@gaoding/cli 2.1.0 → 2.1.2

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.
Files changed (141) hide show
  1. package/README.md +30 -0
  2. package/contracts/operations/agent.send/input.schema.json +8 -84
  3. package/contracts/operations/agent.send/output.schema.json +6 -6
  4. package/contracts/operations/dam.folder.list/input.schema.json +1 -1
  5. package/contracts/operations/dam.folder.list/output.schema.json +1 -1
  6. package/contracts/operations/dam.list/input.schema.json +2 -5
  7. package/contracts/operations/dam.list/output.schema.json +1 -1
  8. package/contracts/operations/dam.search/input.schema.json +2 -5
  9. package/contracts/operations/dam.search/output.schema.json +1 -1
  10. package/contracts/operations/model.get/output.schema.json +6 -5
  11. package/contracts/operations/model.list/output.schema.json +5 -4
  12. package/contracts/operations/task.get/output.schema.json +22 -11
  13. package/contracts/operations/tool.call/models/image-edit-smart.schema.json +7 -5
  14. package/contracts/operations/tool.call/models/image-edit-standard.schema.json +6 -4
  15. package/contracts/operations/tool.call/models/image-enhance-smart.schema.json +5 -3
  16. package/contracts/operations/tool.call/models/image-enhance-standard.schema.json +3 -2
  17. package/contracts/operations/tool.call/models/image-expand-smart.schema.json +16 -10
  18. package/contracts/operations/tool.call/models/image-expand-standard.schema.json +13 -8
  19. package/contracts/operations/tool.call/models/image-layers-layout.schema.json +3 -2
  20. package/contracts/operations/tool.call/models/image-layers-smart.schema.json +3 -4
  21. package/contracts/operations/tool.call/models/image-matting-smart.schema.json +6 -4
  22. package/contracts/operations/tool.call/models/image-matting-standard.schema.json +3 -2
  23. package/contracts/operations/tool.call/models/image-ocr.schema.json +3 -2
  24. package/contracts/operations/tool.call/models/image-remove-smart.schema.json +6 -4
  25. package/contracts/operations/tool.call/models/image-remove-standard.schema.json +4 -3
  26. package/contracts/operations/tool.call/models/image-text-edit.schema.json +5 -3
  27. package/contracts/operations/tool.call/models/image-vectorize.schema.json +3 -2
  28. package/contracts/operations/tool.call/models/video-edit-smart.schema.json +6 -6
  29. package/contracts/operations/tool.call/models/video-enhance-smart.schema.json +7 -4
  30. package/contracts/operations/tool.call/models/video-enhance-standard.schema.json +5 -3
  31. package/contracts/operations/tool.call/ocr-payload.schema.json +4 -5
  32. package/contracts/operations/tool.call/output.schema.json +9 -8
  33. package/dist/bin/postinstall.js +22 -6
  34. package/dist/bin/sync-skill.js +33 -0
  35. package/dist/bin/task-worker.js +2 -2
  36. package/dist/src/bootstrap/create-cli.js +13 -6
  37. package/dist/src/bootstrap/create-runtime.js +103 -29
  38. package/dist/src/bootstrap/run-task-worker.js +6 -2
  39. package/dist/src/bootstrap/validators.js +87 -151
  40. package/dist/src/cli/action-binding.js +14 -37
  41. package/dist/src/cli/agent-commands.js +13 -13
  42. package/dist/src/cli/auth-commands.js +2 -1
  43. package/dist/src/cli/creation-help.js +9 -0
  44. package/dist/src/cli/dam-commands.js +10 -14
  45. package/dist/src/cli/editor-commands.js +16 -12
  46. package/dist/src/cli/errors.js +84 -26
  47. package/dist/src/cli/host-input.js +62 -5
  48. package/dist/src/cli/model-commands.js +9 -3
  49. package/dist/src/cli/observed-errors.js +7 -3
  50. package/dist/src/cli/org-commands.js +3 -1
  51. package/dist/src/cli/presenter.js +4 -5
  52. package/dist/src/cli/task-commands.js +6 -2
  53. package/dist/src/cli/tool-commands.js +12 -11
  54. package/dist/src/contracts/creation-input.js +20 -17
  55. package/dist/src/features/agent/creative-agent-adapter.js +6 -2
  56. package/dist/src/features/agent/creative-protocol.js +8 -29
  57. package/dist/src/features/agent/resource-authorizer.js +25 -17
  58. package/dist/src/features/agent/result-reader.js +31 -14
  59. package/dist/src/features/agent/use-cases.js +6 -31
  60. package/dist/src/features/auth/credential-store.js +1 -0
  61. package/dist/src/features/credits/use-cases.js +55 -28
  62. package/dist/src/features/dam/asset-projection.js +3 -6
  63. package/dist/src/features/dam/dam-api-adapter.js +30 -15
  64. package/dist/src/features/dam/object-storage.js +2 -1
  65. package/dist/src/features/dam/repository-catalog.js +30 -21
  66. package/dist/src/features/dam/use-cases.js +14 -9
  67. package/dist/src/features/editor/bridge-client.js +0 -2
  68. package/dist/src/features/editor/bridge-process.js +3 -2
  69. package/dist/src/features/editor/public-url.js +1 -36
  70. package/dist/src/features/editor/session-state.js +1 -0
  71. package/dist/src/features/editor/session.js +3 -2
  72. package/dist/src/features/editor/use-cases.js +27 -2
  73. package/dist/src/features/org/org-service.js +10 -1
  74. package/dist/src/features/org/use-cases.js +18 -4
  75. package/dist/src/features/task/process-owner.js +54 -0
  76. package/dist/src/features/task/store.js +102 -32
  77. package/dist/src/features/task/task-background.js +8 -4
  78. package/dist/src/features/task/use-cases.js +184 -84
  79. package/dist/src/features/tool/argument-paths.js +14 -0
  80. package/dist/src/features/tool/canvas-copy.js +28 -15
  81. package/dist/src/features/tool/canvas-matting.js +123 -0
  82. package/dist/src/features/tool/canvas-media.js +102 -55
  83. package/dist/src/features/tool/canvas-models.js +66 -33
  84. package/dist/src/features/tool/canvas-pricing.js +12 -0
  85. package/dist/src/features/tool/canvas-recovery.js +13 -30
  86. package/dist/src/features/tool/canvas-results.js +92 -93
  87. package/dist/src/features/tool/canvas-tool-adapter.js +134 -157
  88. package/dist/src/features/tool/canvas-video.js +44 -37
  89. package/dist/src/features/tool/catalog.js +2 -23
  90. package/dist/src/features/tool/dynamic-schema.js +42 -46
  91. package/dist/src/features/tool/ffprobe-executable.js +21 -0
  92. package/dist/src/features/tool/mns-catalog-adapter.js +61 -24
  93. package/dist/src/features/tool/resource-authorizer.js +11 -3
  94. package/dist/src/features/tool/tool-api-adapter.js +73 -82
  95. package/dist/src/features/tool/tool-definitions.js +23 -0
  96. package/dist/src/features/tool/tool-errors.js +25 -0
  97. package/dist/src/features/tool/tool-output.js +15 -0
  98. package/dist/src/features/tool/use-cases.js +74 -98
  99. package/dist/src/features/update/package-manager.js +124 -0
  100. package/dist/src/features/update/update-service.js +195 -55
  101. package/dist/src/platform/detached-spawn.js +9 -0
  102. package/dist/src/platform/file-lock.js +12 -4
  103. package/dist/src/platform/input-uri.js +23 -1
  104. package/dist/src/platform/local-json-file.js +97 -15
  105. package/dist/src/platform/media-type.js +46 -0
  106. package/dist/src/platform/open-browser.js +5 -2
  107. package/dist/src/platform/public-url.js +35 -0
  108. package/dist/src/platform/remote-error-evidence.js +33 -6
  109. package/dist/src/platform/resource-auth-key.js +35 -1
  110. package/dist/src/platform/safe-upload-file.js +38 -44
  111. package/dist/src/platform/schema-compiler.js +16 -0
  112. package/dist/src/platform/signature.js +2 -2
  113. package/dist/src/platform/signed-http-transport.js +4 -1
  114. package/dist/src/platform/url-safety.js +6 -1
  115. package/dist/src/platform/webm-header.js +41 -0
  116. package/dist/src/platform/windows-acl/LICENSE-mingw-w64 +43 -0
  117. package/dist/src/platform/windows-acl/arm64.node +0 -0
  118. package/dist/src/platform/windows-acl/ia32.node +0 -0
  119. package/dist/src/platform/windows-acl/x64.node +0 -0
  120. package/dist/src/platform/windows-host-job/arm64.exe +0 -0
  121. package/dist/src/platform/windows-host-job/ia32.exe +0 -0
  122. package/dist/src/platform/windows-host-job/sha256.json +7 -0
  123. package/dist/src/platform/windows-host-job/x64.exe +0 -0
  124. package/dist/src/platform/windows-private-state.js +72 -0
  125. package/dist/src/product/config.js +1 -1
  126. package/dist/src/telemetry/command-route.js +38 -0
  127. package/dist/src/telemetry/command-routes.json +1 -0
  128. package/dist/src/telemetry/failure-summary.js +3 -3
  129. package/dist/src/telemetry/invocation.js +1 -2
  130. package/dist/src/telemetry/process-errors.js +17 -33
  131. package/dist/src/telemetry/sanitize.js +19 -4
  132. package/dist/src/telemetry/sls-sink.js +45 -20
  133. package/package.json +4 -4
  134. package/skills/gd-cli/SKILL.md +18 -5
  135. package/skills/gd-cli/references/agent.md +9 -4
  136. package/skills/gd-cli/references/creation.md +3 -1
  137. package/skills/gd-cli/references/editor.md +7 -5
  138. package/skills/gd-cli/references/errors.md +19 -8
  139. package/skills/gd-cli/references/matting.md +3 -5
  140. package/skills/gd-cli/references/media-tools.md +10 -4
  141. package/skills/gd-cli/references/tool.md +9 -15
