@code-yeongyu/senpi 2026.8.3 → 2026.8.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +68 -0
- package/README.md +9 -0
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +1 -0
- package/dist/cli/args.js.map +1 -1
- package/dist/client/remote-session.d.ts +2 -2
- package/dist/client/transcript.d.ts +1 -1
- package/dist/core/agent-session.d.ts +6 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +174 -39
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/deterministic-fallback.d.ts +2 -1
- package/dist/core/extensions/builtin/compaction/deterministic-fallback.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/deterministic-fallback.js +126 -26
- package/dist/core/extensions/builtin/compaction/deterministic-fallback.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/index.js +12 -7
- package/dist/core/extensions/builtin/compaction/index.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/per-turn-cap.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/per-turn-cap.js +4 -1
- package/dist/core/extensions/builtin/compaction/per-turn-cap.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/retained-message-safety.d.ts +4 -0
- package/dist/core/extensions/builtin/compaction/retained-message-safety.d.ts.map +1 -0
- package/dist/core/extensions/builtin/compaction/retained-message-safety.js +155 -0
- package/dist/core/extensions/builtin/compaction/retained-message-safety.js.map +1 -0
- package/dist/core/extensions/builtin/compaction/speculative.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/speculative.js +21 -13
- package/dist/core/extensions/builtin/compaction/speculative.js.map +1 -1
- package/dist/core/extensions/builtin/goal/cache-warm-renderer.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/cache-warm-renderer.js +9 -14
- package/dist/core/extensions/builtin/goal/cache-warm-renderer.js.map +1 -1
- package/dist/core/extensions/builtin/goal/continuation-recovery.d.ts +1 -0
- package/dist/core/extensions/builtin/goal/continuation-recovery.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/continuation-recovery.js +7 -0
- package/dist/core/extensions/builtin/goal/continuation-recovery.js.map +1 -1
- package/dist/core/extensions/builtin/goal/continuation.d.ts +2 -1
- package/dist/core/extensions/builtin/goal/continuation.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/continuation.js +2 -1
- package/dist/core/extensions/builtin/goal/continuation.js.map +1 -1
- package/dist/core/extensions/builtin/goal/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/index.js +26 -11
- package/dist/core/extensions/builtin/goal/index.js.map +1 -1
- package/dist/core/extensions/builtin/goal/lifecycle-helpers.d.ts +7 -1
- package/dist/core/extensions/builtin/goal/lifecycle-helpers.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/lifecycle-helpers.js +14 -2
- package/dist/core/extensions/builtin/goal/lifecycle-helpers.js.map +1 -1
- package/dist/core/extensions/builtin/goal/monitor-continuation.d.ts +3 -2
- package/dist/core/extensions/builtin/goal/monitor-continuation.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/monitor-continuation.js +89 -46
- package/dist/core/extensions/builtin/goal/monitor-continuation.js.map +1 -1
- package/dist/core/extensions/builtin/goal/wait-progress.d.ts +11 -0
- package/dist/core/extensions/builtin/goal/wait-progress.d.ts.map +1 -0
- package/dist/core/extensions/builtin/goal/wait-progress.js +30 -0
- package/dist/core/extensions/builtin/goal/wait-progress.js.map +1 -0
- package/dist/core/extensions/builtin/goal/wait-ticker.d.ts +38 -0
- package/dist/core/extensions/builtin/goal/wait-ticker.d.ts.map +1 -0
- package/dist/core/extensions/builtin/goal/wait-ticker.js +71 -0
- package/dist/core/extensions/builtin/goal/wait-ticker.js.map +1 -0
- package/dist/core/extensions/builtin/gpt-apply-patch/extension.d.ts.map +1 -1
- package/dist/core/extensions/builtin/gpt-apply-patch/extension.js +14 -1
- package/dist/core/extensions/builtin/gpt-apply-patch/extension.js.map +1 -1
- package/dist/core/extensions/builtin/gpt-apply-patch/types.d.ts +1 -0
- package/dist/core/extensions/builtin/gpt-apply-patch/types.d.ts.map +1 -1
- package/dist/core/extensions/builtin/gpt-apply-patch/types.js.map +1 -1
- package/dist/core/extensions/builtin/loop-guard/renderer.d.ts.map +1 -1
- package/dist/core/extensions/builtin/loop-guard/renderer.js +4 -12
- package/dist/core/extensions/builtin/loop-guard/renderer.js.map +1 -1
- package/dist/core/extensions/builtin/rule-activation/index.d.ts +6 -0
- package/dist/core/extensions/builtin/rule-activation/index.d.ts.map +1 -0
- package/dist/core/extensions/builtin/rule-activation/index.js +10 -0
- package/dist/core/extensions/builtin/rule-activation/index.js.map +1 -0
- package/dist/core/extensions/builtin/rule-activation/renderer.d.ts +3 -0
- package/dist/core/extensions/builtin/rule-activation/renderer.d.ts.map +1 -0
- package/dist/core/extensions/builtin/rule-activation/renderer.js +37 -0
- package/dist/core/extensions/builtin/rule-activation/renderer.js.map +1 -0
- package/dist/core/extensions/builtin/rule-activation/types.d.ts +15 -0
- package/dist/core/extensions/builtin/rule-activation/types.d.ts.map +1 -0
- package/dist/core/extensions/builtin/rule-activation/types.js +45 -0
- package/dist/core/extensions/builtin/rule-activation/types.js.map +1 -0
- package/dist/core/extensions/builtin/rules/config.d.ts +3 -0
- package/dist/core/extensions/builtin/rules/config.d.ts.map +1 -0
- package/dist/core/extensions/builtin/rules/config.js +24 -0
- package/dist/core/extensions/builtin/rules/config.js.map +1 -0
- package/dist/core/extensions/builtin/rules/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/rules/index.js +14 -4
- package/dist/core/extensions/builtin/rules/index.js.map +1 -1
- package/dist/core/extensions/builtin/rules/rules/formatter.d.ts.map +1 -1
- package/dist/core/extensions/builtin/rules/rules/formatter.js +21 -5
- package/dist/core/extensions/builtin/rules/rules/formatter.js.map +1 -1
- package/dist/core/extensions/builtin/rules/rules/types.d.ts +1 -1
- package/dist/core/extensions/builtin/rules/rules/types.js.map +1 -1
- package/dist/core/extensions/builtin/service-tier.d.ts.map +1 -1
- package/dist/core/extensions/builtin/service-tier.js +2 -3
- package/dist/core/extensions/builtin/service-tier.js.map +1 -1
- package/dist/core/extensions/builtin/ttsr/detectors/repetitive-turns.d.ts +22 -0
- package/dist/core/extensions/builtin/ttsr/detectors/repetitive-turns.d.ts.map +1 -0
- package/dist/core/extensions/builtin/ttsr/detectors/repetitive-turns.js +93 -0
- package/dist/core/extensions/builtin/ttsr/detectors/repetitive-turns.js.map +1 -0
- package/dist/core/extensions/builtin/ttsr/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/ttsr/index.js +60 -21
- package/dist/core/extensions/builtin/ttsr/index.js.map +1 -1
- package/dist/core/extensions/builtin/ttsr/prompts.d.ts +1 -0
- package/dist/core/extensions/builtin/ttsr/prompts.d.ts.map +1 -1
- package/dist/core/extensions/builtin/ttsr/prompts.js +5 -0
- package/dist/core/extensions/builtin/ttsr/prompts.js.map +1 -1
- package/dist/core/extensions/builtin/ttsr/repetitive-turns-lane.d.ts +23 -0
- package/dist/core/extensions/builtin/ttsr/repetitive-turns-lane.d.ts.map +1 -0
- package/dist/core/extensions/builtin/ttsr/repetitive-turns-lane.js +101 -0
- package/dist/core/extensions/builtin/ttsr/repetitive-turns-lane.js.map +1 -0
- package/dist/core/extensions/builtin/ttsr/stream-remediation.d.ts +15 -0
- package/dist/core/extensions/builtin/ttsr/stream-remediation.d.ts.map +1 -0
- package/dist/core/extensions/builtin/ttsr/stream-remediation.js +22 -0
- package/dist/core/extensions/builtin/ttsr/stream-remediation.js.map +1 -0
- package/dist/core/extensions/builtin/ttsr/types.d.ts +1 -1
- package/dist/core/extensions/builtin/ttsr/types.d.ts.map +1 -1
- package/dist/core/extensions/builtin/ttsr/types.js.map +1 -1
- package/dist/core/extensions/notice/adapters.d.ts +15 -0
- package/dist/core/extensions/notice/adapters.d.ts.map +1 -0
- package/dist/core/extensions/notice/adapters.js +22 -0
- package/dist/core/extensions/notice/adapters.js.map +1 -0
- package/dist/core/extensions/notice/box.d.ts +8 -0
- package/dist/core/extensions/notice/box.d.ts.map +1 -0
- package/dist/core/extensions/notice/box.js +17 -0
- package/dist/core/extensions/notice/box.js.map +1 -0
- package/dist/core/extensions/notice/index.d.ts +4 -0
- package/dist/core/extensions/notice/index.d.ts.map +1 -0
- package/dist/core/extensions/notice/index.js +3 -0
- package/dist/core/extensions/notice/index.js.map +1 -0
- package/dist/core/extensions/notice/spec.d.ts +23 -0
- package/dist/core/extensions/notice/spec.d.ts.map +1 -0
- package/dist/core/extensions/notice/spec.js +2 -0
- package/dist/core/extensions/notice/spec.js.map +1 -0
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +1 -0
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +2 -2
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/provider-composer.d.ts.map +1 -1
- package/dist/core/provider-composer.js +8 -3
- package/dist/core/provider-composer.js.map +1 -1
- package/dist/core/provider-display-names.d.ts.map +1 -1
- package/dist/core/provider-display-names.js +1 -0
- package/dist/core/provider-display-names.js.map +1 -1
- package/dist/core/retry-fallback/settings.d.ts.map +1 -1
- package/dist/core/retry-fallback/settings.js +16 -1
- package/dist/core/retry-fallback/settings.js.map +1 -1
- package/dist/core/retry-fallback/validate.d.ts.map +1 -1
- package/dist/core/retry-fallback/validate.js +15 -2
- package/dist/core/retry-fallback/validate.js.map +1 -1
- package/dist/core/session-log.js +1 -1
- package/dist/core/session-log.js.map +1 -1
- package/dist/core/settings-manager.d.ts +7 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +13 -0
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/modes/interactive/components/custom-editor.d.ts +5 -0
- package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-editor.js +22 -1
- package/dist/modes/interactive/components/custom-editor.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +2 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +42 -7
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/interactive-stderr-guard.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-stderr-guard.js +37 -0
- package/dist/modes/interactive/interactive-stderr-guard.js.map +1 -1
- package/docs/providers.md +19 -0
- package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +40 -0
- package/node_modules/@code-yeongyu/senpi-codemode/README.md +13 -3
- package/node_modules/@code-yeongyu/senpi-codemode/package.json +4 -4
- package/node_modules/@code-yeongyu/senpi-codemode/src/extension/eval-status.ts +1 -1
- package/node_modules/@code-yeongyu/senpi-codemode/src/prompt/eval-prompt.ts +6 -6
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/cell-runtime.ts +4 -4
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/detached-cell-manager.ts +2 -2
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/detached-cell-snapshot.ts +2 -2
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-request.ts +20 -2
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-tool.ts +17 -2
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/render.ts +18 -7
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/types.ts +19 -5
- package/node_modules/@earendil-works/pi-agent-core/package.json +2 -2
- package/node_modules/@earendil-works/pi-ai/README.md +3 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.js +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/all.d.ts +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/all.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/all.js +3 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/all.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/alibaba-token-plan.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/github-copilot.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/huggingface.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode-go.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/qwen-token-plan-cn.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/qwen-token-plan.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/together.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/ollama.d.ts +9 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/ollama.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/ollama.js +142 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/ollama.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/package.json +1 -1
- package/node_modules/@earendil-works/pi-pty/package.json +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.js +5 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/slash-command-autocomplete.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/slash-command-autocomplete.js +36 -8
- package/node_modules/@earendil-works/pi-tui/dist/slash-command-autocomplete.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts +2 -0
- package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui.js +49 -33
- package/node_modules/@earendil-works/pi-tui/dist/tui.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/package.json +1 -1
- package/package.json +8 -13
- package/{node_modules/@earendil-works/pi-client/dist → vendor/pi-client}/client.d.ts +1 -1
- package/{node_modules/@earendil-works/pi-client/dist → vendor/pi-client}/client.js +1 -1
- package/{node_modules/@earendil-works/pi-client/dist → vendor/pi-client}/connection.d.ts +1 -1
- package/{node_modules/@earendil-works/pi-client/dist → vendor/pi-client}/connection.js +1 -1
- package/{node_modules/@earendil-works/pi-client/dist → vendor/pi-client}/errors.d.ts +1 -1
- package/{node_modules/@earendil-works/pi-client/dist → vendor/pi-client}/session-handle.d.ts +1 -1
- package/{node_modules/@earendil-works/pi-client/dist → vendor/pi-client}/state.d.ts +1 -1
- package/{node_modules/@earendil-works/pi-client/dist → vendor/pi-client}/types.d.ts +1 -1
- package/{node_modules/@earendil-works/pi-client/dist → vendor/pi-client}/unix.js +1 -1
- package/node_modules/@earendil-works/pi-client/CHANGELOG.md +0 -7
- package/node_modules/@earendil-works/pi-client/README.md +0 -64
- package/node_modules/@earendil-works/pi-client/package.json +0 -56
- package/node_modules/@earendil-works/pi-protocol/README.md +0 -68
- package/node_modules/@earendil-works/pi-protocol/package.json +0 -48
- /package/{node_modules/@earendil-works/pi-client/dist → vendor/pi-client}/client.d.ts.map +0 -0
- /package/{node_modules/@earendil-works/pi-client/dist → vendor/pi-client}/client.js.map +0 -0
- /package/{node_modules/@earendil-works/pi-client/dist → vendor/pi-client}/connection.d.ts.map +0 -0
- /package/{node_modules/@earendil-works/pi-client/dist → vendor/pi-client}/connection.js.map +0 -0
- /package/{node_modules/@earendil-works/pi-client/dist → vendor/pi-client}/errors.d.ts.map +0 -0
- /package/{node_modules/@earendil-works/pi-client/dist → vendor/pi-client}/errors.js +0 -0
- /package/{node_modules/@earendil-works/pi-client/dist → vendor/pi-client}/errors.js.map +0 -0
- /package/{node_modules/@earendil-works/pi-client/dist → vendor/pi-client}/index.d.ts +0 -0
- /package/{node_modules/@earendil-works/pi-client/dist → vendor/pi-client}/index.d.ts.map +0 -0
- /package/{node_modules/@earendil-works/pi-client/dist → vendor/pi-client}/index.js +0 -0
- /package/{node_modules/@earendil-works/pi-client/dist → vendor/pi-client}/index.js.map +0 -0
- /package/{node_modules/@earendil-works/pi-client/dist → vendor/pi-client}/promise.d.ts +0 -0
- /package/{node_modules/@earendil-works/pi-client/dist → vendor/pi-client}/promise.d.ts.map +0 -0
- /package/{node_modules/@earendil-works/pi-client/dist → vendor/pi-client}/promise.js +0 -0
- /package/{node_modules/@earendil-works/pi-client/dist → vendor/pi-client}/promise.js.map +0 -0
- /package/{node_modules/@earendil-works/pi-client/dist → vendor/pi-client}/session-handle.d.ts.map +0 -0
- /package/{node_modules/@earendil-works/pi-client/dist → vendor/pi-client}/session-handle.js +0 -0
- /package/{node_modules/@earendil-works/pi-client/dist → vendor/pi-client}/session-handle.js.map +0 -0
- /package/{node_modules/@earendil-works/pi-client/dist → vendor/pi-client}/state.d.ts.map +0 -0
- /package/{node_modules/@earendil-works/pi-client/dist → vendor/pi-client}/state.js +0 -0
- /package/{node_modules/@earendil-works/pi-client/dist → vendor/pi-client}/state.js.map +0 -0
- /package/{node_modules/@earendil-works/pi-client/dist → vendor/pi-client}/transport.d.ts +0 -0
- /package/{node_modules/@earendil-works/pi-client/dist → vendor/pi-client}/transport.d.ts.map +0 -0
- /package/{node_modules/@earendil-works/pi-client/dist → vendor/pi-client}/transport.js +0 -0
- /package/{node_modules/@earendil-works/pi-client/dist → vendor/pi-client}/transport.js.map +0 -0
- /package/{node_modules/@earendil-works/pi-client/dist → vendor/pi-client}/types.d.ts.map +0 -0
- /package/{node_modules/@earendil-works/pi-client/dist → vendor/pi-client}/types.js +0 -0
- /package/{node_modules/@earendil-works/pi-client/dist → vendor/pi-client}/types.js.map +0 -0
- /package/{node_modules/@earendil-works/pi-client/dist → vendor/pi-client}/unix.d.ts +0 -0
- /package/{node_modules/@earendil-works/pi-client/dist → vendor/pi-client}/unix.d.ts.map +0 -0
- /package/{node_modules/@earendil-works/pi-client/dist → vendor/pi-client}/unix.js.map +0 -0
- /package/{node_modules/@earendil-works/pi-protocol/dist → vendor/pi-protocol}/cbor/decoder.d.ts +0 -0
- /package/{node_modules/@earendil-works/pi-protocol/dist → vendor/pi-protocol}/cbor/decoder.d.ts.map +0 -0
- /package/{node_modules/@earendil-works/pi-protocol/dist → vendor/pi-protocol}/cbor/decoder.js +0 -0
- /package/{node_modules/@earendil-works/pi-protocol/dist → vendor/pi-protocol}/cbor/decoder.js.map +0 -0
- /package/{node_modules/@earendil-works/pi-protocol/dist → vendor/pi-protocol}/cbor/encoder.d.ts +0 -0
- /package/{node_modules/@earendil-works/pi-protocol/dist → vendor/pi-protocol}/cbor/encoder.d.ts.map +0 -0
- /package/{node_modules/@earendil-works/pi-protocol/dist → vendor/pi-protocol}/cbor/encoder.js +0 -0
- /package/{node_modules/@earendil-works/pi-protocol/dist → vendor/pi-protocol}/cbor/encoder.js.map +0 -0
- /package/{node_modules/@earendil-works/pi-protocol/dist → vendor/pi-protocol}/cbor/index.d.ts +0 -0
- /package/{node_modules/@earendil-works/pi-protocol/dist → vendor/pi-protocol}/cbor/index.d.ts.map +0 -0
- /package/{node_modules/@earendil-works/pi-protocol/dist → vendor/pi-protocol}/cbor/index.js +0 -0
- /package/{node_modules/@earendil-works/pi-protocol/dist → vendor/pi-protocol}/cbor/index.js.map +0 -0
- /package/{node_modules/@earendil-works/pi-protocol/dist → vendor/pi-protocol}/cbor/options.d.ts +0 -0
- /package/{node_modules/@earendil-works/pi-protocol/dist → vendor/pi-protocol}/cbor/options.d.ts.map +0 -0
- /package/{node_modules/@earendil-works/pi-protocol/dist → vendor/pi-protocol}/cbor/options.js +0 -0
- /package/{node_modules/@earendil-works/pi-protocol/dist → vendor/pi-protocol}/cbor/options.js.map +0 -0
- /package/{node_modules/@earendil-works/pi-protocol/dist → vendor/pi-protocol}/codec.d.ts +0 -0
- /package/{node_modules/@earendil-works/pi-protocol/dist → vendor/pi-protocol}/codec.d.ts.map +0 -0
- /package/{node_modules/@earendil-works/pi-protocol/dist → vendor/pi-protocol}/codec.js +0 -0
- /package/{node_modules/@earendil-works/pi-protocol/dist → vendor/pi-protocol}/codec.js.map +0 -0
- /package/{node_modules/@earendil-works/pi-protocol/dist → vendor/pi-protocol}/framing.d.ts +0 -0
- /package/{node_modules/@earendil-works/pi-protocol/dist → vendor/pi-protocol}/framing.d.ts.map +0 -0
- /package/{node_modules/@earendil-works/pi-protocol/dist → vendor/pi-protocol}/framing.js +0 -0
- /package/{node_modules/@earendil-works/pi-protocol/dist → vendor/pi-protocol}/framing.js.map +0 -0
- /package/{node_modules/@earendil-works/pi-protocol/dist → vendor/pi-protocol}/index.d.ts +0 -0
- /package/{node_modules/@earendil-works/pi-protocol/dist → vendor/pi-protocol}/index.d.ts.map +0 -0
- /package/{node_modules/@earendil-works/pi-protocol/dist → vendor/pi-protocol}/index.js +0 -0
- /package/{node_modules/@earendil-works/pi-protocol/dist → vendor/pi-protocol}/index.js.map +0 -0
- /package/{node_modules/@earendil-works/pi-protocol/dist → vendor/pi-protocol}/schemas.d.ts +0 -0
- /package/{node_modules/@earendil-works/pi-protocol/dist → vendor/pi-protocol}/schemas.d.ts.map +0 -0
- /package/{node_modules/@earendil-works/pi-protocol/dist → vendor/pi-protocol}/schemas.js +0 -0
- /package/{node_modules/@earendil-works/pi-protocol/dist → vendor/pi-protocol}/schemas.js.map +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slash-command-autocomplete.d.ts","sourceRoot":"","sources":["../src/slash-command-autocomplete.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"slash-command-autocomplete.d.ts","sourceRoot":"","sources":["../src/slash-command-autocomplete.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AA+BxE,wBAAgB,0BAA0B,CACzC,QAAQ,EAAE,SAAS,CAAC,YAAY,GAAG,gBAAgB,CAAC,EAAE,EACtD,MAAM,EAAE,MAAM,GACZ,gBAAgB,EAAE,CAuDpB"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { fuzzyFilter } from "./fuzzy.js";
|
|
2
|
+
const SKILL_COMMAND_PREFIX = "skill:";
|
|
2
3
|
function compareSlashCommandSuggestion(prefix, left, right) {
|
|
3
4
|
const leftExact = left.value === prefix;
|
|
4
5
|
const rightExact = right.value === prefix;
|
|
@@ -14,25 +15,52 @@ function compareSlashCommandSuggestion(prefix, left, right) {
|
|
|
14
15
|
return left.index - right.index;
|
|
15
16
|
}
|
|
16
17
|
export function getSlashCommandSuggestions(commands, prefix) {
|
|
17
|
-
const
|
|
18
|
+
const normalizedPrefix = prefix.toLowerCase();
|
|
19
|
+
const explicitSkillNamespace = normalizedPrefix.startsWith(SKILL_COMMAND_PREFIX);
|
|
20
|
+
const hasSkillCommands = commands.some((cmd) => {
|
|
18
21
|
const name = "name" in cmd ? cmd.name : cmd.value;
|
|
22
|
+
return name.startsWith(SKILL_COMMAND_PREFIX);
|
|
23
|
+
});
|
|
24
|
+
const commandItems = commands.flatMap((cmd) => {
|
|
25
|
+
const name = "name" in cmd ? cmd.name : cmd.value;
|
|
26
|
+
const isSkill = name.startsWith(SKILL_COMMAND_PREFIX);
|
|
27
|
+
const skillName = isSkill ? name.slice(SKILL_COMMAND_PREFIX.length) : "";
|
|
28
|
+
if (isSkill &&
|
|
29
|
+
!explicitSkillNamespace &&
|
|
30
|
+
(normalizedPrefix.length === 0 || !skillName.toLowerCase().startsWith(normalizedPrefix))) {
|
|
31
|
+
return [];
|
|
32
|
+
}
|
|
19
33
|
const hint = "argumentHint" in cmd && cmd.argumentHint ? cmd.argumentHint : undefined;
|
|
20
34
|
const desc = cmd.description ?? "";
|
|
21
35
|
const fullDesc = hint ? (desc ? `${hint} — ${desc}` : hint) : desc;
|
|
22
|
-
return
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
36
|
+
return [
|
|
37
|
+
{
|
|
38
|
+
name,
|
|
39
|
+
label: name,
|
|
40
|
+
description: fullDesc || undefined,
|
|
41
|
+
searchText: isSkill && !explicitSkillNamespace ? skillName : name,
|
|
42
|
+
},
|
|
43
|
+
];
|
|
27
44
|
});
|
|
28
|
-
|
|
45
|
+
if (hasSkillCommands &&
|
|
46
|
+
!explicitSkillNamespace &&
|
|
47
|
+
normalizedPrefix.length > 0 &&
|
|
48
|
+
SKILL_COMMAND_PREFIX.startsWith(normalizedPrefix)) {
|
|
49
|
+
commandItems.push({
|
|
50
|
+
name: SKILL_COMMAND_PREFIX,
|
|
51
|
+
label: SKILL_COMMAND_PREFIX,
|
|
52
|
+
description: "Browse available skills",
|
|
53
|
+
searchText: SKILL_COMMAND_PREFIX,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
return fuzzyFilter(commandItems, prefix, (item) => item.searchText)
|
|
29
57
|
.map((item, index) => ({
|
|
30
58
|
value: item.name,
|
|
31
59
|
label: item.label,
|
|
32
60
|
...(item.description && { description: item.description }),
|
|
33
61
|
index,
|
|
34
62
|
}))
|
|
35
|
-
.sort((left, right) => compareSlashCommandSuggestion(
|
|
63
|
+
.sort((left, right) => compareSlashCommandSuggestion(normalizedPrefix, left, right))
|
|
36
64
|
.map(({ index: _index, ...item }) => item);
|
|
37
65
|
}
|
|
38
66
|
//# sourceMappingURL=slash-command-autocomplete.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slash-command-autocomplete.js","sourceRoot":"","sources":["../src/slash-command-autocomplete.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"slash-command-autocomplete.js","sourceRoot":"","sources":["../src/slash-command-autocomplete.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,MAAM,oBAAoB,GAAG,QAAQ,CAAC;AAatC,SAAS,6BAA6B,CAAC,MAAc,EAAE,IAAuB,EAAE,KAAwB;IACvG,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,KAAK,MAAM,CAAC;IACxC,MAAM,UAAU,GAAG,KAAK,CAAC,KAAK,KAAK,MAAM,CAAC;IAC1C,IAAI,SAAS,KAAK,UAAU;QAAE,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAExD,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;IACjD,MAAM,WAAW,GAAG,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;IACnD,IAAI,UAAU,KAAK,WAAW;QAAE,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3D,IAAI,UAAU,IAAI,WAAW,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;QAC3E,OAAO,K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,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,6BAA6B,CAAC,gBAAgB,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;SACnF,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;AAC7C,CAAC","sourcesContent":["import type { AutocompleteItem, SlashCommand } from \"./autocomplete.ts\";\nimport { fuzzyFilter } from \"./fuzzy.ts\";\n\nconst SKILL_COMMAND_PREFIX = \"skill:\";\n\ntype CommandItem = {\n\treadonly name: string;\n\treadonly label: string;\n\treadonly description?: string;\n\treadonly searchText: string;\n};\n\ntype RankedCommandItem = AutocompleteItem & {\n\treadonly index: number;\n};\n\nfunction compareSlashCommandSuggestion(prefix: string, left: RankedCommandItem, right: RankedCommandItem): number {\n\tconst leftExact = left.value === prefix;\n\tconst rightExact = right.value === prefix;\n\tif (leftExact !== rightExact) return leftExact ? -1 : 1;\n\n\tconst leftPrefix = left.value.startsWith(prefix);\n\tconst rightPrefix = right.value.startsWith(prefix);\n\tif (leftPrefix !== rightPrefix) return leftPrefix ? -1 : 1;\n\tif (leftPrefix && rightPrefix && left.value.length !== right.value.length) {\n\t\treturn right.value.length - left.value.length;\n\t}\n\n\treturn left.index - right.index;\n}\n\nexport function getSlashCommandSuggestions(\n\tcommands: readonly (SlashCommand | AutocompleteItem)[],\n\tprefix: string,\n): AutocompleteItem[] {\n\tconst normalizedPrefix = prefix.toLowerCase();\n\tconst explicitSkillNamespace = normalizedPrefix.startsWith(SKILL_COMMAND_PREFIX);\n\tconst hasSkillCommands = commands.some((cmd) => {\n\t\tconst name = \"name\" in cmd ? cmd.name : cmd.value;\n\t\treturn name.startsWith(SKILL_COMMAND_PREFIX);\n\t});\n\tconst commandItems: CommandItem[] = commands.flatMap((cmd) => {\n\t\tconst name = \"name\" in cmd ? cmd.name : cmd.value;\n\t\tconst isSkill = name.startsWith(SKILL_COMMAND_PREFIX);\n\t\tconst skillName = isSkill ? name.slice(SKILL_COMMAND_PREFIX.length) : \"\";\n\t\tif (\n\t\t\tisSkill &&\n\t\t\t!explicitSkillNamespace &&\n\t\t\t(normalizedPrefix.length === 0 || !skillName.toLowerCase().startsWith(normalizedPrefix))\n\t\t) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst hint = \"argumentHint\" in cmd && cmd.argumentHint ? cmd.argumentHint : undefined;\n\t\tconst desc = cmd.description ?? \"\";\n\t\tconst fullDesc = hint ? (desc ? `${hint} — ${desc}` : hint) : desc;\n\t\treturn [\n\t\t\t{\n\t\t\t\tname,\n\t\t\t\tlabel: name,\n\t\t\t\tdescription: fullDesc || undefined,\n\t\t\t\tsearchText: isSkill && !explicitSkillNamespace ? skillName : name,\n\t\t\t},\n\t\t];\n\t});\n\n\tif (\n\t\thasSkillCommands &&\n\t\t!explicitSkillNamespace &&\n\t\tnormalizedPrefix.length > 0 &&\n\t\tSKILL_COMMAND_PREFIX.startsWith(normalizedPrefix)\n\t) {\n\t\tcommandItems.push({\n\t\t\tname: SKILL_COMMAND_PREFIX,\n\t\t\tlabel: SKILL_COMMAND_PREFIX,\n\t\t\tdescription: \"Browse available skills\",\n\t\t\tsearchText: SKILL_COMMAND_PREFIX,\n\t\t});\n\t}\n\n\treturn fuzzyFilter(commandItems, prefix, (item) => item.searchText)\n\t\t.map((item, index) => ({\n\t\t\tvalue: item.name,\n\t\t\tlabel: item.label,\n\t\t\t...(item.description && { description: item.description }),\n\t\t\tindex,\n\t\t}))\n\t\t.sort((left, right) => compareSlashCommandSuggestion(normalizedPrefix, left, right))\n\t\t.map(({ index: _index, ...item }) => item);\n}\n"]}
|
|
@@ -325,6 +325,8 @@ export declare abstract class TuiBase extends Container {
|
|
|
325
325
|
* @param cursorPos The cursor position extracted from rendered output, or null
|
|
326
326
|
* @param totalLines Total number of rendered lines
|
|
327
327
|
*/
|
|
328
|
+
private buildHardwareCursorSequence;
|
|
329
|
+
private finishFrame;
|
|
328
330
|
private positionHardwareCursor;
|
|
329
331
|
/**
|
|
330
332
|
* Query the terminal's default background color with OSC 11 (`ESC ] 11 ; ? BEL`).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tui.d.ts","sourceRoot":"","sources":["../src/tui.ts"],"names":[],"mappings":"AAAA;;GAEG;AAQH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAIN,KAAK,QAAQ,EACb,KAAK,mBAAmB,EACxB,MAAM,sBAAsB,CAAC;AAS9B,OAAO,EAA2E,YAAY,EAAE,MAAM,YAAY,CAAC;AA0CnH;;GAEG;AACH,MAAM,WAAW,SAAS;IACzB;;;;OAIG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAEhC;;OAEG;IACH,WAAW,CAAC,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAEjC;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;;OAGG;IACH,UAAU,IAAI,IAAI,CAAC;IAEnB,OAAO,CAAC,IAAI,IAAI,CAAC;CACjB;AAED,MAAM,MAAM,sBAAsB,GAAG;IAAE,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAAC;AACtF,MAAM,MAAM,gBAAgB,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,sBAAsB,CAAC;AAcxE,UAAU,mBAAmB;IAC5B,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAC;IACrC,QAAQ,CAAC,0BAA0B,EAAE,MAAM,CAAC;IAC5C,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC;IACtC,QAAQ,CAAC,2BAA2B,EAAE,MAAM,CAAC;IAC7C,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ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sB;IAuC9B,OAAO,CAAC,wBAAwB;IAyChC,2FAA2F;IAC3F,OAAO,CAAC,eAAe;IAqDvB;;;;;;;OAOG;IACH,SAAS,CAAC,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,GAAG;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAgCpG;IAED,SAAS,CAAC,QAAQ,IAAI,IAAI,CAmezB;IAED;;;;OAIG;IACH,OAAO,CAAC,2BAA2B;IAgCnC,OAAO,CAAC,WAAW;IAUnB,OAAO,CAAC,sBAAsB;IAK9B;;;;OAIG;IACH,4BAA4B,CAAC,EAAE,SAAS,EAAE,EAAE;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC,CAqBhG;IAED;;;;OAIG;IACH,wBAAwB,CAAC,EAAE,SAAS,EAAE,EAAE;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,mBAAmB,GAAG,SAAS,CAAC,CAoBvG;CACD;AAED,0CAA0C;AAC1C,qBAAa,GAAI,SAAQ,OAAO;CAAG"}
|
|
@@ -56,6 +56,9 @@ export function isFocusable(component) {
|
|
|
56
56
|
* TUI finds and strips this marker, then positions the hardware cursor there.
|
|
57
57
|
*/
|
|
58
58
|
export const CURSOR_MARKER = "\x1b_pi:c\x07";
|
|
59
|
+
const FAKE_CURSOR_START = "\x1b[7m";
|
|
60
|
+
const FAKE_CURSOR_END = "\x1b[27m";
|
|
61
|
+
const FAKE_CURSOR_RESET = "\x1b[0m";
|
|
59
62
|
export { visibleWidth };
|
|
60
63
|
const renderErrorLoggedClasses = new Set();
|
|
61
64
|
let renderErrorLogWrites = 0;
|
|
@@ -355,9 +358,6 @@ export class TuiBase extends Container {
|
|
|
355
358
|
if (this.showHardwareCursor === enabled)
|
|
356
359
|
return;
|
|
357
360
|
this.showHardwareCursor = enabled;
|
|
358
|
-
if (!enabled) {
|
|
359
|
-
this.#setCursorVisibility(false);
|
|
360
|
-
}
|
|
361
361
|
this.requestRender();
|
|
362
362
|
}
|
|
363
363
|
getClearOnShrink() {
|
|
@@ -696,8 +696,11 @@ export class TuiBase extends Container {
|
|
|
696
696
|
this.beforeTerminalStop();
|
|
697
697
|
// Move cursor to the end of the content to prevent overwriting/artifacts on exit
|
|
698
698
|
if (this.previousLines.length > 0) {
|
|
699
|
-
//
|
|
700
|
-
|
|
699
|
+
// Only overwrite the cursor cell when the last published frame kept the hardware cursor hidden;
|
|
700
|
+
// a pending visibility change has not rendered yet and must not erase content.
|
|
701
|
+
if (this.#lastCursorVisibility === false) {
|
|
702
|
+
this.terminal.write(" ");
|
|
703
|
+
}
|
|
701
704
|
const targetRow = this.previousLines.length; // Line after the last content
|
|
702
705
|
const lineDiff = targetRow - this.hardwareCursorRow;
|
|
703
706
|
if (lineDiff > 0) {
|
|
@@ -1373,13 +1376,12 @@ export class TuiBase extends Container {
|
|
|
1373
1376
|
buffer += row.content;
|
|
1374
1377
|
finalPaintedScreenRow = row.screenRow;
|
|
1375
1378
|
}
|
|
1376
|
-
|
|
1379
|
+
const finalCursorRow = plan.viewportTop + finalPaintedScreenRow;
|
|
1380
|
+
buffer = this.finishFrame(buffer, cursorPos, newLines.length, finalCursorRow);
|
|
1377
1381
|
this.terminal.write(buffer);
|
|
1378
1382
|
this.cursorRow = Math.max(0, newLines.length - 1);
|
|
1379
|
-
this.hardwareCursorRow = plan.viewportTop + finalPaintedScreenRow;
|
|
1380
1383
|
this.maxLinesRendered = Math.max(this.maxLinesRendered, newLines.length);
|
|
1381
1384
|
this.previousViewportTop = plan.viewportTop;
|
|
1382
|
-
this.positionHardwareCursor(cursorPos, newLines.length);
|
|
1383
1385
|
this.setPreviousLines(newLines, rawLines);
|
|
1384
1386
|
this.previousKittyImageIds = this.collectKittyImageIds(newLines);
|
|
1385
1387
|
this.previousWidth = width;
|
|
@@ -1402,13 +1404,11 @@ export class TuiBase extends Container {
|
|
|
1402
1404
|
buffer += `\r\x1b[2K${TUI.SEGMENT_RESET}`;
|
|
1403
1405
|
buffer += newLines[row] ?? "";
|
|
1404
1406
|
}
|
|
1405
|
-
buffer
|
|
1407
|
+
buffer = this.finishFrame(buffer, cursorPos, newLines.length, bufferLength - 1);
|
|
1406
1408
|
this.terminal.write(buffer);
|
|
1407
1409
|
this.cursorRow = Math.max(0, newLines.length - 1);
|
|
1408
|
-
this.hardwareCursorRow = bufferLength - 1;
|
|
1409
1410
|
this.maxLinesRendered = newLines.length;
|
|
1410
1411
|
this.previousViewportTop = Math.max(0, bufferLength - height);
|
|
1411
|
-
this.positionHardwareCursor(cursorPos, newLines.length);
|
|
1412
1412
|
this.setPreviousLines(newLines, rawLines);
|
|
1413
1413
|
this.previousKittyImageIds = this.collectKittyImageIds(newLines);
|
|
1414
1414
|
this.previousWidth = width;
|
|
@@ -1431,14 +1431,13 @@ export class TuiBase extends Container {
|
|
|
1431
1431
|
buffer += `\r\x1b[2K${TUI.SEGMENT_RESET}`;
|
|
1432
1432
|
buffer += newLines[viewportTop + row] ?? "";
|
|
1433
1433
|
}
|
|
1434
|
-
|
|
1434
|
+
const finalCursorRow = viewportTop + Math.max(0, height - 1);
|
|
1435
|
+
buffer = this.finishFrame(buffer, cursorPos, newLines.length, finalCursorRow);
|
|
1435
1436
|
this.terminal.write(buffer);
|
|
1436
1437
|
this.muxViewportRepaintCount += 1;
|
|
1437
1438
|
this.cursorRow = Math.max(0, newLines.length - 1);
|
|
1438
|
-
this.hardwareCursorRow = viewportTop + Math.max(0, height - 1);
|
|
1439
1439
|
this.maxLinesRendered = newLines.length;
|
|
1440
1440
|
this.previousViewportTop = viewportTop;
|
|
1441
|
-
this.positionHardwareCursor(cursorPos, newLines.length);
|
|
1442
1441
|
this.setPreviousLines(newLines, rawLines);
|
|
1443
1442
|
this.previousKittyImageIds = this.collectKittyImageIds(newLines);
|
|
1444
1443
|
this.previousWidth = width;
|
|
@@ -1505,8 +1504,22 @@ export class TuiBase extends Container {
|
|
|
1505
1504
|
// Calculate visual column (width of text before marker)
|
|
1506
1505
|
const beforeMarker = line.slice(0, markerIndex);
|
|
1507
1506
|
const col = visibleWidth(beforeMarker);
|
|
1508
|
-
|
|
1509
|
-
|
|
1507
|
+
let afterMarker = line.slice(markerIndex + CURSOR_MARKER.length);
|
|
1508
|
+
if (this.showHardwareCursor && afterMarker.startsWith(FAKE_CURSOR_START)) {
|
|
1509
|
+
const fakeCursorEnd = afterMarker.indexOf(FAKE_CURSOR_END, FAKE_CURSOR_START.length);
|
|
1510
|
+
const fakeCursorReset = afterMarker.indexOf(FAKE_CURSOR_RESET, FAKE_CURSOR_START.length);
|
|
1511
|
+
if (fakeCursorReset !== -1 && (fakeCursorEnd === -1 || fakeCursorReset < fakeCursorEnd)) {
|
|
1512
|
+
// Keep a full reset because it may also terminate styles surrounding the fake cursor.
|
|
1513
|
+
afterMarker = afterMarker.slice(FAKE_CURSOR_START.length);
|
|
1514
|
+
}
|
|
1515
|
+
else if (fakeCursorEnd !== -1) {
|
|
1516
|
+
afterMarker =
|
|
1517
|
+
afterMarker.slice(FAKE_CURSOR_START.length, fakeCursorEnd) +
|
|
1518
|
+
afterMarker.slice(fakeCursorEnd + FAKE_CURSOR_END.length);
|
|
1519
|
+
}
|
|
1520
|
+
}
|
|
1521
|
+
// Strip marker and any colocated fake cursor styling when the hardware cursor owns the position.
|
|
1522
|
+
lines[row] = beforeMarker + afterMarker;
|
|
1510
1523
|
return { row, col };
|
|
1511
1524
|
}
|
|
1512
1525
|
}
|
|
@@ -1572,10 +1585,10 @@ export class TuiBase extends Container {
|
|
|
1572
1585
|
}
|
|
1573
1586
|
buffer += line;
|
|
1574
1587
|
}
|
|
1575
|
-
|
|
1588
|
+
const finalCursorRow = Math.max(0, newLines.length - 1);
|
|
1589
|
+
buffer = this.finishFrame(buffer, cursorPos, newLines.length, finalCursorRow);
|
|
1576
1590
|
this.terminal.write(buffer);
|
|
1577
1591
|
this.cursorRow = Math.max(0, newLines.length - 1);
|
|
1578
|
-
this.hardwareCursorRow = this.cursorRow;
|
|
1579
1592
|
// Reset max lines when clearing, otherwise track growth
|
|
1580
1593
|
if (clear) {
|
|
1581
1594
|
this.maxLinesRendered = newLines.length;
|
|
@@ -1585,7 +1598,6 @@ export class TuiBase extends Container {
|
|
|
1585
1598
|
}
|
|
1586
1599
|
const bufferLength = Math.max(height, newLines.length);
|
|
1587
1600
|
this.previousViewportTop = Math.max(0, bufferLength - height);
|
|
1588
|
-
this.positionHardwareCursor(cursorPos, newLines.length);
|
|
1589
1601
|
this.setPreviousLines(newLines, rawLines);
|
|
1590
1602
|
this.previousKittyImageIds = this.collectKittyImageIds(newLines);
|
|
1591
1603
|
this.previousWidth = width;
|
|
@@ -1718,12 +1730,13 @@ export class TuiBase extends Container {
|
|
|
1718
1730
|
if (moveBack > 0) {
|
|
1719
1731
|
buffer += `\x1b[${moveBack}A`;
|
|
1720
1732
|
}
|
|
1721
|
-
buffer
|
|
1733
|
+
buffer = this.finishFrame(buffer, cursorPos, newLines.length, targetRow);
|
|
1722
1734
|
this.terminal.write(buffer);
|
|
1723
1735
|
this.cursorRow = targetRow;
|
|
1724
|
-
this.hardwareCursorRow = targetRow;
|
|
1725
1736
|
}
|
|
1726
|
-
|
|
1737
|
+
else {
|
|
1738
|
+
this.positionHardwareCursor(cursorPos, newLines.length);
|
|
1739
|
+
}
|
|
1727
1740
|
this.setPreviousLines(newLines, rawLines);
|
|
1728
1741
|
this.previousKittyImageIds = this.collectKittyImageIds(newLines);
|
|
1729
1742
|
this.previousWidth = width;
|
|
@@ -1787,13 +1800,12 @@ export class TuiBase extends Container {
|
|
|
1787
1800
|
buffer += `\r\x1b[2K${TUI.SEGMENT_RESET}`;
|
|
1788
1801
|
buffer += newLines[viewportTop + row] ?? "";
|
|
1789
1802
|
}
|
|
1790
|
-
|
|
1803
|
+
const finalCursorRow = viewportTop + Math.max(0, height - 1);
|
|
1804
|
+
buffer = this.finishFrame(buffer, cursorPos, newLines.length, finalCursorRow);
|
|
1791
1805
|
this.terminal.write(buffer);
|
|
1792
1806
|
this.cursorRow = Math.max(0, newLines.length - 1);
|
|
1793
|
-
this.hardwareCursorRow = viewportTop + Math.max(0, height - 1);
|
|
1794
1807
|
this.maxLinesRendered = Math.max(this.maxLinesRendered, newLines.length);
|
|
1795
1808
|
this.previousViewportTop = viewportTop;
|
|
1796
|
-
this.positionHardwareCursor(cursorPos, newLines.length);
|
|
1797
1809
|
this.setPreviousLines(newLines, rawLines);
|
|
1798
1810
|
this.previousKittyImageIds = this.collectKittyImageIds(newLines);
|
|
1799
1811
|
this.previousWidth = width;
|
|
@@ -1908,7 +1920,7 @@ export class TuiBase extends Container {
|
|
|
1908
1920
|
// Move cursor back to end of new content
|
|
1909
1921
|
buffer += `\x1b[${extraLines}A`;
|
|
1910
1922
|
}
|
|
1911
|
-
buffer
|
|
1923
|
+
buffer = this.finishFrame(buffer, cursorPos, newLines.length, finalCursorRow);
|
|
1912
1924
|
if (process.env.PI_TUI_DEBUG === "1") {
|
|
1913
1925
|
const debugDir = "/tmp/tui";
|
|
1914
1926
|
fs.mkdirSync(debugDir, { recursive: true });
|
|
@@ -1944,12 +1956,9 @@ export class TuiBase extends Container {
|
|
|
1944
1956
|
// cursorRow tracks end of content (for viewport calculation)
|
|
1945
1957
|
// hardwareCursorRow tracks actual terminal cursor position (for movement)
|
|
1946
1958
|
this.cursorRow = Math.max(0, newLines.length - 1);
|
|
1947
|
-
this.hardwareCursorRow = finalCursorRow;
|
|
1948
1959
|
// Track terminal's working area (grows but doesn't shrink unless cleared)
|
|
1949
1960
|
this.maxLinesRendered = Math.max(this.maxLinesRendered, newLines.length);
|
|
1950
1961
|
this.previousViewportTop = Math.max(prevViewportTop, finalCursorRow - height + 1);
|
|
1951
|
-
// Position hardware cursor for IME
|
|
1952
|
-
this.positionHardwareCursor(cursorPos, newLines.length);
|
|
1953
1962
|
this.setPreviousLines(newLines, rawLines);
|
|
1954
1963
|
if (needsKittyImageExpansion) {
|
|
1955
1964
|
this.previousKittyImageIds = this.collectKittyImageIds(newLines);
|
|
@@ -1962,7 +1971,7 @@ export class TuiBase extends Container {
|
|
|
1962
1971
|
* @param cursorPos The cursor position extracted from rendered output, or null
|
|
1963
1972
|
* @param totalLines Total number of rendered lines
|
|
1964
1973
|
*/
|
|
1965
|
-
|
|
1974
|
+
buildHardwareCursorSequence(cursorPos, totalLines) {
|
|
1966
1975
|
let buffer = "";
|
|
1967
1976
|
if (!cursorPos || totalLines <= 0) {
|
|
1968
1977
|
if (this.#lastCursorVisibility !== false) {
|
|
@@ -1990,9 +1999,16 @@ export class TuiBase extends Container {
|
|
|
1990
1999
|
this.#lastCursorVisibility = this.showHardwareCursor;
|
|
1991
2000
|
}
|
|
1992
2001
|
}
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
2002
|
+
return buffer;
|
|
2003
|
+
}
|
|
2004
|
+
finishFrame(buffer, cursorPos, totalLines, hardwareCursorRow) {
|
|
2005
|
+
this.hardwareCursorRow = hardwareCursorRow;
|
|
2006
|
+
return buffer + this.buildHardwareCursorSequence(cursorPos, totalLines) + TUI.FRAME_END;
|
|
2007
|
+
}
|
|
2008
|
+
positionHardwareCursor(cursorPos, totalLines) {
|
|
2009
|
+
const buffer = this.buildHardwareCursorSequence(cursorPos, totalLines);
|
|
2010
|
+
if (buffer)
|
|
2011
|
+
this.terminal.write(TUI.FRAME_BEGIN + buffer + TUI.FRAME_END);
|
|
1996
2012
|
}
|
|
1997
2013
|
/**
|
|
1998
2014
|
* Query the terminal's default background color with OSC 11 (`ESC ] 11 ; ? BEL`).
|