@harrylabsj/kiwi-merchant-cloud 0.12.4 → 0.12.6
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/app/a2a/node.d.ts +5 -1
- package/app/a2a/node.js +68 -30
- package/app/a2a/node.js.map +1 -1
- package/app/a2a/server/merchant-handler.d.ts +4 -0
- package/app/a2a/server/merchant-handler.js +123 -45
- package/app/a2a/server/merchant-handler.js.map +1 -1
- package/app/a2a/server/merchant-product-facts.d.ts +32 -0
- package/app/a2a/server/merchant-product-facts.js +57 -0
- package/app/a2a/server/merchant-product-facts.js.map +1 -0
- package/app/agent/buyer/buyer-tools.js +285 -3
- package/app/agent/buyer/buyer-tools.js.map +1 -1
- package/app/agent/merchant/types.d.ts +4 -9
- package/app/agent/merchant/types.js +14 -0
- package/app/agent/merchant/types.js.map +1 -1
- package/app/buyer-core/a2a-knp.d.ts +1 -0
- package/app/buyer-core/a2a-knp.js +1 -1
- package/app/buyer-core/a2a-knp.js.map +1 -1
- package/app/buyer-core/a2a-negotiator.d.ts +2 -0
- package/app/buyer-core/a2a-negotiator.js +20 -19
- package/app/buyer-core/a2a-negotiator.js.map +1 -1
- package/app/buyer-core/a2a-quote-fetcher.d.ts +2 -0
- package/app/buyer-core/a2a-quote-fetcher.js +13 -5
- package/app/buyer-core/a2a-quote-fetcher.js.map +1 -1
- package/app/buyer-core/product-summary.d.ts +4 -0
- package/app/buyer-core/product-summary.js +6 -0
- package/app/buyer-core/product-summary.js.map +1 -1
- package/app/buyer-core/protocol-recovery.d.ts +12 -1
- package/app/buyer-core/protocol-recovery.js +59 -19
- package/app/buyer-core/protocol-recovery.js.map +1 -1
- package/app/buyer-core/receive-gate.d.ts +11 -0
- package/app/buyer-core/receive-gate.js +107 -0
- package/app/buyer-core/receive-gate.js.map +1 -0
- package/app/buyer-core/service.d.ts +22 -1
- package/app/buyer-core/service.js +325 -33
- package/app/buyer-core/service.js.map +1 -1
- package/app/buyer-core/store.d.ts +23 -0
- package/app/buyer-core/store.js +71 -8
- package/app/buyer-core/store.js.map +1 -1
- package/app/cloud/bootstrap.d.ts +17 -0
- package/app/cloud/bootstrap.js +96 -59
- package/app/cloud/bootstrap.js.map +1 -1
- package/app/cloud/config.d.ts +26 -0
- package/app/cloud/config.js +75 -3
- package/app/cloud/config.js.map +1 -1
- package/app/cloud/file-listing-publication.js +6 -0
- package/app/cloud/file-listing-publication.js.map +1 -1
- package/app/cloud/main.d.ts +72 -0
- package/app/cloud/main.js +332 -11
- package/app/cloud/main.js.map +1 -1
- package/app/cloud/owned-clock.d.ts +27 -0
- package/app/cloud/owned-clock.js +98 -0
- package/app/cloud/owned-clock.js.map +1 -0
- package/app/cloud/owned-runtime.d.ts +188 -0
- package/app/cloud/owned-runtime.js +1041 -0
- package/app/cloud/owned-runtime.js.map +1 -0
- package/app/cloud/product-import-tabular.d.ts +1 -1
- package/app/cloud/product-import-tabular.js +263 -36
- package/app/cloud/product-import-tabular.js.map +1 -1
- package/app/cloud/product-source.d.ts +6 -1
- package/app/cloud/product-source.js +47 -15
- package/app/cloud/product-source.js.map +1 -1
- package/app/cloud-sample/products.json +3 -3
- package/app/commerce/data-source.d.ts +4 -0
- package/app/commerce/data-source.js.map +1 -1
- package/app/commerce/shopping-cli-source.js +4 -0
- package/app/commerce/shopping-cli-source.js.map +1 -1
- package/app/demo/demo-runner.js +6 -0
- package/app/demo/demo-runner.js.map +1 -1
- package/app/discovery/catalog-source/kiwi-source.d.ts +2 -0
- package/app/discovery/catalog-source/kiwi-source.js +4 -0
- package/app/discovery/catalog-source/kiwi-source.js.map +1 -1
- package/app/handoff/destination.d.ts +2 -0
- package/app/handoff/destination.js +4 -0
- package/app/handoff/destination.js.map +1 -1
- package/app/handoff/index.d.ts +2 -1
- package/app/handoff/index.js +1 -0
- package/app/handoff/index.js.map +1 -1
- package/app/handoff/launch-marketplace-policy.d.ts +149 -0
- package/app/handoff/launch-marketplace-policy.js +301 -0
- package/app/handoff/launch-marketplace-policy.js.map +1 -0
- package/app/handoff/marketplace-product-link.d.ts +18 -0
- package/app/handoff/marketplace-product-link.js +71 -0
- package/app/handoff/marketplace-product-link.js.map +1 -0
- package/app/handoff/transaction.d.ts +30 -0
- package/app/handoff/transaction.js +64 -0
- package/app/handoff/transaction.js.map +1 -1
- package/app/handoff/url-safety.d.ts +3 -0
- package/app/handoff/url-safety.js +4 -0
- package/app/handoff/url-safety.js.map +1 -1
- package/app/http/merchant-management/page.js +176 -45
- package/app/http/merchant-management/page.js.map +1 -1
- package/app/i18n.d.ts +1 -0
- package/app/i18n.js +3 -0
- package/app/i18n.js.map +1 -1
- package/app/lifecycle/close.d.ts +24 -0
- package/app/lifecycle/close.js +131 -0
- package/app/lifecycle/close.js.map +1 -0
- package/app/mcp/merchant-runtime-assembly.js +6 -4
- package/app/mcp/merchant-runtime-assembly.js.map +1 -1
- package/app/mcp/tools.js +17 -16
- package/app/mcp/tools.js.map +1 -1
- package/app/merchant/application/service.d.ts +4 -0
- package/app/merchant/application/service.js.map +1 -1
- package/app/merchant/stats-store.d.ts +3 -0
- package/app/merchant/stats-store.js +15 -1
- package/app/merchant/stats-store.js.map +1 -1
- package/app/merchant-core/rfq/data-source-adapter.d.ts +2 -10
- package/app/merchant-core/rfq/data-source-adapter.js +21 -9
- package/app/merchant-core/rfq/data-source-adapter.js.map +1 -1
- package/app/merchant-gateway/pinned-fetch.js +5 -2
- package/app/merchant-gateway/pinned-fetch.js.map +1 -1
- package/build-manifest.json +4103 -3123
- package/node_modules/@earendil-works/chord/CHANGELOG.md +20 -0
- package/node_modules/@earendil-works/chord/README.md +77 -194
- package/node_modules/@earendil-works/chord/dist/cell.d.ts +101 -0
- package/node_modules/@earendil-works/chord/dist/cell.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/cell.js +316 -0
- package/node_modules/@earendil-works/chord/dist/cell.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/cluster.d.ts +26 -0
- package/node_modules/@earendil-works/chord/dist/cluster.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/cluster.js +214 -0
- package/node_modules/@earendil-works/chord/dist/cluster.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/connection.d.ts +157 -0
- package/node_modules/@earendil-works/chord/dist/connection.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/connection.js +757 -0
- package/node_modules/@earendil-works/chord/dist/connection.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/context/index.d.ts +12 -1
- package/node_modules/@earendil-works/chord/dist/context/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/chord/dist/context/index.js.map +1 -1
- package/node_modules/@earendil-works/chord/dist/contract.d.ts +133 -0
- package/node_modules/@earendil-works/chord/dist/contract.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/contract.js +157 -0
- package/node_modules/@earendil-works/chord/dist/contract.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/declare.d.ts +70 -0
- package/node_modules/@earendil-works/chord/dist/declare.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/declare.js +22 -0
- package/node_modules/@earendil-works/chord/dist/declare.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/delta/apply-immutable-trusted.js.map +1 -1
- package/node_modules/@earendil-works/chord/dist/delta/diff.d.ts +1 -1
- package/node_modules/@earendil-works/chord/dist/delta/diff.d.ts.map +1 -1
- package/node_modules/@earendil-works/chord/dist/delta/diff.js.map +1 -1
- package/node_modules/@earendil-works/chord/dist/delta/index.d.ts +2 -2
- package/node_modules/@earendil-works/chord/dist/delta/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/chord/dist/delta/index.js +41 -0
- package/node_modules/@earendil-works/chord/dist/delta/index.js.map +1 -1
- package/node_modules/@earendil-works/chord/dist/delta/revision-validator.d.ts +1 -1
- package/node_modules/@earendil-works/chord/dist/delta/revision-validator.d.ts.map +1 -1
- package/node_modules/@earendil-works/chord/dist/delta/revision-validator.js.map +1 -1
- package/node_modules/@earendil-works/chord/dist/delta/tracker.d.ts +1 -1
- package/node_modules/@earendil-works/chord/dist/delta/tracker.d.ts.map +1 -1
- package/node_modules/@earendil-works/chord/dist/delta/tracker.js +40 -4
- package/node_modules/@earendil-works/chord/dist/delta/tracker.js.map +1 -1
- package/node_modules/@earendil-works/chord/dist/errors.d.ts +27 -0
- package/node_modules/@earendil-works/chord/dist/errors.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/errors.js +44 -0
- package/node_modules/@earendil-works/chord/dist/errors.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/host.d.ts +254 -0
- package/node_modules/@earendil-works/chord/dist/host.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/host.js +795 -0
- package/node_modules/@earendil-works/chord/dist/host.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/index.d.ts +17 -10
- package/node_modules/@earendil-works/chord/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/chord/dist/index.js +8 -8
- package/node_modules/@earendil-works/chord/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/chord/dist/json.d.ts +9 -1
- package/node_modules/@earendil-works/chord/dist/json.d.ts.map +1 -1
- package/node_modules/@earendil-works/chord/dist/json.js.map +1 -1
- package/node_modules/@earendil-works/chord/dist/link.d.ts +72 -0
- package/node_modules/@earendil-works/chord/dist/link.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/link.js +169 -0
- package/node_modules/@earendil-works/chord/dist/link.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/loader.d.ts +4 -0
- package/node_modules/@earendil-works/chord/dist/loader.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/loader.js +68 -0
- package/node_modules/@earendil-works/chord/dist/loader.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/manager.d.ts +115 -0
- package/node_modules/@earendil-works/chord/dist/manager.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/manager.js +319 -0
- package/node_modules/@earendil-works/chord/dist/manager.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/node.d.ts +3 -4
- package/node_modules/@earendil-works/chord/dist/node.d.ts.map +1 -1
- package/node_modules/@earendil-works/chord/dist/node.js +3 -2
- package/node_modules/@earendil-works/chord/dist/node.js.map +1 -1
- package/node_modules/@earendil-works/chord/dist/publish.d.ts +5 -0
- package/node_modules/@earendil-works/chord/dist/publish.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/publish.js +40 -0
- package/node_modules/@earendil-works/chord/dist/publish.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/record.d.ts +320 -0
- package/node_modules/@earendil-works/chord/dist/record.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/record.js +1292 -0
- package/node_modules/@earendil-works/chord/dist/record.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/registry.d.ts +25 -0
- package/node_modules/@earendil-works/chord/dist/registry.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/registry.js +6 -0
- package/node_modules/@earendil-works/chord/dist/registry.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/reload.d.ts +118 -0
- package/node_modules/@earendil-works/chord/dist/reload.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/reload.js +589 -0
- package/node_modules/@earendil-works/chord/dist/reload.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/remote.d.ts +70 -0
- package/node_modules/@earendil-works/chord/dist/remote.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/remote.js +308 -0
- package/node_modules/@earendil-works/chord/dist/remote.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/schema.d.ts +21 -0
- package/node_modules/@earendil-works/chord/dist/schema.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/schema.js +228 -0
- package/node_modules/@earendil-works/chord/dist/schema.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/state.d.ts +92 -0
- package/node_modules/@earendil-works/chord/dist/state.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/{services/state.js → state.js} +28 -138
- package/node_modules/@earendil-works/chord/dist/state.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/types.d.ts +62 -262
- package/node_modules/@earendil-works/chord/dist/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/chord/dist/types.js.map +1 -1
- package/node_modules/@earendil-works/chord/dist/websocket.d.ts +16 -0
- package/node_modules/@earendil-works/chord/dist/websocket.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/websocket.js +15 -0
- package/node_modules/@earendil-works/chord/dist/websocket.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/wire.d.ts +135 -0
- package/node_modules/@earendil-works/chord/dist/wire.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/wire.js +112 -0
- package/node_modules/@earendil-works/chord/dist/wire.js.map +1 -0
- package/node_modules/@earendil-works/chord/docs/guide.md +750 -0
- package/node_modules/@earendil-works/chord/docs/spec.md +261 -0
- package/node_modules/@earendil-works/chord/docs/tutorial.md +909 -0
- package/node_modules/@earendil-works/chord/package.json +10 -11
- package/node_modules/@earendil-works/chord/src/delta/README.md +5 -3
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js +9 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/proxy.d.ts +2 -5
- package/node_modules/@earendil-works/pi-agent-core/dist/proxy.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/proxy.js +2 -14
- package/node_modules/@earendil-works/pi-agent-core/dist/proxy.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts +4 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/package.json +2 -2
- package/node_modules/@earendil-works/pi-ai/README.md +14 -3
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js +63 -22
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-config.d.ts +15 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-config.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-config.js +76 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-config.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.d.ts +3 -6
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js +2 -74
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js +33 -2
- package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/classifier-shared.d.ts +21 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/classifier-shared.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/classifier-shared.js +98 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/classifier-shared.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-workers-ai-system-one.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-workers-ai-system-one.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-workers-ai-system-one.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/lazy.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/lazy.js +4 -3
- package/node_modules/@earendil-works/pi-ai/dist/api/lazy.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/llama-cpp-classify.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/llama-cpp-classify.js +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/llama-cpp-classify.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js +31 -14
- package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js +7 -4
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-decisions.d.ts +4 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-decisions.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-decisions.js +162 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-decisions.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-decisions.lazy.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-decisions.lazy.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-decisions.lazy.js +4 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-decisions.lazy.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/system-one-shared.d.ts +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/system-one-shared.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/system-one-shared.js +5 -89
- package/node_modules/@earendil-works/pi-ai/dist/api/system-one-shared.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/typesafe-system-one.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/typesafe-system-one.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/typesafe-system-one.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/anthropic.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/anthropic.js +14 -6
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/anthropic.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openai-chatgpt.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openai-chatgpt.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openai-codex.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openai-codex.js +4 -4
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openai-codex.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.d.ts +16 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js +51 -27
- package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/types.d.ts +5 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.d.ts +5 -0
- package/node_modules/@earendil-works/pi-ai/dist/models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts +4 -4
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.js +4 -4
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.js +7 -8
- package/node_modules/@earendil-works/pi-ai/dist/models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/all.js +2 -2
- package/node_modules/@earendil-works/pi-ai/dist/providers/all.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure.js +46 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure.models.d.ts +6 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure.models.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure.models.js +8 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure.models.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/compat-schema.d.ts +338 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/compat-schema.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/compat-schema.js +375 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/compat-schema.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/amazon-bedrock.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/anthropic.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/azure.json +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/baseten.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-ai-gateway.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-workers-ai.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/google-vertex.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/google.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/meta.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/minimax-cn.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/minimax.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/mistral.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openai.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/opencode.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/radius.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/faux.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/faux.js +25 -8
- package/node_modules/@earendil-works/pi-ai/dist/providers/faux.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/model-schema.d.ts +91 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/model-schema.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/model-schema.js +55 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/model-schema.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai.js +12 -3
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter-api.d.ts +40 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter-api.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter-api.js +41 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter-api.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.d.ts +11 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.js +52 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/radius.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/radius.js +4 -12
- package/node_modules/@earendil-works/pi-ai/dist/providers/radius.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +22 -305
- 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/dist/utils/estimate.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/estimate.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.d.ts +10 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.js +25 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/model-operations.d.ts +3 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/model-operations.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/model-operations.js +6 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/model-operations.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.d.ts +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.js +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js +8 -2
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/package.json +2 -2
- package/node_modules/@earendil-works/pi-codemode/README.md +177 -11
- package/node_modules/@earendil-works/pi-codemode/dist/cloudflare.d.ts +53 -0
- package/node_modules/@earendil-works/pi-codemode/dist/cloudflare.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-codemode/dist/cloudflare.js +64 -0
- package/node_modules/@earendil-works/pi-codemode/dist/cloudflare.js.map +1 -0
- package/node_modules/@earendil-works/pi-codemode/dist/declarations.d.ts +6 -21
- package/node_modules/@earendil-works/pi-codemode/dist/declarations.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-codemode/dist/declarations.js +113 -127
- package/node_modules/@earendil-works/pi-codemode/dist/declarations.js.map +1 -1
- package/node_modules/@earendil-works/pi-codemode/dist/index.d.ts +5 -2
- package/node_modules/@earendil-works/pi-codemode/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-codemode/dist/index.js +4 -1
- package/node_modules/@earendil-works/pi-codemode/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-codemode/dist/portable.d.ts +15 -0
- package/node_modules/@earendil-works/pi-codemode/dist/portable.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-codemode/dist/portable.js +12 -0
- package/node_modules/@earendil-works/pi-codemode/dist/portable.js.map +1 -0
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/execution.d.ts +66 -0
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/execution.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/execution.js +494 -0
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/execution.js.map +1 -0
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/host.d.ts +8 -30
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/host.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/host.js +41 -283
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/host.js.map +1 -1
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/inline.d.ts +63 -0
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/inline.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/inline.js +80 -0
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/inline.js.map +1 -0
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/prelude-source.d.ts +9 -3
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/prelude-source.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/prelude-source.js +122 -12
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/prelude-source.js.map +1 -1
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/protocol.d.ts +47 -6
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/protocol.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/protocol.js +6 -1
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/protocol.js.map +1 -1
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/remote.d.ts +102 -0
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/remote.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/remote.js +175 -0
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/remote.js.map +1 -0
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/vm.d.ts +24 -0
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/vm.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/vm.js +293 -0
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/vm.js.map +1 -0
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/worker.js +11 -110
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/worker.js.map +1 -1
- package/node_modules/@earendil-works/pi-codemode/dist/source.d.ts +2 -1
- package/node_modules/@earendil-works/pi-codemode/dist/source.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-codemode/dist/source.js +8 -2
- package/node_modules/@earendil-works/pi-codemode/dist/source.js.map +1 -1
- package/node_modules/@earendil-works/pi-codemode/dist/types.d.ts +101 -6
- package/node_modules/@earendil-works/pi-codemode/dist/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-codemode/dist/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-codemode/package.json +15 -3
- package/node_modules/@earendil-works/pi-coding-agent/CHANGELOG.md +165 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/anthropic-messages-Q7SXESRX.js +6 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/anthropic.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/azure-openai-responses-LM52U7CK.js +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/bedrock-converse-stream.js +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-22CYIUS4.js +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-3ZATHNCK.js +9 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-5GTPJSRI.js +7 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-6MWTY2OB.js +130 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-6QGV3IWD.js +6 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-2KAZSACP.js → chunk-AKJ3ZOR3.js} +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-G7EDXK4D.js → chunk-CQ3XTLTY.js} +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-SYF2TF6W.js → chunk-D7PHKNBM.js} +29 -92
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-DOST5PQW.js +82 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-DVQEBGVL.js +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-ZSI3BL5Q.js → chunk-GDR5JFDJ.js} +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-HACVPRBJ.js +11 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-ITZNWD4K.js +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-LPXNMA2W.js +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-LD2P6SFZ.js → chunk-PMRZO46Y.js} +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-RDZVAGPR.js +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-ZSBPJAJ2.js → chunk-TJXZSVTD.js} +116 -99
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-BYB6ZAAQ.js → chunk-TN4NLWHF.js} +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-WBQBCFWG.js +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-WJUNYZC5.js +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-XIX7LUWI.js +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-ZBURYEWF.js +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{cli-KILDDGW3.js → cli-SWM4FQ6V.js} +4 -4
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/cloudflare-workers-ai-system-one-UTBL2KOF.js +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/codemode-worker.js +117 -14
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/easter-egg-3d-OX6RUCIS.js +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/execute-3CFUPDLS.js +499 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/github-copilot.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{google-generative-ai-ZOK6CV7D.js → google-generative-ai-DXKP72HC.js} +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{google-vertex-VKWZQ3AY.js → google-vertex-W6SIDOVV.js} +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/image-resize-worker.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{llama-cpp-classify-XT44PI3C.js → llama-cpp-classify-FYN623RH.js} +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/mistral-conversations-GBMHTSYF.js +5 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/openai-chatgpt.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/openai-codex-responses-RN6B5UPP.js +10 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/openai-codex.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{openai-completions-GWHGMQ3T.js → openai-completions-QW2B4SML.js} +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/openai-decisions-WVPMQ4JD.js +5 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{openai-responses-EZ7FJ2KL.js → openai-responses-KDJUSIU7.js} +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{openrouter-images-ZVXWCSIM.js → openrouter-images-DUPG5DZO.js} +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{pi-messages-TM5SOOIW.js → pi-messages-YHKPQIHC.js} +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/runtime-366HE7CW.js +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/typesafe-system-one-ZSK3RN4B.js +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/virtual-modules-GI6FRNLG.js +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/cli-runtime.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/index.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/rpc-entry.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli/args.d.ts +2 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli/args.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli/args.js +24 -5
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli/args.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/config.d.ts +18 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/config.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/config.js +44 -6
- package/node_modules/@earendil-works/pi-coding-agent/dist/config.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.d.ts +47 -5
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.js +148 -78
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/auth-storage.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/auth-storage.js +20 -13
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/auth-storage.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/bash-executor.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/bash-executor.js +42 -52
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/bash-executor.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/bug-report.d.ts +9 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/bug-report.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/utils.d.ts +6 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/utils.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/utils.js +7 -8
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/utils.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/export-html/tool-renderer.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/export-html/tool-renderer.js +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/export-html/tool-renderer.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/index.d.ts +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.d.ts +4 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.js +2 -3
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/types.d.ts +44 -7
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/key-id-schema.d.ts +6 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/key-id-schema.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/key-id-schema.js +16 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/key-id-schema.js.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/keybindings-schema.d.ts +4 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/keybindings-schema.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/keybindings-schema.js +16 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/keybindings-schema.js.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/keybindings.d.ts +198 -66
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/keybindings.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/keybindings.js +26 -23
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/keybindings.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/mcp-servers.d.ts +8 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/mcp-servers.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/mcp-servers.js +30 -7
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/mcp-servers.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-config.d.ts +695 -74
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-config.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-config.js +16 -166
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-config.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-resolver.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-resolver.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-runtime.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-runtime.js +13 -7
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-runtime.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/nested-tool-calls.d.ts +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/nested-tool-calls.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/nested-tool-calls.js +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/nested-tool-calls.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.js +3 -3
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/project-trust.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/project-trust.js +2 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/project-trust.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/remote-catalog-provider.d.ts +12 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/remote-catalog-provider.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/remote-catalog-provider.js +82 -24
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/remote-catalog-provider.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/resource-loader.d.ts +3 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/resource-loader.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/resource-loader.js +9 -4
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/resource-loader.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/sdk.d.ts +13 -4
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/sdk.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/sdk.js +19 -6
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/sdk.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-defaults.d.ts +65 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-defaults.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-defaults.js +66 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-defaults.js.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.d.ts +15 -145
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.js +85 -57
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-schema.d.ts +228 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-schema.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-schema.js +287 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-schema.js.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/skills.d.ts +4 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/skills.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/skills.js +6 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/skills.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/system-prompt.d.ts +6 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/system-prompt.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/system-prompt.js +9 -4
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/system-prompt.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/output-accumulator.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/output-accumulator.js +4 -10
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/output-accumulator.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.d.ts +13 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.js +18 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/render-utils.d.ts +18 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/render-utils.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/render-utils.js +46 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/render-utils.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/renderers/bash.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/renderers/bash.js +7 -35
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/renderers/bash.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/renderers/edit.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/renderers/edit.js +5 -4
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/renderers/edit.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/execute.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/execute.js +165 -48
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/execute.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/index.js +3 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/renderer.d.ts +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/renderer.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/renderer.js +9 -3
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/renderer.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/tool.d.ts +15 -14
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/tool.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/tool.js +58 -38
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/tool.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/llama/provider.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/llama/provider.js +34 -11
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/llama/provider.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/cli.js +22 -31
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/cli.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/index.js +188 -84
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/oauth.d.ts +5 -3
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/oauth.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/oauth.js +36 -10
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/oauth.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/resources.d.ts +3 -10
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/resources.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/resources.js +4 -5
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/resources.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/runtime.d.ts +7 -7
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/runtime.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/runtime.js +26 -44
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/runtime.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/tools.d.ts +4 -4
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/tools.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/tools.js +68 -16
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/tools.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/ui.d.ts +3 -3
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/ui.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/ui.js +10 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/ui.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/tool-search/tool.d.ts +0 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/tool-search/tool.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/tool-search/tool.js +2 -4
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/tool-search/tool.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/index.d.ts +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/main.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/main.js +4 -3
- package/node_modules/@earendil-works/pi-coding-agent/dist/main.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/bash-execution.d.ts +5 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/bash-execution.js +17 -14
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/bash-execution.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/branch-summary-message.d.ts +2 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/branch-summary-message.js +5 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/compaction-summary-message.d.ts +2 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/compaction-summary-message.js +5 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/custom-entry.d.ts +3 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/custom-entry.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/custom-entry.js +8 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/custom-entry.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/custom-message.js +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/custom-message.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/settings-selector.js +4 -3
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/skill-invocation-message.d.ts +2 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/skill-invocation-message.js +5 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/status-indicator.d.ts +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/status-indicator.js +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/status-indicator.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts +5 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +10 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +9 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js +103 -40
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/program-status-reporter.d.ts +34 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/program-status-reporter.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/program-status-reporter.js +110 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/program-status-reporter.js.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/dark.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/light.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-schema.d.ts +28 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-schema.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-schema.js +105 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-schema.js.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-tokens.d.ts +257 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-tokens.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-tokens.js +94 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-tokens.js.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts +13 -16
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme.js +22 -29
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/print-mode.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/print-mode.js +4 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/print-mode.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.js +24 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/ansi.d.ts +8 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/ansi.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/ansi.js +30 -11
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/ansi.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/clipboard.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/clipboard.js +18 -12
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/clipboard.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-core.d.ts +12 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-core.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-core.js +5 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-core.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-worker.js +3 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-worker.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize.js +9 -10
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/output-files.d.ts +15 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/output-files.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/output-files.js +30 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/output-files.js.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/syntax-highlight.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/syntax-highlight.js +6 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/syntax-highlight.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/docs/cli-integration.md +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/docs/cli.md +19 -7
- package/node_modules/@earendil-works/pi-coding-agent/docs/codemode.md +30 -9
- package/node_modules/@earendil-works/pi-coding-agent/docs/compaction.md +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/docs/environment-variables.md +3 -1
- package/node_modules/@earendil-works/pi-coding-agent/docs/extensions.md +7 -4
- package/node_modules/@earendil-works/pi-coding-agent/docs/json.md +3 -3
- package/node_modules/@earendil-works/pi-coding-agent/docs/keybindings.md +5 -4
- package/node_modules/@earendil-works/pi-coding-agent/docs/llama-cpp.md +8 -1
- package/node_modules/@earendil-works/pi-coding-agent/docs/mcp.md +4 -2
- package/node_modules/@earendil-works/pi-coding-agent/docs/message-types.md +22 -4
- package/node_modules/@earendil-works/pi-coding-agent/docs/models.md +5 -1
- package/node_modules/@earendil-works/pi-coding-agent/docs/providers.md +47 -0
- package/node_modules/@earendil-works/pi-coding-agent/docs/settings.md +6 -4
- package/node_modules/@earendil-works/pi-coding-agent/docs/terminal-setup.md +14 -0
- package/node_modules/@earendil-works/pi-coding-agent/docs/themes.md +4 -2
- package/node_modules/@earendil-works/pi-coding-agent/docs/tui.md +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/examples/README.md +0 -3
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/dynamic-resources/dynamic.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/gondolin/package-lock.json +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/gondolin/package.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/overlay-test.ts +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/plan-mode/index.ts +6 -2
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/sandbox/package-lock.json +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/sandbox/package.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/with-deps/package-lock.json +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/with-deps/package.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/package.json +10 -21
- package/node_modules/@earendil-works/pi-coding-agent/schemas/keybindings.schema.json +393 -0
- package/node_modules/@earendil-works/pi-coding-agent/schemas/models.schema.json +1157 -0
- package/node_modules/@earendil-works/pi-coding-agent/schemas/settings.schema.json +765 -0
- package/node_modules/@earendil-works/pi-coding-agent/schemas/theme.schema.json +365 -0
- package/node_modules/@earendil-works/pi-durable/CHANGELOG.md +114 -0
- package/node_modules/@earendil-works/pi-durable/README.md +164 -12
- package/node_modules/@earendil-works/pi-durable/dist/codemode/codemode.d.ts +173 -0
- package/node_modules/@earendil-works/pi-durable/dist/codemode/codemode.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/codemode/codemode.js +886 -0
- package/node_modules/@earendil-works/pi-durable/dist/codemode/codemode.js.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/codemode/describe.d.ts +38 -0
- package/node_modules/@earendil-works/pi-durable/dist/codemode/describe.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/codemode/describe.js +119 -0
- package/node_modules/@earendil-works/pi-durable/dist/codemode/describe.js.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/codemode/index.d.ts +3 -0
- package/node_modules/@earendil-works/pi-durable/dist/codemode/index.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/codemode/index.js +3 -0
- package/node_modules/@earendil-works/pi-durable/dist/codemode/index.js.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/codemode/models.d.ts +28 -0
- package/node_modules/@earendil-works/pi-durable/dist/codemode/models.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/codemode/models.js +231 -0
- package/node_modules/@earendil-works/pi-durable/dist/codemode/models.js.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/codemode/output.d.ts +41 -0
- package/node_modules/@earendil-works/pi-durable/dist/codemode/output.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/codemode/output.js +167 -0
- package/node_modules/@earendil-works/pi-durable/dist/codemode/output.js.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/env/decode.d.ts +16 -0
- package/node_modules/@earendil-works/pi-durable/dist/env/decode.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/env/decode.js +28 -0
- package/node_modules/@earendil-works/pi-durable/dist/env/decode.js.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/env/index.d.ts +197 -3
- package/node_modules/@earendil-works/pi-durable/dist/env/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/env/index.js +2 -0
- package/node_modules/@earendil-works/pi-durable/dist/env/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/env/line-scan.d.ts +13 -0
- package/node_modules/@earendil-works/pi-durable/dist/env/line-scan.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/env/line-scan.js +147 -0
- package/node_modules/@earendil-works/pi-durable/dist/env/line-scan.js.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/env/node-watch.d.ts +29 -0
- package/node_modules/@earendil-works/pi-durable/dist/env/node-watch.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/env/node-watch.js +485 -0
- package/node_modules/@earendil-works/pi-durable/dist/env/node-watch.js.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/env/node.d.ts +11 -2
- package/node_modules/@earendil-works/pi-durable/dist/env/node.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/env/node.js +284 -21
- package/node_modules/@earendil-works/pi-durable/dist/env/node.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/errors.d.ts +20 -3
- package/node_modules/@earendil-works/pi-durable/dist/errors.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/errors.js +34 -5
- package/node_modules/@earendil-works/pi-durable/dist/errors.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/agent.d.ts +7 -3
- package/node_modules/@earendil-works/pi-durable/dist/harness/agent.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/agent.js +81 -25
- package/node_modules/@earendil-works/pi-durable/dist/harness/agent.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/compaction.d.ts +6 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/compaction.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/compaction.js +11 -8
- package/node_modules/@earendil-works/pi-durable/dist/harness/compaction.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/context.d.ts +29 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/context.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/context.js +125 -24
- package/node_modules/@earendil-works/pi-durable/dist/harness/context.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/events.d.ts +35 -15
- package/node_modules/@earendil-works/pi-durable/dist/harness/events.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/events.js +77 -23
- package/node_modules/@earendil-works/pi-durable/dist/harness/events.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/generation.d.ts +2 -0
- package/node_modules/@earendil-works/pi-durable/dist/harness/generation.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/generation.js +40 -16
- package/node_modules/@earendil-works/pi-durable/dist/harness/generation.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/harness.d.ts +7 -0
- package/node_modules/@earendil-works/pi-durable/dist/harness/harness.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/harness.js +56 -28
- package/node_modules/@earendil-works/pi-durable/dist/harness/harness.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/inbox.d.ts +16 -4
- package/node_modules/@earendil-works/pi-durable/dist/harness/inbox.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/inbox.js +26 -3
- package/node_modules/@earendil-works/pi-durable/dist/harness/inbox.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/live.d.ts +74 -17
- package/node_modules/@earendil-works/pi-durable/dist/harness/live.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/live.js +66 -14
- package/node_modules/@earendil-works/pi-durable/dist/harness/live.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/output.d.ts +13 -6
- package/node_modules/@earendil-works/pi-durable/dist/harness/output.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/output.js +75 -18
- package/node_modules/@earendil-works/pi-durable/dist/harness/output.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/scheduler.d.ts +18 -5
- package/node_modules/@earendil-works/pi-durable/dist/harness/scheduler.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/scheduler.js +794 -168
- package/node_modules/@earendil-works/pi-durable/dist/harness/scheduler.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/submissions.d.ts +7 -4
- package/node_modules/@earendil-works/pi-durable/dist/harness/submissions.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/submissions.js +32 -13
- package/node_modules/@earendil-works/pi-durable/dist/harness/submissions.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/task-graph.d.ts +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/task-graph.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/task-graph.js +15 -10
- package/node_modules/@earendil-works/pi-durable/dist/harness/task-graph.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/tool.d.ts +45 -5
- package/node_modules/@earendil-works/pi-durable/dist/harness/tool.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/tool.js +400 -67
- package/node_modules/@earendil-works/pi-durable/dist/harness/tool.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/types.d.ts +194 -17
- package/node_modules/@earendil-works/pi-durable/dist/harness/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/util.d.ts +6 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/util.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/util.js +5 -2
- package/node_modules/@earendil-works/pi-durable/dist/harness/util.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/view.d.ts +6 -2
- package/node_modules/@earendil-works/pi-durable/dist/harness/view.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/view.js +22 -12
- package/node_modules/@earendil-works/pi-durable/dist/harness/view.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/images/cloudflare.d.ts +4 -0
- package/node_modules/@earendil-works/pi-durable/dist/images/cloudflare.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/images/cloudflare.js +9 -0
- package/node_modules/@earendil-works/pi-durable/dist/images/cloudflare.js.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/images/exif.d.ts +3 -0
- package/node_modules/@earendil-works/pi-durable/dist/images/exif.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/images/exif.js +71 -0
- package/node_modules/@earendil-works/pi-durable/dist/images/exif.js.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/images/index.d.ts +18 -0
- package/node_modules/@earendil-works/pi-durable/dist/images/index.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/images/index.js +125 -0
- package/node_modules/@earendil-works/pi-durable/dist/images/index.js.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/images/node-worker.d.ts +17 -0
- package/node_modules/@earendil-works/pi-durable/dist/images/node-worker.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/images/node-worker.js +16 -0
- package/node_modules/@earendil-works/pi-durable/dist/images/node-worker.js.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/images/node.d.ts +21 -0
- package/node_modules/@earendil-works/pi-durable/dist/images/node.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/images/node.js +121 -0
- package/node_modules/@earendil-works/pi-durable/dist/images/node.js.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/index.d.ts +7 -7
- package/node_modules/@earendil-works/pi-durable/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/index.js +4 -4
- package/node_modules/@earendil-works/pi-durable/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/search.d.ts +13 -0
- package/node_modules/@earendil-works/pi-durable/dist/search.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/search.js +85 -0
- package/node_modules/@earendil-works/pi-durable/dist/search.js.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/session/observation.d.ts +10 -3
- package/node_modules/@earendil-works/pi-durable/dist/session/observation.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/session/observation.js +24 -34
- package/node_modules/@earendil-works/pi-durable/dist/session/observation.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/session/session.d.ts +71 -6
- package/node_modules/@earendil-works/pi-durable/dist/session/session.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/session/session.js +463 -50
- package/node_modules/@earendil-works/pi-durable/dist/session/session.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/session/transaction.d.ts +2 -0
- package/node_modules/@earendil-works/pi-durable/dist/session/transaction.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/session/transaction.js +19 -1
- package/node_modules/@earendil-works/pi-durable/dist/session/transaction.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/storage/jsonl/storage.d.ts +8 -0
- package/node_modules/@earendil-works/pi-durable/dist/storage/jsonl/storage.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/storage/jsonl/storage.js +2 -1
- package/node_modules/@earendil-works/pi-durable/dist/storage/jsonl/storage.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/storage/memory.d.ts +2 -0
- package/node_modules/@earendil-works/pi-durable/dist/storage/memory.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/storage/memory.js +79 -27
- package/node_modules/@earendil-works/pi-durable/dist/storage/memory.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/storage/scan.d.ts +18 -0
- package/node_modules/@earendil-works/pi-durable/dist/storage/scan.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/storage/scan.js +29 -0
- package/node_modules/@earendil-works/pi-durable/dist/storage/scan.js.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/storage/sqlite/cloudflare.d.ts +46 -0
- package/node_modules/@earendil-works/pi-durable/dist/storage/sqlite/cloudflare.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/storage/sqlite/cloudflare.js +106 -0
- package/node_modules/@earendil-works/pi-durable/dist/storage/sqlite/cloudflare.js.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/storage/sqlite/storage.d.ts +2 -0
- package/node_modules/@earendil-works/pi-durable/dist/storage/sqlite/storage.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/storage/sqlite/storage.js +77 -27
- package/node_modules/@earendil-works/pi-durable/dist/storage/sqlite/storage.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/testing/env-conformance.d.ts +7 -0
- package/node_modules/@earendil-works/pi-durable/dist/testing/env-conformance.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/testing/env-conformance.js +531 -0
- package/node_modules/@earendil-works/pi-durable/dist/testing/env-conformance.js.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/testing/index.d.ts +3 -2
- package/node_modules/@earendil-works/pi-durable/dist/testing/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/testing/index.js +2 -1
- package/node_modules/@earendil-works/pi-durable/dist/testing/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/testing/runner.d.ts +4 -2
- package/node_modules/@earendil-works/pi-durable/dist/testing/runner.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/testing/runner.js +9 -0
- package/node_modules/@earendil-works/pi-durable/dist/testing/runner.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/testing/storage-conformance.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/testing/storage-conformance.js +61 -2
- package/node_modules/@earendil-works/pi-durable/dist/testing/storage-conformance.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/testing/types.d.ts +20 -0
- package/node_modules/@earendil-works/pi-durable/dist/testing/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/testing/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/tool-search/index.d.ts +2 -0
- package/node_modules/@earendil-works/pi-durable/dist/tool-search/index.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/tool-search/index.js +2 -0
- package/node_modules/@earendil-works/pi-durable/dist/tool-search/index.js.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/tool-search/tool-search.d.ts +23 -0
- package/node_modules/@earendil-works/pi-durable/dist/tool-search/tool-search.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/tool-search/tool-search.js +84 -0
- package/node_modules/@earendil-works/pi-durable/dist/tool-search/tool-search.js.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/tools/bash.d.ts +30 -3
- package/node_modules/@earendil-works/pi-durable/dist/tools/bash.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/tools/bash.js +105 -37
- package/node_modules/@earendil-works/pi-durable/dist/tools/bash.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/tools/edit.js +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/tools/edit.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/tools/image-processor.d.ts +47 -0
- package/node_modules/@earendil-works/pi-durable/dist/tools/image-processor.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/tools/image-processor.js +30 -0
- package/node_modules/@earendil-works/pi-durable/dist/tools/image-processor.js.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/tools/image.d.ts +18 -0
- package/node_modules/@earendil-works/pi-durable/dist/tools/image.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/tools/image.js +86 -0
- package/node_modules/@earendil-works/pi-durable/dist/tools/image.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/tools/index.d.ts +26 -3
- package/node_modules/@earendil-works/pi-durable/dist/tools/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/tools/index.js +14 -6
- package/node_modules/@earendil-works/pi-durable/dist/tools/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/tools/read.d.ts +10 -2
- package/node_modules/@earendil-works/pi-durable/dist/tools/read.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/tools/read.js +212 -78
- package/node_modules/@earendil-works/pi-durable/dist/tools/read.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/tools/write.js +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/tools/write.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/truncate.d.ts +9 -0
- package/node_modules/@earendil-works/pi-durable/dist/truncate.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/truncate.js +12 -4
- package/node_modules/@earendil-works/pi-durable/dist/truncate.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/types.d.ts +89 -12
- package/node_modules/@earendil-works/pi-durable/dist/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/package.json +50 -5
- package/node_modules/@earendil-works/pi-mcp/CHANGELOG.md +29 -0
- package/node_modules/@earendil-works/pi-mcp/dist/auth-provider.d.ts +4 -0
- package/node_modules/@earendil-works/pi-mcp/dist/auth-provider.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-mcp/dist/auth-provider.js.map +1 -1
- package/node_modules/@earendil-works/pi-mcp/dist/client.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-mcp/dist/client.js +9 -5
- package/node_modules/@earendil-works/pi-mcp/dist/client.js.map +1 -1
- package/node_modules/@earendil-works/pi-mcp/dist/index.d.ts +1 -1
- package/node_modules/@earendil-works/pi-mcp/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-mcp/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-mcp/dist/oauth/discovery.d.ts +3 -0
- package/node_modules/@earendil-works/pi-mcp/dist/oauth/discovery.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-mcp/dist/oauth/discovery.js +8 -5
- package/node_modules/@earendil-works/pi-mcp/dist/oauth/discovery.js.map +1 -1
- package/node_modules/@earendil-works/pi-mcp/dist/oauth/errors.d.ts +3 -2
- package/node_modules/@earendil-works/pi-mcp/dist/oauth/errors.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-mcp/dist/oauth/errors.js +3 -1
- package/node_modules/@earendil-works/pi-mcp/dist/oauth/errors.js.map +1 -1
- package/node_modules/@earendil-works/pi-mcp/dist/oauth/flow.d.ts +4 -0
- package/node_modules/@earendil-works/pi-mcp/dist/oauth/flow.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-mcp/dist/oauth/flow.js +35 -7
- package/node_modules/@earendil-works/pi-mcp/dist/oauth/flow.js.map +1 -1
- package/node_modules/@earendil-works/pi-mcp/dist/oauth/types.d.ts +5 -0
- package/node_modules/@earendil-works/pi-mcp/dist/oauth/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-mcp/dist/oauth/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-mcp/dist/protocol/content.d.ts +2 -1
- package/node_modules/@earendil-works/pi-mcp/dist/protocol/content.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-mcp/dist/protocol/content.js.map +1 -1
- package/node_modules/@earendil-works/pi-mcp/dist/transports/streamable-http.d.ts +9 -2
- package/node_modules/@earendil-works/pi-mcp/dist/transports/streamable-http.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-mcp/dist/transports/streamable-http.js +28 -19
- package/node_modules/@earendil-works/pi-mcp/dist/transports/streamable-http.js.map +1 -1
- package/node_modules/@earendil-works/pi-mcp/dist/transports/transport.d.ts +9 -1
- package/node_modules/@earendil-works/pi-mcp/dist/transports/transport.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-mcp/dist/transports/transport.js.map +1 -1
- package/node_modules/@earendil-works/pi-mcp/package.json +2 -2
- package/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
- package/node_modules/@earendil-works/pi-tui/README.md +5 -3
- package/node_modules/@earendil-works/pi-tui/dist/components/box.d.ts +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/box.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/box.js +4 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/box.js.map +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 +3 -3
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/input.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/input.js +4 -4
- package/node_modules/@earendil-works/pi-tui/dist/components/input.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/text.d.ts +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/text.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/text.js +4 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/text.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.d.ts +2 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.js +3 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts +4 -4
- package/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/keybindings.js +4 -4
- package/node_modules/@earendil-works/pi-tui/dist/keybindings.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/keys.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/keys.js +52 -20
- package/node_modules/@earendil-works/pi-tui/dist/keys.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/program-status.d.ts +23 -0
- package/node_modules/@earendil-works/pi-tui/dist/program-status.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/program-status.js +43 -0
- package/node_modules/@earendil-works/pi-tui/dist/program-status.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.d.ts +4 -2
- package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.js +36 -1
- package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js +5 -0
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts +17 -0
- package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal.js +46 -2
- package/node_modules/@earendil-works/pi-tui/dist/terminal.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.d.ts +2 -0
- package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.js +8 -4
- package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui-main-screen.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui-main-screen.js +2 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui-main-screen.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts +11 -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 +23 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/utils.js +5 -2
- package/node_modules/@earendil-works/pi-tui/dist/utils.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/package.json +1 -1
- package/node_modules/@silvia-odwyer/photon/LICENSE.md +201 -0
- package/node_modules/@silvia-odwyer/photon/README.md +158 -0
- package/node_modules/@silvia-odwyer/photon/package.json +23 -0
- package/node_modules/@silvia-odwyer/photon/photon_rs.d.ts +3443 -0
- package/node_modules/@silvia-odwyer/photon/photon_rs.js +4572 -0
- package/node_modules/@silvia-odwyer/photon/photon_rs_bg.wasm +0 -0
- package/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/node/crypto.d.ts +2 -2
- package/node_modules/@types/node/dgram.d.ts +1 -1
- package/node_modules/@types/node/package.json +2 -2
- package/node_modules/@types/node/util.d.ts +6 -3
- package/node_modules/@types/node/zlib.d.ts +6 -0
- package/node_modules/hono/README.md +1 -1
- package/node_modules/hono/dist/_virtual/_rolldown/runtime.js +13 -0
- package/node_modules/hono/dist/adapter/aws-lambda/conninfo.js +42 -23
- package/node_modules/hono/dist/adapter/aws-lambda/handler.js +320 -342
- package/node_modules/hono/dist/adapter/aws-lambda/index.js +2 -8
- package/node_modules/hono/dist/adapter/aws-lambda/types.js +1 -0
- package/node_modules/hono/dist/adapter/bun/conninfo.js +20 -25
- package/node_modules/hono/dist/adapter/bun/index.js +3 -13
- package/node_modules/hono/dist/adapter/bun/serve-static.js +27 -27
- package/node_modules/hono/dist/adapter/bun/server.js +11 -5
- package/node_modules/hono/dist/adapter/bun/ssg.js +25 -15
- package/node_modules/hono/dist/adapter/bun/websocket.js +61 -68
- package/node_modules/hono/dist/adapter/cloudflare-pages/conninfo.js +24 -9
- package/node_modules/hono/dist/adapter/cloudflare-pages/handler.js +59 -62
- package/node_modules/hono/dist/adapter/cloudflare-pages/index.js +2 -8
- package/node_modules/hono/dist/adapter/cloudflare-workers/conninfo.js +7 -9
- package/node_modules/hono/dist/adapter/cloudflare-workers/index.js +3 -8
- package/node_modules/hono/dist/adapter/cloudflare-workers/serve-static-module.js +5 -6
- package/node_modules/hono/dist/adapter/cloudflare-workers/serve-static.js +26 -20
- package/node_modules/hono/dist/adapter/cloudflare-workers/utils.js +21 -34
- package/node_modules/hono/dist/adapter/cloudflare-workers/websocket.js +31 -39
- package/node_modules/hono/dist/adapter/deno/conninfo.js +16 -13
- package/node_modules/hono/dist/adapter/deno/deno.d.js +1 -0
- package/node_modules/hono/dist/adapter/deno/index.js +3 -10
- package/node_modules/hono/dist/adapter/deno/serve-static.js +33 -38
- package/node_modules/hono/dist/adapter/deno/ssg.js +27 -16
- package/node_modules/hono/dist/adapter/deno/websocket.js +30 -30
- package/node_modules/hono/dist/adapter/lambda-edge/conninfo.js +7 -9
- package/node_modules/hono/dist/adapter/lambda-edge/handler.js +102 -87
- package/node_modules/hono/dist/adapter/lambda-edge/index.js +2 -6
- package/node_modules/hono/dist/adapter/netlify/conninfo.js +24 -9
- package/node_modules/hono/dist/adapter/netlify/handler.js +10 -8
- package/node_modules/hono/dist/adapter/netlify/index.js +3 -2
- package/node_modules/hono/dist/adapter/netlify/mod.js +2 -6
- package/node_modules/hono/dist/adapter/service-worker/handler.js +15 -19
- package/node_modules/hono/dist/adapter/service-worker/index.js +23 -7
- package/node_modules/hono/dist/adapter/service-worker/types.js +1 -0
- package/node_modules/hono/dist/adapter/vercel/conninfo.js +7 -10
- package/node_modules/hono/dist/adapter/vercel/handler.js +8 -6
- package/node_modules/hono/dist/adapter/vercel/index.js +2 -6
- package/node_modules/hono/dist/cjs/_virtual/_rolldown/runtime.js +33 -0
- package/node_modules/hono/dist/cjs/adapter/aws-lambda/conninfo.js +42 -44
- package/node_modules/hono/dist/cjs/adapter/aws-lambda/handler.js +328 -371
- package/node_modules/hono/dist/cjs/adapter/aws-lambda/index.js +7 -34
- package/node_modules/hono/dist/cjs/adapter/aws-lambda/types.js +0 -15
- package/node_modules/hono/dist/cjs/adapter/bun/conninfo.js +21 -47
- package/node_modules/hono/dist/cjs/adapter/bun/index.js +14 -45
- package/node_modules/hono/dist/cjs/adapter/bun/serve-static.js +29 -50
- package/node_modules/hono/dist/cjs/adapter/bun/server.js +11 -26
- package/node_modules/hono/dist/cjs/adapter/bun/ssg.js +24 -35
- package/node_modules/hono/dist/cjs/adapter/bun/websocket.js +63 -91
- package/node_modules/hono/dist/cjs/adapter/cloudflare-pages/conninfo.js +25 -31
- package/node_modules/hono/dist/cjs/adapter/cloudflare-pages/handler.js +61 -85
- package/node_modules/hono/dist/cjs/adapter/cloudflare-pages/index.js +7 -34
- package/node_modules/hono/dist/cjs/adapter/cloudflare-workers/conninfo.js +8 -31
- package/node_modules/hono/dist/cjs/adapter/cloudflare-workers/index.js +7 -33
- package/node_modules/hono/dist/cjs/adapter/cloudflare-workers/serve-static-module.js +7 -29
- package/node_modules/hono/dist/cjs/adapter/cloudflare-workers/serve-static.js +27 -42
- package/node_modules/hono/dist/cjs/adapter/cloudflare-workers/utils.js +21 -55
- package/node_modules/hono/dist/cjs/adapter/cloudflare-workers/websocket.js +33 -62
- package/node_modules/hono/dist/cjs/adapter/deno/conninfo.js +16 -34
- package/node_modules/hono/dist/cjs/adapter/deno/index.js +10 -38
- package/node_modules/hono/dist/cjs/adapter/deno/serve-static.js +33 -59
- package/node_modules/hono/dist/cjs/adapter/deno/ssg.js +27 -37
- package/node_modules/hono/dist/cjs/adapter/deno/websocket.js +32 -53
- package/node_modules/hono/dist/cjs/adapter/lambda-edge/conninfo.js +8 -31
- package/node_modules/hono/dist/cjs/adapter/lambda-edge/handler.js +105 -119
- package/node_modules/hono/dist/cjs/adapter/lambda-edge/index.js +5 -30
- package/node_modules/hono/dist/cjs/adapter/netlify/conninfo.js +25 -31
- package/node_modules/hono/dist/cjs/adapter/netlify/handler.js +10 -29
- package/node_modules/hono/dist/cjs/adapter/netlify/index.js +5 -21
- package/node_modules/hono/dist/cjs/adapter/netlify/mod.js +5 -30
- package/node_modules/hono/dist/cjs/adapter/service-worker/handler.js +16 -41
- package/node_modules/hono/dist/cjs/adapter/service-worker/index.js +25 -30
- package/node_modules/hono/dist/cjs/adapter/service-worker/types.js +0 -15
- package/node_modules/hono/dist/cjs/adapter/vercel/conninfo.js +8 -32
- package/node_modules/hono/dist/cjs/adapter/vercel/handler.js +8 -27
- package/node_modules/hono/dist/cjs/adapter/vercel/index.js +5 -30
- package/node_modules/hono/dist/cjs/client/client.js +139 -212
- package/node_modules/hono/dist/cjs/client/fetch-result-please.js +62 -80
- package/node_modules/hono/dist/cjs/client/index.js +7 -32
- package/node_modules/hono/dist/cjs/client/types.js +0 -15
- package/node_modules/hono/dist/cjs/client/utils.js +54 -92
- package/node_modules/hono/dist/cjs/compose.js +49 -66
- package/node_modules/hono/dist/cjs/context.js +379 -450
- package/node_modules/hono/dist/cjs/helper/accepts/accepts.js +47 -70
- package/node_modules/hono/dist/cjs/helper/accepts/index.js +3 -27
- package/node_modules/hono/dist/cjs/helper/adapter/index.js +33 -73
- package/node_modules/hono/dist/cjs/helper/conninfo/index.js +0 -15
- package/node_modules/hono/dist/cjs/helper/conninfo/types.js +0 -15
- package/node_modules/hono/dist/cjs/helper/cookie/index.js +75 -116
- package/node_modules/hono/dist/cjs/helper/css/common.js +165 -244
- package/node_modules/hono/dist/cjs/helper/css/index.js +136 -151
- package/node_modules/hono/dist/cjs/helper/dev/index.js +45 -71
- package/node_modules/hono/dist/cjs/helper/factory/index.js +30 -51
- package/node_modules/hono/dist/cjs/helper/html/index.js +32 -62
- package/node_modules/hono/dist/cjs/helper/proxy/index.js +113 -106
- package/node_modules/hono/dist/cjs/helper/route/index.js +123 -66
- package/node_modules/hono/dist/cjs/helper/ssg/index.js +19 -43
- package/node_modules/hono/dist/cjs/helper/ssg/middleware.js +56 -64
- package/node_modules/hono/dist/cjs/helper/ssg/plugins.js +55 -57
- package/node_modules/hono/dist/cjs/helper/ssg/ssg.js +196 -296
- package/node_modules/hono/dist/cjs/helper/ssg/utils.js +47 -90
- package/node_modules/hono/dist/cjs/helper/streaming/index.js +8 -35
- package/node_modules/hono/dist/cjs/helper/streaming/sse.js +53 -85
- package/node_modules/hono/dist/cjs/helper/streaming/stream.js +23 -53
- package/node_modules/hono/dist/cjs/helper/streaming/text.js +10 -32
- package/node_modules/hono/dist/cjs/helper/streaming/utils.js +13 -32
- package/node_modules/hono/dist/cjs/helper/testing/index.js +16 -31
- package/node_modules/hono/dist/cjs/helper/websocket/index.js +51 -76
- package/node_modules/hono/dist/cjs/hono-base.js +345 -403
- package/node_modules/hono/dist/cjs/hono.js +28 -42
- package/node_modules/hono/dist/cjs/http-exception.js +55 -56
- package/node_modules/hono/dist/cjs/index.js +22 -30
- package/node_modules/hono/dist/cjs/jsx/base.js +237 -366
- package/node_modules/hono/dist/cjs/jsx/children.js +16 -41
- package/node_modules/hono/dist/cjs/jsx/components.js +119 -192
- package/node_modules/hono/dist/cjs/jsx/constants.js +15 -42
- package/node_modules/hono/dist/cjs/jsx/context.js +144 -162
- package/node_modules/hono/dist/cjs/jsx/dom/client.js +49 -69
- package/node_modules/hono/dist/cjs/jsx/dom/components.js +23 -52
- package/node_modules/hono/dist/cjs/jsx/dom/context.js +39 -67
- package/node_modules/hono/dist/cjs/jsx/dom/css.js +143 -158
- package/node_modules/hono/dist/cjs/jsx/dom/hooks/index.js +55 -64
- package/node_modules/hono/dist/cjs/jsx/dom/index.js +114 -173
- package/node_modules/hono/dist/cjs/jsx/dom/intrinsic-element/components.js +282 -375
- package/node_modules/hono/dist/cjs/jsx/dom/jsx-dev-runtime.js +14 -49
- package/node_modules/hono/dist/cjs/jsx/dom/jsx-runtime.js +5 -32
- package/node_modules/hono/dist/cjs/jsx/dom/render.js +471 -589
- package/node_modules/hono/dist/cjs/jsx/dom/server.js +37 -64
- package/node_modules/hono/dist/cjs/jsx/dom/utils.js +7 -30
- package/node_modules/hono/dist/cjs/jsx/hooks/index.js +225 -318
- package/node_modules/hono/dist/cjs/jsx/index.js +86 -135
- package/node_modules/hono/dist/cjs/jsx/intrinsic-element/common.js +20 -43
- package/node_modules/hono/dist/cjs/jsx/intrinsic-element/components.js +117 -168
- package/node_modules/hono/dist/cjs/jsx/intrinsic-elements.js +0 -15
- package/node_modules/hono/dist/cjs/jsx/jsx-dev-runtime.js +14 -39
- package/node_modules/hono/dist/cjs/jsx/jsx-runtime.js +34 -68
- package/node_modules/hono/dist/cjs/jsx/streaming.js +123 -166
- package/node_modules/hono/dist/cjs/jsx/types.js +0 -15
- package/node_modules/hono/dist/cjs/jsx/utils.js +91 -175
- package/node_modules/hono/dist/cjs/middleware/basic-auth/index.js +98 -86
- package/node_modules/hono/dist/cjs/middleware/bearer-auth/index.js +92 -109
- package/node_modules/hono/dist/cjs/middleware/body-limit/index.js +66 -72
- package/node_modules/hono/dist/cjs/middleware/cache/index.js +153 -199
- package/node_modules/hono/dist/cjs/middleware/combine/index.js +133 -95
- package/node_modules/hono/dist/cjs/middleware/compress/index.js +73 -88
- package/node_modules/hono/dist/cjs/middleware/context-storage/index.js +49 -41
- package/node_modules/hono/dist/cjs/middleware/cors/index.js +107 -107
- package/node_modules/hono/dist/cjs/middleware/csrf/index.js +101 -72
- package/node_modules/hono/dist/cjs/middleware/etag/digest.js +58 -97
- package/node_modules/hono/dist/cjs/middleware/etag/index.js +71 -91
- package/node_modules/hono/dist/cjs/middleware/ip-restriction/index.js +161 -169
- package/node_modules/hono/dist/cjs/middleware/jsx-renderer/index.js +99 -77
- package/node_modules/hono/dist/cjs/middleware/jwk/index.js +3 -27
- package/node_modules/hono/dist/cjs/middleware/jwk/jwk.js +118 -135
- package/node_modules/hono/dist/cjs/middleware/jwt/index.js +9 -38
- package/node_modules/hono/dist/cjs/middleware/jwt/jwt.js +120 -141
- package/node_modules/hono/dist/cjs/middleware/language/index.js +7 -35
- package/node_modules/hono/dist/cjs/middleware/language/language.js +184 -179
- package/node_modules/hono/dist/cjs/middleware/logger/index.js +41 -62
- package/node_modules/hono/dist/cjs/middleware/method-not-allowed/index.js +82 -88
- package/node_modules/hono/dist/cjs/middleware/method-override/index.js +101 -102
- package/node_modules/hono/dist/cjs/middleware/powered-by/index.js +23 -30
- package/node_modules/hono/dist/cjs/middleware/pretty-json/index.js +38 -36
- package/node_modules/hono/dist/cjs/middleware/request-id/index.js +3 -27
- package/node_modules/hono/dist/cjs/middleware/request-id/request-id.js +34 -42
- package/node_modules/hono/dist/cjs/middleware/secure-headers/index.js +4 -29
- package/node_modules/hono/dist/cjs/middleware/secure-headers/permissions-policy.js +0 -15
- package/node_modules/hono/dist/cjs/middleware/secure-headers/secure-headers.js +142 -174
- package/node_modules/hono/dist/cjs/middleware/serve-static/index.js +56 -93
- package/node_modules/hono/dist/cjs/middleware/serve-static/path.js +15 -38
- package/node_modules/hono/dist/cjs/middleware/timeout/index.js +40 -45
- package/node_modules/hono/dist/cjs/middleware/timing/index.js +7 -35
- package/node_modules/hono/dist/cjs/middleware/timing/timing.js +177 -118
- package/node_modules/hono/dist/cjs/middleware/trailing-slash/index.js +85 -58
- package/node_modules/hono/dist/cjs/preset/quick.js +18 -37
- package/node_modules/hono/dist/cjs/preset/tiny.js +15 -33
- package/node_modules/hono/dist/cjs/request/constants.js +5 -27
- package/node_modules/hono/dist/cjs/request.js +334 -343
- package/node_modules/hono/dist/cjs/router/linear-router/index.js +3 -27
- package/node_modules/hono/dist/cjs/router/linear-router/router.js +95 -143
- package/node_modules/hono/dist/cjs/router/pattern-router/index.js +3 -27
- package/node_modules/hono/dist/cjs/router/pattern-router/router.js +41 -63
- package/node_modules/hono/dist/cjs/router/reg-exp-router/index.js +7 -34
- package/node_modules/hono/dist/cjs/router/reg-exp-router/matcher.js +18 -45
- package/node_modules/hono/dist/cjs/router/reg-exp-router/node.js +91 -135
- package/node_modules/hono/dist/cjs/router/reg-exp-router/prepared-router.js +92 -161
- package/node_modules/hono/dist/cjs/router/reg-exp-router/router.js +98 -147
- package/node_modules/hono/dist/cjs/router/reg-exp-router/trie.js +73 -89
- package/node_modules/hono/dist/cjs/router/smart-router/index.js +3 -27
- package/node_modules/hono/dist/cjs/router/smart-router/router.js +49 -79
- package/node_modules/hono/dist/cjs/router/trie-router/index.js +3 -27
- package/node_modules/hono/dist/cjs/router/trie-router/node.js +134 -186
- package/node_modules/hono/dist/cjs/router/trie-router/router.js +15 -39
- package/node_modules/hono/dist/cjs/router/utils.js +5 -27
- package/node_modules/hono/dist/cjs/router.js +37 -37
- package/node_modules/hono/dist/cjs/types.js +5 -28
- package/node_modules/hono/dist/cjs/utils/accept.js +177 -228
- package/node_modules/hono/dist/cjs/utils/basic-auth.js +16 -40
- package/node_modules/hono/dist/cjs/utils/body.js +84 -110
- package/node_modules/hono/dist/cjs/utils/buffer.js +43 -91
- package/node_modules/hono/dist/cjs/utils/color.js +35 -44
- package/node_modules/hono/dist/cjs/utils/compress.js +11 -26
- package/node_modules/hono/dist/cjs/utils/concurrent.js +29 -59
- package/node_modules/hono/dist/cjs/utils/constants.js +7 -26
- package/node_modules/hono/dist/cjs/utils/cookie.js +107 -177
- package/node_modules/hono/dist/cjs/utils/crypto.js +30 -61
- package/node_modules/hono/dist/cjs/utils/encode.js +31 -48
- package/node_modules/hono/dist/cjs/utils/filepath.js +23 -54
- package/node_modules/hono/dist/cjs/utils/handler.js +11 -33
- package/node_modules/hono/dist/cjs/utils/headers.js +0 -15
- package/node_modules/hono/dist/cjs/utils/html.js +96 -137
- package/node_modules/hono/dist/cjs/utils/http-status.js +0 -15
- package/node_modules/hono/dist/cjs/utils/ipaddr.js +213 -286
- package/node_modules/hono/dist/cjs/utils/jwt/index.js +14 -27
- package/node_modules/hono/dist/cjs/utils/jwt/jwa.js +25 -42
- package/node_modules/hono/dist/cjs/utils/jwt/jws.js +119 -199
- package/node_modules/hono/dist/cjs/utils/jwt/jwt.js +122 -205
- package/node_modules/hono/dist/cjs/utils/jwt/types.js +122 -159
- package/node_modules/hono/dist/cjs/utils/jwt/utf8.js +9 -28
- package/node_modules/hono/dist/cjs/utils/mime.js +75 -101
- package/node_modules/hono/dist/cjs/utils/stream.js +88 -111
- package/node_modules/hono/dist/cjs/utils/types.js +0 -15
- package/node_modules/hono/dist/cjs/utils/url.js +185 -234
- package/node_modules/hono/dist/cjs/validator/index.js +3 -27
- package/node_modules/hono/dist/cjs/validator/utils.js +0 -15
- package/node_modules/hono/dist/cjs/validator/validator.js +60 -103
- package/node_modules/hono/dist/client/client.js +138 -197
- package/node_modules/hono/dist/client/fetch-result-please.js +59 -56
- package/node_modules/hono/dist/client/index.js +3 -7
- package/node_modules/hono/dist/client/types.js +1 -0
- package/node_modules/hono/dist/client/utils.js +51 -68
- package/node_modules/hono/dist/compose.js +49 -45
- package/node_modules/hono/dist/context.js +376 -426
- package/node_modules/hono/dist/helper/accepts/accepts.js +47 -49
- package/node_modules/hono/dist/helper/accepts/index.js +1 -4
- package/node_modules/hono/dist/helper/adapter/index.js +33 -52
- package/node_modules/hono/dist/helper/conninfo/index.js +1 -0
- package/node_modules/hono/dist/helper/conninfo/types.js +1 -0
- package/node_modules/hono/dist/helper/cookie/index.js +74 -94
- package/node_modules/hono/dist/helper/css/common.js +167 -225
- package/node_modules/hono/dist/helper/css/index.js +132 -137
- package/node_modules/hono/dist/helper/dev/index.js +44 -49
- package/node_modules/hono/dist/helper/factory/index.js +27 -27
- package/node_modules/hono/dist/helper/html/index.js +30 -39
- package/node_modules/hono/dist/helper/proxy/index.js +116 -88
- package/node_modules/hono/dist/helper/route/index.js +121 -43
- package/node_modules/hono/dist/helper/ssg/index.js +3 -18
- package/node_modules/hono/dist/helper/ssg/middleware.js +53 -40
- package/node_modules/hono/dist/helper/ssg/plugins.js +55 -36
- package/node_modules/hono/dist/helper/ssg/ssg.js +198 -283
- package/node_modules/hono/dist/helper/ssg/utils.js +53 -75
- package/node_modules/hono/dist/helper/streaming/index.js +2 -8
- package/node_modules/hono/dist/helper/streaming/sse.js +50 -61
- package/node_modules/hono/dist/helper/streaming/stream.js +22 -31
- package/node_modules/hono/dist/helper/streaming/text.js +9 -10
- package/node_modules/hono/dist/helper/streaming/utils.js +9 -12
- package/node_modules/hono/dist/helper/testing/index.js +16 -10
- package/node_modules/hono/dist/helper/websocket/index.js +49 -53
- package/node_modules/hono/dist/hono-base.js +342 -379
- package/node_modules/hono/dist/hono.js +27 -20
- package/node_modules/hono/dist/http-exception.js +53 -33
- package/node_modules/hono/dist/index.js +19 -6
- package/node_modules/hono/dist/jsx/base.js +231 -340
- package/node_modules/hono/dist/jsx/children.js +16 -20
- package/node_modules/hono/dist/jsx/components.js +118 -170
- package/node_modules/hono/dist/jsx/constants.js +9 -15
- package/node_modules/hono/dist/jsx/context.js +153 -150
- package/node_modules/hono/dist/jsx/dom/client.js +45 -48
- package/node_modules/hono/dist/jsx/dom/components.js +21 -29
- package/node_modules/hono/dist/jsx/dom/context.js +37 -44
- package/node_modules/hono/dist/jsx/dom/css.js +142 -147
- package/node_modules/hono/dist/jsx/dom/hooks/index.js +52 -40
- package/node_modules/hono/dist/jsx/dom/index.js +71 -134
- package/node_modules/hono/dist/jsx/dom/intrinsic-element/components.js +275 -359
- package/node_modules/hono/dist/jsx/dom/jsx-dev-runtime.js +14 -18
- package/node_modules/hono/dist/jsx/dom/jsx-runtime.js +2 -8
- package/node_modules/hono/dist/jsx/dom/render.js +492 -595
- package/node_modules/hono/dist/jsx/dom/server.js +32 -32
- package/node_modules/hono/dist/jsx/dom/utils.js +6 -8
- package/node_modules/hono/dist/jsx/hooks/index.js +236 -308
- package/node_modules/hono/dist/jsx/index.js +45 -98
- package/node_modules/hono/dist/jsx/intrinsic-element/common.js +20 -22
- package/node_modules/hono/dist/jsx/intrinsic-element/components.js +113 -154
- package/node_modules/hono/dist/jsx/intrinsic-elements.js +1 -0
- package/node_modules/hono/dist/jsx/jsx-dev-runtime.js +12 -16
- package/node_modules/hono/dist/jsx/jsx-runtime.js +29 -42
- package/node_modules/hono/dist/jsx/streaming.js +120 -142
- package/node_modules/hono/dist/jsx/types.js +1 -0
- package/node_modules/hono/dist/jsx/utils.js +105 -168
- package/node_modules/hono/dist/middleware/basic-auth/index.js +96 -63
- package/node_modules/hono/dist/middleware/bearer-auth/index.js +93 -89
- package/node_modules/hono/dist/middleware/body-limit/index.js +66 -51
- package/node_modules/hono/dist/middleware/cache/index.js +165 -190
- package/node_modules/hono/dist/middleware/combine/index.js +132 -73
- package/node_modules/hono/dist/middleware/compress/index.js +75 -69
- package/node_modules/hono/dist/middleware/context-storage/index.js +49 -19
- package/node_modules/hono/dist/middleware/cors/index.js +107 -86
- package/node_modules/hono/dist/middleware/csrf/index.js +103 -53
- package/node_modules/hono/dist/middleware/etag/digest.js +59 -77
- package/node_modules/hono/dist/middleware/etag/index.js +71 -70
- package/node_modules/hono/dist/middleware/ip-restriction/index.js +163 -158
- package/node_modules/hono/dist/middleware/jsx-renderer/index.js +97 -54
- package/node_modules/hono/dist/middleware/jwk/index.js +1 -4
- package/node_modules/hono/dist/middleware/jwk/jwk.js +116 -112
- package/node_modules/hono/dist/middleware/jwt/index.js +2 -10
- package/node_modules/hono/dist/middleware/jwt/jwt.js +114 -114
- package/node_modules/hono/dist/middleware/language/index.js +2 -15
- package/node_modules/hono/dist/middleware/language/language.js +180 -154
- package/node_modules/hono/dist/middleware/logger/index.js +43 -37
- package/node_modules/hono/dist/middleware/method-not-allowed/index.js +81 -66
- package/node_modules/hono/dist/middleware/method-override/index.js +101 -81
- package/node_modules/hono/dist/middleware/powered-by/index.js +23 -9
- package/node_modules/hono/dist/middleware/pretty-json/index.js +39 -16
- package/node_modules/hono/dist/middleware/request-id/index.js +1 -4
- package/node_modules/hono/dist/middleware/request-id/request-id.js +33 -20
- package/node_modules/hono/dist/middleware/secure-headers/index.js +1 -5
- package/node_modules/hono/dist/middleware/secure-headers/permissions-policy.js +1 -0
- package/node_modules/hono/dist/middleware/secure-headers/secure-headers.js +144 -155
- package/node_modules/hono/dist/middleware/serve-static/index.js +56 -72
- package/node_modules/hono/dist/middleware/serve-static/path.js +15 -17
- package/node_modules/hono/dist/middleware/timeout/index.js +40 -23
- package/node_modules/hono/dist/middleware/timing/index.js +2 -9
- package/node_modules/hono/dist/middleware/timing/timing.js +177 -97
- package/node_modules/hono/dist/middleware/trailing-slash/index.js +85 -37
- package/node_modules/hono/dist/preset/quick.js +17 -15
- package/node_modules/hono/dist/preset/tiny.js +14 -11
- package/node_modules/hono/dist/request/constants.js +4 -5
- package/node_modules/hono/dist/request.js +328 -316
- package/node_modules/hono/dist/router/linear-router/index.js +1 -4
- package/node_modules/hono/dist/router/linear-router/router.js +93 -120
- package/node_modules/hono/dist/router/pattern-router/index.js +1 -4
- package/node_modules/hono/dist/router/pattern-router/router.js +39 -40
- package/node_modules/hono/dist/router/reg-exp-router/index.js +1 -7
- package/node_modules/hono/dist/router/reg-exp-router/matcher.js +17 -23
- package/node_modules/hono/dist/router/reg-exp-router/node.js +87 -110
- package/node_modules/hono/dist/router/reg-exp-router/prepared-router.js +89 -137
- package/node_modules/hono/dist/router/reg-exp-router/router.js +92 -129
- package/node_modules/hono/dist/router/reg-exp-router/trie.js +69 -64
- package/node_modules/hono/dist/router/smart-router/index.js +1 -4
- package/node_modules/hono/dist/router/smart-router/router.js +46 -55
- package/node_modules/hono/dist/router/trie-router/index.js +1 -4
- package/node_modules/hono/dist/router/trie-router/node.js +131 -162
- package/node_modules/hono/dist/router/trie-router/router.js +11 -14
- package/node_modules/hono/dist/router/utils.js +4 -5
- package/node_modules/hono/dist/router.js +35 -14
- package/node_modules/hono/dist/types/adapter/aws-lambda/conninfo.d.ts +4 -1
- package/node_modules/hono/dist/types/adapter/aws-lambda/handler.d.ts +150 -105
- package/node_modules/hono/dist/types/adapter/aws-lambda/index.d.ts +4 -8
- package/node_modules/hono/dist/types/adapter/aws-lambda/types.d.ts +152 -123
- package/node_modules/hono/dist/types/adapter/bun/conninfo.d.ts +4 -1
- package/node_modules/hono/dist/types/adapter/bun/index.d.ts +6 -10
- package/node_modules/hono/dist/types/adapter/bun/serve-static.d.ts +7 -2
- package/node_modules/hono/dist/types/adapter/bun/server.d.ts +4 -5
- package/node_modules/hono/dist/types/adapter/bun/ssg.d.ts +5 -1
- package/node_modules/hono/dist/types/adapter/bun/websocket.d.ts +31 -17
- package/node_modules/hono/dist/types/adapter/cloudflare-pages/conninfo.d.ts +4 -1
- package/node_modules/hono/dist/types/adapter/cloudflare-pages/handler.d.ts +29 -18
- package/node_modules/hono/dist/types/adapter/cloudflare-pages/index.d.ts +3 -7
- package/node_modules/hono/dist/types/adapter/cloudflare-workers/conninfo.d.ts +6 -1
- package/node_modules/hono/dist/types/adapter/cloudflare-workers/index.d.ts +4 -7
- package/node_modules/hono/dist/types/adapter/cloudflare-workers/serve-static-module.d.ts +5 -3
- package/node_modules/hono/dist/types/adapter/cloudflare-workers/serve-static.d.ts +10 -5
- package/node_modules/hono/dist/types/adapter/cloudflare-workers/utils.d.ts +10 -2
- package/node_modules/hono/dist/types/adapter/cloudflare-workers/websocket.d.ts +6 -1
- package/node_modules/hono/dist/types/adapter/deno/conninfo.d.ts +4 -1
- package/node_modules/hono/dist/types/adapter/deno/deno.d.ts +1 -0
- package/node_modules/hono/dist/types/adapter/deno/index.d.ts +5 -8
- package/node_modules/hono/dist/types/adapter/deno/serve-static.d.ts +7 -2
- package/node_modules/hono/dist/types/adapter/deno/ssg.d.ts +5 -1
- package/node_modules/hono/dist/types/adapter/deno/websocket.d.ts +6 -1
- package/node_modules/hono/dist/types/adapter/lambda-edge/conninfo.d.ts +6 -1
- package/node_modules/hono/dist/types/adapter/lambda-edge/handler.d.ts +83 -58
- package/node_modules/hono/dist/types/adapter/lambda-edge/index.d.ts +3 -7
- package/node_modules/hono/dist/types/adapter/netlify/conninfo.d.ts +4 -1
- package/node_modules/hono/dist/types/adapter/netlify/handler.d.ts +6 -1
- package/node_modules/hono/dist/types/adapter/netlify/index.d.ts +3 -5
- package/node_modules/hono/dist/types/adapter/netlify/mod.d.ts +3 -2
- package/node_modules/hono/dist/types/adapter/service-worker/handler.d.ts +9 -8
- package/node_modules/hono/dist/types/adapter/service-worker/index.d.ts +6 -9
- package/node_modules/hono/dist/types/adapter/service-worker/types.d.ts +12 -8
- package/node_modules/hono/dist/types/adapter/vercel/conninfo.d.ts +6 -1
- package/node_modules/hono/dist/types/adapter/vercel/handler.d.ts +6 -1
- package/node_modules/hono/dist/types/adapter/vercel/index.d.ts +3 -6
- package/node_modules/hono/dist/types/client/client.d.ts +5 -3
- package/node_modules/hono/dist/types/client/fetch-result-please.d.ts +21 -19
- package/node_modules/hono/dist/types/client/index.d.ts +5 -7
- package/node_modules/hono/dist/types/client/types.d.ts +134 -160
- package/node_modules/hono/dist/types/client/utils.d.ts +6 -4
- package/node_modules/hono/dist/types/compose.d.ts +4 -2
- package/node_modules/hono/dist/types/context.d.ts +335 -336
- package/node_modules/hono/dist/types/helper/accepts/accepts.d.ts +11 -9
- package/node_modules/hono/dist/types/helper/accepts/index.d.ts +2 -5
- package/node_modules/hono/dist/types/helper/adapter/index.d.ts +4 -6
- package/node_modules/hono/dist/types/helper/conninfo/index.d.ts +2 -5
- package/node_modules/hono/dist/types/helper/conninfo/types.d.ts +25 -23
- package/node_modules/hono/dist/types/helper/cookie/index.d.ts +10 -13
- package/node_modules/hono/dist/types/helper/css/common.d.ts +11 -10
- package/node_modules/hono/dist/types/helper/css/index.d.ts +25 -28
- package/node_modules/hono/dist/types/helper/dev/index.d.ts +10 -13
- package/node_modules/hono/dist/types/helper/factory/index.d.ts +26 -74
- package/node_modules/hono/dist/types/helper/html/index.d.ts +4 -7
- package/node_modules/hono/dist/types/helper/proxy/index.d.ts +20 -23
- package/node_modules/hono/dist/types/helper/route/index.d.ts +6 -4
- package/node_modules/hono/dist/types/helper/ssg/index.d.ts +4 -7
- package/node_modules/hono/dist/types/helper/ssg/middleware.d.ts +8 -7
- package/node_modules/hono/dist/types/helper/ssg/plugins.d.ts +3 -1
- package/node_modules/hono/dist/types/helper/ssg/ssg.d.ts +38 -36
- package/node_modules/hono/dist/types/helper/ssg/utils.d.ts +5 -4
- package/node_modules/hono/dist/types/helper/streaming/index.d.ts +4 -8
- package/node_modules/hono/dist/types/helper/streaming/sse.d.ts +10 -8
- package/node_modules/hono/dist/types/helper/streaming/stream.d.ts +4 -2
- package/node_modules/hono/dist/types/helper/streaming/text.d.ts +4 -2
- package/node_modules/hono/dist/types/helper/streaming/utils.d.ts +2 -0
- package/node_modules/hono/dist/types/helper/testing/index.d.ts +7 -10
- package/node_modules/hono/dist/types/helper/websocket/index.d.ts +30 -33
- package/node_modules/hono/dist/types/hono-base.d.ts +208 -211
- package/node_modules/hono/dist/types/hono.d.ts +11 -10
- package/node_modules/hono/dist/types/http-exception.d.ts +20 -23
- package/node_modules/hono/dist/types/index.d.ts +6 -37
- package/node_modules/hono/dist/types/jsx/base.d.ts +36 -35
- package/node_modules/hono/dist/types/jsx/children.d.ts +8 -6
- package/node_modules/hono/dist/types/jsx/components.d.ts +8 -5
- package/node_modules/hono/dist/types/jsx/constants.d.ts +2 -0
- package/node_modules/hono/dist/types/jsx/context.d.ts +9 -7
- package/node_modules/hono/dist/types/jsx/dom/client.d.ts +8 -10
- package/node_modules/hono/dist/types/jsx/dom/components.d.ts +9 -6
- package/node_modules/hono/dist/types/jsx/dom/context.d.ts +3 -1
- package/node_modules/hono/dist/types/jsx/dom/css.d.ts +26 -30
- package/node_modules/hono/dist/types/jsx/dom/hooks/index.d.ts +11 -13
- package/node_modules/hono/dist/types/jsx/dom/index.d.ts +78 -83
- package/node_modules/hono/dist/types/jsx/dom/intrinsic-element/components.d.ts +9 -5
- package/node_modules/hono/dist/types/jsx/dom/jsx-dev-runtime.d.ts +4 -6
- package/node_modules/hono/dist/types/jsx/dom/jsx-runtime.d.ts +3 -7
- package/node_modules/hono/dist/types/jsx/dom/render.d.ts +32 -51
- package/node_modules/hono/dist/types/jsx/dom/server.d.ts +86 -85
- package/node_modules/hono/dist/types/jsx/dom/utils.d.ts +2 -0
- package/node_modules/hono/dist/types/jsx/hooks/index.d.ts +16 -17
- package/node_modules/hono/dist/types/jsx/index.d.ts +70 -73
- package/node_modules/hono/dist/types/jsx/intrinsic-element/common.d.ts +3 -1
- package/node_modules/hono/dist/types/jsx/intrinsic-element/components.d.ts +7 -4
- package/node_modules/hono/dist/types/jsx/intrinsic-elements.d.ts +708 -708
- package/node_modules/hono/dist/types/jsx/jsx-dev-runtime.d.ts +4 -7
- package/node_modules/hono/dist/types/jsx/jsx-runtime.d.ts +7 -10
- package/node_modules/hono/dist/types/jsx/streaming.d.ts +9 -10
- package/node_modules/hono/dist/types/jsx/types.d.ts +11 -13
- package/node_modules/hono/dist/types/jsx/utils.d.ts +2 -0
- package/node_modules/hono/dist/types/middleware/basic-auth/index.d.ts +17 -20
- package/node_modules/hono/dist/types/middleware/bearer-auth/index.d.ts +46 -49
- package/node_modules/hono/dist/types/middleware/body-limit/index.d.ts +6 -9
- package/node_modules/hono/dist/types/middleware/cache/index.d.ts +13 -15
- package/node_modules/hono/dist/types/middleware/combine/index.d.ts +7 -8
- package/node_modules/hono/dist/types/middleware/compress/index.d.ts +8 -10
- package/node_modules/hono/dist/types/middleware/context-storage/index.d.ts +4 -6
- package/node_modules/hono/dist/types/middleware/cors/index.d.ts +10 -13
- package/node_modules/hono/dist/types/middleware/csrf/index.d.ts +6 -9
- package/node_modules/hono/dist/types/middleware/etag/digest.d.ts +2 -0
- package/node_modules/hono/dist/types/middleware/etag/index.d.ts +6 -9
- package/node_modules/hono/dist/types/middleware/ip-restriction/index.d.ts +11 -13
- package/node_modules/hono/dist/types/middleware/jsx-renderer/index.d.ts +11 -12
- package/node_modules/hono/dist/types/middleware/jwk/index.d.ts +2 -1
- package/node_modules/hono/dist/types/middleware/jwk/jwk.d.ts +20 -23
- package/node_modules/hono/dist/types/middleware/jwt/index.d.ts +6 -6
- package/node_modules/hono/dist/types/middleware/jwt/jwt.d.ts +28 -30
- package/node_modules/hono/dist/types/middleware/language/index.d.ts +5 -5
- package/node_modules/hono/dist/types/middleware/language/language.d.ts +42 -44
- package/node_modules/hono/dist/types/middleware/logger/index.d.ts +3 -6
- package/node_modules/hono/dist/types/middleware/method-not-allowed/index.d.ts +7 -10
- package/node_modules/hono/dist/types/middleware/method-override/index.d.ts +14 -17
- package/node_modules/hono/dist/types/middleware/powered-by/index.d.ts +8 -11
- package/node_modules/hono/dist/types/middleware/pretty-json/index.d.ts +18 -21
- package/node_modules/hono/dist/types/middleware/request-id/index.d.ts +5 -5
- package/node_modules/hono/dist/types/middleware/request-id/request-id.d.ts +9 -11
- package/node_modules/hono/dist/types/middleware/secure-headers/index.d.ts +5 -6
- package/node_modules/hono/dist/types/middleware/secure-headers/permissions-policy.d.ts +2 -1
- package/node_modules/hono/dist/types/middleware/secure-headers/secure-headers.d.ts +55 -58
- package/node_modules/hono/dist/types/middleware/serve-static/index.d.ts +24 -24
- package/node_modules/hono/dist/types/middleware/serve-static/path.d.ts +2 -0
- package/node_modules/hono/dist/types/middleware/timeout/index.d.ts +5 -7
- package/node_modules/hono/dist/types/middleware/timing/index.d.ts +5 -5
- package/node_modules/hono/dist/types/middleware/timing/timing.d.ts +17 -21
- package/node_modules/hono/dist/types/middleware/trailing-slash/index.d.ts +35 -38
- package/node_modules/hono/dist/types/preset/quick.d.ts +6 -9
- package/node_modules/hono/dist/types/preset/tiny.d.ts +6 -9
- package/node_modules/hono/dist/types/request/constants.d.ts +2 -0
- package/node_modules/hono/dist/types/request.d.ts +288 -287
- package/node_modules/hono/dist/types/router/linear-router/index.d.ts +2 -5
- package/node_modules/hono/dist/types/router/linear-router/router.d.ts +7 -5
- package/node_modules/hono/dist/types/router/pattern-router/index.d.ts +2 -5
- package/node_modules/hono/dist/types/router/pattern-router/router.d.ts +7 -5
- package/node_modules/hono/dist/types/router/reg-exp-router/index.d.ts +3 -6
- package/node_modules/hono/dist/types/router/reg-exp-router/matcher.d.ts +3 -1
- package/node_modules/hono/dist/types/router/reg-exp-router/node.d.ts +6 -4
- package/node_modules/hono/dist/types/router/reg-exp-router/prepared-router.d.ts +11 -11
- package/node_modules/hono/dist/types/router/reg-exp-router/router.d.ts +10 -9
- package/node_modules/hono/dist/types/router/reg-exp-router/trie.d.ts +7 -5
- package/node_modules/hono/dist/types/router/smart-router/index.d.ts +2 -5
- package/node_modules/hono/dist/types/router/smart-router/router.d.ts +11 -9
- package/node_modules/hono/dist/types/router/trie-router/index.d.ts +2 -5
- package/node_modules/hono/dist/types/router/trie-router/node.d.ts +6 -4
- package/node_modules/hono/dist/types/router/trie-router/router.d.ts +7 -5
- package/node_modules/hono/dist/types/router/utils.d.ts +2 -0
- package/node_modules/hono/dist/types/router.d.ts +23 -22
- package/node_modules/hono/dist/types/types.d.ts +146 -506
- package/node_modules/hono/dist/types/utils/accept.d.ts +5 -3
- package/node_modules/hono/dist/types/utils/basic-auth.d.ts +4 -2
- package/node_modules/hono/dist/types/utils/body.d.ts +46 -51
- package/node_modules/hono/dist/types/utils/buffer.d.ts +7 -6
- package/node_modules/hono/dist/types/utils/color.d.ts +2 -0
- package/node_modules/hono/dist/types/utils/compress.d.ts +2 -0
- package/node_modules/hono/dist/types/utils/concurrent.d.ts +6 -4
- package/node_modules/hono/dist/types/utils/constants.d.ts +2 -0
- package/node_modules/hono/dist/types/utils/cookie.d.ts +20 -19
- package/node_modules/hono/dist/types/utils/crypto.d.ts +5 -8
- package/node_modules/hono/dist/types/utils/encode.d.ts +2 -0
- package/node_modules/hono/dist/types/utils/filepath.d.ts +5 -4
- package/node_modules/hono/dist/types/utils/handler.d.ts +2 -0
- package/node_modules/hono/dist/types/utils/headers.d.ts +2 -0
- package/node_modules/hono/dist/types/utils/html.d.ts +11 -10
- package/node_modules/hono/dist/types/utils/http-status.d.ts +2 -0
- package/node_modules/hono/dist/types/utils/ipaddr.d.ts +4 -6
- package/node_modules/hono/dist/types/utils/jwt/index.d.ts +18 -12
- package/node_modules/hono/dist/types/utils/jwt/jwa.d.ts +15 -13
- package/node_modules/hono/dist/types/utils/jwt/jws.d.ts +4 -7
- package/node_modules/hono/dist/types/utils/jwt/jwt.d.ts +26 -29
- package/node_modules/hono/dist/types/utils/jwt/types.d.ts +48 -45
- package/node_modules/hono/dist/types/utils/jwt/utf8.d.ts +2 -0
- package/node_modules/hono/dist/types/utils/mime.d.ts +59 -57
- package/node_modules/hono/dist/types/utils/stream.d.ts +27 -25
- package/node_modules/hono/dist/types/utils/types.d.ts +15 -28
- package/node_modules/hono/dist/types/utils/url.d.ts +2 -1
- package/node_modules/hono/dist/types/validator/index.d.ts +3 -7
- package/node_modules/hono/dist/types/validator/utils.d.ts +6 -9
- package/node_modules/hono/dist/types/validator/validator.d.ts +11 -10
- package/node_modules/hono/dist/types.js +4 -6
- package/node_modules/hono/dist/utils/accept.js +185 -215
- package/node_modules/hono/dist/utils/basic-auth.js +18 -21
- package/node_modules/hono/dist/utils/body.js +87 -92
- package/node_modules/hono/dist/utils/buffer.js +44 -71
- package/node_modules/hono/dist/utils/color.js +33 -21
- package/node_modules/hono/dist/utils/compress.js +11 -5
- package/node_modules/hono/dist/utils/concurrent.js +29 -38
- package/node_modules/hono/dist/utils/constants.js +7 -5
- package/node_modules/hono/dist/utils/cookie.js +114 -163
- package/node_modules/hono/dist/utils/crypto.js +30 -40
- package/node_modules/hono/dist/utils/encode.js +30 -26
- package/node_modules/hono/dist/utils/filepath.js +23 -33
- package/node_modules/hono/dist/utils/handler.js +10 -11
- package/node_modules/hono/dist/utils/headers.js +1 -0
- package/node_modules/hono/dist/utils/html.js +97 -117
- package/node_modules/hono/dist/utils/http-status.js +1 -0
- package/node_modules/hono/dist/utils/ipaddr.js +227 -279
- package/node_modules/hono/dist/utils/jwt/index.js +12 -4
- package/node_modules/hono/dist/utils/jwt/jwa.js +24 -20
- package/node_modules/hono/dist/utils/jwt/jws.js +115 -174
- package/node_modules/hono/dist/utils/jwt/jwt.js +120 -197
- package/node_modules/hono/dist/utils/jwt/types.js +79 -95
- package/node_modules/hono/dist/utils/jwt/utf8.js +9 -7
- package/node_modules/hono/dist/utils/mime.js +74 -79
- package/node_modules/hono/dist/utils/stream.js +86 -88
- package/node_modules/hono/dist/utils/types.js +1 -0
- package/node_modules/hono/dist/utils/url.js +187 -215
- package/node_modules/hono/dist/validator/index.js +1 -4
- package/node_modules/hono/dist/validator/utils.js +1 -0
- package/node_modules/hono/dist/validator/validator.js +61 -83
- package/node_modules/hono/package.json +27 -27
- package/package.json +7 -8
- package/prepare.mjs +109 -4
- package/runtime-package.json +7 -9
- package/scripts/check-install-toolchain.mjs +64 -40
- package/shipping-sbom.cdx.json +134 -168
- package/shipping-source.json +15 -15
- package/node_modules/@earendil-works/chord/dist/api.d.ts +0 -20
- package/node_modules/@earendil-works/chord/dist/api.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/api.js +0 -77
- package/node_modules/@earendil-works/chord/dist/api.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/bundler.d.ts +0 -6
- package/node_modules/@earendil-works/chord/dist/bundler.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/bundler.js +0 -3
- package/node_modules/@earendil-works/chord/dist/bundler.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/facets/host.d.ts +0 -12
- package/node_modules/@earendil-works/chord/dist/facets/host.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/facets/host.js +0 -763
- package/node_modules/@earendil-works/chord/dist/facets/host.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/facets/loader.d.ts +0 -3
- package/node_modules/@earendil-works/chord/dist/facets/loader.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/facets/loader.js +0 -5
- package/node_modules/@earendil-works/chord/dist/facets/loader.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/node/bundle-loader.d.ts +0 -30
- package/node_modules/@earendil-works/chord/dist/node/bundle-loader.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/node/bundle-loader.js +0 -377
- package/node_modules/@earendil-works/chord/dist/node/bundle-loader.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/node/bundle.d.ts +0 -26
- package/node_modules/@earendil-works/chord/dist/node/bundle.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/node/bundle.js +0 -183
- package/node_modules/@earendil-works/chord/dist/node/bundle.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/node/manifest.d.ts +0 -36
- package/node_modules/@earendil-works/chord/dist/node/manifest.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/node/manifest.js +0 -6
- package/node_modules/@earendil-works/chord/dist/node/manifest.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/node/package.d.ts +0 -15
- package/node_modules/@earendil-works/chord/dist/node/package.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/node/package.js +0 -199
- package/node_modules/@earendil-works/chord/dist/node/package.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/consumer.d.ts +0 -11
- package/node_modules/@earendil-works/chord/dist/services/consumer.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/consumer.js +0 -585
- package/node_modules/@earendil-works/chord/dist/services/consumer.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/errors.d.ts +0 -8
- package/node_modules/@earendil-works/chord/dist/services/errors.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/errors.js +0 -22
- package/node_modules/@earendil-works/chord/dist/services/errors.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/handle.d.ts +0 -15
- package/node_modules/@earendil-works/chord/dist/services/handle.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/handle.js +0 -101
- package/node_modules/@earendil-works/chord/dist/services/handle.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/instances.d.ts +0 -26
- package/node_modules/@earendil-works/chord/dist/services/instances.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/instances.js +0 -140
- package/node_modules/@earendil-works/chord/dist/services/instances.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/loopback.d.ts +0 -5
- package/node_modules/@earendil-works/chord/dist/services/loopback.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/loopback.js +0 -15
- package/node_modules/@earendil-works/chord/dist/services/loopback.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/provider.d.ts +0 -37
- package/node_modules/@earendil-works/chord/dist/services/provider.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/provider.js +0 -521
- package/node_modules/@earendil-works/chord/dist/services/provider.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/state-codec.d.ts +0 -15
- package/node_modules/@earendil-works/chord/dist/services/state-codec.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/state-codec.js +0 -133
- package/node_modules/@earendil-works/chord/dist/services/state-codec.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/state-internals.d.ts +0 -13
- package/node_modules/@earendil-works/chord/dist/services/state-internals.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/state-internals.js +0 -10
- package/node_modules/@earendil-works/chord/dist/services/state-internals.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/state.d.ts +0 -28
- package/node_modules/@earendil-works/chord/dist/services/state.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/state.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/wire.d.ts +0 -63
- package/node_modules/@earendil-works/chord/dist/services/wire.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/wire.js +0 -186
- package/node_modules/@earendil-works/chord/dist/services/wire.js.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.d.ts +0 -3
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.js +0 -14
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.js.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.models.d.ts +0 -6
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.models.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.models.js +0 -8
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.models.js.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/azure-openai-responses.json +0 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/anthropic-messages-MVG2FL56.js +0 -6
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/azure-openai-responses-7AMFUIWJ.js +0 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-6FX7UEPL.js +0 -132
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-7JGR3GZN.js +0 -11
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-A3JYRWB6.js +0 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-IKZJX7ZT.js +0 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-OSKPX3Z5.js +0 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-OYBSLV7Y.js +0 -16
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-PDFMCAOZ.js +0 -19
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-U7B62NSC.js +0 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-VIV3CWXG.js +0 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-WCQZGZ6I.js +0 -82
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/cloudflare-workers-ai-system-one-X5PVWWYJ.js +0 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/easter-egg-3d-T5FFWIBR.js +0 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/execute-RYVK27GT.js +0 -388
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/mistral-conversations-7DAUEE4N.js +0 -5
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/openai-codex-responses-TC3OK7B4.js +0 -10
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/runtime-D5I2NTIF.js +0 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/typesafe-system-one-A4CZTQWZ.js +0 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/virtual-modules-KVWJD3T3.js +0 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-json.d.ts +0 -85
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-json.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-json.js +0 -132
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-json.js.map +0 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-schema.json +0 -361
- package/node_modules/@earendil-works/pi-coding-agent/examples/plugins/pi-example-plugin/README.md +0 -38
- package/node_modules/@earendil-works/pi-coding-agent/examples/plugins/pi-example-plugin/package.json +0 -10
- package/node_modules/@earendil-works/pi-coding-agent/examples/plugins/pi-example-plugin/src/contract.ts +0 -13
- package/node_modules/@earendil-works/pi-coding-agent/examples/plugins/pi-example-plugin/src/session.ts +0 -24
- package/node_modules/@earendil-works/pi-coding-agent/examples/plugins/pi-example-plugin/src/tui.ts +0 -31
- package/node_modules/@esbuild/linux-x64/README.md +0 -3
- package/node_modules/@esbuild/linux-x64/bin/esbuild +0 -0
- package/node_modules/@esbuild/linux-x64/package.json +0 -20
- package/node_modules/esbuild/LICENSE.md +0 -21
- package/node_modules/esbuild/README.md +0 -3
- package/node_modules/esbuild/bin/esbuild +0 -223
- package/node_modules/esbuild/install.js +0 -300
- package/node_modules/esbuild/lib/main.d.ts +0 -720
- package/node_modules/esbuild/lib/main.js +0 -2536
- package/node_modules/esbuild/package.json +0 -74
|
@@ -165,6 +165,8 @@ const SYMBOL_KEYS = new Set([
|
|
|
165
165
|
">",
|
|
166
166
|
"?",
|
|
167
167
|
]);
|
|
168
|
+
const SHIFTED_SYMBOL_KEYS = new Set("~!@#$%^&*()_+|{}:<>?");
|
|
169
|
+
const MODIFIER_NAMES = ["shift", "alt", "ctrl", "super"];
|
|
168
170
|
const MODIFIERS = {
|
|
169
171
|
shift: 1,
|
|
170
172
|
alt: 2,
|
|
@@ -233,6 +235,14 @@ function normalizeShiftedLetterIdentityCodepoint(codepoint, modifier) {
|
|
|
233
235
|
}
|
|
234
236
|
return codepoint;
|
|
235
237
|
}
|
|
238
|
+
function getLogicalShiftedSymbolCandidate(codepoint, modifier, allowedSymbols) {
|
|
239
|
+
if (codepoint === undefined || (modifier & MODIFIERS.shift) === 0)
|
|
240
|
+
return undefined;
|
|
241
|
+
const normalizedCodepoint = normalizeKittyFunctionalCodepoint(codepoint);
|
|
242
|
+
if (!allowedSymbols.has(String.fromCharCode(normalizedCodepoint)))
|
|
243
|
+
return undefined;
|
|
244
|
+
return { codepoint: normalizedCodepoint, modifier: modifier & ~MODIFIERS.shift };
|
|
245
|
+
}
|
|
236
246
|
const LEGACY_KEY_SEQUENCES = {
|
|
237
247
|
up: ["\x1b[A", "\x1bOA"],
|
|
238
248
|
down: ["\x1b[B", "\x1bOB"],
|
|
@@ -481,14 +491,22 @@ function matchesKittySequence(data, expectedCodepoint, expectedModifier) {
|
|
|
481
491
|
return false;
|
|
482
492
|
const actualMod = parsed.modifier & ~LOCK_MASK;
|
|
483
493
|
const expectedMod = expectedModifier & ~LOCK_MASK;
|
|
484
|
-
// Check if modifiers match
|
|
485
|
-
if (actualMod !== expectedMod)
|
|
486
|
-
return false;
|
|
487
494
|
const normalizedCodepoint = normalizeShiftedLetterIdentityCodepoint(normalizeKittyFunctionalCodepoint(parsed.codepoint), parsed.modifier);
|
|
488
495
|
const normalizedExpectedCodepoint = normalizeShiftedLetterIdentityCodepoint(normalizeKittyFunctionalCodepoint(expectedCodepoint), expectedModifier);
|
|
489
|
-
//
|
|
490
|
-
if (normalizedCodepoint === normalizedExpectedCodepoint)
|
|
496
|
+
// Physical match: primary codepoint and every reported modifier match.
|
|
497
|
+
if (actualMod === expectedMod && normalizedCodepoint === normalizedExpectedCodepoint)
|
|
498
|
+
return true;
|
|
499
|
+
// Logical match: Kitty reports symbols such as "+" as Shift plus the physical "=" key.
|
|
500
|
+
// Bindings name the produced symbol, so consume that implicit Shift while preserving
|
|
501
|
+
// Ctrl, Alt, and Super. The physical "shift+=" spelling remains valid through the match above.
|
|
502
|
+
const logicalShiftedSymbol = getLogicalShiftedSymbolCandidate(parsed.shiftedKey, actualMod, SYMBOL_KEYS);
|
|
503
|
+
if (logicalShiftedSymbol &&
|
|
504
|
+
(logicalShiftedSymbol.modifier & ~LOCK_MASK) === expectedMod &&
|
|
505
|
+
logicalShiftedSymbol.codepoint === normalizeKittyFunctionalCodepoint(expectedCodepoint)) {
|
|
491
506
|
return true;
|
|
507
|
+
}
|
|
508
|
+
if (actualMod !== expectedMod)
|
|
509
|
+
return false;
|
|
492
510
|
// Alternate match: use base layout key for non-Latin keyboard layouts.
|
|
493
511
|
// This allows Ctrl+С (Cyrillic) to match Ctrl+c (Latin) when terminal reports
|
|
494
512
|
// the base layout key (the key in standard PC-101 layout).
|
|
@@ -576,13 +594,16 @@ function isDigitKey(key) {
|
|
|
576
594
|
return key >= "0" && key <= "9";
|
|
577
595
|
}
|
|
578
596
|
function matchesPrintableModifyOtherKeys(data, expectedKeycode, expectedModifier) {
|
|
579
|
-
if (expectedModifier === 0)
|
|
580
|
-
return false;
|
|
581
597
|
const parsed = parseModifyOtherKeysSequence(data);
|
|
582
|
-
if (!parsed
|
|
598
|
+
if (!parsed)
|
|
583
599
|
return false;
|
|
584
|
-
|
|
585
|
-
normalizeShiftedLetterIdentityCodepoint(
|
|
600
|
+
const physicalMatch = parsed.modifier === expectedModifier &&
|
|
601
|
+
normalizeShiftedLetterIdentityCodepoint(parsed.codepoint, parsed.modifier) ===
|
|
602
|
+
normalizeShiftedLetterIdentityCodepoint(expectedKeycode, expectedModifier);
|
|
603
|
+
if (physicalMatch)
|
|
604
|
+
return true;
|
|
605
|
+
const logicalShiftedSymbol = getLogicalShiftedSymbolCandidate(parsed.codepoint, parsed.modifier, SHIFTED_SYMBOL_KEYS);
|
|
606
|
+
return logicalShiftedSymbol?.modifier === expectedModifier && logicalShiftedSymbol.codepoint === expectedKeycode;
|
|
586
607
|
}
|
|
587
608
|
function formatKeyNameWithModifiers(keyName, modifier) {
|
|
588
609
|
const mods = [];
|
|
@@ -601,16 +622,25 @@ function formatKeyNameWithModifiers(keyName, modifier) {
|
|
|
601
622
|
return mods.length > 0 ? `${mods.join("+")}+${keyName}` : keyName;
|
|
602
623
|
}
|
|
603
624
|
function parseKeyId(keyId) {
|
|
604
|
-
|
|
605
|
-
const
|
|
606
|
-
|
|
625
|
+
let key = keyId.toLowerCase();
|
|
626
|
+
const modifiers = new Set();
|
|
627
|
+
while (true) {
|
|
628
|
+
const modifier = MODIFIER_NAMES.find((name) => key.startsWith(`${name}+`));
|
|
629
|
+
if (!modifier)
|
|
630
|
+
break;
|
|
631
|
+
if (modifiers.has(modifier))
|
|
632
|
+
return null;
|
|
633
|
+
modifiers.add(modifier);
|
|
634
|
+
key = key.slice(modifier.length + 1);
|
|
635
|
+
}
|
|
636
|
+
if (!key || (key.includes("+") && key !== "+"))
|
|
607
637
|
return null;
|
|
608
638
|
return {
|
|
609
639
|
key,
|
|
610
|
-
ctrl:
|
|
611
|
-
shift:
|
|
612
|
-
alt:
|
|
613
|
-
super:
|
|
640
|
+
ctrl: modifiers.has("ctrl"),
|
|
641
|
+
shift: modifiers.has("shift"),
|
|
642
|
+
alt: modifiers.has("alt"),
|
|
643
|
+
super: modifiers.has("super"),
|
|
614
644
|
};
|
|
615
645
|
}
|
|
616
646
|
/**
|
|
@@ -933,7 +963,7 @@ export function matchesKey(data, keyId) {
|
|
|
933
963
|
matchesPrintableModifyOtherKeys(data, codepoint, modifier));
|
|
934
964
|
}
|
|
935
965
|
// Check both raw char and Kitty sequence (needed for release events)
|
|
936
|
-
return data === key || matchesKittySequence(data, codepoint, 0);
|
|
966
|
+
return (data === key || matchesKittySequence(data, codepoint, 0) || matchesPrintableModifyOtherKeys(data, codepoint, 0));
|
|
937
967
|
}
|
|
938
968
|
return false;
|
|
939
969
|
}
|
|
@@ -999,11 +1029,13 @@ function formatParsedKey(codepoint, modifier, baseLayoutKey) {
|
|
|
999
1029
|
export function parseKey(data) {
|
|
1000
1030
|
const kitty = parseKittySequence(data);
|
|
1001
1031
|
if (kitty) {
|
|
1002
|
-
|
|
1032
|
+
const logicalShiftedSymbol = getLogicalShiftedSymbolCandidate(kitty.shiftedKey, kitty.modifier, SYMBOL_KEYS);
|
|
1033
|
+
return formatParsedKey(logicalShiftedSymbol?.codepoint ?? kitty.codepoint, logicalShiftedSymbol?.modifier ?? kitty.modifier, kitty.baseLayoutKey);
|
|
1003
1034
|
}
|
|
1004
1035
|
const modifyOtherKeys = parseModifyOtherKeysSequence(data);
|
|
1005
1036
|
if (modifyOtherKeys) {
|
|
1006
|
-
|
|
1037
|
+
const logicalShiftedSymbol = getLogicalShiftedSymbolCandidate(modifyOtherKeys.codepoint, modifyOtherKeys.modifier, SHIFTED_SYMBOL_KEYS);
|
|
1038
|
+
return formatParsedKey(logicalShiftedSymbol?.codepoint ?? modifyOtherKeys.codepoint, logicalShiftedSymbol?.modifier ?? modifyOtherKeys.modifier);
|
|
1007
1039
|
}
|
|
1008
1040
|
// Mode-aware legacy sequences
|
|
1009
1041
|
// When Kitty protocol is active, ambiguous sequences are interpreted as custom terminal mappings:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keys.js","sourceRoot":"","sources":["../src/keys.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,gFAAgF;AAChF,8BAA8B;AAC9B,gFAAgF;AAEhF,IAAI,oBAAoB,GAAG,KAAK,CAAC;AAEjC;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CAAC,MAAe;IACrD,oBAAoB,GAAG,MAAM,CAAC;AAC/B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,qBAAqB;IACpC,OAAO,oBAAoB,CAAC;AAC7B,CAAC;AAkHD;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,GAAG,GAAG;IAClB,eAAe;IACf,MAAM,EAAE,QAAiB;IACzB,GAAG,EAAE,KAAc;IACnB,KAAK,EAAE,OAAgB;IACvB,MAAM,EAAE,QAAiB;IACzB,GAAG,EAAE,KAAc;IACnB,KAAK,EAAE,OAAgB;IACvB,SAAS,EAAE,WAAoB;IAC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AAI,CAAC;QACJ,OAAO,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAC/C,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,SAAS,CAAC;IAClB,CAAC;AACF,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC9C,OAAO,oBAAoB,CAAC,IAAI,CAAC,IAAI,8BAA8B,CAAC,IAAI,CAAC,CAAC;AAC3E,CAAC","sourcesContent":["/**\n * Keyboard input handling for terminal applications.\n *\n * Supports both legacy terminal sequences and Kitty keyboard protocol.\n * See: https://sw.kovidgoyal.net/kitty/keyboard-protocol/\n * Reference: https://github.com/sst/opentui/blob/7da92b4088aebfe27b9f691c04163a48821e49fd/packages/core/src/lib/parse.keypress.ts\n *\n * Symbol keys are also supported, however some ctrl+symbol combos\n * overlap with ASCII codes, e.g. ctrl+[ = ESC.\n * See: https://sw.kovidgoyal.net/kitty/keyboard-protocol/#legacy-ctrl-mapping-of-ascii-keys\n * Those can still be * used for ctrl+shift combos\n *\n * API:\n * - matchesKey(data, keyId) - Check if input matches a key identifier\n * - parseKey(data) - Parse input and return the key identifier\n * - Key - Helper object for creating typed key identifiers\n * - setKittyProtocolActive(active) - Set global Kitty protocol state\n * - isKittyProtocolActive() - Query global Kitty protocol state\n */\n\n// =============================================================================\n// Global Kitty Protocol State\n// =============================================================================\n\nlet _kittyProtocolActive = false;\n\n/**\n * Set the global Kitty keyboard protocol state.\n * Called by ProcessTerminal after detecting protocol support.\n */\nexport function setKittyProtocolActive(active: boolean): void {\n\t_kittyProtocolActive = active;\n}\n\n/**\n * Query whether Kitty keyboard protocol is currently active.\n */\nexport function isKittyProtocolActive(): boolean {\n\treturn _kittyProtocolActive;\n}\n\n// =============================================================================\n// Type-Safe Key Identifiers\n// =============================================================================\n\ntype Letter =\n\t| \"a\"\n\t| \"b\"\n\t| \"c\"\n\t| \"d\"\n\t| \"e\"\n\t| \"f\"\n\t| \"g\"\n\t| \"h\"\n\t| \"i\"\n\t| \"j\"\n\t| \"k\"\n\t| \"l\"\n\t| \"m\"\n\t| \"n\"\n\t| \"o\"\n\t| \"p\"\n\t| \"q\"\n\t| \"r\"\n\t| \"s\"\n\t| \"t\"\n\t| \"u\"\n\t| \"v\"\n\t| \"w\"\n\t| \"x\"\n\t| \"y\"\n\t| \"z\";\n\ntype Digit = \"0\" | \"1\" | \"2\" | \"3\" | \"4\" | \"5\" | \"6\" | \"7\" | \"8\" | \"9\";\n\ntype SymbolKey =\n\t| \"`\"\n\t| \"-\"\n\t| \"=\"\n\t| \"[\"\n\t| \"]\"\n\t| \"\\\\\"\n\t| \";\"\n\t| \"'\"\n\t| \",\"\n\t| \".\"\n\t| \"/\"\n\t| \"!\"\n\t| \"@\"\n\t| \"#\"\n\t| \"$\"\n\t| \"%\"\n\t| \"^\"\n\t| \"&\"\n\t| \"*\"\n\t| \"(\"\n\t| \")\"\n\t| \"_\"\n\t| \"+\"\n\t| \"|\"\n\t| \"~\"\n\t| \"{\"\n\t| \"}\"\n\t| \":\"\n\t| \"<\"\n\t| \">\"\n\t| \"?\";\n\ntype SpecialKey =\n\t| \"escape\"\n\t| \"esc\"\n\t| \"enter\"\n\t| \"return\"\n\t| \"tab\"\n\t| \"space\"\n\t| \"backspace\"\n\t| \"delete\"\n\t| \"insert\"\n\t| \"clear\"\n\t| \"home\"\n\t| \"end\"\n\t| \"pageUp\"\n\t| \"pageDown\"\n\t| \"up\"\n\t| \"down\"\n\t| \"left\"\n\t| \"right\"\n\t| \"f1\"\n\t| \"f2\"\n\t| \"f3\"\n\t| \"f4\"\n\t| \"f5\"\n\t| \"f6\"\n\t| \"f7\"\n\t| \"f8\"\n\t| \"f9\"\n\t| \"f10\"\n\t| \"f11\"\n\t| \"f12\";\n\ntype BaseKey = Letter | Digit | SymbolKey | SpecialKey;\ntype ModifierName = \"ctrl\" | \"shift\" | \"alt\" | \"super\";\n\ntype ModifiedKeyId<Key extends string, RemainingModifiers extends ModifierName = ModifierName> = {\n\t[M in RemainingModifiers]: `${M}+${Key}` | `${M}+${ModifiedKeyId<Key, Exclude<RemainingModifiers, M>>}`;\n}[RemainingModifiers];\n\n/**\n * Union type of all valid key identifiers.\n * Provides autocomplete and catches typos at compile time.\n */\nexport type KeyId = BaseKey | ModifiedKeyId<BaseKey>;\n\n/**\n * Helper object for creating typed key identifiers with autocomplete.\n *\n * Usage:\n * - Key.escape, Key.enter, Key.tab, etc. for special keys\n * - Key.backtick, Key.comma, Key.period, etc. for symbol keys\n * - Key.ctrl(\"c\"), Key.alt(\"x\"), Key.super(\"k\") for single modifiers\n * - Key.ctrlShift(\"p\"), Key.ctrlAlt(\"x\"), Key.ctrlSuper(\"k\") for combined modifiers\n */\nexport const Key = {\n\t// Special keys\n\tescape: \"escape\" as const,\n\tesc: \"esc\" as const,\n\tenter: \"enter\" as const,\n\treturn: \"return\" as const,\n\ttab: \"tab\" as const,\n\tspace: \"space\" as const,\n\tbackspace: \"backspace\" as const,\n\tdelete: \"delete\" as const,\n\tinsert: \"insert\" as const,\n\tclear: \"clear\" as const,\n\thome: \"home\" as const,\n\tend: \"end\" as const,\n\tpageUp: \"pageUp\" as const,\n\tpageDown: \"pageDown\" as const,\n\tup: \"up\" as const,\n\tdown: \"down\" as const,\n\tleft: \"left\" as const,\n\tright: \"right\" as const,\n\tf1: \"f1\" as const,\n\tf2: \"f2\" as const,\n\tf3: \"f3\" as const,\n\tf4: \"f4\" as const,\n\tf5: \"f5\" as const,\n\tf6: \"f6\" as const,\n\tf7: \"f7\" as const,\n\tf8: \"f8\" as const,\n\tf9: \"f9\" as const,\n\tf10: \"f10\" as const,\n\tf11: \"f11\" as const,\n\tf12: \"f12\" as const,\n\n\t// Symbol keys\n\tbacktick: \"`\" as const,\n\thyphen: \"-\" as const,\n\tequals: \"=\" as const,\n\tleftbracket: \"[\" as const,\n\trightbracket: \"]\" as const,\n\tbackslash: \"\\\\\" as const,\n\tsemicolon: \";\" as const,\n\tquote: \"'\" as const,\n\tcomma: \",\" as const,\n\tperiod: \".\" as const,\n\tslash: \"/\" as const,\n\texclamation: \"!\" as const,\n\tat: \"@\" as const,\n\thash: \"#\" as const,\n\tdollar: \"$\" as const,\n\tpercent: \"%\" as const,\n\tcaret: \"^\" as const,\n\tampersand: \"&\" as const,\n\tasterisk: \"*\" as const,\n\tleftparen: \"(\" as const,\n\trightparen: \")\" as const,\n\tunderscore: \"_\" as const,\n\tplus: \"+\" as const,\n\tpipe: \"|\" as const,\n\ttilde: \"~\" as const,\n\tleftbrace: \"{\" as const,\n\trightbrace: \"}\" as const,\n\tcolon: \":\" as const,\n\tlessthan: \"<\" as const,\n\tgreaterthan: \">\" as const,\n\tquestion: \"?\" as const,\n\n\t// Single modifiers\n\tctrl: <K extends BaseKey>(key: K): `ctrl+${K}` => `ctrl+${key}`,\n\tshift: <K extends BaseKey>(key: K): `shift+${K}` => `shift+${key}`,\n\talt: <K extends BaseKey>(key: K): `alt+${K}` => `alt+${key}`,\n\tsuper: <K extends BaseKey>(key: K): `super+${K}` => `super+${key}`,\n\n\t// Combined modifiers\n\tctrlShift: <K extends BaseKey>(key: K): `ctrl+shift+${K}` => `ctrl+shift+${key}`,\n\tshiftCtrl: <K extends BaseKey>(key: K): `shift+ctrl+${K}` => `shift+ctrl+${key}`,\n\tctrlAlt: <K extends BaseKey>(key: K): `ctrl+alt+${K}` => `ctrl+alt+${key}`,\n\taltCtrl: <K extends BaseKey>(key: K): `alt+ctrl+${K}` => `alt+ctrl+${key}`,\n\tshiftAlt: <K extends BaseKey>(key: K): `shift+alt+${K}` => `shift+alt+${key}`,\n\taltShift: <K extends BaseKey>(key: K): `alt+shift+${K}` => `alt+shift+${key}`,\n\tctrlSuper: <K extends BaseKey>(key: K): `ctrl+super+${K}` => `ctrl+super+${key}`,\n\tsuperCtrl: <K extends BaseKey>(key: K): `super+ctrl+${K}` => `super+ctrl+${key}`,\n\tshiftSuper: <K extends BaseKey>(key: K): `shift+super+${K}` => `shift+super+${key}`,\n\tsuperShift: <K extends BaseKey>(key: K): `super+shift+${K}` => `super+shift+${key}`,\n\taltSuper: <K extends BaseKey>(key: K): `alt+super+${K}` => `alt+super+${key}`,\n\tsuperAlt: <K extends BaseKey>(key: K): `super+alt+${K}` => `super+alt+${key}`,\n\n\t// Triple modifiers\n\tctrlShiftAlt: <K extends BaseKey>(key: K): `ctrl+shift+alt+${K}` => `ctrl+shift+alt+${key}`,\n\tctrlShiftSuper: <K extends BaseKey>(key: K): `ctrl+shift+super+${K}` => `ctrl+shift+super+${key}`,\n} as const;\n\n// =============================================================================\n// Constants\n// =============================================================================\n\nconst SYMBOL_KEYS = new Set([\n\t\"`\",\n\t\"-\",\n\t\"=\",\n\t\"[\",\n\t\"]\",\n\t\"\\\\\",\n\t\";\",\n\t\"'\",\n\t\",\",\n\t\".\",\n\t\"/\",\n\t\"!\",\n\t\"@\",\n\t\"#\",\n\t\"$\",\n\t\"%\",\n\t\"^\",\n\t\"&\",\n\t\"*\",\n\t\"(\",\n\t\")\",\n\t\"_\",\n\t\"+\",\n\t\"|\",\n\t\"~\",\n\t\"{\",\n\t\"}\",\n\t\":\",\n\t\"<\",\n\t\">\",\n\t\"?\",\n]);\n\nconst MODIFIERS = {\n\tshift: 1,\n\talt: 2,\n\tctrl: 4,\n\tsuper: 8,\n} as const;\n\nconst LOCK_MASK = 64 + 128; // Caps Lock + Num Lock\n\nconst CODEPOINTS = {\n\tescape: 27,\n\ttab: 9,\n\tenter: 13,\n\tspace: 32,\n\tbackspace: 127,\n\tkpEnter: 57414, // Numpad Enter (Kitty protocol)\n} as const;\n\nconst ARROW_CODEPOINTS = {\n\tup: -1,\n\tdown: -2,\n\tright: -3,\n\tleft: -4,\n} as const;\n\nconst FUNCTIONAL_CODEPOINTS = {\n\tdelete: -10,\n\tinsert: -11,\n\tpageUp: -12,\n\tpageDown: -13,\n\thome: -14,\n\tend: -15,\n} as const;\n\nconst KITTY_FUNCTIONAL_KEY_EQUIVALENTS = new Map<number, number>([\n\t[57399, 48], // KP_0 -> 0\n\t[57400, 49], // KP_1 -> 1\n\t[57401, 50], // KP_2 -> 2\n\t[57402, 51], // KP_3 -> 3\n\t[57403, 52], // KP_4 -> 4\n\t[57404, 53], // KP_5 -> 5\n\t[57405, 54], // KP_6 -> 6\n\t[57406, 55], // KP_7 -> 7\n\t[57407, 56], // KP_8 -> 8\n\t[57408, 57], // KP_9 -> 9\n\t[57409, 46], // KP_DECIMAL -> .\n\t[57410, 47], // KP_DIVIDE -> /\n\t[57411, 42], // KP_MULTIPLY -> *\n\t[57412, 45], // KP_SUBTRACT -> -\n\t[57413, 43], // KP_ADD -> +\n\t[57415, 61], // KP_EQUAL -> =\n\t[57416, 44], // KP_SEPARATOR -> ,\n\t[57417, ARROW_CODEPOINTS.left],\n\t[57418, ARROW_CODEPOINTS.right],\n\t[57419, ARROW_CODEPOINTS.up],\n\t[57420, ARROW_CODEPOINTS.down],\n\t[57421, FUNCTIONAL_CODEPOINTS.pageUp],\n\t[57422, FUNCTIONAL_CODEPOINTS.pageDown],\n\t[57423, FUNCTIONAL_CODEPOINTS.home],\n\t[57424, FUNCTIONAL_CODEPOINTS.end],\n\t[57425, FUNCTIONAL_CODEPOINTS.insert],\n\t[57426, FUNCTIONAL_CODEPOINTS.delete],\n]);\n\nfunction normalizeKittyFunctionalCodepoint(codepoint: number): number {\n\treturn KITTY_FUNCTIONAL_KEY_EQUIVALENTS.get(codepoint) ?? codepoint;\n}\n\nfunction normalizeShiftedLetterIdentityCodepoint(codepoint: number, modifier: number): number {\n\tconst effectiveModifier = modifier & ~LOCK_MASK;\n\tif ((effectiveModifier & MODIFIERS.shift) !== 0 && codepoint >= 65 && codepoint <= 90) {\n\t\treturn codepoint + 32;\n\t}\n\treturn codepoint;\n}\n\nconst LEGACY_KEY_SEQUENCES = {\n\tup: [\"\\x1b[A\", \"\\x1bOA\"],\n\tdown: [\"\\x1b[B\", \"\\x1bOB\"],\n\tright: [\"\\x1b[C\", \"\\x1bOC\"],\n\tleft: [\"\\x1b[D\", \"\\x1bOD\"],\n\thome: [\"\\x1b[H\", \"\\x1bOH\", \"\\x1b[1~\", \"\\x1b[7~\"],\n\tend: [\"\\x1b[F\", \"\\x1bOF\", \"\\x1b[4~\", \"\\x1b[8~\"],\n\tinsert: [\"\\x1b[2~\"],\n\tdelete: [\"\\x1b[3~\"],\n\tpageUp: [\"\\x1b[5~\", \"\\x1b[[5~\"],\n\tpageDown: [\"\\x1b[6~\", \"\\x1b[[6~\"],\n\tclear: [\"\\x1b[E\", \"\\x1bOE\"],\n\tf1: [\"\\x1bOP\", \"\\x1b[11~\", \"\\x1b[[A\"],\n\tf2: [\"\\x1bOQ\", \"\\x1b[12~\", \"\\x1b[[B\"],\n\tf3: [\"\\x1bOR\", \"\\x1b[13~\", \"\\x1b[[C\"],\n\tf4: [\"\\x1bOS\", \"\\x1b[14~\", \"\\x1b[[D\"],\n\tf5: [\"\\x1b[15~\", \"\\x1b[[E\"],\n\tf6: [\"\\x1b[17~\"],\n\tf7: [\"\\x1b[18~\"],\n\tf8: [\"\\x1b[19~\"],\n\tf9: [\"\\x1b[20~\"],\n\tf10: [\"\\x1b[21~\"],\n\tf11: [\"\\x1b[23~\"],\n\tf12: [\"\\x1b[24~\"],\n} as const;\n\nconst LEGACY_SHIFT_SEQUENCES = {\n\tup: [\"\\x1b[a\"],\n\tdown: [\"\\x1b[b\"],\n\tright: [\"\\x1b[c\"],\n\tleft: [\"\\x1b[d\"],\n\tclear: [\"\\x1b[e\"],\n\tinsert: [\"\\x1b[2$\"],\n\tdelete: [\"\\x1b[3$\"],\n\tpageUp: [\"\\x1b[5$\"],\n\tpageDown: [\"\\x1b[6$\"],\n\thome: [\"\\x1b[7$\"],\n\tend: [\"\\x1b[8$\"],\n} as const;\n\nconst LEGACY_CTRL_SEQUENCES = {\n\tup: [\"\\x1bOa\"],\n\tdown: [\"\\x1bOb\"],\n\tright: [\"\\x1bOc\"],\n\tleft: [\"\\x1bOd\"],\n\tclear: [\"\\x1bOe\"],\n\tinsert: [\"\\x1b[2^\"],\n\tdelete: [\"\\x1b[3^\"],\n\tpageUp: [\"\\x1b[5^\"],\n\tpageDown: [\"\\x1b[6^\"],\n\thome: [\"\\x1b[7^\"],\n\tend: [\"\\x1b[8^\"],\n} as const;\n\nconst LEGACY_SEQUENCE_KEY_IDS: Record<string, KeyId> = {\n\t\"\\x1bOA\": \"up\",\n\t\"\\x1bOB\": \"down\",\n\t\"\\x1bOC\": \"right\",\n\t\"\\x1bOD\": \"left\",\n\t\"\\x1bOH\": \"home\",\n\t\"\\x1bOF\": \"end\",\n\t\"\\x1b[E\": \"clear\",\n\t\"\\x1bOE\": \"clear\",\n\t\"\\x1bOe\": \"ctrl+clear\",\n\t\"\\x1b[e\": \"shift+clear\",\n\t\"\\x1b[2~\": \"insert\",\n\t\"\\x1b[2$\": \"shift+insert\",\n\t\"\\x1b[2^\": \"ctrl+insert\",\n\t\"\\x1b[3$\": \"shift+delete\",\n\t\"\\x1b[3^\": \"ctrl+delete\",\n\t\"\\x1b[[5~\": \"pageUp\",\n\t\"\\x1b[[6~\": \"pageDown\",\n\t\"\\x1b[a\": \"shift+up\",\n\t\"\\x1b[b\": \"shift+down\",\n\t\"\\x1b[c\": \"shift+right\",\n\t\"\\x1b[d\": \"shift+left\",\n\t\"\\x1bOa\": \"ctrl+up\",\n\t\"\\x1bOb\": \"ctrl+down\",\n\t\"\\x1bOc\": \"ctrl+right\",\n\t\"\\x1bOd\": \"ctrl+left\",\n\t\"\\x1b[5$\": \"shift+pageUp\",\n\t\"\\x1b[6$\": \"shift+pageDown\",\n\t\"\\x1b[7$\": \"shift+home\",\n\t\"\\x1b[8$\": \"shift+end\",\n\t\"\\x1b[5^\": \"ctrl+pageUp\",\n\t\"\\x1b[6^\": \"ctrl+pageDown\",\n\t\"\\x1b[7^\": \"ctrl+home\",\n\t\"\\x1b[8^\": \"ctrl+end\",\n\t\"\\x1bOP\": \"f1\",\n\t\"\\x1bOQ\": \"f2\",\n\t\"\\x1bOR\": \"f3\",\n\t\"\\x1bOS\": \"f4\",\n\t\"\\x1b[11~\": \"f1\",\n\t\"\\x1b[12~\": \"f2\",\n\t\"\\x1b[13~\": \"f3\",\n\t\"\\x1b[14~\": \"f4\",\n\t\"\\x1b[[A\": \"f1\",\n\t\"\\x1b[[B\": \"f2\",\n\t\"\\x1b[[C\": \"f3\",\n\t\"\\x1b[[D\": \"f4\",\n\t\"\\x1b[[E\": \"f5\",\n\t\"\\x1b[15~\": \"f5\",\n\t\"\\x1b[17~\": \"f6\",\n\t\"\\x1b[18~\": \"f7\",\n\t\"\\x1b[19~\": \"f8\",\n\t\"\\x1b[20~\": \"f9\",\n\t\"\\x1b[21~\": \"f10\",\n\t\"\\x1b[23~\": \"f11\",\n\t\"\\x1b[24~\": \"f12\",\n\t\"\\x1bb\": \"alt+left\",\n\t\"\\x1bf\": \"alt+right\",\n\t\"\\x1bp\": \"alt+up\",\n\t\"\\x1bn\": \"alt+down\",\n} as const;\n\ntype LegacyModifierKey = keyof typeof LEGACY_SHIFT_SEQUENCES;\n\nconst matchesLegacySequence = (data: string, sequences: readonly string[]): boolean => sequences.includes(data);\n\nconst matchesLegacyModifierSequence = (data: string, key: LegacyModifierKey, modifier: number): boolean => {\n\tif (modifier === MODIFIERS.shift) {\n\t\treturn matchesLegacySequence(data, LEGACY_SHIFT_SEQUENCES[key]);\n\t}\n\tif (modifier === MODIFIERS.ctrl) {\n\t\treturn matchesLegacySequence(data, LEGACY_CTRL_SEQUENCES[key]);\n\t}\n\treturn false;\n};\n\n// =============================================================================\n// Kitty Protocol Parsing\n// =============================================================================\n\n/**\n * Event types from Kitty keyboard protocol (flag 2)\n * 1 = key press, 2 = key repeat, 3 = key release\n */\nexport type KeyEventType = \"press\" | \"repeat\" | \"release\";\n\ninterface ParsedKittySequence {\n\tcodepoint: number;\n\tshiftedKey?: number; // Shifted version of the key (when shift is pressed)\n\tbaseLayoutKey?: number; // Key in standard PC-101 layout (for non-Latin layouts)\n\tmodifier: number;\n\teventType: KeyEventType;\n}\n\ninterface ParsedModifyOtherKeysSequence {\n\tcodepoint: number;\n\tmodifier: number;\n}\n\n// Store the last parsed event type for isKeyRelease() to query\nlet _lastEventType: KeyEventType = \"press\";\n\n/**\n * Check if the last parsed key event was a key release.\n * Only meaningful when Kitty keyboard protocol with flag 2 is active.\n */\nexport function isKeyRelease(data: string): boolean {\n\t// Don't treat bracketed paste content as key release, even if it contains\n\t// patterns like \":3F\" (e.g., bluetooth MAC addresses like \"90:62:3F:A5\").\n\t// Terminal.ts re-wraps paste content with bracketed paste markers before\n\t// passing to TUI, so pasted data will always contain \\x1b[200~.\n\tif (data.includes(\"\\x1b[200~\")) {\n\t\treturn false;\n\t}\n\n\t// Quick check: release events with flag 2 contain \":3\"\n\t// Format: \\x1b[<codepoint>;<modifier>:3u\n\tif (\n\t\tdata.includes(\":3u\") ||\n\t\tdata.includes(\":3~\") ||\n\t\tdata.includes(\":3A\") ||\n\t\tdata.includes(\":3B\") ||\n\t\tdata.includes(\":3C\") ||\n\t\tdata.includes(\":3D\") ||\n\t\tdata.includes(\":3H\") ||\n\t\tdata.includes(\":3F\")\n\t) {\n\t\treturn true;\n\t}\n\treturn false;\n}\n\n/**\n * Check if the last parsed key event was a key repeat.\n * Only meaningful when Kitty keyboard protocol with flag 2 is active.\n */\nexport function isKeyRepeat(data: string): boolean {\n\t// Don't treat bracketed paste content as key repeat, even if it contains\n\t// patterns like \":2F\". See isKeyRelease() for details.\n\tif (data.includes(\"\\x1b[200~\")) {\n\t\treturn false;\n\t}\n\n\tif (\n\t\tdata.includes(\":2u\") ||\n\t\tdata.includes(\":2~\") ||\n\t\tdata.includes(\":2A\") ||\n\t\tdata.includes(\":2B\") ||\n\t\tdata.includes(\":2C\") ||\n\t\tdata.includes(\":2D\") ||\n\t\tdata.includes(\":2H\") ||\n\t\tdata.includes(\":2F\")\n\t) {\n\t\treturn true;\n\t}\n\treturn false;\n}\n\nfunction parseEventType(eventTypeStr: string | undefined): KeyEventType {\n\tif (!eventTypeStr) return \"press\";\n\tconst eventType = parseInt(eventTypeStr, 10);\n\tif (eventType === 2) return \"repeat\";\n\tif (eventType === 3) return \"release\";\n\treturn \"press\";\n}\n\nfunction parseKittySequence(data: string): ParsedKittySequence | null {\n\t// CSI u format with alternate keys (flag 4):\n\t// \\x1b[<codepoint>u\n\t// \\x1b[<codepoint>;<mod>u\n\t// \\x1b[<codepoint>;<mod>:<event>u\n\t// \\x1b[<codepoint>:<shifted>;<mod>u\n\t// \\x1b[<codepoint>:<shifted>:<base>;<mod>u\n\t// \\x1b[<codepoint>::<base>;<mod>u (no shifted key, only base)\n\t//\n\t// With flag 2, event type is appended after modifier colon: 1=press, 2=repeat, 3=release\n\t// With flag 4, alternate keys are appended after codepoint with colons\n\tconst csiUMatch = data.match(/^\\x1b\\[(\\d+)(?::(\\d*))?(?::(\\d+))?(?:;(\\d+))?(?::(\\d+))?u$/);\n\tif (csiUMatch) {\n\t\tconst codepoint = parseInt(csiUMatch[1]!, 10);\n\t\tconst shiftedKey = csiUMatch[2] && csiUMatch[2].length > 0 ? parseInt(csiUMatch[2], 10) : undefined;\n\t\tconst baseLayoutKey = csiUMatch[3] ? parseInt(csiUMatch[3], 10) : undefined;\n\t\tconst modValue = csiUMatch[4] ? parseInt(csiUMatch[4], 10) : 1;\n\t\tconst eventType = parseEventType(csiUMatch[5]);\n\t\t_lastEventType = eventType;\n\t\treturn { codepoint, shiftedKey, baseLayoutKey, modifier: modValue - 1, eventType };\n\t}\n\n\t// Arrow keys with modifier: \\x1b[1;<mod>A/B/C/D or \\x1b[1;<mod>:<event>A/B/C/D\n\tconst arrowMatch = data.match(/^\\x1b\\[1;(\\d+)(?::(\\d+))?([ABCD])$/);\n\tif (arrowMatch) {\n\t\tconst modValue = parseInt(arrowMatch[1]!, 10);\n\t\tconst eventType = parseEventType(arrowMatch[2]);\n\t\tconst arrowCodes: Record<string, number> = { A: -1, B: -2, C: -3, D: -4 };\n\t\t_lastEventType = eventType;\n\t\treturn { codepoint: arrowCodes[arrowMatch[3]!]!, modifier: modValue - 1, eventType };\n\t}\n\n\t// Functional keys: \\x1b[<num>~ or \\x1b[<num>;<mod>~ or \\x1b[<num>;<mod>:<event>~\n\tconst funcMatch = data.match(/^\\x1b\\[(\\d+)(?:;(\\d+))?(?::(\\d+))?~$/);\n\tif (funcMatch) {\n\t\tconst keyNum = parseInt(funcMatch[1]!, 10);\n\t\tconst modValue = funcMatch[2] ? parseInt(funcMatch[2], 10) : 1;\n\t\tconst eventType = parseEventType(funcMatch[3]);\n\t\tconst funcCodes: Record<number, number> = {\n\t\t\t2: FUNCTIONAL_CODEPOINTS.insert,\n\t\t\t3: FUNCTIONAL_CODEPOINTS.delete,\n\t\t\t5: FUNCTIONAL_CODEPOINTS.pageUp,\n\t\t\t6: FUNCTIONAL_CODEPOINTS.pageDown,\n\t\t\t7: FUNCTIONAL_CODEPOINTS.home,\n\t\t\t8: FUNCTIONAL_CODEPOINTS.end,\n\t\t};\n\t\tconst codepoint = funcCodes[keyNum];\n\t\tif (codepoint !== undefined) {\n\t\t\t_lastEventType = eventType;\n\t\t\treturn { codepoint, modifier: modValue - 1, eventType };\n\t\t}\n\t}\n\n\t// Home/End with modifier: \\x1b[1;<mod>H/F or \\x1b[1;<mod>:<event>H/F\n\tconst homeEndMatch = data.match(/^\\x1b\\[1;(\\d+)(?::(\\d+))?([HF])$/);\n\tif (homeEndMatch) {\n\t\tconst modValue = parseInt(homeEndMatch[1]!, 10);\n\t\tconst eventType = parseEventType(homeEndMatch[2]);\n\t\tconst codepoint = homeEndMatch[3] === \"H\" ? FUNCTIONAL_CODEPOINTS.home : FUNCTIONAL_CODEPOINTS.end;\n\t\t_lastEventType = eventType;\n\t\treturn { codepoint, modifier: modValue - 1, eventType };\n\t}\n\n\treturn null;\n}\n\nfunction matchesKittySequence(data: string, expectedCodepoint: number, expectedModifier: number): boolean {\n\tconst parsed = parseKittySequence(data);\n\tif (!parsed) return false;\n\tconst actualMod = parsed.modifier & ~LOCK_MASK;\n\tconst expectedMod = expectedModifier & ~LOCK_MASK;\n\n\t// Check if modifiers match\n\tif (actualMod !== expectedMod) return false;\n\n\tconst normalizedCodepoint = normalizeShiftedLetterIdentityCodepoint(\n\t\tnormalizeKittyFunctionalCodepoint(parsed.codepoint),\n\t\tparsed.modifier,\n\t);\n\tconst normalizedExpectedCodepoint = normalizeShiftedLetterIdentityCodepoint(\n\t\tnormalizeKittyFunctionalCodepoint(expectedCodepoint),\n\t\texpectedModifier,\n\t);\n\n\t// Primary match: codepoint matches directly after normalizing functional keys\n\tif (normalizedCodepoint === normalizedExpectedCodepoint) return true;\n\n\t// Alternate match: use base layout key for non-Latin keyboard layouts.\n\t// This allows Ctrl+С (Cyrillic) to match Ctrl+c (Latin) when terminal reports\n\t// the base layout key (the key in standard PC-101 layout).\n\t//\n\t// Only fall back to base layout key when the codepoint is NOT already a\n\t// recognized Latin letter (a-z) or symbol (e.g., /, -, [, ;, etc.).\n\t// When the codepoint is a recognized key, it is authoritative regardless\n\t// of physical key position. This prevents remapped layouts (Dvorak, Colemak,\n\t// xremap, etc.) from causing false matches: both letters and symbols move\n\t// to different physical positions, so Ctrl+K could falsely match Ctrl+V\n\t// (letter remapping) and Ctrl+/ could falsely match Ctrl+[ (symbol remapping)\n\t// if the base layout key were always considered.\n\tif (parsed.baseLayoutKey !== undefined && parsed.baseLayoutKey === expectedCodepoint) {\n\t\tconst cp = normalizedCodepoint;\n\t\tconst isLatinLetter = cp >= 97 && cp <= 122; // a-z\n\t\tconst isKnownSymbol = SYMBOL_KEYS.has(String.fromCharCode(cp));\n\t\tif (!isLatinLetter && !isKnownSymbol) return true;\n\t}\n\n\treturn false;\n}\n\nfunction parseModifyOtherKeysSequence(data: string): ParsedModifyOtherKeysSequence | null {\n\tconst match = data.match(/^\\x1b\\[27;(\\d+);(\\d+)~$/);\n\tif (!match) return null;\n\tconst modValue = parseInt(match[1]!, 10);\n\tconst codepoint = parseInt(match[2]!, 10);\n\treturn { codepoint, modifier: modValue - 1 };\n}\n\n/**\n * Match xterm modifyOtherKeys format: CSI 27 ; modifiers ; keycode ~\n * This is used by terminals when Kitty protocol is not enabled.\n * Modifier values are 1-indexed: 2=shift, 3=alt, 5=ctrl, etc.\n */\nfunction matchesModifyOtherKeys(data: string, expectedKeycode: number, expectedModifier: number): boolean {\n\tconst parsed = parseModifyOtherKeysSequence(data);\n\tif (!parsed) return false;\n\treturn parsed.codepoint === expectedKeycode && parsed.modifier === expectedModifier;\n}\n\nfunction isWindowsTerminalSession(): boolean {\n\treturn (\n\t\tBoolean(process.env.WT_SESSION) && !process.env.SSH_CONNECTION && !process.env.SSH_CLIENT && !process.env.SSH_TTY\n\t);\n}\n\n/**\n * Raw 0x08 (BS) is ambiguous in legacy terminals.\n *\n * - Windows Terminal uses it for Ctrl+Backspace.\n * - Some legacy terminals and tmux setups send it for plain Backspace.\n *\n * Prefer explicit Kitty / CSI-u / modifyOtherKeys sequences whenever they are\n * available. Fall back to a Windows Terminal heuristic only for raw BS bytes.\n */\nfunction matchesRawBackspace(data: string, expectedModifier: number): boolean {\n\tif (data === \"\\x7f\") return expectedModifier === 0;\n\tif (data !== \"\\x08\") return false;\n\treturn isWindowsTerminalSession() ? expectedModifier === MODIFIERS.ctrl : expectedModifier === 0;\n}\n\n// =============================================================================\n// Generic Key Matching\n// =============================================================================\n\n/**\n * Get the control character for a key.\n * Uses the universal formula: code & 0x1f (mask to lower 5 bits)\n *\n * Works for:\n * - Letters a-z → 1-26\n * - Symbols [\\]_ → 27, 28, 29, 31\n * - Also maps - to same as _ (same physical key on US keyboards)\n */\nfunction rawCtrlChar(key: string): string | null {\n\tconst char = key.toLowerCase();\n\tconst code = char.charCodeAt(0);\n\tif ((code >= 97 && code <= 122) || char === \"[\" || char === \"\\\\\" || char === \"]\" || char === \"_\") {\n\t\treturn String.fromCharCode(code & 0x1f);\n\t}\n\t// Handle - as _ (same physical key on US keyboards)\n\tif (char === \"-\") {\n\t\treturn String.fromCharCode(31); // Same as Ctrl+_\n\t}\n\treturn null;\n}\n\nfunction isDigitKey(key: string): boolean {\n\treturn key >= \"0\" && key <= \"9\";\n}\n\nfunction matchesPrintableModifyOtherKeys(data: string, expectedKeycode: number, expectedModifier: number): boolean {\n\tif (expectedModifier === 0) return false;\n\tconst parsed = parseModifyOtherKeysSequence(data);\n\tif (!parsed || parsed.modifier !== expectedModifier) return false;\n\treturn (\n\t\tnormalizeShiftedLetterIdentityCodepoint(parsed.codepoint, parsed.modifier) ===\n\t\tnormalizeShiftedLetterIdentityCodepoint(expectedKeycode, expectedModifier)\n\t);\n}\n\nfunction formatKeyNameWithModifiers(keyName: string, modifier: number): string | undefined {\n\tconst mods: string[] = [];\n\tconst effectiveMod = modifier & ~LOCK_MASK;\n\tconst supportedModifierMask = MODIFIERS.shift | MODIFIERS.ctrl | MODIFIERS.alt | MODIFIERS.super;\n\tif ((effectiveMod & ~supportedModifierMask) !== 0) return undefined;\n\tif (effectiveMod & MODIFIERS.shift) mods.push(\"shift\");\n\tif (effectiveMod & MODIFIERS.ctrl) mods.push(\"ctrl\");\n\tif (effectiveMod & MODIFIERS.alt) mods.push(\"alt\");\n\tif (effectiveMod & MODIFIERS.super) mods.push(\"super\");\n\treturn mods.length > 0 ? `${mods.join(\"+\")}+${keyName}` : keyName;\n}\n\nfunction parseKeyId(\n\tkeyId: string,\n): { key: string; ctrl: boolean; shift: boolean; alt: boolean; super: boolean } | null {\n\tconst parts = keyId.toLowerCase().split(\"+\");\n\tconst key = parts[parts.length - 1];\n\tif (!key) return null;\n\treturn {\n\t\tkey,\n\t\tctrl: parts.includes(\"ctrl\"),\n\t\tshift: parts.includes(\"shift\"),\n\t\talt: parts.includes(\"alt\"),\n\t\tsuper: parts.includes(\"super\"),\n\t};\n}\n\n/**\n * Match input data against a key identifier string.\n *\n * Supported key identifiers:\n * - Single keys: \"escape\", \"tab\", \"enter\", \"backspace\", \"delete\", \"home\", \"end\", \"space\"\n * - Arrow keys: \"up\", \"down\", \"left\", \"right\"\n * - Ctrl combinations: \"ctrl+c\", \"ctrl+z\", etc.\n * - Shift combinations: \"shift+tab\", \"shift+enter\"\n * - Alt combinations: \"alt+enter\", \"alt+backspace\"\n * - Super combinations: \"super+k\", \"super+enter\"\n * - Combined modifiers: \"shift+ctrl+p\", \"ctrl+alt+x\", \"ctrl+super+k\"\n *\n * Use the Key helper for autocomplete: Key.ctrl(\"c\"), Key.escape, Key.ctrlShift(\"p\"), Key.super(\"k\")\n *\n * @param data - Raw input data from terminal\n * @param keyId - Key identifier (e.g., \"ctrl+c\", \"escape\", Key.ctrl(\"c\"))\n */\nexport function matchesKey(data: string, keyId: KeyId): boolean {\n\tconst parsed = parseKeyId(keyId);\n\tif (!parsed) return false;\n\n\tconst { key, ctrl, shift, alt, super: superModifier } = parsed;\n\tlet modifier = 0;\n\tif (shift) modifier |= MODIFIERS.shift;\n\tif (alt) modifier |= MODIFIERS.alt;\n\tif (ctrl) modifier |= MODIFIERS.ctrl;\n\tif (superModifier) modifier |= MODIFIERS.super;\n\n\tswitch (key) {\n\t\tcase \"escape\":\n\t\tcase \"esc\":\n\t\t\tif (modifier !== 0) return false;\n\t\t\treturn (\n\t\t\t\tdata === \"\\x1b\" ||\n\t\t\t\tmatchesKittySequence(data, CODEPOINTS.escape, 0) ||\n\t\t\t\tmatchesModifyOtherKeys(data, CODEPOINTS.escape, 0)\n\t\t\t);\n\n\t\tcase \"space\":\n\t\t\tif (!_kittyProtocolActive) {\n\t\t\t\tif (modifier === MODIFIERS.ctrl && data === \"\\x00\") {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tif (modifier === MODIFIERS.alt && data === \"\\x1b \") {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (modifier === 0) {\n\t\t\t\treturn (\n\t\t\t\t\tdata === \" \" ||\n\t\t\t\t\tmatchesKittySequence(data, CODEPOINTS.space, 0) ||\n\t\t\t\t\tmatchesModifyOtherKeys(data, CODEPOINTS.space, 0)\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn (\n\t\t\t\tmatchesKittySequence(data, CODEPOINTS.space, modifier) ||\n\t\t\t\tmatchesModifyOtherKeys(data, CODEPOINTS.space, modifier)\n\t\t\t);\n\n\t\tcase \"tab\":\n\t\t\tif (modifier === MODIFIERS.shift) {\n\t\t\t\treturn (\n\t\t\t\t\tdata === \"\\x1b[Z\" ||\n\t\t\t\t\tmatchesKittySequence(data, CODEPOINTS.tab, MODIFIERS.shift) ||\n\t\t\t\t\tmatchesModifyOtherKeys(data, CODEPOINTS.tab, MODIFIERS.shift)\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (modifier === 0) {\n\t\t\t\treturn data === \"\\t\" || matchesKittySequence(data, CODEPOINTS.tab, 0);\n\t\t\t}\n\t\t\treturn (\n\t\t\t\tmatchesKittySequence(data, CODEPOINTS.tab, modifier) ||\n\t\t\t\tmatchesModifyOtherKeys(data, CODEPOINTS.tab, modifier)\n\t\t\t);\n\n\t\tcase \"enter\":\n\t\tcase \"return\":\n\t\t\tif (modifier === MODIFIERS.shift) {\n\t\t\t\t// CSI u sequences (standard Kitty protocol)\n\t\t\t\tif (\n\t\t\t\t\tmatchesKittySequence(data, CODEPOINTS.enter, MODIFIERS.shift) ||\n\t\t\t\t\tmatchesKittySequence(data, CODEPOINTS.kpEnter, MODIFIERS.shift)\n\t\t\t\t) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t// xterm modifyOtherKeys format (fallback when Kitty protocol not enabled)\n\t\t\t\tif (matchesModifyOtherKeys(data, CODEPOINTS.enter, MODIFIERS.shift)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t// When Kitty protocol is active, legacy sequences are custom terminal mappings\n\t\t\t\t// \\x1b\\r = Kitty's \"map shift+enter send_text all \\e\\r\"\n\t\t\t\t// \\n = Ghostty's \"keybind = shift+enter=text:\\n\"\n\t\t\t\tif (_kittyProtocolActive) {\n\t\t\t\t\treturn data === \"\\x1b\\r\" || data === \"\\n\";\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (modifier === MODIFIERS.alt) {\n\t\t\t\t// CSI u sequences (standard Kitty protocol)\n\t\t\t\tif (\n\t\t\t\t\tmatchesKittySequence(data, CODEPOINTS.enter, MODIFIERS.alt) ||\n\t\t\t\t\tmatchesKittySequence(data, CODEPOINTS.kpEnter, MODIFIERS.alt)\n\t\t\t\t) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t// xterm modifyOtherKeys format (fallback when Kitty protocol not enabled)\n\t\t\t\tif (matchesModifyOtherKeys(data, CODEPOINTS.enter, MODIFIERS.alt)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t// \\x1b\\r is alt+enter only in legacy mode (no Kitty protocol)\n\t\t\t\t// When Kitty protocol is active, alt+enter comes as CSI u sequence\n\t\t\t\tif (!_kittyProtocolActive) {\n\t\t\t\t\treturn data === \"\\x1b\\r\";\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (modifier === 0) {\n\t\t\t\treturn (\n\t\t\t\t\tdata === \"\\r\" ||\n\t\t\t\t\t(!_kittyProtocolActive && data === \"\\n\") ||\n\t\t\t\t\tdata === \"\\x1bOM\" || // SS3 M (numpad enter in some terminals)\n\t\t\t\t\tmatchesKittySequence(data, CODEPOINTS.enter, 0) ||\n\t\t\t\t\tmatchesKittySequence(data, CODEPOINTS.kpEnter, 0)\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn (\n\t\t\t\tmatchesKittySequence(data, CODEPOINTS.enter, modifier) ||\n\t\t\t\tmatchesKittySequence(data, CODEPOINTS.kpEnter, modifier) ||\n\t\t\t\tmatchesModifyOtherKeys(data, CODEPOINTS.enter, modifier)\n\t\t\t);\n\n\t\tcase \"backspace\":\n\t\t\tif (modifier === MODIFIERS.alt) {\n\t\t\t\tif (data === \"\\x1b\\x7f\" || data === \"\\x1b\\b\") {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn (\n\t\t\t\t\tmatchesKittySequence(data, CODEPOINTS.backspace, MODIFIERS.alt) ||\n\t\t\t\t\tmatchesModifyOtherKeys(data, CODEPOINTS.backspace, MODIFIERS.alt)\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (modifier === MODIFIERS.ctrl) {\n\t\t\t\t// Legacy raw 0x08 is ambiguous: it can be Ctrl+Backspace on Windows\n\t\t\t\t// Terminal or plain Backspace on other terminals, while also\n\t\t\t\t// overlapping with Ctrl+H.\n\t\t\t\tif (matchesRawBackspace(data, MODIFIERS.ctrl)) return true;\n\t\t\t\treturn (\n\t\t\t\t\tmatchesKittySequence(data, CODEPOINTS.backspace, MODIFIERS.ctrl) ||\n\t\t\t\t\tmatchesModifyOtherKeys(data, CODEPOINTS.backspace, MODIFIERS.ctrl)\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (modifier === 0) {\n\t\t\t\treturn (\n\t\t\t\t\tmatchesRawBackspace(data, 0) ||\n\t\t\t\t\tmatchesKittySequence(data, CODEPOINTS.backspace, 0) ||\n\t\t\t\t\tmatchesModifyOtherKeys(data, CODEPOINTS.backspace, 0)\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn (\n\t\t\t\tmatchesKittySequence(data, CODEPOINTS.backspace, modifier) ||\n\t\t\t\tmatchesModifyOtherKeys(data, CODEPOINTS.backspace, modifier)\n\t\t\t);\n\n\t\tcase \"insert\":\n\t\t\tif (modifier === 0) {\n\t\t\t\treturn (\n\t\t\t\t\tmatchesLegacySequence(data, LEGACY_KEY_SEQUENCES.insert) ||\n\t\t\t\t\tmatchesKittySequence(data, FUNCTIONAL_CODEPOINTS.insert, 0)\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (matchesLegacyModifierSequence(data, \"insert\", modifier)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn matchesKittySequence(data, FUNCTIONAL_CODEPOINTS.insert, modifier);\n\n\t\tcase \"delete\":\n\t\t\tif (modifier === 0) {\n\t\t\t\treturn (\n\t\t\t\t\tmatchesLegacySequence(data, LEGACY_KEY_SEQUENCES.delete) ||\n\t\t\t\t\tmatchesKittySequence(data, FUNCTIONAL_CODEPOINTS.delete, 0)\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (matchesLegacyModifierSequence(data, \"delete\", modifier)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn matchesKittySequence(data, FUNCTIONAL_CODEPOINTS.delete, modifier);\n\n\t\tcase \"clear\":\n\t\t\tif (modifier === 0) {\n\t\t\t\treturn matchesLegacySequence(data, LEGACY_KEY_SEQUENCES.clear);\n\t\t\t}\n\t\t\treturn matchesLegacyModifierSequence(data, \"clear\", modifier);\n\n\t\tcase \"home\":\n\t\t\tif (modifier === 0) {\n\t\t\t\treturn (\n\t\t\t\t\tmatchesLegacySequence(data, LEGACY_KEY_SEQUENCES.home) ||\n\t\t\t\t\tmatchesKittySequence(data, FUNCTIONAL_CODEPOINTS.home, 0)\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (matchesLegacyModifierSequence(data, \"home\", modifier)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn matchesKittySequence(data, FUNCTIONAL_CODEPOINTS.home, modifier);\n\n\t\tcase \"end\":\n\t\t\tif (modifier === 0) {\n\t\t\t\treturn (\n\t\t\t\t\tmatchesLegacySequence(data, LEGACY_KEY_SEQUENCES.end) ||\n\t\t\t\t\tmatchesKittySequence(data, FUNCTIONAL_CODEPOINTS.end, 0)\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (matchesLegacyModifierSequence(data, \"end\", modifier)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn matchesKittySequence(data, FUNCTIONAL_CODEPOINTS.end, modifier);\n\n\t\tcase \"pageup\":\n\t\t\tif (modifier === 0) {\n\t\t\t\treturn (\n\t\t\t\t\tmatchesLegacySequence(data, LEGACY_KEY_SEQUENCES.pageUp) ||\n\t\t\t\t\tmatchesKittySequence(data, FUNCTIONAL_CODEPOINTS.pageUp, 0)\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (matchesLegacyModifierSequence(data, \"pageUp\", modifier)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn matchesKittySequence(data, FUNCTIONAL_CODEPOINTS.pageUp, modifier);\n\n\t\tcase \"pagedown\":\n\t\t\tif (modifier === 0) {\n\t\t\t\treturn (\n\t\t\t\t\tmatchesLegacySequence(data, LEGACY_KEY_SEQUENCES.pageDown) ||\n\t\t\t\t\tmatchesKittySequence(data, FUNCTIONAL_CODEPOINTS.pageDown, 0)\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (matchesLegacyModifierSequence(data, \"pageDown\", modifier)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn matchesKittySequence(data, FUNCTIONAL_CODEPOINTS.pageDown, modifier);\n\n\t\tcase \"up\":\n\t\t\tif (modifier === MODIFIERS.alt) {\n\t\t\t\treturn data === \"\\x1bp\" || matchesKittySequence(data, ARROW_CODEPOINTS.up, MODIFIERS.alt);\n\t\t\t}\n\t\t\tif (modifier === 0) {\n\t\t\t\treturn (\n\t\t\t\t\tmatchesLegacySequence(data, LEGACY_KEY_SEQUENCES.up) ||\n\t\t\t\t\tmatchesKittySequence(data, ARROW_CODEPOINTS.up, 0)\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (matchesLegacyModifierSequence(data, \"up\", modifier)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn matchesKittySequence(data, ARROW_CODEPOINTS.up, modifier);\n\n\t\tcase \"down\":\n\t\t\tif (modifier === MODIFIERS.alt) {\n\t\t\t\treturn data === \"\\x1bn\" || matchesKittySequence(data, ARROW_CODEPOINTS.down, MODIFIERS.alt);\n\t\t\t}\n\t\t\tif (modifier === 0) {\n\t\t\t\treturn (\n\t\t\t\t\tmatchesLegacySequence(data, LEGACY_KEY_SEQUENCES.down) ||\n\t\t\t\t\tmatchesKittySequence(data, ARROW_CODEPOINTS.down, 0)\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (matchesLegacyModifierSequence(data, \"down\", modifier)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn matchesKittySequence(data, ARROW_CODEPOINTS.down, modifier);\n\n\t\tcase \"left\":\n\t\t\tif (modifier === MODIFIERS.alt) {\n\t\t\t\treturn (\n\t\t\t\t\tdata === \"\\x1b[1;3D\" ||\n\t\t\t\t\t(!_kittyProtocolActive && data === \"\\x1bB\") ||\n\t\t\t\t\tdata === \"\\x1bb\" ||\n\t\t\t\t\tmatchesKittySequence(data, ARROW_CODEPOINTS.left, MODIFIERS.alt)\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (modifier === MODIFIERS.ctrl) {\n\t\t\t\treturn (\n\t\t\t\t\tdata === \"\\x1b[1;5D\" ||\n\t\t\t\t\tmatchesLegacyModifierSequence(data, \"left\", MODIFIERS.ctrl) ||\n\t\t\t\t\tmatchesKittySequence(data, ARROW_CODEPOINTS.left, MODIFIERS.ctrl)\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (modifier === 0) {\n\t\t\t\treturn (\n\t\t\t\t\tmatchesLegacySequence(data, LEGACY_KEY_SEQUENCES.left) ||\n\t\t\t\t\tmatchesKittySequence(data, ARROW_CODEPOINTS.left, 0)\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (matchesLegacyModifierSequence(data, \"left\", modifier)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn matchesKittySequence(data, ARROW_CODEPOINTS.left, modifier);\n\n\t\tcase \"right\":\n\t\t\tif (modifier === MODIFIERS.alt) {\n\t\t\t\treturn (\n\t\t\t\t\tdata === \"\\x1b[1;3C\" ||\n\t\t\t\t\t(!_kittyProtocolActive && data === \"\\x1bF\") ||\n\t\t\t\t\tdata === \"\\x1bf\" ||\n\t\t\t\t\tmatchesKittySequence(data, ARROW_CODEPOINTS.right, MODIFIERS.alt)\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (modifier === MODIFIERS.ctrl) {\n\t\t\t\treturn (\n\t\t\t\t\tdata === \"\\x1b[1;5C\" ||\n\t\t\t\t\tmatchesLegacyModifierSequence(data, \"right\", MODIFIERS.ctrl) ||\n\t\t\t\t\tmatchesKittySequence(data, ARROW_CODEPOINTS.right, MODIFIERS.ctrl)\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (modifier === 0) {\n\t\t\t\treturn (\n\t\t\t\t\tmatchesLegacySequence(data, LEGACY_KEY_SEQUENCES.right) ||\n\t\t\t\t\tmatchesKittySequence(data, ARROW_CODEPOINTS.right, 0)\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (matchesLegacyModifierSequence(data, \"right\", modifier)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn matchesKittySequence(data, ARROW_CODEPOINTS.right, modifier);\n\n\t\tcase \"f1\":\n\t\tcase \"f2\":\n\t\tcase \"f3\":\n\t\tcase \"f4\":\n\t\tcase \"f5\":\n\t\tcase \"f6\":\n\t\tcase \"f7\":\n\t\tcase \"f8\":\n\t\tcase \"f9\":\n\t\tcase \"f10\":\n\t\tcase \"f11\":\n\t\tcase \"f12\": {\n\t\t\tif (modifier !== 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tconst functionKey = key as keyof typeof LEGACY_KEY_SEQUENCES;\n\t\t\treturn matchesLegacySequence(data, LEGACY_KEY_SEQUENCES[functionKey]);\n\t\t}\n\t}\n\n\t// Handle single letter/digit keys and symbols\n\tif (key.length === 1 && ((key >= \"a\" && key <= \"z\") || isDigitKey(key) || SYMBOL_KEYS.has(key))) {\n\t\tconst codepoint = key.charCodeAt(0);\n\t\tconst rawCtrl = rawCtrlChar(key);\n\t\tconst isLetter = key >= \"a\" && key <= \"z\";\n\t\tconst isDigit = isDigitKey(key);\n\n\t\tif (modifier === MODIFIERS.ctrl + MODIFIERS.alt && !_kittyProtocolActive && rawCtrl) {\n\t\t\t// Legacy: ctrl+alt+key is ESC followed by the control character.\n\t\t\t// If that legacy form does not match, continue so CSI-u and\n\t\t\t// modifyOtherKeys sequences from tmux can still be recognized.\n\t\t\tif (data === `\\x1b${rawCtrl}`) return true;\n\t\t}\n\n\t\tif (modifier === MODIFIERS.alt && !_kittyProtocolActive && (isLetter || isDigit || SYMBOL_KEYS.has(key))) {\n\t\t\t// Legacy: alt+printable key is ESC followed by the key\n\t\t\tif (data === `\\x1b${key}`) return true;\n\t\t}\n\n\t\tif (modifier === MODIFIERS.ctrl) {\n\t\t\t// Legacy: ctrl+key sends the control character\n\t\t\tif (rawCtrl && data === rawCtrl) return true;\n\t\t\treturn (\n\t\t\t\tmatchesKittySequence(data, codepoint, MODIFIERS.ctrl) ||\n\t\t\t\tmatchesPrintableModifyOtherKeys(data, codepoint, MODIFIERS.ctrl)\n\t\t\t);\n\t\t}\n\n\t\tif (modifier === MODIFIERS.shift + MODIFIERS.ctrl) {\n\t\t\treturn (\n\t\t\t\tmatchesKittySequence(data, codepoint, MODIFIERS.shift + MODIFIERS.ctrl) ||\n\t\t\t\tmatchesPrintableModifyOtherKeys(data, codepoint, MODIFIERS.shift + MODIFIERS.ctrl)\n\t\t\t);\n\t\t}\n\n\t\tif (modifier === MODIFIERS.shift) {\n\t\t\t// Legacy: shift+letter produces uppercase\n\t\t\tif (isLetter && data === key.toUpperCase()) return true;\n\t\t\treturn (\n\t\t\t\tmatchesKittySequence(data, codepoint, MODIFIERS.shift) ||\n\t\t\t\tmatchesPrintableModifyOtherKeys(data, codepoint, MODIFIERS.shift)\n\t\t\t);\n\t\t}\n\n\t\tif (modifier !== 0) {\n\t\t\treturn (\n\t\t\t\tmatchesKittySequence(data, codepoint, modifier) ||\n\t\t\t\tmatchesPrintableModifyOtherKeys(data, codepoint, modifier)\n\t\t\t);\n\t\t}\n\n\t\t// Check both raw char and Kitty sequence (needed for release events)\n\t\treturn data === key || matchesKittySequence(data, codepoint, 0);\n\t}\n\n\treturn false;\n}\n\n/**\n * Parse input data and return the key identifier if recognized.\n *\n * @param data - Raw input data from terminal\n * @returns Key identifier string (e.g., \"ctrl+c\") or undefined\n */\nfunction formatParsedKey(codepoint: number, modifier: number, baseLayoutKey?: number): string | undefined {\n\tconst normalizedCodepoint = normalizeKittyFunctionalCodepoint(codepoint);\n\tconst identityCodepoint = normalizeShiftedLetterIdentityCodepoint(normalizedCodepoint, modifier);\n\n\t// Use base layout key only when codepoint is not a recognized Latin\n\t// letter (a-z), digit (0-9), or symbol (/, -, [, ;, etc.). For those,\n\t// the codepoint is authoritative regardless of physical key position.\n\t// This prevents remapped layouts (Dvorak, Colemak, xremap, etc.) from\n\t// reporting the wrong key name based on the QWERTY physical position.\n\tconst isLatinLetter = identityCodepoint >= 97 && identityCodepoint <= 122; // a-z\n\tconst isDigit = identityCodepoint >= 48 && identityCodepoint <= 57; // 0-9\n\tconst isKnownSymbol = SYMBOL_KEYS.has(String.fromCharCode(identityCodepoint));\n\tconst effectiveCodepoint =\n\t\tisLatinLetter || isDigit || isKnownSymbol ? identityCodepoint : (baseLayoutKey ?? identityCodepoint);\n\n\tlet keyName: string | undefined;\n\tif (effectiveCodepoint === CODEPOINTS.escape) keyName = \"escape\";\n\telse if (effectiveCodepoint === CODEPOINTS.tab) keyName = \"tab\";\n\telse if (effectiveCodepoint === CODEPOINTS.enter || effectiveCodepoint === CODEPOINTS.kpEnter) keyName = \"enter\";\n\telse if (effectiveCodepoint === CODEPOINTS.space) keyName = \"space\";\n\telse if (effectiveCodepoint === CODEPOINTS.backspace) keyName = \"backspace\";\n\telse if (effectiveCodepoint === FUNCTIONAL_CODEPOINTS.delete) keyName = \"delete\";\n\telse if (effectiveCodepoint === FUNCTIONAL_CODEPOINTS.insert) keyName = \"insert\";\n\telse if (effectiveCodepoint === FUNCTIONAL_CODEPOINTS.home) keyName = \"home\";\n\telse if (effectiveCodepoint === FUNCTIONAL_CODEPOINTS.end) keyName = \"end\";\n\telse if (effectiveCodepoint === FUNCTIONAL_CODEPOINTS.pageUp) keyName = \"pageUp\";\n\telse if (effectiveCodepoint === FUNCTIONAL_CODEPOINTS.pageDown) keyName = \"pageDown\";\n\telse if (effectiveCodepoint === ARROW_CODEPOINTS.up) keyName = \"up\";\n\telse if (effectiveCodepoint === ARROW_CODEPOINTS.down) keyName = \"down\";\n\telse if (effectiveCodepoint === ARROW_CODEPOINTS.left) keyName = \"left\";\n\telse if (effectiveCodepoint === ARROW_CODEPOINTS.right) keyName = \"right\";\n\telse if (effectiveCodepoint >= 48 && effectiveCodepoint <= 57) keyName = String.fromCharCode(effectiveCodepoint);\n\telse if (effectiveCodepoint >= 97 && effectiveCodepoint <= 122) keyName = String.fromCharCode(effectiveCodepoint);\n\telse if (SYMBOL_KEYS.has(String.fromCharCode(effectiveCodepoint))) keyName = String.fromCharCode(effectiveCodepoint);\n\n\tif (!keyName) return undefined;\n\treturn formatKeyNameWithModifiers(keyName, modifier);\n}\n\nexport function parseKey(data: string): string | undefined {\n\tconst kitty = parseKittySequence(data);\n\tif (kitty) {\n\t\treturn formatParsedKey(kitty.codepoint, kitty.modifier, kitty.baseLayoutKey);\n\t}\n\n\tconst modifyOtherKeys = parseModifyOtherKeysSequence(data);\n\tif (modifyOtherKeys) {\n\t\treturn formatParsedKey(modifyOtherKeys.codepoint, modifyOtherKeys.modifier);\n\t}\n\n\t// Mode-aware legacy sequences\n\t// When Kitty protocol is active, ambiguous sequences are interpreted as custom terminal mappings:\n\t// - \\x1b\\r = shift+enter (Kitty mapping), not alt+enter\n\t// - \\n = shift+enter (Ghostty mapping)\n\tif (_kittyProtocolActive) {\n\t\tif (data === \"\\x1b\\r\" || data === \"\\n\") return \"shift+enter\";\n\t}\n\n\tconst legacySequenceKeyId = LEGACY_SEQUENCE_KEY_IDS[data];\n\tif (legacySequenceKeyId) return legacySequenceKeyId;\n\n\t// Legacy sequences (used when Kitty protocol is not active, or for unambiguous sequences)\n\tif (data === \"\\x1b\") return \"escape\";\n\tif (data === \"\\x1c\") return \"ctrl+\\\\\";\n\tif (data === \"\\x1d\") return \"ctrl+]\";\n\tif (data === \"\\x1f\") return \"ctrl+-\";\n\tif (data === \"\\x1b\\x1b\") return \"ctrl+alt+[\";\n\tif (data === \"\\x1b\\x1c\") return \"ctrl+alt+\\\\\";\n\tif (data === \"\\x1b\\x1d\") return \"ctrl+alt+]\";\n\tif (data === \"\\x1b\\x1f\") return \"ctrl+alt+-\";\n\tif (data === \"\\t\") return \"tab\";\n\tif (data === \"\\r\" || (!_kittyProtocolActive && data === \"\\n\") || data === \"\\x1bOM\") return \"enter\";\n\tif (data === \"\\x00\") return \"ctrl+space\";\n\tif (data === \" \") return \"space\";\n\tif (data === \"\\x7f\") return \"backspace\";\n\tif (data === \"\\x08\") return isWindowsTerminalSession() ? \"ctrl+backspace\" : \"backspace\";\n\tif (data === \"\\x1b[Z\") return \"shift+tab\";\n\tif (!_kittyProtocolActive && data === \"\\x1b\\r\") return \"alt+enter\";\n\tif (!_kittyProtocolActive && data === \"\\x1b \") return \"alt+space\";\n\tif (data === \"\\x1b\\x7f\" || data === \"\\x1b\\b\") return \"alt+backspace\";\n\tif (!_kittyProtocolActive && data === \"\\x1bB\") return \"alt+left\";\n\tif (!_kittyProtocolActive && data === \"\\x1bF\") return \"alt+right\";\n\tif (!_kittyProtocolActive && data.length === 2 && data[0] === \"\\x1b\") {\n\t\tconst code = data.charCodeAt(1);\n\t\tif (code >= 1 && code <= 26) {\n\t\t\treturn `ctrl+alt+${String.fromCharCode(code + 96)}`;\n\t\t}\n\t\t// Legacy alt+letter/digit/symbol (ESC followed by the key)\n\t\tconst key = String.fromCharCode(code);\n\t\tif ((code >= 97 && code <= 122) || (code >= 48 && code <= 57) || SYMBOL_KEYS.has(key)) {\n\t\t\treturn `alt+${key}`;\n\t\t}\n\t}\n\tif (data === \"\\x1b[A\") return \"up\";\n\tif (data === \"\\x1b[B\") return \"down\";\n\tif (data === \"\\x1b[C\") return \"right\";\n\tif (data === \"\\x1b[D\") return \"left\";\n\tif (data === \"\\x1b[H\" || data === \"\\x1bOH\") return \"home\";\n\tif (data === \"\\x1b[F\" || data === \"\\x1bOF\") return \"end\";\n\tif (data === \"\\x1b[3~\") return \"delete\";\n\tif (data === \"\\x1b[5~\") return \"pageUp\";\n\tif (data === \"\\x1b[6~\") return \"pageDown\";\n\n\t// Raw Ctrl+letter\n\tif (data.length === 1) {\n\t\tconst code = data.charCodeAt(0);\n\t\tif (code >= 1 && code <= 26) {\n\t\t\treturn `ctrl+${String.fromCharCode(code + 96)}`;\n\t\t}\n\t\tif (code >= 32 && code <= 126) {\n\t\t\treturn data;\n\t\t}\n\t}\n\n\treturn undefined;\n}\n\n// =============================================================================\n// Kitty CSI-u Printable Decoding\n// =============================================================================\n\nconst KITTY_CSI_U_REGEX = /^\\x1b\\[(\\d+)(?::(\\d*))?(?::(\\d+))?(?:;(\\d+))?(?::(\\d+))?u$/;\nconst KITTY_PRINTABLE_ALLOWED_MODIFIERS = MODIFIERS.shift | LOCK_MASK;\n\n/**\n * Decode a Kitty CSI-u sequence into a printable character, if applicable.\n *\n * When Kitty keyboard protocol flag 1 (disambiguate) is active, terminals send\n * CSI-u sequences for all keys, including plain printable characters. This\n * function extracts the printable character from such sequences.\n *\n * Only accepts plain or Shift-modified keys. Rejects Ctrl, Alt, and unsupported\n * modifier combinations (those are handled by keybinding matching instead).\n * Prefers the shifted keycode when Shift is held and a shifted key is reported.\n *\n * @param data - Raw input data from terminal\n * @returns The printable character, or undefined if not a printable CSI-u sequence\n */\nexport function decodeKittyPrintable(data: string): string | undefined {\n\tconst match = data.match(KITTY_CSI_U_REGEX);\n\tif (!match) return undefined;\n\n\t// CSI-u groups: <codepoint>[:<shifted>[:<base>]];<mod>[:<event>]u\n\tconst codepoint = Number.parseInt(match[1] ?? \"\", 10);\n\tif (!Number.isFinite(codepoint)) return undefined;\n\n\tconst shiftedKey = match[2] && match[2].length > 0 ? Number.parseInt(match[2], 10) : undefined;\n\tconst modValue = match[4] ? Number.parseInt(match[4], 10) : 1;\n\t// Modifiers are 1-indexed in CSI-u; normalize to our bitmask.\n\tconst modifier = Number.isFinite(modValue) ? modValue - 1 : 0;\n\n\t// Only accept printable CSI-u input for plain or Shift-modified text keys.\n\t// Reject unsupported modifier bits (e.g. Super/Meta) to avoid inserting\n\t// characters from modifier-only terminal events.\n\tif ((modifier & ~KITTY_PRINTABLE_ALLOWED_MODIFIERS) !== 0) return undefined;\n\tif (modifier & (MODIFIERS.alt | MODIFIERS.ctrl)) return undefined;\n\n\t// Prefer the shifted keycode when Shift is held.\n\tlet effectiveCodepoint = codepoint;\n\tif (modifier & MODIFIERS.shift && typeof shiftedKey === \"number\") {\n\t\teffectiveCodepoint = shiftedKey;\n\t}\n\teffectiveCodepoint = normalizeKittyFunctionalCodepoint(effectiveCodepoint);\n\t// Drop control characters or invalid codepoints.\n\tif (!Number.isFinite(effectiveCodepoint) || effectiveCodepoint < 32) return undefined;\n\n\ttry {\n\t\treturn String.fromCodePoint(effectiveCodepoint);\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n\nfunction decodeModifyOtherKeysPrintable(data: string): string | undefined {\n\tconst parsed = parseModifyOtherKeysSequence(data);\n\tif (!parsed) return undefined;\n\tconst modifier = parsed.modifier & ~LOCK_MASK;\n\tif ((modifier & ~MODIFIERS.shift) !== 0) return undefined;\n\tif (!Number.isFinite(parsed.codepoint) || parsed.codepoint < 32) return undefined;\n\n\ttry {\n\t\treturn String.fromCodePoint(parsed.codepoint);\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n\nexport function decodePrintableKey(data: string): string | undefined {\n\treturn decodeKittyPrintable(data) ?? decodeModifyOtherKeysPrintable(data);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"keys.js","sourceRoot":"","sources":["../src/keys.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,gFAAgF;AAChF,8BAA8B;AAC9B,gFAAgF;AAEhF,IAAI,oBAAoB,GAAG,KAAK,CAAC;AAEjC;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CAAC,MAAe;IACrD,oBAAoB,GAAG,MAAM,C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CAAC;AACF,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC9C,OAAO,oBAAoB,CAAC,IAAI,CAAC,IAAI,8BAA8B,CAAC,IAAI,CAAC,CAAC;AAC3E,CAAC","sourcesContent":["/**\n * Keyboard input handling for terminal applications.\n *\n * Supports both legacy terminal sequences and Kitty keyboard protocol.\n * See: https://sw.kovidgoyal.net/kitty/keyboard-protocol/\n * Reference: https://github.com/sst/opentui/blob/7da92b4088aebfe27b9f691c04163a48821e49fd/packages/core/src/lib/parse.keypress.ts\n *\n * Symbol keys are also supported, however some ctrl+symbol combos\n * overlap with ASCII codes, e.g. ctrl+[ = ESC.\n * See: https://sw.kovidgoyal.net/kitty/keyboard-protocol/#legacy-ctrl-mapping-of-ascii-keys\n * Those can still be * used for ctrl+shift combos\n *\n * API:\n * - matchesKey(data, keyId) - Check if input matches a key identifier\n * - parseKey(data) - Parse input and return the key identifier\n * - Key - Helper object for creating typed key identifiers\n * - setKittyProtocolActive(active) - Set global Kitty protocol state\n * - isKittyProtocolActive() - Query global Kitty protocol state\n */\n\n// =============================================================================\n// Global Kitty Protocol State\n// =============================================================================\n\nlet _kittyProtocolActive = false;\n\n/**\n * Set the global Kitty keyboard protocol state.\n * Called by ProcessTerminal after detecting protocol support.\n */\nexport function setKittyProtocolActive(active: boolean): void {\n\t_kittyProtocolActive = active;\n}\n\n/**\n * Query whether Kitty keyboard protocol is currently active.\n */\nexport function isKittyProtocolActive(): boolean {\n\treturn _kittyProtocolActive;\n}\n\n// =============================================================================\n// Type-Safe Key Identifiers\n// =============================================================================\n\ntype Letter =\n\t| \"a\"\n\t| \"b\"\n\t| \"c\"\n\t| \"d\"\n\t| \"e\"\n\t| \"f\"\n\t| \"g\"\n\t| \"h\"\n\t| \"i\"\n\t| \"j\"\n\t| \"k\"\n\t| \"l\"\n\t| \"m\"\n\t| \"n\"\n\t| \"o\"\n\t| \"p\"\n\t| \"q\"\n\t| \"r\"\n\t| \"s\"\n\t| \"t\"\n\t| \"u\"\n\t| \"v\"\n\t| \"w\"\n\t| \"x\"\n\t| \"y\"\n\t| \"z\";\n\ntype Digit = \"0\" | \"1\" | \"2\" | \"3\" | \"4\" | \"5\" | \"6\" | \"7\" | \"8\" | \"9\";\n\ntype SymbolKey =\n\t| \"`\"\n\t| \"-\"\n\t| \"=\"\n\t| \"[\"\n\t| \"]\"\n\t| \"\\\\\"\n\t| \";\"\n\t| \"'\"\n\t| \",\"\n\t| \".\"\n\t| \"/\"\n\t| \"!\"\n\t| \"@\"\n\t| \"#\"\n\t| \"$\"\n\t| \"%\"\n\t| \"^\"\n\t| \"&\"\n\t| \"*\"\n\t| \"(\"\n\t| \")\"\n\t| \"_\"\n\t| \"+\"\n\t| \"|\"\n\t| \"~\"\n\t| \"{\"\n\t| \"}\"\n\t| \":\"\n\t| \"<\"\n\t| \">\"\n\t| \"?\";\n\ntype SpecialKey =\n\t| \"escape\"\n\t| \"esc\"\n\t| \"enter\"\n\t| \"return\"\n\t| \"tab\"\n\t| \"space\"\n\t| \"backspace\"\n\t| \"delete\"\n\t| \"insert\"\n\t| \"clear\"\n\t| \"home\"\n\t| \"end\"\n\t| \"pageUp\"\n\t| \"pageDown\"\n\t| \"up\"\n\t| \"down\"\n\t| \"left\"\n\t| \"right\"\n\t| \"f1\"\n\t| \"f2\"\n\t| \"f3\"\n\t| \"f4\"\n\t| \"f5\"\n\t| \"f6\"\n\t| \"f7\"\n\t| \"f8\"\n\t| \"f9\"\n\t| \"f10\"\n\t| \"f11\"\n\t| \"f12\";\n\ntype BaseKey = Letter | Digit | SymbolKey | SpecialKey;\ntype ModifierName = \"ctrl\" | \"shift\" | \"alt\" | \"super\";\n\ntype ModifiedKeyId<Key extends string, RemainingModifiers extends ModifierName = ModifierName> = {\n\t[M in RemainingModifiers]: `${M}+${Key}` | `${M}+${ModifiedKeyId<Key, Exclude<RemainingModifiers, M>>}`;\n}[RemainingModifiers];\n\n/**\n * Union type of all valid key identifiers.\n * Provides autocomplete and catches typos at compile time.\n */\nexport type KeyId = BaseKey | ModifiedKeyId<BaseKey>;\n\n/**\n * Helper object for creating typed key identifiers with autocomplete.\n *\n * Usage:\n * - Key.escape, Key.enter, Key.tab, etc. for special keys\n * - Key.backtick, Key.comma, Key.period, etc. for symbol keys\n * - Key.ctrl(\"c\"), Key.alt(\"x\"), Key.super(\"k\") for single modifiers\n * - Key.ctrlShift(\"p\"), Key.ctrlAlt(\"x\"), Key.ctrlSuper(\"k\") for combined modifiers\n */\nexport const Key = {\n\t// Special keys\n\tescape: \"escape\" as const,\n\tesc: \"esc\" as const,\n\tenter: \"enter\" as const,\n\treturn: \"return\" as const,\n\ttab: \"tab\" as const,\n\tspace: \"space\" as const,\n\tbackspace: \"backspace\" as const,\n\tdelete: \"delete\" as const,\n\tinsert: \"insert\" as const,\n\tclear: \"clear\" as const,\n\thome: \"home\" as const,\n\tend: \"end\" as const,\n\tpageUp: \"pageUp\" as const,\n\tpageDown: \"pageDown\" as const,\n\tup: \"up\" as const,\n\tdown: \"down\" as const,\n\tleft: \"left\" as const,\n\tright: \"right\" as const,\n\tf1: \"f1\" as const,\n\tf2: \"f2\" as const,\n\tf3: \"f3\" as const,\n\tf4: \"f4\" as const,\n\tf5: \"f5\" as const,\n\tf6: \"f6\" as const,\n\tf7: \"f7\" as const,\n\tf8: \"f8\" as const,\n\tf9: \"f9\" as const,\n\tf10: \"f10\" as const,\n\tf11: \"f11\" as const,\n\tf12: \"f12\" as const,\n\n\t// Symbol keys\n\tbacktick: \"`\" as const,\n\thyphen: \"-\" as const,\n\tequals: \"=\" as const,\n\tleftbracket: \"[\" as const,\n\trightbracket: \"]\" as const,\n\tbackslash: \"\\\\\" as const,\n\tsemicolon: \";\" as const,\n\tquote: \"'\" as const,\n\tcomma: \",\" as const,\n\tperiod: \".\" as const,\n\tslash: \"/\" as const,\n\texclamation: \"!\" as const,\n\tat: \"@\" as const,\n\thash: \"#\" as const,\n\tdollar: \"$\" as const,\n\tpercent: \"%\" as const,\n\tcaret: \"^\" as const,\n\tampersand: \"&\" as const,\n\tasterisk: \"*\" as const,\n\tleftparen: \"(\" as const,\n\trightparen: \")\" as const,\n\tunderscore: \"_\" as const,\n\tplus: \"+\" as const,\n\tpipe: \"|\" as const,\n\ttilde: \"~\" as const,\n\tleftbrace: \"{\" as const,\n\trightbrace: \"}\" as const,\n\tcolon: \":\" as const,\n\tlessthan: \"<\" as const,\n\tgreaterthan: \">\" as const,\n\tquestion: \"?\" as const,\n\n\t// Single modifiers\n\tctrl: <K extends BaseKey>(key: K): `ctrl+${K}` => `ctrl+${key}`,\n\tshift: <K extends BaseKey>(key: K): `shift+${K}` => `shift+${key}`,\n\talt: <K extends BaseKey>(key: K): `alt+${K}` => `alt+${key}`,\n\tsuper: <K extends BaseKey>(key: K): `super+${K}` => `super+${key}`,\n\n\t// Combined modifiers\n\tctrlShift: <K extends BaseKey>(key: K): `ctrl+shift+${K}` => `ctrl+shift+${key}`,\n\tshiftCtrl: <K extends BaseKey>(key: K): `shift+ctrl+${K}` => `shift+ctrl+${key}`,\n\tctrlAlt: <K extends BaseKey>(key: K): `ctrl+alt+${K}` => `ctrl+alt+${key}`,\n\taltCtrl: <K extends BaseKey>(key: K): `alt+ctrl+${K}` => `alt+ctrl+${key}`,\n\tshiftAlt: <K extends BaseKey>(key: K): `shift+alt+${K}` => `shift+alt+${key}`,\n\taltShift: <K extends BaseKey>(key: K): `alt+shift+${K}` => `alt+shift+${key}`,\n\tctrlSuper: <K extends BaseKey>(key: K): `ctrl+super+${K}` => `ctrl+super+${key}`,\n\tsuperCtrl: <K extends BaseKey>(key: K): `super+ctrl+${K}` => `super+ctrl+${key}`,\n\tshiftSuper: <K extends BaseKey>(key: K): `shift+super+${K}` => `shift+super+${key}`,\n\tsuperShift: <K extends BaseKey>(key: K): `super+shift+${K}` => `super+shift+${key}`,\n\taltSuper: <K extends BaseKey>(key: K): `alt+super+${K}` => `alt+super+${key}`,\n\tsuperAlt: <K extends BaseKey>(key: K): `super+alt+${K}` => `super+alt+${key}`,\n\n\t// Triple modifiers\n\tctrlShiftAlt: <K extends BaseKey>(key: K): `ctrl+shift+alt+${K}` => `ctrl+shift+alt+${key}`,\n\tctrlShiftSuper: <K extends BaseKey>(key: K): `ctrl+shift+super+${K}` => `ctrl+shift+super+${key}`,\n} as const;\n\n// =============================================================================\n// Constants\n// =============================================================================\n\nconst SYMBOL_KEYS = new Set([\n\t\"`\",\n\t\"-\",\n\t\"=\",\n\t\"[\",\n\t\"]\",\n\t\"\\\\\",\n\t\";\",\n\t\"'\",\n\t\",\",\n\t\".\",\n\t\"/\",\n\t\"!\",\n\t\"@\",\n\t\"#\",\n\t\"$\",\n\t\"%\",\n\t\"^\",\n\t\"&\",\n\t\"*\",\n\t\"(\",\n\t\")\",\n\t\"_\",\n\t\"+\",\n\t\"|\",\n\t\"~\",\n\t\"{\",\n\t\"}\",\n\t\":\",\n\t\"<\",\n\t\">\",\n\t\"?\",\n]);\n\nconst SHIFTED_SYMBOL_KEYS = new Set(\"~!@#$%^&*()_+|{}:<>?\");\n\nconst MODIFIER_NAMES = [\"shift\", \"alt\", \"ctrl\", \"super\"] as const;\n\nconst MODIFIERS = {\n\tshift: 1,\n\talt: 2,\n\tctrl: 4,\n\tsuper: 8,\n} as const;\n\nconst LOCK_MASK = 64 + 128; // Caps Lock + Num Lock\n\nconst CODEPOINTS = {\n\tescape: 27,\n\ttab: 9,\n\tenter: 13,\n\tspace: 32,\n\tbackspace: 127,\n\tkpEnter: 57414, // Numpad Enter (Kitty protocol)\n} as const;\n\nconst ARROW_CODEPOINTS = {\n\tup: -1,\n\tdown: -2,\n\tright: -3,\n\tleft: -4,\n} as const;\n\nconst FUNCTIONAL_CODEPOINTS = {\n\tdelete: -10,\n\tinsert: -11,\n\tpageUp: -12,\n\tpageDown: -13,\n\thome: -14,\n\tend: -15,\n} as const;\n\nconst KITTY_FUNCTIONAL_KEY_EQUIVALENTS = new Map<number, number>([\n\t[57399, 48], // KP_0 -> 0\n\t[57400, 49], // KP_1 -> 1\n\t[57401, 50], // KP_2 -> 2\n\t[57402, 51], // KP_3 -> 3\n\t[57403, 52], // KP_4 -> 4\n\t[57404, 53], // KP_5 -> 5\n\t[57405, 54], // KP_6 -> 6\n\t[57406, 55], // KP_7 -> 7\n\t[57407, 56], // KP_8 -> 8\n\t[57408, 57], // KP_9 -> 9\n\t[57409, 46], // KP_DECIMAL -> .\n\t[57410, 47], // KP_DIVIDE -> /\n\t[57411, 42], // KP_MULTIPLY -> *\n\t[57412, 45], // KP_SUBTRACT -> -\n\t[57413, 43], // KP_ADD -> +\n\t[57415, 61], // KP_EQUAL -> =\n\t[57416, 44], // KP_SEPARATOR -> ,\n\t[57417, ARROW_CODEPOINTS.left],\n\t[57418, ARROW_CODEPOINTS.right],\n\t[57419, ARROW_CODEPOINTS.up],\n\t[57420, ARROW_CODEPOINTS.down],\n\t[57421, FUNCTIONAL_CODEPOINTS.pageUp],\n\t[57422, FUNCTIONAL_CODEPOINTS.pageDown],\n\t[57423, FUNCTIONAL_CODEPOINTS.home],\n\t[57424, FUNCTIONAL_CODEPOINTS.end],\n\t[57425, FUNCTIONAL_CODEPOINTS.insert],\n\t[57426, FUNCTIONAL_CODEPOINTS.delete],\n]);\n\nfunction normalizeKittyFunctionalCodepoint(codepoint: number): number {\n\treturn KITTY_FUNCTIONAL_KEY_EQUIVALENTS.get(codepoint) ?? codepoint;\n}\n\nfunction normalizeShiftedLetterIdentityCodepoint(codepoint: number, modifier: number): number {\n\tconst effectiveModifier = modifier & ~LOCK_MASK;\n\tif ((effectiveModifier & MODIFIERS.shift) !== 0 && codepoint >= 65 && codepoint <= 90) {\n\t\treturn codepoint + 32;\n\t}\n\treturn codepoint;\n}\n\nfunction getLogicalShiftedSymbolCandidate(\n\tcodepoint: number | undefined,\n\tmodifier: number,\n\tallowedSymbols: ReadonlySet<string>,\n): { codepoint: number; modifier: number } | undefined {\n\tif (codepoint === undefined || (modifier & MODIFIERS.shift) === 0) return undefined;\n\tconst normalizedCodepoint = normalizeKittyFunctionalCodepoint(codepoint);\n\tif (!allowedSymbols.has(String.fromCharCode(normalizedCodepoint))) return undefined;\n\treturn { codepoint: normalizedCodepoint, modifier: modifier & ~MODIFIERS.shift };\n}\n\nconst LEGACY_KEY_SEQUENCES = {\n\tup: [\"\\x1b[A\", \"\\x1bOA\"],\n\tdown: [\"\\x1b[B\", \"\\x1bOB\"],\n\tright: [\"\\x1b[C\", \"\\x1bOC\"],\n\tleft: [\"\\x1b[D\", \"\\x1bOD\"],\n\thome: [\"\\x1b[H\", \"\\x1bOH\", \"\\x1b[1~\", \"\\x1b[7~\"],\n\tend: [\"\\x1b[F\", \"\\x1bOF\", \"\\x1b[4~\", \"\\x1b[8~\"],\n\tinsert: [\"\\x1b[2~\"],\n\tdelete: [\"\\x1b[3~\"],\n\tpageUp: [\"\\x1b[5~\", \"\\x1b[[5~\"],\n\tpageDown: [\"\\x1b[6~\", \"\\x1b[[6~\"],\n\tclear: [\"\\x1b[E\", \"\\x1bOE\"],\n\tf1: [\"\\x1bOP\", \"\\x1b[11~\", \"\\x1b[[A\"],\n\tf2: [\"\\x1bOQ\", \"\\x1b[12~\", \"\\x1b[[B\"],\n\tf3: [\"\\x1bOR\", \"\\x1b[13~\", \"\\x1b[[C\"],\n\tf4: [\"\\x1bOS\", \"\\x1b[14~\", \"\\x1b[[D\"],\n\tf5: [\"\\x1b[15~\", \"\\x1b[[E\"],\n\tf6: [\"\\x1b[17~\"],\n\tf7: [\"\\x1b[18~\"],\n\tf8: [\"\\x1b[19~\"],\n\tf9: [\"\\x1b[20~\"],\n\tf10: [\"\\x1b[21~\"],\n\tf11: [\"\\x1b[23~\"],\n\tf12: [\"\\x1b[24~\"],\n} as const;\n\nconst LEGACY_SHIFT_SEQUENCES = {\n\tup: [\"\\x1b[a\"],\n\tdown: [\"\\x1b[b\"],\n\tright: [\"\\x1b[c\"],\n\tleft: [\"\\x1b[d\"],\n\tclear: [\"\\x1b[e\"],\n\tinsert: [\"\\x1b[2$\"],\n\tdelete: [\"\\x1b[3$\"],\n\tpageUp: [\"\\x1b[5$\"],\n\tpageDown: [\"\\x1b[6$\"],\n\thome: [\"\\x1b[7$\"],\n\tend: [\"\\x1b[8$\"],\n} as const;\n\nconst LEGACY_CTRL_SEQUENCES = {\n\tup: [\"\\x1bOa\"],\n\tdown: [\"\\x1bOb\"],\n\tright: [\"\\x1bOc\"],\n\tleft: [\"\\x1bOd\"],\n\tclear: [\"\\x1bOe\"],\n\tinsert: [\"\\x1b[2^\"],\n\tdelete: [\"\\x1b[3^\"],\n\tpageUp: [\"\\x1b[5^\"],\n\tpageDown: [\"\\x1b[6^\"],\n\thome: [\"\\x1b[7^\"],\n\tend: [\"\\x1b[8^\"],\n} as const;\n\nconst LEGACY_SEQUENCE_KEY_IDS: Record<string, KeyId> = {\n\t\"\\x1bOA\": \"up\",\n\t\"\\x1bOB\": \"down\",\n\t\"\\x1bOC\": \"right\",\n\t\"\\x1bOD\": \"left\",\n\t\"\\x1bOH\": \"home\",\n\t\"\\x1bOF\": \"end\",\n\t\"\\x1b[E\": \"clear\",\n\t\"\\x1bOE\": \"clear\",\n\t\"\\x1bOe\": \"ctrl+clear\",\n\t\"\\x1b[e\": \"shift+clear\",\n\t\"\\x1b[2~\": \"insert\",\n\t\"\\x1b[2$\": \"shift+insert\",\n\t\"\\x1b[2^\": \"ctrl+insert\",\n\t\"\\x1b[3$\": \"shift+delete\",\n\t\"\\x1b[3^\": \"ctrl+delete\",\n\t\"\\x1b[[5~\": \"pageUp\",\n\t\"\\x1b[[6~\": \"pageDown\",\n\t\"\\x1b[a\": \"shift+up\",\n\t\"\\x1b[b\": \"shift+down\",\n\t\"\\x1b[c\": \"shift+right\",\n\t\"\\x1b[d\": \"shift+left\",\n\t\"\\x1bOa\": \"ctrl+up\",\n\t\"\\x1bOb\": \"ctrl+down\",\n\t\"\\x1bOc\": \"ctrl+right\",\n\t\"\\x1bOd\": \"ctrl+left\",\n\t\"\\x1b[5$\": \"shift+pageUp\",\n\t\"\\x1b[6$\": \"shift+pageDown\",\n\t\"\\x1b[7$\": \"shift+home\",\n\t\"\\x1b[8$\": \"shift+end\",\n\t\"\\x1b[5^\": \"ctrl+pageUp\",\n\t\"\\x1b[6^\": \"ctrl+pageDown\",\n\t\"\\x1b[7^\": \"ctrl+home\",\n\t\"\\x1b[8^\": \"ctrl+end\",\n\t\"\\x1bOP\": \"f1\",\n\t\"\\x1bOQ\": \"f2\",\n\t\"\\x1bOR\": \"f3\",\n\t\"\\x1bOS\": \"f4\",\n\t\"\\x1b[11~\": \"f1\",\n\t\"\\x1b[12~\": \"f2\",\n\t\"\\x1b[13~\": \"f3\",\n\t\"\\x1b[14~\": \"f4\",\n\t\"\\x1b[[A\": \"f1\",\n\t\"\\x1b[[B\": \"f2\",\n\t\"\\x1b[[C\": \"f3\",\n\t\"\\x1b[[D\": \"f4\",\n\t\"\\x1b[[E\": \"f5\",\n\t\"\\x1b[15~\": \"f5\",\n\t\"\\x1b[17~\": \"f6\",\n\t\"\\x1b[18~\": \"f7\",\n\t\"\\x1b[19~\": \"f8\",\n\t\"\\x1b[20~\": \"f9\",\n\t\"\\x1b[21~\": \"f10\",\n\t\"\\x1b[23~\": \"f11\",\n\t\"\\x1b[24~\": \"f12\",\n\t\"\\x1bb\": \"alt+left\",\n\t\"\\x1bf\": \"alt+right\",\n\t\"\\x1bp\": \"alt+up\",\n\t\"\\x1bn\": \"alt+down\",\n} as const;\n\ntype LegacyModifierKey = keyof typeof LEGACY_SHIFT_SEQUENCES;\n\nconst matchesLegacySequence = (data: string, sequences: readonly string[]): boolean => sequences.includes(data);\n\nconst matchesLegacyModifierSequence = (data: string, key: LegacyModifierKey, modifier: number): boolean => {\n\tif (modifier === MODIFIERS.shift) {\n\t\treturn matchesLegacySequence(data, LEGACY_SHIFT_SEQUENCES[key]);\n\t}\n\tif (modifier === MODIFIERS.ctrl) {\n\t\treturn matchesLegacySequence(data, LEGACY_CTRL_SEQUENCES[key]);\n\t}\n\treturn false;\n};\n\n// =============================================================================\n// Kitty Protocol Parsing\n// =============================================================================\n\n/**\n * Event types from Kitty keyboard protocol (flag 2)\n * 1 = key press, 2 = key repeat, 3 = key release\n */\nexport type KeyEventType = \"press\" | \"repeat\" | \"release\";\n\ninterface ParsedKittySequence {\n\tcodepoint: number;\n\tshiftedKey?: number; // Shifted version of the key (when shift is pressed)\n\tbaseLayoutKey?: number; // Key in standard PC-101 layout (for non-Latin layouts)\n\tmodifier: number;\n\teventType: KeyEventType;\n}\n\ninterface ParsedModifyOtherKeysSequence {\n\tcodepoint: number;\n\tmodifier: number;\n}\n\n// Store the last parsed event type for isKeyRelease() to query\nlet _lastEventType: KeyEventType = \"press\";\n\n/**\n * Check if the last parsed key event was a key release.\n * Only meaningful when Kitty keyboard protocol with flag 2 is active.\n */\nexport function isKeyRelease(data: string): boolean {\n\t// Don't treat bracketed paste content as key release, even if it contains\n\t// patterns like \":3F\" (e.g., bluetooth MAC addresses like \"90:62:3F:A5\").\n\t// Terminal.ts re-wraps paste content with bracketed paste markers before\n\t// passing to TUI, so pasted data will always contain \\x1b[200~.\n\tif (data.includes(\"\\x1b[200~\")) {\n\t\treturn false;\n\t}\n\n\t// Quick check: release events with flag 2 contain \":3\"\n\t// Format: \\x1b[<codepoint>;<modifier>:3u\n\tif (\n\t\tdata.includes(\":3u\") ||\n\t\tdata.includes(\":3~\") ||\n\t\tdata.includes(\":3A\") ||\n\t\tdata.includes(\":3B\") ||\n\t\tdata.includes(\":3C\") ||\n\t\tdata.includes(\":3D\") ||\n\t\tdata.includes(\":3H\") ||\n\t\tdata.includes(\":3F\")\n\t) {\n\t\treturn true;\n\t}\n\treturn false;\n}\n\n/**\n * Check if the last parsed key event was a key repeat.\n * Only meaningful when Kitty keyboard protocol with flag 2 is active.\n */\nexport function isKeyRepeat(data: string): boolean {\n\t// Don't treat bracketed paste content as key repeat, even if it contains\n\t// patterns like \":2F\". See isKeyRelease() for details.\n\tif (data.includes(\"\\x1b[200~\")) {\n\t\treturn false;\n\t}\n\n\tif (\n\t\tdata.includes(\":2u\") ||\n\t\tdata.includes(\":2~\") ||\n\t\tdata.includes(\":2A\") ||\n\t\tdata.includes(\":2B\") ||\n\t\tdata.includes(\":2C\") ||\n\t\tdata.includes(\":2D\") ||\n\t\tdata.includes(\":2H\") ||\n\t\tdata.includes(\":2F\")\n\t) {\n\t\treturn true;\n\t}\n\treturn false;\n}\n\nfunction parseEventType(eventTypeStr: string | undefined): KeyEventType {\n\tif (!eventTypeStr) return \"press\";\n\tconst eventType = parseInt(eventTypeStr, 10);\n\tif (eventType === 2) return \"repeat\";\n\tif (eventType === 3) return \"release\";\n\treturn \"press\";\n}\n\nfunction parseKittySequence(data: string): ParsedKittySequence | null {\n\t// CSI u format with alternate keys (flag 4):\n\t// \\x1b[<codepoint>u\n\t// \\x1b[<codepoint>;<mod>u\n\t// \\x1b[<codepoint>;<mod>:<event>u\n\t// \\x1b[<codepoint>:<shifted>;<mod>u\n\t// \\x1b[<codepoint>:<shifted>:<base>;<mod>u\n\t// \\x1b[<codepoint>::<base>;<mod>u (no shifted key, only base)\n\t//\n\t// With flag 2, event type is appended after modifier colon: 1=press, 2=repeat, 3=release\n\t// With flag 4, alternate keys are appended after codepoint with colons\n\tconst csiUMatch = data.match(/^\\x1b\\[(\\d+)(?::(\\d*))?(?::(\\d+))?(?:;(\\d+))?(?::(\\d+))?u$/);\n\tif (csiUMatch) {\n\t\tconst codepoint = parseInt(csiUMatch[1]!, 10);\n\t\tconst shiftedKey = csiUMatch[2] && csiUMatch[2].length > 0 ? parseInt(csiUMatch[2], 10) : undefined;\n\t\tconst baseLayoutKey = csiUMatch[3] ? parseInt(csiUMatch[3], 10) : undefined;\n\t\tconst modValue = csiUMatch[4] ? parseInt(csiUMatch[4], 10) : 1;\n\t\tconst eventType = parseEventType(csiUMatch[5]);\n\t\t_lastEventType = eventType;\n\t\treturn { codepoint, shiftedKey, baseLayoutKey, modifier: modValue - 1, eventType };\n\t}\n\n\t// Arrow keys with modifier: \\x1b[1;<mod>A/B/C/D or \\x1b[1;<mod>:<event>A/B/C/D\n\tconst arrowMatch = data.match(/^\\x1b\\[1;(\\d+)(?::(\\d+))?([ABCD])$/);\n\tif (arrowMatch) {\n\t\tconst modValue = parseInt(arrowMatch[1]!, 10);\n\t\tconst eventType = parseEventType(arrowMatch[2]);\n\t\tconst arrowCodes: Record<string, number> = { A: -1, B: -2, C: -3, D: -4 };\n\t\t_lastEventType = eventType;\n\t\treturn { codepoint: arrowCodes[arrowMatch[3]!]!, modifier: modValue - 1, eventType };\n\t}\n\n\t// Functional keys: \\x1b[<num>~ or \\x1b[<num>;<mod>~ or \\x1b[<num>;<mod>:<event>~\n\tconst funcMatch = data.match(/^\\x1b\\[(\\d+)(?:;(\\d+))?(?::(\\d+))?~$/);\n\tif (funcMatch) {\n\t\tconst keyNum = parseInt(funcMatch[1]!, 10);\n\t\tconst modValue = funcMatch[2] ? parseInt(funcMatch[2], 10) : 1;\n\t\tconst eventType = parseEventType(funcMatch[3]);\n\t\tconst funcCodes: Record<number, number> = {\n\t\t\t2: FUNCTIONAL_CODEPOINTS.insert,\n\t\t\t3: FUNCTIONAL_CODEPOINTS.delete,\n\t\t\t5: FUNCTIONAL_CODEPOINTS.pageUp,\n\t\t\t6: FUNCTIONAL_CODEPOINTS.pageDown,\n\t\t\t7: FUNCTIONAL_CODEPOINTS.home,\n\t\t\t8: FUNCTIONAL_CODEPOINTS.end,\n\t\t};\n\t\tconst codepoint = funcCodes[keyNum];\n\t\tif (codepoint !== undefined) {\n\t\t\t_lastEventType = eventType;\n\t\t\treturn { codepoint, modifier: modValue - 1, eventType };\n\t\t}\n\t}\n\n\t// Home/End with modifier: \\x1b[1;<mod>H/F or \\x1b[1;<mod>:<event>H/F\n\tconst homeEndMatch = data.match(/^\\x1b\\[1;(\\d+)(?::(\\d+))?([HF])$/);\n\tif (homeEndMatch) {\n\t\tconst modValue = parseInt(homeEndMatch[1]!, 10);\n\t\tconst eventType = parseEventType(homeEndMatch[2]);\n\t\tconst codepoint = homeEndMatch[3] === \"H\" ? FUNCTIONAL_CODEPOINTS.home : FUNCTIONAL_CODEPOINTS.end;\n\t\t_lastEventType = eventType;\n\t\treturn { codepoint, modifier: modValue - 1, eventType };\n\t}\n\n\treturn null;\n}\n\nfunction matchesKittySequence(data: string, expectedCodepoint: number, expectedModifier: number): boolean {\n\tconst parsed = parseKittySequence(data);\n\tif (!parsed) return false;\n\tconst actualMod = parsed.modifier & ~LOCK_MASK;\n\tconst expectedMod = expectedModifier & ~LOCK_MASK;\n\n\tconst normalizedCodepoint = normalizeShiftedLetterIdentityCodepoint(\n\t\tnormalizeKittyFunctionalCodepoint(parsed.codepoint),\n\t\tparsed.modifier,\n\t);\n\tconst normalizedExpectedCodepoint = normalizeShiftedLetterIdentityCodepoint(\n\t\tnormalizeKittyFunctionalCodepoint(expectedCodepoint),\n\t\texpectedModifier,\n\t);\n\n\t// Physical match: primary codepoint and every reported modifier match.\n\tif (actualMod === expectedMod && normalizedCodepoint === normalizedExpectedCodepoint) return true;\n\n\t// Logical match: Kitty reports symbols such as \"+\" as Shift plus the physical \"=\" key.\n\t// Bindings name the produced symbol, so consume that implicit Shift while preserving\n\t// Ctrl, Alt, and Super. The physical \"shift+=\" spelling remains valid through the match above.\n\tconst logicalShiftedSymbol = getLogicalShiftedSymbolCandidate(parsed.shiftedKey, actualMod, SYMBOL_KEYS);\n\tif (\n\t\tlogicalShiftedSymbol &&\n\t\t(logicalShiftedSymbol.modifier & ~LOCK_MASK) === expectedMod &&\n\t\tlogicalShiftedSymbol.codepoint === normalizeKittyFunctionalCodepoint(expectedCodepoint)\n\t) {\n\t\treturn true;\n\t}\n\n\tif (actualMod !== expectedMod) return false;\n\n\t// Alternate match: use base layout key for non-Latin keyboard layouts.\n\t// This allows Ctrl+С (Cyrillic) to match Ctrl+c (Latin) when terminal reports\n\t// the base layout key (the key in standard PC-101 layout).\n\t//\n\t// Only fall back to base layout key when the codepoint is NOT already a\n\t// recognized Latin letter (a-z) or symbol (e.g., /, -, [, ;, etc.).\n\t// When the codepoint is a recognized key, it is authoritative regardless\n\t// of physical key position. This prevents remapped layouts (Dvorak, Colemak,\n\t// xremap, etc.) from causing false matches: both letters and symbols move\n\t// to different physical positions, so Ctrl+K could falsely match Ctrl+V\n\t// (letter remapping) and Ctrl+/ could falsely match Ctrl+[ (symbol remapping)\n\t// if the base layout key were always considered.\n\tif (parsed.baseLayoutKey !== undefined && parsed.baseLayoutKey === expectedCodepoint) {\n\t\tconst cp = normalizedCodepoint;\n\t\tconst isLatinLetter = cp >= 97 && cp <= 122; // a-z\n\t\tconst isKnownSymbol = SYMBOL_KEYS.has(String.fromCharCode(cp));\n\t\tif (!isLatinLetter && !isKnownSymbol) return true;\n\t}\n\n\treturn false;\n}\n\nfunction parseModifyOtherKeysSequence(data: string): ParsedModifyOtherKeysSequence | null {\n\tconst match = data.match(/^\\x1b\\[27;(\\d+);(\\d+)~$/);\n\tif (!match) return null;\n\tconst modValue = parseInt(match[1]!, 10);\n\tconst codepoint = parseInt(match[2]!, 10);\n\treturn { codepoint, modifier: modValue - 1 };\n}\n\n/**\n * Match xterm modifyOtherKeys format: CSI 27 ; modifiers ; keycode ~\n * This is used by terminals when Kitty protocol is not enabled.\n * Modifier values are 1-indexed: 2=shift, 3=alt, 5=ctrl, etc.\n */\nfunction matchesModifyOtherKeys(data: string, expectedKeycode: number, expectedModifier: number): boolean {\n\tconst parsed = parseModifyOtherKeysSequence(data);\n\tif (!parsed) return false;\n\treturn parsed.codepoint === expectedKeycode && parsed.modifier === expectedModifier;\n}\n\nfunction isWindowsTerminalSession(): boolean {\n\treturn (\n\t\tBoolean(process.env.WT_SESSION) && !process.env.SSH_CONNECTION && !process.env.SSH_CLIENT && !process.env.SSH_TTY\n\t);\n}\n\n/**\n * Raw 0x08 (BS) is ambiguous in legacy terminals.\n *\n * - Windows Terminal uses it for Ctrl+Backspace.\n * - Some legacy terminals and tmux setups send it for plain Backspace.\n *\n * Prefer explicit Kitty / CSI-u / modifyOtherKeys sequences whenever they are\n * available. Fall back to a Windows Terminal heuristic only for raw BS bytes.\n */\nfunction matchesRawBackspace(data: string, expectedModifier: number): boolean {\n\tif (data === \"\\x7f\") return expectedModifier === 0;\n\tif (data !== \"\\x08\") return false;\n\treturn isWindowsTerminalSession() ? expectedModifier === MODIFIERS.ctrl : expectedModifier === 0;\n}\n\n// =============================================================================\n// Generic Key Matching\n// =============================================================================\n\n/**\n * Get the control character for a key.\n * Uses the universal formula: code & 0x1f (mask to lower 5 bits)\n *\n * Works for:\n * - Letters a-z → 1-26\n * - Symbols [\\]_ → 27, 28, 29, 31\n * - Also maps - to same as _ (same physical key on US keyboards)\n */\nfunction rawCtrlChar(key: string): string | null {\n\tconst char = key.toLowerCase();\n\tconst code = char.charCodeAt(0);\n\tif ((code >= 97 && code <= 122) || char === \"[\" || char === \"\\\\\" || char === \"]\" || char === \"_\") {\n\t\treturn String.fromCharCode(code & 0x1f);\n\t}\n\t// Handle - as _ (same physical key on US keyboards)\n\tif (char === \"-\") {\n\t\treturn String.fromCharCode(31); // Same as Ctrl+_\n\t}\n\treturn null;\n}\n\nfunction isDigitKey(key: string): boolean {\n\treturn key >= \"0\" && key <= \"9\";\n}\n\nfunction matchesPrintableModifyOtherKeys(data: string, expectedKeycode: number, expectedModifier: number): boolean {\n\tconst parsed = parseModifyOtherKeysSequence(data);\n\tif (!parsed) return false;\n\tconst physicalMatch =\n\t\tparsed.modifier === expectedModifier &&\n\t\tnormalizeShiftedLetterIdentityCodepoint(parsed.codepoint, parsed.modifier) ===\n\t\t\tnormalizeShiftedLetterIdentityCodepoint(expectedKeycode, expectedModifier);\n\tif (physicalMatch) return true;\n\tconst logicalShiftedSymbol = getLogicalShiftedSymbolCandidate(\n\t\tparsed.codepoint,\n\t\tparsed.modifier,\n\t\tSHIFTED_SYMBOL_KEYS,\n\t);\n\treturn logicalShiftedSymbol?.modifier === expectedModifier && logicalShiftedSymbol.codepoint === expectedKeycode;\n}\n\nfunction formatKeyNameWithModifiers(keyName: string, modifier: number): string | undefined {\n\tconst mods: string[] = [];\n\tconst effectiveMod = modifier & ~LOCK_MASK;\n\tconst supportedModifierMask = MODIFIERS.shift | MODIFIERS.ctrl | MODIFIERS.alt | MODIFIERS.super;\n\tif ((effectiveMod & ~supportedModifierMask) !== 0) return undefined;\n\tif (effectiveMod & MODIFIERS.shift) mods.push(\"shift\");\n\tif (effectiveMod & MODIFIERS.ctrl) mods.push(\"ctrl\");\n\tif (effectiveMod & MODIFIERS.alt) mods.push(\"alt\");\n\tif (effectiveMod & MODIFIERS.super) mods.push(\"super\");\n\treturn mods.length > 0 ? `${mods.join(\"+\")}+${keyName}` : keyName;\n}\n\nfunction parseKeyId(\n\tkeyId: string,\n): { key: string; ctrl: boolean; shift: boolean; alt: boolean; super: boolean } | null {\n\tlet key = keyId.toLowerCase();\n\tconst modifiers = new Set<(typeof MODIFIER_NAMES)[number]>();\n\twhile (true) {\n\t\tconst modifier = MODIFIER_NAMES.find((name) => key.startsWith(`${name}+`));\n\t\tif (!modifier) break;\n\t\tif (modifiers.has(modifier)) return null;\n\t\tmodifiers.add(modifier);\n\t\tkey = key.slice(modifier.length + 1);\n\t}\n\tif (!key || (key.includes(\"+\") && key !== \"+\")) return null;\n\treturn {\n\t\tkey,\n\t\tctrl: modifiers.has(\"ctrl\"),\n\t\tshift: modifiers.has(\"shift\"),\n\t\talt: modifiers.has(\"alt\"),\n\t\tsuper: modifiers.has(\"super\"),\n\t};\n}\n\n/**\n * Match input data against a key identifier string.\n *\n * Supported key identifiers:\n * - Single keys: \"escape\", \"tab\", \"enter\", \"backspace\", \"delete\", \"home\", \"end\", \"space\"\n * - Arrow keys: \"up\", \"down\", \"left\", \"right\"\n * - Ctrl combinations: \"ctrl+c\", \"ctrl+z\", etc.\n * - Shift combinations: \"shift+tab\", \"shift+enter\"\n * - Alt combinations: \"alt+enter\", \"alt+backspace\"\n * - Super combinations: \"super+k\", \"super+enter\"\n * - Combined modifiers: \"shift+ctrl+p\", \"ctrl+alt+x\", \"ctrl+super+k\"\n *\n * Use the Key helper for autocomplete: Key.ctrl(\"c\"), Key.escape, Key.ctrlShift(\"p\"), Key.super(\"k\")\n *\n * @param data - Raw input data from terminal\n * @param keyId - Key identifier (e.g., \"ctrl+c\", \"escape\", Key.ctrl(\"c\"))\n */\nexport function matchesKey(data: string, keyId: KeyId): boolean {\n\tconst parsed = parseKeyId(keyId);\n\tif (!parsed) return false;\n\n\tconst { key, ctrl, shift, alt, super: superModifier } = parsed;\n\tlet modifier = 0;\n\tif (shift) modifier |= MODIFIERS.shift;\n\tif (alt) modifier |= MODIFIERS.alt;\n\tif (ctrl) modifier |= MODIFIERS.ctrl;\n\tif (superModifier) modifier |= MODIFIERS.super;\n\n\tswitch (key) {\n\t\tcase \"escape\":\n\t\tcase \"esc\":\n\t\t\tif (modifier !== 0) return false;\n\t\t\treturn (\n\t\t\t\tdata === \"\\x1b\" ||\n\t\t\t\tmatchesKittySequence(data, CODEPOINTS.escape, 0) ||\n\t\t\t\tmatchesModifyOtherKeys(data, CODEPOINTS.escape, 0)\n\t\t\t);\n\n\t\tcase \"space\":\n\t\t\tif (!_kittyProtocolActive) {\n\t\t\t\tif (modifier === MODIFIERS.ctrl && data === \"\\x00\") {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tif (modifier === MODIFIERS.alt && data === \"\\x1b \") {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (modifier === 0) {\n\t\t\t\treturn (\n\t\t\t\t\tdata === \" \" ||\n\t\t\t\t\tmatchesKittySequence(data, CODEPOINTS.space, 0) ||\n\t\t\t\t\tmatchesModifyOtherKeys(data, CODEPOINTS.space, 0)\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn (\n\t\t\t\tmatchesKittySequence(data, CODEPOINTS.space, modifier) ||\n\t\t\t\tmatchesModifyOtherKeys(data, CODEPOINTS.space, modifier)\n\t\t\t);\n\n\t\tcase \"tab\":\n\t\t\tif (modifier === MODIFIERS.shift) {\n\t\t\t\treturn (\n\t\t\t\t\tdata === \"\\x1b[Z\" ||\n\t\t\t\t\tmatchesKittySequence(data, CODEPOINTS.tab, MODIFIERS.shift) ||\n\t\t\t\t\tmatchesModifyOtherKeys(data, CODEPOINTS.tab, MODIFIERS.shift)\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (modifier === 0) {\n\t\t\t\treturn data === \"\\t\" || matchesKittySequence(data, CODEPOINTS.tab, 0);\n\t\t\t}\n\t\t\treturn (\n\t\t\t\tmatchesKittySequence(data, CODEPOINTS.tab, modifier) ||\n\t\t\t\tmatchesModifyOtherKeys(data, CODEPOINTS.tab, modifier)\n\t\t\t);\n\n\t\tcase \"enter\":\n\t\tcase \"return\":\n\t\t\tif (modifier === MODIFIERS.shift) {\n\t\t\t\t// CSI u sequences (standard Kitty protocol)\n\t\t\t\tif (\n\t\t\t\t\tmatchesKittySequence(data, CODEPOINTS.enter, MODIFIERS.shift) ||\n\t\t\t\t\tmatchesKittySequence(data, CODEPOINTS.kpEnter, MODIFIERS.shift)\n\t\t\t\t) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t// xterm modifyOtherKeys format (fallback when Kitty protocol not enabled)\n\t\t\t\tif (matchesModifyOtherKeys(data, CODEPOINTS.enter, MODIFIERS.shift)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t// When Kitty protocol is active, legacy sequences are custom terminal mappings\n\t\t\t\t// \\x1b\\r = Kitty's \"map shift+enter send_text all \\e\\r\"\n\t\t\t\t// \\n = Ghostty's \"keybind = shift+enter=text:\\n\"\n\t\t\t\tif (_kittyProtocolActive) {\n\t\t\t\t\treturn data === \"\\x1b\\r\" || data === \"\\n\";\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (modifier === MODIFIERS.alt) {\n\t\t\t\t// CSI u sequences (standard Kitty protocol)\n\t\t\t\tif (\n\t\t\t\t\tmatchesKittySequence(data, CODEPOINTS.enter, MODIFIERS.alt) ||\n\t\t\t\t\tmatchesKittySequence(data, CODEPOINTS.kpEnter, MODIFIERS.alt)\n\t\t\t\t) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t// xterm modifyOtherKeys format (fallback when Kitty protocol not enabled)\n\t\t\t\tif (matchesModifyOtherKeys(data, CODEPOINTS.enter, MODIFIERS.alt)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t// \\x1b\\r is alt+enter only in legacy mode (no Kitty protocol)\n\t\t\t\t// When Kitty protocol is active, alt+enter comes as CSI u sequence\n\t\t\t\tif (!_kittyProtocolActive) {\n\t\t\t\t\treturn data === \"\\x1b\\r\";\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (modifier === 0) {\n\t\t\t\treturn (\n\t\t\t\t\tdata === \"\\r\" ||\n\t\t\t\t\t(!_kittyProtocolActive && data === \"\\n\") ||\n\t\t\t\t\tdata === \"\\x1bOM\" || // SS3 M (numpad enter in some terminals)\n\t\t\t\t\tmatchesKittySequence(data, CODEPOINTS.enter, 0) ||\n\t\t\t\t\tmatchesKittySequence(data, CODEPOINTS.kpEnter, 0)\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn (\n\t\t\t\tmatchesKittySequence(data, CODEPOINTS.enter, modifier) ||\n\t\t\t\tmatchesKittySequence(data, CODEPOINTS.kpEnter, modifier) ||\n\t\t\t\tmatchesModifyOtherKeys(data, CODEPOINTS.enter, modifier)\n\t\t\t);\n\n\t\tcase \"backspace\":\n\t\t\tif (modifier === MODIFIERS.alt) {\n\t\t\t\tif (data === \"\\x1b\\x7f\" || data === \"\\x1b\\b\") {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn (\n\t\t\t\t\tmatchesKittySequence(data, CODEPOINTS.backspace, MODIFIERS.alt) ||\n\t\t\t\t\tmatchesModifyOtherKeys(data, CODEPOINTS.backspace, MODIFIERS.alt)\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (modifier === MODIFIERS.ctrl) {\n\t\t\t\t// Legacy raw 0x08 is ambiguous: it can be Ctrl+Backspace on Windows\n\t\t\t\t// Terminal or plain Backspace on other terminals, while also\n\t\t\t\t// overlapping with Ctrl+H.\n\t\t\t\tif (matchesRawBackspace(data, MODIFIERS.ctrl)) return true;\n\t\t\t\treturn (\n\t\t\t\t\tmatchesKittySequence(data, CODEPOINTS.backspace, MODIFIERS.ctrl) ||\n\t\t\t\t\tmatchesModifyOtherKeys(data, CODEPOINTS.backspace, MODIFIERS.ctrl)\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (modifier === 0) {\n\t\t\t\treturn (\n\t\t\t\t\tmatchesRawBackspace(data, 0) ||\n\t\t\t\t\tmatchesKittySequence(data, CODEPOINTS.backspace, 0) ||\n\t\t\t\t\tmatchesModifyOtherKeys(data, CODEPOINTS.backspace, 0)\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn (\n\t\t\t\tmatchesKittySequence(data, CODEPOINTS.backspace, modifier) ||\n\t\t\t\tmatchesModifyOtherKeys(data, CODEPOINTS.backspace, modifier)\n\t\t\t);\n\n\t\tcase \"insert\":\n\t\t\tif (modifier === 0) {\n\t\t\t\treturn (\n\t\t\t\t\tmatchesLegacySequence(data, LEGACY_KEY_SEQUENCES.insert) ||\n\t\t\t\t\tmatchesKittySequence(data, FUNCTIONAL_CODEPOINTS.insert, 0)\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (matchesLegacyModifierSequence(data, \"insert\", modifier)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn matchesKittySequence(data, FUNCTIONAL_CODEPOINTS.insert, modifier);\n\n\t\tcase \"delete\":\n\t\t\tif (modifier === 0) {\n\t\t\t\treturn (\n\t\t\t\t\tmatchesLegacySequence(data, LEGACY_KEY_SEQUENCES.delete) ||\n\t\t\t\t\tmatchesKittySequence(data, FUNCTIONAL_CODEPOINTS.delete, 0)\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (matchesLegacyModifierSequence(data, \"delete\", modifier)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn matchesKittySequence(data, FUNCTIONAL_CODEPOINTS.delete, modifier);\n\n\t\tcase \"clear\":\n\t\t\tif (modifier === 0) {\n\t\t\t\treturn matchesLegacySequence(data, LEGACY_KEY_SEQUENCES.clear);\n\t\t\t}\n\t\t\treturn matchesLegacyModifierSequence(data, \"clear\", modifier);\n\n\t\tcase \"home\":\n\t\t\tif (modifier === 0) {\n\t\t\t\treturn (\n\t\t\t\t\tmatchesLegacySequence(data, LEGACY_KEY_SEQUENCES.home) ||\n\t\t\t\t\tmatchesKittySequence(data, FUNCTIONAL_CODEPOINTS.home, 0)\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (matchesLegacyModifierSequence(data, \"home\", modifier)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn matchesKittySequence(data, FUNCTIONAL_CODEPOINTS.home, modifier);\n\n\t\tcase \"end\":\n\t\t\tif (modifier === 0) {\n\t\t\t\treturn (\n\t\t\t\t\tmatchesLegacySequence(data, LEGACY_KEY_SEQUENCES.end) ||\n\t\t\t\t\tmatchesKittySequence(data, FUNCTIONAL_CODEPOINTS.end, 0)\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (matchesLegacyModifierSequence(data, \"end\", modifier)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn matchesKittySequence(data, FUNCTIONAL_CODEPOINTS.end, modifier);\n\n\t\tcase \"pageup\":\n\t\t\tif (modifier === 0) {\n\t\t\t\treturn (\n\t\t\t\t\tmatchesLegacySequence(data, LEGACY_KEY_SEQUENCES.pageUp) ||\n\t\t\t\t\tmatchesKittySequence(data, FUNCTIONAL_CODEPOINTS.pageUp, 0)\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (matchesLegacyModifierSequence(data, \"pageUp\", modifier)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn matchesKittySequence(data, FUNCTIONAL_CODEPOINTS.pageUp, modifier);\n\n\t\tcase \"pagedown\":\n\t\t\tif (modifier === 0) {\n\t\t\t\treturn (\n\t\t\t\t\tmatchesLegacySequence(data, LEGACY_KEY_SEQUENCES.pageDown) ||\n\t\t\t\t\tmatchesKittySequence(data, FUNCTIONAL_CODEPOINTS.pageDown, 0)\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (matchesLegacyModifierSequence(data, \"pageDown\", modifier)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn matchesKittySequence(data, FUNCTIONAL_CODEPOINTS.pageDown, modifier);\n\n\t\tcase \"up\":\n\t\t\tif (modifier === MODIFIERS.alt) {\n\t\t\t\treturn data === \"\\x1bp\" || matchesKittySequence(data, ARROW_CODEPOINTS.up, MODIFIERS.alt);\n\t\t\t}\n\t\t\tif (modifier === 0) {\n\t\t\t\treturn (\n\t\t\t\t\tmatchesLegacySequence(data, LEGACY_KEY_SEQUENCES.up) ||\n\t\t\t\t\tmatchesKittySequence(data, ARROW_CODEPOINTS.up, 0)\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (matchesLegacyModifierSequence(data, \"up\", modifier)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn matchesKittySequence(data, ARROW_CODEPOINTS.up, modifier);\n\n\t\tcase \"down\":\n\t\t\tif (modifier === MODIFIERS.alt) {\n\t\t\t\treturn data === \"\\x1bn\" || matchesKittySequence(data, ARROW_CODEPOINTS.down, MODIFIERS.alt);\n\t\t\t}\n\t\t\tif (modifier === 0) {\n\t\t\t\treturn (\n\t\t\t\t\tmatchesLegacySequence(data, LEGACY_KEY_SEQUENCES.down) ||\n\t\t\t\t\tmatchesKittySequence(data, ARROW_CODEPOINTS.down, 0)\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (matchesLegacyModifierSequence(data, \"down\", modifier)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn matchesKittySequence(data, ARROW_CODEPOINTS.down, modifier);\n\n\t\tcase \"left\":\n\t\t\tif (modifier === MODIFIERS.alt) {\n\t\t\t\treturn (\n\t\t\t\t\tdata === \"\\x1b[1;3D\" ||\n\t\t\t\t\t(!_kittyProtocolActive && data === \"\\x1bB\") ||\n\t\t\t\t\tdata === \"\\x1bb\" ||\n\t\t\t\t\tmatchesKittySequence(data, ARROW_CODEPOINTS.left, MODIFIERS.alt)\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (modifier === MODIFIERS.ctrl) {\n\t\t\t\treturn (\n\t\t\t\t\tdata === \"\\x1b[1;5D\" ||\n\t\t\t\t\tmatchesLegacyModifierSequence(data, \"left\", MODIFIERS.ctrl) ||\n\t\t\t\t\tmatchesKittySequence(data, ARROW_CODEPOINTS.left, MODIFIERS.ctrl)\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (modifier === 0) {\n\t\t\t\treturn (\n\t\t\t\t\tmatchesLegacySequence(data, LEGACY_KEY_SEQUENCES.left) ||\n\t\t\t\t\tmatchesKittySequence(data, ARROW_CODEPOINTS.left, 0)\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (matchesLegacyModifierSequence(data, \"left\", modifier)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn matchesKittySequence(data, ARROW_CODEPOINTS.left, modifier);\n\n\t\tcase \"right\":\n\t\t\tif (modifier === MODIFIERS.alt) {\n\t\t\t\treturn (\n\t\t\t\t\tdata === \"\\x1b[1;3C\" ||\n\t\t\t\t\t(!_kittyProtocolActive && data === \"\\x1bF\") ||\n\t\t\t\t\tdata === \"\\x1bf\" ||\n\t\t\t\t\tmatchesKittySequence(data, ARROW_CODEPOINTS.right, MODIFIERS.alt)\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (modifier === MODIFIERS.ctrl) {\n\t\t\t\treturn (\n\t\t\t\t\tdata === \"\\x1b[1;5C\" ||\n\t\t\t\t\tmatchesLegacyModifierSequence(data, \"right\", MODIFIERS.ctrl) ||\n\t\t\t\t\tmatchesKittySequence(data, ARROW_CODEPOINTS.right, MODIFIERS.ctrl)\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (modifier === 0) {\n\t\t\t\treturn (\n\t\t\t\t\tmatchesLegacySequence(data, LEGACY_KEY_SEQUENCES.right) ||\n\t\t\t\t\tmatchesKittySequence(data, ARROW_CODEPOINTS.right, 0)\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (matchesLegacyModifierSequence(data, \"right\", modifier)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn matchesKittySequence(data, ARROW_CODEPOINTS.right, modifier);\n\n\t\tcase \"f1\":\n\t\tcase \"f2\":\n\t\tcase \"f3\":\n\t\tcase \"f4\":\n\t\tcase \"f5\":\n\t\tcase \"f6\":\n\t\tcase \"f7\":\n\t\tcase \"f8\":\n\t\tcase \"f9\":\n\t\tcase \"f10\":\n\t\tcase \"f11\":\n\t\tcase \"f12\": {\n\t\t\tif (modifier !== 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tconst functionKey = key as keyof typeof LEGACY_KEY_SEQUENCES;\n\t\t\treturn matchesLegacySequence(data, LEGACY_KEY_SEQUENCES[functionKey]);\n\t\t}\n\t}\n\n\t// Handle single letter/digit keys and symbols\n\tif (key.length === 1 && ((key >= \"a\" && key <= \"z\") || isDigitKey(key) || SYMBOL_KEYS.has(key))) {\n\t\tconst codepoint = key.charCodeAt(0);\n\t\tconst rawCtrl = rawCtrlChar(key);\n\t\tconst isLetter = key >= \"a\" && key <= \"z\";\n\t\tconst isDigit = isDigitKey(key);\n\n\t\tif (modifier === MODIFIERS.ctrl + MODIFIERS.alt && !_kittyProtocolActive && rawCtrl) {\n\t\t\t// Legacy: ctrl+alt+key is ESC followed by the control character.\n\t\t\t// If that legacy form does not match, continue so CSI-u and\n\t\t\t// modifyOtherKeys sequences from tmux can still be recognized.\n\t\t\tif (data === `\\x1b${rawCtrl}`) return true;\n\t\t}\n\n\t\tif (modifier === MODIFIERS.alt && !_kittyProtocolActive && (isLetter || isDigit || SYMBOL_KEYS.has(key))) {\n\t\t\t// Legacy: alt+printable key is ESC followed by the key\n\t\t\tif (data === `\\x1b${key}`) return true;\n\t\t}\n\n\t\tif (modifier === MODIFIERS.ctrl) {\n\t\t\t// Legacy: ctrl+key sends the control character\n\t\t\tif (rawCtrl && data === rawCtrl) return true;\n\t\t\treturn (\n\t\t\t\tmatchesKittySequence(data, codepoint, MODIFIERS.ctrl) ||\n\t\t\t\tmatchesPrintableModifyOtherKeys(data, codepoint, MODIFIERS.ctrl)\n\t\t\t);\n\t\t}\n\n\t\tif (modifier === MODIFIERS.shift + MODIFIERS.ctrl) {\n\t\t\treturn (\n\t\t\t\tmatchesKittySequence(data, codepoint, MODIFIERS.shift + MODIFIERS.ctrl) ||\n\t\t\t\tmatchesPrintableModifyOtherKeys(data, codepoint, MODIFIERS.shift + MODIFIERS.ctrl)\n\t\t\t);\n\t\t}\n\n\t\tif (modifier === MODIFIERS.shift) {\n\t\t\t// Legacy: shift+letter produces uppercase\n\t\t\tif (isLetter && data === key.toUpperCase()) return true;\n\t\t\treturn (\n\t\t\t\tmatchesKittySequence(data, codepoint, MODIFIERS.shift) ||\n\t\t\t\tmatchesPrintableModifyOtherKeys(data, codepoint, MODIFIERS.shift)\n\t\t\t);\n\t\t}\n\n\t\tif (modifier !== 0) {\n\t\t\treturn (\n\t\t\t\tmatchesKittySequence(data, codepoint, modifier) ||\n\t\t\t\tmatchesPrintableModifyOtherKeys(data, codepoint, modifier)\n\t\t\t);\n\t\t}\n\n\t\t// Check both raw char and Kitty sequence (needed for release events)\n\t\treturn (\n\t\t\tdata === key || matchesKittySequence(data, codepoint, 0) || matchesPrintableModifyOtherKeys(data, codepoint, 0)\n\t\t);\n\t}\n\n\treturn false;\n}\n\n/**\n * Parse input data and return the key identifier if recognized.\n *\n * @param data - Raw input data from terminal\n * @returns Key identifier string (e.g., \"ctrl+c\") or undefined\n */\nfunction formatParsedKey(codepoint: number, modifier: number, baseLayoutKey?: number): string | undefined {\n\tconst normalizedCodepoint = normalizeKittyFunctionalCodepoint(codepoint);\n\tconst identityCodepoint = normalizeShiftedLetterIdentityCodepoint(normalizedCodepoint, modifier);\n\n\t// Use base layout key only when codepoint is not a recognized Latin\n\t// letter (a-z), digit (0-9), or symbol (/, -, [, ;, etc.). For those,\n\t// the codepoint is authoritative regardless of physical key position.\n\t// This prevents remapped layouts (Dvorak, Colemak, xremap, etc.) from\n\t// reporting the wrong key name based on the QWERTY physical position.\n\tconst isLatinLetter = identityCodepoint >= 97 && identityCodepoint <= 122; // a-z\n\tconst isDigit = identityCodepoint >= 48 && identityCodepoint <= 57; // 0-9\n\tconst isKnownSymbol = SYMBOL_KEYS.has(String.fromCharCode(identityCodepoint));\n\tconst effectiveCodepoint =\n\t\tisLatinLetter || isDigit || isKnownSymbol ? identityCodepoint : (baseLayoutKey ?? identityCodepoint);\n\n\tlet keyName: string | undefined;\n\tif (effectiveCodepoint === CODEPOINTS.escape) keyName = \"escape\";\n\telse if (effectiveCodepoint === CODEPOINTS.tab) keyName = \"tab\";\n\telse if (effectiveCodepoint === CODEPOINTS.enter || effectiveCodepoint === CODEPOINTS.kpEnter) keyName = \"enter\";\n\telse if (effectiveCodepoint === CODEPOINTS.space) keyName = \"space\";\n\telse if (effectiveCodepoint === CODEPOINTS.backspace) keyName = \"backspace\";\n\telse if (effectiveCodepoint === FUNCTIONAL_CODEPOINTS.delete) keyName = \"delete\";\n\telse if (effectiveCodepoint === FUNCTIONAL_CODEPOINTS.insert) keyName = \"insert\";\n\telse if (effectiveCodepoint === FUNCTIONAL_CODEPOINTS.home) keyName = \"home\";\n\telse if (effectiveCodepoint === FUNCTIONAL_CODEPOINTS.end) keyName = \"end\";\n\telse if (effectiveCodepoint === FUNCTIONAL_CODEPOINTS.pageUp) keyName = \"pageUp\";\n\telse if (effectiveCodepoint === FUNCTIONAL_CODEPOINTS.pageDown) keyName = \"pageDown\";\n\telse if (effectiveCodepoint === ARROW_CODEPOINTS.up) keyName = \"up\";\n\telse if (effectiveCodepoint === ARROW_CODEPOINTS.down) keyName = \"down\";\n\telse if (effectiveCodepoint === ARROW_CODEPOINTS.left) keyName = \"left\";\n\telse if (effectiveCodepoint === ARROW_CODEPOINTS.right) keyName = \"right\";\n\telse if (effectiveCodepoint >= 48 && effectiveCodepoint <= 57) keyName = String.fromCharCode(effectiveCodepoint);\n\telse if (effectiveCodepoint >= 97 && effectiveCodepoint <= 122) keyName = String.fromCharCode(effectiveCodepoint);\n\telse if (SYMBOL_KEYS.has(String.fromCharCode(effectiveCodepoint))) keyName = String.fromCharCode(effectiveCodepoint);\n\n\tif (!keyName) return undefined;\n\treturn formatKeyNameWithModifiers(keyName, modifier);\n}\n\nexport function parseKey(data: string): string | undefined {\n\tconst kitty = parseKittySequence(data);\n\tif (kitty) {\n\t\tconst logicalShiftedSymbol = getLogicalShiftedSymbolCandidate(kitty.shiftedKey, kitty.modifier, SYMBOL_KEYS);\n\t\treturn formatParsedKey(\n\t\t\tlogicalShiftedSymbol?.codepoint ?? kitty.codepoint,\n\t\t\tlogicalShiftedSymbol?.modifier ?? kitty.modifier,\n\t\t\tkitty.baseLayoutKey,\n\t\t);\n\t}\n\n\tconst modifyOtherKeys = parseModifyOtherKeysSequence(data);\n\tif (modifyOtherKeys) {\n\t\tconst logicalShiftedSymbol = getLogicalShiftedSymbolCandidate(\n\t\t\tmodifyOtherKeys.codepoint,\n\t\t\tmodifyOtherKeys.modifier,\n\t\t\tSHIFTED_SYMBOL_KEYS,\n\t\t);\n\t\treturn formatParsedKey(\n\t\t\tlogicalShiftedSymbol?.codepoint ?? modifyOtherKeys.codepoint,\n\t\t\tlogicalShiftedSymbol?.modifier ?? modifyOtherKeys.modifier,\n\t\t);\n\t}\n\n\t// Mode-aware legacy sequences\n\t// When Kitty protocol is active, ambiguous sequences are interpreted as custom terminal mappings:\n\t// - \\x1b\\r = shift+enter (Kitty mapping), not alt+enter\n\t// - \\n = shift+enter (Ghostty mapping)\n\tif (_kittyProtocolActive) {\n\t\tif (data === \"\\x1b\\r\" || data === \"\\n\") return \"shift+enter\";\n\t}\n\n\tconst legacySequenceKeyId = LEGACY_SEQUENCE_KEY_IDS[data];\n\tif (legacySequenceKeyId) return legacySequenceKeyId;\n\n\t// Legacy sequences (used when Kitty protocol is not active, or for unambiguous sequences)\n\tif (data === \"\\x1b\") return \"escape\";\n\tif (data === \"\\x1c\") return \"ctrl+\\\\\";\n\tif (data === \"\\x1d\") return \"ctrl+]\";\n\tif (data === \"\\x1f\") return \"ctrl+-\";\n\tif (data === \"\\x1b\\x1b\") return \"ctrl+alt+[\";\n\tif (data === \"\\x1b\\x1c\") return \"ctrl+alt+\\\\\";\n\tif (data === \"\\x1b\\x1d\") return \"ctrl+alt+]\";\n\tif (data === \"\\x1b\\x1f\") return \"ctrl+alt+-\";\n\tif (data === \"\\t\") return \"tab\";\n\tif (data === \"\\r\" || (!_kittyProtocolActive && data === \"\\n\") || data === \"\\x1bOM\") return \"enter\";\n\tif (data === \"\\x00\") return \"ctrl+space\";\n\tif (data === \" \") return \"space\";\n\tif (data === \"\\x7f\") return \"backspace\";\n\tif (data === \"\\x08\") return isWindowsTerminalSession() ? \"ctrl+backspace\" : \"backspace\";\n\tif (data === \"\\x1b[Z\") return \"shift+tab\";\n\tif (!_kittyProtocolActive && data === \"\\x1b\\r\") return \"alt+enter\";\n\tif (!_kittyProtocolActive && data === \"\\x1b \") return \"alt+space\";\n\tif (data === \"\\x1b\\x7f\" || data === \"\\x1b\\b\") return \"alt+backspace\";\n\tif (!_kittyProtocolActive && data === \"\\x1bB\") return \"alt+left\";\n\tif (!_kittyProtocolActive && data === \"\\x1bF\") return \"alt+right\";\n\tif (!_kittyProtocolActive && data.length === 2 && data[0] === \"\\x1b\") {\n\t\tconst code = data.charCodeAt(1);\n\t\tif (code >= 1 && code <= 26) {\n\t\t\treturn `ctrl+alt+${String.fromCharCode(code + 96)}`;\n\t\t}\n\t\t// Legacy alt+letter/digit/symbol (ESC followed by the key)\n\t\tconst key = String.fromCharCode(code);\n\t\tif ((code >= 97 && code <= 122) || (code >= 48 && code <= 57) || SYMBOL_KEYS.has(key)) {\n\t\t\treturn `alt+${key}`;\n\t\t}\n\t}\n\tif (data === \"\\x1b[A\") return \"up\";\n\tif (data === \"\\x1b[B\") return \"down\";\n\tif (data === \"\\x1b[C\") return \"right\";\n\tif (data === \"\\x1b[D\") return \"left\";\n\tif (data === \"\\x1b[H\" || data === \"\\x1bOH\") return \"home\";\n\tif (data === \"\\x1b[F\" || data === \"\\x1bOF\") return \"end\";\n\tif (data === \"\\x1b[3~\") return \"delete\";\n\tif (data === \"\\x1b[5~\") return \"pageUp\";\n\tif (data === \"\\x1b[6~\") return \"pageDown\";\n\n\t// Raw Ctrl+letter\n\tif (data.length === 1) {\n\t\tconst code = data.charCodeAt(0);\n\t\tif (code >= 1 && code <= 26) {\n\t\t\treturn `ctrl+${String.fromCharCode(code + 96)}`;\n\t\t}\n\t\tif (code >= 32 && code <= 126) {\n\t\t\treturn data;\n\t\t}\n\t}\n\n\treturn undefined;\n}\n\n// =============================================================================\n// Kitty CSI-u Printable Decoding\n// =============================================================================\n\nconst KITTY_CSI_U_REGEX = /^\\x1b\\[(\\d+)(?::(\\d*))?(?::(\\d+))?(?:;(\\d+))?(?::(\\d+))?u$/;\nconst KITTY_PRINTABLE_ALLOWED_MODIFIERS = MODIFIERS.shift | LOCK_MASK;\n\n/**\n * Decode a Kitty CSI-u sequence into a printable character, if applicable.\n *\n * When Kitty keyboard protocol flag 1 (disambiguate) is active, terminals send\n * CSI-u sequences for all keys, including plain printable characters. This\n * function extracts the printable character from such sequences.\n *\n * Only accepts plain or Shift-modified keys. Rejects Ctrl, Alt, and unsupported\n * modifier combinations (those are handled by keybinding matching instead).\n * Prefers the shifted keycode when Shift is held and a shifted key is reported.\n *\n * @param data - Raw input data from terminal\n * @returns The printable character, or undefined if not a printable CSI-u sequence\n */\nexport function decodeKittyPrintable(data: string): string | undefined {\n\tconst match = data.match(KITTY_CSI_U_REGEX);\n\tif (!match) return undefined;\n\n\t// CSI-u groups: <codepoint>[:<shifted>[:<base>]];<mod>[:<event>]u\n\tconst codepoint = Number.parseInt(match[1] ?? \"\", 10);\n\tif (!Number.isFinite(codepoint)) return undefined;\n\n\tconst shiftedKey = match[2] && match[2].length > 0 ? Number.parseInt(match[2], 10) : undefined;\n\tconst modValue = match[4] ? Number.parseInt(match[4], 10) : 1;\n\t// Modifiers are 1-indexed in CSI-u; normalize to our bitmask.\n\tconst modifier = Number.isFinite(modValue) ? modValue - 1 : 0;\n\n\t// Only accept printable CSI-u input for plain or Shift-modified text keys.\n\t// Reject unsupported modifier bits (e.g. Super/Meta) to avoid inserting\n\t// characters from modifier-only terminal events.\n\tif ((modifier & ~KITTY_PRINTABLE_ALLOWED_MODIFIERS) !== 0) return undefined;\n\tif (modifier & (MODIFIERS.alt | MODIFIERS.ctrl)) return undefined;\n\n\t// Prefer the shifted keycode when Shift is held.\n\tlet effectiveCodepoint = codepoint;\n\tif (modifier & MODIFIERS.shift && typeof shiftedKey === \"number\") {\n\t\teffectiveCodepoint = shiftedKey;\n\t}\n\teffectiveCodepoint = normalizeKittyFunctionalCodepoint(effectiveCodepoint);\n\t// Drop control characters or invalid codepoints.\n\tif (!Number.isFinite(effectiveCodepoint) || effectiveCodepoint < 32) return undefined;\n\n\ttry {\n\t\treturn String.fromCodePoint(effectiveCodepoint);\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n\nfunction decodeModifyOtherKeysPrintable(data: string): string | undefined {\n\tconst parsed = parseModifyOtherKeysSequence(data);\n\tif (!parsed) return undefined;\n\tconst modifier = parsed.modifier & ~LOCK_MASK;\n\tif ((modifier & ~MODIFIERS.shift) !== 0) return undefined;\n\tif (!Number.isFinite(parsed.codepoint) || parsed.codepoint < 32) return undefined;\n\n\ttry {\n\t\treturn String.fromCodePoint(parsed.codepoint);\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n\nexport function decodePrintableKey(data: string): string | undefined {\n\treturn decodeKittyPrintable(data) ?? decodeModifyOtherKeysPrintable(data);\n}\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Program Status Protocol (OSC 7501): a program tells the terminal whether it is idle, working,
|
|
3
|
+
* blocked on the user, done, or failed. Only the root record is supported.
|
|
4
|
+
*
|
|
5
|
+
* Spec: https://www.superlogical.com/rex/docs/build/program-status
|
|
6
|
+
*/
|
|
7
|
+
export interface ProgramStatus {
|
|
8
|
+
/** `clear` removes the status instead of reporting one. */
|
|
9
|
+
state: "idle" | "working" | "blocked" | "done" | "error" | "clear";
|
|
10
|
+
/** Stable program name, `[A-Za-z0-9_.+-]{1,32}`. Other values are omitted. */
|
|
11
|
+
app?: string;
|
|
12
|
+
/** What a blocked program waits for. Omitted for other states. */
|
|
13
|
+
kind?: "permission" | "question" | "auth";
|
|
14
|
+
/** One human-readable line. Control characters become spaces; longer text is cut to the spec limit. */
|
|
15
|
+
message?: string;
|
|
16
|
+
}
|
|
17
|
+
/** Feature detection query. A supporting terminal replies with the same body. */
|
|
18
|
+
export declare const PROGRAM_STATUS_QUERY = "\u001B]7501;?\u001B\\";
|
|
19
|
+
/** The reply to {@link PROGRAM_STATUS_QUERY}. Later spec revisions may add pairs after the `?`. */
|
|
20
|
+
export declare function isProgramStatusReply(sequence: string): boolean;
|
|
21
|
+
/** Encode a status report. Terminals discard reports whose text contains control characters, so they are replaced. */
|
|
22
|
+
export declare function formatProgramStatus(status: ProgramStatus): string;
|
|
23
|
+
//# sourceMappingURL=program-status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"program-status.d.ts","sourceRoot":"","sources":["../src/program-status.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,aAAa;IAC7B,2DAA2D;IAC3D,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;IACnE,8EAA8E;IAC9E,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,kEAAkE;IAClE,IAAI,CAAC,EAAE,YAAY,GAAG,UAAU,GAAG,MAAM,CAAC;IAC1C,uGAAuG;IACvG,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,iFAAiF;AACjF,eAAO,MAAM,oBAAoB,0BAAsB,CAAC;AAExD,mGAAmG;AACnG,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAE9D;AAoBD,sHAAsH;AACtH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CAOjE"}
|