@linkdesk/plugin-sdk 0.1.50 → 0.1.51

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.md CHANGED
@@ -18,7 +18,7 @@ npm install -D @linkdesk/plugin-sdk
18
18
  > 自动生成,**勿手改**——由 `scripts/generate-api-cheatsheet.mjs` 从 `@linkdesk/contracts` 的 `linkdesk.d.ts` 现读产出,
19
19
  > `npm run check` 机械盯漂。完整签名与逐方法说明见 `linkdesk.d.ts` 本体(IDE 里可直接跳转)。
20
20
 
21
- **15 个域接口 → 46 个命名空间 / 244 个方法**,全部经 `window.linkdesk.<命名空间>.<方法>` 调用。 (plus 1 deprecated alias/es `config`, not counted twice)
21
+ **15 个域接口 → 46 个命名空间 / 249 个方法**,全部经 `window.linkdesk.<命名空间>.<方法>` 调用。 (plus 1 deprecated alias/es `config`, not counted twice)
22
22
 
23
23
  | Namespace | Methods | Method | Notes |
24
24
  |:--|:--:|:--|:--|
@@ -28,15 +28,15 @@ npm install -D @linkdesk/plugin-sdk
28
28
  | `theme` | 11 | `getCurrent` `getAvailable` `apply` `listRecipes` `getActive` `getEffectiveTokens` `setRecipe` `setColorway` `resetAppearance` `resetMix` `getBaselineSeeds` | —— |
29
29
  | `language` | 5 | `getCurrent` `getAvailable` `set` `getInitial` `onChange` | —— |
30
30
  | `appearance` | 2 | `importImage` `revealStorage` | E5.8#50.11:外观资产——本地选图拷贝入库(受控来源——用户任选路径不能 file:// 直读) |
31
- | `tabs` | 8 | `create` `openOrFocus` `focus` `close` `focusBySourceId` `updateLabelBySourceId` `closeBySourceId` `onDidChangeActiveTab` | —— |
31
+ | `tabs` | 9 | `create` `openOrFocus` `focus` `close` `focusBySourceId` `updateLabelBySourceId` `closeBySourceId` `onDidChangeActiveTab` `list` | —— |
32
32
  | `keybindings` | 12 | `getKeybindings` `getConflicts` `registerKeybinding` `saveUserKeybindings` `removeKeybindingForCommand` `resetKeybindingToDefault` `findKeybindingForCommand` `setKeybindingCaptureActive` `keyboardEventToKeyString` `onChange` `syncToMainProcess`° `onForwardedEvent`° | —— |
