@docyrus/animaguru 0.14.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -0
- package/dist/animaguru.js +452 -309
- package/package.json +1 -1
- package/skills/animaguru/SKILL.md +4 -0
- package/skills/animaguru-video/SKILL.md +4 -0
package/dist/animaguru.js
CHANGED
|
@@ -2312,8 +2312,8 @@ var require_lib = __commonJS({
|
|
|
2312
2312
|
if (typeof cb !== "function") {
|
|
2313
2313
|
opts = cb;
|
|
2314
2314
|
cb = null;
|
|
2315
|
-
deferred = new this.Promise(function(
|
|
2316
|
-
deferredResolve =
|
|
2315
|
+
deferred = new this.Promise(function(resolve15, reject) {
|
|
2316
|
+
deferredResolve = resolve15;
|
|
2317
2317
|
deferredReject = reject;
|
|
2318
2318
|
});
|
|
2319
2319
|
}
|
|
@@ -2461,17 +2461,17 @@ var require_lib = __commonJS({
|
|
|
2461
2461
|
if (typeof cb === "function") {
|
|
2462
2462
|
fnx(cb);
|
|
2463
2463
|
} else {
|
|
2464
|
-
return new this.Promise(function(
|
|
2464
|
+
return new this.Promise(function(resolve15, reject) {
|
|
2465
2465
|
if (fnx.length === 1) {
|
|
2466
2466
|
fnx(function(err2, ret) {
|
|
2467
2467
|
if (err2) {
|
|
2468
2468
|
reject(err2);
|
|
2469
2469
|
} else {
|
|
2470
|
-
|
|
2470
|
+
resolve15(ret);
|
|
2471
2471
|
}
|
|
2472
2472
|
});
|
|
2473
2473
|
} else {
|
|
2474
|
-
|
|
2474
|
+
resolve15(fnx());
|
|
2475
2475
|
}
|
|
2476
2476
|
});
|
|
2477
2477
|
}
|
|
@@ -6862,7 +6862,7 @@ var require_pify = __commonJS({
|
|
|
6862
6862
|
"use strict";
|
|
6863
6863
|
var processFn = (fn, options) => function(...args) {
|
|
6864
6864
|
const P = options.promiseModule;
|
|
6865
|
-
return new P((
|
|
6865
|
+
return new P((resolve15, reject) => {
|
|
6866
6866
|
if (options.multiArgs) {
|
|
6867
6867
|
args.push((...result) => {
|
|
6868
6868
|
if (options.errorFirst) {
|
|
@@ -6870,10 +6870,10 @@ var require_pify = __commonJS({
|
|
|
6870
6870
|
reject(result);
|
|
6871
6871
|
} else {
|
|
6872
6872
|
result.shift();
|
|
6873
|
-
|
|
6873
|
+
resolve15(result);
|
|
6874
6874
|
}
|
|
6875
6875
|
} else {
|
|
6876
|
-
|
|
6876
|
+
resolve15(result);
|
|
6877
6877
|
}
|
|
6878
6878
|
});
|
|
6879
6879
|
} else if (options.errorFirst) {
|
|
@@ -6881,11 +6881,11 @@ var require_pify = __commonJS({
|
|
|
6881
6881
|
if (error62) {
|
|
6882
6882
|
reject(error62);
|
|
6883
6883
|
} else {
|
|
6884
|
-
|
|
6884
|
+
resolve15(result);
|
|
6885
6885
|
}
|
|
6886
6886
|
});
|
|
6887
6887
|
} else {
|
|
6888
|
-
args.push(
|
|
6888
|
+
args.push(resolve15);
|
|
6889
6889
|
}
|
|
6890
6890
|
fn.apply(this, args);
|
|
6891
6891
|
});
|
|
@@ -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 dirname11(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 mkdir12 = 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 = mkdir12(dirname11(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: basename6(name2),
|
|
8240
8240
|
metadata,
|
|
8241
8241
|
// This recursively generates any missing parent folders.
|
|
8242
|
-
parent:
|
|
8242
|
+
parent: mkdir12(dirname11(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
|
+
mkdir12(".");
|
|
8251
8251
|
for (const file2 of files) {
|
|
8252
8252
|
mkfile(file2.path, file2);
|
|
8253
8253
|
}
|
|
@@ -8437,12 +8437,12 @@ If you're a developer and you believe this is a bug in isomorphic-git, please fi
|
|
|
8437
8437
|
};
|
|
8438
8438
|
NoRefspecError.code = "NoRefspecError";
|
|
8439
8439
|
var GitPackedRefs = class _GitPackedRefs {
|
|
8440
|
-
constructor(
|
|
8440
|
+
constructor(text2) {
|
|
8441
8441
|
this.refs = /* @__PURE__ */ new Map();
|
|
8442
8442
|
this.parsedConfig = [];
|
|
8443
|
-
if (
|
|
8443
|
+
if (text2) {
|
|
8444
8444
|
let key = null;
|
|
8445
|
-
this.parsedConfig =
|
|
8445
|
+
this.parsedConfig = text2.trim().split("\n").map((line) => {
|
|
8446
8446
|
if (/^\s*#/.test(line)) {
|
|
8447
8447
|
return { line, comment: true };
|
|
8448
8448
|
}
|
|
@@ -8461,8 +8461,8 @@ If you're a developer and you believe this is a bug in isomorphic-git, please fi
|
|
|
8461
8461
|
}
|
|
8462
8462
|
return this;
|
|
8463
8463
|
}
|
|
8464
|
-
static from(
|
|
8465
|
-
return new _GitPackedRefs(
|
|
8464
|
+
static from(text2) {
|
|
8465
|
+
return new _GitPackedRefs(text2);
|
|
8466
8466
|
}
|
|
8467
8467
|
delete(ref) {
|
|
8468
8468
|
this.parsedConfig = this.parsedConfig.filter((entry) => entry.ref !== ref);
|
|
@@ -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 join15(...args) {
|
|
8654
8654
|
if (args.length === 0) return ".";
|
|
8655
8655
|
let joined;
|
|
8656
8656
|
for (let i2 = 0; i2 < args.length; ++i2) {
|
|
@@ -8732,22 +8732,22 @@ If you're a developer and you believe this is a bug in isomorphic-git, please fi
|
|
|
8732
8732
|
}
|
|
8733
8733
|
return valueWithoutComment;
|
|
8734
8734
|
};
|
|
8735
|
-
var hasOddNumberOfQuotes = (
|
|
8736
|
-
const numberOfQuotes = (
|
|
8735
|
+
var hasOddNumberOfQuotes = (text2) => {
|
|
8736
|
+
const numberOfQuotes = (text2.match(/(?:^|[^\\])"/g) || []).length;
|
|
8737
8737
|
return numberOfQuotes % 2 !== 0;
|
|
8738
8738
|
};
|
|
8739
|
-
var removeQuotes = (
|
|
8740
|
-
return
|
|
8741
|
-
const isQuote = c === '"' &&
|
|
8742
|
-
const isEscapeForQuote = c === "\\" &&
|
|
8739
|
+
var removeQuotes = (text2) => {
|
|
8740
|
+
return text2.split("").reduce((newText, c, idx, text3) => {
|
|
8741
|
+
const isQuote = c === '"' && text3[idx - 1] !== "\\";
|
|
8742
|
+
const isEscapeForQuote = c === "\\" && text3[idx + 1] === '"';
|
|
8743
8743
|
if (isQuote || isEscapeForQuote) {
|
|
8744
8744
|
return newText;
|
|
8745
8745
|
}
|
|
8746
8746
|
return newText + c;
|
|
8747
8747
|
}, "");
|
|
8748
8748
|
};
|
|
8749
|
-
var lower = (
|
|
8750
|
-
return
|
|
8749
|
+
var lower = (text2) => {
|
|
8750
|
+
return text2 != null ? text2.toLowerCase() : null;
|
|
8751
8751
|
};
|
|
8752
8752
|
var getPath = (section, subsection, name2) => {
|
|
8753
8753
|
return [lower(section), subsection, lower(name2)].filter((a) => a != null).join(".");
|
|
@@ -8772,10 +8772,10 @@ If you're a developer and you believe this is a bug in isomorphic-git, please fi
|
|
|
8772
8772
|
}, -1);
|
|
8773
8773
|
};
|
|
8774
8774
|
var GitConfig = class _GitConfig {
|
|
8775
|
-
constructor(
|
|
8775
|
+
constructor(text2) {
|
|
8776
8776
|
let section = null;
|
|
8777
8777
|
let subsection = null;
|
|
8778
|
-
this.parsedConfig =
|
|
8778
|
+
this.parsedConfig = text2 ? text2.split("\n").map((line) => {
|
|
8779
8779
|
let name2 = null;
|
|
8780
8780
|
let value = null;
|
|
8781
8781
|
const trimmedLine = line.trim();
|
|
@@ -8796,8 +8796,8 @@ If you're a developer and you believe this is a bug in isomorphic-git, please fi
|
|
|
8796
8796
|
return { line, isSection, section, subsection, name: name2, value, path };
|
|
8797
8797
|
}) : [];
|
|
8798
8798
|
}
|
|
8799
|
-
static from(
|
|
8800
|
-
return new _GitConfig(
|
|
8799
|
+
static from(text2) {
|
|
8800
|
+
return new _GitConfig(text2);
|
|
8801
8801
|
}
|
|
8802
8802
|
async get(path, getall = false) {
|
|
8803
8803
|
const normalizedPath = normalizePath(path).path;
|
|
@@ -8908,8 +8908,8 @@ If you're a developer and you believe this is a bug in isomorphic-git, please fi
|
|
|
8908
8908
|
* @returns {Promise<GitConfig>} A `GitConfig` object representing the parsed configuration.
|
|
8909
8909
|
*/
|
|
8910
8910
|
static async get({ fs: fs2, gitdir }) {
|
|
8911
|
-
const
|
|
8912
|
-
return GitConfig.from(
|
|
8911
|
+
const text2 = await fs2.read(`${gitdir}/config`, { encoding: "utf8" });
|
|
8912
|
+
return GitConfig.from(text2);
|
|
8913
8913
|
}
|
|
8914
8914
|
/**
|
|
8915
8915
|
* Saves the provided Git configuration to the specified `.git` directory.
|
|
@@ -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(join15(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(join15(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(join15(gitdir, ref), `ref: ${value.trim()}
|
|
9098
9098
|
`, "utf8")
|
|
9099
9099
|
);
|
|
9100
9100
|
}
|
|
@@ -9121,12 +9121,12 @@ 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(
|
|
9125
|
-
let
|
|
9124
|
+
await Promise.all(refs.map((ref) => fs2.rm(join15(gitdir, ref))));
|
|
9125
|
+
let text2 = await acquireLock(
|
|
9126
9126
|
"packed-refs",
|
|
9127
9127
|
async () => fs2.read(`${gitdir}/packed-refs`, { encoding: "utf8" })
|
|
9128
9128
|
);
|
|
9129
|
-
const packed = GitPackedRefs.from(
|
|
9129
|
+
const packed = GitPackedRefs.from(text2);
|
|
9130
9130
|
const beforeSize = packed.refs.size;
|
|
9131
9131
|
for (const ref of refs) {
|
|
9132
9132
|
if (packed.refs.has(ref)) {
|
|
@@ -9134,10 +9134,10 @@ If you're a developer and you believe this is a bug in isomorphic-git, please fi
|
|
|
9134
9134
|
}
|
|
9135
9135
|
}
|
|
9136
9136
|
if (packed.refs.size < beforeSize) {
|
|
9137
|
-
|
|
9137
|
+
text2 = packed.toString();
|
|
9138
9138
|
await acquireLock(
|
|
9139
9139
|
"packed-refs",
|
|
9140
|
-
async () => fs2.write(`${gitdir}/packed-refs`,
|
|
9140
|
+
async () => fs2.write(`${gitdir}/packed-refs`, text2, { encoding: "utf8" })
|
|
9141
9141
|
);
|
|
9142
9142
|
}
|
|
9143
9143
|
}
|
|
@@ -9330,11 +9330,11 @@ If you're a developer and you believe this is a bug in isomorphic-git, please fi
|
|
|
9330
9330
|
* @returns {Promise<Map<string, string>>} - A map of packed refs.
|
|
9331
9331
|
*/
|
|
9332
9332
|
static async packedRefs({ fs: fs2, gitdir }) {
|
|
9333
|
-
const
|
|
9333
|
+
const text2 = await acquireLock(
|
|
9334
9334
|
"packed-refs",
|
|
9335
9335
|
async () => fs2.read(`${gitdir}/packed-refs`, { encoding: "utf8" })
|
|
9336
9336
|
);
|
|
9337
|
-
const packed = GitPackedRefs.from(
|
|
9337
|
+
const packed = GitPackedRefs.from(text2);
|
|
9338
9338
|
return packed.refs;
|
|
9339
9339
|
}
|
|
9340
9340
|
/**
|
|
@@ -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(join15(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(join15(filepath, entry2.path), entry2);
|
|
11069
11069
|
}
|
|
11070
|
-
return tree.entries().map((entry2) =>
|
|
11070
|
+
return tree.entries().map((entry2) => join15(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(join15(dir, filepath));
|
|
11164
11164
|
if (names === null) return null;
|
|
11165
|
-
return names.map((name2) =>
|
|
11165
|
+
return names.map((name2) => join15(filepath, name2));
|
|
11166
11166
|
}
|
|
11167
11167
|
async type(entry) {
|
|
11168
11168
|
if (entry._type === false) {
|
|
@@ -11383,24 +11383,24 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
|
|
|
11383
11383
|
};
|
|
11384
11384
|
return walk2(root);
|
|
11385
11385
|
}
|
|
11386
|
-
async function mkdirp(
|
|
11386
|
+
async function mkdirp(mkdir12, filepath, retries = 10) {
|
|
11387
11387
|
try {
|
|
11388
|
-
await
|
|
11388
|
+
await mkdir12(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 = dirname11(filepath);
|
|
11394
11394
|
if (parent === "." || parent === "/" || parent === filepath) throw err2;
|
|
11395
|
-
await mkdirp(
|
|
11395
|
+
await mkdirp(mkdir12, parent, retries);
|
|
11396
11396
|
for (let attempt = 0; ; attempt++) {
|
|
11397
11397
|
try {
|
|
11398
|
-
await
|
|
11398
|
+
await mkdir12(filepath);
|
|
11399
11399
|
return;
|
|
11400
11400
|
} catch (err22) {
|
|
11401
11401
|
if (err22 === null || err22.code === "EEXIST") return;
|
|
11402
11402
|
if (err22.code === "ENOENT" && attempt < retries) {
|
|
11403
|
-
await new Promise((
|
|
11403
|
+
await new Promise((resolve15) => setTimeout(resolve15, 0));
|
|
11404
11404
|
continue;
|
|
11405
11405
|
}
|
|
11406
11406
|
throw err22;
|
|
@@ -11415,7 +11415,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
|
|
|
11415
11415
|
} else if (entries.length) {
|
|
11416
11416
|
await Promise.all(
|
|
11417
11417
|
entries.map((entry) => {
|
|
11418
|
-
const subpath =
|
|
11418
|
+
const subpath = join15(filepath, entry);
|
|
11419
11419
|
return fs2.lstat(subpath).then((stat8) => {
|
|
11420
11420
|
if (!stat8) return;
|
|
11421
11421
|
return stat8.isDirectory() ? rmRecursive(fs2, subpath) : fs2.rm(subpath);
|
|
@@ -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(dirname11(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 = join15(dirname11(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 = join15(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 = join15(dir, ".git"), filepath }) {
|
|
11807
11807
|
if (basename6(filepath) === ".git") return true;
|
|
11808
11808
|
if (filepath === ".") return false;
|
|
11809
11809
|
let excludes = "";
|
|
11810
|
-
const excludesFile =
|
|
11810
|
+
const excludesFile = join15(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: join15(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: join15(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 = dirname11(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 = join15(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(join15(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(join15(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: [join15(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: [join15(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(join15(dir, currentFilepath)).then(posixifyPathBuffer) : await fs2.read(join15(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 = join15(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 = join15(dir, ".git"),
|
|
12514
12514
|
remote,
|
|
12515
12515
|
url: url2,
|
|
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 = join15(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 = join15(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 = join15(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 = join15(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 = join15(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(join15(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 = join15(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 = join15(dir, ".git"),
|
|
13996
13996
|
oid,
|
|
13997
13997
|
cache = {},
|
|
13998
13998
|
committer,
|
|
@@ -14497,13 +14497,13 @@ ${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 = join15(gitdir, "shallow");
|
|
14501
14501
|
const oids = /* @__PURE__ */ new Set();
|
|
14502
14502
|
await acquireLock(filepath, async function() {
|
|
14503
|
-
const
|
|
14504
|
-
if (
|
|
14505
|
-
if (
|
|
14506
|
-
|
|
14503
|
+
const text2 = await fs2.read(filepath, { encoding: "utf8" });
|
|
14504
|
+
if (text2 === null) return oids;
|
|
14505
|
+
if (text2.trim() === "") return oids;
|
|
14506
|
+
text2.trim().split("\n").map((oid) => oids.add(oid));
|
|
14507
14507
|
});
|
|
14508
14508
|
return oids;
|
|
14509
14509
|
}
|
|
@@ -14518,11 +14518,11 @@ ${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 = join15(gitdir, "shallow");
|
|
14522
14522
|
if (oids.size > 0) {
|
|
14523
|
-
const
|
|
14523
|
+
const text2 = [...oids].join("\n") + "\n";
|
|
14524
14524
|
await acquireLock(filepath, async function() {
|
|
14525
|
-
await fs2.write(filepath,
|
|
14525
|
+
await fs2.write(filepath, text2, {
|
|
14526
14526
|
encoding: "utf8"
|
|
14527
14527
|
});
|
|
14528
14528
|
});
|
|
@@ -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(join15(gitdir, "objects/pack"));
|
|
14548
14548
|
list3 = list3.filter((x2) => x2.endsWith(".idx"));
|
|
14549
14549
|
for (const filename of list3) {
|
|
14550
14550
|
const indexFile = `${gitdir}/objects/pack/${filename}`;
|
|
@@ -14616,9 +14616,9 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
|
|
|
14616
14616
|
throw Error("You cannot write to a FIFO that has already been ended!");
|
|
14617
14617
|
}
|
|
14618
14618
|
if (this._waiting) {
|
|
14619
|
-
const
|
|
14619
|
+
const resolve15 = this._waiting;
|
|
14620
14620
|
this._waiting = null;
|
|
14621
|
-
|
|
14621
|
+
resolve15({ value: chunk });
|
|
14622
14622
|
} else {
|
|
14623
14623
|
this._queue.push(chunk);
|
|
14624
14624
|
}
|
|
@@ -14626,9 +14626,9 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
|
|
|
14626
14626
|
end() {
|
|
14627
14627
|
this._ended = true;
|
|
14628
14628
|
if (this._waiting) {
|
|
14629
|
-
const
|
|
14629
|
+
const resolve15 = this._waiting;
|
|
14630
14630
|
this._waiting = null;
|
|
14631
|
-
|
|
14631
|
+
resolve15({ done: true });
|
|
14632
14632
|
}
|
|
14633
14633
|
}
|
|
14634
14634
|
destroy(err2) {
|
|
@@ -14647,8 +14647,8 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
|
|
|
14647
14647
|
"You cannot call read until the previous call to read has returned!"
|
|
14648
14648
|
);
|
|
14649
14649
|
}
|
|
14650
|
-
return new Promise((
|
|
14651
|
-
this._waiting =
|
|
14650
|
+
return new Promise((resolve15) => {
|
|
14651
|
+
this._waiting = resolve15;
|
|
14652
14652
|
});
|
|
14653
14653
|
}
|
|
14654
14654
|
};
|
|
@@ -14803,7 +14803,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
|
|
|
14803
14803
|
const acks = [];
|
|
14804
14804
|
let nak = false;
|
|
14805
14805
|
let done = false;
|
|
14806
|
-
return new Promise((
|
|
14806
|
+
return new Promise((resolve15, reject) => {
|
|
14807
14807
|
forAwait2(packetlines, (data) => {
|
|
14808
14808
|
const line = data.toString("utf8").trim();
|
|
14809
14809
|
if (line.startsWith("shallow")) {
|
|
@@ -14830,11 +14830,11 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
|
|
|
14830
14830
|
nak = true;
|
|
14831
14831
|
}
|
|
14832
14832
|
if (done) {
|
|
14833
|
-
stream.error ? reject(stream.error) :
|
|
14833
|
+
stream.error ? reject(stream.error) : resolve15({ shallows, unshallows, acks, nak, packfile, progress });
|
|
14834
14834
|
}
|
|
14835
14835
|
}).finally(() => {
|
|
14836
14836
|
if (!done) {
|
|
14837
|
-
stream.error ? reject(stream.error) :
|
|
14837
|
+
stream.error ? reject(stream.error) : resolve15({ shallows, unshallows, acks, nak, packfile, progress });
|
|
14838
14838
|
}
|
|
14839
14839
|
});
|
|
14840
14840
|
});
|
|
@@ -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 = join15(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 : join15(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 = join15(dir, ".git"),
|
|
15269
15269
|
url: url2,
|
|
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 = join15(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 = join15(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 = join15(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 = join15(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 = join15(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 = join15(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(join15(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 = join15(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 = join15(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 = join15(dir, ".git"),
|
|
15866
15866
|
ref,
|
|
15867
15867
|
url: url2,
|
|
15868
15868
|
remote,
|
|
@@ -15920,7 +15920,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
|
|
|
15920
15920
|
onAuthSuccess,
|
|
15921
15921
|
onAuthFailure,
|
|
15922
15922
|
dir,
|
|
15923
|
-
gitdir =
|
|
15923
|
+
gitdir = join15(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 = join15(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(join15(filepath, ".git"))) {
|
|
16002
16002
|
return filepath;
|
|
16003
16003
|
} else {
|
|
16004
|
-
const parent =
|
|
16004
|
+
const parent = dirname11(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 = join15(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 = join15(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 = join15(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 = join15(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 : join15(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 = join15(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 = join15(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 = join15(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: join15(prefix, entry.path)
|
|
16468
16468
|
});
|
|
16469
16469
|
} else {
|
|
16470
|
-
filenames.push(
|
|
16470
|
+
filenames.push(join15(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 = join15(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 = join15(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 = join15(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 = join15(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 = join15(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 = join15(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: join15(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 = join15(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 = join15(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 = join15(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(join15(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 = join15(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 = join15(dir, ".git"),
|
|
17116
17116
|
ref,
|
|
17117
17117
|
url: url2,
|
|
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 = join15(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 = join15(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 = join15(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 = join15(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 = join15(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 = join15(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 = join15(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 = join15(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 = join15(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 = join15(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 = join15(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 = join15(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 = join15(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(join15(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(join15(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 = join15(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 = join15(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 = join15(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 join15(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 join15(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 = join15(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) => join15(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 = join15(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(join15(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(join15(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 dirname12 = path.shift();
|
|
18700
18700
|
for (const entry of tree) {
|
|
18701
|
-
if (entry.path ===
|
|
18701
|
+
if (entry.path === dirname12) {
|
|
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 = join15(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 = join15(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 = join15(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(join15(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(join15(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(join15(dir, filepath)) : await fs2.read(join15(dir, filepath));
|
|
18906
18906
|
oid = await _writeObject({
|
|
18907
18907
|
fs: fs2,
|
|
18908
18908
|
gitdir: updatedGitdir,
|
|
@@ -18946,7 +18946,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
|
|
|
18946
18946
|
async function walk({
|
|
18947
18947
|
fs: fs2,
|
|
18948
18948
|
dir,
|
|
18949
|
-
gitdir =
|
|
18949
|
+
gitdir = join15(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 = join15(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 = join15(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 = join15(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 = join15(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 = join15(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 = join15(dir, ".git"), tree }) {
|
|
19140
19140
|
try {
|
|
19141
19141
|
assertParameter("fs", fs2);
|
|
19142
19142
|
assertParameter("gitdir", gitdir);
|
|
@@ -19761,7 +19761,7 @@ var require_ignore2 = __commonJS({
|
|
|
19761
19761
|
// cli/package.json
|
|
19762
19762
|
var package_default = {
|
|
19763
19763
|
name: "@docyrus/animaguru",
|
|
19764
|
-
version: "0.
|
|
19764
|
+
version: "0.15.0",
|
|
19765
19765
|
description: "Agent-friendly AnimaGuru CLI built with CrustJS",
|
|
19766
19766
|
type: "module",
|
|
19767
19767
|
bin: {
|
|
@@ -20027,8 +20027,8 @@ var sectionOwnerLabels = {
|
|
|
20027
20027
|
extension: "Extension"
|
|
20028
20028
|
};
|
|
20029
20029
|
function invalidSections({ subject, name: name2 }) {
|
|
20030
|
-
const
|
|
20031
|
-
return new CrustError("DEFINITION", `${
|
|
20030
|
+
const label3 = sectionOwnerLabels[subject];
|
|
20031
|
+
return new CrustError("DEFINITION", `${label3} "${name2}" contains invalid documentation sections`, {
|
|
20032
20032
|
subject,
|
|
20033
20033
|
name: name2,
|
|
20034
20034
|
reason: "invalid-sections"
|
|
@@ -20317,23 +20317,23 @@ function installExtensionContexts(node2, extensions, reRegisteredIds) {
|
|
|
20317
20317
|
}
|
|
20318
20318
|
return cloned;
|
|
20319
20319
|
}
|
|
20320
|
-
function coerceUrl(raw,
|
|
20320
|
+
function coerceUrl(raw, label3) {
|
|
20321
20321
|
try {
|
|
20322
20322
|
return new URL(raw);
|
|
20323
20323
|
} catch (err2) {
|
|
20324
|
-
throw new CrustError("PARSE", `Invalid URL for ${
|
|
20324
|
+
throw new CrustError("PARSE", `Invalid URL for ${label3}: "${raw}"${/^[a-z][a-z0-9+.-]*:/i.test(raw) ? "" : " (missing protocol \u2014 e.g. https://example.com)"}`).withCause(err2);
|
|
20325
20325
|
}
|
|
20326
20326
|
}
|
|
20327
|
-
function coercePath(raw,
|
|
20328
|
-
if (raw === "") throw new CrustError("PARSE", `Path for ${
|
|
20327
|
+
function coercePath(raw, label3) {
|
|
20328
|
+
if (raw === "") throw new CrustError("PARSE", `Path for ${label3} cannot be empty`);
|
|
20329
20329
|
const expanded = raw.replace(/^~(?=\/|$)/, () => homedir());
|
|
20330
20330
|
return resolve(process.cwd(), expanded);
|
|
20331
20331
|
}
|
|
20332
|
-
function coerceJson(raw,
|
|
20332
|
+
function coerceJson(raw, label3) {
|
|
20333
20333
|
try {
|
|
20334
20334
|
return JSON.parse(raw);
|
|
20335
20335
|
} catch (err2) {
|
|
20336
|
-
throw new CrustError("PARSE", `Invalid JSON for ${
|
|
20336
|
+
throw new CrustError("PARSE", `Invalid JSON for ${label3}: ${err2 instanceof Error ? err2.message : String(err2)}. Tip: wrap JSON in single quotes on the command line, e.g. --flag '{"k":1}'`).withCause(err2);
|
|
20337
20337
|
}
|
|
20338
20338
|
}
|
|
20339
20339
|
async function runSchema(schema, raw, path, issues) {
|
|
@@ -20379,23 +20379,23 @@ function buildParseArgsOptionDescriptor(spellings) {
|
|
|
20379
20379
|
}
|
|
20380
20380
|
return options;
|
|
20381
20381
|
}
|
|
20382
|
-
function coerceValue(value, type,
|
|
20382
|
+
function coerceValue(value, type, label3) {
|
|
20383
20383
|
if (type === "number") {
|
|
20384
20384
|
const num = tryCoerceNumber(value);
|
|
20385
|
-
if (num === void 0) throw new CrustError("PARSE", `Expected number for ${
|
|
20385
|
+
if (num === void 0) throw new CrustError("PARSE", `Expected number for ${label3}, got "${value}"`);
|
|
20386
20386
|
return num;
|
|
20387
20387
|
}
|
|
20388
20388
|
if (type === "boolean") return coerceBooleanString(value);
|
|
20389
|
-
if (type === "url") return coerceUrl(value,
|
|
20390
|
-
if (type === "path") return coercePath(value,
|
|
20391
|
-
if (type === "json") return coerceJson(value,
|
|
20389
|
+
if (type === "url") return coerceUrl(value, label3);
|
|
20390
|
+
if (type === "path") return coercePath(value, label3);
|
|
20391
|
+
if (type === "json") return coerceJson(value, label3);
|
|
20392
20392
|
return value;
|
|
20393
20393
|
}
|
|
20394
|
-
function validateChoice(raw, choices,
|
|
20395
|
-
if (!choices.includes(raw)) throw new CrustError("PARSE", `Invalid value "${raw}" for ${
|
|
20394
|
+
function validateChoice(raw, choices, label3) {
|
|
20395
|
+
if (!choices.includes(raw)) throw new CrustError("PARSE", `Invalid value "${raw}" for ${label3}. Expected one of: ${choices.join(", ")}`);
|
|
20396
20396
|
}
|
|
20397
|
-
function invokeParse(parse4, raw,
|
|
20398
|
-
const location = index2 === void 0 ?
|
|
20397
|
+
function invokeParse(parse4, raw, label3, index2) {
|
|
20398
|
+
const location = index2 === void 0 ? label3 : `${label3} element [${index2}]`;
|
|
20399
20399
|
let result;
|
|
20400
20400
|
try {
|
|
20401
20401
|
result = parse4(raw);
|
|
@@ -20409,29 +20409,29 @@ function invokeParse(parse4, raw, label2, index2) {
|
|
|
20409
20409
|
}
|
|
20410
20410
|
return result;
|
|
20411
20411
|
}
|
|
20412
|
-
function resolveDefault(def,
|
|
20412
|
+
function resolveDefault(def, label3) {
|
|
20413
20413
|
const { default: defaultValue, parse: parse4 } = def;
|
|
20414
20414
|
if (defaultValue === void 0) return void 0;
|
|
20415
20415
|
if (parse4) {
|
|
20416
|
-
if (Array.isArray(defaultValue)) return defaultValue.map((v, i2) => invokeParse(parse4, String(v),
|
|
20417
|
-
return invokeParse(parse4, String(defaultValue),
|
|
20416
|
+
if (Array.isArray(defaultValue)) return defaultValue.map((v, i2) => invokeParse(parse4, String(v), label3, i2));
|
|
20417
|
+
return invokeParse(parse4, String(defaultValue), label3);
|
|
20418
20418
|
}
|
|
20419
20419
|
if (def.type === "path") {
|
|
20420
|
-
if (Array.isArray(defaultValue)) return defaultValue.map((v) => coercePath(String(v),
|
|
20421
|
-
return coercePath(String(defaultValue),
|
|
20420
|
+
if (Array.isArray(defaultValue)) return defaultValue.map((v) => coercePath(String(v), label3));
|
|
20421
|
+
return coercePath(String(defaultValue), label3);
|
|
20422
20422
|
}
|
|
20423
20423
|
return "multiple" in def && def.multiple && Array.isArray(defaultValue) ? [...defaultValue] : defaultValue;
|
|
20424
20424
|
}
|
|
20425
|
-
function coerceToken(def, raw,
|
|
20425
|
+
function coerceToken(def, raw, label3, index2) {
|
|
20426
20426
|
if (def.schema) return raw;
|
|
20427
|
-
if (def.choices) validateChoice(raw, def.choices,
|
|
20428
|
-
if (def.parse) return invokeParse(def.parse, raw,
|
|
20429
|
-
return coerceValue(raw, def.type,
|
|
20427
|
+
if (def.choices) validateChoice(raw, def.choices, label3);
|
|
20428
|
+
if (def.parse) return invokeParse(def.parse, raw, label3, index2);
|
|
20429
|
+
return coerceValue(raw, def.type, label3);
|
|
20430
20430
|
}
|
|
20431
20431
|
function coerceFlagValue(name2, def, parsed) {
|
|
20432
20432
|
if (parsed.kind === "boolean") return parsed.value;
|
|
20433
|
-
const
|
|
20434
|
-
return Array.isArray(parsed.value) ? parsed.value.map((value, i2) => coerceToken(def, value,
|
|
20433
|
+
const label3 = `--${name2}`;
|
|
20434
|
+
return Array.isArray(parsed.value) ? parsed.value.map((value, i2) => coerceToken(def, value, label3, i2)) : coerceToken(def, parsed.value, label3);
|
|
20435
20435
|
}
|
|
20436
20436
|
function resolveAliases(tokens, spellings) {
|
|
20437
20437
|
const canonical = {};
|
|
@@ -20524,7 +20524,7 @@ function resolveArgs(argsDef, positionals, coerce) {
|
|
|
20524
20524
|
let index2 = 0;
|
|
20525
20525
|
for (const def of argsDef) {
|
|
20526
20526
|
const { name: name2 } = def;
|
|
20527
|
-
const
|
|
20527
|
+
const label3 = `<${name2}>`;
|
|
20528
20528
|
Object.defineProperty(resolved, name2, {
|
|
20529
20529
|
value: void 0,
|
|
20530
20530
|
writable: true,
|
|
@@ -20533,12 +20533,12 @@ function resolveArgs(argsDef, positionals, coerce) {
|
|
|
20533
20533
|
});
|
|
20534
20534
|
if (def.variadic) {
|
|
20535
20535
|
const remaining = positionals.slice(index2);
|
|
20536
|
-
resolved[name2] = remaining.length === 0 && def.default !== void 0 ? [resolveDefault(def,
|
|
20536
|
+
resolved[name2] = remaining.length === 0 && def.default !== void 0 ? [resolveDefault(def, label3)] : remaining.map((v, i2) => coerce(def, v, label3, i2));
|
|
20537
20537
|
index2 = positionals.length;
|
|
20538
20538
|
} else if (index2 < positionals.length) {
|
|
20539
|
-
resolved[name2] = coerce(def, positionals[index2],
|
|
20539
|
+
resolved[name2] = coerce(def, positionals[index2], label3);
|
|
20540
20540
|
index2++;
|
|
20541
|
-
} else resolved[name2] = resolveDefault(def,
|
|
20541
|
+
} else resolved[name2] = resolveDefault(def, label3);
|
|
20542
20542
|
}
|
|
20543
20543
|
return {
|
|
20544
20544
|
args: resolved,
|
|
@@ -20600,7 +20600,7 @@ function tokenizeArgv(command, argv) {
|
|
|
20600
20600
|
function isOccurrenceArray(value) {
|
|
20601
20601
|
return Array.isArray(value);
|
|
20602
20602
|
}
|
|
20603
|
-
function validateStructuredValue(def, value,
|
|
20603
|
+
function validateStructuredValue(def, value, label3) {
|
|
20604
20604
|
const type = def.schema ? def.type === "boolean" ? "boolean" : "string" : def.type;
|
|
20605
20605
|
let valid;
|
|
20606
20606
|
if (type === "url") valid = value instanceof URL;
|
|
@@ -20620,21 +20620,21 @@ function validateStructuredValue(def, value, label2) {
|
|
|
20620
20620
|
}
|
|
20621
20621
|
}
|
|
20622
20622
|
} else valid = typeof value === (type === "path" ? "string" : type);
|
|
20623
|
-
if (!valid) throw new CrustError("PARSE", `Expected ${type} for ${
|
|
20624
|
-
if (value === false && "noNegate" in def && def.noNegate) throw new CrustError("PARSE", `Flag "${
|
|
20623
|
+
if (!valid) throw new CrustError("PARSE", `Expected ${type} for ${label3}`);
|
|
20624
|
+
if (value === false && "noNegate" in def && def.noNegate) throw new CrustError("PARSE", `Flag "${label3}" does not support negation`);
|
|
20625
20625
|
}
|
|
20626
|
-
function coerceStructuredValue(def, value,
|
|
20627
|
-
validateStructuredValue(def, value,
|
|
20626
|
+
function coerceStructuredValue(def, value, label3, index2) {
|
|
20627
|
+
validateStructuredValue(def, value, label3);
|
|
20628
20628
|
if (def.type !== "string" && def.type !== "path") return value;
|
|
20629
|
-
return coerceToken(def, String(value),
|
|
20629
|
+
return coerceToken(def, String(value), label3, index2);
|
|
20630
20630
|
}
|
|
20631
20631
|
function coerceStructuredFlag(name2, def, value) {
|
|
20632
|
-
const
|
|
20632
|
+
const label3 = `--${name2}`;
|
|
20633
20633
|
if (def.multiple) {
|
|
20634
|
-
if (!isOccurrenceArray(value)) throw new CrustError("PARSE", `Expected an occurrence array for ${
|
|
20635
|
-
return value.map((item, i2) => coerceStructuredValue(def, item,
|
|
20634
|
+
if (!isOccurrenceArray(value)) throw new CrustError("PARSE", `Expected an occurrence array for ${label3}`);
|
|
20635
|
+
return value.map((item, i2) => coerceStructuredValue(def, item, label3, i2));
|
|
20636
20636
|
}
|
|
20637
|
-
return coerceStructuredValue(def, value,
|
|
20637
|
+
return coerceStructuredValue(def, value, label3);
|
|
20638
20638
|
}
|
|
20639
20639
|
function bind(command, positionals, flagValues, coerceArg, coerceFlag) {
|
|
20640
20640
|
const flags = resolveFlags(command.effectiveFlags, flagValues, coerceFlag);
|
|
@@ -21017,13 +21017,13 @@ function resolveCommand(command, argv) {
|
|
|
21017
21017
|
}
|
|
21018
21018
|
var ignoreStreamError = () => {
|
|
21019
21019
|
};
|
|
21020
|
-
function writeLine(stream,
|
|
21020
|
+
function writeLine(stream, text2) {
|
|
21021
21021
|
const absorb = () => {
|
|
21022
21022
|
if (stream.listenerCount("error") === 0) stream.once("error", ignoreStreamError);
|
|
21023
21023
|
};
|
|
21024
21024
|
try {
|
|
21025
21025
|
absorb();
|
|
21026
|
-
stream.write(`${
|
|
21026
|
+
stream.write(`${text2}
|
|
21027
21027
|
`, (error62) => {
|
|
21028
21028
|
if (error62) absorb();
|
|
21029
21029
|
});
|
|
@@ -21033,8 +21033,8 @@ function writeLine(stream, text) {
|
|
|
21033
21033
|
}
|
|
21034
21034
|
}
|
|
21035
21035
|
var DEFAULT_IO = {
|
|
21036
|
-
stdout: (
|
|
21037
|
-
stderr: (
|
|
21036
|
+
stdout: (text2) => writeLine(process.stdout, text2),
|
|
21037
|
+
stderr: (text2) => writeLine(process.stderr, text2)
|
|
21038
21038
|
};
|
|
21039
21039
|
var SNAPSHOT_PATH_ENV = "CRUST_INTERNAL_SNAPSHOT_PATH";
|
|
21040
21040
|
var EXIT_CODE_CANCELLED = 130;
|
|
@@ -21048,7 +21048,7 @@ function isSuppressedError(error62) {
|
|
|
21048
21048
|
function isObjectLike(value) {
|
|
21049
21049
|
return typeof value === "object" && value !== null;
|
|
21050
21050
|
}
|
|
21051
|
-
function describeFailure(error62,
|
|
21051
|
+
function describeFailure(error62, label3 = "Error") {
|
|
21052
21052
|
const messages = [];
|
|
21053
21053
|
const seen = /* @__PURE__ */ new Set();
|
|
21054
21054
|
let remaining = 256;
|
|
@@ -21097,7 +21097,7 @@ function describeFailure(error62, label2 = "Error") {
|
|
|
21097
21097
|
}
|
|
21098
21098
|
};
|
|
21099
21099
|
visitMember(() => error62);
|
|
21100
|
-
return messages.map((message) => `${
|
|
21100
|
+
return messages.map((message) => `${label3}: ${message}`).join("\n");
|
|
21101
21101
|
}
|
|
21102
21102
|
function freezeTree(node2) {
|
|
21103
21103
|
Object.freeze(node2);
|
|
@@ -21305,13 +21305,13 @@ async function runInvocation(node2, input2, options, materializeCommandDefinitio
|
|
|
21305
21305
|
try {
|
|
21306
21306
|
const { signal = new AbortController().signal, ...sinks } = options ?? {};
|
|
21307
21307
|
const resolvedIO = {
|
|
21308
|
-
stdout(
|
|
21309
|
-
stdout.push(
|
|
21310
|
-
sinks.stdout?.(
|
|
21308
|
+
stdout(text2) {
|
|
21309
|
+
stdout.push(text2);
|
|
21310
|
+
sinks.stdout?.(text2);
|
|
21311
21311
|
},
|
|
21312
|
-
stderr(
|
|
21313
|
-
stderr.push(
|
|
21314
|
-
sinks.stderr?.(
|
|
21312
|
+
stderr(text2) {
|
|
21313
|
+
stderr.push(text2);
|
|
21314
|
+
sinks.stderr?.(text2);
|
|
21315
21315
|
}
|
|
21316
21316
|
};
|
|
21317
21317
|
return {
|
|
@@ -21829,10 +21829,10 @@ function stringWidthJs(input2) {
|
|
|
21829
21829
|
function stringWidth(input2) {
|
|
21830
21830
|
return globalThis.Bun?.stringWidth(input2, { countAnsiEscapeCodes: false }) ?? stringWidthJs(input2);
|
|
21831
21831
|
}
|
|
21832
|
-
function padEnd(
|
|
21833
|
-
const currentWidth = stringWidth(
|
|
21834
|
-
if (currentWidth >= width) return
|
|
21835
|
-
return
|
|
21832
|
+
function padEnd(text2, width, fillChar = " ") {
|
|
21833
|
+
const currentWidth = stringWidth(text2);
|
|
21834
|
+
if (currentWidth >= width) return text2;
|
|
21835
|
+
return text2 + fillChar.repeat(width - currentWidth);
|
|
21836
21836
|
}
|
|
21837
21837
|
var modifierCodes = {
|
|
21838
21838
|
/** Bold / increased intensity. */
|
|
@@ -22694,9 +22694,9 @@ var namedColorValues = {
|
|
|
22694
22694
|
50
|
|
22695
22695
|
]
|
|
22696
22696
|
};
|
|
22697
|
-
function applyStyle(
|
|
22698
|
-
if (
|
|
22699
|
-
let result = String(
|
|
22697
|
+
function applyStyle(text2, style2) {
|
|
22698
|
+
if (text2 == null) return "";
|
|
22699
|
+
let result = String(text2);
|
|
22700
22700
|
if (result === "") return "";
|
|
22701
22701
|
const { open: open7, close } = style2;
|
|
22702
22702
|
if (result.includes(close)) result = result.replaceAll(close, close + open7);
|
|
@@ -22800,15 +22800,15 @@ function colorPair(kind, input2, depth) {
|
|
|
22800
22800
|
close: kind === "fg" ? FG_CLOSE : BG_CLOSE
|
|
22801
22801
|
};
|
|
22802
22802
|
}
|
|
22803
|
-
function paint(kind,
|
|
22803
|
+
function paint(kind, text2, input2, depth) {
|
|
22804
22804
|
const pair = colorPair(kind, input2, depth);
|
|
22805
|
-
return depth === "none" ?
|
|
22805
|
+
return depth === "none" ? text2 : applyStyle(text2, pair);
|
|
22806
22806
|
}
|
|
22807
22807
|
var OSC = "\x1B]";
|
|
22808
22808
|
var ST = "\x1B\\";
|
|
22809
22809
|
var HYPERLINK_CLOSE = `${OSC}8;;${ST}`;
|
|
22810
|
-
function assertMatches(value,
|
|
22811
|
-
if (!pattern.test(value)) throw new TypeError(`Invalid ${
|
|
22810
|
+
function assertMatches(value, label3, pattern, suffix = "") {
|
|
22811
|
+
if (!pattern.test(value)) throw new TypeError(`Invalid ${label3}: ${JSON.stringify(value)} must contain only printable ASCII characters${suffix}.`);
|
|
22812
22812
|
}
|
|
22813
22813
|
function serializeParams(options) {
|
|
22814
22814
|
const id2 = options?.id;
|
|
@@ -22825,8 +22825,8 @@ function linkCode(url2, options) {
|
|
|
22825
22825
|
close: HYPERLINK_CLOSE
|
|
22826
22826
|
};
|
|
22827
22827
|
}
|
|
22828
|
-
function link$1(
|
|
22829
|
-
return applyStyle(
|
|
22828
|
+
function link$1(text2, url2, options) {
|
|
22829
|
+
return applyStyle(text2, linkCode(url2, options));
|
|
22830
22830
|
}
|
|
22831
22831
|
var dynamicColorKinds = ["fg", "bg"];
|
|
22832
22832
|
function stepIsModifier(step) {
|
|
@@ -22850,9 +22850,9 @@ function colorStep(kind, input2) {
|
|
|
22850
22850
|
]
|
|
22851
22851
|
} : step;
|
|
22852
22852
|
}
|
|
22853
|
-
function applyChain(
|
|
22854
|
-
if (
|
|
22855
|
-
let result = String(
|
|
22853
|
+
function applyChain(text2, steps, resolveCapabilities) {
|
|
22854
|
+
if (text2 == null) return "";
|
|
22855
|
+
let result = String(text2);
|
|
22856
22856
|
if (result === "") return result;
|
|
22857
22857
|
const capabilities = resolveCapabilities();
|
|
22858
22858
|
const { modifiersEnabled, colorsEnabled } = capabilities;
|
|
@@ -22876,12 +22876,12 @@ function buildChainableStyleFactory(resolveCapabilities, runtime) {
|
|
|
22876
22876
|
if (cached2) return cached2;
|
|
22877
22877
|
const styleFn = ((first, ...rest) => {
|
|
22878
22878
|
if (isTemplateStringsArray(first)) {
|
|
22879
|
-
let
|
|
22879
|
+
let text2 = "";
|
|
22880
22880
|
for (let i2 = 0; i2 < first.length; i2++) {
|
|
22881
|
-
|
|
22882
|
-
if (i2 < rest.length)
|
|
22881
|
+
text2 += first[i2] ?? "";
|
|
22882
|
+
if (i2 < rest.length) text2 += String(rest[i2]);
|
|
22883
22883
|
}
|
|
22884
|
-
return applyChain(
|
|
22884
|
+
return applyChain(text2, steps, resolveCapabilities);
|
|
22885
22885
|
}
|
|
22886
22886
|
return applyChain(first, steps, resolveCapabilities);
|
|
22887
22887
|
});
|
|
@@ -22966,10 +22966,10 @@ function createStyleInstance(options, runtime) {
|
|
|
22966
22966
|
get colorDepth() {
|
|
22967
22967
|
return resolveCapabilities().colorDepth;
|
|
22968
22968
|
},
|
|
22969
|
-
link(
|
|
22970
|
-
if (resolveCapabilities().modifiersEnabled) return link$1(
|
|
22969
|
+
link(text2, url2, hyperlinkOptions) {
|
|
22970
|
+
if (resolveCapabilities().modifiersEnabled) return link$1(text2, url2, hyperlinkOptions);
|
|
22971
22971
|
linkCode(url2, hyperlinkOptions);
|
|
22972
|
-
return
|
|
22972
|
+
return text2;
|
|
22973
22973
|
},
|
|
22974
22974
|
...Object.fromEntries(dynamicColorKinds.map((kind) => [kind, (...args) => {
|
|
22975
22975
|
if (args.length === 1) return createChainableStyle([colorStep(kind, args[0])]);
|
|
@@ -23073,12 +23073,12 @@ function fishSingleQuote(value) {
|
|
|
23073
23073
|
return `'${value.replace(/\\/g, "\\\\").replace(/'/g, "\\'")}'`;
|
|
23074
23074
|
}
|
|
23075
23075
|
function subcmdWordlist(node2) {
|
|
23076
|
-
const
|
|
23076
|
+
const words2 = [];
|
|
23077
23077
|
for (const sub of node2.subCommands) {
|
|
23078
|
-
|
|
23079
|
-
if (sub.aliases !== void 0) for (const alias of sub.aliases)
|
|
23078
|
+
words2.push(sub.name);
|
|
23079
|
+
if (sub.aliases !== void 0) for (const alias of sub.aliases) words2.push(alias);
|
|
23080
23080
|
}
|
|
23081
|
-
return
|
|
23081
|
+
return words2.join(" ");
|
|
23082
23082
|
}
|
|
23083
23083
|
function flagWordlist(node2) {
|
|
23084
23084
|
return node2.flags.flatMap((flag) => flag.spellings).join(" ");
|
|
@@ -23168,12 +23168,12 @@ function collectArgChoiceCases(cmdPath, node2, out2) {
|
|
|
23168
23168
|
for (const sub of node2.subCommands) collectArgChoiceCases(childPath(cmdPath, sub.name), sub, out2);
|
|
23169
23169
|
}
|
|
23170
23170
|
function valueFlagWordlist(node2) {
|
|
23171
|
-
const
|
|
23171
|
+
const words2 = [];
|
|
23172
23172
|
for (const flag of node2.flags) {
|
|
23173
23173
|
if (!flag.takesValue) continue;
|
|
23174
|
-
for (const spelling of flag.spellings)
|
|
23174
|
+
for (const spelling of flag.spellings) words2.push(spelling);
|
|
23175
23175
|
}
|
|
23176
|
-
return
|
|
23176
|
+
return words2.join(" ");
|
|
23177
23177
|
}
|
|
23178
23178
|
function renderBash(spec, binName, version3, command = "completion") {
|
|
23179
23179
|
const ident = toShellIdent(binName);
|
|
@@ -23896,8 +23896,8 @@ var FLAG_COLUMN_WIDTH = 28;
|
|
|
23896
23896
|
var ARG_COLUMN_WIDTH = 18;
|
|
23897
23897
|
var COMMAND_COLUMN_WIDTH = 10;
|
|
23898
23898
|
var HELP = defineExtensionId("crust:help");
|
|
23899
|
-
function formatArgText(
|
|
23900
|
-
return required2 ? yellow(
|
|
23899
|
+
function formatArgText(text2, required2) {
|
|
23900
|
+
return required2 ? yellow(text2) : dim(yellow(text2));
|
|
23901
23901
|
}
|
|
23902
23902
|
function formatUsageSegment(segment) {
|
|
23903
23903
|
switch (segment.kind) {
|
|
@@ -23913,7 +23913,7 @@ function formatUsageSegment(segment) {
|
|
|
23913
23913
|
}
|
|
23914
23914
|
function formatSection(title, width, rows) {
|
|
23915
23915
|
if (rows.length === 0) return [];
|
|
23916
|
-
return [bold(cyan(`${title}:`)), ...rows.map(([
|
|
23916
|
+
return [bold(cyan(`${title}:`)), ...rows.map(([label3, description]) => ` ${padEnd(label3, width)} ${description}`.trimEnd())];
|
|
23917
23917
|
}
|
|
23918
23918
|
function formatCommandLabel(command) {
|
|
23919
23919
|
const name2 = green(command.name);
|
|
@@ -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 { readFile as
|
|
24299
|
-
import { resolve as
|
|
24298
|
+
import { readFile as readFile15, writeFile as writeFile12 } from "node:fs/promises";
|
|
24299
|
+
import { resolve as resolve14 } from "node:path";
|
|
24300
24300
|
import { setTimeout as delay6 } from "node:timers/promises";
|
|
24301
24301
|
|
|
24302
24302
|
// node_modules/fflate/esm/index.mjs
|
|
@@ -30441,7 +30441,7 @@ var recursive = /* @__PURE__ */ new WeakMap();
|
|
|
30441
30441
|
var NONE = 0;
|
|
30442
30442
|
var ASSUMED = 1;
|
|
30443
30443
|
var PROVEN = 2;
|
|
30444
|
-
function isRecursive(inst, stack,
|
|
30444
|
+
function isRecursive(inst, stack, resolve15) {
|
|
30445
30445
|
const cached2 = recursive.get(inst);
|
|
30446
30446
|
if (cached2 !== void 0)
|
|
30447
30447
|
return cached2 ? PROVEN : NONE;
|
|
@@ -30451,7 +30451,7 @@ function isRecursive(inst, stack, resolve14) {
|
|
|
30451
30451
|
let result = NONE;
|
|
30452
30452
|
const check2 = (child) => {
|
|
30453
30453
|
if (result !== PROVEN && child?._zod) {
|
|
30454
|
-
const answer = isRecursive(child, stack,
|
|
30454
|
+
const answer = isRecursive(child, stack, resolve15);
|
|
30455
30455
|
if (answer > result)
|
|
30456
30456
|
result = answer;
|
|
30457
30457
|
}
|
|
@@ -30462,7 +30462,7 @@ function isRecursive(inst, stack, resolve14) {
|
|
|
30462
30462
|
const desc = Object.getOwnPropertyDescriptor(sh, key);
|
|
30463
30463
|
if (spread && !desc.enumerable)
|
|
30464
30464
|
continue;
|
|
30465
|
-
const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack,
|
|
30465
|
+
const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve15) : NONE;
|
|
30466
30466
|
if (child > answer)
|
|
30467
30467
|
answer = child;
|
|
30468
30468
|
}
|
|
@@ -30526,7 +30526,7 @@ function isRecursive(inst, stack, resolve14) {
|
|
|
30526
30526
|
break;
|
|
30527
30527
|
// `$ZodLazy` caches its inner on the def, so a resolved edge is followed exactly
|
|
30528
30528
|
case "lazy": {
|
|
30529
|
-
const inner = def._cachedInner ?? (
|
|
30529
|
+
const inner = def._cachedInner ?? (resolve15 ? inst._zod.innerType : void 0);
|
|
30530
30530
|
merge2(inner ? isRecursive(inner, stack, false) : ASSUMED);
|
|
30531
30531
|
break;
|
|
30532
30532
|
}
|
|
@@ -34724,8 +34724,8 @@ function ko_default() {
|
|
|
34724
34724
|
}
|
|
34725
34725
|
|
|
34726
34726
|
// node_modules/zod/v4/locales/lt.js
|
|
34727
|
-
var capitalizeFirstCharacter = (
|
|
34728
|
-
return
|
|
34727
|
+
var capitalizeFirstCharacter = (text2) => {
|
|
34728
|
+
return text2.charAt(0).toUpperCase() + text2.slice(1);
|
|
34729
34729
|
};
|
|
34730
34730
|
function getUnitTypeFromNumber(number4) {
|
|
34731
34731
|
const abs = Math.abs(number4);
|
|
@@ -38595,9 +38595,9 @@ function codePointLengthVar(doc, ctx, accessor, inDoubt) {
|
|
|
38595
38595
|
doc.write(`const ${v} = typeof ${accessor} === "string" && ${inDoubt} ? ${cpLen}(${accessor}) : ${accessor}.length;`);
|
|
38596
38596
|
return v;
|
|
38597
38597
|
}
|
|
38598
|
-
function numericOperand(value,
|
|
38598
|
+
function numericOperand(value, label3) {
|
|
38599
38599
|
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
38600
|
-
throw new ZodCompileUnsupportedError(`${
|
|
38600
|
+
throw new ZodCompileUnsupportedError(`${label3} bound of type ${typeof value}`);
|
|
38601
38601
|
}
|
|
38602
38602
|
return `${value}`;
|
|
38603
38603
|
}
|
|
@@ -46402,7 +46402,7 @@ var assetRequest = external_exports.discriminatedUnion("type", [
|
|
|
46402
46402
|
}).transform((p) => ({ ...p, voice: p.voice || (isElevenLabsSpeech(p.model) ? DEFAULT_ELEVENLABS_VOICE : "Kore") })),
|
|
46403
46403
|
external_exports.object({ ...base, type: external_exports.literal("sfx"), model: external_exports.literal("eleven_text_to_sound_v2").default("eleven_text_to_sound_v2"), seconds: external_exports.number().min(0.5).max(30).default(5), loop: external_exports.boolean().default(false), promptInfluence: external_exports.number().min(0).max(1).default(0.3) })
|
|
46404
46404
|
]);
|
|
46405
|
-
var speechCharacters = (
|
|
46405
|
+
var speechCharacters = (text2) => Array.from(text2).length;
|
|
46406
46406
|
function assetEstimate(p, now = Date.now()) {
|
|
46407
46407
|
if (p.type === "image") return Math.ceil(130 * spriteImageModel(p.model).relCost);
|
|
46408
46408
|
if (p.type === "video") return spriteVideoEstimate(spriteVideoModel(p.model), p);
|
|
@@ -46479,13 +46479,13 @@ function seconds(value) {
|
|
|
46479
46479
|
if (!match || Number(match[2]) > 59 || Number(match[3]) > 59) return NaN;
|
|
46480
46480
|
return Number(match[1] ?? 0) * 3600 + Number(match[2]) * 60 + Number(match[3]) + Number(match[4]) / 1e3;
|
|
46481
46481
|
}
|
|
46482
|
-
var subRipText = (
|
|
46482
|
+
var subRipText = (text2) => text2.replace(/<(?!\/?[ibu]>)[^<>]*>/gi, "").replace(/&(?!(?:[a-z][a-z\d]*|#\d+|#x[\da-f]+);)/gi, "&").replace(/<(?!\/?[ibu]>)/gi, "<");
|
|
46483
46483
|
function parseSubtitles(input2, duration3) {
|
|
46484
|
-
const
|
|
46485
|
-
if (
|
|
46486
|
-
const vtt = /^WEBVTT(?:[ \t][^\n]*)?(?:\n|$)/.test(
|
|
46484
|
+
const text2 = input2.replace(/^/, "").replace(/\r\n?/g, "\n");
|
|
46485
|
+
if (text2.includes("\0") || text2.includes("\uFFFD")) throw new Error("Use a UTF-8 text subtitle file.");
|
|
46486
|
+
const vtt = /^WEBVTT(?:[ \t][^\n]*)?(?:\n|$)/.test(text2);
|
|
46487
46487
|
const cues = [];
|
|
46488
|
-
for (const [index2, block] of
|
|
46488
|
+
for (const [index2, block] of text2.split(/\n[ \t]*\n/).entries()) {
|
|
46489
46489
|
const lines = block.split("\n").filter((line) => line.trim());
|
|
46490
46490
|
if (!lines.length || vtt && (index2 === 0 || /^(?:NOTE|STYLE|REGION)(?:[ \t]|$)/.test(lines[0]))) continue;
|
|
46491
46491
|
const timing = lines.findIndex((line) => line.includes("-->"));
|
|
@@ -46531,9 +46531,9 @@ async function readSubtitleFile(file2, maxBytes) {
|
|
|
46531
46531
|
}
|
|
46532
46532
|
if (!info.isFile() || !/\.(?:srt|vtt)$/i.test(file2) || info.size < 1 || info.size > maxBytes) throw new Error(`Use a .srt or .vtt subtitle file up to ${maxBytes / 1024 / 1024} MiB, such as the one npm run export:mp4 writes beside the MP4.`);
|
|
46533
46533
|
const content = await readFile5(file2);
|
|
46534
|
-
const
|
|
46535
|
-
if (
|
|
46536
|
-
return { content, sha256: createHash2("sha256").update(content).digest("hex"), language: /^\uFEFF?WEBVTT[^\n]*\n(?:[^\n]+\n)*?Language:[ \t]*([^\s]+)/.exec(
|
|
46534
|
+
const text2 = content.toString("utf8");
|
|
46535
|
+
if (text2.includes("\uFFFD") || !/\d\d:\d\d[,.]\d{3} --> /.test(text2)) throw new Error("Use a UTF-8 .srt or .vtt subtitle file with timed captions.");
|
|
46536
|
+
return { content, sha256: createHash2("sha256").update(content).digest("hex"), language: /^\uFEFF?WEBVTT[^\n]*\n(?:[^\n]+\n)*?Language:[ \t]*([^\s]+)/.exec(text2)?.[1] };
|
|
46537
46537
|
}
|
|
46538
46538
|
async function subtitleFile(root, mp4, choice, extensions) {
|
|
46539
46539
|
if (choice === "none") return null;
|
|
@@ -46875,20 +46875,20 @@ async function assetsFromBatchFile(file2, model) {
|
|
|
46875
46875
|
const requests = [];
|
|
46876
46876
|
const names = /* @__PURE__ */ new Map();
|
|
46877
46877
|
items.forEach((item, index2) => {
|
|
46878
|
-
const
|
|
46878
|
+
const label3 = `#${index2 + 1}${isObject2(item) && typeof item.name === "string" ? ` (${item.name})` : ""}`;
|
|
46879
46879
|
if (!isObject2(item)) {
|
|
46880
|
-
errors.push(`${
|
|
46880
|
+
errors.push(`${label3}: expected a JSON object.`);
|
|
46881
46881
|
return;
|
|
46882
46882
|
}
|
|
46883
46883
|
try {
|
|
46884
46884
|
const request2 = parseAsset({ ...defaults, ...item, ...model ? { model } : {} });
|
|
46885
46885
|
const key = (fileName(request2.name) || request2.name).toLowerCase();
|
|
46886
46886
|
const first = names.get(key);
|
|
46887
|
-
if (first !== void 0) errors.push(`${
|
|
46887
|
+
if (first !== void 0) errors.push(`${label3}: the name repeats #${first + 1}; downloads need distinct names.`);
|
|
46888
46888
|
else names.set(key, index2);
|
|
46889
46889
|
requests.push(request2);
|
|
46890
46890
|
} catch (error62) {
|
|
46891
|
-
errors.push(`${
|
|
46891
|
+
errors.push(`${label3}: ${(error62 instanceof Error ? error62.message : String(error62)).replaceAll("\n", "; ")}`);
|
|
46892
46892
|
}
|
|
46893
46893
|
});
|
|
46894
46894
|
if (errors.length) throw new Error(`Fix these batch items; nothing was submitted.
|
|
@@ -47555,8 +47555,8 @@ async function youtubeLogin(options) {
|
|
|
47555
47555
|
let receive;
|
|
47556
47556
|
let fail;
|
|
47557
47557
|
let used = false;
|
|
47558
|
-
const callback = new Promise((
|
|
47559
|
-
receive =
|
|
47558
|
+
const callback = new Promise((resolve15, reject) => {
|
|
47559
|
+
receive = resolve15;
|
|
47560
47560
|
fail = reject;
|
|
47561
47561
|
});
|
|
47562
47562
|
void callback.catch(() => {
|
|
@@ -47594,9 +47594,9 @@ async function youtubeLogin(options) {
|
|
|
47594
47594
|
response.end("Authorization received. Return to your AnimaGuru terminal.");
|
|
47595
47595
|
receive(code);
|
|
47596
47596
|
});
|
|
47597
|
-
await new Promise((
|
|
47597
|
+
await new Promise((resolve15, reject) => {
|
|
47598
47598
|
server.once("error", reject);
|
|
47599
|
-
server.listen(0, "127.0.0.1",
|
|
47599
|
+
server.listen(0, "127.0.0.1", resolve15);
|
|
47600
47600
|
});
|
|
47601
47601
|
const address = server.address();
|
|
47602
47602
|
if (!address || typeof address === "string") throw new Error("Cannot open the local YouTube authorization listener.");
|
|
@@ -47631,7 +47631,7 @@ async function youtubeLogin(options) {
|
|
|
47631
47631
|
clearTimeout(timer);
|
|
47632
47632
|
options.signal?.removeEventListener("abort", abort);
|
|
47633
47633
|
server.closeAllConnections();
|
|
47634
|
-
await new Promise((
|
|
47634
|
+
await new Promise((resolve15) => server.close(() => resolve15()));
|
|
47635
47635
|
}
|
|
47636
47636
|
});
|
|
47637
47637
|
}
|
|
@@ -47846,8 +47846,8 @@ sha256 ${sha256}
|
|
|
47846
47846
|
size ${size}
|
|
47847
47847
|
`;
|
|
47848
47848
|
var POINTER = /^animaguru-cloud-object v1\nsha256 ([a-f0-9]{64})\nsize (\d{1,16})\n$/;
|
|
47849
|
-
function parseCloudPointer(
|
|
47850
|
-
const match = POINTER.exec(
|
|
47849
|
+
function parseCloudPointer(text2) {
|
|
47850
|
+
const match = POINTER.exec(text2);
|
|
47851
47851
|
if (!match) return null;
|
|
47852
47852
|
const size = Number(match[2]);
|
|
47853
47853
|
return Number.isSafeInteger(size) && size > 0 && size <= CLOUD_OBJECT_MAX_BYTES ? { sha256: match[1], size } : null;
|
|
@@ -48248,8 +48248,8 @@ async function linkCloud(client, options) {
|
|
|
48248
48248
|
}
|
|
48249
48249
|
async function keepOutOfGit(root) {
|
|
48250
48250
|
const path = join11(root, ".gitignore");
|
|
48251
|
-
const
|
|
48252
|
-
if (
|
|
48251
|
+
const text2 = await readFile12(path, "utf8").catch(() => null);
|
|
48252
|
+
if (text2 !== null && !/^\/?\.animaguru\/(?:sync\/?)?$/m.test(text2)) await writeFile9(path, `${text2}${text2.endsWith("\n") || !text2 ? "" : "\n"}.animaguru/sync/
|
|
48253
48253
|
`);
|
|
48254
48254
|
}
|
|
48255
48255
|
async function unlinkCloud(options) {
|
|
@@ -48844,6 +48844,123 @@ async function writeMotionExample(example, directory, { force = false } = {}) {
|
|
|
48844
48844
|
return { id: example.id, written, kept, kitImports: inAnimation ? "workspace (runtime/kit)" : "standalone (src/kit)", usage: example.usage };
|
|
48845
48845
|
}
|
|
48846
48846
|
|
|
48847
|
+
// cli/src/library.ts
|
|
48848
|
+
import { mkdir as mkdir11, readFile as readFile14, writeFile as writeFile11 } from "node:fs/promises";
|
|
48849
|
+
import { dirname as dirname10, join as join14, resolve as resolve13 } from "node:path";
|
|
48850
|
+
|
|
48851
|
+
// shared/asset-library.ts
|
|
48852
|
+
var LIBRARY_ASSET_TYPES = ["sprite", "image", "video", "music", "speech", "sfx"];
|
|
48853
|
+
var slug = external_exports.string().trim().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/, "Use lowercase words joined by hyphens.").max(80);
|
|
48854
|
+
var label2 = external_exports.string().trim().toLowerCase().regex(/^[a-z0-9][a-z0-9+.-]{0,39}$/, "Labels are lowercase words or hyphenated terms.");
|
|
48855
|
+
var labelList2 = external_exports.union([external_exports.array(label2).max(8), external_exports.string().max(400).transform((value) => value.split(",").map((item) => item.trim().toLowerCase()).filter(Boolean))]).pipe(external_exports.array(label2).max(8));
|
|
48856
|
+
var librarySearchQuery = external_exports.object({
|
|
48857
|
+
query: external_exports.string().trim().max(500).default(""),
|
|
48858
|
+
type: external_exports.enum(LIBRARY_ASSET_TYPES).optional(),
|
|
48859
|
+
/** Every label must be present on a result. */
|
|
48860
|
+
labels: labelList2.optional(),
|
|
48861
|
+
limit: external_exports.coerce.number().int().min(1).max(30).default(10)
|
|
48862
|
+
});
|
|
48863
|
+
var libraryImportBody = external_exports.object({
|
|
48864
|
+
projectId: external_exports.string().regex(/^prj_[A-Za-z0-9]{8,40}$/, "Choose a project."),
|
|
48865
|
+
/** Name in the project; defaults to the library title. */
|
|
48866
|
+
name: external_exports.string().trim().min(1).max(80).optional()
|
|
48867
|
+
});
|
|
48868
|
+
var text = (max2) => external_exports.string().trim().min(1).max(max2);
|
|
48869
|
+
var keywordList = external_exports.array(external_exports.string().trim().min(1).max(60)).max(24);
|
|
48870
|
+
var detailsInput = external_exports.object({
|
|
48871
|
+
width: external_exports.number().int().positive().max(16384),
|
|
48872
|
+
height: external_exports.number().int().positive().max(16384),
|
|
48873
|
+
aspectRatio: external_exports.string().max(10),
|
|
48874
|
+
transparent: external_exports.boolean(),
|
|
48875
|
+
seconds: external_exports.number().positive().max(3600),
|
|
48876
|
+
resolution: external_exports.string().max(10),
|
|
48877
|
+
audio: external_exports.boolean(),
|
|
48878
|
+
loop: external_exports.boolean(),
|
|
48879
|
+
transcript: external_exports.string().max(4e3),
|
|
48880
|
+
voice: external_exports.string().max(80),
|
|
48881
|
+
language: external_exports.string().max(40),
|
|
48882
|
+
bpm: external_exports.number().int().min(20).max(300),
|
|
48883
|
+
mood: external_exports.string().max(120)
|
|
48884
|
+
}).partial();
|
|
48885
|
+
var metadataFields = {
|
|
48886
|
+
title: text(80),
|
|
48887
|
+
summary: text(200),
|
|
48888
|
+
description: text(2e3),
|
|
48889
|
+
labels: external_exports.array(label2).min(1).max(8),
|
|
48890
|
+
keywords: keywordList.default([]),
|
|
48891
|
+
/** Facts the server cannot read from the file, such as tempo or mood; they override what it measured. */
|
|
48892
|
+
details: detailsInput.default({})
|
|
48893
|
+
};
|
|
48894
|
+
var libraryPublishBody = external_exports.object({
|
|
48895
|
+
/** Defaults to the title as a slug. */
|
|
48896
|
+
id: slug.optional(),
|
|
48897
|
+
projectId: external_exports.string().regex(/^prj_[A-Za-z0-9]{8,40}$/),
|
|
48898
|
+
source: external_exports.discriminatedUnion("kind", [
|
|
48899
|
+
external_exports.object({ kind: external_exports.literal("asset"), assetId: external_exports.string().uuid() }),
|
|
48900
|
+
external_exports.object({ kind: external_exports.literal("sprite"), character: slug })
|
|
48901
|
+
]),
|
|
48902
|
+
/** Replace an existing entry with the same id. */
|
|
48903
|
+
replace: external_exports.boolean().default(false),
|
|
48904
|
+
...metadataFields
|
|
48905
|
+
});
|
|
48906
|
+
var libraryUpdateBody = external_exports.object({ ...metadataFields, keywords: keywordList, details: detailsInput }).partial().refine((value) => Object.keys(value).length > 0, "Change at least one field.");
|
|
48907
|
+
|
|
48908
|
+
// cli/src/library.ts
|
|
48909
|
+
var libraryPath = (id2) => `/api/v1/asset-library/${encodeURIComponent(id2)}`;
|
|
48910
|
+
var commaList = (value) => value?.split(",").map((item) => item.trim()).filter(Boolean);
|
|
48911
|
+
function searchLibrary(client, query, flags) {
|
|
48912
|
+
const params = new URLSearchParams();
|
|
48913
|
+
if (query?.trim()) params.set("q", query.trim());
|
|
48914
|
+
if (flags.type) params.set("type", flags.type);
|
|
48915
|
+
if (flags.labels) params.set("labels", flags.labels);
|
|
48916
|
+
if (flags.limit) params.set("limit", String(flags.limit));
|
|
48917
|
+
return client.request(`/api/v1/asset-library/search?${params}`);
|
|
48918
|
+
}
|
|
48919
|
+
var getLibraryAsset = (client, id2) => client.request(libraryPath(id2));
|
|
48920
|
+
async function downloadLibraryAsset(client, id2, output2, { force = false } = {}) {
|
|
48921
|
+
const asset = await getLibraryAsset(client, id2);
|
|
48922
|
+
const root = resolve13(output2, asset.type === "sprite" ? safeProjectPath(asset.id) : ".");
|
|
48923
|
+
const written = [];
|
|
48924
|
+
for (const file2 of asset.files) {
|
|
48925
|
+
const path = join14(root, safeProjectPath(file2.path));
|
|
48926
|
+
const response = await client.request(`${libraryPath(asset.id)}/files/${file2.path.split("/").map(encodeURIComponent).join("/")}?download=1`, { raw: true, timeout: 3e5 });
|
|
48927
|
+
const bytes = new Uint8Array(await response.arrayBuffer());
|
|
48928
|
+
await mkdir11(dirname10(path), { recursive: true });
|
|
48929
|
+
await writeFile11(path, bytes, { flag: force ? "w" : "wx" }).catch((error62) => {
|
|
48930
|
+
throw error62.code === "EEXIST" ? new Error(`Already exists: ${path}. Pass --force to replace it.`) : error62;
|
|
48931
|
+
});
|
|
48932
|
+
written.push({ path, size: bytes.byteLength, mimeType: file2.mimeType });
|
|
48933
|
+
}
|
|
48934
|
+
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: join14(root, sheet), data: join14(root, data), frames, fps, loop })) } : {} };
|
|
48935
|
+
}
|
|
48936
|
+
var importLibraryAsset = (client, id2, project, name2) => client.request(`${libraryPath(id2)}/import`, { method: "POST", body: { projectId: project, ...name2 ? { name: name2 } : {} } });
|
|
48937
|
+
async function words(flags) {
|
|
48938
|
+
const input2 = flags.file ? JSON.parse(await readFile14(flags.file, "utf8")) : {};
|
|
48939
|
+
if (!input2 || typeof input2 !== "object" || Array.isArray(input2)) throw new Error("The file must contain a JSON object.");
|
|
48940
|
+
return {
|
|
48941
|
+
...input2,
|
|
48942
|
+
...flags.title ? { title: flags.title } : {},
|
|
48943
|
+
...flags.summary ? { summary: flags.summary } : {},
|
|
48944
|
+
...flags.description ? { description: flags.description } : {},
|
|
48945
|
+
...flags.labels ? { labels: commaList(flags.labels) } : {},
|
|
48946
|
+
...flags.keywords ? { keywords: commaList(flags.keywords) } : {},
|
|
48947
|
+
...flags.details ? { details: JSON.parse(flags.details) } : {}
|
|
48948
|
+
};
|
|
48949
|
+
}
|
|
48950
|
+
var checked = (parsed) => {
|
|
48951
|
+
if (parsed.success) return parsed.data;
|
|
48952
|
+
throw new Error(parsed.error.issues.map((issue2) => `${issue2.path.length ? `${issue2.path.join(".")}: ` : ""}${issue2.message}`).join("\n"));
|
|
48953
|
+
};
|
|
48954
|
+
async function publishLibraryAsset(client, flags) {
|
|
48955
|
+
if (Boolean(flags.asset) === Boolean(flags.character)) throw new Error("Pass --asset ASSET_ID or --character SLUG.");
|
|
48956
|
+
const source = flags.asset ? { kind: "asset", assetId: flags.asset } : { kind: "sprite", character: flags.character };
|
|
48957
|
+
const body = checked(libraryPublishBody.safeParse({ ...await words(flags), projectId: flags.project, source, ...flags.id ? { id: flags.id } : {}, ...flags.replace ? { replace: true } : {} }));
|
|
48958
|
+
return client.request("/api/v1/asset-library", { method: "POST", body, timeout: 12e4 });
|
|
48959
|
+
}
|
|
48960
|
+
async function updateLibraryAsset(client, id2, flags) {
|
|
48961
|
+
return client.request(libraryPath(id2), { method: "PATCH", body: checked(libraryUpdateBody.safeParse(await words(flags))), timeout: 12e4 });
|
|
48962
|
+
}
|
|
48963
|
+
|
|
48847
48964
|
// cli/src/commands.ts
|
|
48848
48965
|
var assetModelIds = [...SPRITE_IMAGE_MODEL_IDS, ...SPRITE_VIDEO_MODEL_IDS, ...MUSIC_MODELS.map((m) => m.id), ...SPEECH_MODELS.map((m) => m.id), ...SFX_MODELS.map((m) => m.id)];
|
|
48849
48966
|
var assetAuthorizationFlags = [
|
|
@@ -48873,8 +48990,18 @@ var selectedModels = (flags) => ({
|
|
|
48873
48990
|
...flags["video-model"] ? { videoModel: flags["video-model"] } : {}
|
|
48874
48991
|
});
|
|
48875
48992
|
var id = { name: "id", type: "string", required: true, description: "Project ID" };
|
|
48993
|
+
var urlFlag = { name: "url", type: "string", default: "https://animaguru.com", env: { name: "ANIMAGURU_URL" }, description: "Server origin" };
|
|
48994
|
+
var libraryWordFlags = [
|
|
48995
|
+
{ name: "file", type: "string", description: "JSON with title, summary, description, labels, keywords and details; flags override it" },
|
|
48996
|
+
{ name: "title", type: "string" },
|
|
48997
|
+
{ name: "summary", type: "string", description: "One sentence for cards" },
|
|
48998
|
+
{ name: "description", type: "string", description: "What it looks or sounds like and when to use it (searched by meaning)" },
|
|
48999
|
+
{ name: "labels", type: "string", description: "Comma-separated facets, e.g. pixel-art,character" },
|
|
49000
|
+
{ name: "keywords", type: "string", description: "Comma-separated synonyms people may search for" },
|
|
49001
|
+
{ name: "details", type: "string", description: 'JSON facts the server cannot measure, e.g. {"bpm":110,"mood":"uplifting"}' }
|
|
49002
|
+
];
|
|
48876
49003
|
var out = (stdout, data) => stdout(JSON.stringify(data));
|
|
48877
|
-
var actions = (
|
|
49004
|
+
var actions = (text2) => text2 ? text2.split(",").map((s) => s.trim()).filter(Boolean) : [];
|
|
48878
49005
|
var projectPath = (project) => `/api/v1/sprites/${encodeURIComponent(project)}`;
|
|
48879
49006
|
var workspaceQuery = async (client) => {
|
|
48880
49007
|
const selected = await selectedWorkspace(client.origin);
|
|
@@ -48883,17 +49010,17 @@ var workspaceQuery = async (client) => {
|
|
|
48883
49010
|
async function openBrowser(url2) {
|
|
48884
49011
|
const command = process.platform === "darwin" ? "open" : process.platform === "win32" ? "rundll32" : "xdg-open";
|
|
48885
49012
|
const args = process.platform === "win32" ? ["url.dll,FileProtocolHandler", url2] : [url2];
|
|
48886
|
-
await new Promise((
|
|
49013
|
+
await new Promise((resolve15) => {
|
|
48887
49014
|
const child = spawn3(command, args, { stdio: "ignore", detached: true });
|
|
48888
|
-
child.once("error", () =>
|
|
49015
|
+
child.once("error", () => resolve15());
|
|
48889
49016
|
child.once("spawn", () => {
|
|
48890
49017
|
child.unref();
|
|
48891
|
-
|
|
49018
|
+
resolve15();
|
|
48892
49019
|
});
|
|
48893
49020
|
});
|
|
48894
49021
|
}
|
|
48895
49022
|
function createCli() {
|
|
48896
|
-
return new Crust("animaguru", { description: "Sprite, asset and HeyGen avatar generation, video workspaces, video sharing, and direct local YouTube uploads. Successful commands output JSON. Paid jobs and uploads require --yes.", version: package_default.version }).command("youtube", (youtube) => youtube.command("auth", (auth) => auth.add(defineCommand("login", { description: "Connect a YouTube channel through Google; credentials stay on this computer" }, (command) => command.flags(
|
|
49023
|
+
return new Crust("animaguru", { description: "Sprite, asset and HeyGen avatar generation, the motion and asset libraries, video workspaces, video sharing, and direct local YouTube uploads. Successful commands output JSON. Paid jobs and uploads require --yes.", version: package_default.version }).command("youtube", (youtube) => youtube.command("auth", (auth) => auth.add(defineCommand("login", { description: "Connect a YouTube channel through Google; credentials stay on this computer" }, (command) => command.flags(
|
|
48897
49024
|
{ name: "client-file", type: "string", required: true, env: { name: "ANIMAGURU_YOUTUBE_CLIENT_FILE" }, description: "Google Desktop app OAuth client JSON" },
|
|
48898
49025
|
{ name: "browser", type: "boolean", default: true, description: "Open the system browser; --no-browser prints the URL" },
|
|
48899
49026
|
{ name: "timeout", type: "number", default: 300, description: "Authorization timeout in seconds (1\u2013600)" },
|
|
@@ -49029,7 +49156,23 @@ Confirm code: ${device.user_code}`);
|
|
|
49029
49156
|
).action(async ({ args, flags, stdout, signal }) => {
|
|
49030
49157
|
const example = await new Client(flags.url, signal).request(`/api/v1/motion-library/${encodeURIComponent(args.id)}`);
|
|
49031
49158
|
out(stdout, flags.write ? await writeMotionExample(example, flags.write, { force: flags.force }) : example);
|
|
49032
|
-
}))).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("
|
|
49159
|
+
}))).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("library", (library) => library.add(defineCommand("search", { description: "Search the asset library (Pro and Team plans): ready-made sprites, images, videos, music, speech and sound effects, by natural language and keywords" }, (command) => command.args({ name: "query", type: "string", variadic: true, description: "What you need, e.g. whoosh transition, upbeat piano background, pixel knight" }).flags(
|
|
49160
|
+
urlFlag,
|
|
49161
|
+
{ name: "type", type: "string", choices: LIBRARY_ASSET_TYPES, description: "Only this type" },
|
|
49162
|
+
{ name: "labels", type: "string", description: "Comma-separated labels every result must have, e.g. loop,transparent" },
|
|
49163
|
+
{ name: "limit", type: "number", default: 10, description: "Results, 1\u201330" }
|
|
49164
|
+
).action(async ({ args, flags, stdout, signal }) => out(stdout, await searchLibrary(new Client(flags.url, signal), (args.query ?? []).join(" "), flags))))).add(defineCommand("get", { description: "Get a library asset's description, details (length, size, transcript, sprite frames) and files" }, (command) => command.args({ name: "id", type: "string", required: true, description: "Asset id from library search" }).flags(urlFlag).action(async ({ args, flags, stdout, signal }) => out(stdout, await getLibraryAsset(new Client(flags.url, signal), args.id))))).add(defineCommand("download", { description: "Save a library asset's files into a folder: media as ID.EXT, sprites as ID/ with sheets and frame data" }, (command) => command.args({ name: "id", type: "string", required: true, description: "Asset id from library search" }).flags(urlFlag, { name: "output", type: "string", required: true, description: "Folder to save into" }, { name: "force", type: "boolean", description: "Replace existing files" }).action(async ({ args, flags, stdout, signal }) => out(stdout, await downloadLibraryAsset(new Client(flags.url, signal), args.id, flags.output, { force: flags.force }))))).add(defineCommand("import", { description: "Copy a library asset into a project (no credits): media become saved assets, sprites become characters" }, (command) => command.args({ name: "id", type: "string", required: true, description: "Asset id from library search" }).flags(urlFlag, { name: "project", type: "string", required: true, description: "Project ID" }, { name: "name", type: "string", description: "Name in the project; defaults to the library title" }).action(async ({ args, flags, stdout, signal }) => out(stdout, await importLibraryAsset(new Client(flags.url, signal), args.id, flags.project, flags.name))))).add(defineCommand("types", { description: "List asset library types, how many assets each has, and whether this account can use the library" }, (command) => command.flags(urlFlag).action(async ({ flags, stdout, signal }) => out(stdout, await new Client(flags.url, signal).request("/api/v1/asset-library/types"))))).add(defineCommand("publish", { description: "Staff: publish a saved asset or an animated character from a project into the library" }, (command) => command.flags(
|
|
49165
|
+
urlFlag,
|
|
49166
|
+
{ name: "project", type: "string", required: true, description: "Project ID" },
|
|
49167
|
+
{ name: "asset", type: "string", description: "Saved asset id (assets list)" },
|
|
49168
|
+
{ name: "character", type: "string", description: "Character slug (projects get); it must be animated" },
|
|
49169
|
+
{ name: "id", type: "string", description: "Library id; defaults to the title as a slug" },
|
|
49170
|
+
{ name: "replace", type: "boolean", description: "Replace an entry with the same id" },
|
|
49171
|
+
...libraryWordFlags
|
|
49172
|
+
).action(async ({ flags, stdout, signal }) => out(stdout, await publishLibraryAsset(new Client(flags.url, signal), flags))))).add(defineCommand("update", { description: "Staff: change a library asset's title, summary, description, labels, keywords or details" }, (command) => command.args({ name: "id", type: "string", required: true }).flags(urlFlag, ...libraryWordFlags).action(async ({ args, flags, stdout, signal }) => out(stdout, await updateLibraryAsset(new Client(flags.url, signal), args.id, flags))))).add(defineCommand("remove", { description: "Staff: remove an asset from the library; projects that imported it keep their copies. Requires --yes" }, (command) => command.args({ name: "id", type: "string", required: true }).flags(urlFlag, { name: "yes", type: "boolean", required: true }).action(async ({ args, flags, stdout, signal }) => {
|
|
49173
|
+
if (!flags.yes) throw new Error("Pass --yes to remove this library asset.");
|
|
49174
|
+
out(stdout, await new Client(flags.url, signal).request(`/api/v1/asset-library/${encodeURIComponent(args.id)}`, { method: "DELETE" }));
|
|
49175
|
+
})))).command("projects", (projects) => projects.add(defineCommand("list", { description: "List projects in the selected workspace" }, (command) => command.flags({ name: "url", type: "string", default: "https://animaguru.com", env: { name: "ANIMAGURU_URL" }, description: "Server origin" }).action(async ({ flags, stdout, signal }) => {
|
|
49033
49176
|
const client = new Client(flags.url, signal);
|
|
49034
49177
|
out(stdout, await client.request(`/api/v1/projects${await workspaceQuery(client)}`));
|
|
49035
49178
|
}))).add(defineCommand("create", { description: "Create an empty sprite project; generate artwork with jobs submit" }, (command) => command.flags({ name: "url", type: "string", default: "https://animaguru.com", env: { name: "ANIMAGURU_URL" }, description: "Server origin" }).flags(...modelFlags).flags({ name: "name", type: "string", required: true }).action(async ({ flags, stdout, signal }) => {
|
|
@@ -49107,7 +49250,7 @@ Confirm code: ${device.user_code}`);
|
|
|
49107
49250
|
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" }));
|
|
49108
49251
|
})))).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 }) => {
|
|
49109
49252
|
if (!flags.yes) throw new Error("Pass --yes to authorize spending credits.");
|
|
49110
|
-
const body = spriteJobBody.parse({ ...JSON.parse(await
|
|
49253
|
+
const body = spriteJobBody.parse({ ...JSON.parse(await readFile15(flags.file, "utf8")), ...selectedModels(flags) });
|
|
49111
49254
|
out(stdout, await new Client(flags.url, signal).request(`${projectPath(args.id)}/jobs`, { method: "POST", body }));
|
|
49112
49255
|
}))).add(defineCommand("wait", { description: "Wait for a specific job; fail if generation fails or times out" }, (command) => command.flags({ name: "url", type: "string", default: "https://animaguru.com", env: { name: "ANIMAGURU_URL" }, description: "Server origin" }).args(id, { name: "job", type: "string", required: true }).flags({ name: "timeout", type: "number", default: 600, description: "Maximum seconds to wait" }).action(async ({ args, flags, stdout, signal }) => out(stdout, { job: await waitForJob(new Client(flags.url, signal), args.id, args.job, flags.timeout, signal) }))))).add(defineCommand("models", { description: "Set default image and/or video models 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[0], aliases: ["model"] }, modelFlags[1]).action(async ({ args, flags, stdout, signal }) => {
|
|
49113
49256
|
const body = selectedModels(flags);
|
|
@@ -49122,7 +49265,7 @@ Confirm code: ${device.user_code}`);
|
|
|
49122
49265
|
const extension = flags.file.split(".").at(-1)?.toLowerCase();
|
|
49123
49266
|
const type = extension === "png" ? "image/png" : extension === "jpg" || extension === "jpeg" ? "image/jpeg" : extension === "webp" ? "image/webp" : void 0;
|
|
49124
49267
|
if (!type) throw new Error("Use a PNG, JPEG or WebP image.");
|
|
49125
|
-
const bytes = await
|
|
49268
|
+
const bytes = await readFile15(flags.file);
|
|
49126
49269
|
if (bytes.length > 10 * 1024 * 1024) throw new Error("Image must be at most 10 MB.");
|
|
49127
49270
|
const form = new FormData();
|
|
49128
49271
|
form.set("image", new Blob([bytes], { type }), `reference.${extension}`);
|
|
@@ -49140,8 +49283,8 @@ Confirm code: ${device.user_code}`);
|
|
|
49140
49283
|
const response = await client.request(`/api/v1/blobs/${encodeURIComponent(manifest.ownerId)}/${file2.sha}`, { raw: true });
|
|
49141
49284
|
entries[path2] = new Uint8Array(await response.arrayBuffer());
|
|
49142
49285
|
}
|
|
49143
|
-
const path =
|
|
49144
|
-
await
|
|
49286
|
+
const path = resolve14(flags.output);
|
|
49287
|
+
await writeFile12(path, zipSync(entries, { level: 0 }), { flag: "wx" });
|
|
49145
49288
|
out(stdout, { path, files: manifest.files.length });
|
|
49146
49289
|
})))).extend(version(package_default.version, { format: "plain" })).extend(help()).extend(completion());
|
|
49147
49290
|
}
|