@lmzhen/dsh-tool-skill-manage 0.4.0 → 0.5.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
@@ -1,15 +1,18 @@
1
1
  import { effectiveSessionPolicy } from "@lmzhen/dsh-evolution-approval";
2
2
  import z from "@deepseek-ai/schemastery";
3
3
  import { defineTool } from "@deepseek-ai/dsh-tools";
4
- import { DEFAULT_SKILL_LIMITS, DSH_AUTHORING_STANDARDS, SKILLS_GUIDANCE, SKILLS_GUIDANCE_SECTION_ORDER, SKILL_ACTION_REQUIRED_FIELDS, authoringFeedback, callingScope, clampedNumber, computeDedupGroups, contentHash, evolutionIoAdapter, isPresent, isUnknown, newSkillLibrary, parseFrontmatter, probePresent, probeUnknown, resolveExecOrigins } from "@lmzhen/dsh-evolution-core";
4
+ import { DEFAULT_SKILL_LIMITS, DSH_AUTHORING_STANDARDS, SKILLS_GUIDANCE, SKILLS_GUIDANCE_SECTION_ORDER, SKILL_ACTION_REQUIRED_FIELDS, authoringFeedback, callingScope, clampedNumber, computeDedupGroups, contentHash, evolutionIoAdapter, isPresent, isUnknown, newSkillLibrary, parseFrontmatter, policyStageLimits, probePresent, probeUnknown, resolveExecOrigins } from "@lmzhen/dsh-evolution-core";
5
5
  //#region lib/types/index.js
