@bastani/atomic 0.9.19-alpha.2 → 0.9.19-alpha.3
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 +14 -0
- package/dist/builtin/intercom/CHANGELOG.md +7 -0
- package/dist/builtin/intercom/broker/broker.ts +8 -0
- package/dist/builtin/intercom/broker/client.ts +18 -0
- package/dist/builtin/intercom/broker/send-handler.ts +9 -0
- package/dist/builtin/intercom/index.bundle.mjs +44 -4
- package/dist/builtin/intercom/package.json +1 -1
- package/dist/builtin/intercom/types.ts +2 -1
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/CHANGELOG.md +6 -0
- package/dist/builtin/subagents/README.md +2 -2
- package/dist/builtin/subagents/package.json +1 -1
- package/dist/builtin/subagents/src/extension/index.bundle.mjs +2 -2
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/builtin/workflows/CHANGELOG.md +13 -0
- package/dist/builtin/workflows/package.json +1 -1
- package/dist/builtin/workflows/src/extension/index.bundle.mjs +56 -33
- package/dist/builtin/workflows/src/index.js +14 -4
- package/dist/core/agent-session-message-queue.d.ts.map +1 -1
- package/dist/core/agent-session-message-queue.js +2 -2
- package/dist/core/agent-session-message-queue.js.map +1 -1
- package/dist/core/agent-session-methods.d.ts +3 -0
- package/dist/core/agent-session-methods.d.ts.map +1 -1
- package/dist/core/agent-session-methods.js.map +1 -1
- package/dist/core/agent-session-tasks.d.ts +5 -0
- package/dist/core/agent-session-tasks.d.ts.map +1 -1
- package/dist/core/agent-session-tasks.js +8 -1
- package/dist/core/agent-session-tasks.js.map +1 -1
- package/dist/core/extensions/loader-api.d.ts.map +1 -1
- package/dist/core/extensions/loader-api.js +3 -0
- package/dist/core/extensions/loader-api.js.map +1 -1
- package/dist/core/extensions/loader-host-modules.d.ts +1 -1
- package/dist/core/extensions/loader-host-modules.d.ts.map +1 -1
- package/dist/core/extensions/loader-host-modules.js +2 -1
- package/dist/core/extensions/loader-host-modules.js.map +1 -1
- package/dist/core/extensions/loader-virtual-modules.d.ts.map +1 -1
- package/dist/core/extensions/loader-virtual-modules.js +4 -1
- package/dist/core/extensions/loader-virtual-modules.js.map +1 -1
- package/dist/core/retry-policy.d.ts +1 -0
- package/dist/core/retry-policy.d.ts.map +1 -1
- package/dist/core/retry-policy.js +2 -1
- package/dist/core/retry-policy.js.map +1 -1
- package/dist/core/settings-manager-basic-accessors.d.ts +1 -0
- package/dist/core/settings-manager-basic-accessors.d.ts.map +1 -1
- package/dist/core/settings-manager-basic-accessors.js +2 -0
- package/dist/core/settings-manager-basic-accessors.js.map +1 -1
- package/dist/core/settings-types.d.ts +1 -0
- package/dist/core/settings-types.d.ts.map +1 -1
- package/dist/core/settings-types.js.map +1 -1
- package/dist/core/tasks/agent-adapter.d.ts +9 -0
- package/dist/core/tasks/agent-adapter.d.ts.map +1 -1
- package/dist/core/tasks/agent-adapter.js +36 -2
- package/dist/core/tasks/agent-adapter.js.map +1 -1
- package/dist/core/tasks/pause.d.ts +4 -0
- package/dist/core/tasks/pause.d.ts.map +1 -0
- package/dist/core/tasks/pause.js +49 -0
- package/dist/core/tasks/pause.js.map +1 -0
- package/dist/core/tasks/supervisor.d.ts +3 -1
- package/dist/core/tasks/supervisor.d.ts.map +1 -1
- package/dist/core/tasks/supervisor.js +48 -22
- package/dist/core/tasks/supervisor.js.map +1 -1
- package/dist/core/tools/bash.d.ts +2 -0
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +1 -1
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/powershell.d.ts.map +1 -1
- package/dist/core/tools/powershell.js +1 -0
- package/dist/core/tools/powershell.js.map +1 -1
- package/dist/core/tools/resource-selectors.d.ts +1 -1
- package/dist/core/tools/resource-selectors.d.ts.map +1 -1
- package/dist/core/tools/resource-selectors.js +7 -4
- package/dist/core/tools/resource-selectors.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host.js +3 -2
- package/dist/modes/interactive/components/chat-session-host.js.map +1 -1
- package/docs/background-tasks.md +7 -1
- package/docs/development.md +23 -74
- package/docs/extensions.md +4 -0
- package/docs/herdr.md +25 -78
- package/docs/intercom.md +4 -0
- package/docs/models/evals.md +2 -0
- package/docs/models/model-selection.md +10 -7
- package/docs/settings.md +4 -0
- package/docs/subagents.md +3 -1
- package/docs/tools.md +4 -0
- package/docs/workflows/api-reference.md +1 -1
- package/docs/workflows/operations.md +8 -3
- package/npm-shrinkwrap.json +59 -59
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-session-host.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/chat-session-host.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAElE,OAAO,EAAE,iBAAiB,EAAuB,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AACxH,OAAO,EACN,oBAAoB,EACpB,0BAA0B,EAC1B,oBAAoB,EACpB,6BAA6B,EAC7B,iBAAiB,GACjB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACN,uBAAuB,EACvB,sBAAsB,EACtB,wBAAwB,GACxB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,0BAA0B,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AACpG,OAAO,EACN,qBAAqB,EACrB,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,EACvB,gCAAgC,EAChC,sBAAsB,EACtB,8BAA8B,EAC9B,kBAAkB,GAClB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACN,4CAA4C,EAC5C,kBAAkB,EAClB,wBAAwB,EACxB,sBAAsB,EACtB,0CAA0C,EAC1C,gCAAgC,EAChC,uCAAuC,EACvC,4BAA4B,GAC5B,MAAM,gCAAgC,CAAC;A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,MAAM,EAAE,CAAC,IAAI,EAAE,aAAa,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,aAAa,CAAC;YACjE,6BAA6B,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,6BAA6B,EAAE;YACzE,eAAe,EAAE,GAAG,EAAE,CAAC,0BAA0B,CAAC,IAAI,CAAC,KAAK,CAAC;YAC7D,SAAS,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;YAC/C,SAAS,EAAE,GAAG,EAAE,CAAC,oBAAoB,CAAC,IAAI,CAAC,KAAK,CAAC;SACjD,CAAC;IACH,CAAC;CACD","sourcesContent":["import type { Component, Focusable } from \"@earendil-works/pi-tui\";\nimport type { AgentSessionEvent, CompactionReason } from \"../../../core/agent-session.js\";\nimport { repairOrphanToolResults } from \"../../../core/messages.ts\";\nimport { SessionManager } from \"../../../core/session-manager.ts\";\nimport type { TaskId } from \"../../../core/tasks/contracts.js\";\nimport { getOwnerTaskStore, type OwnerTaskStore, watchOwnerTaskStoreBinding } from \"../../../core/tasks/owner-store.js\";\nimport {\n\tabortChatSessionBash,\n\tabortChatSessionCompaction,\n\tinterruptChatSession,\n\trestoreQueuedMessagesToEditor,\n\tsubmitChatSession,\n} from \"./chat-session-host-actions.ts\";\nimport {\n\tcreateChatSessionEditor,\n\thandleChatSessionInput,\n\tsetChatSessionEditorText,\n} from \"./chat-session-host-editor.ts\";\nimport { applyChatSessionAgentEvent, compactionStatusMessage } from \"./chat-session-host-events.ts\";\nimport {\n\trenderChatSessionBody,\n\trenderChatSessionEditor,\n\trenderChatSessionEntry,\n\trenderChatSessionFooter,\n\trenderChatSessionPendingMessages,\n\trenderChatSessionUsage,\n\trenderChatSessionWorkingStatus,\n\ttranscriptCacheKey,\n} from \"./chat-session-host-rendering.ts\";\nimport {\n\tclearChatSessionBusyForTerminalWorkflowStage,\n\tdisposeChatSession,\n\tisChatSessionBashRunning,\n\tisChatSessionStreaming,\n\treassertChatSessionExternalPromptLifecycle,\n\tsettleChatSessionPromptLifecycle,\n\tstartChatSessionExternalPromptLifecycle,\n\tsyncChatSessionAnimationTick,\n} from \"./chat-session-host-runtime.ts\";\nimport { ChatSessionHostState } from \"./chat-session-host-state.ts\";\nimport type {\n\tAgentSnapshotMessage,\n\tChatSessionHostEntry,\n\tChatSessionHostOpts,\n\tChatSessionSubmitMode,\n} from \"./chat-session-host-types.ts\";\nimport type { ChatTranscriptEntryLike } from \"./chat-transcript.js\";\nimport { TaskInspector } from \"./task-inspector.js\";\nimport { renderTaskFooter } from \"./task-list.js\";\n\nexport type {\n\tChatSessionHostBashRequest,\n\tChatSessionHostCommands,\n\tChatSessionHostEntry,\n\tChatSessionHostOpts,\n\tChatSessionHostStyle,\n\tChatSessionSubmitMode,\n} from \"./chat-session-host-types.ts\";\n\nexport class ChatSessionHost<TExtraEntry extends ChatTranscriptEntryLike = never> implements Component, Focusable {\n\tfocused = true;\n\n\tprivate readonly state: ChatSessionHostState<TExtraEntry>;\n\tprivate taskStore?: OwnerTaskStore;\n\tprivate readonly taskRowsInChat: boolean;\n\tprivate unsubscribeTasks?: () => void;\n\tprivate taskSession?: object;\n\tprivate unsubscribeTaskBinding?: () => void;\n\tprivate taskInspector?: TaskInspector;\n\n\tconstructor(opts: ChatSessionHostOpts<TExtraEntry>) {\n\t\t// `/tasks` stays a local action owned by the host's `commands.handleSlashCommand`\n\t\t// (see submitChatSession). Hosts that mount the inspector call `openTasks` from\n\t\t// that callback; the host must not intercept it ahead of the owner.\n\t\tthis.taskRowsInChat = opts.taskRowsInChat ?? true;\n\t\tthis.state = new ChatSessionHostState(opts, {\n\t\t\trenderEntry: (state, entry) => renderChatSessionEntry(state, entry),\n\t\t\ttranscriptCacheKey: (state, entry, index) => transcriptCacheKey(state, entry, index),\n\t\t});\n\t\tthis.state.editor = createChatSessionEditor(\n\t\t\tthis.state,\n\t\t\topts.tui,\n\t\t\topts.keybindings,\n\t\t\topts.editorTheme,\n\t\t\topts.editorFactory,\n\t\t\tthis.editorCallbacks(),\n\t\t);\n\t\tif (opts.autocompleteProvider) this.state.editor?.setAutocompleteProvider?.(opts.autocompleteProvider);\n\t\tthis.syncAnimationTick();\n\t\tthis.refreshTaskStore();\n\t}\n\n\topenTasks(id?: string): boolean {\n\t\tconst session = this.state.getAgentSession?.();\n\t\tif (session && !getOwnerTaskStore(session)) session.getAgentTaskHost?.();\n\t\tthis.refreshTaskStore();\n\t\tif (!this.taskStore) {\n\t\t\tthis.showWarning(\"Launched agents and shells will appear here.\");\n\t\t\treturn true;\n\t\t}\n\t\tthis.taskInspector?.dispose();\n\t\tthis.taskInspector = new TaskInspector(\n\t\t\tthis.taskStore,\n\t\t\t() => this.state.requestRender?.(),\n\t\t\t() => this.closeTasks(),\n\t\t);\n\t\tthis.taskInspector.open(id as TaskId | undefined);\n\t\tthis.state.requestRender?.();\n\t\treturn true;\n\t}\n\tget hasTaskInspector(): boolean {\n\t\treturn this.taskInspector !== undefined;\n\t}\n\tget taskInspectorFullscreen(): boolean {\n\t\treturn this.taskInspector?.fullscreen === true;\n\t}\n\tcloseTasks(): void {\n\t\tthis.taskInspector?.dispose();\n\t\tthis.taskInspector = undefined;\n\t\tthis.state.requestRender?.();\n\t}\n\thandleTaskInput(data: string): boolean {\n\t\tif (!this.taskInspector) return false;\n\t\tthis.taskInspector.handleInput(data);\n\t\treturn true;\n\t}\n\tappendMessages(messages: readonly AgentSnapshotMessage[]): void {\n\t\tthis.state.liveChat.appendMessages(messages);\n\t}\n\n\t/**\n\t * Adopt the assistant message a live session is part-way through streaming.\n\t *\n\t * A host mounted mid-turn missed the `message_start` and every delta that\n\t * came before it, and delta-only updates never restate them, so the session's\n\t * in-flight message is the only place that text still exists. Ignored once\n\t * this host is already following a stream of its own.\n\t */\n\thydrateStreamingAssistantMessage(message: AgentSnapshotMessage | undefined): void {\n\t\tif (message === undefined) return;\n\t\tif (this.state.liveChat.hydrateStreamingAssistantMessage(message)) this.state.requestRender?.();\n\t}\n\n\tloadSessionFile(sessionFile: string | undefined): void {\n\t\tif (this.state.transcript.length > 0 || sessionFile === undefined) return;\n\t\tlet messages: readonly AgentSnapshotMessage[];\n\t\ttry {\n\t\t\tmessages = repairOrphanToolResults(SessionManager.open(sessionFile).buildSessionContext().messages, {\n\t\t\t\trepairTrailing: true,\n\t\t\t}) as readonly AgentSnapshotMessage[];\n\t\t} catch {\n\t\t\treturn;\n\t\t}\n\t\tthis.state.liveChat.appendMessages(messages);\n\t}\n\n\tappendExtraEntry(entry: TExtraEntry): void {\n\t\tthis.state.extraEntries.push(entry);\n\t\tthis.state.transcript.push(entry);\n\t}\n\n\tentries(): readonly ChatSessionHostEntry<TExtraEntry>[] {\n\t\treturn this.state.transcript;\n\t}\n\n\t/** Tasks outlive tools and turns; only host/session binding grants this read projection. */\n\trefreshTaskStore(): void {\n\t\tconst session = this.state.getAgentSession?.();\n\t\tconst sessionChanged = session !== this.taskSession;\n\t\tif (sessionChanged) {\n\t\t\tthis.unsubscribeTaskBinding?.();\n\t\t\tthis.taskSession = session;\n\t\t\tthis.unsubscribeTaskBinding = session\n\t\t\t\t? watchOwnerTaskStoreBinding(session, () => this.refreshTaskStore())\n\t\t\t\t: undefined;\n\t\t}\n\t\tconst store = session ? getOwnerTaskStore(session) : undefined;\n\t\tif (store === this.taskStore) return;\n\t\tthis.closeTasks();\n\t\tthis.unsubscribeTasks?.();\n\t\tthis.taskStore = store;\n\t\tthis.unsubscribeTasks = undefined;\n\t\tthis.state.liveChat.clearTasks();\n\t\tthis.state.transcriptComponent.invalidate();\n\t\tthis.state.requestRender?.();\n\t\tif (!store) return;\n\t\tconst update = () => {\n\t\t\tif (this.taskRowsInChat) this.state.liveChat.upsertTasks(store.tasks, store);\n\t\t\tthis.state.transcriptComponent.invalidate();\n\t\t\tthis.state.requestRender?.();\n\t\t};\n\t\tthis.unsubscribeTasks = store.subscribe(update);\n\t\tupdate();\n\t}\n\tapplyAgentEvent(event: AgentSessionEvent): boolean {\n\t\tthis.refreshTaskStore();\n\t\treturn applyChatSessionAgentEvent(this.state, event);\n\t}\n\n\t/**\n\t * Restore the factual compaction indicator on a host mounted after the\n\t * `compaction_start` it never saw. The label resolves through the same\n\t * mapping the live event path uses, so the two cannot drift.\n\t *\n\t * Branch summaries deliberately do not paint here: their label belongs to\n\t * a retry lifecycle this re-attached host is not inside, and no event exists\n\t * to clear it after the summary finishes. An absent paintable reason is a\n\t * no-op unless this host is actively showing a compaction label, so unrelated\n\t * workflow delivery busy state is preserved.\n\t */\n\thydrateCompactionStatus(reason: CompactionReason | undefined): void {\n\t\tconst compactionReason = reason === \"branchSummary\" ? undefined : reason;\n\t\tif (compactionReason === undefined) {\n\t\t\tif (!this.state.compacting) return;\n\t\t\tthis.state.compacting = false;\n\t\t\tthis.state.statusMessage = \"\";\n\t\t} else {\n\t\t\tthis.state.compacting = true;\n\t\t\tthis.state.sdkBusy = true;\n\t\t\tthis.state.statusMessage = compactionStatusMessage(compactionReason);\n\t\t}\n\t\tthis.syncAnimationTick();\n\t\tthis.state.requestRender?.();\n\t}\n\n\trender(width: number): string[] {\n\t\treturn this.renderBody(width, 1);\n\t}\n\n\tinvalidate(): void {\n\t\tthis.taskInspector?.invalidate();\n\t\tthis.state.transcriptComponent.invalidate();\n\t\tthis.state.bodyViewport.invalidate();\n\t\tthis.state.editor?.invalidate();\n\t}\n\n\trenderBody(width: number, budget: number): string[] {\n\t\tif (this.taskInspector) {\n\t\t\tif (this.taskInspector.fullscreen) return this.taskInspector.renderViewport(width, budget);\n\t\t\tconst picker = this.taskInspector.renderPicker(width, budget);\n\t\t\tconst remaining = Math.max(0, budget - picker.length);\n\t\t\tconst body = remaining ? renderChatSessionBody(this.state, width, remaining) : [];\n\t\t\treturn [...body, ...Array.from({ length: Math.max(0, remaining - body.length) }, () => \"\"), ...picker];\n\t\t}\n\t\treturn renderChatSessionBody(this.state, width, budget);\n\t}\n\n\t/**\n\t * Rows the body occupies at `width`, whether or not they are on screen.\n\t *\n\t * Pair with `renderBodyRows` to read the whole transcript, not only the\n\t * window the reader is parked on. Both measure the component stack the last\n\t * `renderBody` installed, so call them after at least one body render.\n\t */\n\tbodyRowCount(width: number): number {\n\t\treturn this.state.bodyViewport.rowCount(width);\n\t}\n\n\t/** Body rows `startRow` (inclusive) to `endRow` (exclusive), unscrolled. */\n\trenderBodyRows(width: number, startRow: number, endRow: number): string[] {\n\t\treturn this.state.bodyViewport.renderRows(width, startRow, endRow);\n\t}\n\n\t/**\n\t * Render a live assistant entry whole, or only its tail (the default).\n\t *\n\t * The tail window keeps a fast-streaming turn cheap for a reader following\n\t * the bottom of the body; it also drops everything above the last 240 lines\n\t * from what `bodyRowCount` and `renderBodyRows` report. Returns whether the\n\t * setting changed, so the caller can invalidate the rows that were rendered\n\t * under the old rule.\n\t */\n\tsetStreamingTailWindowEnabled(enabled: boolean): boolean {\n\t\tif (this.state.streamingTailWindowEnabled === enabled) return false;\n\t\tthis.state.streamingTailWindowEnabled = enabled;\n\t\tthis.invalidate();\n\t\treturn true;\n\t}\n\n\trenderPendingMessages(width: number): string[] {\n\t\treturn renderChatSessionPendingMessages(this.state, width);\n\t}\n\n\trenderWorkingStatus(width: number): string[] {\n\t\treturn renderChatSessionWorkingStatus(this.state, width);\n\t}\n\n\trenderUsage(width: number): string[] {\n\t\treturn renderChatSessionUsage(this.state, width);\n\t}\n\n\trenderEditor(width: number): string[] {\n\t\treturn renderChatSessionEditor(this.state, width, this.focused);\n\t}\n\n\trenderTaskFooter(width: number): string[] {\n\t\treturn renderTaskFooter(this.taskStore?.backgroundTasks ?? [], width);\n\t}\n\trenderFooter(width: number): string[] {\n\t\tconst footer = renderChatSessionFooter(this.state, width, this.hasTaskInspector && !this.taskInspectorFullscreen);\n\t\treturn footer.length ? footer : renderTaskFooter(this.taskStore?.backgroundTasks ?? [], width);\n\t}\n\n\thandleScrollInput(data: string): boolean {\n\t\treturn this.state.bodyViewport.handleInput(data);\n\t}\n\n\thandleInput(data: string): boolean {\n\t\treturn handleChatSessionInput(this.state, data, this.editorCallbacks());\n\t}\n\n\tasync interrupt(options?: { restoreQueuedMessages?: boolean }): Promise<void> {\n\t\tawait interruptChatSession(this.state, options);\n\t}\n\n\tasync submit(mode: ChatSessionSubmitMode = \"auto\", submittedText?: string): Promise<void> {\n\t\tawait submitChatSession(this.state, mode, submittedText);\n\t}\n\n\tisStreaming(): boolean {\n\t\treturn isChatSessionStreaming(this.state);\n\t}\n\n\tisBashRunning(): boolean {\n\t\treturn isChatSessionBashRunning(this.state);\n\t}\n\n\tisEditingBashCommand(): boolean {\n\t\treturn this.state.isBashMode;\n\t}\n\n\tisCompacting(): boolean {\n\t\treturn this.state.compacting;\n\t}\n\n\thasInputText(): boolean {\n\t\treturn this.state.inputBuffer.length > 0;\n\t}\n\n\thasAnimationTick(): boolean {\n\t\treturn this.state.animationTimer !== undefined;\n\t}\n\n\tbodyScrollFromBottom(): number {\n\t\treturn this.state.bodyViewport.getScrollFromBottom();\n\t}\n\n\tbodyMaxScroll(): number {\n\t\treturn this.state.bodyViewport.getMaxScroll();\n\t}\n\n\tinputText(): string {\n\t\treturn this.state.inputBuffer;\n\t}\n\tsetInputText(text: string): void {\n\t\tsetChatSessionEditorText(this.state, text);\n\t}\n\n\tstatusText(): string {\n\t\treturn this.state.statusMessage;\n\t}\n\n\tshowWarning(message: string): void {\n\t\tthis.state.statusMessage = message;\n\t\tthis.state.lastWarningMessage = message;\n\t\tthis.state.requestRender?.();\n\t}\n\n\tscrollToBottom(): void {\n\t\tthis.state.bodyViewport.scrollToBottom();\n\t}\n\n\t/**\n\t * Park the body with absolute row `row` at the top of its window, clamped\n\t * to the last rendered layout. Used to reveal a search match the reader\n\t * cannot currently see.\n\t */\n\tscrollBodyTo(row: number): void {\n\t\tthis.state.bodyViewport.scrollTo(row);\n\t}\n\n\tsyncAnimationTick(): void {\n\t\tsyncChatSessionAnimationTick(this.state);\n\t}\n\n\tclearBusyForTerminalWorkflowStage(): void {\n\t\tclearChatSessionBusyForTerminalWorkflowStage(this.state);\n\t}\n\n\t/**\n\t * Start Working for an accepted prompt delivered outside this host — a\n\t * workflow definition auto-sending to its own retained stage. Returns the\n\t * lifecycle token to hand back to `settleExternalPromptLifecycle`.\n\t */\n\tbeginExternalPromptLifecycle(): number | undefined {\n\t\treturn startChatSessionExternalPromptLifecycle(this.state);\n\t}\n\n\t/**\n\t * Reopen Working for a delivery still active after a temporary overlay — a\n\t * pre-turn compaction — cleared it. Preserves factual status text.\n\t */\n\treassertExternalPromptLifecycle(): number | undefined {\n\t\treturn reassertChatSessionExternalPromptLifecycle(this.state);\n\t}\n\n\t/** Settle a lifecycle from `beginExternalPromptLifecycle`. Stale tokens no-op. */\n\tsettleExternalPromptLifecycle(generation: number | undefined): void {\n\t\tsettleChatSessionPromptLifecycle(this.state, generation);\n\t\tsyncChatSessionAnimationTick(this.state);\n\t\tthis.state.requestRender?.();\n\t}\n\n\tdispose(): void {\n\t\tthis.taskInspector?.dispose();\n\t\tthis.unsubscribeTasks?.();\n\t\tthis.unsubscribeTaskBinding?.();\n\t\tdisposeChatSession(this.state);\n\t}\n\n\trestoreQueuedMessagesToEditor(): boolean {\n\t\treturn restoreQueuedMessagesToEditor(this.state);\n\t}\n\n\tprivate editorCallbacks(): {\n\t\tsubmit: (mode: \"auto\" | \"followUp\", submittedText?: string) => void | Promise<void>;\n\t\trestoreQueuedMessagesToEditor: () => boolean;\n\t\tabortCompaction: () => void | Promise<void>;\n\t\tinterrupt: (options?: { restoreQueuedMessages?: boolean }) => void | Promise<void>;\n\t\tabortBash: () => void | Promise<void>;\n\t} {\n\t\treturn {\n\t\t\tsubmit: (mode, submittedText) => this.submit(mode, submittedText),\n\t\t\trestoreQueuedMessagesToEditor: () => this.restoreQueuedMessagesToEditor(),\n\t\t\tabortCompaction: () => abortChatSessionCompaction(this.state),\n\t\t\tinterrupt: (options) => this.interrupt(options),\n\t\t\tabortBash: () => abortChatSessionBash(this.state),\n\t\t};\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"chat-session-host.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/chat-session-host.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAElE,OAAO,EAAE,iBAAiB,EAAuB,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AACxH,OAAO,EACN,oBAAoB,EACpB,0BAA0B,EAC1B,oBAAoB,EACpB,6BAA6B,EAC7B,iBAAiB,GACjB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACN,uBAAuB,EACvB,sBAAsB,EACtB,wBAAwB,GACxB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,0BAA0B,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AACpG,OAAO,EACN,qBAAqB,EACrB,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,EACvB,gCAAgC,EAChC,sBAAsB,EACtB,8BAA8B,EAC9B,kBAAkB,GAClB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACN,4CAA4C,EAC5C,kBAAkB,EAClB,wBAAwB,EACxB,sBAAsB,EACtB,0CAA0C,EAC1C,gCAAgC,EAChC,uCAAuC,EACvC,4BAA4B,GAC5B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAQpE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAWlD,MAAM,OAAO,eAAe;IAW3B,YAAY,IAAsC;QAVlD,YAAO,GAAG,IAAI,CAAC;QAWd,kFAAkF;QAClF,gFAAgF;QAChF,oEAAoE;QACpE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,IAAI,IAAI,CAAC;QAClD,IAAI,CAAC,KAAK,GAAG,IAAI,oBAAoB,CAA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AC,KAAK,CAAC;SACjD,CAAC;IACH,CAAC;CACD","sourcesContent":["import type { Component, Focusable } from \"@earendil-works/pi-tui\";\nimport type { AgentSessionEvent, CompactionReason } from \"../../../core/agent-session.js\";\nimport { repairOrphanToolResults } from \"../../../core/messages.ts\";\nimport { SessionManager } from \"../../../core/session-manager.ts\";\nimport type { TaskId } from \"../../../core/tasks/contracts.js\";\nimport { getOwnerTaskStore, type OwnerTaskStore, watchOwnerTaskStoreBinding } from \"../../../core/tasks/owner-store.js\";\nimport {\n\tabortChatSessionBash,\n\tabortChatSessionCompaction,\n\tinterruptChatSession,\n\trestoreQueuedMessagesToEditor,\n\tsubmitChatSession,\n} from \"./chat-session-host-actions.ts\";\nimport {\n\tcreateChatSessionEditor,\n\thandleChatSessionInput,\n\tsetChatSessionEditorText,\n} from \"./chat-session-host-editor.ts\";\nimport { applyChatSessionAgentEvent, compactionStatusMessage } from \"./chat-session-host-events.ts\";\nimport {\n\trenderChatSessionBody,\n\trenderChatSessionEditor,\n\trenderChatSessionEntry,\n\trenderChatSessionFooter,\n\trenderChatSessionPendingMessages,\n\trenderChatSessionUsage,\n\trenderChatSessionWorkingStatus,\n\ttranscriptCacheKey,\n} from \"./chat-session-host-rendering.ts\";\nimport {\n\tclearChatSessionBusyForTerminalWorkflowStage,\n\tdisposeChatSession,\n\tisChatSessionBashRunning,\n\tisChatSessionStreaming,\n\treassertChatSessionExternalPromptLifecycle,\n\tsettleChatSessionPromptLifecycle,\n\tstartChatSessionExternalPromptLifecycle,\n\tsyncChatSessionAnimationTick,\n} from \"./chat-session-host-runtime.ts\";\nimport { ChatSessionHostState } from \"./chat-session-host-state.ts\";\nimport type {\n\tAgentSnapshotMessage,\n\tChatSessionHostEntry,\n\tChatSessionHostOpts,\n\tChatSessionSubmitMode,\n} from \"./chat-session-host-types.ts\";\nimport type { ChatTranscriptEntryLike } from \"./chat-transcript.js\";\nimport { TaskInspector } from \"./task-inspector.js\";\nimport { renderTaskFooter } from \"./task-list.js\";\n\nexport type {\n\tChatSessionHostBashRequest,\n\tChatSessionHostCommands,\n\tChatSessionHostEntry,\n\tChatSessionHostOpts,\n\tChatSessionHostStyle,\n\tChatSessionSubmitMode,\n} from \"./chat-session-host-types.ts\";\n\nexport class ChatSessionHost<TExtraEntry extends ChatTranscriptEntryLike = never> implements Component, Focusable {\n\tfocused = true;\n\n\tprivate readonly state: ChatSessionHostState<TExtraEntry>;\n\tprivate taskStore?: OwnerTaskStore;\n\tprivate readonly taskRowsInChat: boolean;\n\tprivate unsubscribeTasks?: () => void;\n\tprivate taskSession?: object;\n\tprivate unsubscribeTaskBinding?: () => void;\n\tprivate taskInspector?: TaskInspector;\n\n\tconstructor(opts: ChatSessionHostOpts<TExtraEntry>) {\n\t\t// `/tasks` stays a local action owned by the host's `commands.handleSlashCommand`\n\t\t// (see submitChatSession). Hosts that mount the inspector call `openTasks` from\n\t\t// that callback; the host must not intercept it ahead of the owner.\n\t\tthis.taskRowsInChat = opts.taskRowsInChat ?? true;\n\t\tthis.state = new ChatSessionHostState(opts, {\n\t\t\trenderEntry: (state, entry) => renderChatSessionEntry(state, entry),\n\t\t\ttranscriptCacheKey: (state, entry, index) => transcriptCacheKey(state, entry, index),\n\t\t});\n\t\tthis.state.editor = createChatSessionEditor(\n\t\t\tthis.state,\n\t\t\topts.tui,\n\t\t\topts.keybindings,\n\t\t\topts.editorTheme,\n\t\t\topts.editorFactory,\n\t\t\tthis.editorCallbacks(),\n\t\t);\n\t\tif (opts.autocompleteProvider) this.state.editor?.setAutocompleteProvider?.(opts.autocompleteProvider);\n\t\tthis.syncAnimationTick();\n\t\tthis.refreshTaskStore();\n\t}\n\n\topenTasks(id?: string): boolean {\n\t\tconst session = this.state.getAgentSession?.();\n\t\tif (session && !getOwnerTaskStore(session)) session.getAgentTaskHost?.();\n\t\tthis.refreshTaskStore();\n\t\tif (!this.taskStore) {\n\t\t\tthis.showWarning(\"Launched agents and shells will appear here.\");\n\t\t\treturn true;\n\t\t}\n\t\tthis.taskInspector?.dispose();\n\t\tthis.taskInspector = new TaskInspector(\n\t\t\tthis.taskStore,\n\t\t\t() => this.state.requestRender?.(),\n\t\t\t() => this.closeTasks(),\n\t\t);\n\t\tthis.taskInspector.open(id as TaskId | undefined);\n\t\tthis.state.requestRender?.();\n\t\treturn true;\n\t}\n\tget hasTaskInspector(): boolean {\n\t\treturn this.taskInspector !== undefined;\n\t}\n\tget taskInspectorFullscreen(): boolean {\n\t\treturn this.taskInspector?.fullscreen === true;\n\t}\n\tcloseTasks(): void {\n\t\tthis.taskInspector?.dispose();\n\t\tthis.taskInspector = undefined;\n\t\tthis.state.requestRender?.();\n\t}\n\thandleTaskInput(data: string): boolean {\n\t\tif (!this.taskInspector) return false;\n\t\tthis.taskInspector.handleInput(data);\n\t\treturn true;\n\t}\n\tappendMessages(messages: readonly AgentSnapshotMessage[]): void {\n\t\tthis.state.liveChat.appendMessages(messages);\n\t}\n\n\t/**\n\t * Adopt the assistant message a live session is part-way through streaming.\n\t *\n\t * A host mounted mid-turn missed the `message_start` and every delta that\n\t * came before it, and delta-only updates never restate them, so the session's\n\t * in-flight message is the only place that text still exists. Ignored once\n\t * this host is already following a stream of its own.\n\t */\n\thydrateStreamingAssistantMessage(message: AgentSnapshotMessage | undefined): void {\n\t\tif (message === undefined) return;\n\t\tif (this.state.liveChat.hydrateStreamingAssistantMessage(message)) this.state.requestRender?.();\n\t}\n\n\tloadSessionFile(sessionFile: string | undefined): void {\n\t\tif (this.state.transcript.length > 0 || sessionFile === undefined) return;\n\t\tlet messages: readonly AgentSnapshotMessage[];\n\t\ttry {\n\t\t\tmessages = repairOrphanToolResults(SessionManager.open(sessionFile).buildSessionContext().messages, {\n\t\t\t\trepairTrailing: true,\n\t\t\t}) as readonly AgentSnapshotMessage[];\n\t\t} catch {\n\t\t\treturn;\n\t\t}\n\t\tthis.state.liveChat.appendMessages(messages);\n\t}\n\n\tappendExtraEntry(entry: TExtraEntry): void {\n\t\tthis.state.extraEntries.push(entry);\n\t\tthis.state.transcript.push(entry);\n\t}\n\n\tentries(): readonly ChatSessionHostEntry<TExtraEntry>[] {\n\t\treturn this.state.transcript;\n\t}\n\n\t/** Tasks outlive tools and turns; only host/session binding grants this read projection. */\n\trefreshTaskStore(): void {\n\t\tconst session = this.state.getAgentSession?.();\n\t\tconst sessionChanged = session !== this.taskSession;\n\t\tif (sessionChanged) {\n\t\t\tthis.unsubscribeTaskBinding?.();\n\t\t\tthis.taskSession = session;\n\t\t\tthis.unsubscribeTaskBinding = session\n\t\t\t\t? watchOwnerTaskStoreBinding(session, () => this.refreshTaskStore())\n\t\t\t\t: undefined;\n\t\t}\n\t\tconst store = session ? getOwnerTaskStore(session) : undefined;\n\t\tif (store === this.taskStore) return;\n\t\tthis.closeTasks();\n\t\tthis.unsubscribeTasks?.();\n\t\tthis.taskStore = store;\n\t\tthis.unsubscribeTasks = undefined;\n\t\tthis.state.liveChat.clearTasks();\n\t\tthis.state.transcriptComponent.invalidate();\n\t\tthis.state.requestRender?.();\n\t\tif (!store) return;\n\t\tconst update = () => {\n\t\t\tif (this.taskRowsInChat) this.state.liveChat.upsertTasks(store.tasks, store);\n\t\t\tthis.state.transcriptComponent.invalidate();\n\t\t\tthis.state.requestRender?.();\n\t\t};\n\t\tthis.unsubscribeTasks = store.subscribe(update);\n\t\tupdate();\n\t}\n\tapplyAgentEvent(event: AgentSessionEvent): boolean {\n\t\tthis.refreshTaskStore();\n\t\treturn applyChatSessionAgentEvent(this.state, event);\n\t}\n\n\t/**\n\t * Restore the factual compaction indicator on a host mounted after the\n\t * `compaction_start` it never saw. The label resolves through the same\n\t * mapping the live event path uses, so the two cannot drift.\n\t *\n\t * Branch summaries deliberately do not paint here: their label belongs to\n\t * a retry lifecycle this re-attached host is not inside, and no event exists\n\t * to clear it after the summary finishes. An absent paintable reason is a\n\t * no-op unless this host is actively showing a compaction label, so unrelated\n\t * workflow delivery busy state is preserved.\n\t */\n\thydrateCompactionStatus(reason: CompactionReason | undefined): void {\n\t\tconst compactionReason = reason === \"branchSummary\" ? undefined : reason;\n\t\tif (compactionReason === undefined) {\n\t\t\tif (!this.state.compacting) return;\n\t\t\tthis.state.compacting = false;\n\t\t\tthis.state.statusMessage = \"\";\n\t\t} else {\n\t\t\tthis.state.compacting = true;\n\t\t\tthis.state.sdkBusy = true;\n\t\t\tthis.state.statusMessage = compactionStatusMessage(compactionReason);\n\t\t}\n\t\tthis.syncAnimationTick();\n\t\tthis.state.requestRender?.();\n\t}\n\n\trender(width: number): string[] {\n\t\treturn this.renderBody(width, 1);\n\t}\n\n\tinvalidate(): void {\n\t\tthis.taskInspector?.invalidate();\n\t\tthis.state.transcriptComponent.invalidate();\n\t\tthis.state.bodyViewport.invalidate();\n\t\tthis.state.editor?.invalidate();\n\t}\n\n\trenderBody(width: number, budget: number): string[] {\n\t\tif (this.taskInspector) {\n\t\t\tif (this.taskInspector.fullscreen) return this.taskInspector.renderViewport(width, budget);\n\t\t\tconst picker = this.taskInspector.renderPicker(width, budget);\n\t\t\tconst remaining = Math.max(0, budget - picker.length);\n\t\t\tconst body = remaining ? renderChatSessionBody(this.state, width, remaining) : [];\n\t\t\treturn [...body, ...Array.from({ length: Math.max(0, remaining - body.length) }, () => \"\"), ...picker];\n\t\t}\n\t\treturn renderChatSessionBody(this.state, width, budget);\n\t}\n\n\t/**\n\t * Rows the body occupies at `width`, whether or not they are on screen.\n\t *\n\t * Pair with `renderBodyRows` to read the whole transcript, not only the\n\t * window the reader is parked on. Both measure the component stack the last\n\t * `renderBody` installed, so call them after at least one body render.\n\t */\n\tbodyRowCount(width: number): number {\n\t\treturn this.state.bodyViewport.rowCount(width);\n\t}\n\n\t/** Body rows `startRow` (inclusive) to `endRow` (exclusive), unscrolled. */\n\trenderBodyRows(width: number, startRow: number, endRow: number): string[] {\n\t\treturn this.state.bodyViewport.renderRows(width, startRow, endRow);\n\t}\n\n\t/**\n\t * Render a live assistant entry whole, or only its tail (the default).\n\t *\n\t * The tail window keeps a fast-streaming turn cheap for a reader following\n\t * the bottom of the body; it also drops everything above the last 240 lines\n\t * from what `bodyRowCount` and `renderBodyRows` report. Returns whether the\n\t * setting changed, so the caller can invalidate the rows that were rendered\n\t * under the old rule.\n\t */\n\tsetStreamingTailWindowEnabled(enabled: boolean): boolean {\n\t\tif (this.state.streamingTailWindowEnabled === enabled) return false;\n\t\tthis.state.streamingTailWindowEnabled = enabled;\n\t\tthis.invalidate();\n\t\treturn true;\n\t}\n\n\trenderPendingMessages(width: number): string[] {\n\t\treturn renderChatSessionPendingMessages(this.state, width);\n\t}\n\n\trenderWorkingStatus(width: number): string[] {\n\t\treturn renderChatSessionWorkingStatus(this.state, width);\n\t}\n\n\trenderUsage(width: number): string[] {\n\t\treturn renderChatSessionUsage(this.state, width);\n\t}\n\n\trenderEditor(width: number): string[] {\n\t\treturn renderChatSessionEditor(this.state, width, this.focused);\n\t}\n\n\trenderTaskFooter(width: number): string[] {\n\t\treturn renderTaskFooter(this.taskStore?.backgroundTasks ?? [], width);\n\t}\n\trenderFooter(width: number): string[] {\n\t\tconst footer = renderChatSessionFooter(this.state, width, this.hasTaskInspector && !this.taskInspectorFullscreen);\n\t\treturn footer.length ? footer : renderTaskFooter(this.taskStore?.backgroundTasks ?? [], width);\n\t}\n\n\thandleScrollInput(data: string): boolean {\n\t\treturn this.state.bodyViewport.handleInput(data);\n\t}\n\n\thandleInput(data: string): boolean {\n\t\treturn handleChatSessionInput(this.state, data, this.editorCallbacks());\n\t}\n\n\tinterrupt(options?: { restoreQueuedMessages?: boolean }): Promise<void> {\n\t\t// Keep the observed settlement: an async wrapper would orphan rejections from Escape callers.\n\t\treturn interruptChatSession(this.state, options);\n\t}\n\n\tasync submit(mode: ChatSessionSubmitMode = \"auto\", submittedText?: string): Promise<void> {\n\t\tawait submitChatSession(this.state, mode, submittedText);\n\t}\n\n\tisStreaming(): boolean {\n\t\treturn isChatSessionStreaming(this.state);\n\t}\n\n\tisBashRunning(): boolean {\n\t\treturn isChatSessionBashRunning(this.state);\n\t}\n\n\tisEditingBashCommand(): boolean {\n\t\treturn this.state.isBashMode;\n\t}\n\n\tisCompacting(): boolean {\n\t\treturn this.state.compacting;\n\t}\n\n\thasInputText(): boolean {\n\t\treturn this.state.inputBuffer.length > 0;\n\t}\n\n\thasAnimationTick(): boolean {\n\t\treturn this.state.animationTimer !== undefined;\n\t}\n\n\tbodyScrollFromBottom(): number {\n\t\treturn this.state.bodyViewport.getScrollFromBottom();\n\t}\n\n\tbodyMaxScroll(): number {\n\t\treturn this.state.bodyViewport.getMaxScroll();\n\t}\n\n\tinputText(): string {\n\t\treturn this.state.inputBuffer;\n\t}\n\tsetInputText(text: string): void {\n\t\tsetChatSessionEditorText(this.state, text);\n\t}\n\n\tstatusText(): string {\n\t\treturn this.state.statusMessage;\n\t}\n\n\tshowWarning(message: string): void {\n\t\tthis.state.statusMessage = message;\n\t\tthis.state.lastWarningMessage = message;\n\t\tthis.state.requestRender?.();\n\t}\n\n\tscrollToBottom(): void {\n\t\tthis.state.bodyViewport.scrollToBottom();\n\t}\n\n\t/**\n\t * Park the body with absolute row `row` at the top of its window, clamped\n\t * to the last rendered layout. Used to reveal a search match the reader\n\t * cannot currently see.\n\t */\n\tscrollBodyTo(row: number): void {\n\t\tthis.state.bodyViewport.scrollTo(row);\n\t}\n\n\tsyncAnimationTick(): void {\n\t\tsyncChatSessionAnimationTick(this.state);\n\t}\n\n\tclearBusyForTerminalWorkflowStage(): void {\n\t\tclearChatSessionBusyForTerminalWorkflowStage(this.state);\n\t}\n\n\t/**\n\t * Start Working for an accepted prompt delivered outside this host — a\n\t * workflow definition auto-sending to its own retained stage. Returns the\n\t * lifecycle token to hand back to `settleExternalPromptLifecycle`.\n\t */\n\tbeginExternalPromptLifecycle(): number | undefined {\n\t\treturn startChatSessionExternalPromptLifecycle(this.state);\n\t}\n\n\t/**\n\t * Reopen Working for a delivery still active after a temporary overlay — a\n\t * pre-turn compaction — cleared it. Preserves factual status text.\n\t */\n\treassertExternalPromptLifecycle(): number | undefined {\n\t\treturn reassertChatSessionExternalPromptLifecycle(this.state);\n\t}\n\n\t/** Settle a lifecycle from `beginExternalPromptLifecycle`. Stale tokens no-op. */\n\tsettleExternalPromptLifecycle(generation: number | undefined): void {\n\t\tsettleChatSessionPromptLifecycle(this.state, generation);\n\t\tsyncChatSessionAnimationTick(this.state);\n\t\tthis.state.requestRender?.();\n\t}\n\n\tdispose(): void {\n\t\tthis.taskInspector?.dispose();\n\t\tthis.unsubscribeTasks?.();\n\t\tthis.unsubscribeTaskBinding?.();\n\t\tdisposeChatSession(this.state);\n\t}\n\n\trestoreQueuedMessagesToEditor(): boolean {\n\t\treturn restoreQueuedMessagesToEditor(this.state);\n\t}\n\n\tprivate editorCallbacks(): {\n\t\tsubmit: (mode: \"auto\" | \"followUp\", submittedText?: string) => void | Promise<void>;\n\t\trestoreQueuedMessagesToEditor: () => boolean;\n\t\tabortCompaction: () => void | Promise<void>;\n\t\tinterrupt: (options?: { restoreQueuedMessages?: boolean }) => void | Promise<void>;\n\t\tabortBash: () => void | Promise<void>;\n\t} {\n\t\treturn {\n\t\t\tsubmit: (mode, submittedText) => this.submit(mode, submittedText),\n\t\t\trestoreQueuedMessagesToEditor: () => this.restoreQueuedMessagesToEditor(),\n\t\t\tabortCompaction: () => abortChatSessionCompaction(this.state),\n\t\t\tinterrupt: (options) => this.interrupt(options),\n\t\t\tabortBash: () => abortChatSessionBash(this.state),\n\t\t};\n\t}\n}\n"]}
|
package/docs/background-tasks.md
CHANGED
|
@@ -94,6 +94,8 @@ subagent({ action: "status", id: taskId })
|
|
|
94
94
|
|
|
95
95
|
Do not launch a duplicate just to retrieve its result. Use the task ID returned at launch. IDs are scoped to the session or workflow stage that owns them.
|
|
96
96
|
|
|
97
|
+
Foreground subagent launches and explicit `action: "wait"` calls also yield when user steering or an Intercom ask/send is admitted to the waiting parent, in main chat or a live workflow stage. The message stays in the normal delivery queue so the parent can handle it and reply. This releases only observation: children keep running under the same task IDs, and other owners' waits are unaffected.
|
|
98
|
+
|
|
97
99
|
### Completion messages
|
|
98
100
|
|
|
99
101
|
Completion creates a shaded notification card in the owning chat without depending on a model reply. It uses the chat theme's card background and padding, with a colored outcome, the agent or shell name, and an available result preview:
|
|
@@ -174,7 +176,11 @@ Bash calls inside subagent sessions retain their existing execution paths. Witho
|
|
|
174
176
|
|
|
175
177
|
## Lifetime and scope
|
|
176
178
|
|
|
177
|
-
Background means independent of the current observation, not independent of its owner. Pausing main chat
|
|
179
|
+
Background means independent of the current observation, not independent of its owner. **Pausing main chat** aborts the foreground turn only; its background agents and shells keep running. Detaching a workflow pane, ending a model turn, or closing `/tasks` also leaves owned background work alone.
|
|
180
|
+
|
|
181
|
+
**Pausing a workflow stage** blocks new task launches immediately and cancels that stage generation's active and admitted queued agents and commands. Queued agents are cancelled before active cancellations free execution slots. Command setup already in flight may briefly start a shell during the pause transition; pause waits for those admissions, cancels the resulting shells, and confirms resource cleanup before completing. A successful pause leaves no owned active or queued executions. Cancellation or cleanup failures are reported instead of confirming pause. Main-chat tasks, sibling stages, and future stage generations are unaffected by a stage-scoped pause.
|
|
182
|
+
|
|
183
|
+
Pause does not close the stage's message generation: queued user and Intercom messages remain held for resume. Resume permits fresh launches but never resurrects cancelled executions; retained task results remain inspectable. Closing a session or stage generation still cancels its remaining owned work. Explicit `/tasks` stop and declared execution timeouts remain separate controls.
|
|
178
184
|
|
|
179
185
|
On native Windows, Suspend opens a PowerShell subshell rather than freezing Atomic. Exit the subshell to restore the same session; owned background tasks continue while it is open.
|
|
180
186
|
|
package/docs/development.md
CHANGED
|
@@ -8,15 +8,10 @@ See [AGENTS.md](https://github.com/bastani-inc/atomic/blob/main/AGENTS.md) for a
|
|
|
8
8
|
git clone https://github.com/bastani-inc/atomic
|
|
9
9
|
cd atomic
|
|
10
10
|
npm ci --ignore-scripts
|
|
11
|
-
npm run
|
|
11
|
+
npm run build
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
npm run test:unit
|
|
18
|
-
npm run build --workspace=@bastani/atomic
|
|
19
|
-
```
|
|
14
|
+
Use npm for installs, builds, checks, and Vitest suites. Bun compiles standalone binaries and runs repository TypeScript scripts. Do not use yarn, pnpm, or `bun install`.
|
|
20
15
|
|
|
21
16
|
Atomic keeps the caller's current working directory when launched from development wrappers.
|
|
22
17
|
|
|
@@ -33,7 +28,7 @@ Configure via `package.json`:
|
|
|
33
28
|
}
|
|
34
29
|
```
|
|
35
30
|
|
|
36
|
-
Change `name`, `configDir`, and the `bin` field for your fork.
|
|
31
|
+
Change `name`, `configDir`, and the `bin` field for your fork. These control the CLI banner, config paths, and environment variable names. Legacy `piConfig` remains a compatibility fallback.
|
|
37
32
|
|
|
38
33
|
## Path Resolution
|
|
39
34
|
|
|
@@ -53,88 +48,42 @@ Never use `__dirname` directly for package assets.
|
|
|
53
48
|
- Rendered TUI lines with ANSI codes
|
|
54
49
|
- Last messages sent to the LLM
|
|
55
50
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
Use `scripts/perf/windows-startup/benchmark.ts` for Windows startup claims. It launches the ordinary bare `atomic` command through a real 120x40 ConPTY, feeds ordered output into `@xterm/headless`, and timestamps each receive with `process.hrtime.bigint()`. Complete first paint requires the final `Atomic v<version>` identity, the focused `❯ ` editor, and two identical settled frames at least one 80 ms animation interval apart. `dispatchMs` runs from the Enter write to the first byte observed by a raw TCP loopback provider. The headline `spawnToDispatchMs` is exactly `startupCompleteMs + dispatchMs`; `launchToProviderFirstByteMs` separately retains the contiguous launch-to-provider interval that also contains nonce typing and editor-echo wait. The provider request must contain the nonce and the normal tool schemas, and every accepted sample must pass `/workflow list` after the timed response. See [the benchmark README](https://github.com/bastani-inc/atomic/blob/main/scripts/perf/windows-startup/README.md) for artifact preparation, cache profiles, raw records, and summary commands.
|
|
59
|
-
|
|
60
|
-
Do not use `time-to-first-frame` as settled-paint evidence, and do not substitute `launchToProviderFirstByteMs` for the contract sum. The first-frame mark records the host's first requested identity frame after the header is mounted; it does not prove terminal receipt, animation settlement, engine resource readiness, or provider readiness. `ATOMIC_STARTUP_BENCHMARK=1`, `--no-extensions`, and `--no-tools` are attribution controls only. They do not run the accepted full CLI path with bundled workflows, normal extensions, tools, and provider dispatch.
|
|
61
|
-
|
|
62
|
-
The process-local lifecycle timing seams use monotonic nanoseconds and remain disabled until an internal diagnostic adapter installs a synchronous sink. With no sink, they do not read the clock, write output, or schedule work. External ConPTY and TCP marks remain authoritative. Startup now has several deliberate partial orders rather than one cross-process sequence:
|
|
63
|
-
|
|
64
|
-
```text
|
|
65
|
-
interactive host: process-entry → interactive-engine-spawn → engine-ready
|
|
66
|
-
→ tui-start → header-mounted → initialize engine-bound state
|
|
67
|
-
→ chat-output-release → interactive-input-handler-ready
|
|
68
|
-
|
|
69
|
-
isolated child: process-entry → engine-ready → engine-bound
|
|
70
|
-
→ engine-resources-ready
|
|
71
|
-
|
|
72
|
-
external screen: first-terminal-write → startup-coherent → startup-complete
|
|
73
|
-
|
|
74
|
-
first turn: interactive-first-submit → before-provider-request
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
The header and editor are mounted before the host waits for `engine-bound`; the child can therefore report binding while the host is applying its theme or requesting that frame. `engine-bound` means RPC control plus the mandatory minimal session are available. `engine-resources-ready` is a separate, generation-scoped child message sent only after a staged optional snapshot containing bundled extensions, tools, providers, skills, prompts, and themes commits. User prompts, extension commands, model/resource commands, session replacement, and tool-dispatching RPC calls wait for that gate. After a readiness failure, `/reload` bypasses the rejected gate to start a fresh transactional attempt; successful retry replaces the gate before later work proceeds. Escape cancels a first submission that is still waiting, so that continuation cannot dispatch later. `session_start` messages are queued against the candidate snapshot and released only after publication. Mandatory Intercom remains in the minimal runtime. A failed transactional candidate leaves host-managed settings, providers, tools, resources, event subscriptions, and system-prompt state unchanged, restores an unadmitted prompt draft exactly, and reports the generation failure once. Extension-owned objects stored with `sessionScopedExtensionState` are deliberately shared across reloads and are not cloned or rolled back.
|
|
78
|
-
|
|
79
|
-
`engine-resources-ready` is recorded in the isolated engine process; host marks are recorded in the interactive process. The two process clocks are monotonic but must not be subtracted without an external synchronization protocol. `startup-coherent` and `startup-complete` describe internal render composition, not terminal receipt. The external VT predicates decide the reported first-paint marks.
|
|
80
|
-
|
|
81
|
-
For package-manager installs under Node 22, Atomic enables Node's persistent module compile cache in both the host and isolated child and flushes the host cache before spawning the child. Explicit `NODE_COMPILE_CACHE` and `NODE_DISABLE_COMPILE_CACHE` settings pass through unchanged. This preserves Node's coverage opt-out and avoids forcing a new cache directory or a first-run-only precompile step. SEA, V8 snapshots, and package-install precompilation were not adopted because Atomic's dynamic ESM, native modules, workers, and first-run requirements do not provide a safe portable boundary.
|
|
82
|
-
|
|
83
|
-
Compiled releases syntax-minify the shared CJS `app.js` sidecar without identifier minification and compile launchers with bytecode on all eight supported targets, including Windows x64 and ARM64. `bun run scripts/probe-windows-bytecode.ts` pins Bun 1.4.2, cross-compiles `bun-windows-x64-baseline` and `bun-windows-arm64` launchers, and verifies their PE machine types. Atomic observed a Bun 1.3.14 Windows startup crash in `llint_entry`, but Bun 1.4.0 already contains the embedded-bytecode alignment fix ([#26299](https://github.com/oven-sh/bun/pull/26299)) and integrity fallback ([#31961](https://github.com/oven-sh/bun/pull/31961)); the separate Bun 1.4.0 Windows report ([#40302](https://github.com/oven-sh/bun/issues/40302)) concerns a general standalone/JIT segfault and has not been shown to be bytecode-specific. Cross-compilation is not runtime validation: release candidates still require full-archive target-machine coverage of the TUI, workflows, tools, extensions, workers, and native add-ons, with Windows ARM64 validated on ARM64 hardware.
|
|
84
|
-
|
|
85
|
-
Set `ATOMIC_TIMING=1` only for the older human-readable phase diagnostics. Normal interactive launches print that initial timing group before `interactiveMode.run()` starts the TUI loop, so later marks are not printed during ordinary sessions.
|
|
51
|
+
For startup measurements, see the [Windows startup benchmark](https://github.com/bastani-inc/atomic/blob/main/scripts/perf/windows-startup/README.md). Internal timing marks do not prove terminal first paint.
|
|
86
52
|
|
|
87
53
|
## Testing
|
|
88
54
|
|
|
89
55
|
```bash
|
|
90
|
-
npm run
|
|
91
|
-
npm run test:unit
|
|
92
|
-
npm run test:integration
|
|
93
|
-
npm run test:all
|
|
94
|
-
npm run test:scripts
|
|
95
|
-
# Run the package Vitest suite (Node-hosted)
|
|
56
|
+
npm run check # Typechecks and published-shrinkwrap validation
|
|
57
|
+
npm run test:unit # Root unit tests
|
|
58
|
+
npm run test:integration # Root integration tests
|
|
59
|
+
npm run test:all # All root test projects
|
|
60
|
+
npm run test:scripts # Repository script tests under Node
|
|
96
61
|
npm run test --workspace=@bastani/atomic -- test/specific.test.ts
|
|
97
62
|
```
|
|
98
63
|
|
|
99
|
-
|
|
100
|
-
Durability initialization imports the backend and its process owner rather than
|
|
101
|
-
preloading the DBOS factory or the Atomic host. A test that needs host prototype
|
|
102
|
-
installers must import those real modules explicitly rather than depend on a
|
|
103
|
-
side effect of shared setup. Test-local backend overrides still use the factory's
|
|
104
|
-
injection seam, and the next test receives a fresh backend without resetting
|
|
105
|
-
unrelated initialization or warning state. Keep the global artifact/native setups,
|
|
106
|
-
default isolation, worker sizing and timeout budgets unchanged when measuring
|
|
107
|
-
test cost. See the [CI measurements](https://github.com/bastani-inc/atomic/blob/main/docs/ci.md#current-critical-path-measured-september-5-2026)
|
|
108
|
-
for local gains and the remaining hosted Linux/Windows validation.
|
|
109
|
-
|
|
110
|
-
CI runs the complete root unit and integration suites in independent Linux and
|
|
111
|
-
Windows jobs. Each builds its own native and package prerequisites; both required
|
|
112
|
-
result gates wait for every work job and reject failures, cancellations and skips.
|
|
113
|
-
This trades duplicated setup for earlier integration feedback without changing
|
|
114
|
-
test isolation, coverage or retries.
|
|
64
|
+
CI runs root unit and integration suites on Linux and Windows. See [CI documentation](https://github.com/bastani-inc/atomic/blob/main/docs/ci.md) for job details and release procedures.
|
|
115
65
|
|
|
116
|
-
|
|
66
|
+
### Installed package smoke test
|
|
117
67
|
|
|
118
|
-
|
|
68
|
+
After building, run:
|
|
119
69
|
|
|
120
70
|
```bash
|
|
121
|
-
|
|
71
|
+
ATOMIC_REQUIRE_INSTALLED_NODE_SMOKE=1 npx vitest --run --project integration test/integration/installed-package-node-extensions.test.ts
|
|
122
72
|
```
|
|
123
73
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
## Release security boundary
|
|
74
|
+
This checks Node startup and builtin extension loading outside the checkout.
|
|
127
75
|
|
|
128
|
-
Atomic
|
|
76
|
+
Atomic ships an npm shrinkwrap. After dependency changes, regenerate it with `npm run shrinkwrap:coding-agent` and validate with `npm run check`.
|
|
129
77
|
|
|
130
78
|
## Project Structure
|
|
131
79
|
|
|
132
|
-
```
|
|
80
|
+
```text
|
|
133
81
|
packages/
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
82
|
+
ai/ # Atomic's LLM provider fork
|
|
83
|
+
coding-agent/ # CLI, interactive mode, and core runtime
|
|
84
|
+
workflows/ # Workflow execution
|
|
85
|
+
subagents/ # Subagent orchestration
|
|
86
|
+
mcp/ # MCP adapter
|
|
87
|
+
web-access/ # Web search and content extraction
|
|
88
|
+
intercom/ # Cross-session coordination
|
|
140
89
|
```
|
package/docs/extensions.md
CHANGED
|
@@ -248,6 +248,8 @@ export default function (pi: ExtensionAPI) {
|
|
|
248
248
|
|
|
249
249
|
Editable user, project, and package extensions and user workflows are loaded through [jiti](https://github.com/unjs/jiti), so TypeScript works without compilation. `/reload` uses content-hash invalidation across the complete imported file graph: an unchanged graph can reuse its evaluated factory, while a direct edit or a transitive dependency edit re-evaluates that extension's modules.
|
|
250
250
|
|
|
251
|
+
Imports from Atomic's supplied core packages keep the running host's classes and shared state across `/reload`, including on Windows. The supported `@earendil-works/pi-coding-agent` compatibility import shares those exports with `@bastani/atomic`, so class comparisons and `instanceof` checks work across both names after reload. Edits to your extension and its imported local helpers still take effect; restart Atomic after updating Atomic itself.
|
|
252
|
+
|
|
251
253
|
In Bun compiled or bundled single-file builds, Atomic's five fixed installed builtin extension bundles (workflows, subagents, MCP, web access, and Intercom) take a separate startup path. Atomic installs its live host-module bridge, imports each precompiled bundle natively once, and reuses the evaluated factory across `/reload`. This avoids jiti source reads, transforms, hashing, and graph manifests for immutable shipped code. A builtin bundle's module-scoped state is therefore **not** re-evaluated by `/reload` in those builds. This optimization is limited to exact installed entries of identity-verified Atomic packages; editable extensions and workflows retain the dynamic behavior above.
|
|
252
254
|
|
|
253
255
|
If the factory returns a `Promise`, Atomic awaits it before continuing startup. That means async initialization completes before `session_start`, before `resources_discover`, and before provider registrations queued via `pi.registerProvider()` are flushed.
|
|
@@ -2234,6 +2236,8 @@ async execute(_toolCallId, params, _signal, _onUpdate, ctx) {
|
|
|
2234
2236
|
|
|
2235
2237
|
### Tool Definition
|
|
2236
2238
|
|
|
2239
|
+
`parameters` is required, including for no-argument tools (use `Type.Object({})`). Registration rejects missing, null, array, and primitive schema values before they can break a provider request. This checks the schema container, not its JSON Schema `type`: object-valued union and non-object-type schemas remain accepted and unchanged.
|
|
2240
|
+
|
|
2237
2241
|
```typescript
|
|
2238
2242
|
import { Type } from "typebox";
|
|
2239
2243
|
import { StringEnum } from "@bastani/atomic";
|
package/docs/herdr.md
CHANGED
|
@@ -1,55 +1,30 @@
|
|
|
1
1
|
# Herdr
|
|
2
2
|
|
|
3
|
-
Atomic
|
|
3
|
+
Atomic reports its status to [Herdr](https://herdr.dev) automatically when you launch it in a Herdr pane. No extra extension is required. The pane identifies the agent as `atomic`.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Setup
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Use Herdr 0.8.2 or newer and launch Atomic inside it. Herdr supplies the pane connection settings automatically; you do not need to configure them yourself.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|---|---|
|
|
11
|
-
| `HERDR_ENV` | Exactly `1` |
|
|
12
|
-
| `HERDR_BIN_PATH` | Nonempty path to Herdr's executable CLI wrapper |
|
|
13
|
-
| `HERDR_PANE_ID` | Nonempty owning pane ID |
|
|
14
|
-
| `HERDR_SOCKET_PATH` | Nonempty server socket path |
|
|
15
|
-
|
|
16
|
-
The reporter captures these values on activation, not at module import. It runs only when the extension context has `mode: "tui"` and `hasUI: true`. Print, JSON, RPC, no-UI, workflow-stage, and subagent contexts never claim a pane merely because they inherited its environment. Missing prerequisites, disabled reporting, or ineligible contexts create no reporter timer, subprocess, or workflow observation lease.
|
|
17
|
-
|
|
18
|
-
## States and reasons
|
|
19
|
-
|
|
20
|
-
The reporter uses interactive `input`, `agent_start`, `agent_settled`, `ui_prompt_start`, `ui_prompt_end`, live `workflow_lifecycle` events, the owning session's task subscription, and its `observeWorkflowActivity` stream. It does not infer execution from screen text or use `agent_end` as the idle boundary.
|
|
21
|
-
|
|
22
|
-
Quiet work is still work: waiting for a provider response, tool completion, retry backoff, or another automatic continuation does not become `idle` because output stops. Repeated output-cap continuations remain part of the same owning prompt until the entire chain finishes. Reporting is lifecycle-driven, with no inactivity-to-idle timer or heartbeat requirement.
|
|
9
|
+
The integration runs only for interactive Atomic sessions. It stays inactive outside Herdr and in print, JSON, or RPC mode.
|
|
23
10
|
|
|
24
|
-
|
|
25
|
-
|---|---|---|---|
|
|
26
|
-
| Agent executing without an open approval prompt | `working` | `executing` | None unless a workflow needs attention |
|
|
27
|
-
| Owned subagent or shell task queued, running, or cancelling | `working` | `executing` | None unless a workflow needs attention |
|
|
28
|
-
| Workflow execution, automatic continuation, retry, or stop-drain | `working` | Workflow's `executing`, `automatic_continuation`, `retrying`, or `stopping` | `Workflow needs attention` when a root is blocked or needs attention |
|
|
29
|
-
| Approval prompt is the only remaining work, including an agent parked on that prompt | `blocked` | `awaiting_input` | `Waiting for approval` |
|
|
30
|
-
| Workflow waiting for input, an active intervention, or budget approval, with no independent execution | `blocked` | Workflow's `awaiting_input` or `manual_intervention` | `Workflow needs attention` |
|
|
31
|
-
| All observed workflows paused, no agent or prompt work | `idle` | `paused` | None |
|
|
32
|
-
| Settled agent, no prompt, ready workflow source with no work | `idle` | `quiescent` | None |
|
|
33
|
-
| Failed or blocked workflow whose executor has finished, with no pending prompt or budget approval | `idle` | `quiescent` | `Workflow needs attention` |
|
|
34
|
-
| Workflow source `unavailable` or `recovering`, no known contribution | No new report | Unknown | None |
|
|
11
|
+
## Status indicators
|
|
35
12
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
Sending a message acknowledges currently observed workflow blocks for the pane indicator only. The next settled response can return to `idle` instead of repeatedly turning red for the same block; workflow states and budget approvals are not changed. Repeated activity snapshots do not re-arm that attention. A changed workflow activity or a new live block/prompt does, and open approval widgets remain blocking until answered. Extension-generated messages and automatic agent starts do not acknowledge blocks. This acknowledgement is local to the reporter and resets on reload or restart.
|
|
13
|
+
| Status | Meaning |
|
|
14
|
+
|---|---|
|
|
15
|
+
| Working | Atomic, a workflow, a subagent, or a background shell command is still running. |
|
|
16
|
+
| Blocked | Work needs your input or approval, and no independent work is running. |
|
|
17
|
+
| Idle / Done | No work is running. Herdr may show a newly completed turn as Done. |
|
|
43
18
|
|
|
44
|
-
|
|
19
|
+
Quiet periods such as provider waits, retries, and tool execution still count as working. Background work keeps the pane working after Atomic finishes its response.
|
|
45
20
|
|
|
46
|
-
|
|
21
|
+
Opening `/tasks`, `/agents`, or `/workflow connect` does not count as an approval request. Neither does a subagent asking its supervisor for guidance. Actual permission requests and workflow budget approvals can show Blocked.
|
|
47
22
|
|
|
48
|
-
|
|
23
|
+
A failed workflow can remain marked blocked in Atomic after its execution ends, while the pane returns to Idle. Check the workflow details for its result; the pane indicator is not a success or failure verdict. Sending a message acknowledges existing workflow attention for the indicator, but does not resume the workflow or approve a budget increase.
|
|
49
24
|
|
|
50
|
-
##
|
|
25
|
+
## Disable the integration
|
|
51
26
|
|
|
52
|
-
|
|
27
|
+
Add this to `~/.atomic/agent/settings.json` or trusted project `.atomic/settings.json`, then reload or restart Atomic:
|
|
53
28
|
|
|
54
29
|
```json
|
|
55
30
|
{
|
|
@@ -59,48 +34,20 @@ Set this in global `~/.atomic/agent/settings.json` or trusted project `.atomic/s
|
|
|
59
34
|
}
|
|
60
35
|
```
|
|
61
36
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
## Reporter conflicts
|
|
65
|
-
|
|
66
|
-
If the actually loaded extension paths contain `herdr-atomic-reporter` or the legacy Pi `herdr-agent-state`, the built-in reporter defers without claiming or observing. One `unsupported` diagnostic names the loaded reporter path. Merely having such a package on disk does not cause deferral. The selected community or legacy reporter determines workflow coverage in that mode; Atomic's built-in aggregation is inactive.
|
|
67
|
-
|
|
68
|
-
## Ownership, delivery, and privacy
|
|
69
|
-
|
|
70
|
-
One module-owned lease reports each pane. A successor fences and drains the predecessor before reporting, without sending `release-agent`. Sequence numbers use a clock seed and a process-level high-water mark, increasing across extension reloads, runner replacement, and clock rollback within that process. Genuine quit drains the current child and releases authority with a fresh sequence strictly greater than the last report sequence. Late predecessor callbacks cannot report or release a successor.
|
|
71
|
-
|
|
72
|
-
Each reporter instance binds to an eligible session's `SessionManager` and its active extension runner before awaiting pane acquisition. Other sessions sharing the loaded instance cannot change its activity, prompts, or lifecycle. In particular, a child quitting cannot release the parent's pane or cancel its pending claim. A transactional reload starts a candidate runner with the same `SessionManager` before retiring the old runner. The candidate takes over the binding and remains the active runner after commit; old shutdown, activity, approval, and repeated start events cannot release or reclaim that binding. The owning runner's shutdown clears the binding before awaiting transport cleanup, allowing a subsequent eligible session to reuse the same already-loaded resource loader. The successor reserves its binding immediately but waits for predecessor retirement before reporting its own identity; neither delayed predecessor events nor completion of the old shutdown can clear the new binding.
|
|
73
|
-
|
|
74
|
-
Candidate reporting stays staged until transactional preparation and provider publication succeed. A rejected reload leaves the live runner's pane claim, approval count, and workflow observation intact, so continued work and genuine quit still report normally. Rejected candidate callbacks cannot take ownership. After commit, the candidate claims the pane before the old runner's shutdown and before queued extension side effects run.
|
|
75
|
-
|
|
76
|
-
Normal compaction retains the same session and reporter; subsequent work continues reporting without reclaiming authority. Resource reload and in-process session replacement preserve the existing Herdr registration and last reported state while workflow activity is recovering or unavailable. They do not unregister the running agent or invent an idle snapshot, so another prompt is not needed to keep the agent visible. Ready activity resumes normal reporting. Genuine quit releases the inherited registration even if the successor has not sent a report. A non-quit shutdown can restart the same runner if no successor has taken over; late callbacks from superseded runners remain fenced.
|
|
77
|
-
|
|
78
|
-
The reporter invokes the CLI directly with an argument array, not a shell. It permits one child per pane at a time, keeps only the newest pending state, and uses a five-second timeout plus bounded output buffering. Transport errors produce bounded `spawn_failed`, `timeout`, or `protocol_rejected` diagnostics; obsolete ownership uses `stale_owner`. Errors do not become agent or workflow failures. Child stdout and stderr are never logged raw.
|
|
79
|
-
|
|
80
|
-
Only the fixed messages in the table are sent. Prompt titles, tool arguments, provider error bodies, transcripts, and workflow outputs are not forwarded. The parent's session ID and, when available, native absolute session path accompany reports until the first successful CLI delivery per claim, using `--agent-session-id` and `--agent-session-path`. Later reports in that claim omit these flags. This is not a once-per-claim attempt: after a transport failure, later activity retries that identity; no retry timer is added. Child sessions do not replace that identity.
|
|
37
|
+
Reporting is enabled by default. Project settings follow the normal [settings precedence](/settings).
|
|
81
38
|
|
|
82
|
-
##
|
|
39
|
+
## Troubleshooting
|
|
83
40
|
|
|
84
|
-
|
|
41
|
+
If Atomic does not appear in Herdr:
|
|
85
42
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
| Equal or older `--seq` | Exit 0, silently ignored by the server. The CLI never reports a rejected stale sequence. | Each report uses `max(clock ms, previous + 1)`, tracked in a process-level high-water mark; ordering is enforced by Atomic rather than inferred from exit codes. |
|
|
90
|
-
| Sequence high-water mark after release | Survives `release-agent`. A later report with a lower sequence, even from a new owner, is ignored. | New processes seed from the clock. Ordering across a process restart with a rolled-back clock, or against another reporter's higher sequence, is not promised. |
|
|
91
|
-
| `release-agent` without `--seq` | Exit 0, no change. Release by a non-owner source is also ignored. | Release always carries a fresh sequence strictly greater than the last report sequence. Ownership checks prevent late predecessor releases from retiring a successor. |
|
|
92
|
-
| `idle` after `working` | Surfaced as `agent_status: done`; `idle` on a fresh pane surfaces as `idle`. | Atomic reports `idle`. Consumers reading pane state must accept `idle` or `done` for the idle state. |
|
|
93
|
-
| `--message` | Accepted, but not surfaced by `agent get` (`message: null`). | Only the fixed messages `Waiting for approval` and `Workflow needs attention` are sent. |
|
|
94
|
-
| Session identity for custom sources | `--agent-session-id`, `--agent-session-path`, and `report-agent-session` are accepted, but `agent_session` stays `null`. | The parent session identity is reported once per claim as the documented contract. Retention and automatic restoration are not observable on 0.8.2. |
|
|
95
|
-
| Missing or invalid environment | Not applicable: nothing is invoked. | If `HERDR_ENV` is not exactly `1`, or any of `HERDR_BIN_PATH`, `HERDR_PANE_ID`, `HERDR_SOCKET_PATH` is empty, the reporter never activates and allocates no timer, subprocess, or observation lease. |
|
|
96
|
-
| Server not running | Exit 1 immediately with `server_not_running`; no hang. | The report is dropped with one bounded `protocol_rejected` diagnostic. A hung binary is killed after five seconds and reported as `timeout`. |
|
|
97
|
-
| Older Herdr CLI | Not tested. Commands or flags used here may be rejected. | Rejections surface as bounded `protocol_rejected` or `spawn_failed` diagnostics. They never become agent or workflow failures, and no report is retried until later activity. Older releases are not claimed as compatible. |
|
|
43
|
+
- Make sure you launched Atomic inside a Herdr pane, rather than in a separate terminal.
|
|
44
|
+
- Check that Herdr is running and reporting has not been disabled in Atomic's settings.
|
|
45
|
+
- Check for a loaded `herdr-atomic-reporter` or legacy Pi `herdr-agent-state` extension. Atomic defers to these reporters to avoid conflicts; disable the extra extension and reload to use the built-in integration.
|
|
98
46
|
|
|
99
|
-
|
|
47
|
+
For custom launchers, Herdr must provide `HERDR_ENV=1` and nonempty `HERDR_BIN_PATH`, `HERDR_PANE_ID`, and `HERDR_SOCKET_PATH` values. See [Herdr's integration guide](https://herdr.dev/docs/integrations/#integrate-your-own-agent).
|
|
100
48
|
|
|
101
|
-
|
|
102
|
-
- Interactive project-trust decisions also use the prompt lifecycle, including startup/resume and `/trust`; silent saved-policy decisions do not create a block.
|
|
49
|
+
Reloading or compacting a session should not remove Atomic from the pane. If status stops updating, check Herdr's connection and reload Atomic. Reporting failures do not stop your agent or workflow, and reconnect polling is not automatic.
|
|
103
50
|
|
|
104
|
-
|
|
51
|
+
## Privacy
|
|
105
52
|
|
|
106
|
-
|
|
53
|
+
Atomic sends status, generic attention messages, and the parent session's ID and local session path to the local Herdr server. It does not send prompt text, tool arguments, transcripts, or workflow output. Session reporting alone does not guarantee automatic session restoration in Herdr.
|
package/docs/intercom.md
CHANGED
|
@@ -448,6 +448,10 @@ Config validation is strict: every field is checked, and if the file is not vali
|
|
|
448
448
|
|
|
449
449
|
Intercom publishes live session status automatically: sessions register as `idle`, switch to `thinking` while the agent is running, show `tool:<name>` during tool execution, and return to `idle` on completion. A configured `status` is appended as context instead of replacing the lifecycle status.
|
|
450
450
|
|
|
451
|
+
Activity is not reply capability. Session rows include `replyCapability: live` or `terminal` when the host supplies it; terminal noninteractive children cannot answer asks even if activity says `idle`. Closed workflow generations show `closed · reply: post-mortem only` when a late-message router is present, or `closed · reply: unavailable` without one. Post-mortem routing still validates the retained conversation and can return a bounded error if it is unavailable; it never resumes workflow execution. Missing capability metadata is not a guarantee that an ask can succeed. Invocation/subgroup visibility and stale-ID rejection are unchanged.
|
|
452
|
+
|
|
453
|
+
For a retained post-mortem conversation, use its exact Intercom session ID or the previously listed canonical stage path, including its final-stage-name variant. Alternate materialized run-ID paths resolve active stages through the workflow owner; they are not retained aliases after the stage completes. A stage marked `reply: unavailable` rejects an ask with guidance to contact a live stage or start new work with explicit context.
|
|
454
|
+
|
|
451
455
|
## Keyboard Shortcuts
|
|
452
456
|
|
|
453
457
|
| Key | Action |
|
package/docs/models/evals.md
CHANGED
|
@@ -22,6 +22,8 @@ No single benchmark is the source of truth. Validate these inputs against Atomic
|
|
|
22
22
|
|
|
23
23
|
Start here when a stage needs a model. Each row names a relevant benchmark and selected candidates, not a universal winner or a guarantee that the cheaper option stays close. "Measured" means the exact configuration named; a different effort level or agent is a different experiment.
|
|
24
24
|
|
|
25
|
+
Practical workflow default: use `low` or `medium` for coding, and `high` or `xhigh` for code review, test design and failure analysis, where the configured model supports those levels. Run actual tests as tool calls, not model judgments. `max` is usually overkill and is not preferred in practice. These are starting recommendations, not conclusions that every benchmark proves; the rows below preserve the exact measured settings. See [role-based thinking effort](/models/model-selection#role-based-thinking-effort).
|
|
26
|
+
|
|
25
27
|
| Task type | Benchmark to read | Selected measured candidates | Cost-conscious alternative |
|
|
26
28
|
| --- | --- | --- | --- |
|
|
27
29
|
| Implementing features and fixing bugs | September 3 Datacurve DeepSWE | Astra xhigh, Gemini 3.8 Flash high and Opus 5 max display 74% | Luna max 67% / $0.61; GLM-5.3-Flash max 63% / $0.24 |
|
|
@@ -29,6 +29,8 @@ If live results cannot be retrieved, use the dated docs snapshot and say it was
|
|
|
29
29
|
|
|
30
30
|
The thinking level in brackets in the chart is the **measurement configuration used for that benchmark result**, not a universal workflow default. A score measured at `max` does not mean every stage using that model should use `max`; benchmark model identity and production thinking effort are separate choices. When authoring a workflow, choose effort from the stage role and cost of being wrong, then check the returned `availableThinkingLevels` for the configured catalog model.
|
|
31
31
|
|
|
32
|
+
Practical default: use `low` or `medium` for coding, and `high` or `xhigh` for code review, test design and failure analysis, subject to catalog support. Run actual tests as tool calls. `max` is usually overkill and is not preferred in practice. These are starting recommendations to validate on your workflow, not a claim that lower effort reproduces the benchmark scores below.
|
|
33
|
+
|
|
32
34
|
## Pin model identity
|
|
33
35
|
|
|
34
36
|
When a workflow needs an exact model, call `workflow({ action: "models" })` and pin a returned `fullId`. Do not pin a
|
|
@@ -112,25 +114,26 @@ Use this table when the user has not requested a thinking level. It is a product
|
|
|
112
114
|
|
|
113
115
|
| Stage role | Default thinking level | Why |
|
|
114
116
|
| --- | --- | --- |
|
|
115
|
-
|
|
|
116
|
-
|
|
|
117
|
+
| Coding, implementation, routine fixes | `low` or `medium` | Keep implementation fast; use review and tests to catch defects. |
|
|
118
|
+
| Code review, test design, failure analysis, security, identity, adversarial challenge, final approval | `high` or `xhigh` | Spend more reasoning on finding defects, probing edge cases and judging evidence. |
|
|
119
|
+
| Codebase mapping, lifecycle analysis, compatibility, planning, synthesis, triage | `high` | These stages must resolve demanding uncertainty and preserve evidence across handoffs; routine synthesis may use `medium` when evidence quality holds. |
|
|
117
120
|
| User-impact review and final reporting | `medium` | Clear evidence-backed summaries usually do not need the deepest reasoning. |
|
|
118
121
|
| Deterministic checks | No model call | Run typechecks, tests, schema checks, runtime probes, and artifact checks as durable tool nodes. |
|
|
119
122
|
|
|
120
|
-
|
|
123
|
+
`max` is an exception, not a role default. Consider it only when task-specific evidence justifies the extra effort or the user explicitly requests it. An explicit request wins over these defaults, but the requested level still must appear in the configured catalog; do not invent an unsupported suffix. For each primary and fallback, choose a supported level for the same stage role independently. If `xhigh` is unavailable, use `high` rather than automatically promoting to `max`; choose another catalog model or leave the stage unpinned if neither is supported.
|
|
121
124
|
|
|
122
125
|
## Scenario-based guidance
|
|
123
126
|
|
|
124
127
|
Pick by the cost of being wrong in each role, not by raw accuracy. The AA evidence below was read on 2026-09-08; the Datacurve evidence remains the September 3 snapshot. See [Evals](/models/evals) for measurement settings, normalized Elo versus pass-rate units and source links.
|
|
125
128
|
|
|
126
|
-
- **Reviewer / judgment gates.** Use `
|
|
129
|
+
- **Reviewer / judgment gates.** Use `high` or `xhigh` for code review and approval decisions, subject to the configured model's supported efforts. No external benchmark here establishes security-review reliability. Claude Code + Fable 5.1 max with fallback and Claude Code + Opus 5 xhigh score 56% and 55% on SWE-Atlas-QnA, versus 51% for Codex + Astra max, but those harness-specific results need validation in Atomic.
|
|
127
130
|
- **Codebase mapping / planner.** Start at `high`. For knowledge-work deliverables, Fable 5.1 max with fallback scores 58% normalized Elo on AA-Briefcase, Opus 5 max 57%, and GLM-5.3-Flash 48% at $0.25 per Index task. These are candidates, not measured repository-planning pass rates. Raise effort only for the role's cost of error or the user's request.
|
|
128
|
-
- **Debugger / triage / repair.**
|
|
131
|
+
- **Debugger / triage / repair.** Use `high` or `xhigh` for failure analysis and test design, then `low` or `medium` to implement a diagnosed fix. The new Terminal-Bench v4.0 is no longer flat near 90%: Astra xhigh scores 60%, Fable 5.1 xhigh with fallback 55%, Opus 5 max 49%, and Gemini 3.8 Flash high 20%. Keep Datacurve cost and steps as separate evidence; do not transfer its 74% Gemini result into this benchmark.
|
|
129
132
|
- **Research / synthesis.** Use `high` for demanding reconciliation and `medium` for routine synthesis. Luna max scores 84% on AA-LCR at $0.18 per Index task, but its 7% non-hallucination rate counts partial answers or not attempted among non-correct responses, not all answers. Verify factual claims. Astra xhigh leads the displayed GDP.pdf rows at 32%; GLM-5.3-Flash and GLM-5.3 max score 72% and 70% non-hallucination.
|
|
130
133
|
- **Orchestrator / worker / cheap loops.** Use AutomationBench-AA for SaaS tool workflows: Astra max 68%, GLM-5.3-Flash 60%, Luna max 50%. GLM-5.3-Flash and Luna remain budget candidates on the separately dated Datacurve frontier. Gemini 3.8 Flash's 166 steps and 143k output tokens in that snapshot argue against choosing workers on pass rate alone. Validate the tradeoff on the actual workflow.
|
|
131
|
-
- **User-impact review / final reporting
|
|
134
|
+
- **User-impact review / final reporting.** Use `medium` for impact summaries and reports that preserve the evidence needed by the user. If the stage makes an approval decision, use the reviewer guidance instead.
|
|
132
135
|
- **Design** — a quality-first domain not directly measured by these coding tables. Choose effort by the review or approval role. Fable 5.1's AA-Briefcase results make it a candidate for knowledge-work deliverables, not proof of product-design quality; evaluate it on the intended design tasks and do not carry Fable 5's DeepSWE row over to it.
|
|
133
|
-
- **Interactive coding sessions
|
|
136
|
+
- **Interactive coding sessions.** Use `low` or `medium` for implementation, switching to `high` or `xhigh` for code review, test design and failure analysis. Choose only levels supported by the configured model.
|
|
134
137
|
- **Deterministic checks** — make typechecks, tests, schema validation, runtime probes, and artifact inspection tool nodes with no model call. Model self-report is not verification evidence.
|
|
135
138
|
|
|
136
139
|
## Related
|
package/docs/settings.md
CHANGED
|
@@ -223,10 +223,13 @@ The model emits numbered line ranges only; Atomic reconstructs retained text mec
|
|
|
223
223
|
| `retry.enabled` | boolean | `true` | Enable automatic agent-level retry on transient errors |
|
|
224
224
|
| `retry.maxRetries` | number | `3` | Maximum agent-level retry attempts |
|
|
225
225
|
| `retry.baseDelayMs` | number | `2000` | Base delay for agent-level exponential backoff (2s, 4s, 8s) |
|
|
226
|
+
| `retry.maxAgentDelayMs` | number | `60000` | Maximum agent-level backoff delay (60s); `0` retries immediately |
|
|
226
227
|
| `retry.provider.timeoutMs` | number | SDK default | Provider/SDK request timeout in milliseconds |
|
|
227
228
|
| `retry.provider.maxRetries` | number | `0` | Provider/SDK retry attempts. Leave unset/`0` to let Atomic's agent-level retry handle transient failures |
|
|
228
229
|
| `retry.provider.maxRetryDelayMs` | number | `60000` | Max server-requested delay before failing (60s) |
|
|
229
230
|
|
|
231
|
+
Agent-level retries use exponential backoff capped by `retry.maxAgentDelayMs`, including the shared main-chat and workflow retry policy and summary calls. This is independent of provider retry limits. Legacy `retry.maxDelayMs` still migrates to `retry.provider.maxRetryDelayMs`, not the agent cap.
|
|
232
|
+
|
|
230
233
|
When a provider requests a retry delay longer than `retry.provider.maxRetryDelayMs` (e.g., Google's "quota will reset after 5h"), the request fails immediately with an informative error instead of waiting silently. Set to `0` to disable the cap.
|
|
231
234
|
|
|
232
235
|
`retry.provider.maxRetries` follows upstream Pi's behavior and defaults to `0` SDK/provider retries. Atomic still performs agent-level retries via `retry.maxRetries`; set `retry.provider.maxRetries` explicitly only when you want the underlying provider SDK to retry before Atomic observes the failure.
|
|
@@ -237,6 +240,7 @@ When a provider requests a retry delay longer than `retry.provider.maxRetryDelay
|
|
|
237
240
|
"enabled": true,
|
|
238
241
|
"maxRetries": 3,
|
|
239
242
|
"baseDelayMs": 2000,
|
|
243
|
+
"maxAgentDelayMs": 60000,
|
|
240
244
|
"provider": {
|
|
241
245
|
"timeoutMs": 3600000,
|
|
242
246
|
"maxRetries": 0,
|