@docyrus/animaguru 0.31.0 → 0.32.1
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 +14 -1
- package/dist/animaguru.js +364 -266
- package/package.json +1 -1
- package/skills/animaguru/SKILL.md +1 -1
- package/templates/video/README.md +1 -1
- package/templates/video/scripts/audio-vo.mjs +24 -13
- package/templates/video/scripts/export-mp4.mjs +1 -1
package/dist/animaguru.js
CHANGED
|
@@ -7943,9 +7943,9 @@ If you're a developer and you believe this is a bug in isomorphic-git, please fi
|
|
|
7943
7943
|
`Invalid checksum in GitIndex buffer: expected ${shaClaimed} but saw ${shaComputed}`
|
|
7944
7944
|
);
|
|
7945
7945
|
}
|
|
7946
|
-
const
|
|
7947
|
-
if (
|
|
7948
|
-
throw new InternalError(`Unsupported dircache version: ${
|
|
7946
|
+
const version5 = reader.readUInt32BE();
|
|
7947
|
+
if (version5 !== 2) {
|
|
7948
|
+
throw new InternalError(`Unsupported dircache version: ${version5}`);
|
|
7949
7949
|
}
|
|
7950
7950
|
const numEntries = reader.readUInt32BE();
|
|
7951
7951
|
let i2 = 0;
|
|
@@ -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 stat13 = normalizeStats(entry);
|
|
8087
|
+
writer.writeUInt32BE(stat13.ctimeSeconds);
|
|
8088
|
+
writer.writeUInt32BE(stat13.ctimeNanoseconds);
|
|
8089
|
+
writer.writeUInt32BE(stat13.mtimeSeconds);
|
|
8090
|
+
writer.writeUInt32BE(stat13.mtimeNanoseconds);
|
|
8091
|
+
writer.writeUInt32BE(stat13.dev);
|
|
8092
|
+
writer.writeUInt32BE(stat13.ino);
|
|
8093
|
+
writer.writeUInt32BE(stat13.mode);
|
|
8094
|
+
writer.writeUInt32BE(stat13.uid);
|
|
8095
|
+
writer.writeUInt32BE(stat13.gid);
|
|
8096
|
+
writer.writeUInt32BE(stat13.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 [stat13, 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, stat13);
|
|
8155
8155
|
}
|
|
8156
8156
|
async function isIndexStale(fs2, filepath, cache) {
|
|
8157
8157
|
const savedStats = cache.stats.get(filepath);
|
|
@@ -8208,7 +8208,7 @@ If you're a developer and you believe this is a bug in isomorphic-git, please fi
|
|
|
8208
8208
|
}
|
|
8209
8209
|
return path;
|
|
8210
8210
|
}
|
|
8211
|
-
function
|
|
8211
|
+
function dirname17(path) {
|
|
8212
8212
|
const last = Math.max(path.lastIndexOf("/"), path.lastIndexOf("\\"));
|
|
8213
8213
|
if (last === -1) return ".";
|
|
8214
8214
|
if (last === 0) return "/";
|
|
@@ -8216,7 +8216,7 @@ 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 mkdir18 = function(name2) {
|
|
8220
8220
|
if (!inodes.has(name2)) {
|
|
8221
8221
|
const dir = {
|
|
8222
8222
|
type: "tree",
|
|
@@ -8226,7 +8226,7 @@ If you're a developer and you believe this is a bug in isomorphic-git, please fi
|
|
|
8226
8226
|
children: []
|
|
8227
8227
|
};
|
|
8228
8228
|
inodes.set(name2, dir);
|
|
8229
|
-
dir.parent =
|
|
8229
|
+
dir.parent = mkdir18(dirname17(name2));
|
|
8230
8230
|
if (dir.parent && dir.parent !== dir) dir.parent.children.push(dir);
|
|
8231
8231
|
}
|
|
8232
8232
|
return inodes.get(name2);
|
|
@@ -8239,7 +8239,7 @@ If you're a developer and you believe this is a bug in isomorphic-git, please fi
|
|
|
8239
8239
|
basename: basename8(name2),
|
|
8240
8240
|
metadata,
|
|
8241
8241
|
// This recursively generates any missing parent folders.
|
|
8242
|
-
parent:
|
|
8242
|
+
parent: mkdir18(dirname17(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
|
+
mkdir18(".");
|
|
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 join21(...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(join21(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(join21(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(join21(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(join21(gitdir, ref))));
|
|
9125
9125
|
let text2 = await acquireLock(
|
|
9126
9126
|
"packed-refs",
|
|
9127
9127
|
async () => fs2.read(`${gitdir}/packed-refs`, { encoding: "utf8" })
|
|
@@ -9785,10 +9785,10 @@ If you're a developer and you believe this is a bug in isomorphic-git, please fi
|
|
|
9785
9785
|
if (PACK !== "PACK") {
|
|
9786
9786
|
throw new InternalError(`Invalid PACK header '${PACK}'`);
|
|
9787
9787
|
}
|
|
9788
|
-
let
|
|
9789
|
-
|
|
9790
|
-
if (
|
|
9791
|
-
throw new InternalError(`Invalid packfile version: ${
|
|
9788
|
+
let version5 = await reader.read(4);
|
|
9789
|
+
version5 = version5.readUInt32BE(0);
|
|
9790
|
+
if (version5 !== 2) {
|
|
9791
|
+
throw new InternalError(`Invalid packfile version: ${version5}`);
|
|
9792
9792
|
}
|
|
9793
9793
|
let numObjects = await reader.read(4);
|
|
9794
9794
|
numObjects = numObjects.readUInt32BE(0);
|
|
@@ -9912,10 +9912,10 @@ If you're a developer and you believe this is a bug in isomorphic-git, please fi
|
|
|
9912
9912
|
if (magic !== "ff744f63") {
|
|
9913
9913
|
return;
|
|
9914
9914
|
}
|
|
9915
|
-
const
|
|
9916
|
-
if (
|
|
9915
|
+
const version5 = reader.readUInt32BE();
|
|
9916
|
+
if (version5 !== 2) {
|
|
9917
9917
|
throw new InternalError(
|
|
9918
|
-
`Unable to read version ${
|
|
9918
|
+
`Unable to read version ${version5} packfile IDX. (Only version 2 supported)`
|
|
9919
9919
|
);
|
|
9920
9920
|
}
|
|
9921
9921
|
if (idx.byteLength > 2048 * 1024 * 1024) {
|
|
@@ -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(join21(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(join21(filepath, entry2.path), entry2);
|
|
11069
11069
|
}
|
|
11070
|
-
return tree.entries().map((entry2) =>
|
|
11070
|
+
return tree.entries().map((entry2) => join21(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(join21(dir, filepath));
|
|
11164
11164
|
if (names === null) return null;
|
|
11165
|
-
return names.map((name2) =>
|
|
11165
|
+
return names.map((name2) => join21(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 stat13 = await fs2.lstat(`${dir}/${entry._fullpath}`);
|
|
11183
|
+
if (!stat13) {
|
|
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 = stat13.isDirectory() ? "tree" : "blob";
|
|
11189
|
+
if (type === "blob" && !stat13.isFile() && !stat13.isSymbolicLink()) {
|
|
11190
11190
|
type = "special";
|
|
11191
11191
|
}
|
|
11192
11192
|
entry._type = type;
|
|
11193
|
-
|
|
11194
|
-
entry._mode =
|
|
11195
|
-
if (
|
|
11196
|
-
|
|
11193
|
+
stat13 = normalizeStats(stat13);
|
|
11194
|
+
entry._mode = stat13.mode;
|
|
11195
|
+
if (stat13.size === -1 && entry._actualSize) {
|
|
11196
|
+
stat13.size = entry._actualSize;
|
|
11197
11197
|
}
|
|
11198
|
-
entry._stat =
|
|
11198
|
+
entry._stat = stat13;
|
|
11199
11199
|
}
|
|
11200
11200
|
return entry._stat;
|
|
11201
11201
|
}
|
|
@@ -11383,19 +11383,19 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
|
|
|
11383
11383
|
};
|
|
11384
11384
|
return walk2(root);
|
|
11385
11385
|
}
|
|
11386
|
-
async function mkdirp(
|
|
11386
|
+
async function mkdirp(mkdir18, filepath, retries = 10) {
|
|
11387
11387
|
try {
|
|
11388
|
-
await
|
|
11388
|
+
await mkdir18(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 = dirname17(filepath);
|
|
11394
11394
|
if (parent === "." || parent === "/" || parent === filepath) throw err2;
|
|
11395
|
-
await mkdirp(
|
|
11395
|
+
await mkdirp(mkdir18, parent, retries);
|
|
11396
11396
|
for (let attempt = 0; ; attempt++) {
|
|
11397
11397
|
try {
|
|
11398
|
-
await
|
|
11398
|
+
await mkdir18(filepath);
|
|
11399
11399
|
return;
|
|
11400
11400
|
} catch (err22) {
|
|
11401
11401
|
if (err22 === null || err22.code === "EEXIST") return;
|
|
@@ -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 = join21(filepath, entry);
|
|
11419
|
+
return fs2.lstat(subpath).then((stat13) => {
|
|
11420
|
+
if (!stat13) return;
|
|
11421
|
+
return stat13.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(dirname17(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 = join21(dirname17(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 = join21(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 =
|
|
11806
|
+
static async isIgnored({ fs: fs2, dir, gitdir = join21(dir, ".git"), filepath }) {
|
|
11807
11807
|
if (basename8(filepath) === ".git") return true;
|
|
11808
11808
|
if (filepath === ".") return false;
|
|
11809
11809
|
let excludes = "";
|
|
11810
|
-
const excludesFile =
|
|
11810
|
+
const excludesFile = join21(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: join21(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: join21(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 = dirname17(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 = join21(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(join21(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(join21(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: [join21(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: [join21(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(join21(dir, currentFilepath)).then(posixifyPathBuffer) : await fs2.read(join21(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 = join21(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 = join21(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 = join21(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 = join21(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 = join21(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 = join21(dir, ".git"),
|
|
13410
13410
|
index: index3,
|
|
13411
13411
|
ourOid,
|
|
13412
13412
|
baseOid,
|
|
@@ -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 = join21(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(join21(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 = join21(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 = join21(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 = join21(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 = join21(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(join21(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}`;
|
|
@@ -14590,9 +14590,9 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
|
|
|
14590
14590
|
}
|
|
14591
14591
|
function emptyPackfile(pack) {
|
|
14592
14592
|
const pheader = "5041434b";
|
|
14593
|
-
const
|
|
14593
|
+
const version5 = "00000002";
|
|
14594
14594
|
const obCount = "00000000";
|
|
14595
|
-
const header = pheader +
|
|
14595
|
+
const header = pheader + version5 + obCount;
|
|
14596
14596
|
return pack.slice(0, 12).toString("hex") === header;
|
|
14597
14597
|
}
|
|
14598
14598
|
function filterCapabilities(server, client) {
|
|
@@ -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 = join21(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 : join21(dir, ".git"),
|
|
15155
15155
|
defaultBranch = "master"
|
|
15156
15156
|
}) {
|
|
15157
15157
|
if (await fs2.exists(gitdir + "/config")) return;
|
|
@@ -15265,7 +15265,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
|
|
|
15265
15265
|
onAuthFailure,
|
|
15266
15266
|
onPostCheckout,
|
|
15267
15267
|
dir,
|
|
15268
|
-
gitdir =
|
|
15268
|
+
gitdir = join21(dir, ".git"),
|
|
15269
15269
|
url: url3,
|
|
15270
15270
|
corsProxy = void 0,
|
|
15271
15271
|
ref = void 0,
|
|
@@ -15328,7 +15328,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
|
|
|
15328
15328
|
fs: _fs,
|
|
15329
15329
|
onSign,
|
|
15330
15330
|
dir,
|
|
15331
|
-
gitdir =
|
|
15331
|
+
gitdir = join21(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 = join21(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 = join21(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 = join21(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 = join21(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 = join21(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(join21(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 = join21(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 = join21(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 = join21(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 = join21(dir, ".git"),
|
|
15924
15924
|
ref,
|
|
15925
15925
|
remote,
|
|
15926
15926
|
remoteRef,
|
|
@@ -15976,7 +15976,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
|
|
|
15976
15976
|
async function findMergeBase({
|
|
15977
15977
|
fs: fs2,
|
|
15978
15978
|
dir,
|
|
15979
|
-
gitdir =
|
|
15979
|
+
gitdir = join21(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(join21(filepath, ".git"))) {
|
|
16002
16002
|
return filepath;
|
|
16003
16003
|
} else {
|
|
16004
|
-
const parent =
|
|
16004
|
+
const parent = dirname17(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 = join21(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 = join21(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 = join21(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 = join21(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 : join21(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 = join21(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 = join21(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 = join21(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: join21(prefix, entry.path)
|
|
16468
16468
|
});
|
|
16469
16469
|
} else {
|
|
16470
|
-
filenames.push(
|
|
16470
|
+
filenames.push(join21(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 = join21(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 = join21(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 = join21(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 = join21(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 = join21(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 = join21(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: join21(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 = join21(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 = join21(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 = join21(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(join21(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 = join21(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 = join21(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 = join21(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 = join21(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 = join21(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 = join21(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 = join21(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 = join21(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 = join21(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 = join21(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 = join21(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 = join21(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 = join21(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 = join21(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 = join21(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(join21(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(join21(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 = join21(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 = join21(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 = join21(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 join21(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 join21(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 = join21(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) => join21(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 = join21(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(join21(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(join21(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 dirname18 = path.shift();
|
|
18700
18700
|
for (const entry of tree) {
|
|
18701
|
-
if (entry.path ===
|
|
18701
|
+
if (entry.path === dirname18) {
|
|
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 = join21(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 = join21(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 = join21(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(join21(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(join21(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(join21(dir, filepath)) : await fs2.read(join21(dir, filepath));
|
|
18906
18906
|
oid = await _writeObject({
|
|
18907
18907
|
fs: fs2,
|
|
18908
18908
|
gitdir: updatedGitdir,
|
|
@@ -18935,7 +18935,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
|
|
|
18935
18935
|
throw err2;
|
|
18936
18936
|
}
|
|
18937
18937
|
}
|
|
18938
|
-
function
|
|
18938
|
+
function version4() {
|
|
18939
18939
|
try {
|
|
18940
18940
|
return pkg.version;
|
|
18941
18941
|
} catch (err2) {
|
|
@@ -18946,7 +18946,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
|
|
|
18946
18946
|
async function walk({
|
|
18947
18947
|
fs: fs2,
|
|
18948
18948
|
dir,
|
|
18949
|
-
gitdir =
|
|
18949
|
+
gitdir = join21(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 = join21(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 = join21(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 = join21(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 = join21(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 = join21(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 = join21(dir, ".git"), tree }) {
|
|
19140
19140
|
try {
|
|
19141
19141
|
assertParameter("fs", fs2);
|
|
19142
19142
|
assertParameter("gitdir", gitdir);
|
|
@@ -19216,7 +19216,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
|
|
|
19216
19216
|
status,
|
|
19217
19217
|
statusMatrix,
|
|
19218
19218
|
tag,
|
|
19219
|
-
version:
|
|
19219
|
+
version: version4,
|
|
19220
19220
|
walk,
|
|
19221
19221
|
writeBlob,
|
|
19222
19222
|
writeCommit,
|
|
@@ -19290,7 +19290,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
|
|
|
19290
19290
|
exports.statusMatrix = statusMatrix;
|
|
19291
19291
|
exports.tag = tag;
|
|
19292
19292
|
exports.updateIndex = updateIndex$1;
|
|
19293
|
-
exports.version =
|
|
19293
|
+
exports.version = version4;
|
|
19294
19294
|
exports.walk = walk;
|
|
19295
19295
|
exports.writeBlob = writeBlob;
|
|
19296
19296
|
exports.writeCommit = writeCommit;
|
|
@@ -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.32.1",
|
|
19765
19765
|
description: "Agent-friendly AnimaGuru CLI built with CrustJS",
|
|
19766
19766
|
type: "module",
|
|
19767
19767
|
bin: {
|
|
@@ -23175,7 +23175,7 @@ function valueFlagWordlist(node2) {
|
|
|
23175
23175
|
}
|
|
23176
23176
|
return words2.join(" ");
|
|
23177
23177
|
}
|
|
23178
|
-
function renderBash(spec, binName,
|
|
23178
|
+
function renderBash(spec, binName, version4, command = "completion") {
|
|
23179
23179
|
const ident = toShellIdent(binName);
|
|
23180
23180
|
const fnName = `_${ident}`;
|
|
23181
23181
|
const initFn = `__${ident}_init_completion`;
|
|
@@ -23206,7 +23206,7 @@ function renderBash(spec, binName, version3, command = "completion") {
|
|
|
23206
23206
|
}
|
|
23207
23207
|
lines.push(`${indent}esac`);
|
|
23208
23208
|
};
|
|
23209
|
-
lines.push(`# completion script for ${binName} v${
|
|
23209
|
+
lines.push(`# completion script for ${binName} v${version4} \u2014 regenerate with: ${binName} ${command} bash`);
|
|
23210
23210
|
lines.push("");
|
|
23211
23211
|
lines.push(`${initFn}() {`);
|
|
23212
23212
|
lines.push(" COMPREPLY=()");
|
|
@@ -23599,10 +23599,10 @@ function emitPosHelper(ident) {
|
|
|
23599
23599
|
lines.push("end");
|
|
23600
23600
|
return lines;
|
|
23601
23601
|
}
|
|
23602
|
-
function renderFish(spec, binName,
|
|
23602
|
+
function renderFish(spec, binName, version4, command = "completion") {
|
|
23603
23603
|
const ident = toShellIdent(binName);
|
|
23604
23604
|
const lines = [];
|
|
23605
|
-
lines.push(`# completion script for ${binName} v${
|
|
23605
|
+
lines.push(`# completion script for ${binName} v${version4} \u2014 regenerate with: ${binName} ${command} fish`);
|
|
23606
23606
|
lines.push("");
|
|
23607
23607
|
lines.push(...emitFlagScopeHelpers(ident, spec));
|
|
23608
23608
|
lines.push(...emitPosHelper(ident));
|
|
@@ -23724,11 +23724,11 @@ function renderHelper(rootIdent, path, node2, out2) {
|
|
|
23724
23724
|
out2.push("");
|
|
23725
23725
|
for (const sub of node2.subCommands) renderHelper(rootIdent, [...path, sub.name], sub, out2);
|
|
23726
23726
|
}
|
|
23727
|
-
function renderZsh(spec, binName,
|
|
23727
|
+
function renderZsh(spec, binName, version4, command = "completion") {
|
|
23728
23728
|
const ident = toShellIdent(binName);
|
|
23729
23729
|
const lines = [];
|
|
23730
23730
|
lines.push(`#compdef ${binName}`);
|
|
23731
|
-
lines.push(`# completion script for ${binName} v${
|
|
23731
|
+
lines.push(`# completion script for ${binName} v${version4} \u2014 regenerate with: ${binName} ${command} zsh`);
|
|
23732
23732
|
lines.push("");
|
|
23733
23733
|
const helpers = [];
|
|
23734
23734
|
renderHelper(ident, [], spec, helpers);
|
|
@@ -23844,25 +23844,25 @@ var SHELL_RENDERERS = {
|
|
|
23844
23844
|
};
|
|
23845
23845
|
function prepareRender(root, options) {
|
|
23846
23846
|
const binName = assertSafeBinName(root.meta.name);
|
|
23847
|
-
const
|
|
23848
|
-
if (
|
|
23847
|
+
const version4 = options.version ?? root.meta.version;
|
|
23848
|
+
if (version4 === void 0) throw new CrustError("DEFINITION", "The completion extension requires a version in new Crust(name, { version }) or completion({ version })");
|
|
23849
23849
|
return {
|
|
23850
23850
|
spec: walkCommand(buildCommandDocumentation(root)),
|
|
23851
23851
|
binName,
|
|
23852
|
-
version: sanitizeFreeText(
|
|
23852
|
+
version: sanitizeFreeText(version4),
|
|
23853
23853
|
command: options.command ?? "completion"
|
|
23854
23854
|
};
|
|
23855
23855
|
}
|
|
23856
23856
|
function renderCompletionFiles(root, options) {
|
|
23857
|
-
const { spec, binName, version:
|
|
23857
|
+
const { spec, binName, version: version4, command } = prepareRender(root, options);
|
|
23858
23858
|
return SUPPORTED_SHELLS.map((shell) => ({
|
|
23859
23859
|
path: filenameForShell(shell, binName),
|
|
23860
|
-
content: SHELL_RENDERERS[shell](spec, binName,
|
|
23860
|
+
content: SHELL_RENDERERS[shell](spec, binName, version4, command)
|
|
23861
23861
|
}));
|
|
23862
23862
|
}
|
|
23863
23863
|
function renderCompletionScript(shell, root, options = {}) {
|
|
23864
|
-
const { spec, binName, version:
|
|
23865
|
-
return SHELL_RENDERERS[shell](spec, binName,
|
|
23864
|
+
const { spec, binName, version: version4, command } = prepareRender(root, options);
|
|
23865
|
+
return SHELL_RENDERERS[shell](spec, binName, version4, command);
|
|
23866
23866
|
}
|
|
23867
23867
|
var completion = defineExtension(COMPLETION).factory((extension, options = {}) => {
|
|
23868
23868
|
const subcommandName = options.command ?? "completion";
|
|
@@ -24052,9 +24052,9 @@ var DEFAULT_INTERVAL_MS = 864e5;
|
|
|
24052
24052
|
var DEFAULT_TIMEOUT_MS = 5e3;
|
|
24053
24053
|
var DEFAULT_REGISTRY_URL = "https://registry.npmjs.org";
|
|
24054
24054
|
function compareSemver(left, right) {
|
|
24055
|
-
const parse4 = (
|
|
24056
|
-
const match = /^v?(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/.exec(
|
|
24057
|
-
if (!match) throw new TypeError(`Invalid semantic version: ${
|
|
24055
|
+
const parse4 = (version4) => {
|
|
24056
|
+
const match = /^v?(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/.exec(version4);
|
|
24057
|
+
if (!match) throw new TypeError(`Invalid semantic version: ${version4}`);
|
|
24058
24058
|
return {
|
|
24059
24059
|
core: match.slice(1, 4).map(Number),
|
|
24060
24060
|
prerelease: match[4]?.split(".") ?? []
|
|
@@ -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 mkdir17, readFile as readFile21, writeFile as writeFile17 } from "node:fs/promises";
|
|
24299
|
+
import { dirname as dirname16, resolve as resolve18 } from "node:path";
|
|
24300
24300
|
import { setTimeout as delay6 } from "node:timers/promises";
|
|
24301
24301
|
|
|
24302
24302
|
// node_modules/fflate/esm/index.mjs
|
|
@@ -27265,10 +27265,10 @@ function nanoidOfLength(length) {
|
|
|
27265
27265
|
var duration = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;
|
|
27266
27266
|
var extendedDuration = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/;
|
|
27267
27267
|
var guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;
|
|
27268
|
-
var uuid = (
|
|
27269
|
-
if (!
|
|
27268
|
+
var uuid = (version4) => {
|
|
27269
|
+
if (!version4)
|
|
27270
27270
|
return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;
|
|
27271
|
-
return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${
|
|
27271
|
+
return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version4}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);
|
|
27272
27272
|
};
|
|
27273
27273
|
var uuid4 = /* @__PURE__ */ uuid(4);
|
|
27274
27274
|
var uuid6 = /* @__PURE__ */ uuid(6);
|
|
@@ -44721,10 +44721,10 @@ function fromJSONSchema(schema, params) {
|
|
|
44721
44721
|
} catch {
|
|
44722
44722
|
throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas");
|
|
44723
44723
|
}
|
|
44724
|
-
const
|
|
44724
|
+
const version4 = detectVersion(normalized, params?.defaultTarget);
|
|
44725
44725
|
const defs = normalized.$defs || normalized.definitions || {};
|
|
44726
44726
|
const ctx = {
|
|
44727
|
-
version:
|
|
44727
|
+
version: version4,
|
|
44728
44728
|
defs,
|
|
44729
44729
|
refs: /* @__PURE__ */ new Map(),
|
|
44730
44730
|
processing: /* @__PURE__ */ new Set(),
|
|
@@ -46779,7 +46779,7 @@ async function createWorkspace(options, installer = installDependencies) {
|
|
|
46779
46779
|
if (message.startsWith("Creating")) options.log?.(`Creating a shared-brand workspace in ${resolve6(options.directory)}\u2026`);
|
|
46780
46780
|
} }, installer);
|
|
46781
46781
|
const directory = result.path;
|
|
46782
|
-
const { rm:
|
|
46782
|
+
const { rm: rm4 } = await import("node:fs/promises");
|
|
46783
46783
|
await rename3(join7(directory, "src"), join7(directory, "runtime"));
|
|
46784
46784
|
await mkdir7(join7(directory, "templates/animation/src"), { recursive: true });
|
|
46785
46785
|
await mkdir7(join7(directory, "templates/animation/shared/locales/en"), { recursive: true });
|
|
@@ -46787,14 +46787,14 @@ async function createWorkspace(options, installer = installDependencies) {
|
|
|
46787
46787
|
const original = await readFile5(join7(directory, "runtime", file2), "utf8");
|
|
46788
46788
|
const rewritten = original.replace('"./player-types"', '"../../../runtime/player-types"').replace('"./timeline-model"', '"../../../runtime/timeline-model"').replace('"./kit"', '"../../../runtime/kit"').replace('"../shared/locales/en/timeline.json"', '"../../../shared/locales/en/timeline.json"');
|
|
46789
46789
|
await writeFile6(join7(directory, "templates/animation/src", file2), rewritten);
|
|
46790
|
-
await
|
|
46790
|
+
await rm4(join7(directory, "runtime", file2));
|
|
46791
46791
|
}
|
|
46792
|
-
await
|
|
46792
|
+
await rm4(join7(directory, "runtime/main.ts"));
|
|
46793
46793
|
await rename3(join7(directory, "film.config.json"), join7(directory, "templates/animation/film.config.json"));
|
|
46794
46794
|
await rename3(join7(directory, "shared/locales/en/film.json"), join7(directory, "templates/animation/shared/locales/en/film.json"));
|
|
46795
|
-
const { createHash:
|
|
46796
|
-
await writeFile6(join7(directory, "templates/animation/starter-film.sha256"),
|
|
46797
|
-
await
|
|
46795
|
+
const { createHash: createHash8 } = await import("node:crypto");
|
|
46796
|
+
await writeFile6(join7(directory, "templates/animation/starter-film.sha256"), createHash8("sha256").update(await readFile5(join7(directory, "templates/animation/src/film.ts"))).digest("hex") + "\n");
|
|
46797
|
+
await rm4(join7(directory, "animaguru.project.json"));
|
|
46798
46798
|
await mkdir7(join7(directory, "animations"));
|
|
46799
46799
|
await mkdir7(join7(directory, "branding"));
|
|
46800
46800
|
await writeFile6(join7(directory, "branding/brand.json"), JSON.stringify({
|
|
@@ -46815,7 +46815,7 @@ async function createWorkspace(options, installer = installDependencies) {
|
|
|
46815
46815
|
await writeFile6(join7(directory, "tsconfig.json"), JSON.stringify(tsconfig, null, 2) + "\n");
|
|
46816
46816
|
await writeFile6(join7(directory, "AGENTS.md"), await readFile5(join7(packageRoot, "templates/video/WORKSPACE-AGENTS.md"), "utf8"));
|
|
46817
46817
|
await writeFile6(join7(directory, "CLAUDE.md"), "# AnimaGuru workspace\n\nRead AGENTS.md for the multi-animation workflow, shared branding and commands. Claude skills are in .claude/skills. For an incomplete shared kit, read .claude/skills/animaguru-brand-kit/SKILL.md and ask for the official website or brand guide if the user did not supply one. Select the animation folder before editing; reuse shared runtime/ and scripts/.\n");
|
|
46818
|
-
await
|
|
46818
|
+
await rm4(join7(directory, "WORKSPACE-AGENTS.md"), { force: true });
|
|
46819
46819
|
await writeFile6(join7(directory, "README.md"), "# Your AnimaGuru workspace\n\nOpen this root folder in Codex or Claude Code and describe a film. If you have an official website or brand guide, include it; otherwise the agent asks for it while setting up the shared branding/ kit. You can also provide local brand assets or proceed without a website. Create a film with animaguru create animation my-video.\n\nRun npm run dev for the workspace hub. Run npm run build -- --animation my-video, npm run export:html -- --animation my-video, or npm run export:mp4 -- --animation my-video. Player code, dependencies, skills and export tools are shared once; animation folders contain only their own production files.\n");
|
|
46820
46820
|
if (options.install !== false) {
|
|
46821
46821
|
try {
|
|
@@ -48315,9 +48315,9 @@ async function restoreCloud(options) {
|
|
|
48315
48315
|
return withLock(context.root, async () => {
|
|
48316
48316
|
if (!/^[a-f0-9]{4,40}$/.test(options.version)) throw new Error("Pass a version ID from animaguru cloud versions.");
|
|
48317
48317
|
await fetchLatest(context, await token(context, "read"));
|
|
48318
|
-
let
|
|
48318
|
+
let version4;
|
|
48319
48319
|
try {
|
|
48320
|
-
|
|
48320
|
+
version4 = await import_isomorphic_git.default.expandOid({ fs, gitdir: context.gitdir, oid: options.version });
|
|
48321
48321
|
} catch {
|
|
48322
48322
|
throw new Error(`Version ${options.version} was not found in this project's animations.`);
|
|
48323
48323
|
}
|
|
@@ -48326,22 +48326,22 @@ async function restoreCloud(options) {
|
|
|
48326
48326
|
const { files: scanned, tooLarge } = await scanFiles(context.root);
|
|
48327
48327
|
const local = await describeFiles(context, scanned);
|
|
48328
48328
|
const base2 = await versionFiles(context.gitdir, context.state.base);
|
|
48329
|
-
const wanted = await versionFiles(context.gitdir,
|
|
48329
|
+
const wanted = await versionFiles(context.gitdir, version4);
|
|
48330
48330
|
const writes = [];
|
|
48331
48331
|
const deletes = [];
|
|
48332
48332
|
for (const [path, entry] of wanted) if (inScope(path) && !same(local.get(path), entry)) writes.push([path, entry]);
|
|
48333
48333
|
for (const path of local.keys()) if (inScope(path) && !wanted.has(path) && base2.has(path)) deletes.push(path);
|
|
48334
|
-
if (selected.length && !writes.length && !deletes.length && ![...wanted.keys()].some(inScope)) throw new Error(`None of ${selected.join(", ")} is in version ${short(
|
|
48334
|
+
if (selected.length && !writes.length && !deletes.length && ![...wanted.keys()].some(inScope)) throw new Error(`None of ${selected.join(", ")} is in version ${short(version4)}.`);
|
|
48335
48335
|
guardTooLarge(tooLarge, writes.map(([path]) => path));
|
|
48336
48336
|
const unsaved = [...writes.map(([path]) => path), ...deletes].filter((path) => local.has(path) && !same(local.get(path), base2.get(path)));
|
|
48337
48337
|
if (unsaved.length && !options.yes) throw new Error(`Restoring replaces unsaved changes in ${list(unsaved, 20).join(", ")}. Push them first, or pass --yes to replace them (copies are kept in ${SYNC_DIR}/backups).`);
|
|
48338
48338
|
const folder = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
48339
48339
|
for (const path of unsaved) await backup(context, folder, path);
|
|
48340
48340
|
await apply(context, local, writes, deletes);
|
|
48341
|
-
context.state.message = `Restore ${selected.length ? `${selected.join(", ")} from ` : ""}version ${short(
|
|
48341
|
+
context.state.message = `Restore ${selected.length ? `${selected.join(", ")} from ` : ""}version ${short(version4)}`;
|
|
48342
48342
|
remember(context, local);
|
|
48343
48343
|
await saveState(context);
|
|
48344
|
-
return { restored:
|
|
48344
|
+
return { restored: version4, written: writes.length, removed: deletes.length, backedUp: unsaved.length, ...unsaved.length ? { backups: `${SYNC_DIR}/backups/${folder}` } : {}, next: `Run animaguru cloud push to save the restored files as the newest version ("${context.state.message}").` };
|
|
48345
48345
|
});
|
|
48346
48346
|
}
|
|
48347
48347
|
|
|
@@ -49881,9 +49881,100 @@ async function writeMotionExample(example, directory, { force = false } = {}) {
|
|
|
49881
49881
|
return { id: example.id, written, kept, kitImports: inAnimation ? "workspace (runtime/kit)" : "standalone (src/kit)", usage: example.usage };
|
|
49882
49882
|
}
|
|
49883
49883
|
|
|
49884
|
+
// cli/src/film-templates.ts
|
|
49885
|
+
import { mkdir as mkdir12, readFile as readFile15, rename as rename6, rm as rm3, stat as stat9, writeFile as writeFile11 } from "node:fs/promises";
|
|
49886
|
+
import { dirname as dirname11, join as join15 } from "node:path";
|
|
49887
|
+
import { createHash as createHash7, randomUUID as randomUUID5 } from "node:crypto";
|
|
49888
|
+
|
|
49889
|
+
// shared/film-templates.ts
|
|
49890
|
+
var filmTemplateId = external_exports.string().regex(/^ftpl_[a-f0-9]{24}$/, "Use a film template ID such as ftpl_\u2026.");
|
|
49891
|
+
var filmAnimationName = external_exports.string().regex(/^[a-z0-9][a-z0-9-]{0,79}$/, "Use a lowercase, hyphenated animation name.");
|
|
49892
|
+
var FILM_TEMPLATE_LIMITS = { files: 300, bytes: 250 * 1024 ** 2, perWorkspace: 100 };
|
|
49893
|
+
var filmTemplateSave = external_exports.object({
|
|
49894
|
+
requestId: external_exports.string().uuid(),
|
|
49895
|
+
projectId: cloudProjectId,
|
|
49896
|
+
animation: filmAnimationName,
|
|
49897
|
+
title: external_exports.string().trim().min(1).max(120),
|
|
49898
|
+
description: external_exports.string().trim().max(600).default("")
|
|
49899
|
+
}).strict();
|
|
49900
|
+
var filmTemplateUpdate = external_exports.object({ title: external_exports.string().trim().min(1).max(120).optional(), description: external_exports.string().trim().max(600).optional() }).strict().refine((value) => value.title !== void 0 || value.description !== void 0, "Change the title or the description.");
|
|
49901
|
+
var filmTemplateMove = external_exports.object({ workspace: external_exports.string().trim().min(1).max(80) }).strict();
|
|
49902
|
+
var version3 = (value) => typeof value === "string" && /^\d+\.\d+\.\d+$/.test(value) ? value.split(".").map(Number) : null;
|
|
49903
|
+
function runtimeOlder(workspace3, template) {
|
|
49904
|
+
const a = version3(workspace3), b = version3(template);
|
|
49905
|
+
if (!a || !b) return false;
|
|
49906
|
+
for (let index2 = 0; index2 < 3; index2++) if (a[index2] !== b[index2]) return a[index2] < b[index2];
|
|
49907
|
+
return false;
|
|
49908
|
+
}
|
|
49909
|
+
|
|
49910
|
+
// cli/src/film-templates.ts
|
|
49911
|
+
var templatePath = (id2) => {
|
|
49912
|
+
if (!/^ftpl_[a-f0-9]{24}$/.test(id2)) throw new Error("Use a film template ID such as ftpl_\u2026 from template list.");
|
|
49913
|
+
return `/api/v1/film-templates/${id2}`;
|
|
49914
|
+
};
|
|
49915
|
+
async function listFilmTemplates(client, selected) {
|
|
49916
|
+
const workspace3 = selected === "personal" ? "me" : selected ?? await selectedWorkspace(client.origin);
|
|
49917
|
+
return client.request(`/api/v1/film-templates?${new URLSearchParams({ workspace: workspace3 })}`);
|
|
49918
|
+
}
|
|
49919
|
+
var getFilmTemplate = (client, id2) => client.request(templatePath(id2));
|
|
49920
|
+
var exists3 = (path) => stat9(path).then(() => true, () => false);
|
|
49921
|
+
async function installFilmTemplate(client, id2, options) {
|
|
49922
|
+
const root = await findWorkspace(options.workspace);
|
|
49923
|
+
const { template } = await client.request(`${templatePath(id2)}?files=1`);
|
|
49924
|
+
const name2 = filmAnimationName.parse(options.name ?? template.animation);
|
|
49925
|
+
const runtime = JSON.parse(await readFile15(join15(root, "animaguru.workspace.json"), "utf8")).cliVersion;
|
|
49926
|
+
if (runtimeOlder(runtime, template.runtime)) throw new Error(`This template was saved from a newer video workspace (${template.runtime}) than this one (${String(runtime)}). Install it in a new workspace made with animaguru create workspace.`);
|
|
49927
|
+
const directory = join15(root, "animations", name2);
|
|
49928
|
+
if (await exists3(directory)) throw new Error(`Animation already exists: ${name2}. Choose another name with --name; existing files were not changed.`);
|
|
49929
|
+
const files = template.fileList ?? [];
|
|
49930
|
+
const staging = join15(root, ".animaguru", "template-installs", `${name2}-${randomUUID5()}`);
|
|
49931
|
+
try {
|
|
49932
|
+
const downloads = /* @__PURE__ */ new Map();
|
|
49933
|
+
const download = (sha2) => {
|
|
49934
|
+
if (!downloads.has(sha2)) downloads.set(sha2, (async () => {
|
|
49935
|
+
const response = await client.request(`${templatePath(id2)}/blobs/${sha2}`, { raw: true, timeout: 3e5 });
|
|
49936
|
+
const bytes = Buffer.from(await response.arrayBuffer());
|
|
49937
|
+
if (createHash7("sha256").update(bytes).digest("hex") !== sha2) throw new Error(`A template file did not match its checksum (${sha2}). Try again.`);
|
|
49938
|
+
return bytes;
|
|
49939
|
+
})());
|
|
49940
|
+
return downloads.get(sha2);
|
|
49941
|
+
};
|
|
49942
|
+
for (let index2 = 0; index2 < files.length; index2 += 4) {
|
|
49943
|
+
await Promise.all(files.slice(index2, index2 + 4).map(async (file2) => {
|
|
49944
|
+
const path = join15(staging, safeProjectPath(file2.path));
|
|
49945
|
+
await mkdir12(dirname11(path), { recursive: true });
|
|
49946
|
+
await writeFile11(path, await download(file2.sha256));
|
|
49947
|
+
}));
|
|
49948
|
+
}
|
|
49949
|
+
const configPath = join15(staging, "film.config.json");
|
|
49950
|
+
if (await exists3(configPath)) {
|
|
49951
|
+
const config2 = JSON.parse(await readFile15(configPath, "utf8"));
|
|
49952
|
+
await writeFile11(configPath, `${JSON.stringify({ ...config2, slug: name2 }, null, 2)}
|
|
49953
|
+
`);
|
|
49954
|
+
}
|
|
49955
|
+
await mkdir12(join15(staging, "public/assets"), { recursive: true });
|
|
49956
|
+
await mkdir12(join15(staging, "production"), { recursive: true });
|
|
49957
|
+
if (await exists3(directory)) throw new Error(`Animation already exists: ${name2}. Existing files were not changed.`);
|
|
49958
|
+
await rename6(staging, directory);
|
|
49959
|
+
} finally {
|
|
49960
|
+
await rm3(staging, { recursive: true, force: true });
|
|
49961
|
+
}
|
|
49962
|
+
options.log?.(`Installed the film template "${template.title}" at ${directory}.`);
|
|
49963
|
+
return {
|
|
49964
|
+
type: "film-template",
|
|
49965
|
+
id: template.id,
|
|
49966
|
+
title: template.title,
|
|
49967
|
+
name: name2,
|
|
49968
|
+
path: directory,
|
|
49969
|
+
files: files.length,
|
|
49970
|
+
bytes: template.bytes,
|
|
49971
|
+
nextSteps: [`Read animations/${name2}/production/template-brief.md to see what the film was made for, then change it to fit the new brief.`, `Run npm run dev to play it, or npm run review -- --animation ${name2}.`]
|
|
49972
|
+
};
|
|
49973
|
+
}
|
|
49974
|
+
|
|
49884
49975
|
// cli/src/library.ts
|
|
49885
|
-
import { mkdir as
|
|
49886
|
-
import { dirname as
|
|
49976
|
+
import { mkdir as mkdir13, readFile as readFile16, writeFile as writeFile12 } from "node:fs/promises";
|
|
49977
|
+
import { dirname as dirname12, join as join16, resolve as resolve14 } from "node:path";
|
|
49887
49978
|
|
|
49888
49979
|
// shared/asset-library.ts
|
|
49889
49980
|
var LIBRARY_ASSET_TYPES = ["sprite", "image", "video", "music", "speech", "sfx"];
|
|
@@ -49973,20 +50064,20 @@ async function downloadLibraryAsset(client, id2, output2, { force = false } = {}
|
|
|
49973
50064
|
const root = resolve14(output2, asset.type === "sprite" ? safeProjectPath(asset.id) : ".");
|
|
49974
50065
|
const written = [];
|
|
49975
50066
|
for (const file2 of asset.files) {
|
|
49976
|
-
const path =
|
|
50067
|
+
const path = join16(root, safeProjectPath(file2.path));
|
|
49977
50068
|
const response = await client.request(`${libraryPath(asset.id)}/files/${file2.path.split("/").map(encodeURIComponent).join("/")}?download=1`, { raw: true, timeout: 3e5 });
|
|
49978
50069
|
const bytes = new Uint8Array(await response.arrayBuffer());
|
|
49979
|
-
await
|
|
49980
|
-
await
|
|
50070
|
+
await mkdir13(dirname12(path), { recursive: true });
|
|
50071
|
+
await writeFile12(path, bytes, { flag: force ? "w" : "wx" }).catch((error62) => {
|
|
49981
50072
|
throw error62.code === "EEXIST" ? new Error(`Already exists: ${path}. Pass --force to replace it.`) : error62;
|
|
49982
50073
|
});
|
|
49983
50074
|
written.push({ path, size: bytes.byteLength, mimeType: file2.mimeType });
|
|
49984
50075
|
}
|
|
49985
|
-
return { id: asset.id, type: asset.type, files: written, ...asset.type === "sprite" ? { animations: asset.details.animations?.map(({ action, sheet, data, frames, fps, loop }) => ({ action, sheet:
|
|
50076
|
+
return { id: asset.id, type: asset.type, files: written, ...asset.type === "sprite" ? { animations: asset.details.animations?.map(({ action, sheet, data, frames, fps, loop }) => ({ action, sheet: join16(root, sheet), data: join16(root, data), frames, fps, loop })) } : {} };
|
|
49986
50077
|
}
|
|
49987
50078
|
var importLibraryAsset = (client, id2, project, name2) => client.request(`${libraryPath(id2)}/import`, { method: "POST", body: { projectId: project, ...name2 ? { name: name2 } : {} } });
|
|
49988
50079
|
async function words(flags) {
|
|
49989
|
-
const input2 = flags.file ? JSON.parse(await
|
|
50080
|
+
const input2 = flags.file ? JSON.parse(await readFile16(flags.file, "utf8")) : {};
|
|
49990
50081
|
if (!input2 || typeof input2 !== "object" || Array.isArray(input2)) throw new Error("The file must contain a JSON object.");
|
|
49991
50082
|
return {
|
|
49992
50083
|
...input2,
|
|
@@ -50031,13 +50122,13 @@ async function moveWork(client, project, flags) {
|
|
|
50031
50122
|
}
|
|
50032
50123
|
|
|
50033
50124
|
// cli/src/release.ts
|
|
50034
|
-
import { mkdir as
|
|
50035
|
-
import { dirname as
|
|
50036
|
-
import { randomUUID as
|
|
50125
|
+
import { mkdir as mkdir14, readFile as readFile17, rename as rename7, unlink as unlink2, writeFile as writeFile13 } from "node:fs/promises";
|
|
50126
|
+
import { dirname as dirname13, join as join17 } from "node:path";
|
|
50127
|
+
import { randomUUID as randomUUID6 } from "node:crypto";
|
|
50037
50128
|
var releaseUrl = "https://animaguru.com/cli/release.json";
|
|
50038
|
-
function versionParts(
|
|
50039
|
-
if (!/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/.test(
|
|
50040
|
-
const parts =
|
|
50129
|
+
function versionParts(version4) {
|
|
50130
|
+
if (!/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/.test(version4)) throw new Error("Invalid CLI release version.");
|
|
50131
|
+
const parts = version4.split(".").map(Number);
|
|
50041
50132
|
if (!parts.every(Number.isSafeInteger)) throw new Error("Invalid CLI release version.");
|
|
50042
50133
|
return parts;
|
|
50043
50134
|
}
|
|
@@ -50053,10 +50144,10 @@ function parseRelease(value) {
|
|
|
50053
50144
|
versionParts(value.version);
|
|
50054
50145
|
return { name: value.name, version: value.version };
|
|
50055
50146
|
}
|
|
50056
|
-
var cachePath = () =>
|
|
50147
|
+
var cachePath = () => join17(dirname13(credentialsPath()), "cli-release.json");
|
|
50057
50148
|
async function cachedRelease() {
|
|
50058
50149
|
try {
|
|
50059
|
-
return parseRelease(JSON.parse(await
|
|
50150
|
+
return parseRelease(JSON.parse(await readFile17(cachePath(), "utf8")));
|
|
50060
50151
|
} catch {
|
|
50061
50152
|
return void 0;
|
|
50062
50153
|
}
|
|
@@ -50070,11 +50161,11 @@ async function latestRelease(signal) {
|
|
|
50070
50161
|
if (!response.ok) throw new Error(`CLI release check failed (${response.status}).`);
|
|
50071
50162
|
const release = parseRelease(await response.json());
|
|
50072
50163
|
const path = cachePath();
|
|
50073
|
-
const temp = `${path}.${
|
|
50164
|
+
const temp = `${path}.${randomUUID6()}.tmp`;
|
|
50074
50165
|
try {
|
|
50075
|
-
await
|
|
50076
|
-
await
|
|
50077
|
-
await
|
|
50166
|
+
await mkdir14(dirname13(path), { recursive: true, mode: 448 });
|
|
50167
|
+
await writeFile13(temp, JSON.stringify(release) + "\n", { flag: "wx", mode: 384 });
|
|
50168
|
+
await rename7(temp, path);
|
|
50078
50169
|
} catch {
|
|
50079
50170
|
await unlink2(temp).catch(() => void 0);
|
|
50080
50171
|
}
|
|
@@ -50114,8 +50205,8 @@ async function requireCurrentRelease(argv, stderr) {
|
|
|
50114
50205
|
}
|
|
50115
50206
|
|
|
50116
50207
|
// cli/src/brands.ts
|
|
50117
|
-
import { lstat as lstat3, mkdir as
|
|
50118
|
-
import { basename as basename6, dirname as
|
|
50208
|
+
import { lstat as lstat3, mkdir as mkdir15, readFile as readFile18, stat as stat10, writeFile as writeFile14 } from "node:fs/promises";
|
|
50209
|
+
import { basename as basename6, dirname as dirname14, extname as extname2, join as join18, resolve as resolve15 } from "node:path";
|
|
50119
50210
|
|
|
50120
50211
|
// shared/brands.ts
|
|
50121
50212
|
var brandId = external_exports.string().regex(/^br_[a-f0-9]{24}$/);
|
|
@@ -50235,7 +50326,7 @@ async function listBrands(client, selected) {
|
|
|
50235
50326
|
}
|
|
50236
50327
|
var getBrand = (client, id2) => client.request(brandPath(id2));
|
|
50237
50328
|
async function jsonObject(file2) {
|
|
50238
|
-
const value = JSON.parse(await
|
|
50329
|
+
const value = JSON.parse(await readFile18(file2, "utf8"));
|
|
50239
50330
|
if (!value || typeof value !== "object" || Array.isArray(value)) throw new Error("The file must contain a JSON object.");
|
|
50240
50331
|
return value;
|
|
50241
50332
|
}
|
|
@@ -50262,12 +50353,12 @@ async function uploadBrandFile(client, id2, file2, flags) {
|
|
|
50262
50353
|
const path = brandPath(id2);
|
|
50263
50354
|
if (!flags.yes) throw new Error("Pass --yes to authorize uploading this file to the brand.");
|
|
50264
50355
|
if (flags.kind && !BRAND_FILE_KINDS.includes(flags.kind)) throw new Error("Unknown brand file kind.");
|
|
50265
|
-
const info = await
|
|
50356
|
+
const info = await stat10(file2);
|
|
50266
50357
|
if (!info.isFile() || !info.size || info.size > BRAND_FILE_BYTES) throw new Error("A brand file must be between 1 byte and 32 MiB.");
|
|
50267
50358
|
const extension = extname2(file2).slice(1).toLowerCase().replace(/^jpeg$/, "jpg");
|
|
50268
50359
|
const mimeType = flags["mime-type"] ?? Object.entries(BRAND_FILE_TYPES).find(([, ext]) => ext === extension)?.[0];
|
|
50269
50360
|
if (!mimeType || !BRAND_FILE_TYPES[mimeType]) throw new Error("Unsupported brand file type. Use a web image, font, audio or video file, or specify --mime-type.");
|
|
50270
|
-
const bytes = new Uint8Array(await
|
|
50361
|
+
const bytes = new Uint8Array(await readFile18(file2));
|
|
50271
50362
|
if (!bytes.byteLength || bytes.byteLength > BRAND_FILE_BYTES) throw new Error("A brand file must be between 1 byte and 32 MiB.");
|
|
50272
50363
|
const form = new FormData();
|
|
50273
50364
|
form.set("file", new File([bytes], basename6(file2), { type: mimeType }));
|
|
@@ -50286,22 +50377,22 @@ async function downloadBrand(client, id2, output2, flags = {}) {
|
|
|
50286
50377
|
{ path: "branding/brand-guide.md", content: brandGuide(brand), mimeType: "text/markdown" }
|
|
50287
50378
|
];
|
|
50288
50379
|
const root = resolve15(output2);
|
|
50289
|
-
const targets = [...textFiles.map((file2) => file2.path), ...files.map(brandFilePath)].map((path) =>
|
|
50380
|
+
const targets = [...textFiles.map((file2) => file2.path), ...files.map(brandFilePath)].map((path) => join18(root, safeProjectPath(path)));
|
|
50290
50381
|
if (new Set(targets).size !== targets.length) throw new Error("The brand contains conflicting file names.");
|
|
50291
|
-
for (const path of [
|
|
50382
|
+
for (const path of [join18(root, "branding"), ...targets]) {
|
|
50292
50383
|
const info = await lstat3(path).catch((error62) => {
|
|
50293
50384
|
if (error62.code !== "ENOENT") throw error62;
|
|
50294
50385
|
return null;
|
|
50295
50386
|
});
|
|
50296
50387
|
if (info?.isSymbolicLink()) throw new Error(`Refusing to write through a symbolic link: ${path}`);
|
|
50297
|
-
if (path !==
|
|
50388
|
+
if (path !== join18(root, "branding") && info && (!flags.force || !info.isFile())) throw new Error(`Already exists: ${path}. Pass --force to replace files.`);
|
|
50298
50389
|
}
|
|
50299
|
-
await
|
|
50390
|
+
await mkdir15(join18(root, "branding"), { recursive: true });
|
|
50300
50391
|
const written = [];
|
|
50301
50392
|
const save = async (path, bytes, mimeType) => {
|
|
50302
|
-
const target2 =
|
|
50303
|
-
await
|
|
50304
|
-
await
|
|
50393
|
+
const target2 = join18(root, safeProjectPath(path));
|
|
50394
|
+
await mkdir15(dirname14(target2), { recursive: true });
|
|
50395
|
+
await writeFile14(target2, bytes, { flag: flags.force ? "w" : "wx" });
|
|
50305
50396
|
written.push({ path: target2, size: bytes.byteLength, mimeType });
|
|
50306
50397
|
};
|
|
50307
50398
|
for (const file2 of files) {
|
|
@@ -50313,8 +50404,8 @@ async function downloadBrand(client, id2, output2, flags = {}) {
|
|
|
50313
50404
|
}
|
|
50314
50405
|
|
|
50315
50406
|
// cli/src/review-check.ts
|
|
50316
|
-
import { readFile as
|
|
50317
|
-
import { join as
|
|
50407
|
+
import { readFile as readFile19, readdir as readdir7, stat as stat11, writeFile as writeFile15 } from "node:fs/promises";
|
|
50408
|
+
import { join as join19 } from "node:path";
|
|
50318
50409
|
|
|
50319
50410
|
// shared/frame-checks.ts
|
|
50320
50411
|
var FRAME_CHECK_MAX_FRAMES = 12;
|
|
@@ -50358,17 +50449,17 @@ var frameCheckRequest = external_exports.object({
|
|
|
50358
50449
|
// cli/src/review-check.ts
|
|
50359
50450
|
async function framesToCheck(projectRoot, source, report2) {
|
|
50360
50451
|
if (source === "frames") {
|
|
50361
|
-
const folder2 =
|
|
50452
|
+
const folder2 = join19(projectRoot, "production/review/frames");
|
|
50362
50453
|
const names2 = await readdir7(folder2).catch(() => []);
|
|
50363
|
-
const frames = names2.map((name2) => /^frame-([\d.]+)s\.jpg$/.exec(name2)).filter((match) => match !== null).map((match) => ({ file:
|
|
50454
|
+
const frames = names2.map((name2) => /^frame-([\d.]+)s\.jpg$/.exec(name2)).filter((match) => match !== null).map((match) => ({ file: join19(folder2, match[0]), time: Number(match[1]) })).sort((a, b) => a.time - b.time);
|
|
50364
50455
|
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.");
|
|
50365
50456
|
return frames;
|
|
50366
50457
|
}
|
|
50367
|
-
const folder =
|
|
50458
|
+
const folder = join19(projectRoot, "production/review");
|
|
50368
50459
|
const times = [...report2.seekMatches ?? []].map((match) => match.time).sort((a, b) => a - b);
|
|
50369
50460
|
const names = (await readdir7(folder)).filter((name2) => /^frame-\d{2}\.jpg$/.test(name2)).sort();
|
|
50370
50461
|
if (!names.length || names.length !== times.length) throw new Error("The review frames do not match report.json. Run npm run review again.");
|
|
50371
|
-
return names.map((name2, index2) => ({ file:
|
|
50462
|
+
return names.map((name2, index2) => ({ file: join19(folder, name2), time: times[index2] }));
|
|
50372
50463
|
}
|
|
50373
50464
|
function filmContext(report2, brief, extra) {
|
|
50374
50465
|
const config2 = report2.config ?? {};
|
|
@@ -50383,30 +50474,30 @@ function compact(answers) {
|
|
|
50383
50474
|
async function reviewCheck(client, options) {
|
|
50384
50475
|
if (!options.yes && !options["dry-run"]) throw new Error("Pass --yes to authorize spending credits on the check, or --dry-run for its most.");
|
|
50385
50476
|
const context = await localProject(options.directory, options.animation);
|
|
50386
|
-
const reportFile =
|
|
50387
|
-
const report2 = JSON.parse(await
|
|
50477
|
+
const reportFile = join19(context.projectRoot, "production/review/report.json");
|
|
50478
|
+
const report2 = JSON.parse(await readFile19(reportFile, "utf8").catch(() => {
|
|
50388
50479
|
throw new Error("Run npm run review first: production/review/report.json is missing.");
|
|
50389
50480
|
}));
|
|
50390
50481
|
const frames = await framesToCheck(context.projectRoot, options.source ?? "review", report2);
|
|
50391
50482
|
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.`);
|
|
50392
|
-
const sizes = await Promise.all(frames.map(async (frame) => (await
|
|
50483
|
+
const sizes = await Promise.all(frames.map(async (frame) => (await stat11(frame.file)).size));
|
|
50393
50484
|
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.");
|
|
50394
|
-
const questions = options.questions ? frameCheckQuestions.parse(JSON.parse(await
|
|
50395
|
-
const brief = await
|
|
50485
|
+
const questions = options.questions ? frameCheckQuestions.parse(JSON.parse(await readFile19(options.questions, "utf8"))) : void 0;
|
|
50486
|
+
const brief = await readFile19(join19(context.projectRoot, "production/brief.md"), "utf8").catch(() => "");
|
|
50396
50487
|
const link2 = await cloudLink(context.toolsRoot).catch(() => null);
|
|
50397
50488
|
const body = {
|
|
50398
50489
|
...link2?.origin === client.origin ? { projectId: link2.projectId } : { workspace: await selectedWorkspace(client.origin) },
|
|
50399
50490
|
context: filmContext(report2, brief, options.context),
|
|
50400
50491
|
...report2.config?.duration ? { duration: report2.config.duration } : {},
|
|
50401
|
-
frames: await Promise.all(frames.map(async (frame) => ({ time: Math.round(frame.time * 1e3) / 1e3, image: `data:image/jpeg;base64,${(await
|
|
50492
|
+
frames: await Promise.all(frames.map(async (frame) => ({ time: Math.round(frame.time * 1e3) / 1e3, image: `data:image/jpeg;base64,${(await readFile19(frame.file)).toString("base64")}` }))),
|
|
50402
50493
|
...questions ? { questions } : {},
|
|
50403
50494
|
...options["dry-run"] ? { dryRun: true } : {}
|
|
50404
50495
|
};
|
|
50405
50496
|
if (options["dry-run"]) return client.request("/api/v1/frame-checks", { method: "POST", body, timeout: 12e4 });
|
|
50406
50497
|
const result = await client.request("/api/v1/frame-checks", { method: "POST", body, timeout: 12e4 });
|
|
50407
50498
|
const fileAt = (time3) => frames.find((frame) => Math.abs(frame.time - time3) < 1e-3)?.file.slice(context.projectRoot.length + 1);
|
|
50408
|
-
const saved =
|
|
50409
|
-
await
|
|
50499
|
+
const saved = join19(context.projectRoot, "production/review/check.json");
|
|
50500
|
+
await writeFile15(saved, `${JSON.stringify({ ...result, frames: result.frames.map((frame) => ({ file: fileAt(frame.time), ...frame })) }, null, 2)}
|
|
50410
50501
|
`);
|
|
50411
50502
|
return {
|
|
50412
50503
|
flagged: result.flagged.map((flag) => ({ file: fileAt(flag.time), ...flag })),
|
|
@@ -50419,8 +50510,8 @@ async function reviewCheck(client, options) {
|
|
|
50419
50510
|
|
|
50420
50511
|
// cli/src/reference.ts
|
|
50421
50512
|
import { openAsBlob } from "node:fs";
|
|
50422
|
-
import { mkdir as
|
|
50423
|
-
import { basename as basename7, dirname as
|
|
50513
|
+
import { mkdir as mkdir16, stat as stat12, writeFile as writeFile16 } from "node:fs/promises";
|
|
50514
|
+
import { basename as basename7, dirname as dirname15, extname as extname3, join as join20, relative as relative3, resolve as resolve16 } from "node:path";
|
|
50424
50515
|
|
|
50425
50516
|
// shared/video-analysis.ts
|
|
50426
50517
|
var VIDEO_ANALYSIS_MAX_BYTES = 100 * 1024 * 1024;
|
|
@@ -50454,8 +50545,8 @@ async function briefFile(options, name2) {
|
|
|
50454
50545
|
if (options.out) return resolve16(options.out);
|
|
50455
50546
|
const slug2 = name2.replace(/\.[a-z0-9]{2,4}$/i, "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "").slice(0, 60) || "reference";
|
|
50456
50547
|
const project = await localProject(options.directory ?? ".", options.animation).catch(() => null);
|
|
50457
|
-
const film = project && await
|
|
50458
|
-
return film ?
|
|
50548
|
+
const film = project && await stat12(join20(project.projectRoot, "animaguru.project.json")).then(() => true, () => false);
|
|
50549
|
+
return film ? join20(project.projectRoot, "production/references", `${slug2}.json`) : resolve16(options.directory ?? ".", `${slug2}.analysis.json`);
|
|
50459
50550
|
}
|
|
50460
50551
|
var pause = (ms, signal) => new Promise((done, fail) => {
|
|
50461
50552
|
signal?.throwIfAborted();
|
|
@@ -50494,8 +50585,8 @@ async function report(analysis, options) {
|
|
|
50494
50585
|
if (analysis.status === "failed") throw new Error(analysis.error ?? "The analysis failed.");
|
|
50495
50586
|
if (analysis.status !== "completed") return { id: analysis.id, status: analysis.status, next: `animaguru reference get ${analysis.id} --wait` };
|
|
50496
50587
|
const file2 = await briefFile(options, sourceName(analysis));
|
|
50497
|
-
await
|
|
50498
|
-
await
|
|
50588
|
+
await mkdir16(dirname15(file2), { recursive: true });
|
|
50589
|
+
await writeFile16(file2, `${JSON.stringify(analysis, null, 2)}
|
|
50499
50590
|
`);
|
|
50500
50591
|
const brief = analysis.result?.brief;
|
|
50501
50592
|
return {
|
|
@@ -50520,7 +50611,7 @@ async function referenceAnalyze(client, options) {
|
|
|
50520
50611
|
started = await client.request("/api/v1/video-analyses", { method: "POST", body: { ...settings2, url: options.video, ...dryRun ? { dryRun: true } : {} }, timeout: 12e4 });
|
|
50521
50612
|
} else {
|
|
50522
50613
|
const file2 = resolve16(options.video);
|
|
50523
|
-
const info = await
|
|
50614
|
+
const info = await stat12(file2).catch(() => null);
|
|
50524
50615
|
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.`);
|
|
50525
50616
|
const type = TYPES[extname3(file2).toLowerCase()];
|
|
50526
50617
|
if (!type) throw new Error("Analyse an MP4, MOV or WebM video.");
|
|
@@ -50562,7 +50653,7 @@ var socialProfileRequest = external_exports.object({
|
|
|
50562
50653
|
|
|
50563
50654
|
// cli/src/curl.ts
|
|
50564
50655
|
import { createWriteStream as createWriteStream2, openAsBlob as openAsBlob2 } from "node:fs";
|
|
50565
|
-
import { readFile as
|
|
50656
|
+
import { readFile as readFile20, unlink as unlink3 } from "node:fs/promises";
|
|
50566
50657
|
import { extname as extname4, resolve as resolve17 } from "node:path";
|
|
50567
50658
|
import { Readable as Readable2 } from "node:stream";
|
|
50568
50659
|
import { pipeline as pipeline2 } from "node:stream/promises";
|
|
@@ -50603,7 +50694,7 @@ var readStdin = async () => {
|
|
|
50603
50694
|
};
|
|
50604
50695
|
async function bodyValue(value, io) {
|
|
50605
50696
|
if (value === "@-") return (io.stdin ?? readStdin)();
|
|
50606
|
-
return value.startsWith("@") ?
|
|
50697
|
+
return value.startsWith("@") ? readFile20(resolve17(value.slice(1))) : value;
|
|
50607
50698
|
}
|
|
50608
50699
|
var parsesAsJson = (body) => {
|
|
50609
50700
|
try {
|
|
@@ -50949,7 +51040,11 @@ Confirm code: ${device.user_code}`);
|
|
|
50949
51040
|
).action(async ({ args, flags, stdout, signal }) => {
|
|
50950
51041
|
const example = await new Client(flags.url, signal).request(`/api/v1/motion-library/${encodeURIComponent(args.id)}`);
|
|
50951
51042
|
out(stdout, flags.write ? await writeMotionExample(example, flags.write, { force: flags.force }) : example);
|
|
50952
|
-
}))).add(defineCommand("categories", { description: "List motion library categories and their example counts" }, (command) => command.flags({ name: "url", type: "string", default: "https://animaguru.com", env: { name: "ANIMAGURU_URL" }, description: "Server origin" }).action(async ({ flags, stdout, signal }) => out(stdout, await new Client(flags.url, signal).request("/api/v1/motion-library/categories")))))).command("
|
|
51043
|
+
}))).add(defineCommand("categories", { description: "List motion library categories and their example counts" }, (command) => command.flags({ name: "url", type: "string", default: "https://animaguru.com", env: { name: "ANIMAGURU_URL" }, description: "Server origin" }).action(async ({ flags, stdout, signal }) => out(stdout, await new Client(flags.url, signal).request("/api/v1/motion-library/categories")))))).command("template", (template) => template.add(defineCommand("list", { description: "List the film templates of the selected cloud workspace: applied films saved to start new films from (Individual Pro and Team)" }, (command) => command.flags(urlFlag, brandWorkspaceFlag).action(async ({ flags, stdout, signal }) => out(stdout, await listFilmTemplates(new Client(flags.url, signal), flags.workspace))))).add(defineCommand("get", { description: "Show a film template: its film's format, duration, style and files" }, (command) => command.args({ name: "id", type: "string", required: true, description: "Template ID from template list" }).flags(urlFlag).action(async ({ args, flags, stdout, signal }) => out(stdout, await getFilmTemplate(new Client(flags.url, signal), args.id))))).add(defineCommand("install", { description: "Install a film template as animations/NAME of this video workspace, to change into a new film; never replaces an existing film" }, (command) => command.args({ name: "id", type: "string", required: true, description: "Template ID from template list" }).flags(
|
|
51044
|
+
urlFlag,
|
|
51045
|
+
{ name: "name", type: "string", description: "Film folder name; defaults to the template's film name" },
|
|
51046
|
+
{ name: "workspace", type: "string", description: "Video workspace folder; defaults to the one around the current folder" }
|
|
51047
|
+
).action(async ({ args, flags, stdout, stderr, signal }) => out(stdout, await installFilmTemplate(new Client(flags.url, signal), args.id, { name: flags.name, workspace: flags.workspace, log: stderr })))))).command("brands", (brands) => brands.add(defineCommand("list", { description: "List saved brands in the selected cloud workspace" }, (command) => command.flags(urlFlag, brandWorkspaceFlag).action(async ({ flags, stdout, signal }) => out(stdout, await listBrands(new Client(flags.url, signal), flags.workspace))))).add(defineCommand("get", { description: "Read a brand's guide, colors, fonts, logo, sources and files" }, (command) => command.args(brandArgument).flags(urlFlag).action(async ({ args, flags, stdout, signal }) => out(stdout, await getBrand(new Client(flags.url, signal), args.id))))).add(defineCommand("create", { description: "Create a manual brand kit with neutral defaults for omitted colors and fonts" }, (command) => command.flags(
|
|
50953
51048
|
urlFlag,
|
|
50954
51049
|
brandWorkspaceFlag,
|
|
50955
51050
|
brandRequestFlag,
|
|
@@ -51092,9 +51187,12 @@ Confirm code: ${device.user_code}`);
|
|
|
51092
51187
|
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" }));
|
|
51093
51188
|
})))).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 }) => {
|
|
51094
51189
|
if (!flags.yes) throw new Error("Pass --yes to authorize spending credits.");
|
|
51095
|
-
const body = spriteJobBody.parse({ ...JSON.parse(await
|
|
51190
|
+
const body = spriteJobBody.parse({ ...JSON.parse(await readFile21(flags.file, "utf8")), ...selectedModels(flags) });
|
|
51096
51191
|
out(stdout, await new Client(flags.url, signal).request(`${projectPath(args.id)}/jobs`, { method: "POST", body }));
|
|
51097
|
-
}))).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) }))))
|
|
51192
|
+
}))).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("cancel", { description: "Cancel a queued job, or stop a running one at its next provider check; credits already spent stay spent. Requires --yes" }, (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: "yes", type: "boolean", required: true, description: "Confirm canceling the job" }).action(async ({ args, flags, stdout, signal }) => {
|
|
51193
|
+
if (!flags.yes) throw new Error("Pass --yes to cancel the job.");
|
|
51194
|
+
out(stdout, await new Client(flags.url, signal).request(`${projectPath(args.id)}/jobs/${encodeURIComponent(args.job)}/cancel`, { method: "POST" }));
|
|
51195
|
+
})))).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 }) => {
|
|
51098
51196
|
const body = selectedModels(flags);
|
|
51099
51197
|
if (!Object.keys(body).length) throw new Error("Pass --video-model. Image models are managed by staff.");
|
|
51100
51198
|
out(stdout, await new Client(flags.url, signal).request(`${projectPath(args.id)}/models`, { method: "PUT", body }));
|
|
@@ -51107,7 +51205,7 @@ Confirm code: ${device.user_code}`);
|
|
|
51107
51205
|
const extension = flags.file.split(".").at(-1)?.toLowerCase();
|
|
51108
51206
|
const type = extension === "png" ? "image/png" : extension === "jpg" || extension === "jpeg" ? "image/jpeg" : extension === "webp" ? "image/webp" : void 0;
|
|
51109
51207
|
if (!type) throw new Error("Use a PNG, JPEG or WebP image.");
|
|
51110
|
-
const bytes = await
|
|
51208
|
+
const bytes = await readFile21(flags.file);
|
|
51111
51209
|
if (bytes.length > 10 * 1024 * 1024) throw new Error("Image must be at most 10 MB.");
|
|
51112
51210
|
const form = new FormData();
|
|
51113
51211
|
form.set("image", new Blob([bytes], { type }), `reference.${extension}`);
|
|
@@ -51124,9 +51222,9 @@ Confirm code: ${device.user_code}`);
|
|
|
51124
51222
|
if (!/^[a-f0-9]{64}$/.test(file2.sha)) throw new Error("Invalid blob hash in manifest.");
|
|
51125
51223
|
const response = await client.request(`/api/v1/blobs/${encodeURIComponent(manifest.ownerId)}/${file2.sha}`, { raw: true });
|
|
51126
51224
|
const path = resolve18(flags.output);
|
|
51127
|
-
await
|
|
51225
|
+
await mkdir17(dirname16(path), { recursive: true });
|
|
51128
51226
|
const bytes = new Uint8Array(await response.arrayBuffer());
|
|
51129
|
-
await
|
|
51227
|
+
await writeFile17(path, bytes, { flag: "wx" });
|
|
51130
51228
|
out(stdout, { path, bytes: bytes.length });
|
|
51131
51229
|
}))).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 }) => {
|
|
51132
51230
|
const client = new Client(flags.url, signal);
|
|
@@ -51139,7 +51237,7 @@ Confirm code: ${device.user_code}`);
|
|
|
51139
51237
|
entries[path2] = new Uint8Array(await response.arrayBuffer());
|
|
51140
51238
|
}
|
|
51141
51239
|
const path = resolve18(flags.output);
|
|
51142
|
-
await
|
|
51240
|
+
await writeFile17(path, zipSync(entries, { level: 0 }), { flag: "wx" });
|
|
51143
51241
|
out(stdout, { path, files: manifest.files.length });
|
|
51144
51242
|
})))).extend(version(package_default.version, { format: "plain" })).extend(help()).extend(completion());
|
|
51145
51243
|
}
|