@lmzhen/dsh-evolution-core 0.34.0 → 0.36.0

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
@@ -10907,12 +10907,13 @@ function skillRowCells(skill) {
10907
10907
  tone: "tertiary",
10908
10908
  slot: "lead",
10909
10909
  note: skill.description
10910
- }, {
10910
+ }];
10911
+ if (!skill.managed || skill.protectedBy !== null || skill.protectionUnknown) meta.push({
10911
10912
  key: "state",
10912
10913
  copy: skillStateKey(skill),
10913
10914
  tone: "tertiary",
10914
10915
  slot: "meta"
10915
- }];
10916
+ });
10916
10917
  if (skill.protectedBy !== null) meta.push({
10917
10918
  key: "protectedBy",
10918
10919
  literal: skill.protectedBy,
@@ -13588,6 +13589,15 @@ var SkillLibrary = class {
13588
13589
  if (this.badName(name) !== null) return null;
13589
13590
  return await loadVersionContent(this.root, this.io, name, v);
13590
13591
  }
13592
+ /** Read an archived skill's real archived_at, or null when the usage sidecar has no fact. */
13593
+ async readArchivedAt(rawName) {
13594
+ const name = rawName.trim();
13595
+ if (this.badName(name) !== null) return null;
13596
+ const raw = (await loadUsage(this.root, this.io)).get(name)?.archived_at;
13597
+ if (raw === null || raw === void 0) return null;
13598
+ const at = Date.parse(raw);
13599
+ return Number.isFinite(at) ? at : null;
13600
+ }
13591
13601
  /** Read an archived skill's human-readable reason, exact or stamped. */
13592
13602
  async readArchiveReason(rawName) {
13593
13603
  const name = rawName.trim();
@@ -107,8 +107,11 @@ export function skillRowCells(skill) {
107
107
  ];
108
108
  const meta = [
109
109
  { key: 'description', literal: skill.description, tone: 'tertiary', slot: 'lead', note: skill.description },
110
- { key: 'state', copy: skillStateKey(skill), tone: 'tertiary', slot: 'meta' },
111
110
  ];
111
+ // Family management is the default; only an exception (foreign/protected/unknown) earns a state cell.
112
+ if (!skill.managed || skill.protectedBy !== null || skill.protectionUnknown) {
113
+ meta.push({ key: 'state', copy: skillStateKey(skill), tone: 'tertiary', slot: 'meta' });
114
+ }
112
115
  // U-5 (history half): a protected skill says WHO holds it, not only that it is held. The state cell
113
116
  // above answers 'protected or not' from the same field; this cell carries the guard's own name, a
114
117
  // verbatim fact (no dictionary key — literals are values the host owns).
@@ -570,6 +570,8 @@ export declare class SkillLibrary {
570
570
  * blob cannot be read — never an empty string.
571
571
  */
572
572
  readVersion(rawName: string, v: number): Promise<string | null>;
573
+ /** Read an archived skill's real archived_at, or null when the usage sidecar has no fact. */
574
+ readArchivedAt(rawName: string): Promise<number | null>;
573
575
  /** Read an archived skill's human-readable reason, exact or stamped. */
574
576
  readArchiveReason(rawName: string): Promise<string | null>;
575
577
  /** Read an archived skill body (SKILL.md) by its original name, exact or stamped. */
@@ -56,7 +56,7 @@ import { diffFindings } from "./skill-lint.js";
56
56
  import { contentHash, loadMutations, recordMutation } from "./mutations.js";
57
57
  import { revisionFingerprint, revisionSupportDigest } from "./skill-revision.js";
58
58
  import { contentRetentionFeedback, HISTORY_DIR, loadVersionContent, loadVersions, recordVersions } from "./skill-history.js";
59
- import { getRecord, mutateUsage, suppressedFile, usageFile } from "./usage.js";
59
+ import { getRecord, loadUsage, mutateUsage, suppressedFile, usageFile } from "./usage.js";
60
60
  import { assessStructureHealth, DEFAULT_HEALTH_THRESHOLDS, lintBody } from "./skill-health.js";
61
61
  import { CONTENT_SPLIT_HINT, DEFAULT_SKILL_VERSION_KEEP, PROTECTED_BUILTIN_SKILLS, SKILL_NAME_RE, SUPPORT_DIRS } from "./constants.js";
62
62
  /**
@@ -1313,6 +1313,18 @@ export class SkillLibrary {
1313
1313
  return null;
1314
1314
  return await loadVersionContent(this.root, this.io, name, v);
1315
1315
  }
1316
+ /** Read an archived skill's real archived_at, or null when the usage sidecar has no fact. */
1317
+ async readArchivedAt(rawName) {
1318
+ const name = rawName.trim();
1319
+ if (this.badName(name) !== null)
1320
+ return null;
1321
+ const usage = await loadUsage(this.root, this.io);
1322
+ const raw = usage.get(name)?.archived_at;
1323
+ if (raw === null || raw === undefined)
1324
+ return null;
1325
+ const at = Date.parse(raw);
1326
+ return Number.isFinite(at) ? at : null;
1327
+ }
1316
1328
  /** Read an archived skill's human-readable reason, exact or stamped. */
1317
1329
  async readArchiveReason(rawName) {
1318
1330
  const name = rawName.trim();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lmzhen/dsh-evolution-core",
3
3
  "description": "Shared stores, prompts, signals and lifecycle logic for the dsh-evolution plugin family (community build)",
4
- "version": "0.34.0",
4
+ "version": "0.36.0",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -49,7 +49,7 @@
49
49
  "yaml": "^2.4.2",
50
50
  "zod": "^4.4.3",
51
51
  "js-yaml": "^4.1.0",
52
- "@lmzhen/dsh-evolution-contract": "^0.34.0"
52
+ "@lmzhen/dsh-evolution-contract": "^0.36.0"
53
53
  },
54
54
  "peerDependencies": {
55
55
  "@deepseek-ai/cordis": "^4.0.5",