@bastani/atomic 0.9.32 → 0.9.33-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/builtin/intercom/package.json +1 -1
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/package.json +1 -1
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/builtin/workflows/CHANGELOG.md +6 -0
- package/dist/builtin/workflows/builtin/{chunk-bnz4knhy.js → chunk-0d0pd4fz.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-v4scsq3y.js → chunk-119gt64q.js} +54 -16
- package/dist/builtin/workflows/builtin/{chunk-9ywkdsa9.js → chunk-s7y3hw0n.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-dx5sjaxe.js → chunk-y68758re.js} +1 -1
- package/dist/builtin/workflows/builtin/goal.js +2 -2
- package/dist/builtin/workflows/builtin/index.js +3 -3
- package/dist/builtin/workflows/builtin/ralph.js +2 -2
- package/dist/builtin/workflows/package.json +1 -1
- package/dist/builtin/workflows/src/extension/index.bundle.mjs +78 -20
- package/dist/builtin/workflows/src/index.js +53 -15
- package/dist/modes/interactive/interactive-agent-events.js +9 -1
- package/dist/modes/interactive/interactive-agent-events.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-base.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-base.js +1 -1
- package/dist/modes/interactive/interactive-mode-base.js.map +1 -1
- package/dist/modes/interactive/program-status-reporter.d.ts +14 -0
- package/dist/modes/interactive/program-status-reporter.d.ts.map +1 -1
- package/dist/modes/interactive/program-status-reporter.js +92 -1
- package/dist/modes/interactive/program-status-reporter.js.map +1 -1
- package/dist/modes/interactive-engine/engine-workflow-activity.d.ts +23 -0
- package/dist/modes/interactive-engine/engine-workflow-activity.d.ts.map +1 -0
- package/dist/modes/interactive-engine/engine-workflow-activity.js +80 -0
- package/dist/modes/interactive-engine/engine-workflow-activity.js.map +1 -0
- package/dist/modes/interactive-engine/extension-ui-bridge.d.ts +8 -1
- package/dist/modes/interactive-engine/extension-ui-bridge.d.ts.map +1 -1
- package/dist/modes/interactive-engine/extension-ui-bridge.js +31 -1
- package/dist/modes/interactive-engine/extension-ui-bridge.js.map +1 -1
- package/dist/modes/interactive-engine/isolated-runtime.d.ts +3 -0
- package/dist/modes/interactive-engine/isolated-runtime.d.ts.map +1 -1
- package/dist/modes/interactive-engine/isolated-runtime.js +4 -0
- package/dist/modes/interactive-engine/isolated-runtime.js.map +1 -1
- package/dist/modes/interactive-engine/protocol.d.ts +6 -0
- package/dist/modes/interactive-engine/protocol.d.ts.map +1 -1
- package/dist/modes/interactive-engine/protocol.js +63 -0
- package/dist/modes/interactive-engine/protocol.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +7 -0
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +24 -0
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +1 -0
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-session-binding.d.ts +5 -1
- package/dist/modes/rpc/rpc-session-binding.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-session-binding.js +10 -1
- package/dist/modes/rpc/rpc-session-binding.js.map +1 -1
- package/docs/terminal-setup.md +6 -4
- package/docs/workflows/operations.md +1 -1
- package/npm-shrinkwrap.json +32 -32
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc-mode.d.ts","sourceRoot":"","sources":["../../../src/modes/rpc/rpc-mode.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAwB/E,YAAY,EACX,UAAU,EACV,qBAAqB,EACrB,sBAAsB,EACtB,WAAW,EACX,eAAe,GACf,MAAM,gBAAgB,CAAC;AAExB,MAAM,WAAW,cAAc;IAC9B,+BAA+B,CAAC,EAAE,OAAO,CAAC;CAC1C;AAED;;;GAGG;AACH,wBAAsB,UAAU,CAAC,WAAW,EAAE,mBAAmB,EAAE,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"rpc-mode.d.ts","sourceRoot":"","sources":["../../../src/modes/rpc/rpc-mode.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAwB/E,YAAY,EACX,UAAU,EACV,qBAAqB,EACrB,sBAAsB,EACtB,WAAW,EACX,eAAe,GACf,MAAM,gBAAgB,CAAC;AAExB,MAAM,WAAW,cAAc;IAC9B,+BAA+B,CAAC,EAAE,OAAO,CAAC;CAC1C;AAED;;;GAGG;AACH,wBAAsB,UAAU,CAAC,WAAW,EAAE,mBAAmB,EAAE,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,KAAK,CAAC,CAgN/G"}
|
|
@@ -79,6 +79,7 @@ export async function runRpcMode(runtimeHost, options = {}) {
|
|
|
79
79
|
renderService,
|
|
80
80
|
sessionPicker,
|
|
81
81
|
inputForm,
|
|
82
|
+
writeEngineLine: interactiveEngineChild ? writeRawStdout : undefined,
|
|
82
83
|
reloadCoordinator,
|
|
83
84
|
});
|
|
84
85
|
const loadDeferredResources = () => resourceReadiness.run(async () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc-mode.js","sourceRoot":"","sources":["../../../src/modes/rpc/rpc-mode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAGxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,cAAc,EAA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AAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IAC9C,CAAC;SAAM,IAAI,sBAAsB,EAAE,CAAC;QACnC,mBAAmB,CAAC,wBAAwB,CAAC,CAAC;QAC9C,cAAc,CAAC,cAAc,EAAE,CAAC;IACjC,CAAC;IAED,6BAA6B;IAC7B,OAAO,IAAI,OAAO,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;AAC9B,CAAC","sourcesContent":["import { markLifecycleTiming } from \"../../core/lifecycle-timings.ts\";\n/**\n * RPC mode: Headless operation with JSON stdin/stdout protocol.\n *\n * Used for embedding the agent in other applications.\n * Receives commands as JSON on stdin, outputs events and responses as JSON on stdout.\n *\n * Protocol:\n * - Commands: JSON objects with `type` field, optional `id` for correlation\n * - Responses: JSON objects with `type: \"response\"`, `command`, `success`, and optional `data`/`error`\n * - Events: AgentSessionEvent objects streamed as they occur\n * - Extension UI: Extension UI requests are emitted, client responds with extension_ui_response\n */\n\nimport { setKeybindings } from \"@earendil-works/pi-tui\";\nimport type { AgentSession } from \"../../core/agent-session.js\";\nimport type { AgentSessionRuntime } from \"../../core/agent-session-runtime.ts\";\nimport { KeybindingsManager } from \"../../core/keybindings.ts\";\nimport { flushRawStdout, takeOverStdout, writeRawStdout } from \"../../core/output-guard.ts\";\nimport { isInteractiveEngineChild } from \"../../utils/interactive-engine-env.ts\";\nimport { killTrackedDetachedChildren } from \"../../utils/shell.ts\";\nimport { startInteractiveEngineLiveness } from \"../interactive-engine/engine-child-liveness.ts\";\nimport { EngineCustomUiService } from \"../interactive-engine/engine-custom-ui.ts\";\nimport { EngineInputFormService } from \"../interactive-engine/engine-input-form.ts\";\nimport { EngineProjectTrustService } from \"../interactive-engine/engine-project-trust.js\";\nimport { EngineQuitIntent } from \"../interactive-engine/engine-quit-intent.ts\";\nimport { EngineRenderService } from \"../interactive-engine/engine-render-service.ts\";\nimport { EngineSessionPickerService } from \"../interactive-engine/engine-session-picker.ts\";\nimport { serializeInteractiveEngineMessage } from \"../interactive-engine/protocol.ts\";\nimport { attachJsonlLineReader } from \"./jsonl.ts\";\nimport { createRpcCommandHandler } from \"./rpc-command-handler.ts\";\nimport type { RpcPendingExtensionRequests } from \"./rpc-extension-ui.ts\";\nimport { createRpcInputLineHandler } from \"./rpc-input.ts\";\nimport { createRpcInputScheduler } from \"./rpc-input-scheduler.ts\";\nimport { KeybindingsReloadCoordinator } from \"./rpc-keybindings-reload.ts\";\nimport { RpcOutputBuffer } from \"./rpc-output-buffer.ts\";\nimport { RpcResourceReadiness } from \"./rpc-resource-readiness.ts\";\nimport { RpcSessionBinding } from \"./rpc-session-binding.ts\";\n\n// Re-export types for consumers\nexport type {\n\tRpcCommand,\n\tRpcExtensionUIRequest,\n\tRpcExtensionUIResponse,\n\tRpcResponse,\n\tRpcSessionState,\n} from \"./rpc-types.ts\";\n\nexport interface RpcModeOptions {\n\tdeferInteractiveEngineResources?: boolean;\n}\n\n/**\n * Run in RPC mode.\n * Listens for JSON commands on stdin, outputs events and responses on stdout.\n */\nexport async function runRpcMode(runtimeHost: AgentSessionRuntime, options: RpcModeOptions = {}): Promise<never> {\n\ttakeOverStdout();\n\n\tconst interactiveEngineChild = isInteractiveEngineChild();\n\tconst deferInteractiveEngineResources = interactiveEngineChild && options.deferInteractiveEngineResources === true;\n\tconst resourceReadiness = new RpcResourceReadiness();\n\tconst keybindings = interactiveEngineChild ? KeybindingsManager.create(runtimeHost.services.agentDir) : undefined;\n\tif (keybindings) setKeybindings(keybindings);\n\n\tconst outputBuffer = new RpcOutputBuffer();\n\tconst output = outputBuffer.output;\n\tconst pendingExtensionRequests: RpcPendingExtensionRequests = new Map();\n\tconst signalCleanupHandlers: Array<() => void> = [];\n\tconst engineLiveness = startInteractiveEngineLiveness(writeRawStdout);\n\tconst customUi = keybindings ? new EngineCustomUiService(writeRawStdout, keybindings) : undefined;\n\tconst renderService = interactiveEngineChild ? new EngineRenderService(writeRawStdout) : undefined;\n\tconst sessionPicker = interactiveEngineChild ? new EngineSessionPickerService(writeRawStdout) : undefined;\n\tconst inputForm = interactiveEngineChild ? new EngineInputFormService(writeRawStdout) : undefined;\n\tconst quitIntent = interactiveEngineChild ? new EngineQuitIntent(writeRawStdout) : undefined;\n\tconst projectTrust = interactiveEngineChild\n\t\t? new EngineProjectTrustService(() => runtimeHost.session.extensionRunner)\n\t\t: undefined;\n\tconst reloadCoordinator = keybindings\n\t\t? new KeybindingsReloadCoordinator<AgentSession>(\n\t\t\t\tkeybindings,\n\t\t\t\t(state) =>\n\t\t\t\t\twriteRawStdout(serializeInteractiveEngineMessage({ type: \"engine_keybindings_reloaded\", state })),\n\t\t\t\t(session, effectiveBindings) =>\n\t\t\t\t\t[...session.extensionRunner.getShortcuts(effectiveBindings)].map(([key, shortcut]) => ({\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\t...(shortcut.description === undefined ? {} : { description: shortcut.description }),\n\t\t\t\t\t\t...(shortcut.editorKeys === undefined ? {} : { editorKeys: shortcut.editorKeys }),\n\t\t\t\t\t})),\n\t\t\t)\n\t\t: undefined;\n\n\tlet shutdownRequested = false;\n\tlet shuttingDown = false;\n\tlet detachInput = () => {};\n\n\tconst requestShutdown = () => {\n\t\tshutdownRequested = true;\n\t};\n\n\tconst sessionBinding = new RpcSessionBinding({\n\t\truntimeHost,\n\t\toutput,\n\t\tpendingExtensionRequests,\n\t\trequestShutdown,\n\t\tcustomUi,\n\t\trenderService,\n\t\tsessionPicker,\n\t\tinputForm,\n\t\treloadCoordinator,\n\t});\n\tconst loadDeferredResources = () =>\n\t\tresourceReadiness.run(async () => {\n\t\t\ttry {\n\t\t\t\tawait sessionBinding.loadDeferredResources();\n\t\t\t\tmarkLifecycleTiming(\"engine-resources-ready\");\n\t\t\t\tengineLiveness.resourcesReady();\n\t\t\t} catch (error) {\n\t\t\t\tconst resourceError = error instanceof Error ? error : new Error(String(error));\n\t\t\t\tengineLiveness.resourcesFailed(resourceError);\n\t\t\t\tthrow resourceError;\n\t\t\t}\n\t\t});\n\n\truntimeHost.setRebindSession(async () => {\n\t\tprojectTrust?.dispose();\n\t\tawait sessionBinding.rebindSession();\n\t});\n\n\tconst handleCommand = createRpcCommandHandler({\n\t\truntimeHost,\n\t\tgetSession: () => sessionBinding.currentSession,\n\t\trebindSession: () => sessionBinding.rebindSession(),\n\t\toutput,\n\t\tkeybindings,\n\t\t// Browsing host-owned task history is not an extension approval prompt.\n\t\ttaskInspectorUi: customUi ? { custom: customUi.custom.bind(customUi) } : undefined,\n\t\treloadCoordinator,\n\t\tinputForm,\n\t\tpendingExtensionRequests,\n\t\twaitForResources: deferInteractiveEngineResources ? () => resourceReadiness.wait() : undefined,\n\t\treloadResources: deferInteractiveEngineResources ? loadDeferredResources : undefined,\n\t\tshouldRetryResources: deferInteractiveEngineResources ? () => resourceReadiness.needsRetry() : undefined,\n\t});\n\n\t/**\n\t * Whether this shutdown ends the process but not the conversation. A signal and a\n\t * closed stdin only do that when no explicit quit was announced: the interactive host\n\t * announces one before it stops the engine, so anything else is the host being\n\t * signalled or dying. A standalone RPC client has no such announcement; for it a\n\t * signal is a host termination and a closed stdin or a shutdown request is a deliberate end.\n\t */\n\tconst endsProcessOnly = (cause: \"signal\" | \"input-end\" | \"request\"): boolean => {\n\t\tif (cause === \"request\") return false;\n\t\tif (quitIntent) return !quitIntent.explicitQuitRequested;\n\t\treturn cause === \"signal\";\n\t};\n\n\tasync function shutdown(\n\t\texitCode = 0,\n\t\tsignal?: NodeJS.Signals,\n\t\tcause: \"signal\" | \"input-end\" | \"request\" = \"request\",\n\t): Promise<never> {\n\t\tif (shuttingDown) {\n\t\t\tprocess.exit(exitCode);\n\t\t}\n\t\tshuttingDown = true;\n\t\tdetachInput();\n\t\tprocess.stdin.pause();\n\t\tawait handleCommand.disposeActiveBash();\n\t\tfor (const cleanup of signalCleanupHandlers) {\n\t\t\tcleanup();\n\t\t}\n\t\tsessionBinding.disposeSubscriptions();\n\t\tengineLiveness.stop();\n\t\tcustomUi?.dispose();\n\t\trenderService?.dispose();\n\t\tsessionPicker?.dispose();\n\t\tinputForm?.dispose();\n\t\tprojectTrust?.dispose();\n\t\toutputBuffer.dispose();\n\t\tawait runtimeHost.dispose({ fromSignal: endsProcessOnly(cause) });\n\t\tif (signal !== \"SIGTERM\") {\n\t\t\tawait flushRawStdout();\n\t\t}\n\t\tprocess.exit(exitCode);\n\t}\n\n\tconst checkShutdownRequested = async (): Promise<void> => {\n\t\tif (!shutdownRequested) return;\n\t\tawait shutdown();\n\t};\n\n\tconst registerSignalHandlers = (): void => {\n\t\tconst signals: NodeJS.Signals[] = [\"SIGTERM\"];\n\t\tif (process.platform !== \"win32\") {\n\t\t\tsignals.push(\"SIGHUP\");\n\t\t}\n\n\t\tfor (const signal of signals) {\n\t\t\tconst handler = () => {\n\t\t\t\tkillTrackedDetachedChildren();\n\t\t\t\tvoid shutdown(signal === \"SIGHUP\" ? 129 : 143, signal, \"signal\");\n\t\t\t};\n\t\t\tprocess.on(signal, handler);\n\t\t\tsignalCleanupHandlers.push(() => process.off(signal, handler));\n\t\t}\n\t};\n\n\tconst handleInputLine = createRpcInputLineHandler({\n\t\toutput,\n\t\tpendingExtensionRequests,\n\t\thandleCommand,\n\t\tcheckShutdownRequested,\n\t\t// Only the interactive engine host consults this ownership boundary.\n\t\tannounceRequestAccepted: interactiveEngineChild\n\t\t\t? (requestId, command) =>\n\t\t\t\t\twriteRawStdout(\n\t\t\t\t\t\tserializeInteractiveEngineMessage({ type: \"engine_request_accepted\", requestId, command }),\n\t\t\t\t\t)\n\t\t\t: undefined,\n\t\thandleInteractiveEngineLine:\n\t\t\tcustomUi || renderService || sessionPicker || inputForm || projectTrust || quitIntent\n\t\t\t\t? (line) =>\n\t\t\t\t\t\tquitIntent?.handleLine(line) === true ||\n\t\t\t\t\t\tcustomUi?.handleLine(line) === true ||\n\t\t\t\t\t\trenderService?.handleLine(line) === true ||\n\t\t\t\t\t\tsessionPicker?.handleLine(line) === true ||\n\t\t\t\t\t\tinputForm?.handleLine(line) === true ||\n\t\t\t\t\t\tprojectTrust?.handleLine(line) === true\n\t\t\t\t: undefined,\n\t});\n\n\tconst onInputEnd = () => {\n\t\tvoid shutdown(0, undefined, \"input-end\");\n\t};\n\tprocess.stdin.on(\"end\", onInputEnd);\n\n\tdetachInput = (() => {\n\t\tconst scheduleInputLine = createRpcInputScheduler(handleInputLine);\n\t\tconst detachJsonl = attachJsonlLineReader(process.stdin, scheduleInputLine, {\n\t\t\tmaxBytesPerTurn: 256 * 1024,\n\t\t});\n\t\treturn () => {\n\t\t\tdetachJsonl();\n\t\t\tprocess.stdin.off(\"end\", onInputEnd);\n\t\t};\n\t})();\n\tregisterSignalHandlers();\n\tengineLiveness.ready();\n\tawait sessionBinding.rebindSession();\n\tif (interactiveEngineChild) engineLiveness.bound();\n\tif (deferInteractiveEngineResources) {\n\t\t// RPC control and the mandatory minimal session are usable now. Prompt\n\t\t// handling remains generation-gated until a retryable transactional reload commits.\n\t\tvoid loadDeferredResources().catch(() => {});\n\t} else if (interactiveEngineChild) {\n\t\tmarkLifecycleTiming(\"engine-resources-ready\");\n\t\tengineLiveness.resourcesReady();\n\t}\n\n\t// Keep process alive forever\n\treturn new Promise(() => {});\n}\n"]}
|
|
1
|
+
{"version":3,"file":"rpc-mode.js","sourceRoot":"","sources":["../../../src/modes/rpc/rpc-mode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAGxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5F,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,8BAA8B,EAAE,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BAAmB,CAAC,wBAAwB,CAAC,CAAC;QAC9C,cAAc,CAAC,cAAc,EAAE,CAAC;IACjC,CAAC;IAED,6BAA6B;IAC7B,OAAO,IAAI,OAAO,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;AAC9B,CAAC","sourcesContent":["import { markLifecycleTiming } from \"../../core/lifecycle-timings.ts\";\n/**\n * RPC mode: Headless operation with JSON stdin/stdout protocol.\n *\n * Used for embedding the agent in other applications.\n * Receives commands as JSON on stdin, outputs events and responses as JSON on stdout.\n *\n * Protocol:\n * - Commands: JSON objects with `type` field, optional `id` for correlation\n * - Responses: JSON objects with `type: \"response\"`, `command`, `success`, and optional `data`/`error`\n * - Events: AgentSessionEvent objects streamed as they occur\n * - Extension UI: Extension UI requests are emitted, client responds with extension_ui_response\n */\n\nimport { setKeybindings } from \"@earendil-works/pi-tui\";\nimport type { AgentSession } from \"../../core/agent-session.js\";\nimport type { AgentSessionRuntime } from \"../../core/agent-session-runtime.ts\";\nimport { KeybindingsManager } from \"../../core/keybindings.ts\";\nimport { flushRawStdout, takeOverStdout, writeRawStdout } from \"../../core/output-guard.ts\";\nimport { isInteractiveEngineChild } from \"../../utils/interactive-engine-env.ts\";\nimport { killTrackedDetachedChildren } from \"../../utils/shell.ts\";\nimport { startInteractiveEngineLiveness } from \"../interactive-engine/engine-child-liveness.ts\";\nimport { EngineCustomUiService } from \"../interactive-engine/engine-custom-ui.ts\";\nimport { EngineInputFormService } from \"../interactive-engine/engine-input-form.ts\";\nimport { EngineProjectTrustService } from \"../interactive-engine/engine-project-trust.js\";\nimport { EngineQuitIntent } from \"../interactive-engine/engine-quit-intent.ts\";\nimport { EngineRenderService } from \"../interactive-engine/engine-render-service.ts\";\nimport { EngineSessionPickerService } from \"../interactive-engine/engine-session-picker.ts\";\nimport { serializeInteractiveEngineMessage } from \"../interactive-engine/protocol.ts\";\nimport { attachJsonlLineReader } from \"./jsonl.ts\";\nimport { createRpcCommandHandler } from \"./rpc-command-handler.ts\";\nimport type { RpcPendingExtensionRequests } from \"./rpc-extension-ui.ts\";\nimport { createRpcInputLineHandler } from \"./rpc-input.ts\";\nimport { createRpcInputScheduler } from \"./rpc-input-scheduler.ts\";\nimport { KeybindingsReloadCoordinator } from \"./rpc-keybindings-reload.ts\";\nimport { RpcOutputBuffer } from \"./rpc-output-buffer.ts\";\nimport { RpcResourceReadiness } from \"./rpc-resource-readiness.ts\";\nimport { RpcSessionBinding } from \"./rpc-session-binding.ts\";\n\n// Re-export types for consumers\nexport type {\n\tRpcCommand,\n\tRpcExtensionUIRequest,\n\tRpcExtensionUIResponse,\n\tRpcResponse,\n\tRpcSessionState,\n} from \"./rpc-types.ts\";\n\nexport interface RpcModeOptions {\n\tdeferInteractiveEngineResources?: boolean;\n}\n\n/**\n * Run in RPC mode.\n * Listens for JSON commands on stdin, outputs events and responses on stdout.\n */\nexport async function runRpcMode(runtimeHost: AgentSessionRuntime, options: RpcModeOptions = {}): Promise<never> {\n\ttakeOverStdout();\n\n\tconst interactiveEngineChild = isInteractiveEngineChild();\n\tconst deferInteractiveEngineResources = interactiveEngineChild && options.deferInteractiveEngineResources === true;\n\tconst resourceReadiness = new RpcResourceReadiness();\n\tconst keybindings = interactiveEngineChild ? KeybindingsManager.create(runtimeHost.services.agentDir) : undefined;\n\tif (keybindings) setKeybindings(keybindings);\n\n\tconst outputBuffer = new RpcOutputBuffer();\n\tconst output = outputBuffer.output;\n\tconst pendingExtensionRequests: RpcPendingExtensionRequests = new Map();\n\tconst signalCleanupHandlers: Array<() => void> = [];\n\tconst engineLiveness = startInteractiveEngineLiveness(writeRawStdout);\n\tconst customUi = keybindings ? new EngineCustomUiService(writeRawStdout, keybindings) : undefined;\n\tconst renderService = interactiveEngineChild ? new EngineRenderService(writeRawStdout) : undefined;\n\tconst sessionPicker = interactiveEngineChild ? new EngineSessionPickerService(writeRawStdout) : undefined;\n\tconst inputForm = interactiveEngineChild ? new EngineInputFormService(writeRawStdout) : undefined;\n\tconst quitIntent = interactiveEngineChild ? new EngineQuitIntent(writeRawStdout) : undefined;\n\tconst projectTrust = interactiveEngineChild\n\t\t? new EngineProjectTrustService(() => runtimeHost.session.extensionRunner)\n\t\t: undefined;\n\tconst reloadCoordinator = keybindings\n\t\t? new KeybindingsReloadCoordinator<AgentSession>(\n\t\t\t\tkeybindings,\n\t\t\t\t(state) =>\n\t\t\t\t\twriteRawStdout(serializeInteractiveEngineMessage({ type: \"engine_keybindings_reloaded\", state })),\n\t\t\t\t(session, effectiveBindings) =>\n\t\t\t\t\t[...session.extensionRunner.getShortcuts(effectiveBindings)].map(([key, shortcut]) => ({\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\t...(shortcut.description === undefined ? {} : { description: shortcut.description }),\n\t\t\t\t\t\t...(shortcut.editorKeys === undefined ? {} : { editorKeys: shortcut.editorKeys }),\n\t\t\t\t\t})),\n\t\t\t)\n\t\t: undefined;\n\n\tlet shutdownRequested = false;\n\tlet shuttingDown = false;\n\tlet detachInput = () => {};\n\n\tconst requestShutdown = () => {\n\t\tshutdownRequested = true;\n\t};\n\n\tconst sessionBinding = new RpcSessionBinding({\n\t\truntimeHost,\n\t\toutput,\n\t\tpendingExtensionRequests,\n\t\trequestShutdown,\n\t\tcustomUi,\n\t\trenderService,\n\t\tsessionPicker,\n\t\tinputForm,\n\t\twriteEngineLine: interactiveEngineChild ? writeRawStdout : undefined,\n\t\treloadCoordinator,\n\t});\n\tconst loadDeferredResources = () =>\n\t\tresourceReadiness.run(async () => {\n\t\t\ttry {\n\t\t\t\tawait sessionBinding.loadDeferredResources();\n\t\t\t\tmarkLifecycleTiming(\"engine-resources-ready\");\n\t\t\t\tengineLiveness.resourcesReady();\n\t\t\t} catch (error) {\n\t\t\t\tconst resourceError = error instanceof Error ? error : new Error(String(error));\n\t\t\t\tengineLiveness.resourcesFailed(resourceError);\n\t\t\t\tthrow resourceError;\n\t\t\t}\n\t\t});\n\n\truntimeHost.setRebindSession(async () => {\n\t\tprojectTrust?.dispose();\n\t\tawait sessionBinding.rebindSession();\n\t});\n\n\tconst handleCommand = createRpcCommandHandler({\n\t\truntimeHost,\n\t\tgetSession: () => sessionBinding.currentSession,\n\t\trebindSession: () => sessionBinding.rebindSession(),\n\t\toutput,\n\t\tkeybindings,\n\t\t// Browsing host-owned task history is not an extension approval prompt.\n\t\ttaskInspectorUi: customUi ? { custom: customUi.custom.bind(customUi) } : undefined,\n\t\treloadCoordinator,\n\t\tinputForm,\n\t\tpendingExtensionRequests,\n\t\twaitForResources: deferInteractiveEngineResources ? () => resourceReadiness.wait() : undefined,\n\t\treloadResources: deferInteractiveEngineResources ? loadDeferredResources : undefined,\n\t\tshouldRetryResources: deferInteractiveEngineResources ? () => resourceReadiness.needsRetry() : undefined,\n\t});\n\n\t/**\n\t * Whether this shutdown ends the process but not the conversation. A signal and a\n\t * closed stdin only do that when no explicit quit was announced: the interactive host\n\t * announces one before it stops the engine, so anything else is the host being\n\t * signalled or dying. A standalone RPC client has no such announcement; for it a\n\t * signal is a host termination and a closed stdin or a shutdown request is a deliberate end.\n\t */\n\tconst endsProcessOnly = (cause: \"signal\" | \"input-end\" | \"request\"): boolean => {\n\t\tif (cause === \"request\") return false;\n\t\tif (quitIntent) return !quitIntent.explicitQuitRequested;\n\t\treturn cause === \"signal\";\n\t};\n\n\tasync function shutdown(\n\t\texitCode = 0,\n\t\tsignal?: NodeJS.Signals,\n\t\tcause: \"signal\" | \"input-end\" | \"request\" = \"request\",\n\t): Promise<never> {\n\t\tif (shuttingDown) {\n\t\t\tprocess.exit(exitCode);\n\t\t}\n\t\tshuttingDown = true;\n\t\tdetachInput();\n\t\tprocess.stdin.pause();\n\t\tawait handleCommand.disposeActiveBash();\n\t\tfor (const cleanup of signalCleanupHandlers) {\n\t\t\tcleanup();\n\t\t}\n\t\tsessionBinding.disposeSubscriptions();\n\t\tengineLiveness.stop();\n\t\tcustomUi?.dispose();\n\t\trenderService?.dispose();\n\t\tsessionPicker?.dispose();\n\t\tinputForm?.dispose();\n\t\tprojectTrust?.dispose();\n\t\toutputBuffer.dispose();\n\t\tawait runtimeHost.dispose({ fromSignal: endsProcessOnly(cause) });\n\t\tif (signal !== \"SIGTERM\") {\n\t\t\tawait flushRawStdout();\n\t\t}\n\t\tprocess.exit(exitCode);\n\t}\n\n\tconst checkShutdownRequested = async (): Promise<void> => {\n\t\tif (!shutdownRequested) return;\n\t\tawait shutdown();\n\t};\n\n\tconst registerSignalHandlers = (): void => {\n\t\tconst signals: NodeJS.Signals[] = [\"SIGTERM\"];\n\t\tif (process.platform !== \"win32\") {\n\t\t\tsignals.push(\"SIGHUP\");\n\t\t}\n\n\t\tfor (const signal of signals) {\n\t\t\tconst handler = () => {\n\t\t\t\tkillTrackedDetachedChildren();\n\t\t\t\tvoid shutdown(signal === \"SIGHUP\" ? 129 : 143, signal, \"signal\");\n\t\t\t};\n\t\t\tprocess.on(signal, handler);\n\t\t\tsignalCleanupHandlers.push(() => process.off(signal, handler));\n\t\t}\n\t};\n\n\tconst handleInputLine = createRpcInputLineHandler({\n\t\toutput,\n\t\tpendingExtensionRequests,\n\t\thandleCommand,\n\t\tcheckShutdownRequested,\n\t\t// Only the interactive engine host consults this ownership boundary.\n\t\tannounceRequestAccepted: interactiveEngineChild\n\t\t\t? (requestId, command) =>\n\t\t\t\t\twriteRawStdout(\n\t\t\t\t\t\tserializeInteractiveEngineMessage({ type: \"engine_request_accepted\", requestId, command }),\n\t\t\t\t\t)\n\t\t\t: undefined,\n\t\thandleInteractiveEngineLine:\n\t\t\tcustomUi || renderService || sessionPicker || inputForm || projectTrust || quitIntent\n\t\t\t\t? (line) =>\n\t\t\t\t\t\tquitIntent?.handleLine(line) === true ||\n\t\t\t\t\t\tcustomUi?.handleLine(line) === true ||\n\t\t\t\t\t\trenderService?.handleLine(line) === true ||\n\t\t\t\t\t\tsessionPicker?.handleLine(line) === true ||\n\t\t\t\t\t\tinputForm?.handleLine(line) === true ||\n\t\t\t\t\t\tprojectTrust?.handleLine(line) === true\n\t\t\t\t: undefined,\n\t});\n\n\tconst onInputEnd = () => {\n\t\tvoid shutdown(0, undefined, \"input-end\");\n\t};\n\tprocess.stdin.on(\"end\", onInputEnd);\n\n\tdetachInput = (() => {\n\t\tconst scheduleInputLine = createRpcInputScheduler(handleInputLine);\n\t\tconst detachJsonl = attachJsonlLineReader(process.stdin, scheduleInputLine, {\n\t\t\tmaxBytesPerTurn: 256 * 1024,\n\t\t});\n\t\treturn () => {\n\t\t\tdetachJsonl();\n\t\t\tprocess.stdin.off(\"end\", onInputEnd);\n\t\t};\n\t})();\n\tregisterSignalHandlers();\n\tengineLiveness.ready();\n\tawait sessionBinding.rebindSession();\n\tif (interactiveEngineChild) engineLiveness.bound();\n\tif (deferInteractiveEngineResources) {\n\t\t// RPC control and the mandatory minimal session are usable now. Prompt\n\t\t// handling remains generation-gated until a retryable transactional reload commits.\n\t\tvoid loadDeferredResources().catch(() => {});\n\t} else if (interactiveEngineChild) {\n\t\tmarkLifecycleTiming(\"engine-resources-ready\");\n\t\tengineLiveness.resourcesReady();\n\t}\n\n\t// Keep process alive forever\n\treturn new Promise(() => {});\n}\n"]}
|
|
@@ -15,6 +15,8 @@ interface RpcSessionBindingOptions {
|
|
|
15
15
|
renderService?: EngineRenderService;
|
|
16
16
|
sessionPicker?: EngineSessionPickerService;
|
|
17
17
|
inputForm?: EngineInputFormService;
|
|
18
|
+
/** Present in the interactive engine child, which reports workflow activity to its host. */
|
|
19
|
+
writeEngineLine?: (line: string) => void;
|
|
18
20
|
requestShutdown: () => void;
|
|
19
21
|
reloadCoordinator?: KeybindingsReloadCoordinator<AgentSession>;
|
|
20
22
|
}
|
|
@@ -24,6 +26,7 @@ export declare class RpcSessionBinding {
|
|
|
24
26
|
private unsubscribe?;
|
|
25
27
|
private unsubscribeBackpressure?;
|
|
26
28
|
private unsubscribeTasks?;
|
|
29
|
+
private unsubscribeWorkflowActivity?;
|
|
27
30
|
private readonly runtimeHost;
|
|
28
31
|
private readonly output;
|
|
29
32
|
private readonly pendingExtensionRequests;
|
|
@@ -31,10 +34,11 @@ export declare class RpcSessionBinding {
|
|
|
31
34
|
private readonly renderService;
|
|
32
35
|
private readonly sessionPicker;
|
|
33
36
|
private readonly inputForm;
|
|
37
|
+
private readonly writeEngineLine;
|
|
34
38
|
private readonly requestShutdown;
|
|
35
39
|
private readonly reloadCoordinator;
|
|
36
40
|
private footerDataProvider;
|
|
37
|
-
constructor({ runtimeHost, output, pendingExtensionRequests, requestShutdown, customUi, renderService, sessionPicker, inputForm, reloadCoordinator, }: RpcSessionBindingOptions);
|
|
41
|
+
constructor({ runtimeHost, output, pendingExtensionRequests, requestShutdown, customUi, renderService, sessionPicker, inputForm, writeEngineLine, reloadCoordinator, }: RpcSessionBindingOptions);
|
|
38
42
|
private createProjectTrustContext;
|
|
39
43
|
get currentSession(): AgentSession;
|
|
40
44
|
rebindSession(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc-session-binding.d.ts","sourceRoot":"","sources":["../../../src/modes/rpc/rpc-session-binding.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAI/E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2CAA2C,CAAC;AACvF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AACzF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gDAAgD,CAAC;AAC1F,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,gDAAgD,CAAC;
|
|
1
|
+
{"version":3,"file":"rpc-session-binding.d.ts","sourceRoot":"","sources":["../../../src/modes/rpc/rpc-session-binding.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAI/E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B,CAA8B;IACvE,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAoC;IAC7D,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAkC;IAChE,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAyC;IACvE,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAqC;IAC/D,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAuC;IACvE,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAa;IAC7C,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAyD;IAE3F,OAAO,CAAC,kBAAkB,CAAiC;IAC3D,YAAY,EACX,WAAW,EACX,MAAM,EACN,wBAAwB,EACxB,eAAe,EACf,QAAQ,EACR,aAAa,EACb,aAAa,EACb,SAAS,EACT,eAAe,EACf,iBAAiB,GACjB,EAAE,wBAAwB,EAa1B;IAED,OAAO,CAAC,yBAAyB;IA0BjC,IAAI,cAAc,IAAI,YAAY,CAEjC;IAEK,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAwFnC;IAED,wGAAwG;IAClG,qBAAqB,IAAI,OAAO,CAAC,IAAI,CAAC,CAmB3C;IAED,oBAAoB,IAAI,IAAI,CAY3B;CACD"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { setCapabilityOverrides } from "@earendil-works/pi-tui";
|
|
2
2
|
import { FooterDataProvider } from "../../core/footer-data-provider.js";
|
|
3
3
|
import { waitForRawStdoutBackpressure } from "../../core/output-guard.js";
|
|
4
|
+
import { forwardWorkflowActivity } from "../interactive-engine/engine-workflow-activity.js";
|
|
4
5
|
import { toJsonEvent } from "../json-event.js";
|
|
5
6
|
import { createRpcExtensionUIContext } from "./rpc-extension-ui.js";
|
|
6
7
|
import { bindEngineTaskWidget } from "./task-ui-bridge.js";
|
|
@@ -10,6 +11,7 @@ export class RpcSessionBinding {
|
|
|
10
11
|
unsubscribe;
|
|
11
12
|
unsubscribeBackpressure;
|
|
12
13
|
unsubscribeTasks;
|
|
14
|
+
unsubscribeWorkflowActivity;
|
|
13
15
|
runtimeHost;
|
|
14
16
|
output;
|
|
15
17
|
pendingExtensionRequests;
|
|
@@ -17,10 +19,11 @@ export class RpcSessionBinding {
|
|
|
17
19
|
renderService;
|
|
18
20
|
sessionPicker;
|
|
19
21
|
inputForm;
|
|
22
|
+
writeEngineLine;
|
|
20
23
|
requestShutdown;
|
|
21
24
|
reloadCoordinator;
|
|
22
25
|
footerDataProvider;
|
|
23
|
-
constructor({ runtimeHost, output, pendingExtensionRequests, requestShutdown, customUi, renderService, sessionPicker, inputForm, reloadCoordinator, }) {
|
|
26
|
+
constructor({ runtimeHost, output, pendingExtensionRequests, requestShutdown, customUi, renderService, sessionPicker, inputForm, writeEngineLine, reloadCoordinator, }) {
|
|
24
27
|
this.runtimeHost = runtimeHost;
|
|
25
28
|
this.output = output;
|
|
26
29
|
this.pendingExtensionRequests = pendingExtensionRequests;
|
|
@@ -29,6 +32,7 @@ export class RpcSessionBinding {
|
|
|
29
32
|
this.renderService = renderService;
|
|
30
33
|
this.sessionPicker = sessionPicker;
|
|
31
34
|
this.inputForm = inputForm;
|
|
35
|
+
this.writeEngineLine = writeEngineLine;
|
|
32
36
|
this.reloadCoordinator = reloadCoordinator;
|
|
33
37
|
this.session = runtimeHost.session;
|
|
34
38
|
this.runtimeHost.setProjectTrustContextFactory?.((cwd) => this.createProjectTrustContext(cwd));
|
|
@@ -137,6 +141,9 @@ export class RpcSessionBinding {
|
|
|
137
141
|
}
|
|
138
142
|
if (this.customUi)
|
|
139
143
|
this.unsubscribeTasks = bindEngineTaskWidget(session, session.extensionRunner.getUIContext());
|
|
144
|
+
if (this.writeEngineLine) {
|
|
145
|
+
this.unsubscribeWorkflowActivity = forwardWorkflowActivity(session, this.writeEngineLine);
|
|
146
|
+
}
|
|
140
147
|
this.unsubscribe = session.subscribe((event) => {
|
|
141
148
|
this.output(toJsonEvent(event));
|
|
142
149
|
});
|
|
@@ -175,6 +182,8 @@ export class RpcSessionBinding {
|
|
|
175
182
|
this.unsubscribeBackpressure?.();
|
|
176
183
|
this.unsubscribeTasks?.();
|
|
177
184
|
this.unsubscribeTasks = undefined;
|
|
185
|
+
this.unsubscribeWorkflowActivity?.();
|
|
186
|
+
this.unsubscribeWorkflowActivity = undefined;
|
|
178
187
|
this.footerDataProvider?.dispose();
|
|
179
188
|
this.unsubscribe = undefined;
|
|
180
189
|
this.unsubscribeBackpressure = undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc-session-binding.js","sourceRoot":"","sources":["../../../src/modes/rpc/rpc-session-binding.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAIhE,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AACxE,OAAO,EAAE,4BAA4B,EAAE,MAAM,4BAA4B,CAAC;AAK1E,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,2BAA2B,EAAoC,MAAM,uBAAuB,CAAC;AAGtG,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAc3D,MAAM,OAAO,iBAAiB;IACrB,OAAO,CAAe;IACtB,WAAW,CAA8C;IACzD,WAAW,CAAc;IACzB,uBAAuB,CAAc;IACrC,gBAAgB,CAAc;IACrB,WAAW,CAAsB;IACjC,MAAM,CAAY;IAClB,wBAAwB,CAA8B;IACtD,QAAQ,CAAoC;IAC5C,aAAa,CAAkC;IAC/C,aAAa,CAAyC;IACtD,SAAS,CAAqC;IAC9C,eAAe,CAAa;IAC5B,iBAAiB,CAAyD;IAEnF,kBAAkB,CAAiC;IAC3D,YAAY,EACX,WAAW,EACX,MAAM,EACN,wBAAwB,EACxB,eAAe,EACf,QAAQ,EACR,aAAa,EACb,aAAa,EACb,SAAS,EACT,iBAAiB,GACS;QAC1B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;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AAC;gBACnD,MAAM,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,qBAAqB,EAAE,IAAI,EAAE,CAAC,CAAC;YAC1E,CAAC;QACF,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,KAAK,MAAM,cAAc,IAAI,OAAO,CAAC,cAAc,CAAC,aAAa,EAAE,CAAC,MAAM,EAAE,CAAC;gBAC5E,IAAI,CAAC,MAAM,CAAC;oBACX,IAAI,EAAE,iBAAiB;oBACvB,aAAa,EAAE,cAAc,CAAC,IAAI;oBAClC,KAAK,EAAE,SAAS;oBAChB,KAAK,EAAE,cAAc,CAAC,KAAK;iBAC3B,CAAC,CAAC;YACJ,CAAC;YACD,MAAM,KAAK,CAAC;QACb,CAAC;QACD,IAAI,OAAO,KAAK,IAAI,CAAC,OAAO;YAAE,OAAO;QACrC,IAAI,CAAC,iBAAiB,EAAE,mBAAmB,CAAC,OAAO,CAAC,CAAC;IACtD,CAAC;IAED,oBAAoB;QACnB,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC;QAC7B,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;QACrB,IAAI,CAAC,uBAAuB,EAAE,EAAE,CAAC;QACjC,IAAI,CAAC,gBAAgB,EAAE,EAAE,CAAC;QAC1B,IAAI,CAAC,gBAAgB,GAAG,SAAS,CAAC;QAClC,IAAI,CAAC,kBAAkB,EAAE,OAAO,EAAE,CAAC;QACnC,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC;QAC7B,IAAI,CAAC,uBAAuB,GAAG,SAAS,CAAC;QACzC,IAAI,CAAC,kBAAkB,GAAG,SAAS,CAAC;IACrC,CAAC;CACD","sourcesContent":["import { setCapabilityOverrides } from \"@earendil-works/pi-tui\";\nimport type { AgentSession } from \"../../core/agent-session.js\";\nimport type { AgentSessionRuntime } from \"../../core/agent-session-runtime.ts\";\nimport type { ProjectTrustContext } from \"../../core/extensions/index.js\";\nimport { FooterDataProvider } from \"../../core/footer-data-provider.ts\";\nimport { waitForRawStdoutBackpressure } from \"../../core/output-guard.ts\";\nimport type { EngineCustomUiService } from \"../interactive-engine/engine-custom-ui.ts\";\nimport type { EngineInputFormService } from \"../interactive-engine/engine-input-form.ts\";\nimport type { EngineRenderService } from \"../interactive-engine/engine-render-service.ts\";\nimport type { EngineSessionPickerService } from \"../interactive-engine/engine-session-picker.ts\";\nimport { toJsonEvent } from \"../json-event.ts\";\nimport { createRpcExtensionUIContext, type RpcPendingExtensionRequests } from \"./rpc-extension-ui.ts\";\nimport type { KeybindingsReloadCoordinator } from \"./rpc-keybindings-reload.ts\";\nimport type { RpcOutput } from \"./rpc-responses.ts\";\nimport { bindEngineTaskWidget } from \"./task-ui-bridge.js\";\n\ninterface RpcSessionBindingOptions {\n\truntimeHost: AgentSessionRuntime;\n\toutput: RpcOutput;\n\tpendingExtensionRequests: RpcPendingExtensionRequests;\n\tcustomUi?: EngineCustomUiService;\n\trenderService?: EngineRenderService;\n\tsessionPicker?: EngineSessionPickerService;\n\tinputForm?: EngineInputFormService;\n\trequestShutdown: () => void;\n\treloadCoordinator?: KeybindingsReloadCoordinator<AgentSession>;\n}\n\nexport class RpcSessionBinding {\n\tprivate session: AgentSession;\n\tprivate boundRunner: AgentSession[\"extensionRunner\"] | undefined;\n\tprivate unsubscribe?: () => void;\n\tprivate unsubscribeBackpressure?: () => void;\n\tprivate unsubscribeTasks?: () => void;\n\tprivate readonly runtimeHost: AgentSessionRuntime;\n\tprivate readonly output: RpcOutput;\n\tprivate readonly pendingExtensionRequests: RpcPendingExtensionRequests;\n\tprivate readonly customUi: EngineCustomUiService | undefined;\n\tprivate readonly renderService: EngineRenderService | undefined;\n\tprivate readonly sessionPicker: EngineSessionPickerService | undefined;\n\tprivate readonly inputForm: EngineInputFormService | undefined;\n\tprivate readonly requestShutdown: () => void;\n\tprivate readonly reloadCoordinator: KeybindingsReloadCoordinator<AgentSession> | undefined;\n\n\tprivate footerDataProvider: FooterDataProvider | undefined;\n\tconstructor({\n\t\truntimeHost,\n\t\toutput,\n\t\tpendingExtensionRequests,\n\t\trequestShutdown,\n\t\tcustomUi,\n\t\trenderService,\n\t\tsessionPicker,\n\t\tinputForm,\n\t\treloadCoordinator,\n\t}: RpcSessionBindingOptions) {\n\t\tthis.runtimeHost = runtimeHost;\n\t\tthis.output = output;\n\t\tthis.pendingExtensionRequests = pendingExtensionRequests;\n\t\tthis.requestShutdown = requestShutdown;\n\t\tthis.customUi = customUi;\n\t\tthis.renderService = renderService;\n\t\tthis.sessionPicker = sessionPicker;\n\t\tthis.inputForm = inputForm;\n\t\tthis.reloadCoordinator = reloadCoordinator;\n\t\tthis.session = runtimeHost.session;\n\t\tthis.runtimeHost.setProjectTrustContextFactory?.((cwd) => this.createProjectTrustContext(cwd));\n\t}\n\n\tprivate createProjectTrustContext(cwd: string): ProjectTrustContext {\n\t\tconst runner = this.runtimeHost.session.extensionRunner;\n\t\tconst ui = runner.getUIContext();\n\t\tconst hasUI = this.customUi !== undefined;\n\t\treturn {\n\t\t\tcwd,\n\t\t\tmode: hasUI ? \"tui\" : \"rpc\",\n\t\t\thasUI,\n\t\t\tui: {\n\t\t\t\tselect: (title, options, opts) =>\n\t\t\t\t\thasUI\n\t\t\t\t\t\t? runner.withProjectTrustPrompt(\"select\", title, () => ui.select(title, options, opts))\n\t\t\t\t\t\t: Promise.resolve(undefined),\n\t\t\t\tconfirm: (title, message, opts) =>\n\t\t\t\t\thasUI\n\t\t\t\t\t\t? runner.withProjectTrustPrompt(\"confirm\", title, () => ui.confirm(title, message, opts))\n\t\t\t\t\t\t: Promise.resolve(false),\n\t\t\t\tinput: (title, placeholder, opts) =>\n\t\t\t\t\thasUI\n\t\t\t\t\t\t? runner.withProjectTrustPrompt(\"input\", title, () => ui.input(title, placeholder, opts))\n\t\t\t\t\t\t: Promise.resolve(undefined),\n\t\t\t\tnotify: (message, type) => ui.notify(message, type),\n\t\t\t},\n\t\t};\n\t}\n\n\tget currentSession(): AgentSession {\n\t\treturn this.session;\n\t}\n\n\tasync rebindSession(): Promise<void> {\n\t\tif (this.session === this.runtimeHost.session && this.boundRunner === this.session.extensionRunner) return;\n\t\tthis.session = this.runtimeHost.session;\n\t\tthis.disposeSubscriptions();\n\t\tconst session = this.session;\n\t\tsetCapabilityOverrides(session.settingsManager.getTerminalCapabilityOverrides());\n\t\tthis.renderService?.bindSession(session);\n\t\tthis.footerDataProvider = new FooterDataProvider(session.sessionManager.getCwd());\n\t\t// Seed the provider count from the current catalog snapshot, mirroring\n\t\t// updateProviderCountFromSnapshot() in interactive startup, so the\n\t\t// embedded footer shows the (provider) model prefix in multi-provider\n\t\t// sessions instead of defaulting to 0.\n\t\tconst models =\n\t\t\tsession.scopedModels.length > 0\n\t\t\t\t? session.scopedModels.map((scoped) => scoped.model)\n\t\t\t\t: session.modelRuntime.getAvailableSnapshot();\n\t\tthis.footerDataProvider.setAvailableProviderCount(new Set(models.map((model) => model.provider)).size);\n\n\t\ttry {\n\t\t\tawait session.bindExtensions({\n\t\t\t\tuiContext: createRpcExtensionUIContext({\n\t\t\t\t\toutput: this.output,\n\t\t\t\t\tpendingExtensionRequests: this.pendingExtensionRequests,\n\t\t\t\t\tcustomUi: this.customUi,\n\t\t\t\t\tsessionPicker: this.sessionPicker,\n\t\t\t\t\tinputForm: this.inputForm,\n\t\t\t\t\tfooterDataProvider: this.footerDataProvider,\n\t\t\t\t}),\n\t\t\t\tmode: this.customUi ? \"tui\" : \"rpc\",\n\t\t\t\tcommandContextActions: {\n\t\t\t\t\twaitForIdle: () => this.session.agent.waitForIdle(),\n\t\t\t\t\tnewSession: async (options) => this.runtimeHost.newSession(options),\n\t\t\t\t\tfork: async (entryId, forkOptions) => {\n\t\t\t\t\t\tconst result = await this.runtimeHost.fork(entryId, forkOptions);\n\t\t\t\t\t\treturn { cancelled: result.cancelled };\n\t\t\t\t\t},\n\t\t\t\t\tnavigateTree: async (targetId, options) => {\n\t\t\t\t\t\tconst result = await this.session.navigateTree(targetId, {\n\t\t\t\t\t\t\tsummarize: options?.summarize,\n\t\t\t\t\t\t\tcustomInstructions: options?.customInstructions,\n\t\t\t\t\t\t\treplaceInstructions: options?.replaceInstructions,\n\t\t\t\t\t\t\tlabel: options?.label,\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn { cancelled: result.cancelled };\n\t\t\t\t\t},\n\t\t\t\t\tswitchSession: async (sessionPath, options) => {\n\t\t\t\t\t\treturn this.runtimeHost.switchSession(sessionPath, options);\n\t\t\t\t\t},\n\t\t\t\t\treload: async () => {\n\t\t\t\t\t\tconst steeringMode = this.session.steeringMode;\n\t\t\t\t\t\tconst followUpMode = this.session.followUpMode;\n\t\t\t\t\t\tif (this.reloadCoordinator) await this.reloadCoordinator.reload(this.session);\n\t\t\t\t\t\telse await this.session.reload();\n\t\t\t\t\t\tthis.session.setSteeringMode(steeringMode);\n\t\t\t\t\t\tthis.session.setFollowUpMode(followUpMode);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tshutdownHandler: this.requestShutdown,\n\t\t\t\tonError: (err) => {\n\t\t\t\t\tthis.output({\n\t\t\t\t\t\ttype: \"extension_error\",\n\t\t\t\t\t\textensionPath: err.extensionPath,\n\t\t\t\t\t\tevent: err.event,\n\t\t\t\t\t\terror: err.error,\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t});\n\t\t\tthis.footerDataProvider.startGitWatcher();\n\t\t} catch (error) {\n\t\t\t// Leave no partially-initialized footer state behind if extension\n\t\t\t// binding fails; dispose the provider and rethrow.\n\t\t\tthis.footerDataProvider.dispose();\n\t\t\tthis.footerDataProvider = undefined;\n\t\t\tthrow error;\n\t\t}\n\n\t\tif (this.customUi) this.unsubscribeTasks = bindEngineTaskWidget(session, session.extensionRunner.getUIContext());\n\t\tthis.unsubscribe = session.subscribe((event) => {\n\t\t\tthis.output(toJsonEvent(event));\n\t\t});\n\t\tthis.unsubscribeBackpressure = session.agent.subscribe(async () => {\n\t\t\tawait waitForRawStdoutBackpressure();\n\t\t});\n\t\tthis.reloadCoordinator?.publishCurrentState(session);\n\t\tthis.boundRunner = session.extensionRunner;\n\t}\n\n\t/** Load and atomically publish the optional resource set after the minimal interactive engine binds. */\n\tasync loadDeferredResources(): Promise<void> {\n\t\tconst session = this.session;\n\t\ttry {\n\t\t\tif (!(await this.runtimeHost.completeStartup?.())) {\n\t\t\t\tawait session.reload({ reason: \"startup\", failOnExtensionErrors: true });\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tfor (const extensionError of session.resourceLoader.getExtensions().errors) {\n\t\t\t\tthis.output({\n\t\t\t\t\ttype: \"extension_error\",\n\t\t\t\t\textensionPath: extensionError.path,\n\t\t\t\t\tevent: \"startup\",\n\t\t\t\t\terror: extensionError.error,\n\t\t\t\t});\n\t\t\t}\n\t\t\tthrow error;\n\t\t}\n\t\tif (session !== this.session) return;\n\t\tthis.reloadCoordinator?.publishCurrentState(session);\n\t}\n\n\tdisposeSubscriptions(): void {\n\t\tthis.boundRunner = undefined;\n\t\tthis.unsubscribe?.();\n\t\tthis.unsubscribeBackpressure?.();\n\t\tthis.unsubscribeTasks?.();\n\t\tthis.unsubscribeTasks = undefined;\n\t\tthis.footerDataProvider?.dispose();\n\t\tthis.unsubscribe = undefined;\n\t\tthis.unsubscribeBackpressure = undefined;\n\t\tthis.footerDataProvider = undefined;\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"rpc-session-binding.js","sourceRoot":"","sources":["../../../src/modes/rpc/rpc-session-binding.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAIhE,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AACxE,OAAO,EAAE,4BAA4B,EAAE,MAAM,4BAA4B,CAAC;AAK1E,OAAO,EAAE,uBAAuB,EAAE,MAAM,mDAAmD,CAAC;AAC5F,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,2BAA2B,EAAoC,MAAM,uB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,EAAE,cAAc,CAAC,KAAK;iBAC3B,CAAC,CAAC;YACJ,CAAC;YACD,MAAM,KAAK,CAAC;QACb,CAAC;QACD,IAAI,OAAO,KAAK,IAAI,CAAC,OAAO;YAAE,OAAO;QACrC,IAAI,CAAC,iBAAiB,EAAE,mBAAmB,CAAC,OAAO,CAAC,CAAC;IACtD,CAAC;IAED,oBAAoB;QACnB,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC;QAC7B,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;QACrB,IAAI,CAAC,uBAAuB,EAAE,EAAE,CAAC;QACjC,IAAI,CAAC,gBAAgB,EAAE,EAAE,CAAC;QAC1B,IAAI,CAAC,gBAAgB,GAAG,SAAS,CAAC;QAClC,IAAI,CAAC,2BAA2B,EAAE,EAAE,CAAC;QACrC,IAAI,CAAC,2BAA2B,GAAG,SAAS,CAAC;QAC7C,IAAI,CAAC,kBAAkB,EAAE,OAAO,EAAE,CAAC;QACnC,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC;QAC7B,IAAI,CAAC,uBAAuB,GAAG,SAAS,CAAC;QACzC,IAAI,CAAC,kBAAkB,GAAG,SAAS,CAAC;IACrC,CAAC;CACD","sourcesContent":["import { setCapabilityOverrides } from \"@earendil-works/pi-tui\";\nimport type { AgentSession } from \"../../core/agent-session.js\";\nimport type { AgentSessionRuntime } from \"../../core/agent-session-runtime.ts\";\nimport type { ProjectTrustContext } from \"../../core/extensions/index.js\";\nimport { FooterDataProvider } from \"../../core/footer-data-provider.ts\";\nimport { waitForRawStdoutBackpressure } from \"../../core/output-guard.ts\";\nimport type { EngineCustomUiService } from \"../interactive-engine/engine-custom-ui.ts\";\nimport type { EngineInputFormService } from \"../interactive-engine/engine-input-form.ts\";\nimport type { EngineRenderService } from \"../interactive-engine/engine-render-service.ts\";\nimport type { EngineSessionPickerService } from \"../interactive-engine/engine-session-picker.ts\";\nimport { forwardWorkflowActivity } from \"../interactive-engine/engine-workflow-activity.ts\";\nimport { toJsonEvent } from \"../json-event.ts\";\nimport { createRpcExtensionUIContext, type RpcPendingExtensionRequests } from \"./rpc-extension-ui.ts\";\nimport type { KeybindingsReloadCoordinator } from \"./rpc-keybindings-reload.ts\";\nimport type { RpcOutput } from \"./rpc-responses.ts\";\nimport { bindEngineTaskWidget } from \"./task-ui-bridge.js\";\n\ninterface RpcSessionBindingOptions {\n\truntimeHost: AgentSessionRuntime;\n\toutput: RpcOutput;\n\tpendingExtensionRequests: RpcPendingExtensionRequests;\n\tcustomUi?: EngineCustomUiService;\n\trenderService?: EngineRenderService;\n\tsessionPicker?: EngineSessionPickerService;\n\tinputForm?: EngineInputFormService;\n\t/** Present in the interactive engine child, which reports workflow activity to its host. */\n\twriteEngineLine?: (line: string) => void;\n\trequestShutdown: () => void;\n\treloadCoordinator?: KeybindingsReloadCoordinator<AgentSession>;\n}\n\nexport class RpcSessionBinding {\n\tprivate session: AgentSession;\n\tprivate boundRunner: AgentSession[\"extensionRunner\"] | undefined;\n\tprivate unsubscribe?: () => void;\n\tprivate unsubscribeBackpressure?: () => void;\n\tprivate unsubscribeTasks?: () => void;\n\tprivate unsubscribeWorkflowActivity?: () => void;\n\tprivate readonly runtimeHost: AgentSessionRuntime;\n\tprivate readonly output: RpcOutput;\n\tprivate readonly pendingExtensionRequests: RpcPendingExtensionRequests;\n\tprivate readonly customUi: EngineCustomUiService | undefined;\n\tprivate readonly renderService: EngineRenderService | undefined;\n\tprivate readonly sessionPicker: EngineSessionPickerService | undefined;\n\tprivate readonly inputForm: EngineInputFormService | undefined;\n\tprivate readonly writeEngineLine: ((line: string) => void) | undefined;\n\tprivate readonly requestShutdown: () => void;\n\tprivate readonly reloadCoordinator: KeybindingsReloadCoordinator<AgentSession> | undefined;\n\n\tprivate footerDataProvider: FooterDataProvider | undefined;\n\tconstructor({\n\t\truntimeHost,\n\t\toutput,\n\t\tpendingExtensionRequests,\n\t\trequestShutdown,\n\t\tcustomUi,\n\t\trenderService,\n\t\tsessionPicker,\n\t\tinputForm,\n\t\twriteEngineLine,\n\t\treloadCoordinator,\n\t}: RpcSessionBindingOptions) {\n\t\tthis.runtimeHost = runtimeHost;\n\t\tthis.output = output;\n\t\tthis.pendingExtensionRequests = pendingExtensionRequests;\n\t\tthis.requestShutdown = requestShutdown;\n\t\tthis.customUi = customUi;\n\t\tthis.renderService = renderService;\n\t\tthis.sessionPicker = sessionPicker;\n\t\tthis.inputForm = inputForm;\n\t\tthis.writeEngineLine = writeEngineLine;\n\t\tthis.reloadCoordinator = reloadCoordinator;\n\t\tthis.session = runtimeHost.session;\n\t\tthis.runtimeHost.setProjectTrustContextFactory?.((cwd) => this.createProjectTrustContext(cwd));\n\t}\n\n\tprivate createProjectTrustContext(cwd: string): ProjectTrustContext {\n\t\tconst runner = this.runtimeHost.session.extensionRunner;\n\t\tconst ui = runner.getUIContext();\n\t\tconst hasUI = this.customUi !== undefined;\n\t\treturn {\n\t\t\tcwd,\n\t\t\tmode: hasUI ? \"tui\" : \"rpc\",\n\t\t\thasUI,\n\t\t\tui: {\n\t\t\t\tselect: (title, options, opts) =>\n\t\t\t\t\thasUI\n\t\t\t\t\t\t? runner.withProjectTrustPrompt(\"select\", title, () => ui.select(title, options, opts))\n\t\t\t\t\t\t: Promise.resolve(undefined),\n\t\t\t\tconfirm: (title, message, opts) =>\n\t\t\t\t\thasUI\n\t\t\t\t\t\t? runner.withProjectTrustPrompt(\"confirm\", title, () => ui.confirm(title, message, opts))\n\t\t\t\t\t\t: Promise.resolve(false),\n\t\t\t\tinput: (title, placeholder, opts) =>\n\t\t\t\t\thasUI\n\t\t\t\t\t\t? runner.withProjectTrustPrompt(\"input\", title, () => ui.input(title, placeholder, opts))\n\t\t\t\t\t\t: Promise.resolve(undefined),\n\t\t\t\tnotify: (message, type) => ui.notify(message, type),\n\t\t\t},\n\t\t};\n\t}\n\n\tget currentSession(): AgentSession {\n\t\treturn this.session;\n\t}\n\n\tasync rebindSession(): Promise<void> {\n\t\tif (this.session === this.runtimeHost.session && this.boundRunner === this.session.extensionRunner) return;\n\t\tthis.session = this.runtimeHost.session;\n\t\tthis.disposeSubscriptions();\n\t\tconst session = this.session;\n\t\tsetCapabilityOverrides(session.settingsManager.getTerminalCapabilityOverrides());\n\t\tthis.renderService?.bindSession(session);\n\t\tthis.footerDataProvider = new FooterDataProvider(session.sessionManager.getCwd());\n\t\t// Seed the provider count from the current catalog snapshot, mirroring\n\t\t// updateProviderCountFromSnapshot() in interactive startup, so the\n\t\t// embedded footer shows the (provider) model prefix in multi-provider\n\t\t// sessions instead of defaulting to 0.\n\t\tconst models =\n\t\t\tsession.scopedModels.length > 0\n\t\t\t\t? session.scopedModels.map((scoped) => scoped.model)\n\t\t\t\t: session.modelRuntime.getAvailableSnapshot();\n\t\tthis.footerDataProvider.setAvailableProviderCount(new Set(models.map((model) => model.provider)).size);\n\n\t\ttry {\n\t\t\tawait session.bindExtensions({\n\t\t\t\tuiContext: createRpcExtensionUIContext({\n\t\t\t\t\toutput: this.output,\n\t\t\t\t\tpendingExtensionRequests: this.pendingExtensionRequests,\n\t\t\t\t\tcustomUi: this.customUi,\n\t\t\t\t\tsessionPicker: this.sessionPicker,\n\t\t\t\t\tinputForm: this.inputForm,\n\t\t\t\t\tfooterDataProvider: this.footerDataProvider,\n\t\t\t\t}),\n\t\t\t\tmode: this.customUi ? \"tui\" : \"rpc\",\n\t\t\t\tcommandContextActions: {\n\t\t\t\t\twaitForIdle: () => this.session.agent.waitForIdle(),\n\t\t\t\t\tnewSession: async (options) => this.runtimeHost.newSession(options),\n\t\t\t\t\tfork: async (entryId, forkOptions) => {\n\t\t\t\t\t\tconst result = await this.runtimeHost.fork(entryId, forkOptions);\n\t\t\t\t\t\treturn { cancelled: result.cancelled };\n\t\t\t\t\t},\n\t\t\t\t\tnavigateTree: async (targetId, options) => {\n\t\t\t\t\t\tconst result = await this.session.navigateTree(targetId, {\n\t\t\t\t\t\t\tsummarize: options?.summarize,\n\t\t\t\t\t\t\tcustomInstructions: options?.customInstructions,\n\t\t\t\t\t\t\treplaceInstructions: options?.replaceInstructions,\n\t\t\t\t\t\t\tlabel: options?.label,\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn { cancelled: result.cancelled };\n\t\t\t\t\t},\n\t\t\t\t\tswitchSession: async (sessionPath, options) => {\n\t\t\t\t\t\treturn this.runtimeHost.switchSession(sessionPath, options);\n\t\t\t\t\t},\n\t\t\t\t\treload: async () => {\n\t\t\t\t\t\tconst steeringMode = this.session.steeringMode;\n\t\t\t\t\t\tconst followUpMode = this.session.followUpMode;\n\t\t\t\t\t\tif (this.reloadCoordinator) await this.reloadCoordinator.reload(this.session);\n\t\t\t\t\t\telse await this.session.reload();\n\t\t\t\t\t\tthis.session.setSteeringMode(steeringMode);\n\t\t\t\t\t\tthis.session.setFollowUpMode(followUpMode);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tshutdownHandler: this.requestShutdown,\n\t\t\t\tonError: (err) => {\n\t\t\t\t\tthis.output({\n\t\t\t\t\t\ttype: \"extension_error\",\n\t\t\t\t\t\textensionPath: err.extensionPath,\n\t\t\t\t\t\tevent: err.event,\n\t\t\t\t\t\terror: err.error,\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t});\n\t\t\tthis.footerDataProvider.startGitWatcher();\n\t\t} catch (error) {\n\t\t\t// Leave no partially-initialized footer state behind if extension\n\t\t\t// binding fails; dispose the provider and rethrow.\n\t\t\tthis.footerDataProvider.dispose();\n\t\t\tthis.footerDataProvider = undefined;\n\t\t\tthrow error;\n\t\t}\n\n\t\tif (this.customUi) this.unsubscribeTasks = bindEngineTaskWidget(session, session.extensionRunner.getUIContext());\n\t\tif (this.writeEngineLine) {\n\t\t\tthis.unsubscribeWorkflowActivity = forwardWorkflowActivity(session, this.writeEngineLine);\n\t\t}\n\t\tthis.unsubscribe = session.subscribe((event) => {\n\t\t\tthis.output(toJsonEvent(event));\n\t\t});\n\t\tthis.unsubscribeBackpressure = session.agent.subscribe(async () => {\n\t\t\tawait waitForRawStdoutBackpressure();\n\t\t});\n\t\tthis.reloadCoordinator?.publishCurrentState(session);\n\t\tthis.boundRunner = session.extensionRunner;\n\t}\n\n\t/** Load and atomically publish the optional resource set after the minimal interactive engine binds. */\n\tasync loadDeferredResources(): Promise<void> {\n\t\tconst session = this.session;\n\t\ttry {\n\t\t\tif (!(await this.runtimeHost.completeStartup?.())) {\n\t\t\t\tawait session.reload({ reason: \"startup\", failOnExtensionErrors: true });\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tfor (const extensionError of session.resourceLoader.getExtensions().errors) {\n\t\t\t\tthis.output({\n\t\t\t\t\ttype: \"extension_error\",\n\t\t\t\t\textensionPath: extensionError.path,\n\t\t\t\t\tevent: \"startup\",\n\t\t\t\t\terror: extensionError.error,\n\t\t\t\t});\n\t\t\t}\n\t\t\tthrow error;\n\t\t}\n\t\tif (session !== this.session) return;\n\t\tthis.reloadCoordinator?.publishCurrentState(session);\n\t}\n\n\tdisposeSubscriptions(): void {\n\t\tthis.boundRunner = undefined;\n\t\tthis.unsubscribe?.();\n\t\tthis.unsubscribeBackpressure?.();\n\t\tthis.unsubscribeTasks?.();\n\t\tthis.unsubscribeTasks = undefined;\n\t\tthis.unsubscribeWorkflowActivity?.();\n\t\tthis.unsubscribeWorkflowActivity = undefined;\n\t\tthis.footerDataProvider?.dispose();\n\t\tthis.unsubscribe = undefined;\n\t\tthis.unsubscribeBackpressure = undefined;\n\t\tthis.footerDataProvider = undefined;\n\t}\n}\n"]}
|
package/docs/terminal-setup.md
CHANGED
|
@@ -189,10 +189,12 @@ Atomic reports its state with the [Program Status Protocol (OSC 7501)](https://w
|
|
|
189
189
|
|
|
190
190
|
| State | When |
|
|
191
191
|
|---|---|
|
|
192
|
-
| `working` | An agent run or
|
|
193
|
-
| `blocked` | An extension dialog or
|
|
194
|
-
| `done` |
|
|
195
|
-
| `error` | A run ended with an error that is not retried. The message is the first line of the error
|
|
192
|
+
| `working` | An agent run, compaction, or [workflow](/workflows) run is in progress, even when the chat agent is idle. The message is the session name, or `Compacting context`. |
|
|
193
|
+
| `blocked` | An extension dialog, login, or workflow run or stage waits for you, even while other stages of that run are still executing. The message is the dialog title, or `Workflow waiting for input` or `Workflow needs attention`. |
|
|
194
|
+
| `done` | The agent run and workflow runs finished successfully. The message is the session name. |
|
|
195
|
+
| `error` | A run ended with an error that is not retried, or a workflow run failed. The message is the first line of the error, or `Workflow failed`. |
|
|
196
196
|
| `idle` | Atomic started, or you cancelled the run. |
|
|
197
197
|
|
|
198
|
+
After a workflow failure the status stays `error` until you send your next message, except while the chat agent replies to the run-end notice: it is `working` then, and returns to `error` when that reply finishes. While a workflow run is working or waiting for you, the chat agent finishing a turn does not report `done`.
|
|
199
|
+
|
|
198
200
|
Reports never contain prompts or model output. Atomic sends them only after the terminal answers the protocol's support query; tmux and screen do not forward them. Set `PI_PROGRAM_STATUS=1` to send reports without asking, or `PI_PROGRAM_STATUS=0` to disable reports.
|
|
@@ -490,7 +490,7 @@ Supported targets are Linux x64/ARM64 with glibc or musl, macOS x64/ARM64, and W
|
|
|
490
490
|
|
|
491
491
|
The first workflow action initializes and starts the database. Concurrent Atomic sessions share it. Once ready, it stays running after Atomic exits, including after the last client closes.
|
|
492
492
|
|
|
493
|
-
Cluster ownership records live beside the data in `~/.atomic/postgres/v18.shared`, outside Atomic installation/version directories. On Linux root installs, use `/var/lib/atomic-postgres/v18.shared`. Preserve these records and the existing data if Atomic reports an identity mismatch or missing `PG_VERSION`; do not delete either to force initialization. Closing or reloading an updated Atomic client does not stop a ready shared server. Older clients without this lifetime behavior can still stop servers they started, so finish and close those sessions before relying on the updated behavior for long-running work. An explicit `DBOS_SYSTEM_DATABASE_URL` remains outside managed-cluster lifecycle operations.
|
|
493
|
+
Cluster ownership records live beside the data in `~/.atomic/postgres/v18.shared`, outside Atomic installation/version directories. On Linux root installs, use `/var/lib/atomic-postgres/v18.shared`. Preserve these records and the existing data if Atomic reports an identity mismatch or missing `PG_VERSION`; do not delete either to force initialization. An identity mismatch names the fields that differ, for example `(inode)` or `(systemIdentifier)`. A data directory whose filesystem device number changed after a reboot, as can happen on macOS APFS volumes, is not a mismatch: Atomic attaches the cluster and updates the record when the directory inode, path, and PostgreSQL system identifier still match. Closing or reloading an updated Atomic client does not stop a ready shared server. Older clients without this lifetime behavior can still stop servers they started, so finish and close those sessions before relying on the updated behavior for long-running work. An explicit `DBOS_SYSTEM_DATABASE_URL` remains outside managed-cluster lifecycle operations.
|
|
494
494
|
|
|
495
495
|
New managed PostgreSQL servers start from a complete, immutable runtime under
|
|
496
496
|
`~/.atomic/postgres/pg-runtime` (or `/var/lib/atomic-postgres/pg-runtime` when
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/atomic",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.33-alpha.1",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@bastani/atomic",
|
|
9
|
-
"version": "0.9.
|
|
9
|
+
"version": "0.9.33-alpha.1",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@bastani/atomic-natives": "0.9.
|
|
13
|
-
"@bastani/pi-ai": "0.9.
|
|
12
|
+
"@bastani/atomic-natives": "0.9.33-alpha.1",
|
|
13
|
+
"@bastani/pi-ai": "0.9.33-alpha.1",
|
|
14
14
|
"@dbos-inc/dbos-sdk": "4.25.14",
|
|
15
15
|
"@earendil-works/pi-agent-core": "1.1.0",
|
|
16
16
|
"@earendil-works/pi-client": "1.1.0",
|
|
@@ -432,18 +432,18 @@
|
|
|
432
432
|
}
|
|
433
433
|
},
|
|
434
434
|
"node_modules/@bastani/atomic-natives": {
|
|
435
|
-
"version": "0.9.
|
|
436
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives/-/atomic-natives-0.9.
|
|
435
|
+
"version": "0.9.33-alpha.1",
|
|
436
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives/-/atomic-natives-0.9.33-alpha.1.tgz",
|
|
437
437
|
"license": "MIT",
|
|
438
438
|
"optionalDependencies": {
|
|
439
|
-
"@bastani/atomic-natives-darwin-arm64": "0.9.
|
|
440
|
-
"@bastani/atomic-natives-darwin-x64": "0.9.
|
|
441
|
-
"@bastani/atomic-natives-linux-arm64-gnu": "0.9.
|
|
442
|
-
"@bastani/atomic-natives-linux-arm64-musl": "0.9.
|
|
443
|
-
"@bastani/atomic-natives-linux-x64-gnu": "0.9.
|
|
444
|
-
"@bastani/atomic-natives-linux-x64-musl": "0.9.
|
|
445
|
-
"@bastani/atomic-natives-win32-arm64-msvc": "0.9.
|
|
446
|
-
"@bastani/atomic-natives-win32-x64-msvc": "0.9.
|
|
439
|
+
"@bastani/atomic-natives-darwin-arm64": "0.9.33-alpha.1",
|
|
440
|
+
"@bastani/atomic-natives-darwin-x64": "0.9.33-alpha.1",
|
|
441
|
+
"@bastani/atomic-natives-linux-arm64-gnu": "0.9.33-alpha.1",
|
|
442
|
+
"@bastani/atomic-natives-linux-arm64-musl": "0.9.33-alpha.1",
|
|
443
|
+
"@bastani/atomic-natives-linux-x64-gnu": "0.9.33-alpha.1",
|
|
444
|
+
"@bastani/atomic-natives-linux-x64-musl": "0.9.33-alpha.1",
|
|
445
|
+
"@bastani/atomic-natives-win32-arm64-msvc": "0.9.33-alpha.1",
|
|
446
|
+
"@bastani/atomic-natives-win32-x64-msvc": "0.9.33-alpha.1"
|
|
447
447
|
},
|
|
448
448
|
"engines": {
|
|
449
449
|
"bun": ">=1.4.2",
|
|
@@ -451,8 +451,8 @@
|
|
|
451
451
|
}
|
|
452
452
|
},
|
|
453
453
|
"node_modules/@bastani/atomic-natives-darwin-arm64": {
|
|
454
|
-
"version": "0.9.
|
|
455
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-arm64/-/atomic-natives-darwin-arm64-0.9.
|
|
454
|
+
"version": "0.9.33-alpha.1",
|
|
455
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-arm64/-/atomic-natives-darwin-arm64-0.9.33-alpha.1.tgz",
|
|
456
456
|
"license": "MIT",
|
|
457
457
|
"os": [
|
|
458
458
|
"darwin"
|
|
@@ -463,8 +463,8 @@
|
|
|
463
463
|
"optional": true
|
|
464
464
|
},
|
|
465
465
|
"node_modules/@bastani/atomic-natives-darwin-x64": {
|
|
466
|
-
"version": "0.9.
|
|
467
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-x64/-/atomic-natives-darwin-x64-0.9.
|
|
466
|
+
"version": "0.9.33-alpha.1",
|
|
467
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-x64/-/atomic-natives-darwin-x64-0.9.33-alpha.1.tgz",
|
|
468
468
|
"license": "MIT",
|
|
469
469
|
"os": [
|
|
470
470
|
"darwin"
|
|
@@ -475,8 +475,8 @@
|
|
|
475
475
|
"optional": true
|
|
476
476
|
},
|
|
477
477
|
"node_modules/@bastani/atomic-natives-linux-arm64-gnu": {
|
|
478
|
-
"version": "0.9.
|
|
479
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-arm64-gnu/-/atomic-natives-linux-arm64-gnu-0.9.
|
|
478
|
+
"version": "0.9.33-alpha.1",
|
|
479
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-arm64-gnu/-/atomic-natives-linux-arm64-gnu-0.9.33-alpha.1.tgz",
|
|
480
480
|
"license": "MIT",
|
|
481
481
|
"os": [
|
|
482
482
|
"linux"
|
|
@@ -490,8 +490,8 @@
|
|
|
490
490
|
"optional": true
|
|
491
491
|
},
|
|
492
492
|
"node_modules/@bastani/atomic-natives-linux-arm64-musl": {
|
|
493
|
-
"version": "0.9.
|
|
494
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-arm64-musl/-/atomic-natives-linux-arm64-musl-0.9.
|
|
493
|
+
"version": "0.9.33-alpha.1",
|
|
494
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-arm64-musl/-/atomic-natives-linux-arm64-musl-0.9.33-alpha.1.tgz",
|
|
495
495
|
"license": "MIT",
|
|
496
496
|
"os": [
|
|
497
497
|
"linux"
|
|
@@ -505,8 +505,8 @@
|
|
|
505
505
|
"optional": true
|
|
506
506
|
},
|
|
507
507
|
"node_modules/@bastani/atomic-natives-linux-x64-gnu": {
|
|
508
|
-
"version": "0.9.
|
|
509
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-x64-gnu/-/atomic-natives-linux-x64-gnu-0.9.
|
|
508
|
+
"version": "0.9.33-alpha.1",
|
|
509
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-x64-gnu/-/atomic-natives-linux-x64-gnu-0.9.33-alpha.1.tgz",
|
|
510
510
|
"license": "MIT",
|
|
511
511
|
"os": [
|
|
512
512
|
"linux"
|
|
@@ -520,8 +520,8 @@
|
|
|
520
520
|
"optional": true
|
|
521
521
|
},
|
|
522
522
|
"node_modules/@bastani/atomic-natives-linux-x64-musl": {
|
|
523
|
-
"version": "0.9.
|
|
524
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-x64-musl/-/atomic-natives-linux-x64-musl-0.9.
|
|
523
|
+
"version": "0.9.33-alpha.1",
|
|
524
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-x64-musl/-/atomic-natives-linux-x64-musl-0.9.33-alpha.1.tgz",
|
|
525
525
|
"license": "MIT",
|
|
526
526
|
"os": [
|
|
527
527
|
"linux"
|
|
@@ -535,8 +535,8 @@
|
|
|
535
535
|
"optional": true
|
|
536
536
|
},
|
|
537
537
|
"node_modules/@bastani/atomic-natives-win32-arm64-msvc": {
|
|
538
|
-
"version": "0.9.
|
|
539
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-arm64-msvc/-/atomic-natives-win32-arm64-msvc-0.9.
|
|
538
|
+
"version": "0.9.33-alpha.1",
|
|
539
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-arm64-msvc/-/atomic-natives-win32-arm64-msvc-0.9.33-alpha.1.tgz",
|
|
540
540
|
"license": "MIT",
|
|
541
541
|
"os": [
|
|
542
542
|
"win32"
|
|
@@ -547,8 +547,8 @@
|
|
|
547
547
|
"optional": true
|
|
548
548
|
},
|
|
549
549
|
"node_modules/@bastani/atomic-natives-win32-x64-msvc": {
|
|
550
|
-
"version": "0.9.
|
|
551
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-x64-msvc/-/atomic-natives-win32-x64-msvc-0.9.
|
|
550
|
+
"version": "0.9.33-alpha.1",
|
|
551
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-x64-msvc/-/atomic-natives-win32-x64-msvc-0.9.33-alpha.1.tgz",
|
|
552
552
|
"license": "MIT",
|
|
553
553
|
"os": [
|
|
554
554
|
"win32"
|
|
@@ -559,8 +559,8 @@
|
|
|
559
559
|
"optional": true
|
|
560
560
|
},
|
|
561
561
|
"node_modules/@bastani/pi-ai": {
|
|
562
|
-
"version": "0.9.
|
|
563
|
-
"resolved": "https://registry.npmjs.org/@bastani/pi-ai/-/pi-ai-0.9.
|
|
562
|
+
"version": "0.9.33-alpha.1",
|
|
563
|
+
"resolved": "https://registry.npmjs.org/@bastani/pi-ai/-/pi-ai-0.9.33-alpha.1.tgz",
|
|
564
564
|
"license": "MIT",
|
|
565
565
|
"dependencies": {
|
|
566
566
|
"@anthropic-ai/sdk": "0.129.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/atomic",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.33-alpha.1",
|
|
4
4
|
"description": "Atomic coding agent CLI with read, bash, edit, write tools and session management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"atomicConfig": {
|
|
@@ -82,8 +82,8 @@
|
|
|
82
82
|
"prepublishOnly": "bun run clean && bun run build && bun run shrinkwrap"
|
|
83
83
|
},
|
|
84
84
|
"dependencies": {
|
|
85
|
-
"@bastani/atomic-natives": "0.9.
|
|
86
|
-
"@bastani/pi-ai": "0.9.
|
|
85
|
+
"@bastani/atomic-natives": "0.9.33-alpha.1",
|
|
86
|
+
"@bastani/pi-ai": "0.9.33-alpha.1",
|
|
87
87
|
"@dbos-inc/dbos-sdk": "4.25.14",
|
|
88
88
|
"@earendil-works/pi-agent-core": "1.1.0",
|
|
89
89
|
"@earendil-works/pi-client": "1.1.0",
|