@vibesdotdev/agent-execution 0.0.0-stage → 1.0.0-rc.1

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 (191) hide show
  1. package/LICENSE +18 -0
  2. package/README.md +53 -2
  3. package/dist/code-session/agent-code-session.consumer.descriptor.d.ts +68 -0
  4. package/dist/code-session/agent-code-session.consumer.descriptor.d.ts.map +1 -0
  5. package/dist/code-session/agent-code-session.consumer.descriptor.js +31 -0
  6. package/dist/code-session/agent-code-session.consumer.descriptor.js.map +1 -0
  7. package/dist/code-session/agent-code-session.consumer.plugin.d.ts +18 -0
  8. package/dist/code-session/agent-code-session.consumer.plugin.d.ts.map +1 -0
  9. package/dist/code-session/agent-code-session.consumer.plugin.js +47 -0
  10. package/dist/code-session/agent-code-session.consumer.plugin.js.map +1 -0
  11. package/dist/code-session/agent-code-session.descriptor.d.ts +163 -0
  12. package/dist/code-session/agent-code-session.descriptor.d.ts.map +1 -0
  13. package/dist/code-session/agent-code-session.descriptor.js +129 -0
  14. package/dist/code-session/agent-code-session.descriptor.js.map +1 -0
  15. package/dist/code-session/agent-code-session.impl.consumer.d.ts +224 -0
  16. package/dist/code-session/agent-code-session.impl.consumer.d.ts.map +1 -0
  17. package/dist/code-session/agent-code-session.impl.consumer.js +2131 -0
  18. package/dist/code-session/agent-code-session.impl.consumer.js.map +1 -0
  19. package/dist/code-session/agent-code-session.kind.d.ts +15 -0
  20. package/dist/code-session/agent-code-session.kind.d.ts.map +1 -0
  21. package/dist/code-session/agent-code-session.kind.js +17 -0
  22. package/dist/code-session/agent-code-session.kind.js.map +1 -0
  23. package/dist/code-session/agent-code-session.plugin.d.ts +17 -0
  24. package/dist/code-session/agent-code-session.plugin.d.ts.map +1 -0
  25. package/dist/code-session/agent-code-session.plugin.js +28 -0
  26. package/dist/code-session/agent-code-session.plugin.js.map +1 -0
  27. package/dist/code-session/billing/gates.d.ts +52 -0
  28. package/dist/code-session/billing/gates.d.ts.map +1 -0
  29. package/dist/code-session/billing/gates.js +75 -0
  30. package/dist/code-session/billing/gates.js.map +1 -0
  31. package/dist/code-session/client/index.d.ts +2 -0
  32. package/dist/code-session/client/index.d.ts.map +1 -0
  33. package/dist/code-session/client/index.js +2 -0
  34. package/dist/code-session/client/index.js.map +1 -0
  35. package/dist/code-session/client/resolve.d.ts +20 -0
  36. package/dist/code-session/client/resolve.d.ts.map +1 -0
  37. package/dist/code-session/client/resolve.js +145 -0
  38. package/dist/code-session/client/resolve.js.map +1 -0
  39. package/dist/code-session/docs/agent-code-session.docs.descriptor.d.ts +4 -0
  40. package/dist/code-session/docs/agent-code-session.docs.descriptor.d.ts.map +1 -0
  41. package/dist/code-session/docs/agent-code-session.docs.descriptor.js +109 -0
  42. package/dist/code-session/docs/agent-code-session.docs.descriptor.js.map +1 -0
  43. package/dist/code-session/git-credential.d.ts +87 -0
  44. package/dist/code-session/git-credential.d.ts.map +1 -0
  45. package/dist/code-session/git-credential.js +107 -0
  46. package/dist/code-session/git-credential.js.map +1 -0
  47. package/dist/code-session/host-target.d.ts +76 -0
  48. package/dist/code-session/host-target.d.ts.map +1 -0
  49. package/dist/code-session/host-target.js +81 -0
  50. package/dist/code-session/host-target.js.map +1 -0
  51. package/dist/code-session/index.d.ts +20 -0
  52. package/dist/code-session/index.d.ts.map +1 -0
  53. package/dist/code-session/index.js +20 -0
  54. package/dist/code-session/index.js.map +1 -0
  55. package/dist/code-session/interfaces/code-session.d.ts +448 -0
  56. package/dist/code-session/interfaces/code-session.d.ts.map +1 -0
  57. package/dist/code-session/interfaces/code-session.js +373 -0
  58. package/dist/code-session/interfaces/code-session.js.map +1 -0
  59. package/dist/code-session/operation-lease.d.ts +48 -0
  60. package/dist/code-session/operation-lease.d.ts.map +1 -0
  61. package/dist/code-session/operation-lease.js +73 -0
  62. package/dist/code-session/operation-lease.js.map +1 -0
  63. package/dist/code-session/remote-setup-custody.d.ts +59 -0
  64. package/dist/code-session/remote-setup-custody.d.ts.map +1 -0
  65. package/dist/code-session/remote-setup-custody.js +78 -0
  66. package/dist/code-session/remote-setup-custody.js.map +1 -0
  67. package/dist/code-session/remote-workspace-fs.d.ts +119 -0
  68. package/dist/code-session/remote-workspace-fs.d.ts.map +1 -0
  69. package/dist/code-session/remote-workspace-fs.js +257 -0
  70. package/dist/code-session/remote-workspace-fs.js.map +1 -0
  71. package/dist/code-session/session-metadata.d.ts +40 -0
  72. package/dist/code-session/session-metadata.d.ts.map +1 -0
  73. package/dist/code-session/session-metadata.js +69 -0
  74. package/dist/code-session/session-metadata.js.map +1 -0
  75. package/dist/code-session-relay/agent-code-session-relay.descriptor.d.ts +78 -0
  76. package/dist/code-session-relay/agent-code-session-relay.descriptor.d.ts.map +1 -0
  77. package/dist/code-session-relay/agent-code-session-relay.descriptor.js +38 -0
  78. package/dist/code-session-relay/agent-code-session-relay.descriptor.js.map +1 -0
  79. package/dist/code-session-relay/agent-code-session-relay.impl.d.ts +120 -0
  80. package/dist/code-session-relay/agent-code-session-relay.impl.d.ts.map +1 -0
  81. package/dist/code-session-relay/agent-code-session-relay.impl.js +1392 -0
  82. package/dist/code-session-relay/agent-code-session-relay.impl.js.map +1 -0
  83. package/dist/code-session-relay/agent-code-session-relay.plugin.d.ts +14 -0
  84. package/dist/code-session-relay/agent-code-session-relay.plugin.d.ts.map +1 -0
  85. package/dist/code-session-relay/agent-code-session-relay.plugin.js +25 -0
  86. package/dist/code-session-relay/agent-code-session-relay.plugin.js.map +1 -0
  87. package/dist/code-session-relay/index.d.ts +13 -0
  88. package/dist/code-session-relay/index.d.ts.map +1 -0
  89. package/dist/code-session-relay/index.js +13 -0
  90. package/dist/code-session-relay/index.js.map +1 -0
  91. package/dist/code-session-relay/relay-dial.d.ts +72 -0
  92. package/dist/code-session-relay/relay-dial.d.ts.map +1 -0
  93. package/dist/code-session-relay/relay-dial.js +177 -0
  94. package/dist/code-session-relay/relay-dial.js.map +1 -0
  95. package/dist/index.d.ts +10 -0
  96. package/dist/index.d.ts.map +1 -0
  97. package/dist/index.js +10 -0
  98. package/dist/index.js.map +1 -0
  99. package/dist/sandbox/agent-sandbox.consumer.descriptor.d.ts +35 -0
  100. package/dist/sandbox/agent-sandbox.consumer.descriptor.d.ts.map +1 -0
  101. package/dist/sandbox/agent-sandbox.consumer.descriptor.js +19 -0
  102. package/dist/sandbox/agent-sandbox.consumer.descriptor.js.map +1 -0
  103. package/dist/sandbox/agent-sandbox.consumer.plugin.d.ts +9 -0
  104. package/dist/sandbox/agent-sandbox.consumer.plugin.d.ts.map +1 -0
  105. package/dist/sandbox/agent-sandbox.consumer.plugin.js +33 -0
  106. package/dist/sandbox/agent-sandbox.consumer.plugin.js.map +1 -0
  107. package/dist/sandbox/agent-sandbox.descriptor.d.ts +76 -0
  108. package/dist/sandbox/agent-sandbox.descriptor.d.ts.map +1 -0
  109. package/dist/sandbox/agent-sandbox.descriptor.js +57 -0
  110. package/dist/sandbox/agent-sandbox.descriptor.js.map +1 -0
  111. package/dist/sandbox/agent-sandbox.impl.consumer.d.ts +15 -0
  112. package/dist/sandbox/agent-sandbox.impl.consumer.d.ts.map +1 -0
  113. package/dist/sandbox/agent-sandbox.impl.consumer.js +23 -0
  114. package/dist/sandbox/agent-sandbox.impl.consumer.js.map +1 -0
  115. package/dist/sandbox/agent-sandbox.kind.d.ts +14 -0
  116. package/dist/sandbox/agent-sandbox.kind.d.ts.map +1 -0
  117. package/dist/sandbox/agent-sandbox.kind.js +16 -0
  118. package/dist/sandbox/agent-sandbox.kind.js.map +1 -0
  119. package/dist/sandbox/agent-sandbox.plugin.d.ts +15 -0
  120. package/dist/sandbox/agent-sandbox.plugin.d.ts.map +1 -0
  121. package/dist/sandbox/agent-sandbox.plugin.js +25 -0
  122. package/dist/sandbox/agent-sandbox.plugin.js.map +1 -0
  123. package/dist/sandbox/client/resolve.d.ts +21 -0
  124. package/dist/sandbox/client/resolve.d.ts.map +1 -0
  125. package/dist/sandbox/client/resolve.js +103 -0
  126. package/dist/sandbox/client/resolve.js.map +1 -0
  127. package/dist/sandbox/docs/agent-sandbox.docs.descriptor.d.ts +4 -0
  128. package/dist/sandbox/docs/agent-sandbox.docs.descriptor.d.ts.map +1 -0
  129. package/dist/sandbox/docs/agent-sandbox.docs.descriptor.js +75 -0
  130. package/dist/sandbox/docs/agent-sandbox.docs.descriptor.js.map +1 -0
  131. package/dist/sandbox/index.d.ts +15 -0
  132. package/dist/sandbox/index.d.ts.map +1 -0
  133. package/dist/sandbox/index.js +14 -0
  134. package/dist/sandbox/index.js.map +1 -0
  135. package/dist/sandbox/interfaces/sandbox.d.ts +61 -0
  136. package/dist/sandbox/interfaces/sandbox.d.ts.map +1 -0
  137. package/dist/sandbox/interfaces/sandbox.js +54 -0
  138. package/dist/sandbox/interfaces/sandbox.js.map +1 -0
  139. package/dist/schemas/code-session-resolution.d.ts +20 -0
  140. package/dist/schemas/code-session-resolution.d.ts.map +1 -0
  141. package/dist/schemas/code-session-resolution.js +11 -0
  142. package/dist/schemas/code-session-resolution.js.map +1 -0
  143. package/dist/schemas/session-operation.d.ts +73 -0
  144. package/dist/schemas/session-operation.d.ts.map +1 -0
  145. package/dist/schemas/session-operation.js +47 -0
  146. package/dist/schemas/session-operation.js.map +1 -0
  147. package/dist/schemas/voice.d.ts +87 -0
  148. package/dist/schemas/voice.d.ts.map +1 -0
  149. package/dist/schemas/voice.js +70 -0
  150. package/dist/schemas/voice.js.map +1 -0
  151. package/dist/voice/agent-voice.consumer.descriptor.d.ts +43 -0
  152. package/dist/voice/agent-voice.consumer.descriptor.d.ts.map +1 -0
  153. package/dist/voice/agent-voice.consumer.descriptor.js +20 -0
  154. package/dist/voice/agent-voice.consumer.descriptor.js.map +1 -0
  155. package/dist/voice/agent-voice.consumer.plugin.d.ts +4 -0
  156. package/dist/voice/agent-voice.consumer.plugin.d.ts.map +1 -0
  157. package/dist/voice/agent-voice.consumer.plugin.js +13 -0
  158. package/dist/voice/agent-voice.consumer.plugin.js.map +1 -0
  159. package/dist/voice/agent-voice.descriptor.d.ts +82 -0
  160. package/dist/voice/agent-voice.descriptor.d.ts.map +1 -0
  161. package/dist/voice/agent-voice.descriptor.js +79 -0
  162. package/dist/voice/agent-voice.descriptor.js.map +1 -0
  163. package/dist/voice/agent-voice.impl.consumer.d.ts +35 -0
  164. package/dist/voice/agent-voice.impl.consumer.d.ts.map +1 -0
  165. package/dist/voice/agent-voice.impl.consumer.js +50 -0
  166. package/dist/voice/agent-voice.impl.consumer.js.map +1 -0
  167. package/dist/voice/agent-voice.kind.d.ts +67 -0
  168. package/dist/voice/agent-voice.kind.d.ts.map +1 -0
  169. package/dist/voice/agent-voice.kind.js +26 -0
  170. package/dist/voice/agent-voice.kind.js.map +1 -0
  171. package/dist/voice/agent-voice.plugin.d.ts +4 -0
  172. package/dist/voice/agent-voice.plugin.d.ts.map +1 -0
  173. package/dist/voice/agent-voice.plugin.js +18 -0
  174. package/dist/voice/agent-voice.plugin.js.map +1 -0
  175. package/dist/voice/client.d.ts +38 -0
  176. package/dist/voice/client.d.ts.map +1 -0
  177. package/dist/voice/client.js +29 -0
  178. package/dist/voice/client.js.map +1 -0
  179. package/dist/voice/index.d.ts +14 -0
  180. package/dist/voice/index.d.ts.map +1 -0
  181. package/dist/voice/index.js +14 -0
  182. package/dist/voice/index.js.map +1 -0
  183. package/dist/voice/pipeline.d.ts +66 -0
  184. package/dist/voice/pipeline.d.ts.map +1 -0
  185. package/dist/voice/pipeline.js +330 -0
  186. package/dist/voice/pipeline.js.map +1 -0
  187. package/dist/voice/session.d.ts +29 -0
  188. package/dist/voice/session.d.ts.map +1 -0
  189. package/dist/voice/session.js +78 -0
  190. package/dist/voice/session.js.map +1 -0
  191. package/package.json +279 -4
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Compatibility consumer plugin for agent/sandbox. The production loader and
3
+ * descriptor id remain available; execute refuses before any host operation.
4
+ * Compositions such as devtools still resolve it, then receive a typed
5
+ * non-retryable availability error. No unsafe execution fallback is installed.
6
+ */
7
+ import { createRuntimePlugin, createRuntimeImplementation } from '@vibesdotdev/kernel';
8
+ import consumerSandboxDescriptor from "./agent-sandbox.consumer.descriptor.js";
9
+ export const agentSandboxConsumerPlugin = createRuntimePlugin({
10
+ id: 'agent-sandbox-consumer',
11
+ name: 'Agent Sandbox — consumer availability',
12
+ description: 'Consumer agent/sandbox registration with explicit isolation-unavailable refusal.',
13
+ // The kind is declared by @vibesdotdev/agent-execution/sandbox; require it first.
14
+ dependencies: ['agent-sandbox'],
15
+ descriptors: [consumerSandboxDescriptor],
16
+ async onRegister(runtime) {
17
+ runtime.registerLoader('agent/sandbox', consumerSandboxDescriptor.id, async () => {
18
+ const { ConsumerAgentSandbox } = await import("./agent-sandbox.impl.consumer.js");
19
+ return createRuntimeImplementation({
20
+ kind: 'agent/sandbox',
21
+ id: consumerSandboxDescriptor.id,
22
+ constraint: { hardware: ['consumer'] },
23
+ implementation: class extends ConsumerAgentSandbox {
24
+ constructor(descriptor) {
25
+ super(descriptor, runtime);
26
+ }
27
+ }
28
+ });
29
+ });
30
+ }
31
+ });
32
+ export default agentSandboxConsumerPlugin;
33
+ //# sourceMappingURL=agent-sandbox.consumer.plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-sandbox.consumer.plugin.js","sourceRoot":"","sources":["../../src/sandbox/agent-sandbox.consumer.plugin.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AAEvF,OAAO,yBAAyB,MAAM,wCAAwC,CAAC;AAG/E,MAAM,CAAC,MAAM,0BAA0B,GAAG,mBAAmB,CAAC;IAC7D,EAAE,EAAE,wBAAwB;IAC5B,IAAI,EAAE,uCAAuC;IAC7C,WAAW,EACV,kFAAkF;IACnF,kFAAkF;IAClF,YAAY,EAAE,CAAC,eAAe,CAAC;IAC/B,WAAW,EAAE,CAAC,yBAAyB,CAAC;IAExC,KAAK,CAAC,UAAU,CAAC,OAAmB;QACnC,OAAO,CAAC,cAAc,CAAC,eAAe,EAAE,yBAAyB,CAAC,EAAE,EAAE,KAAK,IAAI,EAAE;YAChF,MAAM,EAAE,oBAAoB,EAAE,GAAG,MAAM,MAAM,CAAC,kCAAkC,CAAC,CAAC;YAClF,OAAO,2BAA2B,CAAC;gBAClC,IAAI,EAAE,eAAe;gBACrB,EAAE,EAAE,yBAAyB,CAAC,EAAE;gBAChC,UAAU,EAAE,EAAE,QAAQ,EAAE,CAAC,UAAU,CAAC,EAAE;gBACtC,cAAc,EAAE,KAAM,SAAQ,oBAAoB;oBACjD,YAAY,UAAkC;wBAC7C,KAAK,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;oBAC5B,CAAC;iBACD;aACD,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACJ,CAAC;CACD,CAAC,CAAC;AAEH,eAAe,0BAA0B,CAAC"}
@@ -0,0 +1,76 @@
1
+ /**
2
+ * Descriptor contract for agent/sandbox. Isolation must be enforced by the
3
+ * selected provider; metadata alone does not enforce filesystem, network,
4
+ * package or resource limits. The consumer registration currently refuses all
5
+ * execution because its former subprocess did not provide model-code isolation.
6
+ */
7
+ import * as z from 'zod/v4';
8
+ /** Surfaces a sandbox can be addressed through (informational, mirrors other kinds). */
9
+ export declare const AgentSandboxSurfaceSchema: z.ZodEnum<{
10
+ agent: "agent";
11
+ worker: "worker";
12
+ direct: "direct";
13
+ }>;
14
+ export type AgentSandboxSurface = z.infer<typeof AgentSandboxSurfaceSchema>;
15
+ /**
16
+ * Trust ladder for a sandbox, aligned with the agent capability-tier values
17
+ * (`'0' | '1' | '2a' | '2b' | '3'`). Providers must enforce their declared policy;
18
+ * the schema itself grants no filesystem or network access.
19
+ */
20
+ export declare const SandboxTrustLevelSchema: z.ZodEnum<{
21
+ 0: "0";
22
+ 1: "1";
23
+ 3: "3";
24
+ "2a": "2a";
25
+ "2b": "2b";
26
+ }>;
27
+ export type SandboxTrustLevel = z.infer<typeof SandboxTrustLevelSchema>;
28
+ export declare const AgentSandboxDescriptorSchema: z.ZodObject<{
29
+ id: z.ZodString;
30
+ description: z.ZodOptional<z.ZodString>;
31
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
32
+ hardware: z.ZodOptional<z.ZodArray<z.ZodString>>;
33
+ enabled: z.ZodOptional<z.ZodBoolean>;
34
+ capabilityId: z.ZodOptional<z.ZodString>;
35
+ requiredContext: z.ZodOptional<z.ZodArray<z.ZodString>>;
36
+ optionalContext: z.ZodOptional<z.ZodArray<z.ZodString>>;
37
+ config: z.ZodOptional<z.ZodUnknown>;
38
+ retention: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
39
+ maxAgeDays: z.ZodOptional<z.ZodNumber>;
40
+ maxEntries: z.ZodOptional<z.ZodNumber>;
41
+ maxBytes: z.ZodOptional<z.ZodNumber>;
42
+ cascadeFrom: z.ZodOptional<z.ZodString>;
43
+ ageField: z.ZodOptional<z.ZodString>;
44
+ reason: z.ZodString;
45
+ enforcedBy: z.ZodOptional<z.ZodString>;
46
+ }, z.core.$strip>]>>;
47
+ kind: z.ZodLiteral<"agent/sandbox">;
48
+ name: z.ZodDefault<z.ZodString>;
49
+ priority: z.ZodDefault<z.ZodNumber>;
50
+ surfaces: z.ZodDefault<z.ZodArray<z.ZodEnum<{
51
+ agent: "agent";
52
+ worker: "worker";
53
+ direct: "direct";
54
+ }>>>;
55
+ timeoutMs: z.ZodDefault<z.ZodNumber>;
56
+ memoryLimit: z.ZodDefault<z.ZodNumber>;
57
+ fileSystemAllowed: z.ZodDefault<z.ZodBoolean>;
58
+ npmPackages: z.ZodDefault<z.ZodArray<z.ZodString>>;
59
+ trustLevel: z.ZodDefault<z.ZodEnum<{
60
+ 0: "0";
61
+ 1: "1";
62
+ 3: "3";
63
+ "2a": "2a";
64
+ "2b": "2b";
65
+ }>>;
66
+ }, z.core.$strip>;
67
+ export type AgentSandboxDescriptor = z.infer<typeof AgentSandboxDescriptorSchema>;
68
+ /**
69
+ * Author an `agent/sandbox` descriptor without restating the `kind`. Mirrors
70
+ * `createAIGenerationOutputStoreDescriptor`.
71
+ */
72
+ export declare function createAgentSandboxDescriptor(options: Omit<Partial<AgentSandboxDescriptor>, 'kind'> & {
73
+ id: string;
74
+ }): AgentSandboxDescriptor;
75
+ export default AgentSandboxDescriptorSchema;
76
+ //# sourceMappingURL=agent-sandbox.descriptor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-sandbox.descriptor.d.ts","sourceRoot":"","sources":["../../src/sandbox/agent-sandbox.descriptor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,wFAAwF;AACxF,eAAO,MAAM,yBAAyB;;;;EAAwC,CAAC;AAC/E,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E;;;;GAIG;AACH,eAAO,MAAM,uBAAuB;;;;;;EAAsC,CAAC;AAC3E,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA4BvC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAElF;;;GAGG;AACH,wBAAgB,4BAA4B,CAC3C,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,EAAE,MAAM,CAAC,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,GACrE,sBAAsB,CAKxB;AAED,eAAe,4BAA4B,CAAC"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Descriptor contract for agent/sandbox. Isolation must be enforced by the
3
+ * selected provider; metadata alone does not enforce filesystem, network,
4
+ * package or resource limits. The consumer registration currently refuses all
5
+ * execution because its former subprocess did not provide model-code isolation.
6
+ */
7
+ import * as z from 'zod/v4';
8
+ import { RuntimeDescriptorSchema } from '@vibesdotdev/kernel/schemas/descriptor';
9
+ /** Surfaces a sandbox can be addressed through (informational, mirrors other kinds). */
10
+ export const AgentSandboxSurfaceSchema = z.enum(['agent', 'worker', 'direct']);
11
+ /**
12
+ * Trust ladder for a sandbox, aligned with the agent capability-tier values
13
+ * (`'0' | '1' | '2a' | '2b' | '3'`). Providers must enforce their declared policy;
14
+ * the schema itself grants no filesystem or network access.
15
+ */
16
+ export const SandboxTrustLevelSchema = z.enum(['0', '1', '2a', '2b', '3']);
17
+ export const AgentSandboxDescriptorSchema = RuntimeDescriptorSchema.extend({
18
+ kind: z.literal('agent/sandbox'),
19
+ /** Human label for selectors/logs. */
20
+ name: z.string().default('Agent Sandbox'),
21
+ /**
22
+ * Selection priority when multiple sandbox impls match the scope. Higher
23
+ * wins; consumer defaults to 100, cloud adapters use 110 (disjoint
24
+ * hardware, so priority is only a defensive tie-breaker).
25
+ */
26
+ priority: z.number().int().default(100),
27
+ /** Surfaces this sandbox can be reached through. */
28
+ surfaces: z.array(AgentSandboxSurfaceSchema).default(['agent', 'worker', 'direct']),
29
+ /** Wall-clock budget for a single execution before the process is aborted. */
30
+ timeoutMs: z.number().int().positive().default(30_000),
31
+ /**
32
+ * Requested memory ceiling in megabytes. Enforcement requires provider-specific
33
+ * evidence; the consumer registration does not execute.
34
+ */
35
+ memoryLimit: z.number().int().positive().default(256),
36
+ /**
37
+ * Whether a writable scratch filesystem is permitted inside the workspace.
38
+ * The selected provider must enforce this permission before executing code.
39
+ */
40
+ fileSystemAllowed: z.boolean().default(false),
41
+ /** npm packages the sandbox is allowed to install/import (allowlist; empty = none). */
42
+ npmPackages: z.array(z.string()).default([]),
43
+ /** Declared trust ceiling; the selected provider must enforce its restrictions. */
44
+ trustLevel: SandboxTrustLevelSchema.default('1')
45
+ });
46
+ /**
47
+ * Author an `agent/sandbox` descriptor without restating the `kind`. Mirrors
48
+ * `createAIGenerationOutputStoreDescriptor`.
49
+ */
50
+ export function createAgentSandboxDescriptor(options) {
51
+ return AgentSandboxDescriptorSchema.parse({
52
+ ...options,
53
+ kind: 'agent/sandbox'
54
+ });
55
+ }
56
+ export default AgentSandboxDescriptorSchema;
57
+ //# sourceMappingURL=agent-sandbox.descriptor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-sandbox.descriptor.js","sourceRoot":"","sources":["../../src/sandbox/agent-sandbox.descriptor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AAEjF,wFAAwF;AACxF,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC;AAG/E;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC;AAG3E,MAAM,CAAC,MAAM,4BAA4B,GAAG,uBAAuB,CAAC,MAAM,CAAC;IAC1E,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC;IAChC,sCAAsC;IACtC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,eAAe,CAAC;IACzC;;;;OAIG;IACH,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC;IACvC,oDAAoD;IACpD,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACnF,8EAA8E;IAC9E,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC;IACtD;;;OAGG;IACH,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC;IACrD;;;OAGG;IACH,iBAAiB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;IAC7C,uFAAuF;IACvF,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IAC5C,mFAAmF;IACnF,UAAU,EAAE,uBAAuB,CAAC,OAAO,CAAC,GAAG,CAAC;CAChD,CAAC,CAAC;AAIH;;;GAGG;AACH,MAAM,UAAU,4BAA4B,CAC3C,OAAuE;IAEvE,OAAO,4BAA4B,CAAC,KAAK,CAAC;QACzC,GAAG,OAAO;QACV,IAAI,EAAE,eAAe;KACrB,CAAC,CAAC;AACJ,CAAC;AAED,eAAe,4BAA4B,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Consumer registration retained for compatibility; execution fails closed.
3
+ * A temporary directory and stripped environment do not isolate model code.
4
+ * Cooperative restricted test execution is not a substitute for that boundary.
5
+ */
6
+ import { type RuntimeRef } from '@vibesdotdev/kernel';
7
+ import type { AgentSandboxDescriptor } from './agent-sandbox.descriptor.ts';
8
+ import type { AgentSandboxInterface, SandboxExecuteResult } from './interfaces/sandbox.ts';
9
+ export declare class ConsumerAgentSandbox implements AgentSandboxInterface {
10
+ readonly descriptor: AgentSandboxDescriptor;
11
+ constructor(descriptor: AgentSandboxDescriptor, _runtime: RuntimeRef);
12
+ execute<TInput>(input: TInput): Promise<SandboxExecuteResult>;
13
+ }
14
+ export default ConsumerAgentSandbox;
15
+ //# sourceMappingURL=agent-sandbox.impl.consumer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-sandbox.impl.consumer.d.ts","sourceRoot":"","sources":["../../src/sandbox/agent-sandbox.impl.consumer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAmB,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,KAAK,EACX,qBAAqB,EACrB,oBAAoB,EACpB,MAAM,yBAAyB,CAAC;AAGjC,qBAAa,oBAAqB,YAAW,qBAAqB;IAEhE,QAAQ,CAAC,UAAU,EAAE,sBAAsB;gBAAlC,UAAU,EAAE,sBAAsB,EAC3C,QAAQ,EAAE,UAAU;IAGf,OAAO,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;CAQnE;AAED,eAAe,oBAAoB,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Consumer registration retained for compatibility; execution fails closed.
3
+ * A temporary directory and stripped environment do not isolate model code.
4
+ * Cooperative restricted test execution is not a substitute for that boundary.
5
+ */
6
+ import { CapabilityError } from '@vibesdotdev/kernel';
7
+ import { parseSandboxExecuteInput } from "./interfaces/sandbox.js";
8
+ export class ConsumerAgentSandbox {
9
+ descriptor;
10
+ constructor(descriptor, _runtime) {
11
+ this.descriptor = descriptor;
12
+ }
13
+ async execute(input) {
14
+ parseSandboxExecuteInput(input);
15
+ throw new CapabilityError('Consumer agent sandbox isolation is unavailable.', 'UNAVAILABLE', {
16
+ reason: 'agent-sandbox-isolation-unavailable',
17
+ retryable: false,
18
+ recoveryHint: 'Compose an agent/sandbox provider verified for model-generated code isolation. The separate run-command tool provides ordinary execution with approval and owner-bound session rules; it is not an isolation fallback. The cooperative test runner does not provide model-code isolation.'
19
+ });
20
+ }
21
+ }
22
+ export default ConsumerAgentSandbox;
23
+ //# sourceMappingURL=agent-sandbox.impl.consumer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-sandbox.impl.consumer.js","sourceRoot":"","sources":["../../src/sandbox/agent-sandbox.impl.consumer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,eAAe,EAAmB,MAAM,qBAAqB,CAAC;AAMvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,MAAM,OAAO,oBAAoB;IAEtB;IADV,YACU,UAAkC,EAC3C,QAAoB;QADX,eAAU,GAAV,UAAU,CAAwB;IAEzC,CAAC;IAEJ,KAAK,CAAC,OAAO,CAAS,KAAa;QAClC,wBAAwB,CAAC,KAAK,CAAC,CAAC;QAChC,MAAM,IAAI,eAAe,CAAC,kDAAkD,EAAE,aAAa,EAAE;YAC5F,MAAM,EAAE,qCAAqC;YAC7C,SAAS,EAAE,KAAK;YAChB,YAAY,EAAE,2RAA2R;SACzS,CAAC,CAAC;IACJ,CAAC;CACD;AAED,eAAe,oBAAoB,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * `agent/sandbox` runtime kind.
3
+ *
4
+ * Registers the descriptor schema so the runtime can validate `agent/sandbox`
5
+ * descriptors and feature code can `runtime.query('agent/sandbox')` without a
6
+ * "Kind not registered" error. Impl plugins (consumer availability refusal, cloud
7
+ * provider-owned sandbox adapter) register loaders against this kind id.
8
+ */
9
+ import type { RuntimeKindDescriptor, KindContext } from '@vibesdotdev/kernel/schemas/kind';
10
+ import { type AgentSandboxDescriptor } from './agent-sandbox.descriptor.ts';
11
+ import type { AgentSandboxInterface } from './interfaces/sandbox.ts';
12
+ export declare const agentSandboxKind: RuntimeKindDescriptor<AgentSandboxDescriptor, AgentSandboxInterface, KindContext>;
13
+ export default agentSandboxKind;
14
+ //# sourceMappingURL=agent-sandbox.kind.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-sandbox.kind.d.ts","sourceRoot":"","sources":["../../src/sandbox/agent-sandbox.kind.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACX,qBAAqB,EACrB,WAAW,EACX,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAEN,KAAK,sBAAsB,EAC3B,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAErE,eAAO,MAAM,gBAAgB,EAAE,qBAAqB,CACnD,sBAAsB,EACtB,qBAAqB,EACrB,WAAW,CAKX,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * `agent/sandbox` runtime kind.
3
+ *
4
+ * Registers the descriptor schema so the runtime can validate `agent/sandbox`
5
+ * descriptors and feature code can `runtime.query('agent/sandbox')` without a
6
+ * "Kind not registered" error. Impl plugins (consumer availability refusal, cloud
7
+ * provider-owned sandbox adapter) register loaders against this kind id.
8
+ */
9
+ import { AgentSandboxDescriptorSchema } from "./agent-sandbox.descriptor.js";
10
+ export const agentSandboxKind = {
11
+ id: 'agent/sandbox',
12
+ descriptorSchema: AgentSandboxDescriptorSchema,
13
+ contexts: []
14
+ };
15
+ export default agentSandboxKind;
16
+ //# sourceMappingURL=agent-sandbox.kind.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-sandbox.kind.js","sourceRoot":"","sources":["../../src/sandbox/agent-sandbox.kind.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,OAAO,EACN,4BAA4B,EAE5B,MAAM,+BAA+B,CAAC;AAGvC,MAAM,CAAC,MAAM,gBAAgB,GAIzB;IACH,EAAE,EAAE,eAAe;IACnB,gBAAgB,EAAE,4BAA4B;IAC9C,QAAQ,EAAE,EAAE;CACZ,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Agent Sandbox — runtime plugin (kind + docs only)
3
+ *
4
+ * Declares the `agent/sandbox` kind so cloud and consumer surfaces can resolve
5
+ * it. The IMPLEMENTATIONS live in disjoint, scope-gated sibling plugins that the
6
+ * owning scope's vibes.config imports:
7
+ * - consumer (availability refusal): `@vibesdotdev/agent-execution/sandbox/consumer.plugin`
8
+ * - cloud: provider-owned Integrations plugin
9
+ *
10
+ * Keeping the consumer loader out of THIS plugin means cloud apps can load it to
11
+ * declare the kind independently of any implementation.
12
+ */
13
+ export declare const agentSandboxPlugin: import("@vibesdotdev/kernel").RuntimePlugin;
14
+ export default agentSandboxPlugin;
15
+ //# sourceMappingURL=agent-sandbox.plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-sandbox.plugin.d.ts","sourceRoot":"","sources":["../../src/sandbox/agent-sandbox.plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAMH,eAAO,MAAM,kBAAkB,6CAQ7B,CAAC;AAEH,eAAe,kBAAkB,CAAC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Agent Sandbox — runtime plugin (kind + docs only)
3
+ *
4
+ * Declares the `agent/sandbox` kind so cloud and consumer surfaces can resolve
5
+ * it. The IMPLEMENTATIONS live in disjoint, scope-gated sibling plugins that the
6
+ * owning scope's vibes.config imports:
7
+ * - consumer (availability refusal): `@vibesdotdev/agent-execution/sandbox/consumer.plugin`
8
+ * - cloud: provider-owned Integrations plugin
9
+ *
10
+ * Keeping the consumer loader out of THIS plugin means cloud apps can load it to
11
+ * declare the kind independently of any implementation.
12
+ */
13
+ import { createRuntimePlugin } from '@vibesdotdev/kernel';
14
+ import { agentSandboxKind } from "./agent-sandbox.kind.js";
15
+ import agentSandboxDocsDescriptor from "./docs/agent-sandbox.docs.descriptor.js";
16
+ export const agentSandboxPlugin = createRuntimePlugin({
17
+ id: 'agent-sandbox',
18
+ name: 'Agent Sandbox',
19
+ description: 'Declares the agent/sandbox kind. Implementations ship in the consumer plugin and provider-owned Integrations plugins.',
20
+ dependencies: [],
21
+ kinds: [agentSandboxKind],
22
+ descriptors: [agentSandboxDocsDescriptor]
23
+ });
24
+ export default agentSandboxPlugin;
25
+ //# sourceMappingURL=agent-sandbox.plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-sandbox.plugin.js","sourceRoot":"","sources":["../../src/sandbox/agent-sandbox.plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,0BAA0B,MAAM,yCAAyC,CAAC;AAEjF,MAAM,CAAC,MAAM,kBAAkB,GAAG,mBAAmB,CAAC;IACrD,EAAE,EAAE,eAAe;IACnB,IAAI,EAAE,eAAe;IACrB,WAAW,EACV,uHAAuH;IACxH,YAAY,EAAE,EAAE;IAChB,KAAK,EAAE,CAAC,gBAAgB,CAAC;IACzB,WAAW,EAAE,CAAC,0BAA0B,CAAC;CACzC,CAAC,CAAC;AAEH,eAAe,kBAAkB,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Agent Sandbox Resolver
3
+ *
4
+ * Scope-aware resolution for `agent/sandbox` impls. Mirrors
5
+ * `resolveAIGenerationOutputStore`:
6
+ * 1. Honour an explicit sandbox id if passed.
7
+ * 2. Filter to enabled descriptors, sort by `priority` (desc).
8
+ * 3. Resolve the first the runtime can construct in the current scope — the
9
+ * hardware-aware loader chain handles the consumer/cloud split, so the
10
+ * cloud adapter cleanly throws "not configured" and we never see it on
11
+ * consumer hardware.
12
+ */
13
+ import * as z from 'zod/v4';
14
+ import { type RuntimeRef } from '@vibesdotdev/kernel';
15
+ import type { AgentSandboxInterface } from '../interfaces/sandbox.ts';
16
+ export declare const ResolveAgentSandboxOptionsSchema: z.ZodObject<{
17
+ explicitId: z.ZodOptional<z.ZodString>;
18
+ }, z.core.$strict>;
19
+ export type ResolveAgentSandboxOptions = z.infer<typeof ResolveAgentSandboxOptionsSchema>;
20
+ export declare function resolveAgentSandbox(runtime: RuntimeRef, options?: ResolveAgentSandboxOptions): Promise<AgentSandboxInterface>;
21
+ //# sourceMappingURL=resolve.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../../src/sandbox/client/resolve.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAIN,KAAK,UAAU,EACf,MAAM,qBAAqB,CAAC;AAK7B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEtE,eAAO,MAAM,gCAAgC;;kBAKnC,CAAC;AAEX,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAoB1F,wBAAsB,mBAAmB,CACxC,OAAO,EAAE,UAAU,EACnB,OAAO,GAAE,0BAA+B,GACtC,OAAO,CAAC,qBAAqB,CAAC,CA2EhC"}
@@ -0,0 +1,103 @@
1
+ /**
2
+ * Agent Sandbox Resolver
3
+ *
4
+ * Scope-aware resolution for `agent/sandbox` impls. Mirrors
5
+ * `resolveAIGenerationOutputStore`:
6
+ * 1. Honour an explicit sandbox id if passed.
7
+ * 2. Filter to enabled descriptors, sort by `priority` (desc).
8
+ * 3. Resolve the first the runtime can construct in the current scope — the
9
+ * hardware-aware loader chain handles the consumer/cloud split, so the
10
+ * cloud adapter cleanly throws "not configured" and we never see it on
11
+ * consumer hardware.
12
+ */
13
+ import * as z from 'zod/v4';
14
+ import { CapabilityError, CaughtFailureSchema, valueFreeFailure } from '@vibesdotdev/kernel';
15
+ import { AgentSandboxDescriptorSchema } from "../agent-sandbox.descriptor.js";
16
+ export const ResolveAgentSandboxOptionsSchema = z
17
+ .object({
18
+ /** Explicit sandbox id (overrides scope-aware selection). */
19
+ explicitId: z.string().trim().min(1).max(256).optional()
20
+ })
21
+ .strict();
22
+ function invalidRequest(caught) {
23
+ return new CapabilityError('The sandbox resolution request is invalid.', 'INVALID_INPUT', {
24
+ reason: 'agent-sandbox-request-invalid',
25
+ retryable: false,
26
+ details: { field: 'options' },
27
+ cause: valueFreeFailure(CaughtFailureSchema.parse(caught))
28
+ });
29
+ }
30
+ function invalidDescriptor(caught, candidateCount) {
31
+ return new CapabilityError('A registered sandbox descriptor is invalid.', 'UNAVAILABLE', {
32
+ reason: 'agent-sandbox-unresolvable',
33
+ retryable: false,
34
+ details: { candidateCount, malformedCount: 1, skippedCount: 0 },
35
+ cause: valueFreeFailure(CaughtFailureSchema.parse(caught))
36
+ });
37
+ }
38
+ export async function resolveAgentSandbox(runtime, options = {}) {
39
+ let admitted;
40
+ try {
41
+ admitted = ResolveAgentSandboxOptionsSchema.safeParse(options);
42
+ }
43
+ catch (caught) {
44
+ throw invalidRequest(caught);
45
+ }
46
+ if (!admitted.success) {
47
+ throw invalidRequest(admitted.error);
48
+ }
49
+ const { explicitId } = admitted.data;
50
+ if (explicitId) {
51
+ return runtime
52
+ .query('agent/sandbox')
53
+ .withId(explicitId)
54
+ .resolve();
55
+ }
56
+ const query = runtime.query('agent/sandbox');
57
+ const descriptors = query.descriptors();
58
+ const admittedDescriptors = descriptors.map((descriptor) => {
59
+ try {
60
+ return AgentSandboxDescriptorSchema.parse(descriptor);
61
+ }
62
+ catch (caught) {
63
+ throw invalidDescriptor(caught, descriptors.length);
64
+ }
65
+ });
66
+ const matching = admittedDescriptors
67
+ .filter((descriptor) => descriptor.enabled !== false)
68
+ .sort((a, b) => (b.priority ?? 100) - (a.priority ?? 100));
69
+ if (matching.length === 0) {
70
+ throw new CapabilityError('[agent/sandbox] No enabled sandbox is registered. Compose an agent/sandbox provider verified for model-code isolation; ' +
71
+ 'the consumer registration refuses execution.', 'UNAVAILABLE', {
72
+ reason: 'agent-sandbox-not-registered',
73
+ retryable: false
74
+ });
75
+ }
76
+ let skippedCount = 0;
77
+ for (const candidate of matching) {
78
+ try {
79
+ // Fresh query per candidate to avoid id-intersection issues
80
+ return await runtime
81
+ .query('agent/sandbox')
82
+ .withId(candidate.id)
83
+ .resolve();
84
+ }
85
+ catch (caught) {
86
+ const failure = CaughtFailureSchema.parse(caught);
87
+ // Only the exact candidate's confirmed absence permits fallback. An
88
+ // unavailable registered provider is a present failure and propagates.
89
+ if (CapabilityError.isAbsenceOf(failure, 'agent/sandbox', candidate.id)) {
90
+ skippedCount += 1;
91
+ continue;
92
+ }
93
+ // Any other error is rethrown immediately
94
+ throw CapabilityError.from(failure);
95
+ }
96
+ }
97
+ throw new CapabilityError('No registered sandbox implementation can serve this runtime scope.', 'UNAVAILABLE', {
98
+ reason: 'agent-sandbox-unresolvable',
99
+ retryable: false,
100
+ details: { candidateCount: matching.length, skippedCount }
101
+ });
102
+ }
103
+ //# sourceMappingURL=resolve.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../../src/sandbox/client/resolve.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,4 @@
1
+ import type { DocsTopicDescriptor } from '@vibesdotdev/docs-contracts';
2
+ declare const descriptor: DocsTopicDescriptor;
3
+ export default descriptor;
4
+ //# sourceMappingURL=agent-sandbox.docs.descriptor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-sandbox.docs.descriptor.d.ts","sourceRoot":"","sources":["../../../src/sandbox/docs/agent-sandbox.docs.descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AA8CvE,QAAA,MAAM,UAAU,EAAE,mBA8BjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,75 @@
1
+ /**
2
+ * Docs/topic descriptor for @vibesdotdev/agent-execution/sandbox (Rule 11).
3
+ * Registered by `agentSandboxPlugin` so `vibes docs list | grep agent.sandbox`
4
+ * returns this topic.
5
+ */
6
+ const agentSandboxMarkdown = `---
7
+ title: Agent Sandbox
8
+ summary: Runtime-selected model-code execution and explicit consumer availability refusal
9
+ tags: [agent, sandbox, code-execution, runtime, security]
10
+ parent: agents
11
+ order: 10
12
+ surfaces: [cli, web, in-app, mcp]
13
+ hardware: [consumer, cloud]
14
+ ---
15
+
16
+ # Agent Sandbox
17
+
18
+ The \`agent/sandbox\` kind describes one-shot model-code execution. A selected provider must enforce its isolation claims; temporary directories, replacement environment and trust metadata alone do not do so.
19
+
20
+ ## Consumer availability
21
+
22
+ The \`agent-sandbox-bun\` descriptor remains registered by \`@vibesdotdev/agent-execution/sandbox/consumer.plugin\`. Its execute method refuses every request with \`UNAVAILABLE\`, reason \`agent-sandbox-isolation-unavailable\`, and \`retryable: false\`, before filesystem or execution-provider access. Every trust level, language and filesystem override receives the same refusal.
23
+
24
+ Devtools automatically composes this plugin, so its consumer sandbox calls receive this availability error. There is no ordinary-execution fallback or trusted-mode bypass. The cooperative restricted test runner is not a boundary for hostile model snippets.
25
+
26
+ The existing Agents \`run-command\` tool provides ordinary command execution with its approval requirement and owner-bound session rules. It is a separate authorized operation, never an automatic fallback after sandbox refusal or a guarantee of model-code isolation.
27
+
28
+ ## Provider composition
29
+
30
+ The universal \`@vibesdotdev/agent-execution/sandbox/plugin\` declares the kind and docs only. Compose a provider verified for the required model-code boundary, then resolve it through the runtime. Provider-owned cloud implementations retain their own contracts; these docs do not certify them.
31
+
32
+ The public input/result interfaces, descriptor exports, kind and consumer plugin id remain available. A refusal is an error, not a successful result with empty output.
33
+
34
+ The \`sandbox-execute\` tool and its agent-loop integration are owned by \`@vibesdotdev/agents\`. This package owns the kind, interface and consumer refusal.
35
+
36
+ ## Related
37
+
38
+ :::card{title="See also"}
39
+ - [\`agent.code-session\`](agent.code-session) — persistent repository sessions.
40
+ - [\`agents\`](agents) — owns the sandbox-execute tool and agent loop.
41
+ :::
42
+
43
+ `;
44
+ const descriptor = {
45
+ kind: 'docs/topic',
46
+ id: 'agent.sandbox',
47
+ title: 'Agent Sandbox',
48
+ summary: 'Runtime-selected model-code execution and explicit consumer availability refusal',
49
+ body: {
50
+ type: 'markdown',
51
+ sourceType: 'raw',
52
+ source: agentSandboxMarkdown
53
+ },
54
+ parent: 'agents',
55
+ order: 10,
56
+ tags: ['agent', 'sandbox', 'code-execution', 'runtime', 'security'],
57
+ surfaces: ['cli', 'web', 'in-app', 'mcp'],
58
+ hardware: ['consumer', 'cloud'],
59
+ enabled: true,
60
+ man: {
61
+ name: 'agent.sandbox — model-code execution availability',
62
+ section: 1,
63
+ synopsis: 'vibes man agent.sandbox',
64
+ options: [],
65
+ examples: [
66
+ {
67
+ description: 'Resolve a provider; the consumer registration refuses execution',
68
+ command: "const sandbox = await resolveAgentSandbox(runtime); await sandbox.execute({ language: 'typescript', code: 'console.log(1)' })"
69
+ }
70
+ ],
71
+ seeAlso: ['agent.code-session', 'agents']
72
+ }
73
+ };
74
+ export default descriptor;
75
+ //# sourceMappingURL=agent-sandbox.docs.descriptor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-sandbox.docs.descriptor.js","sourceRoot":"","sources":["../../../src/sandbox/docs/agent-sandbox.docs.descriptor.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,oBAAoB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqC5B,CAAC;AAEF,MAAM,UAAU,GAAwB;IACvC,IAAI,EAAE,YAAY;IAClB,EAAE,EAAE,eAAe;IACnB,KAAK,EAAE,eAAe;IACtB,OAAO,EAAE,kFAAkF;IAC3F,IAAI,EAAE;QACL,IAAI,EAAE,UAAU;QAChB,UAAU,EAAE,KAAK;QACjB,MAAM,EAAE,oBAAoB;KAC5B;IACD,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,EAAE;IACT,IAAI,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,SAAS,EAAE,UAAU,CAAC;IACnE,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,CAAC;IACzC,QAAQ,EAAE,CAAC,UAAU,EAAE,OAAO,CAAC;IAC/B,OAAO,EAAE,IAAI;IACb,GAAG,EAAE;QACJ,IAAI,EAAE,mDAAmD;QACzD,OAAO,EAAE,CAAC;QACV,QAAQ,EAAE,yBAAyB;QACnC,OAAO,EAAE,EAAE;QACX,QAAQ,EAAE;YACT;gBACC,WAAW,EAAE,iEAAiE;gBAC9E,OAAO,EACN,+HAA+H;aAChI;SACD;QACD,OAAO,EAAE,CAAC,oBAAoB,EAAE,QAAQ,CAAC;KACzC;CACD,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @vibesdotdev/agent-execution/sandbox
3
+ *
4
+ * The `agent/sandbox` runtime kind + its consumer availability-refusal impl, the
5
+ * scope-aware resolver, and the execution interface/types. The cloud impl
6
+ * lives in its provider-owned Integrations package.
7
+ */
8
+ export { AgentSandboxDescriptorSchema, SandboxTrustLevelSchema, AgentSandboxSurfaceSchema, createAgentSandboxDescriptor, type AgentSandboxDescriptor, type SandboxTrustLevel, type AgentSandboxSurface } from './agent-sandbox.descriptor.ts';
9
+ export { agentSandboxKind } from './agent-sandbox.kind.ts';
10
+ export { default as consumerSandboxDescriptor } from './agent-sandbox.consumer.descriptor.ts';
11
+ export { agentSandboxPlugin, default } from './agent-sandbox.plugin.ts';
12
+ export { resolveAgentSandbox, type ResolveAgentSandboxOptions } from './client/resolve.ts';
13
+ export { SandboxLanguageSchema, SandboxEgressInputSchema, SandboxExecuteInputSchema, SandboxExecuteResultSchema, parseSandboxExecuteInput } from './interfaces/sandbox.ts';
14
+ export type { AgentSandboxInterface, SandboxExecuteInput, SandboxEgressInput, SandboxExecuteResult, SandboxLanguage } from './interfaces/sandbox.ts';
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sandbox/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACN,4BAA4B,EAC5B,uBAAuB,EACvB,yBAAyB,EACzB,4BAA4B,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,wCAAwC,CAAC;AAC9F,OAAO,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,KAAK,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AAE3F,OAAO,EACN,qBAAqB,EACrB,wBAAwB,EACxB,yBAAyB,EACzB,0BAA0B,EAC1B,wBAAwB,EACxB,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACX,qBAAqB,EACrB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,eAAe,EACf,MAAM,yBAAyB,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @vibesdotdev/agent-execution/sandbox
3
+ *
4
+ * The `agent/sandbox` runtime kind + its consumer availability-refusal impl, the
5
+ * scope-aware resolver, and the execution interface/types. The cloud impl
6
+ * lives in its provider-owned Integrations package.
7
+ */
8
+ export { AgentSandboxDescriptorSchema, SandboxTrustLevelSchema, AgentSandboxSurfaceSchema, createAgentSandboxDescriptor } from "./agent-sandbox.descriptor.js";
9
+ export { agentSandboxKind } from "./agent-sandbox.kind.js";
10
+ export { default as consumerSandboxDescriptor } from "./agent-sandbox.consumer.descriptor.js";
11
+ export { agentSandboxPlugin, default } from "./agent-sandbox.plugin.js";
12
+ export { resolveAgentSandbox } from "./client/resolve.js";
13
+ export { SandboxLanguageSchema, SandboxEgressInputSchema, SandboxExecuteInputSchema, SandboxExecuteResultSchema, parseSandboxExecuteInput } from "./interfaces/sandbox.js";
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sandbox/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACN,4BAA4B,EAC5B,uBAAuB,EACvB,yBAAyB,EACzB,4BAA4B,EAI5B,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,wCAAwC,CAAC;AAC9F,OAAO,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAmC,MAAM,qBAAqB,CAAC;AAE3F,OAAO,EACN,qBAAqB,EACrB,wBAAwB,EACxB,yBAAyB,EACzB,0BAA0B,EAC1B,wBAAwB,EACxB,MAAM,yBAAyB,CAAC"}