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

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 (126) hide show
  1. package/CHANGELOG.md +29 -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/package.json +3 -3
  67. package/dist/sandbox/firecracker.d.ts +0 -18
  68. package/dist/sandbox/firecracker.d.ts.map +0 -1
  69. package/dist/sandbox/firecracker.js +0 -222
  70. package/dist/sandbox/firecracker.js.map +0 -1
  71. package/dist/sandbox/gondolin-bootstrap.d.ts +0 -26
  72. package/dist/sandbox/gondolin-bootstrap.d.ts.map +0 -1
  73. package/dist/sandbox/gondolin-bootstrap.js +0 -27
  74. package/dist/sandbox/gondolin-bootstrap.js.map +0 -1
  75. package/dist/sandbox/gondolin-contract.d.ts +0 -125
  76. package/dist/sandbox/gondolin-contract.d.ts.map +0 -1
  77. package/dist/sandbox/gondolin-contract.js +0 -155
  78. package/dist/sandbox/gondolin-contract.js.map +0 -1
  79. package/dist/sandbox/gondolin-fleet.d.ts +0 -104
  80. package/dist/sandbox/gondolin-fleet.d.ts.map +0 -1
  81. package/dist/sandbox/gondolin-fleet.js +0 -330
  82. package/dist/sandbox/gondolin-fleet.js.map +0 -1
  83. package/dist/sandbox/gondolin-gateway.d.ts +0 -86
  84. package/dist/sandbox/gondolin-gateway.d.ts.map +0 -1
  85. package/dist/sandbox/gondolin-gateway.js +0 -407
  86. package/dist/sandbox/gondolin-gateway.js.map +0 -1
  87. package/dist/sandbox/gondolin-inventory.d.ts +0 -75
  88. package/dist/sandbox/gondolin-inventory.d.ts.map +0 -1
  89. package/dist/sandbox/gondolin-inventory.js +0 -257
  90. package/dist/sandbox/gondolin-inventory.js.map +0 -1
  91. package/dist/sandbox/gondolin-join.d.ts +0 -62
  92. package/dist/sandbox/gondolin-join.d.ts.map +0 -1
  93. package/dist/sandbox/gondolin-join.js +0 -261
  94. package/dist/sandbox/gondolin-join.js.map +0 -1
  95. package/dist/sandbox/gondolin-nfs-advisory.d.ts +0 -15
  96. package/dist/sandbox/gondolin-nfs-advisory.d.ts.map +0 -1
  97. package/dist/sandbox/gondolin-nfs-advisory.js +0 -60
  98. package/dist/sandbox/gondolin-nfs-advisory.js.map +0 -1
  99. package/dist/sandbox/gondolin-placement.d.ts +0 -30
  100. package/dist/sandbox/gondolin-placement.d.ts.map +0 -1
  101. package/dist/sandbox/gondolin-placement.js +0 -77
  102. package/dist/sandbox/gondolin-placement.js.map +0 -1
  103. package/dist/sandbox/gondolin-recovery.d.ts +0 -33
  104. package/dist/sandbox/gondolin-recovery.d.ts.map +0 -1
  105. package/dist/sandbox/gondolin-recovery.js +0 -39
  106. package/dist/sandbox/gondolin-recovery.js.map +0 -1
  107. package/dist/sandbox/gondolin-remote.d.ts +0 -70
  108. package/dist/sandbox/gondolin-remote.d.ts.map +0 -1
  109. package/dist/sandbox/gondolin-remote.js +0 -325
  110. package/dist/sandbox/gondolin-remote.js.map +0 -1
  111. package/dist/sandbox/gondolin-worker-client.d.ts +0 -135
  112. package/dist/sandbox/gondolin-worker-client.d.ts.map +0 -1
  113. package/dist/sandbox/gondolin-worker-client.js +0 -323
  114. package/dist/sandbox/gondolin-worker-client.js.map +0 -1
  115. package/dist/sandbox/gondolin-worker-main.d.ts +0 -2
  116. package/dist/sandbox/gondolin-worker-main.d.ts.map +0 -1
  117. package/dist/sandbox/gondolin-worker-main.js +0 -22
  118. package/dist/sandbox/gondolin-worker-main.js.map +0 -1
  119. package/dist/sandbox/gondolin-worker.d.ts +0 -17
  120. package/dist/sandbox/gondolin-worker.d.ts.map +0 -1
  121. package/dist/sandbox/gondolin-worker.js +0 -201
  122. package/dist/sandbox/gondolin-worker.js.map +0 -1
  123. package/dist/sandbox/gondolin.d.ts +0 -53
  124. package/dist/sandbox/gondolin.d.ts.map +0 -1
  125. package/dist/sandbox/gondolin.js +0 -430
  126. 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;;;;;;;;GAQG;AACH,MAAM,MAAM,kBAAkB,GAAG,YAAY,GAAG,cAAc,CAAC;AAE/D,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,gBAAgB,CAA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,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,cAAc,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAID,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,QAAQ,GAAG,qBAAqB,GAAG,sBAAsB,CAAC;AAElG,MAAM,MAAM,aAAa,GAAG;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnG;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,KAAK,EAAE;IACnC,KAAK,EAAE,iBAAiB,CAAC;IACzB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;CACzB,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC"}
