@linkdesk/contracts 0.1.17 → 0.1.18

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/linkdesk.d.ts +7 -0
  2. package/package.json +1 -1
package/linkdesk.d.ts CHANGED
@@ -92,12 +92,19 @@ export interface CommandsAPI {
92
92
  * plugin.json contributes.commands 未声明的命令经 meta 注册后同样可见/可执行。
93
93
  * 真相源分工:壳 CommandRegistry = 显示真相源(title/category/when 唯一权威),
94
94
  * 池 = 执行真相源(handler 唯一权威,永不跨进程)——meta 只同步显示面。
95
+ * 🔴 **E6#111b:`meta.pluginId` = 注册方显式申报的真身份**(可选,只做加法)。
96
+ * 命令归属解析优先级 = ① plugin.json 声明面 → ② 本字段 → ③ 名字第一段推定。
97
+ * 声明过的命令**不必填**(① 已权威);只有「声明里没有、名字又不带自己前缀」的命令需要它,
98
+ * 否则该命令会被算到名字第一段那个属主头上(借他人前缀 ⇒ 归属错、且异归属顶替拦不住)。
99
+ * 照 `notifications.source` 先例(`ui.ts:26-32`):池是单进程共享 realm,
100
+ * 所有插件共用同一个 `window.linkdesk` ⇒ **无从自动注入,只能作者显式报**。
95
101
  */
96
102
  registerCommand(commandId: string,
97
103
  handler: (...args: any[]) => Promise<unknown> | unknown, meta?: {
98
104
  title?: string;
99
105
  category?: string;
100
106
  when?: string;
107
+ pluginId?: string;
101
108
  }): void;
102
109
  /** 注销插件的池内命令(约定:命令 ID 格式为 "pluginId.commandName")——随视图 unmount 调用 */
103
110
  unregisterCommands(pluginId: string): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@linkdesk/contracts",
3
- "version": "0.1.17",
3
+ "version": "0.1.18",
4
4
  "description": "LinkDesk 插件契约类型——window.linkdesk.* 全量类型定义(E5.8 契约生成产物)。第三方插件作者唯一合法类型消费路径。",
5
5
  "type": "module",
6
6
  "types": "./linkdesk.d.ts",