@swmansion/argent 0.35.1-next.80 → 0.35.1-next.81
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/bin/argent-android-devtools-0.4.0.apk +0 -0
- package/bin/darwin/argent-macos-helper +0 -0
- package/bin/darwin/ax-service +0 -0
- package/bin/darwin/tvos-ax-service +0 -0
- package/bin/darwin/tvos-hid-daemon +0 -0
- package/bin/network-inspector/network-inspector.jar +0 -0
- package/bin/tcp/ax-service +0 -0
- package/dist/cli-cmds.mjs +345 -307
- package/dist/client.js +121 -88
- package/dist/installer.mjs +306 -271
- package/dist/mcp-server.mjs +196 -163
- package/dist/tool-server.cjs +609 -580
- package/dylibs/libArgentAudio.dylib +0 -0
- package/dylibs/libArgentInjectionBootstrap.dylib +0 -0
- package/dylibs/libKeyboardPatch.dylib +0 -0
- package/dylibs/libNativeDevtoolsIos.dylib +0 -0
- package/dylibs/macos/libArgentInjectionBootstrap.dylib +0 -0
- package/dylibs/macos/libNativeDevtoolsMacos.dylib +0 -0
- package/dylibs/tcp/argent-audio-feeder +0 -0
- package/dylibs/tcp/libArgentAudio.dylib +0 -0
- package/dylibs/tcp/libArgentInjectionBootstrap.dylib +0 -0
- package/dylibs/tcp/libKeyboardPatch.dylib +0 -0
- package/dylibs/tcp/libNativeDevtoolsIos.dylib +0 -0
- package/dylibs/tvos/libArgentInjectionBootstrap.dylib +0 -0
- package/dylibs/tvos/libKeyboardPatch.dylib +0 -0
- package/dylibs/tvos/libNativeDevtoolsIos.dylib +0 -0
- package/package.json +2 -2
package/dist/mcp-server.mjs
CHANGED
|
@@ -416,11 +416,11 @@ var require_codegen = __commonJS({
|
|
|
416
416
|
const rhs = this.rhs === void 0 ? "" : ` = ${this.rhs}`;
|
|
417
417
|
return `${varKind} ${this.name}${rhs};` + _n;
|
|
418
418
|
}
|
|
419
|
-
optimizeNames(names,
|
|
419
|
+
optimizeNames(names, constants4) {
|
|
420
420
|
if (!names[this.name.str])
|
|
421
421
|
return;
|
|
422
422
|
if (this.rhs)
|
|
423
|
-
this.rhs = optimizeExpr(this.rhs, names,
|
|
423
|
+
this.rhs = optimizeExpr(this.rhs, names, constants4);
|
|
424
424
|
return this;
|
|
425
425
|
}
|
|
426
426
|
get names() {
|
|
@@ -437,10 +437,10 @@ var require_codegen = __commonJS({
|
|
|
437
437
|
render({ _n }) {
|
|
438
438
|
return `${this.lhs} = ${this.rhs};` + _n;
|
|
439
439
|
}
|
|
440
|
-
optimizeNames(names,
|
|
440
|
+
optimizeNames(names, constants4) {
|
|
441
441
|
if (this.lhs instanceof code_1.Name && !names[this.lhs.str] && !this.sideEffects)
|
|
442
442
|
return;
|
|
443
|
-
this.rhs = optimizeExpr(this.rhs, names,
|
|
443
|
+
this.rhs = optimizeExpr(this.rhs, names, constants4);
|
|
444
444
|
return this;
|
|
445
445
|
}
|
|
446
446
|
get names() {
|
|
@@ -501,8 +501,8 @@ var require_codegen = __commonJS({
|
|
|
501
501
|
optimizeNodes() {
|
|
502
502
|
return `${this.code}` ? this : void 0;
|
|
503
503
|
}
|
|
504
|
-
optimizeNames(names,
|
|
505
|
-
this.code = optimizeExpr(this.code, names,
|
|
504
|
+
optimizeNames(names, constants4) {
|
|
505
|
+
this.code = optimizeExpr(this.code, names, constants4);
|
|
506
506
|
return this;
|
|
507
507
|
}
|
|
508
508
|
get names() {
|
|
@@ -531,12 +531,12 @@ var require_codegen = __commonJS({
|
|
|
531
531
|
}
|
|
532
532
|
return nodes.length > 0 ? this : void 0;
|
|
533
533
|
}
|
|
534
|
-
optimizeNames(names,
|
|
534
|
+
optimizeNames(names, constants4) {
|
|
535
535
|
const { nodes } = this;
|
|
536
536
|
let i = nodes.length;
|
|
537
537
|
while (i--) {
|
|
538
538
|
const n = nodes[i];
|
|
539
|
-
if (n.optimizeNames(names,
|
|
539
|
+
if (n.optimizeNames(names, constants4))
|
|
540
540
|
continue;
|
|
541
541
|
subtractNames(names, n.names);
|
|
542
542
|
nodes.splice(i, 1);
|
|
@@ -589,12 +589,12 @@ var require_codegen = __commonJS({
|
|
|
589
589
|
return void 0;
|
|
590
590
|
return this;
|
|
591
591
|
}
|
|
592
|
-
optimizeNames(names,
|
|
592
|
+
optimizeNames(names, constants4) {
|
|
593
593
|
var _a3;
|
|
594
|
-
this.else = (_a3 = this.else) === null || _a3 === void 0 ? void 0 : _a3.optimizeNames(names,
|
|
595
|
-
if (!(super.optimizeNames(names,
|
|
594
|
+
this.else = (_a3 = this.else) === null || _a3 === void 0 ? void 0 : _a3.optimizeNames(names, constants4);
|
|
595
|
+
if (!(super.optimizeNames(names, constants4) || this.else))
|
|
596
596
|
return;
|
|
597
|
-
this.condition = optimizeExpr(this.condition, names,
|
|
597
|
+
this.condition = optimizeExpr(this.condition, names, constants4);
|
|
598
598
|
return this;
|
|
599
599
|
}
|
|
600
600
|
get names() {
|
|
@@ -617,10 +617,10 @@ var require_codegen = __commonJS({
|
|
|
617
617
|
render(opts) {
|
|
618
618
|
return `for(${this.iteration})` + super.render(opts);
|
|
619
619
|
}
|
|
620
|
-
optimizeNames(names,
|
|
621
|
-
if (!super.optimizeNames(names,
|
|
620
|
+
optimizeNames(names, constants4) {
|
|
621
|
+
if (!super.optimizeNames(names, constants4))
|
|
622
622
|
return;
|
|
623
|
-
this.iteration = optimizeExpr(this.iteration, names,
|
|
623
|
+
this.iteration = optimizeExpr(this.iteration, names, constants4);
|
|
624
624
|
return this;
|
|
625
625
|
}
|
|
626
626
|
get names() {
|
|
@@ -656,10 +656,10 @@ var require_codegen = __commonJS({
|
|
|
656
656
|
render(opts) {
|
|
657
657
|
return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(opts);
|
|
658
658
|
}
|
|
659
|
-
optimizeNames(names,
|
|
660
|
-
if (!super.optimizeNames(names,
|
|
659
|
+
optimizeNames(names, constants4) {
|
|
660
|
+
if (!super.optimizeNames(names, constants4))
|
|
661
661
|
return;
|
|
662
|
-
this.iterable = optimizeExpr(this.iterable, names,
|
|
662
|
+
this.iterable = optimizeExpr(this.iterable, names, constants4);
|
|
663
663
|
return this;
|
|
664
664
|
}
|
|
665
665
|
get names() {
|
|
@@ -701,11 +701,11 @@ var require_codegen = __commonJS({
|
|
|
701
701
|
(_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNodes();
|
|
702
702
|
return this;
|
|
703
703
|
}
|
|
704
|
-
optimizeNames(names,
|
|
704
|
+
optimizeNames(names, constants4) {
|
|
705
705
|
var _a3, _b;
|
|
706
|
-
super.optimizeNames(names,
|
|
707
|
-
(_a3 = this.catch) === null || _a3 === void 0 ? void 0 : _a3.optimizeNames(names,
|
|
708
|
-
(_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNames(names,
|
|
706
|
+
super.optimizeNames(names, constants4);
|
|
707
|
+
(_a3 = this.catch) === null || _a3 === void 0 ? void 0 : _a3.optimizeNames(names, constants4);
|
|
708
|
+
(_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNames(names, constants4);
|
|
709
709
|
return this;
|
|
710
710
|
}
|
|
711
711
|
get names() {
|
|
@@ -1006,7 +1006,7 @@ var require_codegen = __commonJS({
|
|
|
1006
1006
|
function addExprNames(names, from) {
|
|
1007
1007
|
return from instanceof code_1._CodeOrName ? addNames(names, from.names) : names;
|
|
1008
1008
|
}
|
|
1009
|
-
function optimizeExpr(expr, names,
|
|
1009
|
+
function optimizeExpr(expr, names, constants4) {
|
|
1010
1010
|
if (expr instanceof code_1.Name)
|
|
1011
1011
|
return replaceName(expr);
|
|
1012
1012
|
if (!canOptimize(expr))
|
|
@@ -1021,14 +1021,14 @@ var require_codegen = __commonJS({
|
|
|
1021
1021
|
return items;
|
|
1022
1022
|
}, []));
|
|
1023
1023
|
function replaceName(n) {
|
|
1024
|
-
const c =
|
|
1024
|
+
const c = constants4[n.str];
|
|
1025
1025
|
if (c === void 0 || names[n.str] !== 1)
|
|
1026
1026
|
return n;
|
|
1027
1027
|
delete names[n.str];
|
|
1028
1028
|
return c;
|
|
1029
1029
|
}
|
|
1030
1030
|
function canOptimize(e) {
|
|
1031
|
-
return e instanceof code_1._Code && e._items.some((c) => c instanceof code_1.Name && names[c.str] === 1 &&
|
|
1031
|
+
return e instanceof code_1._Code && e._items.some((c) => c instanceof code_1.Name && names[c.str] === 1 && constants4[c.str] !== void 0);
|
|
1032
1032
|
}
|
|
1033
1033
|
}
|
|
1034
1034
|
function subtractNames(names, from) {
|
|
@@ -7158,11 +7158,11 @@ var require_codegen2 = __commonJS({
|
|
|
7158
7158
|
const rhs = this.rhs === void 0 ? "" : ` = ${this.rhs}`;
|
|
7159
7159
|
return `${varKind} ${this.name}${rhs};` + _n;
|
|
7160
7160
|
}
|
|
7161
|
-
optimizeNames(names,
|
|
7161
|
+
optimizeNames(names, constants4) {
|
|
7162
7162
|
if (!names[this.name.str])
|
|
7163
7163
|
return;
|
|
7164
7164
|
if (this.rhs)
|
|
7165
|
-
this.rhs = optimizeExpr(this.rhs, names,
|
|
7165
|
+
this.rhs = optimizeExpr(this.rhs, names, constants4);
|
|
7166
7166
|
return this;
|
|
7167
7167
|
}
|
|
7168
7168
|
get names() {
|
|
@@ -7179,10 +7179,10 @@ var require_codegen2 = __commonJS({
|
|
|
7179
7179
|
render({ _n }) {
|
|
7180
7180
|
return `${this.lhs} = ${this.rhs};` + _n;
|
|
7181
7181
|
}
|
|
7182
|
-
optimizeNames(names,
|
|
7182
|
+
optimizeNames(names, constants4) {
|
|
7183
7183
|
if (this.lhs instanceof code_1.Name && !names[this.lhs.str] && !this.sideEffects)
|
|
7184
7184
|
return;
|
|
7185
|
-
this.rhs = optimizeExpr(this.rhs, names,
|
|
7185
|
+
this.rhs = optimizeExpr(this.rhs, names, constants4);
|
|
7186
7186
|
return this;
|
|
7187
7187
|
}
|
|
7188
7188
|
get names() {
|
|
@@ -7243,8 +7243,8 @@ var require_codegen2 = __commonJS({
|
|
|
7243
7243
|
optimizeNodes() {
|
|
7244
7244
|
return `${this.code}` ? this : void 0;
|
|
7245
7245
|
}
|
|
7246
|
-
optimizeNames(names,
|
|
7247
|
-
this.code = optimizeExpr(this.code, names,
|
|
7246
|
+
optimizeNames(names, constants4) {
|
|
7247
|
+
this.code = optimizeExpr(this.code, names, constants4);
|
|
7248
7248
|
return this;
|
|
7249
7249
|
}
|
|
7250
7250
|
get names() {
|
|
@@ -7273,12 +7273,12 @@ var require_codegen2 = __commonJS({
|
|
|
7273
7273
|
}
|
|
7274
7274
|
return nodes.length > 0 ? this : void 0;
|
|
7275
7275
|
}
|
|
7276
|
-
optimizeNames(names,
|
|
7276
|
+
optimizeNames(names, constants4) {
|
|
7277
7277
|
const { nodes } = this;
|
|
7278
7278
|
let i = nodes.length;
|
|
7279
7279
|
while (i--) {
|
|
7280
7280
|
const n = nodes[i];
|
|
7281
|
-
if (n.optimizeNames(names,
|
|
7281
|
+
if (n.optimizeNames(names, constants4))
|
|
7282
7282
|
continue;
|
|
7283
7283
|
subtractNames(names, n.names);
|
|
7284
7284
|
nodes.splice(i, 1);
|
|
@@ -7331,12 +7331,12 @@ var require_codegen2 = __commonJS({
|
|
|
7331
7331
|
return void 0;
|
|
7332
7332
|
return this;
|
|
7333
7333
|
}
|
|
7334
|
-
optimizeNames(names,
|
|
7334
|
+
optimizeNames(names, constants4) {
|
|
7335
7335
|
var _a3;
|
|
7336
|
-
this.else = (_a3 = this.else) === null || _a3 === void 0 ? void 0 : _a3.optimizeNames(names,
|
|
7337
|
-
if (!(super.optimizeNames(names,
|
|
7336
|
+
this.else = (_a3 = this.else) === null || _a3 === void 0 ? void 0 : _a3.optimizeNames(names, constants4);
|
|
7337
|
+
if (!(super.optimizeNames(names, constants4) || this.else))
|
|
7338
7338
|
return;
|
|
7339
|
-
this.condition = optimizeExpr(this.condition, names,
|
|
7339
|
+
this.condition = optimizeExpr(this.condition, names, constants4);
|
|
7340
7340
|
return this;
|
|
7341
7341
|
}
|
|
7342
7342
|
get names() {
|
|
@@ -7359,10 +7359,10 @@ var require_codegen2 = __commonJS({
|
|
|
7359
7359
|
render(opts) {
|
|
7360
7360
|
return `for(${this.iteration})` + super.render(opts);
|
|
7361
7361
|
}
|
|
7362
|
-
optimizeNames(names,
|
|
7363
|
-
if (!super.optimizeNames(names,
|
|
7362
|
+
optimizeNames(names, constants4) {
|
|
7363
|
+
if (!super.optimizeNames(names, constants4))
|
|
7364
7364
|
return;
|
|
7365
|
-
this.iteration = optimizeExpr(this.iteration, names,
|
|
7365
|
+
this.iteration = optimizeExpr(this.iteration, names, constants4);
|
|
7366
7366
|
return this;
|
|
7367
7367
|
}
|
|
7368
7368
|
get names() {
|
|
@@ -7398,10 +7398,10 @@ var require_codegen2 = __commonJS({
|
|
|
7398
7398
|
render(opts) {
|
|
7399
7399
|
return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(opts);
|
|
7400
7400
|
}
|
|
7401
|
-
optimizeNames(names,
|
|
7402
|
-
if (!super.optimizeNames(names,
|
|
7401
|
+
optimizeNames(names, constants4) {
|
|
7402
|
+
if (!super.optimizeNames(names, constants4))
|
|
7403
7403
|
return;
|
|
7404
|
-
this.iterable = optimizeExpr(this.iterable, names,
|
|
7404
|
+
this.iterable = optimizeExpr(this.iterable, names, constants4);
|
|
7405
7405
|
return this;
|
|
7406
7406
|
}
|
|
7407
7407
|
get names() {
|
|
@@ -7443,11 +7443,11 @@ var require_codegen2 = __commonJS({
|
|
|
7443
7443
|
(_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNodes();
|
|
7444
7444
|
return this;
|
|
7445
7445
|
}
|
|
7446
|
-
optimizeNames(names,
|
|
7446
|
+
optimizeNames(names, constants4) {
|
|
7447
7447
|
var _a3, _b;
|
|
7448
|
-
super.optimizeNames(names,
|
|
7449
|
-
(_a3 = this.catch) === null || _a3 === void 0 ? void 0 : _a3.optimizeNames(names,
|
|
7450
|
-
(_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNames(names,
|
|
7448
|
+
super.optimizeNames(names, constants4);
|
|
7449
|
+
(_a3 = this.catch) === null || _a3 === void 0 ? void 0 : _a3.optimizeNames(names, constants4);
|
|
7450
|
+
(_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNames(names, constants4);
|
|
7451
7451
|
return this;
|
|
7452
7452
|
}
|
|
7453
7453
|
get names() {
|
|
@@ -7748,7 +7748,7 @@ var require_codegen2 = __commonJS({
|
|
|
7748
7748
|
function addExprNames(names, from) {
|
|
7749
7749
|
return from instanceof code_1._CodeOrName ? addNames(names, from.names) : names;
|
|
7750
7750
|
}
|
|
7751
|
-
function optimizeExpr(expr, names,
|
|
7751
|
+
function optimizeExpr(expr, names, constants4) {
|
|
7752
7752
|
if (expr instanceof code_1.Name)
|
|
7753
7753
|
return replaceName(expr);
|
|
7754
7754
|
if (!canOptimize(expr))
|
|
@@ -7763,14 +7763,14 @@ var require_codegen2 = __commonJS({
|
|
|
7763
7763
|
return items;
|
|
7764
7764
|
}, []));
|
|
7765
7765
|
function replaceName(n) {
|
|
7766
|
-
const c =
|
|
7766
|
+
const c = constants4[n.str];
|
|
7767
7767
|
if (c === void 0 || names[n.str] !== 1)
|
|
7768
7768
|
return n;
|
|
7769
7769
|
delete names[n.str];
|
|
7770
7770
|
return c;
|
|
7771
7771
|
}
|
|
7772
7772
|
function canOptimize(e) {
|
|
7773
|
-
return e instanceof code_1._Code && e._items.some((c) => c instanceof code_1.Name && names[c.str] === 1 &&
|
|
7773
|
+
return e instanceof code_1._Code && e._items.some((c) => c instanceof code_1.Name && names[c.str] === 1 && constants4[c.str] !== void 0);
|
|
7774
7774
|
}
|
|
7775
7775
|
}
|
|
7776
7776
|
function subtractNames(names, from) {
|
|
@@ -12577,12 +12577,12 @@ var require_dist = __commonJS({
|
|
|
12577
12577
|
throw new Error(`Unknown format "${name}"`);
|
|
12578
12578
|
return f;
|
|
12579
12579
|
};
|
|
12580
|
-
function addFormats(ajv, list,
|
|
12580
|
+
function addFormats(ajv, list, fs16, exportName) {
|
|
12581
12581
|
var _a3;
|
|
12582
12582
|
var _b;
|
|
12583
12583
|
(_a3 = (_b = ajv.opts.code).formats) !== null && _a3 !== void 0 ? _a3 : _b.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`;
|
|
12584
12584
|
for (const f of list)
|
|
12585
|
-
ajv.addFormat(f,
|
|
12585
|
+
ajv.addFormat(f, fs16[f]);
|
|
12586
12586
|
}
|
|
12587
12587
|
module.exports = exports = formatsPlugin;
|
|
12588
12588
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -19863,14 +19863,14 @@ var require_parser = __commonJS({
|
|
|
19863
19863
|
case "scalar":
|
|
19864
19864
|
case "single-quoted-scalar":
|
|
19865
19865
|
case "double-quoted-scalar": {
|
|
19866
|
-
const
|
|
19866
|
+
const fs16 = this.flowScalar(this.type);
|
|
19867
19867
|
if (atNextItem || it.value) {
|
|
19868
|
-
map.items.push({ start, key:
|
|
19868
|
+
map.items.push({ start, key: fs16, sep: [] });
|
|
19869
19869
|
this.onKeyLine = true;
|
|
19870
19870
|
} else if (it.sep) {
|
|
19871
|
-
this.stack.push(
|
|
19871
|
+
this.stack.push(fs16);
|
|
19872
19872
|
} else {
|
|
19873
|
-
Object.assign(it, { key:
|
|
19873
|
+
Object.assign(it, { key: fs16, sep: [] });
|
|
19874
19874
|
this.onKeyLine = true;
|
|
19875
19875
|
}
|
|
19876
19876
|
return;
|
|
@@ -19998,13 +19998,13 @@ var require_parser = __commonJS({
|
|
|
19998
19998
|
case "scalar":
|
|
19999
19999
|
case "single-quoted-scalar":
|
|
20000
20000
|
case "double-quoted-scalar": {
|
|
20001
|
-
const
|
|
20001
|
+
const fs16 = this.flowScalar(this.type);
|
|
20002
20002
|
if (!it || it.value)
|
|
20003
|
-
fc.items.push({ start: [], key:
|
|
20003
|
+
fc.items.push({ start: [], key: fs16, sep: [] });
|
|
20004
20004
|
else if (it.sep)
|
|
20005
|
-
this.stack.push(
|
|
20005
|
+
this.stack.push(fs16);
|
|
20006
20006
|
else
|
|
20007
|
-
Object.assign(it, { key:
|
|
20007
|
+
Object.assign(it, { key: fs16, sep: [] });
|
|
20008
20008
|
return;
|
|
20009
20009
|
}
|
|
20010
20010
|
case "flow-map-end":
|
|
@@ -21162,10 +21162,10 @@ var require_truncate = __commonJS({
|
|
|
21162
21162
|
"../../node_modules/semver/functions/truncate.js"(exports, module) {
|
|
21163
21163
|
"use strict";
|
|
21164
21164
|
var parse5 = require_parse();
|
|
21165
|
-
var
|
|
21165
|
+
var constants4 = require_constants();
|
|
21166
21166
|
var SemVer = require_semver();
|
|
21167
21167
|
var truncate = (version2, truncation, options) => {
|
|
21168
|
-
if (!
|
|
21168
|
+
if (!constants4.RELEASE_TYPES.includes(truncation)) {
|
|
21169
21169
|
return null;
|
|
21170
21170
|
}
|
|
21171
21171
|
const clonedVersion = cloneInputVersion(version2, options);
|
|
@@ -22214,7 +22214,7 @@ var require_semver2 = __commonJS({
|
|
|
22214
22214
|
"../../node_modules/semver/index.js"(exports, module) {
|
|
22215
22215
|
"use strict";
|
|
22216
22216
|
var internalRe = require_re();
|
|
22217
|
-
var
|
|
22217
|
+
var constants4 = require_constants();
|
|
22218
22218
|
var SemVer = require_semver();
|
|
22219
22219
|
var identifiers = require_identifiers();
|
|
22220
22220
|
var parse5 = require_parse();
|
|
@@ -22298,8 +22298,8 @@ var require_semver2 = __commonJS({
|
|
|
22298
22298
|
re: internalRe.re,
|
|
22299
22299
|
src: internalRe.src,
|
|
22300
22300
|
tokens: internalRe.t,
|
|
22301
|
-
SEMVER_SPEC_VERSION:
|
|
22302
|
-
RELEASE_TYPES:
|
|
22301
|
+
SEMVER_SPEC_VERSION: constants4.SEMVER_SPEC_VERSION,
|
|
22302
|
+
RELEASE_TYPES: constants4.RELEASE_TYPES,
|
|
22303
22303
|
compareIdentifiers: identifiers.compareIdentifiers,
|
|
22304
22304
|
rcompareIdentifiers: identifiers.rcompareIdentifiers
|
|
22305
22305
|
};
|
|
@@ -32097,15 +32097,15 @@ var Server = class extends Protocol {
|
|
|
32097
32097
|
// ../argent-tools-client/src/launcher.ts
|
|
32098
32098
|
import * as net from "node:net";
|
|
32099
32099
|
import * as os3 from "node:os";
|
|
32100
|
-
import * as
|
|
32100
|
+
import * as fs8 from "node:fs";
|
|
32101
32101
|
import * as path8 from "node:path";
|
|
32102
32102
|
import * as readline from "node:readline";
|
|
32103
32103
|
import { spawn, execFileSync } from "node:child_process";
|
|
32104
|
-
import { createHash, randomBytes } from "node:crypto";
|
|
32104
|
+
import { createHash, randomBytes as randomBytes2 } from "node:crypto";
|
|
32105
32105
|
import { readFile, readdir, unlink } from "node:fs/promises";
|
|
32106
32106
|
|
|
32107
32107
|
// ../configuration-core/src/flags.ts
|
|
32108
|
-
import * as
|
|
32108
|
+
import * as fs2 from "node:fs";
|
|
32109
32109
|
import * as path2 from "node:path";
|
|
32110
32110
|
|
|
32111
32111
|
// ../configuration-core/src/home.ts
|
|
@@ -32126,6 +32126,43 @@ function argentHomeDir(options = {}) {
|
|
|
32126
32126
|
return override ? path.resolve(override.trim()) : path.join(resolveHomeDir(options), ".argent");
|
|
32127
32127
|
}
|
|
32128
32128
|
|
|
32129
|
+
// ../configuration-core/src/write-file.ts
|
|
32130
|
+
import * as fs from "node:fs";
|
|
32131
|
+
import { randomBytes } from "node:crypto";
|
|
32132
|
+
function writeFileAtomicSync(file, data, mode = 438) {
|
|
32133
|
+
const tmp = `${file}.${randomBytes(8).toString("hex")}.tmp`;
|
|
32134
|
+
try {
|
|
32135
|
+
fs.writeFileSync(tmp, data, { flag: "wx", mode });
|
|
32136
|
+
fs.renameSync(tmp, file);
|
|
32137
|
+
} catch (err) {
|
|
32138
|
+
fs.rmSync(tmp, { force: true });
|
|
32139
|
+
if (err.code !== "EBUSY" || !writeOwnFileInPlace(file, data, mode)) {
|
|
32140
|
+
throw err;
|
|
32141
|
+
}
|
|
32142
|
+
}
|
|
32143
|
+
}
|
|
32144
|
+
var IN_PLACE_FLAGS = fs.constants.O_WRONLY | fs.constants.O_NOFOLLOW | fs.constants.O_NONBLOCK;
|
|
32145
|
+
function writeOwnFileInPlace(file, data, mode) {
|
|
32146
|
+
const uid = process.getuid?.();
|
|
32147
|
+
if (uid === void 0) return false;
|
|
32148
|
+
let fd;
|
|
32149
|
+
try {
|
|
32150
|
+
fd = fs.openSync(file, IN_PLACE_FLAGS);
|
|
32151
|
+
} catch {
|
|
32152
|
+
return false;
|
|
32153
|
+
}
|
|
32154
|
+
try {
|
|
32155
|
+
const stat6 = fs.fstatSync(fd);
|
|
32156
|
+
if (!stat6.isFile() || stat6.uid !== uid && uid !== 0) return false;
|
|
32157
|
+
fs.fchmodSync(fd, stat6.mode & mode & 511);
|
|
32158
|
+
fs.ftruncateSync(fd);
|
|
32159
|
+
fs.writeFileSync(fd, data);
|
|
32160
|
+
return true;
|
|
32161
|
+
} finally {
|
|
32162
|
+
fs.closeSync(fd);
|
|
32163
|
+
}
|
|
32164
|
+
}
|
|
32165
|
+
|
|
32129
32166
|
// ../configuration-core/src/flags.ts
|
|
32130
32167
|
var FLAG_REGISTRY = [
|
|
32131
32168
|
{
|
|
@@ -32193,7 +32230,7 @@ function findProjectRoot(startDir) {
|
|
|
32193
32230
|
let current = path2.resolve(startDir);
|
|
32194
32231
|
while (true) {
|
|
32195
32232
|
for (const marker of PROJECT_MARKERS) {
|
|
32196
|
-
if (
|
|
32233
|
+
if (fs2.existsSync(path2.join(current, marker))) return current;
|
|
32197
32234
|
}
|
|
32198
32235
|
const parent = path2.dirname(current);
|
|
32199
32236
|
if (parent === current) return null;
|
|
@@ -32213,7 +32250,7 @@ function getFlagsPath(scope, options = {}) {
|
|
|
32213
32250
|
function readFlagsFile(filePath) {
|
|
32214
32251
|
let raw2;
|
|
32215
32252
|
try {
|
|
32216
|
-
raw2 =
|
|
32253
|
+
raw2 = fs2.readFileSync(filePath, "utf8");
|
|
32217
32254
|
} catch {
|
|
32218
32255
|
return {};
|
|
32219
32256
|
}
|
|
@@ -32250,14 +32287,14 @@ function isFeatureEnabled(name, options = {}, registry2 = FLAG_REGISTRY) {
|
|
|
32250
32287
|
}
|
|
32251
32288
|
|
|
32252
32289
|
// ../configuration-core/src/paths.ts
|
|
32253
|
-
import * as
|
|
32290
|
+
import * as fs3 from "node:fs";
|
|
32254
32291
|
import * as path3 from "node:path";
|
|
32255
32292
|
function isHomeDir(dir, options = {}) {
|
|
32256
32293
|
return canonicalPath(dir) === canonicalPath(resolveHomeDir(options));
|
|
32257
32294
|
}
|
|
32258
32295
|
function canonicalPath(p) {
|
|
32259
32296
|
try {
|
|
32260
|
-
return
|
|
32297
|
+
return fs3.realpathSync.native(p);
|
|
32261
32298
|
} catch {
|
|
32262
32299
|
return path3.resolve(p);
|
|
32263
32300
|
}
|
|
@@ -32273,11 +32310,11 @@ function configFilePath(scope = "global", options = {}) {
|
|
|
32273
32310
|
|
|
32274
32311
|
// ../configuration-core/src/config.ts
|
|
32275
32312
|
import * as crypto from "node:crypto";
|
|
32276
|
-
import * as
|
|
32313
|
+
import * as fs4 from "node:fs";
|
|
32277
32314
|
import * as path4 from "node:path";
|
|
32278
32315
|
function readConfigObject(scope = "global", options = {}) {
|
|
32279
32316
|
try {
|
|
32280
|
-
const raw2 =
|
|
32317
|
+
const raw2 = fs4.readFileSync(configFilePath(scope, options), "utf8");
|
|
32281
32318
|
const json = JSON.parse(raw2);
|
|
32282
32319
|
if (json && typeof json === "object" && !Array.isArray(json)) {
|
|
32283
32320
|
return json;
|
|
@@ -32335,9 +32372,9 @@ function acquireConfigLock(finalPath) {
|
|
|
32335
32372
|
const deadline = Date.now() + LOCK_MAX_WAIT_MS;
|
|
32336
32373
|
for (; ; ) {
|
|
32337
32374
|
try {
|
|
32338
|
-
const fd =
|
|
32375
|
+
const fd = fs4.openSync(lockPath, "wx", 384);
|
|
32339
32376
|
try {
|
|
32340
|
-
|
|
32377
|
+
fs4.writeSync(fd, `${process.pid}
|
|
32341
32378
|
`);
|
|
32342
32379
|
} catch {
|
|
32343
32380
|
}
|
|
@@ -32345,8 +32382,8 @@ function acquireConfigLock(finalPath) {
|
|
|
32345
32382
|
} catch (err) {
|
|
32346
32383
|
if (err.code !== "EEXIST") return null;
|
|
32347
32384
|
try {
|
|
32348
|
-
if (Date.now() -
|
|
32349
|
-
|
|
32385
|
+
if (Date.now() - fs4.statSync(lockPath).mtimeMs > LOCK_STALE_MS) {
|
|
32386
|
+
fs4.unlinkSync(lockPath);
|
|
32350
32387
|
continue;
|
|
32351
32388
|
}
|
|
32352
32389
|
} catch {
|
|
@@ -32358,35 +32395,35 @@ function acquireConfigLock(finalPath) {
|
|
|
32358
32395
|
}
|
|
32359
32396
|
function releaseConfigLock(lock) {
|
|
32360
32397
|
try {
|
|
32361
|
-
|
|
32398
|
+
fs4.closeSync(lock.fd);
|
|
32362
32399
|
} catch {
|
|
32363
32400
|
}
|
|
32364
32401
|
try {
|
|
32365
|
-
|
|
32402
|
+
fs4.unlinkSync(lock.lockPath);
|
|
32366
32403
|
} catch {
|
|
32367
32404
|
}
|
|
32368
32405
|
}
|
|
32369
32406
|
function updateConfig(mutate, scope = "global", options = {}) {
|
|
32370
32407
|
const dir = configDir(scope, options);
|
|
32371
|
-
|
|
32408
|
+
fs4.mkdirSync(dir, { recursive: true });
|
|
32372
32409
|
const finalPath = configFilePath(scope, options);
|
|
32373
32410
|
const lock = acquireConfigLock(finalPath);
|
|
32374
32411
|
try {
|
|
32375
32412
|
const next = readConfigObject(scope, options);
|
|
32376
32413
|
mutate(next);
|
|
32377
32414
|
const tmpPath = path4.join(dir, `.config.tmp.${process.pid}.${crypto.randomUUID()}`);
|
|
32378
|
-
const fd =
|
|
32415
|
+
const fd = fs4.openSync(tmpPath, "wx", 384);
|
|
32379
32416
|
try {
|
|
32380
|
-
|
|
32381
|
-
|
|
32417
|
+
fs4.writeSync(fd, JSON.stringify(next, null, 2) + "\n");
|
|
32418
|
+
fs4.fsyncSync(fd);
|
|
32382
32419
|
} finally {
|
|
32383
|
-
|
|
32420
|
+
fs4.closeSync(fd);
|
|
32384
32421
|
}
|
|
32385
32422
|
try {
|
|
32386
|
-
|
|
32423
|
+
fs4.renameSync(tmpPath, finalPath);
|
|
32387
32424
|
} catch (err) {
|
|
32388
32425
|
try {
|
|
32389
|
-
|
|
32426
|
+
fs4.unlinkSync(tmpPath);
|
|
32390
32427
|
} catch {
|
|
32391
32428
|
}
|
|
32392
32429
|
throw err;
|
|
@@ -32420,7 +32457,7 @@ function setWhatsNewSeenVersion(version2, options = {}) {
|
|
|
32420
32457
|
|
|
32421
32458
|
// ../configuration-core/src/secrets.ts
|
|
32422
32459
|
var import_dotenv = __toESM(require_dist2(), 1);
|
|
32423
|
-
import * as
|
|
32460
|
+
import * as fs5 from "node:fs";
|
|
32424
32461
|
import * as path5 from "node:path";
|
|
32425
32462
|
var SECRET_ENV_PREFIX = "ARGENT_SECRET_";
|
|
32426
32463
|
var SECRETS_FILE_NAME = "secrets.env";
|
|
@@ -32450,10 +32487,10 @@ function fileSource(filePath, exposure) {
|
|
|
32450
32487
|
names: [],
|
|
32451
32488
|
values: /* @__PURE__ */ new Map()
|
|
32452
32489
|
};
|
|
32453
|
-
if (!
|
|
32490
|
+
if (!fs5.statSync(filePath, { throwIfNoEntry: false })) return absent;
|
|
32454
32491
|
let content;
|
|
32455
32492
|
try {
|
|
32456
|
-
content =
|
|
32493
|
+
content = fs5.readFileSync(filePath, "utf8");
|
|
32457
32494
|
} catch {
|
|
32458
32495
|
return absent;
|
|
32459
32496
|
}
|
|
@@ -32463,7 +32500,7 @@ function secretsFileSource(filePath) {
|
|
|
32463
32500
|
const resolved = path5.resolve(filePath);
|
|
32464
32501
|
let content;
|
|
32465
32502
|
try {
|
|
32466
|
-
content =
|
|
32503
|
+
content = fs5.readFileSync(resolved, "utf8");
|
|
32467
32504
|
} catch (err) {
|
|
32468
32505
|
const code = err.code;
|
|
32469
32506
|
const reason = code === "ENOENT" ? "no such file" : code === "EISDIR" ? "it is a directory" : code === "EACCES" ? "permission denied" : err instanceof Error ? err.message : String(err);
|
|
@@ -32745,7 +32782,7 @@ function getConfigDefinition(key, registry2 = CONFIG_SCHEMA) {
|
|
|
32745
32782
|
}
|
|
32746
32783
|
|
|
32747
32784
|
// ../configuration-core/src/config-access.ts
|
|
32748
|
-
import * as
|
|
32785
|
+
import * as fs6 from "node:fs";
|
|
32749
32786
|
import * as path6 from "node:path";
|
|
32750
32787
|
function readScopeValue(def, scope, options) {
|
|
32751
32788
|
if (!def.scopes.includes(scope)) return void 0;
|
|
@@ -32782,7 +32819,7 @@ var UnknownConfigKeyError = class extends Error {
|
|
|
32782
32819
|
};
|
|
32783
32820
|
|
|
32784
32821
|
// ../configuration-core/src/cloud-android.ts
|
|
32785
|
-
import * as
|
|
32822
|
+
import * as fs7 from "node:fs";
|
|
32786
32823
|
import * as os2 from "node:os";
|
|
32787
32824
|
import * as path7 from "node:path";
|
|
32788
32825
|
var CLOUD_URL_ENV = "ARGENT_CLOUD_URL";
|
|
@@ -32834,8 +32871,8 @@ function untrusted(dir) {
|
|
|
32834
32871
|
let stat6;
|
|
32835
32872
|
let parent;
|
|
32836
32873
|
try {
|
|
32837
|
-
stat6 =
|
|
32838
|
-
parent =
|
|
32874
|
+
stat6 = fs7.lstatSync(dir);
|
|
32875
|
+
parent = fs7.statSync(path7.dirname(dir));
|
|
32839
32876
|
} catch {
|
|
32840
32877
|
return "it cannot be read";
|
|
32841
32878
|
}
|
|
@@ -32854,14 +32891,14 @@ function trustedCloudAndroidMarkersDir() {
|
|
|
32854
32891
|
var CLOUD_ANDROID_MARKER_TTL_MS = 2 * 6e4;
|
|
32855
32892
|
function readCloudAndroidMarker(file) {
|
|
32856
32893
|
try {
|
|
32857
|
-
const raw2 = JSON.parse(
|
|
32894
|
+
const raw2 = JSON.parse(fs7.readFileSync(file, "utf8"));
|
|
32858
32895
|
if (typeof raw2.pid !== "number" || typeof raw2.lease !== "string") return null;
|
|
32859
32896
|
if (typeof raw2.serial !== "string") return null;
|
|
32860
32897
|
return {
|
|
32861
32898
|
serial: raw2.serial,
|
|
32862
32899
|
pid: raw2.pid,
|
|
32863
32900
|
lease: raw2.lease,
|
|
32864
|
-
refreshedAt:
|
|
32901
|
+
refreshedAt: fs7.statSync(file).mtimeMs
|
|
32865
32902
|
};
|
|
32866
32903
|
} catch {
|
|
32867
32904
|
return null;
|
|
@@ -32871,7 +32908,7 @@ function readCloudAndroidMarkers(dir = trustedCloudAndroidMarkersDir()) {
|
|
|
32871
32908
|
if (!dir) return [];
|
|
32872
32909
|
let names;
|
|
32873
32910
|
try {
|
|
32874
|
-
names =
|
|
32911
|
+
names = fs7.readdirSync(dir);
|
|
32875
32912
|
} catch {
|
|
32876
32913
|
return [];
|
|
32877
32914
|
}
|
|
@@ -32941,7 +32978,7 @@ function buildToolsServerEnv(paths, port, baseEnv = process.env, options = {}) {
|
|
|
32941
32978
|
return env;
|
|
32942
32979
|
}
|
|
32943
32980
|
function generateToken() {
|
|
32944
|
-
return
|
|
32981
|
+
return randomBytes2(AUTH_TOKEN_BYTES).toString("hex");
|
|
32945
32982
|
}
|
|
32946
32983
|
function findFreePort() {
|
|
32947
32984
|
return new Promise((resolve13, reject) => {
|
|
@@ -32997,7 +33034,7 @@ function isVersionNewer(a, b) {
|
|
|
32997
33034
|
function readBundlePackageVersion(bundlePath) {
|
|
32998
33035
|
try {
|
|
32999
33036
|
const pkg = JSON.parse(
|
|
33000
|
-
|
|
33037
|
+
fs8.readFileSync(path8.join(path8.dirname(bundlePath), "..", "package.json"), "utf8")
|
|
33001
33038
|
);
|
|
33002
33039
|
return typeof pkg.version === "string" ? pkg.version : void 0;
|
|
33003
33040
|
} catch {
|
|
@@ -33054,7 +33091,7 @@ function killSpawnedChild(child, pid) {
|
|
|
33054
33091
|
}
|
|
33055
33092
|
function resolveToolsServerNode() {
|
|
33056
33093
|
const { bun, deno, electron } = process.versions;
|
|
33057
|
-
return !(bun || deno || electron) &&
|
|
33094
|
+
return !(bun || deno || electron) && fs8.existsSync(process.execPath) ? process.execPath : "node";
|
|
33058
33095
|
}
|
|
33059
33096
|
function parseListeningPort(line) {
|
|
33060
33097
|
const match = line.match(/Tools server listening on http:\/\/.+:(\d+)/);
|
|
@@ -33064,10 +33101,10 @@ function spawnToolsServer(paths, port, options = {}) {
|
|
|
33064
33101
|
return new Promise((resolve13, reject) => {
|
|
33065
33102
|
let logFd;
|
|
33066
33103
|
try {
|
|
33067
|
-
|
|
33068
|
-
logFd =
|
|
33104
|
+
fs8.mkdirSync(STATE_DIR, { recursive: true });
|
|
33105
|
+
logFd = fs8.openSync(LOG_FILE, "a");
|
|
33069
33106
|
} catch {
|
|
33070
|
-
logFd =
|
|
33107
|
+
logFd = fs8.openSync("/dev/null", "w");
|
|
33071
33108
|
}
|
|
33072
33109
|
const nodeBin = resolveToolsServerNode();
|
|
33073
33110
|
const child = spawn(nodeBin, [paths.bundlePath, "start"], {
|
|
@@ -33075,7 +33112,7 @@ function spawnToolsServer(paths, port, options = {}) {
|
|
|
33075
33112
|
stdio: ["ignore", "pipe", logFd],
|
|
33076
33113
|
env: buildToolsServerEnv(paths, port, process.env, options)
|
|
33077
33114
|
});
|
|
33078
|
-
|
|
33115
|
+
fs8.closeSync(logFd);
|
|
33079
33116
|
const pid = child.pid;
|
|
33080
33117
|
if (!pid) {
|
|
33081
33118
|
child.once(
|
|
@@ -33160,19 +33197,19 @@ var UnsafeArgentHomeError = class extends Error {
|
|
|
33160
33197
|
};
|
|
33161
33198
|
function statHome() {
|
|
33162
33199
|
try {
|
|
33163
|
-
|
|
33164
|
-
|
|
33200
|
+
fs8.mkdirSync(path8.dirname(STATE_DIR), { recursive: true });
|
|
33201
|
+
fs8.mkdirSync(STATE_DIR, { mode: 448 });
|
|
33165
33202
|
} catch {
|
|
33166
33203
|
}
|
|
33167
33204
|
try {
|
|
33168
|
-
return
|
|
33205
|
+
return fs8.statSync(STATE_DIR);
|
|
33169
33206
|
} catch {
|
|
33170
33207
|
return null;
|
|
33171
33208
|
}
|
|
33172
33209
|
}
|
|
33173
33210
|
function isWritable(dir) {
|
|
33174
33211
|
try {
|
|
33175
|
-
|
|
33212
|
+
fs8.accessSync(dir, fs8.constants.W_OK);
|
|
33176
33213
|
return true;
|
|
33177
33214
|
} catch {
|
|
33178
33215
|
return false;
|
|
@@ -33200,16 +33237,12 @@ async function writeToolsServerState(state) {
|
|
|
33200
33237
|
writeToolsServerStateSync(state);
|
|
33201
33238
|
}
|
|
33202
33239
|
function writeToolsServerStateSync(state) {
|
|
33203
|
-
|
|
33204
|
-
|
|
33205
|
-
|
|
33206
|
-
|
|
33207
|
-
|
|
33208
|
-
|
|
33209
|
-
} catch (err) {
|
|
33210
|
-
fs7.rmSync(tmp, { force: true });
|
|
33211
|
-
throw err;
|
|
33212
|
-
}
|
|
33240
|
+
fs8.mkdirSync(STATE_DIR, { recursive: true });
|
|
33241
|
+
writeFileAtomicSync(
|
|
33242
|
+
stateFileForBundle(state.bundlePath, state.cloudProfile),
|
|
33243
|
+
JSON.stringify(state, null, 2) + "\n",
|
|
33244
|
+
384
|
|
33245
|
+
);
|
|
33213
33246
|
}
|
|
33214
33247
|
async function clearToolsServerState(bundlePath, cloudProfile) {
|
|
33215
33248
|
const files = [STATE_FILE];
|
|
@@ -33254,7 +33287,7 @@ async function sweepDeadStateFiles() {
|
|
|
33254
33287
|
});
|
|
33255
33288
|
continue;
|
|
33256
33289
|
}
|
|
33257
|
-
if (
|
|
33290
|
+
if (fs8.existsSync(fresh.bundlePath)) continue;
|
|
33258
33291
|
if (!couldBeOurToolServer(fresh.pid, fresh.bundlePath)) continue;
|
|
33259
33292
|
await unlink(file).catch(() => {
|
|
33260
33293
|
});
|
|
@@ -33295,7 +33328,7 @@ function clientCloudProfile(env = process.env) {
|
|
|
33295
33328
|
const cloud = cloudCredential(env);
|
|
33296
33329
|
return cloud ? cloudProfileId(cloud) : void 0;
|
|
33297
33330
|
}
|
|
33298
|
-
var PS_BIN = ["/bin/ps", "/usr/bin/ps"].find((p) =>
|
|
33331
|
+
var PS_BIN = ["/bin/ps", "/usr/bin/ps"].find((p) => fs8.existsSync(p)) ?? "ps";
|
|
33299
33332
|
var PS_WIDTH_FLAGS = ["-ww"];
|
|
33300
33333
|
var PS_LOCALE = process.platform === "darwin" ? "en_US.UTF-8" : "C.UTF-8";
|
|
33301
33334
|
function readProcessCommandLine(pid, flags = PS_WIDTH_FLAGS, env = { ...process.env, LC_ALL: PS_LOCALE }) {
|
|
@@ -33342,13 +33375,13 @@ var LOCK_STALE_MS2 = 45e3;
|
|
|
33342
33375
|
var LOCK_POLL_MS = 100;
|
|
33343
33376
|
function spawnLockIsStale() {
|
|
33344
33377
|
try {
|
|
33345
|
-
const { pid, ts } = JSON.parse(
|
|
33378
|
+
const { pid, ts } = JSON.parse(fs8.readFileSync(LOCK_FILE, "utf8"));
|
|
33346
33379
|
if (typeof pid === "number" && pid > 0 && !isProcessAlive(pid)) return true;
|
|
33347
33380
|
if (typeof ts === "number" && Date.now() - ts > LOCK_STALE_MS2) return true;
|
|
33348
33381
|
return false;
|
|
33349
33382
|
} catch {
|
|
33350
33383
|
try {
|
|
33351
|
-
return Date.now() -
|
|
33384
|
+
return Date.now() - fs8.statSync(LOCK_FILE).mtimeMs > LOCK_STALE_MS2;
|
|
33352
33385
|
} catch {
|
|
33353
33386
|
return true;
|
|
33354
33387
|
}
|
|
@@ -33356,19 +33389,19 @@ function spawnLockIsStale() {
|
|
|
33356
33389
|
}
|
|
33357
33390
|
async function acquireSpawnLock() {
|
|
33358
33391
|
try {
|
|
33359
|
-
|
|
33392
|
+
fs8.mkdirSync(STATE_DIR, { recursive: true });
|
|
33360
33393
|
} catch {
|
|
33361
33394
|
return null;
|
|
33362
33395
|
}
|
|
33363
|
-
const nonce =
|
|
33396
|
+
const nonce = randomBytes2(8).toString("hex");
|
|
33364
33397
|
const deadline = Date.now() + LOCK_WAIT_TIMEOUT_MS;
|
|
33365
33398
|
for (; ; ) {
|
|
33366
33399
|
try {
|
|
33367
|
-
const fd =
|
|
33400
|
+
const fd = fs8.openSync(LOCK_FILE, "wx");
|
|
33368
33401
|
try {
|
|
33369
|
-
|
|
33402
|
+
fs8.writeSync(fd, JSON.stringify({ pid: process.pid, nonce, ts: Date.now() }));
|
|
33370
33403
|
} finally {
|
|
33371
|
-
|
|
33404
|
+
fs8.closeSync(fd);
|
|
33372
33405
|
}
|
|
33373
33406
|
let released = false;
|
|
33374
33407
|
return {
|
|
@@ -33376,8 +33409,8 @@ async function acquireSpawnLock() {
|
|
|
33376
33409
|
if (released) return;
|
|
33377
33410
|
released = true;
|
|
33378
33411
|
try {
|
|
33379
|
-
const cur = JSON.parse(
|
|
33380
|
-
if (cur.pid === process.pid && cur.nonce === nonce)
|
|
33412
|
+
const cur = JSON.parse(fs8.readFileSync(LOCK_FILE, "utf8"));
|
|
33413
|
+
if (cur.pid === process.pid && cur.nonce === nonce) fs8.unlinkSync(LOCK_FILE);
|
|
33381
33414
|
} catch {
|
|
33382
33415
|
}
|
|
33383
33416
|
}
|
|
@@ -33386,10 +33419,10 @@ async function acquireSpawnLock() {
|
|
|
33386
33419
|
if (err.code !== "EEXIST") return null;
|
|
33387
33420
|
if (spawnLockIsStale()) {
|
|
33388
33421
|
try {
|
|
33389
|
-
|
|
33422
|
+
fs8.unlinkSync(LOCK_FILE);
|
|
33390
33423
|
} catch {
|
|
33391
33424
|
}
|
|
33392
|
-
if (!
|
|
33425
|
+
if (!fs8.existsSync(LOCK_FILE)) continue;
|
|
33393
33426
|
}
|
|
33394
33427
|
if (Date.now() >= deadline) return null;
|
|
33395
33428
|
await new Promise((r) => setTimeout(r, LOCK_POLL_MS));
|
|
@@ -33430,7 +33463,7 @@ async function ensureToolsServer(paths, env = process.env) {
|
|
|
33430
33463
|
}
|
|
33431
33464
|
await clearToolsServerState(paths.bundlePath, cloudProfile);
|
|
33432
33465
|
await sweepDeadStateFiles();
|
|
33433
|
-
if (!
|
|
33466
|
+
if (!fs8.existsSync(paths.bundlePath)) {
|
|
33434
33467
|
throw new Error(
|
|
33435
33468
|
`The argent install serving this session is gone from disk (${paths.bundlePath}) \u2014 it was likely updated or removed. Restart the editor's MCP connection to reconnect.`
|
|
33436
33469
|
);
|
|
@@ -33536,11 +33569,11 @@ var LAUNCH_PLATFORMS = ["ios", "android", "chromium", "vega", "macos"];
|
|
|
33536
33569
|
var SELECTABLE_PLATFORMS = [...LAUNCH_PLATFORMS, "ios-remote"];
|
|
33537
33570
|
|
|
33538
33571
|
// ../registry/src/flow-file-refs.ts
|
|
33539
|
-
import * as
|
|
33572
|
+
import * as fs10 from "node:fs/promises";
|
|
33540
33573
|
import * as path10 from "node:path";
|
|
33541
33574
|
|
|
33542
33575
|
// ../registry/src/e2e-dirs.ts
|
|
33543
|
-
import * as
|
|
33576
|
+
import * as fs9 from "node:fs/promises";
|
|
33544
33577
|
import * as path9 from "node:path";
|
|
33545
33578
|
var E2E_DIR = path9.join(".argent", "e2e");
|
|
33546
33579
|
var LEGACY_E2E_DIRS = Object.freeze([path9.join(".argent", "flows")]);
|
|
@@ -33555,7 +33588,7 @@ function e2eFileCandidates(projectRoot, name) {
|
|
|
33555
33588
|
return e2eDirsFor(projectRoot).map((dir) => path9.join(dir, `${name}.yaml`));
|
|
33556
33589
|
}
|
|
33557
33590
|
async function exists(file) {
|
|
33558
|
-
return
|
|
33591
|
+
return fs9.stat(file).then(
|
|
33559
33592
|
() => true,
|
|
33560
33593
|
() => false
|
|
33561
33594
|
);
|
|
@@ -33646,10 +33679,10 @@ function canonicalToolArgs(tool, args) {
|
|
|
33646
33679
|
// ../registry/src/flow-file-refs.ts
|
|
33647
33680
|
async function canonicalFlowPath(p) {
|
|
33648
33681
|
try {
|
|
33649
|
-
return await
|
|
33682
|
+
return await fs10.realpath(p);
|
|
33650
33683
|
} catch {
|
|
33651
33684
|
try {
|
|
33652
|
-
return path10.join(await
|
|
33685
|
+
return path10.join(await fs10.realpath(path10.dirname(p)), path10.basename(p));
|
|
33653
33686
|
} catch {
|
|
33654
33687
|
return p;
|
|
33655
33688
|
}
|
|
@@ -33709,7 +33742,7 @@ function flowMemberKey(anchorDir, target) {
|
|
|
33709
33742
|
return `${anchorDir}\0${target}`;
|
|
33710
33743
|
}
|
|
33711
33744
|
async function classifyOnDiskSpelling(dir, base, addressable = FLOW_FILE_NAME_PATTERN) {
|
|
33712
|
-
const entries = await
|
|
33745
|
+
const entries = await fs10.readdir(dir).catch(() => null);
|
|
33713
33746
|
if (entries === null || entries.includes(base)) return { state: "listed" };
|
|
33714
33747
|
const actual = entries.find((entry) => entry.toLowerCase() === base.toLowerCase());
|
|
33715
33748
|
if (actual === void 0) return { state: "absent" };
|
|
@@ -34327,7 +34360,7 @@ function describeParamIssues(error2, params) {
|
|
|
34327
34360
|
|
|
34328
34361
|
// ../argent-tools-client/src/link-config.ts
|
|
34329
34362
|
import * as path11 from "node:path";
|
|
34330
|
-
import { mkdir,
|
|
34363
|
+
import { mkdir, readFile as readFile2, unlink as unlink2 } from "node:fs/promises";
|
|
34331
34364
|
var LINK_DIR = argentHomeDir();
|
|
34332
34365
|
var LINK_FILE = path11.join(LINK_DIR, "link.json");
|
|
34333
34366
|
async function readLinkConfig() {
|
|
@@ -34371,7 +34404,7 @@ async function getResolvedToolsUrl() {
|
|
|
34371
34404
|
import { createHash as createHash2, randomUUID as randomUUID4 } from "node:crypto";
|
|
34372
34405
|
import { createReadStream as createReadStream2, rmSync as rmSync3 } from "node:fs";
|
|
34373
34406
|
import {
|
|
34374
|
-
chmod
|
|
34407
|
+
chmod,
|
|
34375
34408
|
lstat,
|
|
34376
34409
|
mkdir as mkdir2,
|
|
34377
34410
|
readFile as readFile3,
|
|
@@ -34379,9 +34412,9 @@ import {
|
|
|
34379
34412
|
rename,
|
|
34380
34413
|
rm as rm2,
|
|
34381
34414
|
stat as stat3,
|
|
34382
|
-
writeFile
|
|
34415
|
+
writeFile
|
|
34383
34416
|
} from "node:fs/promises";
|
|
34384
|
-
import { constants as
|
|
34417
|
+
import { constants as constants3, tmpdir } from "node:os";
|
|
34385
34418
|
import * as path12 from "node:path";
|
|
34386
34419
|
|
|
34387
34420
|
// ../archive/src/index.ts
|
|
@@ -34759,7 +34792,7 @@ function removeArchivesOnSignal(signal) {
|
|
|
34759
34792
|
try {
|
|
34760
34793
|
process.kill(process.pid, signal);
|
|
34761
34794
|
} catch {
|
|
34762
|
-
process.exit(128 +
|
|
34795
|
+
process.exit(128 + constants3.signals[signal]);
|
|
34763
34796
|
}
|
|
34764
34797
|
}
|
|
34765
34798
|
function trackArchive(archive) {
|
|
@@ -34934,8 +34967,8 @@ function isClientFileDirective2(value) {
|
|
|
34934
34967
|
async function replaceFile(target, bytes, mode) {
|
|
34935
34968
|
const temp = path12.join(path12.dirname(target), `.baseline-${randomUUID4()}.tmp`);
|
|
34936
34969
|
try {
|
|
34937
|
-
await
|
|
34938
|
-
if (mode !== void 0) await
|
|
34970
|
+
await writeFile(temp, bytes, { flag: "wx" });
|
|
34971
|
+
if (mode !== void 0) await chmod(temp, mode & 511);
|
|
34939
34972
|
await rename(temp, target);
|
|
34940
34973
|
} catch (err) {
|
|
34941
34974
|
await rm2(temp, { force: true });
|
|
@@ -34990,7 +35023,7 @@ async function applyClientFileDirectives(result, opts = {}) {
|
|
|
34990
35023
|
if (!isAllowedClientFilePath(value.path)) return null;
|
|
34991
35024
|
try {
|
|
34992
35025
|
await mkdir2(path12.dirname(value.path), { recursive: true });
|
|
34993
|
-
await
|
|
35026
|
+
await writeFile(value.path, value.content, "utf8");
|
|
34994
35027
|
written.push(value.path);
|
|
34995
35028
|
return value.path;
|
|
34996
35029
|
} catch {
|
|
@@ -36029,7 +36062,7 @@ import {
|
|
|
36029
36062
|
realpath as realpath4,
|
|
36030
36063
|
rm as rm3,
|
|
36031
36064
|
stat as stat5,
|
|
36032
|
-
writeFile as
|
|
36065
|
+
writeFile as writeFile2
|
|
36033
36066
|
} from "node:fs/promises";
|
|
36034
36067
|
import { constants as fsConstants } from "node:fs";
|
|
36035
36068
|
import { tmpdir as tmpdir2 } from "node:os";
|
|
@@ -36180,7 +36213,7 @@ async function downloadAndExtractArchive(handle, data, dir, signal) {
|
|
|
36180
36213
|
const tarball = join15(attemptDir, "download.tar");
|
|
36181
36214
|
const extractDir = join15(attemptDir, "files");
|
|
36182
36215
|
try {
|
|
36183
|
-
await
|
|
36216
|
+
await writeFile2(tarball, data, { signal });
|
|
36184
36217
|
await mkdir3(extractDir);
|
|
36185
36218
|
const member = await safeExtractArchive(tarball, extractDir, handle.filename, signal);
|
|
36186
36219
|
await rm3(tarball);
|
|
@@ -36244,7 +36277,7 @@ async function materializeArtifacts(result, ctx) {
|
|
|
36244
36277
|
const finalPath = await writeDurableUnique(
|
|
36245
36278
|
saveTarget.dir,
|
|
36246
36279
|
filename,
|
|
36247
|
-
(p) =>
|
|
36280
|
+
(p) => writeFile2(p, data, { flag: "wx" })
|
|
36248
36281
|
);
|
|
36249
36282
|
if (!finalPath) return null;
|
|
36250
36283
|
if (value.mimeType.startsWith("image/")) {
|
|
@@ -36279,7 +36312,7 @@ async function materializeArtifacts(result, ctx) {
|
|
|
36279
36312
|
}
|
|
36280
36313
|
if (value.size > 0 && data.length !== value.size) return null;
|
|
36281
36314
|
const downloadedPath = join15(dir, sanitizeSegment(value.filename));
|
|
36282
|
-
await
|
|
36315
|
+
await writeFile2(downloadedPath, data);
|
|
36283
36316
|
if (value.mimeType.startsWith("image/")) {
|
|
36284
36317
|
images.push({ localPath: downloadedPath, data, mimeType: value.mimeType });
|
|
36285
36318
|
}
|
|
@@ -36312,7 +36345,7 @@ function getDeviceIdFromArgs(args) {
|
|
|
36312
36345
|
}
|
|
36313
36346
|
|
|
36314
36347
|
// ../telemetry/src/debug.ts
|
|
36315
|
-
import * as
|
|
36348
|
+
import * as fs11 from "node:fs";
|
|
36316
36349
|
|
|
36317
36350
|
// ../telemetry/src/paths.ts
|
|
36318
36351
|
import * as path15 from "node:path";
|
|
@@ -36647,7 +36680,7 @@ var SESSION_ID2 = randomUUID5();
|
|
|
36647
36680
|
|
|
36648
36681
|
// ../telemetry/src/identity.ts
|
|
36649
36682
|
import * as crypto2 from "node:crypto";
|
|
36650
|
-
import * as
|
|
36683
|
+
import * as fs12 from "node:fs";
|
|
36651
36684
|
import * as path16 from "node:path";
|
|
36652
36685
|
|
|
36653
36686
|
// ../telemetry/src/fingerprint.ts
|
|
@@ -36655,14 +36688,14 @@ import { execFileSync as execFileSync2, spawn as spawn3 } from "node:child_proce
|
|
|
36655
36688
|
|
|
36656
36689
|
// ../native-devtools-ios/src/index.ts
|
|
36657
36690
|
import * as path17 from "node:path";
|
|
36658
|
-
import * as
|
|
36691
|
+
import * as fs13 from "node:fs";
|
|
36659
36692
|
var DYLIB_DIR = process.env.ARGENT_NATIVE_DEVTOOLS_DIR ?? path17.join(__dirname, "..", "dylibs");
|
|
36660
36693
|
var BIN_DIR = process.env.ARGENT_SIMULATOR_SERVER_DIR ?? path17.join(__dirname, "..", "bin");
|
|
36661
36694
|
var DYLIB_TCP_DIR = process.env.ARGENT_NATIVE_DEVTOOLS_TCP_DIR ?? path17.join(DYLIB_DIR, "tcp");
|
|
36662
36695
|
var DYLIB_TVOS_DIR = path17.join(DYLIB_DIR, "tvos");
|
|
36663
36696
|
|
|
36664
36697
|
// ../telemetry/src/consent.ts
|
|
36665
|
-
import * as
|
|
36698
|
+
import * as fs14 from "node:fs";
|
|
36666
36699
|
import * as path18 from "node:path";
|
|
36667
36700
|
var cache = /* @__PURE__ */ new Map();
|
|
36668
36701
|
var sessionOverride = null;
|
|
@@ -36670,7 +36703,7 @@ function readConfigOverrideAt(filePath) {
|
|
|
36670
36703
|
const miss = { mtimeMs: null, fingerprint: null, enabledOverride: null };
|
|
36671
36704
|
let stats;
|
|
36672
36705
|
try {
|
|
36673
|
-
stats =
|
|
36706
|
+
stats = fs14.lstatSync(filePath);
|
|
36674
36707
|
} catch {
|
|
36675
36708
|
cache.set(filePath, miss);
|
|
36676
36709
|
return null;
|
|
@@ -36687,7 +36720,7 @@ function readConfigOverrideAt(filePath) {
|
|
|
36687
36720
|
}
|
|
36688
36721
|
let parsedEnabled = null;
|
|
36689
36722
|
try {
|
|
36690
|
-
const raw2 =
|
|
36723
|
+
const raw2 = fs14.readFileSync(filePath, "utf8");
|
|
36691
36724
|
const json = JSON.parse(raw2);
|
|
36692
36725
|
if (json && typeof json === "object") {
|
|
36693
36726
|
const t = json.telemetry;
|
|
@@ -38182,12 +38215,12 @@ function debuggerLogRegistryText(result) {
|
|
|
38182
38215
|
var SERVER_INSTRUCTIONS = "Argent controls iOS, Android, Chromium, Mac, TV, and HarmonyOS apps. Use the platform named by the user; otherwise prefer an already-running device from `list-devices` (do not default to iOS). In a single-platform project, boot that platform. Prefer Argent tools over raw `xcrun`/`adb`; use `launch-app`/`open-url` instead of tapping home-screen icons. Load `argent-create-e2e` (`argent-qa-e2e` for acceptance tests) before the first action if an e2e test may be needed (recording is not retroactive), and load the matching `argent-*` skill before React Native build/debug, profiling, physical phone, Mac app, or TV work. Interaction tools return a screenshot + accessibility tree with normalized [0,1] tap frames (or an unchanged note / `-`+`+` diff referencing an earlier screenshot/tree id). Take tap coordinates from that tree \u2014 never guess from pixels \u2014 and call `describe` only without a fresh tree. After two failed taps, re-discover. Use `await-ui-element` instead of polling. Do not stop simulator servers when finishing; call `stop-all-simulator-servers` only when asked to clean up or when a skill tells you to recycle a device's services, scoped with `devices: [...]` (the tool-server is shared across agents), and never stop a user-started Metro. CLI: `argent --help`.";
|
|
38183
38216
|
|
|
38184
38217
|
// ../argent-mcp/src/installed-version.ts
|
|
38185
|
-
import * as
|
|
38218
|
+
import * as fs15 from "node:fs";
|
|
38186
38219
|
import * as path19 from "node:path";
|
|
38187
38220
|
function getInstalledVersion() {
|
|
38188
38221
|
try {
|
|
38189
38222
|
const pkgPath = path19.resolve(import.meta.dirname, "..", "package.json");
|
|
38190
|
-
const pkg = JSON.parse(
|
|
38223
|
+
const pkg = JSON.parse(fs15.readFileSync(pkgPath, "utf8"));
|
|
38191
38224
|
return pkg.version ?? "unknown";
|
|
38192
38225
|
} catch {
|
|
38193
38226
|
return "unknown";
|
|
@@ -38312,7 +38345,7 @@ import {
|
|
|
38312
38345
|
linkSync as linkSync2,
|
|
38313
38346
|
mkdirSync as mkdirSync7,
|
|
38314
38347
|
readFileSync as readFileSync9,
|
|
38315
|
-
renameSync as
|
|
38348
|
+
renameSync as renameSync4,
|
|
38316
38349
|
rmSync as rmSync4,
|
|
38317
38350
|
statSync as statSync5
|
|
38318
38351
|
} from "node:fs";
|
|
@@ -38364,7 +38397,7 @@ function createCallLog(file, maxBytes = CALL_LOG_MAX_BYTES) {
|
|
|
38364
38397
|
function rotate(file, measured) {
|
|
38365
38398
|
const aside = `${file}.${process.pid}.rotating`;
|
|
38366
38399
|
try {
|
|
38367
|
-
|
|
38400
|
+
renameSync4(file, aside);
|
|
38368
38401
|
} catch {
|
|
38369
38402
|
return;
|
|
38370
38403
|
}
|
|
@@ -38376,7 +38409,7 @@ function rotate(file, measured) {
|
|
|
38376
38409
|
}
|
|
38377
38410
|
if (moved.ino === measured.ino && moved.dev === measured.dev) {
|
|
38378
38411
|
try {
|
|
38379
|
-
|
|
38412
|
+
renameSync4(aside, `${file}.1`);
|
|
38380
38413
|
} catch {
|
|
38381
38414
|
}
|
|
38382
38415
|
return;
|
|
@@ -38473,7 +38506,7 @@ async function startMcpServer(options) {
|
|
|
38473
38506
|
const autoDescribeOn = autoDescribeEnabled();
|
|
38474
38507
|
const whatsNewOn = whatsNewEnabled();
|
|
38475
38508
|
const installedVersion = getInstalledVersion();
|
|
38476
|
-
const highlightsVersion = true ? "0.35.1-next.
|
|
38509
|
+
const highlightsVersion = true ? "0.35.1-next.81" : installedVersion;
|
|
38477
38510
|
const captureTimeoutMs = options.captureTimeoutMs ?? CAPTURE_TIMEOUT_MS;
|
|
38478
38511
|
const trees = createTreeMemory();
|
|
38479
38512
|
const screenshots = createScreenshotMemory();
|