@linkdesk/plugin-sdk 0.1.10 → 0.1.11

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