@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,20 @@
|
|
|
1
|
+
import { pendingText } from "../core/user-inbox.js";
|
|
2
|
+
import { findImageRefs } from "./image-attachments.js";
|
|
3
|
+
import { IMAGE_REF } from "./attachment-refs.js";
|
|
4
|
+
// Il testo espanso e i byte sono salvati insieme alla coda: un riavvio non
|
|
5
|
+
// dipende dai registri in memoria o dall'esistenza del file immagine originale.
|
|
6
|
+
export function restoreQueuedInput(entry, images) {
|
|
7
|
+
const oldRefs = findImageRefs(entry.text);
|
|
8
|
+
const replacements = new Map();
|
|
9
|
+
const extra = [];
|
|
10
|
+
const restoredImages = entry.parts.filter(part => part.type === "image").map((part, index) => {
|
|
11
|
+
const restored = images.addData(Buffer.from(part.data, "base64"), part.mime, "ripristinata dalla coda");
|
|
12
|
+
if (oldRefs[index] !== undefined)
|
|
13
|
+
replacements.set(oldRefs[index], restored.ref);
|
|
14
|
+
else
|
|
15
|
+
extra.push(restored.ref);
|
|
16
|
+
return { ...part, source: restored.ref };
|
|
17
|
+
});
|
|
18
|
+
const text = [pendingText(entry).replace(new RegExp(IMAGE_REF, "gi"), (ref, id) => replacements.get(Number(id)) ?? ref), ...extra].join(" ");
|
|
19
|
+
return { ...entry, text, parts: [{ type: "text", text }, ...restoredImages] };
|
|
20
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { TuiTheme } from "./branding.js";
|
|
2
|
+
import type { ReviewEntry } from "./review-store.js";
|
|
3
|
+
export type DetailTab = "output" | "input" | "diff" | "before" | "after";
|
|
4
|
+
export declare const DETAIL_LABELS: Readonly<Record<DetailTab, string>>;
|
|
5
|
+
export declare function detailTabs(entry: ReviewEntry): readonly DetailTab[];
|
|
6
|
+
export declare function detailLines(entry: ReviewEntry, tab: DetailTab, width: number, t: TuiTheme): readonly string[];
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { renderDiff } from "./diff.js";
|
|
2
|
+
import { padLine, plainText, wrapText } from "./terminal-text.js";
|
|
3
|
+
import { commandSource, highlightCommand } from "./command-transcript.js";
|
|
4
|
+
export const DETAIL_LABELS = {
|
|
5
|
+
output: "Risultato", input: "Parametri", diff: "Confronto", before: "Prima", after: "Dopo",
|
|
6
|
+
};
|
|
7
|
+
export function detailTabs(entry) {
|
|
8
|
+
return ["output", ...(entry.input ? ["input"] : []),
|
|
9
|
+
...(entry.change ? ["diff", "before", "after"] : [])];
|
|
10
|
+
}
|
|
11
|
+
export function detailLines(entry, tab, width, t) {
|
|
12
|
+
if (tab === "diff") {
|
|
13
|
+
const change = entry.change;
|
|
14
|
+
if (!change)
|
|
15
|
+
return [t.muted("Nessuna modifica associata.")];
|
|
16
|
+
const note = change.scope === "fragment" ? "Frammento" : change.scope === "append" ? "Aggiunta"
|
|
17
|
+
: change.scope === "reported" ? "Frammento segnalato" : "Confronto";
|
|
18
|
+
if (change.before === undefined && change.scope !== "append") {
|
|
19
|
+
return [...wrapText("Versione precedente non disponibile.", width).map(t.muted), ...numbered(change.after, width, t)];
|
|
20
|
+
}
|
|
21
|
+
const before = plainText(change.before ?? "");
|
|
22
|
+
const after = plainText(change.after);
|
|
23
|
+
const diff = renderDiff(before, after, t, { columns: width, context: 2, path: entry.target, wrapLines: true });
|
|
24
|
+
if (!diff)
|
|
25
|
+
return [t.muted("Nessuna differenza.")];
|
|
26
|
+
const rows = diff.trimEnd().split("\n").slice(1);
|
|
27
|
+
const counts = /\+\d+ −\d+/.exec(plainText(rows[0] ?? ""))?.[0] ?? "";
|
|
28
|
+
return [t.muted(`${note} · ${counts}`), ...rows.slice(1)];
|
|
29
|
+
}
|
|
30
|
+
let body;
|
|
31
|
+
if (tab === "input" && entry.input && entry.tool) {
|
|
32
|
+
const source = commandSource({ name: entry.tool, input: entry.input });
|
|
33
|
+
if (source !== undefined) {
|
|
34
|
+
const args = entry.tool === "execute" && entry.input["mode"] === "call" || entry.tool === "tool_invoke"
|
|
35
|
+
? entry.input["args"] : entry.input;
|
|
36
|
+
const settings = Object.fromEntries(Object.entries(args ?? {}).filter(([key]) => !["command", "code"].includes(key)));
|
|
37
|
+
return [...numbered(source, width, t, true),
|
|
38
|
+
...(Object.keys(settings).length ? ["", t.muted("Parametri"), ...numbered(JSON.stringify(settings, null, 2), width, t)] : [])];
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
if (tab === "input")
|
|
42
|
+
body = JSON.stringify(entry.input ?? {}, null, 2);
|
|
43
|
+
else if (tab === "before")
|
|
44
|
+
body = entry.change?.before ?? "Versione precedente non disponibile per questa operazione.";
|
|
45
|
+
else if (tab === "after")
|
|
46
|
+
body = entry.change?.after ?? "";
|
|
47
|
+
else
|
|
48
|
+
body = entry.output ?? (entry.state === "running" ? "Operazione in corso. Il risultato apparirà qui appena disponibile."
|
|
49
|
+
: entry.state === "stopped" ? "Nessun risultato ricevuto prima della fine del turno." : "Nessun output testuale.");
|
|
50
|
+
return numbered(body || "(vuoto)", width, t);
|
|
51
|
+
}
|
|
52
|
+
function numbered(body, width, t, code = false) {
|
|
53
|
+
const source = plainText(body).split("\n");
|
|
54
|
+
const gutter = String(source.length).length;
|
|
55
|
+
return source.flatMap((line, index) => wrapText(line, Math.max(2, width - gutter - 3)).map((row, part) => t.dim(padLine(part ? "" : String(index + 1), gutter) + " │ ") + (code ? highlightCommand(row, t) : row)));
|
|
56
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export function fileChanges(store, target) {
|
|
2
|
+
return store.entries().filter(e => e.target === target && (e.change || e.kind === "file"));
|
|
3
|
+
}
|
|
4
|
+
// Una voce stabile per file, senza fondere frammenti diversi in un falso diff completo.
|
|
5
|
+
export function fileEntries(store) {
|
|
6
|
+
const groups = new Map();
|
|
7
|
+
for (const entry of store.entries()) {
|
|
8
|
+
if (!entry.change && entry.kind !== "file")
|
|
9
|
+
continue;
|
|
10
|
+
const entries = groups.get(entry.target) ?? [];
|
|
11
|
+
entries.push(entry);
|
|
12
|
+
groups.set(entry.target, entries);
|
|
13
|
+
}
|
|
14
|
+
return [...groups].map(([target, entries]) => {
|
|
15
|
+
const latest = entries.at(-1);
|
|
16
|
+
const count = entries.length;
|
|
17
|
+
return { id: `file:${target}`, kind: "file", title: `${count} ${count === 1 ? "modifica" : "modifiche"}`,
|
|
18
|
+
target, actor: [...new Set(entries.map(e => e.actor))].join(", "),
|
|
19
|
+
state: entries.some(e => e.state === "running") ? "running" : latest.state,
|
|
20
|
+
output: entries.map(e => `${e.title}\n${e.output ?? ""}`).join("\n") };
|
|
21
|
+
});
|
|
22
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { TuiTheme } from "./branding.js";
|
|
2
|
+
import type { ReviewEntry, ReviewState, ReviewStore } from "./review-store.js";
|
|
3
|
+
export interface ReviewContext {
|
|
4
|
+
readonly cwd: string;
|
|
5
|
+
readonly model: string;
|
|
6
|
+
readonly permissions: string;
|
|
7
|
+
readonly sessionId: string;
|
|
8
|
+
readonly usage?: string;
|
|
9
|
+
readonly context?: string;
|
|
10
|
+
readonly plan?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const REVIEW_TABS: readonly ["Riepilogo", "Attività", "Modifiche", "Team", "Problemi"];
|
|
13
|
+
export declare const STATE_LABELS: Readonly<Record<ReviewState, string>>;
|
|
14
|
+
export declare function stateMark(state: ReviewState, t: TuiTheme): string;
|
|
15
|
+
export declare function duration(entry: ReviewEntry): string;
|
|
16
|
+
export declare function reviewTabs(tab: number, width: number, t: TuiTheme, navigating?: boolean): string;
|
|
17
|
+
export declare function reviewNextStep(store: ReviewStore): {
|
|
18
|
+
tab: number;
|
|
19
|
+
label: string;
|
|
20
|
+
};
|
|
21
|
+
export declare function overview(store: ReviewStore, context: ReviewContext, width: number, t: TuiTheme, expanded?: boolean): readonly string[];
|
|
22
|
+
export declare function entryRows(entry: ReviewEntry, selected: boolean, width: number, t: TuiTheme): readonly string[];
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { teamEntries } from "./review-team.js";
|
|
2
|
+
import { fitLine, oneLine, padLine, terminalWidth, wrapText } from "./terminal-text.js";
|
|
3
|
+
export const REVIEW_TABS = ["Riepilogo", "Attività", "Modifiche", "Team", "Problemi"];
|
|
4
|
+
export const STATE_LABELS = {
|
|
5
|
+
running: "in corso", ok: "riuscita", error: "errore", stopped: "interrotta", info: "nota",
|
|
6
|
+
};
|
|
7
|
+
export function stateMark(state, t) {
|
|
8
|
+
return state === "running" ? t.accent("◌") : state === "ok" ? t.green("✓")
|
|
9
|
+
: state === "error" ? t.red("×") : state === "stopped" ? t.yellow("–") : t.muted("·");
|
|
10
|
+
}
|
|
11
|
+
export function duration(entry) {
|
|
12
|
+
if (!entry.startedAt)
|
|
13
|
+
return "";
|
|
14
|
+
const end = entry.endedAt ?? (entry.state === "running" ? Date.now() : entry.startedAt);
|
|
15
|
+
const seconds = Math.max(0, Math.floor((end - entry.startedAt) / 1000));
|
|
16
|
+
return seconds < 60 ? `${seconds}s` : `${Math.floor(seconds / 60)}m ${seconds % 60}s`;
|
|
17
|
+
}
|
|
18
|
+
export function reviewTabs(tab, width, t, navigating = true) {
|
|
19
|
+
if (!navigating)
|
|
20
|
+
return t.muted(REVIEW_TABS[tab] + " / ") + t.bold("Dettaglio");
|
|
21
|
+
const full = REVIEW_TABS.map((label, i) => i === tab
|
|
22
|
+
? t.accent(`\x1b[7m${i + 1} ${label}\x1b[27m`) : t.muted(`${i + 1} ${label}`)).join(" ");
|
|
23
|
+
if (terminalWidth(full) <= width)
|
|
24
|
+
return full;
|
|
25
|
+
return t.accent(`${tab + 1} ${REVIEW_TABS[tab]}`) + t.dim(" ← → sezioni");
|
|
26
|
+
}
|
|
27
|
+
export function reviewNextStep(store) {
|
|
28
|
+
const entries = store.entries();
|
|
29
|
+
if (entries.some(e => e.state === "error" || e.state === "stopped"))
|
|
30
|
+
return { tab: 4, label: "Esamina i problemi" };
|
|
31
|
+
if (entries.some(e => e.change || e.kind === "file"))
|
|
32
|
+
return { tab: 2, label: "Controlla le modifiche" };
|
|
33
|
+
return { tab: 1, label: "Esplora le attività" };
|
|
34
|
+
}
|
|
35
|
+
export function overview(store, context, width, t, expanded = false) {
|
|
36
|
+
const entries = store.entries();
|
|
37
|
+
const tools = entries.filter(e => e.kind === "tool");
|
|
38
|
+
const active = tools.filter(e => e.state === "running");
|
|
39
|
+
const failed = entries.filter(e => e.state === "error" || e.state === "stopped");
|
|
40
|
+
const changed = entries.filter(e => e.change || e.kind === "file");
|
|
41
|
+
const done = tools.filter(e => e.state === "ok").length;
|
|
42
|
+
const files = new Set(changed.map(e => e.target)).size;
|
|
43
|
+
const metrics = [`${tools.length} operazioni`, `${done} ok`, `${files} file`, `${failed.length} da esaminare`];
|
|
44
|
+
const rows = wrapText(metrics.join(" · "), width).map(t.bold);
|
|
45
|
+
const field = (label, value, full = expanded) => {
|
|
46
|
+
const prefix = t.muted(padLine(label, 10));
|
|
47
|
+
const body = full ? wrapText(value, Math.max(2, width - 10)) : [oneLine(value)];
|
|
48
|
+
body.forEach((line, i) => rows.push(fitLine((i ? " ".repeat(10) : prefix) + line, width)));
|
|
49
|
+
};
|
|
50
|
+
field("Stato", store.label);
|
|
51
|
+
if (entries.length) {
|
|
52
|
+
rows.push("");
|
|
53
|
+
rows.push(t.accent(reviewNextStep(store).label));
|
|
54
|
+
if (failed.length)
|
|
55
|
+
rows.push(...wrapText("Apri Problemi per leggere gli errori e le operazioni interrotte.", width).map(t.muted));
|
|
56
|
+
else if (files)
|
|
57
|
+
rows.push(...wrapText("Apri Modifiche per confrontare il contenuto prima e dopo.", width).map(t.muted));
|
|
58
|
+
rows.push("");
|
|
59
|
+
}
|
|
60
|
+
const agents = teamEntries(store);
|
|
61
|
+
if (agents.length)
|
|
62
|
+
field("Team", `${agents.length} collaboratori · ${agents.filter(e => e.state === "running").length} attivi · 4 Team per seguire ciascuno`);
|
|
63
|
+
if (active.length) {
|
|
64
|
+
for (const e of active.slice(0, 2))
|
|
65
|
+
rows.push(fitLine(stateMark(e.state, t) + ` ${e.title} ` + t.muted(oneLine(e.target)), width));
|
|
66
|
+
if (active.length > 2)
|
|
67
|
+
rows.push(t.dim(`+${active.length - 2} in corso · 2 Attività`));
|
|
68
|
+
}
|
|
69
|
+
if (store.goal) {
|
|
70
|
+
field("Obiettivo", store.goal);
|
|
71
|
+
}
|
|
72
|
+
if (context.plan)
|
|
73
|
+
field("Piano", context.plan);
|
|
74
|
+
if (expanded) {
|
|
75
|
+
rows.push("");
|
|
76
|
+
field("Progetto", context.cwd);
|
|
77
|
+
field("Modello", context.model + ` · ${context.permissions}`);
|
|
78
|
+
field("Sessione", context.sessionId, true);
|
|
79
|
+
if (context.usage)
|
|
80
|
+
field("Consumi", context.usage, true);
|
|
81
|
+
if (context.context)
|
|
82
|
+
field("Contesto", context.context, true);
|
|
83
|
+
}
|
|
84
|
+
if (!entries.length)
|
|
85
|
+
rows.push(...wrapText("Nessuna attività da esaminare. Le operazioni compariranno qui durante il lavoro.", width).map(t.muted));
|
|
86
|
+
return rows;
|
|
87
|
+
}
|
|
88
|
+
export function entryRows(entry, selected, width, t) {
|
|
89
|
+
const lead = selected ? t.accent("▸") : " ";
|
|
90
|
+
const titleWidth = width >= 70 ? 13 : width >= 45 ? 9 : 0;
|
|
91
|
+
const title = titleWidth ? padLine(fitLine(selected ? t.bold(entry.title) : entry.title, titleWidth), titleWidth) + " " : "";
|
|
92
|
+
const prefix = lead + " " + stateMark(entry.state, t) + " " + title;
|
|
93
|
+
const meta = [entry.actor !== "Talos" && width >= 70 ? oneLine(entry.actor) : "", width >= 55 ? duration(entry) : ""].filter(Boolean).join(" · ");
|
|
94
|
+
const suffix = meta ? " " + t.muted(fitLine(meta, Math.min(22, Math.floor(width / 4)))) : "";
|
|
95
|
+
const targetWidth = Math.max(1, width - terminalWidth(prefix) - terminalWidth(suffix));
|
|
96
|
+
const target = oneLine(entry.target) || entry.title;
|
|
97
|
+
return [fitLine(prefix + padLine(selected ? t.bold(target) : t.muted(target), targetWidth) + suffix, width)];
|
|
98
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { TuiTheme } from "./branding.js";
|
|
2
|
+
import { type ReviewContext } from "./review-render.js";
|
|
3
|
+
import { ReviewStore } from "./review-store.js";
|
|
4
|
+
import type { ScreenKey, TerminalScreen } from "./terminal-screen.js";
|
|
5
|
+
export declare function reviewSection(value?: string): number;
|
|
6
|
+
export declare class ReviewScreen implements TerminalScreen {
|
|
7
|
+
private readonly store;
|
|
8
|
+
private readonly theme;
|
|
9
|
+
private readonly context;
|
|
10
|
+
private tab;
|
|
11
|
+
private actor?;
|
|
12
|
+
private actorFilter;
|
|
13
|
+
private teamPosition?;
|
|
14
|
+
private file?;
|
|
15
|
+
private filePosition?;
|
|
16
|
+
private backToFiles;
|
|
17
|
+
private resetMatching;
|
|
18
|
+
private backToTeam;
|
|
19
|
+
private selectedId?;
|
|
20
|
+
private detailId?;
|
|
21
|
+
private detailTab;
|
|
22
|
+
private offset;
|
|
23
|
+
private listOffset;
|
|
24
|
+
private query;
|
|
25
|
+
private searching;
|
|
26
|
+
private expandedOverview;
|
|
27
|
+
private pageSize;
|
|
28
|
+
private maxOffset;
|
|
29
|
+
private matching;
|
|
30
|
+
private detailCache;
|
|
31
|
+
constructor(store: ReviewStore, theme: () => TuiTheme, context: () => ReviewContext, section?: string);
|
|
32
|
+
private entries;
|
|
33
|
+
render(width: number, height: number): readonly string[];
|
|
34
|
+
key(text: string, key: ScreenKey): "close" | void;
|
|
35
|
+
scroll(delta: number): void;
|
|
36
|
+
paste(text: string): void;
|
|
37
|
+
}
|
|
38
|
+
export declare function reviewText(store: ReviewStore, context: ReviewContext, theme: TuiTheme, width: number, section?: string): string;
|
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
import { DETAIL_LABELS, detailLines, detailTabs } from "./review-detail.js";
|
|
2
|
+
import { entryRows, overview, reviewNextStep, reviewTabs, STATE_LABELS, stateMark } from "./review-render.js";
|
|
3
|
+
import { ReviewStore } from "./review-store.js";
|
|
4
|
+
import { teamEntries } from "./review-team.js";
|
|
5
|
+
import { fileChanges, fileEntries } from "./review-files.js";
|
|
6
|
+
import { fitLine, oneLine, terminalWidth, wrapText } from "./terminal-text.js";
|
|
7
|
+
export function reviewSection(value = "") {
|
|
8
|
+
const names = { attivita: 1, "attività": 1, activity: 1,
|
|
9
|
+
modifiche: 2, files: 2, file: 2, team: 3, problemi: 4, errors: 4 };
|
|
10
|
+
return names[value.toLowerCase()] ?? 0;
|
|
11
|
+
}
|
|
12
|
+
export class ReviewScreen {
|
|
13
|
+
store;
|
|
14
|
+
theme;
|
|
15
|
+
context;
|
|
16
|
+
tab;
|
|
17
|
+
actor;
|
|
18
|
+
actorFilter = "tutti";
|
|
19
|
+
teamPosition;
|
|
20
|
+
file;
|
|
21
|
+
filePosition;
|
|
22
|
+
backToFiles() {
|
|
23
|
+
this.file = undefined;
|
|
24
|
+
this.selectedId = this.filePosition?.selectedId;
|
|
25
|
+
this.query = this.filePosition?.query ?? "";
|
|
26
|
+
this.listOffset = this.filePosition?.listOffset ?? 0;
|
|
27
|
+
this.offset = 0;
|
|
28
|
+
this.resetMatching();
|
|
29
|
+
}
|
|
30
|
+
resetMatching() { this.matching = undefined; }
|
|
31
|
+
backToTeam() {
|
|
32
|
+
this.actor = undefined;
|
|
33
|
+
this.actorFilter = "tutti";
|
|
34
|
+
this.selectedId = this.teamPosition?.selectedId;
|
|
35
|
+
this.query = this.teamPosition?.query ?? "";
|
|
36
|
+
this.listOffset = this.teamPosition?.listOffset ?? 0;
|
|
37
|
+
this.offset = 0;
|
|
38
|
+
this.resetMatching();
|
|
39
|
+
}
|
|
40
|
+
selectedId;
|
|
41
|
+
detailId;
|
|
42
|
+
detailTab = "output";
|
|
43
|
+
offset = 0;
|
|
44
|
+
listOffset = 0;
|
|
45
|
+
query = "";
|
|
46
|
+
searching = false;
|
|
47
|
+
expandedOverview = false;
|
|
48
|
+
pageSize = 8;
|
|
49
|
+
maxOffset = 0;
|
|
50
|
+
matching;
|
|
51
|
+
detailCache;
|
|
52
|
+
constructor(store, theme, context, section = "") {
|
|
53
|
+
this.store = store;
|
|
54
|
+
this.theme = theme;
|
|
55
|
+
this.context = context;
|
|
56
|
+
this.tab = reviewSection(section);
|
|
57
|
+
}
|
|
58
|
+
entries() {
|
|
59
|
+
if (this.matching?.revision === this.store.revision && this.matching.tab === this.tab && this.matching.query === this.query)
|
|
60
|
+
return this.matching.entries;
|
|
61
|
+
const query = this.query.toLocaleLowerCase();
|
|
62
|
+
const source = this.tab === 3 && !this.actor ? teamEntries(this.store)
|
|
63
|
+
: this.tab === 2 ? this.file ? [...fileChanges(this.store, this.file)].reverse().map((e, i, all) => ({ ...e, title: `Modifica ${all.length - i}/${all.length}` })) : fileEntries(this.store)
|
|
64
|
+
: this.store.entries();
|
|
65
|
+
const entries = source.filter(e => {
|
|
66
|
+
if (this.actor && e.actor !== this.actor)
|
|
67
|
+
return false;
|
|
68
|
+
if (this.actor && this.actorFilter === "attivi" && e.state !== "running")
|
|
69
|
+
return false;
|
|
70
|
+
if (this.actor && this.actorFilter === "problemi" && e.state !== "error" && e.state !== "stopped")
|
|
71
|
+
return false;
|
|
72
|
+
if (this.actor && this.actorFilter === "file" && !e.change && e.kind !== "file")
|
|
73
|
+
return false;
|
|
74
|
+
if (this.tab === 2 && !e.change && e.kind !== "file")
|
|
75
|
+
return false;
|
|
76
|
+
if (this.tab === 3 && e.actor === "Talos" && e.kind !== "team")
|
|
77
|
+
return false;
|
|
78
|
+
if (this.tab === 4 && e.state !== "error" && e.state !== "stopped")
|
|
79
|
+
return false;
|
|
80
|
+
return !query || `${e.title}\n${e.target}\n${e.actor}\n${e.output ?? ""}`.toLocaleLowerCase().includes(query);
|
|
81
|
+
});
|
|
82
|
+
this.matching = { revision: this.store.revision, tab: this.tab, query: this.query, entries };
|
|
83
|
+
return entries;
|
|
84
|
+
}
|
|
85
|
+
render(width, height) {
|
|
86
|
+
const t = this.theme();
|
|
87
|
+
const w = Math.max(4, width - 3);
|
|
88
|
+
const h = Math.max(1, height);
|
|
89
|
+
const margin = width >= 12 ? " " : "";
|
|
90
|
+
const tabs = reviewTabs(this.tab, w, t, !this.detailId);
|
|
91
|
+
const head = [t.bold("Revisione") + (this.store.running ? t.accent(" · in corso") : t.dim(" · " + oneLine(this.store.label))), tabs];
|
|
92
|
+
if (h >= 12)
|
|
93
|
+
head.push(t.dim(this.detailId ? "← → cambia dettaglio · ↑ ↓ scorri" : "← → cambia sezione · 1–5 accesso diretto"));
|
|
94
|
+
if (this.tab === 2 && !this.detailId) {
|
|
95
|
+
head.push(t.bold(this.file ? `Modifiche > ${oneLine(this.file)}` : `Scegli un file · ${fileEntries(this.store).length} file`));
|
|
96
|
+
if (this.file && h >= 12)
|
|
97
|
+
head.push(t.muted("Ultima modifica in cima · Invio confronto · Esc file"));
|
|
98
|
+
}
|
|
99
|
+
if (this.tab === 3 && !this.detailId) {
|
|
100
|
+
const agents = teamEntries(this.store);
|
|
101
|
+
const counts = `${agents.length} · ${agents.filter(e => e.state === "running").length} attivi · ${agents.filter(e => e.state === "error").length} errori`;
|
|
102
|
+
head.push(t.bold(this.actor ? `Team > ${oneLine(this.actor)}` : `Collaboratori · ${counts}`));
|
|
103
|
+
if (this.actor) {
|
|
104
|
+
const agent = agents.find(e => e.actor === this.actor);
|
|
105
|
+
head.push(t.muted(oneLine(agent?.output?.split("\n")[0] ?? "Incarico non disponibile")));
|
|
106
|
+
head.push(t.muted(`f filtro: ${this.actorFilter} · Esc team`));
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
let body = [];
|
|
110
|
+
const selected = this.detailId ? this.store.get(this.detailId) : undefined;
|
|
111
|
+
if (this.detailId && !selected) {
|
|
112
|
+
this.detailId = undefined;
|
|
113
|
+
this.offset = 0;
|
|
114
|
+
}
|
|
115
|
+
if (selected) {
|
|
116
|
+
const actor = selected.actor !== "Talos" && selected.actor !== selected.title ? ` [${selected.actor}]` : "";
|
|
117
|
+
head.push(stateMark(selected.state, t) + " " + t.bold(selected.title) + t.muted(actor + " · " + STATE_LABELS[selected.state]) +
|
|
118
|
+
(h < 16 ? t.muted(" · " + oneLine(selected.target)) : ""));
|
|
119
|
+
if (h >= 16)
|
|
120
|
+
head.push(...wrapText(oneLine(selected.target), w).slice(0, 2).map(t.muted));
|
|
121
|
+
const sections = detailTabs(selected).map(tab => tab === this.detailTab ? t.accent(`[${DETAIL_LABELS[tab]}]`) : t.muted(DETAIL_LABELS[tab])).join(" ");
|
|
122
|
+
head.push(terminalWidth(sections) <= w ? sections : t.accent(`[${DETAIL_LABELS[this.detailTab]}]`) + t.dim(" · Tab"));
|
|
123
|
+
const cache = this.detailCache;
|
|
124
|
+
if (!cache || cache.entry !== selected || cache.tab !== this.detailTab || cache.width !== w || cache.theme !== t) {
|
|
125
|
+
this.detailCache = { entry: selected, tab: this.detailTab, width: w, theme: t, lines: detailLines(selected, this.detailTab, w, t) };
|
|
126
|
+
}
|
|
127
|
+
body = this.detailCache.lines;
|
|
128
|
+
}
|
|
129
|
+
else if (this.tab === 0) {
|
|
130
|
+
body = overview(this.store, this.context(), w, t, this.expandedOverview);
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
const entries = this.entries();
|
|
134
|
+
let index = entries.findIndex(e => e.id === this.selectedId);
|
|
135
|
+
if (index < 0) {
|
|
136
|
+
index = 0;
|
|
137
|
+
this.selectedId = entries[0]?.id;
|
|
138
|
+
}
|
|
139
|
+
if (this.tab === 3 && !this.actor && entries[index]) {
|
|
140
|
+
const info = entries[index].output?.split("\n") ?? [];
|
|
141
|
+
head.push(t.muted(oneLine(info[0] ?? "")));
|
|
142
|
+
head.push(t.muted(oneLine(info[4] ?? "")));
|
|
143
|
+
}
|
|
144
|
+
if (this.query || this.searching)
|
|
145
|
+
head.push(t.accent(`Cerca: ${this.query}${this.searching ? "▏" : ""}`) + t.dim(` · ${entries.length} risultati`));
|
|
146
|
+
if (h >= 16 && entries[index] && !(this.tab === 3 && !this.actor)) {
|
|
147
|
+
const entry = entries[index];
|
|
148
|
+
head.push(t.bold(entry.title) + t.muted(` · ${STATE_LABELS[entry.state]}`));
|
|
149
|
+
head.push(...wrapText(oneLine(entry.target) || entry.title, w).slice(0, 2).map(t.muted));
|
|
150
|
+
}
|
|
151
|
+
this.pageSize = Math.max(1, h - head.length - 1);
|
|
152
|
+
this.listOffset = Math.min(this.listOffset, Math.max(0, entries.length - this.pageSize));
|
|
153
|
+
if (index < this.listOffset)
|
|
154
|
+
this.listOffset = index;
|
|
155
|
+
if (index >= this.listOffset + this.pageSize)
|
|
156
|
+
this.listOffset = index - this.pageSize + 1;
|
|
157
|
+
body = entries.slice(this.listOffset, this.listOffset + this.pageSize).flatMap(entry => entryRows(entry, entry.id === this.selectedId, w, t));
|
|
158
|
+
if (!entries.length) {
|
|
159
|
+
const empty = this.query ? "Nessun risultato. Premi / per cambiare ricerca o Esc per azzerarla."
|
|
160
|
+
: this.tab === 4 ? "Nessun problema registrato."
|
|
161
|
+
: this.tab === 2 ? "Nessuna modifica registrata. I confronti compariranno qui dopo le modifiche ai file."
|
|
162
|
+
: this.actor ? "Nessuna attività per questo filtro. Premi f per cambiare filtro o Esc per tornare al team."
|
|
163
|
+
: this.tab === 3 ? "Nessun collaboratore registrato."
|
|
164
|
+
: "Nessuna attività registrata. Le operazioni compariranno qui durante il lavoro.";
|
|
165
|
+
body = wrapText(empty, w).map(t.muted);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
const available = Math.max(1, h - head.length - 1);
|
|
169
|
+
if (selected || this.tab === 0)
|
|
170
|
+
this.pageSize = available;
|
|
171
|
+
this.maxOffset = Math.max(0, body.length - available);
|
|
172
|
+
this.offset = Math.min(this.offset, this.maxOffset);
|
|
173
|
+
const visible = body.slice(this.offset, this.offset + available);
|
|
174
|
+
const range = selected || this.tab === 0
|
|
175
|
+
? `${body.length ? this.offset + 1 : 0}–${Math.min(this.offset + available, body.length)}/${body.length}`
|
|
176
|
+
: `${this.entries().length ? this.listOffset + 1 : 0}–${Math.min(this.listOffset + this.pageSize, this.entries().length)}/${this.entries().length}`;
|
|
177
|
+
const retention = this.store.evicted ? ` · ${this.store.evicted} esclusi` : "";
|
|
178
|
+
const hint = this.searching ? "Invio conferma · Esc cancella ricerca"
|
|
179
|
+
: selected ? "Esc elenco · Tab dettaglio · ↑↓ scorri"
|
|
180
|
+
: this.tab === 0 ? `Invio: ${reviewNextStep(this.store).label.toLocaleLowerCase()} · i ${this.expandedOverview ? "riduci" : "dettagli"} · Esc chat`
|
|
181
|
+
: this.actor ? "Esc team · Invio apri · f filtro · / cerca"
|
|
182
|
+
: this.tab === 3 ? "Esc chat · Invio agente · / cerca"
|
|
183
|
+
: this.tab === 2 ? `↑↓ seleziona · Invio ${this.file ? "confronto" : "file"} · / cerca · Esc ${this.query ? "azzera" : this.file ? "file" : "chat"}`
|
|
184
|
+
: `↑↓ seleziona · Invio apri · / cerca · Esc ${this.query ? "azzera" : "chat"}`;
|
|
185
|
+
const back = this.searching ? "Esc annulla" : selected ? "Esc elenco" : this.query ? "Esc azzera" : this.actor ? "Esc team" : this.file ? "Esc file" : "Esc chat";
|
|
186
|
+
const compactHint = this.searching ? "Invio cerca · Esc annulla" : selected ? "Esc elenco · Tab · ↑↓"
|
|
187
|
+
: this.tab === 0 ? "Invio apri · i dettagli · Esc chat" : `↑↓ · Invio apri · / cerca · ${back}`;
|
|
188
|
+
const footer = [t.dim(terminalWidth(hint + " " + range + retention) <= w
|
|
189
|
+
? hint + " " + range + retention : terminalWidth(compactHint) <= w ? compactHint : back)];
|
|
190
|
+
const rows = [...head, ...visible, ...Array.from({ length: Math.max(0, h - head.length - visible.length - footer.length) }, () => ""), ...footer];
|
|
191
|
+
// Nei terminali molto bassi conserviamo sempre la via d'uscita.
|
|
192
|
+
const fitted = rows.length > h ? [...rows.slice(0, Math.max(0, h - 1)), footer[0]] : rows;
|
|
193
|
+
return fitted.map(line => fitLine(margin + fitLine(line, w), Math.max(1, width - 1)));
|
|
194
|
+
}
|
|
195
|
+
key(text, key) {
|
|
196
|
+
if (key.ctrl && (key.name === "r" || key.name === "c" || key.name === "o"))
|
|
197
|
+
return "close";
|
|
198
|
+
if (text === "i" && !key.ctrl && !key.meta && this.tab === 0 && !this.detailId) {
|
|
199
|
+
this.expandedOverview = !this.expandedOverview;
|
|
200
|
+
this.offset = 0;
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
if (this.searching) {
|
|
204
|
+
if (key.name === "escape") {
|
|
205
|
+
this.searching = false;
|
|
206
|
+
this.query = "";
|
|
207
|
+
}
|
|
208
|
+
else if (key.name === "return" || key.name === "enter")
|
|
209
|
+
this.searching = false;
|
|
210
|
+
else if (key.name === "backspace")
|
|
211
|
+
this.query = Array.from(this.query).slice(0, -1).join("");
|
|
212
|
+
else if (text && !key.ctrl && !key.meta)
|
|
213
|
+
this.query += text.replace(/[\x00-\x1f\x7f]/g, "");
|
|
214
|
+
this.selectedId = undefined;
|
|
215
|
+
this.listOffset = 0;
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
if (key.name === "escape" || key.name === "backspace") {
|
|
219
|
+
if (this.detailId) {
|
|
220
|
+
this.detailId = undefined;
|
|
221
|
+
this.offset = 0;
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
if (this.query) {
|
|
225
|
+
this.query = "";
|
|
226
|
+
this.listOffset = 0;
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
if (this.actor) {
|
|
230
|
+
this.backToTeam();
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
if (this.file) {
|
|
234
|
+
this.backToFiles();
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
return "close";
|
|
238
|
+
}
|
|
239
|
+
if (this.tab === 0 && !this.detailId && (key.name === "return" || key.name === "enter")) {
|
|
240
|
+
this.tab = reviewNextStep(this.store).tab;
|
|
241
|
+
this.selectedId = undefined;
|
|
242
|
+
this.offset = 0;
|
|
243
|
+
this.listOffset = 0;
|
|
244
|
+
this.resetMatching();
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
if (this.detailId && (key.name === "tab" || key.name === "left" || key.name === "right")) {
|
|
248
|
+
const e = this.store.get(this.detailId);
|
|
249
|
+
if (!e)
|
|
250
|
+
return;
|
|
251
|
+
const tabs = detailTabs(e);
|
|
252
|
+
const step = key.shift || key.name === "left" ? -1 : 1;
|
|
253
|
+
this.detailTab = tabs[(tabs.indexOf(this.detailTab) + step + tabs.length) % tabs.length];
|
|
254
|
+
this.offset = 0;
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
if (text === "f" && this.actor && !this.detailId) {
|
|
258
|
+
const filters = ["tutti", "attivi", "problemi", "file"];
|
|
259
|
+
this.actorFilter = filters[(filters.indexOf(this.actorFilter) + 1) % filters.length];
|
|
260
|
+
this.selectedId = undefined;
|
|
261
|
+
this.listOffset = 0;
|
|
262
|
+
this.resetMatching();
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
if (/^[1-5]$/.test(text) || (!this.detailId && ["tab", "left", "right"].includes(key.name ?? ""))) {
|
|
266
|
+
this.actor = undefined;
|
|
267
|
+
this.actorFilter = "tutti";
|
|
268
|
+
this.file = undefined;
|
|
269
|
+
this.resetMatching();
|
|
270
|
+
this.tab = /^[1-5]$/.test(text) ? Number(text) - 1 : (this.tab + (key.shift || key.name === "left" ? 4 : 1)) % 5;
|
|
271
|
+
this.detailId = undefined;
|
|
272
|
+
this.selectedId = undefined;
|
|
273
|
+
this.offset = 0;
|
|
274
|
+
this.listOffset = 0;
|
|
275
|
+
this.query = "";
|
|
276
|
+
return;
|
|
277
|
+
}
|
|
278
|
+
if (text === "/" && this.tab !== 0 && !this.detailId) {
|
|
279
|
+
this.searching = true;
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
if ((key.name === "return" || key.name === "enter") && this.selectedId && !this.detailId) {
|
|
283
|
+
if (this.tab === 2 && !this.file) {
|
|
284
|
+
const entry = this.entries().find(e => e.id === this.selectedId);
|
|
285
|
+
if (!entry)
|
|
286
|
+
return;
|
|
287
|
+
const changes = fileChanges(this.store, entry.target);
|
|
288
|
+
if (changes.length === 1) {
|
|
289
|
+
this.detailId = changes[0].id;
|
|
290
|
+
this.detailTab = changes[0].change ? "diff" : "output";
|
|
291
|
+
}
|
|
292
|
+
else {
|
|
293
|
+
this.filePosition = { selectedId: this.selectedId, query: this.query, listOffset: this.listOffset };
|
|
294
|
+
this.file = entry.target;
|
|
295
|
+
this.query = "";
|
|
296
|
+
this.selectedId = changes.at(-1)?.id;
|
|
297
|
+
this.listOffset = 0;
|
|
298
|
+
this.resetMatching();
|
|
299
|
+
}
|
|
300
|
+
this.offset = 0;
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
if (this.tab === 3 && !this.actor) {
|
|
304
|
+
const entry = this.entries().find(e => e.id === this.selectedId);
|
|
305
|
+
if (!entry)
|
|
306
|
+
return;
|
|
307
|
+
this.teamPosition = { selectedId: this.selectedId, query: this.query, listOffset: this.listOffset };
|
|
308
|
+
this.actor = entry.actor;
|
|
309
|
+
this.query = "";
|
|
310
|
+
this.selectedId = undefined;
|
|
311
|
+
this.listOffset = 0;
|
|
312
|
+
this.offset = 0;
|
|
313
|
+
this.resetMatching();
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
this.detailId = this.selectedId;
|
|
317
|
+
this.detailTab = this.tab === 2 && this.store.get(this.detailId)?.change ? "diff" : "output";
|
|
318
|
+
this.offset = 0;
|
|
319
|
+
return;
|
|
320
|
+
}
|
|
321
|
+
const step = key.name === "pageup" ? -this.pageSize : key.name === "pagedown" ? this.pageSize
|
|
322
|
+
: key.name === "up" ? -1 : key.name === "down" ? 1 : key.name === "home" ? -Infinity : key.name === "end" ? Infinity : 0;
|
|
323
|
+
if (step)
|
|
324
|
+
this.scroll(step);
|
|
325
|
+
}
|
|
326
|
+
scroll(delta) {
|
|
327
|
+
if (this.detailId || this.tab === 0) {
|
|
328
|
+
this.offset = Math.max(0, Math.min(this.maxOffset, this.offset + delta));
|
|
329
|
+
return;
|
|
330
|
+
}
|
|
331
|
+
const entries = this.entries();
|
|
332
|
+
const i = Math.max(0, entries.findIndex(e => e.id === this.selectedId));
|
|
333
|
+
this.selectedId = entries[Math.max(0, Math.min(entries.length - 1, i + delta))]?.id;
|
|
334
|
+
}
|
|
335
|
+
paste(text) {
|
|
336
|
+
if (this.searching) {
|
|
337
|
+
this.query += oneLine(text);
|
|
338
|
+
this.selectedId = undefined;
|
|
339
|
+
this.listOffset = 0;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
// Fallback leggibile su pipe/readline: nessuna scorciatoia interattiva finta.
|
|
344
|
+
export function reviewText(store, context, theme, width, section = "") {
|
|
345
|
+
const entry = store.get(section);
|
|
346
|
+
if (entry)
|
|
347
|
+
return `\n${entry.title} · ${oneLine(entry.target)}\n` + detailLines(entry, "output", width - 4, theme).join("\n") + "\n";
|
|
348
|
+
const actor = section.startsWith("team ") ? section.slice(5) : undefined;
|
|
349
|
+
const tab = actor ? 3 : reviewSection(section);
|
|
350
|
+
if (tab === 3 && !actor)
|
|
351
|
+
return "\n" + (teamEntries(store).map(e => `${stateMark(e.state, theme)} ${oneLine(e.target)}\n${e.output}\n/review team ${e.actor}`).join("\n\n") || "Nessun collaboratore registrato.") + "\n";
|
|
352
|
+
if (actor)
|
|
353
|
+
return "\n" + store.entries().filter(e => e.actor === actor).map(e => `${stateMark(e.state, theme)} ${e.title} · ${oneLine(e.target)}\n/review ${e.id}`).join("\n") + "\n";
|
|
354
|
+
if (tab === 0)
|
|
355
|
+
return "\n" + overview(store, context, width - 4, theme, true).join("\n") + "\n/review attivita · /review modifiche · /review team · /review problemi\n";
|
|
356
|
+
const entries = store.entries().filter(e => tab === 2 ? e.change || e.kind === "file" : tab === 3 ? e.actor !== "Talos" || e.kind === "team" : tab === 4 ? e.state === "error" || e.state === "stopped" : true);
|
|
357
|
+
return "\n" + (entries.length ? entries.map(e => `${stateMark(e.state, theme)} ${e.title} · ${oneLine(e.target)}\n /review ${e.id}`).join("\n") : "Nessun elemento registrato.") + "\n";
|
|
358
|
+
}
|