dsh-any-background 0.2.6 → 0.2.8

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/lib/index.js CHANGED
@@ -69,7 +69,9 @@ const DEFAULT_CONFIG = {
69
69
  settings: 0,
70
70
  chat: 0,
71
71
  trajectory: 0,
72
- input: 0
72
+ input: 0,
73
+ panel: 0,
74
+ produced: 0
73
75
  },
74
76
  settingsOpacity: 1,
75
77
  wallpaperOpacity: 1,
@@ -95,6 +97,8 @@ const DEFAULT_CONFIG = {
95
97
  regenerateOnReload: false,
96
98
  chatTextOpacity: 0,
97
99
  trajectoryOpacity: 1,
100
+ panelOpacity: 1,
101
+ producedOpacity: 1,
98
102
  profiles: [],
99
103
  rotation: {
100
104
  enabled: false,
@@ -203,7 +207,9 @@ function normalizeConfig(raw) {
203
207
  "settings",
204
208
  "chat",
205
209
  "trajectory",
206
- "input"
210
+ "input",
211
+ "panel",
212
+ "produced"
207
213
  ]) blurs[k] = clamp(bl[k], 0, 60, DEFAULT_CONFIG.blurs[k]);
208
214
  return {
209
215
  color,
@@ -226,6 +232,8 @@ function normalizeConfig(raw) {
226
232
  regenerateOnReload: typeof r.regenerateOnReload === "boolean" ? r.regenerateOnReload : DEFAULT_CONFIG.regenerateOnReload,
227
233
  chatTextOpacity: clamp(r.chatTextOpacity, 0, 1, DEFAULT_CONFIG.chatTextOpacity),
228
234
  trajectoryOpacity: clamp(r.trajectoryOpacity, 0, 1, DEFAULT_CONFIG.trajectoryOpacity),
235
+ panelOpacity: clamp(r.panelOpacity, 0, 1, DEFAULT_CONFIG.panelOpacity),
236
+ producedOpacity: clamp(r.producedOpacity, 0, 1, DEFAULT_CONFIG.producedOpacity),
229
237
  profiles: normalizeProfiles(r.profiles),
230
238
  rotation: normalizeRotation(r.rotation),
231
239
  schedule: normalizeSchedule(r.schedule),
@@ -286,7 +294,9 @@ function normalizeProfileAppearance(raw) {
286
294
  "settings",
287
295
  "chat",
288
296
  "trajectory",
289
- "input"
297
+ "input",
298
+ "panel",
299
+ "produced"
290
300
  ]) blurs[k] = clamp(bl[k], 0, 60, DEFAULT_CONFIG.blurs[k]);
291
301
  return {
292
302
  color: Array.isArray(c) && c.length === 3 && c.every((x) => typeof x === "number" && isFinite(x)) ? [
@@ -305,7 +315,9 @@ function normalizeProfileAppearance(raw) {
305
315
  wallpaperOpacity: clamp(a.wallpaperOpacity, 0, 1, DEFAULT_CONFIG.wallpaperOpacity),
306
316
  blur: clamp(a.blur, 0, 60, DEFAULT_CONFIG.blur),
307
317
  chatTextOpacity: clamp(a.chatTextOpacity, 0, 1, DEFAULT_CONFIG.chatTextOpacity),
308
- trajectoryOpacity: clamp(a.trajectoryOpacity, 0, 1, DEFAULT_CONFIG.trajectoryOpacity)
318
+ trajectoryOpacity: clamp(a.trajectoryOpacity, 0, 1, DEFAULT_CONFIG.trajectoryOpacity),
319
+ panelOpacity: clamp(a.panelOpacity, 0, 1, DEFAULT_CONFIG.panelOpacity),
320
+ producedOpacity: clamp(a.producedOpacity, 0, 1, DEFAULT_CONFIG.producedOpacity)
309
321
  };
310
322
  }
311
323
  function normalizeProfiles(raw) {
@@ -379,10 +391,34 @@ async function readConfig() {
379
391
  return { ...DEFAULT_CONFIG };
380
392
  }
381
393
  }
394
+ const LEGACY_CONFIG_KEYS = /* @__PURE__ */ new Set(["opacity"]);
395
+ const warnedConfigKeys = /* @__PURE__ */ new Set();
396
+ function warnUnknownConfigKeys(raw, normalized) {
397
+ if (raw === null || typeof raw !== "object") return;
398
+ const r = raw;
399
+ const warn = (id) => {
400
+ if (warnedConfigKeys.has(id)) return;
401
+ warnedConfigKeys.add(id);
402
+ console.warn(`dsh-any-background: ignoring unknown config field "${id}" (declared in one half only?)`);
403
+ };
404
+ const known = new Set(Object.keys(normalized));
405
+ for (const key of Object.keys(r)) {
406
+ if (known.has(key) || LEGACY_CONFIG_KEYS.has(key)) continue;
407
+ warn(key);
408
+ }
409
+ for (const group of ["blurs", "opacities"]) {
410
+ const got = r[group];
411
+ if (got === null || typeof got !== "object") continue;
412
+ const have = new Set(Object.keys(normalized[group]));
413
+ for (const key of Object.keys(got)) if (!have.has(key)) warn(`${group}.${key}`);
414
+ }
415
+ }
382
416
  async function writeConfig(config) {
383
417
  await ensureDir();
384
418
  try {
385
- await writeFile(configPath(), JSON.stringify(normalizeConfig(config), null, 2), "utf8");
419
+ const normalized = normalizeConfig(config);
420
+ warnUnknownConfigKeys(config, normalized);
421
+ await writeFile(configPath(), JSON.stringify(normalized, null, 2), "utf8");
386
422
  return true;
387
423
  } catch (e) {
388
424
  console.error(`dsh-any-background: failed to write "${CONFIG_FILE}"`, e);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-any-background",
3
- "version": "0.2.6",
3
+ "version": "0.2.8",
4
4
  "description": "Appearance plugin for DeepSeek Harness: custom theme color (PS-style color wheel), background wallpaper with opacity/blur controls, and separate main/settings interface opacity.",
5
5
  "keywords": [
6
6
  "deepseek-harness",
@@ -23,7 +23,7 @@
23
23
  "author": "Tkingxiao",
24
24
  "type": "module",
25
25
  "engines": {
26
- "dsh": ">=0.1.2-alpha.4"
26
+ "dsh": ">=0.1.5-rc.2"
27
27
  },
28
28
  "exports": {
29
29
  ".": {
@@ -104,13 +104,6 @@
104
104
  "dsh": {
105
105
  "compatibility": {
106
106
  "dshReleases": {
107
- "0.1.2-alpha.4": "compatible",
108
- "0.1.2-alpha.5": "compatible",
109
- "0.1.2-rc.1": "compatible",
110
- "0.1.3-alpha.2": "compatible",
111
- "0.1.5-alpha.1": "compatible",
112
- "0.1.5-alpha.2": "compatible",
113
- "0.1.5-rc.1": "compatible",
114
107
  "0.1.5-rc.2": "compatible"
115
108
  }
116
109
  },