@lmzhen/dsh-skill-usage 0.3.57 → 0.3.59

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 +13 -10
  2. package/package.json +5 -5
package/lib/index.js CHANGED
@@ -85,10 +85,11 @@ var SkillUsageRegistry = class extends Service {
85
85
  * that anchor exists (curator gates churn on `usageObserved()`).
86
86
  */
87
87
  observeRead(name) {
88
+ const normalized = name.trim();
88
89
  return this.mutate(async (map) => {
89
- if (!map.has(name)) return;
90
+ if (!map.has(normalized)) return;
90
91
  const viewsBefore = usageTotals(map).views;
91
- bumpView(map, name, /* @__PURE__ */ new Date());
92
+ bumpView(map, normalized, /* @__PURE__ */ new Date());
92
93
  if (viewsBefore === 0) await this.appendUsageWindowEvent(map);
93
94
  });
94
95
  }
@@ -140,10 +141,11 @@ var SkillUsageRegistry = class extends Service {
140
141
  return run;
141
142
  }
142
143
  async record(name, kind, at = /* @__PURE__ */ new Date()) {
144
+ const normalized = name.trim();
143
145
  await this.mutate((map) => {
144
- if (kind === "use") bumpUse(map, name, at);
145
- else if (kind === "view") bumpView(map, name, at);
146
- else bumpPatch(map, name, at);
146
+ if (kind === "use") bumpUse(map, normalized, at);
147
+ else if (kind === "view") bumpView(map, normalized, at);
148
+ else bumpPatch(map, normalized, at);
147
149
  });
148
150
  }
149
151
  /** Read-only snapshot of the sidecar (no disk write — reading never mutates). */
@@ -154,7 +156,7 @@ var SkillUsageRegistry = class extends Service {
154
156
  }
155
157
  async markAgentCreated(name) {
156
158
  await this.mutate((map) => {
157
- markAgentCreated(map, name);
159
+ markAgentCreated(map, name.trim());
158
160
  });
159
161
  }
160
162
  /**
@@ -167,8 +169,8 @@ var SkillUsageRegistry = class extends Service {
167
169
  */
168
170
  async ensureRecordCreated(name, agentCreated) {
169
171
  await this.mutate((map) => {
170
- if (agentCreated) markAgentCreated(map, name);
171
- else getRecord(map, name);
172
+ if (agentCreated) markAgentCreated(map, name.trim());
173
+ else getRecord(map, name.trim());
172
174
  });
173
175
  }
174
176
  /**
@@ -178,7 +180,7 @@ var SkillUsageRegistry = class extends Service {
178
180
  */
179
181
  async markArchived(name, at = /* @__PURE__ */ new Date()) {
180
182
  await this.mutate((map) => {
181
- const record = map.get(name);
183
+ const record = map.get(name.trim());
182
184
  if (record) {
183
185
  record.state = "archived";
184
186
  record.archived_at = at.toISOString();
@@ -197,8 +199,9 @@ var SkillUsageRegistry = class extends Service {
197
199
  }
198
200
  /** Write feedback-derived quality onto the usage sidecar; curator reads it. */
199
201
  async setQuality(name, score, warn) {
202
+ const normalized = name.trim();
200
203
  await this.mutate((map) => {
201
- const record = map.get(name);
204
+ const record = map.get(normalized);
202
205
  if (!record) return;
203
206
  record.quality_score = score;
204
207
  record.quality_warn = warn;
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.57",
4
+ "version": "0.3.59",
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.57"
34
+ "@lmzhen/dsh-evolution-core": "^0.3.59"
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.57"
40
+ "@lmzhen/dsh-evolution-io": "^0.3.59"
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.57",
46
- "@lmzhen/dsh-evolution-io": "^0.3.57"
45
+ "@lmzhen/dsh-evolution-core": "^0.3.59",
46
+ "@lmzhen/dsh-evolution-io": "^0.3.59"
47
47
  }
48
48
  }