@code-yeongyu/senpi 2026.5.20-3 → 2026.5.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +4 -10
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +10 -4
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +2 -3
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/http-dispatcher.d.ts +21 -0
- package/dist/core/http-dispatcher.d.ts.map +1 -0
- package/dist/core/http-dispatcher.js +48 -0
- package/dist/core/http-dispatcher.js.map +1 -0
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +2 -1
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/settings-manager.d.ts +3 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +20 -0
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +2 -0
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +2 -0
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +15 -0
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +10 -1
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/senpi +4 -10
- package/dist/utils/paths.d.ts +1 -0
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +16 -0
- package/dist/utils/paths.js.map +1 -1
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +2 -2
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +2 -2
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +3 -3
- package/node_modules/@earendil-works/pi-agent-core/README.md +488 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.d.ts +24 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js +610 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.d.ts +120 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.js +405 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.d.ts +92 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.js +904 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/branch-summarization.d.ts +53 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/branch-summarization.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/branch-summarization.js +174 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/branch-summarization.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.d.ts +95 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js +533 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/utils.d.ts +25 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/utils.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/utils.js +131 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/utils.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.d.ts +51 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.js +486 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/messages.d.ts +52 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/messages.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/messages.js +102 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/messages.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/prompt-templates.d.ts +48 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/prompt-templates.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/prompt-templates.js +230 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/prompt-templates.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-repo.d.ts +26 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-repo.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-repo.js +101 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-repo.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-storage.d.ts +33 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-storage.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-storage.js +231 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-storage.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-repo.d.ts +18 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-repo.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-repo.js +42 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-repo.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-storage.d.ts +25 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-storage.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-storage.js +114 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-storage.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo-utils.d.ts +11 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo-utils.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo-utils.js +39 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo-utils.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.d.ts +32 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.js +197 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/uuid.d.ts +2 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/uuid.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/uuid.js +50 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/uuid.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/skills.d.ts +44 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/skills.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/skills.js +311 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/skills.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/system-prompt.d.ts +3 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/system-prompt.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/system-prompt.js +30 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/system-prompt.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.d.ts +604 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.js +103 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/shell-output.d.ts +14 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/shell-output.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/shell-output.js +126 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/shell-output.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/truncate.d.ts +70 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/truncate.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/truncate.js +290 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/truncate.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/index.d.ts +20 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/index.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/index.js +25 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/index.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/node.d.ts +3 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/node.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/node.js +3 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/node.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/proxy.d.ts +69 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/proxy.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/proxy.js +278 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/proxy.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts +394 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/types.js +2 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/types.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/package.json +61 -0
- package/node_modules/@earendil-works/pi-ai/README.md +1386 -0
- package/node_modules/@earendil-works/pi-ai/dist/api-registry.d.ts +20 -0
- package/node_modules/@earendil-works/pi-ai/dist/api-registry.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api-registry.js +44 -0
- package/node_modules/@earendil-works/pi-ai/dist/api-registry.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/bedrock-provider.d.ts +5 -0
- package/node_modules/@earendil-works/pi-ai/dist/bedrock-provider.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/bedrock-provider.js +6 -0
- package/node_modules/@earendil-works/pi-ai/dist/bedrock-provider.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/cli.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/cli.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/cli.js +116 -0
- package/node_modules/@earendil-works/pi-ai/dist/cli.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.d.ts +18 -0
- package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.js +178 -0
- package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/image-models.d.ts +10 -0
- package/node_modules/@earendil-works/pi-ai/dist/image-models.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.d.ts +440 -0
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js +442 -0
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/image-models.js +23 -0
- package/node_modules/@earendil-works/pi-ai/dist/image-models.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/images-api-registry.d.ts +14 -0
- package/node_modules/@earendil-works/pi-ai/dist/images-api-registry.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/images-api-registry.js +22 -0
- package/node_modules/@earendil-works/pi-ai/dist/images-api-registry.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/images.d.ts +4 -0
- package/node_modules/@earendil-works/pi-ai/dist/images.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/images.js +14 -0
- package/node_modules/@earendil-works/pi-ai/dist/images.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/index.d.ts +33 -0
- package/node_modules/@earendil-works/pi-ai/dist/index.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/index.js +21 -0
- package/node_modules/@earendil-works/pi-ai/dist/index.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/models.d.ts +37 -0
- package/node_modules/@earendil-works/pi-ai/dist/models.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts +17658 -0
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.js +16510 -0
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/models.js +114 -0
- package/node_modules/@earendil-works/pi-ai/dist/models.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/oauth.d.ts +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/oauth.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/oauth.js +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/oauth.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.d.ts +38 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.js +787 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.d.ts +52 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.js +1127 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.d.ts +15 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.js +229 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare.d.ts +13 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare.js +26 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/faux.d.ts +66 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/faux.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/faux.js +401 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/faux.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/github-copilot-headers.d.ts +8 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/github-copilot-headers.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/github-copilot-headers.js +29 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/github-copilot-headers.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/google-shared.d.ts +73 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/google-shared.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/google-shared.js +359 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/google-shared.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/google-vertex.d.ts +15 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/google-vertex.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/google-vertex.js +465 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/google-vertex.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/google.d.ts +13 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/google.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/google.js +431 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/google.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/images/openrouter.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/images/openrouter.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/images/openrouter.js +129 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/images/openrouter.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/images/register-builtins.d.ts +4 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/images/register-builtins.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/images/register-builtins.js +34 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/images/register-builtins.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/mistral.d.ts +25 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/mistral.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/mistral.js +542 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/mistral.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex-responses.d.ts +30 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex-responses.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex-responses.js +1112 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex-responses.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.d.ts +22 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.js +977 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-prompt-cache.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-prompt-cache.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-prompt-cache.js +10 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-prompt-cache.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses-shared.d.ts +19 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses-shared.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses-shared.js +579 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses-shared.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses.d.ts +13 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses.js +651 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/register-builtins.d.ts +35 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/register-builtins.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/register-builtins.js +254 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/register-builtins.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/simple-options.d.ts +38 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/simple-options.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/simple-options.js +174 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/simple-options.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/transform-messages.d.ts +16 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/transform-messages.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/transform-messages.js +186 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/transform-messages.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/session-resources.d.ts +4 -0
- package/node_modules/@earendil-works/pi-ai/dist/session-resources.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/session-resources.js +22 -0
- package/node_modules/@earendil-works/pi-ai/dist/session-resources.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/stream.d.ts +8 -0
- package/node_modules/@earendil-works/pi-ai/dist/stream.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/stream.js +42 -0
- package/node_modules/@earendil-works/pi-ai/dist/stream.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/context-transformer.d.ts +22 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/context-transformer.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/context-transformer.js +161 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/context-transformer.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/index.d.ts +13 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/index.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/index.js +23 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/index.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/gemma4.d.ts +21 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/gemma4.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/gemma4.js +559 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/gemma4.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/hermes.d.ts +21 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/hermes.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/hermes.js +69 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/hermes.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/json-mix.d.ts +12 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/json-mix.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/json-mix.js +570 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/json-mix.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/morph-xml.d.ts +15 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/morph-xml.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/morph-xml.js +935 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/morph-xml.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/xml-tool-tag-scanner.d.ts +14 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/xml-tool-tag-scanner.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/xml-tool-tag-scanner.js +54 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/xml-tool-tag-scanner.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/yaml-xml.d.ts +8 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/yaml-xml.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/yaml-xml.js +295 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/yaml-xml.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/stream-wrapper.d.ts +4 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/stream-wrapper.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/stream-wrapper.js +336 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/stream-wrapper.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/types.d.ts +103 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/types.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/types.js +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/types.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +543 -0
- package/node_modules/@earendil-works/pi-ai/dist/types.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/types.js +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/types.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/diagnostics.d.ts +19 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/diagnostics.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/diagnostics.js +25 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/diagnostics.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.d.ts +21 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.js +81 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/hash.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/hash.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/hash.js +14 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/hash.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/headers.d.ts +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/headers.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/headers.js +8 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/headers.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/json-parse.d.ts +16 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/json-parse.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/json-parse.js +113 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/json-parse.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/node-http-proxy.d.ts +10 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/node-http-proxy.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/node-http-proxy.js +97 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/node-http-proxy.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/anthropic.d.ts +25 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/anthropic.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/anthropic.js +335 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/anthropic.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/github-copilot.d.ts +30 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/github-copilot.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/github-copilot.js +292 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/github-copilot.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/index.d.ts +57 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/index.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/index.js +121 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/index.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/oauth-page.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/oauth-page.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/oauth-page.js +105 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/oauth-page.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/openai-codex.d.ts +34 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/openai-codex.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/openai-codex.js +385 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/openai-codex.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/pkce.d.ts +13 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/pkce.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/pkce.js +31 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/pkce.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/types.d.ts +57 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/types.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/types.js +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/types.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.d.ts +56 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.js +151 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/sanitize-unicode.d.ts +22 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/sanitize-unicode.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/sanitize-unicode.js +26 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/sanitize-unicode.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/tool-pair-repair.d.ts +5 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/tool-pair-repair.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/tool-pair-repair.js +49 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/tool-pair-repair.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/typebox-helpers.d.ts +17 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/typebox-helpers.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/typebox-helpers.js +21 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/typebox-helpers.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/validation.d.ts +18 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/validation.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/validation.js +281 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/validation.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/package.json +113 -0
- package/node_modules/@earendil-works/pi-tui/README.md +779 -0
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.d.ts +54 -0
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.js +632 -0
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/box.d.ts +22 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/box.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/box.js +104 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/box.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/cancellable-loader.d.ts +22 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/cancellable-loader.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/cancellable-loader.js +35 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/cancellable-loader.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts +249 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.js +1916 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/image.d.ts +28 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/image.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/image.js +89 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/image.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/input.d.ts +37 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/input.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/input.js +426 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/input.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/loader.d.ts +40 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/loader.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/loader.js +95 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/loader.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/markdown.d.ts +90 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/markdown.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js +634 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/select-list.d.ts +50 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/select-list.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/select-list.js +159 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/select-list.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.d.ts +50 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js +185 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/spacer.d.ts +12 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/spacer.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/spacer.js +23 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/spacer.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/text.d.ts +19 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/text.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/text.js +89 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/text.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/truncated-text.d.ts +13 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/truncated-text.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/truncated-text.js +51 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/truncated-text.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/editor-component.d.ts +39 -0
- package/node_modules/@earendil-works/pi-tui/dist/editor-component.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/editor-component.js +2 -0
- package/node_modules/@earendil-works/pi-tui/dist/editor-component.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/fuzzy.d.ts +16 -0
- package/node_modules/@earendil-works/pi-tui/dist/fuzzy.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/fuzzy.js +110 -0
- package/node_modules/@earendil-works/pi-tui/dist/fuzzy.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/index.d.ts +23 -0
- package/node_modules/@earendil-works/pi-tui/dist/index.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/index.js +32 -0
- package/node_modules/@earendil-works/pi-tui/dist/index.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts +193 -0
- package/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/keybindings.js +174 -0
- package/node_modules/@earendil-works/pi-tui/dist/keybindings.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/keys.d.ts +184 -0
- package/node_modules/@earendil-works/pi-tui/dist/keys.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/keys.js +1173 -0
- package/node_modules/@earendil-works/pi-tui/dist/keys.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/kill-ring.d.ts +28 -0
- package/node_modules/@earendil-works/pi-tui/dist/kill-ring.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/kill-ring.js +44 -0
- package/node_modules/@earendil-works/pi-tui/dist/kill-ring.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.d.ts +50 -0
- package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.js +361 -0
- package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts +90 -0
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js +336 -0
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts +88 -0
- package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/terminal.js +329 -0
- package/node_modules/@earendil-works/pi-tui/dist/terminal.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts +231 -0
- package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/tui.js +1230 -0
- package/node_modules/@earendil-works/pi-tui/dist/tui.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/undo-stack.d.ts +17 -0
- package/node_modules/@earendil-works/pi-tui/dist/undo-stack.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/undo-stack.js +25 -0
- package/node_modules/@earendil-works/pi-tui/dist/undo-stack.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts +79 -0
- package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/utils.js +1031 -0
- package/node_modules/@earendil-works/pi-tui/dist/utils.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/package.json +48 -0
- package/node_modules/@smithy/node-http-handler/LICENSE +201 -0
- package/node_modules/@smithy/node-http-handler/README.md +9 -0
- package/node_modules/@smithy/node-http-handler/dist-cjs/index.js +724 -0
- package/node_modules/@smithy/node-http-handler/dist-es/constants.js +1 -0
- package/node_modules/@smithy/node-http-handler/dist-es/get-transformed-headers.js +9 -0
- package/node_modules/@smithy/node-http-handler/dist-es/index.js +3 -0
- package/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +216 -0
- package/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-manager.js +87 -0
- package/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-pool.js +32 -0
- package/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +170 -0
- package/node_modules/@smithy/node-http-handler/dist-es/readable.mock.js +21 -0
- package/node_modules/@smithy/node-http-handler/dist-es/server.mock.js +88 -0
- package/node_modules/@smithy/node-http-handler/dist-es/set-connection-timeout.js +36 -0
- package/node_modules/@smithy/node-http-handler/dist-es/set-request-timeout.js +21 -0
- package/node_modules/@smithy/node-http-handler/dist-es/set-socket-keep-alive.js +22 -0
- package/node_modules/@smithy/node-http-handler/dist-es/set-socket-timeout.js +23 -0
- package/node_modules/@smithy/node-http-handler/dist-es/stream-collector/collector.js +8 -0
- package/node_modules/@smithy/node-http-handler/dist-es/stream-collector/index.js +41 -0
- package/node_modules/@smithy/node-http-handler/dist-es/stream-collector/readable.mock.js +21 -0
- package/node_modules/@smithy/node-http-handler/dist-es/timing.js +4 -0
- package/node_modules/@smithy/node-http-handler/dist-es/write-request-body.js +56 -0
- package/node_modules/@smithy/node-http-handler/dist-types/constants.d.ts +5 -0
- package/node_modules/@smithy/node-http-handler/dist-types/get-transformed-headers.d.ts +4 -0
- package/node_modules/@smithy/node-http-handler/dist-types/index.d.ts +3 -0
- package/node_modules/@smithy/node-http-handler/dist-types/node-http-handler.d.ts +46 -0
- package/node_modules/@smithy/node-http-handler/dist-types/node-http2-connection-manager.d.ts +24 -0
- package/node_modules/@smithy/node-http-handler/dist-types/node-http2-connection-pool.d.ts +12 -0
- package/node_modules/@smithy/node-http-handler/dist-types/node-http2-handler.d.ts +63 -0
- package/node_modules/@smithy/node-http-handler/dist-types/readable.mock.d.ts +13 -0
- package/node_modules/@smithy/node-http-handler/dist-types/server.mock.d.ts +12 -0
- package/node_modules/@smithy/node-http-handler/dist-types/set-connection-timeout.d.ts +2 -0
- package/node_modules/@smithy/node-http-handler/dist-types/set-request-timeout.d.ts +6 -0
- package/node_modules/@smithy/node-http-handler/dist-types/set-socket-keep-alive.d.ts +6 -0
- package/node_modules/@smithy/node-http-handler/dist-types/set-socket-timeout.d.ts +2 -0
- package/node_modules/@smithy/node-http-handler/dist-types/stream-collector/collector.d.ts +5 -0
- package/node_modules/@smithy/node-http-handler/dist-types/stream-collector/index.d.ts +6 -0
- package/node_modules/@smithy/node-http-handler/dist-types/stream-collector/readable.mock.d.ts +13 -0
- package/node_modules/@smithy/node-http-handler/dist-types/timing.d.ts +8 -0
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/constants.d.ts +5 -0
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/get-transformed-headers.d.ts +4 -0
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/index.d.ts +3 -0
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http-handler.d.ts +46 -0
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-connection-manager.d.ts +24 -0
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-connection-pool.d.ts +12 -0
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-handler.d.ts +63 -0
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/readable.mock.d.ts +13 -0
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/server.mock.d.ts +12 -0
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-connection-timeout.d.ts +2 -0
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-request-timeout.d.ts +6 -0
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-socket-keep-alive.d.ts +6 -0
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-socket-timeout.d.ts +2 -0
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/stream-collector/collector.d.ts +5 -0
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/stream-collector/index.d.ts +6 -0
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/stream-collector/readable.mock.d.ts +13 -0
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/timing.d.ts +8 -0
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/write-request-body.d.ts +11 -0
- package/node_modules/@smithy/node-http-handler/dist-types/write-request-body.d.ts +11 -0
- package/node_modules/@smithy/node-http-handler/package.json +68 -0
- package/node_modules/@smithy/types/LICENSE +201 -0
- package/node_modules/@smithy/types/README.md +115 -0
- package/node_modules/@smithy/types/dist-cjs/index.js +91 -0
- package/node_modules/@smithy/types/dist-es/abort-handler.js +1 -0
- package/node_modules/@smithy/types/dist-es/abort.js +1 -0
- package/node_modules/@smithy/types/dist-es/auth/HttpApiKeyAuth.js +5 -0
- package/node_modules/@smithy/types/dist-es/auth/HttpAuthScheme.js +1 -0
- package/node_modules/@smithy/types/dist-es/auth/HttpAuthSchemeProvider.js +1 -0
- package/node_modules/@smithy/types/dist-es/auth/HttpSigner.js +1 -0
- package/node_modules/@smithy/types/dist-es/auth/IdentityProviderConfig.js +1 -0
- package/node_modules/@smithy/types/dist-es/auth/auth.js +5 -0
- package/node_modules/@smithy/types/dist-es/auth/index.js +6 -0
- package/node_modules/@smithy/types/dist-es/blob/blob-payload-input-types.js +1 -0
- package/node_modules/@smithy/types/dist-es/checksum.js +1 -0
- package/node_modules/@smithy/types/dist-es/client.js +1 -0
- package/node_modules/@smithy/types/dist-es/command.js +1 -0
- package/node_modules/@smithy/types/dist-es/connection/config.js +1 -0
- package/node_modules/@smithy/types/dist-es/connection/index.js +3 -0
- package/node_modules/@smithy/types/dist-es/connection/manager.js +1 -0
- package/node_modules/@smithy/types/dist-es/connection/pool.js +1 -0
- package/node_modules/@smithy/types/dist-es/crypto.js +1 -0
- package/node_modules/@smithy/types/dist-es/downlevel-ts3.4/transform/type-transform.js +1 -0
- package/node_modules/@smithy/types/dist-es/encode.js +1 -0
- package/node_modules/@smithy/types/dist-es/endpoint.js +5 -0
- package/node_modules/@smithy/types/dist-es/endpoints/EndpointRuleObject.js +1 -0
- package/node_modules/@smithy/types/dist-es/endpoints/ErrorRuleObject.js +1 -0
- package/node_modules/@smithy/types/dist-es/endpoints/RuleSetObject.js +1 -0
- package/node_modules/@smithy/types/dist-es/endpoints/TreeRuleObject.js +1 -0
- package/node_modules/@smithy/types/dist-es/endpoints/index.js +5 -0
- package/node_modules/@smithy/types/dist-es/endpoints/shared.js +1 -0
- package/node_modules/@smithy/types/dist-es/eventStream.js +1 -0
- package/node_modules/@smithy/types/dist-es/extensions/checksum.js +38 -0
- package/node_modules/@smithy/types/dist-es/extensions/defaultClientConfiguration.js +7 -0
- package/node_modules/@smithy/types/dist-es/extensions/defaultExtensionConfiguration.js +1 -0
- package/node_modules/@smithy/types/dist-es/extensions/index.js +3 -0
- package/node_modules/@smithy/types/dist-es/extensions/retry.js +1 -0
- package/node_modules/@smithy/types/dist-es/externals-check/browser-externals-check.js +1 -0
- package/node_modules/@smithy/types/dist-es/feature-ids.js +1 -0
- package/node_modules/@smithy/types/dist-es/http/httpHandlerInitialization.js +1 -0
- package/node_modules/@smithy/types/dist-es/http.js +5 -0
- package/node_modules/@smithy/types/dist-es/identity/apiKeyIdentity.js +1 -0
- package/node_modules/@smithy/types/dist-es/identity/awsCredentialIdentity.js +1 -0
- package/node_modules/@smithy/types/dist-es/identity/identity.js +1 -0
- package/node_modules/@smithy/types/dist-es/identity/index.js +4 -0
- package/node_modules/@smithy/types/dist-es/identity/tokenIdentity.js +1 -0
- package/node_modules/@smithy/types/dist-es/index.js +42 -0
- package/node_modules/@smithy/types/dist-es/logger.js +1 -0
- package/node_modules/@smithy/types/dist-es/middleware.js +1 -0
- package/node_modules/@smithy/types/dist-es/pagination.js +1 -0
- package/node_modules/@smithy/types/dist-es/profile.js +6 -0
- package/node_modules/@smithy/types/dist-es/response.js +1 -0
- package/node_modules/@smithy/types/dist-es/retry.js +1 -0
- package/node_modules/@smithy/types/dist-es/schema/schema-deprecated.js +1 -0
- package/node_modules/@smithy/types/dist-es/schema/schema.js +1 -0
- package/node_modules/@smithy/types/dist-es/schema/sentinels.js +1 -0
- package/node_modules/@smithy/types/dist-es/schema/static-schemas.js +1 -0
- package/node_modules/@smithy/types/dist-es/schema/traits.js +1 -0
- package/node_modules/@smithy/types/dist-es/serde.js +1 -0
- package/node_modules/@smithy/types/dist-es/shapes.js +1 -0
- package/node_modules/@smithy/types/dist-es/signature.js +1 -0
- package/node_modules/@smithy/types/dist-es/stream.js +1 -0
- package/node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-common-types.js +1 -0
- package/node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-payload-input-types.js +1 -0
- package/node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-payload-output-types.js +1 -0
- package/node_modules/@smithy/types/dist-es/transfer.js +6 -0
- package/node_modules/@smithy/types/dist-es/transform/client-method-transforms.js +1 -0
- package/node_modules/@smithy/types/dist-es/transform/client-payload-blob-type-narrow.js +1 -0
- package/node_modules/@smithy/types/dist-es/transform/exact.js +1 -0
- package/node_modules/@smithy/types/dist-es/transform/mutable.js +1 -0
- package/node_modules/@smithy/types/dist-es/transform/no-undefined.js +1 -0
- package/node_modules/@smithy/types/dist-es/transform/type-transform.js +1 -0
- package/node_modules/@smithy/types/dist-es/uri.js +1 -0
- package/node_modules/@smithy/types/dist-es/util.js +1 -0
- package/node_modules/@smithy/types/dist-es/waiter.js +1 -0
- package/node_modules/@smithy/types/dist-types/abort-handler.d.ts +7 -0
- package/node_modules/@smithy/types/dist-types/abort.d.ts +50 -0
- package/node_modules/@smithy/types/dist-types/auth/HttpApiKeyAuth.d.ts +7 -0
- package/node_modules/@smithy/types/dist-types/auth/HttpAuthScheme.d.ts +49 -0
- package/node_modules/@smithy/types/dist-types/auth/HttpAuthSchemeProvider.d.ts +20 -0
- package/node_modules/@smithy/types/dist-types/auth/HttpSigner.d.ts +41 -0
- package/node_modules/@smithy/types/dist-types/auth/IdentityProviderConfig.d.ts +14 -0
- package/node_modules/@smithy/types/dist-types/auth/auth.d.ts +57 -0
- package/node_modules/@smithy/types/dist-types/auth/index.d.ts +6 -0
- package/node_modules/@smithy/types/dist-types/blob/blob-payload-input-types.d.ts +40 -0
- package/node_modules/@smithy/types/dist-types/checksum.d.ts +63 -0
- package/node_modules/@smithy/types/dist-types/client.d.ts +57 -0
- package/node_modules/@smithy/types/dist-types/command.d.ts +28 -0
- package/node_modules/@smithy/types/dist-types/connection/config.d.ts +10 -0
- package/node_modules/@smithy/types/dist-types/connection/index.d.ts +3 -0
- package/node_modules/@smithy/types/dist-types/connection/manager.d.ts +34 -0
- package/node_modules/@smithy/types/dist-types/connection/pool.d.ts +32 -0
- package/node_modules/@smithy/types/dist-types/crypto.d.ts +60 -0
- package/node_modules/@smithy/types/dist-types/downlevel-ts3.4/transform/type-transform.d.ts +25 -0
- package/node_modules/@smithy/types/dist-types/encode.d.ts +31 -0
- package/node_modules/@smithy/types/dist-types/endpoint.d.ts +77 -0
- package/node_modules/@smithy/types/dist-types/endpoints/EndpointRuleObject.d.ts +27 -0
- package/node_modules/@smithy/types/dist-types/endpoints/ErrorRuleObject.d.ts +10 -0
- package/node_modules/@smithy/types/dist-types/endpoints/RuleSetObject.d.ts +28 -0
- package/node_modules/@smithy/types/dist-types/endpoints/TreeRuleObject.d.ts +16 -0
- package/node_modules/@smithy/types/dist-types/endpoints/index.d.ts +5 -0
- package/node_modules/@smithy/types/dist-types/endpoints/shared.d.ts +55 -0
- package/node_modules/@smithy/types/dist-types/eventStream.d.ts +137 -0
- package/node_modules/@smithy/types/dist-types/extensions/checksum.d.ts +58 -0
- package/node_modules/@smithy/types/dist-types/extensions/defaultClientConfiguration.d.ts +33 -0
- package/node_modules/@smithy/types/dist-types/extensions/defaultExtensionConfiguration.d.ts +9 -0
- package/node_modules/@smithy/types/dist-types/extensions/index.d.ts +4 -0
- package/node_modules/@smithy/types/dist-types/extensions/retry.d.ts +18 -0
- package/node_modules/@smithy/types/dist-types/externals-check/browser-externals-check.d.ts +35 -0
- package/node_modules/@smithy/types/dist-types/feature-ids.d.ts +16 -0
- package/node_modules/@smithy/types/dist-types/http/httpHandlerInitialization.d.ts +128 -0
- package/node_modules/@smithy/types/dist-types/http.d.ts +112 -0
- package/node_modules/@smithy/types/dist-types/identity/apiKeyIdentity.d.ts +14 -0
- package/node_modules/@smithy/types/dist-types/identity/awsCredentialIdentity.d.ts +31 -0
- package/node_modules/@smithy/types/dist-types/identity/identity.d.ts +15 -0
- package/node_modules/@smithy/types/dist-types/identity/index.d.ts +4 -0
- package/node_modules/@smithy/types/dist-types/identity/tokenIdentity.d.ts +14 -0
- package/node_modules/@smithy/types/dist-types/index.d.ts +42 -0
- package/node_modules/@smithy/types/dist-types/logger.d.ts +13 -0
- package/node_modules/@smithy/types/dist-types/middleware.d.ts +534 -0
- package/node_modules/@smithy/types/dist-types/pagination.d.ts +33 -0
- package/node_modules/@smithy/types/dist-types/profile.d.ts +30 -0
- package/node_modules/@smithy/types/dist-types/response.d.ts +40 -0
- package/node_modules/@smithy/types/dist-types/retry.d.ts +133 -0
- package/node_modules/@smithy/types/dist-types/schema/schema-deprecated.d.ts +136 -0
- package/node_modules/@smithy/types/dist-types/schema/schema.d.ts +230 -0
- package/node_modules/@smithy/types/dist-types/schema/sentinels.d.ts +65 -0
- package/node_modules/@smithy/types/dist-types/schema/static-schemas.d.ts +82 -0
- package/node_modules/@smithy/types/dist-types/schema/traits.d.ts +46 -0
- package/node_modules/@smithy/types/dist-types/serde.d.ts +114 -0
- package/node_modules/@smithy/types/dist-types/shapes.d.ts +82 -0
- package/node_modules/@smithy/types/dist-types/signature.d.ts +155 -0
- package/node_modules/@smithy/types/dist-types/stream.d.ts +22 -0
- package/node_modules/@smithy/types/dist-types/streaming-payload/streaming-blob-common-types.d.ts +32 -0
- package/node_modules/@smithy/types/dist-types/streaming-payload/streaming-blob-payload-input-types.d.ts +60 -0
- package/node_modules/@smithy/types/dist-types/streaming-payload/streaming-blob-payload-output-types.d.ts +51 -0
- package/node_modules/@smithy/types/dist-types/transfer.d.ts +41 -0
- package/node_modules/@smithy/types/dist-types/transform/client-method-transforms.d.ts +26 -0
- package/node_modules/@smithy/types/dist-types/transform/client-payload-blob-type-narrow.d.ts +77 -0
- package/node_modules/@smithy/types/dist-types/transform/exact.d.ts +6 -0
- package/node_modules/@smithy/types/dist-types/transform/mutable.d.ts +6 -0
- package/node_modules/@smithy/types/dist-types/transform/no-undefined.d.ts +68 -0
- package/node_modules/@smithy/types/dist-types/transform/type-transform.d.ts +34 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/abort-handler.d.ts +7 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/abort.d.ts +50 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/auth/HttpApiKeyAuth.d.ts +7 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/auth/HttpAuthScheme.d.ts +49 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/auth/HttpAuthSchemeProvider.d.ts +20 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/auth/HttpSigner.d.ts +41 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/auth/IdentityProviderConfig.d.ts +14 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/auth/auth.d.ts +57 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/auth/index.d.ts +6 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/blob/blob-payload-input-types.d.ts +40 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/checksum.d.ts +63 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/client.d.ts +57 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/command.d.ts +28 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/connection/config.d.ts +10 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/connection/index.d.ts +3 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/connection/manager.d.ts +34 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/connection/pool.d.ts +32 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/crypto.d.ts +60 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/downlevel-ts3.4/transform/type-transform.d.ts +41 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/encode.d.ts +31 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/endpoint.d.ts +77 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/endpoints/EndpointRuleObject.d.ts +27 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/endpoints/ErrorRuleObject.d.ts +10 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/endpoints/RuleSetObject.d.ts +28 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/endpoints/TreeRuleObject.d.ts +16 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/endpoints/index.d.ts +5 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/endpoints/shared.d.ts +55 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/eventStream.d.ts +137 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/extensions/checksum.d.ts +58 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/extensions/defaultClientConfiguration.d.ts +33 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/extensions/defaultExtensionConfiguration.d.ts +9 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/extensions/index.d.ts +4 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/extensions/retry.d.ts +18 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/externals-check/browser-externals-check.d.ts +35 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/feature-ids.d.ts +16 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/http/httpHandlerInitialization.d.ts +128 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/http.d.ts +112 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/identity/apiKeyIdentity.d.ts +14 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/identity/awsCredentialIdentity.d.ts +31 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/identity/identity.d.ts +15 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/identity/index.d.ts +4 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/identity/tokenIdentity.d.ts +14 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/index.d.ts +42 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/logger.d.ts +13 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/middleware.d.ts +534 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/pagination.d.ts +33 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/profile.d.ts +30 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/response.d.ts +40 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/retry.d.ts +133 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/schema/schema-deprecated.d.ts +142 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/schema/schema.d.ts +245 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/schema/sentinels.d.ts +65 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/schema/static-schemas.d.ts +101 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/schema/traits.d.ts +46 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/serde.d.ts +114 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/shapes.d.ts +82 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/signature.d.ts +155 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/stream.d.ts +22 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/streaming-payload/streaming-blob-common-types.d.ts +32 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/streaming-payload/streaming-blob-payload-input-types.d.ts +60 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/streaming-payload/streaming-blob-payload-output-types.d.ts +51 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/transfer.d.ts +41 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/transform/client-method-transforms.d.ts +26 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/transform/client-payload-blob-type-narrow.d.ts +81 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/transform/exact.d.ts +14 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/transform/mutable.d.ts +6 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/transform/no-undefined.d.ts +88 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/transform/type-transform.d.ts +41 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/uri.d.ts +17 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/util.d.ts +192 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/waiter.d.ts +35 -0
- package/node_modules/@smithy/types/dist-types/uri.d.ts +17 -0
- package/node_modules/@smithy/types/dist-types/util.d.ts +176 -0
- package/node_modules/@smithy/types/dist-types/waiter.d.ts +35 -0
- package/node_modules/@smithy/types/package.json +61 -0
- package/node_modules/marked/LICENSE.md +44 -0
- package/node_modules/marked/README.md +106 -0
- package/node_modules/marked/bin/main.js +282 -0
- package/node_modules/marked/bin/marked.js +15 -0
- package/node_modules/marked/lib/marked.cjs +2211 -0
- package/node_modules/marked/lib/marked.cjs.map +7 -0
- package/node_modules/marked/lib/marked.d.cts +728 -0
- package/node_modules/marked/lib/marked.d.ts +728 -0
- package/node_modules/marked/lib/marked.esm.js +2189 -0
- package/node_modules/marked/lib/marked.esm.js.map +7 -0
- package/node_modules/marked/lib/marked.umd.js +2213 -0
- package/node_modules/marked/lib/marked.umd.js.map +7 -0
- package/node_modules/marked/man/marked.1 +111 -0
- package/node_modules/marked/man/marked.1.md +92 -0
- package/node_modules/marked/marked.min.js +69 -0
- package/node_modules/marked/package.json +111 -0
- package/npm-shrinkwrap.json +1841 -0
- package/package.json +49 -31
|
@@ -0,0 +1,1173 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Keyboard input handling for terminal applications.
|
|
3
|
+
*
|
|
4
|
+
* Supports both legacy terminal sequences and Kitty keyboard protocol.
|
|
5
|
+
* See: https://sw.kovidgoyal.net/kitty/keyboard-protocol/
|
|
6
|
+
* Reference: https://github.com/sst/opentui/blob/7da92b4088aebfe27b9f691c04163a48821e49fd/packages/core/src/lib/parse.keypress.ts
|
|
7
|
+
*
|
|
8
|
+
* Symbol keys are also supported, however some ctrl+symbol combos
|
|
9
|
+
* overlap with ASCII codes, e.g. ctrl+[ = ESC.
|
|
10
|
+
* See: https://sw.kovidgoyal.net/kitty/keyboard-protocol/#legacy-ctrl-mapping-of-ascii-keys
|
|
11
|
+
* Those can still be * used for ctrl+shift combos
|
|
12
|
+
*
|
|
13
|
+
* API:
|
|
14
|
+
* - matchesKey(data, keyId) - Check if input matches a key identifier
|
|
15
|
+
* - parseKey(data) - Parse input and return the key identifier
|
|
16
|
+
* - Key - Helper object for creating typed key identifiers
|
|
17
|
+
* - setKittyProtocolActive(active) - Set global Kitty protocol state
|
|
18
|
+
* - isKittyProtocolActive() - Query global Kitty protocol state
|
|
19
|
+
*/
|
|
20
|
+
// =============================================================================
|
|
21
|
+
// Global Kitty Protocol State
|
|
22
|
+
// =============================================================================
|
|
23
|
+
let _kittyProtocolActive = false;
|
|
24
|
+
/**
|
|
25
|
+
* Set the global Kitty keyboard protocol state.
|
|
26
|
+
* Called by ProcessTerminal after detecting protocol support.
|
|
27
|
+
*/
|
|
28
|
+
export function setKittyProtocolActive(active) {
|
|
29
|
+
_kittyProtocolActive = active;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Query whether Kitty keyboard protocol is currently active.
|
|
33
|
+
*/
|
|
34
|
+
export function isKittyProtocolActive() {
|
|
35
|
+
return _kittyProtocolActive;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Helper object for creating typed key identifiers with autocomplete.
|
|
39
|
+
*
|
|
40
|
+
* Usage:
|
|
41
|
+
* - Key.escape, Key.enter, Key.tab, etc. for special keys
|
|
42
|
+
* - Key.backtick, Key.comma, Key.period, etc. for symbol keys
|
|
43
|
+
* - Key.ctrl("c"), Key.alt("x"), Key.super("k") for single modifiers
|
|
44
|
+
* - Key.ctrlShift("p"), Key.ctrlAlt("x"), Key.ctrlSuper("k") for combined modifiers
|
|
45
|
+
*/
|
|
46
|
+
export const Key = {
|
|
47
|
+
// Special keys
|
|
48
|
+
escape: "escape",
|
|
49
|
+
esc: "esc",
|
|
50
|
+
enter: "enter",
|
|
51
|
+
return: "return",
|
|
52
|
+
tab: "tab",
|
|
53
|
+
space: "space",
|
|
54
|
+
backspace: "backspace",
|
|
55
|
+
delete: "delete",
|
|
56
|
+
insert: "insert",
|
|
57
|
+
clear: "clear",
|
|
58
|
+
home: "home",
|
|
59
|
+
end: "end",
|
|
60
|
+
pageUp: "pageUp",
|
|
61
|
+
pageDown: "pageDown",
|
|
62
|
+
up: "up",
|
|
63
|
+
down: "down",
|
|
64
|
+
left: "left",
|
|
65
|
+
right: "right",
|
|
66
|
+
f1: "f1",
|
|
67
|
+
f2: "f2",
|
|
68
|
+
f3: "f3",
|
|
69
|
+
f4: "f4",
|
|
70
|
+
f5: "f5",
|
|
71
|
+
f6: "f6",
|
|
72
|
+
f7: "f7",
|
|
73
|
+
f8: "f8",
|
|
74
|
+
f9: "f9",
|
|
75
|
+
f10: "f10",
|
|
76
|
+
f11: "f11",
|
|
77
|
+
f12: "f12",
|
|
78
|
+
// Symbol keys
|
|
79
|
+
backtick: "`",
|
|
80
|
+
hyphen: "-",
|
|
81
|
+
equals: "=",
|
|
82
|
+
leftbracket: "[",
|
|
83
|
+
rightbracket: "]",
|
|
84
|
+
backslash: "\\",
|
|
85
|
+
semicolon: ";",
|
|
86
|
+
quote: "'",
|
|
87
|
+
comma: ",",
|
|
88
|
+
period: ".",
|
|
89
|
+
slash: "/",
|
|
90
|
+
exclamation: "!",
|
|
91
|
+
at: "@",
|
|
92
|
+
hash: "#",
|
|
93
|
+
dollar: "$",
|
|
94
|
+
percent: "%",
|
|
95
|
+
caret: "^",
|
|
96
|
+
ampersand: "&",
|
|
97
|
+
asterisk: "*",
|
|
98
|
+
leftparen: "(",
|
|
99
|
+
rightparen: ")",
|
|
100
|
+
underscore: "_",
|
|
101
|
+
plus: "+",
|
|
102
|
+
pipe: "|",
|
|
103
|
+
tilde: "~",
|
|
104
|
+
leftbrace: "{",
|
|
105
|
+
rightbrace: "}",
|
|
106
|
+
colon: ":",
|
|
107
|
+
lessthan: "<",
|
|
108
|
+
greaterthan: ">",
|
|
109
|
+
question: "?",
|
|
110
|
+
// Single modifiers
|
|
111
|
+
ctrl: (key) => `ctrl+${key}`,
|
|
112
|
+
shift: (key) => `shift+${key}`,
|
|
113
|
+
alt: (key) => `alt+${key}`,
|
|
114
|
+
super: (key) => `super+${key}`,
|
|
115
|
+
// Combined modifiers
|
|
116
|
+
ctrlShift: (key) => `ctrl+shift+${key}`,
|
|
117
|
+
shiftCtrl: (key) => `shift+ctrl+${key}`,
|
|
118
|
+
ctrlAlt: (key) => `ctrl+alt+${key}`,
|
|
119
|
+
altCtrl: (key) => `alt+ctrl+${key}`,
|
|
120
|
+
shiftAlt: (key) => `shift+alt+${key}`,
|
|
121
|
+
altShift: (key) => `alt+shift+${key}`,
|
|
122
|
+
ctrlSuper: (key) => `ctrl+super+${key}`,
|
|
123
|
+
superCtrl: (key) => `super+ctrl+${key}`,
|
|
124
|
+
shiftSuper: (key) => `shift+super+${key}`,
|
|
125
|
+
superShift: (key) => `super+shift+${key}`,
|
|
126
|
+
altSuper: (key) => `alt+super+${key}`,
|
|
127
|
+
superAlt: (key) => `super+alt+${key}`,
|
|
128
|
+
// Triple modifiers
|
|
129
|
+
ctrlShiftAlt: (key) => `ctrl+shift+alt+${key}`,
|
|
130
|
+
ctrlShiftSuper: (key) => `ctrl+shift+super+${key}`,
|
|
131
|
+
};
|
|
132
|
+
// =============================================================================
|
|
133
|
+
// Constants
|
|
134
|
+
// =============================================================================
|
|
135
|
+
const SYMBOL_KEYS = new Set([
|
|
136
|
+
"`",
|
|
137
|
+
"-",
|
|
138
|
+
"=",
|
|
139
|
+
"[",
|
|
140
|
+
"]",
|
|
141
|
+
"\\",
|
|
142
|
+
";",
|
|
143
|
+
"'",
|
|
144
|
+
",",
|
|
145
|
+
".",
|
|
146
|
+
"/",
|
|
147
|
+
"!",
|
|
148
|
+
"@",
|
|
149
|
+
"#",
|
|
150
|
+
"$",
|
|
151
|
+
"%",
|
|
152
|
+
"^",
|
|
153
|
+
"&",
|
|
154
|
+
"*",
|
|
155
|
+
"(",
|
|
156
|
+
")",
|
|
157
|
+
"_",
|
|
158
|
+
"+",
|
|
159
|
+
"|",
|
|
160
|
+
"~",
|
|
161
|
+
"{",
|
|
162
|
+
"}",
|
|
163
|
+
":",
|
|
164
|
+
"<",
|
|
165
|
+
">",
|
|
166
|
+
"?",
|
|
167
|
+
]);
|
|
168
|
+
const MODIFIERS = {
|
|
169
|
+
shift: 1,
|
|
170
|
+
alt: 2,
|
|
171
|
+
ctrl: 4,
|
|
172
|
+
super: 8,
|
|
173
|
+
};
|
|
174
|
+
const LOCK_MASK = 64 + 128; // Caps Lock + Num Lock
|
|
175
|
+
const CODEPOINTS = {
|
|
176
|
+
escape: 27,
|
|
177
|
+
tab: 9,
|
|
178
|
+
enter: 13,
|
|
179
|
+
space: 32,
|
|
180
|
+
backspace: 127,
|
|
181
|
+
kpEnter: 57414, // Numpad Enter (Kitty protocol)
|
|
182
|
+
};
|
|
183
|
+
const ARROW_CODEPOINTS = {
|
|
184
|
+
up: -1,
|
|
185
|
+
down: -2,
|
|
186
|
+
right: -3,
|
|
187
|
+
left: -4,
|
|
188
|
+
};
|
|
189
|
+
const FUNCTIONAL_CODEPOINTS = {
|
|
190
|
+
delete: -10,
|
|
191
|
+
insert: -11,
|
|
192
|
+
pageUp: -12,
|
|
193
|
+
pageDown: -13,
|
|
194
|
+
home: -14,
|
|
195
|
+
end: -15,
|
|
196
|
+
};
|
|
197
|
+
const KITTY_FUNCTIONAL_KEY_EQUIVALENTS = new Map([
|
|
198
|
+
[57399, 48], // KP_0 -> 0
|
|
199
|
+
[57400, 49], // KP_1 -> 1
|
|
200
|
+
[57401, 50], // KP_2 -> 2
|
|
201
|
+
[57402, 51], // KP_3 -> 3
|
|
202
|
+
[57403, 52], // KP_4 -> 4
|
|
203
|
+
[57404, 53], // KP_5 -> 5
|
|
204
|
+
[57405, 54], // KP_6 -> 6
|
|
205
|
+
[57406, 55], // KP_7 -> 7
|
|
206
|
+
[57407, 56], // KP_8 -> 8
|
|
207
|
+
[57408, 57], // KP_9 -> 9
|
|
208
|
+
[57409, 46], // KP_DECIMAL -> .
|
|
209
|
+
[57410, 47], // KP_DIVIDE -> /
|
|
210
|
+
[57411, 42], // KP_MULTIPLY -> *
|
|
211
|
+
[57412, 45], // KP_SUBTRACT -> -
|
|
212
|
+
[57413, 43], // KP_ADD -> +
|
|
213
|
+
[57415, 61], // KP_EQUAL -> =
|
|
214
|
+
[57416, 44], // KP_SEPARATOR -> ,
|
|
215
|
+
[57417, ARROW_CODEPOINTS.left],
|
|
216
|
+
[57418, ARROW_CODEPOINTS.right],
|
|
217
|
+
[57419, ARROW_CODEPOINTS.up],
|
|
218
|
+
[57420, ARROW_CODEPOINTS.down],
|
|
219
|
+
[57421, FUNCTIONAL_CODEPOINTS.pageUp],
|
|
220
|
+
[57422, FUNCTIONAL_CODEPOINTS.pageDown],
|
|
221
|
+
[57423, FUNCTIONAL_CODEPOINTS.home],
|
|
222
|
+
[57424, FUNCTIONAL_CODEPOINTS.end],
|
|
223
|
+
[57425, FUNCTIONAL_CODEPOINTS.insert],
|
|
224
|
+
[57426, FUNCTIONAL_CODEPOINTS.delete],
|
|
225
|
+
]);
|
|
226
|
+
function normalizeKittyFunctionalCodepoint(codepoint) {
|
|
227
|
+
return KITTY_FUNCTIONAL_KEY_EQUIVALENTS.get(codepoint) ?? codepoint;
|
|
228
|
+
}
|
|
229
|
+
function normalizeShiftedLetterIdentityCodepoint(codepoint, modifier) {
|
|
230
|
+
const effectiveModifier = modifier & ~LOCK_MASK;
|
|
231
|
+
if ((effectiveModifier & MODIFIERS.shift) !== 0 && codepoint >= 65 && codepoint <= 90) {
|
|
232
|
+
return codepoint + 32;
|
|
233
|
+
}
|
|
234
|
+
return codepoint;
|
|
235
|
+
}
|
|
236
|
+
const LEGACY_KEY_SEQUENCES = {
|
|
237
|
+
up: ["\x1b[A", "\x1bOA"],
|
|
238
|
+
down: ["\x1b[B", "\x1bOB"],
|
|
239
|
+
right: ["\x1b[C", "\x1bOC"],
|
|
240
|
+
left: ["\x1b[D", "\x1bOD"],
|
|
241
|
+
home: ["\x1b[H", "\x1bOH", "\x1b[1~", "\x1b[7~"],
|
|
242
|
+
end: ["\x1b[F", "\x1bOF", "\x1b[4~", "\x1b[8~"],
|
|
243
|
+
insert: ["\x1b[2~"],
|
|
244
|
+
delete: ["\x1b[3~"],
|
|
245
|
+
pageUp: ["\x1b[5~", "\x1b[[5~"],
|
|
246
|
+
pageDown: ["\x1b[6~", "\x1b[[6~"],
|
|
247
|
+
clear: ["\x1b[E", "\x1bOE"],
|
|
248
|
+
f1: ["\x1bOP", "\x1b[11~", "\x1b[[A"],
|
|
249
|
+
f2: ["\x1bOQ", "\x1b[12~", "\x1b[[B"],
|
|
250
|
+
f3: ["\x1bOR", "\x1b[13~", "\x1b[[C"],
|
|
251
|
+
f4: ["\x1bOS", "\x1b[14~", "\x1b[[D"],
|
|
252
|
+
f5: ["\x1b[15~", "\x1b[[E"],
|
|
253
|
+
f6: ["\x1b[17~"],
|
|
254
|
+
f7: ["\x1b[18~"],
|
|
255
|
+
f8: ["\x1b[19~"],
|
|
256
|
+
f9: ["\x1b[20~"],
|
|
257
|
+
f10: ["\x1b[21~"],
|
|
258
|
+
f11: ["\x1b[23~"],
|
|
259
|
+
f12: ["\x1b[24~"],
|
|
260
|
+
};
|
|
261
|
+
const LEGACY_SHIFT_SEQUENCES = {
|
|
262
|
+
up: ["\x1b[a"],
|
|
263
|
+
down: ["\x1b[b"],
|
|
264
|
+
right: ["\x1b[c"],
|
|
265
|
+
left: ["\x1b[d"],
|
|
266
|
+
clear: ["\x1b[e"],
|
|
267
|
+
insert: ["\x1b[2$"],
|
|
268
|
+
delete: ["\x1b[3$"],
|
|
269
|
+
pageUp: ["\x1b[5$"],
|
|
270
|
+
pageDown: ["\x1b[6$"],
|
|
271
|
+
home: ["\x1b[7$"],
|
|
272
|
+
end: ["\x1b[8$"],
|
|
273
|
+
};
|
|
274
|
+
const LEGACY_CTRL_SEQUENCES = {
|
|
275
|
+
up: ["\x1bOa"],
|
|
276
|
+
down: ["\x1bOb"],
|
|
277
|
+
right: ["\x1bOc"],
|
|
278
|
+
left: ["\x1bOd"],
|
|
279
|
+
clear: ["\x1bOe"],
|
|
280
|
+
insert: ["\x1b[2^"],
|
|
281
|
+
delete: ["\x1b[3^"],
|
|
282
|
+
pageUp: ["\x1b[5^"],
|
|
283
|
+
pageDown: ["\x1b[6^"],
|
|
284
|
+
home: ["\x1b[7^"],
|
|
285
|
+
end: ["\x1b[8^"],
|
|
286
|
+
};
|
|
287
|
+
const LEGACY_SEQUENCE_KEY_IDS = {
|
|
288
|
+
"\x1bOA": "up",
|
|
289
|
+
"\x1bOB": "down",
|
|
290
|
+
"\x1bOC": "right",
|
|
291
|
+
"\x1bOD": "left",
|
|
292
|
+
"\x1bOH": "home",
|
|
293
|
+
"\x1bOF": "end",
|
|
294
|
+
"\x1b[E": "clear",
|
|
295
|
+
"\x1bOE": "clear",
|
|
296
|
+
"\x1bOe": "ctrl+clear",
|
|
297
|
+
"\x1b[e": "shift+clear",
|
|
298
|
+
"\x1b[2~": "insert",
|
|
299
|
+
"\x1b[2$": "shift+insert",
|
|
300
|
+
"\x1b[2^": "ctrl+insert",
|
|
301
|
+
"\x1b[3$": "shift+delete",
|
|
302
|
+
"\x1b[3^": "ctrl+delete",
|
|
303
|
+
"\x1b[[5~": "pageUp",
|
|
304
|
+
"\x1b[[6~": "pageDown",
|
|
305
|
+
"\x1b[a": "shift+up",
|
|
306
|
+
"\x1b[b": "shift+down",
|
|
307
|
+
"\x1b[c": "shift+right",
|
|
308
|
+
"\x1b[d": "shift+left",
|
|
309
|
+
"\x1bOa": "ctrl+up",
|
|
310
|
+
"\x1bOb": "ctrl+down",
|
|
311
|
+
"\x1bOc": "ctrl+right",
|
|
312
|
+
"\x1bOd": "ctrl+left",
|
|
313
|
+
"\x1b[5$": "shift+pageUp",
|
|
314
|
+
"\x1b[6$": "shift+pageDown",
|
|
315
|
+
"\x1b[7$": "shift+home",
|
|
316
|
+
"\x1b[8$": "shift+end",
|
|
317
|
+
"\x1b[5^": "ctrl+pageUp",
|
|
318
|
+
"\x1b[6^": "ctrl+pageDown",
|
|
319
|
+
"\x1b[7^": "ctrl+home",
|
|
320
|
+
"\x1b[8^": "ctrl+end",
|
|
321
|
+
"\x1bOP": "f1",
|
|
322
|
+
"\x1bOQ": "f2",
|
|
323
|
+
"\x1bOR": "f3",
|
|
324
|
+
"\x1bOS": "f4",
|
|
325
|
+
"\x1b[11~": "f1",
|
|
326
|
+
"\x1b[12~": "f2",
|
|
327
|
+
"\x1b[13~": "f3",
|
|
328
|
+
"\x1b[14~": "f4",
|
|
329
|
+
"\x1b[[A": "f1",
|
|
330
|
+
"\x1b[[B": "f2",
|
|
331
|
+
"\x1b[[C": "f3",
|
|
332
|
+
"\x1b[[D": "f4",
|
|
333
|
+
"\x1b[[E": "f5",
|
|
334
|
+
"\x1b[15~": "f5",
|
|
335
|
+
"\x1b[17~": "f6",
|
|
336
|
+
"\x1b[18~": "f7",
|
|
337
|
+
"\x1b[19~": "f8",
|
|
338
|
+
"\x1b[20~": "f9",
|
|
339
|
+
"\x1b[21~": "f10",
|
|
340
|
+
"\x1b[23~": "f11",
|
|
341
|
+
"\x1b[24~": "f12",
|
|
342
|
+
"\x1bb": "alt+left",
|
|
343
|
+
"\x1bf": "alt+right",
|
|
344
|
+
"\x1bp": "alt+up",
|
|
345
|
+
"\x1bn": "alt+down",
|
|
346
|
+
};
|
|
347
|
+
const matchesLegacySequence = (data, sequences) => sequences.includes(data);
|
|
348
|
+
const matchesLegacyModifierSequence = (data, key, modifier) => {
|
|
349
|
+
if (modifier === MODIFIERS.shift) {
|
|
350
|
+
return matchesLegacySequence(data, LEGACY_SHIFT_SEQUENCES[key]);
|
|
351
|
+
}
|
|
352
|
+
if (modifier === MODIFIERS.ctrl) {
|
|
353
|
+
return matchesLegacySequence(data, LEGACY_CTRL_SEQUENCES[key]);
|
|
354
|
+
}
|
|
355
|
+
return false;
|
|
356
|
+
};
|
|
357
|
+
// Store the last parsed event type for isKeyRelease() to query
|
|
358
|
+
let _lastEventType = "press";
|
|
359
|
+
/**
|
|
360
|
+
* Check if the last parsed key event was a key release.
|
|
361
|
+
* Only meaningful when Kitty keyboard protocol with flag 2 is active.
|
|
362
|
+
*/
|
|
363
|
+
export function isKeyRelease(data) {
|
|
364
|
+
// Don't treat bracketed paste content as key release, even if it contains
|
|
365
|
+
// patterns like ":3F" (e.g., bluetooth MAC addresses like "90:62:3F:A5").
|
|
366
|
+
// Terminal.ts re-wraps paste content with bracketed paste markers before
|
|
367
|
+
// passing to TUI, so pasted data will always contain \x1b[200~.
|
|
368
|
+
if (data.includes("\x1b[200~")) {
|
|
369
|
+
return false;
|
|
370
|
+
}
|
|
371
|
+
// Quick check: release events with flag 2 contain ":3"
|
|
372
|
+
// Format: \x1b[<codepoint>;<modifier>:3u
|
|
373
|
+
if (data.includes(":3u") ||
|
|
374
|
+
data.includes(":3~") ||
|
|
375
|
+
data.includes(":3A") ||
|
|
376
|
+
data.includes(":3B") ||
|
|
377
|
+
data.includes(":3C") ||
|
|
378
|
+
data.includes(":3D") ||
|
|
379
|
+
data.includes(":3H") ||
|
|
380
|
+
data.includes(":3F")) {
|
|
381
|
+
return true;
|
|
382
|
+
}
|
|
383
|
+
return false;
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* Check if the last parsed key event was a key repeat.
|
|
387
|
+
* Only meaningful when Kitty keyboard protocol with flag 2 is active.
|
|
388
|
+
*/
|
|
389
|
+
export function isKeyRepeat(data) {
|
|
390
|
+
// Don't treat bracketed paste content as key repeat, even if it contains
|
|
391
|
+
// patterns like ":2F". See isKeyRelease() for details.
|
|
392
|
+
if (data.includes("\x1b[200~")) {
|
|
393
|
+
return false;
|
|
394
|
+
}
|
|
395
|
+
if (data.includes(":2u") ||
|
|
396
|
+
data.includes(":2~") ||
|
|
397
|
+
data.includes(":2A") ||
|
|
398
|
+
data.includes(":2B") ||
|
|
399
|
+
data.includes(":2C") ||
|
|
400
|
+
data.includes(":2D") ||
|
|
401
|
+
data.includes(":2H") ||
|
|
402
|
+
data.includes(":2F")) {
|
|
403
|
+
return true;
|
|
404
|
+
}
|
|
405
|
+
return false;
|
|
406
|
+
}
|
|
407
|
+
function parseEventType(eventTypeStr) {
|
|
408
|
+
if (!eventTypeStr)
|
|
409
|
+
return "press";
|
|
410
|
+
const eventType = parseInt(eventTypeStr, 10);
|
|
411
|
+
if (eventType === 2)
|
|
412
|
+
return "repeat";
|
|
413
|
+
if (eventType === 3)
|
|
414
|
+
return "release";
|
|
415
|
+
return "press";
|
|
416
|
+
}
|
|
417
|
+
function parseKittySequence(data) {
|
|
418
|
+
// CSI u format with alternate keys (flag 4):
|
|
419
|
+
// \x1b[<codepoint>u
|
|
420
|
+
// \x1b[<codepoint>;<mod>u
|
|
421
|
+
// \x1b[<codepoint>;<mod>:<event>u
|
|
422
|
+
// \x1b[<codepoint>:<shifted>;<mod>u
|
|
423
|
+
// \x1b[<codepoint>:<shifted>:<base>;<mod>u
|
|
424
|
+
// \x1b[<codepoint>::<base>;<mod>u (no shifted key, only base)
|
|
425
|
+
//
|
|
426
|
+
// With flag 2, event type is appended after modifier colon: 1=press, 2=repeat, 3=release
|
|
427
|
+
// With flag 4, alternate keys are appended after codepoint with colons
|
|
428
|
+
const csiUMatch = data.match(/^\x1b\[(\d+)(?::(\d*))?(?::(\d+))?(?:;(\d+))?(?::(\d+))?u$/);
|
|
429
|
+
if (csiUMatch) {
|
|
430
|
+
const codepoint = parseInt(csiUMatch[1], 10);
|
|
431
|
+
const shiftedKey = csiUMatch[2] && csiUMatch[2].length > 0 ? parseInt(csiUMatch[2], 10) : undefined;
|
|
432
|
+
const baseLayoutKey = csiUMatch[3] ? parseInt(csiUMatch[3], 10) : undefined;
|
|
433
|
+
const modValue = csiUMatch[4] ? parseInt(csiUMatch[4], 10) : 1;
|
|
434
|
+
const eventType = parseEventType(csiUMatch[5]);
|
|
435
|
+
_lastEventType = eventType;
|
|
436
|
+
return { codepoint, shiftedKey, baseLayoutKey, modifier: modValue - 1, eventType };
|
|
437
|
+
}
|
|
438
|
+
// Arrow keys with modifier: \x1b[1;<mod>A/B/C/D or \x1b[1;<mod>:<event>A/B/C/D
|
|
439
|
+
const arrowMatch = data.match(/^\x1b\[1;(\d+)(?::(\d+))?([ABCD])$/);
|
|
440
|
+
if (arrowMatch) {
|
|
441
|
+
const modValue = parseInt(arrowMatch[1], 10);
|
|
442
|
+
const eventType = parseEventType(arrowMatch[2]);
|
|
443
|
+
const arrowCodes = { A: -1, B: -2, C: -3, D: -4 };
|
|
444
|
+
_lastEventType = eventType;
|
|
445
|
+
return { codepoint: arrowCodes[arrowMatch[3]], modifier: modValue - 1, eventType };
|
|
446
|
+
}
|
|
447
|
+
// Functional keys: \x1b[<num>~ or \x1b[<num>;<mod>~ or \x1b[<num>;<mod>:<event>~
|
|
448
|
+
const funcMatch = data.match(/^\x1b\[(\d+)(?:;(\d+))?(?::(\d+))?~$/);
|
|
449
|
+
if (funcMatch) {
|
|
450
|
+
const keyNum = parseInt(funcMatch[1], 10);
|
|
451
|
+
const modValue = funcMatch[2] ? parseInt(funcMatch[2], 10) : 1;
|
|
452
|
+
const eventType = parseEventType(funcMatch[3]);
|
|
453
|
+
const funcCodes = {
|
|
454
|
+
2: FUNCTIONAL_CODEPOINTS.insert,
|
|
455
|
+
3: FUNCTIONAL_CODEPOINTS.delete,
|
|
456
|
+
5: FUNCTIONAL_CODEPOINTS.pageUp,
|
|
457
|
+
6: FUNCTIONAL_CODEPOINTS.pageDown,
|
|
458
|
+
7: FUNCTIONAL_CODEPOINTS.home,
|
|
459
|
+
8: FUNCTIONAL_CODEPOINTS.end,
|
|
460
|
+
};
|
|
461
|
+
const codepoint = funcCodes[keyNum];
|
|
462
|
+
if (codepoint !== undefined) {
|
|
463
|
+
_lastEventType = eventType;
|
|
464
|
+
return { codepoint, modifier: modValue - 1, eventType };
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
// Home/End with modifier: \x1b[1;<mod>H/F or \x1b[1;<mod>:<event>H/F
|
|
468
|
+
const homeEndMatch = data.match(/^\x1b\[1;(\d+)(?::(\d+))?([HF])$/);
|
|
469
|
+
if (homeEndMatch) {
|
|
470
|
+
const modValue = parseInt(homeEndMatch[1], 10);
|
|
471
|
+
const eventType = parseEventType(homeEndMatch[2]);
|
|
472
|
+
const codepoint = homeEndMatch[3] === "H" ? FUNCTIONAL_CODEPOINTS.home : FUNCTIONAL_CODEPOINTS.end;
|
|
473
|
+
_lastEventType = eventType;
|
|
474
|
+
return { codepoint, modifier: modValue - 1, eventType };
|
|
475
|
+
}
|
|
476
|
+
return null;
|
|
477
|
+
}
|
|
478
|
+
function matchesKittySequence(data, expectedCodepoint, expectedModifier) {
|
|
479
|
+
const parsed = parseKittySequence(data);
|
|
480
|
+
if (!parsed)
|
|
481
|
+
return false;
|
|
482
|
+
const actualMod = parsed.modifier & ~LOCK_MASK;
|
|
483
|
+
const expectedMod = expectedModifier & ~LOCK_MASK;
|
|
484
|
+
// Check if modifiers match
|
|
485
|
+
if (actualMod !== expectedMod)
|
|
486
|
+
return false;
|
|
487
|
+
const normalizedCodepoint = normalizeShiftedLetterIdentityCodepoint(normalizeKittyFunctionalCodepoint(parsed.codepoint), parsed.modifier);
|
|
488
|
+
const normalizedExpectedCodepoint = normalizeShiftedLetterIdentityCodepoint(normalizeKittyFunctionalCodepoint(expectedCodepoint), expectedModifier);
|
|
489
|
+
// Primary match: codepoint matches directly after normalizing functional keys
|
|
490
|
+
if (normalizedCodepoint === normalizedExpectedCodepoint)
|
|
491
|
+
return true;
|
|
492
|
+
// Alternate match: use base layout key for non-Latin keyboard layouts.
|
|
493
|
+
// This allows Ctrl+С (Cyrillic) to match Ctrl+c (Latin) when terminal reports
|
|
494
|
+
// the base layout key (the key in standard PC-101 layout).
|
|
495
|
+
//
|
|
496
|
+
// Only fall back to base layout key when the codepoint is NOT already a
|
|
497
|
+
// recognized Latin letter (a-z) or symbol (e.g., /, -, [, ;, etc.).
|
|
498
|
+
// When the codepoint is a recognized key, it is authoritative regardless
|
|
499
|
+
// of physical key position. This prevents remapped layouts (Dvorak, Colemak,
|
|
500
|
+
// xremap, etc.) from causing false matches: both letters and symbols move
|
|
501
|
+
// to different physical positions, so Ctrl+K could falsely match Ctrl+V
|
|
502
|
+
// (letter remapping) and Ctrl+/ could falsely match Ctrl+[ (symbol remapping)
|
|
503
|
+
// if the base layout key were always considered.
|
|
504
|
+
if (parsed.baseLayoutKey !== undefined && parsed.baseLayoutKey === expectedCodepoint) {
|
|
505
|
+
const cp = normalizedCodepoint;
|
|
506
|
+
const isLatinLetter = cp >= 97 && cp <= 122; // a-z
|
|
507
|
+
const isKnownSymbol = SYMBOL_KEYS.has(String.fromCharCode(cp));
|
|
508
|
+
if (!isLatinLetter && !isKnownSymbol)
|
|
509
|
+
return true;
|
|
510
|
+
}
|
|
511
|
+
return false;
|
|
512
|
+
}
|
|
513
|
+
function parseModifyOtherKeysSequence(data) {
|
|
514
|
+
const match = data.match(/^\x1b\[27;(\d+);(\d+)~$/);
|
|
515
|
+
if (!match)
|
|
516
|
+
return null;
|
|
517
|
+
const modValue = parseInt(match[1], 10);
|
|
518
|
+
const codepoint = parseInt(match[2], 10);
|
|
519
|
+
return { codepoint, modifier: modValue - 1 };
|
|
520
|
+
}
|
|
521
|
+
/**
|
|
522
|
+
* Match xterm modifyOtherKeys format: CSI 27 ; modifiers ; keycode ~
|
|
523
|
+
* This is used by terminals when Kitty protocol is not enabled.
|
|
524
|
+
* Modifier values are 1-indexed: 2=shift, 3=alt, 5=ctrl, etc.
|
|
525
|
+
*/
|
|
526
|
+
function matchesModifyOtherKeys(data, expectedKeycode, expectedModifier) {
|
|
527
|
+
const parsed = parseModifyOtherKeysSequence(data);
|
|
528
|
+
if (!parsed)
|
|
529
|
+
return false;
|
|
530
|
+
return parsed.codepoint === expectedKeycode && parsed.modifier === expectedModifier;
|
|
531
|
+
}
|
|
532
|
+
function isWindowsTerminalSession() {
|
|
533
|
+
return (Boolean(process.env.WT_SESSION) && !process.env.SSH_CONNECTION && !process.env.SSH_CLIENT && !process.env.SSH_TTY);
|
|
534
|
+
}
|
|
535
|
+
/**
|
|
536
|
+
* Raw 0x08 (BS) is ambiguous in legacy terminals.
|
|
537
|
+
*
|
|
538
|
+
* - Windows Terminal uses it for Ctrl+Backspace.
|
|
539
|
+
* - Some legacy terminals and tmux setups send it for plain Backspace.
|
|
540
|
+
*
|
|
541
|
+
* Prefer explicit Kitty / CSI-u / modifyOtherKeys sequences whenever they are
|
|
542
|
+
* available. Fall back to a Windows Terminal heuristic only for raw BS bytes.
|
|
543
|
+
*/
|
|
544
|
+
function matchesRawBackspace(data, expectedModifier) {
|
|
545
|
+
if (data === "\x7f")
|
|
546
|
+
return expectedModifier === 0;
|
|
547
|
+
if (data !== "\x08")
|
|
548
|
+
return false;
|
|
549
|
+
return isWindowsTerminalSession() ? expectedModifier === MODIFIERS.ctrl : expectedModifier === 0;
|
|
550
|
+
}
|
|
551
|
+
// =============================================================================
|
|
552
|
+
// Generic Key Matching
|
|
553
|
+
// =============================================================================
|
|
554
|
+
/**
|
|
555
|
+
* Get the control character for a key.
|
|
556
|
+
* Uses the universal formula: code & 0x1f (mask to lower 5 bits)
|
|
557
|
+
*
|
|
558
|
+
* Works for:
|
|
559
|
+
* - Letters a-z → 1-26
|
|
560
|
+
* - Symbols [\]_ → 27, 28, 29, 31
|
|
561
|
+
* - Also maps - to same as _ (same physical key on US keyboards)
|
|
562
|
+
*/
|
|
563
|
+
function rawCtrlChar(key) {
|
|
564
|
+
const char = key.toLowerCase();
|
|
565
|
+
const code = char.charCodeAt(0);
|
|
566
|
+
if ((code >= 97 && code <= 122) || char === "[" || char === "\\" || char === "]" || char === "_") {
|
|
567
|
+
return String.fromCharCode(code & 0x1f);
|
|
568
|
+
}
|
|
569
|
+
// Handle - as _ (same physical key on US keyboards)
|
|
570
|
+
if (char === "-") {
|
|
571
|
+
return String.fromCharCode(31); // Same as Ctrl+_
|
|
572
|
+
}
|
|
573
|
+
return null;
|
|
574
|
+
}
|
|
575
|
+
function isDigitKey(key) {
|
|
576
|
+
return key >= "0" && key <= "9";
|
|
577
|
+
}
|
|
578
|
+
function matchesPrintableModifyOtherKeys(data, expectedKeycode, expectedModifier) {
|
|
579
|
+
if (expectedModifier === 0)
|
|
580
|
+
return false;
|
|
581
|
+
const parsed = parseModifyOtherKeysSequence(data);
|
|
582
|
+
if (!parsed || parsed.modifier !== expectedModifier)
|
|
583
|
+
return false;
|
|
584
|
+
return (normalizeShiftedLetterIdentityCodepoint(parsed.codepoint, parsed.modifier) ===
|
|
585
|
+
normalizeShiftedLetterIdentityCodepoint(expectedKeycode, expectedModifier));
|
|
586
|
+
}
|
|
587
|
+
function formatKeyNameWithModifiers(keyName, modifier) {
|
|
588
|
+
const mods = [];
|
|
589
|
+
const effectiveMod = modifier & ~LOCK_MASK;
|
|
590
|
+
const supportedModifierMask = MODIFIERS.shift | MODIFIERS.ctrl | MODIFIERS.alt | MODIFIERS.super;
|
|
591
|
+
if ((effectiveMod & ~supportedModifierMask) !== 0)
|
|
592
|
+
return undefined;
|
|
593
|
+
if (effectiveMod & MODIFIERS.shift)
|
|
594
|
+
mods.push("shift");
|
|
595
|
+
if (effectiveMod & MODIFIERS.ctrl)
|
|
596
|
+
mods.push("ctrl");
|
|
597
|
+
if (effectiveMod & MODIFIERS.alt)
|
|
598
|
+
mods.push("alt");
|
|
599
|
+
if (effectiveMod & MODIFIERS.super)
|
|
600
|
+
mods.push("super");
|
|
601
|
+
return mods.length > 0 ? `${mods.join("+")}+${keyName}` : keyName;
|
|
602
|
+
}
|
|
603
|
+
function parseKeyId(keyId) {
|
|
604
|
+
const parts = keyId.toLowerCase().split("+");
|
|
605
|
+
const key = parts[parts.length - 1];
|
|
606
|
+
if (!key)
|
|
607
|
+
return null;
|
|
608
|
+
return {
|
|
609
|
+
key,
|
|
610
|
+
ctrl: parts.includes("ctrl"),
|
|
611
|
+
shift: parts.includes("shift"),
|
|
612
|
+
alt: parts.includes("alt"),
|
|
613
|
+
super: parts.includes("super"),
|
|
614
|
+
};
|
|
615
|
+
}
|
|
616
|
+
/**
|
|
617
|
+
* Match input data against a key identifier string.
|
|
618
|
+
*
|
|
619
|
+
* Supported key identifiers:
|
|
620
|
+
* - Single keys: "escape", "tab", "enter", "backspace", "delete", "home", "end", "space"
|
|
621
|
+
* - Arrow keys: "up", "down", "left", "right"
|
|
622
|
+
* - Ctrl combinations: "ctrl+c", "ctrl+z", etc.
|
|
623
|
+
* - Shift combinations: "shift+tab", "shift+enter"
|
|
624
|
+
* - Alt combinations: "alt+enter", "alt+backspace"
|
|
625
|
+
* - Super combinations: "super+k", "super+enter"
|
|
626
|
+
* - Combined modifiers: "shift+ctrl+p", "ctrl+alt+x", "ctrl+super+k"
|
|
627
|
+
*
|
|
628
|
+
* Use the Key helper for autocomplete: Key.ctrl("c"), Key.escape, Key.ctrlShift("p"), Key.super("k")
|
|
629
|
+
*
|
|
630
|
+
* @param data - Raw input data from terminal
|
|
631
|
+
* @param keyId - Key identifier (e.g., "ctrl+c", "escape", Key.ctrl("c"))
|
|
632
|
+
*/
|
|
633
|
+
export function matchesKey(data, keyId) {
|
|
634
|
+
const parsed = parseKeyId(keyId);
|
|
635
|
+
if (!parsed)
|
|
636
|
+
return false;
|
|
637
|
+
const { key, ctrl, shift, alt, super: superModifier } = parsed;
|
|
638
|
+
let modifier = 0;
|
|
639
|
+
if (shift)
|
|
640
|
+
modifier |= MODIFIERS.shift;
|
|
641
|
+
if (alt)
|
|
642
|
+
modifier |= MODIFIERS.alt;
|
|
643
|
+
if (ctrl)
|
|
644
|
+
modifier |= MODIFIERS.ctrl;
|
|
645
|
+
if (superModifier)
|
|
646
|
+
modifier |= MODIFIERS.super;
|
|
647
|
+
switch (key) {
|
|
648
|
+
case "escape":
|
|
649
|
+
case "esc":
|
|
650
|
+
if (modifier !== 0)
|
|
651
|
+
return false;
|
|
652
|
+
return (data === "\x1b" ||
|
|
653
|
+
matchesKittySequence(data, CODEPOINTS.escape, 0) ||
|
|
654
|
+
matchesModifyOtherKeys(data, CODEPOINTS.escape, 0));
|
|
655
|
+
case "space":
|
|
656
|
+
if (!_kittyProtocolActive) {
|
|
657
|
+
if (modifier === MODIFIERS.ctrl && data === "\x00") {
|
|
658
|
+
return true;
|
|
659
|
+
}
|
|
660
|
+
if (modifier === MODIFIERS.alt && data === "\x1b ") {
|
|
661
|
+
return true;
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
if (modifier === 0) {
|
|
665
|
+
return (data === " " ||
|
|
666
|
+
matchesKittySequence(data, CODEPOINTS.space, 0) ||
|
|
667
|
+
matchesModifyOtherKeys(data, CODEPOINTS.space, 0));
|
|
668
|
+
}
|
|
669
|
+
return (matchesKittySequence(data, CODEPOINTS.space, modifier) ||
|
|
670
|
+
matchesModifyOtherKeys(data, CODEPOINTS.space, modifier));
|
|
671
|
+
case "tab":
|
|
672
|
+
if (modifier === MODIFIERS.shift) {
|
|
673
|
+
return (data === "\x1b[Z" ||
|
|
674
|
+
matchesKittySequence(data, CODEPOINTS.tab, MODIFIERS.shift) ||
|
|
675
|
+
matchesModifyOtherKeys(data, CODEPOINTS.tab, MODIFIERS.shift));
|
|
676
|
+
}
|
|
677
|
+
if (modifier === 0) {
|
|
678
|
+
return data === "\t" || matchesKittySequence(data, CODEPOINTS.tab, 0);
|
|
679
|
+
}
|
|
680
|
+
return (matchesKittySequence(data, CODEPOINTS.tab, modifier) ||
|
|
681
|
+
matchesModifyOtherKeys(data, CODEPOINTS.tab, modifier));
|
|
682
|
+
case "enter":
|
|
683
|
+
case "return":
|
|
684
|
+
if (modifier === MODIFIERS.shift) {
|
|
685
|
+
// CSI u sequences (standard Kitty protocol)
|
|
686
|
+
if (matchesKittySequence(data, CODEPOINTS.enter, MODIFIERS.shift) ||
|
|
687
|
+
matchesKittySequence(data, CODEPOINTS.kpEnter, MODIFIERS.shift)) {
|
|
688
|
+
return true;
|
|
689
|
+
}
|
|
690
|
+
// xterm modifyOtherKeys format (fallback when Kitty protocol not enabled)
|
|
691
|
+
if (matchesModifyOtherKeys(data, CODEPOINTS.enter, MODIFIERS.shift)) {
|
|
692
|
+
return true;
|
|
693
|
+
}
|
|
694
|
+
// When Kitty protocol is active, legacy sequences are custom terminal mappings
|
|
695
|
+
// \x1b\r = Kitty's "map shift+enter send_text all \e\r"
|
|
696
|
+
// \n = Ghostty's "keybind = shift+enter=text:\n"
|
|
697
|
+
if (_kittyProtocolActive) {
|
|
698
|
+
return data === "\x1b\r" || data === "\n";
|
|
699
|
+
}
|
|
700
|
+
return false;
|
|
701
|
+
}
|
|
702
|
+
if (modifier === MODIFIERS.alt) {
|
|
703
|
+
// CSI u sequences (standard Kitty protocol)
|
|
704
|
+
if (matchesKittySequence(data, CODEPOINTS.enter, MODIFIERS.alt) ||
|
|
705
|
+
matchesKittySequence(data, CODEPOINTS.kpEnter, MODIFIERS.alt)) {
|
|
706
|
+
return true;
|
|
707
|
+
}
|
|
708
|
+
// xterm modifyOtherKeys format (fallback when Kitty protocol not enabled)
|
|
709
|
+
if (matchesModifyOtherKeys(data, CODEPOINTS.enter, MODIFIERS.alt)) {
|
|
710
|
+
return true;
|
|
711
|
+
}
|
|
712
|
+
// \x1b\r is alt+enter only in legacy mode (no Kitty protocol)
|
|
713
|
+
// When Kitty protocol is active, alt+enter comes as CSI u sequence
|
|
714
|
+
if (!_kittyProtocolActive) {
|
|
715
|
+
return data === "\x1b\r";
|
|
716
|
+
}
|
|
717
|
+
return false;
|
|
718
|
+
}
|
|
719
|
+
if (modifier === 0) {
|
|
720
|
+
return (data === "\r" ||
|
|
721
|
+
(!_kittyProtocolActive && data === "\n") ||
|
|
722
|
+
data === "\x1bOM" || // SS3 M (numpad enter in some terminals)
|
|
723
|
+
matchesKittySequence(data, CODEPOINTS.enter, 0) ||
|
|
724
|
+
matchesKittySequence(data, CODEPOINTS.kpEnter, 0));
|
|
725
|
+
}
|
|
726
|
+
return (matchesKittySequence(data, CODEPOINTS.enter, modifier) ||
|
|
727
|
+
matchesKittySequence(data, CODEPOINTS.kpEnter, modifier) ||
|
|
728
|
+
matchesModifyOtherKeys(data, CODEPOINTS.enter, modifier));
|
|
729
|
+
case "backspace":
|
|
730
|
+
if (modifier === MODIFIERS.alt) {
|
|
731
|
+
if (data === "\x1b\x7f" || data === "\x1b\b") {
|
|
732
|
+
return true;
|
|
733
|
+
}
|
|
734
|
+
return (matchesKittySequence(data, CODEPOINTS.backspace, MODIFIERS.alt) ||
|
|
735
|
+
matchesModifyOtherKeys(data, CODEPOINTS.backspace, MODIFIERS.alt));
|
|
736
|
+
}
|
|
737
|
+
if (modifier === MODIFIERS.ctrl) {
|
|
738
|
+
// Legacy raw 0x08 is ambiguous: it can be Ctrl+Backspace on Windows
|
|
739
|
+
// Terminal or plain Backspace on other terminals, while also
|
|
740
|
+
// overlapping with Ctrl+H.
|
|
741
|
+
if (matchesRawBackspace(data, MODIFIERS.ctrl))
|
|
742
|
+
return true;
|
|
743
|
+
return (matchesKittySequence(data, CODEPOINTS.backspace, MODIFIERS.ctrl) ||
|
|
744
|
+
matchesModifyOtherKeys(data, CODEPOINTS.backspace, MODIFIERS.ctrl));
|
|
745
|
+
}
|
|
746
|
+
if (modifier === 0) {
|
|
747
|
+
return (matchesRawBackspace(data, 0) ||
|
|
748
|
+
matchesKittySequence(data, CODEPOINTS.backspace, 0) ||
|
|
749
|
+
matchesModifyOtherKeys(data, CODEPOINTS.backspace, 0));
|
|
750
|
+
}
|
|
751
|
+
return (matchesKittySequence(data, CODEPOINTS.backspace, modifier) ||
|
|
752
|
+
matchesModifyOtherKeys(data, CODEPOINTS.backspace, modifier));
|
|
753
|
+
case "insert":
|
|
754
|
+
if (modifier === 0) {
|
|
755
|
+
return (matchesLegacySequence(data, LEGACY_KEY_SEQUENCES.insert) ||
|
|
756
|
+
matchesKittySequence(data, FUNCTIONAL_CODEPOINTS.insert, 0));
|
|
757
|
+
}
|
|
758
|
+
if (matchesLegacyModifierSequence(data, "insert", modifier)) {
|
|
759
|
+
return true;
|
|
760
|
+
}
|
|
761
|
+
return matchesKittySequence(data, FUNCTIONAL_CODEPOINTS.insert, modifier);
|
|
762
|
+
case "delete":
|
|
763
|
+
if (modifier === 0) {
|
|
764
|
+
return (matchesLegacySequence(data, LEGACY_KEY_SEQUENCES.delete) ||
|
|
765
|
+
matchesKittySequence(data, FUNCTIONAL_CODEPOINTS.delete, 0));
|
|
766
|
+
}
|
|
767
|
+
if (matchesLegacyModifierSequence(data, "delete", modifier)) {
|
|
768
|
+
return true;
|
|
769
|
+
}
|
|
770
|
+
return matchesKittySequence(data, FUNCTIONAL_CODEPOINTS.delete, modifier);
|
|
771
|
+
case "clear":
|
|
772
|
+
if (modifier === 0) {
|
|
773
|
+
return matchesLegacySequence(data, LEGACY_KEY_SEQUENCES.clear);
|
|
774
|
+
}
|
|
775
|
+
return matchesLegacyModifierSequence(data, "clear", modifier);
|
|
776
|
+
case "home":
|
|
777
|
+
if (modifier === 0) {
|
|
778
|
+
return (matchesLegacySequence(data, LEGACY_KEY_SEQUENCES.home) ||
|
|
779
|
+
matchesKittySequence(data, FUNCTIONAL_CODEPOINTS.home, 0));
|
|
780
|
+
}
|
|
781
|
+
if (matchesLegacyModifierSequence(data, "home", modifier)) {
|
|
782
|
+
return true;
|
|
783
|
+
}
|
|
784
|
+
return matchesKittySequence(data, FUNCTIONAL_CODEPOINTS.home, modifier);
|
|
785
|
+
case "end":
|
|
786
|
+
if (modifier === 0) {
|
|
787
|
+
return (matchesLegacySequence(data, LEGACY_KEY_SEQUENCES.end) ||
|
|
788
|
+
matchesKittySequence(data, FUNCTIONAL_CODEPOINTS.end, 0));
|
|
789
|
+
}
|
|
790
|
+
if (matchesLegacyModifierSequence(data, "end", modifier)) {
|
|
791
|
+
return true;
|
|
792
|
+
}
|
|
793
|
+
return matchesKittySequence(data, FUNCTIONAL_CODEPOINTS.end, modifier);
|
|
794
|
+
case "pageup":
|
|
795
|
+
if (modifier === 0) {
|
|
796
|
+
return (matchesLegacySequence(data, LEGACY_KEY_SEQUENCES.pageUp) ||
|
|
797
|
+
matchesKittySequence(data, FUNCTIONAL_CODEPOINTS.pageUp, 0));
|
|
798
|
+
}
|
|
799
|
+
if (matchesLegacyModifierSequence(data, "pageUp", modifier)) {
|
|
800
|
+
return true;
|
|
801
|
+
}
|
|
802
|
+
return matchesKittySequence(data, FUNCTIONAL_CODEPOINTS.pageUp, modifier);
|
|
803
|
+
case "pagedown":
|
|
804
|
+
if (modifier === 0) {
|
|
805
|
+
return (matchesLegacySequence(data, LEGACY_KEY_SEQUENCES.pageDown) ||
|
|
806
|
+
matchesKittySequence(data, FUNCTIONAL_CODEPOINTS.pageDown, 0));
|
|
807
|
+
}
|
|
808
|
+
if (matchesLegacyModifierSequence(data, "pageDown", modifier)) {
|
|
809
|
+
return true;
|
|
810
|
+
}
|
|
811
|
+
return matchesKittySequence(data, FUNCTIONAL_CODEPOINTS.pageDown, modifier);
|
|
812
|
+
case "up":
|
|
813
|
+
if (modifier === MODIFIERS.alt) {
|
|
814
|
+
return data === "\x1bp" || matchesKittySequence(data, ARROW_CODEPOINTS.up, MODIFIERS.alt);
|
|
815
|
+
}
|
|
816
|
+
if (modifier === 0) {
|
|
817
|
+
return (matchesLegacySequence(data, LEGACY_KEY_SEQUENCES.up) ||
|
|
818
|
+
matchesKittySequence(data, ARROW_CODEPOINTS.up, 0));
|
|
819
|
+
}
|
|
820
|
+
if (matchesLegacyModifierSequence(data, "up", modifier)) {
|
|
821
|
+
return true;
|
|
822
|
+
}
|
|
823
|
+
return matchesKittySequence(data, ARROW_CODEPOINTS.up, modifier);
|
|
824
|
+
case "down":
|
|
825
|
+
if (modifier === MODIFIERS.alt) {
|
|
826
|
+
return data === "\x1bn" || matchesKittySequence(data, ARROW_CODEPOINTS.down, MODIFIERS.alt);
|
|
827
|
+
}
|
|
828
|
+
if (modifier === 0) {
|
|
829
|
+
return (matchesLegacySequence(data, LEGACY_KEY_SEQUENCES.down) ||
|
|
830
|
+
matchesKittySequence(data, ARROW_CODEPOINTS.down, 0));
|
|
831
|
+
}
|
|
832
|
+
if (matchesLegacyModifierSequence(data, "down", modifier)) {
|
|
833
|
+
return true;
|
|
834
|
+
}
|
|
835
|
+
return matchesKittySequence(data, ARROW_CODEPOINTS.down, modifier);
|
|
836
|
+
case "left":
|
|
837
|
+
if (modifier === MODIFIERS.alt) {
|
|
838
|
+
return (data === "\x1b[1;3D" ||
|
|
839
|
+
(!_kittyProtocolActive && data === "\x1bB") ||
|
|
840
|
+
data === "\x1bb" ||
|
|
841
|
+
matchesKittySequence(data, ARROW_CODEPOINTS.left, MODIFIERS.alt));
|
|
842
|
+
}
|
|
843
|
+
if (modifier === MODIFIERS.ctrl) {
|
|
844
|
+
return (data === "\x1b[1;5D" ||
|
|
845
|
+
matchesLegacyModifierSequence(data, "left", MODIFIERS.ctrl) ||
|
|
846
|
+
matchesKittySequence(data, ARROW_CODEPOINTS.left, MODIFIERS.ctrl));
|
|
847
|
+
}
|
|
848
|
+
if (modifier === 0) {
|
|
849
|
+
return (matchesLegacySequence(data, LEGACY_KEY_SEQUENCES.left) ||
|
|
850
|
+
matchesKittySequence(data, ARROW_CODEPOINTS.left, 0));
|
|
851
|
+
}
|
|
852
|
+
if (matchesLegacyModifierSequence(data, "left", modifier)) {
|
|
853
|
+
return true;
|
|
854
|
+
}
|
|
855
|
+
return matchesKittySequence(data, ARROW_CODEPOINTS.left, modifier);
|
|
856
|
+
case "right":
|
|
857
|
+
if (modifier === MODIFIERS.alt) {
|
|
858
|
+
return (data === "\x1b[1;3C" ||
|
|
859
|
+
(!_kittyProtocolActive && data === "\x1bF") ||
|
|
860
|
+
data === "\x1bf" ||
|
|
861
|
+
matchesKittySequence(data, ARROW_CODEPOINTS.right, MODIFIERS.alt));
|
|
862
|
+
}
|
|
863
|
+
if (modifier === MODIFIERS.ctrl) {
|
|
864
|
+
return (data === "\x1b[1;5C" ||
|
|
865
|
+
matchesLegacyModifierSequence(data, "right", MODIFIERS.ctrl) ||
|
|
866
|
+
matchesKittySequence(data, ARROW_CODEPOINTS.right, MODIFIERS.ctrl));
|
|
867
|
+
}
|
|
868
|
+
if (modifier === 0) {
|
|
869
|
+
return (matchesLegacySequence(data, LEGACY_KEY_SEQUENCES.right) ||
|
|
870
|
+
matchesKittySequence(data, ARROW_CODEPOINTS.right, 0));
|
|
871
|
+
}
|
|
872
|
+
if (matchesLegacyModifierSequence(data, "right", modifier)) {
|
|
873
|
+
return true;
|
|
874
|
+
}
|
|
875
|
+
return matchesKittySequence(data, ARROW_CODEPOINTS.right, modifier);
|
|
876
|
+
case "f1":
|
|
877
|
+
case "f2":
|
|
878
|
+
case "f3":
|
|
879
|
+
case "f4":
|
|
880
|
+
case "f5":
|
|
881
|
+
case "f6":
|
|
882
|
+
case "f7":
|
|
883
|
+
case "f8":
|
|
884
|
+
case "f9":
|
|
885
|
+
case "f10":
|
|
886
|
+
case "f11":
|
|
887
|
+
case "f12": {
|
|
888
|
+
if (modifier !== 0) {
|
|
889
|
+
return false;
|
|
890
|
+
}
|
|
891
|
+
const functionKey = key;
|
|
892
|
+
return matchesLegacySequence(data, LEGACY_KEY_SEQUENCES[functionKey]);
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
// Handle single letter/digit keys and symbols
|
|
896
|
+
if (key.length === 1 && ((key >= "a" && key <= "z") || isDigitKey(key) || SYMBOL_KEYS.has(key))) {
|
|
897
|
+
const codepoint = key.charCodeAt(0);
|
|
898
|
+
const rawCtrl = rawCtrlChar(key);
|
|
899
|
+
const isLetter = key >= "a" && key <= "z";
|
|
900
|
+
const isDigit = isDigitKey(key);
|
|
901
|
+
if (modifier === MODIFIERS.ctrl + MODIFIERS.alt && !_kittyProtocolActive && rawCtrl) {
|
|
902
|
+
// Legacy: ctrl+alt+key is ESC followed by the control character.
|
|
903
|
+
// If that legacy form does not match, continue so CSI-u and
|
|
904
|
+
// modifyOtherKeys sequences from tmux can still be recognized.
|
|
905
|
+
if (data === `\x1b${rawCtrl}`)
|
|
906
|
+
return true;
|
|
907
|
+
}
|
|
908
|
+
if (modifier === MODIFIERS.alt && !_kittyProtocolActive && (isLetter || isDigit)) {
|
|
909
|
+
// Legacy: alt+letter/digit is ESC followed by the key
|
|
910
|
+
if (data === `\x1b${key}`)
|
|
911
|
+
return true;
|
|
912
|
+
}
|
|
913
|
+
if (modifier === MODIFIERS.ctrl) {
|
|
914
|
+
// Legacy: ctrl+key sends the control character
|
|
915
|
+
if (rawCtrl && data === rawCtrl)
|
|
916
|
+
return true;
|
|
917
|
+
return (matchesKittySequence(data, codepoint, MODIFIERS.ctrl) ||
|
|
918
|
+
matchesPrintableModifyOtherKeys(data, codepoint, MODIFIERS.ctrl));
|
|
919
|
+
}
|
|
920
|
+
if (modifier === MODIFIERS.shift + MODIFIERS.ctrl) {
|
|
921
|
+
return (matchesKittySequence(data, codepoint, MODIFIERS.shift + MODIFIERS.ctrl) ||
|
|
922
|
+
matchesPrintableModifyOtherKeys(data, codepoint, MODIFIERS.shift + MODIFIERS.ctrl));
|
|
923
|
+
}
|
|
924
|
+
if (modifier === MODIFIERS.shift) {
|
|
925
|
+
// Legacy: shift+letter produces uppercase
|
|
926
|
+
if (isLetter && data === key.toUpperCase())
|
|
927
|
+
return true;
|
|
928
|
+
return (matchesKittySequence(data, codepoint, MODIFIERS.shift) ||
|
|
929
|
+
matchesPrintableModifyOtherKeys(data, codepoint, MODIFIERS.shift));
|
|
930
|
+
}
|
|
931
|
+
if (modifier !== 0) {
|
|
932
|
+
return (matchesKittySequence(data, codepoint, modifier) ||
|
|
933
|
+
matchesPrintableModifyOtherKeys(data, codepoint, modifier));
|
|
934
|
+
}
|
|
935
|
+
// Check both raw char and Kitty sequence (needed for release events)
|
|
936
|
+
return data === key || matchesKittySequence(data, codepoint, 0);
|
|
937
|
+
}
|
|
938
|
+
return false;
|
|
939
|
+
}
|
|
940
|
+
/**
|
|
941
|
+
* Parse input data and return the key identifier if recognized.
|
|
942
|
+
*
|
|
943
|
+
* @param data - Raw input data from terminal
|
|
944
|
+
* @returns Key identifier string (e.g., "ctrl+c") or undefined
|
|
945
|
+
*/
|
|
946
|
+
function formatParsedKey(codepoint, modifier, baseLayoutKey) {
|
|
947
|
+
const normalizedCodepoint = normalizeKittyFunctionalCodepoint(codepoint);
|
|
948
|
+
const identityCodepoint = normalizeShiftedLetterIdentityCodepoint(normalizedCodepoint, modifier);
|
|
949
|
+
// Use base layout key only when codepoint is not a recognized Latin
|
|
950
|
+
// letter (a-z), digit (0-9), or symbol (/, -, [, ;, etc.). For those,
|
|
951
|
+
// the codepoint is authoritative regardless of physical key position.
|
|
952
|
+
// This prevents remapped layouts (Dvorak, Colemak, xremap, etc.) from
|
|
953
|
+
// reporting the wrong key name based on the QWERTY physical position.
|
|
954
|
+
const isLatinLetter = identityCodepoint >= 97 && identityCodepoint <= 122; // a-z
|
|
955
|
+
const isDigit = identityCodepoint >= 48 && identityCodepoint <= 57; // 0-9
|
|
956
|
+
const isKnownSymbol = SYMBOL_KEYS.has(String.fromCharCode(identityCodepoint));
|
|
957
|
+
const effectiveCodepoint = isLatinLetter || isDigit || isKnownSymbol ? identityCodepoint : (baseLayoutKey ?? identityCodepoint);
|
|
958
|
+
let keyName;
|
|
959
|
+
if (effectiveCodepoint === CODEPOINTS.escape)
|
|
960
|
+
keyName = "escape";
|
|
961
|
+
else if (effectiveCodepoint === CODEPOINTS.tab)
|
|
962
|
+
keyName = "tab";
|
|
963
|
+
else if (effectiveCodepoint === CODEPOINTS.enter || effectiveCodepoint === CODEPOINTS.kpEnter)
|
|
964
|
+
keyName = "enter";
|
|
965
|
+
else if (effectiveCodepoint === CODEPOINTS.space)
|
|
966
|
+
keyName = "space";
|
|
967
|
+
else if (effectiveCodepoint === CODEPOINTS.backspace)
|
|
968
|
+
keyName = "backspace";
|
|
969
|
+
else if (effectiveCodepoint === FUNCTIONAL_CODEPOINTS.delete)
|
|
970
|
+
keyName = "delete";
|
|
971
|
+
else if (effectiveCodepoint === FUNCTIONAL_CODEPOINTS.insert)
|
|
972
|
+
keyName = "insert";
|
|
973
|
+
else if (effectiveCodepoint === FUNCTIONAL_CODEPOINTS.home)
|
|
974
|
+
keyName = "home";
|
|
975
|
+
else if (effectiveCodepoint === FUNCTIONAL_CODEPOINTS.end)
|
|
976
|
+
keyName = "end";
|
|
977
|
+
else if (effectiveCodepoint === FUNCTIONAL_CODEPOINTS.pageUp)
|
|
978
|
+
keyName = "pageUp";
|
|
979
|
+
else if (effectiveCodepoint === FUNCTIONAL_CODEPOINTS.pageDown)
|
|
980
|
+
keyName = "pageDown";
|
|
981
|
+
else if (effectiveCodepoint === ARROW_CODEPOINTS.up)
|
|
982
|
+
keyName = "up";
|
|
983
|
+
else if (effectiveCodepoint === ARROW_CODEPOINTS.down)
|
|
984
|
+
keyName = "down";
|
|
985
|
+
else if (effectiveCodepoint === ARROW_CODEPOINTS.left)
|
|
986
|
+
keyName = "left";
|
|
987
|
+
else if (effectiveCodepoint === ARROW_CODEPOINTS.right)
|
|
988
|
+
keyName = "right";
|
|
989
|
+
else if (effectiveCodepoint >= 48 && effectiveCodepoint <= 57)
|
|
990
|
+
keyName = String.fromCharCode(effectiveCodepoint);
|
|
991
|
+
else if (effectiveCodepoint >= 97 && effectiveCodepoint <= 122)
|
|
992
|
+
keyName = String.fromCharCode(effectiveCodepoint);
|
|
993
|
+
else if (SYMBOL_KEYS.has(String.fromCharCode(effectiveCodepoint)))
|
|
994
|
+
keyName = String.fromCharCode(effectiveCodepoint);
|
|
995
|
+
if (!keyName)
|
|
996
|
+
return undefined;
|
|
997
|
+
return formatKeyNameWithModifiers(keyName, modifier);
|
|
998
|
+
}
|
|
999
|
+
export function parseKey(data) {
|
|
1000
|
+
const kitty = parseKittySequence(data);
|
|
1001
|
+
if (kitty) {
|
|
1002
|
+
return formatParsedKey(kitty.codepoint, kitty.modifier, kitty.baseLayoutKey);
|
|
1003
|
+
}
|
|
1004
|
+
const modifyOtherKeys = parseModifyOtherKeysSequence(data);
|
|
1005
|
+
if (modifyOtherKeys) {
|
|
1006
|
+
return formatParsedKey(modifyOtherKeys.codepoint, modifyOtherKeys.modifier);
|
|
1007
|
+
}
|
|
1008
|
+
// Mode-aware legacy sequences
|
|
1009
|
+
// When Kitty protocol is active, ambiguous sequences are interpreted as custom terminal mappings:
|
|
1010
|
+
// - \x1b\r = shift+enter (Kitty mapping), not alt+enter
|
|
1011
|
+
// - \n = shift+enter (Ghostty mapping)
|
|
1012
|
+
if (_kittyProtocolActive) {
|
|
1013
|
+
if (data === "\x1b\r" || data === "\n")
|
|
1014
|
+
return "shift+enter";
|
|
1015
|
+
}
|
|
1016
|
+
const legacySequenceKeyId = LEGACY_SEQUENCE_KEY_IDS[data];
|
|
1017
|
+
if (legacySequenceKeyId)
|
|
1018
|
+
return legacySequenceKeyId;
|
|
1019
|
+
// Legacy sequences (used when Kitty protocol is not active, or for unambiguous sequences)
|
|
1020
|
+
if (data === "\x1b")
|
|
1021
|
+
return "escape";
|
|
1022
|
+
if (data === "\x1c")
|
|
1023
|
+
return "ctrl+\\";
|
|
1024
|
+
if (data === "\x1d")
|
|
1025
|
+
return "ctrl+]";
|
|
1026
|
+
if (data === "\x1f")
|
|
1027
|
+
return "ctrl+-";
|
|
1028
|
+
if (data === "\x1b\x1b")
|
|
1029
|
+
return "ctrl+alt+[";
|
|
1030
|
+
if (data === "\x1b\x1c")
|
|
1031
|
+
return "ctrl+alt+\\";
|
|
1032
|
+
if (data === "\x1b\x1d")
|
|
1033
|
+
return "ctrl+alt+]";
|
|
1034
|
+
if (data === "\x1b\x1f")
|
|
1035
|
+
return "ctrl+alt+-";
|
|
1036
|
+
if (data === "\t")
|
|
1037
|
+
return "tab";
|
|
1038
|
+
if (data === "\r" || (!_kittyProtocolActive && data === "\n") || data === "\x1bOM")
|
|
1039
|
+
return "enter";
|
|
1040
|
+
if (data === "\x00")
|
|
1041
|
+
return "ctrl+space";
|
|
1042
|
+
if (data === " ")
|
|
1043
|
+
return "space";
|
|
1044
|
+
if (data === "\x7f")
|
|
1045
|
+
return "backspace";
|
|
1046
|
+
if (data === "\x08")
|
|
1047
|
+
return isWindowsTerminalSession() ? "ctrl+backspace" : "backspace";
|
|
1048
|
+
if (data === "\x1b[Z")
|
|
1049
|
+
return "shift+tab";
|
|
1050
|
+
if (!_kittyProtocolActive && data === "\x1b\r")
|
|
1051
|
+
return "alt+enter";
|
|
1052
|
+
if (!_kittyProtocolActive && data === "\x1b ")
|
|
1053
|
+
return "alt+space";
|
|
1054
|
+
if (data === "\x1b\x7f" || data === "\x1b\b")
|
|
1055
|
+
return "alt+backspace";
|
|
1056
|
+
if (!_kittyProtocolActive && data === "\x1bB")
|
|
1057
|
+
return "alt+left";
|
|
1058
|
+
if (!_kittyProtocolActive && data === "\x1bF")
|
|
1059
|
+
return "alt+right";
|
|
1060
|
+
if (!_kittyProtocolActive && data.length === 2 && data[0] === "\x1b") {
|
|
1061
|
+
const code = data.charCodeAt(1);
|
|
1062
|
+
if (code >= 1 && code <= 26) {
|
|
1063
|
+
return `ctrl+alt+${String.fromCharCode(code + 96)}`;
|
|
1064
|
+
}
|
|
1065
|
+
// Legacy alt+letter/digit (ESC followed by the key)
|
|
1066
|
+
if ((code >= 97 && code <= 122) || (code >= 48 && code <= 57)) {
|
|
1067
|
+
return `alt+${String.fromCharCode(code)}`;
|
|
1068
|
+
}
|
|
1069
|
+
}
|
|
1070
|
+
if (data === "\x1b[A")
|
|
1071
|
+
return "up";
|
|
1072
|
+
if (data === "\x1b[B")
|
|
1073
|
+
return "down";
|
|
1074
|
+
if (data === "\x1b[C")
|
|
1075
|
+
return "right";
|
|
1076
|
+
if (data === "\x1b[D")
|
|
1077
|
+
return "left";
|
|
1078
|
+
if (data === "\x1b[H" || data === "\x1bOH")
|
|
1079
|
+
return "home";
|
|
1080
|
+
if (data === "\x1b[F" || data === "\x1bOF")
|
|
1081
|
+
return "end";
|
|
1082
|
+
if (data === "\x1b[3~")
|
|
1083
|
+
return "delete";
|
|
1084
|
+
if (data === "\x1b[5~")
|
|
1085
|
+
return "pageUp";
|
|
1086
|
+
if (data === "\x1b[6~")
|
|
1087
|
+
return "pageDown";
|
|
1088
|
+
// Raw Ctrl+letter
|
|
1089
|
+
if (data.length === 1) {
|
|
1090
|
+
const code = data.charCodeAt(0);
|
|
1091
|
+
if (code >= 1 && code <= 26) {
|
|
1092
|
+
return `ctrl+${String.fromCharCode(code + 96)}`;
|
|
1093
|
+
}
|
|
1094
|
+
if (code >= 32 && code <= 126) {
|
|
1095
|
+
return data;
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
return undefined;
|
|
1099
|
+
}
|
|
1100
|
+
// =============================================================================
|
|
1101
|
+
// Kitty CSI-u Printable Decoding
|
|
1102
|
+
// =============================================================================
|
|
1103
|
+
const KITTY_CSI_U_REGEX = /^\x1b\[(\d+)(?::(\d*))?(?::(\d+))?(?:;(\d+))?(?::(\d+))?u$/;
|
|
1104
|
+
const KITTY_PRINTABLE_ALLOWED_MODIFIERS = MODIFIERS.shift | LOCK_MASK;
|
|
1105
|
+
/**
|
|
1106
|
+
* Decode a Kitty CSI-u sequence into a printable character, if applicable.
|
|
1107
|
+
*
|
|
1108
|
+
* When Kitty keyboard protocol flag 1 (disambiguate) is active, terminals send
|
|
1109
|
+
* CSI-u sequences for all keys, including plain printable characters. This
|
|
1110
|
+
* function extracts the printable character from such sequences.
|
|
1111
|
+
*
|
|
1112
|
+
* Only accepts plain or Shift-modified keys. Rejects Ctrl, Alt, and unsupported
|
|
1113
|
+
* modifier combinations (those are handled by keybinding matching instead).
|
|
1114
|
+
* Prefers the shifted keycode when Shift is held and a shifted key is reported.
|
|
1115
|
+
*
|
|
1116
|
+
* @param data - Raw input data from terminal
|
|
1117
|
+
* @returns The printable character, or undefined if not a printable CSI-u sequence
|
|
1118
|
+
*/
|
|
1119
|
+
export function decodeKittyPrintable(data) {
|
|
1120
|
+
const match = data.match(KITTY_CSI_U_REGEX);
|
|
1121
|
+
if (!match)
|
|
1122
|
+
return undefined;
|
|
1123
|
+
// CSI-u groups: <codepoint>[:<shifted>[:<base>]];<mod>[:<event>]u
|
|
1124
|
+
const codepoint = Number.parseInt(match[1] ?? "", 10);
|
|
1125
|
+
if (!Number.isFinite(codepoint))
|
|
1126
|
+
return undefined;
|
|
1127
|
+
const shiftedKey = match[2] && match[2].length > 0 ? Number.parseInt(match[2], 10) : undefined;
|
|
1128
|
+
const modValue = match[4] ? Number.parseInt(match[4], 10) : 1;
|
|
1129
|
+
// Modifiers are 1-indexed in CSI-u; normalize to our bitmask.
|
|
1130
|
+
const modifier = Number.isFinite(modValue) ? modValue - 1 : 0;
|
|
1131
|
+
// Only accept printable CSI-u input for plain or Shift-modified text keys.
|
|
1132
|
+
// Reject unsupported modifier bits (e.g. Super/Meta) to avoid inserting
|
|
1133
|
+
// characters from modifier-only terminal events.
|
|
1134
|
+
if ((modifier & ~KITTY_PRINTABLE_ALLOWED_MODIFIERS) !== 0)
|
|
1135
|
+
return undefined;
|
|
1136
|
+
if (modifier & (MODIFIERS.alt | MODIFIERS.ctrl))
|
|
1137
|
+
return undefined;
|
|
1138
|
+
// Prefer the shifted keycode when Shift is held.
|
|
1139
|
+
let effectiveCodepoint = codepoint;
|
|
1140
|
+
if (modifier & MODIFIERS.shift && typeof shiftedKey === "number") {
|
|
1141
|
+
effectiveCodepoint = shiftedKey;
|
|
1142
|
+
}
|
|
1143
|
+
effectiveCodepoint = normalizeKittyFunctionalCodepoint(effectiveCodepoint);
|
|
1144
|
+
// Drop control characters or invalid codepoints.
|
|
1145
|
+
if (!Number.isFinite(effectiveCodepoint) || effectiveCodepoint < 32)
|
|
1146
|
+
return undefined;
|
|
1147
|
+
try {
|
|
1148
|
+
return String.fromCodePoint(effectiveCodepoint);
|
|
1149
|
+
}
|
|
1150
|
+
catch {
|
|
1151
|
+
return undefined;
|
|
1152
|
+
}
|
|
1153
|
+
}
|
|
1154
|
+
function decodeModifyOtherKeysPrintable(data) {
|
|
1155
|
+
const parsed = parseModifyOtherKeysSequence(data);
|
|
1156
|
+
if (!parsed)
|
|
1157
|
+
return undefined;
|
|
1158
|
+
const modifier = parsed.modifier & ~LOCK_MASK;
|
|
1159
|
+
if ((modifier & ~MODIFIERS.shift) !== 0)
|
|
1160
|
+
return undefined;
|
|
1161
|
+
if (!Number.isFinite(parsed.codepoint) || parsed.codepoint < 32)
|
|
1162
|
+
return undefined;
|
|
1163
|
+
try {
|
|
1164
|
+
return String.fromCodePoint(parsed.codepoint);
|
|
1165
|
+
}
|
|
1166
|
+
catch {
|
|
1167
|
+
return undefined;
|
|
1168
|
+
}
|
|
1169
|
+
}
|
|
1170
|
+
export function decodePrintableKey(data) {
|
|
1171
|
+
return decodeKittyPrintable(data) ?? decodeModifyOtherKeysPrintable(data);
|
|
1172
|
+
}
|
|
1173
|
+
//# sourceMappingURL=keys.js.map
|