@bastani/atomic 0.9.46-alpha.1 → 0.9.47-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.
Files changed (71) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/dist/builtin/intercom/CHANGELOG.md +11 -0
  3. package/dist/builtin/intercom/package.json +1 -1
  4. package/dist/builtin/mcp/package.json +1 -1
  5. package/dist/builtin/subagents/CHANGELOG.md +11 -0
  6. package/dist/builtin/subagents/package.json +1 -1
  7. package/dist/builtin/subagents/src/extension/index.bundle.mjs +2 -2
  8. package/dist/builtin/web-access/package.json +1 -1
  9. package/dist/builtin/workflows/CHANGELOG.md +40 -0
  10. package/dist/builtin/workflows/package.json +1 -1
  11. package/dist/builtin/workflows/src/extension/index.bundle.mjs +55 -28
  12. package/dist/builtin/workflows/src/extension/local-worker-entry.mjs +55 -28
  13. package/dist/builtin/workflows/src/index.js +55 -28
  14. package/dist/builtin/workflows/src/local-worker-entry.mjs +55 -28
  15. package/dist/core/agent-session-tasks.d.ts.map +1 -1
  16. package/dist/core/agent-session-tasks.js +8 -1
  17. package/dist/core/agent-session-tasks.js.map +1 -1
  18. package/dist/core/extensions/ui-types.d.ts +9 -1
  19. package/dist/core/extensions/ui-types.d.ts.map +1 -1
  20. package/dist/core/extensions/ui-types.js.map +1 -1
  21. package/dist/core/model-resolver-defaults.js +2 -2
  22. package/dist/core/model-resolver-defaults.js.map +1 -1
  23. package/dist/core/package-manager-npm.d.ts.map +1 -1
  24. package/dist/core/package-manager-npm.js +7 -3
  25. package/dist/core/package-manager-npm.js.map +1 -1
  26. package/dist/core/tasks/completion.d.ts +6 -1
  27. package/dist/core/tasks/completion.d.ts.map +1 -1
  28. package/dist/core/tasks/completion.js +33 -18
  29. package/dist/core/tasks/completion.js.map +1 -1
  30. package/dist/core/tasks/pause.d.ts +2 -1
  31. package/dist/core/tasks/pause.d.ts.map +1 -1
  32. package/dist/core/tasks/pause.js +3 -2
  33. package/dist/core/tasks/pause.js.map +1 -1
  34. package/dist/core/tools/grep.d.ts.map +1 -1
  35. package/dist/core/tools/grep.js +6 -4
  36. package/dist/core/tools/grep.js.map +1 -1
  37. package/dist/core/tools/shell-task-status.d.ts.map +1 -1
  38. package/dist/core/tools/shell-task-status.js +2 -1
  39. package/dist/core/tools/shell-task-status.js.map +1 -1
  40. package/dist/extensions/codemode/execute.d.ts.map +1 -1
  41. package/dist/extensions/codemode/execute.js +14 -2
  42. package/dist/extensions/codemode/execute.js.map +1 -1
  43. package/dist/extensions/tool-search/tool.d.ts +6 -0
  44. package/dist/extensions/tool-search/tool.d.ts.map +1 -1
  45. package/dist/extensions/tool-search/tool.js +41 -6
  46. package/dist/extensions/tool-search/tool.js.map +1 -1
  47. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  48. package/dist/modes/interactive/components/assistant-message.js +20 -12
  49. package/dist/modes/interactive/components/assistant-message.js.map +1 -1
  50. package/dist/modes/interactive/interactive-extension-custom-ui.js +1 -1
  51. package/dist/modes/interactive/interactive-extension-custom-ui.js.map +1 -1
  52. package/dist/modes/interactive/interactive-extension-dialogs.js +10 -4
  53. package/dist/modes/interactive/interactive-extension-dialogs.js.map +1 -1
  54. package/dist/modes/interactive/interactive-mode-surface.d.ts +1 -0
  55. package/dist/modes/interactive/interactive-mode-surface.d.ts.map +1 -1
  56. package/dist/modes/interactive/interactive-mode-surface.js.map +1 -1
  57. package/dist/modes/interactive-engine/engine-custom-ui.d.ts +3 -0
  58. package/dist/modes/interactive-engine/engine-custom-ui.d.ts.map +1 -1
  59. package/dist/modes/interactive-engine/engine-custom-ui.js +1 -0
  60. package/dist/modes/interactive-engine/engine-custom-ui.js.map +1 -1
  61. package/dist/modes/interactive-engine/protocol.d.ts +6 -0
  62. package/dist/modes/interactive-engine/protocol.d.ts.map +1 -1
  63. package/dist/modes/interactive-engine/protocol.js +9 -0
  64. package/dist/modes/interactive-engine/protocol.js.map +1 -1
  65. package/dist/modes/interactive-engine/remote-component.d.ts.map +1 -1
  66. package/dist/modes/interactive-engine/remote-component.js +3 -2
  67. package/dist/modes/interactive-engine/remote-component.js.map +1 -1
  68. package/docs/llama-cpp.md +25 -14
  69. package/docs/tui.md +2 -0
  70. package/npm-shrinkwrap.json +32 -32
  71. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"remote-component.js","sourceRoot":"","sources":["../../../src/modes/interactive-engine/remote-component.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAG3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAsBvE;;;GAGG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,GAAG,CAAC;AAOjD,MAAM,eAAe;IACZ,aAAa,CAAkC;IACvD,gBAAgB;QACf,OAAO,IAAI,CAAC,aAAa,CAAC;IAC3B,CAAC;IACD,QAAQ,CAAC,KAAwB;QAChC,IAAI,CAAC,IAAI,CAAC,QAAQ;YACjB,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,EAAE,IAAI,EAAE,sBAAsB,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,KAAK,EAAE,CAAC,CAAC;IACzG,CAAC;IACD,eAAe,GAAG,IAAI,CAAC;IACd,uBAAuB,CAAU;IAClC,KAAK,GAAG,CAAC,2BAA2B,CAAC,CAAC;IACtC,KAAK,GAAG,CAAC,CAAC;IACV,IAAI,GAAG,CAAC,CAAC;IACT,SAAS,GAAG,CAAC,CAAC;IACd,cAAc,GAAG,CAAC,CAAC;IACnB,gBAAgB,GAAG,CAAC,CAAC;IACrB,KAAK,GAAG,IAAI,CAAC;IACb,QAAQ,GAAG,KAAK,CAAC;IACR,aAAa,GAAG,IAAI,GAAG,EAAwB,CAAC;IAChD,UAAU,GAAG,IAAI,qBAAqB,EAAE,CAAC;IAEzC,WAAW,CAAS;I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sourcesContent":["import type { Component, OverlayHandle, OverlayOptions, TUI } from \"@earendil-works/pi-tui\";\nimport type { ExtensionUIContext } from \"../../core/extensions/index.js\";\nimport type { WidgetScrollRequest, WidgetScrollState } from \"../../core/extensions/ui-types.js\";\nimport { copyToClipboard } from \"../../utils/clipboard.js\";\nimport type { IsolatedInteractiveRuntime } from \"./isolated-runtime.js\";\nimport type { InteractiveEngineMessage, JsonValue, SerializableOverlayOptions } from \"./protocol.ts\";\nimport { RemoteFrameWidthClamp } from \"./remote-frame-clamp.ts\";\nimport { TerminalModeController } from \"./terminal-mode-controller.ts\";\n\nexport type RemoteComponentRuntime = Pick<\n\tIsolatedInteractiveRuntime,\n\t\"onEngineMessage\" | \"onGenerationEnded\" | \"sendEngineCommand\"\n>;\n\nexport type RemoteComponentUI = Pick<ExtensionUIContext, \"custom\" | \"requestRender\" | \"setWidget\" | \"onWidgetRelease\">;\n\ninterface MountedRemoteComponent {\n\tcomponent: RemoteComponent;\n\tdone: (result: JsonValue | undefined) => void;\n\tengineDone: boolean;\n\t/** The extension declared that this component binds Ctrl+C itself. */\n\thandlesCtrlC: boolean;\n\t/** The extension declared that this component claims internal UI actions. */\n\thandlesInternalUiAction: boolean;\n\thandle?: OverlayHandle;\n\twidgetKey?: string;\n\tunsubscribeWidgetRelease?: () => void;\n}\n\n/**\n * A stalled engine must not make fullscreen input wait forever. A timed-out\n * reply is treated as unhandled and lets the viewport process the key.\n */\nexport const REMOTE_INPUT_REPLY_TIMEOUT_MS = 250;\n\ninterface PendingInput {\n\tresolve: (handled: boolean | undefined) => void;\n\ttimer: ReturnType<typeof setTimeout>;\n}\n\nclass RemoteComponent implements Component {\n\tprivate scrollRequest: WidgetScrollRequest | undefined;\n\tgetScrollRequest(): WidgetScrollRequest | undefined {\n\t\treturn this.scrollRequest;\n\t}\n\tonScroll(state: WidgetScrollState): void {\n\t\tif (!this.disposed)\n\t\t\tthis.runtime.sendEngineCommand({ type: \"engine_custom_scroll\", componentId: this.componentId, state });\n\t}\n\twantsKeyRelease = true;\n\treadonly handlesInternalUiAction: boolean;\n\tprivate lines = [\"Loading remote component…\"];\n\tprivate width = 0;\n\tprivate rows = 0;\n\tprivate requestId = 0;\n\tprivate inputRequestId = 0;\n\tprivate appliedRequestId = 0;\n\tprivate dirty = true;\n\tprivate disposed = false;\n\tprivate readonly pendingInputs = new Map<number, PendingInput>();\n\tprivate readonly frameClamp = new RemoteFrameWidthClamp();\n\n\tprivate readonly componentId: string;\n\tprivate readonly runtime: RemoteComponentRuntime;\n\tprivate readonly requestRender: () => void;\n\tprivate readonly getRows: () => number;\n\n\tconstructor(\n\t\tcomponentId: string,\n\t\truntime: RemoteComponentRuntime,\n\t\trequestRender: () => void,\n\t\tgetRows: () => number,\n\t\thandlesInternalUiAction = false,\n\t) {\n\t\tthis.componentId = componentId;\n\t\tthis.runtime = runtime;\n\t\tthis.requestRender = requestRender;\n\t\tthis.getRows = getRows;\n\t\tthis.handlesInternalUiAction = handlesInternalUiAction;\n\t}\n\n\trender(width: number): string[] {\n\t\tconst rows = this.getRows();\n\t\tif (!this.disposed && (this.dirty || width !== this.width || rows !== this.rows)) {\n\t\t\tthis.width = width;\n\t\t\tthis.rows = rows;\n\t\t\tthis.dirty = false;\n\t\t\tthis.runtime.sendEngineCommand({\n\t\t\t\ttype: \"engine_custom_render\",\n\t\t\t\tcomponentId: this.componentId,\n\t\t\t\trequestId: ++this.requestId,\n\t\t\t\twidth,\n\t\t\t\trows,\n\t\t\t});\n\t\t}\n\t\t// The engine child re-renders asynchronously; until the fresh frame\n\t\t// arrives, the previous frame may be wrapped for an older terminal\n\t\t// width. Clamp so a resize never replays overflowing lines (pi-tui\n\t\t// crashes on any rendered line wider than the terminal).\n\t\treturn this.frameClamp.clamp(this.lines, width);\n\t}\n\n\thandleInput(data: string): Promise<boolean | undefined> {\n\t\tif (this.disposed) return Promise.resolve(undefined);\n\t\tconst requestId = ++this.inputRequestId;\n\t\tconst result = new Promise<boolean | undefined>((resolve) => {\n\t\t\tconst timer = setTimeout(() => this.resolveInput(requestId, false), REMOTE_INPUT_REPLY_TIMEOUT_MS);\n\t\t\ttimer.unref?.();\n\t\t\tthis.pendingInputs.set(requestId, { resolve, timer });\n\t\t});\n\t\ttry {\n\t\t\tthis.runtime.sendEngineCommand({\n\t\t\t\ttype: \"engine_custom_input\",\n\t\t\t\tcomponentId: this.componentId,\n\t\t\t\trequestId,\n\t\t\t\tdata,\n\t\t\t});\n\t\t} catch {\n\t\t\tthis.resolveInput(requestId, false);\n\t\t}\n\t\t// Engine commands are delivered in order, so a frame requested now is\n\t\t// rendered by the child only AFTER it has applied this input. Pipelining\n\t\t// the request keeps keypress latency at a single round trip and repaints\n\t\t// components that never self-invalidate, instead of waiting for a\n\t\t// child-side invalidate (or an unrelated refresh) to trigger a frame.\n\t\tthis.dirty = true;\n\t\tthis.requestRender();\n\t\treturn result;\n\t}\n\n\tresolveInput(requestId: number, handled: boolean | undefined): void {\n\t\tconst pending = this.pendingInputs.get(requestId);\n\t\tif (!pending) return;\n\t\tthis.pendingInputs.delete(requestId);\n\t\tclearTimeout(pending.timer);\n\t\tpending.resolve(handled);\n\t}\n\n\tinvalidate(): void {\n\t\tthis.dirty = true;\n\t}\n\n\tapplyFrame(requestId: number, lines: string[], scrollRequest?: WidgetScrollRequest): void {\n\t\tif (this.disposed || requestId < this.appliedRequestId) return;\n\t\tthis.appliedRequestId = requestId;\n\t\tthis.lines = lines;\n\t\tthis.scrollRequest = scrollRequest;\n\t\tthis.requestRender();\n\t}\n\n\trequestRemoteRender(): void {\n\t\tif (this.disposed) return;\n\t\tthis.dirty = true;\n\t\tthis.requestRender();\n\t}\n\n\t/**\n\t * Tear the proxy down. `notifyEngine` must be false once the writer no longer\n\t * points at the generation that owns this component: component IDs restart at\n\t * `remote_component_1` for every child, so a late dispose would address an\n\t * unrelated component in the replacement engine.\n\t */\n\tdispose(notifyEngine = true): void {\n\t\tif (this.disposed) return;\n\t\tthis.disposed = true;\n\t\tfor (const requestId of [...this.pendingInputs.keys()]) this.resolveInput(requestId, undefined);\n\t\tif (notifyEngine)\n\t\t\tthis.runtime.sendEngineCommand({ type: \"engine_custom_dispose\", componentId: this.componentId });\n\t}\n}\n\nfunction overlayOptions(options: SerializableOverlayOptions | undefined): OverlayOptions | undefined {\n\treturn options as OverlayOptions | undefined;\n}\n\n/**\n * Resolve the real host terminal from the pi-tui TUI handed to the overlay\n * factory. Optional: some hosts / test seams do not surface `tui.terminal`, in\n * which case terminal-mode controls harmlessly no-op.\n */\nfunction hostTerminal(tui: TUI): { write(data: string): void } {\n\tconst terminal = (tui as { terminal?: { write?(data: string): void } }).terminal;\n\treturn typeof terminal?.write === \"function\" ? (terminal as { write(data: string): void }) : { write: () => {} };\n}\n\nexport interface TuiRendererLifecycle {\n\tisFullscreen(): boolean;\n\tonRendererReplaced(listener: () => void): () => void;\n}\n\nexport class RemoteComponentController {\n\tprivate readonly mounted = new Map<string, MountedRemoteComponent>();\n\tprivate readonly unsubscribe: () => void;\n\tprivate readonly unsubscribeGenerationEnded: () => void;\n\tprivate readonly terminalModes: TerminalModeController;\n\tprivate readonly unsubscribeTuiRendererReplaced: () => void;\n\n\tprivate readonly runtime: RemoteComponentRuntime;\n\tprivate readonly ui: RemoteComponentUI;\n\tprivate readonly copyText: (text: string) => Promise<void>;\n\n\tconstructor(\n\t\truntime: RemoteComponentRuntime,\n\t\tui: RemoteComponentUI,\n\t\ttuiRendererLifecycle: TuiRendererLifecycle,\n\t\tcopyText: (text: string) => Promise<void> = copyToClipboard,\n\t) {\n\t\tthis.runtime = runtime;\n\t\tthis.ui = ui;\n\t\tthis.copyText = copyText;\n\t\tthis.terminalModes = new TerminalModeController(() => tuiRendererLifecycle.isFullscreen());\n\t\tthis.unsubscribeTuiRendererReplaced = tuiRendererLifecycle.onRendererReplaced(() =>\n\t\t\tthis.terminalModes.rebindTui(),\n\t\t);\n\t\tthis.unsubscribe = runtime.onEngineMessage((message) => this.handleMessage(message));\n\t\t// Teardown is driven by engine death rather than the NEXT generation's\n\t\t// `engine_ready`, so a crash with no restart, or a hung/failed restart,\n\t\t// still releases the host editor, focus, and inline-custom-UI depth.\n\t\tthis.unsubscribeGenerationEnded = runtime.onGenerationEnded(() => this.disposeAll(\"generation-lost\"));\n\t}\n\n\tdispose(): void {\n\t\tthis.unsubscribeTuiRendererReplaced();\n\t\tthis.unsubscribe();\n\t\tthis.unsubscribeGenerationEnded();\n\t\tthis.disposeAll(\"host-shutdown\");\n\t}\n\n\t/** The remote overlay proxy that currently holds focus (see remote-input-ownership.ts). */\n\tfocusedRemoteOverlay(): unknown {\n\t\tfor (const record of this.mounted.values()) {\n\t\t\tif (record.handle?.isFocused() === true) return record.component;\n\t\t}\n\t\treturn undefined;\n\t}\n\n\t/** `component` itself when it is one of this generation's live non-widget proxies. */\n\tremoteProxyOwner(component: unknown): unknown {\n\t\tif (!(component instanceof RemoteComponent)) return undefined;\n\t\tfor (const record of this.mounted.values()) {\n\t\t\tif (record.component === component) return record.widgetKey === undefined ? component : undefined;\n\t\t}\n\t\treturn undefined;\n\t}\n\n\t/** True when the extension that mounted `component` declared it binds Ctrl+C. */\n\tremoteProxyHandlesCtrlC(component: unknown): boolean {\n\t\tfor (const record of this.mounted.values()) {\n\t\t\tif (record.component === component) return record.handlesCtrlC;\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * Close exactly one live proxy through the ordinary host close path.\n\t *\n\t * The host escape from a component that traps Ctrl+C, and deliberately not\n\t * `disposeAll()`: that is generation-death teardown, which would also close\n\t * unrelated nested components and suppress the child notification. Here the\n\t * record stays registered while `done` runs, so `showExtensionCustom()`\n\t * hides this overlay (or remounts the editor) and its finalizer disposes the\n\t * proxy normally — which tells the healthy child to resolve its own\n\t * `ui.custom()` promise with `undefined`, exactly like a user cancel.\n\t */\n\tdismissRemoteProxy(component: unknown): boolean {\n\t\tfor (const record of this.mounted.values()) {\n\t\t\tif (record.component !== component || record.widgetKey !== undefined) continue;\n\t\t\trecord.done(undefined);\n\t\t\tthis.ui.requestRender();\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate releaseWidget(widgetKey: string): void {\n\t\tfor (const [componentId, record] of this.mounted) {\n\t\t\tif (record.widgetKey !== widgetKey) continue;\n\t\t\tthis.mounted.delete(componentId);\n\t\t\trecord.unsubscribeWidgetRelease?.();\n\t\t\trecord.unsubscribeWidgetRelease = undefined;\n\t\t\tthis.terminalModes.onUnmount(componentId);\n\t\t}\n\t}\n\t/**\n\t * Close every mounted component.\n\t *\n\t * `\"generation-lost\"` closes through the real host close path: it hides the\n\t * overlay or remounts the editor into `editorContainer`, restores the saved\n\t * draft and focus, releases `blockingInlineCustomUiDepth`, and resolves the\n\t * extension's `ui.custom()` promise. Records are removed BEFORE each `done`\n\t * runs so the settlement path cannot re-enter the controller, and proxy\n\t * disposal is local-only because the writer already points at a replacement\n\t * child whose component IDs restart at `remote_component_1`.\n\t *\n\t * Order is newest-first, matching the TUI's overlay stack. Closing oldest\n\t * first would let an overlay mounted above an inline proxy restore focus to\n\t * that inline proxy after it had already been disposed.\n\t *\n\t * `\"host-shutdown\"` notifies the still-live engine child instead and leaves\n\t * host mounts alone: the TUI is already stopping and must not repaint.\n\t */\n\tprivate disposeAll(reason: \"generation-lost\" | \"host-shutdown\"): void {\n\t\tconst records = [...this.mounted.entries()].reverse();\n\t\tthis.mounted.clear();\n\t\tfor (const [componentId, record] of records) {\n\t\t\tthis.terminalModes.onUnmount(componentId);\n\t\t\trecord.unsubscribeWidgetRelease?.();\n\t\t\trecord.component.dispose(reason === \"host-shutdown\" && !record.engineDone);\n\t\t\tif (record.widgetKey) this.ui.setWidget(record.widgetKey, undefined);\n\t\t\telse if (reason === \"generation-lost\") record.done(undefined);\n\t\t}\n\t\tthis.terminalModes.resetAll();\n\t\tif (reason === \"generation-lost\" && records.length > 0) this.ui.requestRender();\n\t}\n\n\tprivate handleMessage(message: InteractiveEngineMessage): void {\n\t\tswitch (message.type) {\n\t\t\tcase \"engine_ready\":\n\t\t\t\t// Idempotent fallback for a generation replacement whose death event\n\t\t\t\t// was already handled: stale records must be gone before the new child\n\t\t\t\t// can reuse `remote_component_1`, and any terminal modes the dead\n\t\t\t\t// generation left on are reset here too.\n\t\t\t\tthis.disposeAll(\"generation-lost\");\n\t\t\t\tbreak;\n\t\t\tcase \"engine_custom_open\":\n\t\t\t\tthis.open(\n\t\t\t\t\tmessage.componentId,\n\t\t\t\t\tmessage.overlay,\n\t\t\t\t\tmessage.deferInlineCustomUiFocus,\n\t\t\t\t\tmessage.overlayOptions,\n\t\t\t\t\tmessage.widgetKey,\n\t\t\t\t\tmessage.widgetPlacement,\n\t\t\t\t\tmessage.handlesCtrlC === true,\n\t\t\t\t\tmessage.handlesInternalUiAction === true,\n\t\t\t\t\tmessage.reserveTranscriptRows === true,\n\t\t\t\t\tmessage.purpose,\n\t\t\t\t\tmessage.widgetScroll,\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\tcase \"engine_custom_close\":\n\t\t\t\tthis.close(message.componentId);\n\t\t\t\tbreak;\n\t\t\tcase \"engine_custom_frame\":\n\t\t\t\tthis.mounted\n\t\t\t\t\t.get(message.componentId)\n\t\t\t\t\t?.component.applyFrame(message.requestId, message.lines, message.scrollRequest);\n\t\t\t\tbreak;\n\t\t\tcase \"engine_custom_input_result\":\n\t\t\t\tthis.mounted.get(message.componentId)?.component.resolveInput(message.requestId, message.handled);\n\t\t\t\tbreak;\n\t\t\tcase \"engine_custom_invalidate\":\n\t\t\t\tthis.mounted.get(message.componentId)?.component.requestRemoteRender();\n\t\t\t\tbreak;\n\t\t\tcase \"engine_custom_copy\":\n\t\t\t\tvoid (async () => {\n\t\t\t\t\tlet error: string | undefined;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (!this.mounted.has(message.componentId)) throw new Error(\"Sign-in screen is no longer open\");\n\t\t\t\t\t\tawait this.copyText(message.text);\n\t\t\t\t\t} catch (cause) {\n\t\t\t\t\t\terror = cause instanceof Error ? cause.message : String(cause);\n\t\t\t\t\t}\n\t\t\t\t\tthis.runtime.sendEngineCommand({\n\t\t\t\t\t\ttype: \"engine_custom_copy_result\",\n\t\t\t\t\t\tcomponentId: message.componentId,\n\t\t\t\t\t\trequestId: message.requestId,\n\t\t\t\t\t\terror,\n\t\t\t\t\t});\n\t\t\t\t})();\n\t\t\t\tbreak;\n\t\t\tcase \"engine_custom_terminal\":\n\t\t\t\tthis.terminalModes.applyControl(message.componentId, message.control);\n\t\t\t\tbreak;\n\t\t\tcase \"engine_custom_done\": {\n\t\t\t\tconst record = this.mounted.get(message.componentId);\n\t\t\t\tif (record) {\n\t\t\t\t\trecord.engineDone = true;\n\t\t\t\t\trecord.done(message.result);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"engine_custom_control\":\n\t\t\t\tthis.control(message.componentId, message.action);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tprivate open(\n\t\tcomponentId: string,\n\t\toverlay: boolean,\n\t\tdeferInlineCustomUiFocus: boolean | undefined,\n\t\toptions: SerializableOverlayOptions | undefined,\n\t\twidgetKey?: string,\n\t\twidgetPlacement?: \"aboveEditor\" | \"belowEditor\",\n\t\thandlesCtrlC = false,\n\t\thandlesInternalUiAction = false,\n\t\treserveTranscriptRows = false,\n\t\tpurpose?: \"prompt\" | \"navigation\",\n\t\twidgetScroll?: { maxHeight: number; maxHeightFraction?: number },\n\t): void {\n\t\tif (this.mounted.has(componentId)) return;\n\t\tif (widgetKey) {\n\t\t\tlet getRows = () => 24;\n\t\t\tconst component = new RemoteComponent(\n\t\t\t\tcomponentId,\n\t\t\t\tthis.runtime,\n\t\t\t\t() => this.ui.requestRender(),\n\t\t\t\t() => getRows(),\n\t\t\t\thandlesInternalUiAction,\n\t\t\t);\n\t\t\tconst unsubscribeWidgetRelease = this.ui.onWidgetRelease?.(widgetKey, () => this.releaseWidget(widgetKey));\n\t\t\tthis.mounted.set(componentId, {\n\t\t\t\tcomponent,\n\t\t\t\tdone: () => {},\n\t\t\t\tengineDone: false,\n\t\t\t\thandlesCtrlC,\n\t\t\t\thandlesInternalUiAction,\n\t\t\t\twidgetKey,\n\t\t\t\tunsubscribeWidgetRelease,\n\t\t\t});\n\t\t\tthis.ui.setWidget(\n\t\t\t\twidgetKey,\n\t\t\t\t(tui) => {\n\t\t\t\t\tgetRows = () => tui.terminal.rows;\n\t\t\t\t\treturn component;\n\t\t\t\t},\n\t\t\t\t{ placement: widgetPlacement, ...(widgetScroll ? { scroll: widgetScroll } : {}) },\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\t\tlet mounted: MountedRemoteComponent | undefined;\n\t\tvoid this.ui\n\t\t\t.custom<JsonValue | undefined>(\n\t\t\t\t(tui, _theme, _keybindings, done) => {\n\t\t\t\t\tconst component = new RemoteComponent(\n\t\t\t\t\t\tcomponentId,\n\t\t\t\t\t\tthis.runtime,\n\t\t\t\t\t\t() => this.ui.requestRender(),\n\t\t\t\t\t\t() => tui.terminal.rows,\n\t\t\t\t\t\thandlesInternalUiAction,\n\t\t\t\t\t);\n\t\t\t\t\tmounted = { component, done, engineDone: false, handlesCtrlC, handlesInternalUiAction };\n\t\t\t\t\tthis.mounted.set(componentId, mounted);\n\t\t\t\t\t// Bind this component to the real host terminal so a buffered\n\t\t\t\t\t// autowrap control emitted before the mount frame applies to the host TTY.\n\t\t\t\t\tthis.terminalModes.onMount(componentId, hostTerminal(tui));\n\t\t\t\t\treturn component;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\toverlay,\n\t\t\t\t\tpurpose,\n\t\t\t\t\tdeferInlineCustomUiFocus,\n\t\t\t\t\thandlesInternalUiAction,\n\t\t\t\t\treserveTranscriptRows,\n\t\t\t\t\toverlayOptions: overlayOptions(options),\n\t\t\t\t\tonHandle: (handle) => {\n\t\t\t\t\t\tif (mounted) mounted.handle = handle;\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t)\n\t\t\t.catch(() => undefined)\n\t\t\t.finally(() => {\n\t\t\t\tthis.terminalModes.onUnmount(componentId);\n\t\t\t\tconst record = this.mounted.get(componentId);\n\t\t\t\tif (!record) return;\n\t\t\t\tthis.mounted.delete(componentId);\n\t\t\t\tif (record.engineDone) record.component.dispose(false);\n\t\t\t\telse record.component.dispose();\n\t\t\t});\n\t}\n\n\tprivate close(componentId: string): void {\n\t\tconst record = this.mounted.get(componentId);\n\t\tif (!record) return;\n\t\tthis.terminalModes.onUnmount(componentId);\n\t\tthis.mounted.delete(componentId);\n\t\trecord.unsubscribeWidgetRelease?.();\n\t\tif (record.widgetKey) this.ui.setWidget(record.widgetKey, undefined);\n\t\trecord.component.dispose();\n\t}\n\n\tprivate control(componentId: string, action: \"focus\" | \"hide\" | \"show\" | \"unfocus\"): void {\n\t\tconst handle = this.mounted.get(componentId)?.handle;\n\t\tif (!handle) return;\n\t\tswitch (action) {\n\t\t\tcase \"focus\":\n\t\t\t\thandle.focus();\n\t\t\t\tbreak;\n\t\t\tcase \"hide\":\n\t\t\t\thandle.setHidden(true);\n\t\t\t\tbreak;\n\t\t\tcase \"show\":\n\t\t\t\thandle.setHidden(false);\n\t\t\t\tbreak;\n\t\t\tcase \"unfocus\":\n\t\t\t\thandle.unfocus();\n\t\t\t\tbreak;\n\t\t}\n\t}\n}\n"]}
