@lmzhen/dsh-evolution-review 0.1.0-rc.46 → 0.1.0-rc.48
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 +12 -4
- package/package.json +7 -7
package/lib/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createHash, randomUUID } from "node:crypto";
|
|
2
2
|
import z from "@deepseek-ai/schemastery";
|
|
3
3
|
import { createUserMessage } from "@deepseek-ai/dsh-llm";
|
|
4
|
-
import { COMPLETION_SKILL_REVIEW_PROMPT, DEFAULT_MAX_OPS_PER_PLAN, DEFAULT_MEMORY_CHAR_LIMIT, DEFAULT_REVIEW_MEMORY_INTERVAL, DEFAULT_REVIEW_SKILL_INTERVAL, DEFAULT_SKILL_CONTENT_CHARS, DEFAULT_SKILL_REVIEW_COMPLETION_MIN_TOOL_CALLS, DEFAULT_SKILL_REVIEW_TRIGGER, DEFAULT_USER_CHAR_LIMIT, PROMPT_BUNDLE, SkillLibrary, advanceReview, evolutionIoAdapter, foldTurn, reviewPrompt, verifyPromptBundle } from "@lmzhen/dsh-evolution-core";
|
|
4
|
+
import { COMPLETION_SKILL_REVIEW_PROMPT, DEFAULT_MAX_OPS_PER_PLAN, DEFAULT_MEMORY_CHAR_LIMIT, DEFAULT_REVIEW_MEMORY_INTERVAL, DEFAULT_REVIEW_SKILL_INTERVAL, DEFAULT_SKILL_CONTENT_CHARS, DEFAULT_SKILL_REVIEW_COMPLETION_MIN_TOOL_CALLS, DEFAULT_SKILL_REVIEW_TRIGGER, DEFAULT_USER_CHAR_LIMIT, PROMPT_BUNDLE, SkillLibrary, advanceReview, evolutionIoAdapter, foldTurn, resolveOrigins, reviewPrompt, verifyPromptBundle } from "@lmzhen/dsh-evolution-core";
|
|
5
5
|
import { validateEvolutionPlan } from "@lmzhen/dsh-evolution-plan-validator";
|
|
6
6
|
//#region lib/types/redact.js
|
|
7
7
|
/**
|
|
@@ -238,6 +238,7 @@ function apply(ctx, rawConfig) {
|
|
|
238
238
|
async function executePlan(plan) {
|
|
239
239
|
const memory = ctx.get("memory");
|
|
240
240
|
const approval = ctx.get("evolutionApproval");
|
|
241
|
+
const origins = resolveOrigins(void 0, true);
|
|
241
242
|
const actions = [];
|
|
242
243
|
for (const op of plan.memoryOps ?? []) {
|
|
243
244
|
if (!Array.isArray(op.evidence) || op.evidence.length === 0) continue;
|
|
@@ -257,18 +258,25 @@ function apply(ctx, rawConfig) {
|
|
|
257
258
|
};
|
|
258
259
|
const runnerArgs = {
|
|
259
260
|
operation: args,
|
|
260
|
-
origin:
|
|
261
|
+
origin: origins.library
|
|
261
262
|
};
|
|
262
263
|
if ((approval ? await runApproved("skill", `skill ${op.action ?? "patch"} ${op.name}`, runnerArgs, runnerArgs) : await executeSkillDirect(args))?.ok) actions.push(`Skill ${op.name} ${op.action ?? "patch"}`);
|
|
263
264
|
}
|
|
264
265
|
return actions;
|
|
265
266
|
async function runApproved(kind, summary, stored, runnerArgs) {
|
|
266
267
|
if (!approval) return void 0;
|
|
268
|
+
if (approval.isEnabled === true && !approval.hasRunner(kind)) {
|
|
269
|
+
ctx.logger.warn(`dsh-evolution-review: approval enabled but no replay runner registered for kind "${kind}" - skipping write (${summary})`);
|
|
270
|
+
return {
|
|
271
|
+
ok: false,
|
|
272
|
+
message: `Approval is enabled but no replay runner is registered for kind "${kind}"; write skipped (mount the tool that provides it, or disable approval).`
|
|
273
|
+
};
|
|
274
|
+
}
|
|
267
275
|
const decision = await approval.request({
|
|
268
276
|
kind,
|
|
269
277
|
summary,
|
|
270
278
|
args: stored,
|
|
271
|
-
origin:
|
|
279
|
+
origin: origins.approval
|
|
272
280
|
});
|
|
273
281
|
if (decision.action === "staged") return {
|
|
274
282
|
ok: false,
|
|
@@ -309,7 +317,7 @@ function apply(ctx, rawConfig) {
|
|
|
309
317
|
const library = new SkillLibrary(void 0, evolutionIoAdapter(() => io.provider()));
|
|
310
318
|
const op = skillArgs;
|
|
311
319
|
const name = op.name ?? "";
|
|
312
|
-
const origin =
|
|
320
|
+
const origin = origins.library;
|
|
313
321
|
if (op.action === "create") {
|
|
314
322
|
const created = await library.create(name, op.content ?? "", origin);
|
|
315
323
|
if (created.ok) await ctx.get("skillUsage")?.markAgentCreated?.(name);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lmzhen/dsh-evolution-review",
|
|
3
3
|
"description": "Background review orchestration (community build)",
|
|
4
|
-
"version": "0.1.0-rc.
|
|
4
|
+
"version": "0.1.0-rc.48",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"license": "MIT",
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@deepseek-ai/schemastery": "^3.18.1",
|
|
36
|
-
"@lmzhen/dsh-evolution-core": "^0.1.0-rc.
|
|
37
|
-
"@lmzhen/dsh-evolution-plan-validator": "^0.1.0-rc.
|
|
36
|
+
"@lmzhen/dsh-evolution-core": "^0.1.0-rc.48",
|
|
37
|
+
"@lmzhen/dsh-evolution-plan-validator": "^0.1.0-rc.48"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@deepseek-ai/dsh-llm": "^0.1.0-rc.6",
|
|
44
44
|
"@deepseek-ai/dsh-session": "^0.1.0-rc.6",
|
|
45
45
|
"@deepseek-ai/dsh-tools": "^0.1.0-rc.6",
|
|
46
|
-
"@lmzhen/dsh-evolution-state": "^0.1.0-rc.
|
|
46
|
+
"@lmzhen/dsh-evolution-state": "^0.1.0-rc.48"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@deepseek-ai/dsh-agent": "^0.1.0-rc.6",
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
"@deepseek-ai/dsh-session-persistence": "^0.1.0-rc.6",
|
|
55
55
|
"@deepseek-ai/dsh-session-persistence-jsonl": "^0.1.0-rc.6",
|
|
56
56
|
"@deepseek-ai/dsh-tools": "^0.1.0-rc.6",
|
|
57
|
-
"@lmzhen/dsh-evolution-core": "^0.1.0-rc.
|
|
58
|
-
"@lmzhen/dsh-evolution-plan-validator": "^0.1.0-rc.
|
|
59
|
-
"@lmzhen/dsh-evolution-state": "^0.1.0-rc.
|
|
57
|
+
"@lmzhen/dsh-evolution-core": "^0.1.0-rc.48",
|
|
58
|
+
"@lmzhen/dsh-evolution-plan-validator": "^0.1.0-rc.48",
|
|
59
|
+
"@lmzhen/dsh-evolution-state": "^0.1.0-rc.48"
|
|
60
60
|
}
|
|
61
61
|
}
|