@openvulcan/dsh-vulcancode 0.0.0-stage → 0.4.0

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 (171) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +86 -2
  3. package/assets/openvulcan-icon.svg +33 -0
  4. package/cordis.patch.yml +17 -0
  5. package/node_modules/@openvulcan/dsh-decision-guard/LICENSE +21 -0
  6. package/node_modules/@openvulcan/dsh-decision-guard/README.md +14 -0
  7. package/node_modules/@openvulcan/dsh-decision-guard/assets/decision-guard-icon.png +0 -0
  8. package/node_modules/@openvulcan/dsh-decision-guard/lib/calls.d.ts +40 -0
  9. package/node_modules/@openvulcan/dsh-decision-guard/lib/calls.js +150 -0
  10. package/node_modules/@openvulcan/dsh-decision-guard/lib/client.js +2193 -0
  11. package/node_modules/@openvulcan/dsh-decision-guard/lib/decide.d.ts +90 -0
  12. package/node_modules/@openvulcan/dsh-decision-guard/lib/decide.js +108 -0
  13. package/node_modules/@openvulcan/dsh-decision-guard/lib/index.d.ts +129 -0
  14. package/node_modules/@openvulcan/dsh-decision-guard/lib/index.js +572 -0
  15. package/node_modules/@openvulcan/dsh-decision-guard/lib/intent.d.ts +22 -0
  16. package/node_modules/@openvulcan/dsh-decision-guard/lib/intent.js +77 -0
  17. package/node_modules/@openvulcan/dsh-decision-guard/lib/panel.d.ts +158 -0
  18. package/node_modules/@openvulcan/dsh-decision-guard/lib/panel.js +340 -0
  19. package/node_modules/@openvulcan/dsh-decision-guard/lib/records.d.ts +133 -0
  20. package/node_modules/@openvulcan/dsh-decision-guard/lib/records.js +186 -0
  21. package/node_modules/@openvulcan/dsh-decision-guard/lib/review.d.ts +55 -0
  22. package/node_modules/@openvulcan/dsh-decision-guard/lib/review.js +202 -0
  23. package/node_modules/@openvulcan/dsh-decision-guard/lib/session-state.d.ts +62 -0
  24. package/node_modules/@openvulcan/dsh-decision-guard/lib/session-state.js +155 -0
  25. package/node_modules/@openvulcan/dsh-decision-guard/lib/version.d.ts +2 -0
  26. package/node_modules/@openvulcan/dsh-decision-guard/lib/version.js +4 -0
  27. package/node_modules/@openvulcan/dsh-decision-guard/package.json +68 -0
  28. package/node_modules/@openvulcan/dsh-vulcan-account/LICENSE +21 -0
  29. package/node_modules/@openvulcan/dsh-vulcan-account/assets/account-icon.png +0 -0
  30. package/node_modules/@openvulcan/dsh-vulcan-account/lib/client.js +565 -0
  31. package/node_modules/@openvulcan/dsh-vulcan-account/lib/index.d.ts +92 -0
  32. package/node_modules/@openvulcan/dsh-vulcan-account/lib/index.js +194 -0
  33. package/node_modules/@openvulcan/dsh-vulcan-account/package.json +57 -0
  34. package/node_modules/@openvulcan/dsh-vulcan-answers/LICENSE +21 -0
  35. package/node_modules/@openvulcan/dsh-vulcan-answers/assets/answers-icon.png +0 -0
  36. package/node_modules/@openvulcan/dsh-vulcan-answers/assets/prompts/answer-mode-interactive.md +79 -0
  37. package/node_modules/@openvulcan/dsh-vulcan-answers/assets/prompts/answer-mode-standard.md +1 -0
  38. package/node_modules/@openvulcan/dsh-vulcan-answers/lib/answer-model.d.ts +258 -0
  39. package/node_modules/@openvulcan/dsh-vulcan-answers/lib/answer-model.js +698 -0
  40. package/node_modules/@openvulcan/dsh-vulcan-answers/lib/client.js +671 -0
  41. package/node_modules/@openvulcan/dsh-vulcan-answers/lib/fences.d.ts +29 -0
  42. package/node_modules/@openvulcan/dsh-vulcan-answers/lib/fences.js +70 -0
  43. package/node_modules/@openvulcan/dsh-vulcan-answers/lib/index.d.ts +19 -0
  44. package/node_modules/@openvulcan/dsh-vulcan-answers/lib/index.js +52 -0
  45. package/node_modules/@openvulcan/dsh-vulcan-answers/lib/limits.d.ts +9 -0
  46. package/node_modules/@openvulcan/dsh-vulcan-answers/lib/limits.js +9 -0
  47. package/node_modules/@openvulcan/dsh-vulcan-answers/lib/prompt.d.ts +22 -0
  48. package/node_modules/@openvulcan/dsh-vulcan-answers/lib/prompt.js +39 -0
  49. package/node_modules/@openvulcan/dsh-vulcan-answers/lib/reply-format.d.ts +20 -0
  50. package/node_modules/@openvulcan/dsh-vulcan-answers/lib/reply-format.js +17 -0
  51. package/node_modules/@openvulcan/dsh-vulcan-answers/lib/session-state.d.ts +66 -0
  52. package/node_modules/@openvulcan/dsh-vulcan-answers/lib/session-state.js +118 -0
  53. package/node_modules/@openvulcan/dsh-vulcan-answers/package.json +59 -0
  54. package/node_modules/@openvulcan/dsh-vulcan-luaskills/LICENSE +21 -0
  55. package/node_modules/@openvulcan/dsh-vulcan-luaskills/assets/luaskills-icon.svg +1 -0
  56. package/node_modules/@openvulcan/dsh-vulcan-luaskills/lib/client.js +940 -0
  57. package/node_modules/@openvulcan/dsh-vulcan-luaskills/lib/constants.d.ts +46 -0
  58. package/node_modules/@openvulcan/dsh-vulcan-luaskills/lib/constants.js +51 -0
  59. package/node_modules/@openvulcan/dsh-vulcan-luaskills/lib/engine.d.ts +55 -0
  60. package/node_modules/@openvulcan/dsh-vulcan-luaskills/lib/engine.js +149 -0
  61. package/node_modules/@openvulcan/dsh-vulcan-luaskills/lib/hub.d.ts +49 -0
  62. package/node_modules/@openvulcan/dsh-vulcan-luaskills/lib/hub.js +116 -0
  63. package/node_modules/@openvulcan/dsh-vulcan-luaskills/lib/index.d.ts +26 -0
  64. package/node_modules/@openvulcan/dsh-vulcan-luaskills/lib/index.js +276 -0
  65. package/node_modules/@openvulcan/dsh-vulcan-luaskills/lib/protocol.d.ts +65 -0
  66. package/node_modules/@openvulcan/dsh-vulcan-luaskills/lib/protocol.js +2 -0
  67. package/node_modules/@openvulcan/dsh-vulcan-luaskills/lib/runtime.d.ts +111 -0
  68. package/node_modules/@openvulcan/dsh-vulcan-luaskills/lib/runtime.js +281 -0
  69. package/node_modules/@openvulcan/dsh-vulcan-luaskills/lib/sdk-install.d.ts +26 -0
  70. package/node_modules/@openvulcan/dsh-vulcan-luaskills/lib/sdk-install.js +87 -0
  71. package/node_modules/@openvulcan/dsh-vulcan-luaskills/lib/settings.d.ts +79 -0
  72. package/node_modules/@openvulcan/dsh-vulcan-luaskills/lib/settings.js +165 -0
  73. package/node_modules/@openvulcan/dsh-vulcan-luaskills/lib/skills.d.ts +34 -0
  74. package/node_modules/@openvulcan/dsh-vulcan-luaskills/lib/skills.js +61 -0
  75. package/node_modules/@openvulcan/dsh-vulcan-luaskills/lib/tools.d.ts +59 -0
  76. package/node_modules/@openvulcan/dsh-vulcan-luaskills/lib/tools.js +107 -0
  77. package/node_modules/@openvulcan/dsh-vulcan-luaskills/lib/worker.d.ts +10 -0
  78. package/node_modules/@openvulcan/dsh-vulcan-luaskills/lib/worker.js +140 -0
  79. package/node_modules/@openvulcan/dsh-vulcan-luaskills/package.json +57 -0
  80. package/node_modules/@openvulcan/dsh-vulcan-memory/LICENSE +21 -0
  81. package/node_modules/@openvulcan/dsh-vulcan-memory/assets/markdown-memory-guide.md +21 -0
  82. package/node_modules/@openvulcan/dsh-vulcan-memory/assets/memory-curator/SKILL.md +31 -0
  83. package/node_modules/@openvulcan/dsh-vulcan-memory/assets/memory-icon.png +0 -0
  84. package/node_modules/@openvulcan/dsh-vulcan-memory/lib/client.js +1090 -0
  85. package/node_modules/@openvulcan/dsh-vulcan-memory/lib/index.d.ts +30 -0
  86. package/node_modules/@openvulcan/dsh-vulcan-memory/lib/index.js +240 -0
  87. package/node_modules/@openvulcan/dsh-vulcan-memory/lib/inject.d.ts +30 -0
  88. package/node_modules/@openvulcan/dsh-vulcan-memory/lib/inject.js +46 -0
  89. package/node_modules/@openvulcan/dsh-vulcan-memory/lib/markdown/constants.d.ts +23 -0
  90. package/node_modules/@openvulcan/dsh-vulcan-memory/lib/markdown/constants.js +25 -0
  91. package/node_modules/@openvulcan/dsh-vulcan-memory/lib/markdown/document.d.ts +108 -0
  92. package/node_modules/@openvulcan/dsh-vulcan-memory/lib/markdown/document.js +373 -0
  93. package/node_modules/@openvulcan/dsh-vulcan-memory/lib/markdown/errors.d.ts +14 -0
  94. package/node_modules/@openvulcan/dsh-vulcan-memory/lib/markdown/errors.js +31 -0
  95. package/node_modules/@openvulcan/dsh-vulcan-memory/lib/markdown/index.d.ts +196 -0
  96. package/node_modules/@openvulcan/dsh-vulcan-memory/lib/markdown/index.js +204 -0
  97. package/node_modules/@openvulcan/dsh-vulcan-memory/lib/markdown/operations.d.ts +92 -0
  98. package/node_modules/@openvulcan/dsh-vulcan-memory/lib/markdown/operations.js +472 -0
  99. package/node_modules/@openvulcan/dsh-vulcan-memory/lib/markdown/package.d.ts +126 -0
  100. package/node_modules/@openvulcan/dsh-vulcan-memory/lib/markdown/package.js +553 -0
  101. package/node_modules/@openvulcan/dsh-vulcan-memory/lib/markdown/registry.d.ts +56 -0
  102. package/node_modules/@openvulcan/dsh-vulcan-memory/lib/markdown/registry.js +182 -0
  103. package/node_modules/@openvulcan/dsh-vulcan-memory/lib/markdown/scope.d.ts +13 -0
  104. package/node_modules/@openvulcan/dsh-vulcan-memory/lib/markdown/scope.js +24 -0
  105. package/node_modules/@openvulcan/dsh-vulcan-memory/lib/markdown/search.d.ts +65 -0
  106. package/node_modules/@openvulcan/dsh-vulcan-memory/lib/markdown/search.js +227 -0
  107. package/node_modules/@openvulcan/dsh-vulcan-memory/lib/markdown/snapshot.d.ts +34 -0
  108. package/node_modules/@openvulcan/dsh-vulcan-memory/lib/markdown/snapshot.js +171 -0
  109. package/node_modules/@openvulcan/dsh-vulcan-memory/lib/markdown/store.d.ts +72 -0
  110. package/node_modules/@openvulcan/dsh-vulcan-memory/lib/markdown/store.js +250 -0
  111. package/node_modules/@openvulcan/dsh-vulcan-memory/lib/markdown/timestamp.d.ts +6 -0
  112. package/node_modules/@openvulcan/dsh-vulcan-memory/lib/markdown/timestamp.js +12 -0
  113. package/node_modules/@openvulcan/dsh-vulcan-memory/lib/markdown/tokens.d.ts +8 -0
  114. package/node_modules/@openvulcan/dsh-vulcan-memory/lib/markdown/tokens.js +38 -0
  115. package/node_modules/@openvulcan/dsh-vulcan-memory/lib/page.d.ts +132 -0
  116. package/node_modules/@openvulcan/dsh-vulcan-memory/lib/page.js +235 -0
  117. package/node_modules/@openvulcan/dsh-vulcan-memory/lib/project.d.ts +14 -0
  118. package/node_modules/@openvulcan/dsh-vulcan-memory/lib/project.js +27 -0
  119. package/node_modules/@openvulcan/dsh-vulcan-memory/lib/settings.d.ts +29 -0
  120. package/node_modules/@openvulcan/dsh-vulcan-memory/lib/settings.js +62 -0
  121. package/node_modules/@openvulcan/dsh-vulcan-memory/package.json +63 -0
  122. package/node_modules/@openvulcan/dsh-vulcan-style/LICENSE +21 -0
  123. package/node_modules/@openvulcan/dsh-vulcan-style/assets/style-icon.png +0 -0
  124. package/node_modules/@openvulcan/dsh-vulcan-style/lib/client.js +1061 -0
  125. package/node_modules/@openvulcan/dsh-vulcan-style/lib/index.d.ts +34 -0
  126. package/node_modules/@openvulcan/dsh-vulcan-style/lib/index.js +42 -0
  127. package/node_modules/@openvulcan/dsh-vulcan-style/package.json +51 -0
  128. package/node_modules/@openvulcan/openvulcan-account/LICENSE +21 -0
  129. package/node_modules/@openvulcan/openvulcan-account/lib/account.d.ts +140 -0
  130. package/node_modules/@openvulcan/openvulcan-account/lib/account.js +347 -0
  131. package/node_modules/@openvulcan/openvulcan-account/lib/index.d.ts +1 -0
  132. package/node_modules/@openvulcan/openvulcan-account/lib/index.js +1 -0
  133. package/node_modules/@openvulcan/openvulcan-account/package.json +29 -0
  134. package/node_modules/@openvulcan/vulcan-decision/LICENSE +21 -0
  135. package/node_modules/@openvulcan/vulcan-decision/README.md +23 -0
  136. package/node_modules/@openvulcan/vulcan-decision/bin/vulcan-decision.js +4 -0
  137. package/node_modules/@openvulcan/vulcan-decision/lib/cli.d.ts +5 -0
  138. package/node_modules/@openvulcan/vulcan-decision/lib/cli.js +267 -0
  139. package/node_modules/@openvulcan/vulcan-decision/lib/cloud/edge.d.ts +211 -0
  140. package/node_modules/@openvulcan/vulcan-decision/lib/cloud/edge.js +594 -0
  141. package/node_modules/@openvulcan/vulcan-decision/lib/download.d.ts +36 -0
  142. package/node_modules/@openvulcan/vulcan-decision/lib/download.js +99 -0
  143. package/node_modules/@openvulcan/vulcan-decision/lib/engine.d.ts +37 -0
  144. package/node_modules/@openvulcan/vulcan-decision/lib/engine.js +39 -0
  145. package/node_modules/@openvulcan/vulcan-decision/lib/hardware.d.ts +105 -0
  146. package/node_modules/@openvulcan/vulcan-decision/lib/hardware.js +207 -0
  147. package/node_modules/@openvulcan/vulcan-decision/lib/home.d.ts +26 -0
  148. package/node_modules/@openvulcan/vulcan-decision/lib/home.js +54 -0
  149. package/node_modules/@openvulcan/vulcan-decision/lib/index.d.ts +17 -0
  150. package/node_modules/@openvulcan/vulcan-decision/lib/index.js +17 -0
  151. package/node_modules/@openvulcan/vulcan-decision/lib/local/engine.d.ts +54 -0
  152. package/node_modules/@openvulcan/vulcan-decision/lib/local/engine.js +157 -0
  153. package/node_modules/@openvulcan/vulcan-decision/lib/local/models.d.ts +126 -0
  154. package/node_modules/@openvulcan/vulcan-decision/lib/local/models.js +261 -0
  155. package/node_modules/@openvulcan/vulcan-decision/lib/local/packs.d.ts +102 -0
  156. package/node_modules/@openvulcan/vulcan-decision/lib/local/packs.js +195 -0
  157. package/node_modules/@openvulcan/vulcan-decision/lib/local/worker.d.ts +61 -0
  158. package/node_modules/@openvulcan/vulcan-decision/lib/local/worker.js +123 -0
  159. package/node_modules/@openvulcan/vulcan-decision/lib/protocol.d.ts +74 -0
  160. package/node_modules/@openvulcan/vulcan-decision/lib/protocol.js +31 -0
  161. package/node_modules/@openvulcan/vulcan-decision/lib/render.d.ts +15 -0
  162. package/node_modules/@openvulcan/vulcan-decision/lib/render.js +33 -0
  163. package/node_modules/@openvulcan/vulcan-decision/lib/version.d.ts +2 -0
  164. package/node_modules/@openvulcan/vulcan-decision/lib/version.js +4 -0
  165. package/node_modules/@openvulcan/vulcan-decision/package.json +40 -0
  166. package/node_modules/@openvulcan/vulcan-decision/python/vulcan_decision_worker.py +363 -0
  167. package/node_modules/@openvulcan/vulcan-decision/runtime-packs/onnx-cpu.json +627 -0
  168. package/node_modules/@openvulcan/vulcan-decision/runtime-packs/onnx-cuda.json +423 -0
  169. package/node_modules/@openvulcan/vulcan-decision/runtime-packs/torch-cpu.json +1047 -0
  170. package/node_modules/@openvulcan/vulcan-decision/runtime-packs/torch-cu128.json +647 -0
  171. package/package.json +53 -4
