@tangle-network/agent-app 0.44.28 → 0.44.30

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 (50) hide show
  1. package/dist/assistant/index.d.ts +8 -6
  2. package/dist/assistant/index.js +6 -3
  3. package/dist/assistant/index.js.map +1 -1
  4. package/dist/{attachment-validation-Dvc_Livy.d.ts → attachment-validation-CNkH91Gs.d.ts} +1 -1
  5. package/dist/chat-react/index.d.ts +192 -0
  6. package/dist/chat-react/index.js +179 -0
  7. package/dist/chat-react/index.js.map +1 -0
  8. package/dist/chat-routes/index.d.ts +7 -6
  9. package/dist/chat-routes/index.js +13 -9
  10. package/dist/chat-routes/index.js.map +1 -1
  11. package/dist/chat-store/index.d.ts +6 -5
  12. package/dist/chat-store/index.js +2 -1
  13. package/dist/chat-store/index.js.map +1 -1
  14. package/dist/chunk-4OO7P3ZF.js +292 -0
  15. package/dist/chunk-4OO7P3ZF.js.map +1 -0
  16. package/dist/chunk-4PUMUTLU.js +158 -0
  17. package/dist/chunk-4PUMUTLU.js.map +1 -0
  18. package/dist/{chunk-7775L5NN.js → chunk-BAC2B2KI.js} +170 -7
  19. package/dist/chunk-BAC2B2KI.js.map +1 -0
  20. package/dist/{chunk-PRKSYTMQ.js → chunk-GCH3BUAZ.js} +31 -317
  21. package/dist/chunk-GCH3BUAZ.js.map +1 -0
  22. package/dist/{chunk-BI6NKSO4.js → chunk-IYLJS6VW.js} +3 -84
  23. package/dist/chunk-IYLJS6VW.js.map +1 -0
  24. package/dist/chunk-QY4BRKRJ.js +84 -0
  25. package/dist/chunk-QY4BRKRJ.js.map +1 -0
  26. package/dist/{chunk-C3SRFZGL.js → chunk-QYAQGCHF.js} +2 -154
  27. package/dist/chunk-QYAQGCHF.js.map +1 -0
  28. package/dist/{contract-CEewO6DI.d.ts → contract-CQNvv5th.d.ts} +1 -1
  29. package/dist/interactions/index.d.ts +2 -2
  30. package/dist/{parts-fyPPdDdK.d.ts → parts-7fbe2rj8.d.ts} +4 -274
  31. package/dist/{queue-vRI0Qx3X.d.ts → queue-VTBA5ONX.d.ts} +1 -1
  32. package/dist/sandbox/index.d.ts +253 -1
  33. package/dist/sandbox/index.js +9 -1
  34. package/dist/stream/index.d.ts +3 -3
  35. package/dist/{stream-normalizer-DnuqkZvw.d.ts → stream-normalizer-CnPnMaTp.d.ts} +1 -1
  36. package/dist/teams/index.js +5 -5
  37. package/dist/teams/invitations-api.js +4 -4
  38. package/dist/teams-react/index.js +3 -3
  39. package/dist/{types-DB82fktc.d.ts → types-CCeYywdS.d.ts} +1 -1
  40. package/dist/use-file-mentions-E6a7_cbH.d.ts +98 -0
  41. package/dist/web-react/index.d.ts +13 -104
  42. package/dist/web-react/index.js +17 -12
  43. package/dist/wire-DSp4LzEE.d.ts +272 -0
  44. package/dist/work-product/index.d.ts +3 -3
  45. package/dist/work-product-react/index.d.ts +1 -1
  46. package/package.json +6 -1
  47. package/dist/chunk-7775L5NN.js.map +0 -1
  48. package/dist/chunk-BI6NKSO4.js.map +0 -1
  49. package/dist/chunk-C3SRFZGL.js.map +0 -1
  50. package/dist/chunk-PRKSYTMQ.js.map +0 -1
@@ -1,278 +1,8 @@
1
1
  import { Part } from '@tangle-network/agent-interface';
2
- import { a as ChatInteractionField, C as ChatInteractionStatus, I as InteractionAnswers, N as NoticeKind } from './contract-CEewO6DI.js';
3
- import { c as WorkProductPersistedPart } from './types-DB82fktc.js';
2
+ import { C as ChatInteractionField, a as ChatInteractionStatus, I as InteractionAnswers, N as NoticeKind } from './contract-CQNvv5th.js';
3
+ import { W as WorkProductPersistedPart } from './types-CCeYywdS.js';
4
4
  import { ChatPlanPersistedPart } from './plans/index.js';
