@gaoding/cli 2.0.0 → 2.1.1

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 (132) hide show
  1. package/README.md +5 -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/credits.get/input.schema.json +9 -0
  5. package/contracts/operations/credits.get/output.schema.json +107 -0
  6. package/contracts/operations/credits.usage.get/input.schema.json +18 -0
  7. package/contracts/operations/credits.usage.get/output.schema.json +53 -0
  8. package/contracts/operations/credits.usage.list/input.schema.json +32 -0
  9. package/contracts/operations/credits.usage.list/output.schema.json +144 -0
  10. package/contracts/operations/dam.folder.list/input.schema.json +1 -1
  11. package/contracts/operations/dam.folder.list/output.schema.json +1 -1
  12. package/contracts/operations/dam.list/input.schema.json +2 -5
  13. package/contracts/operations/dam.list/output.schema.json +1 -1
  14. package/contracts/operations/dam.search/input.schema.json +2 -5
  15. package/contracts/operations/dam.search/output.schema.json +1 -1
  16. package/contracts/operations/model.get/output.schema.json +6 -5
  17. package/contracts/operations/model.list/output.schema.json +5 -4
  18. package/contracts/operations/task.get/output.schema.json +22 -11
  19. package/contracts/operations/tool.call/models/image-edit-smart.schema.json +7 -5
  20. package/contracts/operations/tool.call/models/image-edit-standard.schema.json +6 -4
  21. package/contracts/operations/tool.call/models/image-enhance-smart.schema.json +5 -3
  22. package/contracts/operations/tool.call/models/image-enhance-standard.schema.json +3 -2
  23. package/contracts/operations/tool.call/models/image-expand-smart.schema.json +16 -10
  24. package/contracts/operations/tool.call/models/image-expand-standard.schema.json +13 -8
  25. package/contracts/operations/tool.call/models/image-layers-layout.schema.json +3 -2
  26. package/contracts/operations/tool.call/models/image-layers-smart.schema.json +3 -4
  27. package/contracts/operations/tool.call/models/image-matting-smart.schema.json +6 -4
  28. package/contracts/operations/tool.call/models/image-matting-standard.schema.json +3 -2
  29. package/contracts/operations/tool.call/models/image-ocr.schema.json +3 -2
  30. package/contracts/operations/tool.call/models/image-remove-smart.schema.json +6 -4
  31. package/contracts/operations/tool.call/models/image-remove-standard.schema.json +4 -3
  32. package/contracts/operations/tool.call/models/image-text-edit.schema.json +5 -3
  33. package/contracts/operations/tool.call/models/image-vectorize.schema.json +3 -2
  34. package/contracts/operations/tool.call/models/video-edit-smart.schema.json +6 -6
  35. package/contracts/operations/tool.call/models/video-enhance-smart.schema.json +7 -4
  36. package/contracts/operations/tool.call/models/video-enhance-standard.schema.json +5 -3
  37. package/contracts/operations/tool.call/ocr-payload.schema.json +4 -5
  38. package/contracts/operations/tool.call/output.schema.json +9 -8
  39. package/dist/bin/postinstall.js +22 -6
  40. package/dist/bin/task-worker.js +2 -2
  41. package/dist/src/bootstrap/create-cli.js +31 -15
  42. package/dist/src/bootstrap/create-runtime.js +103 -30
  43. package/dist/src/bootstrap/run-task-worker.js +6 -2
  44. package/dist/src/bootstrap/validators.js +4 -1
  45. package/dist/src/cli/action-binding.js +17 -50
  46. package/dist/src/cli/agent-commands.js +11 -11
  47. package/dist/src/cli/auth-commands.js +2 -1
  48. package/dist/src/cli/creation-help.js +9 -0
  49. package/dist/src/cli/credits-command.js +127 -16
  50. package/dist/src/cli/dam-commands.js +10 -14
  51. package/dist/src/cli/editor-commands.js +7 -5
  52. package/dist/src/cli/errors.js +81 -22
  53. package/dist/src/cli/host-input.js +64 -5
  54. package/dist/src/cli/model-commands.js +9 -3
  55. package/dist/src/cli/observed-errors.js +7 -3
  56. package/dist/src/cli/org-commands.js +3 -1
  57. package/dist/src/cli/presenter.js +4 -0
  58. package/dist/src/cli/task-commands.js +6 -2
  59. package/dist/src/cli/tool-commands.js +12 -11
  60. package/dist/src/cli/update-command.js +24 -1
  61. package/dist/src/features/agent/creative-agent-adapter.js +6 -2
  62. package/dist/src/features/agent/creative-protocol.js +8 -29
  63. package/dist/src/features/agent/resource-authorizer.js +25 -17
  64. package/dist/src/features/agent/result-reader.js +31 -14
  65. package/dist/src/features/agent/use-cases.js +6 -31
  66. package/dist/src/features/credits/amount.js +51 -0
  67. package/dist/src/features/credits/response.js +11 -0
  68. package/dist/src/features/credits/use-cases.js +200 -30
  69. package/dist/src/features/dam/asset-projection.js +3 -6
  70. package/dist/src/features/dam/dam-api-adapter.js +30 -15
  71. package/dist/src/features/dam/repository-catalog.js +30 -21
  72. package/dist/src/features/dam/use-cases.js +12 -7
  73. package/dist/src/features/editor/bridge-client.js +0 -2
  74. package/dist/src/features/editor/public-url.js +1 -36
  75. package/dist/src/features/editor/session.js +3 -2
  76. package/dist/src/features/editor/use-cases.js +27 -2
  77. package/dist/src/features/org/org-service.js +10 -1
  78. package/dist/src/features/org/use-cases.js +18 -4
  79. package/dist/src/features/task/process-owner.js +54 -0
  80. package/dist/src/features/task/store.js +37 -10
  81. package/dist/src/features/task/task-background.js +5 -2
  82. package/dist/src/features/task/use-cases.js +184 -84
  83. package/dist/src/features/tool/argument-paths.js +14 -0
  84. package/dist/src/features/tool/canvas-copy.js +28 -15
  85. package/dist/src/features/tool/canvas-matting.js +123 -0
  86. package/dist/src/features/tool/canvas-media.js +100 -52
  87. package/dist/src/features/tool/canvas-models.js +66 -33
  88. package/dist/src/features/tool/canvas-pricing.js +12 -0
  89. package/dist/src/features/tool/canvas-recovery.js +13 -30
  90. package/dist/src/features/tool/canvas-results.js +79 -87
  91. package/dist/src/features/tool/canvas-tool-adapter.js +134 -157
  92. package/dist/src/features/tool/canvas-video.js +44 -37
  93. package/dist/src/features/tool/dynamic-schema.js +39 -40
  94. package/dist/src/features/tool/ffprobe-executable.js +21 -0
  95. package/dist/src/features/tool/mns-catalog-adapter.js +61 -24
  96. package/dist/src/features/tool/resource-authorizer.js +11 -3
  97. package/dist/src/features/tool/tool-api-adapter.js +73 -82
  98. package/dist/src/features/tool/tool-errors.js +25 -0
  99. package/dist/src/features/tool/tool-output.js +15 -0
  100. package/dist/src/features/tool/use-cases.js +74 -98
  101. package/dist/src/features/update/check-schema.js +17 -0
  102. package/dist/src/features/update/host-receipt.js +30 -0
  103. package/dist/src/features/update/notice-output.js +30 -0
  104. package/dist/src/features/update/update-lock.js +80 -0
  105. package/dist/src/features/update/update-notification.js +129 -240
  106. package/dist/src/features/update/update-service.js +95 -21
  107. package/dist/src/platform/media-type.js +46 -0
  108. package/dist/src/platform/public-url.js +35 -0
  109. package/dist/src/platform/remote-error-evidence.js +33 -6
  110. package/dist/src/platform/resource-auth-key.js +35 -1
  111. package/dist/src/platform/safe-upload-file.js +36 -41
  112. package/dist/src/platform/signature.js +3 -1
  113. package/dist/src/platform/signed-http-transport.js +14 -6
  114. package/dist/src/platform/url-safety.js +6 -1
  115. package/dist/src/platform/webm-header.js +41 -0
  116. package/dist/src/telemetry/command-route.js +38 -0
  117. package/dist/src/telemetry/command-routes.json +1 -0
  118. package/dist/src/telemetry/failure-summary.js +1 -1
  119. package/dist/src/telemetry/invocation.js +1 -2
  120. package/dist/src/telemetry/process-errors.js +17 -33
  121. package/dist/src/telemetry/sanitize.js +19 -4
  122. package/dist/src/telemetry/sls-sink.js +8 -0
  123. package/package.json +4 -4
  124. package/skills/gd-cli/SKILL.md +19 -5
  125. package/skills/gd-cli/references/agent.md +9 -4
  126. package/skills/gd-cli/references/creation.md +3 -1
  127. package/skills/gd-cli/references/editor.md +7 -5
  128. package/skills/gd-cli/references/errors.md +19 -8
  129. package/skills/gd-cli/references/matting.md +3 -5
  130. package/skills/gd-cli/references/media-tools.md +10 -4
  131. package/skills/gd-cli/references/tool.md +9 -15
  132. package/skills/gd-cli/references/update.md +6 -0
