@swmansion/argent 0.34.1-next.63 → 0.34.1-next.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli-cmds.mjs +527 -252
- package/dist/installer.mjs +1 -1
- package/dist/tool-server.cjs +1 -1
- package/package.json +1 -1
package/dist/cli-cmds.mjs
CHANGED
|
@@ -124,17 +124,17 @@ var require_visit = __commonJS({
|
|
|
124
124
|
visit2.BREAK = BREAK;
|
|
125
125
|
visit2.SKIP = SKIP;
|
|
126
126
|
visit2.REMOVE = REMOVE;
|
|
127
|
-
function visit_(key, node2, visitor,
|
|
128
|
-
const ctrl = callVisitor(key, node2, visitor,
|
|
127
|
+
function visit_(key, node2, visitor, path30) {
|
|
128
|
+
const ctrl = callVisitor(key, node2, visitor, path30);
|
|
129
129
|
if (identity2.isNode(ctrl) || identity2.isPair(ctrl)) {
|
|
130
|
-
replaceNode(key,
|
|
131
|
-
return visit_(key, ctrl, visitor,
|
|
130
|
+
replaceNode(key, path30, ctrl);
|
|
131
|
+
return visit_(key, ctrl, visitor, path30);
|
|
132
132
|
}
|
|
133
133
|
if (typeof ctrl !== "symbol") {
|
|
134
134
|
if (identity2.isCollection(node2)) {
|
|
135
|
-
|
|
135
|
+
path30 = Object.freeze(path30.concat(node2));
|
|
136
136
|
for (let i2 = 0; i2 < node2.items.length; ++i2) {
|
|
137
|
-
const ci = visit_(i2, node2.items[i2], visitor,
|
|
137
|
+
const ci = visit_(i2, node2.items[i2], visitor, path30);
|
|
138
138
|
if (typeof ci === "number")
|
|
139
139
|
i2 = ci - 1;
|
|
140
140
|
else if (ci === BREAK)
|
|
@@ -145,13 +145,13 @@ var require_visit = __commonJS({
|
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
147
|
} else if (identity2.isPair(node2)) {
|
|
148
|
-
|
|
149
|
-
const ck = visit_("key", node2.key, visitor,
|
|
148
|
+
path30 = Object.freeze(path30.concat(node2));
|
|
149
|
+
const ck = visit_("key", node2.key, visitor, path30);
|
|
150
150
|
if (ck === BREAK)
|
|
151
151
|
return BREAK;
|
|
152
152
|
else if (ck === REMOVE)
|
|
153
153
|
node2.key = null;
|
|
154
|
-
const cv = visit_("value", node2.value, visitor,
|
|
154
|
+
const cv = visit_("value", node2.value, visitor, path30);
|
|
155
155
|
if (cv === BREAK)
|
|
156
156
|
return BREAK;
|
|
157
157
|
else if (cv === REMOVE)
|
|
@@ -172,17 +172,17 @@ var require_visit = __commonJS({
|
|
|
172
172
|
visitAsync.BREAK = BREAK;
|
|
173
173
|
visitAsync.SKIP = SKIP;
|
|
174
174
|
visitAsync.REMOVE = REMOVE;
|
|
175
|
-
async function visitAsync_(key, node2, visitor,
|
|
176
|
-
const ctrl = await callVisitor(key, node2, visitor,
|
|
175
|
+
async function visitAsync_(key, node2, visitor, path30) {
|
|
176
|
+
const ctrl = await callVisitor(key, node2, visitor, path30);
|
|
177
177
|
if (identity2.isNode(ctrl) || identity2.isPair(ctrl)) {
|
|
178
|
-
replaceNode(key,
|
|
179
|
-
return visitAsync_(key, ctrl, visitor,
|
|
178
|
+
replaceNode(key, path30, ctrl);
|
|
179
|
+
return visitAsync_(key, ctrl, visitor, path30);
|
|
180
180
|
}
|
|
181
181
|
if (typeof ctrl !== "symbol") {
|
|
182
182
|
if (identity2.isCollection(node2)) {
|
|
183
|
-
|
|
183
|
+
path30 = Object.freeze(path30.concat(node2));
|
|
184
184
|
for (let i2 = 0; i2 < node2.items.length; ++i2) {
|
|
185
|
-
const ci = await visitAsync_(i2, node2.items[i2], visitor,
|
|
185
|
+
const ci = await visitAsync_(i2, node2.items[i2], visitor, path30);
|
|
186
186
|
if (typeof ci === "number")
|
|
187
187
|
i2 = ci - 1;
|
|
188
188
|
else if (ci === BREAK)
|
|
@@ -193,13 +193,13 @@ var require_visit = __commonJS({
|
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
195
|
} else if (identity2.isPair(node2)) {
|
|
196
|
-
|
|
197
|
-
const ck = await visitAsync_("key", node2.key, visitor,
|
|
196
|
+
path30 = Object.freeze(path30.concat(node2));
|
|
197
|
+
const ck = await visitAsync_("key", node2.key, visitor, path30);
|
|
198
198
|
if (ck === BREAK)
|
|
199
199
|
return BREAK;
|
|
200
200
|
else if (ck === REMOVE)
|
|
201
201
|
node2.key = null;
|
|
202
|
-
const cv = await visitAsync_("value", node2.value, visitor,
|
|
202
|
+
const cv = await visitAsync_("value", node2.value, visitor, path30);
|
|
203
203
|
if (cv === BREAK)
|
|
204
204
|
return BREAK;
|
|
205
205
|
else if (cv === REMOVE)
|
|
@@ -226,23 +226,23 @@ var require_visit = __commonJS({
|
|
|
226
226
|
}
|
|
227
227
|
return visitor;
|
|
228
228
|
}
|
|
229
|
-
function callVisitor(key, node2, visitor,
|
|
229
|
+
function callVisitor(key, node2, visitor, path30) {
|
|
230
230
|
if (typeof visitor === "function")
|
|
231
|
-
return visitor(key, node2,
|
|
231
|
+
return visitor(key, node2, path30);
|
|
232
232
|
if (identity2.isMap(node2))
|
|
233
|
-
return visitor.Map?.(key, node2,
|
|
233
|
+
return visitor.Map?.(key, node2, path30);
|
|
234
234
|
if (identity2.isSeq(node2))
|
|
235
|
-
return visitor.Seq?.(key, node2,
|
|
235
|
+
return visitor.Seq?.(key, node2, path30);
|
|
236
236
|
if (identity2.isPair(node2))
|
|
237
|
-
return visitor.Pair?.(key, node2,
|
|
237
|
+
return visitor.Pair?.(key, node2, path30);
|
|
238
238
|
if (identity2.isScalar(node2))
|
|
239
|
-
return visitor.Scalar?.(key, node2,
|
|
239
|
+
return visitor.Scalar?.(key, node2, path30);
|
|
240
240
|
if (identity2.isAlias(node2))
|
|
241
|
-
return visitor.Alias?.(key, node2,
|
|
241
|
+
return visitor.Alias?.(key, node2, path30);
|
|
242
242
|
return void 0;
|
|
243
243
|
}
|
|
244
|
-
function replaceNode(key,
|
|
245
|
-
const parent =
|
|
244
|
+
function replaceNode(key, path30, node2) {
|
|
245
|
+
const parent = path30[path30.length - 1];
|
|
246
246
|
if (identity2.isCollection(parent)) {
|
|
247
247
|
parent.items[key] = node2;
|
|
248
248
|
} else if (identity2.isPair(parent)) {
|
|
@@ -854,10 +854,10 @@ var require_Collection = __commonJS({
|
|
|
854
854
|
var createNode = require_createNode();
|
|
855
855
|
var identity2 = require_identity();
|
|
856
856
|
var Node = require_Node();
|
|
857
|
-
function collectionFromPath(schema,
|
|
857
|
+
function collectionFromPath(schema, path30, value) {
|
|
858
858
|
let v = value;
|
|
859
|
-
for (let i2 =
|
|
860
|
-
const k =
|
|
859
|
+
for (let i2 = path30.length - 1; i2 >= 0; --i2) {
|
|
860
|
+
const k = path30[i2];
|
|
861
861
|
if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
|
|
862
862
|
const a2 = [];
|
|
863
863
|
a2[k] = v;
|
|
@@ -876,7 +876,7 @@ var require_Collection = __commonJS({
|
|
|
876
876
|
sourceObjects: /* @__PURE__ */ new Map()
|
|
877
877
|
});
|
|
878
878
|
}
|
|
879
|
-
var isEmptyPath = (
|
|
879
|
+
var isEmptyPath = (path30) => path30 == null || typeof path30 === "object" && !!path30[Symbol.iterator]().next().done;
|
|
880
880
|
var Collection = class extends Node.NodeBase {
|
|
881
881
|
constructor(type, schema) {
|
|
882
882
|
super(type);
|
|
@@ -906,11 +906,11 @@ var require_Collection = __commonJS({
|
|
|
906
906
|
* be a Pair instance or a `{ key, value }` object, which may not have a key
|
|
907
907
|
* that already exists in the map.
|
|
908
908
|
*/
|
|
909
|
-
addIn(
|
|
910
|
-
if (isEmptyPath(
|
|
909
|
+
addIn(path30, value) {
|
|
910
|
+
if (isEmptyPath(path30))
|
|
911
911
|
this.add(value);
|
|
912
912
|
else {
|
|
913
|
-
const [key, ...rest] =
|
|
913
|
+
const [key, ...rest] = path30;
|
|
914
914
|
const node2 = this.get(key, true);
|
|
915
915
|
if (identity2.isCollection(node2))
|
|
916
916
|
node2.addIn(rest, value);
|
|
@@ -924,8 +924,8 @@ var require_Collection = __commonJS({
|
|
|
924
924
|
* Removes a value from the collection.
|
|
925
925
|
* @returns `true` if the item was found and removed.
|
|
926
926
|
*/
|
|
927
|
-
deleteIn(
|
|
928
|
-
const [key, ...rest] =
|
|
927
|
+
deleteIn(path30) {
|
|
928
|
+
const [key, ...rest] = path30;
|
|
929
929
|
if (rest.length === 0)
|
|
930
930
|
return this.delete(key);
|
|
931
931
|
const node2 = this.get(key, true);
|
|
@@ -939,8 +939,8 @@ var require_Collection = __commonJS({
|
|
|
939
939
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
940
940
|
* `true` (collections are always returned intact).
|
|
941
941
|
*/
|
|
942
|
-
getIn(
|
|
943
|
-
const [key, ...rest] =
|
|
942
|
+
getIn(path30, keepScalar) {
|
|
943
|
+
const [key, ...rest] = path30;
|
|
944
944
|
const node2 = this.get(key, true);
|
|
945
945
|
if (rest.length === 0)
|
|
946
946
|
return !keepScalar && identity2.isScalar(node2) ? node2.value : node2;
|
|
@@ -958,8 +958,8 @@ var require_Collection = __commonJS({
|
|
|
958
958
|
/**
|
|
959
959
|
* Checks if the collection includes a value with the key `key`.
|
|
960
960
|
*/
|
|
961
|
-
hasIn(
|
|
962
|
-
const [key, ...rest] =
|
|
961
|
+
hasIn(path30) {
|
|
962
|
+
const [key, ...rest] = path30;
|
|
963
963
|
if (rest.length === 0)
|
|
964
964
|
return this.has(key);
|
|
965
965
|
const node2 = this.get(key, true);
|
|
@@ -969,8 +969,8 @@ var require_Collection = __commonJS({
|
|
|
969
969
|
* Sets a value in this collection. For `!!set`, `value` needs to be a
|
|
970
970
|
* boolean to add/remove the item from the set.
|
|
971
971
|
*/
|
|
972
|
-
setIn(
|
|
973
|
-
const [key, ...rest] =
|
|
972
|
+
setIn(path30, value) {
|
|
973
|
+
const [key, ...rest] = path30;
|
|
974
974
|
if (rest.length === 0) {
|
|
975
975
|
this.set(key, value);
|
|
976
976
|
} else {
|
|
@@ -3485,9 +3485,9 @@ var require_Document = __commonJS({
|
|
|
3485
3485
|
this.contents.add(value);
|
|
3486
3486
|
}
|
|
3487
3487
|
/** Adds a value to the document. */
|
|
3488
|
-
addIn(
|
|
3488
|
+
addIn(path30, value) {
|
|
3489
3489
|
if (assertCollection(this.contents))
|
|
3490
|
-
this.contents.addIn(
|
|
3490
|
+
this.contents.addIn(path30, value);
|
|
3491
3491
|
}
|
|
3492
3492
|
/**
|
|
3493
3493
|
* Create a new `Alias` node, ensuring that the target `node` has the required anchor.
|
|
@@ -3562,14 +3562,14 @@ var require_Document = __commonJS({
|
|
|
3562
3562
|
* Removes a value from the document.
|
|
3563
3563
|
* @returns `true` if the item was found and removed.
|
|
3564
3564
|
*/
|
|
3565
|
-
deleteIn(
|
|
3566
|
-
if (Collection.isEmptyPath(
|
|
3565
|
+
deleteIn(path30) {
|
|
3566
|
+
if (Collection.isEmptyPath(path30)) {
|
|
3567
3567
|
if (this.contents == null)
|
|
3568
3568
|
return false;
|
|
3569
3569
|
this.contents = null;
|
|
3570
3570
|
return true;
|
|
3571
3571
|
}
|
|
3572
|
-
return assertCollection(this.contents) ? this.contents.deleteIn(
|
|
3572
|
+
return assertCollection(this.contents) ? this.contents.deleteIn(path30) : false;
|
|
3573
3573
|
}
|
|
3574
3574
|
/**
|
|
3575
3575
|
* Returns item at `key`, or `undefined` if not found. By default unwraps
|
|
@@ -3584,10 +3584,10 @@ var require_Document = __commonJS({
|
|
|
3584
3584
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
3585
3585
|
* `true` (collections are always returned intact).
|
|
3586
3586
|
*/
|
|
3587
|
-
getIn(
|
|
3588
|
-
if (Collection.isEmptyPath(
|
|
3587
|
+
getIn(path30, keepScalar) {
|
|
3588
|
+
if (Collection.isEmptyPath(path30))
|
|
3589
3589
|
return !keepScalar && identity2.isScalar(this.contents) ? this.contents.value : this.contents;
|
|
3590
|
-
return identity2.isCollection(this.contents) ? this.contents.getIn(
|
|
3590
|
+
return identity2.isCollection(this.contents) ? this.contents.getIn(path30, keepScalar) : void 0;
|
|
3591
3591
|
}
|
|
3592
3592
|
/**
|
|
3593
3593
|
* Checks if the document includes a value with the key `key`.
|
|
@@ -3598,10 +3598,10 @@ var require_Document = __commonJS({
|
|
|
3598
3598
|
/**
|
|
3599
3599
|
* Checks if the document includes a value at `path`.
|
|
3600
3600
|
*/
|
|
3601
|
-
hasIn(
|
|
3602
|
-
if (Collection.isEmptyPath(
|
|
3601
|
+
hasIn(path30) {
|
|
3602
|
+
if (Collection.isEmptyPath(path30))
|
|
3603
3603
|
return this.contents !== void 0;
|
|
3604
|
-
return identity2.isCollection(this.contents) ? this.contents.hasIn(
|
|
3604
|
+
return identity2.isCollection(this.contents) ? this.contents.hasIn(path30) : false;
|
|
3605
3605
|
}
|
|
3606
3606
|
/**
|
|
3607
3607
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
@@ -3618,13 +3618,13 @@ var require_Document = __commonJS({
|
|
|
3618
3618
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
3619
3619
|
* boolean to add/remove the item from the set.
|
|
3620
3620
|
*/
|
|
3621
|
-
setIn(
|
|
3622
|
-
if (Collection.isEmptyPath(
|
|
3621
|
+
setIn(path30, value) {
|
|
3622
|
+
if (Collection.isEmptyPath(path30)) {
|
|
3623
3623
|
this.contents = value;
|
|
3624
3624
|
} else if (this.contents == null) {
|
|
3625
|
-
this.contents = Collection.collectionFromPath(this.schema, Array.from(
|
|
3625
|
+
this.contents = Collection.collectionFromPath(this.schema, Array.from(path30), value);
|
|
3626
3626
|
} else if (assertCollection(this.contents)) {
|
|
3627
|
-
this.contents.setIn(
|
|
3627
|
+
this.contents.setIn(path30, value);
|
|
3628
3628
|
}
|
|
3629
3629
|
}
|
|
3630
3630
|
/**
|
|
@@ -5585,9 +5585,9 @@ var require_cst_visit = __commonJS({
|
|
|
5585
5585
|
visit2.BREAK = BREAK;
|
|
5586
5586
|
visit2.SKIP = SKIP;
|
|
5587
5587
|
visit2.REMOVE = REMOVE;
|
|
5588
|
-
visit2.itemAtPath = (cst,
|
|
5588
|
+
visit2.itemAtPath = (cst, path30) => {
|
|
5589
5589
|
let item = cst;
|
|
5590
|
-
for (const [field, index] of
|
|
5590
|
+
for (const [field, index] of path30) {
|
|
5591
5591
|
const tok = item?.[field];
|
|
5592
5592
|
if (tok && "items" in tok) {
|
|
5593
5593
|
item = tok.items[index];
|
|
@@ -5596,23 +5596,23 @@ var require_cst_visit = __commonJS({
|
|
|
5596
5596
|
}
|
|
5597
5597
|
return item;
|
|
5598
5598
|
};
|
|
5599
|
-
visit2.parentCollection = (cst,
|
|
5600
|
-
const parent = visit2.itemAtPath(cst,
|
|
5601
|
-
const field =
|
|
5599
|
+
visit2.parentCollection = (cst, path30) => {
|
|
5600
|
+
const parent = visit2.itemAtPath(cst, path30.slice(0, -1));
|
|
5601
|
+
const field = path30[path30.length - 1][0];
|
|
5602
5602
|
const coll = parent?.[field];
|
|
5603
5603
|
if (coll && "items" in coll)
|
|
5604
5604
|
return coll;
|
|
5605
5605
|
throw new Error("Parent collection not found");
|
|
5606
5606
|
};
|
|
5607
|
-
function _visit(
|
|
5608
|
-
let ctrl = visitor(item,
|
|
5607
|
+
function _visit(path30, item, visitor) {
|
|
5608
|
+
let ctrl = visitor(item, path30);
|
|
5609
5609
|
if (typeof ctrl === "symbol")
|
|
5610
5610
|
return ctrl;
|
|
5611
5611
|
for (const field of ["key", "value"]) {
|
|
5612
5612
|
const token = item[field];
|
|
5613
5613
|
if (token && "items" in token) {
|
|
5614
5614
|
for (let i2 = 0; i2 < token.items.length; ++i2) {
|
|
5615
|
-
const ci = _visit(Object.freeze(
|
|
5615
|
+
const ci = _visit(Object.freeze(path30.concat([[field, i2]])), token.items[i2], visitor);
|
|
5616
5616
|
if (typeof ci === "number")
|
|
5617
5617
|
i2 = ci - 1;
|
|
5618
5618
|
else if (ci === BREAK)
|
|
@@ -5623,10 +5623,10 @@ var require_cst_visit = __commonJS({
|
|
|
5623
5623
|
}
|
|
5624
5624
|
}
|
|
5625
5625
|
if (typeof ctrl === "function" && field === "key")
|
|
5626
|
-
ctrl = ctrl(item,
|
|
5626
|
+
ctrl = ctrl(item, path30);
|
|
5627
5627
|
}
|
|
5628
5628
|
}
|
|
5629
|
-
return typeof ctrl === "function" ? ctrl(item,
|
|
5629
|
+
return typeof ctrl === "function" ? ctrl(item, path30) : ctrl;
|
|
5630
5630
|
}
|
|
5631
5631
|
exports.visit = visit2;
|
|
5632
5632
|
}
|
|
@@ -8917,7 +8917,7 @@ var require_src = __commonJS({
|
|
|
8917
8917
|
|
|
8918
8918
|
// ../argent-cli/src/run.ts
|
|
8919
8919
|
import * as fs13 from "node:fs";
|
|
8920
|
-
import * as
|
|
8920
|
+
import * as path20 from "node:path";
|
|
8921
8921
|
|
|
8922
8922
|
// ../argent-tools-client/src/launcher.ts
|
|
8923
8923
|
import * as net from "node:net";
|
|
@@ -10265,8 +10265,8 @@ var UNEXPANDED_PATH = /^~|\$[A-Za-z0-9_{(]|`|%[A-Za-z_][A-Za-z0-9_]*%|^[A-Za-z][
|
|
|
10265
10265
|
function isUnexpandedPath(p) {
|
|
10266
10266
|
return UNEXPANDED_PATH.test(p);
|
|
10267
10267
|
}
|
|
10268
|
-
function isClientFileArgument({ spec, path:
|
|
10269
|
-
return spec.kind === "file" && spec.path === `\${${spec.target}}` &&
|
|
10268
|
+
function isClientFileArgument({ spec, path: path30 }) {
|
|
10269
|
+
return spec.kind === "file" && spec.path === `\${${spec.target}}` && path30.startsWith("/") && hasToolFileExtension(path30);
|
|
10270
10270
|
}
|
|
10271
10271
|
|
|
10272
10272
|
// ../registry/src/flow-platforms.ts
|
|
@@ -11800,10 +11800,10 @@ function mergeDefs(...defs) {
|
|
|
11800
11800
|
function cloneDef(schema) {
|
|
11801
11801
|
return mergeDefs(schema._zod.def);
|
|
11802
11802
|
}
|
|
11803
|
-
function getElementAtPath(obj,
|
|
11804
|
-
if (!
|
|
11803
|
+
function getElementAtPath(obj, path30) {
|
|
11804
|
+
if (!path30)
|
|
11805
11805
|
return obj;
|
|
11806
|
-
return
|
|
11806
|
+
return path30.reduce((acc, key) => acc?.[key], obj);
|
|
11807
11807
|
}
|
|
11808
11808
|
function promiseAllObject(promisesObj) {
|
|
11809
11809
|
const keys = Object.keys(promisesObj);
|
|
@@ -12143,11 +12143,11 @@ function explicitlyAborted(x, startIndex = 0) {
|
|
|
12143
12143
|
}
|
|
12144
12144
|
return false;
|
|
12145
12145
|
}
|
|
12146
|
-
function prefixIssues(
|
|
12146
|
+
function prefixIssues(path30, issues) {
|
|
12147
12147
|
return issues.map((iss) => {
|
|
12148
12148
|
var _a3;
|
|
12149
12149
|
(_a3 = iss).path ?? (_a3.path = []);
|
|
12150
|
-
iss.path.unshift(
|
|
12150
|
+
iss.path.unshift(path30);
|
|
12151
12151
|
return iss;
|
|
12152
12152
|
});
|
|
12153
12153
|
}
|
|
@@ -12609,16 +12609,16 @@ function flattenError(error63, mapper = (issue2) => issue2.message) {
|
|
|
12609
12609
|
}
|
|
12610
12610
|
function formatError(error63, mapper = (issue2) => issue2.message) {
|
|
12611
12611
|
const fieldErrors = { _errors: [] };
|
|
12612
|
-
const processError = (error64,
|
|
12612
|
+
const processError = (error64, path30 = []) => {
|
|
12613
12613
|
for (const issue2 of error64.issues) {
|
|
12614
12614
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
12615
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
12615
|
+
issue2.errors.map((issues) => processError({ issues }, [...path30, ...issue2.path]));
|
|
12616
12616
|
} else if (issue2.code === "invalid_key") {
|
|
12617
|
-
processError({ issues: issue2.issues }, [...
|
|
12617
|
+
processError({ issues: issue2.issues }, [...path30, ...issue2.path]);
|
|
12618
12618
|
} else if (issue2.code === "invalid_element") {
|
|
12619
|
-
processError({ issues: issue2.issues }, [...
|
|
12619
|
+
processError({ issues: issue2.issues }, [...path30, ...issue2.path]);
|
|
12620
12620
|
} else {
|
|
12621
|
-
const fullpath = [...
|
|
12621
|
+
const fullpath = [...path30, ...issue2.path];
|
|
12622
12622
|
if (fullpath.length === 0) {
|
|
12623
12623
|
fieldErrors._errors.push(mapper(issue2));
|
|
12624
12624
|
} else {
|
|
@@ -12657,17 +12657,17 @@ function formatError(error63, mapper = (issue2) => issue2.message) {
|
|
|
12657
12657
|
}
|
|
12658
12658
|
function treeifyError(error63, mapper = (issue2) => issue2.message) {
|
|
12659
12659
|
const result = { errors: [] };
|
|
12660
|
-
const processError = (error64,
|
|
12660
|
+
const processError = (error64, path30 = []) => {
|
|
12661
12661
|
var _a3;
|
|
12662
12662
|
for (const issue2 of error64.issues) {
|
|
12663
12663
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
12664
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
12664
|
+
issue2.errors.map((issues) => processError({ issues }, [...path30, ...issue2.path]));
|
|
12665
12665
|
} else if (issue2.code === "invalid_key") {
|
|
12666
|
-
processError({ issues: issue2.issues }, [...
|
|
12666
|
+
processError({ issues: issue2.issues }, [...path30, ...issue2.path]);
|
|
12667
12667
|
} else if (issue2.code === "invalid_element") {
|
|
12668
|
-
processError({ issues: issue2.issues }, [...
|
|
12668
|
+
processError({ issues: issue2.issues }, [...path30, ...issue2.path]);
|
|
12669
12669
|
} else {
|
|
12670
|
-
const fullpath = [...
|
|
12670
|
+
const fullpath = [...path30, ...issue2.path];
|
|
12671
12671
|
if (fullpath.length === 0) {
|
|
12672
12672
|
result.errors.push(mapper(issue2));
|
|
12673
12673
|
continue;
|
|
@@ -12706,8 +12706,8 @@ function treeifyError(error63, mapper = (issue2) => issue2.message) {
|
|
|
12706
12706
|
}
|
|
12707
12707
|
function toDotPath(_path) {
|
|
12708
12708
|
const segs = [];
|
|
12709
|
-
const
|
|
12710
|
-
for (const seg of
|
|
12709
|
+
const path30 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
|
|
12710
|
+
for (const seg of path30) {
|
|
12711
12711
|
if (typeof seg === "number")
|
|
12712
12712
|
segs.push(`[${seg}]`);
|
|
12713
12713
|
else if (typeof seg === "symbol")
|
|
@@ -29845,13 +29845,13 @@ function resolveRef(ref, ctx) {
|
|
|
29845
29845
|
if (!ref.startsWith("#")) {
|
|
29846
29846
|
throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
|
|
29847
29847
|
}
|
|
29848
|
-
const
|
|
29849
|
-
if (
|
|
29848
|
+
const path30 = ref.slice(1).split("/").filter(Boolean);
|
|
29849
|
+
if (path30.length === 0) {
|
|
29850
29850
|
return ctx.rootSchema;
|
|
29851
29851
|
}
|
|
29852
29852
|
const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
|
|
29853
|
-
if (
|
|
29854
|
-
const key =
|
|
29853
|
+
if (path30[0] === defsKey) {
|
|
29854
|
+
const key = path30[1] === void 0 ? void 0 : decodeJSONPointerSegment(path30[1]);
|
|
29855
29855
|
if (!key || !ctx.defs[key]) {
|
|
29856
29856
|
throw new Error(`Reference not found: ${ref}`);
|
|
29857
29857
|
}
|
|
@@ -30704,9 +30704,9 @@ function date4(params) {
|
|
|
30704
30704
|
import { randomUUID as randomUUID3 } from "node:crypto";
|
|
30705
30705
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
30706
30706
|
var resolvedDuringInvocation = new AsyncLocalStorage();
|
|
30707
|
-
function valueAtPath(root,
|
|
30707
|
+
function valueAtPath(root, path30) {
|
|
30708
30708
|
let current = root;
|
|
30709
|
-
for (const key of
|
|
30709
|
+
for (const key of path30) {
|
|
30710
30710
|
if (current === null || typeof current !== "object") return void 0;
|
|
30711
30711
|
if (!Object.hasOwn(current, key)) return void 0;
|
|
30712
30712
|
current = current[key];
|
|
@@ -30866,8 +30866,8 @@ function parseLinkTarget(input2) {
|
|
|
30866
30866
|
const host = u3.hostname.startsWith("[") ? u3.hostname.slice(1, -1) : u3.hostname;
|
|
30867
30867
|
if (!host) throw new Error(`URL "${input2}" is missing a host.`);
|
|
30868
30868
|
const port = u3.port ? Number(u3.port) : u3.protocol === "https:" ? 443 : 80;
|
|
30869
|
-
const
|
|
30870
|
-
const url2 = `${u3.protocol}//${u3.host}${
|
|
30869
|
+
const path30 = u3.pathname === "/" ? "" : u3.pathname.replace(/\/+$/, "");
|
|
30870
|
+
const url2 = `${u3.protocol}//${u3.host}${path30}`;
|
|
30871
30871
|
const token = u3.username ? decodeURIComponent(u3.username) : void 0;
|
|
30872
30872
|
return { url: url2, host, port, ...token ? { token } : {} };
|
|
30873
30873
|
}
|
|
@@ -31098,8 +31098,8 @@ async function runTar(archive, args, signal) {
|
|
|
31098
31098
|
function normalizeTarMemberPath(memberPath) {
|
|
31099
31099
|
return memberPath.replace(/^\.\//, "").replace(/\\/g, "/");
|
|
31100
31100
|
}
|
|
31101
|
-
function isContainedPath(
|
|
31102
|
-
const slashed =
|
|
31101
|
+
function isContainedPath(path30, windows = process.platform === "win32") {
|
|
31102
|
+
const slashed = path30.replace(/\\/g, "/");
|
|
31103
31103
|
const drive = windows ? /^[A-Za-z]:/ : /^[A-Za-z]:\//;
|
|
31104
31104
|
return !slashed.startsWith("/") && !drive.test(slashed) && !slashed.split("/").includes("..");
|
|
31105
31105
|
}
|
|
@@ -32123,10 +32123,10 @@ function assertFiniteNumbers(args) {
|
|
|
32123
32123
|
if (typeof item === "object" && item !== null) {
|
|
32124
32124
|
pending.push({ value: item, key, parent: visit2 });
|
|
32125
32125
|
} else if (typeof item === "number" && !Number.isFinite(item)) {
|
|
32126
|
-
const
|
|
32127
|
-
for (let at = visit2; at.parent; at = at.parent)
|
|
32128
|
-
|
|
32129
|
-
issues.push({ code: "invalid_type", path:
|
|
32126
|
+
const path30 = [key];
|
|
32127
|
+
for (let at = visit2; at.parent; at = at.parent) path30.push(at.key);
|
|
32128
|
+
path30.reverse();
|
|
32129
|
+
issues.push({ code: "invalid_type", path: path30, message: `expected a number, got ${item}` });
|
|
32130
32130
|
if (issues.length === MAX_NON_FINITE_ISSUES) break;
|
|
32131
32131
|
}
|
|
32132
32132
|
}
|
|
@@ -32550,10 +32550,10 @@ async function writeDurableUnique(dir, filename, write) {
|
|
|
32550
32550
|
const stem = filename.slice(0, filename.length - ext.length);
|
|
32551
32551
|
for (let i2 = 1; i2 <= 1e3; i2++) {
|
|
32552
32552
|
const candidate = i2 === 1 ? filename : `${stem} (${i2})${ext}`;
|
|
32553
|
-
const
|
|
32553
|
+
const path30 = join13(dir, candidate);
|
|
32554
32554
|
try {
|
|
32555
|
-
await write(
|
|
32556
|
-
return
|
|
32555
|
+
await write(path30);
|
|
32556
|
+
return path30;
|
|
32557
32557
|
} catch (err) {
|
|
32558
32558
|
if (err?.code === "EEXIST") continue;
|
|
32559
32559
|
throw err;
|
|
@@ -35190,7 +35190,7 @@ function appendRootPathToUrlIfNeeded(url2) {
|
|
|
35190
35190
|
return void 0;
|
|
35191
35191
|
}
|
|
35192
35192
|
}
|
|
35193
|
-
function appendResourcePathToUrl(url2,
|
|
35193
|
+
function appendResourcePathToUrl(url2, path30) {
|
|
35194
35194
|
try {
|
|
35195
35195
|
new URL(url2);
|
|
35196
35196
|
} catch {
|
|
@@ -35200,11 +35200,11 @@ function appendResourcePathToUrl(url2, path29) {
|
|
|
35200
35200
|
if (!url2.endsWith("/")) {
|
|
35201
35201
|
url2 = url2 + "/";
|
|
35202
35202
|
}
|
|
35203
|
-
url2 +=
|
|
35203
|
+
url2 += path30;
|
|
35204
35204
|
try {
|
|
35205
35205
|
new URL(url2);
|
|
35206
35206
|
} catch {
|
|
35207
|
-
diag2.warn(`Configuration: Provided URL appended with '${
|
|
35207
|
+
diag2.warn(`Configuration: Provided URL appended with '${path30}' is not a valid URL, using 'undefined' instead of '${url2}'`);
|
|
35208
35208
|
return void 0;
|
|
35209
35209
|
}
|
|
35210
35210
|
return url2;
|
|
@@ -35867,9 +35867,9 @@ function isReplitAgent(env) {
|
|
|
35867
35867
|
}
|
|
35868
35868
|
var DEVIN_MARKER_PATH = "/opt/.devin";
|
|
35869
35869
|
var JULES_MARKER_PATH = "/opt/environment_summary.sh";
|
|
35870
|
-
function safeExists(fileExists,
|
|
35870
|
+
function safeExists(fileExists, path30) {
|
|
35871
35871
|
try {
|
|
35872
|
-
return fileExists(
|
|
35872
|
+
return fileExists(path30);
|
|
35873
35873
|
} catch {
|
|
35874
35874
|
return false;
|
|
35875
35875
|
}
|
|
@@ -36289,7 +36289,7 @@ function isCi(env = process.env) {
|
|
|
36289
36289
|
var SESSION_ID2 = randomUUID5();
|
|
36290
36290
|
function readCliVersion() {
|
|
36291
36291
|
if (true) {
|
|
36292
|
-
return "0.34.1-next.
|
|
36292
|
+
return "0.34.1-next.65";
|
|
36293
36293
|
}
|
|
36294
36294
|
return "0.0.0";
|
|
36295
36295
|
}
|
|
@@ -37235,11 +37235,11 @@ function isValidationIssue(value) {
|
|
|
37235
37235
|
}
|
|
37236
37236
|
|
|
37237
37237
|
// ../argent-cli/src/e2e.ts
|
|
37238
|
-
var
|
|
37239
|
-
import * as
|
|
37238
|
+
var import_yaml4 = __toESM(require_dist(), 1);
|
|
37239
|
+
import * as fsp2 from "node:fs/promises";
|
|
37240
37240
|
import { constants as fsConstants2 } from "node:fs";
|
|
37241
37241
|
import { createHash as createHash5 } from "node:crypto";
|
|
37242
|
-
import * as
|
|
37242
|
+
import * as path19 from "node:path";
|
|
37243
37243
|
|
|
37244
37244
|
// ../argent-cli/src/command-args.ts
|
|
37245
37245
|
var UsageError = class extends Error {
|
|
@@ -37311,6 +37311,150 @@ function parseCommandArgs(argv, specs) {
|
|
|
37311
37311
|
return { positionals, options };
|
|
37312
37312
|
}
|
|
37313
37313
|
|
|
37314
|
+
// ../argent-cli/src/e2e-suite.ts
|
|
37315
|
+
var import_yaml3 = __toESM(require_dist(), 1);
|
|
37316
|
+
import * as fsp from "node:fs/promises";
|
|
37317
|
+
import * as path18 from "node:path";
|
|
37318
|
+
var SUITE_CONFIG_FILE = "suite.config.yaml";
|
|
37319
|
+
var SuiteConfigError = class extends Error {
|
|
37320
|
+
constructor(message) {
|
|
37321
|
+
super(message);
|
|
37322
|
+
this.name = "SuiteConfigError";
|
|
37323
|
+
}
|
|
37324
|
+
};
|
|
37325
|
+
var SUITE_CONFIG_KEYS = ["tests", "continueOnFailure"];
|
|
37326
|
+
function parseSuiteConfig(text2) {
|
|
37327
|
+
let doc;
|
|
37328
|
+
try {
|
|
37329
|
+
doc = (0, import_yaml3.parse)(text2, { logLevel: "error" });
|
|
37330
|
+
} catch (err) {
|
|
37331
|
+
throw new SuiteConfigError(
|
|
37332
|
+
`not valid YAML: ${(err instanceof Error ? err.message : String(err)).trimEnd()}`
|
|
37333
|
+
);
|
|
37334
|
+
}
|
|
37335
|
+
if (doc === null || doc === void 0) return { continueOnFailure: false };
|
|
37336
|
+
if (typeof doc !== "object" || Array.isArray(doc)) {
|
|
37337
|
+
throw new SuiteConfigError(
|
|
37338
|
+
`must be a YAML map with the keys ${SUITE_CONFIG_KEYS.join(" and ")}`
|
|
37339
|
+
);
|
|
37340
|
+
}
|
|
37341
|
+
const map2 = doc;
|
|
37342
|
+
for (const key of Object.keys(map2)) {
|
|
37343
|
+
if (!SUITE_CONFIG_KEYS.includes(key)) {
|
|
37344
|
+
throw new SuiteConfigError(
|
|
37345
|
+
`unknown key ${JSON.stringify(key)}; the allowed keys are ${SUITE_CONFIG_KEYS.join(" and ")}`
|
|
37346
|
+
);
|
|
37347
|
+
}
|
|
37348
|
+
}
|
|
37349
|
+
const config3 = { continueOnFailure: false };
|
|
37350
|
+
if ("continueOnFailure" in map2) {
|
|
37351
|
+
if (typeof map2.continueOnFailure !== "boolean") {
|
|
37352
|
+
throw new SuiteConfigError("continueOnFailure must be true or false");
|
|
37353
|
+
}
|
|
37354
|
+
config3.continueOnFailure = map2.continueOnFailure;
|
|
37355
|
+
}
|
|
37356
|
+
if ("tests" in map2) {
|
|
37357
|
+
const entries = map2.tests;
|
|
37358
|
+
if (!Array.isArray(entries) || entries.length === 0) {
|
|
37359
|
+
throw new SuiteConfigError("tests must be a non-empty list of test names");
|
|
37360
|
+
}
|
|
37361
|
+
const names = [];
|
|
37362
|
+
for (const [index, entry] of entries.entries()) {
|
|
37363
|
+
if (typeof entry !== "string") {
|
|
37364
|
+
throw new SuiteConfigError(
|
|
37365
|
+
`tests entry ${index + 1} is not a string; put the test name in quotes`
|
|
37366
|
+
);
|
|
37367
|
+
}
|
|
37368
|
+
const name = entry.endsWith(".yaml") ? entry.slice(0, -".yaml".length) : entry;
|
|
37369
|
+
if (!FLOW_NAME_PATTERN.test(name)) {
|
|
37370
|
+
throw new SuiteConfigError(`tests entry ${JSON.stringify(entry)} is not a valid test name`);
|
|
37371
|
+
}
|
|
37372
|
+
if (names.includes(name)) {
|
|
37373
|
+
throw new SuiteConfigError(`tests lists ${JSON.stringify(name)} more than once`);
|
|
37374
|
+
}
|
|
37375
|
+
names.push(name);
|
|
37376
|
+
}
|
|
37377
|
+
config3.tests = names;
|
|
37378
|
+
}
|
|
37379
|
+
return config3;
|
|
37380
|
+
}
|
|
37381
|
+
async function readSuiteConfig(dir) {
|
|
37382
|
+
let text2;
|
|
37383
|
+
try {
|
|
37384
|
+
text2 = await fsp.readFile(path18.join(dir, SUITE_CONFIG_FILE), "utf8");
|
|
37385
|
+
} catch (err) {
|
|
37386
|
+
const code = err.code;
|
|
37387
|
+
throw new SuiteConfigError(
|
|
37388
|
+
`could not read the file: ${code ?? (err instanceof Error ? err.message : String(err))}`
|
|
37389
|
+
);
|
|
37390
|
+
}
|
|
37391
|
+
return parseSuiteConfig(text2);
|
|
37392
|
+
}
|
|
37393
|
+
function unlistedWarning(file2, manifest) {
|
|
37394
|
+
return `${file2} is not listed in the tests of ${manifest} and does not run`;
|
|
37395
|
+
}
|
|
37396
|
+
async function planDirectoryRun(runDir, collected, manifests) {
|
|
37397
|
+
const byDir = /* @__PURE__ */ new Map();
|
|
37398
|
+
for (const rel of collected) {
|
|
37399
|
+
const dir = path18.dirname(rel);
|
|
37400
|
+
const files = byDir.get(dir);
|
|
37401
|
+
if (files) files.push(rel);
|
|
37402
|
+
else byDir.set(dir, [rel]);
|
|
37403
|
+
}
|
|
37404
|
+
const testless = manifests.filter((manifest) => !byDir.has(path18.dirname(manifest)));
|
|
37405
|
+
const suiteEntries = /* @__PURE__ */ new Map();
|
|
37406
|
+
const unlisted = [];
|
|
37407
|
+
for (const dir of new Set(manifests.map((manifest) => path18.dirname(manifest)))) {
|
|
37408
|
+
const files = byDir.get(dir) ?? [];
|
|
37409
|
+
const manifest = path18.join(dir, SUITE_CONFIG_FILE);
|
|
37410
|
+
let config3;
|
|
37411
|
+
let ordered = files;
|
|
37412
|
+
try {
|
|
37413
|
+
config3 = await readSuiteConfig(path18.join(runDir, dir));
|
|
37414
|
+
if (config3.tests) {
|
|
37415
|
+
ordered = config3.tests.map((name) => {
|
|
37416
|
+
const file2 = files.find((f) => path18.basename(f, ".yaml") === name);
|
|
37417
|
+
if (file2 === void 0) {
|
|
37418
|
+
throw new SuiteConfigError(
|
|
37419
|
+
`tests entry ${JSON.stringify(name)} names no e2e test in this directory`
|
|
37420
|
+
);
|
|
37421
|
+
}
|
|
37422
|
+
return file2;
|
|
37423
|
+
});
|
|
37424
|
+
}
|
|
37425
|
+
} catch (err) {
|
|
37426
|
+
if (!(err instanceof SuiteConfigError)) throw err;
|
|
37427
|
+
suiteEntries.set(dir, [
|
|
37428
|
+
{
|
|
37429
|
+
kind: "invalid-suite",
|
|
37430
|
+
dir,
|
|
37431
|
+
manifest,
|
|
37432
|
+
message: `${manifest}: ${err.message}`,
|
|
37433
|
+
error: err.message,
|
|
37434
|
+
tests: files
|
|
37435
|
+
}
|
|
37436
|
+
]);
|
|
37437
|
+
continue;
|
|
37438
|
+
}
|
|
37439
|
+
const suite = { dir, manifest, continueOnFailure: config3.continueOnFailure };
|
|
37440
|
+
suiteEntries.set(
|
|
37441
|
+
dir,
|
|
37442
|
+
ordered.map((file2) => ({ kind: "test", path: file2, suite }))
|
|
37443
|
+
);
|
|
37444
|
+
for (const file2 of files) {
|
|
37445
|
+
if (!ordered.includes(file2)) unlisted.push({ path: file2, suite });
|
|
37446
|
+
}
|
|
37447
|
+
}
|
|
37448
|
+
const entries = [];
|
|
37449
|
+
for (const rel of [...collected, ...testless].sort()) {
|
|
37450
|
+
const dir = path18.dirname(rel);
|
|
37451
|
+
const inSuite = suiteEntries.get(dir);
|
|
37452
|
+
if (inSuite === void 0) entries.push({ kind: "test", path: rel });
|
|
37453
|
+
else if ((byDir.get(dir)?.[0] ?? rel) === rel) entries.push(...inSuite);
|
|
37454
|
+
}
|
|
37455
|
+
return { entries, unlisted };
|
|
37456
|
+
}
|
|
37457
|
+
|
|
37314
37458
|
// ../argent-cli/src/e2e.ts
|
|
37315
37459
|
var STATUS_GLYPH = {
|
|
37316
37460
|
pass: "\u2713",
|
|
@@ -37355,7 +37499,8 @@ Run a YAML e2e test without an LLM in the loop. \`run\` takes any of these forms
|
|
|
37355
37499
|
directory. It must not contain ".." segments (pass the resolved
|
|
37356
37500
|
path instead); a path is what reaches e2e tests kept elsewhere, and
|
|
37357
37501
|
what \`argent e2e list\` prints for nested ones
|
|
37358
|
-
a dir
|
|
37502
|
+
a dir The e2e tests in that directory, in no guaranteed order. To set
|
|
37503
|
+
the order, add an optional suite.config.yaml file (see below)
|
|
37359
37504
|
|
|
37360
37505
|
For a name and for a file path alike, the
|
|
37361
37506
|
filename (minus .yaml) names the run's report and artifacts, so it must
|
|
@@ -37370,8 +37515,8 @@ a running instance.
|
|
|
37370
37515
|
|
|
37371
37516
|
A directory run prints only the steps that need attention (each failure, each
|
|
37372
37517
|
warning, and each script step's output), then its outcome. After the last test
|
|
37373
|
-
it lists every failed test with its reason and a command that re-runs
|
|
37374
|
-
|
|
37518
|
+
it lists every failed test with its reason and a command that re-runs it,
|
|
37519
|
+
then a final summary; --recursive walks subdirectories too
|
|
37375
37520
|
(__baselines__, node_modules and dot-directories other than .argent are
|
|
37376
37521
|
skipped). A directory run and list skip a YAML file that is not an e2e test.
|
|
37377
37522
|
A test that fails its steps keeps the batch running, as does one the
|
|
@@ -37380,6 +37525,15 @@ transport failure, a rejection the server does not mark as validation, or a
|
|
|
37380
37525
|
reply that is not a report stops the batch and counts the remaining tests
|
|
37381
37526
|
skipped.
|
|
37382
37527
|
|
|
37528
|
+
A directory that holds a suite.config.yaml file is a suite: its tests run in
|
|
37529
|
+
the order of its \`tests:\` list, or in file name order without one, and a failed
|
|
37530
|
+
test skips the later tests of the suite unless the file sets
|
|
37531
|
+
\`continueOnFailure: true\`. A test file that the \`tests:\` list does not name
|
|
37532
|
+
does not run. list prints the tests of a suite in run order. It leaves out a
|
|
37533
|
+
test file that the \`tests:\` list does not name and the tests of a suite with
|
|
37534
|
+
an invalid suite.config.yaml file, and names them on stderr; list --json keeps
|
|
37535
|
+
those tests and gives each a warning code.
|
|
37536
|
+
|
|
37383
37537
|
A test can declare a \`requires:\` block (platform, runtimeKind) that names the
|
|
37384
37538
|
targets it supports. A directory run skips each test whose requirements the
|
|
37385
37539
|
target does not meet, so the same directory runs on each platform without a
|
|
@@ -37408,14 +37562,15 @@ Without a link, all step kinds run.
|
|
|
37408
37562
|
|
|
37409
37563
|
Subcommands:
|
|
37410
37564
|
run <test|test.yaml|dir> Run a saved e2e test by name, a YAML file by path,
|
|
37411
|
-
or
|
|
37565
|
+
or the tests in a directory, and report pass/fail
|
|
37412
37566
|
(exit reflects result)
|
|
37413
37567
|
list [dir] [-r] [--json] List runnable YAML paths in dir (-r: also in its
|
|
37414
37568
|
subdirectories), or in .argent/e2e and
|
|
37415
37569
|
.argent/flows (legacy) with notes on stderr.
|
|
37416
37570
|
--json prints { "e2eTests": [...] } instead, with
|
|
37417
|
-
path and an optional warning per entry,
|
|
37418
|
-
legacy and shadowedBy when no dir is
|
|
37571
|
+
path and an optional warning and suite per entry,
|
|
37572
|
+
plus name, legacy and shadowedBy when no dir is
|
|
37573
|
+
given
|
|
37419
37574
|
|
|
37420
37575
|
Options (run):
|
|
37421
37576
|
--device <id> Device id to run against (auto-detected when omitted)
|
|
@@ -37622,17 +37777,20 @@ function shellQuoteArg(arg) {
|
|
|
37622
37777
|
return `'${arg.replaceAll("'", "'\\''")}'`;
|
|
37623
37778
|
}
|
|
37624
37779
|
function optionSafePath(p) {
|
|
37625
|
-
return p.startsWith("-") ? `.${
|
|
37780
|
+
return p.startsWith("-") ? `.${path19.sep}${p}` : p;
|
|
37626
37781
|
}
|
|
37627
37782
|
function rerunCommand(flowPath, rel, projectRoot, args) {
|
|
37628
37783
|
const pathArg = (p) => shellQuoteArg(optionSafePath(p));
|
|
37629
|
-
const fromCwd =
|
|
37630
|
-
const shown =
|
|
37631
|
-
const parts = [
|
|
37784
|
+
const fromCwd = path19.relative(projectRoot, flowPath) || ".";
|
|
37785
|
+
const shown = path19.isAbsolute(fromCwd) || fromCwd.split(/[\\/]+/).includes("..") ? flowPath : fromCwd;
|
|
37786
|
+
const parts = [
|
|
37787
|
+
"argent e2e run",
|
|
37788
|
+
pathArg(SAFE_FLOW_NAME.test(shown) ? `.${path19.sep}${shown}` : shown)
|
|
37789
|
+
];
|
|
37632
37790
|
if (args.device) parts.push("--device", shellQuoteArg(args.device));
|
|
37633
37791
|
if (args.platform) parts.push("--platform", shellQuoteArg(args.platform));
|
|
37634
37792
|
if (args.updateBaselines) parts.push("--update-baselines");
|
|
37635
|
-
if (args.output) parts.push("--output", pathArg(
|
|
37793
|
+
if (args.output) parts.push("--output", pathArg(path19.join(args.output, path19.dirname(rel))));
|
|
37636
37794
|
return parts.join(" ");
|
|
37637
37795
|
}
|
|
37638
37796
|
var EXPORT_SOURCE_MARKER = ".argent-e2e-source";
|
|
@@ -37640,14 +37798,14 @@ var LEGACY_EXPORT_SOURCE_MARKER = ".argent-flow-source";
|
|
|
37640
37798
|
var MARKER_READ_RETRIES = 4;
|
|
37641
37799
|
var MARKER_READ_DELAY_MS = 5;
|
|
37642
37800
|
async function readExportMarker(dir) {
|
|
37643
|
-
const owner = await readMarkerFile(
|
|
37644
|
-
return owner !== void 0 ? owner : await readMarkerFile(
|
|
37801
|
+
const owner = await readMarkerFile(path19.join(dir, EXPORT_SOURCE_MARKER));
|
|
37802
|
+
return owner !== void 0 ? owner : await readMarkerFile(path19.join(dir, LEGACY_EXPORT_SOURCE_MARKER));
|
|
37645
37803
|
}
|
|
37646
37804
|
async function readMarkerFile(marker) {
|
|
37647
37805
|
for (let attempt = 0; ; attempt++) {
|
|
37648
37806
|
let owner;
|
|
37649
37807
|
try {
|
|
37650
|
-
owner = (await
|
|
37808
|
+
owner = (await fsp2.readFile(marker, "utf8")).trim();
|
|
37651
37809
|
} catch {
|
|
37652
37810
|
return void 0;
|
|
37653
37811
|
}
|
|
@@ -37660,7 +37818,7 @@ async function classifyExportDir(dir, flowPath) {
|
|
|
37660
37818
|
let owner = await readExportMarker(dir);
|
|
37661
37819
|
if (owner === void 0) {
|
|
37662
37820
|
try {
|
|
37663
|
-
if ((await
|
|
37821
|
+
if ((await fsp2.readdir(dir)).length === 0) {
|
|
37664
37822
|
return { state: "free" };
|
|
37665
37823
|
}
|
|
37666
37824
|
} catch (err) {
|
|
@@ -37677,8 +37835,8 @@ function occupiedBy(owner) {
|
|
|
37677
37835
|
}
|
|
37678
37836
|
async function takeExportDir(dir, flowPath) {
|
|
37679
37837
|
try {
|
|
37680
|
-
await
|
|
37681
|
-
await
|
|
37838
|
+
await fsp2.mkdir(dir, { recursive: true });
|
|
37839
|
+
await fsp2.writeFile(path19.join(dir, EXPORT_SOURCE_MARKER), `${flowPath}
|
|
37682
37840
|
`, { flag: "wx" });
|
|
37683
37841
|
return null;
|
|
37684
37842
|
} catch (err) {
|
|
@@ -37697,7 +37855,7 @@ async function claimExportDirName(outputDir, flowPath, stem) {
|
|
|
37697
37855
|
}
|
|
37698
37856
|
const avoided = [];
|
|
37699
37857
|
for (const name of candidates) {
|
|
37700
|
-
const dir =
|
|
37858
|
+
const dir = path19.join(outputDir, name);
|
|
37701
37859
|
const claim2 = await classifyExportDir(dir, flowPath);
|
|
37702
37860
|
const reason = claim2.state === "foreign" ? occupiedBy(claim2.owner) : await takeExportDir(dir, flowPath);
|
|
37703
37861
|
if (reason !== null) {
|
|
@@ -37717,7 +37875,7 @@ async function claimExportDirName(outputDir, flowPath, stem) {
|
|
|
37717
37875
|
return null;
|
|
37718
37876
|
}
|
|
37719
37877
|
async function exportFailureArtifacts(report, outputDir, flowPath, ctx) {
|
|
37720
|
-
const stem =
|
|
37878
|
+
const stem = path19.basename(flowPath, ".yaml");
|
|
37721
37879
|
if (!SAFE_ARTIFACT_NAME.test(stem)) {
|
|
37722
37880
|
console.error(
|
|
37723
37881
|
`warning: skipping artifact export for unsafe e2e test filename ${JSON.stringify(stem)}`
|
|
@@ -37750,13 +37908,13 @@ async function exportFailureArtifacts(report, outputDir, flowPath, ctx) {
|
|
|
37750
37908
|
if (dir === null) {
|
|
37751
37909
|
const dirName = await claimExportDirName(outputDir, flowPath, stem);
|
|
37752
37910
|
if (dirName === null) return;
|
|
37753
|
-
dir =
|
|
37911
|
+
dir = path19.join(outputDir, dirName);
|
|
37754
37912
|
}
|
|
37755
|
-
const dest =
|
|
37756
|
-
const rel =
|
|
37757
|
-
if (rel.startsWith("..") ||
|
|
37913
|
+
const dest = path19.join(dir, fileName(role));
|
|
37914
|
+
const rel = path19.relative(outputDir, dest);
|
|
37915
|
+
if (rel.startsWith("..") || path19.isAbsolute(rel)) continue;
|
|
37758
37916
|
try {
|
|
37759
|
-
await
|
|
37917
|
+
await fsp2.copyFile(value, dest);
|
|
37760
37918
|
s.artifacts[role] = dest;
|
|
37761
37919
|
} catch (err) {
|
|
37762
37920
|
console.error(
|
|
@@ -37769,7 +37927,7 @@ async function exportFailureArtifacts(report, outputDir, flowPath, ctx) {
|
|
|
37769
37927
|
function keyFromBaselinePath(artifacts) {
|
|
37770
37928
|
const baseline = artifacts.baseline;
|
|
37771
37929
|
if (typeof baseline !== "string") return null;
|
|
37772
|
-
return
|
|
37930
|
+
return path19.basename(baseline).replace(/\.png$/, "");
|
|
37773
37931
|
}
|
|
37774
37932
|
function resolveArtifactDisplayPaths(report) {
|
|
37775
37933
|
for (const s of report.steps) {
|
|
@@ -37814,9 +37972,9 @@ ${renderSummary(report)}`);
|
|
|
37814
37972
|
}
|
|
37815
37973
|
async function isRunnableFlowFile(filePath) {
|
|
37816
37974
|
try {
|
|
37817
|
-
const stat7 = await
|
|
37975
|
+
const stat7 = await fsp2.stat(filePath);
|
|
37818
37976
|
if (!stat7.isFile()) return false;
|
|
37819
|
-
await
|
|
37977
|
+
await fsp2.access(filePath, fsConstants2.R_OK);
|
|
37820
37978
|
return true;
|
|
37821
37979
|
} catch {
|
|
37822
37980
|
return false;
|
|
@@ -37829,7 +37987,7 @@ var E2E_FILE_WARNING_TEXT = {
|
|
|
37829
37987
|
async function checkE2eTestShape(filePath) {
|
|
37830
37988
|
let content;
|
|
37831
37989
|
try {
|
|
37832
|
-
content = (await
|
|
37990
|
+
content = (await fsp2.readFile(filePath, "utf8")).trim();
|
|
37833
37991
|
} catch {
|
|
37834
37992
|
return "ok";
|
|
37835
37993
|
}
|
|
@@ -37837,7 +37995,7 @@ async function checkE2eTestShape(filePath) {
|
|
|
37837
37995
|
if (!content.includes("steps") && !/^version:/m.test(content)) return "skip";
|
|
37838
37996
|
let parsed;
|
|
37839
37997
|
try {
|
|
37840
|
-
parsed = (0,
|
|
37998
|
+
parsed = (0, import_yaml4.parse)(content, { logLevel: "error" });
|
|
37841
37999
|
} catch {
|
|
37842
38000
|
return "syntax-error";
|
|
37843
38001
|
}
|
|
@@ -37849,26 +38007,26 @@ async function resolveFlowRef(ref, projectRoot) {
|
|
|
37849
38007
|
if (!SAFE_FLOW_NAME.test(ref)) return { suppliedPath: ref, fromName: false };
|
|
37850
38008
|
const picked = await resolveE2eFile(projectRoot, ref);
|
|
37851
38009
|
return {
|
|
37852
|
-
suppliedPath:
|
|
38010
|
+
suppliedPath: path19.relative(projectRoot, picked.path),
|
|
37853
38011
|
fromName: true,
|
|
37854
|
-
...picked.shadowed === void 0 ? {} : { shadowed:
|
|
38012
|
+
...picked.shadowed === void 0 ? {} : { shadowed: path19.relative(projectRoot, picked.shadowed) }
|
|
37855
38013
|
};
|
|
37856
38014
|
}
|
|
37857
38015
|
async function savedFlowHint(projectRoot, missingPath) {
|
|
37858
|
-
const dirs = E2E_DIRS.map((rel) => ({ rel, abs:
|
|
38016
|
+
const dirs = E2E_DIRS.map((rel) => ({ rel, abs: path19.resolve(projectRoot, rel) }));
|
|
37859
38017
|
for (const { abs } of dirs) {
|
|
37860
|
-
const within =
|
|
37861
|
-
if (!within.startsWith("..") && !
|
|
38018
|
+
const within = path19.relative(abs, missingPath);
|
|
38019
|
+
if (!within.startsWith("..") && !path19.isAbsolute(within)) return "";
|
|
37862
38020
|
}
|
|
37863
|
-
const wanted = `${
|
|
38021
|
+
const wanted = `${path19.basename(missingPath, ".yaml")}.yaml`;
|
|
37864
38022
|
for (const { rel, abs } of dirs) {
|
|
37865
|
-
const entries = await
|
|
38023
|
+
const entries = await fsp2.readdir(abs).catch(() => null);
|
|
37866
38024
|
if (entries === null) continue;
|
|
37867
38025
|
const actual = entries.includes(wanted) ? wanted : entries.find((name2) => name2.toLowerCase() === wanted.toLowerCase());
|
|
37868
38026
|
if (actual === void 0) continue;
|
|
37869
|
-
const name =
|
|
38027
|
+
const name = path19.basename(actual, ".yaml");
|
|
37870
38028
|
if (!SAFE_FLOW_NAME.test(name)) return "";
|
|
37871
|
-
if (!await isRunnableFlowFile(
|
|
38029
|
+
if (!await isRunnableFlowFile(path19.join(abs, actual))) return "";
|
|
37872
38030
|
return `
|
|
37873
38031
|
An e2e test named "${name}" is saved under ${rel} \u2014 did you mean: argent e2e run ${name}`;
|
|
37874
38032
|
}
|
|
@@ -37876,19 +38034,24 @@ An e2e test named "${name}" is saved under ${rel} \u2014 did you mean: argent e2
|
|
|
37876
38034
|
}
|
|
37877
38035
|
async function collectFlowFiles(dir, recursive2) {
|
|
37878
38036
|
const found = [];
|
|
38037
|
+
const manifests = [];
|
|
37879
38038
|
const walk = async (current, rel) => {
|
|
37880
|
-
for (const entry of await
|
|
37881
|
-
const entryRel = rel ?
|
|
38039
|
+
for (const entry of await fsp2.readdir(current, { withFileTypes: true })) {
|
|
38040
|
+
const entryRel = rel ? path19.join(rel, entry.name) : entry.name;
|
|
37882
38041
|
if (entry.isDirectory()) {
|
|
37883
38042
|
if (recursive2 && entry.name !== "__baselines__" && entry.name !== "node_modules" && (entry.name === ".argent" || !entry.name.startsWith("."))) {
|
|
37884
|
-
await walk(
|
|
38043
|
+
await walk(path19.join(current, entry.name), entryRel).catch(() => {
|
|
37885
38044
|
});
|
|
37886
38045
|
}
|
|
37887
38046
|
continue;
|
|
37888
38047
|
}
|
|
38048
|
+
if (entry.name === SUITE_CONFIG_FILE) {
|
|
38049
|
+
manifests.push(entryRel);
|
|
38050
|
+
continue;
|
|
38051
|
+
}
|
|
37889
38052
|
if (!entry.name.endsWith(".yaml")) continue;
|
|
37890
|
-
if (!SAFE_FLOW_NAME.test(
|
|
37891
|
-
const filePath =
|
|
38053
|
+
if (!SAFE_FLOW_NAME.test(path19.basename(entry.name, ".yaml"))) continue;
|
|
38054
|
+
const filePath = path19.join(current, entry.name);
|
|
37892
38055
|
if (!await isRunnableFlowFile(filePath)) continue;
|
|
37893
38056
|
const shape = await checkE2eTestShape(filePath);
|
|
37894
38057
|
if (shape === "skip") continue;
|
|
@@ -37896,7 +38059,10 @@ async function collectFlowFiles(dir, recursive2) {
|
|
|
37896
38059
|
}
|
|
37897
38060
|
};
|
|
37898
38061
|
await walk(dir, "");
|
|
37899
|
-
return
|
|
38062
|
+
return {
|
|
38063
|
+
files: found.sort((a2, b) => a2.path < b.path ? -1 : a2.path > b.path ? 1 : 0),
|
|
38064
|
+
manifests: manifests.sort()
|
|
38065
|
+
};
|
|
37900
38066
|
}
|
|
37901
38067
|
var RUN_TOOL_ID = "e2e-execute";
|
|
37902
38068
|
function buildRunPayload(flowPath, projectRoot, args) {
|
|
@@ -38019,6 +38185,10 @@ function unwrittenBaselines(report) {
|
|
|
38019
38185
|
return typeof file2 === "string" && typeof error63 === "string" ? [`${file2}: ${error63}`] : [];
|
|
38020
38186
|
});
|
|
38021
38187
|
}
|
|
38188
|
+
var INVALID_SUITE_SIGNAL = {
|
|
38189
|
+
error_code: FAILURE_CODES.FLOW_FILE_INVALID,
|
|
38190
|
+
error_kind: "validation"
|
|
38191
|
+
};
|
|
38022
38192
|
async function runFlowDirectory(dir, args, projectRoot, options) {
|
|
38023
38193
|
const printError = (message, err = message) => {
|
|
38024
38194
|
console.error(args.json ? JSON.stringify(errorRecord(err, message)) : message);
|
|
@@ -38027,32 +38197,91 @@ async function runFlowDirectory(dir, args, projectRoot, options) {
|
|
|
38027
38197
|
printError(message);
|
|
38028
38198
|
return exitAfterFlush(2);
|
|
38029
38199
|
};
|
|
38030
|
-
let
|
|
38200
|
+
let found;
|
|
38031
38201
|
try {
|
|
38032
|
-
|
|
38202
|
+
found = await collectFlowFiles(dir, args.recursive);
|
|
38033
38203
|
} catch {
|
|
38034
38204
|
return reject(`Could not read e2e test directory: ${dir}`);
|
|
38035
38205
|
}
|
|
38036
|
-
|
|
38206
|
+
const plan = await planDirectoryRun(
|
|
38207
|
+
dir,
|
|
38208
|
+
found.files.map((file2) => file2.path),
|
|
38209
|
+
found.manifests
|
|
38210
|
+
);
|
|
38211
|
+
if (plan.entries.length === 0) {
|
|
38037
38212
|
return reject(
|
|
38038
38213
|
`No e2e tests found in ${dir}` + (args.recursive ? "" : "\nPass -r/--recursive to include subdirectories.")
|
|
38039
38214
|
);
|
|
38040
38215
|
}
|
|
38216
|
+
printWarnings(
|
|
38217
|
+
plan.unlisted.map((file2) => unlistedWarning(file2.path, file2.suite.manifest)),
|
|
38218
|
+
args.json
|
|
38219
|
+
);
|
|
38220
|
+
const runOrder = plan.entries.flatMap(
|
|
38221
|
+
(entry) => entry.kind === "test" ? [entry] : [
|
|
38222
|
+
entry,
|
|
38223
|
+
...entry.tests.map((rel) => ({
|
|
38224
|
+
kind: "test",
|
|
38225
|
+
path: rel,
|
|
38226
|
+
invalidManifest: entry.manifest
|
|
38227
|
+
}))
|
|
38228
|
+
]
|
|
38229
|
+
);
|
|
38041
38230
|
const { callTool, baseUrl } = runToolsClient(args, options);
|
|
38042
|
-
const outputBase = args.output ?
|
|
38231
|
+
const outputBase = args.output ? path19.resolve(args.output) : void 0;
|
|
38043
38232
|
const results = [];
|
|
38044
38233
|
const failures = [];
|
|
38045
38234
|
const batchStartedAt = Date.now();
|
|
38235
|
+
const failedInSuite = /* @__PURE__ */ new Map();
|
|
38236
|
+
const recordRun = (result, suite) => {
|
|
38237
|
+
results.push(result);
|
|
38238
|
+
if (result.status === "fail" && suite && !suite.continueOnFailure) {
|
|
38239
|
+
failedInSuite.set(suite, result.path);
|
|
38240
|
+
}
|
|
38241
|
+
};
|
|
38242
|
+
const skip = (rel, outcome, reason) => {
|
|
38243
|
+
results.push({ path: rel, status: "skip", ...reason !== void 0 && { reason } });
|
|
38244
|
+
if (!args.json) {
|
|
38245
|
+
console.log(
|
|
38246
|
+
` ${STATUS_GLYPH.skip} ${outcome}${reason === void 0 ? "" : `
|
|
38247
|
+
${reason}`}`
|
|
38248
|
+
);
|
|
38249
|
+
}
|
|
38250
|
+
};
|
|
38046
38251
|
let stopped = false;
|
|
38047
38252
|
let unreachable = false;
|
|
38048
|
-
for (const [i2,
|
|
38049
|
-
|
|
38253
|
+
for (const [i2, entry] of runOrder.entries()) {
|
|
38254
|
+
const rel = entry.kind === "test" ? entry.path : entry.manifest;
|
|
38255
|
+
if (!args.json) console.log(`[${i2 + 1}/${runOrder.length}] ${rel}`);
|
|
38256
|
+
if (entry.kind === "invalid-suite") {
|
|
38257
|
+
const verdict = "not run (invalid suite config)";
|
|
38258
|
+
if (!args.json) console.log(` ${STATUS_GLYPH.error} ${verdict}`);
|
|
38259
|
+
console.error(
|
|
38260
|
+
args.json ? JSON.stringify({ event: "error", error: entry.message, ...INVALID_SUITE_SIGNAL }) : entry.message
|
|
38261
|
+
);
|
|
38262
|
+
results.push({ path: rel, status: "fail", error: entry.message, ...INVALID_SUITE_SIGNAL });
|
|
38263
|
+
failures.push({
|
|
38264
|
+
path: rel,
|
|
38265
|
+
headline: verdict,
|
|
38266
|
+
detail: entry.message,
|
|
38267
|
+
rerun: rerunCommand(path19.join(dir, entry.dir), rel, projectRoot, args)
|
|
38268
|
+
});
|
|
38269
|
+
continue;
|
|
38270
|
+
}
|
|
38050
38271
|
if (stopped) {
|
|
38051
|
-
|
|
38052
|
-
|
|
38272
|
+
skip(rel, "not run (batch stopped)");
|
|
38273
|
+
continue;
|
|
38274
|
+
}
|
|
38275
|
+
if (entry.invalidManifest !== void 0) {
|
|
38276
|
+
skip(rel, "skipped (invalid suite config)", `invalid suite config: ${entry.invalidManifest}`);
|
|
38053
38277
|
continue;
|
|
38054
38278
|
}
|
|
38055
|
-
const
|
|
38279
|
+
const failedEarlier = entry.suite && failedInSuite.get(entry.suite);
|
|
38280
|
+
if (failedEarlier !== void 0) {
|
|
38281
|
+
skip(rel, "skipped (earlier test failed)", `earlier test failed: ${failedEarlier}`);
|
|
38282
|
+
continue;
|
|
38283
|
+
}
|
|
38284
|
+
const flowPath = path19.join(dir, rel);
|
|
38056
38285
|
const rerun = rerunCommand(flowPath, rel, projectRoot, args);
|
|
38057
38286
|
let report;
|
|
38058
38287
|
try {
|
|
@@ -38064,18 +38293,14 @@ async function runFlowDirectory(dir, args, projectRoot, options) {
|
|
|
38064
38293
|
const message = err instanceof Error ? err.message : String(err);
|
|
38065
38294
|
const toolErr = err instanceof ToolInvocationError ? err : void 0;
|
|
38066
38295
|
if (toolErr?.errorCode === FAILURE_CODES.FLOW_REQUIREMENTS_UNMET) {
|
|
38067
|
-
|
|
38068
|
-
results.push({ path: rel, status: "skip", reason });
|
|
38069
|
-
if (!args.json)
|
|
38070
|
-
console.log(` ${STATUS_GLYPH.skip} skipped (requires not met)
|
|
38071
|
-
${reason}`);
|
|
38296
|
+
skip(rel, "skipped (requires not met)", message.replace(/^\[Tool:[^\]]+\] /, ""));
|
|
38072
38297
|
continue;
|
|
38073
38298
|
}
|
|
38074
38299
|
const rejectedThisFlowOnly = toolErr?.errorKind === "validation";
|
|
38075
38300
|
const verdict = unreachableErr ? UNREACHABLE_VERDICT : rejectedThisFlowOnly ? rejectionVerdict(toolErr?.errorCode) : "did not finish (run error)";
|
|
38076
38301
|
if (!args.json) console.log(` ${STATUS_GLYPH.error} ${verdict}`);
|
|
38077
38302
|
printError(message, err);
|
|
38078
|
-
|
|
38303
|
+
recordRun({ path: rel, status: "fail", error: message, ...failureSignal2(err) }, entry.suite);
|
|
38079
38304
|
failures.push({ path: rel, headline: verdict, detail: message, rerun });
|
|
38080
38305
|
if (!rejectedThisFlowOnly) stopped = true;
|
|
38081
38306
|
if (unreachableErr) unreachable = true;
|
|
@@ -38086,7 +38311,7 @@ async function runFlowDirectory(dir, args, projectRoot, options) {
|
|
|
38086
38311
|
const verdict = "did not finish (no run report)";
|
|
38087
38312
|
if (!args.json) console.log(` ${STATUS_GLYPH.error} ${verdict}`);
|
|
38088
38313
|
printError(message);
|
|
38089
|
-
|
|
38314
|
+
recordRun({ path: rel, status: "fail", error: message }, entry.suite);
|
|
38090
38315
|
failures.push({ path: rel, headline: verdict, detail: message, rerun });
|
|
38091
38316
|
stopped = true;
|
|
38092
38317
|
continue;
|
|
@@ -38094,11 +38319,11 @@ async function runFlowDirectory(dir, args, projectRoot, options) {
|
|
|
38094
38319
|
printWarnings(nestedStepWarnings(report.steps), args.json);
|
|
38095
38320
|
await exportAndResolveArtifacts(
|
|
38096
38321
|
report,
|
|
38097
|
-
outputBase ?
|
|
38322
|
+
outputBase ? path19.join(outputBase, path19.dirname(rel)) : void 0,
|
|
38098
38323
|
flowPath,
|
|
38099
38324
|
baseUrl
|
|
38100
38325
|
);
|
|
38101
|
-
|
|
38326
|
+
recordRun({ path: rel, status: report.ok ? "pass" : "fail", report }, entry.suite);
|
|
38102
38327
|
if (!report.ok) failures.push({ path: rel, ...summarizeFailure(report), rerun });
|
|
38103
38328
|
if (!args.json) {
|
|
38104
38329
|
for (const line of renderFailedSteps(report)) console.log(line);
|
|
@@ -38183,14 +38408,14 @@ Run \`argent e2e --help\`.`
|
|
|
38183
38408
|
Pass the fully resolved path to the directory.`
|
|
38184
38409
|
);
|
|
38185
38410
|
}
|
|
38186
|
-
const
|
|
38411
|
+
const rows = [];
|
|
38187
38412
|
const byName = /* @__PURE__ */ new Map();
|
|
38188
38413
|
let anyDir = false;
|
|
38189
38414
|
const dirs = listDir === void 0 ? E2E_DIRS : [listDir];
|
|
38190
38415
|
for (const dir of dirs) {
|
|
38191
|
-
let
|
|
38416
|
+
let found;
|
|
38192
38417
|
try {
|
|
38193
|
-
|
|
38418
|
+
found = await collectFlowFiles(path19.resolve(dir), listDir === void 0 || recursive2);
|
|
38194
38419
|
} catch (err) {
|
|
38195
38420
|
const code = err.code;
|
|
38196
38421
|
if (listDir === void 0 && (code === "ENOENT" || code === "ENOTDIR")) continue;
|
|
@@ -38199,49 +38424,99 @@ Pass the fully resolved path to the directory.`
|
|
|
38199
38424
|
);
|
|
38200
38425
|
}
|
|
38201
38426
|
anyDir = true;
|
|
38202
|
-
|
|
38203
|
-
|
|
38204
|
-
|
|
38427
|
+
const fileWarnings = new Map(found.files.map((file2) => [file2.path, file2.warning]));
|
|
38428
|
+
const plan = await planDirectoryRun(
|
|
38429
|
+
path19.resolve(dir),
|
|
38430
|
+
found.files.map((file2) => file2.path),
|
|
38431
|
+
found.manifests
|
|
38432
|
+
);
|
|
38433
|
+
const show = (rel) => optionSafePath(path19.join(dir, rel));
|
|
38434
|
+
const add = (rel, inSuite, notRun) => {
|
|
38435
|
+
const shown = show(rel);
|
|
38436
|
+
const fileWarning = fileWarnings.get(rel);
|
|
38437
|
+
const warning = notRun?.warning ?? fileWarning;
|
|
38438
|
+
let entry;
|
|
38205
38439
|
if (listDir !== void 0) {
|
|
38206
|
-
|
|
38440
|
+
entry = { path: shown };
|
|
38441
|
+
} else {
|
|
38442
|
+
const name = path19.dirname(rel) === "." ? path19.basename(rel, ".yaml") : void 0;
|
|
38443
|
+
const shadowedBy = name === void 0 ? void 0 : byName.get(name);
|
|
38444
|
+
if (name !== void 0 && shadowedBy === void 0) byName.set(name, shown);
|
|
38445
|
+
entry = {
|
|
38446
|
+
path: shown,
|
|
38447
|
+
...name !== void 0 && { name },
|
|
38448
|
+
legacy: dir !== E2E_DIR,
|
|
38449
|
+
...shadowedBy !== void 0 && { shadowedBy }
|
|
38450
|
+
};
|
|
38451
|
+
}
|
|
38452
|
+
if (inSuite) entry.suite = optionSafePath(path19.dirname(path19.join(dir, rel)));
|
|
38453
|
+
if (warning !== void 0) entry.warning = warning;
|
|
38454
|
+
const notes = notRun?.notes ?? [
|
|
38455
|
+
...entry.shadowedBy === void 0 ? [] : [`warning: ${shown} is shadowed by ${entry.shadowedBy} when run by name`],
|
|
38456
|
+
...fileWarning === void 0 ? [] : [`warning: ${shown} ${E2E_FILE_WARNING_TEXT[fileWarning]}`]
|
|
38457
|
+
];
|
|
38458
|
+
rows.push({ entry, listed: notRun === void 0, notes });
|
|
38459
|
+
};
|
|
38460
|
+
for (const [i2, entry] of plan.entries.entries()) {
|
|
38461
|
+
if (entry.kind === "invalid-suite") {
|
|
38462
|
+
const manifest = show(entry.manifest);
|
|
38463
|
+
if (entry.tests.length === 0) {
|
|
38464
|
+
rows.push({
|
|
38465
|
+
entry: {
|
|
38466
|
+
path: manifest,
|
|
38467
|
+
...listDir === void 0 && { legacy: dir !== E2E_DIR },
|
|
38468
|
+
suite: show(entry.dir),
|
|
38469
|
+
warning: "invalid-suite-config"
|
|
38470
|
+
},
|
|
38471
|
+
listed: false,
|
|
38472
|
+
notes: [`warning: ${manifest}: ${entry.error}`]
|
|
38473
|
+
});
|
|
38474
|
+
}
|
|
38475
|
+
for (const [j, rel] of entry.tests.entries()) {
|
|
38476
|
+
add(rel, true, {
|
|
38477
|
+
warning: "invalid-suite-config",
|
|
38478
|
+
notes: [
|
|
38479
|
+
...j === 0 ? [`warning: ${manifest}: ${entry.error}`] : [],
|
|
38480
|
+
` not listed: ${show(rel)}`
|
|
38481
|
+
]
|
|
38482
|
+
});
|
|
38483
|
+
}
|
|
38207
38484
|
continue;
|
|
38208
38485
|
}
|
|
38209
|
-
|
|
38210
|
-
const
|
|
38211
|
-
if (
|
|
38212
|
-
|
|
38213
|
-
|
|
38214
|
-
|
|
38215
|
-
|
|
38216
|
-
|
|
38217
|
-
|
|
38218
|
-
|
|
38486
|
+
add(entry.path, entry.suite !== void 0);
|
|
38487
|
+
const next = plan.entries[i2 + 1];
|
|
38488
|
+
if (entry.suite === void 0 || next?.kind === "test" && next.suite === entry.suite) {
|
|
38489
|
+
continue;
|
|
38490
|
+
}
|
|
38491
|
+
for (const file2 of plan.unlisted.filter((f) => f.suite === entry.suite)) {
|
|
38492
|
+
add(file2.path, true, {
|
|
38493
|
+
warning: "not-in-suite",
|
|
38494
|
+
notes: [`warning: ${unlistedWarning(show(file2.path), show(file2.suite.manifest))}`]
|
|
38495
|
+
});
|
|
38496
|
+
}
|
|
38219
38497
|
}
|
|
38220
38498
|
}
|
|
38221
38499
|
if (json3) {
|
|
38222
|
-
const doc = {
|
|
38500
|
+
const doc = {
|
|
38501
|
+
e2eTests: rows.map((row) => row.entry),
|
|
38502
|
+
...!anyDir && { warning: "no-e2e-directory" }
|
|
38503
|
+
};
|
|
38223
38504
|
console.log(JSON.stringify(doc, null, 2));
|
|
38224
38505
|
return;
|
|
38225
38506
|
}
|
|
38507
|
+
const listed = rows.filter((row) => row.listed).map((row) => row.entry);
|
|
38226
38508
|
if (!anyDir) {
|
|
38227
38509
|
console.error(
|
|
38228
38510
|
`warning: no ${E2E_DIRS.join(" or ")} directory in the current working directory`
|
|
38229
38511
|
);
|
|
38230
|
-
} else if (
|
|
38512
|
+
} else if (rows.length === 0) {
|
|
38231
38513
|
console.error(
|
|
38232
38514
|
`No e2e tests found in ${listDir ?? E2E_DIRS.join(" or ")}` + (listDir === void 0 || recursive2 ? "" : "\nPass -r/--recursive to include subdirectories.")
|
|
38233
38515
|
);
|
|
38234
38516
|
} else {
|
|
38235
|
-
console.log(
|
|
38236
|
-
for (const
|
|
38237
|
-
|
|
38238
|
-
console.error(
|
|
38239
|
-
`warning: ${entry.path} is shadowed by ${entry.shadowedBy} when run by name`
|
|
38240
|
-
);
|
|
38241
|
-
if (entry.warning !== void 0)
|
|
38242
|
-
console.error(`warning: ${entry.path} ${E2E_FILE_WARNING_TEXT[entry.warning]}`);
|
|
38243
|
-
}
|
|
38244
|
-
const legacyCount = entries.filter((entry) => entry.legacy).length;
|
|
38517
|
+
if (listed.length > 0) console.log(listed.map((entry) => entry.path).join("\n"));
|
|
38518
|
+
for (const note of rows.flatMap((row) => row.notes)) console.error(note);
|
|
38519
|
+
const legacyCount = listed.filter((entry) => entry.legacy).length;
|
|
38245
38520
|
if (legacyCount > 0) {
|
|
38246
38521
|
console.error(
|
|
38247
38522
|
`note: ${legacyCount} test${legacyCount === 1 ? "" : "s"} listed from .argent/flows (legacy); move ${legacyCount === 1 ? "it" : "them"} to .argent/e2e`
|
|
@@ -38296,11 +38571,11 @@ Pass the fully resolved path to the directory.`
|
|
|
38296
38571
|
}
|
|
38297
38572
|
if (suppliedPath.split(/[\\/]+/).includes("..")) {
|
|
38298
38573
|
let recovery = "Pass the fully resolved path to the e2e test's YAML.";
|
|
38299
|
-
const suppliedBase2 =
|
|
38574
|
+
const suppliedBase2 = path19.basename(suppliedPath);
|
|
38300
38575
|
if (suppliedBase2 !== ".." && suppliedBase2 !== ".") {
|
|
38301
38576
|
try {
|
|
38302
|
-
const resolved =
|
|
38303
|
-
await
|
|
38577
|
+
const resolved = path19.join(await fsp2.realpath(path19.dirname(suppliedPath)), suppliedBase2);
|
|
38578
|
+
await fsp2.stat(resolved);
|
|
38304
38579
|
recovery = `Did you mean: argent e2e run ${shellQuoteArg(resolved)}`;
|
|
38305
38580
|
} catch {
|
|
38306
38581
|
}
|
|
@@ -38311,10 +38586,10 @@ Pass the fully resolved path to the directory.`
|
|
|
38311
38586
|
2
|
|
38312
38587
|
);
|
|
38313
38588
|
}
|
|
38314
|
-
const resolvedPath =
|
|
38589
|
+
const resolvedPath = path19.resolve(projectRoot, suppliedPath);
|
|
38315
38590
|
let isDirectory = false;
|
|
38316
38591
|
try {
|
|
38317
|
-
isDirectory = (await
|
|
38592
|
+
isDirectory = (await fsp2.stat(resolvedPath)).isDirectory();
|
|
38318
38593
|
} catch {
|
|
38319
38594
|
if (args.recursive && !fromName) {
|
|
38320
38595
|
return fail(`E2E test directory not found: ${resolvedPath}`, 2);
|
|
@@ -38334,16 +38609,16 @@ Pass the fully resolved path to the directory.`
|
|
|
38334
38609
|
}
|
|
38335
38610
|
const separatorTrimmedPath = suppliedPath.replace(/[\\/]+$/, "");
|
|
38336
38611
|
if (separatorTrimmedPath !== suppliedPath && separatorTrimmedPath !== "") {
|
|
38337
|
-
const hint = SAFE_FLOW_NAME.test(separatorTrimmedPath) ? `.${
|
|
38612
|
+
const hint = SAFE_FLOW_NAME.test(separatorTrimmedPath) ? `.${path19.sep}${separatorTrimmedPath}` : separatorTrimmedPath;
|
|
38338
38613
|
return fail(
|
|
38339
38614
|
`E2E test path must not end in a path separator \u2014 the separator claims a directory, which the kernel would refuse to open as a file, so the CLI would run a file this string does not name: ${suppliedPath}
|
|
38340
38615
|
Did you mean: argent e2e run ${shellQuoteArg(hint)}`,
|
|
38341
38616
|
2
|
|
38342
38617
|
);
|
|
38343
38618
|
}
|
|
38344
|
-
if (
|
|
38345
|
-
const looksLikeName = !suppliedPath.includes("/") && !suppliedPath.includes("\\") &&
|
|
38346
|
-
if (
|
|
38619
|
+
if (path19.extname(suppliedPath) !== ".yaml") {
|
|
38620
|
+
const looksLikeName = !suppliedPath.includes("/") && !suppliedPath.includes("\\") && path19.extname(suppliedPath) === "";
|
|
38621
|
+
if (path19.basename(suppliedPath).toLowerCase() === ".yaml") {
|
|
38347
38622
|
return fail(
|
|
38348
38623
|
`E2E test filename must have a non-empty name containing only letters, numbers, "_", or "-": ${suppliedPath}`,
|
|
38349
38624
|
2
|
|
@@ -38356,15 +38631,15 @@ Names run \`${E2E_DIRS.map((dir) => `${dir}/<name>.yaml`).join("` or `")}\`; pas
|
|
|
38356
38631
|
2
|
|
38357
38632
|
);
|
|
38358
38633
|
}
|
|
38359
|
-
if (
|
|
38634
|
+
if (path19.extname(suppliedPath).toLowerCase() === ".yaml") {
|
|
38360
38635
|
return fail(
|
|
38361
|
-
`E2E test extension must be lowercase .yaml, not ${
|
|
38636
|
+
`E2E test extension must be lowercase .yaml, not ${path19.extname(suppliedPath)}: ${suppliedPath}`,
|
|
38362
38637
|
2
|
|
38363
38638
|
);
|
|
38364
38639
|
}
|
|
38365
38640
|
return fail(`E2E test path must end in .yaml: ${suppliedPath}`, 2);
|
|
38366
38641
|
}
|
|
38367
|
-
const flowName =
|
|
38642
|
+
const flowName = path19.basename(suppliedPath, ".yaml");
|
|
38368
38643
|
if (!SAFE_FLOW_NAME.test(flowName)) {
|
|
38369
38644
|
return fail(
|
|
38370
38645
|
`E2E test filename must have a non-empty name containing only letters, numbers, "_", or "-": ${suppliedPath}`,
|
|
@@ -38373,11 +38648,11 @@ Names run \`${E2E_DIRS.map((dir) => `${dir}/<name>.yaml`).join("` or `")}\`; pas
|
|
|
38373
38648
|
}
|
|
38374
38649
|
const flowPath = resolvedPath;
|
|
38375
38650
|
try {
|
|
38376
|
-
const stat7 = await
|
|
38651
|
+
const stat7 = await fsp2.stat(flowPath);
|
|
38377
38652
|
if (!stat7.isFile()) {
|
|
38378
38653
|
return fail(`E2E test path is not a file: ${flowPath}`, 2);
|
|
38379
38654
|
}
|
|
38380
|
-
await
|
|
38655
|
+
await fsp2.access(flowPath, fsConstants2.R_OK);
|
|
38381
38656
|
} catch (err) {
|
|
38382
38657
|
const code = err.code;
|
|
38383
38658
|
const detail = code === "ENOENT" ? "E2E test file not found" : "Could not read e2e test file";
|
|
@@ -38388,12 +38663,12 @@ No e2e test named "${args.flowRef}" is saved in ${E2E_DIRS.join(" or ")} \u2014
|
|
|
38388
38663
|
}
|
|
38389
38664
|
return fail(`${detail}: ${flowPath}${recovery}`, 2);
|
|
38390
38665
|
}
|
|
38391
|
-
const suppliedBase =
|
|
38392
|
-
const siblings = await
|
|
38666
|
+
const suppliedBase = path19.basename(flowPath);
|
|
38667
|
+
const siblings = await fsp2.readdir(path19.dirname(flowPath)).catch(() => null);
|
|
38393
38668
|
if (siblings !== null && !siblings.includes(suppliedBase)) {
|
|
38394
38669
|
const actual = siblings.find((name) => name.toLowerCase() === suppliedBase.toLowerCase());
|
|
38395
|
-
const actualRunnable = actual !== void 0 &&
|
|
38396
|
-
const recovery = actualRunnable ? fromName ? `Did you mean: argent e2e run ${
|
|
38670
|
+
const actualRunnable = actual !== void 0 && path19.extname(actual) === ".yaml" && SAFE_FLOW_NAME.test(path19.basename(actual, ".yaml"));
|
|
38671
|
+
const recovery = actualRunnable ? fromName ? `Did you mean: argent e2e run ${path19.basename(actual, ".yaml")}` : `Did you mean: argent e2e run ${shellQuoteArg(path19.join(path19.dirname(suppliedPath), actual))}` : actual !== void 0 ? `Rename ${actual} to ${suppliedBase} to run it \u2014 e2e test files must be lowercase .yaml.` : "Pass the e2e test file's name exactly as it appears on disk.";
|
|
38397
38672
|
return fail(
|
|
38398
38673
|
`E2E test path must name the file as it appears on disk \u2014 this filesystem matched ${JSON.stringify(suppliedBase)} case-insensitively${actual !== void 0 ? ` to ${JSON.stringify(actual)}` : ""}, so the test name (which keys the report, __baselines__/, and --output) would be one no file carries: ${suppliedPath}
|
|
38399
38674
|
${recovery}`,
|
|
@@ -38452,7 +38727,7 @@ ${recovery}`,
|
|
|
38452
38727
|
try {
|
|
38453
38728
|
await exportAndResolveArtifacts(
|
|
38454
38729
|
report,
|
|
38455
|
-
args.output ?
|
|
38730
|
+
args.output ? path19.resolve(args.output) : void 0,
|
|
38456
38731
|
flowPath,
|
|
38457
38732
|
baseUrl
|
|
38458
38733
|
);
|
|
@@ -38541,7 +38816,7 @@ async function fetchImageToFile(result, outPath) {
|
|
|
38541
38816
|
const res = await fetch(url2);
|
|
38542
38817
|
if (!res.ok) throw new Error(`Failed to download image: ${res.status} ${res.statusText}`);
|
|
38543
38818
|
const buf = Buffer.from(await res.arrayBuffer());
|
|
38544
|
-
fs13.mkdirSync(
|
|
38819
|
+
fs13.mkdirSync(path20.dirname(path20.resolve(outPath)), { recursive: true });
|
|
38545
38820
|
fs13.writeFileSync(outPath, buf);
|
|
38546
38821
|
}
|
|
38547
38822
|
function renderResult(result, outputHint, images, json2) {
|
|
@@ -38749,7 +39024,7 @@ settled=false or debugger-status's not_connected.
|
|
|
38749
39024
|
if (outPath && meta3.outputHint === "image") {
|
|
38750
39025
|
try {
|
|
38751
39026
|
if (images.length > 0) {
|
|
38752
|
-
fs13.mkdirSync(
|
|
39027
|
+
fs13.mkdirSync(path20.dirname(path20.resolve(outPath)), { recursive: true });
|
|
38753
39028
|
fs13.writeFileSync(outPath, images[0].data);
|
|
38754
39029
|
} else if (result && typeof result === "object") {
|
|
38755
39030
|
await fetchImageToFile(result, outPath);
|
|
@@ -38883,11 +39158,11 @@ Listing tools contacts the argent tool-server, starting one if none is running.
|
|
|
38883
39158
|
|
|
38884
39159
|
// ../argent-cli/src/server.ts
|
|
38885
39160
|
import * as fs14 from "node:fs";
|
|
38886
|
-
import * as
|
|
39161
|
+
import * as path21 from "node:path";
|
|
38887
39162
|
import { constants as constants2, homedir as homedir5, networkInterfaces } from "node:os";
|
|
38888
39163
|
import { spawn as spawn4 } from "node:child_process";
|
|
38889
|
-
var STATE_DIR2 =
|
|
38890
|
-
var LOG_FILE2 =
|
|
39164
|
+
var STATE_DIR2 = path21.join(homedir5(), ".argent");
|
|
39165
|
+
var LOG_FILE2 = path21.join(STATE_DIR2, "tool-server.log");
|
|
38891
39166
|
async function describeForeignServers(ownBundlePath) {
|
|
38892
39167
|
const others = (await readAllToolsServerStates()).filter(
|
|
38893
39168
|
({ state: state2 }) => state2.bundlePath !== ownBundlePath && isToolsServerProcessAlive(state2.pid)
|
|
@@ -39365,7 +39640,7 @@ async function server(argv, options) {
|
|
|
39365
39640
|
// ../argent-cli/src/lens.ts
|
|
39366
39641
|
import * as fs15 from "node:fs";
|
|
39367
39642
|
import * as os2 from "node:os";
|
|
39368
|
-
import * as
|
|
39643
|
+
import * as path22 from "node:path";
|
|
39369
39644
|
|
|
39370
39645
|
// ../argent-cli/src/lens-terminal.ts
|
|
39371
39646
|
import { execFileSync as execFileSync3 } from "node:child_process";
|
|
@@ -39583,15 +39858,15 @@ function isSessionAlive(session) {
|
|
|
39583
39858
|
// ../argent-cli/src/lens-pty.ts
|
|
39584
39859
|
import { chmodSync as chmodSync2, readdirSync as readdirSync2 } from "node:fs";
|
|
39585
39860
|
import { createRequire } from "node:module";
|
|
39586
|
-
import { dirname as
|
|
39861
|
+
import { dirname as dirname14, join as join20 } from "node:path";
|
|
39587
39862
|
var nodeRequire = createRequire(import.meta.url);
|
|
39588
39863
|
function ensureSpawnHelperExecutable(req = nodeRequire) {
|
|
39589
39864
|
if (process.platform !== "darwin") return;
|
|
39590
39865
|
try {
|
|
39591
|
-
const prebuilds =
|
|
39866
|
+
const prebuilds = join20(dirname14(req.resolve("node-pty/package.json")), "prebuilds");
|
|
39592
39867
|
for (const entry of readdirSync2(prebuilds)) {
|
|
39593
39868
|
try {
|
|
39594
|
-
chmodSync2(
|
|
39869
|
+
chmodSync2(join20(prebuilds, entry, "spawn-helper"), 493);
|
|
39595
39870
|
} catch {
|
|
39596
39871
|
}
|
|
39597
39872
|
}
|
|
@@ -40116,7 +40391,7 @@ async function lens(argv, options) {
|
|
|
40116
40391
|
await endSession(baseUrl);
|
|
40117
40392
|
process.exit(1);
|
|
40118
40393
|
}
|
|
40119
|
-
const seedFile =
|
|
40394
|
+
const seedFile = path22.join(os2.tmpdir(), `argent-lens-seed-${process.pid}-${Date.now()}.txt`);
|
|
40120
40395
|
fs15.writeFileSync(seedFile, buildSeedPrompt(), "utf8");
|
|
40121
40396
|
const launchCmd = agent.launch(shellQuote(process.cwd()), shellQuote(seedFile));
|
|
40122
40397
|
const removeSeedFile = () => {
|
|
@@ -40312,7 +40587,7 @@ async function endSession(baseUrl) {
|
|
|
40312
40587
|
|
|
40313
40588
|
// ../argent-cli/src/flags.ts
|
|
40314
40589
|
var import_picocolors2 = __toESM(require_picocolors(), 1);
|
|
40315
|
-
import * as
|
|
40590
|
+
import * as path24 from "node:path";
|
|
40316
40591
|
|
|
40317
40592
|
// ../argent-cli/src/secrets.ts
|
|
40318
40593
|
var import_picocolors = __toESM(require_picocolors(), 1);
|
|
@@ -40429,11 +40704,11 @@ async function linkedSecretsNote() {
|
|
|
40429
40704
|
}
|
|
40430
40705
|
|
|
40431
40706
|
// ../argent-cli/src/project-scope.ts
|
|
40432
|
-
import * as
|
|
40707
|
+
import * as path23 from "node:path";
|
|
40433
40708
|
function degenerateProjectScopeWarning(scope, file2) {
|
|
40434
40709
|
if (scope !== "project") return null;
|
|
40435
|
-
if (isHomeDir(
|
|
40436
|
-
return `WARNING: no project found between ${process.cwd()} and your home directory \u2014 "project" scope resolved to the home directory, so this writes the GLOBAL ${
|
|
40710
|
+
if (isHomeDir(path23.dirname(path23.dirname(file2)))) {
|
|
40711
|
+
return `WARNING: no project found between ${process.cwd()} and your home directory \u2014 "project" scope resolved to the home directory, so this writes the GLOBAL ${path23.basename(file2, ".json")} file (${file2}).`;
|
|
40437
40712
|
}
|
|
40438
40713
|
if (findProjectRoot(process.cwd()) === null) {
|
|
40439
40714
|
return `WARNING: no project markers (.argent, .git, package.json) found above ${process.cwd()} \u2014 treating it as the project root and creating ${file2}.`;
|
|
@@ -40576,7 +40851,7 @@ Options:
|
|
|
40576
40851
|
console.error(`Error: ${err.message}`);
|
|
40577
40852
|
process.exit(2);
|
|
40578
40853
|
}
|
|
40579
|
-
const projectIsHome = isHomeDir(
|
|
40854
|
+
const projectIsHome = isHomeDir(path24.dirname(path24.dirname(getFlagsPath("project"))));
|
|
40580
40855
|
const projectFlags = projectIsHome ? {} : readFlags("project");
|
|
40581
40856
|
const globalFlags = readFlags("global");
|
|
40582
40857
|
const effective = {};
|
|
@@ -40639,7 +40914,7 @@ Options:
|
|
|
40639
40914
|
|
|
40640
40915
|
// ../argent-cli/src/config.ts
|
|
40641
40916
|
var import_picocolors3 = __toESM(require_picocolors(), 1);
|
|
40642
|
-
import * as
|
|
40917
|
+
import * as path25 from "node:path";
|
|
40643
40918
|
function config2(argv) {
|
|
40644
40919
|
if (argv.length === 0 || argv[0] === "--help" || argv[0] === "-h") {
|
|
40645
40920
|
printUsage2();
|
|
@@ -40819,10 +41094,10 @@ function wantsHelp(argv) {
|
|
|
40819
41094
|
}
|
|
40820
41095
|
function scopeLabel(scope) {
|
|
40821
41096
|
if (scope === "global") return "global";
|
|
40822
|
-
return `project: ${
|
|
41097
|
+
return `project: ${path25.dirname(configDir("project"))}`;
|
|
40823
41098
|
}
|
|
40824
41099
|
function projectConfigWarning(scope) {
|
|
40825
|
-
return degenerateProjectScopeWarning(scope,
|
|
41100
|
+
return degenerateProjectScopeWarning(scope, path25.join(configDir("project"), "config.json"));
|
|
40826
41101
|
}
|
|
40827
41102
|
function restartHint(key) {
|
|
40828
41103
|
if (key !== "android.adbServerPort") return null;
|
|
@@ -41648,7 +41923,7 @@ import { styleText as styleText2, stripVTControlCharacters } from "node:util";
|
|
|
41648
41923
|
import process$1 from "node:process";
|
|
41649
41924
|
var import_sisteransi2 = __toESM(require_src(), 1);
|
|
41650
41925
|
import { existsSync as existsSync7, lstatSync as lstatSync3, readdirSync as readdirSync3 } from "node:fs";
|
|
41651
|
-
import { dirname as
|
|
41926
|
+
import { dirname as dirname18, join as join23 } from "node:path";
|
|
41652
41927
|
function isUnicodeSupported() {
|
|
41653
41928
|
if (process$1.platform !== "win32") {
|
|
41654
41929
|
return process$1.env.TERM !== "linux";
|
|
@@ -42536,7 +42811,7 @@ async function unlink3(argv) {
|
|
|
42536
42811
|
|
|
42537
42812
|
// ../argent-cli/src/telemetry.ts
|
|
42538
42813
|
var import_picocolors5 = __toESM(require_picocolors(), 1);
|
|
42539
|
-
import * as
|
|
42814
|
+
import * as path26 from "node:path";
|
|
42540
42815
|
var SCOPES = ["global", "project"];
|
|
42541
42816
|
var SUBCOMMANDS = ["status", "enable", "disable"];
|
|
42542
42817
|
var TELEMETRY_OPTIONS = {
|
|
@@ -42625,7 +42900,7 @@ function describeSource(source) {
|
|
|
42625
42900
|
}
|
|
42626
42901
|
}
|
|
42627
42902
|
function projectConfigWarning2(scope) {
|
|
42628
|
-
return degenerateProjectScopeWarning(scope,
|
|
42903
|
+
return degenerateProjectScopeWarning(scope, path26.join(configDir("project"), "config.json"));
|
|
42629
42904
|
}
|
|
42630
42905
|
async function cmdEnable(scope) {
|
|
42631
42906
|
const warning = projectConfigWarning2(scope);
|
|
@@ -42662,7 +42937,7 @@ async function cmdDisable(scope) {
|
|
|
42662
42937
|
// ../argent-cli/src/providers.ts
|
|
42663
42938
|
var import_picocolors7 = __toESM(require_picocolors(), 1);
|
|
42664
42939
|
import * as fs19 from "node:fs";
|
|
42665
|
-
import * as
|
|
42940
|
+
import * as path29 from "node:path";
|
|
42666
42941
|
|
|
42667
42942
|
// ../device-providers/src/contract.ts
|
|
42668
42943
|
var PROVIDER_SCHEMA_VERSION = 1;
|
|
@@ -42809,7 +43084,7 @@ var providerEnvelopeSchema = providerRecordSchema.extend({
|
|
|
42809
43084
|
// ../device-providers/src/read.ts
|
|
42810
43085
|
import * as fs16 from "node:fs";
|
|
42811
43086
|
import * as os3 from "node:os";
|
|
42812
|
-
import * as
|
|
43087
|
+
import * as path27 from "node:path";
|
|
42813
43088
|
var DISABLE_ENV = "ARGENT_DISABLE_DEVICE_PROVIDERS";
|
|
42814
43089
|
var OVERRIDE_ENV = "ARGENT_DEVICE_PROVIDERS";
|
|
42815
43090
|
function resolveHomeDir2() {
|
|
@@ -42818,7 +43093,7 @@ function resolveHomeDir2() {
|
|
|
42818
43093
|
return trimmed ? raw : os3.homedir();
|
|
42819
43094
|
}
|
|
42820
43095
|
function providersDirectory() {
|
|
42821
|
-
return
|
|
43096
|
+
return path27.join(resolveHomeDir2(), ".argent", "providers");
|
|
42822
43097
|
}
|
|
42823
43098
|
function discoveryDisabled() {
|
|
42824
43099
|
const raw = process.env[DISABLE_ENV];
|
|
@@ -42884,7 +43159,7 @@ function discoverProviders() {
|
|
|
42884
43159
|
function descriptorFiles() {
|
|
42885
43160
|
const directory = providersDirectory();
|
|
42886
43161
|
try {
|
|
42887
|
-
return fs16.readdirSync(directory).filter((name) => name.endsWith(".json")).sort().map((name) =>
|
|
43162
|
+
return fs16.readdirSync(directory).filter((name) => name.endsWith(".json")).sort().map((name) => path27.join(directory, name));
|
|
42888
43163
|
} catch {
|
|
42889
43164
|
return [];
|
|
42890
43165
|
}
|
|
@@ -42892,7 +43167,7 @@ function descriptorFiles() {
|
|
|
42892
43167
|
|
|
42893
43168
|
// ../device-providers/src/write.ts
|
|
42894
43169
|
import * as fs17 from "node:fs";
|
|
42895
|
-
import * as
|
|
43170
|
+
import * as path28 from "node:path";
|
|
42896
43171
|
var ProviderValidationError = class extends Error {
|
|
42897
43172
|
/** One line per problem, `path: message`, in the order zod reported them. */
|
|
42898
43173
|
issues;
|
|
@@ -42944,7 +43219,7 @@ function publishProvider(record2, options = {}) {
|
|
|
42944
43219
|
);
|
|
42945
43220
|
}
|
|
42946
43221
|
const directory = providersDirectory();
|
|
42947
|
-
const file2 =
|
|
43222
|
+
const file2 = path28.join(directory, `${validated.id}.json`);
|
|
42948
43223
|
const body = JSON.stringify(canonicalize(candidate), null, 2) + "\n";
|
|
42949
43224
|
try {
|
|
42950
43225
|
if (fs17.readFileSync(file2, "utf8") === body) return { changed: false, path: file2 };
|
|
@@ -42968,7 +43243,7 @@ function withdrawProvider(id) {
|
|
|
42968
43243
|
if (!PROVIDER_ID_SHAPE.test(id)) {
|
|
42969
43244
|
throw new Error(`'${id}' is not a valid provider id (${String(PROVIDER_ID_SHAPE)}).`);
|
|
42970
43245
|
}
|
|
42971
|
-
const file2 =
|
|
43246
|
+
const file2 = path28.join(providersDirectory(), `${id}.json`);
|
|
42972
43247
|
try {
|
|
42973
43248
|
fs17.unlinkSync(file2);
|
|
42974
43249
|
return true;
|
|
@@ -43482,7 +43757,7 @@ function runWithdraw(args) {
|
|
|
43482
43757
|
throw new UsageError2(`'${id}' is not a valid provider id (${String(PROVIDER_ID_SHAPE)})`);
|
|
43483
43758
|
}
|
|
43484
43759
|
const removed = withdrawProvider(id);
|
|
43485
|
-
const file2 =
|
|
43760
|
+
const file2 = path29.join(providersDirectory(), `${id}.json`);
|
|
43486
43761
|
if (args.json) {
|
|
43487
43762
|
console.log(JSON.stringify({ ok: true, path: file2, removed }, null, 2));
|
|
43488
43763
|
return;
|