gaoding-cli 1.0.0-alpha.10
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.
- package/LICENSE +21 -0
- package/README.md +38 -0
- package/contracts/operations/agent.send/input.schema.json +354 -0
- package/contracts/operations/agent.send/output.schema.json +271 -0
- package/contracts/operations/auth.status/input.schema.json +7 -0
- package/contracts/operations/auth.status/output.schema.json +132 -0
- package/contracts/operations/dam.delete/input.schema.json +23 -0
- package/contracts/operations/dam.delete/output.schema.json +6 -0
- package/contracts/operations/dam.get/input.schema.json +16 -0
- package/contracts/operations/dam.get/output.schema.json +46 -0
- package/contracts/operations/dam.list/input.schema.json +44 -0
- package/contracts/operations/dam.list/output.schema.json +71 -0
- package/contracts/operations/dam.search/input.schema.json +46 -0
- package/contracts/operations/dam.search/output.schema.json +71 -0
- package/contracts/operations/dam.upload/input.schema.json +31 -0
- package/contracts/operations/dam.upload/output.schema.json +46 -0
- package/contracts/operations/editor.apply/input.schema.json +134 -0
- package/contracts/operations/editor.apply/output.schema.json +15 -0
- package/contracts/operations/editor.connect/input.schema.json +15 -0
- package/contracts/operations/editor.connect/output.schema.json +17 -0
- package/contracts/operations/editor.disconnect/input.schema.json +8 -0
- package/contracts/operations/editor.disconnect/output.schema.json +14 -0
- package/contracts/operations/editor.save/input.schema.json +8 -0
- package/contracts/operations/editor.save/output.schema.json +23 -0
- package/contracts/operations/editor.screenshot/input.schema.json +8 -0
- package/contracts/operations/editor.screenshot/output.schema.json +16 -0
- package/contracts/operations/editor.snapshot/input.schema.json +8 -0
- package/contracts/operations/editor.snapshot/output.schema.json +113 -0
- package/contracts/operations/model.get/input.schema.json +18 -0
- package/contracts/operations/model.get/output.schema.json +190 -0
- package/contracts/operations/model.list/input.schema.json +15 -0
- package/contracts/operations/model.list/output.schema.json +111 -0
- package/contracts/operations/org.current/input.schema.json +7 -0
- package/contracts/operations/org.current/output.schema.json +49 -0
- package/contracts/operations/org.list/input.schema.json +7 -0
- package/contracts/operations/org.list/output.schema.json +71 -0
- package/contracts/operations/tool.call/input.schema.json +35 -0
- package/contracts/operations/tool.call/output.schema.json +129 -0
- package/contracts/operations/tool.list/input.schema.json +7 -0
- package/contracts/operations/tool.list/output.schema.json +45 -0
- package/dist/bin/gd-cli.js +38 -0
- package/dist/bin/postinstall.js +42 -0
- package/dist/src/bootstrap/create-cli.js +55 -0
- package/dist/src/bootstrap/create-runtime.js +222 -0
- package/dist/src/bootstrap/validators.js +118 -0
- package/dist/src/cli/action-binding.js +63 -0
- package/dist/src/cli/agent-commands.js +39 -0
- package/dist/src/cli/auth-commands.js +47 -0
- package/dist/src/cli/dam-commands.js +207 -0
- package/dist/src/cli/editor-commands.js +73 -0
- package/dist/src/cli/errors.js +90 -0
- package/dist/src/cli/model-commands.js +47 -0
- package/dist/src/cli/org-commands.js +52 -0
- package/dist/src/cli/presenter.js +80 -0
- package/dist/src/cli/prompt.js +30 -0
- package/dist/src/cli/tool-commands.js +65 -0
- package/dist/src/cli/update-command.js +12 -0
- package/dist/src/contracts/schema.js +4 -0
- package/dist/src/features/agent/creative-agent-adapter.js +31 -0
- package/dist/src/features/agent/creative-protocol.js +324 -0
- package/dist/src/features/agent/creative-stream.js +127 -0
- package/dist/src/features/agent/use-cases.js +113 -0
- package/dist/src/features/auth/access-policy.js +101 -0
- package/dist/src/features/auth/credential-store.js +62 -0
- package/dist/src/features/auth/sso-service.js +179 -0
- package/dist/src/features/auth/state.js +129 -0
- package/dist/src/features/auth/use-cases.js +106 -0
- package/dist/src/features/dam/asset-projection.js +270 -0
- package/dist/src/features/dam/dam-api-adapter.js +206 -0
- package/dist/src/features/dam/object-storage.js +191 -0
- package/dist/src/features/dam/registered-uploader.js +224 -0
- package/dist/src/features/dam/storage-upload.js +141 -0
- package/dist/src/features/dam/transient-uploader.js +17 -0
- package/dist/src/features/dam/use-cases.js +151 -0
- package/dist/src/features/editor/bridge-client.js +96 -0
- package/dist/src/features/editor/bridge-process.js +222 -0
- package/dist/src/features/editor/bridge-server.js +311 -0
- package/dist/src/features/editor/protocol.js +1 -0
- package/dist/src/features/editor/session-state.js +78 -0
- package/dist/src/features/editor/session.js +193 -0
- package/dist/src/features/editor/use-cases.js +61 -0
- package/dist/src/features/org/org-service.js +76 -0
- package/dist/src/features/org/use-cases.js +140 -0
- package/dist/src/features/skill/bundled-skills.js +55 -0
- package/dist/src/features/skill/installer.js +265 -0
- package/dist/src/features/tool/catalog.js +79 -0
- package/dist/src/features/tool/dynamic-schema.js +96 -0
- package/dist/src/features/tool/mns-catalog-adapter.js +262 -0
- package/dist/src/features/tool/tool-api-adapter.js +200 -0
- package/dist/src/features/tool/use-cases.js +126 -0
- package/dist/src/features/update/update-service.js +194 -0
- package/dist/src/platform/json-input.js +64 -0
- package/dist/src/platform/local-json-file.js +59 -0
- package/dist/src/platform/open-browser.js +8 -0
- package/dist/src/platform/redact.js +80 -0
- package/dist/src/platform/safe-upload-file.js +146 -0
- package/dist/src/platform/signature.js +19 -0
- package/dist/src/platform/signed-http-transport.js +109 -0
- package/dist/src/platform/url-safety.js +100 -0
- package/package.json +56 -0
- package/skills/gd-cli/SKILL.md +15 -0
- package/skills/gd-cli/references/auth-org.md +9 -0
- package/skills/gd-cli/references/creation.md +38 -0
- package/skills/gd-cli/references/dam.md +20 -0
- package/skills/gd-cli/references/editor.md +12 -0
- package/skills/gd-cli/references/errors.md +10 -0
- package/skills/gd-cli/references/update.md +11 -0
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "EditorApplyInput",
|
|
4
|
+
"description": "要依次应用到当前编辑器的操作。",
|
|
5
|
+
"type": "array",
|
|
6
|
+
"items": {
|
|
7
|
+
"oneOf": [
|
|
8
|
+
{ "$ref": "#/$defs/EditorUpsertAction" },
|
|
9
|
+
{ "$ref": "#/$defs/EditorDeleteAction" }
|
|
10
|
+
]
|
|
11
|
+
},
|
|
12
|
+
"$defs": {
|
|
13
|
+
"EditorUpsertAction": {
|
|
14
|
+
"title": "EditorUpsertAction",
|
|
15
|
+
"type": "object",
|
|
16
|
+
"additionalProperties": false,
|
|
17
|
+
"required": ["_type", "element"],
|
|
18
|
+
"properties": {
|
|
19
|
+
"_type": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"enum": ["create", "update"],
|
|
22
|
+
"description": "创建或完整更新元素。"
|
|
23
|
+
},
|
|
24
|
+
"element": {
|
|
25
|
+
"description": "要创建或完整更新的元素。",
|
|
26
|
+
"oneOf": [
|
|
27
|
+
{ "$ref": "#/$defs/EditorShape" },
|
|
28
|
+
{ "$ref": "#/$defs/EditorConnector" }
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"EditorDeleteAction": {
|
|
34
|
+
"title": "EditorDeleteAction",
|
|
35
|
+
"type": "object",
|
|
36
|
+
"additionalProperties": false,
|
|
37
|
+
"required": ["_type", "id"],
|
|
38
|
+
"properties": {
|
|
39
|
+
"_type": {
|
|
40
|
+
"const": "delete",
|
|
41
|
+
"description": "删除元素。"
|
|
42
|
+
},
|
|
43
|
+
"id": {
|
|
44
|
+
"type": "string",
|
|
45
|
+
"minLength": 1,
|
|
46
|
+
"pattern": ".*\\S.*",
|
|
47
|
+
"description": "要删除的元素 ID。"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"EditorShape": {
|
|
52
|
+
"title": "EditorShape",
|
|
53
|
+
"type": "object",
|
|
54
|
+
"additionalProperties": false,
|
|
55
|
+
"required": ["_type", "id", "shapeType", "x", "y", "w", "h", "fill", "stroke"],
|
|
56
|
+
"properties": {
|
|
57
|
+
"_type": {
|
|
58
|
+
"const": "shape",
|
|
59
|
+
"description": "元素类型。"
|
|
60
|
+
},
|
|
61
|
+
"id": {
|
|
62
|
+
"type": "string",
|
|
63
|
+
"minLength": 1,
|
|
64
|
+
"pattern": ".*\\S.*",
|
|
65
|
+
"description": "元素 ID。"
|
|
66
|
+
},
|
|
67
|
+
"shapeType": {
|
|
68
|
+
"type": "string",
|
|
69
|
+
"enum": ["rectangle", "rounded-rectangle", "triangle-up", "ellipse", "diamond"],
|
|
70
|
+
"description": "图形类型。"
|
|
71
|
+
},
|
|
72
|
+
"x": { "type": "number", "description": "左上角横坐标。" },
|
|
73
|
+
"y": { "type": "number", "description": "左上角纵坐标。" },
|
|
74
|
+
"w": { "type": "number", "description": "宽度。" },
|
|
75
|
+
"h": { "type": "number", "description": "高度。" },
|
|
76
|
+
"text": { "type": "string", "description": "图形中的文本。" },
|
|
77
|
+
"fill": {
|
|
78
|
+
"type": "string",
|
|
79
|
+
"minLength": 1,
|
|
80
|
+
"pattern": ".*\\S.*",
|
|
81
|
+
"description": "填充颜色。"
|
|
82
|
+
},
|
|
83
|
+
"stroke": {
|
|
84
|
+
"description": "描边颜色;null 表示无描边。",
|
|
85
|
+
"anyOf": [
|
|
86
|
+
{ "type": "string", "minLength": 1, "pattern": ".*\\S.*" },
|
|
87
|
+
{ "type": "null" }
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
"EditorConnector": {
|
|
93
|
+
"title": "EditorConnector",
|
|
94
|
+
"type": "object",
|
|
95
|
+
"additionalProperties": false,
|
|
96
|
+
"required": ["_type", "id", "fromId", "toId", "lineType", "color"],
|
|
97
|
+
"properties": {
|
|
98
|
+
"_type": {
|
|
99
|
+
"const": "connector",
|
|
100
|
+
"description": "元素类型。"
|
|
101
|
+
},
|
|
102
|
+
"id": {
|
|
103
|
+
"type": "string",
|
|
104
|
+
"minLength": 1,
|
|
105
|
+
"pattern": ".*\\S.*",
|
|
106
|
+
"description": "连线 ID。"
|
|
107
|
+
},
|
|
108
|
+
"fromId": {
|
|
109
|
+
"type": "string",
|
|
110
|
+
"minLength": 1,
|
|
111
|
+
"pattern": ".*\\S.*",
|
|
112
|
+
"description": "起点元素 ID。"
|
|
113
|
+
},
|
|
114
|
+
"toId": {
|
|
115
|
+
"type": "string",
|
|
116
|
+
"minLength": 1,
|
|
117
|
+
"pattern": ".*\\S.*",
|
|
118
|
+
"description": "终点元素 ID。"
|
|
119
|
+
},
|
|
120
|
+
"lineType": {
|
|
121
|
+
"type": "string",
|
|
122
|
+
"enum": ["straight", "elbowed"],
|
|
123
|
+
"description": "连线类型。"
|
|
124
|
+
},
|
|
125
|
+
"color": {
|
|
126
|
+
"type": "string",
|
|
127
|
+
"minLength": 1,
|
|
128
|
+
"pattern": ".*\\S.*",
|
|
129
|
+
"description": "连线颜色。"
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "EditorApplyResult",
|
|
4
|
+
"description": "编辑器操作应用结果。",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["appliedCount"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"appliedCount": {
|
|
10
|
+
"type": "integer",
|
|
11
|
+
"minimum": 0,
|
|
12
|
+
"description": "已成功应用的操作数量。"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "EditorConnectInput",
|
|
4
|
+
"description": "编辑器连接参数。",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"properties": {
|
|
8
|
+
"target": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"minLength": 1,
|
|
11
|
+
"pattern": ".*\\S.*",
|
|
12
|
+
"description": "作品 ID 或 AI+ Editor URL;省略时创建新作品。"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "EditorConnectResult",
|
|
4
|
+
"description": "已连接的编辑器页面。",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["target"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"target": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"format": "uri",
|
|
12
|
+
"minLength": 1,
|
|
13
|
+
"pattern": ".*\\S.*",
|
|
14
|
+
"description": "已连接的 AI+ Editor URL。"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "EditorDisconnectResult",
|
|
4
|
+
"description": "编辑器断开结果。",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["disconnected"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"disconnected": {
|
|
10
|
+
"type": "boolean",
|
|
11
|
+
"description": "是否断开了一个当前连接。"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "EditorSaveResult",
|
|
4
|
+
"description": "已保存的编辑器作品。",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["workId", "url"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"workId": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"minLength": 1,
|
|
12
|
+
"pattern": ".*\\S.*",
|
|
13
|
+
"description": "作品 ID。"
|
|
14
|
+
},
|
|
15
|
+
"url": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"format": "uri",
|
|
18
|
+
"minLength": 1,
|
|
19
|
+
"pattern": ".*\\S.*",
|
|
20
|
+
"description": "作品的 AI+ Editor URL。"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "EditorScreenshotResult",
|
|
4
|
+
"description": "已导出的编辑器截图。",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["path"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"path": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"minLength": 1,
|
|
12
|
+
"pattern": ".*\\S.*",
|
|
13
|
+
"description": "截图在本机的绝对路径。"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "EditorSnapshotResult",
|
|
4
|
+
"description": "当前编辑器中的受支持元素与选区。",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["elements", "selectedIds"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"elements": {
|
|
10
|
+
"type": "array",
|
|
11
|
+
"description": "当前编辑器中的受支持元素。",
|
|
12
|
+
"items": {
|
|
13
|
+
"oneOf": [
|
|
14
|
+
{ "$ref": "#/$defs/EditorShape" },
|
|
15
|
+
{ "$ref": "#/$defs/EditorConnector" }
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"selectedIds": {
|
|
20
|
+
"type": "array",
|
|
21
|
+
"description": "当前选中元素的 ID。",
|
|
22
|
+
"items": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"minLength": 1,
|
|
25
|
+
"pattern": ".*\\S.*"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"$defs": {
|
|
30
|
+
"EditorShape": {
|
|
31
|
+
"title": "EditorShape",
|
|
32
|
+
"type": "object",
|
|
33
|
+
"additionalProperties": false,
|
|
34
|
+
"required": ["_type", "id", "shapeType", "x", "y", "w", "h", "fill", "stroke"],
|
|
35
|
+
"properties": {
|
|
36
|
+
"_type": {
|
|
37
|
+
"const": "shape",
|
|
38
|
+
"description": "元素类型。"
|
|
39
|
+
},
|
|
40
|
+
"id": {
|
|
41
|
+
"type": "string",
|
|
42
|
+
"minLength": 1,
|
|
43
|
+
"pattern": ".*\\S.*",
|
|
44
|
+
"description": "元素 ID。"
|
|
45
|
+
},
|
|
46
|
+
"shapeType": {
|
|
47
|
+
"type": "string",
|
|
48
|
+
"enum": ["rectangle", "rounded-rectangle", "triangle-up", "ellipse", "diamond"],
|
|
49
|
+
"description": "图形类型。"
|
|
50
|
+
},
|
|
51
|
+
"x": { "type": "number", "description": "左上角横坐标。" },
|
|
52
|
+
"y": { "type": "number", "description": "左上角纵坐标。" },
|
|
53
|
+
"w": { "type": "number", "description": "宽度。" },
|
|
54
|
+
"h": { "type": "number", "description": "高度。" },
|
|
55
|
+
"text": { "type": "string", "description": "图形中的文本。" },
|
|
56
|
+
"fill": {
|
|
57
|
+
"type": "string",
|
|
58
|
+
"minLength": 1,
|
|
59
|
+
"pattern": ".*\\S.*",
|
|
60
|
+
"description": "填充颜色。"
|
|
61
|
+
},
|
|
62
|
+
"stroke": {
|
|
63
|
+
"description": "描边颜色;null 表示无描边。",
|
|
64
|
+
"anyOf": [
|
|
65
|
+
{ "type": "string", "minLength": 1, "pattern": ".*\\S.*" },
|
|
66
|
+
{ "type": "null" }
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"EditorConnector": {
|
|
72
|
+
"title": "EditorConnector",
|
|
73
|
+
"type": "object",
|
|
74
|
+
"additionalProperties": false,
|
|
75
|
+
"required": ["_type", "id", "fromId", "toId", "lineType", "color"],
|
|
76
|
+
"properties": {
|
|
77
|
+
"_type": {
|
|
78
|
+
"const": "connector",
|
|
79
|
+
"description": "元素类型。"
|
|
80
|
+
},
|
|
81
|
+
"id": {
|
|
82
|
+
"type": "string",
|
|
83
|
+
"minLength": 1,
|
|
84
|
+
"pattern": ".*\\S.*",
|
|
85
|
+
"description": "连线 ID。"
|
|
86
|
+
},
|
|
87
|
+
"fromId": {
|
|
88
|
+
"type": "string",
|
|
89
|
+
"minLength": 1,
|
|
90
|
+
"pattern": ".*\\S.*",
|
|
91
|
+
"description": "起点元素 ID。"
|
|
92
|
+
},
|
|
93
|
+
"toId": {
|
|
94
|
+
"type": "string",
|
|
95
|
+
"minLength": 1,
|
|
96
|
+
"pattern": ".*\\S.*",
|
|
97
|
+
"description": "终点元素 ID。"
|
|
98
|
+
},
|
|
99
|
+
"lineType": {
|
|
100
|
+
"type": "string",
|
|
101
|
+
"enum": ["straight", "elbowed"],
|
|
102
|
+
"description": "连线类型。"
|
|
103
|
+
},
|
|
104
|
+
"color": {
|
|
105
|
+
"type": "string",
|
|
106
|
+
"minLength": 1,
|
|
107
|
+
"pattern": ".*\\S.*",
|
|
108
|
+
"description": "连线颜色。"
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "ModelGetInput",
|
|
4
|
+
"description": "读取一个创作模型完整信息的输入。",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": [
|
|
8
|
+
"model"
|
|
9
|
+
],
|
|
10
|
+
"properties": {
|
|
11
|
+
"model": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"minLength": 1,
|
|
14
|
+
"pattern": ".*\\S.*",
|
|
15
|
+
"description": "要读取的创作模型机器标识。"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "ModelDetail",
|
|
4
|
+
"description": "一个创作模型的完整产品信息。",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": [
|
|
8
|
+
"tool",
|
|
9
|
+
"model",
|
|
10
|
+
"title",
|
|
11
|
+
"parameters"
|
|
12
|
+
],
|
|
13
|
+
"properties": {
|
|
14
|
+
"tool": {
|
|
15
|
+
"$ref": "#/$defs/NonBlankString",
|
|
16
|
+
"description": "模型所属的产品创作工具。"
|
|
17
|
+
},
|
|
18
|
+
"model": {
|
|
19
|
+
"$ref": "#/$defs/NonBlankString",
|
|
20
|
+
"description": "调用模型时使用的机器标识。"
|
|
21
|
+
},
|
|
22
|
+
"title": {
|
|
23
|
+
"$ref": "#/$defs/NonBlankString",
|
|
24
|
+
"description": "模型的展示名称。"
|
|
25
|
+
},
|
|
26
|
+
"description": {
|
|
27
|
+
"$ref": "#/$defs/NonBlankString",
|
|
28
|
+
"description": "模型的用途说明。"
|
|
29
|
+
},
|
|
30
|
+
"usageDescription": {
|
|
31
|
+
"$ref": "#/$defs/NonBlankString",
|
|
32
|
+
"description": "模型的使用说明。"
|
|
33
|
+
},
|
|
34
|
+
"outputMediaTypes": {
|
|
35
|
+
"type": "array",
|
|
36
|
+
"description": "模型支持的输出 MIME type。",
|
|
37
|
+
"items": {
|
|
38
|
+
"$ref": "#/$defs/NonBlankString"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"parameters": {
|
|
42
|
+
"type": "array",
|
|
43
|
+
"description": "当前模型允许调用者提供的公开参数。",
|
|
44
|
+
"items": {
|
|
45
|
+
"$ref": "#/$defs/ModelParameter"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"cost": {
|
|
49
|
+
"$ref": "#/$defs/CostRange",
|
|
50
|
+
"description": "模型当前可用配置的稿豆消耗区间。"
|
|
51
|
+
},
|
|
52
|
+
"estimatedTime": {
|
|
53
|
+
"$ref": "#/$defs/EstimatedTimeRange",
|
|
54
|
+
"description": "模型当前可用配置的预估耗时区间。"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"$defs": {
|
|
58
|
+
"NonBlankString": {
|
|
59
|
+
"type": "string",
|
|
60
|
+
"minLength": 1,
|
|
61
|
+
"pattern": ".*\\S.*"
|
|
62
|
+
},
|
|
63
|
+
"CostRange": {
|
|
64
|
+
"type": "object",
|
|
65
|
+
"additionalProperties": false,
|
|
66
|
+
"required": [
|
|
67
|
+
"unit",
|
|
68
|
+
"minimum",
|
|
69
|
+
"maximum"
|
|
70
|
+
],
|
|
71
|
+
"properties": {
|
|
72
|
+
"unit": {
|
|
73
|
+
"const": "gaodou",
|
|
74
|
+
"description": "稿豆计价单位。"
|
|
75
|
+
},
|
|
76
|
+
"minimum": {
|
|
77
|
+
"type": "number",
|
|
78
|
+
"minimum": 0,
|
|
79
|
+
"description": "当前可用配置中的最低稿豆消耗。"
|
|
80
|
+
},
|
|
81
|
+
"maximum": {
|
|
82
|
+
"type": "number",
|
|
83
|
+
"minimum": 0,
|
|
84
|
+
"description": "当前可用配置中的最高稿豆消耗。"
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
"EstimatedTimeRange": {
|
|
89
|
+
"type": "object",
|
|
90
|
+
"additionalProperties": false,
|
|
91
|
+
"required": [
|
|
92
|
+
"unit",
|
|
93
|
+
"minimum",
|
|
94
|
+
"maximum"
|
|
95
|
+
],
|
|
96
|
+
"properties": {
|
|
97
|
+
"unit": {
|
|
98
|
+
"const": "second",
|
|
99
|
+
"description": "秒级耗时单位。"
|
|
100
|
+
},
|
|
101
|
+
"minimum": {
|
|
102
|
+
"type": "number",
|
|
103
|
+
"minimum": 0,
|
|
104
|
+
"description": "当前可用配置中的最短预估耗时。"
|
|
105
|
+
},
|
|
106
|
+
"maximum": {
|
|
107
|
+
"type": "number",
|
|
108
|
+
"minimum": 0,
|
|
109
|
+
"description": "当前可用配置中的最长预估耗时。"
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
"ModelParameter": {
|
|
114
|
+
"type": "object",
|
|
115
|
+
"additionalProperties": false,
|
|
116
|
+
"required": [
|
|
117
|
+
"name",
|
|
118
|
+
"type",
|
|
119
|
+
"required"
|
|
120
|
+
],
|
|
121
|
+
"properties": {
|
|
122
|
+
"name": {
|
|
123
|
+
"$ref": "#/$defs/NonBlankString",
|
|
124
|
+
"description": "调用模型时使用的参数名。"
|
|
125
|
+
},
|
|
126
|
+
"type": {
|
|
127
|
+
"type": "string",
|
|
128
|
+
"enum": [
|
|
129
|
+
"string",
|
|
130
|
+
"uri",
|
|
131
|
+
"uri[]"
|
|
132
|
+
],
|
|
133
|
+
"description": "规范化后的参数类型。"
|
|
134
|
+
},
|
|
135
|
+
"required": {
|
|
136
|
+
"type": "boolean",
|
|
137
|
+
"description": "调用当前模型时是否必须提供该参数。"
|
|
138
|
+
},
|
|
139
|
+
"description": {
|
|
140
|
+
"$ref": "#/$defs/NonBlankString",
|
|
141
|
+
"description": "参数的用途说明。"
|
|
142
|
+
},
|
|
143
|
+
"default": {
|
|
144
|
+
"anyOf": [
|
|
145
|
+
{
|
|
146
|
+
"type": "string"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"type": "number"
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"type": "boolean"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"type": "object"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"type": "array"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"type": "null"
|
|
162
|
+
}
|
|
163
|
+
],
|
|
164
|
+
"description": "服务端声明的默认值。"
|
|
165
|
+
},
|
|
166
|
+
"options": {
|
|
167
|
+
"type": "array",
|
|
168
|
+
"description": "选择型参数当前允许的值。",
|
|
169
|
+
"items": {
|
|
170
|
+
"type": "object",
|
|
171
|
+
"additionalProperties": false,
|
|
172
|
+
"required": [
|
|
173
|
+
"value"
|
|
174
|
+
],
|
|
175
|
+
"properties": {
|
|
176
|
+
"value": {
|
|
177
|
+
"$ref": "#/$defs/NonBlankString",
|
|
178
|
+
"description": "调用时提供的选项值。"
|
|
179
|
+
},
|
|
180
|
+
"label": {
|
|
181
|
+
"$ref": "#/$defs/NonBlankString",
|
|
182
|
+
"description": "选项的展示名称。"
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "ModelListInput",
|
|
4
|
+
"description": "列出当前可用创作模型的输入。",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"properties": {
|
|
8
|
+
"tool": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"minLength": 1,
|
|
11
|
+
"pattern": ".*\\S.*",
|
|
12
|
+
"description": "可选的创作工具机器标识。"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|