@linkdesk/contracts 0.1.18 → 0.1.19

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 +36 -0
  2. package/package.json +1 -1
package/linkdesk.d.ts CHANGED
@@ -942,6 +942,38 @@ export interface PluginEntryInfo {
942
942
  /** 目录是否含 index.bundle.js(bundle 格式事实) */
943
943
  bundle: boolean;
944
944
  }
945
+ /** 兼容读数请求(E6#117)——plugins.getCompatibility 入参:插件身份 + 目录侧事实(未装插件由
946
+ * 调用方从 catalog 条目供给;已装插件以磁盘 manifest 为生效值,主进程覆盖) */
947
+ export interface PluginCompatibilityRequest {
948
+ pluginId: string;
949
+ /** 插件要求的最低壳版本(catalog 条目携带;未装插件的唯一来源) */
950
+ minAppVersion?: string | null;
951
+ /** 插件最后发版日(catalog `publishedAt`,ISO) */
952
+ publishedAt?: string | null;
953
+ }
954
+ /** 兼容读数(E6#117)——状态算法单点在壳 `src/core/compat/compatibility.ts`;本面只给机器态,
955
+ * ⛔ 不携带任何用户可见句子(用户面文案归市场插件 i18n,用户面词表见 00 号档 §〇d) */
956
+ export interface PluginCompatibilityReading {
957
+ pluginId: string;
958
+ /** 五态(与用户面五词固定对应,对应表住在 compatibility.ts 头注) */
959
+ state: "current" | "compatible" | "drifted" | "incompatible" | "unknown";
960
+ /** 悬空读数;null = 拿不到(未装 / 目录读不了)——缺数据 ≠ 有问题 */
961
+ dangling: {
962
+ count: number;
963
+ names: string[];
964
+ } | null;
965
+ /** 生效的最低壳版本(已装 = 磁盘 manifest;未装 = 调用方供给);没有 ⇒ null */
966
+ minAppVersion: string | null;
967
+ shellVersion: string;
968
+ /** minAppVersion 缺失/非法 ⇒ null(没得比);false ⇒ state = "incompatible" */
969
+ minAppSatisfied: boolean | null;
970
+ /** 插件最后发版日(YYYY-MM-DD);catalog 拿不到 ⇒ null */
971
+ lastUpdate: string | null;
972
+ /** 当前壳构建日(YYYY-MM-DD);dev 占位 ⇒ null */
973
+ shellBuiltAt: string | null;
974
+ /** 哪些输入缺失(诊断面;state = "unknown" 时非空) */
975
+ unknown: string[];
976
+ }
945
977
  /**
946
978
  * Phase 4 核心类型定义。
947
979
  * 插件元数据、标签页扩展字段、视图注册表条目。
@@ -1236,6 +1268,10 @@ export interface PluginsAPI {
1236
1268
  /** E6#7(1.2-4):resolvePath 的兄弟(discovery 族)——返回 { root, entry, bundle }(bundle 入口恒 index.bundle.js)。
1237
1269
  * 可选——保 state.ts 守卫与两 preload 面(壳/池)编译不裂;调用方先判存在再调用。 */
1238
1270
  resolveEntry?(id: string): Promise<PluginEntryInfo>;
1271
+ /** E6#117:兼容读数(只读)——「这份插件跟当前版本搭不搭」由壳单点算出(状态算法
1272
+ * `src/core/compat/compatibility.ts`;用户面五词与读数的对应表住该文件头注)。
1273
+ * 可选——同 resolveEntry 先例(保 mock 与既有实现面编译不裂;调用方先判存在)。 */
1274
+ getCompatibility?(req: PluginCompatibilityRequest): Promise<PluginCompatibilityReading>;
1239
1275
  listDirs?(): Promise<string[]>;
1240
1276
  /** E6#9a:全量发现——[{ pluginId, entry, manifest }](替代 import.meta.glob;打包插件不在源码树,主进程读盘唯一真源) */
1241
1277
  listAll?(): Promise<PluginDiscoveryEntry[]>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@linkdesk/contracts",
3
- "version": "0.1.18",
3
+ "version": "0.1.19",
4
4
  "description": "LinkDesk 插件契约类型——window.linkdesk.* 全量类型定义(E5.8 契约生成产物)。第三方插件作者唯一合法类型消费路径。",
5
5
  "type": "module",
6
6
  "types": "./linkdesk.d.ts",