dsh-web-icon-indicator 0.3.1 → 0.4.1

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 CHANGED
@@ -7,6 +7,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.4.1](https://github.com/waknow/dsh-web-icon-indicator/compare/v0.4.0...v0.4.1) (2026-09-04)
11
+
12
+ ### Added
13
+
14
+ * add marketplace screenshots.json and ship it in the npm tarball ([8efb5e7](https://github.com/waknow/dsh-web-icon-indicator/commit/8efb5e752c2759681bfbf78b9ccd8650d1f6973a))
15
+ * declare DSH host requirement via engines.dsh ([ec1be5c](https://github.com/waknow/dsh-web-icon-indicator/commit/ec1be5c6723a1237c68acc317bd26580fd06d9d0))
16
+
17
+ ### Changed
18
+
19
+ * document declaring/updating the DSH host requirement (engines.dsh) ([fb568b7](https://github.com/waknow/dsh-web-icon-indicator/commit/fb568b71362b4931712240087213845cfb3b76ee))
20
+ ## [0.4.0](https://github.com/waknow/dsh-web-icon-indicator/compare/v0.3.1...v0.4.0) (2026-09-04)
21
+
22
+ ### Added
23
+
24
+ * support DSH 0.1.2 settings service and configuration card ([de3019e](https://github.com/waknow/dsh-web-icon-indicator/commit/de3019e347fdbd3a512604a8377adc7523305730))
25
+
26
+ ### Changed
27
+
28
+ * auto-create GitHub Release after successful npm publish ([02d98e3](https://github.com/waknow/dsh-web-icon-indicator/commit/02d98e3db9f83013a3e7667c6a0848efecb8ef37))
29
+ * note DSH 0.1.2 support and add a version-support banner ([cd42d2c](https://github.com/waknow/dsh-web-icon-indicator/commit/cd42d2c5b5650800e3620c5806b1b4ac2b25c84f))
10
30
  ## [0.3.1](https://github.com/waknow/dsh-web-icon-indicator/compare/v0.3.0...v0.3.1) (2026-09-02)
11
31
 
12
32
  ### Fixed
@@ -16,6 +36,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
16
36
  ### Changed
17
37
 
18
38
  * add multi-agent count visualization to READMEs ([4326456](https://github.com/waknow/dsh-web-icon-indicator/commit/4326456d60f4f90bab16a3424f91b9550e25da8a))
39
+
19
40
  ## [0.3.0](https://github.com/waknow/dsh-web-icon-indicator/compare/v0.2.3...v0.3.0) (2026-08-31)
20
41
 
21
42
  ### Added
package/README.md CHANGED
@@ -7,6 +7,8 @@
7
7
  [![npm downloads](https://img.shields.io/npm/dm/dsh-web-icon-indicator)](https://www.npmjs.com/package/dsh-web-icon-indicator)
8
8
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE)
9
9
 
10
+ > **⚠️ DSH version support** — requires **DSH ≥ 0.1.2** (the settings-service API the configuration card uses). Built & verified against **DSH 0.1.2-rc.1**, the highest version currently tested. On **DSH < 0.1.2** the favicon still works, but the settings UI (**Settings → Plugins → Plugin config**) is unavailable.
11
+
10
12
  Browser tab favicon reflects the current DSH session state — `idle` / `running` / `asking` / `done` — so you can see at a glance whether a session needs your attention, even when the tab is in the background.
11
13
 
12
14
  ## ✨ What it does
@@ -151,7 +153,7 @@ Entries are shallow-merged over the defaults, so you can override only a few sta
151
153
  done: { effect: heartbeat, colors: ['#2ECC71'] }
152
154
  ```
153
155
 
154
- ### Settings page & `settings.yaml` (DSH ≥ rc7)
156
+ ### Settings page & `settings.yaml` (DSH ≥ 0.1.2)
155
157
 
156
158
  The plugin registers the whole config surface above with the DSH settings
157
159
  service under the `web-icon-indicator` namespace (a schemastery schema in
package/README.zh.md CHANGED
@@ -7,6 +7,8 @@
7
7
  [![npm downloads](https://img.shields.io/npm/dm/dsh-web-icon-indicator)](https://www.npmjs.com/package/dsh-web-icon-indicator)
8
8
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE)
9
9
 
10
+ > **⚠️ DSH 版本支持** —— 需要 **DSH ≥ 0.1.2**(设置卡片所用的 settings 服务 API)。已针对当前最高测试版本 **DSH 0.1.2-rc.1** 构建并验证。在 **DSH < 0.1.2** 上 favicon 仍可用,但设置页(**设置 → 插件 → 插件配置**)不可用。
11
+
10
12
  浏览器标签页 favicon 实时反映 DSH 会话状态——`待机` / `运行中` / `提问` / `完成`——让你在标签页置于后台时也能一眼看出是否有会话需要处理。
11
13
 
12
14
  ## ✨ 功能特性
@@ -146,7 +148,7 @@ config:
146
148
  done: { effect: heartbeat, colors: ['#2ECC71'] }
147
149
  ```
148
150
 
149
- ### 设置页与 `settings.yaml`(DSH ≥ rc7
151
+ ### 设置页与 `settings.yaml`(DSH ≥ 0.1.2
150
152
 
151
153
  插件把上面整套配置注册进 DSH settings 服务,命名空间为 `web-icon-indicator`
152
154
  (schema 为 `lib/index.js` 中的 schemastery schema):
package/lib/index.js CHANGED
@@ -69,7 +69,6 @@
69
69
  import { dirname, join } from "node:path";
70
70
  import { fileURLToPath } from "node:url";
71
71
  import z from "@deepseek-ai/schemastery";
72
- import { installSettingsSection, settingsNamespace } from "@deepseek-ai/dsh-settings";
73
72
 
74
73
  const __dirname = dirname(fileURLToPath(import.meta.url));
75
74
 
@@ -98,8 +97,12 @@ const STATE_NAMES = ["idle", "running", "asking", "done"];
98
97
  * Settings namespace under which this plugin's config is registered (the
99
98
  * `web-icon-indicator:` section of the profile's settings.yaml, surfaced in
100
99
  * 设置 → 插件 → 插件配置). Lowercase kebab, per the settings domain's rule.
100
+ *
101
+ * Since DSH 0.1.2 the namespace is a plain string literal (the type-level
102
+ * `SettingsNamespace` brand exists only at compile time; the runtime value is
103
+ * the same string), so no helper import is needed here.
101
104
  */
102
- const SETTINGS_NAMESPACE = settingsNamespace("web-icon-indicator");
105
+ const SETTINGS_NAMESPACE = "web-icon-indicator";
103
106
 
104
107
  /**
105
108
  * Schemastery schema mirroring `DEFAULTS`. Registered with the settings
@@ -420,8 +423,15 @@ export default {
420
423
  /** Settings namespace + validation schema (exported for reuse/tooling). */
421
424
  SETTINGS_NAMESPACE,
422
425
  CONFIG_SCHEMA,
423
- apply(ctx) {
424
- const entry = ctx.get("config") || {};
426
+ apply(ctx, config) {
427
+ // Cordis passes the resolved composition config as the second argument
428
+ // (`apply(ctx, config)`). `config` is the row's own `config` from the
429
+ // profile composition (merged over the schema only when a `Config` schema
430
+ // is declared); this plugin merges its `DEFAULTS` itself via `resolveConfig`,
431
+ // so an absent row config simply yields the defaults. Fall back to the old
432
+ // `ctx.get("config")` read for compatibility (it is undefined on the host
433
+ // but kept for the zero-dep test harness and older hosts).
434
+ const entry = config ?? ctx.get("config") ?? {};
425
435
  let source = () => entry;
426
436
  // Merge each configured state over its default: { effect, colors, speed }.
427
437
  // Idempotent on schema-resolved values, so it doubles as the fallback
@@ -456,22 +466,34 @@ export default {
456
466
  .replace("__CFG__", JSON.stringify({ states: c.states }));
457
467
  let script = buildScript(cfg);
458
468
  let iconsDir = resolveIconsDir(cfg.iconsDir);
459
- installSettingsSection(ctx, SETTINGS_NAMESPACE, CONFIG_SCHEMA, entry, {
460
- setSource: (next) => { source = next; },
461
- onChange: () => {
462
- // Settings service mounted, or the section changed: re-resolve, then
463
- // mutate cfg in place so the state-machine closures (asking/done hold)
464
- // and the injected script see the new values immediately.
465
- const next = resolveConfig(source());
466
- cfg.askingHoldMs = next.askingHoldMs;
467
- cfg.doneHoldMs = next.doneHoldMs;
468
- cfg.statusPath = next.statusPath;
469
- cfg.iconPathPrefix = next.iconPathPrefix;
470
- if (next.iconsDir !== undefined) cfg.iconsDir = next.iconsDir;
471
- cfg.states = next.states;
472
- iconsDir = resolveIconsDir(cfg.iconsDir);
473
- script = buildScript(cfg);
474
- },
469
+ // Register the settings namespace with the host `settings` service. Since
470
+ // DSH 0.1.2 the standalone `installSettingsSection` export is gone — the
471
+ // host exposes a `settings` service whose `installSection(owner, ns,
472
+ // schema, entry, hooks)` carries the same attach/detach lifecycle (base
473
+ // layer + `setSource` sink + `onChange` notification). The host's own
474
+ // plugins all use `ctx.inject(["settings"], …)` so the section attaches as
475
+ // soon as the provider is available — a plain `ctx.get("settings")` can run
476
+ // before the provider is ready and silently skip the registration. When no
477
+ // settings provider is composed the callback never fires and the plugin
478
+ // keeps working on its composition entry + DEFAULTS only.
479
+ ctx.inject(["settings"], (settingsCtx) => {
480
+ settingsCtx.settings.installSection(ctx, SETTINGS_NAMESPACE, CONFIG_SCHEMA, entry, {
481
+ setSource: (next) => { source = next; },
482
+ onChange: () => {
483
+ // Settings service mounted, or the section changed: re-resolve, then
484
+ // mutate cfg in place so the state-machine closures (asking/done hold)
485
+ // and the injected script see the new values immediately.
486
+ const next = resolveConfig(source());
487
+ cfg.askingHoldMs = next.askingHoldMs;
488
+ cfg.doneHoldMs = next.doneHoldMs;
489
+ cfg.statusPath = next.statusPath;
490
+ cfg.iconPathPrefix = next.iconPathPrefix;
491
+ if (next.iconsDir !== undefined) cfg.iconsDir = next.iconsDir;
492
+ cfg.states = next.states;
493
+ iconsDir = resolveIconsDir(cfg.iconsDir);
494
+ script = buildScript(cfg);
495
+ },
496
+ });
475
497
  });
476
498
  const webServer = ctx.webServer;
477
499
  const agents = ctx.agents;
@@ -633,9 +655,14 @@ export default {
633
655
  });
634
656
 
635
657
  // Authoritative pending-approval check: fold the live session's event log
636
- // for an `approval/asked` that no `approval/decided` has closed.
658
+ // for an `approval/asked` that no `approval/decided` has closed. Since DSH
659
+ // 0.1.2-alpha.4 `Session.events` is gone — read the log on demand through
660
+ // `session.snapshotEvents()` (a frozen half-open range snapshot). Guard on
661
+ // the method so older/newer hosts degrade gracefully.
637
662
  const hasPendingApproval = (live) => {
638
- const events = live?.session?.events;
663
+ const session = live?.session;
664
+ if (!session || typeof session.snapshotEvents !== "function") return false;
665
+ const events = session.snapshotEvents();
639
666
  if (!Array.isArray(events)) return false;
640
667
  const open = new Set();
641
668
  for (const ev of events) {
@@ -102,7 +102,7 @@ declare const plugin: {
102
102
  name: "dsh-web-icon-indicator";
103
103
  inject: readonly ["webServer", "timer", "agents", "fs", "sandboxPolicy"];
104
104
  config: DshWebIconIndicatorConfig;
105
- apply(ctx: unknown): void;
105
+ apply(ctx: unknown, config?: unknown): void;
106
106
  /** Settings namespace carrying the config (`web-icon-indicator`). */
107
107
  SETTINGS_NAMESPACE: string;
108
108
  /** Schemastery schema validating the config surface. */
package/package.json CHANGED
@@ -1,8 +1,11 @@
1
1
  {
2
2
  "name": "dsh-web-icon-indicator",
3
3
  "description": "Browser tab favicon reflects the DSH session state: idle / running / asking / done, recolored and animated from one base SVG in the browser (fully configurable colors + effects). · 浏览器标签页 favicon 实时反映 DSH 会话状态:待机 / 运行中 / 提问 / 完成,由单个 base.svg 在浏览器中动态上色与动画(颜色与特效完全可配置)。",
4
- "version": "0.3.1",
4
+ "version": "0.4.1",
5
5
  "type": "module",
6
+ "engines": {
7
+ "dsh": ">=0.1.2-rc.1"
8
+ },
6
9
  "main": "lib/index.js",
7
10
  "types": "lib/types/index.d.ts",
8
11
  "license": "MIT",
@@ -21,17 +24,15 @@
21
24
  "client": {
22
25
  "platform": "web",
23
26
  "inject": [
24
- "@deepseek-ai/dsh-client-runtime",
25
27
  "@deepseek-ai/dsh-client-locale",
26
- "@deepseek-ai/dsh-client-ui-slots",
28
+ "@deepseek-ai/dsh-client-ui-renderer",
27
29
  "@deepseek-ai/dsh-client-ui-settings",
28
30
  "@deepseek-ai/dsh-client-ui-settings-plugins"
29
31
  ]
30
32
  }
31
33
  },
32
34
  "peerDependencies": {
33
- "@deepseek-ai/dsh-settings": "^0.1.0-rc.7",
34
- "@deepseek-ai/schemastery": "^3.18.0"
35
+ "@deepseek-ai/schemastery": "^3.18.2"
35
36
  },
36
37
  "exports": {
37
38
  ".": {
@@ -52,6 +53,7 @@
52
53
  "assets",
53
54
  "docs",
54
55
  "cordis.patch.yml",
56
+ "screenshots.json",
55
57
  "CHANGELOG.md",
56
58
  "README.md",
57
59
  "README.zh.md",
@@ -0,0 +1,10 @@
1
+ [
2
+ "assets/states-default.svg",
3
+ "assets/multi-agent-count.svg",
4
+ "assets/effects/blink.svg",
5
+ "assets/effects/breath.svg",
6
+ "assets/effects/rainbow.svg",
7
+ "assets/effects/heartbeat.svg",
8
+ "assets/effects/bounce.svg",
9
+ "assets/effects/static.svg"
10
+ ]