@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.
- package/CHANGELOG.md +16 -1
- package/README.md +6 -3
- package/dist/builtin-extensions/ashxj-tui.d.ts +16 -1
- package/dist/builtin-extensions/ashxj-tui.d.ts.map +1 -1
- package/dist/builtin-extensions/ashxj-tui.js +44 -20
- package/dist/builtin-extensions/ashxj-tui.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/index.d.ts +2 -0
- package/dist/builtin-extensions/pi-subagents/src/extension/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/index.js +27 -22
- package/dist/builtin-extensions/pi-subagents/src/extension/index.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.js +5 -2
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-resume.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-resume.js +12 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-resume.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-status.d.ts +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-status.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-status.js +3 -2
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-status.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/chain-append.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/chain-append.js +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/chain-append.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/chain-root-attachment.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/chain-root-attachment.js +3 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/chain-root-attachment.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/fleet-view.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/fleet-view.js +3 -3
- package/dist/builtin-extensions/pi-subagents/src/runs/background/fleet-view.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/run-status.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/run-status.js +2 -2
- package/dist/builtin-extensions/pi-subagents/src/runs/background/run-status.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.js +3 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-execution.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-execution.js +7 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-execution.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/execution.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/execution.js +2 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/execution.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.d.ts +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.js +19 -3
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/model-fallback.d.ts +10 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/model-fallback.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/model-fallback.js +19 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/model-fallback.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/parallel-utils.d.ts +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/parallel-utils.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/parallel-utils.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/child-spec.d.ts +2 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/child-spec.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/child-spec.js +17 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/child-spec.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/formatters.d.ts +3 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/formatters.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/formatters.js +14 -3
- package/dist/builtin-extensions/pi-subagents/src/shared/formatters.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/types.d.ts +14 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/types.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/types.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/tui/fleet.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/tui/fleet.js +2 -2
- package/dist/builtin-extensions/pi-subagents/src/tui/fleet.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/tui/render.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/tui/render.js +12 -10
- package/dist/builtin-extensions/pi-subagents/src/tui/render.js.map +1 -1
- package/dist/catalog/models.json +1 -1
- package/dist/catalog/providers/amazon-bedrock.json +1 -1
- package/dist/catalog/providers/anthropic.json +1 -1
- package/dist/catalog/providers/azure-openai-responses.json +1 -1
- package/dist/catalog/providers/cloudflare-ai-gateway.json +1 -1
- package/dist/catalog/providers/cloudflare-workers-ai.json +1 -1
- package/dist/catalog/providers/fireworks.json +1 -1
- package/dist/catalog/providers/github-copilot.json +1 -1
- package/dist/catalog/providers/google-vertex.json +1 -1
- package/dist/catalog/providers/google.json +1 -1
- package/dist/catalog/providers/groq.json +1 -1
- package/dist/catalog/providers/huggingface.json +1 -1
- package/dist/catalog/providers/nvidia.json +1 -1
- package/dist/catalog/providers/openai-codex.json +1 -1
- package/dist/catalog/providers/openai.json +1 -1
- package/dist/catalog/providers/opencode-go.json +1 -1
- package/dist/catalog/providers/opencode.json +1 -1
- package/dist/catalog/providers/openrouter.json +1 -1
- package/dist/catalog/providers/together.json +1 -1
- package/dist/catalog/providers/vercel-ai-gateway.json +1 -1
- package/dist/catalog/publication.json +131 -3
- package/dist/cli/list-models.d.ts.map +1 -1
- package/dist/cli/list-models.js +1 -0
- package/dist/cli/list-models.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +52 -27
- package/dist/cli.js.map +1 -1
- package/dist/core/catalog-cache-scope.d.ts +3 -0
- package/dist/core/catalog-cache-scope.d.ts.map +1 -0
- package/dist/core/catalog-cache-scope.js +12 -0
- package/dist/core/catalog-cache-scope.js.map +1 -0
- package/dist/core/catalog-merge.d.ts +2 -0
- package/dist/core/catalog-merge.d.ts.map +1 -1
- package/dist/core/catalog-merge.js +29 -2
- package/dist/core/catalog-merge.js.map +1 -1
- package/dist/core/catalog-refresh-polling.d.ts +8 -0
- package/dist/core/catalog-refresh-polling.d.ts.map +1 -0
- package/dist/core/catalog-refresh-polling.js +30 -0
- package/dist/core/catalog-refresh-polling.js.map +1 -0
- package/dist/core/codex-catalog.d.ts +3 -0
- package/dist/core/codex-catalog.d.ts.map +1 -0
- package/dist/core/codex-catalog.js +15 -0
- package/dist/core/codex-catalog.js.map +1 -0
- package/dist/core/context-breakdown.d.ts +3 -1
- package/dist/core/context-breakdown.d.ts.map +1 -1
- package/dist/core/context-breakdown.js +5 -2
- package/dist/core/context-breakdown.js.map +1 -1
- package/dist/core/customize.d.ts +2 -4
- package/dist/core/customize.d.ts.map +1 -1
- package/dist/core/customize.js +2 -8
- package/dist/core/customize.js.map +1 -1
- package/dist/core/footer-data-provider.d.ts +3 -4
- package/dist/core/footer-data-provider.d.ts.map +1 -1
- package/dist/core/footer-data-provider.js +54 -82
- package/dist/core/footer-data-provider.js.map +1 -1
- package/dist/core/live-catalog.d.ts +5 -2
- package/dist/core/live-catalog.d.ts.map +1 -1
- package/dist/core/live-catalog.js +108 -27
- package/dist/core/live-catalog.js.map +1 -1
- package/dist/core/model-runtime.d.ts +8 -0
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +64 -12
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/official-catalog.d.ts +4 -0
- package/dist/core/official-catalog.d.ts.map +1 -1
- package/dist/core/official-catalog.js +86 -21
- package/dist/core/official-catalog.js.map +1 -1
- package/dist/core/settings-manager.d.ts +7 -6
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +13 -17
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +1 -0
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts +2 -0
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +106 -50
- package/dist/main.js.map +1 -1
- package/dist/migrations.d.ts +2 -0
- package/dist/migrations.d.ts.map +1 -1
- package/dist/migrations.js +14 -4
- package/dist/migrations.js.map +1 -1
- package/dist/modes/interactive/components/assistant-message.d.ts +1 -3
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +4 -32
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-editor.js +2 -1
- package/dist/modes/interactive/components/custom-editor.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +4 -1
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/plan-message.d.ts +1 -3
- package/dist/modes/interactive/components/plan-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/plan-message.js +1 -16
- package/dist/modes/interactive/components/plan-message.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +3 -5
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +113 -117
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/user-message.d.ts +1 -3
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message.js +2 -19
- package/dist/modes/interactive/components/user-message.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +12 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +153 -130
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/skill-tag-autocomplete.d.ts +13 -0
- package/dist/modes/interactive/skill-tag-autocomplete.d.ts.map +1 -0
- package/dist/modes/interactive/skill-tag-autocomplete.js +72 -0
- package/dist/modes/interactive/skill-tag-autocomplete.js.map +1 -0
- package/dist/modes/interactive/theme/moon.json +0 -1
- package/dist/modes/interactive/theme/theme-schema.json +3 -3
- package/dist/modes/interactive/theme/theme.d.ts +1 -1
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +95 -90
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/startup/interactive-view.d.ts +55 -0
- package/dist/startup/interactive-view.d.ts.map +1 -0
- package/dist/startup/interactive-view.js +332 -0
- package/dist/startup/interactive-view.js.map +1 -0
- package/dist/startup/launch-routing.d.ts +8 -0
- package/dist/startup/launch-routing.d.ts.map +1 -0
- package/dist/startup/launch-routing.js +29 -0
- package/dist/startup/launch-routing.js.map +1 -0
- package/dist/startup/startup-milestones.d.ts +4 -0
- package/dist/startup/startup-milestones.d.ts.map +1 -0
- package/dist/startup/startup-milestones.js +14 -0
- package/dist/startup/startup-milestones.js.map +1 -0
- package/dist/utils/syntax-highlight.d.ts.map +1 -1
- package/dist/utils/syntax-highlight.js +10 -4
- package/dist/utils/syntax-highlight.js.map +1 -1
- package/docs/features.md +2 -2
- package/docs/interactive-startup.md +58 -0
- package/docs/keybindings.md +1 -1
- package/docs/model-catalog.md +29 -0
- package/docs/quickstart.md +1 -1
- package/docs/settings.md +2 -3
- package/docs/skills.md +10 -0
- package/docs/terminal-setup.md +2 -2
- package/docs/usage.md +2 -1
- package/docs/windows.md +1 -1
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- 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
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
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
|
});
|