@xenosystem/agent-interface-host 0.1.4 → 0.1.6

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 (124) hide show
  1. package/dist/acp/AcpAgentRegistryService.d.ts +43 -1
  2. package/dist/acp/AcpAgentRegistryService.d.ts.map +1 -1
  3. package/dist/acp/AcpAgentRegistryService.js +200 -1
  4. package/dist/acp/AcpAgentRegistryService.js.map +1 -1
  5. package/dist/acp/AcpAgentTurnExecutionAdapter.d.ts +66 -0
  6. package/dist/acp/AcpAgentTurnExecutionAdapter.d.ts.map +1 -1
  7. package/dist/acp/AcpAgentTurnExecutionAdapter.js +182 -1
  8. package/dist/acp/AcpAgentTurnExecutionAdapter.js.map +1 -1
  9. package/dist/acp/AcpPermissionBridge.d.ts.map +1 -1
  10. package/dist/acp/AcpPermissionBridge.js +3 -3
  11. package/dist/acp/AcpPermissionBridge.js.map +1 -1
  12. package/dist/acp/AcpProcessSupervisor.d.ts +81 -0
  13. package/dist/acp/AcpProcessSupervisor.d.ts.map +1 -1
  14. package/dist/acp/AcpProcessSupervisor.js +176 -2
  15. package/dist/acp/AcpProcessSupervisor.js.map +1 -1
  16. package/dist/acp/AcpProviderCatalogService.d.ts.map +1 -1
  17. package/dist/acp/AcpProviderCatalogService.js +68 -2
  18. package/dist/acp/AcpProviderCatalogService.js.map +1 -1
  19. package/dist/acp/AcpRuntimeEventMapper.d.ts.map +1 -1
  20. package/dist/acp/AcpRuntimeEventMapper.js +9 -0
  21. package/dist/acp/AcpRuntimeEventMapper.js.map +1 -1
  22. package/dist/acp/AcpSessionService.d.ts +36 -0
  23. package/dist/acp/AcpSessionService.d.ts.map +1 -1
  24. package/dist/acp/AcpSessionService.js +57 -1
  25. package/dist/acp/AcpSessionService.js.map +1 -1
  26. package/dist/acp/DurableAcpPermissionPolicyStore.d.ts.map +1 -1
  27. package/dist/acp/DurableAcpPermissionPolicyStore.js +5 -3
  28. package/dist/acp/DurableAcpPermissionPolicyStore.js.map +1 -1
  29. package/dist/acp/acpRedaction.d.ts.map +1 -1
  30. package/dist/acp/acpRedaction.js +2 -0
  31. package/dist/acp/acpRedaction.js.map +1 -1
  32. package/dist/acp/acpTypes.d.ts +111 -1
  33. package/dist/acp/acpTypes.d.ts.map +1 -1
  34. package/dist/acp/acpTypes.js +21 -1
  35. package/dist/acp/acpTypes.js.map +1 -1
  36. package/dist/index.d.ts +108 -2
  37. package/dist/index.d.ts.map +1 -1
  38. package/dist/index.js +236 -11
  39. package/dist/index.js.map +1 -1
  40. package/dist/isolation/CommandExecution.d.ts +7 -12
  41. package/dist/isolation/CommandExecution.d.ts.map +1 -1
  42. package/dist/isolation/CommandExecution.js +7 -12
  43. package/dist/isolation/CommandExecution.js.map +1 -1
  44. package/dist/isolation/CommandStream.d.ts +100 -0
  45. package/dist/isolation/CommandStream.d.ts.map +1 -0
  46. package/dist/isolation/CommandStream.js +47 -0
  47. package/dist/isolation/CommandStream.js.map +1 -0
  48. package/dist/isolation/RunExecutionEnvironment.d.ts +15 -0
  49. package/dist/isolation/RunExecutionEnvironment.d.ts.map +1 -1
  50. package/dist/isolation/RunExecutionEnvironment.js +45 -9
  51. package/dist/isolation/RunExecutionEnvironment.js.map +1 -1
  52. package/dist/isolation/RunIsolationService.d.ts +10 -5
  53. package/dist/isolation/RunIsolationService.d.ts.map +1 -1
  54. package/dist/isolation/RunIsolationService.js +7 -3
  55. package/dist/isolation/RunIsolationService.js.map +1 -1
  56. package/dist/isolation/SandboxCapabilities.d.ts +28 -0
  57. package/dist/isolation/SandboxCapabilities.d.ts.map +1 -0
  58. package/dist/isolation/SandboxCapabilities.js +33 -0
  59. package/dist/isolation/SandboxCapabilities.js.map +1 -0
  60. package/dist/isolation/SandboxCommandExecutor.d.ts +4 -7
  61. package/dist/isolation/SandboxCommandExecutor.d.ts.map +1 -1
  62. package/dist/isolation/SandboxCommandExecutor.js +6 -7
  63. package/dist/isolation/SandboxCommandExecutor.js.map +1 -1
  64. package/dist/isolation/SandboxCommandStream.d.ts +38 -0
  65. package/dist/isolation/SandboxCommandStream.d.ts.map +1 -0
  66. package/dist/isolation/SandboxCommandStream.js +232 -0
  67. package/dist/isolation/SandboxCommandStream.js.map +1 -0
  68. package/dist/isolation/shellArgv.d.ts +15 -0
  69. package/dist/isolation/shellArgv.d.ts.map +1 -0
  70. package/dist/isolation/shellArgv.js +31 -0
  71. package/dist/isolation/shellArgv.js.map +1 -0
  72. package/dist/isolation/useIdempotency.d.ts +19 -0
  73. package/dist/isolation/useIdempotency.d.ts.map +1 -0
  74. package/dist/isolation/useIdempotency.js +57 -0
  75. package/dist/isolation/useIdempotency.js.map +1 -0
  76. package/dist/localRpcTransport.d.ts +18 -0
  77. package/dist/localRpcTransport.d.ts.map +1 -1
  78. package/dist/localRpcTransport.js +38 -4
  79. package/dist/localRpcTransport.js.map +1 -1
  80. package/dist/node.d.ts +19 -0
  81. package/dist/node.d.ts.map +1 -1
  82. package/dist/node.js +19 -0
  83. package/dist/node.js.map +1 -1
  84. package/dist/observation/XenoUseRunObserver.d.ts +20 -0
  85. package/dist/observation/XenoUseRunObserver.d.ts.map +1 -1
  86. package/dist/observation/XenoUseRunObserver.js +27 -13
  87. package/dist/observation/XenoUseRunObserver.js.map +1 -1
  88. package/dist/runtime/RuntimeTimelineProjection.d.ts +2 -2
  89. package/dist/runtime/RuntimeTimelineProjection.d.ts.map +1 -1
  90. package/dist/runtime/RuntimeTimelineProjection.js +196 -1
  91. package/dist/runtime/RuntimeTimelineProjection.js.map +1 -1
  92. package/dist/sdk/DurablePendingInjectionStore.d.ts +24 -0
  93. package/dist/sdk/DurablePendingInjectionStore.d.ts.map +1 -0
  94. package/dist/sdk/DurablePendingInjectionStore.js +103 -0
  95. package/dist/sdk/DurablePendingInjectionStore.js.map +1 -0
  96. package/dist/sdk/SdkNativeAgentTurnExecutionAdapter.d.ts +81 -1
  97. package/dist/sdk/SdkNativeAgentTurnExecutionAdapter.d.ts.map +1 -1
  98. package/dist/sdk/SdkNativeAgentTurnExecutionAdapter.js +122 -3
  99. package/dist/sdk/SdkNativeAgentTurnExecutionAdapter.js.map +1 -1
  100. package/dist/sdk/pendingInjections.d.ts +83 -0
  101. package/dist/sdk/pendingInjections.d.ts.map +1 -0
  102. package/dist/sdk/pendingInjections.js +79 -0
  103. package/dist/sdk/pendingInjections.js.map +1 -0
  104. package/dist/session/AgentSessionService.d.ts +34 -0
  105. package/dist/session/AgentSessionService.d.ts.map +1 -1
  106. package/dist/session/AgentSessionService.js +85 -1
  107. package/dist/session/AgentSessionService.js.map +1 -1
  108. package/dist/session/nativeTuiSessionPty.d.ts +40 -0
  109. package/dist/session/nativeTuiSessionPty.d.ts.map +1 -0
  110. package/dist/session/nativeTuiSessionPty.js +142 -0
  111. package/dist/session/nativeTuiSessionPty.js.map +1 -0
  112. package/dist/session/nodePtyLoader.d.ts +23 -0
  113. package/dist/session/nodePtyLoader.d.ts.map +1 -0
  114. package/dist/session/nodePtyLoader.js +41 -0
  115. package/dist/session/nodePtyLoader.js.map +1 -0
  116. package/dist/session/renderSupport.d.ts +34 -0
  117. package/dist/session/renderSupport.d.ts.map +1 -1
  118. package/dist/session/renderSupport.js +39 -1
  119. package/dist/session/renderSupport.js.map +1 -1
  120. package/dist/workspace/WorkspaceHostService.d.ts +27 -2
  121. package/dist/workspace/WorkspaceHostService.d.ts.map +1 -1
  122. package/dist/workspace/WorkspaceHostService.js +221 -25
  123. package/dist/workspace/WorkspaceHostService.js.map +1 -1
  124. package/package.json +8 -8
