@bastani/atomic 0.8.28-alpha.1 → 0.8.28-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 +60 -0
- package/README.md +120 -118
- package/dist/builtin/intercom/package.json +1 -1
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/package.json +1 -1
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/builtin/workflows/CHANGELOG.md +26 -0
- package/dist/builtin/workflows/README.md +1 -1
- package/dist/builtin/workflows/builtin/open-claude-design.ts +150 -13
- package/dist/builtin/workflows/package.json +1 -1
- package/dist/builtin/workflows/src/authoring.d.ts +5 -2
- package/dist/builtin/workflows/src/extension/dispatcher.ts +2 -0
- package/dist/builtin/workflows/src/extension/index.ts +8 -0
- package/dist/builtin/workflows/src/extension/render-result.ts +5 -2
- package/dist/builtin/workflows/src/extension/workflow-schema.ts +18 -0
- package/dist/builtin/workflows/src/runs/background/status.ts +4 -0
- package/dist/builtin/workflows/src/runs/foreground/executor.ts +1251 -110
- package/dist/builtin/workflows/src/shared/authoring-contract.d.ts +34 -10
- package/dist/builtin/workflows/src/shared/expanded-workflow-graph.ts +10 -2
- package/dist/builtin/workflows/src/shared/persistence-restore.ts +28 -9
- package/dist/builtin/workflows/src/shared/persistence-session-entries.ts +9 -3
- package/dist/builtin/workflows/src/shared/store-types.ts +10 -3
- package/dist/builtin/workflows/src/shared/store.ts +29 -7
- package/dist/builtin/workflows/src/shared/types.ts +12 -10
- package/dist/builtin/workflows/src/tui/chat-surface.ts +32 -33
- package/dist/builtin/workflows/src/tui/run-detail.ts +23 -4
- package/dist/builtin/workflows/src/tui/status-helpers.ts +4 -0
- package/dist/builtin/workflows/src/tui/status-list.ts +47 -3
- package/dist/builtin/workflows/src/tui/store-widget-installer.ts +1 -1
- package/dist/builtin/workflows/src/tui/widget.ts +12 -3
- package/dist/builtin/workflows/src/workflows/define-workflow.ts +3 -3
- package/dist/cli/args.d.ts +4 -0
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +35 -0
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/project-trust.d.ts +10 -0
- package/dist/cli/project-trust.d.ts.map +1 -0
- package/dist/cli/project-trust.js +36 -0
- package/dist/cli/project-trust.js.map +1 -0
- package/dist/cli/startup-ui.d.ts +7 -0
- package/dist/cli/startup-ui.d.ts.map +1 -0
- package/dist/cli/startup-ui.js +57 -0
- package/dist/cli/startup-ui.js.map +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +24 -3
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts +3 -1
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +1 -0
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session-services.d.ts +3 -1
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js +3 -2
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/agent-session.d.ts +9 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +70 -21
- package/dist/core/agent-session.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/compaction/branch-summarization.d.ts +3 -1
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +9 -3
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +18 -24
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/compaction/utils.d.ts +1 -1
- package/dist/core/compaction/utils.d.ts.map +1 -1
- package/dist/core/compaction/utils.js +1 -1
- package/dist/core/compaction/utils.js.map +1 -1
- package/dist/core/experimental.d.ts +2 -0
- package/dist/core/experimental.d.ts.map +1 -0
- package/dist/core/experimental.js +5 -0
- package/dist/core/experimental.js.map +1 -0
- package/dist/core/export-html/template.js +19 -6
- package/dist/core/extensions/index.d.ts +1 -1
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/loader.d.ts +1 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +6 -4
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +11 -4
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +53 -3
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +34 -4
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/footer-data-provider.d.ts +2 -0
- package/dist/core/footer-data-provider.d.ts.map +1 -1
- package/dist/core/footer-data-provider.js +27 -1
- package/dist/core/footer-data-provider.js.map +1 -1
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +2 -0
- package/dist/core/index.js.map +1 -1
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +64 -7
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +1 -0
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/output-guard.d.ts +1 -0
- package/dist/core/output-guard.d.ts.map +1 -1
- package/dist/core/output-guard.js +52 -22
- package/dist/core/output-guard.js.map +1 -1
- package/dist/core/package-manager.d.ts +1 -0
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +20 -8
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/project-trust.d.ts +15 -0
- package/dist/core/project-trust.d.ts.map +1 -0
- package/dist/core/project-trust.js +58 -0
- package/dist/core/project-trust.js.map +1 -0
- package/dist/core/prompt-templates.d.ts +5 -4
- package/dist/core/prompt-templates.d.ts.map +1 -1
- package/dist/core/prompt-templates.js +30 -29
- package/dist/core/prompt-templates.js.map +1 -1
- package/dist/core/provider-attribution.d.ts +4 -0
- package/dist/core/provider-attribution.d.ts.map +1 -0
- package/dist/core/provider-attribution.js +73 -0
- package/dist/core/provider-attribution.js.map +1 -0
- package/dist/core/provider-display-names.d.ts.map +1 -1
- package/dist/core/provider-display-names.js +3 -0
- package/dist/core/provider-display-names.js.map +1 -1
- package/dist/core/resolve-config-value.d.ts +9 -1
- package/dist/core/resolve-config-value.d.ts.map +1 -1
- package/dist/core/resolve-config-value.js +134 -11
- package/dist/core/resolve-config-value.js.map +1 -1
- package/dist/core/resource-loader.d.ts +12 -2
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +108 -18
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/sdk.d.ts +4 -2
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +13 -42
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-manager.d.ts +6 -7
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +99 -35
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-manager.d.ts +15 -2
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +69 -10
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +1 -0
- 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 +0 -3
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tools/ask-user-question/state/inline-input.d.ts +28 -0
- package/dist/core/tools/ask-user-question/state/inline-input.d.ts.map +1 -0
- package/dist/core/tools/ask-user-question/state/inline-input.js +56 -0
- package/dist/core/tools/ask-user-question/state/inline-input.js.map +1 -0
- package/dist/core/tools/ask-user-question/state/key-router.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/state/key-router.js +30 -4
- package/dist/core/tools/ask-user-question/state/key-router.js.map +1 -1
- package/dist/core/tools/ask-user-question/state/questionnaire-session.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/state/questionnaire-session.js +9 -8
- package/dist/core/tools/ask-user-question/state/questionnaire-session.js.map +1 -1
- package/dist/core/tools/ask-user-question/state/row-intent.d.ts +3 -2
- package/dist/core/tools/ask-user-question/state/row-intent.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/state/row-intent.js +1 -1
- package/dist/core/tools/ask-user-question/state/row-intent.js.map +1 -1
- package/dist/core/tools/ask-user-question/state/selectors/contract.d.ts +2 -0
- package/dist/core/tools/ask-user-question/state/selectors/contract.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/state/selectors/contract.js.map +1 -1
- package/dist/core/tools/ask-user-question/state/selectors/projections.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/state/selectors/projections.js +2 -0
- package/dist/core/tools/ask-user-question/state/selectors/projections.js.map +1 -1
- package/dist/core/tools/ask-user-question/state/state-reducer.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/state/state-reducer.js +36 -24
- package/dist/core/tools/ask-user-question/state/state-reducer.js.map +1 -1
- package/dist/core/tools/ask-user-question/state/state.d.ts +8 -0
- package/dist/core/tools/ask-user-question/state/state.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/state/state.js.map +1 -1
- package/dist/core/tools/ask-user-question/tool/format-answer.d.ts +6 -0
- package/dist/core/tools/ask-user-question/tool/format-answer.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/tool/format-answer.js +19 -1
- package/dist/core/tools/ask-user-question/tool/format-answer.js.map +1 -1
- package/dist/core/tools/ask-user-question/tool/response-envelope.d.ts +3 -2
- package/dist/core/tools/ask-user-question/tool/response-envelope.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/tool/response-envelope.js +15 -3
- package/dist/core/tools/ask-user-question/tool/response-envelope.js.map +1 -1
- package/dist/core/tools/ask-user-question/tool/types.d.ts +2 -1
- package/dist/core/tools/ask-user-question/tool/types.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/tool/types.js.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/chat-row-view.d.ts +5 -2
- package/dist/core/tools/ask-user-question/view/components/chat-row-view.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/chat-row-view.js +2 -0
- package/dist/core/tools/ask-user-question/view/components/chat-row-view.js.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/wrapping-select.d.ts +1 -0
- package/dist/core/tools/ask-user-question/view/components/wrapping-select.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/wrapping-select.js +2 -1
- package/dist/core/tools/ask-user-question/view/components/wrapping-select.js.map +1 -1
- package/dist/core/tools/ask-user-question/view/props-adapter.d.ts +3 -3
- package/dist/core/tools/ask-user-question/view/props-adapter.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/view/props-adapter.js +11 -4
- package/dist/core/tools/ask-user-question/view/props-adapter.js.map +1 -1
- package/dist/core/tools/bash-policy.d.ts +62 -0
- package/dist/core/tools/bash-policy.d.ts.map +1 -0
- package/dist/core/tools/bash-policy.js +1069 -0
- package/dist/core/tools/bash-policy.js.map +1 -0
- package/dist/core/tools/bash.d.ts +5 -0
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +9 -1
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +7 -10
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js +1 -1
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js +1 -1
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/index.d.ts +1 -0
- package/dist/core/tools/index.d.ts.map +1 -1
- package/dist/core/tools/index.js +1 -0
- package/dist/core/tools/index.js.map +1 -1
- package/dist/core/tools/ls.d.ts.map +1 -1
- package/dist/core/tools/ls.js +1 -1
- package/dist/core/tools/ls.js.map +1 -1
- package/dist/core/tools/oversized-tool-result.d.ts +53 -0
- package/dist/core/tools/oversized-tool-result.d.ts.map +1 -0
- package/dist/core/tools/oversized-tool-result.js +206 -0
- package/dist/core/tools/oversized-tool-result.js.map +1 -0
- package/dist/core/tools/read.d.ts +12 -0
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +99 -34
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/render-utils.d.ts +6 -0
- package/dist/core/tools/render-utils.d.ts.map +1 -1
- package/dist/core/tools/render-utils.js +17 -1
- package/dist/core/tools/render-utils.js.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.d.ts +6 -0
- package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.js +2 -0
- package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
- package/dist/core/tools/tool-limits.d.ts +25 -0
- package/dist/core/tools/tool-limits.d.ts.map +1 -0
- package/dist/core/tools/tool-limits.js +25 -0
- package/dist/core/tools/tool-limits.js.map +1 -0
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/tools/write.js +1 -1
- package/dist/core/tools/write.js.map +1 -1
- package/dist/core/trust-manager.d.ts +31 -0
- package/dist/core/trust-manager.d.ts.map +1 -0
- package/dist/core/trust-manager.js +196 -0
- package/dist/core/trust-manager.js.map +1 -0
- package/dist/index.d.ts +11 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +142 -30
- package/dist/main.js.map +1 -1
- package/dist/migrations.d.ts +3 -1
- package/dist/migrations.d.ts.map +1 -1
- package/dist/migrations.js +325 -7
- package/dist/migrations.js.map +1 -1
- package/dist/modes/index.d.ts +1 -1
- package/dist/modes/index.d.ts.map +1 -1
- package/dist/modes/index.js.map +1 -1
- package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/bash-execution.js +2 -2
- package/dist/modes/interactive/components/bash-execution.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +6 -0
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/index.d.ts +1 -0
- package/dist/modes/interactive/components/index.d.ts.map +1 -1
- package/dist/modes/interactive/components/index.js +1 -0
- package/dist/modes/interactive/components/index.js.map +1 -1
- package/dist/modes/interactive/components/login-dialog.d.ts +1 -1
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/dist/modes/interactive/components/login-dialog.js +9 -16
- package/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +3 -1
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +20 -0
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +22 -0
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/trust-selector.d.ts +23 -0
- package/dist/modes/interactive/components/trust-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/trust-selector.js +85 -0
- package/dist/modes/interactive/components/trust-selector.js.map +1 -0
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message.js +1 -1
- package/dist/modes/interactive/components/user-message.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +9 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +130 -9
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +10 -0
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js +1 -0
- package/dist/modes/print-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +3 -0
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +50 -6
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +23 -4
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +1 -0
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/package-manager-cli.d.ts +6 -2
- package/dist/package-manager-cli.d.ts.map +1 -1
- package/dist/package-manager-cli.js +104 -10
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/utils/changelog.d.ts +1 -0
- package/dist/utils/changelog.d.ts.map +1 -1
- package/dist/utils/changelog.js +72 -0
- package/dist/utils/changelog.js.map +1 -1
- package/dist/utils/deprecation.d.ts +4 -0
- package/dist/utils/deprecation.d.ts.map +1 -0
- package/dist/utils/deprecation.js +13 -0
- package/dist/utils/deprecation.js.map +1 -0
- package/dist/utils/git.d.ts.map +1 -1
- package/dist/utils/git.js +54 -22
- package/dist/utils/git.js.map +1 -1
- package/dist/utils/json.d.ts +3 -0
- package/dist/utils/json.d.ts.map +1 -0
- package/dist/utils/json.js +7 -0
- package/dist/utils/json.js.map +1 -0
- package/dist/utils/open-browser.d.ts +9 -0
- package/dist/utils/open-browser.d.ts.map +1 -0
- package/dist/utils/open-browser.js +22 -0
- package/dist/utils/open-browser.js.map +1 -0
- package/docs/containerization.md +111 -0
- package/docs/custom-provider.md +9 -9
- package/docs/development.md +1 -1
- package/docs/docs.json +2 -0
- package/docs/extensions.md +40 -4
- package/docs/index.md +2 -0
- package/docs/models.md +10 -10
- package/docs/packages.md +1 -1
- package/docs/prompt-templates.md +9 -2
- package/docs/providers.md +18 -5
- package/docs/quickstart.md +1 -0
- package/docs/rpc.md +3 -2
- package/docs/sdk.md +47 -0
- package/docs/security.md +58 -0
- package/docs/session-format.md +2 -2
- package/docs/sessions.md +8 -0
- package/docs/settings.md +21 -4
- package/docs/skills.md +1 -1
- package/docs/terminal-setup.md +44 -2
- package/docs/themes.md +1 -1
- package/docs/tmux.md +4 -2
- package/docs/tui.md +14 -5
- package/docs/usage.md +17 -3
- package/docs/workflows.md +127 -15
- package/examples/README.md +1 -1
- package/examples/extensions/README.md +8 -5
- package/examples/extensions/bash-spawn-hook.ts +1 -1
- package/examples/extensions/built-in-tool-renderer.ts +1 -1
- package/examples/extensions/claude-rules.ts +1 -1
- package/examples/extensions/commands.ts +1 -1
- package/examples/extensions/custom-header.ts +1 -1
- package/examples/extensions/custom-provider-anthropic/index.ts +3 -3
- package/examples/extensions/custom-provider-anthropic/package-lock.json +4 -4
- package/examples/extensions/custom-provider-anthropic/package.json +6 -6
- package/examples/extensions/custom-provider-gitlab-duo/index.ts +55 -4
- package/examples/extensions/custom-provider-gitlab-duo/package.json +3 -3
- package/examples/extensions/doom-overlay/README.md +1 -1
- package/examples/extensions/doom-overlay/index.ts +2 -2
- package/examples/extensions/git-merge-and-resolve.ts +115 -0
- package/examples/extensions/gondolin/index.ts +523 -0
- package/examples/extensions/gondolin/package-lock.json +185 -0
- package/examples/extensions/gondolin/package.json +19 -0
- package/examples/extensions/handoff.ts +1 -1
- package/examples/extensions/hidden-thinking-label.ts +1 -1
- package/examples/extensions/inline-bash.ts +2 -2
- package/examples/extensions/input-transform-streaming.ts +39 -0
- package/examples/extensions/input-transform.ts +3 -3
- package/examples/extensions/interactive-shell.ts +2 -2
- package/examples/extensions/mac-system-theme.ts +2 -2
- package/examples/extensions/minimal-mode.ts +1 -1
- package/examples/extensions/modal-editor.ts +1 -1
- package/examples/extensions/model-status.ts +1 -1
- package/examples/extensions/overlay-qa-tests.ts +198 -179
- package/examples/extensions/overlay-test.ts +1 -1
- package/examples/extensions/pirate.ts +1 -1
- package/examples/extensions/preset.ts +14 -12
- package/examples/extensions/project-trust.ts +64 -0
- package/examples/extensions/prompt-customizer.ts +1 -1
- package/examples/extensions/qna.ts +1 -1
- package/examples/extensions/question.ts +1 -1
- package/examples/extensions/questionnaire.ts +1 -1
- package/examples/extensions/rainbow-editor.ts +1 -1
- package/examples/extensions/sandbox/index.ts +16 -14
- package/examples/extensions/sandbox/package-lock.json +90 -90
- package/examples/extensions/sandbox/package.json +17 -17
- package/examples/extensions/snake.ts +1 -1
- package/examples/extensions/space-invaders.ts +1 -1
- package/examples/extensions/ssh.ts +2 -2
- package/examples/extensions/subagent/README.md +13 -13
- package/examples/extensions/subagent/agents.ts +4 -2
- package/examples/extensions/subagent/index.ts +6 -6
- package/examples/extensions/summarize.ts +1 -1
- package/examples/extensions/tic-tac-toe.ts +1 -1
- package/examples/extensions/titlebar-spinner.ts +1 -1
- package/examples/extensions/todo.ts +1 -1
- package/examples/extensions/tool-override.ts +1 -1
- package/examples/extensions/tools.ts +6 -1
- package/examples/extensions/with-deps/package-lock.json +4 -4
- package/examples/extensions/with-deps/package.json +7 -7
- package/examples/extensions/working-indicator.ts +4 -4
- package/examples/extensions/working-message-test.ts +1 -1
- package/examples/sdk/01-minimal.ts +1 -1
- package/examples/sdk/03-custom-prompt.ts +1 -1
- package/examples/sdk/04-skills.ts +1 -1
- package/examples/sdk/06-extensions.ts +2 -2
- package/examples/sdk/08-prompt-templates.ts +1 -1
- package/examples/sdk/09-api-keys-and-oauth.ts +2 -2
- package/examples/sdk/README.md +2 -2
- package/package.json +4 -4
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import * as fs from "node:fs";
|
|
6
6
|
import * as os from "node:os";
|
|
7
7
|
import * as path from "node:path";
|
|
8
|
+
import chalk from "chalk";
|
|
8
9
|
import { getProviders, } from "@earendil-works/pi-ai";
|
|
9
10
|
import { CombinedAutocompleteProvider, Container, fuzzyFilter, getCapabilities, hyperlink, Loader, Markdown, matchesKey, ProcessTerminal, Spacer, setKeybindings, Text, TruncatedText, TUI, visibleWidth, } from "@earendil-works/pi-tui";
|
|
10
11
|
import { spawn, spawnSync } from "child_process";
|
|
@@ -23,7 +24,7 @@ import { formatMissingSessionCwdPrompt, MissingSessionCwdError, } from "../../co
|
|
|
23
24
|
import { SessionManager, } from "../../core/session-manager.js";
|
|
24
25
|
import { BUILTIN_SLASH_COMMANDS } from "../../core/slash-commands.js";
|
|
25
26
|
import { isInstallTelemetryEnabled } from "../../core/telemetry.js";
|
|
26
|
-
import { getChangelogPath, getEntriesForVersion, getNewEntries, parseChangelog, } from "../../utils/changelog.js";
|
|
27
|
+
import { getChangelogPath, getEntriesForVersion, getNewEntries, normalizeChangelogLinks, parseChangelog, } from "../../utils/changelog.js";
|
|
27
28
|
import { copyToClipboard } from "../../utils/clipboard.js";
|
|
28
29
|
import { combineQueuedMessagesForEditor, openExternalEditorForText, pasteClipboardImageToEditor, } from "./chat-input-actions.js";
|
|
29
30
|
import { parseGitUrl } from "../../utils/git.js";
|
|
@@ -63,6 +64,8 @@ import { SettingsSelectorComponent } from "./components/settings-selector.js";
|
|
|
63
64
|
import { SkillInvocationMessageComponent } from "./components/skill-invocation-message.js";
|
|
64
65
|
import { ToolExecutionComponent } from "./components/tool-execution.js";
|
|
65
66
|
import { TreeSelectorComponent } from "./components/tree-selector.js";
|
|
67
|
+
import { TrustSelectorComponent } from "./components/trust-selector.js";
|
|
68
|
+
import { hasProjectConfigDir, ProjectTrustStore } from "../../core/trust-manager.js";
|
|
66
69
|
import { UserMessageComponent } from "./components/user-message.js";
|
|
67
70
|
import { UserMessageSelectorComponent } from "./components/user-message-selector.js";
|
|
68
71
|
import { getAvailableThemes, getAvailableThemesWithPaths, getEditorTheme, getMarkdownTheme, getThemeByName, initTheme, onThemeChange, setRegisteredThemes, setTheme, setThemeInstance, stopThemeWatcher, Theme, theme, } from "./theme/theme.js";
|
|
@@ -106,6 +109,27 @@ function isUnknownModel(model) {
|
|
|
106
109
|
model.id === "unknown" &&
|
|
107
110
|
model.api === "unknown");
|
|
108
111
|
}
|
|
112
|
+
function quoteIfNeeded(value) {
|
|
113
|
+
if (value.length > 0 && !/[^a-zA-Z0-9_\-./~:@]/.test(value)) {
|
|
114
|
+
return value;
|
|
115
|
+
}
|
|
116
|
+
return `'${value.replace(/'/g, `'\\''`)}'`;
|
|
117
|
+
}
|
|
118
|
+
export function formatResumeCommand(sessionManager) {
|
|
119
|
+
if (!process.stdout.isTTY)
|
|
120
|
+
return undefined;
|
|
121
|
+
if (!sessionManager.isPersisted())
|
|
122
|
+
return undefined;
|
|
123
|
+
const sessionFile = sessionManager.getSessionFile();
|
|
124
|
+
if (!sessionFile || !fs.existsSync(sessionFile))
|
|
125
|
+
return undefined;
|
|
126
|
+
const args = [APP_NAME];
|
|
127
|
+
if (!sessionManager.usesDefaultSessionDir()) {
|
|
128
|
+
args.push("--session-dir", quoteIfNeeded(sessionManager.getSessionDir()));
|
|
129
|
+
}
|
|
130
|
+
args.push("--session", sessionManager.getSessionId());
|
|
131
|
+
return args.join(" ");
|
|
132
|
+
}
|
|
109
133
|
function hasDefaultModelProvider(providerId) {
|
|
110
134
|
return providerId in defaultModelPerProvider;
|
|
111
135
|
}
|
|
@@ -137,6 +161,7 @@ export class InteractiveMode {
|
|
|
137
161
|
constructor(runtimeHost, options = {}) {
|
|
138
162
|
this.autocompleteProviderWrappers = [];
|
|
139
163
|
this.isInitialized = false;
|
|
164
|
+
this.pendingUserInputs = [];
|
|
140
165
|
this.loadingAnimation = undefined;
|
|
141
166
|
this.workingMessage = undefined;
|
|
142
167
|
this.workingVisible = true;
|
|
@@ -200,6 +225,7 @@ export class InteractiveMode {
|
|
|
200
225
|
*/
|
|
201
226
|
this.isShuttingDown = false;
|
|
202
227
|
this.options = options;
|
|
228
|
+
this.autoTrustOnReloadCwd = options.autoTrustOnReloadCwd;
|
|
203
229
|
this.runtimeHost = runtimeHost;
|
|
204
230
|
this.runtimeHost.setBeforeSessionInvalidate(() => {
|
|
205
231
|
this.resetExtensionUI();
|
|
@@ -639,7 +665,7 @@ export class InteractiveMode {
|
|
|
639
665
|
if (currentEntries.length > 0) {
|
|
640
666
|
this.settingsManager.setLastChangelogVersion(VERSION);
|
|
641
667
|
this.reportInstallTelemetry(VERSION);
|
|
642
|
-
return currentEntries.map((e) => e.content).join("\n\n");
|
|
668
|
+
return currentEntries.map((e) => normalizeChangelogLinks(e.content, e)).join("\n\n");
|
|
643
669
|
}
|
|
644
670
|
return undefined;
|
|
645
671
|
}
|
|
@@ -1236,6 +1262,7 @@ export class InteractiveMode {
|
|
|
1236
1262
|
const uiContext = this.createExtensionUIContext();
|
|
1237
1263
|
await this.session.bindExtensions({
|
|
1238
1264
|
uiContext,
|
|
1265
|
+
mode: "tui",
|
|
1239
1266
|
commandContextActions: {
|
|
1240
1267
|
waitForIdle: () => this.session.agent.waitForIdle(),
|
|
1241
1268
|
newSession: async (options) => {
|
|
@@ -1372,12 +1399,14 @@ export class InteractiveMode {
|
|
|
1372
1399
|
// Create a context for shortcut handlers
|
|
1373
1400
|
const createContext = () => ({
|
|
1374
1401
|
ui: this.createExtensionUIContext(),
|
|
1402
|
+
mode: "tui",
|
|
1375
1403
|
hasUI: true,
|
|
1376
1404
|
cwd: this.sessionManager.getCwd(),
|
|
1377
1405
|
sessionManager: this.sessionManager,
|
|
1378
1406
|
modelRegistry: this.session.modelRegistry,
|
|
1379
1407
|
model: this.session.model,
|
|
1380
1408
|
isIdle: () => !this.session.isStreaming,
|
|
1409
|
+
isProjectTrusted: () => this.session.settingsManager.isProjectTrusted(),
|
|
1381
1410
|
signal: this.session.agent.signal,
|
|
1382
1411
|
abort: () => this.session.abort(),
|
|
1383
1412
|
hasPendingMessages: () => this.session.pendingMessageCount > 0,
|
|
@@ -1679,6 +1708,20 @@ export class InteractiveMode {
|
|
|
1679
1708
|
}
|
|
1680
1709
|
this.extensionTerminalInputUnsubscribers.clear();
|
|
1681
1710
|
}
|
|
1711
|
+
createProjectTrustContext(cwd) {
|
|
1712
|
+
const ui = this.createExtensionUIContext();
|
|
1713
|
+
return {
|
|
1714
|
+
cwd,
|
|
1715
|
+
mode: "tui",
|
|
1716
|
+
hasUI: true,
|
|
1717
|
+
ui: {
|
|
1718
|
+
select: ui.select,
|
|
1719
|
+
confirm: ui.confirm,
|
|
1720
|
+
input: ui.input,
|
|
1721
|
+
notify: ui.notify,
|
|
1722
|
+
},
|
|
1723
|
+
};
|
|
1724
|
+
}
|
|
1682
1725
|
/**
|
|
1683
1726
|
* Create the ExtensionUIContext for extensions.
|
|
1684
1727
|
*/
|
|
@@ -2233,6 +2276,11 @@ export class InteractiveMode {
|
|
|
2233
2276
|
this.editor.setText("");
|
|
2234
2277
|
return;
|
|
2235
2278
|
}
|
|
2279
|
+
if (text === "/trust") {
|
|
2280
|
+
this.showTrustSelector();
|
|
2281
|
+
this.editor.setText("");
|
|
2282
|
+
return;
|
|
2283
|
+
}
|
|
2236
2284
|
if (text === "/login") {
|
|
2237
2285
|
this.showOAuthSelector("login");
|
|
2238
2286
|
this.editor.setText("");
|
|
@@ -2334,6 +2382,9 @@ export class InteractiveMode {
|
|
|
2334
2382
|
if (this.onInputCallback) {
|
|
2335
2383
|
this.onInputCallback(text);
|
|
2336
2384
|
}
|
|
2385
|
+
else {
|
|
2386
|
+
this.pendingUserInputs.push(text);
|
|
2387
|
+
}
|
|
2337
2388
|
this.editor.addToHistory?.(text);
|
|
2338
2389
|
};
|
|
2339
2390
|
}
|
|
@@ -2863,6 +2914,10 @@ export class InteractiveMode {
|
|
|
2863
2914
|
}
|
|
2864
2915
|
}
|
|
2865
2916
|
async getUserInput() {
|
|
2917
|
+
const queuedInput = this.pendingUserInputs.shift();
|
|
2918
|
+
if (queuedInput !== undefined) {
|
|
2919
|
+
return queuedInput;
|
|
2920
|
+
}
|
|
2866
2921
|
return new Promise((resolve) => {
|
|
2867
2922
|
this.onInputCallback = (text) => {
|
|
2868
2923
|
this.onInputCallback = undefined;
|
|
@@ -2892,16 +2947,28 @@ export class InteractiveMode {
|
|
|
2892
2947
|
// Only called when editor is empty (enforced by CustomEditor)
|
|
2893
2948
|
void this.shutdown();
|
|
2894
2949
|
}
|
|
2895
|
-
async shutdown() {
|
|
2950
|
+
async shutdown(options) {
|
|
2896
2951
|
if (this.isShuttingDown)
|
|
2897
2952
|
return;
|
|
2898
2953
|
this.isShuttingDown = true;
|
|
2899
2954
|
this.unregisterSignalHandlers();
|
|
2955
|
+
if (options?.fromSignal) {
|
|
2956
|
+
await this.runtimeHost.dispose();
|
|
2957
|
+
// Drain any in-flight Kitty key release events before stopping.
|
|
2958
|
+
// This prevents escape sequences from leaking to the parent shell over slow SSH.
|
|
2959
|
+
await this.ui.terminal.drainInput(1000);
|
|
2960
|
+
this.stop();
|
|
2961
|
+
process.exit(0);
|
|
2962
|
+
}
|
|
2900
2963
|
// Drain any in-flight Kitty key release events before stopping.
|
|
2901
2964
|
// This prevents escape sequences from leaking to the parent shell over slow SSH.
|
|
2902
2965
|
await this.ui.terminal.drainInput(1000);
|
|
2903
2966
|
this.stop();
|
|
2904
2967
|
await this.runtimeHost.dispose();
|
|
2968
|
+
const resumeCommand = formatResumeCommand(this.sessionManager);
|
|
2969
|
+
if (resumeCommand) {
|
|
2970
|
+
process.stdout.write(`${chalk.dim("To resume this session:")} ${resumeCommand}\n`);
|
|
2971
|
+
}
|
|
2905
2972
|
process.exit(0);
|
|
2906
2973
|
}
|
|
2907
2974
|
emergencyTerminalExit() {
|
|
@@ -2960,11 +3027,8 @@ export class InteractiveMode {
|
|
|
2960
3027
|
}
|
|
2961
3028
|
for (const signal of signals) {
|
|
2962
3029
|
const handler = () => {
|
|
2963
|
-
if (signal === "SIGHUP") {
|
|
2964
|
-
this.emergencyTerminalExit();
|
|
2965
|
-
}
|
|
2966
3030
|
killTrackedDetachedChildren();
|
|
2967
|
-
void this.shutdown();
|
|
3031
|
+
void this.shutdown({ fromSignal: true });
|
|
2968
3032
|
};
|
|
2969
3033
|
process.prependListener(signal, handler);
|
|
2970
3034
|
this.signalCleanupHandlers.push(() => process.off(signal, handler));
|
|
@@ -3438,6 +3502,7 @@ export class InteractiveMode {
|
|
|
3438
3502
|
editorPaddingX: this.settingsManager.getEditorPaddingX(),
|
|
3439
3503
|
autocompleteMaxVisible: this.settingsManager.getAutocompleteMaxVisible(),
|
|
3440
3504
|
quietStartup: this.settingsManager.getQuietStartup(),
|
|
3505
|
+
defaultProjectTrust: this.settingsManager.getDefaultProjectTrust(),
|
|
3441
3506
|
clearOnShrink: this.settingsManager.getClearOnShrink(),
|
|
3442
3507
|
showTerminalProgress: this.settingsManager.getShowTerminalProgress(),
|
|
3443
3508
|
warnings: this.settingsManager.getWarnings(),
|
|
@@ -3526,6 +3591,9 @@ export class InteractiveMode {
|
|
|
3526
3591
|
onQuietStartupChange: (enabled) => {
|
|
3527
3592
|
this.settingsManager.setQuietStartup(enabled);
|
|
3528
3593
|
},
|
|
3594
|
+
onDefaultProjectTrustChange: (defaultProjectTrust) => {
|
|
3595
|
+
this.settingsManager.setDefaultProjectTrust(defaultProjectTrust);
|
|
3596
|
+
},
|
|
3529
3597
|
onDoubleEscapeActionChange: (action) => {
|
|
3530
3598
|
this.settingsManager.setDoubleEscapeAction(action);
|
|
3531
3599
|
},
|
|
@@ -3786,6 +3854,51 @@ export class InteractiveMode {
|
|
|
3786
3854
|
this.showError(error instanceof Error ? error.message : String(error));
|
|
3787
3855
|
}
|
|
3788
3856
|
}
|
|
3857
|
+
maybeSaveImplicitProjectTrustAfterReload() {
|
|
3858
|
+
const cwd = this.sessionManager.getCwd();
|
|
3859
|
+
if (this.autoTrustOnReloadCwd !== cwd) {
|
|
3860
|
+
return false;
|
|
3861
|
+
}
|
|
3862
|
+
if (!this.settingsManager.isProjectTrusted() || !hasProjectConfigDir(cwd)) {
|
|
3863
|
+
return false;
|
|
3864
|
+
}
|
|
3865
|
+
const trustStore = new ProjectTrustStore(this.runtimeHost.services.agentDir);
|
|
3866
|
+
try {
|
|
3867
|
+
if (trustStore.get(cwd) !== null) {
|
|
3868
|
+
this.autoTrustOnReloadCwd = undefined;
|
|
3869
|
+
return false;
|
|
3870
|
+
}
|
|
3871
|
+
trustStore.set(cwd, true);
|
|
3872
|
+
this.autoTrustOnReloadCwd = undefined;
|
|
3873
|
+
return true;
|
|
3874
|
+
}
|
|
3875
|
+
catch (error) {
|
|
3876
|
+
this.showWarning(`Could not save project trust after reload: ${error instanceof Error ? error.message : String(error)}`);
|
|
3877
|
+
return false;
|
|
3878
|
+
}
|
|
3879
|
+
}
|
|
3880
|
+
showTrustSelector() {
|
|
3881
|
+
const cwd = this.sessionManager.getCwd();
|
|
3882
|
+
const trustStore = new ProjectTrustStore(this.runtimeHost.services.agentDir);
|
|
3883
|
+
const savedDecision = trustStore.getEntry(cwd);
|
|
3884
|
+
this.showSelector((done) => {
|
|
3885
|
+
const selector = new TrustSelectorComponent({
|
|
3886
|
+
cwd,
|
|
3887
|
+
savedDecision,
|
|
3888
|
+
projectTrusted: this.settingsManager.isProjectTrusted(),
|
|
3889
|
+
onSelect: (selection) => {
|
|
3890
|
+
trustStore.setMany(selection.updates);
|
|
3891
|
+
done();
|
|
3892
|
+
this.showStatus(`Saved trust decision: ${selection.trusted ? "trusted" : "untrusted"}. Restart ${APP_NAME} for this to take effect.`);
|
|
3893
|
+
},
|
|
3894
|
+
onCancel: () => {
|
|
3895
|
+
done();
|
|
3896
|
+
this.ui.requestRender();
|
|
3897
|
+
},
|
|
3898
|
+
});
|
|
3899
|
+
return { component: selector, focus: selector };
|
|
3900
|
+
});
|
|
3901
|
+
}
|
|
3789
3902
|
showTreeSelector(initialSelectedId) {
|
|
3790
3903
|
const tree = this.sessionManager.getTree();
|
|
3791
3904
|
const realLeafId = this.sessionManager.getLeafId();
|
|
@@ -3886,7 +3999,9 @@ export class InteractiveMode {
|
|
|
3886
3999
|
}
|
|
3887
4000
|
showSessionSelector() {
|
|
3888
4001
|
this.showSelector((done) => {
|
|
3889
|
-
const selector = new SessionSelectorComponent((onProgress) => SessionManager.list(this.sessionManager.getCwd(), this.sessionManager.getSessionDir(), onProgress),
|
|
4002
|
+
const selector = new SessionSelectorComponent((onProgress) => SessionManager.list(this.sessionManager.getCwd(), this.sessionManager.getSessionDir(), onProgress), (onProgress) => this.sessionManager.usesDefaultSessionDir()
|
|
4003
|
+
? SessionManager.listAll(onProgress)
|
|
4004
|
+
: SessionManager.listAll(this.sessionManager.getSessionDir(), onProgress), async (sessionPath) => {
|
|
3890
4005
|
done();
|
|
3891
4006
|
await this.handleResumeSession(sessionPath);
|
|
3892
4007
|
}, () => {
|
|
@@ -3917,6 +4032,7 @@ export class InteractiveMode {
|
|
|
3917
4032
|
try {
|
|
3918
4033
|
const result = await this.runtimeHost.switchSession(sessionPath, {
|
|
3919
4034
|
withSession: options?.withSession,
|
|
4035
|
+
projectTrustContextFactory: (cwd) => this.createProjectTrustContext(cwd),
|
|
3920
4036
|
});
|
|
3921
4037
|
if (result.cancelled) {
|
|
3922
4038
|
return result;
|
|
@@ -3935,6 +4051,7 @@ export class InteractiveMode {
|
|
|
3935
4051
|
const result = await this.runtimeHost.switchSession(sessionPath, {
|
|
3936
4052
|
cwdOverride: selectedCwd,
|
|
3937
4053
|
withSession: options?.withSession,
|
|
4054
|
+
projectTrustContextFactory: (cwd) => this.createProjectTrustContext(cwd),
|
|
3938
4055
|
});
|
|
3939
4056
|
if (result.cancelled) {
|
|
3940
4057
|
return result;
|
|
@@ -4341,10 +4458,14 @@ export class InteractiveMode {
|
|
|
4341
4458
|
this.setupExtensionShortcuts(runner);
|
|
4342
4459
|
this.rebuildChatFromMessages();
|
|
4343
4460
|
dismissReloadBox(this.editor);
|
|
4461
|
+
const savedImplicitProjectTrust = this.maybeSaveImplicitProjectTrustAfterReload();
|
|
4344
4462
|
this.showLoadedResources({
|
|
4345
4463
|
force: false,
|
|
4346
4464
|
showDiagnosticsWhenQuiet: true,
|
|
4347
4465
|
});
|
|
4466
|
+
if (savedImplicitProjectTrust) {
|
|
4467
|
+
this.showStatus("Saved project trust for future sessions");
|
|
4468
|
+
}
|
|
4348
4469
|
const modelsJsonError = this.session.modelRegistry.getError();
|
|
4349
4470
|
if (modelsJsonError) {
|
|
4350
4471
|
this.showError(`models.json error: ${modelsJsonError}`);
|
|
@@ -4606,7 +4727,7 @@ export class InteractiveMode {
|
|
|
4606
4727
|
const changelogMarkdown = allEntries.length > 0
|
|
4607
4728
|
? allEntries
|
|
4608
4729
|
.reverse()
|
|
4609
|
-
.map((e) => e.content)
|
|
4730
|
+
.map((e) => normalizeChangelogLinks(e.content, e))
|
|
4610
4731
|
.join("\n\n")
|
|
4611
4732
|
: "No changelog entries found.";
|
|
4612
4733
|
this.chatContainer.addChild(new Spacer(1));
|