package/dist/types.js.map CHANGED
@@ -1 +1 @@
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 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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geminixiang/mikan",
3
- "version": "1.0.0-beta.22",
3
+ "version": "1.0.0-beta.23",
4
4
  "description": "Multi-platform AI coding agent for Slack, Telegram, and Discord",
5
5
  "keywords": [
6
6
  "agent",
@@ -43,19 +43,19 @@
43
43
  "test:e2e": "vitest --run --config vitest.e2e.config.ts",
44
44
  "test:e2e:slack": "vitest --run --config vitest.e2e.config.ts e2e/slack",
45
45
  "test:e2e:slack:coverage": "vitest --run --coverage --coverage.reportsDirectory=.workspace/coverage --config vitest.e2e.config.ts e2e/slack",
46
- "gondolin:image:build": "sh scripts/build-gondolin-image.sh",
47
46
  "docs:dev": "astro dev",
48
47
  "docs:build": "astro build",
49
48
  "docs:preview": "astro preview"
50
49
  },
51
50
  "dependencies": {
52
- "@earendil-works/gondolin": "0.12.0",
53
51
  "@earendil-works/pi-agent-core": "^0.80.6",
54
52
  "@earendil-works/pi-ai": "^0.80.6",
53
+ "@kubernetes/client-node": "^1.0.0",
55
54
  "@sentry/node": "^10.60.0",
56
55
  "@sinclair/typebox": "^0.34.49",
57
56
  "@slack/socket-mode": "^2.0.7",
58
57
  "@slack/web-api": "^7.17.0",
58
+ "agentic-sandbox-client": "file:vendor/agent-sandbox-sdk/agentic-sandbox-client-0.1.0.tgz",
59
59
  "chalk": "^5.6.2",
60
60
  "croner": "^10.0.1",
61
61
  "diff": "^9.0.0",
@@ -1,18 +0,0 @@
1
- import type { ExecOptions, ExecResult, Executor, FirecrackerSandboxConfig, RuntimePathContext, SandboxAdapter } from "./types.js";
2
- export declare class FirecrackerExecutor implements Executor {
3
- private vmId;
4
- private hostPath;
5
- private sshUser;
6
- private sshPort;
7
- private env?;
8
- constructor(vmId: string, hostPath: string, sshUser?: string, sshPort?: number, env?: Record<string, string> | undefined);
9
- exec(command: string, options?: ExecOptions): Promise<ExecResult>;
10
- readFile(path: string, options?: ExecOptions): Promise<string>;
11
- readFileBase64(path: string, options?: ExecOptions): Promise<string>;
12
- writeFile(path: string, content: string, options?: ExecOptions): Promise<void>;
13
- getWorkspacePath(_hostPath: string): string;
14
- getPathContext(hostWorkspaceRoot: string): RuntimePathContext;
15
- getSandboxConfig(): FirecrackerSandboxConfig;
16
- }
17
- export declare const firecrackerSandboxAdapter: SandboxAdapter<FirecrackerSandboxConfig>;
18
- //# sourceMappingURL=firecracker.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"firecracker.d.ts","sourceRoot":"","sources":["../../src/sandbox/firecracker.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,WAAW,EACX,UAAU,EACV,QAAQ,EACR,wBAAwB,EACxB,kBAAkB,EAClB,cAAc,EACf,MAAM,YAAY,CAAC;AA2FpB,qBAAa,mBAAoB,YAAW,QAAQ;IAEhD,OAAO,CAAC,IAAI;IACZ,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,GAAG,CAAC;IALd,YACU,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,MAAe,EACxB,OAAO,GAAE,MAAW,EACpB,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,YAAA,EAClC;IAEE,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,CAqGtE;IAED,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CAE7D;IAED,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CAEnE;IAED,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAE7E;IAED,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAE1C;IAED,cAAc,CAAC,iBAAiB,EAAE,MAAM,GAAG,kBAAkB,CAK5D;IAED,gBAAgB,IAAI,wBAAwB,CAQ3C;CACF;AAgBD,eAAO,MAAM,yBAAyB,EAAE,cAAc,CAAC,wBAAwB,CAO9E,CAAC"}
@@ -1,222 +0,0 @@
1
- import { spawn } from "child_process";
2
- import { SandboxError } from "./errors.js";
3
- import { HostExecutor } from "./host.js";
4
- import { execReadFile, execReadFileBase64, execWriteFile, execSimple, killProcessTree, shellEscape, } from "./utils.js";
5
- function parseFirecrackerSandboxArg(value) {
6
- if (!value.startsWith("firecracker:")) {
7
- return undefined;
8
- }
9
- const arg = value.slice("firecracker:".length);
10
- // Format: firecracker:<vm-id>:<host-path>[:<ssh-user>[:<ssh-port>]]
11
- // Example: firecracker:vm1:/home/user/workspace
12
- // firecracker:vm1:/home/user/workspace:root
13
- // firecracker:vm1:/home/user/workspace:root:22
14
- const parts = arg.split(":");
15
- if (parts.length < 2) {
16
- throw new SandboxError("Error: firecracker sandbox requires vm-id and host-path\n" +
17
- "Usage: firecracker:<vm-id>:<host-path>[:<ssh-user>[:<ssh-port>]]\n" +
18
- "Example: firecracker:vm1:/home/user/workspace");
19
- }
20
- const vmId = parts[0];
21
- const hostPath = parts[1];
22
- const sshUser = parts[2] || "root";
23
- const sshPort = parts[3] ? parseInt(parts[3], 10) : 22;
24
- if (!vmId || !hostPath) {
25
- throw new SandboxError("Error: firecracker sandbox requires vm-id and host-path");
26
- }
27
- if (isNaN(sshPort) || sshPort <= 0 || sshPort > 65535) {
28
- throw new SandboxError("Error: invalid SSH port");
29
- }
30
- return { type: "firecracker", vmId, hostPath, sshUser, sshPort };
31
- }
32
- async function validateFirecrackerSandbox(config) {
33
- // Check if fc-agent or firecracker CLI is available
34
- try {
35
- await execSimple("fc-agent", ["--version"]);
36
- }
37
- catch {
38
- // Try alternative: firecracker
39
- try {
40
- await execSimple("firecracker", ["--version"]);
41
- }
42
- catch {
43
- throw new SandboxError("Error: Firecracker tools (fc-agent or firecracker) not found in PATH", ["Install firecracker: https://github.com/firecracker-microvm/firecracker"]);
44
- }
45
- }
46
- // Check if VM is running using fc-agent
47
- try {
48
- const result = await execSimple("fc-agent", ["status", config.vmId]);
49
- if (!result.includes("running") && !result.includes("Running")) {
50
- throw new SandboxError(`Error: Firecracker VM '${config.vmId}' is not running.`, [
51
- `Start it with: fc-agent start ${config.vmId}`,
52
- ]);
53
- }
54
- }
55
- catch (error) {
56
- if (error instanceof SandboxError) {
57
- throw error;
58
- }
59
- // Try alternative: firecracker-ctl or direct check
60
- try {
61
- await execSimple("firecracker-ctl", ["status", config.vmId]);
62
- }
63
- catch {
64
- console.error(`Warning: Could not verify if VM '${config.vmId}' is running.`);
65
- console.error("Make sure the VM is started before running mikan.");
66
- }
67
- }
68
- // Verify host path exists
69
- try {
70
- await execSimple("ls", ["-d", config.hostPath]);
71
- }
72
- catch {
73
- throw new SandboxError(`Error: Host path '${config.hostPath}' does not exist.`);
74
- }
75
- console.log(` Firecracker VM '${config.vmId}' configured with workspace '${config.hostPath}'.`);
76
- }
77
- export class FirecrackerExecutor {
78
- constructor(vmId, hostPath, sshUser = "root", sshPort = 22, env) {
79
- this.vmId = vmId;
80
- this.hostPath = hostPath;
81
- this.sshUser = sshUser;
82
- this.sshPort = sshPort;
83
- this.env = env;
84
- }
85
- async exec(command, options) {
86
- if (!this.env || Object.keys(this.env).length === 0) {
87
- const sshCmd = this.sshPort === 22
88
- ? `ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 ${this.sshUser}@${this.vmId} sh -c ${shellEscape(command)}`
89
- : `ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 -p ${this.sshPort} ${this.sshUser}@${this.vmId} sh -c ${shellEscape(command)}`;
90
- const hostExecutor = new HostExecutor();
91
- return hostExecutor.exec(sshCmd, options);
92
- }
93
- return new Promise((resolve, reject) => {
94
- const sshArgs = ["-o", "StrictHostKeyChecking=no", "-o", "ConnectTimeout=10"];
95
- if (this.sshPort !== 22) {
96
- sshArgs.push("-p", String(this.sshPort));
97
- }
98
- sshArgs.push(`${this.sshUser}@${this.vmId}`, "sh", "-se");
99
- const child = spawn("ssh", sshArgs, {
100
- detached: true,
101
- stdio: ["pipe", "pipe", "pipe"],
102
- });
103
- let stdout = "";
104
- let stderr = "";
105
- let timedOut = false;
106
- let settled = false;
107
- const timeoutHandle = options?.timeout && options.timeout > 0
108
- ? setTimeout(() => {
109
- timedOut = true;
110
- if (child.pid)
111
- killProcessTree(child.pid);
112
- }, options.timeout * 1000)
113
- : undefined;
114
- const onAbort = () => {
115
- if (child.pid)
116
- killProcessTree(child.pid);
117
- };
118
- if (options?.signal) {
119
- if (options.signal.aborted) {
120
- onAbort();
121
- }
122
- else {
123
- options.signal.addEventListener("abort", onAbort, { once: true });
124
- }
125
- }
126
- child.on("error", (error) => {
127
- if (settled)
128
- return;
129
- settled = true;
130
- if (timeoutHandle)
131
- clearTimeout(timeoutHandle);
132
- if (options?.signal) {
133
- options.signal.removeEventListener("abort", onAbort);
134
- }
135
- reject(error);
136
- });
137
- child.stdout?.on("data", (data) => {
138
- stdout += data.toString();
139
- if (stdout.length > 10 * 1024 * 1024) {
140
- stdout = stdout.slice(0, 10 * 1024 * 1024);
141
- }
142
- });
143
- child.stderr?.on("data", (data) => {
144
- stderr += data.toString();
145
- if (stderr.length > 10 * 1024 * 1024) {
146
- stderr = stderr.slice(0, 10 * 1024 * 1024);
147
- }
148
- });
149
- child.stdin?.on("error", (error) => {
150
- stderr += `${error.message}\n`;
151
- });
152
- child.stdin?.end(buildRemoteScript(command, this.env));
153
- child.on("close", (code) => {
154
- if (settled)
155
- return;
156
- settled = true;
157
- if (timeoutHandle)
158
- clearTimeout(timeoutHandle);
159
- if (options?.signal) {
160
- options.signal.removeEventListener("abort", onAbort);
161
- }
162
- if (options?.signal?.aborted) {
163
- reject(new Error(`${stdout}\n${stderr}\nCommand aborted`.trim()));
164
- return;
165
- }
166
- if (timedOut) {
167
- reject(new Error(`${stdout}\n${stderr}\nCommand timed out after ${options?.timeout} seconds`.trim()));
168
- return;
169
- }
170
- resolve({ stdout, stderr, code: code ?? 0 });
171
- });
172
- });
173
- }
174
- readFile(path, options) {
175
- return execReadFile(this, path, options);
176
- }
177
- readFileBase64(path, options) {
178
- return execReadFileBase64(this, path, options);
179
- }
180
- writeFile(path, content, options) {
181
- return execWriteFile(this, path, content, options);
182
- }
183
- getWorkspacePath(_hostPath) {
184
- return "/workspace";
185
- }
186
- getPathContext(hostWorkspaceRoot) {
187
- return {
188
- hostWorkspaceRoot,
189
- runtimeWorkspaceRoot: "/workspace",
190
- };
191
- }
192
- getSandboxConfig() {
193
- return {
194
- type: "firecracker",
195
- vmId: this.vmId,
196
- hostPath: this.hostPath,
197
- sshUser: this.sshUser,
198
- sshPort: this.sshPort,
199
- };
200
- }
201
- }
202
- function buildRemoteScript(command, env) {
203
- const exports = env
204
- ? Object.entries(env)
205
- .map(([key, value]) => {
206
- if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(key)) {
207
- throw new SandboxError(`Invalid environment variable name for firecracker: ${key}`);
208
- }
209
- return `export ${key}=${shellEscape(value)}`;
210
- })
211
- .join("\n") + "\n"
212
- : "";
213
- return `${exports}${command}\n`;
214
- }
215
- export const firecrackerSandboxAdapter = {
216
- type: "firecracker",
217
- credentials: { env: true, fileMounts: false },
218
- parse: parseFirecrackerSandboxArg,
219
- validate: validateFirecrackerSandbox,
220
- createExecutor: (config, env) => new FirecrackerExecutor(config.vmId, config.hostPath, config.sshUser, config.sshPort, env),
221
- };
222
- //# sourceMappingURL=firecracker.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"firecracker.js","sourceRoot":"","sources":["../../src/sandbox/firecracker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAStC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,UAAU,EACV,eAAe,EACf,WAAW,GACZ,MAAM,YAAY,CAAC;AAEpB,SAAS,0BAA0B,CAAC,KAAa;IAC/C,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE,CAAC;QACtC,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;IAC/C,oEAAoE;IACpE,gDAAgD;IAChD,qDAAqD;IACrD,wDAAwD;IACxD,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC7B,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACrB,MAAM,IAAI,YAAY,CACpB,2DAA2D;YACzD,oEAAoE;YACpE,+CAA+C,CAClD,CAAC;IACJ,CAAC;IACD,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IACtB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E,IAAI,CAAC,OAAO;SACtB,CAAC;IACJ,CAAC;CACF;AAED,SAAS,iBAAiB,CAAC,OAAe,EAAE,GAA4B;IACtE,MAAM,OAAO,GAAG,GAAG;QACjB,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC;aAChB,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;YACpB,IAAI,CAAC,0BAA0B,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC1C,MAAM,IAAI,YAAY,CAAC,sDAAsD,GAAG,EAAE,CAAC,CAAC;YACtF,CAAC;YACD,OAAO,UAAU,GAAG,IAAI,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;QAC/C,CAAC,CAAC;aACD,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI;QACtB,CAAC,CAAC,EAAE,CAAC;IACP,OAAO,GAAG,OAAO,GAAG,OAAO,IAAI,CAAC;AAClC,CAAC;AAED,MAAM,CAAC,MAAM,yBAAyB,GAA6C;IACjF,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE;IAC7C,KAAK,EAAE,0BAA0B;IACjC,QAAQ,EAAE,0BAA0B;IACpC,cAAc,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE,CAC9B,IAAI,mBAAmB,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC;CAC7F,CAAC","sourcesContent":["import { spawn } from \"child_process\";\nimport type {\n ExecOptions,\n ExecResult,\n Executor,\n FirecrackerSandboxConfig,\n RuntimePathContext,\n SandboxAdapter,\n} from \"./types.js\";\nimport { SandboxError } from \"./errors.js\";\nimport { HostExecutor } from \"./host.js\";\nimport {\n execReadFile,\n execReadFileBase64,\n execWriteFile,\n execSimple,\n killProcessTree,\n shellEscape,\n} from \"./utils.js\";\n\nfunction parseFirecrackerSandboxArg(value: string): FirecrackerSandboxConfig | undefined {\n if (!value.startsWith(\"firecracker:\")) {\n return undefined;\n }\n\n const arg = value.slice(\"firecracker:\".length);\n // Format: firecracker:<vm-id>:<host-path>[:<ssh-user>[:<ssh-port>]]\n // Example: firecracker:vm1:/home/user/workspace\n // firecracker:vm1:/home/user/workspace:root\n // firecracker:vm1:/home/user/workspace:root:22\n const parts = arg.split(\":\");\n if (parts.length < 2) {\n throw new SandboxError(\n \"Error: firecracker sandbox requires vm-id and host-path\\n\" +\n \"Usage: firecracker:<vm-id>:<host-path>[:<ssh-user>[:<ssh-port>]]\\n\" +\n \"Example: firecracker:vm1:/home/user/workspace\",\n );\n }\n const vmId = parts[0];\n const hostPath = parts[1];\n const sshUser = parts[2] || \"root\";\n const sshPort = parts[3] ? parseInt(parts[3], 10) : 22;\n\n if (!vmId || !hostPath) {\n throw new SandboxError(\"Error: firecracker sandbox requires vm-id and host-path\");\n }\n if (isNaN(sshPort) || sshPort <= 0 || sshPort > 65535) {\n throw new SandboxError(\"Error: invalid SSH port\");\n }\n return { type: \"firecracker\", vmId, hostPath, sshUser, sshPort };\n}\n\nasync function validateFirecrackerSandbox(config: FirecrackerSandboxConfig): Promise<void> {\n // Check if fc-agent or firecracker CLI is available\n try {\n await execSimple(\"fc-agent\", [\"--version\"]);\n } catch {\n // Try alternative: firecracker\n try {\n await execSimple(\"firecracker\", [\"--version\"]);\n } catch {\n throw new SandboxError(\n \"Error: Firecracker tools (fc-agent or firecracker) not found in PATH\",\n [\"Install firecracker: https://github.com/firecracker-microvm/firecracker\"],\n );\n }\n }\n\n // Check if VM is running using fc-agent\n try {\n const result = await execSimple(\"fc-agent\", [\"status\", config.vmId]);\n if (!result.includes(\"running\") && !result.includes(\"Running\")) {\n throw new SandboxError(`Error: Firecracker VM '${config.vmId}' is not running.`, [\n `Start it with: fc-agent start ${config.vmId}`,\n ]);\n }\n } catch (error) {\n if (error instanceof SandboxError) {\n throw error;\n }\n // Try alternative: firecracker-ctl or direct check\n try {\n await execSimple(\"firecracker-ctl\", [\"status\", config.vmId]);\n } catch {\n console.error(`Warning: Could not verify if VM '${config.vmId}' is running.`);\n console.error(\"Make sure the VM is started before running mikan.\");\n }\n }\n\n // Verify host path exists\n try {\n await execSimple(\"ls\", [\"-d\", config.hostPath]);\n } catch {\n throw new SandboxError(`Error: Host path '${config.hostPath}' does not exist.`);\n }\n\n console.log(` Firecracker VM '${config.vmId}' configured with workspace '${config.hostPath}'.`);\n}\n\nexport class FirecrackerExecutor implements Executor {\n constructor(\n private vmId: string,\n private hostPath: string,\n private sshUser: string = \"root\",\n private sshPort: number = 22,\n private env?: Record<string, string>,\n ) {}\n\n async exec(command: string, options?: ExecOptions): Promise<ExecResult> {\n if (!this.env || Object.keys(this.env).length === 0) {\n const sshCmd =\n this.sshPort === 22\n ? `ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 ${this.sshUser}@${this.vmId} sh -c ${shellEscape(command)}`\n : `ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 -p ${this.sshPort} ${this.sshUser}@${this.vmId} sh -c ${shellEscape(command)}`;\n const hostExecutor = new HostExecutor();\n return hostExecutor.exec(sshCmd, options);\n }\n\n return new Promise((resolve, reject) => {\n const sshArgs = [\"-o\", \"StrictHostKeyChecking=no\", \"-o\", \"ConnectTimeout=10\"];\n if (this.sshPort !== 22) {\n sshArgs.push(\"-p\", String(this.sshPort));\n }\n sshArgs.push(`${this.sshUser}@${this.vmId}`, \"sh\", \"-se\");\n\n const child = spawn(\"ssh\", sshArgs, {\n detached: true,\n stdio: [\"pipe\", \"pipe\", \"pipe\"],\n });\n\n let stdout = \"\";\n let stderr = \"\";\n let timedOut = false;\n let settled = false;\n\n const timeoutHandle =\n options?.timeout && options.timeout > 0\n ? setTimeout(() => {\n timedOut = true;\n if (child.pid) killProcessTree(child.pid);\n }, options.timeout * 1000)\n : undefined;\n\n const onAbort = () => {\n if (child.pid) killProcessTree(child.pid);\n };\n\n if (options?.signal) {\n if (options.signal.aborted) {\n onAbort();\n } else {\n options.signal.addEventListener(\"abort\", onAbort, { once: true });\n }\n }\n\n child.on(\"error\", (error) => {\n if (settled) return;\n settled = true;\n if (timeoutHandle) clearTimeout(timeoutHandle);\n if (options?.signal) {\n options.signal.removeEventListener(\"abort\", onAbort);\n }\n reject(error);\n });\n\n child.stdout?.on(\"data\", (data) => {\n stdout += data.toString();\n if (stdout.length > 10 * 1024 * 1024) {\n stdout = stdout.slice(0, 10 * 1024 * 1024);\n }\n });\n\n child.stderr?.on(\"data\", (data) => {\n stderr += data.toString();\n if (stderr.length > 10 * 1024 * 1024) {\n stderr = stderr.slice(0, 10 * 1024 * 1024);\n }\n });\n\n child.stdin?.on(\"error\", (error) => {\n stderr += `${error.message}\\n`;\n });\n child.stdin?.end(buildRemoteScript(command, this.env));\n\n child.on(\"close\", (code) => {\n if (settled) return;\n settled = true;\n if (timeoutHandle) clearTimeout(timeoutHandle);\n if (options?.signal) {\n options.signal.removeEventListener(\"abort\", onAbort);\n }\n\n if (options?.signal?.aborted) {\n reject(new Error(`${stdout}\\n${stderr}\\nCommand aborted`.trim()));\n return;\n }\n\n if (timedOut) {\n reject(\n new Error(\n `${stdout}\\n${stderr}\\nCommand timed out after ${options?.timeout} seconds`.trim(),\n ),\n );\n return;\n }\n\n resolve({ stdout, stderr, code: code ?? 0 });\n });\n });\n }\n\n readFile(path: string, options?: ExecOptions): Promise<string> {\n return execReadFile(this, path, options);\n }\n\n readFileBase64(path: string, options?: ExecOptions): Promise<string> {\n return execReadFileBase64(this, path, options);\n }\n\n writeFile(path: string, content: string, options?: ExecOptions): Promise<void> {\n return execWriteFile(this, path, content, options);\n }\n\n getWorkspacePath(_hostPath: string): string {\n return \"/workspace\";\n }\n\n getPathContext(hostWorkspaceRoot: string): RuntimePathContext {\n return {\n hostWorkspaceRoot,\n runtimeWorkspaceRoot: \"/workspace\",\n };\n }\n\n getSandboxConfig(): FirecrackerSandboxConfig {\n return {\n type: \"firecracker\",\n vmId: this.vmId,\n hostPath: this.hostPath,\n sshUser: this.sshUser,\n sshPort: this.sshPort,\n };\n }\n}\n\nfunction buildRemoteScript(command: string, env?: Record<string, string>): string {\n const exports = env\n ? Object.entries(env)\n .map(([key, value]) => {\n if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(key)) {\n throw new SandboxError(`Invalid environment variable name for firecracker: ${key}`);\n }\n return `export ${key}=${shellEscape(value)}`;\n })\n .join(\"\\n\") + \"\\n\"\n : \"\";\n return `${exports}${command}\\n`;\n}\n\nexport const firecrackerSandboxAdapter: SandboxAdapter<FirecrackerSandboxConfig> = {\n type: \"firecracker\",\n credentials: { env: true, fileMounts: false },\n parse: parseFirecrackerSandboxArg,\n validate: validateFirecrackerSandbox,\n createExecutor: (config, env) =>\n new FirecrackerExecutor(config.vmId, config.hostPath, config.sshUser, config.sshPort, env),\n};\n"]}
@@ -1,26 +0,0 @@
1
- import type { GondolinRemoteSettings, ResourceLimits } from "../types.js";
2
- export interface GondolinBootstrapOptions {
3
- /** Host-only state dir; inventory, placements, and gateway CA live under it. */
4
- stateDir: string;
5
- /** Default per-runtime resource limits. */
6
- limits?: ResourceLimits;
7
- /** Boosted limits applied while a runtime holds a boost. */
8
- boostLimits?: ResourceLimits;
9
- /** Remote fleet settings (workers, gateway); omit for local-only gondolin. */
10
- remote?: GondolinRemoteSettings;
11
- /**
12
- * Fail loudly when the remote profile is requested but no worker source is
13
- * configured, instead of discovering it on the first runtime ensure.
14
- */
15
- requireRemote?: boolean;
16
- }
17
- /**
18
- * Configure every gondolin runtime singleton for one process — resources,
19
- * inventory, placements, fleet, join, gateway — from one options object.
20
- * This is the managed-sandbox bootstrap seam: main.ts and embedders
21
- * (src/index.ts) call it before creating conversation runtimes with a
22
- * gondolin sandbox config; nothing else may call the individual configure()
23
- * methods outside tests.
24
- */
25
- export declare function configureGondolinRuntime(options: GondolinBootstrapOptions): void;
26
- //# sourceMappingURL=gondolin-bootstrap.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"gondolin-bootstrap.d.ts","sourceRoot":"","sources":["../../src/sandbox/gondolin-bootstrap.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAQ1E,MAAM,WAAW,wBAAwB;IACvC,gFAAgF;IAChF,QAAQ,EAAE,MAAM,CAAC;IACjB,2CAA2C;IAC3C,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,4DAA4D;IAC5D,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B,8EAA8E;IAC9E,MAAM,CAAC,EAAE,sBAAsB,CAAC;IAChC;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,wBAAwB,GAAG,IAAI,CAUhF"}
@@ -1,27 +0,0 @@
1
- import { join } from "node:path";
2
- import { assertRemoteConfigured, gondolinResources } from "./gondolin.js";
3
- import { gondolinFleet } from "./gondolin-fleet.js";
4
- import { gondolinGateway } from "./gondolin-gateway.js";
5
- import { gondolinInventory } from "./gondolin-inventory.js";
6
- import { gondolinJoin } from "./gondolin-join.js";
7
- import { gondolinPlacements } from "./gondolin-placement.js";
8
- /**
9
- * Configure every gondolin runtime singleton for one process — resources,
10
- * inventory, placements, fleet, join, gateway — from one options object.
11
- * This is the managed-sandbox bootstrap seam: main.ts and embedders
12
- * (src/index.ts) call it before creating conversation runtimes with a
13
- * gondolin sandbox config; nothing else may call the individual configure()
14
- * methods outside tests.
15
- */
16
- export function configureGondolinRuntime(options) {
17
- gondolinResources.configure(options.limits, options.boostLimits);
18
- gondolinInventory.configure(join(options.stateDir, "gondolin-runtimes"));
19
- gondolinPlacements.configure(join(options.stateDir, "gondolin-placement.json"));
20
- gondolinFleet.configure(options.remote);
21
- gondolinJoin.configure(join(options.stateDir, "gondolin-gateway"));
22
- gondolinGateway.configure(options.remote?.gateway);
23
- if (options.requireRemote) {
24
- assertRemoteConfigured();
25
- }
26
- }
27
- //# sourceMappingURL=gondolin-bootstrap.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"gondolin-bootstrap.js","sourceRoot":"","sources":["../../src/sandbox/gondolin-bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAkB7D;;;;;;;GAOG;AACH,MAAM,UAAU,wBAAwB,CAAC,OAAiC;IACxE,iBAAiB,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IACjE,iBAAiB,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,mBAAmB,CAAC,CAAC,CAAC;IACzE,kBAAkB,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,yBAAyB,CAAC,CAAC,CAAC;IAChF,aAAa,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACxC,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC,CAAC;IACnE,eAAe,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnD,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC;QAC1B,sBAAsB,EAAE,CAAC;IAC3B,CAAC;AACH,CAAC","sourcesContent":["import { join } from \"node:path\";\nimport type { GondolinRemoteSettings, ResourceLimits } from \"../types.js\";\nimport { assertRemoteConfigured, gondolinResources } from \"./gondolin.js\";\nimport { gondolinFleet } from \"./gondolin-fleet.js\";\nimport { gondolinGateway } from \"./gondolin-gateway.js\";\nimport { gondolinInventory } from \"./gondolin-inventory.js\";\nimport { gondolinJoin } from \"./gondolin-join.js\";\nimport { gondolinPlacements } from \"./gondolin-placement.js\";\n\nexport interface GondolinBootstrapOptions {\n /** Host-only state dir; inventory, placements, and gateway CA live under it. */\n stateDir: string;\n /** Default per-runtime resource limits. */\n limits?: ResourceLimits;\n /** Boosted limits applied while a runtime holds a boost. */\n boostLimits?: ResourceLimits;\n /** Remote fleet settings (workers, gateway); omit for local-only gondolin. */\n remote?: GondolinRemoteSettings;\n /**\n * Fail loudly when the remote profile is requested but no worker source is\n * configured, instead of discovering it on the first runtime ensure.\n */\n requireRemote?: boolean;\n}\n\n/**\n * Configure every gondolin runtime singleton for one process — resources,\n * inventory, placements, fleet, join, gateway — from one options object.\n * This is the managed-sandbox bootstrap seam: main.ts and embedders\n * (src/index.ts) call it before creating conversation runtimes with a\n * gondolin sandbox config; nothing else may call the individual configure()\n * methods outside tests.\n */\nexport function configureGondolinRuntime(options: GondolinBootstrapOptions): void {\n gondolinResources.configure(options.limits, options.boostLimits);\n gondolinInventory.configure(join(options.stateDir, \"gondolin-runtimes\"));\n gondolinPlacements.configure(join(options.stateDir, \"gondolin-placement.json\"));\n gondolinFleet.configure(options.remote);\n gondolinJoin.configure(join(options.stateDir, \"gondolin-gateway\"));\n gondolinGateway.configure(options.remote?.gateway);\n if (options.requireRemote) {\n assertRemoteConfigured();\n }\n}\n"]}