@linkdesk/plugin-sdk 0.1.87 → 0.1.89

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
@@ -15,60 +15,60 @@ npm install -D @linkdesk/plugin-sdk
15
15
 
16
16
  <!-- BEGIN API-CHEATSHEET -->
17
17
 
18
- > 自动生成,**勿手改**——由 `scripts/generate-api-cheatsheet.mjs` 从 `@linkdesk/contracts` 的 `linkdesk.d.ts` 现读产出,
19
- > `npm run check` 机械盯漂。完整签名与逐方法说明见 `linkdesk.d.ts` 本体(IDE 里可直接跳转)。
18
+ > Auto-generated, **do not edit by hand**—produced live by `scripts/generate-api-cheatsheet.mjs` reading `linkdesk.d.ts` from `@linkdesk/contracts`;
19
+ > `npm run check` mechanically watches for drift. For full signatures and per-method notes see `linkdesk.d.ts` itself (jump to it straight from the IDE).
20
20
 
21
- **16 个域接口 → 47 个命名空间 / 260 个方法**,全部经 `window.linkdesk.<命名空间>.<方法>` 调用。 (plus 1 deprecated alias/es `config`, not counted twice)
21
+ **16 domain interfaces → 47 namespaces / 260 methods**, all invoked via `window.linkdesk.<namespace>.<method>`. (plus 1 deprecated alias/es `config`, not counted twice)
22
22
 
23
23
  | Namespace | Methods | Method | Notes |
24
24
  |:--|:--:|:--|:--|
