@ashx-j/lunr 0.2.12 → 0.2.14

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.
Files changed (225) hide show
  1. package/CHANGELOG.md +16 -1
  2. package/README.md +6 -3
  3. package/dist/builtin-extensions/ashxj-tui.d.ts +16 -1
  4. package/dist/builtin-extensions/ashxj-tui.d.ts.map +1 -1
  5. package/dist/builtin-extensions/ashxj-tui.js +44 -20
  6. package/dist/builtin-extensions/ashxj-tui.js.map +1 -1
  7. package/dist/builtin-extensions/pi-subagents/src/extension/index.d.ts +2 -0
  8. package/dist/builtin-extensions/pi-subagents/src/extension/index.d.ts.map +1 -1
  9. package/dist/builtin-extensions/pi-subagents/src/extension/index.js +27 -22
  10. package/dist/builtin-extensions/pi-subagents/src/extension/index.js.map +1 -1
  11. package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.d.ts.map +1 -1
  12. package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.js +5 -2
  13. package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.js.map +1 -1
  14. package/dist/builtin-extensions/pi-subagents/src/runs/background/async-resume.d.ts.map +1 -1
  15. package/dist/builtin-extensions/pi-subagents/src/runs/background/async-resume.js +12 -1
  16. package/dist/builtin-extensions/pi-subagents/src/runs/background/async-resume.js.map +1 -1
  17. package/dist/builtin-extensions/pi-subagents/src/runs/background/async-status.d.ts +1 -0
  18. package/dist/builtin-extensions/pi-subagents/src/runs/background/async-status.d.ts.map +1 -1
  19. package/dist/builtin-extensions/pi-subagents/src/runs/background/async-status.js +3 -2
  20. package/dist/builtin-extensions/pi-subagents/src/runs/background/async-status.js.map +1 -1
  21. package/dist/builtin-extensions/pi-subagents/src/runs/background/chain-append.d.ts.map +1 -1
  22. package/dist/builtin-extensions/pi-subagents/src/runs/background/chain-append.js +1 -0
  23. package/dist/builtin-extensions/pi-subagents/src/runs/background/chain-append.js.map +1 -1
  24. package/dist/builtin-extensions/pi-subagents/src/runs/background/chain-root-attachment.d.ts.map +1 -1
  25. package/dist/builtin-extensions/pi-subagents/src/runs/background/chain-root-attachment.js +3 -0
  26. package/dist/builtin-extensions/pi-subagents/src/runs/background/chain-root-attachment.js.map +1 -1
  27. package/dist/builtin-extensions/pi-subagents/src/runs/background/fleet-view.d.ts.map +1 -1
  28. package/dist/builtin-extensions/pi-subagents/src/runs/background/fleet-view.js +3 -3
  29. package/dist/builtin-extensions/pi-subagents/src/runs/background/fleet-view.js.map +1 -1
  30. package/dist/builtin-extensions/pi-subagents/src/runs/background/run-status.d.ts.map +1 -1
  31. package/dist/builtin-extensions/pi-subagents/src/runs/background/run-status.js +2 -2
  32. package/dist/builtin-extensions/pi-subagents/src/runs/background/run-status.js.map +1 -1
  33. package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.d.ts.map +1 -1
  34. package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.js +3 -0
  35. package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.js.map +1 -1
  36. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-execution.d.ts.map +1 -1
  37. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-execution.js +7 -1
  38. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-execution.js.map +1 -1
  39. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/execution.d.ts.map +1 -1
  40. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/execution.js +2 -0
  41. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/execution.js.map +1 -1
  42. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.d.ts +1 -0
  43. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.d.ts.map +1 -1
  44. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.js +19 -3
  45. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.js.map +1 -1
  46. package/dist/builtin-extensions/pi-subagents/src/runs/shared/model-fallback.d.ts +10 -1
  47. package/dist/builtin-extensions/pi-subagents/src/runs/shared/model-fallback.d.ts.map +1 -1
  48. package/dist/builtin-extensions/pi-subagents/src/runs/shared/model-fallback.js +19 -0
  49. package/dist/builtin-extensions/pi-subagents/src/runs/shared/model-fallback.js.map +1 -1
  50. package/dist/builtin-extensions/pi-subagents/src/runs/shared/parallel-utils.d.ts +1 -0
  51. package/dist/builtin-extensions/pi-subagents/src/runs/shared/parallel-utils.d.ts.map +1 -1
  52. package/dist/builtin-extensions/pi-subagents/src/runs/shared/parallel-utils.js.map +1 -1
  53. package/dist/builtin-extensions/pi-subagents/src/shared/child-spec.d.ts +2 -1
  54. package/dist/builtin-extensions/pi-subagents/src/shared/child-spec.d.ts.map +1 -1
  55. package/dist/builtin-extensions/pi-subagents/src/shared/child-spec.js +17 -0
  56. package/dist/builtin-extensions/pi-subagents/src/shared/child-spec.js.map +1 -1
  57. package/dist/builtin-extensions/pi-subagents/src/shared/formatters.d.ts +3 -1
  58. package/dist/builtin-extensions/pi-subagents/src/shared/formatters.d.ts.map +1 -1
  59. package/dist/builtin-extensions/pi-subagents/src/shared/formatters.js +14 -3
  60. package/dist/builtin-extensions/pi-subagents/src/shared/formatters.js.map +1 -1
  61. package/dist/builtin-extensions/pi-subagents/src/shared/types.d.ts +14 -0
  62. package/dist/builtin-extensions/pi-subagents/src/shared/types.d.ts.map +1 -1
  63. package/dist/builtin-extensions/pi-subagents/src/shared/types.js.map +1 -1
  64. package/dist/builtin-extensions/pi-subagents/src/tui/fleet.d.ts.map +1 -1
  65. package/dist/builtin-extensions/pi-subagents/src/tui/fleet.js +2 -2
  66. package/dist/builtin-extensions/pi-subagents/src/tui/fleet.js.map +1 -1
  67. package/dist/builtin-extensions/pi-subagents/src/tui/render.d.ts.map +1 -1
  68. package/dist/builtin-extensions/pi-subagents/src/tui/render.js +12 -10
  69. package/dist/builtin-extensions/pi-subagents/src/tui/render.js.map +1 -1
  70. package/dist/catalog/models.json +1 -1
  71. package/dist/catalog/providers/amazon-bedrock.json +1 -1
  72. package/dist/catalog/providers/anthropic.json +1 -1
  73. package/dist/catalog/providers/azure-openai-responses.json +1 -1
  74. package/dist/catalog/providers/cloudflare-ai-gateway.json +1 -1
  75. package/dist/catalog/providers/cloudflare-workers-ai.json +1 -1
  76. package/dist/catalog/providers/fireworks.json +1 -1
  77. package/dist/catalog/providers/github-copilot.json +1 -1
  78. package/dist/catalog/providers/google-vertex.json +1 -1
  79. package/dist/catalog/providers/google.json +1 -1
  80. package/dist/catalog/providers/groq.json +1 -1
  81. package/dist/catalog/providers/huggingface.json +1 -1
  82. package/dist/catalog/providers/nvidia.json +1 -1
  83. package/dist/catalog/providers/openai-codex.json +1 -1
  84. package/dist/catalog/providers/openai.json +1 -1
  85. package/dist/catalog/providers/opencode-go.json +1 -1
  86. package/dist/catalog/providers/opencode.json +1 -1
  87. package/dist/catalog/providers/openrouter.json +1 -1
  88. package/dist/catalog/providers/together.json +1 -1
  89. package/dist/catalog/providers/vercel-ai-gateway.json +1 -1
  90. package/dist/catalog/publication.json +131 -3
  91. package/dist/cli/list-models.d.ts.map +1 -1
  92. package/dist/cli/list-models.js +1 -0
  93. package/dist/cli/list-models.js.map +1 -1
  94. package/dist/cli.d.ts.map +1 -1
  95. package/dist/cli.js +52 -27
  96. package/dist/cli.js.map +1 -1
  97. package/dist/core/catalog-cache-scope.d.ts +3 -0
  98. package/dist/core/catalog-cache-scope.d.ts.map +1 -0
  99. package/dist/core/catalog-cache-scope.js +12 -0
  100. package/dist/core/catalog-cache-scope.js.map +1 -0
  101. package/dist/core/catalog-merge.d.ts +2 -0
  102. package/dist/core/catalog-merge.d.ts.map +1 -1
  103. package/dist/core/catalog-merge.js +29 -2
  104. package/dist/core/catalog-merge.js.map +1 -1
  105. package/dist/core/catalog-refresh-polling.d.ts +8 -0
  106. package/dist/core/catalog-refresh-polling.d.ts.map +1 -0
  107. package/dist/core/catalog-refresh-polling.js +30 -0
  108. package/dist/core/catalog-refresh-polling.js.map +1 -0
  109. package/dist/core/codex-catalog.d.ts +3 -0
  110. package/dist/core/codex-catalog.d.ts.map +1 -0
  111. package/dist/core/codex-catalog.js +15 -0
  112. package/dist/core/codex-catalog.js.map +1 -0
  113. package/dist/core/context-breakdown.d.ts +3 -1
  114. package/dist/core/context-breakdown.d.ts.map +1 -1
  115. package/dist/core/context-breakdown.js +5 -2
  116. package/dist/core/context-breakdown.js.map +1 -1
  117. package/dist/core/customize.d.ts +2 -4
  118. package/dist/core/customize.d.ts.map +1 -1
  119. package/dist/core/customize.js +2 -8
  120. package/dist/core/customize.js.map +1 -1
  121. package/dist/core/footer-data-provider.d.ts +3 -4
  122. package/dist/core/footer-data-provider.d.ts.map +1 -1
  123. package/dist/core/footer-data-provider.js +54 -82
  124. package/dist/core/footer-data-provider.js.map +1 -1
  125. package/dist/core/live-catalog.d.ts +5 -2
  126. package/dist/core/live-catalog.d.ts.map +1 -1
  127. package/dist/core/live-catalog.js +108 -27
  128. package/dist/core/live-catalog.js.map +1 -1
  129. package/dist/core/model-runtime.d.ts +8 -0
  130. package/dist/core/model-runtime.d.ts.map +1 -1
  131. package/dist/core/model-runtime.js +64 -12
  132. package/dist/core/model-runtime.js.map +1 -1
  133. package/dist/core/official-catalog.d.ts +4 -0
  134. package/dist/core/official-catalog.d.ts.map +1 -1
  135. package/dist/core/official-catalog.js +86 -21
  136. package/dist/core/official-catalog.js.map +1 -1
  137. package/dist/core/settings-manager.d.ts +7 -6
  138. package/dist/core/settings-manager.d.ts.map +1 -1
  139. package/dist/core/settings-manager.js +13 -17
  140. package/dist/core/settings-manager.js.map +1 -1
  141. package/dist/core/slash-commands.d.ts.map +1 -1
  142. package/dist/core/slash-commands.js +1 -0
  143. package/dist/core/slash-commands.js.map +1 -1
  144. package/dist/index.d.ts +1 -1
  145. package/dist/index.d.ts.map +1 -1
  146. package/dist/index.js.map +1 -1
  147. package/dist/main.d.ts +2 -0
  148. package/dist/main.d.ts.map +1 -1
  149. package/dist/main.js +106 -50
  150. package/dist/main.js.map +1 -1
  151. package/dist/migrations.d.ts +2 -0
  152. package/dist/migrations.d.ts.map +1 -1
  153. package/dist/migrations.js +14 -4
  154. package/dist/migrations.js.map +1 -1
  155. package/dist/modes/interactive/components/assistant-message.d.ts +1 -3
  156. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  157. package/dist/modes/interactive/components/assistant-message.js +4 -32
  158. package/dist/modes/interactive/components/assistant-message.js.map +1 -1
  159. package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
  160. package/dist/modes/interactive/components/custom-editor.js +2 -1
  161. package/dist/modes/interactive/components/custom-editor.js.map +1 -1
  162. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  163. package/dist/modes/interactive/components/model-selector.js +4 -1
  164. package/dist/modes/interactive/components/model-selector.js.map +1 -1
  165. package/dist/modes/interactive/components/plan-message.d.ts +1 -3
  166. package/dist/modes/interactive/components/plan-message.d.ts.map +1 -1
  167. package/dist/modes/interactive/components/plan-message.js +1 -16
  168. package/dist/modes/interactive/components/plan-message.js.map +1 -1
  169. package/dist/modes/interactive/components/settings-selector.d.ts +3 -5
  170. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  171. package/dist/modes/interactive/components/settings-selector.js +113 -117
  172. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  173. package/dist/modes/interactive/components/user-message.d.ts +1 -3
  174. package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
  175. package/dist/modes/interactive/components/user-message.js +2 -19
  176. package/dist/modes/interactive/components/user-message.js.map +1 -1
  177. package/dist/modes/interactive/interactive-mode.d.ts +12 -1
  178. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  179. package/dist/modes/interactive/interactive-mode.js +153 -130
  180. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  181. package/dist/modes/interactive/skill-tag-autocomplete.d.ts +13 -0
  182. package/dist/modes/interactive/skill-tag-autocomplete.d.ts.map +1 -0
  183. package/dist/modes/interactive/skill-tag-autocomplete.js +72 -0
  184. package/dist/modes/interactive/skill-tag-autocomplete.js.map +1 -0
  185. package/dist/modes/interactive/theme/moon.json +0 -1
  186. package/dist/modes/interactive/theme/theme-schema.json +3 -3
  187. package/dist/modes/interactive/theme/theme.d.ts +1 -1
  188. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  189. package/dist/modes/interactive/theme/theme.js +95 -90
  190. package/dist/modes/interactive/theme/theme.js.map +1 -1
  191. package/dist/startup/interactive-view.d.ts +55 -0
  192. package/dist/startup/interactive-view.d.ts.map +1 -0
  193. package/dist/startup/interactive-view.js +332 -0
  194. package/dist/startup/interactive-view.js.map +1 -0
  195. package/dist/startup/launch-routing.d.ts +8 -0
  196. package/dist/startup/launch-routing.d.ts.map +1 -0
  197. package/dist/startup/launch-routing.js +29 -0
  198. package/dist/startup/launch-routing.js.map +1 -0
  199. package/dist/startup/startup-milestones.d.ts +4 -0
  200. package/dist/startup/startup-milestones.d.ts.map +1 -0
  201. package/dist/startup/startup-milestones.js +14 -0
  202. package/dist/startup/startup-milestones.js.map +1 -0
  203. package/dist/utils/syntax-highlight.d.ts.map +1 -1
  204. package/dist/utils/syntax-highlight.js +10 -4
  205. package/dist/utils/syntax-highlight.js.map +1 -1
  206. package/docs/features.md +2 -2
  207. package/docs/interactive-startup.md +58 -0
  208. package/docs/keybindings.md +1 -1
  209. package/docs/model-catalog.md +29 -0
  210. package/docs/quickstart.md +1 -1
  211. package/docs/settings.md +2 -3
  212. package/docs/skills.md +10 -0
  213. package/docs/terminal-setup.md +2 -2
  214. package/docs/usage.md +2 -1
  215. package/docs/windows.md +1 -1
  216. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  217. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  218. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  219. package/examples/extensions/gondolin/package-lock.json +2 -2
  220. package/examples/extensions/gondolin/package.json +1 -1
  221. package/examples/extensions/sandbox/package-lock.json +2 -2
  222. package/examples/extensions/sandbox/package.json +1 -1
  223. package/examples/extensions/with-deps/package-lock.json +2 -2
  224. package/examples/extensions/with-deps/package.json +1 -1
  225. package/package.json +16 -16