@@ -0,0 +1,1061 @@
1
+ window.__ModuleLoader__.load({
2
+ id: "@openvulcan/dsh-vulcan-style",
3
+ factory: (platformRequire) => {
4
+ var definitions = {
5
+ "./controller": function (module, exports, require) {
6
+ "use strict";
7
+ /**
8
+ * Keeps dsh's live theme in step with this plugin's settings: registers the Vulcan themes, applies
9
+ * the stored choice when the settings arrive and whenever they change, answers dsh's own preference
10
+ * changes (`policy.ts`), and stacks the square-corner layer. Also marks the document root while a
11
+ * Vulcan theme or square corners are active, which is what `style.ts` scopes its rules to.
12
+ */
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.SQUARE_ATTRIBUTE = exports.THEME_ATTRIBUTE = exports.DSH_THEME_SETTINGS = void 0;
15
+ exports.settingsWriter = settingsWriter;
16
+ exports.installThemeSync = installThemeSync;
17
+ const policy_1 = require("./policy");
18
+ const shared_1 = require("./shared");
19
+ const themes_1 = require("./themes");
20
+ /** dsh's own theme settings namespace (`THEME_SETTINGS_NAMESPACE` in dsh-client-ui-theme). */
21
+ exports.DSH_THEME_SETTINGS = 'ui-theme';
22
+ /** Root attribute naming the active Vulcan theme (`light`, `dark` or `command`). */
23
+ exports.THEME_ATTRIBUTE = 'data-vulcan-theme';
24
+ /** Root attribute present while the square-corner layer is stacked. */
25
+ exports.SQUARE_ATTRIBUTE = 'data-vulcan-square';
26
+ const log = (message, error) => {
27
+ console.warn(`[${shared_1.PACKAGE_NAME}] ${message}`, ...error === undefined ? [] : [error]);
28
+ };
29
+ function settingsWriter(form) {
30
+ return {
31
+ write: change => form.mutate(Object.entries(change).map(([key, value]) => ({ op: 'set', path: [key], value }))),
32
+ };
33
+ }
34
+ /** Register the themes and keep the preference in step; returns the disposer. */
35
+ function installThemeSync(ctx, form) {
36
+ const theme = ctx.theme;
37
+ const dshSettings = ctx.configForms.get(exports.DSH_THEME_SETTINGS);
38
+ const media = matchMedia('(prefers-color-scheme: dark)');
39
+ const root = document.documentElement;
40
+ let own = 0;
41
+ let live = true;
42
+ /** Settings arrived (or are unavailable, in which case the defaults apply). */
43
+ const settled = () => form.getSnapshot().status !== 'loading';
44
+ const settings = () => (0, shared_1.settingsOf)(form.getSnapshot().value);
45
+ /** The built-in preference dsh stores, which a Vulcan theme only covers while it is active. */
46
+ const storedBuiltin = () => {
47
+ const preference = dshSettings.getSnapshot().value?.preference;
48
+ return typeof preference === 'string' && (0, policy_1.isBuiltinPreference)(preference) ? preference : 'system';
49
+ };
50
+ /** Switch dsh's preference without treating the resulting change as someone else's. */
51
+ const set = (id) => {
52
+ if (theme.getTheme().preference === id)
53
+ return;
54
+ own += 1;
55
+ try {
56
+ theme.setTheme(id);
57
+ }
58
+ catch (error) {
59
+ log(`cannot switch the theme to ${id}`, error);
60
+ }
61
+ finally {
62
+ own -= 1;
63
+ }
64
+ };
65
+ const markTheme = (activeId) => {
66
+ if ((0, themes_1.isVulcanTheme)(activeId))
67
+ root.setAttribute(exports.THEME_ATTRIBUTE, activeId.slice('vulcan-'.length));
68
+ else
69
+ root.removeAttribute(exports.THEME_ATTRIBUTE);
70
+ };
71
+ /** Bring the live preference to the stored choice. */
72
+ const applyChoice = () => {
73
+ if (!live || !settled())
74
+ return;
75
+ const wanted = (0, policy_1.wantedTheme)(settings().theme, media.matches);
76
+ if (wanted !== undefined)
77
+ set(wanted);
78
+ else if ((0, themes_1.isVulcanTheme)(theme.getTheme().preference))
79
+ set(storedBuiltin());
80
+ };
81
+ const record = (choice) => {
82
+ const snapshot = form.getSnapshot();
83
+ if (snapshot.status !== 'ready' || !snapshot.writable) {
84
+ log(`cannot record the theme choice "${choice}": the plugin settings are not writable`);
85
+ return;
86
+ }
87
+ form.mutate([{ op: 'set', path: ['theme'], value: choice }]).then(accepted => { if (!accepted)
88
+ log(`the Host refused the theme choice "${choice}"`); }, (error) => { log(`cannot record the theme choice "${choice}"`, error); });
89
+ };
90
+ const registrations = themes_1.THEMES.map(definition => theme.register(definition));
91
+ markTheme(theme.getTheme().active.id);
92
+ const stopChange = ctx.on('theme/change', snapshot => {
93
+ markTheme(snapshot.active.id);
94
+ if (own > 0 || !live || !settled())
95
+ return;
96
+ const reaction = (0, policy_1.reactToPreference)({
97
+ choice: settings().theme,
98
+ prefersDark: media.matches,
99
+ preference: snapshot.preference,
100
+ // dsh emits synchronously from setTheme, so a pick in its Appearance row arrives while the
101
+ // click is still being dispatched; its own fallbacks arrive from settings callbacks.
102
+ userInput: (0, policy_1.isUserInputEvent)(window.event),
103
+ });
104
+ if (reaction.kind === 'record')
105
+ record(reaction.choice);
106
+ // Out of the emit, so every listener of this change sees it before the next one starts.
107
+ else if (reaction.kind === 'apply')
108
+ queueMicrotask(applyChoice);
109
+ });
110
+ let squareLayer;
111
+ const applyCorners = () => {
112
+ const wanted = live && settings().squareCorners;
113
+ if (wanted && squareLayer === undefined) {
114
+ squareLayer = theme.overrideTokens(shared_1.PACKAGE_NAME, (0, themes_1.squareCornerTokens)());
115
+ root.setAttribute(exports.SQUARE_ATTRIBUTE, '');
116
+ }
117
+ else if (!wanted && squareLayer !== undefined) {
118
+ squareLayer();
119
+ squareLayer = undefined;
120
+ root.removeAttribute(exports.SQUARE_ATTRIBUTE);
121
+ }
122
+ };
123
+ const onSettings = () => {
124
+ applyChoice();
125
+ if (settled())
126
+ applyCorners();
127
+ };
128
+ const stopSettings = form.subscribe(onSettings);
129
+ const onScheme = () => { if (settings().theme === 'vulcan-auto')
130
+ applyChoice(); };
131
+ media.addEventListener('change', onScheme);
132
+ onSettings();
133
+ return () => {
134
+ live = false;
135
+ stopChange();
136
+ stopSettings();
137
+ media.removeEventListener('change', onScheme);
138
+ applyCorners();
139
+ // Hand the page back to the user's built-in preference rather than dsh's default.
140
+ if ((0, themes_1.isVulcanTheme)(theme.getTheme().preference))
141
+ set(storedBuiltin());
142
+ for (const unregister of registrations)
143
+ unregister();
144
+ root.removeAttribute(exports.THEME_ATTRIBUTE);
145
+ };
146
+ }
147
+
148
+ },
149
+ "./dsh-client": function (module, exports, require) {
150
+ "use strict";
151
+ /**
152
+ * The parts of dsh's browser runtime this client half uses.
153
+ *
154
+ * dsh serves these modules from its page module table; their packages are not published at the
155
+ * Host's version, so the shapes are restated here from dsh 0.2.1-rc.2 and must be checked again when
156
+ * the supported dsh range moves:
157
+ * - `@deepseek-ai/dsh-client-ui-theme` `lib/types/client/index.d.ts` (`ThemeRuntime`, `ThemeSnapshot`,
158
+ * `theme/change`)
159
+ * - `packages/client/ui-settings/src/client/config-form-types.ts` (`ConfigForm`)
160
+ * - `packages/client/ui-settings/src/client/contract/slots.ts` (`settings.general.item`)
161
+ * - `packages/client/locale/src/client/index.ts` (`register`)
162
+ */
163
+ Object.defineProperty(exports, "__esModule", { value: true });
164
+
165
+ },
166
+ "./dsh-tokens": function (module, exports, require) {
167
+ "use strict";
168
+ /**
169
+ * Token names dsh 0.2.1-rc.2 declares in its theme stylesheets, generated by
170
+ * `scripts/extract-dsh-tokens.mjs` from `@deepseek-ai/dsh-client-ui-theme/lib/client.js`.
171
+ * Do not edit by hand; regenerate when the supported dsh range moves.
172
+ */
173
+ Object.defineProperty(exports, "__esModule", { value: true });
174
+ exports.RADIUS_TOKENS = exports.SHARED_SKIN_TOKENS = exports.SKIN_TOKENS = exports.DSH_TOKENS_VERSION = void 0;
175
+ /** The dsh release these names were read from. */
176
+ exports.DSH_TOKENS_VERSION = '0.2.1-rc.2';
177
+ /**
178
+ * Alias-layer and shell tokens the light palette (`body`) declares: the surface a theme restates.
179
+ * Static colour ramps, type tokens and radii are not part of it.
180
+ */
181
+ exports.SKIN_TOKENS = [
182
+ '--dsw-alias-bg-base',
183
+ '--dsw-alias-bg-document-preview',
184
+ '--dsw-alias-bg-document-selection',
185
+ '--dsw-alias-bg-layer-1',
186
+ '--dsw-alias-bg-layer-2',
187
+ '--dsw-alias-bg-layer-3',
188
+ '--dsw-alias-bg-mask-1',
189
+ '--dsw-alias-bg-mask-2',
190
+ '--dsw-alias-bg-mask-3',
191
+ '--dsw-alias-bg-mask-drop',
192
+ '--dsw-alias-bg-mask-photo',
193
+ '--dsw-alias-bg-module-platform',
194
+ '--dsw-alias-bg-multi-select',
195
+ '--dsw-alias-bg-overlay',
196
+ '--dsw-alias-bg-skeleton',
197
+ '--dsw-alias-border-inverted',
198
+ '--dsw-alias-border-inverted2',
199
+ '--dsw-alias-border-l1',
200
+ '--dsw-alias-border-l2',
201
+ '--dsw-alias-border-l2-darkmode-thin',
202
+ '--dsw-alias-border-l3',
203
+ '--dsw-alias-border-l4',
204
+ '--dsw-alias-brand-primary',
205
+ '--dsw-alias-brand-primary-invert',
206
+ '--dsw-alias-brand-primary-new-colorprimary-new-color',
207
+ '--dsw-alias-brand-text',
208
+ '--dsw-alias-button-contrast-fill',
209
+ '--dsw-alias-button-elevated-fill',
210
+ '--dsw-alias-button-floating-fill',
211
+ '--dsw-alias-button-floating-hover',
212
+ '--dsw-alias-button-ghost-active-border',
213
+ '--dsw-alias-button-ghost-active-fill',
214
+ '--dsw-alias-button-ghost-active-hover',
215
+ '--dsw-alias-button-info-fill',
216
+ '--dsw-alias-button-info-hover',
217
+ '--dsw-alias-button-primary-dimmed',
218
+ '--dsw-alias-button-primary-fill',
219
+ '--dsw-alias-button-primary-hover',
220
+ '--dsw-alias-button-tool-bar-fill',
221
+ '--dsw-alias-button-tool-bar-fill-invisible',
222
+ '--dsw-alias-button-tool-bar-hover',
223
+ '--dsw-alias-code-diff-added',
224
+ '--dsw-alias-code-diff-deleted',
225
+ '--dsw-alias-file-diff-added-bg',
226
+ '--dsw-alias-file-diff-added-gutter',
227
+ '--dsw-alias-file-diff-added-marker',
228
+ '--dsw-alias-file-diff-deleted-bg',
229
+ '--dsw-alias-file-diff-deleted-gutter',
230
+ '--dsw-alias-file-diff-deleted-marker',
231
+ '--dsw-alias-interactive-bg-active',
232
+ '--dsw-alias-interactive-bg-hover',
233
+ '--dsw-alias-interactive-bg-hover-accent',
234
+ '--dsw-alias-interactive-bg-hover-danger',
235
+ '--dsw-alias-interactive-bg-hover-solid',
236
+ '--dsw-alias-label-caption',
237
+ '--dsw-alias-label-deep-diving',
238
+ '--dsw-alias-label-deep-diving-shimmer',
239
+ '--dsw-alias-label-dimmed',
240
+ '--dsw-alias-label-document-preview',
241
+ '--dsw-alias-label-primary',
242
+ '--dsw-alias-label-primary-bluish',
243
+ '--dsw-alias-label-primary-dimmed',
244
+ '--dsw-alias-label-primary-foreground',
245
+ '--dsw-alias-label-primary-inverted',
246
+ '--dsw-alias-label-secondary',
247
+ '--dsw-alias-label-shimmer',
248
+ '--dsw-alias-label-tertiary',
249
+ '--dsw-alias-link',
250
+ '--dsw-alias-markdown-citation',
251
+ '--dsw-alias-markdown-code-block',
252
+ '--dsw-alias-markdown-code-block-banner',
253
+ '--dsw-alias-markdown-code-segment-selected',
254
+ '--dsw-alias-markdown-code-segment-unselected',
255
+ '--dsw-alias-markdown-inline-code',
256
+ '--dsw-alias-markdown-placeholder',
257
+ '--dsw-alias-markdown-tag',
258
+ '--dsw-alias-menu-group-header-fill',
259
+ '--dsw-alias-menu-icon',
260
+ '--dsw-alias-onboarding-accent',
261
+ '--dsw-alias-onboarding-card-fill',
262
+ '--dsw-alias-onboarding-checkbox-border',
263
+ '--dsw-alias-onboarding-secondary-fill',
264
+ '--dsw-alias-scrollbar-bg-l1',
265
+ '--dsw-alias-scrollbar-bg-l2',
266
+ '--dsw-alias-scrollbar-hover-l1',
267
+ '--dsw-alias-scrollbar-hover-l2',
268
+ '--dsw-alias-settings-card-fill',
269
+ '--dsw-alias-settings-card-stroke',
270
+ '--dsw-alias-state-business-primary',
271
+ '--dsw-alias-state-business-tertiary',
272
+ '--dsw-alias-state-error-primary',
273
+ '--dsw-alias-state-error-secondary',
274
+ '--dsw-alias-state-idle-primary',
275
+ '--dsw-alias-state-success-primary',
276
+ '--dsw-alias-state-success-secondary',
277
+ '--dsw-alias-state-success-tertiary',
278
+ '--dsw-alias-state-warn-label',
279
+ '--dsw-alias-state-warn-primary',
280
+ '--dsw-alias-state-warn-secondary',
281
+ '--dsw-alias-state-warn-tertiary',
282
+ '--dsw-alias-switch-thumb',
283
+ '--dsw-alias-toast-bg',
284
+ '--dsw-alias-toast-label',
285
+ '--dsw-alias-tooltip-bg',
286
+ '--dsw-alias-tooltip-key-bg',
287
+ '--dsw-alias-turn-trigger-bg',
288
+ '--dsw-alias-turn-trigger-bg-hover',
289
+ '--dsw-linear-gradient-think',
290
+ '--dsw-linear-think-select',
291
+ '--dsw-menu-surface-fill',
292
+ '--dsw-shadow-lv1',
293
+ '--dsw-shadow-lv1-blur',
294
+ '--dsw-shadow-lv2',
295
+ '--dsw-shadow-lv3',
296
+ '--dsw-specific-bubble',
297
+ '--dsw-specific-bubble-highlight',
298
+ '--dsw-specific-input-major',
299
+ '--dsw-specific-login-input',
300
+ '--dsw-specific-menu',
301
+ '--dsw-specific-selector',
302
+ '--dsw-specific-sidebar-fill',
303
+ '--dsw-specific-sidebar-nav-item-active',
304
+ '--dsw-specific-sidebar-nav-item-active-accent',
305
+ '--dsw-specific-sidebar-nav-item-hover',
306
+ '--dsw-specific-tip',
307
+ ];
308
+ /** Skin tokens the dark palette does not restate, so both palettes share the light value. */
309
+ exports.SHARED_SKIN_TOKENS = [
310
+ '--dsw-alias-onboarding-accent',
311
+ '--dsw-alias-settings-card-fill',
312
+ '--dsw-alias-settings-card-stroke',
313
+ '--dsw-shadow-lv1',
314
+ '--dsw-shadow-lv1-blur',
315
+ '--dsw-shadow-lv2',
316
+ '--dsw-shadow-lv3',
317
+ ];
318
+ /** Corner radius tokens (`:root` in base.css). */
319
+ exports.RADIUS_TOKENS = [
320
+ '--dsw-radius-lg',
321
+ '--dsw-radius-md',
322
+ '--dsw-radius-panel',
323
+ '--dsw-radius-sm',
324
+ '--dsw-radius-xl',
325
+ '--dsw-radius-xs',
326
+ ];
327
+
328
+ },
329
+ "./i18n": function (module, exports, require) {
330
+ "use strict";
331
+ /** The plugin's interface text; dsh picks the dictionary that matches its interface language. */
332
+ Object.defineProperty(exports, "__esModule", { value: true });
333
+ exports.en = exports.zh = void 0;
334
+ exports.zh = {
335
+ 'title': 'Vulcan 界面风格',
336
+ 'description': 'VulcanCode 的配色与直角外观。选择「使用 dsh 主题」时,由 dsh 的「外观」设置决定明暗。',
337
+ 'choice.vulcan-auto': '跟随系统',
338
+ 'choice.vulcan-light': '亮色',
339
+ 'choice.vulcan-dark': '暗色',
340
+ 'choice.vulcan-command': '指挥舱',
341
+ 'choice.dsh': '使用 dsh 主题',
342
+ 'square.title': '直角',
343
+ 'square.description': '把界面的圆角改为直角,可与任何主题搭配,包括 dsh 自带主题。',
344
+ 'saveFailed': '未能保存设置。',
345
+ 'readOnly': '当前配置为只读,无法修改。',
346
+ };
347
+ exports.en = {
348
+ 'title': 'Vulcan style',
349
+ 'description': 'VulcanCode colours and square corners. With "Use dsh theme", the Appearance setting of dsh decides light or dark.',
350
+ 'choice.vulcan-auto': 'Follow system',
351
+ 'choice.vulcan-light': 'Light',
352
+ 'choice.vulcan-dark': 'Dark',
353
+ 'choice.vulcan-command': 'Command',
354
+ 'choice.dsh': 'Use dsh theme',
355
+ 'square.title': 'Square corners',
356
+ 'square.description': 'Draw the interface with square corners; works with any theme, dsh\'s own included.',
357
+ 'saveFailed': 'The setting could not be saved.',
358
+ 'readOnly': 'The configuration is read-only.',
359
+ };
360
+
361
+ },
362
+ "./index": function (module, exports, require) {
363
+ "use strict";
364
+ Object.defineProperty(exports, "__esModule", { value: true });
365
+ exports.inject = void 0;
366
+ exports.apply = apply;
367
+ const jsx_runtime_1 = require("react/jsx-runtime");
368
+ /**
369
+ * Browser half of the dsh plugin: the VulcanCode look for the whole dsh web interface.
370
+ *
371
+ * - Registers the Vulcan light, dark and command themes and applies the stored choice on load.
372
+ * - Stacks the square-corner token layer over any theme, dsh's own included.
373
+ * - Adds a "Vulcan style" row to Settings › General, right after dsh's Appearance row, and the same
374
+ * form as this row's configuration page on the Plugins page.
375
+ *
376
+ * The choice lives in this plugin's settings because dsh persists only its built-in themes.
377
+ *
378
+ * dsh loads these files as one lazy factory; they may import only modules dsh serves to plugins.
379
+ */
380
+ const controller_1 = require("./controller");
381
+ const i18n_1 = require("./i18n");
382
+ const settings_1 = require("./settings");
383
+ const shared_1 = require("./shared");
384
+ const style_1 = require("./style");
385
+ exports.inject = ['slots', 'locale', 'remote', 'configForms', 'theme'];
386
+ /**
387
+ * The row's configuration on the Plugins page: the description as its one-liner, the settings row as its page.
388
+ * The page passes its own `form` prop (a snapshot without subscription), so the live form travels in a closure.
389
+ */
390
+ const rowConfig = (injected) => function RowConfig({ view, t }) {
391
+ return view === 'summary' ? t('description') : (0, jsx_runtime_1.jsx)(settings_1.StyleRow, { ...injected, t: t });
392
+ };
393
+ function apply(ctx) {
394
+ const form = ctx.configForms.get(shared_1.ENTRY_ID);
395
+ const injected = { form, writer: (0, controller_1.settingsWriter)(form) };
396
+ ctx.effect(() => (0, style_1.installStyle)(), 'vulcan-style: stylesheet');
397
+ ctx.effect(() => ctx.locale.register(shared_1.NAMESPACE, { zh: i18n_1.zh, en: i18n_1.en }), 'vulcan-style: dictionaries');
398
+ ctx.effect(() => (0, controller_1.installThemeSync)(ctx, form), 'vulcan-style: themes');
399
+ // dsh's Appearance row is order 10 and its font rows 11.
400
+ ctx.slots.inject('settings.general.item', () => ctx.slots.register({
401
+ name: 'settings.general.item',
402
+ id: 'vulcan-style',
403
+ order: 10.5,
404
+ locale: shared_1.NAMESPACE,
405
+ inject: () => injected,
406
+ }, settings_1.StyleRow));
407
+ // The Plugins page renders no form of its own; it shows this entry when the row's configure control is opened.
408
+ ctx.slots.inject('plugins.row.config', () => ctx.slots.register({
409
+ name: 'plugins.row.config',
410
+ key: shared_1.ROW_CONFIG_KEY,
411
+ locale: shared_1.NAMESPACE,
412
+ inject: () => ({}),
413
+ }, rowConfig(injected)));
414
+ }
415
+
416
+ },
417
+ "./palette": function (module, exports, require) {
418
+ "use strict";
419
+ /**
420
+ * VulcanCode's three palettes, restated from its ui-kit
421
+ * (`apps/vulcan-code-web/src/ui-kit/styles/tokens.css`, the `--vk-*` skin surface). Re-read that file
422
+ * when VulcanCode's palette changes.
423
+ *
424
+ * Neutrals carry the structure, the flame ("ember") is ambience and AI activity only, and a cool
425
+ * "signal" hue marks focus, selection and links. The command palette's translucent panels sit over
426
+ * a HUD grid in VulcanCode; dsh paints them as plain surfaces, so they are restated here as the
427
+ * opaque colour they produce over the command ground.
428
+ */
429
+ Object.defineProperty(exports, "__esModule", { value: true });
430
+ exports.COMMAND = exports.DARK = exports.LIGHT = void 0;
431
+ exports.LIGHT = {
432
+ scheme: 'light',
433
+ ground: '#f2f3f5',
434
+ ground2: '#ebedf0',
435
+ panel: '#ffffff',
436
+ raised: '#ffffff',
437
+ sunken: '#f6f7f9',
438
+ hover: '#e8ebef',
439
+ select: '#e3e9f8',
440
+ hoverWash: 'rgba(20, 23, 28, 0.09)',
441
+ selectWash: 'rgba(46, 88, 204, 0.13)',
442
+ line: '#dde1e6',
443
+ lineStrong: '#c3c9d1',
444
+ lineSoft: '#eaecef',
445
+ ink: '#14171c',
446
+ ink2: '#4a515c',
447
+ ink3: '#626973',
448
+ inkInverse: '#ffffff',
449
+ ember: '#e2511a',
450
+ ember2: '#f5872e',
451
+ emberSoft: '#fcebe2',
452
+ emberInk: '#ad3d0d',
453
+ signal: '#2e58cc',
454
+ signalSoft: '#e4eafa',
455
+ ok: '#18774a',
456
+ warn: '#945d09',
457
+ bad: '#c3303d',
458
+ codeBg: '#f4f5f7',
459
+ diffAddBg: '#e6f4eb',
460
+ diffAddInk: '#16643d',
461
+ diffDelBg: '#fbe9ea',
462
+ diffDelInk: '#a32632',
463
+ shadow1: '0 1px 2px rgba(17, 21, 28, 0.05)',
464
+ shadow2: '0 12px 32px rgba(17, 21, 28, 0.14), 0 2px 6px rgba(17, 21, 28, 0.06)',
465
+ shade: '16, 19, 24',
466
+ scrim: 'rgba(16, 19, 24, 0.08)',
467
+ scrollbar: '#c3c9d1',
468
+ scrollbarHover: '#626973',
469
+ ambient: 'radial-gradient(70rem 30rem at 8% -12%, rgba(226, 81, 26, 0.07), transparent 62%), '
470
+ + 'radial-gradient(60rem 36rem at 105% 0%, rgba(46, 88, 204, 0.05), transparent 60%)',
471
+ };
472
+ exports.DARK = {
473
+ scheme: 'dark',
474
+ ground: '#0c0e11',
475
+ ground2: '#101317',
476
+ panel: '#15181d',
477
+ raised: '#1b1f25',
478
+ sunken: '#0f1215',
479
+ hover: '#1e2329',
480
+ select: '#1c2537',
481
+ hoverWash: 'rgba(230, 233, 237, 0.06)',
482
+ selectWash: 'rgba(125, 157, 255, 0.11)',
483
+ line: '#23282f',
484
+ lineStrong: '#343b45',
485
+ lineSoft: '#1a1e24',
486
+ ink: '#e6e9ed',
487
+ ink2: '#a2aab5',
488
+ ink3: '#848c97',
489
+ inkInverse: '#0c0e11',
490
+ ember: '#ff6a2b',
491
+ ember2: '#ff9a40',
492
+ emberSoft: '#2a1810',
493
+ emberInk: '#ff9b68',
494
+ signal: '#7d9dff',
495
+ signalSoft: '#1a2236',
496
+ ok: '#3fc48a',
497
+ warn: '#e0a83a',
498
+ bad: '#f0646f',
499
+ codeBg: '#111418',
500
+ diffAddBg: '#0f251a',
501
+ diffAddInk: '#72d6a2',
502
+ diffDelBg: '#2d1316',
503
+ diffDelInk: '#f38c94',
504
+ shadow1: '0 1px 2px rgba(0, 0, 0, 0.4)',
505
+ shadow2: '0 16px 40px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.4)',
506
+ shade: '0, 0, 0',
507
+ scrim: 'rgba(0, 0, 0, 0.18)',
508
+ scrollbar: '#343b45',
509
+ scrollbarHover: '#848c97',
510
+ ambient: 'radial-gradient(64rem 30rem at 50% 118%, rgba(255, 106, 43, 0.11), transparent 66%), '
511
+ + 'radial-gradient(52rem 26rem at -4% -8%, rgba(125, 157, 255, 0.06), transparent 60%)',
512
+ };
513
+ exports.COMMAND = {
514
+ scheme: 'dark',
515
+ ground: '#03060b',
516
+ // rgba(5, 11, 18, 0.86) over the ground.
517
+ ground2: '#050a11',
518
+ // rgba(8, 17, 27, 0.78) over the ground.
519
+ panel: '#070f18',
520
+ raised: '#0a1520',
521
+ // rgba(2, 7, 12, 0.82) over the ground.
522
+ sunken: '#02070c',
523
+ // rgba(56, 214, 255, 0.07) and 0.13 over the panel.
524
+ hover: '#0a1d28',
525
+ select: '#0d2936',
526
+ hoverWash: 'rgba(56, 214, 255, 0.07)',
527
+ selectWash: 'rgba(56, 214, 255, 0.13)',
528
+ line: '#12303e',
529
+ lineStrong: '#1d4b60',
530
+ lineSoft: '#0c2230',
531
+ ink: '#d8f3ff',
532
+ ink2: '#8cb2c3',
533
+ ink3: '#6d92a3',
534
+ inkInverse: '#03060b',
535
+ ember: '#ff7a2f',
536
+ ember2: '#ffb24a',
537
+ // rgba(255, 122, 47, 0.12) over the panel.
538
+ emberSoft: '#251c1b',
539
+ emberInk: '#ffa56d',
540
+ signal: '#38d6ff',
541
+ // rgba(56, 214, 255, 0.12) over the panel.
542
+ signalSoft: '#0d2734',
543
+ ok: '#34e5a1',
544
+ warn: '#ffc44d',
545
+ bad: '#ff5068',
546
+ // rgba(2, 8, 14, 0.85) over the ground.
547
+ codeBg: '#02080e',
548
+ // rgba(52, 229, 161, 0.1) and rgba(255, 80, 104, 0.1) over the code background.
549
+ diffAddBg: '#071e1d',
550
+ diffAddInk: '#6ff0bf',
551
+ diffDelBg: '#1b0f17',
552
+ diffDelInk: '#ff8d9f',
553
+ shadow1: '0 0 0 1px rgba(56, 214, 255, 0.04)',
554
+ shadow2: '0 0 0 1px rgba(56, 214, 255, 0.22), 0 18px 48px rgba(0, 0, 0, 0.7), 0 0 32px rgba(56, 214, 255, 0.08)',
555
+ shade: '1, 4, 9',
556
+ scrim: 'rgba(1, 4, 9, 0.22)',
557
+ // color-mix(in srgb, signal 38%, transparent), as VulcanCode's command scrollbar.
558
+ scrollbar: 'rgba(56, 214, 255, 0.38)',
559
+ scrollbarHover: '#6d92a3',
560
+ ambient: 'radial-gradient(70rem 26rem at 50% 116%, rgba(255, 122, 47, 0.16), transparent 70%), '
561
+ + 'radial-gradient(90rem 34rem at 50% -24%, rgba(56, 214, 255, 0.11), transparent 66%), '
562
+ + 'repeating-linear-gradient(0deg, rgba(56, 214, 255, 0.04) 0 1px, transparent 1px 32px), '
563
+ + 'repeating-linear-gradient(90deg, rgba(56, 214, 255, 0.04) 0 1px, transparent 1px 32px)',
564
+ };
565
+
566
+ },
567
+ "./policy": function (module, exports, require) {
568
+ "use strict";
569
+ /**
570
+ * How the plugin's stored choice and dsh's live theme preference stay in step.
571
+ *
572
+ * dsh persists only its built-in preferences (`light`, `dark`, `system`), so a Vulcan theme is
573
+ * re-applied from this plugin's own settings on every load. dsh also falls back to its stored
574
+ * built-in preference by itself, for instance after any change to its own theme settings (a font
575
+ * size) or when its settings arrive after this plugin applied a theme. Such a fallback is not the
576
+ * user's choice, and the Vulcan theme is applied again. A preference the user picks with a pointer
577
+ * or key press in dsh's own Appearance row is their choice and is recorded instead.
578
+ */
579
+ Object.defineProperty(exports, "__esModule", { value: true });
580
+ exports.BUILTIN_PREFERENCES = void 0;
581
+ exports.isBuiltinPreference = isBuiltinPreference;
582
+ exports.wantedTheme = wantedTheme;
583
+ exports.reactToPreference = reactToPreference;
584
+ exports.isUserInputEvent = isUserInputEvent;
585
+ const themes_1 = require("./themes");
586
+ /** dsh's built-in theme preferences. */
587
+ exports.BUILTIN_PREFERENCES = ['light', 'dark', 'system'];
588
+ function isBuiltinPreference(value) {
589
+ return exports.BUILTIN_PREFERENCES.includes(value);
590
+ }
591
+ /** The Vulcan theme a choice asks for, or undefined when dsh's own setting decides. */
592
+ function wantedTheme(choice, prefersDark) {
593
+ if (choice === 'dsh')
594
+ return undefined;
595
+ if (choice === 'vulcan-auto')
596
+ return prefersDark ? 'vulcan-dark' : 'vulcan-light';
597
+ return choice;
598
+ }
599
+ /** Decide how to answer a theme preference change this plugin did not make itself. */
600
+ function reactToPreference({ choice, prefersDark, preference, userInput }) {
601
+ const wanted = wantedTheme(choice, prefersDark);
602
+ if (userInput) {
603
+ if ((0, themes_1.isVulcanTheme)(preference))
604
+ return preference === wanted ? { kind: 'none' } : { kind: 'record', choice: preference };
605
+ // A built-in preference, or another plugin's theme: dsh's setting decides from now on.
606
+ return choice === 'dsh' ? { kind: 'none' } : { kind: 'record', choice: 'dsh' };
607
+ }
608
+ if (wanted === undefined || preference === wanted)
609
+ return { kind: 'none' };
610
+ // dsh fell back to its stored preference, or a Vulcan theme no longer matches the system scheme.
611
+ if (isBuiltinPreference(preference) || (0, themes_1.isVulcanTheme)(preference))
612
+ return { kind: 'apply', id: wanted };
613
+ // Another plugin applied its own theme without user input; leave it until the next load.
614
+ return { kind: 'none' };
615
+ }
616
+ /** Event types that carry a user's deliberate choice. */
617
+ const USER_INPUT_EVENTS = new Set(['click', 'keydown', 'keyup', 'pointerup', 'mouseup', 'touchend', 'change', 'input', 'submit']);
618
+ /** Whether the event being dispatched right now is a trusted user input event. */
619
+ function isUserInputEvent(event) {
620
+ return event !== undefined && event.isTrusted && USER_INPUT_EVENTS.has(event.type);
621
+ }
622
+
623
+ },
624
+ "./settings": function (module, exports, require) {
625
+ "use strict";
626
+ Object.defineProperty(exports, "__esModule", { value: true });
627
+ exports.StyleRow = StyleRow;
628
+ const jsx_runtime_1 = require("react/jsx-runtime");
629
+ /** The "Vulcan style" row in Settings › General: theme choice and the square-corner switch. */
630
+ const react_1 = require("react");
631
+ const shared_1 = require("./shared");
632
+ const themes_1 = require("./themes");
633
+ /** Colour strip previewing a choice: canvas, panel, ink and the ember accent. */
634
+ const swatchOf = (choice) => {
635
+ switch (choice) {
636
+ case 'vulcan-auto': return [themes_1.PALETTES['vulcan-light'], themes_1.PALETTES['vulcan-dark']];
637
+ case 'dsh': return [];
638
+ default: return [themes_1.PALETTES[choice]];
639
+ }
640
+ };
641
+ function Swatch({ choice }) {
642
+ const palettes = swatchOf(choice);
643
+ if (palettes.length === 0) {
644
+ return (0, jsx_runtime_1.jsxs)("span", { className: "vst-swatch", "aria-hidden": "true", children: [(0, jsx_runtime_1.jsx)("span", { style: { background: 'var(--dsw-alias-bg-base)' } }), (0, jsx_runtime_1.jsx)("span", { style: { background: 'var(--dsw-alias-bg-module-platform)' } }), (0, jsx_runtime_1.jsx)("span", { style: { background: 'var(--dsw-alias-label-primary)' } })] });
645
+ }
646
+ return (0, jsx_runtime_1.jsxs)("span", { className: "vst-swatch", "aria-hidden": "true", children: [palettes.map(p => [
647
+ (0, jsx_runtime_1.jsx)("span", { style: { background: p.ground } }, `${p.ground}g`),
648
+ (0, jsx_runtime_1.jsx)("span", { style: { background: p.panel } }, `${p.ground}p`),
649
+ (0, jsx_runtime_1.jsx)("span", { style: { background: p.ink } }, `${p.ground}i`),
650
+ ]), (0, jsx_runtime_1.jsx)("span", { "data-accent": true, style: { background: palettes[0]?.ember } })] });
651
+ }
652
+ function StyleRow({ form, writer, t }) {
653
+ const translate = t;
654
+ const subscribe = (0, react_1.useCallback)((listener) => form.subscribe(listener), [form]);
655
+ const snapshot = (0, react_1.useSyncExternalStore)(subscribe, () => form.getSnapshot());
656
+ const settings = (0, shared_1.settingsOf)(snapshot.value);
657
+ const writable = snapshot.status === 'ready' && snapshot.writable;
658
+ const [failed, setFailed] = (0, react_1.useState)(false);
659
+ const write = (change) => {
660
+ setFailed(false);
661
+ writer.write(change).then(accepted => { if (!accepted)
662
+ setFailed(true); }, () => { setFailed(true); });
663
+ };
664
+ return (0, jsx_runtime_1.jsxs)("div", { className: "vst", children: [(0, jsx_runtime_1.jsxs)("div", { className: "vst-head", children: [(0, jsx_runtime_1.jsx)("div", { className: "vst-title", children: translate('title') }), (0, jsx_runtime_1.jsx)("div", { className: "vst-desc", children: translate('description') })] }), (0, jsx_runtime_1.jsx)("div", { className: "vst-choices", role: "group", "aria-label": translate('title'), children: shared_1.THEME_CHOICES.map(choice => ((0, jsx_runtime_1.jsxs)("button", { type: "button", className: "vst-choice", "aria-pressed": settings.theme === choice, disabled: !writable, onClick: () => { if (settings.theme !== choice)
665
+ write({ theme: choice }); }, children: [(0, jsx_runtime_1.jsx)(Swatch, { choice: choice }), translate(`choice.${choice}`)] }, choice))) }), (0, jsx_runtime_1.jsxs)("div", { className: "vst-switch-row", children: [(0, jsx_runtime_1.jsxs)("div", { className: "vst-head", children: [(0, jsx_runtime_1.jsx)("div", { className: "vst-title", children: translate('square.title') }), (0, jsx_runtime_1.jsx)("div", { className: "vst-desc", children: translate('square.description') })] }), (0, jsx_runtime_1.jsx)("button", { type: "button", role: "switch", className: "vst-switch", "aria-checked": settings.squareCorners, "aria-label": translate('square.title'), disabled: !writable, onClick: () => { write({ squareCorners: !settings.squareCorners }); } })] }), snapshot.status === 'ready' && !snapshot.writable && (0, jsx_runtime_1.jsx)("div", { className: "vst-desc", children: translate('readOnly') }), failed && (0, jsx_runtime_1.jsx)("div", { className: "vst-error", role: "alert", children: translate('saveFailed') })] });
666
+ }
667
+
668
+ },
669
+ "./shared": function (module, exports, require) {
670
+ "use strict";
671
+ /** Names and settings shapes shared by the controller, the settings row and the host schema. */
672
+ Object.defineProperty(exports, "__esModule", { value: true });
673
+ exports.DEFAULT_SETTINGS = exports.THEME_CHOICES = exports.NAMESPACE = exports.ROW_CONFIG_KEY = exports.SUITE_PACKAGE = exports.ENTRY_ID = exports.PACKAGE_NAME = void 0;
674
+ exports.isThemeChoice = isThemeChoice;
675
+ exports.settingsOf = settingsOf;
676
+ /** Must equal this package's name. */
677
+ exports.PACKAGE_NAME = '@openvulcan/dsh-vulcan-style';
678
+ /** The Host entry id of this plugin's row in the suite patch, which names its configuration namespace. */
679
+ exports.ENTRY_ID = 'vulcan-style';
680
+ /** The suite bundle whose patch declares this plugin's row; must equal that package's name. */
681
+ exports.SUITE_PACKAGE = '@openvulcan/dsh-vulcancode';
682
+ /** The Plugins page's key for this row's configuration page: `<bundle package>#<row id>`. */
683
+ exports.ROW_CONFIG_KEY = `${exports.SUITE_PACKAGE}#${exports.ENTRY_ID}`;
684
+ /** Locale namespace of this plugin's interface text. */
685
+ exports.NAMESPACE = 'vulcan-style';
686
+ /**
687
+ * What the user chose; mirrors `THEME_CHOICES` in `src/index.ts`.
688
+ *
689
+ * - `vulcan-auto`: Vulcan light or dark, following the system colour scheme.
690
+ * - `vulcan-light` / `vulcan-dark` / `vulcan-command`: that Vulcan theme.
691
+ * - `dsh`: leave the theme to dsh's own Appearance setting.
692
+ */
693
+ exports.THEME_CHOICES = ['vulcan-auto', 'vulcan-light', 'vulcan-dark', 'vulcan-command', 'dsh'];
694
+ /** Mirrors the defaults in `src/index.ts`. */
695
+ exports.DEFAULT_SETTINGS = { theme: 'vulcan-auto', squareCorners: true };
696
+ /** Whether a value is a known theme choice. */
697
+ function isThemeChoice(value) {
698
+ return typeof value === 'string' && exports.THEME_CHOICES.includes(value);
699
+ }
700
+ /** The accepted settings, falling back per field to the defaults while the Host has not answered. */
701
+ function settingsOf(value) {
702
+ return {
703
+ theme: isThemeChoice(value?.theme) ? value.theme : exports.DEFAULT_SETTINGS.theme,
704
+ squareCorners: typeof value?.squareCorners === 'boolean' ? value.squareCorners : exports.DEFAULT_SETTINGS.squareCorners,
705
+ };
706
+ }
707
+
708
+ },
709
+ "./style": function (module, exports, require) {
710
+ "use strict";
711
+ /**
712
+ * The plugin's stylesheet, in two parts:
713
+ *
714
+ * - The settings row (`.vst-*`), drawn with dsh's alias tokens so it follows whatever theme is active.
715
+ * - VulcanCode's shell elements that dsh draws differently and no token reaches: the ember marks on
716
+ * the current place, the framed menus and dialogs, the settings navigation, and the VulcanCode
717
+ * symbol beside dsh's own brand.
718
+ * These rules apply only while a Vulcan theme is active (`html[data-vulcan-theme]`, set by
719
+ * `controller.ts`) and reach dsh only through stable hooks: slot names (`data-slot`, whose elements
720
+ * are `display: contents`, so rules go to their children or ancestors), other data attributes, ARIA
721
+ * roles and states, and the semantic `md-*` classes, never the hashed CSS-module class names.
722
+ */
723
+ Object.defineProperty(exports, "__esModule", { value: true });
724
+ exports.installStyle = installStyle;
725
+ const controller_1 = require("./controller");
726
+ const shared_1 = require("./shared");
727
+ const themes_1 = require("./themes");
728
+ /**
729
+ * The VulcanCode symbol as a CSS image: the chevron in the theme's ink and the flame in the brand
730
+ * gradient. The paths are the symbol in the suite's `packages/dsh-vulcancode/assets/openvulcan-icon.svg`;
731
+ * re-read it when the logo changes.
732
+ */
733
+ function vulcanMark(ink, width, height) {
734
+ const svg = `<svg xmlns='http://www.w3.org/2000/svg' width='${width}' height='${height}' viewBox='32 29 232 259'>`
735
+ + `<defs><linearGradient id='flame' x1='0%' y1='100%' x2='100%' y2='0%'>`
736
+ + `<stop offset='0%' stop-color='#FF6527'/><stop offset='100%' stop-color='#F44E1C'/></linearGradient></defs>`
737
+ + `<path d='M 2 0 L 84 0 C 88 0 91 1 95 5 L 153 76 C 159 83 159 95 153 102 L 95 173 C 91 177 88 178 84 178 L 2 178 L 78 89 Z'`
738
+ + ` fill='${ink}' transform='translate(30 110)'/>`
739
+ + `<path d='M 73 0 C 64 14 51 28 38 40 C 21 55 7 68 2 87 C -2 107 8 129 25 150 C 39 134 53 119 67 107`
740
+ + ` C 82 95 91 79 93 60 C 95 40 86 18 73 0 Z' fill='url(#flame)' transform='translate(169 29)'/></svg>`;
741
+ return `url("data:image/svg+xml,${encodeURIComponent(svg)}")`;
742
+ }
743
+ /** Plugin variables per Vulcan theme, read by the scoped rules below. */
744
+ const themeVariables = (name, p) => `html[${controller_1.THEME_ATTRIBUTE}="${name}"] {
745
+ --vulcan-mark-sm: ${vulcanMark(p.ink, 13, 15)};
746
+ --vulcan-mark-lg: ${vulcanMark(p.ink, 22, 25)};
747
+ --vulcan-ground-2: ${p.ground2};
748
+ --vulcan-panel: ${p.panel};
749
+ --vulcan-hover: ${p.hover};
750
+ --vulcan-line: ${p.line};
751
+ --vulcan-line-strong: ${p.lineStrong};
752
+ --vulcan-ink: ${p.ink};
753
+ --vulcan-ink-2: ${p.ink2};
754
+ --vulcan-ink-3: ${p.ink3};
755
+ --vulcan-ink-inverse: ${p.inkInverse};
756
+ --vulcan-ember: ${p.ember};
757
+ --vulcan-signal-soft: ${p.signalSoft};
758
+ --vulcan-shadow-1: ${p.shadow1};
759
+ --vulcan-shadow-2: ${p.shadow2};
760
+ --vulcan-scrim: ${p.scrim};
761
+ --vulcan-ambient: ${p.ambient};
762
+ }`;
763
+ /** Root of every scoped rule. */
764
+ const V = `html[${controller_1.THEME_ATTRIBUTE}]`;
765
+ /** The settings dialog. */
766
+ const SETTINGS = `${V} [data-shortcut-modal="settings"]`;
767
+ /** The workspace tree in the sidebar. */
768
+ const TREE = `${V} [data-slot="sidebar.workspaces"] [role="tree"]`;
769
+ const VULCAN = `
770
+ ${themes_1.VULCAN_THEME_IDS.map(id => themeVariables(id.slice('vulcan-'.length), themes_1.PALETTES[id])).join('\n')}
771
+ ${V} {
772
+ --vulcan-tick-w: 28px;
773
+ --vulcan-font-mono: "Geist Mono", "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
774
+ --vulcan-label-font: inherit;
775
+ --vulcan-label-case: none;
776
+ --vulcan-label-track: 0;
777
+ }
778
+ /* The command bridge sets its labels in capitals of the mono face, as VulcanCode's HUD does. */
779
+ html[${controller_1.THEME_ATTRIBUTE}="command"] {
780
+ --vulcan-label-font: var(--vulcan-font-mono);
781
+ --vulcan-label-case: uppercase;
782
+ --vulcan-label-track: 0.08em;
783
+ }
784
+ ${V} ::selection { background: var(--vulcan-signal-soft); color: var(--dsw-alias-label-primary); }
785
+ /* The ember and signal glow behind the conversation; its scroll port is transparent over the canvas. */
786
+ ${V} [data-conversation-scroll] { background-image: var(--vulcan-ambient); background-attachment: fixed; }
787
+ /* Code blocks are framed objects in VulcanCode: a hairline frame and a ruled header. */
788
+ ${V} .md-code-block { border: 1px solid var(--dsw-alias-border-l2); }
789
+ ${V} .md-code-block [data-code-block-banner] { border-bottom: 1px solid var(--dsw-alias-border-l1); }
790
+
791
+ /* The VulcanCode symbol joins DeepSeek's own brand, after the sidebar wordmark and the welcome fish;
792
+ dsh's brand stays as it is. The empty alt text after the slash keeps the symbol silent to screen readers. */
793
+ ${V} [data-slot="sidebar.brand.name"]::after { content: var(--vulcan-mark-sm) / ""; display: inline-flex; flex: none; align-items: center; }
794
+ ${V} [data-slot="conversation.hero.brand.mark"]::after { content: var(--vulcan-mark-lg) / ""; display: inline-flex; flex: none; align-items: center; margin-left: 8px; }
795
+
796
+ /* Sidebar. New session is VulcanCode's primary action: an ink plate. */
797
+ ${V} [data-slot="sidebar"] > * > button[aria-keyshortcuts] { background: var(--vulcan-ink); color: var(--vulcan-ink-inverse); box-shadow: 0 0 0 1px var(--vulcan-ink); }
798
+ ${V} [data-slot="sidebar"] > * > button[aria-keyshortcuts]:hover { background: color-mix(in srgb, var(--vulcan-ink) 86%, var(--vulcan-ground-2)); }
799
+ /* Its shortcut hint is dsh's tertiary grey, which vanishes on the ink plate; it takes the plate's own ink, one step down. */
800
+ ${V} [data-slot="sidebar"] > * > button[aria-keyshortcuts] :is(:has(> kbd), kbd) { color: color-mix(in srgb, var(--vulcan-ink-inverse) 70%, var(--vulcan-ink)); }
801
+ /* The current session is a framed panel row with an ember edge; its workspace's folder takes the ember. */
802
+ ${TREE} [role="treeitem"][aria-selected="true"] { position: relative; background: var(--vulcan-panel); box-shadow: inset 0 0 0 1px var(--vulcan-line); color: var(--vulcan-ink); }
803
+ ${TREE} [role="treeitem"][aria-selected="true"]::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 2px; background: var(--vulcan-ember); pointer-events: none; }
804
+ ${TREE} [role="treeitem"][data-row-key^="workspace:"] > :first-child { color: var(--vulcan-ink-3); }
805
+ ${TREE} > :has([role="treeitem"][aria-selected="true"]) [role="treeitem"][data-row-key^="workspace:"] > :first-child { color: var(--vulcan-ember); }
806
+ /* The account row sits under a rule, like VulcanCode's sidebar foot. */
807
+ ${V} [data-slot="sidebar"] > * > :has(> * > [data-slot="sidebar.settings"]) { padding-top: 6px; box-shadow: 0 -1px 0 var(--vulcan-line); }
808
+
809
+ /* Composer: a quiet floating card whose edge deepens while typing. */
810
+ ${V} [data-composer-card] { box-shadow: 0 0 0 1px var(--vulcan-line-strong), var(--vulcan-shadow-1); transition: box-shadow .16s ease; }
811
+ ${V} [data-composer-card]:focus-within { box-shadow: 0 0 0 1px var(--vulcan-ink-3), var(--vulcan-shadow-2); }
812
+
813
+ /* Menus and dialogs are framed raised plates; a dialog's backdrop is a light frosted glass. */
814
+ ${V} [role="menu"][data-menu-material] { box-shadow: 0 0 0 1px var(--vulcan-line-strong), var(--vulcan-shadow-2); }
815
+ ${V} [role="dialog"][aria-modal="true"] { box-shadow: 0 0 0 1px var(--vulcan-line-strong), var(--vulcan-shadow-2); }
816
+ ${V} [aria-hidden="true"]:has(+ [role="dialog"][aria-modal="true"]) { background: var(--vulcan-scrim); backdrop-filter: blur(3px) saturate(1.05); }
817
+
818
+ /* Settings: an ember corner tick and a navigation well whose current page carries the ember edge. */
819
+ ${SETTINGS}::before { content: ""; position: absolute; z-index: 1; top: -1px; left: -1px; width: var(--vulcan-tick-w); height: 2px; background: var(--vulcan-ember); pointer-events: none; }
820
+ ${SETTINGS} > nav { background: var(--vulcan-ground-2); box-shadow: inset -1px 0 0 var(--vulcan-line); }
821
+ ${SETTINGS} > nav button { color: var(--vulcan-ink-2); }
822
+ ${SETTINGS} > nav button:hover { background: var(--vulcan-hover); color: var(--vulcan-ink); }
823
+ ${SETTINGS} > nav button[aria-current="true"] { background: var(--vulcan-panel); color: var(--vulcan-ink); box-shadow: inset 2px 0 0 var(--vulcan-ember), 0 0 0 1px var(--vulcan-line); }
824
+ ${SETTINGS} > nav button[aria-current="true"] svg { color: var(--vulcan-ember); }
825
+ ${V} [data-slot="settings.header"] { color: var(--vulcan-ink-3); font-family: var(--vulcan-label-font); font-size: 12px; font-weight: 500; letter-spacing: var(--vulcan-label-track); text-transform: var(--vulcan-label-case); }
826
+ `;
827
+ const ROW = `
828
+ .vst { display: flex; flex-direction: column; gap: 12px; padding: 16px 0; border-bottom: 0.5px solid var(--dsw-alias-border-l2); }
829
+ .vst-head { display: flex; flex-direction: column; gap: 4px; }
830
+ .vst-title { font-size: 14px; line-height: 22px; color: var(--dsw-alias-label-primary); }
831
+ .vst-desc { font-size: 12px; line-height: 18px; color: var(--dsw-alias-label-tertiary); }
832
+ .vst-error { font-size: 12px; line-height: 18px; color: var(--dsw-alias-state-error-primary); }
833
+ .vst-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
834
+ .vst-choice { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 10px; border: 0.5px solid var(--dsw-alias-border-l4); border-radius: var(--dsw-radius-md); background: transparent; color: var(--dsw-alias-label-primary); font: inherit; font-size: 13px; line-height: 20px; text-align: left; cursor: pointer; }
835
+ .vst-choice:disabled { cursor: default; opacity: .6; }
836
+ @media (hover: hover) { .vst-choice:hover:not([aria-pressed="true"]):not(:disabled) { background: var(--dsw-alias-interactive-bg-hover); } }
837
+ .vst-choice[aria-pressed="true"] { background: var(--dsw-alias-bg-module-platform); border-color: var(--dsw-alias-label-tertiary); }
838
+ .vst-swatch { display: flex; height: 28px; overflow: hidden; border: 0.5px solid var(--dsw-alias-border-l2); border-radius: var(--dsw-radius-xs); }
839
+ .vst-swatch > span { flex: 1; }
840
+ .vst-swatch > span[data-accent] { flex: 0 0 6px; }
841
+ .vst-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
842
+ .vst-switch { position: relative; flex: none; width: 36px; height: 20px; padding: 0; border: 0.5px solid var(--dsw-alias-border-l4); border-radius: 999px; background: var(--dsw-alias-bg-module-platform); cursor: pointer; }
843
+ .vst-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 999px; background: var(--dsw-alias-label-tertiary); transition: transform .15s ease; }
844
+ .vst-switch[aria-checked="true"] { background: var(--dsw-alias-state-business-primary); border-color: var(--dsw-alias-state-business-primary); }
845
+ .vst-switch[aria-checked="true"]::after { background: var(--dsw-alias-label-primary-foreground); transform: translateX(16px); }
846
+ .vst-switch:disabled { cursor: default; opacity: .6; }
847
+ html[${controller_1.SQUARE_ATTRIBUTE}] .vst-switch,
848
+ html[${controller_1.SQUARE_ATTRIBUTE}] .vst-switch::after { border-radius: 0; }
849
+ `;
850
+ /** Add the stylesheet once per page; returns a function that removes it again. */
851
+ function installStyle() {
852
+ document.querySelector(`style[data-plugin="${shared_1.PACKAGE_NAME}"]`)?.remove();
853
+ const tag = document.createElement('style');
854
+ tag.dataset['plugin'] = shared_1.PACKAGE_NAME;
855
+ tag.textContent = VULCAN + ROW;
856
+ document.head.appendChild(tag);
857
+ return () => { tag.remove(); };
858
+ }
859
+
860
+ },
861
+ "./themes": function (module, exports, require) {
862
+ "use strict";
863
+ /**
864
+ * The three Vulcan themes: VulcanCode's palettes mapped by meaning onto dsh's alias layer.
865
+ *
866
+ * The map's type is `Record<SkinToken, string>`, so it names every skin token dsh declares
867
+ * (`dsh-tokens.ts`) and nothing else; a dsh release that adds or drops one fails the build until the
868
+ * mapping is reviewed. Fonts, type sizes and spacing stay dsh's: they are user settings or layout.
869
+ */
870
+ Object.defineProperty(exports, "__esModule", { value: true });
871
+ exports.THEMES = exports.PALETTES = exports.VULCAN_THEME_IDS = void 0;
872
+ exports.skinTokens = skinTokens;
873
+ exports.isVulcanTheme = isVulcanTheme;
874
+ exports.squareCornerTokens = squareCornerTokens;
875
+ const dsh_tokens_1 = require("./dsh-tokens");
876
+ const palette_1 = require("./palette");
877
+ /** Theme ids this plugin registers with dsh. */
878
+ exports.VULCAN_THEME_IDS = ['vulcan-light', 'vulcan-dark', 'vulcan-command'];
879
+ /** `color-mix` of two colours in sRGB, `share` percent of the first. */
880
+ const mix = (first, share, second) => `color-mix(in srgb, ${first} ${share}%, ${second})`;
881
+ const fade = (color, share) => mix(color, share, 'transparent');
882
+ const shade = (p, alpha) => `rgba(${p.shade}, ${alpha})`;
883
+ const light = (p) => p.scheme === 'light';
884
+ /** Every dsh skin token, restated from one palette. */
885
+ function skinTokens(p) {
886
+ return {
887
+ // Surfaces: canvas, framed objects, floating objects, wells.
888
+ '--dsw-alias-bg-base': p.ground,
889
+ '--dsw-alias-bg-layer-1': p.panel,
890
+ '--dsw-alias-bg-layer-2': p.raised,
891
+ '--dsw-alias-bg-layer-3': mix(p.raised, 94, p.ink),
892
+ '--dsw-alias-bg-module-platform': p.sunken,
893
+ '--dsw-alias-bg-overlay': p.hover,
894
+ '--dsw-alias-bg-multi-select': p.select,
895
+ '--dsw-alias-bg-skeleton': fade(p.ink, 7),
896
+ '--dsw-alias-bg-document-preview': p.ground2,
897
+ '--dsw-alias-bg-document-selection': fade(p.signal, 35),
898
+ '--dsw-alias-label-document-preview': p.ink2,
899
+ '--dsw-alias-bg-mask-1': shade(p, light(p) ? 0.24 : 0.5),
900
+ '--dsw-alias-bg-mask-2': shade(p, light(p) ? 0.12 : 0.2),
901
+ '--dsw-alias-bg-mask-3': shade(p, 0.48),
902
+ '--dsw-alias-bg-mask-photo': shade(p, 0.88),
903
+ '--dsw-alias-bg-mask-drop': fade(p.panel, 70),
904
+ '--dsw-alias-settings-card-fill': p.panel,
905
+ '--dsw-alias-settings-card-stroke': p.line,
906
+ // Borders: VulcanCode's three hairline weights.
907
+ '--dsw-alias-border-l1': p.lineSoft,
908
+ '--dsw-alias-border-l2': p.line,
909
+ '--dsw-alias-border-l2-darkmode-thin': light(p) ? p.line : p.lineSoft,
910
+ '--dsw-alias-border-l3': mix(p.line, 50, p.lineStrong),
911
+ '--dsw-alias-border-l4': p.lineStrong,
912
+ '--dsw-alias-border-inverted': light(p) ? 'transparent' : p.lineSoft,
913
+ '--dsw-alias-border-inverted2': light(p) ? 'transparent' : p.line,
914
+ // Text tiers.
915
+ '--dsw-alias-label-primary': p.ink,
916
+ '--dsw-alias-label-primary-dimmed': p.ink,
917
+ '--dsw-alias-label-primary-bluish': mix(p.ink, 80, p.signal),
918
+ '--dsw-alias-label-secondary': p.ink2,
919
+ '--dsw-alias-label-tertiary': p.ink3,
920
+ '--dsw-alias-label-caption': p.ink3,
921
+ '--dsw-alias-label-dimmed': p.lineStrong,
922
+ '--dsw-alias-label-primary-foreground': p.inkInverse,
923
+ '--dsw-alias-label-primary-inverted': p.inkInverse,
924
+ '--dsw-alias-label-shimmer': fade(p.ink, light(p) ? 30 : 45),
925
+ '--dsw-alias-menu-icon': p.ink2,
926
+ '--dsw-alias-link': p.signal,
927
+ // Brand: ink carries structure; the ember is ambience and AI activity.
928
+ '--dsw-alias-brand-primary': p.ink,
929
+ '--dsw-alias-brand-primary-invert': p.ink,
930
+ '--dsw-alias-brand-text': p.ink,
931
+ '--dsw-alias-brand-primary-new-colorprimary-new-color': p.ember,
932
+ '--dsw-alias-label-deep-diving': p.emberInk,
933
+ '--dsw-alias-label-deep-diving-shimmer': p.ember2,
934
+ '--dsw-alias-onboarding-accent': p.ember,
935
+ '--dsw-alias-onboarding-card-fill': fade(p.panel, 80),
936
+ '--dsw-alias-onboarding-secondary-fill': p.raised,
937
+ '--dsw-alias-onboarding-checkbox-border': p.lineStrong,
938
+ // Buttons: VulcanCode's primary is an ink fill. dsh's info fill is the send button, which is
939
+ // VulcanCode's one ember control in the composer.
940
+ '--dsw-alias-button-primary-fill': p.ink,
941
+ '--dsw-alias-button-primary-hover': mix(p.ink, 86, p.ground),
942
+ '--dsw-alias-button-primary-dimmed': mix(p.ink, 14, p.raised),
943
+ '--dsw-alias-button-contrast-fill': light(p) ? p.ink2 : p.ink,
944
+ '--dsw-alias-button-elevated-fill': p.raised,
945
+ '--dsw-alias-button-floating-fill': p.raised,
946
+ '--dsw-alias-button-floating-hover': p.hover,
947
+ '--dsw-alias-button-ghost-active-fill': p.select,
948
+ '--dsw-alias-button-ghost-active-hover': mix(p.select, 90, p.ink),
949
+ '--dsw-alias-button-ghost-active-border': p.ink3,
950
+ '--dsw-alias-button-info-fill': p.ember,
951
+ '--dsw-alias-button-info-hover': p.ember2,
952
+ '--dsw-alias-button-tool-bar-fill': shade(p, 0.5),
953
+ '--dsw-alias-button-tool-bar-fill-invisible': shade(p, 0.36),
954
+ '--dsw-alias-button-tool-bar-hover': shade(p, 0.6),
955
+ '--dsw-alias-switch-thumb': light(p) ? p.inkInverse : p.ink2,
956
+ // Interaction washes, usable over any surface.
957
+ '--dsw-alias-interactive-bg-hover': p.hoverWash,
958
+ '--dsw-alias-interactive-bg-hover-solid': p.hover,
959
+ '--dsw-alias-interactive-bg-active': p.selectWash,
960
+ '--dsw-alias-interactive-bg-hover-accent': fade(p.signal, 18),
961
+ '--dsw-alias-interactive-bg-hover-danger': fade(p.bad, 10),
962
+ '--dsw-alias-turn-trigger-bg': p.sunken,
963
+ '--dsw-alias-turn-trigger-bg-hover': p.hoverWash,
964
+ // States.
965
+ '--dsw-alias-state-business-primary': p.signal,
966
+ '--dsw-alias-state-business-tertiary': p.signalSoft,
967
+ '--dsw-alias-state-error-primary': p.bad,
968
+ '--dsw-alias-state-error-secondary': mix(p.bad, 80, p.inkInverse),
969
+ '--dsw-alias-state-success-primary': p.ok,
970
+ '--dsw-alias-state-success-secondary': mix(p.ok, 80, p.inkInverse),
971
+ '--dsw-alias-state-success-tertiary': mix(p.ok, 14, p.panel),
972
+ '--dsw-alias-state-warn-label': p.warn,
973
+ '--dsw-alias-state-warn-primary': p.warn,
974
+ '--dsw-alias-state-warn-secondary': mix(p.warn, 80, p.inkInverse),
975
+ '--dsw-alias-state-warn-tertiary': mix(p.warn, 14, p.panel),
976
+ '--dsw-alias-state-idle-primary': p.lineStrong,
977
+ // Code and diffs.
978
+ '--dsw-alias-markdown-code-block': p.codeBg,
979
+ '--dsw-alias-markdown-code-block-banner': p.codeBg,
980
+ '--dsw-alias-markdown-code-segment-selected': p.panel,
981
+ '--dsw-alias-markdown-code-segment-unselected': p.sunken,
982
+ '--dsw-alias-markdown-inline-code': p.codeBg,
983
+ '--dsw-alias-markdown-citation': p.hover,
984
+ '--dsw-alias-markdown-placeholder': p.sunken,
985
+ '--dsw-alias-markdown-tag': p.hover,
986
+ '--dsw-alias-code-diff-added': p.diffAddBg,
987
+ '--dsw-alias-code-diff-deleted': p.diffDelBg,
988
+ '--dsw-alias-file-diff-added-bg': p.diffAddBg,
989
+ '--dsw-alias-file-diff-added-gutter': mix(p.diffAddBg, 60, p.codeBg),
990
+ '--dsw-alias-file-diff-added-marker': p.diffAddInk,
991
+ '--dsw-alias-file-diff-deleted-bg': p.diffDelBg,
992
+ '--dsw-alias-file-diff-deleted-gutter': mix(p.diffDelBg, 60, p.codeBg),
993
+ '--dsw-alias-file-diff-deleted-marker': p.diffDelInk,
994
+ // Floating feedback: VulcanCode's tooltip is an ink plate.
995
+ '--dsw-alias-tooltip-bg': p.ink,
996
+ '--dsw-alias-tooltip-key-bg': mix(p.ink, 82, p.inkInverse),
997
+ '--dsw-alias-toast-bg': p.ink,
998
+ '--dsw-alias-toast-label': p.inkInverse,
999
+ // Menus are solid raised plates, as in VulcanCode.
1000
+ '--dsw-menu-surface-fill': p.raised,
1001
+ '--dsw-alias-menu-group-header-fill': p.raised,
1002
+ '--dsw-specific-menu': p.raised,
1003
+ '--dsw-alias-scrollbar-bg-l1': p.scrollbar,
1004
+ '--dsw-alias-scrollbar-bg-l2': p.scrollbar,
1005
+ '--dsw-alias-scrollbar-hover-l1': p.scrollbarHover,
1006
+ '--dsw-alias-scrollbar-hover-l2': p.scrollbarHover,
1007
+ '--dsw-shadow-lv1': p.shadow1,
1008
+ '--dsw-shadow-lv1-blur': p.shadow1,
1009
+ '--dsw-shadow-lv2': p.shadow1,
1010
+ '--dsw-shadow-lv3': p.shadow2,
1011
+ '--dsw-linear-gradient-think': `linear-gradient(180deg, ${p.ground} 20.19%, ${fade(p.ground, 0)} 100%)`,
1012
+ '--dsw-linear-think-select': `linear-gradient(180deg, ${p.sunken} 20.19%, ${fade(p.sunken, 0)} 100%)`,
1013
+ // Shell: the navigation well, the composer, the user's prompts.
1014
+ '--dsw-specific-sidebar-fill': p.ground2,
1015
+ '--dsw-specific-sidebar-nav-item-hover': p.hover,
1016
+ '--dsw-specific-sidebar-nav-item-active': p.select,
1017
+ '--dsw-specific-sidebar-nav-item-active-accent': p.emberSoft,
1018
+ '--dsw-specific-input-major': p.raised,
1019
+ '--dsw-specific-login-input': p.sunken,
1020
+ '--dsw-specific-bubble': p.panel,
1021
+ '--dsw-specific-bubble-highlight': p.select,
1022
+ '--dsw-specific-selector': p.sunken,
1023
+ '--dsw-specific-tip': p.sunken,
1024
+ };
1025
+ }
1026
+ /** Each theme's palette. */
1027
+ exports.PALETTES = {
1028
+ 'vulcan-light': palette_1.LIGHT,
1029
+ 'vulcan-dark': palette_1.DARK,
1030
+ 'vulcan-command': palette_1.COMMAND,
1031
+ };
1032
+ /** The definitions registered with dsh, in display order. */
1033
+ exports.THEMES = exports.VULCAN_THEME_IDS.map(id => ({
1034
+ id,
1035
+ colorScheme: exports.PALETTES[id].scheme,
1036
+ tokens: skinTokens(exports.PALETTES[id]),
1037
+ }));
1038
+ /** Whether a theme id is one of this plugin's. */
1039
+ function isVulcanTheme(id) {
1040
+ return exports.VULCAN_THEME_IDS.includes(id);
1041
+ }
1042
+ /** The override layer that squares every corner dsh draws through its radius tokens, in both palettes. */
1043
+ function squareCornerTokens() {
1044
+ return Object.fromEntries(dsh_tokens_1.RADIUS_TOKENS.map(name => [name, { light: '0px', dark: '0px' }]));
1045
+ }
1046
+
1047
+ },
1048
+ };
1049
+ var cache = {};
1050
+ function load(request) {
1051
+ if (!(request in definitions)) return platformRequire(request);
1052
+ if (!(request in cache)) {
1053
+ var module = { exports: {} };
1054
+ cache[request] = module;
1055
+ definitions[request](module, module.exports, load);
1056
+ }
1057
+ return cache[request].exports;
1058
+ }
1059
+ return load('./index');
1060
+ }
1061
+ });