@finalai/agent-provider 0.2.2 → 0.4.0

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 (60) hide show
  1. package/README.md +61 -0
  2. package/dist/modules/sandbox/client.mjs +3 -0
  3. package/dist/modules/sandbox/client.mjs.map +2 -2
  4. package/dist/modules/sandbox/confined-files.d.mts +2 -2
  5. package/dist/modules/sandbox/confined-files.mjs +5 -2
  6. package/dist/modules/sandbox/confined-files.mjs.map +2 -2
  7. package/dist/modules/sandbox/execution-guard.d.mts +36 -0
  8. package/dist/modules/sandbox/execution-guard.mjs +322 -0
  9. package/dist/modules/sandbox/execution-guard.mjs.map +7 -0
  10. package/dist/modules/sandbox/file-kind.d.mts +6 -0
  11. package/dist/modules/sandbox/file-kind.mjs +11 -0
  12. package/dist/modules/sandbox/file-kind.mjs.map +7 -0
  13. package/dist/modules/sandbox/file-schemas.d.mts +15 -0
  14. package/dist/modules/sandbox/file-schemas.mjs +22 -0
  15. package/dist/modules/sandbox/file-schemas.mjs.map +7 -0
  16. package/dist/modules/sandbox/handle.d.mts +15 -0
  17. package/dist/modules/sandbox/handle.mjs +47 -0
  18. package/dist/modules/sandbox/handle.mjs.map +7 -0
  19. package/dist/modules/sandbox/index.d.mts +8 -0
  20. package/dist/modules/sandbox/index.mjs +30 -1
  21. package/dist/modules/sandbox/index.mjs.map +2 -2
  22. package/dist/modules/sandbox/mcp-channel.d.mts +8 -1
  23. package/dist/modules/sandbox/mcp-channel.mjs +217 -15
  24. package/dist/modules/sandbox/mcp-channel.mjs.map +3 -3
  25. package/dist/modules/sandbox/mcp-hosted-marker.d.mts +3 -0
  26. package/dist/modules/sandbox/mcp-hosted-marker.mjs +10 -0
  27. package/dist/modules/sandbox/mcp-hosted-marker.mjs.map +7 -0
  28. package/dist/modules/sandbox/mcp-hosted.d.mts +6 -1
  29. package/dist/modules/sandbox/mcp-hosted.mjs +127 -41
  30. package/dist/modules/sandbox/mcp-hosted.mjs.map +2 -2
  31. package/dist/modules/sandbox/mcp-shell.mjs +14 -4
  32. package/dist/modules/sandbox/mcp-shell.mjs.map +2 -2
  33. package/dist/modules/sandbox/mcp.d.mts +5 -2
  34. package/dist/modules/sandbox/mcp.mjs +102 -27
  35. package/dist/modules/sandbox/mcp.mjs.map +2 -2
  36. package/dist/modules/sandbox/networking.d.mts +73 -0
  37. package/dist/modules/sandbox/networking.mjs +149 -0
  38. package/dist/modules/sandbox/networking.mjs.map +7 -0
  39. package/dist/modules/sandbox/overrides.d.mts +2 -0
  40. package/dist/modules/sandbox/overrides.mjs +44 -0
  41. package/dist/modules/sandbox/overrides.mjs.map +7 -0
  42. package/dist/modules/sandbox/server.d.mts +1 -0
  43. package/dist/modules/sandbox/server.mjs +38 -2
  44. package/dist/modules/sandbox/server.mjs.map +2 -2
  45. package/dist/modules/sandbox/testing.d.mts +1 -0
  46. package/dist/modules/sandbox/testing.mjs +1 -0
  47. package/dist/modules/sandbox/testing.mjs.map +2 -2
  48. package/dist/modules/sandbox/tool-policy.d.mts +5 -0
  49. package/dist/modules/sandbox/tool-policy.mjs +62 -0
  50. package/dist/modules/sandbox/tool-policy.mjs.map +7 -0
  51. package/dist/modules/sandbox/types.d.mts +17 -16
  52. package/dist/modules/sandbox/types.mjs +54 -23
  53. package/dist/modules/sandbox/types.mjs.map +3 -3
  54. package/dist/modules/sandbox/wire.d.mts +23 -18
  55. package/dist/modules/sandbox/wire.mjs +21 -20
  56. package/dist/modules/sandbox/wire.mjs.map +3 -3
  57. package/dist/modules/sandbox/workspace-identity.d.mts +5 -0
  58. package/dist/modules/sandbox/workspace-identity.mjs +14 -0
  59. package/dist/modules/sandbox/workspace-identity.mjs.map +7 -0
  60. package/package.json +3 -3
