@swmansion/argent 0.34.1-next.64 → 0.34.1-next.66
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 +532 -252
- package/dist/client.js +5 -0
- package/dist/installer.mjs +53 -1
- package/dist/mcp-server.mjs +2079 -0
- package/dist/tool-server.cjs +15 -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";
|
|
@@ -9492,6 +9492,11 @@ var FLAG_REGISTRY = [
|
|
|
9492
9492
|
description: "Overlay the argent corner watermark on recorded screen videos. On by default; turn it off with `argent disable video-watermark`.",
|
|
9493
9493
|
defaultEnabled: true
|
|
9494
9494
|
},
|
|
9495
|
+
{
|
|
9496
|
+
name: "whats-new",
|
|
9497
|
+
description: "After an update, tell the agent the highlights of the new Argent version on its first tool call. On by default; turn it off with `argent disable whats-new`.",
|
|
9498
|
+
defaultEnabled: true
|
|
9499
|
+
},
|
|
9495
9500
|
{
|
|
9496
9501
|
name: "macos-apps",
|
|
9497
9502
|
description: "Control native Mac apps, including Mac Catalyst. Adds the macos platform to list-devices and boot-device, and the file-panel and menu-bar tools. On by default; turn it off with `argent disable macos-apps`.",
|
|
@@ -10265,8 +10270,8 @@ var UNEXPANDED_PATH = /^~|\$[A-Za-z0-9_{(]|`|%[A-Za-z_][A-Za-z0-9_]*%|^[A-Za-z][
|
|
|
10265
10270
|
function isUnexpandedPath(p) {
|
|
10266
10271
|
return UNEXPANDED_PATH.test(p);
|
|
10267
10272
|
}
|
|
10268
|
-
function isClientFileArgument({ spec, path:
|
|
10269
|
-
return spec.kind === "file" && spec.path === `\${${spec.target}}` &&
|
|
10273
|
+
function isClientFileArgument({ spec, path: path30 }) {
|
|
10274
|
+
return spec.kind === "file" && spec.path === `\${${spec.target}}` && path30.startsWith("/") && hasToolFileExtension(path30);
|
|
10270
10275
|
}
|
|
10271
10276
|
|
|
10272
10277
|
// ../registry/src/flow-platforms.ts
|
|
@@ -11800,10 +11805,10 @@ function mergeDefs(...defs) {
|
|
|
11800
11805
|
function cloneDef(schema) {
|
|
11801
11806
|
return mergeDefs(schema._zod.def);
|
|
11802
11807
|
}
|
|
11803
|
-
function getElementAtPath(obj,
|
|
11804
|
-
if (!
|
|
11808
|
+
function getElementAtPath(obj, path30) {
|
|
11809
|
+
if (!path30)
|
|
11805
11810
|
return obj;
|
|
11806
|
-
return
|
|
11811
|
+
return path30.reduce((acc, key) => acc?.[key], obj);
|
|
11807
11812
|
}
|
|
11808
11813
|
function promiseAllObject(promisesObj) {
|
|
11809
11814
|
const keys = Object.keys(promisesObj);
|
|
@@ -12143,11 +12148,11 @@ function explicitlyAborted(x, startIndex = 0) {
|
|
|
12143
12148
|
}
|
|
12144
12149
|
return false;
|
|
12145
12150
|
}
|
|
12146
|
-
function prefixIssues(
|
|
12151
|
+
function prefixIssues(path30, issues) {
|
|
12147
12152
|
return issues.map((iss) => {
|
|
12148
12153
|
var _a3;
|
|
12149
12154
|
(_a3 = iss).path ?? (_a3.path = []);
|
|
12150
|
-
iss.path.unshift(
|
|
12155
|
+
iss.path.unshift(path30);
|
|
12151
12156
|
return iss;
|
|
12152
12157
|
});
|
|
12153
12158
|
}
|
|
@@ -12609,16 +12614,16 @@ function flattenError(error63, mapper = (issue2) => issue2.message) {
|
|
|
12609
12614
|
}
|
|
12610
12615
|
function formatError(error63, mapper = (issue2) => issue2.message) {
|
|
12611
12616
|
const fieldErrors = { _errors: [] };
|
|
12612
|
-
const processError = (error64,
|
|
12617
|
+
const processError = (error64, path30 = []) => {
|
|
12613
12618
|
for (const issue2 of error64.issues) {
|
|
12614
12619
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
12615
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
12620
|
+
issue2.errors.map((issues) => processError({ issues }, [...path30, ...issue2.path]));
|
|
12616
12621
|
} else if (issue2.code === "invalid_key") {
|
|
12617
|
-
processError({ issues: issue2.issues }, [...
|
|
12622
|
+
processError({ issues: issue2.issues }, [...path30, ...issue2.path]);
|
|
12618
12623
|
} else if (issue2.code === "invalid_element") {
|
|
12619
|
-
processError({ issues: issue2.issues }, [...
|
|
12624
|
+
processError({ issues: issue2.issues }, [...path30, ...issue2.path]);
|
|
12620
12625
|
} else {
|
|
12621
|
-
const fullpath = [...
|
|
12626
|
+
const fullpath = [...path30, ...issue2.path];
|
|
12622
12627
|
if (fullpath.length === 0) {
|
|
12623
12628
|
fieldErrors._errors.push(mapper(issue2));
|
|
12624
12629
|
} else {
|
|
@@ -12657,17 +12662,17 @@ function formatError(error63, mapper = (issue2) => issue2.message) {
|
|
|
12657
12662
|
}
|
|
12658
12663
|
function treeifyError(error63, mapper = (issue2) => issue2.message) {
|
|
12659
12664
|
const result = { errors: [] };
|
|
12660
|
-
const processError = (error64,
|
|
12665
|
+
const processError = (error64, path30 = []) => {
|
|
12661
12666
|
var _a3;
|
|
12662
12667
|
for (const issue2 of error64.issues) {
|
|
12663
12668
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
12664
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
12669
|
+
issue2.errors.map((issues) => processError({ issues }, [...path30, ...issue2.path]));
|
|
12665
12670
|
} else if (issue2.code === "invalid_key") {
|
|
12666
|
-
processError({ issues: issue2.issues }, [...
|
|
12671
|
+
processError({ issues: issue2.issues }, [...path30, ...issue2.path]);
|
|
12667
12672
|
} else if (issue2.code === "invalid_element") {
|
|
12668
|
-
processError({ issues: issue2.issues }, [...
|
|
12673
|
+
processError({ issues: issue2.issues }, [...path30, ...issue2.path]);
|
|
12669
12674
|
} else {
|
|
12670
|
-
const fullpath = [...
|
|
12675
|
+
const fullpath = [...path30, ...issue2.path];
|
|
12671
12676
|
if (fullpath.length === 0) {
|
|
12672
12677
|
result.errors.push(mapper(issue2));
|
|
12673
12678
|
continue;
|
|
@@ -12706,8 +12711,8 @@ function treeifyError(error63, mapper = (issue2) => issue2.message) {
|
|
|
12706
12711
|
}
|
|
12707
12712
|
function toDotPath(_path) {
|
|
12708
12713
|
const segs = [];
|
|
12709
|
-
const
|
|
12710
|
-
for (const seg of
|
|
12714
|
+
const path30 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
|
|
12715
|
+
for (const seg of path30) {
|
|
12711
12716
|
if (typeof seg === "number")
|
|
12712
12717
|
segs.push(`[${seg}]`);
|
|
12713
12718
|
else if (typeof seg === "symbol")
|
|
@@ -29845,13 +29850,13 @@ function resolveRef(ref, ctx) {
|
|
|
29845
29850
|
if (!ref.startsWith("#")) {
|
|
29846
29851
|
throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
|
|
29847
29852
|
}
|
|
29848
|
-
const
|
|
29849
|
-
if (
|
|
29853
|
+
const path30 = ref.slice(1).split("/").filter(Boolean);
|
|
29854
|
+
if (path30.length === 0) {
|
|
29850
29855
|
return ctx.rootSchema;
|
|
29851
29856
|
}
|
|
29852
29857
|
const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
|
|
29853
|
-
if (
|
|
29854
|
-
const key =
|
|
29858
|
+
if (path30[0] === defsKey) {
|
|
29859
|
+
const key = path30[1] === void 0 ? void 0 : decodeJSONPointerSegment(path30[1]);
|
|
29855
29860
|
if (!key || !ctx.defs[key]) {
|
|
29856
29861
|
throw new Error(`Reference not found: ${ref}`);
|
|
29857
29862
|
}
|
|
@@ -30704,9 +30709,9 @@ function date4(params) {
|
|
|
30704
30709
|
import { randomUUID as randomUUID3 } from "node:crypto";
|
|
30705
30710
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
30706
30711
|
var resolvedDuringInvocation = new AsyncLocalStorage();
|
|
30707
|
-
function valueAtPath(root,
|
|
30712
|
+
function valueAtPath(root, path30) {
|
|
30708
30713
|
let current = root;
|
|
30709
|
-
for (const key of
|
|
30714
|
+
for (const key of path30) {
|
|
30710
30715
|
if (current === null || typeof current !== "object") return void 0;
|
|
30711
30716
|
if (!Object.hasOwn(current, key)) return void 0;
|
|
30712
30717
|
current = current[key];
|
|
@@ -30866,8 +30871,8 @@ function parseLinkTarget(input2) {
|
|
|
30866
30871
|
const host = u3.hostname.startsWith("[") ? u3.hostname.slice(1, -1) : u3.hostname;
|
|
30867
30872
|
if (!host) throw new Error(`URL "${input2}" is missing a host.`);
|
|
30868
30873
|
const port = u3.port ? Number(u3.port) : u3.protocol === "https:" ? 443 : 80;
|
|
30869
|
-
const
|
|
30870
|
-
const url2 = `${u3.protocol}//${u3.host}${
|
|
30874
|
+
const path30 = u3.pathname === "/" ? "" : u3.pathname.replace(/\/+$/, "");
|
|
30875
|
+
const url2 = `${u3.protocol}//${u3.host}${path30}`;
|
|
30871
30876
|
const token = u3.username ? decodeURIComponent(u3.username) : void 0;
|
|
30872
30877
|
return { url: url2, host, port, ...token ? { token } : {} };
|
|
30873
30878
|
}
|
|
@@ -31098,8 +31103,8 @@ async function runTar(archive, args, signal) {
|
|
|
31098
31103
|
function normalizeTarMemberPath(memberPath) {
|
|
31099
31104
|
return memberPath.replace(/^\.\//, "").replace(/\\/g, "/");
|
|
31100
31105
|
}
|
|
31101
|
-
function isContainedPath(
|
|
31102
|
-
const slashed =
|
|
31106
|
+
function isContainedPath(path30, windows = process.platform === "win32") {
|
|
31107
|
+
const slashed = path30.replace(/\\/g, "/");
|
|
31103
31108
|
const drive = windows ? /^[A-Za-z]:/ : /^[A-Za-z]:\//;
|
|
31104
31109
|
return !slashed.startsWith("/") && !drive.test(slashed) && !slashed.split("/").includes("..");
|
|
31105
31110
|
}
|
|
@@ -32123,10 +32128,10 @@ function assertFiniteNumbers(args) {
|
|
|
32123
32128
|
if (typeof item === "object" && item !== null) {
|
|
32124
32129
|
pending.push({ value: item, key, parent: visit2 });
|
|
32125
32130
|
} 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:
|
|
32131
|
+
const path30 = [key];
|
|
32132
|
+
for (let at = visit2; at.parent; at = at.parent) path30.push(at.key);
|
|
32133
|
+
path30.reverse();
|
|
32134
|
+
issues.push({ code: "invalid_type", path: path30, message: `expected a number, got ${item}` });
|
|
32130
32135
|
if (issues.length === MAX_NON_FINITE_ISSUES) break;
|
|
32131
32136
|
}
|
|
32132
32137
|
}
|
|
@@ -32550,10 +32555,10 @@ async function writeDurableUnique(dir, filename, write) {
|
|
|
32550
32555
|
const stem = filename.slice(0, filename.length - ext.length);
|
|
32551
32556
|
for (let i2 = 1; i2 <= 1e3; i2++) {
|
|
32552
32557
|
const candidate = i2 === 1 ? filename : `${stem} (${i2})${ext}`;
|
|
32553
|
-
const
|
|
32558
|
+
const path30 = join13(dir, candidate);
|
|
32554
32559
|
try {
|
|
32555
|
-
await write(
|
|
32556
|
-
return
|
|
32560
|
+
await write(path30);
|
|
32561
|
+
return path30;
|
|
32557
32562
|
} catch (err) {
|
|
32558
32563
|
if (err?.code === "EEXIST") continue;
|
|
32559
32564
|
throw err;
|
|
@@ -35190,7 +35195,7 @@ function appendRootPathToUrlIfNeeded(url2) {
|
|
|
35190
35195
|
return void 0;
|
|
35191
35196
|
}
|
|
35192
35197
|
}
|
|
35193
|
-
function appendResourcePathToUrl(url2,
|
|
35198
|
+
function appendResourcePathToUrl(url2, path30) {
|
|
35194
35199
|
try {
|
|
35195
35200
|
new URL(url2);
|
|
35196
35201
|
} catch {
|
|
@@ -35200,11 +35205,11 @@ function appendResourcePathToUrl(url2, path29) {
|
|
|
35200
35205
|
if (!url2.endsWith("/")) {
|
|
35201
35206
|
url2 = url2 + "/";
|
|
35202
35207
|
}
|
|
35203
|
-
url2 +=
|
|
35208
|
+
url2 += path30;
|
|
35204
35209
|
try {
|
|
35205
35210
|
new URL(url2);
|
|
35206
35211
|
} catch {
|
|
35207
|
-
diag2.warn(`Configuration: Provided URL appended with '${
|
|
35212
|
+
diag2.warn(`Configuration: Provided URL appended with '${path30}' is not a valid URL, using 'undefined' instead of '${url2}'`);
|
|
35208
35213
|
return void 0;
|
|
35209
35214
|
}
|
|
35210
35215
|
return url2;
|
|
@@ -35867,9 +35872,9 @@ function isReplitAgent(env) {
|
|
|
35867
35872
|
}
|
|
35868
35873
|
var DEVIN_MARKER_PATH = "/opt/.devin";
|
|
35869
35874
|
var JULES_MARKER_PATH = "/opt/environment_summary.sh";
|
|
35870
|
-
function safeExists(fileExists,
|
|
35875
|
+
function safeExists(fileExists, path30) {
|
|
35871
35876
|
try {
|
|
35872
|
-
return fileExists(
|
|
35877
|
+
return fileExists(path30);
|
|
35873
35878
|
} catch {
|
|
35874
35879
|
return false;
|
|
35875
35880
|
}
|
|
@@ -36289,7 +36294,7 @@ function isCi(env = process.env) {
|
|
|
36289
36294
|
var SESSION_ID2 = randomUUID5();
|
|
36290
36295
|
function readCliVersion() {
|
|
36291
36296
|
if (true) {
|
|
36292
|
-
return "0.34.1-next.
|
|
36297
|
+
return "0.34.1-next.65";
|
|
36293
36298
|
}
|
|
36294
36299
|
return "0.0.0";
|
|
36295
36300
|
}
|
|
@@ -37235,11 +37240,11 @@ function isValidationIssue(value) {
|
|
|
37235
37240
|
}
|
|
37236
37241
|
|
|
37237
37242
|
// ../argent-cli/src/e2e.ts
|
|
37238
|
-
var
|
|
37239
|
-
import * as
|
|
37243
|
+
var import_yaml4 = __toESM(require_dist(), 1);
|
|
37244
|
+
import * as fsp2 from "node:fs/promises";
|
|
37240
37245
|
import { constants as fsConstants2 } from "node:fs";
|
|
37241
37246
|
import { createHash as createHash5 } from "node:crypto";
|
|
37242
|
-
import * as
|
|
37247
|
+
import * as path19 from "node:path";
|
|
37243
37248
|
|
|
37244
37249
|
// ../argent-cli/src/command-args.ts
|
|
37245
37250
|
var UsageError = class extends Error {
|
|
@@ -37311,6 +37316,150 @@ function parseCommandArgs(argv, specs) {
|
|
|
37311
37316
|
return { positionals, options };
|
|
37312
37317
|
}
|
|
37313
37318
|
|
|
37319
|
+
// ../argent-cli/src/e2e-suite.ts
|
|
37320
|
+
var import_yaml3 = __toESM(require_dist(), 1);
|
|
37321
|
+
import * as fsp from "node:fs/promises";
|
|
37322
|
+
import * as path18 from "node:path";
|
|
37323
|
+
var SUITE_CONFIG_FILE = "suite.config.yaml";
|
|
37324
|
+
var SuiteConfigError = class extends Error {
|
|
37325
|
+
constructor(message) {
|
|
37326
|
+
super(message);
|
|
37327
|
+
this.name = "SuiteConfigError";
|
|
37328
|
+
}
|
|
37329
|
+
};
|
|
37330
|
+
var SUITE_CONFIG_KEYS = ["tests", "continueOnFailure"];
|
|
37331
|
+
function parseSuiteConfig(text2) {
|
|
37332
|
+
let doc;
|
|
37333
|
+
try {
|
|
37334
|
+
doc = (0, import_yaml3.parse)(text2, { logLevel: "error" });
|
|
37335
|
+
} catch (err) {
|
|
37336
|
+
throw new SuiteConfigError(
|
|
37337
|
+
`not valid YAML: ${(err instanceof Error ? err.message : String(err)).trimEnd()}`
|
|
37338
|
+
);
|
|
37339
|
+
}
|
|
37340
|
+
if (doc === null || doc === void 0) return { continueOnFailure: false };
|
|
37341
|
+
if (typeof doc !== "object" || Array.isArray(doc)) {
|
|
37342
|
+
throw new SuiteConfigError(
|
|
37343
|
+
`must be a YAML map with the keys ${SUITE_CONFIG_KEYS.join(" and ")}`
|
|
37344
|
+
);
|
|
37345
|
+
}
|
|
37346
|
+
const map2 = doc;
|
|
37347
|
+
for (const key of Object.keys(map2)) {
|
|
37348
|
+
if (!SUITE_CONFIG_KEYS.includes(key)) {
|
|
37349
|
+
throw new SuiteConfigError(
|
|
37350
|
+
`unknown key ${JSON.stringify(key)}; the allowed keys are ${SUITE_CONFIG_KEYS.join(" and ")}`
|
|
37351
|
+
);
|
|
37352
|
+
}
|
|
37353
|
+
}
|
|
37354
|
+
const config3 = { continueOnFailure: false };
|
|
37355
|
+
if ("continueOnFailure" in map2) {
|
|
37356
|
+
if (typeof map2.continueOnFailure !== "boolean") {
|
|
37357
|
+
throw new SuiteConfigError("continueOnFailure must be true or false");
|
|
37358
|
+
}
|
|
37359
|
+
config3.continueOnFailure = map2.continueOnFailure;
|
|
37360
|
+
}
|
|
37361
|
+
if ("tests" in map2) {
|
|
37362
|
+
const entries = map2.tests;
|
|
37363
|
+
if (!Array.isArray(entries) || entries.length === 0) {
|
|
37364
|
+
throw new SuiteConfigError("tests must be a non-empty list of test names");
|
|
37365
|
+
}
|
|
37366
|
+
const names = [];
|
|
37367
|
+
for (const [index, entry] of entries.entries()) {
|
|
37368
|
+
if (typeof entry !== "string") {
|
|
37369
|
+
throw new SuiteConfigError(
|
|
37370
|
+
`tests entry ${index + 1} is not a string; put the test name in quotes`
|
|
37371
|
+
);
|
|
37372
|
+
}
|
|
37373
|
+
const name = entry.endsWith(".yaml") ? entry.slice(0, -".yaml".length) : entry;
|
|
37374
|
+
if (!FLOW_NAME_PATTERN.test(name)) {
|
|
37375
|
+
throw new SuiteConfigError(`tests entry ${JSON.stringify(entry)} is not a valid test name`);
|
|
37376
|
+
}
|
|
37377
|
+
if (names.includes(name)) {
|
|
37378
|
+
throw new SuiteConfigError(`tests lists ${JSON.stringify(name)} more than once`);
|
|
37379
|
+
}
|
|
37380
|
+
names.push(name);
|
|
37381
|
+
}
|
|
37382
|
+
config3.tests = names;
|
|
37383
|
+
}
|
|
37384
|
+
return config3;
|
|
37385
|
+
}
|
|
37386
|
+
async function readSuiteConfig(dir) {
|
|
37387
|
+
let text2;
|
|
37388
|
+
try {
|
|
37389
|
+
text2 = await fsp.readFile(path18.join(dir, SUITE_CONFIG_FILE), "utf8");
|
|
37390
|
+
} catch (err) {
|
|
37391
|
+
const code = err.code;
|
|
37392
|
+
throw new SuiteConfigError(
|
|
37393
|
+
`could not read the file: ${code ?? (err instanceof Error ? err.message : String(err))}`
|
|
37394
|
+
);
|
|
37395
|
+
}
|
|
37396
|
+
return parseSuiteConfig(text2);
|
|
37397
|
+
}
|
|
37398
|
+
function unlistedWarning(file2, manifest) {
|
|
37399
|
+
return `${file2} is not listed in the tests of ${manifest} and does not run`;
|
|
37400
|
+
}
|
|
37401
|
+
async function planDirectoryRun(runDir, collected, manifests) {
|
|
37402
|
+
const byDir = /* @__PURE__ */ new Map();
|
|
37403
|
+
for (const rel of collected) {
|
|
37404
|
+
const dir = path18.dirname(rel);
|
|
37405
|
+
const files = byDir.get(dir);
|
|
37406
|
+
if (files) files.push(rel);
|
|
37407
|
+
else byDir.set(dir, [rel]);
|
|
37408
|
+
}
|
|
37409
|
+
const testless = manifests.filter((manifest) => !byDir.has(path18.dirname(manifest)));
|
|
37410
|
+
const suiteEntries = /* @__PURE__ */ new Map();
|
|
37411
|
+
const unlisted = [];
|
|
37412
|
+
for (const dir of new Set(manifests.map((manifest) => path18.dirname(manifest)))) {
|
|
37413
|
+
const files = byDir.get(dir) ?? [];
|
|
37414
|
+
const manifest = path18.join(dir, SUITE_CONFIG_FILE);
|
|
37415
|
+
let config3;
|
|
37416
|
+
let ordered = files;
|
|
37417
|
+
try {
|
|
37418
|
+
config3 = await readSuiteConfig(path18.join(runDir, dir));
|
|
37419
|
+
if (config3.tests) {
|
|
37420
|
+
ordered = config3.tests.map((name) => {
|
|
37421
|
+
const file2 = files.find((f) => path18.basename(f, ".yaml") === name);
|
|
37422
|
+
if (file2 === void 0) {
|
|
37423
|
+
throw new SuiteConfigError(
|
|
37424
|
+
`tests entry ${JSON.stringify(name)} names no e2e test in this directory`
|
|
37425
|
+
);
|
|
37426
|
+
}
|
|
37427
|
+
return file2;
|
|
37428
|
+
});
|
|
37429
|
+
}
|
|
37430
|
+
} catch (err) {
|
|
37431
|
+
if (!(err instanceof SuiteConfigError)) throw err;
|
|
37432
|
+
suiteEntries.set(dir, [
|
|
37433
|
+
{
|
|
37434
|
+
kind: "invalid-suite",
|
|
37435
|
+
dir,
|
|
37436
|
+
manifest,
|
|
37437
|
+
message: `${manifest}: ${err.message}`,
|
|
37438
|
+
error: err.message,
|
|
37439
|
+
tests: files
|
|
37440
|
+
}
|
|
37441
|
+
]);
|
|
37442
|
+
continue;
|
|
37443
|
+
}
|
|
37444
|
+
const suite = { dir, manifest, continueOnFailure: config3.continueOnFailure };
|
|
37445
|
+
suiteEntries.set(
|
|
37446
|
+
dir,
|
|
37447
|
+
ordered.map((file2) => ({ kind: "test", path: file2, suite }))
|
|
37448
|
+
);
|
|
37449
|
+
for (const file2 of files) {
|
|
37450
|
+
if (!ordered.includes(file2)) unlisted.push({ path: file2, suite });
|
|
37451
|
+
}
|
|
37452
|
+
}
|
|
37453
|
+
const entries = [];
|
|
37454
|
+
for (const rel of [...collected, ...testless].sort()) {
|
|
37455
|
+
const dir = path18.dirname(rel);
|
|
37456
|
+
const inSuite = suiteEntries.get(dir);
|
|
37457
|
+
if (inSuite === void 0) entries.push({ kind: "test", path: rel });
|
|
37458
|
+
else if ((byDir.get(dir)?.[0] ?? rel) === rel) entries.push(...inSuite);
|
|
37459
|
+
}
|
|
37460
|
+
return { entries, unlisted };
|
|
37461
|
+
}
|
|
37462
|
+
|
|
37314
37463
|
// ../argent-cli/src/e2e.ts
|
|
37315
37464
|
var STATUS_GLYPH = {
|
|
37316
37465
|
pass: "\u2713",
|
|
@@ -37355,7 +37504,8 @@ Run a YAML e2e test without an LLM in the loop. \`run\` takes any of these forms
|
|
|
37355
37504
|
directory. It must not contain ".." segments (pass the resolved
|
|
37356
37505
|
path instead); a path is what reaches e2e tests kept elsewhere, and
|
|
37357
37506
|
what \`argent e2e list\` prints for nested ones
|
|
37358
|
-
a dir
|
|
37507
|
+
a dir The e2e tests in that directory, in no guaranteed order. To set
|
|
37508
|
+
the order, add an optional suite.config.yaml file (see below)
|
|
37359
37509
|
|
|
37360
37510
|
For a name and for a file path alike, the
|
|
37361
37511
|
filename (minus .yaml) names the run's report and artifacts, so it must
|
|
@@ -37370,8 +37520,8 @@ a running instance.
|
|
|
37370
37520
|
|
|
37371
37521
|
A directory run prints only the steps that need attention (each failure, each
|
|
37372
37522
|
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
|
-
|
|
37523
|
+
it lists every failed test with its reason and a command that re-runs it,
|
|
37524
|
+
then a final summary; --recursive walks subdirectories too
|
|
37375
37525
|
(__baselines__, node_modules and dot-directories other than .argent are
|
|
37376
37526
|
skipped). A directory run and list skip a YAML file that is not an e2e test.
|
|
37377
37527
|
A test that fails its steps keeps the batch running, as does one the
|
|
@@ -37380,6 +37530,15 @@ transport failure, a rejection the server does not mark as validation, or a
|
|
|
37380
37530
|
reply that is not a report stops the batch and counts the remaining tests
|
|
37381
37531
|
skipped.
|
|
37382
37532
|
|
|
37533
|
+
A directory that holds a suite.config.yaml file is a suite: its tests run in
|
|
37534
|
+
the order of its \`tests:\` list, or in file name order without one, and a failed
|
|
37535
|
+
test skips the later tests of the suite unless the file sets
|
|
37536
|
+
\`continueOnFailure: true\`. A test file that the \`tests:\` list does not name
|
|
37537
|
+
does not run. list prints the tests of a suite in run order. It leaves out a
|
|
37538
|
+
test file that the \`tests:\` list does not name and the tests of a suite with
|
|
37539
|
+
an invalid suite.config.yaml file, and names them on stderr; list --json keeps
|
|
37540
|
+
those tests and gives each a warning code.
|
|
37541
|
+
|
|
37383
37542
|
A test can declare a \`requires:\` block (platform, runtimeKind) that names the
|
|
37384
37543
|
targets it supports. A directory run skips each test whose requirements the
|
|
37385
37544
|
target does not meet, so the same directory runs on each platform without a
|
|
@@ -37408,14 +37567,15 @@ Without a link, all step kinds run.
|
|
|
37408
37567
|
|
|
37409
37568
|
Subcommands:
|
|
37410
37569
|
run <test|test.yaml|dir> Run a saved e2e test by name, a YAML file by path,
|
|
37411
|
-
or
|
|
37570
|
+
or the tests in a directory, and report pass/fail
|
|
37412
37571
|
(exit reflects result)
|
|
37413
37572
|
list [dir] [-r] [--json] List runnable YAML paths in dir (-r: also in its
|
|
37414
37573
|
subdirectories), or in .argent/e2e and
|
|
37415
37574
|
.argent/flows (legacy) with notes on stderr.
|
|
37416
37575
|
--json prints { "e2eTests": [...] } instead, with
|
|
37417
|
-
path and an optional warning per entry,
|
|
37418
|
-
legacy and shadowedBy when no dir is
|
|
37576
|
+
path and an optional warning and suite per entry,
|
|
37577
|
+
plus name, legacy and shadowedBy when no dir is
|
|
37578
|
+
given
|
|
37419
37579
|
|
|
37420
37580
|
Options (run):
|
|
37421
37581
|
--device <id> Device id to run against (auto-detected when omitted)
|
|
@@ -37622,17 +37782,20 @@ function shellQuoteArg(arg) {
|
|
|
37622
37782
|
return `'${arg.replaceAll("'", "'\\''")}'`;
|
|
37623
37783
|
}
|
|
37624
37784
|
function optionSafePath(p) {
|
|
37625
|
-
return p.startsWith("-") ? `.${
|
|
37785
|
+
return p.startsWith("-") ? `.${path19.sep}${p}` : p;
|
|
37626
37786
|
}
|
|
37627
37787
|
function rerunCommand(flowPath, rel, projectRoot, args) {
|
|
37628
37788
|
const pathArg = (p) => shellQuoteArg(optionSafePath(p));
|
|
37629
|
-
const fromCwd =
|
|
37630
|
-
const shown =
|
|
37631
|
-
const parts = [
|
|
37789
|
+
const fromCwd = path19.relative(projectRoot, flowPath) || ".";
|
|
37790
|
+
const shown = path19.isAbsolute(fromCwd) || fromCwd.split(/[\\/]+/).includes("..") ? flowPath : fromCwd;
|
|
37791
|
+
const parts = [
|
|
37792
|
+
"argent e2e run",
|
|
37793
|
+
pathArg(SAFE_FLOW_NAME.test(shown) ? `.${path19.sep}${shown}` : shown)
|
|
37794
|
+
];
|
|
37632
37795
|
if (args.device) parts.push("--device", shellQuoteArg(args.device));
|
|
37633
37796
|
if (args.platform) parts.push("--platform", shellQuoteArg(args.platform));
|
|
37634
37797
|
if (args.updateBaselines) parts.push("--update-baselines");
|
|
37635
|
-
if (args.output) parts.push("--output", pathArg(
|
|
37798
|
+
if (args.output) parts.push("--output", pathArg(path19.join(args.output, path19.dirname(rel))));
|
|
37636
37799
|
return parts.join(" ");
|
|
37637
37800
|
}
|
|
37638
37801
|
var EXPORT_SOURCE_MARKER = ".argent-e2e-source";
|
|
@@ -37640,14 +37803,14 @@ var LEGACY_EXPORT_SOURCE_MARKER = ".argent-flow-source";
|
|
|
37640
37803
|
var MARKER_READ_RETRIES = 4;
|
|
37641
37804
|
var MARKER_READ_DELAY_MS = 5;
|
|
37642
37805
|
async function readExportMarker(dir) {
|
|
37643
|
-
const owner = await readMarkerFile(
|
|
37644
|
-
return owner !== void 0 ? owner : await readMarkerFile(
|
|
37806
|
+
const owner = await readMarkerFile(path19.join(dir, EXPORT_SOURCE_MARKER));
|
|
37807
|
+
return owner !== void 0 ? owner : await readMarkerFile(path19.join(dir, LEGACY_EXPORT_SOURCE_MARKER));
|
|
37645
37808
|
}
|
|
37646
37809
|
async function readMarkerFile(marker) {
|
|
37647
37810
|
for (let attempt = 0; ; attempt++) {
|
|
37648
37811
|
let owner;
|
|
37649
37812
|
try {
|
|
37650
|
-
owner = (await
|
|
37813
|
+
owner = (await fsp2.readFile(marker, "utf8")).trim();
|
|
37651
37814
|
} catch {
|
|
37652
37815
|
return void 0;
|
|
37653
37816
|
}
|
|
@@ -37660,7 +37823,7 @@ async function classifyExportDir(dir, flowPath) {
|
|
|
37660
37823
|
let owner = await readExportMarker(dir);
|
|
37661
37824
|
if (owner === void 0) {
|
|
37662
37825
|
try {
|
|
37663
|
-
if ((await
|
|
37826
|
+
if ((await fsp2.readdir(dir)).length === 0) {
|
|
37664
37827
|
return { state: "free" };
|
|
37665
37828
|
}
|
|
37666
37829
|
} catch (err) {
|
|
@@ -37677,8 +37840,8 @@ function occupiedBy(owner) {
|
|
|
37677
37840
|
}
|
|
37678
37841
|
async function takeExportDir(dir, flowPath) {
|
|
37679
37842
|
try {
|
|
37680
|
-
await
|
|
37681
|
-
await
|
|
37843
|
+
await fsp2.mkdir(dir, { recursive: true });
|
|
37844
|
+
await fsp2.writeFile(path19.join(dir, EXPORT_SOURCE_MARKER), `${flowPath}
|
|
37682
37845
|
`, { flag: "wx" });
|
|
37683
37846
|
return null;
|
|
37684
37847
|
} catch (err) {
|
|
@@ -37697,7 +37860,7 @@ async function claimExportDirName(outputDir, flowPath, stem) {
|
|
|
37697
37860
|
}
|
|
37698
37861
|
const avoided = [];
|
|
37699
37862
|
for (const name of candidates) {
|
|
37700
|
-
const dir =
|
|
37863
|
+
const dir = path19.join(outputDir, name);
|
|
37701
37864
|
const claim2 = await classifyExportDir(dir, flowPath);
|
|
37702
37865
|
const reason = claim2.state === "foreign" ? occupiedBy(claim2.owner) : await takeExportDir(dir, flowPath);
|
|
37703
37866
|
if (reason !== null) {
|
|
@@ -37717,7 +37880,7 @@ async function claimExportDirName(outputDir, flowPath, stem) {
|
|
|
37717
37880
|
return null;
|
|
37718
37881
|
}
|
|
37719
37882
|
async function exportFailureArtifacts(report, outputDir, flowPath, ctx) {
|
|
37720
|
-
const stem =
|
|
37883
|
+
const stem = path19.basename(flowPath, ".yaml");
|
|
37721
37884
|
if (!SAFE_ARTIFACT_NAME.test(stem)) {
|
|
37722
37885
|
console.error(
|
|
37723
37886
|
`warning: skipping artifact export for unsafe e2e test filename ${JSON.stringify(stem)}`
|
|
@@ -37750,13 +37913,13 @@ async function exportFailureArtifacts(report, outputDir, flowPath, ctx) {
|
|
|
37750
37913
|
if (dir === null) {
|
|
37751
37914
|
const dirName = await claimExportDirName(outputDir, flowPath, stem);
|
|
37752
37915
|
if (dirName === null) return;
|
|
37753
|
-
dir =
|
|
37916
|
+
dir = path19.join(outputDir, dirName);
|
|
37754
37917
|
}
|
|
37755
|
-
const dest =
|
|
37756
|
-
const rel =
|
|
37757
|
-
if (rel.startsWith("..") ||
|
|
37918
|
+
const dest = path19.join(dir, fileName(role));
|
|
37919
|
+
const rel = path19.relative(outputDir, dest);
|
|
37920
|
+
if (rel.startsWith("..") || path19.isAbsolute(rel)) continue;
|
|
37758
37921
|
try {
|
|
37759
|
-
await
|
|
37922
|
+
await fsp2.copyFile(value, dest);
|
|
37760
37923
|
s.artifacts[role] = dest;
|
|
37761
37924
|
} catch (err) {
|
|
37762
37925
|
console.error(
|
|
@@ -37769,7 +37932,7 @@ async function exportFailureArtifacts(report, outputDir, flowPath, ctx) {
|
|
|
37769
37932
|
function keyFromBaselinePath(artifacts) {
|
|
37770
37933
|
const baseline = artifacts.baseline;
|
|
37771
37934
|
if (typeof baseline !== "string") return null;
|
|
37772
|
-
return
|
|
37935
|
+
return path19.basename(baseline).replace(/\.png$/, "");
|
|
37773
37936
|
}
|
|
37774
37937
|
function resolveArtifactDisplayPaths(report) {
|
|
37775
37938
|
for (const s of report.steps) {
|
|
@@ -37814,9 +37977,9 @@ ${renderSummary(report)}`);
|
|
|
37814
37977
|
}
|
|
37815
37978
|
async function isRunnableFlowFile(filePath) {
|
|
37816
37979
|
try {
|
|
37817
|
-
const stat7 = await
|
|
37980
|
+
const stat7 = await fsp2.stat(filePath);
|
|
37818
37981
|
if (!stat7.isFile()) return false;
|
|
37819
|
-
await
|
|
37982
|
+
await fsp2.access(filePath, fsConstants2.R_OK);
|
|
37820
37983
|
return true;
|
|
37821
37984
|
} catch {
|
|
37822
37985
|
return false;
|
|
@@ -37829,7 +37992,7 @@ var E2E_FILE_WARNING_TEXT = {
|
|
|
37829
37992
|
async function checkE2eTestShape(filePath) {
|
|
37830
37993
|
let content;
|
|
37831
37994
|
try {
|
|
37832
|
-
content = (await
|
|
37995
|
+
content = (await fsp2.readFile(filePath, "utf8")).trim();
|
|
37833
37996
|
} catch {
|
|
37834
37997
|
return "ok";
|
|
37835
37998
|
}
|
|
@@ -37837,7 +38000,7 @@ async function checkE2eTestShape(filePath) {
|
|
|
37837
38000
|
if (!content.includes("steps") && !/^version:/m.test(content)) return "skip";
|
|
37838
38001
|
let parsed;
|
|
37839
38002
|
try {
|
|
37840
|
-
parsed = (0,
|
|
38003
|
+
parsed = (0, import_yaml4.parse)(content, { logLevel: "error" });
|
|
37841
38004
|
} catch {
|
|
37842
38005
|
return "syntax-error";
|
|
37843
38006
|
}
|
|
@@ -37849,26 +38012,26 @@ async function resolveFlowRef(ref, projectRoot) {
|
|
|
37849
38012
|
if (!SAFE_FLOW_NAME.test(ref)) return { suppliedPath: ref, fromName: false };
|
|
37850
38013
|
const picked = await resolveE2eFile(projectRoot, ref);
|
|
37851
38014
|
return {
|
|
37852
|
-
suppliedPath:
|
|
38015
|
+
suppliedPath: path19.relative(projectRoot, picked.path),
|
|
37853
38016
|
fromName: true,
|
|
37854
|
-
...picked.shadowed === void 0 ? {} : { shadowed:
|
|
38017
|
+
...picked.shadowed === void 0 ? {} : { shadowed: path19.relative(projectRoot, picked.shadowed) }
|
|
37855
38018
|
};
|
|
37856
38019
|
}
|
|
37857
38020
|
async function savedFlowHint(projectRoot, missingPath) {
|
|
37858
|
-
const dirs = E2E_DIRS.map((rel) => ({ rel, abs:
|
|
38021
|
+
const dirs = E2E_DIRS.map((rel) => ({ rel, abs: path19.resolve(projectRoot, rel) }));
|
|
37859
38022
|
for (const { abs } of dirs) {
|
|
37860
|
-
const within =
|
|
37861
|
-
if (!within.startsWith("..") && !
|
|
38023
|
+
const within = path19.relative(abs, missingPath);
|
|
38024
|
+
if (!within.startsWith("..") && !path19.isAbsolute(within)) return "";
|
|
37862
38025
|
}
|
|
37863
|
-
const wanted = `${
|
|
38026
|
+
const wanted = `${path19.basename(missingPath, ".yaml")}.yaml`;
|
|
37864
38027
|
for (const { rel, abs } of dirs) {
|
|
37865
|
-
const entries = await
|
|
38028
|
+
const entries = await fsp2.readdir(abs).catch(() => null);
|
|
37866
38029
|
if (entries === null) continue;
|
|
37867
38030
|
const actual = entries.includes(wanted) ? wanted : entries.find((name2) => name2.toLowerCase() === wanted.toLowerCase());
|
|
37868
38031
|
if (actual === void 0) continue;
|
|
37869
|
-
const name =
|
|
38032
|
+
const name = path19.basename(actual, ".yaml");
|
|
37870
38033
|
if (!SAFE_FLOW_NAME.test(name)) return "";
|
|
37871
|
-
if (!await isRunnableFlowFile(
|
|
38034
|
+
if (!await isRunnableFlowFile(path19.join(abs, actual))) return "";
|
|
37872
38035
|
return `
|
|
37873
38036
|
An e2e test named "${name}" is saved under ${rel} \u2014 did you mean: argent e2e run ${name}`;
|
|
37874
38037
|
}
|
|
@@ -37876,19 +38039,24 @@ An e2e test named "${name}" is saved under ${rel} \u2014 did you mean: argent e2
|
|
|
37876
38039
|
}
|
|
37877
38040
|
async function collectFlowFiles(dir, recursive2) {
|
|
37878
38041
|
const found = [];
|
|
38042
|
+
const manifests = [];
|
|
37879
38043
|
const walk = async (current, rel) => {
|
|
37880
|
-
for (const entry of await
|
|
37881
|
-
const entryRel = rel ?
|
|
38044
|
+
for (const entry of await fsp2.readdir(current, { withFileTypes: true })) {
|
|
38045
|
+
const entryRel = rel ? path19.join(rel, entry.name) : entry.name;
|
|
37882
38046
|
if (entry.isDirectory()) {
|
|
37883
38047
|
if (recursive2 && entry.name !== "__baselines__" && entry.name !== "node_modules" && (entry.name === ".argent" || !entry.name.startsWith("."))) {
|
|
37884
|
-
await walk(
|
|
38048
|
+
await walk(path19.join(current, entry.name), entryRel).catch(() => {
|
|
37885
38049
|
});
|
|
37886
38050
|
}
|
|
37887
38051
|
continue;
|
|
37888
38052
|
}
|
|
38053
|
+
if (entry.name === SUITE_CONFIG_FILE) {
|
|
38054
|
+
manifests.push(entryRel);
|
|
38055
|
+
continue;
|
|
38056
|
+
}
|
|
37889
38057
|
if (!entry.name.endsWith(".yaml")) continue;
|
|
37890
|
-
if (!SAFE_FLOW_NAME.test(
|
|
37891
|
-
const filePath =
|
|
38058
|
+
if (!SAFE_FLOW_NAME.test(path19.basename(entry.name, ".yaml"))) continue;
|
|
38059
|
+
const filePath = path19.join(current, entry.name);
|
|
37892
38060
|
if (!await isRunnableFlowFile(filePath)) continue;
|
|
37893
38061
|
const shape = await checkE2eTestShape(filePath);
|
|
37894
38062
|
if (shape === "skip") continue;
|
|
@@ -37896,7 +38064,10 @@ async function collectFlowFiles(dir, recursive2) {
|
|
|
37896
38064
|
}
|
|
37897
38065
|
};
|
|
37898
38066
|
await walk(dir, "");
|
|
37899
|
-
return
|
|
38067
|
+
return {
|
|
38068
|
+
files: found.sort((a2, b) => a2.path < b.path ? -1 : a2.path > b.path ? 1 : 0),
|
|
38069
|
+
manifests: manifests.sort()
|
|
38070
|
+
};
|
|
37900
38071
|
}
|
|
37901
38072
|
var RUN_TOOL_ID = "e2e-execute";
|
|
37902
38073
|
function buildRunPayload(flowPath, projectRoot, args) {
|
|
@@ -38019,6 +38190,10 @@ function unwrittenBaselines(report) {
|
|
|
38019
38190
|
return typeof file2 === "string" && typeof error63 === "string" ? [`${file2}: ${error63}`] : [];
|
|
38020
38191
|
});
|
|
38021
38192
|
}
|
|
38193
|
+
var INVALID_SUITE_SIGNAL = {
|
|
38194
|
+
error_code: FAILURE_CODES.FLOW_FILE_INVALID,
|
|
38195
|
+
error_kind: "validation"
|
|
38196
|
+
};
|
|
38022
38197
|
async function runFlowDirectory(dir, args, projectRoot, options) {
|
|
38023
38198
|
const printError = (message, err = message) => {
|
|
38024
38199
|
console.error(args.json ? JSON.stringify(errorRecord(err, message)) : message);
|
|
@@ -38027,32 +38202,91 @@ async function runFlowDirectory(dir, args, projectRoot, options) {
|
|
|
38027
38202
|
printError(message);
|
|
38028
38203
|
return exitAfterFlush(2);
|
|
38029
38204
|
};
|
|
38030
|
-
let
|
|
38205
|
+
let found;
|
|
38031
38206
|
try {
|
|
38032
|
-
|
|
38207
|
+
found = await collectFlowFiles(dir, args.recursive);
|
|
38033
38208
|
} catch {
|
|
38034
38209
|
return reject(`Could not read e2e test directory: ${dir}`);
|
|
38035
38210
|
}
|
|
38036
|
-
|
|
38211
|
+
const plan = await planDirectoryRun(
|
|
38212
|
+
dir,
|
|
38213
|
+
found.files.map((file2) => file2.path),
|
|
38214
|
+
found.manifests
|
|
38215
|
+
);
|
|
38216
|
+
if (plan.entries.length === 0) {
|
|
38037
38217
|
return reject(
|
|
38038
38218
|
`No e2e tests found in ${dir}` + (args.recursive ? "" : "\nPass -r/--recursive to include subdirectories.")
|
|
38039
38219
|
);
|
|
38040
38220
|
}
|
|
38221
|
+
printWarnings(
|
|
38222
|
+
plan.unlisted.map((file2) => unlistedWarning(file2.path, file2.suite.manifest)),
|
|
38223
|
+
args.json
|
|
38224
|
+
);
|
|
38225
|
+
const runOrder = plan.entries.flatMap(
|
|
38226
|
+
(entry) => entry.kind === "test" ? [entry] : [
|
|
38227
|
+
entry,
|
|
38228
|
+
...entry.tests.map((rel) => ({
|
|
38229
|
+
kind: "test",
|
|
38230
|
+
path: rel,
|
|
38231
|
+
invalidManifest: entry.manifest
|
|
38232
|
+
}))
|
|
38233
|
+
]
|
|
38234
|
+
);
|
|
38041
38235
|
const { callTool, baseUrl } = runToolsClient(args, options);
|
|
38042
|
-
const outputBase = args.output ?
|
|
38236
|
+
const outputBase = args.output ? path19.resolve(args.output) : void 0;
|
|
38043
38237
|
const results = [];
|
|
38044
38238
|
const failures = [];
|
|
38045
38239
|
const batchStartedAt = Date.now();
|
|
38240
|
+
const failedInSuite = /* @__PURE__ */ new Map();
|
|
38241
|
+
const recordRun = (result, suite) => {
|
|
38242
|
+
results.push(result);
|
|
38243
|
+
if (result.status === "fail" && suite && !suite.continueOnFailure) {
|
|
38244
|
+
failedInSuite.set(suite, result.path);
|
|
38245
|
+
}
|
|
38246
|
+
};
|
|
38247
|
+
const skip = (rel, outcome, reason) => {
|
|
38248
|
+
results.push({ path: rel, status: "skip", ...reason !== void 0 && { reason } });
|
|
38249
|
+
if (!args.json) {
|
|
38250
|
+
console.log(
|
|
38251
|
+
` ${STATUS_GLYPH.skip} ${outcome}${reason === void 0 ? "" : `
|
|
38252
|
+
${reason}`}`
|
|
38253
|
+
);
|
|
38254
|
+
}
|
|
38255
|
+
};
|
|
38046
38256
|
let stopped = false;
|
|
38047
38257
|
let unreachable = false;
|
|
38048
|
-
for (const [i2,
|
|
38049
|
-
|
|
38258
|
+
for (const [i2, entry] of runOrder.entries()) {
|
|
38259
|
+
const rel = entry.kind === "test" ? entry.path : entry.manifest;
|
|
38260
|
+
if (!args.json) console.log(`[${i2 + 1}/${runOrder.length}] ${rel}`);
|
|
38261
|
+
if (entry.kind === "invalid-suite") {
|
|
38262
|
+
const verdict = "not run (invalid suite config)";
|
|
38263
|
+
if (!args.json) console.log(` ${STATUS_GLYPH.error} ${verdict}`);
|
|
38264
|
+
console.error(
|
|
38265
|
+
args.json ? JSON.stringify({ event: "error", error: entry.message, ...INVALID_SUITE_SIGNAL }) : entry.message
|
|
38266
|
+
);
|
|
38267
|
+
results.push({ path: rel, status: "fail", error: entry.message, ...INVALID_SUITE_SIGNAL });
|
|
38268
|
+
failures.push({
|
|
38269
|
+
path: rel,
|
|
38270
|
+
headline: verdict,
|
|
38271
|
+
detail: entry.message,
|
|
38272
|
+
rerun: rerunCommand(path19.join(dir, entry.dir), rel, projectRoot, args)
|
|
38273
|
+
});
|
|
38274
|
+
continue;
|
|
38275
|
+
}
|
|
38050
38276
|
if (stopped) {
|
|
38051
|
-
|
|
38052
|
-
|
|
38277
|
+
skip(rel, "not run (batch stopped)");
|
|
38278
|
+
continue;
|
|
38279
|
+
}
|
|
38280
|
+
if (entry.invalidManifest !== void 0) {
|
|
38281
|
+
skip(rel, "skipped (invalid suite config)", `invalid suite config: ${entry.invalidManifest}`);
|
|
38282
|
+
continue;
|
|
38283
|
+
}
|
|
38284
|
+
const failedEarlier = entry.suite && failedInSuite.get(entry.suite);
|
|
38285
|
+
if (failedEarlier !== void 0) {
|
|
38286
|
+
skip(rel, "skipped (earlier test failed)", `earlier test failed: ${failedEarlier}`);
|
|
38053
38287
|
continue;
|
|
38054
38288
|
}
|
|
38055
|
-
const flowPath =
|
|
38289
|
+
const flowPath = path19.join(dir, rel);
|
|
38056
38290
|
const rerun = rerunCommand(flowPath, rel, projectRoot, args);
|
|
38057
38291
|
let report;
|
|
38058
38292
|
try {
|
|
@@ -38064,18 +38298,14 @@ async function runFlowDirectory(dir, args, projectRoot, options) {
|
|
|
38064
38298
|
const message = err instanceof Error ? err.message : String(err);
|
|
38065
38299
|
const toolErr = err instanceof ToolInvocationError ? err : void 0;
|
|
38066
38300
|
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}`);
|
|
38301
|
+
skip(rel, "skipped (requires not met)", message.replace(/^\[Tool:[^\]]+\] /, ""));
|
|
38072
38302
|
continue;
|
|
38073
38303
|
}
|
|
38074
38304
|
const rejectedThisFlowOnly = toolErr?.errorKind === "validation";
|
|
38075
38305
|
const verdict = unreachableErr ? UNREACHABLE_VERDICT : rejectedThisFlowOnly ? rejectionVerdict(toolErr?.errorCode) : "did not finish (run error)";
|
|
38076
38306
|
if (!args.json) console.log(` ${STATUS_GLYPH.error} ${verdict}`);
|
|
38077
38307
|
printError(message, err);
|
|
38078
|
-
|
|
38308
|
+
recordRun({ path: rel, status: "fail", error: message, ...failureSignal2(err) }, entry.suite);
|
|
38079
38309
|
failures.push({ path: rel, headline: verdict, detail: message, rerun });
|
|
38080
38310
|
if (!rejectedThisFlowOnly) stopped = true;
|
|
38081
38311
|
if (unreachableErr) unreachable = true;
|
|
@@ -38086,7 +38316,7 @@ async function runFlowDirectory(dir, args, projectRoot, options) {
|
|
|
38086
38316
|
const verdict = "did not finish (no run report)";
|
|
38087
38317
|
if (!args.json) console.log(` ${STATUS_GLYPH.error} ${verdict}`);
|
|
38088
38318
|
printError(message);
|
|
38089
|
-
|
|
38319
|
+
recordRun({ path: rel, status: "fail", error: message }, entry.suite);
|
|
38090
38320
|
failures.push({ path: rel, headline: verdict, detail: message, rerun });
|
|
38091
38321
|
stopped = true;
|
|
38092
38322
|
continue;
|
|
@@ -38094,11 +38324,11 @@ async function runFlowDirectory(dir, args, projectRoot, options) {
|
|
|
38094
38324
|
printWarnings(nestedStepWarnings(report.steps), args.json);
|
|
38095
38325
|
await exportAndResolveArtifacts(
|
|
38096
38326
|
report,
|
|
38097
|
-
outputBase ?
|
|
38327
|
+
outputBase ? path19.join(outputBase, path19.dirname(rel)) : void 0,
|
|
38098
38328
|
flowPath,
|
|
38099
38329
|
baseUrl
|
|
38100
38330
|
);
|
|
38101
|
-
|
|
38331
|
+
recordRun({ path: rel, status: report.ok ? "pass" : "fail", report }, entry.suite);
|
|
38102
38332
|
if (!report.ok) failures.push({ path: rel, ...summarizeFailure(report), rerun });
|
|
38103
38333
|
if (!args.json) {
|
|
38104
38334
|
for (const line of renderFailedSteps(report)) console.log(line);
|
|
@@ -38183,14 +38413,14 @@ Run \`argent e2e --help\`.`
|
|
|
38183
38413
|
Pass the fully resolved path to the directory.`
|
|
38184
38414
|
);
|
|
38185
38415
|
}
|
|
38186
|
-
const
|
|
38416
|
+
const rows = [];
|
|
38187
38417
|
const byName = /* @__PURE__ */ new Map();
|
|
38188
38418
|
let anyDir = false;
|
|
38189
38419
|
const dirs = listDir === void 0 ? E2E_DIRS : [listDir];
|
|
38190
38420
|
for (const dir of dirs) {
|
|
38191
|
-
let
|
|
38421
|
+
let found;
|
|
38192
38422
|
try {
|
|
38193
|
-
|
|
38423
|
+
found = await collectFlowFiles(path19.resolve(dir), listDir === void 0 || recursive2);
|
|
38194
38424
|
} catch (err) {
|
|
38195
38425
|
const code = err.code;
|
|
38196
38426
|
if (listDir === void 0 && (code === "ENOENT" || code === "ENOTDIR")) continue;
|
|
@@ -38199,49 +38429,99 @@ Pass the fully resolved path to the directory.`
|
|
|
38199
38429
|
);
|
|
38200
38430
|
}
|
|
38201
38431
|
anyDir = true;
|
|
38202
|
-
|
|
38203
|
-
|
|
38204
|
-
|
|
38432
|
+
const fileWarnings = new Map(found.files.map((file2) => [file2.path, file2.warning]));
|
|
38433
|
+
const plan = await planDirectoryRun(
|
|
38434
|
+
path19.resolve(dir),
|
|
38435
|
+
found.files.map((file2) => file2.path),
|
|
38436
|
+
found.manifests
|
|
38437
|
+
);
|
|
38438
|
+
const show = (rel) => optionSafePath(path19.join(dir, rel));
|
|
38439
|
+
const add = (rel, inSuite, notRun) => {
|
|
38440
|
+
const shown = show(rel);
|
|
38441
|
+
const fileWarning = fileWarnings.get(rel);
|
|
38442
|
+
const warning = notRun?.warning ?? fileWarning;
|
|
38443
|
+
let entry;
|
|
38205
38444
|
if (listDir !== void 0) {
|
|
38206
|
-
|
|
38445
|
+
entry = { path: shown };
|
|
38446
|
+
} else {
|
|
38447
|
+
const name = path19.dirname(rel) === "." ? path19.basename(rel, ".yaml") : void 0;
|
|
38448
|
+
const shadowedBy = name === void 0 ? void 0 : byName.get(name);
|
|
38449
|
+
if (name !== void 0 && shadowedBy === void 0) byName.set(name, shown);
|
|
38450
|
+
entry = {
|
|
38451
|
+
path: shown,
|
|
38452
|
+
...name !== void 0 && { name },
|
|
38453
|
+
legacy: dir !== E2E_DIR,
|
|
38454
|
+
...shadowedBy !== void 0 && { shadowedBy }
|
|
38455
|
+
};
|
|
38456
|
+
}
|
|
38457
|
+
if (inSuite) entry.suite = optionSafePath(path19.dirname(path19.join(dir, rel)));
|
|
38458
|
+
if (warning !== void 0) entry.warning = warning;
|
|
38459
|
+
const notes = notRun?.notes ?? [
|
|
38460
|
+
...entry.shadowedBy === void 0 ? [] : [`warning: ${shown} is shadowed by ${entry.shadowedBy} when run by name`],
|
|
38461
|
+
...fileWarning === void 0 ? [] : [`warning: ${shown} ${E2E_FILE_WARNING_TEXT[fileWarning]}`]
|
|
38462
|
+
];
|
|
38463
|
+
rows.push({ entry, listed: notRun === void 0, notes });
|
|
38464
|
+
};
|
|
38465
|
+
for (const [i2, entry] of plan.entries.entries()) {
|
|
38466
|
+
if (entry.kind === "invalid-suite") {
|
|
38467
|
+
const manifest = show(entry.manifest);
|
|
38468
|
+
if (entry.tests.length === 0) {
|
|
38469
|
+
rows.push({
|
|
38470
|
+
entry: {
|
|
38471
|
+
path: manifest,
|
|
38472
|
+
...listDir === void 0 && { legacy: dir !== E2E_DIR },
|
|
38473
|
+
suite: show(entry.dir),
|
|
38474
|
+
warning: "invalid-suite-config"
|
|
38475
|
+
},
|
|
38476
|
+
listed: false,
|
|
38477
|
+
notes: [`warning: ${manifest}: ${entry.error}`]
|
|
38478
|
+
});
|
|
38479
|
+
}
|
|
38480
|
+
for (const [j, rel] of entry.tests.entries()) {
|
|
38481
|
+
add(rel, true, {
|
|
38482
|
+
warning: "invalid-suite-config",
|
|
38483
|
+
notes: [
|
|
38484
|
+
...j === 0 ? [`warning: ${manifest}: ${entry.error}`] : [],
|
|
38485
|
+
` not listed: ${show(rel)}`
|
|
38486
|
+
]
|
|
38487
|
+
});
|
|
38488
|
+
}
|
|
38207
38489
|
continue;
|
|
38208
38490
|
}
|
|
38209
|
-
|
|
38210
|
-
const
|
|
38211
|
-
if (
|
|
38212
|
-
|
|
38213
|
-
|
|
38214
|
-
|
|
38215
|
-
|
|
38216
|
-
|
|
38217
|
-
|
|
38218
|
-
|
|
38491
|
+
add(entry.path, entry.suite !== void 0);
|
|
38492
|
+
const next = plan.entries[i2 + 1];
|
|
38493
|
+
if (entry.suite === void 0 || next?.kind === "test" && next.suite === entry.suite) {
|
|
38494
|
+
continue;
|
|
38495
|
+
}
|
|
38496
|
+
for (const file2 of plan.unlisted.filter((f) => f.suite === entry.suite)) {
|
|
38497
|
+
add(file2.path, true, {
|
|
38498
|
+
warning: "not-in-suite",
|
|
38499
|
+
notes: [`warning: ${unlistedWarning(show(file2.path), show(file2.suite.manifest))}`]
|
|
38500
|
+
});
|
|
38501
|
+
}
|
|
38219
38502
|
}
|
|
38220
38503
|
}
|
|
38221
38504
|
if (json3) {
|
|
38222
|
-
const doc = {
|
|
38505
|
+
const doc = {
|
|
38506
|
+
e2eTests: rows.map((row) => row.entry),
|
|
38507
|
+
...!anyDir && { warning: "no-e2e-directory" }
|
|
38508
|
+
};
|
|
38223
38509
|
console.log(JSON.stringify(doc, null, 2));
|
|
38224
38510
|
return;
|
|
38225
38511
|
}
|
|
38512
|
+
const listed = rows.filter((row) => row.listed).map((row) => row.entry);
|
|
38226
38513
|
if (!anyDir) {
|
|
38227
38514
|
console.error(
|
|
38228
38515
|
`warning: no ${E2E_DIRS.join(" or ")} directory in the current working directory`
|
|
38229
38516
|
);
|
|
38230
|
-
} else if (
|
|
38517
|
+
} else if (rows.length === 0) {
|
|
38231
38518
|
console.error(
|
|
38232
38519
|
`No e2e tests found in ${listDir ?? E2E_DIRS.join(" or ")}` + (listDir === void 0 || recursive2 ? "" : "\nPass -r/--recursive to include subdirectories.")
|
|
38233
38520
|
);
|
|
38234
38521
|
} 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;
|
|
38522
|
+
if (listed.length > 0) console.log(listed.map((entry) => entry.path).join("\n"));
|
|
38523
|
+
for (const note of rows.flatMap((row) => row.notes)) console.error(note);
|
|
38524
|
+
const legacyCount = listed.filter((entry) => entry.legacy).length;
|
|
38245
38525
|
if (legacyCount > 0) {
|
|
38246
38526
|
console.error(
|
|
38247
38527
|
`note: ${legacyCount} test${legacyCount === 1 ? "" : "s"} listed from .argent/flows (legacy); move ${legacyCount === 1 ? "it" : "them"} to .argent/e2e`
|
|
@@ -38296,11 +38576,11 @@ Pass the fully resolved path to the directory.`
|
|
|
38296
38576
|
}
|
|
38297
38577
|
if (suppliedPath.split(/[\\/]+/).includes("..")) {
|
|
38298
38578
|
let recovery = "Pass the fully resolved path to the e2e test's YAML.";
|
|
38299
|
-
const suppliedBase2 =
|
|
38579
|
+
const suppliedBase2 = path19.basename(suppliedPath);
|
|
38300
38580
|
if (suppliedBase2 !== ".." && suppliedBase2 !== ".") {
|
|
38301
38581
|
try {
|
|
38302
|
-
const resolved =
|
|
38303
|
-
await
|
|
38582
|
+
const resolved = path19.join(await fsp2.realpath(path19.dirname(suppliedPath)), suppliedBase2);
|
|
38583
|
+
await fsp2.stat(resolved);
|
|
38304
38584
|
recovery = `Did you mean: argent e2e run ${shellQuoteArg(resolved)}`;
|
|
38305
38585
|
} catch {
|
|
38306
38586
|
}
|
|
@@ -38311,10 +38591,10 @@ Pass the fully resolved path to the directory.`
|
|
|
38311
38591
|
2
|
|
38312
38592
|
);
|
|
38313
38593
|
}
|
|
38314
|
-
const resolvedPath =
|
|
38594
|
+
const resolvedPath = path19.resolve(projectRoot, suppliedPath);
|
|
38315
38595
|
let isDirectory = false;
|
|
38316
38596
|
try {
|
|
38317
|
-
isDirectory = (await
|
|
38597
|
+
isDirectory = (await fsp2.stat(resolvedPath)).isDirectory();
|
|
38318
38598
|
} catch {
|
|
38319
38599
|
if (args.recursive && !fromName) {
|
|
38320
38600
|
return fail(`E2E test directory not found: ${resolvedPath}`, 2);
|
|
@@ -38334,16 +38614,16 @@ Pass the fully resolved path to the directory.`
|
|
|
38334
38614
|
}
|
|
38335
38615
|
const separatorTrimmedPath = suppliedPath.replace(/[\\/]+$/, "");
|
|
38336
38616
|
if (separatorTrimmedPath !== suppliedPath && separatorTrimmedPath !== "") {
|
|
38337
|
-
const hint = SAFE_FLOW_NAME.test(separatorTrimmedPath) ? `.${
|
|
38617
|
+
const hint = SAFE_FLOW_NAME.test(separatorTrimmedPath) ? `.${path19.sep}${separatorTrimmedPath}` : separatorTrimmedPath;
|
|
38338
38618
|
return fail(
|
|
38339
38619
|
`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
38620
|
Did you mean: argent e2e run ${shellQuoteArg(hint)}`,
|
|
38341
38621
|
2
|
|
38342
38622
|
);
|
|
38343
38623
|
}
|
|
38344
|
-
if (
|
|
38345
|
-
const looksLikeName = !suppliedPath.includes("/") && !suppliedPath.includes("\\") &&
|
|
38346
|
-
if (
|
|
38624
|
+
if (path19.extname(suppliedPath) !== ".yaml") {
|
|
38625
|
+
const looksLikeName = !suppliedPath.includes("/") && !suppliedPath.includes("\\") && path19.extname(suppliedPath) === "";
|
|
38626
|
+
if (path19.basename(suppliedPath).toLowerCase() === ".yaml") {
|
|
38347
38627
|
return fail(
|
|
38348
38628
|
`E2E test filename must have a non-empty name containing only letters, numbers, "_", or "-": ${suppliedPath}`,
|
|
38349
38629
|
2
|
|
@@ -38356,15 +38636,15 @@ Names run \`${E2E_DIRS.map((dir) => `${dir}/<name>.yaml`).join("` or `")}\`; pas
|
|
|
38356
38636
|
2
|
|
38357
38637
|
);
|
|
38358
38638
|
}
|
|
38359
|
-
if (
|
|
38639
|
+
if (path19.extname(suppliedPath).toLowerCase() === ".yaml") {
|
|
38360
38640
|
return fail(
|
|
38361
|
-
`E2E test extension must be lowercase .yaml, not ${
|
|
38641
|
+
`E2E test extension must be lowercase .yaml, not ${path19.extname(suppliedPath)}: ${suppliedPath}`,
|
|
38362
38642
|
2
|
|
38363
38643
|
);
|
|
38364
38644
|
}
|
|
38365
38645
|
return fail(`E2E test path must end in .yaml: ${suppliedPath}`, 2);
|
|
38366
38646
|
}
|
|
38367
|
-
const flowName =
|
|
38647
|
+
const flowName = path19.basename(suppliedPath, ".yaml");
|
|
38368
38648
|
if (!SAFE_FLOW_NAME.test(flowName)) {
|
|
38369
38649
|
return fail(
|
|
38370
38650
|
`E2E test filename must have a non-empty name containing only letters, numbers, "_", or "-": ${suppliedPath}`,
|
|
@@ -38373,11 +38653,11 @@ Names run \`${E2E_DIRS.map((dir) => `${dir}/<name>.yaml`).join("` or `")}\`; pas
|
|
|
38373
38653
|
}
|
|
38374
38654
|
const flowPath = resolvedPath;
|
|
38375
38655
|
try {
|
|
38376
|
-
const stat7 = await
|
|
38656
|
+
const stat7 = await fsp2.stat(flowPath);
|
|
38377
38657
|
if (!stat7.isFile()) {
|
|
38378
38658
|
return fail(`E2E test path is not a file: ${flowPath}`, 2);
|
|
38379
38659
|
}
|
|
38380
|
-
await
|
|
38660
|
+
await fsp2.access(flowPath, fsConstants2.R_OK);
|
|
38381
38661
|
} catch (err) {
|
|
38382
38662
|
const code = err.code;
|
|
38383
38663
|
const detail = code === "ENOENT" ? "E2E test file not found" : "Could not read e2e test file";
|
|
@@ -38388,12 +38668,12 @@ No e2e test named "${args.flowRef}" is saved in ${E2E_DIRS.join(" or ")} \u2014
|
|
|
38388
38668
|
}
|
|
38389
38669
|
return fail(`${detail}: ${flowPath}${recovery}`, 2);
|
|
38390
38670
|
}
|
|
38391
|
-
const suppliedBase =
|
|
38392
|
-
const siblings = await
|
|
38671
|
+
const suppliedBase = path19.basename(flowPath);
|
|
38672
|
+
const siblings = await fsp2.readdir(path19.dirname(flowPath)).catch(() => null);
|
|
38393
38673
|
if (siblings !== null && !siblings.includes(suppliedBase)) {
|
|
38394
38674
|
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 ${
|
|
38675
|
+
const actualRunnable = actual !== void 0 && path19.extname(actual) === ".yaml" && SAFE_FLOW_NAME.test(path19.basename(actual, ".yaml"));
|
|
38676
|
+
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
38677
|
return fail(
|
|
38398
38678
|
`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
38679
|
${recovery}`,
|
|
@@ -38452,7 +38732,7 @@ ${recovery}`,
|
|
|
38452
38732
|
try {
|
|
38453
38733
|
await exportAndResolveArtifacts(
|
|
38454
38734
|
report,
|
|
38455
|
-
args.output ?
|
|
38735
|
+
args.output ? path19.resolve(args.output) : void 0,
|
|
38456
38736
|
flowPath,
|
|
38457
38737
|
baseUrl
|
|
38458
38738
|
);
|
|
@@ -38541,7 +38821,7 @@ async function fetchImageToFile(result, outPath) {
|
|
|
38541
38821
|
const res = await fetch(url2);
|
|
38542
38822
|
if (!res.ok) throw new Error(`Failed to download image: ${res.status} ${res.statusText}`);
|
|
38543
38823
|
const buf = Buffer.from(await res.arrayBuffer());
|
|
38544
|
-
fs13.mkdirSync(
|
|
38824
|
+
fs13.mkdirSync(path20.dirname(path20.resolve(outPath)), { recursive: true });
|
|
38545
38825
|
fs13.writeFileSync(outPath, buf);
|
|
38546
38826
|
}
|
|
38547
38827
|
function renderResult(result, outputHint, images, json2) {
|
|
@@ -38749,7 +39029,7 @@ settled=false or debugger-status's not_connected.
|
|
|
38749
39029
|
if (outPath && meta3.outputHint === "image") {
|
|
38750
39030
|
try {
|
|
38751
39031
|
if (images.length > 0) {
|
|
38752
|
-
fs13.mkdirSync(
|
|
39032
|
+
fs13.mkdirSync(path20.dirname(path20.resolve(outPath)), { recursive: true });
|
|
38753
39033
|
fs13.writeFileSync(outPath, images[0].data);
|
|
38754
39034
|
} else if (result && typeof result === "object") {
|
|
38755
39035
|
await fetchImageToFile(result, outPath);
|
|
@@ -38883,11 +39163,11 @@ Listing tools contacts the argent tool-server, starting one if none is running.
|
|
|
38883
39163
|
|
|
38884
39164
|
// ../argent-cli/src/server.ts
|
|
38885
39165
|
import * as fs14 from "node:fs";
|
|
38886
|
-
import * as
|
|
39166
|
+
import * as path21 from "node:path";
|
|
38887
39167
|
import { constants as constants2, homedir as homedir5, networkInterfaces } from "node:os";
|
|
38888
39168
|
import { spawn as spawn4 } from "node:child_process";
|
|
38889
|
-
var STATE_DIR2 =
|
|
38890
|
-
var LOG_FILE2 =
|
|
39169
|
+
var STATE_DIR2 = path21.join(homedir5(), ".argent");
|
|
39170
|
+
var LOG_FILE2 = path21.join(STATE_DIR2, "tool-server.log");
|
|
38891
39171
|
async function describeForeignServers(ownBundlePath) {
|
|
38892
39172
|
const others = (await readAllToolsServerStates()).filter(
|
|
38893
39173
|
({ state: state2 }) => state2.bundlePath !== ownBundlePath && isToolsServerProcessAlive(state2.pid)
|
|
@@ -39365,7 +39645,7 @@ async function server(argv, options) {
|
|
|
39365
39645
|
// ../argent-cli/src/lens.ts
|
|
39366
39646
|
import * as fs15 from "node:fs";
|
|
39367
39647
|
import * as os2 from "node:os";
|
|
39368
|
-
import * as
|
|
39648
|
+
import * as path22 from "node:path";
|
|
39369
39649
|
|
|
39370
39650
|
// ../argent-cli/src/lens-terminal.ts
|
|
39371
39651
|
import { execFileSync as execFileSync3 } from "node:child_process";
|
|
@@ -39583,15 +39863,15 @@ function isSessionAlive(session) {
|
|
|
39583
39863
|
// ../argent-cli/src/lens-pty.ts
|
|
39584
39864
|
import { chmodSync as chmodSync2, readdirSync as readdirSync2 } from "node:fs";
|
|
39585
39865
|
import { createRequire } from "node:module";
|
|
39586
|
-
import { dirname as
|
|
39866
|
+
import { dirname as dirname14, join as join20 } from "node:path";
|
|
39587
39867
|
var nodeRequire = createRequire(import.meta.url);
|
|
39588
39868
|
function ensureSpawnHelperExecutable(req = nodeRequire) {
|
|
39589
39869
|
if (process.platform !== "darwin") return;
|
|
39590
39870
|
try {
|
|
39591
|
-
const prebuilds =
|
|
39871
|
+
const prebuilds = join20(dirname14(req.resolve("node-pty/package.json")), "prebuilds");
|
|
39592
39872
|
for (const entry of readdirSync2(prebuilds)) {
|
|
39593
39873
|
try {
|
|
39594
|
-
chmodSync2(
|
|
39874
|
+
chmodSync2(join20(prebuilds, entry, "spawn-helper"), 493);
|
|
39595
39875
|
} catch {
|
|
39596
39876
|
}
|
|
39597
39877
|
}
|
|
@@ -40116,7 +40396,7 @@ async function lens(argv, options) {
|
|
|
40116
40396
|
await endSession(baseUrl);
|
|
40117
40397
|
process.exit(1);
|
|
40118
40398
|
}
|
|
40119
|
-
const seedFile =
|
|
40399
|
+
const seedFile = path22.join(os2.tmpdir(), `argent-lens-seed-${process.pid}-${Date.now()}.txt`);
|
|
40120
40400
|
fs15.writeFileSync(seedFile, buildSeedPrompt(), "utf8");
|
|
40121
40401
|
const launchCmd = agent.launch(shellQuote(process.cwd()), shellQuote(seedFile));
|
|
40122
40402
|
const removeSeedFile = () => {
|
|
@@ -40312,7 +40592,7 @@ async function endSession(baseUrl) {
|
|
|
40312
40592
|
|
|
40313
40593
|
// ../argent-cli/src/flags.ts
|
|
40314
40594
|
var import_picocolors2 = __toESM(require_picocolors(), 1);
|
|
40315
|
-
import * as
|
|
40595
|
+
import * as path24 from "node:path";
|
|
40316
40596
|
|
|
40317
40597
|
// ../argent-cli/src/secrets.ts
|
|
40318
40598
|
var import_picocolors = __toESM(require_picocolors(), 1);
|
|
@@ -40429,11 +40709,11 @@ async function linkedSecretsNote() {
|
|
|
40429
40709
|
}
|
|
40430
40710
|
|
|
40431
40711
|
// ../argent-cli/src/project-scope.ts
|
|
40432
|
-
import * as
|
|
40712
|
+
import * as path23 from "node:path";
|
|
40433
40713
|
function degenerateProjectScopeWarning(scope, file2) {
|
|
40434
40714
|
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 ${
|
|
40715
|
+
if (isHomeDir(path23.dirname(path23.dirname(file2)))) {
|
|
40716
|
+
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
40717
|
}
|
|
40438
40718
|
if (findProjectRoot(process.cwd()) === null) {
|
|
40439
40719
|
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 +40856,7 @@ Options:
|
|
|
40576
40856
|
console.error(`Error: ${err.message}`);
|
|
40577
40857
|
process.exit(2);
|
|
40578
40858
|
}
|
|
40579
|
-
const projectIsHome = isHomeDir(
|
|
40859
|
+
const projectIsHome = isHomeDir(path24.dirname(path24.dirname(getFlagsPath("project"))));
|
|
40580
40860
|
const projectFlags = projectIsHome ? {} : readFlags("project");
|
|
40581
40861
|
const globalFlags = readFlags("global");
|
|
40582
40862
|
const effective = {};
|
|
@@ -40639,7 +40919,7 @@ Options:
|
|
|
40639
40919
|
|
|
40640
40920
|
// ../argent-cli/src/config.ts
|
|
40641
40921
|
var import_picocolors3 = __toESM(require_picocolors(), 1);
|
|
40642
|
-
import * as
|
|
40922
|
+
import * as path25 from "node:path";
|
|
40643
40923
|
function config2(argv) {
|
|
40644
40924
|
if (argv.length === 0 || argv[0] === "--help" || argv[0] === "-h") {
|
|
40645
40925
|
printUsage2();
|
|
@@ -40819,10 +41099,10 @@ function wantsHelp(argv) {
|
|
|
40819
41099
|
}
|
|
40820
41100
|
function scopeLabel(scope) {
|
|
40821
41101
|
if (scope === "global") return "global";
|
|
40822
|
-
return `project: ${
|
|
41102
|
+
return `project: ${path25.dirname(configDir("project"))}`;
|
|
40823
41103
|
}
|
|
40824
41104
|
function projectConfigWarning(scope) {
|
|
40825
|
-
return degenerateProjectScopeWarning(scope,
|
|
41105
|
+
return degenerateProjectScopeWarning(scope, path25.join(configDir("project"), "config.json"));
|
|
40826
41106
|
}
|
|
40827
41107
|
function restartHint(key) {
|
|
40828
41108
|
if (key !== "android.adbServerPort") return null;
|
|
@@ -41648,7 +41928,7 @@ import { styleText as styleText2, stripVTControlCharacters } from "node:util";
|
|
|
41648
41928
|
import process$1 from "node:process";
|
|
41649
41929
|
var import_sisteransi2 = __toESM(require_src(), 1);
|
|
41650
41930
|
import { existsSync as existsSync7, lstatSync as lstatSync3, readdirSync as readdirSync3 } from "node:fs";
|
|
41651
|
-
import { dirname as
|
|
41931
|
+
import { dirname as dirname18, join as join23 } from "node:path";
|
|
41652
41932
|
function isUnicodeSupported() {
|
|
41653
41933
|
if (process$1.platform !== "win32") {
|
|
41654
41934
|
return process$1.env.TERM !== "linux";
|
|
@@ -42536,7 +42816,7 @@ async function unlink3(argv) {
|
|
|
42536
42816
|
|
|
42537
42817
|
// ../argent-cli/src/telemetry.ts
|
|
42538
42818
|
var import_picocolors5 = __toESM(require_picocolors(), 1);
|
|
42539
|
-
import * as
|
|
42819
|
+
import * as path26 from "node:path";
|
|
42540
42820
|
var SCOPES = ["global", "project"];
|
|
42541
42821
|
var SUBCOMMANDS = ["status", "enable", "disable"];
|
|
42542
42822
|
var TELEMETRY_OPTIONS = {
|
|
@@ -42625,7 +42905,7 @@ function describeSource(source) {
|
|
|
42625
42905
|
}
|
|
42626
42906
|
}
|
|
42627
42907
|
function projectConfigWarning2(scope) {
|
|
42628
|
-
return degenerateProjectScopeWarning(scope,
|
|
42908
|
+
return degenerateProjectScopeWarning(scope, path26.join(configDir("project"), "config.json"));
|
|
42629
42909
|
}
|
|
42630
42910
|
async function cmdEnable(scope) {
|
|
42631
42911
|
const warning = projectConfigWarning2(scope);
|
|
@@ -42662,7 +42942,7 @@ async function cmdDisable(scope) {
|
|
|
42662
42942
|
// ../argent-cli/src/providers.ts
|
|
42663
42943
|
var import_picocolors7 = __toESM(require_picocolors(), 1);
|
|
42664
42944
|
import * as fs19 from "node:fs";
|
|
42665
|
-
import * as
|
|
42945
|
+
import * as path29 from "node:path";
|
|
42666
42946
|
|
|
42667
42947
|
// ../device-providers/src/contract.ts
|
|
42668
42948
|
var PROVIDER_SCHEMA_VERSION = 1;
|
|
@@ -42809,7 +43089,7 @@ var providerEnvelopeSchema = providerRecordSchema.extend({
|
|
|
42809
43089
|
// ../device-providers/src/read.ts
|
|
42810
43090
|
import * as fs16 from "node:fs";
|
|
42811
43091
|
import * as os3 from "node:os";
|
|
42812
|
-
import * as
|
|
43092
|
+
import * as path27 from "node:path";
|
|
42813
43093
|
var DISABLE_ENV = "ARGENT_DISABLE_DEVICE_PROVIDERS";
|
|
42814
43094
|
var OVERRIDE_ENV = "ARGENT_DEVICE_PROVIDERS";
|
|
42815
43095
|
function resolveHomeDir2() {
|
|
@@ -42818,7 +43098,7 @@ function resolveHomeDir2() {
|
|
|
42818
43098
|
return trimmed ? raw : os3.homedir();
|
|
42819
43099
|
}
|
|
42820
43100
|
function providersDirectory() {
|
|
42821
|
-
return
|
|
43101
|
+
return path27.join(resolveHomeDir2(), ".argent", "providers");
|
|
42822
43102
|
}
|
|
42823
43103
|
function discoveryDisabled() {
|
|
42824
43104
|
const raw = process.env[DISABLE_ENV];
|
|
@@ -42884,7 +43164,7 @@ function discoverProviders() {
|
|
|
42884
43164
|
function descriptorFiles() {
|
|
42885
43165
|
const directory = providersDirectory();
|
|
42886
43166
|
try {
|
|
42887
|
-
return fs16.readdirSync(directory).filter((name) => name.endsWith(".json")).sort().map((name) =>
|
|
43167
|
+
return fs16.readdirSync(directory).filter((name) => name.endsWith(".json")).sort().map((name) => path27.join(directory, name));
|
|
42888
43168
|
} catch {
|
|
42889
43169
|
return [];
|
|
42890
43170
|
}
|
|
@@ -42892,7 +43172,7 @@ function descriptorFiles() {
|
|
|
42892
43172
|
|
|
42893
43173
|
// ../device-providers/src/write.ts
|
|
42894
43174
|
import * as fs17 from "node:fs";
|
|
42895
|
-
import * as
|
|
43175
|
+
import * as path28 from "node:path";
|
|
42896
43176
|
var ProviderValidationError = class extends Error {
|
|
42897
43177
|
/** One line per problem, `path: message`, in the order zod reported them. */
|
|
42898
43178
|
issues;
|
|
@@ -42944,7 +43224,7 @@ function publishProvider(record2, options = {}) {
|
|
|
42944
43224
|
);
|
|
42945
43225
|
}
|
|
42946
43226
|
const directory = providersDirectory();
|
|
42947
|
-
const file2 =
|
|
43227
|
+
const file2 = path28.join(directory, `${validated.id}.json`);
|
|
42948
43228
|
const body = JSON.stringify(canonicalize(candidate), null, 2) + "\n";
|
|
42949
43229
|
try {
|
|
42950
43230
|
if (fs17.readFileSync(file2, "utf8") === body) return { changed: false, path: file2 };
|
|
@@ -42968,7 +43248,7 @@ function withdrawProvider(id) {
|
|
|
42968
43248
|
if (!PROVIDER_ID_SHAPE.test(id)) {
|
|
42969
43249
|
throw new Error(`'${id}' is not a valid provider id (${String(PROVIDER_ID_SHAPE)}).`);
|
|
42970
43250
|
}
|
|
42971
|
-
const file2 =
|
|
43251
|
+
const file2 = path28.join(providersDirectory(), `${id}.json`);
|
|
42972
43252
|
try {
|
|
42973
43253
|
fs17.unlinkSync(file2);
|
|
42974
43254
|
return true;
|
|
@@ -43482,7 +43762,7 @@ function runWithdraw(args) {
|
|
|
43482
43762
|
throw new UsageError2(`'${id}' is not a valid provider id (${String(PROVIDER_ID_SHAPE)})`);
|
|
43483
43763
|
}
|
|
43484
43764
|
const removed = withdrawProvider(id);
|
|
43485
|
-
const file2 =
|
|
43765
|
+
const file2 = path29.join(providersDirectory(), `${id}.json`);
|
|
43486
43766
|
if (args.json) {
|
|
43487
43767
|
console.log(JSON.stringify({ ok: true, path: file2, removed }, null, 2));
|
|
43488
43768
|
return;
|