6
6
  /**
7
7
  * Model-facing skill_manage tool over ctx.evolutionIo + ctx.skillUsage.
8
8
  *
9
9
  * Mutations pass through the evolution approval seam when it is mounted;
10
10
  * approved/staged background writes are replayed by the registered runner.
11
- * The skill library itself never hard-deletes: archive is the maximum
12
- * destructive action and every curator mutation is snapshot-reversible.
11
+ * On LIVE skills, archive is the maximum destructive action and every
12
+ * curator mutation is snapshot-reversible. Two retention hard-deletes exist
13
+ * by design, both mtime-gated and logged: expired ARCHIVES are pruned after
14
+ * 365 days (skill-store `pruneExpiredArchives`), and pre-run snapshots are
15
+ * capped at the newest 5 — restore-ability holds inside those windows.
13
16
  *
14
17
  * 0.3.18 (E-70) — pin/unpin are deliberately OUTSIDE the approval seam:
15
18
  * pinning only lifts/restores the curator-lifecycle freeze and is fully
@@ -74,6 +77,7 @@ function apply(ctx, rawConfig = {}) {
74
77
  config: rawConfig,
75
78
  io,
76
79
  limits: {
80
+ ...policyStageLimits(policySnapshotOf(ctx.get("evolutionPolicy"))),
77
81
  maxNameLength: limit("maxSkillNameLength", rawConfig.maxSkillNameLength, DEFAULT_SKILL_LIMITS.maxNameLength),
78
82
  maxDescriptionLength: limit("maxDescriptionLength", rawConfig.maxDescriptionLength, DEFAULT_SKILL_LIMITS.maxDescriptionLength),
79
83
  maxSkillContentChars: limit("maxSkillContentChars", rawConfig.maxSkillContentChars, DEFAULT_SKILL_LIMITS.maxSkillContentChars),
@@ -358,15 +362,15 @@ function apply(ctx, rawConfig = {}) {
358
362
  const approval = ctx.get("evolutionApproval");
359
363
  if (approval && args.action !== "list" && args.action !== "review" && args.action !== "pin" && args.action !== "unpin") {
360
364
  if ((args.action === "update" || args.action === "edit") && typeof args.name === "string" && args.name !== "") {
361
- const stageCurrent = await library.read(args.name).catch(() => void 0);
362
- if (stageCurrent !== void 0) operation = {
365
+ const stageCurrent = await library.read(args.name).catch(() => null);
366
+ operation = {
363
367
  ...args,
364
368
  staged_from_sha256: stageCurrent === null ? "absent" : contentHash(stageCurrent)
365
369
  };
366
370
  }
367
371
  if ((args.action === "write_file" || args.action === "remove_file") && typeof args.name === "string" && args.name !== "" && typeof args.file_path === "string" && args.file_path !== "") {
368
- const stageFile = await library.readSupportFile(args.name, args.file_path).catch(() => void 0);
369
- if (stageFile !== void 0) operation = {
372
+ const stageFile = await library.readSupportFile(args.name, args.file_path).catch(() => null);
373
+ operation = {
370
374
  ...args,
371
375
  staged_from_sha256: stageFile === null ? "absent" : contentHash(stageFile)
372
376
  };
@@ -3,8 +3,11 @@
3
3
  *
4
4
  * Mutations pass through the evolution approval seam when it is mounted;
5
5
  * approved/staged background writes are replayed by the registered runner.
6
- * The skill library itself never hard-deletes: archive is the maximum
7
- * destructive action and every curator mutation is snapshot-reversible.
6
+ * On LIVE skills, archive is the maximum destructive action and every
7
+ * curator mutation is snapshot-reversible. Two retention hard-deletes exist
8
+ * by design, both mtime-gated and logged: expired ARCHIVES are pruned after
9
+ * 365 days (skill-store `pruneExpiredArchives`), and pre-run snapshots are
10
+ * capped at the newest 5 — restore-ability holds inside those windows.
8
11
  *
9
12
  * 0.3.18 (E-70) — pin/unpin are deliberately OUTSIDE the approval seam:
10
13
  * pinning only lifts/restores the curator-lifecycle freeze and is fully
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lmzhen/dsh-tool-skill-manage",
3
3
  "description": "Model-facing skill_manage tool (community build)",
4
- "version": "0.4.0",
4
+ "version": "0.5.0",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -27,24 +27,24 @@
27
27
  "license": "MIT",
28
28
  "dependencies": {
29
29
  "@deepseek-ai/schemastery": "^3.18.1",
30
- "@lmzhen/dsh-evolution-approval": "^0.4.0",
31
- "@lmzhen/dsh-evolution-core": "^0.4.0"
30
+ "@lmzhen/dsh-evolution-approval": "^0.5.0",
31
+ "@lmzhen/dsh-evolution-core": "^0.5.0"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "@deepseek-ai/cordis": "^4.0.1",
35
35
  "@deepseek-ai/dsh-skill": "^0.1.5-rc.2",
36
36
  "@deepseek-ai/dsh-system-prompt": "^0.1.5-rc.2",
37
37
  "@deepseek-ai/dsh-tools": "^0.1.5-rc.2",
38
- "@lmzhen/dsh-evolution-io": "^0.4.0",
39
- "@lmzhen/dsh-skill-usage": "^0.4.0"
38
+ "@lmzhen/dsh-evolution-io": "^0.5.0",
39
+ "@lmzhen/dsh-skill-usage": "^0.5.0"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@deepseek-ai/dsh-agent-loop-testkit": "^0.1.5-rc.2",
43
43
  "@deepseek-ai/dsh-skill": "^0.1.5-rc.2",
44
44
  "@deepseek-ai/dsh-system-prompt": "^0.1.5-rc.2",
45
45
  "@deepseek-ai/dsh-tools": "^0.1.5-rc.2",
46
- "@lmzhen/dsh-evolution-core": "^0.4.0",
47
- "@lmzhen/dsh-evolution-io": "^0.4.0",
48
- "@lmzhen/dsh-skill-usage": "^0.4.0"
46
+ "@lmzhen/dsh-evolution-core": "^0.5.0",
47
+ "@lmzhen/dsh-evolution-io": "^0.5.0",
48
+ "@lmzhen/dsh-skill-usage": "^0.5.0"
49
49
  }
50
50
  }