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,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [WHO]: parseStreamingJson
|
|
3
|
+
* [FROM]: Depends on partial-json
|
|
4
|
+
* [TO]: Consumed by core/lib/ai/src/index.ts
|
|
5
|
+
* [HERE]: core/lib/ai/src/utils/json-parse.ts -
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Attempts to parse potentially incomplete JSON during streaming.
|
|
9
|
+
* Always returns a valid object, even if the JSON is incomplete.
|
|
10
|
+
*
|
|
11
|
+
* @param partialJson The partial JSON string from streaming
|
|
12
|
+
* @returns Parsed object or empty object if parsing fails
|
|
13
|
+
*/
|
|
14
|
+
export declare function parseStreamingJson<T = any>(partialJson: string | undefined): T;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var u=Object.defineProperty;var e=(r,t)=>u(r,"name",{value:t,configurable:!0});import{parse as c}from"partial-json";function a(r){if(!r||r.trim()==="")return{};try{return JSON.parse(r)}catch{try{return c(r)??{}}catch{return{}}}}e(a,"parseStreamingJson");export{a as parseStreamingJson};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Anthropic OAuth flow (Claude Pro/Max)
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* [WHO]: anthropicOAuthProvider
|
|
6
|
+
* [FROM]: Depends on ./pkce.js
|
|
7
|
+
* [TO]: Consumed by core/lib/ai/src/index.ts
|
|
8
|
+
* [HERE]: core/lib/ai/src/utils/oauth/anthropic.ts -
|
|
9
|
+
*/
|
|
10
|
+
import type { OAuthCredentials, OAuthProviderInterface } from "./types.js";
|
|
11
|
+
/**
|
|
12
|
+
* Login with Anthropic OAuth (device code flow)
|
|
13
|
+
*
|
|
14
|
+
* @param onAuthUrl - Callback to handle the authorization URL (e.g., open browser)
|
|
15
|
+
* @param onPromptCode - Callback to prompt user for the authorization code
|
|
16
|
+
*/
|
|
17
|
+
export declare function loginAnthropic(onAuthUrl: (url: string) => void, onPromptCode: () => Promise<string>): Promise<OAuthCredentials>;
|
|
18
|
+
/**
|
|
19
|
+
* Refresh Anthropic OAuth token
|
|
20
|
+
*/
|
|
21
|
+
export declare function refreshAnthropicToken(refreshToken: string): Promise<OAuthCredentials>;
|
|
22
|
+
export declare const anthropicOAuthProvider: OAuthProviderInterface;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var g=Object.defineProperty;var r=(e,t)=>g(e,"name",{value:t,configurable:!0});import{generatePKCE as y}from"./pkce.js";const w=r(e=>atob(e),"decode"),c=w("OWQxYzI1MGEtZTYxYi00NGQ5LTg4ZWQtNTk0NGQxOTYyZjVl"),x="https://claude.ai/oauth/authorize",h="https://console.anthropic.com/v1/oauth/token",p="https://console.anthropic.com/oauth/code/callback",T="org:create_api_key user:profile user:inference";async function m(e,t){const{verifier:o,challenge:n}=await y(),d=new URLSearchParams({code:"true",client_id:c,response_type:"code",redirect_uri:p,scope:T,code_challenge:n,code_challenge_method:"S256",state:o}),_=`${x}?${d.toString()}`;e(_);const i=(await t()).split("#"),u=i[0],f=i[1],s=await fetch(h,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({grant_type:"authorization_code",client_id:c,code:u,state:f,redirect_uri:p,code_verifier:o})});if(!s.ok){const k=await s.text();throw new Error(`Token exchange failed: ${k}`)}const a=await s.json(),l=Date.now()+a.expires_in*1e3-300*1e3;return{refresh:a.refresh_token,access:a.access_token,expires:l}}r(m,"loginAnthropic");async function E(e){const t=await fetch(h,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({grant_type:"refresh_token",client_id:c,refresh_token:e})});if(!t.ok){const n=await t.text();throw new Error(`Anthropic token refresh failed: ${n}`)}const o=await t.json();return{refresh:o.refresh_token,access:o.access_token,expires:Date.now()+o.expires_in*1e3-300*1e3}}r(E,"refreshAnthropicToken");const C={id:"anthropic",name:"Anthropic (Claude Pro/Max)",async login(e){return m(t=>e.onAuth({url:t}),()=>e.onPrompt({message:"Paste the authorization code:"}))},async refreshToken(e){return E(e.refresh)},getApiKey(e){return e.access}};export{C as anthropicOAuthProvider,m as loginAnthropic,E as refreshAnthropicToken};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [WHO]: decodeOAuthCredentialSegment
|
|
3
|
+
* [FROM]: No dependencies
|
|
4
|
+
* [TO]: Consumed by core/lib/ai/src/index.ts
|
|
5
|
+
* [HERE]: core/lib/ai/src/utils/oauth/decode-credential.ts — build-time OAuth id/secret embedding
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Decode base64-embedded OAuth client id or secret at module load.
|
|
9
|
+
* Unreplaced placeholders (e.g. YOUR_CLIENT_ID_HERE) are not valid base64 and must never be passed to
|
|
10
|
+
* `atob` — Node throws InvalidCharacterError and crashes any CLI that imports the OAuth module (e.g. --help).
|
|
11
|
+
*/
|
|
12
|
+
export declare function decodeOAuthCredentialSegment(s: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var n=Object.defineProperty;var r=(e,t)=>n(e,"name",{value:t,configurable:!0});function u(e){const t=e.trim();if(t.length===0||/YOUR_|PLACEHOLDER|REPLACE_ME/i.test(t))return t;try{return atob(t)}catch{return t}}r(u,"decodeOAuthCredentialSegment");export{u as decodeOAuthCredentialSegment};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GitHub Copilot OAuth flow
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* [WHO]: normalizeDomain, getGitHubCopilotBaseUrl, githubCopilotOAuthProvider
|
|
6
|
+
* [FROM]: Depends on ../../models.js
|
|
7
|
+
* [TO]: Consumed by core/lib/ai/src/index.ts
|
|
8
|
+
* [HERE]: core/lib/ai/src/utils/oauth/github-copilot.ts -
|
|
9
|
+
*/
|
|
10
|
+
import type { OAuthCredentials, OAuthProviderInterface } from "./types.js";
|
|
11
|
+
export declare function normalizeDomain(input: string): string | null;
|
|
12
|
+
export declare function getGitHubCopilotBaseUrl(token?: string, enterpriseDomain?: string): string;
|
|
13
|
+
/**
|
|
14
|
+
* Refresh GitHub Copilot token
|
|
15
|
+
*/
|
|
16
|
+
export declare function refreshGitHubCopilotToken(refreshToken: string, enterpriseDomain?: string): Promise<OAuthCredentials>;
|
|
17
|
+
/**
|
|
18
|
+
* Login with GitHub Copilot OAuth (device code flow)
|
|
19
|
+
*
|
|
20
|
+
* @param options.onAuth - Callback with URL and optional instructions (user code)
|
|
21
|
+
* @param options.onPrompt - Callback to prompt user for input
|
|
22
|
+
* @param options.onProgress - Optional progress callback
|
|
23
|
+
* @param options.signal - Optional AbortSignal for cancellation
|
|
24
|
+
*/
|
|
25
|
+
export declare function loginGitHubCopilot(options: {
|
|
26
|
+
onAuth: (url: string, instructions?: string) => void;
|
|
27
|
+
onPrompt: (prompt: {
|
|
28
|
+
message: string;
|
|
29
|
+
placeholder?: string;
|
|
30
|
+
allowEmpty?: boolean;
|
|
31
|
+
}) => Promise<string>;
|
|
32
|
+
onProgress?: (message: string) => void;
|
|
33
|
+
signal?: AbortSignal;
|
|
34
|
+
}): Promise<OAuthCredentials>;
|
|
35
|
+
export declare const githubCopilotOAuthProvider: OAuthProviderInterface;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var b=Object.defineProperty;var s=(e,t)=>b(e,"name",{value:t,configurable:!0});import{getModels as v}from"../../models.js";const _=s(e=>atob(e),"decode"),h=_("SXYxLmI1MDdhMDhjODdlY2ZlOTg="),w={"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"};function m(e){const t=e.trim();if(!t)return null;try{return(t.includes("://")?new URL(t):new URL(`https://${t}`)).hostname}catch{return null}}s(m,"normalizeDomain");function d(e){return{deviceCodeUrl:`https://${e}/login/device/code`,accessTokenUrl:`https://${e}/login/oauth/access_token`,copilotTokenUrl:`https://api.${e}/copilot_internal/v2/token`}}s(d,"getUrls");function C(e){const t=e.match(/proxy-ep=([^;]+)/);return t?`https://${t[1].replace(/^proxy\./,"api.")}`:null}s(C,"getBaseUrlFromToken");function y(e,t){if(e){const o=C(e);if(o)return o}return t?`https://copilot-api.${t}`:"https://api.individual.githubcopilot.com"}s(y,"getGitHubCopilotBaseUrl");async function u(e,t){const o=await fetch(e,t);if(!o.ok){const r=await o.text();throw new Error(`${o.status} ${o.statusText}: ${r}`)}return o.json()}s(u,"fetchJson");async function U(e){const t=d(e),o=await u(t.deviceCodeUrl,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json","User-Agent":"GitHubCopilotChat/0.35.0"},body:JSON.stringify({client_id:h,scope:"read:user"})});if(!o||typeof o!="object")throw new Error("Invalid device code response");const r=o.device_code,n=o.user_code,i=o.verification_uri,a=o.interval,c=o.expires_in;if(typeof r!="string"||typeof n!="string"||typeof i!="string"||typeof a!="number"||typeof c!="number")throw new Error("Invalid device code response fields");return{device_code:r,user_code:n,verification_uri:i,interval:a,expires_in:c}}s(U,"startDeviceFlow");function f(e,t){return new Promise((o,r)=>{if(t?.aborted){r(new Error("Login cancelled"));return}const n=setTimeout(o,e);t?.addEventListener("abort",()=>{clearTimeout(n),r(new Error("Login cancelled"))},{once:!0})})}s(f,"abortableSleep");async function E(e,t,o,r,n){const i=d(e),a=Date.now()+r*1e3;let c=Math.max(1e3,Math.floor(o*1e3));for(;Date.now()<a;){if(n?.aborted)throw new Error("Login cancelled");const l=await u(i.accessTokenUrl,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json","User-Agent":"GitHubCopilotChat/0.35.0"},body:JSON.stringify({client_id:h,device_code:t,grant_type:"urn:ietf:params:oauth:grant-type:device_code"})});if(l&&typeof l=="object"&&typeof l.access_token=="string")return l.access_token;if(l&&typeof l=="object"&&typeof l.error=="string"){const p=l.error;if(p==="authorization_pending"){await f(c,n);continue}if(p==="slow_down"){c+=5e3,await f(c,n);continue}throw new Error(`Device flow failed: ${p}`)}await f(c,n)}throw new Error("Device flow timed out")}s(E,"pollForGitHubAccessToken");async function g(e,t){const r=d(t||"github.com"),n=await u(r.copilotTokenUrl,{headers:{Accept:"application/json",Authorization:`Bearer ${e}`,...w}});if(!n||typeof n!="object")throw new Error("Invalid Copilot token response");const i=n.token,a=n.expires_at;if(typeof i!="string"||typeof a!="number")throw new Error("Invalid Copilot token response fields");return{refresh:e,access:i,expires:a*1e3-300*1e3,enterpriseUrl:t}}s(g,"refreshGitHubCopilotToken");async function x(e,t,o){const n=`${y(e,o)}/models/${t}/policy`;try{return(await fetch(n,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`,...w,"openai-intent":"chat-policy","x-interaction-type":"chat-policy"},body:JSON.stringify({state:"enabled"})})).ok}catch{return!1}}s(x,"enableGitHubCopilotModel");async function T(e,t,o){const r=v("github-copilot");await Promise.all(r.map(async n=>{const i=await x(e,n.id,t);o?.(n.id,i)}))}s(T,"enableAllGitHubCopilotModels");async function A(e){const t=await e.onPrompt({message:"GitHub Enterprise URL/domain (blank for github.com)",placeholder:"company.ghe.com",allowEmpty:!0});if(e.signal?.aborted)throw new Error("Login cancelled");const o=t.trim(),r=m(t);if(o&&!r)throw new Error("Invalid GitHub Enterprise URL/domain");const n=r||"github.com",i=await U(n);e.onAuth(i.verification_uri,`Enter code: ${i.user_code}`);const a=await E(n,i.device_code,i.interval,i.expires_in,e.signal),c=await g(a,r??void 0);return e.onProgress?.("Enabling models..."),await T(c.access,r??void 0),c}s(A,"loginGitHubCopilot");const $={id:"github-copilot",name:"GitHub Copilot",async login(e){return A({onAuth:s((t,o)=>e.onAuth({url:t,instructions:o}),"onAuth"),onPrompt:e.onPrompt,onProgress:e.onProgress,signal:e.signal})},async refreshToken(e){const t=e;return g(t.refresh,t.enterpriseUrl)},getApiKey(e){return e.access},modifyModels(e,t){const o=t,r=o.enterpriseUrl?m(o.enterpriseUrl)??void 0:void 0,n=y(o.access,r);return e.map(i=>i.provider==="github-copilot"?{...i,baseUrl:n}:i)}};export{y as getGitHubCopilotBaseUrl,$ as githubCopilotOAuthProvider,A as loginGitHubCopilot,m as normalizeDomain,g as refreshGitHubCopilotToken};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Antigravity OAuth flow (Gemini 3, Claude, GPT-OSS via Google Cloud)
|
|
3
|
+
* Uses different OAuth credentials than google-gemini-cli for access to additional models.
|
|
4
|
+
*
|
|
5
|
+
* NOTE: This module uses Node.js http.createServer for the OAuth callback.
|
|
6
|
+
* It is only intended for CLI use, not browser environments.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* [WHO]: antigravityOAuthProvider
|
|
10
|
+
* [FROM]: Depends on ./pkce.js
|
|
11
|
+
* [TO]: Consumed by core/lib/ai/src/index.ts
|
|
12
|
+
* [HERE]: core/lib/ai/src/utils/oauth/google-antigravity.ts -
|
|
13
|
+
*/
|
|
14
|
+
import type { OAuthCredentials, OAuthProviderInterface } from "./types.js";
|
|
15
|
+
/**
|
|
16
|
+
* Refresh Antigravity token
|
|
17
|
+
*/
|
|
18
|
+
export declare function refreshAntigravityToken(refreshToken: string, projectId: string): Promise<OAuthCredentials>;
|
|
19
|
+
/**
|
|
20
|
+
* Login with Antigravity OAuth
|
|
21
|
+
*
|
|
22
|
+
* @param onAuth - Callback with URL and optional instructions
|
|
23
|
+
* @param onProgress - Optional progress callback
|
|
24
|
+
* @param onManualCodeInput - Optional promise that resolves with user-pasted redirect URL.
|
|
25
|
+
* Races with browser callback - whichever completes first wins.
|
|
26
|
+
*/
|
|
27
|
+
export declare function loginAntigravity(onAuth: (info: {
|
|
28
|
+
url: string;
|
|
29
|
+
instructions?: string;
|
|
30
|
+
}) => void, onProgress?: (message: string) => void, onManualCodeInput?: () => Promise<string>): Promise<OAuthCredentials>;
|
|
31
|
+
export declare const antigravityOAuthProvider: OAuthProviderInterface;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var T=Object.defineProperty;var l=(t,e)=>T(t,"name",{value:e,configurable:!0});import{decodeOAuthCredentialSegment as _}from"./decode-credential.js";import{generatePKCE as j}from"./pkce.js";let w=null,y=null;typeof process<"u"&&(process.versions?.node||process.versions?.bun)&&(y=import("node:http").then(t=>{w=t.createServer}));const E=_("YOUR_CLIENT_ID_HERE"),C=_("YOUR_CLIENT_SECRET_HERE"),S="http://localhost:51121/oauth-callback",R=["https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/userinfo.email","https://www.googleapis.com/auth/userinfo.profile","https://www.googleapis.com/auth/cclog","https://www.googleapis.com/auth/experimentsandconfigs"],O="https://accounts.google.com/o/oauth2/v2/auth",v="https://oauth2.googleapis.com/token",b="rising-fact-p41fc";async function U(){if(w||(y&&await y,w))return w;throw new Error("Antigravity OAuth is only available in Node.js environments")}l(U,"getNodeCreateServer");async function x(){const t=await U();return new Promise((e,n)=>{let r=null,h=!1;const i=t((o,c)=>{const p=new URL(o.url||"","http://localhost:51121");if(p.pathname==="/oauth-callback"){const u=p.searchParams.get("code"),d=p.searchParams.get("state"),m=p.searchParams.get("error");if(m){c.writeHead(400,{"Content-Type":"text/html"}),c.end(`<html><body><h1>Authentication Failed</h1><p>Error: ${m}</p><p>You can close this window.</p></body></html>`);return}u&&d?(c.writeHead(200,{"Content-Type":"text/html"}),c.end("<html><body><h1>Authentication Successful</h1><p>You can close this window and return to the terminal.</p></body></html>"),r={code:u,state:d}):(c.writeHead(400,{"Content-Type":"text/html"}),c.end("<html><body><h1>Authentication Failed</h1><p>Missing code or state parameter.</p></body></html>"))}else c.writeHead(404),c.end()});i.on("error",o=>{n(o)}),i.listen(51121,"127.0.0.1",()=>{e({server:i,cancelWait:l(()=>{h=!0},"cancelWait"),waitForCode:l(async()=>{const o=l(()=>new Promise(c=>setTimeout(c,100)),"sleep");for(;!r&&!h;)await o();return r},"waitForCode")})})})}l(x,"startCallbackServer");function k(t){const e=t.trim();if(!e)return{};try{const n=new URL(e);return{code:n.searchParams.get("code")??void 0,state:n.searchParams.get("state")??void 0}}catch{return{}}}l(k,"parseRedirectUrl");async function N(t,e){const n={Authorization:`Bearer ${t}`,"Content-Type":"application/json","User-Agent":"google-api-nodejs-client/9.15.1","X-Goog-Api-Client":"google-cloud-sdk vscode_cloudshelleditor/0.1","Client-Metadata":JSON.stringify({ideType:"IDE_UNSPECIFIED",platform:"PLATFORM_UNSPECIFIED",pluginType:"GEMINI"})},r=["https://cloudcode-pa.googleapis.com","https://daily-cloudcode-pa.sandbox.googleapis.com"];e?.("Checking for existing project...");for(const h of r)try{const i=await fetch(`${h}/v1internal:loadCodeAssist`,{method:"POST",headers:n,body:JSON.stringify({metadata:{ideType:"IDE_UNSPECIFIED",platform:"PLATFORM_UNSPECIFIED",pluginType:"GEMINI"}})});if(i.ok){const o=await i.json();if(typeof o.cloudaicompanionProject=="string"&&o.cloudaicompanionProject)return o.cloudaicompanionProject;if(o.cloudaicompanionProject&&typeof o.cloudaicompanionProject=="object"&&o.cloudaicompanionProject.id)return o.cloudaicompanionProject.id}}catch{}return e?.("Using default project..."),b}l(N,"discoverProject");async function F(t){try{const e=await fetch("https://www.googleapis.com/oauth2/v1/userinfo?alt=json",{headers:{Authorization:`Bearer ${t}`}});if(e.ok)return(await e.json()).email}catch{}}l(F,"getUserEmail");async function D(t,e){const n=await fetch(v,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({client_id:E,client_secret:C,refresh_token:t,grant_type:"refresh_token"})});if(!n.ok){const h=await n.text();throw new Error(`Antigravity token refresh failed: ${h}`)}const r=await n.json();return{refresh:r.refresh_token||t,access:r.access_token,expires:Date.now()+r.expires_in*1e3-300*1e3,projectId:e}}l(D,"refreshAntigravityToken");async function L(t,e,n){const{verifier:r,challenge:h}=await j();e?.("Starting local server for OAuth callback...");const i=await x();let o;try{const c=new URLSearchParams({client_id:E,response_type:"code",redirect_uri:S,scope:R.join(" "),code_challenge:h,code_challenge_method:"S256",state:r,access_type:"offline",prompt:"consent"}),p=`${O}?${c.toString()}`;if(t({url:p,instructions:"Complete the sign-in in your browser."}),e?.("Waiting for OAuth callback..."),n){let s,f;const A=n().then(a=>{s=a,i.cancelWait()}).catch(a=>{f=a instanceof Error?a:new Error(String(a)),i.cancelWait()}),g=await i.waitForCode();if(f)throw f;if(g?.code){if(g.state!==r)throw new Error("OAuth state mismatch - possible CSRF attack");o=g.code}else if(s){const a=k(s);if(a.state&&a.state!==r)throw new Error("OAuth state mismatch - possible CSRF attack");o=a.code}if(!o){if(await A,f)throw f;if(s){const a=k(s);if(a.state&&a.state!==r)throw new Error("OAuth state mismatch - possible CSRF attack");o=a.code}}}else{const s=await i.waitForCode();if(s?.code){if(s.state!==r)throw new Error("OAuth state mismatch - possible CSRF attack");o=s.code}}if(!o)throw new Error("No authorization code received");e?.("Exchanging authorization code for tokens...");const u=await fetch(v,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({client_id:E,client_secret:C,code:o,grant_type:"authorization_code",redirect_uri:S,code_verifier:r})});if(!u.ok){const s=await u.text();throw new Error(`Token exchange failed: ${s}`)}const d=await u.json();if(!d.refresh_token)throw new Error("No refresh token received. Please try again.");e?.("Getting user info...");const m=await F(d.access_token),P=await N(d.access_token,e),I=Date.now()+d.expires_in*1e3-300*1e3;return{refresh:d.refresh_token,access:d.access_token,expires:I,projectId:P,email:m}}finally{i.server.close()}}l(L,"loginAntigravity");const z={id:"google-antigravity",name:"Antigravity (Gemini 3, Claude, GPT-OSS)",usesCallbackServer:!0,async login(t){return L(t.onAuth,t.onProgress,t.onManualCodeInput)},async refreshToken(t){const e=t;if(!e.projectId)throw new Error("Antigravity credentials missing projectId");return D(e.refresh,e.projectId)},getApiKey(t){const e=t;return JSON.stringify({token:e.access,projectId:e.projectId})}};export{z as antigravityOAuthProvider,L as loginAntigravity,D as refreshAntigravityToken};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gemini CLI OAuth flow (Google Cloud Code Assist)
|
|
3
|
+
* Standard Gemini models only (gemini-2.0-flash, gemini-2.5-*)
|
|
4
|
+
*
|
|
5
|
+
* NOTE: This module uses Node.js http.createServer for the OAuth callback.
|
|
6
|
+
* It is only intended for CLI use, not browser environments.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* [WHO]: geminiCliOAuthProvider
|
|
10
|
+
* [FROM]: Depends on ./pkce.js
|
|
11
|
+
* [TO]: Consumed by core/lib/ai/src/index.ts
|
|
12
|
+
* [HERE]: core/lib/ai/src/utils/oauth/google-gemini-cli.ts -
|
|
13
|
+
*/
|
|
14
|
+
import type { OAuthCredentials, OAuthProviderInterface } from "./types.js";
|
|
15
|
+
/**
|
|
16
|
+
* Refresh Google Cloud Code Assist token
|
|
17
|
+
*/
|
|
18
|
+
export declare function refreshGoogleCloudToken(refreshToken: string, projectId: string): Promise<OAuthCredentials>;
|
|
19
|
+
/**
|
|
20
|
+
* Login with Gemini CLI (Google Cloud Code Assist) OAuth
|
|
21
|
+
*
|
|
22
|
+
* @param onAuth - Callback with URL and optional instructions
|
|
23
|
+
* @param onProgress - Optional progress callback
|
|
24
|
+
* @param onManualCodeInput - Optional promise that resolves with user-pasted redirect URL.
|
|
25
|
+
* Races with browser callback - whichever completes first wins.
|
|
26
|
+
*/
|
|
27
|
+
export declare function loginGeminiCli(onAuth: (info: {
|
|
28
|
+
url: string;
|
|
29
|
+
instructions?: string;
|
|
30
|
+
}) => void, onProgress?: (message: string) => void, onManualCodeInput?: () => Promise<string>): Promise<OAuthCredentials>;
|
|
31
|
+
export declare const geminiCliOAuthProvider: OAuthProviderInterface;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var L=Object.defineProperty;var c=(e,t)=>L(e,"name",{value:t,configurable:!0});import{decodeOAuthCredentialSegment as I}from"./decode-credential.js";import{generatePKCE as j}from"./pkce.js";let g=null,C=null;typeof process<"u"&&(process.versions?.node||process.versions?.bun)&&(C=import("node:http").then(e=>{g=e.createServer}));const O=I("YOUR_CLIENT_ID_HERE"),P=I("YOUR_CLIENT_SECRET_HERE"),S="http://localhost:8085/oauth2callback",D=["https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/userinfo.email","https://www.googleapis.com/auth/userinfo.profile"],U="https://accounts.google.com/o/oauth2/v2/auth",R="https://oauth2.googleapis.com/token",T="https://cloudcode-pa.googleapis.com";async function G(){if(g||(C&&await C,g))return g;throw new Error("Gemini CLI OAuth is only available in Node.js environments")}c(G,"getNodeCreateServer");async function b(){const e=await G();return new Promise((t,o)=>{let r=null,a=!1;const n=e((l,i)=>{const p=new URL(l.url||"","http://localhost:8085");if(p.pathname==="/oauth2callback"){const u=p.searchParams.get("code"),s=p.searchParams.get("state"),f=p.searchParams.get("error");if(f){i.writeHead(400,{"Content-Type":"text/html"}),i.end(`<html><body><h1>Authentication Failed</h1><p>Error: ${f}</p><p>You can close this window.</p></body></html>`);return}u&&s?(i.writeHead(200,{"Content-Type":"text/html"}),i.end("<html><body><h1>Authentication Successful</h1><p>You can close this window and return to the terminal.</p></body></html>"),r={code:u,state:s}):(i.writeHead(400,{"Content-Type":"text/html"}),i.end("<html><body><h1>Authentication Failed</h1><p>Missing code or state parameter.</p></body></html>"))}else i.writeHead(404),i.end()});n.on("error",l=>{o(l)}),n.listen(8085,"127.0.0.1",()=>{t({server:n,cancelWait:c(()=>{a=!0},"cancelWait"),waitForCode:c(async()=>{const l=c(()=>new Promise(i=>setTimeout(i,100)),"sleep");for(;!r&&!a;)await l();return r},"waitForCode")})})})}c(b,"startCallbackServer");function v(e){const t=e.trim();if(!t)return{};try{const o=new URL(t);return{code:o.searchParams.get("code")??void 0,state:o.searchParams.get("state")??void 0}}catch{return{}}}c(v,"parseRedirectUrl");const y="free-tier",k="legacy-tier",x="standard-tier";function N(e){return new Promise(t=>setTimeout(t,e))}c(N,"wait");function $(e){return!e||e.length===0?{id:k}:e.find(o=>o.isDefault)??{id:k}}c($,"getDefaultTier");function F(e){if(!e||typeof e!="object"||!("error"in e))return!1;const t=e.error;return!t?.details||!Array.isArray(t.details)?!1:t.details.some(o=>o.reason==="SECURITY_POLICY_VIOLATED")}c(F,"isVpcScAffectedUser");async function J(e,t,o){let r=0;for(;;){r>0&&(o?.(`Waiting for project provisioning (attempt ${r+1})...`),await N(5e3));const a=await fetch(`${T}/v1internal/${e}`,{method:"GET",headers:t});if(!a.ok)throw new Error(`Failed to poll operation: ${a.status} ${a.statusText}`);const n=await a.json();if(n.done)return n;r+=1}}c(J,"pollOperation");async function H(e,t){const o=process.env.GOOGLE_CLOUD_PROJECT||process.env.GOOGLE_CLOUD_PROJECT_ID,r={Authorization:`Bearer ${e}`,"Content-Type":"application/json","User-Agent":"google-api-nodejs-client/9.15.1","X-Goog-Api-Client":"gl-node/22.17.0"};t?.("Checking for existing Cloud Code Assist project...");const a=await fetch(`${T}/v1internal:loadCodeAssist`,{method:"POST",headers:r,body:JSON.stringify({cloudaicompanionProject:o,metadata:{ideType:"IDE_UNSPECIFIED",platform:"PLATFORM_UNSPECIFIED",pluginType:"GEMINI",duetProject:o}})});let n;if(a.ok)n=await a.json();else{let w;try{w=await a.clone().json()}catch{w=void 0}if(F(w))n={currentTier:{id:x}};else{const E=await a.text();throw new Error(`loadCodeAssist failed: ${a.status} ${a.statusText}: ${E}`)}}if(n.currentTier){if(n.cloudaicompanionProject)return n.cloudaicompanionProject;if(o)return o;throw new Error("This account requires setting the GOOGLE_CLOUD_PROJECT or GOOGLE_CLOUD_PROJECT_ID environment variable. See https://goo.gle/gemini-cli-auth-docs#workspace-gca")}const i=$(n.allowedTiers)?.id??y;if(i!==y&&!o)throw new Error("This account requires setting the GOOGLE_CLOUD_PROJECT or GOOGLE_CLOUD_PROJECT_ID environment variable. See https://goo.gle/gemini-cli-auth-docs#workspace-gca");t?.("Provisioning Cloud Code Assist project (this may take a moment)...");const p={tierId:i,metadata:{ideType:"IDE_UNSPECIFIED",platform:"PLATFORM_UNSPECIFIED",pluginType:"GEMINI"}};i!==y&&o&&(p.cloudaicompanionProject=o,p.metadata.duetProject=o);const u=await fetch(`${T}/v1internal:onboardUser`,{method:"POST",headers:r,body:JSON.stringify(p)});if(!u.ok){const w=await u.text();throw new Error(`onboardUser failed: ${u.status} ${u.statusText}: ${w}`)}let s=await u.json();!s.done&&s.name&&(s=await J(s.name,r,t));const f=s.response?.cloudaicompanionProject?.id;if(f)return f;if(o)return o;throw new Error("Could not discover or provision a Google Cloud project. Try setting the GOOGLE_CLOUD_PROJECT or GOOGLE_CLOUD_PROJECT_ID environment variable. See https://goo.gle/gemini-cli-auth-docs#workspace-gca")}c(H,"discoverProject");async function Y(e){try{const t=await fetch("https://www.googleapis.com/oauth2/v1/userinfo?alt=json",{headers:{Authorization:`Bearer ${e}`}});if(t.ok)return(await t.json()).email}catch{}}c(Y,"getUserEmail");async function z(e,t){const o=await fetch(R,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({client_id:O,client_secret:P,refresh_token:e,grant_type:"refresh_token"})});if(!o.ok){const a=await o.text();throw new Error(`Google Cloud token refresh failed: ${a}`)}const r=await o.json();return{refresh:r.refresh_token||e,access:r.access_token,expires:Date.now()+r.expires_in*1e3-300*1e3,projectId:t}}c(z,"refreshGoogleCloudToken");async function M(e,t,o){const{verifier:r,challenge:a}=await j();t?.("Starting local server for OAuth callback...");const n=await b();let l;try{const i=new URLSearchParams({client_id:O,response_type:"code",redirect_uri:S,scope:D.join(" "),code_challenge:a,code_challenge_method:"S256",state:r,access_type:"offline",prompt:"consent"}),p=`${U}?${i.toString()}`;if(e({url:p,instructions:"Complete the sign-in in your browser."}),t?.("Waiting for OAuth callback..."),o){let h,m;const A=o().then(d=>{h=d,n.cancelWait()}).catch(d=>{m=d instanceof Error?d:new Error(String(d)),n.cancelWait()}),_=await n.waitForCode();if(m)throw m;if(_?.code){if(_.state!==r)throw new Error("OAuth state mismatch - possible CSRF attack");l=_.code}else if(h){const d=v(h);if(d.state&&d.state!==r)throw new Error("OAuth state mismatch - possible CSRF attack");l=d.code}if(!l){if(await A,m)throw m;if(h){const d=v(h);if(d.state&&d.state!==r)throw new Error("OAuth state mismatch - possible CSRF attack");l=d.code}}}else{const h=await n.waitForCode();if(h?.code){if(h.state!==r)throw new Error("OAuth state mismatch - possible CSRF attack");l=h.code}}if(!l)throw new Error("No authorization code received");t?.("Exchanging authorization code for tokens...");const u=await fetch(R,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({client_id:O,client_secret:P,code:l,grant_type:"authorization_code",redirect_uri:S,code_verifier:r})});if(!u.ok){const h=await u.text();throw new Error(`Token exchange failed: ${h}`)}const s=await u.json();if(!s.refresh_token)throw new Error("No refresh token received. Please try again.");t?.("Getting user info...");const f=await Y(s.access_token),w=await H(s.access_token,t),E=Date.now()+s.expires_in*1e3-300*1e3;return{refresh:s.refresh_token,access:s.access_token,expires:E,projectId:w,email:f}}finally{n.server.close()}}c(M,"loginGeminiCli");const V={id:"google-gemini-cli",name:"Google Cloud Code Assist (Gemini CLI)",usesCallbackServer:!0,async login(e){return M(e.onAuth,e.onProgress,e.onManualCodeInput)},async refreshToken(e){const t=e;if(!t.projectId)throw new Error("Google Cloud credentials missing projectId");return z(t.refresh,t.projectId)},getApiKey(e){const t=e;return JSON.stringify({token:t.access,projectId:t.projectId})}};export{V as geminiCliOAuthProvider,M as loginGeminiCli,z as refreshGoogleCloudToken};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [WHO]: OAuth credential management - loginAnthropic, refreshAnthropicToken, loginGitHubCopilot, loginGoogleGeminiCli, loginOpenAICodex
|
|
3
|
+
* [FROM]: Depends on ./anthropic, ./github-copilot, ./google-antigravity, ./google-gemini-cli, ./openai-codex, ../http-proxy
|
|
4
|
+
* [TO]: Consumed by core/lib/ai/src/index.ts, AI providers
|
|
5
|
+
* [HERE]: core/lib/ai/src/utils/oauth/index.ts - OAuth credential management for AI providers
|
|
6
|
+
*
|
|
7
|
+
* Handles login, token refresh, and credential storage for:
|
|
8
|
+
* Anthropic, GitHub Copilot, Google Cloud Code Assist, Antigravity
|
|
9
|
+
*/
|
|
10
|
+
import "../http-proxy.js";
|
|
11
|
+
export { anthropicOAuthProvider, loginAnthropic, refreshAnthropicToken } from "./anthropic.js";
|
|
12
|
+
export { getGitHubCopilotBaseUrl, githubCopilotOAuthProvider, loginGitHubCopilot, normalizeDomain, refreshGitHubCopilotToken, } from "./github-copilot.js";
|
|
13
|
+
export { antigravityOAuthProvider, loginAntigravity, refreshAntigravityToken } from "./google-antigravity.js";
|
|
14
|
+
export { geminiCliOAuthProvider, loginGeminiCli, refreshGoogleCloudToken } from "./google-gemini-cli.js";
|
|
15
|
+
export { loginOpenAICodex, openaiCodexOAuthProvider, refreshOpenAICodexToken } from "./openai-codex.js";
|
|
16
|
+
export * from "./types.js";
|
|
17
|
+
import type { OAuthCredentials, OAuthProviderId, OAuthProviderInfo, OAuthProviderInterface } from "./types.js";
|
|
18
|
+
/**
|
|
19
|
+
* Get an OAuth provider by ID
|
|
20
|
+
*/
|
|
21
|
+
export declare function getOAuthProvider(id: OAuthProviderId): OAuthProviderInterface | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Register a custom OAuth provider
|
|
24
|
+
*/
|
|
25
|
+
export declare function registerOAuthProvider(provider: OAuthProviderInterface): void;
|
|
26
|
+
/**
|
|
27
|
+
* Unregister an OAuth provider.
|
|
28
|
+
*
|
|
29
|
+
* If the provider is built-in, restores the built-in implementation.
|
|
30
|
+
* Custom providers are removed completely.
|
|
31
|
+
*/
|
|
32
|
+
export declare function unregisterOAuthProvider(id: string): void;
|
|
33
|
+
/**
|
|
34
|
+
* Reset OAuth providers to built-ins.
|
|
35
|
+
*/
|
|
36
|
+
export declare function resetOAuthProviders(): void;
|
|
37
|
+
/**
|
|
38
|
+
* Get all registered OAuth providers
|
|
39
|
+
*/
|
|
40
|
+
export declare function getOAuthProviders(): OAuthProviderInterface[];
|
|
41
|
+
/**
|
|
42
|
+
* @deprecated Use getOAuthProviders() which returns OAuthProviderInterface[]
|
|
43
|
+
*/
|
|
44
|
+
export declare function getOAuthProviderInfoList(): OAuthProviderInfo[];
|
|
45
|
+
/**
|
|
46
|
+
* Refresh token for any OAuth provider.
|
|
47
|
+
* @deprecated Use getOAuthProvider(id).refreshToken() instead
|
|
48
|
+
*/
|
|
49
|
+
export declare function refreshOAuthToken(providerId: OAuthProviderId, credentials: OAuthCredentials): Promise<OAuthCredentials>;
|
|
50
|
+
/**
|
|
51
|
+
* Get API key for a provider from OAuth credentials.
|
|
52
|
+
* Automatically refreshes expired tokens.
|
|
53
|
+
*
|
|
54
|
+
* @returns API key string and updated credentials, or null if no credentials
|
|
55
|
+
* @throws Error if refresh fails
|
|
56
|
+
*/
|
|
57
|
+
export declare function getOAuthApiKey(providerId: OAuthProviderId, credentials: Record<string, OAuthCredentials>): Promise<{
|
|
58
|
+
newCredentials: OAuthCredentials;
|
|
59
|
+
apiKey: string;
|
|
60
|
+
} | null>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var p=Object.defineProperty;var e=(r,o)=>p(r,"name",{value:o,configurable:!0});import"../http-proxy.js";import{anthropicOAuthProvider as _,loginAnthropic as D,refreshAnthropicToken as I}from"./anthropic.js";import{getGitHubCopilotBaseUrl as R,githubCopilotOAuthProvider as $,loginGitHubCopilot as B,normalizeDomain as L,refreshGitHubCopilotToken as z}from"./github-copilot.js";import{antigravityOAuthProvider as M,loginAntigravity as N,refreshAntigravityToken as S}from"./google-antigravity.js";import{geminiCliOAuthProvider as j,loginGeminiCli as q,refreshGoogleCloudToken as J}from"./google-gemini-cli.js";import{loginOpenAICodex as W,openaiCodexOAuthProvider as X,refreshOpenAICodexToken as Y}from"./openai-codex.js";export*from"./types.js";import{anthropicOAuthProvider as a}from"./anthropic.js";import{githubCopilotOAuthProvider as s}from"./github-copilot.js";import{antigravityOAuthProvider as A}from"./google-antigravity.js";import{geminiCliOAuthProvider as l}from"./google-gemini-cli.js";import{openaiCodexOAuthProvider as d}from"./openai-codex.js";const u=[a,s,l,A,d],i=new Map(u.map(r=>[r.id,r]));function h(r){return i.get(r)}e(h,"getOAuthProvider");function y(r){i.set(r.id,r)}e(y,"registerOAuthProvider");function k(r){const o=u.find(t=>t.id===r);if(o){i.set(r,o);return}i.delete(r)}e(k,"unregisterOAuthProvider");function T(){i.clear();for(const r of u)i.set(r.id,r)}e(T,"resetOAuthProviders");function m(){return Array.from(i.values())}e(m,"getOAuthProviders");function b(){return m().map(r=>({id:r.id,name:r.name,available:!0}))}e(b,"getOAuthProviderInfoList");async function G(r,o){const t=h(r);if(!t)throw new Error(`Unknown OAuth provider: ${r}`);return t.refreshToken(o)}e(G,"refreshOAuthToken");async function U(r,o){const t=h(r);if(!t)throw new Error(`Unknown OAuth provider: ${r}`);let n=o[r];if(!n)return null;if(Date.now()>=n.expires)try{n=await t.refreshToken(n)}catch{throw new Error(`Failed to refresh OAuth token for ${r}`)}const f=t.getApiKey(n);return{newCredentials:n,apiKey:f}}e(U,"getOAuthApiKey");export{_ as anthropicOAuthProvider,M as antigravityOAuthProvider,j as geminiCliOAuthProvider,R as getGitHubCopilotBaseUrl,U as getOAuthApiKey,h as getOAuthProvider,b as getOAuthProviderInfoList,m as getOAuthProviders,$ as githubCopilotOAuthProvider,D as loginAnthropic,N as loginAntigravity,q as loginGeminiCli,B as loginGitHubCopilot,W as loginOpenAICodex,L as normalizeDomain,X as openaiCodexOAuthProvider,I as refreshAnthropicToken,S as refreshAntigravityToken,z as refreshGitHubCopilotToken,J as refreshGoogleCloudToken,G as refreshOAuthToken,Y as refreshOpenAICodexToken,y as registerOAuthProvider,T as resetOAuthProviders,k as unregisterOAuthProvider};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenAI Codex (ChatGPT OAuth) flow
|
|
3
|
+
*
|
|
4
|
+
* NOTE: This module uses Node.js crypto and http for the OAuth callback.
|
|
5
|
+
* It is only intended for CLI use, not browser environments.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* [WHO]: openaiCodexOAuthProvider
|
|
9
|
+
* [FROM]: Depends on ./pkce.js
|
|
10
|
+
* [TO]: Consumed by core/lib/ai/src/index.ts
|
|
11
|
+
* [HERE]: core/lib/ai/src/utils/oauth/openai-codex.ts -
|
|
12
|
+
*/
|
|
13
|
+
import type { OAuthCredentials, OAuthPrompt, OAuthProviderInterface } from "./types.js";
|
|
14
|
+
/**
|
|
15
|
+
* Login with OpenAI Codex OAuth
|
|
16
|
+
*
|
|
17
|
+
* @param options.onAuth - Called with URL and instructions when auth starts
|
|
18
|
+
* @param options.onPrompt - Called to prompt user for manual code paste (fallback if no onManualCodeInput)
|
|
19
|
+
* @param options.onProgress - Optional progress messages
|
|
20
|
+
* @param options.onManualCodeInput - Optional promise that resolves with user-pasted code.
|
|
21
|
+
* Races with browser callback - whichever completes first wins.
|
|
22
|
+
* Useful for showing paste input immediately alongside browser flow.
|
|
23
|
+
* @param options.originator - OAuth originator parameter (defaults to "catui")
|
|
24
|
+
*/
|
|
25
|
+
export declare function loginOpenAICodex(options: {
|
|
26
|
+
onAuth: (info: {
|
|
27
|
+
url: string;
|
|
28
|
+
instructions?: string;
|
|
29
|
+
}) => void;
|
|
30
|
+
onPrompt: (prompt: OAuthPrompt) => Promise<string>;
|
|
31
|
+
onProgress?: (message: string) => void;
|
|
32
|
+
onManualCodeInput?: () => Promise<string>;
|
|
33
|
+
originator?: string;
|
|
34
|
+
}): Promise<OAuthCredentials>;
|
|
35
|
+
/**
|
|
36
|
+
* Refresh OpenAI Codex OAuth token
|
|
37
|
+
*/
|
|
38
|
+
export declare function refreshOpenAICodexToken(refreshToken: string): Promise<OAuthCredentials>;
|
|
39
|
+
export declare const openaiCodexOAuthProvider: OAuthProviderInterface;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
var C=Object.defineProperty;var s=(e,t)=>C(e,"name",{value:t,configurable:!0});let h=null,f=null;typeof process<"u"&&(process.versions?.node||process.versions?.bun)&&(import("node:crypto").then(e=>{h=e.randomBytes}),import("node:http").then(e=>{f=e}));import{generatePKCE as P}from"./pkce.js";const p="app_EMoamEEZ73f0CkXaXp7hrann",k="https://auth.openai.com/oauth/authorize",y="https://auth.openai.com/oauth/token",_="http://localhost:1455/auth/callback",A="openid profile email offline_access",E="https://api.openai.com/auth",I=`<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
+
<title>Authentication successful</title>
|
|
7
|
+
</head>
|
|
8
|
+
<body>
|
|
9
|
+
<p>Authentication successful. Return to your terminal to continue.</p>
|
|
10
|
+
</body>
|
|
11
|
+
</html>`;function S(){if(!h)throw new Error("OpenAI Codex OAuth is only available in Node.js environments");return h(16).toString("hex")}s(S,"createState");function m(e){const t=e.trim();if(!t)return{};try{const o=new URL(t);return{code:o.searchParams.get("code")??void 0,state:o.searchParams.get("state")??void 0}}catch{}if(t.includes("#")){const[o,a]=t.split("#",2);return{code:o,state:a}}if(t.includes("code=")){const o=new URLSearchParams(t);return{code:o.get("code")??void 0,state:o.get("state")??void 0}}return{code:t}}s(m,"parseAuthorizationInput");function T(e){try{const t=e.split(".");if(t.length!==3)return null;const o=t[1]??"",a=atob(o);return JSON.parse(a)}catch{return null}}s(T,"decodeJwt");async function v(e,t,o=_){const a=await fetch(y,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:"authorization_code",client_id:p,code:e,code_verifier:t,redirect_uri:o})});if(!a.ok){const n=await a.text().catch(()=>"");return console.error("[openai-codex] code->token failed:",a.status,n),{type:"failed"}}const r=await a.json();return!r.access_token||!r.refresh_token||typeof r.expires_in!="number"?(console.error("[openai-codex] token response missing fields:",r),{type:"failed"}):{type:"success",access:r.access_token,refresh:r.refresh_token,expires:Date.now()+r.expires_in*1e3}}s(v,"exchangeAuthorizationCode");async function O(e){try{const t=await fetch(y,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:e,client_id:p})});if(!t.ok){const a=await t.text().catch(()=>"");return console.error("[openai-codex] Token refresh failed:",t.status,a),{type:"failed"}}const o=await t.json();return!o.access_token||!o.refresh_token||typeof o.expires_in!="number"?(console.error("[openai-codex] Token refresh response missing fields:",o),{type:"failed"}):{type:"success",access:o.access_token,refresh:o.refresh_token,expires:Date.now()+o.expires_in*1e3}}catch(t){return console.error("[openai-codex] Token refresh error:",t),{type:"failed"}}}s(O,"refreshAccessToken");async function R(e="catui"){const{verifier:t,challenge:o}=await P(),a=S(),r=new URL(k);return r.searchParams.set("response_type","code"),r.searchParams.set("client_id",p),r.searchParams.set("redirect_uri",_),r.searchParams.set("scope",A),r.searchParams.set("code_challenge",o),r.searchParams.set("code_challenge_method","S256"),r.searchParams.set("state",a),r.searchParams.set("id_token_add_organizations","true"),r.searchParams.set("codex_cli_simplified_flow","true"),r.searchParams.set("originator",e),{verifier:t,state:a,url:r.toString()}}s(R,"createAuthorizationFlow");function b(e){if(!f)throw new Error("OpenAI Codex OAuth is only available in Node.js environments");let t=null,o=!1;const a=f.createServer((r,n)=>{try{const c=new URL(r.url||"","http://localhost");if(c.pathname!=="/auth/callback"){n.statusCode=404,n.end("Not found");return}if(c.searchParams.get("state")!==e){n.statusCode=400,n.end("State mismatch");return}const l=c.searchParams.get("code");if(!l){n.statusCode=400,n.end("Missing authorization code");return}n.statusCode=200,n.setHeader("Content-Type","text/html; charset=utf-8"),n.end(I),t=l}catch{n.statusCode=500,n.end("Internal error")}});return new Promise(r=>{a.listen(1455,"127.0.0.1",()=>{r({close:s(()=>a.close(),"close"),cancelWait:s(()=>{o=!0},"cancelWait"),waitForCode:s(async()=>{const n=s(()=>new Promise(c=>setTimeout(c,100)),"sleep");for(let c=0;c<600;c+=1){if(t)return{code:t};if(o)return null;await n()}return null},"waitForCode")})}).on("error",n=>{console.error("[openai-codex] Failed to bind http://127.0.0.1:1455 (",n.code,") Falling back to manual paste."),r({close:s(()=>{try{a.close()}catch{}},"close"),cancelWait:s(()=>{},"cancelWait"),waitForCode:s(async()=>null,"waitForCode")})})})}s(b,"startLocalOAuthServer");function x(e){const a=T(e)?.[E]?.chatgpt_account_id;return typeof a=="string"&&a.length>0?a:null}s(x,"getAccountId");async function L(e){const{verifier:t,state:o,url:a}=await R(e.originator),r=await b(o);e.onAuth({url:a,instructions:"A browser window should open. Complete login to finish."});let n;try{if(e.onManualCodeInput){let u,d;const g=e.onManualCodeInput().then(i=>{u=i,r.cancelWait()}).catch(i=>{d=i instanceof Error?i:new Error(String(i)),r.cancelWait()}),w=await r.waitForCode();if(d)throw d;if(w?.code)n=w.code;else if(u){const i=m(u);if(i.state&&i.state!==o)throw new Error("State mismatch");n=i.code}if(!n){if(await g,d)throw d;if(u){const i=m(u);if(i.state&&i.state!==o)throw new Error("State mismatch");n=i.code}}}else{const u=await r.waitForCode();u?.code&&(n=u.code)}if(!n){const u=await e.onPrompt({message:"Paste the authorization code (or full redirect URL):"}),d=m(u);if(d.state&&d.state!==o)throw new Error("State mismatch");n=d.code}if(!n)throw new Error("Missing authorization code");const c=await v(n,t);if(c.type!=="success")throw new Error("Token exchange failed");const l=x(c.access);if(!l)throw new Error("Failed to extract accountId from token");return{access:c.access,refresh:c.refresh,expires:c.expires,accountId:l}}finally{r.close()}}s(L,"loginOpenAICodex");async function U(e){const t=await O(e);if(t.type!=="success")throw new Error("Failed to refresh OpenAI Codex token");const o=x(t.access);if(!o)throw new Error("Failed to extract accountId from token");return{access:t.access,refresh:t.refresh,expires:t.expires,accountId:o}}s(U,"refreshOpenAICodexToken");const M={id:"openai-codex",name:"ChatGPT Plus/Pro (Codex Subscription)",usesCallbackServer:!0,async login(e){return L({onAuth:e.onAuth,onPrompt:e.onPrompt,onProgress:e.onProgress,onManualCodeInput:e.onManualCodeInput})},async refreshToken(e){return U(e.refresh)},getApiKey(e){return e.access}};export{L as loginOpenAICodex,M as openaiCodexOAuthProvider,U as refreshOpenAICodexToken};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PKCE utilities using Web Crypto API.
|
|
3
|
+
* Works in both Node.js 20+ and browsers.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* [WHO]: Extension interface
|
|
7
|
+
* [FROM]: No external dependencies
|
|
8
|
+
* [TO]: Consumed by core/lib/ai/src/index.ts
|
|
9
|
+
* [HERE]: core/lib/ai/src/utils/oauth/pkce.ts -
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Generate PKCE code verifier and challenge.
|
|
13
|
+
* Uses Web Crypto API for cross-platform compatibility.
|
|
14
|
+
*/
|
|
15
|
+
export declare function generatePKCE(): Promise<{
|
|
16
|
+
verifier: string;
|
|
17
|
+
challenge: string;
|
|
18
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var i=Object.defineProperty;var r=(n,e)=>i(n,"name",{value:e,configurable:!0});function o(n){let e="";for(const t of n)e+=String.fromCharCode(t);return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}r(o,"base64urlEncode");async function f(){const n=new Uint8Array(32);crypto.getRandomValues(n);const e=o(n),c=new TextEncoder().encode(e),a=await crypto.subtle.digest("SHA-256",c),s=o(new Uint8Array(a));return{verifier:e,challenge:s}}r(f,"generatePKCE");export{f as generatePKCE};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [WHO]: OAuthLoginCallbacks, OAuthProviderInterface, OAuthProviderInfo
|
|
3
|
+
* [FROM]: No external dependencies
|
|
4
|
+
* [TO]: Consumed by core/lib/ai/src/index.ts
|
|
5
|
+
* [HERE]: core/lib/ai/src/utils/oauth/types.ts -
|
|
6
|
+
*/
|
|
7
|
+
import type { Api, Model } from "../../types.js";
|
|
8
|
+
export type OAuthCredentials = {
|
|
9
|
+
refresh: string;
|
|
10
|
+
access: string;
|
|
11
|
+
expires: number;
|
|
12
|
+
[key: string]: unknown;
|
|
13
|
+
};
|
|
14
|
+
export type OAuthProviderId = string;
|
|
15
|
+
/** @deprecated Use OAuthProviderId instead */
|
|
16
|
+
export type OAuthProvider = OAuthProviderId;
|
|
17
|
+
export type OAuthPrompt = {
|
|
18
|
+
message: string;
|
|
19
|
+
placeholder?: string;
|
|
20
|
+
allowEmpty?: boolean;
|
|
21
|
+
};
|
|
22
|
+
export type OAuthAuthInfo = {
|
|
23
|
+
url: string;
|
|
24
|
+
instructions?: string;
|
|
25
|
+
};
|
|
26
|
+
export interface OAuthLoginCallbacks {
|
|
27
|
+
onAuth: (info: OAuthAuthInfo) => void;
|
|
28
|
+
onPrompt: (prompt: OAuthPrompt) => Promise<string>;
|
|
29
|
+
onProgress?: (message: string) => void;
|
|
30
|
+
onManualCodeInput?: () => Promise<string>;
|
|
31
|
+
signal?: AbortSignal;
|
|
32
|
+
}
|
|
33
|
+
export interface OAuthProviderInterface {
|
|
34
|
+
readonly id: OAuthProviderId;
|
|
35
|
+
readonly name: string;
|
|
36
|
+
/** Run the login flow, return credentials to persist */
|
|
37
|
+
login(callbacks: OAuthLoginCallbacks): Promise<OAuthCredentials>;
|
|
38
|
+
/** Whether login uses a local callback server and supports manual code input. */
|
|
39
|
+
usesCallbackServer?: boolean;
|
|
40
|
+
/** Refresh expired credentials, return updated credentials to persist */
|
|
41
|
+
refreshToken(credentials: OAuthCredentials): Promise<OAuthCredentials>;
|
|
42
|
+
/** Convert credentials to API key string for the provider */
|
|
43
|
+
getApiKey(credentials: OAuthCredentials): string;
|
|
44
|
+
/** Optional: modify models for this provider (e.g., update baseUrl) */
|
|
45
|
+
modifyModels?(models: Model<Api>[], credentials: OAuthCredentials): Model<Api>[];
|
|
46
|
+
}
|
|
47
|
+
/** @deprecated Use OAuthProviderInterface instead */
|
|
48
|
+
export interface OAuthProviderInfo {
|
|
49
|
+
id: OAuthProviderId;
|
|
50
|
+
name: string;
|
|
51
|
+
available: boolean;
|
|
52
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [WHO]: isContextOverflow, getOverflowPatterns
|
|
3
|
+
* [FROM]: No external dependencies
|
|
4
|
+
* [TO]: Consumed by core/lib/ai/src/index.ts
|
|
5
|
+
* [HERE]: core/lib/ai/src/utils/overflow.ts -
|
|
6
|
+
*/
|
|
7
|
+
import type { AssistantMessage } from "../types.js";
|
|
8
|
+
/**
|
|
9
|
+
* Check if an assistant message represents a context overflow error.
|
|
10
|
+
*
|
|
11
|
+
* This handles two cases:
|
|
12
|
+
* 1. Error-based overflow: Most providers return stopReason "error" with a
|
|
13
|
+
* specific error message pattern.
|
|
14
|
+
* 2. Silent overflow: Some providers accept overflow requests and return
|
|
15
|
+
* successfully. For these, we check if usage.input exceeds the context window.
|
|
16
|
+
*
|
|
17
|
+
* ## Reliability by Provider
|
|
18
|
+
*
|
|
19
|
+
* **Reliable detection (returns error with detectable message):**
|
|
20
|
+
* - Anthropic: "prompt is too long: X tokens > Y maximum"
|
|
21
|
+
* - OpenAI (Completions & Responses): "exceeds the context window"
|
|
22
|
+
* - Google Gemini: "input token count exceeds the maximum"
|
|
23
|
+
* - xAI (Grok): "maximum prompt length is X but request contains Y"
|
|
24
|
+
* - Groq: "reduce the length of the messages"
|
|
25
|
+
* - Cerebras: 400/413 status code (no body)
|
|
26
|
+
* - Mistral: 400/413 status code (no body)
|
|
27
|
+
* - OpenRouter (all backends): "maximum context length is X tokens"
|
|
28
|
+
* - llama.cpp: "exceeds the available context size"
|
|
29
|
+
* - LM Studio: "greater than the context length"
|
|
30
|
+
* - Kimi For Coding: "exceeded model token limit: X (requested: Y)"
|
|
31
|
+
*
|
|
32
|
+
* **Unreliable detection:**
|
|
33
|
+
* - z.ai: Sometimes accepts overflow silently (detectable via usage.input > contextWindow),
|
|
34
|
+
* sometimes returns rate limit errors. Pass contextWindow param to detect silent overflow.
|
|
35
|
+
* - Ollama: Silently truncates input without error. Cannot be detected via this function.
|
|
36
|
+
* The response will have usage.input < expected, but we don't know the expected value.
|
|
37
|
+
*
|
|
38
|
+
* ## Custom Providers
|
|
39
|
+
*
|
|
40
|
+
* If you've added custom models via settings.json, this function may not detect
|
|
41
|
+
* overflow errors from those providers. To add support:
|
|
42
|
+
*
|
|
43
|
+
* 1. Send a request that exceeds the model's context window
|
|
44
|
+
* 2. Check the errorMessage in the response
|
|
45
|
+
* 3. Create a regex pattern that matches the error
|
|
46
|
+
* 4. The pattern should be added to OVERFLOW_PATTERNS in this file, or
|
|
47
|
+
* check the errorMessage yourself before calling this function
|
|
48
|
+
*
|
|
49
|
+
* @param message - The assistant message to check
|
|
50
|
+
* @param contextWindow - Optional context window size for detecting silent overflow (z.ai)
|
|
51
|
+
* @returns true if the message indicates a context overflow
|
|
52
|
+
*/
|
|
53
|
+
export declare function isContextOverflow(message: AssistantMessage, contextWindow?: number): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Get the overflow patterns for testing purposes.
|
|
56
|
+
*/
|
|
57
|
+
export declare function getOverflowPatterns(): RegExp[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var r=Object.defineProperty;var o=(e,t)=>r(e,"name",{value:t,configurable:!0});const n=[/prompt is too long/i,/input is too long for requested model/i,/exceeds the context window/i,/input token count.*exceeds the maximum/i,/maximum prompt length is \d+/i,/reduce the length of the messages/i,/maximum context length is \d+ tokens/i,/exceeds the limit of \d+/i,/exceeds the available context size/i,/greater than the context length/i,/context window exceeds limit/i,/exceeded model token limit/i,/context[_ ]length[_ ]exceeded/i,/too many tokens/i,/token limit exceeded/i];function u(e,t){return!!(e.stopReason==="error"&&e.errorMessage&&(n.some(i=>i.test(e.errorMessage))||/^4(00|13)\s*(status code)?\s*\(no body\)/i.test(e.errorMessage))||t&&e.stopReason==="stop"&&e.usage.input+e.usage.cacheRead>t)}o(u,"isContextOverflow");function c(){return[...n]}o(c,"getOverflowPatterns");export{c as getOverflowPatterns,u as isContextOverflow};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [WHO]: sanitizeSurrogates function - removes unpaired Unicode surrogate characters
|
|
3
|
+
* [FROM]: No external dependencies
|
|
4
|
+
* [TO]: Consumed by AI providers for JSON-safe text
|
|
5
|
+
* [HERE]: core/lib/ai/src/utils/sanitize-unicode.ts - Unicode sanitization utility
|
|
6
|
+
*
|
|
7
|
+
* Unpaired surrogates cause JSON serialization errors in many API providers.
|
|
8
|
+
* Valid emoji with properly paired surrogates are preserved.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* [WHO]: sanitizeSurrogates
|
|
12
|
+
* [FROM]: No external dependencies
|
|
13
|
+
* [TO]: Consumed by core/lib/ai/src/index.ts
|
|
14
|
+
* [HERE]: core/lib/ai/src/utils/sanitize-unicode.ts -
|
|
15
|
+
*/
|
|
16
|
+
export declare function sanitizeSurrogates(text: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=Object.defineProperty;var F=(u,D)=>e(u,"name",{value:D,configurable:!0});function t(u){return u.replace(/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g,"")}F(t,"sanitizeSurrogates");export{t as sanitizeSurrogates};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [WHO]: StringEnum
|
|
3
|
+
* [FROM]: Depends on @sinclair/typebox
|
|
4
|
+
* [TO]: Consumed by core/lib/ai/src/index.ts
|
|
5
|
+
* [HERE]: core/lib/ai/src/utils/typebox-helpers.ts -
|
|
6
|
+
*/
|
|
7
|
+
import { type TUnsafe } from "@sinclair/typebox";
|
|
8
|
+
/**
|
|
9
|
+
* Creates a string enum schema compatible with Google's API and other providers
|
|
10
|
+
* that don't support anyOf/const patterns.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* const OperationSchema = StringEnum(["add", "subtract", "multiply", "divide"], {
|
|
14
|
+
* description: "The operation to perform"
|
|
15
|
+
* });
|
|
16
|
+
*
|
|
17
|
+
* type Operation = Static<typeof OperationSchema>; // "add" | "subtract" | "multiply" | "divide"
|
|
18
|
+
*/
|
|
19
|
+
export declare function StringEnum<T extends readonly string[]>(values: T, options?: {
|
|
20
|
+
description?: string;
|
|
21
|
+
default?: T[number];
|
|
22
|
+
}): TUnsafe<T[number]>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var n=Object.defineProperty;var t=(r,e)=>n(r,"name",{value:e,configurable:!0});import{Type as i}from"@sinclair/typebox";function f(r,e){return i.Unsafe({type:"string",enum:[...r],...e?.description&&{description:e.description},...e?.default&&{default:e.default}})}t(f,"StringEnum");export{f as StringEnum};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [WHO]: validateToolCall, validateToolArguments
|
|
3
|
+
* [FROM]: Depends on ajv, ajv-formats
|
|
4
|
+
* [TO]: Consumed by core/lib/ai/src/index.ts
|
|
5
|
+
* [HERE]: core/lib/ai/src/utils/validation.ts -
|
|
6
|
+
*/
|
|
7
|
+
import type { Tool, ToolCall } from "../types.js";
|
|
8
|
+
/**
|
|
9
|
+
* Finds a tool by name and validates the tool call arguments against its TypeBox schema
|
|
10
|
+
* @param tools Array of tool definitions
|
|
11
|
+
* @param toolCall The tool call from the LLM
|
|
12
|
+
* @returns The validated arguments
|
|
13
|
+
* @throws Error if tool is not found or validation fails
|
|
14
|
+
*/
|
|
15
|
+
export declare function validateToolCall(tools: Tool[], toolCall: ToolCall): any;
|
|
16
|
+
/**
|
|
17
|
+
* Validates tool call arguments against the tool's TypeBox schema
|
|
18
|
+
* @param tool The tool definition with TypeBox schema
|
|
19
|
+
* @param toolCall The tool call from the LLM
|
|
20
|
+
* @returns The validated (and potentially coerced) arguments
|
|
21
|
+
* @throws Error with formatted message if validation fails
|
|
22
|
+
*/
|
|
23
|
+
export declare function validateToolArguments(tool: Tool, toolCall: ToolCall): any;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
var l=Object.defineProperty;var a=(n,r)=>l(n,"name",{value:r,configurable:!0});import i from"ajv";import u from"ajv-formats";const f=i.default||i,g=u.default||u,p=globalThis,c=p.chrome?.runtime?.id!==void 0;let s=null;if(!c)try{s=new f({allErrors:!0,strict:!1,coerceTypes:!0}),g(s)}catch{console.warn("AJV validation disabled due to CSP restrictions")}function T(n,r){const e=n.find(t=>t.name===r.name);if(!e)throw new Error(`Tool "${r.name}" not found`);return h(e,r)}a(T,"validateToolCall");function h(n,r){if(!s||c)return r.arguments;const e=s.compile(n.parameters),t=structuredClone(r.arguments);if(e(t))return t;const d=e.errors?.map(o=>` - ${o.instancePath?o.instancePath.substring(1):o.params.missingProperty||"root"}: ${o.message}`).join(`
|
|
2
|
+
`)||"Unknown validation error",m=`Validation failed for tool "${r.name}":
|
|
3
|
+
${d}
|
|
4
|
+
|
|
5
|
+
Received arguments:
|
|
6
|
+
${JSON.stringify(r.arguments,null,2)}`;throw new Error(m)}a(h,"validateToolArguments");export{h as validateToolArguments,T as validateToolCall};
|