@lmzhen/dsh-evolution-policy 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.
- package/lib/index.js +25 -24
- package/package.json +3 -2
package/lib/index.js
CHANGED
|
@@ -2,6 +2,7 @@ import { Service } from "@deepseek-ai/cordis";
|
|
|
2
2
|
import { join, resolve, sep } from "node:path";
|
|
3
3
|
import { homedir } from "node:os";
|
|
4
4
|
import z from "@deepseek-ai/schemastery";
|
|
5
|
+
import { DEFAULT_ARCHIVE_AFTER_DAYS, DEFAULT_CURATOR_INTERVAL_HOURS, DEFAULT_MAX_OPS_PER_PLAN, DEFAULT_MEMORY_CHAR_LIMIT, DEFAULT_REVIEW_MEMORY_INTERVAL, DEFAULT_REVIEW_SKILL_INTERVAL, DEFAULT_SKILL_CONTENT_CHARS, DEFAULT_STALE_AFTER_DAYS, DEFAULT_SUBSTANTIVE_MIN_AGENT_CHARS, DEFAULT_SUBSTANTIVE_MIN_TOOL_CALLS, DEFAULT_SUBSTANTIVE_MIN_USER_CHARS, DEFAULT_USER_CHAR_LIMIT } from "@lmzhen/dsh-evolution-core";
|
|
5
6
|
//#region lib/types/index.js
|
|
6
7
|
/**
|
|
7
8
|
* Immutable evolution policy service.
|
|
@@ -9,22 +10,22 @@ import z from "@deepseek-ai/schemastery";
|
|
|
9
10
|
* @module @lmzhen/dsh-evolution-policy
|
|
10
11
|
*/
|
|
11
12
|
const Config = z.object({
|
|
12
|
-
reviewMemoryInterval: z.number().default(
|
|
13
|
-
reviewSkillInterval: z.number().default(
|
|
14
|
-
substantiveMinToolCalls: z.number().default(
|
|
15
|
-
substantiveMinUserChars: z.number().default(
|
|
16
|
-
substantiveMinAgentChars: z.number().default(
|
|
13
|
+
reviewMemoryInterval: z.number().default(DEFAULT_REVIEW_MEMORY_INTERVAL),
|
|
14
|
+
reviewSkillInterval: z.number().default(DEFAULT_REVIEW_SKILL_INTERVAL),
|
|
15
|
+
substantiveMinToolCalls: z.number().default(DEFAULT_SUBSTANTIVE_MIN_TOOL_CALLS),
|
|
16
|
+
substantiveMinUserChars: z.number().default(DEFAULT_SUBSTANTIVE_MIN_USER_CHARS),
|
|
17
|
+
substantiveMinAgentChars: z.number().default(DEFAULT_SUBSTANTIVE_MIN_AGENT_CHARS),
|
|
17
18
|
reviewMode: z.string().default("subagent"),
|
|
18
19
|
memoryReviewModel: z.string().default("deepseek-v4-flash"),
|
|
19
20
|
skillReviewModel: z.string().default("deepseek-v4-pro"),
|
|
20
21
|
curatorModel: z.string().default("deepseek-v4-pro"),
|
|
21
|
-
memoryChars: z.number().default(
|
|
22
|
-
userChars: z.number().default(
|
|
23
|
-
skillContentChars: z.number().default(
|
|
24
|
-
maxOpsPerPlan: z.number().default(
|
|
25
|
-
curatorIntervalHours: z.number().default(
|
|
26
|
-
staleAfterDays: z.number().default(
|
|
27
|
-
archiveAfterDays: z.number().default(
|
|
22
|
+
memoryChars: z.number().default(DEFAULT_MEMORY_CHAR_LIMIT),
|
|
23
|
+
userChars: z.number().default(DEFAULT_USER_CHAR_LIMIT),
|
|
24
|
+
skillContentChars: z.number().default(DEFAULT_SKILL_CONTENT_CHARS),
|
|
25
|
+
maxOpsPerPlan: z.number().default(DEFAULT_MAX_OPS_PER_PLAN),
|
|
26
|
+
curatorIntervalHours: z.number().default(DEFAULT_CURATOR_INTERVAL_HOURS),
|
|
27
|
+
staleAfterDays: z.number().default(DEFAULT_STALE_AFTER_DAYS),
|
|
28
|
+
archiveAfterDays: z.number().default(DEFAULT_ARCHIVE_AFTER_DAYS),
|
|
28
29
|
protectedSkillNames: z.array(z.string()).default([]),
|
|
29
30
|
protectedPaths: z.array(z.string()).default([])
|
|
30
31
|
});
|
|
@@ -40,22 +41,22 @@ var EvolutionPolicy = class extends Service {
|
|
|
40
41
|
const homePolicyPath = resolve(join(process.env.DSH_HOME ?? join(homedir(), ".dsh"), "evolution", "policy.json"));
|
|
41
42
|
this.snapshot = Object.freeze({
|
|
42
43
|
version: 1,
|
|
43
|
-
reviewMemoryInterval: config.reviewMemoryInterval ??
|
|
44
|
-
reviewSkillInterval: config.reviewSkillInterval ??
|
|
45
|
-
substantiveMinToolCalls: config.substantiveMinToolCalls ??
|
|
46
|
-
substantiveMinUserChars: config.substantiveMinUserChars ??
|
|
47
|
-
substantiveMinAgentChars: config.substantiveMinAgentChars ??
|
|
44
|
+
reviewMemoryInterval: config.reviewMemoryInterval ?? DEFAULT_REVIEW_MEMORY_INTERVAL,
|
|
45
|
+
reviewSkillInterval: config.reviewSkillInterval ?? DEFAULT_REVIEW_SKILL_INTERVAL,
|
|
46
|
+
substantiveMinToolCalls: config.substantiveMinToolCalls ?? DEFAULT_SUBSTANTIVE_MIN_TOOL_CALLS,
|
|
47
|
+
substantiveMinUserChars: config.substantiveMinUserChars ?? DEFAULT_SUBSTANTIVE_MIN_USER_CHARS,
|
|
48
|
+
substantiveMinAgentChars: config.substantiveMinAgentChars ?? DEFAULT_SUBSTANTIVE_MIN_AGENT_CHARS,
|
|
48
49
|
reviewMode: config.reviewMode === "inject" ? "inject" : "subagent",
|
|
49
50
|
memoryReviewModel: config.memoryReviewModel ?? "deepseek-v4-flash",
|
|
50
51
|
skillReviewModel: config.skillReviewModel ?? "deepseek-v4-pro",
|
|
51
52
|
curatorModel: config.curatorModel ?? "deepseek-v4-pro",
|
|
52
|
-
memoryChars: config.memoryChars ??
|
|
53
|
-
userChars: config.userChars ??
|
|
54
|
-
skillContentChars: config.skillContentChars ??
|
|
55
|
-
maxOpsPerPlan: config.maxOpsPerPlan ??
|
|
56
|
-
curatorIntervalHours: config.curatorIntervalHours ??
|
|
57
|
-
staleAfterDays: config.staleAfterDays ??
|
|
58
|
-
archiveAfterDays: config.archiveAfterDays ??
|
|
53
|
+
memoryChars: config.memoryChars ?? DEFAULT_MEMORY_CHAR_LIMIT,
|
|
54
|
+
userChars: config.userChars ?? DEFAULT_USER_CHAR_LIMIT,
|
|
55
|
+
skillContentChars: config.skillContentChars ?? DEFAULT_SKILL_CONTENT_CHARS,
|
|
56
|
+
maxOpsPerPlan: config.maxOpsPerPlan ?? DEFAULT_MAX_OPS_PER_PLAN,
|
|
57
|
+
curatorIntervalHours: config.curatorIntervalHours ?? DEFAULT_CURATOR_INTERVAL_HOURS,
|
|
58
|
+
staleAfterDays: config.staleAfterDays ?? DEFAULT_STALE_AFTER_DAYS,
|
|
59
|
+
archiveAfterDays: config.archiveAfterDays ?? DEFAULT_ARCHIVE_AFTER_DAYS,
|
|
59
60
|
protectedSkillNames: Object.freeze([...new Set(["plan", ...config.protectedSkillNames ?? []])]),
|
|
60
61
|
protectedPaths: Object.freeze([...config.protectedPaths ?? [], homePolicyPath])
|
|
61
62
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lmzhen/dsh-evolution-policy",
|
|
3
3
|
"description": "Immutable evolution policy service (community build)",
|
|
4
|
-
"version": "0.1.0-rc.
|
|
4
|
+
"version": "0.1.0-rc.20",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -32,7 +32,8 @@
|
|
|
32
32
|
],
|
|
33
33
|
"license": "MIT",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@deepseek-ai/schemastery": "^3.18.1"
|
|
35
|
+
"@deepseek-ai/schemastery": "^3.18.1",
|
|
36
|
+
"@lmzhen/dsh-evolution-core": "^0.1.0-rc.20"
|
|
36
37
|
},
|
|
37
38
|
"peerDependencies": {
|
|
38
39
|
"@deepseek-ai/dsh-invariants": "^0.1.0-rc.6",
|