@uzooai/anime-ai-cli 0.6.2 → 0.6.3
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/.agents/skills/uzoo-anime-cli/SKILL.md +1 -0
- package/.agents/skills/uzoo-anime-cli/references/commands.md +1 -0
- package/.agents/skills/uzoo-anime-cli/references/generation-workflow.md +16 -0
- package/CHANGELOG.md +5 -0
- package/package.json +1 -1
- package/src/cli.js +24 -0
- package/src/workflows.js +2 -1
|
@@ -30,6 +30,7 @@ If a newer stable version exists, show the installed and available versions and
|
|
|
30
30
|
| Explain node purposes, toolbar tools or missing CLI features | [Node capabilities](references/node-capabilities.md) |
|
|
31
31
|
| Upload, save node results to library, reuse assets, download material originals, arrange/group and connect nodes | [Material and graph workflow](references/material-graph-workflow.md) |
|
|
32
32
|
| Prepare references, estimate, generate, synchronize/recover results, finalize an existing Seedance draft, or select/add ordinary image/video history | [Generation workflow](references/generation-workflow.md) |
|
|
33
|
+
| Ordinary generation submission limits, duplicate requests, or HTTP 429 on submit | Run `uzoo-anime generation limits` for the offline reference and follow [submission limits and recovery](references/generation-workflow.md#生成提交限额与429处理) |
|
|
33
34
|
| Automatically apply sd25-pe while preparing Seedance 2.5 video generation; no explicit skill invocation needed | [Prompt handoff](references/generation-workflow.md#seedance-25提示词优化sd25-pe) |
|
|
34
35
|
| Explicit Seedance image/video material review, status and recovery | [Material review workflow](references/seedance-review-workflow.md) |
|
|
35
36
|
| Account consent, first use/updated agreement or API code 4401 | [Agreement workflow](references/agreement-workflow.md) |
|
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
| `generation protocol-status` | 只读查询视频《统一协议》及《Seedance2.0模型使用承诺书》的 required/agreed/version;status=awaiting_agreement 与 api_code=4401 表示待签署 |
|
|
58
58
|
| `generation protocol-open` | 打开独立本机协议阅读确认页;可选 --browser default/msedge/chrome --timeout MS;本人勾选点击后记录并查询核验,不提交生成 |
|
|
59
59
|
| `generation estimate` | `--input request.json`;保留文档/节点上下文,返回费用和 `will_intercept` |
|
|
60
|
+
| `generation limits` | 可选 `--format json\|table`;离线查看普通生成提交限额和等待建议,不需要登录,不查询实时剩余额度或提交任务。遇到 429 见 [生成提交限额与处理](generation-workflow.md#生成提交限额与429处理) |
|
|
60
61
|
| `generation submit` | `--input request.json --operation NAME` 默认只预估;Seedance 预览额外返回 protocol;--yes 在需要协议时打开阅读页并等待本人确认,核验后继续原操作;可选 --browser 和 --agreement-timeout;首次 --yes 必须带 `--expected-cost OO` 与当次确认费用严格比对,不一致停止;返回 `{operation, estimate, task}`。保存 operation,任务 ID 是 `task.task_id` |
|
|
61
62
|
| `generation recover NAME` | 有已知任务 ID 时只查询该任务;未知提交结果时默认只预估,加 `--yes` 以原请求和原幂等键恢复;原记录无确认金额或价格变化时必须重新卡片确认并带 `--expected-cost OO`,已有有效金额且报价未变可沿用。新授权金额先落原记录,不改请求或键。不得改用新 operation |
|
|
62
63
|
| `generation operations` | 列出本地 operation、taskId、状态与创建时间;失败时包含脱敏 lastFailure(HTTP/业务错误码),不输出原始请求 |
|
|
@@ -49,6 +49,22 @@ Seedance 首次使用或协议更新时,按 [协议签署与继续原任务](a
|
|
|
49
49
|
|
|
50
50
|
`generation protocol-open` 可单独打开本机阅读确认页,不提交生成。已获当次费用确认的 submit/recover --yes 在需要签署时会打开同样页面,用户本人阅读、勾选并确认后,CLI 核验账号/版本/输入/费用,再以原请求与幂等键继续一次。独立页面不重新打开画布,不向网页暴露 CLI 令牌。正文不可用、用户不同意/超时、版本或参数/费用变化时停止,保留原 operation。不得代填 protocol_agreed 或自动同意。
|
|
51
51
|
|
|
52
|
+
## 生成提交限额与429处理
|
|
53
|
+
|
|
54
|
+
以下是普通 AI 生成提交(`POST /canvas/generations`)的规则参考,也可用 `uzoo-anime generation limits --format table` 离线查看。它不是实时剩余额度;预估、任务查询及专用提交接口不套用此表。普通生成逐笔提交,上一笔提交请求返回后再发送下一笔,无需等生成完成。
|
|
55
|
+
|
|
56
|
+
| 规则 | 限额 | 触发时怎么处理 |
|
|
57
|
+
| --- | ---: | --- |
|
|
58
|
+
| 单用户每秒提交 | 20 次 | 等约 1 秒 |
|
|
59
|
+
| 单用户每分钟提交 | 120 次 | 等额度释放,当前窗口最多 60 秒 |
|
|
60
|
+
| 全站每分钟提交 | 1,200 次 | 等额度释放,当前窗口最多 60 秒 |
|
|
61
|
+
| 同时提交请求 | 32 个 | 等前面的提交请求结束;这不是正在生成的任务数上限 |
|
|
62
|
+
| 相同内容去重窗口 | 2 秒 | 等 2 秒,先确认是否已有原任务 |
|
|
63
|
+
|
|
64
|
+
- 优先按服务端给出的具体原因和 `Retry-After`(若有)等待。仅凭 HTTP 429 不能判断触发了哪条规则,也不能据此认定登录失效;分钟窗口结束不保证繁忙时下一次必定成功。
|
|
65
|
+
- 保留错误码、服务端提示与请求编号(若有),先查原节点任务(`generation list --doc DOC_ID --node NODE_ID`)。已有匹配任务就按原 task ID 查询或等待。暂时查不到不等于未提交;不要重复上传仍可用的素材,也不要换 operation、改请求内容或换幂等键重提。
|
|
66
|
+
- CLI 不自动重提。按建议等待、核对原任务后,确需恢复且原费用授权仍有效时,按下节以原 operation、请求和幂等键恢复;报价或输入变化按费用确认流程处理。若再次限流,停止连续重试,报告服务端原因和请求编号(若有)。
|
|
67
|
+
|
|
52
68
|
## 提交中断
|
|
53
69
|
|
|
54
70
|
遇到超时、断连、网关或内部业务错误时先运行 service status,优先判断当前后端连接和数据库/Redis就绪,再查原 operation/任务和画布副作用。CLI 会对网络/服务类异常追加同源诊断,但保留原错误;ready 不代表对象存储/队列/业务事务都正常,也不证明先前没有提交。连接恢复不构成重发或另一次生成授权。
|
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -104,6 +104,7 @@ const help = `Uzoo Anime CLI — 浏览器授权与独立 CLI 会话
|
|
|
104
104
|
generation prepare --doc ID --node ID --space personal|team [--team-uid UID --output request.json]
|
|
105
105
|
generation list --doc ID [--node ID] [--status STATUS] [--cursor ID] [--limit N]
|
|
106
106
|
generation estimate --input request.json
|
|
107
|
+
generation limits [--format json|table](离线查看普通 AI 生成提交限额及 429 处理)
|
|
107
108
|
generation submit --input request.json --operation NAME [--yes --expected-cost OO]
|
|
108
109
|
generation recover NAME [--yes] | operations
|
|
109
110
|
generation get ID | logs ID | wait ID [--interval MS] [--timeout MS]
|
|
@@ -179,6 +180,23 @@ async function input(file) {
|
|
|
179
180
|
}
|
|
180
181
|
function query(endpoint, fields) { const q = new URLSearchParams(Object.entries(fields).filter(([, v]) => v !== undefined)); return `${endpoint}${q.size ? '?' + q : ''}` }
|
|
181
182
|
|
|
183
|
+
const generationLimits = {
|
|
184
|
+
endpoint: 'POST /canvas/generations',
|
|
185
|
+
source: 'documented_reference',
|
|
186
|
+
items: [
|
|
187
|
+
{ rule: '单用户每秒提交', limit: 20, wait: '约 1 秒' },
|
|
188
|
+
{ rule: '单用户每分钟提交', limit: 120, wait: '等额度释放,当前窗口最多 60 秒' },
|
|
189
|
+
{ rule: '全站每分钟提交', limit: 1200, wait: '等额度释放,当前窗口最多 60 秒' },
|
|
190
|
+
{ rule: '同时提交请求', limit: 32, wait: '等前面的提交请求结束,无需等生成完成' },
|
|
191
|
+
{ rule: '相同内容去重窗口(秒)', limit: 2, wait: '等 2 秒,并先确认是否已有任务' },
|
|
192
|
+
],
|
|
193
|
+
notes: [
|
|
194
|
+
'这是平台提供的提交规则参考,并非实时剩余额度;以服务端实际响应和 Retry-After(若有)为准。',
|
|
195
|
+
'HTTP 429 本身不能确定触发哪条规则。先查原节点任务;已有任务就继续查询或等待,不重复提交。',
|
|
196
|
+
'CLI 不自动重提。需要恢复时沿用原 operation、请求和幂等键;确认费用授权仍有效后再执行恢复。',
|
|
197
|
+
],
|
|
198
|
+
}
|
|
199
|
+
|
|
182
200
|
let diagnosticClient
|
|
183
201
|
async function main(args) {
|
|
184
202
|
if (args[0] === 'install') {
|
|
@@ -195,6 +213,12 @@ async function main(args) {
|
|
|
195
213
|
if (!['json', 'table'].includes(format)) throw new Error('--format 必须是 json 或 table')
|
|
196
214
|
if (p.length > 3) throw new Error('多余的位置参数')
|
|
197
215
|
const [group, action, idArg] = p
|
|
216
|
+
if (group === 'generation' && action === 'limits') {
|
|
217
|
+
if (idArg || Object.keys(o).some(key => key !== 'format')) throw new Error('generation limits 仅支持 --format json|table')
|
|
218
|
+
print(generationLimits, format)
|
|
219
|
+
if (format === 'table') console.log('\n' + generationLimits.notes.join('\n'))
|
|
220
|
+
return
|
|
221
|
+
}
|
|
198
222
|
if(group==='version'||group==='skill'){
|
|
199
223
|
if(Object.keys(o).some(k=>k!=='format')||idArg||
|
|
200
224
|
(group==='version'&&p.length!==1)||(group==='skill'&&(action!=='path'||p.length!==2)))
|
package/src/workflows.js
CHANGED
|
@@ -129,7 +129,8 @@ export async function submit(client, profile, body, operation, confirmed, expect
|
|
|
129
129
|
await atomic(file, record)
|
|
130
130
|
if(error.apiCode===4401)throw agreementError('AGREEMENT_REQUIRED','《统一协议》《Seedance2.0模型使用承诺书》需要签署或版本已更新(code 4401);本次生成提交被前置检查阻止,不是生成任务执行失败;保留原 operation',error.protocol || protocol)
|
|
131
131
|
const detail=record.lastFailure.apiCode ? `(接口返回 code ${record.lastFailure.apiCode},HTTP ${record.lastFailure.status})` : record.lastFailure.status ? `(HTTP ${record.lastFailure.status})` : ''
|
|
132
|
-
const
|
|
132
|
+
const rateLimitHint = error.status === 429 ? ';请先查原节点是否已有任务,再按 generation limits 的等待建议处理' : ''
|
|
133
|
+
const failure = new Error(`提交结果未确认${detail}${rateLimitHint};使用 generation recover ${operation} 以原幂等键恢复,勿创建新 operation`,{cause:error})
|
|
133
134
|
failure.code = 'SUBMISSION_UNKNOWN'; throw failure
|
|
134
135
|
}
|
|
135
136
|
}
|