package/README.md CHANGED
@@ -12,12 +12,42 @@ npm install --global --allow-scripts=@gaoding/cli @gaoding/cli
12
12
  pnpm add --global --allow-build=@gaoding/cli @gaoding/cli
13
13
  ```
14
14
 
15
+ Windows PowerShell 如果提示系统禁止运行 `gd-cli.ps1`,请直接运行同一安装提供的 `gd-cli.cmd`,例如 `gd-cli.cmd --help`。其他参数与命令相同。
16
+
17
+ Windows 共享文件可直接把 UNC 路径传给 `dam upload`。Tool 和 Agent 的媒体字段使用 `file://主机/共享名/文件`。当共享主机写作 `localhost` 时,Node 的 `pathToFileURL` 会省略主机名,可用 Python 的 `PureWindowsPath(path).as_uri()` 保留它。
18
+
19
+ 如果 pnpm 生成的 Windows 启动器报 `MODULE_NOT_FOUND`,且错误中的中文安装路径已乱码,可在当前 CMD 执行 `chcp 65001`,再运行 `gd-cli.cmd`。npm 自定义目录含 `&` 等字符时,若启动器截断了路径,可以直接运行 `node "<原 npm prefix>\node_modules\@gaoding\cli\dist\bin\gd-cli.js" update`,再用同一入口执行 `--version` 核对。
20
+
15
21
  全局安装和后续包升级会自动同步随包 `gd-cli` Agent Skill 到 canonical 目录,并连接已检测到的 Agent 宿主。npm 的 `--allow-scripts=@gaoding/cli` 与 pnpm 的 `--allow-build=@gaoding/cli` 分别只允许本包执行安装脚本。若安装时使用了 `--ignore-scripts`,执行以下命令补齐:
