@lmzhen/dsh-tool-skill-manage 0.48.0 → 0.50.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 +201 -113
- package/lib/types/skill-actions.d.ts +22 -0
- package/package.json +14 -14
package/lib/index.js
CHANGED
|
@@ -1,8 +1,88 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineTool, registerEvolutionTool, settingsPort, skillsPort } from "@lmzhen/dsh-evolution-core/platform";
|
|
2
|
+
import { DEFAULT_ARCHIVE_RETENTION_POLICY, DEFAULT_CITATION_POLICY, DEFAULT_REFERENCE_REWRITE_POLICY, DEFAULT_SKILL_LIMITS, DEFAULT_SKILL_VERSION_KEEP, DEFAULT_SUPPORT_FILE_CHAR_POLICY, DEFAULT_WRITE_CONFIRM_MODE, DEFAULT_WRITE_CONFIRM_TIMEOUT_SECONDS, DSH_AUTHORING_STANDARDS, SKILLS_GUIDANCE, SKILLS_GUIDANCE_SECTION_ORDER, authorityFrom, callingScope, clampOnce, computeDedupGroups, contentHash, createSubagentChannel, evolutionIoAdapter, fuzzyPatch, isPresent, isUnknown, liveBool, nearDuplicateSummaries, paramRowId, policyStageLimits, probePresent, probeUnknown, protectedSkillNamesOf, runWriteGates, skillWriteGateContext, unwrapLive, userSetKeys } from "@lmzhen/dsh-evolution-core";
|
|
2
3
|
import { effectiveSessionPolicy } from "@lmzhen/dsh-evolution-approval";
|
|
3
4
|
import z from "@deepseek-ai/schemastery";
|
|
4
|
-
import { defineTool, registerEvolutionTool } from "@lmzhen/dsh-evolution-core/platform";
|
|
5
5
|
import { DEFAULT_HEALTH_THRESHOLDS, anchorVerdict, authoringFeedback, newSkillLibrary, normalizeFrontmatter, parseFrontmatter, resolveExecOrigins, sessionReadSkillNames, sessionReadSupportFiles } from "@lmzhen/dsh-evolution-core/skills";
|
|
6
|
+
import { EXTRACT_PROMPT_V1, buildExtractPlanFromLibrary, ownerCandidatesFromSummaries, ownerDecisionText, projectExtractBodies, proposalFromPlan, readProposalReport, writeProposalReport } from "@lmzhen/dsh-evolution-core/extract";
|
|
7
|
+
//#region lib/types/skill-actions.js
|
|
8
|
+
const SKILL_ACTIONS = Object.freeze({
|
|
9
|
+
list: {
|
|
10
|
+
mutates: false,
|
|
11
|
+
needsName: false,
|
|
12
|
+
gate: "none"
|
|
13
|
+
},
|
|
14
|
+
review: {
|
|
15
|
+
mutates: false,
|
|
16
|
+
needsName: false,
|
|
17
|
+
gate: "none"
|
|
18
|
+
},
|
|
19
|
+
create: {
|
|
20
|
+
mutates: true,
|
|
21
|
+
needsName: true,
|
|
22
|
+
gate: "write"
|
|
23
|
+
},
|
|
24
|
+
edit: {
|
|
25
|
+
mutates: true,
|
|
26
|
+
needsName: true,
|
|
27
|
+
gate: "write"
|
|
28
|
+
},
|
|
29
|
+
update: {
|
|
30
|
+
mutates: true,
|
|
31
|
+
needsName: true,
|
|
32
|
+
gate: "write"
|
|
33
|
+
},
|
|
34
|
+
patch: {
|
|
35
|
+
mutates: true,
|
|
36
|
+
needsName: true,
|
|
37
|
+
gate: "write"
|
|
38
|
+
},
|
|
39
|
+
delete: {
|
|
40
|
+
mutates: true,
|
|
41
|
+
needsName: true,
|
|
42
|
+
gate: "approval"
|
|
43
|
+
},
|
|
44
|
+
write_file: {
|
|
45
|
+
mutates: true,
|
|
46
|
+
needsName: true,
|
|
47
|
+
gate: "write"
|
|
48
|
+
},
|
|
49
|
+
remove_file: {
|
|
50
|
+
mutates: true,
|
|
51
|
+
needsName: true,
|
|
52
|
+
gate: "write"
|
|
53
|
+
},
|
|
54
|
+
restructure: {
|
|
55
|
+
mutates: true,
|
|
56
|
+
needsName: true,
|
|
57
|
+
gate: "write"
|
|
58
|
+
},
|
|
59
|
+
extract: {
|
|
60
|
+
mutates: true,
|
|
61
|
+
needsName: false,
|
|
62
|
+
gate: "write"
|
|
63
|
+
},
|
|
64
|
+
pin: {
|
|
65
|
+
mutates: false,
|
|
66
|
+
needsName: true,
|
|
67
|
+
gate: "none"
|
|
68
|
+
},
|
|
69
|
+
unpin: {
|
|
70
|
+
mutates: false,
|
|
71
|
+
needsName: true,
|
|
72
|
+
gate: "none"
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
function skillActionOf(action) {
|
|
76
|
+
return typeof action === "string" && Object.prototype.hasOwnProperty.call(SKILL_ACTIONS, action) ? SKILL_ACTIONS[action] : void 0;
|
|
77
|
+
}
|
|
78
|
+
/** The one commit seam every table-dispatched action passes through. */
|
|
79
|
+
async function commitSkillAction(run) {
|
|
80
|
+
return run();
|
|
81
|
+
}
|
|
82
|
+
function isReadOnlySkillAction(action) {
|
|
83
|
+
return skillActionOf(action)?.mutates === false;
|
|
84
|
+
}
|
|
85
|
+
//#endregion
|
|
6
86
|
//#region lib/types/index.js
|
|
7
87
|
/**
|
|
8
88
|
* Model-facing skill_manage tool over ctx.evolutionIo + ctx.skillUsage.
|
|
@@ -23,19 +103,8 @@ import { DEFAULT_HEALTH_THRESHOLDS, anchorVerdict, authoringFeedback, newSkillLi
|
|
|
23
103
|
* documented in the README Safety model section.
|
|
24
104
|
* @module @lmzhen/dsh-tool-skill-manage
|
|
25
105
|
*/
|
|
26
|
-
/**
|
|
27
|
-
|
|
28
|
-
* (usage accounting at the patch_count bump, the cross-source directory exemption, the approval gap
|
|
29
|
-
* and the replay exemption). The four USES stay where they are — their neighbouring logic differs —
|
|
30
|
-
* but the CRITERION is this one predicate, so adding an action cannot update three of four.
|
|
31
|
-
*/
|
|
32
|
-
const READ_ONLY_ACTIONS = [
|
|
33
|
-
"list",
|
|
34
|
-
"review",
|
|
35
|
-
"pin",
|
|
36
|
-
"unpin"
|
|
37
|
-
];
|
|
38
|
-
const isReadOnlyAction = (action) => typeof action === "string" && READ_ONLY_ACTIONS.includes(action);
|
|
106
|
+
/** F-2: the read-only criterion is the action table's mutates flag. */
|
|
107
|
+
const isReadOnlyAction = isReadOnlySkillAction;
|
|
39
108
|
const name = "tool-skill-manage";
|
|
40
109
|
const inject = [
|
|
41
110
|
"tools",
|
|
@@ -367,23 +436,24 @@ function reasonOfError(error) {
|
|
|
367
436
|
return error instanceof Error ? error.message : String(error);
|
|
368
437
|
}
|
|
369
438
|
/**
|
|
370
|
-
* The registry's live
|
|
439
|
+
* The registry's live root agent for this call's session, or `undefined`.
|
|
371
440
|
*
|
|
372
441
|
* The registry keys agents by their shared agent/session id (platform `agent`), and the
|
|
373
|
-
* platform's `ask()` accepts only an agent that is BOTH its exact live instance and a
|
|
374
|
-
* that check is `user-questions`'s
|
|
375
|
-
*
|
|
376
|
-
*
|
|
442
|
+
* platform's `ask()` accepts only an agent that is BOTH its exact live instance and not a
|
|
443
|
+
* subagent — that check is `user-questions`'s `assertLiveRoot`: it compares
|
|
444
|
+
* `agents.get(id)` identity and rejects `session.header.origin === 'subagent'`. Delegated
|
|
445
|
+
* agents have no independent human, so the caller proceeds unconfirmed instead of blocking a
|
|
446
|
+
* question on an agent no human is watching.
|
|
377
447
|
* @param probe - the context, read through the optional-service probe.
|
|
378
448
|
* @param exec - this call's execution context.
|
|
379
449
|
* @returns the live root agent, when this session has one.
|
|
380
450
|
*/
|
|
381
451
|
function liveRootAgentOf(probe, exec) {
|
|
382
|
-
const agents = probe.get("
|
|
452
|
+
const agents = probe.get("evolutionPlatform")?.ports?.agents;
|
|
383
453
|
const sessionId = exec.agent?.session?.id;
|
|
384
454
|
if (agents === void 0 || typeof sessionId !== "string") return void 0;
|
|
385
455
|
const candidate = agents.get(sessionId);
|
|
386
|
-
return candidate !== void 0 &&
|
|
456
|
+
return candidate !== void 0 && candidate.session?.header?.origin !== "subagent" ? candidate : void 0;
|
|
387
457
|
}
|
|
388
458
|
/** The one thing the operator's answer decides: was the confirm label selected? */
|
|
389
459
|
function confirmedBy(answer, questionId, confirmLabel) {
|
|
@@ -391,12 +461,12 @@ function confirmedBy(answer, questionId, confirmLabel) {
|
|
|
391
461
|
}
|
|
392
462
|
function apply(ctx, rawConfig = {}) {
|
|
393
463
|
ctx.inject(["settings"], (injected) => {
|
|
394
|
-
const settings = injected
|
|
395
|
-
if (
|
|
464
|
+
const settings = settingsPort(injected);
|
|
465
|
+
if (settings?.configure === void 0) return;
|
|
396
466
|
const disposer = settings.configure({ auto: false }, ctx.fiber);
|
|
397
467
|
if (typeof disposer === "function") ctx.effect(() => disposer, "tool-skill-manage: settings presentation");
|
|
398
468
|
});
|
|
399
|
-
const systemPrompt = ctx.get("
|
|
469
|
+
const systemPrompt = ctx.get("evolutionPlatform")?.ports?.systemPrompt;
|
|
400
470
|
if (systemPrompt) ctx.effect(() => {
|
|
401
471
|
const disposeVariable = systemPrompt.variable(PROTECTED_SKILLS_VARIABLE, () => protectedSkillsLine());
|
|
402
472
|
const disposeSection = systemPrompt.section({
|
|
@@ -449,7 +519,7 @@ function apply(ctx, rawConfig = {}) {
|
|
|
449
519
|
};
|
|
450
520
|
const isDismissed = (error) => questionErrorCode(error) === "ASK_ABORTED";
|
|
451
521
|
const confirmSkillWrite = async (request, exec) => {
|
|
452
|
-
const questions = probe.get("
|
|
522
|
+
const questions = probe.get("evolutionPlatform")?.ports?.userQuestions;
|
|
453
523
|
if (questions === void 0) return confirmUnavailable("no user-questions service is mounted");
|
|
454
524
|
const ask = (agent) => questions.ask({
|
|
455
525
|
questions: [{
|
|
@@ -607,7 +677,7 @@ function apply(ctx, rawConfig = {}) {
|
|
|
607
677
|
};
|
|
608
678
|
};
|
|
609
679
|
const catalogWinner = async (name) => {
|
|
610
|
-
const catalog = ctx
|
|
680
|
+
const catalog = skillsPort(ctx);
|
|
611
681
|
if (catalog === void 0) return probeUnknown("the skills service is not mounted");
|
|
612
682
|
const scope = callingScope(ctx);
|
|
613
683
|
try {
|
|
@@ -625,6 +695,11 @@ function apply(ctx, rawConfig = {}) {
|
|
|
625
695
|
applyLimits();
|
|
626
696
|
const action = args.action;
|
|
627
697
|
const name = args.name ?? "";
|
|
698
|
+
if (skillActionOf(action)?.needsName === true && name === "") return {
|
|
699
|
+
ok: false,
|
|
700
|
+
message: `动作「${action}」需要 name。`,
|
|
701
|
+
skills: []
|
|
702
|
+
};
|
|
628
703
|
if (action === "extract" && origin === "background_review") return {
|
|
629
704
|
ok: false,
|
|
630
705
|
message: "背景审查不能执行 extract:review 只提议;提取必须由显式前台工具/命令执行。",
|
|
@@ -690,102 +765,115 @@ function apply(ctx, rawConfig = {}) {
|
|
|
690
765
|
}
|
|
691
766
|
let result;
|
|
692
767
|
let proposal;
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
toFile: typeof move.to_file === "string" ? move.to_file : ""
|
|
713
|
-
})), origin);
|
|
714
|
-
} else if (action === "extract") {
|
|
715
|
-
let source = typeof args.name === "string" ? args.name : "";
|
|
716
|
-
let items = Array.isArray(args.extract) ? args.extract : [];
|
|
717
|
-
let outcome = args.outcome;
|
|
718
|
-
let ownerCovers = args.owner_covers;
|
|
719
|
-
if (args.proposal_id !== void 0 && args.proposal_id !== "") {
|
|
720
|
-
const io = ctx.get("evolutionIo")?.provider();
|
|
721
|
-
if (io === void 0) result = {
|
|
768
|
+
const simpleActions = {
|
|
769
|
+
create: async () => {
|
|
770
|
+
feedbackLines.push(...await duplicateHintLines(name, candidateDescription, crossSourceView));
|
|
771
|
+
return library.create(name, args.content ?? "", origin, { managed: origin !== "foreground" });
|
|
772
|
+
},
|
|
773
|
+
edit: () => library.update(name, args.content ?? "", origin, stagedAnchor),
|
|
774
|
+
update: () => library.update(name, args.content ?? "", origin, stagedAnchor),
|
|
775
|
+
patch: () => library.patch(name, args.old_string ?? "", args.new_string ?? "", args.file_path ?? "", args.replace_all === true, origin),
|
|
776
|
+
delete: () => library.archive(name, args.absorbed_into ? { absorbedInto: args.absorbed_into } : {}),
|
|
777
|
+
write_file: () => library.writeSupportFile(name, args.file_path ?? "", args.file_content ?? "", origin, stagedAnchor),
|
|
778
|
+
remove_file: () => library.removeSupportFile(name, args.file_path ?? "", origin, stagedAnchor),
|
|
779
|
+
pin: () => library.setPinned(name, true, origin),
|
|
780
|
+
unpin: () => library.setPinned(name, false, origin),
|
|
781
|
+
restructure: async () => {
|
|
782
|
+
const moves = Array.isArray(args.restructure) ? args.restructure : [];
|
|
783
|
+
if (moves.some((move) => {
|
|
784
|
+
const raw = move;
|
|
785
|
+
return raw === null || typeof raw !== "object";
|
|
786
|
+
})) return {
|
|
722
787
|
ok: false,
|
|
723
|
-
message: "
|
|
788
|
+
message: "restructure 的每一项都必须是带 heading 与 to_file 的对象。"
|
|
724
789
|
};
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
790
|
+
return library.restructure(name, moves.map((move) => ({
|
|
791
|
+
heading: typeof move.heading === "string" ? move.heading : "",
|
|
792
|
+
toFile: typeof move.to_file === "string" ? move.to_file : ""
|
|
793
|
+
})), origin);
|
|
794
|
+
},
|
|
795
|
+
extract: async () => {
|
|
796
|
+
let result;
|
|
797
|
+
let source = typeof args.name === "string" ? args.name : "";
|
|
798
|
+
let items = Array.isArray(args.extract) ? args.extract : [];
|
|
799
|
+
let outcome = args.outcome;
|
|
800
|
+
let ownerCovers = args.owner_covers;
|
|
801
|
+
if (args.proposal_id !== void 0 && args.proposal_id !== "") {
|
|
802
|
+
const io = ctx.get("evolutionIo")?.provider();
|
|
803
|
+
if (io === void 0) result = {
|
|
736
804
|
ok: false,
|
|
737
|
-
message: "
|
|
805
|
+
message: "proposal_id 需要 evolutionIo 提供者。"
|
|
738
806
|
};
|
|
739
807
|
else {
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
}
|
|
808
|
+
const report = await readProposalReport(io, args.proposal_id);
|
|
809
|
+
if (report === null) result = {
|
|
810
|
+
ok: false,
|
|
811
|
+
message: "找不到 extract proposal:" + args.proposal_id
|
|
812
|
+
};
|
|
813
|
+
else if (report.outcome === "keep") result = {
|
|
814
|
+
ok: false,
|
|
815
|
+
message: "该 proposal 的结论是 keep,没有可应用提取。"
|
|
816
|
+
};
|
|
817
|
+
else if (report.outcome === "owner-gap" || report.owner.mode !== "covered" || report.owner.name === void 0) result = {
|
|
818
|
+
ok: false,
|
|
819
|
+
message: "该 proposal 未覆盖 owner(owner-gap),不能应用。"
|
|
820
|
+
};
|
|
821
|
+
else {
|
|
822
|
+
source = report.source;
|
|
823
|
+
outcome = report.outcome === "extract" || report.outcome === "mixed" ? report.outcome : void 0;
|
|
824
|
+
ownerCovers = void 0;
|
|
825
|
+
items = report.parts.map((part) => ({
|
|
826
|
+
heading: part.heading,
|
|
827
|
+
...part.anchor.start === void 0 ? {} : { start: part.anchor.start },
|
|
828
|
+
...part.anchor.end === void 0 ? {} : { end: part.anchor.end },
|
|
829
|
+
to_skill: report.owner.name
|
|
830
|
+
}));
|
|
831
|
+
}
|
|
749
832
|
}
|
|
750
833
|
}
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
message: result.message
|
|
760
|
-
};
|
|
761
|
-
if (!built.ok) result = {
|
|
762
|
-
ok: false,
|
|
763
|
-
message: built.message
|
|
764
|
-
};
|
|
765
|
-
else {
|
|
766
|
-
proposal = JSON.stringify(proposalFromPlan(built.plan, { runId: "tool-" + Date.now().toString(36) }));
|
|
767
|
-
const ownerText = ownerDecisionText(built.plan.owner);
|
|
768
|
-
const decisionLine = `提取判定:outcome=${built.plan.outcome};target=${built.plan.target.name};owner=${ownerText}`;
|
|
769
|
-
const candidateLines = built.candidates.slice(0, 8).map((candidate) => "- " + candidate.name + ":" + candidate.description + (candidate.whenToUse === void 0 ? "" : ";whenToUse: " + candidate.whenToUse) + (candidate.headings.length === 0 ? "" : ";headings: " + candidate.headings.join(" / ")));
|
|
770
|
-
result = args.dry_run === true ? {
|
|
771
|
-
ok: true,
|
|
772
|
-
message: "提取计划(未写入):" + built.plan.parts.map((part) => "## " + part.heading).join(", ") + " -> " + built.plan.target.name + "\n" + decisionLine + (candidateLines.length === 0 ? "" : "\n候选 owner:\n" + candidateLines.join("\n"))
|
|
773
|
-
} : await library.extract(built.plan, origin);
|
|
774
|
-
if (result.ok && built.warnings !== void 0 && built.warnings.length > 0) result = {
|
|
775
|
-
...result,
|
|
776
|
-
message: result.message + "\n" + built.warnings.join("\n")
|
|
834
|
+
const built = result === void 0 ? await buildExtractPlanFromLibrary(library, {
|
|
835
|
+
source,
|
|
836
|
+
items,
|
|
837
|
+
...outcome === void 0 ? {} : { outcome },
|
|
838
|
+
...ownerCovers === void 0 ? {} : { ownerCovers }
|
|
839
|
+
}) : {
|
|
840
|
+
ok: false,
|
|
841
|
+
message: result.message
|
|
777
842
|
};
|
|
778
|
-
if (
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
}
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
843
|
+
if (!built.ok) result = {
|
|
844
|
+
ok: false,
|
|
845
|
+
message: built.message
|
|
846
|
+
};
|
|
847
|
+
else {
|
|
848
|
+
const plan = built.plan;
|
|
849
|
+
proposal = JSON.stringify(proposalFromPlan(plan, { runId: "tool-" + Date.now().toString(36) }));
|
|
850
|
+
const ownerText = ownerDecisionText(plan.owner);
|
|
851
|
+
const decisionLine = `提取判定:outcome=${plan.outcome};target=${plan.target.name};owner=${ownerText}`;
|
|
852
|
+
const candidateLines = built.candidates.slice(0, 8).map((candidate) => "- " + candidate.name + ":" + candidate.description + (candidate.whenToUse === void 0 ? "" : ";whenToUse: " + candidate.whenToUse) + (candidate.headings.length === 0 ? "" : ";headings: " + candidate.headings.join(" / ")));
|
|
853
|
+
result = args.dry_run === true ? {
|
|
854
|
+
ok: true,
|
|
855
|
+
message: "提取计划(未写入):" + plan.parts.map((part) => "## " + part.heading).join(", ") + " -> " + plan.target.name + "\n" + decisionLine + (candidateLines.length === 0 ? "" : "\n候选 owner:\n" + candidateLines.join("\n"))
|
|
856
|
+
} : await library.extract(plan, origin);
|
|
857
|
+
if (result.ok && built.warnings !== void 0 && built.warnings.length > 0) result = {
|
|
858
|
+
...result,
|
|
859
|
+
message: result.message + "\n" + built.warnings.join("\n")
|
|
860
|
+
};
|
|
861
|
+
if (args.dry_run === true) try {
|
|
862
|
+
const io = ctx.get("evolutionIo")?.provider();
|
|
863
|
+
if (io !== void 0) await writeProposalReport(io, proposalFromPlan(plan, { runId: "tool-" + Date.now().toString(36) }));
|
|
864
|
+
} catch {}
|
|
865
|
+
if (result.ok) result = {
|
|
866
|
+
...result,
|
|
867
|
+
message: result.message + "\n" + decisionLine
|
|
868
|
+
};
|
|
869
|
+
}
|
|
870
|
+
return result ?? {
|
|
871
|
+
ok: false,
|
|
872
|
+
message: "extract did not produce a result"
|
|
785
873
|
};
|
|
786
874
|
}
|
|
787
|
-
}
|
|
788
|
-
|
|
875
|
+
};
|
|
876
|
+
if (action !== void 0 && Object.prototype.hasOwnProperty.call(simpleActions, action)) result = await commitSkillAction(simpleActions[action]);
|
|
789
877
|
else result = {
|
|
790
878
|
ok: false,
|
|
791
879
|
message: `未知动作「${action}」。`
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The ONE action table for skill_manage. Handlers still live in the tool until
|
|
3
|
+
* the mutation pipeline is extracted, but every cross-cutting decision
|
|
4
|
+
* (read-only, name requirement, gate) reads this table instead of duplicating
|
|
5
|
+
* an action list.
|
|
6
|
+
*/
|
|
7
|
+
import type { SkillActionResult } from '@lmzhen/dsh-evolution-core/skills';
|
|
8
|
+
export type SkillActionId = 'list' | 'review' | 'create' | 'edit' | 'update' | 'patch' | 'delete' | 'write_file' | 'remove_file' | 'restructure' | 'extract' | 'pin' | 'unpin';
|
|
9
|
+
export interface SkillActionMeta {
|
|
10
|
+
/** Does this action write skill bytes (and therefore enter usage/journal)? */
|
|
11
|
+
readonly mutates: boolean;
|
|
12
|
+
/** Does the action address one skill by name? */
|
|
13
|
+
readonly needsName: boolean;
|
|
14
|
+
/** none = read-only; write = SkillLibrary write path; approval = staged gate. */
|
|
15
|
+
readonly gate: 'none' | 'write' | 'approval';
|
|
16
|
+
}
|
|
17
|
+
export declare const SKILL_ACTIONS: Readonly<Record<SkillActionId, SkillActionMeta>>;
|
|
18
|
+
export declare function skillActionOf(action: unknown): SkillActionMeta | undefined;
|
|
19
|
+
/** The one commit seam every table-dispatched action passes through. */
|
|
20
|
+
export declare function commitSkillAction(run: () => Promise<SkillActionResult>): Promise<SkillActionResult>;
|
|
21
|
+
export declare function isReadOnlySkillAction(action: unknown): boolean;
|
|
22
|
+
//# sourceMappingURL=skill-actions.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lmzhen/dsh-tool-skill-manage",
|
|
3
3
|
"description": "Model-facing skill_manage tool (community build)",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.50.0",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -29,25 +29,25 @@
|
|
|
29
29
|
"license": "MIT",
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@deepseek-ai/schemastery": "^3.18.5",
|
|
32
|
-
"@lmzhen/dsh-evolution-approval": "^0.
|
|
33
|
-
"@lmzhen/dsh-evolution-core": "^0.
|
|
34
|
-
"@lmzhen/dsh-evolution-skill-discovery": "^0.
|
|
32
|
+
"@lmzhen/dsh-evolution-approval": "^0.50.0",
|
|
33
|
+
"@lmzhen/dsh-evolution-core": "^0.50.0",
|
|
34
|
+
"@lmzhen/dsh-evolution-skill-discovery": "^0.50.0"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"@deepseek-ai/cordis": "^4.0.5",
|
|
38
|
-
"@deepseek-ai/dsh-skill": "^0.2.2-rc.
|
|
39
|
-
"@deepseek-ai/dsh-system-prompt": "^0.2.2-rc.
|
|
40
|
-
"@deepseek-ai/dsh-agent": "^0.2.2-rc.
|
|
41
|
-
"@lmzhen/dsh-evolution-skill-discovery": "^0.
|
|
38
|
+
"@deepseek-ai/dsh-skill": "^0.2.2-rc.3",
|
|
39
|
+
"@deepseek-ai/dsh-system-prompt": "^0.2.2-rc.3",
|
|
40
|
+
"@deepseek-ai/dsh-agent": "^0.2.2-rc.3",
|
|
41
|
+
"@lmzhen/dsh-evolution-skill-discovery": "^0.50.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@deepseek-ai/dsh-agent-loop-testkit": "^0.2.2-rc.
|
|
45
|
-
"@deepseek-ai/dsh-skill": "^0.2.2-rc.
|
|
46
|
-
"@deepseek-ai/dsh-system-prompt": "^0.2.2-rc.
|
|
47
|
-
"@lmzhen/dsh-evolution-core": "^0.
|
|
48
|
-
"@lmzhen/dsh-evolution-skill-discovery": "^0.
|
|
44
|
+
"@deepseek-ai/dsh-agent-loop-testkit": "^0.2.2-rc.3",
|
|
45
|
+
"@deepseek-ai/dsh-skill": "^0.2.2-rc.3",
|
|
46
|
+
"@deepseek-ai/dsh-system-prompt": "^0.2.2-rc.3",
|
|
47
|
+
"@lmzhen/dsh-evolution-core": "^0.50.0",
|
|
48
|
+
"@lmzhen/dsh-evolution-skill-discovery": "^0.50.0"
|
|
49
49
|
},
|
|
50
50
|
"engines": {
|
|
51
|
-
"dsh": ">=0.2.2-rc.
|
|
51
|
+
"dsh": ">=0.2.2-rc.3 <0.2.3-0"
|
|
52
52
|
}
|
|
53
53
|
}
|