@bastani/atomic 0.9.24-alpha.1 → 0.9.25-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +54 -0
- package/dist/builtin/intercom/index.bundle.mjs +5 -0
- package/dist/builtin/intercom/package.json +2 -2
- package/dist/builtin/mcp/CHANGELOG.md +17 -0
- package/dist/builtin/mcp/index.bundle.mjs +219 -71
- package/dist/builtin/mcp/package.json +6 -2
- package/dist/builtin/subagents/package.json +3 -3
- package/dist/builtin/subagents/src/extension/index.bundle.mjs +1 -0
- package/dist/builtin/web-access/index.bundle.mjs +7 -6
- package/dist/builtin/web-access/package.json +2 -2
- package/dist/builtin/workflows/CHANGELOG.md +17 -0
- package/dist/builtin/workflows/package.json +2 -2
- package/dist/builtin/workflows/skills/prompt-engineer/SKILL.md +1 -0
- package/dist/builtin/workflows/skills/prompt-engineer/references/gpt_6_1_sol.md +66 -0
- package/dist/builtin/workflows/src/extension/index.bundle.mjs +1 -0
- package/dist/cli/startup-ui.d.ts +3 -4
- package/dist/cli/startup-ui.d.ts.map +1 -1
- package/dist/cli/startup-ui.js +3 -4
- package/dist/cli/startup-ui.js.map +1 -1
- package/dist/config.d.ts +3 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +17 -0
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session-events.d.ts.map +1 -1
- package/dist/core/agent-session-events.js +5 -0
- package/dist/core/agent-session-events.js.map +1 -1
- package/dist/core/agent-session-export.d.ts.map +1 -1
- package/dist/core/agent-session-export.js +3 -0
- package/dist/core/agent-session-export.js.map +1 -1
- package/dist/core/agent-session-extension-bindings.d.ts.map +1 -1
- package/dist/core/agent-session-extension-bindings.js +4 -0
- package/dist/core/agent-session-extension-bindings.js.map +1 -1
- package/dist/core/agent-session-methods.d.ts +2 -1
- 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-nested-tools.d.ts +10 -0
- package/dist/core/agent-session-nested-tools.d.ts.map +1 -0
- package/dist/core/agent-session-nested-tools.js +76 -0
- package/dist/core/agent-session-nested-tools.js.map +1 -0
- package/dist/core/agent-session-runtime-auth.js +3 -1
- package/dist/core/agent-session-runtime-auth.js.map +1 -1
- package/dist/core/agent-session-state.d.ts +2 -0
- package/dist/core/agent-session-state.d.ts.map +1 -1
- package/dist/core/agent-session-state.js +11 -11
- package/dist/core/agent-session-state.js.map +1 -1
- package/dist/core/agent-session-tool-hooks.d.ts.map +1 -1
- package/dist/core/agent-session-tool-hooks.js +18 -3
- package/dist/core/agent-session-tool-hooks.js.map +1 -1
- package/dist/core/agent-session-tool-registry.d.ts.map +1 -1
- package/dist/core/agent-session-tool-registry.js +15 -3
- package/dist/core/agent-session-tool-registry.js.map +1 -1
- package/dist/core/agent-session-types.d.ts +6 -2
- package/dist/core/agent-session-types.d.ts.map +1 -1
- package/dist/core/agent-session-types.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 +18 -18
- package/dist/core/compaction/utils.js.map +1 -1
- package/dist/core/execution-model-router.d.ts.map +1 -1
- package/dist/core/execution-model-router.js +24 -8
- package/dist/core/execution-model-router.js.map +1 -1
- package/dist/core/export-html/template.js +12 -0
- package/dist/core/extensions/agent-events.d.ts +3 -0
- package/dist/core/extensions/agent-events.d.ts.map +1 -1
- package/dist/core/extensions/agent-events.js.map +1 -1
- package/dist/core/extensions/api-types.d.ts +2 -0
- 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/context-types.d.ts +9 -0
- package/dist/core/extensions/context-types.d.ts.map +1 -1
- package/dist/core/extensions/context-types.js.map +1 -1
- package/dist/core/extensions/event-results.d.ts +3 -0
- package/dist/core/extensions/event-results.d.ts.map +1 -1
- package/dist/core/extensions/event-results.js.map +1 -1
- package/dist/core/extensions/index.d.ts +2 -0
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/loader-api.d.ts.map +1 -1
- package/dist/core/extensions/loader-api.js +4 -0
- 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 +3 -5
- package/dist/core/extensions/loader-core.js.map +1 -1
- package/dist/core/extensions/loader-host-modules.d.ts.map +1 -1
- package/dist/core/extensions/loader-host-modules.js +7 -1
- package/dist/core/extensions/loader-host-modules.js.map +1 -1
- package/dist/core/extensions/loader-runtime.d.ts.map +1 -1
- package/dist/core/extensions/loader-runtime.js +3 -0
- package/dist/core/extensions/loader-runtime.js.map +1 -1
- package/dist/core/extensions/loader-virtual-modules.d.ts.map +1 -1
- package/dist/core/extensions/loader-virtual-modules.js +4 -0
- package/dist/core/extensions/loader-virtual-modules.js.map +1 -1
- package/dist/core/extensions/provider-types.d.ts +2 -0
- package/dist/core/extensions/provider-types.d.ts.map +1 -1
- package/dist/core/extensions/provider-types.js.map +1 -1
- package/dist/core/extensions/runner-events.d.ts.map +1 -1
- package/dist/core/extensions/runner-events.js +16 -1
- package/dist/core/extensions/runner-events.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +5 -0
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +34 -0
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/runtime-types.d.ts +5 -0
- package/dist/core/extensions/runtime-types.d.ts.map +1 -1
- package/dist/core/extensions/runtime-types.js.map +1 -1
- package/dist/core/extensions/tool-events.d.ts +4 -0
- package/dist/core/extensions/tool-events.d.ts.map +1 -1
- package/dist/core/extensions/tool-events.js.map +1 -1
- package/dist/core/extensions/tool-types.d.ts +34 -3
- package/dist/core/extensions/tool-types.d.ts.map +1 -1
- package/dist/core/extensions/tool-types.js.map +1 -1
- package/dist/core/extensions/wrapper.d.ts.map +1 -1
- package/dist/core/extensions/wrapper.js +14 -2
- package/dist/core/extensions/wrapper.js.map +1 -1
- package/dist/core/fast-model-routing-transport.d.ts.map +1 -1
- package/dist/core/fast-model-routing-transport.js +2 -1
- package/dist/core/fast-model-routing-transport.js.map +1 -1
- package/dist/core/fast-model-routing.d.ts +1 -2
- package/dist/core/fast-model-routing.d.ts.map +1 -1
- package/dist/core/fast-model-routing.js +13 -11
- package/dist/core/fast-model-routing.js.map +1 -1
- package/dist/core/fast-model-variants.d.ts +4 -1
- package/dist/core/fast-model-variants.d.ts.map +1 -1
- package/dist/core/fast-model-variants.js +42 -17
- package/dist/core/fast-model-variants.js.map +1 -1
- package/dist/core/model-registry.d.ts +4 -1
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +9 -0
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver-defaults.js +1 -1
- package/dist/core/model-resolver-defaults.js.map +1 -1
- package/dist/core/model-routing-candidates.d.ts +4 -0
- package/dist/core/model-routing-candidates.d.ts.map +1 -1
- package/dist/core/model-routing-candidates.js +8 -3
- package/dist/core/model-routing-candidates.js.map +1 -1
- package/dist/core/model-routing-evals.d.ts.map +1 -1
- package/dist/core/model-routing-evals.js +4 -5
- package/dist/core/model-routing-evals.js.map +1 -1
- package/dist/core/model-runtime.d.ts +3 -2
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +19 -25
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/nested-tool-calls.d.ts +64 -0
- package/dist/core/nested-tool-calls.d.ts.map +1 -0
- package/dist/core/nested-tool-calls.js +132 -0
- package/dist/core/nested-tool-calls.js.map +1 -0
- package/dist/core/package-manager-resolver.d.ts.map +1 -1
- package/dist/core/package-manager-resolver.js +21 -3
- package/dist/core/package-manager-resolver.js.map +1 -1
- package/dist/core/package-manager-resource-accumulator.d.ts.map +1 -1
- package/dist/core/package-manager-resource-accumulator.js +2 -0
- package/dist/core/package-manager-resource-accumulator.js.map +1 -1
- package/dist/core/package-manager-types.d.ts +2 -0
- package/dist/core/package-manager-types.d.ts.map +1 -1
- package/dist/core/package-manager-types.js.map +1 -1
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +1 -0
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/resource-loader-core.d.ts.map +1 -1
- package/dist/core/resource-loader-core.js +12 -6
- package/dist/core/resource-loader-core.js.map +1 -1
- package/dist/core/resource-loader-extensions.d.ts +1 -0
- package/dist/core/resource-loader-extensions.d.ts.map +1 -1
- package/dist/core/resource-loader-extensions.js +64 -4
- package/dist/core/resource-loader-extensions.js.map +1 -1
- package/dist/core/resource-loader-paths.d.ts.map +1 -1
- package/dist/core/resource-loader-paths.js +2 -1
- package/dist/core/resource-loader-paths.js.map +1 -1
- package/dist/core/resource-loader-reload.d.ts.map +1 -1
- package/dist/core/resource-loader-reload.js +5 -4
- package/dist/core/resource-loader-reload.js.map +1 -1
- package/dist/core/resource-loader-source-info.d.ts.map +1 -1
- package/dist/core/resource-loader-source-info.js +7 -5
- package/dist/core/resource-loader-source-info.js.map +1 -1
- package/dist/core/sdk-types.d.ts +1 -1
- package/dist/core/sdk-types.js.map +1 -1
- package/dist/core/session-manager-core.d.ts +2 -0
- package/dist/core/session-manager-core.d.ts.map +1 -1
- package/dist/core/session-manager-core.js +5 -1
- package/dist/core/session-manager-core.js.map +1 -1
- package/dist/core/session-manager-entries.d.ts +1 -1
- package/dist/core/session-manager-entries.d.ts.map +1 -1
- package/dist/core/session-manager-entries.js.map +1 -1
- 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 +27 -1
- package/dist/core/settings-manager-basic-accessors.js.map +1 -1
- package/dist/core/settings-manager-core.d.ts +2 -0
- package/dist/core/settings-manager-core.d.ts.map +1 -1
- package/dist/core/settings-manager-core.js +4 -0
- package/dist/core/settings-manager-core.js.map +1 -1
- package/dist/core/settings-manager-ui-accessors.d.ts +3 -1
- package/dist/core/settings-manager-ui-accessors.d.ts.map +1 -1
- package/dist/core/settings-manager-ui-accessors.js +13 -0
- package/dist/core/settings-manager-ui-accessors.js.map +1 -1
- package/dist/core/settings-manager.d.ts +1 -1
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/settings-merge.d.ts +1 -0
- package/dist/core/settings-merge.d.ts.map +1 -1
- package/dist/core/settings-merge.js +30 -1
- package/dist/core/settings-merge.js.map +1 -1
- package/dist/core/settings-types.d.ts +8 -1
- package/dist/core/settings-types.d.ts.map +1 -1
- package/dist/core/settings-types.js.map +1 -1
- package/dist/core/source-info.d.ts +3 -0
- package/dist/core/source-info.d.ts.map +1 -1
- package/dist/core/source-info.js +11 -0
- package/dist/core/source-info.js.map +1 -1
- package/dist/core/tool-loadout.d.ts +6 -0
- package/dist/core/tool-loadout.d.ts.map +1 -0
- package/dist/core/tool-loadout.js +63 -0
- package/dist/core/tool-loadout.js.map +1 -0
- package/dist/core/tools/ask-user-question/ask-user-question.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/ask-user-question.js +1 -0
- package/dist/core/tools/ask-user-question/ask-user-question.js.map +1 -1
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +31 -11
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/output-accumulator.d.ts +4 -0
- package/dist/core/tools/output-accumulator.d.ts.map +1 -1
- package/dist/core/tools/output-accumulator.js +32 -0
- package/dist/core/tools/output-accumulator.js.map +1 -1
- package/dist/core/tools/powershell.d.ts +27 -21
- package/dist/core/tools/powershell.d.ts.map +1 -1
- package/dist/core/tools/render-utils.d.ts +4 -0
- package/dist/core/tools/render-utils.d.ts.map +1 -1
- package/dist/core/tools/render-utils.js +19 -0
- package/dist/core/tools/render-utils.js.map +1 -1
- package/dist/core/tools/tool-concurrency.d.ts +1 -1
- package/dist/core/tools/tool-concurrency.d.ts.map +1 -1
- package/dist/core/tools/tool-concurrency.js +28 -3
- package/dist/core/tools/tool-concurrency.js.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.d.ts +1 -1
- package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.js +4 -1
- package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
- package/dist/core/usage-totals.d.ts +2 -0
- package/dist/core/usage-totals.d.ts.map +1 -1
- package/dist/core/usage-totals.js +23 -0
- package/dist/core/usage-totals.js.map +1 -1
- package/dist/extensions/codemode/execute.d.ts +10 -0
- package/dist/extensions/codemode/execute.d.ts.map +1 -0
- package/dist/extensions/codemode/execute.js +313 -0
- package/dist/extensions/codemode/execute.js.map +1 -0
- package/dist/extensions/codemode/index.d.ts +11 -0
- package/dist/extensions/codemode/index.d.ts.map +1 -0
- package/dist/extensions/codemode/index.js +14 -0
- package/dist/extensions/codemode/index.js.map +1 -0
- package/dist/extensions/codemode/renderer.d.ts +4 -0
- package/dist/extensions/codemode/renderer.d.ts.map +1 -0
- package/dist/extensions/codemode/renderer.js +78 -0
- package/dist/extensions/codemode/renderer.js.map +1 -0
- package/dist/extensions/codemode/tool.d.ts +51 -0
- package/dist/extensions/codemode/tool.d.ts.map +1 -0
- package/dist/extensions/codemode/tool.js +134 -0
- package/dist/extensions/codemode/tool.js.map +1 -0
- package/dist/extensions/codemode/worker.d.ts +2 -0
- package/dist/extensions/codemode/worker.d.ts.map +1 -0
- package/dist/extensions/codemode/worker.js +2 -0
- package/dist/extensions/codemode/worker.js.map +1 -0
- package/dist/extensions/index.d.ts.map +1 -1
- package/dist/extensions/index.js +5 -1
- package/dist/extensions/index.js.map +1 -1
- package/dist/extensions/llama/provider.d.ts.map +1 -1
- package/dist/extensions/llama/provider.js +31 -10
- package/dist/extensions/llama/provider.js.map +1 -1
- package/dist/extensions/tool-search/index.d.ts +5 -0
- package/dist/extensions/tool-search/index.d.ts.map +1 -0
- package/dist/extensions/tool-search/index.js +6 -0
- package/dist/extensions/tool-search/index.js.map +1 -0
- package/dist/extensions/tool-search/tool.d.ts +41 -0
- package/dist/extensions/tool-search/tool.d.ts.map +1 -0
- package/dist/extensions/tool-search/tool.js +161 -0
- package/dist/extensions/tool-search/tool.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/modes/interactive/components/chat-message-renderer.d.ts +1 -0
- package/dist/modes/interactive/components/chat-message-renderer.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-message-renderer.js +2 -0
- package/dist/modes/interactive/components/chat-message-renderer.js.map +1 -1
- package/dist/modes/interactive/components/config-selector-list.d.ts.map +1 -1
- package/dist/modes/interactive/components/config-selector-list.js +9 -1
- package/dist/modes/interactive/components/config-selector-list.js.map +1 -1
- package/dist/modes/interactive/components/config-selector-project-scope.d.ts.map +1 -1
- package/dist/modes/interactive/components/config-selector-project-scope.js +4 -1
- package/dist/modes/interactive/components/config-selector-project-scope.js.map +1 -1
- package/dist/modes/interactive/components/first-time-setup.d.ts +2 -2
- package/dist/modes/interactive/components/first-time-setup.d.ts.map +1 -1
- package/dist/modes/interactive/components/first-time-setup.js +1 -0
- package/dist/modes/interactive/components/first-time-setup.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +42 -7
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector-handlers.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector-handlers.js +3 -0
- package/dist/modes/interactive/components/settings-selector-handlers.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 +13 -0
- package/dist/modes/interactive/components/settings-selector-items.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector-submenus.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector-submenus.js +3 -1
- package/dist/modes/interactive/components/settings-selector-submenus.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector-types.d.ts +3 -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/themed-text.d.ts +8 -0
- package/dist/modes/interactive/components/themed-text.d.ts.map +1 -0
- package/dist/modes/interactive/components/themed-text.js +14 -0
- package/dist/modes/interactive/components/themed-text.js.map +1 -0
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +5 -3
- package/dist/modes/interactive/components/tool-execution.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-mode-base.d.ts +2 -1
- package/dist/modes/interactive/interactive-mode-base.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-base.js +5 -0
- package/dist/modes/interactive/interactive-mode-base.js.map +1 -1
- package/dist/modes/interactive/interactive-resource-rendering.js +7 -10
- package/dist/modes/interactive/interactive-resource-rendering.js.map +1 -1
- package/dist/modes/interactive/interactive-selectors.js +5 -0
- package/dist/modes/interactive/interactive-selectors.js.map +1 -1
- package/dist/modes/interactive/interactive-session-runtime.js +1 -0
- package/dist/modes/interactive/interactive-session-runtime.js.map +1 -1
- package/dist/modes/interactive/interactive-startup.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-startup.js +8 -3
- package/dist/modes/interactive/interactive-startup.js.map +1 -1
- package/dist/modes/interactive/interactive-tui.d.ts +2 -1
- package/dist/modes/interactive/interactive-tui.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-tui.js +1 -0
- package/dist/modes/interactive/interactive-tui.js.map +1 -1
- package/dist/modes/interactive/theme/color-utils.d.ts.map +1 -1
- package/dist/modes/interactive/theme/color-utils.js +3 -0
- package/dist/modes/interactive/theme/color-utils.js.map +1 -1
- package/dist/modes/interactive/theme/export-colors.d.ts.map +1 -1
- package/dist/modes/interactive/theme/export-colors.js +4 -1
- package/dist/modes/interactive/theme/export-colors.js.map +1 -1
- package/dist/modes/interactive/theme/system-theme.d.ts +23 -0
- package/dist/modes/interactive/theme/system-theme.d.ts.map +1 -0
- package/dist/modes/interactive/theme/system-theme.js +462 -0
- package/dist/modes/interactive/theme/system-theme.js.map +1 -0
- package/dist/modes/interactive/theme/terminal-colors.d.ts +10 -0
- package/dist/modes/interactive/theme/terminal-colors.d.ts.map +1 -0
- package/dist/modes/interactive/theme/terminal-colors.js +36 -0
- package/dist/modes/interactive/theme/terminal-colors.js.map +1 -0
- package/dist/modes/interactive/theme/terminal-detection.d.ts +4 -6
- package/dist/modes/interactive/theme/terminal-detection.d.ts.map +1 -1
- package/dist/modes/interactive/theme/terminal-detection.js +12 -46
- package/dist/modes/interactive/theme/terminal-detection.js.map +1 -1
- package/dist/modes/interactive/theme/theme-class.d.ts +1 -0
- package/dist/modes/interactive/theme/theme-class.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme-class.js +2 -2
- package/dist/modes/interactive/theme/theme-class.js.map +1 -1
- package/dist/modes/interactive/theme/theme-controller.d.ts +16 -8
- package/dist/modes/interactive/theme/theme-controller.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme-controller.js +106 -64
- package/dist/modes/interactive/theme/theme-controller.js.map +1 -1
- package/dist/modes/interactive/theme/theme-loading.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme-loading.js +23 -2
- package/dist/modes/interactive/theme/theme-loading.js.map +1 -1
- package/dist/modes/interactive/theme/theme-schema.js +1 -1
- package/dist/modes/interactive/theme/theme-schema.js.map +1 -1
- package/dist/modes/interactive/theme/theme-schema.json +2 -2
- package/dist/modes/interactive/theme/theme.d.ts +2 -0
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +2 -0
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/modes/interactive-engine/engine-session-stats.d.ts +26 -0
- package/dist/modes/interactive-engine/engine-session-stats.d.ts.map +1 -0
- package/dist/modes/interactive-engine/engine-session-stats.js +71 -0
- package/dist/modes/interactive-engine/engine-session-stats.js.map +1 -0
- package/dist/modes/interactive-engine/extension-ui-bridge.d.ts +2 -0
- package/dist/modes/interactive-engine/extension-ui-bridge.d.ts.map +1 -1
- package/dist/modes/interactive-engine/extension-ui-bridge.js +4 -0
- package/dist/modes/interactive-engine/extension-ui-bridge.js.map +1 -1
- package/dist/modes/interactive-engine/isolated-runtime.d.ts +3 -0
- package/dist/modes/interactive-engine/isolated-runtime.d.ts.map +1 -1
- package/dist/modes/interactive-engine/isolated-runtime.js +27 -5
- package/dist/modes/interactive-engine/isolated-runtime.js.map +1 -1
- package/dist/modes/rpc/rpc-provider-auth.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-provider-auth.js +3 -1
- package/dist/modes/rpc/rpc-provider-auth.js.map +1 -1
- package/dist/package-manager-cli.d.ts.map +1 -1
- package/dist/package-manager-cli.js +8 -2
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +2 -1
- package/dist/utils/paths.js.map +1 -1
- package/dist/utils/shell.d.ts +1 -3
- package/dist/utils/shell.d.ts.map +1 -1
- package/dist/utils/shell.js +3 -30
- package/dist/utils/shell.js.map +1 -1
- package/docs/extensions/api-reference.md +5 -1
- package/docs/extensions/authoring.md +31 -1
- package/docs/extensions/events.md +3 -1
- package/docs/extensions.md +14 -0
- package/docs/models/evals.md +45 -2
- package/docs/models/reference.md +33 -2
- package/docs/models.md +1 -0
- package/docs/packages.md +2 -0
- package/docs/providers.md +34 -7
- package/docs/reference/cli.md +4 -0
- package/docs/rpc/protocol.md +10 -0
- package/docs/sdk/reference.md +5 -1
- package/docs/sdk/structured-decisions.md +2 -2
- package/docs/session-format.md +5 -0
- package/docs/settings.md +19 -5
- package/docs/skills.md +1 -1
- package/docs/themes/reference.md +2 -1
- package/docs/themes.md +4 -2
- package/docs/tools.md +39 -0
- package/npm-shrinkwrap.json +115 -113
- package/package.json +12 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-info.js","sourceRoot":"","sources":["../../src/core/source-info.ts"],"names":[],"mappings":"AAcA,MAAM,UAAU,gBAAgB,CAAC,IAAY,EAAE,QAAsB;IACpE,OAAO;QACN,IAAI;QACJ,MAAM,EAAE,QAAQ,CAAC,MAAM;QACvB,KAAK,EAAE,QAAQ,CAAC,KAAK;QACrB,MAAM,EAAE,QAAQ,CAAC,MAAM;QACvB,OAAO,EAAE,QAAQ,CAAC,OAAO;QACzB,mBAAmB,EAAE,QAAQ,CAAC,mBAAmB;KACjD,CAAC;AACH,CAAC;AAED,MAAM,UAAU,yBAAyB,CACxC,IAAY,EACZ,OAMC;IAED,OAAO;QACN,IAAI;QACJ,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,WAAW;QACnC,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,WAAW;QACrC,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,mBAAmB,EAAE,OAAO,CAAC,mBAAmB;KAChD,CAAC;AACH,CAAC","sourcesContent":["import type { PathMetadata, ResourceConfigurationOrigin } from \"./package-manager.ts\";\n\nexport type SourceScope = \"user\" | \"project\" | \"temporary\";\nexport type SourceOrigin = \"package\" | \"top-level\";\n\nexport interface SourceInfo {\n\tpath: string;\n\tsource: string;\n\tscope: SourceScope;\n\torigin: SourceOrigin;\n\tbaseDir?: string;\n\tconfigurationOrigin?: ResourceConfigurationOrigin;\n}\n\nexport function createSourceInfo(path: string, metadata: PathMetadata): SourceInfo {\n\treturn {\n\t\tpath,\n\t\tsource: metadata.source,\n\t\tscope: metadata.scope,\n\t\torigin: metadata.origin,\n\t\tbaseDir: metadata.baseDir,\n\t\tconfigurationOrigin: metadata.configurationOrigin,\n\t};\n}\n\nexport function createSyntheticSourceInfo(\n\tpath: string,\n\toptions: {\n\t\tsource: string;\n\t\tscope?: SourceScope;\n\t\torigin?: SourceOrigin;\n\t\tbaseDir?: string;\n\t\tconfigurationOrigin?: ResourceConfigurationOrigin;\n\t},\n): SourceInfo {\n\treturn {\n\t\tpath,\n\t\tsource: options.source,\n\t\tscope: options.scope ?? \"temporary\",\n\t\torigin: options.origin ?? \"top-level\",\n\t\tbaseDir: options.baseDir,\n\t\tconfigurationOrigin: options.configurationOrigin,\n\t};\n}\n"]}
|
|
1
|
+
{"version":3,"file":"source-info.js","sourceRoot":"","sources":["../../src/core/source-info.ts"],"names":[],"mappings":"AAcA,MAAM,CAAC,MAAM,mBAAmB,GAAG,UAAU,CAAC;AAE9C,MAAM,UAAU,sBAAsB,CAAC,IAAY;IAClD,IAAI,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC;QAAE,OAAO,SAAS,CAAC;IAC3D,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,WAAW,CAAC;IACtG,OAAO,SAAS,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,IAAY;IAC3C,OAAO,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;AACrE,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,IAAY,EAAE,QAAsB;IACpE,OAAO;QACN,IAAI;QACJ,MAAM,EAAE,QAAQ,CAAC,MAAM;QACvB,KAAK,EAAE,QAAQ,CAAC,KAAK;QACrB,MAAM,EAAE,QAAQ,CAAC,MAAM;QACvB,OAAO,EAAE,QAAQ,CAAC,OAAO;QACzB,mBAAmB,EAAE,QAAQ,CAAC,mBAAmB;KACjD,CAAC;AACH,CAAC;AAED,MAAM,UAAU,yBAAyB,CACxC,IAAY,EACZ,OAMC;IAED,OAAO;QACN,IAAI;QACJ,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,WAAW;QACnC,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,WAAW;QACrC,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,mBAAmB,EAAE,OAAO,CAAC,mBAAmB;KAChD,CAAC;AACH,CAAC","sourcesContent":["import type { PathMetadata, ResourceConfigurationOrigin } from \"./package-manager.ts\";\n\nexport type SourceScope = \"user\" | \"project\" | \"temporary\";\nexport type SourceOrigin = \"package\" | \"top-level\";\n\nexport interface SourceInfo {\n\tpath: string;\n\tsource: string;\n\tscope: SourceScope;\n\torigin: SourceOrigin;\n\tbaseDir?: string;\n\tconfigurationOrigin?: ResourceConfigurationOrigin;\n}\n\nexport const BUILTIN_PATH_PREFIX = \"builtin:\";\n\nexport function getSyntheticPathSource(path: string): string | undefined {\n\tif (path.startsWith(BUILTIN_PATH_PREFIX)) return \"builtin\";\n\tif (path.startsWith(\"<\") && path.endsWith(\">\")) return path.slice(1, -1).split(\":\")[0] || \"temporary\";\n\treturn undefined;\n}\n\nexport function isSyntheticPath(path: string): boolean {\n\treturn path.startsWith(BUILTIN_PATH_PREFIX) || path.startsWith(\"<\");\n}\n\nexport function createSourceInfo(path: string, metadata: PathMetadata): SourceInfo {\n\treturn {\n\t\tpath,\n\t\tsource: metadata.source,\n\t\tscope: metadata.scope,\n\t\torigin: metadata.origin,\n\t\tbaseDir: metadata.baseDir,\n\t\tconfigurationOrigin: metadata.configurationOrigin,\n\t};\n}\n\nexport function createSyntheticSourceInfo(\n\tpath: string,\n\toptions: {\n\t\tsource: string;\n\t\tscope?: SourceScope;\n\t\torigin?: SourceOrigin;\n\t\tbaseDir?: string;\n\t\tconfigurationOrigin?: ResourceConfigurationOrigin;\n\t},\n): SourceInfo {\n\treturn {\n\t\tpath,\n\t\tsource: options.source,\n\t\tscope: options.scope ?? \"temporary\",\n\t\torigin: options.origin ?? \"top-level\",\n\t\tbaseDir: options.baseDir,\n\t\tconfigurationOrigin: options.configurationOrigin,\n\t};\n}\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { AgentMessage, AgentTool } from "@earendil-works/pi-agent-core";
|
|
2
|
+
import type { AgentSessionInternalSurface as AgentSession } from "./agent-session-methods.ts";
|
|
3
|
+
export declare function applyToolLoadout(session: AgentSession, names: readonly string[]): AgentTool[];
|
|
4
|
+
/** Hide only request declarations. The transcript retains activation and branch history. */
|
|
5
|
+
export declare function projectToolLoadout(session: AgentSession, messages: AgentMessage[]): AgentMessage[];
|
|
6
|
+
//# sourceMappingURL=tool-loadout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-loadout.d.ts","sourceRoot":"","sources":["../../src/core/tool-loadout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC7E,OAAO,KAAK,EAAE,2BAA2B,IAAI,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAK9F,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,EAAE,CAsC7F;AAED,4FAA4F;AAC5F,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,YAAY,EAAE,CAclG"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { getCallableTools } from "./agent-session-nested-tools.js";
|
|
2
|
+
const hiddenDeclarations = new WeakMap();
|
|
3
|
+
export function applyToolLoadout(session, names) {
|
|
4
|
+
const tools = [...new Set(names)].flatMap((name) => {
|
|
5
|
+
const tool = session._toolRegistry.get(name);
|
|
6
|
+
return tool && session.getToolDefinition(name)?.exposure !== "hidden" ? [tool] : [];
|
|
7
|
+
});
|
|
8
|
+
const loadout = {
|
|
9
|
+
declared: tools,
|
|
10
|
+
callable: getCallableTools(session, new Set(tools.map((tool) => tool.name))),
|
|
11
|
+
registered: [...session._toolRegistry.values()],
|
|
12
|
+
getExposure: (name) => session.getToolDefinition(name)?.exposure ?? "direct",
|
|
13
|
+
getNamespace: (name) => session.getToolDefinition(name)?.namespace,
|
|
14
|
+
};
|
|
15
|
+
const descriptions = new Map();
|
|
16
|
+
const hidden = new Set();
|
|
17
|
+
for (const tool of tools) {
|
|
18
|
+
const entry = session._toolDefinitions.get(tool.name);
|
|
19
|
+
if (!entry?.definition.prepareLoadout)
|
|
20
|
+
continue;
|
|
21
|
+
try {
|
|
22
|
+
const changes = entry.definition.prepareLoadout(loadout);
|
|
23
|
+
for (const [name, description] of Object.entries(changes?.descriptions ?? {}))
|
|
24
|
+
descriptions.set(name, description);
|
|
25
|
+
for (const name of changes?.hiddenDeclarations ?? [])
|
|
26
|
+
hidden.add(name);
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
session.extensionRunner.emitError({
|
|
30
|
+
extensionPath: entry.sourceInfo.path,
|
|
31
|
+
event: "prepare_loadout",
|
|
32
|
+
error: error instanceof Error ? error.message : String(error),
|
|
33
|
+
stack: error instanceof Error ? error.stack : undefined,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
hiddenDeclarations.set(session, hidden);
|
|
38
|
+
const declared = tools.map((tool) => {
|
|
39
|
+
const description = descriptions.get(tool.name);
|
|
40
|
+
return description === undefined ? tool : { ...tool, description };
|
|
41
|
+
});
|
|
42
|
+
session.agent.state.tools = declared;
|
|
43
|
+
return declared;
|
|
44
|
+
}
|
|
45
|
+
/** Hide only request declarations. The transcript retains activation and branch history. */
|
|
46
|
+
export function projectToolLoadout(session, messages) {
|
|
47
|
+
const hidden = hiddenDeclarations.get(session);
|
|
48
|
+
if (!hidden?.size)
|
|
49
|
+
return messages;
|
|
50
|
+
return messages.map((message) => {
|
|
51
|
+
if (message.role !== "system" || (!message.toolsAdded && !message.toolsRemoved))
|
|
52
|
+
return message;
|
|
53
|
+
const { toolsAdded, toolsRemoved, ...rest } = message;
|
|
54
|
+
const added = toolsAdded?.filter((tool) => !hidden.has(tool.name)) ?? [];
|
|
55
|
+
const removed = toolsRemoved?.filter((tool) => !hidden.has(tool.name)) ?? [];
|
|
56
|
+
return {
|
|
57
|
+
...rest,
|
|
58
|
+
...(added.length ? { toolsAdded: added } : {}),
|
|
59
|
+
...(removed.length ? { toolsRemoved: removed } : {}),
|
|
60
|
+
};
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=tool-loadout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-loadout.js","sourceRoot":"","sources":["../../src/core/tool-loadout.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAGnE,MAAM,kBAAkB,GAAG,IAAI,OAAO,EAAqC,CAAC;AAC5E,MAAM,UAAU,gBAAgB,CAAC,OAAqB,EAAE,KAAwB;IAC/E,MAAM,KAAK,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QAClD,MAAM,IAAI,GAAG,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC7C,OAAO,IAAI,IAAI,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,EAAE,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACrF,CAAC,CAAC,CAAC;IACH,MAAM,OAAO,GAAgB;QAC5B,QAAQ,EAAE,KAAK;QACf,QAAQ,EAAE,gBAAgB,CAAC,OAAO,EAAE,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,C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,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;QACzE,MAAM,OAAO,GAAG,YAAY,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;QAC7E,OAAO;YACN,GAAG,IAAI;YACP,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC9C,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACpD,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import type { AgentMessage, AgentTool } from \"@earendil-works/pi-agent-core\";\nimport type { AgentSessionInternalSurface as AgentSession } from \"./agent-session-methods.ts\";\nimport { getCallableTools } from \"./agent-session-nested-tools.js\";\nimport type { ToolLoadout } from \"./extensions/tool-types.ts\";\n\nconst hiddenDeclarations = new WeakMap<AgentSession, ReadonlySet<string>>();\nexport function applyToolLoadout(session: AgentSession, names: readonly string[]): AgentTool[] {\n\tconst tools = [...new Set(names)].flatMap((name) => {\n\t\tconst tool = session._toolRegistry.get(name);\n\t\treturn tool && session.getToolDefinition(name)?.exposure !== \"hidden\" ? [tool] : [];\n\t});\n\tconst loadout: ToolLoadout = {\n\t\tdeclared: tools,\n\t\tcallable: getCallableTools(session, new Set(tools.map((tool) => tool.name))),\n\t\tregistered: [...session._toolRegistry.values()],\n\t\tgetExposure: (name) => session.getToolDefinition(name)?.exposure ?? \"direct\",\n\t\tgetNamespace: (name) => session.getToolDefinition(name)?.namespace,\n\t};\n\tconst descriptions = new Map<string, string>();\n\tconst hidden = new Set<string>();\n\tfor (const tool of tools) {\n\t\tconst entry = session._toolDefinitions.get(tool.name);\n\t\tif (!entry?.definition.prepareLoadout) continue;\n\t\ttry {\n\t\t\tconst changes = entry.definition.prepareLoadout(loadout);\n\t\t\tfor (const [name, description] of Object.entries(changes?.descriptions ?? {}))\n\t\t\t\tdescriptions.set(name, description);\n\t\t\tfor (const name of changes?.hiddenDeclarations ?? []) hidden.add(name);\n\t\t} catch (error) {\n\t\t\tsession.extensionRunner.emitError({\n\t\t\t\textensionPath: entry.sourceInfo.path,\n\t\t\t\tevent: \"prepare_loadout\",\n\t\t\t\terror: error instanceof Error ? error.message : String(error),\n\t\t\t\tstack: error instanceof Error ? error.stack : undefined,\n\t\t\t});\n\t\t}\n\t}\n\thiddenDeclarations.set(session, hidden);\n\tconst declared = tools.map((tool) => {\n\t\tconst description = descriptions.get(tool.name);\n\t\treturn description === undefined ? tool : { ...tool, description };\n\t});\n\tsession.agent.state.tools = declared;\n\treturn declared;\n}\n\n/** Hide only request declarations. The transcript retains activation and branch history. */\nexport function projectToolLoadout(session: AgentSession, messages: AgentMessage[]): AgentMessage[] {\n\tconst hidden = hiddenDeclarations.get(session);\n\tif (!hidden?.size) return messages;\n\treturn messages.map((message) => {\n\t\tif (message.role !== \"system\" || (!message.toolsAdded && !message.toolsRemoved)) return message;\n\t\tconst { toolsAdded, toolsRemoved, ...rest } = message;\n\t\tconst added = toolsAdded?.filter((tool) => !hidden.has(tool.name)) ?? [];\n\t\tconst removed = toolsRemoved?.filter((tool) => !hidden.has(tool.name)) ?? [];\n\t\treturn {\n\t\t\t...rest,\n\t\t\t...(added.length ? { toolsAdded: added } : {}),\n\t\t\t...(removed.length ? { toolsRemoved: removed } : {}),\n\t\t};\n\t});\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ask-user-question.d.ts","sourceRoot":"","sources":["../../../../src/core/tools/ask-user-question/ask-user-question.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,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;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,6BAA6B,EAAE,cAG3C,CAAC;AAEF,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,YAAY,GAAG,kBAAkB,EAAE,CAWlF;AAED,eAAO,MAAM,2CAA2C;;;EAU7C,CAAC;AAEZ,wBAAgB,mCAAmC,CAAC,OAAO,CAAC,EAAE;IAC7D,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;CAChC,GAAG,cAAc,CAAC,OAAO,oBAAoB,EAAE,OAAO,CAAC,CAoEvD;AAED,gFAAgF;AAChF,wBAAsB,oBAAoB,CACzC,EAAE,EAAE,kBAAkB,EACtB,MAAM,EAAE,cAAc,EACtB,MAAM,CAAC,EAAE,WAAW,EACpB,YAAY,CAAC,EAAE,OAAO,GACpB,OAAO,CAAC,mBAAmB,CAAC,CAmB9B;AAED,OAAO,EAAE,0BAA0B,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -59,6 +59,7 @@ export function createAskUserQuestionToolDefinition(options) {
|
|
|
59
59
|
const guidance = validateGuidanceFields(loadConfig().guidance);
|
|
60
60
|
return {
|
|
61
61
|
name: "ask_user_question",
|
|
62
|
+
exposure: "model-only",
|
|
62
63
|
concurrency: "exclusive",
|
|
63
64
|
label: "Ask User Question",
|
|
64
65
|
description: `Ask the user one or more structured questions during execution. When ask_user_question or an equivalent question tool is available, all questions to the user must use that tool instead of plain text, including a short 'Proceed?' confirmation. Prefer ask_user_question when available. Use when you need to:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ask-user-question.js","sourceRoot":"","sources":["../../../../src/core/tools/ask-user-question/ask-user-question.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gCAAgC,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAGtE,OAAO,EAAE,UAAU,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EA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AAqB,CAAC,CAAC;IAC/D,EAAE,CAAC,iBAAiB,EAAE,CAAC,KAAK,CAAC,CAAC;IAC9B,IAAI,CAAC;QACJ,OAAO,MAAM,EAAE,CAAC,MAAM,CACrB,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,CACzB,IAAI,oBAAoB,CAAC;YACxB,GAAG;YACH,KAAK;YACL,MAAM;YACN,UAAU;YACV,IAAI;YACJ,GAAG,CAAC,YAAY,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACxD,CAAC,CAAC,SAAS,EACb,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,qBAAqB,EAAE,IAAI,EAAE,cAAc,EAAE,6BAA6B,EAAE,CACrG,CAAC;IACH,CAAC;YAAS,CAAC;QACV,EAAE,CAAC,iBAAiB,EAAE,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;AACF,CAAC;AAED,OAAO,EAAE,0BAA0B,EAAE,eAAe,EAAE,CAAC","sourcesContent":["import type { OverlayOptions } from \"@earendil-works/pi-tui\";\nimport { experimentalToolSamplingProperty } from \"../../experimental.ts\";\nimport { getHostQuestionnaire } from \"../../extensions/host-input.js\";\nimport type { ToolDefinition } from \"../../extensions/types.ts\";\nimport type { ExtensionUIContext } from \"../../extensions/ui-types.js\";\nimport { loadConfig, validateGuidanceFields } from \"./config.ts\";\nimport { QuestionnaireSession } from \"./state/questionnaire-session.ts\";\nimport { ROW_INTENT_META, sentinelsToAppend } from \"./state/row-intent.ts\";\nimport { buildQuestionnaireResponse, buildToolResult } from \"./tool/response-envelope.ts\";\nimport {\n\tMAX_OPTIONS,\n\tMAX_QUESTIONS,\n\tMIN_OPTIONS,\n\ttype QuestionData,\n\ttype QuestionnaireResult,\n\ttype QuestionParams,\n\tQuestionParamsSchema,\n} from \"./tool/types.js\";\nimport { validateQuestionnaire } from \"./tool/validate-questionnaire.ts\";\nimport type { WrappingSelectItem } from \"./view/components/wrapping-select.ts\";\n\nconst ERROR_NO_UI = \"Error: UI not available (running in non-interactive mode)\";\n// Private first-party route: a workflow owns this waiter even without a human host.\nconst STAGE_QUESTIONNAIRE = Symbol.for(\"atomic-coding-agent/stage-questionnaire@1\");\n\n/**\n * Mount options for the blocking questionnaire (#2378).\n *\n * The dialog used to mount inline, inside the fullscreen dock, where it is a\n * flex sibling of the transcript `ScrollView`. A tall side-by-side dialog then\n * took the transcript's rows: on a 40-row terminal the transcript viewport\n * collapsed from 34 rows to 6, and pi-tui derives its page step from that\n * viewport (`viewportHeight - PAGE_SCROLL_OVERLAP`), so PageUp crawled two\n * lines at a time through a six-line window.\n *\n * A bottom-anchored overlay is composited over the bottom rows instead of being\n * measured into the layout, so the transcript keeps its full viewport height\n * and its full page step. `reserveTranscriptRows` is what makes those rows\n * observable rather than merely addressable: the host bounds this overlay so a\n * transcript strip always survives, and extends the transcript's scroll extent\n * by the rows the overlay still covers, so the newest output can be raised into\n * that strip. No `maxHeight` — the host's bound is tighter, and letting pi-tui\n * slice as well would make the measured overlay height wrong.\n */\nexport const QUESTIONNAIRE_OVERLAY_OPTIONS: OverlayOptions = {\n\tanchor: \"bottom-center\",\n\twidth: \"100%\",\n};\n\nexport function buildItemsForQuestion(question: QuestionData): WrappingSelectItem[] {\n\tconst items: WrappingSelectItem[] = question.options.map((o) => ({\n\t\tkind: \"option\",\n\t\tlabel: o.label,\n\t\tdescription: o.description,\n\t}));\n\tconst hasAnyPreview = question.options.some((o) => typeof o.preview === \"string\" && o.preview.length > 0);\n\tfor (const kind of sentinelsToAppend(question, hasAnyPreview)) {\n\t\titems.push({ kind, label: ROW_INTENT_META[kind].label });\n\t}\n\treturn items;\n}\n\nexport const askUserQuestionToolSystemPromptContribution = Object.freeze({\n\tsnippet: `Ask all user questions through this tool, including clarifications and approvals; up to ${MAX_QUESTIONS} questions with ${MIN_OPTIONS}-${MAX_OPTIONS} options each`,\n\tguidelines: Object.freeze([\n\t\t\"When ask_user_question or an equivalent question tool is available, all questions to the user must use that tool instead of plain text, including clarifications, preferences, confirmations, approvals, and permission to proceed. Prefer ask_user_question when available. In these sessions, do not end a progress update or final response with a prose-only question such as 'Proceed?'.\",\n\t\t\"Ask only when a decision is needed; do not seek approval again for already-authorized work. For a confirmation, put the concrete action and its scope in the question and offer explicit proceed and decline options. A cancelled or unanswered question is not approval.\",\n\t\t`Each question MUST have ${MIN_OPTIONS}-${MAX_OPTIONS} options. Every option requires a concise label (1-5 words) and a description explaining what the choice means or its trade-offs. The user can additionally type a custom answer (\"Type something.\" row is appended automatically to single-select questions) or pick \"Chat about this\" to abandon the questionnaire.`,\n\t\t`Set multiSelect: true when multiple answers are valid; this suppresses the \"Type something.\" row. Provide an options[].preview markdown string when an option benefits from richer side-by-side context (mockups, code snippets, diagrams, configs) — single-select only. NOTE: any non-empty preview on a single-select question ALSO suppresses the \"Type something.\" row (no room in the side-by-side layout); \"Chat about this\" remains the escape hatch. If you recommend a specific option, make it the first option and append \"(Recommended)\" to its label.`,\n\t\t\"Do not stack multiple ask_user_question calls back-to-back — group all clarifying questions into one invocation.\",\n\t\t\"If ask_user_question is unavailable, use an equivalent available question tool with its supported schema. If no usable question tool is available, continue autonomously using best judgment and state evidence-backed assumptions. Tool unavailability alone is not a blocker; preserve safety and authorization constraints.\",\n\t] as const),\n} as const);\n\nexport function createAskUserQuestionToolDefinition(options?: {\n\treadonly chatAsOption?: boolean;\n}): ToolDefinition<typeof QuestionParamsSchema, unknown> {\n\tconst guidance = validateGuidanceFields(loadConfig().guidance);\n\treturn {\n\t\tname: \"ask_user_question\",\n\t\tconcurrency: \"exclusive\",\n\t\tlabel: \"Ask User Question\",\n\t\tdescription: `Ask the user one or more structured questions during execution. When ask_user_question or an equivalent question tool is available, all questions to the user must use that tool instead of plain text, including a short 'Proceed?' confirmation. Prefer ask_user_question when available. Use when you need to:\n1. Gather user preferences or requirements\n2. Clarify ambiguous instructions\n3. Get decisions on implementation choices as you work\n4. Request confirmation, approval, or permission to proceed\n\nUsage notes:\n- Ask only for decisions that are needed; do not re-request existing authorization. State the exact action and scope, with explicit proceed and decline options for confirmations. A cancelled or unanswered question is not approval.\n- If ask_user_question is unavailable, use an equivalent available question tool with its supported schema. If no usable question tool is available, continue autonomously using best judgment and state evidence-backed assumptions. Tool unavailability alone is not a blocker; preserve safety and authorization constraints.\n- Users will always be able to type a custom answer (\"Type something.\" row is appended automatically to every single-select question) or pick \"Chat about this\" to abandon the questionnaire and continue in free-form conversation. Do NOT author \"Other\" / \"Type something.\" / \"Chat about this\" labels yourself — duplicates are rejected at runtime.\n- Use multiSelect: true to allow multiple answers to be selected for a question. The \"Type something.\" row is suppressed on multi-select questions, and is ALSO suppressed on single-select questions where any option carries a \\`preview\\` (the side-by-side layout has no room for inline custom text — \"Chat about this\" remains as the free-form escape hatch).\n- If you recommend a specific option, make that the first option in the list and add \"(Recommended)\" at the end of the label.\n\nPreview feature:\nUse the optional \\`preview\\` field on options when presenting concrete artifacts that users need to visually compare:\n- ASCII mockups of UI layouts or components\n- Code snippets showing different implementations\n- Diagram variations\n- Configuration examples\n\nPreview content is rendered as markdown in a monospace box. Multi-line text with newlines is supported. When any option has a preview, the UI switches to a side-by-side layout with a vertical option list on the left and preview on the right. Do not use previews for simple preference questions where labels and descriptions suffice. Note: previews are only supported for single-select questions (not multiSelect).`,\n\t\tpromptSnippet: guidance.promptSnippet ?? askUserQuestionToolSystemPromptContribution.snippet,\n\t\tpromptGuidelines: guidance.promptGuidelines ?? [...askUserQuestionToolSystemPromptContribution.guidelines],\n\t\t...experimentalToolSamplingProperty(),\n\t\tparameters: QuestionParamsSchema,\n\n\t\tasync execute(_toolCallId, params, signal, _onUpdate, ctx) {\n\t\t\tconst typed = params as unknown as QuestionParams;\n\t\t\tconst stageOwned = (\n\t\t\t\tctx.ui as ExtensionUIContext & {\n\t\t\t\t\t[STAGE_QUESTIONNAIRE]?: (sessionId: string, ui: ExtensionUIContext) => void;\n\t\t\t\t}\n\t\t\t)[STAGE_QUESTIONNAIRE];\n\t\t\tif (typeof stageOwned !== \"function\" && !(ctx.hasHumanInput ?? ctx.hasUI))\n\t\t\t\treturn buildToolResult(ERROR_NO_UI, { answers: [], cancelled: true, error: \"no_ui\" });\n\n\t\t\tconst validation = validateQuestionnaire(typed);\n\t\t\tif (!validation.ok) {\n\t\t\t\treturn buildToolResult(validation.message, {\n\t\t\t\t\tanswers: [],\n\t\t\t\t\tcancelled: true,\n\t\t\t\t\terror: validation.error,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif (typeof stageOwned === \"function\") {\n\t\t\t\tstageOwned(ctx.sessionManager.getSessionId(), ctx.ui);\n\t\t\t\treturn buildQuestionnaireResponse(\n\t\t\t\t\tawait presentQuestionnaire(ctx.ui, typed, signal, options?.chatAsOption),\n\t\t\t\t\ttyped,\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst questionnaire = getHostQuestionnaire(ctx.ui);\n\t\t\tconst result = questionnaire\n\t\t\t\t? await questionnaire(typed, signal, (requestSignal) =>\n\t\t\t\t\t\tpresentQuestionnaire(ctx.ui, typed, requestSignal, options?.chatAsOption),\n\t\t\t\t\t)\n\t\t\t\t: await presentQuestionnaire(ctx.ui, typed, signal, options?.chatAsOption);\n\t\t\treturn buildQuestionnaireResponse(result, typed);\n\t\t},\n\t};\n}\n\n/** Rendering adapter shared by the CLI bridge and legacy presentation hosts. */\nexport async function presentQuestionnaire(\n\tui: ExtensionUIContext,\n\tparams: QuestionParams,\n\tsignal?: AbortSignal,\n\tchatAsOption?: boolean,\n): Promise<QuestionnaireResult> {\n\tconst itemsByTab = params.questions.map(buildItemsForQuestion);\n\tui.setWorkingVisible?.(false);\n\ttry {\n\t\treturn await ui.custom<QuestionnaireResult>(\n\t\t\t(tui, theme, _kb, done) =>\n\t\t\t\tnew QuestionnaireSession({\n\t\t\t\t\ttui,\n\t\t\t\t\ttheme,\n\t\t\t\t\tparams,\n\t\t\t\t\titemsByTab,\n\t\t\t\t\tdone,\n\t\t\t\t\t...(chatAsOption === true ? { chatAsOption: true } : {}),\n\t\t\t\t}).component,\n\t\t\t{ signal, overlay: true, reserveTranscriptRows: true, overlayOptions: QUESTIONNAIRE_OVERLAY_OPTIONS },\n\t\t);\n\t} finally {\n\t\tui.setWorkingVisible?.(true);\n\t}\n}\n\nexport { buildQuestionnaireResponse, buildToolResult };\n"]}
|
|
1
|
+
{"version":3,"file":"ask-user-question.js","sourceRoot":"","sources":["../../../../src/core/tools/ask-user-question/ask-user-question.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gCAAgC,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAGtE,OAAO,EAAE,UAAU,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,EAAE,0BAA0B,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC1F,OAAO,EACN,WAAW,EACX,aAAa,EACb,WAAW,EAIX,oBAAoB,GACpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAGzE,MAAM,WAAW,GAAG,2DAA2D,CAAC;AAChF,oFAAoF;AACpF,MAAM,mBAAmB,GAAG,MAAM,CAAC,GAAG,CAAC,2CAA2C,CAAC,CAAC;AAEpF;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAmB;IAC5D,MAAM,EAAE,eAAe;IACvB,KAAK,EAAE,MAAM;CACb,CAAC;AAEF,MAAM,UAAU,qBAAqB,CAAC,QAAsB;IAC3D,MAAM,KAAK,GAAyB,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAA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,CAAC","sourcesContent":["import type { OverlayOptions } from \"@earendil-works/pi-tui\";\nimport { experimentalToolSamplingProperty } from \"../../experimental.ts\";\nimport { getHostQuestionnaire } from \"../../extensions/host-input.js\";\nimport type { ToolDefinition } from \"../../extensions/types.ts\";\nimport type { ExtensionUIContext } from \"../../extensions/ui-types.js\";\nimport { loadConfig, validateGuidanceFields } from \"./config.ts\";\nimport { QuestionnaireSession } from \"./state/questionnaire-session.ts\";\nimport { ROW_INTENT_META, sentinelsToAppend } from \"./state/row-intent.ts\";\nimport { buildQuestionnaireResponse, buildToolResult } from \"./tool/response-envelope.ts\";\nimport {\n\tMAX_OPTIONS,\n\tMAX_QUESTIONS,\n\tMIN_OPTIONS,\n\ttype QuestionData,\n\ttype QuestionnaireResult,\n\ttype QuestionParams,\n\tQuestionParamsSchema,\n} from \"./tool/types.js\";\nimport { validateQuestionnaire } from \"./tool/validate-questionnaire.ts\";\nimport type { WrappingSelectItem } from \"./view/components/wrapping-select.ts\";\n\nconst ERROR_NO_UI = \"Error: UI not available (running in non-interactive mode)\";\n// Private first-party route: a workflow owns this waiter even without a human host.\nconst STAGE_QUESTIONNAIRE = Symbol.for(\"atomic-coding-agent/stage-questionnaire@1\");\n\n/**\n * Mount options for the blocking questionnaire (#2378).\n *\n * The dialog used to mount inline, inside the fullscreen dock, where it is a\n * flex sibling of the transcript `ScrollView`. A tall side-by-side dialog then\n * took the transcript's rows: on a 40-row terminal the transcript viewport\n * collapsed from 34 rows to 6, and pi-tui derives its page step from that\n * viewport (`viewportHeight - PAGE_SCROLL_OVERLAP`), so PageUp crawled two\n * lines at a time through a six-line window.\n *\n * A bottom-anchored overlay is composited over the bottom rows instead of being\n * measured into the layout, so the transcript keeps its full viewport height\n * and its full page step. `reserveTranscriptRows` is what makes those rows\n * observable rather than merely addressable: the host bounds this overlay so a\n * transcript strip always survives, and extends the transcript's scroll extent\n * by the rows the overlay still covers, so the newest output can be raised into\n * that strip. No `maxHeight` — the host's bound is tighter, and letting pi-tui\n * slice as well would make the measured overlay height wrong.\n */\nexport const QUESTIONNAIRE_OVERLAY_OPTIONS: OverlayOptions = {\n\tanchor: \"bottom-center\",\n\twidth: \"100%\",\n};\n\nexport function buildItemsForQuestion(question: QuestionData): WrappingSelectItem[] {\n\tconst items: WrappingSelectItem[] = question.options.map((o) => ({\n\t\tkind: \"option\",\n\t\tlabel: o.label,\n\t\tdescription: o.description,\n\t}));\n\tconst hasAnyPreview = question.options.some((o) => typeof o.preview === \"string\" && o.preview.length > 0);\n\tfor (const kind of sentinelsToAppend(question, hasAnyPreview)) {\n\t\titems.push({ kind, label: ROW_INTENT_META[kind].label });\n\t}\n\treturn items;\n}\n\nexport const askUserQuestionToolSystemPromptContribution = Object.freeze({\n\tsnippet: `Ask all user questions through this tool, including clarifications and approvals; up to ${MAX_QUESTIONS} questions with ${MIN_OPTIONS}-${MAX_OPTIONS} options each`,\n\tguidelines: Object.freeze([\n\t\t\"When ask_user_question or an equivalent question tool is available, all questions to the user must use that tool instead of plain text, including clarifications, preferences, confirmations, approvals, and permission to proceed. Prefer ask_user_question when available. In these sessions, do not end a progress update or final response with a prose-only question such as 'Proceed?'.\",\n\t\t\"Ask only when a decision is needed; do not seek approval again for already-authorized work. For a confirmation, put the concrete action and its scope in the question and offer explicit proceed and decline options. A cancelled or unanswered question is not approval.\",\n\t\t`Each question MUST have ${MIN_OPTIONS}-${MAX_OPTIONS} options. Every option requires a concise label (1-5 words) and a description explaining what the choice means or its trade-offs. The user can additionally type a custom answer (\"Type something.\" row is appended automatically to single-select questions) or pick \"Chat about this\" to abandon the questionnaire.`,\n\t\t`Set multiSelect: true when multiple answers are valid; this suppresses the \"Type something.\" row. Provide an options[].preview markdown string when an option benefits from richer side-by-side context (mockups, code snippets, diagrams, configs) — single-select only. NOTE: any non-empty preview on a single-select question ALSO suppresses the \"Type something.\" row (no room in the side-by-side layout); \"Chat about this\" remains the escape hatch. If you recommend a specific option, make it the first option and append \"(Recommended)\" to its label.`,\n\t\t\"Do not stack multiple ask_user_question calls back-to-back — group all clarifying questions into one invocation.\",\n\t\t\"If ask_user_question is unavailable, use an equivalent available question tool with its supported schema. If no usable question tool is available, continue autonomously using best judgment and state evidence-backed assumptions. Tool unavailability alone is not a blocker; preserve safety and authorization constraints.\",\n\t] as const),\n} as const);\n\nexport function createAskUserQuestionToolDefinition(options?: {\n\treadonly chatAsOption?: boolean;\n}): ToolDefinition<typeof QuestionParamsSchema, unknown> {\n\tconst guidance = validateGuidanceFields(loadConfig().guidance);\n\treturn {\n\t\tname: \"ask_user_question\",\n\t\texposure: \"model-only\",\n\t\tconcurrency: \"exclusive\",\n\t\tlabel: \"Ask User Question\",\n\t\tdescription: `Ask the user one or more structured questions during execution. When ask_user_question or an equivalent question tool is available, all questions to the user must use that tool instead of plain text, including a short 'Proceed?' confirmation. Prefer ask_user_question when available. Use when you need to:\n1. Gather user preferences or requirements\n2. Clarify ambiguous instructions\n3. Get decisions on implementation choices as you work\n4. Request confirmation, approval, or permission to proceed\n\nUsage notes:\n- Ask only for decisions that are needed; do not re-request existing authorization. State the exact action and scope, with explicit proceed and decline options for confirmations. A cancelled or unanswered question is not approval.\n- If ask_user_question is unavailable, use an equivalent available question tool with its supported schema. If no usable question tool is available, continue autonomously using best judgment and state evidence-backed assumptions. Tool unavailability alone is not a blocker; preserve safety and authorization constraints.\n- Users will always be able to type a custom answer (\"Type something.\" row is appended automatically to every single-select question) or pick \"Chat about this\" to abandon the questionnaire and continue in free-form conversation. Do NOT author \"Other\" / \"Type something.\" / \"Chat about this\" labels yourself — duplicates are rejected at runtime.\n- Use multiSelect: true to allow multiple answers to be selected for a question. The \"Type something.\" row is suppressed on multi-select questions, and is ALSO suppressed on single-select questions where any option carries a \\`preview\\` (the side-by-side layout has no room for inline custom text — \"Chat about this\" remains as the free-form escape hatch).\n- If you recommend a specific option, make that the first option in the list and add \"(Recommended)\" at the end of the label.\n\nPreview feature:\nUse the optional \\`preview\\` field on options when presenting concrete artifacts that users need to visually compare:\n- ASCII mockups of UI layouts or components\n- Code snippets showing different implementations\n- Diagram variations\n- Configuration examples\n\nPreview content is rendered as markdown in a monospace box. Multi-line text with newlines is supported. When any option has a preview, the UI switches to a side-by-side layout with a vertical option list on the left and preview on the right. Do not use previews for simple preference questions where labels and descriptions suffice. Note: previews are only supported for single-select questions (not multiSelect).`,\n\t\tpromptSnippet: guidance.promptSnippet ?? askUserQuestionToolSystemPromptContribution.snippet,\n\t\tpromptGuidelines: guidance.promptGuidelines ?? [...askUserQuestionToolSystemPromptContribution.guidelines],\n\t\t...experimentalToolSamplingProperty(),\n\t\tparameters: QuestionParamsSchema,\n\n\t\tasync execute(_toolCallId, params, signal, _onUpdate, ctx) {\n\t\t\tconst typed = params as unknown as QuestionParams;\n\t\t\tconst stageOwned = (\n\t\t\t\tctx.ui as ExtensionUIContext & {\n\t\t\t\t\t[STAGE_QUESTIONNAIRE]?: (sessionId: string, ui: ExtensionUIContext) => void;\n\t\t\t\t}\n\t\t\t)[STAGE_QUESTIONNAIRE];\n\t\t\tif (typeof stageOwned !== \"function\" && !(ctx.hasHumanInput ?? ctx.hasUI))\n\t\t\t\treturn buildToolResult(ERROR_NO_UI, { answers: [], cancelled: true, error: \"no_ui\" });\n\n\t\t\tconst validation = validateQuestionnaire(typed);\n\t\t\tif (!validation.ok) {\n\t\t\t\treturn buildToolResult(validation.message, {\n\t\t\t\t\tanswers: [],\n\t\t\t\t\tcancelled: true,\n\t\t\t\t\terror: validation.error,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif (typeof stageOwned === \"function\") {\n\t\t\t\tstageOwned(ctx.sessionManager.getSessionId(), ctx.ui);\n\t\t\t\treturn buildQuestionnaireResponse(\n\t\t\t\t\tawait presentQuestionnaire(ctx.ui, typed, signal, options?.chatAsOption),\n\t\t\t\t\ttyped,\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst questionnaire = getHostQuestionnaire(ctx.ui);\n\t\t\tconst result = questionnaire\n\t\t\t\t? await questionnaire(typed, signal, (requestSignal) =>\n\t\t\t\t\t\tpresentQuestionnaire(ctx.ui, typed, requestSignal, options?.chatAsOption),\n\t\t\t\t\t)\n\t\t\t\t: await presentQuestionnaire(ctx.ui, typed, signal, options?.chatAsOption);\n\t\t\treturn buildQuestionnaireResponse(result, typed);\n\t\t},\n\t};\n}\n\n/** Rendering adapter shared by the CLI bridge and legacy presentation hosts. */\nexport async function presentQuestionnaire(\n\tui: ExtensionUIContext,\n\tparams: QuestionParams,\n\tsignal?: AbortSignal,\n\tchatAsOption?: boolean,\n): Promise<QuestionnaireResult> {\n\tconst itemsByTab = params.questions.map(buildItemsForQuestion);\n\tui.setWorkingVisible?.(false);\n\ttry {\n\t\treturn await ui.custom<QuestionnaireResult>(\n\t\t\t(tui, theme, _kb, done) =>\n\t\t\t\tnew QuestionnaireSession({\n\t\t\t\t\ttui,\n\t\t\t\t\ttheme,\n\t\t\t\t\tparams,\n\t\t\t\t\titemsByTab,\n\t\t\t\t\tdone,\n\t\t\t\t\t...(chatAsOption === true ? { chatAsOption: true } : {}),\n\t\t\t\t}).component,\n\t\t\t{ signal, overlay: true, reserveTranscriptRows: true, overlayOptions: QUESTIONNAIRE_OVERLAY_OPTIONS },\n\t\t);\n\t} finally {\n\t\tui.setWorkingVisible?.(true);\n\t}\n}\n\nexport { buildQuestionnaireResponse, buildToolResult };\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bash.d.ts","sourceRoot":"","sources":["../../../src/core/tools/bash.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAG/D,OAAO,EAAE,KAAK,MAAM,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAa5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAoB,cAAc,EAA2B,MAAM,wBAAwB,CAAC;AACxG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;A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AAM,CAAC;CACvB;AACD,eAAO,MAAM,uBAAuB,EAAE,qBAGrC,CAAC;AAkBF,KAAK,eAAe,GAAG;IACtB,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC,OAAO,GAAG,SAAS,CAAC;CACrC,CAAC;AAuHF,wBAAgB,wBAAwB,CACvC,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,eAAe,EACzB,YAAY,GAAE,qBAA+C,GAC3D,cAAc,CAAC,OAAO,UAAU,EAAE,eAAe,GAAG,SAAS,EAAE,eAAe,CAAC,CAoUjF;AACD,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC,OAAO,UAAU,CAAC,CAEnG"}
|
package/dist/core/tools/bash.js
CHANGED
|
@@ -21,6 +21,16 @@ import { expandShellInternalUrls } from "./resource-selectors.js";
|
|
|
21
21
|
import { invalidateNativeSearchCache } from "./search-native.js";
|
|
22
22
|
import { wrapToolDefinition } from "./tool-definition-wrapper.js";
|
|
23
23
|
import { DEFAULT_MAX_BYTES, formatSize } from "./truncate.js";
|
|
24
|
+
const STRUCTURED_OUTPUT_MAX_BYTES = 1024 * 1024;
|
|
25
|
+
const bashOutputSchema = Type.Object({
|
|
26
|
+
output: Type.String({
|
|
27
|
+
description: "Combined stdout and stderr, up to 1 MiB, keeping the first and last 512 KiB when longer.",
|
|
28
|
+
}),
|
|
29
|
+
truncated: Type.Boolean(),
|
|
30
|
+
full_output_path: Type.Optional(Type.String()),
|
|
31
|
+
exit_code: Type.Number(),
|
|
32
|
+
wall_time_seconds: Type.Number(),
|
|
33
|
+
});
|
|
24
34
|
const envSchema = Type.Unsafe({
|
|
25
35
|
type: "object",
|
|
26
36
|
description: "Environment variables to add or override.",
|
|
@@ -224,7 +234,6 @@ class BashResultRenderComponent extends Container {
|
|
|
224
234
|
state = {
|
|
225
235
|
cachedWidth: undefined,
|
|
226
236
|
cachedLines: undefined,
|
|
227
|
-
cachedSkipped: undefined,
|
|
228
237
|
};
|
|
229
238
|
}
|
|
230
239
|
function formatDuration(ms) {
|
|
@@ -280,21 +289,20 @@ function rebuildBashResultRenderComponent(component, result, options, showImages
|
|
|
280
289
|
render: (width) => {
|
|
281
290
|
if (state.cachedLines === undefined || state.cachedWidth !== width) {
|
|
282
291
|
const preview = truncateToVisualLines(styledOutput, BASH_PREVIEW_LINES, width);
|
|
283
|
-
|
|
284
|
-
|
|
292
|
+
const hintLines = [];
|
|
293
|
+
if (preview.skippedCount > 0) {
|
|
294
|
+
const hint = theme.fg("muted", "... ") +
|
|
295
|
+
parenthesizedKeyHint("app.tools.expand", "Expand", `${preview.skippedCount} earlier lines`);
|
|
296
|
+
hintLines.push(truncateToWidth(hint, width, "..."));
|
|
297
|
+
}
|
|
298
|
+
state.cachedLines = ["", ...hintLines, ...preview.visualLines];
|
|
285
299
|
state.cachedWidth = width;
|
|
286
300
|
}
|
|
287
|
-
|
|
288
|
-
const hint = theme.fg("muted", "... ") +
|
|
289
|
-
parenthesizedKeyHint("app.tools.expand", "Expand", `${state.cachedSkipped} earlier lines`);
|
|
290
|
-
return ["", truncateToWidth(hint, width, "..."), ...(state.cachedLines ?? [])];
|
|
291
|
-
}
|
|
292
|
-
return ["", ...(state.cachedLines ?? [])];
|
|
301
|
+
return state.cachedLines;
|
|
293
302
|
},
|
|
294
303
|
invalidate: () => {
|
|
295
304
|
state.cachedWidth = undefined;
|
|
296
305
|
state.cachedLines = undefined;
|
|
297
|
-
state.cachedSkipped = undefined;
|
|
298
306
|
},
|
|
299
307
|
});
|
|
300
308
|
}
|
|
@@ -343,6 +351,7 @@ export function createBashToolDefinition(cwd, options, presentation = BASH_SHELL
|
|
|
343
351
|
promptGuidelines: exposeSessionEnvironment ? [...bashToolSystemPromptContribution.guidelines] : undefined,
|
|
344
352
|
prepareArguments: prepareShellInput,
|
|
345
353
|
parameters: bashSchema,
|
|
354
|
+
outputSchema: bashOutputSchema,
|
|
346
355
|
maxResultSizeChars: Infinity,
|
|
347
356
|
async execute(_toolCallId, bashCommand, signal, onUpdate, ctx) {
|
|
348
357
|
if (bashCommand.action !== undefined) {
|
|
@@ -566,14 +575,25 @@ export function createBashToolDefinition(cwd, options, presentation = BASH_SHELL
|
|
|
566
575
|
if (exitCode === null) {
|
|
567
576
|
throw new Error(appendStatus(outputText, "Command terminated without an exit code"));
|
|
568
577
|
}
|
|
578
|
+
const fullOutput = await output.readFullOutput(STRUCTURED_OUTPUT_MAX_BYTES);
|
|
579
|
+
const structuredContent = {
|
|
580
|
+
output: fullOutput.content,
|
|
581
|
+
truncated: fullOutput.truncated,
|
|
582
|
+
...(fullOutput.truncated && snapshot.fullOutputPath
|
|
583
|
+
? { full_output_path: snapshot.fullOutputPath }
|
|
584
|
+
: {}),
|
|
585
|
+
exit_code: exitCode,
|
|
586
|
+
wall_time_seconds: Math.round((Date.now() - startedAt) / 100) / 10,
|
|
587
|
+
};
|
|
569
588
|
if (exitCode !== 0) {
|
|
570
589
|
return {
|
|
571
590
|
content: [{ type: "text", text: appendStatus(outputText, `Command exited with code ${exitCode}`) }],
|
|
572
591
|
details: { ...withTiming(details), exitCode },
|
|
573
592
|
isError: true,
|
|
593
|
+
structuredContent,
|
|
574
594
|
};
|
|
575
595
|
}
|
|
576
|
-
return { content: [{ type: "text", text: outputText }], details: withTiming(details) };
|
|
596
|
+
return { content: [{ type: "text", text: outputText }], details: withTiming(details), structuredContent };
|
|
577
597
|
}
|
|
578
598
|
finally {
|
|
579
599
|
invalidateNativeSearchCache();
|