@@ -0,0 +1,100 @@
1
+ /**
2
+ * Streaming counterpart to `CommandExecutionPort` — ADE step 9.
3
+ *
4
+ * `execute()` buffers to completion and answers once. No parameter turns that
5
+ * into a terminal. This is the other shape: output as it appears, plus a
6
+ * writable stdin, plus an explicit EOF that is a DROP rather than a flush.
7
+ *
8
+ * ## Why it is not more fields on the buffered port
9
+ *
10
+ * A stream is not a `Promise<Result>`. Pretending otherwise would force every
11
+ * one-shot caller to invent a listener they do not want, and every streaming
12
+ * caller to wait for a result that has not happened yet. The two sit beside
13
+ * each other, created from the same sandbox binding, so a composition cannot
14
+ * confine `runCommand` and leave the PTY on the host by forgetting a second
15
+ * wiring.
16
+ *
17
+ * ## Three things this must not get wrong
18
+ *
19
+ * All three are defects `xeno-use` actually hit:
20
+ *
21
+ * - **A chunk is BYTES, not text.** A multi-byte UTF-8 sequence can straddle a
22
+ * drain boundary. Decode with a streaming decoder at the surface that needs
23
+ * a string — never per chunk at the port.
24
+ * - **EOF is a DROP (`closeStdin`), not a flush.** Flushing stdin does not
25
+ * close it; the child never sees EOF and runs to its timeout.
26
+ * - **ASK THE CAPABILITY.** Streaming is a property of the runtime. The
27
+ * broker protocol can stream; the Unix-domain transport is a separate
28
+ * refusal. Assuming the stream exists works against one runtime and
29
+ * fails against another.
30
+ */
31
+ export interface CommandStreamRequest {
32
+ argv: readonly [string, ...string[]];
33
+ cwd: string;
34
+ /**
35
+ * REQUIRED. The substrate refuses an unbounded stream for the same reason
36
+ * the buffered port does: a wedged child becomes a wedged caller.
37
+ */
38
+ timeoutMs: number;
39
+ /**
40
+ * Ask for a PTY. Default off — streaming bytes is not a terminal.
41
+ * Ignored unless the runtime advertised `supports_exec_tty`.
42
+ */
43
+ tty?: boolean;
44
+ }
45
+ export interface CommandStreamChunk {
46
+ stream: 'stdout' | 'stderr';
47
+ bytes: Uint8Array;
48
+ }
49
+ export interface CommandStreamExit {
50
+ exitCode: number | null;
51
+ timedOut: boolean;
52
+ }
53
+ export interface CommandStreamListener {
54
+ onChunk(chunk: CommandStreamChunk): void;
55
+ onExit(exit: CommandStreamExit): void;
56
+ }
57
+ export interface CommandStreamSession {
58
+ /** Bytes for stdin, exactly as given. */
59
+ write(bytes: Uint8Array): Promise<void>;
60
+ /**
61
+ * EOF. Distinct from `kill`: a program waiting on stdin must be told
62
+ * "no more input" without the caller giving up the ability to stop it.
63
+ */
64
+ closeStdin(): Promise<void>;
65
+ kill(): Promise<void>;
66
+ /**
67
+ * False unless this session asked for a terminal AND the runtime
68
+ * advertised `supports_exec_tty`. A pipe is not a TTY.
69
+ */
70
+ readonly tty: boolean;
71
+ /**
72
+ * PTY size. A pipe must refuse — resizing one talks to nothing.
73
+ */
74
+ resize(cols: number, rows: number): Promise<{
75
+ ok: true;
76
+ } | {
77
+ ok: false;
78
+ error: string;
79
+ }>;
80
+ }
81
+ export interface CommandStreamStartResult {
82
+ session?: CommandStreamSession;
83
+ error?: string;
84
+ }
85
+ export interface CommandStreamPort {
86
+ start(request: CommandStreamRequest, listener: CommandStreamListener): Promise<CommandStreamStartResult>;
87
+ }
88
+ /**
89
+ * Decodes UTF-8 ACROSS chunk boundaries.
90
+ *
91
+ * 🔴 Per-chunk `toString()` (or a fresh `TextDecoder` each time) corrupts a
92
+ * multi-byte character that straddles two drains — silently, as U+FFFD in the
93
+ * agent's terminal, looking like the program's own output.
94
+ */
95
+ export declare class Utf8StreamDecoder {
96
+ #private;
97
+ push(bytes: Uint8Array): string;
98
+ flush(): string;
99
+ }
100
+ //# sourceMappingURL=CommandStream.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommandStream.d.ts","sourceRoot":"","sources":["../../src/isolation/CommandStream.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,CAAA;IACpC,GAAG,EAAE,MAAM,CAAA;IACX;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAA;IACjB;;;OAGG;IACH,GAAG,CAAC,EAAE,OAAO,CAAA;CACd;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,QAAQ,GAAG,QAAQ,CAAA;IAC3B,KAAK,EAAE,UAAU,CAAA;CAClB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,QAAQ,EAAE,OAAO,CAAA;CAClB;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,CAAC,KAAK,EAAE,kBAAkB,GAAG,IAAI,CAAA;IACxC,MAAM,CAAC,IAAI,EAAE,iBAAiB,GAAG,IAAI,CAAA;CACtC;AAED,MAAM,WAAW,oBAAoB;IACnC,yCAAyC;IACzC,KAAK,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACvC;;;OAGG;IACH,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IAC3B,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IACrB;;;OAGG;IACH,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAA;IACrB;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,EAAE,EAAE,IAAI,CAAA;KAAE,GAAG;QAAE,EAAE,EAAE,KAAK,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CACzF;AAED,MAAM,WAAW,wBAAwB;IACvC,OAAO,CAAC,EAAE,oBAAoB,CAAA;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,CACH,OAAO,EAAE,oBAAoB,EAC7B,QAAQ,EAAE,qBAAqB,GAC9B,OAAO,CAAC,wBAAwB,CAAC,CAAA;CACrC;AAED;;;;;;GAMG;AACH,qBAAa,iBAAiB;;IAG5B,IAAI,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM;IAI/B,KAAK,IAAI,MAAM;CAGhB"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Streaming counterpart to `CommandExecutionPort` — ADE step 9.
3
+ *
4
+ * `execute()` buffers to completion and answers once. No parameter turns that
5
+ * into a terminal. This is the other shape: output as it appears, plus a
6
+ * writable stdin, plus an explicit EOF that is a DROP rather than a flush.
7
+ *
8
+ * ## Why it is not more fields on the buffered port
9
+ *
10
+ * A stream is not a `Promise<Result>`. Pretending otherwise would force every
11
+ * one-shot caller to invent a listener they do not want, and every streaming
12
+ * caller to wait for a result that has not happened yet. The two sit beside
13
+ * each other, created from the same sandbox binding, so a composition cannot
14
+ * confine `runCommand` and leave the PTY on the host by forgetting a second
15
+ * wiring.
16
+ *
17
+ * ## Three things this must not get wrong
18
+ *
19
+ * All three are defects `xeno-use` actually hit:
20
+ *
21
+ * - **A chunk is BYTES, not text.** A multi-byte UTF-8 sequence can straddle a
22
+ * drain boundary. Decode with a streaming decoder at the surface that needs
23
+ * a string — never per chunk at the port.
24
+ * - **EOF is a DROP (`closeStdin`), not a flush.** Flushing stdin does not
25
+ * close it; the child never sees EOF and runs to its timeout.
26
+ * - **ASK THE CAPABILITY.** Streaming is a property of the runtime. The
27
+ * broker protocol can stream; the Unix-domain transport is a separate
28
+ * refusal. Assuming the stream exists works against one runtime and
29
+ * fails against another.
30
+ */
31
+ /**
32
+ * Decodes UTF-8 ACROSS chunk boundaries.
33
+ *
34
+ * 🔴 Per-chunk `toString()` (or a fresh `TextDecoder` each time) corrupts a
35
+ * multi-byte character that straddles two drains — silently, as U+FFFD in the
36
+ * agent's terminal, looking like the program's own output.
37
+ */
38
+ export class Utf8StreamDecoder {
39
+ #decoder = new TextDecoder('utf-8', { fatal: false });
40
+ push(bytes) {
41
+ return this.#decoder.decode(bytes, { stream: true });
42
+ }
43
+ flush() {
44
+ return this.#decoder.decode();
45
+ }
46
+ }
47
+ //# sourceMappingURL=CommandStream.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommandStream.js","sourceRoot":"","sources":["../../src/isolation/CommandStream.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAgEH;;;;;;GAMG;AACH,MAAM,OAAO,iBAAiB;IACnB,QAAQ,GAAG,IAAI,WAAW,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAA;IAE9D,IAAI,CAAC,KAAiB;QACpB,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAA;IACtD,CAAC;IAED,KAAK;QACH,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAA;IAC/B,CAAC;CACF"}
@@ -39,6 +39,7 @@
39
39
  * matters: `runObservationBinder.begin` is handed `{ runId, conversationId }`.
