@geminixiang/mikan 1.0.0-beta.22 → 1.0.0-beta.24

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 (183) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/README.md +12 -8
  3. package/dist/adapters/discord/bot.d.ts.map +1 -1
  4. package/dist/adapters/discord/bot.js +13 -14
  5. package/dist/adapters/discord/bot.js.map +1 -1
  6. package/dist/agent.d.ts.map +1 -1
  7. package/dist/agent.js +8 -9
  8. package/dist/agent.js.map +1 -1
  9. package/dist/cli/boot.d.ts +1 -1
  10. package/dist/cli/boot.d.ts.map +1 -1
  11. package/dist/cli/boot.js +7 -15
  12. package/dist/cli/boot.js.map +1 -1
  13. package/dist/commands/sandbox.d.ts.map +1 -1
  14. package/dist/commands/sandbox.js +2 -5
  15. package/dist/commands/sandbox.js.map +1 -1
  16. package/dist/commands/text.js +1 -1
  17. package/dist/commands/text.js.map +1 -1
  18. package/dist/config.d.ts.map +1 -1
  19. package/dist/config.js +12 -39
  20. package/dist/config.js.map +1 -1
  21. package/dist/execution-resolver.d.ts +1 -2
  22. package/dist/execution-resolver.d.ts.map +1 -1
  23. package/dist/execution-resolver.js +4 -7
  24. package/dist/execution-resolver.js.map +1 -1
  25. package/dist/harness/runner.d.ts +5 -6
  26. package/dist/harness/runner.d.ts.map +1 -1
  27. package/dist/harness/runner.js +26 -18
  28. package/dist/harness/runner.js.map +1 -1
  29. package/dist/harness/subagent-runner.d.ts.map +1 -1
  30. package/dist/harness/subagent-runner.js +13 -7
  31. package/dist/harness/subagent-runner.js.map +1 -1
  32. package/dist/harness/types.d.ts +7 -4
  33. package/dist/harness/types.d.ts.map +1 -1
  34. package/dist/harness/types.js.map +1 -1
  35. package/dist/harness/usage.d.ts +6 -0
  36. package/dist/harness/usage.d.ts.map +1 -0
  37. package/dist/harness/usage.js +32 -0
  38. package/dist/harness/usage.js.map +1 -0
  39. package/dist/index.d.ts +3 -2
  40. package/dist/index.d.ts.map +1 -1
  41. package/dist/index.js +1 -1
  42. package/dist/index.js.map +1 -1
  43. package/dist/main.js +19 -87
  44. package/dist/main.js.map +1 -1
  45. package/dist/sandbox/agent-sandbox.d.ts +18 -0
  46. package/dist/sandbox/agent-sandbox.d.ts.map +1 -0
  47. package/dist/sandbox/agent-sandbox.js +234 -0
  48. package/dist/sandbox/agent-sandbox.js.map +1 -0
  49. package/dist/sandbox/index.d.ts +6 -7
  50. package/dist/sandbox/index.d.ts.map +1 -1
  51. package/dist/sandbox/index.js +7 -9
  52. package/dist/sandbox/index.js.map +1 -1
  53. package/dist/sandbox/types.d.ts +12 -16
  54. package/dist/sandbox/types.d.ts.map +1 -1
  55. package/dist/sandbox/types.js.map +1 -1
  56. package/dist/tools/sandbox.d.ts.map +1 -1
  57. package/dist/tools/sandbox.js +2 -3
  58. package/dist/tools/sandbox.js.map +1 -1
  59. package/dist/types.d.ts +7 -63
  60. package/dist/types.d.ts.map +1 -1
  61. package/dist/types.js.map +1 -1
  62. package/dist/vault/policy.d.ts +3 -3
  63. package/dist/vault/policy.d.ts.map +1 -1
  64. package/dist/vault/policy.js +6 -4
  65. package/dist/vault/policy.js.map +1 -1
  66. package/node_modules/agentic-sandbox-client/dist/commands/command-executor.d.ts +13 -0
  67. package/node_modules/agentic-sandbox-client/dist/commands/command-executor.d.ts.map +1 -0
  68. package/node_modules/agentic-sandbox-client/dist/commands/command-executor.js +88 -0
  69. package/node_modules/agentic-sandbox-client/dist/commands/command-executor.js.map +1 -0
  70. package/node_modules/agentic-sandbox-client/dist/commands/index.d.ts +2 -0
  71. package/node_modules/agentic-sandbox-client/dist/commands/index.d.ts.map +1 -0
  72. package/node_modules/agentic-sandbox-client/dist/commands/index.js +15 -0
  73. package/node_modules/agentic-sandbox-client/dist/commands/index.js.map +1 -0
  74. package/node_modules/agentic-sandbox-client/dist/constants.d.ts +28 -0
  75. package/node_modules/agentic-sandbox-client/dist/constants.d.ts.map +1 -0
  76. package/node_modules/agentic-sandbox-client/dist/constants.js +65 -0
  77. package/node_modules/agentic-sandbox-client/dist/constants.js.map +1 -0
  78. package/node_modules/agentic-sandbox-client/dist/exceptions.d.ts +67 -0
  79. package/node_modules/agentic-sandbox-client/dist/exceptions.d.ts.map +1 -0
  80. package/node_modules/agentic-sandbox-client/dist/exceptions.js +91 -0
  81. package/node_modules/agentic-sandbox-client/dist/exceptions.js.map +1 -0
  82. package/node_modules/agentic-sandbox-client/dist/extensions/computer-use.d.ts +18 -0
  83. package/node_modules/agentic-sandbox-client/dist/extensions/computer-use.d.ts.map +1 -0
  84. package/node_modules/agentic-sandbox-client/dist/extensions/computer-use.js +61 -0
  85. package/node_modules/agentic-sandbox-client/dist/extensions/computer-use.js.map +1 -0
  86. package/node_modules/agentic-sandbox-client/dist/extensions/index.d.ts +2 -0
  87. package/node_modules/agentic-sandbox-client/dist/extensions/index.d.ts.map +1 -0
  88. package/node_modules/agentic-sandbox-client/dist/extensions/index.js +15 -0
  89. package/node_modules/agentic-sandbox-client/dist/extensions/index.js.map +1 -0
  90. package/node_modules/agentic-sandbox-client/dist/files/filesystem.d.ts +14 -0
  91. package/node_modules/agentic-sandbox-client/dist/files/filesystem.d.ts.map +1 -0
  92. package/node_modules/agentic-sandbox-client/dist/files/filesystem.js +229 -0
  93. package/node_modules/agentic-sandbox-client/dist/files/filesystem.js.map +1 -0
  94. package/node_modules/agentic-sandbox-client/dist/files/index.d.ts +2 -0
  95. package/node_modules/agentic-sandbox-client/dist/files/index.d.ts.map +1 -0
  96. package/node_modules/agentic-sandbox-client/dist/files/index.js +15 -0
  97. package/node_modules/agentic-sandbox-client/dist/files/index.js.map +1 -0
  98. package/node_modules/agentic-sandbox-client/dist/index.d.ts +8 -0
  99. package/node_modules/agentic-sandbox-client/dist/index.d.ts.map +1 -0
  100. package/node_modules/agentic-sandbox-client/dist/index.js +20 -0
  101. package/node_modules/agentic-sandbox-client/dist/index.js.map +1 -0
  102. package/node_modules/agentic-sandbox-client/dist/response-utils.d.ts +34 -0
  103. package/node_modules/agentic-sandbox-client/dist/response-utils.d.ts.map +1 -0
  104. package/node_modules/agentic-sandbox-client/dist/response-utils.js +173 -0
  105. package/node_modules/agentic-sandbox-client/dist/response-utils.js.map +1 -0
  106. package/node_modules/agentic-sandbox-client/dist/sandbox-client.d.ts +100 -0
  107. package/node_modules/agentic-sandbox-client/dist/sandbox-client.d.ts.map +1 -0
  108. package/node_modules/agentic-sandbox-client/dist/sandbox-client.js +951 -0
  109. package/node_modules/agentic-sandbox-client/dist/sandbox-client.js.map +1 -0
  110. package/node_modules/agentic-sandbox-client/dist/sandbox.d.ts +144 -0
  111. package/node_modules/agentic-sandbox-client/dist/sandbox.d.ts.map +1 -0
  112. package/node_modules/agentic-sandbox-client/dist/sandbox.js +892 -0
  113. package/node_modules/agentic-sandbox-client/dist/sandbox.js.map +1 -0
  114. package/node_modules/agentic-sandbox-client/dist/trace-manager.d.ts +44 -0
  115. package/node_modules/agentic-sandbox-client/dist/trace-manager.d.ts.map +1 -0
  116. package/node_modules/agentic-sandbox-client/dist/trace-manager.js +185 -0
  117. package/node_modules/agentic-sandbox-client/dist/trace-manager.js.map +1 -0
  118. package/node_modules/agentic-sandbox-client/dist/types.d.ts +62 -0
  119. package/node_modules/agentic-sandbox-client/dist/types.d.ts.map +1 -0
  120. package/node_modules/agentic-sandbox-client/dist/types.js +15 -0
  121. package/node_modules/agentic-sandbox-client/dist/types.js.map +1 -0
  122. package/node_modules/agentic-sandbox-client/package.json +73 -0
  123. package/package.json +6 -3
  124. package/dist/sandbox/firecracker.d.ts +0 -18
  125. package/dist/sandbox/firecracker.d.ts.map +0 -1
  126. package/dist/sandbox/firecracker.js +0 -222
  127. package/dist/sandbox/firecracker.js.map +0 -1
  128. package/dist/sandbox/gondolin-bootstrap.d.ts +0 -26
  129. package/dist/sandbox/gondolin-bootstrap.d.ts.map +0 -1
  130. package/dist/sandbox/gondolin-bootstrap.js +0 -27
  131. package/dist/sandbox/gondolin-bootstrap.js.map +0 -1
  132. package/dist/sandbox/gondolin-contract.d.ts +0 -125
  133. package/dist/sandbox/gondolin-contract.d.ts.map +0 -1
  134. package/dist/sandbox/gondolin-contract.js +0 -155
  135. package/dist/sandbox/gondolin-contract.js.map +0 -1
  136. package/dist/sandbox/gondolin-fleet.d.ts +0 -104
  137. package/dist/sandbox/gondolin-fleet.d.ts.map +0 -1
  138. package/dist/sandbox/gondolin-fleet.js +0 -330
  139. package/dist/sandbox/gondolin-fleet.js.map +0 -1
  140. package/dist/sandbox/gondolin-gateway.d.ts +0 -86
  141. package/dist/sandbox/gondolin-gateway.d.ts.map +0 -1
  142. package/dist/sandbox/gondolin-gateway.js +0 -407
  143. package/dist/sandbox/gondolin-gateway.js.map +0 -1
  144. package/dist/sandbox/gondolin-inventory.d.ts +0 -75
  145. package/dist/sandbox/gondolin-inventory.d.ts.map +0 -1
  146. package/dist/sandbox/gondolin-inventory.js +0 -257
  147. package/dist/sandbox/gondolin-inventory.js.map +0 -1
  148. package/dist/sandbox/gondolin-join.d.ts +0 -62
  149. package/dist/sandbox/gondolin-join.d.ts.map +0 -1
  150. package/dist/sandbox/gondolin-join.js +0 -261
  151. package/dist/sandbox/gondolin-join.js.map +0 -1
  152. package/dist/sandbox/gondolin-nfs-advisory.d.ts +0 -15
  153. package/dist/sandbox/gondolin-nfs-advisory.d.ts.map +0 -1
  154. package/dist/sandbox/gondolin-nfs-advisory.js +0 -60
  155. package/dist/sandbox/gondolin-nfs-advisory.js.map +0 -1
  156. package/dist/sandbox/gondolin-placement.d.ts +0 -30
  157. package/dist/sandbox/gondolin-placement.d.ts.map +0 -1
  158. package/dist/sandbox/gondolin-placement.js +0 -77
  159. package/dist/sandbox/gondolin-placement.js.map +0 -1
  160. package/dist/sandbox/gondolin-recovery.d.ts +0 -33
  161. package/dist/sandbox/gondolin-recovery.d.ts.map +0 -1
  162. package/dist/sandbox/gondolin-recovery.js +0 -39
  163. package/dist/sandbox/gondolin-recovery.js.map +0 -1
  164. package/dist/sandbox/gondolin-remote.d.ts +0 -70
  165. package/dist/sandbox/gondolin-remote.d.ts.map +0 -1
  166. package/dist/sandbox/gondolin-remote.js +0 -325
  167. package/dist/sandbox/gondolin-remote.js.map +0 -1
  168. package/dist/sandbox/gondolin-worker-client.d.ts +0 -135
  169. package/dist/sandbox/gondolin-worker-client.d.ts.map +0 -1
  170. package/dist/sandbox/gondolin-worker-client.js +0 -323
  171. package/dist/sandbox/gondolin-worker-client.js.map +0 -1
  172. package/dist/sandbox/gondolin-worker-main.d.ts +0 -2
  173. package/dist/sandbox/gondolin-worker-main.d.ts.map +0 -1
  174. package/dist/sandbox/gondolin-worker-main.js +0 -22
  175. package/dist/sandbox/gondolin-worker-main.js.map +0 -1
  176. package/dist/sandbox/gondolin-worker.d.ts +0 -17
  177. package/dist/sandbox/gondolin-worker.d.ts.map +0 -1
  178. package/dist/sandbox/gondolin-worker.js +0 -201
  179. package/dist/sandbox/gondolin-worker.js.map +0 -1
  180. package/dist/sandbox/gondolin.d.ts +0 -53
  181. package/dist/sandbox/gondolin.d.ts.map +0 -1
  182. package/dist/sandbox/gondolin.js +0 -430
  183. package/dist/sandbox/gondolin.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,KAAK,EACV,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,2BAA2B,CAAC;AAEnC,QAAA,MAAM,aAAa,+BAAsB,CAAC;AAC1C,KAAK,aAAa,GAAG,OAAO,aAAa,CAAC;AAI1C,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEnD,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,SAAS,GAAG,UAAU,GAAG,QAAQ,CAAC;AAEvE;;;;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AAM,eAAe,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAOjC,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC","sourcesContent":["import type { ThinkingLevel } from \"@earendil-works/pi-agent-core\";\nimport { execFile } from \"child_process\";\nimport { promisify } from \"util\";\nimport type {\n ImmediateEventPayload,\n OneShotEventPayload,\n PeriodicEventPayload,\n} from \"./harness/event-format.js\";\n\nconst execFileAsync = promisify(execFile);\ntype ExecFileAsync = typeof execFileAsync;\n\n// ── adapter ───────────────────────────────────────────────────────────────────\n\nexport type ConversationKind = \"direct\" | \"shared\";\n\nexport type PlatformName = \"slack\" | \"discord\" | \"telegram\" | \"github\";\n\n/**\n * Who can drive conversations on a platform — gates ambient credential policy.\n *\n * - `membership`: only invited workspace/server members (Slack/Discord/Telegram).\n * Safe to copy `sandbox.defaultSharedVault` into new conversation vaults.\n * - `open-trigger`: broader trigger surface (e.g. GitHub repo writers on public\n * issues/PRs). Ambient shared vault must not apply; use host-side platform\n * identity or an explicitly provisioned vault.\n */\nexport type PlatformTrustModel = \"membership\" | \"open-trigger\";\n\nexport interface ConversationMessage {\n id: string;\n sessionKey: string;\n conversationKind: ConversationKind;\n userId: string;\n userName?: string;\n text: string;\n attachments?: { name: string; localPath: string }[];\n threadTs?: string;\n}\n\nexport interface ChatToolResult {\n toolName: string;\n label?: string;\n args?: Record<string, unknown>;\n result: string;\n isError: boolean;\n durationMs: number;\n}\n\nexport interface ConversationResponder {\n respond(text: string): Promise<void>;\n appendResponseDelta?(delta: string): Promise<void>;\n finishResponse?(finalText?: string): Promise<void>;\n replaceResponse(text: string, options?: { createOverflowLink?: () => string }): Promise<void>;\n respondDiagnostic(text: string, options?: { style?: \"muted\" | \"error\" }): Promise<void>;\n respondToolResult(result: ChatToolResult): Promise<void>;\n setTyping(isTyping: boolean): Promise<void>;\n setWorking(working: boolean): Promise<void>;\n uploadFile(filePath: string, title?: string): Promise<void>;\n /**\n * React to the message that triggered this run with an emoji short name\n * (no colons). Optional: platforms/contexts without reaction support omit\n * it, and callers must handle its absence.\n */\n react?(emoji: string): Promise<void>;\n deleteResponse(): Promise<void>;\n}\n\nexport interface MessagingInfo {\n name: string;\n formattingGuide: string;\n channels: { id: string; name: string }[];\n users: { id: string; userName: string; displayName: string }[];\n /**\n * Trust boundary for ambient credentials. Defaults to `membership` when\n * omitted (closed chat platforms). Open-trigger platforms must set this\n * explicitly so vault policy does not key off platform name strings.\n */\n trustModel?: PlatformTrustModel;\n diagnostics?: {\n showUsageSummary?: boolean;\n };\n}\n\nexport interface ChatAdapter {\n start(): Promise<void>;\n stop(): Promise<void>;\n getMessagingInfo(): MessagingInfo;\n}\n\nexport type AgentEventPayload =\n | { kind: \"sessionStart\" }\n | { kind: \"responseDelta\"; delta: string }\n | { kind: \"responseFinal\"; text: string }\n | { kind: \"diagnostic\"; text: string }\n | { kind: \"toolStart\"; toolId: string; toolName: string; input?: unknown }\n | { kind: \"toolEnd\"; toolId: string }\n | { kind: \"turnEnd\"; awaitingInput?: boolean }\n | { kind: \"sessionEnd\"; reason?: string };\n\nexport interface AgentEventEnvelope {\n source: \"mikan\";\n sessionId: string;\n actorName: string;\n event: AgentEventPayload;\n}\n\n/**\n * A platform-agnostic event (message/mention) that triggers the agent.\n */\nexport interface ConversationEvent {\n type: string;\n /** Platform-specific raw conversation/channel/chat identifier */\n conversationId: string;\n /** Optional alternate conversation identity used for vault routing. */\n vaultConversationId?: string;\n /** Cross-platform conversation shape: direct message vs shared space */\n conversationKind: ConversationKind;\n /** Message timestamp or ID as string */\n ts: string;\n /** Parent message ID for threaded replies (optional) */\n thread_ts?: string;\n /** User ID */\n user: string;\n /** Message text (already stripped of bot mentions) */\n text: string;\n /** Downloaded attachments */\n attachments?: { name: string; localPath: string }[];\n /** Platform-computed session key; overrides default conversationId:thread_ts computation */\n sessionKey?: string;\n}\n\n/**\n * Minimum interface that every platform bot must implement,\n * used by the central handler in main.ts and by EventsWatcher.\n */\nexport interface MessagingBot {\n start(): Promise<void>;\n postMessage(channel: string, text: string): Promise<string>;\n updateMessage(channel: string, ts: string, text: string): Promise<void>;\n /**\n * Add an emoji reaction to a message. `emoji` is a platform-agnostic short\n * name without colons (e.g. \"eyes\", \"white_check_mark\"). Optional so\n * adapters adopt it incrementally; callers must handle its absence.\n */\n addReaction?(channel: string, messageTs: string, emoji: string): Promise<void>;\n /**\n * Upload a host-side file into a conversation. Optional so adapters adopt\n * it incrementally; callers must handle its absence. Existing adapter\n * implementations (Slack/Discord/Telegram) already match this shape.\n */\n uploadFile?(channel: string, filePath: string, title?: string): Promise<void>;\n enqueueEvent(event: ConversationEvent): boolean;\n getMessagingInfo(): MessagingInfo;\n postPrivate?(conversationId: string, userId: string, text: string): Promise<void>;\n postPrivateDiagnostic?(\n conversationId: string,\n userId: string,\n text: string,\n options?: { style?: \"muted\" | \"error\" },\n ): Promise<void>;\n}\n\n/**\n * Post a plain message to a conversation without triggering an agent run.\n * Backs extension `api.notify`; implemented in main.ts over the platform bots.\n * `platform` is required only when more than one platform is running.\n */\nexport type PlatformNotifier = (\n conversationId: string,\n text: string,\n platform?: string,\n) => Promise<void>;\n\n/**\n * Add an emoji reaction to a message without triggering an agent run. Backs\n * extension `api.react`; implemented in main.ts over the platform bots.\n */\nexport type PlatformReactor = (\n conversationId: string,\n messageTs: string,\n emoji: string,\n platform?: string,\n) => Promise<void>;\n\n/**\n * Upload a host-side file into a conversation without triggering an agent\n * run. Backs extension `api.uploadFile`; implemented in main.ts over the\n * platform bots. `platform` is required only when more than one is running.\n */\nexport type PlatformUploader = (\n conversationId: string,\n filePath: string,\n title?: string,\n platform?: string,\n) => Promise<void>;\n\n/** Normalized platform data and reply hook for one event. */\nexport interface ConversationContext {\n message: ConversationMessage;\n responder: ConversationResponder;\n platform: MessagingInfo;\n}\n\nexport interface RunningSession {\n sessionKey: string;\n startedAt: number;\n lastActivityAt?: number;\n currentTool?: string;\n}\n\nexport interface MessagingEventHandler {\n isRunning(sessionKey: string): boolean;\n getRunningSessions(): RunningSession[];\n handleEvent(\n event: ConversationEvent,\n bot: MessagingBot,\n context: ConversationContext,\n ): Promise<void>;\n handleStop(sessionKey: string, conversationId: string, bot: MessagingBot): Promise<void>;\n forceStop(sessionKey: string): void;\n handleNewCommand(sessionKey: string, conversationId: string, bot: MessagingBot): Promise<void>;\n}\n\n// ── agent ─────────────────────────────────────────────────────────────────────\n\nexport interface PiAgentWrapper {\n syncChatHistory(currentMessageId?: string): void;\n run(\n message: ConversationMessage,\n responder: ConversationResponder,\n platform: MessagingInfo,\n ): Promise<{ stopReason: string; errorMessage?: string }>;\n abort(): void;\n getCurrentStep(): { toolName?: string; label?: string } | undefined;\n /**\n * Dispatch a leading-slash message to an extension-registered command.\n * Returns true when a command consumed the message (no agent run follows).\n */\n tryExtensionCommand(\n message: ConversationMessage,\n responder: ConversationResponder,\n ): Promise<boolean>;\n /** Run extension disposers. Call once when this wrapper is discarded. */\n dispose(): Promise<void>;\n}\n\n// ── config ────────────────────────────────────────────────────────────────────\n\nexport interface GondolinRemoteWorkerSettings {\n /** Stable placement identity; defaults to the URL. */\n name?: string;\n /** Base URL of the mikan-worker daemon, e.g. https://worker.internal:8433 */\n url: string;\n /** CA bundle that signs the daemon's server certificate. */\n caFile?: string;\n /** Client certificate + key presented to the daemon (mTLS); falls back to the fleet-level pair. */\n certFile?: string;\n keyFile?: string;\n /** Worker-side path of the shared workspace filesystem. */\n workspaceRoot?: string;\n /** Admission cap for new placements (existing runtimes always count). */\n maxRuntimes?: number;\n /** Drained workers accept no new placements; existing ones finish out. */\n draining?: boolean;\n}\n\nexport interface GondolinGatewaySettings {\n /** Port the worker gateway listens on for dial-home workers. */\n port: number;\n /**\n * Gateway server certificate + key and the CA that signs worker client\n * certificates. Omit all three to let the gateway provision its own CA and\n * server certificate under the state dir (required for `--worker-token`\n * joins).\n */\n certFile?: string;\n keyFile?: string;\n clientCaFile?: string;\n /** SANs for the auto-issued server certificate (defaults to os.hostname). */\n hostnames?: string[];\n /**\n * Worker-side path of the shared workspace filesystem. Required in practice:\n * mount sources are translated to it, and without it every runtime is\n * rejected with \"escapes the workspace root\". gondolinGateway.start()\n * enforces it at boot; typed optional to match the settings schema.\n */\n workspaceRoot?: string;\n /** Per-worker host-side overrides, keyed by worker name. */\n workers?: Record<string, { maxRuntimes?: number; draining?: boolean }>;\n}\n\nexport interface GondolinRemoteSettings {\n /** Single-worker form: connection fields inline (a fleet of one). */\n url?: string;\n caFile?: string;\n certFile?: string;\n keyFile?: string;\n workspaceRoot?: string;\n maxRuntimes?: number;\n /** Fleet form: several workers; per-worker fields fall back to the inline ones. */\n workers?: GondolinRemoteWorkerSettings[];\n /** Dial-home form: listen for workers that connect to mikan instead. */\n gateway?: GondolinGatewaySettings;\n /** Guest image selector resolved on the workers. */\n imageSelector?: string;\n /** How long a new conversation waits for capacity before failing. */\n queueWaitSeconds?: number;\n}\n\nexport interface SandboxSettings {\n cpus?: string;\n memory?: string;\n boost?: { cpus?: string; memory?: string };\n image?: { workspaceMount?: \"private\" | \"full\" };\n gondolin?: { remote?: GondolinRemoteSettings };\n defaultSharedVault?: string;\n}\n\nexport interface AgentConfig {\n provider: string;\n model: string;\n thinkingLevel: ThinkingLevel;\n sentryDsn?: string;\n sandbox?: SandboxSettings;\n slack?: {\n replyMode?: \"top-level\" | \"thread\";\n };\n}\n\n/**\n * @deprecated Auto-reply is kept for compatibility while its future is undecided.\n */\nexport interface AutoReplyConfig {\n enabled: boolean;\n rules: string[];\n}\n\nexport interface JudgeModelConfig {\n provider: string;\n model: string;\n}\n\n// ── context ───────────────────────────────────────────────────────────────────\n\n/**\n * Platform conversation history entry from log.jsonl.\n */\nexport interface ConversationLogMessage {\n date?: string;\n ts?: string;\n threadTs?: string;\n user?: string;\n userName?: string;\n text?: string;\n isMessagingBot?: boolean;\n}\n\n// ── events ────────────────────────────────────────────────────────────────────\n// The wire format (payload union, schema, parser, builder) is owned by\n// src/harness/event-format.ts. These are the *resolved* runtime shapes: the\n// EventsWatcher fills in the platform default and infers the conversation\n// kind before an event reaches a bot.\n\ninterface ResolvedEventFields {\n platform: string;\n conversationKind: ConversationKind;\n}\n\nexport type ImmediateEvent = ImmediateEventPayload & ResolvedEventFields;\n\nexport type OneShotEvent = OneShotEventPayload & ResolvedEventFields;\n\nexport type PeriodicEvent = PeriodicEventPayload & ResolvedEventFields;\n\nexport type MikanEvent = ImmediateEvent | OneShotEvent | PeriodicEvent;\n\nexport interface PeriodicEventInfo {\n filename: string;\n platform: string;\n conversationId: string;\n conversationKind: ConversationKind;\n text: string;\n schedule: string;\n timezone: string;\n nextRun: string | null;\n}\n\n// ── execution-resolver ────────────────────────────────────────────────────────\n\nexport interface ActorContext {\n platform: string;\n userId: string;\n conversationId: string;\n /** From MessagingInfo.trustModel; vault policy uses this, not platform name. */\n trustModel?: PlatformTrustModel;\n}\n\nexport type ImageWorkspaceMountMode = \"private\" | \"full\";\n\n// ── log ───────────────────────────────────────────────────────────────────────\n\nexport interface LogContext {\n conversationId: string;\n userName?: string;\n conversationName?: string;\n sessionId?: string;\n}\n\n// ── portal shell (src/web/portal-shell.ts) ────────────────────────────────────\n\ntype PortalView = \"admin\" | \"session\" | \"vault\";\n\nexport interface PortalShellOptions {\n activeView: PortalView;\n pageTitle: string;\n identity?: {\n primary: string;\n secondary?: string;\n };\n conversationSwitcher?: {\n currentId: string;\n options?: Array<{ id: string; label: string; running?: boolean }>;\n };\n navLinks?: Partial<Record<PortalView, string>>;\n body: string;\n extraStyles?: string;\n inlineScript?: string;\n extraHead?: string;\n bodyAttributes?: Record<string, string>;\n}\n\n// ── provisioner ───────────────────────────────────────────────────────────────\n\nexport interface ContainerMount {\n source: string;\n target: string;\n}\n\nexport interface ResourceLimits {\n cpus?: string;\n memory?: string;\n}\n\nexport interface SandboxLimitStatus {\n limits?: ResourceLimits;\n boosted: boolean;\n}\n\nexport interface SandboxResourceController {\n boost(key: string): Promise<SandboxLimitStatus>;\n setLimits(key: string, limits: ResourceLimits): Promise<SandboxLimitStatus>;\n getLimitStatus(key: string): SandboxLimitStatus;\n getDefaultLimits(): ResourceLimits | undefined;\n getBoostLimits(): ResourceLimits | undefined;\n}\n\nexport interface ProvisionOptions {\n containerName?: string;\n mounts?: ContainerMount[];\n conversationId?: string;\n}\n\nexport interface DockerContainerManagerOptions {\n limits?: ResourceLimits;\n boostLimits?: ResourceLimits;\n execFileImpl?: ExecFileAsync;\n}\n\nexport interface ExecutionPlan {\n credentialKey: string;\n resourceKey: string;\n sandboxConfig: import(\"./sandbox/types.js\").SandboxConfig;\n env?: Record<string, string>;\n mounts: ContainerMount[];\n}\n\n// ── store ─────────────────────────────────────────────────────────────────────\n\nexport interface Attachment {\n original: string;\n localPath: string;\n}\n\nexport interface LoggedMessage {\n date: string;\n ts: string;\n user: string;\n userName?: string;\n displayName?: string;\n text: string;\n attachments: Attachment[];\n isMessagingBot: boolean;\n threadTs?: string;\n}\n\nexport interface ChannelStoreConfig {\n workingDir: string;\n botToken: string;\n}\n\n// ── trigger ───────────────────────────────────────────────────────────────────\n\nexport type TriggerIntent = \"mention\" | \"direct\" | \"thread-continuation\" | \"auto-reply-candidate\";\n\nexport type TriggerResult = { trigger: true; reason: string } | { trigger: false; reason: string };\n\n/**\n * @deprecated Auto-reply is kept for compatibility while its future is undecided.\n */\nexport type AutoReplyJudge = (input: {\n event: ConversationEvent;\n rules: string[];\n conversationDir: string;\n}) => Promise<boolean>;\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAOjC,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC","sourcesContent":["import type { ThinkingLevel } from \"@earendil-works/pi-agent-core\";\nimport { execFile } from \"child_process\";\nimport { promisify } from \"util\";\nimport type {\n ImmediateEventPayload,\n OneShotEventPayload,\n PeriodicEventPayload,\n} from \"./harness/event-format.js\";\n\nconst execFileAsync = promisify(execFile);\ntype ExecFileAsync = typeof execFileAsync;\n\n// ── adapter ───────────────────────────────────────────────────────────────────\n\nexport type ConversationKind = \"direct\" | \"shared\";\n\nexport type PlatformName = \"slack\" | \"discord\" | \"telegram\" | \"github\";\n\n/**\n * Who can drive conversations on a platform — gates ambient credential policy.\n *\n * - `membership`: only invited workspace/server members (Slack/Discord/Telegram).\n * Safe to copy `sandbox.defaultSharedVault` into new conversation vaults.\n * - `open-trigger`: broader trigger surface (e.g. GitHub repo writers on public\n * issues/PRs). Ambient shared vault must not apply; use host-side platform\n * identity or an explicitly provisioned vault.\n */\nexport type PlatformTrustModel = \"membership\" | \"open-trigger\";\n\nexport interface ConversationMessage {\n id: string;\n sessionKey: string;\n conversationKind: ConversationKind;\n userId: string;\n userName?: string;\n text: string;\n attachments?: { name: string; localPath: string }[];\n threadTs?: string;\n}\n\nexport interface ChatToolResult {\n toolName: string;\n label?: string;\n args?: Record<string, unknown>;\n result: string;\n isError: boolean;\n durationMs: number;\n}\n\nexport interface ConversationResponder {\n respond(text: string): Promise<void>;\n appendResponseDelta?(delta: string): Promise<void>;\n finishResponse?(finalText?: string): Promise<void>;\n replaceResponse(text: string, options?: { createOverflowLink?: () => string }): Promise<void>;\n respondDiagnostic(text: string, options?: { style?: \"muted\" | \"error\" }): Promise<void>;\n respondToolResult(result: ChatToolResult): Promise<void>;\n setTyping(isTyping: boolean): Promise<void>;\n setWorking(working: boolean): Promise<void>;\n uploadFile(filePath: string, title?: string): Promise<void>;\n /**\n * React to the message that triggered this run with an emoji short name\n * (no colons). Optional: platforms/contexts without reaction support omit\n * it, and callers must handle its absence.\n */\n react?(emoji: string): Promise<void>;\n deleteResponse(): Promise<void>;\n}\n\nexport interface MessagingInfo {\n name: string;\n formattingGuide: string;\n channels: { id: string; name: string }[];\n users: { id: string; userName: string; displayName: string }[];\n /**\n * Trust boundary for ambient credentials. Defaults to `membership` when\n * omitted (closed chat platforms). Open-trigger platforms must set this\n * explicitly so vault policy does not key off platform name strings.\n */\n trustModel?: PlatformTrustModel;\n diagnostics?: {\n showUsageSummary?: boolean;\n };\n}\n\nexport interface ChatAdapter {\n start(): Promise<void>;\n stop(): Promise<void>;\n getMessagingInfo(): MessagingInfo;\n}\n\nexport type AgentEventPayload =\n | { kind: \"sessionStart\" }\n | { kind: \"responseDelta\"; delta: string }\n | { kind: \"responseFinal\"; text: string }\n | { kind: \"diagnostic\"; text: string }\n | { kind: \"toolStart\"; toolId: string; toolName: string; input?: unknown }\n | { kind: \"toolEnd\"; toolId: string }\n | { kind: \"turnEnd\"; awaitingInput?: boolean }\n | { kind: \"sessionEnd\"; reason?: string };\n\nexport interface AgentEventEnvelope {\n source: \"mikan\";\n sessionId: string;\n actorName: string;\n event: AgentEventPayload;\n}\n\n/**\n * A platform-agnostic event (message/mention) that triggers the agent.\n */\nexport interface ConversationEvent {\n type: string;\n /** Platform-specific raw conversation/channel/chat identifier */\n conversationId: string;\n /** Optional alternate conversation identity used for vault routing. */\n vaultConversationId?: string;\n /** Cross-platform conversation shape: direct message vs shared space */\n conversationKind: ConversationKind;\n /** Message timestamp or ID as string */\n ts: string;\n /** Parent message ID for threaded replies (optional) */\n thread_ts?: string;\n /** User ID */\n user: string;\n /** Message text (already stripped of bot mentions) */\n text: string;\n /** Downloaded attachments */\n attachments?: { name: string; localPath: string }[];\n /** Platform-computed session key; overrides default conversationId:thread_ts computation */\n sessionKey?: string;\n}\n\n/**\n * Minimum interface that every platform bot must implement,\n * used by the central handler in main.ts and by EventsWatcher.\n */\nexport interface MessagingBot {\n start(): Promise<void>;\n postMessage(channel: string, text: string): Promise<string>;\n updateMessage(channel: string, ts: string, text: string): Promise<void>;\n /**\n * Add an emoji reaction to a message. `emoji` is a platform-agnostic short\n * name without colons (e.g. \"eyes\", \"white_check_mark\"). Optional so\n * adapters adopt it incrementally; callers must handle its absence.\n */\n addReaction?(channel: string, messageTs: string, emoji: string): Promise<void>;\n /**\n * Upload a host-side file into a conversation. Optional so adapters adopt\n * it incrementally; callers must handle its absence. Existing adapter\n * implementations (Slack/Discord/Telegram) already match this shape.\n */\n uploadFile?(channel: string, filePath: string, title?: string): Promise<void>;\n enqueueEvent(event: ConversationEvent): boolean;\n getMessagingInfo(): MessagingInfo;\n postPrivate?(conversationId: string, userId: string, text: string): Promise<void>;\n postPrivateDiagnostic?(\n conversationId: string,\n userId: string,\n text: string,\n options?: { style?: \"muted\" | \"error\" },\n ): Promise<void>;\n}\n\n/**\n * Post a plain message to a conversation without triggering an agent run.\n * Backs extension `api.notify`; implemented in main.ts over the platform bots.\n * `platform` is required only when more than one platform is running.\n */\nexport type PlatformNotifier = (\n conversationId: string,\n text: string,\n platform?: string,\n) => Promise<void>;\n\n/**\n * Add an emoji reaction to a message without triggering an agent run. Backs\n * extension `api.react`; implemented in main.ts over the platform bots.\n */\nexport type PlatformReactor = (\n conversationId: string,\n messageTs: string,\n emoji: string,\n platform?: string,\n) => Promise<void>;\n\n/**\n * Upload a host-side file into a conversation without triggering an agent\n * run. Backs extension `api.uploadFile`; implemented in main.ts over the\n * platform bots. `platform` is required only when more than one is running.\n */\nexport type PlatformUploader = (\n conversationId: string,\n filePath: string,\n title?: string,\n platform?: string,\n) => Promise<void>;\n\n/** Normalized platform data and reply hook for one event. */\nexport interface ConversationContext {\n message: ConversationMessage;\n responder: ConversationResponder;\n platform: MessagingInfo;\n}\n\nexport interface RunningSession {\n sessionKey: string;\n startedAt: number;\n lastActivityAt?: number;\n currentTool?: string;\n}\n\nexport interface MessagingEventHandler {\n isRunning(sessionKey: string): boolean;\n getRunningSessions(): RunningSession[];\n handleEvent(\n event: ConversationEvent,\n bot: MessagingBot,\n context: ConversationContext,\n ): Promise<void>;\n handleStop(sessionKey: string, conversationId: string, bot: MessagingBot): Promise<void>;\n forceStop(sessionKey: string): void;\n handleNewCommand(sessionKey: string, conversationId: string, bot: MessagingBot): Promise<void>;\n}\n\n// ── agent ─────────────────────────────────────────────────────────────────────\n\nexport interface PiAgentWrapper {\n syncChatHistory(currentMessageId?: string): void;\n run(\n message: ConversationMessage,\n responder: ConversationResponder,\n platform: MessagingInfo,\n ): Promise<{ stopReason: string; errorMessage?: string }>;\n abort(): void;\n getCurrentStep(): { toolName?: string; label?: string } | undefined;\n /**\n * Dispatch a leading-slash message to an extension-registered command.\n * Returns true when a command consumed the message (no agent run follows).\n */\n tryExtensionCommand(\n message: ConversationMessage,\n responder: ConversationResponder,\n ): Promise<boolean>;\n /** Run extension disposers. Call once when this wrapper is discarded. */\n dispose(): Promise<void>;\n}\n\n// ── config ────────────────────────────────────────────────────────────────────\n\nexport interface AgentSandboxSettings {\n namespace: string;\n runtimeClassName: string;\n apiUrl?: string;\n routerNamespace?: string;\n sandboxReadyTimeout?: number;\n}\n\nexport interface SandboxSettings {\n cpus?: string;\n memory?: string;\n boost?: { cpus?: string; memory?: string };\n image?: { workspaceMount?: \"private\" | \"full\" };\n agentSandbox?: AgentSandboxSettings;\n defaultSharedVault?: string;\n}\n\nexport interface AgentConfig {\n provider: string;\n model: string;\n thinkingLevel: ThinkingLevel;\n sentryDsn?: string;\n sandbox?: SandboxSettings;\n slack?: {\n replyMode?: \"top-level\" | \"thread\";\n };\n}\n\n/**\n * @deprecated Auto-reply is kept for compatibility while its future is undecided.\n */\nexport interface AutoReplyConfig {\n enabled: boolean;\n rules: string[];\n}\n\nexport interface JudgeModelConfig {\n provider: string;\n model: string;\n}\n\n// ── context ───────────────────────────────────────────────────────────────────\n\n/**\n * Platform conversation history entry from log.jsonl.\n */\nexport interface ConversationLogMessage {\n date?: string;\n ts?: string;\n threadTs?: string;\n user?: string;\n userName?: string;\n text?: string;\n isMessagingBot?: boolean;\n}\n\n// ── events ────────────────────────────────────────────────────────────────────\n// The wire format (payload union, schema, parser, builder) is owned by\n// src/harness/event-format.ts. These are the *resolved* runtime shapes: the\n// EventsWatcher fills in the platform default and infers the conversation\n// kind before an event reaches a bot.\n\ninterface ResolvedEventFields {\n platform: string;\n conversationKind: ConversationKind;\n}\n\nexport type ImmediateEvent = ImmediateEventPayload & ResolvedEventFields;\n\nexport type OneShotEvent = OneShotEventPayload & ResolvedEventFields;\n\nexport type PeriodicEvent = PeriodicEventPayload & ResolvedEventFields;\n\nexport type MikanEvent = ImmediateEvent | OneShotEvent | PeriodicEvent;\n\nexport interface PeriodicEventInfo {\n filename: string;\n platform: string;\n conversationId: string;\n conversationKind: ConversationKind;\n text: string;\n schedule: string;\n timezone: string;\n nextRun: string | null;\n}\n\n// ── execution-resolver ────────────────────────────────────────────────────────\n\nexport interface ActorContext {\n platform: string;\n userId: string;\n conversationId: string;\n /** From MessagingInfo.trustModel; vault policy uses this, not platform name. */\n trustModel?: PlatformTrustModel;\n}\n\nexport type ImageWorkspaceMountMode = \"private\" | \"full\";\n\n// ── log ───────────────────────────────────────────────────────────────────────\n\nexport interface LogContext {\n conversationId: string;\n userName?: string;\n conversationName?: string;\n sessionId?: string;\n}\n\n// ── portal shell (src/web/portal-shell.ts) ────────────────────────────────────\n\ntype PortalView = \"admin\" | \"session\" | \"vault\";\n\nexport interface PortalShellOptions {\n activeView: PortalView;\n pageTitle: string;\n identity?: {\n primary: string;\n secondary?: string;\n };\n conversationSwitcher?: {\n currentId: string;\n options?: Array<{ id: string; label: string; running?: boolean }>;\n };\n navLinks?: Partial<Record<PortalView, string>>;\n body: string;\n extraStyles?: string;\n inlineScript?: string;\n extraHead?: string;\n bodyAttributes?: Record<string, string>;\n}\n\n// ── provisioner ───────────────────────────────────────────────────────────────\n\nexport interface ContainerMount {\n source: string;\n target: string;\n}\n\nexport interface ResourceLimits {\n cpus?: string;\n memory?: string;\n}\n\nexport interface SandboxLimitStatus {\n limits?: ResourceLimits;\n boosted: boolean;\n}\n\nexport interface SandboxResourceController {\n boost(key: string): Promise<SandboxLimitStatus>;\n setLimits(key: string, limits: ResourceLimits): Promise<SandboxLimitStatus>;\n getLimitStatus(key: string): SandboxLimitStatus;\n getDefaultLimits(): ResourceLimits | undefined;\n getBoostLimits(): ResourceLimits | undefined;\n}\n\nexport interface ProvisionOptions {\n containerName?: string;\n mounts?: ContainerMount[];\n conversationId?: string;\n}\n\nexport interface DockerContainerManagerOptions {\n limits?: ResourceLimits;\n boostLimits?: ResourceLimits;\n execFileImpl?: ExecFileAsync;\n}\n\nexport interface ExecutionPlan {\n credentialKey: string;\n resourceKey: string;\n sandboxConfig: import(\"./sandbox/types.js\").SandboxConfig;\n env?: Record<string, string>;\n mounts: ContainerMount[];\n}\n\n// ── store ─────────────────────────────────────────────────────────────────────\n\nexport interface Attachment {\n original: string;\n localPath: string;\n}\n\nexport interface LoggedMessage {\n date: string;\n ts: string;\n user: string;\n userName?: string;\n displayName?: string;\n text: string;\n attachments: Attachment[];\n isMessagingBot: boolean;\n threadTs?: string;\n}\n\nexport interface ChannelStoreConfig {\n workingDir: string;\n botToken: string;\n}\n\n// ── trigger ───────────────────────────────────────────────────────────────────\n\nexport type TriggerIntent = \"mention\" | \"direct\" | \"thread-continuation\" | \"auto-reply-candidate\";\n\nexport type TriggerResult = { trigger: true; reason: string } | { trigger: false; reason: string };\n\n/**\n * @deprecated Auto-reply is kept for compatibility while its future is undecided.\n */\nexport type AutoReplyJudge = (input: {\n event: ConversationEvent;\n rules: string[];\n conversationDir: string;\n}) => Promise<boolean>;\n"]}