@@ -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",
@@ -12,12 +12,13 @@
12
12
  "properties": {
13
13
  "model": {
14
14
  "type": "string",
15
- "const": "image-expand-smart"
15
+ "const": "image-expand-smart",
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
  "canvas": {
23
24
  "type": "object",
@@ -29,14 +30,16 @@
29
30
  "properties": {
30
31
  "width": {
31
32
  "type": "integer",
32
- "minimum": 1
33
+ "minimum": 1,
34
+ "description": "布局画布的宽度,以原图自然像素计。宽高用于确定输出比例,成品尺寸随分辨率档位变化。"
33
35
  },
34
36
  "height": {
35
37
  "type": "integer",
36
- "minimum": 1
38
+ "minimum": 1,
39
+ "description": "布局画布的高度,以原图自然像素计。宽高用于确定输出比例,成品尺寸随分辨率档位变化。"
37
40
  }
38
41
  },
39
- "description": "原图自然尺寸上的目标画布,不隐式缩放、旋转或裁切。"
42
+ "description": "用于放置原图的布局画布,宽高确定输出比例。成品像素尺寸取决于所选分辨率档位。"
40
43
  },
41
44
  "placement": {
42
45
  "type": "object",
@@ -48,19 +51,22 @@
48
51
  "properties": {
49
52
  "x": {
50
53
  "type": "integer",
51
- "minimum": 0
54
+ "minimum": 0,
55
+ "description": "原图左上角距画布左边的像素数。"
52
56
  },
53
57
  "y": {
54
58
  "type": "integer",
55
- "minimum": 0
59
+ "minimum": 0,
60
+ "description": "原图左上角距画布上边的像素数。"
56
61
  }
57
62
  },
58
- "description": "原图左上角在目标画布中的像素坐标;原点为画布左上角,x 向右、y 向下。以自动转正后的原图自然尺寸放置,须完整位于画布内。"
63
+ "description": "原图左上角在布局画布中的坐标,以自动转正后的原图自然像素计。x 向右、y 向下,原图须完整放入布局。"
59
64
  },
60
65
  "prompt": {
61
66
  "type": "string",
62
67
  "minLength": 1,
63
- "pattern": ".*\\S.*"
68
+ "pattern": ".*\\S.*",
69
+ "description": "说明本次处理目标、需要的变化和需保留内容;按用户要求填写,媒体本身放在对应 URI 字段。"
64
70
  },
65
71
  "referenceImages": {
66
72
  "type": "array",
@@ -70,7 +76,7 @@
70
76
  "description": "单个 HTTP(S) 或 CLI file:// 素材 URI。"
71
77
  },
72
78
  "minItems": 1,
73
- "uniqueItems": true
79
+ "description": "额外参考图片 URI 数组,按顺序说明各图用途;不代替原图或 mask。"
74
80
  }
75
81
  }
