dsh-any-background 0.2.7 → 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
@@ -70,7 +70,8 @@ const DEFAULT_CONFIG = {
70
70
  chat: 0,
71
71
  trajectory: 0,
72
72
  input: 0,
73
- panel: 0
73
+ panel: 0,
74
+ produced: 0
74
75
  },
75
76
  settingsOpacity: 1,
76
77
  wallpaperOpacity: 1,
@@ -97,6 +98,7 @@ const DEFAULT_CONFIG = {
97
98
  chatTextOpacity: 0,
98
99
  trajectoryOpacity: 1,
99
100
  panelOpacity: 1,
101
+ producedOpacity: 1,
100
102
  profiles: [],
101
103
  rotation: {
102
104
  enabled: false,
@@ -206,7 +208,8 @@ function normalizeConfig(raw) {
206
208
  "chat",
207
209
  "trajectory",
208
210
  "input",
209
- "panel"
211
+ "panel",
212
+ "produced"
210
213
  ]) blurs[k] = clamp(bl[k], 0, 60, DEFAULT_CONFIG.blurs[k]);
211
214
  return {
212
215
  color,
@@ -230,6 +233,7 @@ function normalizeConfig(raw) {
230
233
  chatTextOpacity: clamp(r.chatTextOpacity, 0, 1, DEFAULT_CONFIG.chatTextOpacity),
231
234
  trajectoryOpacity: clamp(r.trajectoryOpacity, 0, 1, DEFAULT_CONFIG.trajectoryOpacity),
232
235
  panelOpacity: clamp(r.panelOpacity, 0, 1, DEFAULT_CONFIG.panelOpacity),
236
+ producedOpacity: clamp(r.producedOpacity, 0, 1, DEFAULT_CONFIG.producedOpacity),
233
237
  profiles: normalizeProfiles(r.profiles),
234
238
  rotation: normalizeRotation(r.rotation),
235
239
  schedule: normalizeSchedule(r.schedule),
@@ -291,7 +295,8 @@ function normalizeProfileAppearance(raw) {
291
295
  "chat",
292
296
  "trajectory",
293
297
  "input",
294
- "panel"
298
+ "panel",
299
+ "produced"
295
300
  ]) blurs[k] = clamp(bl[k], 0, 60, DEFAULT_CONFIG.blurs[k]);
296
301
  return {
297
302
  color: Array.isArray(c) && c.length === 3 && c.every((x) => typeof x === "number" && isFinite(x)) ? [
@@ -311,7 +316,8 @@ function normalizeProfileAppearance(raw) {
311
316
  blur: clamp(a.blur, 0, 60, DEFAULT_CONFIG.blur),
312
317
  chatTextOpacity: clamp(a.chatTextOpacity, 0, 1, DEFAULT_CONFIG.chatTextOpacity),
313
318
  trajectoryOpacity: clamp(a.trajectoryOpacity, 0, 1, DEFAULT_CONFIG.trajectoryOpacity),
314
- panelOpacity: clamp(a.panelOpacity, 0, 1, DEFAULT_CONFIG.panelOpacity)
319
+ panelOpacity: clamp(a.panelOpacity, 0, 1, DEFAULT_CONFIG.panelOpacity),
320
+ producedOpacity: clamp(a.producedOpacity, 0, 1, DEFAULT_CONFIG.producedOpacity)
315
321
  };
316
322
  }
317
323
  function normalizeProfiles(raw) {
@@ -385,10 +391,34 @@ async function readConfig() {
385
391
  return { ...DEFAULT_CONFIG };
386
392
  }
387
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
+ }
388
416
  async function writeConfig(config) {
389
417
  await ensureDir();
390
418
  try {
391
- 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");
392
422
  return true;
393
423
  } catch (e) {
394
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.7",
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",