40
40
  */
41
41
  import type { CommandExecutionPort } from './CommandExecution.js';
42
+ import type { CommandStreamPort } from './CommandStream.js';
42
43
  import type { RunIsolation, RunIsolationReport, RunIsolationSource } from './RunIsolationService.js';
43
44
  import { type SandboxCommandMount } from './SandboxCommandExecutor.js';
44
45
  /** What confines a run, when something does. Supplied by the composition. */
@@ -59,6 +60,13 @@ export interface RunSandboxBinding {
59
60
  export interface RunExecutionResolution {
60
61
  executor: CommandExecutionPort;
61
62
  isolation: RunIsolationReport;
63
+ /**
64
+ * Present only when this run is confined. The PTY and fire-and-forget
65
+ * terminal read it; without one they keep the host `node-pty` / `spawn`.
66
+ * Absent on an unconfined run is a fact, not a gap — there is no sandbox
67
+ * stream to hand them.
68
+ */
69
+ stream?: CommandStreamPort;
62
70
  }
63
71
  /**
64
72
  * A sandbox that is still being created.
@@ -88,6 +96,7 @@ export interface RunExecutionEnvironmentOptions {
88
96
  */
89
97
  localExecutor?: CommandExecutionPort;
90
98
  createSandboxExecutor?: (binding: RunSandboxBinding) => CommandExecutionPort;
99
+ createSandboxStream?: (binding: RunSandboxBinding) => CommandStreamPort;
91
100
  }