76
82
  }
@@ -12,12 +12,13 @@
12
12
  "properties": {
13
13
  "model": {
14
14
  "type": "string",
15
- "const": "image-expand-standard"
15
+ "const": "image-expand-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
  "canvas": {
23
24
  "type": "object",
@@ -29,14 +30,16 @@
29
30
  "properties": {
30
31
  "width": {
31
32
  "type": "integer",
32
- "minimum": 1
33
+ "minimum": 1,
34
+ "description": "请求的输出画布宽度,单位为像素。"
33
35
  },
34
36
  "height": {
35
37
  "type": "integer",
36
- "minimum": 1
38
+ "minimum": 1,
39
+ "description": "请求的输出画布高度,单位为像素。"
37
40
  }
38
41
  },
39
- "description": "原图自然尺寸上的目标画布,不隐式缩放、旋转或裁切。"
42
+ "description": "请求的输出画布像素尺寸。用于有明确成品宽高的扩图,原图按自动转正后的自然尺寸放置。"
40
43
  },
41
44
  "placement": {
42
45
  "type": "object",
@@ -48,14 +51,16 @@
48
51
  "properties": {
49
52
  "x": {
50
53
  "type": "integer",
51
- "minimum": 0
54
+ "minimum": 0,
55
+ "description": "原图左上角距画布左边的像素数。"
52
56
  },
53
57
  "y": {
54
58
  "type": "integer",
55
- "minimum": 0
59
+ "minimum": 0,
60
+ "description": "原图左上角距画布上边的像素数。"
56
61
  }
57
62
  },
58
- "description": "原图左上角在目标画布中的像素坐标;原点为画布左上角,x 向右、y 向下。以自动转正后的原图自然尺寸放置,须完整位于画布内。"
63
+ "description": "原图左上角在请求输出画布中的像素坐标。x 向右、y 向下,按原图自然尺寸完整放入画布。"
59
64
  }
60
65
  }
61
66
  }
