@docyrus/animaguru 0.17.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/README.md +63 -3
- package/dist/animaguru.js +840 -322
- package/package.json +1 -1
- package/skills/animaguru/SKILL.md +9 -1
- package/skills/animaguru/references/sharing.md +1 -1
- package/skills/animaguru-video/SKILL.md +7 -1
- package/skills/animaguru-video/references/short-form-ad.md +1 -0
- package/templates/video/index.html +1 -1
- package/templates/video/scripts/export-mp4.mjs +3 -0
- package/templates/video/shared/locales/en/player.json +1 -0
- package/templates/video/src/player.ts +43 -8
- package/templates/video/src/style.css +6 -1
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(
|
|
2316
|
-
deferredResolve =
|
|
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(
|
|
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
|
-
|
|
2470
|
+
resolve17(ret);
|
|
2471
2471
|
}
|
|
2472
2472
|
});
|
|
2473
2473
|
} else {
|
|
2474
|
-
|
|
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((
|
|
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
|
-
|
|
6873
|
+
resolve17(result);
|
|
6874
6874
|
}
|
|
6875
6875
|
} else {
|
|
6876
|
-
|
|
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
|
-
|
|
6884
|
+
resolve17(result);
|
|
6885
6885
|
}
|
|
6886
6886
|
});
|
|
6887
6887
|
} else {
|
|
6888
|
-
args.push(
|
|
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
|
|
8087
|
-
writer.writeUInt32BE(
|
|
8088
|
-
writer.writeUInt32BE(
|
|
8089
|
-
writer.writeUInt32BE(
|
|
8090
|
-
writer.writeUInt32BE(
|
|
8091
|
-
writer.writeUInt32BE(
|
|
8092
|
-
writer.writeUInt32BE(
|
|
8093
|
-
writer.writeUInt32BE(
|
|
8094
|
-
writer.writeUInt32BE(
|
|
8095
|
-
writer.writeUInt32BE(
|
|
8096
|
-
writer.writeUInt32BE(
|
|
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 [
|
|
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,
|
|
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
|
|
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
|
|
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
|
|
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:
|
|
8224
|
+
basename: basename8(name2),
|
|
8225
8225
|
metadata: {},
|
|
8226
8226
|
children: []
|
|
8227
8227
|
};
|
|
8228
8228
|
inodes.set(name2, dir);
|
|
8229
|
-
dir.parent =
|
|
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:
|
|
8239
|
+
basename: basename8(name2),
|
|
8240
8240
|
metadata,
|
|
8241
8241
|
// This recursively generates any missing parent folders.
|
|
8242
|
-
parent:
|
|
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
|
-
|
|
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
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
11068
|
+
map2.set(join19(filepath, entry2.path), entry2);
|
|
11069
11069
|
}
|
|
11070
|
-
return tree.entries().map((entry2) =>
|
|
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(
|
|
11163
|
+
const names = await fs2.readdir(join19(dir, filepath));
|
|
11164
11164
|
if (names === null) return null;
|
|
11165
|
-
return names.map((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
|
|
11183
|
-
if (!
|
|
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 =
|
|
11189
|
-
if (type === "blob" && !
|
|
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
|
-
|
|
11194
|
-
entry._mode =
|
|
11195
|
-
if (
|
|
11196
|
-
|
|
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 =
|
|
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(
|
|
11386
|
+
async function mkdirp(mkdir16, filepath, retries = 10) {
|
|
11387
11387
|
try {
|
|
11388
|
-
await
|
|
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 =
|
|
11393
|
+
const parent = dirname15(filepath);
|
|
11394
11394
|
if (parent === "." || parent === "/" || parent === filepath) throw err2;
|
|
11395
|
-
await mkdirp(
|
|
11395
|
+
await mkdirp(mkdir16, parent, retries);
|
|
11396
11396
|
for (let attempt = 0; ; attempt++) {
|
|
11397
11397
|
try {
|
|
11398
|
-
await
|
|
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((
|
|
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 =
|
|
11419
|
-
return fs2.lstat(subpath).then((
|
|
11420
|
-
if (!
|
|
11421
|
-
return
|
|
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(
|
|
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 =
|
|
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 =
|
|
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 =
|
|
11807
|
-
if (
|
|
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 =
|
|
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:
|
|
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:
|
|
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 =
|
|
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 =
|
|
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(
|
|
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(
|
|
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: [
|
|
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: [
|
|
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(
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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(
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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(
|
|
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
|
|
14619
|
+
const resolve17 = this._waiting;
|
|
14620
14620
|
this._waiting = null;
|
|
14621
|
-
|
|
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
|
|
14629
|
+
const resolve17 = this._waiting;
|
|
14630
14630
|
this._waiting = null;
|
|
14631
|
-
|
|
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((
|
|
14651
|
-
this._waiting =
|
|
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((
|
|
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) :
|
|
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) :
|
|
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:
|
|
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 (
|
|
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 (
|
|
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 =
|
|
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 :
|
|
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:
|
|
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:
|
|
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 =
|
|
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:
|
|
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:
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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(
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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:
|
|
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:
|
|
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 =
|
|
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(
|
|
16001
|
+
if (await fs2.exists(join19(filepath, ".git"))) {
|
|
16002
16002
|
return filepath;
|
|
16003
16003
|
} else {
|
|
16004
|
-
const parent =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 :
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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:
|
|
16467
|
+
prefix: join19(prefix, entry.path)
|
|
16468
16468
|
});
|
|
16469
16469
|
} else {
|
|
16470
|
-
filenames.push(
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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:
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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(
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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(
|
|
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(
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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
|
|
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
|
|
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 =
|
|
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) =>
|
|
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 =
|
|
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(
|
|
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(
|
|
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
|
|
18699
|
+
const dirname16 = path.shift();
|
|
18700
18700
|
for (const entry of tree) {
|
|
18701
|
-
if (entry.path ===
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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(
|
|
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(
|
|
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(
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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.
|
|
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
|
|
24299
|
-
import { dirname as
|
|
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
|
|
@@ -25339,7 +25339,12 @@ var SPRITE_IMAGE_MODEL_IDS = SPRITE_IMAGE_MODELS.map((m) => m.id);
|
|
|
25339
25339
|
function spriteImageModel(id2) {
|
|
25340
25340
|
return SPRITE_IMAGE_MODELS.find((m) => m.id === id2) ?? SPRITE_IMAGE_MODELS[0];
|
|
25341
25341
|
}
|
|
25342
|
-
var VIDEO_WORKFLOWS = ["image-to-video", "text-to-video", "extend-video"];
|
|
25342
|
+
var VIDEO_WORKFLOWS = ["image-to-video", "text-to-video", "extend-video", "reference-to-video", "lip-sync", "camera-controls", "insert-video", "recast", "relight", "3d-to-video", "style"];
|
|
25343
|
+
var STUDIO_VIDEO_WORKFLOWS = ["image-to-video", "text-to-video", "extend-video"];
|
|
25344
|
+
var MEDIA_LENGTH_WORKFLOWS = ["lip-sync", "recast", "relight", "3d-to-video"];
|
|
25345
|
+
var lengthFromMedia = (workflow) => MEDIA_LENGTH_WORKFLOWS.includes(workflow);
|
|
25346
|
+
var VIDEO_STYLES = ["vhs", "retro-toon-70s", "low-poly", "hand-drawn", "16bit-pixel"];
|
|
25347
|
+
var VHS_DAMAGE_LEVELS = ["light", "medium", "heavy"];
|
|
25343
25348
|
var VIDEO_RESOLUTIONS = ["480p", "768p", "1080p", "2k"];
|
|
25344
25349
|
var VIDEO_ASPECT_RATIOS = ["21:9", "16:9", "4:3", "1:1", "3:4", "9:16"];
|
|
25345
25350
|
var PROMPT_EXPANSION_MODES = ["disabled", "balanced", "quality"];
|
|
@@ -25347,6 +25352,15 @@ var EXTEND_OUTPUTS = ["extended", "continuation"];
|
|
|
25347
25352
|
var SOUNDTRACK_MAX_BYTES = 15 * 1024 * 1024;
|
|
25348
25353
|
var EXTEND_SOURCE_MAX_BYTES = 50 * 1024 * 1024;
|
|
25349
25354
|
var MAX_AUDIO_REFERENCES = 3;
|
|
25355
|
+
var MAX_VIDEO_REFERENCE_IMAGES = 9;
|
|
25356
|
+
var MAX_REFERENCE_VIDEOS = 3;
|
|
25357
|
+
var MAX_REFERENCE_FILES = 12;
|
|
25358
|
+
var MAX_RECAST_PEOPLE = 4;
|
|
25359
|
+
var MAX_3D_REFERENCES = 8;
|
|
25360
|
+
var MAX_CAMERA_KEYFRAMES = 12;
|
|
25361
|
+
var MAX_CAMERA_TURNS = 32;
|
|
25362
|
+
var H3_MAX = "minimax/h3-max";
|
|
25363
|
+
var h3Endpoints = (route) => ({ "image-to-video": `${route}/image-to-video`, "text-to-video": `${route}/text-to-video`, "extend-video": `${route}/extend-video` });
|
|
25350
25364
|
var SPRITE_VIDEO_MODELS = [
|
|
25351
25365
|
{
|
|
25352
25366
|
id: "pruna/p-video-2-pro",
|
|
@@ -25375,9 +25389,27 @@ var SPRITE_VIDEO_MODELS = [
|
|
|
25375
25389
|
label: "MiniMax H3 Max (fal.ai)",
|
|
25376
25390
|
provider: "fal",
|
|
25377
25391
|
workflows: VIDEO_WORKFLOWS,
|
|
25378
|
-
endpoints: {
|
|
25392
|
+
endpoints: {
|
|
25393
|
+
...h3Endpoints(H3_MAX),
|
|
25394
|
+
"reference-to-video": `${H3_MAX}/reference-to-video`,
|
|
25395
|
+
"lip-sync": `${H3_MAX}/lip-sync/image-to-video`,
|
|
25396
|
+
"camera-controls": `${H3_MAX}/camera-controls`,
|
|
25397
|
+
"insert-video": `${H3_MAX}/insert-video`,
|
|
25398
|
+
recast: `${H3_MAX}/recast`,
|
|
25399
|
+
relight: `${H3_MAX}/relight`,
|
|
25400
|
+
"3d-to-video": `${H3_MAX}/3d-to-video`,
|
|
25401
|
+
style: `${H3_MAX}/styles`
|
|
25402
|
+
},
|
|
25379
25403
|
resolutions: ["480p", "768p", "1080p"],
|
|
25380
|
-
|
|
25404
|
+
workflowOptions: {
|
|
25405
|
+
"extend-video": { resolutions: VIDEO_RESOLUTIONS },
|
|
25406
|
+
"lip-sync": { resolutions: VIDEO_RESOLUTIONS, seconds: { min: 5, max: 900, fractional: true } },
|
|
25407
|
+
"insert-video": { resolutions: ["480p", "768p"], seconds: { min: 5, max: 13, fractional: true }, creditsPerSecond: { "480p": 5, "768p": 6 } },
|
|
25408
|
+
recast: { resolutions: ["768p", "1080p"], seconds: { min: 5, max: 30, fractional: true }, creditsPerSecond: { "768p": 30, "1080p": 45 } },
|
|
25409
|
+
relight: { resolutions: VIDEO_RESOLUTIONS, seconds: { min: 2.33, max: 15, fractional: true } },
|
|
25410
|
+
"3d-to-video": { seconds: { min: 1, max: 15, fractional: true } },
|
|
25411
|
+
style: { resolutions: ["768p"], seconds: { min: 5, max: 15 } }
|
|
25412
|
+
},
|
|
25381
25413
|
modes: ["quality"],
|
|
25382
25414
|
lastFrame: true,
|
|
25383
25415
|
endFrameOnly: true,
|
|
@@ -25385,16 +25417,16 @@ var SPRITE_VIDEO_MODELS = [
|
|
|
25385
25417
|
promptExpansion: PROMPT_EXPANSION_MODES,
|
|
25386
25418
|
audio: true,
|
|
25387
25419
|
estimatedCreditsPerSecond: { "480p": { quality: 5 }, "768p": { quality: 8 }, "1080p": { quality: 16 }, "2k": { quality: 32 } },
|
|
25388
|
-
seconds: { min: 1, max: 15 }
|
|
25420
|
+
seconds: { min: 1, max: 15, fractional: true }
|
|
25389
25421
|
},
|
|
25390
25422
|
{
|
|
25391
25423
|
id: "fal/minimax-h3-max-turbo",
|
|
25392
25424
|
label: "MiniMax H3 Max Turbo (fal.ai)",
|
|
25393
25425
|
provider: "fal",
|
|
25394
|
-
workflows:
|
|
25395
|
-
endpoints:
|
|
25426
|
+
workflows: STUDIO_VIDEO_WORKFLOWS,
|
|
25427
|
+
endpoints: h3Endpoints("minimax/h3-max-turbo"),
|
|
25396
25428
|
resolutions: ["480p", "768p", "1080p"],
|
|
25397
|
-
|
|
25429
|
+
workflowOptions: { "extend-video": { resolutions: VIDEO_RESOLUTIONS } },
|
|
25398
25430
|
modes: ["speed"],
|
|
25399
25431
|
lastFrame: true,
|
|
25400
25432
|
endFrameOnly: true,
|
|
@@ -25402,7 +25434,7 @@ var SPRITE_VIDEO_MODELS = [
|
|
|
25402
25434
|
promptExpansion: PROMPT_EXPANSION_MODES,
|
|
25403
25435
|
audio: true,
|
|
25404
25436
|
estimatedCreditsPerSecond: { "480p": { speed: 2.5 }, "768p": { speed: 4 }, "1080p": { speed: 8 }, "2k": { speed: 16 } },
|
|
25405
|
-
seconds: { min: 1, max: 15 }
|
|
25437
|
+
seconds: { min: 1, max: 15, fractional: true }
|
|
25406
25438
|
}
|
|
25407
25439
|
];
|
|
25408
25440
|
var SPRITE_VIDEO_MODEL_IDS = SPRITE_VIDEO_MODELS.map((m) => m.id);
|
|
@@ -25411,12 +25443,31 @@ function spriteVideoModel(id2) {
|
|
|
25411
25443
|
return SPRITE_VIDEO_MODELS.find((m) => m.id === id2) ?? SPRITE_VIDEO_MODELS[0];
|
|
25412
25444
|
}
|
|
25413
25445
|
function videoResolutions(model, workflow = "image-to-video") {
|
|
25414
|
-
return
|
|
25415
|
-
}
|
|
25416
|
-
function
|
|
25446
|
+
return model.workflowOptions?.[workflow]?.resolutions ?? model.resolutions;
|
|
25447
|
+
}
|
|
25448
|
+
function videoSeconds(model, workflow = "image-to-video") {
|
|
25449
|
+
return model.workflowOptions?.[workflow]?.seconds ?? model.seconds;
|
|
25450
|
+
}
|
|
25451
|
+
var INCLUDED_REFERENCE_TOKENS = 4096;
|
|
25452
|
+
var imageReferenceTokens = (size) => size && size[0] > 0 && size[1] > 0 ? 32 * Math.ceil(32 * Math.max(...size) / Math.min(...size)) : 1824;
|
|
25453
|
+
var clipReferenceTokens = (seconds2, resolution) => Math.ceil(Math.max(0, seconds2) * (resolution === "480p" ? 2700 : 6900));
|
|
25454
|
+
var audioReferenceTokens = (seconds2) => Math.ceil(Math.max(0, seconds2) * 80);
|
|
25455
|
+
var DEFAULT_GENERATED_REFERENCES = 2;
|
|
25456
|
+
function billedVideoSeconds(model, workflow, seconds2) {
|
|
25457
|
+
const s = videoSeconds(model, workflow).fractional ? seconds2 : Math.round(seconds2);
|
|
25458
|
+
if (workflow === "3d-to-video") return Math.max(5, s);
|
|
25459
|
+
return workflow === "lip-sync" && s > 15 ? s * 1.2 : s;
|
|
25460
|
+
}
|
|
25461
|
+
function videoCreditsPerSecond(model, p) {
|
|
25462
|
+
const override = model.workflowOptions?.[p.workflow ?? "image-to-video"]?.creditsPerSecond?.[p.resolution];
|
|
25463
|
+
if (override !== void 0) return override;
|
|
25417
25464
|
const byMode = model.estimatedCreditsPerSecond[p.resolution] ?? model.estimatedCreditsPerSecond[model.resolutions[0]];
|
|
25418
|
-
|
|
25419
|
-
|
|
25465
|
+
return byMode[p.mode] ?? byMode[model.modes[0]] ?? 0;
|
|
25466
|
+
}
|
|
25467
|
+
function spriteVideoEstimate(model, p, extras2 = {}) {
|
|
25468
|
+
const seconds2 = billedVideoSeconds(model, p.workflow ?? "image-to-video", p.seconds);
|
|
25469
|
+
const beyond = Math.max(0, (extras2.referenceTokens ?? 0) - INCLUDED_REFERENCE_TOKENS) * 2e-3 + (extras2.generatedReferences ?? 0) * 3;
|
|
25470
|
+
return Math.max(1, Math.ceil((videoCreditsPerSecond(model, p) * seconds2 + beyond) * UNITS_PER_CREDIT));
|
|
25420
25471
|
}
|
|
25421
25472
|
|
|
25422
25473
|
// node_modules/zod/v4/classic/external.js
|
|
@@ -30445,7 +30496,7 @@ var recursive = /* @__PURE__ */ new WeakMap();
|
|
|
30445
30496
|
var NONE = 0;
|
|
30446
30497
|
var ASSUMED = 1;
|
|
30447
30498
|
var PROVEN = 2;
|
|
30448
|
-
function isRecursive(inst, stack,
|
|
30499
|
+
function isRecursive(inst, stack, resolve17) {
|
|
30449
30500
|
const cached2 = recursive.get(inst);
|
|
30450
30501
|
if (cached2 !== void 0)
|
|
30451
30502
|
return cached2 ? PROVEN : NONE;
|
|
@@ -30455,7 +30506,7 @@ function isRecursive(inst, stack, resolve16) {
|
|
|
30455
30506
|
let result = NONE;
|
|
30456
30507
|
const check2 = (child) => {
|
|
30457
30508
|
if (result !== PROVEN && child?._zod) {
|
|
30458
|
-
const answer = isRecursive(child, stack,
|
|
30509
|
+
const answer = isRecursive(child, stack, resolve17);
|
|
30459
30510
|
if (answer > result)
|
|
30460
30511
|
result = answer;
|
|
30461
30512
|
}
|
|
@@ -30466,7 +30517,7 @@ function isRecursive(inst, stack, resolve16) {
|
|
|
30466
30517
|
const desc = Object.getOwnPropertyDescriptor(sh, key);
|
|
30467
30518
|
if (spread && !desc.enumerable)
|
|
30468
30519
|
continue;
|
|
30469
|
-
const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack,
|
|
30520
|
+
const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve17) : NONE;
|
|
30470
30521
|
if (child > answer)
|
|
30471
30522
|
answer = child;
|
|
30472
30523
|
}
|
|
@@ -30530,7 +30581,7 @@ function isRecursive(inst, stack, resolve16) {
|
|
|
30530
30581
|
break;
|
|
30531
30582
|
// `$ZodLazy` caches its inner on the def, so a resolved edge is followed exactly
|
|
30532
30583
|
case "lazy": {
|
|
30533
|
-
const inner = def._cachedInner ?? (
|
|
30584
|
+
const inner = def._cachedInner ?? (resolve17 ? inst._zod.innerType : void 0);
|
|
30534
30585
|
merge2(inner ? isRecursive(inner, stack, false) : ASSUMED);
|
|
30535
30586
|
break;
|
|
30536
30587
|
}
|
|
@@ -46282,8 +46333,8 @@ async function createWorkspace(options, installer = installDependencies) {
|
|
|
46282
46333
|
};
|
|
46283
46334
|
}
|
|
46284
46335
|
async function findWorkspace(start = process.cwd()) {
|
|
46285
|
-
const { realpath
|
|
46286
|
-
let directory = await
|
|
46336
|
+
const { realpath } = await import("node:fs/promises");
|
|
46337
|
+
let directory = await realpath(resolve5(start));
|
|
46287
46338
|
while (true) {
|
|
46288
46339
|
try {
|
|
46289
46340
|
const info = JSON.parse(await readFile4(join6(directory, "animaguru.workspace.json"), "utf8"));
|
|
@@ -46347,55 +46398,214 @@ var MUSIC_MODELS = [{ id: "lyria-3.5", label: "Lyria 3.5" }];
|
|
|
46347
46398
|
var SPEECH_VOICES = ["Kore", "Puck", "Charon", "Fenrir", "Aoede", "Leda", "Orus", "Zephyr"];
|
|
46348
46399
|
var base = { name: external_exports.string().trim().min(1).max(80), prompt: external_exports.string().trim().min(3).max(4e3) };
|
|
46349
46400
|
var blob = external_exports.string().regex(/^[a-f0-9]{64}$/);
|
|
46401
|
+
var cameraKeyframe = external_exports.object({
|
|
46402
|
+
/** When, from 0 at the start of the clip to 1 at its end. */
|
|
46403
|
+
time: external_exports.number().min(0).max(1),
|
|
46404
|
+
/** Degrees around the subject; signed full turns are kept. */
|
|
46405
|
+
azimuth: external_exports.number().min(-360 * MAX_CAMERA_TURNS).max(360 * MAX_CAMERA_TURNS),
|
|
46406
|
+
/** Degrees above (positive) or below the subject. */
|
|
46407
|
+
elevation: external_exports.number().min(-90).max(90),
|
|
46408
|
+
/** Distance from the subject in scene units. */
|
|
46409
|
+
distance: external_exports.number().gt(0).max(100)
|
|
46410
|
+
});
|
|
46350
46411
|
var videoAsset = external_exports.object({
|
|
46351
|
-
|
|
46412
|
+
name: base.name,
|
|
46413
|
+
/** Lip-sync and relight take no prompt, and camera-controls, insert-video, recast and 3d-to-video may leave it out. */
|
|
46414
|
+
prompt: external_exports.string().trim().max(4e3).default(""),
|
|
46352
46415
|
type: external_exports.literal("video"),
|
|
46353
46416
|
model: external_exports.enum(SPRITE_VIDEO_MODEL_IDS).default(DEFAULT_SPRITE_VIDEO_MODEL),
|
|
46354
46417
|
workflow: external_exports.enum(VIDEO_WORKFLOWS).default("image-to-video"),
|
|
46355
|
-
/** First frame. */
|
|
46418
|
+
/** First frame; for lip-sync the face that speaks. */
|
|
46356
46419
|
reference: blob.optional(),
|
|
46357
46420
|
/** Last frame. */
|
|
46358
46421
|
endReference: blob.optional(),
|
|
46359
|
-
/**
|
|
46422
|
+
/** A frame reference-to-video reaches at middleSeconds, between its first and last frames. */
|
|
46423
|
+
middleReference: blob.optional(),
|
|
46424
|
+
middleSeconds: external_exports.number().gt(0).lt(15).optional(),
|
|
46425
|
+
/** The saved clip to extend, insert a scene into, recast, relight, or turn from a 3D render into footage. */
|
|
46360
46426
|
source: blob.optional(),
|
|
46361
|
-
/** Saved audio pinned as the soundtrack (at least two seconds of video). */
|
|
46427
|
+
/** Saved audio pinned as the soundtrack (at least two seconds of video), or the speech a lip-sync follows. */
|
|
46362
46428
|
soundtrack: blob.optional(),
|
|
46363
|
-
/** Saved audio guiding an extension's new sound; name each clip's role in the prompt. */
|
|
46429
|
+
/** Saved audio guiding an extension's new sound or a reference-to-video clip; name each clip's role in the prompt. */
|
|
46364
46430
|
audioReferences: external_exports.array(blob).max(MAX_AUDIO_REFERENCES).default([]),
|
|
46365
|
-
|
|
46366
|
-
|
|
46367
|
-
|
|
46368
|
-
|
|
46431
|
+
/** Images whose subjects or look the clip keeps, named Image 1, Image 2… in the prompt; for recast, one photo per new person. */
|
|
46432
|
+
references: external_exports.array(blob).max(MAX_VIDEO_REFERENCE_IMAGES).optional(),
|
|
46433
|
+
/** Saved clips guiding motion, named Video 1, Video 2… in the prompt. */
|
|
46434
|
+
referenceVideos: external_exports.array(blob).max(MAX_REFERENCE_VIDEOS).optional(),
|
|
46435
|
+
/** The camera's path around the reference image: 2–12 keyframes. */
|
|
46436
|
+
camera: external_exports.array(cameraKeyframe).min(2).max(MAX_CAMERA_KEYFRAMES).optional(),
|
|
46437
|
+
/** Seconds into the source where the inserted scene starts, and where the source resumes after it. */
|
|
46438
|
+
insertAt: external_exports.number().min(1.625).max(60).optional(),
|
|
46439
|
+
resumeAt: external_exports.number().gt(1.625).max(60).optional(),
|
|
46440
|
+
/** Match the inserted scene's colors to the source (fal's default). */
|
|
46441
|
+
colorMatch: external_exports.boolean().optional(),
|
|
46442
|
+
/** Transcribe the speech to guide a lip-sync. */
|
|
46443
|
+
transcribe: external_exports.boolean().optional(),
|
|
46444
|
+
/** Recast: more natural skin and blending of the new people. */
|
|
46445
|
+
enhanceRealism: external_exports.boolean().optional(),
|
|
46446
|
+
/** Recast: the user confirmed that each person in the photos agreed to appear in the video. */
|
|
46447
|
+
subjectConsent: external_exports.literal(true).optional(),
|
|
46448
|
+
/** Relight: a sphere render showing the light to apply. */
|
|
46449
|
+
lighting: blob.optional(),
|
|
46450
|
+
/** 3d-to-video without reference images: how many it may draw itself (default 2). */
|
|
46451
|
+
generatedReferences: external_exports.number().int().min(1).max(8).optional(),
|
|
46452
|
+
style: external_exports.enum(VIDEO_STYLES).optional(),
|
|
46453
|
+
/** VHS tape wear. */
|
|
46454
|
+
damage: external_exports.enum(VHS_DAMAGE_LEVELS).optional(),
|
|
46455
|
+
/** Defaults to 5, within the workflow's range; lip-sync, recast, relight and 3d-to-video take their input's length. */
|
|
46456
|
+
seconds: external_exports.number().min(0.5).max(900).optional(),
|
|
46457
|
+
/** Defaults to the workflow's first resolution. */
|
|
46458
|
+
resolution: external_exports.enum(VIDEO_RESOLUTIONS).optional(),
|
|
46459
|
+
/** Defaults to the model's first mode. */
|
|
46460
|
+
mode: external_exports.enum(["cost", "speed", "quality"]).optional(),
|
|
46461
|
+
/** A clip written from text (default 16:9), or one cropped to a new canvas ("auto" keeps its inputs' shape). */
|
|
46369
46462
|
aspectRatio: external_exports.enum(["auto", ...VIDEO_ASPECT_RATIOS]).optional(),
|
|
46370
46463
|
promptExpansion: external_exports.enum(PROMPT_EXPANSION_MODES).default("disabled"),
|
|
46371
46464
|
seed: external_exports.number().int().min(0).max(2 ** 32 - 1).optional(),
|
|
46372
46465
|
/** An extension returns the whole clip, or only the new footage after a short overlap. */
|
|
46373
46466
|
extendOutput: external_exports.enum(EXTEND_OUTPUTS).default("extended")
|
|
46374
|
-
})
|
|
46467
|
+
});
|
|
46468
|
+
var ALL = VIDEO_WORKFLOWS;
|
|
46469
|
+
var TAKES = {
|
|
46470
|
+
reference: ["image-to-video", "reference-to-video", "lip-sync", "camera-controls", "style"],
|
|
46471
|
+
endReference: ["image-to-video", "reference-to-video"],
|
|
46472
|
+
middleReference: ["reference-to-video"],
|
|
46473
|
+
middleSeconds: ["reference-to-video"],
|
|
46474
|
+
source: ["extend-video", "insert-video", "recast", "relight", "3d-to-video"],
|
|
46475
|
+
soundtrack: ["image-to-video", "text-to-video", "lip-sync"],
|
|
46476
|
+
audioReferences: ["extend-video", "reference-to-video"],
|
|
46477
|
+
references: ["reference-to-video", "insert-video", "recast", "3d-to-video"],
|
|
46478
|
+
referenceVideos: ["reference-to-video", "insert-video"],
|
|
46479
|
+
camera: ["camera-controls"],
|
|
46480
|
+
insertAt: ["insert-video"],
|
|
46481
|
+
resumeAt: ["insert-video"],
|
|
46482
|
+
colorMatch: ["insert-video"],
|
|
46483
|
+
transcribe: ["lip-sync"],
|
|
46484
|
+
enhanceRealism: ["recast"],
|
|
46485
|
+
subjectConsent: ["recast"],
|
|
46486
|
+
lighting: ["relight"],
|
|
46487
|
+
generatedReferences: ["3d-to-video"],
|
|
46488
|
+
style: ["style"],
|
|
46489
|
+
damage: ["style"],
|
|
46490
|
+
aspectRatio: ["text-to-video", "extend-video", "reference-to-video", "relight", "style"],
|
|
46491
|
+
promptExpansion: ["image-to-video", "text-to-video", "extend-video", "reference-to-video", "camera-controls", "insert-video"],
|
|
46492
|
+
seed: ALL.filter((w) => w !== "3d-to-video"),
|
|
46493
|
+
extendOutput: ["extend-video"]
|
|
46494
|
+
};
|
|
46495
|
+
var NEEDS = {
|
|
46496
|
+
"lip-sync": ["reference", "soundtrack"],
|
|
46497
|
+
"camera-controls": ["reference", "camera"],
|
|
46498
|
+
"insert-video": ["source", "insertAt", "resumeAt"],
|
|
46499
|
+
recast: ["source", "references", "subjectConsent"],
|
|
46500
|
+
relight: ["source", "lighting"],
|
|
46501
|
+
"3d-to-video": ["source"],
|
|
46502
|
+
style: ["style"]
|
|
46503
|
+
};
|
|
46504
|
+
var LABELS = {
|
|
46505
|
+
reference: "a starting image",
|
|
46506
|
+
endReference: "an ending image",
|
|
46507
|
+
middleReference: "a middle image",
|
|
46508
|
+
middleSeconds: "middleSeconds",
|
|
46509
|
+
source: "a saved video",
|
|
46510
|
+
soundtrack: "a soundtrack",
|
|
46511
|
+
audioReferences: "audio references",
|
|
46512
|
+
references: "reference images",
|
|
46513
|
+
referenceVideos: "reference videos",
|
|
46514
|
+
camera: "camera keyframes",
|
|
46515
|
+
insertAt: "insertAt",
|
|
46516
|
+
resumeAt: "resumeAt",
|
|
46517
|
+
colorMatch: "colorMatch",
|
|
46518
|
+
transcribe: "transcribe",
|
|
46519
|
+
enhanceRealism: "enhanceRealism",
|
|
46520
|
+
lighting: "a lighting image",
|
|
46521
|
+
subjectConsent: "subjectConsent: true, confirming that each person in the photos agreed to appear in the video",
|
|
46522
|
+
generatedReferences: "generatedReferences",
|
|
46523
|
+
style: "a style",
|
|
46524
|
+
damage: "damage",
|
|
46525
|
+
aspectRatio: "an aspect ratio",
|
|
46526
|
+
promptExpansion: "prompt rewriting",
|
|
46527
|
+
seed: "a seed",
|
|
46528
|
+
extendOutput: "extendOutput"
|
|
46529
|
+
};
|
|
46530
|
+
var STUDIO_MESSAGES = {
|
|
46531
|
+
reference: "Only image-to-video starts from an image.",
|
|
46532
|
+
endReference: "Only image-to-video ends on an image.",
|
|
46533
|
+
source: "Only an extension starts from a saved video.",
|
|
46534
|
+
audioReferences: "Only an extension takes audio references.",
|
|
46535
|
+
extendOutput: "Only an extension can return the new footage alone."
|
|
46536
|
+
};
|
|
46537
|
+
var PROMPT = { "camera-controls": "optional", "insert-video": "optional", recast: "optional", "3d-to-video": "optional", "lip-sync": "none", relight: "none" };
|
|
46538
|
+
var given = (value) => value !== void 0 && !(Array.isArray(value) && !value.length);
|
|
46539
|
+
function videoChecks(p, ctx) {
|
|
46375
46540
|
const model = spriteVideoModel(p.model);
|
|
46376
46541
|
const issue2 = (path, message) => ctx.addIssue({ code: "custom", message, path: [path] });
|
|
46377
46542
|
if (!model.workflows.includes(p.workflow)) return issue2("workflow", "Choose a way of making video supported by the video model.");
|
|
46378
|
-
const
|
|
46379
|
-
|
|
46380
|
-
|
|
46381
|
-
|
|
46382
|
-
|
|
46543
|
+
const w = p.workflow;
|
|
46544
|
+
const extend2 = w === "extend-video";
|
|
46545
|
+
const range = videoSeconds(model, w);
|
|
46546
|
+
const seconds2 = p.seconds ?? defaultSeconds(model, w);
|
|
46547
|
+
const resolution = p.resolution ?? videoResolutions(model, w)[0];
|
|
46548
|
+
const prompt = PROMPT[w];
|
|
46549
|
+
if (prompt === "none" && p.prompt) issue2("prompt", `${w} takes no prompt; leave it out.`);
|
|
46550
|
+
if (!prompt && p.prompt.length < 3) issue2("prompt", "Describe the video in at least 3 characters.");
|
|
46551
|
+
if ((w === "recast" || w === "3d-to-video") && p.prompt.length > 2e3) issue2("prompt", `${w} takes a prompt of at most 2,000 characters.`);
|
|
46552
|
+
if (!lengthFromMedia(w) && (seconds2 < range.min || seconds2 > range.max || !range.fractional && !Number.isInteger(seconds2))) issue2("seconds", "Choose a duration supported by the video model.");
|
|
46553
|
+
if (!videoResolutions(model, w).includes(resolution)) issue2("resolution", "Choose a resolution supported by the video model.");
|
|
46554
|
+
if (p.mode && !model.modes.includes(p.mode)) issue2("mode", "Choose a mode supported by the video model.");
|
|
46555
|
+
for (const [field, workflows] of Object.entries(TAKES)) {
|
|
46556
|
+
if (!given(p[field]) || workflows.includes(w)) continue;
|
|
46557
|
+
if (field === "promptExpansion" && p.promptExpansion === "disabled" || field === "extendOutput" && p.extendOutput === "extended") continue;
|
|
46558
|
+
const studio = w === "image-to-video" || w === "text-to-video" || extend2;
|
|
46559
|
+
if (field === "aspectRatio" && w === "image-to-video") issue2(field, "A video made from an image keeps the image's shape.");
|
|
46560
|
+
else if (field === "soundtrack" && extend2) issue2(field, "An extension keeps its source's soundtrack; add audio references instead.");
|
|
46561
|
+
else if (studio && STUDIO_MESSAGES[field]) issue2(field, STUDIO_MESSAGES[field]);
|
|
46562
|
+
else issue2(field, `${w} doesn't take ${LABELS[field] ?? field}.`);
|
|
46563
|
+
}
|
|
46564
|
+
for (const field of NEEDS[w] ?? []) if (!given(p[field])) issue2(field, `${w} needs ${LABELS[field] ?? field}.`);
|
|
46565
|
+
if (w === "image-to-video") {
|
|
46383
46566
|
if (!p.reference && !(p.endReference && model.endFrameOnly)) issue2("reference", "Choose a starting image.");
|
|
46384
46567
|
if (p.endReference && !model.lastFrame) issue2("endReference", "This video model can't end on a chosen image.");
|
|
46385
|
-
}
|
|
46386
|
-
|
|
46387
|
-
|
|
46388
|
-
|
|
46389
|
-
if (
|
|
46390
|
-
if (p.
|
|
46391
|
-
if (p.
|
|
46392
|
-
if (p.
|
|
46393
|
-
if (p.soundtrack && p.seconds < 2) issue2("seconds", "A video with a soundtrack must be at least 2 seconds long.");
|
|
46394
|
-
if (p.audioReferences.length && (!model.audio || !extend2)) issue2("audioReferences", "Only an extension takes audio references.");
|
|
46568
|
+
}
|
|
46569
|
+
if (extend2 && !p.source) issue2("source", "Choose a saved video to extend.");
|
|
46570
|
+
if (p.aspectRatio === "auto" && (w === "text-to-video" || w === "style")) issue2("aspectRatio", "Choose an aspect ratio for a video written from text.");
|
|
46571
|
+
if (w === "style" && p.aspectRatio && p.reference) issue2("aspectRatio", "A styled video made from an image keeps the image's shape.");
|
|
46572
|
+
if (p.damage && p.style !== "vhs") issue2("damage", "Only the VHS style takes tape damage.");
|
|
46573
|
+
if (p.soundtrack && !model.audio) issue2("soundtrack", "This video model can't use a soundtrack.");
|
|
46574
|
+
if (p.soundtrack && w !== "lip-sync" && seconds2 < 2) issue2("seconds", "A video with a soundtrack must be at least 2 seconds long.");
|
|
46575
|
+
if (p.audioReferences.length && !model.audio) issue2("audioReferences", "Only an extension takes audio references.");
|
|
46395
46576
|
if (p.promptExpansion !== "disabled" && !model.promptExpansion?.includes(p.promptExpansion)) issue2("promptExpansion", "This video model doesn't rewrite prompts.");
|
|
46396
46577
|
if (p.seed !== void 0 && !model.seed) issue2("seed", "This video model doesn't take a seed.");
|
|
46397
|
-
if (p.
|
|
46398
|
-
|
|
46578
|
+
if (p.seed !== void 0 && p.seed >= 2 ** 31 && (w === "lip-sync" || w === "insert-video")) issue2("seed", `${w} takes a seed below 2,147,483,648.`);
|
|
46579
|
+
const references = p.references ?? [];
|
|
46580
|
+
const unique = (shas2) => new Set(shas2).size === shas2.length;
|
|
46581
|
+
if (!unique(references) || !unique(p.referenceVideos ?? []) || !unique(p.audioReferences)) issue2("references", "Choose each reference once.");
|
|
46582
|
+
if (w === "reference-to-video") {
|
|
46583
|
+
if (references.length + (p.referenceVideos?.length ?? 0) + p.audioReferences.length > MAX_REFERENCE_FILES) issue2("references", `reference-to-video takes at most ${MAX_REFERENCE_FILES} reference files in all.`);
|
|
46584
|
+
if (!references.length && !p.referenceVideos?.length && !p.audioReferences.length && !p.reference && !p.endReference) issue2("references", "reference-to-video needs reference images, videos or audio, or a first or last frame.");
|
|
46585
|
+
if (Boolean(p.middleReference) !== (p.middleSeconds !== void 0)) issue2("middleSeconds", "A middle image needs middleSeconds, and middleSeconds a middle image.");
|
|
46586
|
+
if (p.middleReference && (!p.reference || !p.endReference)) issue2("middleReference", "A middle image needs the starting and ending images too.");
|
|
46587
|
+
if (p.middleReference && !["480p", "768p"].includes(resolution)) issue2("middleReference", "A middle image needs 480p or 768p.");
|
|
46588
|
+
if (p.middleSeconds !== void 0 && p.middleSeconds >= seconds2) issue2("middleSeconds", "Put the middle image before the end of the clip.");
|
|
46589
|
+
}
|
|
46590
|
+
if (w === "recast" && references.length > MAX_RECAST_PEOPLE) issue2("references", `recast takes at most ${MAX_RECAST_PEOPLE} photos, one per person.`);
|
|
46591
|
+
if (w === "3d-to-video" && references.length > MAX_3D_REFERENCES) issue2("references", `3d-to-video takes at most ${MAX_3D_REFERENCES} reference images.`);
|
|
46592
|
+
if (w === "3d-to-video" && references.length && p.generatedReferences !== void 0) issue2("generatedReferences", "3d-to-video only draws its own references when you give none.");
|
|
46593
|
+
if (w === "insert-video" && p.insertAt !== void 0 && p.resumeAt !== void 0 && p.resumeAt < p.insertAt) issue2("resumeAt", "Resume the source at or after the point where the new scene starts.");
|
|
46594
|
+
if (p.camera) {
|
|
46595
|
+
const times = p.camera.map((k) => k.time);
|
|
46596
|
+
if (times.some((t, i2) => i2 && t <= times[i2 - 1])) issue2("camera", "Order the camera keyframes by time, each later than the one before.");
|
|
46597
|
+
const travel = p.camera.slice(1).reduce((sum, k, i2) => sum + Math.abs(k.azimuth - p.camera[i2].azimuth), 0);
|
|
46598
|
+
if (travel > 360 * MAX_CAMERA_TURNS) issue2("camera", `The camera may travel at most ${MAX_CAMERA_TURNS} full turns around the subject.`);
|
|
46599
|
+
}
|
|
46600
|
+
}
|
|
46601
|
+
var defaultSeconds = (model, workflow) => {
|
|
46602
|
+
const r = videoSeconds(model, workflow);
|
|
46603
|
+
return Math.min(r.max, Math.max(r.min, 5));
|
|
46604
|
+
};
|
|
46605
|
+
var videoDefaults = (p) => {
|
|
46606
|
+
const model = spriteVideoModel(p.model);
|
|
46607
|
+
return { ...p, seconds: p.seconds ?? defaultSeconds(model, p.workflow), resolution: p.resolution ?? videoResolutions(model, p.workflow)[0], mode: p.mode ?? model.modes[0] };
|
|
46608
|
+
};
|
|
46399
46609
|
var IMAGE_ASPECT_RATIOS = ["1:1", "3:2", "2:3", "16:9", "9:16"];
|
|
46400
46610
|
var MAX_IMAGE_REFERENCES = 4;
|
|
46401
46611
|
var MAX_MASK_REGIONS = 8;
|
|
@@ -46416,7 +46626,7 @@ var imageChecks = (p, ctx) => {
|
|
|
46416
46626
|
};
|
|
46417
46627
|
var assetRequest = external_exports.discriminatedUnion("type", [
|
|
46418
46628
|
imageAsset.superRefine(imageChecks),
|
|
46419
|
-
videoAsset,
|
|
46629
|
+
videoAsset.superRefine(videoChecks).transform(videoDefaults),
|
|
46420
46630
|
external_exports.object({ ...base, type: external_exports.literal("music"), model: external_exports.literal("lyria-3.5").default("lyria-3.5") }),
|
|
46421
46631
|
external_exports.object({ ...base, type: external_exports.literal("speech"), model: external_exports.enum(["gemini-3.8-flash-tts", "gemini-3.8-flash-lite-tts", ...ELEVENLABS_SPEECH_MODEL_IDS]).default("gemini-3.8-flash-lite-tts"), voice: external_exports.string().trim().max(80).default(""), delivery: external_exports.string().trim().max(600).default("") }).superRefine((p, ctx) => {
|
|
46422
46632
|
if (p.voice && (isElevenLabsSpeech(p.model) ? !/^[a-zA-Z0-9]{20}$/.test(p.voice) : !SPEECH_VOICES.includes(p.voice))) ctx.addIssue({ code: "custom", message: "Choose a voice supported by the speech provider.", path: ["voice"] });
|
|
@@ -46432,9 +46642,18 @@ var uploadedMedia = external_exports.object({ name: base.name, prompt: external_
|
|
|
46432
46642
|
var savedAssetOptions = external_exports.union([assetRequest, libraryAudio, uploadedMedia]);
|
|
46433
46643
|
var speechCharacters = (text2) => Array.from(text2).length;
|
|
46434
46644
|
var imageEstimate = (p) => Math.ceil((130 + 40 * p.references.length) * spriteImageModel(p.model).relCost);
|
|
46645
|
+
function videoExtras(p, facts = {}) {
|
|
46646
|
+
const w = p.workflow;
|
|
46647
|
+
if (w !== "reference-to-video" && w !== "insert-video" && w !== "3d-to-video") return {};
|
|
46648
|
+
const images = (p.references ?? []).reduce((sum, sha2) => sum + imageReferenceTokens(facts.size?.(sha2)), 0);
|
|
46649
|
+
if (w === "3d-to-video") return { referenceTokens: images + clipReferenceTokens(p.seconds, p.resolution), generatedReferences: p.references?.length ? 0 : p.generatedReferences ?? DEFAULT_GENERATED_REFERENCES };
|
|
46650
|
+
const clips = Math.min(15, (p.referenceVideos ?? []).reduce((sum, sha2) => sum + Math.min(p.seconds, facts.seconds?.(sha2) ?? p.seconds), 0));
|
|
46651
|
+
const audio = Math.min(15, p.audioReferences.reduce((sum, sha2) => sum + (facts.seconds?.(sha2) ?? 15), 0));
|
|
46652
|
+
return { referenceTokens: images + clipReferenceTokens(clips, p.resolution) + (w === "reference-to-video" ? audioReferenceTokens(audio) : 0) };
|
|
46653
|
+
}
|
|
46435
46654
|
function assetEstimate(p, now = Date.now()) {
|
|
46436
46655
|
if (p.type === "image") return imageEstimate(p);
|
|
46437
|
-
if (p.type === "video") return spriteVideoEstimate(spriteVideoModel(p.model), p);
|
|
46656
|
+
if (p.type === "video") return spriteVideoEstimate(spriteVideoModel(p.model), p, videoExtras(p));
|
|
46438
46657
|
if (p.type === "music") return 80;
|
|
46439
46658
|
const units = (credits) => Math.max(1, Math.ceil(credits * UNITS_PER_CREDIT));
|
|
46440
46659
|
if (p.type === "sfx") return units(Math.max(0, p.seconds) * 0.2);
|
|
@@ -46459,6 +46678,7 @@ import { createHash as createHash4 } from "node:crypto";
|
|
|
46459
46678
|
// shared/videos.ts
|
|
46460
46679
|
var VIDEO_PART_BYTES = 8 * 1024 * 1024;
|
|
46461
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 };
|
|
46462
46682
|
var VIDEO_VISIBILITIES = ["private", "public"];
|
|
46463
46683
|
var VIDEO_SHARING_AGREEMENT_VERSION = "2026-10-15-draft-2";
|
|
46464
46684
|
var videoAgreementAcceptance = external_exports.object({
|
|
@@ -46685,7 +46905,7 @@ async function localProject(directory, selected) {
|
|
|
46685
46905
|
// cli/src/cloud-sync.ts
|
|
46686
46906
|
var import_isomorphic_git = __toESM(require_isomorphic_git(), 1);
|
|
46687
46907
|
import * as fs from "node:fs";
|
|
46688
|
-
import { chmod as chmod3, lstat, mkdir as mkdir7, open as open3, readFile as readFile7, readdir as readdir4,
|
|
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";
|
|
46689
46909
|
import { createHash as createHash3, randomUUID as randomUUID2 } from "node:crypto";
|
|
46690
46910
|
import { dirname as dirname6, join as join8, resolve as resolve8 } from "node:path";
|
|
46691
46911
|
import { Readable } from "node:stream";
|
|
@@ -47169,15 +47389,6 @@ async function uploadObjects(context, files, absolute) {
|
|
|
47169
47389
|
}
|
|
47170
47390
|
return missing.size;
|
|
47171
47391
|
}
|
|
47172
|
-
async function stageCloudVideo(options) {
|
|
47173
|
-
const context = await openContext(options.dir, options);
|
|
47174
|
-
const root = await realpath(context.root);
|
|
47175
|
-
const file2 = await realpath(options.file);
|
|
47176
|
-
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.");
|
|
47177
|
-
const info = await stat2(file2);
|
|
47178
|
-
if (!info.isFile() || info.size !== options.size) throw new Error("The MP4 changed before staging.");
|
|
47179
|
-
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);
|
|
47180
|
-
}
|
|
47181
47392
|
async function retry(context, run) {
|
|
47182
47393
|
for (let attempt = 0; ; attempt++) {
|
|
47183
47394
|
try {
|
|
@@ -47447,6 +47658,11 @@ async function restoreCloud(options) {
|
|
|
47447
47658
|
|
|
47448
47659
|
// cli/src/videos.ts
|
|
47449
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
|
+
}
|
|
47450
47666
|
function sharingEmails(value) {
|
|
47451
47667
|
return value ? value.split(",").map((email3) => email3.trim()).filter(Boolean) : [];
|
|
47452
47668
|
}
|
|
@@ -47484,6 +47700,7 @@ async function exportHtml(root, animation, signal, log) {
|
|
|
47484
47700
|
}
|
|
47485
47701
|
async function submitVideo(client, options) {
|
|
47486
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);
|
|
47487
47704
|
const root = resolve9(options.directory ?? ".");
|
|
47488
47705
|
const context = await localProject(root, options.animation);
|
|
47489
47706
|
const file2 = options.file ? resolve9(root, options.file) : await exportHtml(context.toolsRoot, context.animation, options.signal, options.log);
|
|
@@ -47517,7 +47734,7 @@ async function submitVideo(client, options) {
|
|
|
47517
47734
|
metadata = { ...metadata, ...receipt.title ? { title: receipt.title } : {}, ...probe };
|
|
47518
47735
|
}
|
|
47519
47736
|
const link2 = await cloudLink(context.toolsRoot).catch(() => null);
|
|
47520
|
-
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) };
|
|
47521
47738
|
const body = videoSubmission.parse({
|
|
47522
47739
|
...home,
|
|
47523
47740
|
title: options.title ?? metadata.title ?? basename4(file2).replace(/\.(zip|mp4)$/i, ""),
|
|
@@ -47608,7 +47825,42 @@ async function changeVideoSubtitles(client, id2, options) {
|
|
|
47608
47825
|
import { mkdir as mkdir8, readFile as readFile9, stat as stat4, writeFile as writeFile8 } from "node:fs/promises";
|
|
47609
47826
|
import { dirname as dirname7, join as join10, resolve as resolve10 } from "node:path";
|
|
47610
47827
|
import { setTimeout as delay3 } from "node:timers/promises";
|
|
47611
|
-
var extras = {
|
|
47828
|
+
var extras = {
|
|
47829
|
+
image: ["aspect-ratio", "transparent", "references", "mask"],
|
|
47830
|
+
video: [
|
|
47831
|
+
"workflow",
|
|
47832
|
+
"reference",
|
|
47833
|
+
"end-reference",
|
|
47834
|
+
"source",
|
|
47835
|
+
"soundtrack",
|
|
47836
|
+
"audio-references",
|
|
47837
|
+
"seconds",
|
|
47838
|
+
"resolution",
|
|
47839
|
+
"mode",
|
|
47840
|
+
"aspect-ratio",
|
|
47841
|
+
"prompt-expansion",
|
|
47842
|
+
"seed",
|
|
47843
|
+
"extend-output",
|
|
47844
|
+
"references",
|
|
47845
|
+
"reference-videos",
|
|
47846
|
+
"middle-reference",
|
|
47847
|
+
"middle-seconds",
|
|
47848
|
+
"camera",
|
|
47849
|
+
"insert-at",
|
|
47850
|
+
"resume-at",
|
|
47851
|
+
"color-match",
|
|
47852
|
+
"transcribe",
|
|
47853
|
+
"enhance-realism",
|
|
47854
|
+
"subject-consent",
|
|
47855
|
+
"lighting",
|
|
47856
|
+
"generated-references",
|
|
47857
|
+
"style",
|
|
47858
|
+
"damage"
|
|
47859
|
+
],
|
|
47860
|
+
music: [],
|
|
47861
|
+
speech: ["voice", "delivery"],
|
|
47862
|
+
sfx: ["seconds", "loop", "prompt-influence"]
|
|
47863
|
+
};
|
|
47612
47864
|
var list2 = (items) => items.length < 2 ? items.join("") : `${items.slice(0, -1).join(", ")} and ${items.at(-1)}`;
|
|
47613
47865
|
function accepted(type) {
|
|
47614
47866
|
if (type === "music") return "Music accepts only --name, --prompt and --model; the model chooses the length, so fit it during the edit.";
|
|
@@ -47628,17 +47880,21 @@ var regions = (value) => value?.split(";").filter((region) => region.trim()).map
|
|
|
47628
47880
|
if (rest.length || [x2, y, width, height].some((n) => !Number.isFinite(n))) throw new Error(`--mask regions are x,y,width,height in fractions of Image 1, separated by semicolons; "${region.trim()}" is not.`);
|
|
47629
47881
|
return { x: x2, y, width, height };
|
|
47630
47882
|
});
|
|
47883
|
+
var keyframes = (value) => value?.split(";").filter((frame) => frame.trim()).map((frame) => {
|
|
47884
|
+
const [time3, azimuth, elevation, distance, ...rest] = frame.split(",").map((n) => n.trim() ? Number(n) : NaN);
|
|
47885
|
+
if (rest.length || [time3, azimuth, elevation, distance].some((n) => !Number.isFinite(n))) throw new Error(`--camera keyframes are time,azimuth,elevation,distance (time 0\u20131, angles in degrees), separated by semicolons; "${frame.trim()}" is not.`);
|
|
47886
|
+
return { time: time3, azimuth, elevation, distance };
|
|
47887
|
+
});
|
|
47631
47888
|
function assetFromFlags(flags) {
|
|
47632
47889
|
if (flags.type === "image" && flags.model) throw new Error("Image models are managed by staff. Omit --model.");
|
|
47633
47890
|
for (const name2 of Object.values(extras).flat()) {
|
|
47634
47891
|
const value = flags[name2];
|
|
47635
47892
|
if (value !== void 0 && value !== false && !extras[flags.type]?.includes(name2)) throw new Error(`--${name2} is not an option for ${flags.type} assets. ${accepted(flags.type)}`.trim());
|
|
47636
47893
|
}
|
|
47894
|
+
if (flags.type !== "video" && flags.prompt === void 0) throw new Error(`--prompt is required for ${flags.type} assets.`);
|
|
47637
47895
|
const base2 = { type: flags.type, name: flags.name, prompt: flags.prompt, model: flags.model };
|
|
47638
47896
|
if (flags.type === "image") return parseAsset({ ...base2, aspectRatio: flags["aspect-ratio"], transparent: flags.transparent, references: shas(flags.references), mask: regions(flags.mask) });
|
|
47639
47897
|
if (flags.type === "video") {
|
|
47640
|
-
const model = spriteVideoModel(flags.model);
|
|
47641
|
-
const workflow = flags.workflow ?? "image-to-video";
|
|
47642
47898
|
return parseAsset({
|
|
47643
47899
|
...base2,
|
|
47644
47900
|
workflow: flags.workflow,
|
|
@@ -47647,9 +47903,24 @@ function assetFromFlags(flags) {
|
|
|
47647
47903
|
source: flags.source,
|
|
47648
47904
|
soundtrack: flags.soundtrack,
|
|
47649
47905
|
audioReferences: shas(flags["audio-references"]),
|
|
47650
|
-
|
|
47651
|
-
|
|
47652
|
-
|
|
47906
|
+
references: shas(flags.references),
|
|
47907
|
+
referenceVideos: shas(flags["reference-videos"]),
|
|
47908
|
+
middleReference: flags["middle-reference"],
|
|
47909
|
+
middleSeconds: flags["middle-seconds"],
|
|
47910
|
+
camera: keyframes(flags.camera),
|
|
47911
|
+
insertAt: flags["insert-at"],
|
|
47912
|
+
resumeAt: flags["resume-at"],
|
|
47913
|
+
colorMatch: flags["color-match"],
|
|
47914
|
+
transcribe: flags.transcribe,
|
|
47915
|
+
enhanceRealism: flags["enhance-realism"],
|
|
47916
|
+
subjectConsent: flags["subject-consent"] || void 0,
|
|
47917
|
+
lighting: flags.lighting,
|
|
47918
|
+
generatedReferences: flags["generated-references"],
|
|
47919
|
+
style: flags.style,
|
|
47920
|
+
damage: flags.damage,
|
|
47921
|
+
seconds: flags.seconds,
|
|
47922
|
+
resolution: flags.resolution,
|
|
47923
|
+
mode: flags.mode,
|
|
47653
47924
|
aspectRatio: flags["aspect-ratio"],
|
|
47654
47925
|
promptExpansion: flags["prompt-expansion"],
|
|
47655
47926
|
seed: flags.seed,
|
|
@@ -47703,8 +47974,13 @@ async function assetsFromBatchFile(file2, model) {
|
|
|
47703
47974
|
${errors.join("\n")}`);
|
|
47704
47975
|
return requests;
|
|
47705
47976
|
}
|
|
47977
|
+
var measured = (body) => body.type === "video" && (lengthFromMedia(body.workflow) || ["reference-to-video", "insert-video", "3d-to-video"].includes(body.workflow));
|
|
47978
|
+
async function estimateAsset(client, project, body) {
|
|
47979
|
+
if (measured(body)) return client.request(`${assetsPath(project)}/estimate`, { method: "POST", body });
|
|
47980
|
+
return { dryRun: true, request: body, estimatedCredits: toCredits(assetEstimate(body)) };
|
|
47981
|
+
}
|
|
47706
47982
|
async function submitAsset(client, project, body, options) {
|
|
47707
|
-
if (options["dry-run"]) return
|
|
47983
|
+
if (options["dry-run"]) return estimateAsset(client, project, body);
|
|
47708
47984
|
if (!options.yes) throw new Error("Pass --yes to authorize spending credits, or --dry-run to validate and estimate without generation.");
|
|
47709
47985
|
return client.request(`/api/v1/sprites/${encodeURIComponent(project)}/assets`, { method: "POST", body });
|
|
47710
47986
|
}
|
|
@@ -47800,8 +48076,12 @@ async function generateAsset(client, project, body, options, signal) {
|
|
|
47800
48076
|
var sumCredits = (amounts) => toCredits(amounts.reduce((total, credits) => total + (typeof credits === "number" ? toUnits(credits) : 0), 0));
|
|
47801
48077
|
async function submitAssetBatch(client, project, requests, options, signal) {
|
|
47802
48078
|
if (options["dry-run"]) {
|
|
47803
|
-
const items2 =
|
|
47804
|
-
|
|
48079
|
+
const items2 = [];
|
|
48080
|
+
for (const request2 of requests) {
|
|
48081
|
+
const { request: checked3, estimatedCredits } = await estimateAsset(client, project, request2);
|
|
48082
|
+
items2.push({ name: checked3.name, type: checked3.type, model: checked3.model, estimatedCredits });
|
|
48083
|
+
}
|
|
48084
|
+
return { dryRun: true, items: items2, estimatedCredits: sumCredits(items2.map((item) => item.estimatedCredits)) };
|
|
47805
48085
|
}
|
|
47806
48086
|
if (!options.yes) throw new Error("Pass --yes to authorize spending credits, or --dry-run to validate and estimate without generation.");
|
|
47807
48087
|
const waiting = Boolean(options.wait || options.download);
|
|
@@ -48017,12 +48297,8 @@ import { readFile as readFile12, stat as stat6 } from "node:fs/promises";
|
|
|
48017
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";
|
|
48018
48298
|
import { dirname as dirname8, join as join11 } from "node:path";
|
|
48019
48299
|
import { randomUUID as randomUUID3 } from "node:crypto";
|
|
48020
|
-
function
|
|
48021
|
-
|
|
48022
|
-
const workspace3 = process.env.ANIMAGURU_CLOUD_WORKSPACE;
|
|
48023
|
-
if (!project || !workspace3) return null;
|
|
48024
|
-
if (!/^prj_[A-Za-z0-9]{8,40}$/.test(project) || !/^aw_[a-f0-9]{32}$/.test(workspace3)) throw new Error("Invalid Animator context.");
|
|
48025
|
-
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.");
|
|
48026
48302
|
}
|
|
48027
48303
|
var youtubeMetadata = external_exports.object({
|
|
48028
48304
|
title: external_exports.string().trim().min(1).max(100).refine((value) => !/[<>]/.test(value)),
|
|
@@ -48125,34 +48401,18 @@ async function writePrivate(file2, value) {
|
|
|
48125
48401
|
}
|
|
48126
48402
|
}
|
|
48127
48403
|
async function readYouTubeCredentials() {
|
|
48128
|
-
const cloud = cloudYouTube();
|
|
48129
|
-
if (cloud) {
|
|
48130
|
-
const result = await cloud.client.request(`${cloud.path}/credentials`);
|
|
48131
|
-
return result.credentials === null ? null : youtubeCredentials.parse(result.credentials);
|
|
48132
|
-
}
|
|
48133
48404
|
const value = await readPrivate(credentialFile());
|
|
48134
48405
|
if (value === null) return null;
|
|
48135
48406
|
const parsed = youtubeCredentials.safeParse(value);
|
|
48136
48407
|
if (!parsed.success) throw new Error("Invalid saved YouTube credentials. Run youtube auth logout, then login again.");
|
|
48137
48408
|
return parsed.data;
|
|
48138
48409
|
}
|
|
48139
|
-
var saveYouTubeCredentials = (value) =>
|
|
48410
|
+
var saveYouTubeCredentials = (value) => writePrivate(credentialFile(), youtubeCredentials.parse(value));
|
|
48140
48411
|
async function saveYouTubeJob(value) {
|
|
48141
48412
|
const job = youtubeJob.parse(value);
|
|
48142
|
-
const cloud = cloudYouTube();
|
|
48143
|
-
if (cloud) {
|
|
48144
|
-
await cloud.client.request(`${cloud.path}/uploads/${job.id}`, { method: "PUT", body: job });
|
|
48145
|
-
return;
|
|
48146
|
-
}
|
|
48147
48413
|
await writePrivate(jobFile(job.id), job);
|
|
48148
48414
|
}
|
|
48149
48415
|
async function readYouTubeJob(id2) {
|
|
48150
|
-
const cloud = cloudYouTube();
|
|
48151
|
-
if (cloud) {
|
|
48152
|
-
const job = (await localYouTubeJobs()).find((job2) => job2.id === id2);
|
|
48153
|
-
if (!job) throw new Error("Cloud YouTube upload not found.");
|
|
48154
|
-
return job;
|
|
48155
|
-
}
|
|
48156
48416
|
const parsed = youtubeJob.safeParse(await readPrivate(jobFile(id2)));
|
|
48157
48417
|
if (!parsed.success || parsed.data.id !== id2) throw new Error("Upload not found or local upload state is invalid.");
|
|
48158
48418
|
return parsed.data;
|
|
@@ -48161,11 +48421,6 @@ function youtubeJobSummary(job) {
|
|
|
48161
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 };
|
|
48162
48422
|
}
|
|
48163
48423
|
async function localYouTubeJobs() {
|
|
48164
|
-
const cloud = cloudYouTube();
|
|
48165
|
-
if (cloud) {
|
|
48166
|
-
const result = await cloud.client.request(`${cloud.path}/uploads`);
|
|
48167
|
-
return result.jobs.map((job) => youtubeJob.parse(job));
|
|
48168
|
-
}
|
|
48169
48424
|
const directory = join11(youtubeDirectory(), "uploads");
|
|
48170
48425
|
if (!await existingDirectory(directory)) return [];
|
|
48171
48426
|
let files;
|
|
@@ -48198,6 +48453,7 @@ async function clearYouTubeData() {
|
|
|
48198
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)));
|
|
48199
48454
|
}
|
|
48200
48455
|
async function withYouTubeLock(operation) {
|
|
48456
|
+
refuseInAnimator();
|
|
48201
48457
|
await privateDirectory(youtubeDirectory());
|
|
48202
48458
|
const file2 = join11(youtubeDirectory(), "operation.lock");
|
|
48203
48459
|
const lock = await open5(file2, "wx", 384).catch((error62) => {
|
|
@@ -48252,7 +48508,6 @@ async function googleJson(response) {
|
|
|
48252
48508
|
}
|
|
48253
48509
|
async function providerError(response) {
|
|
48254
48510
|
const body = await googleJson(response);
|
|
48255
|
-
if (cloudYouTube() && typeof body.error?.message === "string") return new YouTubeError(String(body.error.message).slice(0, 512));
|
|
48256
48511
|
const error62 = body.error;
|
|
48257
48512
|
const raw = typeof error62 === "object" ? error62?.errors?.[0]?.reason : error62;
|
|
48258
48513
|
const reason = typeof raw === "string" && /^[A-Za-z_]{1,64}$/.test(raw) ? raw : void 0;
|
|
@@ -48285,7 +48540,6 @@ async function tokenRequest(client, params, signal) {
|
|
|
48285
48540
|
return googleJson(response);
|
|
48286
48541
|
}
|
|
48287
48542
|
async function accessToken(credentials, signal, force = false) {
|
|
48288
|
-
if (cloudYouTube()) return "provided-by-worker";
|
|
48289
48543
|
if (!force && credentials.expiresAt > Date.now() + 6e4) return credentials.accessToken;
|
|
48290
48544
|
const body = await tokenRequest(credentials, { grant_type: "refresh_token", refresh_token: credentials.refreshToken }, signal);
|
|
48291
48545
|
const scopes = typeof body.scope === "string" ? body.scope.split(" ") : null;
|
|
@@ -48339,7 +48593,7 @@ async function revoke(token3, signal) {
|
|
|
48339
48593
|
}
|
|
48340
48594
|
}
|
|
48341
48595
|
async function youtubeLogin(options) {
|
|
48342
|
-
|
|
48596
|
+
refuseInAnimator();
|
|
48343
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.");
|
|
48344
48598
|
const seconds2 = options.timeout ?? 300;
|
|
48345
48599
|
if (!Number.isFinite(seconds2) || seconds2 < 1 || seconds2 > 600) throw new Error("Use an authorization timeout between 1 and 600 seconds.");
|
|
@@ -48363,8 +48617,8 @@ async function youtubeLogin(options) {
|
|
|
48363
48617
|
let receive;
|
|
48364
48618
|
let fail;
|
|
48365
48619
|
let used = false;
|
|
48366
|
-
const callback = new Promise((
|
|
48367
|
-
receive =
|
|
48620
|
+
const callback = new Promise((resolve17, reject) => {
|
|
48621
|
+
receive = resolve17;
|
|
48368
48622
|
fail = reject;
|
|
48369
48623
|
});
|
|
48370
48624
|
void callback.catch(() => {
|
|
@@ -48402,9 +48656,9 @@ async function youtubeLogin(options) {
|
|
|
48402
48656
|
response.end("Authorization received. Return to your AnimaGuru terminal.");
|
|
48403
48657
|
receive(code);
|
|
48404
48658
|
});
|
|
48405
|
-
await new Promise((
|
|
48659
|
+
await new Promise((resolve17, reject) => {
|
|
48406
48660
|
server.once("error", reject);
|
|
48407
|
-
server.listen(0, "127.0.0.1",
|
|
48661
|
+
server.listen(0, "127.0.0.1", resolve17);
|
|
48408
48662
|
});
|
|
48409
48663
|
const address = server.address();
|
|
48410
48664
|
if (!address || typeof address === "string") throw new Error("Cannot open the local YouTube authorization listener.");
|
|
@@ -48439,7 +48693,7 @@ async function youtubeLogin(options) {
|
|
|
48439
48693
|
clearTimeout(timer);
|
|
48440
48694
|
options.signal?.removeEventListener("abort", abort);
|
|
48441
48695
|
server.closeAllConnections();
|
|
48442
|
-
await new Promise((
|
|
48696
|
+
await new Promise((resolve17) => server.close(() => resolve17()));
|
|
48443
48697
|
}
|
|
48444
48698
|
});
|
|
48445
48699
|
}
|
|
@@ -48451,7 +48705,7 @@ async function youtubeStatus(options = {}) {
|
|
|
48451
48705
|
});
|
|
48452
48706
|
}
|
|
48453
48707
|
async function youtubeLogout(options) {
|
|
48454
|
-
|
|
48708
|
+
refuseInAnimator();
|
|
48455
48709
|
if (!options.yes) throw new Error("Pass --yes to revoke YouTube authorization and remove local credentials and upload receipts.");
|
|
48456
48710
|
return withYouTubeLock(async () => {
|
|
48457
48711
|
let credentials = null;
|
|
@@ -48720,6 +48974,7 @@ async function transfer(credentials, job, source, options) {
|
|
|
48720
48974
|
}
|
|
48721
48975
|
}
|
|
48722
48976
|
async function uploadYouTube(options) {
|
|
48977
|
+
refuseInAnimator();
|
|
48723
48978
|
if (!options.yes && !options["dry-run"]) throw new Error("Pass --yes to authorize the YouTube upload, or --dry-run to inspect it locally.");
|
|
48724
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.");
|
|
48725
48980
|
const root = resolve11(options.directory ?? ".");
|
|
@@ -48760,12 +49015,8 @@ async function uploadYouTube(options) {
|
|
|
48760
49015
|
return { ...await finishUpload(credentials, previous, options), alreadyUploaded: true };
|
|
48761
49016
|
}
|
|
48762
49017
|
await source.check();
|
|
48763
|
-
if (cloudYouTube()) {
|
|
48764
|
-
await stageCloudVideo({ dir: root, file: file2, sha256: source.sha256, size: source.bytes, signal: options.signal, log: options.log });
|
|
48765
|
-
await source.check();
|
|
48766
|
-
}
|
|
48767
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`);
|
|
48768
|
-
const response = await youtubeRequest(credentials, "https://www.googleapis.com/upload/youtube/v3/videos?uploadType=resumable&part=snippet,status¬ifySubscribers=false", { method: "POST", headers: { "Content-Type": "application/json; charset=UTF-8", "X-Upload-Content-Length": String(source.bytes), "X-Upload-Content-Type": "video/mp4"
|
|
49019
|
+
const response = await youtubeRequest(credentials, "https://www.googleapis.com/upload/youtube/v3/videos?uploadType=resumable&part=snippet,status¬ifySubscribers=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);
|
|
48769
49020
|
const location = response.headers.get("Location");
|
|
48770
49021
|
await response.body?.cancel();
|
|
48771
49022
|
if (!location) throw new YouTubeError("Google did not return an upload session. No video bytes were sent.");
|
|
@@ -49318,6 +49569,234 @@ async function downloadBrand(client, id2, output2, flags = {}) {
|
|
|
49318
49569
|
return { id: brand.id, name: brand.name, files: written };
|
|
49319
49570
|
}
|
|
49320
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
|
+
|
|
49321
49800
|
// cli/src/commands.ts
|
|
49322
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)];
|
|
49323
49802
|
var assetAuthorizationFlags = [
|
|
@@ -49368,12 +49847,12 @@ var workspaceQuery = async (client) => {
|
|
|
49368
49847
|
async function openBrowser(url3) {
|
|
49369
49848
|
const command = process.platform === "darwin" ? "open" : process.platform === "win32" ? "rundll32" : "xdg-open";
|
|
49370
49849
|
const args = process.platform === "win32" ? ["url.dll,FileProtocolHandler", url3] : [url3];
|
|
49371
|
-
await new Promise((
|
|
49850
|
+
await new Promise((resolve17) => {
|
|
49372
49851
|
const child = spawn3(command, args, { stdio: "ignore", detached: true });
|
|
49373
|
-
child.once("error", () =>
|
|
49852
|
+
child.once("error", () => resolve17());
|
|
49374
49853
|
child.once("spawn", () => {
|
|
49375
49854
|
child.unref();
|
|
49376
|
-
|
|
49855
|
+
resolve17();
|
|
49377
49856
|
});
|
|
49378
49857
|
});
|
|
49379
49858
|
}
|
|
@@ -49399,12 +49878,37 @@ function createCli() {
|
|
|
49399
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" },
|
|
49400
49879
|
{ name: "yes", type: "boolean", description: "Authorize sending this video, its subtitles and thumbnail to the selected channel and privacy; confirm upload rights" },
|
|
49401
49880
|
{ name: "dry-run", type: "boolean", description: "Inspect MP4 and metadata locally without Google authorization or network calls" }
|
|
49402
|
-
).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("
|
|
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 }) => {
|
|
49403
49906
|
if (!args.name) throw new Error("Use animaguru create workspace NAME, or animaguru create animation NAME inside a workspace.");
|
|
49404
49907
|
out(stdout, await createVideoProject({ directory: args.name, log: stderr, signal }));
|
|
49405
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(
|
|
49406
49909
|
{ name: "url", type: "string", default: "https://animaguru.com", env: { name: "ANIMAGURU_URL" } },
|
|
49407
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" },
|
|
49408
49912
|
{ name: "file", type: "string", description: "Exported HTML5 ZIP or MP4; otherwise builds the project's HTML5 export" },
|
|
49409
49913
|
{ name: "title", type: "string" },
|
|
49410
49914
|
{ name: "description", type: "string" },
|
|
@@ -49567,21 +50071,35 @@ Confirm code: ${device.user_code}`);
|
|
|
49567
50071
|
})))).command("assets", (assets) => assets.add(defineCommand("list", { description: "List saved assets, their blob hashes, and configured generation models" }, (command) => command.flags({ name: "url", type: "string", default: "https://animaguru.com", env: { name: "ANIMAGURU_URL" } }).args(id).action(async ({ args, flags, stdout, signal }) => out(stdout, await new Client(flags.url, signal).request(`${projectPath(args.id)}/assets`))))).add(defineCommand("generate", { description: "Generate an image, video, music, speech or sound-effect asset; --yes authorizes credits" }, (command) => command.flags({ name: "url", type: "string", default: "https://animaguru.com", env: { name: "ANIMAGURU_URL" } }).args(id).flags(
|
|
49568
50072
|
{ name: "type", type: "string", required: true, choices: ASSET_TYPES },
|
|
49569
50073
|
{ name: "name", type: "string", required: true },
|
|
49570
|
-
{ name: "prompt", type: "string",
|
|
50074
|
+
{ name: "prompt", type: "string", description: "Description to generate, or verbatim transcript for speech; video lip-sync and relight take none, and camera-controls, insert-video, recast and 3d-to-video may leave it out" },
|
|
49571
50075
|
{ name: "model", type: "string", choices: assetModelIds, description: "Model for the chosen asset type" },
|
|
49572
|
-
{ name: "aspect-ratio", type: "string", choices: [.../* @__PURE__ */ new Set([...IMAGE_ASPECT_RATIOS, "auto", ...VIDEO_ASPECT_RATIOS])], description: "Image: 1:1 (default), 3:2, 2:3, 16:9 or 9:16; a masked edit keeps Image 1's shape. Video from text: 21:9\u20139:16 (default 16:9). Extension: auto (default, the
|
|
50076
|
+
{ name: "aspect-ratio", type: "string", choices: [.../* @__PURE__ */ new Set([...IMAGE_ASPECT_RATIOS, "auto", ...VIDEO_ASPECT_RATIOS])], description: "Image: 1:1 (default), 3:2, 2:3, 16:9 or 9:16; a masked edit keeps Image 1's shape. Video from text or a style without --reference: 21:9\u20139:16 (default 16:9). Extension, reference-to-video and relight: auto (default, the inputs' shape) or a ratio to crop to" },
|
|
49573
50077
|
{ name: "transparent", type: "boolean", description: "Image: transparent background" },
|
|
49574
|
-
{ name: "references", type: "string", description: "
|
|
50078
|
+
{ name: "references", type: "string", description: "Comma-separated blob SHAs of this project's images or sprite art, named Image 1, Image 2\u2026 in the prompt. Image: up to 4 to follow, such as a character sheet. Video: subjects or looks to keep (reference-to-video and insert-video up to 9, 3d-to-video up to 8), or recast's new people, one photo each (up to 4)" },
|
|
49575
50079
|
{ name: "mask", type: "string", description: "Image: edit only these rectangles of Image 1 (the first --references image), as x,y,width,height fractions of its size from the top left, up to 8 separated by semicolons; the rest is kept" },
|
|
49576
|
-
{ name: "workflow", type: "string", choices: VIDEO_WORKFLOWS, description: "Video: image-to-video (default), text-to-video or extend-video, as the model's videoProfiles allow" },
|
|
49577
|
-
{ name: "reference", type: "string", description: "Video: starting image blob SHA from this project's assets or sprites" },
|
|
50080
|
+
{ name: "workflow", type: "string", choices: VIDEO_WORKFLOWS, description: "Video: image-to-video (default), text-to-video or extend-video; H3 Max also reference-to-video, lip-sync, camera-controls, insert-video, recast, relight, 3d-to-video and style, as the model's videoProfiles allow" },
|
|
50081
|
+
{ name: "reference", type: "string", description: "Video: starting image blob SHA from this project's assets or sprites; the speaking face for lip-sync, the image the camera moves around for camera-controls" },
|
|
49578
50082
|
{ name: "end-reference", type: "string", description: "Video: ending image blob SHA; models with endFrameOnly accept it without --reference" },
|
|
49579
|
-
{ name: "
|
|
49580
|
-
{ name: "
|
|
49581
|
-
{ name: "
|
|
49582
|
-
{ name: "
|
|
49583
|
-
{ name: "
|
|
49584
|
-
{ name: "
|
|
50083
|
+
{ name: "middle-reference", type: "string", description: "Reference-to-video: image blob SHA reached at --middle-seconds; needs --reference and --end-reference, 480p or 768p" },
|
|
50084
|
+
{ name: "middle-seconds", type: "number", description: "Reference-to-video: when the middle image is reached, in seconds" },
|
|
50085
|
+
{ name: "source", type: "string", description: "Blob SHA of a video asset in this project: the clip to extend, insert a scene into, recast or relight, or the 3D render 3d-to-video turns into footage" },
|
|
50086
|
+
{ name: "soundtrack", type: "string", description: "Video from an image or text: blob SHA of a music, speech or SFX asset pinned as the soundtrack (2 s or longer). Lip-sync: the speech to say (5 s\u201315 min), which sets the length" },
|
|
50087
|
+
{ name: "audio-references", type: "string", description: "Extension or reference-to-video: up to 3 comma-separated audio asset blob SHAs (2\u201315 s each, 15 s total) guiding the sound; refer to them as Audio 1, Audio 2\u2026 in the prompt" },
|
|
50088
|
+
{ name: "reference-videos", type: "string", description: "Reference-to-video or insert-video: up to 3 comma-separated video asset blob SHAs (2\u201315 s each, 15 s total) guiding motion, named Video 1, Video 2\u2026 in the prompt" },
|
|
50089
|
+
{ name: "camera", type: "string", description: 'Camera-controls: 2\u201312 keyframes time,azimuth,elevation,distance (time 0\u20131, angles in degrees, elevation \u221290\u201390) separated by semicolons, e.g. "0,0,0,1;1,90,15,1.2"' },
|
|
50090
|
+
{ name: "insert-at", type: "number", description: "Insert-video: seconds into --source where the new scene starts (1.625\u201360)" },
|
|
50091
|
+
{ name: "resume-at", type: "number", description: "Insert-video: seconds into --source where it resumes after the scene" },
|
|
50092
|
+
{ name: "color-match", type: "boolean", description: "Insert-video: match the scene's colors to the source (default on; --no-color-match turns it off)" },
|
|
50093
|
+
{ name: "transcribe", type: "boolean", description: "Lip-sync: transcribe the speech to guide the mouth" },
|
|
50094
|
+
{ name: "enhance-realism", type: "boolean", description: "Recast: more natural skin and blending of the new people" },
|
|
50095
|
+
{ name: "subject-consent", type: "boolean", description: "Recast: confirm that each person in the --references photos agreed to appear in the video" },
|
|
50096
|
+
{ name: "lighting", type: "string", description: "Relight: blob SHA of an image of a sphere lit as the video should be" },
|
|
50097
|
+
{ name: "generated-references", type: "number", description: "3d-to-video without --references: how many reference images it may draw, 1\u20138 (default 2)" },
|
|
50098
|
+
{ name: "style", type: "string", choices: VIDEO_STYLES, description: "Style workflow: the preset look, at 768p for 5\u201315 whole seconds" },
|
|
50099
|
+
{ name: "damage", type: "string", choices: VHS_DAMAGE_LEVELS, description: "VHS style: tape damage (fal's default medium)" },
|
|
50100
|
+
{ name: "seconds", type: "number", description: "Video or SFX duration in seconds (default 5); H3 takes fractions (6.5); extensions add this many seconds, insert-video's scene is 5\u201313; lip-sync, recast, relight and 3d-to-video take their input's length; SFX supports 0.5\u201330" },
|
|
50101
|
+
{ name: "resolution", type: "string", choices: VIDEO_RESOLUTIONS, description: "Video resolution supported by the selected model and workflow (default its first)" },
|
|
50102
|
+
{ name: "mode", type: "string", choices: ["cost", "speed", "quality"], description: "Video generation mode supported by the selected model (default its first)" },
|
|
49585
50103
|
{ name: "prompt-expansion", type: "string", choices: PROMPT_EXPANSION_MODES, description: "Video: how much the model may rewrite the prompt (default disabled); extensions treat any other value as on" },
|
|
49586
50104
|
{ name: "seed", type: "number", description: "Video: seed for repeatable results, where the model takes one" },
|
|
49587
50105
|
{ name: "extend-output", type: "string", choices: EXTEND_OUTPUTS, description: "Extension: extended (default, source plus new footage) or continuation (a 1.625 s overlap, then the new footage)" },
|
|
@@ -49634,7 +50152,7 @@ Confirm code: ${device.user_code}`);
|
|
|
49634
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" }));
|
|
49635
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 }) => {
|
|
49636
50154
|
if (!flags.yes) throw new Error("Pass --yes to authorize spending credits.");
|
|
49637
|
-
const body = spriteJobBody.parse({ ...JSON.parse(await
|
|
50155
|
+
const body = spriteJobBody.parse({ ...JSON.parse(await readFile18(flags.file, "utf8")), ...selectedModels(flags) });
|
|
49638
50156
|
out(stdout, await new Client(flags.url, signal).request(`${projectPath(args.id)}/jobs`, { method: "POST", body }));
|
|
49639
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 }) => {
|
|
49640
50158
|
const body = selectedModels(flags);
|
|
@@ -49649,7 +50167,7 @@ Confirm code: ${device.user_code}`);
|
|
|
49649
50167
|
const extension = flags.file.split(".").at(-1)?.toLowerCase();
|
|
49650
50168
|
const type = extension === "png" ? "image/png" : extension === "jpg" || extension === "jpeg" ? "image/jpeg" : extension === "webp" ? "image/webp" : void 0;
|
|
49651
50169
|
if (!type) throw new Error("Use a PNG, JPEG or WebP image.");
|
|
49652
|
-
const bytes = await
|
|
50170
|
+
const bytes = await readFile18(flags.file);
|
|
49653
50171
|
if (bytes.length > 10 * 1024 * 1024) throw new Error("Image must be at most 10 MB.");
|
|
49654
50172
|
const form = new FormData();
|
|
49655
50173
|
form.set("image", new Blob([bytes], { type }), `reference.${extension}`);
|
|
@@ -49665,10 +50183,10 @@ Confirm code: ${device.user_code}`);
|
|
|
49665
50183
|
if (!file2) throw new Error(`No file at ${args.path} in this project. List them with animaguru files list.`);
|
|
49666
50184
|
if (!/^[a-f0-9]{64}$/.test(file2.sha)) throw new Error("Invalid blob hash in manifest.");
|
|
49667
50185
|
const response = await client.request(`/api/v1/blobs/${encodeURIComponent(manifest.ownerId)}/${file2.sha}`, { raw: true });
|
|
49668
|
-
const path =
|
|
49669
|
-
await
|
|
50186
|
+
const path = resolve16(flags.output);
|
|
50187
|
+
await mkdir15(dirname14(path), { recursive: true });
|
|
49670
50188
|
const bytes = new Uint8Array(await response.arrayBuffer());
|
|
49671
|
-
await
|
|
50189
|
+
await writeFile16(path, bytes, { flag: "wx" });
|
|
49672
50190
|
out(stdout, { path, bytes: bytes.length });
|
|
49673
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 }) => {
|
|
49674
50192
|
const client = new Client(flags.url, signal);
|
|
@@ -49680,8 +50198,8 @@ Confirm code: ${device.user_code}`);
|
|
|
49680
50198
|
const response = await client.request(`/api/v1/blobs/${encodeURIComponent(manifest.ownerId)}/${file2.sha}`, { raw: true });
|
|
49681
50199
|
entries[path2] = new Uint8Array(await response.arrayBuffer());
|
|
49682
50200
|
}
|
|
49683
|
-
const path =
|
|
49684
|
-
await
|
|
50201
|
+
const path = resolve16(flags.output);
|
|
50202
|
+
await writeFile16(path, zipSync(entries, { level: 0 }), { flag: "wx" });
|
|
49685
50203
|
out(stdout, { path, files: manifest.files.length });
|
|
49686
50204
|
})))).extend(version(package_default.version, { format: "plain" })).extend(help()).extend(completion());
|
|
49687
50205
|
}
|