@robota-sdk/agent-interface-session 3.0.0-beta.81 → 3.0.0-beta.83

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,336 @@
1
+ # @robota-sdk/agent-interface-session
2
+
3
+ ## 3.0.0-beta.83
4
+
5
+ ### Major Changes
6
+
7
+ - 7b72344: Every client can offer the session's commands and skills and show its status. The GUI uses them as a
8
+ desktop-style composer.
9
+
10
+ - `agent-interface-session` is **`major` because `IInteractiveSession` gains required members**:
11
+ `ISessionCommands.listSkills()` and a `statusRead` capability, `getStatusSnapshot()`. The snapshot
12
+ holds session, model, permission mode, effort, context and goal. An external implementation stops
13
+ compiling until it adds both.
14
+ - `agent-transport` is **`major` for the same reason on `IProtocolSession`**. It also gains the wire
15
+ messages `get-commands` → `commands` and `get-status` → `session_status`. Both are reads that the
16
+ observe role may send.
17
+ - `agent-interface-command` gains `ICommandSkillListEntry`, moved from `agent-framework`, which
18
+ re-exports it unchanged.
19
+ - `agent-ui-web` is **`major` because its state changes shape**:
20
+ - A command's outcome and a finished turn's tool calls are now conversation entries: `messages` is
21
+ `TConversationEntry[]`.
22
+ - The `uiIntentNotices` list, `dismissUiIntentNotice`, `applyUiIntentEvent`,
23
+ `removeUiIntentNotice` and `IUiIntentNotice` are removed. An intent now answers with an info
24
+ line in the conversation.
25
+ - Session notices keep only `session-error` and `protocol-error`.
26
+ - The state gains `commandCatalog` and `sessionStatus`.
27
+ - `agent-command` registers `/theme` and `/keybindings` even without a terminal. They then answer
28
+ that they belong to the robota terminal, instead of being unknown.
29
+ - `agent-framework`:
30
+ - `InteractiveSession.getStatusSnapshot()`.
31
+ - The main-thread row previews the last chat message instead of the last record's type.
32
+ - `agent-cli` serves the full GUI web app, renamed from `agent-cli-web` to `agent-gui-web`, on
33
+ `robota --serve --open`.
34
+
35
+ - 6ae3f28: A served runtime can list its workspace's sessions, start a new one and switch to another without the
36
+ process or any client connection restarting. The GUI shows them in a sessions sidebar.
37
+
38
+ - `agent-interface-session` is **`major`** for two reasons:
39
+ - It adds `ISessionListing`, `ISessionDirectory` and `ISessionSwitchedEvent`.
40
+ - `IInteractiveSessionEvents` gains a required `session_switched` event. An exhaustive map over the
41
+ event names stops compiling until it classifies the new event.
42
+ - `agent-transport` is **`major`** for the same kind of reason:
43
+ - It adds the wire messages `list-sessions` → `sessions`/`sessions_error`, `new-session`,
44
+ `switch-session`, and the broadcast `session_switched`.
45
+ - It adds a `sessionDirectory` handler option. A refusal to switch comes back as a
46
+ `protocol_error` carrying the reason.
47
+ - An exhaustive map over message types must add the new variants.
48
+ - `agent-transport-ws` passes a configured `sessionDirectory` to every connection.
49
+ - `agent-framework` is **`major` because `IRuntimeHostHandle.session` is now a `SessionSlot`**, not the
50
+ `InteractiveSession`, and `bindTransports` receives the slot.
51
+ - The slot is an `IInteractiveSession` that forwards to the current session. Members outside that
52
+ interface are read through `host.session.current`, which changes on a switch.
53
+ - Adds `InteractiveSession.whenInitialized()`.
54
+ - Exports `listUnreadableSessions`.
55
+ - `agent-ui-web` is **`major`**:
56
+ - `IWsSessionState` gains session listing state and actions.
57
+ - It adds a `SessionSidebar`.
58
+ - `/resume` opens the sidebar.
59
+ - `agent-cli`: `robota --serve` provides the session directory, and refuses a switch that would lose
60
+ work in progress. External-event grants belong to the run: a switch reopens them on the new session,
61
+ as the TUI already does.
62
+ - External-event grant history (spent tokens, rate windows, revocations) belongs to the run. The new
63
+ option `externalEventGrantHistory` (from `createExternalEventGrantHistory()`) is shared by every
64
+ session that a served runtime or the TUI builds. A session switch therefore replays no spent token
65
+ and resets no rate limit. The TUI previously had this gap when it switched sessions.
66
+
67
+ - ba822c1: An attached client reads a workspace entry's detail, stops a waiting self-paced loop, completes
68
+ subcommands, and sees status changes another client made.
69
+
70
+ - `agent-interface-session` (major): `IInteractiveSession` gains the required roles
71
+ `ISessionExecutionDetail` and `ISessionSelfPacedLoopControl` (`TWaitingLoopStopOutcome`), and the
72
+ exhaustively mapped event map gains `status_changed`.
73
+ - `agent-transport` (major): `IProtocolSession` gains both roles; the wire unions gain
74
+ `read-execution-detail`, `stop-waiting-loop`, `execution_detail`, `execution_detail_error` and
75
+ `waiting_loop_stop`; `status_changed` is pushed as `session_status`; `isObserverMessageType` is
76
+ exported from the root and `./client`.
77
+ - `agent-interface-command` (minor): `ICommandListEntry` gains optional `argumentHint` and
78
+ `subcommands` (`ICommandSubcommandEntry`).
79
+ - `agent-cli` (minor):
80
+ - `robota session attach` and an attach from `robota session view` open the full terminal UI,
81
+ the one `robota --attach` opens, in drive mode or, with `--observe`, read-only. The reduced
82
+ attached view is gone.
83
+ - A served runtime names each of its sessions after the session's first real turn.
84
+ - `agent-framework` (minor):
85
+ - `InteractiveSession` gains `stopWaitingSelfPacedLoop(reason?)`: it stops the one waiting loop,
86
+ or stops none and names `/loop stop` when several wait. `SessionSlot` forwards it and
87
+ `readExecutionWorkspaceDetail`.
88
+ - The session emits `status_changed` when its mode, model, effort, goal or name changes, after a
89
+ command, a turn, a rename or a goal or plan transition.
90
+ - A new option `autoName: true` makes the session name itself once, after its first turn, with its
91
+ current provider; it keeps a name it already has and lets a rename made meanwhile win. Off by
92
+ default.
93
+ - The command catalog carries each command's `argumentHint` and `subcommands`.
94
+ - `agent-ui-terminal` (major):
95
+ - The full terminal UI attached to a host's session reads a workspace entry's detail, sends input
96
+ to a background task, stops a waiting self-paced loop on Esc, and completes subcommands.
97
+ - `renderAttachedApp` takes `mode: 'drive' | 'observe'` (default `'drive'`) and `announce`. In
98
+ observe mode the terminal sends only what an observer may send, refuses prompts, host commands,
99
+ abort and loop stop with a read-only notice, still runs `/exit` and its own commands, and its
100
+ status bar says it is observing. `ITuiChannelSnapshot` gains `readOnly`.
101
+ - The in-process terminal no longer names sessions; it builds its session with `autoName: true`.
102
+ `ITuiInteractionChannelOptions.onAutoNamed` is removed.
103
+
104
+ - 6e6b06b: A wire client can now render the whole session the way the in-process terminal UI does: the full
105
+ history, the context window as it changes, when the history changes, and where each turn came from.
106
+
107
+ - `agent-interface-session` is **`major`**: `ISessionConversationRead` gains a required
108
+ `getFullHistory()`. Any implementation of it, or of `IInteractiveSession`, must add it.
109
+ - `agent-transport` is **`major`**:
110
+ - It adds `get-history { fromIndex? }` → `history { startIndex, total, entries }`. The history
111
+ crosses one bounded page at a time (at most 256 KiB of entries; a single larger entry is sent
112
+ alone), from `fromIndex` (default 0), so no reply grows with the session. The client asks for
113
+ the next page after the previous one arrived. Entries are `IWireHistoryEntry`: a history entry
114
+ with an ISO 8601 `timestamp`. An observer may send it.
115
+ - `complete` and `interrupted` carry the turn's result without the session's history
116
+ (`TWireExecutionResult`); a client reads the history with `get-history`.
117
+ - It adds `get-prompts`: the host sends the permission and ask prompts still open as the
118
+ `permission_request` / `ask_request` frames that asked them, for a client that attached later.
119
+ An observer may not send it.
120
+ - `pending` gains an optional `pendingCount`: a host sends it when it knows how many prompts are
121
+ queued, and a client that gets none counts the prompt it shows. The host sends `pending` in
122
+ reply to a `submit` once it has taken the prompt, so a prompt queued behind a running turn shows
123
+ as queued.
124
+ - `command` takes an optional `requestId`, which the host echoes on the command's
125
+ `command_result` or `protocol_error`.
126
+ - The session's `context_update` is pushed as the `context` frame that `get-context` answers with.
127
+ - `compact`, `skill_activation` and `memory_event` push the new `history_changed`; the client
128
+ reads the history again.
129
+ - `turn_source` is pushed as the new `turn_source` frame.
130
+ - An exhaustive map over `TClientMessage` or `TServerMessage` types must add the new variants,
131
+ and `IProtocolSession` now requires `getFullHistory()`.
132
+ - `agent-transport-http` is **`major`** only because `IHttpTransportSession` includes the conversation
133
+ read role, so a session handed to it must now provide `getFullHistory()`.
134
+ - `agent-framework`: `SessionSlot` forwards `getFullHistory()` to the current session.
135
+ - `agent-ui-web` receives the new frames and does not render them.
136
+
137
+ ### Minor Changes
138
+
139
+ - 57f57f5: A daemon keeps several sessions live, and each client is bound to its own: one client's switch moves
140
+ only that client.
141
+
142
+ - `agent-interface-session`: `ISessionBinder`/`ISessionBinding`, the session-change refusal codes with
143
+ `isSessionChangeRefusal`, and listing rows that may say `live` and `clients`.
144
+ - `agent-framework`: `SessionPool` and `SessionChangeRefusal`.
145
+ - `agent-transport` (**major**): a new server frame, `session_change_failed`, which an exhaustive
146
+ consumer must handle. A refused `new-session` or `switch-session` now answers with it, carrying a
147
+ `code`, instead of `protocol_error`; both requests take an optional `requestId` that it echoes.
148
+ - `agent-transport-ws`: the `sessionBinder` option binds each connection to its own session and
149
+ releases the binding when the connection closes.
150
+ - `agent-cli`: `robota --serve` and the daemon keep up to four sessions live. Each WebSocket client and
151
+ attached terminal is bound to its own session; leaving a busy session is no longer refused, and only
152
+ the last driver of a session with a pending prompt is kept from leaving it. Grants and the supervised
153
+ name stay on the runtime's first session, and its reported activity covers every live session.
154
+ - `agent-ui-web`: a refused new or switch shows the host's reason as a notice (an older host's
155
+ `protocol_error` still does); the session sidebar marks live sessions and counts the other clients
156
+ on each; after a reconnect to a host that keeps sessions live, the GUI returns to the session it was on.
157
+ - `agent-ui-terminal`: an attached terminal shows why a switch was refused, and the picker's switch
158
+ stays pending until the host answers; the session picker marks live sessions and their clients.
159
+
160
+ ### Patch Changes
161
+
162
+ - 57280bf: Every published package now declares `"engines": { "node": ">=22.12.0" }`. Before, 27 of the 38
163
+ packages declared no floor (`agent-core`, `agent-tools` and every provider among them),
164
+ `agent-session` and `agent-file-authority` declared `>=20.19.0`, and the other nine declared
165
+ `>=22.0.0`, so a consumer on Node 20 saw at most a warning from a transitive dependency.
166
+
167
+ Why 22.12: `agent-cli` and `agent-ui-terminal` need Node 22 through `ink` 7, and the CommonJS entries
168
+ of `agent-tools` and its dependents, `agent-transport`/`node` and its dependents, and
169
+ `agent-ui-terminal` `require()` ESM-only dependencies (`p-limit`, `jose`, `chalk`), which Node 22
170
+ supports unflagged only from 22.12. `engines` is advisory unless the consumer enables `engine-strict`.
171
+
172
+ No code changes: `tsdown` now reads `node22.12.0` as its build target from the field.
173
+
174
+ - 18c0d5c: Every published package now exports `./package.json`, so `require('<package>/package.json')` and
175
+ `import('<package>/package.json', { with: { type: 'json' } })` work instead of failing with
176
+ `ERR_PACKAGE_PATH_NOT_EXPORTED`, and each tarball now ships the package's `CHANGELOG.md`.
177
+ - Updated dependencies [3c81769]
178
+ - Updated dependencies [e689c8e]
179
+ - Updated dependencies [7b72344]
180
+ - Updated dependencies [be0e53c]
181
+ - Updated dependencies [ba822c1]
182
+ - Updated dependencies [9721162]
183
+ - Updated dependencies [8bd5fac]
184
+ - Updated dependencies [57280bf]
185
+ - Updated dependencies [5033dd9]
186
+ - Updated dependencies [18c0d5c]
187
+ - Updated dependencies [dbd888d]
188
+ - Updated dependencies [1887e54]
189
+ - @robota-sdk/agent-interface-analytics@3.0.0-beta.83
190
+ - @robota-sdk/agent-core@3.0.0-beta.83
191
+ - @robota-sdk/agent-interface-command@3.0.0-beta.83
192
+ - @robota-sdk/agent-interface-execution@3.0.0-beta.83
193
+
194
+ ## 3.0.0-beta.82
195
+
196
+ ### Patch Changes
197
+
198
+ - Updated dependencies [c7f9203]
199
+ - @robota-sdk/agent-core@3.0.0-beta.82
200
+ - @robota-sdk/agent-interface-command@3.0.0-beta.82
201
+ - @robota-sdk/agent-interface-execution@3.0.0-beta.82
202
+ - @robota-sdk/agent-interface-analytics@3.0.0-beta.82
203
+
204
+ ## 3.0.0-beta.81
205
+
206
+ ### Minor Changes
207
+
208
+ - 3038eb7: A message from another session is instant messaging: text from an untrusted third party that
209
+ carries no authority. What the model does with it is decided by the session's ordinary permissions —
210
+ rules, permission mode and remembered consent — exactly like the session's own work. The per-origin
211
+ peer policy is gone.
212
+
213
+ **BREAKING**
214
+
215
+ - `agent-core`: `IPermissionEvaluationContext.peerTurn` is now a boolean. It decides only whether a
216
+ `repliesToPeer` tool exists; every other call in a peer turn is decided as in any turn. Removed:
217
+ `isToolAvailableInPeerTurn`, `isSecretPath`, `IPeerTurnAuthority`, `TPeerReach` (now exported by
218
+ `agent-interface-session-mobility`) and `IToolPermissionProfile.workspacePaths`.
219
+ - `agent-tools`: `Read` and `Glob` no longer declare `workspacePaths`.
220
+ - `agent-session`: `ISessionRunOptions.peerReach` is replaced by `peerTurn?: boolean`, and
221
+ `ISessionOptions.allowPeerChanges` is removed. An ask in a peer turn is answered like any other:
222
+ a consent the operator remembered answers it, and an "always allow" given there is remembered.
223
+ - `agent-interface-session`: `IPeerTurnContext` no longer has `reach`; it carries only the reply
224
+ route.
225
+ - `agent-interface-session-mobility`: `peerReachOf` is removed; `TPeerReach` moves here. A delegated
226
+ turn carries no reach.
227
+ - `agent-framework`: the `peers.allowChanges` setting is removed (an existing value is ignored). A
228
+ peer turn is offered the ordinary tools, plus `peer_reply`.
229
+
230
+ **Changes**
231
+
232
+ - `agent-framework`: the per-turn statement tells the model the message is an opinion from an
233
+ untrusted third party, not its owner's instruction, and that it decides for itself whether and how
234
+ to act. A message still expands no `@path` and attaches no context reference, and its requests
235
+ still carry no provider-hosted tool, since no permission step can decide one. The session takes
236
+ at most 6 messages a minute and 30 an hour from each sender for a turn; a message over the limit
237
+ is refused with a reason the sender receives. A prompt answer given in the name of a `peer:` or `external:`
238
+ driver is ignored. External-event turns keep their tool-less baseline.
239
+ - `agent-cli`: incoming peer turns carry only their reply route.
240
+
241
+ ### Patch Changes
242
+
243
+ - Updated dependencies [3038eb7]
244
+ - Updated dependencies [02b7452]
245
+ - Updated dependencies [ec5e477]
246
+ - Updated dependencies [18b52cc]
247
+ - @robota-sdk/agent-core@3.0.0-beta.81
248
+ - @robota-sdk/agent-interface-command@3.0.0-beta.81
249
+ - @robota-sdk/agent-interface-execution@3.0.0-beta.81
250
+ - @robota-sdk/agent-interface-analytics@3.0.0-beta.81
251
+
252
+ ## 3.0.0-beta.80
253
+
254
+ ### Minor Changes
255
+
256
+ - 37b4bd7: `readAssistantReplies`, `readErrors`, `readLastAssistantText` and `readToolCalls` are exported from
257
+ `@robota-sdk/agent-interface-session`, which is now published alongside
258
+ `@robota-sdk/agent-interface-transport` (issue #2260).
259
+
260
+ The four helpers shipped from `agent-interface-transport@3.0.0-beta.79` and moved to the session
261
+ package on `develop` (ARCH-103..108), which was not yet on the registry. A consumer importing them
262
+ from the transport package migrates the import to `@robota-sdk/agent-interface-session`; the session
263
+ package is in the changeset fixed group, so it versions and publishes with the transport package.
264
+
265
+ ### Patch Changes
266
+
267
+ - 4f3c075: Assemble complete, verified package generations before switching build output; preserve the previous generation on build failure and pack only verified regular-file images. Include copied CLI web assets in affected-build ordering and artifact transfer. Preserve the CLI version in managed build paths. Public runtime contracts remain compatible (patch).
268
+ - 07b627f: A local peer can now be answered, and what its turn may do depends on where it runs.
269
+
270
+ - `agent-core`: the permission evaluator takes a peer turn's authority as one more input
271
+ (`IPermissionEvaluationContext.peerTurn`), decided after the deny list and ceiling and before
272
+ bypass and allow rules. A peer on another host uses no tool. A peer on the same host may use an
273
+ inspect-class tool that declares `workspacePaths`, only when every named location resolves inside
274
+ the workspace and is not a credential (`isSecretPath`); write and execute tools are refused unless
275
+ enabled, and then every use asks. A tool declaring `repliesToPeer` exists only in a peer turn and
276
+ asks once the turn used another tool. New: `isToolAvailableInPeerTurn`, `TPeerReach`,
277
+ `IPeerTurnAuthority`. `IRunOptions.withholdHostedTools` leaves a provider's hosted tools out of a
278
+ run's requests (`nativeWebTools` with `false` withholds a hosted tool for one call).
279
+ - `agent-tools`: `Read` and `Glob` declare the arguments that say where they look. `Grep` does not:
280
+ it reads files it was never named, so a peer turn does not get it.
281
+ - `agent-session`: `ISessionRunOptions.peerReach` makes a run a peer turn for the permission policy;
282
+ every ask in it needs a fresh approval, and its requests carry no provider-hosted tool. `ISessionOptions.allowPeerChanges` enables write and execute
283
+ tools for same-host peer turns.
284
+ - `agent-interface-session`: `ISubmitOptions.peer` (`IPeerTurnContext`) carries a peer turn's reach,
285
+ the message it answers and the session a reply goes to.
286
+ - `agent-interface-session-mobility`: `IPeerMessage.inReplyTo` threads a conversation;
287
+ `peerReachOf(admission)` maps admission to a reach.
288
+ - `agent-framework`: a peer turn is offered what its origin allows, and a new `peer_reply` tool
289
+ answers the peer that sent the message, threaded to it. The setting `peers.allowChanges` enables
290
+ write and execute tools for same-host peer turns.
291
+ - `agent-ui-terminal`: a permission prompt in a peer turn names the requesting peer.
292
+ - `agent-cli`: incoming peer turns carry their reach and reply route; a conversation is limited in
293
+ depth and in how often this session answers it, and a reply over a limit is not sent and the
294
+ operator is told.
295
+ - `agent-provider-anthropic`, `agent-provider-openai-compatible` (Qwen): a request whose
296
+ `nativeWebTools` sets a hosted tool to `false` is sent without it.
297
+
298
+ - Updated dependencies [9c19c50]
299
+ - Updated dependencies [7b6234c]
300
+ - Updated dependencies [5307f8a]
301
+ - Updated dependencies [b462ee7]
302
+ - Updated dependencies [4eea54b]
303
+ - Updated dependencies [1698be4]
304
+ - Updated dependencies [d4189b9]
305
+ - Updated dependencies [9edae52]
306
+ - Updated dependencies [4078a72]
307
+ - Updated dependencies [4c73a0b]
308
+ - Updated dependencies [af2f2ad]
309
+ - Updated dependencies [196a900]
310
+ - Updated dependencies [f336838]
311
+ - Updated dependencies [34e50f0]
312
+ - Updated dependencies [722e88a]
313
+ - Updated dependencies [d23c848]
314
+ - Updated dependencies [fec722f]
315
+ - Updated dependencies [2d3b2c0]
316
+ - Updated dependencies [4772067]
317
+ - Updated dependencies [9fbab1b]
318
+ - Updated dependencies [a009f5b]
319
+ - Updated dependencies [4f3c075]
320
+ - Updated dependencies [475e085]
321
+ - Updated dependencies [e477440]
322
+ - Updated dependencies [9dcb5da]
323
+ - Updated dependencies [a95ca85]
324
+ - Updated dependencies [b6d14ce]
325
+ - Updated dependencies [0382a51]
326
+ - Updated dependencies [93d061d]
327
+ - Updated dependencies [39554a1]
328
+ - Updated dependencies [d28430a]
329
+ - Updated dependencies [07b627f]
330
+ - Updated dependencies [d0de5b2]
331
+ - Updated dependencies [d6b9404]
332
+ - Updated dependencies [9814afc]
333
+ - @robota-sdk/agent-interface-execution@3.0.0-beta.80
334
+ - @robota-sdk/agent-interface-command@3.0.0-beta.80
335
+ - @robota-sdk/agent-core@3.0.0-beta.80
336
+ - @robota-sdk/agent-interface-analytics@3.0.0-beta.80
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./session-capability-contracts-D1Oi21Hn.cjs");function t(e){return e.filter(e=>e.type===`assistant-done`).map(e=>e.fullText)}function n(e){return t(e).at(-1)}function r(e){return e.filter(e=>e.type===`tool-call`).map(e=>({id:e.id,name:e.name,args:e.args}))}function i(e){return e.filter(e=>e.type===`error`).map(e=>e.error)}function a(e){return e instanceof Error&&e.name===`TurnNotRunError`}exports.AGENT_DRIVER_ID=`agent`,exports.OWNER_DRIVER_ID=`owner`,exports.SESSION_CAPABILITY_MEMBER_KEYS=e.t,exports.isTurnNotRunError=a,exports.readAssistantReplies=t,exports.readErrors=i,exports.readLastAssistantText=n,exports.readToolCalls=r;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./session-capability-contracts-D-hom_lk.cjs"),t=Object.freeze([`not_available`,`stopping`,`in_progress`,`prompt_pending`,`unknown_session`,`unreadable`,`start_failed`,`limit`,`failed`]);function n(e){return e instanceof Error&&e.name===`SessionChangeRefusal`&&t.includes(e.code)}function r(e){return e.filter(e=>e.type===`assistant-done`).map(e=>e.fullText)}function i(e){return r(e).at(-1)}function a(e){return e.filter(e=>e.type===`tool-call`).map(e=>({id:e.id,name:e.name,args:e.args}))}function o(e){return e.filter(e=>e.type===`error`).map(e=>e.error)}function s(e){return e instanceof Error&&e.name===`TurnNotRunError`}exports.AGENT_DRIVER_ID=`agent`,exports.OWNER_DRIVER_ID=`owner`,exports.SESSION_CAPABILITY_MEMBER_KEYS=e.t,exports.SESSION_CHANGE_REFUSAL_CODES=t,exports.isSessionChangeRefusal=n,exports.isTurnNotRunError=s,exports.readAssistantReplies=r,exports.readErrors=o,exports.readLastAssistantText=i,exports.readToolCalls=a;
@@ -1,15 +1,45 @@
1
- import { $ as TDriverId, A as IGoalEvent, B as TGoalStatus, C as TSessionCapabilityHost, Ct as TCompactTrigger, D as IBranchEvent, E as IAskRequestEvent, F as IPlanApprovalEvent, G as TPlanPhase, H as TInteractiveEventName, I as IPlanArtifact, J as IPeerTurnContext, K as TPlanStepStatus, L as IPlanStep, M as IGoalState, N as IInteractiveSessionEvents, O as IContextFileRefreshedEvent, P as IPermissionRequestEvent, Q as OWNER_DRIVER_ID, R as IPromptResolvedEvent, S as SESSION_CAPABILITY_MEMBER_KEYS, St as ICompactEvent, T as IActiveBranchPointer, U as TInteractivePermissionHandler, V as TGoalStopReason, W as TPermissionResultValue, X as ISubmitOptions, Y as ISessionRenamedEvent, Z as IUiIntentEvent, _ as ISessionPromptResolution, _t as TSkillActivationStatus, a as ISessionBackgroundTasks, at as isTurnNotRunError, b as ISessionTurnSubmission, bt as ISessionLoopState, c as ISessionCommands, ct as IMemoryEvent, d as ISessionEvents, dt as TContextReferenceLoadType, et as IExecutionResult, f as ISessionExecutionState, ft as TContextReferenceStatus, g as ISessionLifecycle, gt as TSkillActivationSource, h as ISessionIdentity, ht as TSkillActivationMode, i as ISessionBackgroundGroups, it as TTurnSource, j as IGoalProgressEntry, k as IDiffLine, l as ISessionConversationRead, lt as IMemoryReference, m as ISessionGoal, mt as TSkillActivationInvocation, n as IInteractiveSessionRecord, nt as ITurnNotRunError, o as ISessionCapabilityHost, ot as IToolSummary, p as ISessionExecutionWorkspace, pt as TMemoryType, q as AGENT_DRIVER_ID, r as ISessionAgentJobs, rt as TTurnNotRunReason, s as ISessionCapabilityMap, st as IContextReferenceItem, t as IInteractiveSession, tt as ITurnHandle, u as ISessionDriverAttribution, ut as ISkillActivationEvent, v as ISessionRuntimeTools, vt as IPromptFileReferenceRecord, w as TSessionCapabilityReadResult, x as ISessionWorkspaceLocation, xt as TSessionLoopPhase, y as ISessionTurnControl, yt as TPromptFileReferenceReason, z as IToolState } from "./session-contracts-BVCzd3uY.cjs";
1
+ import { $ as ISessionRenamedEvent, A as IBranchEvent, At as ISessionListingEntry, B as IPlanStep, C as ISessionTurnSubmission, Ct as TPromptFileReferenceReason, D as TSessionCapabilityReadResult, Dt as IResumableSessionSummary, E as TSessionCapabilityHost, Et as TWaitingLoopStopOutcome, F as IGoalState, G as TGoalStopReason, H as ISessionStatusSnapshot, I as IInteractiveSessionEvents, J as TPermissionResultValue, K as TInteractiveEventName, L as IPermissionRequestEvent, M as IDiffLine, Mt as ICompactEvent, N as IGoalEvent, Nt as TCompactTrigger, O as IActiveBranchPointer, Ot as ISessionDirectory, P as IGoalProgressEntry, Q as IPeerTurnContext, R as IPlanApprovalEvent, S as ISessionTurnControl, St as IPromptFileReferenceRecord, T as SESSION_CAPABILITY_MEMBER_KEYS, Tt as TSessionLoopPhase, U as IToolState, V as IPromptResolvedEvent, W as TGoalStatus, X as TPlanStepStatus, Y as TPlanPhase, Z as AGENT_DRIVER_ID, _ as ISessionLifecycle, _t as TMemoryType, a as ISessionBackgroundTasks, at as ITurnHandle, b as ISessionSelfPacedLoopControl, bt as TSkillActivationSource, c as ISessionCommands, ct as TTurnSource, d as ISessionEvents, dt as IContextReferenceItem, et as ISubmitOptions, f as ISessionExecutionDetail, ft as IMemoryEvent, g as ISessionIdentity, gt as TContextReferenceStatus, h as ISessionGoal, ht as TContextReferenceLoadType, i as ISessionBackgroundGroups, it as IExecutionResult, j as IContextFileRefreshedEvent, jt as ISessionSwitchedEvent, k as IAskRequestEvent, kt as ISessionListing, l as ISessionConversationRead, lt as isTurnNotRunError, m as ISessionExecutionWorkspace, mt as ISkillActivationEvent, n as IInteractiveSessionRecord, nt as OWNER_DRIVER_ID, o as ISessionCapabilityHost, ot as ITurnNotRunError, p as ISessionExecutionState, pt as IMemoryReference, q as TInteractivePermissionHandler, r as ISessionAgentJobs, rt as TDriverId, s as ISessionCapabilityMap, st as TTurnNotRunReason, t as IInteractiveSession, tt as IUiIntentEvent, u as ISessionDriverAttribution, ut as IToolSummary, v as ISessionPromptResolution, vt as TSkillActivationInvocation, w as ISessionWorkspaceLocation, wt as ISessionLoopState, x as ISessionStatusRead, xt as TSkillActivationStatus, y as ISessionRuntimeTools, yt as TSkillActivationMode, z as IPlanArtifact } from "./session-contracts-Cv9Jeiyw.cjs";
2
2
  import { IActionRequest, TActionResponse } from "@robota-sdk/agent-core";
