@uzooai/anime-ai-cli 0.0.0-stage → 0.6.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.
Files changed (89) hide show
  1. package/.agents/skills/uzoo-anime-cli/SKILL.md +89 -0
  2. package/.agents/skills/uzoo-anime-cli/references/agreement-workflow.md +41 -0
  3. package/.agents/skills/uzoo-anime-cli/references/canvas-workflow.md +53 -0
  4. package/.agents/skills/uzoo-anime-cli/references/commands.md +242 -0
  5. package/.agents/skills/uzoo-anime-cli/references/generation-workflow.md +142 -0
  6. package/.agents/skills/uzoo-anime-cli/references/image-tools-workflow.md +153 -0
  7. package/.agents/skills/uzoo-anime-cli/references/interaction-workflow.md +67 -0
  8. package/.agents/skills/uzoo-anime-cli/references/material-graph-workflow.md +113 -0
  9. package/.agents/skills/uzoo-anime-cli/references/node-capabilities.md +64 -0
  10. package/.agents/skills/uzoo-anime-cli/references/node-workflow.md +90 -0
  11. package/.agents/skills/uzoo-anime-cli/references/remake-workflow.md +54 -0
  12. package/.agents/skills/uzoo-anime-cli/references/repaint-workflow.md +13 -0
  13. package/.agents/skills/uzoo-anime-cli/references/seedance-review-workflow.md +37 -0
  14. package/.agents/skills/uzoo-anime-cli/references/video-tools-workflow.md +67 -0
  15. package/CHANGELOG.md +13 -0
  16. package/LICENSE +21 -0
  17. package/README.md +46 -3
  18. package/assets/favicon-uzoo.png +0 -0
  19. package/assets/logo-uzoo.svg +7 -0
  20. package/docs/Agent/346/216/245/345/205/245/344/270/216/347/211/210/346/234/254/346/233/264/346/226/260.md +43 -0
  21. package/examples/matting.json +5 -0
  22. package/extensions/uzoo-cli-login/manifest.json +9 -0
  23. package/extensions/uzoo-cli-login/popup.css +1 -0
  24. package/extensions/uzoo-cli-login/popup.html +14 -0
  25. package/extensions/uzoo-cli-login/popup.js +65 -0
  26. package/package.json +53 -6
  27. package/src/agreement-page.js +62 -0
  28. package/src/agreement.js +419 -0
  29. package/src/annotation-media.js +386 -0
  30. package/src/api.js +168 -0
  31. package/src/browser-login.js +13 -0
  32. package/src/callback-page.js +44 -0
  33. package/src/canvas.js +105 -0
  34. package/src/cli-authorization.js +122 -0
  35. package/src/cli.js +464 -0
  36. package/src/download-name.js +17 -0
  37. package/src/draft-finalize.js +229 -0
  38. package/src/generation-graph.js +124 -0
  39. package/src/generation-input.js +472 -0
  40. package/src/graph-disconnect.js +89 -0
  41. package/src/graph.js +431 -0
  42. package/src/group-edit.js +53 -0
  43. package/src/group-layout.js +113 -0
  44. package/src/group-membership.js +125 -0
  45. package/src/history-add.js +119 -0
  46. package/src/image-annotation.js +246 -0
  47. package/src/image-crop.js +283 -0
  48. package/src/image-matting.js +82 -0
  49. package/src/image-media.js +89 -0
  50. package/src/image-output.js +385 -0
  51. package/src/install.js +237 -0
  52. package/src/local-output.js +23 -0
  53. package/src/material-download.js +55 -0
  54. package/src/material-save.js +254 -0
  55. package/src/materials.js +147 -0
  56. package/src/matting-background.js +73 -0
  57. package/src/matting-jobs.js +63 -0
  58. package/src/matting-worker.js +49 -0
  59. package/src/matting.js +170 -0
  60. package/src/media-copy.js +53 -0
  61. package/src/media.js +343 -0
  62. package/src/model-options.js +76 -0
  63. package/src/multipart.js +28 -0
  64. package/src/node-copy.js +95 -0
  65. package/src/node-delete.js +49 -0
  66. package/src/node-history.js +231 -0
  67. package/src/normal-login.js +118 -0
  68. package/src/package-info.js +8 -0
  69. package/src/png-alpha.js +60 -0
  70. package/src/protocol.js +83 -0
  71. package/src/remake.js +738 -0
  72. package/src/repaint-archive.js +53 -0
  73. package/src/repaint-delivery.js +783 -0
  74. package/src/repaint-export.js +63 -0
  75. package/src/repaint-graph.js +214 -0
  76. package/src/repaint-history.js +267 -0
  77. package/src/repaint-materials.js +601 -0
  78. package/src/repaint-reverse.js +614 -0
  79. package/src/repaint-sequence.js +132 -0
  80. package/src/repaint-settings.js +576 -0
  81. package/src/repaint-video.js +798 -0
  82. package/src/repaint.js +326 -0
  83. package/src/resource.js +110 -0
  84. package/src/review.js +435 -0
  85. package/src/service.js +85 -0
  86. package/src/store.js +100 -0
  87. package/src/video-clip.js +381 -0
  88. package/src/video-frame.js +296 -0
  89. package/src/workflows.js +214 -0
@@ -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 }