catui-agent 1.0.0-beta.0
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/LICENSE +674 -0
- package/README.md +267 -0
- package/dist/build-meta.json +6 -0
- package/dist/builtin-extensions.d.ts +47 -0
- package/dist/builtin-extensions.js +1 -0
- package/dist/catui-defaults.d.ts +555 -0
- package/dist/catui-defaults.js +22 -0
- package/dist/cli/args.d.ts +70 -0
- package/dist/cli/args.js +158 -0
- package/dist/cli/config-selector.d.ts +10 -0
- package/dist/cli/config-selector.js +1 -0
- package/dist/cli/file-processor.d.ts +11 -0
- package/dist/cli/file-processor.js +6 -0
- package/dist/cli/list-models.d.ts +12 -0
- package/dist/cli/list-models.js +2 -0
- package/dist/cli/session-picker.d.ts +5 -0
- package/dist/cli/session-picker.js +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +2 -0
- package/dist/config.d.ts +103 -0
- package/dist/config.js +1 -0
- package/dist/core/agent-dir/agent-dir-context.d.ts +60 -0
- package/dist/core/agent-dir/agent-dir-context.js +1 -0
- package/dist/core/agent-dir/agent-metadata.d.ts +48 -0
- package/dist/core/agent-dir/agent-metadata.js +1 -0
- package/dist/core/agent-dir/migration-tool.d.ts +40 -0
- package/dist/core/agent-dir/migration-tool.js +7 -0
- package/dist/core/export-html/AGENT.md +12 -0
- package/dist/core/export-html/ansi-to-html.d.ts +9 -0
- package/dist/core/export-html/ansi-to-html.js +2 -0
- package/dist/core/export-html/index.d.ts +39 -0
- package/dist/core/export-html/index.js +2 -0
- package/dist/core/export-html/template.css +971 -0
- package/dist/core/export-html/template.html +54 -0
- package/dist/core/export-html/template.js +66 -0
- package/dist/core/export-html/tool-renderer.d.ts +28 -0
- package/dist/core/export-html/tool-renderer.js +1 -0
- package/dist/core/export-html/vendor/highlight.min.js +4 -0
- package/dist/core/export-html/vendor/marked.min.js +56 -0
- package/dist/core/extensions-host/index.d.ts +13 -0
- package/dist/core/extensions-host/index.js +1 -0
- package/dist/core/extensions-host/loader.d.ts +21 -0
- package/dist/core/extensions-host/loader.js +1 -0
- package/dist/core/extensions-host/runner.d.ts +233 -0
- package/dist/core/extensions-host/runner.js +3 -0
- package/dist/core/extensions-host/types.d.ts +1079 -0
- package/dist/core/extensions-host/types.js +1 -0
- package/dist/core/extensions-host/wrapper.d.ts +29 -0
- package/dist/core/extensions-host/wrapper.js +2 -0
- package/dist/core/index.d.ts +17 -0
- package/dist/core/index.js +1 -0
- package/dist/core/lib/agent-core/src/agent-loop-continuations.d.ts +17 -0
- package/dist/core/lib/agent-core/src/agent-loop-continuations.js +1 -0
- package/dist/core/lib/agent-core/src/agent-loop-stream-events.d.ts +19 -0
- package/dist/core/lib/agent-core/src/agent-loop-stream-events.js +1 -0
- package/dist/core/lib/agent-core/src/agent-loop-tool-results.d.ts +10 -0
- package/dist/core/lib/agent-core/src/agent-loop-tool-results.js +3 -0
- package/dist/core/lib/agent-core/src/agent-loop-tool-summaries.d.ts +22 -0
- package/dist/core/lib/agent-core/src/agent-loop-tool-summaries.js +1 -0
- package/dist/core/lib/agent-core/src/agent-loop.d.ts +26 -0
- package/dist/core/lib/agent-core/src/agent-loop.js +4 -0
- package/dist/core/lib/agent-core/src/agent-run-result.d.ts +9 -0
- package/dist/core/lib/agent-core/src/agent-run-result.js +1 -0
- package/dist/core/lib/agent-core/src/agent.d.ts +215 -0
- package/dist/core/lib/agent-core/src/agent.js +1 -0
- package/dist/core/lib/agent-core/src/errors.d.ts +62 -0
- package/dist/core/lib/agent-core/src/errors.js +1 -0
- package/dist/core/lib/agent-core/src/index.d.ts +14 -0
- package/dist/core/lib/agent-core/src/index.js +1 -0
- package/dist/core/lib/agent-core/src/proxy.d.ts +91 -0
- package/dist/core/lib/agent-core/src/proxy.js +2 -0
- package/dist/core/lib/agent-core/src/structured-adaptive-agent-loop.d.ts +15 -0
- package/dist/core/lib/agent-core/src/structured-adaptive-agent-loop.js +2 -0
- package/dist/core/lib/agent-core/src/structured-adaptive-streaming-tool-executor.d.ts +33 -0
- package/dist/core/lib/agent-core/src/structured-adaptive-streaming-tool-executor.js +1 -0
- package/dist/core/lib/agent-core/src/structured-adaptive-tool-orchestration.d.ts +35 -0
- package/dist/core/lib/agent-core/src/structured-adaptive-tool-orchestration.js +3 -0
- package/dist/core/lib/agent-core/src/types.d.ts +417 -0
- package/dist/core/lib/agent-core/src/types.js +1 -0
- package/dist/core/lib/ai/src/api-registry.d.ts +27 -0
- package/dist/core/lib/ai/src/api-registry.js +1 -0
- package/dist/core/lib/ai/src/config-path.d.ts +1 -0
- package/dist/core/lib/ai/src/config-path.js +1 -0
- package/dist/core/lib/ai/src/debug-logger.d.ts +94 -0
- package/dist/core/lib/ai/src/debug-logger.js +4 -0
- package/dist/core/lib/ai/src/env-api-keys.d.ts +8 -0
- package/dist/core/lib/ai/src/env-api-keys.js +1 -0
- package/dist/core/lib/ai/src/env.d.ts +7 -0
- package/dist/core/lib/ai/src/env.js +1 -0
- package/dist/core/lib/ai/src/events.d.ts +8 -0
- package/dist/core/lib/ai/src/events.js +1 -0
- package/dist/core/lib/ai/src/index.d.ts +27 -0
- package/dist/core/lib/ai/src/index.js +1 -0
- package/dist/core/lib/ai/src/json.d.ts +7 -0
- package/dist/core/lib/ai/src/json.js +1 -0
- package/dist/core/lib/ai/src/models.d.ts +31 -0
- package/dist/core/lib/ai/src/models.generated.d.ts +15315 -0
- package/dist/core/lib/ai/src/models.generated.js +1 -0
- package/dist/core/lib/ai/src/models.js +1 -0
- package/dist/core/lib/ai/src/overflow.d.ts +7 -0
- package/dist/core/lib/ai/src/overflow.js +1 -0
- package/dist/core/lib/ai/src/providers/amazon-bedrock.d.ts +20 -0
- package/dist/core/lib/ai/src/providers/amazon-bedrock.js +1 -0
- package/dist/core/lib/ai/src/providers/anthropic.d.ts +38 -0
- package/dist/core/lib/ai/src/providers/anthropic.js +2 -0
- package/dist/core/lib/ai/src/providers/azure-openai-responses.d.ts +21 -0
- package/dist/core/lib/ai/src/providers/azure-openai-responses.js +1 -0
- package/dist/core/lib/ai/src/providers/github-copilot-headers.d.ts +13 -0
- package/dist/core/lib/ai/src/providers/github-copilot-headers.js +1 -0
- package/dist/core/lib/ai/src/providers/google-gemini-cli.d.ts +79 -0
- package/dist/core/lib/ai/src/providers/google-gemini-cli.js +2 -0
- package/dist/core/lib/ai/src/providers/google-shared.d.ts +70 -0
- package/dist/core/lib/ai/src/providers/google-shared.js +2 -0
- package/dist/core/lib/ai/src/providers/google-vertex.d.ts +20 -0
- package/dist/core/lib/ai/src/providers/google-vertex.js +1 -0
- package/dist/core/lib/ai/src/providers/google.d.ts +18 -0
- package/dist/core/lib/ai/src/providers/google.js +1 -0
- package/dist/core/lib/ai/src/providers/openai-codex-responses.d.ts +8 -0
- package/dist/core/lib/ai/src/providers/openai-codex-responses.js +7 -0
- package/dist/core/lib/ai/src/providers/openai-completions.d.ts +20 -0
- package/dist/core/lib/ai/src/providers/openai-completions.js +6 -0
- package/dist/core/lib/ai/src/providers/openai-responses-shared.d.ts +22 -0
- package/dist/core/lib/ai/src/providers/openai-responses-shared.js +10 -0
- package/dist/core/lib/ai/src/providers/openai-responses.d.ts +19 -0
- package/dist/core/lib/ai/src/providers/openai-responses.js +1 -0
- package/dist/core/lib/ai/src/providers/register-builtins.d.ts +8 -0
- package/dist/core/lib/ai/src/providers/register-builtins.js +1 -0
- package/dist/core/lib/ai/src/providers/simple-options.d.ts +13 -0
- package/dist/core/lib/ai/src/providers/simple-options.js +1 -0
- package/dist/core/lib/ai/src/providers/transform-messages.d.ts +13 -0
- package/dist/core/lib/ai/src/providers/transform-messages.js +1 -0
- package/dist/core/lib/ai/src/registry.d.ts +8 -0
- package/dist/core/lib/ai/src/registry.js +1 -0
- package/dist/core/lib/ai/src/schema.d.ts +10 -0
- package/dist/core/lib/ai/src/schema.js +1 -0
- package/dist/core/lib/ai/src/stream.d.ts +33 -0
- package/dist/core/lib/ai/src/stream.js +1 -0
- package/dist/core/lib/ai/src/types.d.ts +331 -0
- package/dist/core/lib/ai/src/types.js +0 -0
- package/dist/core/lib/ai/src/utils/event-stream-types.d.ts +12 -0
- package/dist/core/lib/ai/src/utils/event-stream-types.js +0 -0
- package/dist/core/lib/ai/src/utils/event-stream.d.ts +31 -0
- package/dist/core/lib/ai/src/utils/event-stream.js +1 -0
- package/dist/core/lib/ai/src/utils/http-proxy.d.ts +13 -0
- package/dist/core/lib/ai/src/utils/http-proxy.js +1 -0
- package/dist/core/lib/ai/src/utils/json-parse.d.ts +14 -0
- package/dist/core/lib/ai/src/utils/json-parse.js +1 -0
- package/dist/core/lib/ai/src/utils/oauth/anthropic.d.ts +22 -0
- package/dist/core/lib/ai/src/utils/oauth/anthropic.js +1 -0
- package/dist/core/lib/ai/src/utils/oauth/decode-credential.d.ts +12 -0
- package/dist/core/lib/ai/src/utils/oauth/decode-credential.js +1 -0
- package/dist/core/lib/ai/src/utils/oauth/github-copilot.d.ts +35 -0
- package/dist/core/lib/ai/src/utils/oauth/github-copilot.js +1 -0
- package/dist/core/lib/ai/src/utils/oauth/google-antigravity.d.ts +31 -0
- package/dist/core/lib/ai/src/utils/oauth/google-antigravity.js +1 -0
- package/dist/core/lib/ai/src/utils/oauth/google-gemini-cli.d.ts +31 -0
- package/dist/core/lib/ai/src/utils/oauth/google-gemini-cli.js +1 -0
- package/dist/core/lib/ai/src/utils/oauth/index.d.ts +60 -0
- package/dist/core/lib/ai/src/utils/oauth/index.js +1 -0
- package/dist/core/lib/ai/src/utils/oauth/openai-codex.d.ts +39 -0
- package/dist/core/lib/ai/src/utils/oauth/openai-codex.js +11 -0
- package/dist/core/lib/ai/src/utils/oauth/pkce.d.ts +18 -0
- package/dist/core/lib/ai/src/utils/oauth/pkce.js +1 -0
- package/dist/core/lib/ai/src/utils/oauth/types.d.ts +52 -0
- package/dist/core/lib/ai/src/utils/oauth/types.js +0 -0
- package/dist/core/lib/ai/src/utils/overflow.d.ts +57 -0
- package/dist/core/lib/ai/src/utils/overflow.js +1 -0
- package/dist/core/lib/ai/src/utils/sanitize-unicode.d.ts +16 -0
- package/dist/core/lib/ai/src/utils/sanitize-unicode.js +1 -0
- package/dist/core/lib/ai/src/utils/typebox-helpers.d.ts +22 -0
- package/dist/core/lib/ai/src/utils/typebox-helpers.js +1 -0
- package/dist/core/lib/ai/src/utils/validation.d.ts +23 -0
- package/dist/core/lib/ai/src/utils/validation.js +6 -0
- package/dist/core/lib/tui/src/autocomplete.d.ts +62 -0
- package/dist/core/lib/tui/src/autocomplete.js +2 -0
- package/dist/core/lib/tui/src/components/box.d.ts +27 -0
- package/dist/core/lib/tui/src/components/box.js +1 -0
- package/dist/core/lib/tui/src/components/cached-container.d.ts +42 -0
- package/dist/core/lib/tui/src/components/cached-container.js +1 -0
- package/dist/core/lib/tui/src/components/cancellable-loader.d.ts +27 -0
- package/dist/core/lib/tui/src/components/cancellable-loader.js +1 -0
- package/dist/core/lib/tui/src/components/editor.d.ts +222 -0
- package/dist/core/lib/tui/src/components/editor.js +21 -0
- package/dist/core/lib/tui/src/components/image.d.ts +33 -0
- package/dist/core/lib/tui/src/components/image.js +1 -0
- package/dist/core/lib/tui/src/components/input.d.ts +42 -0
- package/dist/core/lib/tui/src/components/input.js +2 -0
- package/dist/core/lib/tui/src/components/loader.d.ts +26 -0
- package/dist/core/lib/tui/src/components/loader.js +1 -0
- package/dist/core/lib/tui/src/components/markdown.d.ts +100 -0
- package/dist/core/lib/tui/src/components/markdown.js +7 -0
- package/dist/core/lib/tui/src/components/select-list.d.ts +37 -0
- package/dist/core/lib/tui/src/components/select-list.js +1 -0
- package/dist/core/lib/tui/src/components/settings-list.d.ts +55 -0
- package/dist/core/lib/tui/src/components/settings-list.js +1 -0
- package/dist/core/lib/tui/src/components/spacer.d.ts +17 -0
- package/dist/core/lib/tui/src/components/spacer.js +1 -0
- package/dist/core/lib/tui/src/components/text.d.ts +24 -0
- package/dist/core/lib/tui/src/components/text.js +1 -0
- package/dist/core/lib/tui/src/components/truncated-text.d.ts +18 -0
- package/dist/core/lib/tui/src/components/truncated-text.js +2 -0
- package/dist/core/lib/tui/src/editor-component.d.ts +51 -0
- package/dist/core/lib/tui/src/editor-component.js +0 -0
- package/dist/core/lib/tui/src/fuzzy.d.ts +32 -0
- package/dist/core/lib/tui/src/fuzzy.js +1 -0
- package/dist/core/lib/tui/src/index.d.ts +29 -0
- package/dist/core/lib/tui/src/index.js +1 -0
- package/dist/core/lib/tui/src/keybindings.d.ts +44 -0
- package/dist/core/lib/tui/src/keybindings.js +1 -0
- package/dist/core/lib/tui/src/keys.d.ts +149 -0
- package/dist/core/lib/tui/src/keys.js +5 -0
- package/dist/core/lib/tui/src/kill-ring.d.ts +33 -0
- package/dist/core/lib/tui/src/kill-ring.js +1 -0
- package/dist/core/lib/tui/src/stdin-buffer.d.ts +38 -0
- package/dist/core/lib/tui/src/stdin-buffer.js +1 -0
- package/dist/core/lib/tui/src/terminal-image.d.ts +73 -0
- package/dist/core/lib/tui/src/terminal-image.js +1 -0
- package/dist/core/lib/tui/src/terminal.d.ts +86 -0
- package/dist/core/lib/tui/src/terminal.js +1 -0
- package/dist/core/lib/tui/src/tui.d.ts +220 -0
- package/dist/core/lib/tui/src/tui.js +12 -0
- package/dist/core/lib/tui/src/undo-stack.d.ts +22 -0
- package/dist/core/lib/tui/src/undo-stack.js +1 -0
- package/dist/core/lib/tui/src/utils.d.ts +83 -0
- package/dist/core/lib/tui/src/utils.js +2 -0
- package/dist/core/mcp/figma-auth.d.ts +21 -0
- package/dist/core/mcp/figma-auth.js +22 -0
- package/dist/core/mcp/index.d.ts +11 -0
- package/dist/core/mcp/index.js +1 -0
- package/dist/core/mcp/mcp-adapter.d.ts +21 -0
- package/dist/core/mcp/mcp-adapter.js +3 -0
- package/dist/core/mcp/mcp-client.d.ts +91 -0
- package/dist/core/mcp/mcp-client.js +6 -0
- package/dist/core/mcp/mcp-config.d.ts +55 -0
- package/dist/core/mcp/mcp-config.js +1 -0
- package/dist/core/mcp/mcp-guidance.d.ts +52 -0
- package/dist/core/mcp/mcp-guidance.js +54 -0
- package/dist/core/mcp/mcp-manager.d.ts +51 -0
- package/dist/core/mcp/mcp-manager.js +1 -0
- package/dist/core/mcp/mcp-types.d.ts +62 -0
- package/dist/core/mcp/mcp-types.js +0 -0
- package/dist/core/messages.d.ts +77 -0
- package/dist/core/messages.js +17 -0
- package/dist/core/model/custom-providers.d.ts +34 -0
- package/dist/core/model/custom-providers.js +1 -0
- package/dist/core/model/discovery-cache.d.ts +65 -0
- package/dist/core/model/discovery-cache.js +1 -0
- package/dist/core/model/discovery-cache.test.d.ts +7 -0
- package/dist/core/model/discovery-cache.test.js +1 -0
- package/dist/core/model/discovery.d.ts +79 -0
- package/dist/core/model/discovery.js +1 -0
- package/dist/core/model/discovery.test.d.ts +7 -0
- package/dist/core/model/discovery.test.js +1 -0
- package/dist/core/model/index.d.ts +10 -0
- package/dist/core/model/index.js +1 -0
- package/dist/core/model/known-models.d.ts +65 -0
- package/dist/core/model/known-models.generated.d.ts +2 -0
- package/dist/core/model/known-models.generated.js +1 -0
- package/dist/core/model/known-models.js +1 -0
- package/dist/core/model/switcher.d.ts +80 -0
- package/dist/core/model/switcher.js +1 -0
- package/dist/core/model-registry.d.ts +186 -0
- package/dist/core/model-registry.js +9 -0
- package/dist/core/model-resolver.d.ts +106 -0
- package/dist/core/model-resolver.js +1 -0
- package/dist/core/package-manager.d.ts +156 -0
- package/dist/core/package-manager.js +3 -0
- package/dist/core/persona/persona-manager.d.ts +35 -0
- package/dist/core/persona/persona-manager.js +5 -0
- package/dist/core/platform/abort-slot.d.ts +26 -0
- package/dist/core/platform/abort-slot.js +1 -0
- package/dist/core/platform/config/auth-storage.d.ts +126 -0
- package/dist/core/platform/config/auth-storage.js +1 -0
- package/dist/core/platform/config/defaults.d.ts +8 -0
- package/dist/core/platform/config/defaults.js +1 -0
- package/dist/core/platform/config/diagnostics.d.ts +20 -0
- package/dist/core/platform/config/diagnostics.js +0 -0
- package/dist/core/platform/config/resolve-config-value.d.ts +12 -0
- package/dist/core/platform/config/resolve-config-value.js +1 -0
- package/dist/core/platform/config/resource-loader.d.ts +188 -0
- package/dist/core/platform/config/resource-loader.js +2 -0
- package/dist/core/platform/config/settings-manager.d.ts +314 -0
- package/dist/core/platform/config/settings-manager.js +1 -0
- package/dist/core/platform/exec/bash-executor.d.ts +41 -0
- package/dist/core/platform/exec/bash-executor.js +1 -0
- package/dist/core/platform/exec/exec.d.ts +25 -0
- package/dist/core/platform/exec/exec.js +1 -0
- package/dist/core/platform/i18n/index.d.ts +26 -0
- package/dist/core/platform/i18n/index.js +1 -0
- package/dist/core/platform/i18n/messages.d.ts +56 -0
- package/dist/core/platform/i18n/messages.js +1 -0
- package/dist/core/platform/i18n/messages.zh.d.ts +56 -0
- package/dist/core/platform/i18n/messages.zh.js +1 -0
- package/dist/core/platform/i18n/slash-commands.d.ts +53 -0
- package/dist/core/platform/i18n/slash-commands.js +1 -0
- package/dist/core/platform/i18n/slash-commands.zh.d.ts +53 -0
- package/dist/core/platform/i18n/slash-commands.zh.js +1 -0
- package/dist/core/platform/i18n/themes.d.ts +11 -0
- package/dist/core/platform/i18n/themes.js +1 -0
- package/dist/core/platform/i18n/themes.zh.d.ts +11 -0
- package/dist/core/platform/i18n/themes.zh.js +1 -0
- package/dist/core/platform/keybindings.d.ts +61 -0
- package/dist/core/platform/keybindings.js +1 -0
- package/dist/core/platform/listeners.d.ts +21 -0
- package/dist/core/platform/listeners.js +1 -0
- package/dist/core/platform/telemetry/batching-dispatcher.d.ts +41 -0
- package/dist/core/platform/telemetry/batching-dispatcher.js +1 -0
- package/dist/core/platform/telemetry/build-meta.d.ts +12 -0
- package/dist/core/platform/telemetry/build-meta.js +1 -0
- package/dist/core/platform/telemetry/caller-context.d.ts +32 -0
- package/dist/core/platform/telemetry/caller-context.js +1 -0
- package/dist/core/platform/telemetry/credentials.d.ts +27 -0
- package/dist/core/platform/telemetry/credentials.js +1 -0
- package/dist/core/platform/telemetry/ext-events.d.ts +89 -0
- package/dist/core/platform/telemetry/ext-events.js +1 -0
- package/dist/core/platform/telemetry/index.d.ts +13 -0
- package/dist/core/platform/telemetry/index.js +1 -0
- package/dist/core/platform/telemetry/insforge-base.d.ts +37 -0
- package/dist/core/platform/telemetry/insforge-base.js +1 -0
- package/dist/core/platform/telemetry/types.d.ts +33 -0
- package/dist/core/platform/telemetry/types.js +0 -0
- package/dist/core/platform/timings.d.ts +2 -0
- package/dist/core/platform/timings.js +3 -0
- package/dist/core/platform/utils/logger.d.ts +75 -0
- package/dist/core/platform/utils/logger.js +1 -0
- package/dist/core/platform/utils/shell.d.ts +25 -0
- package/dist/core/platform/utils/shell.js +9 -0
- package/dist/core/platform/utils/sleep.d.ts +7 -0
- package/dist/core/platform/utils/sleep.js +1 -0
- package/dist/core/platform/utils/tools-manager.d.ts +19 -0
- package/dist/core/platform/utils/tools-manager.js +1 -0
- package/dist/core/prompt/prompt-templates.d.ts +49 -0
- package/dist/core/prompt/prompt-templates.js +2 -0
- package/dist/core/prompt/system-prompt.d.ts +24 -0
- package/dist/core/prompt/system-prompt.js +139 -0
- package/dist/core/runtime/agent-session.d.ts +676 -0
- package/dist/core/runtime/agent-session.js +15 -0
- package/dist/core/runtime/bash-runner.d.ts +56 -0
- package/dist/core/runtime/bash-runner.js +2 -0
- package/dist/core/runtime/catui-agent.d.ts +182 -0
- package/dist/core/runtime/catui-agent.js +1 -0
- package/dist/core/runtime/compaction-controller.d.ts +43 -0
- package/dist/core/runtime/compaction-controller.js +1 -0
- package/dist/core/runtime/default-tools.d.ts +9 -0
- package/dist/core/runtime/default-tools.js +1 -0
- package/dist/core/runtime/event-bridge.d.ts +21 -0
- package/dist/core/runtime/event-bridge.js +1 -0
- package/dist/core/runtime/event-bus.d.ts +8 -0
- package/dist/core/runtime/event-bus.js +1 -0
- package/dist/core/runtime/export-bridge.d.ts +23 -0
- package/dist/core/runtime/export-bridge.js +1 -0
- package/dist/core/runtime/extension-core-bindings.d.ts +46 -0
- package/dist/core/runtime/extension-core-bindings.js +3 -0
- package/dist/core/runtime/model-controller.d.ts +84 -0
- package/dist/core/runtime/model-controller.js +1 -0
- package/dist/core/runtime/model-cycle.d.ts +20 -0
- package/dist/core/runtime/model-cycle.js +1 -0
- package/dist/core/runtime/prompt-assembly.d.ts +20 -0
- package/dist/core/runtime/prompt-assembly.js +3 -0
- package/dist/core/runtime/retry-coordinator.d.ts +84 -0
- package/dist/core/runtime/retry-coordinator.js +1 -0
- package/dist/core/runtime/sdk.d.ts +163 -0
- package/dist/core/runtime/sdk.js +1 -0
- package/dist/core/runtime/session-context.d.ts +155 -0
- package/dist/core/runtime/session-context.js +0 -0
- package/dist/core/runtime/session-lifecycle-controller.d.ts +42 -0
- package/dist/core/runtime/session-lifecycle-controller.js +1 -0
- package/dist/core/runtime/session-tree-controller.d.ts +40 -0
- package/dist/core/runtime/session-tree-controller.js +1 -0
- package/dist/core/runtime/slash-command-catalog.d.ts +27 -0
- package/dist/core/runtime/slash-command-catalog.js +1 -0
- package/dist/core/runtime/thinking-levels.d.ts +31 -0
- package/dist/core/runtime/thinking-levels.js +1 -0
- package/dist/core/runtime/tool-runtime-controller.d.ts +35 -0
- package/dist/core/runtime/tool-runtime-controller.js +1 -0
- package/dist/core/runtime/turn-context.d.ts +52 -0
- package/dist/core/runtime/turn-context.js +1 -0
- package/dist/core/session/compaction/branch-summarization.d.ts +85 -0
- package/dist/core/session/compaction/branch-summarization.js +38 -0
- package/dist/core/session/compaction/compaction.d.ts +120 -0
- package/dist/core/session/compaction/compaction.js +104 -0
- package/dist/core/session/compaction/index.d.ts +9 -0
- package/dist/core/session/compaction/index.js +1 -0
- package/dist/core/session/compaction/utils.d.ts +37 -0
- package/dist/core/session/compaction/utils.js +17 -0
- package/dist/core/session/session-manager.d.ts +359 -0
- package/dist/core/session/session-manager.js +14 -0
- package/dist/core/skills.d.ts +57 -0
- package/dist/core/skills.js +4 -0
- package/dist/core/slash-commands.d.ts +36 -0
- package/dist/core/slash-commands.js +1 -0
- package/dist/core/soul-integration.d.ts +77 -0
- package/dist/core/soul-integration.js +1 -0
- package/dist/core/soul-options-contract.d.ts +10 -0
- package/dist/core/soul-options-contract.js +0 -0
- package/dist/core/sub-agent/agent-definition-loader.d.ts +96 -0
- package/dist/core/sub-agent/agent-definition-loader.js +2 -0
- package/dist/core/sub-agent/agent-definition.d.ts +162 -0
- package/dist/core/sub-agent/agent-definition.js +6 -0
- package/dist/core/sub-agent/agent-handoff-safety.d.ts +39 -0
- package/dist/core/sub-agent/agent-handoff-safety.js +1 -0
- package/dist/core/sub-agent/agent-input-output.d.ts +143 -0
- package/dist/core/sub-agent/agent-input-output.js +1 -0
- package/dist/core/sub-agent/agent-output-persistence.d.ts +43 -0
- package/dist/core/sub-agent/agent-output-persistence.js +3 -0
- package/dist/core/sub-agent/agent-prompt-builder.d.ts +37 -0
- package/dist/core/sub-agent/agent-prompt-builder.js +2 -0
- package/dist/core/sub-agent/agent-registry.d.ts +145 -0
- package/dist/core/sub-agent/agent-registry.js +1 -0
- package/dist/core/sub-agent/agent-result-extractor.d.ts +28 -0
- package/dist/core/sub-agent/agent-result-extractor.js +3 -0
- package/dist/core/sub-agent/agent-telemetry.d.ts +71 -0
- package/dist/core/sub-agent/agent-telemetry.js +1 -0
- package/dist/core/sub-agent/agent-tool-filter.d.ts +89 -0
- package/dist/core/sub-agent/agent-tool-filter.js +2 -0
- package/dist/core/sub-agent/agent-tool.d.ts +69 -0
- package/dist/core/sub-agent/agent-tool.js +11 -0
- package/dist/core/sub-agent/index.d.ts +26 -0
- package/dist/core/sub-agent/index.js +1 -0
- package/dist/core/sub-agent/send-message-tool.d.ts +33 -0
- package/dist/core/sub-agent/send-message-tool.js +2 -0
- package/dist/core/sub-agent/sub-agent-backend.d.ts +26 -0
- package/dist/core/sub-agent/sub-agent-backend.js +7 -0
- package/dist/core/sub-agent/sub-agent-runtime.d.ts +34 -0
- package/dist/core/sub-agent/sub-agent-runtime.js +1 -0
- package/dist/core/sub-agent/sub-agent-types.d.ts +138 -0
- package/dist/core/sub-agent/sub-agent-types.js +0 -0
- package/dist/core/sub-agent/subprocess-backend.d.ts +35 -0
- package/dist/core/sub-agent/subprocess-backend.js +1 -0
- package/dist/core/sub-agent/subprocess-worker.d.ts +12 -0
- package/dist/core/sub-agent/subprocess-worker.js +1 -0
- package/dist/core/theme-contract.d.ts +32 -0
- package/dist/core/theme-contract.js +0 -0
- package/dist/core/tools/bash.d.ts +73 -0
- package/dist/core/tools/bash.js +21 -0
- package/dist/core/tools/edit-diff.d.ts +58 -0
- package/dist/core/tools/edit-diff.js +16 -0
- package/dist/core/tools/edit.d.ts +46 -0
- package/dist/core/tools/edit.js +1 -0
- package/dist/core/tools/file-state-cache.d.ts +30 -0
- package/dist/core/tools/file-state-cache.js +1 -0
- package/dist/core/tools/find.d.ts +46 -0
- package/dist/core/tools/find.js +8 -0
- package/dist/core/tools/grep.d.ts +58 -0
- package/dist/core/tools/grep.js +13 -0
- package/dist/core/tools/index.d.ts +116 -0
- package/dist/core/tools/index.js +1 -0
- package/dist/core/tools/input-validation.d.ts +13 -0
- package/dist/core/tools/input-validation.js +1 -0
- package/dist/core/tools/ls.d.ts +45 -0
- package/dist/core/tools/ls.js +4 -0
- package/dist/core/tools/orchestrator.d.ts +76 -0
- package/dist/core/tools/orchestrator.js +1 -0
- package/dist/core/tools/path-utils.d.ts +7 -0
- package/dist/core/tools/path-utils.js +1 -0
- package/dist/core/tools/pdf-extract.d.ts +11 -0
- package/dist/core/tools/pdf-extract.js +1 -0
- package/dist/core/tools/read.d.ts +46 -0
- package/dist/core/tools/read.js +11 -0
- package/dist/core/tools/source.d.ts +78 -0
- package/dist/core/tools/source.js +1 -0
- package/dist/core/tools/time.d.ts +19 -0
- package/dist/core/tools/time.js +2 -0
- package/dist/core/tools/truncate.d.ts +66 -0
- package/dist/core/tools/truncate.js +5 -0
- package/dist/core/tools/write-guard.d.ts +2 -0
- package/dist/core/tools/write-guard.js +1 -0
- package/dist/core/tools/write.d.ts +36 -0
- package/dist/core/tools/write.js +1 -0
- package/dist/core/workspace/index.d.ts +8 -0
- package/dist/core/workspace/index.js +1 -0
- package/dist/core/workspace/worktree-manager.d.ts +73 -0
- package/dist/core/workspace/worktree-manager.js +3 -0
- package/dist/extensions/builtin/AGENT.md +115 -0
- package/dist/extensions/builtin/ask-user-question/ask-user-question-tool.d.ts +9 -0
- package/dist/extensions/builtin/ask-user-question/ask-user-question-tool.js +4 -0
- package/dist/extensions/builtin/ask-user-question/index.d.ts +8 -0
- package/dist/extensions/builtin/ask-user-question/index.js +1 -0
- package/dist/extensions/builtin/ask-user-question/prompt.d.ts +14 -0
- package/dist/extensions/builtin/ask-user-question/prompt.js +30 -0
- package/dist/extensions/builtin/ask-user-question/types.d.ts +69 -0
- package/dist/extensions/builtin/ask-user-question/types.js +1 -0
- package/dist/extensions/builtin/browser/AGENT.md +17 -0
- package/dist/extensions/builtin/browser/agent-workspace/agent_helpers.py +12 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/amazon/product-search.md +198 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/archive-org/scraping.md +341 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/arxiv/scraping.md +311 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/arxiv-bulk/scraping.md +333 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/atlas/overview.md +70 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/booking-com/scraping.md +578 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/capterra/scraping.md +440 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/centilebrain/generate-estimates.md +110 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/coingecko/scraping.md +325 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/coinmarketcap/scraping.md +463 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/coursera/scraping.md +360 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/craigslist/scraping.md +390 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/crossref/scraping.md +568 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/dev-to/scraping.md +323 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/duckduckgo/scraping.md +349 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/ebay/scraping.md +435 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/etsy/scraping.md +506 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/eventbrite/scraping.md +363 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/expedia/automation.md +168 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/facebook/groups.md +236 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/facebook/pages.md +295 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/framer/editor.md +108 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/fred/scraping.md +493 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/g2/scraping.md +580 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/genius/scraping.md +511 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/github/repo-actions.md +65 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/github/scraping.md +184 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/glassdoor/scraping.md +543 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/gmail/compose.md +122 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/goodreads/scraping.md +461 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/gutenberg/scraping.md +383 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/hackernews/scraping.md +243 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/howlongtobeat/scraping.md +473 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/imdb/scraping.md +271 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/itch-io/scraping.md +436 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/job-boards/indeed-glassdoor.md +1021 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/letterboxd/scraping.md +349 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/linkedin/invitation-manager.md +109 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/loom/folder-enumeration.md +170 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/macrotrends/scraping.md +537 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/medium/article-hydration.md +120 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/medium/scraping.md +414 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/metacritic/scraping.md +477 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/musicbrainz/scraping.md +478 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/nasa/scraping.md +339 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/news-aggregation/multi-source.md +205 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/open-library/scraping.md +472 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/openalex/scraping.md +470 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/openstreetmap/scraping.md +490 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/package-registries/npm-pypi.md +478 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/polymarket/scraping.md +234 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/producthunt/scraping.md +307 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/pubmed/scraping.md +421 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/quora/scraping.md +364 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/rawg/scraping.md +352 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/reddit/scraping.md +124 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/rest-countries/scraping.md +233 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/sec-edgar/scraping.md +361 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/shopify-admin/README.md +36 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/shopify-admin/embedded-apps.md +72 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/shopify-admin/knowledge-base.md +109 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/shopify-admin/polaris-inputs.md +137 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/soundcloud/scraping.md +362 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/spotify/scraping.md +339 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/stackoverflow/scraping.md +435 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/steam/scraping.md +575 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/substack/scraping.md +338 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/thetechgeeks/pricing.md +52 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/tiktok/upload.md +107 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/tradingview/scraping.md +309 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/trello/boards-and-lists.md +88 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/trustpilot/scraping.md +375 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/walmart/scraping.md +444 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/wayback-machine/scraping.md +306 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/weather/scraping.md +398 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/wellfound/scraping.md +596 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/world-bank/scraping.md +356 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/xiaohongshu/scraping.md +84 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/youtube/scraping.md +418 -0
- package/dist/extensions/builtin/browser/agent-workspace/domain-skills/zillow/scraping.md +433 -0
- package/dist/extensions/builtin/browser/browser.md +73 -0
- package/dist/extensions/builtin/browser/index.d.ts +8 -0
- package/dist/extensions/builtin/browser/index.js +15 -0
- package/dist/extensions/builtin/browser/install.md +142 -0
- package/dist/extensions/builtin/browser/interaction-skills/connection.md +48 -0
- package/dist/extensions/builtin/browser/interaction-skills/cookies.md +3 -0
- package/dist/extensions/builtin/browser/interaction-skills/cross-origin-iframes.md +3 -0
- package/dist/extensions/builtin/browser/interaction-skills/dialogs.md +64 -0
- package/dist/extensions/builtin/browser/interaction-skills/downloads.md +3 -0
- package/dist/extensions/builtin/browser/interaction-skills/drag-and-drop.md +3 -0
- package/dist/extensions/builtin/browser/interaction-skills/dropdowns.md +3 -0
- package/dist/extensions/builtin/browser/interaction-skills/iframes.md +3 -0
- package/dist/extensions/builtin/browser/interaction-skills/network-requests.md +3 -0
- package/dist/extensions/builtin/browser/interaction-skills/print-as-pdf.md +3 -0
- package/dist/extensions/builtin/browser/interaction-skills/profile-sync.md +90 -0
- package/dist/extensions/builtin/browser/interaction-skills/screenshots.md +17 -0
- package/dist/extensions/builtin/browser/interaction-skills/scrolling.md +3 -0
- package/dist/extensions/builtin/browser/interaction-skills/shadow-dom.md +3 -0
- package/dist/extensions/builtin/browser/interaction-skills/tabs.md +69 -0
- package/dist/extensions/builtin/browser/interaction-skills/uploads.md +1 -0
- package/dist/extensions/builtin/browser/interaction-skills/viewport.md +3 -0
- package/dist/extensions/builtin/browser/src/browser_harness/AGENT.md +15 -0
- package/dist/extensions/builtin/browser/src/browser_harness/__init__.py +8 -0
- package/dist/extensions/builtin/browser/src/browser_harness/_ipc.py +90 -0
- package/dist/extensions/builtin/browser/src/browser_harness/admin.py +722 -0
- package/dist/extensions/builtin/browser/src/browser_harness/daemon.py +328 -0
- package/dist/extensions/builtin/browser/src/browser_harness/helpers.py +396 -0
- package/dist/extensions/builtin/browser/src/browser_harness/run.py +103 -0
- package/dist/extensions/builtin/btw/index.d.ts +8 -0
- package/dist/extensions/builtin/btw/index.js +15 -0
- package/dist/extensions/builtin/debug/collectors.d.ts +96 -0
- package/dist/extensions/builtin/debug/collectors.js +7 -0
- package/dist/extensions/builtin/debug/index.d.ts +8 -0
- package/dist/extensions/builtin/debug/index.js +49 -0
- package/dist/extensions/builtin/diagnostics/diagnostic-buffer.d.ts +19 -0
- package/dist/extensions/builtin/diagnostics/diagnostic-buffer.js +1 -0
- package/dist/extensions/builtin/diagnostics/index.d.ts +8 -0
- package/dist/extensions/builtin/diagnostics/index.js +1 -0
- package/dist/extensions/builtin/diagnostics/redaction.d.ts +8 -0
- package/dist/extensions/builtin/diagnostics/redaction.js +1 -0
- package/dist/extensions/builtin/diagnostics/reporter.d.ts +17 -0
- package/dist/extensions/builtin/diagnostics/reporter.js +1 -0
- package/dist/extensions/builtin/diagnostics/types.d.ts +62 -0
- package/dist/extensions/builtin/diagnostics/types.js +1 -0
- package/dist/extensions/builtin/discipline/index.d.ts +8 -0
- package/dist/extensions/builtin/discipline/index.js +7 -0
- package/dist/extensions/builtin/discipline/skills/brainstorming/SKILL.md +33 -0
- package/dist/extensions/builtin/discipline/skills/executing-plans/SKILL.md +25 -0
- package/dist/extensions/builtin/discipline/skills/finishing-development-branch/SKILL.md +25 -0
- package/dist/extensions/builtin/discipline/skills/receiving-code-review/SKILL.md +22 -0
- package/dist/extensions/builtin/discipline/skills/requesting-code-review/SKILL.md +31 -0
- package/dist/extensions/builtin/discipline/skills/systematic-debugging/SKILL.md +28 -0
- package/dist/extensions/builtin/discipline/skills/test-driven-development/SKILL.md +32 -0
- package/dist/extensions/builtin/discipline/skills/using-git-worktrees/SKILL.md +25 -0
- package/dist/extensions/builtin/discipline/skills/verification-before-completion/SKILL.md +27 -0
- package/dist/extensions/builtin/discipline/skills/writing-plans/SKILL.md +26 -0
- package/dist/extensions/builtin/goal/README.md +67 -0
- package/dist/extensions/builtin/goal/goal-command.d.ts +13 -0
- package/dist/extensions/builtin/goal/goal-command.js +9 -0
- package/dist/extensions/builtin/goal/goal-controller.d.ts +143 -0
- package/dist/extensions/builtin/goal/goal-controller.js +1 -0
- package/dist/extensions/builtin/goal/goal-format.d.ts +52 -0
- package/dist/extensions/builtin/goal/goal-format.js +1 -0
- package/dist/extensions/builtin/goal/goal-parser.d.ts +27 -0
- package/dist/extensions/builtin/goal/goal-parser.js +2 -0
- package/dist/extensions/builtin/goal/goal-prompts.d.ts +15 -0
- package/dist/extensions/builtin/goal/goal-prompts.js +5 -0
- package/dist/extensions/builtin/goal/goal-store.d.ts +28 -0
- package/dist/extensions/builtin/goal/goal-store.js +1 -0
- package/dist/extensions/builtin/goal/goal-tools.d.ts +26 -0
- package/dist/extensions/builtin/goal/goal-tools.js +3 -0
- package/dist/extensions/builtin/goal/goal-types.d.ts +87 -0
- package/dist/extensions/builtin/goal/goal-types.js +1 -0
- package/dist/extensions/builtin/goal/index.d.ts +8 -0
- package/dist/extensions/builtin/goal/index.js +10 -0
- package/dist/extensions/builtin/grub/README.md +112 -0
- package/dist/extensions/builtin/grub/grub-controller.d.ts +67 -0
- package/dist/extensions/builtin/grub/grub-controller.js +1 -0
- package/dist/extensions/builtin/grub/grub-decision.d.ts +8 -0
- package/dist/extensions/builtin/grub/grub-decision.js +1 -0
- package/dist/extensions/builtin/grub/grub-feature-list.d.ts +54 -0
- package/dist/extensions/builtin/grub/grub-feature-list.js +2 -0
- package/dist/extensions/builtin/grub/grub-format.d.ts +13 -0
- package/dist/extensions/builtin/grub/grub-format.js +4 -0
- package/dist/extensions/builtin/grub/grub-harness.d.ts +9 -0
- package/dist/extensions/builtin/grub/grub-harness.js +3 -0
- package/dist/extensions/builtin/grub/grub-i18n.d.ts +166 -0
- package/dist/extensions/builtin/grub/grub-i18n.js +1 -0
- package/dist/extensions/builtin/grub/grub-parser.d.ts +24 -0
- package/dist/extensions/builtin/grub/grub-parser.js +2 -0
- package/dist/extensions/builtin/grub/grub-persistence.d.ts +17 -0
- package/dist/extensions/builtin/grub/grub-persistence.js +2 -0
- package/dist/extensions/builtin/grub/grub-prompts.d.ts +12 -0
- package/dist/extensions/builtin/grub/grub-prompts.js +97 -0
- package/dist/extensions/builtin/grub/grub-turn.d.ts +16 -0
- package/dist/extensions/builtin/grub/grub-turn.js +1 -0
- package/dist/extensions/builtin/grub/grub-types.d.ts +110 -0
- package/dist/extensions/builtin/grub/grub-types.js +1 -0
- package/dist/extensions/builtin/grub/index.d.ts +8 -0
- package/dist/extensions/builtin/grub/index.js +6 -0
- package/dist/extensions/builtin/idle-think/curiosity.d.ts +46 -0
- package/dist/extensions/builtin/idle-think/curiosity.js +2 -0
- package/dist/extensions/builtin/idle-think/idle-think-runtime.d.ts +46 -0
- package/dist/extensions/builtin/idle-think/idle-think-runtime.js +1 -0
- package/dist/extensions/builtin/idle-think/index.d.ts +15 -0
- package/dist/extensions/builtin/idle-think/index.js +1 -0
- package/dist/extensions/builtin/idle-think/insights.d.ts +27 -0
- package/dist/extensions/builtin/idle-think/insights.js +5 -0
- package/dist/extensions/builtin/idle-think/thinker.d.ts +26 -0
- package/dist/extensions/builtin/idle-think/thinker.js +9 -0
- package/dist/extensions/builtin/insights/html-report.d.ts +21 -0
- package/dist/extensions/builtin/insights/html-report.js +463 -0
- package/dist/extensions/builtin/insights/index.d.ts +24 -0
- package/dist/extensions/builtin/insights/index.js +2 -0
- package/dist/extensions/builtin/insights/insights-engine.d.ts +18 -0
- package/dist/extensions/builtin/insights/insights-engine.js +39 -0
- package/dist/extensions/builtin/insights/prompts.d.ts +17 -0
- package/dist/extensions/builtin/insights/prompts.js +180 -0
- package/dist/extensions/builtin/insights/session-scanner.d.ts +27 -0
- package/dist/extensions/builtin/insights/session-scanner.js +19 -0
- package/dist/extensions/builtin/insights/stats.d.ts +13 -0
- package/dist/extensions/builtin/insights/stats.js +1 -0
- package/dist/extensions/builtin/insights/types.d.ts +199 -0
- package/dist/extensions/builtin/insights/types.js +0 -0
- package/dist/extensions/builtin/link-world/agent-workspace/README.md +16 -0
- package/dist/extensions/builtin/link-world/index.d.ts +8 -0
- package/dist/extensions/builtin/link-world/index.js +19 -0
- package/dist/extensions/builtin/link-world/internet-search/internet-search.md +65 -0
- package/dist/extensions/builtin/link-world/link-world-agent.md +82 -0
- package/dist/extensions/builtin/link-world/linkworld.md +313 -0
- package/dist/extensions/builtin/link-world/network-routing/network-routing.md +67 -0
- package/dist/extensions/builtin/loop/README.md +92 -0
- package/dist/extensions/builtin/loop/cron/cron-parser.d.ts +56 -0
- package/dist/extensions/builtin/loop/cron/cron-parser.js +1 -0
- package/dist/extensions/builtin/loop/cron/cron-scheduler.d.ts +85 -0
- package/dist/extensions/builtin/loop/cron/cron-scheduler.js +10 -0
- package/dist/extensions/builtin/loop/cron/cron-tasks-lock.d.ts +42 -0
- package/dist/extensions/builtin/loop/cron/cron-tasks-lock.js +1 -0
- package/dist/extensions/builtin/loop/cron/cron-tasks.d.ts +200 -0
- package/dist/extensions/builtin/loop/cron/cron-tasks.js +2 -0
- package/dist/extensions/builtin/loop/cron/index.d.ts +18 -0
- package/dist/extensions/builtin/loop/cron/index.js +1 -0
- package/dist/extensions/builtin/loop/cron-tools/cron-create-tool.d.ts +35 -0
- package/dist/extensions/builtin/loop/cron-tools/cron-create-tool.js +1 -0
- package/dist/extensions/builtin/loop/cron-tools/cron-delete-tool.d.ts +29 -0
- package/dist/extensions/builtin/loop/cron-tools/cron-delete-tool.js +1 -0
- package/dist/extensions/builtin/loop/cron-tools/cron-list-tool.d.ts +25 -0
- package/dist/extensions/builtin/loop/cron-tools/cron-list-tool.js +2 -0
- package/dist/extensions/builtin/loop/cron-tools/index.d.ts +16 -0
- package/dist/extensions/builtin/loop/cron-tools/index.js +1 -0
- package/dist/extensions/builtin/loop/cron-tools/prompt.d.ts +35 -0
- package/dist/extensions/builtin/loop/cron-tools/prompt.js +38 -0
- package/dist/extensions/builtin/loop/index.d.ts +19 -0
- package/dist/extensions/builtin/loop/index.js +2 -0
- package/dist/extensions/builtin/loop/loop-skill.d.ts +18 -0
- package/dist/extensions/builtin/loop/loop-skill.js +58 -0
- package/dist/extensions/builtin/lsp/index.d.ts +8 -0
- package/dist/extensions/builtin/lsp/index.js +1 -0
- package/dist/extensions/builtin/lsp/lsp-client.d.ts +22 -0
- package/dist/extensions/builtin/lsp/lsp-client.js +1 -0
- package/dist/extensions/builtin/lsp/lsp-config.d.ts +8 -0
- package/dist/extensions/builtin/lsp/lsp-config.js +1 -0
- package/dist/extensions/builtin/lsp/lsp-formatters.d.ts +15 -0
- package/dist/extensions/builtin/lsp/lsp-formatters.js +18 -0
- package/dist/extensions/builtin/lsp/lsp-server-instance.d.ts +24 -0
- package/dist/extensions/builtin/lsp/lsp-server-instance.js +1 -0
- package/dist/extensions/builtin/lsp/lsp-server-manager.d.ts +21 -0
- package/dist/extensions/builtin/lsp/lsp-server-manager.js +1 -0
- package/dist/extensions/builtin/lsp/lsp-tool.d.ts +33 -0
- package/dist/extensions/builtin/lsp/lsp-tool.js +2 -0
- package/dist/extensions/builtin/lsp/types.d.ts +31 -0
- package/dist/extensions/builtin/lsp/types.js +1 -0
- package/dist/extensions/builtin/mcp/figma-design.md +68 -0
- package/dist/extensions/builtin/mcp/index.d.ts +14 -0
- package/dist/extensions/builtin/mcp/index.js +25 -0
- package/dist/extensions/builtin/mcp/mcp-management.md +85 -0
- package/dist/extensions/builtin/plan/clear-context-state.d.ts +8 -0
- package/dist/extensions/builtin/plan/clear-context-state.js +1 -0
- package/dist/extensions/builtin/plan/enter-plan-mode-tool.d.ts +11 -0
- package/dist/extensions/builtin/plan/enter-plan-mode-tool.js +2 -0
- package/dist/extensions/builtin/plan/exit-plan-mode-tool.d.ts +18 -0
- package/dist/extensions/builtin/plan/exit-plan-mode-tool.js +13 -0
- package/dist/extensions/builtin/plan/index.d.ts +8 -0
- package/dist/extensions/builtin/plan/index.js +24 -0
- package/dist/extensions/builtin/plan/plan-agents.d.ts +23 -0
- package/dist/extensions/builtin/plan/plan-agents.js +43 -0
- package/dist/extensions/builtin/plan/plan-file-manager.d.ts +26 -0
- package/dist/extensions/builtin/plan/plan-file-manager.js +1 -0
- package/dist/extensions/builtin/plan/plan-permissions.d.ts +15 -0
- package/dist/extensions/builtin/plan/plan-permissions.js +12 -0
- package/dist/extensions/builtin/plan/plan-validation.d.ts +18 -0
- package/dist/extensions/builtin/plan/plan-validation.js +5 -0
- package/dist/extensions/builtin/plan/plan-workflow-prompt.d.ts +18 -0
- package/dist/extensions/builtin/plan/plan-workflow-prompt.js +102 -0
- package/dist/extensions/builtin/plan/teammate-approval.d.ts +49 -0
- package/dist/extensions/builtin/plan/teammate-approval.js +3 -0
- package/dist/extensions/builtin/plan/types.d.ts +133 -0
- package/dist/extensions/builtin/plan/types.js +1 -0
- package/dist/extensions/builtin/presence/index.d.ts +40 -0
- package/dist/extensions/builtin/presence/index.js +15 -0
- package/dist/extensions/builtin/presence/presence-memory.d.ts +47 -0
- package/dist/extensions/builtin/presence/presence-memory.js +1 -0
- package/dist/extensions/builtin/recap/AGENT.md +15 -0
- package/dist/extensions/builtin/recap/index.d.ts +8 -0
- package/dist/extensions/builtin/recap/index.js +1 -0
- package/dist/extensions/builtin/recap/recap-budget.d.ts +24 -0
- package/dist/extensions/builtin/recap/recap-budget.js +1 -0
- package/dist/extensions/builtin/recap/recap-extractor.d.ts +34 -0
- package/dist/extensions/builtin/recap/recap-extractor.js +3 -0
- package/dist/extensions/builtin/recap/recap-renderer.d.ts +19 -0
- package/dist/extensions/builtin/recap/recap-renderer.js +2 -0
- package/dist/extensions/builtin/recap/recap-synthesizer.d.ts +51 -0
- package/dist/extensions/builtin/recap/recap-synthesizer.js +19 -0
- package/dist/extensions/builtin/recap/recap-types.d.ts +40 -0
- package/dist/extensions/builtin/recap/recap-types.js +1 -0
- package/dist/extensions/builtin/sal/README.md +72 -0
- package/dist/extensions/builtin/sal/anchors.d.ts +46 -0
- package/dist/extensions/builtin/sal/anchors.js +1 -0
- package/dist/extensions/builtin/sal/eval/index.d.ts +18 -0
- package/dist/extensions/builtin/sal/eval/index.js +1 -0
- package/dist/extensions/builtin/sal/eval/insforge-sink.d.ts +30 -0
- package/dist/extensions/builtin/sal/eval/insforge-sink.js +1 -0
- package/dist/extensions/builtin/sal/eval/jsonl-sink.d.ts +27 -0
- package/dist/extensions/builtin/sal/eval/jsonl-sink.js +3 -0
- package/dist/extensions/builtin/sal/eval/noop-sink.d.ts +8 -0
- package/dist/extensions/builtin/sal/eval/noop-sink.js +1 -0
- package/dist/extensions/builtin/sal/eval/types.d.ts +60 -0
- package/dist/extensions/builtin/sal/eval/types.js +1 -0
- package/dist/extensions/builtin/sal/index.d.ts +12 -0
- package/dist/extensions/builtin/sal/index.js +7 -0
- package/dist/extensions/builtin/sal/sal-config.d.ts +46 -0
- package/dist/extensions/builtin/sal/sal-config.js +1 -0
- package/dist/extensions/builtin/sal/sal-context.d.ts +11 -0
- package/dist/extensions/builtin/sal/sal-context.js +2 -0
- package/dist/extensions/builtin/sal/sal-runtime.d.ts +72 -0
- package/dist/extensions/builtin/sal/sal-runtime.js +0 -0
- package/dist/extensions/builtin/sal/sal-trace.d.ts +11 -0
- package/dist/extensions/builtin/sal/sal-trace.js +1 -0
- package/dist/extensions/builtin/sal/terrain.d.ts +73 -0
- package/dist/extensions/builtin/sal/terrain.js +3 -0
- package/dist/extensions/builtin/sal/weights.d.ts +28 -0
- package/dist/extensions/builtin/sal/weights.js +1 -0
- package/dist/extensions/builtin/security-audit/README.md +289 -0
- package/dist/extensions/builtin/security-audit/engine/detector.d.ts +44 -0
- package/dist/extensions/builtin/security-audit/engine/detector.js +1 -0
- package/dist/extensions/builtin/security-audit/engine/interceptor.d.ts +61 -0
- package/dist/extensions/builtin/security-audit/engine/interceptor.js +27 -0
- package/dist/extensions/builtin/security-audit/engine/logger.d.ts +65 -0
- package/dist/extensions/builtin/security-audit/engine/logger.js +65 -0
- package/dist/extensions/builtin/security-audit/index.d.ts +13 -0
- package/dist/extensions/builtin/security-audit/index.js +49 -0
- package/dist/extensions/builtin/security-audit/interface.d.ts +167 -0
- package/dist/extensions/builtin/security-audit/interface.js +1 -0
- package/dist/extensions/builtin/soul/index.d.ts +13 -0
- package/dist/extensions/builtin/soul/index.js +1 -0
- package/dist/extensions/builtin/subagent/index.d.ts +8 -0
- package/dist/extensions/builtin/subagent/index.js +8 -0
- package/dist/extensions/builtin/subagent/subagent-parser.d.ts +30 -0
- package/dist/extensions/builtin/subagent/subagent-parser.js +15 -0
- package/dist/extensions/builtin/subagent/subagent-runner.d.ts +49 -0
- package/dist/extensions/builtin/subagent/subagent-runner.js +8 -0
- package/dist/extensions/builtin/subagent/subagent-types.d.ts +57 -0
- package/dist/extensions/builtin/subagent/subagent-types.js +0 -0
- package/dist/extensions/builtin/task/index.d.ts +8 -0
- package/dist/extensions/builtin/task/index.js +1 -0
- package/dist/extensions/builtin/task/task-store.d.ts +42 -0
- package/dist/extensions/builtin/task/task-store.js +1 -0
- package/dist/extensions/builtin/task/task-tools/task-create-tool.d.ts +37 -0
- package/dist/extensions/builtin/task/task-tools/task-create-tool.js +40 -0
- package/dist/extensions/builtin/task/task-tools/task-get-tool.d.ts +31 -0
- package/dist/extensions/builtin/task/task-tools/task-get-tool.js +23 -0
- package/dist/extensions/builtin/task/task-tools/task-list-tool.d.ts +27 -0
- package/dist/extensions/builtin/task/task-tools/task-list-tool.js +22 -0
- package/dist/extensions/builtin/task/task-tools/task-output-tool.d.ts +32 -0
- package/dist/extensions/builtin/task/task-tools/task-output-tool.js +10 -0
- package/dist/extensions/builtin/task/task-tools/task-stop-tool.d.ts +31 -0
- package/dist/extensions/builtin/task/task-tools/task-stop-tool.js +5 -0
- package/dist/extensions/builtin/task/task-tools/task-update-tool.d.ts +47 -0
- package/dist/extensions/builtin/task/task-tools/task-update-tool.js +77 -0
- package/dist/extensions/builtin/task/task-tools/tool-search-tool.d.ts +34 -0
- package/dist/extensions/builtin/task/task-tools/tool-search-tool.js +14 -0
- package/dist/extensions/builtin/task/task-types.d.ts +30 -0
- package/dist/extensions/builtin/task/task-types.js +1 -0
- package/dist/extensions/builtin/teach/README.md +197 -0
- package/dist/extensions/builtin/teach/index.d.ts +12 -0
- package/dist/extensions/builtin/teach/index.js +6 -0
- package/dist/extensions/builtin/teach/references/analogy-library.md +153 -0
- package/dist/extensions/builtin/teach/references/learning-paths.md +214 -0
- package/dist/extensions/builtin/teach/references/source-verification.md +268 -0
- package/dist/extensions/builtin/teach/references/teaching-template.md +237 -0
- package/dist/extensions/builtin/teach/teach-format.d.ts +35 -0
- package/dist/extensions/builtin/teach/teach-format.js +6 -0
- package/dist/extensions/builtin/teach/teach-i18n.d.ts +47 -0
- package/dist/extensions/builtin/teach/teach-i18n.js +1 -0
- package/dist/extensions/builtin/teach/teach-persistence.d.ts +36 -0
- package/dist/extensions/builtin/teach/teach-persistence.js +35 -0
- package/dist/extensions/builtin/teach/teach-prompts.d.ts +52 -0
- package/dist/extensions/builtin/teach/teach-prompts.js +35 -0
- package/dist/extensions/builtin/teach/teach-runtime.d.ts +93 -0
- package/dist/extensions/builtin/teach/teach-runtime.js +9 -0
- package/dist/extensions/builtin/teach/teach-types.d.ts +81 -0
- package/dist/extensions/builtin/teach/teach-types.js +0 -0
- package/dist/extensions/builtin/team/AGENT.md +112 -0
- package/dist/extensions/builtin/team/TESTING.md +299 -0
- package/dist/extensions/builtin/team/index.d.ts +26 -0
- package/dist/extensions/builtin/team/index.js +11 -0
- package/dist/extensions/builtin/team/team-dashboard.d.ts +13 -0
- package/dist/extensions/builtin/team/team-dashboard.js +1 -0
- package/dist/extensions/builtin/team/team-harness.d.ts +35 -0
- package/dist/extensions/builtin/team/team-harness.js +18 -0
- package/dist/extensions/builtin/team/team-mailbox.d.ts +50 -0
- package/dist/extensions/builtin/team/team-mailbox.js +4 -0
- package/dist/extensions/builtin/team/team-orchestrator.d.ts +39 -0
- package/dist/extensions/builtin/team/team-orchestrator.js +5 -0
- package/dist/extensions/builtin/team/team-parser.d.ts +84 -0
- package/dist/extensions/builtin/team/team-parser.js +38 -0
- package/dist/extensions/builtin/team/team-permissions.d.ts +63 -0
- package/dist/extensions/builtin/team/team-permissions.js +1 -0
- package/dist/extensions/builtin/team/team-presets.d.ts +45 -0
- package/dist/extensions/builtin/team/team-presets.js +2 -0
- package/dist/extensions/builtin/team/team-psyche.d.ts +14 -0
- package/dist/extensions/builtin/team/team-psyche.js +5 -0
- package/dist/extensions/builtin/team/team-runtime-helpers.d.ts +48 -0
- package/dist/extensions/builtin/team/team-runtime-helpers.js +2 -0
- package/dist/extensions/builtin/team/team-runtime.d.ts +91 -0
- package/dist/extensions/builtin/team/team-runtime.js +3 -0
- package/dist/extensions/builtin/team/team-state-store.d.ts +29 -0
- package/dist/extensions/builtin/team/team-state-store.js +2 -0
- package/dist/extensions/builtin/team/team-task-store.d.ts +35 -0
- package/dist/extensions/builtin/team/team-task-store.js +2 -0
- package/dist/extensions/builtin/team/team-transcript.d.ts +31 -0
- package/dist/extensions/builtin/team/team-transcript.js +2 -0
- package/dist/extensions/builtin/team/team-types.d.ts +250 -0
- package/dist/extensions/builtin/team/team-types.js +0 -0
- package/dist/extensions/builtin/team/team-ui.d.ts +50 -0
- package/dist/extensions/builtin/team/team-ui.js +2 -0
- package/dist/extensions/builtin/token-save/README.md +56 -0
- package/dist/extensions/builtin/token-save/config.d.ts +8 -0
- package/dist/extensions/builtin/token-save/config.js +1 -0
- package/dist/extensions/builtin/token-save/filters.d.ts +14 -0
- package/dist/extensions/builtin/token-save/filters.js +24 -0
- package/dist/extensions/builtin/token-save/index.d.ts +8 -0
- package/dist/extensions/builtin/token-save/index.js +4 -0
- package/dist/extensions/builtin/token-save/lexer.d.ts +11 -0
- package/dist/extensions/builtin/token-save/lexer.js +1 -0
- package/dist/extensions/builtin/token-save/recovery.d.ts +1 -0
- package/dist/extensions/builtin/token-save/recovery.js +1 -0
- package/dist/extensions/builtin/token-save/rewrite.d.ts +19 -0
- package/dist/extensions/builtin/token-save/rewrite.js +1 -0
- package/dist/extensions/builtin/token-save/runner.d.ts +14 -0
- package/dist/extensions/builtin/token-save/runner.js +3 -0
- package/dist/extensions/builtin/token-save/stream.d.ts +20 -0
- package/dist/extensions/builtin/token-save/stream.js +1 -0
- package/dist/extensions/builtin/token-save/toml-dsl.d.ts +25 -0
- package/dist/extensions/builtin/token-save/toml-dsl.js +3 -0
- package/dist/extensions/builtin/token-save/tracking.d.ts +24 -0
- package/dist/extensions/builtin/token-save/tracking.js +8 -0
- package/dist/extensions/optional/AGENT.md +11 -0
- package/dist/extensions/optional/export-html/index.d.ts +41 -0
- package/dist/extensions/optional/export-html/index.js +2 -0
- package/dist/extensions/optional/simplify/index.d.ts +35 -0
- package/dist/extensions/optional/simplify/index.js +77 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +1 -0
- package/dist/main.d.ts +7 -0
- package/dist/main.js +41 -0
- package/dist/migrations.d.ts +30 -0
- package/dist/migrations.js +4 -0
- package/dist/models.d.ts +7 -0
- package/dist/models.js +1 -0
- package/dist/modes/acp/acp-mode.d.ts +30 -0
- package/dist/modes/acp/acp-mode.js +25 -0
- package/dist/modes/index.d.ts +14 -0
- package/dist/modes/index.js +1 -0
- package/dist/modes/interactive/agent-loop-status.d.ts +8 -0
- package/dist/modes/interactive/agent-loop-status.js +1 -0
- package/dist/modes/interactive/components/apikey-input.d.ts +10 -0
- package/dist/modes/interactive/components/apikey-input.js +3 -0
- package/dist/modes/interactive/components/armin.d.ts +39 -0
- package/dist/modes/interactive/components/armin.js +1 -0
- package/dist/modes/interactive/components/assistant-message.d.ts +21 -0
- package/dist/modes/interactive/components/assistant-message.js +1 -0
- package/dist/modes/interactive/components/attachments-bar.d.ts +37 -0
- package/dist/modes/interactive/components/attachments-bar.js +1 -0
- package/dist/modes/interactive/components/bash-execution.d.ts +40 -0
- package/dist/modes/interactive/components/bash-execution.js +13 -0
- package/dist/modes/interactive/components/bordered-loader.d.ts +21 -0
- package/dist/modes/interactive/components/bordered-loader.js +1 -0
- package/dist/modes/interactive/components/branch-summary-message.d.ts +21 -0
- package/dist/modes/interactive/components/branch-summary-message.js +3 -0
- package/dist/modes/interactive/components/buddy/pet-sprites.d.ts +31 -0
- package/dist/modes/interactive/components/buddy/pet-sprites.js +1 -0
- package/dist/modes/interactive/components/catui-loader.d.ts +55 -0
- package/dist/modes/interactive/components/catui-loader.js +1 -0
- package/dist/modes/interactive/components/compaction-summary-message.d.ts +21 -0
- package/dist/modes/interactive/components/compaction-summary-message.js +3 -0
- package/dist/modes/interactive/components/config-selector.d.ts +76 -0
- package/dist/modes/interactive/components/config-selector.js +1 -0
- package/dist/modes/interactive/components/countdown-timer.d.ts +19 -0
- package/dist/modes/interactive/components/countdown-timer.js +1 -0
- package/dist/modes/interactive/components/custom-editor.d.ts +37 -0
- package/dist/modes/interactive/components/custom-editor.js +1 -0
- package/dist/modes/interactive/components/custom-message.d.ts +26 -0
- package/dist/modes/interactive/components/custom-message.js +2 -0
- package/dist/modes/interactive/components/daxnuts.d.ts +28 -0
- package/dist/modes/interactive/components/daxnuts.js +1 -0
- package/dist/modes/interactive/components/diff.d.ts +17 -0
- package/dist/modes/interactive/components/diff.js +3 -0
- package/dist/modes/interactive/components/dynamic-border.d.ts +20 -0
- package/dist/modes/interactive/components/dynamic-border.js +1 -0
- package/dist/modes/interactive/components/editor-buddy-layout.d.ts +17 -0
- package/dist/modes/interactive/components/editor-buddy-layout.js +1 -0
- package/dist/modes/interactive/components/extension-editor.d.ts +25 -0
- package/dist/modes/interactive/components/extension-editor.js +1 -0
- package/dist/modes/interactive/components/extension-input.d.ts +29 -0
- package/dist/modes/interactive/components/extension-input.js +2 -0
- package/dist/modes/interactive/components/extension-selector.d.ts +32 -0
- package/dist/modes/interactive/components/extension-selector.js +2 -0
- package/dist/modes/interactive/components/footer.d.ts +34 -0
- package/dist/modes/interactive/components/footer.js +1 -0
- package/dist/modes/interactive/components/index.d.ts +44 -0
- package/dist/modes/interactive/components/index.js +1 -0
- package/dist/modes/interactive/components/keybinding-hints.d.ts +46 -0
- package/dist/modes/interactive/components/keybinding-hints.js +1 -0
- package/dist/modes/interactive/components/login-dialog.d.ts +47 -0
- package/dist/modes/interactive/components/login-dialog.js +1 -0
- package/dist/modes/interactive/components/memory-stats.d.ts +14 -0
- package/dist/modes/interactive/components/memory-stats.js +2 -0
- package/dist/modes/interactive/components/model-selector.d.ts +59 -0
- package/dist/modes/interactive/components/model-selector.js +2 -0
- package/dist/modes/interactive/components/notification-queue.d.ts +49 -0
- package/dist/modes/interactive/components/notification-queue.js +1 -0
- package/dist/modes/interactive/components/oauth-selector.d.ts +30 -0
- package/dist/modes/interactive/components/oauth-selector.js +1 -0
- package/dist/modes/interactive/components/persona-selector.d.ts +24 -0
- package/dist/modes/interactive/components/persona-selector.js +1 -0
- package/dist/modes/interactive/components/plan-progress-panel.d.ts +24 -0
- package/dist/modes/interactive/components/plan-progress-panel.js +1 -0
- package/dist/modes/interactive/components/provider-selector.d.ts +25 -0
- package/dist/modes/interactive/components/provider-selector.js +1 -0
- package/dist/modes/interactive/components/raw-text.d.ts +19 -0
- package/dist/modes/interactive/components/raw-text.js +3 -0
- package/dist/modes/interactive/components/scoped-models-selector.d.ts +54 -0
- package/dist/modes/interactive/components/scoped-models-selector.js +1 -0
- package/dist/modes/interactive/components/session-selector-search.d.ts +28 -0
- package/dist/modes/interactive/components/session-selector-search.js +1 -0
- package/dist/modes/interactive/components/session-selector.d.ts +100 -0
- package/dist/modes/interactive/components/session-selector.js +2 -0
- package/dist/modes/interactive/components/settings-selector.d.ts +77 -0
- package/dist/modes/interactive/components/settings-selector.js +1 -0
- package/dist/modes/interactive/components/show-images-selector.d.ts +15 -0
- package/dist/modes/interactive/components/show-images-selector.js +1 -0
- package/dist/modes/interactive/components/skill-invocation-message.d.ts +22 -0
- package/dist/modes/interactive/components/skill-invocation-message.js +3 -0
- package/dist/modes/interactive/components/soul-stats.d.ts +15 -0
- package/dist/modes/interactive/components/soul-stats.js +2 -0
- package/dist/modes/interactive/components/sub-agent-panel.d.ts +24 -0
- package/dist/modes/interactive/components/sub-agent-panel.js +1 -0
- package/dist/modes/interactive/components/task-status-panel.d.ts +36 -0
- package/dist/modes/interactive/components/task-status-panel.js +1 -0
- package/dist/modes/interactive/components/theme-selector.d.ts +16 -0
- package/dist/modes/interactive/components/theme-selector.js +1 -0
- package/dist/modes/interactive/components/thinking-selector.d.ts +16 -0
- package/dist/modes/interactive/components/thinking-selector.js +1 -0
- package/dist/modes/interactive/components/tool-execution.d.ts +80 -0
- package/dist/modes/interactive/components/tool-execution.js +58 -0
- package/dist/modes/interactive/components/tree-selector.d.ts +73 -0
- package/dist/modes/interactive/components/tree-selector.js +1 -0
- package/dist/modes/interactive/components/user-message-selector.d.ts +35 -0
- package/dist/modes/interactive/components/user-message-selector.js +1 -0
- package/dist/modes/interactive/components/user-message.d.ts +13 -0
- package/dist/modes/interactive/components/user-message.js +1 -0
- package/dist/modes/interactive/components/visual-truncate.d.ts +29 -0
- package/dist/modes/interactive/components/visual-truncate.js +1 -0
- package/dist/modes/interactive/controllers/auth-provider-config-controller.d.ts +64 -0
- package/dist/modes/interactive/controllers/auth-provider-config-controller.js +1 -0
- package/dist/modes/interactive/controllers/extension-ui/custom-overlay-host.d.ts +38 -0
- package/dist/modes/interactive/controllers/extension-ui/custom-overlay-host.js +1 -0
- package/dist/modes/interactive/controllers/extension-ui/editor-component-adapter.d.ts +37 -0
- package/dist/modes/interactive/controllers/extension-ui/editor-component-adapter.js +1 -0
- package/dist/modes/interactive/controllers/extension-ui/persistent-surface-registry.d.ts +53 -0
- package/dist/modes/interactive/controllers/extension-ui/persistent-surface-registry.js +1 -0
- package/dist/modes/interactive/controllers/extension-ui/prompt-host.d.ts +52 -0
- package/dist/modes/interactive/controllers/extension-ui/prompt-host.js +2 -0
- package/dist/modes/interactive/controllers/image-pipeline-controller.d.ts +106 -0
- package/dist/modes/interactive/controllers/image-pipeline-controller.js +1 -0
- package/dist/modes/interactive/controllers/input-submit-controller.d.ts +80 -0
- package/dist/modes/interactive/controllers/input-submit-controller.js +2 -0
- package/dist/modes/interactive/controllers/interrupt-controller.d.ts +75 -0
- package/dist/modes/interactive/controllers/interrupt-controller.js +1 -0
- package/dist/modes/interactive/controllers/model-overlay-controller.d.ts +127 -0
- package/dist/modes/interactive/controllers/model-overlay-controller.js +3 -0
- package/dist/modes/interactive/controllers/self-update-controller.d.ts +71 -0
- package/dist/modes/interactive/controllers/self-update-controller.js +24 -0
- package/dist/modes/interactive/controllers/settings-overlay-controller.d.ts +56 -0
- package/dist/modes/interactive/controllers/settings-overlay-controller.js +2 -0
- package/dist/modes/interactive/controllers/slash-dispatcher-controller.d.ts +74 -0
- package/dist/modes/interactive/controllers/slash-dispatcher-controller.js +1 -0
- package/dist/modes/interactive/controllers/stream-render-controller.d.ts +110 -0
- package/dist/modes/interactive/controllers/stream-render-controller.js +2 -0
- package/dist/modes/interactive/controllers/tree-overlay-controller.d.ts +55 -0
- package/dist/modes/interactive/controllers/tree-overlay-controller.js +1 -0
- package/dist/modes/interactive/footer-data-provider.d.ts +32 -0
- package/dist/modes/interactive/footer-data-provider.js +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts +303 -0
- package/dist/modes/interactive/interactive-mode.js +119 -0
- package/dist/modes/interactive/services/tips.d.ts +20 -0
- package/dist/modes/interactive/services/tips.js +1 -0
- package/dist/modes/interactive/slash-command-arguments.d.ts +28 -0
- package/dist/modes/interactive/slash-command-arguments.js +1 -0
- package/dist/modes/interactive/state/interactive-state.d.ts +74 -0
- package/dist/modes/interactive/state/interactive-state.js +1 -0
- package/dist/modes/interactive/theme/dark.json +85 -0
- package/dist/modes/interactive/theme/light.json +84 -0
- package/dist/modes/interactive/theme/theme-schema.json +335 -0
- package/dist/modes/interactive/theme/theme.d.ts +81 -0
- package/dist/modes/interactive/theme/theme.js +16 -0
- package/dist/modes/interactive/theme/warm.json +81 -0
- package/dist/modes/print-mode.d.ts +38 -0
- package/dist/modes/print-mode.js +2 -0
- package/dist/modes/rpc/rpc-client.d.ts +221 -0
- package/dist/modes/rpc/rpc-client.js +2 -0
- package/dist/modes/rpc/rpc-mode.d.ts +14 -0
- package/dist/modes/rpc/rpc-mode.js +1 -0
- package/dist/modes/rpc/rpc-types.d.ts +449 -0
- package/dist/modes/rpc/rpc-types.js +0 -0
- package/dist/modes/utils/agent-loop-result-format.d.ts +10 -0
- package/dist/modes/utils/agent-loop-result-format.js +1 -0
- package/dist/modes/utils/clipboard-image.d.ts +10 -0
- package/dist/modes/utils/clipboard-image.js +1 -0
- package/dist/modes/utils/clipboard-native.d.ts +11 -0
- package/dist/modes/utils/clipboard-native.js +1 -0
- package/dist/modes/utils/clipboard.d.ts +1 -0
- package/dist/modes/utils/clipboard.js +1 -0
- package/dist/modes/utils/image-convert.d.ts +8 -0
- package/dist/modes/utils/image-convert.js +1 -0
- package/dist/modes/utils/image-resize.d.ts +41 -0
- package/dist/modes/utils/image-resize.js +1 -0
- package/dist/node_modules/@catui/agent-core/dist/agent-loop-continuations.js +1 -0
- package/dist/node_modules/@catui/agent-core/dist/agent-loop-stream-events.js +1 -0
- package/dist/node_modules/@catui/agent-core/dist/agent-loop-tool-results.js +3 -0
- package/dist/node_modules/@catui/agent-core/dist/agent-loop-tool-summaries.js +1 -0
- package/dist/node_modules/@catui/agent-core/dist/agent-loop.js +4 -0
- package/dist/node_modules/@catui/agent-core/dist/agent-run-result.js +1 -0
- package/dist/node_modules/@catui/agent-core/dist/agent.js +1 -0
- package/dist/node_modules/@catui/agent-core/dist/errors.js +1 -0
- package/dist/node_modules/@catui/agent-core/dist/index.js +1 -0
- package/dist/node_modules/@catui/agent-core/dist/proxy.js +2 -0
- package/dist/node_modules/@catui/agent-core/dist/structured-adaptive-agent-loop.js +2 -0
- package/dist/node_modules/@catui/agent-core/dist/structured-adaptive-streaming-tool-executor.js +1 -0
- package/dist/node_modules/@catui/agent-core/dist/structured-adaptive-tool-orchestration.js +3 -0
- package/dist/node_modules/@catui/agent-core/dist/types.js +1 -0
- package/dist/node_modules/@catui/agent-core/package.json +28 -0
- package/dist/node_modules/@catui/ai/dist/api-registry.js +1 -0
- package/dist/node_modules/@catui/ai/dist/cli.js +21 -0
- package/dist/node_modules/@catui/ai/dist/config-path.js +1 -0
- package/dist/node_modules/@catui/ai/dist/debug-logger.js +4 -0
- package/dist/node_modules/@catui/ai/dist/env-api-keys.js +1 -0
- package/dist/node_modules/@catui/ai/dist/env.js +1 -0
- package/dist/node_modules/@catui/ai/dist/events.js +1 -0
- package/dist/node_modules/@catui/ai/dist/index.js +1 -0
- package/dist/node_modules/@catui/ai/dist/json.js +1 -0
- package/dist/node_modules/@catui/ai/dist/models.generated.js +1 -0
- package/dist/node_modules/@catui/ai/dist/models.js +1 -0
- package/dist/node_modules/@catui/ai/dist/overflow.js +1 -0
- package/dist/node_modules/@catui/ai/dist/providers/amazon-bedrock.js +1 -0
- package/dist/node_modules/@catui/ai/dist/providers/anthropic.js +2 -0
- package/dist/node_modules/@catui/ai/dist/providers/azure-openai-responses.js +1 -0
- package/dist/node_modules/@catui/ai/dist/providers/github-copilot-headers.js +1 -0
- package/dist/node_modules/@catui/ai/dist/providers/google-gemini-cli.js +2 -0
- package/dist/node_modules/@catui/ai/dist/providers/google-shared.js +2 -0
- package/dist/node_modules/@catui/ai/dist/providers/google-vertex.js +1 -0
- package/dist/node_modules/@catui/ai/dist/providers/google.js +1 -0
- package/dist/node_modules/@catui/ai/dist/providers/openai-codex-responses.js +7 -0
- package/dist/node_modules/@catui/ai/dist/providers/openai-completions.js +6 -0
- package/dist/node_modules/@catui/ai/dist/providers/openai-responses-shared.js +10 -0
- package/dist/node_modules/@catui/ai/dist/providers/openai-responses.js +1 -0
- package/dist/node_modules/@catui/ai/dist/providers/register-builtins.js +1 -0
- package/dist/node_modules/@catui/ai/dist/providers/simple-options.js +1 -0
- package/dist/node_modules/@catui/ai/dist/providers/transform-messages.js +1 -0
- package/dist/node_modules/@catui/ai/dist/registry.js +1 -0
- package/dist/node_modules/@catui/ai/dist/schema.js +1 -0
- package/dist/node_modules/@catui/ai/dist/stream.js +1 -0
- package/dist/node_modules/@catui/ai/dist/types.js +0 -0
- package/dist/node_modules/@catui/ai/dist/utils/event-stream-types.js +0 -0
- package/dist/node_modules/@catui/ai/dist/utils/event-stream.js +1 -0
- package/dist/node_modules/@catui/ai/dist/utils/http-proxy.js +1 -0
- package/dist/node_modules/@catui/ai/dist/utils/json-parse.js +1 -0
- package/dist/node_modules/@catui/ai/dist/utils/oauth/anthropic.js +1 -0
- package/dist/node_modules/@catui/ai/dist/utils/oauth/decode-credential.js +1 -0
- package/dist/node_modules/@catui/ai/dist/utils/oauth/github-copilot.js +1 -0
- package/dist/node_modules/@catui/ai/dist/utils/oauth/google-antigravity.js +1 -0
- package/dist/node_modules/@catui/ai/dist/utils/oauth/google-gemini-cli.js +1 -0
- package/dist/node_modules/@catui/ai/dist/utils/oauth/index.js +1 -0
- package/dist/node_modules/@catui/ai/dist/utils/oauth/openai-codex.js +11 -0
- package/dist/node_modules/@catui/ai/dist/utils/oauth/pkce.js +1 -0
- package/dist/node_modules/@catui/ai/dist/utils/oauth/types.js +0 -0
- package/dist/node_modules/@catui/ai/dist/utils/overflow.js +1 -0
- package/dist/node_modules/@catui/ai/dist/utils/sanitize-unicode.js +1 -0
- package/dist/node_modules/@catui/ai/dist/utils/typebox-helpers.js +1 -0
- package/dist/node_modules/@catui/ai/dist/utils/validation.js +6 -0
- package/dist/node_modules/@catui/ai/package.json +106 -0
- package/dist/node_modules/@catui/tui/dist/autocomplete.js +2 -0
- package/dist/node_modules/@catui/tui/dist/components/box.js +1 -0
- package/dist/node_modules/@catui/tui/dist/components/cached-container.js +1 -0
- package/dist/node_modules/@catui/tui/dist/components/cancellable-loader.js +1 -0
- package/dist/node_modules/@catui/tui/dist/components/editor.js +21 -0
- package/dist/node_modules/@catui/tui/dist/components/image.js +1 -0
- package/dist/node_modules/@catui/tui/dist/components/input.js +2 -0
- package/dist/node_modules/@catui/tui/dist/components/loader.js +1 -0
- package/dist/node_modules/@catui/tui/dist/components/markdown.js +7 -0
- package/dist/node_modules/@catui/tui/dist/components/select-list.js +1 -0
- package/dist/node_modules/@catui/tui/dist/components/settings-list.js +1 -0
- package/dist/node_modules/@catui/tui/dist/components/spacer.js +1 -0
- package/dist/node_modules/@catui/tui/dist/components/text.js +1 -0
- package/dist/node_modules/@catui/tui/dist/components/truncated-text.js +2 -0
- package/dist/node_modules/@catui/tui/dist/editor-component.js +0 -0
- package/dist/node_modules/@catui/tui/dist/fuzzy.js +1 -0
- package/dist/node_modules/@catui/tui/dist/index.js +1 -0
- package/dist/node_modules/@catui/tui/dist/keybindings.js +1 -0
- package/dist/node_modules/@catui/tui/dist/keys.js +5 -0
- package/dist/node_modules/@catui/tui/dist/kill-ring.js +1 -0
- package/dist/node_modules/@catui/tui/dist/stdin-buffer.js +1 -0
- package/dist/node_modules/@catui/tui/dist/terminal-image.js +1 -0
- package/dist/node_modules/@catui/tui/dist/terminal.js +1 -0
- package/dist/node_modules/@catui/tui/dist/tui.js +12 -0
- package/dist/node_modules/@catui/tui/dist/undo-stack.js +1 -0
- package/dist/node_modules/@catui/tui/dist/utils.js +2 -0
- package/dist/node_modules/@catui/tui/package.json +37 -0
- package/dist/packages/mem-core/src/store.d.ts +21 -0
- package/dist/packages/mem-core/src/store.js +1 -0
- package/dist/packages/mem-core/src/types.d.ts +329 -0
- package/dist/packages/mem-core/src/types.js +0 -0
- package/dist/packages/protocol/src/commands.d.ts +33 -0
- package/dist/packages/protocol/src/commands.js +0 -0
- package/dist/packages/protocol/src/flags.d.ts +20 -0
- package/dist/packages/protocol/src/flags.js +0 -0
- package/dist/packages/protocol/src/hooks.d.ts +17 -0
- package/dist/packages/protocol/src/hooks.js +0 -0
- package/dist/packages/protocol/src/index.d.ts +15 -0
- package/dist/packages/protocol/src/index.js +1 -0
- package/dist/packages/protocol/src/lifecycle.d.ts +61 -0
- package/dist/packages/protocol/src/lifecycle.js +0 -0
- package/dist/packages/protocol/src/tools.d.ts +77 -0
- package/dist/packages/protocol/src/tools.js +0 -0
- package/dist/packages/soul-core/src/config.d.ts +20 -0
- package/dist/packages/soul-core/src/config.js +1 -0
- package/dist/packages/soul-core/src/diagnostics.d.ts +23 -0
- package/dist/packages/soul-core/src/diagnostics.js +1 -0
- package/dist/packages/soul-core/src/evolution.d.ts +75 -0
- package/dist/packages/soul-core/src/evolution.js +1 -0
- package/dist/packages/soul-core/src/index.d.ts +13 -0
- package/dist/packages/soul-core/src/index.js +1 -0
- package/dist/packages/soul-core/src/injection.d.ts +35 -0
- package/dist/packages/soul-core/src/injection.js +8 -0
- package/dist/packages/soul-core/src/manager.d.ts +101 -0
- package/dist/packages/soul-core/src/manager.js +1 -0
- package/dist/packages/soul-core/src/store.d.ts +62 -0
- package/dist/packages/soul-core/src/store.js +1 -0
- package/dist/packages/soul-core/src/types.d.ts +317 -0
- package/dist/packages/soul-core/src/types.js +0 -0
- package/dist/public-config.d.ts +12 -0
- package/dist/public-config.js +1 -0
- package/dist/runtime.d.ts +9 -0
- package/dist/runtime.js +1 -0
- package/dist/session-compaction.d.ts +7 -0
- package/dist/session-compaction.js +1 -0
- package/dist/session.d.ts +7 -0
- package/dist/session.js +1 -0
- package/dist/skills.d.ts +7 -0
- package/dist/skills.js +1 -0
- package/dist/tools.d.ts +7 -0
- package/dist/tools.js +1 -0
- package/dist/utils/changelog.d.ts +20 -0
- package/dist/utils/changelog.js +4 -0
- package/dist/utils/diagnostics.d.ts +37 -0
- package/dist/utils/diagnostics.js +1 -0
- package/dist/utils/frontmatter.d.ts +7 -0
- package/dist/utils/frontmatter.js +4 -0
- package/dist/utils/git.d.ts +25 -0
- package/dist/utils/git.js +1 -0
- package/dist/utils/mime.d.ts +1 -0
- package/dist/utils/mime.js +1 -0
- package/dist/utils/photon.d.ts +6 -0
- package/dist/utils/photon.js +1 -0
- package/dist/utils/startup-profiler.d.ts +87 -0
- package/dist/utils/startup-profiler.js +2 -0
- package/docs/codex-goal-command-impl.md +1055 -0
- package/docs/codex-goal-vs-grub.md +500 -0
- package/docs/custom-provider.md +27 -0
- package/docs/extensions.md +27 -0
- package/docs/keybindings.md +27 -0
- package/docs/loop /351/207/215/346/236/204/345/256/214/346/210/220/346/200/273/347/273/223.md" +251 -0
- package/docs/loop /351/207/215/346/236/204/345/256/214/346/210/220/346/212/245/345/221/212.md" +123 -0
- package/docs/loop /351/207/215/346/236/204/346/226/271/346/241/210.md" +1222 -0
- package/docs/loop /351/207/215/346/236/204/346/226/271/346/241/210/345/256/236/347/216/260/346/212/245/345/221/212.md" +158 -0
- package/docs/loop /351/207/215/346/236/204/346/226/271/346/241/210/345/257/271/346/257/224/345/210/206/346/236/220.md" +128 -0
- package/docs/loop /351/207/215/346/236/204/350/256/241/345/210/222.md" +321 -0
- package/docs/loop-usage-examples.md +215 -0
- package/docs/models.md +27 -0
- package/docs/packages.md +27 -0
- package/docs/pi-design-philosophy.md +457 -0
- package/docs/planmode.md +1987 -0
- package/docs/prompt-templates.md +27 -0
- package/docs/providers.md +27 -0
- package/docs/sdk.md +27 -0
- package/docs/skills.md +27 -0
- package/docs/themes.md +27 -0
- package/docs/tui.md +27 -0
- package/package.json +191 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var M=Object.defineProperty;var d=(g,a)=>M(g,"name",{value:a,configurable:!0});import{SubAgentRuntime as $,InProcessSubAgentBackend as D}from"../../../core/sub-agent/index.js";import{createAgentSession as E}from"../../../core/runtime/sdk.js";import{WorktreeManager as L}from"../../../core/workspace/index.js";import{isAbsolute as B,join as _,resolve as S}from"node:path";import{TeamStateStore as F}from"./team-state-store.js";import{PermissionStore as U}from"./team-permissions.js";import{TeamMailbox as R}from"./team-mailbox.js";import{TeamTaskStore as V}from"./team-task-store.js";import{TeamTranscriptWriter as W}from"./team-transcript.js";import{createInitialHarnessState as Q,inspectHarnessExit as q}from"./team-harness.js";import{computePsycheWeights as j}from"./team-psyche.js";import{applyLiveEvent as G,buildTeammatePrompt as H,createWritePathGuard as O,ensureLiveView as w,getDefaultModeForRole as z,indexFromLabel as J,isBuilderRole as b,labelFromIndex as K,normalizePath as X,prepareHarnessTurn as Y,selectToolsForMode as T,singleLine as x,summarizeTask as Z,tailText as N}from"./team-runtime-helpers.js";class ht{static{d(this,"TeamRuntime")}store;worktreeManager;subAgentRuntime;permissions;mailbox;tasks;transcripts;teammates=new Map;sendQueues=new Map;loaded=!1;nameCounter=0;labelCounter=0;soulManager;constructor(a={}){this.store=new F(a.storageDir),this.worktreeManager=new L,this.subAgentRuntime=new $(new D(E)),this.permissions=new U,this.mailbox=new R(1e3,_(this.store.directory,"mailbox.jsonl")),this.tasks=new V(this.store.directory),this.transcripts=new W(this.store.directory)}getPermissionStore(){return this.permissions}getMailbox(){return this.mailbox}getTaskStore(){return this.tasks}setSoulManager(a){this.soulManager=a}async load(){if(this.loaded)return;const a=await this.store.loadAll();await this.mailbox.load(),await this.tasks.load();for(const t of a){if(t.status==="terminated"){await this.store.remove(t.identity.id);continue}let s;if(t.worktreePath)try{const{stat:e}=await import("node:fs/promises");await e(t.worktreePath),s={path:t.worktreePath,type:await this.detectWorkspaceType(t.worktreePath)}}catch{t.worktreePath=void 0,t.worktreeBranch=void 0}t.status==="running"&&(t.status="idle"),t.identity.label||(t.identity.label=this.generateLabel(),await this.store.save(t)),this.bumpNameCounter(t.identity.name,t.identity.role),this.bumpLabelCounter(t.identity.label),t.liveView=w(t.liveView,t.identity);const i={state:t,abortController:new AbortController,worktree:s};this.teammates.set(t.identity.id,i),this.teammates.set(t.identity.name,i),this.teammates.set(t.identity.label,i)}this.loaded=!0}async spawn(a){await this.ensureLoaded();let t=a.name?.trim();t?this.findByName(t)&&(t=this.generateName(a.role)):t=this.generateName(a.role);let s;b(a.role)&&(s=await this.worktreeManager.createGitWorktree(void 0,a.baseCwd));const i={id:crypto.randomUUID(),label:this.generateLabel(),name:t,role:a.role,createdAt:Date.now()},e=a.mode??(a.harnessEnabled&&b(a.role)?"execute":z(a.role)),o={identity:i,mode:e,status:"idle",cwd:s?.path??a.baseCwd,worktreePath:s?.path,worktreeBranch:void 0,messages:[],lastActiveAt:Date.now(),psycheOverrides:a.psycheOverrides,liveView:w(void 0,i)};a.harnessEnabled&&(o.harness=Q()),(a.psycheOverrides||a.role==="verifier"||a.role==="data-analyst")&&(o.psyche=j("verify",a.role,void 0,a.psycheOverrides));const m={state:o,abortController:new AbortController,worktree:s};return this.teammates.set(i.id,m),this.teammates.set(i.name,m),this.teammates.set(i.label,m),await this.store.save(o),o}async send(a,t,s,i={}){await this.ensureLoaded();const e=this.findByName(a);if(!e)return{teammateId:"",teammateName:a,success:!1,response:"",error:`Teammate "${a}" not found`,durationMs:0};const o=this.sendQueues.get(e.state.identity.id);o&&(i.onEvent?.({type:"teammate_status",teammate:e.state,event:`Queued message for ${e.state.identity.name}.`}),this.mailbox.post({teammateId:e.state.identity.id,teammateName:e.state.identity.name,type:"task_progress",direction:"leader_to_teammate",payload:{status:"queued",content:t}}));const m=(o??Promise.resolve()).catch(()=>{}).then(async()=>{const y=Date.now(),k=new AbortController;e.currentTurnAbortController=k;const C={id:crypto.randomUUID(),timestamp:y,direction:"leader",content:t};e.state.messages.push(C),e.state.liveView={...w(e.state.liveView,e.state.identity),currentTask:Z(t),progress:"assigned"},e.state.status="running",e.state.lastActiveAt=y,await this.store.save(e.state),i.onEvent?.({type:"teammate_status",teammate:e.state,event:`Started ${e.state.identity.name} (${e.state.identity.role}) in ${e.state.mode} mode.`}),this.mailbox.post({teammateId:e.state.identity.id,teammateName:e.state.identity.name,type:"task_request",direction:"leader_to_teammate",payload:{content:t}}),await this.transcripts.append(e.state.identity.id,{timestamp:y,kind:"leader",content:t});const A=H({state:e.state,teammates:this.getAllTeammates(),tasks:await this.tasks.list(),mailboxMessages:this.mailbox.list(e.state.identity.id).slice(-12)}),p=await Y({teammate:e,taskDescription:t,soulManager:this.soulManager}),I=p?[A,p.psychePrompt,p.harnessInstructions].join(`
|
|
2
|
+
|
|
3
|
+
`):A,P=T({mode:e.state.mode,cwd:e.state.cwd,getAllTeammates:d(()=>this.getAllTeammates(),"getAllTeammates"),isPathAllowed:d((l,c)=>this.permissions.isPathAllowed(l,c),"isPathAllowed")});try{const l={prompt:I,tools:P,cwd:e.state.cwd,signal:k.signal,model:s,contextFiles:p?.contextFiles,onEvent:d(f=>{G(e,f),i.onEvent?.({type:"teammate_live",teammate:e.state,event:f})},"onEvent"),exitHook:p?async f=>{if(!e.state.harness)return;const h=await q(e.state.harness,e.state.cwd,f);e.state.harness=h.harness,i.onEvent?.({type:"harness_event",teammate:e.state,event:h.event}),this.mailbox.post({teammateId:e.state.identity.id,teammateName:e.state.identity.name,type:"task_result",direction:"teammate_to_leader",payload:{success:h.violations.length===0,content:h.event,error:h.violations.length?h.violations.join("; "):void 0}})}:void 0},c=await this.subAgentRuntime.spawn(l);e.handle=c;const r=await c.result(),u=Date.now()-y,n={id:crypto.randomUUID(),timestamp:Date.now(),direction:"teammate",content:r.success?r.response??"":r.error??"Error",aborted:!r.success&&r.error==="Aborted",error:r.success?void 0:r.error};return e.state.messages.push(n),e.state.status=r.success?"idle":n.aborted?"stopped":"error",!r.success&&r.error&&!n.aborted?e.state.lastError=r.error:e.state.lastError=void 0,e.state.lastActiveAt=Date.now(),e.state.live=void 0,e.state.liveView={...w(e.state.liveView,e.state.identity),lastUtterance:N(x(n.content),200),progress:r.success?"done":n.aborted?"stopped":"error"},await this.store.save(e.state),i.onEvent?.({type:"teammate_status",teammate:e.state,event:r.success?`Finished ${e.state.identity.name}.`:`Failed ${e.state.identity.name}: ${r.error??"Unknown error"}`}),this.mailbox.post({teammateId:e.state.identity.id,teammateName:e.state.identity.name,type:"task_result",direction:"teammate_to_leader",payload:{success:r.success,content:n.content,error:r.error,aborted:n.aborted}}),await this.transcripts.append(e.state.identity.id,{timestamp:Date.now(),kind:"teammate",content:n.content,meta:{success:r.success,aborted:n.aborted}}),{teammateId:e.state.identity.id,teammateName:a,success:r.success,response:n.content,aborted:n.aborted,error:r.error,durationMs:u}}catch(l){const c=Date.now()-y,r=l instanceof Error?l.message:String(l),u={id:crypto.randomUUID(),timestamp:Date.now(),direction:"teammate",content:`Error: ${r}`,error:r};return e.state.messages.push(u),e.state.status=r==="Aborted"?"stopped":"error",e.state.lastError=r==="Aborted"?void 0:r,e.state.lastActiveAt=Date.now(),e.state.live=void 0,e.state.liveView={...w(e.state.liveView,e.state.identity),lastUtterance:N(x(u.content),200),progress:r==="Aborted"?"stopped":"error"},await this.store.save(e.state),i.onEvent?.({type:"teammate_status",teammate:e.state,event:`Failed ${e.state.identity.name}: ${r}`}),this.mailbox.post({teammateId:e.state.identity.id,teammateName:e.state.identity.name,type:"task_result",direction:"teammate_to_leader",payload:{success:!1,content:u.content,error:r,aborted:r==="Aborted"}}),await this.transcripts.append(e.state.identity.id,{timestamp:Date.now(),kind:"teammate",content:u.content,meta:{success:!1,aborted:r==="Aborted",error:r}}),{teammateId:e.state.identity.id,teammateName:a,success:!1,response:"",error:r,durationMs:c}}finally{e.currentTurnAbortController=void 0,e.handle=void 0}}),v=m.then(()=>{},()=>{}).finally(()=>{this.sendQueues.get(e.state.identity.id)===v&&this.sendQueues.delete(e.state.identity.id)});return this.sendQueues.set(e.state.identity.id,v),m}async stop(a){await this.ensureLoaded();const t=this.findByName(a);return t?(t.currentTurnAbortController&&t.currentTurnAbortController.abort(),t.handle&&await t.handle.abort(),t.state.status="stopped",await this.store.save(t.state),!0):!1}async terminate(a){await this.ensureLoaded();const t=this.findByName(a);return t?(t.currentTurnAbortController&&t.currentTurnAbortController.abort(),t.handle&&await t.handle.terminate(),t.worktree&&await this.worktreeManager.dispose(t.worktree),this.permissions.cancelForTeammate(t.state.identity.id),this.permissions.clearPaths(t.state.identity.id),this.mailbox.clearTeammate(t.state.identity.id),await this.transcripts.remove(t.state.identity.id),t.state.status="terminated",await this.store.save(t.state),await this.store.remove(t.state.identity.id),this.teammates.delete(t.state.identity.id),this.teammates.delete(t.state.identity.name),this.teammates.delete(t.state.identity.label),!0):!1}async setMode(a,t){await this.ensureLoaded();const s=this.findByName(a);if(!s)return{ok:!1,error:"not_found"};if(!(t==="execute"&&b(s.state.identity.role)&&s.state.mode!=="execute"))return s.state.mode=t,await this.store.save(s.state),this.mailbox.post({teammateId:s.state.identity.id,teammateName:s.state.identity.name,type:"mode_change",direction:"leader_to_teammate",payload:{mode:t}}),{ok:!0};const{id:e,decision:o}=this.permissions.request(s.state.identity.id,s.state.identity.name,"mode_change_to_execute",`Allow ${s.state.identity.name} to enter execute mode (sandboxed write in ${s.state.cwd})`);return this.mailbox.post({teammateId:s.state.identity.id,teammateName:s.state.identity.name,type:"permission_request",direction:"teammate_to_leader",payload:{requestId:e,action:"mode_change_to_execute"}}),o.then(async m=>{m&&(s.state.mode=t,await this.store.save(s.state)),this.mailbox.post({teammateId:s.state.identity.id,teammateName:s.state.identity.name,type:"permission_response",direction:"leader_to_teammate",payload:{requestId:e,approved:m}}),m&&this.mailbox.post({teammateId:s.state.identity.id,teammateName:s.state.identity.name,type:"mode_change",direction:"leader_to_teammate",payload:{mode:t}})}),{ok:!0,pending:{requestId:e}}}approvePermission(a){return this.permissions.approve(a)}denyPermission(a){return this.permissions.deny(a)}async addTask(a){const t=await this.tasks.create({title:a});return this.mailbox.post({teammateId:"team",teammateName:"team",type:"task_update",direction:"leader_to_teammate",payload:{action:"add",task:t}}),t}async claimTask(a,t){await this.ensureLoaded();const s=this.findByName(t);if(!s)return;const i=await this.tasks.claim(a,s.state.identity.id,s.state.identity.name);return i&&this.mailbox.post({teammateId:s.state.identity.id,teammateName:s.state.identity.name,type:"task_claim",direction:"leader_to_teammate",payload:{task:i}}),i}async updateTaskStatus(a,t){const s=await this.tasks.update(a,{status:t});return s&&this.mailbox.post({teammateId:s.ownerId??"team",teammateName:s.ownerName??"team",type:"task_update",direction:"leader_to_teammate",payload:{action:t,task:s}}),s}async listTasks(){return this.tasks.list()}async sendTeammateMail(a,t,s){await this.ensureLoaded();const i=this.findByName(a),e=this.findByName(t);return!i||!e?!1:(this.mailbox.post({teammateId:i.state.identity.id,teammateName:i.state.identity.name,targetTeammateId:e.state.identity.id,targetTeammateName:e.state.identity.name,type:"teammate_message",direction:"teammate_to_teammate",payload:{content:s}}),await this.transcripts.append(i.state.identity.id,{timestamp:Date.now(),kind:"event",content:`To ${e.state.identity.name}: ${s}`}),await this.transcripts.append(e.state.identity.id,{timestamp:Date.now(),kind:"event",content:`From ${i.state.identity.name}: ${s}`}),!0)}async allowPath(a,t){await this.ensureLoaded();const s=this.findByName(a);if(!s)return;const i=X(B(t)?t:S(s.state.cwd,t));return this.permissions.allowPath(s.state.identity.id,i),this.mailbox.post({teammateId:s.state.identity.id,teammateName:s.state.identity.name,type:"permission_response",direction:"leader_to_teammate",payload:{action:"write_path",path:i,approved:!0}}),i}getAllTeammates(){const a=new Set,t=[];for(const s of this.teammates.values())a.has(s.state.identity.id)||(a.add(s.state.identity.id),t.push(s.state));return t.sort((s,i)=>s.identity.createdAt-i.identity.createdAt)}getTeammate(a){return this.findByName(a)?.state}async dispose(){for(const a of this.teammates.values())a.currentTurnAbortController&&a.currentTurnAbortController.abort(),a.handle&&await a.handle.terminate().catch(()=>{});await this.subAgentRuntime.terminateAll()}async ensureLoaded(){this.loaded||await this.load()}findByName(a){return this.teammates.get(a)}generateName(a){let t;do this.nameCounter++,t=`${a}-${this.nameCounter}`;while(this.findByName(t));return t}generateLabel(){let a="";do this.labelCounter++,a=K(this.labelCounter);while(this.teammates.has(a));return a}bumpNameCounter(a,t){const s=new RegExp(`^${t}-(\\d+)$`).exec(a);if(!s)return;const i=Number.parseInt(s[1]??"",10);Number.isFinite(i)&&(this.nameCounter=Math.max(this.nameCounter,i))}bumpLabelCounter(a){const t=J(a);t>0&&(this.labelCounter=Math.max(this.labelCounter,t))}async detectWorkspaceType(a){try{const{stat:t}=await import("node:fs/promises");return await t(_(a,".git")),"worktree"}catch{return"temp"}}selectTools(a,t){return T({mode:a,cwd:t,getAllTeammates:d(()=>this.getAllTeammates(),"getAllTeammates"),isPathAllowed:d((s,i)=>this.permissions.isPathAllowed(s,i),"isPathAllowed")})}createWritePathGuard(a){return O({cwd:a,getAllTeammates:d(()=>this.getAllTeammates(),"getAllTeammates"),isPathAllowed:d((t,s)=>this.permissions.isPathAllowed(t,s),"isPathAllowed")})}}export{ht as TeamRuntime};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [WHO]: TeamStateStore class — durable teammate persistence
|
|
3
|
+
* [FROM]: Depends on node:fs/promises, node:path, node:os, ./team-types
|
|
4
|
+
* [TO]: Consumed by team-runtime.ts
|
|
5
|
+
* [HERE]: extensions/builtin/team/team-state-store.ts - one JSON file per teammate under <agentDir>/teams/
|
|
6
|
+
*
|
|
7
|
+
* Deliberately independent of core SessionManager. Per refactor plan:
|
|
8
|
+
* "team-state-store 自己负责 teammate 历史 ... SessionManager 只负责主会话".
|
|
9
|
+
*/
|
|
10
|
+
import type { PersistedTeammate } from "./team-types.js";
|
|
11
|
+
/**
|
|
12
|
+
* Resolve the agent dir using the canonical getAgentDir() from config.ts.
|
|
13
|
+
* Previously used NANOPENCIL_AGENT_DIR env directly (wrong name — should be
|
|
14
|
+
* CATUI_CODING_AGENT_DIR). Now reuses the single source of truth.
|
|
15
|
+
*/
|
|
16
|
+
export declare class TeamStateStore {
|
|
17
|
+
private readonly dir;
|
|
18
|
+
constructor(storageDir?: string);
|
|
19
|
+
/** Absolute storage directory for teammates. */
|
|
20
|
+
get directory(): string;
|
|
21
|
+
private fileFor;
|
|
22
|
+
private ensureDir;
|
|
23
|
+
/** Load all persisted teammates. Skips corrupt files. */
|
|
24
|
+
loadAll(): Promise<PersistedTeammate[]>;
|
|
25
|
+
/** Save (overwrite) one teammate record. */
|
|
26
|
+
save(state: PersistedTeammate): Promise<void>;
|
|
27
|
+
/** Remove a teammate's persisted file. No-op if missing. */
|
|
28
|
+
remove(id: string): Promise<void>;
|
|
29
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var c=Object.defineProperty;var n=(e,t)=>c(e,"name",{value:t,configurable:!0});import{mkdir as d,readFile as u,readdir as h,rm as f,writeFile as y}from"node:fs/promises";import{join as i}from"node:path";import{getAgentDir as l}from"../../../config.js";class g{static{n(this,"TeamStateStore")}dir;constructor(t){this.dir=t??i(l(),"teams")}get directory(){return this.dir}fileFor(t){return i(this.dir,`${t}.json`)}async ensureDir(){await d(this.dir,{recursive:!0})}async loadAll(){await this.ensureDir();let t;try{t=await h(this.dir)}catch{return[]}const r=[];for(const s of t)if(s.endsWith(".json"))try{const o=await u(i(this.dir,s),"utf-8"),a=JSON.parse(o);a?.identity?.id&&r.push(a)}catch{}return r}async save(t){await this.ensureDir();const r=`${JSON.stringify(t,null,2)}
|
|
2
|
+
`;await y(this.fileFor(t.identity.id),r,"utf-8")}async remove(t){try{await f(this.fileFor(t),{force:!0})}catch{}}}export{g as TeamStateStore};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [WHO]: TeamTaskStore class - durable shared task list for AgentTeam coordination
|
|
3
|
+
* [FROM]: Depends on node:fs/promises, node:path, ./team-types
|
|
4
|
+
* [TO]: Consumed by team-runtime.ts and index.ts
|
|
5
|
+
* [HERE]: extensions/builtin/team/team-task-store.ts - one tasks.json file under the team storage directory
|
|
6
|
+
*/
|
|
7
|
+
import type { TeamTask, TeamTaskStatus } from "./team-types.js";
|
|
8
|
+
export interface CreateTeamTaskInput {
|
|
9
|
+
title: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
dependsOn?: string[];
|
|
12
|
+
artifactPaths?: string[];
|
|
13
|
+
}
|
|
14
|
+
export interface UpdateTeamTaskInput {
|
|
15
|
+
status?: TeamTaskStatus;
|
|
16
|
+
ownerId?: string;
|
|
17
|
+
ownerName?: string;
|
|
18
|
+
description?: string;
|
|
19
|
+
artifactPaths?: string[];
|
|
20
|
+
}
|
|
21
|
+
export declare class TeamTaskStore {
|
|
22
|
+
private readonly filePath;
|
|
23
|
+
private tasks;
|
|
24
|
+
private loaded;
|
|
25
|
+
constructor(storageDir: string);
|
|
26
|
+
load(): Promise<void>;
|
|
27
|
+
create(input: CreateTeamTaskInput): Promise<TeamTask>;
|
|
28
|
+
claim(taskId: string, ownerId: string, ownerName: string): Promise<TeamTask | undefined>;
|
|
29
|
+
update(taskId: string, input: UpdateTeamTaskInput): Promise<TeamTask | undefined>;
|
|
30
|
+
list(): Promise<TeamTask[]>;
|
|
31
|
+
get(taskId: string): Promise<TeamTask | undefined>;
|
|
32
|
+
private find;
|
|
33
|
+
private nextId;
|
|
34
|
+
private save;
|
|
35
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var d=Object.defineProperty;var i=(s,e)=>d(s,"name",{value:e,configurable:!0});import{mkdir as r,readFile as n,writeFile as o}from"node:fs/promises";import{dirname as f,join as h}from"node:path";class w{static{i(this,"TeamTaskStore")}filePath;tasks=[];loaded=!1;constructor(e){this.filePath=h(e,"tasks.json")}async load(){if(!this.loaded){try{const e=await n(this.filePath,"utf-8"),t=JSON.parse(e);this.tasks=Array.isArray(t)?t.filter(a=>a?.id&&a?.title):[]}catch{this.tasks=[]}this.loaded=!0}}async create(e){await this.load();const t=Date.now(),a={id:this.nextId(),title:e.title.trim(),description:e.description?.trim()||void 0,status:"open",dependsOn:e.dependsOn??[],artifactPaths:e.artifactPaths??[],createdAt:t,updatedAt:t};return this.tasks.push(a),await this.save(),a}async claim(e,t,a){return this.update(e,{status:"claimed",ownerId:t,ownerName:a})}async update(e,t){await this.load();const a=this.find(e);if(a)return t.status&&(a.status=t.status,a.completedAt=t.status==="done"?Date.now():void 0),t.ownerId!==void 0&&(a.ownerId=t.ownerId||void 0),t.ownerName!==void 0&&(a.ownerName=t.ownerName||void 0),t.description!==void 0&&(a.description=t.description.trim()||void 0),t.artifactPaths!==void 0&&(a.artifactPaths=t.artifactPaths),a.updatedAt=Date.now(),await this.save(),a}async list(){return await this.load(),[...this.tasks].sort((e,t)=>e.createdAt-t.createdAt)}async get(e){return await this.load(),this.find(e)}find(e){return this.tasks.find(t=>t.id===e)}nextId(){const e=new Set(this.tasks.map(t=>t.id));for(let t=this.tasks.length+1;;t++){const a=`T-${t}`;if(!e.has(a))return a}}async save(){await r(f(this.filePath),{recursive:!0}),await o(this.filePath,`${JSON.stringify(this.tasks,null,2)}
|
|
2
|
+
`,"utf-8")}}export{w as TeamTaskStore};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [WHO]: TeamTranscriptWriter
|
|
3
|
+
* [FROM]: Depends on node:fs/promises, node:path
|
|
4
|
+
* [TO]: Consumed by team-runtime.ts
|
|
5
|
+
* [HERE]: extensions/builtin/team/team-transcript.ts - per-teammate JSONL transcripts
|
|
6
|
+
*
|
|
7
|
+
* Per refactor plan §B.7: each teammate keeps an independent transcript file
|
|
8
|
+
* for offline observation and debugging. Format is JSONL — one entry per
|
|
9
|
+
* line — under `<storageDir>/transcripts/<teammateId>.jsonl`.
|
|
10
|
+
*
|
|
11
|
+
* Writes are best-effort and never throw into the runtime hot path.
|
|
12
|
+
*/
|
|
13
|
+
export interface TranscriptEntry {
|
|
14
|
+
timestamp: number;
|
|
15
|
+
kind: "leader" | "teammate" | "event";
|
|
16
|
+
content: string;
|
|
17
|
+
meta?: Record<string, unknown>;
|
|
18
|
+
}
|
|
19
|
+
export declare class TeamTranscriptWriter {
|
|
20
|
+
private readonly dir;
|
|
21
|
+
private dirReady;
|
|
22
|
+
constructor(storageDir: string);
|
|
23
|
+
private ensureDir;
|
|
24
|
+
private fileFor;
|
|
25
|
+
/** Append one entry to the teammate's transcript. Never throws. */
|
|
26
|
+
append(teammateId: string, entry: TranscriptEntry): Promise<void>;
|
|
27
|
+
/** Remove a teammate's transcript file (called on terminate). */
|
|
28
|
+
remove(teammateId: string): Promise<void>;
|
|
29
|
+
/** Storage directory used for transcripts. */
|
|
30
|
+
get directory(): string;
|
|
31
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var s=Object.defineProperty;var t=(i,r)=>s(i,"name",{value:r,configurable:!0});import{mkdir as c,appendFile as n,rm as d}from"node:fs/promises";import{join as e}from"node:path";class y{static{t(this,"TeamTranscriptWriter")}dir;dirReady=!1;constructor(r){this.dir=e(r,"transcripts")}async ensureDir(){if(!this.dirReady)try{await c(this.dir,{recursive:!0}),this.dirReady=!0}catch{}}fileFor(r){return e(this.dir,`${r}.jsonl`)}async append(r,a){try{await this.ensureDir(),await n(this.fileFor(r),`${JSON.stringify(a)}
|
|
2
|
+
`,"utf-8")}catch{}}async remove(r){try{await d(this.fileFor(r),{force:!0})}catch{}}get directory(){return this.dir}}export{y as TeamTranscriptWriter};
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [WHO]: TeammateRole, TeammateMode, HarnessState, PsycheWeights, TeamUtterance, Handoff, LeaderPlan, AgentLiveView, PersistedTeammate, TeamSpawnSpec, TeamSendResult
|
|
3
|
+
* [FROM]: No external deps
|
|
4
|
+
* [TO]: Consumed by team-state-store.ts, team-runtime.ts, team-parser.ts, team-dashboard.ts, team-orchestrator.ts, index.ts
|
|
5
|
+
* [HERE]: extensions/builtin/team/team-types.ts - shared type surface for team extension
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Teammate role. Determines default mode and toolset.
|
|
9
|
+
* - pm: planning and sequencing
|
|
10
|
+
* - architect: system design and technical decomposition
|
|
11
|
+
* - developer: implementation and code delivery
|
|
12
|
+
* - designer: UX/UI and interaction review
|
|
13
|
+
* - data-analyst: metrics, evidence, and verification framing
|
|
14
|
+
* - researcher: read-only exploration
|
|
15
|
+
* - reviewer: read-only review/audit
|
|
16
|
+
* - implementer: legacy implementation role
|
|
17
|
+
* - planner: legacy planning role
|
|
18
|
+
* - verifier: legacy verification role
|
|
19
|
+
* - generic: read-only by default, caller supplies mode
|
|
20
|
+
*/
|
|
21
|
+
export type TeammateRole = "pm" | "architect" | "developer" | "designer" | "data-analyst" | "researcher" | "reviewer" | "implementer" | "planner" | "verifier" | "generic";
|
|
22
|
+
/**
|
|
23
|
+
* Teammate operating mode. Controls the permission envelope.
|
|
24
|
+
* - research: read-only exploration
|
|
25
|
+
* - plan: read-only plan production; execute requires leader approval
|
|
26
|
+
* - execute: sandboxed write in worktree
|
|
27
|
+
* - review: read-only review
|
|
28
|
+
*/
|
|
29
|
+
export type TeammateMode = "research" | "plan" | "execute" | "review";
|
|
30
|
+
/**
|
|
31
|
+
* Teammate lifecycle status.
|
|
32
|
+
* - idle: spawned, no work in flight
|
|
33
|
+
* - running: currently processing a message
|
|
34
|
+
* - stopped: current turn aborted, teammate still alive
|
|
35
|
+
* - terminated: fully disposed
|
|
36
|
+
* - error: last turn failed
|
|
37
|
+
*/
|
|
38
|
+
export type TeammateStatus = "idle" | "running" | "stopped" | "terminated" | "error";
|
|
39
|
+
/** Shared task status for team coordination. */
|
|
40
|
+
export type TeamTaskStatus = "open" | "claimed" | "blocked" | "done" | "cancelled";
|
|
41
|
+
/** Harness phase for long-running teammate work. */
|
|
42
|
+
export type HarnessPhase = "init" | "coding" | "verify" | "fix" | "complete";
|
|
43
|
+
/** Three-layer psyche weights used by phase-aware prompts. */
|
|
44
|
+
export interface PsycheWeights {
|
|
45
|
+
id: number;
|
|
46
|
+
ego: number;
|
|
47
|
+
superego: number;
|
|
48
|
+
}
|
|
49
|
+
/** Built-in team presets. */
|
|
50
|
+
export type PresetName = "solo" | "duo" | "squad";
|
|
51
|
+
/** Feature tracked by the harness protocol. */
|
|
52
|
+
export interface HarnessFeature {
|
|
53
|
+
id: string;
|
|
54
|
+
category: "functional" | "visual" | "performance" | "integration";
|
|
55
|
+
description: string;
|
|
56
|
+
steps: string[];
|
|
57
|
+
passes: boolean;
|
|
58
|
+
priority: number;
|
|
59
|
+
}
|
|
60
|
+
/** Durable harness state attached to a teammate. */
|
|
61
|
+
export interface HarnessState {
|
|
62
|
+
enabled: boolean;
|
|
63
|
+
phase: HarnessPhase;
|
|
64
|
+
featureListPath: string;
|
|
65
|
+
progressPath: string;
|
|
66
|
+
initScriptPath: string;
|
|
67
|
+
totalFeatures: number;
|
|
68
|
+
passedFeatures: number;
|
|
69
|
+
currentFeature: string | null;
|
|
70
|
+
lastVerifyReport: string | null;
|
|
71
|
+
cycleCount: number;
|
|
72
|
+
featureSnapshot: Omit<HarnessFeature, "passes">[];
|
|
73
|
+
/** Git commit that existed before the current harness turn began */
|
|
74
|
+
preTurnCommit: string | null;
|
|
75
|
+
/** Last commit created by the harness checkpoint flow */
|
|
76
|
+
lastCheckpointCommit: string | null;
|
|
77
|
+
/** Last commit created to revert a failed/violating turn */
|
|
78
|
+
lastRevertCommit: string | null;
|
|
79
|
+
lastEvent?: string;
|
|
80
|
+
}
|
|
81
|
+
/** Transient live view state used by the TUI dashboard while a teammate is running. */
|
|
82
|
+
export interface TeammateLiveState {
|
|
83
|
+
phase: "starting" | "thinking" | "tool" | "finishing" | "done" | "error";
|
|
84
|
+
preview: string;
|
|
85
|
+
toolName: string | null;
|
|
86
|
+
updatedAt: number;
|
|
87
|
+
}
|
|
88
|
+
/** High-level conversation role surfaced in the team TUI. */
|
|
89
|
+
export type TeamSpeakerRole = "leader" | TeammateRole;
|
|
90
|
+
/** Canonical message kind used by the team speaker stream. */
|
|
91
|
+
export type TeamMessageKind = "thought" | "work" | "handoff" | "result";
|
|
92
|
+
/** Parsed @mention used for agent-to-agent handoffs. */
|
|
93
|
+
export interface TeamMention {
|
|
94
|
+
raw: string;
|
|
95
|
+
targetId: string;
|
|
96
|
+
targetName: string;
|
|
97
|
+
targetLabel: string;
|
|
98
|
+
task: string;
|
|
99
|
+
}
|
|
100
|
+
/** One utterance in the visible team chat stream. */
|
|
101
|
+
export interface TeamUtterance {
|
|
102
|
+
id: string;
|
|
103
|
+
speakerId: string;
|
|
104
|
+
speakerLabel: string;
|
|
105
|
+
role: TeamSpeakerRole;
|
|
106
|
+
text: string;
|
|
107
|
+
kind: TeamMessageKind;
|
|
108
|
+
mentions: TeamMention[];
|
|
109
|
+
timestamp: number;
|
|
110
|
+
}
|
|
111
|
+
/** Leader-visible handoff edge between two agents. */
|
|
112
|
+
export interface Handoff {
|
|
113
|
+
id: string;
|
|
114
|
+
from: string;
|
|
115
|
+
to: string;
|
|
116
|
+
task: string;
|
|
117
|
+
status: "pending" | "accepted" | "done" | "blocked";
|
|
118
|
+
timestamp: number;
|
|
119
|
+
}
|
|
120
|
+
/** Compact per-agent state shown in the workbench/dashboard. */
|
|
121
|
+
export interface AgentLiveView {
|
|
122
|
+
name: string;
|
|
123
|
+
label: string;
|
|
124
|
+
role: TeammateRole;
|
|
125
|
+
currentTask?: string;
|
|
126
|
+
lastUtterance?: string;
|
|
127
|
+
blockedOn?: string;
|
|
128
|
+
progress?: string;
|
|
129
|
+
}
|
|
130
|
+
/** One leader-owned subtask in the orchestration plan. */
|
|
131
|
+
export interface LeaderSubtask {
|
|
132
|
+
id: string;
|
|
133
|
+
ownerId: string;
|
|
134
|
+
ownerName: string;
|
|
135
|
+
ownerLabel: string;
|
|
136
|
+
ownerRole: TeammateRole;
|
|
137
|
+
title: string;
|
|
138
|
+
task: string;
|
|
139
|
+
dependsOn: string[];
|
|
140
|
+
status: "pending" | "in_progress" | "done" | "blocked";
|
|
141
|
+
}
|
|
142
|
+
/** Session-scoped leader plan used by the orchestrator. */
|
|
143
|
+
export interface LeaderPlan {
|
|
144
|
+
userGoal: string;
|
|
145
|
+
phase: "plan" | "assign" | "watch" | "rebalance" | "summarize" | "done";
|
|
146
|
+
subtasks: LeaderSubtask[];
|
|
147
|
+
owners: Record<string, string>;
|
|
148
|
+
dependencies: Record<string, string[]>;
|
|
149
|
+
completionState: "pending" | "running" | "completed" | "blocked";
|
|
150
|
+
}
|
|
151
|
+
/** Stable identity for a teammate, assigned at spawn time. */
|
|
152
|
+
export interface TeammateIdentity {
|
|
153
|
+
/** Unique id (uuid) */
|
|
154
|
+
id: string;
|
|
155
|
+
/** Stable short label used in the TUI and mention protocol (A/B/C/...) */
|
|
156
|
+
label: string;
|
|
157
|
+
/** Human-friendly name (user-supplied or auto-generated) */
|
|
158
|
+
name: string;
|
|
159
|
+
/** Role determines default tools and mode */
|
|
160
|
+
role: TeammateRole;
|
|
161
|
+
/** Creation timestamp (ms) */
|
|
162
|
+
createdAt: number;
|
|
163
|
+
}
|
|
164
|
+
/** One conversation turn persisted with the teammate. */
|
|
165
|
+
export interface TeammateMessage {
|
|
166
|
+
/** Turn id (uuid) */
|
|
167
|
+
id: string;
|
|
168
|
+
/** Timestamp (ms) */
|
|
169
|
+
timestamp: number;
|
|
170
|
+
/** Who spoke */
|
|
171
|
+
direction: "leader" | "teammate";
|
|
172
|
+
/** Plain text body */
|
|
173
|
+
content: string;
|
|
174
|
+
/** Whether the turn was aborted mid-flight */
|
|
175
|
+
aborted?: boolean;
|
|
176
|
+
/** Whether the turn errored */
|
|
177
|
+
error?: string;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Durable teammate state. Only plain JSON fields — no runtime handles.
|
|
181
|
+
* This is the on-disk shape managed by TeamStateStore.
|
|
182
|
+
*/
|
|
183
|
+
export interface PersistedTeammate {
|
|
184
|
+
identity: TeammateIdentity;
|
|
185
|
+
mode: TeammateMode;
|
|
186
|
+
status: TeammateStatus;
|
|
187
|
+
/** Working directory for the teammate (main cwd or worktree path) */
|
|
188
|
+
cwd: string;
|
|
189
|
+
/** Worktree path if the teammate owns one, otherwise undefined */
|
|
190
|
+
worktreePath?: string;
|
|
191
|
+
/** Git branch name for worktree teammates */
|
|
192
|
+
worktreeBranch?: string;
|
|
193
|
+
/** Conversation history */
|
|
194
|
+
messages: TeammateMessage[];
|
|
195
|
+
/** Last activity timestamp */
|
|
196
|
+
lastActiveAt: number;
|
|
197
|
+
/** Last error message if status = error */
|
|
198
|
+
lastError?: string;
|
|
199
|
+
/** Optional long-running task harness state */
|
|
200
|
+
harness?: HarnessState;
|
|
201
|
+
/** Last computed psyche weights for status/UI rendering */
|
|
202
|
+
psyche?: PsycheWeights;
|
|
203
|
+
/** Optional static psyche tuning from presets or spawn configuration */
|
|
204
|
+
psycheOverrides?: Partial<PsycheWeights>;
|
|
205
|
+
/** Runtime-only TUI live state; cleared before persistence after each run */
|
|
206
|
+
live?: TeammateLiveState;
|
|
207
|
+
/** Structured workbench state shown by the team dashboard */
|
|
208
|
+
liveView?: AgentLiveView;
|
|
209
|
+
}
|
|
210
|
+
/** Input for spawning a new teammate. */
|
|
211
|
+
export interface TeamSpawnSpec {
|
|
212
|
+
/** Desired name; if taken or empty, runtime generates one */
|
|
213
|
+
name?: string;
|
|
214
|
+
/** Role selection */
|
|
215
|
+
role: TeammateRole;
|
|
216
|
+
/** Optional explicit mode override (defaults to role's natural mode) */
|
|
217
|
+
mode?: TeammateMode;
|
|
218
|
+
/** Base cwd for the teammate (usually the main session cwd) */
|
|
219
|
+
baseCwd: string;
|
|
220
|
+
/** Enable Anthropic-style long-running harness protocol for this teammate */
|
|
221
|
+
harnessEnabled?: boolean;
|
|
222
|
+
/** Optional static psyche tuning for this teammate */
|
|
223
|
+
psycheOverrides?: Partial<PsycheWeights>;
|
|
224
|
+
}
|
|
225
|
+
/** Result of a /team:send call. */
|
|
226
|
+
export interface TeamSendResult {
|
|
227
|
+
teammateId: string;
|
|
228
|
+
teammateName: string;
|
|
229
|
+
success: boolean;
|
|
230
|
+
response: string;
|
|
231
|
+
aborted?: boolean;
|
|
232
|
+
error?: string;
|
|
233
|
+
durationMs: number;
|
|
234
|
+
utterance?: TeamUtterance;
|
|
235
|
+
mentions?: TeamMention[];
|
|
236
|
+
}
|
|
237
|
+
/** Durable task record shared by the team. */
|
|
238
|
+
export interface TeamTask {
|
|
239
|
+
id: string;
|
|
240
|
+
title: string;
|
|
241
|
+
description?: string;
|
|
242
|
+
status: TeamTaskStatus;
|
|
243
|
+
ownerId?: string;
|
|
244
|
+
ownerName?: string;
|
|
245
|
+
dependsOn: string[];
|
|
246
|
+
artifactPaths: string[];
|
|
247
|
+
createdAt: number;
|
|
248
|
+
updatedAt: number;
|
|
249
|
+
completedAt?: number;
|
|
250
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [WHO]: TEAM_MESSAGE_TYPE, team message rendering, status/list formatting, dashboard/observer helpers
|
|
3
|
+
* [FROM]: Depends on @catui/tui, core/extensions-host/types, theme colors, team runtime/types/dashboard/harness/orchestrator helpers
|
|
4
|
+
* [TO]: Consumed by extensions/builtin/team/index.ts
|
|
5
|
+
* [HERE]: extensions/builtin/team/team-ui.ts - UI and text formatting boundary for AgentTeam
|
|
6
|
+
*/
|
|
7
|
+
import type { ExtensionAPI, MessageRenderer } from "../../../core/extensions-host/types.js";
|
|
8
|
+
import type { TeamRuntime, TeamRuntimeEvent } from "./team-runtime.js";
|
|
9
|
+
import type { PersistedTeammate, TeamTask, TeamUtterance } from "./team-types.js";
|
|
10
|
+
export declare const TEAM_MESSAGE_TYPE = "team";
|
|
11
|
+
export declare function clearTeamDashboardTimer(): void;
|
|
12
|
+
export declare function createTeamMessageRenderer(): MessageRenderer;
|
|
13
|
+
export declare function formatTaskList(tasks: TeamTask[]): string[];
|
|
14
|
+
export declare function formatTeammateList(teammates: PersistedTeammate[]): string[];
|
|
15
|
+
export declare function formatTeammateStatus(teammate: PersistedTeammate): string[];
|
|
16
|
+
export declare function emitTeamUtterance(api: ExtensionAPI, utterance: TeamUtterance, options?: {
|
|
17
|
+
streamKey?: string;
|
|
18
|
+
replace?: boolean;
|
|
19
|
+
}): void;
|
|
20
|
+
export declare function formatSpeakerName(teammate: PersistedTeammate): string;
|
|
21
|
+
export declare function toggleTeamDashboard(ctx: {
|
|
22
|
+
ui: {
|
|
23
|
+
setStatus(key: string, text: string | undefined): void;
|
|
24
|
+
setWidget(key: string, content: string[] | undefined): void;
|
|
25
|
+
};
|
|
26
|
+
}, teamRuntime: TeamRuntime): boolean;
|
|
27
|
+
export declare function updateTeamUi(ctx: {
|
|
28
|
+
ui: {
|
|
29
|
+
setStatus(key: string, text: string | undefined): void;
|
|
30
|
+
setWidget(key: string, content: string[] | undefined): void;
|
|
31
|
+
};
|
|
32
|
+
}, teamRuntime: TeamRuntime): void;
|
|
33
|
+
export declare function setTeamActivity(ctx: {
|
|
34
|
+
ui: {
|
|
35
|
+
setStatus(key: string, text: string | undefined): void;
|
|
36
|
+
setWidget(key: string, content: string[] | undefined): void;
|
|
37
|
+
setWorkingMessage(message?: string): void;
|
|
38
|
+
};
|
|
39
|
+
}, lines: string[]): void;
|
|
40
|
+
export declare function createTeamObserver(api: ExtensionAPI, ctx: {
|
|
41
|
+
ui: {
|
|
42
|
+
setStatus(key: string, text: string | undefined): void;
|
|
43
|
+
setWidget(key: string, content: string[] | undefined): void;
|
|
44
|
+
setWorkingMessage(message?: string): void;
|
|
45
|
+
};
|
|
46
|
+
}, teamRuntime: TeamRuntime): {
|
|
47
|
+
onEvent(event: TeamRuntimeEvent): void;
|
|
48
|
+
flush(): void;
|
|
49
|
+
};
|
|
50
|
+
export declare function truncateForStatus(value: string, max?: number): string;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var T=Object.defineProperty;var r=(e,n)=>T(e,"name",{value:n,configurable:!0});import{Box as w,Container as f,Spacer as h,Text as g}from"@catui/tui";import{formatHarnessProgress as k}from"./team-harness.js";import{createTeamUtterance as x,formatUtteranceForContext as b}from"./team-orchestrator.js";import{renderTeamDashboard as M,renderTeamFooterStatus as S}from"./team-dashboard.js";import{formatPsycheWeights as v}from"./team-psyche.js";const L="team";let m=!1;function R(){}r(R,"clearTeamDashboardTimer");function G(){return(e,n,t)=>{const i=e.details;if(i?.variant==="utterance"){const{utterance:s}=i,c=t.fg(C(s.role),`\x1B[1m${s.speakerLabel}:\x1B[22m`),u=t.fg(P(s.kind),s.text),l=new f;return l.addChild(new h(1)),l.addChild(new g(`${c} ${u}`,1,0)),l}const o=typeof e.content=="string"?e.content:Array.isArray(e.content)?e.content.filter(s=>s.type==="text").map(s=>s.text).join(`
|
|
2
|
+
`):"",d=new w(1,1,s=>t.bg("customMessageBg",s));d.addChild(new g(t.fg("customMessageText",o),0,0));const a=new f;return a.addChild(new h(1)),a.addChild(d),a}}r(G,"createTeamMessageRenderer");function Q(e){if(e.length===0)return["No team tasks. Use /team:task add <title> to create one."];const n=["Team Tasks:",""];for(const t of e){const i=t.ownerName?` @${t.ownerName}`:"",o=t.dependsOn.length?` deps:${t.dependsOn.join(",")}`:"";n.push(`${t.id} [${t.status}]${i}${o} ${t.title}`),t.description&&n.push(` ${t.description}`),t.artifactPaths.length&&n.push(` artifacts: ${t.artifactPaths.join(", ")}`)}return n}r(Q,"formatTaskList");function V(e){if(e.length===0)return["No teammates. Use /team:spawn to create one."];const n=[`Team (${e.length} teammate${e.length===1?"":"s"}):`,""];for(const t of e){const i=B(t.status),o=t.harness?.enabled?` | harness:${t.harness.phase} ${t.harness.passedFeatures}/${t.harness.totalFeatures}`:"";n.push(`${i} ${t.identity.name} (${t.identity.role}) - ${t.mode} mode${o}`)}return n}r(V,"formatTeammateList");function Y(e){const n=[`Teammate: ${e.identity.name}`,` ID: ${e.identity.id}`,` Role: ${e.identity.role}`,` Mode: ${e.mode}`,` Status: ${e.status}`,` Created: ${new Date(e.identity.createdAt).toLocaleString()}`,` Last Active: ${new Date(e.lastActiveAt).toLocaleString()}`,` Working Directory: ${e.cwd}`];return e.worktreePath&&(n.push(` Worktree: ${e.worktreePath}`),e.worktreeBranch&&n.push(` Branch: ${e.worktreeBranch}`)),e.lastError&&n.push(` Last Error: ${e.lastError}`),e.harness?.enabled&&n.push(...k(e.harness).map(t=>` ${t}`)),e.psyche&&n.push(` ${v(e.psyche)}`),n.push(` Messages: ${e.messages.length}`),n}r(Y,"formatTeammateStatus");function A(e,n,t){e.sendMessage({customType:L,content:b(n),display:!0,details:{variant:"utterance",utterance:n,streamKey:t?.streamKey,replace:t?.replace}})}r(A,"emitTeamUtterance");function E(e){return e.identity.name}r(E,"formatSpeakerName");function q(e,n){return m=!m,p(e,n),m}r(q,"toggleTeamDashboard");function p(e,n){const t=n.getAllTeammates(),i=t.some(d=>d.status==="running"),o=m||i;e.ui.setStatus("team",o?S(t):void 0),e.ui.setWidget("team-dashboard",o?M(t,80,{expanded:m}):void 0)}r(p,"updateTeamUi");function z(e,n){const[t]=n;e.ui.setStatus("team",t??"Team: working..."),e.ui.setWidget("team-dashboard",["+ Team Workbench ------------------------------------------+",...n.map(i=>`| ${W(i,58).padEnd(58)} |`),"+---------------------------------------------------------+"]),e.ui.setWorkingMessage(t??"Team: working...")}r(z,"setTeamActivity");function J(e,n,t){let i=0;const o=new Map,d=new Map;return{onEvent(a){const s=Date.now();if(a.type==="teammate_live"){if(n.ui.setWorkingMessage(D(a)),a.event.type==="message_update"){const c=a.teammate,u=c.live?.preview??a.event.text??"",l=o.get(c.identity.id)??"",$=u.startsWith(l)?u.slice(l.length):u,y=d.get(c.identity.id)??0;U($,s-y)&&(A(e,x({speakerId:c.identity.id,speakerLabel:E(c),role:c.identity.role,kind:"thought",text:u.trim()||_(u)}),{streamKey:`team-stream:${c.identity.id}`,replace:!0}),o.set(c.identity.id,u),d.set(c.identity.id,s))}}else a.type==="teammate_status"?n.ui.setWorkingMessage(`Team: ${a.event}`):n.ui.setWorkingMessage(`Team: ${a.teammate.identity.name} ${a.event}`);(a.type==="teammate_live"||s-i>80)&&(p(n,t),i=s)},flush(){p(n,t)}}}r(J,"createTeamObserver");function W(e,n=100){const t=N(e);return t.length<=n?t:`${t.slice(0,Math.max(0,n-3))}...`}r(W,"truncateForStatus");function C(e){switch(e){case"leader":return"accent";case"pm":return"warning";case"architect":return"mdHeading";case"developer":case"implementer":return"success";case"designer":return"mdLink";case"data-analyst":return"syntaxNumber";case"reviewer":return"mdQuote";case"researcher":return"syntaxFunction";default:return"customMessageLabel"}}r(C,"getTeamSpeakerColor");function P(e){switch(e){case"thought":return"thinkingText";case"handoff":return"mdLink";default:return"text"}}r(P,"getTeamUtteranceColor");function U(e,n){const t=e.trim();return t?t.length>=24||/[\n。!?!?]$/.test(t)||n>=700:!1}r(U,"shouldEmitStreamDelta");function _(e,n=120){const t=e.replace(/\s+/g," ").trim();return t.length<=n?t:t.slice(t.length-n)}r(_,"tailPreview");function D(e){const n=e.teammate.identity.name,t=e.teammate.live;return e.event.type==="tool_start"?`Team: ${n} running ${e.event.toolName}...`:e.event.type==="tool_update"||e.event.type==="tool_end"?`Team: ${n} using ${e.event.toolName}...`:t?.phase==="thinking"?`Team: ${n} streaming...`:t?.phase==="finishing"?`Team: ${n} finishing...`:`Team: ${n} ${t?.phase??"working"}...`}r(D,"formatLiveWorkingMessage");function N(e){return e.replace(/\s+/g," ").trim()}r(N,"singleLine");function B(e){switch(e){case"idle":return"o";case"running":return"*";case"stopped":return"!";case"error":return"x";case"terminated":return"-";default:return"?"}}r(B,"getStatusIconAscii");export{L as TEAM_MESSAGE_TYPE,R as clearTeamDashboardTimer,G as createTeamMessageRenderer,J as createTeamObserver,A as emitTeamUtterance,E as formatSpeakerName,Q as formatTaskList,V as formatTeammateList,Y as formatTeammateStatus,z as setTeamActivity,q as toggleTeamDashboard,W as truncateForStatus,p as updateTeamUi};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# TokenSave
|
|
2
|
+
|
|
3
|
+
TokenSave is a default-on extension that reduces noisy shell output before it enters the agent context.
|
|
4
|
+
|
|
5
|
+
## Behavior
|
|
6
|
+
|
|
7
|
+
- Commands execute with their original shell semantics.
|
|
8
|
+
- TokenSave plans commands before execution and filters output after execution.
|
|
9
|
+
- Small outputs, unsafe redirection, heredocs, and explicitly disabled commands pass through unchanged.
|
|
10
|
+
- Filtered outputs include estimated token savings and a raw recovery file path when available.
|
|
11
|
+
- Both agent-called `bash` tools and user `!` bash commands are covered. `!!` commands stay excluded from context and are not intercepted.
|
|
12
|
+
|
|
13
|
+
## Disable
|
|
14
|
+
|
|
15
|
+
Set either environment variable on a command to bypass filtering:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
TOKEN_SAVE_DISABLED=1 git status
|
|
19
|
+
TOKENSAVE_DISABLED=1 npm test
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Stats
|
|
23
|
+
|
|
24
|
+
Use:
|
|
25
|
+
|
|
26
|
+
```text
|
|
27
|
+
/tokensave
|
|
28
|
+
/tokensave history
|
|
29
|
+
/tokensave plan <command>
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Config Filters
|
|
33
|
+
|
|
34
|
+
User filters load from:
|
|
35
|
+
|
|
36
|
+
```text
|
|
37
|
+
~/.catui/token-save/filters.json
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Project filters load from:
|
|
41
|
+
|
|
42
|
+
```text
|
|
43
|
+
.catui/token-save/filters.json
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Project filters are ignored unless the project explicitly opts in with:
|
|
47
|
+
|
|
48
|
+
```json
|
|
49
|
+
{ "trusted": true }
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
at:
|
|
53
|
+
|
|
54
|
+
```text
|
|
55
|
+
.catui/token-save/trust.json
|
|
56
|
+
```
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { TomlStyleFilter } from "./toml-dsl.js";
|
|
2
|
+
export interface ConfiguredTokenSaveFilter {
|
|
3
|
+
name: string;
|
|
4
|
+
commandPattern: string;
|
|
5
|
+
filter: TomlStyleFilter;
|
|
6
|
+
source: "user" | "project";
|
|
7
|
+
}
|
|
8
|
+
export declare function loadTokenSaveConfigFilters(projectPath: string): Promise<ConfiguredTokenSaveFilter[]>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var f=Object.defineProperty;var n=(t,r)=>f(t,"name",{value:r,configurable:!0});import{readFile as i}from"node:fs/promises";import{homedir as p}from"node:os";import{join as o}from"node:path";async function j(t){const r=o(p(),".catui","token-save","filters.json"),e=o(t,".catui","token-save","filters.json"),s=o(t,".catui","token-save","trust.json"),a=[];return a.push(...await c(r,"user")),await m(s)&&a.push(...await c(e,"project")),a}n(j,"loadTokenSaveConfigFilters");async function m(t){try{return JSON.parse(await i(t,"utf8")).trusted===!0}catch{return!1}}n(m,"isProjectTrusted");async function c(t,r){try{return(JSON.parse(await i(t,"utf8")).filters??[]).filter(s=>l(s)).map(s=>({...s,source:r}))}catch{return[]}}n(c,"readFilters");function l(t){return!t||typeof t.name!="string"||typeof t.commandPattern!="string"||t.commandPattern.length>240||!u(t.commandPattern)||!t.filter||typeof t.filter!="object"?!1:[t.filter.stripLines??[],t.filter.keepLines??[],(t.filter.replace??[]).map(e=>e.pattern),(t.filter.matchMessage??[]).map(e=>e.pattern)].flat().every(e=>typeof e=="string"&&e.length<=240&&u(e))}n(l,"isSafeFilter");function u(t){try{return new RegExp(t),!0}catch{return!1}}n(u,"canCompile");export{j as loadTokenSaveConfigFilters};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type TokenSaveCategory = "git-status" | "git-log" | "git-diff" | "read-file" | "search" | "typescript" | "lint" | "pytest" | "test" | "json" | "package-manager" | "generic";
|
|
2
|
+
export interface TokenSaveClassification {
|
|
3
|
+
category: TokenSaveCategory;
|
|
4
|
+
mode: "filtered" | "passthrough";
|
|
5
|
+
reason?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface TokenSaveFilterResult {
|
|
8
|
+
text: string;
|
|
9
|
+
category: TokenSaveCategory;
|
|
10
|
+
mode: "filtered" | "passthrough";
|
|
11
|
+
}
|
|
12
|
+
export declare function classifyCommand(command: string): TokenSaveClassification;
|
|
13
|
+
export declare function filterTokenSaveOutput(command: string, rawOutput: string): TokenSaveFilterResult;
|
|
14
|
+
export declare function estimateTokens(text: string): number;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
var b=Object.defineProperty;var a=(t,e)=>b(t,"name",{value:e,configurable:!0});import{truncateHead as m,truncateTail as u}from"../../../core/tools/truncate.js";const y=120,g=180,k=180;function f(t){return t.replace(/\x1b\[[0-?]*[ -/]*[@-~]/g,"")}a(f,"stripAnsi");function x(t){return t.split(/&&|\|\||;/,1)[0].replace(/^\s*(?:\w+=\S+\s+)*/,"").trim()}a(x,"firstCommandSegment");function $(t){return/\b(?:TOKEN_SAVE_DISABLED|TOKENSAVE_DISABLED)=1\b/.test(t)}a($,"looksLikeDisabled");function S(t){return/(^|\s)(?:>>?|2>|&>)/.test(t)||/\bcat\s*>/.test(t)}a(S,"hasWriteRedirection");function j(t){if(!t.trim())return{category:"generic",mode:"passthrough",reason:"empty command"};if($(t))return{category:"generic",mode:"passthrough",reason:"disabled by env"};const e=x(t);return S(e)?{category:"generic",mode:"passthrough",reason:"write redirection"}:/\bgit\s+status\b/.test(e)?{category:"git-status",mode:"filtered"}:/\bgit\s+(?:log|show)\b/.test(e)?{category:"git-log",mode:"filtered"}:/\bgit\s+(?:diff|show)\b/.test(e)?{category:"git-diff",mode:"filtered"}:/^(?:cat|head|tail|less|sed\s+-n)\b/.test(e)?{category:"read-file",mode:"filtered"}:/^(?:rg|grep|find|fd|ls|tree)\b/.test(e)?{category:"search",mode:"filtered"}:/\b(?:tsc|vue-tsc)\b/.test(e)?{category:"typescript",mode:"filtered"}:/\b(?:eslint|biome)\b/.test(e)?{category:"lint",mode:"filtered"}:/\bpytest\b/.test(e)?{category:"pytest",mode:"filtered"}:/\b(?:vitest|jest|playwright|pytest|mocha)\b/.test(e)?{category:"test",mode:"filtered"}:/\b(?:npm|pnpm|yarn|bun)\s+(?:install|add|remove|update)\b/.test(e)?{category:"package-manager",mode:"filtered"}:/\b(?:npm|pnpm|yarn|bun)\s+(?:test|run\s+(?:test|build|lint|typecheck)|exec\s+(?:tsc|vue-tsc|vitest|jest|playwright|eslint|biome))\b/.test(e)?{category:"test",mode:"filtered"}:/\b(?:jq|curl)\b/.test(e)?{category:"json",mode:"filtered"}:{category:"generic",mode:"filtered"}}a(j,"classifyCommand");function A(t){const e=t.split(`
|
|
2
|
+
`).map(o=>o.trimEnd()).filter(Boolean),s=e.find(o=>/^On branch /.test(o)||/^## /.test(o)),i=e.find(o=>/(nothing to commit|working tree clean|changed|insertions|deletions|files? changed)/i.test(o)),n=[];let r="";const c=new Map;for(const o of e){if(/^(Changes|Untracked|Changes not staged|Changes to be committed)/i.test(o)){r=o.replace(/:$/,""),c.has(r)||c.set(r,[]);continue}if(/^\s*(modified|new file|deleted|renamed|copied|both modified):\s+/.test(o)&&r)c.get(r)?.push(o.trim());else if(/^ \S/.test(o)&&/^Untracked files/i.test(r))c.get(r)?.push(o.trim());else if(/^[ MADRCU?!]{1,2}\s+/.test(o)){const l="Short status";c.has(l)||c.set(l,[]),c.get(l)?.push(o.trim())}}s&&n.push(s),i&&n.push(i);for(const[o,l]of c)n.push(`${o}: ${l.length}`),n.push(...l.slice(0,20).map(p=>` ${p}`)),l.length>20&&n.push(` ... ${l.length-20} more`);return n.length?n.join(`
|
|
3
|
+
`):m(t,{maxLines:80,maxBytes:12e3}).content}a(A,"compactGitStatus");function E(t){const e=t.split(`
|
|
4
|
+
`),s=e.filter(o=>o.startsWith("diff --git ")).map(o=>o.replace(/^diff --git /,"")),i=e.filter(o=>/^[-+]{3} |^@@ |^\+\+\+ /.test(o)),n=e.filter(o=>/^[+-][^+-]/.test(o)).length,r=[`Git diff compact: ${s.length} file(s), ${n} changed line(s)`];s.length&&r.push(...s.slice(0,40).map(o=>` ${o}`));const c=i.slice(0,k);return[...r,...c,i.length>c.length?`... ${i.length-c.length} diff metadata lines omitted`:""].filter(Boolean).join(`
|
|
5
|
+
`)}a(E,"compactGitDiff");function L(t){const e=t.split(`
|
|
6
|
+
`).filter(Boolean),s=e.filter(r=>/^(commit\s+[0-9a-f]{7,40}|[0-9a-f]{7,40}\s+)/i.test(r)),i=e.filter(r=>/^Date:\s+/.test(r)).slice(0,20),n=e.filter(r=>/^\s{4}\S/.test(r)).map(r=>r.trim()).slice(0,80);return s.length===0&&n.length===0?m(t,{maxLines:120,maxBytes:16e3}).content:[`Git log compact: ${s.length||n.length} entr${s.length===1||n.length===1?"y":"ies"}`,...s.slice(0,80),...i,...n].join(`
|
|
7
|
+
`)}a(L,"compactGitLog");function B(t){const e=f(t).split(`
|
|
8
|
+
`).filter(Boolean),s=new Map,i=[];for(const r of e){const c=r.match(/^(.+?\.(?:ts|tsx|js|jsx|vue))\((\d+),(\d+)\):\s+error\s+(TS\d+):\s+(.+)$/);if(c){const o=`${c[1]} ${c[4]}`,l=` ${c[2]}:${c[3]} ${c[5]}`,p=s.get(o)??[];p.push(l),s.set(o,p);continue}/error TS\d+|Found \d+ errors?/.test(r)&&i.push(r)}if(s.size===0)return d(t);const n=[`TypeScript compact: ${s.size} file/code group(s)`];for(const[r,c]of Array.from(s.entries()).slice(0,60))n.push(r),n.push(...c.slice(0,6)),c.length>6&&n.push(` ... ${c.length-6} more`);return n.push(...i.slice(-10)),n.join(`
|
|
9
|
+
`)}a(B,"compactTypeScriptOutput");function _(t){const s=f(t).split(`
|
|
10
|
+
`).filter(Boolean).filter(i=>/(error|warning|problem|^\s*\d+:\d+\s+|\/.+\.(?:ts|tsx|js|jsx|vue|css|json)$)/i.test(i));return s.length?s.slice(0,g).join(`
|
|
11
|
+
`):d(t)}a(_,"compactLintOutput");function O(t){const s=f(t).split(`
|
|
12
|
+
`).filter(Boolean).filter(i=>/(^FAILED |^ERROR |^E\s+|Traceback|AssertionError|short test summary|failed|passed|warnings?)/i.test(i));return s.length?s.slice(0,g).join(`
|
|
13
|
+
`):d(t)}a(O,"compactPytestOutput");function d(t){const e=f(t).split(`
|
|
14
|
+
`).filter(Boolean),s=e.filter(r=>/(error|failed|failure|exception|traceback|^\s*at\s+|expected|received|AssertionError|TS\d{4}|ERR!|FAIL)/i.test(r)),i=e.filter(r=>/(tests?|passed|failed|skipped|errors?|warnings?|Time:|Ran \d+)/i.test(r)).slice(-30),n=[...s.slice(0,g),...i];return n.length?Array.from(new Set(n)).join(`
|
|
15
|
+
`):u(t,{maxLines:120,maxBytes:18e3}).content}a(d,"compactFailureOutput");function T(t){const e=t.split(`
|
|
16
|
+
`).filter(Boolean);if(e.length<=160&&t.length<=2e4)return t;const s=new Map;for(const n of e){const r=n.split(":",1)[0]||"(output)",c=s.get(r)??[];c.push(n),s.set(r,c)}const i=[`Search compact: ${e.length} line(s), ${s.size} group(s)`];for(const[n,r]of Array.from(s.entries()).slice(0,80))i.push(`${n}: ${r.length}`),i.push(...r.slice(0,3).map(c=>` ${c.slice(0,240)}`)),r.length>3&&i.push(` ... ${r.length-3} more`);return i.join(`
|
|
17
|
+
`)}a(T,"compactSearchOutput");function R(t){const s=f(t).split(`
|
|
18
|
+
`).filter(Boolean).filter(i=>/(added|removed|updated|packages?|dependencies|deprecated|warning|error|vulnerab|audit|funding|lockfile|resolved|downloaded)/i.test(i));return s.length?s.slice(0,120).join(`
|
|
19
|
+
`):u(t,{maxLines:80,maxBytes:12e3}).content}a(R,"compactPackageManagerOutput");function D(t){const e=t.split(`
|
|
20
|
+
`);if(e.length<=220&&t.length<=24e3)return t;const s=m(t,{maxLines:80,maxBytes:12e3}).content,i=u(t,{maxLines:80,maxBytes:12e3}).content;return`${s}
|
|
21
|
+
|
|
22
|
+
... TokenSave omitted ${Math.max(0,e.length-160)} middle line(s) ...
|
|
23
|
+
|
|
24
|
+
${i}`}a(D,"compactFileRead");function I(t){try{const e=JSON.parse(t);return JSON.stringify(h(e),null,2)}catch{return u(t,{maxLines:y,maxBytes:18e3}).content}}a(I,"compactJson");function h(t,e=0){if(e>=4)return Array.isArray(t)?`[array:${t.length}]`:typeof t;if(Array.isArray(t))return{type:"array",length:t.length,sample:t.slice(0,3).map(s=>h(s,e+1))};if(t&&typeof t=="object"){const s=Object.entries(t).slice(0,40);return Object.fromEntries(s.map(([i,n])=>[i,h(n,e+1)]))}return typeof t=="string"&&t.length>160?`${t.slice(0,157)}...`:t}a(h,"summarizeJson");function N(t,e){const s=j(t),i=f(e);if(s.mode==="passthrough")return{text:e,category:s.category,mode:"passthrough"};let n;switch(s.category){case"git-status":n=A(i);break;case"git-diff":n=E(i);break;case"git-log":n=L(i);break;case"read-file":n=D(i);break;case"typescript":n=B(i);break;case"lint":n=_(i);break;case"pytest":n=O(i);break;case"test":n=d(i);break;case"json":n=I(i);break;case"search":n=T(i);break;case"package-manager":n=R(i);break;case"generic":n=u(i,{maxLines:y,maxBytes:18e3}).content;break}return{text:n||e,category:s.category,mode:"filtered"}}a(N,"filterTokenSaveOutput");function C(t){return Math.ceil(t.length/4)}a(C,"estimateTokens");export{j as classifyCommand,C as estimateTokens,N as filterTokenSaveOutput};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [WHO]: tokenSaveExtension - default-on bash output filtering, savings tracking, and /tokensave command
|
|
3
|
+
* [FROM]: Depends on core/extensions-host/types, ./filters, ./tracking
|
|
4
|
+
* [TO]: Auto-loaded by builtin-extensions.ts as a default extension
|
|
5
|
+
* [HERE]: extensions/builtin/token-save/index.ts - TokenSave extension entry point
|
|
6
|
+
*/
|
|
7
|
+
import type { ExtensionAPI } from "../../../core/extensions-host/types.js";
|
|
8
|
+
export default function tokenSaveExtension(api: ExtensionAPI): void;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var y=Object.defineProperty;var u=(r,n)=>y(r,"name",{value:n,configurable:!0});import{executeBash as k}from"../../../core/platform/exec/bash-executor.js";import{loadTokenSaveConfigFilters as p}from"./config.js";import{applyTokenSavePlan as f}from"./runner.js";import{planCommand as c}from"./rewrite.js";import{applyTomlStyleFilter as v}from"./toml-dsl.js";import{TokenSaveTracker as w}from"./tracking.js";const P=[{value:"summary",label:"summary",description:"Show total shell output savings"},{value:"history",label:"history",description:"Show recent shortened commands"},{value:"reload",label:"reload",description:"Reload project output-shortening rules"},{value:"plan",label:"plan",description:"Preview how a command will be shortened"}];function m(r){const n=r.content.filter(i=>i.type==="text");if(n.length!==0)return n.map(i=>i.text).join(`
|
|
2
|
+
`)}u(m,"getTextContent");function x(r){const n=r.input.command;return typeof n=="string"?n:void 0}u(x,"getCommand");function h(r){const n=r.details;return typeof n?.fullOutputPath=="string"?n.fullOutputPath:m(r)?.match(/Full output:\s+([^\]\n]+)/)?.[1]?.trim()}u(h,"recoveryPathFromDetails");function $(r){const n=new w(r.cwd);let i=[];p(r.cwd).then(o=>{i=o}),r.registerCommand("tokensave",{description:"Review shell output shortening. Usage: /tokensave [summary|history|reload|plan <cmd>]",getArgumentCompletions:u((o,a)=>{if(a&&a.tokenIndex>0)return null;const s=o.trim().toLowerCase(),t=P.filter(e=>e.value.startsWith(s));return t.length>0?t:null},"getArgumentCompletions"),async handler(o,a){const s=o.trim();if(s==="reload"){i=await p(r.cwd),a.ui.notify(`TokenSave loaded ${i.length} configured filter(s).`,"info");return}if(s.startsWith("plan ")){const t=c(s.slice(5));a.ui.notify(JSON.stringify(t,null,2),"info");return}if(s==="history"){a.ui.notify(n.formatHistory(),"info");return}a.ui.notify(n.formatSummary(),"info")}}),r.on("tool_call",o=>{if(o.toolName!=="bash")return;const a=typeof o.input.command=="string"?o.input.command:void 0;if(!(!a||c(a).mode==="passthrough"))return{input:{...o.input,command:a}}}),r.on("user_bash",async o=>{if(o.excludeFromContext||c(o.command).mode==="passthrough")return;const s=await k(o.command,{cwd:o.cwd});return{result:await R(o.command,s,r.cwd,i,n,Date.now())}}),r.on("tool_result",async o=>{if(o.toolName!=="bash")return;const a=x(o),s=m(o);if(!a||!s)return;const t=Date.now(),e=await f(a,s,r.cwd),l=g(a,s,i);if(l&&l.length<e.filteredText.length&&(e.filteredText=l,e.outputTokens=Math.ceil(l.length/4),e.savedTokens=Math.max(0,e.inputTokens-e.outputTokens),e.savingsPct=e.inputTokens>0?Math.round(e.savedTokens/e.inputTokens*100):0,e.shouldReplace=e.savedTokens>=32&&e.savingsPct>=12),n.add({command:a,category:e.plan.category,mode:e.plan.mode==="passthrough"?"passthrough":"filtered",inputTokens:e.inputTokens,outputTokens:e.outputTokens,savedTokens:e.savedTokens,savingsPct:e.savingsPct,elapsedMs:Date.now()-t,isError:o.isError,rawRecoveryPath:e.rawRecoveryPath??h(o)}),!e.shouldReplace)return;const d=e.rawRecoveryPath??h(o),T=["",`[TokenSave: ${e.inputTokens} -> ${e.outputTokens} estimated tokens, saved ${e.savedTokens} (${e.savingsPct}%), mode=${e.plan.mode}, category=${e.plan.category}]`,d?`[Raw recovery: ${d}]`:void 0].filter(Boolean).join(`
|
|
3
|
+
`);return{content:[{type:"text",text:`${e.filteredText}${T}`}],details:o.details}})}u($,"tokenSaveExtension");async function R(r,n,i,o,a,s){const t=await f(r,n.output,i),e=g(r,n.output,o);if(e&&e.length<t.filteredText.length&&(t.filteredText=e,t.outputTokens=Math.ceil(e.length/4),t.savedTokens=Math.max(0,t.inputTokens-t.outputTokens),t.savingsPct=t.inputTokens>0?Math.round(t.savedTokens/t.inputTokens*100):0,t.shouldReplace=t.savedTokens>=32&&t.savingsPct>=12),a.add({command:r,category:t.plan.category,mode:t.plan.mode==="passthrough"?"passthrough":"filtered",inputTokens:t.inputTokens,outputTokens:t.outputTokens,savedTokens:t.savedTokens,savingsPct:t.savingsPct,elapsedMs:Date.now()-s,isError:(n.exitCode??0)!==0,rawRecoveryPath:t.rawRecoveryPath??n.fullOutputPath}),!t.shouldReplace)return n;const l=["",`[TokenSave: ${t.inputTokens} -> ${t.outputTokens} estimated tokens, saved ${t.savedTokens} (${t.savingsPct}%), mode=${t.plan.mode}, category=${t.plan.category}]`,t.rawRecoveryPath?`[Raw recovery: ${t.rawRecoveryPath}]`:void 0].filter(Boolean).join(`
|
|
4
|
+
`);return{...n,output:`${t.filteredText}${l}`,truncated:n.truncated,fullOutputPath:t.rawRecoveryPath??n.fullOutputPath}}u(R,"applyToBashResult");function g(r,n,i){for(const o of i)try{if(!new RegExp(o.commandPattern).test(r))continue;return v(o.filter,n)}catch{continue}}u(g,"applyConfiguredFilter");export{$ as default};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [WHO]: splitShellSegments() quote-aware shell segment lexer
|
|
3
|
+
* [FROM]: No runtime dependencies
|
|
4
|
+
* [TO]: Consumed by token-save rewrite registry and tests
|
|
5
|
+
* [HERE]: extensions/builtin/token-save/lexer.ts - conservative command boundary parser
|
|
6
|
+
*/
|
|
7
|
+
export interface ShellSegment {
|
|
8
|
+
text: string;
|
|
9
|
+
operator: "" | "&&" | "||" | ";" | "|";
|
|
10
|
+
}
|
|
11
|
+
export declare function splitShellSegments(command: string): ShellSegment[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var c=Object.defineProperty;var u=(o,n)=>c(o,"name",{value:n,configurable:!0});function h(o){const n=[];let e="",r,f=!1;for(let i=0;i<o.length;i++){const t=o[i],s=o[i+1];if(f){e+=t,f=!1;continue}if(t==="\\"){e+=t,f=!0;continue}if(r){e+=t,t===r&&(r=void 0);continue}if(t==="'"||t==='"'||t==="`"){e+=t,r=t;continue}const l=`${t}${s??""}`;if(l==="&&"||l==="||"){n.push({text:e.trim(),operator:l}),e="",i++;continue}if(t===";"||t==="|"){n.push({text:e.trim(),operator:t}),e="";continue}e+=t}return e.trim()||n.length===0?n.push({text:e.trim(),operator:""}):n.length>0&&(n[n.length-1].operator=""),n.filter(i=>i.text||i.operator)}u(h,"splitShellSegments");export{h as splitShellSegments};
|