@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,60 @@
|
|
|
1
|
+
import type { AgentEvent, Message, ToolCallPart } from "../core/types.js";
|
|
2
|
+
export type ReviewState = "running" | "ok" | "error" | "stopped" | "info";
|
|
3
|
+
export type ReviewKind = "tool" | "file" | "team" | "notice";
|
|
4
|
+
export interface ReviewChange {
|
|
5
|
+
readonly before?: string;
|
|
6
|
+
readonly after: string;
|
|
7
|
+
readonly scope: "file" | "fragment" | "append" | "reported";
|
|
8
|
+
}
|
|
9
|
+
export interface ReviewEntry {
|
|
10
|
+
readonly id: string;
|
|
11
|
+
readonly kind: ReviewKind;
|
|
12
|
+
readonly title: string;
|
|
13
|
+
readonly tool?: string;
|
|
14
|
+
readonly target: string;
|
|
15
|
+
readonly actor: string;
|
|
16
|
+
readonly state: ReviewState;
|
|
17
|
+
readonly startedAt?: number;
|
|
18
|
+
readonly endedAt?: number;
|
|
19
|
+
readonly input?: Readonly<Record<string, unknown>>;
|
|
20
|
+
readonly output?: string;
|
|
21
|
+
readonly change?: ReviewChange;
|
|
22
|
+
readonly parentId?: string;
|
|
23
|
+
readonly role?: string;
|
|
24
|
+
readonly parent?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare function reviewTitle(name: string): string;
|
|
27
|
+
export declare function callTarget(call: ToolCallPart): string;
|
|
28
|
+
export declare class ReviewStore {
|
|
29
|
+
private readonly capacity;
|
|
30
|
+
private items;
|
|
31
|
+
private callIndex;
|
|
32
|
+
private actorText;
|
|
33
|
+
private sequence;
|
|
34
|
+
private run;
|
|
35
|
+
private _revision;
|
|
36
|
+
private _evicted;
|
|
37
|
+
private _running;
|
|
38
|
+
private _label;
|
|
39
|
+
private _goal;
|
|
40
|
+
constructor(capacity?: number);
|
|
41
|
+
get revision(): number;
|
|
42
|
+
get evicted(): number;
|
|
43
|
+
get running(): boolean;
|
|
44
|
+
get label(): string;
|
|
45
|
+
get goal(): string;
|
|
46
|
+
entries(): readonly ReviewEntry[];
|
|
47
|
+
get(id: string): ReviewEntry | undefined;
|
|
48
|
+
begin(goal: string): void;
|
|
49
|
+
finish(interrupted?: boolean): void;
|
|
50
|
+
reset(history?: readonly Message[]): void;
|
|
51
|
+
change(callId: string, change: ReviewChange): void;
|
|
52
|
+
record(event: AgentEvent, at?: number | undefined, actor?: string): void;
|
|
53
|
+
recordActor(actor: string, event: AgentEvent): void;
|
|
54
|
+
private recordKingdom;
|
|
55
|
+
private actorId;
|
|
56
|
+
private finishActor;
|
|
57
|
+
private callId;
|
|
58
|
+
private notice;
|
|
59
|
+
private put;
|
|
60
|
+
}
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import { oneLine } from "./terminal-text.js";
|
|
2
|
+
const LABELS = {
|
|
3
|
+
read_file: "Lettura", list_dir: "Cartella", grep: "Ricerca", glob: "Ricerca file",
|
|
4
|
+
write_file: "Scrittura", edit_file: "Modifica", bash: "Comando", bash_bg: "Comando in background",
|
|
5
|
+
run_program: "Programma", tool_search: "Ricerca strumenti", tool_invoke: "Strumento",
|
|
6
|
+
ask_user: "Domanda", vascend_plan: "Lista attività", vascend_mark: "Stato attività",
|
|
7
|
+
vascend_note: "Nota", vascend_addtasks: "Nuove attività", kingdoms_warm: "Collaboratori",
|
|
8
|
+
vascend_addrooms: "Nuove attività", vascend_status: "Lista attività",
|
|
9
|
+
kingdom_send: "Messaggio al team", kingdom_inbox: "Messaggi del team", kingdom_wait: "Attesa collaboratori",
|
|
10
|
+
};
|
|
11
|
+
export function reviewTitle(name) { return LABELS[name] ?? name; }
|
|
12
|
+
export function callTarget(call) {
|
|
13
|
+
const i = call.input;
|
|
14
|
+
return oneLine(String(i["path"] ?? i["command"] ?? i["pattern"] ?? i["query"] ??
|
|
15
|
+
i["task"] ?? i["question"] ?? i["goal"] ?? call.name));
|
|
16
|
+
}
|
|
17
|
+
// Registro della sessione: conserva gli output ricevuti anche quando il log
|
|
18
|
+
// della chat viene compattato. Nessuna lettura del filesystem dal renderer.
|
|
19
|
+
export class ReviewStore {
|
|
20
|
+
capacity;
|
|
21
|
+
items = new Map();
|
|
22
|
+
callIndex = new Map();
|
|
23
|
+
actorText = new Map();
|
|
24
|
+
sequence = 0;
|
|
25
|
+
run = 0;
|
|
26
|
+
_revision = 0;
|
|
27
|
+
_evicted = 0;
|
|
28
|
+
_running = false;
|
|
29
|
+
_label = "Pronto";
|
|
30
|
+
_goal = "";
|
|
31
|
+
constructor(capacity = 2000) {
|
|
32
|
+
this.capacity = capacity;
|
|
33
|
+
}
|
|
34
|
+
get revision() { return this._revision; }
|
|
35
|
+
get evicted() { return this._evicted; }
|
|
36
|
+
get running() { return this._running || [...this.items.values()].some(e => e.state === "running"); }
|
|
37
|
+
get label() { return !this._running && this.running ? "Collaboratori in esecuzione" : this._label; }
|
|
38
|
+
get goal() { return this._goal; }
|
|
39
|
+
entries() { return [...this.items.values()]; }
|
|
40
|
+
get(id) { return this.items.get(id); }
|
|
41
|
+
begin(goal) {
|
|
42
|
+
this.run += 1;
|
|
43
|
+
this._running = true;
|
|
44
|
+
this._label = "Avvio";
|
|
45
|
+
this._goal = goal;
|
|
46
|
+
this._revision += 1;
|
|
47
|
+
}
|
|
48
|
+
finish(interrupted = false) {
|
|
49
|
+
for (const entry of this.items.values()) {
|
|
50
|
+
if (entry.state === "running" && entry.actor === "Talos")
|
|
51
|
+
this.put({ ...entry, state: "stopped", endedAt: Date.now() });
|
|
52
|
+
}
|
|
53
|
+
this._running = false;
|
|
54
|
+
this._label = interrupted ? "Interrotto" : "In attesa del prossimo messaggio";
|
|
55
|
+
this._revision += 1;
|
|
56
|
+
}
|
|
57
|
+
reset(history = []) {
|
|
58
|
+
this.items.clear();
|
|
59
|
+
this.callIndex.clear();
|
|
60
|
+
this.actorText.clear();
|
|
61
|
+
this.sequence = 0;
|
|
62
|
+
this.run = 0;
|
|
63
|
+
this._evicted = 0;
|
|
64
|
+
this._running = false;
|
|
65
|
+
this._label = "Pronto";
|
|
66
|
+
this._goal = "";
|
|
67
|
+
for (const message of history) {
|
|
68
|
+
if (message.role === "user")
|
|
69
|
+
this._goal = message.content.filter(p => p.type === "text").map(p => p.text).join("\n");
|
|
70
|
+
for (const part of message.content) {
|
|
71
|
+
if (part.type === "tool_call")
|
|
72
|
+
this.record({ type: "tool_call", call: part }, undefined);
|
|
73
|
+
else if (part.type === "tool_result")
|
|
74
|
+
this.record({ type: "tool_result", result: part }, undefined);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
// Una sessione ripresa non ha durate affidabili ne' comandi ancora in volo.
|
|
78
|
+
for (const e of this.items.values()) {
|
|
79
|
+
this.put({ ...e, startedAt: undefined, endedAt: undefined, state: e.state === "running" ? "stopped" : e.state });
|
|
80
|
+
}
|
|
81
|
+
this._revision += 1;
|
|
82
|
+
}
|
|
83
|
+
change(callId, change) {
|
|
84
|
+
const id = this.callIndex.get(`Talos:${callId}`) ?? this.callId(callId);
|
|
85
|
+
const entry = this.items.get(id);
|
|
86
|
+
if (entry)
|
|
87
|
+
this.put({ ...entry, change });
|
|
88
|
+
}
|
|
89
|
+
record(event, at = Date.now(), actor = "Talos") {
|
|
90
|
+
switch (event.type) {
|
|
91
|
+
case "status":
|
|
92
|
+
this._label = oneLine(event.label);
|
|
93
|
+
this._revision += 1;
|
|
94
|
+
break;
|
|
95
|
+
case "turn_start":
|
|
96
|
+
this._label = "Elaborazione";
|
|
97
|
+
this._revision += 1;
|
|
98
|
+
break;
|
|
99
|
+
case "text":
|
|
100
|
+
if (this._label !== "Risposta in corso") {
|
|
101
|
+
this._label = "Risposta in corso";
|
|
102
|
+
this._revision += 1;
|
|
103
|
+
}
|
|
104
|
+
break;
|
|
105
|
+
case "tool_call": {
|
|
106
|
+
const call = event.call;
|
|
107
|
+
if (actor === "Talos")
|
|
108
|
+
this._label = `${reviewTitle(call.name)} · ${callTarget(call)}`;
|
|
109
|
+
const id = this.callId(call.id, actor);
|
|
110
|
+
this.callIndex.set(`${actor}:${call.id}`, id);
|
|
111
|
+
this.put({ id, kind: "tool", title: reviewTitle(call.name), tool: call.name,
|
|
112
|
+
target: callTarget(call), actor, state: "running", startedAt: at,
|
|
113
|
+
input: call.input, parentId: event.parentId });
|
|
114
|
+
break;
|
|
115
|
+
}
|
|
116
|
+
case "tool_result": {
|
|
117
|
+
if (actor === "Talos")
|
|
118
|
+
this._label = "Elaborazione";
|
|
119
|
+
const id = this.callIndex.get(`${actor}:${event.result.callId}`) ?? this.callId(event.result.callId, actor);
|
|
120
|
+
const entry = this.items.get(id);
|
|
121
|
+
const input = entry?.input;
|
|
122
|
+
const editing = entry?.tool === "edit_file";
|
|
123
|
+
const writing = entry?.tool === "write_file";
|
|
124
|
+
const change = !event.result.isError && input && (editing || writing)
|
|
125
|
+
? { before: editing ? String(input["old_string"] ?? "") : undefined,
|
|
126
|
+
after: String(input[editing ? "new_string" : "content"] ?? ""),
|
|
127
|
+
scope: editing ? "fragment" : input["append"] === true ? "append" : "reported" }
|
|
128
|
+
: undefined;
|
|
129
|
+
this.put({ ...(entry ?? { id, kind: "tool", title: "Risultato", target: event.result.callId, actor }),
|
|
130
|
+
state: event.result.isError ? "error" : "ok", output: event.result.output, endedAt: at,
|
|
131
|
+
...(change ? { change } : {}) });
|
|
132
|
+
break;
|
|
133
|
+
}
|
|
134
|
+
case "error":
|
|
135
|
+
this.notice("Errore", event.message, "error", at, actor);
|
|
136
|
+
break;
|
|
137
|
+
case "compacted":
|
|
138
|
+
this.notice("Contesto riassunto", `Stima locale: ${event.tokensBefore} → ${event.tokensAfter} token.\n${event.anchors?.join("\n") ?? ""}`, "info", at);
|
|
139
|
+
break;
|
|
140
|
+
case "user_message":
|
|
141
|
+
this.notice("Messaggio preso in carico", event.text, "info", event.at);
|
|
142
|
+
break;
|
|
143
|
+
case "workspace_message":
|
|
144
|
+
this.notice(`Sessione ${event.message.fromLabel}`, event.message.text, "info", at);
|
|
145
|
+
break;
|
|
146
|
+
case "kingdom":
|
|
147
|
+
this.recordKingdom(event, at);
|
|
148
|
+
break;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
recordActor(actor, event) {
|
|
152
|
+
if (event.type === "status") {
|
|
153
|
+
this.put({ id: `status:${this.run}:${actor}`, kind: "notice", actor, title: "Stato",
|
|
154
|
+
target: oneLine(event.label), output: event.label, state: "info", startedAt: Date.now() });
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
if (event.type === "text") {
|
|
158
|
+
const text = (this.actorText.get(actor) ?? "") + event.delta;
|
|
159
|
+
this.actorText.set(actor, text);
|
|
160
|
+
this.put({ id: `stream:${this.run}:${actor}`, kind: "notice", actor, title: "Risposta in corso",
|
|
161
|
+
target: "Scrive un aggiornamento", output: text, state: "info", startedAt: Date.now() });
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
if (event.type === "tool_call" || event.type === "done" || event.type === "error") {
|
|
165
|
+
const text = this.actorText.get(actor);
|
|
166
|
+
if (text?.trim())
|
|
167
|
+
this.notice("Aggiornamento", text, "info", Date.now(), actor);
|
|
168
|
+
this.actorText.delete(actor);
|
|
169
|
+
this.items.delete(`stream:${this.run}:${actor}`);
|
|
170
|
+
}
|
|
171
|
+
if (event.type === "turn_start" || event.type === "done" || event.type === "error") {
|
|
172
|
+
this.record({ type: "kingdom", phase: "vassal", slug: actor,
|
|
173
|
+
state: event.type === "turn_start" ? "active" : event.type === "done" ? "done" : "error",
|
|
174
|
+
...(event.type === "error" ? { label: event.message } : {}) });
|
|
175
|
+
}
|
|
176
|
+
if (event.type === "done" || event.type === "error")
|
|
177
|
+
this.finishActor(actor);
|
|
178
|
+
if (event.type !== "turn_start")
|
|
179
|
+
this.record(event, Date.now(), actor);
|
|
180
|
+
}
|
|
181
|
+
recordKingdom(e, at) {
|
|
182
|
+
if (e.phase === "start") {
|
|
183
|
+
for (const member of e.castles) {
|
|
184
|
+
this.put({ id: `team:${this.run}:${member.slug}`, kind: "team", title: member.slug,
|
|
185
|
+
actor: member.slug, target: member.goal, role: member.role, parent: member.parent,
|
|
186
|
+
state: "info", output: member.after.length ? `In coda · dopo ${member.after.join(", ")}` : "In coda", startedAt: at });
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
else if (e.phase === "tool") {
|
|
190
|
+
const key = `${e.slug}:${e.callId}`;
|
|
191
|
+
const id = e.state === "start" ? this.callId(e.callId, e.slug) : this.callIndex.get(key) ?? this.callId(e.callId, e.slug);
|
|
192
|
+
this.callIndex.set(key, id);
|
|
193
|
+
const prev = this.items.get(id);
|
|
194
|
+
this.put({ ...prev, id, kind: "tool", title: reviewTitle(e.tool), tool: e.tool, actor: e.slug,
|
|
195
|
+
target: e.command ?? e.args ?? prev?.target ?? e.tool,
|
|
196
|
+
state: e.state === "start" ? "running" : e.state === "error" ? "error" : "ok",
|
|
197
|
+
startedAt: prev?.startedAt ?? e.at, endedAt: e.state === "start" ? undefined : e.at,
|
|
198
|
+
input: e.command ? { command: e.command } : prev?.input ?? { argomenti: e.args ?? "" },
|
|
199
|
+
output: e.output ?? prev?.output });
|
|
200
|
+
}
|
|
201
|
+
else if (e.phase === "file") {
|
|
202
|
+
this.put({ id: `file:${++this.sequence}`, kind: "file", title: "Modifica segnalata", target: e.path,
|
|
203
|
+
actor: e.slug, state: "info", startedAt: at, output: "Modifica segnalata dal collaboratore; i frammenti ricevuti possono essere parziali.",
|
|
204
|
+
change: e.edit ? { before: e.edit.oldString, after: e.edit.newString ?? e.edit.content ?? "", scope: "reported" } : undefined });
|
|
205
|
+
}
|
|
206
|
+
else if (e.phase === "vassal") {
|
|
207
|
+
const id = this.actorId(e.slug);
|
|
208
|
+
const prev = this.items.get(id);
|
|
209
|
+
this.put({ ...prev, id, kind: "team", title: e.slug, actor: e.slug,
|
|
210
|
+
target: e.goal ?? prev?.target ?? e.label ?? "Collaboratore",
|
|
211
|
+
role: e.role ?? prev?.role, parent: e.parent ?? prev?.parent,
|
|
212
|
+
output: e.label ?? prev?.output, startedAt: prev?.startedAt ?? at,
|
|
213
|
+
state: e.state === "error" ? "error" : e.state === "done" ? "ok" : "running",
|
|
214
|
+
endedAt: e.state === "done" || e.state === "error" ? at : undefined });
|
|
215
|
+
if (e.state === "done" || e.state === "error")
|
|
216
|
+
this.finishActor(e.slug);
|
|
217
|
+
}
|
|
218
|
+
else if (e.phase === "end") {
|
|
219
|
+
for (const report of e.reports) {
|
|
220
|
+
const id = this.actorId(report.slug);
|
|
221
|
+
const prev = this.items.get(id);
|
|
222
|
+
this.put({ ...prev, id, kind: "team", title: report.slug, actor: report.slug,
|
|
223
|
+
target: prev?.target ?? report.role ?? "Collaboratore", endedAt: at,
|
|
224
|
+
state: report.ok ? "ok" : "error", output: [report.summary, report.error].filter(Boolean).join("\n") });
|
|
225
|
+
this.finishActor(report.slug);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
else if (e.phase === "say" || e.phase === "note" || e.phase === "notice" || e.phase === "message" || e.phase === "inbox") {
|
|
229
|
+
const actor = "slug" in e ? e.slug : "from" in e ? e.from : "Talos";
|
|
230
|
+
this.notice(e.phase === "message" ? `${actor} → ${e.to}` : e.phase === "inbox" ? `Messaggio ${e.state === "read" ? "letto" : "in coda"}` : "Aggiornamento", e.text, "info", at, actor);
|
|
231
|
+
}
|
|
232
|
+
else if (e.phase === "task") {
|
|
233
|
+
const id = `task:${this.run}:${e.slug}:${e.workstreamId}:${e.taskRef}`;
|
|
234
|
+
this.put({ id, kind: "team", title: e.taskRef, target: e.workstreamId, actor: e.slug,
|
|
235
|
+
state: e.status === "completed" ? "ok" : e.status === "failed" ? "error" : e.status === "running" ? "running" : "info", startedAt: e.at });
|
|
236
|
+
}
|
|
237
|
+
else if (e.phase === "usage") {
|
|
238
|
+
this.put({ id: `usage:${this.run}:${e.slug}`, kind: "team", title: "Consumi", target: e.slug, actor: e.slug,
|
|
239
|
+
state: "info", startedAt: e.at, output: `Input: ${e.inputTokens}\nOutput: ${e.outputTokens}\nTotale: ${e.totalTokens}\nTurni: ${e.turns}` +
|
|
240
|
+
(e.costUsd === undefined ? "" : `\nCosto USD: ${e.costUsd}`) });
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
actorId(actor) {
|
|
244
|
+
return [...this.items.values()].find(e => e.id.startsWith("team:") && e.actor === actor && e.state === "running")?.id ?? `team:${this.run}:${actor}`;
|
|
245
|
+
}
|
|
246
|
+
finishActor(actor) {
|
|
247
|
+
for (const entry of this.items.values()) {
|
|
248
|
+
if (entry.actor === actor && entry.state === "running")
|
|
249
|
+
this.put({ ...entry, state: "stopped", endedAt: Date.now() });
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
callId(id, actor = "Talos") { return `call:${this.run}:${actor}:${id}`; }
|
|
253
|
+
notice(title, output, state, at, actor = "Talos") {
|
|
254
|
+
this.put({ id: `notice:${++this.sequence}`, kind: "notice", title, target: oneLine(output).slice(0, 200), actor, state, output, startedAt: at });
|
|
255
|
+
}
|
|
256
|
+
put(entry) {
|
|
257
|
+
this.items.set(entry.id, entry);
|
|
258
|
+
if (this.items.size > this.capacity) {
|
|
259
|
+
const oldest = [...this.items.values()].find(e => e.state !== "running");
|
|
260
|
+
if (oldest) {
|
|
261
|
+
this.items.delete(oldest.id);
|
|
262
|
+
for (const [key, id] of this.callIndex)
|
|
263
|
+
if (id === oldest.id)
|
|
264
|
+
this.callIndex.delete(key);
|
|
265
|
+
this._evicted += 1;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
this._revision += 1;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// Proiezione del registro: una riga stabile per agente, non una per evento.
|
|
2
|
+
export function teamEntries(store) {
|
|
3
|
+
const groups = new Map();
|
|
4
|
+
for (const entry of store.entries()) {
|
|
5
|
+
if (entry.actor === "Talos")
|
|
6
|
+
continue;
|
|
7
|
+
groups.set(entry.actor, [...(groups.get(entry.actor) ?? []), entry]);
|
|
8
|
+
}
|
|
9
|
+
return [...groups].map(([actor, entries]) => {
|
|
10
|
+
const lifecycle = entries.filter(e => e.id.startsWith("team:")).at(-1);
|
|
11
|
+
const active = entries.filter(e => e.kind === "tool" && e.state === "running");
|
|
12
|
+
const problems = entries.filter(e => e.state === "error" || e.state === "stopped");
|
|
13
|
+
const files = new Set(entries.filter(e => e.change || e.kind === "file").map(e => e.target));
|
|
14
|
+
const latest = [...entries].sort((a, b) => (a.endedAt ?? a.startedAt ?? 0) - (b.endedAt ?? b.startedAt ?? 0)).at(-1);
|
|
15
|
+
const current = active.map(e => `${e.title}: ${e.target}`).join(" · ");
|
|
16
|
+
const state = lifecycle?.state ?? (active.length ? "running" : "info");
|
|
17
|
+
const goal = lifecycle?.target ?? "Incarico non disponibile";
|
|
18
|
+
const status = entries.find(e => e.id.startsWith("status:"));
|
|
19
|
+
const waiting = state === "running" && status && /attes|conferm|permess|domand/i.test(status.target)
|
|
20
|
+
&& (status.startedAt ?? 0) >= (latest.endedAt ?? latest.startedAt ?? 0);
|
|
21
|
+
const activity = (waiting ? status.target : "") || current || (state !== "running" ? lifecycle?.output : "") || `${latest.title}: ${latest.target}`;
|
|
22
|
+
return { id: `agent:${actor}`, actor, kind: "team", title: actor,
|
|
23
|
+
state, target: `${actor} · ${state === "running" ? "in corso" : state === "ok" ? "concluso" : state === "error" ? "errore" : state === "stopped" ? "interrotto" : lifecycle?.output?.startsWith("In coda") ? "in coda" : "stato non disponibile"} · ${activity}`,
|
|
24
|
+
output: `Incarico: ${goal}\nRuolo: ${lifecycle?.role ?? "non disponibile"}\nRisponde a: ${lifecycle?.parent ?? "orchestratore"}\nAttività: ${activity}\n${active.length} tool attivi · ${files.size} file · ${problems.length} problemi\nEventi disponibili: ${entries.length}`,
|
|
25
|
+
startedAt: lifecycle?.startedAt, endedAt: lifecycle?.endedAt };
|
|
26
|
+
});
|
|
27
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
interface MouseEvent {
|
|
2
|
+
button: number;
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
press: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare class SelectorMouseInput {
|
|
8
|
+
private readonly text;
|
|
9
|
+
private readonly mouse;
|
|
10
|
+
private pending;
|
|
11
|
+
private timer?;
|
|
12
|
+
constructor(text: (text: string) => void, mouse: (event: MouseEvent) => void);
|
|
13
|
+
push(chunk: string): void;
|
|
14
|
+
dispose(): void;
|
|
15
|
+
}
|
|
16
|
+
export declare function selectorMouseIndex(o: {
|
|
17
|
+
x: number;
|
|
18
|
+
y: number;
|
|
19
|
+
rows: number;
|
|
20
|
+
columns: number;
|
|
21
|
+
renderedRows: number;
|
|
22
|
+
count: number;
|
|
23
|
+
index: number;
|
|
24
|
+
pageSize: number;
|
|
25
|
+
}): number | null;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// SGR reports can arrive in multiple chunks. Never forward partial mouse
|
|
2
|
+
// sequences to readline: their numbers would become the palette's query.
|
|
3
|
+
export class SelectorMouseInput {
|
|
4
|
+
text;
|
|
5
|
+
mouse;
|
|
6
|
+
pending = "";
|
|
7
|
+
timer;
|
|
8
|
+
constructor(text, mouse) {
|
|
9
|
+
this.text = text;
|
|
10
|
+
this.mouse = mouse;
|
|
11
|
+
}
|
|
12
|
+
push(chunk) {
|
|
13
|
+
if (this.timer)
|
|
14
|
+
clearTimeout(this.timer);
|
|
15
|
+
let rest = this.pending + chunk;
|
|
16
|
+
this.pending = "";
|
|
17
|
+
while (rest) {
|
|
18
|
+
const start = rest.indexOf("\x1b[<");
|
|
19
|
+
if (start < 0) {
|
|
20
|
+
// Keep even ESC or ESC+[ until we can distinguish a key from a
|
|
21
|
+
// fragmented mouse report. A lone Escape is released after 35 ms.
|
|
22
|
+
const suffix = rest.endsWith("\x1b[") ? 2 : rest.endsWith("\x1b") ? 1 : 0;
|
|
23
|
+
if (suffix) {
|
|
24
|
+
if (rest.length > suffix)
|
|
25
|
+
this.text(rest.slice(0, -suffix));
|
|
26
|
+
this.pending = rest.slice(-suffix);
|
|
27
|
+
this.timer = setTimeout(() => {
|
|
28
|
+
const key = this.pending;
|
|
29
|
+
this.pending = "";
|
|
30
|
+
this.text(key);
|
|
31
|
+
}, 35);
|
|
32
|
+
}
|
|
33
|
+
else
|
|
34
|
+
this.text(rest);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (start)
|
|
38
|
+
this.text(rest.slice(0, start));
|
|
39
|
+
rest = rest.slice(start);
|
|
40
|
+
const match = /^\x1b\[<(\d+);(\d+);(\d+)([Mm])/.exec(rest);
|
|
41
|
+
if (match) {
|
|
42
|
+
this.mouse({ button: Number(match[1]), x: Number(match[2]), y: Number(match[3]), press: match[4] === "M" });
|
|
43
|
+
rest = rest.slice(match[0].length);
|
|
44
|
+
}
|
|
45
|
+
else if (/^\x1b\[<[\d;]*$/.test(rest) && rest.length < 48) {
|
|
46
|
+
this.pending = rest;
|
|
47
|
+
this.timer = setTimeout(() => { this.pending = ""; }, 250);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
rest = rest.slice(3); // discard a malformed control prefix
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
dispose() { if (this.timer)
|
|
56
|
+
clearTimeout(this.timer); this.pending = ""; }
|
|
57
|
+
}
|
|
58
|
+
export function selectorMouseIndex(o) {
|
|
59
|
+
const top = o.rows - Math.min(o.renderedRows, o.rows - 1) + 1;
|
|
60
|
+
const row = o.y - top - 1; // title occupies the first overlay row
|
|
61
|
+
if (o.x < 1 || o.x > o.columns + 1 || row < 0 || row >= Math.min(o.count, o.pageSize))
|
|
62
|
+
return null;
|
|
63
|
+
const start = Math.max(0, Math.min(o.index - Math.floor(o.pageSize / 2), o.count - o.pageSize));
|
|
64
|
+
return start + row;
|
|
65
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { TuiTheme } from "./branding.js";
|
|
2
|
+
export interface SelectOption<T> {
|
|
3
|
+
readonly key?: string;
|
|
4
|
+
readonly label: string;
|
|
5
|
+
readonly detail: string;
|
|
6
|
+
readonly group?: string;
|
|
7
|
+
readonly hint?: string;
|
|
8
|
+
readonly value: T;
|
|
9
|
+
}
|
|
10
|
+
interface SelectorControl {
|
|
11
|
+
pause(): void;
|
|
12
|
+
resume(): void;
|
|
13
|
+
write(text: string): void;
|
|
14
|
+
setOverlay(lines: string[] | null): void;
|
|
15
|
+
}
|
|
16
|
+
interface SelectorOptions<T> {
|
|
17
|
+
readonly title: string;
|
|
18
|
+
readonly hint?: string;
|
|
19
|
+
readonly options: readonly SelectOption<T>[];
|
|
20
|
+
readonly current?: T;
|
|
21
|
+
readonly currentKey?: string;
|
|
22
|
+
readonly theme: TuiTheme;
|
|
23
|
+
readonly wide?: boolean;
|
|
24
|
+
readonly question?: boolean;
|
|
25
|
+
readonly selectedDetailsOnly?: boolean;
|
|
26
|
+
readonly mouse?: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface SelectorRenderOptions<T> extends SelectorOptions<T> {
|
|
29
|
+
readonly index: number;
|
|
30
|
+
readonly pageSize: number;
|
|
31
|
+
readonly columns: number;
|
|
32
|
+
readonly query?: string;
|
|
33
|
+
readonly totalCount?: number;
|
|
34
|
+
readonly details?: boolean;
|
|
35
|
+
readonly detailOffset?: number;
|
|
36
|
+
}
|
|
37
|
+
export declare function pickerPageSize(rows: number, fullHeight?: boolean): number;
|
|
38
|
+
export declare function filterOptions<T extends {
|
|
39
|
+
label: string;
|
|
40
|
+
detail: string;
|
|
41
|
+
group?: string;
|
|
42
|
+
hint?: string;
|
|
43
|
+
}>(options: readonly T[], query: string): readonly T[];
|
|
44
|
+
export declare function renderSelector<T>(opts: SelectorRenderOptions<T>): string[];
|
|
45
|
+
export declare function selectOption<T>(opts: SelectorOptions<T> & {
|
|
46
|
+
readonly ctl: SelectorControl;
|
|
47
|
+
readonly terminalColumns: () => number;
|
|
48
|
+
readonly filterable?: boolean;
|
|
49
|
+
readonly fullHeight?: boolean;
|
|
50
|
+
}): Promise<SelectOption<T> | null>;
|
|
51
|
+
export {};
|