@lmzhen/dsh-evolution-commands 0.1.0-rc.1

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/README.md ADDED
@@ -0,0 +1,24 @@
1
+ # @deepseek-ai/dsh-evolution-commands
2
+
3
+ Human commands for the evolution family
4
+
5
+ ## Model Experience
6
+
7
+ ### Indirect model surface
8
+
9
+ #### What the model sees
10
+
11
+ `@deepseek-ai/dsh-evolution-commands` registers no direct prompt or tool schema itself. Model-visible effects are owned by the packages that consume this service.
12
+
13
+ #### Token effect
14
+
15
+ Zero direct token effect from this package; consumers add any model-visible tokens.
16
+
17
+ #### KV Cache effect
18
+
19
+ Independent of request-prefix construction. This package does not alter the assembled prompt or tool list.
20
+
21
+ ## Known Limitations and Deferred Work
22
+
23
+
24
+ - No known durable consumer gaps at this time. Runtime contracts are covered by package and boundary tests.
package/lib/index.js ADDED
@@ -0,0 +1,65 @@
1
+ //#region lib/types/index.js
2
+ /**
3
+ * Human commands for the evolution family: /evolution status|pending.
4
+ * @module @lmzhen/dsh-evolution-commands
5
+ */
6
+ const name = "evolution-commands";
7
+ function apply(ctx) {
8
+ ctx.inject(["commands"], (commandCtx) => {
9
+ commandCtx.commands.register({
10
+ name: "evolution",
11
+ description: "Self-evolution status and approval controls",
12
+ recordInput: false,
13
+ async handler(invocation) {
14
+ const input = invocation.rawInput?.trim() ?? "";
15
+ const approval = ctx.get("evolutionApproval");
16
+ if (input === "pending") {
17
+ const pending = approval ? await approval.list("pending") : [];
18
+ return { text: pending.length === 0 ? "No pending evolution writes." : pending.map((p) => `${p.id} ${p.kind} ${p.summary}`).join("\n") };
19
+ }
20
+ if (input.startsWith("approve ")) {
21
+ const id = input.slice(8).trim();
22
+ return { text: (approval ? await approval.approve(id) : {
23
+ ok: false,
24
+ message: "approval service not mounted"
25
+ }).message };
26
+ }
27
+ if (input.startsWith("reject ")) {
28
+ const id = input.slice(7).trim();
29
+ return { text: (approval ? await approval.reject(id) : {
30
+ ok: false,
31
+ message: "approval service not mounted"
32
+ }).message };
33
+ }
34
+ if (input === "curator run") {
35
+ const curator = ctx.get("evolutionCurator");
36
+ if (!curator) return { text: "Curator service not mounted." };
37
+ const result = await curator.run();
38
+ return { text: `Curator run complete: ${result.stale.length} stale, ${result.archived.length} archived, ${result.errors.length} failed.\nrunId=${result.report.runId}${result.report.snapshotPath ? `\nsnapshot=${result.report.snapshotPath}` : ""}` };
39
+ }
40
+ if (input === "curator report") {
41
+ const curator = ctx.get("evolutionCurator");
42
+ if (!curator) return { text: "Curator service not mounted." };
43
+ const report = await curator.latestReport();
44
+ if (!report) return { text: "No curator report available." };
45
+ return { text: [
46
+ `runId=${report.runId}`,
47
+ `startedAt=${report.startedAt}`,
48
+ `archived=${report.archived.map((item) => item.name).join(", ") || "(none)"}`,
49
+ `failed=${report.failed.map((item) => `${item.name}: ${item.reason}`).join(", ") || "(none)"}`
50
+ ].join("\n") };
51
+ }
52
+ if (input.startsWith("restore ")) {
53
+ const curator = ctx.get("evolutionCurator");
54
+ return { text: (curator ? await curator.skills.restoreLatestSnapshot() : {
55
+ ok: false,
56
+ message: "Curator service not mounted."
57
+ }).message };
58
+ }
59
+ return { text: "Evolution: memory, skills, review, curator. Use /evolution pending | curator run | curator report | restore." };
60
+ }
61
+ });
62
+ });
63
+ }
64
+ //#endregion
65
+ export { apply, name };
@@ -0,0 +1,8 @@
1
+ //#region lib/types/invariant.js
2
+ const PACKAGE_NAME = "@deepseek-ai/dsh-evolution-commands";
3
+ const name = "evolution-commands-invariant";
4
+ const inject = ["invariants"];
5
+ const install = () => {};
6
+ const apply = (ctx) => Promise.resolve(ctx.invariants.register(PACKAGE_NAME, install));
7
+ //#endregion
8
+ export { apply, inject, name };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Human commands for the evolution family: /evolution status|pending.
3
+ * @module @deepseek-ai/dsh-evolution-commands
4
+ */
5
+ import type { Context } from '@deepseek-ai/cordis';
6
+ export declare const name = "evolution-commands";
7
+ export declare function apply(ctx: Context): void;
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,5 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ export declare const name = "evolution-commands-invariant";
3
+ export declare const inject: string[];
4
+ export declare const apply: (ctx: Context) => Promise<() => void>;
5
+ //# sourceMappingURL=invariant.d.ts.map
package/package.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "@lmzhen/dsh-evolution-commands",
3
+ "description": "Human commands for the evolution family (community build)",
4
+ "version": "0.1.0-rc.1",
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/lmzhen/dsh-evolution.git",
11
+ "directory": "packages/dsh-evolution-commands"
12
+ },
13
+ "type": "module",
14
+ "main": "lib/index.js",
15
+ "types": "lib/types/index.d.ts",
16
+ "exports": {
17
+ ".": {
18
+ "types": "./lib/types/index.d.ts",
19
+ "default": "./lib/index.js"
20
+ },
21
+ "./invariant": {
22
+ "types": "./lib/types/invariant.d.ts",
23
+ "default": "./lib/invariant.js"
24
+ },
25
+ "./package.json": "./package.json"
26
+ },
27
+ "files": [
28
+ "lib/index.js",
29
+ "lib/invariant.js",
30
+ "lib/types/**/*.d.ts",
31
+ "lib/types/invariant.d.ts"
32
+ ],
33
+ "license": "MIT",
34
+ "dependencies": {
35
+ "@deepseek-ai/schemastery": "^3.18.1"
36
+ },
37
+ "peerDependencies": {
38
+ "@deepseek-ai/dsh-invariants": "^0.1.0-rc.6",
39
+ "@deepseek-ai/cordis": "^4.0.1"
40
+ },
41
+ "devDependencies": {
42
+ "@deepseek-ai/dsh-invariants": "^0.1.0-rc.6"
43
+ }
44
+ }