@lmzhen/dsh-evolution-commands 0.1.0-rc.66 → 0.1.0-rc.68
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 -2
- package/package.json +2 -2
package/lib/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { buildLearnPrompt } from "@lmzhen/dsh-evolution-core";
|
|
1
|
+
import { appendEvolutionEvent, buildLearnPrompt, eventsFile } from "@lmzhen/dsh-evolution-core";
|
|
2
|
+
import { homedir } from "node:os";
|
|
3
|
+
import { join } from "node:path";
|
|
2
4
|
//#region lib/types/index.js
|
|
3
5
|
/**
|
|
4
6
|
* Human commands for the evolution family: /evolution learn|pending|curator|restore|consolidate.
|
|
@@ -130,7 +132,28 @@ function apply(ctx) {
|
|
|
130
132
|
};
|
|
131
133
|
return result.ok ? ok(result.message) : err(result.message);
|
|
132
134
|
}
|
|
133
|
-
if (input === "learn" || input.startsWith("learn "))
|
|
135
|
+
if (input === "learn" || input.startsWith("learn ")) {
|
|
136
|
+
const request = input === "learn" ? "" : input.slice(6).trim();
|
|
137
|
+
invocation.agent.inject({
|
|
138
|
+
content: [{
|
|
139
|
+
type: "text",
|
|
140
|
+
text: buildLearnPrompt(request)
|
|
141
|
+
}],
|
|
142
|
+
source: {
|
|
143
|
+
kind: "plugin",
|
|
144
|
+
plugin: "dsh-evolution-commands",
|
|
145
|
+
form: "notice",
|
|
146
|
+
summary: "learn request"
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
const eventIo = ctx.get("evolutionIo")?.provider();
|
|
150
|
+
if (eventIo) appendEvolutionEvent(eventIo, eventsFile(process.env.DSH_HOME ?? join(homedir(), ".dsh")), {
|
|
151
|
+
type: "learn",
|
|
152
|
+
source: "manual",
|
|
153
|
+
...request ? { request } : {}
|
|
154
|
+
}).catch((error) => {});
|
|
155
|
+
return ok("Learning request sent to this session. Follow it now.");
|
|
156
|
+
}
|
|
134
157
|
if (input === "replay") {
|
|
135
158
|
const replay = ctx.get("evolutionReplay");
|
|
136
159
|
if (!replay) return err("Replay service not mounted.");
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lmzhen/dsh-evolution-commands",
|
|
3
3
|
"description": "Human commands for the evolution family (community build)",
|
|
4
|
-
"version": "0.1.0-rc.
|
|
4
|
+
"version": "0.1.0-rc.68",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"license": "MIT",
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@deepseek-ai/schemastery": "^3.18.1",
|
|
36
|
-
"@lmzhen/dsh-evolution-core": "^0.1.0-rc.
|
|
36
|
+
"@lmzhen/dsh-evolution-core": "^0.1.0-rc.68"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"@deepseek-ai/dsh-invariants": "^0.1.1-rc.2",
|