@@ -0,0 +1,322 @@
1
+ import * as z from "zod";
2
+ import { createHttpMcpChannelEndpoint } from "./mcp-channel.mjs";
3
+ import { createConfinedFileReader } from "./confined-files.mjs";
4
+ import { sandboxMethodSource, withSandboxOverrides } from "./overrides.mjs";
5
+ const serialize = (action) => {
6
+ let previous = Promise.resolve();
7
+ return (...args) => {
8
+ const result = previous.then(() => action(...args));
9
+ previous = result.then(
10
+ () => {
11
+ },
12
+ () => {
13
+ }
14
+ );
15
+ return result;
16
+ };
17
+ };
18
+ const executionGuardMarker = /* @__PURE__ */ Symbol("sandboxExecutionGuard");
19
+ const hasSandboxExecutionGuard = (sandbox) => Reflect.get(sandbox, executionGuardMarker) === true;
20
+ var SandboxExecutionOperation = /* @__PURE__ */ ((SandboxExecutionOperation2) => {
21
+ SandboxExecutionOperation2["Run"] = "run";
22
+ SandboxExecutionOperation2["Spawn"] = "spawn";
23
+ SandboxExecutionOperation2["ProcessInput"] = "processInput";
24
+ SandboxExecutionOperation2["WriteFile"] = "writeFile";
25
+ SandboxExecutionOperation2["WriteTextFile"] = "writeTextFile";
26
+ SandboxExecutionOperation2["WriteBinaryFile"] = "writeBinaryFile";
27
+ SandboxExecutionOperation2["RemovePath"] = "removePath";
28
+ SandboxExecutionOperation2["SetNetworkPolicy"] = "setNetworkPolicy";
29
+ SandboxExecutionOperation2["Egress"] = "egress";
30
+ SandboxExecutionOperation2["PortEndpoint"] = "portEndpoint";
31
+ SandboxExecutionOperation2["Screen"] = "screen";
32
+ SandboxExecutionOperation2["ComputerUse"] = "computerUse";
33
+ SandboxExecutionOperation2["LocalMcp"] = "localMcp";
34
+ SandboxExecutionOperation2["Mcp"] = "mcp";
35
+ SandboxExecutionOperation2["Editor"] = "editor";
36
+ return SandboxExecutionOperation2;
37
+ })(SandboxExecutionOperation || {});
38
+ const guardedMethods = [
39
+ "run",
40
+ "spawn",
41
+ "writeFile",
42
+ "writeTextFile",
43
+ "writeBinaryFile",
44
+ "removePath",
45
+ "getPortEndpoint",
46
+ "getPortUrl",
47
+ "setNetworkPolicy",
48
+ "egress",
49
+ "computerUse",
50
+ "screen",
51
+ "localMcp"
52
+ ];
53
+ const executionChecks = /* @__PURE__ */ new WeakMap();
54
+ const executionSources = /* @__PURE__ */ new WeakMap();
55
+ const sandboxForExecutionMapping = (sandbox) => {
56
+ const overrides = {};
57
+ for (const method of guardedMethods) {
58
+ const original = sandboxMethodSource(sandbox[method]);
59
+ if (typeof original !== "function") continue;
60
+ const source = executionSources.get(original);
61
+ if (source != null) overrides[method] = source.method;
62
+ }
63
+ return withSandboxOverrides(sandbox, overrides);
64
+ };
65
+ const buildSandboxExecutionGuard = (options, unchangedFrom, checks) => {
66
+ const source = options.sandbox;
67
+ const guard = async (operation, background = false, abortSignal) => {
68
+ abortSignal?.throwIfAborted();
69
+ let aborted;
70
+ try {
71
+ const admission = options.beforeExecution({ operation, background, abortSignal });
72
+ if (abortSignal == null) await admission;
73
+ else
74
+ await Promise.race([
75
+ admission,
76
+ new Promise((_resolve, reject) => {
77
+ aborted = () => reject(abortSignal.reason);
78
+ abortSignal.addEventListener("abort", aborted, { once: true });
79
+ if (abortSignal.aborted) aborted();
80
+ })
81
+ ]);
82
+ abortSignal?.throwIfAborted();
83
+ } finally {
84
+ if (aborted != null) abortSignal?.removeEventListener("abort", aborted);
85
+ }
86
+ };
87
+ const stdinFor = (stdin, abortSignal) => {
88
+ if (stdin == null || typeof stdin === "string") return stdin;
89
+ let reader = null;
90
+ return new ReadableStream(
91
+ {
92
+ pull: async (controller) => {
93
+ try {
94
+ reader ??= stdin.getReader();
95
+ const next = await reader.read();
96
+ await guard("processInput" /* ProcessInput */, false, abortSignal);
97
+ if (next.done) {
98
+ reader.releaseLock();
99
+ controller.close();
100
+ return;
101
+ }
102
+ controller.enqueue(next.value);
103
+ } catch (cause) {
104
+ controller.error(cause);
105
+ await reader?.cancel(cause).catch(() => void 0);
106
+ reader?.releaseLock();
107
+ }
108
+ },
109
+ cancel: async (reason) => {
110
+ if (reader == null) await stdin.cancel(reason);
111
+ else {
112
+ try {
113
+ await reader.cancel(reason);
114
+ } finally {
115
+ reader.releaseLock();
116
+ }
117
+ }
118
+ }
119
+ },
120
+ { highWaterMark: 0 }
121
+ );
122
+ };
123
+ const endpoint = (value) => {
124
+ const channelEndpoint = "connect" in value ? value : createHttpMcpChannelEndpoint(value, options.fetch, {
125
+ beforeRequest: () => guard("mcp" /* Mcp */, true)
126
+ });
127
+ return {
128
+ name: channelEndpoint.name,
129
+ connect: async (args) => {
130
+ await guard("mcp" /* Mcp */, false, args?.abortSignal);
131
+ const channel = await channelEndpoint.connect(args);
132
+ const admitSend = serialize(async (...[message, opts]) => {
133
+ const parsed = z.object({ method: z.string().optional() }).safeParse(message);
134
+ const method = parsed.success ? parsed.data.method : void 0;
135
+ const background = parsed.success && (method == null || [
136
+ "initialize",
137
+ "ping",
138
+ "tools/list",
139
+ "subscriptions/listen",
140
+ "notifications/initialized",
141
+ "notifications/cancelled",
142
+ "notifications/subscriptions/acknowledged"
143
+ ].includes(method));
144
+ opts?.abortSignal?.throwIfAborted();
145
+ await guard("mcp" /* Mcp */, background, opts?.abortSignal);
146
+ opts?.abortSignal?.throwIfAborted();
147
+ return { completion: channel.send(message, opts) };
148
+ });
149
+ const send = async (message, opts) => (await admitSend(message, opts)).completion;
150
+ let pending = null;
151
+ let receiving = Promise.resolve();
152
+ const receive = (opts) => new Promise((resolve, reject) => {
153
+ const signal = opts?.abortSignal;
154
+ const aborted = () => reject(signal?.reason);
155
+ signal?.addEventListener("abort", aborted, { once: true });
156
+ if (signal?.aborted === true) {
157
+ signal.removeEventListener("abort", aborted);
158
+ reject(signal.reason);
159
+ return;
160
+ }
161
+ const result = receiving.then(async () => {
162
+ signal?.throwIfAborted();
163
+ pending ??= await channel.receive(opts);
164
+ signal?.throwIfAborted();
165
+ if (pending.length > 0) await guard("mcp" /* Mcp */, true);
166
+ signal?.throwIfAborted();
167
+ resolve(pending);
168
+ pending = null;
169
+ });
170
+ receiving = result.then(
171
+ () => {
172
+ },
173
+ () => {
174
+ }
175
+ );
176
+ void result.catch(reject).finally(() => signal?.removeEventListener("abort", aborted));
177
+ });
178
+ return withSandboxOverrides(channel, { send, receive });
179
+ }
180
+ };
181
+ };
182
+ const overrides = {
183
+ confinedFileReader: source.confinedFileReader ?? createConfinedFileReader(source),
184
+ getPortUrl: async (args) => {
185
+ await guard("portEndpoint" /* PortEndpoint */);
186
+ return source.getPortUrl(args);
187
+ },
188
+ getPortEndpoint: async (args) => {
189
+ await guard("portEndpoint" /* PortEndpoint */);
190
+ return source.getPortEndpoint(args);
191
+ },
192
+ run: async (args) => {
193
+ await guard("run" /* Run */, false, args.abortSignal);
194
+ return source.run({ ...args, stdin: stdinFor(args.stdin, args.abortSignal) });
195
+ },
196
+ spawn: async (args) => {
197
+ await guard("spawn" /* Spawn */, false, args.abortSignal);
198
+ const process = await source.spawn({
199
+ ...args,
200
+ stdin: stdinFor(args.stdin, args.abortSignal)
201
+ });
202
+ let writeFailed = false;
203
+ const write = async (data, opts) => {
204
+ if (writeFailed)
205
+ throw new Error("Process stdin is unusable after a failed write; restart the process");
206
+ try {
207
+ await guard("processInput" /* ProcessInput */);
208
+ await process.write(data, opts);
209
+ } catch (cause) {
210
+ writeFailed = true;
211
+ throw cause;
212
+ }
213
+ };
214
+ return withSandboxOverrides(process, { write: serialize(write) });
215
+ },
216
+ writeFile: async (args) => {
217
+ await guard("writeFile" /* WriteFile */, false, args.abortSignal);
218
+ return source.writeFile(args);
219
+ },
220
+ writeTextFile: async (args) => {
221
+ await guard("writeTextFile" /* WriteTextFile */, false, args.abortSignal);
222
+ return source.writeTextFile(args);
223
+ },
224
+ writeBinaryFile: async (args) => {
225
+ await guard("writeBinaryFile" /* WriteBinaryFile */, false, args.abortSignal);
226
+ return source.writeBinaryFile(args);
227
+ },
228
+ removePath: async (args) => {
229
+ await guard("removePath" /* RemovePath */, false, args.abortSignal);
230
+ return source.removePath(args);
231
+ }
232
+ };
233
+ if (source.computerUse != null) {
234
+ const computerUse = source.computerUse.bind(source);
235
+ overrides.computerUse = async () => {
236
+ await guard("computerUse" /* ComputerUse */);
237
+ return endpoint(await computerUse());
238
+ };
239
+ }
240
+ if (source.screen != null) {
241
+ const screen = source.screen.bind(source);
242
+ overrides.screen = async (args) => {
243
+ await guard("screen" /* Screen */);
244
+ return screen(args);
245
+ };
246
+ }
247
+ if (source.setNetworkPolicy != null) {
248
+ const setNetworkPolicy = source.setNetworkPolicy.bind(source);
249
+ overrides.setNetworkPolicy = async (policy) => {
250
+ await guard("setNetworkPolicy" /* SetNetworkPolicy */);
251
+ await setNetworkPolicy(policy);
252
+ };
253
+ }
254
+ if (source.egress != null) {
255
+ const egress = source.egress.bind(source);
256
+ overrides.egress = async (request) => {
257
+ await guard("egress" /* Egress */);
258
+ return egress(request);
259
+ };
260
+ }
261
+ if (source.localMcp != null) {
262
+ const localMcp = source.localMcp.bind(source);
263
+ overrides.localMcp = async () => {
264
+ await guard("localMcp" /* LocalMcp */);
265
+ return (await localMcp()).map(endpoint);
266
+ };
267
+ }
268
+ for (const method of guardedMethods) {
269
+ if (unchangedFrom != null && sandboxMethodSource(source[method]) === sandboxMethodSource(unchangedFrom[method]))
270
+ delete overrides[method];
271
+ const wrapped = overrides[method];
272
+ const original = sandboxMethodSource(source[method]);
273
+ if (typeof wrapped === "function") {
274
+ const inherited = typeof original === "function" ? executionChecks.get(original) ?? [] : [];
275
+ const value = source[method];
276
+ if (typeof value === "function")
277
+ executionSources.set(wrapped, {
278
+ method: (typeof original === "function" ? executionSources.get(original)?.method : void 0) ?? value.bind(source),
279
+ fetch: (typeof original === "function" ? executionSources.get(original)?.fetch : void 0) ?? options.fetch
280
+ });
281
+ executionChecks.set(wrapped, [
282
+ .../* @__PURE__ */ new Set([...checks ?? [options.beforeExecution], ...inherited])
283
+ ]);
284
+ }
285
+ }
286
+ Object.defineProperty(overrides, executionGuardMarker, { value: true, enumerable: true });
287
+ return withSandboxOverrides(source, overrides);
288
+ };
289
+ const withSandboxExecutionGuard = (options) => buildSandboxExecutionGuard(options);
290
+ const mapSandboxExecutionGuard = (options) => {
291
+ const checks = /* @__PURE__ */ new Set();
292
+ for (const method of guardedMethods) {
293
+ const original = sandboxMethodSource(options.original[method]);
294
+ if (typeof original === "function")
295
+ for (const check of executionChecks.get(original) ?? []) checks.add(check);
296
+ }
297
+ const layers = [...checks];
298
+ if (layers.length === 0) return options.sandbox;
299
+ const inheritedFetch = guardedMethods.map((method) => {
300
+ const original = sandboxMethodSource(options.original[method]);
301
+ return typeof original === "function" ? executionSources.get(original)?.fetch : void 0;
302
+ }).find((fetch) => fetch != null);
303
+ return buildSandboxExecutionGuard(
304
+ {
305
+ sandbox: options.sandbox,
306
+ fetch: inheritedFetch ?? options.fetch,
307
+ beforeExecution: async (context) => {
308
+ for (const check of layers) await check(context);
309
+ }
310
+ },
311
+ options.original,
312
+ layers
313
+ );
314
+ };
315
+ export {
316
+ SandboxExecutionOperation,
317
+ hasSandboxExecutionGuard,
318
+ mapSandboxExecutionGuard,
319
+ sandboxForExecutionMapping,
320
+ withSandboxExecutionGuard
321
+ };
322
+ //# sourceMappingURL=execution-guard.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/sandbox/execution-guard.ts"],
4
+ "sourcesContent": ["import * as z from 'zod';\nimport { createHttpMcpChannelEndpoint } from \"./mcp-channel.mjs\";\nimport { createConfinedFileReader } from \"./confined-files.mjs\";\nimport { sandboxMethodSource, withSandboxOverrides } from \"./overrides.mjs\";\nimport type { NetworkSandboxSessionIface, SandboxMcpEndpoint } from \"./types.mjs\";\n\nconst serialize = <Args extends unknown[], Value>(action: (...args: Args) => Promise<Value>) => {\n let previous = Promise.resolve();\n return (...args: Args): Promise<Value> => {\n const result = previous.then(() => action(...args));\n previous = result.then(\n () => {},\n () => {},\n );\n return result;\n };\n};\n\nconst executionGuardMarker = Symbol('sandboxExecutionGuard');\n\nexport const hasSandboxExecutionGuard = (sandbox: NetworkSandboxSessionIface): boolean =>\n Reflect.get(sandbox, executionGuardMarker) === true;\n\nexport enum SandboxExecutionOperation {\n Run = 'run',\n Spawn = 'spawn',\n ProcessInput = 'processInput',\n WriteFile = 'writeFile',\n WriteTextFile = 'writeTextFile',\n WriteBinaryFile = 'writeBinaryFile',\n RemovePath = 'removePath',\n SetNetworkPolicy = 'setNetworkPolicy',\n Egress = 'egress',\n PortEndpoint = 'portEndpoint',\n Screen = 'screen',\n ComputerUse = 'computerUse',\n LocalMcp = 'localMcp',\n Mcp = 'mcp',\n Editor = 'editor',\n}\n\nexport interface SandboxExecutionContextIface {\n operation: SandboxExecutionOperation;\n // Protocol maintenance can occur between foreground turns; this is not an authorization grant.\n background: boolean;\n abortSignal?: AbortSignal;\n}\n\nexport interface SandboxExecutionGuardOptionsIface<S extends NetworkSandboxSessionIface> {\n sandbox: S;\n fetch?: typeof globalThis.fetch;\n beforeExecution: (context: SandboxExecutionContextIface) => Promise<void>;\n}\n\nconst guardedMethods = [\n 'run',\n 'spawn',\n 'writeFile',\n 'writeTextFile',\n 'writeBinaryFile',\n 'removePath',\n 'getPortEndpoint',\n 'getPortUrl',\n 'setNetworkPolicy',\n 'egress',\n 'computerUse',\n 'screen',\n 'localMcp',\n] satisfies (keyof NetworkSandboxSessionIface)[];\nconst executionChecks = new WeakMap<\n object,\n readonly ((context: SandboxExecutionContextIface) => Promise<void>)[]\n>();\n\nconst executionSources = new WeakMap<\n object,\n { method: unknown; fetch?: typeof globalThis.fetch }\n>();\n\n// Mapping runs against raw methods; the mapped result receives the retained checks once.\nexport const sandboxForExecutionMapping = <S extends NetworkSandboxSessionIface>(sandbox: S): S => {\n const overrides: Record<string, unknown> = {};\n for (const method of guardedMethods) {\n const original = sandboxMethodSource(sandbox[method]);\n if (typeof original !== 'function') continue;\n const source = executionSources.get(original);\n if (source != null) overrides[method] = source.method;\n }\n return withSandboxOverrides(sandbox, overrides);\n};\n\n// The host supplies admission policy; this adapter knows nothing about users, Devices or tunnels.\nconst buildSandboxExecutionGuard = <S extends NetworkSandboxSessionIface>(\n options: SandboxExecutionGuardOptionsIface<S>,\n unchangedFrom?: S,\n checks?: readonly ((context: SandboxExecutionContextIface) => Promise<void>)[],\n): S => {\n const source = options.sandbox;\n const guard = async (\n operation: SandboxExecutionOperation,\n background = false,\n abortSignal?: AbortSignal,\n ) => {\n abortSignal?.throwIfAborted();\n let aborted: (() => void) | undefined;\n try {\n const admission = options.beforeExecution({ operation, background, abortSignal });\n if (abortSignal == null) await admission;\n else\n await Promise.race([\n admission,\n new Promise<never>((_resolve, reject) => {\n aborted = () => reject(abortSignal.reason);\n abortSignal.addEventListener('abort', aborted, { once: true });\n if (abortSignal.aborted) aborted();\n }),\n ]);\n abortSignal?.throwIfAborted();\n } finally {\n if (aborted != null) abortSignal?.removeEventListener('abort', aborted);\n }\n };\n const stdinFor = (\n stdin: ReadableStream<Uint8Array> | string | undefined,\n abortSignal?: AbortSignal,\n ) => {\n if (stdin == null || typeof stdin === 'string') return stdin;\n let reader: ReadableStreamDefaultReader<Uint8Array> | null = null;\n return new ReadableStream<Uint8Array>(\n {\n pull: async (controller) => {\n try {\n reader ??= stdin.getReader();\n const next = await reader.read();\n await guard(SandboxExecutionOperation.ProcessInput, false, abortSignal);\n if (next.done) {\n reader.releaseLock();\n controller.close();\n return;\n }\n controller.enqueue(next.value);\n } catch (cause) {\n controller.error(cause);\n await reader?.cancel(cause).catch(() => undefined);\n reader?.releaseLock();\n }\n },\n cancel: async (reason) => {\n if (reader == null) await stdin.cancel(reason);\n else {\n try {\n await reader.cancel(reason);\n } finally {\n reader.releaseLock();\n }\n }\n },\n },\n { highWaterMark: 0 },\n );\n };\n const endpoint = (value: SandboxMcpEndpoint): SandboxMcpEndpoint => {\n const channelEndpoint =\n 'connect' in value\n ? value\n : createHttpMcpChannelEndpoint(value, options.fetch, {\n beforeRequest: () => guard(SandboxExecutionOperation.Mcp, true),\n });\n return {\n name: channelEndpoint.name,\n connect: async (args) => {\n await guard(SandboxExecutionOperation.Mcp, false, args?.abortSignal);\n const channel = await channelEndpoint.connect(args);\n const admitSend = serialize(async (...[message, opts]: Parameters<typeof channel.send>) => {\n const parsed = z.object({ method: z.string().optional() }).safeParse(message);\n const method = parsed.success ? parsed.data.method : undefined;\n // SDK catalog refreshes and protocol replies can run between foreground turns.\n const background =\n parsed.success &&\n (method == null ||\n [\n 'initialize',\n 'ping',\n 'tools/list',\n 'subscriptions/listen',\n 'notifications/initialized',\n 'notifications/cancelled',\n 'notifications/subscriptions/acknowledged',\n ].includes(method));\n opts?.abortSignal?.throwIfAborted();\n await guard(SandboxExecutionOperation.Mcp, background, opts?.abortSignal);\n opts?.abortSignal?.throwIfAborted();\n // Preserve dispatch order without waiting for an HTTP tool response.\n return { completion: channel.send(message, opts) };\n });\n const send: typeof channel.send = async (message, opts) =>\n (await admitSend(message, opts)).completion;\n let pending: Awaited<ReturnType<typeof channel.receive>> | null = null;\n let receiving = Promise.resolve();\n const receive: typeof channel.receive = (opts) =>\n new Promise((resolve, reject) => {\n const signal = opts?.abortSignal;\n const aborted = () => reject(signal?.reason);\n signal?.addEventListener('abort', aborted, { once: true });\n if (signal?.aborted === true) {\n signal.removeEventListener('abort', aborted);\n reject(signal.reason);\n return;\n }\n const result = receiving.then(async () => {\n signal?.throwIfAborted();\n pending ??= await channel.receive(opts);\n signal?.throwIfAborted();\n // Retain the batch on denial or cancellation until a receiver accepts it.\n if (pending.length > 0) await guard(SandboxExecutionOperation.Mcp, true);\n signal?.throwIfAborted();\n resolve(pending);\n pending = null;\n });\n receiving = result.then(\n () => {},\n () => {},\n );\n void result.catch(reject).finally(() => signal?.removeEventListener('abort', aborted));\n });\n return withSandboxOverrides(channel, { send, receive });\n },\n };\n };\n const overrides: Partial<NetworkSandboxSessionIface> = {\n confinedFileReader: source.confinedFileReader ?? createConfinedFileReader(source),\n getPortUrl: async (args) => {\n await guard(SandboxExecutionOperation.PortEndpoint);\n return source.getPortUrl(args);\n },\n getPortEndpoint: async (args) => {\n await guard(SandboxExecutionOperation.PortEndpoint);\n return source.getPortEndpoint(args);\n },\n run: async (args) => {\n await guard(SandboxExecutionOperation.Run, false, args.abortSignal);\n return source.run({ ...args, stdin: stdinFor(args.stdin, args.abortSignal) });\n },\n spawn: async (args) => {\n await guard(SandboxExecutionOperation.Spawn, false, args.abortSignal);\n const process = await source.spawn({\n ...args,\n stdin: stdinFor(args.stdin, args.abortSignal),\n });\n let writeFailed = false;\n const write: typeof process.write = async (data, opts) => {\n if (writeFailed)\n throw new Error('Process stdin is unusable after a failed write; restart the process');\n try {\n await guard(SandboxExecutionOperation.ProcessInput);\n await process.write(data, opts);\n } catch (cause) {\n writeFailed = true;\n throw cause;\n }\n };\n return withSandboxOverrides(process, { write: serialize(write) });\n },\n writeFile: async (args) => {\n await guard(SandboxExecutionOperation.WriteFile, false, args.abortSignal);\n return source.writeFile(args);\n },\n writeTextFile: async (args) => {\n await guard(SandboxExecutionOperation.WriteTextFile, false, args.abortSignal);\n return source.writeTextFile(args);\n },\n writeBinaryFile: async (args) => {\n await guard(SandboxExecutionOperation.WriteBinaryFile, false, args.abortSignal);\n return source.writeBinaryFile(args);\n },\n removePath: async (args) => {\n await guard(SandboxExecutionOperation.RemovePath, false, args.abortSignal);\n return source.removePath(args);\n },\n };\n if (source.computerUse != null) {\n const computerUse = source.computerUse.bind(source);\n overrides.computerUse = async () => {\n await guard(SandboxExecutionOperation.ComputerUse);\n return endpoint(await computerUse());\n };\n }\n if (source.screen != null) {\n const screen = source.screen.bind(source);\n overrides.screen = async (args) => {\n await guard(SandboxExecutionOperation.Screen);\n return screen(args);\n };\n }\n if (source.setNetworkPolicy != null) {\n const setNetworkPolicy = source.setNetworkPolicy.bind(source);\n overrides.setNetworkPolicy = async (policy) => {\n await guard(SandboxExecutionOperation.SetNetworkPolicy);\n await setNetworkPolicy(policy);\n };\n }\n if (source.egress != null) {\n const egress = source.egress.bind(source);\n overrides.egress = async (request) => {\n await guard(SandboxExecutionOperation.Egress);\n return egress(request);\n };\n }\n if (source.localMcp != null) {\n const localMcp = source.localMcp.bind(source);\n overrides.localMcp = async () => {\n await guard(SandboxExecutionOperation.LocalMcp);\n return (await localMcp()).map(endpoint);\n };\n }\n for (const method of guardedMethods) {\n if (\n unchangedFrom != null &&\n sandboxMethodSource(source[method]) === sandboxMethodSource(unchangedFrom[method])\n )\n delete overrides[method];\n const wrapped = overrides[method];\n const original = sandboxMethodSource(source[method]);\n if (typeof wrapped === 'function') {\n const inherited = typeof original === 'function' ? (executionChecks.get(original) ?? []) : [];\n const value = source[method];\n if (typeof value === 'function')\n executionSources.set(wrapped, {\n method:\n (typeof original === 'function' ? executionSources.get(original)?.method : undefined) ??\n value.bind(source),\n fetch:\n (typeof original === 'function' ? executionSources.get(original)?.fetch : undefined) ??\n options.fetch,\n });\n executionChecks.set(wrapped, [\n ...new Set([...(checks ?? [options.beforeExecution]), ...inherited]),\n ]);\n }\n }\n Object.defineProperty(overrides, executionGuardMarker, { value: true, enumerable: true });\n return withSandboxOverrides(source, overrides);\n};\n\nexport const withSandboxExecutionGuard = <S extends NetworkSandboxSessionIface>(\n options: SandboxExecutionGuardOptionsIface<S>,\n): S => buildSandboxExecutionGuard(options);\n\n// Replacements inherit every original check; identical methods retain their existing wrappers.\nexport const mapSandboxExecutionGuard = <S extends NetworkSandboxSessionIface>(options: {\n sandbox: S;\n original: S;\n fetch?: typeof globalThis.fetch;\n}): S => {\n const checks = new Set<(context: SandboxExecutionContextIface) => Promise<void>>();\n for (const method of guardedMethods) {\n const original = sandboxMethodSource(options.original[method]);\n if (typeof original === 'function')\n for (const check of executionChecks.get(original) ?? []) checks.add(check);\n }\n const layers = [...checks];\n if (layers.length === 0) return options.sandbox;\n const inheritedFetch = guardedMethods\n .map((method) => {\n const original = sandboxMethodSource(options.original[method]);\n return typeof original === 'function' ? executionSources.get(original)?.fetch : undefined;\n })\n .find((fetch) => fetch != null);\n return buildSandboxExecutionGuard(\n {\n sandbox: options.sandbox,\n fetch: inheritedFetch ?? options.fetch,\n beforeExecution: async (context) => {\n for (const check of layers) await check(context);\n },\n },\n options.original,\n layers,\n );\n};\n"],
5
+ "mappings": "AAAA,YAAY,OAAO;AACnB,SAAS,oCAAoC;AAC7C,SAAS,gCAAgC;A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AA,EACF;AACF;",
6
+ "names": ["SandboxExecutionOperation"]
7
+ }
@@ -0,0 +1,6 @@
1
+ export declare enum SandboxEntryType {
2
+ File = "file",
3
+ Directory = "directory",
4
+ Symlink = "symlink",
5
+ Other = "other"
6
+ }
@@ -0,0 +1,11 @@
1
+ var SandboxEntryType = /* @__PURE__ */ ((SandboxEntryType2) => {
2
+ SandboxEntryType2["File"] = "file";
3
+ SandboxEntryType2["Directory"] = "directory";
4
+ SandboxEntryType2["Symlink"] = "symlink";
5
+ SandboxEntryType2["Other"] = "other";
6
+ return SandboxEntryType2;
7
+ })(SandboxEntryType || {});
8
+ export {
9
+ SandboxEntryType
10
+ };
11
+ //# sourceMappingURL=file-kind.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/sandbox/file-kind.ts"],
4
+ "sourcesContent": ["export enum SandboxEntryType {\n File = 'file',\n Directory = 'directory',\n Symlink = 'symlink',\n Other = 'other',\n}\n"],
5
+ "mappings": "AAAO,IAAK,mBAAL,kBAAKA,sBAAL;AACL,EAAAA,kBAAA,UAAO;AACP,EAAAA,kBAAA,eAAY;AACZ,EAAAA,kBAAA,aAAU;AACV,EAAAA,kBAAA,WAAQ;AAJE,SAAAA;AAAA,GAAA;",
6
+ "names": ["SandboxEntryType"]
7
+ }
@@ -0,0 +1,15 @@
1
+ import * as z from 'zod';
2
+ import { SandboxEntryType } from "./file-kind.mjs";
3
+ export declare const statSchema: z.ZodObject<{
4
+ path: z.ZodString;
5
+ type: z.ZodPipe<z.ZodString, z.ZodTransform<SandboxEntryType, string>>;
6
+ size: z.ZodNumber;
7
+ modifiedAt: z.ZodNullable<z.ZodString>;
8
+ mode: z.ZodNullable<z.ZodNumber>;
9
+ }, z.core.$strip>;
10
+ export declare const dirEntrySchema: z.ZodObject<{
11
+ name: z.ZodString;
12
+ path: z.ZodString;
13
+ type: z.ZodPipe<z.ZodString, z.ZodTransform<SandboxEntryType, string>>;
14
+ size: z.ZodNullable<z.ZodNumber>;
15
+ }, z.core.$strip>;
@@ -0,0 +1,22 @@
1
+ import * as z from "zod";
2
+ import { SandboxEntryType } from "./file-kind.mjs";
3
+ const isSandboxEntryType = (value) => Object.values(SandboxEntryType).some((entryType) => entryType === value);
4
+ const entryTypeSchema = z.string().transform((value) => isSandboxEntryType(value) ? value : SandboxEntryType.Other);
5
+ const statSchema = z.object({
6
+ path: z.string(),
7
+ type: entryTypeSchema,
8
+ size: z.number().nonnegative(),
9
+ modifiedAt: z.string().nullable(),
10
+ mode: z.number().int().nullable()
11
+ });
12
+ const dirEntrySchema = z.object({
13
+ name: z.string(),
14
+ path: z.string(),
15
+ type: entryTypeSchema,
16
+ size: z.number().nonnegative().nullable()
17
+ });
18
+ export {
19
+ dirEntrySchema,
20
+ statSchema
21
+ };
22
+ //# sourceMappingURL=file-schemas.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/sandbox/file-schemas.ts"],
4
+ "sourcesContent": ["import * as z from 'zod';\nimport { SandboxEntryType } from \"./file-kind.mjs\";\n\nconst isSandboxEntryType = (value: string): value is SandboxEntryType =>\n Object.values(SandboxEntryType).some((entryType) => entryType === value);\nconst entryTypeSchema = z\n .string()\n .transform((value) => (isSandboxEntryType(value) ? value : SandboxEntryType.Other));\n\nexport const statSchema = z.object({\n path: z.string(),\n type: entryTypeSchema,\n size: z.number().nonnegative(),\n modifiedAt: z.string().nullable(),\n mode: z.number().int().nullable(),\n});\n\nexport const dirEntrySchema = z.object({\n name: z.string(),\n path: z.string(),\n type: entryTypeSchema,\n size: z.number().nonnegative().nullable(),\n});\n"],
5
+ "mappings": "AAAA,YAAY,OAAO;AACnB,SAAS,wBAAwB;AAEjC,MAAM,qBAAqB,CAAC,UAC1B,OAAO,OAAO,gBAAgB,EAAE,KAAK,CAAC,cAAc,cAAc,KAAK;AACzE,MAAM,kBAAkB,EACrB,OAAO,EACP,UAAU,CAAC,UAAW,mBAAmB,KAAK,IAAI,QAAQ,iBAAiB,KAAM;AAE7E,MAAM,aAAa,EAAE,OAAO;AAAA,EACjC,MAAM,EAAE,OAAO;AAAA,EACf,MAAM;AAAA,EACN,MAAM,EAAE,OAAO,EAAE,YAAY;AAAA,EAC7B,YAAY,EAAE,OAAO,EAAE,SAAS;AAAA,EAChC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS;AAClC,CAAC;AAEM,MAAM,iBAAiB,EAAE,OAAO;AAAA,EACrC,MAAM,EAAE,OAAO;AAAA,EACf,MAAM,EAAE,OAAO;AAAA,EACf,MAAM;AAAA,EACN,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,SAAS;AAC1C,CAAC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,15 @@
1
+ import { type SandboxExecutionContextIface } from "./execution-guard.mjs";
2
+ import type { NetworkSandboxSessionIface, SandboxProviderHandleIface } from "./types.mjs";
3
+ export interface SandboxExecutionPolicyIface {
4
+ beforeExecution(context: SandboxExecutionContextIface): Promise<void>;
5
+ fetch?: typeof globalThis.fetch;
6
+ }
7
+ export interface CreateSandboxHandleOptionsIface<S extends NetworkSandboxSessionIface> {
8
+ handle: SandboxProviderHandleIface<S>;
9
+ executionPolicy?: SandboxExecutionPolicyIface;
10
+ }
11
+ export declare const createSandboxHandle: <S extends NetworkSandboxSessionIface>(options: CreateSandboxHandleOptionsIface<S>) => SandboxProviderHandleIface<S>;
12
+ export declare const mapSandboxHandle: <S extends NetworkSandboxSessionIface>(options: {
13
+ handle: SandboxProviderHandleIface<S>;
14
+ mapSandbox: (sandbox: S) => S;
15
+ }) => SandboxProviderHandleIface<S>;
@@ -0,0 +1,47 @@
1
+ import {
2
+ mapSandboxExecutionGuard,
3
+ sandboxForExecutionMapping,
4
+ withSandboxExecutionGuard
5
+ } from "./execution-guard.mjs";
6
+ import { withSandboxOverrides } from "./overrides.mjs";
7
+ const constructedHandles = /* @__PURE__ */ new WeakMap();
8
+ const createSandboxHandle = (options) => {
9
+ const { handle, executionPolicy } = options;
10
+ const providerPolicy = handle.executionPolicy;
11
+ if (executionPolicy == null && providerPolicy == null) return handle;
12
+ const existing = constructedHandles.get(handle);
13
+ if (existing != null && existing.hostPolicy === executionPolicy && providerPolicy == null)
14
+ return handle;
15
+ const result = withSandboxOverrides(handle, {
16
+ // The provider policy is consumed; outer composition must not install it a second time.
17
+ executionPolicy: void 0,
18
+ sandbox: withSandboxExecutionGuard({
19
+ sandbox: handle.sandbox,
20
+ fetch: providerPolicy?.fetch ?? executionPolicy?.fetch,
21
+ beforeExecution: async (context) => {
22
+ await executionPolicy?.beforeExecution(context);
23
+ if (providerPolicy !== executionPolicy) await providerPolicy?.beforeExecution(context);
24
+ }
25
+ })
26
+ });
27
+ constructedHandles.set(result, { hostPolicy: executionPolicy, providerPolicy });
28
+ return result;
29
+ };
30
+ const mapSandboxHandle = (options) => {
31
+ const state = constructedHandles.get(options.handle);
32
+ const mapped = options.mapSandbox(sandboxForExecutionMapping(options.handle.sandbox));
33
+ const result = withSandboxOverrides(options.handle, {
34
+ sandbox: mapSandboxExecutionGuard({
35
+ sandbox: mapped,
36
+ original: options.handle.sandbox,
37
+ fetch: state?.providerPolicy?.fetch ?? state?.hostPolicy?.fetch
38
+ })
39
+ });
40
+ if (state != null) constructedHandles.set(result, state);
41
+ return result;
42
+ };
43
+ export {
44
+ createSandboxHandle,
45
+ mapSandboxHandle
46
+ };
47
+ //# sourceMappingURL=handle.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/sandbox/handle.ts"],
4
+ "sourcesContent": ["import {\n mapSandboxExecutionGuard,\n sandboxForExecutionMapping,\n withSandboxExecutionGuard,\n type SandboxExecutionContextIface,\n} from \"./execution-guard.mjs\";\nimport { withSandboxOverrides } from \"./overrides.mjs\";\nimport type { NetworkSandboxSessionIface, SandboxProviderHandleIface } from \"./types.mjs\";\n\nexport interface SandboxExecutionPolicyIface {\n beforeExecution(context: SandboxExecutionContextIface): Promise<void>;\n // Optional transport for URL-backed MCP endpoints; it does not replace admission.\n fetch?: typeof globalThis.fetch;\n}\n\nexport interface CreateSandboxHandleOptionsIface<S extends NetworkSandboxSessionIface> {\n handle: SandboxProviderHandleIface<S>;\n executionPolicy?: SandboxExecutionPolicyIface;\n}\n\ninterface ConstructedHandleIface {\n hostPolicy?: SandboxExecutionPolicyIface;\n providerPolicy?: SandboxExecutionPolicyIface;\n}\nconst constructedHandles = new WeakMap<object, ConstructedHandleIface>();\n\n// Providers retain their raw executor for setup; only this handle is exposed to consumers.\nexport const createSandboxHandle = <S extends NetworkSandboxSessionIface>(\n options: CreateSandboxHandleOptionsIface<S>,\n): SandboxProviderHandleIface<S> => {\n const { handle, executionPolicy } = options;\n const providerPolicy = handle.executionPolicy;\n if (executionPolicy == null && providerPolicy == null) return handle;\n const existing = constructedHandles.get(handle);\n if (existing != null && existing.hostPolicy === executionPolicy && providerPolicy == null)\n return handle;\n const result = withSandboxOverrides(handle, {\n // The provider policy is consumed; outer composition must not install it a second time.\n executionPolicy: undefined,\n sandbox: withSandboxExecutionGuard({\n sandbox: handle.sandbox,\n fetch: providerPolicy?.fetch ?? executionPolicy?.fetch,\n beforeExecution: async (context) => {\n await executionPolicy?.beforeExecution(context);\n if (providerPolicy !== executionPolicy) await providerPolicy?.beforeExecution(context);\n },\n }),\n });\n constructedHandles.set(result, { hostPolicy: executionPolicy, providerPolicy });\n return result;\n};\n\n// Trusted structural mapping uses raw methods to avoid repeated admission on delegation.\n// Expose only the returned handle; its replacements inherit the original checks.\nexport const mapSandboxHandle = <S extends NetworkSandboxSessionIface>(options: {\n handle: SandboxProviderHandleIface<S>;\n mapSandbox: (sandbox: S) => S;\n}): SandboxProviderHandleIface<S> => {\n const state = constructedHandles.get(options.handle);\n const mapped = options.mapSandbox(sandboxForExecutionMapping(options.handle.sandbox));\n const result = withSandboxOverrides(options.handle, {\n sandbox: mapSandboxExecutionGuard({\n sandbox: mapped,\n original: options.handle.sandbox,\n fetch: state?.providerPolicy?.fetch ?? state?.hostPolicy?.fetch,\n }),\n });\n if (state != null) constructedHandles.set(result, state);\n return result;\n};\n"],
5
+ "mappings": "AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,SAAS,4BAA4B;AAkBrC,MAAM,qBAAqB,oBAAI,QAAwC;AAGhE,MAAM,sBAAsB,CACjC,YACkC;AAClC,QAAM,EAAE,QAAQ,gBAAgB,IAAI;AACpC,QAAM,iBAAiB,OAAO;AAC9B,MAAI,mBAAmB,QAAQ,kBAAkB,KAAM,QAAO;AAC9D,QAAM,WAAW,mBAAmB,IAAI,MAAM;AAC9C,MAAI,YAAY,QAAQ,SAAS,eAAe,mBAAmB,kBAAkB;AACnF,WAAO;AACT,QAAM,SAAS,qBAAqB,QAAQ;AAAA;AAAA,IAE1C,iBAAiB;AAAA,IACjB,SAAS,0BAA0B;AAAA,MACjC,SAAS,OAAO;AAAA,MAChB,OAAO,gBAAgB,SAAS,iBAAiB;AAAA,MACjD,iBAAiB,OAAO,YAAY;AAClC,cAAM,iBAAiB,gBAAgB,OAAO;AAC9C,YAAI,mBAAmB,gBAAiB,OAAM,gBAAgB,gBAAgB,OAAO;AAAA,MACvF;AAAA,IACF,CAAC;AAAA,EACH,CAAC;AACD,qBAAmB,IAAI,QAAQ,EAAE,YAAY,iBAAiB,eAAe,CAAC;AAC9E,SAAO;AACT;AAIO,MAAM,mBAAmB,CAAuC,YAGlC;AACnC,QAAM,QAAQ,mBAAmB,IAAI,QAAQ,MAAM;AACnD,QAAM,SAAS,QAAQ,WAAW,2BAA2B,QAAQ,OAAO,OAAO,CAAC;AACpF,QAAM,SAAS,qBAAqB,QAAQ,QAAQ;AAAA,IAClD,SAAS,yBAAyB;AAAA,MAChC,SAAS;AAAA,MACT,UAAU,QAAQ,OAAO;AAAA,MACzB,OAAO,OAAO,gBAAgB,SAAS,OAAO,YAAY;AAAA,IAC5D,CAAC;AAAA,EACH,CAAC;AACD,MAAI,SAAS,KAAM,oBAAmB,IAAI,QAAQ,KAAK;AACvD,SAAO;AACT;",
6
+ "names": []
7
+ }
@@ -1,3 +1,10 @@
1
+ export { withSandboxExecutionGuard, SandboxExecutionOperation, type SandboxExecutionContextIface, type SandboxExecutionGuardOptionsIface, } from "./execution-guard.mjs";
2
+ export { withSandboxOverrides } from "./overrides.mjs";
3
+ export { createSandboxHandle, mapSandboxHandle, type CreateSandboxHandleOptionsIface, type SandboxExecutionPolicyIface, } from "./handle.mjs";
4
+ export * from "./networking.mjs";
5
+ export { sandboxWorkspaceId } from "./workspace-identity.mjs";
6
+ export { resolveSandboxToolPolicy } from "./tool-policy.mjs";
7
+ export { WorkspaceEgressAction, workspaceEgressRequestSchema, workspaceEgressStatusSchema, type WorkspaceEgressRequestIface, type WorkspaceEgressStatusIface, } from '@finalai/agent-protocol/device-egress';
1
8
  export { ProcessInspectionOperation, inspectedProcessSchema, processInspectionDetailSchema, processInspectionPageSchema, processInspectionRequestSchema, processInspectionResultSchema, type InspectedProcessIface, type ProcessInspectionDetailIface, type ProcessInspectionPageIface, type ProcessInspectionRequestIface, type ProcessInspectionResultIface, } from '@finalai/agent-protocol/process-inspection';
