@robota-sdk/agent-transport 3.0.0-beta.100

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.
Files changed (93) hide show
  1. package/CHANGELOG.md +1137 -0
  2. package/LICENSE +661 -0
  3. package/README.md +121 -0
  4. package/dist/browser/client.d.ts +2 -0
  5. package/dist/browser/client.js +1 -0
  6. package/dist/browser/index.d.ts +624 -0
  7. package/dist/browser/index.d.ts.map +1 -0
  8. package/dist/browser/index.js +2 -0
  9. package/dist/browser/index.js.map +1 -0
  10. package/dist/browser/observer-messages-4fRQZU2D.d.ts +499 -0
  11. package/dist/browser/observer-messages-4fRQZU2D.d.ts.map +1 -0
  12. package/dist/browser/observer-messages-O8jTPEQO.js +2 -0
  13. package/dist/browser/observer-messages-O8jTPEQO.js.map +1 -0
  14. package/dist/node/index.cjs +1 -0
  15. package/dist/node/index.d.cts +1115 -0
  16. package/dist/node/index.d.cts.map +1 -0
  17. package/dist/node/index.d.ts +1115 -0
  18. package/dist/node/index.d.ts.map +1 -0
  19. package/dist/node/index.js +2 -0
  20. package/dist/node/index.js.map +1 -0
  21. package/dist/node/node.cjs +1 -0
  22. package/dist/node/node.d.cts +317 -0
  23. package/dist/node/node.d.cts.map +1 -0
  24. package/dist/node/node.d.ts +317 -0
  25. package/dist/node/node.d.ts.map +1 -0
  26. package/dist/node/node.js +2 -0
  27. package/dist/node/node.js.map +1 -0
  28. package/package.json +122 -0
  29. package/src/__tests__/__fixtures__/korean-text.json +6 -0
  30. package/src/__tests__/access-token-verifier.test.ts +672 -0
  31. package/src/__tests__/admission.test.ts +130 -0
  32. package/src/__tests__/app-tool-messages.test.ts +463 -0
  33. package/src/__tests__/bearer-resource-gate.test.ts +120 -0
  34. package/src/__tests__/channel-frames.test.ts +215 -0
  35. package/src/__tests__/driver-attribution-capability.test.ts +83 -0
  36. package/src/__tests__/file-transfer.test.ts +281 -0
  37. package/src/__tests__/handoff-chunking.test.ts +261 -0
  38. package/src/__tests__/handoff-manifest.test.ts +52 -0
  39. package/src/__tests__/history-attached-budget.test.ts +216 -0
  40. package/src/__tests__/message-decoders.test.ts +870 -0
  41. package/src/__tests__/outbound-delivery.test.ts +558 -0
  42. package/src/__tests__/peer-message-ledger.test.ts +200 -0
  43. package/src/__tests__/permission-summary.test.ts +18 -0
  44. package/src/__tests__/personal-usage-report.test.ts +193 -0
  45. package/src/__tests__/project-read-messages.test.ts +118 -0
  46. package/src/__tests__/resume-buffer.test.ts +93 -0
  47. package/src/__tests__/session-detail-loop-status.test.ts +169 -0
  48. package/src/__tests__/session-directory-messages.test.ts +322 -0
  49. package/src/__tests__/session-error-classification.test.ts +113 -0
  50. package/src/__tests__/session-event-delivery.test.ts +101 -0
  51. package/src/__tests__/session-history-wire.test.ts +364 -0
  52. package/src/__tests__/session-message-handler-e5.test.ts +99 -0
  53. package/src/__tests__/session-message-handler-observe.test.ts +223 -0
  54. package/src/__tests__/session-message-handler.test.ts +726 -0
  55. package/src/__tests__/session-resume-bridge.test.ts +472 -0
  56. package/src/__tests__/settings-messages.test.ts +193 -0
  57. package/src/__tests__/stdio-carrier.test.ts +85 -0
  58. package/src/__tests__/submit-prompt-shape.test.ts +78 -0
  59. package/src/__tests__/usage-report-carrier.test.ts +98 -0
  60. package/src/__tests__/ws-broadcast-events.test.ts +94 -0
  61. package/src/app-tool-messages.ts +140 -0
  62. package/src/background-messages.ts +169 -0
  63. package/src/channel-frames.ts +182 -0
  64. package/src/client.ts +17 -0
  65. package/src/handoff-chunking.ts +275 -0
  66. package/src/index.ts +135 -0
  67. package/src/loop-control-messages.ts +34 -0
  68. package/src/message-decoders.ts +485 -0
  69. package/src/message-parser.ts +33 -0
  70. package/src/node/access-token-verifier.ts +363 -0
  71. package/src/node/admission.ts +153 -0
  72. package/src/node/bearer-resource-gate.ts +331 -0
  73. package/src/node/file-transfer.ts +530 -0
  74. package/src/node/handoff-manifest.ts +77 -0
  75. package/src/node/index.ts +45 -0
  76. package/src/node/stdio-carrier.ts +59 -0
  77. package/src/observer-messages.ts +47 -0
  78. package/src/open-prompts.ts +76 -0
  79. package/src/outbound-delivery.ts +240 -0
  80. package/src/peer-message-ledger.ts +193 -0
  81. package/src/permission-summary.ts +18 -0
  82. package/src/project-read-messages.ts +74 -0
  83. package/src/protocol-session.ts +56 -0
  84. package/src/resume-buffer.ts +123 -0
  85. package/src/session-directory-messages.ts +162 -0
  86. package/src/session-error-classification.ts +91 -0
  87. package/src/session-events.ts +290 -0
  88. package/src/session-message-handler.ts +413 -0
  89. package/src/session-query-messages.ts +160 -0
  90. package/src/session-resume-bridge.ts +275 -0
  91. package/src/settings-messages.ts +103 -0
  92. package/src/usage-messages.ts +195 -0
  93. package/src/wire-messages.ts +436 -0
