Skip to content

Commit a577a12

Browse files
chore: update interface schema files from MaaFramework
Triggered by 9a23995 [skip changelog]
1 parent 9a23995 commit a577a12

1 file changed

Lines changed: 222 additions & 8 deletions

File tree

deps/tools/interface.schema.json

Lines changed: 222 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
},
1717
"caseItem": {
1818
"type": "object",
19-
"title": "选项项",
19+
"title": "选项",
2020
"properties": {
2121
"name": {
2222
"type": "string",
@@ -107,6 +107,27 @@
107107
],
108108
"additionalProperties": false
109109
},
110+
"optionControllerResource": {
111+
"type": "object",
112+
"properties": {
113+
"controller": {
114+
"type": "array",
115+
"title": "适用的控制器",
116+
"description": "💡 v2.3.0 可选。指定该配置项适用的控制器类型列表。数组元素应与 controller 配置中的 name 字段对应。若不指定,则表示该配置项在所有控制器类型中都可用",
117+
"items": {
118+
"type": "string"
119+
}
120+
},
121+
"resource": {
122+
"type": "array",
123+
"title": "适用的资源包",
124+
"description": "💡 v2.3.0 可选。指定该配置项适用的资源包列表。数组元素应与 resource 配置中的 name 字段对应。若不指定,则表示该配置项在所有资源包中都可用",
125+
"items": {
126+
"type": "string"
127+
}
128+
}
129+
}
130+
},
110131
"optionDefinition": {
111132
"type": "object",
112133
"title": "配置项定义",
@@ -134,6 +155,22 @@
134155
"title": "图标路径",
135156
"description": "配置项图标文件路径,相对于项目根目录"
136157
},
158+
"controller": {
159+
"type": "array",
160+
"title": "适用的控制器",
161+
"description": "💡 v2.3.0 可选。指定该配置项适用的控制器类型列表",
162+
"items": {
163+
"type": "string"
164+
}
165+
},
166+
"resource": {
167+
"type": "array",
168+
"title": "适用的资源包",
169+
"description": "💡 v2.3.0 可选。指定该配置项适用的资源包列表",
170+
"items": {
171+
"type": "string"
172+
}
173+
},
137174
"inputs": {
138175
"type": "array",
139176
"title": "输入配置",
@@ -160,7 +197,7 @@
160197
"properties": {
161198
"type": {
162199
"const": "select",
163-
"description": "下拉选项框,用户从预定义的选项中选择"
200+
"description": "下拉选项框,用户从预定义的选项中选择一个"
164201
},
165202
"label": {
166203
"$ref": "#/definitions/i18nString",
@@ -177,6 +214,22 @@
177214
"title": "图标路径",
178215
"description": "配置项图标文件路径,相对于项目根目录"
179216
},
217+
"controller": {
218+
"type": "array",
219+
"title": "适用的控制器",
220+
"description": "💡 v2.3.0 可选。指定该配置项适用的控制器类型列表",
221+
"items": {
222+
"type": "string"
223+
}
224+
},
225+
"resource": {
226+
"type": "array",
227+
"title": "适用的资源包",
228+
"description": "💡 v2.3.0 可选。指定该配置项适用的资源包列表",
229+
"items": {
230+
"type": "string"
231+
}
232+
},
180233
"cases": {
181234
"type": "array",
182235
"title": "可选项列表",
@@ -195,6 +248,69 @@
195248
],
196249
"additionalProperties": false
197250
},
251+
{
252+
"title": "checkboxOption",
253+
"type": "object",
254+
"description": "💡 v2.3.0 多选框,用户从预定义的选项中选择多个",
255+
"properties": {
256+
"type": {
257+
"const": "checkbox",
258+
"description": "💡 v2.3.0 多选框,用户从预定义的选项中选择多个"
259+
},
260+
"label": {
261+
"$ref": "#/definitions/i18nString",
262+
"title": "显示标签",
263+
"description": "用于在用户界面中展示,支持国际化"
264+
},
265+
"description": {
266+
"$ref": "#/definitions/i18nString",
267+
"title": "详细描述",
268+
"description": "帮助用户理解配置项的作用。支持文件路径、URL 或直接文本,内容支持 Markdown 格式"
269+
},
270+
"icon": {
271+
"$ref": "#/definitions/i18nString",
272+
"title": "图标路径",
273+
"description": "配置项图标文件路径,相对于项目根目录"
274+
},
275+
"controller": {
276+
"type": "array",
277+
"title": "适用的控制器",
278+
"description": "💡 v2.3.0 可选。指定该配置项适用的控制器类型列表",
279+
"items": {
280+
"type": "string"
281+
}
282+
},
283+
"resource": {
284+
"type": "array",
285+
"title": "适用的资源包",
286+
"description": "💡 v2.3.0 可选。指定该配置项适用的资源包列表",
287+
"items": {
288+
"type": "string"
289+
}
290+
},
291+
"cases": {
292+
"type": "array",
293+
"title": "可选项列表",
294+
"description": "用户可同时选中多个 case,所有被选中的 case 的 pipeline_override 会按照 cases 数组中的定义顺序依次合并生效",
295+
"items": {
296+
"$ref": "#/definitions/caseItem"
297+
}
298+
},
299+
"default_case": {
300+
"type": "array",
301+
"title": "默认选中项",
302+
"description": "💡 v2.3.0 默认选中的选项名称数组,Client 使用该值作为多选框的初始选中值",
303+
"items": {
304+
"type": "string"
305+
}
306+
}
307+
},
308+
"required": [
309+
"type",
310+
"cases"
311+
],
312+
"additionalProperties": false
313+
},
198314
{
199315
"title": "switchOption",
200316
"type": "object",
@@ -218,6 +334,22 @@
218334
"title": "图标路径",
219335
"description": "配置项图标文件路径,相对于项目根目录"
220336
},
337+
"controller": {
338+
"type": "array",
339+
"title": "适用的控制器",
340+
"description": "💡 v2.3.0 可选。指定该配置项适用的控制器类型列表",
341+
"items": {
342+
"type": "string"
343+
}
344+
},
345+
"resource": {
346+
"type": "array",
347+
"title": "适用的资源包",
348+
"description": "💡 v2.3.0 可选。指定该配置项适用的资源包列表",
349+
"items": {
350+
"type": "string"
351+
}
352+
},
221353
"cases": {
222354
"type": "array",
223355
"title": "可选项列表",
@@ -306,6 +438,14 @@
306438
"type": "string"
307439
}
308440
},
441+
"option": {
442+
"type": "array",
443+
"title": "控制器级选项配置",
444+
"description": "💡 v2.3.0 可选。控制器级的选项配置,为一个字符串数组,数组元素应与外层 option 配置中的键名对应。该选项生成的参数会参与到所有使用该控制器的任务的 pipeline override 中",
445+
"items": {
446+
"type": "string"
447+
}
448+
},
309449
"adb": {
310450
"type": "object",
311451
"title": "Adb 控制器配置",
@@ -482,8 +622,8 @@
482622
},
483623
"option": {
484624
"type": "array",
485-
"title": "全局选项配置",
486-
"description": "可选。资源包的全局选项配置,为一个字符串数组,数组元素应与外层 option 配置中的键名对应。该选项生成的参数会参与到所有任务的 pipeline override 中",
625+
"title": "资源包级选项配置",
626+
"description": "可选。资源包级的选项配置,为一个字符串数组,数组元素应与外层 option 配置中的键名对应。该选项生成的参数会参与到所有任务的 pipeline override 中,起到资源包级参数传递的作用",
487627
"items": {
488628
"type": "string"
489629
}
@@ -755,21 +895,95 @@
755895
"$ref": "#/definitions/optionDefinition"
756896
}
757897
},
898+
"global_option": {
899+
"type": "array",
900+
"title": "全局选项配置",
901+
"description": "💡 v2.3.0 可选。全局选项配置,为一个字符串数组,数组元素应与 option 配置中的键名对应。该选项生成的参数会参与到所有任务的 pipeline override 中,无论用户选择了什么资源包或控制器",
902+
"items": {
903+
"type": "string"
904+
}
905+
},
758906
"import": {
759907
"type": "array",
760908
"title": "导入其他 PI 文件",
761-
"description": "可选。导入其他 PI 文件的路径数组。文件相对路径为 interface.json 同目录下的相对路径。仅支持导入这些文件中的 task 和 option 字段",
909+
"description": "可选。导入其他 PI 文件的路径数组。文件相对路径为 interface.json 同目录下的相对路径。支持导入这些文件中的 task、optionpreset(💡 v2.3.0)字段",
762910
"items": {
763911
"type": "string"
764912
}
913+
},
914+
"preset": {
915+
"type": "array",
916+
"title": "预设配置",
917+
"description": "💡 v2.3.0 可选。预设配置,为一个对象数组。每个预设是一套预定义的任务勾选状态与选项值的快照,用户可一键应用,快速切换不同使用场景",
918+
"items": {
919+
"type": "object",
920+
"title": "预设项",
921+
"properties": {
922+
"name": {
923+
"type": "string",
924+
"title": "预设唯一标识符",
925+
"description": "用作预设 ID"
926+
},
927+
"label": {
928+
"$ref": "#/definitions/i18nString",
929+
"title": "显示名称",
930+
"description": "用于在用户界面中展示,支持国际化。如果未设置,则显示 name 字段的值"
931+
},
932+
"description": {
933+
"$ref": "#/definitions/i18nString",
934+
"title": "详细描述",
935+
"description": "帮助用户理解该预设的适用场景。支持文件路径、URL 或直接文本,内容支持 Markdown 格式"
936+
},
937+
"icon": {
938+
"$ref": "#/definitions/i18nString",
939+
"title": "图标路径",
940+
"description": "预设图标文件路径,相对于项目根目录"
941+
},
942+
"task": {
943+
"type": "array",
944+
"title": "预设任务配置",
945+
"description": "预设包含的任务配置列表",
946+
"items": {
947+
"type": "object",
948+
"title": "预设任务项",
949+
"properties": {
950+
"name": {
951+
"type": "string",
952+
"title": "任务名称",
953+
"description": "必须。与顶层 task[].name 对应的任务名称"
954+
},
955+
"enabled": {
956+
"type": "boolean",
957+
"title": "是否启用",
958+
"description": "可选,默认 true。该任务在预设中是否勾选",
959+
"default": true
960+
},
961+
"option": {
962+
"type": "object",
963+
"title": "任务选项预设值",
964+
"description": "可选。该任务各配置项的预设值,键为顶层 option 中的键名。select/switch 类型填 case.name 字符串,checkbox 类型填 case.name 数组,input 类型填 record<string, string>",
965+
"additionalProperties": true
966+
}
967+
},
968+
"required": [
969+
"name"
970+
],
971+
"additionalProperties": false
972+
}
973+
}
974+
},
975+
"required": [
976+
"name"
977+
],
978+
"additionalProperties": false
979+
}
765980
}
766981
},
767982
"required": [
768983
"interface_version",
769984
"name",
770985
"controller",
771-
"resource",
772-
"task"
986+
"resource"
773987
],
774988
"additionalProperties": false
775-
}
989+
}

0 commit comments

Comments
 (0)