@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,5 @@
|
|
|
1
|
+
export declare const PROTOCOL_TOOLS: ReadonlySet<string>;
|
|
2
|
+
export declare const NATIVE_CALL_TOOLS: ReadonlySet<string>;
|
|
3
|
+
export declare const BUILTIN_CAPABILITIES: Readonly<Record<string, readonly string[]>>;
|
|
4
|
+
export declare const BUILTIN_CONTINUATIONS: Readonly<Record<string, readonly string[]>>;
|
|
5
|
+
export declare const COMPACT_TOOL_GUIDANCE = "Tool protocol: resolve and execute\nAll operation names mentioned elsewhere (bash, read_file, vascend_plan, ask_user, etc.)\nare internal tools. Use execute to call them; only tools in the native list can be\ncalled at top level. Interpret the user's language yourself and emit stable capability\nIDs; never translate file paths, search patterns or user data to discover a tool.\nresolve({capabilities:[\"process.run\",\"files.edit\"]}) returns exact tools, full input\ncontracts, continuations and a catalog revision. Reuse that revision and the contracts\nuntil stale_contract; do not resolve again for tools you already know.\nFamilies: files, process, output, plan, memory, user, workspace, code, web, image,\nskills, team, branches, market. resolve({namespace:\"files\"}) lists that family's\noperations; resolve({namespace:\"tools\"}) lists all installed tools in pages, including\nextensions. resolve({names:[\"read_file\",\"output_page\"]}) gets known names in one call.\nCommon capabilities: files.read/write/edit/search/find/list, process.run/observe,\nplan.create/update/inspect/note, user.ask, memory.recall, output.read.\nFor one operation: execute({mode:\"call\",revision,tool:\"read_file\",args:{path:\"src/a.ts\"}}).\nPrefer call mode for shell scripts and file edits. Use write_file/edit_file for UTF-8\nsource changes. In Python always specify encoding=\"utf-8\" when reading/writing text.\nFor sequences, pass payloads in data: execute({mode:\"program\",revision,data:{path:\"src/a.ts\"},code:\"return await tools.read_file({path:tools.$data.path});\"}).\nKeep scripts, file content and multiline text in data, never inside JavaScript\nstring literals; tools.$data contains this invocation's data, default {}.\nPrograms have tools, state, console and await; state persists per session, return emits\nthe result. Tools return text; tools.$result(name,args) also returns structuredContent,\ncontent and isError. Keep intermediate data in state and return only useful evidence.\nAwait dependent writes and approvals sequentially; use bounded Promise.allSettled for\nindependent work and inspect every outcome. Do not repeat a completed action on error.\nPrefer process.run with bash for rg, rg --files and git. Follow background processes\nwith bash_output through execute until the final exit status. Unknown or unavailable\ncapabilities require catalog inspection or independent work, never invented tool names.\nThe revision checks catalog freshness, not permission. All existing permission gates\nstill apply. Tools marked native must be called directly, including for images or\nincremental computer control when their contract requires it.";
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// Local operational metadata. These declarations never confer permissions.
|
|
2
|
+
export const PROTOCOL_TOOLS = new Set(["resolve", "execute"]);
|
|
3
|
+
export const NATIVE_CALL_TOOLS = new Set(["computer_control", "computer_batch"]);
|
|
4
|
+
export const BUILTIN_CAPABILITIES = {
|
|
5
|
+
read_file: ["files.read"], write_file: ["files.write"], edit_file: ["files.edit"],
|
|
6
|
+
grep: ["files.search"], glob: ["files.find"], list_dir: ["files.list"], file_activity: ["files.activity"],
|
|
7
|
+
bash: ["process.run"], bash_output: ["process.observe"], wait: ["process.wait"],
|
|
8
|
+
output_page: ["output.read"], recall: ["memory.recall"], user_profile: ["memory.profile"],
|
|
9
|
+
vascend_plan: ["plan.create"], vascend_mark: ["plan.update"], vascend_status: ["plan.inspect"],
|
|
10
|
+
vascend_note: ["plan.note"], vascend_addtasks: ["plan.extend"], work_queue: ["plan.queue"],
|
|
11
|
+
ask_user: ["user.ask"], workspace_sessions: ["workspace.sessions"],
|
|
12
|
+
architecture_map: ["code.architecture"], web_fetch: ["web.fetch"], image_generate: ["image.generate"],
|
|
13
|
+
skill_search: ["skills.search"], skill_load: ["skills.load"], vascend_skill: ["skills.create"],
|
|
14
|
+
team_engage: ["team.engage"], team_say: ["team.send"], team_inbox: ["team.receive"],
|
|
15
|
+
team_wait: ["team.wait"], team_report: ["team.inspect"], market_compare: ["market.compare"],
|
|
16
|
+
ram_plan: ["branches.plan"], ram_status: ["branches.inspect"], ram_take: ["branches.take"],
|
|
17
|
+
ram_submit: ["branches.submit"], ram_ask: ["branches.ask"], ram_judge: ["branches.judge"],
|
|
18
|
+
ram_propose: ["branches.propose"], ram_decide: ["branches.decide"], ram_tell: ["branches.send"],
|
|
19
|
+
ram_hear: ["branches.receive"],
|
|
20
|
+
};
|
|
21
|
+
export const BUILTIN_CONTINUATIONS = {
|
|
22
|
+
bash: ["bash_output"], vascend_plan: ["vascend_mark", "vascend_status"],
|
|
23
|
+
skill_search: ["skill_load"], team_engage: ["team_say", "team_inbox", "team_report"],
|
|
24
|
+
};
|
|
25
|
+
export const COMPACT_TOOL_GUIDANCE = `Tool protocol: resolve and execute
|
|
26
|
+
All operation names mentioned elsewhere (bash, read_file, vascend_plan, ask_user, etc.)
|
|
27
|
+
are internal tools. Use execute to call them; only tools in the native list can be
|
|
28
|
+
called at top level. Interpret the user's language yourself and emit stable capability
|
|
29
|
+
IDs; never translate file paths, search patterns or user data to discover a tool.
|
|
30
|
+
resolve({capabilities:["process.run","files.edit"]}) returns exact tools, full input
|
|
31
|
+
contracts, continuations and a catalog revision. Reuse that revision and the contracts
|
|
32
|
+
until stale_contract; do not resolve again for tools you already know.
|
|
33
|
+
Families: files, process, output, plan, memory, user, workspace, code, web, image,
|
|
34
|
+
skills, team, branches, market. resolve({namespace:"files"}) lists that family's
|
|
35
|
+
operations; resolve({namespace:"tools"}) lists all installed tools in pages, including
|
|
36
|
+
extensions. resolve({names:["read_file","output_page"]}) gets known names in one call.
|
|
37
|
+
Common capabilities: files.read/write/edit/search/find/list, process.run/observe,
|
|
38
|
+
plan.create/update/inspect/note, user.ask, memory.recall, output.read.
|
|
39
|
+
For one operation: execute({mode:"call",revision,tool:"read_file",args:{path:"src/a.ts"}}).
|
|
40
|
+
Prefer call mode for shell scripts and file edits. Use write_file/edit_file for UTF-8
|
|
41
|
+
source changes. In Python always specify encoding="utf-8" when reading/writing text.
|
|
42
|
+
For sequences, pass payloads in data: execute({mode:"program",revision,data:{path:"src/a.ts"},code:"return await tools.read_file({path:tools.$data.path});"}).
|
|
43
|
+
Keep scripts, file content and multiline text in data, never inside JavaScript
|
|
44
|
+
string literals; tools.$data contains this invocation's data, default {}.
|
|
45
|
+
Programs have tools, state, console and await; state persists per session, return emits
|
|
46
|
+
the result. Tools return text; tools.$result(name,args) also returns structuredContent,
|
|
47
|
+
content and isError. Keep intermediate data in state and return only useful evidence.
|
|
48
|
+
Await dependent writes and approvals sequentially; use bounded Promise.allSettled for
|
|
49
|
+
independent work and inspect every outcome. Do not repeat a completed action on error.
|
|
50
|
+
Prefer process.run with bash for rg, rg --files and git. Follow background processes
|
|
51
|
+
with bash_output through execute until the final exit status. Unknown or unavailable
|
|
52
|
+
capabilities require catalog inspection or independent work, never invented tool names.
|
|
53
|
+
The revision checks catalog freshness, not permission. All existing permission gates
|
|
54
|
+
still apply. Tools marked native must be called directly, including for images or
|
|
55
|
+
incremental computer control when their contract requires it.`;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
// Fixed program; untrusted coordinates travel as JSON on stdin, never as code.
|
|
3
|
+
export const CAPTURE_SCRIPT = String.raw `
|
|
4
|
+
$ErrorActionPreference = 'Stop'
|
|
5
|
+
Add-Type -AssemblyName System.Drawing
|
|
6
|
+
Add-Type -AssemblyName System.Windows.Forms
|
|
7
|
+
Add-Type @'
|
|
8
|
+
using System;
|
|
9
|
+
using System.Runtime.InteropServices;
|
|
10
|
+
public static class TalosCapture {
|
|
11
|
+
[StructLayout(LayoutKind.Sequential)] public struct Rect { public int Left, Top, Right, Bottom; }
|
|
12
|
+
[DllImport("user32.dll")] public static extern bool SetProcessDPIAware();
|
|
13
|
+
[DllImport("user32.dll")] public static extern IntPtr GetForegroundWindow();
|
|
14
|
+
[DllImport("user32.dll")] public static extern bool IsIconic(IntPtr window);
|
|
15
|
+
[DllImport("user32.dll")] public static extern bool GetWindowRect(IntPtr window, out Rect rect);
|
|
16
|
+
}
|
|
17
|
+
'@
|
|
18
|
+
[void][TalosCapture]::SetProcessDPIAware()
|
|
19
|
+
$p = [Console]::In.ReadToEnd() | ConvertFrom-Json
|
|
20
|
+
$b = [System.Windows.Forms.Screen]::PrimaryScreen.Bounds
|
|
21
|
+
if ($p.display) {
|
|
22
|
+
$screens = [System.Windows.Forms.Screen]::AllScreens
|
|
23
|
+
$selected = $null
|
|
24
|
+
for ($i = 0; $i -lt $screens.Length; $i++) {
|
|
25
|
+
if ([string]$i -eq [string]$p.display -or $screens[$i].DeviceName -eq [string]$p.display) { $selected = $screens[$i]; break }
|
|
26
|
+
}
|
|
27
|
+
if ($null -eq $selected) { throw 'Unknown display: use zero-based index or device name' }
|
|
28
|
+
$b = $selected.Bounds
|
|
29
|
+
}
|
|
30
|
+
if ($p.windowId) {
|
|
31
|
+
$window = [IntPtr]::new([long]$p.windowId)
|
|
32
|
+
if ([TalosCapture]::GetForegroundWindow() -ne $window -or [TalosCapture]::IsIconic($window)) { throw 'Attached window must be visible and in foreground' }
|
|
33
|
+
$r = New-Object TalosCapture+Rect
|
|
34
|
+
if (-not [TalosCapture]::GetWindowRect($window,[ref]$r)) { throw 'Window is no longer available' }
|
|
35
|
+
$b = New-Object System.Drawing.Rectangle($r.Left,$r.Top,($r.Right-$r.Left),($r.Bottom-$r.Top))
|
|
36
|
+
}
|
|
37
|
+
if ($b.Width -lt 1 -or $b.Height -lt 1 -or ([long]$b.Width*$b.Height) -gt 32000000) { throw 'Invalid capture bounds' }
|
|
38
|
+
$bitmap = New-Object System.Drawing.Bitmap($b.Width,$b.Height)
|
|
39
|
+
$graphics = [System.Drawing.Graphics]::FromImage($bitmap)
|
|
40
|
+
$stream = New-Object System.IO.MemoryStream
|
|
41
|
+
$scaled = $null
|
|
42
|
+
try {
|
|
43
|
+
$graphics.CopyFromScreen($b.Location,[System.Drawing.Point]::Empty,$b.Size)
|
|
44
|
+
$scale = [Math]::Min(1,[Math]::Min(1600.0/$b.Width,1000.0/$b.Height))
|
|
45
|
+
$w = [Math]::Max(1,[int]($b.Width*$scale)); $h = [Math]::Max(1,[int]($b.Height*$scale))
|
|
46
|
+
$scaled = New-Object System.Drawing.Bitmap($bitmap,$w,$h)
|
|
47
|
+
$scaled.Save($stream,[System.Drawing.Imaging.ImageFormat]::Png)
|
|
48
|
+
@{data=[Convert]::ToBase64String($stream.ToArray());width=$w;height=$h;bounds=@{x=$b.X;y=$b.Y;width=$b.Width;height=$b.Height}} | ConvertTo-Json -Compress
|
|
49
|
+
} finally {
|
|
50
|
+
if ($null -ne $scaled) { $scaled.Dispose() }
|
|
51
|
+
$stream.Dispose(); $graphics.Dispose(); $bitmap.Dispose()
|
|
52
|
+
}
|
|
53
|
+
`;
|
|
54
|
+
export function captureComputerDesktop(input, signal) {
|
|
55
|
+
if (process.platform !== "win32")
|
|
56
|
+
return Promise.reject(new Error("Computer Use autonomo richiede Windows."));
|
|
57
|
+
return new Promise((resolve, reject) => {
|
|
58
|
+
const child = spawn("powershell.exe", ["-NoProfile", "-NonInteractive", "-EncodedCommand",
|
|
59
|
+
Buffer.from(CAPTURE_SCRIPT, "utf16le").toString("base64")], { windowsHide: true, signal });
|
|
60
|
+
const chunks = [];
|
|
61
|
+
let bytes = 0;
|
|
62
|
+
let error = "";
|
|
63
|
+
const timer = setTimeout(() => { child.kill(); reject(new Error("Timeout cattura desktop")); }, 20000);
|
|
64
|
+
child.stdout.on("data", (chunk) => {
|
|
65
|
+
bytes += chunk.length;
|
|
66
|
+
if (bytes > 12 * 1024 * 1024) {
|
|
67
|
+
child.kill();
|
|
68
|
+
reject(new Error("Screenshot troppo grande"));
|
|
69
|
+
}
|
|
70
|
+
else
|
|
71
|
+
chunks.push(chunk);
|
|
72
|
+
});
|
|
73
|
+
child.stderr.on("data", (chunk) => { error = (error + chunk.toString()).slice(-2000); });
|
|
74
|
+
child.on("error", (err) => { clearTimeout(timer); reject(err); });
|
|
75
|
+
child.on("close", (code) => {
|
|
76
|
+
clearTimeout(timer);
|
|
77
|
+
if (code !== 0) {
|
|
78
|
+
reject(new Error(error || `Cattura terminata: ${code}`));
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
try {
|
|
82
|
+
resolve(JSON.parse(Buffer.concat(chunks).toString("utf8").trim()));
|
|
83
|
+
}
|
|
84
|
+
catch {
|
|
85
|
+
reject(new Error("Risposta cattura non valida"));
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
child.stdin.on("error", () => { });
|
|
89
|
+
child.stdin.end(JSON.stringify(input));
|
|
90
|
+
});
|
|
91
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Tool } from "../core/types.js";
|
|
2
|
+
export type DesktopRunner = (file: string, args: readonly string[], signal: AbortSignal) => Promise<string>;
|
|
3
|
+
export declare const runDesktopCommand: DesktopRunner;
|
|
4
|
+
/** Discrete desktop operations; factory is inert until the shared consent gate runs. */
|
|
5
|
+
export declare function posixComputerTools(platform: "darwin" | "linux", env: NodeJS.ProcessEnv, run?: DesktopRunner): readonly Tool[];
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { execFile } from "node:child_process";
|
|
2
|
+
import { mkdtemp, readFile, rm } from "node:fs/promises";
|
|
3
|
+
import { tmpdir } from "node:os";
|
|
4
|
+
import { join } from "node:path";
|
|
5
|
+
export const runDesktopCommand = (file, args, signal) => new Promise((resolve, reject) => {
|
|
6
|
+
execFile(file, [...args], { signal, timeout: 15_000, maxBuffer: 4_000_000, encoding: "utf8" }, (error, out, stderr) => {
|
|
7
|
+
if (error)
|
|
8
|
+
reject(new Error(`${file}: ${stderr.trim() || error.message}. Verifica installazione, sessione grafica e permessi desktop.`));
|
|
9
|
+
else
|
|
10
|
+
resolve(out.trim());
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
const string = (value, label) => {
|
|
14
|
+
if (typeof value !== "string" || !value.trim() || value.length > 4000 || value.includes("\0"))
|
|
15
|
+
throw new Error(`${label} non valido.`);
|
|
16
|
+
return value;
|
|
17
|
+
};
|
|
18
|
+
const integer = (value, label, min = 0, max = 100_000) => {
|
|
19
|
+
if (typeof value !== "number" || !Number.isInteger(value) || value < min || value > max)
|
|
20
|
+
throw new Error(`${label} non valido.`);
|
|
21
|
+
return value;
|
|
22
|
+
};
|
|
23
|
+
const schemaString = { type: "string" };
|
|
24
|
+
const schemaNumber = { type: "integer" };
|
|
25
|
+
/** Discrete desktop operations; factory is inert until the shared consent gate runs. */
|
|
26
|
+
export function posixComputerTools(platform, env, run = runDesktopCommand) {
|
|
27
|
+
const mac = platform === "darwin";
|
|
28
|
+
let target;
|
|
29
|
+
const check = () => {
|
|
30
|
+
if (!mac && (env["XDG_SESSION_TYPE"] === "wayland" || env["WAYLAND_DISPLAY"])) {
|
|
31
|
+
throw new Error("Wayland: controllo globale non disponibile. Usa una sessione X11; nessun bypass del consenso del compositor o fallback XWayland parziale.");
|
|
32
|
+
}
|
|
33
|
+
if (!mac && !env["DISPLAY"])
|
|
34
|
+
throw new Error("Nessun DISPLAY X11. Serve una sessione desktop locale, non headless/SSH.");
|
|
35
|
+
};
|
|
36
|
+
const command = (ctx, file, args) => {
|
|
37
|
+
if (ctx.signal.aborted)
|
|
38
|
+
throw new Error("Computer Use interrotto.");
|
|
39
|
+
return run(file, args, ctx.signal);
|
|
40
|
+
};
|
|
41
|
+
const apple = (ctx, source, args = []) => command(ctx, "/usr/bin/osascript", ["-e", `on run argv\n${source}\nend run`, "--", ...args]);
|
|
42
|
+
const focus = async (ctx) => {
|
|
43
|
+
if (!target)
|
|
44
|
+
throw new Error("Esegui computer_attach prima di inviare input.");
|
|
45
|
+
if (mac)
|
|
46
|
+
await apple(ctx, 'tell application "System Events" to set frontmost of first application process whose unix id is (item 1 of argv as integer) to true', [target]);
|
|
47
|
+
else
|
|
48
|
+
await command(ctx, "xdotool", ["windowactivate", "--sync", target]);
|
|
49
|
+
};
|
|
50
|
+
const tool = (name, description, properties, required, action) => ({
|
|
51
|
+
name, description, schema: { type: "object", properties, required, additionalProperties: false },
|
|
52
|
+
handler: async (input, ctx) => {
|
|
53
|
+
try {
|
|
54
|
+
if (ctx.signal.aborted)
|
|
55
|
+
throw new Error("Computer Use interrotto.");
|
|
56
|
+
check();
|
|
57
|
+
return await action(input, ctx);
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
return { output: error instanceof Error ? error.message : String(error), isError: true };
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
return [
|
|
65
|
+
{ name: "computer_status", description: "Diagnostica backend desktop e prerequisiti senza leggere lo schermo.", schema: { type: "object", properties: {} }, handler: async () => ({ output: JSON.stringify({ platform, backend: mac ? "macOS Accessibility + cliclick" : "X11 + xdotool", availableSession: mac || Boolean(env["DISPLAY"]) && !env["WAYLAND_DISPLAY"] && env["XDG_SESSION_TYPE"] !== "wayland", prerequisites: mac ? ["Registrazione schermo e Accessibilità per terminale/runtime", "cliclick installato (brew install cliclick)"] : ["Sessione X11 locale", "xdotool", "ImageMagick: import"], limitations: "Nessuna UI Automation Windows/RAC; coordinate desktop native, non coordinate PNG ridimensionato." }) }) },
|
|
66
|
+
tool("computer_processes", "Elenca applicazioni visibili (macOS: PID) o finestre X11 (ID), da usare con computer_attach.", {}, [], async (_, ctx) => ({ output: mac
|
|
67
|
+
? await apple(ctx, 'tell application "System Events"\nset rows to ""\nrepeat with p in (application processes whose background only is false)\nset rows to rows & (unix id of p as text) & tab & (name of p) & linefeed\nend repeat\nreturn rows\nend tell')
|
|
68
|
+
: await command(ctx, "xdotool", ["search", "--onlyvisible", "--name", "."]) })),
|
|
69
|
+
tool("computer_attach", "Collega e porta in primo piano un PID macOS o window ID X11 restituito da computer_processes.", { target: schemaString }, ["target"], async (input, ctx) => {
|
|
70
|
+
const next = string(input["target"], "target");
|
|
71
|
+
if (!/^\d{1,12}$/.test(next))
|
|
72
|
+
throw new Error("target deve essere un identificatore numerico.");
|
|
73
|
+
const previous = target;
|
|
74
|
+
target = next;
|
|
75
|
+
try {
|
|
76
|
+
await focus(ctx);
|
|
77
|
+
}
|
|
78
|
+
catch (error) {
|
|
79
|
+
target = previous;
|
|
80
|
+
throw error;
|
|
81
|
+
}
|
|
82
|
+
return { output: `Target collegato: ${target}. Usa computer_snapshot per osservare prima di agire.` };
|
|
83
|
+
}),
|
|
84
|
+
tool("computer_snapshot", "Cattura desktop intero in PNG come immagine. Può includere altre app e dati sensibili; non è una cattura isolata del target.", {}, [], async (_, ctx) => {
|
|
85
|
+
const dir = await mkdtemp(join(tmpdir(), "talos-desktop-"));
|
|
86
|
+
try {
|
|
87
|
+
const path = join(dir, "screen.png");
|
|
88
|
+
if (mac)
|
|
89
|
+
await command(ctx, "/usr/sbin/screencapture", ["-x", "-t", "png", path]);
|
|
90
|
+
else
|
|
91
|
+
await command(ctx, "import", ["-window", "root", path]);
|
|
92
|
+
const bytes = await readFile(path);
|
|
93
|
+
if (bytes.length > 12_000_000 || bytes.length < 24 || bytes.subarray(0, 8).toString("hex") !== "89504e470d0a1a0a")
|
|
94
|
+
throw new Error("Screenshot PNG non valido o oltre 12 MB.");
|
|
95
|
+
return { content: [{ type: "text", text: JSON.stringify({ width: bytes.readUInt32BE(16), height: bytes.readUInt32BE(20), coordinates: "desktop native; su Retina i pixel PNG possono differire dai punti mouse", target: target ?? null }) }, { type: "image", mimeType: "image/png", data: bytes.toString("base64") }] };
|
|
96
|
+
}
|
|
97
|
+
finally {
|
|
98
|
+
await rm(dir, { recursive: true, force: true });
|
|
99
|
+
}
|
|
100
|
+
}),
|
|
101
|
+
tool("computer_click", "Click su coordinate native del desktop dopo attach. Osserva lo screenshot e verifica l'esito; su Retina usa punti desktop.", { x: schemaNumber, y: schemaNumber, button: { type: "string", enum: ["left", "right"] } }, ["x", "y"], async (input, ctx) => {
|
|
102
|
+
const x = integer(input["x"], "x"), y = integer(input["y"], "y");
|
|
103
|
+
if (input["button"] !== undefined && !["left", "right"].includes(String(input["button"])))
|
|
104
|
+
throw new Error("button non valido.");
|
|
105
|
+
await focus(ctx);
|
|
106
|
+
await command(ctx, mac ? "cliclick" : "xdotool", mac ? [`${input["button"] === "right" ? "rc" : "c"}:${x},${y}`] : ["mousemove", "--sync", String(x), String(y), "click", input["button"] === "right" ? "3" : "1"]);
|
|
107
|
+
return { output: "Click inviato. Verifica con computer_snapshot; invio non equivale a successo dell'azione." };
|
|
108
|
+
}),
|
|
109
|
+
tool("computer_scroll", "Scorre il target focalizzato. Linux: rotella X11; macOS: tasti pagina, non movimento pixel preciso.", { direction: { type: "string", enum: ["up", "down"] }, amount: schemaNumber }, ["direction"], async (input, ctx) => {
|
|
110
|
+
if (input["direction"] !== "up" && input["direction"] !== "down")
|
|
111
|
+
throw new Error("direction non valida.");
|
|
112
|
+
const amount = integer(input["amount"] ?? 1, "amount", 1, 20);
|
|
113
|
+
await focus(ctx);
|
|
114
|
+
await command(ctx, mac ? "cliclick" : "xdotool", mac
|
|
115
|
+
? Array.from({ length: amount }, () => `kp:${input["direction"] === "up" ? "page-up" : "page-down"}`)
|
|
116
|
+
: ["click", "--repeat", String(amount), "--delay", "50", input["direction"] === "up" ? "4" : "5"]);
|
|
117
|
+
return { output: "Scorrimento inviato. Verifica la posizione con computer_snapshot." };
|
|
118
|
+
}),
|
|
119
|
+
tool("computer_type", "Digita testo nel controllo già focalizzato del target. Non cambia clipboard e non preme Invio.", { text: schemaString }, ["text"], async (input, ctx) => {
|
|
120
|
+
const text = string(input["text"], "text");
|
|
121
|
+
await focus(ctx);
|
|
122
|
+
await command(ctx, mac ? "cliclick" : "xdotool", mac ? [`t:${text}`] : ["type", "--clearmodifiers", "--", text]);
|
|
123
|
+
return { output: "Testo inviato; verifica il controllo prima di proseguire." };
|
|
124
|
+
}),
|
|
125
|
+
tool("computer_key", "Invia un tasto discreto: enter, tab, escape, backspace, up, down, left, right. Non accetta codice o combinazioni arbitrarie.", { key: { type: "string", enum: ["enter", "tab", "escape", "backspace", "up", "down", "left", "right"] } }, ["key"], async (input, ctx) => {
|
|
126
|
+
const keys = { enter: ["return", "Return"], tab: ["tab", "Tab"], escape: ["esc", "Escape"], backspace: ["delete", "BackSpace"], up: ["arrow-up", "Up"], down: ["arrow-down", "Down"], left: ["arrow-left", "Left"], right: ["arrow-right", "Right"] };
|
|
127
|
+
const keyName = String(input["key"]);
|
|
128
|
+
const key = Object.hasOwn(keys, keyName) ? keys[keyName] : undefined;
|
|
129
|
+
if (!key)
|
|
130
|
+
throw new Error("key non valido.");
|
|
131
|
+
await focus(ctx);
|
|
132
|
+
await command(ctx, mac ? "cliclick" : "xdotool", mac ? [`kp:${key[0]}`] : ["key", "--clearmodifiers", key[1]]);
|
|
133
|
+
return { output: "Tasto inviato; verifica l'esito." };
|
|
134
|
+
}),
|
|
135
|
+
];
|
|
136
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Tool } from "../core/types.js";
|
|
2
|
+
import type { ToolRegistry } from "./registry.js";
|
|
3
|
+
import { captureComputerDesktop } from "./computer-capture.js";
|
|
4
|
+
import { type DesktopRunner } from "./computer-posix.js";
|
|
5
|
+
export interface ComputerUseModule {
|
|
6
|
+
computerUseTools(options: Record<string, unknown>): readonly Tool[];
|
|
7
|
+
}
|
|
8
|
+
/** Standalone desktop tools. Loading definitions does not access the desktop. */
|
|
9
|
+
export declare function registerComputerUse(registry: ToolRegistry, env: NodeJS.ProcessEnv, options?: {
|
|
10
|
+
platform?: string;
|
|
11
|
+
load?: (path: string) => ComputerUseModule;
|
|
12
|
+
capture?: typeof captureComputerDesktop;
|
|
13
|
+
runDesktop?: DesktopRunner;
|
|
14
|
+
}): readonly string[];
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
3
|
+
import { isAbsolute } from "node:path";
|
|
4
|
+
import { captureComputerDesktop } from "./computer-capture.js";
|
|
5
|
+
import { normalizeMcpToolResult } from "../mcp/protocol.js";
|
|
6
|
+
import { posixComputerTools } from "./computer-posix.js";
|
|
7
|
+
const require = createRequire(import.meta.url);
|
|
8
|
+
const CONSENT = "Consenti accesso al desktop";
|
|
9
|
+
const unavailable = (output) => ({ output, isError: true });
|
|
10
|
+
/** Standalone desktop tools. Loading definitions does not access the desktop. */
|
|
11
|
+
export function registerComputerUse(registry, env, options = {}) {
|
|
12
|
+
if (env["TALOS_COMPUTER_USE"] === "0" || env["TALOS_HOST_PROFILE"]?.trim().toLowerCase() === "horizon")
|
|
13
|
+
return [];
|
|
14
|
+
const override = env["TALOS_COMPUTER_USE_MODULE"]?.trim();
|
|
15
|
+
const platform = options.platform ?? process.platform;
|
|
16
|
+
if (!["win32", "darwin", "linux"].includes(platform))
|
|
17
|
+
return [];
|
|
18
|
+
if (override && platform !== "win32")
|
|
19
|
+
throw new Error("Override Horizon disponibile solo su Windows; macOS/Linux usano il backend POSIX incorporato.");
|
|
20
|
+
const path = override ?? fileURLToPath(new URL("../vendor/computer-use/computer-tools.js", import.meta.url));
|
|
21
|
+
if (!isAbsolute(path))
|
|
22
|
+
throw new Error("TALOS_COMPUTER_USE_MODULE deve essere un percorso assoluto a computer-tools.js di Horizon.");
|
|
23
|
+
const module = platform === "win32"
|
|
24
|
+
? (options.load ?? ((file) => require(file)))(path)
|
|
25
|
+
: { computerUseTools: () => posixComputerTools(platform, env, options.runDesktop) };
|
|
26
|
+
if (typeof module.computerUseTools !== "function")
|
|
27
|
+
throw new Error("Modulo Computer Use incompatibile: manca computerUseTools.");
|
|
28
|
+
const capture = options.capture ?? captureComputerDesktop;
|
|
29
|
+
const excluded = new Set((env["TALOS_EXCLUDE_TOOLS"] ?? "").split(",").map((name) => name.trim()));
|
|
30
|
+
// Each session owns its target, snapshots and permission. A global queue
|
|
31
|
+
// prevents competing sessions/tools from driving the same physical desktop.
|
|
32
|
+
const sessions = new Map();
|
|
33
|
+
let tail = Promise.resolve();
|
|
34
|
+
const createSession = () => {
|
|
35
|
+
const state = { tools: [], approved: false };
|
|
36
|
+
state.tools = module.computerUseTools({
|
|
37
|
+
captureDesktop: (input) => capture(input, state.signal),
|
|
38
|
+
// CLI uses native UI Automation and discrete controls, not Electron RAC.
|
|
39
|
+
racStrictMode: false,
|
|
40
|
+
});
|
|
41
|
+
return state;
|
|
42
|
+
};
|
|
43
|
+
const definitions = createSession().tools;
|
|
44
|
+
if (!definitions.length)
|
|
45
|
+
throw new Error("Modulo Computer Use senza strumenti.");
|
|
46
|
+
const names = [];
|
|
47
|
+
for (const tool of definitions) {
|
|
48
|
+
if (!/^computer_[a-z_]+$/.test(tool.name) || typeof tool.handler !== "function") {
|
|
49
|
+
throw new Error("Definizione Computer Use incompatibile.");
|
|
50
|
+
}
|
|
51
|
+
if (/^computer_(control|control_reset|reactive_goal|reactive_status)$/.test(tool.name))
|
|
52
|
+
continue;
|
|
53
|
+
if (excluded.has(tool.name) || registry.get(tool.name))
|
|
54
|
+
continue;
|
|
55
|
+
registry.register({ ...tool, execution: "serial", handler: async (input, ctx) => {
|
|
56
|
+
const run = async () => {
|
|
57
|
+
if (ctx.signal.aborted)
|
|
58
|
+
return unavailable("Computer Use interrotto.");
|
|
59
|
+
if (ctx.executionTarget && ctx.executionTarget.kind !== "local") {
|
|
60
|
+
return unavailable("Computer Use non controlla il desktop locale da un target remoto.");
|
|
61
|
+
}
|
|
62
|
+
const key = ctx.sessionId ?? "standalone";
|
|
63
|
+
const state = sessions.get(key) ?? createSession();
|
|
64
|
+
sessions.delete(key);
|
|
65
|
+
sessions.set(key, state);
|
|
66
|
+
// Retain only a small LRU of inactive session targets/screenshots.
|
|
67
|
+
if (sessions.size > 8)
|
|
68
|
+
sessions.delete(sessions.keys().next().value);
|
|
69
|
+
// Deliberately do not use the generic auto-approval gate: --yolo is
|
|
70
|
+
// not device consent. Noninteractive callers need explicit env opt-in.
|
|
71
|
+
if (!state.approved) {
|
|
72
|
+
state.approved = env["TALOS_COMPUTER_USE_CONSENT"] === "session"
|
|
73
|
+
|| await ctx.ask?.("Computer Use può leggere lo schermo e controllare mouse/tastiera per questa sessione. Autorizzi?", [CONSENT, "Nega"]) === CONSENT;
|
|
74
|
+
}
|
|
75
|
+
if (ctx.signal.aborted)
|
|
76
|
+
return unavailable("Computer Use interrotto.");
|
|
77
|
+
if (!state.approved)
|
|
78
|
+
return unavailable("Consenso desktop negato o assente. In modalità non interattiva serve TALOS_COMPUTER_USE_CONSENT=session; --yolo non basta.");
|
|
79
|
+
state.signal = ctx.signal;
|
|
80
|
+
const actual = state.tools.find((item) => item.name === tool.name);
|
|
81
|
+
if (!actual)
|
|
82
|
+
return unavailable(`Tool Computer Use non disponibile: ${tool.name}`);
|
|
83
|
+
const context = { ...ctx, confirm: async (action, detail) => !ctx.signal.aborted && (action === "computer_use" ? state.approved : ctx.confirm(action, detail)) };
|
|
84
|
+
try {
|
|
85
|
+
const result = normalizeMcpToolResult(await actual.handler(input, context));
|
|
86
|
+
// Horizon envelopes sometimes encode failures in text/structuredContent.
|
|
87
|
+
const text = result.content.find((part) => part.type === "text");
|
|
88
|
+
let payload = result.structuredContent;
|
|
89
|
+
if (!payload && text?.type === "text") {
|
|
90
|
+
try {
|
|
91
|
+
payload = JSON.parse(text.text);
|
|
92
|
+
}
|
|
93
|
+
catch { /* plain text */ }
|
|
94
|
+
}
|
|
95
|
+
return payload?.["ok"] === false ? { ...result, isError: true } : result;
|
|
96
|
+
}
|
|
97
|
+
finally {
|
|
98
|
+
state.signal = undefined;
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
const pending = tail.then(run, run);
|
|
102
|
+
tail = pending.catch(() => { });
|
|
103
|
+
return pending;
|
|
104
|
+
} }, true);
|
|
105
|
+
names.push(tool.name);
|
|
106
|
+
}
|
|
107
|
+
return names;
|
|
108
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Tool } from "../core/types.js";
|
|
2
|
+
export declare const DISCOVERY_TOOL_NAMES: ReadonlySet<string>;
|
|
3
|
+
export declare const LEGACY_DISCOVERY_TOOL_NAMES: ReadonlySet<string>;
|
|
4
|
+
export declare const ESSENTIAL_TOOL_NAMES: ReadonlySet<string>;
|
|
5
|
+
export declare const CLI_DIRECT_TOOL_NAMES: ReadonlySet<string>;
|
|
6
|
+
export declare const FILE_DISCOVERY_TOOL_NAMES: readonly ["list_dir", "glob", "grep", "file_activity"];
|
|
7
|
+
export declare const HORIZON_DIRECT_TOOL_NAMES: ReadonlySet<string>;
|
|
8
|
+
type DiscoveryRegistry = NonNullable<Parameters<Tool["handler"]>[1]["tools"]>;
|
|
9
|
+
export declare function toolInventory(tools: DiscoveryRegistry): readonly ReturnType<DiscoveryRegistry["catalog"]>[number][];
|
|
10
|
+
export declare const toolListTool: Tool;
|
|
11
|
+
export declare const toolDescribeTool: Tool;
|
|
12
|
+
export {};
|