@vascend/talos 0.1.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/README.md +202 -0
- package/dist/backend/asset-events.d.ts +31 -0
- package/dist/backend/asset-events.js +149 -0
- package/dist/backend/assets.d.ts +31 -0
- package/dist/backend/assets.js +210 -0
- package/dist/backend/auth.d.ts +18 -0
- package/dist/backend/auth.js +59 -0
- package/dist/backend/config.d.ts +14 -0
- package/dist/backend/config.js +41 -0
- package/dist/backend/conversations.d.ts +21 -0
- package/dist/backend/conversations.js +141 -0
- package/dist/backend/crypto.d.ts +9 -0
- package/dist/backend/crypto.js +68 -0
- package/dist/backend/engine.d.ts +13 -0
- package/dist/backend/engine.js +78 -0
- package/dist/backend/http.d.ts +25 -0
- package/dist/backend/http.js +112 -0
- package/dist/backend/index.d.ts +1 -0
- package/dist/backend/index.js +24 -0
- package/dist/backend/routes.d.ts +14 -0
- package/dist/backend/routes.js +169 -0
- package/dist/backend/sdk.d.ts +12 -0
- package/dist/backend/sdk.js +11 -0
- package/dist/backend/server.d.ts +12 -0
- package/dist/backend/server.js +91 -0
- package/dist/backend/temp-image-store.d.ts +46 -0
- package/dist/backend/temp-image-store.js +197 -0
- package/dist/backend/types.d.ts +103 -0
- package/dist/backend/types.js +29 -0
- package/dist/backend/users.d.ts +13 -0
- package/dist/backend/users.js +76 -0
- package/dist/backend/ws-handler.d.ts +14 -0
- package/dist/backend/ws-handler.js +72 -0
- package/dist/backend/ws.d.ts +19 -0
- package/dist/backend/ws.js +146 -0
- package/dist/core/agent.d.ts +56 -0
- package/dist/core/agent.js +1783 -0
- package/dist/core/background.d.ts +45 -0
- package/dist/core/background.js +140 -0
- package/dist/core/bootstrap.d.ts +45 -0
- package/dist/core/bootstrap.js +294 -0
- package/dist/core/cli-args.d.ts +41 -0
- package/dist/core/cli-args.js +282 -0
- package/dist/core/collapsible-output.d.ts +38 -0
- package/dist/core/collapsible-output.js +143 -0
- package/dist/core/compaction-checkpoint.d.ts +9 -0
- package/dist/core/compaction-checkpoint.js +58 -0
- package/dist/core/compaction.d.ts +42 -0
- package/dist/core/compaction.js +270 -0
- package/dist/core/config.d.ts +49 -0
- package/dist/core/config.js +417 -0
- package/dist/core/context-ledger.d.ts +99 -0
- package/dist/core/context-ledger.js +222 -0
- package/dist/core/context-policy.d.ts +17 -0
- package/dist/core/context-policy.js +81 -0
- package/dist/core/continuation-review.d.ts +23 -0
- package/dist/core/continuation-review.js +64 -0
- package/dist/core/crash-report.d.ts +3 -0
- package/dist/core/crash-report.js +27 -0
- package/dist/core/credentials.d.ts +11 -0
- package/dist/core/credentials.js +183 -0
- package/dist/core/doctor.d.ts +24 -0
- package/dist/core/doctor.js +125 -0
- package/dist/core/effort.d.ts +5 -0
- package/dist/core/effort.js +42 -0
- package/dist/core/env-paths.d.ts +3 -0
- package/dist/core/env-paths.js +38 -0
- package/dist/core/execution-guidance.d.ts +9 -0
- package/dist/core/execution-guidance.js +73 -0
- package/dist/core/execution-target.d.ts +41 -0
- package/dist/core/execution-target.js +69 -0
- package/dist/core/file-coordination.d.ts +66 -0
- package/dist/core/file-coordination.js +176 -0
- package/dist/core/file-lease-store.d.ts +14 -0
- package/dist/core/file-lease-store.js +89 -0
- package/dist/core/image-limits.d.ts +26 -0
- package/dist/core/image-limits.js +205 -0
- package/dist/core/interruptible-completion.d.ts +3 -0
- package/dist/core/interruptible-completion.js +42 -0
- package/dist/core/kingdoms-mode-state.d.ts +24 -0
- package/dist/core/kingdoms-mode-state.js +139 -0
- package/dist/core/licenza.d.ts +38 -0
- package/dist/core/licenza.js +125 -0
- package/dist/core/model-limits.d.ts +2 -0
- package/dist/core/model-limits.js +36 -0
- package/dist/core/output-lifecycle.d.ts +44 -0
- package/dist/core/output-lifecycle.js +190 -0
- package/dist/core/package-update.d.ts +15 -0
- package/dist/core/package-update.js +121 -0
- package/dist/core/permission-queue.d.ts +2 -0
- package/dist/core/permission-queue.js +20 -0
- package/dist/core/prompt-attachment.d.ts +21 -0
- package/dist/core/prompt-attachment.js +123 -0
- package/dist/core/request-plan.d.ts +16 -0
- package/dist/core/request-plan.js +36 -0
- package/dist/core/run-timing.d.ts +17 -0
- package/dist/core/run-timing.js +123 -0
- package/dist/core/self-update.d.ts +17 -0
- package/dist/core/self-update.js +54 -0
- package/dist/core/session-refs.d.ts +27 -0
- package/dist/core/session-refs.js +126 -0
- package/dist/core/session-storage.d.ts +4 -0
- package/dist/core/session-storage.js +48 -0
- package/dist/core/session-title.d.ts +1 -0
- package/dist/core/session-title.js +21 -0
- package/dist/core/session-usage.d.ts +17 -0
- package/dist/core/session-usage.js +74 -0
- package/dist/core/session.d.ts +58 -0
- package/dist/core/session.js +296 -0
- package/dist/core/settings.d.ts +17 -0
- package/dist/core/settings.js +107 -0
- package/dist/core/storage-retention.d.ts +21 -0
- package/dist/core/storage-retention.js +227 -0
- package/dist/core/text-sanitize.d.ts +1 -0
- package/dist/core/text-sanitize.js +35 -0
- package/dist/core/tool-artifacts.d.ts +6 -0
- package/dist/core/tool-artifacts.js +51 -0
- package/dist/core/tool-compress.d.ts +8 -0
- package/dist/core/tool-compress.js +111 -0
- package/dist/core/tool-executor.d.ts +16 -0
- package/dist/core/tool-executor.js +97 -0
- package/dist/core/tool-result-index.d.ts +52 -0
- package/dist/core/tool-result-index.js +327 -0
- package/dist/core/tool-result-store.d.ts +38 -0
- package/dist/core/tool-result-store.js +190 -0
- package/dist/core/tool-scheduler.d.ts +16 -0
- package/dist/core/tool-scheduler.js +35 -0
- package/dist/core/trust.d.ts +21 -0
- package/dist/core/trust.js +95 -0
- package/dist/core/types.d.ts +402 -0
- package/dist/core/types.js +1 -0
- package/dist/core/update-check.d.ts +26 -0
- package/dist/core/update-check.js +89 -0
- package/dist/core/update-process.d.ts +10 -0
- package/dist/core/update-process.js +31 -0
- package/dist/core/user-inbox.d.ts +23 -0
- package/dist/core/user-inbox.js +56 -0
- package/dist/core/user-input.d.ts +10 -0
- package/dist/core/user-input.js +35 -0
- package/dist/core/version.d.ts +1 -0
- package/dist/core/version.js +10 -0
- package/dist/core/vibe-modes.d.ts +38 -0
- package/dist/core/vibe-modes.js +383 -0
- package/dist/core/workspace-roots.d.ts +13 -0
- package/dist/core/workspace-roots.js +91 -0
- package/dist/core/workspace-sessions.d.ts +51 -0
- package/dist/core/workspace-sessions.js +243 -0
- package/dist/cowork/client.d.ts +29 -0
- package/dist/cowork/client.js +49 -0
- package/dist/cowork/engine-bridge.d.ts +22 -0
- package/dist/cowork/engine-bridge.js +98 -0
- package/dist/cowork/index.d.ts +11 -0
- package/dist/cowork/index.js +16 -0
- package/dist/cowork/ipc.d.ts +97 -0
- package/dist/cowork/ipc.js +96 -0
- package/dist/cowork/manager.d.ts +66 -0
- package/dist/cowork/manager.js +325 -0
- package/dist/cowork/store.d.ts +23 -0
- package/dist/cowork/store.js +182 -0
- package/dist/cowork/sync.d.ts +20 -0
- package/dist/cowork/sync.js +164 -0
- package/dist/cowork/types.d.ts +78 -0
- package/dist/cowork/types.js +21 -0
- package/dist/extensions/ext-tools.d.ts +3 -0
- package/dist/extensions/ext-tools.js +73 -0
- package/dist/extensions/loader.d.ts +91 -0
- package/dist/extensions/loader.js +474 -0
- package/dist/extensions/settings.d.ts +20 -0
- package/dist/extensions/settings.js +86 -0
- package/dist/extensions/types.d.ts +219 -0
- package/dist/extensions/types.js +1 -0
- package/dist/horizon/async-queue.d.ts +9 -0
- package/dist/horizon/async-queue.js +46 -0
- package/dist/horizon/engine.d.ts +85 -0
- package/dist/horizon/engine.js +603 -0
- package/dist/horizon/index.d.ts +4 -0
- package/dist/horizon/index.js +2 -0
- package/dist/horizon/main-team.d.ts +163 -0
- package/dist/horizon/main-team.js +774 -0
- package/dist/horizon/types.d.ts +233 -0
- package/dist/horizon/types.js +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +233 -0
- package/dist/mcp/protocol.d.ts +81 -0
- package/dist/mcp/protocol.js +122 -0
- package/dist/package.json +1 -0
- package/dist/packages/packages.d.ts +12 -0
- package/dist/packages/packages.js +323 -0
- package/dist/prompts/templates.d.ts +13 -0
- package/dist/prompts/templates.js +139 -0
- package/dist/providers/anthropic-oauth.d.ts +13 -0
- package/dist/providers/anthropic-oauth.js +124 -0
- package/dist/providers/anthropic.d.ts +27 -0
- package/dist/providers/anthropic.js +526 -0
- package/dist/providers/catalog.d.ts +15 -0
- package/dist/providers/catalog.js +166 -0
- package/dist/providers/effort.d.ts +12 -0
- package/dist/providers/effort.js +102 -0
- package/dist/providers/model-catalog.d.ts +43 -0
- package/dist/providers/model-catalog.js +70 -0
- package/dist/providers/model-effort.d.ts +5 -0
- package/dist/providers/model-effort.js +43 -0
- package/dist/providers/model-registry.d.ts +39 -0
- package/dist/providers/model-registry.js +142 -0
- package/dist/providers/models-dev.d.ts +9 -0
- package/dist/providers/models-dev.js +97 -0
- package/dist/providers/oauth-callback-server.d.ts +28 -0
- package/dist/providers/oauth-callback-server.js +184 -0
- package/dist/providers/oauth-orchestrator.d.ts +58 -0
- package/dist/providers/oauth-orchestrator.js +159 -0
- package/dist/providers/oauth-store.d.ts +12 -0
- package/dist/providers/oauth-store.js +139 -0
- package/dist/providers/open-browser.d.ts +20 -0
- package/dist/providers/open-browser.js +92 -0
- package/dist/providers/openai-compat.d.ts +14 -0
- package/dist/providers/openai-compat.js +523 -0
- package/dist/providers/openai-oauth.d.ts +15 -0
- package/dist/providers/openai-oauth.js +382 -0
- package/dist/providers/openrouter-auth.d.ts +73 -0
- package/dist/providers/openrouter-auth.js +321 -0
- package/dist/providers/openrouter-manual-fallback.d.ts +25 -0
- package/dist/providers/openrouter-manual-fallback.js +161 -0
- package/dist/providers/openrouter.d.ts +15 -0
- package/dist/providers/openrouter.js +107 -0
- package/dist/providers/plan-limits.d.ts +6 -0
- package/dist/providers/plan-limits.js +175 -0
- package/dist/providers/provider-reset.d.ts +4 -0
- package/dist/providers/provider-reset.js +83 -0
- package/dist/providers/quota-limits.d.ts +4 -0
- package/dist/providers/quota-limits.js +33 -0
- package/dist/providers/registry.d.ts +33 -0
- package/dist/providers/registry.js +213 -0
- package/dist/providers/retry.d.ts +37 -0
- package/dist/providers/retry.js +347 -0
- package/dist/rpc/server.d.ts +23 -0
- package/dist/rpc/server.js +222 -0
- package/dist/sdk.d.ts +67 -0
- package/dist/sdk.js +64 -0
- package/dist/skills/skills.d.ts +17 -0
- package/dist/skills/skills.js +155 -0
- package/dist/text-sanitize.js +28 -0
- package/dist/tools/ask-user.d.ts +2 -0
- package/dist/tools/ask-user.js +60 -0
- package/dist/tools/builtin.d.ts +48 -0
- package/dist/tools/builtin.js +2494 -0
- package/dist/tools/capabilities.d.ts +5 -0
- package/dist/tools/capabilities.js +55 -0
- package/dist/tools/computer-capture.d.ts +2 -0
- package/dist/tools/computer-capture.js +91 -0
- package/dist/tools/computer-posix.d.ts +5 -0
- package/dist/tools/computer-posix.js +136 -0
- package/dist/tools/computer-use.d.ts +14 -0
- package/dist/tools/computer-use.js +108 -0
- package/dist/tools/discovery.d.ts +12 -0
- package/dist/tools/discovery.js +205 -0
- package/dist/tools/execute.d.ts +2 -0
- package/dist/tools/execute.js +73 -0
- package/dist/tools/normalize-input.d.ts +17 -0
- package/dist/tools/normalize-input.js +174 -0
- package/dist/tools/output-artifact.d.ts +3 -0
- package/dist/tools/output-artifact.js +80 -0
- package/dist/tools/pagination.d.ts +15 -0
- package/dist/tools/pagination.js +93 -0
- package/dist/tools/plan-status.d.ts +2 -0
- package/dist/tools/plan-status.js +109 -0
- package/dist/tools/program-input.d.ts +3 -0
- package/dist/tools/program-input.js +19 -0
- package/dist/tools/program.d.ts +3 -0
- package/dist/tools/program.js +567 -0
- package/dist/tools/protocol-catalog.d.ts +12 -0
- package/dist/tools/protocol-catalog.js +46 -0
- package/dist/tools/ramification-tools.d.ts +12 -0
- package/dist/tools/ramification-tools.js +528 -0
- package/dist/tools/regex-compat.d.ts +9 -0
- package/dist/tools/regex-compat.js +96 -0
- package/dist/tools/registry.d.ts +51 -0
- package/dist/tools/registry.js +185 -0
- package/dist/tools/resolve.d.ts +2 -0
- package/dist/tools/resolve.js +107 -0
- package/dist/tools/shell-env.d.ts +2 -0
- package/dist/tools/shell-env.js +7 -0
- package/dist/tools/team-input.d.ts +3 -0
- package/dist/tools/team-input.js +129 -0
- package/dist/tools/team-tools.d.ts +7 -0
- package/dist/tools/team-tools.js +348 -0
- package/dist/tools/workspace-sessions.d.ts +2 -0
- package/dist/tools/workspace-sessions.js +35 -0
- package/dist/tui/account-entry.d.ts +1 -0
- package/dist/tui/account-entry.js +93 -0
- package/dist/tui/attachment-highlight.d.ts +1 -0
- package/dist/tui/attachment-highlight.js +24 -0
- package/dist/tui/attachment-refs.d.ts +2 -0
- package/dist/tui/attachment-refs.js +3 -0
- package/dist/tui/bottom-input.d.ts +219 -0
- package/dist/tui/bottom-input.js +1958 -0
- package/dist/tui/branding.d.ts +107 -0
- package/dist/tui/branding.js +750 -0
- package/dist/tui/clipboard-image.d.ts +10 -0
- package/dist/tui/clipboard-image.js +163 -0
- package/dist/tui/clipboard-text.d.ts +9 -0
- package/dist/tui/clipboard-text.js +51 -0
- package/dist/tui/clipboard-windows.d.ts +8 -0
- package/dist/tui/clipboard-windows.js +84 -0
- package/dist/tui/collapsible-command.d.ts +15 -0
- package/dist/tui/collapsible-command.js +48 -0
- package/dist/tui/command-feedback.d.ts +10 -0
- package/dist/tui/command-feedback.js +46 -0
- package/dist/tui/command-output-registry.d.ts +28 -0
- package/dist/tui/command-output-registry.js +103 -0
- package/dist/tui/command-transcript.d.ts +12 -0
- package/dist/tui/command-transcript.js +90 -0
- package/dist/tui/commands.d.ts +20 -0
- package/dist/tui/commands.js +131 -0
- package/dist/tui/context-bar.d.ts +4 -0
- package/dist/tui/context-bar.js +74 -0
- package/dist/tui/context-meter.d.ts +25 -0
- package/dist/tui/context-meter.js +81 -0
- package/dist/tui/cost-binding.d.ts +8 -0
- package/dist/tui/cost-binding.js +43 -0
- package/dist/tui/cost-tracker.d.ts +49 -0
- package/dist/tui/cost-tracker.js +122 -0
- package/dist/tui/diff.d.ts +9 -0
- package/dist/tui/diff.js +119 -0
- package/dist/tui/i18n-catalog.d.ts +5 -0
- package/dist/tui/i18n-catalog.js +184 -0
- package/dist/tui/i18n.d.ts +6 -0
- package/dist/tui/i18n.js +10 -0
- package/dist/tui/image-attachments.d.ts +46 -0
- package/dist/tui/image-attachments.js +167 -0
- package/dist/tui/images.d.ts +12 -0
- package/dist/tui/images.js +87 -0
- package/dist/tui/intro.d.ts +13 -0
- package/dist/tui/intro.js +109 -0
- package/dist/tui/language-preference.d.ts +6 -0
- package/dist/tui/language-preference.js +24 -0
- package/dist/tui/live-output.d.ts +2 -0
- package/dist/tui/live-output.js +18 -0
- package/dist/tui/locales.d.ts +19 -0
- package/dist/tui/locales.js +22 -0
- package/dist/tui/login-menu.d.ts +17 -0
- package/dist/tui/login-menu.js +58 -0
- package/dist/tui/logo.d.ts +8 -0
- package/dist/tui/logo.js +305 -0
- package/dist/tui/markdown-inline.d.ts +3 -0
- package/dist/tui/markdown-inline.js +99 -0
- package/dist/tui/markdown-table.d.ts +4 -0
- package/dist/tui/markdown-table.js +63 -0
- package/dist/tui/markdown.d.ts +11 -0
- package/dist/tui/markdown.js +257 -0
- package/dist/tui/mcp-transcript.d.ts +7 -0
- package/dist/tui/mcp-transcript.js +40 -0
- package/dist/tui/model-details.d.ts +2 -0
- package/dist/tui/model-details.js +21 -0
- package/dist/tui/model-selection.d.ts +7 -0
- package/dist/tui/model-selection.js +41 -0
- package/dist/tui/native-scrollback.d.ts +27 -0
- package/dist/tui/native-scrollback.js +134 -0
- package/dist/tui/onboarding.d.ts +72 -0
- package/dist/tui/onboarding.js +207 -0
- package/dist/tui/paste-collapse.d.ts +39 -0
- package/dist/tui/paste-collapse.js +117 -0
- package/dist/tui/perm-mode.d.ts +8 -0
- package/dist/tui/perm-mode.js +41 -0
- package/dist/tui/prompt-queue-store.d.ts +26 -0
- package/dist/tui/prompt-queue-store.js +87 -0
- package/dist/tui/prompt-queue.d.ts +47 -0
- package/dist/tui/prompt-queue.js +187 -0
- package/dist/tui/provider-menu.d.ts +33 -0
- package/dist/tui/provider-menu.js +175 -0
- package/dist/tui/question.d.ts +24 -0
- package/dist/tui/question.js +32 -0
- package/dist/tui/queue-screen.d.ts +25 -0
- package/dist/tui/queue-screen.js +152 -0
- package/dist/tui/queue-team.d.ts +3 -0
- package/dist/tui/queue-team.js +28 -0
- package/dist/tui/queued-questions.d.ts +20 -0
- package/dist/tui/queued-questions.js +163 -0
- package/dist/tui/quick-help.d.ts +1 -0
- package/dist/tui/quick-help.js +53 -0
- package/dist/tui/repl.d.ts +78 -0
- package/dist/tui/repl.js +4130 -0
- package/dist/tui/restore-queued-input.d.ts +3 -0
- package/dist/tui/restore-queued-input.js +20 -0
- package/dist/tui/review-detail.d.ts +6 -0
- package/dist/tui/review-detail.js +56 -0
- package/dist/tui/review-files.d.ts +3 -0
- package/dist/tui/review-files.js +22 -0
- package/dist/tui/review-render.d.ts +22 -0
- package/dist/tui/review-render.js +98 -0
- package/dist/tui/review-screen.d.ts +38 -0
- package/dist/tui/review-screen.js +358 -0
- package/dist/tui/review-store.d.ts +60 -0
- package/dist/tui/review-store.js +270 -0
- package/dist/tui/review-team.d.ts +2 -0
- package/dist/tui/review-team.js +27 -0
- package/dist/tui/selector-mouse.d.ts +26 -0
- package/dist/tui/selector-mouse.js +65 -0
- package/dist/tui/selector.d.ts +51 -0
- package/dist/tui/selector.js +299 -0
- package/dist/tui/session-replay.d.ts +10 -0
- package/dist/tui/session-replay.js +78 -0
- package/dist/tui/session-usage.d.ts +22 -0
- package/dist/tui/session-usage.js +55 -0
- package/dist/tui/skill-transcript.d.ts +5 -0
- package/dist/tui/skill-transcript.js +31 -0
- package/dist/tui/startup.d.ts +5 -0
- package/dist/tui/startup.js +61 -0
- package/dist/tui/status-line-loader.d.ts +8 -0
- package/dist/tui/status-line-loader.js +33 -0
- package/dist/tui/status-line.d.ts +38 -0
- package/dist/tui/status-line.js +213 -0
- package/dist/tui/system-language.d.ts +8 -0
- package/dist/tui/system-language.js +41 -0
- package/dist/tui/task-labels.d.ts +2 -0
- package/dist/tui/task-labels.js +7 -0
- package/dist/tui/term-bg.d.ts +4 -0
- package/dist/tui/term-bg.js +67 -0
- package/dist/tui/terminal-screen.d.ts +12 -0
- package/dist/tui/terminal-screen.js +1 -0
- package/dist/tui/terminal-text.d.ts +7 -0
- package/dist/tui/terminal-text.js +123 -0
- package/dist/tui/theme.d.ts +25 -0
- package/dist/tui/theme.js +383 -0
- package/dist/tui/tool-style.d.ts +7 -0
- package/dist/tui/tool-style.js +119 -0
- package/dist/tui/update-prompt.d.ts +14 -0
- package/dist/tui/update-prompt.js +104 -0
- package/dist/tui/usage-footer.d.ts +9 -0
- package/dist/tui/usage-footer.js +123 -0
- package/dist/tui/vascend-login.d.ts +68 -0
- package/dist/tui/vascend-login.js +355 -0
- package/dist/tui/web-login.d.ts +28 -0
- package/dist/tui/web-login.js +115 -0
- package/dist/vascend/activity-status.d.ts +12 -0
- package/dist/vascend/activity-status.js +68 -0
- package/dist/vascend/architecture-map.d.ts +73 -0
- package/dist/vascend/architecture-map.js +424 -0
- package/dist/vascend/attention-layout.d.ts +19 -0
- package/dist/vascend/attention-layout.js +141 -0
- package/dist/vascend/budget-allocator.d.ts +31 -0
- package/dist/vascend/budget-allocator.js +79 -0
- package/dist/vascend/candidate-collector.d.ts +20 -0
- package/dist/vascend/candidate-collector.js +220 -0
- package/dist/vascend/code-events.d.ts +24 -0
- package/dist/vascend/code-events.js +304 -0
- package/dist/vascend/code-graph-memory.d.ts +38 -0
- package/dist/vascend/code-graph-memory.js +334 -0
- package/dist/vascend/code-graph-runtime.d.ts +19 -0
- package/dist/vascend/code-graph-runtime.js +190 -0
- package/dist/vascend/code-graph-types.d.ts +58 -0
- package/dist/vascend/code-graph-types.js +50 -0
- package/dist/vascend/code-parser.d.ts +4 -0
- package/dist/vascend/code-parser.js +257 -0
- package/dist/vascend/competitor-knowledge.d.ts +53 -0
- package/dist/vascend/competitor-knowledge.js +262 -0
- package/dist/vascend/completeness.d.ts +16 -0
- package/dist/vascend/completeness.js +90 -0
- package/dist/vascend/context-autotuner.d.ts +45 -0
- package/dist/vascend/context-autotuner.js +231 -0
- package/dist/vascend/context-candidate.d.ts +45 -0
- package/dist/vascend/context-candidate.js +150 -0
- package/dist/vascend/context-capsule.d.ts +51 -0
- package/dist/vascend/context-capsule.js +133 -0
- package/dist/vascend/context-fabric.d.ts +108 -0
- package/dist/vascend/context-fabric.js +480 -0
- package/dist/vascend/context-feedback-loop.d.ts +56 -0
- package/dist/vascend/context-feedback-loop.js +204 -0
- package/dist/vascend/context-learning-identity.d.ts +4 -0
- package/dist/vascend/context-learning-identity.js +8 -0
- package/dist/vascend/context-links.d.ts +14 -0
- package/dist/vascend/context-links.js +83 -0
- package/dist/vascend/context-lint.d.ts +22 -0
- package/dist/vascend/context-lint.js +91 -0
- package/dist/vascend/context-market-selection.d.ts +17 -0
- package/dist/vascend/context-market-selection.js +50 -0
- package/dist/vascend/context-metrics.d.ts +25 -0
- package/dist/vascend/context-metrics.js +57 -0
- package/dist/vascend/context-pack-render.d.ts +16 -0
- package/dist/vascend/context-pack-render.js +52 -0
- package/dist/vascend/context-pareto.d.ts +33 -0
- package/dist/vascend/context-pareto.js +165 -0
- package/dist/vascend/context-pattern-explorer.d.ts +41 -0
- package/dist/vascend/context-pattern-explorer.js +276 -0
- package/dist/vascend/context-regret.d.ts +32 -0
- package/dist/vascend/context-regret.js +93 -0
- package/dist/vascend/context-retriever.d.ts +22 -0
- package/dist/vascend/context-retriever.js +243 -0
- package/dist/vascend/context-scope-index.d.ts +5 -0
- package/dist/vascend/context-scope-index.js +96 -0
- package/dist/vascend/context-scorer.d.ts +35 -0
- package/dist/vascend/context-scorer.js +162 -0
- package/dist/vascend/context-search-index.d.ts +12 -0
- package/dist/vascend/context-search-index.js +25 -0
- package/dist/vascend/context-snapshot.d.ts +22 -0
- package/dist/vascend/context-snapshot.js +135 -0
- package/dist/vascend/context-window-compiler.d.ts +42 -0
- package/dist/vascend/context-window-compiler.js +237 -0
- package/dist/vascend/contract-memory.d.ts +61 -0
- package/dist/vascend/contract-memory.js +435 -0
- package/dist/vascend/council.d.ts +58 -0
- package/dist/vascend/council.js +337 -0
- package/dist/vascend/decision-promotion.d.ts +48 -0
- package/dist/vascend/decision-promotion.js +410 -0
- package/dist/vascend/delta-context.d.ts +12 -0
- package/dist/vascend/delta-context.js +36 -0
- package/dist/vascend/dev-context-compiler.d.ts +27 -0
- package/dist/vascend/dev-context-compiler.js +133 -0
- package/dist/vascend/dev-context-layout.d.ts +30 -0
- package/dist/vascend/dev-context-layout.js +262 -0
- package/dist/vascend/evidence-slots.d.ts +14 -0
- package/dist/vascend/evidence-slots.js +55 -0
- package/dist/vascend/expansion-levels.d.ts +15 -0
- package/dist/vascend/expansion-levels.js +178 -0
- package/dist/vascend/file-lock.d.ts +7 -0
- package/dist/vascend/file-lock.js +95 -0
- package/dist/vascend/granular-kingdom.d.ts +25 -0
- package/dist/vascend/granular-kingdom.js +259 -0
- package/dist/vascend/granular-launcher.d.ts +48 -0
- package/dist/vascend/granular-launcher.js +202 -0
- package/dist/vascend/kingdom-bus.d.ts +25 -0
- package/dist/vascend/kingdom-bus.js +54 -0
- package/dist/vascend/kingdom-channel.d.ts +22 -0
- package/dist/vascend/kingdom-channel.js +180 -0
- package/dist/vascend/kingdom-kpi.d.ts +48 -0
- package/dist/vascend/kingdom-kpi.js +172 -0
- package/dist/vascend/kingdom-live.d.ts +28 -0
- package/dist/vascend/kingdom-live.js +61 -0
- package/dist/vascend/kingdom-run.d.ts +18 -0
- package/dist/vascend/kingdom-run.js +506 -0
- package/dist/vascend/kingdom-scribe.d.ts +20 -0
- package/dist/vascend/kingdom-scribe.js +52 -0
- package/dist/vascend/kingdom.d.ts +79 -0
- package/dist/vascend/kingdom.js +870 -0
- package/dist/vascend/lexical-index.d.ts +10 -0
- package/dist/vascend/lexical-index.js +99 -0
- package/dist/vascend/lexical-search.d.ts +29 -0
- package/dist/vascend/lexical-search.js +262 -0
- package/dist/vascend/long-term-context.d.ts +51 -0
- package/dist/vascend/long-term-context.js +194 -0
- package/dist/vascend/mandate.d.ts +33 -0
- package/dist/vascend/mandate.js +107 -0
- package/dist/vascend/memory-packet.d.ts +13 -0
- package/dist/vascend/memory-packet.js +155 -0
- package/dist/vascend/memory-status.d.ts +22 -0
- package/dist/vascend/memory-status.js +73 -0
- package/dist/vascend/memory-store.d.ts +62 -0
- package/dist/vascend/memory-store.js +273 -0
- package/dist/vascend/objective-revision.d.ts +69 -0
- package/dist/vascend/objective-revision.js +319 -0
- package/dist/vascend/patch-plan-store.d.ts +33 -0
- package/dist/vascend/patch-plan-store.js +240 -0
- package/dist/vascend/patch-plan.d.ts +97 -0
- package/dist/vascend/patch-plan.js +345 -0
- package/dist/vascend/plan-progress.d.ts +11 -0
- package/dist/vascend/plan-progress.js +68 -0
- package/dist/vascend/plan-store.d.ts +64 -0
- package/dist/vascend/plan-store.js +460 -0
- package/dist/vascend/proof-chains.d.ts +19 -0
- package/dist/vascend/proof-chains.js +120 -0
- package/dist/vascend/ramification-store.d.ts +25 -0
- package/dist/vascend/ramification-store.js +94 -0
- package/dist/vascend/ramification.d.ts +193 -0
- package/dist/vascend/ramification.js +583 -0
- package/dist/vascend/recall-planner.d.ts +17 -0
- package/dist/vascend/recall-planner.js +109 -0
- package/dist/vascend/requirements.d.ts +31 -0
- package/dist/vascend/requirements.js +151 -0
- package/dist/vascend/reviewer.d.ts +9 -0
- package/dist/vascend/reviewer.js +93 -0
- package/dist/vascend/room-graph.d.ts +29 -0
- package/dist/vascend/room-graph.js +242 -0
- package/dist/vascend/room-memory.d.ts +57 -0
- package/dist/vascend/room-memory.js +631 -0
- package/dist/vascend/runtime.d.ts +84 -0
- package/dist/vascend/runtime.js +286 -0
- package/dist/vascend/self-improve.d.ts +104 -0
- package/dist/vascend/self-improve.js +396 -0
- package/dist/vascend/session-search.d.ts +52 -0
- package/dist/vascend/session-search.js +349 -0
- package/dist/vascend/supersession-graph.d.ts +14 -0
- package/dist/vascend/supersession-graph.js +70 -0
- package/dist/vascend/team-areas.d.ts +9 -0
- package/dist/vascend/team-areas.js +28 -0
- package/dist/vascend/team-handoff.d.ts +24 -0
- package/dist/vascend/team-handoff.js +37 -0
- package/dist/vascend/team-scheduler.d.ts +13 -0
- package/dist/vascend/team-scheduler.js +74 -0
- package/dist/vascend/team-session.d.ts +42 -0
- package/dist/vascend/team-session.js +142 -0
- package/dist/vascend/test-failure-memory.d.ts +76 -0
- package/dist/vascend/test-failure-memory.js +354 -0
- package/dist/vascend/token-market.d.ts +42 -0
- package/dist/vascend/token-market.js +144 -0
- package/dist/vascend/tuner-baseline-store.d.ts +52 -0
- package/dist/vascend/tuner-baseline-store.js +446 -0
- package/dist/vascend/user-profile.d.ts +44 -0
- package/dist/vascend/user-profile.js +131 -0
- package/dist/vascend/vision.d.ts +94 -0
- package/dist/vascend/vision.js +375 -0
- package/dist/vascend/work-agent.d.ts +12 -0
- package/dist/vascend/work-agent.js +83 -0
- package/dist/vascend/work-queue.d.ts +62 -0
- package/dist/vascend/work-queue.js +255 -0
- package/dist/vascend/work-runner.d.ts +64 -0
- package/dist/vascend/work-runner.js +137 -0
- package/dist/vascend/worktree.d.ts +38 -0
- package/dist/vascend/worktree.js +206 -0
- package/dist/vendor/computer-use/README.md +7 -0
- package/dist/vendor/computer-use/computer-desktop.js +211 -0
- package/dist/vendor/computer-use/computer-observe.js +315 -0
- package/dist/vendor/computer-use/computer-scripts.js +1230 -0
- package/dist/vendor/computer-use/computer-tools.js +2136 -0
- package/dist/vendor/computer-use/package.json +1 -0
- package/dist/vendor/computer-use/rac/atomic-input.js +91 -0
- package/dist/vendor/computer-use/rac/grammatica.js +101 -0
- package/dist/vendor/computer-use/rac/parser.js +185 -0
- package/dist/vendor/computer-use/rac/protocol.js +136 -0
- package/install.ps1 +30 -0
- package/install.sh +50 -0
- package/package.json +56 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { type ChildProcess } from "node:child_process";
|
|
2
|
+
export declare function terminateChildProcess(child: ChildProcess): void;
|
|
3
|
+
export type BgStatus = "running" | "done" | "failed" | "killed";
|
|
4
|
+
export interface BgTask {
|
|
5
|
+
readonly id: string;
|
|
6
|
+
readonly command: string;
|
|
7
|
+
readonly startedAt: number;
|
|
8
|
+
endedAt?: number;
|
|
9
|
+
status: BgStatus;
|
|
10
|
+
exitCode?: number;
|
|
11
|
+
output: string;
|
|
12
|
+
detached?: boolean;
|
|
13
|
+
}
|
|
14
|
+
interface Foreground {
|
|
15
|
+
readonly taskId: string;
|
|
16
|
+
background(): void;
|
|
17
|
+
}
|
|
18
|
+
export declare class BackgroundManager {
|
|
19
|
+
private readonly tasks;
|
|
20
|
+
private readonly children;
|
|
21
|
+
private readonly order;
|
|
22
|
+
private seq;
|
|
23
|
+
private fg;
|
|
24
|
+
private readonly changeCbs;
|
|
25
|
+
private readonly finishCbs;
|
|
26
|
+
createTask(command: string): BgTask;
|
|
27
|
+
setChild(id: string, child: ChildProcess): void;
|
|
28
|
+
appendOutput(id: string, chunk: string): void;
|
|
29
|
+
finishTask(id: string, status: BgStatus, exitCode?: number): void;
|
|
30
|
+
setForeground(fg: Foreground): void;
|
|
31
|
+
clearForeground(id?: string): void;
|
|
32
|
+
hasForeground(): boolean;
|
|
33
|
+
markDetached(id: string): void;
|
|
34
|
+
requestBackground(): BgTask | null;
|
|
35
|
+
kill(id: string): boolean;
|
|
36
|
+
get(id: string): BgTask | undefined;
|
|
37
|
+
list(): readonly BgTask[];
|
|
38
|
+
running(): readonly BgTask[];
|
|
39
|
+
onChange(cb: () => void): () => void;
|
|
40
|
+
onFinish(cb: (task: BgTask) => void): () => void;
|
|
41
|
+
private emitChange;
|
|
42
|
+
private pruneHistory;
|
|
43
|
+
}
|
|
44
|
+
export declare const backgroundManager: BackgroundManager;
|
|
45
|
+
export {};
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
// `child.kill()` su Windows termina spesso soltanto cmd/bash lasciando vivi i
|
|
3
|
+
// processi generati (node, npm, test runner). Il controllo agentico deve invece
|
|
4
|
+
// riferirsi all'intero comando, quindi usa la terminazione ricorsiva del tree.
|
|
5
|
+
export function terminateChildProcess(child) {
|
|
6
|
+
if (process.platform === "win32" && child.pid) {
|
|
7
|
+
try {
|
|
8
|
+
const killer = spawn("taskkill", ["/pid", String(child.pid), "/T", "/F"], { windowsHide: true });
|
|
9
|
+
killer.once("error", () => { try {
|
|
10
|
+
child.kill();
|
|
11
|
+
}
|
|
12
|
+
catch { /* gia' terminato */ } });
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
catch { /* fallback portabile sotto */ }
|
|
16
|
+
}
|
|
17
|
+
try {
|
|
18
|
+
child.kill("SIGTERM");
|
|
19
|
+
}
|
|
20
|
+
catch { /* gia' terminato */ }
|
|
21
|
+
}
|
|
22
|
+
const MAX_BG_OUTPUT = 50_000;
|
|
23
|
+
const MAX_COMPLETED_BACKGROUND = 20;
|
|
24
|
+
export class BackgroundManager {
|
|
25
|
+
tasks = new Map();
|
|
26
|
+
children = new Map();
|
|
27
|
+
order = [];
|
|
28
|
+
seq = 0;
|
|
29
|
+
fg = null;
|
|
30
|
+
changeCbs = new Set();
|
|
31
|
+
finishCbs = new Set();
|
|
32
|
+
createTask(command) {
|
|
33
|
+
this.seq += 1;
|
|
34
|
+
const id = `bg${this.seq}`;
|
|
35
|
+
const task = { id, command, startedAt: Date.now(), status: "running", output: "" };
|
|
36
|
+
this.tasks.set(id, task);
|
|
37
|
+
this.order.push(id);
|
|
38
|
+
this.emitChange();
|
|
39
|
+
return task;
|
|
40
|
+
}
|
|
41
|
+
setChild(id, child) {
|
|
42
|
+
this.children.set(id, child);
|
|
43
|
+
}
|
|
44
|
+
appendOutput(id, chunk) {
|
|
45
|
+
const t = this.tasks.get(id);
|
|
46
|
+
if (!t)
|
|
47
|
+
return;
|
|
48
|
+
t.output = (t.output + chunk).slice(-MAX_BG_OUTPUT);
|
|
49
|
+
this.emitChange();
|
|
50
|
+
}
|
|
51
|
+
finishTask(id, status, exitCode) {
|
|
52
|
+
const t = this.tasks.get(id);
|
|
53
|
+
if (!t || t.status !== "running")
|
|
54
|
+
return;
|
|
55
|
+
t.status = status;
|
|
56
|
+
t.endedAt = Date.now();
|
|
57
|
+
if (exitCode !== undefined)
|
|
58
|
+
t.exitCode = exitCode;
|
|
59
|
+
this.children.delete(id);
|
|
60
|
+
this.emitChange();
|
|
61
|
+
for (const cb of this.finishCbs)
|
|
62
|
+
cb(t);
|
|
63
|
+
this.pruneHistory(id);
|
|
64
|
+
}
|
|
65
|
+
// Registra il comando in primo piano (chiamato dal tool bash all'avvio).
|
|
66
|
+
setForeground(fg) { this.fg = fg; }
|
|
67
|
+
clearForeground(id) { if (!id || this.fg?.taskId === id)
|
|
68
|
+
this.fg = null; }
|
|
69
|
+
hasForeground() { return this.fg !== null; }
|
|
70
|
+
markDetached(id) {
|
|
71
|
+
const task = this.tasks.get(id);
|
|
72
|
+
if (task && !task.detached) {
|
|
73
|
+
task.detached = true;
|
|
74
|
+
this.emitChange();
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
// Ctrl+B: stacca il comando in primo piano. Ritorna il task o null se non c'e'
|
|
78
|
+
// niente in primo piano.
|
|
79
|
+
requestBackground() {
|
|
80
|
+
const fg = this.fg;
|
|
81
|
+
if (!fg)
|
|
82
|
+
return null;
|
|
83
|
+
this.fg = null;
|
|
84
|
+
const t = this.tasks.get(fg.taskId);
|
|
85
|
+
if (t)
|
|
86
|
+
t.detached = true;
|
|
87
|
+
this.emitChange();
|
|
88
|
+
fg.background();
|
|
89
|
+
return t ?? null;
|
|
90
|
+
}
|
|
91
|
+
kill(id) {
|
|
92
|
+
const child = this.children.get(id);
|
|
93
|
+
if (!child)
|
|
94
|
+
return false;
|
|
95
|
+
terminateChildProcess(child);
|
|
96
|
+
this.finishTask(id, "killed");
|
|
97
|
+
return true;
|
|
98
|
+
}
|
|
99
|
+
get(id) { return this.tasks.get(id); }
|
|
100
|
+
list() {
|
|
101
|
+
// Ogni comando shell nasce come candidato al Ctrl+B, ma diventa davvero
|
|
102
|
+
// un'attivita' in background soltanto quando l'utente lo stacca. Esporre
|
|
103
|
+
// anche i normali comandi conclusi faceva crescere /bg senza limite.
|
|
104
|
+
return this.order
|
|
105
|
+
.map((id) => this.tasks.get(id))
|
|
106
|
+
.filter((t) => Boolean(t?.detached));
|
|
107
|
+
}
|
|
108
|
+
running() { return this.list().filter((t) => t.status === "running"); }
|
|
109
|
+
onChange(cb) { this.changeCbs.add(cb); return () => this.changeCbs.delete(cb); }
|
|
110
|
+
onFinish(cb) { this.finishCbs.add(cb); return () => this.finishCbs.delete(cb); }
|
|
111
|
+
emitChange() { for (const cb of this.changeCbs)
|
|
112
|
+
cb(); }
|
|
113
|
+
pruneHistory(latestId) {
|
|
114
|
+
const completedDetached = this.order.filter((id) => {
|
|
115
|
+
const task = this.tasks.get(id);
|
|
116
|
+
return Boolean(task?.detached && task.status !== "running");
|
|
117
|
+
});
|
|
118
|
+
const retainedDetached = new Set(completedDetached.slice(-MAX_COMPLETED_BACKGROUND));
|
|
119
|
+
const keep = new Set(this.order.filter((id) => {
|
|
120
|
+
const task = this.tasks.get(id);
|
|
121
|
+
if (!task)
|
|
122
|
+
return false;
|
|
123
|
+
if (task.status === "running")
|
|
124
|
+
return true;
|
|
125
|
+
if (task.detached)
|
|
126
|
+
return retainedDetached.has(id);
|
|
127
|
+
// Mantieni soltanto l'ultimo foreground: il chiamante legge il suo
|
|
128
|
+
// output immediatamente dopo finishTask, gli altri non sono consultabili.
|
|
129
|
+
return id === latestId;
|
|
130
|
+
}));
|
|
131
|
+
for (const id of this.order) {
|
|
132
|
+
if (!keep.has(id))
|
|
133
|
+
this.tasks.delete(id);
|
|
134
|
+
}
|
|
135
|
+
const retainedOrder = this.order.filter((id) => keep.has(id));
|
|
136
|
+
this.order.splice(0, this.order.length, ...retainedOrder);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
// Istanza condivisa di processo.
|
|
140
|
+
export const backgroundManager = new BackgroundManager();
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { PiConfig } from "./config.js";
|
|
2
|
+
import { Session } from "./session.js";
|
|
3
|
+
import { ToolRegistry } from "../tools/registry.js";
|
|
4
|
+
import type { ProviderRegistry } from "../providers/registry.js";
|
|
5
|
+
import { ExtensionHost } from "../extensions/loader.js";
|
|
6
|
+
import { type Skill } from "../skills/skills.js";
|
|
7
|
+
import { type PackageResources } from "../packages/packages.js";
|
|
8
|
+
import type { AgentDeps } from "./agent.js";
|
|
9
|
+
import { type ExecutionTarget } from "./execution-target.js";
|
|
10
|
+
import { WorkspaceSession } from "./workspace-sessions.js";
|
|
11
|
+
export interface Harness {
|
|
12
|
+
config: PiConfig;
|
|
13
|
+
readonly env: NodeJS.ProcessEnv;
|
|
14
|
+
readonly tools: ToolRegistry;
|
|
15
|
+
readonly providers: ProviderRegistry;
|
|
16
|
+
readonly host: ExtensionHost;
|
|
17
|
+
readonly session: Session;
|
|
18
|
+
readonly skills: readonly Skill[];
|
|
19
|
+
readonly skillCommandsEnabled: boolean;
|
|
20
|
+
readonly projectTrusted: boolean;
|
|
21
|
+
readonly packages: PackageResources;
|
|
22
|
+
/** Root aggiuntive che appartengono allo stesso progetto della cwd primaria. */
|
|
23
|
+
readonly fsRoots: readonly string[];
|
|
24
|
+
readonly executionTarget: ExecutionTarget;
|
|
25
|
+
readonly workspaceSession?: WorkspaceSession;
|
|
26
|
+
/** Chiude presenza e risorse del canale fra sessioni. */
|
|
27
|
+
dispose?(): void;
|
|
28
|
+
deps(confirm: AgentDeps["confirm"]): AgentDeps;
|
|
29
|
+
setModel(model: string): void;
|
|
30
|
+
reloadProviders(): void;
|
|
31
|
+
loadSession(id: string): Session;
|
|
32
|
+
newSession(): Session;
|
|
33
|
+
}
|
|
34
|
+
export declare function createToolRegistry(env: NodeJS.ProcessEnv): ToolRegistry;
|
|
35
|
+
export declare function bootstrap(opts: {
|
|
36
|
+
cwd?: string;
|
|
37
|
+
fsRoots?: readonly string[];
|
|
38
|
+
executionTarget?: ExecutionTarget;
|
|
39
|
+
model?: string;
|
|
40
|
+
sessionId?: string;
|
|
41
|
+
continueLast?: boolean;
|
|
42
|
+
sessionName?: string;
|
|
43
|
+
env?: NodeJS.ProcessEnv;
|
|
44
|
+
trustPrompt?: (resources: readonly string[]) => Promise<boolean>;
|
|
45
|
+
}): Promise<Harness>;
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
import { buildConfig } from "./config.js";
|
|
2
|
+
import { Session, listSessions } from "./session.js";
|
|
3
|
+
import { prepareSessionStorage } from "./session-storage.js";
|
|
4
|
+
import { maintainSessionStorage, protectSessionStorage } from "./storage-retention.js";
|
|
5
|
+
import { applyStoredCredentials } from "./credentials.js";
|
|
6
|
+
import { ToolRegistry } from "../tools/registry.js";
|
|
7
|
+
import { builtinTools } from "../tools/builtin.js";
|
|
8
|
+
import { registerComputerUse } from "../tools/computer-use.js";
|
|
9
|
+
import { resolveTool } from "../tools/resolve.js";
|
|
10
|
+
import { executeTool } from "../tools/execute.js";
|
|
11
|
+
import { CLI_DIRECT_TOOL_NAMES, FILE_DISCOVERY_TOOL_NAMES, HORIZON_DIRECT_TOOL_NAMES, toolDescribeTool, toolListTool } from "../tools/discovery.js";
|
|
12
|
+
import { defaultRegistry, resolveStartupModel } from "../providers/registry.js";
|
|
13
|
+
import { ExtensionHost } from "../extensions/loader.js";
|
|
14
|
+
import { registerExtensionTools } from "../extensions/ext-tools.js";
|
|
15
|
+
import { OpenAICompatProvider } from "../providers/openai-compat.js";
|
|
16
|
+
import { discoverSkills, skillsSystemBlock } from "../skills/skills.js";
|
|
17
|
+
import { parseDefaultTrust, resolveProjectTrust, writeTrustDecision } from "./trust.js";
|
|
18
|
+
import { resolvePackages } from "../packages/packages.js";
|
|
19
|
+
import { contextWindowFor, estimateMessagesTokens, estimateTokens, estimateToolDefinitionTokens } from "./compaction.js";
|
|
20
|
+
import { resolveWorkspaceRoots, workspaceSystemBlock } from "./workspace-roots.js";
|
|
21
|
+
import { normalizeExecutionTarget } from "./execution-target.js";
|
|
22
|
+
import { WorkspaceSession } from "./workspace-sessions.js";
|
|
23
|
+
export function createToolRegistry(env) {
|
|
24
|
+
const horizonDiscovery = env["TALOS_HOST_PROFILE"]?.trim().toLowerCase() === "horizon";
|
|
25
|
+
const deferTools = env["TALOS_DEFER_TOOLS"] !== "0";
|
|
26
|
+
const excluded = (env["TALOS_EXCLUDE_TOOLS"] ?? "").split(",").map(name => name.trim()).filter(Boolean);
|
|
27
|
+
const profile = env["TALOS_TOOL_PROFILE"]?.trim().toLowerCase();
|
|
28
|
+
if (profile && profile !== "compact" && profile !== "standard")
|
|
29
|
+
throw new Error("TALOS_TOOL_PROFILE must be compact or standard");
|
|
30
|
+
const compact = profile === "compact" || (!profile && !horizonDiscovery && deferTools
|
|
31
|
+
&& !excluded.includes("resolve") && !excluded.includes("execute"));
|
|
32
|
+
if (compact && (excluded.includes("resolve") || excluded.includes("execute"))) {
|
|
33
|
+
throw new Error("The compact profile requires resolve and execute. Use TALOS_TOOL_PROFILE=standard for this exclusion.");
|
|
34
|
+
}
|
|
35
|
+
const directTools = new Set(horizonDiscovery ? HORIZON_DIRECT_TOOL_NAMES : CLI_DIRECT_TOOL_NAMES);
|
|
36
|
+
if (excluded.includes("bash"))
|
|
37
|
+
for (const name of FILE_DISCOVERY_TOOL_NAMES)
|
|
38
|
+
directTools.add(name);
|
|
39
|
+
const tools = new ToolRegistry(compact ? { compact: true } : horizonDiscovery || deferTools ? { directTools } : undefined);
|
|
40
|
+
for (const tool of builtinTools) {
|
|
41
|
+
tools.register(tool);
|
|
42
|
+
}
|
|
43
|
+
tools.register(toolListTool, deferTools);
|
|
44
|
+
tools.register(toolDescribeTool, deferTools);
|
|
45
|
+
if (compact) {
|
|
46
|
+
tools.register(resolveTool);
|
|
47
|
+
tools.register(executeTool);
|
|
48
|
+
}
|
|
49
|
+
for (const name of excluded) {
|
|
50
|
+
tools.remove(name);
|
|
51
|
+
}
|
|
52
|
+
return tools;
|
|
53
|
+
}
|
|
54
|
+
// Assembla l'intero harness: config, provider, tool builtin, estensioni,
|
|
55
|
+
// sessione. Punto unico di costruzione condiviso da TUI/print/RPC/SDK.
|
|
56
|
+
export async function bootstrap(opts) {
|
|
57
|
+
// Le credenziali persistite (~/.talos/config.json, blocco "providers")
|
|
58
|
+
// diventano TALOS_<ID>_API_KEY / _BASE_URL prima di costruire config e
|
|
59
|
+
// registro. Le env var gia' presenti hanno precedenza.
|
|
60
|
+
const env = applyStoredCredentials(opts.env ?? process.env);
|
|
61
|
+
const executionTarget = normalizeExecutionTarget(opts.executionTarget);
|
|
62
|
+
let config = buildConfig({ cwd: opts.cwd, model: opts.model, env });
|
|
63
|
+
const fsRoots = resolveWorkspaceRoots({ cwd: config.cwd, explicit: opts.fsRoots, env });
|
|
64
|
+
const tools = createToolRegistry(env);
|
|
65
|
+
registerComputerUse(tools, env);
|
|
66
|
+
let providers = defaultRegistry(env);
|
|
67
|
+
// Modello PREFERITO dall'utente: l'intento salvato/configurato. Lo teniamo
|
|
68
|
+
// separato dal modello effettivo cosi', se al riavvio il suo provider non e'
|
|
69
|
+
// (ancora) configurato, ripieghiamo su uno disponibile SENZA dimenticare la
|
|
70
|
+
// scelta. Appena il provider torna (reloadProviders), il preferito riprende.
|
|
71
|
+
let preferredModel = config.model;
|
|
72
|
+
{
|
|
73
|
+
const startup = resolveStartupModel(providers, preferredModel);
|
|
74
|
+
if (startup.model !== config.model)
|
|
75
|
+
config = { ...config, model: startup.model };
|
|
76
|
+
}
|
|
77
|
+
// Project trust: decide se caricare risorse locali al progetto.
|
|
78
|
+
const trust = await resolveProjectTrust({
|
|
79
|
+
cwd: config.cwd,
|
|
80
|
+
env,
|
|
81
|
+
defaultTrust: parseDefaultTrust(env["TALOS_DEFAULT_TRUST"]),
|
|
82
|
+
prompt: opts.trustPrompt,
|
|
83
|
+
});
|
|
84
|
+
const projectTrusted = trust.trusted;
|
|
85
|
+
if (trust.persist)
|
|
86
|
+
writeTrustDecision(env, config.cwd, projectTrusted ? "trust" : "deny");
|
|
87
|
+
// Packages: bundle configurati esplicitamente dall'utente (env/global).
|
|
88
|
+
const packages = resolvePackages(env, [], { cwd: config.cwd, projectTrusted });
|
|
89
|
+
// Estensioni: caricate dal progetto solo se fidato (eseguono codice). Le
|
|
90
|
+
// estensioni dei package sono configurate dall'utente -> caricate sempre.
|
|
91
|
+
const host = new ExtensionHost(tools, config.cwd);
|
|
92
|
+
if (projectTrusted)
|
|
93
|
+
await host.loadDir();
|
|
94
|
+
for (const ext of packages.extensions) {
|
|
95
|
+
try {
|
|
96
|
+
await host.loadModule(ext);
|
|
97
|
+
}
|
|
98
|
+
catch (err) {
|
|
99
|
+
process.stderr.write(`[pkg] errore estensione ${ext}: ${err.message}\n`);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
// Tool CORE per ispezionare e gestire le estensioni a runtime: l'agente puo'
|
|
103
|
+
// vedere la lista (con cosa registrano e lo stato) e cambiarne le impostazioni
|
|
104
|
+
// (enable/disable, opzioni). Persistiti su .talos/extensions-settings.json.
|
|
105
|
+
registerExtensionTools(tools, host);
|
|
106
|
+
// Evento project_trust: le estensioni possono osservare la decisione di
|
|
107
|
+
// fiducia sulle risorse locali (parita' Pi).
|
|
108
|
+
await host.emit("project_trust", {
|
|
109
|
+
trusted: projectTrusted,
|
|
110
|
+
cwd: config.cwd,
|
|
111
|
+
resources: trust.resources,
|
|
112
|
+
source: trust.source,
|
|
113
|
+
});
|
|
114
|
+
// Skills: discovery + progressive disclosure (solo nome+descrizione nel
|
|
115
|
+
// system prompt). --no-skills/--skill arrivano via env. Le skill di progetto
|
|
116
|
+
// richiedono trust.
|
|
117
|
+
const skillsDisabled = env["TALOS_NO_SKILLS"] === "1";
|
|
118
|
+
const extraSkillPaths = [
|
|
119
|
+
...(env["TALOS_SKILLS"] ?? "").split(",").map((p) => p.trim()).filter(Boolean),
|
|
120
|
+
...packages.skills,
|
|
121
|
+
];
|
|
122
|
+
const skills = discoverSkills(config.cwd, {
|
|
123
|
+
extraPaths: extraSkillPaths,
|
|
124
|
+
disabled: skillsDisabled,
|
|
125
|
+
projectTrusted,
|
|
126
|
+
});
|
|
127
|
+
const skillCommandsEnabled = env["TALOS_SKILL_COMMANDS"] !== "0";
|
|
128
|
+
const skillBlock = skillsSystemBlock(skills);
|
|
129
|
+
const workspaceBlock = workspaceSystemBlock(config.cwd, fsRoots);
|
|
130
|
+
const systemParts = [config.system, workspaceBlock, skillBlock].filter(Boolean);
|
|
131
|
+
const systemWithSkills = systemParts.join("\n\n");
|
|
132
|
+
config = { ...config, system: host.applySystem(systemWithSkills) };
|
|
133
|
+
// Sessione MUTABILE: /resume puo' sostituirla a runtime. Le closure sotto
|
|
134
|
+
// (host.bind, deps()) riferiscono la variabile `session`, quindi vedono il
|
|
135
|
+
// nuovo valore dopo loadSession senza ri-bind.
|
|
136
|
+
prepareSessionStorage(config, env);
|
|
137
|
+
const resumeId = opts.sessionId ?? (opts.continueLast ? listSessions(config.sessionDir)[0]?.id : undefined);
|
|
138
|
+
const protectStorage = (id) => protectSessionStorage(config.sessionDir, [id, config.roomStoreId, config.planStoreId].filter((value) => Boolean(value)), env, config.cwd);
|
|
139
|
+
let releaseStorage = resumeId ? protectStorage(resumeId) : () => { };
|
|
140
|
+
let session;
|
|
141
|
+
try {
|
|
142
|
+
session = resumeId ? Session.load(config.sessionDir, resumeId) : Session.create(config.sessionDir);
|
|
143
|
+
if (!resumeId)
|
|
144
|
+
releaseStorage = protectStorage(session.id);
|
|
145
|
+
}
|
|
146
|
+
catch (error) {
|
|
147
|
+
releaseStorage();
|
|
148
|
+
throw error;
|
|
149
|
+
}
|
|
150
|
+
maintainSessionStorage(env, config.cwd);
|
|
151
|
+
const maintenanceTimer = setInterval(() => maintainSessionStorage(env, config.cwd), 3_600_000);
|
|
152
|
+
maintenanceTimer.unref();
|
|
153
|
+
if (opts.sessionName && opts.sessionName !== session.name)
|
|
154
|
+
session.setName(opts.sessionName);
|
|
155
|
+
const openWorkspaceSession = () => {
|
|
156
|
+
if (env["TALOS_WORKSPACE_SESSIONS"] === "0")
|
|
157
|
+
return undefined;
|
|
158
|
+
try {
|
|
159
|
+
return new WorkspaceSession({ cwd: config.cwd, sessionId: session.id, label: session.name ?? session.id,
|
|
160
|
+
model: config.model, env, executionTarget });
|
|
161
|
+
}
|
|
162
|
+
catch (error) {
|
|
163
|
+
process.stderr.write(`[talos] coordinamento fra sessioni non disponibile: ${error.message}\n`);
|
|
164
|
+
return undefined;
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
let workspaceSession = openWorkspaceSession();
|
|
168
|
+
const renewWorkspaceSession = () => {
|
|
169
|
+
workspaceSession?.close();
|
|
170
|
+
workspaceSession = openWorkspaceSession();
|
|
171
|
+
};
|
|
172
|
+
// Inietta nell'host le capacita' runtime (provider/sessione/contesto) per
|
|
173
|
+
// l'ExtensionApi e il bus eventi.
|
|
174
|
+
host.bind({
|
|
175
|
+
isProjectTrusted: () => projectTrusted,
|
|
176
|
+
contextUsage: () => ({
|
|
177
|
+
tokens: estimateTokens(config.system) + estimateMessagesTokens(session.history()) + estimateToolDefinitionTokens(tools.defs()),
|
|
178
|
+
window: contextWindowFor(config.model, config.contextWindow),
|
|
179
|
+
}),
|
|
180
|
+
systemPrompt: () => config.system,
|
|
181
|
+
registerProvider: (name, cfg) => providers.register(new OpenAICompatProvider(name, cfg.label ?? name, cfg.baseUrl ?? "", cfg.apiKey ?? "", cfg.models ?? [])),
|
|
182
|
+
unregisterProvider: (name) => {
|
|
183
|
+
providers.remove(name);
|
|
184
|
+
},
|
|
185
|
+
setSessionName: (name) => session.setName(name),
|
|
186
|
+
setLabel: () => { },
|
|
187
|
+
appendEntry: (type, data) => session.append({ role: "user", content: [{ type: "text", text: `[${type}] ${JSON.stringify(data ?? {})}` }] }),
|
|
188
|
+
sessionEntries: () => session.tree(),
|
|
189
|
+
sessionLeafId: () => session.head,
|
|
190
|
+
});
|
|
191
|
+
// config e' mutabile via closure: /model lo aggiorna e i giri successivi
|
|
192
|
+
// dell'agente lo rileggono al momento di costruire i deps.
|
|
193
|
+
const harness = {
|
|
194
|
+
get config() {
|
|
195
|
+
return config;
|
|
196
|
+
},
|
|
197
|
+
set config(next) {
|
|
198
|
+
const changedWorkspace = config.cwd !== next.cwd;
|
|
199
|
+
const changedStorage = config.sessionDir !== next.sessionDir || config.roomStoreId !== next.roomStoreId || config.planStoreId !== next.planStoreId;
|
|
200
|
+
config = next;
|
|
201
|
+
if (changedStorage) {
|
|
202
|
+
const releasePrevious = releaseStorage;
|
|
203
|
+
releaseStorage = protectStorage(session.id);
|
|
204
|
+
releasePrevious();
|
|
205
|
+
}
|
|
206
|
+
if (changedWorkspace)
|
|
207
|
+
renewWorkspaceSession();
|
|
208
|
+
},
|
|
209
|
+
tools,
|
|
210
|
+
env,
|
|
211
|
+
get providers() {
|
|
212
|
+
return providers;
|
|
213
|
+
},
|
|
214
|
+
host,
|
|
215
|
+
get session() {
|
|
216
|
+
return session;
|
|
217
|
+
},
|
|
218
|
+
skills,
|
|
219
|
+
skillCommandsEnabled,
|
|
220
|
+
projectTrusted,
|
|
221
|
+
packages,
|
|
222
|
+
fsRoots,
|
|
223
|
+
executionTarget,
|
|
224
|
+
get workspaceSession() { return workspaceSession; },
|
|
225
|
+
dispose() { workspaceSession?.close(); workspaceSession = undefined; releaseStorage(); clearInterval(maintenanceTimer); },
|
|
226
|
+
setModel(model) {
|
|
227
|
+
config = { ...config, model };
|
|
228
|
+
// La scelta esplicita dell'utente diventa la nuova PREFERENZA: cosi' un
|
|
229
|
+
// reloadProviders successivo non la sovrascrive con un ripiego.
|
|
230
|
+
preferredModel = model;
|
|
231
|
+
},
|
|
232
|
+
reloadProviders() {
|
|
233
|
+
// Rilegge le credenziali persistite dal disco e ricostruisce il
|
|
234
|
+
// registro. Le env var gia' presenti nel processo mantengono la
|
|
235
|
+
// precedenza (come all'avvio).
|
|
236
|
+
const fresh = applyStoredCredentials(env);
|
|
237
|
+
providers = defaultRegistry(fresh);
|
|
238
|
+
// Il provider del modello PREFERITO potrebbe essere appena diventato
|
|
239
|
+
// disponibile (l'utente ha inserito la chiave): se ora risolve, ripristina
|
|
240
|
+
// il preferito; altrimenti tieni un ripiego erogabile.
|
|
241
|
+
const startup = resolveStartupModel(providers, preferredModel);
|
|
242
|
+
if (startup.model !== config.model)
|
|
243
|
+
config = { ...config, model: startup.model };
|
|
244
|
+
},
|
|
245
|
+
loadSession(id) {
|
|
246
|
+
const releaseNext = protectStorage(id);
|
|
247
|
+
try {
|
|
248
|
+
session = Session.load(config.sessionDir, id);
|
|
249
|
+
}
|
|
250
|
+
catch (error) {
|
|
251
|
+
releaseNext();
|
|
252
|
+
throw error;
|
|
253
|
+
}
|
|
254
|
+
releaseStorage();
|
|
255
|
+
releaseStorage = releaseNext;
|
|
256
|
+
renewWorkspaceSession();
|
|
257
|
+
return session;
|
|
258
|
+
},
|
|
259
|
+
newSession() {
|
|
260
|
+
session = Session.create(config.sessionDir);
|
|
261
|
+
const releaseNext = protectStorage(session.id);
|
|
262
|
+
releaseStorage();
|
|
263
|
+
releaseStorage = releaseNext;
|
|
264
|
+
renewWorkspaceSession();
|
|
265
|
+
return session;
|
|
266
|
+
},
|
|
267
|
+
deps(confirm) {
|
|
268
|
+
workspaceSession?.update({ label: session.name ?? session.id, model: config.model });
|
|
269
|
+
const resolved = providers.resolve(config.model);
|
|
270
|
+
if (!resolved) {
|
|
271
|
+
const configured = providers.list().map((p) => p.id).join(", ") || "nessuno";
|
|
272
|
+
throw new Error(`impossibile risolvere il modello "${config.model}". ` +
|
|
273
|
+
`Provider configurati: ${configured}. ` +
|
|
274
|
+
`Usa la sintassi provider/modello (es. anthropic/claude-sonnet-4-6) ` +
|
|
275
|
+
`e imposta la chiave d'ambiente del provider.`);
|
|
276
|
+
}
|
|
277
|
+
// Il provider riceve l'id del modello SENZA prefisso provider.
|
|
278
|
+
const runConfig = { ...config, model: resolved.modelId };
|
|
279
|
+
return {
|
|
280
|
+
provider: resolved.provider,
|
|
281
|
+
tools,
|
|
282
|
+
session,
|
|
283
|
+
config: runConfig,
|
|
284
|
+
confirm,
|
|
285
|
+
host,
|
|
286
|
+
env,
|
|
287
|
+
executionTarget,
|
|
288
|
+
...(workspaceSession ? { workspaceSession } : {}),
|
|
289
|
+
...(fsRoots.length || env["TALOS_CONFINE_FS"] === "1" ? { fsRoots } : {}),
|
|
290
|
+
};
|
|
291
|
+
},
|
|
292
|
+
};
|
|
293
|
+
return harness;
|
|
294
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type VibeModeSelection } from "./vibe-modes.js";
|
|
2
|
+
export type CliMode = "tui" | "print" | "rpc" | "doctor" | "work";
|
|
3
|
+
export interface ExtensionFlagArg {
|
|
4
|
+
readonly name: string;
|
|
5
|
+
readonly value?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface CliArgs {
|
|
8
|
+
readonly mode: CliMode;
|
|
9
|
+
readonly model?: string;
|
|
10
|
+
readonly cwd?: string;
|
|
11
|
+
readonly addDirs: readonly string[];
|
|
12
|
+
readonly config?: string;
|
|
13
|
+
readonly json: boolean;
|
|
14
|
+
readonly yolo: boolean;
|
|
15
|
+
readonly prompt?: string;
|
|
16
|
+
readonly promptTemplates: readonly string[];
|
|
17
|
+
readonly skills: readonly string[];
|
|
18
|
+
readonly noSkills: boolean;
|
|
19
|
+
readonly approve?: boolean;
|
|
20
|
+
readonly noApprove?: boolean;
|
|
21
|
+
readonly sessionId?: string;
|
|
22
|
+
readonly continueLast?: boolean;
|
|
23
|
+
readonly resumePicker?: boolean;
|
|
24
|
+
readonly name?: string;
|
|
25
|
+
readonly excludeTools: readonly string[];
|
|
26
|
+
readonly vibeMode?: VibeModeSelection;
|
|
27
|
+
readonly help: boolean;
|
|
28
|
+
readonly version: boolean;
|
|
29
|
+
readonly extensionFlags: readonly ExtensionFlagArg[];
|
|
30
|
+
readonly workList?: boolean;
|
|
31
|
+
readonly workScope?: string;
|
|
32
|
+
readonly workVerify?: string;
|
|
33
|
+
readonly workMax?: number;
|
|
34
|
+
readonly workMinutes?: number;
|
|
35
|
+
}
|
|
36
|
+
export declare class CliArgumentError extends Error {
|
|
37
|
+
readonly exitCode = 2;
|
|
38
|
+
constructor(message: string);
|
|
39
|
+
}
|
|
40
|
+
export declare function parseCliArgs(argv: readonly string[]): CliArgs;
|
|
41
|
+
export declare function cliHelp(): string;
|