@lmzhen/dsh-skill-usage 0.3.76 → 0.3.78

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
@@ -1,6 +1,6 @@
1
1
  import { Service } from "@deepseek-ai/cordis";
2
2
  import z from "@deepseek-ai/schemastery";
3
- import { ToolDispatchNormalizer, appendEvolutionEvent, bumpPatch, bumpUse, bumpView, eventsFile, evolutionIoAdapter, evolutionRoot, getRecord, loadUsage, makeSerialQueue, markAgentCreated, mutateUsage, resolveSkillsRoot, skillReadNameOf, usageObserved } from "@lmzhen/dsh-evolution-core";
3
+ import { ToolDispatchNormalizer, appendEvolutionEvent, bumpPatch, bumpUse, bumpView, eventsFile, evolutionIoAdapter, evolutionRoot, getRecord, loadUsage, makeSerialQueue, markAgentCreated, mutateUsage, resolveSkillsRoot, sessionAudited, skillReadNameOf, usageObserved } from "@lmzhen/dsh-evolution-core";
4
4
  //#region lib/types/index.js
5
5
  /**
6
6
  * Skill usage telemetry service for the evolution family.
@@ -36,7 +36,8 @@ var SkillUsageRegistry = class extends Service {
36
36
  static inject = ["evolutionIo"];
37
37
  static Config = z.object({
38
38
  root: z.string().default(""),
39
- eventsHome: z.string().default("")
39
+ eventsHome: z.string().default(""),
40
+ sessionScoped: z.boolean().default(false)
40
41
  });
41
42
  root;
42
43
  eventsHome;
@@ -50,7 +51,8 @@ var SkillUsageRegistry = class extends Service {
50
51
  this.io = evolutionIoAdapter(() => ctx.evolutionIo.provider());
51
52
  ctx.effect(() => {
52
53
  const reads = new ToolDispatchNormalizer();
53
- return ctx.on("session/event", (_session, event) => {
54
+ return ctx.on("session/event", (session, event) => {
55
+ if (!sessionAudited(ctx, session.id, config.sessionScoped)) return;
54
56
  const dispatch = reads.advance(event);
55
57
  if (dispatch === null) return;
56
58
  const name = skillReadNameOf(dispatch);
@@ -14,6 +14,9 @@ export interface Config {
14
14
  root?: string;
15
15
  /** Home for the evolution event timeline (`<eventsHome>/evolution/events.json`); defaults to DSH_HOME or ~/.dsh. */
16
16
  eventsHome?: string;
17
+ /** Act only on sessions that carry the family's model tools (evolution-core's
18
+ * per-session probe). The shipped bundles set it; false observes every session. */
19
+ sessionScoped?: boolean;
17
20
  }
18
21
  export declare class SkillUsageRegistry extends Service {
19
22
  static inject: string[];
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.76",
4
+ "version": "0.3.78",
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.76"
30
+ "@lmzhen/dsh-evolution-core": "^0.3.78"
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.76"
35
+ "@lmzhen/dsh-evolution-io": "^0.3.78"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@deepseek-ai/dsh-session": "^0.1.5-rc.2",
39
- "@lmzhen/dsh-evolution-core": "^0.3.76",
40
- "@lmzhen/dsh-evolution-io": "^0.3.76"
39
+ "@lmzhen/dsh-evolution-core": "^0.3.78",
40
+ "@lmzhen/dsh-evolution-io": "^0.3.78"
41
41
  }
42
42
  }