33
- | `notifications` | 1 | `show` | 通知——插件弹通知(E6#72:唯一通知面 = 铃铛宽通知面板,右下窄卡链路已整删),对标 VS Code vscod… |
33
+ | `notifications` | 3 | `show` `list` `subscribe` | 通知——插件弹通知(E6#72:唯一通知面 = 铃铛宽通知面板,右下窄卡链路已整删),对标 VS Code vscod… |
34
34
  | `menu` | 2 | `registerItems` `getItems` | E5#69:菜单——插件声明式读写 |
35
35
  | `contextKey` | 1 | `set` | E5#70:ContextKey——插件 SET 状态供壳 when 子句读 |
36
36
  | `dialog` | 5 | `confirm` `alert` `open` `openFile` `confirmContent` | E5#67:弹窗——确认/提示/文件选择 |
37
37
  | `quickPick` | 1 | `show` | E5.7#63:插件 quickPick 选择器——池内本地桥(零 IPC,QuickPickHost 渲染) |
38
38
  | `quickPickHost` | 6 | `registerHost` `onShow` `select` `highlight` `close` `itemAction` | E5.7#63:QuickPick 宿主渲染桥——池 QuickPickHost 消费(壳 preload 无此面) |
39
- | `dialogHost` | 4 | `onShow` `current` `confirm` `cancel` | E5.7#17:Dialog 哑渲染订阅——池 DialogHost 消费(壳 preload 无此面) |
39
+ | `dialogHost` | 5 | `onShow` `current` `pending` `confirm` `cancel` | E5.7#17:Dialog 哑渲染订阅——池 DialogHost 消费(壳 preload 无此面) |
40
40
  | `floatingPanelHost` | 2 | `onShow` `action` | E5.8#37(Phase 8 类型 B):悬浮面板哑渲染订阅——池 FloatingPanelHost 消费(壳 p… |
41
41
  | `serial` | 11 | `listPorts` `getStatus` `openPort` `closePort` `sendData` `sendText` `setDtr` `setRts` `onData` `onStats` `onSystem` | 串口——读/写/监听,对标 VS Code SerialPort API |
42
42
  | `clipboard` | 3 | `readText` `writeText` `writeFileList` | 剪贴板——读/写系统剪贴板 |
@@ -58,7 +58,7 @@ npm install -D @linkdesk/plugin-sdk
58
58
  | `plugins` | 14 | `resolvePath` `resolveEntry`° `getCompatibility`° `listDirs`° `listAll`° `listDisabledDirs`° `readManifest`° `readAllManifests`° `packageDownload`° `packageExtract`° `packageCancel`° `packageUpdateCheck`° `packageStageUpdate`° `packageCommitUpdate`° | 插件发现——双端注入:resolvePath 双端同面 |
59
59
  | `pluginManager` | 13 | `list` `enable` `disable` `uninstall` `install` `installWithProgress`° `reinstall` `getDisabled` `getUninstalled` `isDisabled` `update`° `checkUpdates`° `notifyManifestChanged`° | 插件管理——桥接 IpcBridgeHandler → loader 函数 |
60
60
  | `bridge` ⚠️ | 4 | `onRequest` `respond` `broadcast` `notifyConfigChanged` | 壳↔插件通信中继——壳 preload 独有 |
61
- | `pool` | 31 | `pushLayout` `onReady` `toggleDevTools` `onSidebarAction` `onTabAction` `onTabBarRects` `onDragPosition` `pushAdsorbHint` `onAdsorbIndex` `pushQuickPick` `onQuickPickAction` `pushDialog` `onDialogAction` `pushFloatingPanel` `onFloatingPanelAction` `onMemoryPressure` `createWindow` `closeWindow` `onWindowClosed` `onWindowBoundsChanged` `onLayout` `ready` `sidebarAction` `tabAction` `tabBarRects` `dragPosition` `onAdsorbHint` `adsorbIndex` `registerBeforeClose` `unregisterBeforeClose` `beforeClose` | 池控制——壳 preload:推送布局 + 注册池→壳动作回调 |
61
+ | `pool` | 32 | `pushLayout` `onReady` `toggleDevTools` `onSidebarAction` `onTabAction` `onTabBarRects` `onDragPosition` `pushAdsorbHint` `onAdsorbIndex` `pushQuickPick` `onQuickPickAction` `pushDialog` `onDialogAction` `pushFloatingPanel` `onFloatingPanelAction` `onMemoryPressure` `createWindow` `closeWindow` `onWindowClosed` `onWindowBoundsChanged` `getLayout` `onLayout` `ready` `sidebarAction` `tabAction` `tabBarRects` `dragPosition` `onAdsorbHint` `adsorbIndex` `registerBeforeClose` `unregisterBeforeClose` `beforeClose` | 池控制——壳 preload:推送布局 + 注册池→壳动作回调 |
62
62
  | `window` | 11 | `minimize` `maximize` `unmaximize` `close` `setZoom` `toggleDevTools` `isMaximized` `onMaximizeChange` `setAlwaysOnTop` `isAlwaysOnTop` `onAlwaysOnTopChange` | 窗口控制——TitleBar 按钮映射,双端注入(11 方法同通道,共享模块 electron/window-name… |
63
63
  | `shell` | 6 | `showItemInFolder` `openInTerminal` `pluginLocation` `openPluginFolder` `startDrag` `relaunch`° | 壳级命令——revealInOS / openInTerminal / startDrag / relaunch,双端… |
64
64
  | `hotExit` ⚠️ | 3 | `save` `load` `clear` | 热退出暂存——编辑器未保存内容落盘(E5.7#53) |
@@ -90,6 +90,7 @@ export const linkdeskMock: Record<string, unknown> = {
90
90
  updateLabelBySourceId: async (..._args: unknown[]) => { console.info("[linkdesk-mock] tabs.updateLabelBySourceId", ..._args); },
91
91
  closeBySourceId: async (..._args: unknown[]) => { console.info("[linkdesk-mock] tabs.closeBySourceId", ..._args); },
92
92
  onDidChangeActiveTab: (..._args: unknown[]) => { console.info("[linkdesk-mock] tabs.onDidChangeActiveTab", ..._args); return () => {}; },
93
+ list: async (..._args: unknown[]) => { console.info("[linkdesk-mock] tabs.list", ..._args); },
93
94
  },
94
95
  keybindings: {
95
96
  getKeybindings: async (..._args: unknown[]) => { console.info("[linkdesk-mock] keybindings.getKeybindings", ..._args); return []; },
@@ -107,6 +108,8 @@ export const linkdeskMock: Record<string, unknown> = {
107
108
  },
108
109
  notifications: {
109
110
  show: async (..._args: unknown[]) => { console.info("[linkdesk-mock] notifications.show", ..._args); return { update: async () => {}, finish: async () => {}, cancel: async () => {} }; },
111
+ list: async (..._args: unknown[]) => { console.info("[linkdesk-mock] notifications.list", ..._args); },
112
+ subscribe: (..._args: unknown[]) => { console.info("[linkdesk-mock] notifications.subscribe", ..._args); return () => {}; },
110
113
  },
111
114
  menu: {
112
115
  registerItems: async (..._args: unknown[]) => { console.info("[linkdesk-mock] menu.registerItems", ..._args); },
@@ -137,6 +140,7 @@ export const linkdeskMock: Record<string, unknown> = {
137
140
  dialogHost: {
138
141
  onShow: (..._args: unknown[]) => { console.info("[linkdesk-mock] dialogHost.onShow", ..._args); return () => {}; },
139
142
  current: (..._args: unknown[]) => { console.info("[linkdesk-mock] dialogHost.current", ..._args); },
143
+ pending: async (..._args: unknown[]) => { console.info("[linkdesk-mock] dialogHost.pending", ..._args); return []; },
140
144
  confirm: (..._args: unknown[]) => { console.info("[linkdesk-mock] dialogHost.confirm", ..._args); },
141
145
  cancel: (..._args: unknown[]) => { console.info("[linkdesk-mock] dialogHost.cancel", ..._args); },
142
146
  },
@@ -307,6 +311,7 @@ export const linkdeskMock: Record<string, unknown> = {
307
311
  closeWindow: (..._args: unknown[]) => { console.info("[linkdesk-mock] pool.closeWindow", ..._args); },
308
312
  onWindowClosed: (..._args: unknown[]) => { console.info("[linkdesk-mock] pool.onWindowClosed", ..._args); return () => {}; },
309
313
  onWindowBoundsChanged: (..._args: unknown[]) => { console.info("[linkdesk-mock] pool.onWindowBoundsChanged", ..._args); return () => {}; },
314
+ getLayout: (..._args: unknown[]) => { console.info("[linkdesk-mock] pool.getLayout", ..._args); },
310
315
  onLayout: (..._args: unknown[]) => { console.info("[linkdesk-mock] pool.onLayout", ..._args); return () => {}; },
311
316
  ready: (..._args: unknown[]) => { console.info("[linkdesk-mock] pool.ready", ..._args); },
312
317
  sidebarAction: (..._args: unknown[]) => { console.info("[linkdesk-mock] pool.sidebarAction", ..._args); },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@linkdesk/plugin-sdk",
3
- "version": "0.1.50",
3
+ "version": "0.1.51",
4
4
  "description": "@linkdesk/plugin-sdk——LinkDesk 插件作者 SDK(对标 @types/vscode):window.linkdesk.* 类型 + 一键 build(.linkdesk-plugin) + dev 宿主 + plugin.json 验证 + eslint 门禁(E6#54d)。作者 npm i 后零壳源码依赖。",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -805,6 +805,32 @@
805
805
  "ldk-keybinding-pill",
806
806
  "ldk-keybinding-sep",
807
807
  "ldk-main-zone",
808
+ "ldk-manual",
809
+ "ldk-manual-body",
810
+ "ldk-manual-body--center",
811
+ "ldk-manual-ch",
812
+ "ldk-manual-ch--on",
813
+ "ldk-manual-ch-label",
814
+ "ldk-manual-content",
815
+ "ldk-manual-empty",
816
+ "ldk-manual-empty-desc",
817
+ "ldk-manual-empty-icon",
818
+ "ldk-manual-empty-path",
819
+ "ldk-manual-empty-title",
820
+ "ldk-manual-head",
821
+ "ldk-manual-head-main",
822
+ "ldk-manual-nav",
823
+ "ldk-manual-nav-head",
824
+ "ldk-manual-skel",
825
+ "ldk-manual-skel--head",
826
+ "ldk-manual-skel-bar",
827
+ "ldk-manual-skel-bar--h18",
828
+ "ldk-manual-skel-list",
829
+ "ldk-manual-sub",
830
+ "ldk-manual-title",
831
+ "ldk-manual-w40",
832
+ "ldk-manual-w70",
833
+ "ldk-manual-w90",
808
834
  "ldk-mdv",
809
835
  "ldk-notif-action-btn",
810
836
  "ldk-notif-actions-row",
@@ -48,6 +48,7 @@
48
48
  "app.zoneRadiusScale"
49
49
  ],
50
50
  "pseudoPluginIds": [
51
+ "ai-bridge",
51
52
  "app",
52
53
  "appearance"
53
54
  ],
@@ -299,7 +299,26 @@
299
299
  "id": { "type": "string", "description": "Command ID — e.g. terminal.clear" },
300
300
  "title": { "type": "string", "description": "Display name" },
301
301
  "category": { "type": "string", "description": "Command palette group" },
302
- "when": { "type": "string", "description": "context key when condition — e.g. activeEditor == 'terminal'" }
302
+ "when": { "type": "string", "description": "context key when condition — e.g. activeEditor == 'terminal'" },
303
+ "description": {
304
+ "type": "string",
305
+ "description": "What this command does — the intent from the user/AI perspective. Do not restate the command id."
306
+ },
307
+ "params": {
308
+ "type": "array",
309
+ "description": "Parameter structure — items correspond positionally to the handler's arguments.",
310
+ "items": {
311
+ "type": "object",
312
+ "required": ["name", "type"],
313
+ "properties": {
314
+ "name": { "type": "string", "description": "Parameter name — must match the handler's parameter name (e.g. tabId / settingKey / groupId)" },
315
+ "type": { "type": "string", "enum": ["string", "number", "boolean", "object"], "description": "Parameter type — object = structured payload (document its fields in description)" },
316
+ "required": { "type": "boolean", "description": "Whether the parameter is required. Defaults to false." },
317
+ "description": { "type": "string", "description": "One sentence on what this parameter is" }
318
+ },
319
+ "additionalProperties": false
320
+ }
321
+ }
303
322
  },
304
323
  "additionalProperties": false
305
324
  }