@@ -1,99 +1,106 @@
1
1
  import * as fs from "node:fs";
2
+ import { createRequire } from "node:module";
2
3
  import * as path from "node:path";
3
4
  import { getCapabilities, } from "@ashx-j/lunr-tui";
4
5
  import chalk from "chalk";
5
- import { Type } from "typebox";
6
- import { Compile } from "typebox/compile";
7
6
  import { getCustomThemesDir, getThemesDir } from "../../../config.js";
8
7
  import { closeWatcher, watchWithErrorHandler } from "../../../utils/fs-watch.js";
9
8
  import { highlight, supportsLanguage } from "../../../utils/syntax-highlight.js";
10
9
  // ============================================================================
11
10
  // Types & Schema
12
11
  // ============================================================================
13
- const ColorValueSchema = Type.Union([
14
- Type.String(), // hex "#ff0000", var ref "primary", or empty ""
15
- Type.Integer({ minimum: 0, maximum: 255 }), // 256-color index
16
- ]);
17
- const ThemeJsonSchema = Type.Object({
18
- $schema: Type.Optional(Type.String()),
19
- name: Type.String(),
20
- vars: Type.Optional(Type.Record(Type.String(), ColorValueSchema)),
21
- colors: Type.Object({
22
- // Core UI (10 colors)
23
- accent: ColorValueSchema,
24
- accent2: Type.Optional(ColorValueSchema),
25
- border: ColorValueSchema,
26
- borderAccent: ColorValueSchema,
27
- borderMuted: ColorValueSchema,
28
- success: ColorValueSchema,
29
- error: ColorValueSchema,
30
- warning: ColorValueSchema,
31
- muted: ColorValueSchema,
32
- dim: ColorValueSchema,
33
- text: ColorValueSchema,
34
- white: Type.Optional(ColorValueSchema),
35
- thinkingText: ColorValueSchema,
36
- // Backgrounds & Content Text (11 colors)
37
- selectedBg: ColorValueSchema,
38
- userMessageBg: ColorValueSchema,
39
- userMessageText: ColorValueSchema,
40
- customMessageBg: ColorValueSchema,
41
- customMessageText: ColorValueSchema,
42
- customMessageLabel: ColorValueSchema,
43
- toolPendingBg: ColorValueSchema,
44
- toolSuccessBg: ColorValueSchema,
45
- toolErrorBg: ColorValueSchema,
46
- toolTitle: ColorValueSchema,
47
- toolOutput: ColorValueSchema,
48
- // Markdown (10 colors)
49
- mdHeading: ColorValueSchema,
50
- mdLink: ColorValueSchema,
51
- mdLinkUrl: ColorValueSchema,
52
- mdCode: ColorValueSchema,
53
- mdCodeBlock: ColorValueSchema,
54
- mdCodeBlockBorder: ColorValueSchema,
55
- mdQuote: ColorValueSchema,
56
- mdQuoteBorder: ColorValueSchema,
57
- mdHr: ColorValueSchema,
58
- mdListBullet: ColorValueSchema,
59
- // Tool Diffs (3 colors)
60
- toolDiffAdded: ColorValueSchema,
61
- toolDiffRemoved: ColorValueSchema,
62
- toolDiffContext: ColorValueSchema,
63
- // Syntax Highlighting (9 colors)
64
- syntaxComment: ColorValueSchema,
65
- syntaxKeyword: ColorValueSchema,
66
- syntaxFunction: ColorValueSchema,
67
- syntaxVariable: ColorValueSchema,
68
- syntaxString: ColorValueSchema,
69
- syntaxNumber: ColorValueSchema,
70
- syntaxType: ColorValueSchema,
71
- syntaxOperator: ColorValueSchema,
72
- syntaxPunctuation: ColorValueSchema,
73
- // Thinking Level Borders (6 colors)
74
- thinkingOff: ColorValueSchema,
75
- thinkingMinimal: ColorValueSchema,
76
- thinkingLow: ColorValueSchema,
77
- thinkingMedium: ColorValueSchema,
78
- thinkingHigh: ColorValueSchema,
79
- thinkingXhigh: ColorValueSchema,
80
- thinkingMax: Type.Optional(ColorValueSchema),
81
- // Bash Mode (1 color)
82
- bashMode: ColorValueSchema,
83
- }),
84
- // lunr: non-color glyph customization. Both optional; empty string hides
85
- // that part of the prompt glyph. Defaults: promptMoon "☾", promptArrow ">".
86
- glyphs: Type.Optional(Type.Object({
87
- promptMoon: Type.Optional(Type.String()),
88
- promptArrow: Type.Optional(Type.String()),
89
- })),
90
- export: Type.Optional(Type.Object({
91
- pageBg: Type.Optional(ColorValueSchema),
92
- cardBg: Type.Optional(ColorValueSchema),
93
- infoBg: Type.Optional(ColorValueSchema),
94
- })),
95
- });
96
- const validateThemeJson = Compile(ThemeJsonSchema);
12
+ const require = createRequire(import.meta.url);
13
+ // The shipped moon theme needs no schema compiler. Load validation only when
14
+ // a custom theme is parsed, preserving the same schema and diagnostics.
15
+ function createThemeSchema() {
16
+ const { Type } = require("typebox");
17
+ const ColorValueSchema = Type.Union([
18
+ Type.String(), // hex "#ff0000", var ref "primary", or empty ""
19
+ Type.Integer({ minimum: 0, maximum: 255 }), // 256-color index
20
+ ]);
21
+ return Type.Object({
22
+ $schema: Type.Optional(Type.String()),
23
+ name: Type.String(),
24
+ vars: Type.Optional(Type.Record(Type.String(), ColorValueSchema)),
25
+ colors: Type.Object({
26
+ // Core UI (10 colors)
27
+ accent: ColorValueSchema,
28
+ accent2: Type.Optional(ColorValueSchema),
29
+ border: ColorValueSchema,
30
+ borderAccent: ColorValueSchema,
31
+ borderMuted: ColorValueSchema,
32
+ success: ColorValueSchema,
33
+ error: ColorValueSchema,
34
+ warning: ColorValueSchema,
35
+ muted: ColorValueSchema,
36
+ dim: ColorValueSchema,
37
+ text: ColorValueSchema,
38
+ white: Type.Optional(ColorValueSchema),
39
+ thinkingText: ColorValueSchema,
40
+ // Backgrounds & Content Text (11 colors)
41
+ selectedBg: ColorValueSchema,
42
+ userMessageBg: ColorValueSchema,
43
+ userMessageText: ColorValueSchema,
44
+ customMessageBg: ColorValueSchema,
45
+ customMessageText: ColorValueSchema,
46
+ customMessageLabel: ColorValueSchema,
47
+ toolPendingBg: ColorValueSchema,
48
+ toolSuccessBg: ColorValueSchema,
49
+ toolErrorBg: ColorValueSchema,
50
+ toolTitle: ColorValueSchema,
51
+ toolOutput: ColorValueSchema,
52
+ // Markdown (10 colors)
53
+ mdHeading: ColorValueSchema,
54
+ mdLink: ColorValueSchema,
55
+ mdLinkUrl: ColorValueSchema,
56
+ mdCode: ColorValueSchema,
57
+ mdCodeBlock: ColorValueSchema,
58
+ mdCodeBlockBorder: ColorValueSchema,
59
+ mdQuote: ColorValueSchema,
60
+ mdQuoteBorder: ColorValueSchema,
61
+ mdHr: ColorValueSchema,
62
+ mdListBullet: ColorValueSchema,
63
+ // Tool Diffs (3 colors)
64
+ toolDiffAdded: ColorValueSchema,
65
+ toolDiffRemoved: ColorValueSchema,
66
+ toolDiffContext: ColorValueSchema,
67
+ // Syntax Highlighting (9 colors)
68
+ syntaxComment: ColorValueSchema,
69
+ syntaxKeyword: ColorValueSchema,
70
+ syntaxFunction: ColorValueSchema,
71
+ syntaxVariable: ColorValueSchema,
72
+ syntaxString: ColorValueSchema,
73
+ syntaxNumber: ColorValueSchema,
74
+ syntaxType: ColorValueSchema,
75
+ syntaxOperator: ColorValueSchema,
76
+ syntaxPunctuation: ColorValueSchema,
77
+ // Thinking Level Borders (6 colors)
78
+ thinkingOff: ColorValueSchema,
79
+ thinkingMinimal: ColorValueSchema,
80
+ thinkingLow: ColorValueSchema,
81
+ thinkingMedium: ColorValueSchema,
82
+ thinkingHigh: ColorValueSchema,
83
+ thinkingXhigh: ColorValueSchema,
84
+ thinkingMax: Type.Optional(ColorValueSchema),
85
+ // Bash Mode (1 color)
86
+ bashMode: ColorValueSchema,
87
+ }),
88
+ glyphs: Type.Optional(Type.Object({
89
+ promptMoon: Type.Optional(Type.String()),
90
+ promptArrow: Type.Optional(Type.String()),
91
+ })),
92
+ export: Type.Optional(Type.Object({
93
+ pageBg: Type.Optional(ColorValueSchema),
94
+ cardBg: Type.Optional(ColorValueSchema),
95
+ infoBg: Type.Optional(ColorValueSchema),
96
+ })),
97
+ });
98
+ }
99
+ function createThemeValidator() {
100
+ const { Compile } = require("typebox/compile");
101
+ return Compile(createThemeSchema());
102
+ }
103
+ let themeValidator;
97
104
  // ============================================================================
