@linkdesk/contracts 0.1.54 → 0.1.55
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/linkdesk.d.ts +17 -17
- package/package.json +25 -25
package/linkdesk.d.ts
CHANGED
|
@@ -1554,13 +1554,6 @@ export interface MenuItemDescriptor {
|
|
|
1554
1554
|
onSelect?: () => void;
|
|
1555
1555
|
children?: Array<string | MenuItemDescriptor>;
|
|
1556
1556
|
}
|
|
1557
|
-
/**
|
|
1558
|
-
* Dialog wire contract—
|
|
1559
|
-
*
|
|
1560
|
-
* Once defined twice: linkdesk-api.ts (plugin side, ) and an inline struct in dialog-handlers.ts
|
|
1561
|
-
* manually aligned—changing one side silently broke the other. This module defines it in one place:
|
|
1562
|
-
* plugin API re-export (keeping the existing import path) + preload + main process, three ends import type.
|
|
1563
|
-
*/
|
|
1564
1557
|
export interface DialogOpenOptions {
|
|
1565
1558
|
title?: string;
|
|
1566
1559
|
/** true = pick a directory; defaults to picking a file */
|
|
@@ -2548,15 +2541,21 @@ export interface PluginInstallRequest {
|
|
|
2548
2541
|
display: PluginInstallDisplay;
|
|
2549
2542
|
/** update 模式:显式放行降级(版本下拉选旧版)——仍会走确认(policy 出 `downgrade`) */
|
|
2550
2543
|
allowOlder?: boolean;
|
|
2551
|
-
/** 缺依赖解析目录(同 PluginInstallRequestOpts.catalogUrl 语义)——壳在同一 job
|
|
2544
|
+
/** 缺依赖解析目录(同 PluginInstallRequestOpts.catalogUrl 语义)——壳在同一 job 内自动装依赖用。
|
|
2545
|
+
* 🔴 市场**必须**带上(旧链靠它做依赖自动安装,漏了 = 依赖装不上、插件 parked)。 */
|
|
2552
2546
|
catalogUrl?: string;
|
|
2547
|
+
/** 目录条目声明的最低壳版本——壳**自己**再判一次(spec §四:不满足直接拦,不进入确认)。
|
|
2548
|
+
* 市场照抄目录条目即可;不带 = 不判(旧目录条目没有该字段)。 */
|
|
2549
|
+
minAppVersion?: string;
|
|
2553
2550
|
}
|
|
2554
2551
|
/** `requestInstall` 回执——`confirmed:false` + `cancelled:false` = 被拒(`reason` 说原因) */
|
|
2555
2552
|
export interface PluginInstallConfirmResult {
|
|
2556
2553
|
confirmed: boolean;
|
|
2554
|
+
/** 🔴 执行结果(confirmed 只表示「用户同意了」):false = 已确认但没装成。
|
|
2555
|
+
* 市场必须据此报错——实机(2026-11-24):明文 http 被拒后**一点提示都没有**,就是因为这里被吞了。 */
|
|
2556
|
+
ok?: boolean;
|
|
2557
|
+
error?: string;
|
|
2557
2558
|
cancelled?: boolean;
|
|
2558
|
-
/** 确认后壳已入队;进度/终态走 `plugin:installJobs` 全量快照 */
|
|
2559
|
-
jobId?: string;
|
|
2560
2559
|
/** `invalid` = 请求本身不成立(同版本重装 / 未放行降级 / 重复请求) */
|
|
2561
2560
|
reason?: "user-cancelled" | "source-changed" | "integrity-failed" | "min-app" | "no-token" | "up-to-date" | "invalid";
|
|
2562
2561
|
}
|
|
@@ -2566,14 +2565,12 @@ export interface PluginConfirmRejected {
|
|
|
2566
2565
|
reason: "min-app" | "integrity-failed" | "invalid";
|
|
2567
2566
|
message?: string;
|
|
2568
2567
|
}
|
|
2569
|
-
/** `requestUpdateBatch` 回执——`confirmed:false` = **整批取消**(0
|
|
2568
|
+
/** `requestUpdateBatch` 回执——`confirmed:false` = **整批取消**(0 个执行,spec §五.4)。
|
|
2569
|
+
* 🔴 壳不建 job 表:这里的 `confirmed` 只回答「用户同不同意」,逐项成败走完成通知(轻 toast + 铃铛面板)。 */
|
|
2570
2570
|
export interface PluginUpdateBatchResult {
|
|
2571
2571
|
confirmed: boolean;
|
|
2572
2572
|
cancelled?: boolean;
|
|
2573
|
-
/**
|
|
2574
|
-
jobIds: string[];
|
|
2575
|
-
batchId?: string;
|
|
2576
|
-
/** 被直接拒的项(不弹卡、不进 jobIds) */
|
|
2573
|
+
/** 被直接拒的项(不弹卡、不执行) */
|
|
2577
2574
|
rejected?: PluginConfirmRejected[];
|
|
2578
2575
|
}
|
|
2579
2576
|
/** 需要确认的原因——**封闭集合**;渲染体只按它选文案,⛔ 不自推(两条独立开关见 PluginUpdatePolicy) */
|
|
@@ -2634,11 +2631,14 @@ export interface PluginInstallPrepared {
|
|
|
2634
2631
|
/** 句柄到期时刻(ms)——到点后 commit 返回 `expired` */
|
|
2635
2632
|
expiresAt: number;
|
|
2636
2633
|
}
|
|
2637
|
-
/** `commitInstall` 回执——`confirmed:true` =
|
|
2634
|
+
/** `commitInstall` 回执——`confirmed:true` = 用户已确认且已交执行体(成败看 `ok`) */
|
|
2638
2635
|
export interface PluginInstallCommitResult {
|
|
2639
2636
|
confirmed: boolean;
|
|
2637
|
+
/** 🔴 **执行结果**(confirmed 只表示"用户同意了"):false = 已确认但没装成(下载/校验/落盘失败)。
|
|
2638
|
+
* 市场必须据此报错,⛔ 不许把 confirmed 当成"装好了"(实机:确认后失败的更新被报成成功)。 */
|
|
2639
|
+
ok?: boolean;
|
|
2640
|
+
error?: string;
|
|
2640
2641
|
cancelled?: boolean;
|
|
2641
|
-
jobId?: string;
|
|
2642
2642
|
/** `unknown-plan` = planId 不存在/已用过/已过期(统一一个词,⛔ 不细分) */
|
|
2643
2643
|
reason?: "unknown-plan" | "rejected" | "user-cancelled" | "no-token";
|
|
2644
2644
|
}
|
package/package.json
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@linkdesk/contracts",
|
|
3
|
-
"version": "0.1.
|
|
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
|
-
"prepublishOnly": "node ../scripts/prepublish-auth-preflight.mjs --npm",
|
|
16
|
-
"prepack": "node ../scripts/generate-contract.mjs"
|
|
17
|
-
},
|
|
18
|
-
"keywords": [
|
|
19
|
-
"linkdesk",
|
|
20
|
-
"plugin",
|
|
21
|
-
"types",
|
|
22
|
-
"contract"
|
|
23
|
-
],
|
|
24
|
-
"license": "MIT"
|
|
25
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@linkdesk/contracts",
|
|
3
|
+
"version": "0.1.55",
|
|
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
|
+
"prepublishOnly": "node ../scripts/prepublish-auth-preflight.mjs --npm",
|
|
16
|
+
"prepack": "node ../scripts/generate-contract.mjs"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"linkdesk",
|
|
20
|
+
"plugin",
|
|
21
|
+
"types",
|
|
22
|
+
"contract"
|
|
23
|
+
],
|
|
24
|
+
"license": "MIT"
|
|
25
|
+
}
|