@zerowall/dsh-plugin-skills 0.1.0-preview.4 → 0.1.0-preview.5

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
@@ -12,8 +12,8 @@
12
12
  en: 21744e6415a744df
13
13
  zh: 054ba34c61b48ecd
14
14
  /zerowall-dsh-plugin-skills/sources-and-state:
15
- en: 452d9902dc4e35f0
16
- zh: ff03b7f8e55b3c8b
15
+ en: 337af80caaa23ebf
16
+ zh: 6bbd33e85d5344fc
17
17
  /zerowall-dsh-plugin-skills/limits:
18
18
  en: ae5577470ed2d396
19
19
  zh: 8c498bd4e294a958
package/README.md CHANGED
@@ -15,7 +15,7 @@ Folder, ZIP, Markdown and public GitHub imports require a preview. GitHub source
15
15
 
16
16
  ## Sources and state
17
17
 
18
- Plugin-owned instructions appear in the owning plugin's Usage instructions section. Its switch controls model instructions independently of plugin activation. Bundled entries declare `metadata.ownerPackage`; `providerOwners` maps official providers without modifying official packages. Project and user overrides remain in Skills according to their actual source. The registry still supplies enabled instructions to the Skill tool, PPT lazy tools and Claude projection. `resources/plugin-instructions.json` records the retired duplicate help copies; active guidance and third-party notices remain with their owners.
18
+ Plugin-owned instructions appear in the owning plugin's Usage instructions section. Its switch controls model instructions independently of plugin activation. Bundled entries declare `metadata.ownerPackage`; `providerOwners` maps official providers without modifying official packages. Owners without a bundle page receive a package-named detail entry, generated from the registry; bundle pages are not duplicated. Entries refresh after plugin management changes and are released with their client scope. Project and user overrides remain in Skills according to their actual source. The registry still supplies enabled instructions to the Skill tool, PPT lazy tools and Claude projection. `resources/plugin-instructions.json` records the retired duplicate help copies; active guidance and third-party notices remain with their owners.
19
19
 
20
20
  The shared registry supplies plugin, project and user sources, winner selection and enablement. Disabled and shadowed entries remain visible. Standard DSH consumers and Claude use the same policies. Plugin-owned instructions remain with their owning plugin; the curated package provides no duplicate navigation Skill.
21
21
 
package/README.zh.md CHANGED
@@ -15,7 +15,7 @@ description: "通过 DSH 共享注册表管理整理后的科研工作流与导
15
15
 
16
16
  ## 来源与状态
17
17
 
18
- 插件说明显示在所属插件详情的“使用说明”中,开关仅控制向模型提供的说明,与插件启停独立。内置条目通过 `metadata.ownerPackage` 声明归属,`providerOwners` 映射官方 provider,无需修改官方包。项目和用户覆盖项仍按实际来源显示在 Skills 中。注册表继续向 Skill 工具、PPT 按需工具和 Claude 投影提供已启用的说明。`resources/plugin-instructions.json` 记录已整理的重复副本,活动说明与第三方声明由所属包维护。
18
+ 插件说明显示在所属插件详情的“使用说明”中,开关仅控制向模型提供的说明,与插件启停独立。内置条目通过 `metadata.ownerPackage` 声明归属,`providerOwners` 映射官方 provider,无需修改官方包。没有组合包页面的所属包,会根据注册表生成以包名标识的详情入口;已有组合包页面不会重复显示。入口随插件管理变更刷新,并随客户端作用域释放。项目和用户覆盖项仍按实际来源显示在 Skills 中。注册表继续向 Skill 工具、PPT 按需工具和 Claude 投影提供已启用的说明。`resources/plugin-instructions.json` 记录已整理的重复副本,活动说明与第三方声明由所属包维护。
19
19
 
20
20
  共享注册表提供插件、项目和用户来源、同名胜出选择及启停策略。停用和被覆盖的条目仍可查看。标准 DSH 和 Claude 消费方采用相同策略。插件使用说明由所属插件提供,整理包不提供重复的导航 Skill。
21
21
 
package/lib/client.js CHANGED
@@ -345,6 +345,36 @@ function createSkillsViewStore() {
345
345
  });
346
346
  }
347
347
 
