@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
package/dist/tui/logo.js
ADDED
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
+
import { dirname, join } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
const DEFAULT_LOGO = {
|
|
5
|
+
columns: 28,
|
|
6
|
+
rows: 14,
|
|
7
|
+
samples: 4,
|
|
8
|
+
ansi: true,
|
|
9
|
+
};
|
|
10
|
+
const cachedLogos = new Map();
|
|
11
|
+
export function renderVascendTerminalLogo(options = {}) {
|
|
12
|
+
const cfg = { ...DEFAULT_LOGO, ...options };
|
|
13
|
+
const key = `${cfg.columns}:${cfg.rows}:${cfg.samples}:${cfg.ansi ? 1 : 0}`;
|
|
14
|
+
const cached = cachedLogos.get(key);
|
|
15
|
+
if (cached)
|
|
16
|
+
return cached;
|
|
17
|
+
const rendered = renderBlockLogo(readVascendTerminalSvg(), cfg);
|
|
18
|
+
cachedLogos.set(key, rendered);
|
|
19
|
+
return rendered;
|
|
20
|
+
}
|
|
21
|
+
export function renderBlockLogo(svg, options = {}) {
|
|
22
|
+
const paths = extractPaths(svg);
|
|
23
|
+
const transform = extractTransform(svg);
|
|
24
|
+
const polygons = paths.flatMap((path) => parsePath(path, transform));
|
|
25
|
+
const box = extractViewBox(svg) ?? bounds(polygons);
|
|
26
|
+
if (!box)
|
|
27
|
+
return [];
|
|
28
|
+
return renderPolygons(polygons, box, {
|
|
29
|
+
columns: options.columns ?? 28,
|
|
30
|
+
rows: options.rows ?? 14,
|
|
31
|
+
samples: options.samples ?? 4,
|
|
32
|
+
ansi: options.ansi ?? false,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
function readVascendTerminalSvg() {
|
|
36
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
37
|
+
const candidates = [
|
|
38
|
+
join(here, "..", "..", "..", "vascend-terminal", "assets", "logo.svg"),
|
|
39
|
+
join(process.cwd(), "..", "vascend-terminal", "assets", "logo.svg"),
|
|
40
|
+
join(process.cwd(), "vascend-terminal", "assets", "logo.svg"),
|
|
41
|
+
];
|
|
42
|
+
const path = candidates.find((candidate) => existsSync(candidate));
|
|
43
|
+
if (!path)
|
|
44
|
+
return "";
|
|
45
|
+
return readFileSync(path, "utf8");
|
|
46
|
+
}
|
|
47
|
+
function extractPaths(svg) {
|
|
48
|
+
return [...svg.matchAll(/<path\b[^>]*\bd="([^"]+)"/g)]
|
|
49
|
+
.map((match) => match[1]?.replace(/\s+/g, " ").trim() ?? "")
|
|
50
|
+
.filter(Boolean);
|
|
51
|
+
}
|
|
52
|
+
// I gruppi possono essere ANNIDATI (il logo Vascend Terminal ha un <g> esterno
|
|
53
|
+
// translate+scale e uno interno con scale(0.1,-0.1)): considerare solo il primo
|
|
54
|
+
// lasciava i poligoni fuori dal viewBox e il logo usciva VUOTO. Le trasformazioni
|
|
55
|
+
// affini translate+scale si compongono in ordine di documento:
|
|
56
|
+
// p' = t1 + s1 * (t2 + s2 * p) = (t1 + s1*t2) + (s1*s2) * p.
|
|
57
|
+
function extractTransform(svg) {
|
|
58
|
+
const groups = [...svg.matchAll(/<g\b[^>]*\btransform="([^"]+)"/g)].map((match) => match[1] ?? "");
|
|
59
|
+
return groups.reduce((outer, raw) => {
|
|
60
|
+
const translate = /translate\(([-+0-9.eE]+)[,\s]+([-+0-9.eE]+)\)/.exec(raw);
|
|
61
|
+
const scale = /scale\(([-+0-9.eE]+)(?:[,\s]+([-+0-9.eE]+))?\)/.exec(raw);
|
|
62
|
+
const inner = {
|
|
63
|
+
tx: Number(translate?.[1] ?? 0),
|
|
64
|
+
ty: Number(translate?.[2] ?? 0),
|
|
65
|
+
sx: Number(scale?.[1] ?? 1),
|
|
66
|
+
sy: Number(scale?.[2] ?? scale?.[1] ?? 1),
|
|
67
|
+
};
|
|
68
|
+
return {
|
|
69
|
+
tx: outer.tx + outer.sx * inner.tx,
|
|
70
|
+
ty: outer.ty + outer.sy * inner.ty,
|
|
71
|
+
sx: outer.sx * inner.sx,
|
|
72
|
+
sy: outer.sy * inner.sy,
|
|
73
|
+
};
|
|
74
|
+
}, { tx: 0, ty: 0, sx: 1, sy: 1 });
|
|
75
|
+
}
|
|
76
|
+
function extractViewBox(svg) {
|
|
77
|
+
const match = /\bviewBox="([-+0-9.eE]+)\s+([-+0-9.eE]+)\s+([-+0-9.eE]+)\s+([-+0-9.eE]+)"/.exec(svg);
|
|
78
|
+
if (!match)
|
|
79
|
+
return null;
|
|
80
|
+
const minX = Number(match[1]);
|
|
81
|
+
const minY = Number(match[2]);
|
|
82
|
+
const width = Number(match[3]);
|
|
83
|
+
const height = Number(match[4]);
|
|
84
|
+
if (![minX, minY, width, height].every(Number.isFinite) || width <= 0 || height <= 0)
|
|
85
|
+
return null;
|
|
86
|
+
return { minX, minY, maxX: minX + width, maxY: minY + height };
|
|
87
|
+
}
|
|
88
|
+
function parsePath(path, transform) {
|
|
89
|
+
const tokens = path.match(/[a-zA-Z]|[-+]?(?:\d*\.\d+|\d+)(?:e[-+]?\d+)?/g) ?? [];
|
|
90
|
+
const polygons = [];
|
|
91
|
+
let polygon = [];
|
|
92
|
+
let index = 0;
|
|
93
|
+
let command = "";
|
|
94
|
+
let current = { x: 0, y: 0 };
|
|
95
|
+
let start = current;
|
|
96
|
+
const add = (point) => {
|
|
97
|
+
polygon.push(applyTransform(point, transform));
|
|
98
|
+
};
|
|
99
|
+
const close = () => {
|
|
100
|
+
if (polygon.length > 0)
|
|
101
|
+
polygons.push(polygon);
|
|
102
|
+
polygon = [];
|
|
103
|
+
};
|
|
104
|
+
const nextNumber = () => {
|
|
105
|
+
const token = tokens[index];
|
|
106
|
+
if (token === undefined || isCommand(token))
|
|
107
|
+
throw new Error(`path SVG non valido vicino a ${index}`);
|
|
108
|
+
index += 1;
|
|
109
|
+
return Number(token);
|
|
110
|
+
};
|
|
111
|
+
while (index < tokens.length) {
|
|
112
|
+
const token = tokens[index];
|
|
113
|
+
if (token === undefined)
|
|
114
|
+
break;
|
|
115
|
+
if (isCommand(token)) {
|
|
116
|
+
command = token;
|
|
117
|
+
index += 1;
|
|
118
|
+
}
|
|
119
|
+
switch (command) {
|
|
120
|
+
case "M":
|
|
121
|
+
case "m": {
|
|
122
|
+
const relative = command === "m";
|
|
123
|
+
current = point(nextNumber(), nextNumber(), relative ? current : undefined);
|
|
124
|
+
start = current;
|
|
125
|
+
add(current);
|
|
126
|
+
command = relative ? "l" : "L";
|
|
127
|
+
break;
|
|
128
|
+
}
|
|
129
|
+
case "L":
|
|
130
|
+
case "l": {
|
|
131
|
+
const relative = command === "l";
|
|
132
|
+
while (hasNumber(tokens, index)) {
|
|
133
|
+
current = point(nextNumber(), nextNumber(), relative ? current : undefined);
|
|
134
|
+
add(current);
|
|
135
|
+
}
|
|
136
|
+
break;
|
|
137
|
+
}
|
|
138
|
+
case "C":
|
|
139
|
+
case "c": {
|
|
140
|
+
const relative = command === "c";
|
|
141
|
+
while (hasNumber(tokens, index)) {
|
|
142
|
+
const p0 = current;
|
|
143
|
+
const p1 = point(nextNumber(), nextNumber(), relative ? current : undefined);
|
|
144
|
+
const p2 = point(nextNumber(), nextNumber(), relative ? current : undefined);
|
|
145
|
+
const p3 = point(nextNumber(), nextNumber(), relative ? current : undefined);
|
|
146
|
+
for (let step = 1; step <= 24; step += 1) {
|
|
147
|
+
add(cubic(p0, p1, p2, p3, step / 24));
|
|
148
|
+
}
|
|
149
|
+
current = p3;
|
|
150
|
+
}
|
|
151
|
+
break;
|
|
152
|
+
}
|
|
153
|
+
case "Z":
|
|
154
|
+
case "z":
|
|
155
|
+
current = start;
|
|
156
|
+
close();
|
|
157
|
+
break;
|
|
158
|
+
default:
|
|
159
|
+
throw new Error(`comando SVG non supportato: ${command}`);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
close();
|
|
163
|
+
return polygons;
|
|
164
|
+
}
|
|
165
|
+
function isCommand(token) {
|
|
166
|
+
return /^[a-zA-Z]$/.test(token);
|
|
167
|
+
}
|
|
168
|
+
function hasNumber(tokens, index) {
|
|
169
|
+
const token = tokens[index];
|
|
170
|
+
return token !== undefined && !isCommand(token);
|
|
171
|
+
}
|
|
172
|
+
function point(x, y, relativeTo) {
|
|
173
|
+
return relativeTo ? { x: relativeTo.x + x, y: relativeTo.y + y } : { x, y };
|
|
174
|
+
}
|
|
175
|
+
function applyTransform(point, transform) {
|
|
176
|
+
return {
|
|
177
|
+
x: transform.tx + point.x * transform.sx,
|
|
178
|
+
y: transform.ty + point.y * transform.sy,
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
function cubic(p0, p1, p2, p3, t) {
|
|
182
|
+
const mt = 1 - t;
|
|
183
|
+
return {
|
|
184
|
+
x: mt ** 3 * p0.x + 3 * mt ** 2 * t * p1.x + 3 * mt * t ** 2 * p2.x + t ** 3 * p3.x,
|
|
185
|
+
y: mt ** 3 * p0.y + 3 * mt ** 2 * t * p1.y + 3 * mt * t ** 2 * p2.y + t ** 3 * p3.y,
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
function bounds(polygons) {
|
|
189
|
+
const first = polygons[0]?.[0];
|
|
190
|
+
if (!first)
|
|
191
|
+
return null;
|
|
192
|
+
return polygons.reduce((box, polygon) => {
|
|
193
|
+
return polygon.reduce((acc, p) => ({
|
|
194
|
+
minX: Math.min(acc.minX, p.x),
|
|
195
|
+
minY: Math.min(acc.minY, p.y),
|
|
196
|
+
maxX: Math.max(acc.maxX, p.x),
|
|
197
|
+
maxY: Math.max(acc.maxY, p.y),
|
|
198
|
+
}), box);
|
|
199
|
+
}, { minX: first.x, minY: first.y, maxX: first.x, maxY: first.y });
|
|
200
|
+
}
|
|
201
|
+
function renderPolygons(polygons, box, options) {
|
|
202
|
+
const minX = box.minX;
|
|
203
|
+
const maxX = box.maxX;
|
|
204
|
+
const minY = box.minY;
|
|
205
|
+
const maxY = box.maxY;
|
|
206
|
+
const lines = [];
|
|
207
|
+
for (let row = 0; row < options.rows; row += 1) {
|
|
208
|
+
const cells = [];
|
|
209
|
+
let lastActive = -1;
|
|
210
|
+
for (let col = 0; col < options.columns; col += 1) {
|
|
211
|
+
const x0 = minX + (col / options.columns) * (maxX - minX);
|
|
212
|
+
const x1 = minX + ((col + 1) / options.columns) * (maxX - minX);
|
|
213
|
+
const y0 = minY + (row / options.rows) * (maxY - minY);
|
|
214
|
+
const yMid = minY + ((row + 0.5) / options.rows) * (maxY - minY);
|
|
215
|
+
const y1 = minY + ((row + 1) / options.rows) * (maxY - minY);
|
|
216
|
+
const top = coverage(polygons, x0, x1, y0, yMid, options.samples);
|
|
217
|
+
const bottom = coverage(polygons, x0, x1, yMid, y1, options.samples);
|
|
218
|
+
const cell = block(top, bottom, options.ansi);
|
|
219
|
+
cells.push(cell.text);
|
|
220
|
+
if (cell.active)
|
|
221
|
+
lastActive = col;
|
|
222
|
+
}
|
|
223
|
+
lines.push(cells.slice(0, lastActive + 1).join(""));
|
|
224
|
+
}
|
|
225
|
+
return trimEmpty(lines);
|
|
226
|
+
}
|
|
227
|
+
function coverage(polygons, x0, x1, y0, y1, samples) {
|
|
228
|
+
let hits = 0;
|
|
229
|
+
const total = samples * samples;
|
|
230
|
+
for (let y = 0; y < samples; y += 1) {
|
|
231
|
+
for (let x = 0; x < samples; x += 1) {
|
|
232
|
+
const px = x0 + ((x + 0.5) / samples) * (x1 - x0);
|
|
233
|
+
const py = y0 + ((y + 0.5) / samples) * (y1 - y0);
|
|
234
|
+
if (insideAny(polygons, px, py))
|
|
235
|
+
hits += 1;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
return hits / total;
|
|
239
|
+
}
|
|
240
|
+
function block(topCoverage, bottomCoverage, ansi) {
|
|
241
|
+
const top = shade(topCoverage);
|
|
242
|
+
const bottom = shade(bottomCoverage);
|
|
243
|
+
if (top === 0 && bottom === 0)
|
|
244
|
+
return { text: " ", active: false };
|
|
245
|
+
if (!ansi)
|
|
246
|
+
return { text: plainBlock(top, bottom), active: true };
|
|
247
|
+
if (top > 0 && bottom > 0) {
|
|
248
|
+
return {
|
|
249
|
+
text: `\x1b[38;2;${top};${top};${top};48;2;${bottom};${bottom};${bottom}m▀\x1b[0m`,
|
|
250
|
+
active: true,
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
if (top > 0)
|
|
254
|
+
return { text: `${fg(top)}▀\x1b[0m`, active: true };
|
|
255
|
+
return { text: `${fg(bottom)}▄\x1b[0m`, active: true };
|
|
256
|
+
}
|
|
257
|
+
function plainBlock(top, bottom) {
|
|
258
|
+
if (top > 0 && bottom > 0)
|
|
259
|
+
return "█";
|
|
260
|
+
if (top > 0)
|
|
261
|
+
return "▀";
|
|
262
|
+
return "▄";
|
|
263
|
+
}
|
|
264
|
+
function shade(coverageValue) {
|
|
265
|
+
if (coverageValue < 0.18)
|
|
266
|
+
return 0;
|
|
267
|
+
if (coverageValue < 0.35)
|
|
268
|
+
return 96;
|
|
269
|
+
if (coverageValue < 0.58)
|
|
270
|
+
return 160;
|
|
271
|
+
if (coverageValue < 0.82)
|
|
272
|
+
return 220;
|
|
273
|
+
return 255;
|
|
274
|
+
}
|
|
275
|
+
function fg(value) {
|
|
276
|
+
return `\x1b[38;2;${value};${value};${value}m`;
|
|
277
|
+
}
|
|
278
|
+
function insideAny(polygons, x, y) {
|
|
279
|
+
return polygons.some((polygon) => insidePolygon(polygon, x, y));
|
|
280
|
+
}
|
|
281
|
+
function insidePolygon(polygon, x, y) {
|
|
282
|
+
let inside = false;
|
|
283
|
+
let previousIndex = polygon.length - 1;
|
|
284
|
+
for (let currentIndex = 0; currentIndex < polygon.length; currentIndex += 1) {
|
|
285
|
+
const current = polygon[currentIndex];
|
|
286
|
+
const previous = polygon[previousIndex];
|
|
287
|
+
if (current && previous) {
|
|
288
|
+
const crosses = current.y > y !== previous.y > y;
|
|
289
|
+
const atX = ((previous.x - current.x) * (y - current.y)) / (previous.y - current.y) + current.x;
|
|
290
|
+
if (crosses && x < atX)
|
|
291
|
+
inside = !inside;
|
|
292
|
+
}
|
|
293
|
+
previousIndex = currentIndex;
|
|
294
|
+
}
|
|
295
|
+
return inside;
|
|
296
|
+
}
|
|
297
|
+
function trimEmpty(lines) {
|
|
298
|
+
let start = 0;
|
|
299
|
+
let end = lines.length;
|
|
300
|
+
while (start < end && !lines[start]?.trim())
|
|
301
|
+
start += 1;
|
|
302
|
+
while (end > start && !lines[end - 1]?.trim())
|
|
303
|
+
end -= 1;
|
|
304
|
+
return lines.slice(start, end);
|
|
305
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { resolve } from "node:path";
|
|
2
|
+
import { pathToFileURL } from "node:url";
|
|
3
|
+
import { plainText, terminalWidth } from "./terminal-text.js";
|
|
4
|
+
const token = /\\([\\`*_{}\[\]()#+\-.!|>~])|(`+)([\s\S]*?)\2|\*\*(.+?)\*\*|__(.+?)__|\[([^\]]+)\]\((<[^>]+>|(?:[^\s()]|\([^()]*\))+)\)|\*([^*]+)\*|_([^_]+)_|~~(.+?)~~/g;
|
|
5
|
+
function linkTarget(value) {
|
|
6
|
+
const target = value.replace(/^<|>$/g, "");
|
|
7
|
+
if (/^(https?:|mailto:)/i.test(target))
|
|
8
|
+
return target;
|
|
9
|
+
if (/^[a-z][a-z0-9+.-]*:/i.test(target) && !/^[a-z]:[\\/]/i.test(target))
|
|
10
|
+
return undefined;
|
|
11
|
+
return pathToFileURL(resolve(target)).href;
|
|
12
|
+
}
|
|
13
|
+
function spans(text, style = {}) {
|
|
14
|
+
const out = [];
|
|
15
|
+
let offset = 0;
|
|
16
|
+
// Each recursive call owns its regex cursor.
|
|
17
|
+
for (const match of text.matchAll(new RegExp(token))) {
|
|
18
|
+
if (match.index > offset)
|
|
19
|
+
out.push({ ...style, text: text.slice(offset, match.index) });
|
|
20
|
+
if (match[1])
|
|
21
|
+
out.push({ ...style, text: match[1] });
|
|
22
|
+
else if (match[2])
|
|
23
|
+
out.push({ ...style, text: match[3], code: true });
|
|
24
|
+
else if (match[4] || match[5])
|
|
25
|
+
out.push(...spans(match[4] ?? match[5], { ...style, bold: true }));
|
|
26
|
+
else if (match[6])
|
|
27
|
+
out.push(...spans(match[6], { ...style, href: linkTarget(match[7]) }));
|
|
28
|
+
else if (match[8] || match[9])
|
|
29
|
+
out.push(...spans(match[8] ?? match[9], { ...style, italic: true }));
|
|
30
|
+
else
|
|
31
|
+
out.push(...spans(match[10], { ...style, strike: true }));
|
|
32
|
+
offset = match.index + match[0].length;
|
|
33
|
+
}
|
|
34
|
+
if (offset < text.length)
|
|
35
|
+
out.push({ ...style, text: text.slice(offset) });
|
|
36
|
+
return out;
|
|
37
|
+
}
|
|
38
|
+
function paint(span, text, theme, textStyle) {
|
|
39
|
+
let out = span.href ? (theme.markdownLink ?? theme.accent)(text)
|
|
40
|
+
: span.code ? (theme.markdownCode ?? theme.accent)(text) : textStyle(text);
|
|
41
|
+
if (span.bold)
|
|
42
|
+
out = theme.bold(out);
|
|
43
|
+
if (span.italic)
|
|
44
|
+
out = `\x1b[3m${out}\x1b[23m`;
|
|
45
|
+
if (span.strike)
|
|
46
|
+
out = `\x1b[9m${out}\x1b[29m`;
|
|
47
|
+
if (span.href)
|
|
48
|
+
out = `\x1b]8;;${span.href}\x1b\\${out}\x1b]8;;\x1b\\`;
|
|
49
|
+
return out;
|
|
50
|
+
}
|
|
51
|
+
export function inlineText(text) { return spans(plainText(text)).map(span => span.text).join(""); }
|
|
52
|
+
// Wrap rendered text, not Markdown delimiters. Every line closes its styles
|
|
53
|
+
// and links, including when a long bold phrase or a link spans several rows.
|
|
54
|
+
export function wrapInline(text, width, theme, hangingIndent = 0, textStyle = theme.silver) {
|
|
55
|
+
const parts = spans(plainText(text));
|
|
56
|
+
const content = parts.map(span => span.text).join("");
|
|
57
|
+
if (!content)
|
|
58
|
+
return [""];
|
|
59
|
+
const graphemes = new Intl.Segmenter(undefined, { granularity: "grapheme" });
|
|
60
|
+
const out = [];
|
|
61
|
+
let start = 0;
|
|
62
|
+
while (start < content.length) {
|
|
63
|
+
const indent = out.length ? Math.min(hangingIndent, Math.max(0, width - 2)) : 0;
|
|
64
|
+
const available = Math.max(2, width - indent);
|
|
65
|
+
let end = start;
|
|
66
|
+
let cells = 0;
|
|
67
|
+
let space = -1;
|
|
68
|
+
for (const { segment } of graphemes.segment(content.slice(start))) {
|
|
69
|
+
const size = terminalWidth(segment);
|
|
70
|
+
if (cells + size > available)
|
|
71
|
+
break;
|
|
72
|
+
if (/\s/.test(segment))
|
|
73
|
+
space = end;
|
|
74
|
+
cells += size;
|
|
75
|
+
end += segment.length;
|
|
76
|
+
}
|
|
77
|
+
if (end < content.length && space > start)
|
|
78
|
+
end = space;
|
|
79
|
+
if (end === start)
|
|
80
|
+
end = start + 1;
|
|
81
|
+
const limit = start + content.slice(start, end).trimEnd().length;
|
|
82
|
+
let cursor = 0;
|
|
83
|
+
let row = " ".repeat(indent);
|
|
84
|
+
for (const part of parts) {
|
|
85
|
+
const a = Math.max(0, start - cursor);
|
|
86
|
+
const b = Math.min(part.text.length, limit - cursor);
|
|
87
|
+
if (b > a)
|
|
88
|
+
row += paint(part, part.text.slice(a, b), theme, textStyle);
|
|
89
|
+
cursor += part.text.length;
|
|
90
|
+
if (cursor >= limit)
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
out.push(row);
|
|
94
|
+
start = end;
|
|
95
|
+
while (content[start] === " ")
|
|
96
|
+
start++;
|
|
97
|
+
}
|
|
98
|
+
return out;
|
|
99
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { TuiTheme } from "./branding.js";
|
|
2
|
+
export declare function tableCells(line: string): string[];
|
|
3
|
+
export declare function isTableSeparator(line: string): boolean;
|
|
4
|
+
export declare function renderTable(header: readonly string[], separator: readonly string[], rows: readonly string[][], width: number, theme: TuiTheme): readonly string[];
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { inlineText, wrapInline } from "./markdown-inline.js";
|
|
2
|
+
import { terminalWidth } from "./terminal-text.js";
|
|
3
|
+
export function tableCells(line) {
|
|
4
|
+
const source = line.trim().replace(/^\|/, "").replace(/(?<!\\)\|$/, "");
|
|
5
|
+
const cells = [];
|
|
6
|
+
let cell = "";
|
|
7
|
+
let codeFence = "";
|
|
8
|
+
for (let i = 0; i < source.length; i++) {
|
|
9
|
+
const ch = source[i];
|
|
10
|
+
if (ch === "\\" && i + 1 < source.length) {
|
|
11
|
+
cell += ch + source[++i];
|
|
12
|
+
continue;
|
|
13
|
+
}
|
|
14
|
+
if (ch === "`") {
|
|
15
|
+
const run = /^`+/.exec(source.slice(i))[0];
|
|
16
|
+
codeFence = codeFence === run ? "" : codeFence || run;
|
|
17
|
+
cell += run;
|
|
18
|
+
i += run.length - 1;
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
if (ch === "|" && !codeFence) {
|
|
22
|
+
cells.push(cell.trim());
|
|
23
|
+
cell = "";
|
|
24
|
+
}
|
|
25
|
+
else
|
|
26
|
+
cell += ch;
|
|
27
|
+
}
|
|
28
|
+
cells.push(cell.trim());
|
|
29
|
+
return cells;
|
|
30
|
+
}
|
|
31
|
+
export function isTableSeparator(line) {
|
|
32
|
+
return line.includes("|") && tableCells(line).every(cell => /^:?-{3,}:?$/.test(cell));
|
|
33
|
+
}
|
|
34
|
+
export function renderTable(header, separator, rows, width, theme) {
|
|
35
|
+
const count = header.length;
|
|
36
|
+
const gap = 3;
|
|
37
|
+
if (width < count * 6 + (count - 1) * gap) {
|
|
38
|
+
return rows.flatMap((row, index) => [
|
|
39
|
+
...(index ? [""] : []),
|
|
40
|
+
...header.flatMap((label, col) => wrapInline(`**${label}**: ${row[col] ?? ""}`, width, theme)),
|
|
41
|
+
]);
|
|
42
|
+
}
|
|
43
|
+
const widths = header.map((label, col) => Math.max(3, terminalWidth(inlineText(label)), ...rows.map(row => terminalWidth(inlineText(row[col] ?? "")))));
|
|
44
|
+
const budget = width - (count - 1) * gap;
|
|
45
|
+
while (widths.reduce((sum, size) => sum + size, 0) > budget) {
|
|
46
|
+
const largest = widths.indexOf(Math.max(...widths));
|
|
47
|
+
widths[largest]--;
|
|
48
|
+
}
|
|
49
|
+
const rule = widths.map(size => theme.dark("─".repeat(size))).join(" ".repeat(gap));
|
|
50
|
+
const renderRow = (row, heading = false) => {
|
|
51
|
+
const cells = widths.map((size, col) => wrapInline(row[col] ?? "", size, theme, 0, heading ? s => theme.bold((theme.markdownHeading ?? theme.silver)(s)) : theme.silver));
|
|
52
|
+
return Array.from({ length: Math.max(1, ...cells.map(cell => cell.length)) }, (_, line) => widths.map((size, col) => {
|
|
53
|
+
const value = cells[col][line] ?? "";
|
|
54
|
+
const padding = Math.max(0, size - terminalWidth(value));
|
|
55
|
+
const align = separator[col] ?? "";
|
|
56
|
+
const left = !heading && align.endsWith(":") ? (align.startsWith(":") ? Math.floor(padding / 2) : padding) : 0;
|
|
57
|
+
return " ".repeat(left) + value + " ".repeat(padding - left);
|
|
58
|
+
}).join(" ".repeat(gap)));
|
|
59
|
+
};
|
|
60
|
+
return [...renderRow(header, true), rule, ...rows.flatMap((row, index) => [
|
|
61
|
+
...(index ? [rule] : []), ...renderRow(row),
|
|
62
|
+
])];
|
|
63
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { TuiTheme } from "./branding.js";
|
|
2
|
+
export interface MarkdownRenderOptions {
|
|
3
|
+
readonly width: number;
|
|
4
|
+
readonly theme: TuiTheme;
|
|
5
|
+
readonly imageCtx?: {
|
|
6
|
+
readonly cwd: string;
|
|
7
|
+
readonly env: NodeJS.ProcessEnv;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export declare function renderMarkdown(text: string, opts: MarkdownRenderOptions): readonly string[];
|
|
11
|
+
export declare function wrapPlain(text: string, width: number): readonly string[];
|