@bonginkan/maria 4.3.15 → 4.3.16

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/dist/cli.cjs CHANGED
@@ -1704,7 +1704,7 @@ var init_AuthenticationManager = __esm({
1704
1704
  const response = await fetch(`${this.apiBase}/api/user/profile`, {
1705
1705
  headers: {
1706
1706
  "Authorization": `Bearer ${tokens2.accessToken}`,
1707
- "User-Agent": `maria-cli/${process.env.CLI_VERSION || "4.3.15"}`
1707
+ "User-Agent": `maria-cli/${process.env.CLI_VERSION || "4.3.16"}`
1708
1708
  }
1709
1709
  });
1710
1710
  if (response.status === 401) {
@@ -2407,7 +2407,7 @@ async function callApi(path60, init3 = {}) {
2407
2407
  "Authorization": `Bearer ${token}`,
2408
2408
  "X-Device-Id": getDeviceId(),
2409
2409
  "X-Session-Id": getSessionId() || "",
2410
- "User-Agent": `maria-cli/${process.env.CLI_VERSION || "4.3.15"}`,
2410
+ "User-Agent": `maria-cli/${process.env.CLI_VERSION || "4.3.16"}`,
2411
2411
  "Content-Type": init3.headers?.["Content-Type"] || "application/json"
2412
2412
  });
2413
2413
  const doFetch = async (token) => {
@@ -16071,8 +16071,8 @@ var require_package = __commonJS({
16071
16071
  "package.json"(exports, module) {
16072
16072
  module.exports = {
16073
16073
  name: "@bonginkan/maria",
16074
- version: "4.3.15",
16075
- description: "\u{1F680} MARIA v4.3.15 - Enterprise AI Development Platform with identity system and character voice implementation. Features 74 production-ready commands with comprehensive fallback implementation, local LLM support, and zero external dependencies. Includes natural language coding, AI safety evaluation, intelligent evolution system, episodic memory with PII masking, and real-time monitoring dashboard. Built with TypeScript AST-powered code generation, OAuth2.0 + PKCE authentication, quantum-resistant cryptography, and enterprise-grade performance.",
16074
+ version: "4.3.16",
16075
+ description: "\u{1F680} MARIA v4.3.16 - Enterprise AI Development Platform with identity system and character voice implementation. Features 74 production-ready commands with comprehensive fallback implementation, local LLM support, and zero external dependencies. Includes natural language coding, AI safety evaluation, intelligent evolution system, episodic memory with PII masking, and real-time monitoring dashboard. Built with TypeScript AST-powered code generation, OAuth2.0 + PKCE authentication, quantum-resistant cryptography, and enterprise-grade performance.",
16076
16076
  keywords: [
16077
16077
  "ai",
16078
16078
  "cli",
@@ -22272,7 +22272,7 @@ function normalizeVideoArgs(raw, root) {
22272
22272
  if (!prompt) throw new Error("prompt required");
22273
22273
  const out = {
22274
22274
  prompt,
22275
- duration: 5,
22275
+ duration: 8,
22276
22276
  fps: 24,
22277
22277
  size: [1280, 720],
22278
22278
  format: "mp4",
@@ -22420,7 +22420,7 @@ async function atomicRename(stage, dest) {
22420
22420
  }
22421
22421
  async function saveArtifacts(ctx2, items, manifest) {
22422
22422
  const root = ctx2.root;
22423
- const base = ctx2.baseDir || (ctx2.kind === "image" ? "artifacts/media/images" : "artifacts/media/videos");
22423
+ const base = typeof ctx2.baseDir === "string" ? ctx2.baseDir : "";
22424
22424
  const trace = ctx2.trace || Math.random().toString(36).slice(2, 10).toUpperCase();
22425
22425
  const stage = stageDir(root, trace);
22426
22426
  ensureDirSync(stage);
@@ -22428,7 +22428,7 @@ async function saveArtifacts(ctx2, items, manifest) {
22428
22428
  const dateSeg = datePath(/* @__PURE__ */ new Date());
22429
22429
  const reqHash = manifest.request && manifest.request.promptHash || "sha256:unknown";
22430
22430
  const slug = hashPrefix(reqHash, 6);
22431
- const outDirSeg = `${base}/${dateSeg}/${slug}`;
22431
+ const outDirSeg = ctx2.flat ? base || "" : `${base ? base + "/" : ""}${dateSeg}/${slug}`;
22432
22432
  const outDir = safeJoin(root, outDirSeg).full;
22433
22433
  ensureDirSync(outDir);
22434
22434
  const saved = [];
@@ -22438,7 +22438,8 @@ async function saveArtifacts(ctx2, items, manifest) {
22438
22438
  const ext2 = it.ext.startsWith(".") ? it.ext : `.${it.ext}`;
22439
22439
  const baseName = it.logicalName ? `${it.logicalName}` : `${contentHash}`;
22440
22440
  const fname = `${baseName}${ext2}`;
22441
- const dest = safeJoin(root, `${outDirSeg}/${fname}`);
22441
+ const relPath = outDirSeg ? `${outDirSeg}/${fname}` : `${fname}`;
22442
+ const dest = safeJoin(root, relPath);
22442
22443
  validateWinPathEdge(dest.full);
22443
22444
  if (await hasCaseInsensitiveCollision(path10__namespace.dirname(dest.full), path10__namespace.basename(dest.full))) {
22444
22445
  throw new Error("case-insensitive filename collision");
@@ -22458,23 +22459,28 @@ async function saveArtifacts(ctx2, items, manifest) {
22458
22459
  await atomicRename(stg, dest.full);
22459
22460
  saved.push(dest.rel);
22460
22461
  }
22461
- const manifestObj = {
22462
- manifestVersion: 1,
22463
- ...manifest,
22464
- createdAt: manifest.createdAt || (/* @__PURE__ */ new Date()).toISOString(),
22465
- artifacts: manifest.artifacts && manifest.artifacts.length > 0 ? manifest.artifacts : saved.map((file) => ({ file, hash: `sha256:${path10__namespace.basename(file).split(".")[0]}` }))
22466
- };
22467
- const manifestPathRel = `${outDirSeg}/manifest.json`;
22468
- const manifestStage = path10__namespace.join(stage, "manifest.json.part");
22469
- const manifestFull = safeJoin(root, manifestPathRel).full;
22470
- await fsp__namespace.writeFile(manifestStage, JSON.stringify(manifestObj, null, 2), "utf8");
22471
- try {
22472
- console.log(`[store] manifest -> ${manifestPathRel}`);
22473
- } catch {
22462
+ if (!ctx2.skipManifest) {
22463
+ const manifestObj = {
22464
+ manifestVersion: 1,
22465
+ ...manifest,
22466
+ createdAt: manifest.createdAt || (/* @__PURE__ */ new Date()).toISOString(),
22467
+ artifacts: manifest.artifacts && manifest.artifacts.length > 0 ? manifest.artifacts : saved.map((file) => ({ file, hash: `sha256:${path10__namespace.basename(file).split(".")[0]}` }))
22468
+ };
22469
+ const manifestPathRel = `${outDirSeg ? outDirSeg + "/" : ""}manifest.json`;
22470
+ const manifestStage = path10__namespace.join(stage, "manifest.json.part");
22471
+ const manifestFull = safeJoin(root, manifestPathRel).full;
22472
+ await fsp__namespace.writeFile(manifestStage, JSON.stringify(manifestObj, null, 2), "utf8");
22473
+ try {
22474
+ console.log(`[store] manifest -> ${manifestPathRel}`);
22475
+ } catch {
22476
+ }
22477
+ await atomicRename(manifestStage, manifestFull);
22478
+ await fsp__namespace.rm(stage, { recursive: true, force: true });
22479
+ return { files: saved, manifestPath: manifestPathRel };
22480
+ } else {
22481
+ await fsp__namespace.rm(stage, { recursive: true, force: true });
22482
+ return { files: saved, manifestPath: "" };
22474
22483
  }
22475
- await atomicRename(manifestStage, manifestFull);
22476
- await fsp__namespace.rm(stage, { recursive: true, force: true });
22477
- return { files: saved, manifestPath: manifestPathRel };
22478
22484
  } catch (e2) {
22479
22485
  await fsp__namespace.rm(stage, { recursive: true, force: true });
22480
22486
  throw e2;
@@ -22755,7 +22761,7 @@ async function runImagePipeline(params2, opts) {
22755
22761
  trace: Math.random().toString(36).slice(2, 8).toUpperCase()
22756
22762
  };
22757
22763
  const items = successes.filter(Boolean).map((b) => ({ bytes: b, ext: `.${params2.format}` }));
22758
- const saved = await saveArtifacts({ root: opts.root, kind: "image", baseDir: opts.outDir }, items, manifest);
22764
+ const saved = await saveArtifacts({ root: opts.root, kind: "image", baseDir: opts.outDir, flat: true, skipManifest: true }, items, manifest);
22759
22765
  progress.done();
22760
22766
  return {
22761
22767
  saved,
@@ -23147,7 +23153,7 @@ var init_image_command = __esm({
23147
23153
  init_firestore();
23148
23154
  init_cli_auth();
23149
23155
  init_api_client();
23150
- init_MariaAPIClient();
23156
+ init_cli_auth();
23151
23157
  init_animations();
23152
23158
  ImageCommand = class extends BaseCommand {
23153
23159
  name = "image";
@@ -23196,12 +23202,13 @@ var init_image_command = __esm({
23196
23202
  const fsMod = await import('fs/promises');
23197
23203
  const savedPaths = [];
23198
23204
  for (const f3 of filesInline) {
23199
- const rel = String(f3.file || "").replace(/^[\\/]+/, "");
23200
- const full = pathMod.resolve(root, rel);
23205
+ const original = String(f3.file || "").replace(/^[\\/]+/, "");
23206
+ const name2 = pathMod.basename(original);
23207
+ const full = pathMod.resolve(root, name2);
23201
23208
  await fsMod.mkdir(pathMod.dirname(full), { recursive: true });
23202
23209
  const buf = Buffer.from(String(f3.bytesBase64 || ""), "base64");
23203
23210
  await fsMod.writeFile(full, buf);
23204
- savedPaths.push(rel);
23211
+ savedPaths.push(name2);
23205
23212
  }
23206
23213
  const { formatImageOutput: formatImageOutput3 } = await Promise.resolve().then(() => (init_cli_style(), cli_style_exports));
23207
23214
  const output4 = await formatImageOutput3(root, {
@@ -23209,18 +23216,18 @@ var init_image_command = __esm({
23209
23216
  ok: savedPaths.length,
23210
23217
  fail: 0,
23211
23218
  files: savedPaths,
23212
- manifestPath: apiRes?.data?.url || savedPaths[0],
23219
+ manifestPath: "",
23213
23220
  size: cli.size,
23214
23221
  format: cli.format,
23215
23222
  model: cli.model,
23216
23223
  jobId: apiRes?.data?.jobId
23217
23224
  });
23218
23225
  try {
23219
- const api = new MariaAPIClient();
23226
+ const api = cliAuth.getAPIClient();
23220
23227
  await api.consumeQuota({ requests: 1, image: Math.max(1, savedPaths.length) });
23221
23228
  } catch {
23222
23229
  }
23223
- return this.success(output4);
23230
+ return this.success(output4, void 0, void 0);
23224
23231
  }
23225
23232
  if (Array.isArray(filesList) && filesList.length > 0) {
23226
23233
  const pathMod = await import('path');
@@ -23228,16 +23235,17 @@ var init_image_command = __esm({
23228
23235
  const base = (process.env.MARIA_API_BASE || "https://api.maria-code.ai").replace(/\/$/, "");
23229
23236
  const savedPaths = [];
23230
23237
  for (const relRaw of filesList) {
23231
- const rel = String(relRaw || "").replace(/^[\\/]+/, "");
23232
- const url2 = `${base}/${rel}`;
23233
- const full = pathMod.resolve(root, rel);
23238
+ const originalRel = String(relRaw || "").replace(/^[\\/]+/, "");
23239
+ const url2 = `${base}/${originalRel}`;
23240
+ const name2 = pathMod.basename(originalRel);
23241
+ const full = pathMod.resolve(root, name2);
23234
23242
  await fsMod.mkdir(pathMod.dirname(full), { recursive: true });
23235
23243
  const res2 = await fetch(url2);
23236
23244
  if (!res2.ok) throw new Error(`Failed to download image: ${res2.status}`);
23237
23245
  const arrayBuf = await res2.arrayBuffer();
23238
23246
  const buf = Buffer.from(arrayBuf);
23239
23247
  await fsMod.writeFile(full, buf);
23240
- savedPaths.push(rel);
23248
+ savedPaths.push(name2);
23241
23249
  }
23242
23250
  const { formatImageOutput: formatImageOutput3 } = await Promise.resolve().then(() => (init_cli_style(), cli_style_exports));
23243
23251
  const output4 = await formatImageOutput3(root, {
@@ -23245,18 +23253,18 @@ var init_image_command = __esm({
23245
23253
  ok: savedPaths.length,
23246
23254
  fail: 0,
23247
23255
  files: savedPaths,
23248
- manifestPath: savedPaths[0],
23256
+ manifestPath: "",
23249
23257
  size: cli.size,
23250
23258
  format: cli.format,
23251
23259
  model: cli.model,
23252
23260
  jobId: apiRes?.data?.jobId
23253
23261
  });
23254
23262
  try {
23255
- const api = new MariaAPIClient();
23263
+ const api = cliAuth.getAPIClient();
23256
23264
  await api.consumeQuota({ requests: 1, image: Math.max(1, savedPaths.length) });
23257
23265
  } catch {
23258
23266
  }
23259
- return this.success(output4);
23267
+ return this.success(output4, void 0, void 0);
23260
23268
  }
23261
23269
  if (urls.length > 0) {
23262
23270
  const { formatImageOutput: formatImageOutput3 } = await Promise.resolve().then(() => (init_cli_style(), cli_style_exports));
@@ -23265,19 +23273,19 @@ var init_image_command = __esm({
23265
23273
  ok: urls.length,
23266
23274
  fail: 0,
23267
23275
  files: urls,
23268
- manifestPath: urls[0],
23276
+ manifestPath: "",
23269
23277
  size: cli.size,
23270
23278
  format: cli.format,
23271
23279
  model: cli.model,
23272
23280
  jobId: apiRes?.data?.jobId
23273
23281
  });
23274
23282
  try {
23275
- const api = new MariaAPIClient();
23283
+ const api = cliAuth.getAPIClient();
23276
23284
  const consumed = Math.max(1, urls.length || Number(cli.count || 1));
23277
23285
  await api.consumeQuota({ requests: 1, image: consumed });
23278
23286
  } catch {
23279
23287
  }
23280
- return this.success(output4);
23288
+ return this.success(output4, void 0, void 0);
23281
23289
  }
23282
23290
  const { formatRemoteAcceptedImage: formatRemoteAcceptedImage2 } = await Promise.resolve().then(() => (init_cli_style(), cli_style_exports));
23283
23291
  const msg = formatRemoteAcceptedImage2({
@@ -23304,11 +23312,11 @@ var init_image_command = __esm({
23304
23312
  } catch {
23305
23313
  }
23306
23314
  try {
23307
- const api = new MariaAPIClient();
23315
+ const api = cliAuth.getAPIClient();
23308
23316
  await api.consumeQuota({ requests: 1, image: Math.max(1, Number(cli.count || 1)) });
23309
23317
  } catch {
23310
23318
  }
23311
- return this.success(msg);
23319
+ return this.success(msg, void 0, void 0);
23312
23320
  } catch (e2) {
23313
23321
  }
23314
23322
  }
@@ -23322,7 +23330,7 @@ var init_image_command = __esm({
23322
23330
  keepExif: cli.keepExif
23323
23331
  }, {
23324
23332
  root,
23325
- outDir: cli.outDir,
23333
+ outDir: cli.outDir || "",
23326
23334
  concurrency: cli.concurrency || 1,
23327
23335
  retry: cli.retry || 0,
23328
23336
  onProgress: () => {
@@ -23353,7 +23361,7 @@ var init_image_command = __esm({
23353
23361
  }
23354
23362
  try {
23355
23363
  if (await authManager.isAuthenticated()) {
23356
- const api = new MariaAPIClient();
23364
+ const api = cliAuth.getAPIClient();
23357
23365
  const consumed = Math.max(0, Number(res.ok || 0));
23358
23366
  if (consumed > 0) await api.consumeQuota({ requests: 1, image: consumed });
23359
23367
  }
@@ -23365,12 +23373,12 @@ var init_image_command = __esm({
23365
23373
  ok,
23366
23374
  fail,
23367
23375
  files: res.saved.files,
23368
- manifestPath: res.saved.manifestPath,
23376
+ manifestPath: "",
23369
23377
  size: cli.size,
23370
23378
  format: cli.format,
23371
23379
  model: cli.model
23372
23380
  });
23373
- return this.success(output3);
23381
+ return this.success(output3, void 0, void 0);
23374
23382
  } finally {
23375
23383
  try {
23376
23384
  spinner.stop();
@@ -23454,7 +23462,13 @@ async function runVideoPipeline(params2, opts) {
23454
23462
  const { GoogleGenAI } = __require("@google/genai");
23455
23463
  const ai2 = new GoogleGenAI({ apiKey });
23456
23464
  const modelName = params2.model || "veo-3.0-generate-001";
23457
- let operation = await ai2.models.generateVideos({ model: modelName, prompt: String(params2.prompt) });
23465
+ const aspectRatio = params2.size[0] >= params2.size[1] ? "16:9" : "9:16";
23466
+ const effectiveDuration = 8;
23467
+ let operation = await ai2.models.generateVideos({
23468
+ model: modelName,
23469
+ prompt: String(params2.prompt),
23470
+ config: { aspectRatio, durationSeconds: effectiveDuration, frameRate: params2.fps }
23471
+ });
23458
23472
  const pollStart = Date.now();
23459
23473
  const maxWaitMs = 6 * 60 * 1e3;
23460
23474
  while (!operation?.done && Date.now() - pollStart < maxWaitMs) {
@@ -23465,16 +23479,27 @@ async function runVideoPipeline(params2, opts) {
23465
23479
  if (!fileRef) throw new Error("Veo3: no video in response");
23466
23480
  const dl = await ai2.files.download({ file: fileRef });
23467
23481
  const arrayBuffer = await dl.arrayBuffer();
23468
- const mp4 = Buffer.from(arrayBuffer);
23482
+ const bytes = Buffer.from(arrayBuffer);
23483
+ const head2 = bytes.subarray(0, 256);
23484
+ const headStr = head2.toString("latin1");
23485
+ const hasFtyp = headStr.indexOf("ftyp") >= 0 || head2.includes(Buffer.from("ftyp", "ascii"));
23486
+ const isWebm = head2[0] === 26 && head2[1] === 69 && head2[2] === 223 && head2[3] === 163;
23487
+ let ext2 = ".mp4";
23488
+ if (isWebm) ext2 = ".webm";
23489
+ else if (hasFtyp) {
23490
+ const brand = head2.subarray(8, 12).toString("latin1").toLowerCase();
23491
+ if (brand.startsWith("qt")) ext2 = ".mov";
23492
+ else ext2 = ".mp4";
23493
+ }
23469
23494
  const promptHash2 = hashPrompt(params2.prompt);
23470
23495
  const manifest2 = {
23471
23496
  kind: "video",
23472
- request: { promptHash: promptHash2, seed: params2.seed, params: { size: params2.size, fps: params2.fps, duration: params2.duration, format: params2.format }, model: modelName, provider: "google" },
23497
+ request: { promptHash: promptHash2, seed: params2.seed, params: { size: params2.size, fps: params2.fps, duration: effectiveDuration, format: ext2.replace(".", "") }, model: modelName, provider: "google" },
23473
23498
  artifacts: [],
23474
23499
  metrics: { durationMs: Date.now() - started, retries: 0, fallbacks: 0 },
23475
23500
  trace: Math.random().toString(36).slice(2, 8).toUpperCase()
23476
23501
  };
23477
- const saved2 = await saveArtifacts({ root: opts.root, kind: "video", baseDir: opts.outDir }, [{ bytes: mp4, ext: ".mp4" }], manifest2);
23502
+ const saved2 = await saveArtifacts({ root: opts.root, kind: "video", baseDir: opts.outDir, flat: true, skipManifest: true }, [{ bytes, ext: ext2 }], manifest2);
23478
23503
  return { saved: saved2, durationMs: Date.now() - started, frames: 0, warnFallback: false, retries: 0 };
23479
23504
  }
23480
23505
  } catch {
@@ -23519,11 +23544,11 @@ async function runVideoPipeline(params2, opts) {
23519
23544
  await fsp__namespace.writeFile(path10__namespace.join(tmpDir, fname), frames[i2]);
23520
23545
  }
23521
23546
  const outBuf = await muxFramesToMp4(tmpDir, params2.fps);
23522
- saved = await saveArtifacts({ root: opts.root, kind: "video", baseDir: opts.outDir }, [{ bytes: outBuf, ext: ".mp4" }], manifest);
23547
+ saved = await saveArtifacts({ root: opts.root, kind: "video", baseDir: opts.outDir, flat: true, skipManifest: true }, [{ bytes: outBuf, ext: ".mp4" }], manifest);
23523
23548
  await fsp__namespace.rm(tmpDir, { recursive: true, force: true });
23524
23549
  } else {
23525
23550
  const items = frames.map((b, i2) => ({ bytes: b, ext: `.png`, logicalName: `frame-${String(i2 + 1).padStart(4, "0")}` }));
23526
- saved = await saveArtifacts({ root: opts.root, kind: "video", baseDir: opts.outDir }, items, manifest);
23551
+ saved = await saveArtifacts({ root: opts.root, kind: "video", baseDir: opts.outDir, flat: true, skipManifest: true }, items, manifest);
23527
23552
  warnFallback = true;
23528
23553
  }
23529
23554
  progress.done();
@@ -23564,15 +23589,16 @@ var init_video_command = __esm({
23564
23589
  category = "media";
23565
23590
  description = "Generate videos using Gemini (frames fallback when mux unavailable)";
23566
23591
  aliases = [];
23567
- usage = '/video "prompt" [--duration 5] [--fps 24] [--res 1280x720] [--format mp4|webm] [--model gemini-...] [--seed N] [--out dir] [--apply|--plan-only|--dry-run] [--concurrency N] [--retry N]';
23592
+ usage = '/video "prompt" [--duration 8] [--fps 24] [--res 1280x720] [--format mp4|webm] [--model gemini-...] [--seed N] [--out dir] [--apply|--plan-only|--dry-run] [--concurrency N] [--retry N]';
23568
23593
  examples = [
23569
- { input: '/video "product demo" --duration 5 --fps 24 --res 1280x720 --apply', description: "Generate a short demo video" }
23594
+ { input: '/video "product demo" --duration 8 --fps 24 --res 1280x720 --apply', description: "Generate a short demo video" }
23570
23595
  ];
23571
23596
  metadata = { version: "2.0.0", author: "maria" };
23572
23597
  async execute(args2, context2) {
23573
23598
  try {
23574
23599
  const root = context2.environment.cwd;
23575
23600
  const cli = normalizeVideoArgs(args2.raw, root);
23601
+ cli.duration = 8;
23576
23602
  if (cli.planOnly || cli.dryRun || !cli.apply) {
23577
23603
  const line = `Plan: video ${cli.duration}s @${cli.fps}fps ${cli.size[0]}x${cli.size[1]} ${cli.format} model=${cli.model || "auto"} concurrency=${cli.concurrency} retry=${cli.retry}`;
23578
23604
  const next = `Next: /video "${cli.prompt}" --duration ${cli.duration} --fps ${cli.fps} --res ${cli.size[0]}x${cli.size[1]} --apply`;
@@ -23598,6 +23624,41 @@ var init_video_command = __esm({
23598
23624
  body: JSON.stringify(body),
23599
23625
  headers: { "Content-Type": "application/json" }
23600
23626
  });
23627
+ const filesInline = apiRes?.data?.filesInline || [];
23628
+ if (filesInline.length > 0) {
23629
+ const pathMod = await import('path');
23630
+ const fsMod = await import('fs/promises');
23631
+ const savedPaths = [];
23632
+ for (const f3 of filesInline) {
23633
+ const original = String(f3.file || "").replace(/^[\\/]+/, "");
23634
+ const name2 = pathMod.basename(original || `video.${cli.format}`);
23635
+ const full = pathMod.resolve(root, name2);
23636
+ await fsMod.mkdir(pathMod.dirname(full), { recursive: true });
23637
+ const buf = Buffer.from(String(f3.bytesBase64 || ""), "base64");
23638
+ await fsMod.writeFile(full, buf);
23639
+ savedPaths.push(name2);
23640
+ }
23641
+ const { formatVideoOutput: formatVideoOutput3 } = await Promise.resolve().then(() => (init_cli_style(), cli_style_exports));
23642
+ const output4 = await formatVideoOutput3(root, {
23643
+ kind: "video",
23644
+ warnFallback: false,
23645
+ frames: 0,
23646
+ files: savedPaths,
23647
+ manifestPath: "",
23648
+ duration: cli.duration,
23649
+ fps: cli.fps,
23650
+ size: cli.size,
23651
+ format: cli.format,
23652
+ model: cli.model,
23653
+ jobId: apiRes?.data?.jobId
23654
+ });
23655
+ try {
23656
+ const api = cliAuth.getAPIClient();
23657
+ await api.consumeQuota({ requests: 1, video: savedPaths.length > 0 ? 1 : 0 });
23658
+ } catch {
23659
+ }
23660
+ return this.success(output4);
23661
+ }
23601
23662
  const filesFromApi = apiRes?.data?.files || [];
23602
23663
  if (filesFromApi.length > 0) {
23603
23664
  const pathMod = await import('path');
@@ -23607,14 +23668,15 @@ var init_video_command = __esm({
23607
23668
  for (const relRaw of filesFromApi) {
23608
23669
  const rel = String(relRaw || "").replace(/^[\\/]+/, "");
23609
23670
  const url2 = `${base}/${rel}`;
23610
- const full = pathMod.resolve(root, rel);
23671
+ const name2 = pathMod.basename(rel);
23672
+ const full = pathMod.resolve(root, name2);
23611
23673
  await fsMod.mkdir(pathMod.dirname(full), { recursive: true });
23612
23674
  const res2 = await fetch(url2);
23613
23675
  if (!res2.ok) throw new Error(`Failed to download video: ${res2.status}`);
23614
23676
  const arrayBuf = await res2.arrayBuffer();
23615
23677
  const buf = Buffer.from(arrayBuf);
23616
23678
  await fsMod.writeFile(full, buf);
23617
- savedPaths.push(rel);
23679
+ savedPaths.push(name2);
23618
23680
  }
23619
23681
  const { formatVideoOutput: formatVideoOutput3 } = await Promise.resolve().then(() => (init_cli_style(), cli_style_exports));
23620
23682
  const output4 = await formatVideoOutput3(root, {
@@ -23622,7 +23684,7 @@ var init_video_command = __esm({
23622
23684
  warnFallback: false,
23623
23685
  frames: 0,
23624
23686
  files: savedPaths,
23625
- manifestPath: String(apiRes?.data?.url || savedPaths[0]),
23687
+ manifestPath: "",
23626
23688
  duration: cli.duration,
23627
23689
  fps: cli.fps,
23628
23690
  size: cli.size,
@@ -25595,7 +25657,7 @@ var init_about_command = __esm({
25595
25657
  async execute(args2, context2) {
25596
25658
  const output3 = [];
25597
25659
  output3.push("");
25598
- output3.push(chalk40__default.default.cyan.bold("\u{1F916} About MARIA v4.3.15"));
25660
+ output3.push(chalk40__default.default.cyan.bold("\u{1F916} About MARIA v4.3.16"));
25599
25661
  output3.push(chalk40__default.default.gray("\u2550".repeat(40)));
25600
25662
  output3.push("");
25601
25663
  output3.push(chalk40__default.default.white.bold("MARIA - Minimal API, Maximum Power"));