@remixhq/claude-plugin 0.1.8 → 0.1.10
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/.claude-plugin/plugin.json +1 -1
- package/.mcp.json +1 -1
- package/dist/{hook-post-collab.js → hook-post-collab.cjs} +191 -46
- package/dist/hook-post-collab.cjs.map +1 -0
- package/dist/{hook-pre-git.js → hook-pre-git.cjs} +41 -16
- package/dist/hook-pre-git.cjs.map +1 -0
- package/dist/{hook-stop-collab.js → hook-stop-collab.cjs} +577 -376
- package/dist/hook-stop-collab.cjs.map +1 -0
- package/dist/{hook-user-prompt.js → hook-user-prompt.cjs} +51 -28
- package/dist/hook-user-prompt.cjs.map +1 -0
- package/dist/index.js +48 -6
- package/dist/index.js.map +1 -1
- package/dist/{mcp-server.js → mcp-server.cjs} +814 -782
- package/dist/mcp-server.cjs.map +1 -0
- package/hooks/hooks.json +5 -5
- package/package.json +2 -2
- package/dist/hook-post-collab.js.map +0 -1
- package/dist/hook-pre-git.js.map +0 -1
- package/dist/hook-stop-collab.js.map +0 -1
- package/dist/hook-user-prompt.js.map +0 -1
- package/dist/mcp-server.js.map +0 -1
- /package/dist/{hook-post-collab.d.ts → hook-post-collab.d.cts} +0 -0
- /package/dist/{hook-pre-git.d.ts → hook-pre-git.d.cts} +0 -0
- /package/dist/{hook-stop-collab.d.ts → hook-stop-collab.d.cts} +0 -0
- /package/dist/{hook-user-prompt.d.ts → hook-user-prompt.d.cts} +0 -0
- /package/dist/{mcp-server.d.ts → mcp-server.d.cts} +0 -0
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
2
3
|
var __create = Object.create;
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var
|
|
9
|
-
get: (a2, b) => (typeof require !== "undefined" ? require : a2)[b]
|
|
10
|
-
}) : x)(function(x) {
|
|
11
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
12
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
13
|
-
});
|
|
14
|
-
var __commonJS = (cb, mod) => function __require2() {
|
|
9
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
15
10
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
16
11
|
};
|
|
17
12
|
var __export = (target, all) => {
|
|
@@ -37,11 +32,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
37
32
|
|
|
38
33
|
// node_modules/isexe/windows.js
|
|
39
34
|
var require_windows = __commonJS({
|
|
40
|
-
"node_modules/isexe/windows.js"(
|
|
35
|
+
"node_modules/isexe/windows.js"(exports2, module2) {
|
|
41
36
|
"use strict";
|
|
42
|
-
|
|
37
|
+
module2.exports = isexe;
|
|
43
38
|
isexe.sync = sync;
|
|
44
|
-
var fs8 =
|
|
39
|
+
var fs8 = require("fs");
|
|
45
40
|
function checkPathExt(path12, options) {
|
|
46
41
|
var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
|
|
47
42
|
if (!pathext) {
|
|
@@ -78,11 +73,11 @@ var require_windows = __commonJS({
|
|
|
78
73
|
|
|
79
74
|
// node_modules/isexe/mode.js
|
|
80
75
|
var require_mode = __commonJS({
|
|
81
|
-
"node_modules/isexe/mode.js"(
|
|
76
|
+
"node_modules/isexe/mode.js"(exports2, module2) {
|
|
82
77
|
"use strict";
|
|
83
|
-
|
|
78
|
+
module2.exports = isexe;
|
|
84
79
|
isexe.sync = sync;
|
|
85
|
-
var fs8 =
|
|
80
|
+
var fs8 = require("fs");
|
|
86
81
|
function isexe(path12, options, cb) {
|
|
87
82
|
fs8.stat(path12, function(er, stat) {
|
|
88
83
|
cb(er, er ? false : checkStat(stat, options));
|
|
@@ -112,16 +107,16 @@ var require_mode = __commonJS({
|
|
|
112
107
|
|
|
113
108
|
// node_modules/isexe/index.js
|
|
114
109
|
var require_isexe = __commonJS({
|
|
115
|
-
"node_modules/isexe/index.js"(
|
|
110
|
+
"node_modules/isexe/index.js"(exports2, module2) {
|
|
116
111
|
"use strict";
|
|
117
|
-
var fs8 =
|
|
112
|
+
var fs8 = require("fs");
|
|
118
113
|
var core;
|
|
119
114
|
if (process.platform === "win32" || global.TESTING_WINDOWS) {
|
|
120
115
|
core = require_windows();
|
|
121
116
|
} else {
|
|
122
117
|
core = require_mode();
|
|
123
118
|
}
|
|
124
|
-
|
|
119
|
+
module2.exports = isexe;
|
|
125
120
|
isexe.sync = sync;
|
|
126
121
|
function isexe(path12, options, cb) {
|
|
127
122
|
if (typeof options === "function") {
|
|
@@ -168,10 +163,10 @@ var require_isexe = __commonJS({
|
|
|
168
163
|
|
|
169
164
|
// node_modules/which/which.js
|
|
170
165
|
var require_which = __commonJS({
|
|
171
|
-
"node_modules/which/which.js"(
|
|
166
|
+
"node_modules/which/which.js"(exports2, module2) {
|
|
172
167
|
"use strict";
|
|
173
168
|
var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
|
|
174
|
-
var path12 =
|
|
169
|
+
var path12 = require("path");
|
|
175
170
|
var COLON = isWindows ? ";" : ":";
|
|
176
171
|
var isexe = require_isexe();
|
|
177
172
|
var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
|
|
@@ -258,14 +253,14 @@ var require_which = __commonJS({
|
|
|
258
253
|
return null;
|
|
259
254
|
throw getNotFoundError(cmd);
|
|
260
255
|
};
|
|
261
|
-
|
|
256
|
+
module2.exports = which;
|
|
262
257
|
which.sync = whichSync;
|
|
263
258
|
}
|
|
264
259
|
});
|
|
265
260
|
|
|
266
261
|
// node_modules/path-key/index.js
|
|
267
262
|
var require_path_key = __commonJS({
|
|
268
|
-
"node_modules/path-key/index.js"(
|
|
263
|
+
"node_modules/path-key/index.js"(exports2, module2) {
|
|
269
264
|
"use strict";
|
|
270
265
|
var pathKey2 = (options = {}) => {
|
|
271
266
|
const environment = options.env || process.env;
|
|
@@ -275,16 +270,16 @@ var require_path_key = __commonJS({
|
|
|
275
270
|
}
|
|
276
271
|
return Object.keys(environment).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
|
|
277
272
|
};
|
|
278
|
-
|
|
279
|
-
|
|
273
|
+
module2.exports = pathKey2;
|
|
274
|
+
module2.exports.default = pathKey2;
|
|
280
275
|
}
|
|
281
276
|
});
|
|
282
277
|
|
|
283
278
|
// node_modules/cross-spawn/lib/util/resolveCommand.js
|
|
284
279
|
var require_resolveCommand = __commonJS({
|
|
285
|
-
"node_modules/cross-spawn/lib/util/resolveCommand.js"(
|
|
280
|
+
"node_modules/cross-spawn/lib/util/resolveCommand.js"(exports2, module2) {
|
|
286
281
|
"use strict";
|
|
287
|
-
var path12 =
|
|
282
|
+
var path12 = require("path");
|
|
288
283
|
var which = require_which();
|
|
289
284
|
var getPathKey = require_path_key();
|
|
290
285
|
function resolveCommandAttempt(parsed, withoutPathExt) {
|
|
@@ -318,13 +313,13 @@ var require_resolveCommand = __commonJS({
|
|
|
318
313
|
function resolveCommand(parsed) {
|
|
319
314
|
return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
|
|
320
315
|
}
|
|
321
|
-
|
|
316
|
+
module2.exports = resolveCommand;
|
|
322
317
|
}
|
|
323
318
|
});
|
|
324
319
|
|
|
325
320
|
// node_modules/cross-spawn/lib/util/escape.js
|
|
326
321
|
var require_escape = __commonJS({
|
|
327
|
-
"node_modules/cross-spawn/lib/util/escape.js"(
|
|
322
|
+
"node_modules/cross-spawn/lib/util/escape.js"(exports2, module2) {
|
|
328
323
|
"use strict";
|
|
329
324
|
var metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
|
|
330
325
|
function escapeCommand(arg) {
|
|
@@ -342,25 +337,25 @@ var require_escape = __commonJS({
|
|
|
342
337
|
}
|
|
343
338
|
return arg;
|
|
344
339
|
}
|
|
345
|
-
|
|
346
|
-
|
|
340
|
+
module2.exports.command = escapeCommand;
|
|
341
|
+
module2.exports.argument = escapeArgument;
|
|
347
342
|
}
|
|
348
343
|
});
|
|
349
344
|
|
|
350
345
|
// node_modules/shebang-regex/index.js
|
|
351
346
|
var require_shebang_regex = __commonJS({
|
|
352
|
-
"node_modules/shebang-regex/index.js"(
|
|
347
|
+
"node_modules/shebang-regex/index.js"(exports2, module2) {
|
|
353
348
|
"use strict";
|
|
354
|
-
|
|
349
|
+
module2.exports = /^#!(.*)/;
|
|
355
350
|
}
|
|
356
351
|
});
|
|
357
352
|
|
|
358
353
|
// node_modules/shebang-command/index.js
|
|
359
354
|
var require_shebang_command = __commonJS({
|
|
360
|
-
"node_modules/shebang-command/index.js"(
|
|
355
|
+
"node_modules/shebang-command/index.js"(exports2, module2) {
|
|
361
356
|
"use strict";
|
|
362
357
|
var shebangRegex = require_shebang_regex();
|
|
363
|
-
|
|
358
|
+
module2.exports = (string = "") => {
|
|
364
359
|
const match = string.match(shebangRegex);
|
|
365
360
|
if (!match) {
|
|
366
361
|
return null;
|
|
@@ -377,9 +372,9 @@ var require_shebang_command = __commonJS({
|
|
|
377
372
|
|
|
378
373
|
// node_modules/cross-spawn/lib/util/readShebang.js
|
|
379
374
|
var require_readShebang = __commonJS({
|
|
380
|
-
"node_modules/cross-spawn/lib/util/readShebang.js"(
|
|
375
|
+
"node_modules/cross-spawn/lib/util/readShebang.js"(exports2, module2) {
|
|
381
376
|
"use strict";
|
|
382
|
-
var fs8 =
|
|
377
|
+
var fs8 = require("fs");
|
|
383
378
|
var shebangCommand = require_shebang_command();
|
|
384
379
|
function readShebang(command) {
|
|
385
380
|
const size = 150;
|
|
@@ -393,15 +388,15 @@ var require_readShebang = __commonJS({
|
|
|
393
388
|
}
|
|
394
389
|
return shebangCommand(buffer.toString());
|
|
395
390
|
}
|
|
396
|
-
|
|
391
|
+
module2.exports = readShebang;
|
|
397
392
|
}
|
|
398
393
|
});
|
|
399
394
|
|
|
400
395
|
// node_modules/cross-spawn/lib/parse.js
|
|
401
396
|
var require_parse = __commonJS({
|
|
402
|
-
"node_modules/cross-spawn/lib/parse.js"(
|
|
397
|
+
"node_modules/cross-spawn/lib/parse.js"(exports2, module2) {
|
|
403
398
|
"use strict";
|
|
404
|
-
var path12 =
|
|
399
|
+
var path12 = require("path");
|
|
405
400
|
var resolveCommand = require_resolveCommand();
|
|
406
401
|
var escape = require_escape();
|
|
407
402
|
var readShebang = require_readShebang();
|
|
@@ -455,13 +450,13 @@ var require_parse = __commonJS({
|
|
|
455
450
|
};
|
|
456
451
|
return options.shell ? parsed : parseNonShell(parsed);
|
|
457
452
|
}
|
|
458
|
-
|
|
453
|
+
module2.exports = parse;
|
|
459
454
|
}
|
|
460
455
|
});
|
|
461
456
|
|
|
462
457
|
// node_modules/cross-spawn/lib/enoent.js
|
|
463
458
|
var require_enoent = __commonJS({
|
|
464
|
-
"node_modules/cross-spawn/lib/enoent.js"(
|
|
459
|
+
"node_modules/cross-spawn/lib/enoent.js"(exports2, module2) {
|
|
465
460
|
"use strict";
|
|
466
461
|
var isWin = process.platform === "win32";
|
|
467
462
|
function notFoundError(original, syscall) {
|
|
@@ -500,7 +495,7 @@ var require_enoent = __commonJS({
|
|
|
500
495
|
}
|
|
501
496
|
return null;
|
|
502
497
|
}
|
|
503
|
-
|
|
498
|
+
module2.exports = {
|
|
504
499
|
hookChildProcess,
|
|
505
500
|
verifyENOENT,
|
|
506
501
|
verifyENOENTSync,
|
|
@@ -511,9 +506,9 @@ var require_enoent = __commonJS({
|
|
|
511
506
|
|
|
512
507
|
// node_modules/cross-spawn/index.js
|
|
513
508
|
var require_cross_spawn = __commonJS({
|
|
514
|
-
"node_modules/cross-spawn/index.js"(
|
|
509
|
+
"node_modules/cross-spawn/index.js"(exports2, module2) {
|
|
515
510
|
"use strict";
|
|
516
|
-
var cp =
|
|
511
|
+
var cp = require("child_process");
|
|
517
512
|
var parse = require_parse();
|
|
518
513
|
var enoent = require_enoent();
|
|
519
514
|
function spawn2(command, args, options) {
|
|
@@ -528,11 +523,11 @@ var require_cross_spawn = __commonJS({
|
|
|
528
523
|
result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
|
|
529
524
|
return result;
|
|
530
525
|
}
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
526
|
+
module2.exports = spawn2;
|
|
527
|
+
module2.exports.spawn = spawn2;
|
|
528
|
+
module2.exports.sync = spawnSync2;
|
|
529
|
+
module2.exports._parse = parse;
|
|
530
|
+
module2.exports._enoent = enoent;
|
|
536
531
|
}
|
|
537
532
|
});
|
|
538
533
|
|
|
@@ -551,14 +546,14 @@ var RemixError = class extends Error {
|
|
|
551
546
|
};
|
|
552
547
|
|
|
553
548
|
// node_modules/@remixhq/core/dist/chunk-FAZUMWBS.js
|
|
554
|
-
|
|
555
|
-
|
|
549
|
+
var import_promises = __toESM(require("fs/promises"), 1);
|
|
550
|
+
var import_path = __toESM(require("path"), 1);
|
|
556
551
|
function getCollabBindingPath(repoRoot) {
|
|
557
|
-
return
|
|
552
|
+
return import_path.default.join(repoRoot, ".remix", "config.json");
|
|
558
553
|
}
|
|
559
554
|
async function readCollabBinding(repoRoot) {
|
|
560
555
|
try {
|
|
561
|
-
const raw = await
|
|
556
|
+
const raw = await import_promises.default.readFile(getCollabBindingPath(repoRoot), "utf8");
|
|
562
557
|
const parsed = JSON.parse(raw);
|
|
563
558
|
if (parsed?.schemaVersion !== 1) return null;
|
|
564
559
|
if (!parsed.projectId || !parsed.currentAppId || !parsed.upstreamAppId) return null;
|
|
@@ -588,10 +583,10 @@ var REMIX_ERROR_CODES = {
|
|
|
588
583
|
};
|
|
589
584
|
|
|
590
585
|
// node_modules/@remixhq/core/dist/chunk-UGKPOCN5.js
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
586
|
+
var import_promises13 = __toESM(require("fs/promises"), 1);
|
|
587
|
+
var import_crypto = require("crypto");
|
|
588
|
+
var import_os = __toESM(require("os"), 1);
|
|
589
|
+
var import_path2 = __toESM(require("path"), 1);
|
|
595
590
|
|
|
596
591
|
// node_modules/is-plain-obj/index.js
|
|
597
592
|
function isPlainObject(value) {
|
|
@@ -603,7 +598,7 @@ function isPlainObject(value) {
|
|
|
603
598
|
}
|
|
604
599
|
|
|
605
600
|
// node_modules/execa/lib/arguments/file-url.js
|
|
606
|
-
|
|
601
|
+
var import_node_url = require("url");
|
|
607
602
|
var safeNormalizeFileUrl = (file, name) => {
|
|
608
603
|
const fileString = normalizeFileUrl(normalizeDenoExecPath(file));
|
|
609
604
|
if (typeof fileString !== "string") {
|
|
@@ -613,7 +608,7 @@ var safeNormalizeFileUrl = (file, name) => {
|
|
|
613
608
|
};
|
|
614
609
|
var normalizeDenoExecPath = (file) => isDenoExecPath(file) ? file.toString() : file;
|
|
615
610
|
var isDenoExecPath = (file) => typeof file !== "string" && file && Object.getPrototypeOf(file) === String.prototype;
|
|
616
|
-
var normalizeFileUrl = (file) => file instanceof URL ? fileURLToPath(file) : file;
|
|
611
|
+
var normalizeFileUrl = (file) => file instanceof URL ? (0, import_node_url.fileURLToPath)(file) : file;
|
|
617
612
|
|
|
618
613
|
// node_modules/execa/lib/methods/parameters.js
|
|
619
614
|
var normalizeParameters = (rawFile, rawArguments = [], rawOptions = {}) => {
|
|
@@ -637,10 +632,10 @@ var normalizeParameters = (rawFile, rawArguments = [], rawOptions = {}) => {
|
|
|
637
632
|
};
|
|
638
633
|
|
|
639
634
|
// node_modules/execa/lib/methods/template.js
|
|
640
|
-
|
|
635
|
+
var import_node_child_process = require("child_process");
|
|
641
636
|
|
|
642
637
|
// node_modules/execa/lib/utils/uint-array.js
|
|
643
|
-
|
|
638
|
+
var import_node_string_decoder = require("string_decoder");
|
|
644
639
|
var { toString: objectToString } = Object.prototype;
|
|
645
640
|
var isArrayBuffer = (value) => objectToString.call(value) === "[object ArrayBuffer]";
|
|
646
641
|
var isUint8Array = (value) => objectToString.call(value) === "[object Uint8Array]";
|
|
@@ -657,7 +652,7 @@ var uint8ArraysToStrings = (uint8ArraysOrStrings, encoding) => {
|
|
|
657
652
|
if (encoding === "utf8" && uint8ArraysOrStrings.every((uint8ArrayOrString) => typeof uint8ArrayOrString === "string")) {
|
|
658
653
|
return uint8ArraysOrStrings;
|
|
659
654
|
}
|
|
660
|
-
const decoder = new StringDecoder(encoding);
|
|
655
|
+
const decoder = new import_node_string_decoder.StringDecoder(encoding);
|
|
661
656
|
const strings = uint8ArraysOrStrings.map((uint8ArrayOrString) => typeof uint8ArrayOrString === "string" ? stringToUint8Array(uint8ArrayOrString) : uint8ArrayOrString).map((uint8Array) => decoder.write(uint8Array));
|
|
662
657
|
const finalString = decoder.end();
|
|
663
658
|
return finalString === "" ? strings : [...strings, finalString];
|
|
@@ -768,7 +763,7 @@ var parseExpression = (expression) => {
|
|
|
768
763
|
if (isPlainObject(expression) && ("stdout" in expression || "isMaxBuffer" in expression)) {
|
|
769
764
|
return getSubprocessResult(expression);
|
|
770
765
|
}
|
|
771
|
-
if (expression instanceof ChildProcess || Object.prototype.toString.call(expression) === "[object Promise]") {
|
|
766
|
+
if (expression instanceof import_node_child_process.ChildProcess || Object.prototype.toString.call(expression) === "[object Promise]") {
|
|
772
767
|
throw new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}.");
|
|
773
768
|
}
|
|
774
769
|
throw new TypeError(`Unexpected "${typeOfExpression}" in template expression`);
|
|
@@ -787,15 +782,15 @@ var getSubprocessResult = ({ stdout }) => {
|
|
|
787
782
|
};
|
|
788
783
|
|
|
789
784
|
// node_modules/execa/lib/methods/main-sync.js
|
|
790
|
-
|
|
785
|
+
var import_node_child_process3 = require("child_process");
|
|
791
786
|
|
|
792
787
|
// node_modules/execa/lib/arguments/specific.js
|
|
793
|
-
|
|
788
|
+
var import_node_util = require("util");
|
|
794
789
|
|
|
795
790
|
// node_modules/execa/lib/utils/standard-stream.js
|
|
796
|
-
|
|
791
|
+
var import_node_process = __toESM(require("process"), 1);
|
|
797
792
|
var isStandardStream = (stream) => STANDARD_STREAMS.includes(stream);
|
|
798
|
-
var STANDARD_STREAMS = [
|
|
793
|
+
var STANDARD_STREAMS = [import_node_process.default.stdin, import_node_process.default.stdout, import_node_process.default.stderr];
|
|
799
794
|
var STANDARD_STREAMS_ALIASES = ["stdin", "stdout", "stderr"];
|
|
800
795
|
var getStreamName = (fdNumber) => STANDARD_STREAMS_ALIASES[fdNumber] ?? `stdio[${fdNumber}]`;
|
|
801
796
|
|
|
@@ -858,7 +853,7 @@ var parseFd = (fdName) => {
|
|
|
858
853
|
};
|
|
859
854
|
var FD_REGEXP = /^fd(\d+)$/;
|
|
860
855
|
var addDefaultValue = (optionArray, optionName) => optionArray.map((optionValue) => optionValue === void 0 ? DEFAULT_OPTIONS[optionName] : optionValue);
|
|
861
|
-
var verboseDefault = debuglog("execa").enabled ? "full" : "none";
|
|
856
|
+
var verboseDefault = (0, import_node_util.debuglog)("execa").enabled ? "full" : "none";
|
|
862
857
|
var DEFAULT_OPTIONS = {
|
|
863
858
|
lines: false,
|
|
864
859
|
buffer: true,
|
|
@@ -882,18 +877,18 @@ var isVerboseFunction = (fdVerbose) => typeof fdVerbose === "function";
|
|
|
882
877
|
var VERBOSE_VALUES = ["none", "short", "full"];
|
|
883
878
|
|
|
884
879
|
// node_modules/execa/lib/verbose/log.js
|
|
885
|
-
|
|
880
|
+
var import_node_util3 = require("util");
|
|
886
881
|
|
|
887
882
|
// node_modules/execa/lib/arguments/escape.js
|
|
888
|
-
|
|
889
|
-
|
|
883
|
+
var import_node_process2 = require("process");
|
|
884
|
+
var import_node_util2 = require("util");
|
|
890
885
|
var joinCommand = (filePath, rawArguments) => {
|
|
891
886
|
const fileAndArguments = [filePath, ...rawArguments];
|
|
892
887
|
const command = fileAndArguments.join(" ");
|
|
893
888
|
const escapedCommand = fileAndArguments.map((fileAndArgument) => quoteString(escapeControlCharacters(fileAndArgument))).join(" ");
|
|
894
889
|
return { command, escapedCommand };
|
|
895
890
|
};
|
|
896
|
-
var escapeLines = (lines) => stripVTControlCharacters(lines).split("\n").map((line) => escapeControlCharacters(line)).join("\n");
|
|
891
|
+
var escapeLines = (lines) => (0, import_node_util2.stripVTControlCharacters)(lines).split("\n").map((line) => escapeControlCharacters(line)).join("\n");
|
|
897
892
|
var escapeControlCharacters = (line) => line.replaceAll(SPECIAL_CHAR_REGEXP, (character) => escapeControlCharacter(character));
|
|
898
893
|
var escapeControlCharacter = (character) => {
|
|
899
894
|
const commonEscape = COMMON_ESCAPES[character];
|
|
@@ -925,16 +920,16 @@ var quoteString = (escapedArgument) => {
|
|
|
925
920
|
if (NO_ESCAPE_REGEXP.test(escapedArgument)) {
|
|
926
921
|
return escapedArgument;
|
|
927
922
|
}
|
|
928
|
-
return platform === "win32" ? `"${escapedArgument.replaceAll('"', '""')}"` : `'${escapedArgument.replaceAll("'", "'\\''")}'`;
|
|
923
|
+
return import_node_process2.platform === "win32" ? `"${escapedArgument.replaceAll('"', '""')}"` : `'${escapedArgument.replaceAll("'", "'\\''")}'`;
|
|
929
924
|
};
|
|
930
925
|
var NO_ESCAPE_REGEXP = /^[\w./-]+$/;
|
|
931
926
|
|
|
932
927
|
// node_modules/is-unicode-supported/index.js
|
|
933
|
-
|
|
928
|
+
var import_node_process3 = __toESM(require("process"), 1);
|
|
934
929
|
function isUnicodeSupported() {
|
|
935
|
-
const { env } =
|
|
930
|
+
const { env } = import_node_process3.default;
|
|
936
931
|
const { TERM, TERM_PROGRAM } = env;
|
|
937
|
-
if (
|
|
932
|
+
if (import_node_process3.default.platform !== "win32") {
|
|
938
933
|
return TERM !== "linux";
|
|
939
934
|
}
|
|
940
935
|
return Boolean(env.WT_SESSION) || Boolean(env.TERMINUS_SUBLIME) || env.ConEmuTask === "{cmd::Cmder}" || TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
@@ -1217,8 +1212,8 @@ var figures_default = figures;
|
|
|
1217
1212
|
var replacements = Object.entries(specialMainSymbols);
|
|
1218
1213
|
|
|
1219
1214
|
// node_modules/yoctocolors/base.js
|
|
1220
|
-
|
|
1221
|
-
var hasColors =
|
|
1215
|
+
var import_node_tty = __toESM(require("tty"), 1);
|
|
1216
|
+
var hasColors = import_node_tty.default?.WriteStream?.prototype?.hasColors?.() ?? false;
|
|
1222
1217
|
var format = (open, close) => {
|
|
1223
1218
|
if (!hasColors) {
|
|
1224
1219
|
return (input) => input;
|
|
@@ -1370,7 +1365,7 @@ var getPrintedLine = (verboseObject) => {
|
|
|
1370
1365
|
return { verboseLine, verboseObject };
|
|
1371
1366
|
};
|
|
1372
1367
|
var serializeVerboseMessage = (message) => {
|
|
1373
|
-
const messageString = typeof message === "string" ? message : inspect(message);
|
|
1368
|
+
const messageString = typeof message === "string" ? message : (0, import_node_util3.inspect)(message);
|
|
1374
1369
|
const escapedMessage = escapeLines(messageString);
|
|
1375
1370
|
return escapedMessage.replaceAll(" ", " ".repeat(TAB_SIZE));
|
|
1376
1371
|
};
|
|
@@ -1417,9 +1412,9 @@ var validateVerbose = (verbose) => {
|
|
|
1417
1412
|
};
|
|
1418
1413
|
|
|
1419
1414
|
// node_modules/execa/lib/return/duration.js
|
|
1420
|
-
|
|
1421
|
-
var getStartTime = () => hrtime.bigint();
|
|
1422
|
-
var getDurationMs = (startTime) => Number(hrtime.bigint() - startTime) / 1e6;
|
|
1415
|
+
var import_node_process4 = require("process");
|
|
1416
|
+
var getStartTime = () => import_node_process4.hrtime.bigint();
|
|
1417
|
+
var getDurationMs = (startTime) => Number(import_node_process4.hrtime.bigint() - startTime) / 1e6;
|
|
1423
1418
|
|
|
1424
1419
|
// node_modules/execa/lib/arguments/command.js
|
|
1425
1420
|
var handleCommand = (filePath, rawArguments, rawOptions) => {
|
|
@@ -1437,13 +1432,13 @@ var handleCommand = (filePath, rawArguments, rawOptions) => {
|
|
|
1437
1432
|
};
|
|
1438
1433
|
|
|
1439
1434
|
// node_modules/execa/lib/arguments/options.js
|
|
1435
|
+
var import_node_path5 = __toESM(require("path"), 1);
|
|
1436
|
+
var import_node_process8 = __toESM(require("process"), 1);
|
|
1440
1437
|
var import_cross_spawn = __toESM(require_cross_spawn(), 1);
|
|
1441
|
-
import path6 from "path";
|
|
1442
|
-
import process6 from "process";
|
|
1443
1438
|
|
|
1444
1439
|
// node_modules/npm-run-path/index.js
|
|
1445
|
-
|
|
1446
|
-
|
|
1440
|
+
var import_node_process5 = __toESM(require("process"), 1);
|
|
1441
|
+
var import_node_path2 = __toESM(require("path"), 1);
|
|
1447
1442
|
|
|
1448
1443
|
// node_modules/npm-run-path/node_modules/path-key/index.js
|
|
1449
1444
|
function pathKey(options = {}) {
|
|
@@ -1458,23 +1453,23 @@ function pathKey(options = {}) {
|
|
|
1458
1453
|
}
|
|
1459
1454
|
|
|
1460
1455
|
// node_modules/unicorn-magic/node.js
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
var execFileOriginal = promisify(
|
|
1456
|
+
var import_node_util4 = require("util");
|
|
1457
|
+
var import_node_child_process2 = require("child_process");
|
|
1458
|
+
var import_node_path = __toESM(require("path"), 1);
|
|
1459
|
+
var import_node_url2 = require("url");
|
|
1460
|
+
var execFileOriginal = (0, import_node_util4.promisify)(import_node_child_process2.execFile);
|
|
1466
1461
|
function toPath(urlOrPath) {
|
|
1467
|
-
return urlOrPath instanceof URL ?
|
|
1462
|
+
return urlOrPath instanceof URL ? (0, import_node_url2.fileURLToPath)(urlOrPath) : urlOrPath;
|
|
1468
1463
|
}
|
|
1469
1464
|
function traversePathUp(startPath) {
|
|
1470
1465
|
return {
|
|
1471
1466
|
*[Symbol.iterator]() {
|
|
1472
|
-
let currentPath =
|
|
1467
|
+
let currentPath = import_node_path.default.resolve(toPath(startPath));
|
|
1473
1468
|
let previousPath;
|
|
1474
1469
|
while (previousPath !== currentPath) {
|
|
1475
1470
|
yield currentPath;
|
|
1476
1471
|
previousPath = currentPath;
|
|
1477
|
-
currentPath =
|
|
1472
|
+
currentPath = import_node_path.default.resolve(currentPath, "..");
|
|
1478
1473
|
}
|
|
1479
1474
|
}
|
|
1480
1475
|
};
|
|
@@ -1483,38 +1478,38 @@ var TEN_MEGABYTES_IN_BYTES = 10 * 1024 * 1024;
|
|
|
1483
1478
|
|
|
1484
1479
|
// node_modules/npm-run-path/index.js
|
|
1485
1480
|
var npmRunPath = ({
|
|
1486
|
-
cwd =
|
|
1487
|
-
path: pathOption =
|
|
1481
|
+
cwd = import_node_process5.default.cwd(),
|
|
1482
|
+
path: pathOption = import_node_process5.default.env[pathKey()],
|
|
1488
1483
|
preferLocal = true,
|
|
1489
|
-
execPath: execPath2 =
|
|
1484
|
+
execPath: execPath2 = import_node_process5.default.execPath,
|
|
1490
1485
|
addExecPath = true
|
|
1491
1486
|
} = {}) => {
|
|
1492
|
-
const cwdPath =
|
|
1487
|
+
const cwdPath = import_node_path2.default.resolve(toPath(cwd));
|
|
1493
1488
|
const result = [];
|
|
1494
|
-
const pathParts = pathOption.split(
|
|
1489
|
+
const pathParts = pathOption.split(import_node_path2.default.delimiter);
|
|
1495
1490
|
if (preferLocal) {
|
|
1496
1491
|
applyPreferLocal(result, pathParts, cwdPath);
|
|
1497
1492
|
}
|
|
1498
1493
|
if (addExecPath) {
|
|
1499
1494
|
applyExecPath(result, pathParts, execPath2, cwdPath);
|
|
1500
1495
|
}
|
|
1501
|
-
return pathOption === "" || pathOption ===
|
|
1496
|
+
return pathOption === "" || pathOption === import_node_path2.default.delimiter ? `${result.join(import_node_path2.default.delimiter)}${pathOption}` : [...result, pathOption].join(import_node_path2.default.delimiter);
|
|
1502
1497
|
};
|
|
1503
1498
|
var applyPreferLocal = (result, pathParts, cwdPath) => {
|
|
1504
1499
|
for (const directory of traversePathUp(cwdPath)) {
|
|
1505
|
-
const pathPart =
|
|
1500
|
+
const pathPart = import_node_path2.default.join(directory, "node_modules/.bin");
|
|
1506
1501
|
if (!pathParts.includes(pathPart)) {
|
|
1507
1502
|
result.push(pathPart);
|
|
1508
1503
|
}
|
|
1509
1504
|
}
|
|
1510
1505
|
};
|
|
1511
1506
|
var applyExecPath = (result, pathParts, execPath2, cwdPath) => {
|
|
1512
|
-
const pathPart =
|
|
1507
|
+
const pathPart = import_node_path2.default.resolve(cwdPath, toPath(execPath2), "..");
|
|
1513
1508
|
if (!pathParts.includes(pathPart)) {
|
|
1514
1509
|
result.push(pathPart);
|
|
1515
1510
|
}
|
|
1516
1511
|
};
|
|
1517
|
-
var npmRunPathEnv = ({ env =
|
|
1512
|
+
var npmRunPathEnv = ({ env = import_node_process5.default.env, ...options } = {}) => {
|
|
1518
1513
|
env = { ...env };
|
|
1519
1514
|
const pathName = pathKey({ env });
|
|
1520
1515
|
options.path = env[pathName];
|
|
@@ -1523,7 +1518,7 @@ var npmRunPathEnv = ({ env = process4.env, ...options } = {}) => {
|
|
|
1523
1518
|
};
|
|
1524
1519
|
|
|
1525
1520
|
// node_modules/execa/lib/terminate/kill.js
|
|
1526
|
-
|
|
1521
|
+
var import_promises2 = require("timers/promises");
|
|
1527
1522
|
|
|
1528
1523
|
// node_modules/execa/lib/return/final-error.js
|
|
1529
1524
|
var getFinalError = (originalError, message, isSync) => {
|
|
@@ -1558,10 +1553,10 @@ var ExecaSyncError = class extends Error {
|
|
|
1558
1553
|
setErrorName(ExecaSyncError, ExecaSyncError.name);
|
|
1559
1554
|
|
|
1560
1555
|
// node_modules/execa/lib/terminate/signal.js
|
|
1561
|
-
|
|
1556
|
+
var import_node_os3 = require("os");
|
|
1562
1557
|
|
|
1563
1558
|
// node_modules/human-signals/build/src/main.js
|
|
1564
|
-
|
|
1559
|
+
var import_node_os2 = require("os");
|
|
1565
1560
|
|
|
1566
1561
|
// node_modules/human-signals/build/src/realtime.js
|
|
1567
1562
|
var getRealtimeSignals = () => {
|
|
@@ -1579,7 +1574,7 @@ var SIGRTMIN = 34;
|
|
|
1579
1574
|
var SIGRTMAX = 64;
|
|
1580
1575
|
|
|
1581
1576
|
// node_modules/human-signals/build/src/signals.js
|
|
1582
|
-
|
|
1577
|
+
var import_node_os = require("os");
|
|
1583
1578
|
|
|
1584
1579
|
// node_modules/human-signals/build/src/core.js
|
|
1585
1580
|
var SIGNALS = [
|
|
@@ -1870,7 +1865,7 @@ var normalizeSignal = ({
|
|
|
1870
1865
|
}) => {
|
|
1871
1866
|
const {
|
|
1872
1867
|
signals: { [name]: constantSignal }
|
|
1873
|
-
} = constants;
|
|
1868
|
+
} = import_node_os.constants;
|
|
1874
1869
|
const supported = constantSignal !== void 0;
|
|
1875
1870
|
const number = supported ? constantSignal : defaultNumber;
|
|
1876
1871
|
return { name, number, description, supported, action, forced, standard };
|
|
@@ -1919,7 +1914,7 @@ var getSignalByNumber = (number, signals2) => {
|
|
|
1919
1914
|
};
|
|
1920
1915
|
};
|
|
1921
1916
|
var findSignalByNumber = (number, signals2) => {
|
|
1922
|
-
const signal = signals2.find(({ name }) =>
|
|
1917
|
+
const signal = signals2.find(({ name }) => import_node_os2.constants.signals[name] === number);
|
|
1923
1918
|
if (signal !== void 0) {
|
|
1924
1919
|
return signal;
|
|
1925
1920
|
}
|
|
@@ -1953,13 +1948,13 @@ var normalizeSignalInteger = (signalInteger, optionName) => {
|
|
|
1953
1948
|
throw new TypeError(`Invalid ${optionName} ${signalInteger}: this signal integer does not exist.
|
|
1954
1949
|
${getAvailableSignals()}`);
|
|
1955
1950
|
};
|
|
1956
|
-
var getSignalsIntegerToName = () => new Map(Object.entries(
|
|
1951
|
+
var getSignalsIntegerToName = () => new Map(Object.entries(import_node_os3.constants.signals).reverse().map(([signalName, signalInteger]) => [signalInteger, signalName]));
|
|
1957
1952
|
var signalsIntegerToName = getSignalsIntegerToName();
|
|
1958
1953
|
var normalizeSignalName = (signalName, optionName) => {
|
|
1959
|
-
if (signalName in
|
|
1954
|
+
if (signalName in import_node_os3.constants.signals) {
|
|
1960
1955
|
return signalName;
|
|
1961
1956
|
}
|
|
1962
|
-
if (signalName.toUpperCase() in
|
|
1957
|
+
if (signalName.toUpperCase() in import_node_os3.constants.signals) {
|
|
1963
1958
|
throw new TypeError(`Invalid ${optionName} '${signalName}': please rename it to '${signalName.toUpperCase()}'.`);
|
|
1964
1959
|
}
|
|
1965
1960
|
throw new TypeError(`Invalid ${optionName} '${signalName}': this signal name does not exist.
|
|
@@ -1967,8 +1962,8 @@ ${getAvailableSignals()}`);
|
|
|
1967
1962
|
};
|
|
1968
1963
|
var getAvailableSignals = () => `Available signal names: ${getAvailableSignalNames()}.
|
|
1969
1964
|
Available signal numbers: ${getAvailableSignalIntegers()}.`;
|
|
1970
|
-
var getAvailableSignalNames = () => Object.keys(
|
|
1971
|
-
var getAvailableSignalIntegers = () => [...new Set(Object.values(
|
|
1965
|
+
var getAvailableSignalNames = () => Object.keys(import_node_os3.constants.signals).sort().map((signalName) => `'${signalName}'`).join(", ");
|
|
1966
|
+
var getAvailableSignalIntegers = () => [...new Set(Object.values(import_node_os3.constants.signals).sort((signalInteger, signalIntegerTwo) => signalInteger - signalIntegerTwo))].join(", ");
|
|
1972
1967
|
var getSignalDescription = (signal) => signalsByName[signal].description;
|
|
1973
1968
|
|
|
1974
1969
|
// node_modules/execa/lib/terminate/kill.js
|
|
@@ -2030,7 +2025,7 @@ var killOnTimeout = async ({ kill, forceKillAfterDelay, context, controllerSigna
|
|
|
2030
2025
|
return;
|
|
2031
2026
|
}
|
|
2032
2027
|
try {
|
|
2033
|
-
await
|
|
2028
|
+
await (0, import_promises2.setTimeout)(forceKillAfterDelay, void 0, { signal: controllerSignal });
|
|
2034
2029
|
if (kill("SIGKILL")) {
|
|
2035
2030
|
context.isForcefullyTerminated ??= true;
|
|
2036
2031
|
}
|
|
@@ -2039,10 +2034,10 @@ var killOnTimeout = async ({ kill, forceKillAfterDelay, context, controllerSigna
|
|
|
2039
2034
|
};
|
|
2040
2035
|
|
|
2041
2036
|
// node_modules/execa/lib/utils/abort-signal.js
|
|
2042
|
-
|
|
2037
|
+
var import_node_events = require("events");
|
|
2043
2038
|
var onAbortedSignal = async (mainSignal, stopSignal) => {
|
|
2044
2039
|
if (!mainSignal.aborted) {
|
|
2045
|
-
await once(mainSignal, "abort", { signal: stopSignal });
|
|
2040
|
+
await (0, import_node_events.once)(mainSignal, "abort", { signal: stopSignal });
|
|
2046
2041
|
}
|
|
2047
2042
|
};
|
|
2048
2043
|
|
|
@@ -2061,10 +2056,10 @@ var terminateOnCancel = async (subprocess, cancelSignal, context, { signal }) =>
|
|
|
2061
2056
|
};
|
|
2062
2057
|
|
|
2063
2058
|
// node_modules/execa/lib/ipc/graceful.js
|
|
2064
|
-
|
|
2059
|
+
var import_promises4 = require("timers/promises");
|
|
2065
2060
|
|
|
2066
2061
|
// node_modules/execa/lib/ipc/send.js
|
|
2067
|
-
|
|
2062
|
+
var import_node_util5 = require("util");
|
|
2068
2063
|
|
|
2069
2064
|
// node_modules/execa/lib/ipc/validation.js
|
|
2070
2065
|
var validateIpcMethod = ({ methodName, isSubprocess, ipc, isConnected: isConnected2 }) => {
|
|
@@ -2228,27 +2223,27 @@ var serializeOptionValue = (value) => {
|
|
|
2228
2223
|
};
|
|
2229
2224
|
|
|
2230
2225
|
// node_modules/execa/lib/ipc/strict.js
|
|
2231
|
-
|
|
2226
|
+
var import_node_events5 = require("events");
|
|
2232
2227
|
|
|
2233
2228
|
// node_modules/execa/lib/utils/max-listeners.js
|
|
2234
|
-
|
|
2229
|
+
var import_node_events2 = require("events");
|
|
2235
2230
|
var incrementMaxListeners = (eventEmitter, maxListenersIncrement, signal) => {
|
|
2236
2231
|
const maxListeners = eventEmitter.getMaxListeners();
|
|
2237
2232
|
if (maxListeners === 0 || maxListeners === Number.POSITIVE_INFINITY) {
|
|
2238
2233
|
return;
|
|
2239
2234
|
}
|
|
2240
2235
|
eventEmitter.setMaxListeners(maxListeners + maxListenersIncrement);
|
|
2241
|
-
addAbortListener(signal, () => {
|
|
2236
|
+
(0, import_node_events2.addAbortListener)(signal, () => {
|
|
2242
2237
|
eventEmitter.setMaxListeners(eventEmitter.getMaxListeners() - maxListenersIncrement);
|
|
2243
2238
|
});
|
|
2244
2239
|
};
|
|
2245
2240
|
|
|
2246
2241
|
// node_modules/execa/lib/ipc/forward.js
|
|
2247
|
-
|
|
2242
|
+
var import_node_events4 = require("events");
|
|
2248
2243
|
|
|
2249
2244
|
// node_modules/execa/lib/ipc/incoming.js
|
|
2250
|
-
|
|
2251
|
-
|
|
2245
|
+
var import_node_events3 = require("events");
|
|
2246
|
+
var import_promises3 = require("timers/promises");
|
|
2252
2247
|
|
|
2253
2248
|
// node_modules/execa/lib/ipc/reference.js
|
|
2254
2249
|
var addReference = (channel, reference) => {
|
|
@@ -2295,7 +2290,7 @@ var onMessage = async ({ anyProcess, channel, isSubprocess, ipcEmitter }, wrappe
|
|
|
2295
2290
|
}
|
|
2296
2291
|
while (incomingMessages.length > 0) {
|
|
2297
2292
|
await waitForOutgoingMessages(anyProcess, ipcEmitter, wrappedMessage);
|
|
2298
|
-
await scheduler.yield();
|
|
2293
|
+
await import_promises3.scheduler.yield();
|
|
2299
2294
|
const message = await handleStrictRequest({
|
|
2300
2295
|
wrappedMessage: incomingMessages[0],
|
|
2301
2296
|
anyProcess,
|
|
@@ -2312,7 +2307,7 @@ var onDisconnect = async ({ anyProcess, channel, isSubprocess, ipcEmitter, bound
|
|
|
2312
2307
|
abortOnDisconnect();
|
|
2313
2308
|
const incomingMessages = INCOMING_MESSAGES.get(anyProcess);
|
|
2314
2309
|
while (incomingMessages?.length > 0) {
|
|
2315
|
-
await
|
|
2310
|
+
await (0, import_node_events3.once)(ipcEmitter, "message:done");
|
|
2316
2311
|
}
|
|
2317
2312
|
anyProcess.removeListener("message", boundOnMessage);
|
|
2318
2313
|
redoAddedReferences(channel, isSubprocess);
|
|
@@ -2326,7 +2321,7 @@ var getIpcEmitter = (anyProcess, channel, isSubprocess) => {
|
|
|
2326
2321
|
if (IPC_EMITTERS.has(anyProcess)) {
|
|
2327
2322
|
return IPC_EMITTERS.get(anyProcess);
|
|
2328
2323
|
}
|
|
2329
|
-
const ipcEmitter = new EventEmitter();
|
|
2324
|
+
const ipcEmitter = new import_node_events4.EventEmitter();
|
|
2330
2325
|
ipcEmitter.connected = true;
|
|
2331
2326
|
IPC_EMITTERS.set(anyProcess, ipcEmitter);
|
|
2332
2327
|
forwardEvents({
|
|
@@ -2437,7 +2432,7 @@ var waitForStrictResponse = async (wrappedMessage, anyProcess, isSubprocess) =>
|
|
|
2437
2432
|
var STRICT_RESPONSES = {};
|
|
2438
2433
|
var throwOnDisconnect = async (anyProcess, isSubprocess, { signal }) => {
|
|
2439
2434
|
incrementMaxListeners(anyProcess, 1, signal);
|
|
2440
|
-
await
|
|
2435
|
+
await (0, import_node_events5.once)(anyProcess, "disconnect", { signal });
|
|
2441
2436
|
throwOnStrictDisconnect(isSubprocess);
|
|
2442
2437
|
};
|
|
2443
2438
|
var REQUEST_TYPE = "execa:ipc:request";
|
|
@@ -2534,7 +2529,7 @@ var getSendMethod = (anyProcess) => {
|
|
|
2534
2529
|
if (PROCESS_SEND_METHODS.has(anyProcess)) {
|
|
2535
2530
|
return PROCESS_SEND_METHODS.get(anyProcess);
|
|
2536
2531
|
}
|
|
2537
|
-
const sendMethod =
|
|
2532
|
+
const sendMethod = (0, import_node_util5.promisify)(anyProcess.send.bind(anyProcess));
|
|
2538
2533
|
PROCESS_SEND_METHODS.set(anyProcess, sendMethod);
|
|
2539
2534
|
return sendMethod;
|
|
2540
2535
|
};
|
|
@@ -2575,7 +2570,7 @@ var startIpc = async ({ anyProcess, channel, isSubprocess, ipc }) => {
|
|
|
2575
2570
|
return;
|
|
2576
2571
|
}
|
|
2577
2572
|
getIpcEmitter(anyProcess, channel, isSubprocess);
|
|
2578
|
-
await
|
|
2573
|
+
await import_promises4.scheduler.yield();
|
|
2579
2574
|
};
|
|
2580
2575
|
var cancelListening = false;
|
|
2581
2576
|
var handleAbort = (wrappedMessage) => {
|
|
@@ -2648,7 +2643,7 @@ var getReason = ({ reason }) => {
|
|
|
2648
2643
|
};
|
|
2649
2644
|
|
|
2650
2645
|
// node_modules/execa/lib/terminate/timeout.js
|
|
2651
|
-
|
|
2646
|
+
var import_promises5 = require("timers/promises");
|
|
2652
2647
|
var validateTimeout = ({ timeout }) => {
|
|
2653
2648
|
if (timeout !== void 0 && (!Number.isFinite(timeout) || timeout < 0)) {
|
|
2654
2649
|
throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${timeout}\` (${typeof timeout})`);
|
|
@@ -2656,15 +2651,15 @@ var validateTimeout = ({ timeout }) => {
|
|
|
2656
2651
|
};
|
|
2657
2652
|
var throwOnTimeout = (subprocess, timeout, context, controller) => timeout === 0 || timeout === void 0 ? [] : [killAfterTimeout(subprocess, timeout, context, controller)];
|
|
2658
2653
|
var killAfterTimeout = async (subprocess, timeout, context, { signal }) => {
|
|
2659
|
-
await
|
|
2654
|
+
await (0, import_promises5.setTimeout)(timeout, void 0, { signal });
|
|
2660
2655
|
context.terminationReason ??= "timeout";
|
|
2661
2656
|
subprocess.kill();
|
|
2662
2657
|
throw new DiscardedError();
|
|
2663
2658
|
};
|
|
2664
2659
|
|
|
2665
2660
|
// node_modules/execa/lib/methods/node.js
|
|
2666
|
-
|
|
2667
|
-
|
|
2661
|
+
var import_node_process6 = require("process");
|
|
2662
|
+
var import_node_path3 = __toESM(require("path"), 1);
|
|
2668
2663
|
var mapNode = ({ options }) => {
|
|
2669
2664
|
if (options.node === false) {
|
|
2670
2665
|
throw new TypeError('The "node" option cannot be false with `execaNode()`.');
|
|
@@ -2673,8 +2668,8 @@ var mapNode = ({ options }) => {
|
|
|
2673
2668
|
};
|
|
2674
2669
|
var handleNodeOption = (file, commandArguments, {
|
|
2675
2670
|
node: shouldHandleNode = false,
|
|
2676
|
-
nodePath = execPath,
|
|
2677
|
-
nodeOptions = execArgv.filter((nodeOption) => !nodeOption.startsWith("--inspect")),
|
|
2671
|
+
nodePath = import_node_process6.execPath,
|
|
2672
|
+
nodeOptions = import_node_process6.execArgv.filter((nodeOption) => !nodeOption.startsWith("--inspect")),
|
|
2678
2673
|
cwd,
|
|
2679
2674
|
execPath: formerNodePath,
|
|
2680
2675
|
...options
|
|
@@ -2683,7 +2678,7 @@ var handleNodeOption = (file, commandArguments, {
|
|
|
2683
2678
|
throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');
|
|
2684
2679
|
}
|
|
2685
2680
|
const normalizedNodePath = safeNormalizeFileUrl(nodePath, 'The "nodePath" option');
|
|
2686
|
-
const resolvedNodePath =
|
|
2681
|
+
const resolvedNodePath = import_node_path3.default.resolve(cwd, normalizedNodePath);
|
|
2687
2682
|
const newOptions = {
|
|
2688
2683
|
...options,
|
|
2689
2684
|
nodePath: resolvedNodePath,
|
|
@@ -2693,7 +2688,7 @@ var handleNodeOption = (file, commandArguments, {
|
|
|
2693
2688
|
if (!shouldHandleNode) {
|
|
2694
2689
|
return [file, commandArguments, newOptions];
|
|
2695
2690
|
}
|
|
2696
|
-
if (
|
|
2691
|
+
if (import_node_path3.default.basename(file, ".exe") === "node") {
|
|
2697
2692
|
throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');
|
|
2698
2693
|
}
|
|
2699
2694
|
return [
|
|
@@ -2704,7 +2699,7 @@ var handleNodeOption = (file, commandArguments, {
|
|
|
2704
2699
|
};
|
|
2705
2700
|
|
|
2706
2701
|
// node_modules/execa/lib/ipc/ipc-input.js
|
|
2707
|
-
|
|
2702
|
+
var import_node_v8 = require("v8");
|
|
2708
2703
|
var validateIpcInputOption = ({ ipcInput, ipc, serialization }) => {
|
|
2709
2704
|
if (ipcInput === void 0) {
|
|
2710
2705
|
return;
|
|
@@ -2716,7 +2711,7 @@ var validateIpcInputOption = ({ ipcInput, ipc, serialization }) => {
|
|
|
2716
2711
|
};
|
|
2717
2712
|
var validateAdvancedInput = (ipcInput) => {
|
|
2718
2713
|
try {
|
|
2719
|
-
serialize(ipcInput);
|
|
2714
|
+
(0, import_node_v8.serialize)(ipcInput);
|
|
2720
2715
|
} catch (error) {
|
|
2721
2716
|
throw new Error("The `ipcInput` option is not serializable with a structured clone.", { cause: error });
|
|
2722
2717
|
}
|
|
@@ -2782,16 +2777,16 @@ var ENCODING_ALIASES = {
|
|
|
2782
2777
|
var serializeEncoding = (encoding) => typeof encoding === "string" ? `"${encoding}"` : String(encoding);
|
|
2783
2778
|
|
|
2784
2779
|
// node_modules/execa/lib/arguments/cwd.js
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2780
|
+
var import_node_fs = require("fs");
|
|
2781
|
+
var import_node_path4 = __toESM(require("path"), 1);
|
|
2782
|
+
var import_node_process7 = __toESM(require("process"), 1);
|
|
2788
2783
|
var normalizeCwd = (cwd = getDefaultCwd()) => {
|
|
2789
2784
|
const cwdString = safeNormalizeFileUrl(cwd, 'The "cwd" option');
|
|
2790
|
-
return
|
|
2785
|
+
return import_node_path4.default.resolve(cwdString);
|
|
2791
2786
|
};
|
|
2792
2787
|
var getDefaultCwd = () => {
|
|
2793
2788
|
try {
|
|
2794
|
-
return
|
|
2789
|
+
return import_node_process7.default.cwd();
|
|
2795
2790
|
} catch (error) {
|
|
2796
2791
|
error.message = `The current directory does not exist.
|
|
2797
2792
|
${error.message}`;
|
|
@@ -2804,7 +2799,7 @@ var fixCwdError = (originalMessage, cwd) => {
|
|
|
2804
2799
|
}
|
|
2805
2800
|
let cwdStat;
|
|
2806
2801
|
try {
|
|
2807
|
-
cwdStat = statSync(cwd);
|
|
2802
|
+
cwdStat = (0, import_node_fs.statSync)(cwd);
|
|
2808
2803
|
} catch (error) {
|
|
2809
2804
|
return `The "cwd" option is invalid: ${cwd}.
|
|
2810
2805
|
${error.message}
|
|
@@ -2834,7 +2829,7 @@ var normalizeOptions = (filePath, rawArguments, rawOptions) => {
|
|
|
2834
2829
|
options.killSignal = normalizeKillSignal(options.killSignal);
|
|
2835
2830
|
options.forceKillAfterDelay = normalizeForceKillAfterDelay(options.forceKillAfterDelay);
|
|
2836
2831
|
options.lines = options.lines.map((lines, fdNumber) => lines && !BINARY_ENCODINGS.has(options.encoding) && options.buffer[fdNumber]);
|
|
2837
|
-
if (
|
|
2832
|
+
if (import_node_process8.default.platform === "win32" && import_node_path5.default.basename(file, ".exe") === "cmd") {
|
|
2838
2833
|
commandArguments.unshift("/q");
|
|
2839
2834
|
}
|
|
2840
2835
|
return { file, commandArguments, options };
|
|
@@ -2875,7 +2870,7 @@ var addDefaultOptions = ({
|
|
|
2875
2870
|
serialization
|
|
2876
2871
|
});
|
|
2877
2872
|
var getEnv = ({ env: envOption, extendEnv, preferLocal, node, localDirectory, nodePath }) => {
|
|
2878
|
-
const env = extendEnv ? { ...
|
|
2873
|
+
const env = extendEnv ? { ...import_node_process8.default.env, ...envOption } : envOption;
|
|
2879
2874
|
if (preferLocal || node) {
|
|
2880
2875
|
return npmRunPathEnv({
|
|
2881
2876
|
env,
|
|
@@ -2892,7 +2887,7 @@ var getEnv = ({ env: envOption, extendEnv, preferLocal, node, localDirectory, no
|
|
|
2892
2887
|
var concatenateShell = (file, commandArguments, options) => options.shell && commandArguments.length > 0 ? [[file, ...commandArguments].join(" "), [], options] : [file, commandArguments, options];
|
|
2893
2888
|
|
|
2894
2889
|
// node_modules/execa/lib/return/message.js
|
|
2895
|
-
|
|
2890
|
+
var import_node_util6 = require("util");
|
|
2896
2891
|
|
|
2897
2892
|
// node_modules/strip-final-newline/index.js
|
|
2898
2893
|
function stripFinalNewline(input) {
|
|
@@ -2912,8 +2907,8 @@ var CR = "\r";
|
|
|
2912
2907
|
var CR_BINARY = CR.codePointAt(0);
|
|
2913
2908
|
|
|
2914
2909
|
// node_modules/get-stream/source/index.js
|
|
2915
|
-
|
|
2916
|
-
|
|
2910
|
+
var import_node_events6 = require("events");
|
|
2911
|
+
var import_promises6 = require("stream/promises");
|
|
2917
2912
|
|
|
2918
2913
|
// node_modules/is-stream/index.js
|
|
2919
2914
|
function isStream(stream, { checkOpen = true } = {}) {
|
|
@@ -3279,7 +3274,7 @@ var stringMethods = {
|
|
|
3279
3274
|
};
|
|
3280
3275
|
|
|
3281
3276
|
// node_modules/get-stream/source/index.js
|
|
3282
|
-
Object.assign(nodeImports, { on, finished });
|
|
3277
|
+
Object.assign(nodeImports, { on: import_node_events6.on, finished: import_promises6.finished });
|
|
3283
3278
|
|
|
3284
3279
|
// node_modules/execa/lib/io/max-buffer.js
|
|
3285
3280
|
var handleMaxBuffer = ({ error, stream, readableObjectMode, lines, encoding, fdNumber }) => {
|
|
@@ -3446,7 +3441,7 @@ var getOriginalMessage = (originalError, cwd) => {
|
|
|
3446
3441
|
const escapedOriginalMessage = escapeLines(fixCwdError(originalMessage, cwd));
|
|
3447
3442
|
return escapedOriginalMessage === "" ? void 0 : escapedOriginalMessage;
|
|
3448
3443
|
};
|
|
3449
|
-
var serializeIpcMessage = (ipcMessage) => typeof ipcMessage === "string" ? ipcMessage :
|
|
3444
|
+
var serializeIpcMessage = (ipcMessage) => typeof ipcMessage === "string" ? ipcMessage : (0, import_node_util6.inspect)(ipcMessage);
|
|
3450
3445
|
var serializeMessagePart = (messagePart) => Array.isArray(messagePart) ? messagePart.map((messageItem) => stripFinalNewline(serializeMessageItem(messageItem))).filter(Boolean).join("\n") : serializeMessageItem(messagePart);
|
|
3451
3446
|
var serializeMessageItem = (messageItem) => {
|
|
3452
3447
|
if (typeof messageItem === "string") {
|
|
@@ -3809,7 +3804,7 @@ var handleResult = (result, verboseInfo, { reject }) => {
|
|
|
3809
3804
|
};
|
|
3810
3805
|
|
|
3811
3806
|
// node_modules/execa/lib/stdio/handle-sync.js
|
|
3812
|
-
|
|
3807
|
+
var import_node_fs3 = require("fs");
|
|
3813
3808
|
|
|
3814
3809
|
// node_modules/execa/lib/stdio/type.js
|
|
3815
3810
|
var getStdioItemType = (value, optionName) => {
|
|
@@ -4052,7 +4047,7 @@ var normalizeGenerator = ({ stdioItem, stdioItem: { value }, index, newTransform
|
|
|
4052
4047
|
var sortTransforms = (newTransforms, direction) => direction === "input" ? newTransforms.reverse() : newTransforms;
|
|
4053
4048
|
|
|
4054
4049
|
// node_modules/execa/lib/stdio/direction.js
|
|
4055
|
-
|
|
4050
|
+
var import_node_process9 = __toESM(require("process"), 1);
|
|
4056
4051
|
var getStreamDirection = (stdioItems, fdNumber, optionName) => {
|
|
4057
4052
|
const directions = stdioItems.map((stdioItem) => getStdioItemDirection(stdioItem, fdNumber));
|
|
4058
4053
|
if (directions.includes("input") && directions.includes("output")) {
|
|
@@ -4092,10 +4087,10 @@ var guessStreamDirection = {
|
|
|
4092
4087
|
}
|
|
4093
4088
|
};
|
|
4094
4089
|
var getStandardStreamDirection = (value) => {
|
|
4095
|
-
if ([0,
|
|
4090
|
+
if ([0, import_node_process9.default.stdin].includes(value)) {
|
|
4096
4091
|
return "input";
|
|
4097
4092
|
}
|
|
4098
|
-
if ([1, 2,
|
|
4093
|
+
if ([1, 2, import_node_process9.default.stdout, import_node_process9.default.stderr].includes(value)) {
|
|
4099
4094
|
return "output";
|
|
4100
4095
|
}
|
|
4101
4096
|
};
|
|
@@ -4139,8 +4134,8 @@ var normalizeStdioSync = (stdioArray, buffer, verboseInfo) => stdioArray.map((st
|
|
|
4139
4134
|
var isOutputPipeOnly = (stdioOption) => stdioOption === "pipe" || Array.isArray(stdioOption) && stdioOption.every((item) => item === "pipe");
|
|
4140
4135
|
|
|
4141
4136
|
// node_modules/execa/lib/stdio/native.js
|
|
4142
|
-
|
|
4143
|
-
|
|
4137
|
+
var import_node_fs2 = require("fs");
|
|
4138
|
+
var import_node_tty2 = __toESM(require("tty"), 1);
|
|
4144
4139
|
var handleNativeStream = ({ stdioItem, stdioItem: { type }, isStdioArray, fdNumber, direction, isSync }) => {
|
|
4145
4140
|
if (!isStdioArray || type !== "native") {
|
|
4146
4141
|
return stdioItem;
|
|
@@ -4170,10 +4165,10 @@ var getTargetFd = ({ value, optionName, fdNumber, direction }) => {
|
|
|
4170
4165
|
if (direction === "output") {
|
|
4171
4166
|
return { type: "fileNumber", value: targetFdNumber, optionName };
|
|
4172
4167
|
}
|
|
4173
|
-
if (
|
|
4168
|
+
if (import_node_tty2.default.isatty(targetFdNumber)) {
|
|
4174
4169
|
throw new TypeError(`The \`${optionName}: ${serializeOptionValue(value)}\` option is invalid: it cannot be a TTY with synchronous methods.`);
|
|
4175
4170
|
}
|
|
4176
|
-
return { type: "uint8Array", value: bufferToUint8Array(readFileSync(targetFdNumber)), optionName };
|
|
4171
|
+
return { type: "uint8Array", value: bufferToUint8Array((0, import_node_fs2.readFileSync)(targetFdNumber)), optionName };
|
|
4177
4172
|
};
|
|
4178
4173
|
var getTargetFdNumber = (value, fdNumber) => {
|
|
4179
4174
|
if (value === "inherit") {
|
|
@@ -4506,8 +4501,8 @@ var addProperties = {
|
|
|
4506
4501
|
var addPropertiesSync = {
|
|
4507
4502
|
input: {
|
|
4508
4503
|
...addProperties,
|
|
4509
|
-
fileUrl: ({ value }) => ({ contents: [bufferToUint8Array(
|
|
4510
|
-
filePath: ({ value: { file } }) => ({ contents: [bufferToUint8Array(
|
|
4504
|
+
fileUrl: ({ value }) => ({ contents: [bufferToUint8Array((0, import_node_fs3.readFileSync)(value))] }),
|
|
4505
|
+
filePath: ({ value: { file } }) => ({ contents: [bufferToUint8Array((0, import_node_fs3.readFileSync)(file))] }),
|
|
4511
4506
|
fileNumber: forbiddenIfSync,
|
|
4512
4507
|
iterable: ({ value }) => ({ contents: [...value] }),
|
|
4513
4508
|
string: ({ value }) => ({ contents: [value] }),
|
|
@@ -4529,7 +4524,7 @@ var stripNewline = (value, { stripFinalNewline: stripFinalNewline2 }, fdNumber)
|
|
|
4529
4524
|
var getStripFinalNewline = (stripFinalNewline2, fdNumber) => fdNumber === "all" ? stripFinalNewline2[1] || stripFinalNewline2[2] : stripFinalNewline2[fdNumber];
|
|
4530
4525
|
|
|
4531
4526
|
// node_modules/execa/lib/transform/generator.js
|
|
4532
|
-
|
|
4527
|
+
var import_node_stream = require("stream");
|
|
4533
4528
|
|
|
4534
4529
|
// node_modules/execa/lib/transform/split.js
|
|
4535
4530
|
var getSplitLinesGenerator = (binary, preserveNewlines, skipped, state) => binary || skipped ? void 0 : initializeSplitLines(preserveNewlines, state);
|
|
@@ -4612,10 +4607,10 @@ var linesUint8ArrayInfo = {
|
|
|
4612
4607
|
};
|
|
4613
4608
|
|
|
4614
4609
|
// node_modules/execa/lib/transform/validate.js
|
|
4615
|
-
|
|
4610
|
+
var import_node_buffer = require("buffer");
|
|
4616
4611
|
var getValidateTransformInput = (writableObjectMode, optionName) => writableObjectMode ? void 0 : validateStringTransformInput.bind(void 0, optionName);
|
|
4617
4612
|
var validateStringTransformInput = function* (optionName, chunk) {
|
|
4618
|
-
if (typeof chunk !== "string" && !isUint8Array(chunk) && !
|
|
4613
|
+
if (typeof chunk !== "string" && !isUint8Array(chunk) && !import_node_buffer.Buffer.isBuffer(chunk)) {
|
|
4619
4614
|
throw new TypeError(`The \`${optionName}\` option's transform must use "objectMode: true" to receive as input: ${typeof chunk}.`);
|
|
4620
4615
|
}
|
|
4621
4616
|
yield chunk;
|
|
@@ -4641,8 +4636,8 @@ Instead, \`yield\` should either be called with a value, or not be called at all
|
|
|
4641
4636
|
};
|
|
4642
4637
|
|
|
4643
4638
|
// node_modules/execa/lib/transform/encoding-transform.js
|
|
4644
|
-
|
|
4645
|
-
|
|
4639
|
+
var import_node_buffer2 = require("buffer");
|
|
4640
|
+
var import_node_string_decoder2 = require("string_decoder");
|
|
4646
4641
|
var getEncodingTransformGenerator = (binary, encoding, skipped) => {
|
|
4647
4642
|
if (skipped) {
|
|
4648
4643
|
return;
|
|
@@ -4650,14 +4645,14 @@ var getEncodingTransformGenerator = (binary, encoding, skipped) => {
|
|
|
4650
4645
|
if (binary) {
|
|
4651
4646
|
return { transform: encodingUint8ArrayGenerator.bind(void 0, new TextEncoder()) };
|
|
4652
4647
|
}
|
|
4653
|
-
const stringDecoder = new
|
|
4648
|
+
const stringDecoder = new import_node_string_decoder2.StringDecoder(encoding);
|
|
4654
4649
|
return {
|
|
4655
4650
|
transform: encodingStringGenerator.bind(void 0, stringDecoder),
|
|
4656
4651
|
final: encodingStringFinal.bind(void 0, stringDecoder)
|
|
4657
4652
|
};
|
|
4658
4653
|
};
|
|
4659
4654
|
var encodingUint8ArrayGenerator = function* (textEncoder3, chunk) {
|
|
4660
|
-
if (
|
|
4655
|
+
if (import_node_buffer2.Buffer.isBuffer(chunk)) {
|
|
4661
4656
|
yield bufferToUint8Array(chunk);
|
|
4662
4657
|
} else if (typeof chunk === "string") {
|
|
4663
4658
|
yield textEncoder3.encode(chunk);
|
|
@@ -4676,8 +4671,8 @@ var encodingStringFinal = function* (stringDecoder) {
|
|
|
4676
4671
|
};
|
|
4677
4672
|
|
|
4678
4673
|
// node_modules/execa/lib/transform/run-async.js
|
|
4679
|
-
|
|
4680
|
-
var pushChunks = callbackify(async (getChunks, state, getChunksArguments, transformStream) => {
|
|
4674
|
+
var import_node_util7 = require("util");
|
|
4675
|
+
var pushChunks = (0, import_node_util7.callbackify)(async (getChunks, state, getChunksArguments, transformStream) => {
|
|
4681
4676
|
state.currentIterable = getChunks(...getChunksArguments);
|
|
4682
4677
|
try {
|
|
4683
4678
|
for await (const chunk of state.currentIterable) {
|
|
@@ -4710,7 +4705,7 @@ var generatorFinalChunks = async function* (final, index, generators) {
|
|
|
4710
4705
|
yield* transformChunk(finalChunk, generators, index + 1);
|
|
4711
4706
|
}
|
|
4712
4707
|
};
|
|
4713
|
-
var destroyTransform = callbackify(async ({ currentIterable }, error) => {
|
|
4708
|
+
var destroyTransform = (0, import_node_util7.callbackify)(async ({ currentIterable }, error) => {
|
|
4714
4709
|
if (currentIterable !== void 0) {
|
|
4715
4710
|
await (error ? currentIterable.throw(error) : currentIterable.return());
|
|
4716
4711
|
return;
|
|
@@ -4778,11 +4773,11 @@ var generatorToStream = ({
|
|
|
4778
4773
|
const transformMethod = transformAsync ? pushChunks.bind(void 0, transformChunk, state) : pushChunksSync.bind(void 0, transformChunkSync);
|
|
4779
4774
|
const finalMethod = transformAsync || finalAsync ? pushChunks.bind(void 0, finalChunks, state) : pushChunksSync.bind(void 0, finalChunksSync);
|
|
4780
4775
|
const destroyMethod = transformAsync || finalAsync ? destroyTransform.bind(void 0, state) : void 0;
|
|
4781
|
-
const stream = new Transform({
|
|
4776
|
+
const stream = new import_node_stream.Transform({
|
|
4782
4777
|
writableObjectMode,
|
|
4783
|
-
writableHighWaterMark: getDefaultHighWaterMark(writableObjectMode),
|
|
4778
|
+
writableHighWaterMark: (0, import_node_stream.getDefaultHighWaterMark)(writableObjectMode),
|
|
4784
4779
|
readableObjectMode,
|
|
4785
|
-
readableHighWaterMark: getDefaultHighWaterMark(readableObjectMode),
|
|
4780
|
+
readableHighWaterMark: (0, import_node_stream.getDefaultHighWaterMark)(readableObjectMode),
|
|
4786
4781
|
transform(chunk, encoding2, done) {
|
|
4787
4782
|
transformMethod([chunk, generators, 0], this, done);
|
|
4788
4783
|
},
|
|
@@ -4853,7 +4848,7 @@ var validateSerializable = (newContents) => {
|
|
|
4853
4848
|
};
|
|
4854
4849
|
|
|
4855
4850
|
// node_modules/execa/lib/io/output-sync.js
|
|
4856
|
-
|
|
4851
|
+
var import_node_fs4 = require("fs");
|
|
4857
4852
|
|
|
4858
4853
|
// node_modules/execa/lib/verbose/output.js
|
|
4859
4854
|
var shouldLogOutput = ({ stdioItems, encoding, verboseInfo, fdNumber }) => fdNumber !== "all" && isFullVerbose(verboseInfo, fdNumber) && !BINARY_ENCODINGS.has(encoding) && fdUsesVerbose(fdNumber) && (stdioItems.some(({ type, value }) => type === "native" && PIPED_STDIO_VALUES.has(value)) || stdioItems.every(({ type }) => TRANSFORM_TYPES.has(type)));
|
|
@@ -4977,10 +4972,10 @@ var writeToFiles = (serializedResult, stdioItems, outputFiles) => {
|
|
|
4977
4972
|
for (const { path: path12, append } of stdioItems.filter(({ type }) => FILE_TYPES.has(type))) {
|
|
4978
4973
|
const pathString = typeof path12 === "string" ? path12 : path12.toString();
|
|
4979
4974
|
if (append || outputFiles.has(pathString)) {
|
|
4980
|
-
appendFileSync(path12, serializedResult);
|
|
4975
|
+
(0, import_node_fs4.appendFileSync)(path12, serializedResult);
|
|
4981
4976
|
} else {
|
|
4982
4977
|
outputFiles.add(pathString);
|
|
4983
|
-
writeFileSync(path12, serializedResult);
|
|
4978
|
+
(0, import_node_fs4.writeFileSync)(path12, serializedResult);
|
|
4984
4979
|
}
|
|
4985
4980
|
}
|
|
4986
4981
|
};
|
|
@@ -5009,7 +5004,7 @@ var getAllSync = ([, stdout, stderr], options) => {
|
|
|
5009
5004
|
};
|
|
5010
5005
|
|
|
5011
5006
|
// node_modules/execa/lib/resolve/exit-async.js
|
|
5012
|
-
|
|
5007
|
+
var import_node_events7 = require("events");
|
|
5013
5008
|
var waitForExit = async (subprocess, context) => {
|
|
5014
5009
|
const [exitCode, signal] = await waitForExitOrError(subprocess);
|
|
5015
5010
|
context.isForcefullyTerminated ??= false;
|
|
@@ -5017,8 +5012,8 @@ var waitForExit = async (subprocess, context) => {
|
|
|
5017
5012
|
};
|
|
5018
5013
|
var waitForExitOrError = async (subprocess) => {
|
|
5019
5014
|
const [spawnPayload, exitPayload] = await Promise.allSettled([
|
|
5020
|
-
|
|
5021
|
-
|
|
5015
|
+
(0, import_node_events7.once)(subprocess, "spawn"),
|
|
5016
|
+
(0, import_node_events7.once)(subprocess, "exit")
|
|
5022
5017
|
]);
|
|
5023
5018
|
if (spawnPayload.status === "rejected") {
|
|
5024
5019
|
return [];
|
|
@@ -5027,7 +5022,7 @@ var waitForExitOrError = async (subprocess) => {
|
|
|
5027
5022
|
};
|
|
5028
5023
|
var waitForSubprocessExit = async (subprocess) => {
|
|
5029
5024
|
try {
|
|
5030
|
-
return await
|
|
5025
|
+
return await (0, import_node_events7.once)(subprocess, "exit");
|
|
5031
5026
|
} catch {
|
|
5032
5027
|
return waitForSubprocessExit(subprocess);
|
|
5033
5028
|
}
|
|
@@ -5153,7 +5148,7 @@ var runSubprocessSync = ({ file, commandArguments, options, command, escapedComm
|
|
|
5153
5148
|
try {
|
|
5154
5149
|
addInputOptionsSync(fileDescriptors, options);
|
|
5155
5150
|
const normalizedOptions = normalizeSpawnSyncOptions(options);
|
|
5156
|
-
return spawnSync(...concatenateShell(file, commandArguments, normalizedOptions));
|
|
5151
|
+
return (0, import_node_child_process3.spawnSync)(...concatenateShell(file, commandArguments, normalizedOptions));
|
|
5157
5152
|
} catch (error) {
|
|
5158
5153
|
return makeEarlyError({
|
|
5159
5154
|
error,
|
|
@@ -5195,14 +5190,14 @@ var getSyncResult = ({ error, exitCode, signal, timedOut, isMaxBuffer, stdio, al
|
|
|
5195
5190
|
});
|
|
5196
5191
|
|
|
5197
5192
|
// node_modules/execa/lib/methods/main-async.js
|
|
5198
|
-
|
|
5199
|
-
|
|
5193
|
+
var import_node_events14 = require("events");
|
|
5194
|
+
var import_node_child_process5 = require("child_process");
|
|
5200
5195
|
|
|
5201
5196
|
// node_modules/execa/lib/ipc/methods.js
|
|
5202
|
-
|
|
5197
|
+
var import_node_process10 = __toESM(require("process"), 1);
|
|
5203
5198
|
|
|
5204
5199
|
// node_modules/execa/lib/ipc/get-one.js
|
|
5205
|
-
|
|
5200
|
+
var import_node_events8 = require("events");
|
|
5206
5201
|
var getOneMessage = ({ anyProcess, channel, isSubprocess, ipc }, { reference = true, filter } = {}) => {
|
|
5207
5202
|
validateIpcMethod({
|
|
5208
5203
|
methodName: "getOneMessage",
|
|
@@ -5238,26 +5233,26 @@ var getOneMessageAsync = async ({ anyProcess, channel, isSubprocess, filter, ref
|
|
|
5238
5233
|
};
|
|
5239
5234
|
var getMessage = async (ipcEmitter, filter, { signal }) => {
|
|
5240
5235
|
if (filter === void 0) {
|
|
5241
|
-
const [message] = await
|
|
5236
|
+
const [message] = await (0, import_node_events8.once)(ipcEmitter, "message", { signal });
|
|
5242
5237
|
return message;
|
|
5243
5238
|
}
|
|
5244
|
-
for await (const [message] of
|
|
5239
|
+
for await (const [message] of (0, import_node_events8.on)(ipcEmitter, "message", { signal })) {
|
|
5245
5240
|
if (filter(message)) {
|
|
5246
5241
|
return message;
|
|
5247
5242
|
}
|
|
5248
5243
|
}
|
|
5249
5244
|
};
|
|
5250
5245
|
var throwOnDisconnect2 = async (ipcEmitter, isSubprocess, { signal }) => {
|
|
5251
|
-
await
|
|
5246
|
+
await (0, import_node_events8.once)(ipcEmitter, "disconnect", { signal });
|
|
5252
5247
|
throwOnEarlyDisconnect(isSubprocess);
|
|
5253
5248
|
};
|
|
5254
5249
|
var throwOnStrictError = async (ipcEmitter, isSubprocess, { signal }) => {
|
|
5255
|
-
const [error] = await
|
|
5250
|
+
const [error] = await (0, import_node_events8.once)(ipcEmitter, "strict:error", { signal });
|
|
5256
5251
|
throw getStrictResponseError(error, isSubprocess);
|
|
5257
5252
|
};
|
|
5258
5253
|
|
|
5259
5254
|
// node_modules/execa/lib/ipc/get-each.js
|
|
5260
|
-
|
|
5255
|
+
var import_node_events9 = require("events");
|
|
5261
5256
|
var getEachMessage = ({ anyProcess, channel, isSubprocess, ipc }, { reference = true } = {}) => loopOnMessages({
|
|
5262
5257
|
anyProcess,
|
|
5263
5258
|
channel,
|
|
@@ -5297,14 +5292,14 @@ var loopOnMessages = ({ anyProcess, channel, isSubprocess, ipc, shouldAwait, ref
|
|
|
5297
5292
|
};
|
|
5298
5293
|
var stopOnDisconnect = async (anyProcess, ipcEmitter, controller) => {
|
|
5299
5294
|
try {
|
|
5300
|
-
await
|
|
5295
|
+
await (0, import_node_events9.once)(ipcEmitter, "disconnect", { signal: controller.signal });
|
|
5301
5296
|
controller.abort();
|
|
5302
5297
|
} catch {
|
|
5303
5298
|
}
|
|
5304
5299
|
};
|
|
5305
5300
|
var abortOnStrictError = async ({ ipcEmitter, isSubprocess, controller, state }) => {
|
|
5306
5301
|
try {
|
|
5307
|
-
const [error] = await
|
|
5302
|
+
const [error] = await (0, import_node_events9.once)(ipcEmitter, "strict:error", { signal: controller.signal });
|
|
5308
5303
|
state.error = getStrictResponseError(error, isSubprocess);
|
|
5309
5304
|
controller.abort();
|
|
5310
5305
|
} catch {
|
|
@@ -5312,7 +5307,7 @@ var abortOnStrictError = async ({ ipcEmitter, isSubprocess, controller, state })
|
|
|
5312
5307
|
};
|
|
5313
5308
|
var iterateOnMessages = async function* ({ anyProcess, channel, ipcEmitter, isSubprocess, shouldAwait, controller, state, reference }) {
|
|
5314
5309
|
try {
|
|
5315
|
-
for await (const [message] of
|
|
5310
|
+
for await (const [message] of (0, import_node_events9.on)(ipcEmitter, "message", { signal: controller.signal })) {
|
|
5316
5311
|
throwIfStrictError(state);
|
|
5317
5312
|
yield message;
|
|
5318
5313
|
}
|
|
@@ -5340,9 +5335,9 @@ var addIpcMethods = (subprocess, { ipc }) => {
|
|
|
5340
5335
|
Object.assign(subprocess, getIpcMethods(subprocess, false, ipc));
|
|
5341
5336
|
};
|
|
5342
5337
|
var getIpcExport = () => {
|
|
5343
|
-
const anyProcess =
|
|
5338
|
+
const anyProcess = import_node_process10.default;
|
|
5344
5339
|
const isSubprocess = true;
|
|
5345
|
-
const ipc =
|
|
5340
|
+
const ipc = import_node_process10.default.channel !== void 0;
|
|
5346
5341
|
return {
|
|
5347
5342
|
...getIpcMethods(anyProcess, isSubprocess, ipc),
|
|
5348
5343
|
getCancelSignal: getCancelSignal.bind(void 0, {
|
|
@@ -5375,16 +5370,11 @@ var getIpcMethods = (anyProcess, isSubprocess, ipc) => ({
|
|
|
5375
5370
|
});
|
|
5376
5371
|
|
|
5377
5372
|
// node_modules/execa/lib/return/early-error.js
|
|
5378
|
-
|
|
5379
|
-
|
|
5380
|
-
PassThrough,
|
|
5381
|
-
Readable,
|
|
5382
|
-
Writable,
|
|
5383
|
-
Duplex
|
|
5384
|
-
} from "stream";
|
|
5373
|
+
var import_node_child_process4 = require("child_process");
|
|
5374
|
+
var import_node_stream2 = require("stream");
|
|
5385
5375
|
var handleEarlyError = ({ error, command, escapedCommand, fileDescriptors, options, startTime, verboseInfo }) => {
|
|
5386
5376
|
cleanupCustomStreams(fileDescriptors);
|
|
5387
|
-
const subprocess = new
|
|
5377
|
+
const subprocess = new import_node_child_process4.ChildProcess();
|
|
5388
5378
|
createDummyStreams(subprocess, fileDescriptors);
|
|
5389
5379
|
Object.assign(subprocess, { readable, writable, duplex });
|
|
5390
5380
|
const earlyError = makeEarlyError({
|
|
@@ -5415,23 +5405,23 @@ var createDummyStreams = (subprocess, fileDescriptors) => {
|
|
|
5415
5405
|
});
|
|
5416
5406
|
};
|
|
5417
5407
|
var createDummyStream = () => {
|
|
5418
|
-
const stream = new PassThrough();
|
|
5408
|
+
const stream = new import_node_stream2.PassThrough();
|
|
5419
5409
|
stream.end();
|
|
5420
5410
|
return stream;
|
|
5421
5411
|
};
|
|
5422
|
-
var readable = () => new Readable({ read() {
|
|
5412
|
+
var readable = () => new import_node_stream2.Readable({ read() {
|
|
5423
5413
|
} });
|
|
5424
|
-
var writable = () => new Writable({ write() {
|
|
5414
|
+
var writable = () => new import_node_stream2.Writable({ write() {
|
|
5425
5415
|
} });
|
|
5426
|
-
var duplex = () => new Duplex({ read() {
|
|
5416
|
+
var duplex = () => new import_node_stream2.Duplex({ read() {
|
|
5427
5417
|
}, write() {
|
|
5428
5418
|
} });
|
|
5429
5419
|
var handleDummyPromise = async (error, verboseInfo, options) => handleResult(error, verboseInfo, options);
|
|
5430
5420
|
|
|
5431
5421
|
// node_modules/execa/lib/stdio/handle-async.js
|
|
5432
|
-
|
|
5433
|
-
|
|
5434
|
-
|
|
5422
|
+
var import_node_fs5 = require("fs");
|
|
5423
|
+
var import_node_buffer3 = require("buffer");
|
|
5424
|
+
var import_node_stream3 = require("stream");
|
|
5435
5425
|
var handleStdioAsync = (options, verboseInfo) => handleStdio(addPropertiesAsync, options, verboseInfo, false);
|
|
5436
5426
|
var forbiddenIfAsync = ({ type, optionName }) => {
|
|
5437
5427
|
throw new TypeError(`The \`${optionName}\` option cannot be ${TYPE_TO_MESSAGE[type]}.`);
|
|
@@ -5443,7 +5433,7 @@ var addProperties2 = {
|
|
|
5443
5433
|
nodeStream: ({ value }) => ({ stream: value }),
|
|
5444
5434
|
webTransform({ value: { transform, writableObjectMode, readableObjectMode } }) {
|
|
5445
5435
|
const objectMode = writableObjectMode || readableObjectMode;
|
|
5446
|
-
const stream =
|
|
5436
|
+
const stream = import_node_stream3.Duplex.fromWeb(transform, { objectMode });
|
|
5447
5437
|
return { stream };
|
|
5448
5438
|
},
|
|
5449
5439
|
duplex: ({ value: { transform } }) => ({ stream: transform }),
|
|
@@ -5453,19 +5443,19 @@ var addProperties2 = {
|
|
|
5453
5443
|
var addPropertiesAsync = {
|
|
5454
5444
|
input: {
|
|
5455
5445
|
...addProperties2,
|
|
5456
|
-
fileUrl: ({ value }) => ({ stream: createReadStream(value) }),
|
|
5457
|
-
filePath: ({ value: { file } }) => ({ stream: createReadStream(file) }),
|
|
5458
|
-
webStream: ({ value }) => ({ stream:
|
|
5459
|
-
iterable: ({ value }) => ({ stream:
|
|
5460
|
-
asyncIterable: ({ value }) => ({ stream:
|
|
5461
|
-
string: ({ value }) => ({ stream:
|
|
5462
|
-
uint8Array: ({ value }) => ({ stream:
|
|
5446
|
+
fileUrl: ({ value }) => ({ stream: (0, import_node_fs5.createReadStream)(value) }),
|
|
5447
|
+
filePath: ({ value: { file } }) => ({ stream: (0, import_node_fs5.createReadStream)(file) }),
|
|
5448
|
+
webStream: ({ value }) => ({ stream: import_node_stream3.Readable.fromWeb(value) }),
|
|
5449
|
+
iterable: ({ value }) => ({ stream: import_node_stream3.Readable.from(value) }),
|
|
5450
|
+
asyncIterable: ({ value }) => ({ stream: import_node_stream3.Readable.from(value) }),
|
|
5451
|
+
string: ({ value }) => ({ stream: import_node_stream3.Readable.from(value) }),
|
|
5452
|
+
uint8Array: ({ value }) => ({ stream: import_node_stream3.Readable.from(import_node_buffer3.Buffer.from(value)) })
|
|
5463
5453
|
},
|
|
5464
5454
|
output: {
|
|
5465
5455
|
...addProperties2,
|
|
5466
|
-
fileUrl: ({ value }) => ({ stream: createWriteStream(value) }),
|
|
5467
|
-
filePath: ({ value: { file, append } }) => ({ stream: createWriteStream(file, append ? { flags: "a" } : {}) }),
|
|
5468
|
-
webStream: ({ value }) => ({ stream:
|
|
5456
|
+
fileUrl: ({ value }) => ({ stream: (0, import_node_fs5.createWriteStream)(value) }),
|
|
5457
|
+
filePath: ({ value: { file, append } }) => ({ stream: (0, import_node_fs5.createWriteStream)(file, append ? { flags: "a" } : {}) }),
|
|
5458
|
+
webStream: ({ value }) => ({ stream: import_node_stream3.Writable.fromWeb(value) }),
|
|
5469
5459
|
iterable: forbiddenIfAsync,
|
|
5470
5460
|
asyncIterable: forbiddenIfAsync,
|
|
5471
5461
|
string: forbiddenIfAsync,
|
|
@@ -5474,9 +5464,9 @@ var addPropertiesAsync = {
|
|
|
5474
5464
|
};
|
|
5475
5465
|
|
|
5476
5466
|
// node_modules/@sindresorhus/merge-streams/index.js
|
|
5477
|
-
|
|
5478
|
-
|
|
5479
|
-
|
|
5467
|
+
var import_node_events10 = require("events");
|
|
5468
|
+
var import_node_stream4 = require("stream");
|
|
5469
|
+
var import_promises7 = require("stream/promises");
|
|
5480
5470
|
function mergeStreams(streams) {
|
|
5481
5471
|
if (!Array.isArray(streams)) {
|
|
5482
5472
|
throw new TypeError(`Expected an array, got \`${typeof streams}\`.`);
|
|
@@ -5498,12 +5488,12 @@ function mergeStreams(streams) {
|
|
|
5498
5488
|
}
|
|
5499
5489
|
var getHighWaterMark = (streams, objectMode) => {
|
|
5500
5490
|
if (streams.length === 0) {
|
|
5501
|
-
return
|
|
5491
|
+
return (0, import_node_stream4.getDefaultHighWaterMark)(objectMode);
|
|
5502
5492
|
}
|
|
5503
5493
|
const highWaterMarks = streams.filter(({ readableObjectMode }) => readableObjectMode === objectMode).map(({ readableHighWaterMark }) => readableHighWaterMark);
|
|
5504
5494
|
return Math.max(...highWaterMarks);
|
|
5505
5495
|
};
|
|
5506
|
-
var MergedStream = class extends
|
|
5496
|
+
var MergedStream = class extends import_node_stream4.PassThrough {
|
|
5507
5497
|
#streams = /* @__PURE__ */ new Set([]);
|
|
5508
5498
|
#ended = /* @__PURE__ */ new Set([]);
|
|
5509
5499
|
#aborted = /* @__PURE__ */ new Set([]);
|
|
@@ -5559,14 +5549,14 @@ var onMergedStreamFinished = async (passThroughStream, streams, unpipeEvent) =>
|
|
|
5559
5549
|
};
|
|
5560
5550
|
var onMergedStreamEnd = async (passThroughStream, { signal }) => {
|
|
5561
5551
|
try {
|
|
5562
|
-
await
|
|
5552
|
+
await (0, import_promises7.finished)(passThroughStream, { signal, cleanup: true });
|
|
5563
5553
|
} catch (error) {
|
|
5564
5554
|
errorOrAbortStream(passThroughStream, error);
|
|
5565
5555
|
throw error;
|
|
5566
5556
|
}
|
|
5567
5557
|
};
|
|
5568
5558
|
var onInputStreamsUnpipe = async (passThroughStream, streams, unpipeEvent, { signal }) => {
|
|
5569
|
-
for await (const [unpipedStream] of
|
|
5559
|
+
for await (const [unpipedStream] of (0, import_node_events10.on)(passThroughStream, "unpipe", { signal })) {
|
|
5570
5560
|
if (streams.has(unpipedStream)) {
|
|
5571
5561
|
unpipedStream.emit(unpipeEvent);
|
|
5572
5562
|
}
|
|
@@ -5626,7 +5616,7 @@ var afterMergedStreamFinished = async (onFinished, stream, { signal }) => {
|
|
|
5626
5616
|
};
|
|
5627
5617
|
var onInputStreamEnd = async ({ passThroughStream, stream, streams, ended, aborted: aborted2, controller: { signal } }) => {
|
|
5628
5618
|
try {
|
|
5629
|
-
await
|
|
5619
|
+
await (0, import_promises7.finished)(stream, {
|
|
5630
5620
|
signal,
|
|
5631
5621
|
cleanup: true,
|
|
5632
5622
|
readable: true,
|
|
@@ -5647,9 +5637,9 @@ var onInputStreamEnd = async ({ passThroughStream, stream, streams, ended, abort
|
|
|
5647
5637
|
}
|
|
5648
5638
|
};
|
|
5649
5639
|
var onInputStreamUnpipe = async ({ stream, streams, ended, aborted: aborted2, unpipeEvent, controller: { signal } }) => {
|
|
5650
|
-
await
|
|
5640
|
+
await (0, import_node_events10.once)(stream, unpipeEvent, { signal });
|
|
5651
5641
|
if (!stream.readable) {
|
|
5652
|
-
return
|
|
5642
|
+
return (0, import_node_events10.once)(signal, "abort", { signal });
|
|
5653
5643
|
}
|
|
5654
5644
|
streams.delete(stream);
|
|
5655
5645
|
ended.delete(stream);
|
|
@@ -5691,7 +5681,7 @@ var PASSTHROUGH_LISTENERS_COUNT = 2;
|
|
|
5691
5681
|
var PASSTHROUGH_LISTENERS_PER_STREAM = 1;
|
|
5692
5682
|
|
|
5693
5683
|
// node_modules/execa/lib/io/pipeline.js
|
|
5694
|
-
|
|
5684
|
+
var import_promises8 = require("stream/promises");
|
|
5695
5685
|
var pipeStreams = (source, destination) => {
|
|
5696
5686
|
source.pipe(destination);
|
|
5697
5687
|
onSourceFinish(source, destination);
|
|
@@ -5702,7 +5692,7 @@ var onSourceFinish = async (source, destination) => {
|
|
|
5702
5692
|
return;
|
|
5703
5693
|
}
|
|
5704
5694
|
try {
|
|
5705
|
-
await
|
|
5695
|
+
await (0, import_promises8.finished)(source, { cleanup: true, readable: true, writable: false });
|
|
5706
5696
|
} catch {
|
|
5707
5697
|
}
|
|
5708
5698
|
endDestinationStream(destination);
|
|
@@ -5717,7 +5707,7 @@ var onDestinationFinish = async (source, destination) => {
|
|
|
5717
5707
|
return;
|
|
5718
5708
|
}
|
|
5719
5709
|
try {
|
|
5720
|
-
await
|
|
5710
|
+
await (0, import_promises8.finished)(destination, { cleanup: true, readable: false, writable: true });
|
|
5721
5711
|
} catch {
|
|
5722
5712
|
}
|
|
5723
5713
|
abortSourceStream(source);
|
|
@@ -5781,7 +5771,7 @@ var setStandardStreamMaxListeners = (stream, { signal }) => {
|
|
|
5781
5771
|
var MAX_LISTENERS_INCREMENT = 2;
|
|
5782
5772
|
|
|
5783
5773
|
// node_modules/execa/lib/terminate/cleanup.js
|
|
5784
|
-
|
|
5774
|
+
var import_node_events11 = require("events");
|
|
5785
5775
|
|
|
5786
5776
|
// node_modules/signal-exit/dist/mjs/signals.js
|
|
5787
5777
|
var signals = [];
|
|
@@ -6042,7 +6032,7 @@ var cleanupOnExit = (subprocess, { cleanup, detached }, { signal }) => {
|
|
|
6042
6032
|
const removeExitHandler = onExit(() => {
|
|
6043
6033
|
subprocess.kill();
|
|
6044
6034
|
});
|
|
6045
|
-
|
|
6035
|
+
(0, import_node_events11.addAbortListener)(signal, () => {
|
|
6046
6036
|
removeExitHandler();
|
|
6047
6037
|
});
|
|
6048
6038
|
};
|
|
@@ -6188,7 +6178,7 @@ var waitForBothSubprocesses = async (subprocessPromises) => {
|
|
|
6188
6178
|
};
|
|
6189
6179
|
|
|
6190
6180
|
// node_modules/execa/lib/pipe/streaming.js
|
|
6191
|
-
|
|
6181
|
+
var import_promises9 = require("stream/promises");
|
|
6192
6182
|
var pipeSubprocessStream = (sourceStream, destinationStream, maxListenersController) => {
|
|
6193
6183
|
const mergedStream = MERGED_STREAMS.has(destinationStream) ? pipeMoreSubprocessStream(sourceStream, destinationStream) : pipeFirstSubprocessStream(sourceStream, destinationStream);
|
|
6194
6184
|
incrementMaxListeners(sourceStream, SOURCE_LISTENERS_PER_PIPE, maxListenersController.signal);
|
|
@@ -6209,7 +6199,7 @@ var pipeMoreSubprocessStream = (sourceStream, destinationStream) => {
|
|
|
6209
6199
|
};
|
|
6210
6200
|
var cleanupMergedStreamsMap = async (destinationStream) => {
|
|
6211
6201
|
try {
|
|
6212
|
-
await
|
|
6202
|
+
await (0, import_promises9.finished)(destinationStream, { cleanup: true, readable: false, writable: true });
|
|
6213
6203
|
} catch {
|
|
6214
6204
|
}
|
|
6215
6205
|
MERGED_STREAMS.delete(destinationStream);
|
|
@@ -6219,10 +6209,10 @@ var SOURCE_LISTENERS_PER_PIPE = 2;
|
|
|
6219
6209
|
var DESTINATION_LISTENERS_PER_PIPE = 1;
|
|
6220
6210
|
|
|
6221
6211
|
// node_modules/execa/lib/pipe/abort.js
|
|
6222
|
-
|
|
6212
|
+
var import_node_util8 = require("util");
|
|
6223
6213
|
var unpipeOnAbort = (unpipeSignal, unpipeContext) => unpipeSignal === void 0 ? [] : [unpipeOnSignalAbort(unpipeSignal, unpipeContext)];
|
|
6224
6214
|
var unpipeOnSignalAbort = async (unpipeSignal, { sourceStream, mergedStream, fileDescriptors, sourceOptions, startTime }) => {
|
|
6225
|
-
await aborted(unpipeSignal, sourceStream);
|
|
6215
|
+
await (0, import_node_util8.aborted)(unpipeSignal, sourceStream);
|
|
6226
6216
|
await mergedStream.remove(sourceStream);
|
|
6227
6217
|
const error = new Error("Pipe canceled by `unpipeSignal` option.");
|
|
6228
6218
|
throw createNonCommandError({
|
|
@@ -6293,11 +6283,11 @@ var handlePipePromise = async ({
|
|
|
6293
6283
|
var getSubprocessPromises = (sourcePromise, destination) => Promise.allSettled([sourcePromise, destination]);
|
|
6294
6284
|
|
|
6295
6285
|
// node_modules/execa/lib/io/contents.js
|
|
6296
|
-
|
|
6286
|
+
var import_promises10 = require("timers/promises");
|
|
6297
6287
|
|
|
6298
6288
|
// node_modules/execa/lib/io/iterate.js
|
|
6299
|
-
|
|
6300
|
-
|
|
6289
|
+
var import_node_events12 = require("events");
|
|
6290
|
+
var import_node_stream5 = require("stream");
|
|
6301
6291
|
var iterateOnSubprocessStream = ({ subprocessStdout, subprocess, binary, shouldEncode, encoding, preserveNewlines }) => {
|
|
6302
6292
|
const controller = new AbortController();
|
|
6303
6293
|
stopReadingOnExit(subprocess, controller);
|
|
@@ -6343,7 +6333,7 @@ var stopReadingOnStreamEnd = async (onStreamEnd, controller, stream) => {
|
|
|
6343
6333
|
}
|
|
6344
6334
|
};
|
|
6345
6335
|
var iterateOnStream = ({ stream, controller, binary, shouldEncode, encoding, shouldSplit, preserveNewlines }) => {
|
|
6346
|
-
const onStdoutChunk =
|
|
6336
|
+
const onStdoutChunk = (0, import_node_events12.on)(stream, "data", {
|
|
6347
6337
|
signal: controller.signal,
|
|
6348
6338
|
highWaterMark: HIGH_WATER_MARK,
|
|
6349
6339
|
// Backward compatibility with older name for this option
|
|
@@ -6361,7 +6351,7 @@ var iterateOnStream = ({ stream, controller, binary, shouldEncode, encoding, sho
|
|
|
6361
6351
|
preserveNewlines
|
|
6362
6352
|
});
|
|
6363
6353
|
};
|
|
6364
|
-
var DEFAULT_OBJECT_HIGH_WATER_MARK =
|
|
6354
|
+
var DEFAULT_OBJECT_HIGH_WATER_MARK = (0, import_node_stream5.getDefaultHighWaterMark)(true);
|
|
6365
6355
|
var HIGH_WATER_MARK = DEFAULT_OBJECT_HIGH_WATER_MARK;
|
|
6366
6356
|
var iterateOnData = async function* ({ onStdoutChunk, controller, binary, shouldEncode, encoding, shouldSplit, preserveNewlines }) {
|
|
6367
6357
|
const generators = getGenerators({
|
|
@@ -6445,7 +6435,7 @@ var logOutputAsync = async ({ stream, onStreamEnd, fdNumber, encoding, allMixed,
|
|
|
6445
6435
|
await logLines(linesIterable, stream, fdNumber, verboseInfo);
|
|
6446
6436
|
};
|
|
6447
6437
|
var resumeStream = async (stream) => {
|
|
6448
|
-
await setImmediate();
|
|
6438
|
+
await (0, import_promises10.setImmediate)();
|
|
6449
6439
|
if (stream.readableFlowing === null) {
|
|
6450
6440
|
stream.resume();
|
|
6451
6441
|
}
|
|
@@ -6480,14 +6470,14 @@ var getBufferedData = async (streamPromise) => {
|
|
|
6480
6470
|
var handleBufferedData = ({ bufferedData }) => isArrayBuffer(bufferedData) ? new Uint8Array(bufferedData) : bufferedData;
|
|
6481
6471
|
|
|
6482
6472
|
// node_modules/execa/lib/resolve/wait-stream.js
|
|
6483
|
-
|
|
6473
|
+
var import_promises11 = require("stream/promises");
|
|
6484
6474
|
var waitForStream = async (stream, fdNumber, streamInfo, { isSameDirection, stopOnExit = false } = {}) => {
|
|
6485
6475
|
const state = handleStdinDestroy(stream, streamInfo);
|
|
6486
6476
|
const abortController = new AbortController();
|
|
6487
6477
|
try {
|
|
6488
6478
|
await Promise.race([
|
|
6489
6479
|
...stopOnExit ? [streamInfo.exitPromise] : [],
|
|
6490
|
-
|
|
6480
|
+
(0, import_promises11.finished)(stream, { cleanup: true, signal: abortController.signal })
|
|
6491
6481
|
]);
|
|
6492
6482
|
} catch (error) {
|
|
6493
6483
|
if (!state.stdinCleanedUp) {
|
|
@@ -6602,7 +6592,7 @@ var getAllStream = ({ stdout, stderr, all }, [, bufferStdout, bufferStderr]) =>
|
|
|
6602
6592
|
var getAllMixed = ({ all, stdout, stderr }) => all && stdout && stderr && stdout.readableObjectMode !== stderr.readableObjectMode;
|
|
6603
6593
|
|
|
6604
6594
|
// node_modules/execa/lib/resolve/wait-subprocess.js
|
|
6605
|
-
|
|
6595
|
+
var import_node_events13 = require("events");
|
|
6606
6596
|
|
|
6607
6597
|
// node_modules/execa/lib/verbose/ipc.js
|
|
6608
6598
|
var shouldLogIpc = (verboseInfo) => isFullVerbose(verboseInfo, "ipc");
|
|
@@ -6766,7 +6756,7 @@ var waitForCustomStreamsEnd = (fileDescriptors, streamInfo) => fileDescriptors.f
|
|
|
6766
6756
|
stopOnExit: type === "native"
|
|
6767
6757
|
})));
|
|
6768
6758
|
var throwOnSubprocessError = async (subprocess, { signal }) => {
|
|
6769
|
-
const [error] = await
|
|
6759
|
+
const [error] = await (0, import_node_events13.once)(subprocess, "error", { signal });
|
|
6770
6760
|
throw error;
|
|
6771
6761
|
};
|
|
6772
6762
|
|
|
@@ -6797,11 +6787,11 @@ var waitForConcurrentStreams = async ({ resolve, promises }, subprocess) => {
|
|
|
6797
6787
|
};
|
|
6798
6788
|
|
|
6799
6789
|
// node_modules/execa/lib/convert/readable.js
|
|
6800
|
-
|
|
6801
|
-
|
|
6790
|
+
var import_node_stream6 = require("stream");
|
|
6791
|
+
var import_node_util9 = require("util");
|
|
6802
6792
|
|
|
6803
6793
|
// node_modules/execa/lib/convert/shared.js
|
|
6804
|
-
|
|
6794
|
+
var import_promises12 = require("stream/promises");
|
|
6805
6795
|
var safeWaitForSubprocessStdin = async (subprocessStdin) => {
|
|
6806
6796
|
if (subprocessStdin === void 0) {
|
|
6807
6797
|
return;
|
|
@@ -6821,10 +6811,10 @@ var safeWaitForSubprocessStdout = async (subprocessStdout) => {
|
|
|
6821
6811
|
}
|
|
6822
6812
|
};
|
|
6823
6813
|
var waitForSubprocessStdin = async (subprocessStdin) => {
|
|
6824
|
-
await
|
|
6814
|
+
await (0, import_promises12.finished)(subprocessStdin, { cleanup: true, readable: false, writable: true });
|
|
6825
6815
|
};
|
|
6826
6816
|
var waitForSubprocessStdout = async (subprocessStdout) => {
|
|
6827
|
-
await
|
|
6817
|
+
await (0, import_promises12.finished)(subprocessStdout, { cleanup: true, readable: true, writable: false });
|
|
6828
6818
|
};
|
|
6829
6819
|
var waitForSubprocess = async (subprocess, error) => {
|
|
6830
6820
|
await subprocess;
|
|
@@ -6852,9 +6842,9 @@ var createReadable = ({ subprocess, concurrentStreams, encoding }, { from, binar
|
|
|
6852
6842
|
encoding,
|
|
6853
6843
|
preserveNewlines
|
|
6854
6844
|
});
|
|
6855
|
-
const readable2 = new
|
|
6845
|
+
const readable2 = new import_node_stream6.Readable({
|
|
6856
6846
|
read,
|
|
6857
|
-
destroy:
|
|
6847
|
+
destroy: (0, import_node_util9.callbackify)(onReadableDestroy.bind(void 0, { subprocessStdout, subprocess, waitReadableDestroy })),
|
|
6858
6848
|
highWaterMark: readableHighWaterMark,
|
|
6859
6849
|
objectMode: readableObjectMode,
|
|
6860
6850
|
encoding: readableEncoding
|
|
@@ -6926,13 +6916,13 @@ var destroyOtherReadable = (stream, error) => {
|
|
|
6926
6916
|
};
|
|
6927
6917
|
|
|
6928
6918
|
// node_modules/execa/lib/convert/writable.js
|
|
6929
|
-
|
|
6930
|
-
|
|
6919
|
+
var import_node_stream7 = require("stream");
|
|
6920
|
+
var import_node_util10 = require("util");
|
|
6931
6921
|
var createWritable = ({ subprocess, concurrentStreams }, { to } = {}) => {
|
|
6932
6922
|
const { subprocessStdin, waitWritableFinal, waitWritableDestroy } = getSubprocessStdin(subprocess, to, concurrentStreams);
|
|
6933
|
-
const writable2 = new
|
|
6923
|
+
const writable2 = new import_node_stream7.Writable({
|
|
6934
6924
|
...getWritableMethods(subprocessStdin, subprocess, waitWritableFinal),
|
|
6935
|
-
destroy:
|
|
6925
|
+
destroy: (0, import_node_util10.callbackify)(onWritableDestroy.bind(void 0, {
|
|
6936
6926
|
subprocessStdin,
|
|
6937
6927
|
subprocess,
|
|
6938
6928
|
waitWritableFinal,
|
|
@@ -6952,7 +6942,7 @@ var getSubprocessStdin = (subprocess, to, concurrentStreams) => {
|
|
|
6952
6942
|
};
|
|
6953
6943
|
var getWritableMethods = (subprocessStdin, subprocess, waitWritableFinal) => ({
|
|
6954
6944
|
write: onWrite.bind(void 0, subprocessStdin),
|
|
6955
|
-
final:
|
|
6945
|
+
final: (0, import_node_util10.callbackify)(onWritableFinal.bind(void 0, subprocessStdin, subprocess, waitWritableFinal))
|
|
6956
6946
|
});
|
|
6957
6947
|
var onWrite = (subprocessStdin, chunk, encoding, done) => {
|
|
6958
6948
|
if (subprocessStdin.write(chunk, encoding)) {
|
|
@@ -6992,8 +6982,8 @@ var destroyOtherWritable = (stream, error) => {
|
|
|
6992
6982
|
};
|
|
6993
6983
|
|
|
6994
6984
|
// node_modules/execa/lib/convert/duplex.js
|
|
6995
|
-
|
|
6996
|
-
|
|
6985
|
+
var import_node_stream8 = require("stream");
|
|
6986
|
+
var import_node_util11 = require("util");
|
|
6997
6987
|
var createDuplex = ({ subprocess, concurrentStreams, encoding }, { from, to, binary: binaryOption = true, preserveNewlines = true } = {}) => {
|
|
6998
6988
|
const binary = binaryOption || BINARY_ENCODINGS.has(encoding);
|
|
6999
6989
|
const { subprocessStdout, waitReadableDestroy } = getSubprocessStdout(subprocess, from, concurrentStreams);
|
|
@@ -7006,10 +6996,10 @@ var createDuplex = ({ subprocess, concurrentStreams, encoding }, { from, to, bin
|
|
|
7006
6996
|
encoding,
|
|
7007
6997
|
preserveNewlines
|
|
7008
6998
|
});
|
|
7009
|
-
const duplex2 = new
|
|
6999
|
+
const duplex2 = new import_node_stream8.Duplex({
|
|
7010
7000
|
read,
|
|
7011
7001
|
...getWritableMethods(subprocessStdin, subprocess, waitWritableFinal),
|
|
7012
|
-
destroy:
|
|
7002
|
+
destroy: (0, import_node_util11.callbackify)(onDuplexDestroy.bind(void 0, {
|
|
7013
7003
|
subprocessStdout,
|
|
7014
7004
|
subprocessStdin,
|
|
7015
7005
|
subprocess,
|
|
@@ -7146,7 +7136,7 @@ var handleAsyncOptions = ({ timeout, signal, ...options }) => {
|
|
|
7146
7136
|
var spawnSubprocessAsync = ({ file, commandArguments, options, startTime, verboseInfo, command, escapedCommand, fileDescriptors }) => {
|
|
7147
7137
|
let subprocess;
|
|
7148
7138
|
try {
|
|
7149
|
-
subprocess = spawn(...concatenateShell(file, commandArguments, options));
|
|
7139
|
+
subprocess = (0, import_node_child_process5.spawn)(...concatenateShell(file, commandArguments, options));
|
|
7150
7140
|
} catch (error) {
|
|
7151
7141
|
return handleEarlyError({
|
|
7152
7142
|
error,
|
|
@@ -7159,7 +7149,7 @@ var spawnSubprocessAsync = ({ file, commandArguments, options, startTime, verbos
|
|
|
7159
7149
|
});
|
|
7160
7150
|
}
|
|
7161
7151
|
const controller = new AbortController();
|
|
7162
|
-
setMaxListeners(Number.POSITIVE_INFINITY, controller.signal);
|
|
7152
|
+
(0, import_node_events14.setMaxListeners)(Number.POSITIVE_INFINITY, controller.signal);
|
|
7163
7153
|
const originalStreams = [...subprocess.stdio];
|
|
7164
7154
|
pipeOutputAsync(subprocess, fileDescriptors, controller);
|
|
7165
7155
|
cleanupOnExit(subprocess, options, controller);
|
|
@@ -7395,8 +7385,8 @@ async function runGitDetailed(args, cwd) {
|
|
|
7395
7385
|
};
|
|
7396
7386
|
}
|
|
7397
7387
|
function normalizeRepoRelativePath(value) {
|
|
7398
|
-
const normalized =
|
|
7399
|
-
if (!normalized || normalized === "." || normalized === ".." || normalized.startsWith("../") ||
|
|
7388
|
+
const normalized = import_path2.default.posix.normalize(value.replace(/\\/g, "/").trim());
|
|
7389
|
+
if (!normalized || normalized === "." || normalized === ".." || normalized.startsWith("../") || import_path2.default.posix.isAbsolute(normalized)) {
|
|
7400
7390
|
throw new RemixError("Git returned an invalid repository-relative path.", {
|
|
7401
7391
|
exitCode: 1,
|
|
7402
7392
|
hint: `Path: ${value}`
|
|
@@ -7405,21 +7395,21 @@ function normalizeRepoRelativePath(value) {
|
|
|
7405
7395
|
return normalized;
|
|
7406
7396
|
}
|
|
7407
7397
|
function resolveRepoRelativePath(repoRoot, relativePath) {
|
|
7408
|
-
return
|
|
7398
|
+
return import_path2.default.resolve(repoRoot, ...relativePath.split("/"));
|
|
7409
7399
|
}
|
|
7410
7400
|
function isWithinRepoRoot(repoRoot, targetPath) {
|
|
7411
|
-
const relative =
|
|
7412
|
-
return relative === "" || !relative.startsWith("..") && !
|
|
7401
|
+
const relative = import_path2.default.relative(repoRoot, targetPath);
|
|
7402
|
+
return relative === "" || !relative.startsWith("..") && !import_path2.default.isAbsolute(relative);
|
|
7413
7403
|
}
|
|
7414
7404
|
function sha256Hex(value) {
|
|
7415
|
-
return createHash("sha256").update(value).digest("hex");
|
|
7405
|
+
return (0, import_crypto.createHash)("sha256").update(value).digest("hex");
|
|
7416
7406
|
}
|
|
7417
7407
|
function resolveGitReportedPath(cwd, reportedPath) {
|
|
7418
7408
|
const value = reportedPath.trim();
|
|
7419
7409
|
if (!value) {
|
|
7420
7410
|
throw new RemixError("Git returned an empty internal path.", { exitCode: 1 });
|
|
7421
7411
|
}
|
|
7422
|
-
return
|
|
7412
|
+
return import_path2.default.isAbsolute(value) ? value : import_path2.default.resolve(cwd, value);
|
|
7423
7413
|
}
|
|
7424
7414
|
function parseGitNameStatusZ(stdout) {
|
|
7425
7415
|
const tokens = stdout.split("\0");
|
|
@@ -7490,12 +7480,12 @@ function classifyGitApplyFailure(detail) {
|
|
|
7490
7480
|
return "unknown";
|
|
7491
7481
|
}
|
|
7492
7482
|
async function pruneEmptyParentDirectories(repoRoot, filePath) {
|
|
7493
|
-
let current =
|
|
7483
|
+
let current = import_path2.default.dirname(filePath);
|
|
7494
7484
|
while (current !== repoRoot && isWithinRepoRoot(repoRoot, current)) {
|
|
7495
|
-
const entries = await
|
|
7485
|
+
const entries = await import_promises13.default.readdir(current).catch(() => null);
|
|
7496
7486
|
if (!entries || entries.length > 0) return;
|
|
7497
|
-
await
|
|
7498
|
-
current =
|
|
7487
|
+
await import_promises13.default.rmdir(current).catch(() => void 0);
|
|
7488
|
+
current = import_path2.default.dirname(current);
|
|
7499
7489
|
}
|
|
7500
7490
|
}
|
|
7501
7491
|
async function findGitRoot(startDir) {
|
|
@@ -7550,8 +7540,8 @@ async function getWorkspaceSnapshot(cwd) {
|
|
|
7550
7540
|
throw new RemixError("Failed to resolve local HEAD commit.", { exitCode: 1 });
|
|
7551
7541
|
}
|
|
7552
7542
|
const includedUntrackedPaths = Array.from(new Set((await listUntrackedFiles(cwd)).map((entry) => normalizeRepoRelativePath(entry))));
|
|
7553
|
-
const tempDir = await
|
|
7554
|
-
const tempIndexPath =
|
|
7543
|
+
const tempDir = await import_promises13.default.mkdtemp(import_path2.default.join(import_os.default.tmpdir(), "remix-index-"));
|
|
7544
|
+
const tempIndexPath = import_path2.default.join(tempDir, "index");
|
|
7555
7545
|
const env = { ...process.env, GIT_INDEX_FILE: tempIndexPath };
|
|
7556
7546
|
try {
|
|
7557
7547
|
try {
|
|
@@ -7574,14 +7564,14 @@ async function getWorkspaceSnapshot(cwd) {
|
|
|
7574
7564
|
});
|
|
7575
7565
|
}
|
|
7576
7566
|
} finally {
|
|
7577
|
-
await
|
|
7567
|
+
await import_promises13.default.rm(tempDir, { recursive: true, force: true }).catch(() => void 0);
|
|
7578
7568
|
}
|
|
7579
7569
|
}
|
|
7580
7570
|
async function writeTempUnifiedDiffBackup(diff, prefix = "remix-add-backup") {
|
|
7581
7571
|
const safePrefix = prefix.replace(/[^a-zA-Z0-9._-]+/g, "-") || "remix-add-backup";
|
|
7582
|
-
const tmpDir = await
|
|
7583
|
-
const backupPath =
|
|
7584
|
-
await
|
|
7572
|
+
const tmpDir = await import_promises13.default.mkdtemp(import_path2.default.join(import_os.default.tmpdir(), `${safePrefix}-`));
|
|
7573
|
+
const backupPath = import_path2.default.join(tmpDir, "submitted.diff");
|
|
7574
|
+
await import_promises13.default.writeFile(backupPath, diff, "utf8");
|
|
7585
7575
|
return { backupPath, diffSha256: sha256Hex(diff) };
|
|
7586
7576
|
}
|
|
7587
7577
|
async function validateUnifiedDiff(cwd, diff) {
|
|
@@ -7598,7 +7588,7 @@ async function validateUnifiedDiff(cwd, diff) {
|
|
|
7598
7588
|
detail
|
|
7599
7589
|
};
|
|
7600
7590
|
} finally {
|
|
7601
|
-
await
|
|
7591
|
+
await import_promises13.default.rm(import_path2.default.dirname(backupPath), { recursive: true, force: true }).catch(() => void 0);
|
|
7602
7592
|
}
|
|
7603
7593
|
}
|
|
7604
7594
|
async function preserveWorkspaceChanges(cwd, prefix = "remix-add-preserve") {
|
|
@@ -7618,7 +7608,7 @@ async function preserveWorkspaceChanges(cwd, prefix = "remix-add-preserve") {
|
|
|
7618
7608
|
}
|
|
7619
7609
|
async function reapplyPreservedWorkspaceChanges(cwd, preserved, operation = "`remix collab add`") {
|
|
7620
7610
|
const patchFilePath = preserved.preservedDiffPath;
|
|
7621
|
-
const tempPatchHash = await
|
|
7611
|
+
const tempPatchHash = await import_promises13.default.readFile(patchFilePath, "utf8").then((content) => sha256Hex(content)).catch(() => null);
|
|
7622
7612
|
if (!tempPatchHash) {
|
|
7623
7613
|
return { status: "failed", detail: "Preserved diff artifact is missing." };
|
|
7624
7614
|
}
|
|
@@ -7750,7 +7740,7 @@ async function discardCapturedUntrackedChanges(repoRoot, capturedPaths) {
|
|
|
7750
7740
|
hint: `Path: ${relativePath}`
|
|
7751
7741
|
});
|
|
7752
7742
|
}
|
|
7753
|
-
await
|
|
7743
|
+
await import_promises13.default.rm(absolutePath, { recursive: true, force: true }).catch((err) => {
|
|
7754
7744
|
throw new RemixError("Failed to remove a captured untracked path before syncing.", {
|
|
7755
7745
|
exitCode: 1,
|
|
7756
7746
|
hint: err instanceof Error ? `${relativePath}
|
|
@@ -7826,15 +7816,15 @@ function summarizeUnifiedDiff(diff) {
|
|
|
7826
7816
|
}
|
|
7827
7817
|
|
|
7828
7818
|
// node_modules/@remixhq/core/dist/collab.js
|
|
7829
|
-
|
|
7830
|
-
|
|
7831
|
-
|
|
7832
|
-
|
|
7833
|
-
|
|
7834
|
-
|
|
7835
|
-
|
|
7836
|
-
|
|
7837
|
-
|
|
7819
|
+
var import_promises14 = __toESM(require("fs/promises"), 1);
|
|
7820
|
+
var import_path3 = __toESM(require("path"), 1);
|
|
7821
|
+
var import_crypto2 = require("crypto");
|
|
7822
|
+
var import_promises15 = __toESM(require("fs/promises"), 1);
|
|
7823
|
+
var import_os2 = __toESM(require("os"), 1);
|
|
7824
|
+
var import_path4 = __toESM(require("path"), 1);
|
|
7825
|
+
var import_promises16 = __toESM(require("fs/promises"), 1);
|
|
7826
|
+
var import_os3 = __toESM(require("os"), 1);
|
|
7827
|
+
var import_path5 = __toESM(require("path"), 1);
|
|
7838
7828
|
function describeBranch(value) {
|
|
7839
7829
|
const normalized = String(value ?? "").trim();
|
|
7840
7830
|
return normalized || "(detached)";
|
|
@@ -7878,7 +7868,7 @@ function sleep(ms) {
|
|
|
7878
7868
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
7879
7869
|
}
|
|
7880
7870
|
function buildDeterministicIdempotencyKey(parts) {
|
|
7881
|
-
return
|
|
7871
|
+
return (0, import_crypto2.createHash)("sha256").update(JSON.stringify(parts)).digest("hex");
|
|
7882
7872
|
}
|
|
7883
7873
|
function formatCliErrorDetail(err) {
|
|
7884
7874
|
if (err instanceof RemixError) {
|
|
@@ -8137,7 +8127,7 @@ function createOwner(params) {
|
|
|
8137
8127
|
operation: params.operation,
|
|
8138
8128
|
repoRoot: params.repoRoot,
|
|
8139
8129
|
pid: process.pid,
|
|
8140
|
-
hostname:
|
|
8130
|
+
hostname: import_os2.default.hostname(),
|
|
8141
8131
|
startedAt: now,
|
|
8142
8132
|
heartbeatAt: now,
|
|
8143
8133
|
version: process.version,
|
|
@@ -8145,12 +8135,12 @@ function createOwner(params) {
|
|
|
8145
8135
|
};
|
|
8146
8136
|
}
|
|
8147
8137
|
async function writeOwnerMetadata(ownerPath, owner) {
|
|
8148
|
-
await
|
|
8138
|
+
await import_promises15.default.writeFile(ownerPath, `${JSON.stringify(owner, null, 2)}
|
|
8149
8139
|
`, "utf8");
|
|
8150
8140
|
}
|
|
8151
8141
|
async function readOwnerMetadata(ownerPath) {
|
|
8152
8142
|
try {
|
|
8153
|
-
const raw = await
|
|
8143
|
+
const raw = await import_promises15.default.readFile(ownerPath, "utf8");
|
|
8154
8144
|
const parsed = JSON.parse(raw);
|
|
8155
8145
|
if (!parsed || typeof parsed !== "object") return null;
|
|
8156
8146
|
if (!parsed.operation || !parsed.repoRoot || typeof parsed.pid !== "number" || !parsed.startedAt || !parsed.heartbeatAt) {
|
|
@@ -8172,7 +8162,7 @@ async function readOwnerMetadata(ownerPath) {
|
|
|
8172
8162
|
}
|
|
8173
8163
|
async function isProcessAlive(owner) {
|
|
8174
8164
|
if (!owner) return null;
|
|
8175
|
-
if (owner.hostname !==
|
|
8165
|
+
if (owner.hostname !== import_os2.default.hostname()) return null;
|
|
8176
8166
|
try {
|
|
8177
8167
|
process.kill(owner.pid, 0);
|
|
8178
8168
|
return true;
|
|
@@ -8187,23 +8177,23 @@ async function getLastKnownUpdateMs(lockDir, ownerPath, owner) {
|
|
|
8187
8177
|
if (Number.isFinite(heartbeatMs)) return heartbeatMs;
|
|
8188
8178
|
const startedMs = owner ? Date.parse(owner.startedAt) : Number.NaN;
|
|
8189
8179
|
if (Number.isFinite(startedMs)) return startedMs;
|
|
8190
|
-
const stat = await
|
|
8180
|
+
const stat = await import_promises15.default.stat(ownerPath).catch(() => null);
|
|
8191
8181
|
if (stat) return stat.mtimeMs;
|
|
8192
|
-
const dirStat = await
|
|
8182
|
+
const dirStat = await import_promises15.default.stat(lockDir).catch(() => null);
|
|
8193
8183
|
if (dirStat) return dirStat.mtimeMs;
|
|
8194
8184
|
return 0;
|
|
8195
8185
|
}
|
|
8196
8186
|
async function ensureLockDir(lockDir) {
|
|
8197
|
-
await
|
|
8187
|
+
await import_promises15.default.mkdir(import_path4.default.dirname(lockDir), { recursive: true });
|
|
8198
8188
|
}
|
|
8199
8189
|
async function tryAcquireLock(lockDir, ownerPath, owner) {
|
|
8200
8190
|
try {
|
|
8201
8191
|
await ensureLockDir(lockDir);
|
|
8202
|
-
await
|
|
8192
|
+
await import_promises15.default.mkdir(lockDir);
|
|
8203
8193
|
try {
|
|
8204
8194
|
await writeOwnerMetadata(ownerPath, owner);
|
|
8205
8195
|
} catch (error) {
|
|
8206
|
-
await
|
|
8196
|
+
await import_promises15.default.rm(lockDir, { recursive: true, force: true }).catch(() => void 0);
|
|
8207
8197
|
throw error;
|
|
8208
8198
|
}
|
|
8209
8199
|
return true;
|
|
@@ -8252,7 +8242,7 @@ async function acquirePhysicalLock(lockDir, ownerPath, owner, options) {
|
|
|
8252
8242
|
const alive = await isProcessAlive(currentOwner2);
|
|
8253
8243
|
if (ageMs >= options.staleMs && alive !== true) {
|
|
8254
8244
|
notices.push(buildStaleRecoveryNotice(currentOwner2));
|
|
8255
|
-
await
|
|
8245
|
+
await import_promises15.default.rm(lockDir, { recursive: true, force: true }).catch(() => void 0);
|
|
8256
8246
|
continue;
|
|
8257
8247
|
}
|
|
8258
8248
|
await sleep2(RETRY_DELAY_MS);
|
|
@@ -8277,7 +8267,7 @@ function startHeartbeat(lockDir, ownerPath, owner, heartbeatMs) {
|
|
|
8277
8267
|
};
|
|
8278
8268
|
owner.heartbeatAt = nextOwner.heartbeatAt;
|
|
8279
8269
|
void writeOwnerMetadata(ownerPath, nextOwner).catch(() => void 0);
|
|
8280
|
-
void
|
|
8270
|
+
void import_promises15.default.utimes(lockDir, /* @__PURE__ */ new Date(), /* @__PURE__ */ new Date()).catch(() => void 0);
|
|
8281
8271
|
}, heartbeatMs);
|
|
8282
8272
|
}
|
|
8283
8273
|
async function releaseReentrantLock(lockDir) {
|
|
@@ -8287,12 +8277,12 @@ async function releaseReentrantLock(lockDir) {
|
|
|
8287
8277
|
if (held.count > 0) return;
|
|
8288
8278
|
clearInterval(held.heartbeatTimer);
|
|
8289
8279
|
heldLocks.delete(lockDir);
|
|
8290
|
-
await
|
|
8280
|
+
await import_promises15.default.rm(lockDir, { recursive: true, force: true }).catch(() => void 0);
|
|
8291
8281
|
}
|
|
8292
8282
|
async function withRepoMutationLock(options, fn) {
|
|
8293
8283
|
const repoRoot = await findGitRoot(options.cwd);
|
|
8294
8284
|
const gitCommonDir = await getGitCommonDir(repoRoot);
|
|
8295
|
-
const lockDir =
|
|
8285
|
+
const lockDir = import_path4.default.join(gitCommonDir, "remix", "locks", "repo-mutation.lock");
|
|
8296
8286
|
const owner = createOwner({
|
|
8297
8287
|
operation: options.operation,
|
|
8298
8288
|
repoRoot,
|
|
@@ -8304,11 +8294,11 @@ async function withRepoMutationLock(options, fn) {
|
|
|
8304
8294
|
const existing = heldLocks.get(lockDir);
|
|
8305
8295
|
let notices = [];
|
|
8306
8296
|
if (!existing) {
|
|
8307
|
-
notices = await acquirePhysicalLock(lockDir,
|
|
8297
|
+
notices = await acquirePhysicalLock(lockDir, import_path4.default.join(lockDir, "owner.json"), owner, {
|
|
8308
8298
|
acquireTimeoutMs,
|
|
8309
8299
|
staleMs
|
|
8310
8300
|
});
|
|
8311
|
-
const ownerPath =
|
|
8301
|
+
const ownerPath = import_path4.default.join(lockDir, "owner.json");
|
|
8312
8302
|
heldLocks.set(lockDir, {
|
|
8313
8303
|
count: 1,
|
|
8314
8304
|
lockDir,
|
|
@@ -8427,10 +8417,10 @@ async function collabSync(params) {
|
|
|
8427
8417
|
allowBranchMismatch: params.allowBranchMismatch,
|
|
8428
8418
|
operation: "`remix collab sync`"
|
|
8429
8419
|
});
|
|
8430
|
-
const tempDir = await
|
|
8431
|
-
const bundlePath =
|
|
8420
|
+
const tempDir = await import_promises16.default.mkdtemp(import_path5.default.join(import_os3.default.tmpdir(), "remix-sync-"));
|
|
8421
|
+
const bundlePath = import_path5.default.join(tempDir, "sync-local.bundle");
|
|
8432
8422
|
try {
|
|
8433
|
-
await
|
|
8423
|
+
await import_promises16.default.writeFile(bundlePath, Buffer.from(bundleBase64, "base64"));
|
|
8434
8424
|
await importGitBundle(lockedRepoRoot, bundlePath, bundleRef);
|
|
8435
8425
|
await ensureCommitExists(lockedRepoRoot, sync.targetCommitHash);
|
|
8436
8426
|
const localCommitHash = await fastForwardToCommit(lockedRepoRoot, sync.targetCommitHash);
|
|
@@ -8442,7 +8432,7 @@ async function collabSync(params) {
|
|
|
8442
8432
|
...warnings.length > 0 ? { warnings } : {}
|
|
8443
8433
|
};
|
|
8444
8434
|
} finally {
|
|
8445
|
-
await
|
|
8435
|
+
await import_promises16.default.rm(tempDir, { recursive: true, force: true });
|
|
8446
8436
|
}
|
|
8447
8437
|
}
|
|
8448
8438
|
);
|
|
@@ -8592,7 +8582,7 @@ async function collabAdd(params) {
|
|
|
8592
8582
|
const replayResp = await params.api.startChangeStepReplay(binding.currentAppId, {
|
|
8593
8583
|
prompt,
|
|
8594
8584
|
assistantResponse: assistantResponse ?? void 0,
|
|
8595
|
-
diff: await
|
|
8585
|
+
diff: await import_promises14.default.readFile(preserved.preservedDiffPath, "utf8"),
|
|
8596
8586
|
baseCommitHash: preserved.baseHeadCommitHash,
|
|
8597
8587
|
targetHeadCommitHash: headCommitHash,
|
|
8598
8588
|
expectedPaths: preserved.stagePlan.expectedPaths,
|
|
@@ -8724,7 +8714,7 @@ async function collabAdd(params) {
|
|
|
8724
8714
|
dryRun: false,
|
|
8725
8715
|
allowBranchMismatch: params.allowBranchMismatch
|
|
8726
8716
|
});
|
|
8727
|
-
await
|
|
8717
|
+
await import_promises14.default.rm(import_path3.default.dirname(backupPath), { recursive: true, force: true }).catch(() => void 0);
|
|
8728
8718
|
} catch (err) {
|
|
8729
8719
|
const detail = formatCliErrorDetail(err);
|
|
8730
8720
|
const hint = [
|
|
@@ -13193,9 +13183,9 @@ var coerce = {
|
|
|
13193
13183
|
var NEVER = INVALID;
|
|
13194
13184
|
|
|
13195
13185
|
// node_modules/@remixhq/core/dist/chunk-EVWDYCBL.js
|
|
13196
|
-
|
|
13197
|
-
|
|
13198
|
-
|
|
13186
|
+
var import_promises17 = __toESM(require("fs/promises"), 1);
|
|
13187
|
+
var import_os4 = __toESM(require("os"), 1);
|
|
13188
|
+
var import_path6 = __toESM(require("path"), 1);
|
|
13199
13189
|
|
|
13200
13190
|
// node_modules/tslib/tslib.es6.mjs
|
|
13201
13191
|
function __rest(s, e) {
|
|
@@ -32854,7 +32844,7 @@ var storedSessionSchema = external_exports.object({
|
|
|
32854
32844
|
function xdgConfigHome() {
|
|
32855
32845
|
const value = process.env.XDG_CONFIG_HOME;
|
|
32856
32846
|
if (typeof value === "string" && value.trim()) return value;
|
|
32857
|
-
return
|
|
32847
|
+
return import_path6.default.join(import_os4.default.homedir(), ".config");
|
|
32858
32848
|
}
|
|
32859
32849
|
async function maybeLoadKeytar() {
|
|
32860
32850
|
try {
|
|
@@ -32872,22 +32862,22 @@ async function maybeLoadKeytar() {
|
|
|
32872
32862
|
return null;
|
|
32873
32863
|
}
|
|
32874
32864
|
async function ensurePathPermissions(filePath) {
|
|
32875
|
-
const dir =
|
|
32876
|
-
await
|
|
32865
|
+
const dir = import_path6.default.dirname(filePath);
|
|
32866
|
+
await import_promises17.default.mkdir(dir, { recursive: true });
|
|
32877
32867
|
try {
|
|
32878
|
-
await
|
|
32868
|
+
await import_promises17.default.chmod(dir, 448);
|
|
32879
32869
|
} catch {
|
|
32880
32870
|
}
|
|
32881
32871
|
try {
|
|
32882
|
-
await
|
|
32872
|
+
await import_promises17.default.chmod(filePath, 384);
|
|
32883
32873
|
} catch {
|
|
32884
32874
|
}
|
|
32885
32875
|
}
|
|
32886
32876
|
async function writeJsonAtomic(filePath, value) {
|
|
32887
|
-
await
|
|
32877
|
+
await import_promises17.default.mkdir(import_path6.default.dirname(filePath), { recursive: true });
|
|
32888
32878
|
const tmpPath = `${filePath}.tmp-${Date.now()}-${Math.random().toString(16).slice(2)}`;
|
|
32889
|
-
await
|
|
32890
|
-
await
|
|
32879
|
+
await import_promises17.default.writeFile(tmpPath, JSON.stringify(value, null, 2) + "\n", "utf8");
|
|
32880
|
+
await import_promises17.default.rename(tmpPath, filePath);
|
|
32891
32881
|
}
|
|
32892
32882
|
async function writeSessionFileFallback(filePath, session) {
|
|
32893
32883
|
await writeJsonAtomic(filePath, session);
|
|
@@ -32896,7 +32886,7 @@ async function writeSessionFileFallback(filePath, session) {
|
|
|
32896
32886
|
function createLocalSessionStore(params) {
|
|
32897
32887
|
const service = params?.service?.trim() || "remix-cli";
|
|
32898
32888
|
const account = params?.account?.trim() || "default";
|
|
32899
|
-
const filePath = params?.filePath?.trim() ||
|
|
32889
|
+
const filePath = params?.filePath?.trim() || import_path6.default.join(xdgConfigHome(), "remix", "session.json");
|
|
32900
32890
|
return {
|
|
32901
32891
|
async getSession() {
|
|
32902
32892
|
const keytar = await maybeLoadKeytar();
|
|
@@ -32910,7 +32900,7 @@ function createLocalSessionStore(params) {
|
|
|
32910
32900
|
return null;
|
|
32911
32901
|
}
|
|
32912
32902
|
}
|
|
32913
|
-
const raw = await
|
|
32903
|
+
const raw = await import_promises17.default.readFile(filePath, "utf8").catch(() => null);
|
|
32914
32904
|
if (!raw) return null;
|
|
32915
32905
|
try {
|
|
32916
32906
|
const parsed = storedSessionSchema.safeParse(JSON.parse(raw));
|
|
@@ -33096,27 +33086,27 @@ async function createHookCollabApiClient() {
|
|
|
33096
33086
|
}
|
|
33097
33087
|
|
|
33098
33088
|
// src/hook-state.ts
|
|
33099
|
-
|
|
33100
|
-
|
|
33101
|
-
|
|
33102
|
-
|
|
33089
|
+
var import_promises18 = __toESM(require("fs/promises"), 1);
|
|
33090
|
+
var import_node_os4 = __toESM(require("os"), 1);
|
|
33091
|
+
var import_node_path6 = __toESM(require("path"), 1);
|
|
33092
|
+
var import_node_crypto = require("crypto");
|
|
33103
33093
|
function stateRoot() {
|
|
33104
|
-
return
|
|
33094
|
+
return import_node_path6.default.join(import_node_os4.default.tmpdir(), "remix-claude-plugin-hooks");
|
|
33105
33095
|
}
|
|
33106
33096
|
function statePath(sessionId) {
|
|
33107
|
-
return
|
|
33097
|
+
return import_node_path6.default.join(stateRoot(), `${sessionId}.json`);
|
|
33108
33098
|
}
|
|
33109
33099
|
function stateLockPath(sessionId) {
|
|
33110
|
-
return
|
|
33100
|
+
return import_node_path6.default.join(stateRoot(), `${sessionId}.lock`);
|
|
33111
33101
|
}
|
|
33112
33102
|
function stateLockMetaPath(sessionId) {
|
|
33113
|
-
return
|
|
33103
|
+
return import_node_path6.default.join(stateLockPath(sessionId), "owner.json");
|
|
33114
33104
|
}
|
|
33115
33105
|
async function writeJsonAtomic2(filePath, value) {
|
|
33116
|
-
await
|
|
33106
|
+
await import_promises18.default.mkdir(import_node_path6.default.dirname(filePath), { recursive: true });
|
|
33117
33107
|
const tmpPath = `${filePath}.tmp-${Date.now()}-${Math.random().toString(16).slice(2)}`;
|
|
33118
|
-
await
|
|
33119
|
-
await
|
|
33108
|
+
await import_promises18.default.writeFile(tmpPath, JSON.stringify(value, null, 2) + "\n", "utf8");
|
|
33109
|
+
await import_promises18.default.rename(tmpPath, filePath);
|
|
33120
33110
|
}
|
|
33121
33111
|
var STATE_LOCK_WAIT_MS = 2e3;
|
|
33122
33112
|
var STATE_LOCK_POLL_MS = 25;
|
|
@@ -33126,7 +33116,7 @@ async function sleep4(ms) {
|
|
|
33126
33116
|
await new Promise((resolve) => setTimeout(resolve, ms));
|
|
33127
33117
|
}
|
|
33128
33118
|
async function readStateLockMetadata(sessionId) {
|
|
33129
|
-
const raw = await
|
|
33119
|
+
const raw = await import_promises18.default.readFile(stateLockMetaPath(sessionId), "utf8").catch(() => null);
|
|
33130
33120
|
if (!raw) return null;
|
|
33131
33121
|
try {
|
|
33132
33122
|
const parsed = JSON.parse(raw);
|
|
@@ -33151,13 +33141,13 @@ async function tryRemoveStaleStateLock(sessionId) {
|
|
|
33151
33141
|
const metadata = await readStateLockMetadata(sessionId);
|
|
33152
33142
|
const staleByHeartbeat = metadata && Date.now() - new Date(metadata.heartbeatAt).getTime() > STATE_LOCK_STALE_MS;
|
|
33153
33143
|
if (staleByHeartbeat) {
|
|
33154
|
-
await
|
|
33144
|
+
await import_promises18.default.rm(lockPath, { recursive: true, force: true }).catch(() => void 0);
|
|
33155
33145
|
return true;
|
|
33156
33146
|
}
|
|
33157
33147
|
if (!metadata) {
|
|
33158
|
-
const lockStat = await
|
|
33148
|
+
const lockStat = await import_promises18.default.stat(lockPath).catch(() => null);
|
|
33159
33149
|
if (lockStat && Date.now() - lockStat.mtimeMs > STATE_LOCK_STALE_MS) {
|
|
33160
|
-
await
|
|
33150
|
+
await import_promises18.default.rm(lockPath, { recursive: true, force: true }).catch(() => void 0);
|
|
33161
33151
|
return true;
|
|
33162
33152
|
}
|
|
33163
33153
|
}
|
|
@@ -33168,8 +33158,8 @@ async function acquireStateLock(sessionId) {
|
|
|
33168
33158
|
const deadline = Date.now() + STATE_LOCK_WAIT_MS;
|
|
33169
33159
|
while (true) {
|
|
33170
33160
|
try {
|
|
33171
|
-
await
|
|
33172
|
-
const ownerId = randomUUID();
|
|
33161
|
+
await import_promises18.default.mkdir(lockPath);
|
|
33162
|
+
const ownerId = (0, import_node_crypto.randomUUID)();
|
|
33173
33163
|
const createdAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
33174
33164
|
const metadata = {
|
|
33175
33165
|
ownerId,
|
|
@@ -33193,7 +33183,7 @@ async function acquireStateLock(sessionId) {
|
|
|
33193
33183
|
clearInterval(heartbeat);
|
|
33194
33184
|
const currentMetadata = await readStateLockMetadata(sessionId);
|
|
33195
33185
|
if (currentMetadata?.ownerId === ownerId) {
|
|
33196
|
-
await
|
|
33186
|
+
await import_promises18.default.rm(lockPath, { recursive: true, force: true }).catch(() => void 0);
|
|
33197
33187
|
}
|
|
33198
33188
|
};
|
|
33199
33189
|
} catch (error) {
|
|
@@ -33251,6 +33241,8 @@ function normalizeTouchedRepo(value, repoRoot) {
|
|
|
33251
33241
|
manuallyRecorded: Boolean(parsed.manuallyRecorded),
|
|
33252
33242
|
manuallyRecordedAt: normalizeString(parsed.manuallyRecordedAt),
|
|
33253
33243
|
manuallyRecordedByTool: normalizeString(parsed.manuallyRecordedByTool),
|
|
33244
|
+
manualRecordingScope: parsed.manualRecordingScope === "change_step" || parsed.manualRecordingScope === "full_turn" ? parsed.manualRecordingScope : null,
|
|
33245
|
+
manualRemoteChangeRecordedAt: normalizeString(parsed.manualRemoteChangeRecordedAt),
|
|
33254
33246
|
stopAttempted: Boolean(parsed.stopAttempted),
|
|
33255
33247
|
stopRecorded: Boolean(parsed.stopRecorded),
|
|
33256
33248
|
stopRecordedAt: normalizeString(parsed.stopRecordedAt),
|
|
@@ -33265,6 +33257,33 @@ function normalizeTouchedRepos(value) {
|
|
|
33265
33257
|
const entries = Object.entries(value).map(([repoRoot, repo]) => normalizeTouchedRepo(repo, repoRoot)).filter((repo) => repo !== null).sort((a2, b) => a2.repoRoot.localeCompare(b.repoRoot));
|
|
33266
33258
|
return Object.fromEntries(entries.map((repo) => [repo.repoRoot, repo]));
|
|
33267
33259
|
}
|
|
33260
|
+
function createTouchedRepo(params) {
|
|
33261
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
33262
|
+
const touchedBy = params.touchedBy?.trim() ? [params.touchedBy.trim()] : [];
|
|
33263
|
+
return {
|
|
33264
|
+
repoRoot: params.repoRoot,
|
|
33265
|
+
projectId: normalizeString(params.projectId),
|
|
33266
|
+
currentAppId: normalizeString(params.currentAppId),
|
|
33267
|
+
upstreamAppId: normalizeString(params.upstreamAppId),
|
|
33268
|
+
firstTouchedAt: now,
|
|
33269
|
+
lastTouchedAt: now,
|
|
33270
|
+
lastObservedWriteAt: params.hasObservedWrite ? now : null,
|
|
33271
|
+
touchedBy,
|
|
33272
|
+
hasObservedWrite: Boolean(params.hasObservedWrite),
|
|
33273
|
+
manuallyRecorded: false,
|
|
33274
|
+
manuallyRecordedAt: null,
|
|
33275
|
+
manuallyRecordedByTool: null,
|
|
33276
|
+
manualRecordingScope: null,
|
|
33277
|
+
manualRemoteChangeRecordedAt: null,
|
|
33278
|
+
stopAttempted: false,
|
|
33279
|
+
stopRecorded: false,
|
|
33280
|
+
stopRecordedAt: null,
|
|
33281
|
+
stopRecordedMode: null,
|
|
33282
|
+
recordingFailureMessage: null,
|
|
33283
|
+
recordingFailureHint: null,
|
|
33284
|
+
recordingFailedAt: null
|
|
33285
|
+
};
|
|
33286
|
+
}
|
|
33268
33287
|
async function updatePendingTurnState(sessionId, updater) {
|
|
33269
33288
|
return withStateLock(sessionId, async () => {
|
|
33270
33289
|
const existing = await loadPendingTurnState(sessionId);
|
|
@@ -33276,7 +33295,7 @@ async function updatePendingTurnState(sessionId, updater) {
|
|
|
33276
33295
|
});
|
|
33277
33296
|
}
|
|
33278
33297
|
async function loadPendingTurnState(sessionId) {
|
|
33279
|
-
const raw = await
|
|
33298
|
+
const raw = await import_promises18.default.readFile(statePath(sessionId), "utf8").catch(() => null);
|
|
33280
33299
|
if (!raw) return null;
|
|
33281
33300
|
try {
|
|
33282
33301
|
const parsed = JSON.parse(raw);
|
|
@@ -33304,6 +33323,33 @@ async function loadPendingTurnState(sessionId) {
|
|
|
33304
33323
|
async function savePendingTurnState(state) {
|
|
33305
33324
|
await writeJsonAtomic2(statePath(state.sessionId), state);
|
|
33306
33325
|
}
|
|
33326
|
+
async function upsertTouchedRepo(sessionId, params) {
|
|
33327
|
+
const normalizedRepoRoot = params.repoRoot.trim();
|
|
33328
|
+
if (!normalizedRepoRoot) return null;
|
|
33329
|
+
const state = await updatePendingTurnState(sessionId, (existing) => {
|
|
33330
|
+
const current = existing.touchedRepos[normalizedRepoRoot] ?? createTouchedRepo({
|
|
33331
|
+
repoRoot: normalizedRepoRoot,
|
|
33332
|
+
projectId: params.projectId,
|
|
33333
|
+
currentAppId: params.currentAppId,
|
|
33334
|
+
upstreamAppId: params.upstreamAppId,
|
|
33335
|
+
touchedBy: params.touchedBy,
|
|
33336
|
+
hasObservedWrite: params.hasObservedWrite
|
|
33337
|
+
});
|
|
33338
|
+
current.projectId = normalizeString(params.projectId) ?? current.projectId;
|
|
33339
|
+
current.currentAppId = normalizeString(params.currentAppId) ?? current.currentAppId;
|
|
33340
|
+
current.upstreamAppId = normalizeString(params.upstreamAppId) ?? current.upstreamAppId;
|
|
33341
|
+
current.lastTouchedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
33342
|
+
if (params.touchedBy?.trim() && !current.touchedBy.includes(params.touchedBy.trim())) {
|
|
33343
|
+
current.touchedBy = [...current.touchedBy, params.touchedBy.trim()].sort((a2, b) => a2.localeCompare(b));
|
|
33344
|
+
}
|
|
33345
|
+
if (params.hasObservedWrite) {
|
|
33346
|
+
current.hasObservedWrite = true;
|
|
33347
|
+
current.lastObservedWriteAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
33348
|
+
}
|
|
33349
|
+
existing.touchedRepos[normalizedRepoRoot] = current;
|
|
33350
|
+
});
|
|
33351
|
+
return state?.touchedRepos[normalizedRepoRoot] ?? null;
|
|
33352
|
+
}
|
|
33307
33353
|
async function markTouchedRepoStopAttempted(sessionId, repoRoot) {
|
|
33308
33354
|
await updatePendingTurnState(sessionId, (existing) => {
|
|
33309
33355
|
const current = existing.touchedRepos[repoRoot];
|
|
@@ -33351,25 +33397,67 @@ async function listTouchedRepos(sessionId) {
|
|
|
33351
33397
|
}
|
|
33352
33398
|
async function clearPendingTurnState(sessionId) {
|
|
33353
33399
|
await withStateLock(sessionId, async () => {
|
|
33354
|
-
await
|
|
33400
|
+
await import_promises18.default.rm(statePath(sessionId), { force: true }).catch(() => void 0);
|
|
33355
33401
|
});
|
|
33356
33402
|
}
|
|
33357
33403
|
|
|
33404
|
+
// package.json
|
|
33405
|
+
var package_default = {
|
|
33406
|
+
name: "@remixhq/claude-plugin",
|
|
33407
|
+
version: "0.1.10",
|
|
33408
|
+
description: "Claude Code plugin for Remix collaboration workflows",
|
|
33409
|
+
homepage: "https://github.com/RemixDotOne/remix-claude-plugin",
|
|
33410
|
+
license: "MIT",
|
|
33411
|
+
repository: {
|
|
33412
|
+
type: "git",
|
|
33413
|
+
url: "https://github.com/RemixDotOne/remix-claude-plugin.git"
|
|
33414
|
+
},
|
|
33415
|
+
type: "module",
|
|
33416
|
+
engines: {
|
|
33417
|
+
node: ">=20"
|
|
33418
|
+
},
|
|
33419
|
+
publishConfig: {
|
|
33420
|
+
access: "public"
|
|
33421
|
+
},
|
|
33422
|
+
files: [
|
|
33423
|
+
"dist",
|
|
33424
|
+
".claude-plugin/plugin.json",
|
|
33425
|
+
".mcp.json",
|
|
33426
|
+
"skills",
|
|
33427
|
+
"hooks",
|
|
33428
|
+
"agents"
|
|
33429
|
+
],
|
|
33430
|
+
scripts: {
|
|
33431
|
+
build: "tsup",
|
|
33432
|
+
postbuild: `node -e "const fs=require('node:fs'); for (const p of ['dist/mcp-server.cjs','dist/hook-pre-git.cjs','dist/hook-user-prompt.cjs','dist/hook-post-collab.cjs','dist/hook-stop-collab.cjs']) fs.chmodSync(p, 0o755);"`,
|
|
33433
|
+
dev: "tsx src/mcp-server.ts",
|
|
33434
|
+
typecheck: "tsc -p tsconfig.json --noEmit",
|
|
33435
|
+
prepack: "npm run build"
|
|
33436
|
+
},
|
|
33437
|
+
dependencies: {
|
|
33438
|
+
"@remixhq/core": "^0.1.7",
|
|
33439
|
+
"@remixhq/mcp": "^0.1.7"
|
|
33440
|
+
},
|
|
33441
|
+
devDependencies: {
|
|
33442
|
+
"@types/node": "^25.4.0",
|
|
33443
|
+
tsup: "^8.5.1",
|
|
33444
|
+
tsx: "^4.21.0",
|
|
33445
|
+
typescript: "^5.9.3"
|
|
33446
|
+
}
|
|
33447
|
+
};
|
|
33448
|
+
|
|
33358
33449
|
// src/metadata.ts
|
|
33359
|
-
import { createRequire } from "module";
|
|
33360
|
-
var require2 = createRequire(import.meta.url);
|
|
33361
|
-
var pkg = require2("../package.json");
|
|
33362
33450
|
var pluginMetadata = {
|
|
33363
|
-
name:
|
|
33364
|
-
version:
|
|
33365
|
-
description:
|
|
33451
|
+
name: package_default.name,
|
|
33452
|
+
version: package_default.version,
|
|
33453
|
+
description: package_default.description,
|
|
33366
33454
|
pluginId: "remix",
|
|
33367
33455
|
agentName: "remix-collab"
|
|
33368
33456
|
};
|
|
33369
33457
|
|
|
33370
33458
|
// src/hook-utils.ts
|
|
33371
|
-
|
|
33372
|
-
|
|
33459
|
+
var import_promises19 = __toESM(require("fs/promises"), 1);
|
|
33460
|
+
var import_node_path7 = __toESM(require("path"), 1);
|
|
33373
33461
|
async function readJsonStdin() {
|
|
33374
33462
|
const chunks = [];
|
|
33375
33463
|
for await (const chunk of process.stdin) {
|
|
@@ -33384,6 +33472,28 @@ async function readJsonStdin() {
|
|
|
33384
33472
|
return {};
|
|
33385
33473
|
}
|
|
33386
33474
|
}
|
|
33475
|
+
function getNestedRecord(value) {
|
|
33476
|
+
return value && typeof value === "object" ? value : null;
|
|
33477
|
+
}
|
|
33478
|
+
function extractToolInput(payload) {
|
|
33479
|
+
return getNestedRecord(payload.tool_input) ?? getNestedRecord(payload.toolInput) ?? payload;
|
|
33480
|
+
}
|
|
33481
|
+
function extractToolResponse(payload) {
|
|
33482
|
+
return getNestedRecord(payload.tool_response) ?? getNestedRecord(payload.toolResponse);
|
|
33483
|
+
}
|
|
33484
|
+
function extractAssistantResponse(payload) {
|
|
33485
|
+
const candidateKeys = [
|
|
33486
|
+
"last_assistant_message",
|
|
33487
|
+
"lastAssistantMessage",
|
|
33488
|
+
"assistant_response",
|
|
33489
|
+
"assistantResponse",
|
|
33490
|
+
"assistant_message",
|
|
33491
|
+
"assistantMessage",
|
|
33492
|
+
"response",
|
|
33493
|
+
"message"
|
|
33494
|
+
];
|
|
33495
|
+
return extractString(payload, candidateKeys) ?? extractString(extractToolResponse(payload) ?? {}, candidateKeys) ?? extractString(extractToolInput(payload), candidateKeys);
|
|
33496
|
+
}
|
|
33387
33497
|
function extractString(input, keys) {
|
|
33388
33498
|
for (const key of keys) {
|
|
33389
33499
|
const value = input[key];
|
|
@@ -33402,6 +33512,34 @@ function extractBoolean(input, keys) {
|
|
|
33402
33512
|
}
|
|
33403
33513
|
return null;
|
|
33404
33514
|
}
|
|
33515
|
+
async function findBoundRepo(startPath) {
|
|
33516
|
+
if (!startPath) return null;
|
|
33517
|
+
let current = import_node_path7.default.resolve(startPath);
|
|
33518
|
+
let stats = await import_promises19.default.stat(current).catch(() => null);
|
|
33519
|
+
if (stats?.isFile()) {
|
|
33520
|
+
current = import_node_path7.default.dirname(current);
|
|
33521
|
+
}
|
|
33522
|
+
while (true) {
|
|
33523
|
+
const bindingPath = import_node_path7.default.join(current, ".remix", "config.json");
|
|
33524
|
+
const bindingStats = await import_promises19.default.stat(bindingPath).catch(() => null);
|
|
33525
|
+
if (bindingStats?.isFile()) return current;
|
|
33526
|
+
const parent = import_node_path7.default.dirname(current);
|
|
33527
|
+
if (parent === current) return null;
|
|
33528
|
+
current = parent;
|
|
33529
|
+
}
|
|
33530
|
+
}
|
|
33531
|
+
async function resolveBoundRepoSummary(startPath) {
|
|
33532
|
+
const repoRoot = await findBoundRepo(startPath);
|
|
33533
|
+
if (!repoRoot) return null;
|
|
33534
|
+
const binding = await readCollabBinding(repoRoot).catch(() => null);
|
|
33535
|
+
if (!binding) return null;
|
|
33536
|
+
return {
|
|
33537
|
+
repoRoot,
|
|
33538
|
+
projectId: binding.projectId,
|
|
33539
|
+
currentAppId: binding.currentAppId,
|
|
33540
|
+
upstreamAppId: binding.upstreamAppId
|
|
33541
|
+
};
|
|
33542
|
+
}
|
|
33405
33543
|
|
|
33406
33544
|
// src/hook-stop-collab.ts
|
|
33407
33545
|
var HOOK_ACTOR = {
|
|
@@ -33468,6 +33606,9 @@ function shouldSkipStopRecording(repo) {
|
|
|
33468
33606
|
if (!repo.manuallyRecorded) {
|
|
33469
33607
|
return false;
|
|
33470
33608
|
}
|
|
33609
|
+
if (repo.manualRecordingScope !== "full_turn") {
|
|
33610
|
+
return false;
|
|
33611
|
+
}
|
|
33471
33612
|
if (!repo.manuallyRecordedAt) {
|
|
33472
33613
|
return false;
|
|
33473
33614
|
}
|
|
@@ -33476,6 +33617,38 @@ function shouldSkipStopRecording(repo) {
|
|
|
33476
33617
|
}
|
|
33477
33618
|
return new Date(repo.lastObservedWriteAt).getTime() <= new Date(repo.manuallyRecordedAt).getTime();
|
|
33478
33619
|
}
|
|
33620
|
+
function hasNewObservedWriteSince(timestamp, repo) {
|
|
33621
|
+
if (!repo.lastObservedWriteAt) {
|
|
33622
|
+
return false;
|
|
33623
|
+
}
|
|
33624
|
+
return new Date(repo.lastObservedWriteAt).getTime() > new Date(timestamp).getTime();
|
|
33625
|
+
}
|
|
33626
|
+
function createFallbackTouchedRepo(params) {
|
|
33627
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
33628
|
+
return {
|
|
33629
|
+
repoRoot: params.repoRoot,
|
|
33630
|
+
projectId: params.projectId,
|
|
33631
|
+
currentAppId: params.currentAppId,
|
|
33632
|
+
upstreamAppId: params.upstreamAppId,
|
|
33633
|
+
firstTouchedAt: now,
|
|
33634
|
+
lastTouchedAt: now,
|
|
33635
|
+
lastObservedWriteAt: null,
|
|
33636
|
+
touchedBy: ["Stop:fallback-bound-repo"],
|
|
33637
|
+
hasObservedWrite: false,
|
|
33638
|
+
manuallyRecorded: false,
|
|
33639
|
+
manuallyRecordedAt: null,
|
|
33640
|
+
manuallyRecordedByTool: null,
|
|
33641
|
+
manualRecordingScope: null,
|
|
33642
|
+
manualRemoteChangeRecordedAt: null,
|
|
33643
|
+
stopAttempted: false,
|
|
33644
|
+
stopRecorded: false,
|
|
33645
|
+
stopRecordedAt: null,
|
|
33646
|
+
stopRecordedMode: null,
|
|
33647
|
+
recordingFailureMessage: null,
|
|
33648
|
+
recordingFailureHint: null,
|
|
33649
|
+
recordingFailedAt: null
|
|
33650
|
+
};
|
|
33651
|
+
}
|
|
33479
33652
|
async function recordTouchedRepo(params) {
|
|
33480
33653
|
const { sessionId, turnId, repo, prompt, assistantResponse, api } = params;
|
|
33481
33654
|
await markTouchedRepoStopAttempted(sessionId, repo.repoRoot);
|
|
@@ -33488,17 +33661,21 @@ async function recordTouchedRepo(params) {
|
|
|
33488
33661
|
});
|
|
33489
33662
|
return false;
|
|
33490
33663
|
}
|
|
33491
|
-
const recordingPreflight = await collabRecordingPreflight({
|
|
33492
|
-
api,
|
|
33493
|
-
cwd: repo.repoRoot
|
|
33494
|
-
});
|
|
33495
|
-
const blocked = getRecordingBlockedMessage(recordingPreflight, repo.repoRoot);
|
|
33496
|
-
if (blocked) {
|
|
33497
|
-
await markTouchedRepoRecordingFailure(sessionId, repo.repoRoot, blocked);
|
|
33498
|
-
return false;
|
|
33499
|
-
}
|
|
33500
33664
|
const workspaceDiff = await getWorkspaceDiff(repo.repoRoot);
|
|
33501
33665
|
if (workspaceDiff.diff.trim()) {
|
|
33666
|
+
if (repo.manualRemoteChangeRecordedAt && !hasNewObservedWriteSince(repo.manualRemoteChangeRecordedAt, repo)) {
|
|
33667
|
+
await markTouchedRepoStopRecorded(sessionId, repo.repoRoot, { mode: "changed_turn" });
|
|
33668
|
+
return true;
|
|
33669
|
+
}
|
|
33670
|
+
const recordingPreflight2 = await collabRecordingPreflight({
|
|
33671
|
+
api,
|
|
33672
|
+
cwd: repo.repoRoot
|
|
33673
|
+
});
|
|
33674
|
+
const blocked2 = getRecordingBlockedMessage(recordingPreflight2, repo.repoRoot);
|
|
33675
|
+
if (blocked2) {
|
|
33676
|
+
await markTouchedRepoRecordingFailure(sessionId, repo.repoRoot, blocked2);
|
|
33677
|
+
return false;
|
|
33678
|
+
}
|
|
33502
33679
|
await collabAdd({
|
|
33503
33680
|
api,
|
|
33504
33681
|
cwd: repo.repoRoot,
|
|
@@ -33511,6 +33688,15 @@ async function recordTouchedRepo(params) {
|
|
|
33511
33688
|
await markTouchedRepoStopRecorded(sessionId, repo.repoRoot, { mode: "changed_turn" });
|
|
33512
33689
|
return true;
|
|
33513
33690
|
}
|
|
33691
|
+
const recordingPreflight = await collabRecordingPreflight({
|
|
33692
|
+
api,
|
|
33693
|
+
cwd: repo.repoRoot
|
|
33694
|
+
});
|
|
33695
|
+
const blocked = getRecordingBlockedMessage(recordingPreflight, repo.repoRoot);
|
|
33696
|
+
if (blocked) {
|
|
33697
|
+
await markTouchedRepoRecordingFailure(sessionId, repo.repoRoot, blocked);
|
|
33698
|
+
return false;
|
|
33699
|
+
}
|
|
33514
33700
|
await collabRecordTurn({
|
|
33515
33701
|
api,
|
|
33516
33702
|
cwd: repo.repoRoot,
|
|
@@ -33541,13 +33727,28 @@ async function main() {
|
|
|
33541
33727
|
return;
|
|
33542
33728
|
}
|
|
33543
33729
|
try {
|
|
33544
|
-
|
|
33730
|
+
let touchedRepos = await listTouchedRepos(sessionId);
|
|
33545
33731
|
if (touchedRepos.length === 0) {
|
|
33546
|
-
await
|
|
33547
|
-
|
|
33732
|
+
const fallbackRepo = await resolveBoundRepoSummary(state.initialCwd);
|
|
33733
|
+
if (!fallbackRepo) {
|
|
33734
|
+
await clearPendingTurnState(sessionId);
|
|
33735
|
+
return;
|
|
33736
|
+
}
|
|
33737
|
+
await upsertTouchedRepo(sessionId, {
|
|
33738
|
+
repoRoot: fallbackRepo.repoRoot,
|
|
33739
|
+
projectId: fallbackRepo.projectId,
|
|
33740
|
+
currentAppId: fallbackRepo.currentAppId,
|
|
33741
|
+
upstreamAppId: fallbackRepo.upstreamAppId,
|
|
33742
|
+
touchedBy: "Stop:fallback-bound-repo",
|
|
33743
|
+
hasObservedWrite: false
|
|
33744
|
+
});
|
|
33745
|
+
touchedRepos = await listTouchedRepos(sessionId);
|
|
33746
|
+
if (touchedRepos.length === 0) {
|
|
33747
|
+
touchedRepos = [createFallbackTouchedRepo(fallbackRepo)];
|
|
33748
|
+
}
|
|
33548
33749
|
}
|
|
33549
33750
|
const prompt = state.prompt.trim();
|
|
33550
|
-
const assistantResponse = (
|
|
33751
|
+
const assistantResponse = (extractAssistantResponse(payload) || "").trim();
|
|
33551
33752
|
if (!prompt || !assistantResponse) {
|
|
33552
33753
|
await markPendingTurnFailure(sessionId, {
|
|
33553
33754
|
message: "Automatic Remix turn recording failed because the prompt or assistant response was missing."
|
|
@@ -33586,4 +33787,4 @@ main().catch((error) => {
|
|
|
33586
33787
|
`);
|
|
33587
33788
|
process.exitCode = 0;
|
|
33588
33789
|
});
|
|
33589
|
-
//# sourceMappingURL=hook-stop-collab.
|
|
33790
|
+
//# sourceMappingURL=hook-stop-collab.cjs.map
|