348
+ // src/client/instruction-pages.ts
349
+ function createInstructionPages(options) {
350
+ const pages = /* @__PURE__ */ new Map();
351
+ let disposed = false;
352
+ let pending = Promise.resolve();
353
+ return {
354
+ refresh() {
355
+ pending = pending.then(async () => {
356
+ if (disposed) return;
357
+ const inventory = await options.load();
358
+ if (disposed) return;
359
+ const bundles = new Set(inventory.packages);
360
+ const owners = new Set(inventory.entries.flatMap((entry) => entry.kind === "plugin-instructions" && entry.ownerPackage && !bundles.has(entry.ownerPackage) ? [entry.ownerPackage] : []));
361
+ for (const [owner, dispose] of pages) if (!owners.has(owner)) {
362
+ dispose();
363
+ pages.delete(owner);
364
+ }
365
+ for (const owner of owners) if (!pages.has(owner)) pages.set(owner, options.register(owner));
366
+ }).catch(options.failed);
367
+ return pending;
368
+ },
369
+ async dispose() {
370
+ disposed = true;
371
+ await pending;
372
+ for (const dispose of pages.values()) dispose();
373
+ pages.clear();
374
+ }
375
+ };
376
+ }
377
+
348
378
  // src/client/index.ts
349
379
  var inject = ["slots", "locale", "uiWorkspace", "remote.zerowallSkills"];
350
380
  function apply(ctx) {
@@ -360,6 +390,28 @@ function apply(ctx) {
360
390
  ctx.slots.inject("settings.section", () => ctx.slots.register({ name: "settings.section", id: "zerowall-skills", order: 35, label: () => ctx.locale.bind(NS)("title"), locale: NS, store, inject: configuration }, SkillsPanel));
361
391
  ctx.slots.inject("plugins.bundle.config", () => ctx.slots.register({ name: "plugins.bundle.config", key: "@zerowall/dsh-plugin-skills", locale: NS, store, inject: configuration }, SkillsPanel));
362
392
  ctx.slots.inject("plugins.detail.section", () => ctx.slots.register({ name: "plugins.detail.section", id: "zerowall-plugin-instructions", locale: NS, store, inject: configuration }, PluginInstructionsPanel));
393
+ ctx.inject(["remote", "remote.pluginManager"], (scope) => {
394
+ scope.slots.inject("plugins.item", () => {
395
+ const pages = createInstructionPages({
396
+ load: async () => {
397
+ const [skills, bundles] = await Promise.all([request({ action: "list" }), scope.remote.pluginManager.listBundles()]);
398
+ if (!bundles.ok) throw new Error(bundles.error.message);
399
+ return { entries: skills.entries ?? [], packages: bundles.value.map((bundle) => bundle.name) };
400
+ },
401
+ register: (ownerPackage) => scope.effect(() => scope.slots.register({ name: "plugins.item", id: ownerPackage, order: 70, label: () => ownerPackage }, ({ view }) => view === "summary" ? scope.locale.bind(NS)("pluginDescription") : null)),
402
+ failed: (error51) => scope.logger.warn(`Plugin instruction pages could not refresh: ${String(error51)}`)
403
+ });
404
+ const refresh = () => {
405
+ void pages.refresh();
406
+ };
407
+ refresh();
408
+ const unsubscribe = scope.remote.$on("plugin-manager/changed", refresh);
409
+ return async () => {
410
+ unsubscribe();
411
+ await pages.dispose();
412
+ };
413
+ });
414
+ });
363
415
  ctx.slots.inject("shell.overlay", () => ctx.slots.register({ name: "shell.overlay", id: "zerowall-skills-feedback", locale: NS, store }, SkillsFeedback));
364
416
  }
365
417
 
@@ -0,0 +1,20 @@
1
+ /** Keep instructions reachable for providers whose packages have no bundle detail page. */
2
+ import type { ManagedSkill } from '../shared/types.js';
3
+ interface InstructionPagesOptions {
4
+ load(): Promise<{
5
+ entries: readonly ManagedSkill[];
6
+ packages: readonly string[];
7
+ }>;
8
+ register(ownerPackage: string): () => void;
9
+ failed(error: unknown): void;
10
+ }
11
+ /**
12
+ * Reconcile package-owned instruction pages and release all contributions on teardown.
13
+ * @param options - Inventory reader, page registration and error reporting owned by the client scope.
14
+ * @returns Serialized refresh and teardown operations; failed reads retain current pages.
15
+ */
16
+ export declare function createInstructionPages(options: InstructionPagesOptions): {
17
+ refresh(): Promise<void>;
18
+ dispose(): Promise<void>;
19
+ };
20
+ export {};
package/package.json CHANGED
@@ -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-preview.5",
4
4
  "description": "Curated scientific skills, imports and shared enablement management.",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",