--- a/dsh-client-runtime/lib/client.js +++ b/dsh-client-runtime/lib/client.js @@ -0,0 +0,0 @@ this.subscribedLastSeq = frame.lastSeq; if (this.queueMirror.reset()) this.notifier.markDirty(); return; + case "session/reload": + this.resync(); + return; case "approval/requested": { const { type: _type, sessionId: _sid, ...payload } = frame; this.mint(new PendingWait("approval", rpcId, this.sessionId, payload, (m) => this.api.respond(m))); @@ -0,0 +0,0 @@ return transportError(error); } } + /** Contract session.truncate; discard atSeq and everything after from this session log. */ + async truncate(opts) { + try { + const sessionId = opts.sessionId ?? this.selected; + const { result } = await this.api.sessions.truncate({ + sessionId, + atSeq: opts.atSeq + }); + return result; + } catch (error) { + return transportError(error); + } + } /** * Insert-or-enrich a locally synthesized summary: a new id prepends; an * existing entry only gains fields it lacks (the session-added frame and the @@ -0,0 +0,0 @@ return this.resolve(id)?.binding; } /** + * Contract session.truncate; discard atSeq and everything after from this session log. + * SessionRuntime itself has no wire client; delegate to the object-layer manager + * (which holds this.api + this.selected) and let it forward to the per-session runtime. + * @param opts - target session (default current) and the event seq anchoring the cut. + */ + async truncate(opts) { + try { + return await this.manager.truncate(opts); + } catch (error) { + return transportError(error); + } + } + /** * Resolve one session's render-layer standard-props bundle (ctx never * enters the render layer; the renderer subscribes to * {@link SessionRuntime.currentProvideInfo}). Pure resolution — render-safe: