@uzooai/anime-ai-cli 0.0.0-stage → 0.5.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/.agents/skills/uzoo-anime-cli/SKILL.md +83 -0
- package/.agents/skills/uzoo-anime-cli/references/agreement-workflow.md +51 -0
- package/.agents/skills/uzoo-anime-cli/references/canvas-workflow.md +53 -0
- package/.agents/skills/uzoo-anime-cli/references/commands.md +250 -0
- package/.agents/skills/uzoo-anime-cli/references/generation-workflow.md +152 -0
- package/.agents/skills/uzoo-anime-cli/references/image-tools-workflow.md +175 -0
- package/.agents/skills/uzoo-anime-cli/references/interaction-workflow.md +67 -0
- package/.agents/skills/uzoo-anime-cli/references/material-graph-workflow.md +123 -0
- package/.agents/skills/uzoo-anime-cli/references/node-capabilities.md +95 -0
- package/.agents/skills/uzoo-anime-cli/references/node-workflow.md +94 -0
- package/.agents/skills/uzoo-anime-cli/references/remake-workflow.md +54 -0
- package/.agents/skills/uzoo-anime-cli/references/repaint-workflow.md +300 -0
- package/.agents/skills/uzoo-anime-cli/references/seedance-review-workflow.md +41 -0
- package/.agents/skills/uzoo-anime-cli/references/video-tools-workflow.md +71 -0
- package/CHANGELOG.md +92 -0
- package/LICENSE +21 -0
- package/README.md +242 -3
- package/assets/README.md +4 -0
- package/assets/favicon-uzoo.png +0 -0
- package/assets/logo-uzoo.svg +7 -0
- package/docs/CLI/345/275/223/345/211/215/350/214/203/345/233/264/344/270/216/346/234/254/345/234/260/346/211/223/345/214/205-20261103.md +134 -0
- package/docs/CLI/346/216/210/346/235/203/346/216/245/345/217/243/344/270/216/344/273/244/347/211/214/350/207/252/345/212/250/345/210/267/346/226/260/350/256/276/350/256/241.md +540 -0
- package/docs/CLI/347/274/272/345/217/243/346/240/270/345/257/271/344/270/216/346/224/266/345/260/276-20261105.md +65 -0
- package/docs/CLI/347/275/221/351/241/265/344/277/235/345/255/230/350/212/202/347/202/271/347/274/272/345/244/261/344/272/244/346/216/245.md +52 -0
- package/docs/M0-M5/345/256/236/346/226/275/344/270/216/351/252/214/346/224/266.md +89 -0
- package/docs/npm/347/272/277/344/270/212/345/217/221/345/270/203/344/270/216/345/256/211/350/243/205/344/275/277/347/224/250.md +151 -0
- package/docs//344/270/213/350/275/275/346/216/245/345/217/243/351/200/202/351/205/215/344/270/216/351/252/214/346/224/266.md +107 -0
- package/docs//344/270/232/345/212/241/350/203/275/345/212/233/350/241/245/345/205/250/344/270/216Skill/347/273/223/346/236/204/350/247/204/345/210/222.md +311 -0
- package/docs//345/205/250/345/261/200/351/231/204/344/273/266/350/265/204/346/272/220/345/234/260/345/235/200/344/270/216/346/250/241/345/236/213/350/257/273/345/217/226/345/267/256/345/274/202.md +47 -0
- package/docs//345/206/205/351/203/250Windows/345/256/211/350/243/205/344/270/216/345/215/207/347/272/247/351/252/214/346/224/266/346/270/205/345/215/225.md +34 -0
- package/docs//345/233/276/347/211/207/346/212/240/345/233/276/346/216/245/345/205/245/344/270/216/351/252/214/346/224/266-20261104.md +110 -0
- package/docs//345/274/200/345/217/221/350/256/241/345/210/222.md +127 -0
- package/docs//345/274/202/346/255/245/346/212/240/345/233/276CLI/346/235/203/351/231/220/344/272/244/346/216/245-20261105.md +50 -0
- package/docs//345/274/202/346/255/245/346/212/240/345/233/276/347/234/237/345/256/236/351/252/214/346/224/266-20261105.md +44 -0
- package/docs//346/226/260/344/274/232/350/257/235/344/273/273/345/212/241/344/272/244/344/273/243-/351/230/266/346/256/2652A.md +79 -0
- package/docs//346/226/260/351/203/250/347/275/262/347/224/273/345/270/203/345/206/262/347/252/201/351/252/214/346/224/266-20261102.md +61 -0
- package/docs//346/231/256/351/200/232/346/265/217/350/247/210/345/231/250/347/231/273/345/275/225.md +53 -0
- package/docs//346/255/243/345/274/217/347/253/231/345/210/207/346/215/242/344/270/216/351/252/214/346/224/266-20261104.md +90 -0
- package/docs//347/224/273/345/270/203CLI/344/270/213/344/270/200/351/230/266/346/256/265/345/274/200/345/217/221/350/256/241/345/210/222.md +136 -0
- package/docs//347/224/273/345/270/203CLI/351/235/236/350/275/254/347/273/230/345/256/214/345/226/204/350/256/241/345/210/222.md +183 -0
- package/docs//347/224/273/345/270/203/350/203/275/345/212/233/345/245/221/347/272/246/346/240/270/345/257/271.md +59 -0
- package/docs//347/234/237/345/256/236/344/270/232/345/212/241/346/216/245/345/205/245/344/270/216/346/265/213/350/257/225.md +1004 -0
- package/docs//347/264/240/346/235/220/345/205/245/345/272/223/344/270/216/347/224/273/345/270/203/344/277/235/345/255/230/351/227/256/351/242/230/345/256/232/344/275/215.md +52 -0
- package/docs//351/230/266/346/256/2653B/351/252/214/346/224/266/344/272/244/346/216/245.md +44 -0
- package/docs//351/230/266/346/256/265/344/270/200/351/252/214/346/224/266.md +60 -0
- package/docs//351/235/236/350/275/254/347/273/230/346/214/201/347/273/255/345/256/214/345/226/204/344/270/216/351/252/214/346/224/266-20261103.md +76 -0
- package/docs//351/235/236/350/275/254/347/273/230/347/254/254/344/272/214/346/211/271/345/256/236/346/226/275/344/270/216/351/252/214/346/224/266.md +39 -0
- package/docs//351/235/236/350/275/254/347/273/230/350/241/245/345/205/205/346/235/241/344/273/266/351/252/214/346/224/266-20261103.md +113 -0
- package/docs//351/235/236/350/275/254/347/273/230/351/246/226/346/211/271/345/256/236/346/226/275/344/270/216/351/252/214/346/224/266.md +71 -0
- package/examples/matting.json +5 -0
- package/examples/real-business/image-request.template.json +7 -0
- package/examples/real-business/node-patch.template.json +11 -0
- package/extensions/uzoo-cli-login/manifest.json +9 -0
- package/extensions/uzoo-cli-login/popup.css +1 -0
- package/extensions/uzoo-cli-login/popup.html +14 -0
- package/extensions/uzoo-cli-login/popup.js +65 -0
- package/package.json +56 -6
- package/scripts/check-package-resources.mjs +56 -0
- package/scripts/check-release.mjs +19 -0
- package/scripts/pack-local.mjs +33 -0
- package/scripts/release-policy.mjs +22 -0
- package/src/agreement-page.js +62 -0
- package/src/agreement.js +419 -0
- package/src/annotation-media.js +386 -0
- package/src/api.js +168 -0
- package/src/browser-login.js +13 -0
- package/src/callback-page.js +44 -0
- package/src/canvas.js +105 -0
- package/src/cli-authorization.js +122 -0
- package/src/cli.js +459 -0
- package/src/download-name.js +17 -0
- package/src/draft-finalize.js +229 -0
- package/src/generation-graph.js +124 -0
- package/src/generation-input.js +472 -0
- package/src/graph-disconnect.js +89 -0
- package/src/graph.js +431 -0
- package/src/group-edit.js +53 -0
- package/src/group-layout.js +113 -0
- package/src/group-membership.js +126 -0
- package/src/history-add.js +119 -0
- package/src/image-annotation.js +246 -0
- package/src/image-crop.js +283 -0
- package/src/image-matting.js +82 -0
- package/src/image-media.js +89 -0
- package/src/image-output.js +385 -0
- package/src/local-output.js +23 -0
- package/src/material-download.js +55 -0
- package/src/material-save.js +254 -0
- package/src/materials.js +147 -0
- package/src/matting-background.js +73 -0
- package/src/matting-jobs.js +63 -0
- package/src/matting-worker.js +49 -0
- package/src/matting.js +170 -0
- package/src/media-copy.js +53 -0
- package/src/media.js +343 -0
- package/src/model-options.js +76 -0
- package/src/multipart.js +28 -0
- package/src/node-copy.js +95 -0
- package/src/node-delete.js +49 -0
- package/src/node-history.js +231 -0
- package/src/normal-login.js +118 -0
- package/src/package-info.js +8 -0
- package/src/png-alpha.js +60 -0
- package/src/protocol.js +83 -0
- package/src/remake.js +738 -0
- package/src/repaint-archive.js +53 -0
- package/src/repaint-delivery.js +783 -0
- package/src/repaint-export.js +63 -0
- package/src/repaint-graph.js +214 -0
- package/src/repaint-history.js +267 -0
- package/src/repaint-materials.js +601 -0
- package/src/repaint-reverse.js +614 -0
- package/src/repaint-sequence.js +132 -0
- package/src/repaint-settings.js +576 -0
- package/src/repaint-video.js +798 -0
- package/src/repaint.js +326 -0
- package/src/resource.js +110 -0
- package/src/review.js +435 -0
- package/src/service.js +85 -0
- package/src/store.js +100 -0
- package/src/video-clip.js +381 -0
- package/src/video-frame.js +296 -0
- package/src/workflows.js +214 -0
package/src/protocol.js
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import crypto from 'node:crypto'
|
|
2
|
+
function encodeRfc3986(value) {
|
|
3
|
+
return encodeURIComponent(value).replace(/[!'()*]/g, (char) => `%${char.charCodeAt(0).toString(16).toUpperCase()}`)
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
function decodeQueryPart(value) {
|
|
7
|
+
try {
|
|
8
|
+
return decodeURIComponent(value)
|
|
9
|
+
} catch {
|
|
10
|
+
return value
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function canonicalQuery(search) {
|
|
15
|
+
const raw = String(search || '').replace(/^\?/, '')
|
|
16
|
+
if (!raw) return ''
|
|
17
|
+
const pairs = []
|
|
18
|
+
raw.split('&').forEach((segment, index) => {
|
|
19
|
+
if (!segment) return
|
|
20
|
+
const separator = segment.indexOf('=')
|
|
21
|
+
const rawKey = separator >= 0 ? segment.slice(0, separator) : segment
|
|
22
|
+
const rawValue = separator >= 0 ? segment.slice(separator + 1) : ''
|
|
23
|
+
pairs.push([encodeRfc3986(decodeQueryPart(rawKey)), encodeRfc3986(decodeQueryPart(rawValue)), index])
|
|
24
|
+
})
|
|
25
|
+
pairs.sort((a, b) => (a[0] === b[0] ? a[2] - b[2] : a[0] < b[0] ? -1 : 1))
|
|
26
|
+
return pairs.map(([key, value]) => `${key}=${value}`).join('&')
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function b64url(value) {
|
|
30
|
+
return Buffer.from(value).toString('base64url')
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function bodyBytes(body) {
|
|
34
|
+
if (body === undefined || body === null) return Buffer.alloc(0)
|
|
35
|
+
if (body instanceof URLSearchParams) return Buffer.from(body.toString())
|
|
36
|
+
return Buffer.from(typeof body === 'string' || Buffer.isBuffer(body) ? body : JSON.stringify(body))
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function signRequest({ method, url, body, keyId, apiSecret }) {
|
|
40
|
+
const parsed = new URL(url)
|
|
41
|
+
const timestamp = String(Date.now())
|
|
42
|
+
const nonce = crypto.randomBytes(16).toString('base64url')
|
|
43
|
+
const key = `S1.${keyId}.${nonce}`
|
|
44
|
+
const bodyHash = crypto.createHash('sha256').update(bodyBytes(body)).digest('hex')
|
|
45
|
+
const canonical = [method.toUpperCase(), parsed.pathname || '/', canonicalQuery(parsed.search), bodyHash, timestamp, key].join('\n')
|
|
46
|
+
const signature = crypto.createHmac('sha256', String(apiSecret)).update(canonical).digest('base64url')
|
|
47
|
+
return { 'X-T': timestamp, 'X-K': key, 'X-Sign': signature }
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function unwrap(payload) {
|
|
51
|
+
if (payload && typeof payload === 'object' && 'code' in payload) {
|
|
52
|
+
if (payload.code !== 0) {
|
|
53
|
+
const error = new Error(payload.message || `API error ${payload.code}`)
|
|
54
|
+
error.code = payload.code
|
|
55
|
+
throw error
|
|
56
|
+
}
|
|
57
|
+
return 'data' in payload ? payload.data : payload
|
|
58
|
+
}
|
|
59
|
+
return payload
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function getSetCookie(headers) {
|
|
63
|
+
if (typeof headers.getSetCookie === 'function') return headers.getSetCookie()
|
|
64
|
+
const value = headers.get('set-cookie')
|
|
65
|
+
return value ? [value] : []
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function mergeCookie(existing, setCookies) {
|
|
69
|
+
const jar = new Map()
|
|
70
|
+
for (const part of String(existing || '').split(';')) {
|
|
71
|
+
const [key, ...rest] = part.trim().split('=')
|
|
72
|
+
if (key && rest.length) jar.set(key, rest.join('='))
|
|
73
|
+
}
|
|
74
|
+
for (const cookie of setCookies) {
|
|
75
|
+
const first = String(cookie).split(';', 1)[0]
|
|
76
|
+
const [key, ...rest] = first.split('=')
|
|
77
|
+
if (key && rest.length) jar.set(key.trim(), rest.join('='))
|
|
78
|
+
}
|
|
79
|
+
return [...jar].map(([key, value]) => `${key}=${value}`).join('; ')
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
export { signRequest, bodyBytes, unwrap, getSetCookie, mergeCookie }
|