@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,205 @@
|
|
|
1
|
+
export const DISCOVERY_TOOL_NAMES = new Set([
|
|
2
|
+
"tool_list",
|
|
3
|
+
"tool_search",
|
|
4
|
+
"tool_describe",
|
|
5
|
+
"tool_invoke",
|
|
6
|
+
]);
|
|
7
|
+
// tool_search lists, finds and activates tools. The older entry points remain
|
|
8
|
+
// callable for integrations and saved sessions, without occupying every prompt.
|
|
9
|
+
export const LEGACY_DISCOVERY_TOOL_NAMES = new Set([
|
|
10
|
+
"tool_list", "tool_describe", "tool_invoke",
|
|
11
|
+
]);
|
|
12
|
+
// Primitives needed throughout a task, including resuming and checking work.
|
|
13
|
+
// Keep these available in CLI and Horizon; optional capabilities stay discoverable.
|
|
14
|
+
export const ESSENTIAL_TOOL_NAMES = new Set([
|
|
15
|
+
"tool_search",
|
|
16
|
+
"read_file", "write_file", "edit_file",
|
|
17
|
+
"bash", "bash_output", "run_program", "output_page", "recall", "ask_user",
|
|
18
|
+
"vascend_plan", "vascend_mark", "vascend_status",
|
|
19
|
+
"workspace_sessions",
|
|
20
|
+
"team_engage",
|
|
21
|
+
]);
|
|
22
|
+
// The terminal handles routine discovery. Specialized tools remain callable
|
|
23
|
+
// through tool_search/run_program without sending their schemas on every turn.
|
|
24
|
+
export const CLI_DIRECT_TOOL_NAMES = new Set([
|
|
25
|
+
...ESSENTIAL_TOOL_NAMES, "skill_search", "skill_load",
|
|
26
|
+
]);
|
|
27
|
+
export const FILE_DISCOVERY_TOOL_NAMES = ["list_dir", "glob", "grep", "file_activity"];
|
|
28
|
+
// Tool esposti DIRETTAMENTE nel profilo Horizon, oltre ai meta-tool. Tutto il
|
|
29
|
+
// resto resta nel catalogo, scopribile con tool_search.
|
|
30
|
+
//
|
|
31
|
+
// Perche' un hot set e non solo i meta-tool: con la sola discovery ogni azione
|
|
32
|
+
// reale costa da due a tre tool call (search -> eventuale describe -> invoke).
|
|
33
|
+
// Su un lavoro di venti azioni sono cinquanta chiamate al posto di venti, e il
|
|
34
|
+
// giro finisce il proprio budget di turni prima di completare il task. Il
|
|
35
|
+
// risparmio di token nel prompt e' inoltre apparente: i loro schemi entrano nel
|
|
36
|
+
// prefisso cacheabile una volta, mentre ogni risposta di tool_search ripaga lo
|
|
37
|
+
// stesso schema a ogni ricerca, fuori dalla cache.
|
|
38
|
+
//
|
|
39
|
+
// Il criterio di ammissione e' duplice:
|
|
40
|
+
// 1. lavoro quotidiano: leggere, scrivere, modificare, cercare, eseguire;
|
|
41
|
+
// 2. tool CITATI dai messaggi dell'harness (marker di paginazione, pack di
|
|
42
|
+
// memoria, esito di bash in background): se il testo che il modello legge
|
|
43
|
+
// nomina un tool, quel tool deve essere invocabile senza una discovery.
|
|
44
|
+
export const HORIZON_DIRECT_TOOL_NAMES = new Set([
|
|
45
|
+
...ESSENTIAL_TOOL_NAMES,
|
|
46
|
+
// lavoro quotidiano
|
|
47
|
+
"read_file",
|
|
48
|
+
"write_file",
|
|
49
|
+
"edit_file",
|
|
50
|
+
"bash",
|
|
51
|
+
// Programmatic Tool Calling: N azioni collegate in UN turno, con i risultati
|
|
52
|
+
// intermedi nel kernel invece che nel contesto. E' l'antidoto all'inflazione
|
|
53
|
+
// di tool call (il caso da 72 chiamate senza completare): dietro discovery
|
|
54
|
+
// non verrebbe mai scelto proprio nei lavori lunghi in cui serve.
|
|
55
|
+
"run_program",
|
|
56
|
+
// citati dai messaggi dell'harness
|
|
57
|
+
"output_page",
|
|
58
|
+
"bash_output",
|
|
59
|
+
"recall",
|
|
60
|
+
// Il piano E' un'interfaccia: in Horizon i passaggi compaiono in tempo reale
|
|
61
|
+
// nella board affiancata alla chat, dove l'utente li vede e li modifica.
|
|
62
|
+
// Tenere questi due nel catalogo significava board vuota, perche' il modello
|
|
63
|
+
// pianifica solo se pianificare e' a portata di mano.
|
|
64
|
+
"vascend_plan",
|
|
65
|
+
"vascend_mark",
|
|
66
|
+
// Chiedere una mano deve essere a portata di mano, per lo stesso motivo per
|
|
67
|
+
// cui lo e' pianificare: un modello ingaggia dei collaboratori solo se
|
|
68
|
+
// ingaggiarli e' una mossa che ha davanti, non qualcosa da scoprire con
|
|
69
|
+
// tool_search mentre sta gia' decidendo come procedere. Con questi nel
|
|
70
|
+
// catalogo l'agente o faceva tutto da solo, o si affidava alla vecchia
|
|
71
|
+
// delega automatica. Stessa cosa per parlarci: una squadra che non si puo'
|
|
72
|
+
// interpellare senza una discovery non e' una squadra.
|
|
73
|
+
"team_engage",
|
|
74
|
+
"team_say",
|
|
75
|
+
"team_inbox",
|
|
76
|
+
// Dove e' arrivato un piano lungo: e' la prima domanda di una sessione che
|
|
77
|
+
// riprende un lavoro a rami, e deve poterla fare senza cercare il tool.
|
|
78
|
+
"ram_status",
|
|
79
|
+
// E il piano a rami deve stare accanto a vascend_plan, non dietro una
|
|
80
|
+
// discovery: se l'unica pianificazione a portata di mano e' quella dei
|
|
81
|
+
// passaggi di questa sessione, un lavoro lungo verra' sempre spezzato in
|
|
82
|
+
// passaggi di questa sessione. La scelta fra i due la decide la durata del
|
|
83
|
+
// lavoro, e va potuta fare nel momento in cui si pianifica.
|
|
84
|
+
"ram_plan",
|
|
85
|
+
// Lettura del web: leggere una fonte e' un gesto quotidiano quanto leggere un
|
|
86
|
+
// file. Dietro una discovery il modello preferiva indovinare invece di leggere.
|
|
87
|
+
// Sono gli strumenti dell'host (smart fetch), non il web_fetch del core.
|
|
88
|
+
"smart_fetch",
|
|
89
|
+
"smart_fetch_many",
|
|
90
|
+
// Il browser interno si APRE da qui; gli altri strumenti browser restano
|
|
91
|
+
// dietro la discovery e vengono nominati dalla descrizione di browser_open.
|
|
92
|
+
"browser_open",
|
|
93
|
+
// Excalidraw MCP: il modello deve poter disegnare subito. Lasciarli dietro
|
|
94
|
+
// tool_search ricreerebbe il ciclo discovery -> schema -> invoke a ogni
|
|
95
|
+
// revisione e renderebbe improbabile l'uso del checkpoint incrementale.
|
|
96
|
+
"read_me",
|
|
97
|
+
"create_view",
|
|
98
|
+
// read_view va accanto a create_view, non dietro una discovery. La guida di
|
|
99
|
+
// read_me e il blocco di sistema dicono "ALWAYS call read_view before
|
|
100
|
+
// updating a whiteboard you did not just write": un obbligo che costa una
|
|
101
|
+
// tool_search ogni volta viene disatteso, e disattenderlo qui significa
|
|
102
|
+
// SOVRASCRIVERE le modifiche manuali dell'utente — esattamente il danno che
|
|
103
|
+
// quella guida esiste per evitare. Un tool che il prompt rende obbligatorio
|
|
104
|
+
// deve essere a portata di chiamata.
|
|
105
|
+
"read_view",
|
|
106
|
+
"mermaid_to_excalidraw",
|
|
107
|
+
// Visual Creation Suite dell'host Horizon. La guida widget usa un nome
|
|
108
|
+
// distinto da read_me (riservato a Excalidraw) e la consegna deve essere
|
|
109
|
+
// invocabile senza il giro tool_search -> tool_describe -> tool_invoke.
|
|
110
|
+
"widget_read_me",
|
|
111
|
+
"show_widget",
|
|
112
|
+
"visualize",
|
|
113
|
+
// DLACT: cercare e usare uno strumento custom e' quotidiano; crearlo e
|
|
114
|
+
// promuoverlo (dlact_forge, dlact_promote) restano nel catalogo, sono rari.
|
|
115
|
+
"dlact_search",
|
|
116
|
+
"dlact_invoke",
|
|
117
|
+
// Computer Use dell'host Horizon. La catena reale e' una sola: trovare
|
|
118
|
+
// l'applicazione, collegarla, leggere i controlli, agire. Dietro la discovery
|
|
119
|
+
// OGNI passo costava una tool_search con lo schema intero: in una sessione su
|
|
120
|
+
// Spotify sono state sei ricerche di catalogo su trentatre turni, e nel
|
|
121
|
+
// frattempo il modello ha ripiegato su tasklist via bash e su click a
|
|
122
|
+
// coordinate indovinate. Il resto (snapshot, click, type, drag, wait, key,
|
|
123
|
+
// scroll, launch, detach) resta scopribile ed e' nominato da questi.
|
|
124
|
+
"computer_processes",
|
|
125
|
+
"computer_launch",
|
|
126
|
+
"computer_attach",
|
|
127
|
+
"computer_snapshot",
|
|
128
|
+
"computer_inspect",
|
|
129
|
+
"computer_wait",
|
|
130
|
+
// MCP-RAC deve essere nel prefisso iniziale: se resta deferred il modello
|
|
131
|
+
// paga una tool_search prima della prima action e tende a ripiegare su
|
|
132
|
+
// run_program, perdendo i delta nativi che costituiscono la frontiera di
|
|
133
|
+
// partial commit.
|
|
134
|
+
"computer_control",
|
|
135
|
+
"computer_activate",
|
|
136
|
+
"computer_fill",
|
|
137
|
+
"computer_batch",
|
|
138
|
+
]);
|
|
139
|
+
// Inventario autoritativo: un tool diretto e uno deferred sono entrambi
|
|
140
|
+
// disponibili. In precedenza list/search guardavano soltanto catalog(), quindi
|
|
141
|
+
// una verifica esplicita di "widget" rispondeva falsamente che show_widget non
|
|
142
|
+
// esisteva proprio perche' era gia' diretto. Manteniamo la compatibilita' con i
|
|
143
|
+
// vecchi host che non espongono ancora defs().
|
|
144
|
+
export function toolInventory(tools) {
|
|
145
|
+
const direct = typeof tools.defs === "function" ? tools.defs() : [];
|
|
146
|
+
const byName = new Map();
|
|
147
|
+
for (const tool of [...direct, ...tools.catalog()])
|
|
148
|
+
byName.set(tool.name, tool);
|
|
149
|
+
return [...byName.values()];
|
|
150
|
+
}
|
|
151
|
+
// Vista compatta dell'intero registro. Non copia ne' attiva i tool: rende
|
|
152
|
+
// semplicemente consultabile cio' che il modello puo davvero usare.
|
|
153
|
+
export const toolListTool = {
|
|
154
|
+
name: "tool_list",
|
|
155
|
+
description: "Elenca tutti i tool disponibili, sia diretti sia on demand. Usa tool_describe per lo schema.",
|
|
156
|
+
schema: {
|
|
157
|
+
type: "object",
|
|
158
|
+
properties: {
|
|
159
|
+
limit: { type: "number", description: "numero massimo di nomi (default 100)" },
|
|
160
|
+
offset: { type: "integer", minimum: 0, description: "riprende l'inventario da next_offset (default 0)" },
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
handler: async (input, ctx) => {
|
|
164
|
+
if (!ctx.tools)
|
|
165
|
+
return "catalogo non disponibile in questo contesto";
|
|
166
|
+
const requested = typeof input["limit"] === "number" && Number.isFinite(input["limit"]) ? Math.floor(input["limit"]) : 100;
|
|
167
|
+
const limit = Math.max(1, Math.min(requested, 200));
|
|
168
|
+
const rawOffset = input["offset"] ?? 0;
|
|
169
|
+
if (typeof rawOffset !== "number" || !Number.isSafeInteger(rawOffset) || rawOffset < 0) {
|
|
170
|
+
return { output: "errore: offset deve essere un intero non negativo", isError: true };
|
|
171
|
+
}
|
|
172
|
+
const offset = rawOffset;
|
|
173
|
+
const catalog = [...toolInventory(ctx.tools)].sort((a, b) => a.name.localeCompare(b.name));
|
|
174
|
+
const end = Math.min(offset + limit, catalog.length);
|
|
175
|
+
const truncated = end < catalog.length;
|
|
176
|
+
return JSON.stringify({
|
|
177
|
+
total: catalog.length,
|
|
178
|
+
tools: catalog.slice(offset, end).map((tool) => tool.name),
|
|
179
|
+
truncated,
|
|
180
|
+
...(truncated || offset ? { next_offset: truncated ? end : null } : {}),
|
|
181
|
+
});
|
|
182
|
+
},
|
|
183
|
+
};
|
|
184
|
+
export const toolDescribeTool = {
|
|
185
|
+
name: "tool_describe",
|
|
186
|
+
description: "Restituisce descrizione e schema di un tool trovato con tool_list o tool_search.",
|
|
187
|
+
schema: {
|
|
188
|
+
type: "object",
|
|
189
|
+
properties: {
|
|
190
|
+
name: { type: "string", description: "nome esatto del tool" },
|
|
191
|
+
},
|
|
192
|
+
required: ["name"],
|
|
193
|
+
},
|
|
194
|
+
handler: async (input, ctx) => {
|
|
195
|
+
if (!ctx.tools)
|
|
196
|
+
return "catalogo non disponibile in questo contesto";
|
|
197
|
+
const name = String(input["name"] ?? "").trim();
|
|
198
|
+
if (!name)
|
|
199
|
+
return "errore: nome strumento mancante";
|
|
200
|
+
const found = toolInventory(ctx.tools).find((tool) => tool.name === name);
|
|
201
|
+
if (!found)
|
|
202
|
+
return `strumento non disponibile: ${name} (usa tool_list o tool_search)`;
|
|
203
|
+
return JSON.stringify(found, null, 2);
|
|
204
|
+
},
|
|
205
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
import { invokeToolCall } from "../core/tool-executor.js";
|
|
3
|
+
import { catalogRevision, nativeCall, protocolCatalog, protocolError } from "./protocol-catalog.js";
|
|
4
|
+
const RECURSIVE = new Set(["execute", "run_program", "tool_invoke"]);
|
|
5
|
+
export const executeTool = {
|
|
6
|
+
name: "execute",
|
|
7
|
+
description: "Execute a known contract using the revision returned by resolve. mode=call invokes tool(args) "
|
|
8
|
+
+ "directly without a JS kernel; prefer it for shell scripts and file edits. mode=program runs async JavaScript with tools, state, console and return "
|
|
9
|
+
+ "in a persistent kernel; await all operations, return only useful output. Tools return text; "
|
|
10
|
+
+ "tools.$result(name,args) preserves structuredContent/content/isError. Native-only tools must be called "
|
|
11
|
+
+ "directly. Pass scripts and multiline text in data, read via tools.$data, instead of embedding them in code. "
|
|
12
|
+
+ "A stale_contract error requires resolving again; never replay completed effects blindly.",
|
|
13
|
+
schema: { type: "object", properties: {
|
|
14
|
+
mode: { type: "string", enum: ["call", "program"] }, revision: { type: "string" },
|
|
15
|
+
tool: { type: "string" }, args: { type: "object" }, code: { type: "string" },
|
|
16
|
+
data: { type: "object", description: "Program input as JSON, available at tools.$data; keeps scripts/text out of JavaScript string literals" },
|
|
17
|
+
timeout_s: { type: "number" }, reset: { type: "boolean" },
|
|
18
|
+
}, required: ["mode", "revision"] },
|
|
19
|
+
handler: async (input, ctx) => {
|
|
20
|
+
if (ctx.signal.aborted)
|
|
21
|
+
return protocolError("cancelled", "Execution cancelled.");
|
|
22
|
+
if (!ctx.tools)
|
|
23
|
+
return protocolError("unavailable", "Tool registry unavailable.");
|
|
24
|
+
const registry = ctx.tools;
|
|
25
|
+
const revision = input["revision"];
|
|
26
|
+
if (typeof revision !== "string" || revision !== catalogRevision(registry)) {
|
|
27
|
+
return protocolError("stale_contract", "Resolve the needed contracts before execution. No operation started.");
|
|
28
|
+
}
|
|
29
|
+
const mode = input["mode"];
|
|
30
|
+
const check = (name) => {
|
|
31
|
+
if (catalogRevision(registry) !== revision)
|
|
32
|
+
return "stale_contract: resolve again; earlier operations may already have completed";
|
|
33
|
+
const tool = registry.get(name);
|
|
34
|
+
if (!tool || !protocolCatalog(registry).tools.has(name))
|
|
35
|
+
return `unavailable: ${name}`;
|
|
36
|
+
if (nativeCall(tool))
|
|
37
|
+
return `native_required: call ${name} directly`;
|
|
38
|
+
return undefined;
|
|
39
|
+
};
|
|
40
|
+
// Run inside the common executor, after hooks and before every handler.
|
|
41
|
+
const guarded = { ...ctx, guardToolCall: call => {
|
|
42
|
+
ctx.guardToolCall?.(call);
|
|
43
|
+
const problem = check(call.name);
|
|
44
|
+
if (problem)
|
|
45
|
+
throw new Error(problem);
|
|
46
|
+
} };
|
|
47
|
+
if (mode === "call") {
|
|
48
|
+
if (typeof input["tool"] !== "string" || !input["tool"].trim() || input["code"] !== undefined || input["data"] !== undefined
|
|
49
|
+
|| input["args"] !== undefined && (input["args"] === null || typeof input["args"] !== "object" || Array.isArray(input["args"]))) {
|
|
50
|
+
return protocolError("invalid_input", "call requires a tool name and object args; code and data belong to program mode.");
|
|
51
|
+
}
|
|
52
|
+
const name = input["tool"].trim();
|
|
53
|
+
if (RECURSIVE.has(name))
|
|
54
|
+
return protocolError("invalid_input", "Use program mode for code; do not nest execution wrappers.");
|
|
55
|
+
const error = check(name);
|
|
56
|
+
if (error)
|
|
57
|
+
return protocolError("unavailable", error);
|
|
58
|
+
return invokeToolCall({ type: "tool_call", id: "exec-" + randomUUID(), name,
|
|
59
|
+
input: (input["args"] ?? {}) }, guarded);
|
|
60
|
+
}
|
|
61
|
+
if (mode !== "program" || typeof input["code"] !== "string" || !input["code"].trim()
|
|
62
|
+
|| input["tool"] !== undefined || input["args"] !== undefined) {
|
|
63
|
+
return protocolError("invalid_input", "program requires nonempty code; tool and args belong to call mode.");
|
|
64
|
+
}
|
|
65
|
+
const error = check("run_program");
|
|
66
|
+
if (error)
|
|
67
|
+
return protocolError("unavailable", error);
|
|
68
|
+
// The existing executor still owns hooks, permissions, media and cancellation.
|
|
69
|
+
// Check catalog freshness again at each bridge call, including after an await.
|
|
70
|
+
return invokeToolCall({ type: "tool_call", id: "exec-" + randomUUID(), name: "run_program",
|
|
71
|
+
input: { code: input["code"], data: input["data"], timeout_s: input["timeout_s"], reset: input["reset"] } }, guarded);
|
|
72
|
+
},
|
|
73
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Riconduce l'input di una tool call alla forma dichiarata dal suo schema.
|
|
3
|
+
* Non lancia mai: un input inutilizzabile diventa `{}` e il tool produrra' il
|
|
4
|
+
* proprio errore diagnostico.
|
|
5
|
+
*/
|
|
6
|
+
export declare function normalizeToolInput(raw: unknown, schema?: Readonly<Record<string, unknown>>): Record<string, unknown>;
|
|
7
|
+
/**
|
|
8
|
+
* Elenco leggibile delle chiavi effettivamente ricevute, per messaggi d'errore
|
|
9
|
+
* che dicano al modello cosa ha sbagliato invece di un "parametro mancante"
|
|
10
|
+
* secco (che lo porta a ritentare identico).
|
|
11
|
+
*/
|
|
12
|
+
export declare function describeReceivedKeys(input: unknown): string;
|
|
13
|
+
/**
|
|
14
|
+
* Errore diagnostico standard per un parametro obbligatorio mancante: dice il
|
|
15
|
+
* parametro atteso, cosa e' arrivato e un esempio di chiamata corretta.
|
|
16
|
+
*/
|
|
17
|
+
export declare function missingParamError(param: string, input: unknown, example: string): string;
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
// Normalizzazione degli argomenti di una tool call. Modulo PURO.
|
|
2
|
+
//
|
|
3
|
+
// Perche' esiste: i modelli non consegnano sempre gli argomenti nella forma
|
|
4
|
+
// dichiarata dallo schema. Le deviazioni osservate in produzione sono sempre le
|
|
5
|
+
// stesse tre:
|
|
6
|
+
//
|
|
7
|
+
// 1. impacchettamento: {"args": "{\"command\":\"...\"}"} invece di
|
|
8
|
+
// {"command": "..."} (tipico quando lo schema di un parametro e' `object`
|
|
9
|
+
// senza properties, o quando un gateway ri-serializza la chiamata);
|
|
10
|
+
// 2. annidamento: {"args": {"args": {...}}};
|
|
11
|
+
// 3. tipi stringati: {"page": "3"} per un parametro dichiarato number,
|
|
12
|
+
// {"castles": "[...]"} per uno dichiarato array.
|
|
13
|
+
//
|
|
14
|
+
// Senza normalizzazione il tool riceve {} , risponde "parametro mancante", e il
|
|
15
|
+
// modello ritenta la stessa chiamata in un ciclo che brucia turni senza mai
|
|
16
|
+
// completare il task. Qui l'input viene ricondotto allo schema una volta sola,
|
|
17
|
+
// nel punto di dispatch, per TUTTI i tool.
|
|
18
|
+
// Chiavi usate dai modelli per impacchettare gli argomenti veri. Vengono
|
|
19
|
+
// srotolate SOLO se il tool non dichiara quella property nel proprio schema
|
|
20
|
+
// (tool_invoke, per esempio, ha un `args` legittimo).
|
|
21
|
+
const WRAPPER_KEYS = [
|
|
22
|
+
"args",
|
|
23
|
+
"arguments",
|
|
24
|
+
"argument",
|
|
25
|
+
"input",
|
|
26
|
+
"inputs",
|
|
27
|
+
"parameters",
|
|
28
|
+
"params",
|
|
29
|
+
"kwargs",
|
|
30
|
+
"tool_input",
|
|
31
|
+
];
|
|
32
|
+
// Tetto agli srotolamenti: protegge da input costruiti in modo patologico.
|
|
33
|
+
const MAX_UNWRAP_DEPTH = 3;
|
|
34
|
+
function isPlainObject(value) {
|
|
35
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
36
|
+
}
|
|
37
|
+
// Parsing tollerante: ritorna il valore solo se il JSON e' valido.
|
|
38
|
+
function parseJson(raw) {
|
|
39
|
+
const trimmed = raw.trim();
|
|
40
|
+
if (!trimmed)
|
|
41
|
+
return undefined;
|
|
42
|
+
if (!/^[[{"]|^-?\d|^true$|^false$|^null$/.test(trimmed))
|
|
43
|
+
return undefined;
|
|
44
|
+
try {
|
|
45
|
+
return JSON.parse(trimmed);
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
return undefined;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
// Le properties dichiarate dallo schema del tool (vuoto se lo schema non le
|
|
52
|
+
// dichiara: in quel caso nessuna coercizione tipata, solo lo srotolamento).
|
|
53
|
+
function schemaProperties(schema) {
|
|
54
|
+
const props = schema?.["properties"];
|
|
55
|
+
return isPlainObject(props) ? props : {};
|
|
56
|
+
}
|
|
57
|
+
function declaredType(prop) {
|
|
58
|
+
if (!isPlainObject(prop))
|
|
59
|
+
return "";
|
|
60
|
+
const t = prop["type"];
|
|
61
|
+
if (typeof t === "string")
|
|
62
|
+
return t;
|
|
63
|
+
// union ["string","null"]: conta il primo tipo concreto
|
|
64
|
+
if (Array.isArray(t)) {
|
|
65
|
+
const first = t.find((x) => typeof x === "string" && x !== "null");
|
|
66
|
+
return typeof first === "string" ? first : "";
|
|
67
|
+
}
|
|
68
|
+
return "";
|
|
69
|
+
}
|
|
70
|
+
// Riconduce un valore stringa al tipo dichiarato dallo schema. Non forza nulla:
|
|
71
|
+
// se la conversione non e' certa, il valore originale resta intatto.
|
|
72
|
+
function coerceValue(value, type) {
|
|
73
|
+
if (typeof value !== "string")
|
|
74
|
+
return value;
|
|
75
|
+
if (type === "object" || type === "array") {
|
|
76
|
+
const parsed = parseJson(value);
|
|
77
|
+
if (type === "object" && isPlainObject(parsed))
|
|
78
|
+
return parsed;
|
|
79
|
+
if (type === "array" && Array.isArray(parsed))
|
|
80
|
+
return parsed;
|
|
81
|
+
return value;
|
|
82
|
+
}
|
|
83
|
+
if (type === "number" || type === "integer") {
|
|
84
|
+
const trimmed = value.trim();
|
|
85
|
+
if (!trimmed)
|
|
86
|
+
return value;
|
|
87
|
+
const n = Number(trimmed);
|
|
88
|
+
return Number.isFinite(n) ? n : value;
|
|
89
|
+
}
|
|
90
|
+
if (type === "boolean") {
|
|
91
|
+
const v = value.trim().toLowerCase();
|
|
92
|
+
if (v === "true")
|
|
93
|
+
return true;
|
|
94
|
+
if (v === "false")
|
|
95
|
+
return false;
|
|
96
|
+
return value;
|
|
97
|
+
}
|
|
98
|
+
return value;
|
|
99
|
+
}
|
|
100
|
+
// Srotola un livello di impacchettamento. Ritorna null se non c'e' nulla da
|
|
101
|
+
// srotolare a questo livello.
|
|
102
|
+
function unwrapOnce(input, known) {
|
|
103
|
+
for (const key of WRAPPER_KEYS) {
|
|
104
|
+
if (!(key in input))
|
|
105
|
+
continue;
|
|
106
|
+
// Il tool dichiara questa property: e' un argomento vero, non un involucro.
|
|
107
|
+
if (key in known)
|
|
108
|
+
continue;
|
|
109
|
+
const raw = input[key];
|
|
110
|
+
const value = typeof raw === "string" ? parseJson(raw) : raw;
|
|
111
|
+
if (!isPlainObject(value))
|
|
112
|
+
continue;
|
|
113
|
+
const rest = { ...input };
|
|
114
|
+
delete rest[key];
|
|
115
|
+
// Gli argomenti interni vincono su quelli esterni: sono la forma esplicita
|
|
116
|
+
// che il modello intendeva passare al tool.
|
|
117
|
+
return { ...rest, ...value };
|
|
118
|
+
}
|
|
119
|
+
return null;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Riconduce l'input di una tool call alla forma dichiarata dal suo schema.
|
|
123
|
+
* Non lancia mai: un input inutilizzabile diventa `{}` e il tool produrra' il
|
|
124
|
+
* proprio errore diagnostico.
|
|
125
|
+
*/
|
|
126
|
+
export function normalizeToolInput(raw, schema) {
|
|
127
|
+
const known = schemaProperties(schema);
|
|
128
|
+
// L'intera call consegnata come stringa JSON.
|
|
129
|
+
let current = raw;
|
|
130
|
+
if (typeof current === "string")
|
|
131
|
+
current = parseJson(current);
|
|
132
|
+
if (!isPlainObject(current))
|
|
133
|
+
return {};
|
|
134
|
+
let out = current;
|
|
135
|
+
for (let i = 0; i < MAX_UNWRAP_DEPTH; i += 1) {
|
|
136
|
+
const next = unwrapOnce(out, known);
|
|
137
|
+
if (!next)
|
|
138
|
+
break;
|
|
139
|
+
out = next;
|
|
140
|
+
}
|
|
141
|
+
// Coercizione tipata sulle property dichiarate.
|
|
142
|
+
let coerced = null;
|
|
143
|
+
for (const [key, value] of Object.entries(out)) {
|
|
144
|
+
const type = declaredType(known[key]);
|
|
145
|
+
if (!type)
|
|
146
|
+
continue;
|
|
147
|
+
const next = coerceValue(value, type);
|
|
148
|
+
if (next !== value) {
|
|
149
|
+
coerced = coerced ?? { ...out };
|
|
150
|
+
coerced[key] = next;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
return coerced ?? out;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Elenco leggibile delle chiavi effettivamente ricevute, per messaggi d'errore
|
|
157
|
+
* che dicano al modello cosa ha sbagliato invece di un "parametro mancante"
|
|
158
|
+
* secco (che lo porta a ritentare identico).
|
|
159
|
+
*/
|
|
160
|
+
export function describeReceivedKeys(input) {
|
|
161
|
+
if (!isPlainObject(input))
|
|
162
|
+
return typeof input === "undefined" ? "nessuna" : `valore ${typeof input}`;
|
|
163
|
+
const keys = Object.keys(input);
|
|
164
|
+
return keys.length ? keys.join(", ") : "nessuna";
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Errore diagnostico standard per un parametro obbligatorio mancante: dice il
|
|
168
|
+
* parametro atteso, cosa e' arrivato e un esempio di chiamata corretta.
|
|
169
|
+
*/
|
|
170
|
+
export function missingParamError(param, input, example) {
|
|
171
|
+
return (`errore: parametro \`${param}\` mancante o vuoto. ` +
|
|
172
|
+
`Chiavi ricevute: ${describeReceivedKeys(input)}. ` +
|
|
173
|
+
`Passa gli argomenti come oggetto piatto, es. ${example}`);
|
|
174
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ToolContext, ToolHandlerOutput } from "../core/types.js";
|
|
2
|
+
/** Scoped artifact reads, with bounded search/slices and a canonical structured route for programs. */
|
|
3
|
+
export declare function outputArtifact(input: Record<string, unknown>, ctx: ToolContext): ToolHandlerOutput;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { ToolOutputStore } from "../core/tool-result-store.js";
|
|
2
|
+
import { readTeamHandoff } from "../vascend/team-handoff.js";
|
|
3
|
+
import { teamForSession, teamByKingdom } from "../vascend/team-session.js";
|
|
4
|
+
import { pageOf } from "./pagination.js";
|
|
5
|
+
import { createHash } from "node:crypto";
|
|
6
|
+
/** Scoped artifact reads, with bounded search/slices and a canonical structured route for programs. */
|
|
7
|
+
export function outputArtifact(input, ctx) {
|
|
8
|
+
const id = String(input["id"] ?? "");
|
|
9
|
+
const fail = (output) => ({ output, isError: true });
|
|
10
|
+
if (!ctx.sessionDir || !ctx.sessionId)
|
|
11
|
+
return fail(`archivio non disponibile in questo contesto: ${id}`);
|
|
12
|
+
const own = ctx.roomStoreId ?? ctx.sessionId;
|
|
13
|
+
const scope = String(input["scope"] ?? own);
|
|
14
|
+
const team = ctx.kingdom?.id ? teamByKingdom(ctx.kingdom.id) : teamForSession(ctx.sessionId);
|
|
15
|
+
const saved = readTeamHandoff(ctx.sessionDir, ctx.sessionId, scope) ?? readTeamHandoff(ctx.sessionDir, ctx.sessionId);
|
|
16
|
+
const scopes = new Set([own, ctx.sessionId, ctx.kingdom?.id, team?.id, saved?.id,
|
|
17
|
+
...(team?.members ?? []).flatMap((member) => (member.artifacts ?? []).map((ref) => ref.scope)),
|
|
18
|
+
...(saved?.members ?? []).flatMap((member) => (member.artifacts ?? []).map((ref) => ref.scope))]);
|
|
19
|
+
if (!scopes.has(scope))
|
|
20
|
+
return fail("scope non associato a questa sessione o al suo team");
|
|
21
|
+
const source = ToolOutputStore.open(ctx.sessionDir, scope);
|
|
22
|
+
const text = source.text(id);
|
|
23
|
+
let entry = source.entry(id);
|
|
24
|
+
if (text === null || !entry)
|
|
25
|
+
return fail(`risultato archiviato non trovato: ${id} (riesegui lo strumento)`);
|
|
26
|
+
if (scope !== own) {
|
|
27
|
+
// Import into the reader's scope so subsequent pages and compaction use an unambiguous local id.
|
|
28
|
+
const importKey = createHash("sha256").update(JSON.stringify([scope, id, entry.sha256 ?? entry.at])).digest("hex");
|
|
29
|
+
entry = ToolOutputStore.open(ctx.sessionDir, own).put(`import-${importKey}`, entry.name, text, source.result(id) ?? undefined);
|
|
30
|
+
if (!entry)
|
|
31
|
+
return fail("impossibile conservare il riferimento condiviso nella sessione");
|
|
32
|
+
}
|
|
33
|
+
const ref = { id: entry.id, scope: own, name: entry.name, sha256: entry.sha256 ?? "", chars: entry.chars };
|
|
34
|
+
const meta = { talosArtifact: ref, talosRetrievedId: entry.id };
|
|
35
|
+
if (input["format"] === "metadata")
|
|
36
|
+
return { output: JSON.stringify(ref), structuredContent: ref, _meta: meta };
|
|
37
|
+
if (input["format"] === "structured") {
|
|
38
|
+
const canonical = source.result(id);
|
|
39
|
+
let data = canonical?.structuredContent;
|
|
40
|
+
if (!data) {
|
|
41
|
+
try {
|
|
42
|
+
data = { value: JSON.parse(text) };
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
return fail("questo artefatto non contiene dati strutturati: usa page, query oppure offset/limit");
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return { output: `Dati strutturati di ${entry.id} disponibili in structuredContent (tools.$result).`,
|
|
49
|
+
structuredContent: data, _meta: meta };
|
|
50
|
+
}
|
|
51
|
+
const bounded = (value, fallback, max) => typeof value === "number" && Number.isFinite(value) ? Math.min(max, Math.max(0, Math.floor(value))) : fallback;
|
|
52
|
+
const offset = bounded(input["offset"], 0, text.length);
|
|
53
|
+
const limit = Math.max(1, bounded(input["limit"], 8000, 30000));
|
|
54
|
+
if (typeof input["query"] === "string" && input["query"].length) {
|
|
55
|
+
const query = input["query"];
|
|
56
|
+
const matches = [];
|
|
57
|
+
let cursor = offset, chars = 0;
|
|
58
|
+
while (matches.length < 50 && chars < limit) {
|
|
59
|
+
const at = text.indexOf(query, cursor);
|
|
60
|
+
if (at < 0) {
|
|
61
|
+
cursor = text.length;
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
const start = Math.max(0, at - 120);
|
|
65
|
+
const excerpt = text.slice(start, Math.min(text.length, at + query.length + 240, start + limit - chars));
|
|
66
|
+
matches.push({ offset: at, text: excerpt });
|
|
67
|
+
chars += excerpt.length;
|
|
68
|
+
cursor = at + Math.max(1, query.length);
|
|
69
|
+
}
|
|
70
|
+
const data = { ...ref, matches, next_offset: cursor < text.length ? cursor : null };
|
|
71
|
+
return { output: JSON.stringify(data), structuredContent: data, _meta: meta };
|
|
72
|
+
}
|
|
73
|
+
if (input["offset"] !== undefined || input["limit"] !== undefined) {
|
|
74
|
+
const end = Math.min(text.length, offset + limit);
|
|
75
|
+
const data = { ...ref, offset, next_offset: end < text.length ? end : null, text: text.slice(offset, end) };
|
|
76
|
+
return { output: JSON.stringify(data), structuredContent: data, _meta: meta };
|
|
77
|
+
}
|
|
78
|
+
const page = Math.max(1, bounded(input["page"], 1, Number.MAX_SAFE_INTEGER));
|
|
79
|
+
return { output: pageOf(text, `${entry.name} archiviato`, page, entry.id), _meta: meta };
|
|
80
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ToolContext } from "../core/types.js";
|
|
2
|
+
declare class PageStore {
|
|
3
|
+
private readonly map;
|
|
4
|
+
private readonly order;
|
|
5
|
+
private seq;
|
|
6
|
+
store(text: string, label: string): string;
|
|
7
|
+
totalPages(id: string): number;
|
|
8
|
+
page(id: string, page: number): string | null;
|
|
9
|
+
}
|
|
10
|
+
export declare function stripPageMarkers(text: string): string;
|
|
11
|
+
export declare function pageOf(text: string, label: string, page: number, id: string): string;
|
|
12
|
+
export declare const pageStore: PageStore;
|
|
13
|
+
export declare function paginate(text: string, label?: string, ctx?: ToolContext): string;
|
|
14
|
+
export declare function isPaginated(output: string): boolean;
|
|
15
|
+
export {};
|