@@ -9,9 +9,9 @@ import type { SandboxConfig } from "../sandbox/index.js";
9
9
  * must not inherit ambient credentials — host-side platform identity or an
10
10
  * explicitly provisioned vault only.
11
11
  *
12
- * Topology: only isolated sandboxes (`image` / `cloudflare`) auto-provision
13
- * per-conversation vaults that receive the copy. `host` / `container` /
14
- * `firecracker` do not use this ambient path.
12
+ * Topology: isolated sandboxes (`image` / `agent-sandbox` / `cloudflare`)
13
+ * auto-provision per-conversation vaults that receive the copy. `host` and
14
+ * `container` do not use this ambient path.
15
15
  */
16
16
  export declare function allowsAmbientDefaultSharedVault(options: {
17
17
  trustModel?: PlatformTrustModel;
@@ -1 +1 @@
1
- {"version":3,"file":"policy.d.ts","sourceRoot":"","sources":["../../src/vault/policy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD;;;;;;;;;;;;GAYG;AACH,wBAAgB,+BAA+B,CAAC,OAAO,EAAE;IACvD,UAAU,CAAC,EAAE,kBAAkB,CAAC;IAChC,WAAW,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CACpC,GAAG,OAAO,CAIV"}
1
+ {"version":3,"file":"policy.d.ts","sourceRoot":"","sources":["../../src/vault/policy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD;;;;;;;;;;;;GAYG;AACH,wBAAgB,+BAA+B,CAAC,OAAO,EAAE;IACvD,UAAU,CAAC,EAAE,kBAAkB,CAAC;IAChC,WAAW,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CACpC,GAAG,OAAO,CAQV"}
@@ -7,14 +7,16 @@
7
7
  * must not inherit ambient credentials — host-side platform identity or an
8
8
  * explicitly provisioned vault only.
9
9
  *
10
- * Topology: only isolated sandboxes (`image` / `cloudflare`) auto-provision
11
- * per-conversation vaults that receive the copy. `host` / `container` /
12
- * `firecracker` do not use this ambient path.
10
+ * Topology: isolated sandboxes (`image` / `agent-sandbox` / `cloudflare`)
11
+ * auto-provision per-conversation vaults that receive the copy. `host` and
12
+ * `container` do not use this ambient path.
13
13
  */
14
14
  export function allowsAmbientDefaultSharedVault(options) {
15
15
  const trustModel = options.trustModel ?? "membership";
16
16
  if (trustModel === "open-trigger")
17
17
  return false;
18
- return options.sandboxType === "image" || options.sandboxType === "cloudflare";
18
+ return (options.sandboxType === "image" ||
19
+ options.sandboxType === "agent-sandbox" ||
20
+ options.sandboxType === "cloudflare");
19
21
  }
20
22
  //# sourceMappingURL=policy.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"policy.js","sourceRoot":"","sources":["../../src/vault/policy.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,+BAA+B,CAAC,OAG/C;IACC,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,YAAY,CAAC;IACtD,IAAI,UAAU,KAAK,cAAc;QAAE,OAAO,KAAK,CAAC;IAChD,OAAO,OAAO,CAAC,WAAW,KAAK,OAAO,IAAI,OAAO,CAAC,WAAW,KAAK,YAAY,CAAC;AACjF,CAAC","sourcesContent":["import type { PlatformTrustModel } from \"../types.js\";\nimport type { SandboxConfig } from \"../sandbox/index.js\";\n\n/**\n * Decide whether a new conversation vault may inherit `sandbox.defaultSharedVault`.\n *\n * Ambient copy is a membership-trust convenience: only appropriate when the\n * people who can drive the agent are already gated by platform membership\n * (Slack/Discord/Telegram). Open-trigger surfaces (GitHub issue/PR comments)\n * must not inherit ambient credentials — host-side platform identity or an\n * explicitly provisioned vault only.\n *\n * Topology: only isolated sandboxes (`image` / `cloudflare`) auto-provision\n * per-conversation vaults that receive the copy. `host` / `container` /\n * `firecracker` do not use this ambient path.\n */\nexport function allowsAmbientDefaultSharedVault(options: {\n trustModel?: PlatformTrustModel;\n sandboxType: SandboxConfig[\"type\"];\n}): boolean {\n const trustModel = options.trustModel ?? \"membership\";\n if (trustModel === \"open-trigger\") return false;\n return options.sandboxType === \"image\" || options.sandboxType === \"cloudflare\";\n}\n"]}
1
+ {"version":3,"file":"policy.js","sourceRoot":"","sources":["../../src/vault/policy.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,+BAA+B,CAAC,OAG/C;IACC,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,YAAY,CAAC;IACtD,IAAI,UAAU,KAAK,cAAc;QAAE,OAAO,KAAK,CAAC;IAChD,OAAO,CACL,OAAO,CAAC,WAAW,KAAK,OAAO;QAC/B,OAAO,CAAC,WAAW,KAAK,eAAe;QACvC,OAAO,CAAC,WAAW,KAAK,YAAY,CACrC,CAAC;AACJ,CAAC","sourcesContent":["import type { PlatformTrustModel } from \"../types.js\";\nimport type { SandboxConfig } from \"../sandbox/index.js\";\n\n/**\n * Decide whether a new conversation vault may inherit `sandbox.defaultSharedVault`.\n *\n * Ambient copy is a membership-trust convenience: only appropriate when the\n * people who can drive the agent are already gated by platform membership\n * (Slack/Discord/Telegram). Open-trigger surfaces (GitHub issue/PR comments)\n * must not inherit ambient credentials — host-side platform identity or an\n * explicitly provisioned vault only.\n *\n * Topology: isolated sandboxes (`image` / `agent-sandbox` / `cloudflare`)\n * auto-provision per-conversation vaults that receive the copy. `host` and\n * `container` do not use this ambient path.\n */\nexport function allowsAmbientDefaultSharedVault(options: {\n trustModel?: PlatformTrustModel;\n sandboxType: SandboxConfig[\"type\"];\n}): boolean {\n const trustModel = options.trustModel ?? \"membership\";\n if (trustModel === \"open-trigger\") return false;\n return (\n options.sandboxType === \"image\" ||\n options.sandboxType === \"agent-sandbox\" ||\n options.sandboxType === \"cloudflare\"\n );\n}\n"]}
@@ -0,0 +1,13 @@
1
+ import type { Tracer } from "../trace-manager.js";
2
+ import type { CallOptions, ExecutionResult, RequestFn } from "../types.js";
3
+ /** @internal — exported for unit testing only; not part of the public API. */
4
+ export declare function extractExecutable(command: string): string;
5
+ export declare class CommandExecutor {
6
+ private requestFn;
7
+ private getTracer;
8
+ private getParentContext;
9
+ private traceServiceName;
10
+ constructor(requestFn: RequestFn, getTracer: () => Tracer | null, traceServiceName: string, getParentContext?: () => unknown);
11
+ run(command: string, options?: number | CallOptions): Promise<ExecutionResult>;
12
+ }
13
+ //# sourceMappingURL=command-executor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-executor.d.ts","sourceRoot":"","sources":["../../src/commands/command-executor.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAElD,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAkB3E,8EAA8E;AAC9E,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAQzD;AAED,qBAAa,eAAe;IAC1B,OAAO,CAAC,SAAS,CAAY;IAC7B,OAAO,CAAC,SAAS,CAAsB;IACvC,OAAO,CAAC,gBAAgB,CAAgB;IACxC,OAAO,CAAC,gBAAgB,CAAS;gBAG/B,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,MAAM,MAAM,GAAG,IAAI,EAC9B,gBAAgB,EAAE,MAAM,EACxB,gBAAgB,GAAE,MAAM,OAAoB;IAQxC,GAAG,CACP,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,MAAM,GAAG,WAAW,GAC7B,OAAO,CAAC,eAAe,CAAC;CAmD5B"}
@@ -0,0 +1,88 @@
1
+ // Copyright 2025 The Kubernetes Authors.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+ import { posix } from "node:path";
15
+ import { MAX_ERROR_BODY_BYTES, MAX_EXECUTION_RESPONSE_SIZE, } from "../constants.js";
16
+ import { SandboxRequestError } from "../exceptions.js";
17
+ import { parseExecutionResult, readBoundedText } from "../response-utils.js";
18
+ import { withSpan } from "../trace-manager.js";
19
+ function normalizeCallOptions(arg, defaultTimeoutSec) {
20
+ if (typeof arg === "number") {
21
+ return { timeout: arg };
22
+ }
23
+ if (arg === undefined) {
24
+ return { timeout: defaultTimeoutSec };
25
+ }
26
+ return {
27
+ timeout: arg.timeout ?? defaultTimeoutSec,
28
+ signal: arg.signal,
29
+ };
30
+ }
31
+ /** @internal — exported for unit testing only; not part of the public API. */
32
+ export function extractExecutable(command) {
33
+ if (!command)
34
+ return "";
35
+ for (const field of command.split(/\s+/)) {
36
+ if (!field || (field.includes("=") && !field.split("=")[0].includes("/")))
37
+ continue;
38
+ return posix.basename(field);
39
+ }
40
+ return "";
41
+ }
42
+ export class CommandExecutor {
43
+ requestFn;
44
+ getTracer;
45
+ getParentContext;
46
+ traceServiceName;
47
+ constructor(requestFn, getTracer, traceServiceName, getParentContext = () => null) {
48
+ this.requestFn = requestFn;
49
+ this.getTracer = getTracer;
50
+ this.getParentContext = getParentContext;
51
+ this.traceServiceName = traceServiceName;
52
+ }
53
+ async run(command, options) {
54
+ const { timeout, signal } = normalizeCallOptions(options, 60);
55
+ return withSpan(this.getTracer(), this.traceServiceName, "run", async (span) => {
56
+ if (span.isRecording()) {
57
+ const executable = extractExecutable(command);
58
+ if (executable) {
59
+ span.setAttribute("sandbox.command.executable", executable);
60
+ }
61
+ }
62
+ const response = await this.requestFn("POST", "execute", {
63
+ body: JSON.stringify({ command }),
64
+ headers: { "Content-Type": "application/json" },
65
+ timeout,
66
+ signal,
67
+ maxRetries: 1, // command execution is non-idempotent; never retry
68
+ });
69
+ const rawText = await readBoundedText(response, MAX_EXECUTION_RESPONSE_SIZE, "execute");
70
+ let data;
71
+ try {
72
+ data = JSON.parse(rawText);
73
+ }
74
+ catch (err) {
75
+ const preview = rawText.length > MAX_ERROR_BODY_BYTES
76
+ ? `${[...rawText].slice(0, MAX_ERROR_BODY_BYTES).join("")}…`
77
+ : rawText;
78
+ throw new SandboxRequestError(`Failed to decode JSON response from sandbox: ${preview}`, { cause: err, operation: "execute" });
79
+ }
80
+ const result = parseExecutionResult(data);
81
+ if (span.isRecording()) {
82
+ span.setAttribute("sandbox.exit_code", result.exitCode);
83
+ }
84
+ return result;
85
+ }, this.getParentContext());
86
+ }
87
+ }
88
+ //# sourceMappingURL=command-executor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-executor.js","sourceRoot":"","sources":["../../src/commands/command-executor.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,iDAAiD;AACjD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EACL,oBAAoB,EACpB,2BAA2B,GAC5B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE7E,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAG/C,SAAS,oBAAoB,CAC3B,GAAqC,EACrC,iBAAyB;IAEzB,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC5B,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC;IAC1B,CAAC;IACD,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;QACtB,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,CAAC;IACxC,CAAC;IACD,OAAO;QACL,OAAO,EAAE,GAAG,CAAC,OAAO,IAAI,iBAAiB;QACzC,MAAM,EAAE,GAAG,CAAC,MAAM;KACnB,CAAC;AACJ,CAAC;AAED,8EAA8E;AAC9E,MAAM,UAAU,iBAAiB,CAAC,OAAe;IAC/C,IAAI,CAAC,OAAO;QAAE,OAAO,EAAE,CAAC;IACxB,KAAK,MAAM,KAAK,IAAI,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;QACzC,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,QAAQ,CAA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OAAO,EAAE,CAAC;gBACjC,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;gBAC/C,OAAO;gBACP,MAAM;gBACN,UAAU,EAAE,CAAC,EAAE,mDAAmD;aACnE,CAAC,CAAC;YAEH,MAAM,OAAO,GAAG,MAAM,eAAe,CACnC,QAAQ,EACR,2BAA2B,EAC3B,SAAS,CACV,CAAC;YACF,IAAI,IAAa,CAAC;YAClB,IAAI,CAAC;gBACH,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YAC7B,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,MAAM,OAAO,GACX,OAAO,CAAC,MAAM,GAAG,oBAAoB;oBACnC,CAAC,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,oBAAoB,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG;oBAC5D,CAAC,CAAC,OAAO,CAAC;gBACd,MAAM,IAAI,mBAAmB,CAC3B,gDAAgD,OAAO,EAAE,EACzD,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,CACrC,CAAC;YACJ,CAAC;YACD,MAAM,MAAM,GAAG,oBAAoB,CAAC,IAAI,CAAC,CAAC;YAE1C,IAAI,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;gBACvB,IAAI,CAAC,YAAY,CAAC,mBAAmB,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;YAC1D,CAAC;YAED,OAAO,MAAM,CAAC;QAChB,CAAC,EACD,IAAI,CAAC,gBAAgB,EAAE,CACxB,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,2 @@
1
+ export { CommandExecutor } from "./command-executor.js";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,15 @@
1
+ // Copyright 2025 The Kubernetes Authors.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+ export { CommandExecutor } from "./command-executor.js";
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,iDAAiD;AACjD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,28 @@
1
+ export declare const GATEWAY_API_GROUP = "gateway.networking.k8s.io";
2
+ export declare const GATEWAY_API_VERSION = "v1";
3
+ export declare const GATEWAY_PLURAL = "gateways";
4
+ export declare const CLAIM_API_GROUP = "extensions.agents.x-k8s.io";
5
+ export declare const CLAIM_API_VERSION = "v1beta1";
6
+ export declare const CLAIM_PLURAL_NAME = "sandboxclaims";
7
+ export declare const SANDBOX_API_GROUP = "agents.x-k8s.io";
8
+ export declare const SANDBOX_API_VERSION = "v1beta1";
9
+ export declare const SANDBOX_PLURAL_NAME = "sandboxes";
10
+ export declare const POD_NAME_ANNOTATION = "agents.x-k8s.io/pod-name";
11
+ export declare const MAX_RETRIES = 6;
12
+ export declare const BACKOFF_FACTOR = 0.5;
13
+ export declare const MAX_BACKOFF_MS = 8000;
14
+ export declare const RETRY_STATUS_CODES: number[];
15
+ export declare const MAX_DRAIN_BYTES = 4096;
16
+ export declare const MAX_ERROR_BODY_BYTES = 512;
17
+ export declare const MAX_RECONNECT_ATTEMPTS = 3;
18
+ export declare const PER_ATTEMPT_TIMEOUT_MS = 60000;
19
+ export declare const HEADER_REQUEST_ID = "X-Request-ID";
20
+ export declare const MAX_GATEWAY_REWATCH = 10;
21
+ export declare const GATEWAY_PROBE_TIMEOUT_MS = 30000;
22
+ export declare const GATEWAY_PROBE_INTERVAL_MS = 500;
23
+ export declare const CLEANUP_TIMEOUT_MS = 5000;
24
+ export declare const MAX_EXECUTION_RESPONSE_SIZE: number;
25
+ export declare const MAX_METADATA_RESPONSE_SIZE: number;
26
+ export declare const MAX_DOWNLOAD_SIZE: number;
27
+ export declare const MAX_UPLOAD_SIZE: number;
28
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,iBAAiB,8BAA8B,CAAC;AAC7D,eAAO,MAAM,mBAAmB,OAAO,CAAC;AACxC,eAAO,MAAM,cAAc,aAAa,CAAC;AAEzC,eAAO,MAAM,eAAe,+BAA+B,CAAC;AAC5D,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAC3C,eAAO,MAAM,iBAAiB,kBAAkB,CAAC;AAEjD,eAAO,MAAM,iBAAiB,oBAAoB,CAAC;AACnD,eAAO,MAAM,mBAAmB,YAAY,CAAC;AAC7C,eAAO,MAAM,mBAAmB,cAAc,CAAC;AAE/C,eAAO,MAAM,mBAAmB,6BAA6B,CAAC;AAM9D,eAAO,MAAM,WAAW,IAAI,CAAC;AAC7B,eAAO,MAAM,cAAc,MAAM,CAAC;AAQlC,eAAO,MAAM,cAAc,OAAO,CAAC;AACnC,eAAO,MAAM,kBAAkB,UAAuB,CAAC;AAGvD,eAAO,MAAM,eAAe,OAAO,CAAC;AAGpC,eAAO,MAAM,oBAAoB,MAAM,CAAC;AAGxC,eAAO,MAAM,sBAAsB,IAAI,CAAC;AAKxC,eAAO,MAAM,sBAAsB,QAAS,CAAC;AAG7C,eAAO,MAAM,iBAAiB,iBAAiB,CAAC;AAGhD,eAAO,MAAM,mBAAmB,KAAK,CAAC;AAItC,eAAO,MAAM,wBAAwB,QAAS,CAAC;AAG/C,eAAO,MAAM,yBAAyB,MAAM,CAAC;AAG7C,eAAO,MAAM,kBAAkB,OAAQ,CAAC;AAGxC,eAAO,MAAM,2BAA2B,QAAmB,CAAC;AAC5D,eAAO,MAAM,0BAA0B,QAAkB,CAAC;AAC1D,eAAO,MAAM,iBAAiB,QAAoB,CAAC;AACnD,eAAO,MAAM,eAAe,QAAoB,CAAC"}
@@ -0,0 +1,65 @@
1
+ // Copyright 2025 The Kubernetes Authors.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+ export const GATEWAY_API_GROUP = "gateway.networking.k8s.io";
15
+ export const GATEWAY_API_VERSION = "v1";
16
+ export const GATEWAY_PLURAL = "gateways";
17
+ export const CLAIM_API_GROUP = "extensions.agents.x-k8s.io";
18
+ export const CLAIM_API_VERSION = "v1beta1";
19
+ export const CLAIM_PLURAL_NAME = "sandboxclaims";
20
+ export const SANDBOX_API_GROUP = "agents.x-k8s.io";
21
+ export const SANDBOX_API_VERSION = "v1beta1";
22
+ export const SANDBOX_PLURAL_NAME = "sandboxes";
23
+ export const POD_NAME_ANNOTATION = "agents.x-k8s.io/pod-name";
24
+ // Total attempt count for idempotent operations (matches Go client's maxAttempts=6).
25
+ // With the loop `for (let attempt = 0; attempt < MAX_RETRIES; attempt++)` this gives
26
+ // attempts 0–5, i.e. up to 5 retries after the first attempt.
27
+ // Non-idempotent callers (POST /execute, /upload, /agent) pass maxRetries: 1 explicitly.
28
+ export const MAX_RETRIES = 6;
29
+ export const BACKOFF_FACTOR = 0.5;
30
+ // Upper cap for per-retry backoff delay. Without this clamp the delay would
31
+ // grow unbounded as attempt increases (0.5s, 1s, 2s, 4s, 8s, 16s, ...).
32
+ // Matches the Go client's maxBackoff (clients/go/sandbox/connector.go).
33
+ // Kept intentionally below the Python client's urllib3 default (120s) because
34
+ // a 60s per-attempt timeout means any single retry delay > ~8s is already
35
+ // comparable in duration to a full attempt, at which point additional waiting
36
+ // rarely helps and exceeds most callers' overall timeout budget.
37
+ export const MAX_BACKOFF_MS = 8000;
38
+ export const RETRY_STATUS_CODES = [500, 502, 503, 504];
39
+ // Maximum bytes to drain from a response body before retrying (allows TCP connection reuse)
40
+ export const MAX_DRAIN_BYTES = 4096;
41
+ // Maximum bytes of response body to include in SandboxRequestError.body
42
+ export const MAX_ERROR_BODY_BYTES = 512;
43
+ // Number of port-forward reconnect attempts before giving up
44
+ export const MAX_RECONNECT_ATTEMPTS = 3;
45
+ // Default per-attempt timeout in milliseconds (independent of the overall request timeout).
46
+ // Matches Go client's defaultPerAttemptTimeout = 60s. Overridable via
47
+ // SandboxClientOptions.perAttemptTimeoutMs or per-request options.
48
+ export const PER_ATTEMPT_TIMEOUT_MS = 60_000;
49
+ // Header name used to propagate a per-request correlation ID (matches Go client).
50
+ export const HEADER_REQUEST_ID = "X-Request-ID";
51
+ // Maximum number of gateway watch reconnects within a single waitForGatewayIp call
52
+ export const MAX_GATEWAY_REWATCH = 10;
53
+ // Maximum time (ms) for the TCP connectivity probe after gateway IP resolution.
54
+ // The gateway may report an IP before the proxy (e.g. Envoy) is ready to accept connections.
55
+ export const GATEWAY_PROBE_TIMEOUT_MS = 30_000;
56
+ // Interval (ms) between TCP connectivity probe attempts.
57
+ export const GATEWAY_PROBE_INTERVAL_MS = 500;
58
+ // Maximum time (ms) allowed for cleanup operations (claim deletion, in-flight drain)
59
+ export const CLEANUP_TIMEOUT_MS = 5_000;
60
+ // Response / request size limits (matches Go client constants)
61
+ export const MAX_EXECUTION_RESPONSE_SIZE = 16 * 1024 * 1024; // 16 MB: run/agent stdout+stderr
62
+ export const MAX_METADATA_RESPONSE_SIZE = 8 * 1024 * 1024; // 8 MB: list/exists JSON
63
+ export const MAX_DOWNLOAD_SIZE = 256 * 1024 * 1024; // 256 MB: file download
64
+ export const MAX_UPLOAD_SIZE = 256 * 1024 * 1024; // 256 MB: file upload (pre-check)
65
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,iDAAiD;AACjD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,MAAM,CAAC,MAAM,iBAAiB,GAAG,2BAA2B,CAAC;AAC7D,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAC;AACxC,MAAM,CAAC,MAAM,cAAc,GAAG,UAAU,CAAC;AAEzC,MAAM,CAAC,MAAM,eAAe,GAAG,4BAA4B,CAAC;AAC5D,MAAM,CAAC,MAAM,iBAAiB,GAAG,SAAS,CAAC;AAC3C,MAAM,CAAC,MAAM,iBAAiB,GAAG,eAAe,CAAC;AAEjD,MAAM,CAAC,MAAM,iBAAiB,GAAG,iBAAiB,CAAC;AACnD,MAAM,CAAC,MAAM,mBAAmB,GAAG,SAAS,CAAC;AAC7C,MAAM,CAAC,MAAM,mBAAmB,GAAG,WAAW,CAAC;AAE/C,MAAM,CAAC,MAAM,mBAAmB,GAAG,0BAA0B,CAAC;AA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,0BAA0B;AACrF,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC,wBAAwB;AAC5E,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC,kCAAkC"}
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Base class for all sandbox-related errors.
3
+ */
4
+ export declare class SandboxError extends Error {
5
+ constructor(message: string, options?: ErrorOptions);
6
+ }
7
+ /**
8
+ * Raised when the sandbox is not ready for communication.
9
+ */
10
+ export declare class SandboxNotReadyError extends SandboxError {
11
+ }
12
+ /**
13
+ * Raised when the sandbox or sandbox claim cannot be found or was deleted.
14
+ */
15
+ export declare class SandboxNotFoundError extends SandboxError {
16
+ }
17
+ /**
18
+ * Raised when the port-forward process crashes.
19
+ */
20
+ export declare class SandboxPortForwardError extends SandboxError {
21
+ }
22
+ /**
23
+ * Raised when the sandbox object is missing expected metadata.
24
+ */
25
+ export declare class SandboxMetadataError extends SandboxError {
26
+ }
27
+ /**
28
+ * Raised when an operation times out waiting for a sandbox resource.
29
+ */
30
+ export declare class SandboxTimeoutError extends SandboxError {
31
+ }
32
+ /**
33
+ * Raised when the SandboxTemplate referenced by the WarmPool does not exist.
34
+ */
35
+ export declare class SandboxTemplateNotFoundError extends SandboxError {
36
+ }
37
+ /**
38
+ * Raised when the referenced SandboxWarmPool does not exist.
39
+ */
40
+ export declare class SandboxWarmPoolNotFoundError extends SandboxError {
41
+ }
42
+ /**
43
+ * Raised when an HTTP request to the sandbox fails.
44
+ */
45
+ export declare class SandboxRequestError extends SandboxError {
46
+ readonly statusCode: number | undefined;
47
+ readonly response: Response | undefined;
48
+ readonly body: string | undefined;
49
+ readonly operation: string | undefined;
50
+ constructor(message: string, options?: ErrorOptions & {
51
+ statusCode?: number;
52
+ response?: Response;
53
+ body?: string;
54
+ operation?: string;
55
+ });
56
+ }
57
+ /**
58
+ * Raised when a response body exceeds the configured size limit.
59
+ */
60
+ export declare class SandboxResponseTooLargeError extends SandboxRequestError {
61
+ }
62
+ /**
63
+ * Returns true if the error is a Kubernetes 404 (Not Found).
64
+ * Handles both @kubernetes/client-node ApiException (.code / .statusCode).
65
+ */
66
+ export declare function isK8s404(err: unknown): boolean;
67
+ //# sourceMappingURL=exceptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exceptions.d.ts","sourceRoot":"","sources":["../src/exceptions.ts"],"names":[],"mappings":"AAcA;;GAEG;AACH,qBAAa,YAAa,SAAQ,KAAK;gBACzB,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY;CAIpD;AAED;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,YAAY;CAAG;AAEzD;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,YAAY;CAAG;AAEzD;;GAEG;AACH,qBAAa,uBAAwB,SAAQ,YAAY;CAAG;AAE5D;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,YAAY;CAAG;AAEzD;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,YAAY;CAAG;AAExD;;GAEG;AACH,qBAAa,4BAA6B,SAAQ,YAAY;CAAG;AAEjE;;GAEG;AACH,qBAAa,4BAA6B,SAAQ,YAAY;CAAG;AAEjE;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,YAAY;IACnD,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,GAAG,SAAS,CAAC;IACxC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;gBAGrC,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,YAAY,GAAG;QACvB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,QAAQ,CAAC,EAAE,QAAQ,CAAC;QACpB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB;CAQJ;AAED;;GAEG;AACH,qBAAa,4BAA6B,SAAQ,mBAAmB;CAAG;AAExE;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAM9C"}
@@ -0,0 +1,91 @@
1
+ // Copyright 2025 The Kubernetes Authors.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+ /**
15
+ * Base class for all sandbox-related errors.
16
+ */
17
+ export class SandboxError extends Error {
18
+ constructor(message, options) {
19
+ super(message, options);
20
+ this.name = this.constructor.name;
21
+ }
22
+ }
23
+ /**
24
+ * Raised when the sandbox is not ready for communication.
25
+ */
26
+ export class SandboxNotReadyError extends SandboxError {
27
+ }
28
+ /**
29
+ * Raised when the sandbox or sandbox claim cannot be found or was deleted.
30
+ */
31
+ export class SandboxNotFoundError extends SandboxError {
32
+ }
33
+ /**
34
+ * Raised when the port-forward process crashes.
35
+ */
36
+ export class SandboxPortForwardError extends SandboxError {
37
+ }
38
+ /**
39
+ * Raised when the sandbox object is missing expected metadata.
40
+ */
41
+ export class SandboxMetadataError extends SandboxError {
42
+ }
43
+ /**
44
+ * Raised when an operation times out waiting for a sandbox resource.
45
+ */
46
+ export class SandboxTimeoutError extends SandboxError {
47
+ }
48
+ /**
49
+ * Raised when the SandboxTemplate referenced by the WarmPool does not exist.
50
+ */
51
+ export class SandboxTemplateNotFoundError extends SandboxError {
52
+ }
53
+ /**
54
+ * Raised when the referenced SandboxWarmPool does not exist.
55
+ */
56
+ export class SandboxWarmPoolNotFoundError extends SandboxError {
57
+ }
58
+ /**
59
+ * Raised when an HTTP request to the sandbox fails.
60
+ */
61
+ export class SandboxRequestError extends SandboxError {
62
+ statusCode;
63
+ response;
64
+ body;
65
+ operation;
66
+ constructor(message, options) {
67
+ super(message, options);
68
+ this.statusCode = options?.statusCode;
69
+ this.response = options?.response;
70
+ this.body = options?.body;
71
+ this.operation = options?.operation;
72
+ }
73
+ }
74
+ /**
75
+ * Raised when a response body exceeds the configured size limit.
76
+ */
77
+ export class SandboxResponseTooLargeError extends SandboxRequestError {
78
+ }
79
+ /**
80
+ * Returns true if the error is a Kubernetes 404 (Not Found).
81
+ * Handles both @kubernetes/client-node ApiException (.code / .statusCode).
82
+ */
83
+ export function isK8s404(err) {
84
+ if (typeof err === "object" && err !== null) {
85
+ const candidate = err;
86
+ if (candidate.code === 404 || candidate.statusCode === 404)
87
+ return true;
88
+ }
89
+ return false;
90
+ }
91
+ //# sourceMappingURL=exceptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exceptions.js","sourceRoot":"","sources":["../src/exceptions.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,iDAAiD;AACjD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,KAAK;IACrC,YAAY,OAAe,EAAE,OAAsB;QACjD,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;IACpC,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,oBAAqB,SAAQ,YAAY;CAAG;AAEzD;;GAEG;AACH,MAAM,OAAO,oBAAqB,SAAQ,YAAY;CAAG;AAEzD;;GAEG;AACH,MAAM,OAAO,uBAAwB,SAAQ,Y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