25
- | `commands` | 5 | `execute` `executeCommand` `registerCommand` `unregisterCommands` `getCommands` | 命令——对标 VS Code vscode.commands |
26
- | `configuration` | 15 | `get` `set` `getSchema` `onChange` `getConfigurationContributions` `inspectConfiguration` `getUserSettings` `onDidChangeConfiguration` `onPluginLifecycleChange` `consumeSettingsGroup` `onRequestSettingsGroup` `consumeScrollToSetting` `onRequestScrollToSetting` `consumeOpenKeybindings` `onRequestOpenKeybindings` | 配置—新名——对标 VS Code vscode.workspace.getConfiguration |
27
- | `config` | 15 | (废弃别名 → `configuration`) | @deprecated 向后兼容别名,新代码用 configuration |
25
+ | `commands` | 5 | `execute` `executeCommand` `registerCommand` `unregisterCommands` `getCommands` | Commands — modeled after VS Code vscode.commands |
26
+ | `configuration` | 15 | `get` `set` `getSchema` `onChange` `getConfigurationContributions` `inspectConfiguration` `getUserSettings` `onDidChangeConfiguration` `onPluginLifecycleChange` `consumeSettingsGroup` `onRequestSettingsGroup` `consumeScrollToSetting` `onRequestScrollToSetting` `consumeOpenKeybindings` `onRequestOpenKeybindings` | Configuration — the new name — modeled after VS Code vscode… |
27
+ | `config` | 15 | (deprecated alias → `configuration`) | @deprecated — backward-compatibility alias |
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
- | `appearance` | 2 | `importImage` `revealStorage` | 外观资产——本地选图拷贝入库(受控来源——用户任选路径不能 file:// 直读) |
30
+ | `appearance` | 2 | `importImage` `revealStorage` | appearance assets — locally picked images are copied into m… |
31
31
  | `storage` ⚠️ | 2 | `revealCache` `cacheDir` | —— |
32
32
  | `tabs` | 9 | `create` `openOrFocus` `focus` `close` `focusBySourceId` `updateLabelBySourceId` `closeBySourceId` `onDidChangeActiveTab` `list` | —— |
33
33
  | `keybindings` | 13 | `getKeybindings` `getConflicts` `registerKeybinding` `saveUserKeybindings` `removeKeybindingForCommand` `resetKeybindingToDefault` `clearKeybindingForCommand` `findKeybindingForCommand` `setKeybindingCaptureActive` `keyboardEventToKeyString` `onChange` `syncToMainProcess`° `onForwardedEvent`° | —— |
34
- | `notifications` | 3 | `show` `list` `subscribe` | 通知——插件弹通知(唯一通知面 = 铃铛宽通知面板,右下窄卡链路已整删),对标 VS Code vscode.wind… |
35
- | `menu` | 2 | `registerItems` `getItems` | 菜单——插件声明式读写 |
36
- | `contextKey` | 1 | `set` | ContextKey——插件 SET 状态供壳 when 子句读 |
37
- | `dialog` | 5 | `confirm` `alert` `open` `openFile` `confirmContent` | 弹窗——确认/提示/文件选择 |
38
- | `quickPick` | 1 | `show` | 插件 quickPick 选择器——池内本地桥(零 IPC,QuickPickHost 渲染) |
39
- | `quickPickHost` | 6 | `registerHost` `onShow` `select` `highlight` `close` `itemAction` | QuickPick 宿主渲染桥——池 QuickPickHost 消费(壳 preload 无此面) |
40
- | `dialogHost` | 5 | `onShow` `current` `pending` `confirm` `cancel` | Dialog 哑渲染订阅——池 DialogHost 消费(壳 preload 无此面) |
41
- | `floatingPanelHost` | 4 | `onShow` `action` `registerBoundsHost` `getBounds` | (类型 B):悬浮面板哑渲染订阅——池 FloatingPanelHost 消费(壳 preload 无此面) |
42
- | `serial` | 11 | `listPorts` `getStatus` `openPort` `closePort` `sendData` `sendText` `setDtr` `setRts` `onData` `onStats` `onSystem` | 串口——读/写/监听,对标 VS Code SerialPort API |
43
- | `clipboard` | 3 | `readText` `writeText` `writeFileList` | 剪贴板——读/写系统剪贴板 |
44
- | `p2p` | 2 | `send` `on` | p2p 插件间定向推流——和 bridge.broadcast 同模式(fire-and-forget) |
45
- | `events` | 4 | `on` `emit` `heartbeat`° `notifyTheme`° | 通用事件订阅 + 发布——插件间数据管道 |
46
- | `pluginState` | 3 | `get` `set` `onChange` | 插件持久化存储——集中缓存 + 文件持久化 |
47
- | `workspace` | 8 | `getFolders` `getActive` `setActive` `openFolder` `addFolder` `removeFolder` `onDidChangeFolders` `onDidChangeActiveWorkspace` | 工作区——池 preload 注入(壳侧经 WorkspaceService 直用) |
48
- | `filesystem` | 12 | `readTextFile` `writeTextFile` `exists` `createDir` `copy` `rename` `remove` `listDir` `readBinaryFile` `writeBinaryFile` `watch` `readdir`° | 文件系统——插件读写(路径校验由主进程执行) |
49
- | `path` | 6 | `appDataDir`° `normalize` `join` `basename` `dirname` `extname` | 路径工具——壳/池双端注入(editor/file-tree 池插件消费 normalize/join 等) |
50
- | `env` | 1 | `get` | 环境信息——对标 VS Code ExtensionContext |
51
- | `search` | 1 | `searchFiles` | 文件搜索——全文搜索/替换(IPC 到壳/主进程执行) |
52
- | `encoding` | 4 | `detect` `decode` `encode` `isBinary` | 编码检测/转换(主进程 EncodingService) |
53
- | `decorations` | 4 | `registerProvider` `unregisterProvider` `getDecoration` `onDidChange` | 文件装饰——池内本地注册表(零 IPC) |
54
- | `fileAssociation` | 4 | `getPluginFor` `listHandlersFor` `setDefault` `setDefaultBulk` | 文件关联——扩展名→插件 ID(主进程 FileAssociationService 直答) |
55
- | `langDef` | 1 | `get` | langDef——语言定义注册表(主进程直答) |
56
- | `lsp` | 4 | `spawn` `write` `dispose` `onData` | LSP 桥——自动补全/F12/诊断/重命名 |
57
- | `protocol` | 3 | `listProtocols` `getActiveProtocolId` `setActiveProtocolId` | protocol——协议注册表(主进程直答) |
58
- | `viewContainer` | 4 | `getViewContainer` `getViews` `getView` `registerView` | viewContainer——真 IPC 查询/更新(问壳侧注册表) |
59
- | `plugins` | 14 | `resolvePath` `resolveEntry`° `getCompatibility`° `listDirs`° `listAll`° `listDisabledDirs`° `readManifest`° `readAllManifests`° `packageDownload`° `packageExtract`° `packageCancel`° `packageUpdateCheck`° `packageStageUpdate`° `packageCommitUpdate`° | 插件发现——双端注入:resolvePath 双端同面 |
60
- | `pluginManager` | 13 | `list` `enable` `disable` `uninstall` `install` `installWithProgress`° `reinstall` `getDisabled` `getUninstalled` `isDisabled` `update`° `checkUpdates`° `notifyManifestChanged`° | 插件管理——桥接 IpcBridgeHandler → loader 函数 |
61
- | `bridge` ⚠️ | 4 | `onRequest` `respond` `broadcast` `notifyConfigChanged` | 壳↔插件通信中继——壳 preload 独有 |
62
- | `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:推送布局 + 注册池→壳动作回调 |
63
- | `window` | 11 | `minimize` `maximize` `unmaximize` `close` `setZoom` `toggleDevTools` `isMaximized` `onMaximizeChange` `setAlwaysOnTop` `isAlwaysOnTop` `onAlwaysOnTopChange` | 窗口控制——TitleBar 按钮映射,双端注入(11 方法同通道,共享模块 electron/window-name… |
64
- | `shell` | 7 | `showItemInFolder` `openInTerminal` `pluginLocation` `openPluginFolder` `startDrag` `relaunch`° `openExternal` | 壳级命令——revealInOS / openInTerminal / startDrag / relaunch,双端… |
65
- | `hotExit` ⚠️ | 3 | `save` `load` `clear` | 热退出暂存——编辑器未保存内容落盘 |
66
- | `getFilePath` | 0 | (top-level function)`getFilePath: (file: File) => string;` | OS 拖入文件路径获取——双端注入 |
34
+ | `notifications` | 3 | `show` `list` `subscribe` | Notifications — plugins raise notifications ( the only noti… |
35
+ | `menu` | 2 | `registerItems` `getItems` | Menus — declarative read/write for plugins |
36
+ | `contextKey` | 1 | `set` | ContextKey — plugins SET state for the shell's when clauses… |
37
+ | `dialog` | 5 | `confirm` `alert` `open` `openFile` `confirmContent` | Dialogs — confirm/alert/file selection |
38
+ | `quickPick` | 1 | `show` | plugin quickPick picker — local bridge inside the pool (zer… |
39
+ | `quickPickHost` | 6 | `registerHost` `onShow` `select` `highlight` `close` `itemAction` | QuickPick host rendering bridge — consumed by the pool's Qu… |
40
+ | `dialogHost` | 5 | `onShow` `current` `pending` `confirm` `cancel` | Dialog dumb-render subscription — consumed by the pool's Di… |
41
+ | `floatingPanelHost` | 4 | `onShow` `action` `registerBoundsHost` `getBounds` | (type B): floating panel dumb-render subscription — consume… |
42
+ | `serial` | 11 | `listPorts` `getStatus` `openPort` `closePort` `sendData` `sendText` `setDtr` `setRts` `onData` `onStats` `onSystem` | Serial — read/write/listen, modeled after VS Code SerialPor… |
43
+ | `clipboard` | 3 | `readText` `writeText` `writeFileList` | Clipboard — read/write the system clipboard |
44
+ | `p2p` | 2 | `send` `on` | p2p targeted inter-plugin push — same pattern as bridge.bro… |
45
+ | `events` | 4 | `on` `emit` `heartbeat`° `notifyTheme`° | Generic event subscribe + publish — the inter-plugin data p… |
46
+ | `pluginState` | 3 | `get` `set` `onChange` | plugin persistent storage — centralized cache + file persis… |
47
+ | `workspace` | 8 | `getFolders` `getActive` `setActive` `openFolder` `addFolder` `removeFolder` `onDidChangeFolders` `onDidChangeActiveWorkspace` | Workspace — injected by the pool preload (the shell side us… |
48
+ | `filesystem` | 12 | `readTextFile` `writeTextFile` `exists` `createDir` `copy` `rename` `remove` `listDir` `readBinaryFile` `writeBinaryFile` `watch` `readdir`° | Filesystem — plugin read/write (path validation is performe… |
49
+ | `path` | 6 | `appDataDir`° `normalize` `join` `basename` `dirname` `extname` | Path utilities — injected on both shell/pool ends (in-pool … |
50
+ | `env` | 1 | `get` | Environment info — modeled after VS Code ExtensionContext |
51
+ | `search` | 1 | `searchFiles` | file search — full-text search/replace (executed via IPC in… |
52
+ | `encoding` | 4 | `detect` `decode` `encode` `isBinary` | encoding detection/conversion (main-process EncodingService) |
53
+ | `decorations` | 4 | `registerProvider` `unregisterProvider` `getDecoration` `onDidChange` | file decorations — a local in-pool registry (zero IPC). Sha… |
54
+ | `fileAssociation` | 4 | `getPluginFor` `listHandlersFor` `setDefault` `setDefaultBulk` | file associations — extension→plugin ID (answered directly … |
55
+ | `langDef` | 1 | `get` | langDef — language definition registry (answered directly b… |
56
+ | `lsp` | 4 | `spawn` `write` `dispose` `onData` | LSP bridge — autocompletion/F12/diagnostics/rename |
57
+ | `protocol` | 3 | `listProtocols` `getActiveProtocolId` `setActiveProtocolId` | protocol — protocol registry (answered directly by the main… |
58
+ | `viewContainer` | 4 | `getViewContainer` `getViews` `getView` `registerView` | viewContainer — real IPC query/update (asks the shell-side … |
59
+ | `plugins` | 14 | `resolvePath` `resolveEntry`° `getCompatibility`° `listDirs`° `listAll`° `listDisabledDirs`° `readManifest`° `readAllManifests`° `packageDownload`° `packageExtract`° `packageCancel`° `packageUpdateCheck`° `packageStageUpdate`° `packageCommitUpdate`° | Plugin discovery — injected on both ends: resolvePath exist… |
60
+ | `pluginManager` | 13 | `list` `enable` `disable` `uninstall` `install` `installWithProgress`° `reinstall` `getDisabled` `getUninstalled` `isDisabled` `update`° `checkUpdates`° `notifyManifestChanged`° | Plugin management — bridges IpcBridgeHandler → loader funct… |
61
+ | `bridge` ⚠️ | 4 | `onRequest` `respond` `broadcast` `notifyConfigChanged` | Shell↔plugin communication relay — shell preload only |
62
+ | `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` | Pool control — shell preload: pushes layout + registers poo… |
63
+ | `window` | 11 | `minimize` `maximize` `unmaximize` `close` `setZoom` `toggleDevTools` `isMaximized` `onMaximizeChange` `setAlwaysOnTop` `isAlwaysOnTop` `onAlwaysOnTopChange` | Window control — TitleBar button mapping, injected on both … |
64
+ | `shell` | 7 | `showItemInFolder` `openInTerminal` `pluginLocation` `openPluginFolder` `startDrag` `relaunch`° `openExternal` | Shell-level commands — revealInOS / openInTerminal / startD… |
65
+ | `hotExit` ⚠️ | 3 | `save` `load` `clear` | Hot exit staging — persists unsaved editor content to disk … |
66
+ | `getFilePath` | 0 | (top-level function)`getFilePath: (file: File) => string;` | Get the paths of files dragged in from the OS — injected on… |
67
67
  | `panel` | 3 | `reveal` `revealFloating` `setFloatingBounds` | —— |
68
68
  | `settings` | 3 | `list` `getActive` `setActive` | —— |
69
69
  | `factorySlots` | 4 | `listRoles` `list` `getActive` `setActive` | —— |
70
- | `app` | 1 | `getVersion` | app 命名空间——只读产品身份 |
71
- | `update` | 1 | `getState` | update 命名空间——只读更新状态(供「关于」类插件读宿主版本/更新态) |
70
+ | `app` | 1 | `getVersion` | The app namespace — read-only product identity. The only ru… |
71
+ | `update` | 1 | `getState` | The update namespace — read-only update state (for "About"-… |
72
72
 
73
73
  ⚠️ = optional namespace in the contract (injected on one side only): `storage` `bridge` `hotExit` — check for existence before calling; on the other side it is undefined.
74
74
  ° = member marked `?` in the contract: injected in one side's preload only (almost always shell-side). **Your plugin runs in the pool** — check for existence before calling.
@@ -184,4 +184,4 @@ npm run release:mark
184
184
  ```
185
185
 
186
186
  > 🔴 The shelf read has a **~3 minute replication delay** (`contracts` is visible within seconds, `plugin-sdk` takes minutes) — do **not** re-publish on a 404, npm will reject the duplicate version.
187
- > Full procedure + all three measured pitfalls → **`docs/06-发布管理/作者轴npm发版.md`** in the LinkDesk repository.
187
+ > Full procedure + all three measured pitfalls → the author-axis npm release dossier in the LinkDesk repository (Chinese docs tree, publishing-management series).
@@ -1,17 +1,17 @@
1
1
  /**
2
- * 🔥 linkdesk-mock.generated.ts——dev 宿主 window.linkdesk mock 树(自动生成,勿手改)
2
+ * 🔥 linkdesk-mock.generated.ts—dev-host window.linkdesk mock tree (auto-generated, do not edit by hand)
3
3
  *
4
- * 生成源:src/core/api/linkdesk-api.ts + linkdesk-api/(LinkDeskAPI 交集——与 linkdesk.d.ts 同一标注源)
5
- * 生成器:scripts/generate-contract.mjs(E6#27 第三产物,杜绝 mock/preload 双份漂移)
6
- * 改契约源 → 跑 `node scripts/generate-contract.mjs`(npm run check 里 contracts:check 三产物逐字节强制)
4
+ * Generated from: src/core/api/linkdesk-api.ts + linkdesk-api/ (LinkDeskAPI intersection—same annotation source as linkdesk.d.ts)
5
+ * Generator: scripts/generate-contract.mjs (E6#27 third artifact—prevents mock/preload drift; consumed by dev-host/mock.ts via a Proxy)
6
+ * After changing a contract source, run `node scripts/generate-contract.mjs` (contracts:check enforces all three artifacts byte-for-byte)
7
7
  *
8
- * 消费方:packages/plugin-sdk/dev-host/mock.ts——injectDevMockApi() 用 Proxy 包本树:
9
- * 树内方法 = 类型驱动中性默认 + 调用即打 [linkdesk-mock] 日志(mock vs 真 IPC 可感知);
10
- * 树外路径(契约里不存在的方法名) = Proxy 抛「不在 linkdesk API 契约」。
11
- * 默认值策略("不崩 + 可感知",详见 02-本地预览环境.md §10.2):
12
- * Promise<void/…数据对象> → async 返 undefined;Promise<数组> → [];Promise<string/boolean> → ""/false;
13
- * void → noop(registerCommand 等每插件必调,绝不抛);返回退订句柄(onChange 等)→ noop 函数;
14
- * 其余同步 → ""/undefined。真数据/真行为走真实 IPC / linkdesk-plugin-sdk dev --real(E6#28.5)。
8
+ * Consumer: packages/plugin-sdk/dev-host/mock.ts—injectDevMockApi() wraps this tree in a Proxy:
9
+ * in-tree methods = type-driven neutral defaults + a [linkdesk-mock] log line per call (mock vs real IPC is perceivable);
10
+ * out-of-tree paths (method names absent from the contract) = the Proxy throws "not in the linkdesk API contract".
11
+ * Default-value strategy ("never crash + stay perceivable"; see the local-preview-environment design doc §10.2):
12
+ * Promise<void/…data object> → async returns undefined; Promise<array> → []; Promise<string/boolean> → ""/false;
13
+ * void → noop (registerCommand etc. are called by every plugin—never throw); unsubscribe handles (onChange etc.) → noop function;
14
+ * other sync returns → ""/undefined. Real data/behavior goes through real IPC / linkdesk-plugin-sdk dev --real (E6#28.5).
15
15
  */
16
16
  export const linkdeskMock: Record<string, unknown> = {
17
17
  commands: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@linkdesk/plugin-sdk",
3
- "version": "0.1.87",
3
+ "version": "0.1.89",
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",
@@ -64,6 +64,7 @@
64
64
  "node": ">=20.0.0"
65
65
  },
66
66
  "scripts": {
67
+ "prepublishOnly": "node ../../scripts/prepublish-auth-preflight.mjs --npm",
67
68
  "build": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.build.json",
68
69
  "typecheck": "tsc -p tsconfig.json --noEmit",
69
70
  "prepack": "npm run build"
@@ -798,7 +798,9 @@
798
798
  "ldk-floating-panel-resize",
799
799
  "ldk-floating-panel-title",
800
800
  "ldk-form-row",
801
+ "ldk-group-pane",
801
802
  "ldk-group-pane-focused",
803
+ "ldk-group-pane-split",
802
804
  "ldk-group-tab-bar",
803
805
  "ldk-group-tab-close",
804
806
  "ldk-group-tab-dirty-dot",
@@ -1147,6 +1149,7 @@
1147
1149
  "ldk-status-chord",
1148
1150
  "ldk-status-divider",
1149
1151
  "ldk-status-text",
1152
+ "ldk-tab-content-split",
1150
1153
  "ldk-theme-picker",
1151
1154
  "ldk-theme-picker-badge",
1152
1155
  "ldk-theme-picker-card",