@lmzhen/dsh-evolution-commands 0.3.21 → 0.3.23
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 +7 -8
- package/lib/types/index.d.ts +3 -1
- package/package.json +4 -4
package/lib/index.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
2
|
import { createUserMessage } from "@deepseek-ai/dsh-llm";
|
|
3
|
-
import { SkillLibrary, appendEvolutionEvent, buildLearnPrompt, composePresetComposition, eventsFile } from "@lmzhen/dsh-evolution-core";
|
|
3
|
+
import { SkillLibrary, appendEvolutionEvent, buildLearnPrompt, composePresetComposition, eventsFile, evolutionRoot, resolveSkillsRoot } from "@lmzhen/dsh-evolution-core";
|
|
4
4
|
import { buildEnrichment, buildMaintainFacts, runMaintain, snapshotFromLibrary } from "@lmzhen/dsh-evolution-maintenance";
|
|
5
5
|
import { copyFileSync, existsSync, mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
6
|
-
import { homedir } from "node:os";
|
|
7
6
|
import { dirname, join } from "node:path";
|
|
8
7
|
import { fileURLToPath } from "node:url";
|
|
9
8
|
//#region lib/types/index.js
|
|
@@ -176,7 +175,7 @@ function apply(ctx, rawConfig = {}) {
|
|
|
176
175
|
}
|
|
177
176
|
}));
|
|
178
177
|
const eventIo = ctx.get("evolutionIo")?.provider();
|
|
179
|
-
if (eventIo) appendEvolutionEvent(eventIo, eventsFile(
|
|
178
|
+
if (eventIo) appendEvolutionEvent(eventIo, eventsFile(evolutionRoot()), {
|
|
180
179
|
type: "learn",
|
|
181
180
|
source: "manual",
|
|
182
181
|
...request ? { request } : {}
|
|
@@ -188,7 +187,7 @@ function apply(ctx, rawConfig = {}) {
|
|
|
188
187
|
if (input === "maintain --facts") {
|
|
189
188
|
const ioRegistry = ctx.get("evolutionIo");
|
|
190
189
|
if (!ioRegistry) return err("Evolution IO registry not mounted — maintenance facts unavailable.");
|
|
191
|
-
const library = new SkillLibrary(config.skillsRoot, ioRegistry.provider());
|
|
190
|
+
const library = new SkillLibrary(resolveSkillsRoot({ root: config.skillsRoot }), ioRegistry.provider());
|
|
192
191
|
const enrichment = await buildEnrichment(ctx, library);
|
|
193
192
|
const { facts } = buildMaintainFacts(await snapshotFromLibrary(library, {
|
|
194
193
|
descriptions: enrichment.descriptions,
|
|
@@ -213,7 +212,7 @@ function apply(ctx, rawConfig = {}) {
|
|
|
213
212
|
if (!subagents) return err("Subagents service not mounted — maintenance scan unavailable.");
|
|
214
213
|
try {
|
|
215
214
|
maintainInFlightSince = Date.now();
|
|
216
|
-
const library = new SkillLibrary(config.skillsRoot, ioRegistry.provider());
|
|
215
|
+
const library = new SkillLibrary(resolveSkillsRoot({ root: config.skillsRoot }), ioRegistry.provider());
|
|
217
216
|
const enrichment = await buildEnrichment(ctx, library);
|
|
218
217
|
const outcome = await runMaintain({
|
|
219
218
|
library,
|
|
@@ -231,7 +230,7 @@ function apply(ctx, rawConfig = {}) {
|
|
|
231
230
|
});
|
|
232
231
|
lastMaintainRunId = outcome.runId ?? "";
|
|
233
232
|
if (!outcome.ok) return err(outcome.error ?? "Maintenance scan failed.");
|
|
234
|
-
appendEvolutionEvent(ioRegistry.provider(), eventsFile(
|
|
233
|
+
appendEvolutionEvent(ioRegistry.provider(), eventsFile(evolutionRoot()), {
|
|
235
234
|
type: "maintain",
|
|
236
235
|
source: "manual",
|
|
237
236
|
runId: outcome.runId,
|
|
@@ -250,7 +249,7 @@ function apply(ctx, rawConfig = {}) {
|
|
|
250
249
|
}
|
|
251
250
|
if (/^maintain\b/.test(input)) return err("Unknown maintain arguments: expected bare `maintain` or `maintain --timeout <ms>` (a positive integer). Got: " + input);
|
|
252
251
|
if (input === "preset install") {
|
|
253
|
-
const target = join(
|
|
252
|
+
const target = join(evolutionRoot(), ".agent-presets", "evolution");
|
|
254
253
|
try {
|
|
255
254
|
const source = resolveAgentPresetDir(import.meta.url);
|
|
256
255
|
const deltaPath = join(source, "agent.cordis.yml");
|
|
@@ -284,7 +283,7 @@ function apply(ctx, rawConfig = {}) {
|
|
|
284
283
|
if (!toFile.startsWith("references/")) return err("to_file must live under references/ (log/detail destination).");
|
|
285
284
|
const ioRegistry = ctx.get("evolutionIo");
|
|
286
285
|
if (!ioRegistry) return err("Evolution IO registry not mounted — restructure unavailable.");
|
|
287
|
-
const result = await new SkillLibrary(config.skillsRoot, ioRegistry.provider()).restructure(name, [{
|
|
286
|
+
const result = await new SkillLibrary(resolveSkillsRoot({ root: config.skillsRoot }), ioRegistry.provider()).restructure(name, [{
|
|
288
287
|
heading,
|
|
289
288
|
toFile
|
|
290
289
|
}], "foreground");
|
package/lib/types/index.d.ts
CHANGED
|
@@ -6,7 +6,9 @@ import type { Context } from '@deepseek-ai/cordis';
|
|
|
6
6
|
export declare const name = "evolution-commands";
|
|
7
7
|
export interface Config {
|
|
8
8
|
/** Skill-tree root for maintain/restructure; empty uses skillsRoot().
|
|
9
|
-
* Align with tool-skill-manage/skill-usage/evolution-skill-catalog rows (A7).
|
|
9
|
+
* Align with tool-skill-manage/skill-usage/evolution-skill-catalog rows (A7).
|
|
10
|
+
* 0.3.22 (G3.2, F-342): resolved through resolveSkillsRoot() so an empty/
|
|
11
|
+
* whitespace value falls back to the default instead of a CWD-relative root. */
|
|
10
12
|
skillsRoot?: string | undefined;
|
|
11
13
|
/** Cooldown window for scan commands (ms) — misclick/rapid-trigger guard;
|
|
12
14
|
* secondary calls inside the window return the previous runId instead of
|
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.3.
|
|
4
|
+
"version": "0.3.23",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
],
|
|
31
31
|
"license": "MIT",
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@lmzhen/dsh-evolution-approval": "^0.3.
|
|
34
|
-
"@lmzhen/dsh-evolution-core": "^0.3.
|
|
35
|
-
"@lmzhen/dsh-evolution-maintenance": "^0.3.
|
|
33
|
+
"@lmzhen/dsh-evolution-approval": "^0.3.23",
|
|
34
|
+
"@lmzhen/dsh-evolution-core": "^0.3.23",
|
|
35
|
+
"@lmzhen/dsh-evolution-maintenance": "^0.3.23"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"@deepseek-ai/cordis": "^4.0.1",
|