@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,348 @@
|
|
|
1
|
+
import { readTeamHandoff } from "../vascend/team-handoff.js";
|
|
2
|
+
import { resolveKingdomBus } from "../vascend/kingdom-channel.js";
|
|
3
|
+
import { MemoryStore } from "../vascend/memory-store.js";
|
|
4
|
+
import { pendingMembers, teamById, teamByKingdom, teamForSession } from "../vascend/team-session.js";
|
|
5
|
+
import { memberSlug, parseTeamMembers } from "./team-input.js";
|
|
6
|
+
import { kingdomLive } from "../vascend/kingdom-live.js";
|
|
7
|
+
// La squadra come si lavora davvero: la si ingaggia, le si parla, si aspetta
|
|
8
|
+
// solo quando non c'e' altro da fare.
|
|
9
|
+
//
|
|
10
|
+
// Prima ingaggiare voleva dire sparire dentro una tool call finche' l'ultimo
|
|
11
|
+
// non aveva finito. Qui l'ingaggio TORNA SUBITO e il turno prosegue: chi ha
|
|
12
|
+
// ingaggiato puo' assegnare parlando, correggere a meta' strada, rispondere a
|
|
13
|
+
// una domanda. E' la differenza fra dare un compito e lavorare insieme.
|
|
14
|
+
const WAIT_DEFAULT_S = 30;
|
|
15
|
+
const WAIT_MAX_S = 60;
|
|
16
|
+
const engagements = new Set();
|
|
17
|
+
// Chi parla. In una sessione delegata e' lo slug del collaboratore; altrimenti
|
|
18
|
+
// e' l'agente principale, che ora ha una voce sul canale come tutti gli altri:
|
|
19
|
+
// senza, "assegnare il compito parlando" non era esprimibile.
|
|
20
|
+
function speaker(ctx) {
|
|
21
|
+
return String(ctx.kingdom?.self || "orchestratore");
|
|
22
|
+
}
|
|
23
|
+
// Il canale su cui parla questa sessione: quello della squadra di cui fa parte,
|
|
24
|
+
// oppure quello della squadra che ha ingaggiato.
|
|
25
|
+
function channelId(ctx) {
|
|
26
|
+
if (ctx.kingdom?.id)
|
|
27
|
+
return ctx.kingdom.id;
|
|
28
|
+
const team = teamForSession(String(ctx.sessionId || ""));
|
|
29
|
+
return team ? team.id : "";
|
|
30
|
+
}
|
|
31
|
+
function noTeam() {
|
|
32
|
+
return "nessuna squadra al lavoro: ingaggiala con team_engage";
|
|
33
|
+
}
|
|
34
|
+
function bus(ctx) {
|
|
35
|
+
return resolveKingdomBus(process.env, ctx.sessionDir);
|
|
36
|
+
}
|
|
37
|
+
function fmt(m) {
|
|
38
|
+
return `${m.from} -> ${m.to ?? "tutti"}: ${m.text}`;
|
|
39
|
+
}
|
|
40
|
+
function text(input, key) {
|
|
41
|
+
const value = input[key];
|
|
42
|
+
return typeof value === "string" ? value.trim() : "";
|
|
43
|
+
}
|
|
44
|
+
async function sleep(ms, signal) {
|
|
45
|
+
return new Promise((resolve, reject) => {
|
|
46
|
+
if (signal.aborted) {
|
|
47
|
+
reject(new Error("interrotto"));
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
const cleanup = () => { clearTimeout(timer); signal.removeEventListener("abort", onAbort); };
|
|
51
|
+
const onAbort = () => { cleanup(); reject(new Error("interrotto")); };
|
|
52
|
+
const timer = setTimeout(() => { cleanup(); resolve(); }, ms);
|
|
53
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
function currentTeam(ctx) {
|
|
57
|
+
return ctx.kingdom?.id ? teamByKingdom(ctx.kingdom.id) : teamForSession(String(ctx.sessionId || ""));
|
|
58
|
+
}
|
|
59
|
+
function addressKey(value) {
|
|
60
|
+
return value.split("/").map(memberSlug).join("/");
|
|
61
|
+
}
|
|
62
|
+
function teamAddress(value, ctx) {
|
|
63
|
+
const members = [...new Set(["orchestratore", ...(currentTeam(ctx)?.members.map((member) => member.slug) ?? []),
|
|
64
|
+
...(ctx.kingdom?.peers ?? []), ...kingdomLive.slugs(channelId(ctx))])];
|
|
65
|
+
const key = addressKey(value);
|
|
66
|
+
const parent = speaker(ctx).split("/").slice(0, -1).join("/");
|
|
67
|
+
const address = members.find((member) => addressKey(member) === key)
|
|
68
|
+
?? (parent ? members.find((member) => addressKey(member) === addressKey(`${parent}/${value}`)) : undefined);
|
|
69
|
+
return { address: address ?? key, known: Boolean(address), members };
|
|
70
|
+
}
|
|
71
|
+
export const teamEngageTool = {
|
|
72
|
+
name: "team_engage",
|
|
73
|
+
description: "Ingaggia collaboratori quando l'utente richiede lavoro di team o delega. Assegna un mandate completo "
|
|
74
|
+
+ "con risultato atteso e verifica, oppure group/tasks del piano esistente. Gli incarichi indipendenti "
|
|
75
|
+
+ "partono in parallelo entro il limite; after attende il successo dei prerequisiti e ne riceve i risultati. "
|
|
76
|
+
+ "Dichiara area con percorsi concreti: senza worktree le aree sovrapposte o mancanti si eseguono in sequenza. "
|
|
77
|
+
+ "Le aree coordinano il lavoro, non sono una sandbox. Torna subito sull'host asincrono. "
|
|
78
|
+
+ "Coordina con team_say/team_inbox, lavora su attivita' indipendenti e raccogli stato e risultati con "
|
|
79
|
+
+ "team_report prima della consegna. Non duplicare una squadra ancora attiva.",
|
|
80
|
+
schema: {
|
|
81
|
+
type: "object",
|
|
82
|
+
properties: {
|
|
83
|
+
members: {
|
|
84
|
+
type: "array",
|
|
85
|
+
minItems: 1,
|
|
86
|
+
maxItems: 32,
|
|
87
|
+
description: "i collaboratori da ingaggiare",
|
|
88
|
+
items: {
|
|
89
|
+
type: "object",
|
|
90
|
+
properties: {
|
|
91
|
+
slug: { type: "string", description: "nome breve, es. recon-frontend" },
|
|
92
|
+
role: { type: "string", description: "di cosa si occupa" },
|
|
93
|
+
mandate: { type: "string", description: "compito completo con risultato atteso e verifica; opzionale con group" },
|
|
94
|
+
group: { type: "string", description: "gruppo del piano esistente assegnato al collaboratore" },
|
|
95
|
+
tasks: { type: "array", items: { type: "string" }, description: "attivita del gruppo (T01 o bit); default tutte le aperte" },
|
|
96
|
+
area: {
|
|
97
|
+
type: "array",
|
|
98
|
+
items: { type: "string" },
|
|
99
|
+
description: "percorsi di competenza (es. src/api), senza glob. Aree disgiunte consentono concorrenza nella cartella condivisa",
|
|
100
|
+
},
|
|
101
|
+
after: {
|
|
102
|
+
type: "array",
|
|
103
|
+
items: { type: "string" },
|
|
104
|
+
description: "slug dei prerequisiti nello stesso ingaggio; parte solo dopo il loro successo. Ometti per lavori indipendenti",
|
|
105
|
+
},
|
|
106
|
+
model: { type: "string", description: "modello dedicato; ometti per ereditare" },
|
|
107
|
+
effort: { type: "string", enum: ["low", "medium", "high", "max"] },
|
|
108
|
+
parent: { type: "string", description: "a chi risponde (default: chi ingaggia)" },
|
|
109
|
+
instructions: { type: "string", description: "istruzioni aggiuntive in Markdown" },
|
|
110
|
+
tools: {
|
|
111
|
+
type: "object",
|
|
112
|
+
description: "cosa puo' e non puo' usare",
|
|
113
|
+
properties: {
|
|
114
|
+
allow: { type: "array", items: { type: "string" } },
|
|
115
|
+
deny: { type: "array", items: { type: "string" } },
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
required: ["slug"],
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
why: { type: "string", description: "perche' ti serve una mano: lo legge l'utente" },
|
|
123
|
+
},
|
|
124
|
+
required: ["members"],
|
|
125
|
+
},
|
|
126
|
+
handler: async (input, ctx) => {
|
|
127
|
+
if (!ctx.spawnKingdom)
|
|
128
|
+
return "non posso ingaggiare collaboratori in questo contesto";
|
|
129
|
+
let members;
|
|
130
|
+
try {
|
|
131
|
+
members = parseTeamMembers(input["members"], ctx);
|
|
132
|
+
}
|
|
133
|
+
catch (error) {
|
|
134
|
+
return { output: `errore: ${error.message}`, isError: true };
|
|
135
|
+
}
|
|
136
|
+
const session = String(ctx.sessionId ?? "");
|
|
137
|
+
const active = teamForSession(session);
|
|
138
|
+
if (engagements.has(session) || (active && !active.done)) {
|
|
139
|
+
return { output: "team gia' in avvio o al lavoro: usa team_report e team_say per coordinarlo", isError: true };
|
|
140
|
+
}
|
|
141
|
+
/* Ingaggiare costa: sono agenti veri che girano. Passa dal cancello dei
|
|
142
|
+
permessi come ogni altra azione che consuma, e la modalita' dell'host
|
|
143
|
+
decide se chiedere davvero o lasciar correre. */
|
|
144
|
+
engagements.add(session);
|
|
145
|
+
try {
|
|
146
|
+
const dettaglio = `${members.length} collaborator${members.length === 1 ? "e" : "i"}: `
|
|
147
|
+
+ members.map((m) => m.slug).join(", ") + (text(input, "why") ? `; ${text(input, "why")}` : "");
|
|
148
|
+
const ok = await ctx.confirm("team_engage", dettaglio);
|
|
149
|
+
if (!ok)
|
|
150
|
+
return "Ingaggio rifiutato dall'utente";
|
|
151
|
+
if (ctx.signal.aborted)
|
|
152
|
+
return "ingaggio interrotto";
|
|
153
|
+
const result = await ctx.spawnKingdom(members, { detach: true });
|
|
154
|
+
for (const name of ["team_say", "team_inbox", "team_wait", "team_report", "vascend_status"])
|
|
155
|
+
ctx.tools?.promote?.(name);
|
|
156
|
+
return result;
|
|
157
|
+
}
|
|
158
|
+
finally {
|
|
159
|
+
engagements.delete(session);
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
};
|
|
163
|
+
export const teamSayTool = {
|
|
164
|
+
name: "team_say",
|
|
165
|
+
description: "Parla con la squadra mentre lavora: assegna un compito, precisa cosa serve, correggi una direzione "
|
|
166
|
+
+ "sbagliata prima che diventi lavoro buttato. `to` = nome di un collaboratore, oppure ometti per "
|
|
167
|
+
+ "dirlo a tutti. Vale anche fra collaboratori: annuncia cosa hai finito e cosa sblocca, o chiedi "
|
|
168
|
+
+ "un prerequisito.",
|
|
169
|
+
schema: {
|
|
170
|
+
type: "object",
|
|
171
|
+
properties: {
|
|
172
|
+
to: { type: "string", description: "destinatario; ometti per tutti" },
|
|
173
|
+
text: { type: "string", description: "il messaggio" },
|
|
174
|
+
},
|
|
175
|
+
required: ["text"],
|
|
176
|
+
},
|
|
177
|
+
handler: async (input, ctx) => {
|
|
178
|
+
const id = channelId(ctx);
|
|
179
|
+
if (!id)
|
|
180
|
+
return noTeam();
|
|
181
|
+
const messaggio = text(input, "text");
|
|
182
|
+
if (!messaggio)
|
|
183
|
+
return "errore: messaggio vuoto";
|
|
184
|
+
const recipient = text(input, "to");
|
|
185
|
+
const routed = teamAddress(recipient, ctx);
|
|
186
|
+
const to = recipient ? routed.address : null;
|
|
187
|
+
if (to && !routed.known && (currentTeam(ctx) || ctx.kingdom?.peers?.length)) {
|
|
188
|
+
return { output: `destinatario sconosciuto: ${to}; membri: ${routed.members.join(", ")}`, isError: true };
|
|
189
|
+
}
|
|
190
|
+
const m = bus(ctx).post(id, speaker(ctx), to, messaggio, Date.now());
|
|
191
|
+
/* Quello che la squadra si dice entra anche in MEMORIA. Su un lavoro lungo
|
|
192
|
+
la decisione presa parlando vale quanto quella scritta in un file, e fra
|
|
193
|
+
due settimane la si ritrova solo se recall puo' pescarla. Best-effort: il
|
|
194
|
+
canale resta la fonte immediata, la persistenza non deve costare il turno. */
|
|
195
|
+
if (ctx.sessionDir) {
|
|
196
|
+
try {
|
|
197
|
+
MemoryStore.open(ctx.sessionDir, ctx.roomStoreId ?? id).append({
|
|
198
|
+
type: "team.message",
|
|
199
|
+
domain: "kingdom",
|
|
200
|
+
subject: `${m.from}->${m.to ?? "tutti"}`,
|
|
201
|
+
summary: messaggio,
|
|
202
|
+
body: fmt(m),
|
|
203
|
+
terms: [m.from, m.to ?? "tutti", ...messaggio.split(/\s+/)],
|
|
204
|
+
links: [
|
|
205
|
+
{ rel: "from", target: m.from, domain: "kingdom" },
|
|
206
|
+
...(m.to ? [{ rel: "to", target: m.to, domain: "kingdom" }] : []),
|
|
207
|
+
],
|
|
208
|
+
payload: { message: m },
|
|
209
|
+
createdAt: m.ts,
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
catch {
|
|
213
|
+
// Senza memoria il messaggio e' comunque arrivato a destinazione.
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
return `detto ${fmt(m)}`;
|
|
217
|
+
},
|
|
218
|
+
};
|
|
219
|
+
export const teamInboxTool = {
|
|
220
|
+
name: "team_inbox",
|
|
221
|
+
description: "Leggi cosa ti hanno detto: risposte, domande, annunci di cio' che e' pronto. Non blocca. "
|
|
222
|
+
+ "Controllalo prima di dare per fatto qualcosa che stava facendo un altro.",
|
|
223
|
+
schema: { type: "object", properties: {} },
|
|
224
|
+
handler: async (_input, ctx) => {
|
|
225
|
+
const id = channelId(ctx);
|
|
226
|
+
if (!id)
|
|
227
|
+
return noTeam();
|
|
228
|
+
const msgs = bus(ctx).inbox(id, speaker(ctx));
|
|
229
|
+
if (!msgs.length)
|
|
230
|
+
return "niente di nuovo";
|
|
231
|
+
return msgs.map(fmt).join("\n");
|
|
232
|
+
},
|
|
233
|
+
};
|
|
234
|
+
export const teamWaitTool = {
|
|
235
|
+
name: "team_wait",
|
|
236
|
+
description: "Aspetta che arrivi un messaggio, o che la squadra finisca. Usalo SOLO se non hai altro di utile da "
|
|
237
|
+
+ "fare: se puoi andare avanti su un altro pezzo, vai avanti. Filtra per `from` e/o `contains`. "
|
|
238
|
+
+ "Scade dopo `timeout_s` e torna dicendo cosa sta ancora girando.",
|
|
239
|
+
schema: {
|
|
240
|
+
type: "object",
|
|
241
|
+
properties: {
|
|
242
|
+
from: { type: "string", description: "aspetta solo da questo collaboratore" },
|
|
243
|
+
contains: { type: "string", description: "aspetta un messaggio che contiene questo testo" },
|
|
244
|
+
timeout_s: { type: "number", description: `secondi di attesa (default ${WAIT_DEFAULT_S}, max ${WAIT_MAX_S})` },
|
|
245
|
+
},
|
|
246
|
+
},
|
|
247
|
+
handler: async (input, ctx) => {
|
|
248
|
+
const id = channelId(ctx);
|
|
249
|
+
if (!id)
|
|
250
|
+
return noTeam();
|
|
251
|
+
const me = speaker(ctx);
|
|
252
|
+
const from = addressKey(teamAddress(text(input, "from"), ctx).address);
|
|
253
|
+
const contains = text(input, "contains").toLowerCase();
|
|
254
|
+
const richiesti = Number(input["timeout_s"]);
|
|
255
|
+
const secondi = Number.isFinite(richiesti) ? Math.min(WAIT_MAX_S, Math.max(1, richiesti)) : WAIT_DEFAULT_S;
|
|
256
|
+
const scadenza = Date.now() + secondi * 1000;
|
|
257
|
+
const combacia = (m) => (!from || addressKey(m.from) === from) && (!contains || m.text.toLowerCase().includes(contains));
|
|
258
|
+
const canale = bus(ctx);
|
|
259
|
+
for (;;) {
|
|
260
|
+
if (ctx.signal.aborted)
|
|
261
|
+
return "attesa interrotta";
|
|
262
|
+
const msgs = canale.inbox(id, me, combacia);
|
|
263
|
+
if (msgs.length)
|
|
264
|
+
return `arrivato:\n${msgs.map(fmt).join("\n")}`;
|
|
265
|
+
const team = currentTeam(ctx);
|
|
266
|
+
if (team && team.done)
|
|
267
|
+
return `${team.failed ? "squadra terminata con errori" : "la squadra ha finito"}.\n${team.report}`;
|
|
268
|
+
if (Date.now() >= scadenza) {
|
|
269
|
+
const ancora = team ? pendingMembers(team) : [];
|
|
270
|
+
return `nessuna risposta entro ${secondi}s`
|
|
271
|
+
+ (ancora.length ? `: stanno ancora lavorando ${ancora.join(", ")}` : "")
|
|
272
|
+
+ ". Vai avanti con quello che puoi.";
|
|
273
|
+
}
|
|
274
|
+
try {
|
|
275
|
+
await sleep(Math.min(250, Math.max(1, scadenza - Date.now())), ctx.signal);
|
|
276
|
+
}
|
|
277
|
+
catch {
|
|
278
|
+
return "attesa interrotta";
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
},
|
|
282
|
+
};
|
|
283
|
+
function reportResult(output, team, live = true) {
|
|
284
|
+
const references = team.members.flatMap((member) => (member.artifacts ?? []).slice(-6).map((ref) => `[${member.slug}] output_page id="${ref.id}" scope="${ref.scope}" (${ref.name}, ${ref.chars} char)`));
|
|
285
|
+
return {
|
|
286
|
+
output: output + (references.length ? "\nArtefatti recuperabili:\n" + references.join("\n") : "")
|
|
287
|
+
+ ("persistenceError" in team && team.persistenceError ? "\nCheckpoint non salvato: " + team.persistenceError : ""),
|
|
288
|
+
structuredContent: { team_id: team.id, revision: team.revision ?? 0, runtime: live ? "live" : "offline",
|
|
289
|
+
done: team.done, failed: team.failed, members: team.members,
|
|
290
|
+
...("persistenceError" in team && team.persistenceError ? { persistenceError: team.persistenceError } : {}) },
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
export const teamReportTool = {
|
|
294
|
+
name: "team_report",
|
|
295
|
+
description: "Raccogli stato, task e risultati della squadra, con revisione e artefatti recuperabili via output_page. "
|
|
296
|
+
+ "Il checkpoint sopravvive al riavvio. wait=true attende fino a timeout_s; altrimenti torna subito.",
|
|
297
|
+
schema: {
|
|
298
|
+
type: "object",
|
|
299
|
+
properties: {
|
|
300
|
+
team_id: { type: "string", description: "squadra di questa sessione da recuperare; default: la piu' recente" },
|
|
301
|
+
wait: { type: "boolean", description: "true: aspetta che finiscano (fino a timeout_s)" },
|
|
302
|
+
timeout_s: { type: "number", description: `secondi massimi di attesa (default ${WAIT_DEFAULT_S}, max ${WAIT_MAX_S})` },
|
|
303
|
+
},
|
|
304
|
+
},
|
|
305
|
+
handler: async (input, ctx) => {
|
|
306
|
+
const requested = typeof input["team_id"] === "string" ? input["team_id"].trim() : "";
|
|
307
|
+
const team = requested ? teamById(ctx.sessionId ?? "", requested) : currentTeam(ctx);
|
|
308
|
+
if (!team) {
|
|
309
|
+
const saved = ctx.sessionDir && ctx.sessionId ? readTeamHandoff(ctx.sessionDir, ctx.sessionId, requested || undefined) : null;
|
|
310
|
+
return saved ? reportResult(`Checkpoint squadra ${saved.id}, revisione ${saved.revision}. `
|
|
311
|
+
+ (saved.done ? "Lavoro terminato.\n" : "Runtime non attivo: gli incarichi incompleti vanno ripresi.\n")
|
|
312
|
+
+ (saved.failed ? "Sono presenti incarichi falliti.\n" : "")
|
|
313
|
+
+ (saved.report || saved.members.map((member) => `[${member.slug}] ${member.status}: ${member.summary ?? member.error ?? ""}`).join("\n")), saved, false) : noTeam();
|
|
314
|
+
}
|
|
315
|
+
const finished = (current) => reportResult(`${current.failed ? "squadra terminata con errori:\n" : ""}${current.report || "la squadra ha finito"}`, current);
|
|
316
|
+
if (team.done)
|
|
317
|
+
return finished(team);
|
|
318
|
+
const progress = team.members.map((member) => `[${member.slug}] ${member.status ?? "queued"}`
|
|
319
|
+
+ (member.error ? `: ${member.error}` : member.summary ? `: ${member.summary.slice(0, 600)}` : "")).join("\n");
|
|
320
|
+
if (input["wait"] !== true)
|
|
321
|
+
return reportResult(`stanno ancora lavorando: ${pendingMembers(team).join(", ")}.`
|
|
322
|
+
+ `\n${progress}\nContinua con quello che puoi, oppure chiama team_report con wait=true.`, team);
|
|
323
|
+
const richiesti = Number(input["timeout_s"]);
|
|
324
|
+
const secondi = Number.isFinite(richiesti) ? Math.min(WAIT_MAX_S, Math.max(1, richiesti)) : WAIT_DEFAULT_S;
|
|
325
|
+
const deadline = Date.now() + secondi * 1000;
|
|
326
|
+
while (Date.now() < deadline) {
|
|
327
|
+
if (ctx.signal.aborted)
|
|
328
|
+
return reportResult("attesa interrotta; il lavoro del team non viene cancellato", currentTeam(ctx) ?? team);
|
|
329
|
+
const current = requested ? teamById(ctx.sessionId ?? "", requested) : currentTeam(ctx);
|
|
330
|
+
if (current?.done)
|
|
331
|
+
return finished(current);
|
|
332
|
+
try {
|
|
333
|
+
await sleep(Math.min(250, Math.max(1, deadline - Date.now())), ctx.signal);
|
|
334
|
+
}
|
|
335
|
+
catch {
|
|
336
|
+
return reportResult("attesa interrotta; il lavoro del team non viene cancellato", currentTeam(ctx) ?? team);
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
return reportResult(`non hanno ancora finito dopo ${secondi}s: ${pendingMembers(currentTeam(ctx) ?? team).join(", ")}. Richiama team_report piu' tardi.`, currentTeam(ctx) ?? team);
|
|
340
|
+
},
|
|
341
|
+
};
|
|
342
|
+
export const teamTools = [
|
|
343
|
+
teamEngageTool,
|
|
344
|
+
teamSayTool,
|
|
345
|
+
teamInboxTool,
|
|
346
|
+
teamWaitTool,
|
|
347
|
+
teamReportTool,
|
|
348
|
+
];
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export const workspaceSessionsTool = {
|
|
2
|
+
name: "workspace_sessions",
|
|
3
|
+
description: "Rileva altre sessioni Talos attive nella stessa cartella e invia messaggi di coordinamento. "
|
|
4
|
+
+ "I messaggi ricevuti entrano automaticamente al prossimo confine sicuro del turno; le sessioni inattive li leggono al prossimo turno.",
|
|
5
|
+
schema: {
|
|
6
|
+
type: "object",
|
|
7
|
+
properties: {
|
|
8
|
+
action: { type: "string", enum: ["list", "send"], description: "default list" },
|
|
9
|
+
to: { type: "string", description: "id esatto del destinatario restituito da list" },
|
|
10
|
+
message: { type: "string", description: "messaggio conciso; massimo 6000 byte" },
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
handler: async (input, ctx) => {
|
|
14
|
+
if (ctx.signal.aborted)
|
|
15
|
+
return { output: "chiamata annullata", isError: true };
|
|
16
|
+
const channel = ctx.workspaceSession;
|
|
17
|
+
if (!channel)
|
|
18
|
+
return { output: "coordinamento tra sessioni non attivo in questo host", isError: true };
|
|
19
|
+
const action = input["action"] ?? "list";
|
|
20
|
+
if (action === "list")
|
|
21
|
+
return JSON.stringify({ self: channel.id, peers: channel.peers() });
|
|
22
|
+
if (action !== "send")
|
|
23
|
+
return { output: "action deve essere list oppure send", isError: true };
|
|
24
|
+
if (typeof input["to"] !== "string" || typeof input["message"] !== "string") {
|
|
25
|
+
return { output: "send richiede to e message come stringhe", isError: true };
|
|
26
|
+
}
|
|
27
|
+
try {
|
|
28
|
+
const message = channel.send(input["to"], input["message"]);
|
|
29
|
+
return JSON.stringify({ id: message.id, to: message.to, status: "queued" });
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
return { output: error.message, isError: true };
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function enterAccount(env: NodeJS.ProcessEnv): Promise<string>;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import * as readline from "node:readline";
|
|
2
|
+
import { stdin, stdout } from "node:process";
|
|
3
|
+
import { openUrl } from "../providers/open-browser.js";
|
|
4
|
+
import { tr } from "./i18n.js";
|
|
5
|
+
import { initializeLanguage, onboardingLanguage } from "./language-preference.js";
|
|
6
|
+
import { leggiOnboarding, salvaOnboarding, serveTermini, TESTI, consensoAffermativo, TERMINI_VERSIONE, LINK_TERMINI, LINK_PRIVACY } from "./onboarding.js";
|
|
7
|
+
import { decisioneCancello, tokenVascend, statoSessione, valutaLicenzaLocale, rimuoviTokenVascend, salvaTokenVascend, rinnovaProvaOffline } from "./vascend-login.js";
|
|
8
|
+
import { startWebLogin, waitForWebLogin, WebLoginError } from "./web-login.js";
|
|
9
|
+
export async function enterAccount(env) {
|
|
10
|
+
const language = initializeLanguage(env);
|
|
11
|
+
const state = onboardingLanguage(leggiOnboarding(env), env);
|
|
12
|
+
// Host/test flags only control this local UI. Server authorization always
|
|
13
|
+
// requires a verified session and current account permissions.
|
|
14
|
+
if (env["TALOS_NO_LOGIN"] === "1")
|
|
15
|
+
return "";
|
|
16
|
+
const saved = tokenVascend(env);
|
|
17
|
+
const session = saved ? await statoSessione(env, saved) : null;
|
|
18
|
+
if (!stdin.isTTY || !stdout.isTTY || env["TALOS_HOST_PROFILE"]?.toLowerCase() === "horizon")
|
|
19
|
+
return "";
|
|
20
|
+
const offline = session?.stato === "irraggiungibile" ? valutaLicenzaLocale(env) : null;
|
|
21
|
+
const decision = decisioneCancello(saved, session, offline);
|
|
22
|
+
let tier = decision.tier;
|
|
23
|
+
let token = saved;
|
|
24
|
+
const note = () => tr("Account connesso", "Account connected") +
|
|
25
|
+
(tier ? ` · ${tr("Piano", "Plan")} ${tier}` : "");
|
|
26
|
+
if (decision.azione === "prosegui" && !serveTermini(state)) {
|
|
27
|
+
if (session?.stato === "valida" && token)
|
|
28
|
+
void rinnovaProvaOffline(env, token).catch(() => { });
|
|
29
|
+
return offline?.ok ? tr("Account offline · prova firmata valida", "Offline account · signed proof valid") : note();
|
|
30
|
+
}
|
|
31
|
+
const abort = new AbortController();
|
|
32
|
+
const rl = readline.createInterface({ input: stdin, output: stdout });
|
|
33
|
+
const cancel = () => abort.abort();
|
|
34
|
+
rl.on("SIGINT", cancel);
|
|
35
|
+
const write = (text) => { stdout.write(` ${text}\n`); };
|
|
36
|
+
try {
|
|
37
|
+
if (decision.azione === "login") {
|
|
38
|
+
if (saved)
|
|
39
|
+
rimuoviTokenVascend(env);
|
|
40
|
+
write(tr("Accesso a Vascend Talos", "Sign in to Vascend Talos"));
|
|
41
|
+
write(tr("Accedi sul sito e conferma il collegamento a Talos.", "Sign in on the website and approve the connection to Talos."));
|
|
42
|
+
const grant = await startWebLogin(env, language, {}, abort.signal);
|
|
43
|
+
write(grant.url);
|
|
44
|
+
write(`${tr("Codice", "Code")}: ${grant.userCode.slice(0, 5)}-${grant.userCode.slice(5)}`);
|
|
45
|
+
write(tr("Confronta il codice sul sito. In attesa della conferma · Ctrl+C annulla", "Compare the code on the website. Waiting for approval · Ctrl+C cancel"));
|
|
46
|
+
await openUrl(grant.url, { print: () => { } });
|
|
47
|
+
const account = await waitForWebLogin(env, grant, {}, abort.signal);
|
|
48
|
+
if (!salvaTokenVascend(env, account.token))
|
|
49
|
+
throw new Error(TESTI[language].tokenNonSalvabile);
|
|
50
|
+
token = account.token;
|
|
51
|
+
tier = account.tier;
|
|
52
|
+
write(TESTI[language].benvenuto(account.email));
|
|
53
|
+
await rinnovaProvaOffline(env, token).catch(() => { });
|
|
54
|
+
}
|
|
55
|
+
if (serveTermini(state)) {
|
|
56
|
+
const t = TESTI[language];
|
|
57
|
+
write(t.terminiTitolo);
|
|
58
|
+
write(t.terminiCorpo);
|
|
59
|
+
write(`${t.terminiEtichetta}: ${LINK_TERMINI}`);
|
|
60
|
+
write(`${t.privacyEtichetta}: ${LINK_PRIVACY}`);
|
|
61
|
+
const answer = await new Promise((resolve, reject) => {
|
|
62
|
+
const onAbort = () => reject(new WebLoginError("cancelled"));
|
|
63
|
+
if (abort.signal.aborted) {
|
|
64
|
+
onAbort();
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
abort.signal.addEventListener("abort", onAbort, { once: true });
|
|
68
|
+
rl.question(` ${t.terminiDomanda} `, answer => {
|
|
69
|
+
abort.signal.removeEventListener("abort", onAbort);
|
|
70
|
+
resolve(answer);
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
if (!consensoAffermativo(answer, language))
|
|
74
|
+
throw new Error(t.terminiRifiutati);
|
|
75
|
+
salvaOnboarding(env, { ...state, lingua: language, terminiVersione: TERMINI_VERSIONE, terminiQuando: new Date().toISOString() });
|
|
76
|
+
}
|
|
77
|
+
return note();
|
|
78
|
+
}
|
|
79
|
+
catch (e) {
|
|
80
|
+
if (e instanceof WebLoginError) {
|
|
81
|
+
const messages = {
|
|
82
|
+
cancelled: tr("Accesso annullato.", "Sign-in cancelled."),
|
|
83
|
+
expired_token: tr("Link scaduto. Riavvia Talos per riprovare.", "Link expired. Restart Talos to try again."),
|
|
84
|
+
access_denied: tr("Collegamento annullato dal sito.", "Connection cancelled on the website."),
|
|
85
|
+
};
|
|
86
|
+
throw new Error(messages[e.code] ?? tr("Accesso dal sito non disponibile. Riprova fra poco.", "Website sign-in is unavailable. Please try again shortly."));
|
|
87
|
+
}
|
|
88
|
+
throw e;
|
|
89
|
+
}
|
|
90
|
+
finally {
|
|
91
|
+
rl.close();
|
|
92
|
+
}
|
|
93
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function createAttachmentHighlighter(source: string, paint: ((text: string) => string) | undefined): (row: string, offset?: number) => string;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { IMAGE_REF, TEXT_REF } from "./attachment-refs.js";
|
|
2
|
+
// Il colore viene applicato solo alla vista: testo, offset del cursore e
|
|
3
|
+
// riferimenti usati per recuperare gli allegati restano identici.
|
|
4
|
+
export function createAttachmentHighlighter(source, paint) {
|
|
5
|
+
if (!paint)
|
|
6
|
+
return row => row;
|
|
7
|
+
const refs = new RegExp(`${IMAGE_REF}|${TEXT_REF}`, "gi");
|
|
8
|
+
const spans = [...source.matchAll(refs)].map(match => ({ start: match.index, end: match.index + match[0].length }));
|
|
9
|
+
return (row, offset = 0) => {
|
|
10
|
+
let cursor = 0;
|
|
11
|
+
let output = "";
|
|
12
|
+
for (const span of spans) {
|
|
13
|
+
const start = Math.max(0, span.start - offset);
|
|
14
|
+
const end = Math.min(row.length, span.end - offset);
|
|
15
|
+
if (start >= row.length)
|
|
16
|
+
break;
|
|
17
|
+
if (end <= start)
|
|
18
|
+
continue;
|
|
19
|
+
output += row.slice(cursor, start) + paint(row.slice(start, end));
|
|
20
|
+
cursor = end;
|
|
21
|
+
}
|
|
22
|
+
return output + row.slice(cursor);
|
|
23
|
+
};
|
|
24
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// Keep legacy references readable in saved prompts and queued messages.
|
|
2
|
+
export const IMAGE_REF = String.raw `(?:\[(?:image|img)|\bimg)[ \t]*#[ \t]*(\d+)\b\]?`;
|
|
3
|
+
export const TEXT_REF = String.raw `(?:\[(?:text|txt)|\btxt)[ \t]*#[ \t]*(\d+)\b(?:[ \t]*\u00b7[ \t]*\d+[ \t]*(?:caratteri|characters|caracteres|Zeichen))?\]?`;
|