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
|
@@ -325,131 +325,74 @@ const FUNCTIONAL_CODEPOINTS = {
|
|
|
325
325
|
end: -15,
|
|
326
326
|
} as const;
|
|
327
327
|
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
left: ["\x1b[d"],
|
|
359
|
-
clear: ["\x1b[e"],
|
|
360
|
-
insert: ["\x1b[2$"],
|
|
361
|
-
delete: ["\x1b[3$"],
|
|
362
|
-
pageUp: ["\x1b[5$"],
|
|
363
|
-
pageDown: ["\x1b[6$"],
|
|
364
|
-
home: ["\x1b[7$"],
|
|
365
|
-
end: ["\x1b[8$"],
|
|
366
|
-
} as const;
|
|
367
|
-
|
|
368
|
-
const LEGACY_CTRL_SEQUENCES = {
|
|
369
|
-
up: ["\x1bOa"],
|
|
370
|
-
down: ["\x1bOb"],
|
|
371
|
-
right: ["\x1bOc"],
|
|
372
|
-
left: ["\x1bOd"],
|
|
373
|
-
clear: ["\x1bOe"],
|
|
374
|
-
insert: ["\x1b[2^"],
|
|
375
|
-
delete: ["\x1b[3^"],
|
|
376
|
-
pageUp: ["\x1b[5^"],
|
|
377
|
-
pageDown: ["\x1b[6^"],
|
|
378
|
-
home: ["\x1b[7^"],
|
|
379
|
-
end: ["\x1b[8^"],
|
|
380
|
-
} as const;
|
|
381
|
-
|
|
382
|
-
const LEGACY_SEQUENCE_KEY_IDS: Record<string, KeyId> = {
|
|
383
|
-
"\x1bOA": "up",
|
|
384
|
-
"\x1bOB": "down",
|
|
385
|
-
"\x1bOC": "right",
|
|
386
|
-
"\x1bOD": "left",
|
|
387
|
-
"\x1bOH": "home",
|
|
388
|
-
"\x1bOF": "end",
|
|
389
|
-
"\x1b[E": "clear",
|
|
390
|
-
"\x1bOE": "clear",
|
|
391
|
-
"\x1bOe": "ctrl+clear",
|
|
392
|
-
"\x1b[e": "shift+clear",
|
|
393
|
-
"\x1b[2~": "insert",
|
|
394
|
-
"\x1b[2$": "shift+insert",
|
|
395
|
-
"\x1b[2^": "ctrl+insert",
|
|
396
|
-
"\x1b[3$": "shift+delete",
|
|
397
|
-
"\x1b[3^": "ctrl+delete",
|
|
398
|
-
"\x1b[[5~": "pageUp",
|
|
399
|
-
"\x1b[[6~": "pageDown",
|
|
400
|
-
"\x1b[a": "shift+up",
|
|
401
|
-
"\x1b[b": "shift+down",
|
|
402
|
-
"\x1b[c": "shift+right",
|
|
403
|
-
"\x1b[d": "shift+left",
|
|
404
|
-
"\x1bOa": "ctrl+up",
|
|
405
|
-
"\x1bOb": "ctrl+down",
|
|
406
|
-
"\x1bOc": "ctrl+right",
|
|
407
|
-
"\x1bOd": "ctrl+left",
|
|
408
|
-
"\x1b[5$": "shift+pageUp",
|
|
409
|
-
"\x1b[6$": "shift+pageDown",
|
|
410
|
-
"\x1b[7$": "shift+home",
|
|
411
|
-
"\x1b[8$": "shift+end",
|
|
412
|
-
"\x1b[5^": "ctrl+pageUp",
|
|
413
|
-
"\x1b[6^": "ctrl+pageDown",
|
|
414
|
-
"\x1b[7^": "ctrl+home",
|
|
415
|
-
"\x1b[8^": "ctrl+end",
|
|
416
|
-
"\x1bOP": "f1",
|
|
417
|
-
"\x1bOQ": "f2",
|
|
418
|
-
"\x1bOR": "f3",
|
|
419
|
-
"\x1bOS": "f4",
|
|
420
|
-
"\x1b[11~": "f1",
|
|
421
|
-
"\x1b[12~": "f2",
|
|
422
|
-
"\x1b[13~": "f3",
|
|
423
|
-
"\x1b[14~": "f4",
|
|
424
|
-
"\x1b[[A": "f1",
|
|
425
|
-
"\x1b[[B": "f2",
|
|
426
|
-
"\x1b[[C": "f3",
|
|
427
|
-
"\x1b[[D": "f4",
|
|
428
|
-
"\x1b[[E": "f5",
|
|
429
|
-
"\x1b[15~": "f5",
|
|
430
|
-
"\x1b[17~": "f6",
|
|
431
|
-
"\x1b[18~": "f7",
|
|
432
|
-
"\x1b[19~": "f8",
|
|
433
|
-
"\x1b[20~": "f9",
|
|
434
|
-
"\x1b[21~": "f10",
|
|
435
|
-
"\x1b[23~": "f11",
|
|
436
|
-
"\x1b[24~": "f12",
|
|
437
|
-
"\x1bb": "alt+left",
|
|
438
|
-
"\x1bf": "alt+right",
|
|
439
|
-
"\x1bp": "alt+up",
|
|
440
|
-
"\x1bn": "alt+down",
|
|
328
|
+
/**
|
|
329
|
+
* Consolidated legacy terminal key sequences.
|
|
330
|
+
* Each key maps to its sequences for unmodified, shift-modified, and ctrl-modified variants.
|
|
331
|
+
* This single structure replaces three separate maps (LEGACY_KEY_SEQUENCES,
|
|
332
|
+
* LEGACY_SHIFT_SEQUENCES, LEGACY_CTRL_SEQUENCES) that shared the same key sets.
|
|
333
|
+
*/
|
|
334
|
+
const LEGACY_SEQUENCES: Record<string, { plain?: readonly string[]; shift?: readonly string[]; ctrl?: readonly string[] }> = {
|
|
335
|
+
up: { plain: ["\x1b[A", "\x1bOA"], shift: ["\x1b[a"], ctrl: ["\x1bOa"] },
|
|
336
|
+
down: { plain: ["\x1b[B", "\x1bOB"], shift: ["\x1b[b"], ctrl: ["\x1bOb"] },
|
|
337
|
+
right: { plain: ["\x1b[C", "\x1bOC"], shift: ["\x1b[c"], ctrl: ["\x1bOc"] },
|
|
338
|
+
left: { plain: ["\x1b[D", "\x1bOD"], shift: ["\x1b[d"], ctrl: ["\x1bOd"] },
|
|
339
|
+
home: { plain: ["\x1b[H", "\x1bOH", "\x1b[1~", "\x1b[7~"], shift: ["\x1b[7$"], ctrl: ["\x1b[7^"] },
|
|
340
|
+
end: { plain: ["\x1b[F", "\x1bOF", "\x1b[4~", "\x1b[8~"], shift: ["\x1b[8$"], ctrl: ["\x1b[8^"] },
|
|
341
|
+
insert: { plain: ["\x1b[2~"], shift: ["\x1b[2$"], ctrl: ["\x1b[2^"] },
|
|
342
|
+
delete: { plain: ["\x1b[3~"], shift: ["\x1b[3$"], ctrl: ["\x1b[3^"] },
|
|
343
|
+
pageUp: { plain: ["\x1b[5~", "\x1b[[5~"], shift: ["\x1b[5$"], ctrl: ["\x1b[5^"] },
|
|
344
|
+
pageDown: { plain: ["\x1b[6~", "\x1b[[6~"], shift: ["\x1b[6$"], ctrl: ["\x1b[6^"] },
|
|
345
|
+
clear: { plain: ["\x1b[E", "\x1bOE"], shift: ["\x1b[e"], ctrl: ["\x1bOe"] },
|
|
346
|
+
f1: { plain: ["\x1bOP", "\x1b[11~", "\x1b[[A"] },
|
|
347
|
+
f2: { plain: ["\x1bOQ", "\x1b[12~", "\x1b[[B"] },
|
|
348
|
+
f3: { plain: ["\x1bOR", "\x1b[13~", "\x1b[[C"] },
|
|
349
|
+
f4: { plain: ["\x1bOS", "\x1b[14~", "\x1b[[D"] },
|
|
350
|
+
f5: { plain: ["\x1b[15~", "\x1b[[E"] },
|
|
351
|
+
f6: { plain: ["\x1b[17~"] },
|
|
352
|
+
f7: { plain: ["\x1b[18~"] },
|
|
353
|
+
f8: { plain: ["\x1b[19~"] },
|
|
354
|
+
f9: { plain: ["\x1b[20~"] },
|
|
355
|
+
f10: { plain: ["\x1b[21~"] },
|
|
356
|
+
f11: { plain: ["\x1b[23~"] },
|
|
357
|
+
f12: { plain: ["\x1b[24~"] },
|
|
441
358
|
} as const;
|
|
442
359
|
|
|
443
|
-
|
|
360
|
+
/**
|
|
361
|
+
* Reverse lookup from escape sequence to key identifier, auto-generated from LEGACY_SEQUENCES.
|
|
362
|
+
* Additional non-standard sequences (alt+arrow aliases) are appended after generation.
|
|
363
|
+
*/
|
|
364
|
+
const LEGACY_SEQUENCE_KEY_IDS: Record<string, KeyId> = (() => {
|
|
365
|
+
const map: Record<string, KeyId> = {};
|
|
366
|
+
for (const [key, entry] of Object.entries(LEGACY_SEQUENCES)) {
|
|
367
|
+
const keyId = key as KeyId;
|
|
368
|
+
if (entry.plain) {
|
|
369
|
+
for (const seq of entry.plain) map[seq] = keyId;
|
|
370
|
+
}
|
|
371
|
+
if (entry.shift) {
|
|
372
|
+
for (const seq of entry.shift) map[seq] = `shift+${keyId}` as KeyId;
|
|
373
|
+
}
|
|
374
|
+
if (entry.ctrl) {
|
|
375
|
+
for (const seq of entry.ctrl) map[seq] = `ctrl+${keyId}` as KeyId;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
// Non-standard alt+arrow aliases not derivable from the table
|
|
379
|
+
map["\x1bb"] = "alt+left";
|
|
380
|
+
map["\x1bf"] = "alt+right";
|
|
381
|
+
map["\x1bp"] = "alt+up";
|
|
382
|
+
map["\x1bn"] = "alt+down";
|
|
383
|
+
return map;
|
|
384
|
+
})();
|
|
444
385
|
|
|
445
386
|
const matchesLegacySequence = (data: string, sequences: readonly string[]): boolean => sequences.includes(data);
|
|
446
387
|
|
|
447
|
-
const matchesLegacyModifierSequence = (data: string, key:
|
|
448
|
-
|
|
449
|
-
|
|
388
|
+
const matchesLegacyModifierSequence = (data: string, key: string, modifier: number): boolean => {
|
|
389
|
+
const entry = LEGACY_SEQUENCES[key];
|
|
390
|
+
if (!entry) return false;
|
|
391
|
+
if (modifier === MODIFIERS.shift && entry.shift) {
|
|
392
|
+
return matchesLegacySequence(data, entry.shift);
|
|
450
393
|
}
|
|
451
|
-
if (modifier === MODIFIERS.ctrl) {
|
|
452
|
-
return matchesLegacySequence(data,
|
|
394
|
+
if (modifier === MODIFIERS.ctrl && entry.ctrl) {
|
|
395
|
+
return matchesLegacySequence(data, entry.ctrl);
|
|
453
396
|
}
|
|
454
397
|
return false;
|
|
455
398
|
};
|
|
@@ -481,33 +424,29 @@ interface ParsedModifyOtherKeysSequence {
|
|
|
481
424
|
let _lastEventType: KeyEventType = "press";
|
|
482
425
|
|
|
483
426
|
/**
|
|
484
|
-
* Check if
|
|
485
|
-
*
|
|
427
|
+
* Check if input data contains a Kitty event type marker.
|
|
428
|
+
* Event type markers appear as ":<eventType>" followed by a sequence terminator (u, ~, A-D, H, F).
|
|
429
|
+
* Ignores bracketed paste content which may contain similar patterns.
|
|
486
430
|
*/
|
|
487
|
-
|
|
488
|
-
// Don't treat bracketed paste content as key release, even if it contains
|
|
489
|
-
// patterns like ":3F" (e.g., bluetooth MAC addresses like "90:62:3F:A5").
|
|
490
|
-
// Terminal.ts re-wraps paste content with bracketed paste markers before
|
|
491
|
-
// passing to TUI, so pasted data will always contain \x1b[200~.
|
|
431
|
+
function hasKittyEventType(data: string, eventType: number): boolean {
|
|
492
432
|
if (data.includes("\x1b[200~")) {
|
|
493
433
|
return false;
|
|
494
434
|
}
|
|
435
|
+
const marker = `:${eventType}`;
|
|
436
|
+
return (
|
|
437
|
+
data.includes(`${marker}u`) ||
|
|
438
|
+
data.includes(`${marker}~`) ||
|
|
439
|
+
data.includes(`${marker}A`) ||
|
|
440
|
+
data.includes(`${marker}B`) ||
|
|
441
|
+
data.includes(`${marker}C`) ||
|
|
442
|
+
data.includes(`${marker}D`) ||
|
|
443
|
+
data.includes(`${marker}H`) ||
|
|
444
|
+
data.includes(`${marker}F`)
|
|
445
|
+
);
|
|
446
|
+
}
|
|
495
447
|
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
if (
|
|
499
|
-
data.includes(":3u") ||
|
|
500
|
-
data.includes(":3~") ||
|
|
501
|
-
data.includes(":3A") ||
|
|
502
|
-
data.includes(":3B") ||
|
|
503
|
-
data.includes(":3C") ||
|
|
504
|
-
data.includes(":3D") ||
|
|
505
|
-
data.includes(":3H") ||
|
|
506
|
-
data.includes(":3F")
|
|
507
|
-
) {
|
|
508
|
-
return true;
|
|
509
|
-
}
|
|
510
|
-
return false;
|
|
448
|
+
export function isKeyRelease(data: string): boolean {
|
|
449
|
+
return hasKittyEventType(data, 3);
|
|
511
450
|
}
|
|
512
451
|
|
|
513
452
|
/**
|
|
@@ -515,25 +454,7 @@ export function isKeyRelease(data: string): boolean {
|
|
|
515
454
|
* Only meaningful when Kitty keyboard protocol with flag 2 is active.
|
|
516
455
|
*/
|
|
517
456
|
export function isKeyRepeat(data: string): boolean {
|
|
518
|
-
|
|
519
|
-
// patterns like ":2F". See isKeyRelease() for details.
|
|
520
|
-
if (data.includes("\x1b[200~")) {
|
|
521
|
-
return false;
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
if (
|
|
525
|
-
data.includes(":2u") ||
|
|
526
|
-
data.includes(":2~") ||
|
|
527
|
-
data.includes(":2A") ||
|
|
528
|
-
data.includes(":2B") ||
|
|
529
|
-
data.includes(":2C") ||
|
|
530
|
-
data.includes(":2D") ||
|
|
531
|
-
data.includes(":2H") ||
|
|
532
|
-
data.includes(":2F")
|
|
533
|
-
) {
|
|
534
|
-
return true;
|
|
535
|
-
}
|
|
536
|
-
return false;
|
|
457
|
+
return hasKittyEventType(data, 2);
|
|
537
458
|
}
|
|
538
459
|
|
|
539
460
|
function parseEventType(eventTypeStr: string | undefined): KeyEventType {
|
|
@@ -847,7 +768,7 @@ export function matchesKey(data: string, keyId: KeyId): boolean {
|
|
|
847
768
|
case "insert":
|
|
848
769
|
if (modifier === 0) {
|
|
849
770
|
return (
|
|
850
|
-
matchesLegacySequence(data,
|
|
771
|
+
matchesLegacySequence(data, LEGACY_SEQUENCES.insert.plain!) ||
|
|
851
772
|
matchesKittySequence(data, FUNCTIONAL_CODEPOINTS.insert, 0)
|
|
852
773
|
);
|
|
853
774
|
}
|
|
@@ -859,7 +780,7 @@ export function matchesKey(data: string, keyId: KeyId): boolean {
|
|
|
859
780
|
case "delete":
|
|
860
781
|
if (modifier === 0) {
|
|
861
782
|
return (
|
|
862
|
-
matchesLegacySequence(data,
|
|
783
|
+
matchesLegacySequence(data, LEGACY_SEQUENCES.delete.plain!) ||
|
|
863
784
|
matchesKittySequence(data, FUNCTIONAL_CODEPOINTS.delete, 0)
|
|
864
785
|
);
|
|
865
786
|
}
|
|
@@ -870,14 +791,14 @@ export function matchesKey(data: string, keyId: KeyId): boolean {
|
|
|
870
791
|
|
|
871
792
|
case "clear":
|
|
872
793
|
if (modifier === 0) {
|
|
873
|
-
return matchesLegacySequence(data,
|
|
794
|
+
return matchesLegacySequence(data, LEGACY_SEQUENCES.clear.plain!);
|
|
874
795
|
}
|
|
875
796
|
return matchesLegacyModifierSequence(data, "clear", modifier);
|
|
876
797
|
|
|
877
798
|
case "home":
|
|
878
799
|
if (modifier === 0) {
|
|
879
800
|
return (
|
|
880
|
-
matchesLegacySequence(data,
|
|
801
|
+
matchesLegacySequence(data, LEGACY_SEQUENCES.home.plain!) ||
|
|
881
802
|
matchesKittySequence(data, FUNCTIONAL_CODEPOINTS.home, 0)
|
|
882
803
|
);
|
|
883
804
|
}
|
|
@@ -889,7 +810,7 @@ export function matchesKey(data: string, keyId: KeyId): boolean {
|
|
|
889
810
|
case "end":
|
|
890
811
|
if (modifier === 0) {
|
|
891
812
|
return (
|
|
892
|
-
matchesLegacySequence(data,
|
|
813
|
+
matchesLegacySequence(data, LEGACY_SEQUENCES.end.plain!) ||
|
|
893
814
|
matchesKittySequence(data, FUNCTIONAL_CODEPOINTS.end, 0)
|
|
894
815
|
);
|
|
895
816
|
}
|
|
@@ -901,7 +822,7 @@ export function matchesKey(data: string, keyId: KeyId): boolean {
|
|
|
901
822
|
case "pageup":
|
|
902
823
|
if (modifier === 0) {
|
|
903
824
|
return (
|
|
904
|
-
matchesLegacySequence(data,
|
|
825
|
+
matchesLegacySequence(data, LEGACY_SEQUENCES.pageUp.plain!) ||
|
|
905
826
|
matchesKittySequence(data, FUNCTIONAL_CODEPOINTS.pageUp, 0)
|
|
906
827
|
);
|
|
907
828
|
}
|
|
@@ -913,7 +834,7 @@ export function matchesKey(data: string, keyId: KeyId): boolean {
|
|
|
913
834
|
case "pagedown":
|
|
914
835
|
if (modifier === 0) {
|
|
915
836
|
return (
|
|
916
|
-
matchesLegacySequence(data,
|
|
837
|
+
matchesLegacySequence(data, LEGACY_SEQUENCES.pageDown.plain!) ||
|
|
917
838
|
matchesKittySequence(data, FUNCTIONAL_CODEPOINTS.pageDown, 0)
|
|
918
839
|
);
|
|
919
840
|
}
|
|
@@ -928,7 +849,7 @@ export function matchesKey(data: string, keyId: KeyId): boolean {
|
|
|
928
849
|
}
|
|
929
850
|
if (modifier === 0) {
|
|
930
851
|
return (
|
|
931
|
-
matchesLegacySequence(data,
|
|
852
|
+
matchesLegacySequence(data, LEGACY_SEQUENCES.up.plain!) ||
|
|
932
853
|
matchesKittySequence(data, ARROW_CODEPOINTS.up, 0)
|
|
933
854
|
);
|
|
934
855
|
}
|
|
@@ -943,7 +864,7 @@ export function matchesKey(data: string, keyId: KeyId): boolean {
|
|
|
943
864
|
}
|
|
944
865
|
if (modifier === 0) {
|
|
945
866
|
return (
|
|
946
|
-
matchesLegacySequence(data,
|
|
867
|
+
matchesLegacySequence(data, LEGACY_SEQUENCES.down.plain!) ||
|
|
947
868
|
matchesKittySequence(data, ARROW_CODEPOINTS.down, 0)
|
|
948
869
|
);
|
|
949
870
|
}
|
|
@@ -970,7 +891,7 @@ export function matchesKey(data: string, keyId: KeyId): boolean {
|
|
|
970
891
|
}
|
|
971
892
|
if (modifier === 0) {
|
|
972
893
|
return (
|
|
973
|
-
matchesLegacySequence(data,
|
|
894
|
+
matchesLegacySequence(data, LEGACY_SEQUENCES.left.plain!) ||
|
|
974
895
|
matchesKittySequence(data, ARROW_CODEPOINTS.left, 0)
|
|
975
896
|
);
|
|
976
897
|
}
|
|
@@ -997,7 +918,7 @@ export function matchesKey(data: string, keyId: KeyId): boolean {
|
|
|
997
918
|
}
|
|
998
919
|
if (modifier === 0) {
|
|
999
920
|
return (
|
|
1000
|
-
matchesLegacySequence(data,
|
|
921
|
+
matchesLegacySequence(data, LEGACY_SEQUENCES.right.plain!) ||
|
|
1001
922
|
matchesKittySequence(data, ARROW_CODEPOINTS.right, 0)
|
|
1002
923
|
);
|
|
1003
924
|
}
|
|
@@ -1021,8 +942,8 @@ export function matchesKey(data: string, keyId: KeyId): boolean {
|
|
|
1021
942
|
if (modifier !== 0) {
|
|
1022
943
|
return false;
|
|
1023
944
|
}
|
|
1024
|
-
const functionKey = key as keyof typeof
|
|
1025
|
-
return matchesLegacySequence(data,
|
|
945
|
+
const functionKey = key as keyof typeof LEGACY_SEQUENCES;
|
|
946
|
+
return matchesLegacySequence(data, LEGACY_SEQUENCES[functionKey]!.plain!);
|
|
1026
947
|
}
|
|
1027
948
|
}
|
|
1028
949
|
|
|
@@ -1,4 +1,69 @@
|
|
|
1
1
|
import type { EditorTheme, MarkdownTheme, SelectListTheme } from "@gsd/pi-tui";
|
|
2
|
+
import { type Static } from "@sinclair/typebox";
|
|
3
|
+
declare const ThemeJsonSchema: import("@sinclair/typebox").TObject<{
|
|
4
|
+
$schema: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
5
|
+
name: import("@sinclair/typebox").TString;
|
|
6
|
+
vars: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>>>;
|
|
7
|
+
colors: import("@sinclair/typebox").TObject<{
|
|
8
|
+
accent: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>;
|
|
9
|
+
border: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>;
|
|
10
|
+
borderAccent: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>;
|
|
11
|
+
borderMuted: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>;
|
|
12
|
+
success: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>;
|
|
13
|
+
error: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>;
|
|
14
|
+
warning: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>;
|
|
15
|
+
muted: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>;
|
|
16
|
+
dim: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>;
|
|
17
|
+
text: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>;
|
|
18
|
+
thinkingText: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>;
|
|
19
|
+
selectedBg: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>;
|
|
20
|
+
userMessageBg: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>;
|
|
21
|
+
userMessageText: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>;
|
|
22
|
+
customMessageBg: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>;
|
|
23
|
+
customMessageText: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>;
|
|
24
|
+
customMessageLabel: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>;
|
|
25
|
+
toolPendingBg: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>;
|
|
26
|
+
toolSuccessBg: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>;
|
|
27
|
+
toolErrorBg: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>;
|
|
28
|
+
toolTitle: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>;
|
|
29
|
+
toolOutput: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>;
|
|
30
|
+
mdHeading: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>;
|
|
31
|
+
mdLink: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>;
|
|
32
|
+
mdLinkUrl: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>;
|
|
33
|
+
mdCode: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>;
|
|
34
|
+
mdCodeBlock: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>;
|
|
35
|
+
mdCodeBlockBorder: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>;
|
|
36
|
+
mdQuote: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>;
|
|
37
|
+
mdQuoteBorder: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>;
|
|
38
|
+
mdHr: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>;
|
|
39
|
+
mdListBullet: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>;
|
|
40
|
+
toolDiffAdded: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>;
|
|
41
|
+
toolDiffRemoved: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>;
|
|
42
|
+
toolDiffContext: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>;
|
|
43
|
+
syntaxComment: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>;
|
|
44
|
+
syntaxKeyword: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>;
|
|
45
|
+
syntaxFunction: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>;
|
|
46
|
+
syntaxVariable: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>;
|
|
47
|
+
syntaxString: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>;
|
|
48
|
+
syntaxNumber: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>;
|
|
49
|
+
syntaxType: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>;
|
|
50
|
+
syntaxOperator: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>;
|
|
51
|
+
syntaxPunctuation: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>;
|
|
52
|
+
thinkingOff: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>;
|
|
53
|
+
thinkingMinimal: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>;
|
|
54
|
+
thinkingLow: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>;
|
|
55
|
+
thinkingMedium: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>;
|
|
56
|
+
thinkingHigh: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>;
|
|
57
|
+
thinkingXhigh: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>;
|
|
58
|
+
bashMode: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>;
|
|
59
|
+
}>;
|
|
60
|
+
export: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
61
|
+
pageBg: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>>;
|
|
62
|
+
cardBg: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>>;
|
|
63
|
+
infoBg: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TInteger]>>;
|
|
64
|
+
}>>;
|
|
65
|
+
}>;
|
|
66
|
+
export type ThemeJson = Static<typeof ThemeJsonSchema>;
|
|
2
67
|
export type ThemeColor = "accent" | "border" | "borderAccent" | "borderMuted" | "success" | "error" | "warning" | "muted" | "dim" | "text" | "thinkingText" | "userMessageText" | "customMessageText" | "customMessageLabel" | "toolTitle" | "toolOutput" | "mdHeading" | "mdLink" | "mdLinkUrl" | "mdCode" | "mdCodeBlock" | "mdCodeBlockBorder" | "mdQuote" | "mdQuoteBorder" | "mdHr" | "mdListBullet" | "toolDiffAdded" | "toolDiffRemoved" | "toolDiffContext" | "syntaxComment" | "syntaxKeyword" | "syntaxFunction" | "syntaxVariable" | "syntaxString" | "syntaxNumber" | "syntaxType" | "syntaxOperator" | "syntaxPunctuation" | "thinkingOff" | "thinkingMinimal" | "thinkingLow" | "thinkingMedium" | "thinkingHigh" | "thinkingXhigh" | "bashMode";
|
|
3
68
|
export type ThemeBg = "selectedBg" | "userMessageBg" | "customMessageBg" | "toolPendingBg" | "toolSuccessBg" | "toolErrorBg";
|
|
4
69
|
type ColorMode = "truecolor" | "256color";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/theme/theme.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"theme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GAAG,MAAM,GAAG,SAAS,CAkExE;AAED,wBAAgB,gBAAgB,IAAI,aAAa,CA6BhD;AAED,wBAAgB,kBAAkB,IAAI,eAAe,CAQpD;AAED,wBAAgB,cAAc,IAAI,WAAW,CAK5C;AAED,wBAAgB,oBAAoB,IAAI,OAAO,aAAa,EAAE,iBAAiB,CAQ9E"}
|
|
@@ -4,7 +4,8 @@ import { Type } from "@sinclair/typebox";
|
|
|
4
4
|
import { TypeCompiler } from "@sinclair/typebox/compiler";
|
|
5
5
|
import chalk from "chalk";
|
|
6
6
|
import { highlightCode as nativeHighlightCode, supportsLanguage, } from "@gsd/native";
|
|
7
|
-
import { getCustomThemesDir
|
|
7
|
+
import { getCustomThemesDir } from "../../../config.js";
|
|
8
|
+
import { builtinThemes } from "./themes.js";
|
|
8
9
|
// Issue #453: native preview highlighting can wedge the entire interactive
|
|
9
10
|
// session after a successful file tool. Keep the safer plain-text path as the
|
|
10
11
|
// default and allow native highlighting only as an explicit opt-in.
|
|
@@ -335,18 +336,8 @@ export class Theme {
|
|
|
335
336
|
// ============================================================================
|
|
336
337
|
// Theme Loading
|
|
337
338
|
// ============================================================================
|
|
338
|
-
let BUILTIN_THEMES;
|
|
339
339
|
function getBuiltinThemes() {
|
|
340
|
-
|
|
341
|
-
const themesDir = getThemesDir();
|
|
342
|
-
const darkPath = path.join(themesDir, "dark.json");
|
|
343
|
-
const lightPath = path.join(themesDir, "light.json");
|
|
344
|
-
BUILTIN_THEMES = {
|
|
345
|
-
dark: JSON.parse(fs.readFileSync(darkPath, "utf-8")),
|
|
346
|
-
light: JSON.parse(fs.readFileSync(lightPath, "utf-8")),
|
|
347
|
-
};
|
|
348
|
-
}
|
|
349
|
-
return BUILTIN_THEMES;
|
|
340
|
+
return builtinThemes;
|
|
350
341
|
}
|
|
351
342
|
export function getAvailableThemes() {
|
|
352
343
|
const themes = new Set(Object.keys(getBuiltinThemes()));
|
|
@@ -365,12 +356,11 @@ export function getAvailableThemes() {
|
|
|
365
356
|
return Array.from(themes).sort();
|
|
366
357
|
}
|
|
367
358
|
export function getAvailableThemesWithPaths() {
|
|
368
|
-
const themesDir = getThemesDir();
|
|
369
359
|
const customThemesDir = getCustomThemesDir();
|
|
370
360
|
const result = [];
|
|
371
|
-
// Built-in themes
|
|
361
|
+
// Built-in themes (embedded in code, no file path)
|
|
372
362
|
for (const name of Object.keys(getBuiltinThemes())) {
|
|
373
|
-
result.push({ name, path:
|
|
363
|
+
result.push({ name, path: undefined });
|
|
374
364
|
}
|
|
375
365
|
// Custom themes
|
|
376
366
|
if (fs.existsSync(customThemesDir)) {
|
|
@@ -410,7 +400,7 @@ function parseThemeJson(label, json) {
|
|
|
410
400
|
errorMessage += "\nMissing required color tokens:\n";
|
|
411
401
|
errorMessage += missingColors.map((c) => ` - ${c}`).join("\n");
|
|
412
402
|
errorMessage += '\n\nPlease add these colors to your theme\'s "colors" object.';
|
|
413
|
-
errorMessage += "\nSee the built-in
|
|
403
|
+
errorMessage += "\nSee the built-in dark/light themes for reference values.";
|
|
414
404
|
}
|
|
415
405
|
if (otherErrors.length > 0) {
|
|
416
406
|
errorMessage += `\n\nOther errors:\n${otherErrors.join("\n")}`;
|