5
-
6
- /**
7
- * Wire contract between the chat client (composer + `streamChatTurn`) and the
8
- * assembled server vertical (`createChatTurnRoutes`). Import-free on purpose:
9
- * `/web-react` re-exports these types into browser bundles, so nothing here may
10
- * reach a Node builtin or an engine package.
11
- *
12
- * The client part shape permits an absolute file path until the server converts
13
- * it to the URL required by the sandbox SDK. It is derived here, not imported,
14
- * so the client bundle never touches the SDK.
15
- */
16
- interface ChatTurnTextPartInput {
17
- type: 'text';
18
- text: string;
19
- }
20
- /** A non-text prompt part the upload route hands back and the client echoes
21
- * on send. `url` carries an inline `data:` URI for small files; `path` is a
22
- * sandbox workspace reference for large ones (the >1 MiB gateway body cap
23
- * makes the two-step upload mandatory). */
24
- interface ChatTurnFilePartInput {
25
- type: 'image' | 'file';
26
- filename?: string;
27
- mediaType?: string;
28
- url?: string;
29
- path?: string;
30
- }
31
- /** Resolve input as either a text part or a file part of a chat turn */
32
- type ChatTurnPartInput = ChatTurnTextPartInput | ChatTurnFilePartInput;
33
- /** Represent a text event produced by a source with a fixed type and associated text content */
34
- interface ProducerTextEvent {
35
- type: 'text';
36
- text: string;
37
- }
38
- /** Define an event representing reasoning output with a fixed type and associated text */
39
- interface ProducerReasoningEvent {
40
- type: 'reasoning';
41
- text: string;
42
- }
43
- /** Represent an event triggered by a producer tool call with its identifier, name, and arguments */
44
- interface ProducerToolCallEvent {
45
- type: 'tool_call';
46
- call: {
47
- toolCallId: string;
48
- toolName: string;
49
- args: Record<string, unknown>;
50
- };
51
- }
52
- /** Describe the structure of an event representing the result of a producer tool call */
53
- interface ProducerToolResultEvent {
54
- type: 'tool_result';
55
- toolCallId: string;
56
- toolName: string;
57
- outcome: {
58
- ok: boolean;
59
- result?: unknown;
60
- message?: string;
61
- };
62
- }
63
- /** Describe usage event with prompt and completion token counts for a producer */
64
- interface ProducerUsageEvent {
65
- type: 'usage';
66
- usage: {
67
- promptTokens: number;
68
- completionTokens: number;
69
- };
70
- }
71
- /** Define the structure for a producer notice event with type, id, kind, and text fields */
72
- interface ProducerNoticeEvent {
73
- type: 'notice';
74
- id: string;
75
- /** Kept inline with `/interactions`' `NoticeKind` so this file stays import-free. */
76
- noticeKind: 'warning' | 'auto-declined';
77
- text: string;
78
- }
79
- /** Represent an error event emitted by a producer containing message, code, and optional details */
80
- interface ProducerErrorEvent {
81
- type: 'error';
82
- data: {
83
- message: string;
84
- code?: string;
85
- details?: Record<string, unknown>;
86
- };
87
- }
88
- /** Stable raw lifecycle/interaction/plan/route events forwarded unchanged. */
89
- type ProducerPassthroughEventType = 'turn' | 'metadata' | 'interaction' | 'interaction.cancel' | 'plan.submitted' | 'done' | 'warning' | 'session.run.started' | 'session.run.completed' | 'session.run.failed' | 'turn_status';
90
- /** Define an event carrying passthrough data with flexible properties for producer communication */
91
- interface ProducerPassthroughEvent {
92
- type: ProducerPassthroughEventType;
93
- data?: Record<string, unknown>;
94
- /** Route markers and raw passthroughs may carry `turnId`, `status`, `seq`, etc. */
95
- [key: string]: unknown;
96
- }
97
- /** Represent events emitted by a producer during its operation for processing and handling */
98
- type ProducerWireEvent = ProducerTextEvent | ProducerReasoningEvent | ProducerToolCallEvent | ProducerToolResultEvent | ProducerUsageEvent | ProducerNoticeEvent | ProducerErrorEvent | ProducerPassthroughEvent;
99
- /** The image/file split an attachment is rendered and persisted under — the
100
- * same discriminant as {@link ChatMentionKind}, but a distinct name because an
101
- * attachment carries content the product uploaded (`ChatAttachmentInput`)
102
- * while a mention points at a file the box already has. Defined HERE (the
103
- * import-free layer) so `ChatAttachmentInput` can reference it and the client
104
- * composer imports it without pulling the persisted-part vocabulary;
105
- * `/chat-store`'s parts module re-exports it alongside the attachment helpers. */
106
- type ChatAttachmentKind = 'image' | 'file';
107
- /** `POST` turn-body entry describing a file already uploaded to the product's
108
- * store (vault/object-store) — distinct from an inline {@link
109
- * ChatTurnFilePartInput} (which carries bytes) and from a {@link FileMention}
110
- * (a sandbox path the box already holds). The route resolves this field with
111
- * {@link resolveChatAttachments}: every path is re-validated and every size is
112
- * re-derived from the stored body, so nothing here is trusted as sent. */
113
- interface ChatAttachmentInput {
114
- path: string;
115
- name: string;
116
- size: number;
117
- mediaType: string;
118
- kind: ChatAttachmentKind;
119
- }
120
- /** POST body for the turn route. `content` may be empty when `parts` carry the
121
- * message (an image-only send). Product routing fields (workspaceId etc.) ride
122
- * alongside and are read by the product's `authorize` seam. */
123
- interface ChatTurnRequestPayload {
124
- threadId: string;
125
- content?: string;
126
- /** Non-text parts from the upload route, echoed back verbatim. */
127
- parts?: ChatTurnFilePartInput[];
128
- /** `@`-picked file mentions for this turn — path references into the
129
- * workspace sandbox, NOT uploads, so they travel in their own field rather
130
- * than as `parts` entries. A product whose `parts` field is already spoken
131
- * for (an attachment sentinel) can still send mentions, and mentions
132
- * persist as their own `ChatMentionPart`s so a retry rebuilds them. The
133
- * route validates this field with {@link parseFileMentions} and replaces it
134
- * on the payload with the validated, deduped list. */
135
- mentions?: FileMention[];
136
- /** Files uploaded to the product's store ahead of the turn — path
137
- * references, NOT inline bytes (those ride `parts`). Validated and
138
- * size-re-derived by {@link resolveChatAttachments} into persistable
139
- * attachment parts; a product whose `parts` field is spoken for by inline
140
- * uploads still sends store-backed files here. */
141
- attachments?: ChatAttachmentInput[];
142
- model?: string;
143
- effort?: 'auto' | 'low' | 'medium' | 'high';
144
- harness?: string;
145
- /** Client-generated idempotency key for the logical turn (retry-safe). */
146
- turnId?: string;
147
- [key: string]: unknown;
148
- }
149
- /** `fetch` init for the turn route — the one place the client wire shape is
150
- * serialized, so composer glue and products never drift from the server's
151
- * parser. */
152
- declare function chatTurnRequestInit(payload: ChatTurnRequestPayload): RequestInit;
153
- /** Define the maximum byte size allowed for inline parts in data processing */
154
- declare const INLINE_PARTS_MAX_BYTES = 950000;
155
- /** Hard cap on the whole `/prompt` request body as it crosses the sandbox
156
- * proxy — smaller in practice than a raw-file write cap because a dispatch
157
- * carries several inline parts plus the flattened history in one request. */
158
- declare const DISPATCH_REQUEST_MAX_BYTES: number;
159
- /** Bytes reserved off the top of {@link DISPATCH_REQUEST_MAX_BYTES} for the
160
- * JSON structure around the parts array (keys, delimiters, per-part
161
- * `type`/`filename`/`mediaType` fields) that {@link base64WireLen} does not
162
- * account for — keeps the inline budget off the exact proxy cap where one
163
- * stray byte trips the 413. */
164
- declare const DISPATCH_STRUCTURAL_RESERVE_BYTES: number;
165
- /** Sidecar's hard cap on the `parts` array of one prompt request — a dispatch
166
- * must never assemble more parts than this or the whole turn 400s. */
167
- declare const DISPATCH_MAX_PARTS = 64;
168
- /** Product-side cap on media parts per dispatch (current turn + carried
169
- * history), well under {@link DISPATCH_MAX_PARTS}. History trimming that keeps
170
- * a transcript's native media under this is a PRODUCT concern (the pointer
171
- * block keeps trimmed media reachable); `buildDispatchParts` enforces only the
172
- * total {@link DISPATCH_MAX_PARTS} cap. */
173
- declare const DISPATCH_MAX_MEDIA_PARTS = 24;
174
- /** Size a base64-encoded string occupies on the wire given the raw
175
- * (pre-encoding) byte length: base64 packs 3 raw bytes into 4 output
176
- * characters, rounded up to the next multiple of 4. */
177
- declare function base64WireLen(byteLen: number): number;
178
- /**
179
- * Render a raw byte count as a human-readable size (`512B`, `3KB`, `12MB
180
- * 500KB`). Ported EXACTLY from gtm-agent's `attachment-limits.ts` — byte-
181
- * identical implementation, not a reinterpretation — so `resolve-attachments`'s
182
- * and `promote-file-part`'s error strings match gtm's wording verbatim. Lives
183
- * in the import-free wire layer (not `resolve-attachments.ts` alone) because
184
- * BOTH the aggregate-cap message here and the per-file oversize message in
185
- * `promote-file-part.ts` need it; a browser composer wanting the same
186
- * formatting for a client-side pre-check can also import it with no engine
187
- * pulled in.
188
- */
189
- declare function formatBytes(bytes: number): string;
190
- /** Represent errors for invalid chat turn inputs with status and code properties */
191
- declare class ChatTurnInputError extends Error {
192
- readonly status: number;
193
- readonly code: string;
194
- constructor(message: string, status?: number, code?: string);
195
- }
196
- /** Calculate the total byte size of an array of chat turn parts */
197
- declare function promptPartsByteSize(parts: ChatTurnPartInput[]): number;
198
- /** Throws `ChatTurnInputError` (413) when the parts' inline payload would blow
199
- * the gateway cap. Path-ref parts are tiny by construction and always pass. */
200
- declare function assertPromptPartsWithinCap(parts: ChatTurnPartInput[], maxBytes?: number): void;
201
- /** A file mention resolved from the composer's `@`-picker: the
202
- * workspace-relative path plus enough metadata to build a prompt part and
203
- * pointer text. `path` is the canonical identity — the mention pill's
204
- * `MentionItem.id` for the file kind (`/web-react`'s `useFileMentions`). */
205
- interface FileMention {
206
- path: string;
207
- name: string;
208
- size?: number;
209
- }
210
- /** The `image/*` mime for a mention path by extension, or `undefined` for
211
- * anything not in the known image set (dispatched as `type: 'file'`). */
212
- declare function mediaTypeForMentionPath(path: string): string | undefined;
213
- /** The image/file split a mention is rendered and persisted under — the
214
- * composer pill's icon, the dispatched part's `type`, and
215
- * `ChatMentionPart.mentionKind` are all this one value. */
216
- type ChatMentionKind = 'image' | 'file';
217
- /** `image` when the path's extension is in the known image set (the same table
218
- * {@link mediaTypeForMentionPath} reads), `file` otherwise. Exported so a
219
- * client that needs only the discriminant — a pill icon, a persisted part's
220
- * `mentionKind` — never re-declares the extension table; two frozen copies of
221
- * one mime table is how one gains a format and the other doesn't. */
222
- declare function mentionKindForPath(path: string): ChatMentionKind;
223
- /** Define options to resolve mention paths when converting file mentions to parts */
224
- interface FileMentionsToPartsOptions {
225
- /** Resolve a mention's workspace-relative path to the absolute path the
226
- * dispatched part should carry (e.g. a host prefixing the in-box vault
227
- * root). Default: identity — the path travels unchanged. */
228
- resolvePath?: (path: string) => string;
229
- }
230
- /** Maps resolved file mentions to path-only `ChatTurnFilePartInput`s —
231
- * `image` vs `file` by extension, and always a `path`, never a `url` (the
232
- * url/path XOR invariant: a mention is a sandbox path reference, never
233
- * inline bytes). */
234
- declare function fileMentionsToParts(mentions: readonly FileMention[], opts?: FileMentionsToPartsOptions): ChatTurnFilePartInput[];
235
- /** The agent-facing pointer block appended to the dispatched prompt — never
236
- * persisted in message `content`. Empty array → `''` so callers can append
237
- * unconditionally. This is the sole producer of that text: the current
238
- * turn's dispatch and any history projection built from the same mention
239
- * list both route through here, so the two can't drift apart. */
240
- declare function buildMentionPromptBlock(mentions: readonly Pick<FileMention, 'name' | 'path'>[]): string;
241
- /** Hard cap on mentions per turn. Bounds the prompt pointer block, the
242
- * persisted parts, and whatever media budget a dispatch draws from them. */
243
- declare const MENTION_MAX_COUNT = 16;
244
- /** Represent the result of a sandbox mention path check indicating success or failure with an error message */
245
- type SandboxMentionPathCheck = {
246
- succeeded: true;
247
- } | {
248
- succeeded: false;
249
- error: string;
250
- };
251
- /**
252
- * Validate a workspace-relative sandbox mention path. Rejects traversal (a
253
- * `..` path segment), absolute paths (leading `/`), backslashes, and null
254
- * bytes — the four ways a path picked in a client can escape the root the
255
- * index route scanned.
256
- *
257
- * Spaces and unicode are deliberately ALLOWED: in-box filenames are arbitrary,
258
- * and an ASCII-only charset would silently drop real files from a feature
259
- * whose whole job is naming them.
260
- */
261
- declare function validateSandboxMentionPath(path: unknown): SandboxMentionPathCheck;
262
- /**
263
- * Validates the untyped `mentions` array off the wire, mirroring
264
- * {@link parseChatTurnParts}: the typed list, or `ChatTurnInputError` (400)
265
- * naming the offending entry. Never sanitizes-and-continues — a traversal path
266
- * is a rejected request, not a trimmed one.
267
- *
268
- * A path repeated within one turn is deduped to its first occurrence rather
269
- * than rejected: mentioning the same file twice is plausible user input, not
270
- * an attack.
271
- */
272
- declare function parseFileMentions(raw: unknown): FileMention[];
273
- /** Validates the untyped `parts` array off the wire. Returns the typed parts
274
- * or throws `ChatTurnInputError` (400) naming the offending entry. */
275
- declare function parseChatTurnParts(raw: unknown): ChatTurnFilePartInput[];
5
+ import { C as ChatMentionKind, a as ChatAttachmentKind, b as ChatAttachmentInput, F as FileMention } from './wire-DSp4LzEE.js';
276
6
 
