@osfactory/har 0.27.0 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +502 -231
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -873,14 +873,14 @@ var require_url_state_machine = __commonJS({
|
|
|
873
873
|
return url.replace(/\u0009|\u000A|\u000D/g, "");
|
|
874
874
|
}
|
|
875
875
|
function shortenPath(url) {
|
|
876
|
-
const
|
|
877
|
-
if (
|
|
876
|
+
const path58 = url.path;
|
|
877
|
+
if (path58.length === 0) {
|
|
878
878
|
return;
|
|
879
879
|
}
|
|
880
|
-
if (url.scheme === "file" &&
|
|
880
|
+
if (url.scheme === "file" && path58.length === 1 && isNormalizedWindowsDriveLetter(path58[0])) {
|
|
881
881
|
return;
|
|
882
882
|
}
|
|
883
|
-
|
|
883
|
+
path58.pop();
|
|
884
884
|
}
|
|
885
885
|
function includesCredentials(url) {
|
|
886
886
|
return url.username !== "" || url.password !== "";
|
|
@@ -2200,7 +2200,7 @@ var require_lib2 = __commonJS({
|
|
|
2200
2200
|
let accum = [];
|
|
2201
2201
|
let accumBytes = 0;
|
|
2202
2202
|
let abort = false;
|
|
2203
|
-
return new Body.Promise(function(
|
|
2203
|
+
return new Body.Promise(function(resolve42, reject) {
|
|
2204
2204
|
let resTimeout;
|
|
2205
2205
|
if (_this4.timeout) {
|
|
2206
2206
|
resTimeout = setTimeout(function() {
|
|
@@ -2234,7 +2234,7 @@ var require_lib2 = __commonJS({
|
|
|
2234
2234
|
}
|
|
2235
2235
|
clearTimeout(resTimeout);
|
|
2236
2236
|
try {
|
|
2237
|
-
|
|
2237
|
+
resolve42(Buffer.concat(accum, accumBytes));
|
|
2238
2238
|
} catch (err) {
|
|
2239
2239
|
reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, "system", err));
|
|
2240
2240
|
}
|
|
@@ -2909,7 +2909,7 @@ var require_lib2 = __commonJS({
|
|
|
2909
2909
|
throw new Error("native promise missing, set fetch.Promise to your favorite alternative");
|
|
2910
2910
|
}
|
|
2911
2911
|
Body.Promise = fetch3.Promise;
|
|
2912
|
-
return new fetch3.Promise(function(
|
|
2912
|
+
return new fetch3.Promise(function(resolve42, reject) {
|
|
2913
2913
|
const request = new Request3(url, opts);
|
|
2914
2914
|
const options = getNodeRequestOptions(request);
|
|
2915
2915
|
const send = (options.protocol === "https:" ? https : http2).request;
|
|
@@ -3042,7 +3042,7 @@ var require_lib2 = __commonJS({
|
|
|
3042
3042
|
requestOpts.body = void 0;
|
|
3043
3043
|
requestOpts.headers.delete("content-length");
|
|
3044
3044
|
}
|
|
3045
|
-
|
|
3045
|
+
resolve42(fetch3(new Request3(locationURL, requestOpts)));
|
|
3046
3046
|
finalize();
|
|
3047
3047
|
return;
|
|
3048
3048
|
}
|
|
@@ -3063,7 +3063,7 @@ var require_lib2 = __commonJS({
|
|
|
3063
3063
|
const codings = headers.get("Content-Encoding");
|
|
3064
3064
|
if (!request.compress || request.method === "HEAD" || codings === null || res.statusCode === 204 || res.statusCode === 304) {
|
|
3065
3065
|
response = new Response3(body, response_options);
|
|
3066
|
-
|
|
3066
|
+
resolve42(response);
|
|
3067
3067
|
return;
|
|
3068
3068
|
}
|
|
3069
3069
|
const zlibOptions = {
|
|
@@ -3073,7 +3073,7 @@ var require_lib2 = __commonJS({
|
|
|
3073
3073
|
if (codings == "gzip" || codings == "x-gzip") {
|
|
3074
3074
|
body = body.pipe(zlib.createGunzip(zlibOptions));
|
|
3075
3075
|
response = new Response3(body, response_options);
|
|
3076
|
-
|
|
3076
|
+
resolve42(response);
|
|
3077
3077
|
return;
|
|
3078
3078
|
}
|
|
3079
3079
|
if (codings == "deflate" || codings == "x-deflate") {
|
|
@@ -3085,12 +3085,12 @@ var require_lib2 = __commonJS({
|
|
|
3085
3085
|
body = body.pipe(zlib.createInflateRaw());
|
|
3086
3086
|
}
|
|
3087
3087
|
response = new Response3(body, response_options);
|
|
3088
|
-
|
|
3088
|
+
resolve42(response);
|
|
3089
3089
|
});
|
|
3090
3090
|
raw.on("end", function() {
|
|
3091
3091
|
if (!response) {
|
|
3092
3092
|
response = new Response3(body, response_options);
|
|
3093
|
-
|
|
3093
|
+
resolve42(response);
|
|
3094
3094
|
}
|
|
3095
3095
|
});
|
|
3096
3096
|
return;
|
|
@@ -3098,11 +3098,11 @@ var require_lib2 = __commonJS({
|
|
|
3098
3098
|
if (codings == "br" && typeof zlib.createBrotliDecompress === "function") {
|
|
3099
3099
|
body = body.pipe(zlib.createBrotliDecompress());
|
|
3100
3100
|
response = new Response3(body, response_options);
|
|
3101
|
-
|
|
3101
|
+
resolve42(response);
|
|
3102
3102
|
return;
|
|
3103
3103
|
}
|
|
3104
3104
|
response = new Response3(body, response_options);
|
|
3105
|
-
|
|
3105
|
+
resolve42(response);
|
|
3106
3106
|
});
|
|
3107
3107
|
writeToStream(req, request);
|
|
3108
3108
|
});
|
|
@@ -6459,14 +6459,14 @@ __export(fileFromPath_exports, {
|
|
|
6459
6459
|
fileFromPathSync: () => fileFromPathSync,
|
|
6460
6460
|
isFile: () => isFile
|
|
6461
6461
|
});
|
|
6462
|
-
function createFileFromPath(
|
|
6462
|
+
function createFileFromPath(path58, { mtimeMs, size }, filenameOrOptions, options = {}) {
|
|
6463
6463
|
let filename;
|
|
6464
6464
|
if (isPlainObject_default2(filenameOrOptions)) {
|
|
6465
6465
|
[options, filename] = [filenameOrOptions, void 0];
|
|
6466
6466
|
} else {
|
|
6467
6467
|
filename = filenameOrOptions;
|
|
6468
6468
|
}
|
|
6469
|
-
const file = new FileFromPath({ path:
|
|
6469
|
+
const file = new FileFromPath({ path: path58, size, lastModified: mtimeMs });
|
|
6470
6470
|
if (!filename) {
|
|
6471
6471
|
filename = file.name;
|
|
6472
6472
|
}
|
|
@@ -6475,13 +6475,13 @@ function createFileFromPath(path57, { mtimeMs, size }, filenameOrOptions, option
|
|
|
6475
6475
|
lastModified: file.lastModified
|
|
6476
6476
|
});
|
|
6477
6477
|
}
|
|
6478
|
-
function fileFromPathSync(
|
|
6479
|
-
const stats = (0, import_fs5.statSync)(
|
|
6480
|
-
return createFileFromPath(
|
|
6478
|
+
function fileFromPathSync(path58, filenameOrOptions, options = {}) {
|
|
6479
|
+
const stats = (0, import_fs5.statSync)(path58);
|
|
6480
|
+
return createFileFromPath(path58, stats, filenameOrOptions, options);
|
|
6481
6481
|
}
|
|
6482
|
-
async function fileFromPath2(
|
|
6483
|
-
const stats = await import_fs5.promises.stat(
|
|
6484
|
-
return createFileFromPath(
|
|
6482
|
+
async function fileFromPath2(path58, filenameOrOptions, options) {
|
|
6483
|
+
const stats = await import_fs5.promises.stat(path58);
|
|
6484
|
+
return createFileFromPath(path58, stats, filenameOrOptions, options);
|
|
6485
6485
|
}
|
|
6486
6486
|
var import_fs5, import_path5, import_node_domexception, __classPrivateFieldSet5, __classPrivateFieldGet6, _FileFromPath_path, _FileFromPath_start, MESSAGE, FileFromPath;
|
|
6487
6487
|
var init_fileFromPath = __esm({
|
|
@@ -8003,15 +8003,15 @@ var require_route = __commonJS({
|
|
|
8003
8003
|
};
|
|
8004
8004
|
}
|
|
8005
8005
|
function wrapConversion(toModel, graph) {
|
|
8006
|
-
const
|
|
8006
|
+
const path58 = [graph[toModel].parent, toModel];
|
|
8007
8007
|
let fn = conversions[graph[toModel].parent][toModel];
|
|
8008
8008
|
let cur = graph[toModel].parent;
|
|
8009
8009
|
while (graph[cur].parent) {
|
|
8010
|
-
|
|
8010
|
+
path58.unshift(graph[cur].parent);
|
|
8011
8011
|
fn = link(conversions[graph[cur].parent][cur], fn);
|
|
8012
8012
|
cur = graph[cur].parent;
|
|
8013
8013
|
}
|
|
8014
|
-
fn.conversion =
|
|
8014
|
+
fn.conversion = path58;
|
|
8015
8015
|
return fn;
|
|
8016
8016
|
}
|
|
8017
8017
|
module2.exports = function(fromModel) {
|
|
@@ -13941,7 +13941,7 @@ var require_iso2022 = __commonJS({
|
|
|
13941
13941
|
// node_modules/chardet/index.js
|
|
13942
13942
|
var require_chardet = __commonJS({
|
|
13943
13943
|
"node_modules/chardet/index.js"(exports2, module2) {
|
|
13944
|
-
var
|
|
13944
|
+
var fs49 = require("fs");
|
|
13945
13945
|
var utf8 = require_utf8();
|
|
13946
13946
|
var unicode = require_unicode();
|
|
13947
13947
|
var mbcs = require_mbcs();
|
|
@@ -14015,28 +14015,28 @@ var require_chardet = __commonJS({
|
|
|
14015
14015
|
var fd;
|
|
14016
14016
|
var handler = function(err, buffer) {
|
|
14017
14017
|
if (fd) {
|
|
14018
|
-
|
|
14018
|
+
fs49.closeSync(fd);
|
|
14019
14019
|
}
|
|
14020
14020
|
if (err) return cb(err, null);
|
|
14021
14021
|
cb(null, self.detect(buffer, opts));
|
|
14022
14022
|
};
|
|
14023
14023
|
if (opts && opts.sampleSize) {
|
|
14024
|
-
fd =
|
|
14025
|
-
|
|
14024
|
+
fd = fs49.openSync(filepath, "r"), sample = Buffer.allocUnsafe(opts.sampleSize);
|
|
14025
|
+
fs49.read(fd, sample, 0, opts.sampleSize, null, function(err) {
|
|
14026
14026
|
handler(err, sample);
|
|
14027
14027
|
});
|
|
14028
14028
|
return;
|
|
14029
14029
|
}
|
|
14030
|
-
|
|
14030
|
+
fs49.readFile(filepath, handler);
|
|
14031
14031
|
};
|
|
14032
14032
|
module2.exports.detectFileSync = function(filepath, opts) {
|
|
14033
14033
|
if (opts && opts.sampleSize) {
|
|
14034
|
-
var fd =
|
|
14035
|
-
|
|
14036
|
-
|
|
14034
|
+
var fd = fs49.openSync(filepath, "r"), sample2 = Buffer.allocUnsafe(opts.sampleSize);
|
|
14035
|
+
fs49.readSync(fd, sample2, 0, opts.sampleSize);
|
|
14036
|
+
fs49.closeSync(fd);
|
|
14037
14037
|
return self.detect(sample2, opts);
|
|
14038
14038
|
}
|
|
14039
|
-
return self.detect(
|
|
14039
|
+
return self.detect(fs49.readFileSync(filepath), opts);
|
|
14040
14040
|
};
|
|
14041
14041
|
module2.exports.detectAll = function(buffer, opts) {
|
|
14042
14042
|
if (typeof opts !== "object") {
|
|
@@ -17501,16 +17501,16 @@ var require_os_tmpdir = __commonJS({
|
|
|
17501
17501
|
var isWindows = process.platform === "win32";
|
|
17502
17502
|
var trailingSlashRe = isWindows ? /[^:]\\$/ : /.\/$/;
|
|
17503
17503
|
module2.exports = function() {
|
|
17504
|
-
var
|
|
17504
|
+
var path58;
|
|
17505
17505
|
if (isWindows) {
|
|
17506
|
-
|
|
17506
|
+
path58 = process.env.TEMP || process.env.TMP || (process.env.SystemRoot || process.env.windir) + "\\temp";
|
|
17507
17507
|
} else {
|
|
17508
|
-
|
|
17508
|
+
path58 = process.env.TMPDIR || process.env.TMP || process.env.TEMP || "/tmp";
|
|
17509
17509
|
}
|
|
17510
|
-
if (trailingSlashRe.test(
|
|
17511
|
-
|
|
17510
|
+
if (trailingSlashRe.test(path58)) {
|
|
17511
|
+
path58 = path58.slice(0, -1);
|
|
17512
17512
|
}
|
|
17513
|
-
return
|
|
17513
|
+
return path58;
|
|
17514
17514
|
};
|
|
17515
17515
|
}
|
|
17516
17516
|
});
|
|
@@ -17518,8 +17518,8 @@ var require_os_tmpdir = __commonJS({
|
|
|
17518
17518
|
// node_modules/tmp/lib/tmp.js
|
|
17519
17519
|
var require_tmp = __commonJS({
|
|
17520
17520
|
"node_modules/tmp/lib/tmp.js"(exports2, module2) {
|
|
17521
|
-
var
|
|
17522
|
-
var
|
|
17521
|
+
var fs49 = require("fs");
|
|
17522
|
+
var path58 = require("path");
|
|
17523
17523
|
var crypto6 = require("crypto");
|
|
17524
17524
|
var osTmpDir = require_os_tmpdir();
|
|
17525
17525
|
var _c2 = process.binding("constants");
|
|
@@ -17561,7 +17561,7 @@ var require_tmp = __commonJS({
|
|
|
17561
17561
|
}
|
|
17562
17562
|
function _generateTmpName(opts) {
|
|
17563
17563
|
if (opts.name) {
|
|
17564
|
-
return
|
|
17564
|
+
return path58.join(opts.dir || tmpDir, opts.name);
|
|
17565
17565
|
}
|
|
17566
17566
|
if (opts.template) {
|
|
17567
17567
|
return opts.template.replace(TEMPLATE_PATTERN, _randomChars(6));
|
|
@@ -17572,7 +17572,7 @@ var require_tmp = __commonJS({
|
|
|
17572
17572
|
_randomChars(12),
|
|
17573
17573
|
opts.postfix || ""
|
|
17574
17574
|
].join("");
|
|
17575
|
-
return
|
|
17575
|
+
return path58.join(opts.dir || tmpDir, name);
|
|
17576
17576
|
}
|
|
17577
17577
|
function tmpName(options, callback) {
|
|
17578
17578
|
var args = _parseArguments(options, callback), opts = args[0], cb = args[1], tries = opts.name ? 1 : opts.tries || DEFAULT_TRIES;
|
|
@@ -17582,7 +17582,7 @@ var require_tmp = __commonJS({
|
|
|
17582
17582
|
return cb(new Error("Invalid template provided"));
|
|
17583
17583
|
(function _getUniqueName() {
|
|
17584
17584
|
const name = _generateTmpName(opts);
|
|
17585
|
-
|
|
17585
|
+
fs49.stat(name, function(err) {
|
|
17586
17586
|
if (!err) {
|
|
17587
17587
|
if (tries-- > 0) return _getUniqueName();
|
|
17588
17588
|
return cb(new Error("Could not get a unique tmp filename, max tries reached " + name));
|
|
@@ -17600,7 +17600,7 @@ var require_tmp = __commonJS({
|
|
|
17600
17600
|
do {
|
|
17601
17601
|
const name = _generateTmpName(opts);
|
|
17602
17602
|
try {
|
|
17603
|
-
|
|
17603
|
+
fs49.statSync(name);
|
|
17604
17604
|
} catch (e2) {
|
|
17605
17605
|
return name;
|
|
17606
17606
|
}
|
|
@@ -17612,13 +17612,13 @@ var require_tmp = __commonJS({
|
|
|
17612
17612
|
opts.postfix = _isUndefined(opts.postfix) ? ".tmp" : opts.postfix;
|
|
17613
17613
|
tmpName(opts, function _tmpNameCreated(err, name) {
|
|
17614
17614
|
if (err) return cb(err);
|
|
17615
|
-
|
|
17615
|
+
fs49.open(name, CREATE_FLAGS, opts.mode || FILE_MODE, function _fileCreated(err2, fd) {
|
|
17616
17616
|
if (err2) return cb(err2);
|
|
17617
17617
|
if (opts.discardDescriptor) {
|
|
17618
|
-
return
|
|
17618
|
+
return fs49.close(fd, function _discardCallback(err3) {
|
|
17619
17619
|
if (err3) {
|
|
17620
17620
|
try {
|
|
17621
|
-
|
|
17621
|
+
fs49.unlinkSync(name);
|
|
17622
17622
|
} catch (e2) {
|
|
17623
17623
|
if (!isENOENT(e2)) {
|
|
17624
17624
|
err3 = e2;
|
|
@@ -17641,9 +17641,9 @@ var require_tmp = __commonJS({
|
|
|
17641
17641
|
opts.postfix = opts.postfix || ".tmp";
|
|
17642
17642
|
const discardOrDetachDescriptor = opts.discardDescriptor || opts.detachDescriptor;
|
|
17643
17643
|
const name = tmpNameSync(opts);
|
|
17644
|
-
var fd =
|
|
17644
|
+
var fd = fs49.openSync(name, CREATE_FLAGS, opts.mode || FILE_MODE);
|
|
17645
17645
|
if (opts.discardDescriptor) {
|
|
17646
|
-
|
|
17646
|
+
fs49.closeSync(fd);
|
|
17647
17647
|
fd = void 0;
|
|
17648
17648
|
}
|
|
17649
17649
|
return {
|
|
@@ -17655,9 +17655,9 @@ var require_tmp = __commonJS({
|
|
|
17655
17655
|
function _rmdirRecursiveSync(root) {
|
|
17656
17656
|
const dirs = [root];
|
|
17657
17657
|
do {
|
|
17658
|
-
var dir2 = dirs.pop(), deferred = false, files =
|
|
17658
|
+
var dir2 = dirs.pop(), deferred = false, files = fs49.readdirSync(dir2);
|
|
17659
17659
|
for (var i2 = 0, length = files.length; i2 < length; i2++) {
|
|
17660
|
-
var file2 =
|
|
17660
|
+
var file2 = path58.join(dir2, files[i2]), stat = fs49.lstatSync(file2);
|
|
17661
17661
|
if (stat.isDirectory()) {
|
|
17662
17662
|
if (!deferred) {
|
|
17663
17663
|
deferred = true;
|
|
@@ -17665,11 +17665,11 @@ var require_tmp = __commonJS({
|
|
|
17665
17665
|
}
|
|
17666
17666
|
dirs.push(file2);
|
|
17667
17667
|
} else {
|
|
17668
|
-
|
|
17668
|
+
fs49.unlinkSync(file2);
|
|
17669
17669
|
}
|
|
17670
17670
|
}
|
|
17671
17671
|
if (!deferred) {
|
|
17672
|
-
|
|
17672
|
+
fs49.rmdirSync(dir2);
|
|
17673
17673
|
}
|
|
17674
17674
|
} while (dirs.length !== 0);
|
|
17675
17675
|
}
|
|
@@ -17677,7 +17677,7 @@ var require_tmp = __commonJS({
|
|
|
17677
17677
|
var args = _parseArguments(options, callback), opts = args[0], cb = args[1];
|
|
17678
17678
|
tmpName(opts, function _tmpNameCreated(err, name) {
|
|
17679
17679
|
if (err) return cb(err);
|
|
17680
|
-
|
|
17680
|
+
fs49.mkdir(name, opts.mode || DIR_MODE, function _dirCreated(err2) {
|
|
17681
17681
|
if (err2) return cb(err2);
|
|
17682
17682
|
cb(null, name, _prepareTmpDirRemoveCallback(name, opts));
|
|
17683
17683
|
});
|
|
@@ -17686,7 +17686,7 @@ var require_tmp = __commonJS({
|
|
|
17686
17686
|
function dirSync(options) {
|
|
17687
17687
|
var args = _parseArguments(options), opts = args[0];
|
|
17688
17688
|
const name = tmpNameSync(opts);
|
|
17689
|
-
|
|
17689
|
+
fs49.mkdirSync(name, opts.mode || DIR_MODE);
|
|
17690
17690
|
return {
|
|
17691
17691
|
name,
|
|
17692
17692
|
removeCallback: _prepareTmpDirRemoveCallback(name, opts)
|
|
@@ -17696,7 +17696,7 @@ var require_tmp = __commonJS({
|
|
|
17696
17696
|
const removeCallback = _prepareRemoveCallback(function _removeCallback(fdPath) {
|
|
17697
17697
|
try {
|
|
17698
17698
|
if (0 <= fdPath[0]) {
|
|
17699
|
-
|
|
17699
|
+
fs49.closeSync(fdPath[0]);
|
|
17700
17700
|
}
|
|
17701
17701
|
} catch (e2) {
|
|
17702
17702
|
if (!isEBADF(e2) && !isENOENT(e2)) {
|
|
@@ -17704,7 +17704,7 @@ var require_tmp = __commonJS({
|
|
|
17704
17704
|
}
|
|
17705
17705
|
}
|
|
17706
17706
|
try {
|
|
17707
|
-
|
|
17707
|
+
fs49.unlinkSync(fdPath[1]);
|
|
17708
17708
|
} catch (e2) {
|
|
17709
17709
|
if (!isENOENT(e2)) {
|
|
17710
17710
|
throw e2;
|
|
@@ -17717,7 +17717,7 @@ var require_tmp = __commonJS({
|
|
|
17717
17717
|
return removeCallback;
|
|
17718
17718
|
}
|
|
17719
17719
|
function _prepareTmpDirRemoveCallback(name, opts) {
|
|
17720
|
-
const removeFunction = opts.unsafeCleanup ? _rmdirRecursiveSync :
|
|
17720
|
+
const removeFunction = opts.unsafeCleanup ? _rmdirRecursiveSync : fs49.rmdirSync.bind(fs49);
|
|
17721
17721
|
const removeCallback = _prepareRemoveCallback(removeFunction, name);
|
|
17722
17722
|
if (!opts.keep) {
|
|
17723
17723
|
_removeObjects.unshift(removeCallback);
|
|
@@ -18868,7 +18868,7 @@ var require_Observable = __commonJS({
|
|
|
18868
18868
|
Observable2.prototype.forEach = function(next, promiseCtor) {
|
|
18869
18869
|
var _this = this;
|
|
18870
18870
|
promiseCtor = getPromiseCtor(promiseCtor);
|
|
18871
|
-
return new promiseCtor(function(
|
|
18871
|
+
return new promiseCtor(function(resolve42, reject) {
|
|
18872
18872
|
var subscriber = new Subscriber_1.SafeSubscriber({
|
|
18873
18873
|
next: function(value) {
|
|
18874
18874
|
try {
|
|
@@ -18879,7 +18879,7 @@ var require_Observable = __commonJS({
|
|
|
18879
18879
|
}
|
|
18880
18880
|
},
|
|
18881
18881
|
error: reject,
|
|
18882
|
-
complete:
|
|
18882
|
+
complete: resolve42
|
|
18883
18883
|
});
|
|
18884
18884
|
_this.subscribe(subscriber);
|
|
18885
18885
|
});
|
|
@@ -18901,14 +18901,14 @@ var require_Observable = __commonJS({
|
|
|
18901
18901
|
Observable2.prototype.toPromise = function(promiseCtor) {
|
|
18902
18902
|
var _this = this;
|
|
18903
18903
|
promiseCtor = getPromiseCtor(promiseCtor);
|
|
18904
|
-
return new promiseCtor(function(
|
|
18904
|
+
return new promiseCtor(function(resolve42, reject) {
|
|
18905
18905
|
var value;
|
|
18906
18906
|
_this.subscribe(function(x2) {
|
|
18907
18907
|
return value = x2;
|
|
18908
18908
|
}, function(err) {
|
|
18909
18909
|
return reject(err);
|
|
18910
18910
|
}, function() {
|
|
18911
|
-
return
|
|
18911
|
+
return resolve42(value);
|
|
18912
18912
|
});
|
|
18913
18913
|
});
|
|
18914
18914
|
};
|
|
@@ -21004,11 +21004,11 @@ var require_innerFrom = __commonJS({
|
|
|
21004
21004
|
"use strict";
|
|
21005
21005
|
var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P2, generator) {
|
|
21006
21006
|
function adopt(value) {
|
|
21007
|
-
return value instanceof P2 ? value : new P2(function(
|
|
21008
|
-
|
|
21007
|
+
return value instanceof P2 ? value : new P2(function(resolve42) {
|
|
21008
|
+
resolve42(value);
|
|
21009
21009
|
});
|
|
21010
21010
|
}
|
|
21011
|
-
return new (P2 || (P2 = Promise))(function(
|
|
21011
|
+
return new (P2 || (P2 = Promise))(function(resolve42, reject) {
|
|
21012
21012
|
function fulfilled(value) {
|
|
21013
21013
|
try {
|
|
21014
21014
|
step(generator.next(value));
|
|
@@ -21024,7 +21024,7 @@ var require_innerFrom = __commonJS({
|
|
|
21024
21024
|
}
|
|
21025
21025
|
}
|
|
21026
21026
|
function step(result) {
|
|
21027
|
-
result.done ?
|
|
21027
|
+
result.done ? resolve42(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
21028
21028
|
}
|
|
21029
21029
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21030
21030
|
});
|
|
@@ -21106,14 +21106,14 @@ var require_innerFrom = __commonJS({
|
|
|
21106
21106
|
}, i2);
|
|
21107
21107
|
function verb(n2) {
|
|
21108
21108
|
i2[n2] = o2[n2] && function(v2) {
|
|
21109
|
-
return new Promise(function(
|
|
21110
|
-
v2 = o2[n2](v2), settle(
|
|
21109
|
+
return new Promise(function(resolve42, reject) {
|
|
21110
|
+
v2 = o2[n2](v2), settle(resolve42, reject, v2.done, v2.value);
|
|
21111
21111
|
});
|
|
21112
21112
|
};
|
|
21113
21113
|
}
|
|
21114
|
-
function settle(
|
|
21114
|
+
function settle(resolve42, reject, d2, v2) {
|
|
21115
21115
|
Promise.resolve(v2).then(function(v3) {
|
|
21116
|
-
|
|
21116
|
+
resolve42({ value: v3, done: d2 });
|
|
21117
21117
|
}, reject);
|
|
21118
21118
|
}
|
|
21119
21119
|
};
|
|
@@ -21732,7 +21732,7 @@ var require_lastValueFrom = __commonJS({
|
|
|
21732
21732
|
var EmptyError_1 = require_EmptyError();
|
|
21733
21733
|
function lastValueFrom2(source, config2) {
|
|
21734
21734
|
var hasConfig = typeof config2 === "object";
|
|
21735
|
-
return new Promise(function(
|
|
21735
|
+
return new Promise(function(resolve42, reject) {
|
|
21736
21736
|
var _hasValue = false;
|
|
21737
21737
|
var _value;
|
|
21738
21738
|
source.subscribe({
|
|
@@ -21743,9 +21743,9 @@ var require_lastValueFrom = __commonJS({
|
|
|
21743
21743
|
error: reject,
|
|
21744
21744
|
complete: function() {
|
|
21745
21745
|
if (_hasValue) {
|
|
21746
|
-
|
|
21746
|
+
resolve42(_value);
|
|
21747
21747
|
} else if (hasConfig) {
|
|
21748
|
-
|
|
21748
|
+
resolve42(config2.defaultValue);
|
|
21749
21749
|
} else {
|
|
21750
21750
|
reject(new EmptyError_1.EmptyError());
|
|
21751
21751
|
}
|
|
@@ -21767,16 +21767,16 @@ var require_firstValueFrom = __commonJS({
|
|
|
21767
21767
|
var Subscriber_1 = require_Subscriber();
|
|
21768
21768
|
function firstValueFrom(source, config2) {
|
|
21769
21769
|
var hasConfig = typeof config2 === "object";
|
|
21770
|
-
return new Promise(function(
|
|
21770
|
+
return new Promise(function(resolve42, reject) {
|
|
21771
21771
|
var subscriber = new Subscriber_1.SafeSubscriber({
|
|
21772
21772
|
next: function(value) {
|
|
21773
|
-
|
|
21773
|
+
resolve42(value);
|
|
21774
21774
|
subscriber.unsubscribe();
|
|
21775
21775
|
},
|
|
21776
21776
|
error: reject,
|
|
21777
21777
|
complete: function() {
|
|
21778
21778
|
if (hasConfig) {
|
|
21779
|
-
|
|
21779
|
+
resolve42(config2.defaultValue);
|
|
21780
21780
|
} else {
|
|
21781
21781
|
reject(new EmptyError_1.EmptyError());
|
|
21782
21782
|
}
|
|
@@ -25739,7 +25739,7 @@ var require_share = __commonJS({
|
|
|
25739
25739
|
subscriber.add(function() {
|
|
25740
25740
|
refCount--;
|
|
25741
25741
|
if (refCount === 0 && !hasErrored && !hasCompleted) {
|
|
25742
|
-
resetConnection =
|
|
25742
|
+
resetConnection = handleReset2(resetAndUnsubscribe, resetOnRefCountZero);
|
|
25743
25743
|
}
|
|
25744
25744
|
});
|
|
25745
25745
|
dest.subscribe(subscriber);
|
|
@@ -25751,13 +25751,13 @@ var require_share = __commonJS({
|
|
|
25751
25751
|
error: function(err) {
|
|
25752
25752
|
hasErrored = true;
|
|
25753
25753
|
cancelReset();
|
|
25754
|
-
resetConnection =
|
|
25754
|
+
resetConnection = handleReset2(reset, resetOnError, err);
|
|
25755
25755
|
dest.error(err);
|
|
25756
25756
|
},
|
|
25757
25757
|
complete: function() {
|
|
25758
25758
|
hasCompleted = true;
|
|
25759
25759
|
cancelReset();
|
|
25760
|
-
resetConnection =
|
|
25760
|
+
resetConnection = handleReset2(reset, resetOnComplete);
|
|
25761
25761
|
dest.complete();
|
|
25762
25762
|
}
|
|
25763
25763
|
});
|
|
@@ -25767,7 +25767,7 @@ var require_share = __commonJS({
|
|
|
25767
25767
|
};
|
|
25768
25768
|
}
|
|
25769
25769
|
exports2.share = share;
|
|
25770
|
-
function
|
|
25770
|
+
function handleReset2(reset, on) {
|
|
25771
25771
|
var args = [];
|
|
25772
25772
|
for (var _i = 2; _i < arguments.length; _i++) {
|
|
25773
25773
|
args[_i - 2] = arguments[_i];
|
|
@@ -27569,14 +27569,14 @@ var require_run_async = __commonJS({
|
|
|
27569
27569
|
return function() {
|
|
27570
27570
|
var args = arguments;
|
|
27571
27571
|
var originalThis = this;
|
|
27572
|
-
var promise = new Promise(function(
|
|
27572
|
+
var promise = new Promise(function(resolve42, reject) {
|
|
27573
27573
|
var resolved = false;
|
|
27574
27574
|
const wrappedResolve = function(value) {
|
|
27575
27575
|
if (resolved) {
|
|
27576
27576
|
console.warn("Run-async promise already resolved.");
|
|
27577
27577
|
}
|
|
27578
27578
|
resolved = true;
|
|
27579
|
-
|
|
27579
|
+
resolve42(value);
|
|
27580
27580
|
};
|
|
27581
27581
|
var rejected = false;
|
|
27582
27582
|
const wrappedReject = function(value) {
|
|
@@ -30605,7 +30605,7 @@ var require_compile = __commonJS({
|
|
|
30605
30605
|
const schOrFunc = root.refs[ref];
|
|
30606
30606
|
if (schOrFunc)
|
|
30607
30607
|
return schOrFunc;
|
|
30608
|
-
let _sch =
|
|
30608
|
+
let _sch = resolve42.call(this, root, ref);
|
|
30609
30609
|
if (_sch === void 0) {
|
|
30610
30610
|
const schema = (_a3 = root.localRefs) === null || _a3 === void 0 ? void 0 : _a3[ref];
|
|
30611
30611
|
const { schemaId } = this.opts;
|
|
@@ -30632,7 +30632,7 @@ var require_compile = __commonJS({
|
|
|
30632
30632
|
function sameSchemaEnv(s1, s2) {
|
|
30633
30633
|
return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;
|
|
30634
30634
|
}
|
|
30635
|
-
function
|
|
30635
|
+
function resolve42(root, ref) {
|
|
30636
30636
|
let sch;
|
|
30637
30637
|
while (typeof (sch = this.refs[ref]) == "string")
|
|
30638
30638
|
ref = sch;
|
|
@@ -30850,8 +30850,8 @@ var require_utils2 = __commonJS({
|
|
|
30850
30850
|
}
|
|
30851
30851
|
return ind;
|
|
30852
30852
|
}
|
|
30853
|
-
function removeDotSegments(
|
|
30854
|
-
let input =
|
|
30853
|
+
function removeDotSegments(path58) {
|
|
30854
|
+
let input = path58;
|
|
30855
30855
|
const output = [];
|
|
30856
30856
|
let nextSlash = -1;
|
|
30857
30857
|
let len = 0;
|
|
@@ -31103,8 +31103,8 @@ var require_schemes = __commonJS({
|
|
|
31103
31103
|
wsComponent.secure = void 0;
|
|
31104
31104
|
}
|
|
31105
31105
|
if (wsComponent.resourceName) {
|
|
31106
|
-
const [
|
|
31107
|
-
wsComponent.path =
|
|
31106
|
+
const [path58, query] = wsComponent.resourceName.split("?");
|
|
31107
|
+
wsComponent.path = path58 && path58 !== "/" ? path58 : void 0;
|
|
31108
31108
|
wsComponent.query = query;
|
|
31109
31109
|
wsComponent.resourceName = void 0;
|
|
31110
31110
|
}
|
|
@@ -31263,7 +31263,7 @@ var require_fast_uri = __commonJS({
|
|
|
31263
31263
|
}
|
|
31264
31264
|
return uri;
|
|
31265
31265
|
}
|
|
31266
|
-
function
|
|
31266
|
+
function resolve42(baseURI, relativeURI, options) {
|
|
31267
31267
|
const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
|
|
31268
31268
|
const resolved = resolveComponent(parse4(baseURI, schemelessOptions), parse4(relativeURI, schemelessOptions), schemelessOptions, true);
|
|
31269
31269
|
schemelessOptions.skipEscape = true;
|
|
@@ -31521,7 +31521,7 @@ var require_fast_uri = __commonJS({
|
|
|
31521
31521
|
var fastUri = {
|
|
31522
31522
|
SCHEMES,
|
|
31523
31523
|
normalize: normalize3,
|
|
31524
|
-
resolve:
|
|
31524
|
+
resolve: resolve42,
|
|
31525
31525
|
resolveComponent,
|
|
31526
31526
|
equal,
|
|
31527
31527
|
serialize,
|
|
@@ -34497,12 +34497,12 @@ var require_dist = __commonJS({
|
|
|
34497
34497
|
throw new Error(`Unknown format "${name}"`);
|
|
34498
34498
|
return f2;
|
|
34499
34499
|
};
|
|
34500
|
-
function addFormats(ajv, list,
|
|
34500
|
+
function addFormats(ajv, list, fs49, exportName) {
|
|
34501
34501
|
var _a3;
|
|
34502
34502
|
var _b2;
|
|
34503
34503
|
(_a3 = (_b2 = ajv.opts.code).formats) !== null && _a3 !== void 0 ? _a3 : _b2.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`;
|
|
34504
34504
|
for (const f2 of list)
|
|
34505
|
-
ajv.addFormat(f2,
|
|
34505
|
+
ajv.addFormat(f2, fs49[f2]);
|
|
34506
34506
|
}
|
|
34507
34507
|
module2.exports = exports2 = formatsPlugin;
|
|
34508
34508
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
@@ -35786,11 +35786,11 @@ var parser = new YargsParser({
|
|
|
35786
35786
|
resolve: import_path2.resolve,
|
|
35787
35787
|
// TODO: figure out a way to combine ESM and CJS coverage, such that
|
|
35788
35788
|
// we can exercise all the lines below:
|
|
35789
|
-
require: (
|
|
35789
|
+
require: (path58) => {
|
|
35790
35790
|
if (typeof require !== "undefined") {
|
|
35791
|
-
return require(
|
|
35792
|
-
} else if (
|
|
35793
|
-
return JSON.parse((0, import_fs2.readFileSync)(
|
|
35791
|
+
return require(path58);
|
|
35792
|
+
} else if (path58.match(/\.json$/)) {
|
|
35793
|
+
return JSON.parse((0, import_fs2.readFileSync)(path58, "utf8"));
|
|
35794
35794
|
} else {
|
|
35795
35795
|
throw Error("only .json config files are supported in ESM");
|
|
35796
35796
|
}
|
|
@@ -38316,12 +38316,12 @@ var YargsInstance = class {
|
|
|
38316
38316
|
async getCompletion(args, done) {
|
|
38317
38317
|
argsert("<array> [function]", [args, done], arguments.length);
|
|
38318
38318
|
if (!done) {
|
|
38319
|
-
return new Promise((
|
|
38319
|
+
return new Promise((resolve42, reject) => {
|
|
38320
38320
|
__classPrivateFieldGet(this, _YargsInstance_completion, "f").getCompletion(args, (err, completions) => {
|
|
38321
38321
|
if (err)
|
|
38322
38322
|
reject(err);
|
|
38323
38323
|
else
|
|
38324
|
-
|
|
38324
|
+
resolve42(completions);
|
|
38325
38325
|
});
|
|
38326
38326
|
});
|
|
38327
38327
|
} else {
|
|
@@ -40474,8 +40474,8 @@ function getErrorMap() {
|
|
|
40474
40474
|
|
|
40475
40475
|
// node_modules/zod/v3/helpers/parseUtil.js
|
|
40476
40476
|
var makeIssue = (params) => {
|
|
40477
|
-
const { data, path:
|
|
40478
|
-
const fullPath = [...
|
|
40477
|
+
const { data, path: path58, errorMaps, issueData } = params;
|
|
40478
|
+
const fullPath = [...path58, ...issueData.path || []];
|
|
40479
40479
|
const fullIssue = {
|
|
40480
40480
|
...issueData,
|
|
40481
40481
|
path: fullPath
|
|
@@ -40591,11 +40591,11 @@ var errorUtil;
|
|
|
40591
40591
|
|
|
40592
40592
|
// node_modules/zod/v3/types.js
|
|
40593
40593
|
var ParseInputLazyPath = class {
|
|
40594
|
-
constructor(parent, value,
|
|
40594
|
+
constructor(parent, value, path58, key) {
|
|
40595
40595
|
this._cachedPath = [];
|
|
40596
40596
|
this.parent = parent;
|
|
40597
40597
|
this.data = value;
|
|
40598
|
-
this._path =
|
|
40598
|
+
this._path = path58;
|
|
40599
40599
|
this._key = key;
|
|
40600
40600
|
}
|
|
40601
40601
|
get path() {
|
|
@@ -44378,6 +44378,28 @@ var UnregisterRepoResultSchema = external_exports.object({
|
|
|
44378
44378
|
deleteWorktrees: external_exports.boolean(),
|
|
44379
44379
|
worktrees: external_exports.array(UnregisterWorktreeResultSchema)
|
|
44380
44380
|
});
|
|
44381
|
+
var ResetMissionControlInputSchema = external_exports.object({
|
|
44382
|
+
confirm: external_exports.literal("RESET"),
|
|
44383
|
+
/**
|
|
44384
|
+
* When true, delete `.har/{runs,validations,state,slots}` under each registered
|
|
44385
|
+
* repository path (best-effort; Docker often cannot see host paths).
|
|
44386
|
+
*/
|
|
44387
|
+
scrubLocalHarness: external_exports.boolean().optional().default(true)
|
|
44388
|
+
});
|
|
44389
|
+
var HarnessScrubResultSchema = external_exports.object({
|
|
44390
|
+
path: external_exports.string(),
|
|
44391
|
+
directory: external_exports.string(),
|
|
44392
|
+
deleted: external_exports.boolean(),
|
|
44393
|
+
error: external_exports.string().optional()
|
|
44394
|
+
});
|
|
44395
|
+
var ResetMissionControlResultSchema = external_exports.object({
|
|
44396
|
+
ok: external_exports.literal(true),
|
|
44397
|
+
repositoriesDeleted: external_exports.number().int().nonnegative(),
|
|
44398
|
+
unregisteredCleared: external_exports.number().int().nonnegative(),
|
|
44399
|
+
scrubLocalHarness: external_exports.boolean(),
|
|
44400
|
+
scrubbed: external_exports.array(HarnessScrubResultSchema),
|
|
44401
|
+
repoPaths: external_exports.array(external_exports.string())
|
|
44402
|
+
});
|
|
44381
44403
|
var SyncRunsInputSchema = external_exports.object({
|
|
44382
44404
|
runs: external_exports.array(RunRecordSchema)
|
|
44383
44405
|
});
|
|
@@ -44734,16 +44756,16 @@ async function handleAgentSkills(options) {
|
|
|
44734
44756
|
}
|
|
44735
44757
|
async function askYesNo(question) {
|
|
44736
44758
|
const rl = readline.createInterface({ input: process.stdin, output: process.stderr });
|
|
44737
|
-
return new Promise((
|
|
44759
|
+
return new Promise((resolve42) => {
|
|
44738
44760
|
process.stderr.write(`${question} `);
|
|
44739
44761
|
rl.once("line", (answer) => {
|
|
44740
44762
|
rl.close();
|
|
44741
44763
|
const trimmed = answer.trim();
|
|
44742
44764
|
if (trimmed === "") {
|
|
44743
|
-
|
|
44765
|
+
resolve42(true);
|
|
44744
44766
|
return;
|
|
44745
44767
|
}
|
|
44746
|
-
|
|
44768
|
+
resolve42(/^y(es)?$/i.test(trimmed));
|
|
44747
44769
|
});
|
|
44748
44770
|
});
|
|
44749
44771
|
}
|
|
@@ -45601,13 +45623,13 @@ var MultipartBody = class {
|
|
|
45601
45623
|
// node_modules/@anthropic-ai/sdk/_shims/node-runtime.mjs
|
|
45602
45624
|
var import_web = require("node:stream/web");
|
|
45603
45625
|
var fileFromPathWarned = false;
|
|
45604
|
-
async function fileFromPath3(
|
|
45626
|
+
async function fileFromPath3(path58, ...args) {
|
|
45605
45627
|
const { fileFromPath: _fileFromPath } = await Promise.resolve().then(() => (init_fileFromPath(), fileFromPath_exports));
|
|
45606
45628
|
if (!fileFromPathWarned) {
|
|
45607
|
-
console.warn(`fileFromPath is deprecated; use fs.createReadStream(${JSON.stringify(
|
|
45629
|
+
console.warn(`fileFromPath is deprecated; use fs.createReadStream(${JSON.stringify(path58)}) instead`);
|
|
45608
45630
|
fileFromPathWarned = true;
|
|
45609
45631
|
}
|
|
45610
|
-
return await _fileFromPath(
|
|
45632
|
+
return await _fileFromPath(path58, ...args);
|
|
45611
45633
|
}
|
|
45612
45634
|
var defaultHttpAgent = new import_agentkeepalive.default({ keepAlive: true, timeout: 5 * 60 * 1e3 });
|
|
45613
45635
|
var defaultHttpsAgent = new import_agentkeepalive.default.HttpsAgent({ keepAlive: true, timeout: 5 * 60 * 1e3 });
|
|
@@ -46103,8 +46125,8 @@ async function defaultParseResponse(props) {
|
|
|
46103
46125
|
}
|
|
46104
46126
|
var APIPromise = class _APIPromise extends Promise {
|
|
46105
46127
|
constructor(responsePromise, parseResponse = defaultParseResponse) {
|
|
46106
|
-
super((
|
|
46107
|
-
|
|
46128
|
+
super((resolve42) => {
|
|
46129
|
+
resolve42(null);
|
|
46108
46130
|
});
|
|
46109
46131
|
this.responsePromise = responsePromise;
|
|
46110
46132
|
this.parseResponse = parseResponse;
|
|
@@ -46204,29 +46226,29 @@ var APIClient = class {
|
|
|
46204
46226
|
defaultIdempotencyKey() {
|
|
46205
46227
|
return `stainless-node-retry-${uuid4()}`;
|
|
46206
46228
|
}
|
|
46207
|
-
get(
|
|
46208
|
-
return this.methodRequest("get",
|
|
46229
|
+
get(path58, opts) {
|
|
46230
|
+
return this.methodRequest("get", path58, opts);
|
|
46209
46231
|
}
|
|
46210
|
-
post(
|
|
46211
|
-
return this.methodRequest("post",
|
|
46232
|
+
post(path58, opts) {
|
|
46233
|
+
return this.methodRequest("post", path58, opts);
|
|
46212
46234
|
}
|
|
46213
|
-
patch(
|
|
46214
|
-
return this.methodRequest("patch",
|
|
46235
|
+
patch(path58, opts) {
|
|
46236
|
+
return this.methodRequest("patch", path58, opts);
|
|
46215
46237
|
}
|
|
46216
|
-
put(
|
|
46217
|
-
return this.methodRequest("put",
|
|
46238
|
+
put(path58, opts) {
|
|
46239
|
+
return this.methodRequest("put", path58, opts);
|
|
46218
46240
|
}
|
|
46219
|
-
delete(
|
|
46220
|
-
return this.methodRequest("delete",
|
|
46241
|
+
delete(path58, opts) {
|
|
46242
|
+
return this.methodRequest("delete", path58, opts);
|
|
46221
46243
|
}
|
|
46222
|
-
methodRequest(method,
|
|
46244
|
+
methodRequest(method, path58, opts) {
|
|
46223
46245
|
return this.request(Promise.resolve(opts).then(async (opts2) => {
|
|
46224
46246
|
const body = opts2 && isBlobLike(opts2?.body) ? new DataView(await opts2.body.arrayBuffer()) : opts2?.body instanceof DataView ? opts2.body : opts2?.body instanceof ArrayBuffer ? new DataView(opts2.body) : opts2 && ArrayBuffer.isView(opts2?.body) ? new DataView(opts2.body.buffer) : opts2?.body;
|
|
46225
|
-
return { method, path:
|
|
46247
|
+
return { method, path: path58, ...opts2, body };
|
|
46226
46248
|
}));
|
|
46227
46249
|
}
|
|
46228
|
-
getAPIList(
|
|
46229
|
-
return this.requestAPIList(Page, { method: "get", path:
|
|
46250
|
+
getAPIList(path58, Page, opts) {
|
|
46251
|
+
return this.requestAPIList(Page, { method: "get", path: path58, ...opts });
|
|
46230
46252
|
}
|
|
46231
46253
|
calculateContentLength(body) {
|
|
46232
46254
|
if (typeof body === "string") {
|
|
@@ -46244,10 +46266,10 @@ var APIClient = class {
|
|
|
46244
46266
|
return null;
|
|
46245
46267
|
}
|
|
46246
46268
|
buildRequest(options) {
|
|
46247
|
-
const { method, path:
|
|
46269
|
+
const { method, path: path58, query, headers = {} } = options;
|
|
46248
46270
|
const body = ArrayBuffer.isView(options.body) || options.__binaryRequest && typeof options.body === "string" ? options.body : isMultipartBody(options.body) ? options.body.body : options.body ? JSON.stringify(options.body, null, 2) : null;
|
|
46249
46271
|
const contentLength = this.calculateContentLength(body);
|
|
46250
|
-
const url = this.buildURL(
|
|
46272
|
+
const url = this.buildURL(path58, query);
|
|
46251
46273
|
if ("timeout" in options)
|
|
46252
46274
|
validatePositiveInteger("timeout", options.timeout);
|
|
46253
46275
|
const timeout = options.timeout ?? this.timeout;
|
|
@@ -46356,8 +46378,8 @@ var APIClient = class {
|
|
|
46356
46378
|
const request = this.makeRequest(options, null);
|
|
46357
46379
|
return new PagePromise(this, request, Page);
|
|
46358
46380
|
}
|
|
46359
|
-
buildURL(
|
|
46360
|
-
const url = isAbsoluteURL(
|
|
46381
|
+
buildURL(path58, query) {
|
|
46382
|
+
const url = isAbsoluteURL(path58) ? new URL(path58) : new URL(this.baseURL + (this.baseURL.endsWith("/") && path58.startsWith("/") ? path58.slice(1) : path58));
|
|
46361
46383
|
const defaultQuery = this.defaultQuery();
|
|
46362
46384
|
if (!isEmptyObj(defaultQuery)) {
|
|
46363
46385
|
query = { ...defaultQuery, ...query };
|
|
@@ -46642,7 +46664,7 @@ var startsWithSchemeRegexp = new RegExp("^(?:[a-z]+:)?//", "i");
|
|
|
46642
46664
|
var isAbsoluteURL = (url) => {
|
|
46643
46665
|
return startsWithSchemeRegexp.test(url);
|
|
46644
46666
|
};
|
|
46645
|
-
var sleep = (ms) => new Promise((
|
|
46667
|
+
var sleep = (ms) => new Promise((resolve42) => setTimeout(resolve42, ms));
|
|
46646
46668
|
var validatePositiveInteger = (name, n2) => {
|
|
46647
46669
|
if (typeof n2 !== "number" || !Number.isInteger(n2)) {
|
|
46648
46670
|
throw new AnthropicError(`${name} must be an integer`);
|
|
@@ -47133,12 +47155,12 @@ var PromptCachingBetaMessageStream = class _PromptCachingBetaMessageStream {
|
|
|
47133
47155
|
}
|
|
47134
47156
|
return this._emit("error", new AnthropicError(String(error3)));
|
|
47135
47157
|
});
|
|
47136
|
-
__classPrivateFieldSet7(this, _PromptCachingBetaMessageStream_connectedPromise, new Promise((
|
|
47137
|
-
__classPrivateFieldSet7(this, _PromptCachingBetaMessageStream_resolveConnectedPromise,
|
|
47158
|
+
__classPrivateFieldSet7(this, _PromptCachingBetaMessageStream_connectedPromise, new Promise((resolve42, reject) => {
|
|
47159
|
+
__classPrivateFieldSet7(this, _PromptCachingBetaMessageStream_resolveConnectedPromise, resolve42, "f");
|
|
47138
47160
|
__classPrivateFieldSet7(this, _PromptCachingBetaMessageStream_rejectConnectedPromise, reject, "f");
|
|
47139
47161
|
}), "f");
|
|
47140
|
-
__classPrivateFieldSet7(this, _PromptCachingBetaMessageStream_endPromise, new Promise((
|
|
47141
|
-
__classPrivateFieldSet7(this, _PromptCachingBetaMessageStream_resolveEndPromise,
|
|
47162
|
+
__classPrivateFieldSet7(this, _PromptCachingBetaMessageStream_endPromise, new Promise((resolve42, reject) => {
|
|
47163
|
+
__classPrivateFieldSet7(this, _PromptCachingBetaMessageStream_resolveEndPromise, resolve42, "f");
|
|
47142
47164
|
__classPrivateFieldSet7(this, _PromptCachingBetaMessageStream_rejectEndPromise, reject, "f");
|
|
47143
47165
|
}), "f");
|
|
47144
47166
|
__classPrivateFieldGet8(this, _PromptCachingBetaMessageStream_connectedPromise, "f").catch(() => {
|
|
@@ -47267,11 +47289,11 @@ var PromptCachingBetaMessageStream = class _PromptCachingBetaMessageStream {
|
|
|
47267
47289
|
* const message = await stream.emitted('message') // rejects if the stream errors
|
|
47268
47290
|
*/
|
|
47269
47291
|
emitted(event) {
|
|
47270
|
-
return new Promise((
|
|
47292
|
+
return new Promise((resolve42, reject) => {
|
|
47271
47293
|
__classPrivateFieldSet7(this, _PromptCachingBetaMessageStream_catchingPromiseCreated, true, "f");
|
|
47272
47294
|
if (event !== "error")
|
|
47273
47295
|
this.once("error", reject);
|
|
47274
|
-
this.once(event,
|
|
47296
|
+
this.once(event, resolve42);
|
|
47275
47297
|
});
|
|
47276
47298
|
}
|
|
47277
47299
|
async done() {
|
|
@@ -47498,7 +47520,7 @@ var PromptCachingBetaMessageStream = class _PromptCachingBetaMessageStream {
|
|
|
47498
47520
|
if (done) {
|
|
47499
47521
|
return { value: void 0, done: true };
|
|
47500
47522
|
}
|
|
47501
|
-
return new Promise((
|
|
47523
|
+
return new Promise((resolve42, reject) => readQueue.push({ resolve: resolve42, reject })).then((chunk2) => chunk2 ? { value: chunk2, done: false } : { value: void 0, done: true });
|
|
47502
47524
|
}
|
|
47503
47525
|
const chunk = pushQueue.shift();
|
|
47504
47526
|
return { value: chunk, done: false };
|
|
@@ -47646,12 +47668,12 @@ var MessageStream = class _MessageStream {
|
|
|
47646
47668
|
}
|
|
47647
47669
|
return this._emit("error", new AnthropicError(String(error3)));
|
|
47648
47670
|
});
|
|
47649
|
-
__classPrivateFieldSet8(this, _MessageStream_connectedPromise, new Promise((
|
|
47650
|
-
__classPrivateFieldSet8(this, _MessageStream_resolveConnectedPromise,
|
|
47671
|
+
__classPrivateFieldSet8(this, _MessageStream_connectedPromise, new Promise((resolve42, reject) => {
|
|
47672
|
+
__classPrivateFieldSet8(this, _MessageStream_resolveConnectedPromise, resolve42, "f");
|
|
47651
47673
|
__classPrivateFieldSet8(this, _MessageStream_rejectConnectedPromise, reject, "f");
|
|
47652
47674
|
}), "f");
|
|
47653
|
-
__classPrivateFieldSet8(this, _MessageStream_endPromise, new Promise((
|
|
47654
|
-
__classPrivateFieldSet8(this, _MessageStream_resolveEndPromise,
|
|
47675
|
+
__classPrivateFieldSet8(this, _MessageStream_endPromise, new Promise((resolve42, reject) => {
|
|
47676
|
+
__classPrivateFieldSet8(this, _MessageStream_resolveEndPromise, resolve42, "f");
|
|
47655
47677
|
__classPrivateFieldSet8(this, _MessageStream_rejectEndPromise, reject, "f");
|
|
47656
47678
|
}), "f");
|
|
47657
47679
|
__classPrivateFieldGet9(this, _MessageStream_connectedPromise, "f").catch(() => {
|
|
@@ -47780,11 +47802,11 @@ var MessageStream = class _MessageStream {
|
|
|
47780
47802
|
* const message = await stream.emitted('message') // rejects if the stream errors
|
|
47781
47803
|
*/
|
|
47782
47804
|
emitted(event) {
|
|
47783
|
-
return new Promise((
|
|
47805
|
+
return new Promise((resolve42, reject) => {
|
|
47784
47806
|
__classPrivateFieldSet8(this, _MessageStream_catchingPromiseCreated, true, "f");
|
|
47785
47807
|
if (event !== "error")
|
|
47786
47808
|
this.once("error", reject);
|
|
47787
|
-
this.once(event,
|
|
47809
|
+
this.once(event, resolve42);
|
|
47788
47810
|
});
|
|
47789
47811
|
}
|
|
47790
47812
|
async done() {
|
|
@@ -48011,7 +48033,7 @@ var MessageStream = class _MessageStream {
|
|
|
48011
48033
|
if (done) {
|
|
48012
48034
|
return { value: void 0, done: true };
|
|
48013
48035
|
}
|
|
48014
|
-
return new Promise((
|
|
48036
|
+
return new Promise((resolve42, reject) => readQueue.push({ resolve: resolve42, reject })).then((chunk2) => chunk2 ? { value: chunk2, done: false } : { value: void 0, done: true });
|
|
48015
48037
|
}
|
|
48016
48038
|
const chunk = pushQueue.shift();
|
|
48017
48039
|
return { value: chunk, done: false };
|
|
@@ -48271,11 +48293,11 @@ async function promptApplyAgentMdProposal(repoPath) {
|
|
|
48271
48293
|
}
|
|
48272
48294
|
async function askYesNo2(question) {
|
|
48273
48295
|
const rl = readline2.createInterface({ input: process.stdin, output: process.stderr });
|
|
48274
|
-
return new Promise((
|
|
48296
|
+
return new Promise((resolve42) => {
|
|
48275
48297
|
process.stderr.write(`${question} `);
|
|
48276
48298
|
rl.once("line", (answer) => {
|
|
48277
48299
|
rl.close();
|
|
48278
|
-
|
|
48300
|
+
resolve42(/^y(es)?$/i.test(answer.trim()));
|
|
48279
48301
|
});
|
|
48280
48302
|
});
|
|
48281
48303
|
}
|
|
@@ -48505,7 +48527,7 @@ async function executeAuthoringToolCall(toolName, input, repoPath, harnessDir, c
|
|
|
48505
48527
|
}
|
|
48506
48528
|
async function askUser(question, options) {
|
|
48507
48529
|
const rl = readline3.createInterface({ input: process.stdin, output: process.stderr });
|
|
48508
|
-
return new Promise((
|
|
48530
|
+
return new Promise((resolve42) => {
|
|
48509
48531
|
process.stderr.write("\n");
|
|
48510
48532
|
process.stderr.write(`\u2753 ${question}
|
|
48511
48533
|
`);
|
|
@@ -48516,7 +48538,7 @@ async function askUser(question, options) {
|
|
|
48516
48538
|
process.stderr.write("> ");
|
|
48517
48539
|
rl.once("line", (answer) => {
|
|
48518
48540
|
rl.close();
|
|
48519
|
-
|
|
48541
|
+
resolve42(answer.trim());
|
|
48520
48542
|
});
|
|
48521
48543
|
});
|
|
48522
48544
|
}
|
|
@@ -48660,7 +48682,7 @@ function runScript(scriptPath, args = [], options = {}) {
|
|
|
48660
48682
|
function runScriptCapture(scriptPath, args = [], options = {}) {
|
|
48661
48683
|
const stream = options.stream ?? false;
|
|
48662
48684
|
const { stream: _stream, ...spawnOptions } = options;
|
|
48663
|
-
return new Promise((
|
|
48685
|
+
return new Promise((resolve42) => {
|
|
48664
48686
|
const proc = (0, import_child_process.spawn)("bash", [scriptPath, ...args], {
|
|
48665
48687
|
...spawnOptions,
|
|
48666
48688
|
stdio: ["inherit", "pipe", "pipe"]
|
|
@@ -48675,13 +48697,13 @@ function runScriptCapture(scriptPath, args = [], options = {}) {
|
|
|
48675
48697
|
stderr += d2;
|
|
48676
48698
|
if (stream) process.stderr.write(d2);
|
|
48677
48699
|
});
|
|
48678
|
-
proc.on("close", (code) =>
|
|
48700
|
+
proc.on("close", (code) => resolve42({ stdout, stderr, code: code ?? 0 }));
|
|
48679
48701
|
});
|
|
48680
48702
|
}
|
|
48681
48703
|
function runShellCommand(command2, options = {}) {
|
|
48682
48704
|
const stream = options.stream ?? false;
|
|
48683
48705
|
const { stream: _stream, ...spawnOptions } = options;
|
|
48684
|
-
return new Promise((
|
|
48706
|
+
return new Promise((resolve42) => {
|
|
48685
48707
|
const proc = (0, import_child_process.spawn)("bash", ["-lc", command2], {
|
|
48686
48708
|
...spawnOptions,
|
|
48687
48709
|
stdio: ["inherit", "pipe", "pipe"]
|
|
@@ -48696,7 +48718,7 @@ function runShellCommand(command2, options = {}) {
|
|
|
48696
48718
|
stderr += d2;
|
|
48697
48719
|
if (stream) process.stderr.write(d2);
|
|
48698
48720
|
});
|
|
48699
|
-
proc.on("close", (code) =>
|
|
48721
|
+
proc.on("close", (code) => resolve42({ stdout, stderr, code: code ?? 0 }));
|
|
48700
48722
|
});
|
|
48701
48723
|
}
|
|
48702
48724
|
|
|
@@ -49877,12 +49899,12 @@ function printAdaptationPrompt(content) {
|
|
|
49877
49899
|
}
|
|
49878
49900
|
function askYesNo3(question) {
|
|
49879
49901
|
const rl = readline4.createInterface({ input: process.stdin, output: process.stderr });
|
|
49880
|
-
return new Promise((
|
|
49902
|
+
return new Promise((resolve42) => {
|
|
49881
49903
|
process.stderr.write(`${question} `);
|
|
49882
49904
|
rl.once("line", (answer) => {
|
|
49883
49905
|
rl.close();
|
|
49884
49906
|
const trimmed = answer.trim();
|
|
49885
|
-
|
|
49907
|
+
resolve42(trimmed === "" || /^y(es)?$/i.test(trimmed));
|
|
49886
49908
|
});
|
|
49887
49909
|
});
|
|
49888
49910
|
}
|
|
@@ -49969,16 +49991,16 @@ async function promptScaffoldCursorRule(exists) {
|
|
|
49969
49991
|
}
|
|
49970
49992
|
async function askYesNo4(question) {
|
|
49971
49993
|
const rl = readline5.createInterface({ input: process.stdin, output: process.stderr });
|
|
49972
|
-
return new Promise((
|
|
49994
|
+
return new Promise((resolve42) => {
|
|
49973
49995
|
process.stderr.write(`${question} `);
|
|
49974
49996
|
rl.once("line", (answer) => {
|
|
49975
49997
|
rl.close();
|
|
49976
49998
|
const trimmed = answer.trim();
|
|
49977
49999
|
if (trimmed === "") {
|
|
49978
|
-
|
|
50000
|
+
resolve42(true);
|
|
49979
50001
|
return;
|
|
49980
50002
|
}
|
|
49981
|
-
|
|
50003
|
+
resolve42(/^y(es)?$/i.test(trimmed));
|
|
49982
50004
|
});
|
|
49983
50005
|
});
|
|
49984
50006
|
}
|
|
@@ -50405,6 +50427,13 @@ function listRegisteredRepos() {
|
|
|
50405
50427
|
}
|
|
50406
50428
|
return kept;
|
|
50407
50429
|
}
|
|
50430
|
+
function clearRegisteredRepos() {
|
|
50431
|
+
const registry2 = readRegistry();
|
|
50432
|
+
const count = registry2.repos.length;
|
|
50433
|
+
if (count === 0) return 0;
|
|
50434
|
+
writeRegistry({ repos: [] });
|
|
50435
|
+
return count;
|
|
50436
|
+
}
|
|
50408
50437
|
|
|
50409
50438
|
// src/core/control-sync.ts
|
|
50410
50439
|
init_portal_credentials();
|
|
@@ -52521,7 +52550,7 @@ async function waitForControlApi(apiUrl = getControlApiUrl(), timeoutMs = 6e4, i
|
|
|
52521
52550
|
const deadline = Date.now() + timeoutMs;
|
|
52522
52551
|
while (Date.now() < deadline) {
|
|
52523
52552
|
if (await isControlApiReachable(apiUrl)) return true;
|
|
52524
|
-
await new Promise((
|
|
52553
|
+
await new Promise((resolve42) => setTimeout(resolve42, intervalMs));
|
|
52525
52554
|
}
|
|
52526
52555
|
return false;
|
|
52527
52556
|
}
|
|
@@ -53756,12 +53785,12 @@ async function recordCommitAssociation(cwd) {
|
|
|
53756
53785
|
// src/core/commit-gate-onboarding.ts
|
|
53757
53786
|
function askYesNo5(question) {
|
|
53758
53787
|
const rl = readline6.createInterface({ input: process.stdin, output: process.stderr });
|
|
53759
|
-
return new Promise((
|
|
53788
|
+
return new Promise((resolve42) => {
|
|
53760
53789
|
process.stderr.write(`${question} `);
|
|
53761
53790
|
rl.once("line", (answer) => {
|
|
53762
53791
|
rl.close();
|
|
53763
53792
|
const trimmed = answer.trim();
|
|
53764
|
-
|
|
53793
|
+
resolve42(trimmed === "" || /^y(es)?$/i.test(trimmed));
|
|
53765
53794
|
});
|
|
53766
53795
|
});
|
|
53767
53796
|
}
|
|
@@ -54471,8 +54500,8 @@ async function handleLaunch(argv) {
|
|
|
54471
54500
|
console.error(guard.reason ?? "");
|
|
54472
54501
|
const readline10 = await import("readline");
|
|
54473
54502
|
const rl = readline10.createInterface({ input: process.stdin, output: process.stderr });
|
|
54474
|
-
const answer = await new Promise((
|
|
54475
|
-
rl.question("Replace this slot? [y/N] ",
|
|
54503
|
+
const answer = await new Promise((resolve42) => {
|
|
54504
|
+
rl.question("Replace this slot? [y/N] ", resolve42);
|
|
54476
54505
|
});
|
|
54477
54506
|
rl.close();
|
|
54478
54507
|
if (!/^[Yy]$/.test(answer.trim())) {
|
|
@@ -54488,8 +54517,8 @@ async function handleLaunch(argv) {
|
|
|
54488
54517
|
warn("Worktree has uncommitted changes.");
|
|
54489
54518
|
const readline10 = await import("readline");
|
|
54490
54519
|
const rl = readline10.createInterface({ input: process.stdin, output: process.stderr });
|
|
54491
|
-
const answer = await new Promise((
|
|
54492
|
-
rl.question("Discard uncommitted changes? [y/N] ",
|
|
54520
|
+
const answer = await new Promise((resolve42) => {
|
|
54521
|
+
rl.question("Discard uncommitted changes? [y/N] ", resolve42);
|
|
54493
54522
|
});
|
|
54494
54523
|
rl.close();
|
|
54495
54524
|
if (!/^[Yy]$/.test(answer.trim())) {
|
|
@@ -54706,7 +54735,7 @@ function printNextSteps(auto2) {
|
|
|
54706
54735
|
}
|
|
54707
54736
|
|
|
54708
54737
|
// src/cli/commands/control.ts
|
|
54709
|
-
var
|
|
54738
|
+
var path53 = __toESM(require("path"));
|
|
54710
54739
|
|
|
54711
54740
|
// node_modules/@inquirer/core/dist/esm/lib/key.mjs
|
|
54712
54741
|
var isUpKey = (key) => (
|
|
@@ -55726,13 +55755,13 @@ var PromisePolyfill = class extends Promise {
|
|
|
55726
55755
|
// Available starting from Node 22
|
|
55727
55756
|
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/withResolvers
|
|
55728
55757
|
static withResolver() {
|
|
55729
|
-
let
|
|
55758
|
+
let resolve42;
|
|
55730
55759
|
let reject;
|
|
55731
55760
|
const promise = new Promise((res, rej) => {
|
|
55732
|
-
|
|
55761
|
+
resolve42 = res;
|
|
55733
55762
|
reject = rej;
|
|
55734
55763
|
});
|
|
55735
|
-
return { promise, resolve:
|
|
55764
|
+
return { promise, resolve: resolve42, reject };
|
|
55736
55765
|
}
|
|
55737
55766
|
};
|
|
55738
55767
|
|
|
@@ -55749,7 +55778,7 @@ function createPrompt(view) {
|
|
|
55749
55778
|
output
|
|
55750
55779
|
});
|
|
55751
55780
|
const screen = new ScreenManager(rl);
|
|
55752
|
-
const { promise, resolve:
|
|
55781
|
+
const { promise, resolve: resolve42, reject } = PromisePolyfill.withResolver();
|
|
55753
55782
|
const cancel = () => reject(new CancelPromptError());
|
|
55754
55783
|
if (signal) {
|
|
55755
55784
|
const abort = () => reject(new AbortPromptError({ cause: signal.reason }));
|
|
@@ -55773,7 +55802,7 @@ function createPrompt(view) {
|
|
|
55773
55802
|
cycle(() => {
|
|
55774
55803
|
try {
|
|
55775
55804
|
const nextView = view(config2, (value) => {
|
|
55776
|
-
setImmediate(() =>
|
|
55805
|
+
setImmediate(() => resolve42(value));
|
|
55777
55806
|
});
|
|
55778
55807
|
const [content, bottomContent] = typeof nextView === "string" ? [nextView] : nextView;
|
|
55779
55808
|
screen.render(content, bottomContent);
|
|
@@ -56760,9 +56789,9 @@ var import_run_async = __toESM(require_run_async(), 1);
|
|
|
56760
56789
|
var import_mute_stream2 = __toESM(require_lib3(), 1);
|
|
56761
56790
|
var import_ansi_escapes5 = __toESM(require_ansi_escapes(), 1);
|
|
56762
56791
|
var _2 = {
|
|
56763
|
-
set: (obj,
|
|
56792
|
+
set: (obj, path58 = "", value) => {
|
|
56764
56793
|
let pointer = obj;
|
|
56765
|
-
|
|
56794
|
+
path58.split(".").forEach((key, index, arr) => {
|
|
56766
56795
|
if (key === "__proto__" || key === "constructor")
|
|
56767
56796
|
return;
|
|
56768
56797
|
if (index === arr.length - 1) {
|
|
@@ -56773,8 +56802,8 @@ var _2 = {
|
|
|
56773
56802
|
pointer = pointer[key];
|
|
56774
56803
|
});
|
|
56775
56804
|
},
|
|
56776
|
-
get: (obj,
|
|
56777
|
-
const travel = (regexp) => String.prototype.split.call(
|
|
56805
|
+
get: (obj, path58 = "", defaultValue) => {
|
|
56806
|
+
const travel = (regexp) => String.prototype.split.call(path58, regexp).filter(Boolean).reduce(
|
|
56778
56807
|
// @ts-expect-error implicit any on res[key]
|
|
56779
56808
|
(res, key) => res !== null && res !== void 0 ? res[key] : res,
|
|
56780
56809
|
obj
|
|
@@ -56888,7 +56917,7 @@ var PromptsRunner = class {
|
|
|
56888
56917
|
throw new Error(`Prompt for type ${question.type} not found`);
|
|
56889
56918
|
}
|
|
56890
56919
|
let cleanupSignal;
|
|
56891
|
-
const promptFn = isPromptConstructor(prompt2) ? (q2, { signal: signal2 } = {}) => new Promise((
|
|
56920
|
+
const promptFn = isPromptConstructor(prompt2) ? (q2, { signal: signal2 } = {}) => new Promise((resolve42, reject) => {
|
|
56892
56921
|
const rl = import_node_readline.default.createInterface(setupReadlineOptions(this.opt));
|
|
56893
56922
|
rl.resume();
|
|
56894
56923
|
const onClose = () => {
|
|
@@ -56924,7 +56953,7 @@ var PromptsRunner = class {
|
|
|
56924
56953
|
cleanupSignal = void 0;
|
|
56925
56954
|
};
|
|
56926
56955
|
}
|
|
56927
|
-
activePrompt.run().then(
|
|
56956
|
+
activePrompt.run().then(resolve42, reject).finally(cleanup);
|
|
56928
56957
|
}) : prompt2;
|
|
56929
56958
|
const { signal: moduleSignal } = this.opt;
|
|
56930
56959
|
if (moduleSignal?.aborted) {
|
|
@@ -57097,7 +57126,7 @@ function openBrowser(url) {
|
|
|
57097
57126
|
}
|
|
57098
57127
|
async function loginViaBrowser(portalUrl, openUrl = openBrowser) {
|
|
57099
57128
|
const state = (0, import_crypto.randomUUID)();
|
|
57100
|
-
return new Promise((
|
|
57129
|
+
return new Promise((resolve42, reject) => {
|
|
57101
57130
|
let timer;
|
|
57102
57131
|
const server = http.createServer((req, res) => {
|
|
57103
57132
|
const requestUrl = new URL(req.url ?? "", "http://127.0.0.1");
|
|
@@ -57120,7 +57149,7 @@ async function loginViaBrowser(portalUrl, openUrl = openBrowser) {
|
|
|
57120
57149
|
res.writeHead(200, { "Content-Type": "text/html" });
|
|
57121
57150
|
res.end("<h1>Logged in</h1><p>You can close this tab and return to the terminal.</p>");
|
|
57122
57151
|
cleanup();
|
|
57123
|
-
|
|
57152
|
+
resolve42({ portalUrl, token, workspace, email: email2, createdAt: (/* @__PURE__ */ new Date()).toISOString() });
|
|
57124
57153
|
});
|
|
57125
57154
|
const cleanup = () => {
|
|
57126
57155
|
clearTimeout(timer);
|
|
@@ -57207,8 +57236,8 @@ async function askYesNo6(question) {
|
|
|
57207
57236
|
if (!process.stdin.isTTY || !process.stdout.isTTY) return false;
|
|
57208
57237
|
const readline10 = await import("readline");
|
|
57209
57238
|
const rl = readline10.createInterface({ input: process.stdin, output: process.stderr });
|
|
57210
|
-
const answer = await new Promise((
|
|
57211
|
-
rl.question(question,
|
|
57239
|
+
const answer = await new Promise((resolve42) => {
|
|
57240
|
+
rl.question(question, resolve42);
|
|
57212
57241
|
});
|
|
57213
57242
|
rl.close();
|
|
57214
57243
|
return /^[Yy]$/.test(answer.trim());
|
|
@@ -57349,6 +57378,162 @@ async function unregisterRepoWithControl(options) {
|
|
|
57349
57378
|
};
|
|
57350
57379
|
}
|
|
57351
57380
|
|
|
57381
|
+
// src/core/control-reset.ts
|
|
57382
|
+
init_control_config();
|
|
57383
|
+
|
|
57384
|
+
// src/core/harness-scrub.ts
|
|
57385
|
+
var fs47 = __toESM(require("fs"));
|
|
57386
|
+
var path52 = __toESM(require("path"));
|
|
57387
|
+
var HARNESS_SCRUB_DIRS = ["runs", "validations", "state", "slots"];
|
|
57388
|
+
function scrubLocalHarnessDirs(repoPath) {
|
|
57389
|
+
const results = [];
|
|
57390
|
+
const resolved = path52.resolve(repoPath);
|
|
57391
|
+
if (!fs47.existsSync(resolved)) {
|
|
57392
|
+
for (const directory of HARNESS_SCRUB_DIRS) {
|
|
57393
|
+
results.push({
|
|
57394
|
+
path: path52.join(resolved, ".har", directory),
|
|
57395
|
+
directory,
|
|
57396
|
+
deleted: false,
|
|
57397
|
+
error: "repository path does not exist"
|
|
57398
|
+
});
|
|
57399
|
+
}
|
|
57400
|
+
return results;
|
|
57401
|
+
}
|
|
57402
|
+
for (const directory of HARNESS_SCRUB_DIRS) {
|
|
57403
|
+
const target = path52.join(resolved, ".har", directory);
|
|
57404
|
+
if (!fs47.existsSync(target)) {
|
|
57405
|
+
results.push({ path: target, directory, deleted: true });
|
|
57406
|
+
continue;
|
|
57407
|
+
}
|
|
57408
|
+
try {
|
|
57409
|
+
fs47.rmSync(target, { recursive: true, force: true });
|
|
57410
|
+
results.push({
|
|
57411
|
+
path: target,
|
|
57412
|
+
directory,
|
|
57413
|
+
deleted: !fs47.existsSync(target),
|
|
57414
|
+
error: fs47.existsSync(target) ? "failed to remove directory" : void 0
|
|
57415
|
+
});
|
|
57416
|
+
} catch (err) {
|
|
57417
|
+
results.push({
|
|
57418
|
+
path: target,
|
|
57419
|
+
directory,
|
|
57420
|
+
deleted: !fs47.existsSync(target),
|
|
57421
|
+
error: err instanceof Error ? err.message : String(err)
|
|
57422
|
+
});
|
|
57423
|
+
}
|
|
57424
|
+
}
|
|
57425
|
+
return results;
|
|
57426
|
+
}
|
|
57427
|
+
function scrubLocalHarnessForRepos(repoPaths) {
|
|
57428
|
+
const results = [];
|
|
57429
|
+
const seen = /* @__PURE__ */ new Set();
|
|
57430
|
+
for (const repoPath of repoPaths) {
|
|
57431
|
+
const key = path52.resolve(repoPath);
|
|
57432
|
+
if (seen.has(key)) continue;
|
|
57433
|
+
seen.add(key);
|
|
57434
|
+
results.push(...scrubLocalHarnessDirs(key));
|
|
57435
|
+
}
|
|
57436
|
+
return results;
|
|
57437
|
+
}
|
|
57438
|
+
|
|
57439
|
+
// src/core/control-reset.ts
|
|
57440
|
+
async function askYesNo7(question) {
|
|
57441
|
+
if (!process.stdin.isTTY || !process.stdout.isTTY) return false;
|
|
57442
|
+
const readline10 = await import("readline");
|
|
57443
|
+
const rl = readline10.createInterface({ input: process.stdin, output: process.stderr });
|
|
57444
|
+
const answer = await new Promise((resolve42) => {
|
|
57445
|
+
rl.question(question, resolve42);
|
|
57446
|
+
});
|
|
57447
|
+
rl.close();
|
|
57448
|
+
return /^[Yy]$/.test(answer.trim());
|
|
57449
|
+
}
|
|
57450
|
+
async function confirmControlReset(options) {
|
|
57451
|
+
if (options.yes) return true;
|
|
57452
|
+
if (!process.stdin.isTTY || !process.stdout.isTTY) {
|
|
57453
|
+
throw new Error("Non-interactive terminal \u2014 pass --yes");
|
|
57454
|
+
}
|
|
57455
|
+
return askYesNo7(
|
|
57456
|
+
`Clear Mission Control data for ${options.repoCount} registered repositor${options.repoCount === 1 ? "y" : "ies"} (and scrub local .har history)? [y/N] `
|
|
57457
|
+
);
|
|
57458
|
+
}
|
|
57459
|
+
async function resetMissionControlFromCli(options = {}) {
|
|
57460
|
+
const apiUrl = options.apiUrl ?? getControlApiUrl();
|
|
57461
|
+
const scrubLocalHarness = options.scrubLocalHarness !== false;
|
|
57462
|
+
const clearRegistry = options.clearRegistry !== false;
|
|
57463
|
+
const registryPaths = listRegisteredRepos();
|
|
57464
|
+
let apiRepoPaths = [];
|
|
57465
|
+
let apiUnreachable = false;
|
|
57466
|
+
let repositoriesDeleted = 0;
|
|
57467
|
+
let unregisteredCleared = 0;
|
|
57468
|
+
let apiScrubbed = [];
|
|
57469
|
+
if (!options.dryRun) {
|
|
57470
|
+
try {
|
|
57471
|
+
const listResponse = await fetch(`${apiUrl}/api/repos`, {
|
|
57472
|
+
signal: AbortSignal.timeout(5e3)
|
|
57473
|
+
});
|
|
57474
|
+
if (listResponse.ok) {
|
|
57475
|
+
const repos = await listResponse.json();
|
|
57476
|
+
apiRepoPaths = repos.map((repo) => repo.path);
|
|
57477
|
+
} else {
|
|
57478
|
+
apiUnreachable = true;
|
|
57479
|
+
}
|
|
57480
|
+
} catch {
|
|
57481
|
+
apiUnreachable = true;
|
|
57482
|
+
}
|
|
57483
|
+
}
|
|
57484
|
+
const repoPaths = [.../* @__PURE__ */ new Set([...registryPaths, ...apiRepoPaths])].sort();
|
|
57485
|
+
let scrubbed = [];
|
|
57486
|
+
if (scrubLocalHarness) {
|
|
57487
|
+
scrubbed = options.dryRun ? repoPaths.flatMap(
|
|
57488
|
+
(repoPath) => ["runs", "validations", "state", "slots"].map((directory) => ({
|
|
57489
|
+
path: `${repoPath}/.har/${directory}`,
|
|
57490
|
+
directory,
|
|
57491
|
+
deleted: false
|
|
57492
|
+
}))
|
|
57493
|
+
) : scrubLocalHarnessForRepos(repoPaths);
|
|
57494
|
+
}
|
|
57495
|
+
if (!options.dryRun && !apiUnreachable) {
|
|
57496
|
+
const response = await fetch(`${apiUrl}/api/reset`, {
|
|
57497
|
+
method: "POST",
|
|
57498
|
+
headers: { "Content-Type": "application/json" },
|
|
57499
|
+
body: JSON.stringify({
|
|
57500
|
+
confirm: "RESET",
|
|
57501
|
+
// Host scrub already ran; skip duplicate best-effort inside Docker/API.
|
|
57502
|
+
scrubLocalHarness: false
|
|
57503
|
+
})
|
|
57504
|
+
});
|
|
57505
|
+
if (!response.ok) {
|
|
57506
|
+
const text = await response.text().catch(() => "");
|
|
57507
|
+
throw new Error(`Control API ${response.status}: ${text || response.statusText}`);
|
|
57508
|
+
}
|
|
57509
|
+
const payload = await response.json();
|
|
57510
|
+
repositoriesDeleted = payload.repositoriesDeleted;
|
|
57511
|
+
unregisteredCleared = payload.unregisteredCleared;
|
|
57512
|
+
apiScrubbed = payload.scrubbed ?? [];
|
|
57513
|
+
} else if (!options.dryRun && apiUnreachable) {
|
|
57514
|
+
}
|
|
57515
|
+
let registryCleared = false;
|
|
57516
|
+
if (clearRegistry) {
|
|
57517
|
+
if (options.dryRun) {
|
|
57518
|
+
registryCleared = registryPaths.length > 0;
|
|
57519
|
+
} else {
|
|
57520
|
+
registryCleared = clearRegisteredRepos() > 0;
|
|
57521
|
+
}
|
|
57522
|
+
}
|
|
57523
|
+
return {
|
|
57524
|
+
ok: true,
|
|
57525
|
+
dryRun: options.dryRun === true,
|
|
57526
|
+
repositoriesDeleted: options.dryRun ? repoPaths.length : repositoriesDeleted,
|
|
57527
|
+
unregisteredCleared,
|
|
57528
|
+
scrubLocalHarness,
|
|
57529
|
+
clearRegistry,
|
|
57530
|
+
registryCleared,
|
|
57531
|
+
repoPaths,
|
|
57532
|
+
scrubbed: scrubbed.length > 0 ? scrubbed : apiScrubbed,
|
|
57533
|
+
apiUnreachable: apiUnreachable || void 0
|
|
57534
|
+
};
|
|
57535
|
+
}
|
|
57536
|
+
|
|
57352
57537
|
// src/cli/commands/control.ts
|
|
57353
57538
|
var controlCommand = {
|
|
57354
57539
|
command: "control <subcommand>",
|
|
@@ -57421,9 +57606,27 @@ var controlCommand = {
|
|
|
57421
57606
|
describe: "Store this ingest token directly instead of browser login"
|
|
57422
57607
|
}),
|
|
57423
57608
|
handleLogin
|
|
57609
|
+
).command(
|
|
57610
|
+
"reset",
|
|
57611
|
+
"Clear all Mission Control data and optionally scrub local .har history",
|
|
57612
|
+
(y2) => y2.option("api-url", { type: "string", describe: "Control API URL" }).option("yes", {
|
|
57613
|
+
alias: "y",
|
|
57614
|
+
type: "boolean",
|
|
57615
|
+
default: false,
|
|
57616
|
+
describe: "Skip confirmation prompt"
|
|
57617
|
+
}).option("no-scrub-local", {
|
|
57618
|
+
type: "boolean",
|
|
57619
|
+
default: false,
|
|
57620
|
+
describe: "Keep local .har/{runs,validations,state,slots} directories"
|
|
57621
|
+
}).option("keep-registry", {
|
|
57622
|
+
type: "boolean",
|
|
57623
|
+
default: false,
|
|
57624
|
+
describe: "Keep ~/.har/repos.json entries (default clears them)"
|
|
57625
|
+
}).option("dry-run", { type: "boolean", default: false }).option("json", { type: "boolean", default: false }),
|
|
57626
|
+
handleReset
|
|
57424
57627
|
).demandCommand(
|
|
57425
57628
|
1,
|
|
57426
|
-
"Please specify a subcommand: up, down, register, unregister, sync, watch, login"
|
|
57629
|
+
"Please specify a subcommand: up, down, register, unregister, sync, watch, login, reset"
|
|
57427
57630
|
),
|
|
57428
57631
|
handler: () => {
|
|
57429
57632
|
}
|
|
@@ -57484,7 +57687,7 @@ async function handleDown() {
|
|
|
57484
57687
|
process.exit(code);
|
|
57485
57688
|
}
|
|
57486
57689
|
async function handleRegister(argv) {
|
|
57487
|
-
const repoPath =
|
|
57690
|
+
const repoPath = path53.resolve(argv.repo);
|
|
57488
57691
|
header("har control register");
|
|
57489
57692
|
info(`Repository: ${repoPath}`);
|
|
57490
57693
|
try {
|
|
@@ -57507,8 +57710,76 @@ async function handleRegister(argv) {
|
|
|
57507
57710
|
process.exit(1);
|
|
57508
57711
|
}
|
|
57509
57712
|
}
|
|
57713
|
+
async function handleReset(argv) {
|
|
57714
|
+
try {
|
|
57715
|
+
const repoCount = listRegisteredRepos().length;
|
|
57716
|
+
if (!argv.yes && !argv.dryRun) {
|
|
57717
|
+
const proceed = await confirmControlReset({ yes: false, repoCount });
|
|
57718
|
+
if (!proceed) {
|
|
57719
|
+
error("Aborted \u2014 Mission Control left unchanged.");
|
|
57720
|
+
process.exit(2);
|
|
57721
|
+
}
|
|
57722
|
+
}
|
|
57723
|
+
const result = await resetMissionControlFromCli({
|
|
57724
|
+
apiUrl: argv.apiUrl,
|
|
57725
|
+
dryRun: argv.dryRun,
|
|
57726
|
+
scrubLocalHarness: !argv.noScrubLocal,
|
|
57727
|
+
clearRegistry: !argv.keepRegistry
|
|
57728
|
+
});
|
|
57729
|
+
if (argv.json) {
|
|
57730
|
+
process.stdout.write(JSON.stringify(result, null, 2) + "\n");
|
|
57731
|
+
return;
|
|
57732
|
+
}
|
|
57733
|
+
header("har control reset");
|
|
57734
|
+
if (argv.dryRun) {
|
|
57735
|
+
info(
|
|
57736
|
+
`Dry run \u2014 would clear Mission Control for ${result.repoPaths.length} repositor${result.repoPaths.length === 1 ? "y" : "ies"}`
|
|
57737
|
+
);
|
|
57738
|
+
if (result.scrubLocalHarness) {
|
|
57739
|
+
info(`Would scrub ${result.scrubbed.length} local .har director${result.scrubbed.length === 1 ? "y" : "ies"}`);
|
|
57740
|
+
}
|
|
57741
|
+
if (result.clearRegistry) {
|
|
57742
|
+
info("Would clear local sync registry (~/.har/repos.json)");
|
|
57743
|
+
}
|
|
57744
|
+
return;
|
|
57745
|
+
}
|
|
57746
|
+
if (result.apiUnreachable) {
|
|
57747
|
+
warn("Mission Control API unreachable \u2014 dashboard DB not cleared");
|
|
57748
|
+
} else {
|
|
57749
|
+
success(
|
|
57750
|
+
`Cleared ${result.repositoriesDeleted} repositor${result.repositoriesDeleted === 1 ? "y" : "ies"} from Mission Control`
|
|
57751
|
+
);
|
|
57752
|
+
if (result.unregisteredCleared > 0) {
|
|
57753
|
+
success(`Cleared ${result.unregisteredCleared} unregister blocklist entr${result.unregisteredCleared === 1 ? "y" : "ies"}`);
|
|
57754
|
+
}
|
|
57755
|
+
}
|
|
57756
|
+
if (result.scrubLocalHarness) {
|
|
57757
|
+
const deleted = result.scrubbed.filter((row) => row.deleted).length;
|
|
57758
|
+
const failed = result.scrubbed.filter((row) => !row.deleted && row.error);
|
|
57759
|
+
success(`Scrubbed ${deleted} local .har director${deleted === 1 ? "y" : "ies"}`);
|
|
57760
|
+
for (const failure of failed) {
|
|
57761
|
+
warn(`Failed to delete ${failure.path}: ${failure.error}`);
|
|
57762
|
+
}
|
|
57763
|
+
}
|
|
57764
|
+
if (result.registryCleared) {
|
|
57765
|
+
success("Cleared local sync registry (~/.har/repos.json)");
|
|
57766
|
+
} else if (result.clearRegistry) {
|
|
57767
|
+
info("Local sync registry was already empty");
|
|
57768
|
+
}
|
|
57769
|
+
info("Re-register with: har control register --repo <path>");
|
|
57770
|
+
} catch (err) {
|
|
57771
|
+
if (argv.json) {
|
|
57772
|
+
process.stdout.write(
|
|
57773
|
+
JSON.stringify({ ok: false, error: err.message }, null, 2) + "\n"
|
|
57774
|
+
);
|
|
57775
|
+
process.exit(1);
|
|
57776
|
+
}
|
|
57777
|
+
error(err.message);
|
|
57778
|
+
process.exit(1);
|
|
57779
|
+
}
|
|
57780
|
+
}
|
|
57510
57781
|
async function handleUnregister(argv) {
|
|
57511
|
-
const repoPath =
|
|
57782
|
+
const repoPath = path53.resolve(argv.repo);
|
|
57512
57783
|
const worktrees = listUnregisterWorktreeCandidates(repoPath);
|
|
57513
57784
|
try {
|
|
57514
57785
|
let deleteWorktrees = argv.deleteWorktrees;
|
|
@@ -57669,7 +57940,7 @@ async function handleWatch(argv) {
|
|
|
57669
57940
|
};
|
|
57670
57941
|
const tick = async () => {
|
|
57671
57942
|
if (argv.repo) {
|
|
57672
|
-
await syncOne(
|
|
57943
|
+
await syncOne(path53.resolve(argv.repo));
|
|
57673
57944
|
return;
|
|
57674
57945
|
}
|
|
57675
57946
|
try {
|
|
@@ -57719,11 +57990,11 @@ async function handleLogin(argv) {
|
|
|
57719
57990
|
}
|
|
57720
57991
|
|
|
57721
57992
|
// src/cli/commands/hooks.ts
|
|
57722
|
-
var
|
|
57993
|
+
var path55 = __toESM(require("path"));
|
|
57723
57994
|
|
|
57724
57995
|
// src/core/claude-hooks.ts
|
|
57725
|
-
var
|
|
57726
|
-
var
|
|
57996
|
+
var fs48 = __toESM(require("fs"));
|
|
57997
|
+
var path54 = __toESM(require("path"));
|
|
57727
57998
|
var CLAUDE_GUARD_RELATIVE_PATH = ".har/hooks/claude-worktree-guard.sh";
|
|
57728
57999
|
var CLAUDE_SETTINGS_RELATIVE_PATH = ".claude/settings.json";
|
|
57729
58000
|
var GUARD_MATCHER = "Edit|Write|MultiEdit|NotebookEdit";
|
|
@@ -57734,8 +58005,8 @@ function isHarGuardEntry(entry) {
|
|
|
57734
58005
|
);
|
|
57735
58006
|
}
|
|
57736
58007
|
function readSettings(settingsPath) {
|
|
57737
|
-
if (!
|
|
57738
|
-
const raw =
|
|
58008
|
+
if (!fs48.existsSync(settingsPath)) return {};
|
|
58009
|
+
const raw = fs48.readFileSync(settingsPath, "utf8").trim();
|
|
57739
58010
|
if (raw === "") return {};
|
|
57740
58011
|
const parsed = JSON.parse(raw);
|
|
57741
58012
|
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
@@ -57744,19 +58015,19 @@ function readSettings(settingsPath) {
|
|
|
57744
58015
|
return parsed;
|
|
57745
58016
|
}
|
|
57746
58017
|
function writeSettings(settingsPath, settings) {
|
|
57747
|
-
|
|
57748
|
-
|
|
58018
|
+
fs48.mkdirSync(path54.dirname(settingsPath), { recursive: true });
|
|
58019
|
+
fs48.writeFileSync(settingsPath, JSON.stringify(settings, null, 2) + "\n");
|
|
57749
58020
|
}
|
|
57750
58021
|
function installClaudeGuard(repoPath) {
|
|
57751
58022
|
const templatePath = resolveTemplateFile("claude-worktree-guard.sh.template");
|
|
57752
58023
|
if (!templatePath) {
|
|
57753
58024
|
throw new Error("Guard template not found (claude-worktree-guard.sh.template). Run npm run build.");
|
|
57754
58025
|
}
|
|
57755
|
-
const guardScript =
|
|
57756
|
-
|
|
57757
|
-
|
|
57758
|
-
|
|
57759
|
-
const settingsPath =
|
|
58026
|
+
const guardScript = path54.join(repoPath, CLAUDE_GUARD_RELATIVE_PATH);
|
|
58027
|
+
fs48.mkdirSync(path54.dirname(guardScript), { recursive: true });
|
|
58028
|
+
fs48.copyFileSync(templatePath, guardScript);
|
|
58029
|
+
fs48.chmodSync(guardScript, 493);
|
|
58030
|
+
const settingsPath = path54.join(repoPath, CLAUDE_SETTINGS_RELATIVE_PATH);
|
|
57760
58031
|
const settings = readSettings(settingsPath);
|
|
57761
58032
|
const hooks = settings.hooks ?? {};
|
|
57762
58033
|
const preToolUse = (hooks.PreToolUse ?? []).filter((entry) => !isHarGuardEntry(entry));
|
|
@@ -57770,15 +58041,15 @@ function installClaudeGuard(repoPath) {
|
|
|
57770
58041
|
}
|
|
57771
58042
|
function uninstallClaudeGuard(repoPath) {
|
|
57772
58043
|
let removed = false;
|
|
57773
|
-
const guardScript =
|
|
57774
|
-
if (
|
|
57775
|
-
|
|
58044
|
+
const guardScript = path54.join(repoPath, CLAUDE_GUARD_RELATIVE_PATH);
|
|
58045
|
+
if (fs48.existsSync(guardScript)) {
|
|
58046
|
+
fs48.rmSync(guardScript);
|
|
57776
58047
|
removed = true;
|
|
57777
|
-
const parent =
|
|
57778
|
-
if (
|
|
58048
|
+
const parent = path54.dirname(guardScript);
|
|
58049
|
+
if (fs48.existsSync(parent) && fs48.readdirSync(parent).length === 0) fs48.rmdirSync(parent);
|
|
57779
58050
|
}
|
|
57780
|
-
const settingsPath =
|
|
57781
|
-
if (
|
|
58051
|
+
const settingsPath = path54.join(repoPath, CLAUDE_SETTINGS_RELATIVE_PATH);
|
|
58052
|
+
if (fs48.existsSync(settingsPath)) {
|
|
57782
58053
|
const settings = readSettings(settingsPath);
|
|
57783
58054
|
const preToolUse = settings.hooks?.PreToolUse;
|
|
57784
58055
|
if (preToolUse) {
|
|
@@ -57803,8 +58074,8 @@ function uninstallClaudeGuard(repoPath) {
|
|
|
57803
58074
|
return { removed };
|
|
57804
58075
|
}
|
|
57805
58076
|
function claudeGuardInstalled(repoPath) {
|
|
57806
|
-
const settingsPath =
|
|
57807
|
-
if (!
|
|
58077
|
+
const settingsPath = path54.join(repoPath, CLAUDE_SETTINGS_RELATIVE_PATH);
|
|
58078
|
+
if (!fs48.existsSync(settingsPath)) return false;
|
|
57808
58079
|
try {
|
|
57809
58080
|
const settings = readSettings(settingsPath);
|
|
57810
58081
|
return (settings.hooks?.PreToolUse ?? []).some(isHarGuardEntry);
|
|
@@ -57820,7 +58091,7 @@ function repoOption(y2) {
|
|
|
57820
58091
|
function handleInstall2(argv) {
|
|
57821
58092
|
try {
|
|
57822
58093
|
if (argv.claude) {
|
|
57823
|
-
const result2 = installClaudeGuard(
|
|
58094
|
+
const result2 = installClaudeGuard(path55.resolve(argv.repo));
|
|
57824
58095
|
success("Claude Code worktree guard installed.");
|
|
57825
58096
|
info(`Guard script: ${result2.guardScript}`);
|
|
57826
58097
|
info(`Settings: ${result2.settingsPath} (PreToolUse: Edit|Write|MultiEdit|NotebookEdit)`);
|
|
@@ -57828,7 +58099,7 @@ function handleInstall2(argv) {
|
|
|
57828
58099
|
info("Commit both files so the guard travels with the repo.");
|
|
57829
58100
|
return;
|
|
57830
58101
|
}
|
|
57831
|
-
const result = installHooks({ repoPath:
|
|
58102
|
+
const result = installHooks({ repoPath: path55.resolve(argv.repo), force: argv.force });
|
|
57832
58103
|
success(`Commit gate installed in ${result.hooksDir}`);
|
|
57833
58104
|
info(`pre-commit: ${result.preCommit}, post-commit: ${result.postCommit}`);
|
|
57834
58105
|
info("Commits of unverified change batches will be blocked in agent worktrees.");
|
|
@@ -57841,7 +58112,7 @@ function handleInstall2(argv) {
|
|
|
57841
58112
|
function handleUninstall(argv) {
|
|
57842
58113
|
try {
|
|
57843
58114
|
if (argv.claude) {
|
|
57844
|
-
const result2 = uninstallClaudeGuard(
|
|
58115
|
+
const result2 = uninstallClaudeGuard(path55.resolve(argv.repo));
|
|
57845
58116
|
if (result2.removed) {
|
|
57846
58117
|
success("Claude Code worktree guard removed.");
|
|
57847
58118
|
} else {
|
|
@@ -57849,7 +58120,7 @@ function handleUninstall(argv) {
|
|
|
57849
58120
|
}
|
|
57850
58121
|
return;
|
|
57851
58122
|
}
|
|
57852
|
-
const result = uninstallHooks(
|
|
58123
|
+
const result = uninstallHooks(path55.resolve(argv.repo));
|
|
57853
58124
|
if (result.removed) {
|
|
57854
58125
|
success(`Commit gate removed from ${result.hooksDir}`);
|
|
57855
58126
|
} else {
|
|
@@ -57862,7 +58133,7 @@ function handleUninstall(argv) {
|
|
|
57862
58133
|
}
|
|
57863
58134
|
function handleStatus2(argv) {
|
|
57864
58135
|
try {
|
|
57865
|
-
const status = getHooksStatus(
|
|
58136
|
+
const status = getHooksStatus(path55.resolve(argv.repo));
|
|
57866
58137
|
if (argv.json) {
|
|
57867
58138
|
process.stdout.write(`${JSON.stringify(status, null, 2)}
|
|
57868
58139
|
`);
|
|
@@ -57880,7 +58151,7 @@ function handleStatus2(argv) {
|
|
|
57880
58151
|
);
|
|
57881
58152
|
info(`Effective: ${status.effectiveMode} (in this checkout)`);
|
|
57882
58153
|
info(
|
|
57883
|
-
`Claude guard: ${claudeGuardInstalled(
|
|
58154
|
+
`Claude guard: ${claudeGuardInstalled(path55.resolve(argv.repo)) ? `installed (${CLAUDE_GUARD_RELATIVE_PATH})` : "not installed"}`
|
|
57884
58155
|
);
|
|
57885
58156
|
} catch (err) {
|
|
57886
58157
|
error(err instanceof Error ? err.message : String(err));
|
|
@@ -58141,10 +58412,10 @@ function assignProp(target, prop, value) {
|
|
|
58141
58412
|
configurable: true
|
|
58142
58413
|
});
|
|
58143
58414
|
}
|
|
58144
|
-
function getElementAtPath(obj,
|
|
58145
|
-
if (!
|
|
58415
|
+
function getElementAtPath(obj, path58) {
|
|
58416
|
+
if (!path58)
|
|
58146
58417
|
return obj;
|
|
58147
|
-
return
|
|
58418
|
+
return path58.reduce((acc, key) => acc?.[key], obj);
|
|
58148
58419
|
}
|
|
58149
58420
|
function promiseAllObject(promisesObj) {
|
|
58150
58421
|
const keys = Object.keys(promisesObj);
|
|
@@ -58464,11 +58735,11 @@ function aborted(x2, startIndex = 0) {
|
|
|
58464
58735
|
}
|
|
58465
58736
|
return false;
|
|
58466
58737
|
}
|
|
58467
|
-
function prefixIssues(
|
|
58738
|
+
function prefixIssues(path58, issues) {
|
|
58468
58739
|
return issues.map((iss) => {
|
|
58469
58740
|
var _a3;
|
|
58470
58741
|
(_a3 = iss).path ?? (_a3.path = []);
|
|
58471
|
-
iss.path.unshift(
|
|
58742
|
+
iss.path.unshift(path58);
|
|
58472
58743
|
return iss;
|
|
58473
58744
|
});
|
|
58474
58745
|
}
|
|
@@ -63791,7 +64062,7 @@ var Protocol = class {
|
|
|
63791
64062
|
return;
|
|
63792
64063
|
}
|
|
63793
64064
|
const pollInterval = task2.pollInterval ?? this._options?.defaultTaskPollInterval ?? 1e3;
|
|
63794
|
-
await new Promise((
|
|
64065
|
+
await new Promise((resolve42) => setTimeout(resolve42, pollInterval));
|
|
63795
64066
|
options?.signal?.throwIfAborted();
|
|
63796
64067
|
}
|
|
63797
64068
|
} catch (error3) {
|
|
@@ -63808,7 +64079,7 @@ var Protocol = class {
|
|
|
63808
64079
|
*/
|
|
63809
64080
|
request(request, resultSchema, options) {
|
|
63810
64081
|
const { relatedRequestId, resumptionToken, onresumptiontoken, task, relatedTask } = options ?? {};
|
|
63811
|
-
return new Promise((
|
|
64082
|
+
return new Promise((resolve42, reject) => {
|
|
63812
64083
|
const earlyReject = (error3) => {
|
|
63813
64084
|
reject(error3);
|
|
63814
64085
|
};
|
|
@@ -63886,7 +64157,7 @@ var Protocol = class {
|
|
|
63886
64157
|
if (!parseResult.success) {
|
|
63887
64158
|
reject(parseResult.error);
|
|
63888
64159
|
} else {
|
|
63889
|
-
|
|
64160
|
+
resolve42(parseResult.data);
|
|
63890
64161
|
}
|
|
63891
64162
|
} catch (error3) {
|
|
63892
64163
|
reject(error3);
|
|
@@ -64147,12 +64418,12 @@ var Protocol = class {
|
|
|
64147
64418
|
}
|
|
64148
64419
|
} catch {
|
|
64149
64420
|
}
|
|
64150
|
-
return new Promise((
|
|
64421
|
+
return new Promise((resolve42, reject) => {
|
|
64151
64422
|
if (signal.aborted) {
|
|
64152
64423
|
reject(new McpError(ErrorCode.InvalidRequest, "Request cancelled"));
|
|
64153
64424
|
return;
|
|
64154
64425
|
}
|
|
64155
|
-
const timeoutId = setTimeout(
|
|
64426
|
+
const timeoutId = setTimeout(resolve42, interval);
|
|
64156
64427
|
signal.addEventListener("abort", () => {
|
|
64157
64428
|
clearTimeout(timeoutId);
|
|
64158
64429
|
reject(new McpError(ErrorCode.InvalidRequest, "Request cancelled"));
|
|
@@ -64942,7 +65213,7 @@ var Server = class extends Protocol {
|
|
|
64942
65213
|
};
|
|
64943
65214
|
|
|
64944
65215
|
// src/mcp/server.ts
|
|
64945
|
-
var
|
|
65216
|
+
var path56 = __toESM(require("path"));
|
|
64946
65217
|
|
|
64947
65218
|
// node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
|
|
64948
65219
|
var import_node_process3 = __toESM(require("node:process"), 1);
|
|
@@ -65025,12 +65296,12 @@ var StdioServerTransport = class {
|
|
|
65025
65296
|
this.onclose?.();
|
|
65026
65297
|
}
|
|
65027
65298
|
send(message) {
|
|
65028
|
-
return new Promise((
|
|
65299
|
+
return new Promise((resolve42) => {
|
|
65029
65300
|
const json = serializeMessage(message);
|
|
65030
65301
|
if (this._stdout.write(json)) {
|
|
65031
|
-
|
|
65302
|
+
resolve42();
|
|
65032
65303
|
} else {
|
|
65033
|
-
this._stdout.once("drain",
|
|
65304
|
+
this._stdout.once("drain", resolve42);
|
|
65034
65305
|
}
|
|
65035
65306
|
});
|
|
65036
65307
|
}
|
|
@@ -65605,7 +65876,7 @@ async function handleMcpToolCall(toolName, args, defaultRepo = ".") {
|
|
|
65605
65876
|
const input = ControlUpInputSchema.parse({ ...args, repo });
|
|
65606
65877
|
const result = await startControlAndSync({
|
|
65607
65878
|
detach: input.detach,
|
|
65608
|
-
cwd:
|
|
65879
|
+
cwd: path56.resolve(input.repo)
|
|
65609
65880
|
});
|
|
65610
65881
|
if (result.code !== 0) {
|
|
65611
65882
|
return {
|
|
@@ -65784,7 +66055,7 @@ var preferencesCommand = {
|
|
|
65784
66055
|
};
|
|
65785
66056
|
|
|
65786
66057
|
// src/cli/commands/telemetry.ts
|
|
65787
|
-
var
|
|
66058
|
+
var path57 = __toESM(require("path"));
|
|
65788
66059
|
init_control_config();
|
|
65789
66060
|
init_otel_hooks();
|
|
65790
66061
|
init_telemetry_config();
|
|
@@ -65871,7 +66142,7 @@ async function handleOff() {
|
|
|
65871
66142
|
info("Mission Control will not auto-start. Existing usage rows are kept.");
|
|
65872
66143
|
}
|
|
65873
66144
|
async function handleWriteEnv(argv) {
|
|
65874
|
-
const repoPath =
|
|
66145
|
+
const repoPath = path57.resolve(argv.repo);
|
|
65875
66146
|
const harnessRoot = resolveHarnessRoot(repoPath);
|
|
65876
66147
|
const session = readSlotRegistry(harnessRoot, argv.agentId);
|
|
65877
66148
|
const workDir = argv.workDir ?? session?.workDir ?? repoPath;
|
|
@@ -65883,7 +66154,7 @@ async function handleWriteEnv(argv) {
|
|
|
65883
66154
|
suffix,
|
|
65884
66155
|
createdAt: session?.createdAt
|
|
65885
66156
|
});
|
|
65886
|
-
const envFile = argv.envFile ??
|
|
66157
|
+
const envFile = argv.envFile ?? path57.join(workDir, `.env.agent.${argv.agentId}`);
|
|
65887
66158
|
const attrs = {
|
|
65888
66159
|
sessionKey,
|
|
65889
66160
|
agentId: argv.agentId,
|
|
@@ -65902,7 +66173,7 @@ async function handleWriteEnv(argv) {
|
|
|
65902
66173
|
success(`Wrote session attribution to ${envFile}`);
|
|
65903
66174
|
}
|
|
65904
66175
|
function handlePrintEnv(argv) {
|
|
65905
|
-
const repoPath =
|
|
66176
|
+
const repoPath = path57.resolve(argv.repo);
|
|
65906
66177
|
const workDir = argv.workDir ?? repoPath;
|
|
65907
66178
|
const sessionKey = buildSessionKey({
|
|
65908
66179
|
branch: argv.branch,
|