@linkdesk/plugin-sdk 0.1.0 → 0.1.1

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 (44) hide show
  1. package/dist/bin.js +12 -0
  2. package/dist/bin.js.map +1 -1
  3. package/dist/eslint/checks/css-hardcode.d.ts +14 -0
  4. package/dist/eslint/checks/css-hardcode.d.ts.map +1 -0
  5. package/dist/eslint/checks/css-hardcode.js +87 -0
  6. package/dist/eslint/checks/css-hardcode.js.map +1 -0
  7. package/dist/eslint/checks/disable.d.ts +29 -0
  8. package/dist/eslint/checks/disable.d.ts.map +1 -0
  9. package/dist/eslint/checks/disable.js +151 -0
  10. package/dist/eslint/checks/disable.js.map +1 -0
  11. package/dist/eslint/checks/font-scale.d.ts +19 -0
  12. package/dist/eslint/checks/font-scale.d.ts.map +1 -0
  13. package/dist/eslint/checks/font-scale.js +127 -0
  14. package/dist/eslint/checks/font-scale.js.map +1 -0
  15. package/dist/eslint/checks/scan.d.ts +20 -0
  16. package/dist/eslint/checks/scan.d.ts.map +1 -0
  17. package/dist/eslint/checks/scan.js +63 -0
  18. package/dist/eslint/checks/scan.js.map +1 -0
  19. package/dist/eslint/checks/spacing-grid.d.ts +14 -0
  20. package/dist/eslint/checks/spacing-grid.d.ts.map +1 -0
  21. package/dist/eslint/checks/spacing-grid.js +54 -0
  22. package/dist/eslint/checks/spacing-grid.js.map +1 -0
  23. package/dist/eslint/index.d.ts +15 -0
  24. package/dist/eslint/index.d.ts.map +1 -0
  25. package/dist/eslint/index.js +13 -0
  26. package/dist/eslint/index.js.map +1 -0
  27. package/dist/eslint/lint.d.ts +26 -0
  28. package/dist/eslint/lint.d.ts.map +1 -0
  29. package/dist/eslint/lint.js +112 -0
  30. package/dist/eslint/lint.js.map +1 -0
  31. package/dist/eslint/preset.d.ts +11 -0
  32. package/dist/eslint/preset.d.ts.map +1 -0
  33. package/dist/eslint/preset.js +88 -0
  34. package/dist/eslint/preset.js.map +1 -0
  35. package/dist/eslint/rules.d.ts +28 -0
  36. package/dist/eslint/rules.d.ts.map +1 -0
  37. package/dist/eslint/rules.js +441 -0
  38. package/dist/eslint/rules.js.map +1 -0
  39. package/dist/vite-config.d.ts +29 -8
  40. package/dist/vite-config.d.ts.map +1 -1
  41. package/dist/vite-config.js +377 -67
  42. package/dist/vite-config.js.map +1 -1
  43. package/package.json +20 -3
  44. package/schemas/plugin.schema.json +696 -687