277
7
  /**
278
8
  * The stored shape of `message.parts` — one typed vocabulary for every part a
@@ -606,4 +336,4 @@ declare function historyContentWithAttachments(message: {
606
336
  parts?: ReadonlyArray<Record<string, unknown>> | null;
607
337
  }, header?: string): string;
608
338
 
609
- export { type ProducerErrorEvent as $, isChatInteractionPart as A, isChatMentionPart as B, type ChatMessagePart as C, DEFAULT_ATTACHMENT_PROMPT_HEADER as D, isChatPlanPart as E, isChatStepFinishPart as F, isChatTextPart as G, isChatToolPart as H, isChatWorkProductPart as I, mentionInputToPart as J, mentionPartsFromMessageParts as K, toChatMessageParts as L, type FileMention as M, type ChatTurnRequestPayload as N, type ChatTurnPartInput as O, type ChatTurnFilePartInput as P, type ChatAttachmentInput as Q, ChatTurnInputError as R, type StorableHarnessPartKind as S, type ChatTurnTextPartInput as T, DISPATCH_MAX_MEDIA_PARTS as U, DISPATCH_MAX_PARTS as V, DISPATCH_REQUEST_MAX_BYTES as W, DISPATCH_STRUCTURAL_RESERVE_BYTES as X, type FileMentionsToPartsOptions as Y, INLINE_PARTS_MAX_BYTES as Z, MENTION_MAX_COUNT as _, type ChatAttachmentKind as a, type ProducerNoticeEvent as a0, type ProducerPassthroughEvent as a1, type ProducerPassthroughEventType as a2, type ProducerReasoningEvent as a3, type ProducerTextEvent as a4, type ProducerToolCallEvent as a5, type ProducerToolResultEvent as a6, type ProducerUsageEvent as a7, type ProducerWireEvent as a8, type SandboxMentionPathCheck as a9, assertPromptPartsWithinCap as aa, base64WireLen as ab, buildMentionPromptBlock as ac, chatTurnRequestInit as ad, fileMentionsToParts as ae, formatBytes as af, mediaTypeForMentionPath as ag, mentionKindForPath as ah, parseChatTurnParts as ai, parseFileMentions as aj, promptPartsByteSize as ak, validateSandboxMentionPath as al, type ChatAttachmentPart as b, type ChatFilePart as c, type ChatImagePart as d, type ChatInteractionPart as e, type ChatMentionKind as f, type ChatMentionPart as g, type ChatNoticePart as h, type ChatPartTime as i, type ChatPlanPart as j, type ChatReasoningPart as k, type ChatStepFinishPart as l, type ChatStepStartPart as m, type ChatSubtaskPart as n, type ChatTextPart as o, type ChatToolPart as p, type ChatToolState as q, type ChatToolStatus as r, type ChatUsageTokens as s, type ChatWorkProductPart as t, attachmentInputToPart as u, attachmentKindForMime as v, attachmentPartsFromMessageParts as w, buildAttachmentPromptBlock as x, historyContentWithAttachments as y, isChatAttachmentPart as z };
339
+ export { isChatPlanPart as A, isChatStepFinishPart as B, type ChatMessagePart as C, DEFAULT_ATTACHMENT_PROMPT_HEADER as D, isChatTextPart as E, isChatToolPart as F, isChatWorkProductPart as G, mentionInputToPart as H, mentionPartsFromMessageParts as I, toChatMessageParts as J, type StorableHarnessPartKind as S, type ChatAttachmentPart as a, type ChatFilePart as b, type ChatImagePart as c, type ChatInteractionPart as d, type ChatMentionPart as e, type ChatNoticePart as f, type ChatPartTime as g, type ChatPlanPart as h, type ChatReasoningPart as i, type ChatStepFinishPart as j, type ChatStepStartPart as k, type ChatSubtaskPart as l, type ChatTextPart as m, type ChatToolPart as n, type ChatToolState as o, type ChatToolStatus as p, type ChatUsageTokens as q, type ChatWorkProductPart as r, attachmentInputToPart as s, attachmentKindForMime as t, attachmentPartsFromMessageParts as u, buildAttachmentPromptBlock as v, historyContentWithAttachments as w, isChatAttachmentPart as x, isChatInteractionPart as y, isChatMentionPart as z };
@@ -1,4 +1,4 @@
1
- import { W as WorkProductRef, a as WorkProductProvenance, b as WorkProductRecord } from './types-DB82fktc.js';
1
+ import { a as WorkProductRef, b as WorkProductProvenance, c as WorkProductRecord } from './types-CCeYywdS.js';
2
2
 
3
3
  /**
4
4
  * The review queue is a PROJECTION, not a store — a client-safe pure fold of
@@ -369,6 +369,29 @@ interface SandboxApiCredentials {
369
369
  baseUrl: string;
370
370
  apiKey: string;
371
371
  }
372
+ /**
373
+ * Build the sandbox API's sidecar-proxy base for a box:
374
+ * `{baseUrl}/v1/sidecar-proxy/{sandboxId}`.
375
+ *
376
+ * This is the ONLY upstream that serves the interactive terminal. Measured on
377
+ * production (`sandbox.tangle.tools`, one box, `ws` client, same credential in
378
+ * every arm):
379
+ *
380
+ * | upstream base | result |
381
+ * |----------------------------------------|---------------------------------|
382
+ * | `/v1/sidecar-proxy/{id}` | 101 -> `ready` 2551ms -> shell |
383
+ * | `/v1/sandboxes/{id}/runtime/` | HTTP 500 |
384
+ * | `connection.runtimeUrl` (the box host) | 101 then close 1000, 0 bytes |
385
+ *
386
+ * The box's own `connection.runtimeUrl` (`https://sandbox-*.tangle.sh`) accepts
387
+ * the upgrade — its Caddy front end upgrades every path, including ones that do
388
+ * not exist — and then hangs up without a PTY. A 101 from that host therefore
389
+ * proves nothing; only a `ready` control frame does. Two products shipped a
390
+ * terminal against it and rendered a permanent spinner.
391
+ *
392
+ * Exported so no product writes the path literal a fourth time.
393
+ */
394
+ declare function sandboxSidecarProxyUrl(baseUrl: string, sandboxId: string): string;
372
395
  /** Define a connection configuration for sandbox runtime including URL and optional server-side auth token */
