@lmzhen/dsh-skill-usage 0.1.0-rc.31 → 0.1.0-rc.32

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
@@ -48,6 +48,30 @@ var SkillUsageRegistry = class extends Service {
48
48
  await this.flush();
49
49
  });
50
50
  }
51
+ /**
52
+ * Mark a skill's usage record as archived (delete / curator archive paths).
53
+ * Unlike `record('patch')` this never bumps the patch counter — archiving is
54
+ * a state transition, not a content mutation.
55
+ */
56
+ async markArchived(name, at = /* @__PURE__ */ new Date()) {
57
+ await this.mutate(async (map) => {
58
+ const record = map.get(name);
59
+ if (record) {
60
+ record.state = "archived";
61
+ record.archived_at = at.toISOString();
62
+ }
63
+ await this.flush();
64
+ });
65
+ }
66
+ /**
67
+ * Drop the in-memory cache once queued work drains, so the next `map()` reads
68
+ * the file again. The curator writes the sidecar directly; without this, the
69
+ * next tool telemetry flush would re-cover its quality/state/pinned writes.
70
+ */
71
+ async invalidate() {
72
+ await this.chain;
73
+ this.usage = null;
74
+ }
51
75
  /** Write feedback-derived quality onto the usage sidecar; curator reads it. */
52
76
  async setQuality(name, score, warn) {
53
77
  await this.mutate(async (map) => {
@@ -28,6 +28,18 @@ export declare class SkillUsageRegistry extends Service {
28
28
  record(name: string, kind: 'use' | 'view' | 'patch', at?: Date): Promise<void>;
29
29
  report(): Promise<UsageMap>;
30
30
  markAgentCreated(name: string): Promise<void>;
31
+ /**
32
+ * Mark a skill's usage record as archived (delete / curator archive paths).
33
+ * Unlike `record('patch')` this never bumps the patch counter — archiving is
34
+ * a state transition, not a content mutation.
35
+ */
36
+ markArchived(name: string, at?: Date): Promise<void>;
37
+ /**
38
+ * Drop the in-memory cache once queued work drains, so the next `map()` reads
39
+ * the file again. The curator writes the sidecar directly; without this, the
40
+ * next tool telemetry flush would re-cover its quality/state/pinned writes.
41
+ */
42
+ invalidate(): Promise<void>;
31
43
  /** Write feedback-derived quality onto the usage sidecar; curator reads it. */
32
44
  setQuality(name: string, score: number, warn: boolean): Promise<void>;
33
45
  }
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.1.0-rc.31",
4
+ "version": "0.1.0-rc.32",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -33,16 +33,16 @@
33
33
  "license": "MIT",
34
34
  "dependencies": {
35
35
  "@deepseek-ai/schemastery": "^3.18.1",
36
- "@lmzhen/dsh-evolution-core": "^0.1.0-rc.31"
36
+ "@lmzhen/dsh-evolution-core": "^0.1.0-rc.32"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "@deepseek-ai/cordis": "^4.0.1",
40
40
  "@deepseek-ai/dsh-invariants": "^0.1.0-rc.6",
41
- "@lmzhen/dsh-evolution-io": "^0.1.0-rc.31"
41
+ "@lmzhen/dsh-evolution-io": "^0.1.0-rc.32"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@deepseek-ai/dsh-invariants": "^0.1.0-rc.6",
45
- "@lmzhen/dsh-evolution-core": "^0.1.0-rc.31",
46
- "@lmzhen/dsh-evolution-io": "^0.1.0-rc.31"
45
+ "@lmzhen/dsh-evolution-core": "^0.1.0-rc.32",
46
+ "@lmzhen/dsh-evolution-io": "^0.1.0-rc.32"
47
47
  }
48
48
  }