16
22
 
17
23
  ```bash
18
24
  gd-cli update
19
25
  ```
20
26
 
27
+ 提前准备 tarball 和 pnpm 依赖缓存;直接离线安装固定版本的 pnpm tarball 后,如安装脚本未执行,可通过已安装的 pnpm 启动器同步并验收该版本的 Skill(不会联网或升级 CLI):
28
+
29
+ ```sh
30
+ node -e 'const f=require("fs"),p=require("path"),c=require("child_process"),d=process.argv[1],s=p.join(d,process.platform==="win32"?"gd-cli.cmd":"gd-cli"),v=f.readFileSync(s,"utf8"),m=v.match(/cmd-shim-target=(.+)/i)||v.match(/"\$basedir\/([^"\r\n]+\.js)"/);if(!m)throw Error("Cannot identify pnpm launcher target");const t=p.resolve(d,m[1].trim()),r=c.spawnSync(process.execPath,[p.join(p.dirname(t),"sync-skill.js")],{stdio:"inherit"});process.exit(r.status??1)' "$(pnpm bin --global)"
31
+ ```
32
+
33
+ Windows PowerShell:
34
+
35
+ ```powershell
36
+ $previousEncoding = [Console]::OutputEncoding
37
+ try { [Console]::OutputEncoding = [Text.UTF8Encoding]::new(); $bin = (pnpm bin --global).Trim() }
38
+ finally { [Console]::OutputEncoding = $previousEncoding }
39
+ $shim = Get-Content -Encoding UTF8 -LiteralPath (Join-Path $bin "gd-cli.cmd") -Raw
40
+ if ($shim -match 'cmd-shim-target=(.+)') { $entry = $Matches[1].Trim() }
41
+ elseif ($shim -match '"%~dp0\\([^"\r\n]+\.js)"') { $entry = $Matches[1] }
42
+ else { throw "Cannot identify pnpm launcher target" }
43
+ if ([IO.Path]::IsPathRooted($entry)) { $target = [IO.Path]::GetFullPath($entry) }
44
+ else { $target = [IO.Path]::GetFullPath((Join-Path $bin $entry)) }
45
+ node (Join-Path (Split-Path $target) "sync-skill.js")
46
+ ```
47
+
48
+
49
+ 宿主管理的安装不使用此步骤;已有外来 Skill 不会被覆盖。
50
+
21
51
  ## 开始使用
22
52
 
