@lmzhen/dsh-skill-usage 0.3.78 → 0.3.80

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 (2) hide show
  1. package/lib/index.js +12 -6
  2. package/package.json +5 -5
package/lib/index.js CHANGED
@@ -6,6 +6,11 @@ import { ToolDispatchNormalizer, appendEvolutionEvent, bumpPatch, bumpUse, bumpV
6
6
  * Skill usage telemetry service for the evolution family.
7
7
  * @module @lmzhen/dsh-skill-usage
8
8
  */
9
+ /** S2-P2-14 (0.3.80): bound for the live listener's dispatch ledger — it is
10
+ * dedup state (a call/result pair spans one tool call), so 4096 tracked
11
+ * dispatches is orders of magnitude above any real pairing window while the
12
+ * ledger stops growing with the host process lifetime. */
13
+ const LIVE_DISPATCH_LEDGER_CAP = 4096;
9
14
  /**
10
15
  * Folds the session's dispatch events into one signal per READ (A2).
11
16
  *
@@ -50,14 +55,15 @@ var SkillUsageRegistry = class extends Service {
50
55
  this.eventsHome = config.eventsHome?.trim() || evolutionRoot();
51
56
  this.io = evolutionIoAdapter(() => ctx.evolutionIo.provider());
52
57
  ctx.effect(() => {
53
- const reads = new ToolDispatchNormalizer();
58
+ const reads = new ToolDispatchNormalizer({ maxTracked: LIVE_DISPATCH_LEDGER_CAP });
54
59
  return ctx.on("session/event", (session, event) => {
55
60
  if (!sessionAudited(ctx, session.id, config.sessionScoped)) return;
56
- const dispatch = reads.advance(event);
57
- if (dispatch === null) return;
58
- const name = skillReadNameOf(dispatch);
59
- if (name === void 0) return;
60
- this.observeRead(name).catch(() => {});
61
+ reads.advance(event);
62
+ const settled = reads.settledSignalOf(event);
63
+ if (settled === null || settled.ok === false) return;
64
+ const settledName = skillReadNameOf(settled);
65
+ if (settledName === void 0) return;
66
+ this.observeRead(settledName).catch(() => {});
61
67
  });
62
68
  }, "skill-usage.telemetry");
63
69
  }
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.78",
4
+ "version": "0.3.80",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -27,16 +27,16 @@
27
27
  "license": "MIT",
28
28
  "dependencies": {
29
29
  "@deepseek-ai/schemastery": "^3.18.1",
30
- "@lmzhen/dsh-evolution-core": "^0.3.78"
30
+ "@lmzhen/dsh-evolution-core": "^0.3.80"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "@deepseek-ai/cordis": "^4.0.1",
34
34
  "@deepseek-ai/dsh-session": "^0.1.5-rc.2",
35
- "@lmzhen/dsh-evolution-io": "^0.3.78"
35
+ "@lmzhen/dsh-evolution-io": "^0.3.80"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@deepseek-ai/dsh-session": "^0.1.5-rc.2",
39
- "@lmzhen/dsh-evolution-core": "^0.3.78",
40
- "@lmzhen/dsh-evolution-io": "^0.3.78"
39
+ "@lmzhen/dsh-evolution-core": "^0.3.80",
40
+ "@lmzhen/dsh-evolution-io": "^0.3.80"
41
41
  }
42
42
  }