@lmzhen/dsh-tool-skill-manage 0.1.0 → 0.2.0-rc.1

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.
Files changed (2) hide show
  1. package/lib/index.js +18 -2
  2. package/package.json +7 -7
package/lib/index.js CHANGED
@@ -93,6 +93,10 @@ function apply(ctx, rawConfig = {}) {
93
93
  else if (action === "delete") result = await library.archive(name, args.absorbed_into ? { absorbedInto: args.absorbed_into } : {});
94
94
  else if (action === "write_file") result = await library.writeSupportFile(name, args.file_path ?? "", args.file_content ?? "", origin);
95
95
  else if (action === "remove_file") result = await library.removeSupportFile(name, args.file_path ?? "", origin);
96
+ else if (action === "restructure") result = await library.restructure(name, (args.restructure ?? []).map((move) => ({
97
+ heading: move.heading ?? "",
98
+ toFile: move.to_file ?? ""
99
+ })), origin);
96
100
  else if (action === "pin") result = await library.setPinned(name, true, origin);
97
101
  else if (action === "unpin") result = await library.setPinned(name, false, origin);
98
102
  else result = {
@@ -136,7 +140,7 @@ function apply(ctx, rawConfig = {}) {
136
140
  }
137
141
  ctx.tools.register(defineTool({
138
142
  name: "skill_manage",
139
- description: "Manage reusable skills. review returns the library review text (state/usage/quality per skill); list returns names only; create/edit take full SKILL.md content; patch applies old_string -> new_string; delete archives to .archive; pin protects a skill from deletion, background review, and the lifecycle (pin/unpin are never allowed from a background review — foreground and delegated subagents may). Protected bundled/hub skills reject any mutation; pinned skills reject deletion and are read-only to the background review.Prefer patching an umbrella over creating narrow skills. Created/edited SKILL.md MUST start with YAML frontmatter (a name/description block), or creation is rejected. " + DSH_AUTHORING_STANDARDS,
143
+ description: "Manage reusable skills. review returns the library review text (state/usage/quality per skill); list returns names only; create/edit take full SKILL.md content; patch applies old_string -> new_string; delete archives to .archive; pin protects a skill from deletion, background review, and the lifecycle (pin/unpin are never allowed from a background review — foreground and delegated subagents may). Protected bundled/hub skills reject any mutation; pinned skills reject deletion and are read-only to the background review.Prefer patching an umbrella over creating narrow skills. restructure moves entire body sections (by their exact \"## heading\" line, via restructure: [{heading, to_file: \"references/<topic>.md\"}]) into a references/ file and replaces each with a pointer line — the skill name and directory never change.Created/edited SKILL.md MUST start with YAML frontmatter (a name/description block), or creation is rejected. " + DSH_AUTHORING_STANDARDS,
140
144
  parameters: {
141
145
  action: {
142
146
  type: "string",
@@ -151,6 +155,7 @@ function apply(ctx, rawConfig = {}) {
151
155
  "delete",
152
156
  "write_file",
153
157
  "remove_file",
158
+ "restructure",
154
159
  "skip",
155
160
  "pin",
156
161
  "unpin"
@@ -163,7 +168,18 @@ function apply(ctx, rawConfig = {}) {
163
168
  replace_all: { type: "boolean" },
164
169
  file_path: { type: "string" },
165
170
  file_content: { type: "string" },
166
- absorbed_into: { type: "string" }
171
+ absorbed_into: { type: "string" },
172
+ restructure: {
173
+ type: "array",
174
+ items: {
175
+ type: "object",
176
+ additionalProperties: false,
177
+ properties: {
178
+ heading: { type: "string" },
179
+ to_file: { type: "string" }
180
+ }
181
+ }
182
+ }
167
183
  },
168
184
  output: {
169
185
  schema: {
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.1.0",
4
+ "version": "0.2.0-rc.1",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -33,21 +33,21 @@
33
33
  "license": "MIT",
34
34
  "dependencies": {
35
35
  "@deepseek-ai/schemastery": "^3.18.1",
36
- "@lmzhen/dsh-evolution-core": "^0.1.0"
36
+ "@lmzhen/dsh-evolution-core": "^0.2.0-rc.1"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "@deepseek-ai/cordis": "^4.0.1",
40
40
  "@deepseek-ai/dsh-invariants": "^0.1.1-rc.2",
41
41
  "@deepseek-ai/dsh-tools": "^0.1.1-rc.2",
42
- "@lmzhen/dsh-evolution-io": "^0.1.0",
43
- "@lmzhen/dsh-skill-usage": "^0.1.0"
42
+ "@lmzhen/dsh-evolution-io": "^0.2.0-rc.1",
43
+ "@lmzhen/dsh-skill-usage": "^0.2.0-rc.1"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@deepseek-ai/dsh-agent-loop-testkit": "^0.1.1-rc.2",
47
47
  "@deepseek-ai/dsh-invariants": "^0.1.1-rc.2",
48
48
  "@deepseek-ai/dsh-tools": "^0.1.1-rc.2",
49
- "@lmzhen/dsh-evolution-core": "^0.1.0",
50
- "@lmzhen/dsh-evolution-io": "^0.1.0",
51
- "@lmzhen/dsh-skill-usage": "^0.1.0"
49
+ "@lmzhen/dsh-evolution-core": "^0.2.0-rc.1",
50
+ "@lmzhen/dsh-evolution-io": "^0.2.0-rc.1",
51
+ "@lmzhen/dsh-skill-usage": "^0.2.0-rc.1"
52
52
  }
53
53
  }