@bastani/atomic 0.9.16-alpha.4 → 0.9.16-alpha.5
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 +55 -0
- package/README.md +11 -6
- package/dist/builtin/intercom/CHANGELOG.md +15 -0
- package/dist/builtin/intercom/README.md +6 -4
- package/dist/builtin/intercom/broker/broker.ts +34 -8
- package/dist/builtin/intercom/broker/client.ts +13 -0
- package/dist/builtin/intercom/broker/pending-question-index.ts +50 -0
- package/dist/builtin/intercom/broker/send-handler.ts +8 -0
- package/dist/builtin/intercom/index.bundle.mjs +2041 -1210
- package/dist/builtin/intercom/package.json +2 -2
- package/dist/builtin/intercom/skills/intercom/SKILL.md +20 -19
- package/dist/builtin/mcp/index.bundle.mjs +1774 -1025
- package/dist/builtin/mcp/package.json +2 -2
- package/dist/builtin/subagents/CHANGELOG.md +11 -0
- package/dist/builtin/subagents/README.md +3 -3
- package/dist/builtin/subagents/package.json +3 -3
- package/dist/builtin/subagents/skills/subagent/SKILL.md +4 -4
- package/dist/builtin/subagents/src/extension/index.bundle.mjs +2641 -1505
- package/dist/builtin/web-access/index.bundle.mjs +1750 -1001
- package/dist/builtin/web-access/package.json +2 -2
- package/dist/builtin/workflows/CHANGELOG.md +20 -0
- package/dist/builtin/workflows/README.md +1 -1
- package/dist/builtin/workflows/builtin/goal-ledger.ts +54 -10
- package/dist/builtin/workflows/builtin/goal-runner.ts +57 -12
- package/dist/builtin/workflows/package.json +2 -2
- package/dist/builtin/workflows/src/extension/index.bundle.mjs +13603 -12021
- package/dist/builtin/workflows/src/index.bundle.mjs +2331 -1277
- package/dist/bun/split-loader.js +2 -1
- package/dist/bun/split-loader.js.map +1 -1
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +6 -1
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/file-processor.d.ts.map +1 -1
- package/dist/cli/file-processor.js +2 -1
- package/dist/cli/file-processor.js.map +1 -1
- package/dist/config-package-identity.d.ts.map +1 -1
- package/dist/config-package-identity.js +2 -1
- package/dist/config-package-identity.js.map +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +2 -1
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session-auto-compaction.d.ts.map +1 -1
- package/dist/core/agent-session-auto-compaction.js +64 -28
- package/dist/core/agent-session-auto-compaction.js.map +1 -1
- package/dist/core/agent-session-compaction.d.ts +2 -0
- package/dist/core/agent-session-compaction.d.ts.map +1 -1
- package/dist/core/agent-session-compaction.js +25 -5
- package/dist/core/agent-session-compaction.js.map +1 -1
- package/dist/core/agent-session-custom-message-commit.d.ts.map +1 -1
- package/dist/core/agent-session-custom-message-commit.js +12 -0
- package/dist/core/agent-session-custom-message-commit.js.map +1 -1
- package/dist/core/agent-session-events.d.ts.map +1 -1
- package/dist/core/agent-session-events.js +2 -0
- package/dist/core/agent-session-events.js.map +1 -1
- package/dist/core/agent-session-export.d.ts +3 -1
- package/dist/core/agent-session-export.d.ts.map +1 -1
- package/dist/core/agent-session-export.js +22 -2
- package/dist/core/agent-session-export.js.map +1 -1
- package/dist/core/agent-session-message-queue.d.ts +3 -0
- package/dist/core/agent-session-message-queue.d.ts.map +1 -1
- package/dist/core/agent-session-message-queue.js +10 -0
- package/dist/core/agent-session-message-queue.js.map +1 -1
- package/dist/core/agent-session-methods.d.ts +15 -9
- 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-models.d.ts +8 -13
- package/dist/core/agent-session-models.d.ts.map +1 -1
- package/dist/core/agent-session-models.js +53 -19
- package/dist/core/agent-session-models.js.map +1 -1
- package/dist/core/agent-session-post-tool-compaction.d.ts.map +1 -1
- package/dist/core/agent-session-post-tool-compaction.js +12 -0
- package/dist/core/agent-session-post-tool-compaction.js.map +1 -1
- package/dist/core/agent-session-prompt.d.ts.map +1 -1
- package/dist/core/agent-session-prompt.js +3 -1
- package/dist/core/agent-session-prompt.js.map +1 -1
- package/dist/core/agent-session-tool-registry.js +3 -3
- package/dist/core/agent-session-tool-registry.js.map +1 -1
- package/dist/core/agent-session-transfer.d.ts.map +1 -1
- package/dist/core/agent-session-transfer.js +1 -0
- package/dist/core/agent-session-transfer.js.map +1 -1
- package/dist/core/agent-session-tree.d.ts.map +1 -1
- package/dist/core/agent-session-tree.js +1 -1
- package/dist/core/agent-session-tree.js.map +1 -1
- package/dist/core/agent-session-types.d.ts +3 -0
- package/dist/core/agent-session-types.d.ts.map +1 -1
- package/dist/core/agent-session-types.js.map +1 -1
- package/dist/core/agent-session.d.ts +2 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +2 -0
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-storage-backends.d.ts.map +1 -1
- package/dist/core/auth-storage-backends.js +10 -6
- package/dist/core/auth-storage-backends.js.map +1 -1
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +4 -3
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/builtin-packages.d.ts.map +1 -1
- package/dist/core/builtin-packages.js +2 -1
- package/dist/core/builtin-packages.js.map +1 -1
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +6 -0
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction-runner.d.ts +3 -1
- package/dist/core/compaction/compaction-runner.d.ts.map +1 -1
- package/dist/core/compaction/compaction-runner.js +30 -4
- package/dist/core/compaction/compaction-runner.js.map +1 -1
- package/dist/core/compaction/compaction-types.d.ts +3 -1
- package/dist/core/compaction/compaction-types.d.ts.map +1 -1
- package/dist/core/compaction/compaction-types.js.map +1 -1
- package/dist/core/compaction/range-planner.d.ts +3 -1
- package/dist/core/compaction/range-planner.d.ts.map +1 -1
- package/dist/core/compaction/range-planner.js +11 -1
- package/dist/core/compaction/range-planner.js.map +1 -1
- package/dist/core/compaction/session-summarization.d.ts.map +1 -1
- package/dist/core/compaction/session-summarization.js +6 -0
- package/dist/core/compaction/session-summarization.js.map +1 -1
- package/dist/core/extensions/api-types.d.ts +8 -3
- package/dist/core/extensions/api-types.d.ts.map +1 -1
- package/dist/core/extensions/api-types.js.map +1 -1
- package/dist/core/extensions/index.d.ts +2 -2
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/loader-api.d.ts +5 -1
- package/dist/core/extensions/loader-api.d.ts.map +1 -1
- package/dist/core/extensions/loader-api.js +124 -36
- package/dist/core/extensions/loader-api.js.map +1 -1
- package/dist/core/extensions/loader-core.d.ts.map +1 -1
- package/dist/core/extensions/loader-core.js +18 -4
- package/dist/core/extensions/loader-core.js.map +1 -1
- package/dist/core/extensions/loader-runtime.d.ts.map +1 -1
- package/dist/core/extensions/loader-runtime.js +10 -2
- package/dist/core/extensions/loader-runtime.js.map +1 -1
- package/dist/core/extensions/session-events.d.ts +11 -2
- package/dist/core/extensions/session-events.d.ts.map +1 -1
- package/dist/core/extensions/session-events.js.map +1 -1
- package/dist/core/extensions/tool-events.d.ts +13 -3
- package/dist/core/extensions/tool-events.d.ts.map +1 -1
- package/dist/core/extensions/tool-events.js +3 -0
- package/dist/core/extensions/tool-events.js.map +1 -1
- package/dist/core/extensions/types.d.ts +1 -1
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/extensions/ui-types.d.ts +2 -2
- package/dist/core/extensions/ui-types.js.map +1 -1
- package/dist/core/footer-data-provider.d.ts +1 -1
- package/dist/core/footer-data-provider.js +1 -1
- package/dist/core/footer-data-provider.js.map +1 -1
- package/dist/core/keybindings.d.ts +17 -16
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +23 -6
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-config.js +2 -1
- package/dist/core/model-config.js.map +1 -1
- package/dist/core/model-resolver-initial.d.ts +1 -0
- package/dist/core/model-resolver-initial.d.ts.map +1 -1
- package/dist/core/model-resolver-initial.js +9 -5
- package/dist/core/model-resolver-initial.js.map +1 -1
- package/dist/core/models-store.d.ts.map +1 -1
- package/dist/core/models-store.js +2 -1
- package/dist/core/models-store.js.map +1 -1
- package/dist/core/package-manager-git.d.ts.map +1 -1
- package/dist/core/package-manager-git.js +2 -1
- package/dist/core/package-manager-git.js.map +1 -1
- package/dist/core/package-manager-manifest.d.ts.map +1 -1
- package/dist/core/package-manager-manifest.js +2 -1
- package/dist/core/package-manager-manifest.js.map +1 -1
- package/dist/core/package-manager-npm.d.ts.map +1 -1
- package/dist/core/package-manager-npm.js +4 -3
- package/dist/core/package-manager-npm.js.map +1 -1
- package/dist/core/package-manager-operations.d.ts.map +1 -1
- package/dist/core/package-manager-operations.js +2 -1
- package/dist/core/package-manager-operations.js.map +1 -1
- package/dist/core/package-manager-resource-collector.d.ts.map +1 -1
- package/dist/core/package-manager-resource-collector.js +2 -1
- package/dist/core/package-manager-resource-collector.js.map +1 -1
- package/dist/core/package-manager-resource-files.d.ts.map +1 -1
- package/dist/core/package-manager-resource-files.js +7 -2
- package/dist/core/package-manager-resource-files.js.map +1 -1
- package/dist/core/remote-catalog-provider.d.ts.map +1 -1
- package/dist/core/remote-catalog-provider.js +2 -1
- package/dist/core/remote-catalog-provider.js.map +1 -1
- package/dist/core/resource-loader-context-files.d.ts.map +1 -1
- package/dist/core/resource-loader-context-files.js +3 -2
- package/dist/core/resource-loader-context-files.js.map +1 -1
- package/dist/core/sdk-exports.d.ts +5 -3
- package/dist/core/sdk-exports.d.ts.map +1 -1
- package/dist/core/sdk-exports.js +4 -2
- package/dist/core/sdk-exports.js.map +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +7 -3
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-manager-core.d.ts +2 -2
- package/dist/core/session-manager-core.d.ts.map +1 -1
- package/dist/core/session-manager-core.js +4 -4
- package/dist/core/session-manager-core.js.map +1 -1
- package/dist/core/session-manager-entries.d.ts +2 -2
- package/dist/core/session-manager-entries.d.ts.map +1 -1
- package/dist/core/session-manager-entries.js +4 -3
- package/dist/core/session-manager-entries.js.map +1 -1
- package/dist/core/session-manager-storage.d.ts.map +1 -1
- package/dist/core/session-manager-storage.js +4 -2
- package/dist/core/session-manager-storage.js.map +1 -1
- package/dist/core/session-manager-types.d.ts +2 -0
- package/dist/core/session-manager-types.d.ts.map +1 -1
- package/dist/core/session-manager-types.js.map +1 -1
- package/dist/core/settings-diagnostics.d.ts +4 -0
- package/dist/core/settings-diagnostics.d.ts.map +1 -0
- package/dist/core/settings-diagnostics.js +12 -0
- package/dist/core/settings-diagnostics.js.map +1 -0
- package/dist/core/settings-manager-basic-accessors.d.ts +4 -0
- package/dist/core/settings-manager-basic-accessors.d.ts.map +1 -1
- package/dist/core/settings-manager-basic-accessors.js +23 -0
- package/dist/core/settings-manager-basic-accessors.js.map +1 -1
- package/dist/core/settings-manager-core.d.ts.map +1 -1
- package/dist/core/settings-manager-core.js +10 -2
- package/dist/core/settings-manager-core.js.map +1 -1
- package/dist/core/settings-storage.d.ts.map +1 -1
- package/dist/core/settings-storage.js +10 -3
- package/dist/core/settings-storage.js.map +1 -1
- package/dist/core/settings-types.d.ts +2 -0
- package/dist/core/settings-types.d.ts.map +1 -1
- package/dist/core/settings-types.js.map +1 -1
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +51 -33
- package/dist/core/skills.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +3 -2
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +11 -2
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tools/ask-user-question/config.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/config.js +2 -1
- package/dist/core/tools/ask-user-question/config.js.map +1 -1
- package/dist/core/tools/bash.d.ts +13 -1
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +9 -5
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/index.d.ts +21 -5
- package/dist/core/tools/index.d.ts.map +1 -1
- package/dist/core/tools/index.js +45 -13
- package/dist/core/tools/index.js.map +1 -1
- package/dist/core/tools/powershell.d.ts +83 -0
- package/dist/core/tools/powershell.d.ts.map +1 -0
- package/dist/core/tools/powershell.js +89 -0
- package/dist/core/tools/powershell.js.map +1 -0
- package/dist/core/usage-totals.d.ts.map +1 -1
- package/dist/core/usage-totals.js +2 -1
- package/dist/core/usage-totals.js.map +1 -1
- package/dist/extensions/llama/client.d.ts +6 -0
- package/dist/extensions/llama/client.d.ts.map +1 -1
- package/dist/extensions/llama/client.js +12 -0
- package/dist/extensions/llama/client.js.map +1 -1
- package/dist/extensions/llama/index.d.ts.map +1 -1
- package/dist/extensions/llama/index.js +2 -0
- package/dist/extensions/llama/index.js.map +1 -1
- package/dist/extensions/llama/provider.d.ts +3 -1
- package/dist/extensions/llama/provider.d.ts.map +1 -1
- package/dist/extensions/llama/provider.js +25 -8
- package/dist/extensions/llama/provider.js.map +1 -1
- package/dist/index-extensions.d.ts +2 -2
- package/dist/index-extensions.d.ts.map +1 -1
- package/dist/index-extensions.js +1 -1
- package/dist/index-extensions.js.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/main-stdio.d.ts.map +1 -1
- package/dist/main-stdio.js +4 -2
- package/dist/main-stdio.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +10 -3
- package/dist/main.js.map +1 -1
- package/dist/migrations-config-values.d.ts.map +1 -1
- package/dist/migrations-config-values.js +2 -1
- package/dist/migrations-config-values.js.map +1 -1
- package/dist/migrations.d.ts.map +1 -1
- package/dist/migrations.js +5 -4
- package/dist/migrations.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +2 -1
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts +2 -2
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +27 -16
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector-items.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector-items.js +67 -14
- package/dist/modes/interactive/components/settings-selector-items.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector-submenus.d.ts +7 -1
- package/dist/modes/interactive/components/settings-selector-submenus.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector-submenus.js +38 -3
- package/dist/modes/interactive/components/settings-selector-submenus.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector-types.d.ts +5 -1
- package/dist/modes/interactive/components/settings-selector-types.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector-types.js.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.d.ts +15 -6
- package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.js +65 -27
- package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
- package/dist/modes/interactive/external-editor.d.ts.map +1 -1
- package/dist/modes/interactive/external-editor.js +2 -1
- package/dist/modes/interactive/external-editor.js.map +1 -1
- package/dist/modes/interactive/interactive-agent-events.js +2 -0
- package/dist/modes/interactive/interactive-agent-events.js.map +1 -1
- package/dist/modes/interactive/interactive-auth-login.d.ts +1 -1
- package/dist/modes/interactive/interactive-auth-login.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-auth-login.js +9 -1
- package/dist/modes/interactive/interactive-auth-login.js.map +1 -1
- package/dist/modes/interactive/interactive-autocomplete.js +9 -0
- package/dist/modes/interactive/interactive-autocomplete.js.map +1 -1
- package/dist/modes/interactive/interactive-deferred-startup.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-deferred-startup.js +2 -0
- package/dist/modes/interactive/interactive-deferred-startup.js.map +1 -1
- package/dist/modes/interactive/interactive-editor-actions.js +11 -10
- package/dist/modes/interactive/interactive-editor-actions.js.map +1 -1
- package/dist/modes/interactive/interactive-input-handling.js +6 -0
- package/dist/modes/interactive/interactive-input-handling.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-deps.d.ts +1 -0
- package/dist/modes/interactive/interactive-mode-deps.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-deps.js +1 -0
- package/dist/modes/interactive/interactive-mode-deps.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-surface.d.ts +7 -0
- package/dist/modes/interactive/interactive-mode-surface.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-surface.js +0 -1
- package/dist/modes/interactive/interactive-mode-surface.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-types.d.ts +3 -0
- package/dist/modes/interactive/interactive-mode-types.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-types.js.map +1 -1
- package/dist/modes/interactive/interactive-model-routing.d.ts +16 -1
- package/dist/modes/interactive/interactive-model-routing.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-model-routing.js +62 -3
- package/dist/modes/interactive/interactive-model-routing.js.map +1 -1
- package/dist/modes/interactive/interactive-render-chat.js +18 -0
- package/dist/modes/interactive/interactive-render-chat.js.map +1 -1
- package/dist/modes/interactive/interactive-selectors.js +10 -8
- package/dist/modes/interactive/interactive-selectors.js.map +1 -1
- package/dist/modes/interactive/interactive-slash-commands.js +6 -5
- package/dist/modes/interactive/interactive-slash-commands.js.map +1 -1
- package/dist/modes/interactive/interactive-startup.js +9 -1
- package/dist/modes/interactive/interactive-startup.js.map +1 -1
- package/dist/modes/interactive/theme/theme-parse.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme-parse.js +2 -1
- package/dist/modes/interactive/theme/theme-parse.js.map +1 -1
- package/dist/modes/json-event.d.ts +15 -18
- package/dist/modes/json-event.d.ts.map +1 -1
- package/dist/modes/json-event.js +21 -17
- package/dist/modes/json-event.js.map +1 -1
- package/dist/modes/rpc/rpc-client-api.d.ts +4 -0
- package/dist/modes/rpc/rpc-client-api.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client-api.js +3 -0
- package/dist/modes/rpc/rpc-client-api.js.map +1 -1
- package/dist/utils/frontmatter.d.ts.map +1 -1
- package/dist/utils/frontmatter.js +2 -1
- package/dist/utils/frontmatter.js.map +1 -1
- package/dist/utils/management-http.d.ts +2 -0
- package/dist/utils/management-http.d.ts.map +1 -1
- package/dist/utils/management-http.js +11 -7
- package/dist/utils/management-http.js.map +1 -1
- package/dist/utils/shell.d.ts +3 -0
- package/dist/utils/shell.d.ts.map +1 -1
- package/dist/utils/shell.js +41 -10
- package/dist/utils/shell.js.map +1 -1
- package/dist/utils/syntax-highlight.d.ts +1 -0
- package/dist/utils/syntax-highlight.d.ts.map +1 -1
- package/dist/utils/syntax-highlight.js +61 -1
- package/dist/utils/syntax-highlight.js.map +1 -1
- package/dist/utils/text.d.ts +8 -0
- package/dist/utils/text.d.ts.map +1 -0
- package/dist/utils/text.js +9 -0
- package/dist/utils/text.js.map +1 -0
- package/docs/changelog.mdx +1 -1
- package/docs/compaction.md +16 -3
- package/docs/containerization.md +17 -0
- package/docs/custom-provider.md +1 -1
- package/docs/environment-variables.md +3 -3
- package/docs/extensions.md +22 -5
- package/docs/index.md +12 -10
- package/docs/intercom.md +5 -3
- package/docs/keybindings.md +1 -1
- package/docs/llama-cpp.md +1 -1
- package/docs/models.md +2 -0
- package/docs/quickstart.md +80 -9
- package/docs/rpc.md +24 -1
- package/docs/sdk.md +11 -0
- package/docs/settings.md +16 -7
- package/docs/skills.md +3 -2
- package/docs/subagents.md +7 -0
- package/docs/termux.md +1 -1
- package/docs/usage.md +4 -3
- package/docs/windows.md +33 -3
- package/docs/workflows.md +20 -10
- package/examples/extensions/border-status-editor.ts +1 -1
- package/examples/extensions/git-checkpoint.ts +1 -1
- package/examples/extensions/notify.ts +1 -1
- package/examples/extensions/titlebar-spinner.ts +1 -1
- package/examples/rpc-extension-ui.ts +1 -1
- package/examples/sdk/README.md +1 -1
- package/npm-shrinkwrap.json +73 -65
- package/package.json +11 -13
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,61 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.9.16-alpha.5] - 2026-08-26
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Added `/thinking [level]` plus searchable model and per-model thinking selectors. Selectors show saved defaults, search by model/provider/default state, order the current and default models first, and use `Ctrl+S` to persist a startup default while Enter changes only the current session ([#8399](https://github.com/earendil-works/pi/issues/8399)).
|
|
10
|
+
- Added a Windows PowerShell tool that prefers PowerShell 7 and falls back to Windows PowerShell when `pwsh.exe` or `powershell.exe` is on `PATH`. The tool is omitted when neither executable is available and is exposed through the SDK with typed extension events and result guards. Bash remains the shell for `!`/`!!`, plus Windows/WSL-friendly default keybindings ([#8512](https://github.com/earendil-works/pi/issues/8512)).
|
|
11
|
+
- Added path-aware, deduplicated settings diagnostics and routed startup diagnostics into the fullscreen transcript so alternate-screen startup cannot hide configuration errors.
|
|
12
|
+
- Added transcript billing notices for compaction and branch summaries when cache-miss notices are enabled. Verbatim Compaction aggregates usage from every completed planner response, including retries, into the persisted boundary, session statistics, footer totals, and cost breakdowns.
|
|
13
|
+
- Added export-only `atomic.share` context records containing the system prompt and tool schemas. Session sharing keeps private-Gist transport and Atomic viewer URLs; no persisted session is mutated and no Radius upload is introduced.
|
|
14
|
+
- Added RPC `clear_queue` to retrieve and remove queued steering and follow-up messages ([#8432](https://github.com/earendil-works/pi/issues/8432)).
|
|
15
|
+
- Exported `detectSupportedImageMimeTypeFromFile` from the public coding-agent API ([#8600](https://github.com/earendil-works/pi/pull/8600)).
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
|
|
19
|
+
- Updated the external pi runtime dependencies to 0.84.3, inheriting the matching agent/client/protocol updates and TUI fixes for narrow-width padding and wrapped Markdown-table link colors ([#8252](https://github.com/earendil-works/pi/issues/8252), [#8335](https://github.com/earendil-works/pi/issues/8335)).
|
|
20
|
+
- Model and thinking-level changes are session-scoped by default; saved per-model thinking overrides determine startup behavior, and persistence is now explicit through `Ctrl+S` ([#8356](https://github.com/earendil-works/pi/issues/8356)).
|
|
21
|
+
- Skill discovery silently ignores ordinary root Markdown files without skill frontmatter, continues diagnosing malformed declared skills, and loads nested Markdown skills from packages ([#8012](https://github.com/earendil-works/pi/issues/8012), [#8255](https://github.com/earendil-works/pi/issues/8255)).
|
|
22
|
+
- llama.cpp catalogs now expose sleeping models, refresh local-router catalogs even in offline mode, detect autoload support and offer presets, and explain when `/llama` is required after login ([#8235](https://github.com/earendil-works/pi/issues/8235), [#8236](https://github.com/earendil-works/pi/issues/8236), [#8238](https://github.com/earendil-works/pi/issues/8238), [#8558](https://github.com/earendil-works/pi/issues/8558)).
|
|
23
|
+
- Deferred uncommon syntax grammars until after first render to reduce interactive startup work while keeping common languages available immediately.
|
|
24
|
+
- Extension examples whose intent is final settlement now listen for `agent_settled`; JSON mode exposes tool-call ID and tool name at stream start; session-share links use canonical terminal hyperlinks and perform GitHub authentication preflight before export ([#8242](https://github.com/earendil-works/pi/issues/8242), [#7953](https://github.com/earendil-works/pi/issues/7953)).
|
|
25
|
+
- Compaction now reports truthful aggregate planner usage notices, including multi-attempt Verbatim planning, when cache-miss notices are enabled.
|
|
26
|
+
- Documented `/thinking`, the Ctrl+S startup-default shortcut in the model and thinking pickers, and the `modelThinkingLevels` setting.
|
|
27
|
+
|
|
28
|
+
### Fixed
|
|
29
|
+
|
|
30
|
+
- Fixed `/thinking` being absent from slash-command autocomplete and added completions for the active model's available thinking levels.
|
|
31
|
+
- Fixed the thinking-level selector so a capability-clamped default still receives the default badge when the saved setting is higher than the active model supports.
|
|
32
|
+
- Failed extension loads now roll back provider registrations applied during that load instead of leaving an earlier provider in the runtime.
|
|
33
|
+
- PowerShell cancellation now terminates the Windows process tree and returns without waiting on descendant-held stdout or stderr.
|
|
34
|
+
- Fixed `/tree` ranking below `/thinking` in slash-command autocomplete, so typing `/t` again offers branch navigation before the thinking-level command.
|
|
35
|
+
- Fixed PowerShell tool calls rendering with the Bash `$` transcript prompt. PowerShell calls now render as `PS> <command>`, and truncated PowerShell output is saved under its own temp-file prefix.
|
|
36
|
+
- Fixed the per-model thinking-level settings row opening an empty, unexplained picker when no models are available; it now states that a provider login or API key is required.
|
|
37
|
+
- Fixed Windows compiled binaries crashing with `ERR_INVALID_FILE_URL_PATH` when Return reached native modifier detection, including from the `/model` selector. Release app bundles keep only `pi-tui`'s native modifier loader runtime-relative, avoiding both the Linux build host's frozen module URL and Bun's inability to resolve a fully external `pi-tui` from a compiled split launcher, while retaining the staged Windows native helper for Shift+Enter handling.
|
|
38
|
+
- Fixed `bundle:dev` and `start:fast` omitting the statically registered OAuth adapters. Development bundles now use the Bun entrypoint shared with compiled builds, so OpenAI Codex and xAI OAuth derivation and refresh no longer fail on unresolved runtime imports.
|
|
39
|
+
- Fixed duplicate fullscreen right-click paste in VS Code-based terminals on Windows ([#8186](https://github.com/earendil-works/pi/issues/8186)).
|
|
40
|
+
- Fixed padded text exceeding narrow terminal widths ([#8252](https://github.com/earendil-works/pi/issues/8252)).
|
|
41
|
+
- Fixed wrapped Markdown table links leaking color into borders and neighboring cells, including tables inside blockquotes ([#8335](https://github.com/earendil-works/pi/issues/8335)).
|
|
42
|
+
- Compaction failures and cancellations now emit `session_compact_failed` to extensions and expose public failure details with their trigger, error, abort/retry state, and whether an extension supplied the compacted text ([#8241](https://github.com/earendil-works/pi/issues/8241)).
|
|
43
|
+
- Automatic compaction now estimates message size when providers report all-zero usage instead of silently skipping the threshold check ([#8328](https://github.com/earendil-works/pi/issues/8328)).
|
|
44
|
+
- Branch and session summaries reject tool calls, and their requests explicitly disable tools; planner requests do the same while retaining validated truncated-range recovery.
|
|
45
|
+
- Branch and session summaries reject token-cap-truncated prose instead of persisting incomplete checkpoints ([#7048](https://github.com/earendil-works/pi/issues/7048)).
|
|
46
|
+
- Branch summaries record the source leaf rather than the navigation destination.
|
|
47
|
+
- Fixed package updates comparing versions for inequality and potentially downgrading a newer installed package; upgrades now use semantic-version ordering ([#8239](https://github.com/earendil-works/pi/issues/8239)).
|
|
48
|
+
- Fixed extension flags accepting runtime defaults whose value did not match the declared boolean/string type, and failed extension factories leaking partially registered commands, tools, flags, and inherited resources into later loads ([#8123](https://github.com/earendil-works/pi/issues/8123), [#8424](https://github.com/earendil-works/pi/issues/8424)).
|
|
49
|
+
- Fixed hung authenticated model-catalog attempts consuming the whole request budget without retrying by applying a per-attempt timeout before retrying.
|
|
50
|
+
- Fixed UTF-8 BOMs breaking auth, model, keybinding, frontmatter, package, resource, theme, CLI, and external-editor text inputs while preserving BOM-aware hashline edits.
|
|
51
|
+
- Fixed atomic managed-state rewrites resetting existing file permissions. `auth.json` and `models-store.json` are created owner-only (`0600`) but keep an administrator-managed mode across later rewrites instead of having it reset by the atomic replacement.
|
|
52
|
+
- Fixed explicitly persisted default models disappearing from non-empty model scopes; persisted defaults are now added to both the active and saved scope.
|
|
53
|
+
- Fixed extension messages sent with `triggerTurn: false` while the agent is running being inserted between a tool call and its result; they are now appended after the turn's tool results ([#8537](https://github.com/earendil-works/pi/issues/8537)).
|
|
54
|
+
- Fixed compaction range planning and branch/session summaries forcing `toolChoice: "none"`, which sent `tool_choice` with no tools and could be rejected by gateways ([#8649](https://github.com/earendil-works/pi/issues/8649), [#8638](https://github.com/earendil-works/pi/issues/8638)).
|
|
55
|
+
- Fixed Windows shell aborts crashing Atomic when `taskkill.exe` is not on `PATH`. Both `killProcessTree` and the detached-child guardian worker now spawn the System32 executable and consume the asynchronous spawn error ([#6596](https://github.com/earendil-works/pi/issues/6596)).
|
|
56
|
+
- Fixed Windows `taskkill` spawning without `windowsHide`. Because the spawn is `detached`, Windows allocated and briefly flashed a console window on every process-tree kill.
|
|
57
|
+
- Fixed session files whose final record has no trailing newline not being repaired on load, so a later append no longer concatenates onto that record.
|
|
58
|
+
- Fixed toggling thinking-block visibility discarding partial Bash output. Rendered assistant messages are updated in place instead of rebuilding the chat and its live tool components ([#8611](https://github.com/earendil-works/pi/issues/8611)).
|
|
59
|
+
|
|
5
60
|
## [0.9.16-alpha.4] - 2026-08-23
|
|
6
61
|
|
|
7
62
|
### Fixed
|
package/README.md
CHANGED
|
@@ -77,7 +77,7 @@ atomic
|
|
|
77
77
|
/login # Then select provider
|
|
78
78
|
```
|
|
79
79
|
|
|
80
|
-
Then just talk to Atomic. By default, Atomic gives the model six coding tools: `read`, `write`, `edit`, `bash`, `find`, and `search`. The model uses these to fulfill your requests. `read`, `search`, `write`, and successful `edit` calls emit session-scoped hashline anchors (`[path#TAG]` plus `LINE:text`) so the model can make stale-safe line edits; see [docs/tools.md](docs/tools.md). Add capabilities via [skills](#skills), [prompt templates](#prompt-templates), [extensions](#extensions), or [Atomic packages](#atomic-packages).
|
|
80
|
+
Then just talk to Atomic. By default, Atomic gives the model six coding tools: `read`, `write`, `edit`, `bash`, `find`, and `search`. On native Windows, Atomic also enables `powershell` when `pwsh.exe` or `powershell.exe` is available. The model uses these to fulfill your requests. `read`, `search`, `write`, and successful `edit` calls emit session-scoped hashline anchors (`[path#TAG]` plus `LINE:text`) so the model can make stale-safe line edits; see [docs/tools.md](docs/tools.md). Add capabilities via [skills](#skills), [prompt templates](#prompt-templates), [extensions](#extensions), or [Atomic packages](#atomic-packages).
|
|
81
81
|
|
|
82
82
|
**Platform notes:** [Windows](docs/windows.md) | [Alpine/musl Linux](docs/index.md#alpine-and-musl-linux-archives) | [Termux (Android)](docs/termux.md) | [tmux](docs/tmux.md) | [Terminal setup](docs/terminal-setup.md) | [Shell aliases](docs/shell-aliases.md)
|
|
83
83
|
|
|
@@ -176,9 +176,10 @@ Type `/` in the editor to trigger commands. [Extensions](#extensions) can regist
|
|
|
176
176
|
| Command | Description |
|
|
177
177
|
|---------|-------------|
|
|
178
178
|
| `/login`, `/logout` | OAuth authentication |
|
|
179
|
-
| `/model` | Switch models |
|
|
179
|
+
| `/model` | Switch models; Ctrl+S in the picker saves the startup default |
|
|
180
|
+
| `/thinking` | Switch thinking level; Ctrl+S in the picker saves the startup default |
|
|
180
181
|
| `/scoped-models` | Enable/disable models for CTRL+P cycling |
|
|
181
|
-
| `/settings` |
|
|
182
|
+
| `/settings` | Theme, message delivery, transport, and other preferences |
|
|
182
183
|
| `/resume` | Pick from previous sessions |
|
|
183
184
|
| `/new` | Start a new session |
|
|
184
185
|
| `/name <name>` | Set session display name |
|
|
@@ -492,7 +493,7 @@ Upstream Pi's minimal-core rationale is documented in the [original blog post](h
|
|
|
492
493
|
## CLI Reference
|
|
493
494
|
|
|
494
495
|
```bash
|
|
495
|
-
atomic [options] [@files...] [messages...]
|
|
496
|
+
atomic [options] [--] [@files...] [messages...]
|
|
496
497
|
```
|
|
497
498
|
|
|
498
499
|
### Package Commands
|
|
@@ -561,7 +562,7 @@ cat README.md | atomic -p "Summarize this text"
|
|
|
561
562
|
| `--no-builtin-tools`, `-nbt` | Disable built-in tools by default but keep extension/custom tools enabled |
|
|
562
563
|
| `--no-tools`, `-nt` | Disable all tools by default |
|
|
563
564
|
|
|
564
|
-
Default built-in tools: `read`, `bash`, `edit`, `write`, `find`, `search`, `ask_user_question`, `todo
|
|
565
|
+
Default built-in tools: `read`, `bash`, `edit`, `write`, `find`, `search`, `ask_user_question`, `todo`, plus `powershell` on native Windows when a PowerShell executable is available. `find.paths` accepts directories, files, or glob paths such as `*.ts` and honors `timeout`; `search` accepts `pattern`, `paths`, `i`, `gitignore`, and `skip` for regex content-search pagination. `read`/`search`/`write`/`edit` share session-scoped hashline snapshot tags for stale-safe line edits; copied hashline output is stripped by `write` only when it matches a known current-session snapshot. Archive selectors are Bun-native, and internal-resource selectors use the session router when available. Use `--exclude-tools` to disable one or more tools while leaving the rest available.
|
|
565
566
|
|
|
566
567
|
### Project Trust Options
|
|
567
568
|
|
|
@@ -596,6 +597,7 @@ Combine `--no-*` with explicit flags to load exactly what you need, ignoring set
|
|
|
596
597
|
| `--append-system-prompt <text>` | Append to system prompt |
|
|
597
598
|
| `--offline` | Disable startup network operations, including update checks, package updates, and telemetry |
|
|
598
599
|
| `--verbose` | Force verbose startup |
|
|
600
|
+
| `--` | Stop option parsing; remaining arguments are prompts or `@file` inputs |
|
|
599
601
|
| `-h`, `--help` | Show help |
|
|
600
602
|
| `-v`, `--version` | Show version |
|
|
601
603
|
|
|
@@ -618,6 +620,9 @@ atomic "List all .ts files in src/"
|
|
|
618
620
|
# Non-interactive
|
|
619
621
|
atomic -p "Summarize this codebase"
|
|
620
622
|
|
|
623
|
+
# Prompt beginning with a dash
|
|
624
|
+
atomic -p -- "- Summarize these points"
|
|
625
|
+
|
|
621
626
|
# Non-interactive with piped stdin
|
|
622
627
|
cat README.md | atomic -p "Summarize this text"
|
|
623
628
|
|
|
@@ -657,7 +662,7 @@ atomic --thinking high "Solve this complex problem"
|
|
|
657
662
|
| `PI_CACHE_RETENTION` | Provider/upstream-specific prompt-cache retention knob; set to `long` where supported. This is not an `ATOMIC_*` alias and has no Atomic-prefixed equivalent. |
|
|
658
663
|
| `VISUAL`, `EDITOR` | External editor for CTRL+G |
|
|
659
664
|
|
|
660
|
-
Bash commands also receive an execution-time session snapshot through `ATOMIC_SESSION_ID`, `ATOMIC_SESSION_FILE` (omitted for unsaved sessions), `ATOMIC_PROVIDER`, `ATOMIC_MODEL`, and `ATOMIC_REASONING_LEVEL`. The exact `PI_SESSION_ID`, `PI_SESSION_FILE`, `PI_PROVIDER`, `PI_MODEL`, and `PI_REASONING_LEVEL` aliases carry identical values. Unrelated inherited or caller-supplied environment variables are preserved.
|
|
665
|
+
Bash and PowerShell commands also receive an execution-time session snapshot through `ATOMIC_SESSION_ID`, `ATOMIC_SESSION_FILE` (omitted for unsaved sessions), `ATOMIC_PROVIDER`, `ATOMIC_MODEL`, and `ATOMIC_REASONING_LEVEL`. The exact `PI_SESSION_ID`, `PI_SESSION_FILE`, `PI_PROVIDER`, `PI_MODEL`, and `PI_REASONING_LEVEL` aliases carry identical values. Unrelated inherited or caller-supplied environment variables are preserved.
|
|
661
666
|
|
|
662
667
|
---
|
|
663
668
|
|
|
@@ -4,6 +4,21 @@ All notable changes to the `pi-intercom` extension will be documented in this fi
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [0.9.16-alpha.5] - 2026-08-26
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- Concurrent blocking asks now use a correlation-keyed waiter registry, with configurable `maxPendingAsks` capacity, exact out-of-order reply and selective-disconnect settlement, and a structured refusal when full. Blocking supervisor decisions remain exclusive per child while coexisting with ordinary peer asks ([#2628](https://github.com/bastani-inc/atomic/issues/2628)).
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- Session teardown rejects every pending reply waiter while preserving per-waiter reply, timeout, abort, cancel, and peer-disconnect settlement.
|
|
16
|
+
|
|
17
|
+
### Fixed
|
|
18
|
+
|
|
19
|
+
- Blocking `ask` and `contact_supervisor` waits now fail promptly with the departed session's name when their target disconnects after delivery, instead of hanging until the 10-minute timeout ([#2627](https://github.com/bastani-inc/atomic/issues/2627)).
|
|
20
|
+
- Replying to an exact pending ask now removes its queued turn context, preventing the same ask from resurfacing and being answered twice ([#2628](https://github.com/bastani-inc/atomic/issues/2628)).
|
|
21
|
+
|
|
7
22
|
## [0.9.16-alpha.1] - 2026-08-23
|
|
8
23
|
|
|
9
24
|
### Breaking Changes
|
|
@@ -230,7 +230,7 @@ This matters because the agent receiving the message doesn't need to reconstruct
|
|
|
230
230
|
|
|
231
231
|
`send` is fire-and-forget — the tool returns immediately after delivery. By default, it sends immediately even in interactive sessions. If you want an approval dialog before non-reply sends, set `confirmSend: true` in config. Replies that include `replyTo` still skip confirmation so reply-hint flows can continue without an extra approval step.
|
|
232
232
|
|
|
233
|
-
`ask` sends the message and blocks until the recipient responds (10-minute timeout). The reply comes back as the tool result, so the agent continues in the same turn with full context. No confirmation dialog — if you're asking and waiting, the intent is clear. A completed workflow-stage target with a retained conversation is automatically reopened for one post-mortem turn; unavailable or non-resumable completed targets fail actionably without consuming the full reply timeout.
|
|
233
|
+
`ask` sends the message and blocks until the recipient responds (10-minute timeout). If the recipient disconnects after delivery, the ask fails promptly with an error naming that session; the timeout remains the backstop for a connected but unresponsive recipient. The reply comes back as the tool result, so the agent continues in the same turn with full context. No confirmation dialog — if you're asking and waiting, the intent is clear. A completed workflow-stage target with a retained conversation is automatically reopened for one post-mortem turn; unavailable or non-resumable completed targets fail actionably without consuming the full reply timeout.
|
|
234
234
|
|
|
235
235
|
`reply` is receiver-side sugar for replying to an inbound ask. In the turn triggered by an incoming intercom ask, `intercom({ action: "reply", message: "..." })` targets that exact sender and message automatically. If you reply later, it falls back to the single unresolved inbound ask. If multiple asks are pending, use `intercom({ action: "pending" })` to inspect them and then call `reply` with `to` to disambiguate.
|
|
236
236
|
|
|
@@ -350,7 +350,7 @@ Only registered in sessions where `pi-subagents` supplied the required child bri
|
|
|
350
350
|
| `message` | string | The decision request, optional interview note, or progress update |
|
|
351
351
|
| `interview` | object | Required for `interview_request`: `{ title?, description?, questions: [...] }` |
|
|
352
352
|
|
|
353
|
-
**`need_decision`** — Sends a formatted ask to the supervisor and blocks until it replies (10-minute timeout). The reply comes back as the tool result. Includes run metadata in the message so the supervisor knows which subagent is asking.
|
|
353
|
+
**`need_decision`** — Sends a formatted ask to the supervisor and blocks until it replies (10-minute timeout). If the supervisor disconnects after delivery, the wait fails promptly instead. The reply comes back as the tool result. Includes run metadata in the message so the supervisor knows which subagent is asking.
|
|
354
354
|
|
|
355
355
|
**`interview_request`** — Sends a formatted, agent-readable interview to the supervisor and blocks until it replies. Questions use a local pi-interview-like shape: `{ id, type, question, options?, context? }` where `type` is `single`, `multi`, `text`, `image`, or `info`. `info` questions are context-only and do not need responses. The supervisor reply should be JSON with `{ "responses": [{ "id": "...", "value": ... }] }`. Parsed JSON replies are returned in `details.structuredReply`.
|
|
356
356
|
|
|
@@ -368,12 +368,14 @@ Target lookup accepts only an exact full session ID or an exact case-insensitive
|
|
|
368
368
|
|
|
369
369
|
**`send`** — Sends a message to the specified session. By default it sends immediately, including in interactive sessions. Set `confirmSend: true` in config if you want a confirmation dialog for non-reply sends. Replies that include `replyTo` skip confirmation. Returns delivery confirmation.
|
|
370
370
|
|
|
371
|
-
**`ask`** — Sends a message and waits for the recipient to reply (10-minute timeout).
|
|
371
|
+
**`ask`** — Sends a message and waits for the recipient to reply (10-minute timeout). A recipient disconnect after delivery fails only that peer's exact wait promptly; the timeout remains the backstop while the recipient stays connected. Up to `maxPendingAsks` blocking asks (default: 6) may run concurrently, including same-target and mixed-target fan-out. Replies resolve by exact sender and message ID, so out-of-order replies cannot cross-settle another call. When capacity is full, new asks receive a structured refusal. Use this when the agent needs the answer to continue working.
|
|
372
372
|
|
|
373
|
-
**`reply`** — Replies to the current intercom-triggered message if there is one. Otherwise it falls back to the single unresolved inbound ask. If multiple asks are pending, pass an exact name
|
|
373
|
+
**`reply`** — Replies to the current intercom-triggered message if there is one. Otherwise it falls back to the single unresolved inbound ask. If multiple asks are pending, pass an exact name/full session ID in `to`, or the listed message ID in `replyTo`; use `pending` to inspect them first. `replyTo` also disambiguates multiple asks from the same sender. Under the hood this is still a normal `send` with the exact `replyTo` value.
|
|
374
374
|
|
|
375
375
|
**`pending`** — Lists unresolved inbound asks with sender, message ID, elapsed time, and a short preview. Useful when replying after the original triggered turn.
|
|
376
376
|
|
|
377
|
+
`contact_supervisor` decisions and interviews are deliberately exclusive per child: one supervisor wait may coexist with ordinary peer asks, but a second concurrent supervisor wait receives `Already waiting for a supervisor reply`. Claimed foreground parent handoffs remain first-claim-wins and do not allocate a waiter. Multiple children can contact the same parent independently because inbound asks and handoffs are keyed by child/message identity. Mutual peer asks are supported, but each side must process inbound work to reply; the per-waiter timeout remains the deadlock backstop.
|
|
378
|
+
|
|
377
379
|
**`status`** — Shows connection status, session ID, current group, and the total count of active sessions in that group. A `group` filter remains a read-only peek.
|
|
378
380
|
|
|
379
381
|
## Keyboard Shortcuts
|
|
@@ -12,6 +12,7 @@ import { handleBrokerSend, type BrokerConnectedSession } from "./send-handler.js
|
|
|
12
12
|
import { SupervisorChannelCache } from "./supervisor-channel.js";
|
|
13
13
|
import { normalizeGroup } from "../group.js";
|
|
14
14
|
import { handleBrokerPresence } from "./presence-handler.js";
|
|
15
|
+
import { PendingQuestionIndex } from "./pending-question-index.js";
|
|
15
16
|
|
|
16
17
|
const INTERCOM_DIR = getIntercomDirPath();
|
|
17
18
|
const SOCKET_PATH = getBrokerSocketPath();
|
|
@@ -60,6 +61,7 @@ class IntercomBroker {
|
|
|
60
61
|
private shutdownTimer: NodeJS.Timeout | null = null;
|
|
61
62
|
private deliveredMessages = new DeliveredMessageCache();
|
|
62
63
|
private supervisorChannel = new SupervisorChannelCache();
|
|
64
|
+
private pendingQuestions = new PendingQuestionIndex();
|
|
63
65
|
|
|
64
66
|
constructor() {
|
|
65
67
|
mkdirSync(INTERCOM_DIR, { recursive: true });
|
|
@@ -97,10 +99,7 @@ class IntercomBroker {
|
|
|
97
99
|
|
|
98
100
|
socket.on("close", () => {
|
|
99
101
|
if (sessionId) {
|
|
100
|
-
|
|
101
|
-
this.sessions.delete(sessionId);
|
|
102
|
-
this.broadcastToGroup({ type: "session_left", sessionId }, leavingGroup, sessionId);
|
|
103
|
-
|
|
102
|
+
this.disconnectSession(sessionId);
|
|
104
103
|
this.scheduleShutdownCheck();
|
|
105
104
|
}
|
|
106
105
|
});
|
|
@@ -195,9 +194,7 @@ class IntercomBroker {
|
|
|
195
194
|
}
|
|
196
195
|
|
|
197
196
|
case "unregister": {
|
|
198
|
-
|
|
199
|
-
this.sessions.delete(currentId);
|
|
200
|
-
this.broadcastToGroup({ type: "session_left", sessionId: currentId }, leavingGroup, currentId);
|
|
197
|
+
this.disconnectSession(currentId);
|
|
201
198
|
setId(null);
|
|
202
199
|
this.scheduleShutdownCheck();
|
|
203
200
|
break;
|
|
@@ -248,7 +245,16 @@ class IntercomBroker {
|
|
|
248
245
|
|
|
249
246
|
case "send":
|
|
250
247
|
case "supervisor_send": {
|
|
251
|
-
handleBrokerSend(
|
|
248
|
+
handleBrokerSend(
|
|
249
|
+
socket,
|
|
250
|
+
clientMessage,
|
|
251
|
+
currentId,
|
|
252
|
+
this.sessions,
|
|
253
|
+
this.deliveredMessages,
|
|
254
|
+
writeMessage,
|
|
255
|
+
this.supervisorChannel,
|
|
256
|
+
this.pendingQuestions,
|
|
257
|
+
);
|
|
252
258
|
break;
|
|
253
259
|
}
|
|
254
260
|
|
|
@@ -268,6 +274,26 @@ class IntercomBroker {
|
|
|
268
274
|
}
|
|
269
275
|
}
|
|
270
276
|
|
|
277
|
+
private disconnectSession(sessionId: string): void {
|
|
278
|
+
const departed = this.sessions.get(sessionId);
|
|
279
|
+
if (!departed) return;
|
|
280
|
+
|
|
281
|
+
this.pendingQuestions.pruneSender(sessionId);
|
|
282
|
+
for (const question of this.pendingQuestions.takeForTarget(sessionId)) {
|
|
283
|
+
const asker = this.sessions.get(question.senderSessionId);
|
|
284
|
+
if (!asker) continue;
|
|
285
|
+
writeMessage(asker.socket, {
|
|
286
|
+
type: "peer_disconnected",
|
|
287
|
+
replyTo: question.messageId,
|
|
288
|
+
peerSessionId: departed.info.id,
|
|
289
|
+
...(departed.info.name !== undefined ? { peerName: departed.info.name } : {}),
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
this.sessions.delete(sessionId);
|
|
294
|
+
this.broadcastToGroup({ type: "session_left", sessionId }, departed.info.group, sessionId);
|
|
295
|
+
}
|
|
296
|
+
|
|
271
297
|
/** Deliver a broadcast only to sessions in the given (normalized) group. */
|
|
272
298
|
private broadcastToGroup(msg: BrokerMessage, group: string | undefined, exclude?: string): void {
|
|
273
299
|
const target = normalizeGroup(group);
|
|
@@ -365,6 +365,19 @@ export class IntercomClient extends EventEmitter {
|
|
|
365
365
|
pending.reject(new Error(brokerMessage.reason));
|
|
366
366
|
break;
|
|
367
367
|
}
|
|
368
|
+
case "peer_disconnected": {
|
|
369
|
+
const { replyTo, peerSessionId, peerName } = brokerMessage;
|
|
370
|
+
if (typeof replyTo !== "string" || typeof peerSessionId !== "string"
|
|
371
|
+
|| (peerName !== undefined && typeof peerName !== "string")) {
|
|
372
|
+
throw new Error("Invalid peer_disconnected message");
|
|
373
|
+
}
|
|
374
|
+
this.emit("peer_disconnected", {
|
|
375
|
+
replyTo,
|
|
376
|
+
peerSessionId,
|
|
377
|
+
...(peerName !== undefined ? { peerName } : {}),
|
|
378
|
+
});
|
|
379
|
+
break;
|
|
380
|
+
}
|
|
368
381
|
case "error": {
|
|
369
382
|
if (typeof brokerMessage.error !== "string") {
|
|
370
383
|
throw new Error("Invalid error message");
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export interface PendingQuestion {
|
|
2
|
+
senderSessionId: string;
|
|
3
|
+
targetSessionId: string;
|
|
4
|
+
messageId: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/** Tracks delivered questions until their reply or either peer's departure. */
|
|
8
|
+
export class PendingQuestionIndex {
|
|
9
|
+
private readonly questions = new Map<string, PendingQuestion[]>();
|
|
10
|
+
|
|
11
|
+
record(senderSessionId: string, targetSessionId: string, messageId: string): void {
|
|
12
|
+
const routes = this.questions.get(messageId) ?? [];
|
|
13
|
+
if (routes.some((route) => route.senderSessionId === senderSessionId && route.targetSessionId === targetSessionId)) return;
|
|
14
|
+
routes.push({ senderSessionId, targetSessionId, messageId });
|
|
15
|
+
this.questions.set(messageId, routes);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
clearReply(senderSessionId: string, targetSessionId: string, replyTo: string): boolean {
|
|
19
|
+
const routes = this.questions.get(replyTo);
|
|
20
|
+
const index = routes?.findIndex(
|
|
21
|
+
(route) => route.targetSessionId === senderSessionId && route.senderSessionId === targetSessionId,
|
|
22
|
+
) ?? -1;
|
|
23
|
+
if (!routes || index < 0) return false;
|
|
24
|
+
routes.splice(index, 1);
|
|
25
|
+
if (routes.length === 0) this.questions.delete(replyTo);
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
pruneSender(senderSessionId: string): void {
|
|
30
|
+
for (const [messageId, routes] of this.questions) {
|
|
31
|
+
const remaining = routes.filter((route) => route.senderSessionId !== senderSessionId);
|
|
32
|
+
if (remaining.length === 0) this.questions.delete(messageId);
|
|
33
|
+
else if (remaining.length !== routes.length) this.questions.set(messageId, remaining);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
takeForTarget(targetSessionId: string): PendingQuestion[] {
|
|
38
|
+
const pending: PendingQuestion[] = [];
|
|
39
|
+
for (const [messageId, routes] of this.questions) {
|
|
40
|
+
const remaining = routes.filter((route) => {
|
|
41
|
+
if (route.targetSessionId !== targetSessionId) return true;
|
|
42
|
+
pending.push(route);
|
|
43
|
+
return false;
|
|
44
|
+
});
|
|
45
|
+
if (remaining.length === 0) this.questions.delete(messageId);
|
|
46
|
+
else if (remaining.length !== routes.length) this.questions.set(messageId, remaining);
|
|
47
|
+
}
|
|
48
|
+
return pending;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -6,6 +6,7 @@ import { buildMessageSendSignature } from "./send-signature.js";
|
|
|
6
6
|
import { SupervisorChannelCache } from "./supervisor-channel.js";
|
|
7
7
|
import { isVerticalBypass, sameGroup } from "./group-isolation.js";
|
|
8
8
|
import { normalizeGroup } from "../group.js";
|
|
9
|
+
import { PendingQuestionIndex } from "./pending-question-index.js";
|
|
9
10
|
|
|
10
11
|
export interface BrokerConnectedSession {
|
|
11
12
|
socket: net.Socket;
|
|
@@ -49,6 +50,7 @@ export function handleBrokerSend(
|
|
|
49
50
|
deliveredMessages: DeliveredMessageCache,
|
|
50
51
|
write: (target: net.Socket, message: BrokerMessage) => void,
|
|
51
52
|
supervisorCache: SupervisorChannelCache = new SupervisorChannelCache(),
|
|
53
|
+
pendingQuestions: PendingQuestionIndex = new PendingQuestionIndex(),
|
|
52
54
|
): void {
|
|
53
55
|
const message = clientMessage.message;
|
|
54
56
|
const messageId = isMessage(message) ? message.id : "unknown";
|
|
@@ -147,6 +149,12 @@ export function handleBrokerSend(
|
|
|
147
149
|
? { type: "message", from: fromSession.info, message, channel: "supervisor" }
|
|
148
150
|
: { type: "message", from: fromSession.info, message });
|
|
149
151
|
deliveredMessages.record(message.id, signature);
|
|
152
|
+
if (message.expectsReply === true) {
|
|
153
|
+
pendingQuestions.record(fromSession.info.id, target.info.id, message.id);
|
|
154
|
+
}
|
|
155
|
+
if (message.replyTo !== undefined) {
|
|
156
|
+
pendingQuestions.clearReply(fromSession.info.id, target.info.id, message.replyTo);
|
|
157
|
+
}
|
|
150
158
|
if (supervisorSend) supervisorCache.record(message.id, fromSession.info.id, target.info.id);
|
|
151
159
|
write(socket, { type: "delivered", messageId: message.id, attemptId });
|
|
152
160
|
return;
|