@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,51 @@
|
|
|
1
|
+
import type { RegisteredTool, Tool, ToolDef } from "../core/types.js";
|
|
2
|
+
export interface ToolRegistryOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Quando presente, solo questi tool entrano in defs(). Tutti gli altri
|
|
5
|
+
* restano nel medesimo registro ma diventano deferred, quindi sono
|
|
6
|
+
* raggiungibili tramite i meta-tool di discovery.
|
|
7
|
+
*/
|
|
8
|
+
readonly directTools?: ReadonlySet<string>;
|
|
9
|
+
readonly compact?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface ToolScope {
|
|
12
|
+
readonly allow?: readonly string[];
|
|
13
|
+
readonly deny?: readonly string[];
|
|
14
|
+
}
|
|
15
|
+
export declare class ToolRegistry {
|
|
16
|
+
private readonly options;
|
|
17
|
+
private readonly tools;
|
|
18
|
+
private readonly deferred;
|
|
19
|
+
private readonly baselineDeferred;
|
|
20
|
+
private phase;
|
|
21
|
+
private definitions;
|
|
22
|
+
private deferredDefinitions;
|
|
23
|
+
private readonly identity;
|
|
24
|
+
private generation;
|
|
25
|
+
get revision(): string;
|
|
26
|
+
get compact(): boolean;
|
|
27
|
+
private invalidate;
|
|
28
|
+
constructor(options?: ToolRegistryOptions);
|
|
29
|
+
register(tool: Tool, deferred?: boolean): void;
|
|
30
|
+
remove(name: string): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Promuove un tool del catalogo fra quelli diretti per il resto del giro.
|
|
33
|
+
*
|
|
34
|
+
* Serve a tool_search: prima la ricerca incollava lo schema completo nella
|
|
35
|
+
* CONVERSAZIONE (fuori dalla cache del prompt, e per sempre), quindi cercare
|
|
36
|
+
* tre volte significava pagare tre volte gli stessi schemi. Promuovendo, lo
|
|
37
|
+
* schema entra UNA volta nella lista strumenti — che sta nel prefisso
|
|
38
|
+
* cacheabile — e il messaggio di risposta resta una riga per tool.
|
|
39
|
+
*/
|
|
40
|
+
promote(name: string): boolean;
|
|
41
|
+
get(name: string): RegisteredTool | undefined;
|
|
42
|
+
isDeferred(name: string): boolean;
|
|
43
|
+
defs(): readonly ToolDef[];
|
|
44
|
+
catalog(): readonly ToolDef[];
|
|
45
|
+
names(): readonly string[];
|
|
46
|
+
setActive(names: readonly string[]): void;
|
|
47
|
+
/** Discovery promotions remain stable until the task epoch changes. */
|
|
48
|
+
enterPhase(phase: string): void;
|
|
49
|
+
activeNames(): readonly string[];
|
|
50
|
+
scoped(scope?: ToolScope): ToolRegistry;
|
|
51
|
+
}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { isToolVisibleToModel, toolInputSchema } from "../mcp/protocol.js";
|
|
2
|
+
import { randomBytes } from "node:crypto";
|
|
3
|
+
import { NATIVE_CALL_TOOLS, PROTOCOL_TOOLS } from "./capabilities.js";
|
|
4
|
+
// Registro degli strumenti. L'agente espone al modello solo i ToolDef dei tool
|
|
5
|
+
// CORE; l'esecuzione passa sempre da qui (single choke point per i permessi).
|
|
6
|
+
// I tool DEFERRED (catalogo) non entrano in defs() — quindi non occupano il
|
|
7
|
+
// system prompt — ma sono scopribili/eseguibili via i meta-tool (tool_search/
|
|
8
|
+
// tool_invoke). Cosi' il contesto resta leggero anche con molti tool.
|
|
9
|
+
export class ToolRegistry {
|
|
10
|
+
options;
|
|
11
|
+
tools = new Map();
|
|
12
|
+
deferred = new Set();
|
|
13
|
+
baselineDeferred = new Set();
|
|
14
|
+
phase;
|
|
15
|
+
definitions = null;
|
|
16
|
+
deferredDefinitions = null;
|
|
17
|
+
identity = randomBytes(8).toString("hex");
|
|
18
|
+
generation = 0;
|
|
19
|
+
get revision() { return `${this.identity}.${this.generation}`; }
|
|
20
|
+
get compact() { return this.options.compact === true; }
|
|
21
|
+
invalidate() {
|
|
22
|
+
this.definitions = null;
|
|
23
|
+
this.deferredDefinitions = null;
|
|
24
|
+
}
|
|
25
|
+
constructor(options = {}) {
|
|
26
|
+
this.options = options;
|
|
27
|
+
}
|
|
28
|
+
register(tool, deferred = false) {
|
|
29
|
+
const inputSchema = toolInputSchema(tool);
|
|
30
|
+
const normalized = { ...tool, inputSchema, schema: inputSchema };
|
|
31
|
+
this.tools.set(tool.name, normalized);
|
|
32
|
+
this.generation++;
|
|
33
|
+
this.invalidate();
|
|
34
|
+
if (this.compact) {
|
|
35
|
+
const direct = PROTOCOL_TOOLS.has(tool.name) || NATIVE_CALL_TOOLS.has(tool.name) || tool.requiresNativeCall;
|
|
36
|
+
if (direct) {
|
|
37
|
+
this.deferred.delete(tool.name);
|
|
38
|
+
this.baselineDeferred.delete(tool.name);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
this.deferred.add(tool.name);
|
|
42
|
+
this.baselineDeferred.add(tool.name);
|
|
43
|
+
}
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
// Con una policy dell'host (directTools) decide SOLO l'appartenenza
|
|
47
|
+
// all'insieme diretto: sostituisce la selezione storica del chiamante nei
|
|
48
|
+
// due versi, altrimenti un tool dell'hot set che l'host vuole diretto
|
|
49
|
+
// resterebbe deferred perche' la CLI lo classifica come on demand.
|
|
50
|
+
if (this.options.directTools !== undefined) {
|
|
51
|
+
if (this.options.directTools.has(tool.name))
|
|
52
|
+
this.deferred.delete(tool.name);
|
|
53
|
+
else
|
|
54
|
+
this.deferred.add(tool.name);
|
|
55
|
+
if (this.deferred.has(tool.name))
|
|
56
|
+
this.baselineDeferred.add(tool.name);
|
|
57
|
+
else
|
|
58
|
+
this.baselineDeferred.delete(tool.name);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
if (deferred)
|
|
62
|
+
this.deferred.add(tool.name);
|
|
63
|
+
else
|
|
64
|
+
this.deferred.delete(tool.name);
|
|
65
|
+
if (deferred)
|
|
66
|
+
this.baselineDeferred.add(tool.name);
|
|
67
|
+
else
|
|
68
|
+
this.baselineDeferred.delete(tool.name);
|
|
69
|
+
}
|
|
70
|
+
// Rimuove uno strumento (es. --exclude-tools). No-op se assente.
|
|
71
|
+
remove(name) {
|
|
72
|
+
this.deferred.delete(name);
|
|
73
|
+
this.baselineDeferred.delete(name);
|
|
74
|
+
const removed = this.tools.delete(name);
|
|
75
|
+
if (removed) {
|
|
76
|
+
this.generation++;
|
|
77
|
+
this.invalidate();
|
|
78
|
+
}
|
|
79
|
+
return removed;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Promuove un tool del catalogo fra quelli diretti per il resto del giro.
|
|
83
|
+
*
|
|
84
|
+
* Serve a tool_search: prima la ricerca incollava lo schema completo nella
|
|
85
|
+
* CONVERSAZIONE (fuori dalla cache del prompt, e per sempre), quindi cercare
|
|
86
|
+
* tre volte significava pagare tre volte gli stessi schemi. Promuovendo, lo
|
|
87
|
+
* schema entra UNA volta nella lista strumenti — che sta nel prefisso
|
|
88
|
+
* cacheabile — e il messaggio di risposta resta una riga per tool.
|
|
89
|
+
*/
|
|
90
|
+
promote(name) {
|
|
91
|
+
if (this.compact)
|
|
92
|
+
return false;
|
|
93
|
+
if (!this.tools.has(name) || !this.deferred.has(name))
|
|
94
|
+
return false;
|
|
95
|
+
this.deferred.delete(name);
|
|
96
|
+
this.invalidate();
|
|
97
|
+
return true;
|
|
98
|
+
}
|
|
99
|
+
get(name) {
|
|
100
|
+
return this.tools.get(name === "vascend_addrooms" ? "vascend_addtasks" : name);
|
|
101
|
+
}
|
|
102
|
+
isDeferred(name) {
|
|
103
|
+
return this.deferred.has(name);
|
|
104
|
+
}
|
|
105
|
+
// Tool esposti al modello: solo i CORE (non deferred).
|
|
106
|
+
defs() {
|
|
107
|
+
return this.definitions ??= Object.freeze([...this.tools.values()]
|
|
108
|
+
.filter((t) => !this.deferred.has(t.name) && isToolVisibleToModel(t._meta))
|
|
109
|
+
.map((tool) => Object.freeze(toolDefinition(tool))));
|
|
110
|
+
}
|
|
111
|
+
// Catalogo dei tool DEFERRED (scopribili via tool_search): name+description+schema.
|
|
112
|
+
catalog() {
|
|
113
|
+
return this.deferredDefinitions ??= Object.freeze([...this.tools.values()]
|
|
114
|
+
.filter((t) => this.deferred.has(t.name) && isToolVisibleToModel(t._meta))
|
|
115
|
+
.map((tool) => Object.freeze(toolDefinition(tool))));
|
|
116
|
+
}
|
|
117
|
+
names() {
|
|
118
|
+
return [...this.tools.keys()];
|
|
119
|
+
}
|
|
120
|
+
// Le estensioni Pi possono cambiare l'hot set dei tool durante la sessione.
|
|
121
|
+
// Gli strumenti non selezionati restano installati e scopribili, ma non
|
|
122
|
+
// occupano il prompt del modello.
|
|
123
|
+
setActive(names) {
|
|
124
|
+
if (this.compact)
|
|
125
|
+
return; // The compact surface is stable; scopes use scoped().
|
|
126
|
+
const active = new Set(names);
|
|
127
|
+
let changed = false;
|
|
128
|
+
for (const name of this.tools.keys()) {
|
|
129
|
+
if (active.has(name) === this.deferred.has(name))
|
|
130
|
+
changed = true;
|
|
131
|
+
if (active.has(name))
|
|
132
|
+
this.deferred.delete(name);
|
|
133
|
+
else
|
|
134
|
+
this.deferred.add(name);
|
|
135
|
+
}
|
|
136
|
+
this.baselineDeferred.clear();
|
|
137
|
+
for (const name of this.deferred)
|
|
138
|
+
this.baselineDeferred.add(name);
|
|
139
|
+
if (changed)
|
|
140
|
+
this.invalidate();
|
|
141
|
+
}
|
|
142
|
+
/** Discovery promotions remain stable until the task epoch changes. */
|
|
143
|
+
enterPhase(phase) {
|
|
144
|
+
if (this.phase === phase)
|
|
145
|
+
return;
|
|
146
|
+
if (this.phase !== undefined) {
|
|
147
|
+
this.deferred.clear();
|
|
148
|
+
for (const name of this.baselineDeferred)
|
|
149
|
+
this.deferred.add(name);
|
|
150
|
+
this.invalidate();
|
|
151
|
+
}
|
|
152
|
+
this.phase = phase;
|
|
153
|
+
}
|
|
154
|
+
activeNames() {
|
|
155
|
+
return [...this.tools.keys()].filter((name) => !this.deferred.has(name));
|
|
156
|
+
}
|
|
157
|
+
// Vista immutabile del registro per un singolo collaboratore. Non rimuove
|
|
158
|
+
// nulla dal registro dell'orchestratore e conserva la classificazione
|
|
159
|
+
// direct/deferred dei tool inclusi.
|
|
160
|
+
scoped(scope = {}) {
|
|
161
|
+
const allow = scope.allow && scope.allow.length ? new Set(scope.allow) : null;
|
|
162
|
+
const deny = new Set(scope.deny ?? []);
|
|
163
|
+
const compact = this.compact && [...PROTOCOL_TOOLS].every(name => this.get(name) && !deny.has(name));
|
|
164
|
+
const next = new ToolRegistry({ compact });
|
|
165
|
+
for (const [name, tool] of this.tools) {
|
|
166
|
+
if ((allow && !allow.has(name) && !(compact && PROTOCOL_TOOLS.has(name))) || deny.has(name))
|
|
167
|
+
continue;
|
|
168
|
+
next.register(tool, this.compact && !compact ? false : this.deferred.has(name));
|
|
169
|
+
}
|
|
170
|
+
return next;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
function toolDefinition(tool) {
|
|
174
|
+
return {
|
|
175
|
+
name: tool.name,
|
|
176
|
+
...(tool.title ? { title: tool.title } : {}),
|
|
177
|
+
description: tool.description,
|
|
178
|
+
inputSchema: tool.inputSchema,
|
|
179
|
+
// Alias temporaneo per host/estensioni Talos precedenti a MCP 2026-07-28.
|
|
180
|
+
schema: tool.inputSchema,
|
|
181
|
+
...(tool.outputSchema ? { outputSchema: tool.outputSchema } : {}),
|
|
182
|
+
...(tool.annotations ? { annotations: tool.annotations } : {}),
|
|
183
|
+
...(tool._meta ? { _meta: tool._meta } : {}),
|
|
184
|
+
};
|
|
185
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { estimateTokens } from "../core/compaction.js";
|
|
2
|
+
import { nativeCall, protocolCatalog, protocolError, protocolResult } from "./protocol-catalog.js";
|
|
3
|
+
import { PROTOCOL_TOOLS } from "./capabilities.js";
|
|
4
|
+
import { DISCOVERY_TOOL_NAMES } from "./discovery.js";
|
|
5
|
+
function strings(input) {
|
|
6
|
+
if (input === undefined)
|
|
7
|
+
return [];
|
|
8
|
+
if (!Array.isArray(input) || input.length > 24 || input.some(item => typeof item !== "string" || !item.trim()))
|
|
9
|
+
return;
|
|
10
|
+
return [...new Set(input.map(value => value.trim()))];
|
|
11
|
+
}
|
|
12
|
+
function integer(input, fallback, min, max) {
|
|
13
|
+
if (input === undefined)
|
|
14
|
+
return fallback;
|
|
15
|
+
return typeof input === "number" && Number.isSafeInteger(input) && input >= min && input <= max ? input : undefined;
|
|
16
|
+
}
|
|
17
|
+
function bounded(data, budget, error = false) {
|
|
18
|
+
const estimatedTokens = estimateTokens(JSON.stringify(data));
|
|
19
|
+
if (estimatedTokens > budget)
|
|
20
|
+
return protocolError("budget_exceeded", "Request fewer capabilities/names, a smaller inventory page, or increase schema_budget.", { required_tokens: estimatedTokens, schema_budget: budget });
|
|
21
|
+
return protocolResult(data, error);
|
|
22
|
+
}
|
|
23
|
+
export const resolveTool = {
|
|
24
|
+
name: "resolve",
|
|
25
|
+
execution: "parallel",
|
|
26
|
+
description: "Resolve exact capability IDs or tool names into reusable input contracts and a catalog revision. "
|
|
27
|
+
+ "Interpret the user's language yourself; capabilities are stable IDs, not natural-language queries. "
|
|
28
|
+
+ "Batch everything needed. No arguments lists families; namespace lists operations (tools lists all tools). "
|
|
29
|
+
+ "Follow next_offset for pages. Does not execute or activate tools. Reuse contracts with execute.",
|
|
30
|
+
schema: { type: "object", properties: {
|
|
31
|
+
capabilities: { type: "array", items: { type: "string" }, maxItems: 24 },
|
|
32
|
+
names: { type: "array", items: { type: "string" }, maxItems: 24 },
|
|
33
|
+
namespace: { type: "string" }, offset: { type: "integer", minimum: 0 },
|
|
34
|
+
limit: { type: "integer", minimum: 1, maximum: 50 },
|
|
35
|
+
schema_budget: { type: "integer", minimum: 100, maximum: 32000, description: "Estimated tokens, default 4000" },
|
|
36
|
+
} },
|
|
37
|
+
handler: async (input, ctx) => resolve(input, ctx),
|
|
38
|
+
};
|
|
39
|
+
function resolve(input, ctx) {
|
|
40
|
+
if (ctx.signal.aborted)
|
|
41
|
+
return protocolError("cancelled", "Resolution cancelled.");
|
|
42
|
+
if (!ctx.tools)
|
|
43
|
+
return protocolError("unavailable", "Tool registry unavailable.");
|
|
44
|
+
const capabilities = strings(input["capabilities"]);
|
|
45
|
+
const requested = strings(input["names"]);
|
|
46
|
+
const offset = integer(input["offset"], 0, 0, Number.MAX_SAFE_INTEGER);
|
|
47
|
+
const limit = integer(input["limit"], 30, 1, 50);
|
|
48
|
+
const budget = integer(input["schema_budget"], 4000, 100, 32000);
|
|
49
|
+
if (!capabilities || !requested || offset === undefined || limit === undefined || budget === undefined
|
|
50
|
+
|| input["namespace"] !== undefined && typeof input["namespace"] !== "string") {
|
|
51
|
+
return protocolError("invalid_input", "Use arrays of up to 24 exact IDs/names and integer limits within the schema.");
|
|
52
|
+
}
|
|
53
|
+
const namespace = String(input["namespace"] ?? "").trim();
|
|
54
|
+
const catalog = protocolCatalog(ctx.tools);
|
|
55
|
+
if (!capabilities.length && !requested.length) {
|
|
56
|
+
const rows = namespace === "tools"
|
|
57
|
+
? [...catalog.tools.values()].filter(tool => !PROTOCOL_TOOLS.has(tool.name)).map(tool => ({
|
|
58
|
+
name: tool.name, description: tool.description.replace(/\s+/g, " ").slice(0, 180),
|
|
59
|
+
capabilities: ctx.tools.get(tool.name)?.capabilities ?? [],
|
|
60
|
+
}))
|
|
61
|
+
: namespace
|
|
62
|
+
? [...catalog.capabilities.keys()].filter(cap => cap.startsWith(`${namespace}.`)).sort()
|
|
63
|
+
: [...new Set([...catalog.capabilities.keys()].map(cap => cap.split(".")[0])), "tools"].sort();
|
|
64
|
+
const end = Math.min(offset + limit, rows.length);
|
|
65
|
+
return bounded({ status: "inventory", revision: catalog.revision, namespace: namespace || "families",
|
|
66
|
+
entries: rows.slice(offset, end), total: rows.length, next_offset: end < rows.length ? end : null }, budget);
|
|
67
|
+
}
|
|
68
|
+
if (namespace || offset)
|
|
69
|
+
return protocolError("invalid_input", "Namespace and offset apply only to inventory listing.");
|
|
70
|
+
const unknown = capabilities.filter(cap => !catalog.capabilities.has(cap));
|
|
71
|
+
const names = new Set([...requested, ...capabilities.flatMap(cap => catalog.capabilities.get(cap) ?? [])]);
|
|
72
|
+
const unavailable = [...names].filter(name => !catalog.tools.has(name) || PROTOCOL_TOOLS.has(name));
|
|
73
|
+
// Continuation graph: walk once, include whole contracts, never run the continuation.
|
|
74
|
+
const pending = [...names].filter(name => !unavailable.includes(name));
|
|
75
|
+
const included = new Set();
|
|
76
|
+
const missingContinuations = new Set();
|
|
77
|
+
for (let cursor = 0; cursor < pending.length; cursor++) {
|
|
78
|
+
const name = pending[cursor];
|
|
79
|
+
if (included.has(name))
|
|
80
|
+
continue;
|
|
81
|
+
included.add(name);
|
|
82
|
+
for (const next of ctx.tools.get(name)?.continuations ?? []) {
|
|
83
|
+
if (!catalog.tools.has(next) || PROTOCOL_TOOLS.has(next))
|
|
84
|
+
missingContinuations.add(next);
|
|
85
|
+
else if (!included.has(next))
|
|
86
|
+
pending.push(next);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
const contracts = [...included].map(name => {
|
|
90
|
+
const def = catalog.tools.get(name);
|
|
91
|
+
const tool = ctx.tools.get(name);
|
|
92
|
+
return { name, description: def.description, inputSchema: def.inputSchema,
|
|
93
|
+
...(def.outputSchema ? { outputSchema: def.outputSchema } : {}),
|
|
94
|
+
...(def.annotations ? { annotations: def.annotations } : {}),
|
|
95
|
+
...(def._meta ? { _meta: def._meta } : {}),
|
|
96
|
+
mode: nativeCall(tool) ? "native" : name === "run_program" ? "program"
|
|
97
|
+
: name === "tool_invoke" ? "legacy" : DISCOVERY_TOOL_NAMES.has(name) ? "call" : "call_or_program",
|
|
98
|
+
continuations: tool.continuations ?? [] };
|
|
99
|
+
});
|
|
100
|
+
const incomplete = unknown.length > 0 || unavailable.length > 0 || missingContinuations.size > 0;
|
|
101
|
+
return bounded({ status: incomplete ? contracts.length ? "partial" : "unavailable" : "ready",
|
|
102
|
+
revision: catalog.revision, contracts,
|
|
103
|
+
...(unknown.length ? { unknown_capabilities: unknown, hint: "List a namespace or use exact names; availability is catalog-scoped." } : {}),
|
|
104
|
+
...(unavailable.length ? { unavailable_tools: unavailable } : {}),
|
|
105
|
+
...(missingContinuations.size ? { unavailable_continuations: [...missingContinuations] } : {}),
|
|
106
|
+
}, budget, incomplete);
|
|
107
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Python's legacy Windows encoding can truncate a file before failing to write Unicode. */
|
|
2
|
+
export function shellEnvironment(env = process.env, platform = process.platform) {
|
|
3
|
+
if (platform !== "win32" || env["PYTHONUTF8"] !== undefined)
|
|
4
|
+
return env;
|
|
5
|
+
// Inherited by Python launched from bash, cmd or PowerShell; preserve explicit overrides.
|
|
6
|
+
return { ...env, PYTHONUTF8: "1" };
|
|
7
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { posix } from "node:path";
|
|
2
|
+
import { VascendPlanStore } from "../vascend/plan-store.js";
|
|
3
|
+
import { validateTeamGraph } from "../vascend/team-scheduler.js";
|
|
4
|
+
import { planBlockers } from "../vascend/plan-progress.js";
|
|
5
|
+
export function memberSlug(value) {
|
|
6
|
+
return value.trim().toLowerCase().replace(/[^a-z0-9_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
7
|
+
}
|
|
8
|
+
export function parseTeamMembers(raw, ctx) {
|
|
9
|
+
if (!Array.isArray(raw) || !raw.length || raw.length > 32)
|
|
10
|
+
throw new Error("members richiede da 1 a 32 collaboratori");
|
|
11
|
+
const members = raw.map((value) => {
|
|
12
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
13
|
+
throw new Error("ogni collaboratore deve essere un oggetto");
|
|
14
|
+
const m = value;
|
|
15
|
+
const slug = memberSlug(string(m, "slug"));
|
|
16
|
+
const goal = string(m, "mandate");
|
|
17
|
+
const castle = string(m, "group") || string(m, "castle");
|
|
18
|
+
if (!slug || (!goal && !castle))
|
|
19
|
+
throw new Error("ogni collaboratore richiede slug e mandate oppure group");
|
|
20
|
+
const effort = string(m, "effort").toLowerCase();
|
|
21
|
+
if (effort && !["low", "medium", "high", "max"].includes(effort))
|
|
22
|
+
throw new Error(`effort non valido: ${effort}`);
|
|
23
|
+
const after = list(m, "after").map(memberSlug);
|
|
24
|
+
if (after.some((slug) => !slug))
|
|
25
|
+
throw new Error("dipendenza senza slug valido");
|
|
26
|
+
const area = list(m, "area").map((path) => posix.normalize(path.replaceAll("\\", "/")));
|
|
27
|
+
if (area.some((path) => /[*?\[\]{}]/.test(path)))
|
|
28
|
+
throw new Error("area richiede percorsi, non glob");
|
|
29
|
+
const tasks = list(m, "tasks");
|
|
30
|
+
if (tasks.length && !castle)
|
|
31
|
+
throw new Error("tasks richiede group");
|
|
32
|
+
const tools = m["tools"];
|
|
33
|
+
if (tools !== undefined && (!tools || typeof tools !== "object" || Array.isArray(tools)))
|
|
34
|
+
throw new Error("tools deve essere un oggetto allow/deny");
|
|
35
|
+
return {
|
|
36
|
+
slug, goal,
|
|
37
|
+
...(castle ? { castle } : {}), ...(tasks.length ? { tasks } : {}),
|
|
38
|
+
...(area.length ? { area } : {}), ...(after.length ? { after: [...new Set(after)] } : {}),
|
|
39
|
+
...(string(m, "parent") ? { parent: string(m, "parent") } : {}),
|
|
40
|
+
...(string(m, "role") ? { role: string(m, "role") } : {}),
|
|
41
|
+
...(string(m, "model") ? { model: string(m, "model") } : {}),
|
|
42
|
+
...(effort ? { effort } : {}), ...(string(m, "instructions") ? { instructions: string(m, "instructions") } : {}),
|
|
43
|
+
...(tools ? { tools: {
|
|
44
|
+
...("allow" in tools ? { allow: list(tools, "allow") } : {}),
|
|
45
|
+
...("deny" in tools ? { deny: list(tools, "deny") } : {}),
|
|
46
|
+
} } : {}),
|
|
47
|
+
};
|
|
48
|
+
});
|
|
49
|
+
validateTeamGraph(members);
|
|
50
|
+
if (!members.some((member) => member.castle))
|
|
51
|
+
return members;
|
|
52
|
+
const scope = ctx.planStoreId ?? ctx.roomStoreId ?? ctx.sessionId;
|
|
53
|
+
if (!ctx.sessionDir || !scope)
|
|
54
|
+
throw new Error("lista non disponibile per assegnare gruppi e attivita");
|
|
55
|
+
const store = VascendPlanStore.open(ctx.sessionDir, scope, { strict: true });
|
|
56
|
+
const owners = new Map();
|
|
57
|
+
const resolved = members.map((member) => {
|
|
58
|
+
if (!member.castle)
|
|
59
|
+
return member;
|
|
60
|
+
const castle = store.castle(member.castle);
|
|
61
|
+
if (!castle)
|
|
62
|
+
throw new Error(`gruppo non trovato: ${member.castle}`);
|
|
63
|
+
if (ctx.planCastle && ctx.planCastle !== castle.slug)
|
|
64
|
+
throw new Error(`delega fuori dal gruppo assegnato: ${castle.slug}`);
|
|
65
|
+
const tasks = member.tasks?.length ? member.tasks.map((ref) => {
|
|
66
|
+
const task = castle.tasks.find((task) => task.id.toLowerCase() === ref.toLowerCase() || String(task.bit) === ref);
|
|
67
|
+
if (!task)
|
|
68
|
+
throw new Error(`attivita non trovata: ${castle.slug}/${ref}`);
|
|
69
|
+
return task;
|
|
70
|
+
}) : castle.tasks.filter((task) => task.status !== "completed");
|
|
71
|
+
if (!tasks.length || tasks.every((task) => task.status === "completed"))
|
|
72
|
+
throw new Error(`nessun task aperto: ${castle.slug}`);
|
|
73
|
+
for (const task of tasks) {
|
|
74
|
+
if (ctx.planTasks && !ctx.planTasks.includes(task.id))
|
|
75
|
+
throw new Error(`delega fuori dai task assegnati: ${castle.slug}/${task.id}`);
|
|
76
|
+
const ref = `${castle.slug}/${task.id}`;
|
|
77
|
+
const previous = owners.get(ref);
|
|
78
|
+
if (previous)
|
|
79
|
+
throw new Error(`task ${ref} assegnato sia a ${previous} sia a ${member.slug}`);
|
|
80
|
+
owners.set(ref, member.slug);
|
|
81
|
+
}
|
|
82
|
+
const after = new Set(member.after ?? []);
|
|
83
|
+
if (castle.after && store.castle(castle.after)?.tasks.some((task) => task.status !== "completed")) {
|
|
84
|
+
const prerequisites = members.filter((candidate) => candidate.castle === castle.after);
|
|
85
|
+
if (!prerequisites.length)
|
|
86
|
+
throw new Error(`prerequisito ${castle.after} ancora aperto e non assegnato`);
|
|
87
|
+
for (const prerequisite of prerequisites)
|
|
88
|
+
after.add(prerequisite.slug);
|
|
89
|
+
}
|
|
90
|
+
if (castle.after && !store.castle(castle.after))
|
|
91
|
+
throw new Error(`prerequisito mancante: ${castle.after}`);
|
|
92
|
+
return { ...member, tasks: tasks.map((task) => task.id), ...(after.size ? { after: [...after] } : {}),
|
|
93
|
+
goal: member.goal || `${castle.title}: ${tasks.map((task) => `${task.id} ${task.title}`).join("; ")}` };
|
|
94
|
+
});
|
|
95
|
+
const completeDependencies = resolved.map((member) => {
|
|
96
|
+
if (!member.castle)
|
|
97
|
+
return member;
|
|
98
|
+
const after = new Set(member.after ?? []);
|
|
99
|
+
for (const blocker of planBlockers(store.castles(), member.castle)) {
|
|
100
|
+
if (blocker.reason !== "incomplete")
|
|
101
|
+
throw new Error(`prerequisito ${blocker.castle}: ${blocker.reason}`);
|
|
102
|
+
for (const task of store.castle(blocker.castle).tasks.filter((task) => task.status !== "completed")) {
|
|
103
|
+
const owner = owners.get(`${blocker.castle}/${task.id}`);
|
|
104
|
+
if (!owner)
|
|
105
|
+
throw new Error(`prerequisito non assegnato: ${blocker.castle}/${task.id}`);
|
|
106
|
+
after.add(owner);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return { ...member, ...(after.size ? { after: [...after] } : {}) };
|
|
110
|
+
});
|
|
111
|
+
validateTeamGraph(completeDependencies);
|
|
112
|
+
return completeDependencies;
|
|
113
|
+
}
|
|
114
|
+
function string(input, key) {
|
|
115
|
+
const value = input[key];
|
|
116
|
+
if (value === undefined)
|
|
117
|
+
return "";
|
|
118
|
+
if (typeof value !== "string")
|
|
119
|
+
throw new Error(`${key} deve essere una stringa`);
|
|
120
|
+
return value.trim();
|
|
121
|
+
}
|
|
122
|
+
function list(input, key) {
|
|
123
|
+
const value = input[key];
|
|
124
|
+
if (value === undefined)
|
|
125
|
+
return [];
|
|
126
|
+
if (!Array.isArray(value) || value.some((item) => typeof item !== "string" || !item.trim()))
|
|
127
|
+
throw new Error(`${key} deve contenere stringhe non vuote`);
|
|
128
|
+
return value.map((item) => item.trim());
|
|
129
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Tool } from "../core/types.js";
|
|
2
|
+
export declare const teamEngageTool: Tool;
|
|
3
|
+
export declare const teamSayTool: Tool;
|
|
4
|
+
export declare const teamInboxTool: Tool;
|
|
5
|
+
export declare const teamWaitTool: Tool;
|
|
6
|
+
export declare const teamReportTool: Tool;
|
|
7
|
+
export declare const teamTools: readonly Tool[];
|