@@ -10,12 +10,13 @@
10
10
  "properties": {
11
11
  "model": {
12
12
  "type": "string",
13
- "const": "image-layers-layout"
13
+ "const": "image-layers-layout",
14
+ "description": "用于拆分版式元素,例如海报的标题、正文和底图。实际可编辑元素以返回的原生模板为准。"
14
15
  },
15
16
  "image": {
16
17
  "type": "string",
17
18
  "format": "uri",
18
- "description": "单个 HTTP(S) 或 CLI file:// 素材 URI。"
19
+ "description": "本次要处理的原图 URI;HTTP(S) URL 或标准 file URI。参考图另放 referenceImages(若该模型支持),不与原图互换。"
19
20
  }
20
21
  }
21
22
  }
@@ -11,17 +11,16 @@
11
11
  "properties": {
12
12
  "model": {
13
13
  "type": "string",
14
- "const": "image-layers-smart"
14
+ "const": "image-layers-smart",
15
+ "description": "用于分开照片中的物件和背景,例如商品与周围的摆件。实际分层以返回的原生模板为准。"
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
  "maxLayers": {
22
23
  "type": "integer",
23
- "minimum": 1,
24
- "maximum": 17,
25
24
  "description": "请求层数上限,不承诺恰好返回该数量。"
26
25
  }
27
26
  }
@@ -11,22 +11,24 @@
11
11
  "properties": {
12
12
  "model": {
13
13
  "type": "string",
14
- "const": "image-matting-smart"
14
+ "const": "image-matting-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
  "cropToSubject": {
32
34
  "type": "boolean",
@@ -10,12 +10,13 @@
10
10
  "properties": {
11
11
  "model": {
12
12
  "type": "string",
13
- "const": "image-matting-standard"
13
+ "const": "image-matting-standard",
14
+ "description": "本次调用的模型机器标识;使用当前 model list/get 返回值。"
14
15
  },
15
16
  "image": {
16
17
  "type": "string",
17
18
  "format": "uri",
18
- "description": "单个 HTTP(S) 或 CLI file:// 素材 URI。"
19
+ "description": "本次要处理的原图 URI;HTTP(S) URL 或标准 file URI。参考图另放 referenceImages(若该模型支持),不与原图互换。"
19
20
  },
20
21
  "cropToSubject": {
21
22
  "type": "boolean",
@@ -10,12 +10,13 @@
10
10
  "properties": {
11
11
  "model": {
12
12
  "type": "string",
13
- "const": "image-ocr"
13
+ "const": "image-ocr",
14
+ "description": "本次调用的模型机器标识;使用当前 model list/get 返回值。"
14
15
  },
15
16
  "image": {
16
17
  "type": "string",
17
18
  "format": "uri",
18
- "description": "单个 HTTP(S) 或 CLI file:// 素材 URI。"
19
+ "description": "本次要处理的原图 URI;HTTP(S) URL 或标准 file URI。参考图另放 referenceImages(若该模型支持),不与原图互换。"
19
20
  }
20
21
  }
21
22
  }
@@ -11,22 +11,24 @@
11
11
  "properties": {
12
12
  "model": {
13
13
  "type": "string",
14
- "const": "image-remove-smart"
14
+ "const": "image-remove-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
  }
32
34
  }
@@ -11,17 +11,18 @@
11
11
  "properties": {
12
12
  "model": {
13
13
  "type": "string",
14
- "const": "image-remove-standard"
14
+ "const": "image-remove-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
  "mask": {
22
23
  "type": "string",
23
24
  "format": "uri",
24
- "description": "与校正 EXIF 后原图同尺寸的全不透明二值 PNG,只含纯黑和纯白。白色处理、黑色保护;白区须非空,全白表示处理全图。"
25
+ "description": "与校正 EXIF 后原图同尺寸的全不透明二值 PNG,只含纯黑和纯白。白色处理、黑色保护;白区须非空,全白表示处理全图。 像素 RGB 只能全为 0 或全为 255;有 alpha 时全部为 255。不要提交半透明、灰阶抗锯齿或彩色圈选预览。"
25
26
  }
26
27
  }
27
28
  }
@@ -11,12 +11,13 @@
11
11
  "properties": {
12
12
  "model": {
13
13
  "type": "string",
14
- "const": "image-text-edit"
14
+ "const": "image-text-edit",
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
  "replacements": {
22
23
  "type": "array",
@@ -32,7 +33,8 @@
32
33
  "from": {
33
34
  "type": "string",
34
35
  "minLength": 1,
35
- "pattern": ".*\\S.*"
36
+ "pattern": ".*\\S.*",
37
+ "description": "需要替换的完整原文字串,包括标点、空格;顺序按数组保留。"
36
38
  },
37
39
  "to": {
38
40
  "type": "string",
@@ -10,12 +10,13 @@
10
10
  "properties": {
11
11
  "model": {
12
12
  "type": "string",
13
- "const": "image-vectorize"
13
+ "const": "image-vectorize",
14
+ "description": "本次调用的模型机器标识;使用当前 model list/get 返回值。"
14
15
  },
15
16
  "image": {
16
17
  "type": "string",
17
18
  "format": "uri",
18
- "description": "单个 HTTP(S) 或 CLI file:// 素材 URI。"
19
+ "description": "本次要处理的原图 URI;HTTP(S) URL 或标准 file URI。参考图另放 referenceImages(若该模型支持),不与原图互换。"
19
20
  }
20
21
  }
21
22
  }