@lmzhen/dsh-skill-usage 0.3.35 → 0.3.37

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
@@ -61,14 +61,16 @@ var SkillUsageRegistry = class extends Service {
61
61
  this.root = resolveSkillsRoot(config);
62
62
  this.eventsHome = config.eventsHome || evolutionRoot();
63
63
  this.io = evolutionIoAdapter(() => ctx.evolutionIo.provider());
64
- ctx.on("session/event", (_session, event) => {
65
- if (event.type !== "tool/call") return;
66
- const data = event.data;
67
- if (!(typeof data?.name === "string" ? READ_TOOL_KIND[data.name] : void 0)) return;
68
- const name = skillNameFromToolCall(data?.arguments);
69
- if (!name) return;
70
- this.observeRead(name).catch(() => {});
71
- });
64
+ ctx.effect(() => {
65
+ return ctx.on("session/event", (_session, event) => {
66
+ if (event.type !== "tool/call") return;
67
+ const data = event.data;
68
+ if (!(typeof data?.name === "string" ? READ_TOOL_KIND[data.name] : void 0)) return;
69
+ const name = skillNameFromToolCall(data?.arguments);
70
+ if (!name) return;
71
+ this.observeRead(name).catch(() => {});
72
+ });
73
+ }, "skill-usage.telemetry");
72
74
  }
73
75
  /**
74
76
  * Read-side telemetry (A2): bump the view counter for an EXISTING record
@@ -187,6 +189,8 @@ var SkillUsageRegistry = class extends Service {
187
189
  * Barrier for external writers: every mutate reads the sidecar fresh from
188
190
  * disk (rc.50 P2-2 transact), so a curator direct-write is visible on the
189
191
  * next call without a cache flush; this waits for queued work to drain.
192
+ * V6-44 (0.3.37): test-support API — no production consumer uses it
193
+ * (tests use it as a drain barrier); kept by declaration.
190
194
  */
191
195
  async invalidate() {
192
196
  await this.chain;
@@ -82,6 +82,8 @@ export declare class SkillUsageRegistry extends Service {
82
82
  * Barrier for external writers: every mutate reads the sidecar fresh from
83
83
  * disk (rc.50 P2-2 transact), so a curator direct-write is visible on the
84
84
  * next call without a cache flush; this waits for queued work to drain.
85
+ * V6-44 (0.3.37): test-support API — no production consumer uses it
86
+ * (tests use it as a drain barrier); kept by declaration.
85
87
  */
86
88
  invalidate(): Promise<void>;
87
89
  /** Write feedback-derived quality onto the usage sidecar; curator reads it. */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lmzhen/dsh-skill-usage",
3
3
  "description": "Skill usage telemetry service (community build)",
4
- "version": "0.3.35",
4
+ "version": "0.3.37",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -31,18 +31,18 @@
31
31
  "license": "MIT",
32
32
  "dependencies": {
33
33
  "@deepseek-ai/schemastery": "^3.18.1",
34
- "@lmzhen/dsh-evolution-core": "^0.3.35"
34
+ "@lmzhen/dsh-evolution-core": "^0.3.37"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "@deepseek-ai/cordis": "^4.0.1",
38
38
  "@deepseek-ai/dsh-invariants": "^0.1.1-rc.2",
39
39
  "@deepseek-ai/dsh-session": "^0.1.1-rc.2",
40
- "@lmzhen/dsh-evolution-io": "^0.3.35"
40
+ "@lmzhen/dsh-evolution-io": "^0.3.37"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@deepseek-ai/dsh-invariants": "^0.1.1-rc.2",
44
44
  "@deepseek-ai/dsh-session": "^0.1.1-rc.2",
45
- "@lmzhen/dsh-evolution-core": "^0.3.35",
46
- "@lmzhen/dsh-evolution-io": "^0.3.35"
45
+ "@lmzhen/dsh-evolution-core": "^0.3.37",
46
+ "@lmzhen/dsh-evolution-io": "^0.3.37"
47
47
  }
48
48
  }