@lmzhen/dsh-evolution-commands 0.12.0 → 0.13.0
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 +16 -5
- package/package.json +5 -5
package/lib/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { createRequire } from "node:module";
|
|
|
2
2
|
import z from "@deepseek-ai/schemastery";
|
|
3
3
|
import { effectiveSessionPolicy } from "@lmzhen/dsh-evolution-approval";
|
|
4
4
|
import { createUserMessage } from "@deepseek-ai/dsh-llm";
|
|
5
|
-
import { DEFAULT_SKILL_LIMITS, MAX_TIMER_DELAY_MS, PARAM_EXPOSURE, PARAM_GROUP_LABELS, PARAM_NAMESPACES, appendEvolutionEvent, assertSkillsRootAliasRetired, buildLearnPrompt, canonicalWriteId, clampedNumber, composePresetComposition, errorText, eventsFile, evolutionRoot, isDeprecatedParamId, isMissingPath, newSkillLibrary, partitionVersions, policyStageLimits, resolveParamId, resolveRootConfig, scopedProbeReport } from "@lmzhen/dsh-evolution-core";
|
|
5
|
+
import { DEFAULT_SKILL_LIMITS, MAX_TIMER_DELAY_MS, PARAM_EXPOSURE, PARAM_GROUP_LABELS, PARAM_NAMESPACES, appendEvolutionEvent, assertSkillsRootAliasRetired, buildLearnPrompt, canonicalWriteId, clampedNumber, composePresetComposition, elapsedSince, errorText, eventsFile, evolutionRoot, isDeprecatedParamId, isMissingPath, newSkillLibrary, partitionVersions, policyStageLimits, resolveParamId, resolveRootConfig, scopedProbeReport } from "@lmzhen/dsh-evolution-core";
|
|
6
6
|
import { buildEnrichment, buildMaintainFacts, runMaintain, snapshotFromLibrary } from "@lmzhen/dsh-evolution-maintenance";
|
|
7
7
|
import { copyFileSync, existsSync, mkdirSync, readFileSync, readdirSync, renameSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
8
8
|
import { dirname, join } from "node:path";
|
|
@@ -694,10 +694,11 @@ function renderParamRows(rows, options) {
|
|
|
694
694
|
const counts = options.providerMounted ? `共 ${rows.length} 个参数:${tiers};你改过的:${userRows} 项。` : `共 ${rows.length} 个参数:${tiers};是否改过:未知(没有设置服务)。`;
|
|
695
695
|
const note = options.providerMounted ? "来源:我改过=你在设置里改的;默认=安装时的配置;不可改=该功能不提供用户可改项。" : "设置服务未挂载——读不到你改过的值,所以每行显示的都是安装时的配置(这不等于「你没改过」)。";
|
|
696
696
|
return [
|
|
697
|
+
counts,
|
|
698
|
+
"",
|
|
697
699
|
header,
|
|
698
700
|
...body,
|
|
699
701
|
"",
|
|
700
|
-
counts,
|
|
701
702
|
TIER_LEGEND,
|
|
702
703
|
note
|
|
703
704
|
].join("\n");
|
|
@@ -830,7 +831,11 @@ function renderHint() {
|
|
|
830
831
|
}
|
|
831
832
|
/** The bare `/evolution` help body (one line per subcommand). */
|
|
832
833
|
function renderHelpText() {
|
|
833
|
-
return
|
|
834
|
+
return [
|
|
835
|
+
`/evolution subcommands (${COMMAND_ENTRIES.length}):`,
|
|
836
|
+
"",
|
|
837
|
+
...COMMAND_ENTRIES.map((entry) => ` ${entry.usage.padEnd(44)} ${entry.summary}`)
|
|
838
|
+
].join("\n");
|
|
834
839
|
}
|
|
835
840
|
//#endregion
|
|
836
841
|
//#region lib/types/index.js
|
|
@@ -889,10 +894,16 @@ function apply(ctx, rawConfig = {}) {
|
|
|
889
894
|
const pending = [...new Map(listed.map((row) => [row.id, row])).values()];
|
|
890
895
|
if (pending.length === 0) return ok("No pending evolution writes.");
|
|
891
896
|
const detailed = pendingMatch[0] === "pending --detail";
|
|
897
|
+
const nowMs = Date.now();
|
|
898
|
+
const attribution = (p) => {
|
|
899
|
+
const age = elapsedSince(p.createdAt, nowMs);
|
|
900
|
+
const unit = age.n === 1 ? age.unit.replace(/s$/u, "") : age.unit;
|
|
901
|
+
return ` · ${age.unit === "now" ? "just now" : `${age.n} ${unit} ago`}${p.origin === void 0 ? "" : ` from ${p.origin}`}${p.sessionId === void 0 ? "" : ` (session ${p.sessionId.slice(0, 8)})`}`;
|
|
902
|
+
};
|
|
892
903
|
return ok(pending.map((p) => {
|
|
893
|
-
if (!detailed) return `${p.id} ${p.kind} ${p.status === "executing" ? "EXECUTING " : ""}${p.summary}`;
|
|
904
|
+
if (!detailed) return `${p.id} ${p.kind} ${p.status === "executing" ? "EXECUTING " : ""}${p.summary}${attribution(p)}`;
|
|
894
905
|
const status = p.status === "executing" ? "EXECUTING" : p.status;
|
|
895
|
-
const line = `${p.id} ${p.kind} ${status} ${p.summary}`;
|
|
906
|
+
const line = `${p.id} ${p.kind} ${status} ${p.summary}${attribution(p)}`;
|
|
896
907
|
return p.args === void 0 ? line : `${line}\n staged args: ${safeStagedArgs(p.args)}`;
|
|
897
908
|
}).join("\n") + (pending.some((p) => p.status === "executing") ? "\n(EXECUTING: a previous approve may have crashed after running; verify the write manually, then reject — approve will not re-run it)" : ""));
|
|
898
909
|
}
|
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 (/evolution pending|curator|maintain|doctor) (community build)",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.13.0",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
"license": "MIT",
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@deepseek-ai/schemastery": "^3.18.1",
|
|
30
|
-
"@lmzhen/dsh-evolution-approval": "^0.
|
|
31
|
-
"@lmzhen/dsh-evolution-core": "^0.
|
|
32
|
-
"@lmzhen/dsh-evolution-maintenance": "^0.
|
|
30
|
+
"@lmzhen/dsh-evolution-approval": "^0.13.0",
|
|
31
|
+
"@lmzhen/dsh-evolution-core": "^0.13.0",
|
|
32
|
+
"@lmzhen/dsh-evolution-maintenance": "^0.13.0"
|
|
33
33
|
},
|
|
34
34
|
"optionalDependencies": {
|
|
35
|
-
"@lmzhen/dsh-evolution-agent-preset": "^0.
|
|
35
|
+
"@lmzhen/dsh-evolution-agent-preset": "^0.13.0"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"@deepseek-ai/cordis": "^4.0.1",
|