@relay-harness/coding-agent 0.0.0-stage → 1.0.2
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/CHANGELOG.md +6111 -0
- package/README.md +80 -2
- package/dist/bun/cli.d.ts +5 -0
- package/dist/bun/cli.d.ts.map +1 -0
- package/dist/bun/cli.js +5 -0
- package/dist/bun/cli.js.map +1 -0
- package/dist/bun/restore-sandbox-env.d.ts +17 -0
- package/dist/bun/restore-sandbox-env.d.ts.map +1 -0
- package/dist/bun/restore-sandbox-env.js +36 -0
- package/dist/bun/restore-sandbox-env.js.map +1 -0
- package/dist/bun/runtime-setup.d.ts +2 -0
- package/dist/bun/runtime-setup.d.ts.map +1 -0
- package/dist/bun/runtime-setup.js +12 -0
- package/dist/bun/runtime-setup.js.map +1 -0
- package/dist/bun/sandbox-env-setup.d.ts +2 -0
- package/dist/bun/sandbox-env-setup.d.ts.map +1 -0
- package/dist/bun/sandbox-env-setup.js +4 -0
- package/dist/bun/sandbox-env-setup.js.map +1 -0
- package/dist/bundle/chunks/anthropic-messages-TXWUAW5N.js +6 -0
- package/dist/bundle/chunks/anthropic.js +75 -0
- package/dist/bundle/chunks/azure-openai-responses-EJG46ESA.js +2 -0
- package/dist/bundle/chunks/bedrock-converse-stream.js +83 -0
- package/dist/bundle/chunks/chunk-3QND5D7W.js +82 -0
- package/dist/bundle/chunks/chunk-3XNI2SB6.js +15 -0
- package/dist/bundle/chunks/chunk-4L3WN2XY.js +2 -0
- package/dist/bundle/chunks/chunk-6CYCI3EJ.js +12 -0
- package/dist/bundle/chunks/chunk-7ZC4UXSL.js +2 -0
- package/dist/bundle/chunks/chunk-A3JYRWB6.js +2 -0
- package/dist/bundle/chunks/chunk-C47CLQZK.js +2 -0
- package/dist/bundle/chunks/chunk-DRQDKNXA.js +2 -0
- package/dist/bundle/chunks/chunk-EQ2HXQGJ.js +2 -0
- package/dist/bundle/chunks/chunk-F5ZABL6Z.js +20 -0
- package/dist/bundle/chunks/chunk-H3QXYIF7.js +31 -0
- package/dist/bundle/chunks/chunk-H6S6DQTM.js +2 -0
- package/dist/bundle/chunks/chunk-ISNO4JTR.js +127 -0
- package/dist/bundle/chunks/chunk-KJUDFE6Y.js +11 -0
- package/dist/bundle/chunks/chunk-L2ZPNLYD.js +2 -0
- package/dist/bundle/chunks/chunk-LD2P6SFZ.js +2 -0
- package/dist/bundle/chunks/chunk-MP5FU7MG.js +20 -0
- package/dist/bundle/chunks/chunk-O7R77OAK.js +2 -0
- package/dist/bundle/chunks/chunk-PGXDEOVV.js +2 -0
- package/dist/bundle/chunks/chunk-PJACZCIR.js +2 -0
- package/dist/bundle/chunks/chunk-PRRNXB7S.js +2 -0
- package/dist/bundle/chunks/chunk-PTRF7IZB.js +2 -0
- package/dist/bundle/chunks/chunk-RZ4KG4BP.js +44 -0
- package/dist/bundle/chunks/chunk-S3GGRYIO.js +6 -0
- package/dist/bundle/chunks/chunk-TEPMHNKQ.js +2 -0
- package/dist/bundle/chunks/chunk-TRDNDS6A.js +4 -0
- package/dist/bundle/chunks/chunk-USJZMAIR.js +2 -0
- package/dist/bundle/chunks/chunk-UTB4DTYQ.js +2 -0
- package/dist/bundle/chunks/chunk-WMTXXI7H.js +4 -0
- package/dist/bundle/chunks/chunk-XDAWU2J5.js +132 -0
- package/dist/bundle/chunks/chunk-XSLAMYCK.js +1297 -0
- package/dist/bundle/chunks/chunk-Z2G7KLPH.js +11 -0
- package/dist/bundle/chunks/cli-K4CNHWOI.js +51 -0
- package/dist/bundle/chunks/cloudflare-workers-ai-system-one-NM3JRRWQ.js +2 -0
- package/dist/bundle/chunks/codemode-worker.js +374 -0
- package/dist/bundle/chunks/easter-egg-3d-TGRCIHA4.js +2 -0
- package/dist/bundle/chunks/execute-6E5DA2QI.js +388 -0
- package/dist/bundle/chunks/github-copilot.js +2 -0
- package/dist/bundle/chunks/google-generative-ai-HYUNEOCJ.js +2 -0
- package/dist/bundle/chunks/google-vertex-J7MDGTNM.js +2 -0
- package/dist/bundle/chunks/https-proxy-agent-2VXB7436.js +13 -0
- package/dist/bundle/chunks/image-resize-worker.js +2 -0
- package/dist/bundle/chunks/jiti-loader-C3NU2SDH.js +21 -0
- package/dist/bundle/chunks/jiti-static-loader-E6ANQD5T.js +2 -0
- package/dist/bundle/chunks/kimi-coding.js +2 -0
- package/dist/bundle/chunks/lib-TEDK3E5I.js +9 -0
- package/dist/bundle/chunks/llama-cpp-classify-XT44PI3C.js +22 -0
- package/dist/bundle/chunks/meta.js +2 -0
- package/dist/bundle/chunks/mistral-conversations-UD2HHXKZ.js +5 -0
- package/dist/bundle/chunks/multipart-parser-SQ6GDJL7.js +3 -0
- package/dist/bundle/chunks/node-N5BSDOA5.js +16 -0
- package/dist/bundle/chunks/node-TWVVAGPO.js +2 -0
- package/dist/bundle/chunks/openai-chatgpt.js +75 -0
- package/dist/bundle/chunks/openai-codex-responses-EMHXEJR4.js +10 -0
- package/dist/bundle/chunks/openai-codex.js +75 -0
- package/dist/bundle/chunks/openai-completions-LPKRZYMC.js +7 -0
- package/dist/bundle/chunks/openai-responses-TOOBRHUV.js +3 -0
- package/dist/bundle/chunks/openrouter-images-ZVXWCSIM.js +2 -0
- package/dist/bundle/chunks/openrouter.js +75 -0
- package/dist/bundle/chunks/relay-messages-QRFJXG5X.js +8 -0
- package/dist/bundle/chunks/runtime-O5HLCH3V.js +2 -0
- package/dist/bundle/chunks/src-UK77SYZE.js +4 -0
- package/dist/bundle/chunks/typesafe-system-one-PRR5K6CI.js +2 -0
- package/dist/bundle/chunks/virtual-modules-FNVEVB65.js +2 -0
- package/dist/bundle/chunks/xai.js +2 -0
- package/dist/bundle/cli-runtime.js +3 -0
- package/dist/bundle/cli.js +5 -0
- package/dist/bundle/index.js +2 -0
- package/dist/bundle/rpc-entry.js +3 -0
- package/dist/cli/args.d.ts +61 -0
- package/dist/cli/args.d.ts.map +1 -0
- package/dist/cli/args.js +454 -0
- package/dist/cli/args.js.map +1 -0
- package/dist/cli/auth-check.d.ts +19 -0
- package/dist/cli/auth-check.d.ts.map +1 -0
- package/dist/cli/auth-check.js +50 -0
- package/dist/cli/auth-check.js.map +1 -0
- package/dist/cli/auth-command.d.ts +24 -0
- package/dist/cli/auth-command.d.ts.map +1 -0
- package/dist/cli/auth-command.js +103 -0
- package/dist/cli/auth-command.js.map +1 -0
- package/dist/cli/config-selector.d.ts +16 -0
- package/dist/cli/config-selector.d.ts.map +1 -0
- package/dist/cli/config-selector.js +32 -0
- package/dist/cli/config-selector.js.map +1 -0
- package/dist/cli/credential-print.d.ts +13 -0
- package/dist/cli/credential-print.d.ts.map +1 -0
- package/dist/cli/credential-print.js +76 -0
- package/dist/cli/credential-print.js.map +1 -0
- package/dist/cli/file-processor.d.ts +15 -0
- package/dist/cli/file-processor.d.ts.map +1 -0
- package/dist/cli/file-processor.js +71 -0
- package/dist/cli/file-processor.js.map +1 -0
- package/dist/cli/initial-message.d.ts +18 -0
- package/dist/cli/initial-message.d.ts.map +1 -0
- package/dist/cli/initial-message.js +22 -0
- package/dist/cli/initial-message.js.map +1 -0
- package/dist/cli/list-models.d.ts +9 -0
- package/dist/cli/list-models.d.ts.map +1 -0
- package/dist/cli/list-models.js +98 -0
- package/dist/cli/list-models.js.map +1 -0
- package/dist/cli/project-trust.d.ts +10 -0
- package/dist/cli/project-trust.d.ts.map +1 -0
- package/dist/cli/project-trust.js +48 -0
- package/dist/cli/project-trust.js.map +1 -0
- package/dist/cli/session-picker.d.ts +10 -0
- package/dist/cli/session-picker.d.ts.map +1 -0
- package/dist/cli/session-picker.js +36 -0
- package/dist/cli/session-picker.js.map +1 -0
- package/dist/cli/setup.d.ts +2 -0
- package/dist/cli/setup.d.ts.map +1 -0
- package/dist/cli/setup.js +12 -0
- package/dist/cli/setup.js.map +1 -0
- package/dist/cli/startup-ui.d.ts +20 -0
- package/dist/cli/startup-ui.d.ts.map +1 -0
- package/dist/cli/startup-ui.js +193 -0
- package/dist/cli/startup-ui.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +6 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +108 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +264 -0
- package/dist/config.js.map +1 -0
- package/dist/core/agent-session-runtime.d.ts +119 -0
- package/dist/core/agent-session-runtime.d.ts.map +1 -0
- package/dist/core/agent-session-runtime.js +317 -0
- package/dist/core/agent-session-runtime.js.map +1 -0
- package/dist/core/agent-session-services.d.ts +86 -0
- package/dist/core/agent-session-services.d.ts.map +1 -0
- package/dist/core/agent-session-services.js +147 -0
- package/dist/core/agent-session-services.js.map +1 -0
- package/dist/core/agent-session.d.ts +891 -0
- package/dist/core/agent-session.d.ts.map +1 -0
- package/dist/core/agent-session.js +3553 -0
- package/dist/core/agent-session.js.map +1 -0
- package/dist/core/auth-guidance.d.ts +5 -0
- package/dist/core/auth-guidance.d.ts.map +1 -0
- package/dist/core/auth-guidance.js +21 -0
- package/dist/core/auth-guidance.js.map +1 -0
- package/dist/core/auth-storage.d.ts +72 -0
- package/dist/core/auth-storage.d.ts.map +1 -0
- package/dist/core/auth-storage.js +426 -0
- package/dist/core/auth-storage.js.map +1 -0
- package/dist/core/bash-executor.d.ts +32 -0
- package/dist/core/bash-executor.d.ts.map +1 -0
- package/dist/core/bash-executor.js +106 -0
- package/dist/core/bash-executor.js.map +1 -0
- package/dist/core/bug-report.d.ts +176 -0
- package/dist/core/bug-report.d.ts.map +1 -0
- package/dist/core/bug-report.js +292 -0
- package/dist/core/bug-report.js.map +1 -0
- package/dist/core/cache-stats.d.ts +49 -0
- package/dist/core/cache-stats.d.ts.map +1 -0
- package/dist/core/cache-stats.js +112 -0
- package/dist/core/cache-stats.js.map +1 -0
- package/dist/core/cache-warmer.d.ts +103 -0
- package/dist/core/cache-warmer.d.ts.map +1 -0
- package/dist/core/cache-warmer.js +356 -0
- package/dist/core/cache-warmer.js.map +1 -0
- package/dist/core/compaction/branch-summarization.d.ts +98 -0
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -0
- package/dist/core/compaction/branch-summarization.js +251 -0
- package/dist/core/compaction/branch-summarization.js.map +1 -0
- package/dist/core/compaction/compaction.d.ts +145 -0
- package/dist/core/compaction/compaction.d.ts.map +1 -0
- package/dist/core/compaction/compaction.js +744 -0
- package/dist/core/compaction/compaction.js.map +1 -0
- package/dist/core/compaction/index.d.ts +7 -0
- package/dist/core/compaction/index.d.ts.map +1 -0
- package/dist/core/compaction/index.js +7 -0
- package/dist/core/compaction/index.js.map +1 -0
- package/dist/core/compaction/utils.d.ts +39 -0
- package/dist/core/compaction/utils.d.ts.map +1 -0
- package/dist/core/compaction/utils.js +149 -0
- package/dist/core/compaction/utils.js.map +1 -0
- package/dist/core/crash-log.d.ts +27 -0
- package/dist/core/crash-log.d.ts.map +1 -0
- package/dist/core/crash-log.js +140 -0
- package/dist/core/crash-log.js.map +1 -0
- package/dist/core/defaults.d.ts +4 -0
- package/dist/core/defaults.d.ts.map +1 -0
- package/dist/core/defaults.js +11 -0
- package/dist/core/defaults.js.map +1 -0
- package/dist/core/diagnostics.d.ts +15 -0
- package/dist/core/diagnostics.d.ts.map +1 -0
- package/dist/core/diagnostics.js +2 -0
- package/dist/core/diagnostics.js.map +1 -0
- package/dist/core/event-bus.d.ts +9 -0
- package/dist/core/event-bus.d.ts.map +1 -0
- package/dist/core/event-bus.js +25 -0
- package/dist/core/event-bus.js.map +1 -0
- package/dist/core/exec.d.ts +29 -0
- package/dist/core/exec.d.ts.map +1 -0
- package/dist/core/exec.js +75 -0
- package/dist/core/exec.js.map +1 -0
- package/dist/core/experimental.d.ts +2 -0
- package/dist/core/experimental.d.ts.map +1 -0
- package/dist/core/experimental.js +4 -0
- package/dist/core/experimental.js.map +1 -0
- package/dist/core/export-html/ansi-to-html.d.ts +22 -0
- package/dist/core/export-html/ansi-to-html.d.ts.map +1 -0
- package/dist/core/export-html/ansi-to-html.js +249 -0
- package/dist/core/export-html/ansi-to-html.js.map +1 -0
- package/dist/core/export-html/index.d.ts +37 -0
- package/dist/core/export-html/index.d.ts.map +1 -0
- package/dist/core/export-html/index.js +226 -0
- package/dist/core/export-html/index.js.map +1 -0
- package/dist/core/export-html/template.css +1076 -0
- package/dist/core/export-html/template.html +55 -0
- package/dist/core/export-html/template.js +1918 -0
- package/dist/core/export-html/tool-renderer.d.ts +34 -0
- package/dist/core/export-html/tool-renderer.d.ts.map +1 -0
- package/dist/core/export-html/tool-renderer.js +108 -0
- package/dist/core/export-html/tool-renderer.js.map +1 -0
- package/dist/core/export-html/vendor/highlight.min.js +1213 -0
- package/dist/core/export-html/vendor/marked.min.js +78 -0
- package/dist/core/extensions/index.d.ts +12 -0
- package/dist/core/extensions/index.d.ts.map +1 -0
- package/dist/core/extensions/index.js +9 -0
- package/dist/core/extensions/index.js.map +1 -0
- package/dist/core/extensions/jiti-loader.d.ts +2 -0
- package/dist/core/extensions/jiti-loader.d.ts.map +1 -0
- package/dist/core/extensions/jiti-loader.js +4 -0
- package/dist/core/extensions/jiti-loader.js.map +1 -0
- package/dist/core/extensions/jiti-static-loader.d.ts +2 -0
- package/dist/core/extensions/jiti-static-loader.d.ts.map +1 -0
- package/dist/core/extensions/jiti-static-loader.js +4 -0
- package/dist/core/extensions/jiti-static-loader.js.map +1 -0
- package/dist/core/extensions/loader.d.ts +23 -0
- package/dist/core/extensions/loader.d.ts.map +1 -0
- package/dist/core/extensions/loader.js +701 -0
- package/dist/core/extensions/loader.js.map +1 -0
- package/dist/core/extensions/runner.d.ts +213 -0
- package/dist/core/extensions/runner.d.ts.map +1 -0
- package/dist/core/extensions/runner.js +1239 -0
- package/dist/core/extensions/runner.js.map +1 -0
- package/dist/core/extensions/types.d.ts +1720 -0
- package/dist/core/extensions/types.d.ts.map +1 -0
- package/dist/core/extensions/types.js +48 -0
- package/dist/core/extensions/types.js.map +1 -0
- package/dist/core/extensions/virtual-modules.d.ts +3 -0
- package/dist/core/extensions/virtual-modules.d.ts.map +1 -0
- package/dist/core/extensions/virtual-modules.js +38 -0
- package/dist/core/extensions/virtual-modules.js.map +1 -0
- package/dist/core/extensions/wrapper.d.ts +20 -0
- package/dist/core/extensions/wrapper.d.ts.map +1 -0
- package/dist/core/extensions/wrapper.js +22 -0
- package/dist/core/extensions/wrapper.js.map +1 -0
- package/dist/core/footer-data-provider.d.ts +64 -0
- package/dist/core/footer-data-provider.d.ts.map +1 -0
- package/dist/core/footer-data-provider.js +338 -0
- package/dist/core/footer-data-provider.js.map +1 -0
- package/dist/core/harness-core.d.ts +50 -0
- package/dist/core/harness-core.d.ts.map +1 -0
- package/dist/core/harness-core.js +240 -0
- package/dist/core/harness-core.js.map +1 -0
- package/dist/core/http-dispatcher.d.ts +22 -0
- package/dist/core/http-dispatcher.d.ts.map +1 -0
- package/dist/core/http-dispatcher.js +98 -0
- package/dist/core/http-dispatcher.js.map +1 -0
- package/dist/core/index.d.ts +14 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +13 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/keybindings.d.ts +428 -0
- package/dist/core/keybindings.d.ts.map +1 -0
- package/dist/core/keybindings.js +321 -0
- package/dist/core/keybindings.js.map +1 -0
- package/dist/core/mcp-servers.d.ts +125 -0
- package/dist/core/mcp-servers.d.ts.map +1 -0
- package/dist/core/mcp-servers.js +198 -0
- package/dist/core/mcp-servers.js.map +1 -0
- package/dist/core/messages.d.ts +77 -0
- package/dist/core/messages.d.ts.map +1 -0
- package/dist/core/messages.js +124 -0
- package/dist/core/messages.js.map +1 -0
- package/dist/core/model-config.d.ts +759 -0
- package/dist/core/model-config.d.ts.map +1 -0
- package/dist/core/model-config.js +293 -0
- package/dist/core/model-config.js.map +1 -0
- package/dist/core/model-registry.d.ts +63 -0
- package/dist/core/model-registry.d.ts.map +1 -0
- package/dist/core/model-registry.js +144 -0
- package/dist/core/model-registry.js.map +1 -0
- package/dist/core/model-resolver.d.ts +124 -0
- package/dist/core/model-resolver.d.ts.map +1 -0
- package/dist/core/model-resolver.js +589 -0
- package/dist/core/model-resolver.js.map +1 -0
- package/dist/core/model-runtime.d.ts +142 -0
- package/dist/core/model-runtime.d.ts.map +1 -0
- package/dist/core/model-runtime.js +732 -0
- package/dist/core/model-runtime.js.map +1 -0
- package/dist/core/models-store.d.ts +22 -0
- package/dist/core/models-store.d.ts.map +1 -0
- package/dist/core/models-store.js +115 -0
- package/dist/core/models-store.js.map +1 -0
- package/dist/core/nested-tool-calls.d.ts +102 -0
- package/dist/core/nested-tool-calls.d.ts.map +1 -0
- package/dist/core/nested-tool-calls.js +178 -0
- package/dist/core/nested-tool-calls.js.map +1 -0
- package/dist/core/output-guard.d.ts +7 -0
- package/dist/core/output-guard.d.ts.map +1 -0
- package/dist/core/output-guard.js +89 -0
- package/dist/core/output-guard.js.map +1 -0
- package/dist/core/package-manager.d.ts +217 -0
- package/dist/core/package-manager.d.ts.map +1 -0
- package/dist/core/package-manager.js +2224 -0
- package/dist/core/package-manager.js.map +1 -0
- package/dist/core/project-trust.d.ts +15 -0
- package/dist/core/project-trust.d.ts.map +1 -0
- package/dist/core/project-trust.js +59 -0
- package/dist/core/project-trust.js.map +1 -0
- package/dist/core/prompt-templates.d.ts +59 -0
- package/dist/core/prompt-templates.d.ts.map +1 -0
- package/dist/core/prompt-templates.js +262 -0
- package/dist/core/prompt-templates.js.map +1 -0
- package/dist/core/provider-attribution.d.ts +4 -0
- package/dist/core/provider-attribution.d.ts.map +1 -0
- package/dist/core/provider-attribution.js +72 -0
- package/dist/core/provider-attribution.js.map +1 -0
- package/dist/core/provider-composer.d.ts +80 -0
- package/dist/core/provider-composer.d.ts.map +1 -0
- package/dist/core/provider-composer.js +484 -0
- package/dist/core/provider-composer.js.map +1 -0
- package/dist/core/relay-manifest.d.ts +8 -0
- package/dist/core/relay-manifest.d.ts.map +1 -0
- package/dist/core/relay-manifest.js +26 -0
- package/dist/core/relay-manifest.js.map +1 -0
- package/dist/core/resolve-config-value.d.ts +30 -0
- package/dist/core/resolve-config-value.d.ts.map +1 -0
- package/dist/core/resolve-config-value.js +247 -0
- package/dist/core/resolve-config-value.js.map +1 -0
- package/dist/core/resource-loader.d.ts +227 -0
- package/dist/core/resource-loader.d.ts.map +1 -0
- package/dist/core/resource-loader.js +1005 -0
- package/dist/core/resource-loader.js.map +1 -0
- package/dist/core/runtime-credentials.d.ts +15 -0
- package/dist/core/runtime-credentials.d.ts.map +1 -0
- package/dist/core/runtime-credentials.js +39 -0
- package/dist/core/runtime-credentials.js.map +1 -0
- package/dist/core/sdk.d.ts +108 -0
- package/dist/core/sdk.d.ts.map +1 -0
- package/dist/core/sdk.js +315 -0
- package/dist/core/sdk.js.map +1 -0
- package/dist/core/session-cwd.d.ts +19 -0
- package/dist/core/session-cwd.d.ts.map +1 -0
- package/dist/core/session-cwd.js +38 -0
- package/dist/core/session-cwd.js.map +1 -0
- package/dist/core/session-export.d.ts +8 -0
- package/dist/core/session-export.d.ts.map +1 -0
- package/dist/core/session-export.js +33 -0
- package/dist/core/session-export.js.map +1 -0
- package/dist/core/session-manager.d.ts +416 -0
- package/dist/core/session-manager.d.ts.map +1 -0
- package/dist/core/session-manager.js +1523 -0
- package/dist/core/session-manager.js.map +1 -0
- package/dist/core/settings-diagnostics.d.ts +9 -0
- package/dist/core/settings-diagnostics.d.ts.map +1 -0
- package/dist/core/settings-diagnostics.js +21 -0
- package/dist/core/settings-diagnostics.js.map +1 -0
- package/dist/core/settings-manager.d.ts +421 -0
- package/dist/core/settings-manager.d.ts.map +1 -0
- package/dist/core/settings-manager.js +1120 -0
- package/dist/core/settings-manager.js.map +1 -0
- package/dist/core/skills.d.ts +60 -0
- package/dist/core/skills.d.ts.map +1 -0
- package/dist/core/skills.js +408 -0
- package/dist/core/skills.js.map +1 -0
- package/dist/core/slash-commands.d.ts +15 -0
- package/dist/core/slash-commands.d.ts.map +1 -0
- package/dist/core/slash-commands.js +29 -0
- package/dist/core/slash-commands.js.map +1 -0
- package/dist/core/source-info.d.ts +26 -0
- package/dist/core/source-info.d.ts.map +1 -0
- package/dist/core/source-info.js +35 -0
- package/dist/core/source-info.js.map +1 -0
- package/dist/core/system-prompt.d.ts +71 -0
- package/dist/core/system-prompt.d.ts.map +1 -0
- package/dist/core/system-prompt.js +147 -0
- package/dist/core/system-prompt.js.map +1 -0
- package/dist/core/telemetry.d.ts +3 -0
- package/dist/core/telemetry.d.ts.map +1 -0
- package/dist/core/telemetry.js +9 -0
- package/dist/core/telemetry.js.map +1 -0
- package/dist/core/timings.d.ts +10 -0
- package/dist/core/timings.d.ts.map +1 -0
- package/dist/core/timings.js +41 -0
- package/dist/core/timings.js.map +1 -0
- package/dist/core/tools/bash.d.ts +100 -0
- package/dist/core/tools/bash.d.ts.map +1 -0
- package/dist/core/tools/bash.js +333 -0
- package/dist/core/tools/bash.js.map +1 -0
- package/dist/core/tools/edit-diff.d.ts +101 -0
- package/dist/core/tools/edit-diff.d.ts.map +1 -0
- package/dist/core/tools/edit-diff.js +421 -0
- package/dist/core/tools/edit-diff.js.map +1 -0
- package/dist/core/tools/edit.d.ts +44 -0
- package/dist/core/tools/edit.d.ts.map +1 -0
- package/dist/core/tools/edit.js +147 -0
- package/dist/core/tools/edit.js.map +1 -0
- package/dist/core/tools/file-mutation-queue.d.ts +6 -0
- package/dist/core/tools/file-mutation-queue.d.ts.map +1 -0
- package/dist/core/tools/file-mutation-queue.js +52 -0
- package/dist/core/tools/file-mutation-queue.js.map +1 -0
- package/dist/core/tools/find.d.ts +42 -0
- package/dist/core/tools/find.d.ts.map +1 -0
- package/dist/core/tools/find.js +251 -0
- package/dist/core/tools/find.js.map +1 -0
- package/dist/core/tools/grep.d.ts +41 -0
- package/dist/core/tools/grep.d.ts.map +1 -0
- package/dist/core/tools/grep.js +252 -0
- package/dist/core/tools/grep.js.map +1 -0
- package/dist/core/tools/index.d.ts +43 -0
- package/dist/core/tools/index.d.ts.map +1 -0
- package/dist/core/tools/index.js +129 -0
- package/dist/core/tools/index.js.map +1 -0
- package/dist/core/tools/ls.d.ts +41 -0
- package/dist/core/tools/ls.d.ts.map +1 -0
- package/dist/core/tools/ls.js +126 -0
- package/dist/core/tools/ls.js.map +1 -0
- package/dist/core/tools/output-accumulator.d.ts +63 -0
- package/dist/core/tools/output-accumulator.d.ts.map +1 -0
- package/dist/core/tools/output-accumulator.js +214 -0
- package/dist/core/tools/output-accumulator.js.map +1 -0
- package/dist/core/tools/path-utils.d.ts +10 -0
- package/dist/core/tools/path-utils.d.ts.map +1 -0
- package/dist/core/tools/path-utils.js +99 -0
- package/dist/core/tools/path-utils.js.map +1 -0
- package/dist/core/tools/powershell.d.ts +16 -0
- package/dist/core/tools/powershell.d.ts.map +1 -0
- package/dist/core/tools/powershell.js +39 -0
- package/dist/core/tools/powershell.js.map +1 -0
- package/dist/core/tools/read.d.ts +42 -0
- package/dist/core/tools/read.d.ts.map +1 -0
- package/dist/core/tools/read.js +169 -0
- package/dist/core/tools/read.js.map +1 -0
- package/dist/core/tools/render-utils.d.ts +30 -0
- package/dist/core/tools/render-utils.d.ts.map +1 -0
- package/dist/core/tools/render-utils.js +91 -0
- package/dist/core/tools/render-utils.js.map +1 -0
- package/dist/core/tools/renderers/bash.d.ts +12 -0
- package/dist/core/tools/renderers/bash.d.ts.map +1 -0
- package/dist/core/tools/renderers/bash.js +117 -0
- package/dist/core/tools/renderers/bash.js.map +1 -0
- package/dist/core/tools/renderers/edit.d.ts +23 -0
- package/dist/core/tools/renderers/edit.d.ts.map +1 -0
- package/dist/core/tools/renderers/edit.js +167 -0
- package/dist/core/tools/renderers/edit.js.map +1 -0
- package/dist/core/tools/renderers/find.d.ts +10 -0
- package/dist/core/tools/renderers/find.d.ts.map +1 -0
- package/dist/core/tools/renderers/find.js +64 -0
- package/dist/core/tools/renderers/find.js.map +1 -0
- package/dist/core/tools/renderers/grep.d.ts +10 -0
- package/dist/core/tools/renderers/grep.d.ts.map +1 -0
- package/dist/core/tools/renderers/grep.js +69 -0
- package/dist/core/tools/renderers/grep.js.map +1 -0
- package/dist/core/tools/renderers/index.d.ts +28 -0
- package/dist/core/tools/renderers/index.d.ts.map +1 -0
- package/dist/core/tools/renderers/index.js +47 -0
- package/dist/core/tools/renderers/index.js.map +1 -0
- package/dist/core/tools/renderers/ls.d.ts +10 -0
- package/dist/core/tools/renderers/ls.d.ts.map +1 -0
- package/dist/core/tools/renderers/ls.js +58 -0
- package/dist/core/tools/renderers/ls.js.map +1 -0
- package/dist/core/tools/renderers/read.d.ts +11 -0
- package/dist/core/tools/renderers/read.d.ts.map +1 -0
- package/dist/core/tools/renderers/read.js +130 -0
- package/dist/core/tools/renderers/read.js.map +1 -0
- package/dist/core/tools/renderers/write.d.ts +10 -0
- package/dist/core/tools/renderers/write.d.ts.map +1 -0
- package/dist/core/tools/renderers/write.js +153 -0
- package/dist/core/tools/renderers/write.js.map +1 -0
- package/dist/core/tools/tool-definition-wrapper.d.ts +16 -0
- package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -0
- package/dist/core/tools/tool-definition-wrapper.js +38 -0
- package/dist/core/tools/tool-definition-wrapper.js.map +1 -0
- package/dist/core/tools/truncate.d.ts +84 -0
- package/dist/core/tools/truncate.d.ts.map +1 -0
- package/dist/core/tools/truncate.js +244 -0
- package/dist/core/tools/truncate.js.map +1 -0
- package/dist/core/tools/write.d.ts +30 -0
- package/dist/core/tools/write.d.ts.map +1 -0
- package/dist/core/tools/write.js +61 -0
- package/dist/core/tools/write.js.map +1 -0
- package/dist/core/trust-manager.d.ts +36 -0
- package/dist/core/trust-manager.d.ts.map +1 -0
- package/dist/core/trust-manager.js +204 -0
- package/dist/core/trust-manager.js.map +1 -0
- package/dist/core/usage-totals.d.ts +21 -0
- package/dist/core/usage-totals.d.ts.map +1 -0
- package/dist/core/usage-totals.js +79 -0
- package/dist/core/usage-totals.js.map +1 -0
- package/dist/core/virtual-models.d.ts +117 -0
- package/dist/core/virtual-models.d.ts.map +1 -0
- package/dist/core/virtual-models.js +124 -0
- package/dist/core/virtual-models.js.map +1 -0
- package/dist/core/workspace-probe.d.ts +8 -0
- package/dist/core/workspace-probe.d.ts.map +1 -0
- package/dist/core/workspace-probe.js +65 -0
- package/dist/core/workspace-probe.js.map +1 -0
- package/dist/extensions/codemode/execute.d.ts +16 -0
- package/dist/extensions/codemode/execute.d.ts.map +1 -0
- package/dist/extensions/codemode/execute.js +577 -0
- package/dist/extensions/codemode/execute.js.map +1 -0
- package/dist/extensions/codemode/execute.lazy.d.ts +3 -0
- package/dist/extensions/codemode/execute.lazy.d.ts.map +1 -0
- package/dist/extensions/codemode/execute.lazy.js +3 -0
- package/dist/extensions/codemode/execute.lazy.js.map +1 -0
- package/dist/extensions/codemode/index.d.ts +21 -0
- package/dist/extensions/codemode/index.d.ts.map +1 -0
- package/dist/extensions/codemode/index.js +31 -0
- package/dist/extensions/codemode/index.js.map +1 -0
- package/dist/extensions/codemode/renderer.d.ts +12 -0
- package/dist/extensions/codemode/renderer.d.ts.map +1 -0
- package/dist/extensions/codemode/renderer.js +137 -0
- package/dist/extensions/codemode/renderer.js.map +1 -0
- package/dist/extensions/codemode/tool.d.ts +123 -0
- package/dist/extensions/codemode/tool.d.ts.map +1 -0
- package/dist/extensions/codemode/tool.js +268 -0
- package/dist/extensions/codemode/tool.js.map +1 -0
- package/dist/extensions/codemode/worker.d.ts +7 -0
- package/dist/extensions/codemode/worker.d.ts.map +1 -0
- package/dist/extensions/codemode/worker.js +7 -0
- package/dist/extensions/codemode/worker.js.map +1 -0
- package/dist/extensions/index.d.ts +3 -0
- package/dist/extensions/index.d.ts.map +1 -0
- package/dist/extensions/index.js +19 -0
- package/dist/extensions/index.js.map +1 -0
- package/dist/extensions/intake/docx.d.ts +42 -0
- package/dist/extensions/intake/docx.d.ts.map +1 -0
- package/dist/extensions/intake/docx.js +148 -0
- package/dist/extensions/intake/docx.js.map +1 -0
- package/dist/extensions/intake/index.d.ts +17 -0
- package/dist/extensions/intake/index.d.ts.map +1 -0
- package/dist/extensions/intake/index.js +88 -0
- package/dist/extensions/intake/index.js.map +1 -0
- package/dist/extensions/intake/prompt.d.ts +6 -0
- package/dist/extensions/intake/prompt.d.ts.map +1 -0
- package/dist/extensions/intake/prompt.js +41 -0
- package/dist/extensions/intake/prompt.js.map +1 -0
- package/dist/extensions/intake/questionnaire.d.ts +84 -0
- package/dist/extensions/intake/questionnaire.d.ts.map +1 -0
- package/dist/extensions/intake/questionnaire.js +472 -0
- package/dist/extensions/intake/questionnaire.js.map +1 -0
- package/dist/extensions/laya/assessment.d.ts +34 -0
- package/dist/extensions/laya/assessment.d.ts.map +1 -0
- package/dist/extensions/laya/assessment.js +171 -0
- package/dist/extensions/laya/assessment.js.map +1 -0
- package/dist/extensions/laya/index.d.ts +34 -0
- package/dist/extensions/laya/index.d.ts.map +1 -0
- package/dist/extensions/laya/index.js +516 -0
- package/dist/extensions/laya/index.js.map +1 -0
- package/dist/extensions/laya/model-manifest.d.ts +7 -0
- package/dist/extensions/laya/model-manifest.d.ts.map +1 -0
- package/dist/extensions/laya/model-manifest.js +48 -0
- package/dist/extensions/laya/model-manifest.js.map +1 -0
- package/dist/extensions/laya/policy.d.ts +130 -0
- package/dist/extensions/laya/policy.d.ts.map +1 -0
- package/dist/extensions/laya/policy.js +222 -0
- package/dist/extensions/laya/policy.js.map +1 -0
- package/dist/extensions/laya/questions.d.ts +60 -0
- package/dist/extensions/laya/questions.d.ts.map +1 -0
- package/dist/extensions/laya/questions.js +189 -0
- package/dist/extensions/laya/questions.js.map +1 -0
- package/dist/extensions/laya/routers.d.ts +17 -0
- package/dist/extensions/laya/routers.d.ts.map +1 -0
- package/dist/extensions/laya/routers.js +119 -0
- package/dist/extensions/laya/routers.js.map +1 -0
- package/dist/extensions/laya/runtime.d.ts +68 -0
- package/dist/extensions/laya/runtime.d.ts.map +1 -0
- package/dist/extensions/laya/runtime.js +179 -0
- package/dist/extensions/laya/runtime.js.map +1 -0
- package/dist/extensions/laya/seed.d.ts +39 -0
- package/dist/extensions/laya/seed.d.ts.map +1 -0
- package/dist/extensions/laya/seed.js +358 -0
- package/dist/extensions/laya/seed.js.map +1 -0
- package/dist/extensions/laya/server.d.ts +26 -0
- package/dist/extensions/laya/server.d.ts.map +1 -0
- package/dist/extensions/laya/server.js +117 -0
- package/dist/extensions/laya/server.js.map +1 -0
- package/dist/extensions/laya/telemetry.d.ts +94 -0
- package/dist/extensions/laya/telemetry.d.ts.map +1 -0
- package/dist/extensions/laya/telemetry.js +107 -0
- package/dist/extensions/laya/telemetry.js.map +1 -0
- package/dist/extensions/llama/client.d.ts +69 -0
- package/dist/extensions/llama/client.d.ts.map +1 -0
- package/dist/extensions/llama/client.js +313 -0
- package/dist/extensions/llama/client.js.map +1 -0
- package/dist/extensions/llama/huggingface.d.ts +23 -0
- package/dist/extensions/llama/huggingface.d.ts.map +1 -0
- package/dist/extensions/llama/huggingface.js +141 -0
- package/dist/extensions/llama/huggingface.js.map +1 -0
- package/dist/extensions/llama/index.d.ts +3 -0
- package/dist/extensions/llama/index.d.ts.map +1 -0
- package/dist/extensions/llama/index.js +219 -0
- package/dist/extensions/llama/index.js.map +1 -0
- package/dist/extensions/llama/provider.d.ts +12 -0
- package/dist/extensions/llama/provider.d.ts.map +1 -0
- package/dist/extensions/llama/provider.js +213 -0
- package/dist/extensions/llama/provider.js.map +1 -0
- package/dist/extensions/llama/ui.d.ts +42 -0
- package/dist/extensions/llama/ui.d.ts.map +1 -0
- package/dist/extensions/llama/ui.js +416 -0
- package/dist/extensions/llama/ui.js.map +1 -0
- package/dist/extensions/mcp/cli.d.ts +21 -0
- package/dist/extensions/mcp/cli.d.ts.map +1 -0
- package/dist/extensions/mcp/cli.js +503 -0
- package/dist/extensions/mcp/cli.js.map +1 -0
- package/dist/extensions/mcp/cli.lazy.d.ts +3 -0
- package/dist/extensions/mcp/cli.lazy.d.ts.map +1 -0
- package/dist/extensions/mcp/cli.lazy.js +3 -0
- package/dist/extensions/mcp/cli.lazy.js.map +1 -0
- package/dist/extensions/mcp/config.d.ts +84 -0
- package/dist/extensions/mcp/config.d.ts.map +1 -0
- package/dist/extensions/mcp/config.js +194 -0
- package/dist/extensions/mcp/config.js.map +1 -0
- package/dist/extensions/mcp/index.d.ts +79 -0
- package/dist/extensions/mcp/index.d.ts.map +1 -0
- package/dist/extensions/mcp/index.js +1101 -0
- package/dist/extensions/mcp/index.js.map +1 -0
- package/dist/extensions/mcp/log.d.ts +16 -0
- package/dist/extensions/mcp/log.d.ts.map +1 -0
- package/dist/extensions/mcp/log.js +66 -0
- package/dist/extensions/mcp/log.js.map +1 -0
- package/dist/extensions/mcp/oauth.d.ts +98 -0
- package/dist/extensions/mcp/oauth.d.ts.map +1 -0
- package/dist/extensions/mcp/oauth.js +366 -0
- package/dist/extensions/mcp/oauth.js.map +1 -0
- package/dist/extensions/mcp/resources.d.ts +43 -0
- package/dist/extensions/mcp/resources.d.ts.map +1 -0
- package/dist/extensions/mcp/resources.js +262 -0
- package/dist/extensions/mcp/resources.js.map +1 -0
- package/dist/extensions/mcp/runtime.d.ts +98 -0
- package/dist/extensions/mcp/runtime.d.ts.map +1 -0
- package/dist/extensions/mcp/runtime.js +395 -0
- package/dist/extensions/mcp/runtime.js.map +1 -0
- package/dist/extensions/mcp/runtime.lazy.d.ts +3 -0
- package/dist/extensions/mcp/runtime.lazy.d.ts.map +1 -0
- package/dist/extensions/mcp/runtime.lazy.js +3 -0
- package/dist/extensions/mcp/runtime.lazy.js.map +1 -0
- package/dist/extensions/mcp/tools.d.ts +86 -0
- package/dist/extensions/mcp/tools.d.ts.map +1 -0
- package/dist/extensions/mcp/tools.js +252 -0
- package/dist/extensions/mcp/tools.js.map +1 -0
- package/dist/extensions/mcp/ui.d.ts +60 -0
- package/dist/extensions/mcp/ui.d.ts.map +1 -0
- package/dist/extensions/mcp/ui.js +178 -0
- package/dist/extensions/mcp/ui.js.map +1 -0
- package/dist/extensions/tool-search/index.d.ts +12 -0
- package/dist/extensions/tool-search/index.d.ts.map +1 -0
- package/dist/extensions/tool-search/index.js +15 -0
- package/dist/extensions/tool-search/index.js.map +1 -0
- package/dist/extensions/tool-search/tool.d.ts +73 -0
- package/dist/extensions/tool-search/tool.d.ts.map +1 -0
- package/dist/extensions/tool-search/tool.js +189 -0
- package/dist/extensions/tool-search/tool.js.map +1 -0
- package/dist/index.d.ts +44 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +53 -0
- package/dist/index.js.map +1 -0
- package/dist/main.d.ts +16 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +820 -0
- package/dist/main.js.map +1 -0
- package/dist/migrations.d.ts +33 -0
- package/dist/migrations.d.ts.map +1 -0
- package/dist/migrations.js +282 -0
- package/dist/migrations.js.map +1 -0
- package/dist/modes/index.d.ts +10 -0
- package/dist/modes/index.d.ts.map +1 -0
- package/dist/modes/index.js +8 -0
- package/dist/modes/index.js.map +1 -0
- package/dist/modes/interactive/assets/clankolas.png +0 -0
- package/dist/modes/interactive/bug-report.d.ts +16 -0
- package/dist/modes/interactive/bug-report.d.ts.map +1 -0
- package/dist/modes/interactive/bug-report.js +171 -0
- package/dist/modes/interactive/bug-report.js.map +1 -0
- package/dist/modes/interactive/chat-viewport.d.ts +20 -0
- package/dist/modes/interactive/chat-viewport.d.ts.map +1 -0
- package/dist/modes/interactive/chat-viewport.js +28 -0
- package/dist/modes/interactive/chat-viewport.js.map +1 -0
- package/dist/modes/interactive/components/armin.d.ts +37 -0
- package/dist/modes/interactive/components/armin.d.ts.map +1 -0
- package/dist/modes/interactive/components/armin.js +335 -0
- package/dist/modes/interactive/components/armin.js.map +1 -0
- package/dist/modes/interactive/components/assistant-message.d.ts +26 -0
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/assistant-message.js +158 -0
- package/dist/modes/interactive/components/assistant-message.js.map +1 -0
- package/dist/modes/interactive/components/auth-url.d.ts +14 -0
- package/dist/modes/interactive/components/auth-url.d.ts.map +1 -0
- package/dist/modes/interactive/components/auth-url.js +37 -0
- package/dist/modes/interactive/components/auth-url.js.map +1 -0
- package/dist/modes/interactive/components/bash-execution.d.ts +34 -0
- package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -0
- package/dist/modes/interactive/components/bash-execution.js +175 -0
- package/dist/modes/interactive/components/bash-execution.js.map +1 -0
- package/dist/modes/interactive/components/bordered-loader.d.ts +16 -0
- package/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -0
- package/dist/modes/interactive/components/bordered-loader.js +54 -0
- package/dist/modes/interactive/components/bordered-loader.js.map +1 -0
- package/dist/modes/interactive/components/branch-summary-message.d.ts +16 -0
- package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/branch-summary-message.js +51 -0
- package/dist/modes/interactive/components/branch-summary-message.js.map +1 -0
- package/dist/modes/interactive/components/compaction-summary-message.d.ts +16 -0
- package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/compaction-summary-message.js +52 -0
- package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -0
- package/dist/modes/interactive/components/config-selector.d.ts +102 -0
- package/dist/modes/interactive/components/config-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/config-selector.js +771 -0
- package/dist/modes/interactive/components/config-selector.js.map +1 -0
- package/dist/modes/interactive/components/countdown-timer.d.ts +14 -0
- package/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -0
- package/dist/modes/interactive/components/countdown-timer.js +33 -0
- package/dist/modes/interactive/components/countdown-timer.js.map +1 -0
- package/dist/modes/interactive/components/custom-editor.d.ts +30 -0
- package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -0
- package/dist/modes/interactive/components/custom-editor.js +115 -0
- package/dist/modes/interactive/components/custom-editor.js.map +1 -0
- package/dist/modes/interactive/components/custom-entry.d.ts +19 -0
- package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -0
- package/dist/modes/interactive/components/custom-entry.js +52 -0
- package/dist/modes/interactive/components/custom-entry.js.map +1 -0
- package/dist/modes/interactive/components/custom-message.d.ts +22 -0
- package/dist/modes/interactive/components/custom-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/custom-message.js +87 -0
- package/dist/modes/interactive/components/custom-message.js.map +1 -0
- package/dist/modes/interactive/components/diff.d.ts +12 -0
- package/dist/modes/interactive/components/diff.d.ts.map +1 -0
- package/dist/modes/interactive/components/diff.js +133 -0
- package/dist/modes/interactive/components/diff.js.map +1 -0
- package/dist/modes/interactive/components/dynamic-border.d.ts +15 -0
- package/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -0
- package/dist/modes/interactive/components/dynamic-border.js +21 -0
- package/dist/modes/interactive/components/dynamic-border.js.map +1 -0
- package/dist/modes/interactive/components/earendil-announcement.d.ts +5 -0
- package/dist/modes/interactive/components/earendil-announcement.d.ts.map +1 -0
- package/dist/modes/interactive/components/earendil-announcement.js +40 -0
- package/dist/modes/interactive/components/earendil-announcement.js.map +1 -0
- package/dist/modes/interactive/components/easter-egg-3d.d.ts +104 -0
- package/dist/modes/interactive/components/easter-egg-3d.d.ts.map +1 -0
- package/dist/modes/interactive/components/easter-egg-3d.js +1141 -0
- package/dist/modes/interactive/components/easter-egg-3d.js.map +1 -0
- package/dist/modes/interactive/components/easter-egg-3d.lazy.d.ts +6 -0
- package/dist/modes/interactive/components/easter-egg-3d.lazy.d.ts.map +1 -0
- package/dist/modes/interactive/components/easter-egg-3d.lazy.js +23 -0
- package/dist/modes/interactive/components/easter-egg-3d.lazy.js.map +1 -0
- package/dist/modes/interactive/components/extension-editor.d.ts +24 -0
- package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -0
- package/dist/modes/interactive/components/extension-editor.js +103 -0
- package/dist/modes/interactive/components/extension-editor.js.map +1 -0
- package/dist/modes/interactive/components/extension-input.d.ts +25 -0
- package/dist/modes/interactive/components/extension-input.d.ts.map +1 -0
- package/dist/modes/interactive/components/extension-input.js +67 -0
- package/dist/modes/interactive/components/extension-input.js.map +1 -0
- package/dist/modes/interactive/components/extension-selector.d.ts +27 -0
- package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/extension-selector.js +87 -0
- package/dist/modes/interactive/components/extension-selector.js.map +1 -0
- package/dist/modes/interactive/components/first-time-setup.d.ts +25 -0
- package/dist/modes/interactive/components/first-time-setup.d.ts.map +1 -0
- package/dist/modes/interactive/components/first-time-setup.js +109 -0
- package/dist/modes/interactive/components/first-time-setup.js.map +1 -0
- package/dist/modes/interactive/components/footer.d.ts +39 -0
- package/dist/modes/interactive/components/footer.d.ts.map +1 -0
- package/dist/modes/interactive/components/footer.js +265 -0
- package/dist/modes/interactive/components/footer.js.map +1 -0
- package/dist/modes/interactive/components/index.d.ts +33 -0
- package/dist/modes/interactive/components/index.d.ts.map +1 -0
- package/dist/modes/interactive/components/index.js +34 -0
- package/dist/modes/interactive/components/index.js.map +1 -0
- package/dist/modes/interactive/components/keybinding-hints.d.ts +13 -0
- package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -0
- package/dist/modes/interactive/components/keybinding-hints.js +36 -0
- package/dist/modes/interactive/components/keybinding-hints.js.map +1 -0
- package/dist/modes/interactive/components/login-dialog.d.ts +54 -0
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -0
- package/dist/modes/interactive/components/login-dialog.js +194 -0
- package/dist/modes/interactive/components/login-dialog.js.map +1 -0
- package/dist/modes/interactive/components/markdown-transform.d.ts +3 -0
- package/dist/modes/interactive/components/markdown-transform.d.ts.map +1 -0
- package/dist/modes/interactive/components/markdown-transform.js +19 -0
- package/dist/modes/interactive/components/markdown-transform.js.map +1 -0
- package/dist/modes/interactive/components/mermaid.d.ts +11 -0
- package/dist/modes/interactive/components/mermaid.d.ts.map +1 -0
- package/dist/modes/interactive/components/mermaid.js +75 -0
- package/dist/modes/interactive/components/mermaid.js.map +1 -0
- package/dist/modes/interactive/components/model-selector.d.ts +60 -0
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/model-selector.js +361 -0
- package/dist/modes/interactive/components/model-selector.js.map +1 -0
- package/dist/modes/interactive/components/oauth-selector.d.ts +39 -0
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/oauth-selector.js +166 -0
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -0
- package/dist/modes/interactive/components/relay-logo.d.ts +22 -0
- package/dist/modes/interactive/components/relay-logo.d.ts.map +1 -0
- package/dist/modes/interactive/components/relay-logo.js +63 -0
- package/dist/modes/interactive/components/relay-logo.js.map +1 -0
- package/dist/modes/interactive/components/scoped-models-selector.d.ts +46 -0
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/scoped-models-selector.js +326 -0
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -0
- package/dist/modes/interactive/components/session-selector-search.d.ts +23 -0
- package/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -0
- package/dist/modes/interactive/components/session-selector-search.js +155 -0
- package/dist/modes/interactive/components/session-selector-search.js.map +1 -0
- package/dist/modes/interactive/components/session-selector.d.ts +95 -0
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/session-selector.js +893 -0
- package/dist/modes/interactive/components/session-selector.js.map +1 -0
- package/dist/modes/interactive/components/settings-selector.d.ts +96 -0
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/settings-selector.js +742 -0
- package/dist/modes/interactive/components/settings-selector.js.map +1 -0
- package/dist/modes/interactive/components/settings-submenu.d.ts +72 -0
- package/dist/modes/interactive/components/settings-submenu.d.ts.map +1 -0
- package/dist/modes/interactive/components/settings-submenu.js +165 -0
- package/dist/modes/interactive/components/settings-submenu.js.map +1 -0
- package/dist/modes/interactive/components/show-images-selector.d.ts +10 -0
- package/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/show-images-selector.js +39 -0
- package/dist/modes/interactive/components/show-images-selector.js.map +1 -0
- package/dist/modes/interactive/components/skill-invocation-message.d.ts +17 -0
- package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/skill-invocation-message.js +54 -0
- package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -0
- package/dist/modes/interactive/components/status-indicator.d.ts +30 -0
- package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -0
- package/dist/modes/interactive/components/status-indicator.js +67 -0
- package/dist/modes/interactive/components/status-indicator.js.map +1 -0
- package/dist/modes/interactive/components/theme-selector.d.ts +11 -0
- package/dist/modes/interactive/components/theme-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/theme-selector.js +50 -0
- package/dist/modes/interactive/components/theme-selector.js.map +1 -0
- package/dist/modes/interactive/components/themed-text.d.ts +17 -0
- package/dist/modes/interactive/components/themed-text.d.ts.map +1 -0
- package/dist/modes/interactive/components/themed-text.js +29 -0
- package/dist/modes/interactive/components/themed-text.js.map +1 -0
- package/dist/modes/interactive/components/thinking-selector.d.ts +23 -0
- package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/thinking-selector.js +109 -0
- package/dist/modes/interactive/components/thinking-selector.js.map +1 -0
- package/dist/modes/interactive/components/tool-execution.d.ts +68 -0
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -0
- package/dist/modes/interactive/components/tool-execution.js +314 -0
- package/dist/modes/interactive/components/tool-execution.js.map +1 -0
- package/dist/modes/interactive/components/tree-selector.d.ts +94 -0
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/tree-selector.js +1254 -0
- package/dist/modes/interactive/components/tree-selector.js.map +1 -0
- package/dist/modes/interactive/components/trust-selector.d.ts +23 -0
- package/dist/modes/interactive/components/trust-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/trust-selector.js +91 -0
- package/dist/modes/interactive/components/trust-selector.js.map +1 -0
- package/dist/modes/interactive/components/user-message-selector.d.ts +30 -0
- package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/user-message-selector.js +114 -0
- package/dist/modes/interactive/components/user-message-selector.js.map +1 -0
- package/dist/modes/interactive/components/user-message.d.ts +16 -0
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/user-message.js +50 -0
- package/dist/modes/interactive/components/user-message.js.map +1 -0
- package/dist/modes/interactive/components/visual-truncate.d.ts +48 -0
- package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -0
- package/dist/modes/interactive/components/visual-truncate.js +66 -0
- package/dist/modes/interactive/components/visual-truncate.js.map +1 -0
- package/dist/modes/interactive/external-editor.d.ts +12 -0
- package/dist/modes/interactive/external-editor.d.ts.map +1 -0
- package/dist/modes/interactive/external-editor.js +38 -0
- package/dist/modes/interactive/external-editor.js.map +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts +482 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-mode.js +5861 -0
- package/dist/modes/interactive/interactive-mode.js.map +1 -0
- package/dist/modes/interactive/model-catalog-refresh.d.ts +7 -0
- package/dist/modes/interactive/model-catalog-refresh.d.ts.map +1 -0
- package/dist/modes/interactive/model-catalog-refresh.js +34 -0
- package/dist/modes/interactive/model-catalog-refresh.js.map +1 -0
- package/dist/modes/interactive/model-search.d.ts +12 -0
- package/dist/modes/interactive/model-search.d.ts.map +1 -0
- package/dist/modes/interactive/model-search.js +15 -0
- package/dist/modes/interactive/model-search.js.map +1 -0
- package/dist/modes/interactive/session-share.d.ts +16 -0
- package/dist/modes/interactive/session-share.d.ts.map +1 -0
- package/dist/modes/interactive/session-share.js +119 -0
- package/dist/modes/interactive/session-share.js.map +1 -0
- package/dist/modes/interactive/theme/dark.json +78 -0
- package/dist/modes/interactive/theme/light.json +78 -0
- package/dist/modes/interactive/theme/system-theme.d.ts +55 -0
- package/dist/modes/interactive/theme/system-theme.d.ts.map +1 -0
- package/dist/modes/interactive/theme/system-theme.js +546 -0
- package/dist/modes/interactive/theme/system-theme.js.map +1 -0
- package/dist/modes/interactive/theme/theme-controller.d.ts +81 -0
- package/dist/modes/interactive/theme/theme-controller.d.ts.map +1 -0
- package/dist/modes/interactive/theme/theme-controller.js +210 -0
- package/dist/modes/interactive/theme/theme-controller.js.map +1 -0
- package/dist/modes/interactive/theme/theme-json.d.ts +85 -0
- package/dist/modes/interactive/theme/theme-json.d.ts.map +1 -0
- package/dist/modes/interactive/theme/theme-json.js +132 -0
- package/dist/modes/interactive/theme/theme-json.js.map +1 -0
- package/dist/modes/interactive/theme/theme-schema.json +361 -0
- package/dist/modes/interactive/theme/theme.d.ts +158 -0
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -0
- package/dist/modes/interactive/theme/theme.js +912 -0
- package/dist/modes/interactive/theme/theme.js.map +1 -0
- package/dist/modes/interactive/tui-renderer.d.ts +22 -0
- package/dist/modes/interactive/tui-renderer.d.ts.map +1 -0
- package/dist/modes/interactive/tui-renderer.js +67 -0
- package/dist/modes/interactive/tui-renderer.js.map +1 -0
- package/dist/modes/json-event.d.ts +34 -0
- package/dist/modes/json-event.d.ts.map +1 -0
- package/dist/modes/json-event.js +29 -0
- package/dist/modes/json-event.js.map +1 -0
- package/dist/modes/print-mode.d.ts +28 -0
- package/dist/modes/print-mode.d.ts.map +1 -0
- package/dist/modes/print-mode.js +142 -0
- package/dist/modes/print-mode.js.map +1 -0
- package/dist/modes/rpc/jsonl.d.ts +17 -0
- package/dist/modes/rpc/jsonl.d.ts.map +1 -0
- package/dist/modes/rpc/jsonl.js +49 -0
- package/dist/modes/rpc/jsonl.js.map +1 -0
- package/dist/modes/rpc/rpc-client.d.ts +254 -0
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-client.js +499 -0
- package/dist/modes/rpc/rpc-client.js.map +1 -0
- package/dist/modes/rpc/rpc-mode.d.ts +20 -0
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-mode.js +655 -0
- package/dist/modes/rpc/rpc-mode.js.map +1 -0
- package/dist/modes/rpc/rpc-types.d.ts +478 -0
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-types.js +8 -0
- package/dist/modes/rpc/rpc-types.js.map +1 -0
- package/dist/package-manager-cli.d.ts +8 -0
- package/dist/package-manager-cli.d.ts.map +1 -0
- package/dist/package-manager-cli.js +524 -0
- package/dist/package-manager-cli.js.map +1 -0
- package/dist/rpc-entry.d.ts +3 -0
- package/dist/rpc-entry.d.ts.map +1 -0
- package/dist/rpc-entry.js +11 -0
- package/dist/rpc-entry.js.map +1 -0
- package/dist/utils/abort.d.ts +5 -0
- package/dist/utils/abort.d.ts.map +1 -0
- package/dist/utils/abort.js +48 -0
- package/dist/utils/abort.js.map +1 -0
- package/dist/utils/ansi.d.ts +2 -0
- package/dist/utils/ansi.d.ts.map +1 -0
- package/dist/utils/ansi.js +52 -0
- package/dist/utils/ansi.js.map +1 -0
- package/dist/utils/changelog.d.ts +22 -0
- package/dist/utils/changelog.d.ts.map +1 -0
- package/dist/utils/changelog.js +176 -0
- package/dist/utils/changelog.js.map +1 -0
- package/dist/utils/child-process.d.ts +18 -0
- package/dist/utils/child-process.d.ts.map +1 -0
- package/dist/utils/child-process.js +106 -0
- package/dist/utils/child-process.js.map +1 -0
- package/dist/utils/clipboard-command.d.ts +7 -0
- package/dist/utils/clipboard-command.d.ts.map +1 -0
- package/dist/utils/clipboard-command.js +45 -0
- package/dist/utils/clipboard-command.js.map +1 -0
- package/dist/utils/clipboard-image.d.ts +11 -0
- package/dist/utils/clipboard-image.d.ts.map +1 -0
- package/dist/utils/clipboard-image.js +214 -0
- package/dist/utils/clipboard-image.js.map +1 -0
- package/dist/utils/clipboard.d.ts +6 -0
- package/dist/utils/clipboard.d.ts.map +1 -0
- package/dist/utils/clipboard.js +156 -0
- package/dist/utils/clipboard.js.map +1 -0
- package/dist/utils/deprecation.d.ts +4 -0
- package/dist/utils/deprecation.d.ts.map +1 -0
- package/dist/utils/deprecation.js +13 -0
- package/dist/utils/deprecation.js.map +1 -0
- package/dist/utils/exif-orientation.d.ts +5 -0
- package/dist/utils/exif-orientation.d.ts.map +1 -0
- package/dist/utils/exif-orientation.js +157 -0
- package/dist/utils/exif-orientation.js.map +1 -0
- package/dist/utils/frontmatter.d.ts +8 -0
- package/dist/utils/frontmatter.d.ts.map +1 -0
- package/dist/utils/frontmatter.js +27 -0
- package/dist/utils/frontmatter.js.map +1 -0
- package/dist/utils/fs-watch.d.ts +5 -0
- package/dist/utils/fs-watch.d.ts.map +1 -0
- package/dist/utils/fs-watch.js +25 -0
- package/dist/utils/fs-watch.js.map +1 -0
- package/dist/utils/git.d.ts +26 -0
- package/dist/utils/git.d.ts.map +1 -0
- package/dist/utils/git.js +195 -0
- package/dist/utils/git.js.map +1 -0
- package/dist/utils/html.d.ts +7 -0
- package/dist/utils/html.d.ts.map +1 -0
- package/dist/utils/html.js +40 -0
- package/dist/utils/html.js.map +1 -0
- package/dist/utils/image-convert.d.ts +22 -0
- package/dist/utils/image-convert.d.ts.map +1 -0
- package/dist/utils/image-convert.js +84 -0
- package/dist/utils/image-convert.js.map +1 -0
- package/dist/utils/image-process.d.ts +18 -0
- package/dist/utils/image-process.d.ts.map +1 -0
- package/dist/utils/image-process.js +83 -0
- package/dist/utils/image-process.js.map +1 -0
- package/dist/utils/image-resize-core.d.ts +30 -0
- package/dist/utils/image-resize-core.d.ts.map +1 -0
- package/dist/utils/image-resize-core.js +124 -0
- package/dist/utils/image-resize-core.js.map +1 -0
- package/dist/utils/image-resize-worker.d.ts +2 -0
- package/dist/utils/image-resize-worker.d.ts.map +1 -0
- package/dist/utils/image-resize-worker.js +31 -0
- package/dist/utils/image-resize-worker.js.map +1 -0
- package/dist/utils/image-resize.d.ts +16 -0
- package/dist/utils/image-resize.d.ts.map +1 -0
- package/dist/utils/image-resize.js +97 -0
- package/dist/utils/image-resize.js.map +1 -0
- package/dist/utils/json.d.ts +3 -0
- package/dist/utils/json.d.ts.map +1 -0
- package/dist/utils/json.js +7 -0
- package/dist/utils/json.js.map +1 -0
- package/dist/utils/management-http.d.ts +25 -0
- package/dist/utils/management-http.d.ts.map +1 -0
- package/dist/utils/management-http.js +54 -0
- package/dist/utils/management-http.js.map +1 -0
- package/dist/utils/mime.d.ts +3 -0
- package/dist/utils/mime.d.ts.map +1 -0
- package/dist/utils/mime.js +110 -0
- package/dist/utils/mime.js.map +1 -0
- package/dist/utils/open-browser.d.ts +9 -0
- package/dist/utils/open-browser.d.ts.map +1 -0
- package/dist/utils/open-browser.js +22 -0
- package/dist/utils/open-browser.js.map +1 -0
- package/dist/utils/output-files.d.ts +15 -0
- package/dist/utils/output-files.d.ts.map +1 -0
- package/dist/utils/output-files.js +30 -0
- package/dist/utils/output-files.js.map +1 -0
- package/dist/utils/paths.d.ts +34 -0
- package/dist/utils/paths.d.ts.map +1 -0
- package/dist/utils/paths.js +115 -0
- package/dist/utils/paths.js.map +1 -0
- package/dist/utils/photon.d.ts +21 -0
- package/dist/utils/photon.d.ts.map +1 -0
- package/dist/utils/photon.js +121 -0
- package/dist/utils/photon.js.map +1 -0
- package/dist/utils/relay-user-agent.d.ts +2 -0
- package/dist/utils/relay-user-agent.d.ts.map +1 -0
- package/dist/utils/relay-user-agent.js +5 -0
- package/dist/utils/relay-user-agent.js.map +1 -0
- package/dist/utils/shell.d.ts +32 -0
- package/dist/utils/shell.d.ts.map +1 -0
- package/dist/utils/shell.js +189 -0
- package/dist/utils/shell.js.map +1 -0
- package/dist/utils/sleep.d.ts +5 -0
- package/dist/utils/sleep.d.ts.map +1 -0
- package/dist/utils/sleep.js +17 -0
- package/dist/utils/sleep.js.map +1 -0
- package/dist/utils/syntax-highlight.d.ts +13 -0
- package/dist/utils/syntax-highlight.d.ts.map +1 -0
- package/dist/utils/syntax-highlight.js +179 -0
- package/dist/utils/syntax-highlight.js.map +1 -0
- package/dist/utils/text.d.ts +8 -0
- package/dist/utils/text.d.ts.map +1 -0
- package/dist/utils/text.js +9 -0
- package/dist/utils/text.js.map +1 -0
- package/dist/utils/tool-result-images.d.ts +21 -0
- package/dist/utils/tool-result-images.d.ts.map +1 -0
- package/dist/utils/tool-result-images.js +48 -0
- package/dist/utils/tool-result-images.js.map +1 -0
- package/dist/utils/tools-manager.d.ts +13 -0
- package/dist/utils/tools-manager.d.ts.map +1 -0
- package/dist/utils/tools-manager.js +343 -0
- package/dist/utils/tools-manager.js.map +1 -0
- package/dist/utils/version-check.d.ts +17 -0
- package/dist/utils/version-check.d.ts.map +1 -0
- package/dist/utils/version-check.js +74 -0
- package/dist/utils/version-check.js.map +1 -0
- package/dist/utils/wsl.d.ts +3 -0
- package/dist/utils/wsl.d.ts.map +1 -0
- package/dist/utils/wsl.js +15 -0
- package/dist/utils/wsl.js.map +1 -0
- package/dist/utils/zip.d.ts +7 -0
- package/dist/utils/zip.d.ts.map +1 -0
- package/dist/utils/zip.js +60 -0
- package/dist/utils/zip.js.map +1 -0
- package/docs/cli-integration.md +106 -0
- package/docs/cli.md +316 -0
- package/docs/codemode.md +207 -0
- package/docs/compaction.md +463 -0
- package/docs/configuration.md +47 -0
- package/docs/containerization.md +154 -0
- package/docs/custom-provider.md +173 -0
- package/docs/docs.json +224 -0
- package/docs/environment-variables.md +97 -0
- package/docs/extensions.md +274 -0
- package/docs/harness-core.md +99 -0
- package/docs/how-relay-works.md +49 -0
- package/docs/images/doom-extension.png +0 -0
- package/docs/images/exy.png +0 -0
- package/docs/images/interactive-mode.png +0 -0
- package/docs/images/tree-view.png +0 -0
- package/docs/index.md +39 -0
- package/docs/intake.md +40 -0
- package/docs/json.md +226 -0
- package/docs/keybindings.md +194 -0
- package/docs/laya.md +112 -0
- package/docs/llama-cpp.md +114 -0
- package/docs/mcp.md +258 -0
- package/docs/message-types.md +261 -0
- package/docs/models.md +205 -0
- package/docs/packages.md +129 -0
- package/docs/prompt-templates.md +59 -0
- package/docs/providers.md +187 -0
- package/docs/quickstart.md +126 -0
- package/docs/rpc-commands.md +860 -0
- package/docs/rpc-extension-ui.md +200 -0
- package/docs/rpc.md +193 -0
- package/docs/sdk.md +147 -0
- package/docs/security.md +99 -0
- package/docs/session-format.md +293 -0
- package/docs/sessions.md +66 -0
- package/docs/settings.md +205 -0
- package/docs/shell-aliases.md +93 -0
- package/docs/skills.md +93 -0
- package/docs/slash-commands.md +61 -0
- package/docs/terminal-setup.md +219 -0
- package/docs/termux.md +121 -0
- package/docs/themes.md +136 -0
- package/docs/tmux.md +55 -0
- package/docs/tui.md +125 -0
- package/docs/usage.md +94 -0
- package/docs/virtual-models.md +114 -0
- package/docs/windows.md +67 -0
- package/examples/README.md +39 -0
- package/examples/extensions/README.md +213 -0
- package/examples/extensions/auto-commit-on-exit.ts +49 -0
- package/examples/extensions/bash-spawn-hook.ts +30 -0
- package/examples/extensions/bookmark.ts +50 -0
- package/examples/extensions/border-status-editor.ts +150 -0
- package/examples/extensions/built-in-tool-renderer.ts +225 -0
- package/examples/extensions/claude-rules.ts +86 -0
- package/examples/extensions/commands.ts +72 -0
- package/examples/extensions/confirm-destructive.ts +59 -0
- package/examples/extensions/custom-compaction.ts +117 -0
- package/examples/extensions/custom-footer.ts +64 -0
- package/examples/extensions/custom-header.ts +73 -0
- package/examples/extensions/custom-provider-anthropic/index.ts +617 -0
- package/examples/extensions/custom-provider-anthropic/package-lock.json +24 -0
- package/examples/extensions/custom-provider-anthropic/package.json +19 -0
- package/examples/extensions/custom-provider-gitlab-duo/index.ts +405 -0
- package/examples/extensions/custom-provider-gitlab-duo/package.json +16 -0
- package/examples/extensions/custom-provider-gitlab-duo/test.ts +82 -0
- package/examples/extensions/debug-provider.ts +90 -0
- package/examples/extensions/dirty-repo-guard.ts +56 -0
- package/examples/extensions/doom-overlay/README.md +46 -0
- package/examples/extensions/doom-overlay/doom/build/doom.js +21 -0
- package/examples/extensions/doom-overlay/doom/build/doom.wasm +0 -0
- package/examples/extensions/doom-overlay/doom/build.sh +152 -0
- package/examples/extensions/doom-overlay/doom/doomgeneric_relay.c +72 -0
- package/examples/extensions/doom-overlay/doom-component.ts +132 -0
- package/examples/extensions/doom-overlay/doom-engine.ts +173 -0
- package/examples/extensions/doom-overlay/doom-keys.ts +104 -0
- package/examples/extensions/doom-overlay/index.ts +74 -0
- package/examples/extensions/doom-overlay/wad-finder.ts +55 -0
- package/examples/extensions/dynamic-resources/SKILL.md +8 -0
- package/examples/extensions/dynamic-resources/dynamic.json +81 -0
- package/examples/extensions/dynamic-resources/dynamic.md +5 -0
- package/examples/extensions/dynamic-resources/index.ts +15 -0
- package/examples/extensions/dynamic-tools.ts +74 -0
- package/examples/extensions/entry-renderer.ts +41 -0
- package/examples/extensions/event-bus.ts +43 -0
- package/examples/extensions/file-trigger.ts +41 -0
- package/examples/extensions/git-checkpoint.ts +53 -0
- package/examples/extensions/git-merge-and-resolve.ts +115 -0
- package/examples/extensions/github-issue-autocomplete.ts +185 -0
- package/examples/extensions/handoff.ts +190 -0
- package/examples/extensions/hello.ts +26 -0
- package/examples/extensions/hidden-thinking-label.ts +53 -0
- package/examples/extensions/inline-bash.ts +94 -0
- package/examples/extensions/input-transform-streaming.ts +39 -0
- package/examples/extensions/input-transform.ts +43 -0
- package/examples/extensions/interactive-shell.ts +196 -0
- package/examples/extensions/jev-router.ts +113 -0
- package/examples/extensions/mac-system-theme.ts +47 -0
- package/examples/extensions/message-renderer.ts +59 -0
- package/examples/extensions/minimal-mode.ts +354 -0
- package/examples/extensions/modal-editor.ts +85 -0
- package/examples/extensions/model-status.ts +31 -0
- package/examples/extensions/notify.ts +57 -0
- package/examples/extensions/overlay-qa-tests.ts +1450 -0
- package/examples/extensions/overlay-test.ts +153 -0
- package/examples/extensions/permission-gate.ts +34 -0
- package/examples/extensions/pirate.ts +47 -0
- package/examples/extensions/plan-mode/README.md +66 -0
- package/examples/extensions/plan-mode/index.ts +390 -0
- package/examples/extensions/plan-mode/utils.ts +168 -0
- package/examples/extensions/preset.ts +436 -0
- package/examples/extensions/project-trust.ts +64 -0
- package/examples/extensions/prompt-customizer.ts +49 -0
- package/examples/extensions/protected-paths.ts +30 -0
- package/examples/extensions/provider-payload.ts +18 -0
- package/examples/extensions/qna.ts +118 -0
- package/examples/extensions/question.ts +278 -0
- package/examples/extensions/questionnaire.ts +440 -0
- package/examples/extensions/rainbow-editor.ts +88 -0
- package/examples/extensions/reload-runtime.ts +37 -0
- package/examples/extensions/rpc-demo.ts +118 -0
- package/examples/extensions/sandbox/index.ts +321 -0
- package/examples/extensions/sandbox/package-lock.json +92 -0
- package/examples/extensions/sandbox/package.json +19 -0
- package/examples/extensions/send-user-message.ts +97 -0
- package/examples/extensions/session-name.ts +27 -0
- package/examples/extensions/shutdown-command.ts +63 -0
- package/examples/extensions/snake.ts +343 -0
- package/examples/extensions/space-invaders.ts +560 -0
- package/examples/extensions/ssh.ts +220 -0
- package/examples/extensions/status-line.ts +32 -0
- package/examples/extensions/structured-output.ts +65 -0
- package/examples/extensions/subagent/README.md +196 -0
- package/examples/extensions/subagent/agents/planner.md +37 -0
- package/examples/extensions/subagent/agents/reviewer.md +35 -0
- package/examples/extensions/subagent/agents/scout.md +50 -0
- package/examples/extensions/subagent/agents/security-auditor.md +20 -0
- package/examples/extensions/subagent/agents/verifier.md +31 -0
- package/examples/extensions/subagent/agents/worker.md +24 -0
- package/examples/extensions/subagent/agents.ts +157 -0
- package/examples/extensions/subagent/index.ts +1038 -0
- package/examples/extensions/subagent/prompts/implement-and-review.md +10 -0
- package/examples/extensions/subagent/prompts/implement-and-verify.md +10 -0
- package/examples/extensions/subagent/prompts/implement.md +10 -0
- package/examples/extensions/subagent/prompts/scout-and-plan.md +9 -0
- package/examples/extensions/subagent/skills/delegate/SKILL.md +48 -0
- package/examples/extensions/subagent/skills/security-audit/SKILL.md +108 -0
- package/examples/extensions/subagent/skills/security-audit/references/categories.md +130 -0
- package/examples/extensions/subagent/skills/security-audit/references/report.md +38 -0
- package/examples/extensions/summarize.ts +199 -0
- package/examples/extensions/system-prompt-header.ts +17 -0
- package/examples/extensions/tic-tac-toe.ts +1008 -0
- package/examples/extensions/timed-confirm.ts +70 -0
- package/examples/extensions/titlebar-spinner.ts +58 -0
- package/examples/extensions/todo.ts +297 -0
- package/examples/extensions/tool-override.ts +144 -0
- package/examples/extensions/tools.ts +146 -0
- package/examples/extensions/trigger-compact.ts +50 -0
- package/examples/extensions/truncated-tool.ts +195 -0
- package/examples/extensions/widget-placement.ts +9 -0
- package/examples/extensions/with-deps/index.ts +32 -0
- package/examples/extensions/with-deps/package-lock.json +31 -0
- package/examples/extensions/with-deps/package.json +22 -0
- package/examples/extensions/working-indicator.ts +123 -0
- package/examples/extensions/working-message-test.ts +25 -0
- package/examples/plugins/relay-example-plugin/README.md +38 -0
- package/examples/plugins/relay-example-plugin/package.json +10 -0
- package/examples/plugins/relay-example-plugin/src/contract.ts +13 -0
- package/examples/plugins/relay-example-plugin/src/session.ts +24 -0
- package/examples/plugins/relay-example-plugin/src/tui.ts +31 -0
- package/examples/rpc-client.ts +35 -0
- package/examples/rpc-extension-ui.ts +661 -0
- package/examples/sdk/01-minimal.ts +26 -0
- package/examples/sdk/02-custom-model.ts +49 -0
- package/examples/sdk/03-custom-prompt.ts +70 -0
- package/examples/sdk/04-skills.ts +55 -0
- package/examples/sdk/05-tools.ts +48 -0
- package/examples/sdk/06-extensions.ts +94 -0
- package/examples/sdk/07-context-files.ts +42 -0
- package/examples/sdk/08-prompt-templates.ts +51 -0
- package/examples/sdk/09-api-keys-and-oauth.ts +34 -0
- package/examples/sdk/10-settings.ts +53 -0
- package/examples/sdk/11-sessions.ts +52 -0
- package/examples/sdk/12-full-control.ts +74 -0
- package/examples/sdk/13-session-runtime.ts +67 -0
- package/examples/sdk/14-codemode-mcp.ts +61 -0
- package/examples/sdk/README.md +141 -0
- package/package.json +107 -5
|
@@ -0,0 +1,1141 @@
|
|
|
1
|
+
import { backgroundAnsi, colorToRgb, foregroundAnsi, getKeybindings, indexedColor, rgbColor, visibleWidth, } from "@relay-harness/tui";
|
|
2
|
+
import { theme } from "../theme/theme.js";
|
|
3
|
+
import { ARMIN_HEIGHT, ARMIN_WIDTH, isArminPixel } from "./armin.js";
|
|
4
|
+
import { formatKeyText } from "./keybinding-hints.js";
|
|
5
|
+
import { RELAY_LOGO_COLORS, RELAY_LOGO_PIXELS, RELAY_LOGO_WIDTH } from "./relay-logo.js";
|
|
6
|
+
const DEPTH = 0.7;
|
|
7
|
+
const FLY_START = 0.1;
|
|
8
|
+
const FLY_DURATION = 1.3;
|
|
9
|
+
/** Braille dots per pixel when a model without an origin appears, growing from a speck at the center. */
|
|
10
|
+
const START_SCALE = 0.1;
|
|
11
|
+
function createModel(columns, rows, pixel, options) {
|
|
12
|
+
const blocks = [];
|
|
13
|
+
for (let row = 0; row < rows; row++) {
|
|
14
|
+
for (let column = 0; column < columns; column++) {
|
|
15
|
+
const color = pixel(column, row);
|
|
16
|
+
if (color)
|
|
17
|
+
blocks.push({ home: [column, row, 0], color });
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return {
|
|
21
|
+
columns,
|
|
22
|
+
rows,
|
|
23
|
+
blocks,
|
|
24
|
+
cameraDistance: options.cameraDistance,
|
|
25
|
+
radius: Math.hypot(columns / 2, rows / 2, 1 + DEPTH / 2),
|
|
26
|
+
widthShare: options.widthShare,
|
|
27
|
+
puzzleMoves: (random) => options.puzzleMoves(random, blocks.length),
|
|
28
|
+
origin: options.origin,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function relayLogoPixel(column, row) {
|
|
32
|
+
const color = RELAY_LOGO_COLORS[RELAY_LOGO_PIXELS[row][column]];
|
|
33
|
+
return color && [color.r, color.g, color.b];
|
|
34
|
+
}
|
|
35
|
+
function relayLogoModel(origin) {
|
|
36
|
+
return createModel(RELAY_LOGO_WIDTH, RELAY_LOGO_PIXELS.length, relayLogoPixel, {
|
|
37
|
+
cameraDistance: 16,
|
|
38
|
+
widthShare: 0.35,
|
|
39
|
+
puzzleMoves: (random) => (random < 0.4 ? 2 : 1),
|
|
40
|
+
origin,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
function arminModel(color) {
|
|
44
|
+
return createModel(ARMIN_WIDTH, ARMIN_HEIGHT, (column, row) => (isArminPixel(column, row) ? color : undefined), {
|
|
45
|
+
// Far enough that the perspective stays mild for a figure about 36 blocks tall.
|
|
46
|
+
cameraDistance: 80,
|
|
47
|
+
widthShare: 0.45,
|
|
48
|
+
puzzleMoves: (random, blockCount) => Math.round(blockCount * (0.03 + random * 0.04)),
|
|
49
|
+
origin: undefined,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
// The sliding puzzle: after the model spun for a while, blocks slide into free neighboring cells, a few at a time.
|
|
53
|
+
// Each cycle shuffles, flies every block back home, and holds the model briefly.
|
|
54
|
+
const PUZZLE_START = FLY_START + FLY_DURATION + 3;
|
|
55
|
+
const PUZZLE_STEP = 0.3;
|
|
56
|
+
const PUZZLE_STEPS = 12;
|
|
57
|
+
const PUZZLE_RETURN = 1;
|
|
58
|
+
const PUZZLE_HOLD = 0.6;
|
|
59
|
+
const PUZZLE_CYCLE = PUZZLE_STEP * PUZZLE_STEPS + PUZZLE_RETURN + PUZZLE_HOLD;
|
|
60
|
+
const PUZZLE_MOVES = [
|
|
61
|
+
[1, 0, 0],
|
|
62
|
+
[-1, 0, 0],
|
|
63
|
+
[0, 1, 0],
|
|
64
|
+
[0, -1, 0],
|
|
65
|
+
[1, 0, 0],
|
|
66
|
+
[-1, 0, 0],
|
|
67
|
+
[0, 1, 0],
|
|
68
|
+
[0, -1, 0],
|
|
69
|
+
[0, 0, 1],
|
|
70
|
+
[0, 0, -1],
|
|
71
|
+
];
|
|
72
|
+
/** Block positions after each step of one shuffle cycle, starting at home. Deterministic per cycle. */
|
|
73
|
+
function shuffleSteps(model, cycle) {
|
|
74
|
+
const { columns, rows } = model;
|
|
75
|
+
let positions = model.blocks.map((block) => block.home);
|
|
76
|
+
const steps = [positions];
|
|
77
|
+
const lastMoved = new Set();
|
|
78
|
+
let random = cycle * 7_919 + 1;
|
|
79
|
+
const next = () => hash(random++);
|
|
80
|
+
const key = ([x, y, z]) => ((z + 1) * rows + y) * columns + x;
|
|
81
|
+
for (let step = 0; step < PUZZLE_STEPS; step++) {
|
|
82
|
+
const occupied = new Set(positions.map(key));
|
|
83
|
+
const nextPositions = [...positions];
|
|
84
|
+
const moved = new Set();
|
|
85
|
+
const moveCount = model.puzzleMoves(next());
|
|
86
|
+
for (let move = 0; move < moveCount; move++) {
|
|
87
|
+
const candidates = [];
|
|
88
|
+
for (let block = 0; block < positions.length; block++) {
|
|
89
|
+
if (moved.has(block))
|
|
90
|
+
continue;
|
|
91
|
+
const [x, y, z] = positions[block];
|
|
92
|
+
for (const [dx, dy, dz] of PUZZLE_MOVES) {
|
|
93
|
+
const target = [x + dx, y + dy, z + dz];
|
|
94
|
+
if (target[0] < 0 || target[0] >= columns || target[1] < 0 || target[1] >= rows)
|
|
95
|
+
continue;
|
|
96
|
+
if (target[2] < -1 || target[2] > 1 || occupied.has(key(target)))
|
|
97
|
+
continue;
|
|
98
|
+
candidates.push({ block, target });
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
// Prefer blocks that did not just move, so the puzzle does not look like one block jittering.
|
|
102
|
+
const fresh = candidates.filter((candidate) => !lastMoved.has(candidate.block));
|
|
103
|
+
const pool = fresh.length > 0 ? fresh : candidates;
|
|
104
|
+
const choice = pool[Math.floor(next() * pool.length)];
|
|
105
|
+
if (!choice)
|
|
106
|
+
break;
|
|
107
|
+
occupied.add(key(choice.target));
|
|
108
|
+
nextPositions[choice.block] = choice.target;
|
|
109
|
+
moved.add(choice.block);
|
|
110
|
+
}
|
|
111
|
+
lastMoved.clear();
|
|
112
|
+
for (const block of moved)
|
|
113
|
+
lastMoved.add(block);
|
|
114
|
+
positions = nextPositions;
|
|
115
|
+
steps.push(positions);
|
|
116
|
+
}
|
|
117
|
+
return steps;
|
|
118
|
+
}
|
|
119
|
+
const FRAME_MS = 1000 / 30;
|
|
120
|
+
const DUST_DURATION = 0.35;
|
|
121
|
+
const WAVE_SPREAD = 0.55;
|
|
122
|
+
const WAVE_JITTER = 0.12;
|
|
123
|
+
const DISSOLVE_END = FLY_START + WAVE_SPREAD + WAVE_JITTER + DUST_DURATION;
|
|
124
|
+
const BACKGROUND_FADE = 0.5;
|
|
125
|
+
const EXIT_DURATION = 1.1;
|
|
126
|
+
// A faint starfield fades in behind the logo once the screen has dissolved.
|
|
127
|
+
const STARS_START = 2.5;
|
|
128
|
+
const STARS_FADE = 2;
|
|
129
|
+
const STAR_DENSITY = 0.018;
|
|
130
|
+
// Star tints: neutral, pale blue, pale gold, and pale rose, each mixed half with the terminal's foreground.
|
|
131
|
+
const STAR_TINTS = [
|
|
132
|
+
[255, 255, 255],
|
|
133
|
+
[170, 195, 255],
|
|
134
|
+
[255, 225, 170],
|
|
135
|
+
[255, 190, 205],
|
|
136
|
+
];
|
|
137
|
+
const LOGO_COLOR_STEP = 5;
|
|
138
|
+
// On light backgrounds most of each braille cell shows the bright background, which washes the logo out. There,
|
|
139
|
+
// the logo gets a halo: its colors and coverage blurred into the cell backgrounds, strongest under the logo and
|
|
140
|
+
// fading out over HALO_RADIUS_X columns and HALO_RADIUS_Y rows (cells are about twice as tall as wide).
|
|
141
|
+
const LIGHT_HALO_STRENGTH = 0.3;
|
|
142
|
+
const HALO_RADIUS_X = 6;
|
|
143
|
+
const HALO_RADIUS_Y = 3;
|
|
144
|
+
const HALO_LEVELS = 32;
|
|
145
|
+
const STAR_ALPHA_LEVELS = 8;
|
|
146
|
+
const STAR_FLICKER_LEVELS = 3;
|
|
147
|
+
const HINT_FADE = 0.5;
|
|
148
|
+
// Braille dot bits, indexed by row * 2 + column within the 2x4 cell.
|
|
149
|
+
const DOT_BITS = [0x01, 0x08, 0x02, 0x10, 0x04, 0x20, 0x40, 0x80];
|
|
150
|
+
const BRAILLE = Array.from({ length: 256 }, (_, bits) => String.fromCharCode(0x2800 + bits));
|
|
151
|
+
const LIGHT = normalize([-0.45, -0.6, 0.75]);
|
|
152
|
+
const HALF_VECTOR = normalize([LIGHT[0], LIGHT[1], LIGHT[2] + 1]);
|
|
153
|
+
function normalize(v) {
|
|
154
|
+
const length = Math.hypot(v[0], v[1], v[2]);
|
|
155
|
+
return [v[0] / length, v[1] / length, v[2] / length];
|
|
156
|
+
}
|
|
157
|
+
function clamp01(value) {
|
|
158
|
+
return value < 0 ? 0 : value > 1 ? 1 : value;
|
|
159
|
+
}
|
|
160
|
+
/** Quintic smoothstep. */
|
|
161
|
+
function smooth(value) {
|
|
162
|
+
const t = clamp01(value);
|
|
163
|
+
return t * t * t * (t * (t * 6 - 15) + 10);
|
|
164
|
+
}
|
|
165
|
+
function easeOut(value) {
|
|
166
|
+
const t = 1 - clamp01(value);
|
|
167
|
+
return 1 - t * t * t;
|
|
168
|
+
}
|
|
169
|
+
function mix(a, b, amount) {
|
|
170
|
+
return [a[0] + (b[0] - a[0]) * amount, a[1] + (b[1] - a[1]) * amount, a[2] + (b[2] - a[2]) * amount];
|
|
171
|
+
}
|
|
172
|
+
function hash(value) {
|
|
173
|
+
let x = Math.imul(value ^ 0x9e3779b9, 0x85ebca6b);
|
|
174
|
+
x ^= x >>> 13;
|
|
175
|
+
x = Math.imul(x, 0xc2b2ae35);
|
|
176
|
+
x ^= x >>> 16;
|
|
177
|
+
return (x >>> 0) / 0x100000000;
|
|
178
|
+
}
|
|
179
|
+
/** Whether a background is light, by relative luminance. */
|
|
180
|
+
function isLight([r, g, b]) {
|
|
181
|
+
return 0.2126 * r + 0.7152 * g + 0.0722 * b > 128;
|
|
182
|
+
}
|
|
183
|
+
function toRgb(color) {
|
|
184
|
+
const { r, g, b } = colorToRgb(color);
|
|
185
|
+
return [r, g, b];
|
|
186
|
+
}
|
|
187
|
+
/** Braille dots a glyph turns into, a rough measure of how much ink it has. */
|
|
188
|
+
function glyphInk(text, seed) {
|
|
189
|
+
if (text.trim() === "")
|
|
190
|
+
return 0;
|
|
191
|
+
if (/^[.,:;'`\-_·]$/.test(text))
|
|
192
|
+
return 2;
|
|
193
|
+
if (/^[\u2500-\u257f]$/.test(text))
|
|
194
|
+
return 3;
|
|
195
|
+
return 4 + Math.floor(seed * 3);
|
|
196
|
+
}
|
|
197
|
+
const segmenter = new Intl.Segmenter();
|
|
198
|
+
/** Parse rendered lines into cells with resolved colors. Other escape sequences (OSC, APC, cursor) are skipped. */
|
|
199
|
+
function parseScreen(lines, width, foreground, background) {
|
|
200
|
+
const palette = (index) => toRgb(indexedColor(index));
|
|
201
|
+
return lines.map((line) => {
|
|
202
|
+
const cells = [];
|
|
203
|
+
let fg;
|
|
204
|
+
let bg;
|
|
205
|
+
let dim = false;
|
|
206
|
+
let inverse = false;
|
|
207
|
+
const applySgr = (params) => {
|
|
208
|
+
const codes = params === "" ? ["0"] : params.split(";");
|
|
209
|
+
for (let i = 0; i < codes.length; i++) {
|
|
210
|
+
const parts = codes[i].split(":").map((part) => Number.parseInt(part, 10));
|
|
211
|
+
const code = parts[0] ?? 0;
|
|
212
|
+
if (code === 38 || code === 48) {
|
|
213
|
+
// Extended color, either as `38;5;n` / `38;2;r;g;b` or colon sub-parameters.
|
|
214
|
+
let args;
|
|
215
|
+
if (parts.length > 1) {
|
|
216
|
+
args = parts.slice(1).filter((part) => !Number.isNaN(part));
|
|
217
|
+
// `38:2::r:g:b` has an empty color space id, dropped above.
|
|
218
|
+
}
|
|
219
|
+
else {
|
|
220
|
+
const kind = Number.parseInt(codes[i + 1] ?? "", 10);
|
|
221
|
+
const count = kind === 5 ? 2 : kind === 2 ? 4 : 1;
|
|
222
|
+
args = codes.slice(i + 1, i + 1 + count).map((part) => Number.parseInt(part, 10));
|
|
223
|
+
i += count;
|
|
224
|
+
}
|
|
225
|
+
let color;
|
|
226
|
+
if (args[0] === 5 && args[1] !== undefined)
|
|
227
|
+
color = palette(args[1]);
|
|
228
|
+
else if (args[0] === 2 && args.length >= 4)
|
|
229
|
+
color = [args[1], args[2], args[3]];
|
|
230
|
+
if (color) {
|
|
231
|
+
if (code === 38)
|
|
232
|
+
fg = color;
|
|
233
|
+
else
|
|
234
|
+
bg = color;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
else if (code === 0) {
|
|
238
|
+
fg = undefined;
|
|
239
|
+
bg = undefined;
|
|
240
|
+
dim = false;
|
|
241
|
+
inverse = false;
|
|
242
|
+
}
|
|
243
|
+
else if (code === 2)
|
|
244
|
+
dim = true;
|
|
245
|
+
else if (code === 22)
|
|
246
|
+
dim = false;
|
|
247
|
+
else if (code === 7)
|
|
248
|
+
inverse = true;
|
|
249
|
+
else if (code === 27)
|
|
250
|
+
inverse = false;
|
|
251
|
+
else if (code >= 30 && code <= 37)
|
|
252
|
+
fg = palette(code - 30);
|
|
253
|
+
else if (code >= 90 && code <= 97)
|
|
254
|
+
fg = palette(code - 90 + 8);
|
|
255
|
+
else if (code === 39)
|
|
256
|
+
fg = undefined;
|
|
257
|
+
else if (code >= 40 && code <= 47)
|
|
258
|
+
bg = palette(code - 40);
|
|
259
|
+
else if (code >= 100 && code <= 107)
|
|
260
|
+
bg = palette(code - 100 + 8);
|
|
261
|
+
else if (code === 49)
|
|
262
|
+
bg = undefined;
|
|
263
|
+
}
|
|
264
|
+
};
|
|
265
|
+
const pushText = (text) => {
|
|
266
|
+
for (const { segment } of segmenter.segment(text)) {
|
|
267
|
+
const glyphWidth = visibleWidth(segment);
|
|
268
|
+
if (glyphWidth === 0 || cells.length + glyphWidth > width)
|
|
269
|
+
continue;
|
|
270
|
+
let cellFg = fg ?? foreground;
|
|
271
|
+
let cellBg = bg;
|
|
272
|
+
if (inverse) {
|
|
273
|
+
cellFg = bg ?? background;
|
|
274
|
+
cellBg = fg ?? foreground;
|
|
275
|
+
}
|
|
276
|
+
if (dim)
|
|
277
|
+
cellFg = mix(cellFg, cellBg ?? background, 0.4);
|
|
278
|
+
const cell = { text: segment, width: glyphWidth, fg: cellFg, bg: cellBg, delay: 0, ink: 0, seed: 0 };
|
|
279
|
+
cells.push(cell);
|
|
280
|
+
if (glyphWidth === 2)
|
|
281
|
+
cells.push({ ...cell, text: "", width: 0 });
|
|
282
|
+
}
|
|
283
|
+
};
|
|
284
|
+
let i = 0;
|
|
285
|
+
while (i < line.length) {
|
|
286
|
+
const sequenceStart = line.indexOf("\x1b", i);
|
|
287
|
+
if (sequenceStart === -1) {
|
|
288
|
+
pushText(line.slice(i));
|
|
289
|
+
break;
|
|
290
|
+
}
|
|
291
|
+
if (sequenceStart > i)
|
|
292
|
+
pushText(line.slice(i, sequenceStart));
|
|
293
|
+
const kind = line[sequenceStart + 1];
|
|
294
|
+
if (kind === "[") {
|
|
295
|
+
let end = sequenceStart + 2;
|
|
296
|
+
while (end < line.length && (line.charCodeAt(end) < 0x40 || line.charCodeAt(end) > 0x7e))
|
|
297
|
+
end++;
|
|
298
|
+
if (line[end] === "m")
|
|
299
|
+
applySgr(line.slice(sequenceStart + 2, end));
|
|
300
|
+
i = end + 1;
|
|
301
|
+
}
|
|
302
|
+
else if (kind === "]" || kind === "_" || kind === "P" || kind === "^") {
|
|
303
|
+
// String sequences end at BEL or ST (ESC \).
|
|
304
|
+
const bell = line.indexOf("\x07", sequenceStart + 2);
|
|
305
|
+
const st = line.indexOf("\x1b\\", sequenceStart + 2);
|
|
306
|
+
if (bell === -1 && st === -1)
|
|
307
|
+
break;
|
|
308
|
+
i = bell !== -1 && (st === -1 || bell < st) ? bell + 1 : st + 2;
|
|
309
|
+
}
|
|
310
|
+
else {
|
|
311
|
+
i = sequenceStart + 2;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
return cells;
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
/** Row-major 3x3 rotation matrix for yaw (y), then pitch (x), then roll (z). */
|
|
318
|
+
function rotation(yaw, pitch, roll) {
|
|
319
|
+
const [sy, cy, sx, cx, sz, cz] = [
|
|
320
|
+
Math.sin(yaw),
|
|
321
|
+
Math.cos(yaw),
|
|
322
|
+
Math.sin(pitch),
|
|
323
|
+
Math.cos(pitch),
|
|
324
|
+
Math.sin(roll),
|
|
325
|
+
Math.cos(roll),
|
|
326
|
+
];
|
|
327
|
+
// Rz * Rx * Ry
|
|
328
|
+
const ry = [cy, 0, sy, 0, 1, 0, -sy, 0, cy];
|
|
329
|
+
const rx = [1, 0, 0, 0, cx, -sx, 0, sx, cx];
|
|
330
|
+
const rz = [cz, -sz, 0, sz, cz, 0, 0, 0, 1];
|
|
331
|
+
return multiply(rz, multiply(rx, ry));
|
|
332
|
+
}
|
|
333
|
+
function multiply(a, b) {
|
|
334
|
+
const result = new Array(9);
|
|
335
|
+
for (let row = 0; row < 3; row++) {
|
|
336
|
+
for (let column = 0; column < 3; column++) {
|
|
337
|
+
result[row * 3 + column] =
|
|
338
|
+
a[row * 3] * b[column] + a[row * 3 + 1] * b[3 + column] + a[row * 3 + 2] * b[6 + column];
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
return result;
|
|
342
|
+
}
|
|
343
|
+
// The spin is locked to the puzzle: one turn per cycle, facing the camera in the middle of each hold.
|
|
344
|
+
const SPIN_RAMP = 1.4;
|
|
345
|
+
const SPIN_SPEED = (Math.PI * 2) / PUZZLE_CYCLE;
|
|
346
|
+
// How much the spin slows down while facing the camera (and speeds up while facing away), from 0 to 1.
|
|
347
|
+
const SPIN_LINGER = 0.6;
|
|
348
|
+
const FIRST_FRONT_VIEW = PUZZLE_START + PUZZLE_STEP * PUZZLE_STEPS + PUZZLE_RETURN + PUZZLE_HOLD / 2;
|
|
349
|
+
/** Uniform spin that accelerates from rest over SPIN_RAMP, then turns at SPIN_SPEED. */
|
|
350
|
+
function baseSpinPhase(time) {
|
|
351
|
+
const elapsed = time - FLY_START;
|
|
352
|
+
if (elapsed <= 0)
|
|
353
|
+
return 0;
|
|
354
|
+
const u = elapsed / SPIN_RAMP;
|
|
355
|
+
// Integral of the quintic smoothstep ramp.
|
|
356
|
+
if (u < 1)
|
|
357
|
+
return SPIN_SPEED * SPIN_RAMP * (u ** 6 - 3 * u ** 5 + 2.5 * u ** 4);
|
|
358
|
+
return SPIN_SPEED * (SPIN_RAMP * 0.5 + elapsed - SPIN_RAMP);
|
|
359
|
+
}
|
|
360
|
+
// Extra rotation added during the flight, so the phase is a whole number of turns at every assembled front view.
|
|
361
|
+
const SPIN_ALIGNMENT = Math.PI * 2 - (baseSpinPhase(FIRST_FRONT_VIEW) % (Math.PI * 2));
|
|
362
|
+
/** Spin phase: whole turns exactly when the reassembled logo faces the camera. */
|
|
363
|
+
function spinPhase(time) {
|
|
364
|
+
return baseSpinPhase(time) + SPIN_ALIGNMENT * smooth((time - FLY_START) / FLY_DURATION);
|
|
365
|
+
}
|
|
366
|
+
/** Yaw of the logo. It matches the phase at whole turns but lingers there, so the logo reads from the front. */
|
|
367
|
+
function spinAngle(time) {
|
|
368
|
+
const phase = spinPhase(time);
|
|
369
|
+
return phase - SPIN_LINGER * Math.sin(phase);
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
* Renders the model's blocks into braille cells. Only faces that point at the camera and are not covered by a
|
|
373
|
+
* touching block are drawn. Each face is rasterized over its projected bounds by intersecting each dot's ray
|
|
374
|
+
* with the face's plane, with a depth buffer resolving overlaps. Buffers are reused between frames.
|
|
375
|
+
*/
|
|
376
|
+
class BlockRaster {
|
|
377
|
+
/** Braille dot bits per cell. */
|
|
378
|
+
bits = new Uint8Array(0);
|
|
379
|
+
/** Lit dots per cell. */
|
|
380
|
+
counts = new Uint8Array(0);
|
|
381
|
+
/** Summed RGB of the lit dots per cell. */
|
|
382
|
+
rgb = new Float32Array(0);
|
|
383
|
+
/** Halo tint strength per cell, from 0 to 1. Only set when a halo was requested. */
|
|
384
|
+
haloAmount = new Float32Array(0);
|
|
385
|
+
/** Halo color per cell. */
|
|
386
|
+
haloRgb = new Float32Array(0);
|
|
387
|
+
width = 0;
|
|
388
|
+
height = 0;
|
|
389
|
+
/** Ray parameter of the nearest hit per dot; smaller is nearer. */
|
|
390
|
+
depth = new Float32Array(0);
|
|
391
|
+
/** Face index + 1 of the nearest hit per dot, 0 for none. */
|
|
392
|
+
faceIds = new Uint16Array(0);
|
|
393
|
+
/** Cells written by the previous frame, cleared before the next one. */
|
|
394
|
+
dirty;
|
|
395
|
+
/** Cells with a halo from the previous frame, cleared before the next one. */
|
|
396
|
+
haloDirty;
|
|
397
|
+
cameraDistance;
|
|
398
|
+
constructor(cameraDistance) {
|
|
399
|
+
this.cameraDistance = cameraDistance;
|
|
400
|
+
}
|
|
401
|
+
render(width, height, pose, boxes, background, haloStrength) {
|
|
402
|
+
const dotWidth = width * 2;
|
|
403
|
+
const dotHeight = height * 4;
|
|
404
|
+
if (width !== this.width || height !== this.height) {
|
|
405
|
+
this.width = width;
|
|
406
|
+
this.height = height;
|
|
407
|
+
this.bits = new Uint8Array(width * height);
|
|
408
|
+
this.counts = new Uint8Array(width * height);
|
|
409
|
+
this.rgb = new Float32Array(width * height * 3);
|
|
410
|
+
this.haloAmount = new Float32Array(width * height);
|
|
411
|
+
this.haloRgb = new Float32Array(width * height * 3);
|
|
412
|
+
this.haloDirty = undefined;
|
|
413
|
+
this.depth = new Float32Array(dotWidth * dotHeight).fill(Infinity);
|
|
414
|
+
this.faceIds = new Uint16Array(dotWidth * dotHeight);
|
|
415
|
+
this.dirty = undefined;
|
|
416
|
+
}
|
|
417
|
+
else if (this.dirty) {
|
|
418
|
+
const { minX, minY, maxX, maxY } = this.dirty;
|
|
419
|
+
for (let row = minY; row <= maxY; row++) {
|
|
420
|
+
this.bits.fill(0, row * width + minX, row * width + maxX + 1);
|
|
421
|
+
this.counts.fill(0, row * width + minX, row * width + maxX + 1);
|
|
422
|
+
this.rgb.fill(0, (row * width + minX) * 3, (row * width + maxX + 1) * 3);
|
|
423
|
+
}
|
|
424
|
+
this.dirty = undefined;
|
|
425
|
+
}
|
|
426
|
+
if (this.haloDirty) {
|
|
427
|
+
const { minX, minY, maxX, maxY } = this.haloDirty;
|
|
428
|
+
for (let row = minY; row <= maxY; row++) {
|
|
429
|
+
this.haloAmount.fill(0, row * width + minX, row * width + maxX + 1);
|
|
430
|
+
this.haloRgb.fill(0, (row * width + minX) * 3, (row * width + maxX + 1) * 3);
|
|
431
|
+
}
|
|
432
|
+
this.haloDirty = undefined;
|
|
433
|
+
}
|
|
434
|
+
const m = rotation(pose.yaw, pose.pitch, pose.roll);
|
|
435
|
+
const { centerX, centerY, scale } = pose;
|
|
436
|
+
const cameraDistance = this.cameraDistance;
|
|
437
|
+
// The camera sits at (0, 0, cameraDistance) in camera space; object space is the transpose rotation.
|
|
438
|
+
const origin = [m[6] * cameraDistance, m[7] * cameraDistance, m[8] * cameraDistance];
|
|
439
|
+
const light = isLight(background);
|
|
440
|
+
const faces = this.visibleFaces(m, origin, pose, boxes, dotWidth, dotHeight, light);
|
|
441
|
+
if (faces.length === 0)
|
|
442
|
+
return;
|
|
443
|
+
let minX = dotWidth;
|
|
444
|
+
let minY = dotHeight;
|
|
445
|
+
let maxX = -1;
|
|
446
|
+
let maxY = -1;
|
|
447
|
+
for (const face of faces) {
|
|
448
|
+
minX = Math.min(minX, face.minX);
|
|
449
|
+
minY = Math.min(minY, face.minY);
|
|
450
|
+
maxX = Math.max(maxX, face.maxX);
|
|
451
|
+
maxY = Math.max(maxY, face.maxY);
|
|
452
|
+
}
|
|
453
|
+
if (maxX < minX || maxY < minY)
|
|
454
|
+
return;
|
|
455
|
+
const depth = this.depth;
|
|
456
|
+
const faceIds = this.faceIds;
|
|
457
|
+
for (let faceIndex = 0; faceIndex < faces.length; faceIndex++) {
|
|
458
|
+
const face = faces[faceIndex];
|
|
459
|
+
const a = face.axis;
|
|
460
|
+
const u = (a + 1) % 3;
|
|
461
|
+
const v = (a + 2) % 3;
|
|
462
|
+
const originA = origin[a];
|
|
463
|
+
const originU = origin[u];
|
|
464
|
+
const originV = origin[v];
|
|
465
|
+
// The ray direction in object space is linear in the dot position, so it is stepped per dot.
|
|
466
|
+
const stepA = m[a] / scale;
|
|
467
|
+
const stepU = m[u] / scale;
|
|
468
|
+
const stepV = m[v] / scale;
|
|
469
|
+
const sx = (face.minX + 0.5 - centerX) / scale;
|
|
470
|
+
for (let dotY = face.minY; dotY <= face.maxY; dotY++) {
|
|
471
|
+
const sy = (dotY + 0.5 - centerY) / scale;
|
|
472
|
+
let directionA = m[a] * sx + m[3 + a] * sy - m[6 + a] * cameraDistance;
|
|
473
|
+
let directionU = m[u] * sx + m[3 + u] * sy - m[6 + u] * cameraDistance;
|
|
474
|
+
let directionV = m[v] * sx + m[3 + v] * sy - m[6 + v] * cameraDistance;
|
|
475
|
+
let index = dotY * dotWidth + face.minX;
|
|
476
|
+
for (let dotX = face.minX; dotX <= face.maxX; dotX++, index++) {
|
|
477
|
+
const t = (face.plane - originA) / directionA;
|
|
478
|
+
if (t > 0 && t < depth[index]) {
|
|
479
|
+
const hitU = originU + t * directionU;
|
|
480
|
+
const hitV = originV + t * directionV;
|
|
481
|
+
if (hitU >= face.uMin && hitU <= face.uMax && hitV >= face.vMin && hitV <= face.vMax) {
|
|
482
|
+
depth[index] = t;
|
|
483
|
+
faceIds[index] = faceIndex + 1;
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
directionA += stepA;
|
|
487
|
+
directionU += stepU;
|
|
488
|
+
directionV += stepV;
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
// Shade the hit dots, pack them into braille cells, and reset the dot buffers for the next frame.
|
|
493
|
+
const bits = this.bits;
|
|
494
|
+
const counts = this.counts;
|
|
495
|
+
const rgb = this.rgb;
|
|
496
|
+
let cellMinX = width;
|
|
497
|
+
let cellMinY = height;
|
|
498
|
+
let cellMaxX = -1;
|
|
499
|
+
let cellMaxY = -1;
|
|
500
|
+
for (let dotY = minY; dotY <= maxY; dotY++) {
|
|
501
|
+
let index = dotY * dotWidth + minX;
|
|
502
|
+
for (let dotX = minX; dotX <= maxX; dotX++, index++) {
|
|
503
|
+
const id = faceIds[index];
|
|
504
|
+
if (id === 0)
|
|
505
|
+
continue;
|
|
506
|
+
const face = faces[id - 1];
|
|
507
|
+
// Points farther from the camera fade slightly toward the background for depth.
|
|
508
|
+
const fog = clamp01(0.15 - cameraDistance * (1 - depth[index]) * 0.12) * (light ? 0.5 : 1);
|
|
509
|
+
faceIds[index] = 0;
|
|
510
|
+
depth[index] = Infinity;
|
|
511
|
+
const cellX = dotX >> 1;
|
|
512
|
+
const cellY = dotY >> 2;
|
|
513
|
+
const cell = cellY * width + cellX;
|
|
514
|
+
bits[cell] |= DOT_BITS[(dotY & 3) * 2 + (dotX & 1)];
|
|
515
|
+
counts[cell]++;
|
|
516
|
+
rgb[cell * 3] += face.red + (background[0] - face.red) * fog;
|
|
517
|
+
rgb[cell * 3 + 1] += face.green + (background[1] - face.green) * fog;
|
|
518
|
+
rgb[cell * 3 + 2] += face.blue + (background[2] - face.blue) * fog;
|
|
519
|
+
if (cellX < cellMinX)
|
|
520
|
+
cellMinX = cellX;
|
|
521
|
+
if (cellX > cellMaxX)
|
|
522
|
+
cellMaxX = cellX;
|
|
523
|
+
if (cellY < cellMinY)
|
|
524
|
+
cellMinY = cellY;
|
|
525
|
+
if (cellY > cellMaxY)
|
|
526
|
+
cellMaxY = cellY;
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
if (cellMaxX >= 0)
|
|
530
|
+
this.dirty = { minX: cellMinX, minY: cellMinY, maxX: cellMaxX, maxY: cellMaxY };
|
|
531
|
+
if (haloStrength > 0)
|
|
532
|
+
this.renderHalo(haloStrength);
|
|
533
|
+
}
|
|
534
|
+
/**
|
|
535
|
+
* Blur the logo's coverage and color over neighboring cells with a separable tent filter, so the tint falls
|
|
536
|
+
* off smoothly past the logo's edges.
|
|
537
|
+
*/
|
|
538
|
+
renderHalo(strength) {
|
|
539
|
+
const cells = this.dirty;
|
|
540
|
+
if (!cells)
|
|
541
|
+
return;
|
|
542
|
+
const { width, height, counts, rgb } = this;
|
|
543
|
+
const minX = Math.max(0, cells.minX - HALO_RADIUS_X);
|
|
544
|
+
const maxX = Math.min(width - 1, cells.maxX + HALO_RADIUS_X);
|
|
545
|
+
const minY = Math.max(0, cells.minY - HALO_RADIUS_Y);
|
|
546
|
+
const maxY = Math.min(height - 1, cells.maxY + HALO_RADIUS_Y);
|
|
547
|
+
const regionWidth = maxX - minX + 1;
|
|
548
|
+
const tent = (radius) => {
|
|
549
|
+
const weights = Array.from({ length: radius * 2 + 1 }, (_, i) => radius + 1 - Math.abs(i - radius));
|
|
550
|
+
const total = weights.reduce((sum, weight) => sum + weight, 0);
|
|
551
|
+
return weights.map((weight) => weight / total);
|
|
552
|
+
};
|
|
553
|
+
const weightsX = tent(HALO_RADIUS_X);
|
|
554
|
+
const weightsY = tent(HALO_RADIUS_Y);
|
|
555
|
+
// Horizontal pass over the rows that contain the logo: coverage and premultiplied color per cell.
|
|
556
|
+
const rows = cells.maxY - cells.minY + 1;
|
|
557
|
+
const horizontal = new Float32Array(rows * regionWidth * 4);
|
|
558
|
+
for (let y = cells.minY; y <= cells.maxY; y++) {
|
|
559
|
+
for (let x = minX; x <= maxX; x++) {
|
|
560
|
+
let coverage = 0;
|
|
561
|
+
let red = 0;
|
|
562
|
+
let green = 0;
|
|
563
|
+
let blue = 0;
|
|
564
|
+
for (let dx = -HALO_RADIUS_X; dx <= HALO_RADIUS_X; dx++) {
|
|
565
|
+
const sourceX = x + dx;
|
|
566
|
+
if (sourceX < cells.minX || sourceX > cells.maxX)
|
|
567
|
+
continue;
|
|
568
|
+
const source = y * width + sourceX;
|
|
569
|
+
const count = counts[source];
|
|
570
|
+
if (count === 0)
|
|
571
|
+
continue;
|
|
572
|
+
const weight = weightsX[dx + HALO_RADIUS_X] / 8;
|
|
573
|
+
coverage += count * weight;
|
|
574
|
+
red += rgb[source * 3] * weight;
|
|
575
|
+
green += rgb[source * 3 + 1] * weight;
|
|
576
|
+
blue += rgb[source * 3 + 2] * weight;
|
|
577
|
+
}
|
|
578
|
+
const target = ((y - cells.minY) * regionWidth + (x - minX)) * 4;
|
|
579
|
+
horizontal[target] = coverage;
|
|
580
|
+
horizontal[target + 1] = red;
|
|
581
|
+
horizontal[target + 2] = green;
|
|
582
|
+
horizontal[target + 3] = blue;
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
// Vertical pass into the halo buffers.
|
|
586
|
+
for (let y = minY; y <= maxY; y++) {
|
|
587
|
+
for (let x = minX; x <= maxX; x++) {
|
|
588
|
+
let coverage = 0;
|
|
589
|
+
let red = 0;
|
|
590
|
+
let green = 0;
|
|
591
|
+
let blue = 0;
|
|
592
|
+
for (let dy = -HALO_RADIUS_Y; dy <= HALO_RADIUS_Y; dy++) {
|
|
593
|
+
const sourceY = y + dy;
|
|
594
|
+
if (sourceY < cells.minY || sourceY > cells.maxY)
|
|
595
|
+
continue;
|
|
596
|
+
const weight = weightsY[dy + HALO_RADIUS_Y];
|
|
597
|
+
const source = ((sourceY - cells.minY) * regionWidth + (x - minX)) * 4;
|
|
598
|
+
coverage += horizontal[source] * weight;
|
|
599
|
+
red += horizontal[source + 1] * weight;
|
|
600
|
+
green += horizontal[source + 2] * weight;
|
|
601
|
+
blue += horizontal[source + 3] * weight;
|
|
602
|
+
}
|
|
603
|
+
const target = y * width + x;
|
|
604
|
+
// Cells under the logo keep at least their own coverage, so faces stay solidly tinted.
|
|
605
|
+
const count = counts[target];
|
|
606
|
+
if (count > 0 && count / 8 > coverage) {
|
|
607
|
+
coverage = count / 8;
|
|
608
|
+
red = (rgb[target * 3] / count) * coverage;
|
|
609
|
+
green = (rgb[target * 3 + 1] / count) * coverage;
|
|
610
|
+
blue = (rgb[target * 3 + 2] / count) * coverage;
|
|
611
|
+
}
|
|
612
|
+
if (coverage <= 0)
|
|
613
|
+
continue;
|
|
614
|
+
// Quantized so neighboring cells usually share a background and its escape sequence.
|
|
615
|
+
const amount = Math.round(strength * Math.min(1, coverage) ** 0.7 * HALO_LEVELS) / HALO_LEVELS;
|
|
616
|
+
if (amount <= 0)
|
|
617
|
+
continue;
|
|
618
|
+
this.haloAmount[target] = amount;
|
|
619
|
+
this.haloRgb[target * 3] = Math.round(red / coverage / LOGO_COLOR_STEP) * LOGO_COLOR_STEP;
|
|
620
|
+
this.haloRgb[target * 3 + 1] = Math.round(green / coverage / LOGO_COLOR_STEP) * LOGO_COLOR_STEP;
|
|
621
|
+
this.haloRgb[target * 3 + 2] = Math.round(blue / coverage / LOGO_COLOR_STEP) * LOGO_COLOR_STEP;
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
this.haloDirty = { minX, minY, maxX, maxY };
|
|
625
|
+
}
|
|
626
|
+
visibleFaces(m, origin, pose, boxes, dotWidth, dotHeight, lightBackground) {
|
|
627
|
+
const faces = [];
|
|
628
|
+
const cameraDistance = this.cameraDistance;
|
|
629
|
+
for (const box of boxes) {
|
|
630
|
+
for (let a = 0; a < 3; a++) {
|
|
631
|
+
const u = (a + 1) % 3;
|
|
632
|
+
const v = (a + 2) % 3;
|
|
633
|
+
for (const side of [-1, 1]) {
|
|
634
|
+
const plane = side > 0 ? box.max[a] : box.min[a];
|
|
635
|
+
// Back faces point away from the camera.
|
|
636
|
+
if ((origin[a] - plane) * side <= 0)
|
|
637
|
+
continue;
|
|
638
|
+
// Faces pressed against a neighboring block are hidden. Positions are exact while blocks rest.
|
|
639
|
+
const covered = boxes.some((other) => other !== box &&
|
|
640
|
+
(side > 0 ? other.min[a] : other.max[a]) === plane &&
|
|
641
|
+
other.min[u] <= box.min[u] &&
|
|
642
|
+
other.max[u] >= box.max[u] &&
|
|
643
|
+
other.min[v] <= box.min[v] &&
|
|
644
|
+
other.max[v] >= box.max[v]);
|
|
645
|
+
if (covered)
|
|
646
|
+
continue;
|
|
647
|
+
let minX = Infinity;
|
|
648
|
+
let minY = Infinity;
|
|
649
|
+
let maxX = -Infinity;
|
|
650
|
+
let maxY = -Infinity;
|
|
651
|
+
const corner = [0, 0, 0];
|
|
652
|
+
for (const cornerU of [box.min[u], box.max[u]]) {
|
|
653
|
+
for (const cornerV of [box.min[v], box.max[v]]) {
|
|
654
|
+
corner[a] = plane;
|
|
655
|
+
corner[u] = cornerU;
|
|
656
|
+
corner[v] = cornerV;
|
|
657
|
+
const x = m[0] * corner[0] + m[1] * corner[1] + m[2] * corner[2];
|
|
658
|
+
const y = m[3] * corner[0] + m[4] * corner[1] + m[5] * corner[2];
|
|
659
|
+
const z = m[6] * corner[0] + m[7] * corner[1] + m[8] * corner[2];
|
|
660
|
+
const perspective = (pose.scale * cameraDistance) / (cameraDistance - z);
|
|
661
|
+
const screenX = pose.centerX + x * perspective;
|
|
662
|
+
const screenY = pose.centerY + y * perspective;
|
|
663
|
+
minX = Math.min(minX, screenX);
|
|
664
|
+
minY = Math.min(minY, screenY);
|
|
665
|
+
maxX = Math.max(maxX, screenX);
|
|
666
|
+
maxY = Math.max(maxY, screenY);
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
const face = {
|
|
670
|
+
minX: Math.max(0, Math.floor(minX)),
|
|
671
|
+
minY: Math.max(0, Math.floor(minY)),
|
|
672
|
+
maxX: Math.min(dotWidth - 1, Math.ceil(maxX)),
|
|
673
|
+
maxY: Math.min(dotHeight - 1, Math.ceil(maxY)),
|
|
674
|
+
};
|
|
675
|
+
if (face.maxX < face.minX || face.maxY < face.minY)
|
|
676
|
+
continue;
|
|
677
|
+
// Faces are flat, so lighting is computed once per face. The normal in camera space is a
|
|
678
|
+
// column of the rotation matrix.
|
|
679
|
+
const nx = m[a] * side;
|
|
680
|
+
const ny = m[3 + a] * side;
|
|
681
|
+
const nz = m[6 + a] * side;
|
|
682
|
+
const diffuse = Math.max(0, nx * LIGHT[0] + ny * LIGHT[1] + nz * LIGHT[2]);
|
|
683
|
+
const rim = Math.max(0, nx * 0.8 - nz * 0.3);
|
|
684
|
+
// On light backgrounds, highlights toward white would vanish, so faces only get darker than
|
|
685
|
+
// the brand colors there.
|
|
686
|
+
const specular = lightBackground
|
|
687
|
+
? 0
|
|
688
|
+
: Math.max(0, nx * HALF_VECTOR[0] + ny * HALF_VECTOR[1] + nz * HALF_VECTOR[2]) ** 24 * 0.6 * 255;
|
|
689
|
+
const light = lightBackground
|
|
690
|
+
? Math.min(1, 0.55 + diffuse * 0.45 + rim * 0.1)
|
|
691
|
+
: 0.45 + diffuse * 0.78 + rim * 0.25;
|
|
692
|
+
faces.push({
|
|
693
|
+
axis: a,
|
|
694
|
+
plane,
|
|
695
|
+
uMin: box.min[u],
|
|
696
|
+
uMax: box.max[u],
|
|
697
|
+
vMin: box.min[v],
|
|
698
|
+
vMax: box.max[v],
|
|
699
|
+
...face,
|
|
700
|
+
red: Math.min(255, box.color[0] * light + specular),
|
|
701
|
+
green: Math.min(255, box.color[1] * light + specular),
|
|
702
|
+
blue: Math.min(255, box.color[2] * light + specular),
|
|
703
|
+
});
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
return faces;
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
let playing = false;
|
|
711
|
+
/**
|
|
712
|
+
* Show the animation as a fullscreen overlay until it is dismissed. The overlay takes focus and mouse input and
|
|
713
|
+
* returns focus when hidden, so the rest of the UI keeps running underneath untouched.
|
|
714
|
+
*/
|
|
715
|
+
export async function playEasterEgg3d(tui, screen, egg) {
|
|
716
|
+
if (playing)
|
|
717
|
+
return;
|
|
718
|
+
playing = true;
|
|
719
|
+
// Fading needs the terminal's actual default colors; the theme only knows its own.
|
|
720
|
+
const reported = await tui.queryTerminalColors({ timeoutMs: 100 });
|
|
721
|
+
const dark = theme.appearance === "dark";
|
|
722
|
+
const toRgbTuple = (rgb, fallback) => rgb ? [rgb.r, rgb.g, rgb.b] : fallback;
|
|
723
|
+
const colors = {
|
|
724
|
+
foreground: toRgbTuple(reported.foreground, toRgb(theme.colors.text)),
|
|
725
|
+
background: toRgbTuple(reported.background, dark ? [0, 0, 0] : [255, 255, 255]),
|
|
726
|
+
};
|
|
727
|
+
if (tui.hasOverlay()) {
|
|
728
|
+
playing = false;
|
|
729
|
+
return;
|
|
730
|
+
}
|
|
731
|
+
const model = egg.kind === "armin"
|
|
732
|
+
? arminModel(toRgb(theme.colors.accent))
|
|
733
|
+
: relayLogoModel({ column: egg.column, row: egg.row });
|
|
734
|
+
const animation = new EasterEgg3dAnimation(tui, screen, model, colors, () => {
|
|
735
|
+
playing = false;
|
|
736
|
+
overlay.hide();
|
|
737
|
+
});
|
|
738
|
+
const overlay = tui.showOverlay(animation, { anchor: "top-left", width: "100%", maxHeight: "100%" });
|
|
739
|
+
}
|
|
740
|
+
export class EasterEgg3dAnimation {
|
|
741
|
+
tui;
|
|
742
|
+
/** The screen to dissolve, as rendered lines. */
|
|
743
|
+
screen;
|
|
744
|
+
model;
|
|
745
|
+
foreground;
|
|
746
|
+
background;
|
|
747
|
+
onDone;
|
|
748
|
+
startTime = performance.now();
|
|
749
|
+
lastRender = performance.now();
|
|
750
|
+
timer;
|
|
751
|
+
exit;
|
|
752
|
+
shuffle;
|
|
753
|
+
screenWidth = -1;
|
|
754
|
+
screenHeight = -1;
|
|
755
|
+
/** Star per cell index, or undefined. */
|
|
756
|
+
stars = [];
|
|
757
|
+
cells = [];
|
|
758
|
+
ansiCache = new Map();
|
|
759
|
+
raster;
|
|
760
|
+
constructor(tui, screen, model, colors, onDone) {
|
|
761
|
+
this.tui = tui;
|
|
762
|
+
this.screen = screen;
|
|
763
|
+
this.model = model;
|
|
764
|
+
this.raster = new BlockRaster(model.cameraDistance);
|
|
765
|
+
this.foreground = colors.foreground;
|
|
766
|
+
this.background = colors.background;
|
|
767
|
+
this.onDone = onDone;
|
|
768
|
+
this.timer = setInterval(() => {
|
|
769
|
+
// Also stop when no longer rendered, e.g. when relay hides all overlays on exit.
|
|
770
|
+
if ((this.exit && this.exitProgress() >= 1) || performance.now() - this.lastRender > 1000)
|
|
771
|
+
this.finish();
|
|
772
|
+
else
|
|
773
|
+
this.tui.requestRender();
|
|
774
|
+
}, FRAME_MS);
|
|
775
|
+
this.timer.unref?.();
|
|
776
|
+
}
|
|
777
|
+
/** Play the exit animation. A second call skips it. */
|
|
778
|
+
close() {
|
|
779
|
+
if (this.exit) {
|
|
780
|
+
this.finish();
|
|
781
|
+
return;
|
|
782
|
+
}
|
|
783
|
+
const time = this.elapsed();
|
|
784
|
+
const yaw = spinAngle(time);
|
|
785
|
+
const turn = Math.PI * 2;
|
|
786
|
+
this.exit = {
|
|
787
|
+
start: performance.now(),
|
|
788
|
+
time,
|
|
789
|
+
yaw,
|
|
790
|
+
targetYaw: Math.ceil(yaw / turn) * turn,
|
|
791
|
+
offsets: this.blockOffsets(time),
|
|
792
|
+
};
|
|
793
|
+
}
|
|
794
|
+
handleInput(data) {
|
|
795
|
+
const keybindings = getKeybindings();
|
|
796
|
+
if (keybindings.matches(data, "tui.select.cancel") || keybindings.matches(data, "app.clear"))
|
|
797
|
+
this.close();
|
|
798
|
+
}
|
|
799
|
+
handleMouse(event) {
|
|
800
|
+
if (event.type === "click")
|
|
801
|
+
this.close();
|
|
802
|
+
return { handled: true, render: false };
|
|
803
|
+
}
|
|
804
|
+
invalidate() {
|
|
805
|
+
this.screenWidth = -1;
|
|
806
|
+
this.screenHeight = -1;
|
|
807
|
+
this.ansiCache.clear();
|
|
808
|
+
}
|
|
809
|
+
render(width) {
|
|
810
|
+
const height = Math.max(1, this.tui.terminal.rows);
|
|
811
|
+
const foreground = this.foreground;
|
|
812
|
+
const background = this.background;
|
|
813
|
+
this.lastRender = performance.now();
|
|
814
|
+
if (width !== this.screenWidth || height !== this.screenHeight) {
|
|
815
|
+
this.screenWidth = width;
|
|
816
|
+
this.screenHeight = height;
|
|
817
|
+
this.cells = this.prepareCells(width, foreground);
|
|
818
|
+
this.stars = this.prepareStars(width, height);
|
|
819
|
+
}
|
|
820
|
+
// Dissolve time runs forward on entry and backward on exit, so the screen reassembles in reverse order.
|
|
821
|
+
let dissolveTime;
|
|
822
|
+
let pose;
|
|
823
|
+
let hintAlpha;
|
|
824
|
+
let starAlpha;
|
|
825
|
+
let offsets;
|
|
826
|
+
if (this.exit) {
|
|
827
|
+
const progress = this.exitProgress();
|
|
828
|
+
const landing = clamp01(progress / 0.8);
|
|
829
|
+
const settle = 1 - smooth(landing);
|
|
830
|
+
dissolveTime = Math.min(this.exit.time, DISSOLVE_END) * (1 - progress);
|
|
831
|
+
pose = this.pose(width, height, this.flyProgress(this.exit.time) * settle, this.exit.time);
|
|
832
|
+
pose.yaw = this.exit.yaw + (this.exit.targetYaw - this.exit.yaw) * easeOut(landing);
|
|
833
|
+
pose.pitch *= settle;
|
|
834
|
+
pose.roll *= settle;
|
|
835
|
+
hintAlpha = this.hintAlpha(this.exit.time) * (1 - smooth(progress / 0.2));
|
|
836
|
+
starAlpha = this.starAlpha(this.exit.time) * (1 - smooth(progress / 0.3));
|
|
837
|
+
// Blocks are home well before the logo lands.
|
|
838
|
+
const gather = 1 - smooth(progress / 0.5);
|
|
839
|
+
offsets = this.exit.offsets.map(([x, y, z]) => [x * gather, y * gather, z * gather]);
|
|
840
|
+
}
|
|
841
|
+
else {
|
|
842
|
+
const time = this.elapsed();
|
|
843
|
+
dissolveTime = time;
|
|
844
|
+
pose = this.pose(width, height, this.flyProgress(time), time);
|
|
845
|
+
hintAlpha = this.hintAlpha(time);
|
|
846
|
+
starAlpha = this.starAlpha(time);
|
|
847
|
+
offsets = this.blockOffsets(time);
|
|
848
|
+
}
|
|
849
|
+
const { columns, rows } = this.model;
|
|
850
|
+
const boxes = this.model.blocks.map((block, index) => {
|
|
851
|
+
const [dx, dy, dz] = offsets[index];
|
|
852
|
+
const x = block.home[0] - columns / 2 + dx;
|
|
853
|
+
const y = block.home[1] - rows / 2 + dy;
|
|
854
|
+
return { min: [x, y, dz - DEPTH / 2], max: [x + 1, y + 1, dz + DEPTH / 2], color: block.color };
|
|
855
|
+
});
|
|
856
|
+
const raster = this.raster;
|
|
857
|
+
raster.render(width, height, pose, boxes, background, isLight(background) ? LIGHT_HALO_STRENGTH : 0);
|
|
858
|
+
const halo = (index, base) => {
|
|
859
|
+
const amount = raster.haloAmount[index];
|
|
860
|
+
if (amount <= 0)
|
|
861
|
+
return base;
|
|
862
|
+
const color = raster.haloRgb;
|
|
863
|
+
return mix(base ?? background, [color[index * 3], color[index * 3 + 1], color[index * 3 + 2]], amount);
|
|
864
|
+
};
|
|
865
|
+
const backgroundFade = smooth(dissolveTime / BACKGROUND_FADE);
|
|
866
|
+
const textFade = smooth(dissolveTime / 0.6) * 0.3;
|
|
867
|
+
// Once the screen has fully dissolved, the text layer is empty and can be skipped.
|
|
868
|
+
const textActive = dissolveTime < DISSOLVE_END || backgroundFade < 1;
|
|
869
|
+
const hint = this.hint(width, height, hintAlpha, background);
|
|
870
|
+
const frame = Math.floor(dissolveTime * 14);
|
|
871
|
+
const now = this.elapsed();
|
|
872
|
+
// Star brightness is quantized, so a row only changes when one of its stars steps to another level
|
|
873
|
+
// instead of on every frame.
|
|
874
|
+
const starLevel = Math.round(starAlpha * STAR_ALPHA_LEVELS) / STAR_ALPHA_LEVELS;
|
|
875
|
+
const starfield = (index) => {
|
|
876
|
+
if (starLevel <= 0)
|
|
877
|
+
return undefined;
|
|
878
|
+
const star = this.stars[index];
|
|
879
|
+
if (!star)
|
|
880
|
+
return undefined;
|
|
881
|
+
const flicker = Math.round((0.5 + 0.5 * Math.sin(now * star.speed + star.phase)) * STAR_FLICKER_LEVELS) /
|
|
882
|
+
STAR_FLICKER_LEVELS;
|
|
883
|
+
return {
|
|
884
|
+
text: star.glyph,
|
|
885
|
+
fg: mix(background, mix(foreground, star.tint, 0.5), star.strength * (0.7 + 0.3 * flicker) * starLevel),
|
|
886
|
+
};
|
|
887
|
+
};
|
|
888
|
+
const lines = [];
|
|
889
|
+
for (let row = 0; row < height; row++) {
|
|
890
|
+
const cells = this.cells[row] ?? [];
|
|
891
|
+
let line = "";
|
|
892
|
+
let currentFg = -1;
|
|
893
|
+
let currentBg = -1;
|
|
894
|
+
const emit = (text, fg, bg) => {
|
|
895
|
+
const fgKey = fg ? this.pack(fg) : -1;
|
|
896
|
+
const bgKey = bg ? this.pack(bg) : -1;
|
|
897
|
+
if (fgKey !== currentFg && text !== " ") {
|
|
898
|
+
line += fg ? this.ansi(fgKey, false) : "\x1b[39m";
|
|
899
|
+
currentFg = fgKey;
|
|
900
|
+
}
|
|
901
|
+
if (bgKey !== currentBg) {
|
|
902
|
+
line += bg ? this.ansi(bgKey, true) : "\x1b[49m";
|
|
903
|
+
currentBg = bgKey;
|
|
904
|
+
}
|
|
905
|
+
line += text;
|
|
906
|
+
};
|
|
907
|
+
for (let column = 0; column < width; column++) {
|
|
908
|
+
const index = row * width + column;
|
|
909
|
+
const cell = textActive ? cells[column] : undefined;
|
|
910
|
+
const cellBg = halo(index, cell?.bg && backgroundFade < 1 ? mix(cell.bg, background, backgroundFade) : undefined);
|
|
911
|
+
if (hint && row === hint.row && column >= hint.start && column < hint.start + hint.text.length) {
|
|
912
|
+
const offset = column - hint.start;
|
|
913
|
+
emit(hint.text[offset], offset < hint.keyLength ? hint.keyColor : hint.color, cellBg);
|
|
914
|
+
continue;
|
|
915
|
+
}
|
|
916
|
+
const dots = raster.bits[index];
|
|
917
|
+
if (dots) {
|
|
918
|
+
// Quantized so neighboring cells on one face usually share a color and its escape sequence.
|
|
919
|
+
const step = LOGO_COLOR_STEP * raster.counts[index];
|
|
920
|
+
const rgb = raster.rgb;
|
|
921
|
+
const color = [
|
|
922
|
+
Math.round(rgb[index * 3] / step) * LOGO_COLOR_STEP,
|
|
923
|
+
Math.round(rgb[index * 3 + 1] / step) * LOGO_COLOR_STEP,
|
|
924
|
+
Math.round(rgb[index * 3 + 2] / step) * LOGO_COLOR_STEP,
|
|
925
|
+
];
|
|
926
|
+
emit(BRAILLE[dots], color, cellBg);
|
|
927
|
+
continue;
|
|
928
|
+
}
|
|
929
|
+
if (!cell) {
|
|
930
|
+
const star = starfield(index);
|
|
931
|
+
emit(star?.text ?? " ", star?.fg, cellBg);
|
|
932
|
+
continue;
|
|
933
|
+
}
|
|
934
|
+
const dust = (dissolveTime - cell.delay) / DUST_DURATION;
|
|
935
|
+
if (dust < 0 && cell.width === 2 && !raster.bits[index + 1]) {
|
|
936
|
+
emit(cell.text, mix(cell.fg, background, textFade), cellBg);
|
|
937
|
+
column++;
|
|
938
|
+
continue;
|
|
939
|
+
}
|
|
940
|
+
if (dust < 0 && cell.width === 1) {
|
|
941
|
+
emit(cell.text, mix(cell.fg, background, textFade), cellBg);
|
|
942
|
+
continue;
|
|
943
|
+
}
|
|
944
|
+
const dotCount = dust < 0 ? cell.ink : Math.round(cell.ink * (1 - clamp01(dust)));
|
|
945
|
+
if (dotCount <= 0) {
|
|
946
|
+
const star = starfield(index);
|
|
947
|
+
emit(star?.text ?? " ", star?.fg, cellBg);
|
|
948
|
+
continue;
|
|
949
|
+
}
|
|
950
|
+
// Pick `dotCount` distinct dots; the choice changes a few times per second so the dust shimmers.
|
|
951
|
+
let bits = 0;
|
|
952
|
+
let placed = 0;
|
|
953
|
+
for (let attempt = 0; placed < dotCount && attempt < 32; attempt++) {
|
|
954
|
+
const bit = DOT_BITS[Math.floor(hash(cell.seed * 7919 + frame * 131 + attempt) * 8)];
|
|
955
|
+
if (bits & bit)
|
|
956
|
+
continue;
|
|
957
|
+
bits |= bit;
|
|
958
|
+
placed++;
|
|
959
|
+
}
|
|
960
|
+
const fade = textFade + (1 - textFade) * clamp01(dust) ** 0.8;
|
|
961
|
+
emit(BRAILLE[bits], mix(cell.fg, background, fade), cellBg);
|
|
962
|
+
}
|
|
963
|
+
lines.push(`${line}\x1b[0m`);
|
|
964
|
+
}
|
|
965
|
+
return lines;
|
|
966
|
+
}
|
|
967
|
+
elapsed() {
|
|
968
|
+
return (performance.now() - this.startTime) / 1000;
|
|
969
|
+
}
|
|
970
|
+
exitProgress() {
|
|
971
|
+
return this.exit ? clamp01((performance.now() - this.exit.start) / 1000 / EXIT_DURATION) : 0;
|
|
972
|
+
}
|
|
973
|
+
finish() {
|
|
974
|
+
if (!this.timer)
|
|
975
|
+
return;
|
|
976
|
+
clearInterval(this.timer);
|
|
977
|
+
this.timer = undefined;
|
|
978
|
+
this.onDone();
|
|
979
|
+
}
|
|
980
|
+
/** Each block's displacement from its place in the model at `time`, in grid units. */
|
|
981
|
+
blockOffsets(time) {
|
|
982
|
+
const blocks = this.model.blocks;
|
|
983
|
+
const home = () => blocks.map(() => [0, 0, 0]);
|
|
984
|
+
if (time < PUZZLE_START)
|
|
985
|
+
return home();
|
|
986
|
+
const cycle = Math.floor((time - PUZZLE_START) / PUZZLE_CYCLE);
|
|
987
|
+
const local = time - PUZZLE_START - cycle * PUZZLE_CYCLE;
|
|
988
|
+
if (this.shuffle?.cycle !== cycle)
|
|
989
|
+
this.shuffle = { cycle, steps: shuffleSteps(this.model, cycle) };
|
|
990
|
+
const steps = this.shuffle.steps;
|
|
991
|
+
const offset = (position, index) => {
|
|
992
|
+
const block = blocks[index].home;
|
|
993
|
+
return [position[0] - block[0], position[1] - block[1], position[2] - block[2]];
|
|
994
|
+
};
|
|
995
|
+
const shuffleEnd = PUZZLE_STEP * PUZZLE_STEPS;
|
|
996
|
+
if (local < shuffleEnd) {
|
|
997
|
+
const step = Math.floor(local / PUZZLE_STEP);
|
|
998
|
+
const progress = smooth((local - step * PUZZLE_STEP) / PUZZLE_STEP);
|
|
999
|
+
return steps[step].map((from, index) => {
|
|
1000
|
+
const a = offset(from, index);
|
|
1001
|
+
const b = offset(steps[step + 1][index], index);
|
|
1002
|
+
return [a[0] + (b[0] - a[0]) * progress, a[1] + (b[1] - a[1]) * progress, a[2] + (b[2] - a[2]) * progress];
|
|
1003
|
+
});
|
|
1004
|
+
}
|
|
1005
|
+
if (local < shuffleEnd + PUZZLE_RETURN) {
|
|
1006
|
+
// All blocks fly home at once. Alternating arcs in depth keep them from passing through each other.
|
|
1007
|
+
const u = (local - shuffleEnd) / PUZZLE_RETURN;
|
|
1008
|
+
const remaining = 1 - smooth(u);
|
|
1009
|
+
const arc = Math.sin(Math.PI * clamp01(u)) * 0.8;
|
|
1010
|
+
return steps[PUZZLE_STEPS].map((position, index) => {
|
|
1011
|
+
const [x, y, z] = offset(position, index);
|
|
1012
|
+
return [x * remaining, y * remaining, z * remaining + (index % 2 === 0 ? arc : -arc)];
|
|
1013
|
+
});
|
|
1014
|
+
}
|
|
1015
|
+
return home();
|
|
1016
|
+
}
|
|
1017
|
+
flyProgress(time) {
|
|
1018
|
+
return smooth((time - FLY_START) / FLY_DURATION);
|
|
1019
|
+
}
|
|
1020
|
+
starAlpha(time) {
|
|
1021
|
+
return smooth((time - STARS_START) / STARS_FADE);
|
|
1022
|
+
}
|
|
1023
|
+
hintAlpha(time) {
|
|
1024
|
+
return smooth((time - FLY_START - FLY_DURATION) / HINT_FADE);
|
|
1025
|
+
}
|
|
1026
|
+
pose(width, height, progress, time) {
|
|
1027
|
+
const { columns, rows, cameraDistance, radius, widthShare, origin } = this.model;
|
|
1028
|
+
const reach = radius * (cameraDistance / (cameraDistance - radius));
|
|
1029
|
+
// Lifting off, the front face must cover exactly the half-block cells (2x2 dots per pixel) despite the
|
|
1030
|
+
// perspective.
|
|
1031
|
+
const startScale = origin ? (2 * (cameraDistance - DEPTH / 2)) / cameraDistance : START_SCALE;
|
|
1032
|
+
const endScale = Math.max(startScale, Math.min(width * 2 * widthShare, (height * 4 - 8) * 0.48) / reach);
|
|
1033
|
+
const endX = width;
|
|
1034
|
+
const endY = height * 2 - 2;
|
|
1035
|
+
const startX = origin ? origin.column * 2 + columns : endX;
|
|
1036
|
+
const startY = origin ? origin.row * 4 + rows : endY;
|
|
1037
|
+
return {
|
|
1038
|
+
centerX: startX + (endX - startX) * progress,
|
|
1039
|
+
centerY: startY + (endY - startY) * progress,
|
|
1040
|
+
// Interpolate the zoom geometrically so it feels uniform.
|
|
1041
|
+
scale: startScale * (endScale / startScale) ** progress,
|
|
1042
|
+
yaw: spinAngle(time),
|
|
1043
|
+
// Tilts are zero at whole turns, so the camera looks straight at the front of the reassembled logo.
|
|
1044
|
+
pitch: 0.3 * Math.sin(spinPhase(time)) * progress,
|
|
1045
|
+
roll: 0.06 * Math.sin(2 * spinPhase(time)) * progress,
|
|
1046
|
+
};
|
|
1047
|
+
}
|
|
1048
|
+
hint(width, height, alpha, background) {
|
|
1049
|
+
if (alpha <= 0)
|
|
1050
|
+
return undefined;
|
|
1051
|
+
const key = formatKeyText(getKeybindings().getKeys("tui.select.cancel")[0] ?? "escape");
|
|
1052
|
+
const text = `${key} to return`;
|
|
1053
|
+
if (text.length > width)
|
|
1054
|
+
return undefined;
|
|
1055
|
+
return {
|
|
1056
|
+
row: height - 2,
|
|
1057
|
+
start: Math.floor((width - text.length) / 2),
|
|
1058
|
+
text,
|
|
1059
|
+
keyLength: key.length,
|
|
1060
|
+
keyColor: mix(background, toRgb(theme.colors.muted), alpha),
|
|
1061
|
+
color: mix(background, toRgb(theme.colors.dim), alpha),
|
|
1062
|
+
};
|
|
1063
|
+
}
|
|
1064
|
+
/** A sparse, deterministic starfield: one braille dot in about STAR_DENSITY of all cells. */
|
|
1065
|
+
prepareStars(width, height) {
|
|
1066
|
+
const stars = new Array(width * height);
|
|
1067
|
+
for (let index = 0; index < width * height; index++) {
|
|
1068
|
+
if (hash(index * 3 + 0x51ed) >= STAR_DENSITY)
|
|
1069
|
+
continue;
|
|
1070
|
+
const random = (salt) => hash(index * 7 + salt * 0x9e37);
|
|
1071
|
+
stars[index] = {
|
|
1072
|
+
glyph: BRAILLE[DOT_BITS[Math.floor(random(1) * 8)]],
|
|
1073
|
+
tint: STAR_TINTS[Math.floor(random(2) * STAR_TINTS.length)],
|
|
1074
|
+
strength: 0.1 + random(3) * 0.12,
|
|
1075
|
+
phase: random(4) * Math.PI * 2,
|
|
1076
|
+
speed: 0.4 + random(5) * 0.8,
|
|
1077
|
+
};
|
|
1078
|
+
}
|
|
1079
|
+
return stars;
|
|
1080
|
+
}
|
|
1081
|
+
prepareCells(width, foreground) {
|
|
1082
|
+
const cells = parseScreen(this.screen, width, foreground, this.background);
|
|
1083
|
+
const height = Math.max(1, this.tui.terminal.rows);
|
|
1084
|
+
const { columns, rows, origin } = this.model;
|
|
1085
|
+
// The dust spreads out from where the model starts.
|
|
1086
|
+
const centerX = origin ? origin.column + columns / 2 : width / 2;
|
|
1087
|
+
const centerY = origin ? origin.row + rows / 4 : height / 2;
|
|
1088
|
+
const farthest = Math.hypot(Math.max(centerX, width - centerX), Math.max(centerY, height - centerY) * 2);
|
|
1089
|
+
for (let row = 0; row < cells.length; row++) {
|
|
1090
|
+
const line = cells[row];
|
|
1091
|
+
for (let column = 0; column < line.length; column++) {
|
|
1092
|
+
const cell = line[column];
|
|
1093
|
+
// Wide graphemes share their first column's timing so both halves change together.
|
|
1094
|
+
const owner = cell.width === 0 ? line[column - 1] : cell;
|
|
1095
|
+
const seed = hash(row * 65_537 + column);
|
|
1096
|
+
if (cell.width !== 0) {
|
|
1097
|
+
const distance = Math.hypot(column - centerX, (row - centerY) * 2) / farthest;
|
|
1098
|
+
cell.delay = FLY_START + distance * WAVE_SPREAD + seed * WAVE_JITTER;
|
|
1099
|
+
}
|
|
1100
|
+
else {
|
|
1101
|
+
cell.delay = owner.delay;
|
|
1102
|
+
}
|
|
1103
|
+
cell.seed = row * 65_537 + column;
|
|
1104
|
+
cell.ink = glyphInk(owner.text, seed);
|
|
1105
|
+
}
|
|
1106
|
+
}
|
|
1107
|
+
// The 3D model replaces its half-block rendering on screen.
|
|
1108
|
+
if (origin) {
|
|
1109
|
+
for (let row = origin.row; row < origin.row + Math.ceil(rows / 2); row++) {
|
|
1110
|
+
const line = cells[row];
|
|
1111
|
+
if (!line)
|
|
1112
|
+
continue;
|
|
1113
|
+
for (let column = origin.column; column < origin.column + columns; column++) {
|
|
1114
|
+
const cell = line[column];
|
|
1115
|
+
if (cell) {
|
|
1116
|
+
cell.text = " ";
|
|
1117
|
+
cell.width = 1;
|
|
1118
|
+
cell.ink = 0;
|
|
1119
|
+
cell.bg = undefined;
|
|
1120
|
+
}
|
|
1121
|
+
}
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1124
|
+
return cells;
|
|
1125
|
+
}
|
|
1126
|
+
pack(color) {
|
|
1127
|
+
return (Math.round(color[0]) << 16) | (Math.round(color[1]) << 8) | Math.round(color[2]);
|
|
1128
|
+
}
|
|
1129
|
+
ansi(key, isBackground) {
|
|
1130
|
+
const cacheKey = key * 2 + (isBackground ? 1 : 0);
|
|
1131
|
+
let value = this.ansiCache.get(cacheKey);
|
|
1132
|
+
if (value === undefined) {
|
|
1133
|
+
const color = rgbColor((key >> 16) & 255, (key >> 8) & 255, key & 255);
|
|
1134
|
+
const mode = theme.getColorMode();
|
|
1135
|
+
value = isBackground ? backgroundAnsi(color, mode) : foregroundAnsi(color, mode);
|
|
1136
|
+
this.ansiCache.set(cacheKey, value);
|
|
1137
|
+
}
|
|
1138
|
+
return value;
|
|
1139
|
+
}
|
|
1140
|
+
}
|
|
1141
|
+
//# sourceMappingURL=easter-egg-3d.js.map
|