@zerowall/dsh-plugin-skills 0.1.0-preview.6 → 0.1.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/README.i18n.yaml CHANGED
@@ -9,8 +9,8 @@
9
9
  en: 7fd0b049ff244d0a
10
10
  zh: 16c9b16c4eb549d3
11
11
  /zerowall-dsh-plugin-skills/use:
12
- en: 21744e6415a744df
13
- zh: 054ba34c61b48ecd
12
+ en: a3ca8eb65e309295
13
+ zh: 2af9eb755844c49a
14
14
  /zerowall-dsh-plugin-skills/sources-and-state:
15
15
  en: 337af80caaa23ebf
16
16
  zh: 6bbd33e85d5344fc
package/README.md CHANGED
@@ -9,9 +9,9 @@ English | [中文](README.zh.md)
9
9
 
10
10
  ## Use
11
11
 
12
- Open Skills in Settings or this plugin's configuration page. Twelve independent core workflows are enabled initially. Other topics are disabled; enable one skill or a complete topic for all workspaces or a selected workspace. Management initially targets a selected workspace; choose its directory or explicitly switch to all workspaces before changing enablement or importing. Optional Python dependencies must become usable before enablement is committed. Instruction loading resolves existing dependency environments without installing packages.
12
+ Open Skills in Settings or this plugin's configuration page. Twelve independent core workflows are enabled initially. Other model-invocable bundled workflows are available on demand: `skills_manage` searches by task, activates a matching workflow for the current conversation workspace, and lets the Skill tool load its instructions. Activation is temporary and limited to that workspace. The switch defaults to all workspaces; users can enable or disable an individual skill or topic globally or for a selected workspace. A manual disable takes precedence over automatic activation. Optional Python dependencies must become usable before enablement or activation succeeds. Instruction loading resolves existing dependency environments without installing packages.
13
13
 
14
- Folder, ZIP, Markdown and public GitHub imports require a preview. GitHub sources are pinned to the resolved commit. Name conflicts require an explicit replacement choice. Imported instructions stay disabled until enabled, and retain their `disable-model-invocation` and `user-invocable` frontmatter controls. Scripts and installers never run during preview or import. Removal unregisters an import and preserves its files and backup metadata.
14
+ Folder, ZIP, Markdown and public GitHub imports require a preview. GitHub sources are pinned to the resolved commit. Name conflicts require an explicit replacement choice. Imported instructions stay disabled until enabled, and retain their `disable-model-invocation` and `user-invocable` frontmatter controls. Only model-invocable bundled workflows can activate automatically; manual-only and user-imported skills require explicit enablement. Scripts and installers never run during preview or import. Removal unregisters an import and preserves its files and backup metadata.
15
15
 
16
16
  ## Sources and state
17
17
 
package/README.zh.md CHANGED
@@ -9,9 +9,9 @@ description: "通过 DSH 共享注册表管理整理后的科研工作流与导
9
9
 
10
10
  ## 使用
11
11
 
12
- 在设置中的 Skills 或本插件配置页打开管理器。初始启用 12 个独立核心工作流,其余专题停用;可为全部项目或所选项目启用单个 Skill 或整个专题。管理操作初始针对所选项目;更改启停状态或导入前,须选择项目目录或明确切换为所有项目。可选 Python 依赖准备成功后才提交启用状态。加载指令只解析已有依赖环境,不安装包。
12
+ 在设置中的 Skills 或本插件配置页打开管理器。初始启用 12 个独立核心工作流。其他允许模型调用的内置工作流可按需使用:`skills_manage` 根据任务搜索,在当前会话工作区临时启用匹配工作流,再由 Skill 工具读取完整指令。临时启用只作用于当前工作区。开关默认管理所有工作区;用户也可以为单个 Skill 或专题设置全局状态或所选工作区状态。手工关闭优先于自动启用。可选 Python 依赖准备成功后才能启用或按需调用。加载指令只解析已有依赖环境,不安装包。
13
13
 
14
- 文件夹、ZIP、Markdown 和公开 GitHub 来源均先预览。GitHub 来源固定到解析出的提交,同名冲突须明确选择替换。导入项保持停用,直到用户开启,并保留 frontmatter 中的 `disable-model-invocation` 与 `user-invocable` 调用控制。预览和导入期间不会运行脚本或安装器。移除导入项时取消注册,同时保留文件和备份元数据。
14
+ 文件夹、ZIP、Markdown 和公开 GitHub 来源均先预览。GitHub 来源固定到解析出的提交,同名冲突须明确选择替换。导入项保持停用,直到用户开启,并保留 frontmatter 中的 `disable-model-invocation` 与 `user-invocable` 调用控制。只有允许模型调用的内置工作流支持自动启用;仅手工调用的指令和用户导入项仍需手动开启。预览和导入期间不会运行脚本或安装器。移除导入项时取消注册,同时保留文件和备份元数据。
15
15
 
16
16
  ## 来源与状态
17
17
 
package/lib/client.js CHANGED
@@ -63,20 +63,21 @@ function SkillsPanel({ request, pickDirectory, t, actions, view, ownerPackage })
63
63
  const [query, setQuery] = (0, import_react.useState)("");
64
64
  const [source, setSource] = (0, import_react.useState)("");
65
65
  const [cwd, setCwd] = (0, import_react.useState)();
66
- const [scope, setScope] = (0, import_react.useState)(ownerPackage ? "global" : "workspace");
66
+ const [scope, setScope] = (0, import_react.useState)("global");
67
+ const selectedCwd = scope === "workspace" ? cwd : void 0;
67
68
  const [preview, setPreview] = (0, import_react.useState)();
68
69
  const [replace, setReplace] = (0, import_react.useState)(false);
69
70
  const [content, setContent] = (0, import_react.useState)();
70
71
  const [busy, setBusy] = (0, import_react.useState)(false);
71
72
  const [failure, setFailure] = (0, import_react.useState)("");