373
396
  interface SandboxRuntimeConnection {
374
397
  runtimeUrl: string;
@@ -464,6 +487,42 @@ interface WorkspaceSandboxTerminalUpgradeHandlerOptions {
464
487
  * ```
465
488
  */
466
489
  declare function createWorkspaceSandboxTerminalUpgradeHandler(opts: WorkspaceSandboxTerminalUpgradeHandlerOptions): (request: Request) => Promise<Response | null>;
490
+ /** A response-like shape carrying just what the subprotocol echo decision reads. */
491
+ interface TerminalUpgradeResponseLike {
492
+ status: number;
493
+ statusText?: string;
494
+ headers: Headers;
495
+ }
496
+ /**
497
+ * Decide whether a terminal upgrade's 101 needs the browser's own subprotocol
498
+ * echoed back onto it, and return the headers to answer with. `null` means
499
+ * "pass the upstream response through untouched".
500
+ *
501
+ * Why this exists: the browser's terminal credential rides in a
502
+ * `bearer.<base64url>` WebSocket subprotocol, because a browser cannot set
503
+ * `Authorization` on a WS handshake. That subprotocol is a browser-to-Worker
504
+ * credential, so it is stripped before the upstream hop — and the upstream then
505
+ * answers the 101 selecting nothing. A browser MUST fail the connection when a
506
+ * 101 selects no subprotocol after it offered one (RFC 6455 s4.1), so the socket
507
+ * dies on open and the terminal renders a spinner forever.
508
+ *
509
+ * Kept as a pure function because a 101 `Response` cannot be constructed off
510
+ * Workers, so this is the only part of the decision a test can drive directly.
511
+ */
512
+ declare function terminalUpgradeSubprotocolEcho(upstream: TerminalUpgradeResponseLike, browserProtocol: string | null): {
513
+ status: number;
514
+ statusText: string;
515
+ headers: Headers;
516
+ } | null;
517
+ /**
518
+ * The exact `bearer.*` subprotocol string the browser offered, so it can be
519
+ * echoed verbatim on the 101. Returns null when the browser offered none.
520
+ *
521
+ * Takes the raw `Sec-WebSocket-Protocol` value rather than the `Headers`, to
522
+ * match its siblings `bearerSubprotocolToken` and `stripBearerSubprotocol` —
523
+ * one shape for the whole family, and the caller reads the header once.
524
+ */
525
+ declare function selectedBearerSubprotocol(value: string | null): string | null;
467
526
  /** Build proxy headers for sandbox runtime including authorization and forwarded headers */
468
527
  declare function buildSandboxRuntimeProxyHeaders(source: Headers, sandboxApiKey: string, forwardHeaders?: string[]): Headers;
469
528
  /** Encode a runtime path by URI-encoding each valid segment and returning null for invalid segments */
@@ -475,6 +534,199 @@ declare function bearerSubprotocolToken(value: string | null): string | null;
475
534
  /** Resolve the terminal token from request headers using Authorization or Sec-WebSocket-Protocol fields */
476
535
  declare function terminalTokenFromRequest(headers: Headers): string | null;
477
536
 
537
+ /**
538
+ * `createSandboxPrewarmer` — "this user just opened this project; start warming
539
+ * their box" as a shell primitive, so every agent-app product gets the same
540
+ * answer instead of forking one.
541
+ *
542
+ * WHY THIS IS SHELL, NOT ENGINE. The engine rule asks whether the capability
543
+ * makes sense without a specific app's side channel. "Warm a box" does — but
544
+ * `@tangle-network/sandbox` has no notion of a WORKSPACE. It keys boxes by an
545
+ * opaque sandbox id; the workspace→box mapping, the harness match, and the
546
+ * profile materialisation all live in `ensureWorkspaceSandbox` here. A
547
+ * prewarmer is that mapping plus a scheduling policy, so it belongs beside it.
548
+ * It is deliberately NOT a new subpath: it composes `peekWorkspaceSandbox` and
549
+ * `ensureWorkspaceSandbox` directly and needs exactly the peers `/sandbox`
550
+ * already needs, so a separate entry would add a second place to look for "how
551
+ * do I get a box" and buy no peer isolation (the reason `/work-product-react`
552
+ * is split out).
553
+ *
554
+ * WHAT IT IS NOT. It does not make cold starts fast — they already are.
555
+ * Measured on the real platform (staging-sandbox, n=5, 2026-07-28): a box goes
556
+ * from nothing to terminal-ready in 2.34–3.19 s (median 2.73 s), and an
557
+ * already-running box answers in 1.16–2.29 s (median 1.35 s). Prewarming buys
558
+ * ~1.4 s. The reason it matters is not latency: it is that a product which
559
+ * only ever provisions lazily, on a path whose guard never passes, never
560
+ * provisions AT ALL — and the UI then shows a spinner over a box that does not
561
+ * exist and is not being created. That is the failure this primitive removes.
562
+ *
563
+ * ── COST POSTURE (read before adopting) ────────────────────────────────────
564
+ * A warmed box is a REAL charge. It bills from creation until the platform's
565
+ * idle timeout reclaims it — `SandboxRuntimeConfig`'s create-time
566
+ * `idleTimeoutSeconds`, not anything this module sets. A product warming on
567
+ * every project open pays that timeout for every user who opens and bounces.
568
+ * With a 3600 s idle timeout against a ~131 s mean session life, a bounce
569
+ * costs an hour of box time to save ~1.4 s. THAT TRADE IS USUALLY WRONG.
570
+ *
571
+ * So the levers are explicit and the defaults are the cheap ones:
572
+ * - `mode: 'resume-only'` (DEFAULT) never creates a box that does not exist.
573
+ * It only revives one the user already has, so the spend is bounded by
574
+ * boxes the user already caused. This is the safe fleet default.
575
+ * - `mode: 'create-or-resume'` is the owner-requested behaviour — warm on
576
+ * open even for a first-time user. Opt in per product, and lower the
577
+ * shell's `idleTimeoutSeconds` when you do.
578
+ * - `shouldPrewarm(scope)` is the product's own policy hook (paid tier only,
579
+ * returning user only, has-documents only …). Returning false costs nothing.
580
+ * - `failureCooldownMs` stops a hard-failing workspace from retry-storming;
581
+ * every retry is another create attempt, which is more spend.
582
+ * Warm with the SAME harness the next turn will use. `ensureWorkspaceSandbox`
583
+ * DELETES and recreates a name-matched box whose harness differs, so warming
584
+ * `opencode` and then turning `claude-code` pays for two boxes and is slower
585
+ * than not warming at all. The prewarm key includes the harness so the two are
586
+ * never deduped into one.
587
+ *
588
+ * ── SINGLE-FLIGHT (measured, not assumed) ──────────────────────────────────
589
+ * The sandbox platform does NOT dedupe by box name. Two concurrent
590
+ * `POST /v1/sandboxes` with an identical name both returned HTTP 201 and left
591
+ * two running boxes (verified against staging-sandbox, 2026-07-28). So two
592
+ * tabs, or two isolates, racing a warm genuinely leak a box — a prewarm that
593
+ * races is worse than no prewarm. Hence two layers:
594
+ * 1. an in-process map, which is free and catches same-isolate races
595
+ * (double-mount, two requests on one isolate);
596
+ * 2. a `claim` store the product supplies, which is the only thing that can
597
+ * make this correct ACROSS isolates — the usual deployment target here is
598
+ * Cloudflare Workers, where "same isolate" guarantees nothing.
599
+ * `claim` is REQUIRED, with `'single-isolate-only'` as the explicit opt-out,
600
+ * so nobody gets the unsafe behaviour by forgetting a field. Say it out loud
601
+ * or supply a store.
602
+ *
603
+ * ── FAILURE IS LOUD, NEVER FATAL ───────────────────────────────────────────
604
+ * A failed warm degrades to exactly today's lazy path: the next real request
605
+ * calls `ensureWorkspaceSandbox` itself. It never throws into the caller's
606
+ * render path — `completion` RESOLVES with `{ ok: false }` rather than
607
+ * rejecting, because an unhandled rejection handed to `waitUntil` can fail the
608
+ * request it rode in on. But it is never silent: every failure fires
609
+ * `onEvent({ type: 'failed' })` and is readable afterwards through
610
+ * `readiness()` as `{ status: 'failed' }`. The bug class this whole module
611
+ * exists to kill is a soft failure that surfaces as an unusable panel ten
612
+ * minutes later, so a warm that dies must leave a trace a product can render.
613
+ */
614
+
615
+ /** The workspace a warm targets. Mirrors `EnsureWorkspaceSandboxOptions`'
616
+ * identity fields — the prewarmer forwards them verbatim so a warmed box is
617
+ * byte-identical to the one the lazy path would have built. */
618
+ interface SandboxPrewarmScope {
619
+ workspaceId: string;
620
+ userId?: string;
621
+ /** Must match the harness the next turn will use — see the cost note above. */
622
+ harness: Harness;
623
+ billingOwnerId?: string;
624
+ }
625
+ /**
626
+ * Cross-isolate claim. `acquire` must be atomic (a D1 conditional insert, a DO,
627
+ * a KV `put` with `onlyIf`) — a read-then-write is exactly the race this exists
628
+ * to close. `ttlSeconds` bounds a claim leaked by an isolate that died
629
+ * mid-warm; without expiry a single crash wedges a workspace forever.
630
+ */
631
+ interface PrewarmClaimStore {
632
+ /** True when THIS caller now owns the right to warm `key`. */
633
+ acquire(key: string, ttlSeconds: number): Promise<boolean>;
634
+ /** Best-effort release. A throw here is swallowed — the TTL is the backstop. */
635
+ release(key: string): Promise<void>;
636
+ /** Optional: lets `readiness()` report `warming` for a warm running in
637
+ * ANOTHER isolate. Without it, `warming` is only visible in the isolate
638
+ * that started it, and every other one reports `absent`. */
639
+ isHeld?(key: string): Promise<boolean>;
640
+ }
641
+ /** What `prewarm()` decided. Every value except `started` means no box was
642
+ * created and nothing was spent on this call. */
643
+ type PrewarmOutcome = 'started' | 'already-running' | 'already-warming' | 'warming-elsewhere' | 'declined-by-policy' | 'cooling-down' | 'absent-and-resume-only';
644
+ /** Terminal result of a warm this caller owns. Never a rejection. */
645
+ interface PrewarmResult {
646
+ ok: boolean;
647
+ boxId?: string;
648
+ error?: string;
649
+ /** Wall time of the warm itself, for the product's own timing trace. */
650
+ ms: number;
651
+ }
652
+ interface PrewarmDecision {
653
+ outcome: PrewarmOutcome;
654
+ /** Present ONLY when `outcome === 'started'`. Hand it to `ctx.waitUntil` so a
655
+ * client disconnect cannot kill the warm. Never rejects. */
656
+ completion?: Promise<PrewarmResult>;
657
+ }
658
+ /** Readiness for the UI. `ready`/`warming` reuse the vocabulary
659
+ * `createSandboxFileIndexRoute` (`/chat-routes`) and `useFileMentions`
660
+ * (`/web-react`) already speak, so a product renders ONE warming state rather
661
+ * than inventing a second spinner for boxes. */
662
+ type SandboxReadiness = {
663
+ status: 'ready';
664
+ boxId: string;
665
+ } | {
666
+ status: 'warming';
667
+ } | {
668
+ status: 'absent';
669
+ } | {
670
+ status: 'failed';
671
+ error: string;
672
+ retryAfterMs: number;
673
+ };
674
+ type PrewarmEvent = {
675
+ type: 'started';
676
+ key: string;
677
+ workspaceId: string;
678
+ } | {
679
+ type: 'succeeded';
680
+ key: string;
681
+ workspaceId: string;
682
+ boxId: string;
683
+ ms: number;
684
+ } | {
685
+ type: 'failed';
686
+ key: string;
687
+ workspaceId: string;
688
+ error: string;
689
+ ms: number;
690
+ } | {
691
+ type: 'skipped';
692
+ key: string;
693
+ workspaceId: string;
694
+ outcome: PrewarmOutcome;
695
+ };
696
+ interface SandboxPrewarmerOptions {
697
+ /** Cross-isolate single-flight, or the explicit acknowledgement that you are
698
+ * accepting per-isolate dedupe only. No default — see the header. */
699
+ claim: PrewarmClaimStore | 'single-isolate-only';
700
+ /** `'resume-only'` (default) never creates a box that does not exist.
701
+ * `'create-or-resume'` warms from nothing — the expensive one. */
702
+ mode?: 'resume-only' | 'create-or-resume';
703
+ /** Product policy gate. Not called when a box is already running. */
704
+ shouldPrewarm?(scope: SandboxPrewarmScope): boolean | Promise<boolean>;
705
+ /** Observability seam. A failed warm MUST be visible somewhere. */
706
+ onEvent?(event: PrewarmEvent): void;
707
+ /** Claim lifetime. Default 180 s — comfortably over a cold create. */
708
+ claimTtlSeconds?: number;
709
+ /** Suppress re-warming a workspace that just failed. Default 60_000 ms. */
710
+ failureCooldownMs?: number;
711
+ /** Clock seam for tests. */
712
+ now?(): number;
713
+ }
714
+ interface SandboxPrewarmer {
715
+ /**
716
+ * Non-blocking warm. The returned promise settles as soon as the DECISION is
717
+ * known (at most one `list()` against the platform, plus a claim `acquire`);
718
+ * the provisioning itself rides on `completion`. On a render path either
719
+ * ignore the returned promise or run the whole call inside `waitUntil` — do
720
+ * not await `completion` before responding.
721
+ */
722
+ prewarm(scope: SandboxPrewarmScope): Promise<PrewarmDecision>;
723
+ /** Zero-provisioning status read for a UI. Never creates or resumes. */
724
+ readiness(scope: SandboxPrewarmScope): Promise<SandboxReadiness>;
725
+ /** Clear a recorded failure so the next `prewarm` retries immediately. */
726
+ clearFailure(scope: SandboxPrewarmScope): void;
727
+ }
728
+ declare function createSandboxPrewarmer(shell: SandboxRuntimeConfig, options: SandboxPrewarmerOptions): SandboxPrewarmer;
729
+
478
730
  /** Define client credentials for accessing the sandbox environment with API key and base URL */
479
731
  interface SandboxClientCredentials {
480
732
  apiKey: string;
@@ -976,4 +1228,4 @@ declare function isTerminalPromptEvent(event: unknown): boolean;
976
1228
  /** Resolve the interactive question text from a structured event or return null if none found */
977
1229
  declare function detectInteractiveQuestion(event: unknown): string | null;
978
1230
 
979
- export { type AppToolDescriptor, type AuthenticatedSandboxUser, type BuildAppToolMcpServersOptions, type BuildSandboxToolFileMountsOptions, DEFAULT_SANDBOX_RESOURCES, type DriveSandboxTurnOptions, ENV_TOTAL_MAX_BYTES, ENV_VALUE_MAX_BYTES, type EnsureWorkspaceSandboxOptions, type LivenessProbeConfig, type MemberSyncSeam, type ModelSelection, type ModelSelectionError, type ModelSelectionFailure, type ModelSelectionSource, type Outcome, PROVISION_PAYLOAD_MAX_BYTES, type PeekWorkspaceSandboxOutcome, type ProfileComposeOptions, type PromptInputPart, type ProviderResolutionConfig, type ProvisionPayloadSections, type ProvisionProfileSection, type ResolveSandboxClientCredentialsOptions, type ResolvedModel, type SandboxApiCredentials, type SandboxBuildContext, type SandboxClientCredentials, type SandboxCredentialEnvironment, type SandboxExecChannel, type SandboxExecOptions, type SandboxFileBytesOutcome, type SandboxFileSizeOutcome, SandboxModelResolutionError, type SandboxPermissionLevel, SandboxRecoveryFailedError, type SandboxRecoveryPhase, type SandboxResourceConfig, type SandboxRestoreSpec, SandboxRuntimeAuthRefreshError, type SandboxRuntimeConfig, type SandboxRuntimeConnection, type SandboxScope, type SandboxStepTransition, type SandboxTerminalTokenOptions, type SandboxTerminalTokenResult, type SandboxTerminalTokenSubject, type SandboxTerminalWsMatch, type SandboxToolPathOptions, type SandboxToolSpec, type ScopedTokenResult, type SecretStore, type StoppedSandboxResumeFailure, type StoppedSandboxResumeRecovery, type StreamSandboxPromptOptions, type TerminalProxyIdentity, type WorkspaceSandboxConnectionArgs, type WorkspaceSandboxConnectionHandlerOptions, type WorkspaceSandboxEnsureContext, type WorkspaceSandboxInstanceLike, type WorkspaceSandboxManager, type WorkspaceSandboxManagerOptions, type WorkspaceSandboxRuntimeProxyArgs, type WorkspaceSandboxRuntimeProxyHandlerOptions, type WorkspaceSandboxTerminalUpgradeHandlerOptions, type WriteProfileFilesOptions, assertEnvWithinLimits, assertProvisionPayloadWithinCap, attachReasoningEffort, bearerSubprotocolToken, bearerToken, buildAppToolMcpServers, buildSandboxRuntimeProxyHeaders, buildSandboxToolFileMounts, buildSandboxToolPathSetupScript, classifySeveredStream, collectSandboxPromptText, createSandboxTerminalToken, createWorkspaceSandboxConnectionHandler, createWorkspaceSandboxManager, createWorkspaceSandboxRuntimeProxyHandler, createWorkspaceSandboxTerminalUpgradeHandler, deferredCorpusHash, deleteSecret, detectInteractiveQuestion, driveSandboxTurn, encodeSandboxRuntimePath, ensureWorkspaceSandbox, flattenHistory, getClient, isSandboxTerminalWsUpgrade, isTerminalPromptEvent, matchSandboxTerminalWsPath, mergeExtraMcp, mergeHistoryIntoParts, mintSandboxScopedToken, mintTerminalProxyToken, peekWorkspaceSandbox, readSandboxBinaryBytes, readSecret, requireTransportableModel, resetClientCache, resolveModel, resolveModelSelection, resolveSandboxClientCredentials, runSandboxPrompt, runSandboxToolPathSetup, sandboxToolBinDir, sandboxToolPath, sandboxToolRootDir, secretStoreFromClient, shellQuote, splitDeferredProfileFiles, statSandboxFileSize, storeSecret, streamSandboxPrompt, syncSandboxMemberAdd, syncSandboxMemberRemove, syncSandboxMemberRole, terminalTokenFromRequest, verifySandboxTerminalToken, verifyTerminalProxyToken, writeProfileFilesToBox };
1231
+ export { type AppToolDescriptor, type AuthenticatedSandboxUser, type BuildAppToolMcpServersOptions, type BuildSandboxToolFileMountsOptions, DEFAULT_SANDBOX_RESOURCES, type DriveSandboxTurnOptions, ENV_TOTAL_MAX_BYTES, ENV_VALUE_MAX_BYTES, type EnsureWorkspaceSandboxOptions, type LivenessProbeConfig, type MemberSyncSeam, type ModelSelection, type ModelSelectionError, type ModelSelectionFailure, type ModelSelectionSource, type Outcome, PROVISION_PAYLOAD_MAX_BYTES, type PeekWorkspaceSandboxOutcome, type PrewarmClaimStore, type PrewarmDecision, type PrewarmEvent, type PrewarmOutcome, type PrewarmResult, type ProfileComposeOptions, type PromptInputPart, type ProviderResolutionConfig, type ProvisionPayloadSections, type ProvisionProfileSection, type ResolveSandboxClientCredentialsOptions, type ResolvedModel, type SandboxApiCredentials, type SandboxBuildContext, type SandboxClientCredentials, type SandboxCredentialEnvironment, type SandboxExecChannel, type SandboxExecOptions, type SandboxFileBytesOutcome, type SandboxFileSizeOutcome, SandboxModelResolutionError, type SandboxPermissionLevel, type SandboxPrewarmScope, type SandboxPrewarmer, type SandboxPrewarmerOptions, type SandboxReadiness, SandboxRecoveryFailedError, type SandboxRecoveryPhase, type SandboxResourceConfig, type SandboxRestoreSpec, SandboxRuntimeAuthRefreshError, type SandboxRuntimeConfig, type SandboxRuntimeConnection, type SandboxScope, type SandboxStepTransition, type SandboxTerminalTokenOptions, type SandboxTerminalTokenResult, type SandboxTerminalTokenSubject, type SandboxTerminalWsMatch, type SandboxToolPathOptions, type SandboxToolSpec, type ScopedTokenResult, type SecretStore, type StoppedSandboxResumeFailure, type StoppedSandboxResumeRecovery, type StreamSandboxPromptOptions, type TerminalProxyIdentity, type TerminalUpgradeResponseLike, type WorkspaceSandboxConnectionArgs, type WorkspaceSandboxConnectionHandlerOptions, type WorkspaceSandboxEnsureContext, type WorkspaceSandboxInstanceLike, type WorkspaceSandboxManager, type WorkspaceSandboxManagerOptions, type WorkspaceSandboxRuntimeProxyArgs, type WorkspaceSandboxRuntimeProxyHandlerOptions, type WorkspaceSandboxTerminalUpgradeHandlerOptions, type WriteProfileFilesOptions, assertEnvWithinLimits, assertProvisionPayloadWithinCap, attachReasoningEffort, bearerSubprotocolToken, bearerToken, buildAppToolMcpServers, buildSandboxRuntimeProxyHeaders, buildSandboxToolFileMounts, buildSandboxToolPathSetupScript, classifySeveredStream, collectSandboxPromptText, createSandboxPrewarmer, createSandboxTerminalToken, createWorkspaceSandboxConnectionHandler, createWorkspaceSandboxManager, createWorkspaceSandboxRuntimeProxyHandler, createWorkspaceSandboxTerminalUpgradeHandler, deferredCorpusHash, deleteSecret, detectInteractiveQuestion, driveSandboxTurn, encodeSandboxRuntimePath, ensureWorkspaceSandbox, flattenHistory, getClient, isSandboxTerminalWsUpgrade, isTerminalPromptEvent, matchSandboxTerminalWsPath, mergeExtraMcp, mergeHistoryIntoParts, mintSandboxScopedToken, mintTerminalProxyToken, peekWorkspaceSandbox, readSandboxBinaryBytes, readSecret, requireTransportableModel, resetClientCache, resolveModel, resolveModelSelection, resolveSandboxClientCredentials, runSandboxPrompt, runSandboxToolPathSetup, sandboxSidecarProxyUrl, sandboxToolBinDir, sandboxToolPath, sandboxToolRootDir, secretStoreFromClient, selectedBearerSubprotocol, shellQuote, splitDeferredProfileFiles, statSandboxFileSize, storeSecret, streamSandboxPrompt, syncSandboxMemberAdd, syncSandboxMemberRemove, syncSandboxMemberRole, terminalTokenFromRequest, terminalUpgradeSubprotocolEcho, verifySandboxTerminalToken, verifyTerminalProxyToken, writeProfileFilesToBox };
@@ -17,6 +17,7 @@ import {
17
17
  buildSandboxToolPathSetupScript,
18
18
  classifySeveredStream,
19
19
  collectSandboxPromptText,
20
+ createSandboxPrewarmer,
20
21
  createSandboxTerminalToken,
21
22
  createWorkspaceSandboxConnectionHandler,
22
23
  createWorkspaceSandboxManager,
@@ -47,10 +48,12 @@ import {
47
48
  resolveSandboxClientCredentials,
48
49
  runSandboxPrompt,
49
50
  runSandboxToolPathSetup,
51
+ sandboxSidecarProxyUrl,
50
52
  sandboxToolBinDir,
51
53
  sandboxToolPath,
52
54
  sandboxToolRootDir,
53
55
  secretStoreFromClient,
56
+ selectedBearerSubprotocol,
54
57
  shellQuote,
55
58
  splitDeferredProfileFiles,
56
59
  statSandboxFileSize,
@@ -60,10 +63,11 @@ import {
60
63
  syncSandboxMemberRemove,
61
64
  syncSandboxMemberRole,
62
65
  terminalTokenFromRequest,
66
+ terminalUpgradeSubprotocolEcho,
63
67
  verifySandboxTerminalToken,
64
68
  verifyTerminalProxyToken,
65
69
  writeProfileFilesToBox
66
- } from "../chunk-7775L5NN.js";
70
+ } from "../chunk-BAC2B2KI.js";
67
71
  import "../chunk-LWSJK546.js";
68
72
  import "../chunk-CQZSAR77.js";
69
73
  import "../chunk-ICOHEZK6.js";
@@ -90,6 +94,7 @@ export {
90
94
  buildSandboxToolPathSetupScript,
91
95
  classifySeveredStream,
92
96
  collectSandboxPromptText,
97
+ createSandboxPrewarmer,
93
98
  createSandboxTerminalToken,
94
99
  createWorkspaceSandboxConnectionHandler,
95
100
  createWorkspaceSandboxManager,
@@ -120,10 +125,12 @@ export {
120
125
  resolveSandboxClientCredentials,
121
126
  runSandboxPrompt,
122
127
  runSandboxToolPathSetup,
128
+ sandboxSidecarProxyUrl,
123
129
  sandboxToolBinDir,
124
130
  sandboxToolPath,
125
131
  sandboxToolRootDir,
126
132
  secretStoreFromClient,
133
+ selectedBearerSubprotocol,
127
134
  shellQuote,
128
135
  splitDeferredProfileFiles,
129
136
  statSandboxFileSize,
@@ -133,6 +140,7 @@ export {
133
140
  syncSandboxMemberRemove,
134
141
  syncSandboxMemberRole,
135
142
  terminalTokenFromRequest,
143
+ terminalUpgradeSubprotocolEcho,
136
144
  verifySandboxTerminalToken,
137
145
  verifyTerminalProxyToken,
138
146
  writeProfileFilesToBox