@selesai/code 0.13.13 → 0.13.14
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/dist/bun/cli.d.ts +2 -0
- package/dist/bun/cli.js +10 -0
- package/dist/bun/register-bedrock.d.ts +1 -0
- package/dist/bun/register-bedrock.js +3 -0
- package/dist/bun/restore-sandbox-env.d.ts +16 -0
- package/dist/bun/restore-sandbox-env.js +35 -0
- package/dist/cli/args.d.ts +59 -0
- package/dist/cli/args.js +428 -0
- package/dist/cli/args.test.d.ts +1 -0
- package/dist/cli/args.test.js +32 -0
- package/dist/cli/config-selector.d.ts +15 -0
- package/dist/cli/config-selector.js +30 -0
- package/dist/cli/credential-print.d.ts +22 -0
- package/dist/cli/credential-print.js +116 -0
- package/dist/cli/file-processor.d.ts +14 -0
- package/dist/cli/file-processor.js +69 -0
- package/dist/cli/initial-message.d.ts +17 -0
- package/dist/cli/initial-message.js +21 -0
- package/dist/cli/list-models.d.ts +8 -0
- package/dist/cli/list-models.js +97 -0
- package/dist/cli/project-trust.d.ts +9 -0
- package/dist/cli/project-trust.js +47 -0
- package/dist/cli/session-picker.d.ts +9 -0
- package/dist/cli/session-picker.js +35 -0
- package/dist/cli/startup-ui.d.ts +22 -0
- package/dist/cli/startup-ui.js +172 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +17 -0
- package/dist/config.d.ts +181 -0
- package/dist/config.js +788 -0
- package/dist/core/agent-session-auto-handoff.test.d.ts +1 -0
- package/dist/core/agent-session-auto-handoff.test.js +183 -0
- package/dist/core/agent-session-length-continuation.test.d.ts +1 -0
- package/dist/core/agent-session-length-continuation.test.js +107 -0
- package/dist/core/agent-session-runtime.d.ts +118 -0
- package/dist/core/agent-session-runtime.js +305 -0
- package/dist/core/agent-session-services.d.ts +84 -0
- package/dist/core/agent-session-services.js +132 -0
- package/dist/core/agent-session-skill-block.test.d.ts +1 -0
- package/dist/core/agent-session-skill-block.test.js +19 -0
- package/dist/core/agent-session.d.ts +713 -0
- package/dist/core/agent-session.js +3054 -0
- package/dist/core/agents.d.ts +52 -0
- package/dist/core/agents.js +237 -0
- package/dist/core/auth-guidance.d.ts +4 -0
- package/dist/core/auth-guidance.js +20 -0
- package/dist/core/auth-storage.d.ts +61 -0
- package/dist/core/auth-storage.js +249 -0
- package/dist/core/bash-executor.d.ts +31 -0
- package/dist/core/bash-executor.js +110 -0
- package/dist/core/built-in-extensions.d.ts +2 -0
- package/dist/core/built-in-extensions.js +2 -0
- package/dist/core/cache-stats.d.ts +48 -0
- package/dist/core/cache-stats.js +100 -0
- package/dist/core/compaction/branch-summarization.d.ts +97 -0
- package/dist/core/compaction/branch-summarization.js +246 -0
- package/dist/core/compaction/compaction.d.ts +141 -0
- package/dist/core/compaction/compaction.js +659 -0
- package/dist/core/compaction/index.d.ts +6 -0
- package/dist/core/compaction/index.js +6 -0
- package/dist/core/compaction/utils.d.ts +37 -0
- package/dist/core/compaction/utils.js +141 -0
- package/dist/core/defaults.d.ts +3 -0
- package/dist/core/defaults.js +10 -0
- package/dist/core/diagnostics.d.ts +15 -0
- package/dist/core/diagnostics.js +1 -0
- package/dist/core/event-bus.d.ts +8 -0
- package/dist/core/event-bus.js +24 -0
- package/dist/core/exec.d.ts +28 -0
- package/dist/core/exec.js +74 -0
- package/dist/core/experimental.d.ts +5 -0
- package/dist/core/experimental.js +7 -0
- package/dist/core/export-html/ansi-to-html.d.ts +21 -0
- package/dist/core/export-html/ansi-to-html.js +248 -0
- package/dist/core/export-html/index.d.ts +36 -0
- package/dist/core/export-html/index.js +225 -0
- package/dist/core/export-html/template.css +1066 -0
- package/dist/core/export-html/template.html +55 -0
- package/dist/core/export-html/template.js +1864 -0
- package/dist/core/export-html/tool-renderer.d.ts +33 -0
- package/dist/core/export-html/tool-renderer.js +107 -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 +11 -0
- package/dist/core/extensions/index.js +8 -0
- package/dist/core/extensions/loader.d.ts +22 -0
- package/dist/core/extensions/loader.js +632 -0
- package/dist/core/extensions/loader.test.d.ts +1 -0
- package/dist/core/extensions/loader.test.js +21 -0
- package/dist/core/extensions/runner.d.ts +176 -0
- package/dist/core/extensions/runner.js +1016 -0
- package/dist/core/extensions/types.d.ts +1313 -0
- package/dist/core/extensions/types.js +44 -0
- package/dist/core/extensions/wrapper.d.ts +19 -0
- package/dist/core/extensions/wrapper.js +40 -0
- package/dist/core/footer-data-provider.d.ts +63 -0
- package/dist/core/footer-data-provider.js +337 -0
- package/dist/core/git-command.d.ts +8 -0
- package/dist/core/git-command.js +48 -0
- package/dist/core/handoff.d.ts +11 -0
- package/dist/core/handoff.js +49 -0
- package/dist/core/http-dispatcher.d.ts +21 -0
- package/dist/core/http-dispatcher.js +90 -0
- package/dist/core/index.d.ts +12 -0
- package/dist/core/index.js +12 -0
- package/dist/core/keybindings.d.ts +421 -0
- package/dist/core/keybindings.js +295 -0
- package/dist/core/llama/client.d.ts +66 -0
- package/dist/core/llama/client.js +308 -0
- package/dist/core/llama/huggingface.d.ts +22 -0
- package/dist/core/llama/huggingface.js +140 -0
- package/dist/core/llama/index.d.ts +2 -0
- package/dist/core/llama/index.js +207 -0
- package/dist/core/llama/provider.d.ts +11 -0
- package/dist/core/llama/provider.js +143 -0
- package/dist/core/llama/ui.d.ts +41 -0
- package/dist/core/llama/ui.js +415 -0
- package/dist/core/messages.d.ts +76 -0
- package/dist/core/messages.js +122 -0
- package/dist/core/model-config.d.ts +547 -0
- package/dist/core/model-config.js +278 -0
- package/dist/core/model-registry.d.ts +45 -0
- package/dist/core/model-registry.js +107 -0
- package/dist/core/model-resolver.d.ts +122 -0
- package/dist/core/model-resolver.js +558 -0
- package/dist/core/model-runtime.d.ts +86 -0
- package/dist/core/model-runtime.js +472 -0
- package/dist/core/models-store.d.ts +16 -0
- package/dist/core/models-store.js +44 -0
- package/dist/core/output-guard.d.ts +6 -0
- package/dist/core/output-guard.js +88 -0
- package/dist/core/package-manager.d.ts +221 -0
- package/dist/core/package-manager.js +2232 -0
- package/dist/core/package-manager.test.d.ts +1 -0
- package/dist/core/package-manager.test.js +58 -0
- package/dist/core/project-trust.d.ts +14 -0
- package/dist/core/project-trust.js +58 -0
- package/dist/core/prompt-templates.d.ts +53 -0
- package/dist/core/prompt-templates.js +235 -0
- package/dist/core/provider-attribution.d.ts +3 -0
- package/dist/core/provider-attribution.js +71 -0
- package/dist/core/provider-composer.d.ts +54 -0
- package/dist/core/provider-composer.js +387 -0
- package/dist/core/radius.d.ts +1 -0
- package/dist/core/radius.js +1 -0
- package/dist/core/remote-catalog-provider.d.ts +4 -0
- package/dist/core/remote-catalog-provider.js +119 -0
- package/dist/core/resolve-config-value.d.ts +29 -0
- package/dist/core/resolve-config-value.js +246 -0
- package/dist/core/resource-loader.d.ts +256 -0
- package/dist/core/resource-loader.js +974 -0
- package/dist/core/runtime-credentials.d.ts +16 -0
- package/dist/core/runtime-credentials.js +41 -0
- package/dist/core/sdk.d.ts +107 -0
- package/dist/core/sdk.js +279 -0
- package/dist/core/session-cwd.d.ts +18 -0
- package/dist/core/session-cwd.js +37 -0
- package/dist/core/session-manager.d.ts +355 -0
- package/dist/core/session-manager.js +1339 -0
- package/dist/core/settings-manager-auto-handoff.test.d.ts +1 -0
- package/dist/core/settings-manager-auto-handoff.test.js +42 -0
- package/dist/core/settings-manager.d.ts +350 -0
- package/dist/core/settings-manager.js +1076 -0
- package/dist/core/skills.d.ts +70 -0
- package/dist/core/skills.js +401 -0
- package/dist/core/slash-commands.d.ts +14 -0
- package/dist/core/slash-commands.js +27 -0
- package/dist/core/source-info.d.ts +17 -0
- package/dist/core/source-info.js +18 -0
- package/dist/core/system-prompt.d.ts +30 -0
- package/dist/core/system-prompt.js +129 -0
- package/dist/core/system-prompt.test.d.ts +1 -0
- package/dist/core/system-prompt.test.js +94 -0
- package/dist/core/telemetry.d.ts +2 -0
- package/dist/core/telemetry.js +8 -0
- package/dist/core/timings.d.ts +9 -0
- package/dist/core/timings.js +40 -0
- package/dist/core/tools/bash.d.ts +86 -0
- package/dist/core/tools/bash.js +409 -0
- package/dist/core/tools/edit-diff.d.ts +105 -0
- package/dist/core/tools/edit-diff.js +423 -0
- package/dist/core/tools/edit.d.ts +50 -0
- package/dist/core/tools/edit.js +285 -0
- package/dist/core/tools/file-mutation-queue.d.ts +5 -0
- package/dist/core/tools/file-mutation-queue.js +51 -0
- package/dist/core/tools/find.d.ts +34 -0
- package/dist/core/tools/find.js +304 -0
- package/dist/core/tools/grep.d.ts +36 -0
- package/dist/core/tools/grep.js +303 -0
- package/dist/core/tools/index.d.ts +42 -0
- package/dist/core/tools/index.js +119 -0
- package/dist/core/tools/ls.d.ts +36 -0
- package/dist/core/tools/ls.js +166 -0
- package/dist/core/tools/output-accumulator.d.ts +51 -0
- package/dist/core/tools/output-accumulator.js +183 -0
- package/dist/core/tools/path-utils.d.ts +9 -0
- package/dist/core/tools/path-utils.js +98 -0
- package/dist/core/tools/powershell.d.ts +15 -0
- package/dist/core/tools/powershell.js +38 -0
- package/dist/core/tools/powershell.test.d.ts +1 -0
- package/dist/core/tools/powershell.test.js +20 -0
- package/dist/core/tools/read-vision.test.d.ts +1 -0
- package/dist/core/tools/read-vision.test.js +122 -0
- package/dist/core/tools/read.d.ts +46 -0
- package/dist/core/tools/read.js +327 -0
- package/dist/core/tools/render-utils.d.ts +23 -0
- package/dist/core/tools/render-utils.js +64 -0
- package/dist/core/tools/tool-definition-wrapper.d.ts +13 -0
- package/dist/core/tools/tool-definition-wrapper.js +35 -0
- package/dist/core/tools/truncate.d.ts +69 -0
- package/dist/core/tools/truncate.js +214 -0
- package/dist/core/tools/write.d.ts +25 -0
- package/dist/core/tools/write.js +198 -0
- package/dist/core/trust-manager.d.ts +35 -0
- package/dist/core/trust-manager.js +201 -0
- package/dist/core/usage-totals.d.ts +20 -0
- package/dist/core/usage-totals.js +61 -0
- package/dist/core/vision-caption.d.ts +30 -0
- package/dist/core/vision-caption.js +62 -0
- package/dist/defaults/models.json +335 -0
- package/dist/defaults/settings.json +61 -0
- package/dist/extensions/agent-browser.test.ts +371 -0
- package/dist/extensions/agent-browser.ts +160 -0
- package/dist/extensions/auto-session-name.test.ts +169 -0
- package/dist/extensions/auto-session-name.ts +100 -0
- package/dist/extensions/context-compaction-reminder.test.ts +82 -0
- package/dist/extensions/context-compaction-reminder.ts +28 -0
- package/dist/extensions/copy-turn.test.ts +383 -0
- package/dist/extensions/copy-turn.ts +146 -0
- package/dist/extensions/cost-reconcile.test.ts +272 -0
- package/dist/extensions/cost-reconcile.ts +264 -0
- package/dist/extensions/grep-app/index.test.ts +406 -0
- package/dist/extensions/grep-app/index.ts +216 -0
- package/dist/extensions/handoff-new.test.ts +434 -0
- package/dist/extensions/handoff-new.ts +129 -0
- package/dist/extensions/herdr-agent-state.ts +310 -0
- package/dist/extensions/inline-skills.test.ts +204 -0
- package/dist/extensions/inline-skills.ts +102 -0
- package/dist/extensions/package.json +32 -0
- package/dist/extensions/pi-hermes-memory/CHANGELOG.md +371 -0
- package/dist/extensions/pi-hermes-memory/LICENSE +21 -0
- package/dist/extensions/pi-hermes-memory/README.md +643 -0
- package/dist/extensions/pi-hermes-memory/docs/0.1/TASKS.md +197 -0
- package/dist/extensions/pi-hermes-memory/docs/0.2/PLAN.md +290 -0
- package/dist/extensions/pi-hermes-memory/docs/0.2/TASKS.md +134 -0
- package/dist/extensions/pi-hermes-memory/docs/0.2/TEST-PLAN.md +216 -0
- package/dist/extensions/pi-hermes-memory/docs/0.3/PLAN.md +330 -0
- package/dist/extensions/pi-hermes-memory/docs/0.3/TASKS.md +125 -0
- package/dist/extensions/pi-hermes-memory/docs/0.4/PLAN.md +160 -0
- package/dist/extensions/pi-hermes-memory/docs/0.4/TASKS.md +113 -0
- package/dist/extensions/pi-hermes-memory/docs/0.6/CHANGELOG.md +57 -0
- package/dist/extensions/pi-hermes-memory/docs/0.6/PLAN.md +202 -0
- package/dist/extensions/pi-hermes-memory/docs/0.6/TASKS.md +144 -0
- package/dist/extensions/pi-hermes-memory/docs/0.7/PLAN.md +349 -0
- package/dist/extensions/pi-hermes-memory/docs/0.7/TASKS.md +110 -0
- package/dist/extensions/pi-hermes-memory/docs/PUBLISHING.md +149 -0
- package/dist/extensions/pi-hermes-memory/docs/ROADMAP.md +468 -0
- package/dist/extensions/pi-hermes-memory/docs/images/memory-architecture.svg +1 -0
- package/dist/extensions/pi-hermes-memory/docs/images/pi-logo.svg +22 -0
- package/dist/extensions/pi-hermes-memory/docs/images/pi_memory.png +0 -0
- package/dist/extensions/pi-hermes-memory/docs/images/pi_memory.svg +19 -0
- package/dist/extensions/pi-hermes-memory/docs/images/security-flow.svg +1 -0
- package/dist/extensions/pi-hermes-memory/docs/images/session-lifecycle.svg +1 -0
- package/dist/extensions/pi-hermes-memory/docs/images/source-architecture.svg +1 -0
- package/dist/extensions/pi-hermes-memory/docs/mermaid/memory-architecture.mmd +49 -0
- package/dist/extensions/pi-hermes-memory/docs/mermaid/security-flow.mmd +40 -0
- package/dist/extensions/pi-hermes-memory/docs/mermaid/session-lifecycle.mmd +56 -0
- package/dist/extensions/pi-hermes-memory/docs/mermaid/source-architecture.mmd +54 -0
- package/dist/extensions/pi-hermes-memory/package-lock.json +3799 -0
- package/dist/extensions/pi-hermes-memory/package.json +66 -0
- package/dist/extensions/pi-hermes-memory/scripts/check-min-sdk.mjs +99 -0
- package/dist/extensions/pi-hermes-memory/scripts/ensure-dev.mjs +57 -0
- package/dist/extensions/pi-hermes-memory/src/auto-consolidation-warning.ts +6 -0
- package/dist/extensions/pi-hermes-memory/src/config.ts +178 -0
- package/dist/extensions/pi-hermes-memory/src/constants.ts +424 -0
- package/dist/extensions/pi-hermes-memory/src/extension-root-migration.ts +639 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/auto-consolidate.ts +401 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/background-review.ts +297 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/child-process-watchdog.mjs +90 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/correction-detector.ts +300 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/index-sessions.ts +86 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/insights.ts +78 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/interview.ts +37 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/learn-memory.ts +186 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/message-parts.ts +27 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/pi-child-process.ts +485 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/preview-context.ts +105 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/review-memory-ops.ts +506 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/session-backfill.ts +145 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/session-flush.ts +151 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/session-live-index.ts +94 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/skills-command.ts +1334 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/standing-pin.ts +111 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/switch-project.ts +75 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/sync-markdown-memories.ts +266 -0
- package/dist/extensions/pi-hermes-memory/src/index.ts +384 -0
- package/dist/extensions/pi-hermes-memory/src/lifecycle-timing.ts +54 -0
- package/dist/extensions/pi-hermes-memory/src/paths.ts +61 -0
- package/dist/extensions/pi-hermes-memory/src/project-context.ts +13 -0
- package/dist/extensions/pi-hermes-memory/src/project-memory-migration.ts +93 -0
- package/dist/extensions/pi-hermes-memory/src/project.ts +157 -0
- package/dist/extensions/pi-hermes-memory/src/prompt-context.ts +55 -0
- package/dist/extensions/pi-hermes-memory/src/store/atomic-lock-coordinator.ts +375 -0
- package/dist/extensions/pi-hermes-memory/src/store/canonical-storage-path.ts +54 -0
- package/dist/extensions/pi-hermes-memory/src/store/content-scanner.ts +101 -0
- package/dist/extensions/pi-hermes-memory/src/store/db.ts +1180 -0
- package/dist/extensions/pi-hermes-memory/src/store/fts-query.ts +101 -0
- package/dist/extensions/pi-hermes-memory/src/store/markdown-mutation-lock.ts +38 -0
- package/dist/extensions/pi-hermes-memory/src/store/memory-lookup.ts +24 -0
- package/dist/extensions/pi-hermes-memory/src/store/memory-store.ts +1191 -0
- package/dist/extensions/pi-hermes-memory/src/store/recovery-maintenance.ts +66 -0
- package/dist/extensions/pi-hermes-memory/src/store/schema.ts +118 -0
- package/dist/extensions/pi-hermes-memory/src/store/session-anchor-search.ts +472 -0
- package/dist/extensions/pi-hermes-memory/src/store/session-indexer.ts +511 -0
- package/dist/extensions/pi-hermes-memory/src/store/session-parser.ts +213 -0
- package/dist/extensions/pi-hermes-memory/src/store/session-search.ts +234 -0
- package/dist/extensions/pi-hermes-memory/src/store/skill-store.ts +950 -0
- package/dist/extensions/pi-hermes-memory/src/store/skill-utils.ts +133 -0
- package/dist/extensions/pi-hermes-memory/src/store/sqlite-memory-store.ts +1002 -0
- package/dist/extensions/pi-hermes-memory/src/store/sqlite-native.ts +241 -0
- package/dist/extensions/pi-hermes-memory/src/store/standing-instructions.ts +247 -0
- package/dist/extensions/pi-hermes-memory/src/tools/memory-search-tool.ts +95 -0
- package/dist/extensions/pi-hermes-memory/src/tools/memory-tool.ts +469 -0
- package/dist/extensions/pi-hermes-memory/src/tools/session-search-tool.ts +246 -0
- package/dist/extensions/pi-hermes-memory/src/tools/shared-output-view.ts +170 -0
- package/dist/extensions/pi-hermes-memory/src/tools/skill-tool.ts +333 -0
- package/dist/extensions/pi-hermes-memory/src/tools/tool-result-views.ts +105 -0
- package/dist/extensions/pi-hermes-memory/src/types.ts +214 -0
- package/dist/extensions/pi-hermes-memory/tests/config.test.ts +434 -0
- package/dist/extensions/pi-hermes-memory/tests/extension-root-migration.test.ts +368 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/auto-consolidate.test.ts +984 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/background-review.test.ts +950 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/correction-detector.test.ts +671 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/insights.test.ts +157 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/interview.test.ts +127 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/pi-child-process.test.ts +905 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/preview-context.test.ts +152 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/prompt-context.test.ts +166 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/resources-discover.test.ts +71 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/review-memory-ops.test.ts +614 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/session-backfill.test.ts +192 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/session-flush.test.ts +677 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/session-live-index.test.ts +225 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/skills-command.test.ts +827 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/standing-pin.test.ts +134 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/sync-markdown-memories.test.ts +491 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/system-prompt.test.ts +199 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/thinking-max.test.ts +64 -0
- package/dist/extensions/pi-hermes-memory/tests/index.test.ts +30 -0
- package/dist/extensions/pi-hermes-memory/tests/integration/flow.test.ts +126 -0
- package/dist/extensions/pi-hermes-memory/tests/lifecycle-timing.test.ts +76 -0
- package/dist/extensions/pi-hermes-memory/tests/paths.test.ts +23 -0
- package/dist/extensions/pi-hermes-memory/tests/project-memory-migration.test.ts +80 -0
- package/dist/extensions/pi-hermes-memory/tests/project-rebinding.test.ts +115 -0
- package/dist/extensions/pi-hermes-memory/tests/project.test.ts +120 -0
- package/dist/extensions/pi-hermes-memory/tests/run-all-timeout.test.ts +107 -0
- package/dist/extensions/pi-hermes-memory/tests/run-all.sh +45 -0
- package/dist/extensions/pi-hermes-memory/tests/store/atomic-lock-coordinator.test.ts +381 -0
- package/dist/extensions/pi-hermes-memory/tests/store/content-scanner.test.ts +388 -0
- package/dist/extensions/pi-hermes-memory/tests/store/db.test.ts +1046 -0
- package/dist/extensions/pi-hermes-memory/tests/store/markdown-mutation-lock.test.ts +34 -0
- package/dist/extensions/pi-hermes-memory/tests/store/memory-store.test.ts +2150 -0
- package/dist/extensions/pi-hermes-memory/tests/store/recovery-maintenance.test.ts +170 -0
- package/dist/extensions/pi-hermes-memory/tests/store/session-anchor-search.test.ts +210 -0
- package/dist/extensions/pi-hermes-memory/tests/store/session-indexer.test.ts +643 -0
- package/dist/extensions/pi-hermes-memory/tests/store/session-parser.test.ts +282 -0
- package/dist/extensions/pi-hermes-memory/tests/store/session-search.test.ts +287 -0
- package/dist/extensions/pi-hermes-memory/tests/store/skill-store.test.ts +678 -0
- package/dist/extensions/pi-hermes-memory/tests/store/skill-utils.test.ts +21 -0
- package/dist/extensions/pi-hermes-memory/tests/store/sqlite-lazy-load.test.ts +78 -0
- package/dist/extensions/pi-hermes-memory/tests/store/sqlite-memory-store.test.ts +543 -0
- package/dist/extensions/pi-hermes-memory/tests/store/sqlite-native.test.ts +164 -0
- package/dist/extensions/pi-hermes-memory/tests/store/standing-instructions.test.ts +171 -0
- package/dist/extensions/pi-hermes-memory/tests/tools/memory-search-tool.test.ts +84 -0
- package/dist/extensions/pi-hermes-memory/tests/tools/memory-tool.test.ts +709 -0
- package/dist/extensions/pi-hermes-memory/tests/tools/session-search-tool.test.ts +345 -0
- package/dist/extensions/pi-hermes-memory/tests/tools/shared-output-view.test.ts +362 -0
- package/dist/extensions/pi-hermes-memory/tests/tools/skill-tool.test.ts +478 -0
- package/dist/extensions/pi-hermes-memory/tests/tools/tool-result-renderer-wiring.test.ts +40 -0
- package/dist/extensions/pi-hermes-memory/tsconfig.json +19 -0
- package/dist/extensions/pi-intercom/CHANGELOG.md +321 -0
- package/dist/extensions/pi-intercom/LICENSE +21 -0
- package/dist/extensions/pi-intercom/README.md +598 -0
- package/dist/extensions/pi-intercom/banner.png +0 -0
- package/dist/extensions/pi-intercom/broker/broker.ts +1721 -0
- package/dist/extensions/pi-intercom/broker/client-liveness.test.ts +173 -0
- package/dist/extensions/pi-intercom/broker/client.test.ts +83 -0
- package/dist/extensions/pi-intercom/broker/client.ts +793 -0
- package/dist/extensions/pi-intercom/broker/extension-state.ts +197 -0
- package/dist/extensions/pi-intercom/broker/extension.test.ts +486 -0
- package/dist/extensions/pi-intercom/broker/framing.test.ts +114 -0
- package/dist/extensions/pi-intercom/broker/framing.ts +115 -0
- package/dist/extensions/pi-intercom/broker/paths.test.ts +153 -0
- package/dist/extensions/pi-intercom/broker/paths.ts +134 -0
- package/dist/extensions/pi-intercom/broker/protocol.ts +208 -0
- package/dist/extensions/pi-intercom/broker/runtime-claim.test.ts +34 -0
- package/dist/extensions/pi-intercom/broker/runtime-claim.ts +21 -0
- package/dist/extensions/pi-intercom/broker/spawn.test.ts +252 -0
- package/dist/extensions/pi-intercom/broker/spawn.ts +420 -0
- package/dist/extensions/pi-intercom/config.test.ts +104 -0
- package/dist/extensions/pi-intercom/config.ts +163 -0
- package/dist/extensions/pi-intercom/cwd.test.ts +40 -0
- package/dist/extensions/pi-intercom/cwd.ts +31 -0
- package/dist/extensions/pi-intercom/extension-api.ts +84 -0
- package/dist/extensions/pi-intercom/format-context.test.ts +31 -0
- package/dist/extensions/pi-intercom/format-context.ts +32 -0
- package/dist/extensions/pi-intercom/index.ts +2821 -0
- package/dist/extensions/pi-intercom/intercom.integration.test.ts +4232 -0
- package/dist/extensions/pi-intercom/package.json +49 -0
- package/dist/extensions/pi-intercom/project-agent.test.ts +145 -0
- package/dist/extensions/pi-intercom/project-agent.ts +324 -0
- package/dist/extensions/pi-intercom/reply-tracker.test.ts +239 -0
- package/dist/extensions/pi-intercom/reply-tracker.ts +160 -0
- package/dist/extensions/pi-intercom/skills/pi-intercom/SKILL.md +452 -0
- package/dist/extensions/pi-intercom/test/inline-message.test.ts +184 -0
- package/dist/extensions/pi-intercom/test/overlay-width.test.ts +66 -0
- package/dist/extensions/pi-intercom/types.ts +165 -0
- package/dist/extensions/pi-intercom/ui/compose.ts +143 -0
- package/dist/extensions/pi-intercom/ui/inline-message.ts +118 -0
- package/dist/extensions/pi-intercom/ui/session-list.ts +166 -0
- package/dist/extensions/pi-rewind-hook/README.md +248 -0
- package/dist/extensions/pi-rewind-hook/index.ts +1575 -0
- package/dist/extensions/pi-rewind-hook/package.json +31 -0
- package/dist/extensions/pi-subagents/.github/assets/subagent-fleet-inspector.png +0 -0
- package/dist/extensions/pi-subagents/.github/workflows/release.yml +28 -0
- package/dist/extensions/pi-subagents/.github/workflows/test.yml +51 -0
- package/dist/extensions/pi-subagents/.greptile/config.json +33 -0
- package/dist/extensions/pi-subagents/.greptile/files.json +8 -0
- package/dist/extensions/pi-subagents/.greptile/rules.md +16 -0
- package/dist/extensions/pi-subagents/.oxlintrc.json +43 -0
- package/dist/extensions/pi-subagents/AGENTS.md +5 -0
- package/dist/extensions/pi-subagents/CHANGELOG.md +2325 -0
- package/dist/extensions/pi-subagents/LICENSE +21 -0
- package/dist/extensions/pi-subagents/README.md +126 -0
- package/dist/extensions/pi-subagents/VISION.md +92 -0
- package/dist/extensions/pi-subagents/agents/delegate.md +14 -0
- package/dist/extensions/pi-subagents/agents/oracle.md +78 -0
- package/dist/extensions/pi-subagents/agents/researcher.md +52 -0
- package/dist/extensions/pi-subagents/agents/reviewer.md +89 -0
- package/dist/extensions/pi-subagents/agents/scout.md +50 -0
- package/dist/extensions/pi-subagents/agents/worker.md +60 -0
- package/dist/extensions/pi-subagents/async-retention-discovery-worker.mjs +180 -0
- package/dist/extensions/pi-subagents/docs/agents.md +382 -0
- package/dist/extensions/pi-subagents/docs/configuration.md +534 -0
- package/dist/extensions/pi-subagents/docs/extension-api.md +443 -0
- package/dist/extensions/pi-subagents/docs/missions.md +121 -0
- package/dist/extensions/pi-subagents/docs/models.md +258 -0
- package/dist/extensions/pi-subagents/docs/observability.md +265 -0
- package/dist/extensions/pi-subagents/docs/tool-reference.md +482 -0
- package/dist/extensions/pi-subagents/docs/watchdog.md +154 -0
- package/dist/extensions/pi-subagents/docs/workflows.md +475 -0
- package/dist/extensions/pi-subagents/index.ts +10 -0
- package/dist/extensions/pi-subagents/inspector-runner.mjs +11 -0
- package/dist/extensions/pi-subagents/install.mjs +93 -0
- package/dist/extensions/pi-subagents/package-lock.json +1872 -0
- package/dist/extensions/pi-subagents/package.json +109 -0
- package/dist/extensions/pi-subagents/prompts/council.md +60 -0
- package/dist/extensions/pi-subagents/prompts/gather-context-and-clarify.md +13 -0
- package/dist/extensions/pi-subagents/prompts/parallel-cleanup.md +59 -0
- package/dist/extensions/pi-subagents/prompts/parallel-research.md +50 -0
- package/dist/extensions/pi-subagents/prompts/parallel-review.md +58 -0
- package/dist/extensions/pi-subagents/prompts/review-loop.md +47 -0
- package/dist/extensions/pi-subagents/skills/council-mode/SKILL.md +59 -0
- package/dist/extensions/pi-subagents/skills/council-mode/references/pass-contracts.md +150 -0
- package/dist/extensions/pi-subagents/skills/pi-subagents/SKILL.md +103 -0
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/constraints-and-recipes.md +70 -0
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/execution-controls.md +539 -0
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/management-authoring-rpc.md +161 -0
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/multi-lane-orchestration.md +51 -0
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/prompting-and-roles.md +295 -0
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/review-and-validation.md +73 -0
- package/dist/extensions/pi-subagents/src/agents/agent-management.ts +1373 -0
- package/dist/extensions/pi-subagents/src/agents/agent-memory.ts +254 -0
- package/dist/extensions/pi-subagents/src/agents/agent-refinements.ts +624 -0
- package/dist/extensions/pi-subagents/src/agents/agent-scope.ts +6 -0
- package/dist/extensions/pi-subagents/src/agents/agent-selection.ts +25 -0
- package/dist/extensions/pi-subagents/src/agents/agent-serializer.ts +179 -0
- package/dist/extensions/pi-subagents/src/agents/agents.ts +2790 -0
- package/dist/extensions/pi-subagents/src/agents/builtin-names.ts +9 -0
- package/dist/extensions/pi-subagents/src/agents/chain-serializer.ts +280 -0
- package/dist/extensions/pi-subagents/src/agents/frontmatter.ts +153 -0
- package/dist/extensions/pi-subagents/src/agents/identity.ts +30 -0
- package/dist/extensions/pi-subagents/src/agents/proactive-skills.ts +194 -0
- package/dist/extensions/pi-subagents/src/agents/runtime-agent-events.ts +70 -0
- package/dist/extensions/pi-subagents/src/agents/runtime-agent-registry.ts +429 -0
- package/dist/extensions/pi-subagents/src/agents/skills.ts +754 -0
- package/dist/extensions/pi-subagents/src/api/agents.ts +12 -0
- package/dist/extensions/pi-subagents/src/api/background-work.ts +206 -0
- package/dist/extensions/pi-subagents/src/api/capability-ceiling.ts +17 -0
- package/dist/extensions/pi-subagents/src/api/control-channel.ts +4 -0
- package/dist/extensions/pi-subagents/src/api/delegation.ts +112 -0
- package/dist/extensions/pi-subagents/src/api/external-job-provider.ts +195 -0
- package/dist/extensions/pi-subagents/src/api/external-runs.ts +282 -0
- package/dist/extensions/pi-subagents/src/api/intercom-bridge.ts +3 -0
- package/dist/extensions/pi-subagents/src/api/pi-args.ts +5 -0
- package/dist/extensions/pi-subagents/src/api/preflight.ts +501 -0
- package/dist/extensions/pi-subagents/src/api/project-panes.ts +32 -0
- package/dist/extensions/pi-subagents/src/api/shared-types.ts +27 -0
- package/dist/extensions/pi-subagents/src/extension/config.ts +255 -0
- package/dist/extensions/pi-subagents/src/extension/control-notices.ts +58 -0
- package/dist/extensions/pi-subagents/src/extension/doctor.ts +278 -0
- package/dist/extensions/pi-subagents/src/extension/fanout-child.ts +205 -0
- package/dist/extensions/pi-subagents/src/extension/index.ts +1093 -0
- package/dist/extensions/pi-subagents/src/extension/public-execution.ts +210 -0
- package/dist/extensions/pi-subagents/src/extension/rpc.ts +860 -0
- package/dist/extensions/pi-subagents/src/extension/schemas.ts +419 -0
- package/dist/extensions/pi-subagents/src/extension/steering-notices.ts +35 -0
- package/dist/extensions/pi-subagents/src/extension/subagent-guide.ts +39 -0
- package/dist/extensions/pi-subagents/src/extension/tool-description.ts +204 -0
- package/dist/extensions/pi-subagents/src/extension/tool-result.ts +19 -0
- package/dist/extensions/pi-subagents/src/inspectors/herdr/actions.ts +235 -0
- package/dist/extensions/pi-subagents/src/inspectors/herdr/client.ts +130 -0
- package/dist/extensions/pi-subagents/src/inspectors/herdr/focus.ts +55 -0
- package/dist/extensions/pi-subagents/src/inspectors/herdr/inspector-runner.ts +153 -0
- package/dist/extensions/pi-subagents/src/inspectors/herdr/project-panes.ts +730 -0
- package/dist/extensions/pi-subagents/src/inspectors/herdr/session-roots-codec.ts +42 -0
- package/dist/extensions/pi-subagents/src/inspectors/herdr/shell-command.ts +16 -0
- package/dist/extensions/pi-subagents/src/integrations/herdr-status.ts +396 -0
- package/dist/extensions/pi-subagents/src/intercom/intercom-bridge.ts +191 -0
- package/dist/extensions/pi-subagents/src/intercom/native-supervisor-channel.ts +812 -0
- package/dist/extensions/pi-subagents/src/intercom/result-intercom.ts +423 -0
- package/dist/extensions/pi-subagents/src/missions/actions.ts +433 -0
- package/dist/extensions/pi-subagents/src/missions/goal-driver.ts +164 -0
- package/dist/extensions/pi-subagents/src/missions/lifecycle.ts +367 -0
- package/dist/extensions/pi-subagents/src/missions/store.ts +584 -0
- package/dist/extensions/pi-subagents/src/missions/types.ts +190 -0
- package/dist/extensions/pi-subagents/src/missions/workflow-state.ts +260 -0
- package/dist/extensions/pi-subagents/src/policy/authority.ts +46 -0
- package/dist/extensions/pi-subagents/src/profiles/profiles.ts +662 -0
- package/dist/extensions/pi-subagents/src/runs/background/active-async-capacity.ts +516 -0
- package/dist/extensions/pi-subagents/src/runs/background/active-run-index.ts +139 -0
- package/dist/extensions/pi-subagents/src/runs/background/async-execution.ts +2080 -0
- package/dist/extensions/pi-subagents/src/runs/background/async-job-tracker.ts +781 -0
- package/dist/extensions/pi-subagents/src/runs/background/async-resume.ts +631 -0
- package/dist/extensions/pi-subagents/src/runs/background/async-retention.ts +903 -0
- package/dist/extensions/pi-subagents/src/runs/background/async-status-snapshot.ts +48 -0
- package/dist/extensions/pi-subagents/src/runs/background/async-status.ts +761 -0
- package/dist/extensions/pi-subagents/src/runs/background/auto-drain.ts +68 -0
- package/dist/extensions/pi-subagents/src/runs/background/chain-append.ts +321 -0
- package/dist/extensions/pi-subagents/src/runs/background/chain-root-attachment.ts +270 -0
- package/dist/extensions/pi-subagents/src/runs/background/completion-batcher.ts +168 -0
- package/dist/extensions/pi-subagents/src/runs/background/completion-dedupe.ts +58 -0
- package/dist/extensions/pi-subagents/src/runs/background/completion-replay.ts +287 -0
- package/dist/extensions/pi-subagents/src/runs/background/control-channel.ts +768 -0
- package/dist/extensions/pi-subagents/src/runs/background/fleet-view.ts +620 -0
- package/dist/extensions/pi-subagents/src/runs/background/index-segment.ts +59 -0
- package/dist/extensions/pi-subagents/src/runs/background/inspect-rpc.ts +443 -0
- package/dist/extensions/pi-subagents/src/runs/background/notify.ts +645 -0
- package/dist/extensions/pi-subagents/src/runs/background/owned-process-tree.ts +104 -0
- package/dist/extensions/pi-subagents/src/runs/background/parallel-groups.ts +45 -0
- package/dist/extensions/pi-subagents/src/runs/background/process-terminal.ts +310 -0
- package/dist/extensions/pi-subagents/src/runs/background/result-delivery-ownership.ts +45 -0
- package/dist/extensions/pi-subagents/src/runs/background/result-files.ts +519 -0
- package/dist/extensions/pi-subagents/src/runs/background/result-watcher.ts +792 -0
- package/dist/extensions/pi-subagents/src/runs/background/resume-guidance.ts +56 -0
- package/dist/extensions/pi-subagents/src/runs/background/retained-children.ts +135 -0
- package/dist/extensions/pi-subagents/src/runs/background/run-id-query.ts +7 -0
- package/dist/extensions/pi-subagents/src/runs/background/run-id-resolver.ts +175 -0
- package/dist/extensions/pi-subagents/src/runs/background/run-status.ts +714 -0
- package/dist/extensions/pi-subagents/src/runs/background/scheduled-runs.ts +965 -0
- package/dist/extensions/pi-subagents/src/runs/background/stale-run-reconciler.ts +410 -0
- package/dist/extensions/pi-subagents/src/runs/background/steering.ts +242 -0
- package/dist/extensions/pi-subagents/src/runs/background/subagent-runner.ts +5683 -0
- package/dist/extensions/pi-subagents/src/runs/background/subagent-wait.ts +725 -0
- package/dist/extensions/pi-subagents/src/runs/background/terminal-run-index.ts +138 -0
- package/dist/extensions/pi-subagents/src/runs/background/top-level-async.ts +14 -0
- package/dist/extensions/pi-subagents/src/runs/background/wait-completions.ts +209 -0
- package/dist/extensions/pi-subagents/src/runs/background/wait-config.ts +50 -0
- package/dist/extensions/pi-subagents/src/runs/background/wait-subscriptions.ts +348 -0
- package/dist/extensions/pi-subagents/src/runs/background/wait-tool.ts +51 -0
- package/dist/extensions/pi-subagents/src/runs/foreground/async-dismiss-action.ts +86 -0
- package/dist/extensions/pi-subagents/src/runs/foreground/async-steering-action.ts +262 -0
- package/dist/extensions/pi-subagents/src/runs/foreground/async-stop-action.ts +86 -0
- package/dist/extensions/pi-subagents/src/runs/foreground/execution.ts +2443 -0
- package/dist/extensions/pi-subagents/src/runs/foreground/foreground-control.ts +153 -0
- package/dist/extensions/pi-subagents/src/runs/foreground/foreground-history.ts +160 -0
- package/dist/extensions/pi-subagents/src/runs/foreground/prompt-audit.ts +172 -0
- package/dist/extensions/pi-subagents/src/runs/foreground/subagent-executor.ts +6971 -0
- package/dist/extensions/pi-subagents/src/runs/foreground/workflow-detach-reconcile.ts +299 -0
- package/dist/extensions/pi-subagents/src/runs/foreground/workflow-foreground-steering.ts +188 -0
- package/dist/extensions/pi-subagents/src/runs/shared/abort-recovery.ts +119 -0
- package/dist/extensions/pi-subagents/src/runs/shared/acceptance.ts +1525 -0
- package/dist/extensions/pi-subagents/src/runs/shared/agent-contract.ts +38 -0
- package/dist/extensions/pi-subagents/src/runs/shared/async-status-projection.ts +565 -0
- package/dist/extensions/pi-subagents/src/runs/shared/background-process-options.ts +9 -0
- package/dist/extensions/pi-subagents/src/runs/shared/capability-ceiling.ts +210 -0
- package/dist/extensions/pi-subagents/src/runs/shared/chain-outputs.ts +116 -0
- package/dist/extensions/pi-subagents/src/runs/shared/child-identity.ts +51 -0
- package/dist/extensions/pi-subagents/src/runs/shared/child-launch-plan.ts +151 -0
- package/dist/extensions/pi-subagents/src/runs/shared/child-protocol.ts +415 -0
- package/dist/extensions/pi-subagents/src/runs/shared/completion-evidence.ts +89 -0
- package/dist/extensions/pi-subagents/src/runs/shared/completion-guard.ts +252 -0
- package/dist/extensions/pi-subagents/src/runs/shared/context-mode.ts +44 -0
- package/dist/extensions/pi-subagents/src/runs/shared/dynamic-fanout.ts +297 -0
- package/dist/extensions/pi-subagents/src/runs/shared/extension-bindings.ts +78 -0
- package/dist/extensions/pi-subagents/src/runs/shared/external-cli-contract.ts +138 -0
- package/dist/extensions/pi-subagents/src/runs/shared/external-cli-preflight.ts +122 -0
- package/dist/extensions/pi-subagents/src/runs/shared/external-cli-runner.ts +429 -0
- package/dist/extensions/pi-subagents/src/runs/shared/external-job-bridge.ts +460 -0
- package/dist/extensions/pi-subagents/src/runs/shared/external-job-runner.ts +389 -0
- package/dist/extensions/pi-subagents/src/runs/shared/fast-mode-extension.ts +10 -0
- package/dist/extensions/pi-subagents/src/runs/shared/host-step-status.ts +231 -0
- package/dist/extensions/pi-subagents/src/runs/shared/lane-metadata.ts +126 -0
- package/dist/extensions/pi-subagents/src/runs/shared/launch-cwd.ts +16 -0
- package/dist/extensions/pi-subagents/src/runs/shared/llm-intent-arbiter.ts +302 -0
- package/dist/extensions/pi-subagents/src/runs/shared/long-running-guard.ts +221 -0
- package/dist/extensions/pi-subagents/src/runs/shared/mcp-config-sources.ts +422 -0
- package/dist/extensions/pi-subagents/src/runs/shared/mcp-direct-tool-allowlist.ts +483 -0
- package/dist/extensions/pi-subagents/src/runs/shared/mcp-direct-tool-grant.ts +194 -0
- package/dist/extensions/pi-subagents/src/runs/shared/model-exclusions.ts +305 -0
- package/dist/extensions/pi-subagents/src/runs/shared/model-fallback.ts +578 -0
- package/dist/extensions/pi-subagents/src/runs/shared/model-scope.ts +205 -0
- package/dist/extensions/pi-subagents/src/runs/shared/mutation-evidence.ts +199 -0
- package/dist/extensions/pi-subagents/src/runs/shared/nested-events.ts +1086 -0
- package/dist/extensions/pi-subagents/src/runs/shared/nested-path.ts +52 -0
- package/dist/extensions/pi-subagents/src/runs/shared/nested-render.ts +127 -0
- package/dist/extensions/pi-subagents/src/runs/shared/orca-progress-tabs.ts +499 -0
- package/dist/extensions/pi-subagents/src/runs/shared/parallel-handoff.ts +696 -0
- package/dist/extensions/pi-subagents/src/runs/shared/parallel-utils.ts +275 -0
- package/dist/extensions/pi-subagents/src/runs/shared/permissions.ts +100 -0
- package/dist/extensions/pi-subagents/src/runs/shared/pi-args.ts +1059 -0
- package/dist/extensions/pi-subagents/src/runs/shared/pi-spawn.ts +199 -0
- package/dist/extensions/pi-subagents/src/runs/shared/process-signal.ts +32 -0
- package/dist/extensions/pi-subagents/src/runs/shared/run-fanout-budget.ts +280 -0
- package/dist/extensions/pi-subagents/src/runs/shared/run-history.ts +201 -0
- package/dist/extensions/pi-subagents/src/runs/shared/runtime-acknowledged-extensions.ts +71 -0
- package/dist/extensions/pi-subagents/src/runs/shared/session-lease.ts +293 -0
- package/dist/extensions/pi-subagents/src/runs/shared/single-output.ts +304 -0
- package/dist/extensions/pi-subagents/src/runs/shared/spawn-budget.ts +128 -0
- package/dist/extensions/pi-subagents/src/runs/shared/structured-output.ts +223 -0
- package/dist/extensions/pi-subagents/src/runs/shared/subagent-control.ts +292 -0
- package/dist/extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.ts +825 -0
- package/dist/extensions/pi-subagents/src/runs/shared/subagent-startup-retry.ts +116 -0
- package/dist/extensions/pi-subagents/src/runs/shared/task-intent.ts +211 -0
- package/dist/extensions/pi-subagents/src/runs/shared/tool-availability.ts +81 -0
- package/dist/extensions/pi-subagents/src/runs/shared/tool-budget.ts +80 -0
- package/dist/extensions/pi-subagents/src/runs/shared/tool-timeout.ts +93 -0
- package/dist/extensions/pi-subagents/src/runs/shared/usage-budget.ts +65 -0
- package/dist/extensions/pi-subagents/src/runs/shared/workflow-graph.ts +225 -0
- package/dist/extensions/pi-subagents/src/runs/shared/worktree-cleanup-plan.ts +847 -0
- package/dist/extensions/pi-subagents/src/runs/shared/worktree.ts +1206 -0
- package/dist/extensions/pi-subagents/src/shared/accessible-dir.ts +47 -0
- package/dist/extensions/pi-subagents/src/shared/agent-stream-options.ts +5 -0
- package/dist/extensions/pi-subagents/src/shared/artifacts.ts +281 -0
- package/dist/extensions/pi-subagents/src/shared/atomic-json.ts +83 -0
- package/dist/extensions/pi-subagents/src/shared/capacity-resilient-json.ts +102 -0
- package/dist/extensions/pi-subagents/src/shared/child-session-name.ts +46 -0
- package/dist/extensions/pi-subagents/src/shared/child-transcript.ts +264 -0
- package/dist/extensions/pi-subagents/src/shared/completion-owner.ts +14 -0
- package/dist/extensions/pi-subagents/src/shared/display-text.ts +150 -0
- package/dist/extensions/pi-subagents/src/shared/extension-context.ts +24 -0
- package/dist/extensions/pi-subagents/src/shared/file-coalescer.ts +49 -0
- package/dist/extensions/pi-subagents/src/shared/file-system-retry.ts +95 -0
- package/dist/extensions/pi-subagents/src/shared/fork-context.ts +293 -0
- package/dist/extensions/pi-subagents/src/shared/fork-session-cwd.ts +27 -0
- package/dist/extensions/pi-subagents/src/shared/formatters.ts +146 -0
- package/dist/extensions/pi-subagents/src/shared/jsonl-writer.ts +81 -0
- package/dist/extensions/pi-subagents/src/shared/launch-contract.ts +138 -0
- package/dist/extensions/pi-subagents/src/shared/model-info.ts +101 -0
- package/dist/extensions/pi-subagents/src/shared/node-executable.ts +21 -0
- package/dist/extensions/pi-subagents/src/shared/post-exit-stdio-guard.ts +85 -0
- package/dist/extensions/pi-subagents/src/shared/prompt-resources.ts +11 -0
- package/dist/extensions/pi-subagents/src/shared/pruned-fork.ts +450 -0
- package/dist/extensions/pi-subagents/src/shared/session-file-trust.ts +19 -0
- package/dist/extensions/pi-subagents/src/shared/session-identity.ts +10 -0
- package/dist/extensions/pi-subagents/src/shared/session-tokens.ts +55 -0
- package/dist/extensions/pi-subagents/src/shared/settings.ts +409 -0
- package/dist/extensions/pi-subagents/src/shared/shortcuts.ts +17 -0
- package/dist/extensions/pi-subagents/src/shared/status-format.ts +55 -0
- package/dist/extensions/pi-subagents/src/shared/thinking-ceiling.ts +52 -0
- package/dist/extensions/pi-subagents/src/shared/types.ts +2872 -0
- package/dist/extensions/pi-subagents/src/shared/utf8.ts +11 -0
- package/dist/extensions/pi-subagents/src/shared/utils.ts +601 -0
- package/dist/extensions/pi-subagents/src/shared/watch-strategy.ts +10 -0
- package/dist/extensions/pi-subagents/src/shared/workflow-child-permit.ts +207 -0
- package/dist/extensions/pi-subagents/src/slash/delegation-adapters.ts +426 -0
- package/dist/extensions/pi-subagents/src/slash/delegation-json.ts +108 -0
- package/dist/extensions/pi-subagents/src/slash/delegation-request.ts +162 -0
- package/dist/extensions/pi-subagents/src/slash/prompt-template-bridge.ts +419 -0
- package/dist/extensions/pi-subagents/src/slash/prompt-workflows.ts +287 -0
- package/dist/extensions/pi-subagents/src/slash/selector.ts +147 -0
- package/dist/extensions/pi-subagents/src/slash/slash-bridge.ts +192 -0
- package/dist/extensions/pi-subagents/src/slash/slash-commands.ts +1345 -0
- package/dist/extensions/pi-subagents/src/slash/slash-live-state.ts +310 -0
- package/dist/extensions/pi-subagents/src/slash/subagents-admin.ts +449 -0
- package/dist/extensions/pi-subagents/src/tui/fleet-status.ts +964 -0
- package/dist/extensions/pi-subagents/src/tui/fleet-transcript.ts +536 -0
- package/dist/extensions/pi-subagents/src/tui/fleet.ts +1441 -0
- package/dist/extensions/pi-subagents/src/tui/render-helpers.ts +111 -0
- package/dist/extensions/pi-subagents/src/tui/render.ts +3359 -0
- package/dist/extensions/pi-subagents/src/types/pi-runtime-compat.d.ts +8 -0
- package/dist/extensions/pi-subagents/src/watchdog/change-signature.ts +260 -0
- package/dist/extensions/pi-subagents/src/watchdog/child-status.ts +227 -0
- package/dist/extensions/pi-subagents/src/watchdog/diff-tool.ts +77 -0
- package/dist/extensions/pi-subagents/src/watchdog/emission-guard.ts +125 -0
- package/dist/extensions/pi-subagents/src/watchdog/guidance.ts +20 -0
- package/dist/extensions/pi-subagents/src/watchdog/lsp-diagnostics.ts +538 -0
- package/dist/extensions/pi-subagents/src/watchdog/model-selection.ts +167 -0
- package/dist/extensions/pi-subagents/src/watchdog/permission-arbiter.ts +154 -0
- package/dist/extensions/pi-subagents/src/watchdog/register-child.ts +120 -0
- package/dist/extensions/pi-subagents/src/watchdog/register-main.ts +441 -0
- package/dist/extensions/pi-subagents/src/watchdog/render.ts +53 -0
- package/dist/extensions/pi-subagents/src/watchdog/review.ts +314 -0
- package/dist/extensions/pi-subagents/src/watchdog/rules.ts +70 -0
- package/dist/extensions/pi-subagents/src/watchdog/runtime.ts +851 -0
- package/dist/extensions/pi-subagents/src/watchdog/scope.ts +63 -0
- package/dist/extensions/pi-subagents/src/watchdog/settings.ts +512 -0
- package/dist/extensions/pi-subagents/src/watchdog/tool-actions.ts +155 -0
- package/dist/extensions/pi-subagents/src/watchdog/turn-delta.ts +161 -0
- package/dist/extensions/pi-subagents/src/watchdog/types.ts +184 -0
- package/dist/extensions/pi-subagents/src/watchdog/warning-format.ts +72 -0
- package/dist/extensions/pi-subagents/src/workflows/chat-progress.ts +152 -0
- package/dist/extensions/pi-subagents/src/workflows/host-command.ts +235 -0
- package/dist/extensions/pi-subagents/src/workflows/scripted-workflow.ts +2183 -0
- package/dist/extensions/pi-subagents/src/workflows/workflow-checklist.ts +439 -0
- package/dist/extensions/pi-subagents/src/workflows/workflow-child-summary.ts +121 -0
- package/dist/extensions/pi-subagents/src/workflows/workflow-preflight.ts +297 -0
- package/dist/extensions/pi-subagents/src/workflows/workflow-receipt.ts +330 -0
- package/dist/extensions/pi-subagents/src/workflows/workflow-resources.ts +150 -0
- package/dist/extensions/pi-subagents/src/workflows/workflow-settlement.ts +246 -0
- package/dist/extensions/pi-subagents/test/e2e/real-session-subagent.test.ts +224 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/bun/cli.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/bun/register-bedrock.d.ts +2 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/bun/restore-sandbox-env.d.ts +17 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/args.d.ts +57 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/config-selector.d.ts +16 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/file-processor.d.ts +15 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/initial-message.d.ts +18 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/list-models.d.ts +9 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/project-trust.d.ts +10 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/session-picker.d.ts +10 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/startup-ui.d.ts +20 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/config.d.ts +96 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/agent-session-runtime.d.ts +119 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/agent-session-services.d.ts +85 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/agent-session.d.ts +620 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/auth-guidance.d.ts +5 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/auth-storage.d.ts +56 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/bash-executor.d.ts +32 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/cache-stats.d.ts +49 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/compaction/branch-summarization.d.ts +93 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/compaction/compaction.d.ts +128 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/compaction/index.d.ts +7 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/compaction/utils.d.ts +38 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/defaults.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/diagnostics.d.ts +15 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/event-bus.d.ts +9 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/exec.d.ts +29 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/experimental.d.ts +2 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/export-html/ansi-to-html.d.ts +22 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/export-html/index.d.ts +37 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/export-html/tool-renderer.d.ts +34 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/extensions/index.d.ts +12 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/extensions/loader.d.ts +23 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/extensions/runner.d.ts +171 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/extensions/types.d.ts +1261 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/extensions/wrapper.d.ts +20 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/footer-data-provider.d.ts +54 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/http-dispatcher.d.ts +22 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/index.d.ts +13 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/keybindings.d.ts +358 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/messages.d.ts +77 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/model-config.d.ts +512 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/model-registry.d.ts +43 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/model-resolver.d.ts +121 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/model-runtime.d.ts +82 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/models-store.d.ts +17 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/output-guard.d.ts +7 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/package-manager.d.ts +210 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/project-trust.d.ts +15 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/prompt-templates.d.ts +54 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/provider-attribution.d.ts +4 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/provider-composer.d.ts +55 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/radius.d.ts +2 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/remote-catalog-provider.d.ts +5 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/resolve-config-value.d.ts +30 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/resource-loader.d.ts +206 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/runtime-credentials.d.ts +15 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/sdk.d.ts +106 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/session-cwd.d.ts +19 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/session-manager.d.ts +356 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/settings-manager.d.ts +297 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/skills.d.ts +60 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/slash-commands.d.ts +15 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/source-info.d.ts +18 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/system-prompt.d.ts +28 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/telemetry.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/timings.d.ts +10 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/bash.d.ts +68 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/edit-diff.d.ts +106 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/edit.d.ts +51 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/file-mutation-queue.d.ts +6 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/find.d.ts +35 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/grep.d.ts +37 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/index.d.ts +40 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/ls.d.ts +37 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/output-accumulator.d.ts +52 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/path-utils.d.ts +10 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/read.d.ts +35 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/render-utils.d.ts +24 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/tool-definition-wrapper.d.ts +14 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/truncate.d.ts +70 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/write.d.ts +26 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/trust-manager.d.ts +36 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/usage-totals.d.ts +19 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/extensions/index.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/extensions/llama/client.d.ts +61 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/extensions/llama/huggingface.d.ts +23 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/extensions/llama/index.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/extensions/llama/provider.d.ts +10 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/extensions/llama/ui.d.ts +42 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/index.d.ts +35 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/main.d.ts +12 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/migrations.d.ts +33 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/index.d.ts +9 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/armin.d.ts +34 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/assistant-message.d.ts +22 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/bash-execution.d.ts +34 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/bordered-loader.d.ts +16 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/branch-summary-message.d.ts +16 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/compaction-summary-message.d.ts +16 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/config-selector.d.ts +102 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/countdown-timer.d.ts +14 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/custom-editor.d.ts +21 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/custom-entry.d.ts +19 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/custom-message.d.ts +20 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/daxnuts.d.ts +23 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/diff.d.ts +12 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/dynamic-border.d.ts +15 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/earendil-announcement.d.ts +5 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/extension-editor.d.ts +22 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/extension-input.d.ts +23 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/extension-selector.d.ts +26 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/first-time-setup.d.ts +25 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/footer.d.ts +32 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/index.d.ts +34 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/keybinding-hints.d.ts +13 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/login-dialog.d.ts +52 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/model-selector.d.ts +54 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/oauth-selector.d.ts +33 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/scoped-models-selector.d.ts +42 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/session-selector-search.d.ts +23 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/session-selector.d.ts +95 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/settings-selector.d.ts +77 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/show-images-selector.d.ts +10 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/skill-invocation-message.d.ts +17 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/status-indicator.d.ts +28 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/theme-selector.d.ts +11 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/thinking-selector.d.ts +11 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/tool-execution.d.ts +63 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/tree-selector.d.ts +94 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/trust-selector.d.ts +23 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/user-message-selector.d.ts +30 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/user-message.d.ts +14 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/visual-truncate.d.ts +24 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/interactive-mode.d.ts +394 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/model-search.d.ts +12 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/theme/theme-controller.d.ts +29 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/theme/theme.d.ts +120 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/print-mode.d.ts +28 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/rpc/jsonl.d.ts +17 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/rpc/rpc-client.d.ts +246 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/rpc/rpc-mode.d.ts +20 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/rpc/rpc-types.d.ts +457 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/package-manager-cli.d.ts +8 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/rpc-entry.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/ansi.d.ts +2 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/changelog.d.ts +22 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/child-process.d.ts +18 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/clipboard-image.d.ts +11 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/clipboard-native.d.ts +11 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/clipboard.d.ts +4 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/deprecation.d.ts +4 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/exif-orientation.d.ts +5 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/frontmatter.d.ts +8 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/fs-watch.d.ts +5 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/git.d.ts +26 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/html.d.ts +7 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/image-convert.d.ts +10 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/image-process.d.ts +18 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/image-resize-core.d.ts +30 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/image-resize-worker.d.ts +2 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/image-resize.d.ts +16 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/json.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/mime.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/open-browser.d.ts +9 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/paths.d.ts +31 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/photon.d.ts +21 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/pi-user-agent.d.ts +2 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/shell.d.ts +31 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/sleep.d.ts +5 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/syntax-highlight.d.ts +12 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/tools-manager.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/version-check.d.ts +15 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/windows-self-update.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/index.mjs +84 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/package.json +14 -0
- package/dist/extensions/pi-subagents/test/integration/acceptance-file-report.test.ts +472 -0
- package/dist/extensions/pi-subagents/test/integration/async-execution.test.ts +6986 -0
- package/dist/extensions/pi-subagents/test/integration/async-job-tracker.test.ts +2000 -0
- package/dist/extensions/pi-subagents/test/integration/async-status.test.ts +1300 -0
- package/dist/extensions/pi-subagents/test/integration/detect-error.test.ts +249 -0
- package/dist/extensions/pi-subagents/test/integration/doctor-executor.test.ts +128 -0
- package/dist/extensions/pi-subagents/test/integration/error-handling.test.ts +281 -0
- package/dist/extensions/pi-subagents/test/integration/external-cli-runner.test.ts +167 -0
- package/dist/extensions/pi-subagents/test/integration/foreground-result-size.test.ts +188 -0
- package/dist/extensions/pi-subagents/test/integration/fork-context-execution.test.ts +1356 -0
- package/dist/extensions/pi-subagents/test/integration/intercom-result-delivery.test.ts +1946 -0
- package/dist/extensions/pi-subagents/test/integration/orca-progress-tabs.test.ts +214 -0
- package/dist/extensions/pi-subagents/test/integration/render-fork-badge.test.ts +1408 -0
- package/dist/extensions/pi-subagents/test/integration/render-widget.test.ts +2094 -0
- package/dist/extensions/pi-subagents/test/integration/result-watcher.test.ts +2442 -0
- package/dist/extensions/pi-subagents/test/integration/session-tokens.test.ts +62 -0
- package/dist/extensions/pi-subagents/test/integration/single-execution.test.ts +9292 -0
- package/dist/extensions/pi-subagents/test/integration/slash-commands.test.ts +1517 -0
- package/dist/extensions/pi-subagents/test/integration/slash-live-state.test.ts +166 -0
- package/dist/extensions/pi-subagents/test/integration/template-resolution.test.ts +344 -0
- package/dist/extensions/pi-subagents/test/integration/top-level-async.test.ts +43 -0
- package/dist/extensions/pi-subagents/test/support/cursor-smoke-inputs.ts +51 -0
- package/dist/extensions/pi-subagents/test/support/helpers.ts +250 -0
- package/dist/extensions/pi-subagents/test/support/isolated-temp-root.mjs +20 -0
- package/dist/extensions/pi-subagents/test/support/mock-pi-script.mjs +447 -0
- package/dist/extensions/pi-subagents/test/support/mock-pi.ts +159 -0
- package/dist/extensions/pi-subagents/test/support/node-command.ts +15 -0
- package/dist/extensions/pi-subagents/test/support/real-session-child-cli.mjs +185 -0
- package/dist/extensions/pi-subagents/test/support/real-session-runner.ts +311 -0
- package/dist/extensions/pi-subagents/test/support/register-loader.mjs +16 -0
- package/dist/extensions/pi-subagents/test/support/session-lease-child.mjs +42 -0
- package/dist/extensions/pi-subagents/test/support/ts-loader.mjs +100 -0
- package/dist/extensions/pi-subagents/test/unit/abort-recovery.test.ts +152 -0
- package/dist/extensions/pi-subagents/test/unit/acceptance.test.ts +1556 -0
- package/dist/extensions/pi-subagents/test/unit/accessible-dir.test.ts +82 -0
- package/dist/extensions/pi-subagents/test/unit/active-async-capacity.test.ts +463 -0
- package/dist/extensions/pi-subagents/test/unit/agent-contract.test.ts +14 -0
- package/dist/extensions/pi-subagents/test/unit/agent-disabled.test.ts +213 -0
- package/dist/extensions/pi-subagents/test/unit/agent-discovery-cache.test.ts +232 -0
- package/dist/extensions/pi-subagents/test/unit/agent-eject-disable.test.ts +343 -0
- package/dist/extensions/pi-subagents/test/unit/agent-frontmatter.test.ts +2324 -0
- package/dist/extensions/pi-subagents/test/unit/agent-management.test.ts +1408 -0
- package/dist/extensions/pi-subagents/test/unit/agent-memory.test.ts +420 -0
- package/dist/extensions/pi-subagents/test/unit/agent-overrides.test.ts +1174 -0
- package/dist/extensions/pi-subagents/test/unit/agent-refinements.test.ts +178 -0
- package/dist/extensions/pi-subagents/test/unit/agent-scan-dirs.test.ts +133 -0
- package/dist/extensions/pi-subagents/test/unit/agent-scope.test.ts +20 -0
- package/dist/extensions/pi-subagents/test/unit/agent-selection.test.ts +88 -0
- package/dist/extensions/pi-subagents/test/unit/agent-stream-options.test.ts +14 -0
- package/dist/extensions/pi-subagents/test/unit/anti-slop-oxlint.test.ts +98 -0
- package/dist/extensions/pi-subagents/test/unit/artifacts.test.ts +78 -0
- package/dist/extensions/pi-subagents/test/unit/async-execution.test.ts +280 -0
- package/dist/extensions/pi-subagents/test/unit/async-interrupt-action.test.ts +1022 -0
- package/dist/extensions/pi-subagents/test/unit/async-permission-session.test.ts +100 -0
- package/dist/extensions/pi-subagents/test/unit/async-recovery-descriptor.test.ts +188 -0
- package/dist/extensions/pi-subagents/test/unit/async-resume.test.ts +978 -0
- package/dist/extensions/pi-subagents/test/unit/async-retention.test.ts +635 -0
- package/dist/extensions/pi-subagents/test/unit/async-status-projection.test.ts +260 -0
- package/dist/extensions/pi-subagents/test/unit/async-status-snapshot.test.ts +204 -0
- package/dist/extensions/pi-subagents/test/unit/atomic-json.test.ts +192 -0
- package/dist/extensions/pi-subagents/test/unit/authority-policy.test.ts +22 -0
- package/dist/extensions/pi-subagents/test/unit/auto-drain.test.ts +83 -0
- package/dist/extensions/pi-subagents/test/unit/background-process-options.test.ts +17 -0
- package/dist/extensions/pi-subagents/test/unit/background-work.test.ts +365 -0
- package/dist/extensions/pi-subagents/test/unit/capability-ceiling-agent-allowlist.test.ts +102 -0
- package/dist/extensions/pi-subagents/test/unit/capability-ceiling-pi-args.test.ts +84 -0
- package/dist/extensions/pi-subagents/test/unit/capability-ceiling.test.ts +68 -0
- package/dist/extensions/pi-subagents/test/unit/capacity-resilient-json.test.ts +155 -0
- package/dist/extensions/pi-subagents/test/unit/chain-append.test.ts +283 -0
- package/dist/extensions/pi-subagents/test/unit/chain-root-attachment.test.ts +236 -0
- package/dist/extensions/pi-subagents/test/unit/chain-serializer.test.ts +229 -0
- package/dist/extensions/pi-subagents/test/unit/child-launch-plan.test.ts +94 -0
- package/dist/extensions/pi-subagents/test/unit/child-protocol.test.ts +202 -0
- package/dist/extensions/pi-subagents/test/unit/child-session-name.test.ts +50 -0
- package/dist/extensions/pi-subagents/test/unit/child-transcript.test.ts +267 -0
- package/dist/extensions/pi-subagents/test/unit/close-grace-timer.test.ts +101 -0
- package/dist/extensions/pi-subagents/test/unit/compaction-resume.test.ts +98 -0
- package/dist/extensions/pi-subagents/test/unit/completion-batcher.test.ts +230 -0
- package/dist/extensions/pi-subagents/test/unit/completion-dedupe.test.ts +35 -0
- package/dist/extensions/pi-subagents/test/unit/completion-evidence.test.ts +150 -0
- package/dist/extensions/pi-subagents/test/unit/completion-guard.test.ts +753 -0
- package/dist/extensions/pi-subagents/test/unit/completion-replay.test.ts +305 -0
- package/dist/extensions/pi-subagents/test/unit/config-dir-runtime.test.ts +107 -0
- package/dist/extensions/pi-subagents/test/unit/control-channel.test.ts +630 -0
- package/dist/extensions/pi-subagents/test/unit/control-notices.test.ts +110 -0
- package/dist/extensions/pi-subagents/test/unit/cursor-smoke-inputs.test.ts +77 -0
- package/dist/extensions/pi-subagents/test/unit/default-extensions.test.ts +219 -0
- package/dist/extensions/pi-subagents/test/unit/delegation-api.test.ts +588 -0
- package/dist/extensions/pi-subagents/test/unit/doctor.test.ts +201 -0
- package/dist/extensions/pi-subagents/test/unit/dynamic-fanout.test.ts +219 -0
- package/dist/extensions/pi-subagents/test/unit/ensure-accessible-dir.test.ts +125 -0
- package/dist/extensions/pi-subagents/test/unit/extension-bindings.test.ts +79 -0
- package/dist/extensions/pi-subagents/test/unit/extension-context.test.ts +27 -0
- package/dist/extensions/pi-subagents/test/unit/external-cli-runner.test.ts +339 -0
- package/dist/extensions/pi-subagents/test/unit/external-job-runner.test.ts +961 -0
- package/dist/extensions/pi-subagents/test/unit/external-runs.test.ts +261 -0
- package/dist/extensions/pi-subagents/test/unit/extra-agent-dirs.test.ts +88 -0
- package/dist/extensions/pi-subagents/test/unit/fast-mode-extension.test.ts +27 -0
- package/dist/extensions/pi-subagents/test/unit/file-coalescer.test.ts +83 -0
- package/dist/extensions/pi-subagents/test/unit/file-system-retry.test.ts +64 -0
- package/dist/extensions/pi-subagents/test/unit/fleet-status.test.ts +1377 -0
- package/dist/extensions/pi-subagents/test/unit/fleet-transcript.test.ts +435 -0
- package/dist/extensions/pi-subagents/test/unit/fleet.test.ts +1786 -0
- package/dist/extensions/pi-subagents/test/unit/foreground-control.test.ts +125 -0
- package/dist/extensions/pi-subagents/test/unit/foreground-tool-call-compaction.test.ts +115 -0
- package/dist/extensions/pi-subagents/test/unit/fork-cache-key.test.ts +91 -0
- package/dist/extensions/pi-subagents/test/unit/fork-context.test.ts +588 -0
- package/dist/extensions/pi-subagents/test/unit/formatters.test.ts +14 -0
- package/dist/extensions/pi-subagents/test/unit/get-final-output.test.ts +175 -0
- package/dist/extensions/pi-subagents/test/unit/herdr-inspector-bootstrap.test.ts +101 -0
- package/dist/extensions/pi-subagents/test/unit/herdr-inspector.test.ts +479 -0
- package/dist/extensions/pi-subagents/test/unit/herdr-session-roots-codec.test.ts +63 -0
- package/dist/extensions/pi-subagents/test/unit/herdr-shell-command.test.ts +59 -0
- package/dist/extensions/pi-subagents/test/unit/herdr-status-bridge.test.ts +716 -0
- package/dist/extensions/pi-subagents/test/unit/host-command.test.ts +157 -0
- package/dist/extensions/pi-subagents/test/unit/host-peer-runtime-imports.test.ts +157 -0
- package/dist/extensions/pi-subagents/test/unit/host-step-status.test.ts +98 -0
- package/dist/extensions/pi-subagents/test/unit/index-child-registration.test.ts +1307 -0
- package/dist/extensions/pi-subagents/test/unit/index-segment.test.ts +96 -0
- package/dist/extensions/pi-subagents/test/unit/inspect-rpc.test.ts +617 -0
- package/dist/extensions/pi-subagents/test/unit/intercom-bridge.test.ts +220 -0
- package/dist/extensions/pi-subagents/test/unit/jsonl-writer.test.ts +119 -0
- package/dist/extensions/pi-subagents/test/unit/llm-intent-arbiter.test.ts +226 -0
- package/dist/extensions/pi-subagents/test/unit/mcp-direct-tool-grant.test.ts +155 -0
- package/dist/extensions/pi-subagents/test/unit/mission-goal-driver.test.ts +180 -0
- package/dist/extensions/pi-subagents/test/unit/mission-lifecycle.test.ts +300 -0
- package/dist/extensions/pi-subagents/test/unit/mission-store.test.ts +470 -0
- package/dist/extensions/pi-subagents/test/unit/mock-pi.test.ts +22 -0
- package/dist/extensions/pi-subagents/test/unit/model-exclusions.test.ts +258 -0
- package/dist/extensions/pi-subagents/test/unit/model-fallback.test.ts +903 -0
- package/dist/extensions/pi-subagents/test/unit/model-info.test.ts +162 -0
- package/dist/extensions/pi-subagents/test/unit/model-scope-settings.test.ts +101 -0
- package/dist/extensions/pi-subagents/test/unit/model-scope.test.ts +198 -0
- package/dist/extensions/pi-subagents/test/unit/mutation-evidence.test.ts +177 -0
- package/dist/extensions/pi-subagents/test/unit/native-supervisor-channel.test.ts +796 -0
- package/dist/extensions/pi-subagents/test/unit/nested-control.test.ts +655 -0
- package/dist/extensions/pi-subagents/test/unit/nested-events.test.ts +492 -0
- package/dist/extensions/pi-subagents/test/unit/node-executable.test.ts +26 -0
- package/dist/extensions/pi-subagents/test/unit/notify.test.ts +816 -0
- package/dist/extensions/pi-subagents/test/unit/orca-progress-tabs.test.ts +545 -0
- package/dist/extensions/pi-subagents/test/unit/owned-process-tree.test.ts +69 -0
- package/dist/extensions/pi-subagents/test/unit/package-manifest.test.ts +241 -0
- package/dist/extensions/pi-subagents/test/unit/parallel-handoff.test.ts +563 -0
- package/dist/extensions/pi-subagents/test/unit/parallel-utils.test.ts +269 -0
- package/dist/extensions/pi-subagents/test/unit/path-handling.test.ts +108 -0
- package/dist/extensions/pi-subagents/test/unit/path-resolution.test.ts +103 -0
- package/dist/extensions/pi-subagents/test/unit/permissions.test.ts +46 -0
- package/dist/extensions/pi-subagents/test/unit/pi-args-permission-system.test.ts +437 -0
- package/dist/extensions/pi-subagents/test/unit/pi-args.test.ts +2347 -0
- package/dist/extensions/pi-subagents/test/unit/pi-coding-agent-dir.test.ts +461 -0
- package/dist/extensions/pi-subagents/test/unit/pi-spawn.test.ts +493 -0
- package/dist/extensions/pi-subagents/test/unit/preflight.test.ts +978 -0
- package/dist/extensions/pi-subagents/test/unit/proactive-skills.test.ts +118 -0
- package/dist/extensions/pi-subagents/test/unit/process-terminal.test.ts +279 -0
- package/dist/extensions/pi-subagents/test/unit/profiles.test.ts +373 -0
- package/dist/extensions/pi-subagents/test/unit/project-panes-public-api.test.ts +293 -0
- package/dist/extensions/pi-subagents/test/unit/prompt-template-bridge.test.ts +244 -0
- package/dist/extensions/pi-subagents/test/unit/prompt-workflows.test.ts +167 -0
- package/dist/extensions/pi-subagents/test/unit/pruned-fork.test.ts +214 -0
- package/dist/extensions/pi-subagents/test/unit/public-execution.test.ts +182 -0
- package/dist/extensions/pi-subagents/test/unit/reads-resolution.test.ts +66 -0
- package/dist/extensions/pi-subagents/test/unit/recursion-guard.test.ts +265 -0
- package/dist/extensions/pi-subagents/test/unit/render-helpers.test.ts +639 -0
- package/dist/extensions/pi-subagents/test/unit/result-delivery-ownership.test.ts +34 -0
- package/dist/extensions/pi-subagents/test/unit/result-files.test.ts +501 -0
- package/dist/extensions/pi-subagents/test/unit/result-intercom.test.ts +258 -0
- package/dist/extensions/pi-subagents/test/unit/retained-children.test.ts +191 -0
- package/dist/extensions/pi-subagents/test/unit/rpc.test.ts +1124 -0
- package/dist/extensions/pi-subagents/test/unit/run-fanout-budget.test.ts +191 -0
- package/dist/extensions/pi-subagents/test/unit/run-id-resolver.test.ts +247 -0
- package/dist/extensions/pi-subagents/test/unit/run-status.test.ts +1545 -0
- package/dist/extensions/pi-subagents/test/unit/runtime-acknowledged-extensions.test.ts +52 -0
- package/dist/extensions/pi-subagents/test/unit/runtime-agent-registration.test.ts +349 -0
- package/dist/extensions/pi-subagents/test/unit/scheduled-runs.test.ts +904 -0
- package/dist/extensions/pi-subagents/test/unit/scheduled-store-root.test.ts +67 -0
- package/dist/extensions/pi-subagents/test/unit/schemas.test.ts +657 -0
- package/dist/extensions/pi-subagents/test/unit/scripted-workflow.test.ts +2501 -0
- package/dist/extensions/pi-subagents/test/unit/selector.test.ts +57 -0
- package/dist/extensions/pi-subagents/test/unit/session-lease.test.ts +339 -0
- package/dist/extensions/pi-subagents/test/unit/single-output.test.ts +361 -0
- package/dist/extensions/pi-subagents/test/unit/skills-fallback.test.ts +709 -0
- package/dist/extensions/pi-subagents/test/unit/slash-bridge.test.ts +115 -0
- package/dist/extensions/pi-subagents/test/unit/spawn-budget.test.ts +124 -0
- package/dist/extensions/pi-subagents/test/unit/stale-run-reconciler.test.ts +440 -0
- package/dist/extensions/pi-subagents/test/unit/status-format.test.ts +26 -0
- package/dist/extensions/pi-subagents/test/unit/steering-action.test.ts +435 -0
- package/dist/extensions/pi-subagents/test/unit/steering-notices.test.ts +58 -0
- package/dist/extensions/pi-subagents/test/unit/steering.test.ts +217 -0
- package/dist/extensions/pi-subagents/test/unit/streamed-progress-bounds.test.ts +78 -0
- package/dist/extensions/pi-subagents/test/unit/subagent-action-recovery.test.ts +85 -0
- package/dist/extensions/pi-subagents/test/unit/subagent-control.test.ts +342 -0
- package/dist/extensions/pi-subagents/test/unit/subagent-guide.test.ts +37 -0
- package/dist/extensions/pi-subagents/test/unit/subagent-prompt-runtime.test.ts +1593 -0
- package/dist/extensions/pi-subagents/test/unit/subagent-startup-retry.test.ts +104 -0
- package/dist/extensions/pi-subagents/test/unit/subagent-wait.test.ts +1367 -0
- package/dist/extensions/pi-subagents/test/unit/task-intent.test.ts +153 -0
- package/dist/extensions/pi-subagents/test/unit/temp-paths.test.ts +147 -0
- package/dist/extensions/pi-subagents/test/unit/thinking-ceiling.test.ts +73 -0
- package/dist/extensions/pi-subagents/test/unit/timeout-defaults.test.ts +138 -0
- package/dist/extensions/pi-subagents/test/unit/tool-budget.test.ts +67 -0
- package/dist/extensions/pi-subagents/test/unit/tool-description.test.ts +308 -0
- package/dist/extensions/pi-subagents/test/unit/tool-timeout.test.ts +108 -0
- package/dist/extensions/pi-subagents/test/unit/total-cost.test.ts +61 -0
- package/dist/extensions/pi-subagents/test/unit/ts-loader.test.ts +33 -0
- package/dist/extensions/pi-subagents/test/unit/types-fork-preamble.test.ts +23 -0
- package/dist/extensions/pi-subagents/test/unit/wait-completions.test.ts +110 -0
- package/dist/extensions/pi-subagents/test/unit/wait-subscriptions.test.ts +663 -0
- package/dist/extensions/pi-subagents/test/unit/watch-strategy.test.ts +24 -0
- package/dist/extensions/pi-subagents/test/unit/watchdog-change-signature.test.ts +434 -0
- package/dist/extensions/pi-subagents/test/unit/watchdog-child-status.test.ts +170 -0
- package/dist/extensions/pi-subagents/test/unit/watchdog-diff-tool.test.ts +79 -0
- package/dist/extensions/pi-subagents/test/unit/watchdog-emission-guard.test.ts +62 -0
- package/dist/extensions/pi-subagents/test/unit/watchdog-lsp-diagnostics.test.ts +144 -0
- package/dist/extensions/pi-subagents/test/unit/watchdog-model-selection.test.ts +121 -0
- package/dist/extensions/pi-subagents/test/unit/watchdog-permission-arbiter.test.ts +113 -0
- package/dist/extensions/pi-subagents/test/unit/watchdog-render.test.ts +75 -0
- package/dist/extensions/pi-subagents/test/unit/watchdog-review.test.ts +372 -0
- package/dist/extensions/pi-subagents/test/unit/watchdog-rules.test.ts +37 -0
- package/dist/extensions/pi-subagents/test/unit/watchdog-runtime.test.ts +990 -0
- package/dist/extensions/pi-subagents/test/unit/watchdog-scope.test.ts +33 -0
- package/dist/extensions/pi-subagents/test/unit/watchdog-settings.test.ts +345 -0
- package/dist/extensions/pi-subagents/test/unit/watchdog-tool-actions.test.ts +91 -0
- package/dist/extensions/pi-subagents/test/unit/watchdog-turn-delta.test.ts +130 -0
- package/dist/extensions/pi-subagents/test/unit/widget-nested-render.test.ts +171 -0
- package/dist/extensions/pi-subagents/test/unit/windows-hide-spawn.test.ts +49 -0
- package/dist/extensions/pi-subagents/test/unit/workflow-chat-progress.test.ts +570 -0
- package/dist/extensions/pi-subagents/test/unit/workflow-checklist.test.ts +223 -0
- package/dist/extensions/pi-subagents/test/unit/workflow-detach-reconcile.test.ts +777 -0
- package/dist/extensions/pi-subagents/test/unit/workflow-graph.test.ts +134 -0
- package/dist/extensions/pi-subagents/test/unit/workflow-launch-params.test.ts +407 -0
- package/dist/extensions/pi-subagents/test/unit/workflow-preflight.test.ts +177 -0
- package/dist/extensions/pi-subagents/test/unit/workflow-receipt.test.ts +461 -0
- package/dist/extensions/pi-subagents/test/unit/workflow-resources.test.ts +98 -0
- package/dist/extensions/pi-subagents/test/unit/workflow-resume-hint.test.ts +365 -0
- package/dist/extensions/pi-subagents/test/unit/worktree-cleanup-plan.test.ts +349 -0
- package/dist/extensions/pi-subagents/test/unit/worktree.test.ts +827 -0
- package/dist/extensions/pi-subagents/test/unit/writer-budget-guidance.test.ts +25 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/effect/index.ts +13 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/effect/rules/no-service-constructor-imports.ts +52 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/index.ts +41 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-chained-type-assertions.ts +77 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-conditional-empty-object-spread.ts +49 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-known-value-widening.ts +247 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-module-mocking.ts +91 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-object-parameters.ts +126 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-reflect-apply.ts +28 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-reflect-get.ts +28 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-runtime-typeof.ts +67 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-shape-in-symbol-names.ts +39 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-unknown-parameters.ts +83 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-unknown-returns.ts +115 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-unknown-type-aliases.ts +72 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-unsafe-dictionary-type.ts +134 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-widen-then-assert.ts +366 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/require-safety-comment-for-type-assertion.ts +62 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/shared/dictionary-types.ts +502 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/shared/lexical-type-parameters.ts +60 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/shared/reflect-method.ts +35 -0
- package/dist/extensions/pi-subagents/tsconfig.json +15 -0
- package/dist/extensions/pi-tool-display/CHANGELOG.md +329 -0
- package/dist/extensions/pi-tool-display/LICENSE +21 -0
- package/dist/extensions/pi-tool-display/README.md +417 -0
- package/dist/extensions/pi-tool-display/config/config.example.json +40 -0
- package/dist/extensions/pi-tool-display/index.ts +3 -0
- package/dist/extensions/pi-tool-display/package-lock.json +2555 -0
- package/dist/extensions/pi-tool-display/package.json +86 -0
- package/dist/extensions/pi-tool-display/src/agent-dir.ts +35 -0
- package/dist/extensions/pi-tool-display/src/ansi-utils.ts +116 -0
- package/dist/extensions/pi-tool-display/src/bash-display.ts +213 -0
- package/dist/extensions/pi-tool-display/src/capabilities.ts +88 -0
- package/dist/extensions/pi-tool-display/src/config-modal.ts +541 -0
- package/dist/extensions/pi-tool-display/src/config-store.ts +304 -0
- package/dist/extensions/pi-tool-display/src/debug-logger.ts +150 -0
- package/dist/extensions/pi-tool-display/src/diff-presentation.ts +72 -0
- package/dist/extensions/pi-tool-display/src/diff-renderer.ts +2517 -0
- package/dist/extensions/pi-tool-display/src/disposable.ts +34 -0
- package/dist/extensions/pi-tool-display/src/extension-lifecycle.ts +14 -0
- package/dist/extensions/pi-tool-display/src/index.ts +109 -0
- package/dist/extensions/pi-tool-display/src/line-width-safety.ts +93 -0
- package/dist/extensions/pi-tool-display/src/modal-icons.ts +57 -0
- package/dist/extensions/pi-tool-display/src/pending-diff-preview.ts +370 -0
- package/dist/extensions/pi-tool-display/src/presets.ts +117 -0
- package/dist/extensions/pi-tool-display/src/render-utils.ts +186 -0
- package/dist/extensions/pi-tool-display/src/settings-inspector-modal.ts +475 -0
- package/dist/extensions/pi-tool-display/src/thinking-label.ts +343 -0
- package/dist/extensions/pi-tool-display/src/tool-call-box.ts +181 -0
- package/dist/extensions/pi-tool-display/src/tool-metadata.ts +139 -0
- package/dist/extensions/pi-tool-display/src/tool-overrides.ts +2168 -0
- package/dist/extensions/pi-tool-display/src/types.ts +109 -0
- package/dist/extensions/pi-tool-display/src/user-message-box-markdown.ts +64 -0
- package/dist/extensions/pi-tool-display/src/user-message-box-native.ts +66 -0
- package/dist/extensions/pi-tool-display/src/user-message-box-patch.ts +72 -0
- package/dist/extensions/pi-tool-display/src/user-message-box-renderer.ts +419 -0
- package/dist/extensions/pi-tool-display/src/user-message-box-utils.ts +106 -0
- package/dist/extensions/pi-tool-display/src/write-display-utils.ts +31 -0
- package/dist/extensions/pi-tool-display/src/zellij-modal.ts +1027 -0
- package/dist/extensions/pi-tool-display/tests/active-backlog-red.test.ts +65 -0
- package/dist/extensions/pi-tool-display/tests/ansi-utils.test.ts +345 -0
- package/dist/extensions/pi-tool-display/tests/bash-display.test.ts +442 -0
- package/dist/extensions/pi-tool-display/tests/capabilities-edge.test.ts +360 -0
- package/dist/extensions/pi-tool-display/tests/capabilities.test.ts +54 -0
- package/dist/extensions/pi-tool-display/tests/config-modal.test.ts +360 -0
- package/dist/extensions/pi-tool-display/tests/config-store.test.ts +87 -0
- package/dist/extensions/pi-tool-display/tests/custom-tool-overrides.test.ts +415 -0
- package/dist/extensions/pi-tool-display/tests/debug-logger-edge.test.ts +630 -0
- package/dist/extensions/pi-tool-display/tests/debug-logger.test.ts +62 -0
- package/dist/extensions/pi-tool-display/tests/diff-renderer-ansi.test.ts +55 -0
- package/dist/extensions/pi-tool-display/tests/diff-renderer-edge.test.ts +886 -0
- package/dist/extensions/pi-tool-display/tests/diff-renderer-numbering.test.ts +135 -0
- package/dist/extensions/pi-tool-display/tests/diff-renderer-width.test.ts +454 -0
- package/dist/extensions/pi-tool-display/tests/diff-renderer-wrap.test.ts +169 -0
- package/dist/extensions/pi-tool-display/tests/index-integration.test.ts +354 -0
- package/dist/extensions/pi-tool-display/tests/pending-diff-preview.test.ts +79 -0
- package/dist/extensions/pi-tool-display/tests/presets-edge.test.ts +229 -0
- package/dist/extensions/pi-tool-display/tests/presets.test.ts +26 -0
- package/dist/extensions/pi-tool-display/tests/reload-behavior.test.ts +1241 -0
- package/dist/extensions/pi-tool-display/tests/render-utils.test.ts +710 -0
- package/dist/extensions/pi-tool-display/tests/settings-inspector.test.ts +450 -0
- package/dist/extensions/pi-tool-display/tests/thinking-label-edge.test.ts +904 -0
- package/dist/extensions/pi-tool-display/tests/thinking-label.test.ts +72 -0
- package/dist/extensions/pi-tool-display/tests/tool-call-box.test.ts +105 -0
- package/dist/extensions/pi-tool-display/tests/tool-overrides-config.test.ts +613 -0
- package/dist/extensions/pi-tool-display/tests/tool-overrides-mcp.test.ts +499 -0
- package/dist/extensions/pi-tool-display/tests/tool-overrides-registration.test.ts +315 -0
- package/dist/extensions/pi-tool-display/tests/tool-overrides-write-meta.test.ts +68 -0
- package/dist/extensions/pi-tool-display/tests/tool-ui-utils.test.ts +413 -0
- package/dist/extensions/pi-tool-display/tests/user-message-box-performance-red.test.ts +176 -0
- package/dist/extensions/pi-tool-display/tests/user-message-box.test.ts +908 -0
- package/dist/extensions/pi-tool-display/tests/zellij-modal.test.ts +848 -0
- package/dist/extensions/pi-tool-display/tool-display-api-consumer.d.ts +30 -0
- package/dist/extensions/pi-tool-display/tool-display-api-consumer.js +40 -0
- package/dist/extensions/pi-web-agent/CHANGELOG.md +410 -0
- package/dist/extensions/pi-web-agent/README.md +131 -0
- package/dist/extensions/pi-web-agent/package.json +33 -0
- package/dist/extensions/pi-web-agent/src/backends/config.ts +264 -0
- package/dist/extensions/pi-web-agent/src/backends/doctor.ts +272 -0
- package/dist/extensions/pi-web-agent/src/backends/factory.ts +253 -0
- package/dist/extensions/pi-web-agent/src/backends/settings-reader.ts +46 -0
- package/dist/extensions/pi-web-agent/src/cache/ttl-cache.ts +28 -0
- package/dist/extensions/pi-web-agent/src/changelog-notice.ts +136 -0
- package/dist/extensions/pi-web-agent/src/commands/web-agent-config.ts +1082 -0
- package/dist/extensions/pi-web-agent/src/extension.ts +163 -0
- package/dist/extensions/pi-web-agent/src/extract/readability.ts +126 -0
- package/dist/extensions/pi-web-agent/src/fetch/browser-resolution.ts +199 -0
- package/dist/extensions/pi-web-agent/src/fetch/firecrawl-fetch.ts +100 -0
- package/dist/extensions/pi-web-agent/src/fetch/headless-fetch.ts +117 -0
- package/dist/extensions/pi-web-agent/src/fetch/http-fetch.ts +67 -0
- package/dist/extensions/pi-web-agent/src/orchestration/answer-synthesizer.ts +60 -0
- package/dist/extensions/pi-web-agent/src/orchestration/candidate-selector.ts +51 -0
- package/dist/extensions/pi-web-agent/src/orchestration/direct-url.ts +29 -0
- package/dist/extensions/pi-web-agent/src/orchestration/evidence-quality.ts +108 -0
- package/dist/extensions/pi-web-agent/src/orchestration/evidence-ranker.ts +47 -0
- package/dist/extensions/pi-web-agent/src/orchestration/index.ts +28 -0
- package/dist/extensions/pi-web-agent/src/orchestration/query-planner.ts +47 -0
- package/dist/extensions/pi-web-agent/src/orchestration/research-orchestrator.ts +441 -0
- package/dist/extensions/pi-web-agent/src/orchestration/research-types.ts +71 -0
- package/dist/extensions/pi-web-agent/src/orchestration/research-worker.ts +206 -0
- package/dist/extensions/pi-web-agent/src/orchestration/source-profile.ts +105 -0
- package/dist/extensions/pi-web-agent/src/orchestration/stop-decider.ts +81 -0
- package/dist/extensions/pi-web-agent/src/orchestration/url.ts +35 -0
- package/dist/extensions/pi-web-agent/src/presentation/config-store.ts +210 -0
- package/dist/extensions/pi-web-agent/src/presentation/config.ts +75 -0
- package/dist/extensions/pi-web-agent/src/presentation/explore-presentation.ts +73 -0
- package/dist/extensions/pi-web-agent/src/presentation/fetch-presentation.ts +54 -0
- package/dist/extensions/pi-web-agent/src/presentation/search-presentation.ts +53 -0
- package/dist/extensions/pi-web-agent/src/presentation/select-view.ts +20 -0
- package/dist/extensions/pi-web-agent/src/presentation/types.ts +63 -0
- package/dist/extensions/pi-web-agent/src/readers/github-reader.ts +150 -0
- package/dist/extensions/pi-web-agent/src/readers/limits.ts +3 -0
- package/dist/extensions/pi-web-agent/src/readers/pdf-reader.ts +87 -0
- package/dist/extensions/pi-web-agent/src/readers/resolver.ts +25 -0
- package/dist/extensions/pi-web-agent/src/readers/types.ts +11 -0
- package/dist/extensions/pi-web-agent/src/readers/youtube-reader.ts +79 -0
- package/dist/extensions/pi-web-agent/src/search/brave.ts +114 -0
- package/dist/extensions/pi-web-agent/src/search/duckduckgo.ts +99 -0
- package/dist/extensions/pi-web-agent/src/search/exa.ts +109 -0
- package/dist/extensions/pi-web-agent/src/search/fanout.ts +154 -0
- package/dist/extensions/pi-web-agent/src/search/searxng.ts +96 -0
- package/dist/extensions/pi-web-agent/src/search/tavily.ts +113 -0
- package/dist/extensions/pi-web-agent/src/search/tokenin.ts +130 -0
- package/dist/extensions/pi-web-agent/src/search/youcom.ts +109 -0
- package/dist/extensions/pi-web-agent/src/tools/web-explore.ts +71 -0
- package/dist/extensions/pi-web-agent/src/tools/web-fetch-headless.ts +31 -0
- package/dist/extensions/pi-web-agent/src/tools/web-fetch.ts +31 -0
- package/dist/extensions/pi-web-agent/src/tools/web-search.ts +170 -0
- package/dist/extensions/pi-web-agent/src/types.ts +103 -0
- package/dist/extensions/pi-zentui/.editorconfig +12 -0
- package/dist/extensions/pi-zentui/.github/CODEOWNERS +1 -0
- package/dist/extensions/pi-zentui/.github/ISSUE_TEMPLATE/bug_report.yml +110 -0
- package/dist/extensions/pi-zentui/.github/ISSUE_TEMPLATE/config.yml +8 -0
- package/dist/extensions/pi-zentui/.github/ISSUE_TEMPLATE/config_question.yml +56 -0
- package/dist/extensions/pi-zentui/.github/ISSUE_TEMPLATE/feature_request.yml +63 -0
- package/dist/extensions/pi-zentui/.github/ISSUE_TEMPLATE/rendering_issue.yml +106 -0
- package/dist/extensions/pi-zentui/.github/ISSUE_TEMPLATE/runtime_detection.yml +103 -0
- package/dist/extensions/pi-zentui/.github/dependabot.yml +47 -0
- package/dist/extensions/pi-zentui/.github/pull_request_template.md +34 -0
- package/dist/extensions/pi-zentui/.github/release.yml +18 -0
- package/dist/extensions/pi-zentui/.github/workflows/ci.yml +79 -0
- package/dist/extensions/pi-zentui/.github/workflows/publish.yml +63 -0
- package/dist/extensions/pi-zentui/AGENTS.md +107 -0
- package/dist/extensions/pi-zentui/CONTRIBUTING.md +68 -0
- package/dist/extensions/pi-zentui/LICENSE +21 -0
- package/dist/extensions/pi-zentui/README.md +202 -0
- package/dist/extensions/pi-zentui/SECURITY.md +18 -0
- package/dist/extensions/pi-zentui/assets/main-cover.png +0 -0
- package/dist/extensions/pi-zentui/assets/screenshots/editor-accent-rail.png +0 -0
- package/dist/extensions/pi-zentui/assets/screenshots/editor-minimalist.png +0 -0
- package/dist/extensions/pi-zentui/assets/screenshots/editor-opencode-copy-friendly.png +0 -0
- package/dist/extensions/pi-zentui/assets/screenshots/editor-opencode.png +0 -0
- package/dist/extensions/pi-zentui/assets/screenshots/user-message-compact.png +0 -0
- package/dist/extensions/pi-zentui/assets/screenshots/user-message-framed-copy-friendly.png +0 -0
- package/dist/extensions/pi-zentui/assets/screenshots/user-message-framed.png +0 -0
- package/dist/extensions/pi-zentui/assets/screenshots/user-message-labeled.png +0 -0
- package/dist/extensions/pi-zentui/assets/zentui.png +0 -0
- package/dist/extensions/pi-zentui/biome.json +31 -0
- package/dist/extensions/pi-zentui/docs/configuration.md +537 -0
- package/dist/extensions/pi-zentui/docs/footer-format.md +162 -0
- package/dist/extensions/pi-zentui/extensions/zentui/accent-rail-editor.ts +99 -0
- package/dist/extensions/pi-zentui/extensions/zentui/accent-rail-layout-patch.ts +457 -0
- package/dist/extensions/pi-zentui/extensions/zentui/completion-menu.ts +157 -0
- package/dist/extensions/pi-zentui/extensions/zentui/config.ts +2129 -0
- package/dist/extensions/pi-zentui/extensions/zentui/editor-metadata-format.ts +321 -0
- package/dist/extensions/pi-zentui/extensions/zentui/editor-transfer.ts +73 -0
- package/dist/extensions/pi-zentui/extensions/zentui/extension-status.ts +89 -0
- package/dist/extensions/pi-zentui/extensions/zentui/footer-format.ts +364 -0
- package/dist/extensions/pi-zentui/extensions/zentui/footer-layout.ts +122 -0
- package/dist/extensions/pi-zentui/extensions/zentui/footer.ts +812 -0
- package/dist/extensions/pi-zentui/extensions/zentui/format.ts +620 -0
- package/dist/extensions/pi-zentui/extensions/zentui/git.ts +384 -0
- package/dist/extensions/pi-zentui/extensions/zentui/icons.ts +252 -0
- package/dist/extensions/pi-zentui/extensions/zentui/index.ts +1445 -0
- package/dist/extensions/pi-zentui/extensions/zentui/interaction-summary.ts +1049 -0
- package/dist/extensions/pi-zentui/extensions/zentui/live-context.ts +75 -0
- package/dist/extensions/pi-zentui/extensions/zentui/minimalist-editor.ts +463 -0
- package/dist/extensions/pi-zentui/extensions/zentui/package-version.ts +651 -0
- package/dist/extensions/pi-zentui/extensions/zentui/project-refresh.ts +120 -0
- package/dist/extensions/pi-zentui/extensions/zentui/project-state.ts +59 -0
- package/dist/extensions/pi-zentui/extensions/zentui/prototype-patch-registry.ts +210 -0
- package/dist/extensions/pi-zentui/extensions/zentui/repository-root.ts +98 -0
- package/dist/extensions/pi-zentui/extensions/zentui/runtime.ts +841 -0
- package/dist/extensions/pi-zentui/extensions/zentui/selector-border.ts +93 -0
- package/dist/extensions/pi-zentui/extensions/zentui/session-lifecycle.ts +60 -0
- package/dist/extensions/pi-zentui/extensions/zentui/settings-command.ts +1908 -0
- package/dist/extensions/pi-zentui/extensions/zentui/settings-previews.ts +245 -0
- package/dist/extensions/pi-zentui/extensions/zentui/state.ts +94 -0
- package/dist/extensions/pi-zentui/extensions/zentui/style.ts +424 -0
- package/dist/extensions/pi-zentui/extensions/zentui/telemetry.ts +82 -0
- package/dist/extensions/pi-zentui/extensions/zentui/thinking-experimental.ts +1768 -0
- package/dist/extensions/pi-zentui/extensions/zentui/thinking-status.ts +69 -0
- package/dist/extensions/pi-zentui/extensions/zentui/thinking-steps.ts +155 -0
- package/dist/extensions/pi-zentui/extensions/zentui/ui.ts +1291 -0
- package/dist/extensions/pi-zentui/extensions/zentui/user-message-osc.ts +262 -0
- package/dist/extensions/pi-zentui/extensions/zentui/user-message-styles.ts +215 -0
- package/dist/extensions/pi-zentui/extensions/zentui/user-message.ts +206 -0
- package/dist/extensions/pi-zentui/extensions/zentui/working-line-messages.ts +24 -0
- package/dist/extensions/pi-zentui/extensions/zentui/working-line-spinners.ts +54 -0
- package/dist/extensions/pi-zentui/extensions/zentui/working-line.ts +1433 -0
- package/dist/extensions/pi-zentui/package-lock.json +5311 -0
- package/dist/extensions/pi-zentui/package.json +60 -0
- package/dist/extensions/pi-zentui/test/accent-rail-editor.test.ts +232 -0
- package/dist/extensions/pi-zentui/test/accent-rail-layout-patch.test.ts +669 -0
- package/dist/extensions/pi-zentui/test/completion-menu.test.ts +265 -0
- package/dist/extensions/pi-zentui/test/config-load-lifecycle.test.ts +124 -0
- package/dist/extensions/pi-zentui/test/config.test.ts +3199 -0
- package/dist/extensions/pi-zentui/test/editor-metadata-format.test.ts +405 -0
- package/dist/extensions/pi-zentui/test/editor-transfer.test.ts +260 -0
- package/dist/extensions/pi-zentui/test/editor-viewport-indicators.test.ts +1301 -0
- package/dist/extensions/pi-zentui/test/extension-compliance.test.ts +7245 -0
- package/dist/extensions/pi-zentui/test/extension-status.test.ts +182 -0
- package/dist/extensions/pi-zentui/test/fixtures/starship-nerd-font-symbols.toml +172 -0
- package/dist/extensions/pi-zentui/test/footer-format.test.ts +431 -0
- package/dist/extensions/pi-zentui/test/footer-layout.test.ts +113 -0
- package/dist/extensions/pi-zentui/test/footer-repository-path.test.ts +123 -0
- package/dist/extensions/pi-zentui/test/format.test.ts +927 -0
- package/dist/extensions/pi-zentui/test/git.test.ts +212 -0
- package/dist/extensions/pi-zentui/test/icons.test.ts +69 -0
- package/dist/extensions/pi-zentui/test/interaction-summary.test.ts +1402 -0
- package/dist/extensions/pi-zentui/test/live-context-integration.test.ts +378 -0
- package/dist/extensions/pi-zentui/test/live-context.test.ts +139 -0
- package/dist/extensions/pi-zentui/test/minimalist-editor.test.ts +811 -0
- package/dist/extensions/pi-zentui/test/package-contents.mjs +33 -0
- package/dist/extensions/pi-zentui/test/package-version.test.ts +321 -0
- package/dist/extensions/pi-zentui/test/project-refresh.test.ts +250 -0
- package/dist/extensions/pi-zentui/test/project-state.test.ts +159 -0
- package/dist/extensions/pi-zentui/test/prototype-patch-registry.test.ts +131 -0
- package/dist/extensions/pi-zentui/test/repository-root.test.ts +108 -0
- package/dist/extensions/pi-zentui/test/responsive-dependencies.test.ts +825 -0
- package/dist/extensions/pi-zentui/test/runtime.test.ts +183 -0
- package/dist/extensions/pi-zentui/test/session-lifecycle.test.ts +40 -0
- package/dist/extensions/pi-zentui/test/settings-command.test.ts +1663 -0
- package/dist/extensions/pi-zentui/test/settings-previews.test.ts +453 -0
- package/dist/extensions/pi-zentui/test/state.test.ts +84 -0
- package/dist/extensions/pi-zentui/test/telemetry-lifecycle-integration.test.ts +276 -0
- package/dist/extensions/pi-zentui/test/telemetry.test.ts +105 -0
- package/dist/extensions/pi-zentui/test/thinking-experimental-docs.test.ts +51 -0
- package/dist/extensions/pi-zentui/test/thinking-experimental-loader-diagnostics.mjs +54 -0
- package/dist/extensions/pi-zentui/test/thinking-experimental-missing-export.test.ts +44 -0
- package/dist/extensions/pi-zentui/test/thinking-experimental-rows.test.ts +297 -0
- package/dist/extensions/pi-zentui/test/thinking-experimental-tui.mjs +2329 -0
- package/dist/extensions/pi-zentui/test/thinking-experimental.test.ts +1668 -0
- package/dist/extensions/pi-zentui/test/thinking-status.test.ts +85 -0
- package/dist/extensions/pi-zentui/test/thinking-steps.test.ts +122 -0
- package/dist/extensions/pi-zentui/test/turn-summary-lifecycle.integration.test.ts +327 -0
- package/dist/extensions/pi-zentui/test/user-message-osc.test.ts +222 -0
- package/dist/extensions/pi-zentui/test/user-message-styles.test.ts +292 -0
- package/dist/extensions/pi-zentui/test/working-line-lifecycle.integration.test.ts +730 -0
- package/dist/extensions/pi-zentui/test/working-line-messages.test.ts +34 -0
- package/dist/extensions/pi-zentui/test/working-line.test.ts +1990 -0
- package/dist/extensions/pi-zentui/tsconfig.json +16 -0
- package/dist/extensions/ponytail/index.js +176 -0
- package/dist/extensions/ponytail/package.json +8 -0
- package/dist/extensions/ponytail/ponytail-config.cjs +151 -0
- package/dist/extensions/ponytail/ponytail-instructions.cjs +112 -0
- package/dist/extensions/ponytail/test/extension.test.js +299 -0
- package/dist/extensions/ponytail/test/helpers.test.js +312 -0
- package/dist/extensions/question/batch.ts +103 -0
- package/dist/extensions/question/constants.ts +31 -0
- package/dist/extensions/question/helpers.ts +58 -0
- package/dist/extensions/question/index.ts +688 -0
- package/dist/extensions/question/navigation.ts +14 -0
- package/dist/extensions/question/package.json +19 -0
- package/dist/extensions/question/question-list.ts +533 -0
- package/dist/extensions/question/row-layout.ts +165 -0
- package/dist/extensions/question/schemas.ts +43 -0
- package/dist/extensions/question/selection-mode.ts +47 -0
- package/dist/extensions/question/shortcuts.ts +44 -0
- package/dist/extensions/question/tests/batch.test.ts +113 -0
- package/dist/extensions/question/tests/exp.test.ts +70 -0
- package/dist/extensions/question/tests/exp2.test.ts +59 -0
- package/dist/extensions/question/tests/exp3.test.ts +47 -0
- package/dist/extensions/question/tests/helpers.test.ts +93 -0
- package/dist/extensions/question/tests/question-list.test.ts +694 -0
- package/dist/extensions/question/tests/row-layout.test.ts +215 -0
- package/dist/extensions/question/tests/schemas.test.ts +53 -0
- package/dist/extensions/question/tests/selection-mode.test.ts +54 -0
- package/dist/extensions/question/tests/shortcuts.test.ts +107 -0
- package/dist/extensions/question/tests/wizard.test.ts +839 -0
- package/dist/extensions/question/tests/zz-ig3.test.ts +20 -0
- package/dist/extensions/question/tests/zz-probe.test.ts +29 -0
- package/dist/extensions/question/types.ts +132 -0
- package/dist/extensions/rtk.test.ts +320 -0
- package/dist/extensions/rtk.ts +123 -0
- package/dist/extensions/test-resolve-hook-impl.mjs +7 -0
- package/dist/extensions/test-resolve-hook.mjs +7 -0
- package/dist/extensions/tokenin-onboarding.ts +883 -0
- package/dist/extensions/tps.test.ts +38 -0
- package/dist/extensions/tps.ts +349 -0
- package/dist/extensions/undo.test.ts +720 -0
- package/dist/extensions/undo.ts +298 -0
- package/dist/extensions/web-agent-onboarding.test.ts +415 -0
- package/dist/extensions/web-agent-onboarding.ts +222 -0
- package/dist/index.d.ts +36 -0
- package/dist/index.js +48 -0
- package/dist/main.d.ts +11 -0
- package/dist/main.js +768 -0
- package/dist/migrations.d.ts +32 -0
- package/dist/migrations.js +280 -0
- package/dist/modes/index.d.ts +8 -0
- package/dist/modes/index.js +7 -0
- package/dist/modes/interactive/assets/clankolas.png +0 -0
- package/dist/modes/interactive/components/armin.d.ts +33 -0
- package/dist/modes/interactive/components/armin.js +332 -0
- package/dist/modes/interactive/components/assistant-message.d.ts +21 -0
- package/dist/modes/interactive/components/assistant-message.js +142 -0
- package/dist/modes/interactive/components/bash-execution.d.ts +33 -0
- package/dist/modes/interactive/components/bash-execution.js +174 -0
- package/dist/modes/interactive/components/bordered-loader.d.ts +15 -0
- package/dist/modes/interactive/components/bordered-loader.js +53 -0
- package/dist/modes/interactive/components/branch-summary-message.d.ts +15 -0
- package/dist/modes/interactive/components/branch-summary-message.js +43 -0
- package/dist/modes/interactive/components/compaction-summary-message.d.ts +15 -0
- package/dist/modes/interactive/components/compaction-summary-message.js +44 -0
- package/dist/modes/interactive/components/config-selector.d.ts +101 -0
- package/dist/modes/interactive/components/config-selector.js +760 -0
- package/dist/modes/interactive/components/countdown-timer.d.ts +13 -0
- package/dist/modes/interactive/components/countdown-timer.js +32 -0
- package/dist/modes/interactive/components/custom-editor.d.ts +20 -0
- package/dist/modes/interactive/components/custom-editor.js +69 -0
- package/dist/modes/interactive/components/custom-entry.d.ts +18 -0
- package/dist/modes/interactive/components/custom-entry.js +51 -0
- package/dist/modes/interactive/components/custom-message.d.ts +21 -0
- package/dist/modes/interactive/components/custom-message.js +86 -0
- package/dist/modes/interactive/components/daxnuts.d.ts +22 -0
- package/dist/modes/interactive/components/daxnuts.js +139 -0
- package/dist/modes/interactive/components/diff.d.ts +11 -0
- package/dist/modes/interactive/components/diff.js +132 -0
- package/dist/modes/interactive/components/dynamic-border.d.ts +14 -0
- package/dist/modes/interactive/components/dynamic-border.js +20 -0
- package/dist/modes/interactive/components/earendil-announcement.d.ts +4 -0
- package/dist/modes/interactive/components/earendil-announcement.js +39 -0
- package/dist/modes/interactive/components/extension-editor.d.ts +20 -0
- package/dist/modes/interactive/components/extension-editor.js +97 -0
- package/dist/modes/interactive/components/extension-input.d.ts +22 -0
- package/dist/modes/interactive/components/extension-input.js +60 -0
- package/dist/modes/interactive/components/extension-selector.d.ts +25 -0
- package/dist/modes/interactive/components/extension-selector.js +82 -0
- package/dist/modes/interactive/components/first-time-setup.d.ts +24 -0
- package/dist/modes/interactive/components/first-time-setup.js +116 -0
- package/dist/modes/interactive/components/footer.d.ts +31 -0
- package/dist/modes/interactive/components/footer.js +221 -0
- package/dist/modes/interactive/components/index.d.ts +33 -0
- package/dist/modes/interactive/components/index.js +34 -0
- package/dist/modes/interactive/components/keybinding-hints.d.ts +12 -0
- package/dist/modes/interactive/components/keybinding-hints.js +35 -0
- package/dist/modes/interactive/components/login-dialog.d.ts +51 -0
- package/dist/modes/interactive/components/login-dialog.js +187 -0
- package/dist/modes/interactive/components/model-selector.d.ts +63 -0
- package/dist/modes/interactive/components/model-selector.js +321 -0
- package/dist/modes/interactive/components/oauth-selector.d.ts +32 -0
- package/dist/modes/interactive/components/oauth-selector.js +162 -0
- package/dist/modes/interactive/components/scoped-models-selector.d.ts +41 -0
- package/dist/modes/interactive/components/scoped-models-selector.js +301 -0
- package/dist/modes/interactive/components/session-selector-search.d.ts +22 -0
- package/dist/modes/interactive/components/session-selector-search.js +154 -0
- package/dist/modes/interactive/components/session-selector.d.ts +94 -0
- package/dist/modes/interactive/components/session-selector.js +866 -0
- package/dist/modes/interactive/components/settings-selector.d.ts +103 -0
- package/dist/modes/interactive/components/settings-selector.js +726 -0
- package/dist/modes/interactive/components/show-images-selector.d.ts +9 -0
- package/dist/modes/interactive/components/show-images-selector.js +38 -0
- package/dist/modes/interactive/components/skill-invocation-message.d.ts +16 -0
- package/dist/modes/interactive/components/skill-invocation-message.js +46 -0
- package/dist/modes/interactive/components/startup-box.d.ts +38 -0
- package/dist/modes/interactive/components/startup-box.js +90 -0
- package/dist/modes/interactive/components/status-indicator.d.ts +30 -0
- package/dist/modes/interactive/components/status-indicator.js +64 -0
- package/dist/modes/interactive/components/theme-selector.d.ts +10 -0
- package/dist/modes/interactive/components/theme-selector.js +49 -0
- package/dist/modes/interactive/components/thinking-selector.d.ts +10 -0
- package/dist/modes/interactive/components/thinking-selector.js +51 -0
- package/dist/modes/interactive/components/tool-execution.d.ts +62 -0
- package/dist/modes/interactive/components/tool-execution.js +325 -0
- package/dist/modes/interactive/components/tree-selector.d.ts +93 -0
- package/dist/modes/interactive/components/tree-selector.js +1244 -0
- package/dist/modes/interactive/components/trust-selector.d.ts +22 -0
- package/dist/modes/interactive/components/trust-selector.js +90 -0
- package/dist/modes/interactive/components/user-message-selector.d.ts +29 -0
- package/dist/modes/interactive/components/user-message-selector.js +113 -0
- package/dist/modes/interactive/components/user-message.d.ts +13 -0
- package/dist/modes/interactive/components/user-message.js +41 -0
- package/dist/modes/interactive/components/visual-truncate.d.ts +23 -0
- package/dist/modes/interactive/components/visual-truncate.js +32 -0
- package/dist/modes/interactive/external-editor.d.ts +11 -0
- package/dist/modes/interactive/external-editor.js +36 -0
- package/dist/modes/interactive/interactive-mode.d.ts +447 -0
- package/dist/modes/interactive/interactive-mode.js +5489 -0
- package/dist/modes/interactive/model-catalog-refresh.d.ts +6 -0
- package/dist/modes/interactive/model-catalog-refresh.js +33 -0
- package/dist/modes/interactive/model-search.d.ts +11 -0
- package/dist/modes/interactive/model-search.js +14 -0
- package/dist/modes/interactive/theme/dark.json +90 -0
- package/dist/modes/interactive/theme/light.json +89 -0
- package/dist/modes/interactive/theme/theme-controller.d.ts +39 -0
- package/dist/modes/interactive/theme/theme-controller.js +124 -0
- package/dist/modes/interactive/theme/theme-schema.json +348 -0
- package/dist/modes/interactive/theme/theme.d.ts +121 -0
- package/dist/modes/interactive/theme/theme.js +1090 -0
- package/dist/modes/print-mode.d.ts +27 -0
- package/dist/modes/print-mode.js +141 -0
- package/dist/modes/rpc/jsonl.d.ts +16 -0
- package/dist/modes/rpc/jsonl.js +48 -0
- package/dist/modes/rpc/rpc-client.d.ts +438 -0
- package/dist/modes/rpc/rpc-client.js +712 -0
- package/dist/modes/rpc/rpc-mode.d.ts +19 -0
- package/dist/modes/rpc/rpc-mode.js +1459 -0
- package/dist/modes/rpc/rpc-types.d.ts +902 -0
- package/dist/modes/rpc/rpc-types.js +7 -0
- package/dist/package-manager-cli.d.ts +7 -0
- package/dist/package-manager-cli.js +789 -0
- package/dist/rpc-entry.d.ts +2 -0
- package/dist/rpc-entry.js +9 -0
- package/dist/skills/agent-browser/SKILL.md +53 -0
- package/dist/skills/batch-grill-me/SKILL.md +20 -0
- package/dist/skills/brandkit/SKILL.md +798 -0
- package/dist/skills/brutalist/SKILL.md +92 -0
- package/dist/skills/design-references/SKILL.md +32 -0
- package/dist/skills/design-references/references/clickhouse/DESIGN.md +544 -0
- package/dist/skills/gpt-taste/SKILL.md +74 -0
- package/dist/skills/grill-me/SKILL.md +11 -0
- package/dist/skills/handoff/SKILL.md +17 -0
- package/dist/skills/handoff-text/SKILL.md +15 -0
- package/dist/skills/image-to-code/SKILL.md +1228 -0
- package/dist/skills/imagegen-frontend-mobile/SKILL.md +1465 -0
- package/dist/skills/imagegen-frontend-web/SKILL.md +987 -0
- package/dist/skills/implanger/SKILL.md +70 -0
- package/dist/skills/improve-codebase/REFERENCE.md +78 -0
- package/dist/skills/improve-codebase/SKILL.md +180 -0
- package/dist/skills/minimalist/SKILL.md +85 -0
- package/dist/skills/output/SKILL.md +49 -0
- package/dist/skills/pi-subagents/SKILL.md +50 -0
- package/dist/skills/pi-subagents/references/constraints-and-recipes.md +274 -0
- package/dist/skills/pi-subagents/references/execution-controls.md +463 -0
- package/dist/skills/pi-subagents/references/management-authoring-rpc.md +161 -0
- package/dist/skills/pi-subagents/references/multi-lane-orchestration.md +39 -0
- package/dist/skills/pi-subagents/references/prompting-and-roles.md +267 -0
- package/dist/skills/planger/SKILL.md +167 -0
- package/dist/skills/ponytail/SKILL.md +121 -0
- package/dist/skills/ponytail-audit/SKILL.md +42 -0
- package/dist/skills/ponytail-debt/SKILL.md +45 -0
- package/dist/skills/ponytail-gain/SKILL.md +51 -0
- package/dist/skills/ponytail-help/SKILL.md +72 -0
- package/dist/skills/ponytail-review/SKILL.md +58 -0
- package/dist/skills/redesign/SKILL.md +178 -0
- package/dist/skills/selesai-handoff/SKILL.md +21 -0
- package/dist/skills/soft/SKILL.md +98 -0
- package/dist/skills/stitch/DESIGN.md +121 -0
- package/dist/skills/stitch/SKILL.md +184 -0
- package/dist/skills/taste/SKILL.md +1206 -0
- package/dist/skills/taste-v1/SKILL.md +226 -0
- package/dist/skills/unlazy/CHANGELOG.md +109 -0
- package/dist/skills/unlazy/CONTRIBUTING.md +63 -0
- package/dist/skills/unlazy/LICENSE +21 -0
- package/dist/skills/unlazy/README.md +228 -0
- package/dist/skills/unlazy/SECURITY.md +60 -0
- package/dist/skills/unlazy/SKILL.md +93 -0
- package/dist/skills/unlazy/package.json +13 -0
- package/dist/skills/unlazy/references/dispatch.md +79 -0
- package/dist/skills/unlazy/references/gates.md +132 -0
- package/dist/skills/unlazy/references/method.md +49 -0
- package/dist/skills/unlazy/references/orchestration.md +98 -0
- package/dist/skills/unlazy/references/parallel.md +111 -0
- package/dist/skills/unlazy/references/token-economy.md +39 -0
- package/dist/skills/unlazy/research/validation-protocol.md +81 -0
- package/dist/skills/unlazy/scripts/dispatch-check.mjs +108 -0
- package/dist/skills/unlazy/scripts/gate-check.mjs +879 -0
- package/dist/skills/unlazy/scripts/gate-lint.mjs +178 -0
- package/dist/skills/unlazy/scripts/lib/check-supervisor.mjs +46 -0
- package/dist/skills/unlazy/scripts/lib/dispatch.mjs +283 -0
- package/dist/skills/unlazy/scripts/lib/gates.mjs +625 -0
- package/dist/skills/unlazy/scripts/lib/process-tree.mjs +161 -0
- package/dist/skills/unlazy/scripts/lib/regex-worker.mjs +9 -0
- package/dist/skills/unlazy/templates/PLAN.md +65 -0
- package/dist/skills/unlazy/templates/gates-leaf.md +51 -0
- package/dist/skills/unlazy/templates/gates-node.md +50 -0
- package/dist/skills/unlazy/tests/contract-tests.mjs +127 -0
- package/dist/skills/unlazy/tests/dispatch-tests.mjs +296 -0
- package/dist/skills/unlazy/tests/hardening-tests.mjs +900 -0
- package/dist/skills/unlazy/tests/lint-tests.mjs +242 -0
- package/dist/skills/unlazy/tests/run-tests.mjs +360 -0
- package/dist/skills/unlazy/tests/self-check.mjs +152 -0
- package/dist/skills/unlazy/tests/stress-tests.mjs +165 -0
- package/dist/skills/web-design-guidelines/SKILL.md +41 -0
- package/dist/skills/workflow/SKILL.md +95 -0
- package/dist/themes/adventure.json +84 -0
- package/dist/themes/adwaita-dark.json +84 -0
- package/dist/themes/arcoiris.json +84 -0
- package/dist/themes/arthur.json +84 -0
- package/dist/themes/atom.json +84 -0
- package/dist/themes/aura.json +84 -0
- package/dist/themes/black-metal-bathory.json +84 -0
- package/dist/themes/black-metal-burzum.json +84 -0
- package/dist/themes/black-metal-khold.json +84 -0
- package/dist/themes/box.json +84 -0
- package/dist/themes/brogrammer.json +84 -0
- package/dist/themes/carbonfox.json +84 -0
- package/dist/themes/catppuccin-mocha.json +84 -0
- package/dist/themes/citruszest.json +84 -0
- package/dist/themes/cursor-dark.json +84 -0
- package/dist/themes/cutie-pro.json +84 -0
- package/dist/themes/dark-modern.json +84 -0
- package/dist/themes/dark-pastel.json +84 -0
- package/dist/themes/dimmed-monokai.json +84 -0
- package/dist/themes/doom-peacock.json +84 -0
- package/dist/themes/dracula-plus.json +84 -0
- package/dist/themes/dracula.json +80 -0
- package/dist/themes/earthsong.json +84 -0
- package/dist/themes/everforest-dark-hard.json +84 -0
- package/dist/themes/everforest-dark.json +80 -0
- package/dist/themes/fahrenheit.json +84 -0
- package/dist/themes/flatland.json +84 -0
- package/dist/themes/flexoki-dark.json +84 -0
- package/dist/themes/front-end-delight.json +84 -0
- package/dist/themes/fun-forrest.json +84 -0
- package/dist/themes/galizur.json +84 -0
- package/dist/themes/github-dark-colorblind.json +84 -0
- package/dist/themes/github-dark-high-contrast.json +84 -0
- package/dist/themes/glacier.json +84 -0
- package/dist/themes/gruber-darker.json +84 -0
- package/dist/themes/gruvbox-dark-hard.json +84 -0
- package/dist/themes/gruvbox-dark.json +84 -0
- package/dist/themes/gruvbox-material.json +84 -0
- package/dist/themes/guezwhoz.json +84 -0
- package/dist/themes/hacktober.json +84 -0
- package/dist/themes/hardcore.json +84 -0
- package/dist/themes/havn-skumring.json +84 -0
- package/dist/themes/ic-orange-ppl.json +84 -0
- package/dist/themes/iterm2-smoooooth.json +84 -0
- package/dist/themes/iterm2-tango-dark.json +84 -0
- package/dist/themes/japanesque.json +84 -0
- package/dist/themes/jellybeans.json +84 -0
- package/dist/themes/kanagawa-wave.json +84 -0
- package/dist/themes/kurokula.json +84 -0
- package/dist/themes/later-this-evening.json +84 -0
- package/dist/themes/lovelace.json +84 -0
- package/dist/themes/material-darker.json +84 -0
- package/dist/themes/matte-black.json +84 -0
- package/dist/themes/mellow.json +84 -0
- package/dist/themes/miasma.json +84 -0
- package/dist/themes/nord.json +80 -0
- package/dist/themes/nvim-dark.json +84 -0
- package/dist/themes/one-dark.json +80 -0
- package/dist/themes/popping-and-locking.json +84 -0
- package/dist/themes/rose-pine.json +80 -0
- package/dist/themes/sea-shells.json +84 -0
- package/dist/themes/sleepy-hollow.json +84 -0
- package/dist/themes/smyck.json +84 -0
- package/dist/themes/solarized-dark.json +80 -0
- package/dist/themes/tokyo-night.json +80 -0
- package/dist/themes/tomorrow-night-bright.json +84 -0
- package/dist/themes/tomorrow-night-burns.json +84 -0
- package/dist/themes/tomorrow-night.json +84 -0
- package/dist/themes/twilight.json +84 -0
- package/dist/themes/vague.json +84 -0
- package/dist/themes/vesper.json +84 -0
- package/dist/themes/xcode-dark-hc.json +84 -0
- package/dist/utils/abort.d.ts +4 -0
- package/dist/utils/abort.js +47 -0
- package/dist/utils/ansi.d.ts +1 -0
- package/dist/utils/ansi.js +51 -0
- package/dist/utils/changelog.d.ts +21 -0
- package/dist/utils/changelog.js +164 -0
- package/dist/utils/child-process.d.ts +17 -0
- package/dist/utils/child-process.js +105 -0
- package/dist/utils/clipboard-image.d.ts +10 -0
- package/dist/utils/clipboard-image.js +250 -0
- package/dist/utils/clipboard-native.d.ts +10 -0
- package/dist/utils/clipboard-native.js +19 -0
- package/dist/utils/clipboard.d.ts +3 -0
- package/dist/utils/clipboard.js +140 -0
- package/dist/utils/deprecation.d.ts +3 -0
- package/dist/utils/deprecation.js +12 -0
- package/dist/utils/exif-orientation.d.ts +4 -0
- package/dist/utils/exif-orientation.js +157 -0
- package/dist/utils/frontmatter.d.ts +7 -0
- package/dist/utils/frontmatter.js +25 -0
- package/dist/utils/fs-watch.d.ts +4 -0
- package/dist/utils/fs-watch.js +24 -0
- package/dist/utils/git.d.ts +25 -0
- package/dist/utils/git.js +194 -0
- package/dist/utils/html.d.ts +6 -0
- package/dist/utils/html.js +39 -0
- package/dist/utils/image-convert.d.ts +9 -0
- package/dist/utils/image-convert.js +44 -0
- package/dist/utils/image-process.d.ts +17 -0
- package/dist/utils/image-process.js +82 -0
- package/dist/utils/image-resize-core.d.ts +29 -0
- package/dist/utils/image-resize-core.js +123 -0
- package/dist/utils/image-resize-worker.d.ts +1 -0
- package/dist/utils/image-resize-worker.js +30 -0
- package/dist/utils/image-resize.d.ts +15 -0
- package/dist/utils/image-resize.js +96 -0
- package/dist/utils/json.d.ts +2 -0
- package/dist/utils/json.js +6 -0
- package/dist/utils/mime.d.ts +2 -0
- package/dist/utils/mime.js +132 -0
- package/dist/utils/open-browser.d.ts +8 -0
- package/dist/utils/open-browser.js +21 -0
- package/dist/utils/paths.d.ts +30 -0
- package/dist/utils/paths.js +91 -0
- package/dist/utils/photon.d.ts +20 -0
- package/dist/utils/photon.js +120 -0
- package/dist/utils/pi-user-agent.d.ts +1 -0
- package/dist/utils/pi-user-agent.js +4 -0
- package/dist/utils/shell.d.ts +33 -0
- package/dist/utils/shell.js +215 -0
- package/dist/utils/sleep.d.ts +4 -0
- package/dist/utils/sleep.js +16 -0
- package/dist/utils/syntax-highlight.d.ts +11 -0
- package/dist/utils/syntax-highlight.js +117 -0
- package/dist/utils/thinking-tags.d.ts +6 -0
- package/dist/utils/thinking-tags.js +62 -0
- package/dist/utils/tools-manager.d.ts +7 -0
- package/dist/utils/tools-manager.js +402 -0
- package/dist/utils/version-check.d.ts +19 -0
- package/dist/utils/version-check.js +72 -0
- package/dist/utils/windows-self-update.d.ts +2 -0
- package/dist/utils/windows-self-update.js +76 -0
- package/package.json +1 -1
|
@@ -0,0 +1,3199 @@
|
|
|
1
|
+
import {
|
|
2
|
+
chmodSync,
|
|
3
|
+
existsSync,
|
|
4
|
+
lstatSync,
|
|
5
|
+
mkdirSync,
|
|
6
|
+
mkdtempSync,
|
|
7
|
+
readdirSync,
|
|
8
|
+
readFileSync,
|
|
9
|
+
readlinkSync,
|
|
10
|
+
rmSync,
|
|
11
|
+
statSync,
|
|
12
|
+
symlinkSync,
|
|
13
|
+
writeFileSync,
|
|
14
|
+
} from "node:fs";
|
|
15
|
+
import { tmpdir } from "node:os";
|
|
16
|
+
import { join } from "node:path";
|
|
17
|
+
import { visibleWidth } from "@earendil-works/pi-tui";
|
|
18
|
+
import { describe, expect, it } from "vitest";
|
|
19
|
+
import {
|
|
20
|
+
DEFAULT_COMPACT_FOOTER_FORMAT,
|
|
21
|
+
DEFAULT_EDITOR_METADATA_FORMAT,
|
|
22
|
+
defaultConfig,
|
|
23
|
+
ensureConfigExists,
|
|
24
|
+
FOOTER_FORMAT_VARIABLES,
|
|
25
|
+
getExtensionStatusColorMode,
|
|
26
|
+
getExtensionStatusPlacement,
|
|
27
|
+
hasUnsupportedComponentStyle,
|
|
28
|
+
mergeConfig,
|
|
29
|
+
saveAccentRailEditorStylePatch,
|
|
30
|
+
saveColorSourcesPatch,
|
|
31
|
+
saveContextStylePatch,
|
|
32
|
+
saveContextThresholdsPatch,
|
|
33
|
+
saveEditorBorderColorMode,
|
|
34
|
+
saveEditorComponentPatch,
|
|
35
|
+
saveEditorModelLabel,
|
|
36
|
+
saveEditorStyle,
|
|
37
|
+
saveExtensionStatusColorMode,
|
|
38
|
+
saveExtensionStatusDefaultPlacement,
|
|
39
|
+
saveExtensionStatusPlacement,
|
|
40
|
+
saveFooterComponentPatch,
|
|
41
|
+
saveFooterFormatPatch,
|
|
42
|
+
saveFooterSegmentsPatch,
|
|
43
|
+
saveGitBranchPatch,
|
|
44
|
+
saveGitCommitPatch,
|
|
45
|
+
saveGitMetricsPatch,
|
|
46
|
+
saveMinimalistEditorStylePatch,
|
|
47
|
+
saveMinimalistPatch,
|
|
48
|
+
savePathDisplayPatch,
|
|
49
|
+
savePolishedCopyFriendlyEditorStylePatch,
|
|
50
|
+
savePolishedEditorStylePatch,
|
|
51
|
+
saveResponsiveFooterPatch,
|
|
52
|
+
saveSelectorBordersComponentPatch,
|
|
53
|
+
saveSeparatorPatch,
|
|
54
|
+
saveStarshipFooterStylePatch,
|
|
55
|
+
saveThinkingStepsComponentPatch,
|
|
56
|
+
saveUiFeaturesPatch,
|
|
57
|
+
saveUserMessagesComponentPatch,
|
|
58
|
+
saveWorkingLineComponentPatch,
|
|
59
|
+
} from "../extensions/zentui/config";
|
|
60
|
+
import {
|
|
61
|
+
colorize,
|
|
62
|
+
renderChromeBorder,
|
|
63
|
+
renderStyle,
|
|
64
|
+
renderStyleForSource,
|
|
65
|
+
renderTerminalStyle,
|
|
66
|
+
} from "../extensions/zentui/style";
|
|
67
|
+
|
|
68
|
+
function configTempFiles(dir: string, filename = "zentui.json"): string[] {
|
|
69
|
+
return readdirSync(dir).filter(
|
|
70
|
+
(name) => name.startsWith(`.${filename}.`) && name.endsWith(".tmp"),
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function withConfig(
|
|
75
|
+
initial: Record<string, unknown> | undefined,
|
|
76
|
+
assertions: (path: string, dir: string) => void,
|
|
77
|
+
): void {
|
|
78
|
+
const dir = mkdtempSync(join(tmpdir(), "zentui-config-"));
|
|
79
|
+
const path = join(dir, "zentui.json");
|
|
80
|
+
try {
|
|
81
|
+
if (initial !== undefined) writeFileSync(path, `${JSON.stringify(initial, null, 2)}\n`);
|
|
82
|
+
assertions(path, dir);
|
|
83
|
+
} finally {
|
|
84
|
+
rmSync(dir, { recursive: true, force: true });
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// biome-ignore lint/suspicious/noExplicitAny: Tests intentionally inspect arbitrary JSON fixture shapes.
|
|
89
|
+
function readRaw(path: string): Record<string, any> {
|
|
90
|
+
return JSON.parse(readFileSync(path, "utf8"));
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
describe("canonical config resolution", () => {
|
|
94
|
+
it("provides complete canonical defaults and the established palette defaults", () => {
|
|
95
|
+
const config = mergeConfig({});
|
|
96
|
+
expect(config.components).toEqual({
|
|
97
|
+
editor: {
|
|
98
|
+
enabled: false,
|
|
99
|
+
style: "opencode",
|
|
100
|
+
colorSource: "theme",
|
|
101
|
+
borderColorMode: "adaptive",
|
|
102
|
+
modelLabel: "name",
|
|
103
|
+
viewportIndicators: false,
|
|
104
|
+
styles: {
|
|
105
|
+
opencode: {
|
|
106
|
+
metadataFormat: DEFAULT_EDITOR_METADATA_FORMAT,
|
|
107
|
+
completionMenu: "native",
|
|
108
|
+
},
|
|
109
|
+
"opencode-copy-friendly": {
|
|
110
|
+
metadataFormat: DEFAULT_EDITOR_METADATA_FORMAT,
|
|
111
|
+
completionMenu: "native",
|
|
112
|
+
},
|
|
113
|
+
"accent-rail": {
|
|
114
|
+
rail: "▎",
|
|
115
|
+
asciiRail: "|",
|
|
116
|
+
transparent: false,
|
|
117
|
+
},
|
|
118
|
+
minimalist: {
|
|
119
|
+
pathDisplay: "compact",
|
|
120
|
+
contextFormat: "percent",
|
|
121
|
+
contextGauge: true,
|
|
122
|
+
showSessionName: true,
|
|
123
|
+
showTimer: true,
|
|
124
|
+
showCost: true,
|
|
125
|
+
showGit: true,
|
|
126
|
+
contextThresholds: { warning: 70, error: 90 },
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
userMessages: {
|
|
131
|
+
enabled: true,
|
|
132
|
+
style: "labeled",
|
|
133
|
+
colorSource: "theme",
|
|
134
|
+
styles: { framed: {}, "framed-copy-friendly": {}, compact: {}, labeled: {} },
|
|
135
|
+
},
|
|
136
|
+
thinkingSteps: { enabled: false, mode: "tree" },
|
|
137
|
+
workingLine: {
|
|
138
|
+
enabled: true,
|
|
139
|
+
turnSummary: true,
|
|
140
|
+
spinner: "star-bloom",
|
|
141
|
+
spinnerIntervalMs: 100,
|
|
142
|
+
animateSpinnerColor: false,
|
|
143
|
+
textIntervalMs: 60,
|
|
144
|
+
textAnimation: "classic",
|
|
145
|
+
colorSource: "theme",
|
|
146
|
+
messages: {
|
|
147
|
+
custom: true,
|
|
148
|
+
values: [...defaultConfig.components.workingLine.messages.values],
|
|
149
|
+
},
|
|
150
|
+
segments: { tool: true, elapsed: true, thought: true, tokens: true },
|
|
151
|
+
},
|
|
152
|
+
selectorBorders: { enabled: true, style: "zentui", colorSource: "theme" },
|
|
153
|
+
footer: {
|
|
154
|
+
style: "native",
|
|
155
|
+
colorSource: "theme",
|
|
156
|
+
modelLabel: "name",
|
|
157
|
+
styles: {
|
|
158
|
+
starship: {
|
|
159
|
+
format: "",
|
|
160
|
+
responsive: true,
|
|
161
|
+
compactFormat: DEFAULT_COMPACT_FOOTER_FORMAT,
|
|
162
|
+
compactMaxLines: "unlimited",
|
|
163
|
+
separator: "none",
|
|
164
|
+
contextStyle: "text",
|
|
165
|
+
contextThresholds: { warning: 70, error: 90 },
|
|
166
|
+
pathDisplay: { mode: "basename", depth: 2 },
|
|
167
|
+
segments: defaultConfig.footerSegments,
|
|
168
|
+
gitBranch: { maxLength: "full" },
|
|
169
|
+
gitCommit: { hashLength: 7, onlyDetached: true, showTag: true },
|
|
170
|
+
gitMetrics: { onlyNonzero: true, ignoreSubmodules: false },
|
|
171
|
+
extensionStatuses: {
|
|
172
|
+
defaultPlacement: "right",
|
|
173
|
+
placements: {},
|
|
174
|
+
colorModes: {},
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
});
|
|
180
|
+
expect(config.projectRefreshIntervalMs).toBe(30_000);
|
|
181
|
+
expect(config.icons.cacheHit).toBe("c");
|
|
182
|
+
expect(config.colors).toEqual(defaultConfig.colors);
|
|
183
|
+
expect(defaultConfig.components).toEqual(config.components);
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
it("normalizes Opencode completion menus independently", () => {
|
|
187
|
+
const config = mergeConfig({
|
|
188
|
+
components: {
|
|
189
|
+
editor: {
|
|
190
|
+
styles: {
|
|
191
|
+
opencode: { completionMenu: "native" },
|
|
192
|
+
"opencode-copy-friendly": { completionMenu: "invalid" },
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
});
|
|
197
|
+
expect(config.components.editor.styles.opencode.completionMenu).toBe("native");
|
|
198
|
+
expect(config.components.editor.styles["opencode-copy-friendly"].completionMenu).toBe(
|
|
199
|
+
"native",
|
|
200
|
+
);
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
it("normalizes the canonical accent-rail style and its editor-owned roles", () => {
|
|
204
|
+
const config = mergeConfig({
|
|
205
|
+
colors: { editorRail: "bright-green", editorAccent: "error" },
|
|
206
|
+
components: {
|
|
207
|
+
editor: {
|
|
208
|
+
style: "accent-rail",
|
|
209
|
+
styles: { "accent-rail": { rail: "!", asciiRail: ":", transparent: true } },
|
|
210
|
+
},
|
|
211
|
+
},
|
|
212
|
+
});
|
|
213
|
+
expect(config.components.editor.style).toBe("accent-rail");
|
|
214
|
+
expect(config.components.editor.styles["accent-rail"]).toEqual({
|
|
215
|
+
rail: "!",
|
|
216
|
+
asciiRail: ":",
|
|
217
|
+
transparent: true,
|
|
218
|
+
});
|
|
219
|
+
expect(config.colors.editorRail).toBe("bright-green");
|
|
220
|
+
expect(config.colors.editorAccent).toBe("error");
|
|
221
|
+
|
|
222
|
+
const invalid = mergeConfig({
|
|
223
|
+
components: {
|
|
224
|
+
editor: {
|
|
225
|
+
styles: { "accent-rail": { rail: "", asciiRail: 1, transparent: "yes" } },
|
|
226
|
+
},
|
|
227
|
+
},
|
|
228
|
+
});
|
|
229
|
+
expect(invalid.components.editor.styles["accent-rail"]).toEqual({
|
|
230
|
+
rail: "▎",
|
|
231
|
+
asciiRail: "|",
|
|
232
|
+
transparent: false,
|
|
233
|
+
});
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
it("bridges explicit legacy branch colors into the independent Editor branch role", () => {
|
|
237
|
+
expect(mergeConfig({}).colors.editorGitBranch).toBeUndefined();
|
|
238
|
+
|
|
239
|
+
const legacyDefault = mergeConfig({ colors: { gitBranch: "bold purple" } }).colors;
|
|
240
|
+
expect(legacyDefault.gitBranch).toBe("bold purple");
|
|
241
|
+
expect(legacyDefault.editorGitBranch).toBe("bold purple");
|
|
242
|
+
|
|
243
|
+
const legacyCustom = mergeConfig({ colors: { gitBranch: "success" } }).colors;
|
|
244
|
+
expect(legacyCustom.gitBranch).toBe("success");
|
|
245
|
+
expect(legacyCustom.editorGitBranch).toBe("success");
|
|
246
|
+
|
|
247
|
+
const independent = mergeConfig({
|
|
248
|
+
colors: { gitBranch: "success", editorGitBranch: "accent" },
|
|
249
|
+
}).colors;
|
|
250
|
+
expect(independent.gitBranch).toBe("success");
|
|
251
|
+
expect(independent.editorGitBranch).toBe("accent");
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
it("ignores stale fixed-editor config forms without exposing runtime fields", () => {
|
|
255
|
+
const config = mergeConfig({
|
|
256
|
+
fixedEditor: { enabled: true, mouseScroll: false },
|
|
257
|
+
layout: { fixedEditor: { enabled: "yes", copyNotice: false }, futureLayout: true },
|
|
258
|
+
});
|
|
259
|
+
expect(config).not.toHaveProperty("fixedEditor");
|
|
260
|
+
expect(config).not.toHaveProperty("layout");
|
|
261
|
+
});
|
|
262
|
+
|
|
263
|
+
it("migrates every released legacy field leaf-by-leaf", () => {
|
|
264
|
+
const config = mergeConfig({
|
|
265
|
+
features: {
|
|
266
|
+
editor: false,
|
|
267
|
+
statusLine: false,
|
|
268
|
+
viewportIndicators: false,
|
|
269
|
+
copyFriendly: true,
|
|
270
|
+
},
|
|
271
|
+
colorSources: { editor: "terminal", userMessages: "terminal", starship: "terminal" },
|
|
272
|
+
editorBorderColorMode: "adaptive",
|
|
273
|
+
editorModelLabel: "name",
|
|
274
|
+
editorMetadataFormat: "$model",
|
|
275
|
+
contextThresholds: { warning: 55, error: 88 },
|
|
276
|
+
footerFormat: "$cwd",
|
|
277
|
+
responsiveFooter: false,
|
|
278
|
+
compactFooterFormat: "$context",
|
|
279
|
+
compactFooterMaxLines: 3,
|
|
280
|
+
separator: "dot",
|
|
281
|
+
contextStyle: "gauge",
|
|
282
|
+
pathDisplay: { mode: "full", depth: 2 },
|
|
283
|
+
footerSegments: { cwd: false, modelInfo: true },
|
|
284
|
+
gitBranch: { maxLength: 18 },
|
|
285
|
+
gitCommit: { hashLength: 12, onlyDetached: false, showTag: false },
|
|
286
|
+
gitMetrics: { onlyNonzero: false, ignoreSubmodules: true },
|
|
287
|
+
extensionStatuses: {
|
|
288
|
+
defaultPlacement: "middle",
|
|
289
|
+
placements: { alpha: "left" },
|
|
290
|
+
colorModes: { alpha: "original" },
|
|
291
|
+
},
|
|
292
|
+
});
|
|
293
|
+
const { editor, userMessages, selectorBorders, footer } = config.components;
|
|
294
|
+
const starship = footer.styles.starship;
|
|
295
|
+
expect([editor.enabled, userMessages.enabled, selectorBorders.enabled]).toEqual([
|
|
296
|
+
false,
|
|
297
|
+
false,
|
|
298
|
+
false,
|
|
299
|
+
]);
|
|
300
|
+
expect(editor.viewportIndicators).toBe(false);
|
|
301
|
+
expect(editor.style).toBe("opencode-copy-friendly");
|
|
302
|
+
expect(userMessages).toMatchObject({ enabled: false, style: "framed-copy-friendly" });
|
|
303
|
+
expect([editor.colorSource, selectorBorders.colorSource]).toEqual(["terminal", "terminal"]);
|
|
304
|
+
expect(userMessages.colorSource).toBe("terminal");
|
|
305
|
+
expect(footer.colorSource).toBe("terminal");
|
|
306
|
+
expect(editor.borderColorMode).toBe("adaptive");
|
|
307
|
+
expect([editor.modelLabel, footer.modelLabel]).toEqual(["name", "name"]);
|
|
308
|
+
expect(editor.styles.opencode.metadataFormat).toBe("$model");
|
|
309
|
+
expect(editor.styles.minimalist.contextThresholds).toEqual({ warning: 55, error: 88 });
|
|
310
|
+
expect(starship).toMatchObject({
|
|
311
|
+
format: "$cwd",
|
|
312
|
+
responsive: false,
|
|
313
|
+
compactFormat: "$context",
|
|
314
|
+
compactMaxLines: 3,
|
|
315
|
+
separator: "dot",
|
|
316
|
+
contextStyle: "gauge",
|
|
317
|
+
contextThresholds: { warning: 55, error: 88 },
|
|
318
|
+
pathDisplay: { mode: "full", depth: 2 },
|
|
319
|
+
gitBranch: { maxLength: 18 },
|
|
320
|
+
gitCommit: { hashLength: 12, onlyDetached: false, showTag: false },
|
|
321
|
+
gitMetrics: { onlyNonzero: false, ignoreSubmodules: true },
|
|
322
|
+
extensionStatuses: {
|
|
323
|
+
defaultPlacement: "middle",
|
|
324
|
+
placements: { alpha: "left" },
|
|
325
|
+
colorModes: { alpha: "original" },
|
|
326
|
+
},
|
|
327
|
+
});
|
|
328
|
+
expect(starship.segments).toMatchObject({ cwd: false, modelInfo: true });
|
|
329
|
+
});
|
|
330
|
+
|
|
331
|
+
it("gives canonical leaves precedence, including false and invalid-but-present values", () => {
|
|
332
|
+
const config = mergeConfig({
|
|
333
|
+
features: { editor: true, copyFriendly: true, viewportIndicators: false },
|
|
334
|
+
colorSources: { editor: "terminal" },
|
|
335
|
+
editorBorderColorMode: "adaptive",
|
|
336
|
+
editorMetadataFormat: "$legacy",
|
|
337
|
+
components: {
|
|
338
|
+
editor: {
|
|
339
|
+
enabled: false,
|
|
340
|
+
style: "unknown",
|
|
341
|
+
colorSource: "unknown",
|
|
342
|
+
styles: {
|
|
343
|
+
polished: { copyFriendly: "yes" },
|
|
344
|
+
},
|
|
345
|
+
},
|
|
346
|
+
},
|
|
347
|
+
});
|
|
348
|
+
expect(config.components.editor.enabled).toBe(false);
|
|
349
|
+
expect(config.components.editor.style).toBe("opencode");
|
|
350
|
+
expect(config.components.editor.colorSource).toBe("theme");
|
|
351
|
+
// Missing canonical siblings still migrate independently.
|
|
352
|
+
expect(config.components.editor.viewportIndicators).toBe(false);
|
|
353
|
+
expect(config.components.editor.borderColorMode).toBe("adaptive");
|
|
354
|
+
expect(config.components.editor.styles.opencode.metadataFormat).toBe("$legacy");
|
|
355
|
+
});
|
|
356
|
+
|
|
357
|
+
it("normalizes every canonical minimalist leaf without reviving branch-only inputs", () => {
|
|
358
|
+
for (const pathDisplay of ["compact", "project", "full"]) {
|
|
359
|
+
expect(
|
|
360
|
+
mergeConfig({
|
|
361
|
+
components: { editor: { styles: { minimalist: { pathDisplay } } } },
|
|
362
|
+
}).components.editor.styles.minimalist.pathDisplay,
|
|
363
|
+
).toBe(pathDisplay);
|
|
364
|
+
}
|
|
365
|
+
for (const pathDisplay of ["basename", "", 1, null, true]) {
|
|
366
|
+
expect(
|
|
367
|
+
mergeConfig({
|
|
368
|
+
editorStyles: { minimalist: { pathDisplay: "full" } },
|
|
369
|
+
components: { editor: { styles: { minimalist: { pathDisplay } } } },
|
|
370
|
+
}).components.editor.styles.minimalist.pathDisplay,
|
|
371
|
+
).toBe("compact");
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
for (const contextFormat of ["percent", "percent-total"]) {
|
|
375
|
+
expect(
|
|
376
|
+
mergeConfig({
|
|
377
|
+
components: { editor: { styles: { minimalist: { contextFormat } } } },
|
|
378
|
+
}).components.editor.styles.minimalist.contextFormat,
|
|
379
|
+
).toBe(contextFormat);
|
|
380
|
+
}
|
|
381
|
+
for (const contextFormat of ["tokens", "", 1, null, true]) {
|
|
382
|
+
expect(
|
|
383
|
+
mergeConfig({
|
|
384
|
+
editorStyles: { minimalist: { contextFormat: "percent-total" } },
|
|
385
|
+
components: { editor: { styles: { minimalist: { contextFormat } } } },
|
|
386
|
+
}).components.editor.styles.minimalist.contextFormat,
|
|
387
|
+
).toBe("percent");
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
const valid = mergeConfig({
|
|
391
|
+
components: {
|
|
392
|
+
editor: {
|
|
393
|
+
styles: {
|
|
394
|
+
minimalist: {
|
|
395
|
+
contextGauge: true,
|
|
396
|
+
showSessionName: false,
|
|
397
|
+
showTimer: false,
|
|
398
|
+
showCost: false,
|
|
399
|
+
showGit: false,
|
|
400
|
+
},
|
|
401
|
+
},
|
|
402
|
+
},
|
|
403
|
+
},
|
|
404
|
+
}).components.editor.styles.minimalist;
|
|
405
|
+
expect(valid).toMatchObject({
|
|
406
|
+
contextGauge: true,
|
|
407
|
+
showSessionName: false,
|
|
408
|
+
showTimer: false,
|
|
409
|
+
showCost: false,
|
|
410
|
+
showGit: false,
|
|
411
|
+
});
|
|
412
|
+
|
|
413
|
+
const invalid = mergeConfig({
|
|
414
|
+
editorStyles: {
|
|
415
|
+
minimalist: {
|
|
416
|
+
contextGauge: true,
|
|
417
|
+
showSessionName: false,
|
|
418
|
+
showTimer: false,
|
|
419
|
+
showCost: false,
|
|
420
|
+
showGit: false,
|
|
421
|
+
},
|
|
422
|
+
},
|
|
423
|
+
components: {
|
|
424
|
+
editor: {
|
|
425
|
+
styles: {
|
|
426
|
+
minimalist: {
|
|
427
|
+
contextGauge: "yes",
|
|
428
|
+
showSessionName: "yes",
|
|
429
|
+
showTimer: null,
|
|
430
|
+
showCost: 0,
|
|
431
|
+
showGit: "no",
|
|
432
|
+
},
|
|
433
|
+
},
|
|
434
|
+
},
|
|
435
|
+
},
|
|
436
|
+
}).components.editor.styles.minimalist;
|
|
437
|
+
expect(invalid).toEqual(defaultConfig.components.editor.styles.minimalist);
|
|
438
|
+
});
|
|
439
|
+
|
|
440
|
+
it("ignores branch-only editorStyle/editorStyles and safely defaults closed style IDs", () => {
|
|
441
|
+
const config = mergeConfig({
|
|
442
|
+
editorStyle: "minimalist",
|
|
443
|
+
editorStyles: { minimalist: { showGit: false } },
|
|
444
|
+
components: {
|
|
445
|
+
editor: { style: "future" },
|
|
446
|
+
userMessages: { style: "future" },
|
|
447
|
+
selectorBorders: { style: "future" },
|
|
448
|
+
footer: { style: "future" },
|
|
449
|
+
},
|
|
450
|
+
});
|
|
451
|
+
expect(config.components.editor.style).toBe("opencode");
|
|
452
|
+
expect(config.components.editor.styles.minimalist.showGit).toBe(true);
|
|
453
|
+
expect(config.components.userMessages.style).toBe("labeled");
|
|
454
|
+
expect(config.components.selectorBorders.style).toBe("zentui");
|
|
455
|
+
expect(config.components.footer.style).toBe("native");
|
|
456
|
+
});
|
|
457
|
+
|
|
458
|
+
it("does not treat native as a User-message style", () => {
|
|
459
|
+
expect(
|
|
460
|
+
mergeConfig({ components: { userMessages: { style: "native" } } }).components.userMessages
|
|
461
|
+
.style,
|
|
462
|
+
).toBe("labeled");
|
|
463
|
+
});
|
|
464
|
+
|
|
465
|
+
it("normalizes nested canonical leaves without falling through to contradictory legacy leaves", () => {
|
|
466
|
+
const config = mergeConfig({
|
|
467
|
+
contextThresholds: { warning: 20, error: 80 },
|
|
468
|
+
pathDisplay: { mode: "full", depth: 4 },
|
|
469
|
+
components: {
|
|
470
|
+
editor: {
|
|
471
|
+
styles: { minimalist: { contextThresholds: { warning: "bad" } } },
|
|
472
|
+
},
|
|
473
|
+
footer: {
|
|
474
|
+
styles: {
|
|
475
|
+
starship: {
|
|
476
|
+
contextThresholds: { warning: "bad" },
|
|
477
|
+
pathDisplay: { mode: "bad" },
|
|
478
|
+
},
|
|
479
|
+
},
|
|
480
|
+
},
|
|
481
|
+
},
|
|
482
|
+
});
|
|
483
|
+
expect(config.components.editor.styles.minimalist.contextThresholds).toEqual({
|
|
484
|
+
warning: 70,
|
|
485
|
+
error: 80,
|
|
486
|
+
});
|
|
487
|
+
expect(config.components.footer.styles.starship.contextThresholds).toEqual({
|
|
488
|
+
warning: 70,
|
|
489
|
+
error: 80,
|
|
490
|
+
});
|
|
491
|
+
expect(config.components.footer.styles.starship.pathDisplay).toEqual({
|
|
492
|
+
mode: "basename",
|
|
493
|
+
depth: 4,
|
|
494
|
+
});
|
|
495
|
+
});
|
|
496
|
+
|
|
497
|
+
it("projects the intentionally lossy flat compatibility view from canonical sources", () => {
|
|
498
|
+
const config = mergeConfig({
|
|
499
|
+
components: {
|
|
500
|
+
editor: {
|
|
501
|
+
enabled: false,
|
|
502
|
+
style: "minimalist",
|
|
503
|
+
colorSource: "terminal",
|
|
504
|
+
modelLabel: "name",
|
|
505
|
+
styles: { opencode: { copyFriendly: true, metadataFormat: "$model" } },
|
|
506
|
+
},
|
|
507
|
+
userMessages: {
|
|
508
|
+
enabled: true,
|
|
509
|
+
colorSource: "theme",
|
|
510
|
+
styles: { framed: { copyFriendly: false } },
|
|
511
|
+
},
|
|
512
|
+
selectorBorders: { enabled: true, colorSource: "theme" },
|
|
513
|
+
footer: {
|
|
514
|
+
modelLabel: "id",
|
|
515
|
+
colorSource: "terminal",
|
|
516
|
+
styles: { starship: { contextThresholds: { warning: 40, error: 60 } } },
|
|
517
|
+
},
|
|
518
|
+
},
|
|
519
|
+
});
|
|
520
|
+
const starship = config.components.footer.styles.starship;
|
|
521
|
+
expect(config.footerFormat).toBe(starship.format);
|
|
522
|
+
expect(config.responsiveFooter).toBe(starship.responsive);
|
|
523
|
+
expect(config.compactFooterFormat).toBe(starship.compactFormat);
|
|
524
|
+
expect(config.compactFooterMaxLines).toBe(starship.compactMaxLines);
|
|
525
|
+
expect(config.separator).toBe(starship.separator);
|
|
526
|
+
expect(config.contextStyle).toBe(starship.contextStyle);
|
|
527
|
+
expect(config.contextThresholds).toBe(starship.contextThresholds);
|
|
528
|
+
expect(config.pathDisplay).toBe(starship.pathDisplay);
|
|
529
|
+
expect(config.footerSegments).toBe(starship.segments);
|
|
530
|
+
expect(config.gitBranch).toBe(starship.gitBranch);
|
|
531
|
+
expect(config.gitCommit).toBe(starship.gitCommit);
|
|
532
|
+
expect(config.gitMetrics).toBe(starship.gitMetrics);
|
|
533
|
+
expect(config.extensionStatuses).toBe(starship.extensionStatuses);
|
|
534
|
+
expect(config.features).toEqual({
|
|
535
|
+
editor: false,
|
|
536
|
+
statusLine: false,
|
|
537
|
+
viewportIndicators: false,
|
|
538
|
+
});
|
|
539
|
+
expect(config.colorSources).toEqual({
|
|
540
|
+
starship: "terminal",
|
|
541
|
+
editor: "terminal",
|
|
542
|
+
userMessages: "theme",
|
|
543
|
+
});
|
|
544
|
+
expect(config.editorModelLabel).toBe("name");
|
|
545
|
+
expect(config.contextThresholds).toEqual({ warning: 40, error: 60 });
|
|
546
|
+
});
|
|
547
|
+
|
|
548
|
+
it("does not mutate the parsed record", () => {
|
|
549
|
+
const parsed = {
|
|
550
|
+
features: { editor: false },
|
|
551
|
+
components: { editor: { styles: { opencode: { copyFriendly: true } } } },
|
|
552
|
+
};
|
|
553
|
+
const before = structuredClone(parsed);
|
|
554
|
+
mergeConfig(parsed);
|
|
555
|
+
expect(parsed).toEqual(before);
|
|
556
|
+
});
|
|
557
|
+
|
|
558
|
+
it("retains root parsing behavior for intervals, icons, colors, and telemetry variables", () => {
|
|
559
|
+
const config = mergeConfig({
|
|
560
|
+
projectRefreshIntervalMs: 100,
|
|
561
|
+
icons: { mode: "ascii", cwd: "DIR" },
|
|
562
|
+
colors: { gitBranch: "syntaxKeyword", editorAccent: "accent" },
|
|
563
|
+
});
|
|
564
|
+
expect(config.projectRefreshIntervalMs).toBe(5_000);
|
|
565
|
+
expect(config.icons.cwd).toBe("DIR");
|
|
566
|
+
expect(config.colors.gitBranch).toBe("syntaxKeyword");
|
|
567
|
+
expect(config.colors.editorAccent).toBe("accent");
|
|
568
|
+
expect(FOOTER_FORMAT_VARIABLES).toEqual(
|
|
569
|
+
expect.arrayContaining(["cache_read", "cache_write", "subscription", "auto_compaction"]),
|
|
570
|
+
);
|
|
571
|
+
});
|
|
572
|
+
});
|
|
573
|
+
|
|
574
|
+
describe("thinking-steps config", () => {
|
|
575
|
+
it("defaults independently and normalizes invalid canonical leaves", () => {
|
|
576
|
+
const first = mergeConfig({});
|
|
577
|
+
const second = mergeConfig({});
|
|
578
|
+
expect(first.components.thinkingSteps).toEqual({ enabled: false, mode: "tree" });
|
|
579
|
+
expect(first.components.thinkingSteps).not.toBe(second.components.thinkingSteps);
|
|
580
|
+
expect(
|
|
581
|
+
mergeConfig({ components: { thinkingSteps: { enabled: true, mode: "rail" } } }).components
|
|
582
|
+
.thinkingSteps,
|
|
583
|
+
).toEqual({ enabled: true, mode: "rail" });
|
|
584
|
+
expect(
|
|
585
|
+
mergeConfig({
|
|
586
|
+
components: {
|
|
587
|
+
thinkingSteps: { enabled: true, mode: "streaming" },
|
|
588
|
+
},
|
|
589
|
+
}).components.thinkingSteps,
|
|
590
|
+
).toEqual({ enabled: true, mode: "streaming" });
|
|
591
|
+
expect(
|
|
592
|
+
mergeConfig({
|
|
593
|
+
components: {
|
|
594
|
+
thinkingSteps: { enabled: true, mode: "streaming-experimental" },
|
|
595
|
+
},
|
|
596
|
+
}).components.thinkingSteps,
|
|
597
|
+
).toEqual({ enabled: true, mode: "streaming" });
|
|
598
|
+
for (const mode of [undefined, "native", "Rail"]) {
|
|
599
|
+
expect(
|
|
600
|
+
mergeConfig({ components: { thinkingSteps: { enabled: "yes", mode } } }).components
|
|
601
|
+
.thinkingSteps,
|
|
602
|
+
).toEqual({ enabled: false, mode: "tree" });
|
|
603
|
+
}
|
|
604
|
+
});
|
|
605
|
+
|
|
606
|
+
it("persists atomic component patches and preserves unknown keys", () => {
|
|
607
|
+
withConfig(
|
|
608
|
+
{
|
|
609
|
+
futureTop: { keep: true },
|
|
610
|
+
components: { thinkingSteps: { future: { keep: true } } },
|
|
611
|
+
},
|
|
612
|
+
(path) => {
|
|
613
|
+
const saved = saveThinkingStepsComponentPatch({ enabled: true, mode: "rail" }, path);
|
|
614
|
+
const raw = readRaw(path);
|
|
615
|
+
expect(saved.components.thinkingSteps).toEqual({ enabled: true, mode: "rail" });
|
|
616
|
+
expect(raw.components.thinkingSteps).toMatchObject({
|
|
617
|
+
enabled: true,
|
|
618
|
+
mode: "rail",
|
|
619
|
+
future: { keep: true },
|
|
620
|
+
});
|
|
621
|
+
expect(raw.futureTop).toEqual({ keep: true });
|
|
622
|
+
expect(configTempFiles(join(path, ".."))).toEqual([]);
|
|
623
|
+
},
|
|
624
|
+
);
|
|
625
|
+
});
|
|
626
|
+
|
|
627
|
+
it("normalizes the one-window Streaming migration alias on the next save", () => {
|
|
628
|
+
withConfig(
|
|
629
|
+
{ components: { thinkingSteps: { enabled: false, mode: "streaming-experimental" } } },
|
|
630
|
+
(path) => {
|
|
631
|
+
const saved = saveThinkingStepsComponentPatch({ enabled: true }, path);
|
|
632
|
+
expect(saved.components.thinkingSteps).toEqual({ enabled: true, mode: "streaming" });
|
|
633
|
+
expect(readRaw(path).components.thinkingSteps).toMatchObject({
|
|
634
|
+
enabled: true,
|
|
635
|
+
mode: "streaming",
|
|
636
|
+
});
|
|
637
|
+
},
|
|
638
|
+
);
|
|
639
|
+
});
|
|
640
|
+
|
|
641
|
+
it("refuses to overwrite corrupt files", () => {
|
|
642
|
+
withConfig(undefined, (path) => {
|
|
643
|
+
writeFileSync(path, "{broken");
|
|
644
|
+
expect(() => saveThinkingStepsComponentPatch({ enabled: true }, path)).toThrow(
|
|
645
|
+
/Refusing to save Zentui config/,
|
|
646
|
+
);
|
|
647
|
+
expect(readFileSync(path, "utf8")).toBe("{broken");
|
|
648
|
+
});
|
|
649
|
+
});
|
|
650
|
+
});
|
|
651
|
+
|
|
652
|
+
describe("working-line config", () => {
|
|
653
|
+
it("defaults to cloned custom presets and migrates legacy modes without losing values", () => {
|
|
654
|
+
const first = mergeConfig({}).components.workingLine.messages;
|
|
655
|
+
const second = mergeConfig({}).components.workingLine.messages;
|
|
656
|
+
expect(first).toEqual({
|
|
657
|
+
custom: true,
|
|
658
|
+
values: defaultConfig.components.workingLine.messages.values,
|
|
659
|
+
});
|
|
660
|
+
expect(first.values).not.toBe(second.values);
|
|
661
|
+
expect(first.values).not.toBe(defaultConfig.components.workingLine.messages.values);
|
|
662
|
+
expect(
|
|
663
|
+
mergeConfig({ components: { workingLine: { messages: { mode: "native", values: [] } } } })
|
|
664
|
+
.components.workingLine.messages,
|
|
665
|
+
).toEqual({ custom: false, values: defaultConfig.components.workingLine.messages.values });
|
|
666
|
+
expect(
|
|
667
|
+
mergeConfig({ components: { workingLine: { messages: { mode: "replace", values: [] } } } })
|
|
668
|
+
.components.workingLine.messages,
|
|
669
|
+
).toEqual({ custom: true, values: defaultConfig.components.workingLine.messages.values });
|
|
670
|
+
expect(
|
|
671
|
+
mergeConfig({
|
|
672
|
+
components: { workingLine: { messages: { mode: "replace", values: [" Custom "] } } },
|
|
673
|
+
}).components.workingLine.messages,
|
|
674
|
+
).toEqual({ custom: true, values: ["Custom"] });
|
|
675
|
+
const appendValues = Array.from({ length: 32 }, (_, index) => `legacy-${index}`);
|
|
676
|
+
const append = mergeConfig({
|
|
677
|
+
components: { workingLine: { messages: { mode: "append", values: appendValues } } },
|
|
678
|
+
}).components.workingLine.messages;
|
|
679
|
+
expect(append.custom).toBe(true);
|
|
680
|
+
expect(append.values).toEqual([
|
|
681
|
+
...defaultConfig.components.workingLine.messages.values,
|
|
682
|
+
...appendValues,
|
|
683
|
+
]);
|
|
684
|
+
expect(append.values).toHaveLength(48);
|
|
685
|
+
});
|
|
686
|
+
|
|
687
|
+
it("gives canonical custom presence precedence and preserves explicit empty values", () => {
|
|
688
|
+
expect(
|
|
689
|
+
mergeConfig({
|
|
690
|
+
components: {
|
|
691
|
+
workingLine: { messages: { custom: false, mode: "append", values: [] } },
|
|
692
|
+
},
|
|
693
|
+
}).components.workingLine.messages,
|
|
694
|
+
).toEqual({ custom: false, values: [] });
|
|
695
|
+
expect(
|
|
696
|
+
mergeConfig({
|
|
697
|
+
components: { workingLine: { messages: { custom: "bad", mode: "native" } } },
|
|
698
|
+
}).components.workingLine.messages,
|
|
699
|
+
).toEqual({ custom: true, values: defaultConfig.components.workingLine.messages.values });
|
|
700
|
+
expect(
|
|
701
|
+
mergeConfig({ components: { workingLine: { messages: { values: [] } } } }).components
|
|
702
|
+
.workingLine.messages,
|
|
703
|
+
).toEqual({ custom: true, values: [] });
|
|
704
|
+
});
|
|
705
|
+
|
|
706
|
+
it.each([
|
|
707
|
+
[30, 30],
|
|
708
|
+
[1000, 1000],
|
|
709
|
+
[29, 100],
|
|
710
|
+
[1001, 100],
|
|
711
|
+
[60.5, 100],
|
|
712
|
+
["60", 100],
|
|
713
|
+
[Number.NaN, 100],
|
|
714
|
+
[Number.MAX_SAFE_INTEGER, 100],
|
|
715
|
+
] as const)(
|
|
716
|
+
"migrates legacy Working-line interval %s to spinner speed %s ms",
|
|
717
|
+
(intervalMs, expected) => {
|
|
718
|
+
expect(
|
|
719
|
+
mergeConfig({ components: { workingLine: { intervalMs } } }).components.workingLine
|
|
720
|
+
.spinnerIntervalMs,
|
|
721
|
+
).toBe(expected);
|
|
722
|
+
expect(
|
|
723
|
+
mergeConfig({ components: { workingLine: { intervalMs } } }).components.workingLine
|
|
724
|
+
.textIntervalMs,
|
|
725
|
+
).toBe(60);
|
|
726
|
+
},
|
|
727
|
+
);
|
|
728
|
+
|
|
729
|
+
it.each([
|
|
730
|
+
[30, 30],
|
|
731
|
+
[1000, 1000],
|
|
732
|
+
[29, 60],
|
|
733
|
+
[1001, 60],
|
|
734
|
+
[60.5, 60],
|
|
735
|
+
["60", 60],
|
|
736
|
+
] as const)("normalizes canonical text speed %s to %s ms", (textIntervalMs, expected) => {
|
|
737
|
+
expect(
|
|
738
|
+
mergeConfig({ components: { workingLine: { textIntervalMs } } }).components.workingLine
|
|
739
|
+
.textIntervalMs,
|
|
740
|
+
).toBe(expected);
|
|
741
|
+
});
|
|
742
|
+
|
|
743
|
+
it("gives canonical spinner speed presence precedence over legacy input", () => {
|
|
744
|
+
expect(
|
|
745
|
+
mergeConfig({
|
|
746
|
+
components: { workingLine: { intervalMs: 180, spinnerIntervalMs: 160 } },
|
|
747
|
+
}).components.workingLine.spinnerIntervalMs,
|
|
748
|
+
).toBe(160);
|
|
749
|
+
expect(
|
|
750
|
+
mergeConfig({
|
|
751
|
+
components: { workingLine: { intervalMs: 180, spinnerIntervalMs: "bad" } },
|
|
752
|
+
}).components.workingLine.spinnerIntervalMs,
|
|
753
|
+
).toBe(100);
|
|
754
|
+
});
|
|
755
|
+
|
|
756
|
+
it("defaults malformed or missing Turn summary to true and preserves explicit false", () => {
|
|
757
|
+
expect(mergeConfig({}).components.workingLine.turnSummary).toBe(true);
|
|
758
|
+
expect(
|
|
759
|
+
mergeConfig({ components: { workingLine: { turnSummary: "bad" } } }).components.workingLine
|
|
760
|
+
.turnSummary,
|
|
761
|
+
).toBe(true);
|
|
762
|
+
expect(
|
|
763
|
+
mergeConfig({ components: { workingLine: { turnSummary: false } } }).components.workingLine
|
|
764
|
+
.turnSummary,
|
|
765
|
+
).toBe(false);
|
|
766
|
+
});
|
|
767
|
+
|
|
768
|
+
it("saves Turn summary while preserving unknown config", () => {
|
|
769
|
+
withConfig(
|
|
770
|
+
{ components: { workingLine: { unknown: { keep: true } } }, topLevel: "keep" },
|
|
771
|
+
(path) => {
|
|
772
|
+
const config = saveWorkingLineComponentPatch({ turnSummary: false }, path);
|
|
773
|
+
const raw = JSON.parse(readFileSync(path, "utf8"));
|
|
774
|
+
expect(config.components.workingLine.turnSummary).toBe(false);
|
|
775
|
+
expect(raw.components.workingLine.turnSummary).toBe(false);
|
|
776
|
+
expect(raw.components.workingLine.unknown).toEqual({ keep: true });
|
|
777
|
+
expect(raw.topLevel).toBe("keep");
|
|
778
|
+
},
|
|
779
|
+
);
|
|
780
|
+
});
|
|
781
|
+
|
|
782
|
+
it("parses Pulse without changing established Working-line defaults", () => {
|
|
783
|
+
expect(mergeConfig({}).components.workingLine.spinner).toBe("star-bloom");
|
|
784
|
+
expect(
|
|
785
|
+
mergeConfig({
|
|
786
|
+
components: { workingLine: { spinner: "pulse", spinnerIntervalMs: 180 } },
|
|
787
|
+
}).components.workingLine,
|
|
788
|
+
).toMatchObject({ spinner: "pulse", spinnerIntervalMs: 180, textIntervalMs: 60 });
|
|
789
|
+
});
|
|
790
|
+
|
|
791
|
+
it("normalizes each independent field, messages, and palette override", () => {
|
|
792
|
+
const config = mergeConfig({
|
|
793
|
+
components: {
|
|
794
|
+
workingLine: {
|
|
795
|
+
enabled: true,
|
|
796
|
+
spinner: "pinwheel",
|
|
797
|
+
spinnerIntervalMs: 160,
|
|
798
|
+
animateSpinnerColor: true,
|
|
799
|
+
textIntervalMs: 40,
|
|
800
|
+
textAnimation: "kitt",
|
|
801
|
+
colorSource: "terminal",
|
|
802
|
+
messages: {
|
|
803
|
+
mode: "replace",
|
|
804
|
+
values: [" One ", "One", "\x1b[31mTwo\x1b[0m", "\n"],
|
|
805
|
+
},
|
|
806
|
+
segments: { tool: false, elapsed: true, thought: true, tokens: false },
|
|
807
|
+
},
|
|
808
|
+
},
|
|
809
|
+
colors: {
|
|
810
|
+
workingLineLow: "fg:240",
|
|
811
|
+
workingLineMid: "cyan",
|
|
812
|
+
workingLineHigh: "bold cyan",
|
|
813
|
+
editorAccent: "red",
|
|
814
|
+
},
|
|
815
|
+
});
|
|
816
|
+
expect(config.components.workingLine).toEqual({
|
|
817
|
+
enabled: true,
|
|
818
|
+
turnSummary: true,
|
|
819
|
+
spinner: "pinwheel",
|
|
820
|
+
spinnerIntervalMs: 160,
|
|
821
|
+
animateSpinnerColor: true,
|
|
822
|
+
textIntervalMs: 40,
|
|
823
|
+
textAnimation: "kitt",
|
|
824
|
+
colorSource: "terminal",
|
|
825
|
+
messages: { custom: true, values: ["One", "Two"] },
|
|
826
|
+
segments: { tool: false, elapsed: true, thought: true, tokens: false },
|
|
827
|
+
});
|
|
828
|
+
expect(config.colors).toMatchObject({
|
|
829
|
+
workingLineLow: "fg:240",
|
|
830
|
+
workingLineMid: "cyan",
|
|
831
|
+
workingLineHigh: "bold cyan",
|
|
832
|
+
editorAccent: "red",
|
|
833
|
+
});
|
|
834
|
+
});
|
|
835
|
+
|
|
836
|
+
it("falls back malformed leaves independently and enforces message caps", () => {
|
|
837
|
+
const values = Array.from({ length: 40 }, (_, index) => `${index}:${"界".repeat(30)}`);
|
|
838
|
+
const component = mergeConfig({
|
|
839
|
+
components: {
|
|
840
|
+
workingLine: {
|
|
841
|
+
enabled: "yes",
|
|
842
|
+
spinner: "future",
|
|
843
|
+
intervalMs: 29,
|
|
844
|
+
animateSpinnerColor: "yes",
|
|
845
|
+
textAnimation: "pulse",
|
|
846
|
+
colorSource: "editor",
|
|
847
|
+
messages: { mode: "rotate", values },
|
|
848
|
+
},
|
|
849
|
+
},
|
|
850
|
+
colors: { workingLineLow: "not-a-color" },
|
|
851
|
+
}).components.workingLine;
|
|
852
|
+
expect(component).toMatchObject({
|
|
853
|
+
enabled: true,
|
|
854
|
+
spinner: "star-bloom",
|
|
855
|
+
spinnerIntervalMs: 100,
|
|
856
|
+
animateSpinnerColor: false,
|
|
857
|
+
textIntervalMs: 60,
|
|
858
|
+
textAnimation: "classic",
|
|
859
|
+
colorSource: "theme",
|
|
860
|
+
messages: { custom: true },
|
|
861
|
+
segments: { tool: true, elapsed: true, thought: true, tokens: true },
|
|
862
|
+
});
|
|
863
|
+
expect(component.messages.values).toHaveLength(40);
|
|
864
|
+
expect(component.messages.values.every((value) => value.length > 0)).toBe(true);
|
|
865
|
+
expect(component.messages.values.every((value) => visibleWidth(value) <= 43)).toBe(true);
|
|
866
|
+
});
|
|
867
|
+
|
|
868
|
+
it("saves nested patches, copies arrays, and preserves unknown fields", () => {
|
|
869
|
+
withConfig(
|
|
870
|
+
{
|
|
871
|
+
unknownTop: true,
|
|
872
|
+
components: {
|
|
873
|
+
workingLine: {
|
|
874
|
+
future: { keep: true },
|
|
875
|
+
intervalMs: 180,
|
|
876
|
+
messages: { mode: "append", futureMessages: true, values: ["Old"] },
|
|
877
|
+
},
|
|
878
|
+
},
|
|
879
|
+
},
|
|
880
|
+
(path) => {
|
|
881
|
+
const values = [" New ", "New", "Other"];
|
|
882
|
+
const saved = saveWorkingLineComponentPatch(
|
|
883
|
+
{
|
|
884
|
+
spinner: "braille",
|
|
885
|
+
spinnerIntervalMs: 60,
|
|
886
|
+
animateSpinnerColor: true,
|
|
887
|
+
messages: { custom: true, values },
|
|
888
|
+
segments: { elapsed: false },
|
|
889
|
+
},
|
|
890
|
+
path,
|
|
891
|
+
);
|
|
892
|
+
values[0] = "mutated";
|
|
893
|
+
const raw = readRaw(path);
|
|
894
|
+
expect(saved.components.workingLine).toMatchObject({
|
|
895
|
+
spinner: "braille",
|
|
896
|
+
spinnerIntervalMs: 60,
|
|
897
|
+
animateSpinnerColor: true,
|
|
898
|
+
textIntervalMs: 60,
|
|
899
|
+
messages: { custom: true, values: ["New", "Other"] },
|
|
900
|
+
segments: { tool: true, elapsed: false, thought: true, tokens: true },
|
|
901
|
+
});
|
|
902
|
+
expect(raw.unknownTop).toBe(true);
|
|
903
|
+
expect(raw.components.workingLine.future).toEqual({ keep: true });
|
|
904
|
+
expect(raw.components.workingLine.messages.futureMessages).toBe(true);
|
|
905
|
+
expect(raw.components.workingLine.messages.values).toEqual(["New", "Other"]);
|
|
906
|
+
expect(raw.components.workingLine.messages.custom).toBe(true);
|
|
907
|
+
expect(raw.components.workingLine.messages).not.toHaveProperty("mode");
|
|
908
|
+
expect(raw.components.workingLine).not.toHaveProperty("intervalMs");
|
|
909
|
+
},
|
|
910
|
+
);
|
|
911
|
+
});
|
|
912
|
+
});
|
|
913
|
+
|
|
914
|
+
describe("Phase 4 style migration", () => {
|
|
915
|
+
it.each([
|
|
916
|
+
[true, "opencode-copy-friendly"],
|
|
917
|
+
[false, "opencode"],
|
|
918
|
+
["invalid", "opencode"],
|
|
919
|
+
] as const)("maps a present nested Editor flag %s deterministically", (copyFriendly, style) => {
|
|
920
|
+
const config = mergeConfig({
|
|
921
|
+
features: { copyFriendly: true },
|
|
922
|
+
components: {
|
|
923
|
+
editor: { style: "polished", styles: { polished: { copyFriendly } } },
|
|
924
|
+
},
|
|
925
|
+
});
|
|
926
|
+
expect(config.components.editor.style).toBe(style);
|
|
927
|
+
});
|
|
928
|
+
|
|
929
|
+
it.each([
|
|
930
|
+
[true, "framed-copy-friendly"],
|
|
931
|
+
[false, "framed"],
|
|
932
|
+
["invalid", "framed"],
|
|
933
|
+
] as const)("maps a present nested message flag %s deterministically", (copyFriendly, style) => {
|
|
934
|
+
const config = mergeConfig({
|
|
935
|
+
features: { editor: true, copyFriendly: true },
|
|
936
|
+
components: {
|
|
937
|
+
userMessages: {
|
|
938
|
+
enabled: true,
|
|
939
|
+
style: "framed",
|
|
940
|
+
styles: { framed: { copyFriendly } },
|
|
941
|
+
},
|
|
942
|
+
},
|
|
943
|
+
});
|
|
944
|
+
expect(config.components.userMessages).toMatchObject({ style, enabled: true });
|
|
945
|
+
});
|
|
946
|
+
|
|
947
|
+
it("maps the released feature flag to copy-friendly Editor and messages", () => {
|
|
948
|
+
const migrated = mergeConfig({ features: { copyFriendly: true } });
|
|
949
|
+
expect(migrated.components.editor.style).toBe("opencode-copy-friendly");
|
|
950
|
+
expect(migrated.components.userMessages).toMatchObject({
|
|
951
|
+
style: "framed-copy-friendly",
|
|
952
|
+
enabled: true,
|
|
953
|
+
});
|
|
954
|
+
|
|
955
|
+
const regular = mergeConfig({ features: { copyFriendly: false } });
|
|
956
|
+
expect(regular.components.editor.style).toBe("opencode");
|
|
957
|
+
expect(regular.components.userMessages).toMatchObject({ style: "labeled", enabled: true });
|
|
958
|
+
expect(migrated.features).not.toHaveProperty("copyFriendly");
|
|
959
|
+
});
|
|
960
|
+
|
|
961
|
+
it.each([
|
|
962
|
+
[undefined, true, "opencode-copy-friendly"],
|
|
963
|
+
[undefined, false, "opencode"],
|
|
964
|
+
[undefined, "invalid", "opencode"],
|
|
965
|
+
["future", true, "opencode-copy-friendly"],
|
|
966
|
+
["future", false, "opencode"],
|
|
967
|
+
["future", "invalid", "opencode"],
|
|
968
|
+
] as const)(
|
|
969
|
+
"resolves absent or invalid Editor style %s from nested flag %s",
|
|
970
|
+
(rawStyle, copyFriendly, expected) => {
|
|
971
|
+
const config = mergeConfig({
|
|
972
|
+
features: { copyFriendly: copyFriendly !== true },
|
|
973
|
+
components: {
|
|
974
|
+
editor: {
|
|
975
|
+
...(rawStyle === undefined ? {} : { style: rawStyle }),
|
|
976
|
+
styles: { polished: { copyFriendly } },
|
|
977
|
+
},
|
|
978
|
+
},
|
|
979
|
+
});
|
|
980
|
+
expect(config.components.editor.style).toBe(expected);
|
|
981
|
+
},
|
|
982
|
+
);
|
|
983
|
+
|
|
984
|
+
it.each([
|
|
985
|
+
[undefined, true, "framed-copy-friendly"],
|
|
986
|
+
[undefined, false, "framed"],
|
|
987
|
+
[undefined, "invalid", "framed"],
|
|
988
|
+
["future", true, "framed-copy-friendly"],
|
|
989
|
+
["future", false, "framed"],
|
|
990
|
+
["future", "invalid", "framed"],
|
|
991
|
+
] as const)(
|
|
992
|
+
"resolves absent or invalid message style %s from nested flag %s",
|
|
993
|
+
(rawStyle, copyFriendly, expectedStyle) => {
|
|
994
|
+
const config = mergeConfig({
|
|
995
|
+
features: { editor: true, copyFriendly: copyFriendly !== true },
|
|
996
|
+
components: {
|
|
997
|
+
userMessages: {
|
|
998
|
+
enabled: true,
|
|
999
|
+
...(rawStyle === undefined ? {} : { style: rawStyle }),
|
|
1000
|
+
styles: { framed: { copyFriendly } },
|
|
1001
|
+
},
|
|
1002
|
+
},
|
|
1003
|
+
});
|
|
1004
|
+
expect(config.components.userMessages).toMatchObject({
|
|
1005
|
+
style: expectedStyle,
|
|
1006
|
+
enabled: true,
|
|
1007
|
+
});
|
|
1008
|
+
},
|
|
1009
|
+
);
|
|
1010
|
+
|
|
1011
|
+
it("treats ambiguous explicit styles without nested flags as authoritative", () => {
|
|
1012
|
+
const config = mergeConfig({
|
|
1013
|
+
features: { editor: true, copyFriendly: true },
|
|
1014
|
+
components: {
|
|
1015
|
+
editor: { style: "opencode" },
|
|
1016
|
+
userMessages: { enabled: true, style: "framed" },
|
|
1017
|
+
},
|
|
1018
|
+
});
|
|
1019
|
+
expect(config.components.editor.style).toBe("opencode");
|
|
1020
|
+
expect(config.components.userMessages).toMatchObject({ style: "framed", enabled: true });
|
|
1021
|
+
});
|
|
1022
|
+
|
|
1023
|
+
it("uses released flags for absent or invalid styles without nested flags", () => {
|
|
1024
|
+
for (const style of [undefined, "future"] as const) {
|
|
1025
|
+
const config = mergeConfig({
|
|
1026
|
+
features: { editor: true, copyFriendly: true },
|
|
1027
|
+
components: {
|
|
1028
|
+
editor: style === undefined ? {} : { style },
|
|
1029
|
+
userMessages: style === undefined ? { enabled: true } : { enabled: true, style },
|
|
1030
|
+
},
|
|
1031
|
+
});
|
|
1032
|
+
expect(config.components.editor.style).toBe("opencode-copy-friendly");
|
|
1033
|
+
expect(config.components.userMessages).toMatchObject({
|
|
1034
|
+
style: "framed-copy-friendly",
|
|
1035
|
+
enabled: true,
|
|
1036
|
+
});
|
|
1037
|
+
}
|
|
1038
|
+
});
|
|
1039
|
+
|
|
1040
|
+
it.each([
|
|
1041
|
+
["minimalist", "compact"],
|
|
1042
|
+
["opencode-copy-friendly", "labeled"],
|
|
1043
|
+
["opencode", "framed-copy-friendly"],
|
|
1044
|
+
] as const)("preserves unambiguous explicit styles %s and %s", (editorStyle, messageStyle) => {
|
|
1045
|
+
const config = mergeConfig({
|
|
1046
|
+
features: { copyFriendly: true },
|
|
1047
|
+
components: {
|
|
1048
|
+
editor: {
|
|
1049
|
+
style: editorStyle,
|
|
1050
|
+
styles: { opencode: { copyFriendly: true } },
|
|
1051
|
+
},
|
|
1052
|
+
userMessages: {
|
|
1053
|
+
enabled: true,
|
|
1054
|
+
style: messageStyle,
|
|
1055
|
+
styles: { framed: { copyFriendly: true } },
|
|
1056
|
+
},
|
|
1057
|
+
},
|
|
1058
|
+
});
|
|
1059
|
+
expect(config.components.editor.style).toBe(editorStyle);
|
|
1060
|
+
expect(config.components.userMessages).toMatchObject({ style: messageStyle, enabled: true });
|
|
1061
|
+
});
|
|
1062
|
+
|
|
1063
|
+
it("seeds and parses polished metadata independently", () => {
|
|
1064
|
+
const seeded = mergeConfig({ editorMetadataFormat: "$legacy" });
|
|
1065
|
+
expect(seeded.components.editor.styles.opencode.metadataFormat).toBe("$legacy");
|
|
1066
|
+
expect(seeded.components.editor.styles["opencode-copy-friendly"].metadataFormat).toBe(
|
|
1067
|
+
"$legacy",
|
|
1068
|
+
);
|
|
1069
|
+
const independent = mergeConfig({
|
|
1070
|
+
editorMetadataFormat: "$flat",
|
|
1071
|
+
components: {
|
|
1072
|
+
editor: {
|
|
1073
|
+
styles: {
|
|
1074
|
+
polished: { metadataFormat: "$regular" },
|
|
1075
|
+
"opencode-copy-friendly": { metadataFormat: "$low" },
|
|
1076
|
+
},
|
|
1077
|
+
},
|
|
1078
|
+
},
|
|
1079
|
+
});
|
|
1080
|
+
expect(independent.components.editor.styles.opencode.metadataFormat).toBe("$regular");
|
|
1081
|
+
expect(independent.components.editor.styles["opencode-copy-friendly"].metadataFormat).toBe(
|
|
1082
|
+
"$low",
|
|
1083
|
+
);
|
|
1084
|
+
});
|
|
1085
|
+
|
|
1086
|
+
it("deletes only obsolete owning leaves on explicit style saves", () => {
|
|
1087
|
+
withConfig(
|
|
1088
|
+
{
|
|
1089
|
+
features: { copyFriendly: true },
|
|
1090
|
+
components: {
|
|
1091
|
+
editor: {
|
|
1092
|
+
styles: {
|
|
1093
|
+
polished: { copyFriendly: true, sibling: "keep" },
|
|
1094
|
+
future: { keep: true },
|
|
1095
|
+
},
|
|
1096
|
+
},
|
|
1097
|
+
userMessages: {
|
|
1098
|
+
styles: { framed: { copyFriendly: true, sibling: "keep" }, future: { keep: true } },
|
|
1099
|
+
},
|
|
1100
|
+
},
|
|
1101
|
+
},
|
|
1102
|
+
(path) => {
|
|
1103
|
+
saveEditorComponentPatch({ style: "opencode" }, path);
|
|
1104
|
+
const afterEditor = readRaw(path);
|
|
1105
|
+
expect(afterEditor.components.editor.styles.polished).toMatchObject({ sibling: "keep" });
|
|
1106
|
+
expect(afterEditor.components.editor.styles.polished).not.toHaveProperty("copyFriendly");
|
|
1107
|
+
expect(afterEditor.components.editor.styles.opencode).toHaveProperty("metadataFormat");
|
|
1108
|
+
expect(afterEditor.components.userMessages.styles.framed).toMatchObject({
|
|
1109
|
+
copyFriendly: true,
|
|
1110
|
+
sibling: "keep",
|
|
1111
|
+
});
|
|
1112
|
+
|
|
1113
|
+
saveUserMessagesComponentPatch({ style: "framed" }, path);
|
|
1114
|
+
const raw = readRaw(path);
|
|
1115
|
+
expect(raw.components.editor.styles.polished).toMatchObject({ sibling: "keep" });
|
|
1116
|
+
expect(raw.components.editor.styles.polished).not.toHaveProperty("copyFriendly");
|
|
1117
|
+
expect(raw.components.userMessages.styles.framed).toMatchObject({ sibling: "keep" });
|
|
1118
|
+
expect(raw.components.userMessages.styles.framed).not.toHaveProperty("copyFriendly");
|
|
1119
|
+
expect(raw.components.editor.styles.future).toEqual({ keep: true });
|
|
1120
|
+
expect(raw.components.userMessages.styles.future).toEqual({ keep: true });
|
|
1121
|
+
expect(raw.features.copyFriendly).toBe(true);
|
|
1122
|
+
const reloaded = mergeConfig(raw);
|
|
1123
|
+
expect(reloaded.components.editor.style).toBe("opencode");
|
|
1124
|
+
expect(reloaded.components.userMessages).toMatchObject({ style: "framed", enabled: true });
|
|
1125
|
+
},
|
|
1126
|
+
);
|
|
1127
|
+
});
|
|
1128
|
+
|
|
1129
|
+
it.each(["framed", "framed-copy-friendly"] as const)(
|
|
1130
|
+
"cleans only the obsolete nested flag when explicitly saving %s",
|
|
1131
|
+
(style) => {
|
|
1132
|
+
withConfig(
|
|
1133
|
+
{
|
|
1134
|
+
features: { copyFriendly: true },
|
|
1135
|
+
components: {
|
|
1136
|
+
userMessages: {
|
|
1137
|
+
styles: {
|
|
1138
|
+
framed: { copyFriendly: true, sibling: "keep" },
|
|
1139
|
+
future: { keep: true },
|
|
1140
|
+
},
|
|
1141
|
+
futureComponent: "keep",
|
|
1142
|
+
},
|
|
1143
|
+
},
|
|
1144
|
+
},
|
|
1145
|
+
(path) => {
|
|
1146
|
+
saveUserMessagesComponentPatch({ style }, path);
|
|
1147
|
+
const raw = readRaw(path);
|
|
1148
|
+
expect(raw.components.userMessages.style).toBe(style);
|
|
1149
|
+
expect(raw.components.userMessages.styles.framed).toEqual({ sibling: "keep" });
|
|
1150
|
+
expect(raw.components.userMessages.styles.future).toEqual({ keep: true });
|
|
1151
|
+
expect(raw.components.userMessages.futureComponent).toBe("keep");
|
|
1152
|
+
expect(raw.features.copyFriendly).toBe(true);
|
|
1153
|
+
expect(mergeConfig(raw).components.userMessages.style).toBe(style);
|
|
1154
|
+
},
|
|
1155
|
+
);
|
|
1156
|
+
},
|
|
1157
|
+
);
|
|
1158
|
+
|
|
1159
|
+
it.each([
|
|
1160
|
+
[
|
|
1161
|
+
"Editor",
|
|
1162
|
+
"editor",
|
|
1163
|
+
(path: string) => saveEditorComponentPatch({ enabled: false }, path),
|
|
1164
|
+
(path: string) => saveEditorComponentPatch({ style: "opencode" }, path),
|
|
1165
|
+
"opencode",
|
|
1166
|
+
],
|
|
1167
|
+
[
|
|
1168
|
+
"User messages",
|
|
1169
|
+
"userMessages",
|
|
1170
|
+
(path: string) => saveUserMessagesComponentPatch({ enabled: false }, path),
|
|
1171
|
+
(path: string) => saveUserMessagesComponentPatch({ style: "framed" }, path),
|
|
1172
|
+
"framed",
|
|
1173
|
+
],
|
|
1174
|
+
[
|
|
1175
|
+
"Selector borders",
|
|
1176
|
+
"selectorBorders",
|
|
1177
|
+
(path: string) => saveSelectorBordersComponentPatch({ enabled: false }, path),
|
|
1178
|
+
(path: string) => saveSelectorBordersComponentPatch({ style: "zentui" }, path),
|
|
1179
|
+
"zentui",
|
|
1180
|
+
],
|
|
1181
|
+
[
|
|
1182
|
+
"Footer",
|
|
1183
|
+
"footer",
|
|
1184
|
+
(path: string) => saveFooterComponentPatch({ colorSource: "terminal" }, path),
|
|
1185
|
+
(path: string) => saveFooterComponentPatch({ style: "starship" }, path),
|
|
1186
|
+
"starship",
|
|
1187
|
+
],
|
|
1188
|
+
] as const)(
|
|
1189
|
+
"preserves an unknown raw %s style until its owning style is explicitly selected",
|
|
1190
|
+
(_label, owner, saveUnrelated, saveStyle, expectedStyle) => {
|
|
1191
|
+
withConfig(
|
|
1192
|
+
{
|
|
1193
|
+
components: {
|
|
1194
|
+
[owner]: {
|
|
1195
|
+
style: `future-${owner}`,
|
|
1196
|
+
futureOption: "keep",
|
|
1197
|
+
styles: { future: { keep: true } },
|
|
1198
|
+
},
|
|
1199
|
+
},
|
|
1200
|
+
},
|
|
1201
|
+
(path) => {
|
|
1202
|
+
const unrelatedConfig = saveUnrelated(path);
|
|
1203
|
+
expect(hasUnsupportedComponentStyle(unrelatedConfig, owner)).toBe(true);
|
|
1204
|
+
const preserved = readRaw(path);
|
|
1205
|
+
expect(preserved.components[owner].style).toBe(`future-${owner}`);
|
|
1206
|
+
expect(preserved.components[owner].futureOption).toBe("keep");
|
|
1207
|
+
expect(preserved.components[owner].styles.future).toEqual({ keep: true });
|
|
1208
|
+
|
|
1209
|
+
const replacedConfig = saveStyle(path);
|
|
1210
|
+
expect(hasUnsupportedComponentStyle(replacedConfig, owner)).toBe(false);
|
|
1211
|
+
const replaced = readRaw(path);
|
|
1212
|
+
expect(replaced.components[owner].style).toBe(expectedStyle);
|
|
1213
|
+
expect(replaced.components[owner].futureOption).toBe("keep");
|
|
1214
|
+
expect(replaced.components[owner].styles.future).toEqual({ keep: true });
|
|
1215
|
+
},
|
|
1216
|
+
);
|
|
1217
|
+
},
|
|
1218
|
+
);
|
|
1219
|
+
});
|
|
1220
|
+
|
|
1221
|
+
describe("canonical snapshot persistence", () => {
|
|
1222
|
+
it("materializes every component from legacy inputs and preserves unknown data", () => {
|
|
1223
|
+
withConfig(
|
|
1224
|
+
{
|
|
1225
|
+
unknownTop: { keep: true },
|
|
1226
|
+
features: { editor: false, copyFriendly: true },
|
|
1227
|
+
colorSources: { editor: "terminal" },
|
|
1228
|
+
components: {
|
|
1229
|
+
futureDomain: { keep: true },
|
|
1230
|
+
editor: {
|
|
1231
|
+
futureComponent: true,
|
|
1232
|
+
styles: {
|
|
1233
|
+
futureStyle: { keep: true },
|
|
1234
|
+
polished: { futurePolished: true },
|
|
1235
|
+
},
|
|
1236
|
+
},
|
|
1237
|
+
footer: {
|
|
1238
|
+
styles: {
|
|
1239
|
+
starship: {
|
|
1240
|
+
futureStarship: true,
|
|
1241
|
+
pathDisplay: { futurePath: true },
|
|
1242
|
+
extensionStatuses: { futureStatuses: true },
|
|
1243
|
+
},
|
|
1244
|
+
},
|
|
1245
|
+
},
|
|
1246
|
+
},
|
|
1247
|
+
},
|
|
1248
|
+
(path) => {
|
|
1249
|
+
const config = saveEditorComponentPatch({ enabled: true }, path);
|
|
1250
|
+
const raw = readRaw(path);
|
|
1251
|
+
expect(Object.keys(raw.components)).toEqual(
|
|
1252
|
+
expect.arrayContaining([
|
|
1253
|
+
"editor",
|
|
1254
|
+
"userMessages",
|
|
1255
|
+
"workingLine",
|
|
1256
|
+
"selectorBorders",
|
|
1257
|
+
"footer",
|
|
1258
|
+
"futureDomain",
|
|
1259
|
+
]),
|
|
1260
|
+
);
|
|
1261
|
+
expect(raw.components.editor.enabled).toBe(true);
|
|
1262
|
+
expect(raw.components.userMessages.enabled).toBe(false);
|
|
1263
|
+
expect(raw.components.selectorBorders.enabled).toBe(false);
|
|
1264
|
+
expect(raw.components.editor.style).toBe("opencode-copy-friendly");
|
|
1265
|
+
expect(raw.components.userMessages.enabled).toBe(false);
|
|
1266
|
+
expect(raw.components.editor.colorSource).toBe("terminal");
|
|
1267
|
+
expect(raw.components.selectorBorders.colorSource).toBe("terminal");
|
|
1268
|
+
expect(raw.features).toEqual({ editor: false, copyFriendly: true });
|
|
1269
|
+
expect(raw.unknownTop).toEqual({ keep: true });
|
|
1270
|
+
expect(raw.components.futureDomain).toEqual({ keep: true });
|
|
1271
|
+
expect(raw.components.editor.futureComponent).toBe(true);
|
|
1272
|
+
expect(raw.components.editor.styles.futureStyle).toEqual({ keep: true });
|
|
1273
|
+
expect(raw.components.editor.styles.polished.futurePolished).toBe(true);
|
|
1274
|
+
expect(raw.components.footer.styles.starship.futureStarship).toBe(true);
|
|
1275
|
+
expect(raw.components.footer.styles.starship.pathDisplay.futurePath).toBe(true);
|
|
1276
|
+
expect(raw.components.footer.styles.starship.extensionStatuses.futureStatuses).toBe(true);
|
|
1277
|
+
expect(config).toEqual(mergeConfig(raw));
|
|
1278
|
+
},
|
|
1279
|
+
);
|
|
1280
|
+
});
|
|
1281
|
+
|
|
1282
|
+
it("prevents legacy edits from recoupling surfaces after the first save", () => {
|
|
1283
|
+
withConfig({ features: { editor: false, copyFriendly: true } }, (path) => {
|
|
1284
|
+
saveEditorComponentPatch({ enabled: true }, path);
|
|
1285
|
+
const raw = readRaw(path);
|
|
1286
|
+
expect(raw.components.editor.enabled).toBe(true);
|
|
1287
|
+
expect(raw.components.userMessages.enabled).toBe(false);
|
|
1288
|
+
expect(raw.components.selectorBorders.enabled).toBe(false);
|
|
1289
|
+
expect(raw.components.editor.style).toBe("opencode-copy-friendly");
|
|
1290
|
+
expect(raw.components.userMessages.enabled).toBe(false);
|
|
1291
|
+
raw.features.editor = true;
|
|
1292
|
+
raw.features.copyFriendly = false;
|
|
1293
|
+
writeFileSync(path, `${JSON.stringify(raw, null, 2)}\n`);
|
|
1294
|
+
const reloaded = mergeConfig(readRaw(path));
|
|
1295
|
+
expect(reloaded.components.editor.enabled).toBe(true);
|
|
1296
|
+
expect(reloaded.components.userMessages.enabled).toBe(false);
|
|
1297
|
+
expect(reloaded.components.selectorBorders.enabled).toBe(false);
|
|
1298
|
+
expect(reloaded.components.editor.style).toBe("opencode-copy-friendly");
|
|
1299
|
+
expect(reloaded.components.userMessages.enabled).toBe(false);
|
|
1300
|
+
});
|
|
1301
|
+
});
|
|
1302
|
+
|
|
1303
|
+
it("supports every typed component saver without discarding inactive styles", () => {
|
|
1304
|
+
withConfig(undefined, (path) => {
|
|
1305
|
+
savePolishedEditorStylePatch({ metadataFormat: "$provider", completionMenu: "native" }, path);
|
|
1306
|
+
savePolishedCopyFriendlyEditorStylePatch(
|
|
1307
|
+
{ metadataFormat: "$model", completionMenu: "palette" },
|
|
1308
|
+
path,
|
|
1309
|
+
);
|
|
1310
|
+
saveAccentRailEditorStylePatch({ transparent: true }, path);
|
|
1311
|
+
saveMinimalistEditorStylePatch({ showGit: false, contextGauge: true }, path);
|
|
1312
|
+
saveUserMessagesComponentPatch({ enabled: false, colorSource: "terminal" }, path);
|
|
1313
|
+
saveSelectorBordersComponentPatch({ enabled: false, colorSource: "terminal" }, path);
|
|
1314
|
+
saveFooterComponentPatch({ style: "native", modelLabel: "name" }, path);
|
|
1315
|
+
saveStarshipFooterStylePatch(
|
|
1316
|
+
{ separator: "chevron", pathDisplay: { mode: "full", depth: 2 } },
|
|
1317
|
+
path,
|
|
1318
|
+
);
|
|
1319
|
+
const config = mergeConfig(readRaw(path));
|
|
1320
|
+
expect(config.components.editor.styles.opencode).toEqual({
|
|
1321
|
+
metadataFormat: "$provider",
|
|
1322
|
+
completionMenu: "native",
|
|
1323
|
+
});
|
|
1324
|
+
expect(config.components.editor.styles["opencode-copy-friendly"]).toEqual({
|
|
1325
|
+
metadataFormat: "$model",
|
|
1326
|
+
completionMenu: "palette",
|
|
1327
|
+
});
|
|
1328
|
+
expect(config.components.editor.styles["accent-rail"]).toMatchObject({
|
|
1329
|
+
transparent: true,
|
|
1330
|
+
});
|
|
1331
|
+
expect(config.components.editor.styles.minimalist).toMatchObject({
|
|
1332
|
+
showGit: false,
|
|
1333
|
+
contextGauge: true,
|
|
1334
|
+
});
|
|
1335
|
+
expect(config.components.userMessages).toMatchObject({
|
|
1336
|
+
enabled: false,
|
|
1337
|
+
colorSource: "terminal",
|
|
1338
|
+
});
|
|
1339
|
+
expect(config.components.selectorBorders).toMatchObject({
|
|
1340
|
+
enabled: false,
|
|
1341
|
+
colorSource: "terminal",
|
|
1342
|
+
});
|
|
1343
|
+
expect(config.components.footer).toMatchObject({ style: "native", modelLabel: "name" });
|
|
1344
|
+
expect(config.components.footer.styles.starship).toMatchObject({
|
|
1345
|
+
separator: "chevron",
|
|
1346
|
+
pathDisplay: { mode: "full", depth: 2 },
|
|
1347
|
+
});
|
|
1348
|
+
});
|
|
1349
|
+
});
|
|
1350
|
+
|
|
1351
|
+
it("preserves stale fixed-editor keys during an unrelated explicit save", () => {
|
|
1352
|
+
const stale = {
|
|
1353
|
+
fixedEditor: { enabled: true, legacyUnknown: true },
|
|
1354
|
+
layout: { fixedEditor: { mouseScroll: false }, futureLayout: true },
|
|
1355
|
+
};
|
|
1356
|
+
withConfig(stale, (path) => {
|
|
1357
|
+
saveFooterComponentPatch({ style: "hidden" }, path);
|
|
1358
|
+
const raw = readRaw(path);
|
|
1359
|
+
expect(raw.fixedEditor).toEqual(stale.fixedEditor);
|
|
1360
|
+
expect(raw.layout).toEqual(stale.layout);
|
|
1361
|
+
expect(raw.components.footer.style).toBe("hidden");
|
|
1362
|
+
});
|
|
1363
|
+
});
|
|
1364
|
+
});
|
|
1365
|
+
|
|
1366
|
+
describe("compatibility saver recipes", () => {
|
|
1367
|
+
it("writes canonical paths only and updates all historically coupled destinations", () => {
|
|
1368
|
+
withConfig(
|
|
1369
|
+
{
|
|
1370
|
+
features: { editor: true, statusLine: true, copyFriendly: false },
|
|
1371
|
+
colorSources: { editor: "theme", starship: "theme", userMessages: "theme" },
|
|
1372
|
+
editorModelLabel: "id",
|
|
1373
|
+
footerFormat: "$legacy",
|
|
1374
|
+
unknown: true,
|
|
1375
|
+
},
|
|
1376
|
+
(path) => {
|
|
1377
|
+
const legacyBefore = structuredClone(readRaw(path));
|
|
1378
|
+
saveColorSourcesPatch(
|
|
1379
|
+
{ editor: "terminal", starship: "terminal", userMessages: "terminal" },
|
|
1380
|
+
path,
|
|
1381
|
+
);
|
|
1382
|
+
saveUiFeaturesPatch({ editor: false, statusLine: false, viewportIndicators: false }, path);
|
|
1383
|
+
saveEditorModelLabel("name", path);
|
|
1384
|
+
saveEditorStyle("minimalist", path);
|
|
1385
|
+
saveMinimalistPatch({ showTimer: false, showGit: false }, path);
|
|
1386
|
+
saveEditorBorderColorMode("adaptive", path);
|
|
1387
|
+
saveFooterFormatPatch("$cwd", path);
|
|
1388
|
+
saveResponsiveFooterPatch(
|
|
1389
|
+
{ responsiveFooter: false, compactFooterFormat: "$context", compactFooterMaxLines: 3 },
|
|
1390
|
+
path,
|
|
1391
|
+
);
|
|
1392
|
+
saveSeparatorPatch("dot", path);
|
|
1393
|
+
saveContextStylePatch("text+gauge", path);
|
|
1394
|
+
saveContextThresholdsPatch({ warning: 45, error: 75 }, path);
|
|
1395
|
+
savePathDisplayPatch({ mode: "full", depth: 3 }, path);
|
|
1396
|
+
saveFooterSegmentsPatch({ modelInfo: true, tokens: false }, path);
|
|
1397
|
+
saveGitBranchPatch({ maxLength: 24 }, path);
|
|
1398
|
+
saveGitCommitPatch({ onlyDetached: false, showTag: false }, path);
|
|
1399
|
+
saveGitMetricsPatch({ onlyNonzero: false, ignoreSubmodules: true }, path);
|
|
1400
|
+
saveExtensionStatusDefaultPlacement("middle", path);
|
|
1401
|
+
saveExtensionStatusPlacement("alpha", "left", path);
|
|
1402
|
+
saveExtensionStatusColorMode("alpha", "original", path);
|
|
1403
|
+
const raw = readRaw(path);
|
|
1404
|
+
const config = mergeConfig(raw);
|
|
1405
|
+
expect(raw.features).toEqual(legacyBefore.features);
|
|
1406
|
+
expect(raw.colorSources).toEqual(legacyBefore.colorSources);
|
|
1407
|
+
expect(raw.editorModelLabel).toBe("id");
|
|
1408
|
+
expect(raw.footerFormat).toBe("$legacy");
|
|
1409
|
+
expect(raw.unknown).toBe(true);
|
|
1410
|
+
expect(raw).not.toHaveProperty("editorStyle");
|
|
1411
|
+
expect(raw).not.toHaveProperty("editorStyles");
|
|
1412
|
+
expect(config.components.editor).toMatchObject({
|
|
1413
|
+
enabled: false,
|
|
1414
|
+
style: "minimalist",
|
|
1415
|
+
colorSource: "terminal",
|
|
1416
|
+
borderColorMode: "adaptive",
|
|
1417
|
+
modelLabel: "name",
|
|
1418
|
+
viewportIndicators: false,
|
|
1419
|
+
});
|
|
1420
|
+
expect(config.components.userMessages).toMatchObject({
|
|
1421
|
+
enabled: false,
|
|
1422
|
+
colorSource: "terminal",
|
|
1423
|
+
});
|
|
1424
|
+
expect(config.components.selectorBorders).toMatchObject({
|
|
1425
|
+
enabled: false,
|
|
1426
|
+
colorSource: "terminal",
|
|
1427
|
+
});
|
|
1428
|
+
expect(config.components.editor.styles.minimalist).toMatchObject({
|
|
1429
|
+
showTimer: false,
|
|
1430
|
+
showGit: false,
|
|
1431
|
+
contextThresholds: { warning: 45, error: 75 },
|
|
1432
|
+
});
|
|
1433
|
+
expect(config.components.footer).toMatchObject({
|
|
1434
|
+
style: "native",
|
|
1435
|
+
colorSource: "terminal",
|
|
1436
|
+
modelLabel: "name",
|
|
1437
|
+
});
|
|
1438
|
+
expect(config.components.footer.styles.starship).toMatchObject({
|
|
1439
|
+
format: "$cwd",
|
|
1440
|
+
responsive: false,
|
|
1441
|
+
compactFormat: "$context",
|
|
1442
|
+
compactMaxLines: 3,
|
|
1443
|
+
separator: "dot",
|
|
1444
|
+
contextStyle: "text+gauge",
|
|
1445
|
+
contextThresholds: { warning: 45, error: 75 },
|
|
1446
|
+
pathDisplay: { mode: "full", depth: 3 },
|
|
1447
|
+
segments: { modelInfo: true, tokens: false },
|
|
1448
|
+
gitBranch: { maxLength: 24 },
|
|
1449
|
+
gitCommit: { onlyDetached: false, showTag: false },
|
|
1450
|
+
gitMetrics: { onlyNonzero: false, ignoreSubmodules: true },
|
|
1451
|
+
extensionStatuses: {
|
|
1452
|
+
defaultPlacement: "middle",
|
|
1453
|
+
placements: { alpha: "left" },
|
|
1454
|
+
colorModes: { alpha: "original" },
|
|
1455
|
+
},
|
|
1456
|
+
});
|
|
1457
|
+
},
|
|
1458
|
+
);
|
|
1459
|
+
});
|
|
1460
|
+
|
|
1461
|
+
it("materializes a complete snapshot when a compatibility saver creates the file", () => {
|
|
1462
|
+
withConfig(undefined, (path) => {
|
|
1463
|
+
saveUiFeaturesPatch({ editor: false }, path);
|
|
1464
|
+
const raw = readRaw(path);
|
|
1465
|
+
expect(Object.keys(raw)).toEqual(["components"]);
|
|
1466
|
+
expect(Object.keys(raw.components).sort()).toEqual([
|
|
1467
|
+
"editor",
|
|
1468
|
+
"footer",
|
|
1469
|
+
"selectorBorders",
|
|
1470
|
+
"thinkingSteps",
|
|
1471
|
+
"userMessages",
|
|
1472
|
+
"workingLine",
|
|
1473
|
+
]);
|
|
1474
|
+
expect(raw.components.editor.enabled).toBe(false);
|
|
1475
|
+
expect(raw.components.userMessages.enabled).toBe(false);
|
|
1476
|
+
expect(raw.components.selectorBorders.enabled).toBe(false);
|
|
1477
|
+
expect(raw).not.toHaveProperty("features");
|
|
1478
|
+
});
|
|
1479
|
+
});
|
|
1480
|
+
});
|
|
1481
|
+
|
|
1482
|
+
describe("mergeConfig", () => {
|
|
1483
|
+
it("defaults project refresh polling to 30 seconds and Starship styles", () => {
|
|
1484
|
+
const config = mergeConfig({});
|
|
1485
|
+
expect(config.projectRefreshIntervalMs).toBe(30_000);
|
|
1486
|
+
expect(config.icons.cacheHit).toBe("c");
|
|
1487
|
+
expect(config.icons.editorPrompt).toBe("");
|
|
1488
|
+
expect(config.colors.gitBranch).toBe("bold purple");
|
|
1489
|
+
expect(config.colors.packageVersion).toBe("208");
|
|
1490
|
+
expect(config.colors.gitCommit).toBe("bold green");
|
|
1491
|
+
expect(config.colors.gitMetricsAdded).toBe("bold green");
|
|
1492
|
+
expect(config.colors.gitMetricsDeleted).toBe("bold red");
|
|
1493
|
+
expect(config.colors.sessionName).toBe("bold green");
|
|
1494
|
+
expect(config.colors.contextNormal).toBe("bright-black");
|
|
1495
|
+
expect(config.colors.tokens).toBe("bright-black");
|
|
1496
|
+
expect(config.colors.extensionStatus).toBe("bright-black");
|
|
1497
|
+
expect(config.colors.editorAccent).toBeUndefined();
|
|
1498
|
+
expect(config.colors.editorRail).toBeUndefined();
|
|
1499
|
+
expect(config.colors.editorPrompt).toBeUndefined();
|
|
1500
|
+
expect(config.colors.editorBorder).toBeUndefined();
|
|
1501
|
+
expect(config.colorSources).toEqual({
|
|
1502
|
+
starship: "theme",
|
|
1503
|
+
editor: "theme",
|
|
1504
|
+
userMessages: "theme",
|
|
1505
|
+
});
|
|
1506
|
+
expect(config.features).toEqual({
|
|
1507
|
+
editor: false,
|
|
1508
|
+
statusLine: false,
|
|
1509
|
+
viewportIndicators: false,
|
|
1510
|
+
});
|
|
1511
|
+
expect(config.footerSegments).toEqual({
|
|
1512
|
+
cwd: true,
|
|
1513
|
+
sessionName: true,
|
|
1514
|
+
gitBranch: true,
|
|
1515
|
+
gitStatus: true,
|
|
1516
|
+
runtime: true,
|
|
1517
|
+
modelInfo: false,
|
|
1518
|
+
context: true,
|
|
1519
|
+
gitCounts: false,
|
|
1520
|
+
sessionDuration: false,
|
|
1521
|
+
username: false,
|
|
1522
|
+
time: false,
|
|
1523
|
+
os: false,
|
|
1524
|
+
packageVersion: false,
|
|
1525
|
+
gitCommit: false,
|
|
1526
|
+
gitMetrics: true,
|
|
1527
|
+
tokens: true,
|
|
1528
|
+
cost: true,
|
|
1529
|
+
});
|
|
1530
|
+
expect(config.extensionStatuses).toEqual({
|
|
1531
|
+
defaultPlacement: "right",
|
|
1532
|
+
placements: {},
|
|
1533
|
+
colorModes: {},
|
|
1534
|
+
});
|
|
1535
|
+
});
|
|
1536
|
+
|
|
1537
|
+
it("registers the canonical telemetry variables without aliases", () => {
|
|
1538
|
+
expect(FOOTER_FORMAT_VARIABLES).toEqual(
|
|
1539
|
+
expect.arrayContaining(["cache_read", "cache_write", "subscription", "auto_compaction"]),
|
|
1540
|
+
);
|
|
1541
|
+
expect(FOOTER_FORMAT_VARIABLES).not.toContain("experimental");
|
|
1542
|
+
});
|
|
1543
|
+
|
|
1544
|
+
it("defaults footerFormat to empty string", () => {
|
|
1545
|
+
expect(mergeConfig({}).footerFormat).toBe("");
|
|
1546
|
+
expect(defaultConfig.footerFormat).toBe("");
|
|
1547
|
+
});
|
|
1548
|
+
|
|
1549
|
+
it("accepts a custom footerFormat string", () => {
|
|
1550
|
+
expect(mergeConfig({ footerFormat: "$cwd on $git_branch $fill $cost" }).footerFormat).toBe(
|
|
1551
|
+
"$cwd on $git_branch $fill $cost",
|
|
1552
|
+
);
|
|
1553
|
+
});
|
|
1554
|
+
|
|
1555
|
+
it("defaults and normalizes responsive footer settings", () => {
|
|
1556
|
+
expect(DEFAULT_COMPACT_FOOTER_FORMAT).toBe(
|
|
1557
|
+
"$cwd$wrap(in $session_name)$wrap(on $git_branch) $git_status$wrap$context$wrap_sep$tokens",
|
|
1558
|
+
);
|
|
1559
|
+
expect(mergeConfig({})).toMatchObject({
|
|
1560
|
+
responsiveFooter: true,
|
|
1561
|
+
compactFooterFormat: DEFAULT_COMPACT_FOOTER_FORMAT,
|
|
1562
|
+
compactFooterMaxLines: "unlimited",
|
|
1563
|
+
});
|
|
1564
|
+
expect(
|
|
1565
|
+
mergeConfig({
|
|
1566
|
+
responsiveFooter: false,
|
|
1567
|
+
compactFooterFormat: "$cwd$wrap$context",
|
|
1568
|
+
compactFooterMaxLines: "unlimited",
|
|
1569
|
+
}),
|
|
1570
|
+
).toMatchObject({
|
|
1571
|
+
responsiveFooter: false,
|
|
1572
|
+
compactFooterFormat: "$cwd$wrap$context",
|
|
1573
|
+
compactFooterMaxLines: "unlimited",
|
|
1574
|
+
});
|
|
1575
|
+
for (const compactFooterMaxLines of [1, 2, 3, "unlimited"] as const) {
|
|
1576
|
+
expect(mergeConfig({ compactFooterMaxLines }).compactFooterMaxLines).toBe(
|
|
1577
|
+
compactFooterMaxLines,
|
|
1578
|
+
);
|
|
1579
|
+
}
|
|
1580
|
+
for (const value of [0, 4, "2", null, false]) {
|
|
1581
|
+
expect(mergeConfig({ compactFooterMaxLines: value }).compactFooterMaxLines).toBe("unlimited");
|
|
1582
|
+
}
|
|
1583
|
+
expect(mergeConfig({ responsiveFooter: "false" }).responsiveFooter).toBe(true);
|
|
1584
|
+
expect(mergeConfig({ compactFooterFormat: "" }).compactFooterFormat).toBe(
|
|
1585
|
+
DEFAULT_COMPACT_FOOTER_FORMAT,
|
|
1586
|
+
);
|
|
1587
|
+
});
|
|
1588
|
+
|
|
1589
|
+
it("persists responsive footer patches without replacing unrelated keys", () => {
|
|
1590
|
+
const dir = mkdtempSync(join(tmpdir(), "zentui-responsive-config-"));
|
|
1591
|
+
const path = join(dir, "zentui.json");
|
|
1592
|
+
try {
|
|
1593
|
+
writeFileSync(path, JSON.stringify({ unknown: { keep: true }, footerFormat: "$cwd" }));
|
|
1594
|
+
const config = saveResponsiveFooterPatch(
|
|
1595
|
+
{ responsiveFooter: false, compactFooterMaxLines: 3 },
|
|
1596
|
+
path,
|
|
1597
|
+
);
|
|
1598
|
+
const raw = JSON.parse(readFileSync(path, "utf8"));
|
|
1599
|
+
expect(raw.unknown).toEqual({ keep: true });
|
|
1600
|
+
expect(raw.footerFormat).toBe("$cwd");
|
|
1601
|
+
expect(raw.components.footer.styles.starship).toMatchObject({
|
|
1602
|
+
format: "$cwd",
|
|
1603
|
+
responsive: false,
|
|
1604
|
+
compactMaxLines: 3,
|
|
1605
|
+
});
|
|
1606
|
+
expect(config.responsiveFooter).toBe(false);
|
|
1607
|
+
expect(config.compactFooterMaxLines).toBe(3);
|
|
1608
|
+
} finally {
|
|
1609
|
+
rmSync(dir, { recursive: true, force: true });
|
|
1610
|
+
}
|
|
1611
|
+
});
|
|
1612
|
+
|
|
1613
|
+
it("defaults editorMetadataFormat and preserves non-empty strings", () => {
|
|
1614
|
+
expect(defaultConfig.editorMetadataFormat).toBe(DEFAULT_EDITOR_METADATA_FORMAT);
|
|
1615
|
+
for (const value of [undefined, null, 123, true, ""]) {
|
|
1616
|
+
expect(mergeConfig({ editorMetadataFormat: value }).editorMetadataFormat).toBe(
|
|
1617
|
+
DEFAULT_EDITOR_METADATA_FORMAT,
|
|
1618
|
+
);
|
|
1619
|
+
}
|
|
1620
|
+
expect(mergeConfig({ editorMetadataFormat: "$model · $provider" }).editorMetadataFormat).toBe(
|
|
1621
|
+
"$model · $provider",
|
|
1622
|
+
);
|
|
1623
|
+
expect(mergeConfig({ editorMetadataFormat: " " }).editorMetadataFormat).toBe(" ");
|
|
1624
|
+
});
|
|
1625
|
+
|
|
1626
|
+
it("ignores non-string footerFormat values", () => {
|
|
1627
|
+
expect(mergeConfig({ footerFormat: 123 }).footerFormat).toBe("");
|
|
1628
|
+
expect(mergeConfig({ footerFormat: null }).footerFormat).toBe("");
|
|
1629
|
+
expect(mergeConfig({ footerFormat: true }).footerFormat).toBe("");
|
|
1630
|
+
});
|
|
1631
|
+
|
|
1632
|
+
it("accepts custom project refresh intervals and 0 to disable polling", () => {
|
|
1633
|
+
expect(mergeConfig({ projectRefreshIntervalMs: 60_000 }).projectRefreshIntervalMs).toBe(60_000);
|
|
1634
|
+
expect(mergeConfig({ projectRefreshIntervalMs: 0 }).projectRefreshIntervalMs).toBe(0);
|
|
1635
|
+
});
|
|
1636
|
+
|
|
1637
|
+
it("clamps short project refresh intervals up to 5 seconds", () => {
|
|
1638
|
+
expect(mergeConfig({ projectRefreshIntervalMs: 100 }).projectRefreshIntervalMs).toBe(5_000);
|
|
1639
|
+
expect(mergeConfig({ projectRefreshIntervalMs: 4_999 }).projectRefreshIntervalMs).toBe(5_000);
|
|
1640
|
+
expect(mergeConfig({ projectRefreshIntervalMs: 5_000 }).projectRefreshIntervalMs).toBe(5_000);
|
|
1641
|
+
});
|
|
1642
|
+
|
|
1643
|
+
it("ignores invalid project refresh intervals", () => {
|
|
1644
|
+
expect(mergeConfig({ projectRefreshIntervalMs: "30000" }).projectRefreshIntervalMs).toBe(
|
|
1645
|
+
30_000,
|
|
1646
|
+
);
|
|
1647
|
+
expect(
|
|
1648
|
+
mergeConfig({ projectRefreshIntervalMs: Number.POSITIVE_INFINITY }).projectRefreshIntervalMs,
|
|
1649
|
+
).toBe(30_000);
|
|
1650
|
+
});
|
|
1651
|
+
|
|
1652
|
+
it("defaults separator style to none and accepts supported values", () => {
|
|
1653
|
+
expect(mergeConfig({}).separator).toBe("none");
|
|
1654
|
+
expect(defaultConfig.separator).toBe("none");
|
|
1655
|
+
for (const separator of ["pipe", "dot", "chevron", "none"] as const) {
|
|
1656
|
+
expect(mergeConfig({ separator }).separator).toBe(separator);
|
|
1657
|
+
}
|
|
1658
|
+
});
|
|
1659
|
+
|
|
1660
|
+
it("falls back to none for invalid separator styles", () => {
|
|
1661
|
+
for (const separator of ["arrow", "", 123, null, true]) {
|
|
1662
|
+
expect(mergeConfig({ separator }).separator).toBe("none");
|
|
1663
|
+
}
|
|
1664
|
+
});
|
|
1665
|
+
|
|
1666
|
+
it("saves separator style without erasing unknown config", () => {
|
|
1667
|
+
const dir = mkdtempSync(join(tmpdir(), "zentui-config-"));
|
|
1668
|
+
const path = join(dir, "zentui.json");
|
|
1669
|
+
try {
|
|
1670
|
+
writeFileSync(path, `${JSON.stringify({ unknown: true, contextStyle: "gauge" }, null, 2)}\n`);
|
|
1671
|
+
|
|
1672
|
+
const config = saveSeparatorPatch("chevron", path);
|
|
1673
|
+
const raw = JSON.parse(readFileSync(path, "utf8"));
|
|
1674
|
+
|
|
1675
|
+
expect(config.separator).toBe("chevron");
|
|
1676
|
+
expect(raw.unknown).toBe(true);
|
|
1677
|
+
expect(raw.contextStyle).toBe("gauge");
|
|
1678
|
+
expect(raw.separator).toBeUndefined();
|
|
1679
|
+
expect(raw.components.footer.styles.starship).toMatchObject({
|
|
1680
|
+
contextStyle: "gauge",
|
|
1681
|
+
separator: "chevron",
|
|
1682
|
+
});
|
|
1683
|
+
} finally {
|
|
1684
|
+
rmSync(dir, { recursive: true, force: true });
|
|
1685
|
+
}
|
|
1686
|
+
});
|
|
1687
|
+
|
|
1688
|
+
it("defaults context style/thresholds and accepts valid overrides", () => {
|
|
1689
|
+
expect(mergeConfig({}).contextStyle).toBe("text");
|
|
1690
|
+
expect(mergeConfig({}).contextThresholds).toEqual({ warning: 70, error: 90 });
|
|
1691
|
+
expect(mergeConfig({ contextStyle: "gauge" }).contextStyle).toBe("gauge");
|
|
1692
|
+
expect(mergeConfig({ contextStyle: "text+gauge" }).contextStyle).toBe("text+gauge");
|
|
1693
|
+
expect(mergeConfig({ contextStyle: "bars" }).contextStyle).toBe("text");
|
|
1694
|
+
expect(
|
|
1695
|
+
mergeConfig({ contextThresholds: { warning: 50, error: 80 } }).contextThresholds,
|
|
1696
|
+
).toEqual({ warning: 50, error: 80 });
|
|
1697
|
+
expect(
|
|
1698
|
+
mergeConfig({ contextThresholds: { warning: 90, error: 70 } }).contextThresholds,
|
|
1699
|
+
).toEqual({ warning: 70, error: 90 });
|
|
1700
|
+
});
|
|
1701
|
+
|
|
1702
|
+
it("defaults editorModelLabel to name and accepts valid overrides", () => {
|
|
1703
|
+
expect(mergeConfig({}).editorModelLabel).toBe("name");
|
|
1704
|
+
expect(mergeConfig({ editorModelLabel: "name" }).editorModelLabel).toBe("name");
|
|
1705
|
+
expect(mergeConfig({ editorModelLabel: "id" }).editorModelLabel).toBe("id");
|
|
1706
|
+
expect(mergeConfig({ editorModelLabel: "title" }).editorModelLabel).toBe("name");
|
|
1707
|
+
});
|
|
1708
|
+
|
|
1709
|
+
it("saves minimalist patches while preserving unknown nested config", () => {
|
|
1710
|
+
const dir = mkdtempSync(join(tmpdir(), "zentui-config-"));
|
|
1711
|
+
const path = join(dir, "zentui.json");
|
|
1712
|
+
try {
|
|
1713
|
+
writeFileSync(
|
|
1714
|
+
path,
|
|
1715
|
+
JSON.stringify({
|
|
1716
|
+
unknownTop: true,
|
|
1717
|
+
editorStyles: {
|
|
1718
|
+
unknownStyle: { keep: true },
|
|
1719
|
+
minimalist: { unknownNested: "keep", showGit: true },
|
|
1720
|
+
},
|
|
1721
|
+
}),
|
|
1722
|
+
);
|
|
1723
|
+
const config = saveMinimalistPatch(
|
|
1724
|
+
{
|
|
1725
|
+
pathDisplay: "full",
|
|
1726
|
+
contextFormat: "percent-total",
|
|
1727
|
+
showSessionName: false,
|
|
1728
|
+
showGit: false,
|
|
1729
|
+
},
|
|
1730
|
+
path,
|
|
1731
|
+
);
|
|
1732
|
+
expect(config.editorStyles.minimalist.pathDisplay).toBe("full");
|
|
1733
|
+
expect(config.editorStyles.minimalist.contextFormat).toBe("percent-total");
|
|
1734
|
+
expect(config.editorStyles.minimalist.showSessionName).toBe(false);
|
|
1735
|
+
expect(config.editorStyles.minimalist.showGit).toBe(false);
|
|
1736
|
+
const raw = JSON.parse(readFileSync(path, "utf8"));
|
|
1737
|
+
expect(raw).toMatchObject({
|
|
1738
|
+
unknownTop: true,
|
|
1739
|
+
editorStyles: {
|
|
1740
|
+
unknownStyle: { keep: true },
|
|
1741
|
+
minimalist: { unknownNested: "keep", showGit: true },
|
|
1742
|
+
},
|
|
1743
|
+
});
|
|
1744
|
+
expect(raw.components.editor.styles.minimalist).toMatchObject({
|
|
1745
|
+
pathDisplay: "full",
|
|
1746
|
+
contextFormat: "percent-total",
|
|
1747
|
+
showSessionName: false,
|
|
1748
|
+
showGit: false,
|
|
1749
|
+
});
|
|
1750
|
+
} finally {
|
|
1751
|
+
rmSync(dir, { recursive: true, force: true });
|
|
1752
|
+
}
|
|
1753
|
+
});
|
|
1754
|
+
|
|
1755
|
+
it("saves editor style without erasing sibling config", () => {
|
|
1756
|
+
const dir = mkdtempSync(join(tmpdir(), "zentui-config-"));
|
|
1757
|
+
const path = join(dir, "zentui.json");
|
|
1758
|
+
try {
|
|
1759
|
+
writeFileSync(path, JSON.stringify({ unknown: { keep: true }, editorModelLabel: "name" }));
|
|
1760
|
+
const minimalist = saveEditorStyle("minimalist", path);
|
|
1761
|
+
let raw = JSON.parse(readFileSync(path, "utf8"));
|
|
1762
|
+
expect(raw.unknown).toEqual({ keep: true });
|
|
1763
|
+
expect(raw.editorModelLabel).toBe("name");
|
|
1764
|
+
expect(raw.editorStyle).toBeUndefined();
|
|
1765
|
+
expect(raw.components.editor.style).toBe("minimalist");
|
|
1766
|
+
expect(minimalist.editorStyle).toBe("minimalist");
|
|
1767
|
+
|
|
1768
|
+
const accentRail = saveEditorStyle("accent-rail", path);
|
|
1769
|
+
raw = JSON.parse(readFileSync(path, "utf8"));
|
|
1770
|
+
expect(accentRail.editorStyle).toBe("accent-rail");
|
|
1771
|
+
expect(raw.components.editor.style).toBe("accent-rail");
|
|
1772
|
+
expect(raw.components.editor.styles["accent-rail"]).toEqual({
|
|
1773
|
+
rail: "▎",
|
|
1774
|
+
asciiRail: "|",
|
|
1775
|
+
transparent: false,
|
|
1776
|
+
});
|
|
1777
|
+
|
|
1778
|
+
const polished = saveEditorStyle("opencode", path);
|
|
1779
|
+
raw = JSON.parse(readFileSync(path, "utf8"));
|
|
1780
|
+
expect(polished.editorStyle).toBe("opencode");
|
|
1781
|
+
expect(raw.unknown).toEqual({ keep: true });
|
|
1782
|
+
expect(raw.editorModelLabel).toBe("name");
|
|
1783
|
+
expect(raw.components.editor.style).toBe("opencode");
|
|
1784
|
+
} finally {
|
|
1785
|
+
rmSync(dir, { recursive: true, force: true });
|
|
1786
|
+
}
|
|
1787
|
+
});
|
|
1788
|
+
|
|
1789
|
+
it("defaults and normalizes editor border color mode", () => {
|
|
1790
|
+
expect(defaultConfig.editorBorderColorMode).toBe("adaptive");
|
|
1791
|
+
expect(mergeConfig({}).editorBorderColorMode).toBe("adaptive");
|
|
1792
|
+
expect(mergeConfig({ editorBorderColorMode: "static" }).editorBorderColorMode).toBe("static");
|
|
1793
|
+
expect(mergeConfig({ editorBorderColorMode: "adaptive" }).editorBorderColorMode).toBe(
|
|
1794
|
+
"adaptive",
|
|
1795
|
+
);
|
|
1796
|
+
for (const value of ["dynamic", "", 1, null, true]) {
|
|
1797
|
+
expect(mergeConfig({ editorBorderColorMode: value }).editorBorderColorMode).toBe("adaptive");
|
|
1798
|
+
}
|
|
1799
|
+
});
|
|
1800
|
+
|
|
1801
|
+
it("saves editor border color mode without erasing sibling config", () => {
|
|
1802
|
+
const dir = mkdtempSync(join(tmpdir(), "zentui-config-"));
|
|
1803
|
+
const path = join(dir, "zentui.json");
|
|
1804
|
+
try {
|
|
1805
|
+
writeFileSync(
|
|
1806
|
+
path,
|
|
1807
|
+
`${JSON.stringify({ unknown: { keep: true }, editorModelLabel: "name" }, null, 2)}\n`,
|
|
1808
|
+
);
|
|
1809
|
+
|
|
1810
|
+
const config = saveEditorBorderColorMode("adaptive", path);
|
|
1811
|
+
const raw = JSON.parse(readFileSync(path, "utf8"));
|
|
1812
|
+
expect(raw.unknown).toEqual({ keep: true });
|
|
1813
|
+
expect(raw.editorModelLabel).toBe("name");
|
|
1814
|
+
expect(raw.editorBorderColorMode).toBeUndefined();
|
|
1815
|
+
expect(raw.components.editor.borderColorMode).toBe("adaptive");
|
|
1816
|
+
expect(config.editorBorderColorMode).toBe("adaptive");
|
|
1817
|
+
expect(config.editorModelLabel).toBe("name");
|
|
1818
|
+
expect(configTempFiles(dir)).toEqual([]);
|
|
1819
|
+
} finally {
|
|
1820
|
+
rmSync(dir, { recursive: true, force: true });
|
|
1821
|
+
}
|
|
1822
|
+
});
|
|
1823
|
+
|
|
1824
|
+
it("defaults pathDisplay and accepts mode/depth overrides", () => {
|
|
1825
|
+
expect(mergeConfig({}).pathDisplay).toEqual({ mode: "basename", depth: 2 });
|
|
1826
|
+
expect(mergeConfig({ pathDisplay: { mode: "full" } }).pathDisplay).toEqual({
|
|
1827
|
+
mode: "full",
|
|
1828
|
+
depth: 2,
|
|
1829
|
+
});
|
|
1830
|
+
expect(mergeConfig({ pathDisplay: { mode: "full", depth: 3 } }).pathDisplay).toEqual({
|
|
1831
|
+
mode: "full",
|
|
1832
|
+
depth: 3,
|
|
1833
|
+
});
|
|
1834
|
+
expect(mergeConfig({ pathDisplay: { mode: "repository", depth: 2 } }).pathDisplay).toEqual({
|
|
1835
|
+
mode: "repository",
|
|
1836
|
+
depth: 2,
|
|
1837
|
+
});
|
|
1838
|
+
expect(
|
|
1839
|
+
mergeConfig({
|
|
1840
|
+
components: { footer: { styles: { starship: { pathDisplay: { mode: "repository" } } } } },
|
|
1841
|
+
}).components.footer.styles.starship.pathDisplay,
|
|
1842
|
+
).toEqual({ mode: "repository", depth: 2 }); expect(mergeConfig({ pathDisplay: { mode: "fish", depth: -3 } }).pathDisplay).toEqual({
|
|
1843
|
+
mode: "basename",
|
|
1844
|
+
depth: 2,
|
|
1845
|
+
});
|
|
1846
|
+
expect(mergeConfig({ pathDisplay: { depth: 12.8 } }).pathDisplay).toEqual({
|
|
1847
|
+
mode: "basename",
|
|
1848
|
+
depth: 5,
|
|
1849
|
+
});
|
|
1850
|
+
expect(mergeConfig({ pathDisplay: "full" }).pathDisplay).toEqual({
|
|
1851
|
+
mode: "basename",
|
|
1852
|
+
depth: 2,
|
|
1853
|
+
});
|
|
1854
|
+
expect(
|
|
1855
|
+
mergeConfig({ pathDisplay: { mode: "full", depth: Number.POSITIVE_INFINITY } }).pathDisplay,
|
|
1856
|
+
).toEqual({ mode: "full", depth: 2 });
|
|
1857
|
+
});
|
|
1858
|
+
|
|
1859
|
+
it("saves pathDisplay patches and keeps unknown keys", () => {
|
|
1860
|
+
const dir = mkdtempSync(join(tmpdir(), "zentui-config-"));
|
|
1861
|
+
const path = join(dir, "zentui.json");
|
|
1862
|
+
try {
|
|
1863
|
+
writeFileSync(
|
|
1864
|
+
path,
|
|
1865
|
+
`${JSON.stringify(
|
|
1866
|
+
{
|
|
1867
|
+
unknown: true,
|
|
1868
|
+
pathDisplay: {
|
|
1869
|
+
mode: "basename",
|
|
1870
|
+
depth: 3,
|
|
1871
|
+
futureKey: "future",
|
|
1872
|
+
},
|
|
1873
|
+
},
|
|
1874
|
+
null,
|
|
1875
|
+
2,
|
|
1876
|
+
)}
|
|
1877
|
+
`,
|
|
1878
|
+
);
|
|
1879
|
+
|
|
1880
|
+
const config = savePathDisplayPatch({ mode: "full" }, path);
|
|
1881
|
+
const raw = JSON.parse(readFileSync(path, "utf8"));
|
|
1882
|
+
|
|
1883
|
+
expect(config.pathDisplay).toEqual({ mode: "full", depth: 3 });
|
|
1884
|
+
expect(raw.unknown).toBe(true);
|
|
1885
|
+
expect(raw.pathDisplay).toEqual({
|
|
1886
|
+
mode: "basename",
|
|
1887
|
+
depth: 3,
|
|
1888
|
+
futureKey: "future",
|
|
1889
|
+
});
|
|
1890
|
+
expect(raw.components.footer.styles.starship.pathDisplay).toEqual({
|
|
1891
|
+
mode: "full",
|
|
1892
|
+
depth: 3,
|
|
1893
|
+
});
|
|
1894
|
+
|
|
1895
|
+
const depthConfig = savePathDisplayPatch({ depth: 1 }, path);
|
|
1896
|
+
expect(depthConfig.pathDisplay).toEqual({ mode: "full", depth: 1 });
|
|
1897
|
+
} finally {
|
|
1898
|
+
rmSync(dir, { recursive: true, force: true });
|
|
1899
|
+
}
|
|
1900
|
+
});
|
|
1901
|
+
|
|
1902
|
+
it("defaults git branch length to full and accepts positive integer values", () => {
|
|
1903
|
+
expect(mergeConfig({}).gitBranch).toEqual({ maxLength: "full" });
|
|
1904
|
+
expect(defaultConfig.gitBranch).toEqual({ maxLength: "full" });
|
|
1905
|
+
for (const maxLength of [1, 10, 17, 20, 30, 40, 50, 10_000]) {
|
|
1906
|
+
expect(mergeConfig({ gitBranch: { maxLength } }).gitBranch).toEqual({ maxLength });
|
|
1907
|
+
}
|
|
1908
|
+
expect(mergeConfig({ gitBranch: { maxLength: "full" } }).gitBranch).toEqual({
|
|
1909
|
+
maxLength: "full",
|
|
1910
|
+
});
|
|
1911
|
+
});
|
|
1912
|
+
|
|
1913
|
+
it("falls back to full for invalid git branch lengths", () => {
|
|
1914
|
+
for (const maxLength of [0, -1, 1.5, "10", "short", null, true]) {
|
|
1915
|
+
expect(mergeConfig({ gitBranch: { maxLength } }).gitBranch).toEqual({
|
|
1916
|
+
maxLength: "full",
|
|
1917
|
+
});
|
|
1918
|
+
}
|
|
1919
|
+
expect(mergeConfig({ gitBranch: 20 }).gitBranch).toEqual({ maxLength: "full" });
|
|
1920
|
+
});
|
|
1921
|
+
|
|
1922
|
+
it("saves git branch length without erasing unknown config", () => {
|
|
1923
|
+
const dir = mkdtempSync(join(tmpdir(), "zentui-config-"));
|
|
1924
|
+
const path = join(dir, "zentui.json");
|
|
1925
|
+
try {
|
|
1926
|
+
writeFileSync(
|
|
1927
|
+
path,
|
|
1928
|
+
`${JSON.stringify({ unknown: true, gitBranch: { maxLength: 17, future: true } }, null, 2)}\n`,
|
|
1929
|
+
);
|
|
1930
|
+
|
|
1931
|
+
const config = saveGitBranchPatch({ maxLength: 30 }, path);
|
|
1932
|
+
const raw = JSON.parse(readFileSync(path, "utf8"));
|
|
1933
|
+
expect(config.gitBranch).toEqual({ maxLength: 30 });
|
|
1934
|
+
expect(raw.unknown).toBe(true);
|
|
1935
|
+
expect(raw.gitBranch).toEqual({ maxLength: 17, future: true });
|
|
1936
|
+
expect(raw.components.footer.styles.starship.gitBranch).toEqual({ maxLength: 30 });
|
|
1937
|
+
} finally {
|
|
1938
|
+
rmSync(dir, { recursive: true, force: true });
|
|
1939
|
+
}
|
|
1940
|
+
});
|
|
1941
|
+
|
|
1942
|
+
it("defaults icon mode to ascii and accepts nerd/ascii", () => {
|
|
1943
|
+
expect(mergeConfig({}).icons.mode).toBe("ascii");
|
|
1944
|
+
expect(mergeConfig({ icons: { mode: "ascii" } }).icons.mode).toBe("ascii");
|
|
1945
|
+
expect(mergeConfig({ icons: { mode: "nerd" } }).icons.mode).toBe("nerd");
|
|
1946
|
+
expect(mergeConfig({ icons: { mode: "emoji" } }).icons.mode).toBe("ascii");
|
|
1947
|
+
expect(mergeConfig({ icons: { mode: "ascii" } }).icons.cwd).toBe("");
|
|
1948
|
+
expect(mergeConfig({ icons: { mode: "ascii", cwd: "DIR" } }).icons.cwd).toBe("DIR");
|
|
1949
|
+
});
|
|
1950
|
+
|
|
1951
|
+
it("accepts Starship colors and old color key aliases", () => {
|
|
1952
|
+
expect(mergeConfig({ colors: { gitBranch: "bold purple" } }).colors.gitBranch).toBe(
|
|
1953
|
+
"bold purple",
|
|
1954
|
+
);
|
|
1955
|
+
expect(mergeConfig({ colors: { packageVersion: "bold green" } }).colors.packageVersion).toBe(
|
|
1956
|
+
"bold green",
|
|
1957
|
+
);
|
|
1958
|
+
expect(mergeConfig({ colors: { gitCommit: "bold yellow" } }).colors.gitCommit).toBe(
|
|
1959
|
+
"bold yellow",
|
|
1960
|
+
);
|
|
1961
|
+
expect(mergeConfig({ colors: { gitMetricsAdded: "green" } }).colors.gitMetricsAdded).toBe(
|
|
1962
|
+
"green",
|
|
1963
|
+
);
|
|
1964
|
+
expect(mergeConfig({ colors: { gitMetricsDeleted: "red" } }).colors.gitMetricsDeleted).toBe(
|
|
1965
|
+
"red",
|
|
1966
|
+
);
|
|
1967
|
+
expect(mergeConfig({ colors: { git: "syntaxKeyword" } }).colors.gitBranch).toBe(
|
|
1968
|
+
"syntaxKeyword",
|
|
1969
|
+
);
|
|
1970
|
+
expect(mergeConfig({ colors: { extensionStatus: "warning" } }).colors.extensionStatus).toBe(
|
|
1971
|
+
"warning",
|
|
1972
|
+
);
|
|
1973
|
+
expect(mergeConfig({ colors: { extensionStatus: "neon" } }).colors.extensionStatus).toBe(
|
|
1974
|
+
defaultConfig.colors.extensionStatus,
|
|
1975
|
+
);
|
|
1976
|
+
});
|
|
1977
|
+
|
|
1978
|
+
it("accepts extension status placement and color mode config", () => {
|
|
1979
|
+
const config = mergeConfig({
|
|
1980
|
+
extensionStatuses: {
|
|
1981
|
+
defaultPlacement: "middle",
|
|
1982
|
+
placements: {
|
|
1983
|
+
alpha: "left",
|
|
1984
|
+
beta: "off",
|
|
1985
|
+
gamma: "right",
|
|
1986
|
+
},
|
|
1987
|
+
colorModes: {
|
|
1988
|
+
alpha: "original",
|
|
1989
|
+
beta: "zentui",
|
|
1990
|
+
},
|
|
1991
|
+
},
|
|
1992
|
+
});
|
|
1993
|
+
|
|
1994
|
+
expect(config.extensionStatuses).toEqual({
|
|
1995
|
+
defaultPlacement: "middle",
|
|
1996
|
+
placements: {
|
|
1997
|
+
alpha: "left",
|
|
1998
|
+
beta: "off",
|
|
1999
|
+
gamma: "right",
|
|
2000
|
+
},
|
|
2001
|
+
colorModes: {
|
|
2002
|
+
alpha: "original",
|
|
2003
|
+
beta: "zentui",
|
|
2004
|
+
},
|
|
2005
|
+
});
|
|
2006
|
+
});
|
|
2007
|
+
|
|
2008
|
+
it("normalizes invalid extension status placement config", () => {
|
|
2009
|
+
expect(
|
|
2010
|
+
mergeConfig({
|
|
2011
|
+
extensionStatuses: {
|
|
2012
|
+
defaultPlacement: "center",
|
|
2013
|
+
placements: {
|
|
2014
|
+
alpha: "left",
|
|
2015
|
+
beta: "center",
|
|
2016
|
+
gamma: 1,
|
|
2017
|
+
},
|
|
2018
|
+
colorModes: {
|
|
2019
|
+
alpha: "original",
|
|
2020
|
+
beta: "muted",
|
|
2021
|
+
gamma: 1,
|
|
2022
|
+
},
|
|
2023
|
+
},
|
|
2024
|
+
}).extensionStatuses,
|
|
2025
|
+
).toEqual({
|
|
2026
|
+
defaultPlacement: "right",
|
|
2027
|
+
placements: { alpha: "left" },
|
|
2028
|
+
colorModes: { alpha: "original" },
|
|
2029
|
+
});
|
|
2030
|
+
expect(mergeConfig({ extensionStatuses: { placements: "none" } }).extensionStatuses).toEqual({
|
|
2031
|
+
defaultPlacement: "right",
|
|
2032
|
+
placements: {},
|
|
2033
|
+
colorModes: {},
|
|
2034
|
+
});
|
|
2035
|
+
});
|
|
2036
|
+
|
|
2037
|
+
it("accepts optional editor and user-message chrome color overrides", () => {
|
|
2038
|
+
const config = mergeConfig({
|
|
2039
|
+
colors: {
|
|
2040
|
+
editorAccent: "bold purple",
|
|
2041
|
+
editorBorder: "#89b4fa",
|
|
2042
|
+
editorModel: "accent",
|
|
2043
|
+
editorProvider: "text",
|
|
2044
|
+
editorThinking: "muted",
|
|
2045
|
+
editorThinkingMinimal: "thinkingMinimal",
|
|
2046
|
+
editorThinkingLow: "thinkingLow",
|
|
2047
|
+
editorThinkingMedium: "thinkingMedium",
|
|
2048
|
+
editorThinkingHigh: "thinkingHigh",
|
|
2049
|
+
editorThinkingXhigh: "thinkingXhigh",
|
|
2050
|
+
editorThinkingMax: "thinkingMax",
|
|
2051
|
+
},
|
|
2052
|
+
});
|
|
2053
|
+
|
|
2054
|
+
expect(config.colors.editorAccent).toBe("bold purple");
|
|
2055
|
+
expect(config.colors.editorBorder).toBe("#89b4fa");
|
|
2056
|
+
expect(config.colors.editorModel).toBe("accent");
|
|
2057
|
+
expect(config.colors.editorProvider).toBe("text");
|
|
2058
|
+
expect(config.colors.editorThinking).toBe("muted");
|
|
2059
|
+
expect(config.colors.editorThinkingMinimal).toBe("thinkingMinimal");
|
|
2060
|
+
expect(config.colors.editorThinkingLow).toBe("thinkingLow");
|
|
2061
|
+
expect(config.colors.editorThinkingMedium).toBe("thinkingMedium");
|
|
2062
|
+
expect(config.colors.editorThinkingHigh).toBe("thinkingHigh");
|
|
2063
|
+
expect(config.colors.editorThinkingXhigh).toBe("thinkingXhigh");
|
|
2064
|
+
expect(config.colors.editorThinkingMax).toBe("thinkingMax");
|
|
2065
|
+
});
|
|
2066
|
+
|
|
2067
|
+
it("ignores invalid known values at runtime instead of trusting zentui.json", () => {
|
|
2068
|
+
const config = mergeConfig({
|
|
2069
|
+
projectRefreshIntervalMs: "fast",
|
|
2070
|
+
icons: {
|
|
2071
|
+
cwd: 42,
|
|
2072
|
+
git: "git",
|
|
2073
|
+
cacheHit: "CH",
|
|
2074
|
+
editorPrompt: ">",
|
|
2075
|
+
},
|
|
2076
|
+
colors: {
|
|
2077
|
+
cwd: 123,
|
|
2078
|
+
gitStatus: "not-a-color",
|
|
2079
|
+
separator: "dimmed",
|
|
2080
|
+
editorAccent: "neon",
|
|
2081
|
+
editorPrompt: "accent",
|
|
2082
|
+
editorBorder: "also-neon",
|
|
2083
|
+
editorThinkingHigh: "thinkingHigh",
|
|
2084
|
+
},
|
|
2085
|
+
colorSources: {
|
|
2086
|
+
starship: "neon",
|
|
2087
|
+
editor: "terminal",
|
|
2088
|
+
},
|
|
2089
|
+
});
|
|
2090
|
+
|
|
2091
|
+
expect(config.projectRefreshIntervalMs).toBe(defaultConfig.projectRefreshIntervalMs);
|
|
2092
|
+
expect(config.icons.cwd).toBe(defaultConfig.icons.cwd);
|
|
2093
|
+
expect(config.icons.git).toBe("git");
|
|
2094
|
+
expect(config.icons.cacheHit).toBe("CH");
|
|
2095
|
+
expect(config.icons.editorPrompt).toBe(">");
|
|
2096
|
+
expect(config.colors.cwd).toBe(defaultConfig.colors.cwd);
|
|
2097
|
+
expect(config.colors.gitStatus).toBe(defaultConfig.colors.gitStatus);
|
|
2098
|
+
expect(config.colors.separator).toBe("dimmed");
|
|
2099
|
+
expect(config.colors.editorAccent).toBeUndefined();
|
|
2100
|
+
expect(config.colors.editorPrompt).toBe("accent");
|
|
2101
|
+
expect(config.colors.editorBorder).toBeUndefined();
|
|
2102
|
+
expect(config.colors.editorThinkingHigh).toBe("thinkingHigh");
|
|
2103
|
+
expect(config.colorSources).toEqual({
|
|
2104
|
+
starship: "theme",
|
|
2105
|
+
editor: "terminal",
|
|
2106
|
+
userMessages: "theme",
|
|
2107
|
+
});
|
|
2108
|
+
});
|
|
2109
|
+
|
|
2110
|
+
it("accepts valid color source preferences and ignores invalid values", () => {
|
|
2111
|
+
expect(
|
|
2112
|
+
mergeConfig({ colorSources: { starship: "terminal", editor: "theme" } }).colorSources,
|
|
2113
|
+
).toEqual({ starship: "terminal", editor: "theme", userMessages: "theme" });
|
|
2114
|
+
expect(
|
|
2115
|
+
mergeConfig({ colorSources: { starship: "neon", userMessages: "terminal" } }).colorSources,
|
|
2116
|
+
).toEqual({ starship: "theme", editor: "theme", userMessages: "terminal" });
|
|
2117
|
+
});
|
|
2118
|
+
|
|
2119
|
+
it("accepts valid UI feature preferences and ignores invalid values", () => {
|
|
2120
|
+
expect(mergeConfig({ features: { editor: false } }).features).toEqual({
|
|
2121
|
+
editor: false,
|
|
2122
|
+
statusLine: false,
|
|
2123
|
+
viewportIndicators: false,
|
|
2124
|
+
});
|
|
2125
|
+
expect(
|
|
2126
|
+
mergeConfig({
|
|
2127
|
+
features: {
|
|
2128
|
+
editor: "off",
|
|
2129
|
+
statusLine: false,
|
|
2130
|
+
copyFriendly: true,
|
|
2131
|
+
viewportIndicators: false,
|
|
2132
|
+
},
|
|
2133
|
+
}).features,
|
|
2134
|
+
).toEqual({
|
|
2135
|
+
editor: false,
|
|
2136
|
+
statusLine: false,
|
|
2137
|
+
viewportIndicators: false,
|
|
2138
|
+
});
|
|
2139
|
+
expect(
|
|
2140
|
+
mergeConfig({ features: { copyFriendly: "on", viewportIndicators: "off" } }).features,
|
|
2141
|
+
).toEqual({ editor: false, statusLine: false, viewportIndicators: false });
|
|
2142
|
+
});
|
|
2143
|
+
|
|
2144
|
+
it("accepts valid footer segment preferences and ignores invalid values", () => {
|
|
2145
|
+
expect(
|
|
2146
|
+
mergeConfig({ footerSegments: { cwd: false, modelInfo: true, tokens: false } })
|
|
2147
|
+
.footerSegments,
|
|
2148
|
+
).toEqual({
|
|
2149
|
+
cwd: false,
|
|
2150
|
+
sessionName: true,
|
|
2151
|
+
gitBranch: true,
|
|
2152
|
+
gitStatus: true,
|
|
2153
|
+
runtime: true,
|
|
2154
|
+
modelInfo: true,
|
|
2155
|
+
context: true,
|
|
2156
|
+
gitCounts: false,
|
|
2157
|
+
sessionDuration: false,
|
|
2158
|
+
username: false,
|
|
2159
|
+
time: false,
|
|
2160
|
+
os: false,
|
|
2161
|
+
packageVersion: false,
|
|
2162
|
+
gitCommit: false,
|
|
2163
|
+
gitMetrics: true,
|
|
2164
|
+
tokens: false,
|
|
2165
|
+
cost: true,
|
|
2166
|
+
});
|
|
2167
|
+
expect(
|
|
2168
|
+
mergeConfig({
|
|
2169
|
+
footerSegments: { cost: "off", gitBranch: false, gitStatus: false, modelInfo: "on" },
|
|
2170
|
+
}).footerSegments,
|
|
2171
|
+
).toEqual({
|
|
2172
|
+
cwd: true,
|
|
2173
|
+
sessionName: true,
|
|
2174
|
+
gitBranch: false,
|
|
2175
|
+
gitStatus: false,
|
|
2176
|
+
runtime: true,
|
|
2177
|
+
modelInfo: false,
|
|
2178
|
+
context: true,
|
|
2179
|
+
gitCounts: false,
|
|
2180
|
+
sessionDuration: false,
|
|
2181
|
+
username: false,
|
|
2182
|
+
time: false,
|
|
2183
|
+
os: false,
|
|
2184
|
+
packageVersion: false,
|
|
2185
|
+
gitCommit: false,
|
|
2186
|
+
gitMetrics: true,
|
|
2187
|
+
tokens: true,
|
|
2188
|
+
cost: true,
|
|
2189
|
+
});
|
|
2190
|
+
});
|
|
2191
|
+
|
|
2192
|
+
it("normalizes session-name preferences", () => {
|
|
2193
|
+
expect(mergeConfig({ colors: { sessionName: "success" } }).colors.sessionName).toBe("success");
|
|
2194
|
+
expect(mergeConfig({ footerSegments: { sessionName: false } }).footerSegments.sessionName).toBe(
|
|
2195
|
+
false,
|
|
2196
|
+
);
|
|
2197
|
+
expect(mergeConfig({ colors: { sessionName: "not-a-color" } }).colors.sessionName).toBe(
|
|
2198
|
+
"bold green",
|
|
2199
|
+
);
|
|
2200
|
+
expect(mergeConfig({ footerSegments: { sessionName: "on" } }).footerSegments.sessionName).toBe(
|
|
2201
|
+
true,
|
|
2202
|
+
);
|
|
2203
|
+
});
|
|
2204
|
+
|
|
2205
|
+
it("saves color source patches without erasing unknown user config", () => {
|
|
2206
|
+
const dir = mkdtempSync(join(tmpdir(), "zentui-config-"));
|
|
2207
|
+
const path = join(dir, "zentui.json");
|
|
2208
|
+
try {
|
|
2209
|
+
writeFileSync(
|
|
2210
|
+
path,
|
|
2211
|
+
`${JSON.stringify(
|
|
2212
|
+
{
|
|
2213
|
+
unknown: true,
|
|
2214
|
+
icons: { git: "git" },
|
|
2215
|
+
colors: {
|
|
2216
|
+
futureKey: "future",
|
|
2217
|
+
cwd: "bold cyan",
|
|
2218
|
+
gitBranch: "syntaxKeyword",
|
|
2219
|
+
cost: "success",
|
|
2220
|
+
},
|
|
2221
|
+
colorSources: { editor: "terminal" },
|
|
2222
|
+
},
|
|
2223
|
+
null,
|
|
2224
|
+
2,
|
|
2225
|
+
)}\n`,
|
|
2226
|
+
);
|
|
2227
|
+
|
|
2228
|
+
const config = saveColorSourcesPatch({ starship: "terminal" }, path);
|
|
2229
|
+
const raw = JSON.parse(readFileSync(path, "utf8"));
|
|
2230
|
+
|
|
2231
|
+
expect(config.colorSources).toEqual({
|
|
2232
|
+
starship: "terminal",
|
|
2233
|
+
editor: "terminal",
|
|
2234
|
+
userMessages: "theme",
|
|
2235
|
+
});
|
|
2236
|
+
expect(raw.unknown).toBe(true);
|
|
2237
|
+
expect(raw.icons.git).toBe("git");
|
|
2238
|
+
expect(raw.colors.cwd).toBe("bold cyan");
|
|
2239
|
+
expect(raw.colors.futureKey).toBe("future");
|
|
2240
|
+
expect(raw.colors.gitBranch).toBe("syntaxKeyword");
|
|
2241
|
+
expect(raw.colors.cost).toBe("success");
|
|
2242
|
+
expect(raw.colorSources).toEqual({ editor: "terminal" });
|
|
2243
|
+
expect(raw.components.footer.colorSource).toBe("terminal");
|
|
2244
|
+
expect(raw.components.editor.colorSource).toBe("terminal");
|
|
2245
|
+
} finally {
|
|
2246
|
+
rmSync(dir, { recursive: true, force: true });
|
|
2247
|
+
}
|
|
2248
|
+
});
|
|
2249
|
+
|
|
2250
|
+
it("preserves invalid and unknown color source data on disk while normalizing runtime", () => {
|
|
2251
|
+
const dir = mkdtempSync(join(tmpdir(), "zentui-config-"));
|
|
2252
|
+
const path = join(dir, "zentui.json");
|
|
2253
|
+
try {
|
|
2254
|
+
writeFileSync(
|
|
2255
|
+
path,
|
|
2256
|
+
`${JSON.stringify(
|
|
2257
|
+
{
|
|
2258
|
+
colorSources: {
|
|
2259
|
+
starship: "neon",
|
|
2260
|
+
editor: "terminal",
|
|
2261
|
+
userMessages: "invalid",
|
|
2262
|
+
extra: "terminal",
|
|
2263
|
+
},
|
|
2264
|
+
},
|
|
2265
|
+
null,
|
|
2266
|
+
2,
|
|
2267
|
+
)}\n`,
|
|
2268
|
+
);
|
|
2269
|
+
|
|
2270
|
+
const config = saveColorSourcesPatch({ userMessages: "terminal" }, path);
|
|
2271
|
+
const raw = JSON.parse(readFileSync(path, "utf8"));
|
|
2272
|
+
|
|
2273
|
+
expect(config.colorSources).toEqual({
|
|
2274
|
+
starship: "theme",
|
|
2275
|
+
editor: "terminal",
|
|
2276
|
+
userMessages: "terminal",
|
|
2277
|
+
});
|
|
2278
|
+
expect(raw.colorSources).toEqual({
|
|
2279
|
+
starship: "neon",
|
|
2280
|
+
editor: "terminal",
|
|
2281
|
+
userMessages: "invalid",
|
|
2282
|
+
extra: "terminal",
|
|
2283
|
+
});
|
|
2284
|
+
expect(raw.components.userMessages.colorSource).toBe("terminal");
|
|
2285
|
+
} finally {
|
|
2286
|
+
rmSync(dir, { recursive: true, force: true });
|
|
2287
|
+
}
|
|
2288
|
+
});
|
|
2289
|
+
|
|
2290
|
+
it("writes only the requested settings when creating zentui.json", () => {
|
|
2291
|
+
const dir = mkdtempSync(join(tmpdir(), "zentui-config-"));
|
|
2292
|
+
const path = join(dir, "zentui.json");
|
|
2293
|
+
try {
|
|
2294
|
+
const config = saveColorSourcesPatch({ starship: "terminal" }, path);
|
|
2295
|
+
const raw = JSON.parse(readFileSync(path, "utf8"));
|
|
2296
|
+
|
|
2297
|
+
expect(config.colorSources).toEqual({
|
|
2298
|
+
starship: "terminal",
|
|
2299
|
+
editor: "theme",
|
|
2300
|
+
userMessages: "theme",
|
|
2301
|
+
});
|
|
2302
|
+
expect(Object.keys(raw)).toEqual(["components"]);
|
|
2303
|
+
expect(raw.components.footer.colorSource).toBe("terminal");
|
|
2304
|
+
expect(raw.components.editor.colorSource).toBe("theme");
|
|
2305
|
+
expect(raw.components.userMessages.colorSource).toBe("theme");
|
|
2306
|
+
} finally {
|
|
2307
|
+
rmSync(dir, { recursive: true, force: true });
|
|
2308
|
+
}
|
|
2309
|
+
});
|
|
2310
|
+
|
|
2311
|
+
it("saves UI feature patches without erasing unknown user config", () => {
|
|
2312
|
+
const dir = mkdtempSync(join(tmpdir(), "zentui-config-"));
|
|
2313
|
+
const path = join(dir, "zentui.json");
|
|
2314
|
+
try {
|
|
2315
|
+
writeFileSync(
|
|
2316
|
+
path,
|
|
2317
|
+
`${JSON.stringify(
|
|
2318
|
+
{
|
|
2319
|
+
unknown: true,
|
|
2320
|
+
features: {
|
|
2321
|
+
editor: true,
|
|
2322
|
+
futureKey: "future",
|
|
2323
|
+
},
|
|
2324
|
+
},
|
|
2325
|
+
null,
|
|
2326
|
+
2,
|
|
2327
|
+
)}\n`,
|
|
2328
|
+
);
|
|
2329
|
+
|
|
2330
|
+
const config = saveUiFeaturesPatch({ statusLine: false, viewportIndicators: false }, path);
|
|
2331
|
+
const raw = JSON.parse(readFileSync(path, "utf8"));
|
|
2332
|
+
|
|
2333
|
+
expect(config.features).toEqual({
|
|
2334
|
+
editor: true,
|
|
2335
|
+
statusLine: false,
|
|
2336
|
+
viewportIndicators: false,
|
|
2337
|
+
});
|
|
2338
|
+
expect(raw.unknown).toBe(true);
|
|
2339
|
+
expect(raw.features).toEqual({ editor: true, futureKey: "future" });
|
|
2340
|
+
expect(raw.components.editor.enabled).toBe(true);
|
|
2341
|
+
expect(raw.components.editor.viewportIndicators).toBe(false);
|
|
2342
|
+
expect(raw.components.footer.style).toBe("native");
|
|
2343
|
+
} finally {
|
|
2344
|
+
rmSync(dir, { recursive: true, force: true });
|
|
2345
|
+
}
|
|
2346
|
+
});
|
|
2347
|
+
|
|
2348
|
+
it("writes only the requested UI feature setting when creating zentui.json", () => {
|
|
2349
|
+
const dir = mkdtempSync(join(tmpdir(), "zentui-config-"));
|
|
2350
|
+
const path = join(dir, "zentui.json");
|
|
2351
|
+
try {
|
|
2352
|
+
const config = saveUiFeaturesPatch({ editor: false }, path);
|
|
2353
|
+
const raw = JSON.parse(readFileSync(path, "utf8"));
|
|
2354
|
+
|
|
2355
|
+
expect(config.features).toEqual({
|
|
2356
|
+
editor: false,
|
|
2357
|
+
statusLine: false,
|
|
2358
|
+
viewportIndicators: false,
|
|
2359
|
+
});
|
|
2360
|
+
expect(Object.keys(raw)).toEqual(["components"]);
|
|
2361
|
+
expect(raw.components.editor.enabled).toBe(false);
|
|
2362
|
+
expect(raw.components.userMessages.enabled).toBe(false);
|
|
2363
|
+
expect(raw.components.selectorBorders.enabled).toBe(false);
|
|
2364
|
+
} finally {
|
|
2365
|
+
rmSync(dir, { recursive: true, force: true });
|
|
2366
|
+
}
|
|
2367
|
+
});
|
|
2368
|
+
|
|
2369
|
+
it("saves footer segment patches without erasing unknown user config", () => {
|
|
2370
|
+
const dir = mkdtempSync(join(tmpdir(), "zentui-config-"));
|
|
2371
|
+
const path = join(dir, "zentui.json");
|
|
2372
|
+
try {
|
|
2373
|
+
writeFileSync(
|
|
2374
|
+
path,
|
|
2375
|
+
`${JSON.stringify(
|
|
2376
|
+
{
|
|
2377
|
+
unknown: true,
|
|
2378
|
+
footerSegments: {
|
|
2379
|
+
cwd: true,
|
|
2380
|
+
futureKey: "future",
|
|
2381
|
+
},
|
|
2382
|
+
},
|
|
2383
|
+
null,
|
|
2384
|
+
2,
|
|
2385
|
+
)}\n`,
|
|
2386
|
+
);
|
|
2387
|
+
|
|
2388
|
+
const config = saveFooterSegmentsPatch({ modelInfo: true, tokens: false, cost: false }, path);
|
|
2389
|
+
const raw = JSON.parse(readFileSync(path, "utf8"));
|
|
2390
|
+
|
|
2391
|
+
expect(config.footerSegments).toEqual({
|
|
2392
|
+
cwd: true,
|
|
2393
|
+
sessionName: true,
|
|
2394
|
+
gitBranch: true,
|
|
2395
|
+
gitStatus: true,
|
|
2396
|
+
runtime: true,
|
|
2397
|
+
modelInfo: true,
|
|
2398
|
+
context: true,
|
|
2399
|
+
gitCounts: false,
|
|
2400
|
+
sessionDuration: false,
|
|
2401
|
+
username: false,
|
|
2402
|
+
time: false,
|
|
2403
|
+
os: false,
|
|
2404
|
+
packageVersion: false,
|
|
2405
|
+
gitCommit: false,
|
|
2406
|
+
gitMetrics: true,
|
|
2407
|
+
tokens: false,
|
|
2408
|
+
cost: false,
|
|
2409
|
+
});
|
|
2410
|
+
expect(raw.unknown).toBe(true);
|
|
2411
|
+
expect(raw.footerSegments).toEqual({ cwd: true, futureKey: "future" });
|
|
2412
|
+
expect(raw.components.footer.styles.starship.segments).toMatchObject({
|
|
2413
|
+
cwd: true,
|
|
2414
|
+
modelInfo: true,
|
|
2415
|
+
tokens: false,
|
|
2416
|
+
cost: false,
|
|
2417
|
+
});
|
|
2418
|
+
expect(mergeConfig(raw).footerSegments.modelInfo).toBe(true);
|
|
2419
|
+
|
|
2420
|
+
const disabled = saveFooterSegmentsPatch({ modelInfo: false }, path);
|
|
2421
|
+
const disabledRaw = JSON.parse(readFileSync(path, "utf8"));
|
|
2422
|
+
expect(disabled.footerSegments.modelInfo).toBe(false);
|
|
2423
|
+
expect(mergeConfig(disabledRaw).footerSegments.modelInfo).toBe(false);
|
|
2424
|
+
expect(disabledRaw.unknown).toBe(true);
|
|
2425
|
+
expect(disabledRaw.footerSegments).toEqual({ cwd: true, futureKey: "future" });
|
|
2426
|
+
expect(disabledRaw.components.footer.styles.starship.segments).toMatchObject({
|
|
2427
|
+
modelInfo: false,
|
|
2428
|
+
tokens: false,
|
|
2429
|
+
cost: false,
|
|
2430
|
+
});
|
|
2431
|
+
} finally {
|
|
2432
|
+
rmSync(dir, { recursive: true, force: true });
|
|
2433
|
+
}
|
|
2434
|
+
});
|
|
2435
|
+
|
|
2436
|
+
it("writes only the requested footer segment setting when creating zentui.json", () => {
|
|
2437
|
+
const dir = mkdtempSync(join(tmpdir(), "zentui-config-"));
|
|
2438
|
+
const path = join(dir, "zentui.json");
|
|
2439
|
+
try {
|
|
2440
|
+
const config = saveFooterSegmentsPatch({ runtime: false }, path);
|
|
2441
|
+
const raw = JSON.parse(readFileSync(path, "utf8"));
|
|
2442
|
+
|
|
2443
|
+
expect(config.footerSegments).toEqual({
|
|
2444
|
+
cwd: true,
|
|
2445
|
+
sessionName: true,
|
|
2446
|
+
gitBranch: true,
|
|
2447
|
+
gitStatus: true,
|
|
2448
|
+
runtime: false,
|
|
2449
|
+
modelInfo: false,
|
|
2450
|
+
context: true,
|
|
2451
|
+
gitCounts: false,
|
|
2452
|
+
sessionDuration: false,
|
|
2453
|
+
username: false,
|
|
2454
|
+
time: false,
|
|
2455
|
+
os: false,
|
|
2456
|
+
packageVersion: false,
|
|
2457
|
+
gitCommit: false,
|
|
2458
|
+
gitMetrics: true,
|
|
2459
|
+
tokens: true,
|
|
2460
|
+
cost: true,
|
|
2461
|
+
});
|
|
2462
|
+
expect(Object.keys(raw)).toEqual(["components"]);
|
|
2463
|
+
expect(raw.components.footer.styles.starship.segments.runtime).toBe(false);
|
|
2464
|
+
} finally {
|
|
2465
|
+
rmSync(dir, { recursive: true, force: true });
|
|
2466
|
+
}
|
|
2467
|
+
});
|
|
2468
|
+
|
|
2469
|
+
it("toggles and persists the packageVersion footer segment", () => {
|
|
2470
|
+
const dir = mkdtempSync(join(tmpdir(), "zentui-config-"));
|
|
2471
|
+
const path = join(dir, "zentui.json");
|
|
2472
|
+
try {
|
|
2473
|
+
const config = saveFooterSegmentsPatch({ packageVersion: true }, path);
|
|
2474
|
+
expect(config.footerSegments.packageVersion).toBe(true);
|
|
2475
|
+
|
|
2476
|
+
const raw = JSON.parse(readFileSync(path, "utf8"));
|
|
2477
|
+
expect(raw.components.footer.styles.starship.segments.packageVersion).toBe(true);
|
|
2478
|
+
|
|
2479
|
+
const reloaded = mergeConfig(raw);
|
|
2480
|
+
expect(reloaded.footerSegments.packageVersion).toBe(true);
|
|
2481
|
+
} finally {
|
|
2482
|
+
rmSync(dir, { recursive: true, force: true });
|
|
2483
|
+
}
|
|
2484
|
+
});
|
|
2485
|
+
|
|
2486
|
+
it("toggles and persists gitCommit and gitMetrics footer segments", () => {
|
|
2487
|
+
const dir = mkdtempSync(join(tmpdir(), "zentui-config-"));
|
|
2488
|
+
const path = join(dir, "zentui.json");
|
|
2489
|
+
try {
|
|
2490
|
+
const config = saveFooterSegmentsPatch({ gitCommit: true, gitMetrics: true }, path);
|
|
2491
|
+
expect(config.footerSegments.gitCommit).toBe(true);
|
|
2492
|
+
expect(config.footerSegments.gitMetrics).toBe(true);
|
|
2493
|
+
|
|
2494
|
+
const raw = JSON.parse(readFileSync(path, "utf8"));
|
|
2495
|
+
expect(raw.components.footer.styles.starship.segments).toMatchObject({
|
|
2496
|
+
gitCommit: true,
|
|
2497
|
+
gitMetrics: true,
|
|
2498
|
+
});
|
|
2499
|
+
|
|
2500
|
+
const reloaded = mergeConfig(raw);
|
|
2501
|
+
expect(reloaded.footerSegments.gitCommit).toBe(true);
|
|
2502
|
+
expect(reloaded.footerSegments.gitMetrics).toBe(true);
|
|
2503
|
+
} finally {
|
|
2504
|
+
rmSync(dir, { recursive: true, force: true });
|
|
2505
|
+
}
|
|
2506
|
+
});
|
|
2507
|
+
|
|
2508
|
+
it("gitCommit config defaults and normalizes hashLength", () => {
|
|
2509
|
+
expect(defaultConfig.gitCommit).toEqual({ hashLength: 7, onlyDetached: true, showTag: true });
|
|
2510
|
+
expect(mergeConfig({ gitCommit: { hashLength: 3 } }).gitCommit.hashLength).toBe(4);
|
|
2511
|
+
expect(mergeConfig({ gitCommit: { hashLength: 100 } }).gitCommit.hashLength).toBe(40);
|
|
2512
|
+
expect(mergeConfig({ gitCommit: { hashLength: 10 } }).gitCommit.hashLength).toBe(10);
|
|
2513
|
+
expect(mergeConfig({ gitCommit: { onlyDetached: false } }).gitCommit.onlyDetached).toBe(false);
|
|
2514
|
+
expect(mergeConfig({ gitCommit: { showTag: false } }).gitCommit.showTag).toBe(false);
|
|
2515
|
+
// Missing fields fall back to defaults.
|
|
2516
|
+
expect(mergeConfig({ gitCommit: {} }).gitCommit).toEqual({
|
|
2517
|
+
hashLength: 7,
|
|
2518
|
+
onlyDetached: true,
|
|
2519
|
+
showTag: true,
|
|
2520
|
+
});
|
|
2521
|
+
});
|
|
2522
|
+
|
|
2523
|
+
it("gitMetrics config defaults", () => {
|
|
2524
|
+
expect(defaultConfig.gitMetrics).toEqual({ onlyNonzero: true, ignoreSubmodules: false });
|
|
2525
|
+
expect(mergeConfig({ gitMetrics: { onlyNonzero: false } }).gitMetrics.onlyNonzero).toBe(false);
|
|
2526
|
+
expect(
|
|
2527
|
+
mergeConfig({ gitMetrics: { ignoreSubmodules: true } }).gitMetrics.ignoreSubmodules,
|
|
2528
|
+
).toBe(true);
|
|
2529
|
+
});
|
|
2530
|
+
|
|
2531
|
+
it("writes and reads back footerFormat", () => {
|
|
2532
|
+
const dir = mkdtempSync(join(tmpdir(), "zentui-config-"));
|
|
2533
|
+
const path = join(dir, "zentui.json");
|
|
2534
|
+
try {
|
|
2535
|
+
const config = saveFooterFormatPatch("$cwd on $git_branch $fill $cost", path);
|
|
2536
|
+
const raw = JSON.parse(readFileSync(path, "utf8"));
|
|
2537
|
+
|
|
2538
|
+
expect(config.footerFormat).toBe("$cwd on $git_branch $fill $cost");
|
|
2539
|
+
expect(Object.keys(raw)).toEqual(["components"]);
|
|
2540
|
+
expect(raw.components.footer.styles.starship.format).toBe("$cwd on $git_branch $fill $cost");
|
|
2541
|
+
} finally {
|
|
2542
|
+
rmSync(dir, { recursive: true, force: true });
|
|
2543
|
+
}
|
|
2544
|
+
});
|
|
2545
|
+
|
|
2546
|
+
it("clears footerFormat when saving empty string", () => {
|
|
2547
|
+
const dir = mkdtempSync(join(tmpdir(), "zentui-config-"));
|
|
2548
|
+
const path = join(dir, "zentui.json");
|
|
2549
|
+
try {
|
|
2550
|
+
const config = saveFooterFormatPatch("", path);
|
|
2551
|
+
expect(config.footerFormat).toBe("");
|
|
2552
|
+
} finally {
|
|
2553
|
+
rmSync(dir, { recursive: true, force: true });
|
|
2554
|
+
}
|
|
2555
|
+
});
|
|
2556
|
+
|
|
2557
|
+
it("saves extension status placement when creating zentui.json", () => {
|
|
2558
|
+
const dir = mkdtempSync(join(tmpdir(), "zentui-config-"));
|
|
2559
|
+
const path = join(dir, "zentui.json");
|
|
2560
|
+
try {
|
|
2561
|
+
const config = saveExtensionStatusPlacement("plugin.key", "middle", path);
|
|
2562
|
+
const raw = JSON.parse(readFileSync(path, "utf8"));
|
|
2563
|
+
|
|
2564
|
+
expect(config.extensionStatuses.placements).toEqual({ "plugin.key": "middle" });
|
|
2565
|
+
expect(Object.keys(raw)).toEqual(["components"]);
|
|
2566
|
+
expect(raw.components.footer.styles.starship.extensionStatuses.placements).toEqual({
|
|
2567
|
+
"plugin.key": "middle",
|
|
2568
|
+
});
|
|
2569
|
+
} finally {
|
|
2570
|
+
rmSync(dir, { recursive: true, force: true });
|
|
2571
|
+
}
|
|
2572
|
+
});
|
|
2573
|
+
|
|
2574
|
+
it("saves extension status color mode when creating zentui.json", () => {
|
|
2575
|
+
const dir = mkdtempSync(join(tmpdir(), "zentui-config-"));
|
|
2576
|
+
const path = join(dir, "zentui.json");
|
|
2577
|
+
try {
|
|
2578
|
+
const config = saveExtensionStatusColorMode("plugin.key", "original", path);
|
|
2579
|
+
const raw = JSON.parse(readFileSync(path, "utf8"));
|
|
2580
|
+
|
|
2581
|
+
expect(config.extensionStatuses.colorModes).toEqual({ "plugin.key": "original" });
|
|
2582
|
+
expect(Object.keys(raw)).toEqual(["components"]);
|
|
2583
|
+
expect(raw.components.footer.styles.starship.extensionStatuses.colorModes).toEqual({
|
|
2584
|
+
"plugin.key": "original",
|
|
2585
|
+
});
|
|
2586
|
+
} finally {
|
|
2587
|
+
rmSync(dir, { recursive: true, force: true });
|
|
2588
|
+
}
|
|
2589
|
+
});
|
|
2590
|
+
|
|
2591
|
+
it("saves extension status color mode without erasing placement config", () => {
|
|
2592
|
+
const dir = mkdtempSync(join(tmpdir(), "zentui-config-"));
|
|
2593
|
+
const path = join(dir, "zentui.json");
|
|
2594
|
+
try {
|
|
2595
|
+
writeFileSync(
|
|
2596
|
+
path,
|
|
2597
|
+
`${JSON.stringify(
|
|
2598
|
+
{
|
|
2599
|
+
unknown: true,
|
|
2600
|
+
colors: { futureKey: "future" },
|
|
2601
|
+
extensionStatuses: {
|
|
2602
|
+
defaultPlacement: "left",
|
|
2603
|
+
futureKey: "future",
|
|
2604
|
+
placements: {
|
|
2605
|
+
alpha: "right",
|
|
2606
|
+
invalid: "center",
|
|
2607
|
+
},
|
|
2608
|
+
colorModes: {
|
|
2609
|
+
alpha: "zentui",
|
|
2610
|
+
invalid: "muted",
|
|
2611
|
+
},
|
|
2612
|
+
},
|
|
2613
|
+
},
|
|
2614
|
+
null,
|
|
2615
|
+
2,
|
|
2616
|
+
)}\n`,
|
|
2617
|
+
);
|
|
2618
|
+
|
|
2619
|
+
const config = saveExtensionStatusColorMode("beta", "original", path);
|
|
2620
|
+
const raw = JSON.parse(readFileSync(path, "utf8"));
|
|
2621
|
+
|
|
2622
|
+
expect(config.extensionStatuses).toEqual({
|
|
2623
|
+
defaultPlacement: "left",
|
|
2624
|
+
placements: { alpha: "right" },
|
|
2625
|
+
colorModes: { alpha: "zentui", beta: "original" },
|
|
2626
|
+
});
|
|
2627
|
+
expect(raw.unknown).toBe(true);
|
|
2628
|
+
expect(raw.colors.futureKey).toBe("future");
|
|
2629
|
+
expect(raw.extensionStatuses.futureKey).toBe("future");
|
|
2630
|
+
expect(raw.extensionStatuses.placements).toEqual({
|
|
2631
|
+
alpha: "right",
|
|
2632
|
+
invalid: "center",
|
|
2633
|
+
});
|
|
2634
|
+
expect(raw.extensionStatuses.colorModes).toEqual({
|
|
2635
|
+
alpha: "zentui",
|
|
2636
|
+
invalid: "muted",
|
|
2637
|
+
});
|
|
2638
|
+
expect(raw.components.footer.styles.starship.extensionStatuses.colorModes).toEqual({
|
|
2639
|
+
alpha: "zentui",
|
|
2640
|
+
beta: "original",
|
|
2641
|
+
});
|
|
2642
|
+
} finally {
|
|
2643
|
+
rmSync(dir, { recursive: true, force: true });
|
|
2644
|
+
}
|
|
2645
|
+
});
|
|
2646
|
+
|
|
2647
|
+
it("saves extension status placement without erasing unknown user config", () => {
|
|
2648
|
+
const dir = mkdtempSync(join(tmpdir(), "zentui-config-"));
|
|
2649
|
+
const path = join(dir, "zentui.json");
|
|
2650
|
+
try {
|
|
2651
|
+
writeFileSync(
|
|
2652
|
+
path,
|
|
2653
|
+
`${JSON.stringify(
|
|
2654
|
+
{
|
|
2655
|
+
unknown: true,
|
|
2656
|
+
colors: { futureKey: "future" },
|
|
2657
|
+
extensionStatuses: {
|
|
2658
|
+
defaultPlacement: "left",
|
|
2659
|
+
futureKey: "future",
|
|
2660
|
+
placements: {
|
|
2661
|
+
alpha: "right",
|
|
2662
|
+
invalid: "center",
|
|
2663
|
+
},
|
|
2664
|
+
},
|
|
2665
|
+
},
|
|
2666
|
+
null,
|
|
2667
|
+
2,
|
|
2668
|
+
)}\n`,
|
|
2669
|
+
);
|
|
2670
|
+
|
|
2671
|
+
const config = saveExtensionStatusPlacement("beta", "off", path);
|
|
2672
|
+
const raw = JSON.parse(readFileSync(path, "utf8"));
|
|
2673
|
+
|
|
2674
|
+
expect(config.extensionStatuses).toEqual({
|
|
2675
|
+
defaultPlacement: "left",
|
|
2676
|
+
placements: { alpha: "right", beta: "off" },
|
|
2677
|
+
colorModes: {},
|
|
2678
|
+
});
|
|
2679
|
+
expect(raw.unknown).toBe(true);
|
|
2680
|
+
expect(raw.colors.futureKey).toBe("future");
|
|
2681
|
+
expect(raw.extensionStatuses.futureKey).toBe("future");
|
|
2682
|
+
expect(raw.extensionStatuses.placements).toEqual({
|
|
2683
|
+
alpha: "right",
|
|
2684
|
+
invalid: "center",
|
|
2685
|
+
});
|
|
2686
|
+
expect(raw.components.footer.styles.starship.extensionStatuses.placements).toEqual({
|
|
2687
|
+
alpha: "right",
|
|
2688
|
+
beta: "off",
|
|
2689
|
+
});
|
|
2690
|
+
} finally {
|
|
2691
|
+
rmSync(dir, { recursive: true, force: true });
|
|
2692
|
+
}
|
|
2693
|
+
});
|
|
2694
|
+
});
|
|
2695
|
+
|
|
2696
|
+
describe("renderTerminalStyle", () => {
|
|
2697
|
+
it("renders Starship bold green with terminal palette ANSI codes", () => {
|
|
2698
|
+
expect(renderTerminalStyle("bold green", " v22.0.0")).toBe("\u001b[1;32m v22.0.0\u001b[0m");
|
|
2699
|
+
});
|
|
2700
|
+
|
|
2701
|
+
it("supports 256-color, fg/bg aliases, dimmed, and Starship hex styles", () => {
|
|
2702
|
+
expect(renderTerminalStyle("bold 149", "C")).toBe("\u001b[1;38;5;149mC\u001b[0m");
|
|
2703
|
+
expect(renderTerminalStyle("bold fg:202", "Haxe")).toBe("\u001b[1;38;5;202mHaxe\u001b[0m");
|
|
2704
|
+
expect(renderTerminalStyle("red dimmed", "Java")).toBe("\u001b[31;2mJava\u001b[0m");
|
|
2705
|
+
expect(renderTerminalStyle("bg:blue fg:bright-green", "ok")).toBe("\u001b[44;92mok\u001b[0m");
|
|
2706
|
+
expect(renderTerminalStyle("bold #FFAFF3", "Gleam")).toBe(
|
|
2707
|
+
"\u001b[1;38;2;255;175;243mGleam\u001b[0m",
|
|
2708
|
+
);
|
|
2709
|
+
});
|
|
2710
|
+
});
|
|
2711
|
+
|
|
2712
|
+
describe("style rendering", () => {
|
|
2713
|
+
const theme = {
|
|
2714
|
+
fg(token: string, text: string) {
|
|
2715
|
+
return `<${token}>${text}</${token}>`;
|
|
2716
|
+
},
|
|
2717
|
+
};
|
|
2718
|
+
|
|
2719
|
+
it("uses theme tokens when provided to colorize", () => {
|
|
2720
|
+
expect(colorize(theme, "accent", "hello")).toBe("<accent>hello</accent>");
|
|
2721
|
+
});
|
|
2722
|
+
|
|
2723
|
+
it("falls back to plain text for invalid theme tokens", () => {
|
|
2724
|
+
const throwingTheme = {
|
|
2725
|
+
fg(token: string, text: string) {
|
|
2726
|
+
if (token === "text") return `<text>${text}</text>`;
|
|
2727
|
+
throw new Error(`Unknown color: ${token}`);
|
|
2728
|
+
},
|
|
2729
|
+
};
|
|
2730
|
+
|
|
2731
|
+
expect(colorize(throwingTheme, "doesNotExist", "hello")).toBe("hello");
|
|
2732
|
+
expect(renderStyle(throwingTheme, "doesNotExist", "hello")).toBe("hello");
|
|
2733
|
+
expect(renderStyleForSource(throwingTheme, "theme", "doesNotExist", "hello")).toBe("hello");
|
|
2734
|
+
});
|
|
2735
|
+
|
|
2736
|
+
it("maps Starship modifiers to safe theme colors when the theme rejects unknown tokens", () => {
|
|
2737
|
+
const strictTheme = {
|
|
2738
|
+
fg(token: string, text: string) {
|
|
2739
|
+
if (!["muted", "syntaxKeyword", "text"].includes(token)) {
|
|
2740
|
+
throw new Error(`Unknown theme color: ${token}`);
|
|
2741
|
+
}
|
|
2742
|
+
return `<${token}>${text}</${token}>`;
|
|
2743
|
+
},
|
|
2744
|
+
bold(text: string) {
|
|
2745
|
+
return `<bold>${text}</bold>`;
|
|
2746
|
+
},
|
|
2747
|
+
};
|
|
2748
|
+
|
|
2749
|
+
expect(renderStyleForSource(strictTheme, "theme", "dimmed", "tokens")).toBe(
|
|
2750
|
+
"<muted>tokens</muted>",
|
|
2751
|
+
);
|
|
2752
|
+
expect(renderStyleForSource(strictTheme, "theme", "bold purple", "git")).toBe(
|
|
2753
|
+
"<syntaxKeyword><bold>git</bold></syntaxKeyword>",
|
|
2754
|
+
);
|
|
2755
|
+
expect(renderStyleForSource(strictTheme, "theme", "unknownColor", "text")).toBe("text");
|
|
2756
|
+
});
|
|
2757
|
+
|
|
2758
|
+
it("supports hex colors", () => {
|
|
2759
|
+
expect(colorize(theme, "#89b4fa", "hello")).toBe("\u001b[38;2;137;180;250mhello\u001b[39m");
|
|
2760
|
+
});
|
|
2761
|
+
|
|
2762
|
+
it("supports short #rgb hex colors by expanding to rrggbb", () => {
|
|
2763
|
+
expect(colorize(theme, "#89b", "hello")).toBe("\u001b[38;2;136;153;187mhello\u001b[39m");
|
|
2764
|
+
expect(renderTerminalStyle("bold #89b", "x")).toBe("\u001b[1;38;2;136;153;187mx\u001b[0m");
|
|
2765
|
+
});
|
|
2766
|
+
|
|
2767
|
+
it("renders Starship styles before falling back to theme tokens", () => {
|
|
2768
|
+
expect(renderStyle(theme, "bold purple", "git")).toBe("\u001b[1;35mgit\u001b[0m");
|
|
2769
|
+
expect(renderStyle(theme, "syntaxKeyword", "git")).toBe("<syntaxKeyword>git</syntaxKeyword>");
|
|
2770
|
+
});
|
|
2771
|
+
|
|
2772
|
+
it("renders theme-source Starship colors through Pi theme tokens", () => {
|
|
2773
|
+
expect(renderStyleForSource(theme, "theme", "bold cyan", "cwd")).toBe(
|
|
2774
|
+
"<syntaxFunction>cwd</syntaxFunction>",
|
|
2775
|
+
);
|
|
2776
|
+
expect(renderStyleForSource(theme, "theme", "bold purple", "git")).toBe(
|
|
2777
|
+
"<syntaxKeyword>git</syntaxKeyword>",
|
|
2778
|
+
);
|
|
2779
|
+
expect(renderStyleForSource(theme, "theme", "bold red", "!")).toBe("<error>!</error>");
|
|
2780
|
+
expect(renderStyleForSource(theme, "theme", "dimmed", "tokens")).toBe("<muted>tokens</muted>");
|
|
2781
|
+
expect(renderStyleForSource(theme, "theme", "bold green", "cost")).toBe(
|
|
2782
|
+
"<success>cost</success>",
|
|
2783
|
+
);
|
|
2784
|
+
expect(renderStyleForSource(theme, "theme", "syntaxKeyword", "git")).toBe(
|
|
2785
|
+
"<syntaxKeyword>git</syntaxKeyword>",
|
|
2786
|
+
);
|
|
2787
|
+
});
|
|
2788
|
+
|
|
2789
|
+
it("keeps explicit terminal styles available for terminal source", () => {
|
|
2790
|
+
expect(renderStyleForSource(theme, "terminal", "bold purple", "git")).toBe(
|
|
2791
|
+
"\u001b[1;35mgit\u001b[0m",
|
|
2792
|
+
);
|
|
2793
|
+
expect(renderStyleForSource(theme, "theme", "fg:202", "git")).toBe(
|
|
2794
|
+
"\u001b[38;5;202mgit\u001b[0m",
|
|
2795
|
+
);
|
|
2796
|
+
});
|
|
2797
|
+
|
|
2798
|
+
it("renders theme borders with borderMuted and terminal borders with bright black", () => {
|
|
2799
|
+
const thinkingTheme = {
|
|
2800
|
+
fg(token: string, text: string) {
|
|
2801
|
+
return `<${token}>${text}</${token}>`;
|
|
2802
|
+
},
|
|
2803
|
+
};
|
|
2804
|
+
|
|
2805
|
+
expect(renderChromeBorder(thinkingTheme, "theme", "bright-black", "────")).toBe(
|
|
2806
|
+
"<borderMuted>────</borderMuted>",
|
|
2807
|
+
);
|
|
2808
|
+
expect(renderChromeBorder(thinkingTheme, "terminal", "bright-black", "────")).toBe(
|
|
2809
|
+
"\u001b[90m────\u001b[0m",
|
|
2810
|
+
);
|
|
2811
|
+
});
|
|
2812
|
+
});
|
|
2813
|
+
|
|
2814
|
+
describe("bounded settings persistence", () => {
|
|
2815
|
+
function withConfig(initial: Record<string, unknown>, assertions: (path: string) => void): void {
|
|
2816
|
+
const dir = mkdtempSync(join(tmpdir(), "zentui-bounded-config-"));
|
|
2817
|
+
const path = join(dir, "zentui.json");
|
|
2818
|
+
try {
|
|
2819
|
+
writeFileSync(path, `${JSON.stringify(initial, null, 2)}\n`);
|
|
2820
|
+
assertions(path);
|
|
2821
|
+
} finally {
|
|
2822
|
+
rmSync(dir, { recursive: true, force: true });
|
|
2823
|
+
}
|
|
2824
|
+
}
|
|
2825
|
+
|
|
2826
|
+
it("saves editorModelLabel while preserving unrelated root config", () => {
|
|
2827
|
+
withConfig({ editorModelLabel: "id", unknown: { keep: true } }, (path) => {
|
|
2828
|
+
const config = saveEditorModelLabel("name", path);
|
|
2829
|
+
const raw = JSON.parse(readFileSync(path, "utf8"));
|
|
2830
|
+
expect(config.editorModelLabel).toBe("name");
|
|
2831
|
+
expect(raw.editorModelLabel).toBe("id");
|
|
2832
|
+
expect(raw.unknown).toEqual({ keep: true });
|
|
2833
|
+
expect(raw.components.editor.modelLabel).toBe("name");
|
|
2834
|
+
expect(raw.components.footer.modelLabel).toBe("name");
|
|
2835
|
+
});
|
|
2836
|
+
});
|
|
2837
|
+
|
|
2838
|
+
it("saves git commit booleans while preserving hashLength and unknown siblings", () => {
|
|
2839
|
+
withConfig(
|
|
2840
|
+
{
|
|
2841
|
+
unknown: true,
|
|
2842
|
+
gitCommit: { hashLength: 12, onlyDetached: true, showTag: true, future: "keep" },
|
|
2843
|
+
},
|
|
2844
|
+
(path) => {
|
|
2845
|
+
const config = saveGitCommitPatch({ onlyDetached: false, showTag: false }, path);
|
|
2846
|
+
const raw = JSON.parse(readFileSync(path, "utf8"));
|
|
2847
|
+
expect(config.gitCommit).toEqual({ hashLength: 12, onlyDetached: false, showTag: false });
|
|
2848
|
+
expect(raw.gitCommit).toEqual({
|
|
2849
|
+
hashLength: 12,
|
|
2850
|
+
onlyDetached: true,
|
|
2851
|
+
showTag: true,
|
|
2852
|
+
future: "keep",
|
|
2853
|
+
});
|
|
2854
|
+
expect(raw.components.footer.styles.starship.gitCommit).toEqual({
|
|
2855
|
+
hashLength: 12,
|
|
2856
|
+
onlyDetached: false,
|
|
2857
|
+
showTag: false,
|
|
2858
|
+
});
|
|
2859
|
+
expect(raw.unknown).toBe(true);
|
|
2860
|
+
},
|
|
2861
|
+
);
|
|
2862
|
+
});
|
|
2863
|
+
|
|
2864
|
+
it("saves git metrics booleans while preserving unknown siblings", () => {
|
|
2865
|
+
withConfig(
|
|
2866
|
+
{ unknown: true, gitMetrics: { onlyNonzero: true, ignoreSubmodules: false, future: 1 } },
|
|
2867
|
+
(path) => {
|
|
2868
|
+
const config = saveGitMetricsPatch({ onlyNonzero: false, ignoreSubmodules: true }, path);
|
|
2869
|
+
const raw = JSON.parse(readFileSync(path, "utf8"));
|
|
2870
|
+
expect(config.gitMetrics).toEqual({ onlyNonzero: false, ignoreSubmodules: true });
|
|
2871
|
+
expect(raw.gitMetrics).toEqual({
|
|
2872
|
+
onlyNonzero: true,
|
|
2873
|
+
ignoreSubmodules: false,
|
|
2874
|
+
future: 1,
|
|
2875
|
+
});
|
|
2876
|
+
expect(raw.components.footer.styles.starship.gitMetrics).toEqual({
|
|
2877
|
+
onlyNonzero: false,
|
|
2878
|
+
ignoreSubmodules: true,
|
|
2879
|
+
});
|
|
2880
|
+
expect(raw.unknown).toBe(true);
|
|
2881
|
+
},
|
|
2882
|
+
);
|
|
2883
|
+
});
|
|
2884
|
+
|
|
2885
|
+
it("saves default extension placement while preserving keyed and unknown config", () => {
|
|
2886
|
+
withConfig(
|
|
2887
|
+
{
|
|
2888
|
+
unknown: true,
|
|
2889
|
+
extensionStatuses: {
|
|
2890
|
+
defaultPlacement: "right",
|
|
2891
|
+
placements: { alpha: "left" },
|
|
2892
|
+
colorModes: { alpha: "original" },
|
|
2893
|
+
future: "keep",
|
|
2894
|
+
},
|
|
2895
|
+
},
|
|
2896
|
+
(path) => {
|
|
2897
|
+
const config = saveExtensionStatusDefaultPlacement("middle", path);
|
|
2898
|
+
const raw = JSON.parse(readFileSync(path, "utf8"));
|
|
2899
|
+
expect(config.extensionStatuses).toEqual({
|
|
2900
|
+
defaultPlacement: "middle",
|
|
2901
|
+
placements: { alpha: "left" },
|
|
2902
|
+
colorModes: { alpha: "original" },
|
|
2903
|
+
});
|
|
2904
|
+
expect(raw.extensionStatuses.future).toBe("keep");
|
|
2905
|
+
expect(raw.extensionStatuses.placements).toEqual({ alpha: "left" });
|
|
2906
|
+
expect(raw.extensionStatuses.colorModes).toEqual({ alpha: "original" });
|
|
2907
|
+
expect(raw.components.footer.styles.starship.extensionStatuses.defaultPlacement).toBe(
|
|
2908
|
+
"middle",
|
|
2909
|
+
);
|
|
2910
|
+
expect(raw.unknown).toBe(true);
|
|
2911
|
+
},
|
|
2912
|
+
);
|
|
2913
|
+
});
|
|
2914
|
+
});
|
|
2915
|
+
|
|
2916
|
+
describe("startup and file safety", () => {
|
|
2917
|
+
it("does not create, rewrite, or materialize config at startup", () => {
|
|
2918
|
+
withConfig(undefined, (path) => {
|
|
2919
|
+
ensureConfigExists(path);
|
|
2920
|
+
expect(existsSync(path)).toBe(false);
|
|
2921
|
+
});
|
|
2922
|
+
withConfig({ features: { editor: false }, unknown: true }, (path) => {
|
|
2923
|
+
const before = readFileSync(path, "utf8");
|
|
2924
|
+
ensureConfigExists(path);
|
|
2925
|
+
expect(readFileSync(path, "utf8")).toBe(before);
|
|
2926
|
+
expect(readRaw(path)).not.toHaveProperty("components");
|
|
2927
|
+
});
|
|
2928
|
+
});
|
|
2929
|
+
|
|
2930
|
+
it("refuses corrupt config without changing bytes or leaving a temporary file", () => {
|
|
2931
|
+
withConfig(undefined, (path, dir) => {
|
|
2932
|
+
const original = "{ invalid json\n";
|
|
2933
|
+
writeFileSync(path, original);
|
|
2934
|
+
expect(() => saveSeparatorPatch("dot", path)).toThrow(
|
|
2935
|
+
/Refusing to save Zentui config.*corrupt/,
|
|
2936
|
+
);
|
|
2937
|
+
expect(readFileSync(path, "utf8")).toBe(original);
|
|
2938
|
+
expect(configTempFiles(dir)).toEqual([]);
|
|
2939
|
+
});
|
|
2940
|
+
});
|
|
2941
|
+
|
|
2942
|
+
it("creates a missing config atomically and returns the re-merged file", () => {
|
|
2943
|
+
withConfig(undefined, (path, dir) => {
|
|
2944
|
+
const config = saveFooterFormatPatch("$cwd", path);
|
|
2945
|
+
const raw = readRaw(path);
|
|
2946
|
+
expect(raw.components.footer.styles.starship.format).toBe("$cwd");
|
|
2947
|
+
expect(raw).not.toHaveProperty("fixedEditor");
|
|
2948
|
+
expect(raw).not.toHaveProperty("layout.fixedEditor");
|
|
2949
|
+
expect(config).toEqual(mergeConfig(raw));
|
|
2950
|
+
expect(configTempFiles(dir)).toEqual([]);
|
|
2951
|
+
});
|
|
2952
|
+
});
|
|
2953
|
+
|
|
2954
|
+
it("preserves destination mode during atomic replacement", () => {
|
|
2955
|
+
withConfig({ separator: "pipe" }, (path, dir) => {
|
|
2956
|
+
chmodSync(path, 0o600);
|
|
2957
|
+
saveSeparatorPatch("dot", path);
|
|
2958
|
+
expect(statSync(path).mode & 0o777).toBe(0o600);
|
|
2959
|
+
expect(readRaw(path).components.footer.styles.starship.separator).toBe("dot");
|
|
2960
|
+
expect(configTempFiles(dir)).toEqual([]);
|
|
2961
|
+
});
|
|
2962
|
+
});
|
|
2963
|
+
|
|
2964
|
+
it("updates a symlink target atomically without replacing the symlink", () => {
|
|
2965
|
+
const dir = mkdtempSync(join(tmpdir(), "zentui-symlink-config-"));
|
|
2966
|
+
const targetDir = join(dir, "target");
|
|
2967
|
+
const targetPath = join(targetDir, "actual.json");
|
|
2968
|
+
const linkPath = join(dir, "zentui.json");
|
|
2969
|
+
try {
|
|
2970
|
+
mkdirSync(targetDir);
|
|
2971
|
+
writeFileSync(targetPath, `${JSON.stringify({ unknown: true }, null, 2)}\n`);
|
|
2972
|
+
chmodSync(targetPath, 0o600);
|
|
2973
|
+
symlinkSync(targetPath, linkPath);
|
|
2974
|
+
const originalLink = readlinkSync(linkPath);
|
|
2975
|
+
const config = saveSeparatorPatch("chevron", linkPath);
|
|
2976
|
+
const raw = readRaw(targetPath);
|
|
2977
|
+
expect(lstatSync(linkPath).isSymbolicLink()).toBe(true);
|
|
2978
|
+
expect(readlinkSync(linkPath)).toBe(originalLink);
|
|
2979
|
+
expect(raw.unknown).toBe(true);
|
|
2980
|
+
expect(raw.components.footer.styles.starship.separator).toBe("chevron");
|
|
2981
|
+
expect(config).toEqual(mergeConfig(raw));
|
|
2982
|
+
expect(statSync(targetPath).mode & 0o777).toBe(0o600);
|
|
2983
|
+
expect(configTempFiles(targetDir, "actual.json")).toEqual([]);
|
|
2984
|
+
expect(configTempFiles(dir)).toEqual([]);
|
|
2985
|
+
} finally {
|
|
2986
|
+
rmSync(dir, { recursive: true, force: true });
|
|
2987
|
+
}
|
|
2988
|
+
});
|
|
2989
|
+
|
|
2990
|
+
it("refuses a dangling symlink without changing it", () => {
|
|
2991
|
+
const dir = mkdtempSync(join(tmpdir(), "zentui-dangling-config-"));
|
|
2992
|
+
const targetDir = join(dir, "target");
|
|
2993
|
+
const missingTarget = join(targetDir, "missing.json");
|
|
2994
|
+
const linkPath = join(dir, "zentui.json");
|
|
2995
|
+
try {
|
|
2996
|
+
mkdirSync(targetDir);
|
|
2997
|
+
symlinkSync(missingTarget, linkPath);
|
|
2998
|
+
const originalLink = readlinkSync(linkPath);
|
|
2999
|
+
expect(() => saveSeparatorPatch("dot", linkPath)).toThrow(/Refusing to save Zentui config/);
|
|
3000
|
+
expect(lstatSync(linkPath).isSymbolicLink()).toBe(true);
|
|
3001
|
+
expect(readlinkSync(linkPath)).toBe(originalLink);
|
|
3002
|
+
expect(existsSync(missingTarget)).toBe(false);
|
|
3003
|
+
expect(configTempFiles(targetDir, "missing.json")).toEqual([]);
|
|
3004
|
+
expect(configTempFiles(dir)).toEqual([]);
|
|
3005
|
+
} finally {
|
|
3006
|
+
rmSync(dir, { recursive: true, force: true });
|
|
3007
|
+
}
|
|
3008
|
+
});
|
|
3009
|
+
|
|
3010
|
+
it("keeps the destination and leaves no temp file when serialization input is invalid", () => {
|
|
3011
|
+
withConfig({ unknown: true }, (path, dir) => {
|
|
3012
|
+
const original = readFileSync(path, "utf8");
|
|
3013
|
+
expect(() => saveContextThresholdsPatch({ warning: 1n as never }, path)).toThrow();
|
|
3014
|
+
expect(readFileSync(path, "utf8")).toBe(original);
|
|
3015
|
+
expect(configTempFiles(dir)).toEqual([]);
|
|
3016
|
+
});
|
|
3017
|
+
});
|
|
3018
|
+
});
|
|
3019
|
+
|
|
3020
|
+
describe("Opencode and Footer follow-up migration", () => {
|
|
3021
|
+
it("resolves canonical and alias editor metadata in documented precedence", () => {
|
|
3022
|
+
const config = mergeConfig({
|
|
3023
|
+
editorMetadataFormat: "$flat",
|
|
3024
|
+
components: {
|
|
3025
|
+
editor: {
|
|
3026
|
+
styles: {
|
|
3027
|
+
opencode: { metadataFormat: "$canonical" },
|
|
3028
|
+
polished: { metadataFormat: "$alias" },
|
|
3029
|
+
"polished-copy-friendly": { metadataFormat: "$alias-copy" },
|
|
3030
|
+
},
|
|
3031
|
+
},
|
|
3032
|
+
},
|
|
3033
|
+
});
|
|
3034
|
+
expect(config.components.editor.styles.opencode.metadataFormat).toBe("$canonical");
|
|
3035
|
+
expect(config.components.editor.styles["opencode-copy-friendly"].metadataFormat).toBe(
|
|
3036
|
+
"$alias-copy",
|
|
3037
|
+
);
|
|
3038
|
+
expect(
|
|
3039
|
+
mergeConfig({
|
|
3040
|
+
editorMetadataFormat: "$flat",
|
|
3041
|
+
components: { editor: { styles: { polished: { metadataFormat: "$alias" } } } },
|
|
3042
|
+
}).components.editor.styles.opencode.metadataFormat,
|
|
3043
|
+
).toBe("$alias");
|
|
3044
|
+
});
|
|
3045
|
+
|
|
3046
|
+
it("resolves Footer style from valid style, enabled, released statusLine, then default", () => {
|
|
3047
|
+
expect(
|
|
3048
|
+
mergeConfig({
|
|
3049
|
+
features: { statusLine: false },
|
|
3050
|
+
components: { footer: { style: "hidden", enabled: true } },
|
|
3051
|
+
}).components.footer.style,
|
|
3052
|
+
).toBe("hidden");
|
|
3053
|
+
expect(
|
|
3054
|
+
mergeConfig({
|
|
3055
|
+
features: { statusLine: true },
|
|
3056
|
+
components: { footer: { style: "future", enabled: false } },
|
|
3057
|
+
}).components.footer.style,
|
|
3058
|
+
).toBe("native");
|
|
3059
|
+
expect(mergeConfig({ features: { statusLine: false } }).components.footer.style).toBe("native");
|
|
3060
|
+
expect(mergeConfig({}).components.footer.style).toBe("native");
|
|
3061
|
+
expect(mergeConfig({ components: { footer: { style: "hidden" } } }).features.statusLine).toBe(
|
|
3062
|
+
false,
|
|
3063
|
+
);
|
|
3064
|
+
});
|
|
3065
|
+
|
|
3066
|
+
it("saves Footer styles canonically and removes only obsolete enabled", () => {
|
|
3067
|
+
withConfig(
|
|
3068
|
+
{
|
|
3069
|
+
features: { statusLine: true, future: "keep" },
|
|
3070
|
+
components: {
|
|
3071
|
+
footer: {
|
|
3072
|
+
enabled: true,
|
|
3073
|
+
future: "keep",
|
|
3074
|
+
styles: { starship: { format: "$cwd", future: "keep" }, future: { keep: true } },
|
|
3075
|
+
},
|
|
3076
|
+
},
|
|
3077
|
+
},
|
|
3078
|
+
(path) => {
|
|
3079
|
+
saveFooterComponentPatch({ style: "hidden" }, path);
|
|
3080
|
+
const raw = readRaw(path);
|
|
3081
|
+
expect(raw.components.footer.style).toBe("hidden");
|
|
3082
|
+
expect(raw.components.footer).not.toHaveProperty("enabled");
|
|
3083
|
+
expect(raw.components.footer.future).toBe("keep");
|
|
3084
|
+
expect(raw.components.footer.styles.starship).toMatchObject({
|
|
3085
|
+
format: "$cwd",
|
|
3086
|
+
future: "keep",
|
|
3087
|
+
});
|
|
3088
|
+
expect(raw.components.footer.styles.future).toEqual({ keep: true });
|
|
3089
|
+
expect(raw.features).toEqual({ statusLine: true, future: "keep" });
|
|
3090
|
+
},
|
|
3091
|
+
);
|
|
3092
|
+
});
|
|
3093
|
+
|
|
3094
|
+
it("keeps saveUiFeaturesPatch as a Starship/Native compatibility API", () => {
|
|
3095
|
+
withConfig({ components: { footer: { style: "hidden" } } }, (path) => {
|
|
3096
|
+
expect(saveUiFeaturesPatch({ statusLine: true }, path).components.footer.style).toBe(
|
|
3097
|
+
"starship",
|
|
3098
|
+
);
|
|
3099
|
+
expect(saveUiFeaturesPatch({ statusLine: false }, path).components.footer.style).toBe(
|
|
3100
|
+
"native",
|
|
3101
|
+
);
|
|
3102
|
+
});
|
|
3103
|
+
});
|
|
3104
|
+
|
|
3105
|
+
it("ignores inherited extension-status overrides and validates runtime mutations", () => {
|
|
3106
|
+
const config = structuredClone(defaultConfig);
|
|
3107
|
+
const statuses = config.components.footer.styles.starship.extensionStatuses;
|
|
3108
|
+
statuses.placements = Object.create({ constructor: "left" }) as Record<
|
|
3109
|
+
string,
|
|
3110
|
+
(typeof statuses.placements)[string]
|
|
3111
|
+
>;
|
|
3112
|
+
statuses.colorModes = Object.create({ constructor: "original" }) as Record<
|
|
3113
|
+
string,
|
|
3114
|
+
(typeof statuses.colorModes)[string]
|
|
3115
|
+
>;
|
|
3116
|
+
expect(getExtensionStatusPlacement(config, "constructor")).toBe("right");
|
|
3117
|
+
expect(getExtensionStatusColorMode(config, "constructor")).toBe("zentui");
|
|
3118
|
+
|
|
3119
|
+
Object.defineProperty(statuses.placements, "constructor", {
|
|
3120
|
+
value: "left",
|
|
3121
|
+
enumerable: true,
|
|
3122
|
+
configurable: true,
|
|
3123
|
+
});
|
|
3124
|
+
Object.defineProperty(statuses.colorModes, "constructor", {
|
|
3125
|
+
value: "original",
|
|
3126
|
+
enumerable: true,
|
|
3127
|
+
configurable: true,
|
|
3128
|
+
});
|
|
3129
|
+
expect(getExtensionStatusPlacement(config, "constructor")).toBe("left");
|
|
3130
|
+
expect(getExtensionStatusColorMode(config, "constructor")).toBe("original");
|
|
3131
|
+
|
|
3132
|
+
(statuses as unknown as { defaultPlacement: string }).defaultPlacement = "center";
|
|
3133
|
+
(statuses.placements as unknown as Record<string, string>).alpha = "explode";
|
|
3134
|
+
(statuses.colorModes as unknown as Record<string, string>).alpha = "rainbow";
|
|
3135
|
+
expect(getExtensionStatusPlacement(config, "missing")).toBe("right");
|
|
3136
|
+
expect(getExtensionStatusPlacement(config, "alpha")).toBe("right");
|
|
3137
|
+
expect(getExtensionStatusColorMode(config, "alpha")).toBe("zentui");
|
|
3138
|
+
});
|
|
3139
|
+
|
|
3140
|
+
it("marks only explicit non-empty unknown canonical component styles", () => {
|
|
3141
|
+
const future = mergeConfig({
|
|
3142
|
+
components: {
|
|
3143
|
+
editor: { style: "future-editor" },
|
|
3144
|
+
userMessages: { style: "future-messages" },
|
|
3145
|
+
selectorBorders: { style: "future-selectors" },
|
|
3146
|
+
footer: { style: "future-footer" },
|
|
3147
|
+
},
|
|
3148
|
+
});
|
|
3149
|
+
for (const owner of ["editor", "userMessages", "selectorBorders", "footer"] as const) {
|
|
3150
|
+
expect(hasUnsupportedComponentStyle(future, owner)).toBe(true);
|
|
3151
|
+
}
|
|
3152
|
+
|
|
3153
|
+
for (const style of [undefined, "", " ", null, false, {}, []]) {
|
|
3154
|
+
const ordinary = mergeConfig({ components: { editor: { style } } });
|
|
3155
|
+
expect(hasUnsupportedComponentStyle(ordinary, "editor")).toBe(false);
|
|
3156
|
+
}
|
|
3157
|
+
expect(
|
|
3158
|
+
hasUnsupportedComponentStyle(
|
|
3159
|
+
mergeConfig({ components: { editor: { style: "polished" } } }),
|
|
3160
|
+
"editor",
|
|
3161
|
+
),
|
|
3162
|
+
).toBe(false);
|
|
3163
|
+
});
|
|
3164
|
+
|
|
3165
|
+
it.each([
|
|
3166
|
+
[true, "starship"],
|
|
3167
|
+
[false, "native"],
|
|
3168
|
+
] as const)(
|
|
3169
|
+
"makes compatibility statusLine=%s authoritative over unknown Footer state",
|
|
3170
|
+
(statusLine, expectedStyle) => {
|
|
3171
|
+
withConfig(
|
|
3172
|
+
{
|
|
3173
|
+
features: { statusLine: !statusLine, future: "keep" },
|
|
3174
|
+
components: {
|
|
3175
|
+
footer: {
|
|
3176
|
+
style: "future-footer",
|
|
3177
|
+
enabled: true,
|
|
3178
|
+
future: "keep",
|
|
3179
|
+
styles: {
|
|
3180
|
+
starship: { format: "$cwd" },
|
|
3181
|
+
future: { keep: true },
|
|
3182
|
+
},
|
|
3183
|
+
},
|
|
3184
|
+
},
|
|
3185
|
+
},
|
|
3186
|
+
(path) => {
|
|
3187
|
+
const config = saveUiFeaturesPatch({ statusLine }, path);
|
|
3188
|
+
const raw = readRaw(path);
|
|
3189
|
+
expect(config.components.footer.style).toBe(expectedStyle);
|
|
3190
|
+
expect(raw.components.footer.style).toBe(expectedStyle);
|
|
3191
|
+
expect(raw.components.footer).not.toHaveProperty("enabled");
|
|
3192
|
+
expect(raw.components.footer.future).toBe("keep");
|
|
3193
|
+
expect(raw.components.footer.styles.future).toEqual({ keep: true });
|
|
3194
|
+
expect(raw.features).toEqual({ statusLine: !statusLine, future: "keep" });
|
|
3195
|
+
},
|
|
3196
|
+
);
|
|
3197
|
+
},
|
|
3198
|
+
);
|
|
3199
|
+
});
|