zerocut-cli 0.1.0 → 0.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zerocut-cli",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "ZeroCut CLI: AI assistant CLI for creating and editing images/audio/video",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -7,6 +7,24 @@ import { createProgressSpinner } from "../utils/progress";
7
7
  export const name = "video";
8
8
  export const description = "Video command: create video";
9
9
 
10
+ function resolveResultUrl(result: unknown): string | undefined {
11
+ if (!result || typeof result !== "object") {
12
+ return undefined;
13
+ }
14
+ const record = result as Record<string, unknown>;
15
+ if (typeof record.url === "string" && record.url.length > 0) {
16
+ return record.url;
17
+ }
18
+ const data = record.data;
19
+ if (data && typeof data === "object") {
20
+ const dataRecord = data as Record<string, unknown>;
21
+ if (typeof dataRecord.url === "string" && dataRecord.url.length > 0) {
22
+ return dataRecord.url;
23
+ }
24
+ }
25
+ return undefined;
26
+ }
27
+
10
28
  export function register(program: Command): void {
11
29
  const parent = program.command("video").description("Create a new video; requires --prompt");
12
30
 
@@ -137,11 +155,12 @@ export function register(program: Command): void {
137
155
  : undefined,
138
156
  onProgress: createProgressSpinner("inferencing"),
139
157
  });
158
+ const initialUrl = resolveResultUrl(res);
140
159
  try {
141
- if (res?.url) {
142
- const tosUrl = await syncToTOS(res.url as string);
160
+ if (initialUrl) {
161
+ const tosUrl = await syncToTOS(initialUrl);
143
162
  if (tosUrl) {
144
- res.url = tosUrl;
163
+ (res as Record<string, unknown>).url = tosUrl;
145
164
  }
146
165
  }
147
166
  } catch {}
@@ -149,7 +168,15 @@ export function register(program: Command): void {
149
168
  const output = typeof opts.output === "string" ? opts.output : undefined;
150
169
  if (output) {
151
170
  const dir = process.cwd();
152
- const url = res.url;
171
+ const url = resolveResultUrl(res);
172
+ if (!url) {
173
+ process.stderr.write(
174
+ "Cannot save --output because no video URL was returned. Please retry later or run without --output to inspect raw response.\n"
175
+ );
176
+ process.exitCode = 1;
177
+ console.log(res);
178
+ return;
179
+ }
153
180
  const response = await fetch(url);
154
181
  const buffer = Buffer.from(await response.arrayBuffer());
155
182
  const filePath = path.resolve(dir, output);
@@ -34,7 +34,9 @@ Before every task, the agent must check configuration first:
34
34
  npx zerocut-cli config list
35
35
  ```
36
36
 
37
- If `apiKey` is missing or empty, require user to configure via OTT exchange first:
37
+ If `apiKey` is missing or empty, the agent must immediately stop task execution and request an OTT token from the user. Do not continue any generation, conversion, or sandbox command until configuration is completed.
38
+
39
+ Required user action:
38
40
 
39
41
  ```bash
40
42
  npx zerocut-cli config --ott <token> --region <cn|us>
@@ -71,7 +73,9 @@ Validation rules:
71
73
  - `--prompt` must be non-empty
72
74
  - `--model` allowed: `seedream|seedream-pro|seedream-5l|banana|banana2|banana-pro|wan`
73
75
  - `--aspectRatio` allowed: `1:1|3:4|4:3|16:9|9:16|2:3|3:2|21:9|1:4|4:1|1:8|8:1`
76
+ - unless user specifies aspect ratio, default to `16:9`
74
77
  - `--resolution` allowed: `1K|2K|4K`
78
+ - unless user specifies resolution, default to `1K`
75
79
 
76
80
  ### video
77
81
 
@@ -105,6 +109,8 @@ Validation rules:
105
109
  - `--model` allowed: `zerocut3.0|seedance-1.5-pro|vidu|vidu-pro|viduq3|viduq3-turbo|kling|kling-v3|wan|wan-flash|sora2|sora2-pro|veo3.1|veo3.1-pro`
106
110
  - `--duration` must be integer in `1-16`
107
111
  - `--aspectRatio` allowed: `9:16|16:9|1:1`
112
+ - unless user specifies aspect ratio, default to `16:9`
113
+ - unless user specifies resolution, default to `720p`
108
114
 
109
115
  Long video guidance:
110
116