gsd-pi 2.34.0-dev.ed0bfbf → 2.35.0-dev.55dcc60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/resources/extensions/gsd/changelog.js +162 -0
- package/dist/resources/extensions/gsd/commands-bootstrap.js +1 -0
- package/dist/resources/extensions/gsd/commands-inspect.js +10 -3
- package/dist/resources/extensions/gsd/commands-prefs-wizard.js +5 -1
- package/dist/resources/extensions/gsd/commands.js +8 -1
- package/dist/resources/extensions/gsd/docs/preferences-reference.md +10 -0
- package/dist/resources/extensions/gsd/doctor-checks.js +113 -5
- package/dist/resources/extensions/gsd/doctor-proactive.js +22 -0
- package/dist/resources/extensions/gsd/doctor.js +36 -0
- package/dist/resources/extensions/gsd/guided-flow.js +4 -2
- package/dist/resources/extensions/gsd/preferences-validation.js +38 -0
- package/dist/resources/extensions/gsd/preferences.js +2 -0
- package/dist/resources/skills/create-gsd-extension/references/events-reference.md +4 -4
- package/package.json +1 -1
- package/packages/pi-agent-core/dist/agent-loop.d.ts +14 -0
- package/packages/pi-agent-core/dist/agent-loop.d.ts.map +1 -1
- package/packages/pi-agent-core/dist/agent-loop.js +24 -27
- package/packages/pi-agent-core/dist/agent-loop.js.map +1 -1
- package/packages/pi-agent-core/dist/agent.d.ts +1 -0
- package/packages/pi-agent-core/dist/agent.d.ts.map +1 -1
- package/packages/pi-agent-core/dist/agent.js +11 -22
- package/packages/pi-agent-core/dist/agent.js.map +1 -1
- package/packages/pi-agent-core/dist/proxy.d.ts.map +1 -1
- package/packages/pi-agent-core/dist/proxy.js +2 -8
- package/packages/pi-agent-core/dist/proxy.js.map +1 -1
- package/packages/pi-agent-core/src/agent-loop.ts +30 -27
- package/packages/pi-agent-core/src/agent.ts +12 -23
- package/packages/pi-agent-core/src/proxy.ts +2 -8
- package/packages/pi-ai/dist/providers/azure-openai-responses.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/azure-openai-responses.js +5 -41
- package/packages/pi-ai/dist/providers/azure-openai-responses.js.map +1 -1
- package/packages/pi-ai/dist/providers/openai-completions.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/openai-completions.js +10 -73
- package/packages/pi-ai/dist/providers/openai-completions.js.map +1 -1
- package/packages/pi-ai/dist/providers/openai-responses.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/openai-responses.js +8 -79
- package/packages/pi-ai/dist/providers/openai-responses.js.map +1 -1
- package/packages/pi-ai/dist/providers/openai-shared.d.ts +65 -0
- package/packages/pi-ai/dist/providers/openai-shared.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/openai-shared.js +146 -0
- package/packages/pi-ai/dist/providers/openai-shared.js.map +1 -0
- package/packages/pi-ai/dist/utils/oauth/google-antigravity.d.ts.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/google-antigravity.js +7 -135
- package/packages/pi-ai/dist/utils/oauth/google-antigravity.js.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.d.ts.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.js +7 -135
- package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.js.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/google-oauth-utils.d.ts +46 -0
- package/packages/pi-ai/dist/utils/oauth/google-oauth-utils.d.ts.map +1 -0
- package/packages/pi-ai/dist/utils/oauth/google-oauth-utils.js +160 -0
- package/packages/pi-ai/dist/utils/oauth/google-oauth-utils.js.map +1 -0
- package/packages/pi-ai/src/providers/azure-openai-responses.ts +11 -45
- package/packages/pi-ai/src/providers/openai-completions.ts +16 -86
- package/packages/pi-ai/src/providers/openai-responses.ts +15 -95
- package/packages/pi-ai/src/providers/openai-shared.ts +193 -0
- package/packages/pi-ai/src/utils/oauth/google-antigravity.ts +14 -162
- package/packages/pi-ai/src/utils/oauth/google-gemini-cli.ts +13 -161
- package/packages/pi-ai/src/utils/oauth/google-oauth-utils.ts +201 -0
- package/packages/pi-coding-agent/dist/core/agent-session.d.ts +16 -63
- package/packages/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session.js +104 -641
- package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/auth-storage.d.ts +0 -1
- package/packages/pi-coding-agent/dist/core/auth-storage.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/auth-storage.js +4 -35
- package/packages/pi-coding-agent/dist/core/auth-storage.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/branch-summarization.js +5 -43
- package/packages/pi-coding-agent/dist/core/compaction/branch-summarization.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/compaction.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/compaction.js +11 -69
- package/packages/pi-coding-agent/dist/core/compaction/compaction.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/utils.d.ts +40 -0
- package/packages/pi-coding-agent/dist/core/compaction/utils.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/utils.js +78 -0
- package/packages/pi-coding-agent/dist/core/compaction/utils.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction-orchestrator.d.ts +77 -0
- package/packages/pi-coding-agent/dist/core/compaction-orchestrator.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/compaction-orchestrator.js +331 -0
- package/packages/pi-coding-agent/dist/core/compaction-orchestrator.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/extensions/index.d.ts +2 -2
- package/packages/pi-coding-agent/dist/core/extensions/index.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/index.js +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/index.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts +15 -0
- package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/runner.js +129 -243
- package/packages/pi-coding-agent/dist/core/extensions/runner.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/types.d.ts +49 -42
- package/packages/pi-coding-agent/dist/core/extensions/types.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/types.js +2 -21
- package/packages/pi-coding-agent/dist/core/extensions/types.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/lock-utils.d.ts +39 -0
- package/packages/pi-coding-agent/dist/core/lock-utils.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/lock-utils.js +89 -0
- package/packages/pi-coding-agent/dist/core/lock-utils.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/lsp/config.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/lsp/config.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/lsp/config.js +4 -1
- package/packages/pi-coding-agent/dist/core/lsp/config.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/lsp/index.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/lsp/index.js +52 -107
- package/packages/pi-coding-agent/dist/core/lsp/index.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/lsp/lspmux.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/lsp/lspmux.js +2 -21
- package/packages/pi-coding-agent/dist/core/lsp/lspmux.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/lsp/types.d.ts +0 -1
- package/packages/pi-coding-agent/dist/core/lsp/types.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/lsp/types.js +0 -28
- package/packages/pi-coding-agent/dist/core/lsp/types.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/package-manager.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/package-manager.js +2 -4
- package/packages/pi-coding-agent/dist/core/package-manager.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/resource-loader.d.ts +2 -4
- package/packages/pi-coding-agent/dist/core/resource-loader.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/resource-loader.js +33 -58
- package/packages/pi-coding-agent/dist/core/resource-loader.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/retry-handler.d.ts +87 -0
- package/packages/pi-coding-agent/dist/core/retry-handler.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/retry-handler.js +295 -0
- package/packages/pi-coding-agent/dist/core/retry-handler.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/session-manager.d.ts +0 -1
- package/packages/pi-coding-agent/dist/core/session-manager.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/session-manager.js +3 -28
- package/packages/pi-coding-agent/dist/core/session-manager.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/settings-manager.d.ts +8 -0
- package/packages/pi-coding-agent/dist/core/settings-manager.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/settings-manager.js +76 -166
- package/packages/pi-coding-agent/dist/core/settings-manager.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/skills.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/skills.js +1 -3
- package/packages/pi-coding-agent/dist/core/skills.js.map +1 -1
- package/packages/pi-coding-agent/dist/index.d.ts +1 -1
- package/packages/pi-coding-agent/dist/index.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/index.js +1 -1
- package/packages/pi-coding-agent/dist/index.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/session-selector.d.ts +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/session-selector.js +9 -26
- package/packages/pi-coding-agent/dist/modes/interactive/components/session-selector.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +1 -13
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tree-render-utils.d.ts +44 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/tree-render-utils.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/tree-render-utils.js +61 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/tree-render-utils.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tree-selector.js +6 -9
- package/packages/pi-coding-agent/dist/modes/interactive/components/tree-selector.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts +65 -0
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js +6 -16
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.d.ts +12 -0
- package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.js +175 -0
- package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/utils/shorten-path.d.ts +6 -0
- package/packages/pi-coding-agent/dist/modes/interactive/utils/shorten-path.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/utils/shorten-path.js +15 -0
- package/packages/pi-coding-agent/dist/modes/interactive/utils/shorten-path.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/print-mode.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/print-mode.js +2 -30
- package/packages/pi-coding-agent/dist/modes/print-mode.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/rpc/rpc-mode.js +2 -28
- package/packages/pi-coding-agent/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/shared/command-context-actions.d.ts +19 -0
- package/packages/pi-coding-agent/dist/modes/shared/command-context-actions.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/shared/command-context-actions.js +45 -0
- package/packages/pi-coding-agent/dist/modes/shared/command-context-actions.js.map +1 -0
- package/packages/pi-coding-agent/dist/utils/error.d.ts +5 -0
- package/packages/pi-coding-agent/dist/utils/error.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/utils/error.js +7 -0
- package/packages/pi-coding-agent/dist/utils/error.js.map +1 -0
- package/packages/pi-coding-agent/package.json +1 -1
- package/packages/pi-coding-agent/src/core/agent-session.ts +117 -745
- package/packages/pi-coding-agent/src/core/auth-storage.ts +4 -38
- package/packages/pi-coding-agent/src/core/compaction/branch-summarization.ts +7 -53
- package/packages/pi-coding-agent/src/core/compaction/compaction.ts +14 -74
- package/packages/pi-coding-agent/src/core/compaction/utils.ts +100 -0
- package/packages/pi-coding-agent/src/core/compaction-orchestrator.ts +424 -0
- package/packages/pi-coding-agent/src/core/extensions/index.ts +1 -21
- package/packages/pi-coding-agent/src/core/extensions/runner.ts +119 -243
- package/packages/pi-coding-agent/src/core/extensions/types.ts +50 -69
- package/packages/pi-coding-agent/src/core/lock-utils.ts +113 -0
- package/packages/pi-coding-agent/src/core/lsp/config.ts +4 -1
- package/packages/pi-coding-agent/src/core/lsp/index.ts +83 -152
- package/packages/pi-coding-agent/src/core/lsp/lspmux.ts +2 -22
- package/packages/pi-coding-agent/src/core/lsp/types.ts +0 -29
- package/packages/pi-coding-agent/src/core/package-manager.ts +1 -4
- package/packages/pi-coding-agent/src/core/resource-loader.ts +43 -67
- package/packages/pi-coding-agent/src/core/retry-handler.ts +359 -0
- package/packages/pi-coding-agent/src/core/session-manager.ts +3 -30
- package/packages/pi-coding-agent/src/core/settings-manager.ts +85 -164
- package/packages/pi-coding-agent/src/core/skills.ts +1 -4
- package/packages/pi-coding-agent/src/index.ts +1 -7
- package/packages/pi-coding-agent/src/modes/interactive/components/session-selector.ts +17 -29
- package/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +1 -13
- package/packages/pi-coding-agent/src/modes/interactive/components/tree-render-utils.ts +81 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/tree-selector.ts +14 -19
- package/packages/pi-coding-agent/src/modes/interactive/theme/theme.ts +7 -18
- package/packages/pi-coding-agent/src/modes/interactive/theme/themes.ts +196 -0
- package/packages/pi-coding-agent/src/modes/interactive/utils/shorten-path.ts +14 -0
- package/packages/pi-coding-agent/src/modes/print-mode.ts +2 -30
- package/packages/pi-coding-agent/src/modes/rpc/rpc-mode.ts +2 -28
- package/packages/pi-coding-agent/src/modes/shared/command-context-actions.ts +53 -0
- package/packages/pi-coding-agent/src/utils/error.ts +6 -0
- package/packages/pi-tui/dist/components/markdown.d.ts +5 -0
- package/packages/pi-tui/dist/components/markdown.d.ts.map +1 -1
- package/packages/pi-tui/dist/components/markdown.js +25 -31
- package/packages/pi-tui/dist/components/markdown.js.map +1 -1
- package/packages/pi-tui/dist/keys.d.ts +0 -4
- package/packages/pi-tui/dist/keys.d.ts.map +1 -1
- package/packages/pi-tui/dist/keys.js +94 -162
- package/packages/pi-tui/dist/keys.js.map +1 -1
- package/packages/pi-tui/src/components/markdown.ts +25 -29
- package/packages/pi-tui/src/keys.ts +94 -173
- package/pkg/dist/modes/interactive/theme/theme.d.ts +65 -0
- package/pkg/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/pkg/dist/modes/interactive/theme/theme.js +6 -16
- package/pkg/dist/modes/interactive/theme/theme.js.map +1 -1
- package/pkg/dist/modes/interactive/theme/themes.d.ts +12 -0
- package/pkg/dist/modes/interactive/theme/themes.d.ts.map +1 -0
- package/pkg/dist/modes/interactive/theme/themes.js +175 -0
- package/pkg/dist/modes/interactive/theme/themes.js.map +1 -0
- package/pkg/package.json +1 -1
- package/src/resources/extensions/gsd/changelog.ts +213 -0
- package/src/resources/extensions/gsd/commands-bootstrap.ts +1 -0
- package/src/resources/extensions/gsd/commands-inspect.ts +10 -3
- package/src/resources/extensions/gsd/commands-prefs-wizard.ts +5 -1
- package/src/resources/extensions/gsd/commands.ts +9 -1
- package/src/resources/extensions/gsd/docs/preferences-reference.md +10 -0
- package/src/resources/extensions/gsd/doctor-checks.ts +107 -5
- package/src/resources/extensions/gsd/doctor-proactive.ts +24 -0
- package/src/resources/extensions/gsd/doctor-types.ts +9 -1
- package/src/resources/extensions/gsd/doctor.ts +35 -0
- package/src/resources/extensions/gsd/guided-flow.ts +4 -2
- package/src/resources/extensions/gsd/preferences-validation.ts +38 -0
- package/src/resources/extensions/gsd/preferences.ts +2 -0
- package/src/resources/extensions/gsd/tests/commands-inspect-open-db.test.ts +46 -0
- package/src/resources/extensions/gsd/tests/doctor-git.test.ts +98 -2
- package/src/resources/extensions/gsd/tests/doctor-runtime.test.ts +59 -3
- package/src/resources/extensions/gsd/tests/preferences.test.ts +28 -0
- package/src/resources/skills/create-gsd-extension/references/events-reference.md +4 -4
- package/packages/pi-coding-agent/dist/modes/interactive/theme/dark.json +0 -85
- package/packages/pi-coding-agent/dist/modes/interactive/theme/light.json +0 -84
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-schema.json +0 -335
- package/packages/pi-coding-agent/src/modes/interactive/theme/dark.json +0 -85
- package/packages/pi-coding-agent/src/modes/interactive/theme/light.json +0 -84
- package/packages/pi-coding-agent/src/modes/interactive/theme/theme-schema.json +0 -335
- package/pkg/dist/modes/interactive/theme/dark.json +0 -85
- package/pkg/dist/modes/interactive/theme/light.json +0 -84
- package/pkg/dist/modes/interactive/theme/theme-schema.json +0 -335
|
@@ -185,176 +185,108 @@ const FUNCTIONAL_CODEPOINTS = {
|
|
|
185
185
|
home: -14,
|
|
186
186
|
end: -15,
|
|
187
187
|
};
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
clear: ["\x1b[e"],
|
|
219
|
-
insert: ["\x1b[2$"],
|
|
220
|
-
delete: ["\x1b[3$"],
|
|
221
|
-
pageUp: ["\x1b[5$"],
|
|
222
|
-
pageDown: ["\x1b[6$"],
|
|
223
|
-
home: ["\x1b[7$"],
|
|
224
|
-
end: ["\x1b[8$"],
|
|
225
|
-
};
|
|
226
|
-
const LEGACY_CTRL_SEQUENCES = {
|
|
227
|
-
up: ["\x1bOa"],
|
|
228
|
-
down: ["\x1bOb"],
|
|
229
|
-
right: ["\x1bOc"],
|
|
230
|
-
left: ["\x1bOd"],
|
|
231
|
-
clear: ["\x1bOe"],
|
|
232
|
-
insert: ["\x1b[2^"],
|
|
233
|
-
delete: ["\x1b[3^"],
|
|
234
|
-
pageUp: ["\x1b[5^"],
|
|
235
|
-
pageDown: ["\x1b[6^"],
|
|
236
|
-
home: ["\x1b[7^"],
|
|
237
|
-
end: ["\x1b[8^"],
|
|
238
|
-
};
|
|
239
|
-
const LEGACY_SEQUENCE_KEY_IDS = {
|
|
240
|
-
"\x1bOA": "up",
|
|
241
|
-
"\x1bOB": "down",
|
|
242
|
-
"\x1bOC": "right",
|
|
243
|
-
"\x1bOD": "left",
|
|
244
|
-
"\x1bOH": "home",
|
|
245
|
-
"\x1bOF": "end",
|
|
246
|
-
"\x1b[E": "clear",
|
|
247
|
-
"\x1bOE": "clear",
|
|
248
|
-
"\x1bOe": "ctrl+clear",
|
|
249
|
-
"\x1b[e": "shift+clear",
|
|
250
|
-
"\x1b[2~": "insert",
|
|
251
|
-
"\x1b[2$": "shift+insert",
|
|
252
|
-
"\x1b[2^": "ctrl+insert",
|
|
253
|
-
"\x1b[3$": "shift+delete",
|
|
254
|
-
"\x1b[3^": "ctrl+delete",
|
|
255
|
-
"\x1b[[5~": "pageUp",
|
|
256
|
-
"\x1b[[6~": "pageDown",
|
|
257
|
-
"\x1b[a": "shift+up",
|
|
258
|
-
"\x1b[b": "shift+down",
|
|
259
|
-
"\x1b[c": "shift+right",
|
|
260
|
-
"\x1b[d": "shift+left",
|
|
261
|
-
"\x1bOa": "ctrl+up",
|
|
262
|
-
"\x1bOb": "ctrl+down",
|
|
263
|
-
"\x1bOc": "ctrl+right",
|
|
264
|
-
"\x1bOd": "ctrl+left",
|
|
265
|
-
"\x1b[5$": "shift+pageUp",
|
|
266
|
-
"\x1b[6$": "shift+pageDown",
|
|
267
|
-
"\x1b[7$": "shift+home",
|
|
268
|
-
"\x1b[8$": "shift+end",
|
|
269
|
-
"\x1b[5^": "ctrl+pageUp",
|
|
270
|
-
"\x1b[6^": "ctrl+pageDown",
|
|
271
|
-
"\x1b[7^": "ctrl+home",
|
|
272
|
-
"\x1b[8^": "ctrl+end",
|
|
273
|
-
"\x1bOP": "f1",
|
|
274
|
-
"\x1bOQ": "f2",
|
|
275
|
-
"\x1bOR": "f3",
|
|
276
|
-
"\x1bOS": "f4",
|
|
277
|
-
"\x1b[11~": "f1",
|
|
278
|
-
"\x1b[12~": "f2",
|
|
279
|
-
"\x1b[13~": "f3",
|
|
280
|
-
"\x1b[14~": "f4",
|
|
281
|
-
"\x1b[[A": "f1",
|
|
282
|
-
"\x1b[[B": "f2",
|
|
283
|
-
"\x1b[[C": "f3",
|
|
284
|
-
"\x1b[[D": "f4",
|
|
285
|
-
"\x1b[[E": "f5",
|
|
286
|
-
"\x1b[15~": "f5",
|
|
287
|
-
"\x1b[17~": "f6",
|
|
288
|
-
"\x1b[18~": "f7",
|
|
289
|
-
"\x1b[19~": "f8",
|
|
290
|
-
"\x1b[20~": "f9",
|
|
291
|
-
"\x1b[21~": "f10",
|
|
292
|
-
"\x1b[23~": "f11",
|
|
293
|
-
"\x1b[24~": "f12",
|
|
294
|
-
"\x1bb": "alt+left",
|
|
295
|
-
"\x1bf": "alt+right",
|
|
296
|
-
"\x1bp": "alt+up",
|
|
297
|
-
"\x1bn": "alt+down",
|
|
188
|
+
/**
|
|
189
|
+
* Consolidated legacy terminal key sequences.
|
|
190
|
+
* Each key maps to its sequences for unmodified, shift-modified, and ctrl-modified variants.
|
|
191
|
+
* This single structure replaces three separate maps (LEGACY_KEY_SEQUENCES,
|
|
192
|
+
* LEGACY_SHIFT_SEQUENCES, LEGACY_CTRL_SEQUENCES) that shared the same key sets.
|
|
193
|
+
*/
|
|
194
|
+
const LEGACY_SEQUENCES = {
|
|
195
|
+
up: { plain: ["\x1b[A", "\x1bOA"], shift: ["\x1b[a"], ctrl: ["\x1bOa"] },
|
|
196
|
+
down: { plain: ["\x1b[B", "\x1bOB"], shift: ["\x1b[b"], ctrl: ["\x1bOb"] },
|
|
197
|
+
right: { plain: ["\x1b[C", "\x1bOC"], shift: ["\x1b[c"], ctrl: ["\x1bOc"] },
|
|
198
|
+
left: { plain: ["\x1b[D", "\x1bOD"], shift: ["\x1b[d"], ctrl: ["\x1bOd"] },
|
|
199
|
+
home: { plain: ["\x1b[H", "\x1bOH", "\x1b[1~", "\x1b[7~"], shift: ["\x1b[7$"], ctrl: ["\x1b[7^"] },
|
|
200
|
+
end: { plain: ["\x1b[F", "\x1bOF", "\x1b[4~", "\x1b[8~"], shift: ["\x1b[8$"], ctrl: ["\x1b[8^"] },
|
|
201
|
+
insert: { plain: ["\x1b[2~"], shift: ["\x1b[2$"], ctrl: ["\x1b[2^"] },
|
|
202
|
+
delete: { plain: ["\x1b[3~"], shift: ["\x1b[3$"], ctrl: ["\x1b[3^"] },
|
|
203
|
+
pageUp: { plain: ["\x1b[5~", "\x1b[[5~"], shift: ["\x1b[5$"], ctrl: ["\x1b[5^"] },
|
|
204
|
+
pageDown: { plain: ["\x1b[6~", "\x1b[[6~"], shift: ["\x1b[6$"], ctrl: ["\x1b[6^"] },
|
|
205
|
+
clear: { plain: ["\x1b[E", "\x1bOE"], shift: ["\x1b[e"], ctrl: ["\x1bOe"] },
|
|
206
|
+
f1: { plain: ["\x1bOP", "\x1b[11~", "\x1b[[A"] },
|
|
207
|
+
f2: { plain: ["\x1bOQ", "\x1b[12~", "\x1b[[B"] },
|
|
208
|
+
f3: { plain: ["\x1bOR", "\x1b[13~", "\x1b[[C"] },
|
|
209
|
+
f4: { plain: ["\x1bOS", "\x1b[14~", "\x1b[[D"] },
|
|
210
|
+
f5: { plain: ["\x1b[15~", "\x1b[[E"] },
|
|
211
|
+
f6: { plain: ["\x1b[17~"] },
|
|
212
|
+
f7: { plain: ["\x1b[18~"] },
|
|
213
|
+
f8: { plain: ["\x1b[19~"] },
|
|
214
|
+
f9: { plain: ["\x1b[20~"] },
|
|
215
|
+
f10: { plain: ["\x1b[21~"] },
|
|
216
|
+
f11: { plain: ["\x1b[23~"] },
|
|
217
|
+
f12: { plain: ["\x1b[24~"] },
|
|
298
218
|
};
|
|
219
|
+
/**
|
|
220
|
+
* Reverse lookup from escape sequence to key identifier, auto-generated from LEGACY_SEQUENCES.
|
|
221
|
+
* Additional non-standard sequences (alt+arrow aliases) are appended after generation.
|
|
222
|
+
*/
|
|
223
|
+
const LEGACY_SEQUENCE_KEY_IDS = (() => {
|
|
224
|
+
const map = {};
|
|
225
|
+
for (const [key, entry] of Object.entries(LEGACY_SEQUENCES)) {
|
|
226
|
+
const keyId = key;
|
|
227
|
+
if (entry.plain) {
|
|
228
|
+
for (const seq of entry.plain)
|
|
229
|
+
map[seq] = keyId;
|
|
230
|
+
}
|
|
231
|
+
if (entry.shift) {
|
|
232
|
+
for (const seq of entry.shift)
|
|
233
|
+
map[seq] = `shift+${keyId}`;
|
|
234
|
+
}
|
|
235
|
+
if (entry.ctrl) {
|
|
236
|
+
for (const seq of entry.ctrl)
|
|
237
|
+
map[seq] = `ctrl+${keyId}`;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
// Non-standard alt+arrow aliases not derivable from the table
|
|
241
|
+
map["\x1bb"] = "alt+left";
|
|
242
|
+
map["\x1bf"] = "alt+right";
|
|
243
|
+
map["\x1bp"] = "alt+up";
|
|
244
|
+
map["\x1bn"] = "alt+down";
|
|
245
|
+
return map;
|
|
246
|
+
})();
|
|
299
247
|
const matchesLegacySequence = (data, sequences) => sequences.includes(data);
|
|
300
248
|
const matchesLegacyModifierSequence = (data, key, modifier) => {
|
|
301
|
-
|
|
302
|
-
|
|
249
|
+
const entry = LEGACY_SEQUENCES[key];
|
|
250
|
+
if (!entry)
|
|
251
|
+
return false;
|
|
252
|
+
if (modifier === MODIFIERS.shift && entry.shift) {
|
|
253
|
+
return matchesLegacySequence(data, entry.shift);
|
|
303
254
|
}
|
|
304
|
-
if (modifier === MODIFIERS.ctrl) {
|
|
305
|
-
return matchesLegacySequence(data,
|
|
255
|
+
if (modifier === MODIFIERS.ctrl && entry.ctrl) {
|
|
256
|
+
return matchesLegacySequence(data, entry.ctrl);
|
|
306
257
|
}
|
|
307
258
|
return false;
|
|
308
259
|
};
|
|
309
260
|
// Store the last parsed event type for isKeyRelease() to query
|
|
310
261
|
let _lastEventType = "press";
|
|
311
262
|
/**
|
|
312
|
-
* Check if
|
|
313
|
-
*
|
|
263
|
+
* Check if input data contains a Kitty event type marker.
|
|
264
|
+
* Event type markers appear as ":<eventType>" followed by a sequence terminator (u, ~, A-D, H, F).
|
|
265
|
+
* Ignores bracketed paste content which may contain similar patterns.
|
|
314
266
|
*/
|
|
315
|
-
|
|
316
|
-
// Don't treat bracketed paste content as key release, even if it contains
|
|
317
|
-
// patterns like ":3F" (e.g., bluetooth MAC addresses like "90:62:3F:A5").
|
|
318
|
-
// Terminal.ts re-wraps paste content with bracketed paste markers before
|
|
319
|
-
// passing to TUI, so pasted data will always contain \x1b[200~.
|
|
267
|
+
function hasKittyEventType(data, eventType) {
|
|
320
268
|
if (data.includes("\x1b[200~")) {
|
|
321
269
|
return false;
|
|
322
270
|
}
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
data.includes(
|
|
327
|
-
data.includes(
|
|
328
|
-
data.includes(
|
|
329
|
-
data.includes(
|
|
330
|
-
data.includes(
|
|
331
|
-
data.includes(
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
return false;
|
|
271
|
+
const marker = `:${eventType}`;
|
|
272
|
+
return (data.includes(`${marker}u`) ||
|
|
273
|
+
data.includes(`${marker}~`) ||
|
|
274
|
+
data.includes(`${marker}A`) ||
|
|
275
|
+
data.includes(`${marker}B`) ||
|
|
276
|
+
data.includes(`${marker}C`) ||
|
|
277
|
+
data.includes(`${marker}D`) ||
|
|
278
|
+
data.includes(`${marker}H`) ||
|
|
279
|
+
data.includes(`${marker}F`));
|
|
280
|
+
}
|
|
281
|
+
export function isKeyRelease(data) {
|
|
282
|
+
return hasKittyEventType(data, 3);
|
|
336
283
|
}
|
|
337
284
|
/**
|
|
338
285
|
* Check if the last parsed key event was a key repeat.
|
|
339
286
|
* Only meaningful when Kitty keyboard protocol with flag 2 is active.
|
|
340
287
|
*/
|
|
341
288
|
export function isKeyRepeat(data) {
|
|
342
|
-
|
|
343
|
-
// patterns like ":2F". See isKeyRelease() for details.
|
|
344
|
-
if (data.includes("\x1b[200~")) {
|
|
345
|
-
return false;
|
|
346
|
-
}
|
|
347
|
-
if (data.includes(":2u") ||
|
|
348
|
-
data.includes(":2~") ||
|
|
349
|
-
data.includes(":2A") ||
|
|
350
|
-
data.includes(":2B") ||
|
|
351
|
-
data.includes(":2C") ||
|
|
352
|
-
data.includes(":2D") ||
|
|
353
|
-
data.includes(":2H") ||
|
|
354
|
-
data.includes(":2F")) {
|
|
355
|
-
return true;
|
|
356
|
-
}
|
|
357
|
-
return false;
|
|
289
|
+
return hasKittyEventType(data, 2);
|
|
358
290
|
}
|
|
359
291
|
function parseEventType(eventTypeStr) {
|
|
360
292
|
if (!eventTypeStr)
|
|
@@ -652,7 +584,7 @@ export function matchesKey(data, keyId) {
|
|
|
652
584
|
return matchesKittySequence(data, CODEPOINTS.backspace, modifier);
|
|
653
585
|
case "insert":
|
|
654
586
|
if (modifier === 0) {
|
|
655
|
-
return (matchesLegacySequence(data,
|
|
587
|
+
return (matchesLegacySequence(data, LEGACY_SEQUENCES.insert.plain) ||
|
|
656
588
|
matchesKittySequence(data, FUNCTIONAL_CODEPOINTS.insert, 0));
|
|
657
589
|
}
|
|
658
590
|
if (matchesLegacyModifierSequence(data, "insert", modifier)) {
|
|
@@ -661,7 +593,7 @@ export function matchesKey(data, keyId) {
|
|
|
661
593
|
return matchesKittySequence(data, FUNCTIONAL_CODEPOINTS.insert, modifier);
|
|
662
594
|
case "delete":
|
|
663
595
|
if (modifier === 0) {
|
|
664
|
-
return (matchesLegacySequence(data,
|
|
596
|
+
return (matchesLegacySequence(data, LEGACY_SEQUENCES.delete.plain) ||
|
|
665
597
|
matchesKittySequence(data, FUNCTIONAL_CODEPOINTS.delete, 0));
|
|
666
598
|
}
|
|
667
599
|
if (matchesLegacyModifierSequence(data, "delete", modifier)) {
|
|
@@ -670,12 +602,12 @@ export function matchesKey(data, keyId) {
|
|
|
670
602
|
return matchesKittySequence(data, FUNCTIONAL_CODEPOINTS.delete, modifier);
|
|
671
603
|
case "clear":
|
|
672
604
|
if (modifier === 0) {
|
|
673
|
-
return matchesLegacySequence(data,
|
|
605
|
+
return matchesLegacySequence(data, LEGACY_SEQUENCES.clear.plain);
|
|
674
606
|
}
|
|
675
607
|
return matchesLegacyModifierSequence(data, "clear", modifier);
|
|
676
608
|
case "home":
|
|
677
609
|
if (modifier === 0) {
|
|
678
|
-
return (matchesLegacySequence(data,
|
|
610
|
+
return (matchesLegacySequence(data, LEGACY_SEQUENCES.home.plain) ||
|
|
679
611
|
matchesKittySequence(data, FUNCTIONAL_CODEPOINTS.home, 0));
|
|
680
612
|
}
|
|
681
613
|
if (matchesLegacyModifierSequence(data, "home", modifier)) {
|
|
@@ -684,7 +616,7 @@ export function matchesKey(data, keyId) {
|
|
|
684
616
|
return matchesKittySequence(data, FUNCTIONAL_CODEPOINTS.home, modifier);
|
|
685
617
|
case "end":
|
|
686
618
|
if (modifier === 0) {
|
|
687
|
-
return (matchesLegacySequence(data,
|
|
619
|
+
return (matchesLegacySequence(data, LEGACY_SEQUENCES.end.plain) ||
|
|
688
620
|
matchesKittySequence(data, FUNCTIONAL_CODEPOINTS.end, 0));
|
|
689
621
|
}
|
|
690
622
|
if (matchesLegacyModifierSequence(data, "end", modifier)) {
|
|
@@ -693,7 +625,7 @@ export function matchesKey(data, keyId) {
|
|
|
693
625
|
return matchesKittySequence(data, FUNCTIONAL_CODEPOINTS.end, modifier);
|
|
694
626
|
case "pageup":
|
|
695
627
|
if (modifier === 0) {
|
|
696
|
-
return (matchesLegacySequence(data,
|
|
628
|
+
return (matchesLegacySequence(data, LEGACY_SEQUENCES.pageUp.plain) ||
|
|
697
629
|
matchesKittySequence(data, FUNCTIONAL_CODEPOINTS.pageUp, 0));
|
|
698
630
|
}
|
|
699
631
|
if (matchesLegacyModifierSequence(data, "pageUp", modifier)) {
|
|
@@ -702,7 +634,7 @@ export function matchesKey(data, keyId) {
|
|
|
702
634
|
return matchesKittySequence(data, FUNCTIONAL_CODEPOINTS.pageUp, modifier);
|
|
703
635
|
case "pagedown":
|
|
704
636
|
if (modifier === 0) {
|
|
705
|
-
return (matchesLegacySequence(data,
|
|
637
|
+
return (matchesLegacySequence(data, LEGACY_SEQUENCES.pageDown.plain) ||
|
|
706
638
|
matchesKittySequence(data, FUNCTIONAL_CODEPOINTS.pageDown, 0));
|
|
707
639
|
}
|
|
708
640
|
if (matchesLegacyModifierSequence(data, "pageDown", modifier)) {
|
|
@@ -714,7 +646,7 @@ export function matchesKey(data, keyId) {
|
|
|
714
646
|
return data === "\x1bp" || matchesKittySequence(data, ARROW_CODEPOINTS.up, MODIFIERS.alt);
|
|
715
647
|
}
|
|
716
648
|
if (modifier === 0) {
|
|
717
|
-
return (matchesLegacySequence(data,
|
|
649
|
+
return (matchesLegacySequence(data, LEGACY_SEQUENCES.up.plain) ||
|
|
718
650
|
matchesKittySequence(data, ARROW_CODEPOINTS.up, 0));
|
|
719
651
|
}
|
|
720
652
|
if (matchesLegacyModifierSequence(data, "up", modifier)) {
|
|
@@ -726,7 +658,7 @@ export function matchesKey(data, keyId) {
|
|
|
726
658
|
return data === "\x1bn" || matchesKittySequence(data, ARROW_CODEPOINTS.down, MODIFIERS.alt);
|
|
727
659
|
}
|
|
728
660
|
if (modifier === 0) {
|
|
729
|
-
return (matchesLegacySequence(data,
|
|
661
|
+
return (matchesLegacySequence(data, LEGACY_SEQUENCES.down.plain) ||
|
|
730
662
|
matchesKittySequence(data, ARROW_CODEPOINTS.down, 0));
|
|
731
663
|
}
|
|
732
664
|
if (matchesLegacyModifierSequence(data, "down", modifier)) {
|
|
@@ -746,7 +678,7 @@ export function matchesKey(data, keyId) {
|
|
|
746
678
|
matchesKittySequence(data, ARROW_CODEPOINTS.left, MODIFIERS.ctrl));
|
|
747
679
|
}
|
|
748
680
|
if (modifier === 0) {
|
|
749
|
-
return (matchesLegacySequence(data,
|
|
681
|
+
return (matchesLegacySequence(data, LEGACY_SEQUENCES.left.plain) ||
|
|
750
682
|
matchesKittySequence(data, ARROW_CODEPOINTS.left, 0));
|
|
751
683
|
}
|
|
752
684
|
if (matchesLegacyModifierSequence(data, "left", modifier)) {
|
|
@@ -766,7 +698,7 @@ export function matchesKey(data, keyId) {
|
|
|
766
698
|
matchesKittySequence(data, ARROW_CODEPOINTS.right, MODIFIERS.ctrl));
|
|
767
699
|
}
|
|
768
700
|
if (modifier === 0) {
|
|
769
|
-
return (matchesLegacySequence(data,
|
|
701
|
+
return (matchesLegacySequence(data, LEGACY_SEQUENCES.right.plain) ||
|
|
770
702
|
matchesKittySequence(data, ARROW_CODEPOINTS.right, 0));
|
|
771
703
|
}
|
|
772
704
|
if (matchesLegacyModifierSequence(data, "right", modifier)) {
|
|
@@ -789,7 +721,7 @@ export function matchesKey(data, keyId) {
|
|
|
789
721
|
return false;
|
|
790
722
|
}
|
|
791
723
|
const functionKey = key;
|
|
792
|
-
return matchesLegacySequence(data,
|
|
724
|
+
return matchesLegacySequence(data, LEGACY_SEQUENCES[functionKey].plain);
|
|
793
725
|
}
|
|
794
726
|
}
|
|
795
727
|
// Handle single letter/digit keys and symbols
|