98
105
  // Color Utilities
99
106
  // ============================================================================
@@ -240,7 +247,6 @@ function withThemeColorFallbacks(colors) {
240
247
  };
241
248
  }
242
249
  export const DEFAULT_THEME_GLYPHS = {
243
- promptMoon: "☾",
244
250
  promptArrow: ">",
245
251
  };
246
252
  export class Theme {
@@ -409,6 +415,8 @@ function assertThemeNameIsValid(name) {
409
415
  }
410
416
  }
411
417
  function parseThemeJson(label, json) {
418
+ themeValidator ??= createThemeValidator();
419
+ const validateThemeJson = themeValidator;
412
420
  if (!validateThemeJson.Check(json)) {
413
421
  const errors = Array.from(validateThemeJson.Errors(json));
414
422
  const missingColors = new Set();
@@ -498,10 +506,7 @@ function createTheme(themeJson, mode, sourcePath) {
498
506
  return new Theme(fgColors, bgColors, colorMode, {
499
507
  name: themeJson.name,
500
508
  sourcePath,
501
- // lunr: `??` (not `||`) is intentional — an explicitly empty glyph stays
502
- // empty (hidden); only a missing key falls back to the default.
503
509
  glyphs: {
504
- promptMoon: themeJson.glyphs?.promptMoon ?? DEFAULT_THEME_GLYPHS.promptMoon,
505
510
  promptArrow: themeJson.glyphs?.promptArrow ?? DEFAULT_THEME_GLYPHS.promptArrow,
506
511
  },
507
512
  });