dsh-mnemon-source-skills 0.5.5 → 0.5.6
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/client.js +4 -1
- package/lib/contracts.d.ts +3 -0
- package/lib/index.js +10 -2
- package/lib/types/contracts.d.ts +3 -0
- package/package.json +6 -6
- package/presentation/locales.json +2 -0
package/lib/client.js
CHANGED
|
@@ -325,6 +325,7 @@ window.__ModuleLoader__.load({
|
|
|
325
325
|
"evolution.evidenceGone": "这段对话记录已删除。",
|
|
326
326
|
"evolution.openRecord": "完整记录",
|
|
327
327
|
"draft.title": "草案",
|
|
328
|
+
"evolution.targetRoot": "建议位置:{root}",
|
|
328
329
|
"draft.writeTo": "写入",
|
|
329
330
|
"draft.adopt": "采纳",
|
|
330
331
|
"draft.discard": "放弃",
|
|
@@ -673,6 +674,7 @@ window.__ModuleLoader__.load({
|
|
|
673
674
|
"evolution.evidenceGone": "This conversation record was deleted.",
|
|
674
675
|
"evolution.openRecord": "Full record",
|
|
675
676
|
"draft.title": "Draft",
|
|
677
|
+
"evolution.targetRoot": "Suggested destination: {root}",
|
|
676
678
|
"draft.writeTo": "Write to",
|
|
677
679
|
"draft.adopt": "Adopt",
|
|
678
680
|
"draft.discard": "Discard",
|
|
@@ -3700,7 +3702,8 @@ window.__ModuleLoader__.load({
|
|
|
3700
3702
|
const meta = [
|
|
3701
3703
|
...suggestion.sourceSessionTitle === void 0 ? [] : [t("evolution.from", { session: suggestion.sourceSessionTitle })],
|
|
3702
3704
|
relative(t, suggestion.createdAt),
|
|
3703
|
-
t("evolution.confidence", { value: Math.round(suggestion.confidence * 100) })
|
|
3705
|
+
t("evolution.confidence", { value: Math.round(suggestion.confidence * 100) }),
|
|
3706
|
+
...suggestion.action === "create" && suggestion.targetRoot !== void 0 ? [t("evolution.targetRoot", { root: t(`root.${suggestion.targetRoot}`) })] : []
|
|
3704
3707
|
];
|
|
3705
3708
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("article", {
|
|
3706
3709
|
className: css.skDetail,
|
package/lib/contracts.d.ts
CHANGED
|
@@ -167,6 +167,8 @@ interface SkillSuggestion {
|
|
|
167
167
|
id: string;
|
|
168
168
|
skillName: string;
|
|
169
169
|
action: 'create' | 'update';
|
|
170
|
+
/** For new skills, the Host-resolved destination; absent on older suggestions. */
|
|
171
|
+
targetRoot?: SkillRootKind;
|
|
170
172
|
summary: string;
|
|
171
173
|
rationale?: string;
|
|
172
174
|
confidence: number;
|
|
@@ -398,6 +400,7 @@ interface ReviewRecordInput {
|
|
|
398
400
|
suggestions: Array<{
|
|
399
401
|
skillName: string;
|
|
400
402
|
action: 'create' | 'update';
|
|
403
|
+
targetRoot?: SkillRootKind;
|
|
401
404
|
summary: string;
|
|
402
405
|
rationale?: string;
|
|
403
406
|
confidence: number;
|
package/lib/index.js
CHANGED
|
@@ -966,6 +966,7 @@ function admitReview(context, input) {
|
|
|
966
966
|
id: context.id(),
|
|
967
967
|
skillName: proposal.skillName,
|
|
968
968
|
action: proposal.action,
|
|
969
|
+
...proposal.action === "create" && proposal.targetRoot !== void 0 ? { targetRoot: proposal.targetRoot } : {},
|
|
969
970
|
summary: clip$1(proposal.summary, 600),
|
|
970
971
|
...proposal.rationale === void 0 || proposal.rationale.trim() === "" ? {} : { rationale: clip$1(proposal.rationale, 2e3) },
|
|
971
972
|
confidence,
|
|
@@ -3710,7 +3711,7 @@ var SkillsService = class {
|
|
|
3710
3711
|
...input.suggestionId === void 0 ? {} : { suggestionId: input.suggestionId },
|
|
3711
3712
|
skillName: input.skillName,
|
|
3712
3713
|
action: loaded === void 0 ? "create" : "update",
|
|
3713
|
-
...loaded === void 0 ? { targetRoot: input.targetRoot ?? DEFAULT_ROOT } : {
|
|
3714
|
+
...loaded === void 0 ? { targetRoot: input.targetRoot ?? suggestion?.targetRoot ?? DEFAULT_ROOT } : {
|
|
3714
3715
|
baseKey: loaded.key,
|
|
3715
3716
|
baseHash: loaded.hash
|
|
3716
3717
|
},
|
|
@@ -3765,7 +3766,13 @@ var SkillsService = class {
|
|
|
3765
3766
|
} else {
|
|
3766
3767
|
const root = input.root ?? draft.targetRoot ?? DEFAULT_ROOT;
|
|
3767
3768
|
if (activeSkill(catalog, draft.skillName) !== void 0) throw new Error(`${draft.skillName} exists now; draft it again as an update`);
|
|
3768
|
-
const
|
|
3769
|
+
const target = rootPath(catalog, root);
|
|
3770
|
+
if (root.startsWith("project-")) try {
|
|
3771
|
+
if (catalog.projectRoot === void 0 || !statSync(catalog.projectRoot).isDirectory()) throw new Error("not a directory");
|
|
3772
|
+
} catch {
|
|
3773
|
+
throw new Error("The selected workspace project is unavailable; select an existing workspace or explicitly choose a user skill root.");
|
|
3774
|
+
}
|
|
3775
|
+
const directory = join(target, draft.skillName);
|
|
3769
3776
|
if (existsSync(directory) || existsSync(directory + ".md")) throw new Error(`${draft.skillName} already exists in this root`);
|
|
3770
3777
|
writeFileAtomic(join(directory, "SKILL.md"), draft.content);
|
|
3771
3778
|
key = `${root}:${draft.skillName}`;
|
|
@@ -4612,6 +4619,7 @@ function reviewRecord(value) {
|
|
|
4612
4619
|
return {
|
|
4613
4620
|
skillName: memoryInputText(suggestion.skillName, "skillName", 120),
|
|
4614
4621
|
action: suggestion.action === "update" ? "update" : "create",
|
|
4622
|
+
...rootKind(suggestion.targetRoot) === void 0 ? {} : { targetRoot: rootKind(suggestion.targetRoot) },
|
|
4615
4623
|
summary: memoryInputText(suggestion.summary, "summary", 2e3),
|
|
4616
4624
|
...optionalText(suggestion.rationale, "rationale", 4e3) === void 0 ? {} : { rationale: optionalText(suggestion.rationale, "rationale", 4e3) },
|
|
4617
4625
|
confidence: Number(suggestion.confidence),
|
package/lib/types/contracts.d.ts
CHANGED
|
@@ -149,6 +149,8 @@ export interface SkillSuggestion {
|
|
|
149
149
|
id: string;
|
|
150
150
|
skillName: string;
|
|
151
151
|
action: 'create' | 'update';
|
|
152
|
+
/** For new skills, the Host-resolved destination; absent on older suggestions. */
|
|
153
|
+
targetRoot?: SkillRootKind;
|
|
152
154
|
summary: string;
|
|
153
155
|
rationale?: string;
|
|
154
156
|
confidence: number;
|
|
@@ -380,6 +382,7 @@ export interface ReviewRecordInput {
|
|
|
380
382
|
suggestions: Array<{
|
|
381
383
|
skillName: string;
|
|
382
384
|
action: 'create' | 'update';
|
|
385
|
+
targetRoot?: SkillRootKind;
|
|
383
386
|
summary: string;
|
|
384
387
|
rationale?: string;
|
|
385
388
|
confidence: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-mnemon-source-skills",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.6",
|
|
4
4
|
"description": "Skills Source for Composable View Memory: DSH skill management, evolution suggestions, evidence trajectories and eval sets.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -57,12 +57,12 @@
|
|
|
57
57
|
"react": "^18.2.0"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@deepseek-ai/dsh-client-ui-primitives": "0.2.1-rc.
|
|
60
|
+
"@deepseek-ai/dsh-client-ui-primitives": "0.2.1-rc.5",
|
|
61
61
|
"@testing-library/react": "^16.3.0",
|
|
62
62
|
"@types/node": "^22.0.0",
|
|
63
63
|
"@types/react": "^18.3.0",
|
|
64
64
|
"@types/react-dom": "^18.3.0",
|
|
65
|
-
"dsh-mnemon": "^0.5.
|
|
65
|
+
"dsh-mnemon": "^0.5.39",
|
|
66
66
|
"jsdom": "^26.0.0",
|
|
67
67
|
"react": "^18.2.0",
|
|
68
68
|
"react-dom": "^18.2.0",
|
|
@@ -86,9 +86,9 @@
|
|
|
86
86
|
"micromark-util-sanitize-uri": "^2.0.1",
|
|
87
87
|
"micromark-util-symbol": "^2.0.1",
|
|
88
88
|
"shiki": "^4.3.1",
|
|
89
|
-
"@deepseek-ai/dsh-client-store": "0.2.1-rc.
|
|
90
|
-
"@deepseek-ai/dsh-util-code-language": "0.2.1-rc.
|
|
91
|
-
"@deepseek-ai/dsh-util-workspace-path": "0.2.1-rc.
|
|
89
|
+
"@deepseek-ai/dsh-client-store": "0.2.1-rc.5",
|
|
90
|
+
"@deepseek-ai/dsh-util-code-language": "0.2.1-rc.5",
|
|
91
|
+
"@deepseek-ai/dsh-util-workspace-path": "0.2.1-rc.5",
|
|
92
92
|
"diff": "^9.0.0",
|
|
93
93
|
"immer": "^10.1.1",
|
|
94
94
|
"simple-icons": "16.31.0",
|
|
@@ -143,6 +143,7 @@
|
|
|
143
143
|
"evolution.evidenceGone": "这段对话记录已删除。",
|
|
144
144
|
"evolution.openRecord": "完整记录",
|
|
145
145
|
"draft.title": "草案",
|
|
146
|
+
"evolution.targetRoot": "建议位置:{root}",
|
|
146
147
|
"draft.writeTo": "写入",
|
|
147
148
|
"draft.adopt": "采纳",
|
|
148
149
|
"draft.discard": "放弃",
|
|
@@ -491,6 +492,7 @@
|
|
|
491
492
|
"evolution.evidenceGone": "This conversation record was deleted.",
|
|
492
493
|
"evolution.openRecord": "Full record",
|
|
493
494
|
"draft.title": "Draft",
|
|
495
|
+
"evolution.targetRoot": "Suggested destination: {root}",
|
|
494
496
|
"draft.writeTo": "Write to",
|
|
495
497
|
"draft.adopt": "Adopt",
|
|
496
498
|
"draft.discard": "Discard",
|