@lmzhen/dsh-evolution-approval 0.1.0-rc.2 → 0.1.0-rc.20

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 +12 -1
  2. package/package.json +8 -8
package/lib/index.js CHANGED
@@ -52,6 +52,7 @@ var EvolutionApproval = class extends Service {
52
52
  }
53
53
  /** Evaluate one mutation. Returns allow, or stores the write and returns staged. */
54
54
  async request(input) {
55
+ const summary = normalizeSummary(input);
55
56
  if (!this.enabled) return {
56
57
  action: "allow",
57
58
  message: "Approval disabled."
@@ -60,7 +61,7 @@ var EvolutionApproval = class extends Service {
60
61
  const record = {
61
62
  id: randomUUID(),
62
63
  kind: input.kind,
63
- summary: input.summary,
64
+ summary,
64
65
  args: input.args,
65
66
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
66
67
  status: "pending"
@@ -157,5 +158,15 @@ var EvolutionApproval = class extends Service {
157
158
  };
158
159
  }
159
160
  };
161
+ /** Compact, batch-aware approval summary so pending lists stay scannable. */
162
+ function normalizeSummary(input) {
163
+ const trimmed = input.summary.length > 120 ? `${input.summary.slice(0, 117)}...` : input.summary;
164
+ if (input.kind === "memory") {
165
+ const candidate = input.args;
166
+ if (Array.isArray(candidate?.operations) && candidate.operations.length > 1) return `memory ${candidate.target ?? "memory"} batch of ${candidate.operations.length} operations`;
167
+ }
168
+ if (input.kind === "skill" && /^skill delete /.test(trimmed)) return `${trimmed} (warning: archive)`;
169
+ return trimmed;
170
+ }
160
171
  //#endregion
161
172
  export { EvolutionApproval, EvolutionApproval as default };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lmzhen/dsh-evolution-approval",
3
3
  "description": "Stage/pending approval service for Hermes-style self-evolution writes (community build)",
4
- "version": "0.1.0-rc.2",
4
+ "version": "0.1.0-rc.20",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -37,15 +37,15 @@
37
37
  "peerDependencies": {
38
38
  "@deepseek-ai/dsh-invariants": "^0.1.0-rc.6",
39
39
  "@deepseek-ai/cordis": "^4.0.1",
40
- "@lmzhen/dsh-evolution-state-storage": "^0.1.0-rc.2",
41
- "@lmzhen/dsh-evolution-state": "^0.1.0-rc.2"
40
+ "@lmzhen/dsh-evolution-state-storage": "^0.1.0-rc.20",
41
+ "@lmzhen/dsh-evolution-state": "^0.1.0-rc.20"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@deepseek-ai/dsh-invariants": "^0.1.0-rc.6",
45
- "@lmzhen/dsh-evolution-state-storage": "^0.1.0-rc.2",
46
- "@lmzhen/dsh-evolution-state": "^0.1.0-rc.2",
47
- "@lmzhen/dsh-evolution-io": "^0.1.0-rc.2",
48
- "@lmzhen/dsh-evolution-io-node": "^0.1.0-rc.2",
49
- "@lmzhen/dsh-evolution-state-json": "^0.1.0-rc.2"
45
+ "@lmzhen/dsh-evolution-state-storage": "^0.1.0-rc.20",
46
+ "@lmzhen/dsh-evolution-state": "^0.1.0-rc.20",
47
+ "@lmzhen/dsh-evolution-io": "^0.1.0-rc.20",
48
+ "@lmzhen/dsh-evolution-io-node": "^0.1.0-rc.20",
49
+ "@lmzhen/dsh-evolution-state-json": "^0.1.0-rc.20"
50
50
  }
51
51
  }