1
+ {"version":3,"file":"remote-component.js","sourceRoot":"","sources":["../../../src/modes/interactive-engine/remote-component.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAQ3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAsBvE;;;GAGG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,GAAG,CAAC;AAOjD,MAAM,eAAe;IACZ,aAAa,CAAkC;IACvD,gBAAgB;QACf,OAAO,IAAI,CAAC,aAAa,CAAC;IAC3B,CAAC;IACD,QAAQ,CAAC,KAAwB;QAChC,IAAI,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AC,SAAS,CAAC,MAAM,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QACrE,MAAM,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;IAC5B,CAAC;IAEO,OAAO,CAAC,WAAmB,EAAE,MAA6C;QACjF,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;QACrD,IAAI,CAAC,MAAM;YAAE,OAAO;QACpB,QAAQ,MAAM,EAAE,CAAC;YAChB,KAAK,OAAO;gBACX,MAAM,CAAC,KAAK,EAAE,CAAC;gBACf,MAAM;YACP,KAAK,MAAM;gBACV,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;gBACvB,MAAM;YACP,KAAK,MAAM;gBACV,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;gBACxB,MAAM;YACP,KAAK,SAAS;gBACb,MAAM,CAAC,OAAO,EAAE,CAAC;gBACjB,MAAM;QACR,CAAC;IACF,CAAC;CACD","sourcesContent":["import type { Component, OverlayHandle, OverlayOptions, TUI } from \"@earendil-works/pi-tui\";\nimport type { ExtensionUIContext } from \"../../core/extensions/index.js\";\nimport type { WidgetScrollRequest, WidgetScrollState } from \"../../core/extensions/ui-types.js\";\nimport { copyToClipboard } from \"../../utils/clipboard.js\";\nimport type { IsolatedInteractiveRuntime } from \"./isolated-runtime.js\";\nimport type {\n\tEngineBlockedStatus,\n\tInteractiveEngineMessage,\n\tJsonValue,\n\tSerializableOverlayOptions,\n} from \"./protocol.ts\";\nimport { RemoteFrameWidthClamp } from \"./remote-frame-clamp.ts\";\nimport { TerminalModeController } from \"./terminal-mode-controller.ts\";\n\nexport type RemoteComponentRuntime = Pick<\n\tIsolatedInteractiveRuntime,\n\t\"onEngineMessage\" | \"onGenerationEnded\" | \"sendEngineCommand\"\n>;\n\nexport type RemoteComponentUI = Pick<ExtensionUIContext, \"custom\" | \"requestRender\" | \"setWidget\" | \"onWidgetRelease\">;\n\ninterface MountedRemoteComponent {\n\tcomponent: RemoteComponent;\n\tdone: (result: JsonValue | undefined) => void;\n\tengineDone: boolean;\n\t/** The extension declared that this component binds Ctrl+C itself. */\n\thandlesCtrlC: boolean;\n\t/** The extension declared that this component claims internal UI actions. */\n\thandlesInternalUiAction: boolean;\n\thandle?: OverlayHandle;\n\twidgetKey?: string;\n\tunsubscribeWidgetRelease?: () => void;\n}\n\n/**\n * A stalled engine must not make fullscreen input wait forever. A timed-out\n * reply is treated as unhandled and lets the viewport process the key.\n */\nexport const REMOTE_INPUT_REPLY_TIMEOUT_MS = 250;\n\ninterface PendingInput {\n\tresolve: (handled: boolean | undefined) => void;\n\ttimer: ReturnType<typeof setTimeout>;\n}\n\nclass RemoteComponent implements Component {\n\tprivate scrollRequest: WidgetScrollRequest | undefined;\n\tgetScrollRequest(): WidgetScrollRequest | undefined {\n\t\treturn this.scrollRequest;\n\t}\n\tonScroll(state: WidgetScrollState): void {\n\t\tif (!this.disposed)\n\t\t\tthis.runtime.sendEngineCommand({ type: \"engine_custom_scroll\", componentId: this.componentId, state });\n\t}\n\twantsKeyRelease = true;\n\treadonly handlesInternalUiAction: boolean;\n\tprivate lines = [\"Loading remote component…\"];\n\tprivate width = 0;\n\tprivate rows = 0;\n\tprivate requestId = 0;\n\tprivate inputRequestId = 0;\n\tprivate appliedRequestId = 0;\n\tprivate dirty = true;\n\tprivate disposed = false;\n\tprivate readonly pendingInputs = new Map<number, PendingInput>();\n\tprivate readonly frameClamp = new RemoteFrameWidthClamp();\n\n\tprivate readonly componentId: string;\n\tprivate readonly runtime: RemoteComponentRuntime;\n\tprivate readonly requestRender: () => void;\n\tprivate readonly getRows: () => number;\n\n\tconstructor(\n\t\tcomponentId: string,\n\t\truntime: RemoteComponentRuntime,\n\t\trequestRender: () => void,\n\t\tgetRows: () => number,\n\t\thandlesInternalUiAction = false,\n\t) {\n\t\tthis.componentId = componentId;\n\t\tthis.runtime = runtime;\n\t\tthis.requestRender = requestRender;\n\t\tthis.getRows = getRows;\n\t\tthis.handlesInternalUiAction = handlesInternalUiAction;\n\t}\n\n\trender(width: number): string[] {\n\t\tconst rows = this.getRows();\n\t\tif (!this.disposed && (this.dirty || width !== this.width || rows !== this.rows)) {\n\t\t\tthis.width = width;\n\t\t\tthis.rows = rows;\n\t\t\tthis.dirty = false;\n\t\t\tthis.runtime.sendEngineCommand({\n\t\t\t\ttype: \"engine_custom_render\",\n\t\t\t\tcomponentId: this.componentId,\n\t\t\t\trequestId: ++this.requestId,\n\t\t\t\twidth,\n\t\t\t\trows,\n\t\t\t});\n\t\t}\n\t\t// The engine child re-renders asynchronously; until the fresh frame\n\t\t// arrives, the previous frame may be wrapped for an older terminal\n\t\t// width. Clamp so a resize never replays overflowing lines (pi-tui\n\t\t// crashes on any rendered line wider than the terminal).\n\t\treturn this.frameClamp.clamp(this.lines, width);\n\t}\n\n\thandleInput(data: string): Promise<boolean | undefined> {\n\t\tif (this.disposed) return Promise.resolve(undefined);\n\t\tconst requestId = ++this.inputRequestId;\n\t\tconst result = new Promise<boolean | undefined>((resolve) => {\n\t\t\tconst timer = setTimeout(() => this.resolveInput(requestId, false), REMOTE_INPUT_REPLY_TIMEOUT_MS);\n\t\t\ttimer.unref?.();\n\t\t\tthis.pendingInputs.set(requestId, { resolve, timer });\n\t\t});\n\t\ttry {\n\t\t\tthis.runtime.sendEngineCommand({\n\t\t\t\ttype: \"engine_custom_input\",\n\t\t\t\tcomponentId: this.componentId,\n\t\t\t\trequestId,\n\t\t\t\tdata,\n\t\t\t});\n\t\t} catch {\n\t\t\tthis.resolveInput(requestId, false);\n\t\t}\n\t\t// Engine commands are delivered in order, so a frame requested now is\n\t\t// rendered by the child only AFTER it has applied this input. Pipelining\n\t\t// the request keeps keypress latency at a single round trip and repaints\n\t\t// components that never self-invalidate, instead of waiting for a\n\t\t// child-side invalidate (or an unrelated refresh) to trigger a frame.\n\t\tthis.dirty = true;\n\t\tthis.requestRender();\n\t\treturn result;\n\t}\n\n\tresolveInput(requestId: number, handled: boolean | undefined): void {\n\t\tconst pending = this.pendingInputs.get(requestId);\n\t\tif (!pending) return;\n\t\tthis.pendingInputs.delete(requestId);\n\t\tclearTimeout(pending.timer);\n\t\tpending.resolve(handled);\n\t}\n\n\tinvalidate(): void {\n\t\tthis.dirty = true;\n\t}\n\n\tapplyFrame(requestId: number, lines: string[], scrollRequest?: WidgetScrollRequest): void {\n\t\tif (this.disposed || requestId < this.appliedRequestId) return;\n\t\tthis.appliedRequestId = requestId;\n\t\tthis.lines = lines;\n\t\tthis.scrollRequest = scrollRequest;\n\t\tthis.requestRender();\n\t}\n\n\trequestRemoteRender(): void {\n\t\tif (this.disposed) return;\n\t\tthis.dirty = true;\n\t\tthis.requestRender();\n\t}\n\n\t/**\n\t * Tear the proxy down. `notifyEngine` must be false once the writer no longer\n\t * points at the generation that owns this component: component IDs restart at\n\t * `remote_component_1` for every child, so a late dispose would address an\n\t * unrelated component in the replacement engine.\n\t */\n\tdispose(notifyEngine = true): void {\n\t\tif (this.disposed) return;\n\t\tthis.disposed = true;\n\t\tfor (const requestId of [...this.pendingInputs.keys()]) this.resolveInput(requestId, undefined);\n\t\tif (notifyEngine)\n\t\t\tthis.runtime.sendEngineCommand({ type: \"engine_custom_dispose\", componentId: this.componentId });\n\t}\n}\n\nfunction overlayOptions(options: SerializableOverlayOptions | undefined): OverlayOptions | undefined {\n\treturn options as OverlayOptions | undefined;\n}\n\n/**\n * Resolve the real host terminal from the pi-tui TUI handed to the overlay\n * factory. Optional: some hosts / test seams do not surface `tui.terminal`, in\n * which case terminal-mode controls harmlessly no-op.\n */\nfunction hostTerminal(tui: TUI): { write(data: string): void } {\n\tconst terminal = (tui as { terminal?: { write?(data: string): void } }).terminal;\n\treturn typeof terminal?.write === \"function\" ? (terminal as { write(data: string): void }) : { write: () => {} };\n}\n\nexport interface TuiRendererLifecycle {\n\tisFullscreen(): boolean;\n\tonRendererReplaced(listener: () => void): () => void;\n}\n\nexport class RemoteComponentController {\n\tprivate readonly mounted = new Map<string, MountedRemoteComponent>();\n\tprivate readonly unsubscribe: () => void;\n\tprivate readonly unsubscribeGenerationEnded: () => void;\n\tprivate readonly terminalModes: TerminalModeController;\n\tprivate readonly unsubscribeTuiRendererReplaced: () => void;\n\n\tprivate readonly runtime: RemoteComponentRuntime;\n\tprivate readonly ui: RemoteComponentUI;\n\tprivate readonly copyText: (text: string) => Promise<void>;\n\n\tconstructor(\n\t\truntime: RemoteComponentRuntime,\n\t\tui: RemoteComponentUI,\n\t\ttuiRendererLifecycle: TuiRendererLifecycle,\n\t\tcopyText: (text: string) => Promise<void> = copyToClipboard,\n\t) {\n\t\tthis.runtime = runtime;\n\t\tthis.ui = ui;\n\t\tthis.copyText = copyText;\n\t\tthis.terminalModes = new TerminalModeController(() => tuiRendererLifecycle.isFullscreen());\n\t\tthis.unsubscribeTuiRendererReplaced = tuiRendererLifecycle.onRendererReplaced(() =>\n\t\t\tthis.terminalModes.rebindTui(),\n\t\t);\n\t\tthis.unsubscribe = runtime.onEngineMessage((message) => this.handleMessage(message));\n\t\t// Teardown is driven by engine death rather than the NEXT generation's\n\t\t// `engine_ready`, so a crash with no restart, or a hung/failed restart,\n\t\t// still releases the host editor, focus, and inline-custom-UI depth.\n\t\tthis.unsubscribeGenerationEnded = runtime.onGenerationEnded(() => this.disposeAll(\"generation-lost\"));\n\t}\n\n\tdispose(): void {\n\t\tthis.unsubscribeTuiRendererReplaced();\n\t\tthis.unsubscribe();\n\t\tthis.unsubscribeGenerationEnded();\n\t\tthis.disposeAll(\"host-shutdown\");\n\t}\n\n\t/** The remote overlay proxy that currently holds focus (see remote-input-ownership.ts). */\n\tfocusedRemoteOverlay(): unknown {\n\t\tfor (const record of this.mounted.values()) {\n\t\t\tif (record.handle?.isFocused() === true) return record.component;\n\t\t}\n\t\treturn undefined;\n\t}\n\n\t/** `component` itself when it is one of this generation's live non-widget proxies. */\n\tremoteProxyOwner(component: unknown): unknown {\n\t\tif (!(component instanceof RemoteComponent)) return undefined;\n\t\tfor (const record of this.mounted.values()) {\n\t\t\tif (record.component === component) return record.widgetKey === undefined ? component : undefined;\n\t\t}\n\t\treturn undefined;\n\t}\n\n\t/** True when the extension that mounted `component` declared it binds Ctrl+C. */\n\tremoteProxyHandlesCtrlC(component: unknown): boolean {\n\t\tfor (const record of this.mounted.values()) {\n\t\t\tif (record.component === component) return record.handlesCtrlC;\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * Close exactly one live proxy through the ordinary host close path.\n\t *\n\t * The host escape from a component that traps Ctrl+C, and deliberately not\n\t * `disposeAll()`: that is generation-death teardown, which would also close\n\t * unrelated nested components and suppress the child notification. Here the\n\t * record stays registered while `done` runs, so `showExtensionCustom()`\n\t * hides this overlay (or remounts the editor) and its finalizer disposes the\n\t * proxy normally — which tells the healthy child to resolve its own\n\t * `ui.custom()` promise with `undefined`, exactly like a user cancel.\n\t */\n\tdismissRemoteProxy(component: unknown): boolean {\n\t\tfor (const record of this.mounted.values()) {\n\t\t\tif (record.component !== component || record.widgetKey !== undefined) continue;\n\t\t\trecord.done(undefined);\n\t\t\tthis.ui.requestRender();\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate releaseWidget(widgetKey: string): void {\n\t\tfor (const [componentId, record] of this.mounted) {\n\t\t\tif (record.widgetKey !== widgetKey) continue;\n\t\t\tthis.mounted.delete(componentId);\n\t\t\trecord.unsubscribeWidgetRelease?.();\n\t\t\trecord.unsubscribeWidgetRelease = undefined;\n\t\t\tthis.terminalModes.onUnmount(componentId);\n\t\t}\n\t}\n\t/**\n\t * Close every mounted component.\n\t *\n\t * `\"generation-lost\"` closes through the real host close path: it hides the\n\t * overlay or remounts the editor into `editorContainer`, restores the saved\n\t * draft and focus, releases `blockingInlineCustomUiDepth`, and resolves the\n\t * extension's `ui.custom()` promise. Records are removed BEFORE each `done`\n\t * runs so the settlement path cannot re-enter the controller, and proxy\n\t * disposal is local-only because the writer already points at a replacement\n\t * child whose component IDs restart at `remote_component_1`.\n\t *\n\t * Order is newest-first, matching the TUI's overlay stack. Closing oldest\n\t * first would let an overlay mounted above an inline proxy restore focus to\n\t * that inline proxy after it had already been disposed.\n\t *\n\t * `\"host-shutdown\"` notifies the still-live engine child instead and leaves\n\t * host mounts alone: the TUI is already stopping and must not repaint.\n\t */\n\tprivate disposeAll(reason: \"generation-lost\" | \"host-shutdown\"): void {\n\t\tconst records = [...this.mounted.entries()].reverse();\n\t\tthis.mounted.clear();\n\t\tfor (const [componentId, record] of records) {\n\t\t\tthis.terminalModes.onUnmount(componentId);\n\t\t\trecord.unsubscribeWidgetRelease?.();\n\t\t\trecord.component.dispose(reason === \"host-shutdown\" && !record.engineDone);\n\t\t\tif (record.widgetKey) this.ui.setWidget(record.widgetKey, undefined);\n\t\t\telse if (reason === \"generation-lost\") record.done(undefined);\n\t\t}\n\t\tthis.terminalModes.resetAll();\n\t\tif (reason === \"generation-lost\" && records.length > 0) this.ui.requestRender();\n\t}\n\n\tprivate handleMessage(message: InteractiveEngineMessage): void {\n\t\tswitch (message.type) {\n\t\t\tcase \"engine_ready\":\n\t\t\t\t// Idempotent fallback for a generation replacement whose death event\n\t\t\t\t// was already handled: stale records must be gone before the new child\n\t\t\t\t// can reuse `remote_component_1`, and any terminal modes the dead\n\t\t\t\t// generation left on are reset here too.\n\t\t\t\tthis.disposeAll(\"generation-lost\");\n\t\t\t\tbreak;\n\t\t\tcase \"engine_custom_open\":\n\t\t\t\tthis.open(\n\t\t\t\t\tmessage.componentId,\n\t\t\t\t\tmessage.overlay,\n\t\t\t\t\tmessage.deferInlineCustomUiFocus,\n\t\t\t\t\tmessage.overlayOptions,\n\t\t\t\t\tmessage.widgetKey,\n\t\t\t\t\tmessage.widgetPlacement,\n\t\t\t\t\tmessage.handlesCtrlC === true,\n\t\t\t\t\tmessage.handlesInternalUiAction === true,\n\t\t\t\t\tmessage.reserveTranscriptRows === true,\n\t\t\t\t\tmessage.purpose,\n\t\t\t\t\tmessage.widgetScroll,\n\t\t\t\t\tmessage.blocked,\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\tcase \"engine_custom_close\":\n\t\t\t\tthis.close(message.componentId);\n\t\t\t\tbreak;\n\t\t\tcase \"engine_custom_frame\":\n\t\t\t\tthis.mounted\n\t\t\t\t\t.get(message.componentId)\n\t\t\t\t\t?.component.applyFrame(message.requestId, message.lines, message.scrollRequest);\n\t\t\t\tbreak;\n\t\t\tcase \"engine_custom_input_result\":\n\t\t\t\tthis.mounted.get(message.componentId)?.component.resolveInput(message.requestId, message.handled);\n\t\t\t\tbreak;\n\t\t\tcase \"engine_custom_invalidate\":\n\t\t\t\tthis.mounted.get(message.componentId)?.component.requestRemoteRender();\n\t\t\t\tbreak;\n\t\t\tcase \"engine_custom_copy\":\n\t\t\t\tvoid (async () => {\n\t\t\t\t\tlet error: string | undefined;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (!this.mounted.has(message.componentId)) throw new Error(\"Sign-in screen is no longer open\");\n\t\t\t\t\t\tawait this.copyText(message.text);\n\t\t\t\t\t} catch (cause) {\n\t\t\t\t\t\terror = cause instanceof Error ? cause.message : String(cause);\n\t\t\t\t\t}\n\t\t\t\t\tthis.runtime.sendEngineCommand({\n\t\t\t\t\t\ttype: \"engine_custom_copy_result\",\n\t\t\t\t\t\tcomponentId: message.componentId,\n\t\t\t\t\t\trequestId: message.requestId,\n\t\t\t\t\t\terror,\n\t\t\t\t\t});\n\t\t\t\t})();\n\t\t\t\tbreak;\n\t\t\tcase \"engine_custom_terminal\":\n\t\t\t\tthis.terminalModes.applyControl(message.componentId, message.control);\n\t\t\t\tbreak;\n\t\t\tcase \"engine_custom_done\": {\n\t\t\t\tconst record = this.mounted.get(message.componentId);\n\t\t\t\tif (record) {\n\t\t\t\t\trecord.engineDone = true;\n\t\t\t\t\trecord.done(message.result);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"engine_custom_control\":\n\t\t\t\tthis.control(message.componentId, message.action);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tprivate open(\n\t\tcomponentId: string,\n\t\toverlay: boolean,\n\t\tdeferInlineCustomUiFocus: boolean | undefined,\n\t\toptions: SerializableOverlayOptions | undefined,\n\t\twidgetKey?: string,\n\t\twidgetPlacement?: \"aboveEditor\" | \"belowEditor\",\n\t\thandlesCtrlC = false,\n\t\thandlesInternalUiAction = false,\n\t\treserveTranscriptRows = false,\n\t\tpurpose?: \"prompt\" | \"navigation\",\n\t\twidgetScroll?: { maxHeight: number; maxHeightFraction?: number },\n\t\tblocked?: EngineBlockedStatus,\n\t): void {\n\t\tif (this.mounted.has(componentId)) return;\n\t\tif (widgetKey) {\n\t\t\tlet getRows = () => 24;\n\t\t\tconst component = new RemoteComponent(\n\t\t\t\tcomponentId,\n\t\t\t\tthis.runtime,\n\t\t\t\t() => this.ui.requestRender(),\n\t\t\t\t() => getRows(),\n\t\t\t\thandlesInternalUiAction,\n\t\t\t);\n\t\t\tconst unsubscribeWidgetRelease = this.ui.onWidgetRelease?.(widgetKey, () => this.releaseWidget(widgetKey));\n\t\t\tthis.mounted.set(componentId, {\n\t\t\t\tcomponent,\n\t\t\t\tdone: () => {},\n\t\t\t\tengineDone: false,\n\t\t\t\thandlesCtrlC,\n\t\t\t\thandlesInternalUiAction,\n\t\t\t\twidgetKey,\n\t\t\t\tunsubscribeWidgetRelease,\n\t\t\t});\n\t\t\tthis.ui.setWidget(\n\t\t\t\twidgetKey,\n\t\t\t\t(tui) => {\n\t\t\t\t\tgetRows = () => tui.terminal.rows;\n\t\t\t\t\treturn component;\n\t\t\t\t},\n\t\t\t\t{ placement: widgetPlacement, ...(widgetScroll ? { scroll: widgetScroll } : {}) },\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\t\tlet mounted: MountedRemoteComponent | undefined;\n\t\tvoid this.ui\n\t\t\t.custom<JsonValue | undefined>(\n\t\t\t\t(tui, _theme, _keybindings, done) => {\n\t\t\t\t\tconst component = new RemoteComponent(\n\t\t\t\t\t\tcomponentId,\n\t\t\t\t\t\tthis.runtime,\n\t\t\t\t\t\t() => this.ui.requestRender(),\n\t\t\t\t\t\t() => tui.terminal.rows,\n\t\t\t\t\t\thandlesInternalUiAction,\n\t\t\t\t\t);\n\t\t\t\t\tmounted = { component, done, engineDone: false, handlesCtrlC, handlesInternalUiAction };\n\t\t\t\t\tthis.mounted.set(componentId, mounted);\n\t\t\t\t\t// Bind this component to the real host terminal so a buffered\n\t\t\t\t\t// autowrap control emitted before the mount frame applies to the host TTY.\n\t\t\t\t\tthis.terminalModes.onMount(componentId, hostTerminal(tui));\n\t\t\t\t\treturn component;\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\toverlay,\n\t\t\t\t\tpurpose,\n\t\t\t\t\tdeferInlineCustomUiFocus,\n\t\t\t\t\thandlesInternalUiAction,\n\t\t\t\t\treserveTranscriptRows,\n\t\t\t\t\toverlayOptions: overlayOptions(options),\n\t\t\t\t\tblocked,\n\t\t\t\t\tonHandle: (handle) => {\n\t\t\t\t\t\tif (mounted) mounted.handle = handle;\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t)\n\t\t\t.catch(() => undefined)\n\t\t\t.finally(() => {\n\t\t\t\tthis.terminalModes.onUnmount(componentId);\n\t\t\t\tconst record = this.mounted.get(componentId);\n\t\t\t\tif (!record) return;\n\t\t\t\tthis.mounted.delete(componentId);\n\t\t\t\tif (record.engineDone) record.component.dispose(false);\n\t\t\t\telse record.component.dispose();\n\t\t\t});\n\t}\n\n\tprivate close(componentId: string): void {\n\t\tconst record = this.mounted.get(componentId);\n\t\tif (!record) return;\n\t\tthis.terminalModes.onUnmount(componentId);\n\t\tthis.mounted.delete(componentId);\n\t\trecord.unsubscribeWidgetRelease?.();\n\t\tif (record.widgetKey) this.ui.setWidget(record.widgetKey, undefined);\n\t\trecord.component.dispose();\n\t}\n\n\tprivate control(componentId: string, action: \"focus\" | \"hide\" | \"show\" | \"unfocus\"): void {\n\t\tconst handle = this.mounted.get(componentId)?.handle;\n\t\tif (!handle) return;\n\t\tswitch (action) {\n\t\t\tcase \"focus\":\n\t\t\t\thandle.focus();\n\t\t\t\tbreak;\n\t\t\tcase \"hide\":\n\t\t\t\thandle.setHidden(true);\n\t\t\t\tbreak;\n\t\t\tcase \"show\":\n\t\t\t\thandle.setHidden(false);\n\t\t\t\tbreak;\n\t\t\tcase \"unfocus\":\n\t\t\t\thandle.unfocus();\n\t\t\t\tbreak;\n\t\t}\n\t}\n}\n"]}
package/docs/llama-cpp.md CHANGED
@@ -5,32 +5,43 @@ description: "Run models locally with a llama.cpp server: discovery, load manage
5
5
 
6
6
  # llama.cpp
7
7
 
8
- Atomic supports the [llama.cpp](https://github.com/ggml-org/llama.cpp) router server. The router discovers multiple GGUF models and loads or unloads them on demand.
8
+ Atomic supports the [llama.cpp](https://llama.app) router server. The router discovers multiple GGUF models and loads or unloads them on demand.
9
9
 
10
- Use a current llama.cpp build with router support. Follow its [build instructions](https://github.com/ggml-org/llama.cpp/blob/master/docs/build.md) or install a [prebuilt release](https://github.com/ggml-org/llama.cpp/releases).
10
+ ## Install llama.cpp
11
+
12
+ Install llama.cpp with the [official installer](https://llama.app/docs/installation):
13
+
14
+ ```bash
15
+ curl -LsSf https://llama.app/install.sh | sh
16
+ ```
17
+
18
+ Verify the installation:
19
+
20
+ ```bash
21
+ llama cli --version
22
+ ```
23
+
24
+ See [llama.app](https://llama.app) for other installation methods, including package managers and building from source.
11
25
 
12
26
  ## Start the router
13
27
 
14
- Start `llama-server` without `--model` or `-m`; those options start single-model mode instead of router mode.
28
+ Start `llama serve` without `--model`, `-m`, or `-hf`; those options start single-model mode instead of router mode. See the [llama.cpp server guide](https://llama.app/docs/serve#serving-multiple-models-router-mode) for router configuration.
15
29
 
16
30
  ```bash
17
- llama-server \
18
- --models-dir ~/models \
31
+ llama serve \
19
32
  --no-models-autoload \
20
- --jinja \
21
33
  --host 127.0.0.1 \
22
34
  --port 8080 \
23
- -ngl 999 \
35
+ -ngl all \
24
36
  -c 32768
25
37
  ```
26
38
 
27
- - `--models-dir` discovers local GGUF files.
28
39
  - `--no-models-autoload` leaves loading under explicit `/llama` control.
29
- - `--jinja` enables compatible chat templates and tool calling.
30
- - `-ngl 999` offloads as many layers as possible to the GPU.
31
- - `-c 32768` sets each model's context window. Omit it to use the model's native context, which may require substantially more memory.
40
+ - `-ngl all` offloads all layers to the GPU. Omit it to use automatic GPU offloading.
41
+ - `-c 32768` sets the context size in tokens. Use `-c 0` for the model's full context window, which may require substantially more memory. Context is shared across parallel server slots.
42
+ - `--models-dir ~/models` also discovers local GGUF files in that directory.
32
43
 
33
- Single-file models can sit directly in the model directory. Put multimodal and multi-shard models in separate subdirectories with their projection or shard files. Restart the router after manually adding files. Per-model context sizes and other options can be set with [model presets](https://github.com/ggml-org/llama.cpp/blob/master/tools/server/README.md#model-presets).
44
+ Single-file models can sit directly in the model directory. Put multimodal and multi-shard models in separate subdirectories with their projection or shard files. Restart the router after manually adding files. The router also supports cached models and preset files through `--models-preset`, as described in the [server guide](https://llama.app/docs/serve#serving-multiple-models-router-mode).
34
45
 
35
46
  For settings tuned to a specific NVIDIA GPU and model, see [NVIDIA RTX recipes](#nvidia-rtx-recipes).
36
47
 
@@ -50,7 +61,7 @@ export LLAMA_API_KEY=optional-secret
50
61
  atomic
51
62
  ```
52
63
 
53
- If the server requires a key, start `llama-server` with the matching `--api-key`. Keep `--host 127.0.0.1` for local-only access.
64
+ If the server requires a key, start `llama serve` with the matching `--api-key`. Keep `--host 127.0.0.1` for local-only access.
54
65
 
55
66
  ## Manage models
56
67
 
@@ -190,7 +201,7 @@ curl http://127.0.0.1:8080/health
190
201
  curl http://127.0.0.1:8080/models
191
202
  ```
192
203
 
193
- - **No models in `/llama`:** Check `--models-dir`, the directory layout, and restart the router.
204
+ - **No models in `/llama`:** Check the cached models, `--models-dir` and its directory layout, then restart the router.
194
205
  - **Model missing from `/model` with `--no-models-autoload`:** Load it with `/llama` first.
195
206
  - **Load fails or uses too much memory:** Lower `-c` or unload another model.
196
207
  - **Server is not in router mode:** Start it without `--model`, `-m`, or `-hf`.
package/docs/tui.md CHANGED
@@ -46,6 +46,8 @@ For inspection or navigation, pass `{ purpose: "navigation" }`. Atomic then moun
46
46
 
47
47
  Navigation still owns keyboard focus. In `getHostCustomUiState()` and its change listener, `blockingInlineCustomUiActive` counts all inline mounts. When navigation is present, `blockingInlineCustomUiNeedsInput` distinguishes real pending prompts from navigation-only mounts; when omitted, use `blockingInlineCustomUiActive`. This distinction is preserved across the isolated-engine bridge.
48
48
 
49
+ Custom components do not report Atomic as waiting for you through [program status](/terminal-setup#program-status), because `ctx.ui.custom()` also hosts loaders and other non-blocking UI. When an inline component waits for an answer, pass `blocked: { kind: "question", message: "Pick a color" }` so supporting terminals show Atomic as blocked while the component is visible. `kind` is `"question"`, `"permission"`, or `"auth"`. Overlays ignore this option.
50
+
49
51
  Main-chat inline custom UIs share the editor slot. Completing or canceling an older mount leaves the current one visible; closing the current mount restores the most recently mounted UI that is still pending, including task navigation or an approval. The main editor returns only after the last inline owner closes. A foreground workflow graph keeps focus until you hide or close it, then the surviving inline UI is visible and receives input.
50
52
 
51
53
  Reserving bottom prompts (`reserveTranscriptRows`, including `ask_user_question`) also wait out of view while inline navigation or an overlay's `deferInlineCustomUiFocus` owns input. Leaving navigation restores the same pending prompt, not a new questionnaire. Escape belongs exclusively to the active navigation view until then; once the questionnaire returns, its ordinary Escape cancellation applies.
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@bastani/atomic",
3
- "version": "0.9.46-alpha.1",
3
+ "version": "0.9.47-alpha.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@bastani/atomic",
9
- "version": "0.9.46-alpha.1",
9
+ "version": "0.9.47-alpha.1",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
- "@bastani/atomic-natives": "0.9.46-alpha.1",
13
- "@bastani/pi-ai": "0.9.46-alpha.1",
12
+ "@bastani/atomic-natives": "0.9.47-alpha.1",
13
+ "@bastani/pi-ai": "0.9.47-alpha.1",
14
14
  "@earendil-works/pi-agent-core": "1.4.0",
15
15
  "@earendil-works/pi-codemode": "1.4.0",
16
16
  "@earendil-works/pi-tui": "1.4.0",
@@ -427,18 +427,18 @@
427
427
  }
428
428
  },
429
429
  "node_modules/@bastani/atomic-natives": {
430
- "version": "0.9.46-alpha.1",
431
- "resolved": "https://registry.npmjs.org/@bastani/atomic-natives/-/atomic-natives-0.9.46-alpha.1.tgz",
430
+ "version": "0.9.47-alpha.1",
431
+ "resolved": "https://registry.npmjs.org/@bastani/atomic-natives/-/atomic-natives-0.9.47-alpha.1.tgz",
432
432
  "license": "MIT",
433
433
  "optionalDependencies": {
434
- "@bastani/atomic-natives-darwin-arm64": "0.9.46-alpha.1",
435
- "@bastani/atomic-natives-darwin-x64": "0.9.46-alpha.1",
436
- "@bastani/atomic-natives-linux-arm64-gnu": "0.9.46-alpha.1",
437
- "@bastani/atomic-natives-linux-arm64-musl": "0.9.46-alpha.1",
438
- "@bastani/atomic-natives-linux-x64-gnu": "0.9.46-alpha.1",
439
- "@bastani/atomic-natives-linux-x64-musl": "0.9.46-alpha.1",
440
- "@bastani/atomic-natives-win32-arm64-msvc": "0.9.46-alpha.1",
441
- "@bastani/atomic-natives-win32-x64-msvc": "0.9.46-alpha.1"
434
+ "@bastani/atomic-natives-darwin-arm64": "0.9.47-alpha.1",
435
+ "@bastani/atomic-natives-darwin-x64": "0.9.47-alpha.1",
436
+ "@bastani/atomic-natives-linux-arm64-gnu": "0.9.47-alpha.1",
437
+ "@bastani/atomic-natives-linux-arm64-musl": "0.9.47-alpha.1",
438
+ "@bastani/atomic-natives-linux-x64-gnu": "0.9.47-alpha.1",
439
+ "@bastani/atomic-natives-linux-x64-musl": "0.9.47-alpha.1",
440
+ "@bastani/atomic-natives-win32-arm64-msvc": "0.9.47-alpha.1",
441
+ "@bastani/atomic-natives-win32-x64-msvc": "0.9.47-alpha.1"
442
442
  },
443
443
  "engines": {
444
444
  "bun": ">=1.4.2",
@@ -446,8 +446,8 @@
446
446
  }
447
447
  },
448
448
  "node_modules/@bastani/atomic-natives-darwin-arm64": {
449
- "version": "0.9.46-alpha.1",
450
- "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-arm64/-/atomic-natives-darwin-arm64-0.9.46-alpha.1.tgz",
449
+ "version": "0.9.47-alpha.1",
450
+ "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-arm64/-/atomic-natives-darwin-arm64-0.9.47-alpha.1.tgz",
451
451
  "license": "MIT",
452
452
  "os": [
453
453
  "darwin"
@@ -458,8 +458,8 @@
458
458
  "optional": true
459
459
  },
460
460
  "node_modules/@bastani/atomic-natives-darwin-x64": {
461
- "version": "0.9.46-alpha.1",
462
- "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-x64/-/atomic-natives-darwin-x64-0.9.46-alpha.1.tgz",
461
+ "version": "0.9.47-alpha.1",
462
+ "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-x64/-/atomic-natives-darwin-x64-0.9.47-alpha.1.tgz",
463
463
  "license": "MIT",
464
464
  "os": [
465
465
  "darwin"
@@ -470,8 +470,8 @@
470
470
  "optional": true
471
471
  },
472
472
  "node_modules/@bastani/atomic-natives-linux-arm64-gnu": {
473
- "version": "0.9.46-alpha.1",
474
- "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-arm64-gnu/-/atomic-natives-linux-arm64-gnu-0.9.46-alpha.1.tgz",
473
+ "version": "0.9.47-alpha.1",
474
+ "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-arm64-gnu/-/atomic-natives-linux-arm64-gnu-0.9.47-alpha.1.tgz",
475
475
  "license": "MIT",
476
476
  "os": [
477
477
  "linux"
@@ -485,8 +485,8 @@
485
485
  "optional": true
486
486
  },
487
487
  "node_modules/@bastani/atomic-natives-linux-arm64-musl": {
488
- "version": "0.9.46-alpha.1",
489
- "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-arm64-musl/-/atomic-natives-linux-arm64-musl-0.9.46-alpha.1.tgz",
488
+ "version": "0.9.47-alpha.1",
489
+ "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-arm64-musl/-/atomic-natives-linux-arm64-musl-0.9.47-alpha.1.tgz",
490
490
  "license": "MIT",
491
491
  "os": [
492
492
  "linux"
@@ -500,8 +500,8 @@
500
500
  "optional": true
501
501
  },
502
502
  "node_modules/@bastani/atomic-natives-linux-x64-gnu": {
503
- "version": "0.9.46-alpha.1",
504
- "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-x64-gnu/-/atomic-natives-linux-x64-gnu-0.9.46-alpha.1.tgz",
503
+ "version": "0.9.47-alpha.1",
504
+ "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-x64-gnu/-/atomic-natives-linux-x64-gnu-0.9.47-alpha.1.tgz",
505
505
  "license": "MIT",
506
506
  "os": [
507
507
  "linux"
@@ -515,8 +515,8 @@
515
515
  "optional": true
516
516
  },
517
517
  "node_modules/@bastani/atomic-natives-linux-x64-musl": {
518
- "version": "0.9.46-alpha.1",
519
- "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-x64-musl/-/atomic-natives-linux-x64-musl-0.9.46-alpha.1.tgz",
518
+ "version": "0.9.47-alpha.1",
519
+ "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-x64-musl/-/atomic-natives-linux-x64-musl-0.9.47-alpha.1.tgz",
520
520
  "license": "MIT",
521
521
  "os": [
522
522
  "linux"
@@ -530,8 +530,8 @@
530
530
  "optional": true
531
531
  },
532
532
  "node_modules/@bastani/atomic-natives-win32-arm64-msvc": {
533
- "version": "0.9.46-alpha.1",
534
- "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-arm64-msvc/-/atomic-natives-win32-arm64-msvc-0.9.46-alpha.1.tgz",
533
+ "version": "0.9.47-alpha.1",
534
+ "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-arm64-msvc/-/atomic-natives-win32-arm64-msvc-0.9.47-alpha.1.tgz",
535
535
  "license": "MIT",
536
536
  "os": [
537
537
  "win32"
@@ -542,8 +542,8 @@
542
542
  "optional": true
543
543
  },
544
544
  "node_modules/@bastani/atomic-natives-win32-x64-msvc": {
545
- "version": "0.9.46-alpha.1",
546
- "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-x64-msvc/-/atomic-natives-win32-x64-msvc-0.9.46-alpha.1.tgz",
545
+ "version": "0.9.47-alpha.1",
546
+ "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-x64-msvc/-/atomic-natives-win32-x64-msvc-0.9.47-alpha.1.tgz",
547
547
  "license": "MIT",
548
548
  "os": [
549
549
  "win32"
@@ -554,8 +554,8 @@
554
554
  "optional": true
555
555
  },
556
556
  "node_modules/@bastani/pi-ai": {
557
- "version": "0.9.46-alpha.1",
558
- "resolved": "https://registry.npmjs.org/@bastani/pi-ai/-/pi-ai-0.9.46-alpha.1.tgz",
557
+ "version": "0.9.47-alpha.1",
558
+ "resolved": "https://registry.npmjs.org/@bastani/pi-ai/-/pi-ai-0.9.47-alpha.1.tgz",
559
559
  "license": "MIT",
560
560
  "dependencies": {
561
561
  "@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.46-alpha.1",
3
+ "version": "0.9.47-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": {
@@ -89,8 +89,8 @@
89
89
  "prepublishOnly": "bun run clean && bun run build && bun run shrinkwrap"
90
90
  },
91
91
  "dependencies": {
92
- "@bastani/atomic-natives": "0.9.46-alpha.1",
93
- "@bastani/pi-ai": "0.9.46-alpha.1",
92
+ "@bastani/atomic-natives": "0.9.47-alpha.1",
93
+ "@bastani/pi-ai": "0.9.47-alpha.1",
94
94
  "@earendil-works/pi-agent-core": "1.4.0",
95
95
  "@earendil-works/pi-codemode": "1.4.0",
96
96
  "@earendil-works/pi-tui": "1.4.0",