@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,417 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
+
import { isAbsolute, join, relative, resolve } from "node:path";
|
|
3
|
+
import { DEFAULT_COMPACTION } from "./compaction.js";
|
|
4
|
+
import { VASCEND_SYSTEM_BLOCK } from "../vascend/runtime.js";
|
|
5
|
+
import { parseVibeMode } from "./vibe-modes.js";
|
|
6
|
+
import { defaultSessionDir, talosConfigDir } from "./env-paths.js";
|
|
7
|
+
import { EXECUTION_GUIDANCE } from "./execution-guidance.js";
|
|
8
|
+
// System prompt deliberatamente minimale: la personalita' e le regole
|
|
9
|
+
// di progetto arrivano da SYSTEM.md / AGENTS.md, non dal harness.
|
|
10
|
+
export const BASE_SYSTEM = `# Vascend Talos
|
|
11
|
+
|
|
12
|
+
INDICE
|
|
13
|
+
1 = agente
|
|
14
|
+
2 = workspace
|
|
15
|
+
3 = strumento
|
|
16
|
+
4 = azione
|
|
17
|
+
|
|
18
|
+
DEFINIZIONI
|
|
19
|
+
@agente[ruolo]: coding_agent in terminale, conciso, diretto
|
|
20
|
+
@workspace[fonte]: ispeziona coi tool invece di indovinare
|
|
21
|
+
@strumento[uso]: read/edit/bash per agire sul workspace, non descrivere
|
|
22
|
+
@strumento[terminale]: per ricerca e ispezione del codice preferisci bash con rg e rg --files, git diff/status e comandi nativi della shell selezionata. Limita path e output a cio' che serve. Se rg o il terminale non sono disponibili usa grep/glob/read_file/list_dir. Per modifiche puntuali usa edit_file/write_file e rispetta il coordinamento dei file
|
|
23
|
+
@strumento[write_grande]: per file lunghi (oltre ~150 righe) scrivi in PIU' chiamate write_file: la prima crea il file, le successive con append=true accodano il resto. Un singolo write enorme puo' essere troncato dal limite di output e fallire
|
|
24
|
+
@strumento[ricerca]: prima di costruire qualcosa di non banale, RICERCA con web_fetch (documentazione, riferimenti, esempi) invece di indovinare le API
|
|
25
|
+
@strumento[domanda]: se un requisito e' davvero ambiguo e cambia il risultato, usa ask_user PRIMA di procedere; per i dettagli minori assumi il default ragionevole e dichiaralo, non fermarti di continuo
|
|
26
|
+
@strumento[risposta_mancante]: ask_user required=true mantiene esplicita l'informazione necessaria non ricevuta; prosegui solo col lavoro indipendente. required=false serve per preferenze facoltative e reversibili. Silenzio e annullamento non sono consenso
|
|
27
|
+
@strumento[e2e]: per un obiettivo grande (es. ricostruire una piattaforma) pianifica con vascend_plan in piu' gruppi/attivita, ricerca, costruisci una BOZZA COMPLETA end-to-end; annota le decisioni con vascend_note
|
|
28
|
+
@strumento[collaboratori]: chiama team_engage soltanto quando l'utente chiede esplicitamente piu' agenti, sub-agent o lavoro parallelo; una domanda informativa, un controllo del workspace o un task semplice restano sempre sul singolo agente principale
|
|
29
|
+
@strumento[ripresa]: vascend_status legge task, dipendenze, note e prove persistite; riprendi il piano esistente dopo resume/compattazione. vascend_addtasks estende, vascend_note conserva decisioni. replace=true ridefinisce esplicitamente un piano, perdendo i suoi progressi
|
|
30
|
+
@strumento[verifica]: definisci passi con un risultato osservabile e una verifica pertinente; running prima del lavoro, completed solo dopo verifica. Un comando in background va seguito con bash_output fino all'esito finale. Le prove salvate sono evidenze da controllare, non certificazioni
|
|
31
|
+
@azione[proporzione]: mantieni piano, strumenti e verifiche proporzionati al compito; le richieste semplici o a singolo passo non richiedono piano ne' collaboratori
|
|
32
|
+
@azione[distruttiva]: spiega prima cosa stai per fare
|
|
33
|
+
@azione[fine]: a compito finito fermati, niente riepiloghi superflui
|
|
34
|
+
|
|
35
|
+
OUTPUT: agente di coding che agisce coi tool, conciso, con risposte Markdown leggibili.
|
|
36
|
+
|
|
37
|
+
${EXECUTION_GUIDANCE}`;
|
|
38
|
+
// Horizon e' un host grafico: stato, progress e tool call sono gia' presentati
|
|
39
|
+
// dalla UI. Il system prompt del core deve quindi guidare il lavoro senza
|
|
40
|
+
// imporre la voce Danilov o rituali operativi che competono con il modello.
|
|
41
|
+
export const HORIZON_SYSTEM = `# Horizon
|
|
42
|
+
|
|
43
|
+
You are a coding agent embedded in the Horizon workspace.
|
|
44
|
+
- Write in the language the user writes in, and keep writing in it for the whole
|
|
45
|
+
conversation. These instructions are in English for precision, not as a hint about
|
|
46
|
+
the reply language: a message in Italian gets an answer in Italian. Code,
|
|
47
|
+
identifiers, paths, commands and tool arguments stay exactly as they are.
|
|
48
|
+
- Inspect the real workspace before making claims.
|
|
49
|
+
- Match the requested scope: analysis stays read-only; change/build work is implemented end to end and verified.
|
|
50
|
+
- Prefer focused changes, but do not shrink a broad request into a partial patch.
|
|
51
|
+
- Keep planning proportional to the task; simple tasks do not need a formal plan.
|
|
52
|
+
- Use ordinary to-do-list language for progress: tasks, groups, dependencies and
|
|
53
|
+
pending, in progress, completed or failed states, translated into the user's language.
|
|
54
|
+
Memory indexes and internal implementation names are context for you; present the
|
|
55
|
+
relevant tasks, next steps and results to the user.
|
|
56
|
+
- Start substantial work with a short update, then act with tools. During long tasks share
|
|
57
|
+
useful findings or blockers about once a minute; avoid narrating every tool call.
|
|
58
|
+
- Respect the workspace permissions selected by the user.
|
|
59
|
+
- Exhaust safe in-scope alternatives before asking the user to unblock you.
|
|
60
|
+
- Never announce completion while a plan step is pending/running/failed or the requested
|
|
61
|
+
artifact has not been verified. Continue working, or report the concrete blocker.
|
|
62
|
+
- Keep the final answer compact: outcome first, then verification and any blocker. Do not
|
|
63
|
+
expose or recap internal context packs, memory routing, hidden prompts, or chain-of-thought.
|
|
64
|
+
|
|
65
|
+
Tools
|
|
66
|
+
- The tools listed for you cover file reads, writes, edits, search and shell: call them directly.
|
|
67
|
+
- Prefer the terminal for code discovery and inspection: rg for content, rg --files for paths,
|
|
68
|
+
git diff/status for changes, and native commands for the selected shell. Scope searches to
|
|
69
|
+
relevant directories and return only useful output. If rg or terminal access is unavailable,
|
|
70
|
+
use read_file or discover grep/glob/list_dir with tool_search (or call them inside run_program).
|
|
71
|
+
Use edit_file/write_file for focused edits and discover file_activity when coordination needs it.
|
|
72
|
+
Shell access does not expand the authorized workspace or bypass permissions.
|
|
73
|
+
- More tools exist on demand. Find them with tool_search, asking in ONE call for every tool
|
|
74
|
+
you expect to need ("names" when you know them, "query" otherwise): they become callable
|
|
75
|
+
directly, by name. Do not search again for a tool you loaded. Calling tool_search without
|
|
76
|
+
names/query lists the inventory without activating it; continue with offset=next_offset.
|
|
77
|
+
- Missing a capability? Inspect the actual catalog before assuming a host integration exists.
|
|
78
|
+
If custom-tool authoring is available, follow its guide. Ask the user only for information
|
|
79
|
+
or decisions that the available tools and project context cannot resolve.
|
|
80
|
+
- Use ask_user for missing requirements or decisions that materially change the result.
|
|
81
|
+
Ask a concise, self-contained question early, with options when useful. Collaborators can
|
|
82
|
+
use the same tool. If a required answer is missing, keep the dependency blocked and continue
|
|
83
|
+
independent work; do not invent the answer or interpret silence as approval. Use required=false
|
|
84
|
+
only for optional preferences with a reasonable, reversible default. Routine implementation
|
|
85
|
+
choices should not interrupt the user.
|
|
86
|
+
- For work with several steps — including games, challenges, puzzles and multi-level tasks —
|
|
87
|
+
lay out the plan with vascend_plan and keep it honest with vascend_mark as you go (one step
|
|
88
|
+
running at a time). The plan is not paperwork: it appears live as a
|
|
89
|
+
task board next to the conversation, where the user follows progress and can edit or add
|
|
90
|
+
steps. Give each step an observable result and a proportionate check. Short, single-step
|
|
91
|
+
requests need no plan. Read vascend_status after resume/compaction and before handing off
|
|
92
|
+
substantial work; resume it only when that is still necessary and authorized by the current
|
|
93
|
+
request. vascend_addtasks extends it without resetting
|
|
94
|
+
progress; vascend_plan with replace=true explicitly replaces it. Save decisions, blockers
|
|
95
|
+
and the next action with vascend_note before switching workstreams.
|
|
96
|
+
- Start a step with vascend_mark status=running. Complete it only after the relevant checks,
|
|
97
|
+
recording paths, commands and observed outcomes. Evidence in the plan is a record to inspect,
|
|
98
|
+
not an automatic correctness certificate. Reopening a step clears old completion evidence.
|
|
99
|
+
Respect after dependencies; use pending to pause a step and failed to record a concrete blocker.
|
|
100
|
+
- A plan is not a collaborator. When the user asks for multiple agents, subagents or parallel
|
|
101
|
+
experts, actually call team_engage: create one collaborator per independent workstream and
|
|
102
|
+
assign its complete task. If vascend_plan already created several task groups, pass their slugs
|
|
103
|
+
through the group field so those collaborators own and update the same T01/T02 tasks. Do not
|
|
104
|
+
merely draw multiple workstreams and then execute all of them in the orchestrator.
|
|
105
|
+
- Issue independent reads together. For related tool sequences use run_program and print only
|
|
106
|
+
the results needed for the next decision; keep dependent edits and approvals sequential.
|
|
107
|
+
- When bash returns a background id, use bash_output until the process exits. Partial output
|
|
108
|
+
or a started process does not mean the check passed. Leave persistent development servers
|
|
109
|
+
running when they are needed and report their status separately from verification results.
|
|
110
|
+
- Act on what is already in context: do not re-read a file or repeat a search whose result
|
|
111
|
+
you still have.
|
|
112
|
+
- If a tool reports a missing or malformed argument, fix the argument shape it names — do not
|
|
113
|
+
retry the same call unchanged.
|
|
114
|
+
|
|
115
|
+
${EXECUTION_GUIDANCE}`;
|
|
116
|
+
// File di contesto a livello progetto, in ordine di priorita'.
|
|
117
|
+
const DEFAULT_CONTEXT_FILES = ["SYSTEM.md", "AGENTS.md", ".talos/SYSTEM.md"];
|
|
118
|
+
const DEFAULT_UI = {
|
|
119
|
+
banner: "vascend-terminal",
|
|
120
|
+
logoLines: [],
|
|
121
|
+
title: "Vascend Talos",
|
|
122
|
+
subtitle: "harness customizzabile per agenti da terminale",
|
|
123
|
+
prompt: "› ",
|
|
124
|
+
accentColor: "cyan",
|
|
125
|
+
mutedColor: "dim",
|
|
126
|
+
showMeta: true,
|
|
127
|
+
theme: "",
|
|
128
|
+
};
|
|
129
|
+
function isRecord(value) {
|
|
130
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
131
|
+
}
|
|
132
|
+
function text(value) {
|
|
133
|
+
return typeof value === "string" && value.length > 0 ? value : undefined;
|
|
134
|
+
}
|
|
135
|
+
function positiveInt(value) {
|
|
136
|
+
const n = typeof value === "number" ? value : typeof value === "string" ? Number(value) : NaN;
|
|
137
|
+
return Number.isInteger(n) && n > 0 ? n : undefined;
|
|
138
|
+
}
|
|
139
|
+
function bool(value) {
|
|
140
|
+
if (typeof value === "boolean")
|
|
141
|
+
return value;
|
|
142
|
+
if (typeof value !== "string")
|
|
143
|
+
return undefined;
|
|
144
|
+
if (/^(1|true|yes|on)$/i.test(value))
|
|
145
|
+
return true;
|
|
146
|
+
if (/^(0|false|no|off)$/i.test(value))
|
|
147
|
+
return false;
|
|
148
|
+
return undefined;
|
|
149
|
+
}
|
|
150
|
+
function textArray(value) {
|
|
151
|
+
if (Array.isArray(value)) {
|
|
152
|
+
const lines = value.filter((item) => typeof item === "string");
|
|
153
|
+
return lines.length ? lines : undefined;
|
|
154
|
+
}
|
|
155
|
+
if (typeof value === "string" && value.trim()) {
|
|
156
|
+
return value.split(/\r?\n|\|/).filter((line) => line.length > 0);
|
|
157
|
+
}
|
|
158
|
+
return undefined;
|
|
159
|
+
}
|
|
160
|
+
function csv(value) {
|
|
161
|
+
if (Array.isArray(value))
|
|
162
|
+
return textArray(value);
|
|
163
|
+
if (typeof value !== "string" || !value.trim())
|
|
164
|
+
return undefined;
|
|
165
|
+
return value.split(",").map((item) => item.trim()).filter(Boolean);
|
|
166
|
+
}
|
|
167
|
+
function color(value) {
|
|
168
|
+
const v = text(value);
|
|
169
|
+
return v && ["blue", "cyan", "dim", "gray", "green", "magenta", "red", "white", "yellow"].includes(v)
|
|
170
|
+
? v
|
|
171
|
+
: undefined;
|
|
172
|
+
}
|
|
173
|
+
function banner(value) {
|
|
174
|
+
const v = text(value);
|
|
175
|
+
return v && ["vascend-terminal", "minimal", "custom", "none"].includes(v) ? v : undefined;
|
|
176
|
+
}
|
|
177
|
+
function effort(value) {
|
|
178
|
+
const v = typeof value === "string" ? value.trim().toLowerCase() : undefined;
|
|
179
|
+
return v && ["", "none", "minimal", "low", "medium", "high", "xhigh", "max"].includes(v) ? v : undefined;
|
|
180
|
+
}
|
|
181
|
+
function permMode(value) {
|
|
182
|
+
const v = typeof value === "string" ? value.trim() : undefined;
|
|
183
|
+
// Migrate the removed mode without changing its permission policy.
|
|
184
|
+
if (v === "autoDanilov")
|
|
185
|
+
return "auto";
|
|
186
|
+
return v && ["normal", "acceptEdits", "auto"].includes(v) ? v : undefined;
|
|
187
|
+
}
|
|
188
|
+
function resolveFrom(cwd, path) {
|
|
189
|
+
return isAbsolute(path) ? path : resolve(cwd, path);
|
|
190
|
+
}
|
|
191
|
+
function inside(base, target) {
|
|
192
|
+
const rel = relative(base, target);
|
|
193
|
+
return rel === "" || (!rel.startsWith("..") && !isAbsolute(rel));
|
|
194
|
+
}
|
|
195
|
+
function loadProjectContext(cwd, contextFiles) {
|
|
196
|
+
const blocks = [];
|
|
197
|
+
for (const name of contextFiles) {
|
|
198
|
+
const p = resolveFrom(cwd, name);
|
|
199
|
+
if (!inside(cwd, p))
|
|
200
|
+
continue;
|
|
201
|
+
if (existsSync(p)) {
|
|
202
|
+
blocks.push(`# Da ${name}\n\n${readFileSync(p, "utf8").trim()}`);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
return blocks.join("\n\n");
|
|
206
|
+
}
|
|
207
|
+
function parseUi(raw) {
|
|
208
|
+
if (!isRecord(raw))
|
|
209
|
+
return undefined;
|
|
210
|
+
return {
|
|
211
|
+
banner: banner(raw["banner"]),
|
|
212
|
+
logoLines: textArray(raw["logoLines"]),
|
|
213
|
+
title: text(raw["title"]),
|
|
214
|
+
subtitle: text(raw["subtitle"]),
|
|
215
|
+
prompt: text(raw["prompt"]),
|
|
216
|
+
accentColor: color(raw["accentColor"]),
|
|
217
|
+
mutedColor: color(raw["mutedColor"]),
|
|
218
|
+
showMeta: bool(raw["showMeta"]),
|
|
219
|
+
theme: text(raw["theme"]),
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
function parseCompaction(raw) {
|
|
223
|
+
if (!isRecord(raw))
|
|
224
|
+
return undefined;
|
|
225
|
+
return {
|
|
226
|
+
enabled: bool(raw["enabled"]),
|
|
227
|
+
reserveTokens: positiveInt(raw["reserveTokens"]),
|
|
228
|
+
keepRecentTokens: positiveInt(raw["keepRecentTokens"]),
|
|
229
|
+
perRoom: bool(raw["perRoom"]),
|
|
230
|
+
roomFanout: positiveInt(raw["roomFanout"]),
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
function parseConfigFile(path) {
|
|
234
|
+
let raw;
|
|
235
|
+
try {
|
|
236
|
+
raw = JSON.parse(readFileSync(path, "utf8"));
|
|
237
|
+
}
|
|
238
|
+
catch (err) {
|
|
239
|
+
// Un config corrotto (es. scrittura troncata da disco pieno) non deve
|
|
240
|
+
// impedire l'avvio: lo si ignora con un avviso e si usano i default.
|
|
241
|
+
process.stderr.write(`[avviso] config ignorata (JSON non valido): ${path} — ${err.message}\n`);
|
|
242
|
+
return {};
|
|
243
|
+
}
|
|
244
|
+
if (!isRecord(raw))
|
|
245
|
+
return {};
|
|
246
|
+
return {
|
|
247
|
+
model: text(raw["model"]),
|
|
248
|
+
maxTokens: positiveInt(raw["maxTokens"]),
|
|
249
|
+
sessionDir: text(raw["sessionDir"]),
|
|
250
|
+
contextFiles: csv(raw["contextFiles"]),
|
|
251
|
+
systemAppend: text(raw["systemAppend"]),
|
|
252
|
+
ui: parseUi(raw["ui"]),
|
|
253
|
+
compaction: parseCompaction(raw["compaction"]),
|
|
254
|
+
contextWindow: positiveInt(raw["contextWindow"]),
|
|
255
|
+
effort: effort(raw["effort"]),
|
|
256
|
+
fast: bool(raw["fast"]),
|
|
257
|
+
permMode: permMode(raw["permMode"]),
|
|
258
|
+
statusLine: Array.isArray(raw["statusLine"]) ? raw["statusLine"].map(String) : undefined,
|
|
259
|
+
vibeMode: parseVibeMode(raw["vibeMode"]),
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
function envPatch(env) {
|
|
263
|
+
return {
|
|
264
|
+
model: text(env["TALOS_MODEL"]),
|
|
265
|
+
maxTokens: positiveInt(env["TALOS_MAX_TOKENS"]),
|
|
266
|
+
sessionDir: text(env["TALOS_SESSION_DIR"]),
|
|
267
|
+
contextFiles: csv(env["TALOS_CONTEXT_FILES"]),
|
|
268
|
+
systemAppend: text(env["TALOS_SYSTEM_APPEND"]),
|
|
269
|
+
ui: {
|
|
270
|
+
banner: banner(env["TALOS_BANNER"]),
|
|
271
|
+
logoLines: textArray(env["TALOS_LOGO_LINES"]),
|
|
272
|
+
title: text(env["TALOS_TITLE"]),
|
|
273
|
+
subtitle: text(env["TALOS_SUBTITLE"]),
|
|
274
|
+
prompt: text(env["TALOS_PROMPT"]),
|
|
275
|
+
accentColor: color(env["TALOS_ACCENT_COLOR"]),
|
|
276
|
+
mutedColor: color(env["TALOS_MUTED_COLOR"]),
|
|
277
|
+
showMeta: bool(env["TALOS_SHOW_META"]),
|
|
278
|
+
theme: text(env["TALOS_THEME"]),
|
|
279
|
+
},
|
|
280
|
+
compaction: {
|
|
281
|
+
enabled: bool(env["TALOS_COMPACTION"]),
|
|
282
|
+
reserveTokens: positiveInt(env["TALOS_RESERVE_TOKENS"]),
|
|
283
|
+
keepRecentTokens: positiveInt(env["TALOS_KEEP_RECENT_TOKENS"]),
|
|
284
|
+
perRoom: bool(env["TALOS_ROOM_MEMORY"]),
|
|
285
|
+
roomFanout: positiveInt(env["TALOS_ROOM_FANOUT"]),
|
|
286
|
+
},
|
|
287
|
+
// TALOS_CONTEXT_WINDOW numerico ha precedenza; TALOS_CONTEXT_1M=1 e' la
|
|
288
|
+
// scorciatoia per la finestra 1M (Opus/Sonnet con beta context-1m).
|
|
289
|
+
contextWindow: positiveInt(env["TALOS_CONTEXT_WINDOW"]) ?? (bool(env["TALOS_CONTEXT_1M"]) ? 1_000_000 : undefined),
|
|
290
|
+
effort: effort(env["TALOS_EFFORT"]),
|
|
291
|
+
fast: bool(env["TALOS_FAST"]),
|
|
292
|
+
permMode: permMode(env["TALOS_PERM_MODE"]),
|
|
293
|
+
vibeMode: parseVibeMode(env["TALOS_VIBE_MODE"]),
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
function mergeCompaction(base, patch) {
|
|
297
|
+
if (!patch)
|
|
298
|
+
return base;
|
|
299
|
+
return {
|
|
300
|
+
enabled: patch.enabled ?? base.enabled,
|
|
301
|
+
reserveTokens: patch.reserveTokens ?? base.reserveTokens,
|
|
302
|
+
keepRecentTokens: patch.keepRecentTokens ?? base.keepRecentTokens,
|
|
303
|
+
perRoom: patch.perRoom ?? base.perRoom,
|
|
304
|
+
roomFanout: patch.roomFanout ?? base.roomFanout,
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
function mergeUi(base, patch) {
|
|
308
|
+
if (!patch)
|
|
309
|
+
return base;
|
|
310
|
+
return {
|
|
311
|
+
banner: patch.banner ?? base.banner,
|
|
312
|
+
logoLines: patch.logoLines ?? base.logoLines,
|
|
313
|
+
title: patch.title ?? base.title,
|
|
314
|
+
subtitle: patch.subtitle ?? base.subtitle,
|
|
315
|
+
prompt: patch.prompt ?? base.prompt,
|
|
316
|
+
accentColor: patch.accentColor ?? base.accentColor,
|
|
317
|
+
mutedColor: patch.mutedColor ?? base.mutedColor,
|
|
318
|
+
showMeta: patch.showMeta ?? base.showMeta,
|
|
319
|
+
theme: patch.theme ?? base.theme,
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
function mergeConfig(base, patch) {
|
|
323
|
+
const systemAppend = patch.systemAppend
|
|
324
|
+
? [base.systemAppend, patch.systemAppend].filter(Boolean).join("\n\n")
|
|
325
|
+
: base.systemAppend;
|
|
326
|
+
return {
|
|
327
|
+
...base,
|
|
328
|
+
model: patch.model ?? base.model,
|
|
329
|
+
maxTokens: patch.maxTokens ?? base.maxTokens,
|
|
330
|
+
sessionDir: patch.sessionDir ?? base.sessionDir,
|
|
331
|
+
contextFiles: patch.contextFiles ?? base.contextFiles,
|
|
332
|
+
systemAppend,
|
|
333
|
+
ui: mergeUi(base.ui, patch.ui),
|
|
334
|
+
compaction: mergeCompaction(base.compaction, patch.compaction),
|
|
335
|
+
contextWindow: patch.contextWindow ?? base.contextWindow,
|
|
336
|
+
effort: patch.effort ?? base.effort,
|
|
337
|
+
fast: patch.fast ?? base.fast,
|
|
338
|
+
permMode: patch.permMode ?? base.permMode,
|
|
339
|
+
statusLine: patch.statusLine ?? base.statusLine,
|
|
340
|
+
vibeMode: patch.vibeMode ?? base.vibeMode,
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
function configFiles(cwd, env) {
|
|
344
|
+
const discovered = [
|
|
345
|
+
env["TALOS_NO_GLOBAL_CONFIG"] === "1" ? undefined : join(talosConfigDir(env), "config.json"),
|
|
346
|
+
join(cwd, "talos.config.json"),
|
|
347
|
+
join(cwd, ".talos", "config.json"),
|
|
348
|
+
].filter((path) => typeof path === "string" && existsSync(path));
|
|
349
|
+
const explicit = text(env["TALOS_CONFIG"]);
|
|
350
|
+
if (!explicit)
|
|
351
|
+
return discovered;
|
|
352
|
+
const explicitPath = resolveFrom(cwd, explicit);
|
|
353
|
+
if (!existsSync(explicitPath))
|
|
354
|
+
throw new Error(`config Talos non trovata: ${explicitPath}`);
|
|
355
|
+
return [...discovered, explicitPath];
|
|
356
|
+
}
|
|
357
|
+
function applyConfigFiles(cwd, env, initial) {
|
|
358
|
+
return configFiles(cwd, env).reduce((acc, file) => {
|
|
359
|
+
const patch = parseConfigFile(file);
|
|
360
|
+
const next = mergeConfig(acc, patch);
|
|
361
|
+
return { ...next, loadedConfigFiles: [...next.loadedConfigFiles, file] };
|
|
362
|
+
}, initial);
|
|
363
|
+
}
|
|
364
|
+
export function buildConfig(opts) {
|
|
365
|
+
const cwd = resolve(opts.cwd ?? process.cwd());
|
|
366
|
+
const base = {
|
|
367
|
+
model: "anthropic/claude-sonnet-4-6",
|
|
368
|
+
// 0 = AUTO: il provider usa il massimo di output del modello (niente tetto
|
|
369
|
+
// fisso che troncherebbe i file lunghi). Override con maxTokens nel config.
|
|
370
|
+
maxTokens: 0,
|
|
371
|
+
sessionDir: defaultSessionDir(cwd, opts.env),
|
|
372
|
+
contextFiles: DEFAULT_CONTEXT_FILES,
|
|
373
|
+
systemAppend: "",
|
|
374
|
+
loadedConfigFiles: [],
|
|
375
|
+
ui: DEFAULT_UI,
|
|
376
|
+
compaction: DEFAULT_COMPACTION,
|
|
377
|
+
contextWindow: 0,
|
|
378
|
+
effort: "",
|
|
379
|
+
fast: false,
|
|
380
|
+
permMode: "normal",
|
|
381
|
+
vibeMode: "auto",
|
|
382
|
+
};
|
|
383
|
+
const withFiles = applyConfigFiles(cwd, opts.env, base);
|
|
384
|
+
const withEnv = mergeConfig(withFiles, envPatch(opts.env));
|
|
385
|
+
const finalConfig = mergeConfig(withEnv, { model: opts.model });
|
|
386
|
+
const projectCtx = loadProjectContext(cwd, finalConfig.contextFiles);
|
|
387
|
+
const hostProfile = opts.env["TALOS_HOST_PROFILE"]?.trim().toLowerCase() ?? "";
|
|
388
|
+
const horizonHost = hostProfile === "horizon";
|
|
389
|
+
// Talos e' il CLI di Horizon: la chat del terminale usa la STESSA guida della
|
|
390
|
+
// chat di Horizon (voce naturale, piano via vascend_plan/board, tool file).
|
|
391
|
+
// Il system nativo in notazione Danilov resta raggiungibile con
|
|
392
|
+
// TALOS_HOST_PROFILE=danilov per i flussi che parlano in notazione.
|
|
393
|
+
// Legacy host profiles now use the standard conversational interface.
|
|
394
|
+
const system = [
|
|
395
|
+
HORIZON_SYSTEM,
|
|
396
|
+
projectCtx ? `---\n\n${projectCtx}` : "",
|
|
397
|
+
finalConfig.systemAppend ? `---\n\n# Da configurazione Talos\n\n${finalConfig.systemAppend}` : "",
|
|
398
|
+
].filter(Boolean).join("\n\n");
|
|
399
|
+
return {
|
|
400
|
+
cwd,
|
|
401
|
+
model: finalConfig.model,
|
|
402
|
+
maxTokens: finalConfig.maxTokens,
|
|
403
|
+
system,
|
|
404
|
+
autoDelegatePlans: horizonHost,
|
|
405
|
+
sessionDir: resolveFrom(cwd, finalConfig.sessionDir),
|
|
406
|
+
contextFiles: finalConfig.contextFiles,
|
|
407
|
+
loadedConfigFiles: finalConfig.loadedConfigFiles,
|
|
408
|
+
ui: finalConfig.ui,
|
|
409
|
+
compaction: finalConfig.compaction,
|
|
410
|
+
contextWindow: finalConfig.contextWindow,
|
|
411
|
+
effort: finalConfig.effort,
|
|
412
|
+
fast: finalConfig.fast,
|
|
413
|
+
permMode: finalConfig.permMode,
|
|
414
|
+
statusLine: finalConfig.statusLine,
|
|
415
|
+
vibeMode: finalConfig.vibeMode,
|
|
416
|
+
};
|
|
417
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import type { Message, ToolDef } from "./types.js";
|
|
2
|
+
export interface ContextBlockInput {
|
|
3
|
+
readonly key: string;
|
|
4
|
+
readonly label: string;
|
|
5
|
+
readonly text?: string;
|
|
6
|
+
readonly tokens?: number;
|
|
7
|
+
readonly cacheable?: boolean;
|
|
8
|
+
readonly detail?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ContextSlice {
|
|
11
|
+
readonly key: string;
|
|
12
|
+
readonly label: string;
|
|
13
|
+
readonly tokens: number;
|
|
14
|
+
readonly share: number;
|
|
15
|
+
readonly cacheable: boolean;
|
|
16
|
+
readonly detail?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface ContextHeavyItem {
|
|
19
|
+
readonly kind: "tool_result" | "tool_call" | "text" | "image";
|
|
20
|
+
readonly label: string;
|
|
21
|
+
readonly tokens: number;
|
|
22
|
+
readonly role: string;
|
|
23
|
+
}
|
|
24
|
+
export interface ContextHistoryStats {
|
|
25
|
+
readonly messages: number;
|
|
26
|
+
readonly textTokens: number;
|
|
27
|
+
readonly toolCallTokens: number;
|
|
28
|
+
readonly toolResultTokens: number;
|
|
29
|
+
readonly toolResults: number;
|
|
30
|
+
readonly images: number;
|
|
31
|
+
readonly imageTokens: number;
|
|
32
|
+
}
|
|
33
|
+
export interface ContextPackStats {
|
|
34
|
+
readonly tokens: number;
|
|
35
|
+
readonly selected: number;
|
|
36
|
+
readonly dropped: number;
|
|
37
|
+
readonly utility?: number;
|
|
38
|
+
readonly staleRate?: number;
|
|
39
|
+
}
|
|
40
|
+
export interface ContextLedger {
|
|
41
|
+
readonly admission?: {
|
|
42
|
+
readonly estimatedInputTokens: number;
|
|
43
|
+
readonly calibration: number;
|
|
44
|
+
readonly outputTokens: number;
|
|
45
|
+
readonly fits: boolean;
|
|
46
|
+
};
|
|
47
|
+
readonly at: number;
|
|
48
|
+
readonly model: string;
|
|
49
|
+
readonly turn: number;
|
|
50
|
+
readonly window: number;
|
|
51
|
+
readonly reserve: number;
|
|
52
|
+
readonly compactAt: number;
|
|
53
|
+
readonly tokens: number;
|
|
54
|
+
readonly fraction: number;
|
|
55
|
+
readonly pressure: number;
|
|
56
|
+
readonly cacheable: number;
|
|
57
|
+
readonly volatile: number;
|
|
58
|
+
readonly slices: readonly ContextSlice[];
|
|
59
|
+
readonly history: ContextHistoryStats;
|
|
60
|
+
readonly tools: {
|
|
61
|
+
readonly total: number;
|
|
62
|
+
readonly tokens: number;
|
|
63
|
+
};
|
|
64
|
+
readonly compaction: {
|
|
65
|
+
readonly at: number;
|
|
66
|
+
readonly tokensBefore: number;
|
|
67
|
+
readonly summaryTokens: number;
|
|
68
|
+
} | null;
|
|
69
|
+
readonly heaviest: readonly ContextHeavyItem[];
|
|
70
|
+
readonly pack: ContextPackStats | null;
|
|
71
|
+
readonly demoted: {
|
|
72
|
+
readonly count: number;
|
|
73
|
+
readonly freedTokens: number;
|
|
74
|
+
} | null;
|
|
75
|
+
}
|
|
76
|
+
export interface ContextLedgerInput {
|
|
77
|
+
readonly model: string;
|
|
78
|
+
readonly turn?: number;
|
|
79
|
+
readonly contextWindow?: number;
|
|
80
|
+
readonly reserveTokens?: number;
|
|
81
|
+
readonly workingContextTokens?: number;
|
|
82
|
+
readonly system: string;
|
|
83
|
+
readonly systemBlocks?: readonly ContextBlockInput[];
|
|
84
|
+
readonly turnBlocks?: readonly ContextBlockInput[];
|
|
85
|
+
readonly tools?: readonly ToolDef[];
|
|
86
|
+
readonly messages?: readonly Message[];
|
|
87
|
+
readonly compaction?: {
|
|
88
|
+
readonly ts: number;
|
|
89
|
+
readonly tokensBefore: number;
|
|
90
|
+
readonly summary: string;
|
|
91
|
+
} | null;
|
|
92
|
+
readonly pack?: ContextPackStats | null;
|
|
93
|
+
readonly demoted?: {
|
|
94
|
+
readonly count: number;
|
|
95
|
+
readonly freedTokens: number;
|
|
96
|
+
} | null;
|
|
97
|
+
readonly now?: number;
|
|
98
|
+
}
|
|
99
|
+
export declare function buildContextLedger(input: ContextLedgerInput): ContextLedger;
|