@linkdesk/contracts 0.1.13 → 0.1.15

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 (3) hide show
  1. package/README.md +14 -14
  2. package/linkdesk.d.ts +11 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,35 +1,35 @@
1
1
  # @linkdesk/contracts
2
2
 
3
- LinkDesk 插件契约类型——`window.linkdesk.*` 全量类型定义。
3
+ The LinkDesk plugin contract types — the complete type definitions for `window.linkdesk.*`.
4
4
 
5
- > 本包由 LinkDesk 壳的**契约生成器**(`scripts/generate-contract.mjs`)从 `src/core/api/linkdesk-api.ts` 自动生成,**唯一**类型真相源。第三方插件作者用它拿到与壳完全同步的 API 类型——漂移即编译错误。
5
+ > This package is generated automatically by the LinkDesk shell's **contract generator** (`scripts/generate-contract.mjs`) from `src/core/api/linkdesk-api.ts`, and is the **single** source of truth for types. Third-party plugin authors use it to get API types that are perfectly in sync with the shell — drift means a compile error.
6
6
 
7
- ## 安装
7
+ ## Installation
8
8
 
9
9
  ```bash
10
10
  npm install -D @linkdesk/contracts
11
11
  ```
12
12
 
13
- ## 使用
13
+ ## Usage
14
14
 
15
- 包只含类型(`linkdesk.d.ts`,`types` 入口直指它),零运行时。装完后:
15
+ The package contains types only (`linkdesk.d.ts`, with the `types` entry pointing straight at it) and has zero runtime. Once installed:
16
16
 
17
17
  ```ts
18
18
  import type { LinkDeskAPI } from "@linkdesk/contracts";
19
19
 
20
- // window.linkdesk 自动有类型(声明内置 global Window 接口),无需额外 global.d.ts
21
- window.linkdesk.configuration.get("editor.fontSize"); // 智能提示 + 类型检查
20
+ // window.linkdesk is typed automatically (the built-in global Window interface is declared); no extra global.d.ts needed
21
+ window.linkdesk.configuration.get("editor.fontSize"); // IntelliSense + type checking
22
22
  ```
23
23
 
24
- - **纯类型**:不含 `getLinkDesk`/`linkdesk` 值导出——运行时走 `window.linkdesk`(preload 注入)。
25
- - **自包含**:无任何 `@src/core` 依赖,拷一个 d.ts 进项目即完整类型。
26
- - **版本轴独立(2026-09-06 拆焊,反向 E5.8#22.6)**:包版本不再随壳——壳升级 ≠ 契约升级(软件升级是用户轴,与本包无关)。只有当 `window.linkdesk.*` API 面变了、作者要拿新类型时才升版发布。**内容仍与壳源码逐字节同步**(生成器比对,漂移即 `contracts:check` 红)——类型永远描述当前壳,只是版本号不绑壳。`npm update @linkdesk/contracts` 在版本升后拿新类型。
24
+ - **Types only**: no `getLinkDesk`/`linkdesk` value exports — at runtime you go through `window.linkdesk` (injected by the preload).
25
+ - **Self-contained**: no `@src/core` dependency whatsoever; drop a single d.ts into your project for the complete types.
26
+ - **Independent version axis (decoupled on 2026-09-06)**: the package version no longer follows the shell — a shell upgrade is not a contract upgrade (app upgrades are a user-facing axis and unrelated to this package). A new version is published only when the `window.linkdesk.*` API surface changes and authors need the new types. **The content is still byte-for-byte in sync with the shell source** (compared by the generator; drift turns `contracts:check` red) — the types always describe the current shell, only the version number is not tied to it. Run `npm update @linkdesk/contracts` after a version bump to pick up the new types.
27
27
 
28
- ## 与仓库产物双轨
28
+ ## Two tracks alongside the repository artifact
29
29
 
30
- - **推荐**:`npm i -D @linkdesk/contracts`(真实发布链,类型随版本走)
31
- - **备选**:从 LinkDesk 仓库 `contracts/linkdesk.d.ts` 拷贝(无 npm 环境时兜底)
30
+ - **Recommended**: `npm i -D @linkdesk/contracts` (the real publication chain; types follow the version)
31
+ - **Alternative**: copy `contracts/linkdesk.d.ts` from the LinkDesk repository (a fallback when there is no npm environment)
32
32
 
33
- ## 协议
33
+ ## License
34
34
 
35
35
  MIT
package/linkdesk.d.ts CHANGED
@@ -1191,7 +1191,11 @@ export interface PluginInstallResult {
1191
1191
  }
1192
1192
  /** 禁用/卸载列表条目——loader getDisabledPluginInfo/getUninstalledPluginInfo 序列化形状(PluginListSubset 的再子集)
1193
1193
  * E6#30.5b:core 旗标透传——list() EXCLUDES 禁用插件,禁用态详情页卸载钮守 E6#18「core:true 详情页不画」
1194
- * 只能经此拿到 core(缓存 manifest 内取值,纯新增可选字段零回归)。 */
1194
+ * 只能经此拿到 core(缓存 manifest 内取值,纯新增可选字段零回归)。
1195
+ * E6#106:+ 图标四字段(icon/iconSource/marketIcon/marketIconSource)——**同 #65a 给 list() 补图标通道的
1196
+ * 同一先例**。禁用行此前只能退到目录条目取图,而目录条目的图标已改绝对 URL(未装态形态)⇒ 禁用行
1197
+ * (明明插件还在盘上)会静默改拉远程图,断网即裂。补通道后裁决序与其它位统一:已装优先 → 目录 → 默认块。
1198
+ * 未安装列表(getUninstalledPluginInfo)**不补**:插件已不在盘上,本地无图可读,目录条目本就是唯一来源。 */
1195
1199
  export interface PluginInfoEntry {
1196
1200
  pluginId: string;
1197
1201
  name: string;
@@ -1201,6 +1205,12 @@ export interface PluginInfoEntry {
1201
1205
  /** E6#73j(G6):同 `PluginListEntry.updatable` 的住所判据——禁用**不改住所**(disable 只记名单,
1202
1206
  * 目录原地不动)⇒ userData 家的禁用插件照样可更新,app 树的则否。 */
1203
1207
  updatable?: boolean;
1208
+ /** E6#106:界面小图标(Type-1 剪影 for 图标栏插件 / Type-2 身份图 for 其余) */
1209
+ icon?: string;
1210
+ iconSource?: "codicon" | "svg" | "url" | "lucide";
1211
+ /** E6#106:插件身份彩色图(Type-2)——行/详情展示位的第一候选 */
1212
+ marketIcon?: string;
1213
+ marketIconSource?: "codicon" | "svg" | "url" | "lucide";
1204
1214
  }
1205
1215
  /** E6#11c/#13b(段 B):更新结果——PluginInstallResult 的更新扩展。
1206
1216
  * upToDate = catalog 直答已是最新(success:true 但非"更新发生"——UI 显示"已是最新"非红错误);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@linkdesk/contracts",
3
- "version": "0.1.13",
3
+ "version": "0.1.15",
4
4
  "description": "LinkDesk 插件契约类型——window.linkdesk.* 全量类型定义(E5.8 契约生成产物)。第三方插件作者唯一合法类型消费路径。",
5
5
  "type": "module",
6
6
  "types": "./linkdesk.d.ts",