2
9
  export { decodeSandboxText, encodeSandboxText } from "./bytes.mjs";
3
10
  export * from "./client.mjs";
@@ -16,3 +23,4 @@ export { mapSessionPath, withSessionWorkspaceRoot } from "./workspace-root.mjs";
16
23
  export type { MapSessionPathArgsIface } from "./workspace-root.mjs";
17
24
  export * from "./snapshots.mjs";
18
25
  export { SandboxEditorOperation, sandboxEditorRequestSchema, sandboxEditorResultSchema, sandboxEditorSessionSchema, type SandboxEditorRequestIface, type SandboxEditorResultIface, type SandboxEditorSessionIface, } from "./editor.mjs";
26
+ export { createHttpMcpChannelEndpoint } from "./mcp-channel.mjs";
@@ -1,3 +1,20 @@
1
+ import {
2
+ withSandboxExecutionGuard,
3
+ SandboxExecutionOperation
4
+ } from "./execution-guard.mjs";
5
+ import { withSandboxOverrides } from "./overrides.mjs";
6
+ import {
7
+ createSandboxHandle,
8
+ mapSandboxHandle
9
+ } from "./handle.mjs";
10
+ export * from "./networking.mjs";
11
+ import { sandboxWorkspaceId } from "./workspace-identity.mjs";
12
+ import { resolveSandboxToolPolicy } from "./tool-policy.mjs";
13
+ import {
14
+ WorkspaceEgressAction,
15
+ workspaceEgressRequestSchema,
16
+ workspaceEgressStatusSchema
17
+ } from "@finalai/agent-protocol/device-egress";
1
18
  import {
2
19
  ProcessInspectionOperation,
3
20
  inspectedProcessSchema,
@@ -39,22 +56,29 @@ import {
39
56
  sandboxEditorResultSchema,
40
57
  sandboxEditorSessionSchema
41
58
  } from "./editor.mjs";
59
+ import { createHttpMcpChannelEndpoint } from "./mcp-channel.mjs";
42
60
  export {
43
61
  MAX_SANDBOX_SEED_BYTES,
44
62
  ProcessInspectionOperation,
45
63
  SANDBOX_SEED_MARKER,
46
64
  SANDBOX_SEED_PROTOCOL,
47
65
  SandboxEditorOperation,
66
+ SandboxExecutionOperation,
67
+ WorkspaceEgressAction,
48
68
  createConfinedFileReader,
69
+ createHttpMcpChannelEndpoint,
70
+ createSandboxHandle,
49
71
  decodeSandboxText,
50
72
  encodeSandboxText,
51
73
  inspectedProcessSchema,
74
+ mapSandboxHandle,
52
75
  mapSessionPath,
53
76
  materializeSandboxSeeds,
54
77
  processInspectionDetailSchema,
55
78
  processInspectionPageSchema,
56
79
  processInspectionRequestSchema,
57
80
  processInspectionResultSchema,
81
+ resolveSandboxToolPolicy,
58
82
  sandboxEditorRequestSchema,
59
83
  sandboxEditorResultSchema,
60
84
  sandboxEditorSessionSchema,
@@ -65,6 +89,11 @@ export {
65
89
  sandboxSeedFilesForStart,
66
90
  sandboxSeedFilesSchema,
67
91
  sandboxSeedIdentity,
68
- withSessionWorkspaceRoot
92
+ sandboxWorkspaceId,
93
+ withSandboxExecutionGuard,
94
+ withSandboxOverrides,
95
+ withSessionWorkspaceRoot,
96
+ workspaceEgressRequestSchema,
97
+ workspaceEgressStatusSchema
69
98
  };
70
99
  //# sourceMappingURL=index.mjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/sandbox/index.ts"],
4
- "sourcesContent": ["export {\n ProcessInspectionOperation,\n inspectedProcessSchema,\n processInspectionDetailSchema,\n processInspectionPageSchema,\n processInspectionRequestSchema,\n processInspectionResultSchema,\n type InspectedProcessIface,\n type ProcessInspectionDetailIface,\n type ProcessInspectionPageIface,\n type ProcessInspectionRequestIface,\n type ProcessInspectionResultIface,\n} from '@finalai/agent-protocol/process-inspection';\nexport { decodeSandboxText, encodeSandboxText } from \"./bytes.mjs\";\nexport * from \"./client.mjs\";\nexport { createConfinedFileReader } from \"./confined-files.mjs\";\nexport * from \"./convenience.mjs\";\nexport * from \"./mcp.mjs\";\nexport * from \"./mcp-testing.mjs\";\nexport * from \"./memory-sandbox.mjs\";\nexport * from \"./open-scope.mjs\";\nexport {\n MAX_SANDBOX_SEED_BYTES,\n SANDBOX_SEED_MARKER,\n SANDBOX_SEED_PROTOCOL,\n materializeSandboxSeeds,\n sandboxPreparationInputs,\n sandboxSeedArtifact,\n sandboxSeedArtifactSchema,\n sandboxSeedFiles,\n sandboxSeedFilesForStart,\n sandboxSeedFilesSchema,\n sandboxSeedIdentity,\n} from \"./seeds.mjs\";\nexport * from \"./server.mjs\";\nexport * from \"./testing.mjs\";\nexport * from \"./types.mjs\";\nexport * from \"./wire.mjs\";\nexport { mapSessionPath, withSessionWorkspaceRoot } from \"./workspace-root.mjs\";\nexport type { MapSessionPathArgsIface } from \"./workspace-root.mjs\";\n\nexport * from \"./snapshots.mjs\";\n\nexport {\n SandboxEditorOperation,\n sandboxEditorRequestSchema,\n sandboxEditorResultSchema,\n sandboxEditorSessionSchema,\n type SandboxEditorRequestIface,\n type SandboxEditorResultIface,\n type SandboxEditorSessionIface,\n} from \"./editor.mjs\";\n"],
5
- "mappings": "AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAMK;AACP,SAAS,mBAAmB,yBAAyB;AACrD,cAAc;AACd,SAAS,gCAAgC;AACzC,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,SAAS,gBAAgB,gCAAgC;AAGzD,cAAc;AAEd;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAIK;",
4
+ "sourcesContent": ["export {\n withSandboxExecutionGuard,\n SandboxExecutionOperation,\n type SandboxExecutionContextIface,\n type SandboxExecutionGuardOptionsIface,\n} from \"./execution-guard.mjs\";\nexport { withSandboxOverrides } from \"./overrides.mjs\";\nexport {\n createSandboxHandle,\n mapSandboxHandle,\n type CreateSandboxHandleOptionsIface,\n type SandboxExecutionPolicyIface,\n} from \"./handle.mjs\";\nexport * from \"./networking.mjs\";\nexport { sandboxWorkspaceId } from \"./workspace-identity.mjs\";\nexport { resolveSandboxToolPolicy } from \"./tool-policy.mjs\";\nexport {\n WorkspaceEgressAction,\n workspaceEgressRequestSchema,\n workspaceEgressStatusSchema,\n type WorkspaceEgressRequestIface,\n type WorkspaceEgressStatusIface,\n} from '@finalai/agent-protocol/device-egress';\n\nexport {\n ProcessInspectionOperation,\n inspectedProcessSchema,\n processInspectionDetailSchema,\n processInspectionPageSchema,\n processInspectionRequestSchema,\n processInspectionResultSchema,\n type InspectedProcessIface,\n type ProcessInspectionDetailIface,\n type ProcessInspectionPageIface,\n type ProcessInspectionRequestIface,\n type ProcessInspectionResultIface,\n} from '@finalai/agent-protocol/process-inspection';\nexport { decodeSandboxText, encodeSandboxText } from \"./bytes.mjs\";\nexport * from \"./client.mjs\";\nexport { createConfinedFileReader } from \"./confined-files.mjs\";\nexport * from \"./convenience.mjs\";\nexport * from \"./mcp.mjs\";\nexport * from \"./mcp-testing.mjs\";\nexport * from \"./memory-sandbox.mjs\";\nexport * from \"./open-scope.mjs\";\nexport {\n MAX_SANDBOX_SEED_BYTES,\n SANDBOX_SEED_MARKER,\n SANDBOX_SEED_PROTOCOL,\n materializeSandboxSeeds,\n sandboxPreparationInputs,\n sandboxSeedArtifact,\n sandboxSeedArtifactSchema,\n sandboxSeedFiles,\n sandboxSeedFilesForStart,\n sandboxSeedFilesSchema,\n sandboxSeedIdentity,\n} from \"./seeds.mjs\";\nexport * from \"./server.mjs\";\nexport * from \"./testing.mjs\";\nexport * from \"./types.mjs\";\nexport * from \"./wire.mjs\";\nexport { mapSessionPath, withSessionWorkspaceRoot } from \"./workspace-root.mjs\";\nexport type { MapSessionPathArgsIface } from \"./workspace-root.mjs\";\n\nexport * from \"./snapshots.mjs\";\n\nexport {\n SandboxEditorOperation,\n sandboxEditorRequestSchema,\n sandboxEditorResultSchema,\n sandboxEditorSessionSchema,\n type SandboxEditorRequestIface,\n type SandboxEditorResultIface,\n type SandboxEditorSessionIface,\n} from \"./editor.mjs\";\n\nexport { createHttpMcpChannelEndpoint } from \"./mcp-channel.mjs\";\n"],
5
+ "mappings": "AAAA;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AACP,SAAS,4BAA4B;AACrC;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AACP,cAAc;AACd,SAAS,0BAA0B;AACnC,SAAS,gCAAgC;AACzC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AAEP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAMK;AACP,SAAS,mBAAmB,yBAAyB;AACrD,cAAc;AACd,SAAS,gCAAgC;AACzC,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,SAAS,gBAAgB,gCAAgC;AAGzD,cAAc;AAEd;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AAEP,SAAS,oCAAoC;",
6
6
  "names": []
7
7
  }