@@ -0,0 +1,624 @@
1
+ import { a as decodeFrame, c as IWireHistoryEntry, d as TServerMessage, f as TWireExecutionResult, i as decodeClientMessage, l as TClientMessage, n as MAX_INBOUND_FRAME_BYTES, o as decodeServerMessage, r as TMessageDecodeResult, s as IWireAgentDefinitionSummary, t as isObserverMessageType, u as TSeqServerMessage } from "./observer-messages-4fRQZU2D.js";
2
+ import { ISessionAgentJobs, ISessionBackgroundGroups, ISessionBackgroundTasks, ISessionCommands, ISessionConversationRead, ISessionDirectory, ISessionDriverAttribution, ISessionEvents, ISessionExecutionDetail, ISessionExecutionState, ISessionExecutionWorkspace, ISessionProjectRead, ISessionPromptResolution, ISessionRuntimeTools, ISessionSelfPacedLoopControl, ISessionStatusRead, ISessionToolAppViews, ISessionTurnControl, ISessionTurnSubmission, ISettingsSnapshot, TDriverId, TSettingsPatch } from "@robota-sdk/agent-interface-session";
3
+ import { TToolArgs } from "@robota-sdk/agent-core";
4
+ import { IPersonalUsageReport, IPersonalUsageRequest, IUsageBySourceReport, TUsageSurface } from "@robota-sdk/agent-interface-analytics";
5
+ import { TCommandSurfaceLocality } from "@robota-sdk/agent-interface-command";
6
+ import { IBinaryFrame, IChannelEventFrame, TChannelReceiveResult } from "@robota-sdk/agent-interface-transport";
7
+ import { IHandoffIntegrity, IPeerMessage, IPeerMessageAck, TPeerDeliveryState } from "@robota-sdk/agent-interface-session-mobility";
8
+ //#region src/outbound-delivery.d.ts
9
+ declare const outboundDeliveryBrand: unique symbol;
10
+ /**
11
+ * Deliver one outbound frame on a connection. A carrier failure is REPORTED through the boundary's
12
+ * error handler, never thrown at the caller — so a reply resolving after a disconnect cannot escape as
13
+ * an unhandled rejection or out of the carrier's inbound listener.
14
+ *
15
+ * Only {@link createOutboundDelivery} produces one. The brand is the mechanism, not decoration: it is
16
+ * what makes a raw carrier `send` unusable where a boundary is required.
17
+ */
18
+ type TOutboundDeliver = ((message: TServerMessage) => void) & {
19
+ readonly [outboundDeliveryBrand]: true;
20
+ /**
21
+ * Bytes this carrier has ACCEPTED and not yet written to the peer — or `undefined` when it cannot
22
+ * say.
23
+ *
24
+ * `deliver` returning is not delivery. Both carriers hand this boundary a fire-and-forget sink, so
25
+ * a frame that has "been sent" may be sitting in a socket buffer the boundary cannot see. Anything
26
+ * this boundary counted itself would be a count of what it HANDED OVER, which is a different
27
+ * quantity from what the peer has not read — and a budget over the wrong quantity reports a
28
+ * healthy connection for a peer that stopped reading (ARCH-030 / issue #1734).
29
+ *
30
+ * `undefined` is deliberately not `0`. A carrier that cannot report backpressure and a carrier with
31
+ * nothing pending are different states, and collapsing them would let "unknown" satisfy any
32
+ * threshold placed on this number.
33
+ */
34
+ readonly pendingBytes: () => number | undefined;
35
+ };
36
+ /**
37
+ * Observe THIS connection's first outbound delivery failure. `event` is the `type` of the frame that
38
+ * could not be delivered — for the fan-out, the frame a session event was forwarded as (usually, not
39
+ * always, the event's own name), and the reply's type for a reply (`command_result`, `protocol_error`, …).
40
+ *
41
+ * Required, never optional: a carrier that could opt out of observing its own delivery failures is the
42
+ * silent-failure shape this boundary exists to remove.
43
+ */
44
+ type TDeliveryErrorHandler = (error: Error, event: TServerMessage['type']) => void;
45
+ declare const DEFAULT_MAX_PENDING_BYTES: number;
46
+ /**
47
+ * Backpressure budget for a terminal attached to a session on the same host, in either role.
48
+ *
49
+ * 1 MiB, tighter than the default: an attached terminal reads a local socket, so a backlog this large
50
+ * means it stopped reading rather than that a network is slow. Exceeding it closes that connection
51
+ * only; the session never waits for a reader, so other surfaces keep streaming.
52
+ */
53
+ declare const ATTACHED_SURFACE_MAX_PENDING_BYTES: number;
54
+ /**
55
+ * Is this carrier holding more than the budget allows?
56
+ *
57
+ * Exported because a WebSocket carries TWO kinds of outbound frame over one socket — the text
58
+ * protocol and TRANS-001's payload channels — and only one of them goes through
59
+ * {@link createOutboundDelivery}. A budget the binary path re-implemented would be a second opinion
60
+ * about one socket's backpressure; a budget it skipped would leave the same non-reading peer
61
+ * unbounded on the other half of the connection.
62
+ *
63
+ * `undefined` is unknown, not zero: a carrier that cannot report backpressure is never over budget.
64
+ */
65
+ declare function isOverPendingBudget(pending: number | undefined, limit?: number): boolean;
66
+ /**
67
+ * Default outbound DRAIN budget (issue #2306): how long a carrier may stay non-empty before the peer
68
+ * is treated as not reading.
69
+ *
70
+ * 120 seconds. The byte budget bounds HOW MUCH a peer holds; it cannot bound HOW LONG, because
71
+ * `bufferedAmount` is a quantity with no history — a peer draining just enough to stay under 8 MiB
72
+ * forever is never over it. The figure is generous on purpose: a legitimately slow link drains to
73
+ * zero between bursts, so the clock resets, whereas a peer that keeps SOMETHING pending for two
74
+ * minutes straight is holding a session, its resume buffer, and a socket it does not intend to read.
75
+ * A badly chosen figure here disconnects real users, which is why it is one named constant and an
76
+ * argument, never an inline number. `Infinity` disables the budget.
77
+ */
78
+ declare const DEFAULT_MAX_PENDING_MS: number;
79
+ /**
80
+ * The drain clock the boundary keeps for a carrier (issue #2306). One timestamp, not per-frame
81
+ * bookkeeping: it starts on the first reading that finds the carrier non-empty, RESETS only when a
82
+ * reading finds it empty (a peer that drains to one byte and stalls again has not drained), and is
83
+ * consulted synchronously at each send — the boundary has no timer and gains none here.
84
+ */
85
+ interface IPendingStallClock {
86
+ readonly maxPendingMs: number;
87
+ /**
88
+ * Record one reading of the carrier's pending bytes. Returns how long the carrier has been
89
+ * continuously non-empty when that exceeds the budget; `undefined` otherwise. An `undefined`
90
+ * reading is unknown, not zero: it neither starts nor resets the clock.
91
+ */
92
+ observe: (pending: number | undefined) => number | undefined;
93
+ }
94
+ declare function createPendingStallClock(maxPendingMs?: number, now?: () => number): IPendingStallClock;
95
+ declare function createOutboundDelivery(send: (message: TServerMessage) => void, onDeliveryError: TDeliveryErrorHandler, pendingBytes?: () => number | undefined, maxPendingBytes?: number, stallClock?: IPendingStallClock): TOutboundDeliver;
96
+ //#endregion
97
+ //#region src/protocol-session.d.ts
98
+ /** Session roles required by the shared WebSocket/WebRTC protocol. */
99
+ interface IProtocolSession extends ISessionTurnSubmission, ISessionTurnControl, ISessionCommands, ISessionStatusRead, ISessionEvents, ISessionPromptResolution, ISessionConversationRead, ISessionExecutionState, ISessionDriverAttribution, ISessionBackgroundTasks, ISessionBackgroundGroups, ISessionExecutionWorkspace, ISessionExecutionDetail, ISessionSelfPacedLoopControl, ISessionAgentJobs, ISessionRuntimeTools, ISessionToolAppViews {}
100
+ /**
101
+ * #3282 §4c: a protocol session that ALSO answers the Project panel's reads. `Partial` (not a fourth
102
+ * mandatory role on {@link IProtocolSession} itself) deliberately: every existing test double and
103
+ * every other host that builds an `IProtocolSession` keeps type-checking unchanged, and the panel's
104
+ * three methods are runtime-probed (`typeof session.readProjectStatus === 'function'`) rather than
105
+ * assumed — `InteractiveSession` (the one production implementation) provides all three, satisfying
106
+ * this type with no further wiring.
107
+ */
108
+ type TProjectReadCapableSession = IProtocolSession & Partial<ISessionProjectRead>;
109
+ //#endregion
110
+ //#region src/settings-messages.d.ts
111
+ type TSettingsMessage = Extract<TClientMessage, {
112
+ type: 'get-settings' | 'update-settings';
113
+ }>;
114
+ declare function isSettingsMessage(msg: TClientMessage): msg is TSettingsMessage;
115
+ /** What applying a patch did: the fresh snapshot, or why nothing was written. */
116
+ type TSettingsUpdateOutcome = {
117
+ readonly ok: true;
118
+ readonly settings: ISettingsSnapshot;
119
+ } | {
120
+ readonly ok: false;
121
+ readonly code: 'not_available' | 'invalid' | 'refused' | 'update_failed';
122
+ readonly message: string;
123
+ };
124
+ /**
125
+ * #3282 §4a: host-owned read/write for the Settings screen, supplied by the composition root the
126
+ * same way `IUsageQueryReporters` supplies usage reads — this package only correlates the request
127
+ * and carries the result. `updateSettings` applies through the SAME function the matching slash
128
+ * command uses (issue #3282 §4: "one code path, so the behavior matches the TUI"), so whatever a
129
+ * command would refuse on this surface is refused here too.
130
+ */
131
+ interface ISettingsReporter {
132
+ getSettings(session: IProtocolSession, locality?: TCommandSurfaceLocality): ISettingsSnapshot | Promise<ISettingsSnapshot>;
133
+ /**
134
+ * Applies through the SAME function the matching slash command uses. `locality` (#3282 §4 part
135
+ * b-2) is forwarded to that command exactly as the transport received it, so a command that
136
+ * refuses a remote surface (installing a plugin) refuses identically here.
137
+ */
138
+ updateSettings(session: IProtocolSession, patch: TSettingsPatch, locality?: TCommandSurfaceLocality): TSettingsUpdateOutcome | Promise<TSettingsUpdateOutcome>;
139
+ }
140
+ declare function handleSettingsMessage(session: IProtocolSession, deliver: TOutboundDeliver, msg: TSettingsMessage, reporter: ISettingsReporter | undefined, locality?: TCommandSurfaceLocality): void;
141
+ //#endregion
142
+ //#region src/usage-messages.d.ts
143
+ interface IUsageQueryReporters {
144
+ readonly personalUsageReporter: ((request: IPersonalUsageRequest) => IPersonalUsageReport | Promise<IPersonalUsageReport>) | undefined;
145
+ readonly usageReporter: ((session: IProtocolSession) => IUsageBySourceReport | Promise<IUsageBySourceReport>) | undefined;
146
+ readonly storedSessionUsageReporter: ((sessionId: string) => IUsageBySourceReport | Promise<IUsageBySourceReport>) | undefined;
147
+ }
148
+ //#endregion
149
+ //#region src/session-events.d.ts
150
+ type TProtocolSessionEventClassification = 'forwarded' | 'requester-routed' | 'non-surface';
151
+ /** Exhaustive protocol-owner policy over the shared session-event vocabulary. */
152
+ declare const PROTOCOL_SESSION_EVENT_CLASSIFICATION: {
153
+ readonly text_delta: "forwarded";
154
+ readonly tool_start: "forwarded";
155
+ readonly tool_end: "forwarded";
156
+ readonly thinking: "forwarded";
157
+ readonly thinking_delta: "non-surface";
158
+ readonly complete: "forwarded";
159
+ readonly error: "forwarded";
160
+ readonly context_update: "forwarded";
161
+ readonly compact: "forwarded";
162
+ readonly interrupted: "forwarded";
163
+ readonly skill_activation: "forwarded";
164
+ readonly background_task_event: "forwarded";
165
+ readonly background_job_group_event: "forwarded";
166
+ readonly execution_workspace_event: "forwarded";
167
+ readonly user_message: "forwarded";
168
+ readonly turn_source: "forwarded";
169
+ readonly context_file_refreshed: "forwarded";
170
+ readonly memory_event: "forwarded";
171
+ readonly goal_event: "non-surface";
172
+ readonly plan_event: "forwarded";
173
+ readonly branch_event: "forwarded";
174
+ readonly permission_request: "forwarded";
175
+ readonly ask_request: "forwarded";
176
+ readonly prompt_resolved: "forwarded";
177
+ readonly ui_intent: "requester-routed";
178
+ readonly session_renamed: "forwarded";
179
+ readonly history_cleared: "forwarded";
180
+ readonly session_switched: "forwarded";
181
+ readonly status_changed: "forwarded";
182
+ };
183
+ //#endregion
184
+ //#region src/session-message-handler.d.ts
185
+ /**
186
+ * What a connected surface may do. `drive` sends prompts, answers questions and controls the session.
187
+ * `observe` is read-only: it follows this session's conversation and state, but never submits, answers,
188
+ * controls, or reads another session's records, and it never counts as a surface that can answer.
189
+ */
190
+ type TSessionSurfaceRole = 'drive' | 'observe';
191
+ interface ISessionMessageHandlerOptions {
192
+ /** IProtocolSession to expose — `Partial<ISessionProjectRead>` is probed, not assumed (#3282 §4c). */
193
+ session: TProjectReadCapableSession;
194
+ /**
195
+ * ARCH-030: the CARRIER's connection-scoped outbound delivery boundary — not a raw `send`, and not a
196
+ * `send` plus an error callback for this handler to assemble into one. The carrier owns both the sink
197
+ * and the "what does a failed send mean for this connection" policy, so it builds the boundary and
198
+ * passes it down; the raw sink never crosses this parameter, which is what stops a future reply family
199
+ * from reaching the wire unguarded.
200
+ */
201
+ deliver: TOutboundDeliver;
202
+ /**
203
+ * REMOTE-014 E5: the SERVER-ASSIGNED driver id for THIS remote surface (the E3 `deviceId`). Injected into
204
+ * every inbound `submit`/`command`/prompt-response so a co-drive turn/answer is attributed to this driver —
205
+ * a client-supplied driver id is NEVER trusted. Absent → unattributed (the session defaults to the owner).
206
+ */
207
+ driverId?: TDriverId;
208
+ /** Trusted carrier-owned product surface, kept separate from driver identity. */
209
+ surface?: TUsageSurface;
210
+ /** Carrier-decided role of this connection; defaults to `drive`. The client never chooses it here. */
211
+ role?: TSessionSurfaceRole;
212
+ /** Host-owned cross-session read model. The protocol only correlates and carries its result. */
213
+ personalUsageReporter?: NonNullable<IUsageQueryReporters['personalUsageReporter']>;
214
+ /** Host-owned current-session trace/cost producer for the pre-existing message family. */
215
+ usageReporter?: NonNullable<IUsageQueryReporters['usageReporter']>;
216
+ /** Host-owned stored-session producer used by cross-session drill-down. */
217
+ storedSessionUsageReporter?: NonNullable<IUsageQueryReporters['storedSessionUsageReporter']>;
218
+ /** Host-owned session directory (#3189): list, start and switch the host's sessions. */
219
+ sessionDirectory?: ISessionDirectory;
220
+ /** #3282 §4a: host-owned read/write for the GUI Settings screen. */
221
+ settingsReporter?: ISettingsReporter;
222
+ /**
223
+ * #3282 §4 part b-2: carrier-decided, like `role` — whether THIS carrier's connections are
224
+ * provably on this machine. The loopback WS carrier is `'local'`; the device-mesh/WebRTC carrier
225
+ * sets `'remote'`. Absent → `'local'`, forwarded to `executeCommand` and the settings reporter so a
226
+ * command that runs code from outside the session (installing a plugin) can refuse a remote device.
227
+ */
228
+ commandSurfaceLocality?: TCommandSurfaceLocality;
229
+ /**
230
+ * The most bytes one frame answering an app tool call or view read may take, for a carrier whose
231
+ * channel carries less than the inbound limit (a WebRTC data channel). An answer over it is
232
+ * replaced by a `protocol_error` before it reaches any buffer. Defaults to the inbound limit less
233
+ * a margin for a carrier that stamps frames afterwards.
234
+ */
235
+ maxFrameBytes?: number;
236
+ }
237
+ /**
238
+ * Create a carrier-neutral message handler for an IProtocolSession.
239
+ *
240
+ * Returns:
241
+ * - `onMessage(data)`: call this when the WebSocket receives a message
242
+ * - `cleanup()`: call this when the WebSocket disconnects
243
+ *
244
+ * Usage:
245
+ * ```typescript
246
+ * const delivery = createOutboundDelivery(
247
+ * (msg) => ws.send(JSON.stringify(msg)),
248
+ * (error) => ws.close(1011, error.message),
249
+ * );
250
+ * const { onMessage, cleanup } = createSessionMessageHandler({ session: interactiveSession, deliver: delivery });
251
+ *
252
+ * ws.on('message', (data) => onMessage(String(data)));
253
+ * ws.on('close', cleanup);
254
+ * ```
255
+ */
256
+ declare function createSessionMessageHandler(options: ISessionMessageHandlerOptions): {
257
+ onMessage: (data: string) => void;
258
+ cleanup: () => void;
259
+ };
260
+ //#endregion
261
+ //#region src/session-query-messages.d.ts
262
+ /**
263
+ * #3189: the most serialized history one `history` frame carries. Well under the tightest outbound
264
+ * budget (an attached terminal's, 1 MiB), so a client reading page after page is never mistaken for
265
+ * one that stopped reading.
266
+ */
267
+ declare const HISTORY_PAGE_MAX_BYTES: number;
268
+ //#endregion
269
+ //#region src/resume-buffer.d.ts
270
+ /** One retained frame: its sequence number and the message. */
271
+ interface IBufferedFrame {
272
+ readonly seq: number;
273
+ readonly message: TServerMessage;
274
+ }
275
+ /** The result of a `tailAfter` — either the ordered replay slice, or an overrun (client must full-refresh). */
276
+ type TResumeTail = {
277
+ readonly kind: 'tail';
278
+ readonly frames: readonly IBufferedFrame[];
279
+ } | {
280
+ readonly kind: 'overrun';
281
+ };
282
+ interface IResumeBufferOptions {
283
+ /** Max retained frames (drop-oldest beyond this). Default 512. */
284
+ readonly maxFrames?: number;
285
+ /** Max retained bytes across frames (drop-oldest beyond this). Default 4 MiB. */
286
+ readonly maxBytes?: number;
287
+ /** Serialized size of a message (for the byte budget). Default: JSON length. Injectable for tests. */
288
+ readonly sizeOf?: (message: TServerMessage) => number;
289
+ }
290
+ /**
291
+ * A monotonic, bounded ring of un-acked frames. Sequence numbers are assigned by {@link append} and never
292
+ * reused; `tailAfter` / `ackThrough` operate over the retained window.
293
+ */
294
+ declare class ResumeBuffer {
295
+ private readonly frames;
296
+ private readonly sizes;
297
+ private nextSeq;
298
+ private bytes;
299
+ private readonly maxFrames;
300
+ private readonly maxBytes;
301
+ private readonly sizeOf;
302
+ constructor(options?: IResumeBufferOptions);
303
+ /** Append a message, assign + return its monotonic seq, and evict oldest frames beyond the bounds. */
304
+ append(message: TServerMessage): number;
305
+ /** Drop all retained frames with `seq <= throughSeq` (the client confirmed receipt up to there). */
306
+ ackThrough(throughSeq: number): void;
307
+ /**
308
+ * The ordered frames with `seq > lastSeq`. Returns an `overrun` marker when `lastSeq` is older than the
309
+ * oldest retained frame (i.e. some frame after `lastSeq` was already evicted) — the client must full-refresh.
310
+ * `lastSeq` at or beyond the newest seq yields an empty tail (nothing to replay).
311
+ */
312
+ tailAfter(lastSeq: number): TResumeTail;
313
+ /** The last seq assigned (0 when nothing has been appended). */
314
+ get lastSeq(): number;
315
+ /** Retained frame count (diagnostics/tests). */
316
+ get size(): number;
317
+ private evict;
318
+ /** The single place that mutates `frames`/`sizes`/`bytes` for removal, so byte accounting can't drift. */
319
+ private removeOldest;
320
+ }
321
+ //#endregion
322
+ //#region src/channel-frames.d.ts
323
+ /** `R`, `B`, `F` — the shared prefix every channel frame starts with. */
324
+ declare const CHANNEL_FRAME_MAGIC: Uint8Array;
325
+ /** Envelope version. Bumped only on an incompatible layout change. */
326
+ declare const CHANNEL_FRAME_VERSION = 1;
327
+ /** Encode an opaque binary frame. The payload bytes are copied verbatim. */
328
+ declare function encodeBinaryFrame(frame: IBinaryFrame): Uint8Array;
329
+ /** Encode a structured, consumer-declared event frame (UTF-8 JSON body). */
330
+ declare function encodeChannelEventFrame(frame: IChannelEventFrame): Uint8Array;
331
+ /** True when `bytes` starts with the channel-frame magic — a cheap, non-parsing routing check. */
332
+ declare function isChannelFrame(bytes: Uint8Array): boolean;
333
+ /**
334
+ * Decode a channel frame. Returns an explicit result union — a non-channel, truncated, or malformed
335
+ * input is a stated error the carrier reports to the peer, never a thrown exception on the hot path
336
+ * and never a silently dropped frame.
337
+ */
338
+ declare function decodeChannelFrame(bytes: Uint8Array): TChannelReceiveResult;
339
+ //#endregion
340
+ //#region src/session-resume-bridge.d.ts
341
+ /** The current channel sink — receives a serialized JSON frame to put on the wire. */
342
+ type TResumeSink = (data: string) => void;
343
+ /** Options for {@link SessionResumeBridge.attach}. */
344
+ interface IAttachOptions {
345
+ /**
346
+ * REMOTE-013 E4: on a RECONNECT, HOLD live sink-forwarding until the client's `resume` has replayed the
347
+ * buffered tail — otherwise a live frame emitted between attach and the inbound `resume` would leapfrog the
348
+ * gap frames on the wire, and the client's seq-dedup would then discard the (older, lower-seq) gap. Every
349
+ * live event is already appended to the buffer, so holding loses nothing; `replay()` flushes in order and
350
+ * un-holds. First-pair attach does NOT hold (the client starts at seq 0, frames arrive in order).
351
+ */
352
+ readonly awaitResume?: boolean;
353
+ /** Sink/carrier-owned failure lifecycle for this attachment only. */
354
+ readonly onDeliveryError: (error: Error, event: string) => void;
355
+ /**
356
+ * ARCH-030: this attachment's carrier backpressure reading, if it has one.
357
+ *
358
+ * Threaded through because the replay path is the burst this budget exists for — a reconnecting
359
+ * peer is handed the whole retained tail at once, and without a reading the boundary here would
360
+ * have no budget at all while the per-channel boundary did.
361
+ */
362
+ readonly pendingBytes?: () => number | undefined;
363
+ }
364
+ interface ISessionResumeBridgeOptions {
365
+ readonly session: IProtocolSession;
366
+ readonly buffer?: IResumeBufferOptions;
367
+ /** REMOTE-014 E5: the SERVER-ASSIGNED driver id for this surface, injected into inbound submit/command/prompt-response. */
368
+ readonly driverId?: TDriverId;
369
+ readonly surface?: TUsageSurface;
370
+ readonly personalUsageReporter?: IUsageQueryReporters['personalUsageReporter'];
371
+ readonly usageReporter?: IUsageQueryReporters['usageReporter'];
372
+ readonly storedSessionUsageReporter?: IUsageQueryReporters['storedSessionUsageReporter'];
373
+ /** #3282 §4 part b-2: this bridge is the reconnectable WebRTC path, so it is always `'remote'`. */
374
+ readonly commandSurfaceLocality?: TCommandSurfaceLocality;
375
+ /** See {@link ISessionMessageHandlerOptions.maxFrameBytes}: the channel's limit, not the inbound one. */
376
+ readonly maxFrameBytes?: number;
377
+ }
378
+ declare class SessionResumeBridge {
379
+ private readonly session;
380
+ private readonly buffer;
381
+ private driverId?;
382
+ private readonly reporters;
383
+ private readonly surface?;
384
+ private readonly commandSurfaceLocality?;
385
+ private readonly maxFrameBytes?;
386
+ /**
387
+ * Ends with the bridge, not with a channel: a channel drop keeps the session reconnectable, so work
388
+ * started for a hosted app view (a call waiting on its prompt) survives it and is cancelled only when
389
+ * the host gives up on the session.
390
+ */
391
+ private readonly lifetime;
392
+ private readonly unsubscribe;
393
+ private onDeliveryError?;
394
+ /**
395
+ * ARCH-030: the attachment's outbound boundary — and the only reference this class keeps to the current
396
+ * channel, which is why `dispose()` goes through `detach()` rather than clearing a separate field.
397
+ * Built per `attach` because a boundary LATCHES on its first failure, so a fresh one is exactly what
398
+ * un-latches the session for the next channel. It holds the only try/catch on the frame path.
399
+ */
400
+ private outbound?;
401
+ /**
402
+ * The session-lifetime entry every frame takes — event fan-out AND every reply to an inbound frame —
403
+ * before it is seq-stamped and buffered by {@link emit}. Distinct from {@link outbound}, which is the
404
+ * per-attachment exit to the current channel; this one outlives channels because the subscription does.
405
+ *
406
+ * It guards the BUFFERING step, not a carrier, and it latches for the life of the session on purpose:
407
+ * the failure it is placed against is the buffer refusing a frame on capacity, and a resume buffer that
408
+ * cannot accept frames cannot honour a later `resume` either, so there is nothing a reconnect recovers.
409
+ * That is the opposite of {@link outbound}, where the next channel IS the recovery — the two scopes
410
+ * differ because the failures do. (A per-frame serialization failure would leave the buffer intact, but
411
+ * such a frame is undeliverable on every carrier, since each one stringifies it too; it is reported and
412
+ * the carrier torn down, never silently dropped.)
413
+ */
414
+ private readonly emitBoundary;
415
+ private disposed;
416
+ /** REMOTE-013 E4: while true, live emits are buffered but NOT forwarded — released by `replay()` on reconnect. */
417
+ private holding;
418
+ constructor(options: ISessionResumeBridgeOptions);
419
+ /** Set the current channel sink (on connect / reconnect). Live messages reach the client; replay is `resume`-driven. */
420
+ attach(sink: TResumeSink, options: IAttachOptions): void;
421
+ /** Clear the sink (channel drop). Buffering continues so gap output is retained for the next `resume`. */
422
+ detach(): void;
423
+ /**
424
+ * REMOTE-014 E5: bind the SERVER-ASSIGNED driver id (the E3 `deviceId`) once the peer pairs — the bridge
425
+ * injects it into every subsequent inbound submit/command/prompt-response for co-drive attribution.
426
+ */
427
+ setDriverId(driverId: TDriverId): void;
428
+ /** Route one inbound channel frame: `resume`/`ack` handled here; everything else → the session. */
429
+ onClientMessage(data: string): void;
430
+ /** Unsubscribe from the session (host reconnect-window ceiling / teardown). Idempotent. */
431
+ dispose(): void;
432
+ /** Diagnostics/tests: the last seq assigned. */
433
+ get lastSeq(): number;
434
+ /**
435
+ * Stamp a seq, retain in the buffer, and forward to the current sink — UNLESS holding for a reconnect replay.
436
+ *
437
+ * ARCH-030: the `buffer.append` happens BEFORE the boundary, deliberately. The boundary latches on its
438
+ * first failure and drops everything after it, so a frame appended afterwards would be lost — appending
439
+ * first means a dropped frame is still in the un-acked tail and still replays on the next `resume`.
440
+ */
441
+ private emit;
442
+ /**
443
+ * Replay the buffered tail after `lastSeq` (or `resume_gap` on overrun), then RELEASE the reconnect hold so
444
+ * subsequent live frames flow in order behind the flushed gap.
445
+ *
446
+ * A failing sink reports ONCE across the whole tail: the boundary latches on the first failure and every
447
+ * remaining frame is dropped silently. Those frames stay un-acked in the buffer and replay on the next
448
+ * attachment. Before ARCH-030 the single report was a side effect of `detach()` running mid-loop; now it
449
+ * is the boundary's stated contract.
450
+ */
451
+ private replay;
452
+ /** The ONE outbound exit from this class. No frame reaches the sink except through the attachment's boundary. */
453
+ private deliverFrame;
454
+ /** Detach the failed sink but retain the frame, then notify its attachment owner. */
455
+ private reportDeliveryError;
456
+ }
457
+ //#endregion
458
+ //#region src/peer-message-ledger.d.ts
459
+ /**
460
+ * What the receiver has seen from one origin.
461
+ *
462
+ * `delivered` is a SET, not just a high-water mark, and that distinction is the whole of review
463
+ * finding #1. A high-water mark cannot tell "sequence 2 was already used" from "sequence 2 is the
464
+ * gap we reported and it has just arrived" — and answering the second as if it were the first
465
+ * refuses a message that was never delivered, permanently. `highestSequence` is kept alongside it
466
+ * because reporting a gap needs the frontier, not the membership.
467
+ *
468
+ * Exported because it is reachable from `IPeerMessageLedger`. A public interface whose field type is
469
+ * unexported is a name a consumer cannot write down (review finding #2). Measured: `tsdown` inlines
470
+ * it into the bundled declaration so no TS4033 is raised today — the finding's build-breakage claim
471
+ * does not reproduce — but a type nobody can name is still a bad public surface.
472
+ */
473
+ interface IOriginRecord {
474
+ /** The highest sequence delivered from this origin — the frontier a gap is measured against. */
475
+ highestSequence: number;
476
+ /** Every sequence actually delivered. Membership, not a range: gaps get filled out of order. */
477
+ delivered: Set<number>;
478
+ /** Acks already issued, by message id, so a retry gets the original answer back. */
479
+ issued: Map<string, IPeerMessageAck>;
480
+ }
481
+ /** Per-connection receive state. Created empty; discarded when the connection ends. */
482
+ interface IPeerMessageLedger {
483
+ readonly origins: Map<string, IOriginRecord>;
484
+ }
485
+ declare function createPeerMessageLedger(): IPeerMessageLedger;
486
+ /** Why a message was not accepted, when it was not. */
487
+ interface IPeerMessageRejection {
488
+ readonly state: Extract<TPeerDeliveryState, 'refused' | 'failed'>;
489
+ readonly reason: string;
490
+ }
491
+ interface IPeerMessageVerdict {
492
+ readonly ack: IPeerMessageAck;
493
+ /**
494
+ * Should the session deliver this to the agent?
495
+ *
496
+ * False for a duplicate and for a refusal. Separate from `ack.state` because a caller that
497
+ * re-derived it from the state string would have to re-list which states mean "deliver", and that
498
+ * list is exactly what drifts.
499
+ */
500
+ readonly deliver: boolean;
501
+ /**
502
+ * Set when this message's sequence is ahead of the last one delivered from its origin.
503
+ *
504
+ * Reported, not resolved. The session layer decides whether a gap is worth waiting for; the
505
+ * ledger's job is to make sure it is never invisible.
506
+ */
507
+ readonly gapBefore?: number;
508
+ }
509
+ /**
510
+ * Record a message and say what should happen to it.
511
+ *
512
+ * Pure with respect to its inputs except for the ledger it is handed, which it updates in place —
513
+ * the caller owns the ledger's lifetime, so a connection ending is a reference going away rather
514
+ * than a cleanup step someone can forget.
515
+ */
516
+ declare function admitPeerMessage(ledger: IPeerMessageLedger, message: IPeerMessage, rejection?: IPeerMessageRejection): IPeerMessageVerdict;
517
+ /**
518
+ * Mark a delivered message as acknowledged by the agent side.
519
+ *
520
+ * Separate from `admitPeerMessage` because delivery and acknowledgement answer different questions —
521
+ * "did the receiver take it" versus "did the agent act on it" — and a sender waiting for the second
522
+ * must not be told the first.
523
+ */
524
+ declare function acknowledgePeerMessage(ledger: IPeerMessageLedger, originSessionId: string, id: string): IPeerMessageAck | undefined;
525
+ /** Forget one origin — used when a peer disconnects and its sequence space is no longer meaningful. */
526
+ declare function forgetPeerOrigin(ledger: IPeerMessageLedger, originSessionId: string): void;
527
+ //#endregion
528
+ //#region src/permission-summary.d.ts
529
+ /** The call's identifying argument, or `undefined` when it has none worth showing. */
530
+ declare function permissionSummaryArgument(toolArgs: TToolArgs): string | undefined;
531
+ //#endregion
532
+ //#region src/handoff-chunking.d.ts
533
+ /**
534
+ * One piece of a payload in flight.
535
+ *
536
+ * `total` travels on every chunk rather than in a separate header frame: a header can be the frame
537
+ * that gets lost, and a receiver that learned the count from a message it never got would wait
538
+ * forever for a number it cannot ask for again.
539
+ */
540
+ interface IHandoffChunk {
541
+ readonly handoffId: string;
542
+ /** 0-based position in the sequence. */
543
+ readonly index: number;
544
+ /** How many chunks make up the whole payload. */
545
+ readonly total: number;
546
+ /** base64 of this slice of the UTF-8 encoded payload. */
547
+ readonly data: string;
548
+ }
549
+ /**
550
+ * Default frame budget, in bytes of encoded chunk data.
551
+ *
552
+ * 16 KiB because that is the size every SCTP implementation carries without negotiation. Larger
553
+ * works between two peers that both support it and fails between two that do not — and it fails at
554
+ * transfer time, on the user's session, not in a test.
555
+ */
556
+ declare const DEFAULT_MAX_CHUNK_BYTES: number;
557
+ /**
558
+ * Cut a sealed payload into chunks.
559
+ *
560
+ * Takes the serialized string the seal produced, not the record — the digest is over those exact
561
+ * bytes, and re-serializing here would let a chunked payload differ from the one the manifest
562
+ * describes.
563
+ */
564
+ declare function chunkHandoffPayload(handoffId: string, serialized: string, maxChunkBytes?: number): readonly IHandoffChunk[];
565
+ /** Why a chunk was not accepted. */
566
+ type TChunkRejection =
567
+ /** Belongs to a different transfer. */
568
+ 'wrong-handoff' |
569
+ /** `index` is negative, or beyond the declared `total`. */
570
+ 'out-of-range' |
571
+ /** Its `total` disagrees with what earlier chunks declared. */
572
+ 'inconsistent-total' |
573
+ /** Its `data` is not decodable base64. */
574
+ 'undecodable';
575
+ type TChunkOutcome =
576
+ /** Stored; more are still needed. */
577
+ 'accepted' |
578
+ /** Already had this index, and it matched. A retry, not a problem. */
579
+ 'duplicate' |
580
+ /** Stored, and that was the last one missing. */
581
+ 'complete' | 'refused';
582
+ interface IChunkResult {
583
+ readonly outcome: TChunkOutcome;
584
+ readonly rejection?: TChunkRejection;
585
+ /** Present when complete: the reassembled payload, ready for the integrity check. */
586
+ readonly serialized?: string;
587
+ /** How many distinct chunks are held. */
588
+ readonly received: number;
589
+ /** How many are expected, once anything has declared it. */
590
+ readonly expected?: number;
591
+ }
592
+ /**
593
+ * Collects the chunks of ONE transfer.
594
+ *
595
+ * One assembler per `handoffId`, because a shared one would have to key everything by transfer and
596
+ * would then be a place where two transfers can be confused for each other. A chunk naming a
597
+ * different transfer is refused rather than routed — routing is the caller's job and doing it here
598
+ * would make this a dispatcher as well as a buffer.
599
+ */
600
+ declare class HandoffChunkAssembler {
601
+ private readonly handoffId;
602
+ private readonly chunks;
603
+ private declaredTotal;
604
+ constructor(handoffId: string);
605
+ get received(): number;
606
+ get expected(): number | undefined;
607
+ /** Take one chunk. Reordering and retries are normal; inconsistency is not. */
608
+ accept(chunk: IHandoffChunk): IChunkResult;
609
+ /** Which indices are still missing, so a caller can ask for them rather than restarting. */
610
+ missing(): readonly number[];
611
+ /** Drop everything held. The transfer was abandoned, or its integrity check failed. */
612
+ discard(): void;
613
+ private reassemble;
614
+ }
615
+ /**
616
+ * How many chunks a payload of this size will take, without building them.
617
+ *
618
+ * For a progress indicator at the sending end, and for a receiver deciding whether it is willing to
619
+ * hold that much before the first chunk arrives.
620
+ */
621
+ declare function chunkCountFor(integrity: IHandoffIntegrity, maxChunkBytes?: number): number;
622
+ //#endregion
623
+ export { ATTACHED_SURFACE_MAX_PENDING_BYTES, CHANNEL_FRAME_MAGIC, CHANNEL_FRAME_VERSION, DEFAULT_MAX_CHUNK_BYTES, DEFAULT_MAX_PENDING_BYTES, DEFAULT_MAX_PENDING_MS, HISTORY_PAGE_MAX_BYTES, HandoffChunkAssembler, type IAttachOptions, type IBufferedFrame, type IChunkResult, type IHandoffChunk, type IPeerMessageLedger, type IPeerMessageRejection, type IPeerMessageVerdict, type IPendingStallClock, type IProtocolSession, type IResumeBufferOptions, type ISessionMessageHandlerOptions, type ISessionResumeBridgeOptions, type ISettingsReporter, type IWireAgentDefinitionSummary, type IWireHistoryEntry, MAX_INBOUND_FRAME_BYTES, PROTOCOL_SESSION_EVENT_CLASSIFICATION, ResumeBuffer, SessionResumeBridge, type TChunkOutcome, type TChunkRejection, type TClientMessage, type TDeliveryErrorHandler, type TMessageDecodeResult, type TOutboundDeliver, type TProtocolSessionEventClassification, type TResumeSink, type TResumeTail, type TSeqServerMessage, type TServerMessage, type TSessionSurfaceRole, type TSettingsUpdateOutcome, type TWireExecutionResult, acknowledgePeerMessage, admitPeerMessage, chunkCountFor, chunkHandoffPayload, createOutboundDelivery, createPeerMessageLedger, createPendingStallClock, createSessionMessageHandler, decodeChannelFrame, decodeClientMessage, decodeFrame, decodeServerMessage, encodeBinaryFrame, encodeChannelEventFrame, forgetPeerOrigin, handleSettingsMessage, isChannelFrame, isObserverMessageType, isOverPendingBudget, isSettingsMessage, permissionSummaryArgument };
624
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/outbound-delivery.ts","../../src/protocol-session.ts","../../src/settings-messages.ts","../../src/usage-messages.ts","../../src/session-events.ts","../../src/session-message-handler.ts","../../src/session-query-messages.ts","../../src/resume-buffer.ts","../../src/channel-frames.ts","../../src/session-resume-bridge.ts","../../src/peer-message-ledger.ts","../../src/permission-summary.ts","../../src/handoff-chunking.ts"],"mappings":"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"}