23
53
  ```bash
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "title": "AgentSendInput",
4
- "description": "发送给稿定 Agent 的结构化创作消息。",
4
+ "description": "发送一次业务策划或持续创作消息;先读 agent send --help 了解本轮回复、续聊与任务取回。",
5
5
  "type": "object",
6
6
  "additionalProperties": false,
7
7
  "required": [
@@ -25,7 +25,7 @@
25
25
  "type": "string",
26
26
  "minLength": 1,
27
27
  "pattern": ".*\\S.*",
28
- "description": "继续已有创作 Context 时使用服务端返回的标识。"
28
+ "description": "首次省略;继续同一创作(包括回答补充/确认)时原样使用上一轮 message.contextId,不使用 taskId。"
29
29
  },
30
30
  "parts": {
31
31
  "type": "array",
@@ -79,30 +79,6 @@
79
79
  }
80
80
  }
81
81
  },
82
- {
83
- "properties": {
84
- "parts": {
85
- "type": "array",
86
- "contains": {
87
- "$ref": "#/$defs/FirstFramePart"
88
- },
89
- "minContains": 0,
90
- "maxContains": 1
91
- }
92
- }
93
- },
94
- {
95
- "properties": {
96
- "parts": {
97
- "type": "array",
98
- "contains": {
99
- "$ref": "#/$defs/LastFramePart"
100
- },
101
- "minContains": 0,
102
- "maxContains": 1
103
- }
104
- }
105
- },
106
82
  {
107
83
  "if": {
108
84
  "properties": {
@@ -179,7 +155,7 @@
179
155
  "format": "uri",
180
156
  "minLength": 1,
181
157
  "pattern": ".*\\S.*",
182
- "description": "HTTP(S) 素材或由 CLI 处理的 file:// 本地文件。"
158
+ "description": "HTTP(S) 素材 URL,或 CLI 使用的标准本地 file URI。用 Python Path(path).resolve().as_uri() / Node.js pathToFileURL(path).href 从真实路径生成,转义中文、空格和 #;已有 HTTP(S) URL 原样使用。"
183
159
  },
184
160
  "mediaType": {
185
161
  "type": "string",
@@ -200,12 +176,12 @@
200
176
  "properties": {
201
177
  "role": {
202
178
  "type": "string",
203
- "enum": [
179
+ "examples": [
204
180
  "reference",
205
181
  "first_frame",
206
182
  "last_frame"
207
183
  ],
208
- "description": "素材角色;省略时按 reference 处理。"
184
+ "description": "素材角色;常用 reference、first_frame、last_frame,省略按 reference 处理。其他服务角色按所给字符串传递。"
209
185
  }
210
186
  }
211
187
  }
@@ -254,18 +230,18 @@
254
230
  "questionMessageId",
255
231
  "answers"
256
232
  ],
257
- "description": "对上一轮 Agent 追问的回答。",
233
+ "description": "回答上一轮 Agent 的结构化补充/确认问题;该 Part 必须是 parts 唯一一项,同时沿用 message.contextId。普通文本续聊用 TextPart。",
258
234
  "properties": {
259
235
  "questionMessageId": {
260
236
  "type": "string",
261
237
  "minLength": 1,
262
238
  "pattern": ".*\\S.*",
263
- "description": "上一轮追问消息的标识。"
239
+ "description": "上一轮返回的 message.messageId 原值;不是 taskId 或 contextId。"
264
240
  },
265
241
  "answers": {
266
242
  "type": "array",
267
243
  "minItems": 1,
268
- "description": "按问题原文给出的回答。",
244
+ "description": "保留上一轮 questions 中的 question 原文,values 使用用户选择或自由回答,不擅自替用户作答。",
269
245
  "items": {
270
246
  "type": "object",
271
247
  "additionalProperties": false,
@@ -296,58 +272,6 @@
296
272
  }
297
273
  }
298
274
  }
299
- },
300
- "FirstFramePart": {
301
- "allOf": [
302
- {
303
- "$ref": "#/$defs/InputAssetPart"
304
- },
305
- {
306
- "type": "object",
307
- "properties": {
308
- "metadata": {
309
- "type": "object",
310
- "properties": {
311
- "role": {
312
- "const": "first_frame"
313
- }
314
- },
315
- "required": [
316
- "role"
317
- ]
318
- }
319
- },
320
- "required": [
321
- "metadata"
322
- ]
323
- }
324
- ]
325
- },
326
- "LastFramePart": {
327
- "allOf": [
328
- {
329
- "$ref": "#/$defs/InputAssetPart"
330
- },
331
- {
332
- "type": "object",
333
- "properties": {
334
- "metadata": {
335
- "type": "object",
336
- "properties": {
337
- "role": {
338
- "const": "last_frame"
339
- }
340
- },
341
- "required": [
342
- "role"
343
- ]
344
- }
345
- },
346
- "required": [
347
- "metadata"
348
- ]
349
- }
350
- ]
351
275
  }
352
276
  }
353
277
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "title": "AgentSendOutput",
4
- "description": "稿定 Agent 同步返回的最终消息与实际稿豆消耗。",
4
+ "description": "本轮 Agent 的完整回复及实际消耗;回复可能是文本、资源或补充/确认问题,不保证本轮已有成品。",
5
5
  "type": "object",
6
6
  "additionalProperties": false,
7
7
  "required": [
@@ -11,11 +11,11 @@
11
11
  "properties": {
12
12
  "message": {
13
13
  "$ref": "#/$defs/AgentMessage",
14
- "description": "本次调用返回的最终 Agent 消息。"
14
+ "description": "本轮已完成的回复;读取 parts 后决定交付实际资源、转述文本或向用户提问。"
15
15
  },
16
16
  "usage": {
17
17
  "$ref": "#/$defs/AgentUsage",
18
- "description": "本次调用由最终消息结算的实际稿豆消耗。"
18
+ "description": "本轮服务已确认的实扣合计;若命令提示计费记录不完整,此数仅是已知部分,请以对应账单为准。"
19
19
  }
20
20
  },
21
21
  "$defs": {
@@ -48,7 +48,7 @@
48
48
  "properties": {
49
49
  "cost": {
50
50
  "$ref": "#/$defs/ActualCost",
51
- "description": "本次 Agent 调用的实际总消耗。"
51
+ "description": "本轮有有效实扣记录的金额合计;若命令提示计费不完整,以账单为准,不能据此推断免费。"
52
52
  },
53
53
  "items": {
54
54
  "type": "array",
@@ -99,7 +99,7 @@
99
99
  "parts": {
100
100
  "type": "array",
101
101
  "minItems": 1,
102
- "description": "最终文本、素材或有效追问。",
102
+ "description": "本轮文本、资源或有效问题;按实际内容交付,不能把计划或确认文本说成图片/视频已生成。续聊沿用 contextId,结构化答复使用 messageId。",
103
103
  "items": {
104
104
  "$ref": "#/$defs/AgentPart"
105
105
  }
@@ -181,7 +181,7 @@
181
181
  "format": "uri",
182
182
  "minLength": 1,
183
183
  "pattern": ".*\\S.*",
184
- "description": "生成素材的访问 URL。"
184
+ "description": "生成素材的完整访问 URL。交付时原样保留查询参数,不截断、拼接或按诊断日志脱敏规则删除授权参数。"
185
185
  },
186
186
  "mediaType": {
187
187
  "type": "string",
@@ -9,7 +9,7 @@
9
9
  "parentId": { "$ref": "#/$defs/nonblank", "default": "0", "description": "父文件夹 ID。" },
10
10
  "query": { "$ref": "#/$defs/nonblank", "description": "文件夹标题关键词。" },
11
11
  "page": { "type": "integer", "minimum": 1, "default": 1, "description": "页码。" },
12
- "pageSize": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20, "description": "每页数量。" }
12
+ "pageSize": { "type": "integer", "minimum": 1, "default": 20, "description": "每页数量。" }
13
13
  },
14
14
  "$defs": { "nonblank": { "type": "string", "minLength": 1, "pattern": ".*\\S.*" } }
15
15
  }
@@ -9,7 +9,7 @@
9
9
  "repository_id": { "$ref": "#/$defs/nonblank" },
10
10
  "parent_id": { "$ref": "#/$defs/nonblank" },
11
11
  "page": { "type": "integer", "minimum": 1 },
12
- "page_size": { "type": "integer", "minimum": 1, "maximum": 100 },
12
+ "page_size": { "type": "integer", "minimum": 1 },
13
13
  "total": { "type": "integer", "minimum": 0 },
14
14
  "folders": { "type": "array", "items": { "$ref": "#/$defs/folder" } }
15
15
  },
@@ -16,20 +16,17 @@
16
16
  "type": { "$ref": "#/$defs/assetType", "description": "素材类型。" },
17
17
  "assetFormats": {
18
18
  "type": "array",
19
- "minItems": 1,
20
- "items": { "$ref": "#/$defs/nonblank" },
19
+ "items": { "type": "string" },
21
20
  "description": "文件格式筛选。"
22
21
  },
23
22
  "tagIds": {
24
23
  "type": "array",
25
- "minItems": 1,
26
- "items": { "$ref": "#/$defs/nonblank" },
24
+ "items": { "type": "string" },
27
25
  "description": "标签 ID 筛选。"
28
26
  },
29
27
  "pageSize": {
30
28
  "type": "integer",
31
29
  "minimum": 1,
32
- "maximum": 100,
33
30
  "description": "DAM 请求的分页大小。"
34
31
  },
35
32
  "cursor": { "$ref": "#/$defs/nonblank", "description": "分页游标。" }
@@ -12,7 +12,7 @@
12
12
  "items": { "$ref": "#/$defs/nonblank" },
13
13
  "description": "本次查询的资源库 ID。"
14
14
  },
15
- "page_size": { "type": "integer", "minimum": 1, "maximum": 100, "description": "本次 DAM 请求的分页大小;实际 assets 数量可能大于该值。" },
15
+ "page_size": { "type": "integer", "minimum": 1, "description": "本次 DAM 请求的分页大小;实际 assets 数量可能大于该值。" },
16
16
  "total": { "type": "integer", "minimum": 0, "description": "匹配素材总数。" },
17
17
  "finish": { "type": "boolean", "description": "是否已到最后一页。" },
18
18
  "next_cursor": { "$ref": "#/$defs/nonblank", "description": "下一页游标。" },
@@ -18,20 +18,17 @@
18
18
  "type": { "$ref": "#/$defs/assetType", "description": "素材类型。" },
19
19
  "assetFormats": {
20
20
  "type": "array",
21
- "minItems": 1,
22
- "items": { "$ref": "#/$defs/nonblank" },
21
+ "items": { "type": "string" },
23
22
  "description": "文件格式筛选。"
24
23
  },
25
24
  "tagIds": {
26
25
  "type": "array",
27
- "minItems": 1,
28
- "items": { "$ref": "#/$defs/nonblank" },
26
+ "items": { "type": "string" },
29
27
  "description": "标签 ID 筛选。"
30
28
  },
31
29
  "pageSize": {
32
30
  "type": "integer",
33
31
  "minimum": 1,
34
- "maximum": 100,
35
32
  "description": "DAM 请求的分页大小。"
36
33
  },
37
34
  "cursor": { "$ref": "#/$defs/nonblank", "description": "分页游标。" }
@@ -12,7 +12,7 @@
12
12
  "items": { "$ref": "#/$defs/nonblank" },
13
13
  "description": "本次查询的资源库 ID。"
14
14
  },
15
- "page_size": { "type": "integer", "minimum": 1, "maximum": 100, "description": "本次 DAM 请求的分页大小;实际 assets 数量可能大于该值。" },
15
+ "page_size": { "type": "integer", "minimum": 1, "description": "本次 DAM 请求的分页大小;实际 assets 数量可能大于该值。" },
16
16
  "total": { "type": "integer", "minimum": 0, "description": "匹配素材总数。" },
17
17
  "finish": { "type": "boolean", "description": "是否已到最后一页。" },
18
18
  "next_cursor": { "$ref": "#/$defs/nonblank", "description": "下一页游标。" },
@@ -47,7 +47,7 @@
47
47
  },
48
48
  "cost": {
49
49
  "$ref": "#/$defs/CostRange",
50
- "description": "模型当前可用配置的稿豆消耗区间。"
50
+ "description": "当前配置的目录预估价格区间,不表示实际扣费;计量模型的公式见 usageDescription。"
51
51
  },
52
52
  "estimatedTime": {
53
53
  "$ref": "#/$defs/EstimatedTimeRange",
@@ -55,7 +55,7 @@
55
55
  },
56
56
  "inputSchema": {
57
57
  "type": "object",
58
- "description": "当前 Tool/Model 完整 JSON Schema,与执行校验使用同一来源。",
58
+ "description": "当前 Tool/Model 的完整公开输入 Schema,指导字段、类型、媒体角色和取值;CLI 仅检查自身构造请求所必需的条件,业务接受性由执行服务判断。",
59
59
  "additionalProperties": true
60
60
  }
61
61
  },
@@ -81,14 +81,15 @@
81
81
  "minimum": {
82
82
  "type": "number",
83
83
  "minimum": 0,
84
- "description": "当前可用配置中的最低稿豆消耗。"
84
+ "description": "目录预估价格区间的下限。"
85
85
  },
86
86
  "maximum": {
87
87
  "type": "number",
88
88
  "minimum": 0,
89
- "description": "当前可用配置中的最高稿豆消耗。"
89
+ "description": "目录预估价格区间的上限。"
90
90
  }
91
- }
91
+ },
92
+ "description": "Model Catalog 目录估价,不是实际扣费;minimum 与 maximum 相等也仍是估价。"
92
93
  },
93
94
  "EstimatedTimeRange": {
94
95
  "type": "object",
@@ -38,14 +38,15 @@
38
38
  "minimum": {
39
39
  "type": "number",
40
40
  "minimum": 0,
41
- "description": "当前可用配置中的最低稿豆消耗。"
41
+ "description": "目录预估价格区间的下限。"
42
42
  },
43
43
  "maximum": {
44
44
  "type": "number",
45
45
  "minimum": 0,
46
- "description": "当前可用配置中的最高稿豆消耗。"
46
+ "description": "目录预估价格区间的上限。"
47
47
  }
48
- }
48
+ },
49
+ "description": "Model Catalog 目录估价,不是实际扣费;minimum 与 maximum 相等也仍是估价。"
49
50
  },
50
51
  "EstimatedTimeRange": {
51
52
  "type": "object",
@@ -99,7 +100,7 @@
99
100
  },
100
101
  "cost": {
101
102
  "$ref": "#/$defs/CostRange",
102
- "description": "模型当前可用配置的稿豆消耗区间。"
103
+ "description": "当前配置的目录预估价格区间,不表示实际扣费。"
103
104
  },
104
105
  "estimatedTime": {
105
106
  "$ref": "#/$defs/EstimatedTimeRange",
@@ -44,25 +44,30 @@
44
44
  "properties": {
45
45
  "taskId": {
46
46
  "type": "string",
47
- "format": "uuid"
47
+ "format": "uuid",
48
+ "description": "本机原创作的任务 ID;用 task get 继续取回,不用于 Agent 续聊。"
48
49
  },
49
50
  "operation": {
50
51
  "enum": [
51
52
  "agent.send",
52
53
  "tool.call"
53
- ]
54
+ ],
55
+ "description": "决定 result 的结构及费用含义:agent.send 为本轮回复和实扣,tool.call 为工具产物和估价。"
54
56
  },
55
57
  "label": {
56
58
  "type": "string",
57
- "maxLength": 200
59
+ "maxLength": 200,
60
+ "description": "用于在任务列表定位原需求的摘要,不是结果。"
58
61
  },
59
62
  "createdAt": {
60
63
  "type": "string",
61
- "format": "date-time"
64
+ "format": "date-time",
65
+ "description": "本地任务创建时刻。"
62
66
  },
63
67
  "updatedAt": {
64
68
  "type": "string",
65
- "format": "date-time"
69
+ "format": "date-time",
70
+ "description": "本地记录最近更新时刻,不等同服务端完成时间。"
66
71
  },
67
72
  "state": {
68
73
  "enum": [
@@ -70,14 +75,17 @@
70
75
  "completed",
71
76
  "failed",
72
77
  "unknown"
73
- ]
78
+ ],
79
+ "description": "running 表示仍在执行。现在需要结果时继续查同一 ID,明确稍后取回时先交接 ID 和状态。completed 时交付 result 中的实际内容。failed 时根据 note 说明原因。unknown 时保留原 ID 核查。"
74
80
  },
75
81
  "contextId": {
76
82
  "type": "string",
77
- "minLength": 1
83
+ "minLength": 1,
84
+ "description": "Agent 对话上下文;续聊使用结果中的 message.contextId,查询仍用 taskId。"
78
85
  },
79
86
  "note": {
80
- "type": "string"
87
+ "type": "string",
88
+ "description": "已有事实、失败或无法确认原因;保留其含义,不据查询成功推断生成成功。"
81
89
  },
82
90
  "result": {
83
91
  "oneOf": [
@@ -87,7 +95,8 @@
87
95
  {
88
96
  "$ref": "../tool.call/output.schema.json"
89
97
  }
90
- ]
98
+ ],
99
+ "description": "仅 completed 时提供原调用完整结果;同一 taskId 重读不累计 usage。Tool cost.minimum/maximum 是估价,Agent cost.amount 是本轮实扣。交付本次返回的完整链接;再次查询可更新稿定结构化资源的授权,第三方签名和正文保持原样。"
91
100
  },
92
101
  "partialResult": {
93
102
  "oneOf": [
@@ -97,7 +106,9 @@
97
106
  {
98
107
  "$ref": "../tool.call/output.schema.json"
99
108
  }
100
- ]
109
+ ],
110
+ "description": "已取得的消息或中间结果快照,不证明本轮完成;不能当作完整交付或最终费用。"
101
111
  }
102
- }
112
+ },
113
+ "description": "原创作调用的当前状态;查询退出码 0 不代表该任务完成。依 state 和 operation 读取结果,不重复发起创作。"
103
114
  }
@@ -11,22 +11,24 @@
11
11
  "properties": {
12
12
  "model": {
13
13
  "type": "string",
14
- "const": "image-edit-smart"
14
+ "const": "image-edit-smart",
15
+ "description": "本次调用的模型机器标识;使用当前 model list/get 返回值。"
15
16
  },
16
17
  "image": {
17
18
  "type": "string",
18
19
  "format": "uri",
19
- "description": "单个 HTTP(S) 或 CLI file:// 素材 URI。"
20
+ "description": "本次要处理的原图 URI;HTTP(S) URL 或标准 file URI。参考图另放 referenceImages(若该模型支持),不与原图互换。"
20
21
  },
21
22
  "prompt": {
22
23
  "type": "string",
23
24
  "minLength": 1,
24
- "pattern": ".*\\S.*"
25
+ "pattern": ".*\\S.*",
26
+ "description": "说明本次处理目标、需要的变化和需保留内容;按用户要求填写,媒体本身放在对应 URI 字段。"
25
27
  },
26
28
  "mask": {
27
29
  "type": "string",
28
30
  "format": "uri",
29
- "description": "与校正 EXIF 后原图同尺寸的全不透明二值 PNG,只含纯黑和纯白;非空白区标识处理目标,全白表示全图。CLI 将选区转为视觉边界提示,不能保证黑区像素完全不变。"
31
+ "description": "与校正 EXIF 后原图同尺寸的全不透明二值 PNG。白色选中处理目标,黑色表示选区外。白色选区须非空,全白表示选中全图。RGB 只用 0/0/0 或 255/255/255,有 alpha 时全部为 255。请将彩色圈选或带半透明、灰边的预览另制为蒙版。CLI 将选区轮廓标在主图上供模型参考,模型可能改动选区外的内容。"
30
32
  },
31
33
  "referenceImages": {
32
34
  "type": "array",
@@ -36,7 +38,7 @@
36
38
  "description": "单个 HTTP(S) 或 CLI file:// 素材 URI。"
37
39
  },
38
40
  "minItems": 1,
39
- "uniqueItems": true
41
+ "description": "额外参考图片 URI 数组,按顺序说明各图用途;不代替原图或 mask。"
40
42
  }
41
43
  }
42
44
  }
@@ -12,22 +12,24 @@
12
12
  "properties": {
13
13
  "model": {
14
14
  "type": "string",
15
- "const": "image-edit-standard"
15
+ "const": "image-edit-standard",
16
+ "description": "本次调用的模型机器标识;使用当前 model list/get 返回值。"
16
17
  },
17
18
  "image": {
18
19
  "type": "string",
19
20
  "format": "uri",
20
- "description": "单个 HTTP(S) 或 CLI file:// 素材 URI。"
21
+ "description": "本次要处理的原图 URI;HTTP(S) URL 或标准 file URI。参考图另放 referenceImages(若该模型支持),不与原图互换。"
21
22
  },
22
23
  "mask": {
23
24
  "type": "string",
24
25
  "format": "uri",
25
- "description": "与校正 EXIF 后原图同尺寸的全不透明二值 PNG,只含纯黑和纯白。白色处理、黑色保护;白区须非空,全白表示处理全图。"
26
+ "description": "与校正 EXIF 后原图同尺寸的全不透明二值 PNG,只含纯黑和纯白。白色处理、黑色保护;白区须非空,全白表示处理全图。 像素 RGB 只能全为 0 或全为 255;有 alpha 时全部为 255。不要提交半透明、灰阶抗锯齿或彩色圈选预览。"
26
27
  },
27
28
  "prompt": {
28
29
  "type": "string",
29
30
  "minLength": 1,
30
- "pattern": ".*\\S.*"
31
+ "pattern": ".*\\S.*",
32
+ "description": "说明本次处理目标、需要的变化和需保留内容;按用户要求填写,媒体本身放在对应 URI 字段。"
31
33
  }
32
34
  }
33
35
  }
@@ -11,17 +11,19 @@
11
11
  "properties": {
12
12
  "model": {
13
13
  "type": "string",
14
- "const": "image-enhance-smart"
14
+ "const": "image-enhance-smart",
15
+ "description": "本次调用的模型机器标识;使用当前 model list/get 返回值。"
15
16
  },
16
17
  "image": {
17
18
  "type": "string",
18
19
  "format": "uri",
19
- "description": "单个 HTTP(S) 或 CLI file:// 素材 URI。"
20
+ "description": "本次要处理的原图 URI;HTTP(S) URL 或标准 file URI。参考图另放 referenceImages(若该模型支持),不与原图互换。"
20
21
  },
21
22
  "prompt": {
22
23
  "type": "string",
23
24
  "minLength": 1,
24
- "pattern": ".*\\S.*"
25
+ "pattern": ".*\\S.*",
26
+ "description": "说明本次处理目标、需要的变化和需保留内容;按用户要求填写,媒体本身放在对应 URI 字段。"
25
27
  }
26
28
  }
27
29
  }
@@ -11,12 +11,13 @@
11
11
  "properties": {
12
12
  "model": {
13
13
  "type": "string",
14
- "const": "image-enhance-standard"
14
+ "const": "image-enhance-standard",
15
+ "description": "本次调用的模型机器标识;使用当前 model list/get 返回值。"
15
16
  },
16
17
  "image": {
17
18
  "type": "string",
18
19
  "format": "uri",
19
- "description": "单个 HTTP(S) 或 CLI file:// 素材 URI。"
20
+ "description": "本次要处理的原图 URI;HTTP(S) URL 或标准 file URI。参考图另放 referenceImages(若该模型支持),不与原图互换。"
20
21
  },
21
22
  "targetLongEdge": {
22
23
  "type": "integer",