@linkdesk/contracts 0.1.35 → 0.1.37

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 +18 -2
  2. package/package.json +24 -24
package/linkdesk.d.ts CHANGED
@@ -1931,9 +1931,22 @@ export interface EditorAPI {
1931
1931
  getDecoration(uri: string): Promise<FileDecoration | null>;
1932
1932
  onDidChange(cb: (uris: string[]) => void): () => void;
1933
1933
  };
1934
- /** 文件关联——扩展名→插件 ID(主进程 FileAssociationService 直答) */
1934
+ /**
1935
+ * 文件关联——扩展名→插件 ID(主进程 FileAssociationService 直答)。
1936
+ * T2(第 3 波):`getPluginFor` 升级为覆盖表感知的完整解析(覆盖 → 声明 → 角色,01 §T2.2)——
1937
+ * 三入口(FoldersView/SearchView/intake)同吃 ⇒ F3「一处真相」;`listHandlersFor` = 选择器只读面;
1938
+ * `setDefault` = 覆盖表唯一写口(「设为默认」/「恢复自动」,双向同步)。
1939
+ */
1935
1940
  fileAssociation: {
1936
1941
  getPluginFor(ext: string): Promise<string | undefined>;
1942
+ /** 列该扩展名全部声明者+当前默认标记(「打开方式…」选择器数据源,01 §T2.1);无声明者 ⇒ [] */
1943
+ listHandlersFor(ext: string): Promise<Array<{
1944
+ pluginId: string;
1945
+ displayName: string;
1946
+ isCurrent: boolean;
1947
+ }>>;
1948
+ /** 覆盖表唯一写口——`pluginId: null` = 恢复自动(删覆盖键);写后 config:changed 即时广播 */
1949
+ setDefault(ext: string, pluginId: string | null): Promise<void>;
1937
1950
  };
1938
1951
  /** langDef——语言定义注册表(主进程直答)。只返回可序列化字段(monarch tokenizer 函数主进程侧剥壳) */
1939
1952
  langDef: {
@@ -2359,10 +2372,13 @@ export interface PluginsAPI {
2359
2372
  newVersion: string;
2360
2373
  stagedDir: string;
2361
2374
  }>;
2362
- /** 主进程原子替换段——同卷 rename:target→.bak→staged→target→rm .bak(失败复原旧版) */
2375
+ /** 主进程原子替换段——同卷 rename:target→.bak→staged→target→rm .bak(失败复原旧版)。
2376
+ * 0.2.48:`deferred: true` = 旧版目录被占用(dev 轨道 Vite 句柄主场景,磁盘未动、暂存原样)——
2377
+ * 调用方提示「重启后自动替换」,启动时 `commitPendingStagedUpdates` 补提交;version = 暂存的新版号。 */
2363
2378
  packageCommitUpdate?(pluginId: string, stagedDir: string): Promise<{
2364
2379
  pluginId: string;
2365
2380
  version: string;
2381
+ deferred?: boolean;
2366
2382
  }>;
2367
2383
  };
2368
2384
  /** 插件管理——桥接 IpcBridgeHandler → loader 函数。池权威(marketplace 插件消费),必选 */
package/package.json CHANGED
@@ -1,24 +1,24 @@
1
- {
2
- "name": "@linkdesk/contracts",
3
- "version": "0.1.35",
4
- "description": "LinkDesk 插件契约类型——window.linkdesk.* 全量类型定义(E5.8 契约生成产物)。第三方插件作者唯一合法类型消费路径。",
5
- "type": "module",
6
- "types": "./linkdesk.d.ts",
7
- "files": [
8
- "linkdesk.d.ts"
9
- ],
10
- "sideEffects": false,
11
- "publishConfig": {
12
- "access": "public"
13
- },
14
- "scripts": {
15
- "prepack": "node ../scripts/generate-contract.mjs"
16
- },
17
- "keywords": [
18
- "linkdesk",
19
- "plugin",
20
- "types",
21
- "contract"
22
- ],
23
- "license": "MIT"
24
- }
1
+ {
2
+ "name": "@linkdesk/contracts",
3
+ "version": "0.1.37",
4
+ "description": "LinkDesk 插件契约类型——window.linkdesk.* 全量类型定义(E5.8 契约生成产物)。第三方插件作者唯一合法类型消费路径。",
5
+ "type": "module",
6
+ "types": "./linkdesk.d.ts",
7
+ "files": [
8
+ "linkdesk.d.ts"
9
+ ],
10
+ "sideEffects": false,
11
+ "publishConfig": {
12
+ "access": "public"
13
+ },
14
+ "scripts": {
15
+ "prepack": "node ../scripts/generate-contract.mjs"
16
+ },
17
+ "keywords": [
18
+ "linkdesk",
19
+ "plugin",
20
+ "types",
21
+ "contract"
22
+ ],
23
+ "license": "MIT"
24
+ }