@@ -1,687 +1,696 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://embeddesk.app/schemas/plugin.schema.json",
4
- "title": "插件元数据",
5
- "description": "plugin.json 的 JSON Schema——IDE 自动补全 + JSON 校验",
6
- "type": "object",
7
- "required": ["name", "version"],
8
- "properties": {
9
- "$schema": {
10
- "type": "string",
11
- "description": "JSON Schema 引用——IDE 自动补全用",
12
- "$comment": "$schema 仅用于 IDE 自动补全,运行时不做 JSON Schema 验证"
13
- },
14
- "type": {
15
- "type": "string",
16
- "description": "【已废弃】插件类型——不再必需。loader 从 entry/mode/themes/languages/resources 等声明字段自动检测贡献类型。保留仅用于向后兼容。E5.7#66:enum 开放为任意字符串。"
17
- },
18
- "core": {
19
- "type": "boolean",
20
- "description": "核心控制面插件——不可卸载,卸载按钮在 UI 中不显示或禁用。外壳依赖此插件提供基础交互能力(如设置页、插件市场)。无此声明 = 普通插件,用户可自由装卸。默认 false。",
21
- "default": false
22
- },
23
- "factoryRole": {
24
- "type": "string",
25
- "description": "系统插槽角色——声明此插件填充哪个系统级功能。settings=设置页(Ctrl+, 打开),marketplace=插件市场。多个插件声明同一 role → 第一个 core: true 的胜出。"
26
- },
27
- "pluginRole": {
28
- "type": "string",
29
- "description": "插件加载策略——view=有 React UI 组件,data=纯数据(主题/语言/协议),不填则自动推导。E5.7#66:enum 开放——第三方可声明新加载策略名。"
30
- },
31
- "appearsIn": {
32
- "type": "object",
33
- "description": "插件 UI 出现位置——声明式。替代 iconLocation+viewRole+keepSidebarOnFocus。",
34
- "properties": {
35
- "iconBar": { "type": "string", "enum": ["top", "bottom"], "description": "图标栏位置,不填=不显示图标" },
36
- "sidePanel": { "type": "boolean", "description": "有侧栏视图容器,默认 false" },
37
- "tabBar": { "type": "boolean", "description": "可作为标签页打开,默认 false" },
38
- "statusBar": { "type": "boolean", "description": "有状态栏条目,默认 false" }
39
- }
40
- },
41
- "distribution": {
42
- "type": "string",
43
- "enum": ["builtin", "user"],
44
- "default": "user",
45
- "description": "分发渠道——builtin=内置(随安装包分发,放 plugins/builtin/),user=用户安装(放 plugins/user/)。第三方插件不填即可,默认 user"
46
- },
47
- "name": {
48
- "type": "string",
49
- "description": "显示名称",
50
- "minLength": 1
51
- },
52
- "version": {
53
- "type": "string",
54
- "description": "语义化版本",
55
- "pattern": "^\\d+\\.\\d+\\.\\d+$"
56
- },
57
- "icon": {
58
- "type": "string",
59
- "description": "图标标识——codicon 名称或文件路径"
60
- },
61
- "iconSource": {
62
- "type": "string",
63
- "description": "图标来源",
64
- "enum": ["codicon", "svg", "url", "lucide"],
65
- "default": "codicon"
66
- },
67
- "description": {
68
- "type": "string",
69
- "description": "一句话描述,插件详情页展示。支持多行"
70
- },
71
- "author": {
72
- "type": "string",
73
- "description": "作者名"
74
- },
75
- "readme": {
76
- "type": "string",
77
- "description": "附带说明文档路径——相对插件目录(如 \"./README.md\"),可选;.linkdesk-plugin 详情/市场展示数据源(E6#4a K2 缝隙:作者包里有 README.md 就随包,本字段作者填指向包内文件)"
78
- },
79
- "entry": {
80
- "type": "string",
81
- "description": "入口文件路径,相对插件目录。view/card/protocol 必需"
82
- },
83
- "sidebar": {
84
- "type": "string",
85
- "description": "侧栏组件路径,仅 view 类型有效",
86
- "$comment": "由 Vite glob 自动发现,无需插件声明"
87
- },
88
- "tabBehavior": {
89
- "type": "object",
90
- "description": "标签页行为声明——核心读此字段决定去重/保底/关闭确认",
91
- "properties": {
92
- "isFallback": {
93
- "type": "boolean",
94
- "description": "场上无标签页时自动创建此标签页,且不可关闭",
95
- "default": false
96
- },
97
- "singleton": {
98
- "type": "boolean",
99
- "description": "全局只允许一个实例",
100
- "default": false
101
- },
102
- "confirmOnClose": {
103
- "type": "string",
104
- "description": "关闭前弹出确认对话框,值为提示文本"
105
- },
106
- "invokeBeforeClose": {
107
- "type": "string",
108
- "description": "关闭前调用的命令(在 confirmOnClose 确认之后、标签页关闭之前)。如终端声明 \"close_port\""
109
- },
110
- "identityField": {
111
- "type": "string",
112
- "description": "CreateTabOptions 中用于判断标签页身份的唯一字段。不声明=允许多实例不去重。如 workspace 声明 \"workspaceName\"——同名工作台只允许一个标签页。"
113
- }
114
- },
115
- "additionalProperties": false
116
- },
117
- "statusBar": {
118
- "type": "array",
119
- "description": "状态栏贡献条目",
120
- "items": {
121
- "type": "object",
122
- "required": ["id"],
123
- "properties": {
124
- "id": { "type": "string", "description": "唯一标识" },
125
- "icon": { "type": "string", "description": "codicon 名称或 SVG 路径" },
126
- "label": { "type": "string", "description": "显示文字" },
127
- "align": { "type": "string", "enum": ["left", "right"], "default": "left" },
128
- "onClick": { "type": "string", "description": "点击行为——命令名" },
129
- "configurable": { "type": "boolean", "description": "声明 true → 壳自动注册配置项并注入 visible prop。插件作者只写一行 JSON,零代码。", "default": false }
130
- },
131
- "additionalProperties": false
132
- }
133
- },
134
- "file": {
135
- "type": "string",
136
- "description": "单文件入口——theme/language 类型用。和 themes/languages 二选一"
137
- },
138
- "themes": {
139
- "type": "array",
140
- "description": "多主题数组,仅 theme 类型",
141
- "items": {
142
- "type": "object",
143
- "required": ["id", "name", "file"],
144
- "properties": {
145
- "id": { "type": "string" },
146
- "name": { "type": "string" },
147
- "file": { "type": "string" }
148
- },
149
- "additionalProperties": false
150
- }
151
- },
152
- "languages": {
153
- "type": "array",
154
- "description": "多语言数组,仅 language 类型",
155
- "items": {
156
- "type": "object",
157
- "required": ["code", "name", "file"],
158
- "properties": {
159
- "code": { "type": "string" },
160
- "name": { "type": "string" },
161
- "file": { "type": "string" }
162
- },
163
- "additionalProperties": false
164
- }
165
- },
166
- "mode": {
167
- "type": "string",
168
- "description": "协议模式。text = Phase 4 可用;binary = Phase 6+ WASM",
169
- "enum": ["text", "binary"],
170
- "default": "text"
171
- },
172
- "resources": {
173
- "type": "array",
174
- "description": "资源文件列表,仅 resource 类型",
175
- "items": { "type": "string" }
176
- },
177
- "recommends": {
178
- "type": "array",
179
- "description": "推荐同时安装的插件",
180
- "items": {
181
- "type": "object",
182
- "required": ["plugin", "reason"],
183
- "properties": {
184
- "plugin": { "type": "string" },
185
- "reason": { "type": "string" }
186
- },
187
- "additionalProperties": false
188
- }
189
- },
190
- "suggests": {
191
- "type": "array",
192
- "description": "可选相关插件",
193
- "items": {
194
- "type": "object",
195
- "required": ["plugin", "reason"],
196
- "properties": {
197
- "plugin": { "type": "string" },
198
- "reason": { "type": "string" }
199
- },
200
- "additionalProperties": false
201
- }
202
- },
203
- "requires": {
204
- "type": "array",
205
- "description": "插件级激活顺序依赖(E5.8#13)——按 pluginId 声明,加载时先加载依赖再加载本插件。无版本约束。缺依赖 → 插件挂起(PENDING),依赖就绪自动加载。",
206
- "items": { "type": "string" },
207
- "uniqueItems": true
208
- },
209
- "changelog": {
210
- "type": "array",
211
- "description": "更新日志",
212
- "items": {
213
- "type": "object",
214
- "required": ["version", "date"],
215
- "properties": {
216
- "version": { "type": "string" },
217
- "date": { "type": "string" },
218
- "changes": {
219
- "type": "array",
220
- "items": { "type": "string" }
221
- }
222
- },
223
- "additionalProperties": false
224
- }
225
- },
226
- "screenshots": {
227
- "type": "array",
228
- "description": "截图 URL 数组",
229
- "$comment": "Phase 6 PluginDetailView 增强时启用",
230
- "items": { "type": "string" }
231
- },
232
- "minAppVersion": {
233
- "type": "string",
234
- "description": "最低软件版本要求"
235
- },
236
- "docs": {
237
- "type": "string",
238
- "description": "附带文档路径(资源插件联动)",
239
- "$comment": "Phase 6 文档链接"
240
- },
241
- "cardDocMap": {
242
- "type": "object",
243
- "description": "卡片 ID → 文档锚点映射",
244
- "$comment": "Phase 8 卡片文档映射",
245
- "additionalProperties": { "type": "string" }
246
- },
247
- "i18n": {
248
- "type": "object",
249
- "description": "@deprecated 使用 contributes.i18n 代替——翻译文件声明已迁移到 contributes 下。保留仅向后兼容。",
250
- "additionalProperties": { "type": "string" }
251
- },
252
- "cssVars": {
253
- "type": "object",
254
- "description": "插件自定义 CSS 变量",
255
- "$comment": "Phase 7 启用——插件注入 CSS 变量到 :root",
256
- "additionalProperties": {
257
- "type": "object",
258
- "properties": {
259
- "dark": { "type": "string" },
260
- "light": { "type": "string" }
261
- }
262
- }
263
- },
264
- "permissions": {
265
- "type": "array",
266
- "description": "权限声明",
267
- "$comment": "Phase 6 启用——serial/filesystem/network 为第一批白名单值。E5.7#66:enum 开放——第三方可声明新权限名(主进程解释)。",
268
- "items": {
269
- "type": "string"
270
- }
271
- },
272
- "iconLocation": {
273
- "type": "string",
274
- "description": "Phase 5g:图标在图标栏的位置。top(默认,上部可拖拽区)或 bottom(底部固定区)。",
275
- "enum": ["top", "bottom"],
276
- "default": "top"
277
- },
278
- "viewRole": {
279
- "type": "string",
280
- "description": "Phase 5g:视图在壳中的交互角色。sidebarPrimary=侧栏为主(点击 toggle 侧栏,标签页由侧栏内操作触发,默认),tabOnly=纯标签页视图(直接开标签页)。tabPrimary 已移除——所有插件统一 sidebarPrimary。",
281
- "enum": ["sidebarPrimary", "tabOnly"],
282
- "default": "sidebarPrimary"
283
- },
284
- "shellRendered": {
285
- "type": "boolean",
286
- "description": "Phase 5g:壳自己渲染此视图(不走插件路由)。仅欢迎页/插件详情页等壳级视图声明。",
287
- "default": false
288
- },
289
- "keepSidebarOnFocus": {
290
- "type": "boolean",
291
- "description": "Phase 5g:聚焦此视图时保留当前侧栏不清除。如插件详情页浏览时侧栏不变。",
292
- "default": false
293
- },
294
- "contributes": {
295
- "type": "object",
296
- "description": "贡献点声明——对标 VS Code package.json contributes。Phase 5 核心机制。",
297
- "properties": {
298
- "commands": {
299
- "type": "array",
300
- "description": "注册命令——CommandPalette/右键菜单/快捷键的消费源",
301
- "items": {
302
- "type": "object",
303
- "required": ["id", "title"],
304
- "properties": {
305
- "id": { "type": "string", "description": "命令 ID——如 terminal.clear" },
306
- "title": { "type": "string", "description": "显示名称" },
307
- "category": { "type": "string", "description": "命令面板分组" },
308
- "when": { "type": "string", "description": "context key when 条件——如 activeEditor == 'terminal'" }
309
- },
310
- "additionalProperties": false
311
- }
312
- },
313
- "menus": {
314
- "type": "object",
315
- "description": "菜单项声明——按 MenuId 分组。壳内置注册点见 MenuRegistry MENU_SLOTS 常量表;E5.7#64 起 MenuId 开放字符串,第三方可声明任意新注册点(propertyNames enum 已删)。",
316
- "additionalProperties": {
317
- "type": "array",
318
- "items": {
319
- "oneOf": [
320
- { "type": "string", "description": "命令 ID(简写)" },
321
- { "$ref": "#/$defs/menuItem" }
322
- ]
323
- }
324
- }
325
- },
326
- "keybindings": {
327
- "type": "array",
328
- "description": "快捷键绑定",
329
- "items": {
330
- "type": "object",
331
- "required": ["command", "key"],
332
- "properties": {
333
- "command": { "type": "string" },
334
- "key": { "type": "string", "description": "如 ctrl+k" },
335
- "when": { "type": "string", "description": "context key when 条件" }
336
- },
337
- "additionalProperties": false
338
- }
339
- },
340
- "configuration": {
341
- "type": "object",
342
- "description": "设置项声明——Settings Editor 自动渲染",
343
- "required": ["title", "properties"],
344
- "properties": {
345
- "title": { "type": "string", "description": "设置分组名" },
346
- "properties": {
347
- "type": "object",
348
- "description": "设置项映射——key → { type, default, enum?, description }",
349
- "additionalProperties": {
350
- "type": "object",
351
- "required": ["type", "default", "description"],
352
- "properties": {
353
- "type": { "type": "string", "enum": ["string", "number", "boolean", "object", "array"] },
354
- "default": {},
355
- "enum": { "type": "array" },
356
- "enumDescriptions": { "type": "object", "description": "enum 值 → 显示名映射" },
357
- "description": { "type": "string" },
358
- "uiHint": { "type": "string", "description": "设置编辑器渲染提示。SettingsView 按提示选择控件。不认识的 hint 降级回 type 默认渲染——不抛错。E5.7#66:enum 开放——第三方可声明新 hint 名。" },
359
- "monoOnly": { "type": "boolean", "description": "等宽限定——仅 uiHint \"fontFamily\" 有意义。true/缺省 = 只列等宽族(编辑器字体);false = 全字族(UI 字体)。E5.8#50.20。" },
360
- "minimum": { "type": "number", "description": "数值下限——type number 时生效(E5.8#65 补录:滑杆/数值控件范围)" },
361
- "maximum": { "type": "number", "description": "数值上限——type number 时生效(E5.8#65 补录:滑杆/数值控件范围)" },
362
- "step": { "type": "number", "description": "滑杆步进——仅 uiHint \"slider\" 有意义。缺省由 SettingsView 按区间推导(浮点区间自动 0.01)。E5.8#65。" },
363
- "group": { "type": "string", "description": "组内二级标题——同 group key 在设置页归到子标题下渲染(E5.8#78/#189);无 group 保持平铺(第三方零侵入)" }
364
- },
365
- "additionalProperties": false
366
- }
367
- }
368
- },
369
- "additionalProperties": false
370
- },
371
- "configurationDefaults": {
372
- "type": "object",
373
- "description": "弱默认值——插件给其他配置项的建议值,用户手动设置优先",
374
- "additionalProperties": {}
375
- },
376
- "themes": {
377
- "type": "array",
378
- "description": "主题声明——对标 VS Code contributes.themes。插件贡献主题供用户在主题浏览器/外观中切换。",
379
- "items": {
380
- "type": "object",
381
- "required": ["id", "label", "uiTheme", "path"],
382
- "properties": {
383
- "id": { "type": "string", "description": "主题 ID——如 my-theme-dark" },
384
- "label": { "type": "string", "description": "显示名称——如 My Theme Dark" },
385
- "uiTheme": { "type": "string", "enum": ["dark", "light", "highContrast"], "description": "基础 UI 主题——暗色/亮色/高对比" },
386
- "path": { "type": "string", "description": "主题定义 JSON 文件路径" }
387
- },
388
- "additionalProperties": false
389
- }
390
- },
391
- "iconThemes": {
392
- "type": "array",
393
- "description": "产品图标主题——对标 VS Code productIconThemes。插件声明图标集供用户切换。",
394
- "items": {
395
- "type": "object",
396
- "required": ["id", "label", "path"],
397
- "properties": {
398
- "id": { "type": "string", "description": "图标主题 ID——如 codicon" },
399
- "label": { "type": "string", "description": "显示名称——如 Codicon" },
400
- "path": { "type": "string", "description": "图标定义 JSON 文件路径" }
401
- },
402
- "additionalProperties": false
403
- }
404
- },
405
- "icons": {
406
- "type": "object",
407
- "description": "共享图标——插件贡献图标供其他插件通过 iconSource:shared 引用。对标 VS Code icon extension point。",
408
- "additionalProperties": {
409
- "type": "object",
410
- "required": ["description", "default"],
411
- "properties": {
412
- "description": { "type": "string", "description": "图标描述" },
413
- "default": {
414
- "type": "object",
415
- "properties": {
416
- "fontPath": { "type": "string", "description": "字体文件路径" },
417
- "fontCharacter": { "type": "string", "description": "字体字符码——如 \\e001" }
418
- },
419
- "additionalProperties": false
420
- }
421
- },
422
- "additionalProperties": false
423
- }
424
- },
425
- "langDefs": {
426
- "type": "array",
427
- "description": "编程语言定义——对标 VS Code contributes.languages。声明新语言的 ID/扩展名/语法高亮/LSP 支持。",
428
- "items": {
429
- "type": "object",
430
- "required": ["id", "extensions"],
431
- "properties": {
432
- "id": { "type": "string", "description": "语言 ID——如 cpp / python / rust" },
433
- "extensions": { "type": "array", "items": { "type": "string" }, "description": "扩展名列表——如 ['.cpp', '.cxx', '.h']" },
434
- "aliases": { "type": "array", "items": { "type": "string" }, "description": "别名——如 ['C++', 'C']" },
435
- "monarch": {
436
- "type": "object",
437
- "description": "可选——Monarch tokenizer 定义(Monaco 内建语法高亮)",
438
- "properties": {
439
- "tokenizer": { "type": "object" }
440
- }
441
- },
442
- "lsp": {
443
- "type": "object",
444
- "description": "可选——LSP 语言服务器配置",
445
- "properties": {
446
- "command": { "type": "string", "description": "启动命令——如 node_modules/pyright/dist/pyright-langserver.js --stdio" },
447
- "args": { "type": "array", "items": { "type": "string" }, "description": "启动参数" }
448
- }
449
- }
450
- },
451
- "additionalProperties": false
452
- }
453
- },
454
- "fileAssociations": {
455
- "type": "array",
456
- "description": "文件关联——文件扩展名 → 插件路由(主进程 plugin-manifest-loader 消费,E5.7#50 壳侧注册已删)。只声明扩展名 + 可选打开命令;pluginId 用目录名,无需声明。",
457
- "items": {
458
- "type": "object",
459
- "required": ["extension"],
460
- "properties": {
461
- "extension": { "type": "string", "description": "文件扩展名——不含点,如 dxf / stl / step" },
462
- "command": { "type": "string", "description": "可选——打开该扩展名文件时执行的命令 ID" },
463
- "displayName": { "type": "string", "description": "可选——'打开方式…'选择器中的显示名" }
464
- },
465
- "additionalProperties": false
466
- }
467
- },
468
- "languages": {
469
- "type": "array",
470
- "description": "语言包——对标 VS Code language extension point。合集语言包一个 plugin.json 声明多个条目。",
471
- "items": {
472
- "type": "object",
473
- "required": ["id", "label", "path"],
474
- "properties": {
475
- "id": { "type": "string", "description": "语言代码——如 zh / en / ja" },
476
- "label": { "type": "string", "description": "显示名称——如 中文 / English / 日本語" },
477
- "path": { "type": "string", "description": "i18n JSON 翻译文件路径" }
478
- },
479
- "additionalProperties": false
480
- }
481
- },
482
- "titleBar": {
483
- "type": "object",
484
- "description": "顶栏按钮声明——对标 VS Code titleBar。声明标题栏左侧/右侧的图标按钮。",
485
- "properties": {
486
- "left": {
487
- "type": "array",
488
- "description": "标题栏左侧按钮",
489
- "items": {
490
- "type": "object",
491
- "required": ["command"],
492
- "properties": {
493
- "command": { "type": "string", "description": "点击执行的命令 ID" },
494
- "icon": { "type": "string", "description": "codicon 图标名(如 codicon-settings)或图片路径" },
495
- "when": { "type": "string", "description": "context key when 条件——不满足时按钮隐藏" }
496
- },
497
- "additionalProperties": false
498
- }
499
- },
500
- "right": {
501
- "type": "array",
502
- "description": "标题栏右侧按钮",
503
- "items": {
504
- "type": "object",
505
- "required": ["command"],
506
- "properties": {
507
- "command": { "type": "string", "description": "点击执行的命令 ID" },
508
- "icon": { "type": "string", "description": "codicon 图标名(如 codicon-settings)或图片路径" },
509
- "when": { "type": "string", "description": "context key when 条件——不满足时按钮隐藏" }
510
- },
511
- "additionalProperties": false
512
- }
513
- }
514
- },
515
- "additionalProperties": false
516
- },
517
- "viewsContainers": {
518
- "type": "object",
519
- "description": "声明侧栏容器——点此插件图标时切换到此容器。对标 VS Code viewsContainers。",
520
- "patternProperties": {
521
- "^[a-z][a-z0-9-]*$": {
522
- "type": "object",
523
- "required": ["title"],
524
- "properties": {
525
- "title": { "type": "string", "description": "容器标题——侧栏 header 显示" },
526
- "icon": { "type": "string", "description": "容器图标——覆盖插件自身的图标" },
527
- "location": {
528
- "type": "string",
529
- "enum": ["sidebar", "panel", "auxiliarybar"],
530
- "default": "sidebar",
531
- "description": "容器位置——sidebar=侧栏, panel=底部面板, auxiliarybar=辅助侧栏"
532
- },
533
- "hideIfEmpty": {
534
- "type": "boolean",
535
- "default": false,
536
- "description": "无活跃 view 时自动隐藏容器"
537
- },
538
- "order": {
539
- "type": "number",
540
- "description": "同位置内的排序权重。小值靠前"
541
- },
542
- "mergeHeaderWhenSingle": {
543
- "type": "boolean",
544
- "default": false,
545
- "description": "容器内只有一个 view 时隐藏 view header——标题合并到容器 header。对标 VS Code mergeViewWithContainerWhenSingleView"
546
- }
547
- },
548
- "additionalProperties": false
549
- }
550
- },
551
- "additionalProperties": false
552
- },
553
- "views": {
554
- "type": "object",
555
- "description": "往容器注册视图——key = 容器 ID。对标 VS Code views。",
556
- "patternProperties": {
557
- "^[a-z][a-z0-9-]*$": {
558
- "type": "array",
559
- "items": {
560
- "type": "object",
561
- "required": ["id", "render"],
562
- "properties": {
563
- "id": { "type": "string", "description": "View 唯一 ID——如 folders / sessions / settings" },
564
- "title": { "type": "string", "description": "显示标题——SidebarSection 的 header 文字。空字符串=不显示折叠头" },
565
- "render": { "type": "string", "description": "视图组件的模块路径——相对插件根目录" },
566
- "when": { "type": "string", "description": "Context key when 条件" },
567
- "order": { "type": "number", "description": "同容器内的排序权重。小值在上" },
568
- "role": { "type": "string", "enum": ["toolbar", "section"], "default": "section", "description": "容器角色——toolbar 粘顶不被覆盖,section 有折叠头同级替换" },
569
- "collapsed": { "type": "boolean", "default": false, "description": "初始折叠状态" },
570
- "canToggleVisibility": { "type": "boolean", "default": true, "description": "用户可通过 Views 子菜单切换可见性" },
571
- "canMoveView": { "type": "boolean", "default": true, "description": "用户可将此 view 移到其他容器" },
572
- "hideByDefault": { "type": "boolean", "default": false, "description": "默认隐藏——用户需手动从 Views 菜单开启" },
573
- "singleViewPaneContainerTitle": { "type": "string", "description": " view 且容器 mergeHeaderWhenSingle 时替代容器 title" },
574
- "titleDescription": { "type": "string", "description": "标题旁的副文字——如 (5 files)" },
575
- "showActions": {
576
- "type": "string",
577
- "enum": ["always", "whenExpanded", "default"],
578
- "default": "default",
579
- "description": "actions 显隐时机——always=始终, whenExpanded=展开时, default=hover 显示"
580
- },
581
- "titleTooltip": { "type": "string", "description": "标题 hover tooltip——标题截断时显示完整文字" },
582
- "titleActions": {
583
- "type": "array",
584
- "description": "视图动作区声明(E5.8#36.5)——面板标签栏/侧栏 header 右侧 widget 列表,随视图走随视图迁移。三形态:icon 按钮 / dropdown 下拉菜单 / split 主按钮+下拉复合(VS Code 终端 [+] 新建 + [▾] 配置文件列表同款)。动作 = command + args,label/title 为 i18n key(中文原文)。",
585
- "items": {
586
- "type": "object",
587
- "required": ["type", "id"],
588
- "properties": {
589
- "type": { "type": "string", "enum": ["icon", "dropdown", "split"], "description": "widget 形态" },
590
- "id": { "type": "string", "description": "widget 唯一 ID——React key / 下拉展开状态定位" },
591
- "command": { "type": "string", "description": "点击执行的命令 ID(split=主按钮默认动作 / icon 必填)" },
592
- "icon": { "type": "string", "description": "codicon 类名(如 codicon-add)——icon/split 主按钮图标" },
593
- "title": { "type": "string", "description": "tooltip / aria-label——i18n key(split icon 时作文本按钮)" },
594
- "args": { "description": "命令参数——executeCommand(command, args) 单个位置参数透传(JSON 可序列化)" },
595
- "items": {
596
- "type": "array",
597
- "description": "dropdown / split 下拉条目",
598
- "items": {
599
- "type": "object",
600
- "required": ["label", "command"],
601
- "properties": {
602
- "label": { "type": "string", "description": "显示文本——i18n key(中文原文)" },
603
- "command": { "type": "string", "description": "点击执行的命令 ID" },
604
- "args": { "description": "命令参数——单个位置参数透传" }
605
- }
606
- }
607
- }
608
- }
609
- }
610
- }
611
- },
612
- "additionalProperties": false
613
- }
614
- }
615
- },
616
- "additionalProperties": false
617
- },
618
- "floatingPanel": {
619
- "type": "object",
620
- "description": "悬浮面板声明(E5.8#39.5)——声明 contributes.views 中某视图可在壳内悬浮面板显示(类型 B)。viewId 必须引用已注册视图——声明寻址解析出 pluginId/renderPath/title;未声明则无「在悬浮面板中打开」右键入口(I8-3 声明即出现)。首批声明者 = settings(#38 Ctrl+, 弹面板)。",
621
- "required": ["viewId"],
622
- "properties": {
623
- "viewId": { "type": "string", "description": "视图 ID——contributes.views 已注册视图" }
624
- },
625
- "additionalProperties": false
626
- },
627
- "i18n": {
628
- "type": "object",
629
- "description": "插件自带翻译——key=语言代码, value=相对插件根目录的 JSON 文件路径。如 { \"en\": \"i18n/en.json\" }。不需要 zh.json——中文 key 自带兜底。",
630
- "additionalProperties": { "type": "string" }
631
- }
632
- },
633
- "additionalProperties": false
634
- }
635
- },
636
- "$defs": {
637
- "menuItem": {
638
- "type": "object",
639
- "required": ["command"],
640
- "description": "菜单项——与运行时 ManifestMenuItem(MenuRegistry)对齐(E5.8#149 声明式 schema 唯一缺口补齐:label/order/children 递归自引用)。children 任意深度递归,与运行时归一一对一。",
641
- "properties": {
642
- "command": { "type": "string", "description": "命令 ID(有 children 时可为空——父菜单项不执行命令,展开子菜单)" },
643
- "label": { "type": "string", "description": "显示标签——有值时覆盖命令标题(getCommand(id).title);父菜单项(无 command)必填" },
644
- "group": { "type": "string", "description": "分组——navigation/edit/terminal/delete/split" },
645
- "when": { "type": "string", "description": "context key when 条件" },
646
- "order": { "type": "number", "description": "排序权重——同 group 内越小越靠前(E5.8#33)" },
647
- "children": {
648
- "type": "array",
649
- "description": "嵌套子菜单——任意深度递归(对标 VS Code SubmenuAction,E5.8#148/#149);有 children command 可为空",
650
- "items": { "$ref": "#/$defs/menuItem" }
651
- }
652
- },
653
- "additionalProperties": false
654
- }
655
- },
656
- "allOf": [
657
- {
658
- "$comment": "entry 条件(废弃 type 系)——if 必须带 required:[\"type\"],否则对缺 type 的 theme/language 等数据插件空真(properties 只验在场属性)→ 误强 entry(E6#5 SDK validate 冒烟实证 2026-09-04)。type 在场且命中 const 才强制 entry。",
659
- "if": {
660
- "required": ["type"],
661
- "properties": { "type": { "const": "view" } }
662
- },
663
- "then": {
664
- "required": ["entry"]
665
- }
666
- },
667
- {
668
- "if": {
669
- "required": ["type"],
670
- "properties": { "type": { "const": "card" } }
671
- },
672
- "then": {
673
- "required": ["entry"]
674
- }
675
- },
676
- {
677
- "if": {
678
- "required": ["type"],
679
- "properties": { "type": { "const": "protocol" } }
680
- },
681
- "then": {
682
- "required": ["entry"]
683
- }
684
- }
685
- ],
686
- "additionalProperties": true
687
- }
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://embeddesk.app/schemas/plugin.schema.json",
4
+ "title": "插件元数据",
5
+ "description": "plugin.json 的 JSON Schema——IDE 自动补全 + JSON 校验",
6
+ "type": "object",
7
+ "required": ["name", "version"],
8
+ "properties": {
9
+ "$schema": {
10
+ "type": "string",
11
+ "description": "JSON Schema 引用——IDE 自动补全用",
12
+ "$comment": "$schema 仅用于 IDE 自动补全,运行时不做 JSON Schema 验证"
13
+ },
14
+ "type": {
15
+ "type": "string",
16
+ "description": "【已废弃】插件类型——不再必需。loader 从 entry/mode/themes/languages/resources 等声明字段自动检测贡献类型。保留仅用于向后兼容。E5.7#66:enum 开放为任意字符串。"
17
+ },
18
+ "core": {
19
+ "type": "boolean",
20
+ "description": "核心控制面插件——不可卸载,卸载按钮在 UI 中不显示或禁用。外壳依赖此插件提供基础交互能力(如设置页、插件市场)。无此声明 = 普通插件,用户可自由装卸。默认 false。",
21
+ "default": false
22
+ },
23
+ "factoryRole": {
24
+ "type": "string",
25
+ "description": "系统插槽角色——声明此插件填充哪个系统级功能。settings=设置页(Ctrl+, 打开),marketplace=插件市场。多个插件声明同一 role → 第一个 core: true 的胜出。"
26
+ },
27
+ "pluginRole": {
28
+ "type": "string",
29
+ "description": "插件加载策略——view=有 React UI 组件,data=纯数据(主题/语言/协议),不填则自动推导。E5.7#66:enum 开放——第三方可声明新加载策略名。"
30
+ },
31
+ "appearsIn": {
32
+ "type": "object",
33
+ "description": "插件 UI 出现位置——声明式。替代 iconLocation+viewRole+keepSidebarOnFocus。",
34
+ "properties": {
35
+ "iconBar": { "type": "string", "enum": ["top", "bottom"], "description": "图标栏位置,不填=不显示图标" },
36
+ "sidePanel": { "type": "boolean", "description": "有侧栏视图容器,默认 false" },
37
+ "tabBar": { "type": "boolean", "description": "可作为标签页打开,默认 false" },
38
+ "statusBar": { "type": "boolean", "description": "有状态栏条目,默认 false" }
39
+ }
40
+ },
41
+ "distribution": {
42
+ "type": "string",
43
+ "enum": ["builtin", "user"],
44
+ "default": "user",
45
+ "description": "⚠️ 遗留字段(2026-09-05 塌平单根后已无 plugins/builtinplugins/user 之分——本字段不再对应任何目录,安装侧恒归一化为 user)。内置随带与否由 `core` 声明,与分发字段无关。第三方插件请勿填写。"
46
+ },
47
+ "name": {
48
+ "type": "string",
49
+ "description": "显示名称",
50
+ "minLength": 1
51
+ },
52
+ "version": {
53
+ "type": "string",
54
+ "description": "语义化版本",
55
+ "pattern": "^\\d+\\.\\d+\\.\\d+$"
56
+ },
57
+ "icon": {
58
+ "type": "string",
59
+ "description": "图标标识——codicon 名称或文件路径"
60
+ },
61
+ "iconSource": {
62
+ "type": "string",
63
+ "description": "图标来源",
64
+ "enum": ["codicon", "svg", "url", "lucide"],
65
+ "default": "codicon"
66
+ },
67
+ "description": {
68
+ "type": "string",
69
+ "description": "一句话描述,插件详情页展示。支持多行"
70
+ },
71
+ "author": {
72
+ "type": "string",
73
+ "description": "作者名"
74
+ },
75
+ "readme": {
76
+ "type": "string",
77
+ "description": "附带说明文档路径——相对插件目录(如 \"./README.md\"),可选;.linkdesk-plugin 详情/市场展示数据源(E6#4a K2 缝隙:作者包里有 README.md 就随包,本字段作者填指向包内文件)"
78
+ },
79
+ "entry": {
80
+ "type": "string",
81
+ "description": "入口文件路径,相对插件目录。view/card/protocol 必需"
82
+ },
83
+ "sidebar": {
84
+ "type": "string",
85
+ "description": "侧栏组件路径,仅 view 类型有效",
86
+ "$comment": "由 Vite glob 自动发现,无需插件声明"
87
+ },
88
+ "tabBehavior": {
89
+ "type": "object",
90
+ "description": "标签页行为声明——核心读此字段决定去重/保底/关闭确认",
91
+ "properties": {
92
+ "isFallback": {
93
+ "type": "boolean",
94
+ "description": "场上无标签页时自动创建此标签页,且不可关闭",
95
+ "default": false
96
+ },
97
+ "singleton": {
98
+ "type": "boolean",
99
+ "description": "全局只允许一个实例",
100
+ "default": false
101
+ },
102
+ "confirmOnClose": {
103
+ "type": "string",
104
+ "description": "关闭前弹出确认对话框,值为提示文本"
105
+ },
106
+ "invokeBeforeClose": {
107
+ "type": "string",
108
+ "description": "关闭前调用的命令(在 confirmOnClose 确认之后、标签页关闭之前)。如终端声明 \"close_port\""
109
+ },
110
+ "identityField": {
111
+ "type": "string",
112
+ "description": "CreateTabOptions 中用于判断标签页身份的唯一字段。不声明=允许多实例不去重。如 workspace 声明 \"workspaceName\"——同名工作台只允许一个标签页。"
113
+ }
114
+ },
115
+ "additionalProperties": false
116
+ },
117
+ "statusBar": {
118
+ "type": "array",
119
+ "description": "状态栏贡献条目",
120
+ "items": {
121
+ "type": "object",
122
+ "required": ["id"],
123
+ "properties": {
124
+ "id": { "type": "string", "description": "唯一标识" },
125
+ "icon": { "type": "string", "description": "codicon 名称或 SVG 路径" },
126
+ "label": { "type": "string", "description": "显示文字" },
127
+ "align": { "type": "string", "enum": ["left", "right"], "default": "left" },
128
+ "onClick": { "type": "string", "description": "点击行为——命令名" },
129
+ "configurable": { "type": "boolean", "description": "声明 true → 壳自动注册配置项并注入 visible prop。插件作者只写一行 JSON,零代码。", "default": false }
130
+ },
131
+ "additionalProperties": false
132
+ }
133
+ },
134
+ "file": {
135
+ "type": "string",
136
+ "description": "单文件入口——theme/language 类型用。和 themes/languages 二选一"
137
+ },
138
+ "themes": {
139
+ "type": "array",
140
+ "description": "多主题数组,仅 theme 类型",
141
+ "items": {
142
+ "type": "object",
143
+ "required": ["id", "name", "file"],
144
+ "properties": {
145
+ "id": { "type": "string" },
146
+ "name": { "type": "string" },
147
+ "file": { "type": "string" }
148
+ },
149
+ "additionalProperties": false
150
+ }
151
+ },
152
+ "languages": {
153
+ "type": "array",
154
+ "description": "多语言数组,仅 language 类型",
155
+ "items": {
156
+ "type": "object",
157
+ "required": ["code", "name", "file"],
158
+ "properties": {
159
+ "code": { "type": "string" },
160
+ "name": { "type": "string" },
161
+ "file": { "type": "string" }
162
+ },
163
+ "additionalProperties": false
164
+ }
165
+ },
166
+ "mode": {
167
+ "type": "string",
168
+ "description": "协议模式。text = Phase 4 可用;binary = Phase 6+ WASM",
169
+ "enum": ["text", "binary"],
170
+ "default": "text"
171
+ },
172
+ "resources": {
173
+ "type": "array",
174
+ "description": "资源文件列表,仅 resource 类型",
175
+ "items": { "type": "string" }
176
+ },
177
+ "recommends": {
178
+ "type": "array",
179
+ "description": "推荐同时安装的插件",
180
+ "items": {
181
+ "type": "object",
182
+ "required": ["plugin", "reason"],
183
+ "properties": {
184
+ "plugin": { "type": "string" },
185
+ "reason": { "type": "string" }
186
+ },
187
+ "additionalProperties": false
188
+ }
189
+ },
190
+ "suggests": {
191
+ "type": "array",
192
+ "description": "可选相关插件",
193
+ "items": {
194
+ "type": "object",
195
+ "required": ["plugin", "reason"],
196
+ "properties": {
197
+ "plugin": { "type": "string" },
198
+ "reason": { "type": "string" }
199
+ },
200
+ "additionalProperties": false
201
+ }
202
+ },
203
+ "requires": {
204
+ "type": "array",
205
+ "description": "插件级激活顺序依赖(E5.8#13)——按 pluginId 声明,加载时先加载依赖再加载本插件。无版本约束。缺依赖 → 插件挂起(PENDING),依赖就绪自动加载。",
206
+ "items": { "type": "string" },
207
+ "uniqueItems": true
208
+ },
209
+ "changelog": {
210
+ "type": "array",
211
+ "description": "更新日志",
212
+ "items": {
213
+ "type": "object",
214
+ "required": ["version", "date"],
215
+ "properties": {
216
+ "version": { "type": "string" },
217
+ "date": { "type": "string" },
218
+ "changes": {
219
+ "type": "array",
220
+ "items": { "type": "string" }
221
+ }
222
+ },
223
+ "additionalProperties": false
224
+ }
225
+ },
226
+ "screenshots": {
227
+ "type": "array",
228
+ "description": "截图 URL 数组",
229
+ "$comment": "Phase 6 PluginDetailView 增强时启用",
230
+ "items": { "type": "string" }
231
+ },
232
+ "minAppVersion": {
233
+ "type": "string",
234
+ "description": "最低软件版本要求"
235
+ },
236
+ "activationEvents": {
237
+ "type": "array",
238
+ "description": "激活事件——对标 VS Code activationEvents。空或含 \"*\" = 启动时立即加载。具体事件(canonical 无前导点):onCommand:id / onFileOpen:ext / onLanguage:ext / onPortOpen / onView:containerId。未写此字段 → 壳按 contributes 自动推断(fileAssociations→onLanguage / views→onView / commands→onCommand),写了则显式优先。延迟插件启动只注册元数据,首用事件才加载 JS。",
239
+ "items": { "type": "string" }
240
+ },
241
+ "docs": {
242
+ "type": "string",
243
+ "description": "附带文档路径(资源插件联动)",
244
+ "$comment": "Phase 6 文档链接"
245
+ },
246
+ "cardDocMap": {
247
+ "type": "object",
248
+ "description": "卡片 ID → 文档锚点映射",
249
+ "$comment": "Phase 8 卡片文档映射",
250
+ "additionalProperties": { "type": "string" }
251
+ },
252
+ "i18n": {
253
+ "type": "object",
254
+ "description": "@deprecated 使用 contributes.i18n 代替——翻译文件声明已迁移到 contributes 下。保留仅向后兼容。",
255
+ "additionalProperties": { "type": "string" }
256
+ },
257
+ "cssVars": {
258
+ "type": "object",
259
+ "description": "插件自定义 CSS 变量",
260
+ "$comment": "Phase 7 启用——插件注入 CSS 变量到 :root",
261
+ "additionalProperties": {
262
+ "type": "object",
263
+ "properties": {
264
+ "dark": { "type": "string" },
265
+ "light": { "type": "string" }
266
+ }
267
+ }
268
+ },
269
+ "permissions": {
270
+ "type": "array",
271
+ "description": "权限声明",
272
+ "$comment": "Phase 6 启用——serial/filesystem/network 为第一批白名单值。E5.7#66:enum 开放——第三方可声明新权限名(主进程解释)。",
273
+ "items": {
274
+ "type": "string"
275
+ }
276
+ },
277
+ "iconLocation": {
278
+ "type": "string",
279
+ "description": "Phase 5g:图标在图标栏的位置。top(默认,上部可拖拽区)或 bottom(底部固定区)。",
280
+ "enum": ["top", "bottom"],
281
+ "default": "top"
282
+ },
283
+ "viewRole": {
284
+ "type": "string",
285
+ "description": "Phase 5g:视图在壳中的交互角色。sidebarPrimary=侧栏为主(点击 toggle 侧栏,标签页由侧栏内操作触发,默认),tabOnly=纯标签页视图(直接开标签页)。tabPrimary 已移除——所有插件统一 sidebarPrimary。",
286
+ "enum": ["sidebarPrimary", "tabOnly"],
287
+ "default": "sidebarPrimary"
288
+ },
289
+ "shellRendered": {
290
+ "type": "boolean",
291
+ "description": "Phase 5g:壳自己渲染此视图(不走插件路由)。仅欢迎页/插件详情页等壳级视图声明。",
292
+ "default": false
293
+ },
294
+ "keepSidebarOnFocus": {
295
+ "type": "boolean",
296
+ "description": "Phase 5g:聚焦此视图时保留当前侧栏不清除。如插件详情页浏览时侧栏不变。",
297
+ "default": false
298
+ },
299
+ "contributes": {
300
+ "type": "object",
301
+ "description": "贡献点声明——对标 VS Code package.json contributes。Phase 5 核心机制。",
302
+ "properties": {
303
+ "commands": {
304
+ "type": "array",
305
+ "description": "注册命令——CommandPalette/右键菜单/快捷键的消费源",
306
+ "items": {
307
+ "type": "object",
308
+ "required": ["id", "title"],
309
+ "properties": {
310
+ "id": { "type": "string", "description": "命令 ID——如 terminal.clear" },
311
+ "title": { "type": "string", "description": "显示名称" },
312
+ "category": { "type": "string", "description": "命令面板分组" },
313
+ "when": { "type": "string", "description": "context key when 条件——如 activeEditor == 'terminal'" }
314
+ },
315
+ "additionalProperties": false
316
+ }
317
+ },
318
+ "menus": {
319
+ "type": "object",
320
+ "description": "菜单项声明——按 MenuId 分组。壳内置注册点见 MenuRegistry MENU_SLOTS 常量表;E5.7#64 起 MenuId 开放字符串,第三方可声明任意新注册点(propertyNames enum 已删)。",
321
+ "additionalProperties": {
322
+ "type": "array",
323
+ "items": {
324
+ "oneOf": [
325
+ { "type": "string", "description": "命令 ID(简写)" },
326
+ { "$ref": "#/$defs/menuItem" }
327
+ ]
328
+ }
329
+ }
330
+ },
331
+ "keybindings": {
332
+ "type": "array",
333
+ "description": "快捷键绑定",
334
+ "items": {
335
+ "type": "object",
336
+ "required": ["command", "key"],
337
+ "properties": {
338
+ "command": { "type": "string" },
339
+ "key": { "type": "string", "description": "如 ctrl+k" },
340
+ "when": { "type": "string", "description": "context key when 条件" }
341
+ },
342
+ "additionalProperties": false
343
+ }
344
+ },
345
+ "configuration": {
346
+ "type": "object",
347
+ "description": "设置项声明——Settings Editor 自动渲染",
348
+ "required": ["title", "properties"],
349
+ "properties": {
350
+ "title": { "type": "string", "description": "设置分组名" },
351
+ "properties": {
352
+ "type": "object",
353
+ "description": "设置项映射——key { type, default, enum?, description }",
354
+ "additionalProperties": {
355
+ "type": "object",
356
+ "required": ["type", "default", "description"],
357
+ "properties": {
358
+ "type": { "type": "string", "enum": ["string", "number", "boolean", "object", "array"] },
359
+ "default": {},
360
+ "enum": { "type": "array" },
361
+ "enumDescriptions": { "type": "object", "description": "enum 显示名映射" },
362
+ "description": { "type": "string" },
363
+ "uiHint": { "type": "string", "description": "设置编辑器渲染提示。SettingsView 按提示选择控件。不认识的 hint 降级回 type 默认渲染——不抛错。E5.7#66:enum 开放——第三方可声明新 hint 名。" },
364
+ "monoOnly": { "type": "boolean", "description": "等宽限定——仅 uiHint \"fontFamily\" 有意义。true/缺省 = 只列等宽族(编辑器字体);false = 全字族(UI 字体)。E5.8#50.20。" },
365
+ "minimum": { "type": "number", "description": "数值下限——type number 时生效(E5.8#65 补录:滑杆/数值控件范围)" },
366
+ "maximum": { "type": "number", "description": "数值上限——type number 时生效(E5.8#65 补录:滑杆/数值控件范围)" },
367
+ "step": { "type": "number", "description": "滑杆步进——仅 uiHint \"slider\" 有意义。缺省由 SettingsView 按区间推导(浮点区间自动 0.01)。E5.8#65。" },
368
+ "group": { "type": "string", "description": "组内二级标题——同 group 的 key 在设置页归到子标题下渲染(E5.8#78/#189);无 group 保持平铺(第三方零侵入)" }
369
+ },
370
+ "additionalProperties": false
371
+ }
372
+ }
373
+ },
374
+ "additionalProperties": false
375
+ },
376
+ "configurationDefaults": {
377
+ "type": "object",
378
+ "description": "弱默认值——插件给其他配置项的建议值,用户手动设置优先",
379
+ "additionalProperties": {}
380
+ },
381
+ "themes": {
382
+ "type": "array",
383
+ "description": "主题声明——对标 VS Code contributes.themes。插件贡献主题供用户在主题浏览器/外观中切换。",
384
+ "items": {
385
+ "type": "object",
386
+ "required": ["id", "label", "uiTheme", "path"],
387
+ "properties": {
388
+ "id": { "type": "string", "description": "主题 ID——如 my-theme-dark" },
389
+ "label": { "type": "string", "description": "显示名称——如 My Theme Dark" },
390
+ "uiTheme": { "type": "string", "enum": ["dark", "light", "highContrast"], "description": "基础 UI 主题——暗色/亮色/高对比" },
391
+ "path": { "type": "string", "description": "主题定义 JSON 文件路径" }
392
+ },
393
+ "additionalProperties": false
394
+ }
395
+ },
396
+ "iconThemes": {
397
+ "type": "array",
398
+ "description": "产品图标主题——对标 VS Code productIconThemes。插件声明图标集供用户切换。",
399
+ "items": {
400
+ "type": "object",
401
+ "required": ["id", "label", "path"],
402
+ "properties": {
403
+ "id": { "type": "string", "description": "图标主题 ID——如 codicon" },
404
+ "label": { "type": "string", "description": "显示名称——如 Codicon" },
405
+ "path": { "type": "string", "description": "图标定义 JSON 文件路径" }
406
+ },
407
+ "additionalProperties": false
408
+ }
409
+ },
410
+ "icons": {
411
+ "type": "object",
412
+ "description": "共享图标——插件贡献图标供其他插件通过 iconSource:shared 引用。对标 VS Code icon extension point。",
413
+ "additionalProperties": {
414
+ "type": "object",
415
+ "required": ["description", "default"],
416
+ "properties": {
417
+ "description": { "type": "string", "description": "图标描述" },
418
+ "default": {
419
+ "type": "object",
420
+ "properties": {
421
+ "fontPath": { "type": "string", "description": "字体文件路径" },
422
+ "fontCharacter": { "type": "string", "description": "字体字符码——如 \\e001" }
423
+ },
424
+ "additionalProperties": false
425
+ }
426
+ },
427
+ "additionalProperties": false
428
+ }
429
+ },
430
+ "langDefs": {
431
+ "type": "array",
432
+ "description": "编程语言定义——对标 VS Code contributes.languages。声明新语言的 ID/扩展名/语法高亮/LSP 支持。",
433
+ "items": {
434
+ "type": "object",
435
+ "required": ["id", "extensions"],
436
+ "properties": {
437
+ "id": { "type": "string", "description": "语言 ID——如 cpp / python / rust" },
438
+ "extensions": { "type": "array", "items": { "type": "string" }, "description": "扩展名列表——如 ['.cpp', '.cxx', '.h']" },
439
+ "aliases": { "type": "array", "items": { "type": "string" }, "description": "别名——如 ['C++', 'C']" },
440
+ "monarch": {
441
+ "type": "object",
442
+ "description": "可选——Monarch tokenizer 定义(Monaco 内建语法高亮)",
443
+ "properties": {
444
+ "tokenizer": { "type": "object" }
445
+ }
446
+ },
447
+ "lsp": {
448
+ "type": "object",
449
+ "description": "可选——LSP 语言服务器配置",
450
+ "properties": {
451
+ "command": { "type": "string", "description": "启动命令——解释器或可执行名(解释器如 node;PATH 二进制如 clangd;或绝对路径)。python 插件即 command='node' + args 带脚本路径" },
452
+ "args": { "type": "array", "items": { "type": "string" }, "description": "启动参数。E6#15e:相对路径式参数以插件根目录为基准解析(注册处一次绝对化)——如 'node_modules/pyright/dist/pyright-langserver.js' → <插件根>/node_modules/pyright/dist/pyright-langserver.js;'--stdio' 等 flag 原样透传。LSP 二进制随插件自带:SDK 打包按 args 引用把对应 node_modules 包打进 .linkdesk-plugin(壳不再发货 LSP,E5#114d extraResources 临时方案已删)" }
453
+ }
454
+ }
455
+ },
456
+ "additionalProperties": false
457
+ }
458
+ },
459
+ "fileAssociations": {
460
+ "type": "array",
461
+ "description": "文件关联——文件扩展名 插件路由(主进程 plugin-manifest-loader 消费,E5.7#50 壳侧注册已删)。只声明扩展名 + 可选打开命令;pluginId 用目录名,无需声明。",
462
+ "items": {
463
+ "type": "object",
464
+ "required": ["extension"],
465
+ "properties": {
466
+ "extension": { "type": "string", "description": "文件扩展名——不含点,如 dxf / stl / step" },
467
+ "command": { "type": "string", "description": "可选——打开该扩展名文件时执行的命令 ID" },
468
+ "displayName": { "type": "string", "description": "可选——'打开方式…'选择器中的显示名" }
469
+ },
470
+ "additionalProperties": false
471
+ }
472
+ },
473
+ "languages": {
474
+ "type": "array",
475
+ "description": "语言包——对标 VS Code language extension point。合集语言包一个 plugin.json 声明多个条目。",
476
+ "items": {
477
+ "type": "object",
478
+ "required": ["id", "label", "path"],
479
+ "properties": {
480
+ "id": { "type": "string", "description": "语言代码——如 zh / en / ja" },
481
+ "label": { "type": "string", "description": "显示名称——如 中文 / English / 日本語" },
482
+ "path": { "type": "string", "description": "i18n JSON 翻译文件路径" }
483
+ },
484
+ "additionalProperties": false
485
+ }
486
+ },
487
+ "titleBar": {
488
+ "type": "object",
489
+ "description": "顶栏按钮声明——对标 VS Code titleBar。声明标题栏左侧/右侧的图标按钮。",
490
+ "properties": {
491
+ "left": {
492
+ "type": "array",
493
+ "description": "标题栏左侧按钮",
494
+ "items": {
495
+ "type": "object",
496
+ "required": ["command"],
497
+ "properties": {
498
+ "command": { "type": "string", "description": "点击执行的命令 ID" },
499
+ "icon": { "type": "string", "description": "codicon 图标名(如 codicon-settings)或图片路径" },
500
+ "when": { "type": "string", "description": "context key when 条件——不满足时按钮隐藏" }
501
+ },
502
+ "additionalProperties": false
503
+ }
504
+ },
505
+ "right": {
506
+ "type": "array",
507
+ "description": "标题栏右侧按钮",
508
+ "items": {
509
+ "type": "object",
510
+ "required": ["command"],
511
+ "properties": {
512
+ "command": { "type": "string", "description": "点击执行的命令 ID" },
513
+ "icon": { "type": "string", "description": "codicon 图标名(如 codicon-settings)或图片路径" },
514
+ "when": { "type": "string", "description": "context key when 条件——不满足时按钮隐藏" }
515
+ },
516
+ "additionalProperties": false
517
+ }
518
+ }
519
+ },
520
+ "additionalProperties": false
521
+ },
522
+ "viewsContainers": {
523
+ "type": "object",
524
+ "description": "声明侧栏容器——点此插件图标时切换到此容器。对标 VS Code viewsContainers。",
525
+ "patternProperties": {
526
+ "^[a-z][a-z0-9-]*$": {
527
+ "type": "object",
528
+ "required": ["title"],
529
+ "properties": {
530
+ "title": { "type": "string", "description": "容器标题——侧栏 header 显示" },
531
+ "icon": { "type": "string", "description": "容器图标——覆盖插件自身的图标" },
532
+ "location": {
533
+ "type": "string",
534
+ "enum": ["sidebar", "panel", "auxiliarybar"],
535
+ "default": "sidebar",
536
+ "description": "容器位置——sidebar=侧栏, panel=底部面板, auxiliarybar=辅助侧栏"
537
+ },
538
+ "hideIfEmpty": {
539
+ "type": "boolean",
540
+ "default": false,
541
+ "description": "无活跃 view 时自动隐藏容器"
542
+ },
543
+ "order": {
544
+ "type": "number",
545
+ "description": "同位置内的排序权重。小值靠前"
546
+ },
547
+ "mergeHeaderWhenSingle": {
548
+ "type": "boolean",
549
+ "default": false,
550
+ "description": "容器内只有一个 view 时隐藏 view header——标题合并到容器 header。对标 VS Code mergeViewWithContainerWhenSingleView"
551
+ }
552
+ },
553
+ "additionalProperties": false
554
+ }
555
+ },
556
+ "additionalProperties": false
557
+ },
558
+ "views": {
559
+ "type": "object",
560
+ "description": "往容器注册视图——key = 容器 ID。对标 VS Code views。",
561
+ "patternProperties": {
562
+ "^[a-z][a-z0-9-]*$": {
563
+ "type": "array",
564
+ "items": {
565
+ "type": "object",
566
+ "required": ["id", "render"],
567
+ "properties": {
568
+ "id": { "type": "string", "description": "View 唯一 ID——如 folders / sessions / settings" },
569
+ "title": { "type": "string", "description": "显示标题——SidebarSection 的 header 文字。空字符串=不显示折叠头" },
570
+ "render": { "type": "string", "description": "视图组件的模块路径——相对插件根目录" },
571
+ "when": { "type": "string", "description": "Context key when 条件" },
572
+ "order": { "type": "number", "description": "同容器内的排序权重。小值在上" },
573
+ "role": { "type": "string", "enum": ["toolbar", "section"], "default": "section", "description": "容器角色——toolbar 粘顶不被覆盖,section 有折叠头同级替换" },
574
+ "collapsed": { "type": "boolean", "default": false, "description": "初始折叠状态" },
575
+ "canToggleVisibility": { "type": "boolean", "default": true, "description": "用户可通过 Views 子菜单切换可见性" },
576
+ "canMoveView": { "type": "boolean", "default": true, "description": "用户可将此 view 移到其他容器" }, "minHeight": {
577
+ "type": "number",
578
+ "description": "声明视图最小高度——侧栏分区 PaneSash effectiveMinHeight(对标 VS Code view 的 view size)"
579
+ },
580
+
581
+ "hideByDefault": { "type": "boolean", "default": false, "description": "默认隐藏——用户需手动从 Views 菜单开启" },
582
+ "singleViewPaneContainerTitle": { "type": "string", "description": "单 view 且容器 mergeHeaderWhenSingle 时替代容器 title" },
583
+ "titleDescription": { "type": "string", "description": "标题旁的副文字——如 (5 files)" },
584
+ "showActions": {
585
+ "type": "string",
586
+ "enum": ["always", "whenExpanded", "default"],
587
+ "default": "default",
588
+ "description": "actions 显隐时机——always=始终, whenExpanded=展开时, default=hover 显示"
589
+ },
590
+ "titleTooltip": { "type": "string", "description": "标题 hover tooltip——标题截断时显示完整文字" },
591
+ "titleActions": {
592
+ "type": "array",
593
+ "description": "视图动作区声明(E5.8#36.5)——面板标签栏/侧栏 header 右侧 widget 列表,随视图走随视图迁移。三形态:icon 按钮 / dropdown 下拉菜单 / split 主按钮+下拉复合(VS Code 终端 [+] 新建 + [▾] 配置文件列表同款)。动作 = command + args,label/title 为 i18n key(中文原文)。",
594
+ "items": {
595
+ "type": "object",
596
+ "required": ["type", "id"],
597
+ "properties": {
598
+ "type": { "type": "string", "enum": ["icon", "dropdown", "split"], "description": "widget 形态" },
599
+ "id": { "type": "string", "description": "widget 唯一 ID——React key / 下拉展开状态定位" },
600
+ "command": { "type": "string", "description": "点击执行的命令 ID(split=主按钮默认动作 / icon 必填)" },
601
+ "icon": { "type": "string", "description": "codicon 类名(如 codicon-add)——icon/split 主按钮图标" },
602
+ "title": { "type": "string", "description": "tooltip / aria-label——i18n key(split 无 icon 时作文本按钮)" },
603
+ "args": { "description": "命令参数——executeCommand(command, args) 单个位置参数透传(JSON 可序列化)" },
604
+ "items": {
605
+ "type": "array",
606
+ "description": "dropdown / split 下拉条目",
607
+ "items": {
608
+ "type": "object",
609
+ "required": ["label", "command"],
610
+ "properties": {
611
+ "label": { "type": "string", "description": "显示文本——i18n key(中文原文)" },
612
+ "command": { "type": "string", "description": "点击执行的命令 ID" },
613
+ "args": { "description": "命令参数——单个位置参数透传" }
614
+ }
615
+ }
616
+ }
617
+ }
618
+ }
619
+ }
620
+ },
621
+ "additionalProperties": false
622
+ }
623
+ }
624
+ },
625
+ "additionalProperties": false
626
+ },
627
+ "floatingPanel": {
628
+ "type": "object",
629
+ "description": "悬浮面板声明(E5.8#39.5)——声明 contributes.views 中某视图可在壳内悬浮面板显示(类型 B)。viewId 必须引用已注册视图——声明寻址解析出 pluginId/renderPath/title;未声明则无「在悬浮面板中打开」右键入口(I8-3 声明即出现)。首批声明者 = settings(#38 Ctrl+, 弹面板)。",
630
+ "required": ["viewId"],
631
+ "properties": {
632
+ "viewId": { "type": "string", "description": "视图 ID——contributes.views 已注册视图" }
633
+ },
634
+ "additionalProperties": false
635
+ },
636
+ "i18n": {
637
+ "type": "object",
638
+ "description": "插件自带翻译——key=语言代码, value=相对插件根目录的 JSON 文件路径。如 { \"en\": \"i18n/en.json\" }。不需要 zh.json——中文 key 自带兜底。",
639
+ "additionalProperties": { "type": "string" }
640
+ }
641
+ },
642
+ "additionalProperties": false
643
+ }
644
+ },
645
+ "$defs": {
646
+ "menuItem": {
647
+ "type": "object",
648
+ "required": ["command"],
649
+ "description": "菜单项——与运行时 ManifestMenuItem(MenuRegistry)对齐(E5.8#149 声明式 schema 唯一缺口补齐:label/order/children 递归自引用)。children 任意深度递归,与运行时归一一对一。",
650
+ "properties": {
651
+ "command": { "type": "string", "description": "命令 ID(有 children 时可为空——父菜单项不执行命令,展开子菜单)" },
652
+ "label": { "type": "string", "description": "显示标签——有值时覆盖命令标题(getCommand(id).title);父菜单项(无 command)必填" },
653
+ "group": { "type": "string", "description": "分组——navigation/edit/terminal/delete/split" },
654
+ "when": { "type": "string", "description": "context key when 条件" },
655
+ "order": { "type": "number", "description": "排序权重——同 group 内越小越靠前(E5.8#33)" },
656
+ "children": {
657
+ "type": "array",
658
+ "description": "嵌套子菜单——任意深度递归(对标 VS Code SubmenuAction,E5.8#148/#149);有 children command 可为空",
659
+ "items": { "$ref": "#/$defs/menuItem" }
660
+ }
661
+ },
662
+ "additionalProperties": false
663
+ }
664
+ },
665
+ "allOf": [
666
+ {
667
+ "$comment": "entry 条件(废弃 type 系)——if 必须带 required:[\"type\"],否则对缺 type 的 theme/language 等数据插件空真(properties 只验在场属性)→ 误强 entry(E6#5 SDK validate 冒烟实证 2026-09-04)。type 在场且命中 const 才强制 entry。",
668
+ "if": {
669
+ "required": ["type"],
670
+ "properties": { "type": { "const": "view" } }
671
+ },
672
+ "then": {
673
+ "required": ["entry"]
674
+ }
675
+ },
676
+ {
677
+ "if": {
678
+ "required": ["type"],
679
+ "properties": { "type": { "const": "card" } }
680
+ },
681
+ "then": {
682
+ "required": ["entry"]
683
+ }
684
+ },
685
+ {
686
+ "if": {
687
+ "required": ["type"],
688
+ "properties": { "type": { "const": "protocol" } }
689
+ },
690
+ "then": {
691
+ "required": ["entry"]
692
+ }
693
+ }
694
+ ],
695
+ "additionalProperties": true
696
+ }