-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathconfig.schema.json
More file actions
508 lines (508 loc) · 24 KB
/
Copy pathconfig.schema.json
File metadata and controls
508 lines (508 loc) · 24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://focusany.com/sdk/config.schema.json",
"title": "FocusAny 插件配置文件",
"description": "FocusAny 插件配置文件,用于描述插件的基本信息,以及插件的入口文件。",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "插件名称,此为必选项,且插件应用内不可重复。"
},
"version": {
"type": "string",
"description": "插件版本,此为必选项。"
},
"platform": {
"type": "array",
"description": "支持的平台,此为选填,留空表示支持所有平台。",
"items": {
"type": "string",
"enum": [
"win",
"osx",
"linux"
]
}
},
"versionRequire": {
"type": "string",
"description": "FocusAny 版本要求,如 * 或 >=1.0.0 或 <=1.0.0 或 >1.0.0 或 <1.0.0,此为选填,留空表示不限制 FocusAny 版本。"
},
"editionRequire": {
"type": "array",
"description": "FocusAny 类型要求,此为选填,留空表示不限制 FocusAny 类型(open社区版、pro专业版)。",
"items": {
"type": "string",
"enum": [
"open",
"pro"
]
}
},
"title": {
"type": "string",
"description": "插件标题,此为必选项。"
},
"logo": {
"type": "string",
"description": "插件图标,支持png,jpg,svg格式"
},
"description": {
"type": "string",
"description": "插件描述"
},
"main": {
"type": "string",
"description": "主入口文件"
},
"mainView": {
"type": "string",
"description": "快捷面板/智能视图 入口文件,当该配置为空时,使用主入口文件"
},
"preload": {
"type": "string",
"description": "插件预加载文件,相对于插件目录,需要是 cjs 文件"
},
"author": {
"type": "string",
"description": "插件作者"
},
"homepage": {
"type": "string",
"description": "插件主页"
},
"actions": {
"type": "array",
"description": "插件动作,描述了当 FocusAny 主输入框内容产生变化时,此插件应用是否显示在搜索结果列表中,一个插件应用可以有多个功能,一个功能可以提供多个命令供用户搜索。",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "插件应用提供的某个功能的唯一标示,此为必选项,且插件应用内不可重复。"
},
"title": {
"type": "string",
"description": "对此功能的说明,将在搜索列表对应位置中显示。"
},
"icon": {
"type": "string",
"description": "此功能的图标,支持png,jpg,svg格式。"
},
"trackHistory": {
"type": "boolean",
"description": "是否启用历史记录,默认为 true。启用后,FocusAny 会记录用户对该功能的使用历史,并在搜索结果中显示。"
},
"type": {
"type": "string",
"description": "此功能的类型",
"enum": [
"command",
"web",
"code",
"backend",
"view"
]
},
"platform": {
"type": "array",
"description": "支持的平台,此为选填,留空表示支持所有平台。",
"items": {
"type": "string",
"enum": [
"win",
"osx",
"linux"
]
}
},
"data": {
"type": "object",
"description": "其他补充数据。",
"properties": {
"command": {
"type": "string",
"description": "type=command时,此为必选项,表示此功能的命令。"
},
"showFastPanel": {
"type": "boolean",
"description": "type=view时,是否在快捷面板中显示,默认为 false"
},
"showMainPanel": {
"type": "boolean",
"description": "type=view时,是否在主面板中显示,默认为 true"
}
}
},
"matches": {
"type": "array",
"description": "该功能下可响应的命令集,支持 6 种类型,由 matches 的类型或 matches.type 决定。",
"items": {
"oneOf": [
{
"type": "string",
"description": "简单字符串匹配"
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"description": "类型",
"enum": [
"text",
"key",
"regex",
"file",
"image",
"window",
"editor"
]
},
"name": {
"type": "string",
"description": "匹配名称"
},
"regex": {
"type": "string",
"description": "匹配正则表达式"
},
"title": {
"type": "string",
"description": "匹配标题"
},
"text": {
"type": "string",
"description": "匹配文本"
},
"minLength": {
"type": "number",
"description": "最小匹配长度",
"minimum": 1
},
"maxLength": {
"type": "number",
"description": "最大匹配长度",
"minimum": 1,
"maximum": 10000
},
"key": {
"type": "string",
"description": "匹配键值"
},
"minCount": {
"type": "number",
"description": "最小匹配数量",
"minimum": 1
},
"maxCount": {
"type": "number",
"description": "最大匹配数量",
"minimum": 1,
"maximum": 10000
},
"filterFileType": {
"type": "string",
"description": "文件类型",
"enum": [
"file",
"directory"
]
},
"filterExtensions": {
"type": "array",
"description": "文件扩展名",
"items": {
"type": "string"
}
},
"nameRegex": {
"type": "string",
"description": "匹配名称正则"
},
"titleRegex": {
"type": "string",
"description": "匹配标题正则"
},
"attrRegex": {
"type": "object",
"description": "匹配属性正则",
"properties": {
"name": {
"type": "string",
"description": "属性名称"
},
"value": {
"type": "string",
"description": "属性值正则表达式"
}
}
},
"extensions": {
"type": "array",
"description": "文件扩展名",
"items": {
"type": "string"
}
},
"fadTypes": {
"type": "array",
"description": "FocusAny 数据类型",
"items": {
"type": "string"
}
}
},
"additionalProperties": false
}
]
}
}
}
}
},
"mcp": {
"type": "object",
"description": "MCP 配置,描述了插件应用在 MCP 中的相关信息。",
"properties": {
"tools": {
"type": "array",
"description": "插件应用提供的工具列表,一个插件应用可以提供多个工具。",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "工具名称,此为必选项,且插件应用内不可重复。建议使用小写+点号分隔,例如 'list.plugins'。"
},
"description": {
"type": "string",
"description": "工具描述,简要说明工具的用途。"
},
"inputSchema": {
"type": "object",
"description": "工具输入参数的 JSON Schema。必须符合 JSON Schema Draft 7 标准。",
"properties": {
"type": {
"type": "string",
"enum": [
"object"
],
"description": "输入参数必须是对象类型。"
},
"properties": {
"type": "object",
"description": "对象的属性定义。每个属性名对应一个参数。",
"additionalProperties": {
"type": "object",
"description": "参数的 JSON Schema 定义。例如 {\"type\":\"string\",\"description\":\"...\"}",
"properties": {
"type": {
"type": "string",
"description": "参数类型,例如 string、number、boolean、array、object 等。",
"enum": [
"string",
"number",
"object",
"array",
"boolean"
]
},
"description": {
"type": "string",
"description": "参数描述,简要说明参数的用途。"
},
"examples": {
"type": "array",
"description": "参数示例值。",
"items": {
"type": [
"string",
"number",
"object",
"array",
"boolean"
]
}
}
}
}
},
"required": {
"type": "array",
"description": "必填参数列表。",
"items": {
"type": "string"
}
}
},
"required": [
"type",
"properties"
]
}
},
"required": [
"name",
"description",
"inputSchema"
]
}
}
},
"required": [
"tools"
]
},
"development": {
"type": "object",
"properties": {
"env": {
"type": "string",
"description": "开发环境,prod 表示生产环境,dev 表示开发环境,prod 环境会忽略 development 的所有配置。",
"enum": [
"prod",
"dev"
]
},
"main": {
"type": "string",
"description": "dev环境 入口文件,通常为开发环境如 http://localhost:8080"
},
"mainView": {
"type": "string",
"description": "dev环境 快捷面板/智能视图快速面板入口文件,通常为开发环境如 http://localhost:8080"
},
"showDevTools": {
"type": "boolean",
"description": "dev环境 是否在插件加载完成后显示开发者窗口"
},
"showCodeDevTools": {
"type": "boolean",
"description": "dev环境 是否在code执行完成后显示开发者窗口"
},
"keepCodeDevTools": {
"type": "boolean",
"description": "dev环境 插件是否在code执行完成后保留开发者窗口"
},
"showViewDevTools": {
"type": "boolean",
"description": "dev环境 是否在快捷面板/智能视图渲染view时显示开发者窗口"
},
"releaseDoc": {
"type": "string",
"description": "更新日志文档,参照插件选择根目录,默认为 release.md,使用 markdown 格式,格式为【## x.x.x 功能特性[换行][换行]更新内容详情】使用 --- 分割多个。"
},
"contentDoc": {
"type": "string",
"description": "插件内容文档,参照插件选择根目录,默认为 content.md,使用 markdown 格式。"
},
"previewDoc": {
"type": "string",
"description": "插件预览文档,参照插件选择根目录,默认为 preview.md,使用 markdown 格式,每行一个图片链接。"
}
}
},
"permissions": {
"type": "array",
"description": "插件权限",
"items": {
"type": "string",
"enum": [
"ClipboardManage",
"Api",
"File"
]
}
},
"setting": {
"type": "object",
"properties": {
"autoDetach": {
"type": "boolean",
"description": "是否默认分离模式打开,默认为 false"
},
"detachPosition": {
"type": "string",
"description": "分离模式默认位置,默认为 center",
"enum": [
"center",
"left-top",
"right-top",
"left-bottom",
"right-bottom"
]
},
"detachAlwaysOnTop": {
"type": "boolean",
"description": "分离模式默认是否置顶,默认为 false"
},
"height": {
"type": "string",
"description": "窗口高度,支持 数字 或 百分比,设置后窗口大小将默认为分离模式,默认为 600"
},
"width": {
"type": "string",
"description": "窗口宽度,支持 数字 或 百分比,设置后窗口大小将默认为分离模式,默认为 800"
},
"heightView": {
"type": "integer",
"description": "快速面板高度,单位为像素,默认为 100"
},
"singleton": {
"type": "boolean",
"description": "是否只允许打开一个窗口,默认为 true"
},
"zoom": {
"type": "number",
"description": "窗口缩放比例,100表示原始大小,默认为 100"
},
"darkModeSupport": {
"type": "boolean",
"description": "是否支持暗黑模式,默认为 false"
},
"httpEntry": {
"type": "boolean",
"description": "是否使用 http 协议入口,默认为 false"
},
"remoteWebCacheEnable": {
"type": "boolean",
"description": "是否启用远程Web缓存,默认为 false"
},
"moreMenu": {
"type": "array",
"description": "分离模式更多菜单,默认为空",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "菜单标识"
},
"title": {
"type": "string",
"description": "菜单标题"
}
},
"required": [
"name",
"title"
]
}
},
"preloadBase": {
"type": "string",
"description": "基础预加载文件,普通插件应用不需要设置"
},
"nodeIntegration": {
"type": "boolean",
"description": "是否启用 nodejs,普通应用不需要设置"
}
}
}
}
}