@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,299 @@
|
|
|
1
|
+
import * as readline from "node:readline";
|
|
2
|
+
import { stdin, stdout } from "node:process";
|
|
3
|
+
import { PassThrough } from "node:stream";
|
|
4
|
+
import { StringDecoder } from "node:string_decoder";
|
|
5
|
+
import { tr } from "./i18n.js";
|
|
6
|
+
import { SelectorMouseInput, selectorMouseIndex } from "./selector-mouse.js";
|
|
7
|
+
import { fitLine, oneLine, padLine, plainText, terminalWidth, wrapText } from "./terminal-text.js";
|
|
8
|
+
import { renderQuestionChoices } from "./question.js";
|
|
9
|
+
export function pickerPageSize(rows, fullHeight = false) {
|
|
10
|
+
const available = Math.max(1, Math.floor(rows) - 6);
|
|
11
|
+
return Math.min(available, fullHeight ? 26 : 7);
|
|
12
|
+
}
|
|
13
|
+
function searchable(text) {
|
|
14
|
+
return plainText(text).normalize("NFD").replace(/\p{Mark}/gu, "").toLowerCase();
|
|
15
|
+
}
|
|
16
|
+
export function filterOptions(options, query) {
|
|
17
|
+
const terms = searchable(query).split(/\s+/).filter(Boolean);
|
|
18
|
+
if (!terms.length)
|
|
19
|
+
return options;
|
|
20
|
+
return options.filter(option => {
|
|
21
|
+
const hay = searchable(`${option.label} ${option.detail} ${option.group ?? ""} ${option.hint ?? ""}`);
|
|
22
|
+
return terms.every(term => hay.includes(term));
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
function isCurrent(option, current, currentKey) {
|
|
26
|
+
if (currentKey !== undefined)
|
|
27
|
+
return (option.key ?? String(option.value)) === currentKey;
|
|
28
|
+
return current !== undefined && option.value === current;
|
|
29
|
+
}
|
|
30
|
+
function selectorWidth(columns, wide) {
|
|
31
|
+
return Math.max(1, Math.min(wide ? 120 : 96, columns - 2));
|
|
32
|
+
}
|
|
33
|
+
function detailLines(opts, option, width) {
|
|
34
|
+
if (!option)
|
|
35
|
+
return [];
|
|
36
|
+
return [
|
|
37
|
+
...wrapText(opts.title, width, true),
|
|
38
|
+
...(opts.hint ? wrapText(opts.hint, width, true) : []),
|
|
39
|
+
...wrapText(`${option.label}${option.hint ? ` ${option.hint}` : ""}`, width),
|
|
40
|
+
...(option.group ? wrapText(option.group, width) : []),
|
|
41
|
+
...wrapText(option.detail, width, true),
|
|
42
|
+
];
|
|
43
|
+
}
|
|
44
|
+
export function renderSelector(opts) {
|
|
45
|
+
const t = opts.theme;
|
|
46
|
+
const width = selectorWidth(opts.columns, opts.wide);
|
|
47
|
+
const page = Math.max(1, opts.pageSize);
|
|
48
|
+
const index = Math.max(0, Math.min(opts.index, opts.options.length - 1));
|
|
49
|
+
const selected = opts.options[index];
|
|
50
|
+
const row = (text) => " " + fitLine(text, width);
|
|
51
|
+
const title = fitLine(oneLine(opts.title), opts.query === undefined ? width : Math.max(4, Math.floor(width * 0.45)));
|
|
52
|
+
const searchWidth = Math.max(1, width - terminalWidth(title) - 3);
|
|
53
|
+
// Una sola riga per titolo e ricerca; mostra la coda della query durante la digitazione.
|
|
54
|
+
const query = Array.from(oneLine(opts.query ?? ""));
|
|
55
|
+
while (query.length && terminalWidth(query.join("")) > searchWidth - 2)
|
|
56
|
+
query.shift();
|
|
57
|
+
const search = opts.query === undefined ? "" : t.muted(" / ") +
|
|
58
|
+
(opts.query ? t.silver(query.join("")) : t.muted(fitLine(tr("Cerca", "Search"), searchWidth - 1))) + t.accent("▏");
|
|
59
|
+
const lines = [row(t.bold(title) + search)];
|
|
60
|
+
let range;
|
|
61
|
+
if (opts.details && selected) {
|
|
62
|
+
const all = detailLines(opts, selected, width - 2);
|
|
63
|
+
const offset = Math.max(0, Math.min(opts.detailOffset ?? 0, all.length - page));
|
|
64
|
+
for (const [i, line] of all.slice(offset, offset + page).entries()) {
|
|
65
|
+
lines.push(row(" " + (offset + i === 0 ? t.bold(line) : t.silver(line))));
|
|
66
|
+
}
|
|
67
|
+
range = `${offset + 1}–${Math.min(all.length, offset + page)}/${all.length}`;
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
const start = Math.max(0, Math.min(index - Math.floor(page / 2), opts.options.length - page));
|
|
71
|
+
const visible = opts.options.slice(start, start + page);
|
|
72
|
+
const maxLabel = Math.max(0, ...opts.options.map(option => terminalWidth(oneLine(option.label))));
|
|
73
|
+
const contentWidth = Math.max(1, width - 4);
|
|
74
|
+
const labelWidth = width < 38 ? contentWidth : Math.min(maxLabel, Math.max(10, Math.floor(contentWidth * 0.48)));
|
|
75
|
+
const detailWidth = Math.max(0, contentWidth - labelWidth - 2);
|
|
76
|
+
for (const [offset, option] of visible.entries()) {
|
|
77
|
+
const active = start + offset === index;
|
|
78
|
+
const current = isCurrent(option, opts.current, opts.currentKey);
|
|
79
|
+
const mark = `${active ? "›" : " "}${current ? "●" : " "} `;
|
|
80
|
+
const label = padLine(oneLine(option.label), labelWidth);
|
|
81
|
+
const detail = detailWidth > 2 && (!opts.selectedDetailsOnly || active)
|
|
82
|
+
? " " + fitLine(oneLine(option.detail), detailWidth) : "";
|
|
83
|
+
if (active) {
|
|
84
|
+
// Colore uniforme, con un indicatore testuale visibile anche senza colori.
|
|
85
|
+
lines.push(row(t.selected(padLine(plainText(mark + label + detail), width))));
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
lines.push(row((current ? t.accent(mark) : t.muted(mark)) + t.silver(label) + t.muted(detail)));
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
if (!visible.length)
|
|
92
|
+
lines.push(row(t.muted(tr(" Nessun risultato. Modifica la ricerca.", " No results. Change your search."))));
|
|
93
|
+
range = opts.options.length ? `${start + 1}–${start + visible.length}/${opts.options.length}` : "0";
|
|
94
|
+
if (opts.totalCount !== undefined && opts.totalCount !== opts.options.length)
|
|
95
|
+
range += ` ${tr("di", "of")} ${opts.totalCount}`;
|
|
96
|
+
// Categoria e sintassi soltanto per la voce a fuoco, non ripetute nella lista.
|
|
97
|
+
if (opts.hint || (selected && (selected.group || selected.hint))) {
|
|
98
|
+
const meta = [opts.hint, selected?.group, selected?.hint ? `${selected.label} ${selected.hint}` : ""].filter(Boolean).join(" · ");
|
|
99
|
+
lines.push(row(t.muted(" " + meta)));
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
const shortcut = opts.details ? tr("↑↓ scorri · Tab elenco · Invio · Esc", "↑↓ scroll · Tab list · Enter · Esc")
|
|
103
|
+
: opts.mouse ? tr("↑↓ / click · Invio apri · Tab dettagli · Esc", "↑↓ / click · Enter open · Tab details · Esc")
|
|
104
|
+
: tr("↑↓ · Invio scegli · Tab dettagli · Esc", "↑↓ · Enter select · Tab details · Esc");
|
|
105
|
+
const short = opts.details ? tr("Tab elenco · Invio · Esc", "Tab list · Enter · Esc") : tr("↑↓ · Invio · Tab · Esc", "↑↓ · Enter · Tab · Esc");
|
|
106
|
+
const hintWidth = width - terminalWidth(range) - 2;
|
|
107
|
+
const hint = fitLine(terminalWidth(shortcut) <= hintWidth ? shortcut : short, hintWidth);
|
|
108
|
+
lines.push(row(t.muted(hint + " ".repeat(Math.max(1, width - terminalWidth(hint) - terminalWidth(range))) + range)));
|
|
109
|
+
return lines;
|
|
110
|
+
}
|
|
111
|
+
export async function selectOption(opts) {
|
|
112
|
+
if (!stdin.isTTY || !stdout.isTTY || typeof stdin.setRawMode !== "function") {
|
|
113
|
+
opts.ctl.write(opts.theme.bold(`\n ${opts.title}\n`));
|
|
114
|
+
if (opts.hint)
|
|
115
|
+
opts.ctl.write(` ${opts.hint}\n`);
|
|
116
|
+
for (const option of opts.options) {
|
|
117
|
+
const mark = isCurrent(option, opts.current, opts.currentKey) ? "●" : " ";
|
|
118
|
+
opts.ctl.write(` ${mark} ${option.label}${option.hint ? ` ${option.hint}` : ""} · ${option.detail}\n`);
|
|
119
|
+
}
|
|
120
|
+
return null;
|
|
121
|
+
}
|
|
122
|
+
// Decode mouse reports before readline can turn fragments into search text.
|
|
123
|
+
const keys = new PassThrough();
|
|
124
|
+
readline.emitKeypressEvents(keys);
|
|
125
|
+
let query = "";
|
|
126
|
+
let filtered = opts.options;
|
|
127
|
+
let index = Math.max(0, filtered.findIndex(option => isCurrent(option, opts.current, opts.currentKey)));
|
|
128
|
+
let details = false;
|
|
129
|
+
let detailOffset = 0;
|
|
130
|
+
let questionOffset = 0;
|
|
131
|
+
let questionView;
|
|
132
|
+
let renderedRows = 0;
|
|
133
|
+
const wasRaw = stdin.isRaw;
|
|
134
|
+
const wasPaused = stdin.isPaused();
|
|
135
|
+
const pageSize = () => pickerPageSize(stdout.rows || 24, opts.fullHeight);
|
|
136
|
+
const detailMax = () => Math.max(0, detailLines(opts, filtered[index], selectorWidth(opts.terminalColumns(), opts.wide) - 2).length - pageSize());
|
|
137
|
+
const applyFilter = () => {
|
|
138
|
+
const previous = filtered[index];
|
|
139
|
+
filtered = filterOptions(opts.options, query);
|
|
140
|
+
index = Math.max(0, previous ? filtered.indexOf(previous) : 0);
|
|
141
|
+
details = false;
|
|
142
|
+
detailOffset = 0;
|
|
143
|
+
};
|
|
144
|
+
const draw = () => {
|
|
145
|
+
if (opts.question) {
|
|
146
|
+
questionView = renderQuestionChoices({ title: opts.title, options: filtered, index, offset: questionOffset,
|
|
147
|
+
columns: opts.terminalColumns(), rows: Math.max(5, (stdout.rows || 24) - 1), theme: opts.theme });
|
|
148
|
+
questionOffset = questionView.offset;
|
|
149
|
+
opts.ctl.setOverlay(questionView.lines);
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
detailOffset = Math.min(detailOffset, detailMax());
|
|
153
|
+
const lines = renderSelector({ ...opts, options: filtered, index,
|
|
154
|
+
pageSize: pageSize(), columns: opts.terminalColumns(), query: opts.filterable ? query : undefined,
|
|
155
|
+
totalCount: opts.options.length, details, detailOffset,
|
|
156
|
+
});
|
|
157
|
+
renderedRows = lines.length;
|
|
158
|
+
opts.ctl.setOverlay(lines);
|
|
159
|
+
if (opts.mouse)
|
|
160
|
+
stdout.write("\x1b[?1000h\x1b[?1006h");
|
|
161
|
+
};
|
|
162
|
+
return new Promise(resolve => {
|
|
163
|
+
let settled = false;
|
|
164
|
+
const cleanup = (value) => {
|
|
165
|
+
if (settled)
|
|
166
|
+
return;
|
|
167
|
+
settled = true;
|
|
168
|
+
stdin.off("data", onData);
|
|
169
|
+
decoder.dispose();
|
|
170
|
+
keys.off("keypress", onKeypress);
|
|
171
|
+
keys.destroy();
|
|
172
|
+
if (opts.mouse)
|
|
173
|
+
stdout.write("\x1b[?1000l\x1b[?1006l");
|
|
174
|
+
stdout.off("resize", draw);
|
|
175
|
+
stdin.setRawMode(Boolean(wasRaw));
|
|
176
|
+
if (wasPaused)
|
|
177
|
+
stdin.pause();
|
|
178
|
+
opts.ctl.setOverlay(null);
|
|
179
|
+
opts.ctl.resume();
|
|
180
|
+
resolve(value);
|
|
181
|
+
};
|
|
182
|
+
const decoder = new SelectorMouseInput((data) => { if (!settled)
|
|
183
|
+
keys.write(data); }, (event) => {
|
|
184
|
+
if (!opts.mouse || !event.press || settled)
|
|
185
|
+
return;
|
|
186
|
+
if (event.button === 64 || event.button === 65) {
|
|
187
|
+
onKeypress("", { name: event.button === 64 ? "up" : "down" });
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
if (event.button !== 0 || details || opts.question)
|
|
191
|
+
return;
|
|
192
|
+
const hit = selectorMouseIndex({ y: event.y, x: event.x, rows: stdout.rows || 24,
|
|
193
|
+
columns: selectorWidth(opts.terminalColumns(), opts.wide), renderedRows,
|
|
194
|
+
count: filtered.length, index, pageSize: pageSize() });
|
|
195
|
+
if (hit === null)
|
|
196
|
+
return;
|
|
197
|
+
// A click focuses and reveals the description; clicking the focused row opens it.
|
|
198
|
+
if (index === hit)
|
|
199
|
+
cleanup(filtered[hit] ?? null);
|
|
200
|
+
else {
|
|
201
|
+
index = hit;
|
|
202
|
+
draw();
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
const utf8 = new StringDecoder("utf8");
|
|
206
|
+
const onData = (data) => decoder.push(typeof data === "string" ? data : utf8.write(data));
|
|
207
|
+
const onKeypress = (chunk, key) => {
|
|
208
|
+
if (key.name === "return") {
|
|
209
|
+
cleanup(filtered[index] ?? null);
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
if (key.ctrl && key.name === "c") {
|
|
213
|
+
cleanup(null);
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
if (key.name === "escape") {
|
|
217
|
+
if (details) {
|
|
218
|
+
details = false;
|
|
219
|
+
draw();
|
|
220
|
+
}
|
|
221
|
+
else
|
|
222
|
+
cleanup(null);
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
if (opts.question && questionView) {
|
|
226
|
+
const page = questionView.pageSize;
|
|
227
|
+
if (key.name === "pageup")
|
|
228
|
+
questionOffset = Math.max(0, questionOffset - page);
|
|
229
|
+
else if (key.name === "pagedown")
|
|
230
|
+
questionOffset = Math.min(questionView.maxOffset, questionOffset + page);
|
|
231
|
+
else if (key.name === "home") {
|
|
232
|
+
index = 0;
|
|
233
|
+
questionOffset = 0;
|
|
234
|
+
}
|
|
235
|
+
else if (key.name === "end") {
|
|
236
|
+
index = Math.max(0, filtered.length - 1);
|
|
237
|
+
questionOffset = questionView.maxOffset;
|
|
238
|
+
}
|
|
239
|
+
else if (key.name === "up" || key.name === "down" || key.name === "tab") {
|
|
240
|
+
const delta = key.name === "up" || key.shift ? -1 : 1;
|
|
241
|
+
const next = Math.max(0, Math.min(filtered.length - 1, index + delta));
|
|
242
|
+
if (next === index && delta < 0)
|
|
243
|
+
questionOffset = Math.max(0, questionOffset - 1);
|
|
244
|
+
else {
|
|
245
|
+
index = next;
|
|
246
|
+
const range = questionView.ranges[index];
|
|
247
|
+
if (range && (range.start < questionOffset || range.end > questionOffset + page))
|
|
248
|
+
questionOffset = range.start;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
else
|
|
252
|
+
return;
|
|
253
|
+
draw();
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
if (key.name === "tab" && filtered.length) {
|
|
257
|
+
details = !details;
|
|
258
|
+
detailOffset = 0;
|
|
259
|
+
draw();
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
const moves = { down: 1, up: -1, pagedown: pageSize(), pageup: -pageSize() };
|
|
263
|
+
const name = key.ctrl && key.name === "n" ? "down" : key.ctrl && key.name === "p" ? "up" : key.name ?? "";
|
|
264
|
+
const delta = moves[name];
|
|
265
|
+
if (delta !== undefined || name === "home" || name === "end") {
|
|
266
|
+
const max = details ? detailMax() : Math.max(0, filtered.length - 1);
|
|
267
|
+
const pos = details ? detailOffset : index;
|
|
268
|
+
const next = name === "home" ? 0 : name === "end" ? max : Math.max(0, Math.min(max, pos + (delta ?? 0)));
|
|
269
|
+
if (details)
|
|
270
|
+
detailOffset = next;
|
|
271
|
+
else
|
|
272
|
+
index = next;
|
|
273
|
+
draw();
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
if (opts.filterable) {
|
|
277
|
+
if (key.name === "backspace")
|
|
278
|
+
query = Array.from(query).slice(0, -1).join("");
|
|
279
|
+
else if (key.ctrl && key.name === "u")
|
|
280
|
+
query = "";
|
|
281
|
+
else if (!key.ctrl && !key.meta && typeof chunk === "string" && chunk && !/[\x00-\x1f\x7f-\x9f]/.test(chunk))
|
|
282
|
+
query += chunk;
|
|
283
|
+
else
|
|
284
|
+
return;
|
|
285
|
+
applyFilter();
|
|
286
|
+
draw();
|
|
287
|
+
}
|
|
288
|
+
else if (key.name === "q")
|
|
289
|
+
cleanup(null);
|
|
290
|
+
};
|
|
291
|
+
opts.ctl.pause();
|
|
292
|
+
stdin.setRawMode(true);
|
|
293
|
+
stdin.resume();
|
|
294
|
+
stdin.on("data", onData);
|
|
295
|
+
keys.on("keypress", onKeypress);
|
|
296
|
+
stdout.on("resize", draw);
|
|
297
|
+
draw();
|
|
298
|
+
});
|
|
299
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Session } from "../core/session.js";
|
|
2
|
+
import type { Message } from "../core/types.js";
|
|
3
|
+
import { type TuiTheme } from "./branding.js";
|
|
4
|
+
export declare function sessionConversation(session: Session): readonly Message[];
|
|
5
|
+
export declare function replaySession(session: Session, control: {
|
|
6
|
+
write(text: string): void;
|
|
7
|
+
writeConversation?(text: string): void;
|
|
8
|
+
replayConversation?(renderer: (columns: number) => string): void;
|
|
9
|
+
}, theme: TuiTheme, columns: number): void;
|
|
10
|
+
export declare function resumeReplay(session: Session, theme: TuiTheme, columns: number): string;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { renderAssistantSegment, renderUserMessage } from "./branding.js";
|
|
2
|
+
import { commandSource, highlightCommand } from "./command-transcript.js";
|
|
3
|
+
import { plainText, wrapText } from "./terminal-text.js";
|
|
4
|
+
import { tr } from "./i18n.js";
|
|
5
|
+
// The model's history() is compacted; the visible conversation uses the
|
|
6
|
+
// original nodes on the selected branch, including archived messages.
|
|
7
|
+
export function sessionConversation(session) {
|
|
8
|
+
return session.nodeChain().map(node => node.message);
|
|
9
|
+
}
|
|
10
|
+
export function replaySession(session, control, theme, columns) {
|
|
11
|
+
if (control.replayConversation)
|
|
12
|
+
control.replayConversation(width => resumeReplay(session, theme, width));
|
|
13
|
+
else
|
|
14
|
+
(control.writeConversation ?? control.write).call(control, resumeReplay(session, theme, columns));
|
|
15
|
+
}
|
|
16
|
+
export function resumeReplay(session, theme, columns) {
|
|
17
|
+
const messages = sessionConversation(session);
|
|
18
|
+
const width = Math.max(2, columns - 5);
|
|
19
|
+
const out = [];
|
|
20
|
+
const calls = new Map();
|
|
21
|
+
const heading = (text, style = theme.dim) => {
|
|
22
|
+
out.push("\n" + wrapText(plainText(text), width, true).map(row => " " + style(row)).join("\n") + "\n");
|
|
23
|
+
};
|
|
24
|
+
const literal = (text, style = theme.dim) => {
|
|
25
|
+
out.push(wrapText(plainText(text), width, true).map(row => " " + style(row)).join("\n") + "\n");
|
|
26
|
+
};
|
|
27
|
+
const attachment = (part) => {
|
|
28
|
+
const source = part.source && !part.source.startsWith("data:") ? ` · ${part.source}` : "";
|
|
29
|
+
literal(`[${tr("immagine", "image")} · ${part.mime}${source}]`);
|
|
30
|
+
};
|
|
31
|
+
heading(tr("ripresa sessione {name}({id}) · {count} messaggi", "Resumed session {name}({id}) · {count} messages", {
|
|
32
|
+
name: session.name ? `"${session.name}" ` : "", id: session.id, count: messages.length,
|
|
33
|
+
}), theme.bold);
|
|
34
|
+
for (const message of messages) {
|
|
35
|
+
let text = "";
|
|
36
|
+
const flushText = () => {
|
|
37
|
+
if (!text.trim()) {
|
|
38
|
+
text = "";
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
if (message.role === "user")
|
|
42
|
+
out.push(renderUserMessage(text, theme, columns));
|
|
43
|
+
else if (message.role === "assistant")
|
|
44
|
+
out.push(renderAssistantSegment(text, theme, columns));
|
|
45
|
+
else {
|
|
46
|
+
heading(message.role === "system" ? tr("Sistema", "System") : tr("Strumento", "Tool"));
|
|
47
|
+
literal(text);
|
|
48
|
+
}
|
|
49
|
+
text = "";
|
|
50
|
+
};
|
|
51
|
+
for (const part of message.content) {
|
|
52
|
+
if (part.type === "text") {
|
|
53
|
+
text += (text ? "\n\n" : "") + part.text;
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
flushText();
|
|
57
|
+
if (part.type === "tool_call") {
|
|
58
|
+
calls.set(part.id, part);
|
|
59
|
+
heading(`${tr("Strumento", "Tool")} · ${part.name}`, theme.accent);
|
|
60
|
+
const source = commandSource(part);
|
|
61
|
+
literal(source ?? JSON.stringify(part.input, null, 2), source === undefined ? theme.dim : row => highlightCommand(row, theme));
|
|
62
|
+
}
|
|
63
|
+
else if (part.type === "tool_result") {
|
|
64
|
+
const name = calls.get(part.callId)?.name ?? part.callId;
|
|
65
|
+
heading(`${part.isError ? tr("Errore", "Error") : tr("Risultato", "Result")} · ${name}`, part.isError ? theme.red : theme.dim);
|
|
66
|
+
literal(part.output || tr("(nessun output)", "(no output)"), part.isError ? theme.red : theme.dim);
|
|
67
|
+
for (const media of part.media ?? [])
|
|
68
|
+
attachment(media);
|
|
69
|
+
}
|
|
70
|
+
else if (part.type === "image") {
|
|
71
|
+
attachment(part);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
flushText();
|
|
75
|
+
}
|
|
76
|
+
heading(tr("contesto ripreso: continua pure da qui", "Context restored: continue from here"));
|
|
77
|
+
return out.join("");
|
|
78
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { AgentEvent, PlanLimits, Usage } from "../core/types.js";
|
|
2
|
+
import type { CostTracker } from "./cost-tracker.js";
|
|
3
|
+
import { ContextMeter } from "./context-meter.js";
|
|
4
|
+
export declare const isSubscription: (providerId: string) => boolean;
|
|
5
|
+
export declare class SessionUsageState {
|
|
6
|
+
readonly cost: CostTracker;
|
|
7
|
+
readonly context: ContextMeter;
|
|
8
|
+
last?: Usage;
|
|
9
|
+
readonly limits: Map<string, PlanLimits>;
|
|
10
|
+
missing: number;
|
|
11
|
+
incomplete: boolean;
|
|
12
|
+
unsaved: boolean;
|
|
13
|
+
private readonly seen;
|
|
14
|
+
private directory;
|
|
15
|
+
private sessionId;
|
|
16
|
+
constructor(cost: CostTracker);
|
|
17
|
+
restore(directory: string, sessionId: string, oldestAssistantAt?: number): void;
|
|
18
|
+
private add;
|
|
19
|
+
observe(event: Extract<AgentEvent, {
|
|
20
|
+
type: "usage";
|
|
21
|
+
}>): void;
|
|
22
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { readSessionUsage, saveSessionUsage } from "../core/session-usage.js";
|
|
2
|
+
import { ContextMeter } from "./context-meter.js";
|
|
3
|
+
export const isSubscription = (providerId) => providerId === "chatgpt" || providerId === "claude-code";
|
|
4
|
+
export class SessionUsageState {
|
|
5
|
+
cost;
|
|
6
|
+
context = new ContextMeter();
|
|
7
|
+
last;
|
|
8
|
+
limits = new Map();
|
|
9
|
+
missing = 0;
|
|
10
|
+
incomplete = false;
|
|
11
|
+
unsaved = false;
|
|
12
|
+
seen = new Set();
|
|
13
|
+
directory = "";
|
|
14
|
+
sessionId = "";
|
|
15
|
+
constructor(cost) {
|
|
16
|
+
this.cost = cost;
|
|
17
|
+
}
|
|
18
|
+
restore(directory, sessionId, oldestAssistantAt) {
|
|
19
|
+
this.context.reset();
|
|
20
|
+
this.directory = directory;
|
|
21
|
+
this.sessionId = sessionId;
|
|
22
|
+
this.cost.reset();
|
|
23
|
+
this.seen.clear();
|
|
24
|
+
this.last = undefined;
|
|
25
|
+
this.missing = 0;
|
|
26
|
+
this.unsaved = false;
|
|
27
|
+
const saved = readSessionUsage(directory, sessionId);
|
|
28
|
+
this.incomplete = saved.incomplete || (oldestAssistantAt !== undefined &&
|
|
29
|
+
(!saved.records.length || oldestAssistantAt < Math.min(...saved.records.map(r => r.at))));
|
|
30
|
+
for (const record of saved.records)
|
|
31
|
+
this.add(record);
|
|
32
|
+
}
|
|
33
|
+
add(record) {
|
|
34
|
+
if (this.seen.has(record.id))
|
|
35
|
+
return;
|
|
36
|
+
this.seen.add(record.id);
|
|
37
|
+
if (record.usage) {
|
|
38
|
+
this.last = record.usage;
|
|
39
|
+
this.cost.record(record.model, record.usage, isSubscription(record.providerId));
|
|
40
|
+
}
|
|
41
|
+
else
|
|
42
|
+
this.missing++;
|
|
43
|
+
const previous = this.limits.get(record.providerId);
|
|
44
|
+
if (record.limits && (!previous || record.limits.capturedAt >= previous.capturedAt))
|
|
45
|
+
this.limits.set(record.providerId, record.limits);
|
|
46
|
+
}
|
|
47
|
+
observe(event) {
|
|
48
|
+
if (this.seen.has(event.record.id))
|
|
49
|
+
return;
|
|
50
|
+
const own = event.record.sessionId === this.sessionId;
|
|
51
|
+
const saved = own ? event.persisted : saveSessionUsage(this.directory, this.sessionId, event.record);
|
|
52
|
+
this.unsaved ||= !saved;
|
|
53
|
+
this.add(event.record);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ToolCallPart } from "../core/types.js";
|
|
2
|
+
import type { TuiTheme } from "./branding.js";
|
|
3
|
+
export declare function loadedSkill(call: ToolCallPart): string | undefined;
|
|
4
|
+
export declare function skillHeader(state: "running" | "ok" | "error", theme: TuiTheme, columns: number): string;
|
|
5
|
+
export declare function skillPreview(name: string, theme: TuiTheme, columns: number, state?: "running" | "ok" | "error"): string[];
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { fitLine, plainText } from "./terminal-text.js";
|
|
2
|
+
import { tr } from "./i18n.js";
|
|
3
|
+
export function loadedSkill(call) {
|
|
4
|
+
if (call.name === "skill_load" && typeof call.input["name"] === "string")
|
|
5
|
+
return call.input["name"];
|
|
6
|
+
if (call.name === "vascend_skill" && call.input["load"] === true && Array.isArray(call.input["skills"])) {
|
|
7
|
+
return call.input["skills"].filter((name) => typeof name === "string").join(", ") || undefined;
|
|
8
|
+
}
|
|
9
|
+
if (call.name === "read_file" && typeof call.input["path"] === "string") {
|
|
10
|
+
const path = call.input["path"].replaceAll("\\", "/");
|
|
11
|
+
return /(?:^|\/)SKILL\.md$/i.test(path) ? path.split("/").at(-2) || "SKILL.md" : undefined;
|
|
12
|
+
}
|
|
13
|
+
if (call.name === "bash" && typeof call.input["command"] === "string") {
|
|
14
|
+
// Recognize a single declared file read, never a script or command chain.
|
|
15
|
+
const read = /^\s*(?:cat|type|Get-Content)(?:\s+-(?:LiteralPath|Path)|\s+-Encoding\s+(?:UTF8|UTF-8))?\s+(?:-(?:LiteralPath|Path)\s+)?(?:"([^"]+)"|'([^']+)'|([^\s;&|<>]+))\s*$/i.exec(call.input["command"]);
|
|
16
|
+
const path = (read?.[1] ?? read?.[2] ?? read?.[3])?.replaceAll("\\", "/");
|
|
17
|
+
if (path && /(?:^|\/)SKILL\.md$/i.test(path))
|
|
18
|
+
return path.split("/").at(-2) || "SKILL.md";
|
|
19
|
+
}
|
|
20
|
+
return undefined;
|
|
21
|
+
}
|
|
22
|
+
export function skillHeader(state, theme, columns) {
|
|
23
|
+
const label = state === "running" ? tr("Esplorazione", "Exploring")
|
|
24
|
+
: state === "error" ? tr("Errore", "Error") : tr("Esplorato", "Explored");
|
|
25
|
+
return fitLine(theme.dim(" • ") + (state === "error" ? theme.red : theme.bold)(label), Math.max(1, columns - 1));
|
|
26
|
+
}
|
|
27
|
+
export function skillPreview(name, theme, columns, state = "running") {
|
|
28
|
+
return [skillHeader(state, theme, columns),
|
|
29
|
+
fitLine(theme.dim(" └ ") + (theme.markdownLink ?? theme.accent)(tr("Lettura", "Read"))
|
|
30
|
+
+ theme.dim(` SKILL.md (${plainText(name).replace(/\s+/g, " ")} skill)`), Math.max(1, columns - 1))];
|
|
31
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { TuiTheme } from "./branding.js";
|
|
2
|
+
import type { StatusData } from "./status-line.js";
|
|
3
|
+
export declare function permissionLabel(mode?: string): string;
|
|
4
|
+
export declare function buildTerminalStartup(d: StatusData, t: TuiTheme): readonly string[];
|
|
5
|
+
export declare function buildStartupRuntime(d: StatusData, t: TuiTheme): string;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { TALOS_VERSION } from "../core/version.js";
|
|
2
|
+
import { tr } from "./i18n.js";
|
|
3
|
+
import { fitLine, oneLine, padLine, terminalWidth, wrapText } from "./terminal-text.js";
|
|
4
|
+
function modelLabel(d, t, width) {
|
|
5
|
+
const model = oneLine(d.model).split("/").pop() || oneLine(d.model);
|
|
6
|
+
const suffix = [d.effort ? t.muted(oneLine(d.effort)) : "", d.fast ? t.accent("fast") : ""].filter(Boolean).join(" ");
|
|
7
|
+
const budget = Math.max(1, width - terminalWidth(suffix) - (suffix ? 1 : 0));
|
|
8
|
+
return fitLine(t.silver(fitLine(model, budget)) + (suffix ? " " + suffix : ""), width);
|
|
9
|
+
}
|
|
10
|
+
export function permissionLabel(mode = "normal") {
|
|
11
|
+
const labels = { normal: tr("Conferma azioni", "Ask before actions"), acceptEdits: tr("Modifiche automatiche", "Automatic edits"), auto: tr("Senza conferme", "No confirmations") };
|
|
12
|
+
return labels[mode] ?? labels["normal"];
|
|
13
|
+
}
|
|
14
|
+
// The native renderer refreshes this header when the settings change.
|
|
15
|
+
export function buildTerminalStartup(d, t) {
|
|
16
|
+
const width = Math.max(2, d.width - 2);
|
|
17
|
+
const preferred = Math.max(46, terminalWidth(oneLine(d.cwd)) + 11, terminalWidth(modelLabel(d, t, 200)) + 26, terminalWidth(oneLine(d.sessionLabel ?? "")) + 11);
|
|
18
|
+
const inner = Math.max(2, Math.min(68, preferred, width - 4));
|
|
19
|
+
const permission = permissionLabel(d.permissions);
|
|
20
|
+
const permissionPaint = d.permissions === "auto" ? t.yellow : t.muted;
|
|
21
|
+
const title = t.muted(">_ ") + t.bold(t.silver("Vascend Talos")) + t.muted(` (v${TALOS_VERSION})`);
|
|
22
|
+
const body = [fitLine(title, inner), ""];
|
|
23
|
+
const labelWidth = Math.max(11, tr("permessi:", "permissions:").length + 1);
|
|
24
|
+
const stacked = inner < 40;
|
|
25
|
+
const field = (label, value, paint) => {
|
|
26
|
+
if (stacked) {
|
|
27
|
+
body.push(t.muted(label));
|
|
28
|
+
body.push(...wrapText(oneLine(value), Math.max(2, inner - 2), true).map(line => " " + paint(line)));
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
const rows = wrapText(oneLine(value), inner - labelWidth, true);
|
|
32
|
+
body.push(...rows.map((line, i) => (i === 0 ? t.muted(label.padEnd(labelWidth)) : " ".repeat(labelWidth)) + paint(line)));
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
if (stacked) {
|
|
36
|
+
body.push(t.muted(tr("modello:", "model:")), " " + modelLabel(d, t, inner - 2));
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
let model = modelLabel(d, t, inner - labelWidth);
|
|
40
|
+
const shortcut = tr(" /model cambia", " /model change");
|
|
41
|
+
if (terminalWidth(model) + shortcut.length <= inner - labelWidth)
|
|
42
|
+
model += t.accent(shortcut);
|
|
43
|
+
body.push(t.muted(tr("modello:", "model:").padEnd(labelWidth)) + model);
|
|
44
|
+
}
|
|
45
|
+
field(tr("cartella:", "directory:"), d.cwd, t.silver);
|
|
46
|
+
field(tr("permessi:", "permissions:"), permission, permissionPaint);
|
|
47
|
+
if (d.sessionLabel)
|
|
48
|
+
field("chat:", d.sessionLabel, t.silver);
|
|
49
|
+
if (width < 12)
|
|
50
|
+
return body.map(line => fitLine(line, width));
|
|
51
|
+
const edge = (left, right) => " " + t.frame(left + "─".repeat(inner + 2) + right);
|
|
52
|
+
return [edge("╭", "╮"), ...body.map(line => " " + t.frame("│ ") + padLine(line, inner) + t.frame(" │")), edge("╰", "╯")];
|
|
53
|
+
}
|
|
54
|
+
export function buildStartupRuntime(d, t) {
|
|
55
|
+
const width = Math.max(1, d.width - 3);
|
|
56
|
+
let line = modelLabel(d, t, width);
|
|
57
|
+
const remaining = width - terminalWidth(line) - 3;
|
|
58
|
+
if (remaining >= 8)
|
|
59
|
+
line += t.dim(" · ") + t.muted(fitLine(oneLine(d.cwd), remaining));
|
|
60
|
+
return fitLine(" " + line, Math.max(1, d.width - 1));
|
|
61
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SegmentRender } from "./status-line.js";
|
|
2
|
+
export interface StatusExt {
|
|
3
|
+
readonly render?: SegmentRender;
|
|
4
|
+
readonly custom?: Readonly<Record<string, SegmentRender>>;
|
|
5
|
+
readonly path?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function statusLineFiles(cwd: string, projectTrusted: boolean): string[];
|
|
8
|
+
export declare function loadStatusExt(cwd: string, projectTrusted: boolean): Promise<StatusExt>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import { homedir } from "node:os";
|
|
3
|
+
import { join, resolve } from "node:path";
|
|
4
|
+
import { pathToFileURL } from "node:url";
|
|
5
|
+
// File candidati (progetto prima, poi globale). Solo i fidati: il file di
|
|
6
|
+
// progetto richiede project trust.
|
|
7
|
+
export function statusLineFiles(cwd, projectTrusted) {
|
|
8
|
+
const names = ["status-line.js", "status-line.mjs", "status-line.cjs", "status-line.ts"];
|
|
9
|
+
const out = [];
|
|
10
|
+
if (projectTrusted)
|
|
11
|
+
for (const n of names)
|
|
12
|
+
out.push(join(cwd, ".talos", n));
|
|
13
|
+
for (const n of names)
|
|
14
|
+
out.push(join(homedir(), ".talos", n));
|
|
15
|
+
return out;
|
|
16
|
+
}
|
|
17
|
+
export async function loadStatusExt(cwd, projectTrusted) {
|
|
18
|
+
const file = statusLineFiles(cwd, projectTrusted).find((p) => existsSync(p));
|
|
19
|
+
if (!file)
|
|
20
|
+
return {};
|
|
21
|
+
try {
|
|
22
|
+
// Cache-bust per il reload a caldo (ogni import rilegge il file).
|
|
23
|
+
const url = pathToFileURL(resolve(file)).href + `?t=${Date.now()}`;
|
|
24
|
+
const mod = (await import(url));
|
|
25
|
+
const render = typeof mod.default === "function" ? mod.default : undefined;
|
|
26
|
+
const custom = mod.segments && typeof mod.segments === "object" ? mod.segments : undefined;
|
|
27
|
+
return { render, custom, path: file };
|
|
28
|
+
}
|
|
29
|
+
catch (err) {
|
|
30
|
+
process.stderr.write(`[status-line] errore caricando ${file}: ${err.message}\n`);
|
|
31
|
+
return { path: file };
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { TuiTheme } from "./branding.js";
|
|
2
|
+
import type { ContextArchiveBlock } from "./context-meter.js";
|
|
3
|
+
import { type CostSnapshot } from "./cost-tracker.js";
|
|
4
|
+
export interface StatusData {
|
|
5
|
+
readonly model: string;
|
|
6
|
+
readonly provider?: string;
|
|
7
|
+
readonly cwd: string;
|
|
8
|
+
readonly effort?: string;
|
|
9
|
+
readonly fast?: boolean;
|
|
10
|
+
readonly vibeMode?: string;
|
|
11
|
+
readonly permissions?: string;
|
|
12
|
+
readonly sessionLabel?: string;
|
|
13
|
+
readonly contextTokens?: number;
|
|
14
|
+
readonly contextWindow?: number;
|
|
15
|
+
readonly contextArchive?: readonly ContextArchiveBlock[];
|
|
16
|
+
readonly regno?: {
|
|
17
|
+
readonly done: number;
|
|
18
|
+
readonly total: number;
|
|
19
|
+
readonly castles: number;
|
|
20
|
+
} | null;
|
|
21
|
+
readonly cost?: CostSnapshot | null;
|
|
22
|
+
readonly bg?: {
|
|
23
|
+
readonly running: number;
|
|
24
|
+
readonly total: number;
|
|
25
|
+
} | null;
|
|
26
|
+
readonly width: number;
|
|
27
|
+
}
|
|
28
|
+
export type SegmentRender = (d: StatusData, theme: TuiTheme) => string | null;
|
|
29
|
+
export interface StatusOptions {
|
|
30
|
+
readonly order?: readonly string[];
|
|
31
|
+
readonly custom?: Readonly<Record<string, SegmentRender>>;
|
|
32
|
+
readonly render?: (d: StatusData, theme: TuiTheme) => string | null;
|
|
33
|
+
}
|
|
34
|
+
export declare const DEFAULT_ORDER: readonly string[];
|
|
35
|
+
export declare const BUILTIN_SEGMENTS: Readonly<Record<string, SegmentRender>>;
|
|
36
|
+
export declare function buildStatusLine(d: StatusData, theme: TuiTheme, opts?: StatusOptions): string;
|
|
37
|
+
export declare function buildTerminalHeader(d: StatusData, theme: TuiTheme): readonly string[];
|
|
38
|
+
export declare function buildTerminalWelcome(width: number, theme: TuiTheme): string;
|