92
101
  export declare class RunExecutionEnvironment implements RunIsolationSource {
93
102
  #private;
@@ -125,6 +134,12 @@ export declare class RunExecutionEnvironment implements RunIsolationSource {
125
134
  * into a confident all-clear.
126
135
  */
127
136
  resolve(runId: string | undefined): RunExecutionResolution;
137
+ /**
138
+ * The single lookup, keyed the way call sites actually know a run — by
139
+ * conversation. `executorFor` and the agent's Bash tool both read this so
140
+ * argv and the executor describe the same destination.
141
+ */
142
+ resolutionForConversation(conversationId: string | undefined): RunExecutionResolution;
128
143
  /** The executor for a CONVERSATION's current run — the identity call sites have. */
129
144
  executorFor(conversationId: string | undefined): CommandExecutionPort;
130
145
  /** `RunIsolationSource`. Same lookup, so it cannot disagree with the executor. */
@@ -1 +1 @@
1
- {"version":3,"file":"RunExecutionEnvironment.d.ts","sourceRoot":"","sources":["../../src/isolation/RunExecutionEnvironment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AAEjE,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AACpG,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,6BAA6B,CAAA;AAEpC,6EAA6E;AAC7E,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,mBAAmB,CAAA;IAC1B,0CAA0C;IAC1C,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb;;;;OAIG;IACH,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,kEAAkE;AAClE,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,oBAAoB,CAAA;IAC9B,SAAS,EAAE,kBAAkB,CAAA;CAC9B;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC,CAAA;AAWnE,MAAM,WAAW,8BAA8B;IAC7C;;;OAGG;IACH,aAAa,CAAC,EAAE,oBAAoB,CAAA;IACpC,qBAAqB,CAAC,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,oBAAoB,CAAA;CAC7E;AAED,qBAAa,uBAAwB,YAAW,kBAAkB;;gBAOpD,OAAO,GAA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GAAG,YAAY;CAG9C"}
@@ -40,12 +40,14 @@
40
40
  */
41
41
  import { LocalCommandExecutor } from './LocalCommandExecutor.js';
42
42
  import { SandboxCommandExecutor, } from './SandboxCommandExecutor.js';
43
+ import { SandboxCommandStream } from './SandboxCommandStream.js';
43
44
  export class RunExecutionEnvironment {
44
45
  #runs = new Map();
45
46
  /** conversationId → runId. Rebuilt on bind/release so it cannot outlive its run. */
46
47
  #byConversation = new Map();
47
48
  #localExecutor;
48
49
  #createSandboxExecutor;
50
+ #createSandboxStream;
49
51
  constructor(options = {}) {
50
52
  this.#localExecutor = options.localExecutor ?? new LocalCommandExecutor();
51
53
  this.#createSandboxExecutor =
@@ -56,6 +58,14 @@ export class RunExecutionEnvironment {
56
58
  sandboxId: binding.sandboxId,
57
59
  mount: binding.mount,
58
60
  }));
61
+ this.#createSandboxStream =
62
+ options.createSandboxStream ??
63
+ ((binding) => new SandboxCommandStream({
64
+ baseUrl: binding.baseUrl,
65
+ token: binding.token,
66
+ sandboxId: binding.sandboxId,
67
+ mount: binding.mount,
68
+ }));
59
69
  }
60
70
  /**
61
71
  * Records where a run executes.
@@ -70,26 +80,30 @@ export class RunExecutionEnvironment {
70
80
  if (context.sandbox) {
71
81
  record.sandbox = {
72
82
  executor: this.#createSandboxExecutor(context.sandbox),
83
+ stream: this.#createSandboxStream(context.sandbox),
73
84
  mechanism: context.sandbox.mechanism,
74
85
  };
75
86
  }
76
87
  else if (context.pendingSandbox) {
77
- const pending = { executor: undefined, failed: false };
88
+ const pending = { failed: false };
78
89
  const ready = context.pendingSandbox.then((binding) => {
79
90
  if (!binding) {
80
91
  pending.failed = true;
81
92
  return undefined;
82
93
  }
83
- pending.executor = this.#createSandboxExecutor(binding);
94
+ const pair = {
95
+ executor: this.#createSandboxExecutor(binding),
96
+ stream: this.#createSandboxStream(binding),
97
+ };
84
98
  const current = this.#runs.get(context.runId);
85
99
  // Only if this record is still the live one: a second run on the same
86
100
  // conversation, or a release, must not be overwritten by a container
87
101
  // that finished spawning for a run nobody is watching any more.
88
102
  if (current === record) {
89
- current.sandbox = { executor: pending.executor, mechanism: binding.mechanism };
103
+ current.sandbox = { ...pair, mechanism: binding.mechanism };
90
104
  delete current.pending;
91
105
  }
92
- return pending.executor;
106
+ return pair;
93
107
  }, () => {
94
108
  pending.failed = true;
95
109
  return undefined;
@@ -100,8 +114,8 @@ export class RunExecutionEnvironment {
100
114
  // spawn do not each try to create a container.
101
115
  executor: {
102
116
  execute: async (request) => {
103
- const executor = await ready;
104
- if (!executor) {
117
+ const pair = await ready;
118
+ if (!pair) {
105
119
  // Refused, never run locally. The whole point of waiting is that
106
120
  // no command escapes to the host; falling back here would undo it
107
121
  // at the one moment it matters.
@@ -114,7 +128,18 @@ export class RunExecutionEnvironment {
114
128
  error: 'The sandbox for this run could not be created, so the command was not run.',
115
129
  };
116
130
  }
117
- return await executor.execute(request);
131
+ return await pair.executor.execute(request);
132
+ },
133
+ },
134
+ stream: {
135
+ start: async (request, listener) => {
136
+ const pair = await ready;
137
+ if (!pair) {
138
+ return {
139
+ error: 'The sandbox for this run could not be created, so the stream was not started.',
140
+ };
141
+ }
142
+ return await pair.stream.start(request, listener);
118
143
  },
119
144
  },
120
145
  };
@@ -162,6 +187,7 @@ export class RunExecutionEnvironment {
162
187
  if (record.sandbox) {
163
188
  return {
164
189
  executor: record.sandbox.executor,
190
+ stream: record.sandbox.stream,
165
191
  isolation: { isolation: 'sandboxed', mechanism: record.sandbox.mechanism },
166
192
  };
167
193
  }
@@ -173,6 +199,7 @@ export class RunExecutionEnvironment {
173
199
  if (record.pending.failed) {
174
200
  return {
175
201
  executor: record.pending.executor,
202
+ stream: record.pending.stream,
176
203
  isolation: {
177
204
  isolation: 'unknown',
178
205
  reason: 'The sandbox for this run could not be created.',
@@ -184,15 +211,24 @@ export class RunExecutionEnvironment {
184
211
  // command can reach the host in the meantime.
185
212
  return {
186
213
  executor: record.pending.executor,
214
+ stream: record.pending.stream,
187
215
  isolation: { isolation: 'sandboxed', mechanism: 'container (starting)' },
188
216
  };
189
217
  }
190
218
  return { executor: this.#localExecutor, isolation: { isolation: 'none' } };
191
219
  }
220
+ /**
221
+ * The single lookup, keyed the way call sites actually know a run — by
222
+ * conversation. `executorFor` and the agent's Bash tool both read this so
223
+ * argv and the executor describe the same destination.
224
+ */
225
+ resolutionForConversation(conversationId) {
226
+ const runId = conversationId === undefined ? undefined : this.#byConversation.get(conversationId);
227
+ return this.resolve(runId);
228
+ }
192
229
  /** The executor for a CONVERSATION's current run — the identity call sites have. */
193
230
  executorFor(conversationId) {
194
- const runId = conversationId === undefined ? undefined : this.#byConversation.get(conversationId);
195
- return this.resolve(runId).executor;
231
+ return this.resolutionForConversation(conversationId).executor;
196
232
  }
197
233
  /** `RunIsolationSource`. Same lookup, so it cannot disagree with the executor. */
198
234
  isolationFor(runId) {
@@ -1 +1 @@
1
- {"version":3,"file":"RunExecutionEnvironment.js","sourceRoot":"","sources":["../../src/isolation/RunExecutionEnvironment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAEhE,OAAO,EACL,sBAAsB,GAEvB,MAAM,6BAA6B,CAAA;AA+DpC,MAAM,OAAO,uBAAuB;IACzB,KAAK,GAAG,IAAI,GAAG,EAAqB,CAAA;IAC7C,oFAAoF;IAC3E,eAAe,GAAG,IAAI,GAAG,EAAkB,CAAA;IAC3C,cAAc,CAAsB;IACpC,sBAAsB,CAAsD;IAErF,YAAY,UAA0C,EAAE;QACtD,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,aAAa,IAAI,IAAI,oBAAoB,EAAE,CAAA;QACzE,IAAI,CAAC,sBAAsB;YACzB,OAAO,CAAC,qBAAqB;gBAC7B,CAAC,CAAC,OAAO,EAAE,EAAE,CACX,IAAI,sBAAsB,CAAC;oBACzB,OAAO,EAAE,OAAO,CAAC,OAAO;oBACxB,K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AAC,QAAQ;gBACjC,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,MAAM;gBAC7B,SAAS,EAAE,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,sBAAsB,EAAE;aACzE,CAAA;QACH,CAAC;QACD,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,cAAc,EAAE,SAAS,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,CAAA;IAC5E,CAAC;IAED;;;;OAIG;IACH,yBAAyB,CAAC,cAAkC;QAC1D,MAAM,KAAK,GAAG,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,cAAc,CAAC,CAAA;QACjG,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAC5B,CAAC;IAED,oFAAoF;IACpF,WAAW,CAAC,cAAkC;QAC5C,OAAO,IAAI,CAAC,yBAAyB,CAAC,cAAc,CAAC,CAAC,QAAQ,CAAA;IAChE,CAAC;IAED,kFAAkF;IAClF,YAAY,CAAC,KAAa;QACxB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,SAAS,CAAA;IACtC,CAAC;IAED,qFAAqF;IACrF,gBAAgB,CAAC,KAAa;QAC5B,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,SAAS,CAAA;IAChD,CAAC;CACF"}
@@ -14,7 +14,9 @@
14
14
  * for this repo, and its gate requires an out-of-mount write to be refused **by
15
15
  * the substrate, not by a rule inside the shell it runs in**. So nothing here
16
16
  * confines anything. It answers one question — *is this run contained?* — and
17
- * answers it honestly while the answer is still "no".
17
+ * answers it honestly. Unconfigured is `none`. A composition that bound
18
+ * `pendingSandbox` can report `sandboxed`. Deriving that from the observer
19
+ * alone is still refused.
18
20
  *
19
21
  * That ordering is not a compromise. A surface that can display containment is
20
22
  * the thing that makes adopting a sandbox observable: land the adapter and the
@@ -38,8 +40,9 @@
38
40
  * rather than a boolean. The three are genuinely different facts:
39
41
  *
40
42
  * - `none` — POSITIVE knowledge that nothing confines this run. When no source
41
- * is configured at all, this is what the host knows: execution goes through
42
- * `WorkspaceHostService.runCommand` to a host process as the signed-in user.
43
+ * is configured, this is what the host knows: unconfined execution still
44
+ * starts a host process as the signed-in user. A configured sidecar that
45
+ * failed to bind still reports `none` or `unknown`, never a silent upgrade.
43
46
  * "No sandbox is installed" is not ignorance about containment; it is
44
47
  * containment's absence, and the user is entitled to be told so plainly.
45
48
  * - `sandboxed` — a source answered that this run is confined.
@@ -75,8 +78,10 @@ export interface RunIsolationSource {
75
78
  /**
76
79
  * Answers "is this run contained?" for every run, with or without a source.
77
80
  *
78
- * 🔴 Constructed with NO source in the shipped composition today, and that path
79
- * is the one that must be right: it reports `none`, because that is true.
81
+ * The shipped composition passes `runExecutionEnvironment` as the source, so
82
+ * a bound sandbox reports `sandboxed` from the same lookup as the executor.
83
+ * The no-source path must still be right: it reports `none`, because that is
84
+ * true when nothing is configured.
80
85
  */
81
86
  export declare class RunIsolationService {
82
87
  #private;
@@ -1 +1 @@
1
- {"version":3,"file":"RunIsolationService.d.ts","sourceRoot":"","sources":["../../src/isolation/RunIsolationService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,WAAW,GAAG,SAAS,CAAA;AAE3D,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,YAAY,CAAA;IACvB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,qEAAqE;IACrE,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,kBAAkB;IACjC,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,kBAAkB,GAAG,SAAS,CAAA;CAC5D;AAED;;;;;GAKG;AACH,qBAAa,mBAAmB;;gBAGlB,OAAO,GAAE;QAAE,MAAM,CAAC,EAAE,kBAAkB,CAAA;KAAO;IAIzD,4DAA4D;IAC5D,IAAI,SAAS,IAAI,OAAO,CAEvB;IAED,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,kBAAkB;CAkC1C"}
1
+ {"version":3,"file":"RunIsolationService.d.ts","sourceRoot":"","sources":["../../src/isolation/RunIsolationService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,WAAW,GAAG,SAAS,CAAA;AAE3D,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,YAAY,CAAA;IACvB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,qEAAqE;IACrE,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,kBAAkB;IACjC,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,kBAAkB,GAAG,SAAS,CAAA;CAC5D;AAED;;;;;;;GAOG;AACH,qBAAa,mBAAmB;;gBAGlB,OAAO,GAAE;QAAE,MAAM,CAAC,EAAE,kBAAkB,CAAA;KAAO;IAIzD,4DAA4D;IAC5D,IAAI,SAAS,IAAI,OAAO,CAEvB;IAED,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,kBAAkB;CAkC1C"}
@@ -14,7 +14,9 @@
14
14
  * for this repo, and its gate requires an out-of-mount write to be refused **by
15
15
  * the substrate, not by a rule inside the shell it runs in**. So nothing here
16
16
  * confines anything. It answers one question — *is this run contained?* — and
17
- * answers it honestly while the answer is still "no".
17
+ * answers it honestly. Unconfigured is `none`. A composition that bound
18
+ * `pendingSandbox` can report `sandboxed`. Deriving that from the observer
19
+ * alone is still refused.
18
20
  *
19
21
  * That ordering is not a compromise. A surface that can display containment is
20
22
  * the thing that makes adopting a sandbox observable: land the adapter and the
@@ -34,8 +36,10 @@
34
36
  /**
35
37
  * Answers "is this run contained?" for every run, with or without a source.
36
38
  *
37
- * 🔴 Constructed with NO source in the shipped composition today, and that path
38
- * is the one that must be right: it reports `none`, because that is true.
39
+ * The shipped composition passes `runExecutionEnvironment` as the source, so
40
+ * a bound sandbox reports `sandboxed` from the same lookup as the executor.
41
+ * The no-source path must still be right: it reports `none`, because that is
42
+ * true when nothing is configured.
39
43
  */
40
44
  export class RunIsolationService {
41
45
  #source;
@@ -1 +1 @@
1
- {"version":3,"file":"RunIsolationService.js","sourceRoot":"","sources":["../../src/isolation/RunIsolationService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AA8CH;;;;;GAKG;AACH,MAAM,OAAO,mBAAmB;IACrB,OAAO,CAAgC;IAEhD,YAAY,UAA2C,EAAE;QACvD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,MAAM,CAAA;IAC/B,CAAC;IAED,4DAA4D;IAC5D,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,OAAO,KAAK,SAAS,CAAA;IACnC,CAAC;IAED,MAAM,CAAC,KAAa;QAClB,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAA;QAC3B,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,uEAAuE;YACvE,iDAAiD;YACjD,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,CAAA;QAC9B,CAAC;QACD,IAAI,MAAsC,CAAA;QAC1C,IAAI,CAAC;YACH,MAAM,GAAG,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,CAAA;QACrC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,qEAAqE;YACrE,wEAAwE;YACxE,qCAAqC;YACrC,OAAO;gBACL,SAAS,EAAE,SAAS;gBACpB,MAAM,EAAE,gCAAgC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC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 Redeclared rather than imported: `xeno-use` is AGPL-3.0 and this package
5
+ * is proprietary. The shapes are written out by hand for the same reason
6
+ * `SandboxCommandExecutor` redeclares the buffered exec result.
7
+ *
8
+ * ⚠️ RUNTIME-level, not per-sandbox. Answerable BEFORE any sandbox exists,
9
+ * because a consumer needs this when it is deciding whether it can honestly
10
+ * offer a confined stream at all.
11
+ */
12
+ export interface SandboxRuntimeCapabilities {
13
+ supports_exec: boolean;
14
+ supports_exec_stream: boolean;
15
+ /**
16
+ * A real PTY inside the sandbox. Separate from streaming bytes, and false
17
+ * on the CLI runtime: `docker exec -i` is not a terminal and `-t` is refused
18
+ * when the caller's stdin is not one. Do not treat a stream as a TTY.
19
+ */
20
+ supports_exec_tty: boolean;
21
+ }
22
+ export declare function readSandboxCapabilities(data: unknown): SandboxRuntimeCapabilities;
23
+ export declare function fetchSandboxCapabilities(options: {
24
+ baseUrl: string;
25
+ token: string;
26
+ fetch?: typeof globalThis.fetch;
27
+ }): Promise<SandboxRuntimeCapabilities>;
28
+ //# sourceMappingURL=SandboxCapabilities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SandboxCapabilities.d.ts","sourceRoot":"","sources":["../../src/isolation/SandboxCapabilities.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,WAAW,0BAA0B;IACzC,aAAa,EAAE,OAAO,CAAA;IACtB,oBAAoB,EAAE,OAAO,CAAA;IAC7B;;;;OAIG;IACH,iBAAiB,EAAE,OAAO,CAAA;CAC3B;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,OAAO,GAAG,0BAA0B,CAOjF;AAED,wBAAsB,wBAAwB,CAAC,OAAO,EAAE;IACtD,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAA;CAChC,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAYtC"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * What a `xeno-use` runtime can actually do — asked over HTTP, never assumed.
3
+ *
4
+ * 🔒 Redeclared rather than imported: `xeno-use` is AGPL-3.0 and this package
5
+ * is proprietary. The shapes are written out by hand for the same reason
6
+ * `SandboxCommandExecutor` redeclares the buffered exec result.
7
+ *
8
+ * ⚠️ RUNTIME-level, not per-sandbox. Answerable BEFORE any sandbox exists,
9
+ * because a consumer needs this when it is deciding whether it can honestly
10
+ * offer a confined stream at all.
11
+ */
12
+ export function readSandboxCapabilities(data) {
13
+ const record = data && typeof data === 'object' ? data : {};
14
+ return {
15
+ supports_exec: record.supports_exec === true,
16
+ supports_exec_stream: record.supports_exec_stream === true,
17
+ supports_exec_tty: record.supports_exec_tty === true,
18
+ };
19
+ }
20
+ export async function fetchSandboxCapabilities(options) {
21
+ const fetchImpl = options.fetch ?? globalThis.fetch;
22
+ const baseUrl = options.baseUrl.replace(/\/+$/, '');
23
+ const response = await fetchImpl(`${baseUrl}/v1/use/sandbox/capabilities`, {
24
+ method: 'GET',
25
+ headers: { authorization: `Bearer ${options.token}` },
26
+ });
27
+ if (!response.ok) {
28
+ throw new Error(`The sandbox capabilities request failed (HTTP ${response.status}).`);
29
+ }
30
+ const body = (await response.json());
31
+ return readSandboxCapabilities(body.data);
32
+ }
33
+ //# sourceMappingURL=SandboxCapabilities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SandboxCapabilities.js","sourceRoot":"","sources":["../../src/isolation/SandboxCapabilities.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAaH,MAAM,UAAU,uBAAuB,CAAC,IAAa;IACnD,MAAM,MAAM,GAAG,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAE,IAAgC,CAAC,CAAC,CAAC,EAAE,CAAA;IACxF,OAAO;QACL,aAAa,EAAE,MAAM,CAAC,aAAa,KAAK,IAAI;QAC5C,oBAAoB,EAAE,MAAM,CAAC,oBAAoB,KAAK,IAAI;QAC1D,iBAAiB,EAAE,MAAM,CAAC,iBAAiB,KAAK,IAAI;KACrD,CAAA;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAAC,OAI9C;IACC,MAAM,SAAS,GAAG,OAAO,CAAC,KAAK,IAAI,UAAU,CAAC,KAAK,CAAA;IACnD,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA;IACnD,MAAM,QAAQ,GAAG,MAAM,SAAS,CAAC,GAAG,OAAO,8BAA8B,EAAE;QACzE,MAAM,EAAE,KAAK;QACb,OAAO,EAAE,EAAE,aAAa,EAAE,UAAU,OAAO,CAAC,KAAK,EAAE,EAAE;KACtD,CAAC,CAAA;IACF,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,iDAAiD,QAAQ,CAAC,MAAM,IAAI,CAAC,CAAA;IACvF,CAAC;IACD,MAAM,IAAI,GAAG,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAuB,CAAA;IAC1D,OAAO,uBAAuB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAC3C,CAAC"}
@@ -5,13 +5,10 @@
5
5
  * and what decides — in ONE lookup — both that this executor serves a run and
6
6
  * that the run reports `sandboxed`. Nothing constructs this directly.
7
7
  *
8
- * ⚠️ What remains before a run is actually confined is the BINDING: no
9
- * composition yet spawns a sandbox the agent RUNS in. `XenoUseRunObserver`
10
- * spawns an OBSERVATION sandbox, and binding execution to that one is exactly
11
- * the convenient wrong turn `isolationIsNotObservation.test.ts` exists to pin —
12
- * a sandbox that is watched is not a sandbox that confines. Everything
13
- * downstream of the binding is now live, so that step is a spawn plus a
14
- * `bind({ sandbox })`, not a rewrite.
8
+ * Binding is a composition concern. `composeHost` already hands the same
9
+ * sandbox to observation and to `RunExecutionEnvironment.bind({ sandbox })`.
10
+ * `isolationIsNotObservation.test.ts` still pins the other direction: a
11
+ * watched sandbox is not a confined one unless execution is bound to it.
15
12
  *
16
13
  * This is the other half of the port `LocalCommandExecutor` exists beside, and
17
14
  * the reason the port was built at all: adopting a sandbox becomes a composition
@@ -1 +1 @@
1
- {"version":3,"file":"SandboxCommandExecutor.d.ts","sourceRoot":"","sources":["../../src/isolation/SandboxCommandExecutor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AAEH,OAAO,KAAK,EACV,oBAAoB,EACpB,uBAAuB,EACvB,sBAAsB,EACvB,MAAM,uBAAuB,CAAA;AAE9B,gEAAgE;AAChE,MAAM,WAAW,mBAAmB;IAClC,kEAAkE;IAClE,aAAa,EAAE,MAAM,CAAA;IACrB,kEAAkE;IAClE,kBAAkB,EAAE,MAAM,CAAA;CAC3B;AAED,MAAM,WAAW,6BAA6B;IAC5C,wEAAwE;IACxE,OAAO,EAAE,MAAM,CAAA;IACf,+DAA+D;IAC/D,KAAK,EAAE,MAAM,CAAA;IACb,oEAAoE;IACpE,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,mBAAmB,CAAA;IAC1B,KAAK,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAA;CAChC;AAiBD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,mBAAmB,EAC1B,QAAQ,EAAE,MAAM,GACf,MAAM,GAAG,SAAS,CAapB;AAED,qBAAa,sBAAuB,YAAW,oBAAoB;;gBAOrD,OAAO,EAAE,6BAA6B;IAQ5C,OAAO,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,sBAAsB,CAAC;CA2FjF"}
1
+ {"version":3,"file":"SandboxCommandExecutor.d.ts","sourceRoot":"","sources":["../../src/isolation/SandboxCommandExecutor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAEH,OAAO,KAAK,EACV,oBAAoB,EACpB,uBAAuB,EACvB,sBAAsB,EACvB,MAAM,uBAAuB,CAAA;AAG9B,gEAAgE;AAChE,MAAM,WAAW,mBAAmB;IAClC,kEAAkE;IAClE,aAAa,EAAE,MAAM,CAAA;IACrB,kEAAkE;IAClE,kBAAkB,EAAE,MAAM,CAAA;CAC3B;AAED,MAAM,WAAW,6BAA6B;IAC5C,wEAAwE;IACxE,OAAO,EAAE,MAAM,CAAA;IACf,+DAA+D;IAC/D,KAAK,EAAE,MAAM,CAAA;IACb,oEAAoE;IACpE,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,mBAAmB,CAAA;IAC1B,KAAK,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAA;CAChC;AAiBD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,mBAAmB,EAC1B,QAAQ,EAAE,MAAM,GACf,MAAM,GAAG,SAAS,CAapB;AAED,qBAAa,sBAAuB,YAAW,oBAAoB;;gBAOrD,OAAO,EAAE,6BAA6B;IAQ5C,OAAO,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,sBAAsB,CAAC;CA4FjF"}
@@ -5,13 +5,10 @@
5
5
  * and what decides — in ONE lookup — both that this executor serves a run and
6
6
  * that the run reports `sandboxed`. Nothing constructs this directly.
7
7
  *
8
- * ⚠️ What remains before a run is actually confined is the BINDING: no
9
- * composition yet spawns a sandbox the agent RUNS in. `XenoUseRunObserver`
10
- * spawns an OBSERVATION sandbox, and binding execution to that one is exactly
11
- * the convenient wrong turn `isolationIsNotObservation.test.ts` exists to pin —
12
- * a sandbox that is watched is not a sandbox that confines. Everything
13
- * downstream of the binding is now live, so that step is a spawn plus a
14
- * `bind({ sandbox })`, not a rewrite.
8
+ * Binding is a composition concern. `composeHost` already hands the same
9
+ * sandbox to observation and to `RunExecutionEnvironment.bind({ sandbox })`.
10
+ * `isolationIsNotObservation.test.ts` still pins the other direction: a
11
+ * watched sandbox is not a confined one unless execution is bound to it.
15
12
  *
16
13
  * This is the other half of the port `LocalCommandExecutor` exists beside, and
17
14
  * the reason the port was built at all: adopting a sandbox becomes a composition
@@ -50,6 +47,7 @@
50
47
  * resolver taking a run id would put routing in the hot path and make "which
51
48
  * sandbox did this actually run in?" a question with a computed answer.
52
49
  */
50
+ import { mintUseIdempotencyKey } from './useIdempotency.js';
53
51
  const DEFAULT_MAX_OUTPUT_BYTES = 200_000;
54
52
  /**
55
53
  * Maps a host path into container terms.
@@ -110,6 +108,7 @@ export class SandboxCommandExecutor {
110
108
  headers: {
111
109
  authorization: `Bearer ${this.#token}`,
112
110
  'content-type': 'application/json',
111
+ 'idempotency-key': mintUseIdempotencyKey('exec'),
113
112
  },
114
113
  body: JSON.stringify({
115
114
  // A LIST, unchanged. The port and the substrate agree on this, so
@@ -1 +1 @@
1
- {"version":3,"file":"SandboxCommandExecutor.js","sourceRoot":"","sources":["../../src/isolation/SandboxCommandExecutor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AAwCH,MAAM,wBAAwB,GAAG,OAAO,CAAA;AAExC;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,eAAe,CAC7B,KAA0B,EAC1B,QAAgB;IAEhB,MAAM,SAAS,GAAG,CAAC,KAAa,EAAU,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA;IAC5F,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC,aAAa,CAAC,CAAA;IAC3C,MAAM,MAAM,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAA;IAClC,MAAM,SAAS,GAAG,SAAS,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAA;IAErD,IAAI,MAAM,CAAC,WAAW,EAAE,KAAK,IAAI,CAAC,WAAW,EAAE;QA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