72
73
  const reload = (0, import_react.useCallback)(async () => {
73
- const response = await request({ action: "list", ...cwd ? { cwd } : {} });
74
+ const response = await request({ action: "list", ...selectedCwd ? { cwd: selectedCwd } : {} });
74
75
  setEntries(response.entries ?? []);
75
76
  setComplete(response.complete !== false);
76
- }, [request, cwd]);
77
+ }, [request, selectedCwd]);
77
78
  (0, import_react.useEffect)(() => {
78
79
  let current = true;
79
- void request({ action: "list", ...cwd ? { cwd } : {} }).then((response) => {
80
+ void request({ action: "list", ...selectedCwd ? { cwd: selectedCwd } : {} }).then((response) => {
80
81
  if (current) {
81
82
  setEntries(response.entries ?? []);
82
83
  setComplete(response.complete !== false);
@@ -88,12 +89,12 @@ function SkillsPanel({ request, pickDirectory, t, actions, view, ownerPackage })
88
89
  return () => {
89
90
  current = false;
90
91
  };
91
- }, [request, cwd]);
92
+ }, [request, selectedCwd]);
92
93
  async function operate(input) {
93
94
  setBusy(true);
94
95
  setFailure("");
95
96
  try {
96
- const response = await request({ ...input, ...cwd ? { cwd } : {}, scope });
97
+ const response = await request({ ...input, ...selectedCwd ? { cwd: selectedCwd } : {}, scope });
97
98
  if (response.preview) {
98
99
  setPreview(response.preview);
99
100
  setReplace(false);
@@ -169,7 +170,7 @@ function SkillsPanel({ request, pickDirectory, t, actions, view, ownerPackage })
169
170
  !visible.length && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: t("empty") }),
170
171
  topics.map((topic) => {
171
172
  const rows = visible.filter((row) => row.topic === topic);
172
- const enabled = rows.some((row) => row.enabled);
173
+ const enabled = rows.some((row) => row.enabled || row.onDemand);
173
174
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("details", { className: panel_default.group, open: topic === "core", children: [
174
175
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("summary", { children: [
175
176
  topicKeys.has(topic) ? t(topic) : topic,
@@ -191,7 +192,7 @@ function SkillsPanel({ request, pickDirectory, t, actions, view, ownerPackage })
191
192
  " \xB7 ",
192
193
  row.source,
193
194
  " \xB7 ",
194
- t(!row.effective ? "shadowed" : row.enabled ? "enabled" : "disabled")
195
+ t(!row.effective ? "shadowed" : row.onDemand ? "onDemand" : row.enabled ? "enabled" : "disabled")
195
196
  ] }),
196
197
  row.requirements.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("details", { children: [
197
198
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("summary", { children: [
@@ -208,7 +209,7 @@ function SkillsPanel({ request, pickDirectory, t, actions, view, ownerPackage })
208
209
  row.license
209
210
  ] })
210
211
  ] }),
211
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.Switch, { label: `${t(ownerPackage ? "enableInstructions" : "enable")}: ${row.name}`, checked: row.enabled, disabled: busy || !row.effective || scope === "workspace" && !cwd, onChange: (enabled2) => {
212
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.Switch, { label: `${t(ownerPackage ? "enableInstructions" : "enable")}: ${row.name}`, checked: row.enabled || row.onDemand === true, disabled: busy || !row.effective || scope === "workspace" && !cwd, onChange: (enabled2) => {
212
213
  void operate({ action: "set-enabled", name: row.name, enabled: enabled2 });
213
214
  } }),
214
215
  row.removable && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.Button, { disabled: busy, onClick: () => {
@@ -236,7 +237,8 @@ function PluginInstructionsPanel({ subject, ...props }) {
236
237
  var NS = "zerowall.skills";
237
238
  var en = {
238
239
  title: "Skills",
239
- description: "Core workflows are enabled by default. Optional topics load only when enabled. Plugin instructions stay with their owning plugin.",
240
+ description: "Core workflows are ready. Optional workflows activate when a task needs them. Switches control availability for all workspaces by default; manually disabled skills stay off.",
241
+ onDemand: "On demand",
240
242
  pluginDescription: "These instructions help the model use this plugin. Their switch controls instructions, not plugin activation.",
241
243
  enableInstructions: "Provide instructions to the model",
242
244
  search: "Search skills",
@@ -283,7 +285,8 @@ var en = {
283
285
  };
284
286
  var zh = {
285
287
  title: "Skills \u7BA1\u7406",
286
- description: "\u6838\u5FC3\u5DE5\u4F5C\u6D41\u9ED8\u8BA4\u542F\u7528\uFF0C\u4E13\u9898\u6309\u9700\u5F00\u542F\uFF1B\u63D2\u4EF6\u63D0\u4F9B\u7684\u4F7F\u7528\u8BF4\u660E\u968F\u63D2\u4EF6\u7BA1\u7406",
288
+ description: "\u6838\u5FC3\u5DE5\u4F5C\u6D41\u76F4\u63A5\u53EF\u7528\uFF0C\u4E13\u9898\u7531\u6A21\u578B\u5728\u4EFB\u52A1\u9700\u8981\u65F6\u6309\u9700\u542F\u7528\uFF1B\u5F00\u5173\u9ED8\u8BA4\u4F5C\u7528\u4E8E\u6240\u6709\u9879\u76EE\uFF0C\u624B\u5DE5\u505C\u7528\u540E\u4E0D\u4F1A\u81EA\u52A8\u5F00\u542F",
289
+ onDemand: "\u6309\u9700\u52A0\u8F7D",
287
290
  pluginDescription: "\u8FD9\u4E9B\u8BF4\u660E\u5E2E\u52A9\u6A21\u578B\u4F7F\u7528\u672C\u63D2\u4EF6\uFF1B\u5F00\u5173\u4EC5\u63A7\u5236\u8BF4\u660E\u662F\u5426\u63D0\u4F9B\u7ED9\u6A21\u578B\uFF0C\u4E0D\u63A7\u5236\u63D2\u4EF6\u542F\u505C",
288
291
  enableInstructions: "\u5411\u6A21\u578B\u63D0\u4F9B\u4F7F\u7528\u8BF4\u660E",
289
292
  search: "\u641C\u7D22 Skill",
@@ -15079,7 +15082,7 @@ var ResultValue = class {
15079
15082
  // lib/typert.remote-client.js
15080
15083
  var _zerowall_dsh_plugin_skills_zerowallSkills_request_parameter_0$schema$value;
15081
15084
  var _zerowall_dsh_plugin_skills_zerowallSkills_request_parameter_0$schema = () => _zerowall_dsh_plugin_skills_zerowallSkills_request_parameter_0$schema$value ??= external_exports.object({
15082
- "action": external_exports.union([external_exports.literal("list"), external_exports.literal("detail"), external_exports.literal("set-enabled"), external_exports.literal("set-topic"), external_exports.literal("preview"), external_exports.literal("install"), external_exports.literal("remove")]),
15085
+ "action": external_exports.union([external_exports.literal("list"), external_exports.literal("detail"), external_exports.literal("set-enabled"), external_exports.literal("set-topic"), external_exports.literal("preview"), external_exports.literal("install"), external_exports.literal("remove"), external_exports.literal("activate")]),
15083
15086
  "cwd": external_exports.union([external_exports.undefined(), external_exports.string()]).optional(),
15084
15087
  "id": external_exports.union([external_exports.undefined(), external_exports.string()]).optional(),
15085
15088
  "name": external_exports.union([external_exports.undefined(), external_exports.string()]).optional(),
@@ -15101,6 +15104,7 @@ var _zerowall_dsh_plugin_skills_zerowallSkills_request_result$schema = () => _ze
15101
15104
  "ownerPackage": external_exports.union([external_exports.undefined(), external_exports.string()]).optional(),
15102
15105
  "topic": external_exports.string(),
15103
15106
  "enabled": external_exports.boolean(),
15107
+ "onDemand": external_exports.union([external_exports.undefined(), external_exports.literal(false), external_exports.literal(true)]).optional().describe("Optional bundled instructions available for activation when the task needs them."),
15104
15108
  "effective": external_exports.boolean(),
15105
15109
  "removable": external_exports.boolean(),
15106
15110
  "path": external_exports.union([external_exports.undefined(), external_exports.string()]).optional(),
@@ -15125,7 +15129,7 @@ var _zerowall_dsh_plugin_skills_zerowallSkills_request_result$schema = () => _ze
15125
15129
  });
15126
15130
  var _zerowall_dsh_plugin_skills_zerowallSkills_request_parameter_0_strict$schema$value;
15127
15131
  var _zerowall_dsh_plugin_skills_zerowallSkills_request_parameter_0_strict$schema = () => _zerowall_dsh_plugin_skills_zerowallSkills_request_parameter_0_strict$schema$value ??= external_exports.strictObject({
15128
- "action": external_exports.union([external_exports.literal("list"), external_exports.literal("detail"), external_exports.literal("set-enabled"), external_exports.literal("set-topic"), external_exports.literal("preview"), external_exports.literal("install"), external_exports.literal("remove")]),
15132
+ "action": external_exports.union([external_exports.literal("list"), external_exports.literal("detail"), external_exports.literal("set-enabled"), external_exports.literal("set-topic"), external_exports.literal("preview"), external_exports.literal("install"), external_exports.literal("remove"), external_exports.literal("activate")]),
15129
15133
  "cwd": external_exports.union([external_exports.undefined(), external_exports.string()]).optional(),
15130
15134
  "id": external_exports.union([external_exports.undefined(), external_exports.string()]).optional(),
15131
15135
  "name": external_exports.union([external_exports.undefined(), external_exports.string()]).optional(),
@@ -15151,13 +15155,13 @@ var TYPERT_REMOTE = createTypertRemoteInfo({
15151
15155
  mode: "strict",
15152
15156
  typeSymbol: "@zerowall/dsh-plugin-skills/types#SkillsRequest",
15153
15157
  create: _zerowall_dsh_plugin_skills_zerowallSkills_request_parameter_0$schema,
15154
- jsonSchema: { "type": "object", "properties": { "action": { "type": "string", "enum": ["list", "detail", "set-enabled", "set-topic", "preview", "install", "remove"] }, "cwd": { "type": "string" }, "id": { "type": "string" }, "name": { "type": "string" }, "enabled": { "type": "boolean", "enum": [false, true] }, "topic": { "type": "string" }, "source": { "type": "string" }, "scope": { "type": "string", "enum": ["workspace", "global"] }, "replace": { "type": "boolean", "enum": [false, true] } }, "required": ["action"], "additionalProperties": true }
15158
+ jsonSchema: { "type": "object", "properties": { "action": { "type": "string", "enum": ["list", "detail", "set-enabled", "set-topic", "preview", "install", "remove", "activate"] }, "cwd": { "type": "string" }, "id": { "type": "string" }, "name": { "type": "string" }, "enabled": { "type": "boolean", "enum": [false, true] }, "topic": { "type": "string" }, "source": { "type": "string" }, "scope": { "type": "string", "enum": ["workspace", "global"] }, "replace": { "type": "boolean", "enum": [false, true] } }, "required": ["action"], "additionalProperties": true }
15155
15159
  },
15156
15160
  strictCodec: {
15157
15161
  mode: "strict",
15158
15162
  typeSymbol: "@zerowall/dsh-plugin-skills/types#SkillsRequest",
15159
15163
  create: _zerowall_dsh_plugin_skills_zerowallSkills_request_parameter_0_strict$schema,
15160
- jsonSchema: { "type": "object", "properties": { "action": { "type": "string", "enum": ["list", "detail", "set-enabled", "set-topic", "preview", "install", "remove"] }, "cwd": { "type": "string" }, "id": { "type": "string" }, "name": { "type": "string" }, "enabled": { "type": "boolean", "enum": [false, true] }, "topic": { "type": "string" }, "source": { "type": "string" }, "scope": { "type": "string", "enum": ["workspace", "global"] }, "replace": { "type": "boolean", "enum": [false, true] } }, "required": ["action"], "additionalProperties": false }
15164
+ jsonSchema: { "type": "object", "properties": { "action": { "type": "string", "enum": ["list", "detail", "set-enabled", "set-topic", "preview", "install", "remove", "activate"] }, "cwd": { "type": "string" }, "id": { "type": "string" }, "name": { "type": "string" }, "enabled": { "type": "boolean", "enum": [false, true] }, "topic": { "type": "string" }, "source": { "type": "string" }, "scope": { "type": "string", "enum": ["workspace", "global"] }, "replace": { "type": "boolean", "enum": [false, true] } }, "required": ["action"], "additionalProperties": false }
15161
15165
  }
15162
15166
  }
15163
15167
  ],
@@ -15166,9 +15170,9 @@ var TYPERT_REMOTE = createTypertRemoteInfo({
15166
15170
  typeSymbol: "@zerowall/dsh-plugin-skills/types#SkillsResponse",
15167
15171
  create: _zerowall_dsh_plugin_skills_zerowallSkills_request_result$schema,
15168
15172
  description: "committed state or a read-only import preview; imported code is never executed.",
15169
- jsonSchema: { "type": "object", "properties": { "entries": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "description": { "type": "string" }, "source": { "type": "string" }, "provider": { "type": "string" }, "kind": { "type": "string", "enum": ["standalone", "plugin-instructions"] }, "ownerPackage": { "type": "string" }, "topic": { "type": "string" }, "enabled": { "type": "boolean" }, "effective": { "type": "boolean" }, "removable": { "type": "boolean" }, "path": { "type": "string" }, "license": { "type": "string" }, "requirements": { "type": "array", "items": { "type": "string" } } }, "required": ["id", "name", "description", "source", "provider", "kind", "topic", "enabled", "effective", "removable", "requirements"], "additionalProperties": true } }, "complete": { "type": "boolean", "enum": [false, true] }, "content": { "type": "string" }, "preview": { "type": "object", "properties": { "id": { "type": "string" }, "source": { "type": "string" }, "commit": { "type": "string" }, "skills": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "description": { "type": "string" }, "relativePath": { "type": "string" }, "conflict": { "type": "boolean" } }, "required": ["name", "description", "relativePath", "conflict"], "additionalProperties": true } } }, "required": ["id", "source", "skills"], "additionalProperties": true }, "installed": { "type": "array", "items": { "type": "string" } }, "status": { "type": "string" } }, "required": [], "additionalProperties": true }
15173
+ jsonSchema: { "type": "object", "properties": { "entries": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "description": { "type": "string" }, "source": { "type": "string" }, "provider": { "type": "string" }, "kind": { "type": "string", "enum": ["standalone", "plugin-instructions"] }, "ownerPackage": { "type": "string" }, "topic": { "type": "string" }, "enabled": { "type": "boolean" }, "onDemand": { "type": "boolean", "enum": [false, true], "description": "Optional bundled instructions available for activation when the task needs them." }, "effective": { "type": "boolean" }, "removable": { "type": "boolean" }, "path": { "type": "string" }, "license": { "type": "string" }, "requirements": { "type": "array", "items": { "type": "string" } } }, "required": ["id", "name", "description", "source", "provider", "kind", "topic", "enabled", "effective", "removable", "requirements"], "additionalProperties": true } }, "complete": { "type": "boolean", "enum": [false, true] }, "content": { "type": "string" }, "preview": { "type": "object", "properties": { "id": { "type": "string" }, "source": { "type": "string" }, "commit": { "type": "string" }, "skills": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "description": { "type": "string" }, "relativePath": { "type": "string" }, "conflict": { "type": "boolean" } }, "required": ["name", "description", "relativePath", "conflict"], "additionalProperties": true } } }, "required": ["id", "source", "skills"], "additionalProperties": true }, "installed": { "type": "array", "items": { "type": "string" } }, "status": { "type": "string" } }, "required": [], "additionalProperties": true }
15170
15174
  },
15171
- sourceLocation: { "file": "packages/plugin/src/host/index.ts", "line": 155, "column": 9 }
15175
+ sourceLocation: { "file": "packages/plugin/src/host/index.ts", "line": 159, "column": 9 }
15172
15176
  }
15173
15177
  }
15174
15178
  }, external_exports);
package/lib/index.js CHANGED
@@ -52,6 +52,7 @@ import { randomUUID as randomUUID2 } from "node:crypto";
52
52
  import { mkdir as mkdir2, readFile as readFile2, rename as rename2, rm as rm2, writeFile as writeFile2 } from "node:fs/promises";
53
53
  import { dirname as dirname2, join as join2, resolve as resolve2 } from "node:path";
54
54
  import { fileURLToPath } from "node:url";
55
+ import { defineTool } from "@deepseek-ai/dsh-tools";
55
56
  import { resolveDshHome } from "@deepseek-ai/dsh-home-paths";
56
57
  import { Remote, TypertRemoteService } from "@deepseek-ai/dsh-typert-protocol";
57
58
  import { BUNDLED_SKILL_RANK } from "@deepseek-ai/dsh-skill";
@@ -217,8 +218,8 @@ async function publishImport(prepared, destination) {
217
218
  // src/host/index.ts
218
219
  var name = "zerowall-skills";
219
220
  var inject = ["skills"];
220
- var Config = configSchema.object({ home: configSchema.string(), resources: configSchema.string(), providerOwners: configSchema.dict(configSchema.string()) });
221
- var requestSchema = z.object({ action: z.enum(["list", "detail", "set-enabled", "set-topic", "preview", "install", "remove"]), cwd: z.string().optional(), id: z.string().optional(), name: z.string().optional(), enabled: z.boolean().optional(), topic: z.string().optional(), source: z.string().optional(), scope: z.enum(["workspace", "global"]).optional(), replace: z.boolean().optional() });
221
+ var Config = configSchema.object({ home: configSchema.string(), resources: configSchema.string(), providerOwners: configSchema.dict(configSchema.string()), searchLimit: configSchema.natural().min(1).max(50).default(10) });
222
+ var requestSchema = z.object({ action: z.enum(["list", "detail", "set-enabled", "set-topic", "preview", "install", "remove", "activate"]), cwd: z.string().optional(), id: z.string().optional(), name: z.string().optional(), enabled: z.boolean().optional(), topic: z.string().optional(), source: z.string().optional(), scope: z.enum(["workspace", "global"]).optional(), replace: z.boolean().optional() });
222
223
  var importSchema = z.object({ id: z.string(), name: z.string(), description: z.string(), path: z.string(), root: z.string(), source: z.string(), cwd: z.string().optional(), commit: z.string().optional() });
223
224
  var stateSchema = z.object({ version: z.literal(1), overrides: z.record(z.string(), z.boolean()), workspaceOverrides: z.record(z.string(), z.record(z.string(), z.boolean())), topics: z.array(z.string()), imports: z.array(importSchema) });
224
225
  var _request_dec, _a, _init;
@@ -238,6 +239,7 @@ var SkillsManagement = class extends (_a = TypertRemoteService, _request_dec = [
238
239
  __publicField(this, "queue", Promise.resolve());
239
240
  __publicField(this, "previews", /* @__PURE__ */ new Map());
240
241
  __publicField(this, "disposed", false);
242
+ __publicField(this, "automatic", /* @__PURE__ */ new Map());
241
243
  __publicField(this, "registry");
242
244
  this.providerOwners = config.providerOwners ?? {};
243
245
  this.registry = host.get("skills");
@@ -292,7 +294,7 @@ var SkillsManagement = class extends (_a = TypertRemoteService, _request_dec = [
292
294
  if (global !== void 0) return global;
293
295
  if (candidate.provider !== "zerowall-curated") return true;
294
296
  const curated = this.catalog.find((row) => row.name === candidate.name);
295
- if (curated) return curated.core || this.state.topics.includes(curated.topic);
297
+ if (curated) return curated.core || this.state.topics.includes(curated.topic) || cwd !== void 0 && this.automatic.get(cwd)?.has(candidate.name) === true;
296
298
  return false;
297
299
  }
298
300
  async candidates(options) {
@@ -363,7 +365,10 @@ ${content}` : content;
363
365
  const imported = this.state.imports.find((row) => row.path === entry.skill.path);
364
366
  const curated = entry.skill.provider === "zerowall-curated" ? this.catalog.find((row) => row.name === entry.skill.name) : void 0;
365
367
  const owner = entry.skill.source === "bundled" && !imported && !curated ? typeof entry.metadata?.ownerPackage === "string" ? entry.metadata.ownerPackage : this.providerOwners[entry.skill.provider] : void 0;
366
- return { id: imported?.id ?? `${entry.skill.provider}:${entry.skill.path ?? entry.skill.name}`, name: entry.skill.name, description: entry.skill.description, source: entry.skill.source, provider: entry.skill.provider, kind: owner ? "plugin-instructions" : "standalone", ...owner ? { ownerPackage: owner } : {}, topic: curated?.topic ?? (imported ? "imported" : "plugin"), enabled: entry.enabled, effective: entry.effective, removable: imported !== void 0, ...entry.skill.path ? { path: entry.skill.path } : {}, ...curated ? { license: curated.license } : {}, requirements: curated?.requirements ?? [] };
368
+ const cwd = input.cwd ? resolve2(input.cwd) : void 0;
369
+ const explicit = cwd ? this.state.workspaceOverrides[cwd]?.[entry.skill.name] ?? this.state.overrides[entry.skill.name] : this.state.overrides[entry.skill.name];
370
+ const onDemand = curated !== void 0 && !curated.core && explicit === void 0 && !this.state.topics.includes(curated.topic) && entry.skill.invocation.modelInvocable;
371
+ return { id: imported?.id ?? `${entry.skill.provider}:${entry.skill.path ?? entry.skill.name}`, name: entry.skill.name, description: entry.skill.description, source: entry.skill.source, provider: entry.skill.provider, kind: owner ? "plugin-instructions" : "standalone", ...owner ? { ownerPackage: owner } : {}, topic: curated?.topic ?? (imported ? "imported" : "plugin"), enabled: entry.enabled, onDemand, effective: entry.effective, removable: imported !== void 0, ...entry.skill.path ? { path: entry.skill.path } : {}, ...curated ? { license: curated.license } : {}, requirements: curated?.requirements ?? [] };
367
372
  });
368
373
  if (input.action === "detail") {
369
374
  const item = entries.find((row) => row.id === input.id);
@@ -376,6 +381,23 @@ ${content}` : content;
376
381
  }
377
382
  async mutate(input) {
378
383
  const next = structuredClone(this.state);
384
+ if (input.action === "activate") {
385
+ if (!input.cwd || !input.name) throw new Error("A current workspace and exact skill name are required.");
386
+ const candidate = (await this.registry.inventory({ cwd: input.cwd })).entries.find((entry) => entry.effective && entry.skill.name === input.name);
387
+ if (!candidate?.skill.invocation.modelInvocable) throw new Error("This skill does not permit automatic model invocation.");
388
+ const row = (await this.read({ action: "list", cwd: input.cwd })).entries?.find((entry) => entry.name === input.name && entry.effective);
389
+ if (!row || !row.onDemand && !row.enabled) throw new Error("This skill is disabled. Enable it manually in Skills settings before using it.");
390
+ if (row.enabled) return { status: "already-enabled" };
391
+ const curated = this.catalog.find((entry) => entry.name === input.name);
392
+ if (!curated) throw new Error("Only bundled optional skills support automatic activation.");
393
+ await this.dependencies([curated]);
394
+ const cwd = resolve2(input.cwd);
395
+ const selected = this.automatic.get(cwd) ?? /* @__PURE__ */ new Set();
396
+ selected.add(input.name);
397
+ this.automatic.set(cwd, selected);
398
+ this.policyControl?.invalidate();
399
+ return { status: "activated" };
400
+ }
379
401
  if (input.action === "preview") {
380
402
  if (!input.source?.trim()) throw new Error("Select a skill source.");
381
403
  if (this.previews.size >= 8) throw new Error("Finish or restart the existing import previews before adding more.");
@@ -394,7 +416,10 @@ ${content}` : content;
394
416
  next.workspaceOverrides[cwd] = { ...next.workspaceOverrides[cwd], ...Object.fromEntries(rows.map((row) => [row.name, Boolean(input.enabled)])) };
395
417
  } else {
396
418
  next.topics = input.enabled ? [.../* @__PURE__ */ new Set([...next.topics, input.topic])] : next.topics.filter((topic) => topic !== input.topic);
397
- for (const row of rows) delete next.overrides[row.name];
419
+ for (const row of rows) {
420
+ if (input.enabled) delete next.overrides[row.name];
421
+ else next.overrides[row.name] = false;
422
+ }
398
423
  }
399
424
  } else if (input.action === "set-enabled") {
400
425
  if (!input.name) throw new Error("Choose a skill to enable or disable.");
@@ -445,7 +470,35 @@ __decorateElement(_init, 1, "request", _request_dec, SkillsManagement);
445
470
  __decoratorMetadata(_init, SkillsManagement);
446
471
  __publicField(SkillsManagement, "inject", ["skills"]);
447
472
  function apply(ctx, config) {
473
+ const searchLimit = config.searchLimit ?? 10;
448
474
  ctx.plugin(SkillsManagement, config);
475
+ ctx.inject(["zerowallSkills", "tools", "workingDirectory"], (scope) => {
476
+ scope.effect(() => scope.tools.register(defineTool({
477
+ name: "skills_manage",
478
+ description: "Search optional scientific workflows by task or capability before starting specialized work. Activate a matching on-demand skill for the current workspace, then load its full instructions with the skill tool. Manually disabled skills remain unavailable.",
479
+ parameters: {
480
+ action: { type: "string", enum: ["search", "activate"], required: true },
481
+ query: { type: "string", description: "Capability keywords used to find a workflow." },
482
+ name: { type: "string", description: "Exact skill name to activate after searching." }
483
+ },
484
+ output: { schema: { type: "object", additionalProperties: true }, render: (_args, value) => [{ type: "text", text: JSON.stringify(value) }] },
485
+ async execute(args, exec) {
486
+ if (exec.agent === void 0) throw new Error("Skill discovery requires a conversation workspace.");
487
+ const cwd = await scope.workingDirectory.ensure(exec.agent, exec.signal);
488
+ if (args.action === "activate") return { status: (await scope.zerowallSkills.request({ action: "activate", name: args.name, cwd })).status ?? "activated" };
489
+ const terms = (args.query ?? "").toLowerCase().split(/\s+/u).filter(Boolean);
490
+ const entries = (await scope.zerowallSkills.request({ action: "list", cwd })).entries ?? [];
491
+ const invocable = new Set((await scope.skills.inventory({ cwd })).entries.filter((entry) => entry.effective && entry.skill.invocation.modelInvocable).map((entry) => entry.skill.name));
492
+ return { matches: entries.filter((row) => row.effective && invocable.has(row.name) && (row.enabled || row.onDemand) && terms.every((term) => `${row.name} ${row.description} ${row.topic}`.toLowerCase().includes(term))).slice(0, searchLimit).map((row) => ({
493
+ name: row.name,
494
+ description: row.description,
495
+ topic: row.topic,
496
+ state: row.onDemand && !row.enabled ? "on-demand" : "enabled",
497
+ requirements: row.requirements
498
+ })) };
499
+ }
500
+ })), "zerowall-skills: demand activation tool");
501
+ });
449
502
  }
450
503
  export {
451
504
  Config,
@@ -5,7 +5,7 @@ import { createTypertRemoteInfo } from '@deepseek-ai/dsh-typert-protocol/remote-
5
5
 
6
6
  let _zerowall_dsh_plugin_skills_zerowallSkills_request_parameter_0$schema$value
7
7
  const _zerowall_dsh_plugin_skills_zerowallSkills_request_parameter_0$schema = () => (_zerowall_dsh_plugin_skills_zerowallSkills_request_parameter_0$schema$value ??= z.object({
8
- 'action': z.union([z.literal("list"), z.literal("detail"), z.literal("set-enabled"), z.literal("set-topic"), z.literal("preview"), z.literal("install"), z.literal("remove")]),
8
+ 'action': z.union([z.literal("list"), z.literal("detail"), z.literal("set-enabled"), z.literal("set-topic"), z.literal("preview"), z.literal("install"), z.literal("remove"), z.literal("activate")]),
9
9
  'cwd': z.union([z.undefined(), z.string()]).optional(),
10
10
  'id': z.union([z.undefined(), z.string()]).optional(),
11
11
  'name': z.union([z.undefined(), z.string()]).optional(),
@@ -27,6 +27,7 @@ const _zerowall_dsh_plugin_skills_zerowallSkills_request_result$schema = () => (
27
27
  'ownerPackage': z.union([z.undefined(), z.string()]).optional(),
28
28
  'topic': z.string(),
29
29
  'enabled': z.boolean(),
30
+ 'onDemand': z.union([z.undefined(), z.literal(false), z.literal(true)]).optional().describe('Optional bundled instructions available for activation when the task needs them.'),
30
31
  'effective': z.boolean(),
31
32
  'removable': z.boolean(),
32
33
  'path': z.union([z.undefined(), z.string()]).optional(),
@@ -51,7 +52,7 @@ const _zerowall_dsh_plugin_skills_zerowallSkills_request_result$schema = () => (
51
52
  }))
52
53
  let _zerowall_dsh_plugin_skills_zerowallSkills_request_parameter_0_strict$schema$value
53
54
  const _zerowall_dsh_plugin_skills_zerowallSkills_request_parameter_0_strict$schema = () => (_zerowall_dsh_plugin_skills_zerowallSkills_request_parameter_0_strict$schema$value ??= z.strictObject({
54
- 'action': z.union([z.literal("list"), z.literal("detail"), z.literal("set-enabled"), z.literal("set-topic"), z.literal("preview"), z.literal("install"), z.literal("remove")]),
55
+ 'action': z.union([z.literal("list"), z.literal("detail"), z.literal("set-enabled"), z.literal("set-topic"), z.literal("preview"), z.literal("install"), z.literal("remove"), z.literal("activate")]),
55
56
  'cwd': z.union([z.undefined(), z.string()]).optional(),
56
57
  'id': z.union([z.undefined(), z.string()]).optional(),
57
58
  'name': z.union([z.undefined(), z.string()]).optional(),
@@ -78,13 +79,13 @@ const $remote = createTypertRemoteInfo({
78
79
  mode: 'strict',
79
80
  typeSymbol: '@zerowall/dsh-plugin-skills/types#SkillsRequest',
80
81
  create: _zerowall_dsh_plugin_skills_zerowallSkills_request_parameter_0$schema,
81
- jsonSchema: {"type":"object","properties":{"action":{"type":"string","enum":["list","detail","set-enabled","set-topic","preview","install","remove"]},"cwd":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"enabled":{"type":"boolean","enum":[false,true]},"topic":{"type":"string"},"source":{"type":"string"},"scope":{"type":"string","enum":["workspace","global"]},"replace":{"type":"boolean","enum":[false,true]}},"required":["action"],"additionalProperties":true},
82
+ jsonSchema: {"type":"object","properties":{"action":{"type":"string","enum":["list","detail","set-enabled","set-topic","preview","install","remove","activate"]},"cwd":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"enabled":{"type":"boolean","enum":[false,true]},"topic":{"type":"string"},"source":{"type":"string"},"scope":{"type":"string","enum":["workspace","global"]},"replace":{"type":"boolean","enum":[false,true]}},"required":["action"],"additionalProperties":true},
82
83
  },
83
84
  strictCodec: {
84
85
  mode: 'strict',
85
86
  typeSymbol: '@zerowall/dsh-plugin-skills/types#SkillsRequest',
86
87
  create: _zerowall_dsh_plugin_skills_zerowallSkills_request_parameter_0_strict$schema,
87
- jsonSchema: {"type":"object","properties":{"action":{"type":"string","enum":["list","detail","set-enabled","set-topic","preview","install","remove"]},"cwd":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"enabled":{"type":"boolean","enum":[false,true]},"topic":{"type":"string"},"source":{"type":"string"},"scope":{"type":"string","enum":["workspace","global"]},"replace":{"type":"boolean","enum":[false,true]}},"required":["action"],"additionalProperties":false},
88
+ jsonSchema: {"type":"object","properties":{"action":{"type":"string","enum":["list","detail","set-enabled","set-topic","preview","install","remove","activate"]},"cwd":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"enabled":{"type":"boolean","enum":[false,true]},"topic":{"type":"string"},"source":{"type":"string"},"scope":{"type":"string","enum":["workspace","global"]},"replace":{"type":"boolean","enum":[false,true]}},"required":["action"],"additionalProperties":false},
88
89
  },
89
90
  },
90
91
  ],
@@ -93,9 +94,9 @@ const $remote = createTypertRemoteInfo({
93
94
  typeSymbol: '@zerowall/dsh-plugin-skills/types#SkillsResponse',
94
95
  create: _zerowall_dsh_plugin_skills_zerowallSkills_request_result$schema,
95
96
  description: 'committed state or a read-only import preview; imported code is never executed.',
96
- jsonSchema: {"type":"object","properties":{"entries":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"source":{"type":"string"},"provider":{"type":"string"},"kind":{"type":"string","enum":["standalone","plugin-instructions"]},"ownerPackage":{"type":"string"},"topic":{"type":"string"},"enabled":{"type":"boolean"},"effective":{"type":"boolean"},"removable":{"type":"boolean"},"path":{"type":"string"},"license":{"type":"string"},"requirements":{"type":"array","items":{"type":"string"}}},"required":["id","name","description","source","provider","kind","topic","enabled","effective","removable","requirements"],"additionalProperties":true}},"complete":{"type":"boolean","enum":[false,true]},"content":{"type":"string"},"preview":{"type":"object","properties":{"id":{"type":"string"},"source":{"type":"string"},"commit":{"type":"string"},"skills":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"relativePath":{"type":"string"},"conflict":{"type":"boolean"}},"required":["name","description","relativePath","conflict"],"additionalProperties":true}}},"required":["id","source","skills"],"additionalProperties":true},"installed":{"type":"array","items":{"type":"string"}},"status":{"type":"string"}},"required":[],"additionalProperties":true},
97
+ jsonSchema: {"type":"object","properties":{"entries":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"source":{"type":"string"},"provider":{"type":"string"},"kind":{"type":"string","enum":["standalone","plugin-instructions"]},"ownerPackage":{"type":"string"},"topic":{"type":"string"},"enabled":{"type":"boolean"},"onDemand":{"type":"boolean","enum":[false,true],"description":"Optional bundled instructions available for activation when the task needs them."},"effective":{"type":"boolean"},"removable":{"type":"boolean"},"path":{"type":"string"},"license":{"type":"string"},"requirements":{"type":"array","items":{"type":"string"}}},"required":["id","name","description","source","provider","kind","topic","enabled","effective","removable","requirements"],"additionalProperties":true}},"complete":{"type":"boolean","enum":[false,true]},"content":{"type":"string"},"preview":{"type":"object","properties":{"id":{"type":"string"},"source":{"type":"string"},"commit":{"type":"string"},"skills":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"relativePath":{"type":"string"},"conflict":{"type":"boolean"}},"required":["name","description","relativePath","conflict"],"additionalProperties":true}}},"required":["id","source","skills"],"additionalProperties":true},"installed":{"type":"array","items":{"type":"string"}},"status":{"type":"string"}},"required":[],"additionalProperties":true},
97
98
  },
98
- sourceLocation: {"file":"packages/plugin/src/host/index.ts","line":155,"column":9},
99
+ sourceLocation: {"file":"packages/plugin/src/host/index.ts","line":159,"column":9},
99
100
  },
100
101
  },
101
102
  }, z)
@@ -131,11 +132,11 @@ export const TYPERT = {
131
132
  },
132
133
  {
133
134
  "name": "ManagedSkill",
134
- "declaration": "export interface ManagedSkill {\n id: string;\n name: string;\n description: string;\n source: string;\n provider: string;\n kind: 'standalone' | 'plugin-instructions';\n ownerPackage?: string;\n topic: string;\n enabled: boolean;\n effective: boolean;\n removable: boolean;\n path?: string;\n license?: string;\n requirements: string[];\n}"
135
+ "declaration": "export interface ManagedSkill {\n id: string;\n name: string;\n description: string;\n source: string;\n provider: string;\n kind: 'standalone' | 'plugin-instructions';\n ownerPackage?: string;\n topic: string;\n enabled: boolean;\n onDemand?: boolean;\n effective: boolean;\n removable: boolean;\n path?: string;\n license?: string;\n requirements: string[];\n}"
135
136
  },
136
137
  {
137
138
  "name": "SkillsRequest",
138
- "declaration": "export interface SkillsRequest {\n action: 'list' | 'detail' | 'set-enabled' | 'set-topic' | 'preview' | 'install' | 'remove';\n cwd?: string;\n id?: string;\n name?: string;\n enabled?: boolean;\n topic?: string;\n source?: string;\n scope?: 'workspace' | 'global';\n replace?: boolean;\n}"
139
+ "declaration": "export interface SkillsRequest {\n action: 'list' | 'detail' | 'set-enabled' | 'set-topic' | 'preview' | 'install' | 'remove' | 'activate';\n cwd?: string;\n id?: string;\n name?: string;\n enabled?: boolean;\n topic?: string;\n source?: string;\n scope?: 'workspace' | 'global';\n replace?: boolean;\n}"
139
140
  },
140
141
  {
141
142
  "name": "SkillsResponse",
@@ -1 +1 @@
1
- {"version":3,"file":"typert.remote-client.d.ts","names":["request"],"sources":["../src/host/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;IA0JQA,O;;;IAAAA,wB","ignoreList":[]}
1
+ {"version":3,"file":"typert.remote-client.d.ts","names":["request"],"sources":["../src/host/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;IA8JQA,O;;;IAAAA,wB","ignoreList":[]}
@@ -5,7 +5,7 @@ import { createTypertRemoteInfo } from '@deepseek-ai/dsh-typert-protocol/remote-
5
5
 
6
6
  let _zerowall_dsh_plugin_skills_zerowallSkills_request_parameter_0$schema$value
7
7
  const _zerowall_dsh_plugin_skills_zerowallSkills_request_parameter_0$schema = () => (_zerowall_dsh_plugin_skills_zerowallSkills_request_parameter_0$schema$value ??= z.object({
8
- 'action': z.union([z.literal("list"), z.literal("detail"), z.literal("set-enabled"), z.literal("set-topic"), z.literal("preview"), z.literal("install"), z.literal("remove")]),
8
+ 'action': z.union([z.literal("list"), z.literal("detail"), z.literal("set-enabled"), z.literal("set-topic"), z.literal("preview"), z.literal("install"), z.literal("remove"), z.literal("activate")]),
9
9
  'cwd': z.union([z.undefined(), z.string()]).optional(),
10
10
  'id': z.union([z.undefined(), z.string()]).optional(),
11
11
  'name': z.union([z.undefined(), z.string()]).optional(),
@@ -27,6 +27,7 @@ const _zerowall_dsh_plugin_skills_zerowallSkills_request_result$schema = () => (
27
27
  'ownerPackage': z.union([z.undefined(), z.string()]).optional(),
28
28
  'topic': z.string(),
29
29
  'enabled': z.boolean(),
30
+ 'onDemand': z.union([z.undefined(), z.literal(false), z.literal(true)]).optional().describe('Optional bundled instructions available for activation when the task needs them.'),
30
31
  'effective': z.boolean(),
31
32
  'removable': z.boolean(),
32
33
  'path': z.union([z.undefined(), z.string()]).optional(),
@@ -51,7 +52,7 @@ const _zerowall_dsh_plugin_skills_zerowallSkills_request_result$schema = () => (
51
52
  }))
52
53
  let _zerowall_dsh_plugin_skills_zerowallSkills_request_parameter_0_strict$schema$value
53
54
  const _zerowall_dsh_plugin_skills_zerowallSkills_request_parameter_0_strict$schema = () => (_zerowall_dsh_plugin_skills_zerowallSkills_request_parameter_0_strict$schema$value ??= z.strictObject({
54
- 'action': z.union([z.literal("list"), z.literal("detail"), z.literal("set-enabled"), z.literal("set-topic"), z.literal("preview"), z.literal("install"), z.literal("remove")]),
55
+ 'action': z.union([z.literal("list"), z.literal("detail"), z.literal("set-enabled"), z.literal("set-topic"), z.literal("preview"), z.literal("install"), z.literal("remove"), z.literal("activate")]),
55
56
  'cwd': z.union([z.undefined(), z.string()]).optional(),
56
57
  'id': z.union([z.undefined(), z.string()]).optional(),
57
58
  'name': z.union([z.undefined(), z.string()]).optional(),
@@ -78,13 +79,13 @@ export const TYPERT_REMOTE = createTypertRemoteInfo({
78
79
  mode: 'strict',
79
80
  typeSymbol: '@zerowall/dsh-plugin-skills/types#SkillsRequest',
80
81
  create: _zerowall_dsh_plugin_skills_zerowallSkills_request_parameter_0$schema,
81
- jsonSchema: {"type":"object","properties":{"action":{"type":"string","enum":["list","detail","set-enabled","set-topic","preview","install","remove"]},"cwd":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"enabled":{"type":"boolean","enum":[false,true]},"topic":{"type":"string"},"source":{"type":"string"},"scope":{"type":"string","enum":["workspace","global"]},"replace":{"type":"boolean","enum":[false,true]}},"required":["action"],"additionalProperties":true},
82
+ jsonSchema: {"type":"object","properties":{"action":{"type":"string","enum":["list","detail","set-enabled","set-topic","preview","install","remove","activate"]},"cwd":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"enabled":{"type":"boolean","enum":[false,true]},"topic":{"type":"string"},"source":{"type":"string"},"scope":{"type":"string","enum":["workspace","global"]},"replace":{"type":"boolean","enum":[false,true]}},"required":["action"],"additionalProperties":true},
82
83
  },
83
84
  strictCodec: {
84
85
  mode: 'strict',
85
86
  typeSymbol: '@zerowall/dsh-plugin-skills/types#SkillsRequest',
86
87
  create: _zerowall_dsh_plugin_skills_zerowallSkills_request_parameter_0_strict$schema,
87
- jsonSchema: {"type":"object","properties":{"action":{"type":"string","enum":["list","detail","set-enabled","set-topic","preview","install","remove"]},"cwd":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"enabled":{"type":"boolean","enum":[false,true]},"topic":{"type":"string"},"source":{"type":"string"},"scope":{"type":"string","enum":["workspace","global"]},"replace":{"type":"boolean","enum":[false,true]}},"required":["action"],"additionalProperties":false},
88
+ jsonSchema: {"type":"object","properties":{"action":{"type":"string","enum":["list","detail","set-enabled","set-topic","preview","install","remove","activate"]},"cwd":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"enabled":{"type":"boolean","enum":[false,true]},"topic":{"type":"string"},"source":{"type":"string"},"scope":{"type":"string","enum":["workspace","global"]},"replace":{"type":"boolean","enum":[false,true]}},"required":["action"],"additionalProperties":false},
88
89
  },
89
90
  },
90
91
  ],
@@ -93,9 +94,9 @@ export const TYPERT_REMOTE = createTypertRemoteInfo({
93
94
  typeSymbol: '@zerowall/dsh-plugin-skills/types#SkillsResponse',
94
95
  create: _zerowall_dsh_plugin_skills_zerowallSkills_request_result$schema,
95
96
  description: 'committed state or a read-only import preview; imported code is never executed.',
96
- jsonSchema: {"type":"object","properties":{"entries":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"source":{"type":"string"},"provider":{"type":"string"},"kind":{"type":"string","enum":["standalone","plugin-instructions"]},"ownerPackage":{"type":"string"},"topic":{"type":"string"},"enabled":{"type":"boolean"},"effective":{"type":"boolean"},"removable":{"type":"boolean"},"path":{"type":"string"},"license":{"type":"string"},"requirements":{"type":"array","items":{"type":"string"}}},"required":["id","name","description","source","provider","kind","topic","enabled","effective","removable","requirements"],"additionalProperties":true}},"complete":{"type":"boolean","enum":[false,true]},"content":{"type":"string"},"preview":{"type":"object","properties":{"id":{"type":"string"},"source":{"type":"string"},"commit":{"type":"string"},"skills":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"relativePath":{"type":"string"},"conflict":{"type":"boolean"}},"required":["name","description","relativePath","conflict"],"additionalProperties":true}}},"required":["id","source","skills"],"additionalProperties":true},"installed":{"type":"array","items":{"type":"string"}},"status":{"type":"string"}},"required":[],"additionalProperties":true},
97
+ jsonSchema: {"type":"object","properties":{"entries":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"source":{"type":"string"},"provider":{"type":"string"},"kind":{"type":"string","enum":["standalone","plugin-instructions"]},"ownerPackage":{"type":"string"},"topic":{"type":"string"},"enabled":{"type":"boolean"},"onDemand":{"type":"boolean","enum":[false,true],"description":"Optional bundled instructions available for activation when the task needs them."},"effective":{"type":"boolean"},"removable":{"type":"boolean"},"path":{"type":"string"},"license":{"type":"string"},"requirements":{"type":"array","items":{"type":"string"}}},"required":["id","name","description","source","provider","kind","topic","enabled","effective","removable","requirements"],"additionalProperties":true}},"complete":{"type":"boolean","enum":[false,true]},"content":{"type":"string"},"preview":{"type":"object","properties":{"id":{"type":"string"},"source":{"type":"string"},"commit":{"type":"string"},"skills":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"relativePath":{"type":"string"},"conflict":{"type":"boolean"}},"required":["name","description","relativePath","conflict"],"additionalProperties":true}}},"required":["id","source","skills"],"additionalProperties":true},"installed":{"type":"array","items":{"type":"string"}},"status":{"type":"string"}},"required":[],"additionalProperties":true},
97
98
  },
98
- sourceLocation: {"file":"packages/plugin/src/host/index.ts","line":155,"column":9},
99
+ sourceLocation: {"file":"packages/plugin/src/host/index.ts","line":159,"column":9},
99
100
  },
100
101
  },
101
102
  }, z)
@@ -3,7 +3,8 @@ import type { Translate } from '@deepseek-ai/dsh-client-ui-slots';
3
3
  export declare const NS = "zerowall.skills";
4
4
  export declare const en: {
5
5
  readonly title: "Skills";
6
- readonly description: "Core workflows are enabled by default. Optional topics load only when enabled. Plugin instructions stay with their owning plugin.";
6
+ readonly description: "Core workflows are ready. Optional workflows activate when a task needs them. Switches control availability for all workspaces by default; manually disabled skills stay off.";
7
+ readonly onDemand: "On demand";
7
8
  readonly pluginDescription: "These instructions help the model use this plugin. Their switch controls instructions, not plugin activation.";
8
9
  readonly enableInstructions: "Provide instructions to the model";
9
10
  readonly search: "Search skills";
@@ -9,16 +9,19 @@ export declare const Config: configSchema<Schemastery.ObjectS<NoInfer<{
9
9
  home: configSchema<string, string, "plain">;
10
10
  resources: configSchema<string, string, "plain">;
11
11
  providerOwners: configSchema<import("@deepseek-ai/cosmokit").Dict<string, string>, import("@deepseek-ai/cosmokit").Dict<string, string>, "plain">;
12
+ searchLimit: configSchema<number, number, "defined">;
12
13
  }>>, Schemastery.ObjectT<NoInfer<{
13
14
  home: configSchema<string, string, "plain">;
14
15
  resources: configSchema<string, string, "plain">;
15
16
  providerOwners: configSchema<import("@deepseek-ai/cosmokit").Dict<string, string>, import("@deepseek-ai/cosmokit").Dict<string, string>, "plain">;
17
+ searchLimit: configSchema<number, number, "defined">;
16
18
  }>>, "plain">;
17
19
  /** Configured storage and shipped resource roots; neither depends on an installation directory. */
18
20
  export interface Config {
19
21
  home?: string;
20
22
  resources?: string;
21
23
  providerOwners?: Record<string, string>;
24
+ searchLimit?: number;
22
25
  }
23
26
  declare module '@deepseek-ai/cordis' {
24
27
  interface Context {
@@ -40,6 +43,7 @@ export declare class SkillsManagement extends TypertRemoteService {
40
43
  private queue;
41
44
  private readonly previews;
42
45
  private disposed;
46
+ private readonly automatic;
43
47
  private readonly registry;
44
48
  constructor(host: Context, config: Config);
45
49
  private initialize;
@@ -250,7 +250,7 @@ export declare class SkillRegistry extends Service {
250
250
  * @param create - factory receiving invalidation and disposal controls; call invalidate after policy state changes.
251
251
  * @returns the registration disposer; disposal restores the remaining policies.
252
252
  */
253
- registerEnablementPolicy(create: (control: SkillProviderControl) => SkillEnablementPolicy): () => void;
253
+ registerEnablementPolicy(create: (control: SkillProviderControl) => SkillEnablementPolicy): () => Promise<void>;
254
254
  /**
255
255
  * Inspect all contributions without loading their instruction bodies.
256
256
  * @param options - viewing scope and workspace, with optional discovery cancellation.
@@ -9,6 +9,8 @@ export interface ManagedSkill {
9
9
  ownerPackage?: string;
10
10
  topic: string;
11
11
  enabled: boolean;
12
+ /** Optional bundled instructions available for activation when the task needs them. */
13
+ onDemand?: boolean;
12
14
  effective: boolean;
13
15
  removable: boolean;
14
16
  path?: string;
@@ -40,7 +42,7 @@ export interface ImportPreview {
40
42
  }
41
43
  /** Management operations accept an optional current workspace, never an installation path. */
42
44
  export interface SkillsRequest {
43
- action: 'list' | 'detail' | 'set-enabled' | 'set-topic' | 'preview' | 'install' | 'remove';
45
+ action: 'list' | 'detail' | 'set-enabled' | 'set-topic' | 'preview' | 'install' | 'remove' | 'activate';
44
46
  cwd?: string;
45
47
  id?: string;
46
48
  name?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zerowall/dsh-plugin-skills",
3
- "version": "0.1.0-preview.6",
3
+ "version": "0.1.0",
4
4
  "description": "Curated scientific skills, imports and shared enablement management.",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",
@@ -88,7 +88,6 @@
88
88
  ],
89
89
  "profiles": [
90
90
  "development",
91
- "preview",
92
91
  "stable"
93
92
  ],
94
93
  "migrationVersion": 1,
@@ -104,7 +103,7 @@
104
103
  },
105
104
  "publishConfig": {
106
105
  "access": "public",
107
- "tag": "next",
106
+ "tag": "latest",
108
107
  "registry": "https://registry.npmjs.org/"
109
108
  },
110
109
  "license": "AGPL-3.0-only",
@@ -134,7 +133,8 @@
134
133
  "@deepseek-ai/cordis": "4.1.0",
135
134
  "@deepseek-ai/dsh-typert-protocol": "0.2.2-rc.1",
136
135
  "@deepseek-ai/dsh-home-paths": "0.2.2-rc.1",
137
- "@deepseek-ai/dsh-scope": "0.2.2-rc.1"
136
+ "@deepseek-ai/dsh-scope": "0.2.2-rc.1",
137
+ "@deepseek-ai/dsh-tools": "0.2.2-rc.1"
138
138
  },
139
139
  "devDependencies": {
140
140
  "typescript": "6.0.3",
@@ -193,7 +193,8 @@
193
193
  "@deepseek-ai/schemastery": "3.19.0",
194
194
  "@testing-library/react": "^16.3.3",
195
195
  "jsdom": "29.1.1",
196
- "@deepseek-ai/dsh-util-values": "0.2.2-rc.1"
196
+ "@deepseek-ai/dsh-util-values": "0.2.2-rc.1",
197
+ "@deepseek-ai/dsh-working-directory": "0.2.2-rc.1"
197
198
  },
198
199
  "engines": {
199
200
  "node": ">=24.9.0",
package/plugin-detail.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Skills manager
2
2
 
3
- Browse plugin instructions, curated scientific workflows and user imports in one catalog. Disabled and overridden entries remain visible. Twelve core workflows are enabled initially; other topics can be enabled individually or together.
3
+ Browse plugin instructions, curated scientific workflows and user imports in one catalog. Disabled and overridden entries remain visible. Twelve core workflows are enabled initially; other bundled workflows can activate when a task needs them. Search with `skills_manage`, or use the switch to set global or workspace availability. A manual disable always wins.
4
4
 
5
- Select a workspace before changing its skills, or explicitly choose all workspaces. Folder, ZIP, Markdown and public GitHub imports require a preview; conflicts require a replacement choice. Imports remain disabled until enabled, and importing never runs scripts or installs packages.
5
+ The switch defaults to all workspaces; choose a workspace for a local override. Folder, ZIP, Markdown and public GitHub imports require a preview; conflicts require a replacement choice. Imports remain disabled until enabled, and importing never runs scripts or installs packages. Only model-invocable bundled workflows support automatic activation.
6
6
 
7
7
  Python dependencies are prepared before an optional workflow is enabled. Removal unregisters an import and retains its files and backup metadata. Plugin instructions follow their owning plugin and share the same enablement policy with standard DSH and Claude sessions.
@@ -1,7 +1,7 @@
1
1
  # 技能管理
2
2
 
3
- 在一个目录中查看插件使用说明、整理后的科研工作流与用户导入技能。停用和被同名项覆盖的条目仍可查看。初始启用 12 个核心工作流,其他专题可逐项或整组启用。
3
+ 在一个目录中查看插件使用说明、整理后的科研工作流与用户导入技能。停用和被同名项覆盖的条目仍可查看。初始启用 12 个核心工作流;其他内置工作流可在任务需要时自动启用。用户可通过 `skills_manage` 搜索,也可使用开关设置全局或工作区可用状态。手工关闭始终优先。
4
4
 
5
- 更改项目技能前先选择工作区,也可以明确选择所有项目。文件夹、ZIP、Markdown 和公开 GitHub 来源先预览;同名冲突需要选择是否替换。导入项保持停用,导入期间不会运行脚本或安装软件包。
5
+ 开关默认管理所有工作区;需要局部覆盖时选择具体工作区。文件夹、ZIP、Markdown 和公开 GitHub 来源先预览;同名冲突需要选择是否替换。导入项保持停用,导入期间不会运行脚本或安装软件包。只有允许模型调用的内置工作流支持自动启用。
6
6
 
7
7
  可选工作流启用前会准备需要的 Python 依赖。移除导入项时取消注册,并保留文件与备份信息。插件使用说明随所属插件管理,标准 DSH 和 Claude 会话采用同一启停策略。
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zerowall/dsh-plugin-skills",
3
- "version": "0.1.0-preview.4",
3
+ "version": "0.1.0",
4
4
  "host": "./lib/index.js",
5
5
  "client": "./lib/client.js",
6
6
  "remote": "./lib/typert.remote-client.js",
@@ -23,7 +23,6 @@
23
23
  ],
24
24
  "profiles": [
25
25
  "development",
26
- "preview",
27
26
  "stable"
28
27
  ],
29
28
  "migrationVersion": 1,