@lmzhen/dsh-tool-skill-manage 0.46.0 → 0.48.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 +9 -42
- package/lib/types/index.d.ts +4 -10
- package/package.json +7 -7
- package/lib/types/write-gates.d.ts +0 -12
package/lib/index.js
CHANGED
|
@@ -1,39 +1,8 @@
|
|
|
1
|
-
import { DEFAULT_ARCHIVE_RETENTION_POLICY, DEFAULT_CITATION_POLICY, DEFAULT_REFERENCE_REWRITE_POLICY, DEFAULT_SKILL_LIMITS, DEFAULT_SKILL_VERSION_KEEP, DEFAULT_SUPPORT_FILE_CHAR_POLICY, DSH_AUTHORING_STANDARDS, EXTRACT_PROMPT_V1, SKILLS_GUIDANCE, SKILLS_GUIDANCE_SECTION_ORDER, authorityFrom, buildExtractPlanFromLibrary, callingScope, clampOnce, computeDedupGroups, contentHash, createSubagentChannel, evolutionIoAdapter, fuzzyPatch, isPresent, isUnknown, liveBool, nearDuplicateSummaries, ownerCandidatesFromSummaries, ownerDecisionText, paramRowId, policyStageLimits, probePresent, probeUnknown, projectExtractBodies, proposalFromPlan, protectedSkillNamesOf, readProposalReport, skillWriteGateContext, unwrapLive, userSetKeys, writeProposalReport } from "@lmzhen/dsh-evolution-core";
|
|
1
|
+
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, EXTRACT_PROMPT_V1, SKILLS_GUIDANCE, SKILLS_GUIDANCE_SECTION_ORDER, authorityFrom, buildExtractPlanFromLibrary, callingScope, clampOnce, computeDedupGroups, contentHash, createSubagentChannel, evolutionIoAdapter, fuzzyPatch, isPresent, isUnknown, liveBool, nearDuplicateSummaries, ownerCandidatesFromSummaries, ownerDecisionText, paramRowId, policyStageLimits, probePresent, probeUnknown, projectExtractBodies, proposalFromPlan, protectedSkillNamesOf, readProposalReport, runWriteGates, skillWriteGateContext, unwrapLive, userSetKeys, writeProposalReport } from "@lmzhen/dsh-evolution-core";
|
|
2
2
|
import { effectiveSessionPolicy } from "@lmzhen/dsh-evolution-approval";
|
|
3
3
|
import z from "@deepseek-ai/schemastery";
|
|
4
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
|
-
//#region \0rolldown/runtime.js
|
|
7
|
-
var __defProp = Object.defineProperty;
|
|
8
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
9
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
10
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
-
var __exportAll = (all, no_symbols) => {
|
|
12
|
-
let target = {};
|
|
13
|
-
for (var name in all) __defProp(target, name, {
|
|
14
|
-
get: all[name],
|
|
15
|
-
enumerable: true
|
|
16
|
-
});
|
|
17
|
-
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
18
|
-
return target;
|
|
19
|
-
};
|
|
20
|
-
var __copyProps = (to, from, except, desc) => {
|
|
21
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
22
|
-
key = keys[i];
|
|
23
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
24
|
-
get: ((k) => from[k]).bind(null, key),
|
|
25
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
return to;
|
|
29
|
-
};
|
|
30
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
31
|
-
//#endregion
|
|
32
|
-
//#region lib/types/write-gates.js
|
|
33
|
-
var write_gates_exports = /* @__PURE__ */ __exportAll({});
|
|
34
|
-
import * as import__deepseek_ai_dsh_evolution_core from "@lmzhen/dsh-evolution-core";
|
|
35
|
-
__reExport(write_gates_exports, import__deepseek_ai_dsh_evolution_core);
|
|
36
|
-
//#endregion
|
|
37
6
|
//#region lib/types/index.js
|
|
38
7
|
/**
|
|
39
8
|
* Model-facing skill_manage tool over ctx.evolutionIo + ctx.skillUsage.
|
|
@@ -93,7 +62,6 @@ const Config = z.object({
|
|
|
93
62
|
skillContentChars: z.number().min(1).volatile(),
|
|
94
63
|
citationPolicy: z.union([z.const("verify"), z.const("refuse")]).volatile(),
|
|
95
64
|
supportFileCharPolicy: z.union([z.const("report"), z.const("enforce")]).volatile(),
|
|
96
|
-
maxSkillContentChars: z.number().min(1).default(DEFAULT_SKILL_LIMITS.maxSkillContentChars),
|
|
97
65
|
maxSkillFileBytes: z.number().min(1).default(DEFAULT_SKILL_LIMITS.maxSkillFileBytes).volatile(),
|
|
98
66
|
descriptionStrict: z.boolean().default(false).volatile(),
|
|
99
67
|
threatExemptLabels: z.array(z.string()).default([]),
|
|
@@ -103,8 +71,8 @@ const Config = z.object({
|
|
|
103
71
|
z.const("auto"),
|
|
104
72
|
z.const("ask"),
|
|
105
73
|
z.const("timeout")
|
|
106
|
-
]).default(
|
|
107
|
-
skillWriteConfirmTimeoutSeconds: z.number().min(1).default(
|
|
74
|
+
]).default(DEFAULT_WRITE_CONFIRM_MODE).volatile(),
|
|
75
|
+
skillWriteConfirmTimeoutSeconds: z.number().min(1).default(DEFAULT_WRITE_CONFIRM_TIMEOUT_SECONDS).volatile()
|
|
108
76
|
});
|
|
109
77
|
/** The four caps a user may only tighten, in schema order (the sentry reads it). */
|
|
110
78
|
const SKILL_SETTINGS_CAPS = [
|
|
@@ -516,12 +484,11 @@ function apply(ctx, rawConfig = {}) {
|
|
|
516
484
|
/**
|
|
517
485
|
* This row's write knobs as they stand RIGHT NOW (G1 §8.3) — the base layer of the
|
|
518
486
|
* precedence chain. The ten E3 keys are live references the platform updates in
|
|
519
|
-
* place
|
|
520
|
-
* of `skillContentChars`. Every numeric field is clamped (V6-06).
|
|
487
|
+
* place. Every numeric field is clamped (V6-06).
|
|
521
488
|
* @returns the row layer of the write settings.
|
|
522
489
|
*/
|
|
523
490
|
const rowSettings = () => ({
|
|
524
|
-
skillContentChars: limit("
|
|
491
|
+
skillContentChars: limit("skillContentChars", unwrapLive(rawConfig.skillContentChars), DEFAULT_SKILL_LIMITS.maxSkillContentChars),
|
|
525
492
|
maxSkillFileBytes: limit("maxSkillFileBytes", rawConfig.maxSkillFileBytes, DEFAULT_SKILL_LIMITS.maxSkillFileBytes),
|
|
526
493
|
maxSkillNameLength: limit("maxSkillNameLength", rawConfig.maxSkillNameLength, DEFAULT_SKILL_LIMITS.maxNameLength),
|
|
527
494
|
maxDescriptionLength: limit("maxDescriptionLength", rawConfig.maxDescriptionLength, DEFAULT_SKILL_LIMITS.maxDescriptionLength),
|
|
@@ -529,8 +496,8 @@ function apply(ctx, rawConfig = {}) {
|
|
|
529
496
|
strictCrossSource: liveBool(rawConfig.strictCrossSource),
|
|
530
497
|
citationPolicy: unwrapLive(rawConfig.citationPolicy) ?? DEFAULT_CITATION_POLICY,
|
|
531
498
|
supportFileCharPolicy: unwrapLive(rawConfig.supportFileCharPolicy) ?? DEFAULT_SUPPORT_FILE_CHAR_POLICY,
|
|
532
|
-
skillWriteConfirm: unwrapLive(rawConfig.skillWriteConfirm) ??
|
|
533
|
-
skillWriteConfirmTimeoutSeconds: limit("skillWriteConfirmTimeoutSeconds", rawConfig.skillWriteConfirmTimeoutSeconds,
|
|
499
|
+
skillWriteConfirm: unwrapLive(rawConfig.skillWriteConfirm) ?? DEFAULT_WRITE_CONFIRM_MODE,
|
|
500
|
+
skillWriteConfirmTimeoutSeconds: limit("skillWriteConfirmTimeoutSeconds", rawConfig.skillWriteConfirmTimeoutSeconds, DEFAULT_WRITE_CONFIRM_TIMEOUT_SECONDS)
|
|
534
501
|
});
|
|
535
502
|
/**
|
|
536
503
|
* G3/S3.4 + G1: the USER layer sits above the deployment carriers. `settings()` is
|
|
@@ -690,7 +657,7 @@ function apply(ctx, rawConfig = {}) {
|
|
|
690
657
|
skills: []
|
|
691
658
|
};
|
|
692
659
|
}
|
|
693
|
-
const refusal = await
|
|
660
|
+
const refusal = await runWriteGates(skillWriteGateContext({
|
|
694
661
|
policy: ctx.get("evolutionPolicy"),
|
|
695
662
|
confirm: void 0,
|
|
696
663
|
readNames: void 0,
|
|
@@ -1043,7 +1010,7 @@ function apply(ctx, rawConfig = {}) {
|
|
|
1043
1010
|
};
|
|
1044
1011
|
crossSourceView = gate.view;
|
|
1045
1012
|
}
|
|
1046
|
-
const refusal = await
|
|
1013
|
+
const refusal = await runWriteGates({
|
|
1047
1014
|
point: "admission",
|
|
1048
1015
|
args,
|
|
1049
1016
|
origin: libraryOrigin,
|
package/lib/types/index.d.ts
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
import type { Context, Volatile } from '@deepseek-ai/cordis';
|
|
21
21
|
import z from '@deepseek-ai/schemastery';
|
|
22
22
|
import type { CitationPolicy, SupportFileCharPolicy } from '@lmzhen/dsh-evolution-core';
|
|
23
|
-
import { type WriteConfirmMode } from '
|
|
23
|
+
import { type WriteConfirmMode } from '@lmzhen/dsh-evolution-core';
|
|
24
24
|
export declare const name = "tool-skill-manage";
|
|
25
25
|
export declare const inject: string[];
|
|
26
26
|
export interface Config {
|
|
@@ -29,9 +29,9 @@ export interface Config {
|
|
|
29
29
|
maxSkillNameLength?: Volatile<number>;
|
|
30
30
|
maxDescriptionLength?: Volatile<number>;
|
|
31
31
|
/** Read cap for SKILL.md writes — the CANONICAL registry id (G1) and a LIVE row
|
|
32
|
-
* field; the
|
|
33
|
-
* the alias carries it, and a default on the
|
|
34
|
-
* the alias unreachable. */
|
|
32
|
+
* field; G0/S0.3: the removed live-row alias `maxSkillContentChars` is migration
|
|
33
|
+
* input only. No schema default: the alias carries it, and a default on the
|
|
34
|
+
* canonical key would fill it and make the alias unreachable. */
|
|
35
35
|
skillContentChars?: Volatile<number | undefined>;
|
|
36
36
|
/** Refuse a move that would leave a dangling reference, or verify it — the
|
|
37
37
|
* CANONICAL registry id (G1). The user layer sits above the policy stages,
|
|
@@ -40,10 +40,6 @@ export interface Config {
|
|
|
40
40
|
/** Warn about an oversize support file, or refuse the write — the CANONICAL
|
|
41
41
|
* registry id (G1). */
|
|
42
42
|
supportFileCharPolicy?: Volatile<SupportFileCharPolicy | undefined>;
|
|
43
|
-
/** Deprecated alias of `skillContentChars` (G0/S0.3): still readable, refused
|
|
44
|
-
* by writes; removal was planned for 0.7.0 and is deferred (the alias still
|
|
45
|
-
* ships — see the package README). */
|
|
46
|
-
maxSkillContentChars?: number;
|
|
47
43
|
maxSkillFileBytes?: Volatile<number>;
|
|
48
44
|
/** When true, create/update refuse a description over the 60-char authoring bar (default: advisory feedback only). */
|
|
49
45
|
descriptionStrict?: Volatile<boolean>;
|
|
@@ -74,7 +70,6 @@ export declare const Config: z<Schemastery.ObjectS<NoInfer<{
|
|
|
74
70
|
skillContentChars: z<number, number, "volatile">;
|
|
75
71
|
citationPolicy: z<"verify" | "refuse", "verify" | "refuse", "volatile">;
|
|
76
72
|
supportFileCharPolicy: z<"report" | "enforce", "report" | "enforce", "volatile">;
|
|
77
|
-
maxSkillContentChars: z<number, number, "defined">;
|
|
78
73
|
maxSkillFileBytes: z<number, number, "volatile-defined">;
|
|
79
74
|
descriptionStrict: z<boolean, boolean, "volatile-defined">;
|
|
80
75
|
threatExemptLabels: z<string[], string[], "defined">;
|
|
@@ -89,7 +84,6 @@ export declare const Config: z<Schemastery.ObjectS<NoInfer<{
|
|
|
89
84
|
skillContentChars: z<number, number, "volatile">;
|
|
90
85
|
citationPolicy: z<"verify" | "refuse", "verify" | "refuse", "volatile">;
|
|
91
86
|
supportFileCharPolicy: z<"report" | "enforce", "report" | "enforce", "volatile">;
|
|
92
|
-
maxSkillContentChars: z<number, number, "defined">;
|
|
93
87
|
maxSkillFileBytes: z<number, number, "volatile-defined">;
|
|
94
88
|
descriptionStrict: z<boolean, boolean, "volatile-defined">;
|
|
95
89
|
threatExemptLabels: z<string[], string[], "defined">;
|
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.48.0",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -29,23 +29,23 @@
|
|
|
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.48.0",
|
|
33
|
+
"@lmzhen/dsh-evolution-core": "^0.48.0",
|
|
34
|
+
"@lmzhen/dsh-evolution-skill-discovery": "^0.48.0"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"@deepseek-ai/cordis": "^4.0.5",
|
|
38
38
|
"@deepseek-ai/dsh-skill": "^0.2.2-rc.0",
|
|
39
39
|
"@deepseek-ai/dsh-system-prompt": "^0.2.2-rc.0",
|
|
40
40
|
"@deepseek-ai/dsh-agent": "^0.2.2-rc.0",
|
|
41
|
-
"@lmzhen/dsh-evolution-skill-discovery": "^0.
|
|
41
|
+
"@lmzhen/dsh-evolution-skill-discovery": "^0.48.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@deepseek-ai/dsh-agent-loop-testkit": "^0.2.2-rc.0",
|
|
45
45
|
"@deepseek-ai/dsh-skill": "^0.2.2-rc.0",
|
|
46
46
|
"@deepseek-ai/dsh-system-prompt": "^0.2.2-rc.0",
|
|
47
|
-
"@lmzhen/dsh-evolution-core": "^0.
|
|
48
|
-
"@lmzhen/dsh-evolution-skill-discovery": "^0.
|
|
47
|
+
"@lmzhen/dsh-evolution-core": "^0.48.0",
|
|
48
|
+
"@lmzhen/dsh-evolution-skill-discovery": "^0.48.0"
|
|
49
49
|
},
|
|
50
50
|
"engines": {
|
|
51
51
|
"dsh": ">=0.2.2-rc.0 <0.2.3-0"
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* G1/1.2: the write-admission sequence moved to its nouns' home.
|
|
3
|
-
*
|
|
4
|
-
* The gate table used to be package-private to this tool, so every other write entry point - the graph
|
|
5
|
-
* commands above all - either bypassed it or copied its semantics (audit: approval mirrors the confirm
|
|
6
|
-
* vocabulary "mirrored, not imported"). It now lives in evolution-core next to `write-authority.ts`, and
|
|
7
|
-
* this file re-exports it unchanged so nothing importing from here has to move.
|
|
8
|
-
*
|
|
9
|
-
* @module @lmzhen/dsh-tool-skill-manage/write-gates
|
|
10
|
-
*/
|
|
11
|
-
export * from '@lmzhen/dsh-evolution-core';
|
|
12
|
-
//# sourceMappingURL=write-gates.d.ts.map
|