@lmzhen/dsh-evolution-capability 0.3.16 → 0.3.18

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 +3 -2
  2. package/package.json +10 -10
package/lib/index.js CHANGED
@@ -11,7 +11,7 @@ import z from "@deepseek-ai/schemastery";
11
11
  * package; the actual `cordis_define`/`cordis_run` work stays in Creator mode.
12
12
  * @module @lmzhen/dsh-evolution-capability
13
13
  */
14
- const CAPABILITY_NAME_RE = /^[a-z0-9][a-z0-9-]*$/;
14
+ const CAPABILITY_NAME_RE = /^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/;
15
15
  var EvolutionCapability = class extends Service {
16
16
  static inject = ["evolutionApproval", "evolutionState"];
17
17
  static Config = z.object({
@@ -65,7 +65,8 @@ var EvolutionCapability = class extends Service {
65
65
  /** Retrieve an approved package for manual Creator-mode activation. */
66
66
  async approvedPackage(id) {
67
67
  const record = (await this.ctx.evolutionState.listPending("approved")).find((item) => item.id === id && item.kind === "capability");
68
- return record ? record.args : null;
68
+ if (!record) return null;
69
+ return this.validate(record.args).ok ? record.args : null;
69
70
  }
70
71
  };
71
72
  function validateCapabilityPackage(pkg, limits = {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lmzhen/dsh-evolution-capability",
3
3
  "description": "Explicit staged governance adapter for Creator-mode capability packages (community build)",
4
- "version": "0.3.16",
4
+ "version": "0.3.18",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -37,17 +37,17 @@
37
37
  "peerDependencies": {
38
38
  "@deepseek-ai/dsh-invariants": "^0.1.1-rc.2",
39
39
  "@deepseek-ai/cordis": "^4.0.1",
40
- "@lmzhen/dsh-evolution-approval": "^0.3.16",
41
- "@lmzhen/dsh-evolution-state": "^0.3.16",
42
- "@lmzhen/dsh-evolution-state-storage": "^0.3.16"
40
+ "@lmzhen/dsh-evolution-approval": "^0.3.18",
41
+ "@lmzhen/dsh-evolution-state": "^0.3.18",
42
+ "@lmzhen/dsh-evolution-state-storage": "^0.3.18"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@deepseek-ai/dsh-invariants": "^0.1.1-rc.2",
46
- "@lmzhen/dsh-evolution-approval": "^0.3.16",
47
- "@lmzhen/dsh-evolution-state": "^0.3.16",
48
- "@lmzhen/dsh-evolution-state-storage": "^0.3.16",
49
- "@lmzhen/dsh-evolution-io": "^0.3.16",
50
- "@lmzhen/dsh-evolution-io-node": "^0.3.16",
51
- "@lmzhen/dsh-evolution-state-json": "^0.3.16"
46
+ "@lmzhen/dsh-evolution-approval": "^0.3.18",
47
+ "@lmzhen/dsh-evolution-state": "^0.3.18",
48
+ "@lmzhen/dsh-evolution-state-storage": "^0.3.18",
49
+ "@lmzhen/dsh-evolution-io": "^0.3.18",
50
+ "@lmzhen/dsh-evolution-io-node": "^0.3.18",
51
+ "@lmzhen/dsh-evolution-state-json": "^0.3.18"
52
52
  }
53
53
  }