@docyrus/animaguru 0.18.0 → 0.19.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/dist/animaguru.js CHANGED
@@ -2312,8 +2312,8 @@ var require_lib = __commonJS({
2312
2312
  if (typeof cb !== "function") {
2313
2313
  opts = cb;
2314
2314
  cb = null;
2315
- deferred = new this.Promise(function(resolve16, reject) {
2316
- deferredResolve = resolve16;
2315
+ deferred = new this.Promise(function(resolve17, reject) {
2316
+ deferredResolve = resolve17;
2317
2317
  deferredReject = reject;
2318
2318
  });
2319
2319
  }
@@ -2461,17 +2461,17 @@ var require_lib = __commonJS({
2461
2461
  if (typeof cb === "function") {
2462
2462
  fnx(cb);
2463
2463
  } else {
2464
- return new this.Promise(function(resolve16, reject) {
2464
+ return new this.Promise(function(resolve17, reject) {
2465
2465
  if (fnx.length === 1) {
2466
2466
  fnx(function(err2, ret) {
2467
2467
  if (err2) {
2468
2468
  reject(err2);
2469
2469
  } else {
2470
- resolve16(ret);
2470
+ resolve17(ret);
2471
2471
  }
2472
2472
  });
2473
2473
  } else {
2474
- resolve16(fnx());
2474
+ resolve17(fnx());
2475
2475
  }
2476
2476
  });
2477
2477
  }
@@ -6862,7 +6862,7 @@ var require_pify = __commonJS({
6862
6862
  "use strict";
6863
6863
  var processFn = (fn, options) => function(...args) {
6864
6864
  const P = options.promiseModule;
6865
- return new P((resolve16, reject) => {
6865
+ return new P((resolve17, reject) => {
6866
6866
  if (options.multiArgs) {
6867
6867
  args.push((...result) => {
6868
6868
  if (options.errorFirst) {
@@ -6870,10 +6870,10 @@ var require_pify = __commonJS({
6870
6870
  reject(result);
6871
6871
  } else {
6872
6872
  result.shift();
6873
- resolve16(result);
6873
+ resolve17(result);
6874
6874
  }
6875
6875
  } else {
6876
- resolve16(result);
6876
+ resolve17(result);
6877
6877
  }
6878
6878
  });
6879
6879
  } else if (options.errorFirst) {
@@ -6881,11 +6881,11 @@ var require_pify = __commonJS({
6881
6881
  if (error62) {
6882
6882
  reject(error62);
6883
6883
  } else {
6884
- resolve16(result);
6884
+ resolve17(result);
6885
6885
  }
6886
6886
  });
6887
6887
  } else {
6888
- args.push(resolve16);
6888
+ args.push(resolve17);
6889
6889
  }
6890
6890
  fn.apply(this, args);
6891
6891
  });
@@ -8083,17 +8083,17 @@ If you're a developer and you believe this is a bug in isomorphic-git, please fi
8083
8083
  const length = Math.ceil((62 + bpath.length + 1) / 8) * 8;
8084
8084
  const written = Buffer.alloc(length);
8085
8085
  const writer = new BufferCursor(written);
8086
- const stat9 = normalizeStats(entry);
8087
- writer.writeUInt32BE(stat9.ctimeSeconds);
8088
- writer.writeUInt32BE(stat9.ctimeNanoseconds);
8089
- writer.writeUInt32BE(stat9.mtimeSeconds);
8090
- writer.writeUInt32BE(stat9.mtimeNanoseconds);
8091
- writer.writeUInt32BE(stat9.dev);
8092
- writer.writeUInt32BE(stat9.ino);
8093
- writer.writeUInt32BE(stat9.mode);
8094
- writer.writeUInt32BE(stat9.uid);
8095
- writer.writeUInt32BE(stat9.gid);
8096
- writer.writeUInt32BE(stat9.size);
8086
+ const stat11 = normalizeStats(entry);
8087
+ writer.writeUInt32BE(stat11.ctimeSeconds);
8088
+ writer.writeUInt32BE(stat11.ctimeNanoseconds);
8089
+ writer.writeUInt32BE(stat11.mtimeSeconds);
8090
+ writer.writeUInt32BE(stat11.mtimeNanoseconds);
8091
+ writer.writeUInt32BE(stat11.dev);
8092
+ writer.writeUInt32BE(stat11.ino);
8093
+ writer.writeUInt32BE(stat11.mode);
8094
+ writer.writeUInt32BE(stat11.uid);
8095
+ writer.writeUInt32BE(stat11.gid);
8096
+ writer.writeUInt32BE(stat11.size);
8097
8097
  writer.write(entry.oid, 20, "hex");
8098
8098
  writer.writeUInt16BE(renderCacheEntryFlags(entry));
8099
8099
  writer.write(entry.path, bpath.length, "utf8");
@@ -8145,13 +8145,13 @@ If you're a developer and you believe this is a bug in isomorphic-git, please fi
8145
8145
  };
8146
8146
  }
8147
8147
  async function updateCachedIndexFile(fs2, filepath, cache) {
8148
- const [stat9, rawIndexFile] = await Promise.all([
8148
+ const [stat11, rawIndexFile] = await Promise.all([
8149
8149
  fs2.lstat(filepath),
8150
8150
  fs2.read(filepath)
8151
8151
  ]);
8152
8152
  const index3 = await GitIndex.from(rawIndexFile);
8153
8153
  cache.map.set(filepath, index3);
8154
- cache.stats.set(filepath, stat9);
8154
+ cache.stats.set(filepath, stat11);
8155
8155
  }
8156
8156
  async function isIndexStale(fs2, filepath, cache) {
8157
8157
  const savedStats = cache.stats.get(filepath);
@@ -8201,14 +8201,14 @@ If you're a developer and you believe this is a bug in isomorphic-git, please fi
8201
8201
  return result;
8202
8202
  }
8203
8203
  };
8204
- function basename7(path) {
8204
+ function basename8(path) {
8205
8205
  const last = Math.max(path.lastIndexOf("/"), path.lastIndexOf("\\"));
8206
8206
  if (last > -1) {
8207
8207
  path = path.slice(last + 1);
8208
8208
  }
8209
8209
  return path;
8210
8210
  }
8211
- function dirname14(path) {
8211
+ function dirname15(path) {
8212
8212
  const last = Math.max(path.lastIndexOf("/"), path.lastIndexOf("\\"));
8213
8213
  if (last === -1) return ".";
8214
8214
  if (last === 0) return "/";
@@ -8216,17 +8216,17 @@ If you're a developer and you believe this is a bug in isomorphic-git, please fi
8216
8216
  }
8217
8217
  function flatFileListToDirectoryStructure(files) {
8218
8218
  const inodes = /* @__PURE__ */ new Map();
8219
- const mkdir15 = function(name2) {
8219
+ const mkdir16 = function(name2) {
8220
8220
  if (!inodes.has(name2)) {
8221
8221
  const dir = {
8222
8222
  type: "tree",
8223
8223
  fullpath: name2,
8224
- basename: basename7(name2),
8224
+ basename: basename8(name2),
8225
8225
  metadata: {},
8226
8226
  children: []
8227
8227
  };
8228
8228
  inodes.set(name2, dir);
8229
- dir.parent = mkdir15(dirname14(name2));
8229
+ dir.parent = mkdir16(dirname15(name2));
8230
8230
  if (dir.parent && dir.parent !== dir) dir.parent.children.push(dir);
8231
8231
  }
8232
8232
  return inodes.get(name2);
@@ -8236,10 +8236,10 @@ If you're a developer and you believe this is a bug in isomorphic-git, please fi
8236
8236
  const file2 = {
8237
8237
  type: "blob",
8238
8238
  fullpath: name2,
8239
- basename: basename7(name2),
8239
+ basename: basename8(name2),
8240
8240
  metadata,
8241
8241
  // This recursively generates any missing parent folders.
8242
- parent: mkdir15(dirname14(name2)),
8242
+ parent: mkdir16(dirname15(name2)),
8243
8243
  children: []
8244
8244
  };
8245
8245
  if (file2.parent) file2.parent.children.push(file2);
@@ -8247,7 +8247,7 @@ If you're a developer and you believe this is a bug in isomorphic-git, please fi
8247
8247
  }
8248
8248
  return inodes.get(name2);
8249
8249
  };
8250
- mkdir15(".");
8250
+ mkdir16(".");
8251
8251
  for (const file2 of files) {
8252
8252
  mkfile(file2.path, file2);
8253
8253
  }
@@ -8650,7 +8650,7 @@ If you're a developer and you believe this is a bug in isomorphic-git, please fi
8650
8650
  }
8651
8651
  return isAbsolute2 ? `/${normalized}` : normalized;
8652
8652
  }
8653
- function join17(...args) {
8653
+ function join19(...args) {
8654
8654
  if (args.length === 0) return ".";
8655
8655
  let joined;
8656
8656
  for (let i2 = 0; i2 < args.length; ++i2) {
@@ -9052,7 +9052,7 @@ If you're a developer and you believe this is a bug in isomorphic-git, please fi
9052
9052
  for (const [key, value] of actualRefsToWrite) {
9053
9053
  await acquireLock(
9054
9054
  key,
9055
- async () => fs2.write(join17(gitdir, key), `${value.trim()}
9055
+ async () => fs2.write(join19(gitdir, key), `${value.trim()}
9056
9056
  `, "utf8")
9057
9057
  );
9058
9058
  }
@@ -9076,7 +9076,7 @@ If you're a developer and you believe this is a bug in isomorphic-git, please fi
9076
9076
  }
9077
9077
  await acquireLock(
9078
9078
  ref,
9079
- async () => fs2.write(join17(gitdir, ref), `${value.trim()}
9079
+ async () => fs2.write(join19(gitdir, ref), `${value.trim()}
9080
9080
  `, "utf8")
9081
9081
  );
9082
9082
  }
@@ -9094,7 +9094,7 @@ If you're a developer and you believe this is a bug in isomorphic-git, please fi
9094
9094
  assertWritableRef(ref);
9095
9095
  await acquireLock(
9096
9096
  ref,
9097
- async () => fs2.write(join17(gitdir, ref), `ref: ${value.trim()}
9097
+ async () => fs2.write(join19(gitdir, ref), `ref: ${value.trim()}
9098
9098
  `, "utf8")
9099
9099
  );
9100
9100
  }
@@ -9121,7 +9121,7 @@ If you're a developer and you believe this is a bug in isomorphic-git, please fi
9121
9121
  */
9122
9122
  static async deleteRefs({ fs: fs2, gitdir, refs }) {
9123
9123
  refs.forEach(assertWritableRef);
9124
- await Promise.all(refs.map((ref) => fs2.rm(join17(gitdir, ref))));
9124
+ await Promise.all(refs.map((ref) => fs2.rm(join19(gitdir, ref))));
9125
9125
  let text2 = await acquireLock(
9126
9126
  "packed-refs",
9127
9127
  async () => fs2.read(`${gitdir}/packed-refs`, { encoding: "utf8" })
@@ -10208,7 +10208,7 @@ If you're a developer and you believe this is a bug in isomorphic-git, please fi
10208
10208
  format = "content",
10209
10209
  getExternalRefDelta
10210
10210
  }) {
10211
- let list3 = await fs2.readdir(join17(gitdir, "objects/pack"));
10211
+ let list3 = await fs2.readdir(join19(gitdir, "objects/pack"));
10212
10212
  list3 = list3.filter((x2) => x2.endsWith(".idx"));
10213
10213
  for (const filename of list3) {
10214
10214
  const indexFile = `${gitdir}/objects/pack/${filename}`;
@@ -11065,9 +11065,9 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
11065
11065
  }
11066
11066
  const tree = GitTree.from(object2);
11067
11067
  for (const entry2 of tree) {
11068
- map2.set(join17(filepath, entry2.path), entry2);
11068
+ map2.set(join19(filepath, entry2.path), entry2);
11069
11069
  }
11070
- return tree.entries().map((entry2) => join17(filepath, entry2.path));
11070
+ return tree.entries().map((entry2) => join19(filepath, entry2.path));
11071
11071
  }
11072
11072
  async type(entry) {
11073
11073
  if (entry._type === false) {
@@ -11160,9 +11160,9 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
11160
11160
  if (await entry.type() !== "tree") return null;
11161
11161
  const filepath = entry._fullpath;
11162
11162
  const { fs: fs2, dir } = this;
11163
- const names = await fs2.readdir(join17(dir, filepath));
11163
+ const names = await fs2.readdir(join19(dir, filepath));
11164
11164
  if (names === null) return null;
11165
- return names.map((name2) => join17(filepath, name2));
11165
+ return names.map((name2) => join19(filepath, name2));
11166
11166
  }
11167
11167
  async type(entry) {
11168
11168
  if (entry._type === false) {
@@ -11179,23 +11179,23 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
11179
11179
  async stat(entry) {
11180
11180
  if (entry._stat === false) {
11181
11181
  const { fs: fs2, dir } = this;
11182
- let stat9 = await fs2.lstat(`${dir}/${entry._fullpath}`);
11183
- if (!stat9) {
11182
+ let stat11 = await fs2.lstat(`${dir}/${entry._fullpath}`);
11183
+ if (!stat11) {
11184
11184
  throw new Error(
11185
11185
  `ENOENT: no such file or directory, lstat '${entry._fullpath}'`
11186
11186
  );
11187
11187
  }
11188
- let type = stat9.isDirectory() ? "tree" : "blob";
11189
- if (type === "blob" && !stat9.isFile() && !stat9.isSymbolicLink()) {
11188
+ let type = stat11.isDirectory() ? "tree" : "blob";
11189
+ if (type === "blob" && !stat11.isFile() && !stat11.isSymbolicLink()) {
11190
11190
  type = "special";
11191
11191
  }
11192
11192
  entry._type = type;
11193
- stat9 = normalizeStats(stat9);
11194
- entry._mode = stat9.mode;
11195
- if (stat9.size === -1 && entry._actualSize) {
11196
- stat9.size = entry._actualSize;
11193
+ stat11 = normalizeStats(stat11);
11194
+ entry._mode = stat11.mode;
11195
+ if (stat11.size === -1 && entry._actualSize) {
11196
+ stat11.size = entry._actualSize;
11197
11197
  }
11198
- entry._stat = stat9;
11198
+ entry._stat = stat11;
11199
11199
  }
11200
11200
  return entry._stat;
11201
11201
  }
@@ -11383,24 +11383,24 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
11383
11383
  };
11384
11384
  return walk2(root);
11385
11385
  }
11386
- async function mkdirp(mkdir15, filepath, retries = 10) {
11386
+ async function mkdirp(mkdir16, filepath, retries = 10) {
11387
11387
  try {
11388
- await mkdir15(filepath);
11388
+ await mkdir16(filepath);
11389
11389
  } catch (err2) {
11390
11390
  if (err2 === null) return;
11391
11391
  if (err2.code === "EEXIST") return;
11392
11392
  if (err2.code !== "ENOENT") throw err2;
11393
- const parent = dirname14(filepath);
11393
+ const parent = dirname15(filepath);
11394
11394
  if (parent === "." || parent === "/" || parent === filepath) throw err2;
11395
- await mkdirp(mkdir15, parent, retries);
11395
+ await mkdirp(mkdir16, parent, retries);
11396
11396
  for (let attempt = 0; ; attempt++) {
11397
11397
  try {
11398
- await mkdir15(filepath);
11398
+ await mkdir16(filepath);
11399
11399
  return;
11400
11400
  } catch (err22) {
11401
11401
  if (err22 === null || err22.code === "EEXIST") return;
11402
11402
  if (err22.code === "ENOENT" && attempt < retries) {
11403
- await new Promise((resolve16) => setTimeout(resolve16, 0));
11403
+ await new Promise((resolve17) => setTimeout(resolve17, 0));
11404
11404
  continue;
11405
11405
  }
11406
11406
  throw err22;
@@ -11415,10 +11415,10 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
11415
11415
  } else if (entries.length) {
11416
11416
  await Promise.all(
11417
11417
  entries.map((entry) => {
11418
- const subpath = join17(filepath, entry);
11419
- return fs2.lstat(subpath).then((stat9) => {
11420
- if (!stat9) return;
11421
- return stat9.isDirectory() ? rmRecursive(fs2, subpath) : fs2.rm(subpath);
11418
+ const subpath = join19(filepath, entry);
11419
+ return fs2.lstat(subpath).then((stat11) => {
11420
+ if (!stat11) return;
11421
+ return stat11.isDirectory() ? rmRecursive(fs2, subpath) : fs2.rm(subpath);
11422
11422
  });
11423
11423
  })
11424
11424
  ).then(() => fs2.rmdir(filepath));
@@ -11554,7 +11554,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
11554
11554
  try {
11555
11555
  await this._writeFile(filepath, contents, options);
11556
11556
  } catch (err2) {
11557
- await this.mkdir(dirname14(filepath));
11557
+ await this.mkdir(dirname15(filepath));
11558
11558
  await this._writeFile(filepath, contents, options);
11559
11559
  }
11560
11560
  }
@@ -11700,7 +11700,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
11700
11700
  if (isAbsolute(submoduleGitdir)) {
11701
11701
  return submoduleGitdir;
11702
11702
  }
11703
- const gitdir = join17(dirname14(dotgit), submoduleGitdir);
11703
+ const gitdir = join19(dirname15(dotgit), submoduleGitdir);
11704
11704
  return gitdir;
11705
11705
  });
11706
11706
  } else {
@@ -11722,7 +11722,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
11722
11722
  async function abortMerge({
11723
11723
  fs: _fs,
11724
11724
  dir,
11725
- gitdir = join17(dir, ".git"),
11725
+ gitdir = join19(dir, ".git"),
11726
11726
  commit: commit2 = "HEAD",
11727
11727
  cache = {}
11728
11728
  }) {
@@ -11803,17 +11803,17 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
11803
11803
  * @param {string} args.filepath - The path of the file to check.
11804
11804
  * @returns {Promise<boolean>} - `true` if the file is ignored, `false` otherwise.
11805
11805
  */
11806
- static async isIgnored({ fs: fs2, dir, gitdir = join17(dir, ".git"), filepath }) {
11807
- if (basename7(filepath) === ".git") return true;
11806
+ static async isIgnored({ fs: fs2, dir, gitdir = join19(dir, ".git"), filepath }) {
11807
+ if (basename8(filepath) === ".git") return true;
11808
11808
  if (filepath === ".") return false;
11809
11809
  let excludes = "";
11810
- const excludesFile = join17(gitdir, "info", "exclude");
11810
+ const excludesFile = join19(gitdir, "info", "exclude");
11811
11811
  if (await fs2.exists(excludesFile)) {
11812
11812
  excludes = await fs2.read(excludesFile, "utf8");
11813
11813
  }
11814
11814
  const pairs = [
11815
11815
  {
11816
- gitignore: join17(dir, ".gitignore"),
11816
+ gitignore: join19(dir, ".gitignore"),
11817
11817
  filepath
11818
11818
  }
11819
11819
  ];
@@ -11822,7 +11822,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
11822
11822
  const folder = pieces.slice(0, i2).join("/");
11823
11823
  const file2 = pieces.slice(i2).join("/");
11824
11824
  pairs.push({
11825
- gitignore: join17(dir, folder, ".gitignore"),
11825
+ gitignore: join19(dir, folder, ".gitignore"),
11826
11826
  filepath: file2
11827
11827
  });
11828
11828
  }
@@ -11836,7 +11836,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
11836
11836
  }
11837
11837
  const ign = ignore2().add(excludes);
11838
11838
  ign.add(file2);
11839
- const parentdir = dirname14(p.filepath);
11839
+ const parentdir = dirname15(p.filepath);
11840
11840
  if (parentdir !== "." && ign.ignores(parentdir)) return true;
11841
11841
  if (ignoredStatus) {
11842
11842
  ignoredStatus = !ign.test(p.filepath).unignored;
@@ -11909,7 +11909,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
11909
11909
  async function add({
11910
11910
  fs: _fs,
11911
11911
  dir,
11912
- gitdir = join17(dir, ".git"),
11912
+ gitdir = join19(dir, ".git"),
11913
11913
  filepath,
11914
11914
  cache = {},
11915
11915
  force = false,
@@ -11973,17 +11973,17 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
11973
11973
  });
11974
11974
  if (ignored) return;
11975
11975
  }
11976
- const stats = await fs2.lstat(join17(dir, currentFilepath));
11976
+ const stats = await fs2.lstat(join19(dir, currentFilepath));
11977
11977
  if (!stats) throw new NotFoundError(currentFilepath);
11978
11978
  if (stats.isDirectory()) {
11979
- const children = await fs2.readdir(join17(dir, currentFilepath));
11979
+ const children = await fs2.readdir(join19(dir, currentFilepath));
11980
11980
  if (parallel) {
11981
11981
  const promises3 = children.map(
11982
11982
  (child) => addToIndex({
11983
11983
  dir,
11984
11984
  gitdir,
11985
11985
  fs: fs2,
11986
- filepath: [join17(currentFilepath, child)],
11986
+ filepath: [join19(currentFilepath, child)],
11987
11987
  index: index3,
11988
11988
  force,
11989
11989
  parallel,
@@ -11997,7 +11997,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
11997
11997
  dir,
11998
11998
  gitdir,
11999
11999
  fs: fs2,
12000
- filepath: [join17(currentFilepath, child)],
12000
+ filepath: [join19(currentFilepath, child)],
12001
12001
  index: index3,
12002
12002
  force,
12003
12003
  parallel,
@@ -12006,7 +12006,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
12006
12006
  }
12007
12007
  }
12008
12008
  } else {
12009
- const object2 = stats.isSymbolicLink() ? await fs2.readlink(join17(dir, currentFilepath)).then(posixifyPathBuffer) : await fs2.read(join17(dir, currentFilepath), { autocrlf });
12009
+ const object2 = stats.isSymbolicLink() ? await fs2.readlink(join19(dir, currentFilepath)).then(posixifyPathBuffer) : await fs2.read(join19(dir, currentFilepath), { autocrlf });
12010
12010
  if (object2 === null) throw new NotFoundError(currentFilepath);
12011
12011
  const oid = await _writeObject({ fs: fs2, gitdir, type: "blob", object: object2 });
12012
12012
  index3.insert({ filepath: currentFilepath, stats, oid });
@@ -12440,7 +12440,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
12440
12440
  fs: _fs,
12441
12441
  onSign,
12442
12442
  dir,
12443
- gitdir = join17(dir, ".git"),
12443
+ gitdir = join19(dir, ".git"),
12444
12444
  ref = "refs/notes/commits",
12445
12445
  oid,
12446
12446
  note,
@@ -12510,7 +12510,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
12510
12510
  async function addRemote({
12511
12511
  fs: fs2,
12512
12512
  dir,
12513
- gitdir = join17(dir, ".git"),
12513
+ gitdir = join19(dir, ".git"),
12514
12514
  remote,
12515
12515
  url: url3,
12516
12516
  force = false
@@ -12580,7 +12580,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
12580
12580
  fs: _fs,
12581
12581
  onSign,
12582
12582
  dir,
12583
- gitdir = join17(dir, ".git"),
12583
+ gitdir = join19(dir, ".git"),
12584
12584
  ref,
12585
12585
  tagger: _tagger,
12586
12586
  message = ref,
@@ -12661,7 +12661,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
12661
12661
  async function branch({
12662
12662
  fs: fs2,
12663
12663
  dir,
12664
- gitdir = join17(dir, ".git"),
12664
+ gitdir = join19(dir, ".git"),
12665
12665
  ref,
12666
12666
  object: object2,
12667
12667
  checkout: checkout2 = false,
@@ -13325,7 +13325,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
13325
13325
  onProgress,
13326
13326
  onPostCheckout,
13327
13327
  dir,
13328
- gitdir = join17(dir, ".git"),
13328
+ gitdir = join19(dir, ".git"),
13329
13329
  remote = "origin",
13330
13330
  ref: _ref,
13331
13331
  filepaths,
@@ -13406,7 +13406,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
13406
13406
  fs: fs2,
13407
13407
  cache,
13408
13408
  dir,
13409
- gitdir = join17(dir, ".git"),
13409
+ gitdir = join19(dir, ".git"),
13410
13410
  index: index3,
13411
13411
  ourOid,
13412
13412
  baseOid,
@@ -13432,7 +13432,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
13432
13432
  gitdir,
13433
13433
  trees: [ourTree, baseTree, theirTree],
13434
13434
  map: async function(filepath, [ours, base2, theirs]) {
13435
- const path = basename7(filepath);
13435
+ const path = basename8(filepath);
13436
13436
  const ourChange = await modified(ours, base2);
13437
13437
  const theirChange = await modified(theirs, base2);
13438
13438
  switch (`${ourChange}-${theirChange}`) {
@@ -13676,7 +13676,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
13676
13676
  workdir: WORKDIR
13677
13677
  };
13678
13678
  async function checkAndWriteBlob(fs2, gitdir, dir, filepath, oid = null) {
13679
- const currentFilepath = join17(dir, filepath);
13679
+ const currentFilepath = join19(dir, filepath);
13680
13680
  const stats = await fs2.lstat(currentFilepath);
13681
13681
  if (!stats) throw new NotFoundError(currentFilepath);
13682
13682
  if (stats.isDirectory())
@@ -13845,7 +13845,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
13845
13845
  stageUpdated.push({
13846
13846
  filepath,
13847
13847
  oid,
13848
- stats: await fs2.lstat(join17(dir, filepath))
13848
+ stats: await fs2.lstat(join19(dir, filepath))
13849
13849
  });
13850
13850
  return {
13851
13851
  method: "write",
@@ -13858,7 +13858,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
13858
13858
  });
13859
13859
  await acquireLock(gitdir, async () => {
13860
13860
  for (const op of ops) {
13861
- const currentFilepath = join17(dir, op.filepath);
13861
+ const currentFilepath = join19(dir, op.filepath);
13862
13862
  switch (op.method) {
13863
13863
  case "rmdir":
13864
13864
  await fs2.rmdir(currentFilepath);
@@ -13992,7 +13992,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
13992
13992
  async function cherryPick({
13993
13993
  fs: _fs,
13994
13994
  dir,
13995
- gitdir = join17(dir, ".git"),
13995
+ gitdir = join19(dir, ".git"),
13996
13996
  oid,
13997
13997
  cache = {},
13998
13998
  committer,
@@ -14497,7 +14497,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
14497
14497
  * @returns {Promise<Set<string>>} - A set of shallow object IDs.
14498
14498
  */
14499
14499
  static async read({ fs: fs2, gitdir }) {
14500
- const filepath = join17(gitdir, "shallow");
14500
+ const filepath = join19(gitdir, "shallow");
14501
14501
  const oids = /* @__PURE__ */ new Set();
14502
14502
  await acquireLock(filepath, async function() {
14503
14503
  const text2 = await fs2.read(filepath, { encoding: "utf8" });
@@ -14518,7 +14518,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
14518
14518
  * @returns {Promise<void>}
14519
14519
  */
14520
14520
  static async write({ fs: fs2, gitdir, oids }) {
14521
- const filepath = join17(gitdir, "shallow");
14521
+ const filepath = join19(gitdir, "shallow");
14522
14522
  if (oids.size > 0) {
14523
14523
  const text2 = [...oids].join("\n") + "\n";
14524
14524
  await acquireLock(filepath, async function() {
@@ -14544,7 +14544,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
14544
14544
  oid,
14545
14545
  getExternalRefDelta
14546
14546
  }) {
14547
- let list3 = await fs2.readdir(join17(gitdir, "objects/pack"));
14547
+ let list3 = await fs2.readdir(join19(gitdir, "objects/pack"));
14548
14548
  list3 = list3.filter((x2) => x2.endsWith(".idx"));
14549
14549
  for (const filename of list3) {
14550
14550
  const indexFile = `${gitdir}/objects/pack/${filename}`;
@@ -14616,9 +14616,9 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
14616
14616
  throw Error("You cannot write to a FIFO that has already been ended!");
14617
14617
  }
14618
14618
  if (this._waiting) {
14619
- const resolve16 = this._waiting;
14619
+ const resolve17 = this._waiting;
14620
14620
  this._waiting = null;
14621
- resolve16({ value: chunk });
14621
+ resolve17({ value: chunk });
14622
14622
  } else {
14623
14623
  this._queue.push(chunk);
14624
14624
  }
@@ -14626,9 +14626,9 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
14626
14626
  end() {
14627
14627
  this._ended = true;
14628
14628
  if (this._waiting) {
14629
- const resolve16 = this._waiting;
14629
+ const resolve17 = this._waiting;
14630
14630
  this._waiting = null;
14631
- resolve16({ done: true });
14631
+ resolve17({ done: true });
14632
14632
  }
14633
14633
  }
14634
14634
  destroy(err2) {
@@ -14647,8 +14647,8 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
14647
14647
  "You cannot call read until the previous call to read has returned!"
14648
14648
  );
14649
14649
  }
14650
- return new Promise((resolve16) => {
14651
- this._waiting = resolve16;
14650
+ return new Promise((resolve17) => {
14651
+ this._waiting = resolve17;
14652
14652
  });
14653
14653
  }
14654
14654
  };
@@ -14803,7 +14803,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
14803
14803
  const acks = [];
14804
14804
  let nak = false;
14805
14805
  let done = false;
14806
- return new Promise((resolve16, reject) => {
14806
+ return new Promise((resolve17, reject) => {
14807
14807
  forAwait2(packetlines, (data) => {
14808
14808
  const line = data.toString("utf8").trim();
14809
14809
  if (line.startsWith("shallow")) {
@@ -14830,11 +14830,11 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
14830
14830
  nak = true;
14831
14831
  }
14832
14832
  if (done) {
14833
- stream.error ? reject(stream.error) : resolve16({ shallows, unshallows, acks, nak, packfile, progress });
14833
+ stream.error ? reject(stream.error) : resolve17({ shallows, unshallows, acks, nak, packfile, progress });
14834
14834
  }
14835
14835
  }).finally(() => {
14836
14836
  if (!done) {
14837
- stream.error ? reject(stream.error) : resolve16({ shallows, unshallows, acks, nak, packfile, progress });
14837
+ stream.error ? reject(stream.error) : resolve17({ shallows, unshallows, acks, nak, packfile, progress });
14838
14838
  }
14839
14839
  });
14840
14840
  });
@@ -14901,7 +14901,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
14901
14901
  depth = null,
14902
14902
  since = null,
14903
14903
  exclude = [],
14904
- relative: relative3 = false,
14904
+ relative: relative4 = false,
14905
14905
  tags = false,
14906
14906
  singleBranch = false,
14907
14907
  headers = {},
@@ -14949,7 +14949,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
14949
14949
  if (exclude.length > 0 && !remoteHTTP.capabilities.has("deepen-not")) {
14950
14950
  throw new RemoteCapabilityError("deepen-not", "exclude");
14951
14951
  }
14952
- if (relative3 === true && !remoteHTTP.capabilities.has("deepen-relative")) {
14952
+ if (relative4 === true && !remoteHTTP.capabilities.has("deepen-relative")) {
14953
14953
  throw new RemoteCapabilityError("deepen-relative", "relative");
14954
14954
  }
14955
14955
  const { oid, fullref } = GitRefManager.resolveAgainstMap({
@@ -14977,7 +14977,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
14977
14977
  `agent=${pkg.agent}`
14978
14978
  ]
14979
14979
  );
14980
- if (relative3) capabilities.push("deepen-relative");
14980
+ if (relative4) capabilities.push("deepen-relative");
14981
14981
  const wants = singleBranch ? [oid] : remoteRefs.values();
14982
14982
  const haveRefs = singleBranch ? [ref] : await GitRefManager.listRefs({
14983
14983
  fs: fs2,
@@ -15135,7 +15135,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
15135
15135
  }
15136
15136
  if (packfileSha !== "" && !emptyPackfile(packfile)) {
15137
15137
  res.packfile = `objects/pack/pack-${packfileSha}.pack`;
15138
- const fullpath = join17(gitdir, res.packfile);
15138
+ const fullpath = join19(gitdir, res.packfile);
15139
15139
  await fs2.write(fullpath, packfile);
15140
15140
  const getExternalRefDelta = (oid2) => _readObject({ fs: fs2, cache, gitdir, oid: oid2 });
15141
15141
  const idx = await GitPackIndex.fromPack({
@@ -15151,7 +15151,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
15151
15151
  fs: fs2,
15152
15152
  bare = false,
15153
15153
  dir,
15154
- gitdir = bare ? dir : join17(dir, ".git"),
15154
+ gitdir = bare ? dir : join19(dir, ".git"),
15155
15155
  defaultBranch = "master"
15156
15156
  }) {
15157
15157
  if (await fs2.exists(gitdir + "/config")) return;
@@ -15197,7 +15197,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
15197
15197
  depth,
15198
15198
  since,
15199
15199
  exclude,
15200
- relative: relative3,
15200
+ relative: relative4,
15201
15201
  singleBranch,
15202
15202
  noCheckout,
15203
15203
  noTags,
@@ -15229,7 +15229,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
15229
15229
  depth,
15230
15230
  since,
15231
15231
  exclude,
15232
- relative: relative3,
15232
+ relative: relative4,
15233
15233
  singleBranch,
15234
15234
  headers,
15235
15235
  tags: !noTags
@@ -15265,7 +15265,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
15265
15265
  onAuthFailure,
15266
15266
  onPostCheckout,
15267
15267
  dir,
15268
- gitdir = join17(dir, ".git"),
15268
+ gitdir = join19(dir, ".git"),
15269
15269
  url: url3,
15270
15270
  corsProxy = void 0,
15271
15271
  ref = void 0,
@@ -15273,7 +15273,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
15273
15273
  depth = void 0,
15274
15274
  since = void 0,
15275
15275
  exclude = [],
15276
- relative: relative3 = false,
15276
+ relative: relative4 = false,
15277
15277
  singleBranch = false,
15278
15278
  noCheckout = false,
15279
15279
  noTags = false,
@@ -15311,7 +15311,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
15311
15311
  depth,
15312
15312
  since,
15313
15313
  exclude,
15314
- relative: relative3,
15314
+ relative: relative4,
15315
15315
  singleBranch,
15316
15316
  noCheckout,
15317
15317
  noTags,
@@ -15328,7 +15328,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
15328
15328
  fs: _fs,
15329
15329
  onSign,
15330
15330
  dir,
15331
- gitdir = join17(dir, ".git"),
15331
+ gitdir = join19(dir, ".git"),
15332
15332
  message,
15333
15333
  author,
15334
15334
  committer,
@@ -15377,7 +15377,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
15377
15377
  async function currentBranch({
15378
15378
  fs: fs2,
15379
15379
  dir,
15380
- gitdir = join17(dir, ".git"),
15380
+ gitdir = join19(dir, ".git"),
15381
15381
  fullname = false,
15382
15382
  test = false
15383
15383
  }) {
@@ -15418,7 +15418,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
15418
15418
  async function deleteBranch({
15419
15419
  fs: fs2,
15420
15420
  dir,
15421
- gitdir = join17(dir, ".git"),
15421
+ gitdir = join19(dir, ".git"),
15422
15422
  ref
15423
15423
  }) {
15424
15424
  try {
@@ -15436,7 +15436,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
15436
15436
  throw err2;
15437
15437
  }
15438
15438
  }
15439
- async function deleteRef({ fs: fs2, dir, gitdir = join17(dir, ".git"), ref }) {
15439
+ async function deleteRef({ fs: fs2, dir, gitdir = join19(dir, ".git"), ref }) {
15440
15440
  try {
15441
15441
  assertParameter("fs", fs2);
15442
15442
  assertParameter("ref", ref);
@@ -15456,7 +15456,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
15456
15456
  async function deleteRemote({
15457
15457
  fs: fs2,
15458
15458
  dir,
15459
- gitdir = join17(dir, ".git"),
15459
+ gitdir = join19(dir, ".git"),
15460
15460
  remote
15461
15461
  }) {
15462
15462
  try {
@@ -15478,7 +15478,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
15478
15478
  ref = ref.startsWith("refs/tags/") ? ref : `refs/tags/${ref}`;
15479
15479
  await GitRefManager.deleteRef({ fs: fs2, gitdir, ref });
15480
15480
  }
15481
- async function deleteTag({ fs: fs2, dir, gitdir = join17(dir, ".git"), ref }) {
15481
+ async function deleteTag({ fs: fs2, dir, gitdir = join19(dir, ".git"), ref }) {
15482
15482
  try {
15483
15483
  assertParameter("fs", fs2);
15484
15484
  assertParameter("ref", ref);
@@ -15507,7 +15507,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
15507
15507
  getExternalRefDelta
15508
15508
  }) {
15509
15509
  const results = [];
15510
- let list3 = await fs2.readdir(join17(gitdir, "objects/pack"));
15510
+ let list3 = await fs2.readdir(join19(gitdir, "objects/pack"));
15511
15511
  list3 = list3.filter((x2) => x2.endsWith(".idx"));
15512
15512
  for (const filename of list3) {
15513
15513
  const indexFile = `${gitdir}/objects/pack/${filename}`;
@@ -15550,7 +15550,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
15550
15550
  async function expandOid({
15551
15551
  fs: fs2,
15552
15552
  dir,
15553
- gitdir = join17(dir, ".git"),
15553
+ gitdir = join19(dir, ".git"),
15554
15554
  oid,
15555
15555
  cache = {}
15556
15556
  }) {
@@ -15571,7 +15571,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
15571
15571
  throw err2;
15572
15572
  }
15573
15573
  }
15574
- async function expandRef({ fs: fs2, dir, gitdir = join17(dir, ".git"), ref }) {
15574
+ async function expandRef({ fs: fs2, dir, gitdir = join19(dir, ".git"), ref }) {
15575
15575
  try {
15576
15576
  assertParameter("fs", fs2);
15577
15577
  assertParameter("gitdir", gitdir);
@@ -15862,7 +15862,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
15862
15862
  onAuthSuccess,
15863
15863
  onAuthFailure,
15864
15864
  dir,
15865
- gitdir = join17(dir, ".git"),
15865
+ gitdir = join19(dir, ".git"),
15866
15866
  ref,
15867
15867
  url: url3,
15868
15868
  remote,
@@ -15920,7 +15920,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
15920
15920
  onAuthSuccess,
15921
15921
  onAuthFailure,
15922
15922
  dir,
15923
- gitdir = join17(dir, ".git"),
15923
+ gitdir = join19(dir, ".git"),
15924
15924
  ref,
15925
15925
  remote,
15926
15926
  remoteRef,
@@ -15929,7 +15929,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
15929
15929
  depth = null,
15930
15930
  since = null,
15931
15931
  exclude = [],
15932
- relative: relative3 = false,
15932
+ relative: relative4 = false,
15933
15933
  tags = false,
15934
15934
  singleBranch = false,
15935
15935
  headers = {},
@@ -15961,7 +15961,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
15961
15961
  depth,
15962
15962
  since,
15963
15963
  exclude,
15964
- relative: relative3,
15964
+ relative: relative4,
15965
15965
  tags,
15966
15966
  singleBranch,
15967
15967
  headers,
@@ -15976,7 +15976,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
15976
15976
  async function findMergeBase({
15977
15977
  fs: fs2,
15978
15978
  dir,
15979
- gitdir = join17(dir, ".git"),
15979
+ gitdir = join19(dir, ".git"),
15980
15980
  oids,
15981
15981
  cache = {}
15982
15982
  }) {
@@ -15998,10 +15998,10 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
15998
15998
  }
15999
15999
  }
16000
16000
  async function _findRoot({ fs: fs2, filepath }) {
16001
- if (await fs2.exists(join17(filepath, ".git"))) {
16001
+ if (await fs2.exists(join19(filepath, ".git"))) {
16002
16002
  return filepath;
16003
16003
  } else {
16004
- const parent = dirname14(filepath);
16004
+ const parent = dirname15(filepath);
16005
16005
  if (parent === filepath) {
16006
16006
  throw new NotFoundError(`git root for ${filepath}`);
16007
16007
  }
@@ -16018,7 +16018,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
16018
16018
  throw err2;
16019
16019
  }
16020
16020
  }
16021
- async function getConfig({ fs: fs2, dir, gitdir = join17(dir, ".git"), path }) {
16021
+ async function getConfig({ fs: fs2, dir, gitdir = join19(dir, ".git"), path }) {
16022
16022
  try {
16023
16023
  assertParameter("fs", fs2);
16024
16024
  assertParameter("gitdir", gitdir);
@@ -16042,7 +16042,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
16042
16042
  async function getConfigAll({
16043
16043
  fs: fs2,
16044
16044
  dir,
16045
- gitdir = join17(dir, ".git"),
16045
+ gitdir = join19(dir, ".git"),
16046
16046
  path
16047
16047
  }) {
16048
16048
  try {
@@ -16231,7 +16231,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
16231
16231
  filepath
16232
16232
  }) {
16233
16233
  try {
16234
- filepath = join17(dir, filepath);
16234
+ filepath = join19(dir, filepath);
16235
16235
  const pack = await fs2.read(filepath);
16236
16236
  const getExternalRefDelta = (oid) => _readObject({ fs: fs2, cache, gitdir, oid });
16237
16237
  const idx = await GitPackIndex.fromPack({
@@ -16252,7 +16252,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
16252
16252
  fs: fs2,
16253
16253
  onProgress,
16254
16254
  dir,
16255
- gitdir = join17(dir, ".git"),
16255
+ gitdir = join19(dir, ".git"),
16256
16256
  filepath,
16257
16257
  cache = {}
16258
16258
  }) {
@@ -16280,7 +16280,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
16280
16280
  fs: fs2,
16281
16281
  bare = false,
16282
16282
  dir,
16283
- gitdir = bare ? dir : join17(dir, ".git"),
16283
+ gitdir = bare ? dir : join19(dir, ".git"),
16284
16284
  defaultBranch = "master"
16285
16285
  }) {
16286
16286
  try {
@@ -16354,7 +16354,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
16354
16354
  async function isDescendent({
16355
16355
  fs: fs2,
16356
16356
  dir,
16357
- gitdir = join17(dir, ".git"),
16357
+ gitdir = join19(dir, ".git"),
16358
16358
  oid,
16359
16359
  ancestor,
16360
16360
  depth = -1,
@@ -16383,7 +16383,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
16383
16383
  async function isIgnored({
16384
16384
  fs: fs2,
16385
16385
  dir,
16386
- gitdir = join17(dir, ".git"),
16386
+ gitdir = join19(dir, ".git"),
16387
16387
  filepath
16388
16388
  }) {
16389
16389
  try {
@@ -16407,7 +16407,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
16407
16407
  async function listBranches({
16408
16408
  fs: fs2,
16409
16409
  dir,
16410
- gitdir = join17(dir, ".git"),
16410
+ gitdir = join19(dir, ".git"),
16411
16411
  remote
16412
16412
  }) {
16413
16413
  try {
@@ -16464,17 +16464,17 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
16464
16464
  gitdir,
16465
16465
  oid: entry.oid,
16466
16466
  filenames,
16467
- prefix: join17(prefix, entry.path)
16467
+ prefix: join19(prefix, entry.path)
16468
16468
  });
16469
16469
  } else {
16470
- filenames.push(join17(prefix, entry.path));
16470
+ filenames.push(join19(prefix, entry.path));
16471
16471
  }
16472
16472
  }
16473
16473
  }
16474
16474
  async function listFiles({
16475
16475
  fs: fs2,
16476
16476
  dir,
16477
- gitdir = join17(dir, ".git"),
16477
+ gitdir = join19(dir, ".git"),
16478
16478
  ref,
16479
16479
  cache = {}
16480
16480
  }) {
@@ -16518,7 +16518,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
16518
16518
  async function listNotes({
16519
16519
  fs: fs2,
16520
16520
  dir,
16521
- gitdir = join17(dir, ".git"),
16521
+ gitdir = join19(dir, ".git"),
16522
16522
  ref = "refs/notes/commits",
16523
16523
  cache = {}
16524
16524
  }) {
@@ -16542,7 +16542,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
16542
16542
  async function listRefs({
16543
16543
  fs: fs2,
16544
16544
  dir,
16545
- gitdir = join17(dir, ".git"),
16545
+ gitdir = join19(dir, ".git"),
16546
16546
  filepath
16547
16547
  }) {
16548
16548
  try {
@@ -16567,7 +16567,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
16567
16567
  );
16568
16568
  return remotes;
16569
16569
  }
16570
- async function listRemotes({ fs: fs2, dir, gitdir = join17(dir, ".git") }) {
16570
+ async function listRemotes({ fs: fs2, dir, gitdir = join19(dir, ".git") }) {
16571
16571
  try {
16572
16572
  assertParameter("fs", fs2);
16573
16573
  assertParameter("gitdir", gitdir);
@@ -16666,7 +16666,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
16666
16666
  throw err2;
16667
16667
  }
16668
16668
  }
16669
- async function listTags({ fs: fs2, dir, gitdir = join17(dir, ".git") }) {
16669
+ async function listTags({ fs: fs2, dir, gitdir = join19(dir, ".git") }) {
16670
16670
  try {
16671
16671
  assertParameter("fs", fs2);
16672
16672
  assertParameter("gitdir", gitdir);
@@ -16719,7 +16719,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
16719
16719
  const walks = tree.entries().map(function(entry) {
16720
16720
  let result;
16721
16721
  if (entry.oid === fileId) {
16722
- result = join17(parentPath, entry.path);
16722
+ result = join19(parentPath, entry.path);
16723
16723
  filepaths.push(result);
16724
16724
  } else if (entry.type === "tree") {
16725
16725
  result = _readObject({
@@ -16736,7 +16736,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
16736
16736
  fileId,
16737
16737
  oid,
16738
16738
  filepaths,
16739
- parentPath: join17(parentPath, entry.path)
16739
+ parentPath: join19(parentPath, entry.path)
16740
16740
  });
16741
16741
  });
16742
16742
  }
@@ -16911,7 +16911,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
16911
16911
  async function log({
16912
16912
  fs: fs2,
16913
16913
  dir,
16914
- gitdir = join17(dir, ".git"),
16914
+ gitdir = join19(dir, ".git"),
16915
16915
  filepath,
16916
16916
  ref = "HEAD",
16917
16917
  depth,
@@ -16949,7 +16949,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
16949
16949
  fs: _fs,
16950
16950
  onSign,
16951
16951
  dir,
16952
- gitdir = join17(dir, ".git"),
16952
+ gitdir = join19(dir, ".git"),
16953
16953
  ours,
16954
16954
  theirs,
16955
16955
  fastForward: fastForward2 = true,
@@ -17026,7 +17026,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
17026
17026
  fs: fs2,
17027
17027
  cache,
17028
17028
  dir,
17029
- gitdir = join17(dir, ".git"),
17029
+ gitdir = join19(dir, ".git"),
17030
17030
  oids
17031
17031
  }) {
17032
17032
  const hash2 = new Hash();
@@ -17069,7 +17069,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
17069
17069
  const packfileSha = packfile.slice(-20).toString("hex");
17070
17070
  const filename = `pack-${packfileSha}.pack`;
17071
17071
  if (write) {
17072
- await fs2.write(join17(gitdir, `objects/pack/${filename}`), packfile);
17072
+ await fs2.write(join19(gitdir, `objects/pack/${filename}`), packfile);
17073
17073
  return { filename };
17074
17074
  }
17075
17075
  return {
@@ -17080,7 +17080,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
17080
17080
  async function packObjects({
17081
17081
  fs: fs2,
17082
17082
  dir,
17083
- gitdir = join17(dir, ".git"),
17083
+ gitdir = join19(dir, ".git"),
17084
17084
  oids,
17085
17085
  write = false,
17086
17086
  cache = {}
@@ -17112,7 +17112,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
17112
17112
  onAuthSuccess,
17113
17113
  onAuthFailure,
17114
17114
  dir,
17115
- gitdir = join17(dir, ".git"),
17115
+ gitdir = join19(dir, ".git"),
17116
17116
  ref,
17117
17117
  url: url3,
17118
17118
  remote,
@@ -17182,7 +17182,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
17182
17182
  fs: fs2,
17183
17183
  cache,
17184
17184
  dir,
17185
- gitdir = join17(dir, ".git"),
17185
+ gitdir = join19(dir, ".git"),
17186
17186
  start,
17187
17187
  finish
17188
17188
  }) {
@@ -17230,7 +17230,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
17230
17230
  fs: fs2,
17231
17231
  cache,
17232
17232
  dir,
17233
- gitdir = join17(dir, ".git"),
17233
+ gitdir = join19(dir, ".git"),
17234
17234
  oids
17235
17235
  }) {
17236
17236
  const visited = /* @__PURE__ */ new Set();
@@ -17533,7 +17533,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
17533
17533
  onAuthFailure,
17534
17534
  onPrePush,
17535
17535
  dir,
17536
- gitdir = join17(dir, ".git"),
17536
+ gitdir = join19(dir, ".git"),
17537
17537
  ref,
17538
17538
  remoteRef,
17539
17539
  remote = "origin",
@@ -17609,7 +17609,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
17609
17609
  async function readBlob({
17610
17610
  fs: fs2,
17611
17611
  dir,
17612
- gitdir = join17(dir, ".git"),
17612
+ gitdir = join19(dir, ".git"),
17613
17613
  oid,
17614
17614
  filepath,
17615
17615
  cache = {}
@@ -17635,7 +17635,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
17635
17635
  async function readCommit({
17636
17636
  fs: fs2,
17637
17637
  dir,
17638
- gitdir = join17(dir, ".git"),
17638
+ gitdir = join19(dir, ".git"),
17639
17639
  oid,
17640
17640
  cache = {}
17641
17641
  }) {
@@ -17676,7 +17676,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
17676
17676
  async function readNote({
17677
17677
  fs: fs2,
17678
17678
  dir,
17679
- gitdir = join17(dir, ".git"),
17679
+ gitdir = join19(dir, ".git"),
17680
17680
  ref = "refs/notes/commits",
17681
17681
  oid,
17682
17682
  cache = {}
@@ -17703,7 +17703,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
17703
17703
  async function readObject({
17704
17704
  fs: _fs,
17705
17705
  dir,
17706
- gitdir = join17(dir, ".git"),
17706
+ gitdir = join19(dir, ".git"),
17707
17707
  oid,
17708
17708
  format = "parsed",
17709
17709
  filepath = void 0,
@@ -17792,7 +17792,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
17792
17792
  async function readTag({
17793
17793
  fs: fs2,
17794
17794
  dir,
17795
- gitdir = join17(dir, ".git"),
17795
+ gitdir = join19(dir, ".git"),
17796
17796
  oid,
17797
17797
  cache = {}
17798
17798
  }) {
@@ -17816,7 +17816,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
17816
17816
  async function readTree({
17817
17817
  fs: fs2,
17818
17818
  dir,
17819
- gitdir = join17(dir, ".git"),
17819
+ gitdir = join19(dir, ".git"),
17820
17820
  oid,
17821
17821
  filepath = void 0,
17822
17822
  cache = {}
@@ -17842,7 +17842,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
17842
17842
  async function remove2({
17843
17843
  fs: _fs,
17844
17844
  dir,
17845
- gitdir = join17(dir, ".git"),
17845
+ gitdir = join19(dir, ".git"),
17846
17846
  filepath,
17847
17847
  cache = {}
17848
17848
  }) {
@@ -17915,7 +17915,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
17915
17915
  fs: _fs,
17916
17916
  onSign,
17917
17917
  dir,
17918
- gitdir = join17(dir, ".git"),
17918
+ gitdir = join19(dir, ".git"),
17919
17919
  ref = "refs/notes/commits",
17920
17920
  oid,
17921
17921
  author: _author,
@@ -18003,7 +18003,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
18003
18003
  async function renameBranch({
18004
18004
  fs: fs2,
18005
18005
  dir,
18006
- gitdir = join17(dir, ".git"),
18006
+ gitdir = join19(dir, ".git"),
18007
18007
  ref,
18008
18008
  oldref,
18009
18009
  checkout: checkout2 = false
@@ -18033,7 +18033,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
18033
18033
  async function resetIndex({
18034
18034
  fs: _fs,
18035
18035
  dir,
18036
- gitdir = join17(dir, ".git"),
18036
+ gitdir = join19(dir, ".git"),
18037
18037
  filepath,
18038
18038
  ref,
18039
18039
  cache = {}
@@ -18080,7 +18080,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
18080
18080
  gid: 0,
18081
18081
  size: 0
18082
18082
  };
18083
- const object2 = dir && await fs2.read(join17(dir, filepath));
18083
+ const object2 = dir && await fs2.read(join19(dir, filepath));
18084
18084
  if (object2) {
18085
18085
  workdirOid = await hashObject$1({
18086
18086
  gitdir: updatedGitdir,
@@ -18088,7 +18088,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
18088
18088
  object: object2
18089
18089
  });
18090
18090
  if (oid === workdirOid) {
18091
- stats = await fs2.lstat(join17(dir, filepath));
18091
+ stats = await fs2.lstat(join19(dir, filepath));
18092
18092
  }
18093
18093
  }
18094
18094
  await GitIndexManager.acquire(
@@ -18108,7 +18108,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
18108
18108
  async function resolveRef2({
18109
18109
  fs: fs2,
18110
18110
  dir,
18111
- gitdir = join17(dir, ".git"),
18111
+ gitdir = join19(dir, ".git"),
18112
18112
  ref,
18113
18113
  depth
18114
18114
  }) {
@@ -18133,7 +18133,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
18133
18133
  async function setConfig({
18134
18134
  fs: _fs,
18135
18135
  dir,
18136
- gitdir = join17(dir, ".git"),
18136
+ gitdir = join19(dir, ".git"),
18137
18137
  path,
18138
18138
  value,
18139
18139
  append = false
@@ -18201,7 +18201,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
18201
18201
  * @param {string} args.dir - The working directory.
18202
18202
  * @param {string}[args.gitdir=join(dir, '.git')] - [required] The [git directory](dir-vs-gitdir.md) path
18203
18203
  */
18204
- constructor({ fs: fs2, dir, gitdir = join17(dir, ".git") }) {
18204
+ constructor({ fs: fs2, dir, gitdir = join19(dir, ".git") }) {
18205
18205
  Object.assign(this, {
18206
18206
  fs: fs2,
18207
18207
  dir,
@@ -18231,7 +18231,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
18231
18231
  * @returns {string} - The file path for the stash reference.
18232
18232
  */
18233
18233
  get refStashPath() {
18234
- return join17(this.gitdir, _GitStashManager.refStash);
18234
+ return join19(this.gitdir, _GitStashManager.refStash);
18235
18235
  }
18236
18236
  /**
18237
18237
  * Gets the file path for the stash reflogs.
@@ -18239,7 +18239,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
18239
18239
  * @returns {string} - The file path for the stash reflogs.
18240
18240
  */
18241
18241
  get refLogsStashPath() {
18242
- return join17(this.gitdir, _GitStashManager.refLogsStash);
18242
+ return join19(this.gitdir, _GitStashManager.refLogsStash);
18243
18243
  }
18244
18244
  /**
18245
18245
  * Retrieves the author information for the stash.
@@ -18545,7 +18545,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
18545
18545
  async function stash({
18546
18546
  fs: fs2,
18547
18547
  dir,
18548
- gitdir = join17(dir, ".git"),
18548
+ gitdir = join19(dir, ".git"),
18549
18549
  op = "push",
18550
18550
  message = "",
18551
18551
  refIdx = 0
@@ -18568,7 +18568,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
18568
18568
  const _fs = new FileSystem(fs2);
18569
18569
  const updatedGitdir = await discoverGitdir({ fsp: _fs, dotgit: gitdir });
18570
18570
  const folders = ["refs", "logs", "logs/refs"];
18571
- folders.map((f) => join17(updatedGitdir, f)).forEach(async (folder) => {
18571
+ folders.map((f) => join19(updatedGitdir, f)).forEach(async (folder) => {
18572
18572
  if (!await _fs.exists(folder)) {
18573
18573
  await _fs.mkdir(folder);
18574
18574
  }
@@ -18598,7 +18598,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
18598
18598
  async function status({
18599
18599
  fs: _fs,
18600
18600
  dir,
18601
- gitdir = join17(dir, ".git"),
18601
+ gitdir = join19(dir, ".git"),
18602
18602
  filepath,
18603
18603
  cache = {},
18604
18604
  refresh: refresh2 = true
@@ -18637,7 +18637,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
18637
18637
  return "ignored";
18638
18638
  }
18639
18639
  }
18640
- const stats = await fs2.lstat(join17(dir, filepath));
18640
+ const stats = await fs2.lstat(join19(dir, filepath));
18641
18641
  const H = treeOid !== null;
18642
18642
  const I = indexEntry !== null;
18643
18643
  const W = stats !== null;
@@ -18647,7 +18647,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
18647
18647
  } else {
18648
18648
  const config2 = await GitConfigManager.get({ fs: fs2, gitdir: updatedGitdir });
18649
18649
  const autocrlf = await config2.get("core.autocrlf");
18650
- const object2 = await fs2.read(join17(dir, filepath), { autocrlf });
18650
+ const object2 = await fs2.read(join19(dir, filepath), { autocrlf });
18651
18651
  const workdirOid = await hashObject$1({
18652
18652
  gitdir: updatedGitdir,
18653
18653
  type: "blob",
@@ -18696,9 +18696,9 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
18696
18696
  }
18697
18697
  async function getOidAtPath({ fs: fs2, cache, gitdir: updatedGitdir, tree, path }) {
18698
18698
  if (typeof path === "string") path = path.split("/");
18699
- const dirname15 = path.shift();
18699
+ const dirname16 = path.shift();
18700
18700
  for (const entry of tree) {
18701
- if (entry.path === dirname15) {
18701
+ if (entry.path === dirname16) {
18702
18702
  if (path.length === 0) {
18703
18703
  return entry.oid;
18704
18704
  }
@@ -18738,7 +18738,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
18738
18738
  async function statusMatrix({
18739
18739
  fs: _fs,
18740
18740
  dir,
18741
- gitdir = join17(dir, ".git"),
18741
+ gitdir = join19(dir, ".git"),
18742
18742
  ref = "HEAD",
18743
18743
  filepaths = ["."],
18744
18744
  filter,
@@ -18811,7 +18811,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
18811
18811
  async function tag({
18812
18812
  fs: _fs,
18813
18813
  dir,
18814
- gitdir = join17(dir, ".git"),
18814
+ gitdir = join19(dir, ".git"),
18815
18815
  ref,
18816
18816
  object: object2,
18817
18817
  force = false
@@ -18843,7 +18843,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
18843
18843
  async function updateIndex$1({
18844
18844
  fs: _fs,
18845
18845
  dir,
18846
- gitdir = join17(dir, ".git"),
18846
+ gitdir = join19(dir, ".git"),
18847
18847
  cache = {},
18848
18848
  filepath,
18849
18849
  oid,
@@ -18863,7 +18863,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
18863
18863
  { fs: fs2, gitdir: updatedGitdir, cache },
18864
18864
  async function(index3) {
18865
18865
  if (!force) {
18866
- const fileStats2 = await fs2.lstat(join17(dir, filepath));
18866
+ const fileStats2 = await fs2.lstat(join19(dir, filepath));
18867
18867
  if (fileStats2) {
18868
18868
  if (fileStats2.isDirectory()) {
18869
18869
  throw new InvalidFilepathError("directory");
@@ -18881,7 +18881,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
18881
18881
  }
18882
18882
  let fileStats;
18883
18883
  if (!oid) {
18884
- fileStats = await fs2.lstat(join17(dir, filepath));
18884
+ fileStats = await fs2.lstat(join19(dir, filepath));
18885
18885
  if (!fileStats) {
18886
18886
  throw new NotFoundError(
18887
18887
  `file at "${filepath}" on disk and "remove" not set`
@@ -18902,7 +18902,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
18902
18902
  let stats;
18903
18903
  if (!oid) {
18904
18904
  stats = fileStats;
18905
- const object2 = stats.isSymbolicLink() ? await fs2.readlink(join17(dir, filepath)) : await fs2.read(join17(dir, filepath));
18905
+ const object2 = stats.isSymbolicLink() ? await fs2.readlink(join19(dir, filepath)) : await fs2.read(join19(dir, filepath));
18906
18906
  oid = await _writeObject({
18907
18907
  fs: fs2,
18908
18908
  gitdir: updatedGitdir,
@@ -18946,7 +18946,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
18946
18946
  async function walk({
18947
18947
  fs: fs2,
18948
18948
  dir,
18949
- gitdir = join17(dir, ".git"),
18949
+ gitdir = join19(dir, ".git"),
18950
18950
  trees,
18951
18951
  map: map2,
18952
18952
  reduce,
@@ -18974,7 +18974,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
18974
18974
  throw err2;
18975
18975
  }
18976
18976
  }
18977
- async function writeBlob({ fs: fs2, dir, gitdir = join17(dir, ".git"), blob: blob2 }) {
18977
+ async function writeBlob({ fs: fs2, dir, gitdir = join19(dir, ".git"), blob: blob2 }) {
18978
18978
  try {
18979
18979
  assertParameter("fs", fs2);
18980
18980
  assertParameter("gitdir", gitdir);
@@ -18996,7 +18996,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
18996
18996
  async function writeCommit({
18997
18997
  fs: fs2,
18998
18998
  dir,
18999
- gitdir = join17(dir, ".git"),
18999
+ gitdir = join19(dir, ".git"),
19000
19000
  commit: commit2
19001
19001
  }) {
19002
19002
  try {
@@ -19018,7 +19018,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
19018
19018
  async function writeObject({
19019
19019
  fs: _fs,
19020
19020
  dir,
19021
- gitdir = join17(dir, ".git"),
19021
+ gitdir = join19(dir, ".git"),
19022
19022
  type,
19023
19023
  object: object2,
19024
19024
  format = "parsed",
@@ -19064,7 +19064,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
19064
19064
  async function writeRef({
19065
19065
  fs: _fs,
19066
19066
  dir,
19067
- gitdir = join17(dir, ".git"),
19067
+ gitdir = join19(dir, ".git"),
19068
19068
  ref,
19069
19069
  value,
19070
19070
  force = false,
@@ -19119,7 +19119,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
19119
19119
  });
19120
19120
  return oid;
19121
19121
  }
19122
- async function writeTag({ fs: fs2, dir, gitdir = join17(dir, ".git"), tag: tag2 }) {
19122
+ async function writeTag({ fs: fs2, dir, gitdir = join19(dir, ".git"), tag: tag2 }) {
19123
19123
  try {
19124
19124
  assertParameter("fs", fs2);
19125
19125
  assertParameter("gitdir", gitdir);
@@ -19136,7 +19136,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
19136
19136
  throw err2;
19137
19137
  }
19138
19138
  }
19139
- async function writeTree2({ fs: fs2, dir, gitdir = join17(dir, ".git"), tree }) {
19139
+ async function writeTree2({ fs: fs2, dir, gitdir = join19(dir, ".git"), tree }) {
19140
19140
  try {
19141
19141
  assertParameter("fs", fs2);
19142
19142
  assertParameter("gitdir", gitdir);
@@ -19761,7 +19761,7 @@ var require_ignore2 = __commonJS({
19761
19761
  // cli/package.json
19762
19762
  var package_default = {
19763
19763
  name: "@docyrus/animaguru",
19764
- version: "0.18.0",
19764
+ version: "0.19.0",
19765
19765
  description: "Agent-friendly AnimaGuru CLI built with CrustJS",
19766
19766
  type: "module",
19767
19767
  bin: {
@@ -24295,8 +24295,8 @@ var version = defineExtension(VERSION).factory((extension, value, options = {})
24295
24295
 
24296
24296
  // cli/src/commands.ts
24297
24297
  import { spawn as spawn3 } from "node:child_process";
24298
- import { mkdir as mkdir14, readFile as readFile17, writeFile as writeFile14 } from "node:fs/promises";
24299
- import { dirname as dirname13, resolve as resolve15 } from "node:path";
24298
+ import { mkdir as mkdir15, readFile as readFile18, writeFile as writeFile16 } from "node:fs/promises";
24299
+ import { dirname as dirname14, resolve as resolve16 } from "node:path";
24300
24300
  import { setTimeout as delay6 } from "node:timers/promises";
24301
24301
 
24302
24302
  // node_modules/fflate/esm/index.mjs
@@ -30496,7 +30496,7 @@ var recursive = /* @__PURE__ */ new WeakMap();
30496
30496
  var NONE = 0;
30497
30497
  var ASSUMED = 1;
30498
30498
  var PROVEN = 2;
30499
- function isRecursive(inst, stack, resolve16) {
30499
+ function isRecursive(inst, stack, resolve17) {
30500
30500
  const cached2 = recursive.get(inst);
30501
30501
  if (cached2 !== void 0)
30502
30502
  return cached2 ? PROVEN : NONE;
@@ -30506,7 +30506,7 @@ function isRecursive(inst, stack, resolve16) {
30506
30506
  let result = NONE;
30507
30507
  const check2 = (child) => {
30508
30508
  if (result !== PROVEN && child?._zod) {
30509
- const answer = isRecursive(child, stack, resolve16);
30509
+ const answer = isRecursive(child, stack, resolve17);
30510
30510
  if (answer > result)
30511
30511
  result = answer;
30512
30512
  }
@@ -30517,7 +30517,7 @@ function isRecursive(inst, stack, resolve16) {
30517
30517
  const desc = Object.getOwnPropertyDescriptor(sh, key);
30518
30518
  if (spread && !desc.enumerable)
30519
30519
  continue;
30520
- const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve16) : NONE;
30520
+ const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve17) : NONE;
30521
30521
  if (child > answer)
30522
30522
  answer = child;
30523
30523
  }
@@ -30581,7 +30581,7 @@ function isRecursive(inst, stack, resolve16) {
30581
30581
  break;
30582
30582
  // `$ZodLazy` caches its inner on the def, so a resolved edge is followed exactly
30583
30583
  case "lazy": {
30584
- const inner = def._cachedInner ?? (resolve16 ? inst._zod.innerType : void 0);
30584
+ const inner = def._cachedInner ?? (resolve17 ? inst._zod.innerType : void 0);
30585
30585
  merge2(inner ? isRecursive(inner, stack, false) : ASSUMED);
30586
30586
  break;
30587
30587
  }
@@ -46333,8 +46333,8 @@ async function createWorkspace(options, installer = installDependencies) {
46333
46333
  };
46334
46334
  }
46335
46335
  async function findWorkspace(start = process.cwd()) {
46336
- const { realpath: realpath2 } = await import("node:fs/promises");
46337
- let directory = await realpath2(resolve5(start));
46336
+ const { realpath } = await import("node:fs/promises");
46337
+ let directory = await realpath(resolve5(start));
46338
46338
  while (true) {
46339
46339
  try {
46340
46340
  const info = JSON.parse(await readFile4(join6(directory, "animaguru.workspace.json"), "utf8"));
@@ -46678,6 +46678,7 @@ import { createHash as createHash4 } from "node:crypto";
46678
46678
  // shared/videos.ts
46679
46679
  var VIDEO_PART_BYTES = 8 * 1024 * 1024;
46680
46680
  var VIDEO_MAX_BYTES = { html5: 64 * 1024 * 1024, mp4: 512 * 1024 * 1024 };
46681
+ var VIDEO_LIBRARY_BYTES = { user: 2 * 1024 ** 3, team: 10 * 1024 ** 3 };
46681
46682
  var VIDEO_VISIBILITIES = ["private", "public"];
46682
46683
  var VIDEO_SHARING_AGREEMENT_VERSION = "2026-10-15-draft-2";
46683
46684
  var videoAgreementAcceptance = external_exports.object({
@@ -46904,7 +46905,7 @@ async function localProject(directory, selected) {
46904
46905
  // cli/src/cloud-sync.ts
46905
46906
  var import_isomorphic_git = __toESM(require_isomorphic_git(), 1);
46906
46907
  import * as fs from "node:fs";
46907
- import { chmod as chmod3, lstat, mkdir as mkdir7, open as open3, readFile as readFile7, readdir as readdir4, realpath, rename as rename4, rm as rm2, stat as stat2, writeFile as writeFile7 } from "node:fs/promises";
46908
+ import { chmod as chmod3, lstat, mkdir as mkdir7, open as open3, readFile as readFile7, readdir as readdir4, rename as rename4, rm as rm2, stat as stat2, writeFile as writeFile7 } from "node:fs/promises";
46908
46909
  import { createHash as createHash3, randomUUID as randomUUID2 } from "node:crypto";
46909
46910
  import { dirname as dirname6, join as join8, resolve as resolve8 } from "node:path";
46910
46911
  import { Readable } from "node:stream";
@@ -47388,15 +47389,6 @@ async function uploadObjects(context, files, absolute) {
47388
47389
  }
47389
47390
  return missing.size;
47390
47391
  }
47391
- async function stageCloudVideo(options) {
47392
- const context = await openContext(options.dir, options);
47393
- const root = await realpath(context.root);
47394
- const file2 = await realpath(options.file);
47395
- if (!file2.startsWith(root + "/") || !file2.endsWith(".mp4") || options.size > CLOUD_OBJECT_MAX_BYTES || !/^[a-f0-9]{64}$/.test(options.sha256)) throw new Error("Choose a cloud workspace MP4 up to 4 GiB.");
47396
- const info = await stat2(file2);
47397
- if (!info.isFile() || info.size !== options.size) throw new Error("The MP4 changed before staging.");
47398
- await uploadObjects(context, /* @__PURE__ */ new Map([[file2.slice(root.length + 1), { oid: "0".repeat(40), mode: "100644", size: options.size, mtimeMs: info.mtimeMs, sha256: options.sha256 }]]), () => file2);
47399
- }
47400
47392
  async function retry(context, run) {
47401
47393
  for (let attempt = 0; ; attempt++) {
47402
47394
  try {
@@ -47666,6 +47658,11 @@ async function restoreCloud(options) {
47666
47658
 
47667
47659
  // cli/src/videos.ts
47668
47660
  var subtitlesBody = (content) => new Blob([new Uint8Array(content)], { type: "text/plain; charset=utf-8" });
47661
+ function libraryWorkspace(value) {
47662
+ if (value === "personal" || value === "me") return "me";
47663
+ if (!/^team_[a-f0-9]{32}$/.test(value)) throw new Error("Pass --workspace personal or a team ID from animaguru workspaces list.");
47664
+ return value;
47665
+ }
47669
47666
  function sharingEmails(value) {
47670
47667
  return value ? value.split(",").map((email3) => email3.trim()).filter(Boolean) : [];
47671
47668
  }
@@ -47703,6 +47700,7 @@ async function exportHtml(root, animation, signal, log) {
47703
47700
  }
47704
47701
  async function submitVideo(client, options) {
47705
47702
  if (!options.yes && !options["dry-run"]) throw new Error("Pass --yes to authorize uploading and sharing this animation, or --dry-run to inspect the submission.");
47703
+ const workspace3 = options.workspace === void 0 ? void 0 : libraryWorkspace(options.workspace);
47706
47704
  const root = resolve9(options.directory ?? ".");
47707
47705
  const context = await localProject(root, options.animation);
47708
47706
  const file2 = options.file ? resolve9(root, options.file) : await exportHtml(context.toolsRoot, context.animation, options.signal, options.log);
@@ -47736,7 +47734,7 @@ async function submitVideo(client, options) {
47736
47734
  metadata = { ...metadata, ...receipt.title ? { title: receipt.title } : {}, ...probe };
47737
47735
  }
47738
47736
  const link2 = await cloudLink(context.toolsRoot).catch(() => null);
47739
- const home = link2?.origin === client.origin ? { project: link2.projectId, ...context.animation ? { animation: context.animation } : {} } : { workspace: await selectedWorkspace(client.origin) };
47737
+ const home = link2?.origin === client.origin ? { project: link2.projectId, ...context.animation ? { animation: context.animation } : {}, ...workspace3 ? { workspace: workspace3 } : {} } : { workspace: workspace3 ?? await selectedWorkspace(client.origin) };
47740
47738
  const body = videoSubmission.parse({
47741
47739
  ...home,
47742
47740
  title: options.title ?? metadata.title ?? basename4(file2).replace(/\.(zip|mp4)$/i, ""),
@@ -48299,12 +48297,8 @@ import { readFile as readFile12, stat as stat6 } from "node:fs/promises";
48299
48297
  import { chmod as chmod4, lstat as lstat2, mkdir as mkdir9, open as open5, readFile as readFile11, readdir as readdir5, rename as rename5, unlink, writeFile as writeFile9 } from "node:fs/promises";
48300
48298
  import { dirname as dirname8, join as join11 } from "node:path";
48301
48299
  import { randomUUID as randomUUID3 } from "node:crypto";
48302
- function cloudYouTube() {
48303
- const project = process.env.ANIMAGURU_CLOUD_PROJECT;
48304
- const workspace3 = process.env.ANIMAGURU_CLOUD_WORKSPACE;
48305
- if (!project || !workspace3) return null;
48306
- if (!/^prj_[A-Za-z0-9]{8,40}$/.test(project) || !/^aw_[a-f0-9]{32}$/.test(workspace3)) throw new Error("Invalid Animator context.");
48307
- return { client: new Client(process.env.ANIMAGURU_URL ?? "https://animaguru.com"), path: `/api/v1/cloud/${project}/animator/${workspace3}/youtube` };
48300
+ function refuseInAnimator() {
48301
+ if (process.env.ANIMAGURU_CLOUD_WORKSPACE) throw new Error("YouTube uploads are not available in the cloud Animator. The user exports the MP4 from the draft page in their browser, then uploads it under Publishing \u2192 YouTube.");
48308
48302
  }
48309
48303
  var youtubeMetadata = external_exports.object({
48310
48304
  title: external_exports.string().trim().min(1).max(100).refine((value) => !/[<>]/.test(value)),
@@ -48407,34 +48401,18 @@ async function writePrivate(file2, value) {
48407
48401
  }
48408
48402
  }
48409
48403
  async function readYouTubeCredentials() {
48410
- const cloud = cloudYouTube();
48411
- if (cloud) {
48412
- const result = await cloud.client.request(`${cloud.path}/credentials`);
48413
- return result.credentials === null ? null : youtubeCredentials.parse(result.credentials);
48414
- }
48415
48404
  const value = await readPrivate(credentialFile());
48416
48405
  if (value === null) return null;
48417
48406
  const parsed = youtubeCredentials.safeParse(value);
48418
48407
  if (!parsed.success) throw new Error("Invalid saved YouTube credentials. Run youtube auth logout, then login again.");
48419
48408
  return parsed.data;
48420
48409
  }
48421
- var saveYouTubeCredentials = (value) => cloudYouTube() ? Promise.resolve() : writePrivate(credentialFile(), youtubeCredentials.parse(value));
48410
+ var saveYouTubeCredentials = (value) => writePrivate(credentialFile(), youtubeCredentials.parse(value));
48422
48411
  async function saveYouTubeJob(value) {
48423
48412
  const job = youtubeJob.parse(value);
48424
- const cloud = cloudYouTube();
48425
- if (cloud) {
48426
- await cloud.client.request(`${cloud.path}/uploads/${job.id}`, { method: "PUT", body: job });
48427
- return;
48428
- }
48429
48413
  await writePrivate(jobFile(job.id), job);
48430
48414
  }
48431
48415
  async function readYouTubeJob(id2) {
48432
- const cloud = cloudYouTube();
48433
- if (cloud) {
48434
- const job = (await localYouTubeJobs()).find((job2) => job2.id === id2);
48435
- if (!job) throw new Error("Cloud YouTube upload not found.");
48436
- return job;
48437
- }
48438
48416
  const parsed = youtubeJob.safeParse(await readPrivate(jobFile(id2)));
48439
48417
  if (!parsed.success || parsed.data.id !== id2) throw new Error("Upload not found or local upload state is invalid.");
48440
48418
  return parsed.data;
@@ -48443,11 +48421,6 @@ function youtubeJobSummary(job) {
48443
48421
  return { id: job.id, file: job.file, title: job.metadata.title, channelId: job.channelId, status: job.status, bytes: job.bytes, bytesUploaded: job.bytesUploaded, privacy: job.privacy, youtubeId: job.youtubeId, url: job.youtubeId ? `https://www.youtube.com/watch?v=${job.youtubeId}` : null, createdAt: job.createdAt, captions: job.captions ? { file: job.captions.file, language: job.captions.language, name: job.captions.name, status: job.captions.status } : null, thumbnail: job.thumbnail ? { file: job.thumbnail.file, status: job.thumbnail.status } : null };
48444
48422
  }
48445
48423
  async function localYouTubeJobs() {
48446
- const cloud = cloudYouTube();
48447
- if (cloud) {
48448
- const result = await cloud.client.request(`${cloud.path}/uploads`);
48449
- return result.jobs.map((job) => youtubeJob.parse(job));
48450
- }
48451
48424
  const directory = join11(youtubeDirectory(), "uploads");
48452
48425
  if (!await existingDirectory(directory)) return [];
48453
48426
  let files;
@@ -48480,6 +48453,7 @@ async function clearYouTubeData() {
48480
48453
  for (const file2 of files.filter((name2) => name2.endsWith(".json") && external_exports.uuid().safeParse(name2.slice(0, -5)).success)) await unlink(jobFile(file2.slice(0, -5)));
48481
48454
  }
48482
48455
  async function withYouTubeLock(operation) {
48456
+ refuseInAnimator();
48483
48457
  await privateDirectory(youtubeDirectory());
48484
48458
  const file2 = join11(youtubeDirectory(), "operation.lock");
48485
48459
  const lock = await open5(file2, "wx", 384).catch((error62) => {
@@ -48534,7 +48508,6 @@ async function googleJson(response) {
48534
48508
  }
48535
48509
  async function providerError(response) {
48536
48510
  const body = await googleJson(response);
48537
- if (cloudYouTube() && typeof body.error?.message === "string") return new YouTubeError(String(body.error.message).slice(0, 512));
48538
48511
  const error62 = body.error;
48539
48512
  const raw = typeof error62 === "object" ? error62?.errors?.[0]?.reason : error62;
48540
48513
  const reason = typeof raw === "string" && /^[A-Za-z_]{1,64}$/.test(raw) ? raw : void 0;
@@ -48567,7 +48540,6 @@ async function tokenRequest(client, params, signal) {
48567
48540
  return googleJson(response);
48568
48541
  }
48569
48542
  async function accessToken(credentials, signal, force = false) {
48570
- if (cloudYouTube()) return "provided-by-worker";
48571
48543
  if (!force && credentials.expiresAt > Date.now() + 6e4) return credentials.accessToken;
48572
48544
  const body = await tokenRequest(credentials, { grant_type: "refresh_token", refresh_token: credentials.refreshToken }, signal);
48573
48545
  const scopes = typeof body.scope === "string" ? body.scope.split(" ") : null;
@@ -48621,7 +48593,7 @@ async function revoke(token3, signal) {
48621
48593
  }
48622
48594
  }
48623
48595
  async function youtubeLogin(options) {
48624
- if (cloudYouTube()) throw new Error("Connect YouTube on the Animator draft page. OAuth credentials stay in the Worker.");
48596
+ refuseInAnimator();
48625
48597
  if (!options.yes) throw new Error("Pass --yes to accept YouTube's Terms of Service and authorize saving YouTube credentials locally. Review https://www.youtube.com/t/terms and https://policies.google.com/privacy first.");
48626
48598
  const seconds2 = options.timeout ?? 300;
48627
48599
  if (!Number.isFinite(seconds2) || seconds2 < 1 || seconds2 > 600) throw new Error("Use an authorization timeout between 1 and 600 seconds.");
@@ -48645,8 +48617,8 @@ async function youtubeLogin(options) {
48645
48617
  let receive;
48646
48618
  let fail;
48647
48619
  let used = false;
48648
- const callback = new Promise((resolve16, reject) => {
48649
- receive = resolve16;
48620
+ const callback = new Promise((resolve17, reject) => {
48621
+ receive = resolve17;
48650
48622
  fail = reject;
48651
48623
  });
48652
48624
  void callback.catch(() => {
@@ -48684,9 +48656,9 @@ async function youtubeLogin(options) {
48684
48656
  response.end("Authorization received. Return to your AnimaGuru terminal.");
48685
48657
  receive(code);
48686
48658
  });
48687
- await new Promise((resolve16, reject) => {
48659
+ await new Promise((resolve17, reject) => {
48688
48660
  server.once("error", reject);
48689
- server.listen(0, "127.0.0.1", resolve16);
48661
+ server.listen(0, "127.0.0.1", resolve17);
48690
48662
  });
48691
48663
  const address = server.address();
48692
48664
  if (!address || typeof address === "string") throw new Error("Cannot open the local YouTube authorization listener.");
@@ -48721,7 +48693,7 @@ async function youtubeLogin(options) {
48721
48693
  clearTimeout(timer);
48722
48694
  options.signal?.removeEventListener("abort", abort);
48723
48695
  server.closeAllConnections();
48724
- await new Promise((resolve16) => server.close(() => resolve16()));
48696
+ await new Promise((resolve17) => server.close(() => resolve17()));
48725
48697
  }
48726
48698
  });
48727
48699
  }
@@ -48733,7 +48705,7 @@ async function youtubeStatus(options = {}) {
48733
48705
  });
48734
48706
  }
48735
48707
  async function youtubeLogout(options) {
48736
- if (cloudYouTube()) throw new Error("Disconnect YouTube on the Animator draft page.");
48708
+ refuseInAnimator();
48737
48709
  if (!options.yes) throw new Error("Pass --yes to revoke YouTube authorization and remove local credentials and upload receipts.");
48738
48710
  return withYouTubeLock(async () => {
48739
48711
  let credentials = null;
@@ -49002,6 +48974,7 @@ async function transfer(credentials, job, source, options) {
49002
48974
  }
49003
48975
  }
49004
48976
  async function uploadYouTube(options) {
48977
+ refuseInAnimator();
49005
48978
  if (!options.yes && !options["dry-run"]) throw new Error("Pass --yes to authorize the YouTube upload, or --dry-run to inspect it locally.");
49006
48979
  if (!["yes", "no"].includes(options["made-for-kids"]) || !["yes", "no"].includes(options["synthetic-media"])) throw new Error("Set --made-for-kids yes|no and --synthetic-media yes|no explicitly.");
49007
48980
  const root = resolve11(options.directory ?? ".");
@@ -49042,12 +49015,8 @@ async function uploadYouTube(options) {
49042
49015
  return { ...await finishUpload(credentials, previous, options), alreadyUploaded: true };
49043
49016
  }
49044
49017
  await source.check();
49045
- if (cloudYouTube()) {
49046
- await stageCloudVideo({ dir: root, file: file2, sha256: source.sha256, size: source.bytes, signal: options.signal, log: options.log });
49047
- await source.check();
49048
- }
49049
49018
  options.log?.(`Uploading ${file2} to ${credentials.channelTitle} (${credentials.channelId}) with ${metadata.privacy} visibility${pending ? `, then adding ${pending.language} captions from ${pending.file}` : ""}${thumbnail ? `${pending ? " and" : ", then setting"} the thumbnail ${thumbnail.file}` : ""}. You confirm you have the rights to upload this video. YouTube terms: https://www.youtube.com/t/terms`);
49050
- const response = await youtubeRequest(credentials, "https://www.googleapis.com/upload/youtube/v3/videos?uploadType=resumable&part=snippet,status&notifySubscribers=false", { method: "POST", headers: { "Content-Type": "application/json; charset=UTF-8", "X-Upload-Content-Length": String(source.bytes), "X-Upload-Content-Type": "video/mp4", ...cloudYouTube() ? { "X-AnimaGuru-Source-SHA256": source.sha256, "X-AnimaGuru-Upload-Plan": JSON.stringify({ captions: pending && { sha256: pending.sha256, language: pending.language, name: pending.name }, thumbnail: thumbnail && { sha256: thumbnail.sha256 } }) } : {} }, body: JSON.stringify({ snippet: { title: metadata.title, description: metadata.description, categoryId: "22" }, status: { privacyStatus: metadata.privacy, selfDeclaredMadeForKids: metadata.madeForKids, containsSyntheticMedia: metadata.syntheticMedia } }) }, options.signal);
49019
+ const response = await youtubeRequest(credentials, "https://www.googleapis.com/upload/youtube/v3/videos?uploadType=resumable&part=snippet,status&notifySubscribers=false", { method: "POST", headers: { "Content-Type": "application/json; charset=UTF-8", "X-Upload-Content-Length": String(source.bytes), "X-Upload-Content-Type": "video/mp4" }, body: JSON.stringify({ snippet: { title: metadata.title, description: metadata.description, categoryId: "22" }, status: { privacyStatus: metadata.privacy, selfDeclaredMadeForKids: metadata.madeForKids, containsSyntheticMedia: metadata.syntheticMedia } }) }, options.signal);
49051
49020
  const location = response.headers.get("Location");
49052
49021
  await response.body?.cancel();
49053
49022
  if (!location) throw new YouTubeError("Google did not return an upload session. No video bytes were sent.");
@@ -49600,6 +49569,234 @@ async function downloadBrand(client, id2, output2, flags = {}) {
49600
49569
  return { id: brand.id, name: brand.name, files: written };
49601
49570
  }
49602
49571
 
49572
+ // cli/src/review-check.ts
49573
+ import { readFile as readFile17, readdir as readdir6, stat as stat9, writeFile as writeFile14 } from "node:fs/promises";
49574
+ import { join as join17 } from "node:path";
49575
+
49576
+ // shared/frame-checks.ts
49577
+ var FRAME_CHECK_MAX_FRAMES = 12;
49578
+ var FRAME_CHECK_IMAGE_BYTES = 4 * 1024 * 1024;
49579
+ var FRAME_CHECK_TOTAL_BYTES = 8 * 1024 * 1024;
49580
+ var FRAME_CHECKS = {
49581
+ empty: { type: "noul", instructions: "Is this frame empty or nearly empty: a plain background with no readable text, product, interface or main subject?" },
49582
+ cut_off: { type: "noul", instructions: "Is any text, logo or important element cut off by the edge of the frame?" },
49583
+ overlap: { type: "noul", instructions: "Does any text overlap other text, a logo or an interface element so that it is hard to read?" },
49584
+ broken_text: { type: "noul", instructions: "Does any text show broken or missing letters, gaps inside words, wrong characters or placeholder boxes?" },
49585
+ hard_to_read: { type: "noul", instructions: "Is the main text too small, too faint or too low in contrast to read comfortably on a phone?" },
49586
+ polish: { type: "score", instructions: "How finished and professional does this frame look as a frame of an advertisement or explainer video?", criteria: ["Broken", "Unfinished or unbalanced", "Acceptable", "Polished"] }
49587
+ };
49588
+ var questionId = external_exports.string().regex(/^[A-Za-z0-9_.-]{1,60}$/, "Use letters, digits, '_', '.' or '-' in a question ID.").refine((id2) => !(id2 in FRAME_CHECKS), "Built-in checks are always asked; give your question another ID.");
49589
+ var instructions = external_exports.string().trim().min(3).max(500);
49590
+ var frameCheckQuestion = external_exports.discriminatedUnion("type", [
49591
+ external_exports.object({ type: external_exports.literal("noul"), instructions }).strict(),
49592
+ external_exports.object({ type: external_exports.literal("choice"), instructions, criteria: external_exports.record(external_exports.string().regex(/^[A-Za-z0-9_.-]{1,40}$/), external_exports.string().trim().min(1).max(200)).refine((options) => Object.keys(options).length >= 2 && Object.keys(options).length <= 12, "A choice needs 2\u201312 options.") }).strict(),
49593
+ external_exports.object({ type: external_exports.literal("score"), instructions, criteria: external_exports.array(external_exports.string().trim().min(1).max(200)).min(2).max(10) }).strict()
49594
+ ]);
49595
+ var frameCheckQuestions = external_exports.record(questionId, frameCheckQuestion).refine((questions) => Object.keys(questions).length <= 16, "Ask at most 16 questions of your own.");
49596
+ function dataUrlBytes(image) {
49597
+ const data = image.slice(image.indexOf(",") + 1);
49598
+ return Math.floor(data.length * 3 / 4) - (data.endsWith("==") ? 2 : data.endsWith("=") ? 1 : 0);
49599
+ }
49600
+ var frameImage = external_exports.string().regex(/^data:image\/(?:jpeg|png|webp);base64,[A-Za-z0-9+/]+={0,2}$/, "Send each frame as a base64 JPEG, PNG or WebP data URL.").refine((image) => dataUrlBytes(image) <= FRAME_CHECK_IMAGE_BYTES, "Each frame can be up to 4 MiB.");
49601
+ var frameCheckFrame = external_exports.object({ time: external_exports.number().min(0).max(3600), image: frameImage }).strict();
49602
+ var frameCheckRequest = external_exports.object({
49603
+ /** 'me' or a team ID; a project's or Animator draft's own workspace takes precedence. */
49604
+ workspace: external_exports.string().max(80).optional(),
49605
+ projectId: external_exports.string().regex(/^prj_[A-Za-z0-9]+$/).optional(),
49606
+ /** What the film is: its title, format, audience, brief. Each frame is judged with it. */
49607
+ context: external_exports.string().max(2e3).default(""),
49608
+ duration: external_exports.number().positive().max(3600).optional(),
49609
+ frames: external_exports.array(frameCheckFrame).min(1).max(FRAME_CHECK_MAX_FRAMES),
49610
+ questions: frameCheckQuestions.optional(),
49611
+ /** Validate and return the most the check can cost, without running it. */
49612
+ dryRun: external_exports.boolean().optional()
49613
+ }).strict().refine((input2) => input2.frames.reduce((sum, frame) => sum + dataUrlBytes(frame.image), 0) <= FRAME_CHECK_TOTAL_BYTES, "A check's frames can total up to 8 MiB; send fewer or smaller frames.");
49614
+
49615
+ // cli/src/review-check.ts
49616
+ async function framesToCheck(projectRoot, source, report2) {
49617
+ if (source === "frames") {
49618
+ const folder2 = join17(projectRoot, "production/review/frames");
49619
+ const names2 = await readdir6(folder2).catch(() => []);
49620
+ const frames = names2.map((name2) => /^frame-([\d.]+)s\.jpg$/.exec(name2)).filter((match) => match !== null).map((match) => ({ file: join17(folder2, match[0]), time: Number(match[1]) })).sort((a, b) => a.time - b.time);
49621
+ if (!frames.length) throw new Error("No full-size frames found. Run npm run frames -- --full (with --at TIMES for the moments to check) first.");
49622
+ return frames;
49623
+ }
49624
+ const folder = join17(projectRoot, "production/review");
49625
+ const times = [...report2.seekMatches ?? []].map((match) => match.time).sort((a, b) => a - b);
49626
+ const names = (await readdir6(folder)).filter((name2) => /^frame-\d{2}\.jpg$/.test(name2)).sort();
49627
+ if (!names.length || names.length !== times.length) throw new Error("The review frames do not match report.json. Run npm run review again.");
49628
+ return names.map((name2, index2) => ({ file: join17(folder, name2), time: times[index2] }));
49629
+ }
49630
+ function filmContext(report2, brief, extra) {
49631
+ const config2 = report2.config ?? {};
49632
+ const film = [config2.title ? `Title: ${config2.title}` : "", config2.width && config2.height ? `Format: ${config2.width}\xD7${config2.height}${config2.height > config2.width ? ", vertical for phones" : ""}` : ""].filter(Boolean).join("\n");
49633
+ const text2 = [film, extra?.trim() ?? "", brief ? `Brief:
49634
+ ${brief.trim()}` : ""].filter(Boolean).join("\n\n");
49635
+ return text2.length > 2e3 ? `${text2.slice(0, 1999)}\u2026` : text2;
49636
+ }
49637
+ function compact(answers) {
49638
+ return Object.fromEntries(Object.entries(answers).map(([id2, answer]) => [id2, typeof answer === "number" ? answer : "score" in answer ? answer.score : answer.choice]));
49639
+ }
49640
+ async function reviewCheck(client, options) {
49641
+ if (!options.yes && !options["dry-run"]) throw new Error("Pass --yes to authorize spending credits on the check, or --dry-run for its most.");
49642
+ const context = await localProject(options.directory, options.animation);
49643
+ const reportFile = join17(context.projectRoot, "production/review/report.json");
49644
+ const report2 = JSON.parse(await readFile17(reportFile, "utf8").catch(() => {
49645
+ throw new Error("Run npm run review first: production/review/report.json is missing.");
49646
+ }));
49647
+ const frames = await framesToCheck(context.projectRoot, options.source ?? "review", report2);
49648
+ if (frames.length > FRAME_CHECK_MAX_FRAMES) throw new Error(`Check at most ${FRAME_CHECK_MAX_FRAMES} frames at once; run npm run frames -- --full --at with fewer times.`);
49649
+ const sizes = await Promise.all(frames.map(async (frame) => (await stat9(frame.file)).size));
49650
+ if (sizes.reduce((sum, size) => sum + size, 0) > FRAME_CHECK_TOTAL_BYTES) throw new Error("These frames total over 8 MiB. Check fewer at once.");
49651
+ const questions = options.questions ? frameCheckQuestions.parse(JSON.parse(await readFile17(options.questions, "utf8"))) : void 0;
49652
+ const brief = await readFile17(join17(context.projectRoot, "production/brief.md"), "utf8").catch(() => "");
49653
+ const link2 = await cloudLink(context.toolsRoot).catch(() => null);
49654
+ const body = {
49655
+ ...link2?.origin === client.origin ? { projectId: link2.projectId } : { workspace: await selectedWorkspace(client.origin) },
49656
+ context: filmContext(report2, brief, options.context),
49657
+ ...report2.config?.duration ? { duration: report2.config.duration } : {},
49658
+ frames: await Promise.all(frames.map(async (frame) => ({ time: Math.round(frame.time * 1e3) / 1e3, image: `data:image/jpeg;base64,${(await readFile17(frame.file)).toString("base64")}` }))),
49659
+ ...questions ? { questions } : {},
49660
+ ...options["dry-run"] ? { dryRun: true } : {}
49661
+ };
49662
+ if (options["dry-run"]) return client.request("/api/v1/frame-checks", { method: "POST", body, timeout: 12e4 });
49663
+ const result = await client.request("/api/v1/frame-checks", { method: "POST", body, timeout: 12e4 });
49664
+ const fileAt = (time3) => frames.find((frame) => Math.abs(frame.time - time3) < 1e-3)?.file.slice(context.projectRoot.length + 1);
49665
+ const saved = join17(context.projectRoot, "production/review/check.json");
49666
+ await writeFile14(saved, `${JSON.stringify({ ...result, frames: result.frames.map((frame) => ({ file: fileAt(frame.time), ...frame })) }, null, 2)}
49667
+ `);
49668
+ return {
49669
+ flagged: result.flagged.map((flag) => ({ file: fileAt(flag.time), ...flag })),
49670
+ frames: result.frames.map((frame) => "error" in frame ? { file: fileAt(frame.time), ...frame } : { file: fileAt(frame.time), time: frame.time, flags: frame.flags, answers: compact(frame.answers) }),
49671
+ credits: result.credits,
49672
+ saved: saved.slice(context.projectRoot.length + 1),
49673
+ note: result.flagged.length ? "Open the flagged frames first; the check estimates probabilities and does not replace watching the film." : "No check flagged a frame. It estimates probabilities: still watch the film before calling it finished."
49674
+ };
49675
+ }
49676
+
49677
+ // cli/src/reference.ts
49678
+ import { openAsBlob } from "node:fs";
49679
+ import { mkdir as mkdir14, stat as stat10, writeFile as writeFile15 } from "node:fs/promises";
49680
+ import { basename as basename7, dirname as dirname13, extname as extname3, join as join18, relative as relative3, resolve as resolve15 } from "node:path";
49681
+
49682
+ // shared/video-analysis.ts
49683
+ var VIDEO_ANALYSIS_MAX_BYTES = 100 * 1024 * 1024;
49684
+ var videoAnalysisEffort = external_exports.enum(["low", "medium", "xhigh"]);
49685
+ var settings = {
49686
+ workspace: external_exports.string().min(1).max(100).optional(),
49687
+ projectId: external_exports.string().regex(/^prj_[A-Za-z0-9]{1,64}$/).optional(),
49688
+ /** What the person cares about most, such as "the transitions" or "how the offer is introduced". */
49689
+ focus: external_exports.string().trim().max(2e3).optional(),
49690
+ effort: videoAnalysisEffort.default("low"),
49691
+ dryRun: external_exports.boolean().optional()
49692
+ };
49693
+ var videoAnalysisRequest = external_exports.object({ ...settings, url: external_exports.string().trim().max(2048).url().refine((url3) => url3.startsWith("https://"), "Use an HTTPS link to the video file.") }).strict();
49694
+ var videoAnalysisUpload = external_exports.object({ ...settings, name: external_exports.string().trim().min(1).max(255).optional(), dryRun: external_exports.enum(["true", "false"]).transform((value) => value === "true").optional() }).strict();
49695
+ var videoAnalysisBrief = external_exports.object({
49696
+ summary: external_exports.string().optional(),
49697
+ format: external_exports.object({ aspect_ratio: external_exports.string().optional(), duration_s: external_exports.number().optional(), pace: external_exports.string().optional() }).passthrough().optional(),
49698
+ story: external_exports.object({ structure: external_exports.string().optional(), hook: external_exports.string().optional(), message: external_exports.string().optional(), call_to_action: external_exports.string().optional() }).passthrough().optional(),
49699
+ style: external_exports.object({ look: external_exports.string().optional(), palette: external_exports.array(external_exports.string()).optional(), typography: external_exports.string().optional(), motion: external_exports.string().optional(), transitions: external_exports.string().optional() }).passthrough().optional(),
49700
+ audio: external_exports.object({ voice: external_exports.string().optional(), music: external_exports.string().optional(), effects: external_exports.string().optional(), transcript: external_exports.array(external_exports.object({ start_s: external_exports.number().optional(), end_s: external_exports.number().optional(), text: external_exports.string() }).passthrough()).optional() }).passthrough().optional(),
49701
+ scenes: external_exports.array(external_exports.object({ start_s: external_exports.number().optional(), end_s: external_exports.number().optional(), shown: external_exports.string().optional(), framing: external_exports.string().optional(), motion: external_exports.string().optional(), on_screen_text: external_exports.string().optional(), audio: external_exports.string().optional(), purpose: external_exports.string().optional() }).passthrough()),
49702
+ brand_elements: external_exports.array(external_exports.object({ element: external_exports.string(), where: external_exports.string().optional(), replace_with: external_exports.string().optional() }).passthrough()).optional(),
49703
+ remake_notes: external_exports.array(external_exports.string()).optional()
49704
+ }).passthrough();
49705
+
49706
+ // cli/src/reference.ts
49707
+ var TYPES = { ".mp4": "video/mp4", ".m4v": "video/mp4", ".mov": "video/quicktime", ".webm": "video/webm" };
49708
+ var POLL_MS = 1e4;
49709
+ var WAIT_LIMIT_MS = 70 * 6e4;
49710
+ async function briefFile(options, name2) {
49711
+ if (options.out) return resolve15(options.out);
49712
+ const slug2 = name2.replace(/\.[a-z0-9]{2,4}$/i, "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "").slice(0, 60) || "reference";
49713
+ const project = await localProject(options.directory ?? ".", options.animation).catch(() => null);
49714
+ const film = project && await stat10(join18(project.projectRoot, "animaguru.project.json")).then(() => true, () => false);
49715
+ return film ? join18(project.projectRoot, "production/references", `${slug2}.json`) : resolve15(options.directory ?? ".", `${slug2}.analysis.json`);
49716
+ }
49717
+ var pause = (ms, signal) => new Promise((done, fail) => {
49718
+ signal?.throwIfAborted();
49719
+ const stop = () => {
49720
+ clearTimeout(timer);
49721
+ fail(signal.reason);
49722
+ };
49723
+ const timer = setTimeout(() => {
49724
+ signal?.removeEventListener("abort", stop);
49725
+ done();
49726
+ }, ms);
49727
+ signal?.addEventListener("abort", stop, { once: true });
49728
+ });
49729
+ var sourceName = (analysis) => analysis.source.kind === "file" ? analysis.source.name : decodeURIComponent(new URL(analysis.source.url).pathname.split("/").filter(Boolean).at(-1) ?? "reference");
49730
+ async function finished(client, analysis, log) {
49731
+ const started = Date.now();
49732
+ let last = analysis.status;
49733
+ while (analysis.status === "processing" || analysis.status === "running") {
49734
+ if (Date.now() - started > WAIT_LIMIT_MS) throw new Error(`Analysis ${analysis.id} is still ${analysis.status}. Check it later with animaguru reference get ${analysis.id}.`);
49735
+ await pause(POLL_MS, client.signal);
49736
+ try {
49737
+ analysis = (await client.request(`/api/v1/video-analyses/${analysis.id}`, { timeout: 6e4 })).analysis;
49738
+ } catch (error62) {
49739
+ if (error62 instanceof ServiceError && error62.status < 500) throw error62;
49740
+ log?.("The connection dropped; asking again.");
49741
+ continue;
49742
+ }
49743
+ if (analysis.status !== last) {
49744
+ last = analysis.status;
49745
+ log?.(analysis.status === "running" ? "Elorian is watching the video." : `Analysis ${analysis.status}.`);
49746
+ }
49747
+ }
49748
+ return analysis;
49749
+ }
49750
+ async function report(analysis, options) {
49751
+ if (analysis.status === "failed") throw new Error(analysis.error ?? "The analysis failed.");
49752
+ if (analysis.status !== "completed") return { id: analysis.id, status: analysis.status, next: `animaguru reference get ${analysis.id} --wait` };
49753
+ const file2 = await briefFile(options, sourceName(analysis));
49754
+ await mkdir14(dirname13(file2), { recursive: true });
49755
+ await writeFile15(file2, `${JSON.stringify(analysis, null, 2)}
49756
+ `);
49757
+ const brief = analysis.result?.brief;
49758
+ return {
49759
+ id: analysis.id,
49760
+ status: analysis.status,
49761
+ credits: analysis.credits,
49762
+ video: analysis.result?.video,
49763
+ saved: relative3(process.cwd(), file2) || file2,
49764
+ ...brief ? { summary: brief.summary, format: brief.format, story: brief.story, scenes: brief.scenes.length, brandElements: brief.brand_elements?.map((item) => item.element) ?? [] } : { note: "The answer is not a JSON brief; read result.text in the saved file." },
49765
+ next: "Read the saved brief scene by scene, then plan the remake with the user's own brand kit and story: keep the reference's structure, pacing and techniques, never its brand, claims, people or footage."
49766
+ };
49767
+ }
49768
+ async function referenceAnalyze(client, options) {
49769
+ const dryRun = Boolean(options["dry-run"]);
49770
+ if (!options.yes && !dryRun) throw new Error("Pass --yes to authorize spending credits on the analysis, or --dry-run for its most.");
49771
+ const project = await localProject(options.directory ?? ".", options.animation).catch(() => null);
49772
+ const link2 = project ? await cloudLink(project.toolsRoot).catch(() => null) : null;
49773
+ const settings2 = { ...link2?.origin === client.origin ? { projectId: link2.projectId } : { workspace: await selectedWorkspace(client.origin) }, effort: options.effort ?? "low", ...options.focus ? { focus: options.focus } : {} };
49774
+ let started;
49775
+ if (/^[a-z]+:\/\//i.test(options.video)) {
49776
+ if (!options.video.startsWith("https://")) throw new Error("Use an HTTPS link to the video file.");
49777
+ started = await client.request("/api/v1/video-analyses", { method: "POST", body: { ...settings2, url: options.video, ...dryRun ? { dryRun: true } : {} }, timeout: 12e4 });
49778
+ } else {
49779
+ const file2 = resolve15(options.video);
49780
+ const info = await stat10(file2).catch(() => null);
49781
+ if (!info?.isFile()) throw new Error(`No video file at ${options.video}. Give a file path, or an HTTPS link to the video file itself.`);
49782
+ const type = TYPES[extname3(file2).toLowerCase()];
49783
+ if (!type) throw new Error("Analyse an MP4, MOV or WebM video.");
49784
+ if (info.size > VIDEO_ANALYSIS_MAX_BYTES) throw new Error("The video is over 100 MB. Trim or compress it first, for example to 720p.");
49785
+ const query = new URLSearchParams({ ...settings2, name: basename7(file2), ...dryRun ? { dryRun: "true" } : {} });
49786
+ if (!dryRun) options.log?.(`Uploading ${basename7(file2)} (${(info.size / 1024 ** 2).toFixed(1)} MB).`);
49787
+ started = await client.request(`/api/v1/video-analyses/upload?${query}`, { method: "POST", ...dryRun ? {} : { body: await openAsBlob(file2, { type }) }, timeout: 6e5 });
49788
+ }
49789
+ if (dryRun || !started.analysis) return started;
49790
+ options.log?.(`Analysis ${started.analysis.id} started. It takes several minutes.`);
49791
+ if (options.wait === false) return { id: started.analysis.id, status: started.analysis.status, next: `animaguru reference get ${started.analysis.id} --wait` };
49792
+ return report(await finished(client, started.analysis, options.log), options);
49793
+ }
49794
+ async function referenceGet(client, id2, options) {
49795
+ if (!/^va_[a-f0-9]{32}$/.test(id2)) throw new Error("Use an analysis ID returned by animaguru reference analyze.");
49796
+ const { analysis } = await client.request(`/api/v1/video-analyses/${id2}`, { timeout: 6e4 });
49797
+ return report(options.wait ? await finished(client, analysis, options.log) : analysis, options);
49798
+ }
49799
+
49603
49800
  // cli/src/commands.ts
49604
49801
  var assetModelIds = [...SPRITE_VIDEO_MODEL_IDS, ...MUSIC_MODELS.map((m) => m.id), ...SPEECH_MODELS.map((m) => m.id), ...SFX_MODELS.map((m) => m.id)];
49605
49802
  var assetAuthorizationFlags = [
@@ -49650,12 +49847,12 @@ var workspaceQuery = async (client) => {
49650
49847
  async function openBrowser(url3) {
49651
49848
  const command = process.platform === "darwin" ? "open" : process.platform === "win32" ? "rundll32" : "xdg-open";
49652
49849
  const args = process.platform === "win32" ? ["url.dll,FileProtocolHandler", url3] : [url3];
49653
- await new Promise((resolve16) => {
49850
+ await new Promise((resolve17) => {
49654
49851
  const child = spawn3(command, args, { stdio: "ignore", detached: true });
49655
- child.once("error", () => resolve16());
49852
+ child.once("error", () => resolve17());
49656
49853
  child.once("spawn", () => {
49657
49854
  child.unref();
49658
- resolve16();
49855
+ resolve17();
49659
49856
  });
49660
49857
  });
49661
49858
  }
@@ -49681,12 +49878,37 @@ function createCli() {
49681
49878
  { name: "thumbnail", type: "string", default: "auto", description: "JPEG or PNG thumbnail up to 2 MiB to set after the upload; auto uses FILM.jpg beside FILM.mp4; none skips" },
49682
49879
  { name: "yes", type: "boolean", description: "Authorize sending this video, its subtitles and thumbnail to the selected channel and privacy; confirm upload rights" },
49683
49880
  { name: "dry-run", type: "boolean", description: "Inspect MP4 and metadata locally without Google authorization or network calls" }
49684
- ).action(async ({ args, flags, stdout, stderr, signal }) => out(stdout, await uploadYouTube({ ...flags, directory: args.directory, log: stderr, signal }))))).command("uploads", (uploads) => uploads.add(defineCommand("list", { description: "List local upload receipts without tokens or session URLs" }, (command) => command.action(async ({ stdout }) => out(stdout, await listYouTubeUploads())))).add(defineCommand("resume", { description: "Resume the same local MP4 and Google upload session after an interruption" }, (command) => command.args({ name: "id", type: "string", required: true, description: "Upload ID returned by youtube uploads list" }).flags({ name: "yes", type: "boolean", description: "Authorize resuming the saved upload and visibility" }).action(async ({ args, flags, stdout, stderr, signal }) => out(stdout, await resumeYouTube(args.id, { ...flags, log: stderr, signal }))))))).add(defineCommand("init", { description: "Install or refresh the AnimaGuru agent skill in the current folder" }, (command) => command.action(async ({ stdout }) => out(stdout, await initializeSkill())))).add(defineCommand("templates", { description: "List video categories and available starter templates" }, (command) => command.action(({ stdout }) => out(stdout, listTemplates())))).command("create", (creation) => creation.args({ name: "name", type: "string", description: "Legacy standalone project folder; prefer create workspace NAME" }).action(async ({ args, stdout, stderr, signal }) => {
49881
+ ).action(async ({ args, flags, stdout, stderr, signal }) => out(stdout, await uploadYouTube({ ...flags, directory: args.directory, log: stderr, signal }))))).command("uploads", (uploads) => uploads.add(defineCommand("list", { description: "List local upload receipts without tokens or session URLs" }, (command) => command.action(async ({ stdout }) => out(stdout, await listYouTubeUploads())))).add(defineCommand("resume", { description: "Resume the same local MP4 and Google upload session after an interruption" }, (command) => command.args({ name: "id", type: "string", required: true, description: "Upload ID returned by youtube uploads list" }).flags({ name: "yes", type: "boolean", description: "Authorize resuming the saved upload and visibility" }).action(async ({ args, flags, stdout, stderr, signal }) => out(stdout, await resumeYouTube(args.id, { ...flags, log: stderr, signal }))))))).add(defineCommand("init", { description: "Install or refresh the AnimaGuru agent skill in the current folder" }, (command) => command.action(async ({ stdout }) => out(stdout, await initializeSkill())))).add(defineCommand("templates", { description: "List video categories and available starter templates" }, (command) => command.action(({ stdout }) => out(stdout, listTemplates())))).command("review", (review) => review.add(defineCommand("check", { description: "Check a film's review frames for visual faults with AnimaGuru's frame checker (Clef-omni): empty frames, cut-off or overlapping text, broken letters, hard-to-read text and a polish score. Run npm run review first; open the flagged frames first. Charges a fraction of a credit per frame" }, (command) => command.args({ name: "directory", type: "string", default: ".", description: "Video workspace or animation folder" }).flags(
49882
+ { name: "animation", type: "string", description: "Animation in a multi-animation workspace" },
49883
+ { name: "source", type: "string", choices: ["review", "frames"], default: "review", description: "review: npm run review's five frames; frames: the full-size frames of npm run frames -- --full" },
49884
+ { name: "context", type: "string", description: "What the film should show, added to its title, format and brief" },
49885
+ { name: "questions", type: "string", description: 'JSON file of up to 16 extra questions asked of every frame, e.g. {"logo": {"type": "noul", "instructions": "Is the Acme logo visible?"}}' },
49886
+ { name: "yes", type: "boolean", description: "Authorize spending credits" },
49887
+ { name: "dry-run", type: "boolean", description: "Validate the frames and return the check's most credits without running it" },
49888
+ urlFlag
49889
+ ).action(async ({ args, flags, stdout, signal }) => out(stdout, await reviewCheck(new Client(flags.url, signal), { ...flags, directory: args.directory })))))).command("reference", (reference) => reference.add(defineCommand("analyze", { description: "Analyse a reference video someone wants remade for their own brand or story: Elorian's Glimpse watches and listens to it and returns a remake brief (format, story, style, palette, typography, motion, transitions, audio and transcript, timed scenes, the original brand's elements to replace). Saves it to production/references/NAME.json in a video project. Takes several minutes; charged what it costs, about 22 to 36 credits for a 6-second clip in testing and more for a longer video" }, (command) => command.args({ name: "video", type: "string", required: true, description: "Video file (MP4, MOV or WebM, up to 100 MB and ten minutes) or an HTTPS link to the video file itself; YouTube, Instagram and TikTok pages cannot be fetched" }).flags(
49890
+ { name: "directory", type: "string", default: ".", description: "Video workspace or animation folder to save the brief in" },
49891
+ { name: "animation", type: "string", description: "Animation in a multi-animation workspace" },
49892
+ { name: "focus", type: "string", description: 'What matters most, such as "the transitions" or "how the offer is introduced"' },
49893
+ { name: "effort", type: "string", choices: ["low", "medium", "xhigh"], default: "low", description: "How long Glimpse thinks: low is quickest and cheapest, xhigh most thorough" },
49894
+ { name: "out", type: "string", description: "Write the analysis to this file instead" },
49895
+ { name: "wait", type: "boolean", default: true, description: "Wait for the brief; --no-wait returns the analysis ID at once" },
49896
+ { name: "yes", type: "boolean", description: "Authorize spending credits" },
49897
+ { name: "dry-run", type: "boolean", description: "Return the most credits the analysis can hold without starting it" },
49898
+ urlFlag
49899
+ ).action(async ({ args, flags, stdout, stderr, signal }) => out(stdout, await referenceAnalyze(new Client(flags.url, signal), { ...flags, video: args.video, log: stderr }))))).add(defineCommand("get", { description: "Read an analysis started with reference analyze; --wait waits for it to finish. A completed one is saved like a new one" }, (command) => command.args({ name: "id", type: "string", required: true, description: "Analysis ID (va_\u2026)" }).flags(
49900
+ { name: "directory", type: "string", default: ".", description: "Video workspace or animation folder to save the brief in" },
49901
+ { name: "animation", type: "string", description: "Animation in a multi-animation workspace" },
49902
+ { name: "out", type: "string", description: "Write the analysis to this file instead" },
49903
+ { name: "wait", type: "boolean", description: "Wait until the analysis finishes" },
49904
+ urlFlag
49905
+ ).action(async ({ args, flags, stdout, stderr, signal }) => out(stdout, await referenceGet(new Client(flags.url, signal), args.id, { ...flags, log: stderr })))))).command("create", (creation) => creation.args({ name: "name", type: "string", description: "Legacy standalone project folder; prefer create workspace NAME" }).action(async ({ args, stdout, stderr, signal }) => {
49685
49906
  if (!args.name) throw new Error("Use animaguru create workspace NAME, or animaguru create animation NAME inside a workspace.");
49686
49907
  out(stdout, await createVideoProject({ directory: args.name, log: stderr, signal }));
49687
49908
  }).add(defineCommand("workspace", { description: "Create a shared-brand workspace with one player, dependencies, skills and export toolchain" }, (command) => command.args({ name: "name", type: "string", required: true }).flags({ name: "skip-install", type: "boolean", default: false, description: "Create source files without installing dependencies" }).action(async ({ args, flags, stdout, stderr, signal }) => out(stdout, await createWorkspace({ directory: args.name, install: !flags["skip-install"], log: stderr, signal }))))).add(defineCommand("animation", { description: "Add an animation to a workspace without copying shared runtime, dependencies or skills" }, (command) => command.args({ name: "name", type: "string", required: true }).flags({ name: "workspace", type: "string", description: "Workspace folder; otherwise finds it from the current directory" }).action(async ({ args, flags, stdout, stderr, signal }) => out(stdout, await createAnimation({ name: args.name, workspace: flags.workspace, log: stderr, signal })))))).add(defineCommand("submit", { description: "Upload a finished HTML5 animation or MP4 to AnimaGuru; private unless --visibility public" }, (command) => command.args({ name: "directory", type: "string", default: ".", description: "Video project folder; defaults to current folder" }).flags(
49688
49909
  { name: "url", type: "string", default: "https://animaguru.com", env: { name: "ANIMAGURU_URL" } },
49689
49910
  { name: "animation", type: "string", description: "Animation name when submitting from a multi-animation workspace" },
49911
+ { name: "workspace", type: "string", description: "Video library: personal or a team ID; defaults to the selected workspace, or a synced project's" },
49690
49912
  { name: "file", type: "string", description: "Exported HTML5 ZIP or MP4; otherwise builds the project's HTML5 export" },
49691
49913
  { name: "title", type: "string" },
49692
49914
  { name: "description", type: "string" },
@@ -49930,7 +50152,7 @@ Confirm code: ${device.user_code}`);
49930
50152
  out(stdout, await new Client(flags.url, signal).request(flags.look ? `${avatarsPath(args.id)}/looks/${encodeURIComponent(flags.look)}` : `${avatarsPath(args.id)}/${encodeURIComponent(flags.group)}`, { method: "DELETE" }));
49931
50153
  })))).command("jobs", (jobs) => jobs.add(defineCommand("list", { description: "List the latest generation jobs" }, (command) => command.flags({ name: "url", type: "string", default: "https://animaguru.com", env: { name: "ANIMAGURU_URL" }, description: "Server origin" }).args(id).action(async ({ args, flags, stdout, signal }) => out(stdout, await new Client(flags.url, signal).request(`${projectPath(args.id)}/jobs`))))).add(defineCommand("submit", { description: "Submit a typed JSON job: character, animate, custom or redraw; spends credits" }, (command) => command.flags({ name: "url", type: "string", default: "https://animaguru.com", env: { name: "ANIMAGURU_URL" }, description: "Server origin" }).args(id).flags(...modelFlags).flags({ name: "file", type: "string", required: true, description: "JSON job file" }, { name: "yes", type: "boolean", required: true, description: "Authorize spending credits" }).action(async ({ args, flags, stdout, signal }) => {
49932
50154
  if (!flags.yes) throw new Error("Pass --yes to authorize spending credits.");
49933
- const body = spriteJobBody.parse({ ...JSON.parse(await readFile17(flags.file, "utf8")), ...selectedModels(flags) });
50155
+ const body = spriteJobBody.parse({ ...JSON.parse(await readFile18(flags.file, "utf8")), ...selectedModels(flags) });
49934
50156
  out(stdout, await new Client(flags.url, signal).request(`${projectPath(args.id)}/jobs`, { method: "POST", body }));
49935
50157
  }))).add(defineCommand("wait", { description: "Wait for a specific job; fail if generation fails or times out" }, (command) => command.flags({ name: "url", type: "string", default: "https://animaguru.com", env: { name: "ANIMAGURU_URL" }, description: "Server origin" }).args(id, { name: "job", type: "string", required: true }).flags({ name: "timeout", type: "number", default: 600, description: "Maximum seconds to wait" }).action(async ({ args, flags, stdout, signal }) => out(stdout, { job: await waitForJob(new Client(flags.url, signal), args.id, args.job, flags.timeout, signal) }))))).add(defineCommand("models", { description: "Set the default video model for future project jobs" }, (command) => command.flags({ name: "url", type: "string", default: "https://animaguru.com", env: { name: "ANIMAGURU_URL" }, description: "Server origin" }).args(id).flags(...modelFlags).action(async ({ args, flags, stdout, signal }) => {
49936
50158
  const body = selectedModels(flags);
@@ -49945,7 +50167,7 @@ Confirm code: ${device.user_code}`);
49945
50167
  const extension = flags.file.split(".").at(-1)?.toLowerCase();
49946
50168
  const type = extension === "png" ? "image/png" : extension === "jpg" || extension === "jpeg" ? "image/jpeg" : extension === "webp" ? "image/webp" : void 0;
49947
50169
  if (!type) throw new Error("Use a PNG, JPEG or WebP image.");
49948
- const bytes = await readFile17(flags.file);
50170
+ const bytes = await readFile18(flags.file);
49949
50171
  if (bytes.length > 10 * 1024 * 1024) throw new Error("Image must be at most 10 MB.");
49950
50172
  const form = new FormData();
49951
50173
  form.set("image", new Blob([bytes], { type }), `reference.${extension}`);
@@ -49961,10 +50183,10 @@ Confirm code: ${device.user_code}`);
49961
50183
  if (!file2) throw new Error(`No file at ${args.path} in this project. List them with animaguru files list.`);
49962
50184
  if (!/^[a-f0-9]{64}$/.test(file2.sha)) throw new Error("Invalid blob hash in manifest.");
49963
50185
  const response = await client.request(`/api/v1/blobs/${encodeURIComponent(manifest.ownerId)}/${file2.sha}`, { raw: true });
49964
- const path = resolve15(flags.output);
49965
- await mkdir14(dirname13(path), { recursive: true });
50186
+ const path = resolve16(flags.output);
50187
+ await mkdir15(dirname14(path), { recursive: true });
49966
50188
  const bytes = new Uint8Array(await response.arrayBuffer());
49967
- await writeFile14(path, bytes, { flag: "wx" });
50189
+ await writeFile16(path, bytes, { flag: "wx" });
49968
50190
  out(stdout, { path, bytes: bytes.length });
49969
50191
  }))).add(defineCommand("export", { description: "Download all project assets as a ZIP; refuses to overwrite" }, (command) => command.flags({ name: "url", type: "string", default: "https://animaguru.com", env: { name: "ANIMAGURU_URL" }, description: "Server origin" }).args(id).flags({ name: "output", type: "string", required: true }).action(async ({ args, flags, stdout, signal }) => {
49970
50192
  const client = new Client(flags.url, signal);
@@ -49976,8 +50198,8 @@ Confirm code: ${device.user_code}`);
49976
50198
  const response = await client.request(`/api/v1/blobs/${encodeURIComponent(manifest.ownerId)}/${file2.sha}`, { raw: true });
49977
50199
  entries[path2] = new Uint8Array(await response.arrayBuffer());
49978
50200
  }
49979
- const path = resolve15(flags.output);
49980
- await writeFile14(path, zipSync(entries, { level: 0 }), { flag: "wx" });
50201
+ const path = resolve16(flags.output);
50202
+ await writeFile16(path, zipSync(entries, { level: 0 }), { flag: "wx" });
49981
50203
  out(stdout, { path, files: manifest.files.length });
49982
50204
  })))).extend(version(package_default.version, { format: "plain" })).extend(help()).extend(completion());
49983
50205
  }