3
- //#region src/session-summary-contracts.d.ts
4
- /** Projection used to render a resume picker. */
5
- interface IResumableSessionSummary {
6
- id: string;
7
- name?: string;
8
- cwd: string;
9
- updatedAt: string;
10
- messageCount: number;
11
- preview: string;
3
+ //#region src/session-binding-contracts.d.ts
4
+ /**
5
+ * What a binding may do. A `drive` binding submits and answers prompts; an `observe` binding only
6
+ * watches. The difference matters when a binding leaves: a prompt pending on the session needs a
7
+ * driver left to answer it.
8
+ */
9
+ type TSessionBindingRole = 'drive' | 'observe';
10
+ /** One client's hold on a session. */
11
+ interface ISessionBinding<TSession = IInteractiveSession> {
12
+ /** The session this client is on, stable across its switches: calls reach whichever is current. */
13
+ readonly session: TSession;
14
+ /**
15
+ * This client's directory. `listSessions().currentSessionId` is the session THIS binding is on, and
16
+ * a switch through it moves this binding alone.
17
+ */
18
+ readonly directory: ISessionDirectory;
19
+ /** The client has gone. A session nobody is bound to may then be shut down once it is idle. */
20
+ release(): void;
21
+ }
22
+ /** Hands each client connection a binding of its own. */
23
+ interface ISessionBinder<TSession = IInteractiveSession> {
24
+ bind(role: TSessionBindingRole): ISessionBinding<TSession>;
12
25
  }
26
+ /** Every reason a session change can be refused, in one place so a wire decoder can check a code. */
27
+ declare const SESSION_CHANGE_REFUSAL_CODES: readonly ["not_available", "stopping", "in_progress", "prompt_pending", "unknown_session", "unreadable", "start_failed", "limit", "failed"];
28
+ /** Why a session change was refused. */
29
+ type TSessionChangeRefusalCode = (typeof SESSION_CHANGE_REFUSAL_CODES)[number];
30
+ /**
31
+ * The error a refused session change carries. A client shows `message` and may branch on `code`; it
32
+ * never has to parse the message to tell a limit from a pending prompt.
33
+ */
34
+ interface ISessionChangeRefusal extends Error {
35
+ readonly name: 'SessionChangeRefusal';
36
+ readonly code: TSessionChangeRefusalCode;
37
+ }
38
+ /**
39
+ * Is this error a declared refusal, or a real failure? A refusal is an outcome to report to the
40
+ * client that asked; anything else should surface as the fault it is.
41
+ */
42
+ declare function isSessionChangeRefusal(value: unknown): value is ISessionChangeRefusal;
13
43
  //#endregion
14
44
  //#region src/session-store-contracts.d.ts
15
45
  /**
@@ -235,5 +265,5 @@ interface ITerminalHandoff {
235
265
  runWithTerminal<T>(fn: () => Promise<T>): Promise<T>;
236
266
  }
237
267
  //#endregion
238
- export { AGENT_DRIVER_ID, type IActiveBranchPointer, type IAgentDriver, type IAskRequestEvent, type IBranchEvent, type ICommandInfo, type ICompactEvent, type IContextFileRefreshedEvent, type IContextReferenceItem, type IDiffLine, type IExecutionResult, type IGoalEvent, type IGoalProgressEntry, type IGoalState, type IInteractionChannel, type IInteractiveSession, type IInteractiveSessionEvents, type IInteractiveSessionRecord, type IInteractiveSessionStore, type IMemoryEvent, type IMemoryReference, type IPeerTurnContext, type IPermissionRequestEvent, type IPlanApprovalEvent, type IPlanArtifact, type IPlanStep, type IPromptFileReferenceRecord, type IPromptHistoryBlock, type IPromptHistoryEntry, type IPromptHistoryReadOptions, type IPromptHistorySource, type IPromptHistoryWriter, type IPromptResolvedEvent, type IResumableSessionSummary, type ISessionAgentJobs, type ISessionBackgroundGroups, type ISessionBackgroundTasks, type ISessionCapabilityHost, type ISessionCapabilityMap, type ISessionCommands, type ISessionConversationRead, type ISessionDriverAttribution, type ISessionEvents, type ISessionExecutionState, type ISessionExecutionWorkspace, type ISessionGoal, type ISessionIdentity, type ISessionLifecycle, type ISessionListEntry, type ISessionLoopState, type ISessionPromptResolution, type ISessionRecordDecodeIssue, type ISessionRenamedEvent, type ISessionRuntimeTools, type ISessionTurnControl, type ISessionTurnSubmission, type ISessionWorkspaceLocation, type ISkillActivationEvent, type ISubmitOptions, type ITerminalHandoff, type IToolCallObservation, type IToolState, type IToolSummary, type ITurnHandle, type ITurnNotRunError, type IUiIntentEvent, type InteractionEvent, OWNER_DRIVER_ID, SESSION_CAPABILITY_MEMBER_KEYS, type TCompactTrigger, type TContextReferenceLoadType, type TContextReferenceStatus, type TDriverId, type TGoalStatus, type TGoalStopReason, type TInteractiveEventName, type TInteractivePermissionHandler, type TMemoryType, type TPermissionResultValue, type TPlanPhase, type TPlanStepStatus, type TPromptFileReferenceReason, type TSessionCapabilityHost, type TSessionCapabilityReadResult, type TSessionLoadOutcome, type TSessionLoopPhase, type TSkillActivationInvocation, type TSkillActivationMode, type TSkillActivationSource, type TSkillActivationStatus, type TTurnNotRunReason, type TTurnSource, isTurnNotRunError, readAssistantReplies, readErrors, readLastAssistantText, readToolCalls };
268
+ export { AGENT_DRIVER_ID, type IActiveBranchPointer, type IAgentDriver, type IAskRequestEvent, type IBranchEvent, type ICommandInfo, type ICompactEvent, type IContextFileRefreshedEvent, type IContextReferenceItem, type IDiffLine, type IExecutionResult, type IGoalEvent, type IGoalProgressEntry, type IGoalState, type IInteractionChannel, type IInteractiveSession, type IInteractiveSessionEvents, type IInteractiveSessionRecord, type IInteractiveSessionStore, type IMemoryEvent, type IMemoryReference, type IPeerTurnContext, type IPermissionRequestEvent, type IPlanApprovalEvent, type IPlanArtifact, type IPlanStep, type IPromptFileReferenceRecord, type IPromptHistoryBlock, type IPromptHistoryEntry, type IPromptHistoryReadOptions, type IPromptHistorySource, type IPromptHistoryWriter, type IPromptResolvedEvent, type IResumableSessionSummary, type ISessionAgentJobs, type ISessionBackgroundGroups, type ISessionBackgroundTasks, type ISessionBinder, type ISessionBinding, type ISessionCapabilityHost, type ISessionCapabilityMap, type ISessionChangeRefusal, type ISessionCommands, type ISessionConversationRead, type ISessionDirectory, type ISessionDriverAttribution, type ISessionEvents, type ISessionExecutionDetail, type ISessionExecutionState, type ISessionExecutionWorkspace, type ISessionGoal, type ISessionIdentity, type ISessionLifecycle, type ISessionListEntry, type ISessionListing, type ISessionListingEntry, type ISessionLoopState, type ISessionPromptResolution, type ISessionRecordDecodeIssue, type ISessionRenamedEvent, type ISessionRuntimeTools, type ISessionSelfPacedLoopControl, type ISessionStatusRead, type ISessionStatusSnapshot, type ISessionSwitchedEvent, type ISessionTurnControl, type ISessionTurnSubmission, type ISessionWorkspaceLocation, type ISkillActivationEvent, type ISubmitOptions, type ITerminalHandoff, type IToolCallObservation, type IToolState, type IToolSummary, type ITurnHandle, type ITurnNotRunError, type IUiIntentEvent, type InteractionEvent, OWNER_DRIVER_ID, SESSION_CAPABILITY_MEMBER_KEYS, SESSION_CHANGE_REFUSAL_CODES, type TCompactTrigger, type TContextReferenceLoadType, type TContextReferenceStatus, type TDriverId, type TGoalStatus, type TGoalStopReason, type TInteractiveEventName, type TInteractivePermissionHandler, type TMemoryType, type TPermissionResultValue, type TPlanPhase, type TPlanStepStatus, type TPromptFileReferenceReason, type TSessionBindingRole, type TSessionCapabilityHost, type TSessionCapabilityReadResult, type TSessionChangeRefusalCode, type TSessionLoadOutcome, type TSessionLoopPhase, type TSkillActivationInvocation, type TSkillActivationMode, type TSkillActivationSource, type TSkillActivationStatus, type TTurnNotRunReason, type TTurnSource, type TWaitingLoopStopOutcome, isSessionChangeRefusal, isTurnNotRunError, readAssistantReplies, readErrors, readLastAssistantText, readToolCalls };
239
269
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/session-summary-contracts.ts","../../src/session-store-contracts.ts","../../src/prompt-history-contracts.ts","../../src/interaction-contracts.ts"],"mappings":";;;;UACiB;EACf;EACA;EACA;EACA;EACA;EACA;;;;;;;;;;;;;UCae;WACN;WACA;;;;;;;;;;;;;;;;;;KAmBC;WACG;WAA0B,QAAQ;;;;WAElC;;;;WAEA;WAA4B,iBAAiB;;;;WAE7C;WAAgC;;;;;;;;;UAS9B;WACN;WACA,SAAS;;;UAIH;EACf,KAAK,SAAS;EACd,KAAK,aAAa;EAClB,iBAAiB;EACjB,OAAO;;;;;;;;;;;UC3DQ;;WAEN;WACA;;WAEA;;WAEA;;;UAIM;EACf,OAAO,OAAO;;;UAIC;WACN,kBAAkB;;WAElB;;UAGM;;WAEN,QAAQ;;;UAIF;EACf,KAAK,SAAS,4BAA4B,cAAc;;;;;KC1B9C;EACN;EAAsB;;EACtB;EAAyB;;EACzB;EAAwB;;EACxB;EAAmB;EAAY;EAAc;;EAC7C;EAAqB;EAAY;EAAc;;EAC/C;EAAwB;EAAc;;EACtC;EAAe,OAAO;;UAEX;EACf;EACA;EACA,cAAc;;UAGC;;EAEf,SAAS,UAAU,iBAAiB;;EAGpC,MAAM,OAAO;;;;;;EAOb,QAAQ,SAAS,iBAAiB,QAAQ;;EAG1C,qBAAqB,UAAU;;EAG/B,QAAQ;EAER,SAAS;EACT,QAAQ;;;UAIO;EACf;EACA;EACA;;;;;;;;;;;;;;UAee;;EAEf,SAAS;;;;;EAKT,KAAK,eAAe;;EAEpB,gBAAgB,UAAU;;WAEjB,iBAAiB;;EAE1B;;EAEA;;EAEA,aAAa;;EAEb,UAAU;;EAEV,QAAQ;;;iBAQM,qBAAqB,iBAAiB;;iBAUtC,sBAAsB,iBAAiB;;iBAKvC,cAAc,iBAAiB,qBAAqB;;iBAOpD,WAAW,iBAAiB,qBAAqB;;;;;;;;;;UAehD;;WAEN;;;;;;EAOT,gBAAgB,GAAG,UAAU,QAAQ,KAAK,QAAQ"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/session-binding-contracts.ts","../../src/session-store-contracts.ts","../../src/prompt-history-contracts.ts","../../src/interaction-contracts.ts"],"mappings":";;;;;;;;KAoBY;;UAGK,gBAAgB,WAAW;;WAEjC,SAAS;;;;;WAKT,WAAW;;EAEpB;;;UAIe,eAAe,WAAW;EACzC,KAAK,MAAM,sBAAsB,gBAAgB;;;cAItC;;KAsBD,oCAAoC;;;;;UAM/B,8BAA8B;WACpC;WACA,MAAM;;;;;;iBAOD,uBAAuB,iBAAiB,SAAS;;;;;;;;;;;;UC1DhD;WACN;WACA;;;;;;;;;;;;;;;;;;KAmBC;WACG;WAA0B,QAAQ;;;;WAElC;;;;WAEA;WAA4B,iBAAiB;;;;WAE7C;WAAgC;;;;;;;;;UAS9B;WACN;WACA,SAAS;;;UAIH;EACf,KAAK,SAAS;EACd,KAAK,aAAa;EAClB,iBAAiB;EACjB,OAAO;;;;;;;;;;;UC3DQ;;WAEN;WACA;;WAEA;;WAEA;;;UAIM;EACf,OAAO,OAAO;;;UAIC;WACN,kBAAkB;;WAElB;;UAGM;;WAEN,QAAQ;;;UAIF;EACf,KAAK,SAAS,4BAA4B,cAAc;;;;;KC1B9C;EACN;EAAsB;;EACtB;EAAyB;;EACzB;EAAwB;;EACxB;EAAmB;EAAY;EAAc;;EAC7C;EAAqB;EAAY;EAAc;;EAC/C;EAAwB;EAAc;;EACtC;EAAe,OAAO;;UAEX;EACf;EACA;EACA,cAAc;;UAGC;;EAEf,SAAS,UAAU,iBAAiB;;EAGpC,MAAM,OAAO;;;;;;EAOb,QAAQ,SAAS,iBAAiB,QAAQ;;EAG1C,qBAAqB,UAAU;;EAG/B,QAAQ;EAER,SAAS;EACT,QAAQ;;;UAIO;EACf;EACA;EACA;;;;;;;;;;;;;;UAee;;EAEf,SAAS;;;;;EAKT,KAAK,eAAe;;EAEpB,gBAAgB,UAAU;;WAEjB,iBAAiB;;EAE1B;;EAEA;;EAEA,aAAa;;EAEb,UAAU;;EAEV,QAAQ;;;iBAQM,qBAAqB,iBAAiB;;iBAUtC,sBAAsB,iBAAiB;;iBAKvC,cAAc,iBAAiB,qBAAqB;;iBAOpD,WAAW,iBAAiB,qBAAqB;;;;;;;;;;UAehD;;WAEN;;;;;;EAOT,gBAAgB,GAAG,UAAU,QAAQ,KAAK,QAAQ"}
@@ -1,15 +1,45 @@
1
- import { $ as TDriverId, A as IGoalEvent, B as TGoalStatus, C as TSessionCapabilityHost, Ct as TCompactTrigger, D as IBranchEvent, E as IAskRequestEvent, F as IPlanApprovalEvent, G as TPlanPhase, H as TInteractiveEventName, I as IPlanArtifact, J as IPeerTurnContext, K as TPlanStepStatus, L as IPlanStep, M as IGoalState, N as IInteractiveSessionEvents, O as IContextFileRefreshedEvent, P as IPermissionRequestEvent, Q as OWNER_DRIVER_ID, R as IPromptResolvedEvent, S as SESSION_CAPABILITY_MEMBER_KEYS, St as ICompactEvent, T as IActiveBranchPointer, U as TInteractivePermissionHandler, V as TGoalStopReason, W as TPermissionResultValue, X as ISubmitOptions, Y as ISessionRenamedEvent, Z as IUiIntentEvent, _ as ISessionPromptResolution, _t as TSkillActivationStatus, a as ISessionBackgroundTasks, at as isTurnNotRunError, b as ISessionTurnSubmission, bt as ISessionLoopState, c as ISessionCommands, ct as IMemoryEvent, d as ISessionEvents, dt as TContextReferenceLoadType, et as IExecutionResult, f as ISessionExecutionState, ft as TContextReferenceStatus, g as ISessionLifecycle, gt as TSkillActivationSource, h as ISessionIdentity, ht as TSkillActivationMode, i as ISessionBackgroundGroups, it as TTurnSource, j as IGoalProgressEntry, k as IDiffLine, l as ISessionConversationRead, lt as IMemoryReference, m as ISessionGoal, mt as TSkillActivationInvocation, n as IInteractiveSessionRecord, nt as ITurnNotRunError, o as ISessionCapabilityHost, ot as IToolSummary, p as ISessionExecutionWorkspace, pt as TMemoryType, q as AGENT_DRIVER_ID, r as ISessionAgentJobs, rt as TTurnNotRunReason, s as ISessionCapabilityMap, st as IContextReferenceItem, t as IInteractiveSession, tt as ITurnHandle, u as ISessionDriverAttribution, ut as ISkillActivationEvent, v as ISessionRuntimeTools, vt as IPromptFileReferenceRecord, w as TSessionCapabilityReadResult, x as ISessionWorkspaceLocation, xt as TSessionLoopPhase, y as ISessionTurnControl, yt as TPromptFileReferenceReason, z as IToolState } from "./session-contracts-BVCzd3uY.js";
1
+ import { $ as ISessionRenamedEvent, A as IBranchEvent, At as ISessionListingEntry, B as IPlanStep, C as ISessionTurnSubmission, Ct as TPromptFileReferenceReason, D as TSessionCapabilityReadResult, Dt as IResumableSessionSummary, E as TSessionCapabilityHost, Et as TWaitingLoopStopOutcome, F as IGoalState, G as TGoalStopReason, H as ISessionStatusSnapshot, I as IInteractiveSessionEvents, J as TPermissionResultValue, K as TInteractiveEventName, L as IPermissionRequestEvent, M as IDiffLine, Mt as ICompactEvent, N as IGoalEvent, Nt as TCompactTrigger, O as IActiveBranchPointer, Ot as ISessionDirectory, P as IGoalProgressEntry, Q as IPeerTurnContext, R as IPlanApprovalEvent, S as ISessionTurnControl, St as IPromptFileReferenceRecord, T as SESSION_CAPABILITY_MEMBER_KEYS, Tt as TSessionLoopPhase, U as IToolState, V as IPromptResolvedEvent, W as TGoalStatus, X as TPlanStepStatus, Y as TPlanPhase, Z as AGENT_DRIVER_ID, _ as ISessionLifecycle, _t as TMemoryType, a as ISessionBackgroundTasks, at as ITurnHandle, b as ISessionSelfPacedLoopControl, bt as TSkillActivationSource, c as ISessionCommands, ct as TTurnSource, d as ISessionEvents, dt as IContextReferenceItem, et as ISubmitOptions, f as ISessionExecutionDetail, ft as IMemoryEvent, g as ISessionIdentity, gt as TContextReferenceStatus, h as ISessionGoal, ht as TContextReferenceLoadType, i as ISessionBackgroundGroups, it as IExecutionResult, j as IContextFileRefreshedEvent, jt as ISessionSwitchedEvent, k as IAskRequestEvent, kt as ISessionListing, l as ISessionConversationRead, lt as isTurnNotRunError, m as ISessionExecutionWorkspace, mt as ISkillActivationEvent, n as IInteractiveSessionRecord, nt as OWNER_DRIVER_ID, o as ISessionCapabilityHost, ot as ITurnNotRunError, p as ISessionExecutionState, pt as IMemoryReference, q as TInteractivePermissionHandler, r as ISessionAgentJobs, rt as TDriverId, s as ISessionCapabilityMap, st as TTurnNotRunReason, t as IInteractiveSession, tt as IUiIntentEvent, u as ISessionDriverAttribution, ut as IToolSummary, v as ISessionPromptResolution, vt as TSkillActivationInvocation, w as ISessionWorkspaceLocation, wt as ISessionLoopState, x as ISessionStatusRead, xt as TSkillActivationStatus, y as ISessionRuntimeTools, yt as TSkillActivationMode, z as IPlanArtifact } from "./session-contracts-Cv9Jeiyw.js";
2
2
  import { IActionRequest, TActionResponse } from "@robota-sdk/agent-core";
3
- //#region src/session-summary-contracts.d.ts
4
- /** Projection used to render a resume picker. */
5
- interface IResumableSessionSummary {
6
- id: string;
7
- name?: string;
8
- cwd: string;
9
- updatedAt: string;
10
- messageCount: number;
11
- preview: string;
3
+ //#region src/session-binding-contracts.d.ts
4
+ /**
5
+ * What a binding may do. A `drive` binding submits and answers prompts; an `observe` binding only
6
+ * watches. The difference matters when a binding leaves: a prompt pending on the session needs a
7
+ * driver left to answer it.
8
+ */
9
+ type TSessionBindingRole = 'drive' | 'observe';
10
+ /** One client's hold on a session. */
11
+ interface ISessionBinding<TSession = IInteractiveSession> {
12
+ /** The session this client is on, stable across its switches: calls reach whichever is current. */
13
+ readonly session: TSession;
14
+ /**
15
+ * This client's directory. `listSessions().currentSessionId` is the session THIS binding is on, and
16
+ * a switch through it moves this binding alone.
17
+ */
18
+ readonly directory: ISessionDirectory;
19
+ /** The client has gone. A session nobody is bound to may then be shut down once it is idle. */
20
+ release(): void;
21
+ }
22
+ /** Hands each client connection a binding of its own. */
23
+ interface ISessionBinder<TSession = IInteractiveSession> {
24
+ bind(role: TSessionBindingRole): ISessionBinding<TSession>;
12
25
  }
26
+ /** Every reason a session change can be refused, in one place so a wire decoder can check a code. */
27
+ declare const SESSION_CHANGE_REFUSAL_CODES: readonly ["not_available", "stopping", "in_progress", "prompt_pending", "unknown_session", "unreadable", "start_failed", "limit", "failed"];
28
+ /** Why a session change was refused. */
29
+ type TSessionChangeRefusalCode = (typeof SESSION_CHANGE_REFUSAL_CODES)[number];
30
+ /**
31
+ * The error a refused session change carries. A client shows `message` and may branch on `code`; it
32
+ * never has to parse the message to tell a limit from a pending prompt.
33
+ */
34
+ interface ISessionChangeRefusal extends Error {
35
+ readonly name: 'SessionChangeRefusal';
36
+ readonly code: TSessionChangeRefusalCode;
37
+ }
38
+ /**
39
+ * Is this error a declared refusal, or a real failure? A refusal is an outcome to report to the
40
+ * client that asked; anything else should surface as the fault it is.
41
+ */
42
+ declare function isSessionChangeRefusal(value: unknown): value is ISessionChangeRefusal;
13
43
  //#endregion
14
44
  //#region src/session-store-contracts.d.ts
15
45
  /**
@@ -235,5 +265,5 @@ interface ITerminalHandoff {
235
265
  runWithTerminal<T>(fn: () => Promise<T>): Promise<T>;
236
266
  }
237
267
  //#endregion
238
- export { AGENT_DRIVER_ID, type IActiveBranchPointer, type IAgentDriver, type IAskRequestEvent, type IBranchEvent, type ICommandInfo, type ICompactEvent, type IContextFileRefreshedEvent, type IContextReferenceItem, type IDiffLine, type IExecutionResult, type IGoalEvent, type IGoalProgressEntry, type IGoalState, type IInteractionChannel, type IInteractiveSession, type IInteractiveSessionEvents, type IInteractiveSessionRecord, type IInteractiveSessionStore, type IMemoryEvent, type IMemoryReference, type IPeerTurnContext, type IPermissionRequestEvent, type IPlanApprovalEvent, type IPlanArtifact, type IPlanStep, type IPromptFileReferenceRecord, type IPromptHistoryBlock, type IPromptHistoryEntry, type IPromptHistoryReadOptions, type IPromptHistorySource, type IPromptHistoryWriter, type IPromptResolvedEvent, type IResumableSessionSummary, type ISessionAgentJobs, type ISessionBackgroundGroups, type ISessionBackgroundTasks, type ISessionCapabilityHost, type ISessionCapabilityMap, type ISessionCommands, type ISessionConversationRead, type ISessionDriverAttribution, type ISessionEvents, type ISessionExecutionState, type ISessionExecutionWorkspace, type ISessionGoal, type ISessionIdentity, type ISessionLifecycle, type ISessionListEntry, type ISessionLoopState, type ISessionPromptResolution, type ISessionRecordDecodeIssue, type ISessionRenamedEvent, type ISessionRuntimeTools, type ISessionTurnControl, type ISessionTurnSubmission, type ISessionWorkspaceLocation, type ISkillActivationEvent, type ISubmitOptions, type ITerminalHandoff, type IToolCallObservation, type IToolState, type IToolSummary, type ITurnHandle, type ITurnNotRunError, type IUiIntentEvent, type InteractionEvent, OWNER_DRIVER_ID, SESSION_CAPABILITY_MEMBER_KEYS, type TCompactTrigger, type TContextReferenceLoadType, type TContextReferenceStatus, type TDriverId, type TGoalStatus, type TGoalStopReason, type TInteractiveEventName, type TInteractivePermissionHandler, type TMemoryType, type TPermissionResultValue, type TPlanPhase, type TPlanStepStatus, type TPromptFileReferenceReason, type TSessionCapabilityHost, type TSessionCapabilityReadResult, type TSessionLoadOutcome, type TSessionLoopPhase, type TSkillActivationInvocation, type TSkillActivationMode, type TSkillActivationSource, type TSkillActivationStatus, type TTurnNotRunReason, type TTurnSource, isTurnNotRunError, readAssistantReplies, readErrors, readLastAssistantText, readToolCalls };
268
+ export { AGENT_DRIVER_ID, type IActiveBranchPointer, type IAgentDriver, type IAskRequestEvent, type IBranchEvent, type ICommandInfo, type ICompactEvent, type IContextFileRefreshedEvent, type IContextReferenceItem, type IDiffLine, type IExecutionResult, type IGoalEvent, type IGoalProgressEntry, type IGoalState, type IInteractionChannel, type IInteractiveSession, type IInteractiveSessionEvents, type IInteractiveSessionRecord, type IInteractiveSessionStore, type IMemoryEvent, type IMemoryReference, type IPeerTurnContext, type IPermissionRequestEvent, type IPlanApprovalEvent, type IPlanArtifact, type IPlanStep, type IPromptFileReferenceRecord, type IPromptHistoryBlock, type IPromptHistoryEntry, type IPromptHistoryReadOptions, type IPromptHistorySource, type IPromptHistoryWriter, type IPromptResolvedEvent, type IResumableSessionSummary, type ISessionAgentJobs, type ISessionBackgroundGroups, type ISessionBackgroundTasks, type ISessionBinder, type ISessionBinding, type ISessionCapabilityHost, type ISessionCapabilityMap, type ISessionChangeRefusal, type ISessionCommands, type ISessionConversationRead, type ISessionDirectory, type ISessionDriverAttribution, type ISessionEvents, type ISessionExecutionDetail, type ISessionExecutionState, type ISessionExecutionWorkspace, type ISessionGoal, type ISessionIdentity, type ISessionLifecycle, type ISessionListEntry, type ISessionListing, type ISessionListingEntry, type ISessionLoopState, type ISessionPromptResolution, type ISessionRecordDecodeIssue, type ISessionRenamedEvent, type ISessionRuntimeTools, type ISessionSelfPacedLoopControl, type ISessionStatusRead, type ISessionStatusSnapshot, type ISessionSwitchedEvent, type ISessionTurnControl, type ISessionTurnSubmission, type ISessionWorkspaceLocation, type ISkillActivationEvent, type ISubmitOptions, type ITerminalHandoff, type IToolCallObservation, type IToolState, type IToolSummary, type ITurnHandle, type ITurnNotRunError, type IUiIntentEvent, type InteractionEvent, OWNER_DRIVER_ID, SESSION_CAPABILITY_MEMBER_KEYS, SESSION_CHANGE_REFUSAL_CODES, type TCompactTrigger, type TContextReferenceLoadType, type TContextReferenceStatus, type TDriverId, type TGoalStatus, type TGoalStopReason, type TInteractiveEventName, type TInteractivePermissionHandler, type TMemoryType, type TPermissionResultValue, type TPlanPhase, type TPlanStepStatus, type TPromptFileReferenceReason, type TSessionBindingRole, type TSessionCapabilityHost, type TSessionCapabilityReadResult, type TSessionChangeRefusalCode, type TSessionLoadOutcome, type TSessionLoopPhase, type TSkillActivationInvocation, type TSkillActivationMode, type TSkillActivationSource, type TSkillActivationStatus, type TTurnNotRunReason, type TTurnSource, type TWaitingLoopStopOutcome, isSessionChangeRefusal, isTurnNotRunError, readAssistantReplies, readErrors, readLastAssistantText, readToolCalls };
239
269
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/session-summary-contracts.ts","../../src/session-store-contracts.ts","../../src/prompt-history-contracts.ts","../../src/interaction-contracts.ts"],"mappings":";;;;UACiB;EACf;EACA;EACA;EACA;EACA;EACA;;;;;;;;;;;;;UCae;WACN;WACA;;;;;;;;;;;;;;;;;;KAmBC;WACG;WAA0B,QAAQ;;;;WAElC;;;;WAEA;WAA4B,iBAAiB;;;;WAE7C;WAAgC;;;;;;;;;UAS9B;WACN;WACA,SAAS;;;UAIH;EACf,KAAK,SAAS;EACd,KAAK,aAAa;EAClB,iBAAiB;EACjB,OAAO;;;;;;;;;;;UC3DQ;;WAEN;WACA;;WAEA;;WAEA;;;UAIM;EACf,OAAO,OAAO;;;UAIC;WACN,kBAAkB;;WAElB;;UAGM;;WAEN,QAAQ;;;UAIF;EACf,KAAK,SAAS,4BAA4B,cAAc;;;;;KC1B9C;EACN;EAAsB;;EACtB;EAAyB;;EACzB;EAAwB;;EACxB;EAAmB;EAAY;EAAc;;EAC7C;EAAqB;EAAY;EAAc;;EAC/C;EAAwB;EAAc;;EACtC;EAAe,OAAO;;UAEX;EACf;EACA;EACA,cAAc;;UAGC;;EAEf,SAAS,UAAU,iBAAiB;;EAGpC,MAAM,OAAO;;;;;;EAOb,QAAQ,SAAS,iBAAiB,QAAQ;;EAG1C,qBAAqB,UAAU;;EAG/B,QAAQ;EAER,SAAS;EACT,QAAQ;;;UAIO;EACf;EACA;EACA;;;;;;;;;;;;;;UAee;;EAEf,SAAS;;;;;EAKT,KAAK,eAAe;;EAEpB,gBAAgB,UAAU;;WAEjB,iBAAiB;;EAE1B;;EAEA;;EAEA,aAAa;;EAEb,UAAU;;EAEV,QAAQ;;;iBAQM,qBAAqB,iBAAiB;;iBAUtC,sBAAsB,iBAAiB;;iBAKvC,cAAc,iBAAiB,qBAAqB;;iBAOpD,WAAW,iBAAiB,qBAAqB;;;;;;;;;;UAehD;;WAEN;;;;;;EAOT,gBAAgB,GAAG,UAAU,QAAQ,KAAK,QAAQ"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/session-binding-contracts.ts","../../src/session-store-contracts.ts","../../src/prompt-history-contracts.ts","../../src/interaction-contracts.ts"],"mappings":";;;;;;;;KAoBY;;UAGK,gBAAgB,WAAW;;WAEjC,SAAS;;;;;WAKT,WAAW;;EAEpB;;;UAIe,eAAe,WAAW;EACzC,KAAK,MAAM,sBAAsB,gBAAgB;;;cAItC;;KAsBD,oCAAoC;;;;;UAM/B,8BAA8B;WACpC;WACA,MAAM;;;;;;iBAOD,uBAAuB,iBAAiB,SAAS;;;;;;;;;;;;UC1DhD;WACN;WACA;;;;;;;;;;;;;;;;;;KAmBC;WACG;WAA0B,QAAQ;;;;WAElC;;;;WAEA;WAA4B,iBAAiB;;;;WAE7C;WAAgC;;;;;;;;;UAS9B;WACN;WACA,SAAS;;;UAIH;EACf,KAAK,SAAS;EACd,KAAK,aAAa;EAClB,iBAAiB;EACjB,OAAO;;;;;;;;;;;UC3DQ;;WAEN;WACA;;WAEA;;WAEA;;;UAIM;EACf,OAAO,OAAO;;;UAIC;WACN,kBAAkB;;WAElB;;UAGM;;WAEN,QAAQ;;;UAIF;EACf,KAAK,SAAS,4BAA4B,cAAc;;;;;KC1B9C;EACN;EAAsB;;EACtB;EAAyB;;EACzB;EAAwB;;EACxB;EAAmB;EAAY;EAAc;;EAC7C;EAAqB;EAAY;EAAc;;EAC/C;EAAwB;EAAc;;EACtC;EAAe,OAAO;;UAEX;EACf;EACA;EACA,cAAc;;UAGC;;EAEf,SAAS,UAAU,iBAAiB;;EAGpC,MAAM,OAAO;;;;;;EAOb,QAAQ,SAAS,iBAAiB,QAAQ;;EAG1C,qBAAqB,UAAU;;EAG/B,QAAQ;EAER,SAAS;EACT,QAAQ;;;UAIO;EACf;EACA;EACA;;;;;;;;;;;;;;UAee;;EAEf,SAAS;;;;;EAKT,KAAK,eAAe;;EAEpB,gBAAgB,UAAU;;WAEjB,iBAAiB;;EAE1B;;EAEA;;EAEA,aAAa;;EAEb,UAAU;;EAEV,QAAQ;;;iBAQM,qBAAqB,iBAAiB;;iBAUtC,sBAAsB,iBAAiB;;iBAKvC,cAAc,iBAAiB,qBAAqB;;iBAOpD,WAAW,iBAAiB,qBAAqB;;;;;;;;;;UAehD;;WAEN;;;;;;EAOT,gBAAgB,GAAG,UAAU,QAAQ,KAAK,QAAQ"}
@@ -1,2 +1,2 @@
1
- import{t as e}from"./session-capability-contracts-LonmBQKB.js";const t=`owner`,n=`agent`;function r(e){return e.filter(e=>e.type===`assistant-done`).map(e=>e.fullText)}function i(e){return r(e).at(-1)}function a(e){return e.filter(e=>e.type===`tool-call`).map(e=>({id:e.id,name:e.name,args:e.args}))}function o(e){return e.filter(e=>e.type===`error`).map(e=>e.error)}function s(e){return e instanceof Error&&e.name===`TurnNotRunError`}export{n as AGENT_DRIVER_ID,t as OWNER_DRIVER_ID,e as SESSION_CAPABILITY_MEMBER_KEYS,s as isTurnNotRunError,r as readAssistantReplies,o as readErrors,i as readLastAssistantText,a as readToolCalls};
1
+ import{t as e}from"./session-capability-contracts-CKIDmkEQ.js";const t=Object.freeze([`not_available`,`stopping`,`in_progress`,`prompt_pending`,`unknown_session`,`unreadable`,`start_failed`,`limit`,`failed`]);function n(e){return e instanceof Error&&e.name===`SessionChangeRefusal`&&t.includes(e.code)}const r=`owner`,i=`agent`;function a(e){return e.filter(e=>e.type===`assistant-done`).map(e=>e.fullText)}function o(e){return a(e).at(-1)}function s(e){return e.filter(e=>e.type===`tool-call`).map(e=>({id:e.id,name:e.name,args:e.args}))}function c(e){return e.filter(e=>e.type===`error`).map(e=>e.error)}function l(e){return e instanceof Error&&e.name===`TurnNotRunError`}export{i as AGENT_DRIVER_ID,r as OWNER_DRIVER_ID,e as SESSION_CAPABILITY_MEMBER_KEYS,t as SESSION_CHANGE_REFUSAL_CODES,n as isSessionChangeRefusal,l as isTurnNotRunError,a as readAssistantReplies,c as readErrors,o as readLastAssistantText,s as readToolCalls};
2
2
  //# sourceMappingURL=index.js.map