@insmind/cli 1.3.0
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 +11 -0
- package/contracts/operations/agent.send/input.schema.json +335 -0
- package/contracts/operations/agent.send/output.schema.json +248 -0
- package/contracts/operations/auth.status/input.schema.json +7 -0
- package/contracts/operations/auth.status/output.schema.json +119 -0
- package/contracts/operations/dam.copy/input.schema.json +42 -0
- package/contracts/operations/dam.copy/output.schema.json +43 -0
- package/contracts/operations/dam.delete/input.schema.json +24 -0
- package/contracts/operations/dam.delete/output.schema.json +5 -0
- package/contracts/operations/dam.download/input.schema.json +28 -0
- package/contracts/operations/dam.download/output.schema.json +51 -0
- package/contracts/operations/dam.folder.list/input.schema.json +36 -0
- package/contracts/operations/dam.folder.list/output.schema.json +104 -0
- package/contracts/operations/dam.get/input.schema.json +16 -0
- package/contracts/operations/dam.get/output.schema.json +107 -0
- package/contracts/operations/dam.list/input.schema.json +73 -0
- package/contracts/operations/dam.list/output.schema.json +145 -0
- package/contracts/operations/dam.move/input.schema.json +42 -0
- package/contracts/operations/dam.move/output.schema.json +40 -0
- package/contracts/operations/dam.rename/input.schema.json +42 -0
- package/contracts/operations/dam.rename/output.schema.json +43 -0
- package/contracts/operations/dam.repository.list/input.schema.json +7 -0
- package/contracts/operations/dam.repository.list/output.schema.json +65 -0
- package/contracts/operations/dam.search/input.schema.json +79 -0
- package/contracts/operations/dam.search/output.schema.json +145 -0
- package/contracts/operations/dam.tag.list/input.schema.json +21 -0
- package/contracts/operations/dam.tag.list/output.schema.json +52 -0
- package/contracts/operations/dam.upload/input.schema.json +43 -0
- package/contracts/operations/dam.upload/output.schema.json +107 -0
- package/contracts/operations/editor.apply/input.schema.json +177 -0
- package/contracts/operations/editor.apply/output.schema.json +15 -0
- package/contracts/operations/editor.connect/input.schema.json +13 -0
- package/contracts/operations/editor.connect/output.schema.json +17 -0
- package/contracts/operations/editor.disconnect/input.schema.json +7 -0
- package/contracts/operations/editor.disconnect/output.schema.json +14 -0
- package/contracts/operations/editor.save/input.schema.json +7 -0
- package/contracts/operations/editor.save/output.schema.json +23 -0
- package/contracts/operations/editor.screenshot/input.schema.json +7 -0
- package/contracts/operations/editor.screenshot/output.schema.json +16 -0
- package/contracts/operations/editor.snapshot/input.schema.json +7 -0
- package/contracts/operations/editor.snapshot/output.schema.json +148 -0
- package/contracts/operations/model.get/input.schema.json +16 -0
- package/contracts/operations/model.get/output.schema.json +167 -0
- package/contracts/operations/model.list/input.schema.json +13 -0
- package/contracts/operations/model.list/output.schema.json +97 -0
- package/contracts/operations/task.get/input.schema.json +14 -0
- package/contracts/operations/task.get/output.schema.json +103 -0
- package/contracts/operations/task.list/input.schema.json +18 -0
- package/contracts/operations/task.list/output.schema.json +53 -0
- package/contracts/operations/tool.call/input.schema.json +31 -0
- package/contracts/operations/tool.call/output.schema.json +115 -0
- package/contracts/operations/tool.list/input.schema.json +6 -0
- package/contracts/operations/tool.list/output.schema.json +40 -0
- package/dist/bin/agent-worker.js +41 -0
- package/dist/bin/insmind-cli.js +60 -0
- package/dist/bin/postinstall.js +69 -0
- package/dist/src/bootstrap/create-cli.js +124 -0
- package/dist/src/bootstrap/create-runtime.js +451 -0
- package/dist/src/bootstrap/run-agent-worker.js +37 -0
- package/dist/src/bootstrap/validators.js +169 -0
- package/dist/src/cli/action-binding.js +109 -0
- package/dist/src/cli/agent-commands.js +75 -0
- package/dist/src/cli/auth-commands.js +58 -0
- package/dist/src/cli/credits-command.js +23 -0
- package/dist/src/cli/dam-commands.js +470 -0
- package/dist/src/cli/editor-commands.js +74 -0
- package/dist/src/cli/errors.js +208 -0
- package/dist/src/cli/model-commands.js +62 -0
- package/dist/src/cli/org-commands.js +58 -0
- package/dist/src/cli/presenter.js +123 -0
- package/dist/src/cli/prompt.js +30 -0
- package/dist/src/cli/task-commands.js +48 -0
- package/dist/src/cli/tool-commands.js +101 -0
- package/dist/src/cli/update-command.js +15 -0
- package/dist/src/contracts/schema.js +4 -0
- package/dist/src/features/agent/creative-agent-adapter.js +42 -0
- package/dist/src/features/agent/creative-protocol.js +421 -0
- package/dist/src/features/agent/creative-stream.js +138 -0
- package/dist/src/features/agent/filems-resource-auth-key-provider.js +23 -0
- package/dist/src/features/agent/resource-authorizer.js +47 -0
- package/dist/src/features/agent/result-reader.js +30 -0
- package/dist/src/features/agent/use-cases.js +153 -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 +196 -0
- package/dist/src/features/auth/state.js +129 -0
- package/dist/src/features/auth/use-cases.js +162 -0
- package/dist/src/features/credits/use-cases.js +52 -0
- package/dist/src/features/dam/asset-projection.js +278 -0
- package/dist/src/features/dam/dam-api-adapter.js +562 -0
- package/dist/src/features/dam/file-downloader.js +242 -0
- package/dist/src/features/dam/object-storage.js +193 -0
- package/dist/src/features/dam/operation-executor.js +72 -0
- package/dist/src/features/dam/registered-uploader.js +247 -0
- package/dist/src/features/dam/repository-catalog.js +127 -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 +470 -0
- package/dist/src/features/editor/bridge-client.js +109 -0
- package/dist/src/features/editor/bridge-process.js +229 -0
- package/dist/src/features/editor/bridge-server.js +337 -0
- package/dist/src/features/editor/protocol.js +1 -0
- package/dist/src/features/editor/public-url.js +36 -0
- package/dist/src/features/editor/session-state.js +78 -0
- package/dist/src/features/editor/session.js +213 -0
- package/dist/src/features/editor/use-cases.js +88 -0
- package/dist/src/features/org/org-service.js +76 -0
- package/dist/src/features/org/use-cases.js +163 -0
- package/dist/src/features/skill/bundled-skills.js +63 -0
- package/dist/src/features/skill/installer.js +271 -0
- package/dist/src/features/task/agent-background.js +63 -0
- package/dist/src/features/task/store.js +97 -0
- package/dist/src/features/task/types.js +1 -0
- package/dist/src/features/task/use-cases.js +139 -0
- package/dist/src/features/tool/catalog.js +83 -0
- package/dist/src/features/tool/dynamic-schema.js +128 -0
- package/dist/src/features/tool/mns-catalog-adapter.js +265 -0
- package/dist/src/features/tool/tool-api-adapter.js +369 -0
- package/dist/src/features/tool/use-cases.js +180 -0
- package/dist/src/features/update/latest-version.js +37 -0
- package/dist/src/features/update/update-notification.js +271 -0
- package/dist/src/features/update/update-service.js +226 -0
- package/dist/src/platform/installation-owner.js +81 -0
- package/dist/src/platform/json-input.js +67 -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/remote-error-evidence.js +80 -0
- package/dist/src/platform/remote-protocol.js +10 -0
- package/dist/src/platform/resource-auth-key.js +1 -0
- package/dist/src/platform/safe-upload-file.js +146 -0
- package/dist/src/platform/signature.js +20 -0
- package/dist/src/platform/signed-http-transport.js +144 -0
- package/dist/src/platform/task-observer.js +1 -0
- package/dist/src/platform/url-safety.js +100 -0
- package/dist/src/product/billing.js +47 -0
- package/dist/src/product/config.js +85 -0
- package/dist/src/product/locale.js +38 -0
- package/dist/src/product/text.js +3 -0
- package/dist/src/telemetry/invocation.js +156 -0
- package/dist/src/telemetry/sls-sink.js +30 -0
- package/package.json +53 -0
- package/skills/insmind-cli/SKILL.md +15 -0
- package/skills/insmind-cli/references/agent.md +34 -0
- package/skills/insmind-cli/references/auth.md +8 -0
- package/skills/insmind-cli/references/creation.md +40 -0
- package/skills/insmind-cli/references/dam.md +51 -0
- package/skills/insmind-cli/references/editor.md +184 -0
- package/skills/insmind-cli/references/errors.md +29 -0
- package/skills/insmind-cli/references/generation-constraints.md +36 -0
- package/skills/insmind-cli/references/tool.md +31 -0
- package/skills/insmind-cli/references/update.md +11 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025-present GDHub Team
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# insMind CLI
|
|
2
|
+
|
|
3
|
+
The official insMind command-line interface for people, agents, and CI.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm install --global --allow-scripts=@insmind/cli @insmind/cli
|
|
7
|
+
insmind-cli auth login
|
|
8
|
+
insmind-cli --help
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Requires Node.js 20 or newer. Credentials and local runtime state are stored separately from GaoDing CLI under `~/.insmind`.
|
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "AgentSendInput",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"additionalProperties": false,
|
|
6
|
+
"required": [
|
|
7
|
+
"message"
|
|
8
|
+
],
|
|
9
|
+
"properties": {
|
|
10
|
+
"message": {
|
|
11
|
+
"$ref": "#/$defs/UserMessage"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"$defs": {
|
|
15
|
+
"UserMessage": {
|
|
16
|
+
"type": "object",
|
|
17
|
+
"additionalProperties": false,
|
|
18
|
+
"required": [
|
|
19
|
+
"parts"
|
|
20
|
+
],
|
|
21
|
+
"properties": {
|
|
22
|
+
"contextId": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"minLength": 1,
|
|
25
|
+
"pattern": ".*\\S.*"
|
|
26
|
+
},
|
|
27
|
+
"parts": {
|
|
28
|
+
"type": "array",
|
|
29
|
+
"minItems": 1,
|
|
30
|
+
"items": {
|
|
31
|
+
"$ref": "#/$defs/UserPart"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"allOf": [
|
|
36
|
+
{
|
|
37
|
+
"properties": {
|
|
38
|
+
"parts": {
|
|
39
|
+
"type": "array",
|
|
40
|
+
"contains": {
|
|
41
|
+
"anyOf": [
|
|
42
|
+
{
|
|
43
|
+
"$ref": "#/$defs/TextPart"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"$ref": "#/$defs/QuestionAnswerPart"
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
"minContains": 1
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"properties": {
|
|
56
|
+
"parts": {
|
|
57
|
+
"type": "array",
|
|
58
|
+
"contains": {
|
|
59
|
+
"$ref": "#/$defs/GenerationConstraintsPart"
|
|
60
|
+
},
|
|
61
|
+
"minContains": 0,
|
|
62
|
+
"maxContains": 1
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"properties": {
|
|
68
|
+
"parts": {
|
|
69
|
+
"type": "array",
|
|
70
|
+
"contains": {
|
|
71
|
+
"$ref": "#/$defs/QuestionAnswerPart"
|
|
72
|
+
},
|
|
73
|
+
"minContains": 0,
|
|
74
|
+
"maxContains": 1
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"properties": {
|
|
80
|
+
"parts": {
|
|
81
|
+
"type": "array",
|
|
82
|
+
"contains": {
|
|
83
|
+
"$ref": "#/$defs/FirstFramePart"
|
|
84
|
+
},
|
|
85
|
+
"minContains": 0,
|
|
86
|
+
"maxContains": 1
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"properties": {
|
|
92
|
+
"parts": {
|
|
93
|
+
"type": "array",
|
|
94
|
+
"contains": {
|
|
95
|
+
"$ref": "#/$defs/LastFramePart"
|
|
96
|
+
},
|
|
97
|
+
"minContains": 0,
|
|
98
|
+
"maxContains": 1
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"if": {
|
|
104
|
+
"properties": {
|
|
105
|
+
"parts": {
|
|
106
|
+
"type": "array",
|
|
107
|
+
"contains": {
|
|
108
|
+
"$ref": "#/$defs/QuestionAnswerPart"
|
|
109
|
+
},
|
|
110
|
+
"minContains": 1
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
"required": [
|
|
114
|
+
"parts"
|
|
115
|
+
]
|
|
116
|
+
},
|
|
117
|
+
"then": {
|
|
118
|
+
"type": "object",
|
|
119
|
+
"properties": {
|
|
120
|
+
"contextId": {
|
|
121
|
+
"type": "string"
|
|
122
|
+
},
|
|
123
|
+
"parts": {
|
|
124
|
+
"type": "array",
|
|
125
|
+
"maxItems": 1
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
"required": [
|
|
129
|
+
"contextId"
|
|
130
|
+
]
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
]
|
|
134
|
+
},
|
|
135
|
+
"UserPart": {
|
|
136
|
+
"oneOf": [
|
|
137
|
+
{
|
|
138
|
+
"$ref": "#/$defs/TextPart"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"$ref": "#/$defs/InputAssetPart"
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"$ref": "#/$defs/GenerationConstraintsPart"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"$ref": "#/$defs/QuestionAnswerPart"
|
|
148
|
+
}
|
|
149
|
+
]
|
|
150
|
+
},
|
|
151
|
+
"TextPart": {
|
|
152
|
+
"type": "object",
|
|
153
|
+
"additionalProperties": false,
|
|
154
|
+
"required": [
|
|
155
|
+
"text"
|
|
156
|
+
],
|
|
157
|
+
"properties": {
|
|
158
|
+
"text": {
|
|
159
|
+
"type": "string",
|
|
160
|
+
"minLength": 1,
|
|
161
|
+
"pattern": ".*\\S.*"
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
"InputAssetPart": {
|
|
166
|
+
"type": "object",
|
|
167
|
+
"additionalProperties": false,
|
|
168
|
+
"required": [
|
|
169
|
+
"url"
|
|
170
|
+
],
|
|
171
|
+
"properties": {
|
|
172
|
+
"url": {
|
|
173
|
+
"type": "string",
|
|
174
|
+
"format": "uri",
|
|
175
|
+
"minLength": 1,
|
|
176
|
+
"pattern": ".*\\S.*"
|
|
177
|
+
},
|
|
178
|
+
"mediaType": {
|
|
179
|
+
"type": "string",
|
|
180
|
+
"minLength": 1,
|
|
181
|
+
"pattern": ".*\\S.*"
|
|
182
|
+
},
|
|
183
|
+
"filename": {
|
|
184
|
+
"type": "string",
|
|
185
|
+
"minLength": 1,
|
|
186
|
+
"pattern": ".*\\S.*"
|
|
187
|
+
},
|
|
188
|
+
"metadata": {
|
|
189
|
+
"type": "object",
|
|
190
|
+
"additionalProperties": false,
|
|
191
|
+
"properties": {
|
|
192
|
+
"role": {
|
|
193
|
+
"type": "string",
|
|
194
|
+
"enum": [
|
|
195
|
+
"reference",
|
|
196
|
+
"first_frame",
|
|
197
|
+
"last_frame"
|
|
198
|
+
]
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
"GenerationConstraintsPart": {
|
|
205
|
+
"type": "object",
|
|
206
|
+
"additionalProperties": false,
|
|
207
|
+
"required": [
|
|
208
|
+
"data"
|
|
209
|
+
],
|
|
210
|
+
"properties": {
|
|
211
|
+
"data": {
|
|
212
|
+
"type": "object",
|
|
213
|
+
"additionalProperties": false,
|
|
214
|
+
"minProperties": 1,
|
|
215
|
+
"properties": {
|
|
216
|
+
"model": {
|
|
217
|
+
"type": "string",
|
|
218
|
+
"minLength": 1,
|
|
219
|
+
"pattern": ".*\\S.*"
|
|
220
|
+
},
|
|
221
|
+
"arguments": {
|
|
222
|
+
"type": "object",
|
|
223
|
+
"minProperties": 1,
|
|
224
|
+
"additionalProperties": true
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
"QuestionAnswerPart": {
|
|
231
|
+
"type": "object",
|
|
232
|
+
"additionalProperties": false,
|
|
233
|
+
"required": [
|
|
234
|
+
"data"
|
|
235
|
+
],
|
|
236
|
+
"properties": {
|
|
237
|
+
"data": {
|
|
238
|
+
"type": "object",
|
|
239
|
+
"additionalProperties": false,
|
|
240
|
+
"required": [
|
|
241
|
+
"questionMessageId",
|
|
242
|
+
"answers"
|
|
243
|
+
],
|
|
244
|
+
"properties": {
|
|
245
|
+
"questionMessageId": {
|
|
246
|
+
"type": "string",
|
|
247
|
+
"minLength": 1,
|
|
248
|
+
"pattern": ".*\\S.*"
|
|
249
|
+
},
|
|
250
|
+
"answers": {
|
|
251
|
+
"type": "array",
|
|
252
|
+
"minItems": 1,
|
|
253
|
+
"items": {
|
|
254
|
+
"type": "object",
|
|
255
|
+
"additionalProperties": false,
|
|
256
|
+
"required": [
|
|
257
|
+
"question",
|
|
258
|
+
"values"
|
|
259
|
+
],
|
|
260
|
+
"properties": {
|
|
261
|
+
"question": {
|
|
262
|
+
"type": "string",
|
|
263
|
+
"minLength": 1,
|
|
264
|
+
"pattern": ".*\\S.*"
|
|
265
|
+
},
|
|
266
|
+
"values": {
|
|
267
|
+
"type": "array",
|
|
268
|
+
"minItems": 1,
|
|
269
|
+
"items": {
|
|
270
|
+
"type": "string",
|
|
271
|
+
"minLength": 1,
|
|
272
|
+
"pattern": ".*\\S.*"
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
},
|
|
282
|
+
"FirstFramePart": {
|
|
283
|
+
"allOf": [
|
|
284
|
+
{
|
|
285
|
+
"$ref": "#/$defs/InputAssetPart"
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
"type": "object",
|
|
289
|
+
"properties": {
|
|
290
|
+
"metadata": {
|
|
291
|
+
"type": "object",
|
|
292
|
+
"properties": {
|
|
293
|
+
"role": {
|
|
294
|
+
"const": "first_frame"
|
|
295
|
+
}
|
|
296
|
+
},
|
|
297
|
+
"required": [
|
|
298
|
+
"role"
|
|
299
|
+
]
|
|
300
|
+
}
|
|
301
|
+
},
|
|
302
|
+
"required": [
|
|
303
|
+
"metadata"
|
|
304
|
+
]
|
|
305
|
+
}
|
|
306
|
+
]
|
|
307
|
+
},
|
|
308
|
+
"LastFramePart": {
|
|
309
|
+
"allOf": [
|
|
310
|
+
{
|
|
311
|
+
"$ref": "#/$defs/InputAssetPart"
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
"type": "object",
|
|
315
|
+
"properties": {
|
|
316
|
+
"metadata": {
|
|
317
|
+
"type": "object",
|
|
318
|
+
"properties": {
|
|
319
|
+
"role": {
|
|
320
|
+
"const": "last_frame"
|
|
321
|
+
}
|
|
322
|
+
},
|
|
323
|
+
"required": [
|
|
324
|
+
"role"
|
|
325
|
+
]
|
|
326
|
+
}
|
|
327
|
+
},
|
|
328
|
+
"required": [
|
|
329
|
+
"metadata"
|
|
330
|
+
]
|
|
331
|
+
}
|
|
332
|
+
]
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
}
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "AgentSendOutput",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"additionalProperties": false,
|
|
6
|
+
"required": [
|
|
7
|
+
"message",
|
|
8
|
+
"usage"
|
|
9
|
+
],
|
|
10
|
+
"properties": {
|
|
11
|
+
"message": {
|
|
12
|
+
"$ref": "#/$defs/AgentMessage"
|
|
13
|
+
},
|
|
14
|
+
"usage": {
|
|
15
|
+
"$ref": "#/$defs/AgentUsage"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"$defs": {
|
|
19
|
+
"ActualCost": {
|
|
20
|
+
"type": "object",
|
|
21
|
+
"additionalProperties": false,
|
|
22
|
+
"required": [
|
|
23
|
+
"unit",
|
|
24
|
+
"amount"
|
|
25
|
+
],
|
|
26
|
+
"properties": {
|
|
27
|
+
"unit": {
|
|
28
|
+
"const": "credit"
|
|
29
|
+
},
|
|
30
|
+
"amount": {
|
|
31
|
+
"type": "number",
|
|
32
|
+
"minimum": 0
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"AgentUsage": {
|
|
37
|
+
"type": "object",
|
|
38
|
+
"additionalProperties": false,
|
|
39
|
+
"required": [
|
|
40
|
+
"cost",
|
|
41
|
+
"items"
|
|
42
|
+
],
|
|
43
|
+
"properties": {
|
|
44
|
+
"cost": {
|
|
45
|
+
"$ref": "#/$defs/ActualCost"
|
|
46
|
+
},
|
|
47
|
+
"items": {
|
|
48
|
+
"type": "array",
|
|
49
|
+
"items": {
|
|
50
|
+
"type": "object",
|
|
51
|
+
"additionalProperties": false,
|
|
52
|
+
"required": [
|
|
53
|
+
"model",
|
|
54
|
+
"cost"
|
|
55
|
+
],
|
|
56
|
+
"properties": {
|
|
57
|
+
"model": {
|
|
58
|
+
"type": "string",
|
|
59
|
+
"minLength": 1,
|
|
60
|
+
"pattern": ".*\\S.*"
|
|
61
|
+
},
|
|
62
|
+
"cost": {
|
|
63
|
+
"$ref": "#/$defs/ActualCost"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"AgentMessage": {
|
|
71
|
+
"type": "object",
|
|
72
|
+
"additionalProperties": false,
|
|
73
|
+
"required": [
|
|
74
|
+
"contextId",
|
|
75
|
+
"parts"
|
|
76
|
+
],
|
|
77
|
+
"properties": {
|
|
78
|
+
"messageId": {
|
|
79
|
+
"type": "string",
|
|
80
|
+
"minLength": 1,
|
|
81
|
+
"pattern": ".*\\S.*"
|
|
82
|
+
},
|
|
83
|
+
"contextId": {
|
|
84
|
+
"type": "string",
|
|
85
|
+
"minLength": 1,
|
|
86
|
+
"pattern": ".*\\S.*"
|
|
87
|
+
},
|
|
88
|
+
"parts": {
|
|
89
|
+
"type": "array",
|
|
90
|
+
"minItems": 1,
|
|
91
|
+
"items": {
|
|
92
|
+
"$ref": "#/$defs/AgentPart"
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
"allOf": [
|
|
97
|
+
{
|
|
98
|
+
"if": {
|
|
99
|
+
"properties": {
|
|
100
|
+
"parts": {
|
|
101
|
+
"type": "array",
|
|
102
|
+
"contains": {
|
|
103
|
+
"$ref": "#/$defs/QuestionPart"
|
|
104
|
+
},
|
|
105
|
+
"minContains": 1
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
"required": [
|
|
109
|
+
"parts"
|
|
110
|
+
]
|
|
111
|
+
},
|
|
112
|
+
"then": {
|
|
113
|
+
"type": "object",
|
|
114
|
+
"properties": {
|
|
115
|
+
"messageId": {
|
|
116
|
+
"type": "string"
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
"required": [
|
|
120
|
+
"messageId"
|
|
121
|
+
]
|
|
122
|
+
},
|
|
123
|
+
"else": {
|
|
124
|
+
"properties": {
|
|
125
|
+
"messageId": false
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
]
|
|
130
|
+
},
|
|
131
|
+
"AgentPart": {
|
|
132
|
+
"oneOf": [
|
|
133
|
+
{
|
|
134
|
+
"$ref": "#/$defs/TextPart"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"$ref": "#/$defs/OutputAssetPart"
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"$ref": "#/$defs/QuestionPart"
|
|
141
|
+
}
|
|
142
|
+
]
|
|
143
|
+
},
|
|
144
|
+
"TextPart": {
|
|
145
|
+
"type": "object",
|
|
146
|
+
"additionalProperties": false,
|
|
147
|
+
"required": [
|
|
148
|
+
"text"
|
|
149
|
+
],
|
|
150
|
+
"properties": {
|
|
151
|
+
"text": {
|
|
152
|
+
"type": "string",
|
|
153
|
+
"minLength": 1,
|
|
154
|
+
"pattern": ".*\\S.*"
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
"OutputAssetPart": {
|
|
159
|
+
"type": "object",
|
|
160
|
+
"additionalProperties": false,
|
|
161
|
+
"required": [
|
|
162
|
+
"url",
|
|
163
|
+
"mediaType"
|
|
164
|
+
],
|
|
165
|
+
"properties": {
|
|
166
|
+
"url": {
|
|
167
|
+
"type": "string",
|
|
168
|
+
"format": "uri",
|
|
169
|
+
"minLength": 1,
|
|
170
|
+
"pattern": ".*\\S.*"
|
|
171
|
+
},
|
|
172
|
+
"mediaType": {
|
|
173
|
+
"type": "string",
|
|
174
|
+
"minLength": 1,
|
|
175
|
+
"pattern": ".*\\S.*"
|
|
176
|
+
},
|
|
177
|
+
"filename": {
|
|
178
|
+
"type": "string",
|
|
179
|
+
"minLength": 1,
|
|
180
|
+
"pattern": ".*\\S.*"
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
"QuestionPart": {
|
|
185
|
+
"type": "object",
|
|
186
|
+
"additionalProperties": false,
|
|
187
|
+
"required": [
|
|
188
|
+
"data"
|
|
189
|
+
],
|
|
190
|
+
"properties": {
|
|
191
|
+
"data": {
|
|
192
|
+
"type": "object",
|
|
193
|
+
"additionalProperties": false,
|
|
194
|
+
"required": [
|
|
195
|
+
"questions"
|
|
196
|
+
],
|
|
197
|
+
"properties": {
|
|
198
|
+
"title": {
|
|
199
|
+
"type": "string",
|
|
200
|
+
"minLength": 1,
|
|
201
|
+
"pattern": ".*\\S.*"
|
|
202
|
+
},
|
|
203
|
+
"questions": {
|
|
204
|
+
"type": "array",
|
|
205
|
+
"minItems": 1,
|
|
206
|
+
"items": {
|
|
207
|
+
"type": "object",
|
|
208
|
+
"additionalProperties": false,
|
|
209
|
+
"required": [
|
|
210
|
+
"question",
|
|
211
|
+
"options",
|
|
212
|
+
"allowMultiple"
|
|
213
|
+
],
|
|
214
|
+
"properties": {
|
|
215
|
+
"question": {
|
|
216
|
+
"type": "string",
|
|
217
|
+
"minLength": 1,
|
|
218
|
+
"pattern": ".*\\S.*"
|
|
219
|
+
},
|
|
220
|
+
"options": {
|
|
221
|
+
"type": "array",
|
|
222
|
+
"items": {
|
|
223
|
+
"type": "object",
|
|
224
|
+
"additionalProperties": false,
|
|
225
|
+
"required": [
|
|
226
|
+
"label"
|
|
227
|
+
],
|
|
228
|
+
"properties": {
|
|
229
|
+
"label": {
|
|
230
|
+
"type": "string",
|
|
231
|
+
"minLength": 1,
|
|
232
|
+
"pattern": ".*\\S.*"
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
"allowMultiple": {
|
|
238
|
+
"type": "boolean"
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|