@swmansion/argent 0.29.1-next.9 → 0.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/README.md +2 -2
  2. package/bin/argent-android-devtools-0.3.0.apk +0 -0
  3. package/bin/darwin/ax-service +0 -0
  4. package/bin/darwin/simulator-server +0 -0
  5. package/bin/darwin/tvos-ax-service +0 -0
  6. package/bin/darwin/tvos-hid-daemon +0 -0
  7. package/bin/linux/simulator-server +0 -0
  8. package/bin/linux-arm64/simulator-server +0 -0
  9. package/bin/tcp/ax-service +0 -0
  10. package/bin/win32/simulator-server.exe +0 -0
  11. package/dist/cli-cmds.mjs +1186 -865
  12. package/dist/cli.js +3 -2
  13. package/dist/cli.js.map +1 -1
  14. package/dist/client.js +758 -517
  15. package/dist/flow-script-runner.mjs +1 -1
  16. package/dist/installer.mjs +1025 -832
  17. package/dist/mcp-server.mjs +826 -579
  18. package/dist/tool-args.generated.d.ts +53 -39
  19. package/dist/tool-server.cjs +5035 -2797
  20. package/dylibs/libArgentInjectionBootstrap.dylib +0 -0
  21. package/dylibs/libKeyboardPatch.dylib +0 -0
  22. package/dylibs/libNativeDevtoolsIos.dylib +0 -0
  23. package/dylibs/tcp/libArgentInjectionBootstrap.dylib +0 -0
  24. package/dylibs/tcp/libKeyboardPatch.dylib +0 -0
  25. package/dylibs/tcp/libNativeDevtoolsIos.dylib +0 -0
  26. package/dylibs/tvos/libArgentInjectionBootstrap.dylib +0 -0
  27. package/dylibs/tvos/libKeyboardPatch.dylib +0 -0
  28. package/dylibs/tvos/libNativeDevtoolsIos.dylib +0 -0
  29. package/package.json +7 -7
  30. package/rules/argent.md +10 -10
  31. package/skills/{argent-create-flow → argent-create-e2e}/SKILL.md +16 -16
  32. package/skills/{argent-create-flow/references/flow-yaml.md → argent-create-e2e/references/e2e-yaml.md} +33 -33
  33. package/skills/{argent-create-flow → argent-create-e2e}/references/live-authoring.md +62 -62
  34. package/skills/{argent-create-flow → argent-create-e2e}/references/reliability-and-recovery.md +18 -18
  35. package/skills/argent-device-interact/SKILL.md +10 -8
  36. package/skills/argent-device-interact/references/chromium.md +1 -1
  37. package/skills/argent-ios-device-interact/SKILL.md +1 -1
  38. package/skills/argent-metro-debugger/SKILL.md +1 -1
  39. package/skills/argent-native-profiler/SKILL.md +1 -1
  40. package/skills/{argent-qa-flows → argent-qa-e2e}/SKILL.md +23 -23
  41. package/skills/argent-react-native-optimization/SKILL.md +2 -2
  42. package/skills/argent-react-native-profiler/SKILL.md +3 -3
  43. package/skills/argent-screen-recording/SKILL.md +1 -1
  44. package/skills/argent-test-ui-flow/SKILL.md +4 -4
@@ -1189,322 +1189,395 @@ var init_esm = __esm({
1189
1189
  }
1190
1190
  });
1191
1191
 
1192
- // ../../node_modules/dotenv/lib/main.js
1193
- var require_main = __commonJS({
1194
- "../../node_modules/dotenv/lib/main.js"(exports, module) {
1195
- var fs20 = __require("fs");
1196
- var path26 = __require("path");
1197
- var os3 = __require("os");
1198
- var crypto3 = __require("crypto");
1199
- var TIPS = [
1200
- "\u25C8 encrypted .env [www.dotenvx.com]",
1201
- "\u25C8 secrets for agents [www.dotenvx.com]",
1202
- "\u2301 auth for agents [www.vestauth.com]",
1203
- "\u2318 custom filepath { path: '/custom/path/.env' }",
1204
- "\u2318 enable debugging { debug: true }",
1205
- "\u2318 override existing { override: true }",
1206
- "\u2318 suppress logs { quiet: true }",
1207
- "\u2318 multiple files { path: ['.env.local', '.env'] }"
1208
- ];
1209
- function _getRandomTip() {
1210
- return TIPS[Math.floor(Math.random() * TIPS.length)];
1211
- }
1212
- function parseBoolean(value) {
1213
- if (typeof value === "string") {
1214
- return !["false", "0", "no", "off", ""].includes(value.toLowerCase());
1215
- }
1216
- return Boolean(value);
1217
- }
1218
- function supportsAnsi() {
1219
- return process.stdout.isTTY;
1220
- }
1221
- function dim(text2) {
1222
- return supportsAnsi() ? `\x1B[2m${text2}\x1B[0m` : text2;
1223
- }
1224
- var LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
1225
- function parse4(src) {
1226
- const obj = {};
1227
- let lines = src.toString();
1228
- lines = lines.replace(/\r\n?/mg, "\n");
1229
- let match;
1230
- while ((match = LINE.exec(lines)) != null) {
1231
- const key = match[1];
1232
- let value = match[2] || "";
1233
- value = value.trim();
1234
- const maybeQuote = value[0];
1235
- value = value.replace(/^(['"`])([\s\S]*)\1$/mg, "$2");
1236
- if (maybeQuote === '"') {
1237
- value = value.replace(/\\n/g, "\n");
1238
- value = value.replace(/\\r/g, "\r");
1239
- }
1240
- obj[key] = value;
1241
- }
1242
- return obj;
1243
- }
1244
- function _parseVault(options) {
1245
- options = options || {};
1246
- const vaultPath = _vaultPath(options);
1247
- options.path = vaultPath;
1248
- const result = DotenvModule.configDotenv(options);
1249
- if (!result.parsed) {
1250
- const err = new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`);
1251
- err.code = "MISSING_DATA";
1252
- throw err;
1192
+ // ../../node_modules/dotenv/dist/index.cjs
1193
+ var require_dist = __commonJS({
1194
+ "../../node_modules/dotenv/dist/index.cjs"(exports, module) {
1195
+ var j = (e, n3) => () => {
1196
+ try {
1197
+ return n3 || e((n3 = { exports: {} }).exports, n3), n3.exports;
1198
+ } catch (t2) {
1199
+ throw n3 = 0, t2;
1253
1200
  }
1254
- const keys = _dotenvKey(options).split(",");
1255
- const length = keys.length;
1256
- let decrypted;
1257
- for (let i2 = 0; i2 < length; i2++) {
1258
- try {
1259
- const key = keys[i2].trim();
1260
- const attrs = _instructions(result, key);
1261
- decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key);
1262
- break;
1263
- } catch (error) {
1264
- if (i2 + 1 >= length) {
1265
- throw error;
1266
- }
1267
- }
1201
+ };
1202
+ var k = j((xe, U2) => {
1203
+ function G(e) {
1204
+ return typeof e == "string" ? !["false", "0", "no", "off", ""].includes(e.toLowerCase()) : !!e;
1268
1205
  }
1269
- return DotenvModule.parse(decrypted);
1270
- }
1271
- function _warn(message) {
1272
- console.error(`\u26A0 ${message}`);
1273
- }
1274
- function _debug(message) {
1275
- console.log(`\u2506 ${message}`);
1276
- }
1277
- function _log(message) {
1278
- console.log(`\u25C7 ${message}`);
1279
- }
1280
- function _dotenvKey(options) {
1281
- if (options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0) {
1282
- return options.DOTENV_KEY;
1206
+ function Y(e = process.env) {
1207
+ let n3 = {};
1208
+ for (let t2 of ["ENCODING", "PATH", "QUIET", "DEBUG", "OVERRIDE", "FAST"]) {
1209
+ let o = e[`DOTENV_${t2}`] != null ? e[`DOTENV_${t2}`] : e[`DOTENV_CONFIG_${t2}`];
1210
+ o != null && (n3[t2.toLowerCase()] = t2 === "ENCODING" || t2 === "PATH" ? o : G(o));
1211
+ }
1212
+ return n3;
1283
1213
  }
1284
- if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) {
1285
- return process.env.DOTENV_KEY;
1214
+ U2.exports = { parseBoolean: G, optionsFromEnv: Y };
1215
+ });
1216
+ var N = j((ye, x) => {
1217
+ var z = __require("fs"), I2 = __require("path"), Z = __require("os"), { URL: ee, fileURLToPath: te } = __require("url"), { parseBoolean: $, optionsFromEnv: B } = k(), re2 = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg, b = new Uint8Array(256);
1218
+ for (let e = 48; e <= 57; e++) b[e] = 1;
1219
+ for (let e = 65; e <= 90; e++) b[e] = 1;
1220
+ for (let e = 97; e <= 122; e++) b[e] = 1;
1221
+ b[45] = 1;
1222
+ b[46] = 1;
1223
+ b[95] = 1;
1224
+ function ne(e) {
1225
+ let n3 = {}, t2 = e.toString();
1226
+ t2 = t2.replace(/\r\n?/mg, `
1227
+ `);
1228
+ let o;
1229
+ for (; (o = re2.exec(t2)) != null; ) {
1230
+ let r2 = o[1], s = o[2] || "";
1231
+ s = s.trim();
1232
+ let i2 = s[0];
1233
+ s = s.replace(/^(['"`])([\s\S]*)\1$/mg, "$2"), i2 === '"' && (s = s.replace(/\\n/g, `
1234
+ `), s = s.replace(/\\r/g, "\r")), n3[r2] = s;
1235
+ }
1236
+ return n3;
1286
1237
  }
1287
- return "";
1288
- }
1289
- function _instructions(result, dotenvKey) {
1290
- let uri;
1291
- try {
1292
- uri = new URL(dotenvKey);
1293
- } catch (error) {
1294
- if (error.code === "ERR_INVALID_URL") {
1295
- const err = new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");
1296
- err.code = "INVALID_DOTENV_KEY";
1297
- throw err;
1238
+ function w(e) {
1239
+ return e <= 32 ? e === 32 || e >= 9 && e <= 13 : e >= 160 && (e === 160 || e === 5760 || e >= 8192 && e <= 8202 || e === 8232 || e === 8233 || e === 8239 || e === 8287 || e === 12288 || e === 65279);
1240
+ }
1241
+ function q(e) {
1242
+ return e === 10 || e === 8232 || e === 8233;
1243
+ }
1244
+ function oe(e) {
1245
+ let n3 = {}, t2 = typeof e == "string" ? e : e.toString();
1246
+ t2.indexOf("\r") !== -1 && (t2 = t2.replace(/\r\n?/g, `
1247
+ `));
1248
+ let o = t2.length, r2 = 0;
1249
+ for (; r2 < o; ) {
1250
+ let s = t2.charCodeAt(r2);
1251
+ for (; r2 < o && w(s); ) r2++, s = t2.charCodeAt(r2);
1252
+ if (r2 >= o) break;
1253
+ if (s === 35) {
1254
+ for (; r2 < o && !q(t2.charCodeAt(r2)); ) r2++;
1255
+ continue;
1256
+ }
1257
+ let i2 = -1;
1258
+ if (s === 101 && r2 + 6 < o && t2.charCodeAt(r2 + 1) === 120 && t2.charCodeAt(r2 + 2) === 112 && t2.charCodeAt(r2 + 3) === 111 && t2.charCodeAt(r2 + 4) === 114 && t2.charCodeAt(r2 + 5) === 116) {
1259
+ let v = t2.charCodeAt(r2 + 6);
1260
+ if (w(v)) {
1261
+ let u3 = r2 + 7;
1262
+ for (; u3 < o && w(t2.charCodeAt(u3)); ) u3++;
1263
+ b[t2.charCodeAt(u3)] && (i2 = r2 + 6, r2 = u3);
1264
+ } else s = t2.charCodeAt(r2);
1265
+ }
1266
+ let l2 = r2, d = 0;
1267
+ for (; r2 < o && (d = t2.charCodeAt(r2), b[d]); ) r2++;
1268
+ if (r2 === l2) {
1269
+ for (; r2 < o && !q(t2.charCodeAt(r2)); ) r2++;
1270
+ continue;
1271
+ }
1272
+ let h2 = t2.slice(l2, r2), f = r2;
1273
+ if (r2 >= o && (d = 0), w(d)) do
1274
+ r2++, d = r2 < o ? t2.charCodeAt(r2) : 0;
1275
+ while (w(d));
1276
+ if (d === 61) r2++;
1277
+ else if (d === 58 && r2 === f && r2 + 1 < o && w(t2.charCodeAt(r2 + 1))) r2 += 2;
1278
+ else {
1279
+ for (r2 = i2 === -1 ? f : i2; r2 < o && !q(t2.charCodeAt(r2)); ) r2++;
1280
+ continue;
1281
+ }
1282
+ let c2 = r2, a2 = r2;
1283
+ for (; a2 < o && w(t2.charCodeAt(a2)); ) a2++;
1284
+ let g = t2.charCodeAt(a2), p, y2 = false;
1285
+ if (g === 39 || g === 34 || g === 96) {
1286
+ let v = t2[a2], u3 = t2.indexOf(v, a2 + 1), m2 = -1, C2 = -1;
1287
+ for (; u3 !== -1; ) {
1288
+ let O = t2.charCodeAt(u3 - 1) === 92, E = u3 + 1;
1289
+ for (; E < o && !q(t2.charCodeAt(E)) && w(t2.charCodeAt(E)); ) E++;
1290
+ if ((E === o || q(t2.charCodeAt(E)) || t2.charCodeAt(E) === 35) && (m2 = u3, C2 = E), !O) break;
1291
+ u3 = t2.indexOf(v, u3 + 1);
1292
+ }
1293
+ if (m2 !== -1) {
1294
+ if (p = t2.slice(a2 + 1, m2), r2 = C2, t2.charCodeAt(r2) === 35) for (; r2 < o && !q(t2.charCodeAt(r2)); ) r2++;
1295
+ y2 = true;
1296
+ }
1297
+ }
1298
+ if (!y2) {
1299
+ let v = t2.indexOf(`
1300
+ `, c2);
1301
+ v === -1 && (v = o);
1302
+ let u3;
1303
+ if (o < 4096) u3 = t2.indexOf("#", c2), (u3 === -1 || u3 > v) && (u3 = v);
1304
+ else for (u3 = c2; u3 < v && t2.charCodeAt(u3) !== 35; ) u3++;
1305
+ let m2 = c2, C2 = u3;
1306
+ for (; m2 < C2 && w(t2.charCodeAt(m2)); ) m2++;
1307
+ for (; C2 > m2 && w(t2.charCodeAt(C2 - 1)); ) C2--;
1308
+ let O = t2.charCodeAt(m2);
1309
+ if (p = t2.slice(m2, C2), p.includes("\u2028") || p.includes("\u2029") ? p = p.replace(/^(['"`])([\s\S]*)\1$/mg, "$2") : C2 - m2 >= 2 && (O === 39 || O === 34 || O === 96) && t2.charCodeAt(C2 - 1) === O && (p = t2.slice(m2 + 1, C2 - 1)), r2 = u3, u3 < v) for (; r2 < o && !q(t2.charCodeAt(r2)); ) r2++;
1310
+ }
1311
+ g === 34 && (y2 || a2 < r2) && p.indexOf("\\") !== -1 && (p = p.replace(/\\n/g, `
1312
+ `).replace(/\\r/g, "\r")), n3[h2] = p;
1298
1313
  }
1299
- throw error;
1314
+ return n3;
1300
1315
  }
1301
- const key = uri.password;
1302
- if (!key) {
1303
- const err = new Error("INVALID_DOTENV_KEY: Missing key part");
1304
- err.code = "INVALID_DOTENV_KEY";
1305
- throw err;
1316
+ function se(e, n3) {
1317
+ return n3 && $(n3.fast) ? oe(e) : ne(e);
1306
1318
  }
1307
- const environment = uri.searchParams.get("environment");
1308
- if (!environment) {
1309
- const err = new Error("INVALID_DOTENV_KEY: Missing environment part");
1310
- err.code = "INVALID_DOTENV_KEY";
1311
- throw err;
1319
+ function T(e) {
1320
+ console.log(`\u2506 ${e}`);
1312
1321
  }
1313
- const environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`;
1314
- const ciphertext = result.parsed[environmentKey];
1315
- if (!ciphertext) {
1316
- const err = new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`);
1317
- err.code = "NOT_FOUND_DOTENV_ENVIRONMENT";
1318
- throw err;
1322
+ function ie(e) {
1323
+ console.error(`\u25C7 ${e}`);
1319
1324
  }
1320
- return { ciphertext, key };
1321
- }
1322
- function _vaultPath(options) {
1323
- let possibleVaultPath = null;
1324
- if (options && options.path && options.path.length > 0) {
1325
- if (Array.isArray(options.path)) {
1326
- for (const filepath of options.path) {
1327
- if (fs20.existsSync(filepath)) {
1328
- possibleVaultPath = filepath.endsWith(".vault") ? filepath : `${filepath}.vault`;
1329
- }
1325
+ function V(e) {
1326
+ return e[0] === "~" ? I2.join(Z.homedir(), e.slice(1)) : e;
1327
+ }
1328
+ function ce(e = {}) {
1329
+ let n3 = { ...e };
1330
+ for (let t2 of Object.keys(n3)) n3[t2] === void 0 && delete n3[t2];
1331
+ return { ...B(), ...n3 };
1332
+ }
1333
+ function ae(e) {
1334
+ e = ce(e);
1335
+ let n3 = I2.resolve(process.cwd(), ".env"), t2 = "utf8", o = process.env;
1336
+ e && e.processEnv != null && (o = e.processEnv);
1337
+ let r2 = $(e && e.debug);
1338
+ e && e.encoding ? t2 = e.encoding : r2 && T("no encoding is specified (UTF-8 is used by default)");
1339
+ let s = [n3];
1340
+ if (e && e.path) if (!Array.isArray(e.path)) s = [V(e.path)];
1341
+ else {
1342
+ s = [];
1343
+ for (let c2 of e.path) s.push(V(c2));
1344
+ }
1345
+ let i2, l2 = {}, d = { fast: e.fast };
1346
+ for (let c2 of s) try {
1347
+ let a2 = A.parse(z.readFileSync(c2, { encoding: t2 }), d);
1348
+ A.populate(l2, a2, e);
1349
+ } catch (a2) {
1350
+ r2 && T(`failed to load ${c2} ${a2.message}`), i2 = a2;
1351
+ }
1352
+ let h2 = A.populate(o, l2, e), f = $(Object.prototype.hasOwnProperty.call(e, "quiet") ? e.quiet : B(o).quiet);
1353
+ if (r2 || !f) {
1354
+ let c2 = Object.keys(h2).length, a2 = [];
1355
+ for (let g of s) try {
1356
+ let p = I2.relative(process.cwd(), g instanceof ee ? te(g) : g);
1357
+ a2.push(p);
1358
+ } catch (p) {
1359
+ r2 && T(`failed to load ${g} ${p.message}`), i2 = p;
1330
1360
  }
1331
- } else {
1332
- possibleVaultPath = options.path.endsWith(".vault") ? options.path : `${options.path}.vault`;
1361
+ ie(`injected env (${c2}) from ${a2.join(",")}`);
1333
1362
  }
1334
- } else {
1335
- possibleVaultPath = path26.resolve(process.cwd(), ".env.vault");
1363
+ return i2 ? { parsed: l2, error: i2 } : { parsed: l2 };
1336
1364
  }
1337
- if (fs20.existsSync(possibleVaultPath)) {
1338
- return possibleVaultPath;
1365
+ function le(e) {
1366
+ return A.configDotenv(e);
1339
1367
  }
1340
- return null;
1341
- }
1342
- function _resolveHome(envPath) {
1343
- return envPath[0] === "~" ? path26.join(os3.homedir(), envPath.slice(1)) : envPath;
1344
- }
1345
- function _configVault(options) {
1346
- const debug = parseBoolean(process.env.DOTENV_CONFIG_DEBUG || options && options.debug);
1347
- const quiet = parseBoolean(process.env.DOTENV_CONFIG_QUIET || options && options.quiet);
1348
- if (debug || !quiet) {
1349
- _log("loading env from encrypted .env.vault");
1350
- }
1351
- const parsed = DotenvModule._parseVault(options);
1352
- let processEnv = process.env;
1353
- if (options && options.processEnv != null) {
1354
- processEnv = options.processEnv;
1355
- }
1356
- DotenvModule.populate(processEnv, parsed, options);
1357
- return { parsed };
1358
- }
1359
- function configDotenv(options) {
1360
- const dotenvPath = path26.resolve(process.cwd(), ".env");
1361
- let encoding = "utf8";
1362
- let processEnv = process.env;
1363
- if (options && options.processEnv != null) {
1364
- processEnv = options.processEnv;
1365
- }
1366
- let debug = parseBoolean(processEnv.DOTENV_CONFIG_DEBUG || options && options.debug);
1367
- let quiet = parseBoolean(processEnv.DOTENV_CONFIG_QUIET || options && options.quiet);
1368
- if (options && options.encoding) {
1369
- encoding = options.encoding;
1370
- } else {
1371
- if (debug) {
1372
- _debug("no encoding is specified (UTF-8 is used by default)");
1368
+ function fe(e, n3, t2 = {}) {
1369
+ let o = $(t2 && t2.debug), r2 = $(t2 && t2.override), s = {};
1370
+ if (e === null || typeof e != "object" || n3 === null || typeof n3 != "object") {
1371
+ let i2 = new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");
1372
+ throw i2.code = "OBJECT_REQUIRED", i2;
1373
1373
  }
1374
+ for (let i2 of Object.keys(n3)) Object.prototype.hasOwnProperty.call(e, i2) ? (r2 === true && (e[i2] = n3[i2], s[i2] = n3[i2]), o && T(r2 === true ? `"${i2}" is already defined and WAS overwritten` : `"${i2}" is already defined and was NOT overwritten`)) : (e[i2] = n3[i2], s[i2] = n3[i2]);
1375
+ return s;
1374
1376
  }
1375
- let optionPaths = [dotenvPath];
1376
- if (options && options.path) {
1377
- if (!Array.isArray(options.path)) {
1378
- optionPaths = [_resolveHome(options.path)];
1379
- } else {
1380
- optionPaths = [];
1381
- for (const filepath of options.path) {
1382
- optionPaths.push(_resolveHome(filepath));
1377
+ var A = { configDotenv: ae, config: le, parse: se, populate: fe };
1378
+ x.exports.configDotenv = A.configDotenv;
1379
+ x.exports.config = A.config;
1380
+ x.exports.parse = A.parse;
1381
+ x.exports.populate = A.populate;
1382
+ x.exports = A;
1383
+ });
1384
+ var M = j((Te, W2) => {
1385
+ var _ = __require("child_process"), ue = __require("fs"), L = __require("path");
1386
+ function de(e) {
1387
+ let n3 = ['"'], t2 = 0;
1388
+ for (let o of e) {
1389
+ if (o === "\\") {
1390
+ t2++;
1391
+ continue;
1383
1392
  }
1393
+ o === '"' ? n3.push("\\".repeat(t2 * 2 + 1), '"') : n3.push("\\".repeat(t2), o), t2 = 0;
1384
1394
  }
1395
+ return n3.push("\\".repeat(t2 * 2), '"'), n3.join("");
1385
1396
  }
1386
- let lastError;
1387
- const parsedAll = {};
1388
- for (const path27 of optionPaths) {
1389
- try {
1390
- const parsed = DotenvModule.parse(fs20.readFileSync(path27, { encoding }));
1391
- DotenvModule.populate(parsedAll, parsed, options);
1392
- } catch (e) {
1393
- if (debug) {
1394
- _debug(`failed to load ${path27} ${e.message}`);
1397
+ function H(e, n3 = 1) {
1398
+ for (let t2 = 0; t2 < n3; t2++) {
1399
+ let o = [];
1400
+ for (let r2 of e) {
1401
+ let s = r2.charCodeAt(0), i2 = s >= 48 && s <= 57 || s >= 65 && s <= 90 || s >= 97 && s <= 122, l2 = "\\/:._-".includes(r2);
1402
+ !i2 && !l2 && s < 128 && o.push("^"), o.push(r2);
1395
1403
  }
1396
- lastError = e;
1404
+ e = o.join("");
1397
1405
  }
1406
+ return e;
1398
1407
  }
1399
- const populated = DotenvModule.populate(processEnv, parsedAll, options);
1400
- debug = parseBoolean(processEnv.DOTENV_CONFIG_DEBUG || debug);
1401
- quiet = parseBoolean(processEnv.DOTENV_CONFIG_QUIET || quiet);
1402
- if (debug || !quiet) {
1403
- const keysCount = Object.keys(populated).length;
1404
- const shortPaths = [];
1405
- for (const filePath of optionPaths) {
1408
+ function P(e, n3) {
1409
+ let t2 = Object.keys(e).reverse().find((o) => o.toUpperCase() === n3);
1410
+ return t2 === void 0 ? void 0 : e[t2];
1411
+ }
1412
+ function pe(e, n3, t2) {
1413
+ let o = (P(n3, "PATHEXT") || ".COM;.EXE;.BAT;.CMD").split(";").filter(Boolean), s = o.some((l2) => e.toLowerCase().endsWith(l2.toLowerCase())) ? ["", ...o] : [...o, ""], i2 = /[\\/]/.test(e) ? [t2] : [t2, ...(P(n3, "PATH") || "").split(";")];
1414
+ for (let l2 of i2) for (let d of s) {
1415
+ let h2 = L.resolve(t2, l2.replace(/^"|"$/g, ""), e + d);
1406
1416
  try {
1407
- const relative5 = path26.relative(process.cwd(), filePath);
1408
- shortPaths.push(relative5);
1409
- } catch (e) {
1410
- if (debug) {
1411
- _debug(`failed to load ${filePath} ${e.message}`);
1412
- }
1413
- lastError = e;
1417
+ if (ue.statSync(h2).isFile()) return h2;
1418
+ } catch {
1414
1419
  }
1415
1420
  }
1416
- _log(`injected env (${keysCount}) from ${shortPaths.join(",")} ${dim(`// tip: ${_getRandomTip()}`)}`);
1417
1421
  }
1418
- if (lastError) {
1419
- return { parsed: parsedAll, error: lastError };
1420
- } else {
1421
- return { parsed: parsedAll };
1422
+ function he(e, n3, t2) {
1423
+ if (process.platform !== "win32") return _.spawn(e, n3, t2);
1424
+ let o = t2.env || process.env, r2 = pe(e, o, t2.cwd || process.cwd());
1425
+ if (r2 && /\.(?:exe|com)$/i.test(r2)) return _.spawn(r2, n3, t2);
1426
+ let s = /\.(?:bat|cmd)$/i.test(r2 || e), i2 = [H(L.normalize(r2 || e))];
1427
+ for (let d of n3) i2.push(H(de(d), s ? 2 : 1));
1428
+ let l2 = i2.join(" ");
1429
+ return _.spawn(P(o, "COMSPEC") || "cmd.exe", ["/d", "/v:off", "/s", "/c", `"${l2}"`], { ...t2, windowsVerbatimArguments: true });
1422
1430
  }
1423
- }
1424
- function config(options) {
1425
- if (_dotenvKey(options).length === 0) {
1426
- return DotenvModule.configDotenv(options);
1431
+ W2.exports = he;
1432
+ });
1433
+ var X = j(($e, F) => {
1434
+ var ge = __require("fs"), me = __require("os"), Q = __require("path"), ve = __require("child_process"), Ce = M(), R2 = N(), { optionsFromEnv: J } = k();
1435
+ function D() {
1436
+ console.log(["Usage: dotenv run [--help] [-q|--quiet] [--debug] [--override] [--fast] [-f|--file <paths>] [--] <command> [args...]", "", "Run a command with environment variables from a .env file.", "Place dotenv options before the command; all following arguments go to the command.", "", "Options:", " -f, --file <paths> .env paths, comma-separated or repeated (default: .env)", " -q, --quiet suppress the injected env message", " --debug enable debug logging", " --override override existing environment variables", " --fast use the faster character-scanner parser", "", "Environment variables (DOTENV_CONFIG_* names remain as fallbacks):", " DOTENV_PATH, DOTENV_ENCODING, DOTENV_QUIET,", " DOTENV_DEBUG, DOTENV_OVERRIDE,", " DOTENV_FAST"].join(`
1437
+ `));
1438
+ }
1439
+ function we(e) {
1440
+ let n3 = [], t2 = false, o, r2, s, i2, l2 = -1;
1441
+ for (let h2 = 0; h2 < e.length; h2++) {
1442
+ let f = e[h2];
1443
+ if (f === "--") {
1444
+ l2 = h2 + 1;
1445
+ break;
1446
+ }
1447
+ if (f === "--help" || f === "-h") return { help: true };
1448
+ if (f === "--quiet" || f === "-q") {
1449
+ o = true;
1450
+ continue;
1451
+ }
1452
+ if (f === "--debug") {
1453
+ r2 = true;
1454
+ continue;
1455
+ }
1456
+ if (f === "--override") {
1457
+ s = true;
1458
+ continue;
1459
+ }
1460
+ if (f === "--fast") {
1461
+ i2 = true;
1462
+ continue;
1463
+ }
1464
+ if (f === "-f" || f === "--file" || f.startsWith("-f=") || f.startsWith("--file=")) {
1465
+ let c2 = f.indexOf("="), a2 = c2 === -1 ? f : f.slice(0, c2), g = c2 === -1 ? e[++h2] : f.slice(c2 + 1);
1466
+ if (!g || g === "--") return { error: `${a2} requires a path` };
1467
+ let p = g.split(",").map((y2) => y2.trim()).filter(Boolean);
1468
+ if (p.length === 0) return { error: `${a2} requires a path` };
1469
+ n3.push(...p), t2 = true;
1470
+ continue;
1471
+ }
1472
+ if (f.startsWith("-")) return { error: `unknown option: ${f}` };
1473
+ l2 = h2;
1474
+ break;
1475
+ }
1476
+ let d = l2 === -1 ? [] : e.slice(l2);
1477
+ return { paths: n3, pathSet: t2, quiet: o, debug: r2, override: s, fast: i2, command: d };
1427
1478
  }
1428
- const vaultPath = _vaultPath(options);
1429
- if (!vaultPath) {
1430
- _warn(`you set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}`);
1431
- return DotenvModule.configDotenv(options);
1479
+ function Ae(e) {
1480
+ return e[0] === "~" ? Q.join(me.homedir(), e.slice(1)) : e;
1432
1481
  }
1433
- return DotenvModule._configVault(options);
1434
- }
1435
- function decrypt(encrypted, keyStr) {
1436
- const key = Buffer.from(keyStr.slice(-64), "hex");
1437
- let ciphertext = Buffer.from(encrypted, "base64");
1438
- const nonce = ciphertext.subarray(0, 12);
1439
- const authTag = ciphertext.subarray(-16);
1440
- ciphertext = ciphertext.subarray(12, -16);
1441
- try {
1442
- const aesgcm = crypto3.createDecipheriv("aes-256-gcm", key, nonce);
1443
- aesgcm.setAuthTag(authTag);
1444
- return `${aesgcm.update(ciphertext)}${aesgcm.final()}`;
1445
- } catch (error) {
1446
- const isRange = error instanceof RangeError;
1447
- const invalidKeyLength = error.message === "Invalid key length";
1448
- const decryptionFailed = error.message === "Unsupported state or unable to authenticate data";
1449
- if (isRange || invalidKeyLength) {
1450
- const err = new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");
1451
- err.code = "INVALID_DOTENV_KEY";
1452
- throw err;
1453
- } else if (decryptionFailed) {
1454
- const err = new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");
1455
- err.code = "DECRYPTION_FAILED";
1456
- throw err;
1457
- } else {
1458
- throw error;
1459
- }
1482
+ function Ee(e) {
1483
+ let n3 = J(), t2 = { encoding: n3.encoding || "utf8", quiet: n3.quiet, debug: n3.debug === true, override: n3.override === true, fast: n3.fast === true, paths: [".env"], defaultPath: true };
1484
+ return n3.path != null && (t2.paths = [n3.path], t2.defaultPath = false), e.pathSet && (t2.paths = e.paths, t2.defaultPath = false), e.quiet != null && (t2.quiet = e.quiet), e.debug != null && (t2.debug = e.debug), e.override != null && (t2.override = e.override), e.fast != null && (t2.fast = e.fast), t2;
1460
1485
  }
1461
- }
1462
- function populate(processEnv, parsed, options = {}) {
1463
- const debug = Boolean(options && options.debug);
1464
- const override = Boolean(options && options.override);
1465
- const populated = {};
1466
- if (typeof parsed !== "object") {
1467
- const err = new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");
1468
- err.code = "OBJECT_REQUIRED";
1469
- throw err;
1486
+ function be(e) {
1487
+ let n3 = {}, t2 = [], o = { override: e.override, debug: e.debug };
1488
+ for (let s of e.paths) {
1489
+ let i2 = Q.resolve(process.cwd(), Ae(s));
1490
+ try {
1491
+ let l2 = R2.parse(ge.readFileSync(i2, { encoding: e.encoding }), { fast: e.fast });
1492
+ R2.populate(n3, l2, o), t2.push(s);
1493
+ } catch (l2) {
1494
+ if (e.debug && console.log(`\u2506 failed to load ${s} ${l2.message}`), !(e.defaultPath && l2.code === "ENOENT")) throw l2;
1495
+ }
1496
+ }
1497
+ return { injected: R2.populate(process.env, n3, o), loadedPaths: t2 };
1470
1498
  }
1471
- for (const key of Object.keys(parsed)) {
1472
- if (Object.prototype.hasOwnProperty.call(processEnv, key)) {
1473
- if (override === true) {
1474
- processEnv[key] = parsed[key];
1475
- populated[key] = parsed[key];
1499
+ function K(e) {
1500
+ let n3 = e[0];
1501
+ if (n3 === "--help" || n3 === "-h") {
1502
+ D();
1503
+ return;
1504
+ }
1505
+ if (n3 !== "run") {
1506
+ D(), process.exitCode = 1;
1507
+ return;
1508
+ }
1509
+ let t2 = we(e.slice(1));
1510
+ if (t2.help) {
1511
+ D();
1512
+ return;
1513
+ }
1514
+ if (t2.error) {
1515
+ console.error(`dotenv: ${t2.error}`), D(), process.exitCode = 1;
1516
+ return;
1517
+ }
1518
+ if (t2.command.length === 0) {
1519
+ D(), process.exitCode = 1;
1520
+ return;
1521
+ }
1522
+ let o = Ee(t2);
1523
+ try {
1524
+ let c2 = be(o);
1525
+ if (!(o.quiet == null ? J().quiet : o.quiet)) {
1526
+ let g = `\u25C7 injected env (${Object.keys(c2.injected).length})`;
1527
+ c2.loadedPaths.length > 0 && (g += ` from ${c2.loadedPaths.join(", ")}`), console.error(g);
1476
1528
  }
1477
- if (debug) {
1478
- if (override === true) {
1479
- _debug(`"${key}" is already defined and WAS overwritten`);
1480
- } else {
1481
- _debug(`"${key}" is already defined and was NOT overwritten`);
1529
+ } catch (c2) {
1530
+ console.error(`dotenv: ${c2.message}`), process.exitCode = 1;
1531
+ return;
1532
+ }
1533
+ let r2 = !!process.stdin.isTTY, s = process.platform !== "win32" && !r2, i2 = Ce(t2.command[0], t2.command.slice(1), { stdio: "inherit", detached: s }), l2 = /* @__PURE__ */ new Map(), d = 0;
1534
+ function h2(c2) {
1535
+ if (!(!i2.pid || i2.exitCode !== null || i2.signalCode !== null)) {
1536
+ if (process.platform === "win32") {
1537
+ ve.spawnSync("taskkill", ["/pid", String(i2.pid), "/T", "/F"], { stdio: "ignore" });
1538
+ return;
1539
+ }
1540
+ try {
1541
+ process.kill(s ? -i2.pid : i2.pid, c2);
1542
+ } catch (a2) {
1543
+ if (a2.code !== "ESRCH") throw a2;
1482
1544
  }
1483
1545
  }
1484
- } else {
1485
- processEnv[key] = parsed[key];
1486
- populated[key] = parsed[key];
1487
1546
  }
1547
+ function f() {
1548
+ for (let [c2, a2] of l2) process.removeListener(c2, a2);
1549
+ }
1550
+ for (let c2 of ["SIGINT", "SIGTERM", "SIGHUP", "SIGQUIT"]) {
1551
+ let a2 = () => {
1552
+ if (c2 === "SIGINT") {
1553
+ if (d++, r2 && process.platform !== "win32" && d === 1) return;
1554
+ if (d > 1) {
1555
+ h2(d === 2 ? "SIGTERM" : "SIGKILL");
1556
+ return;
1557
+ }
1558
+ }
1559
+ h2(c2);
1560
+ };
1561
+ l2.set(c2, a2), process.on(c2, a2);
1562
+ }
1563
+ i2.on("error", function(c2) {
1564
+ f(), console.error(`dotenv: ${c2.message}`), process.exitCode = 1;
1565
+ }), i2.on("exit", function(c2, a2) {
1566
+ f(), typeof c2 == "number" ? process.exit(c2) : (setInterval(() => {
1567
+ }, 1e3), process.kill(process.pid, a2));
1568
+ });
1488
1569
  }
1489
- return populated;
1490
- }
1491
- var DotenvModule = {
1492
- configDotenv,
1493
- _configVault,
1494
- _parseVault,
1495
- config,
1496
- decrypt,
1497
- parse: parse4,
1498
- populate
1499
- };
1500
- module.exports.configDotenv = DotenvModule.configDotenv;
1501
- module.exports._configVault = DotenvModule._configVault;
1502
- module.exports._parseVault = DotenvModule._parseVault;
1503
- module.exports.config = DotenvModule.config;
1504
- module.exports.decrypt = DotenvModule.decrypt;
1505
- module.exports.parse = DotenvModule.parse;
1506
- module.exports.populate = DotenvModule.populate;
1507
- module.exports = DotenvModule;
1570
+ F.exports = K;
1571
+ __require.main === F && K(process.argv.slice(2));
1572
+ });
1573
+ var S = N();
1574
+ var qe = X();
1575
+ module.exports = S;
1576
+ module.exports.config = S.config;
1577
+ module.exports.configDotenv = S.configDotenv;
1578
+ module.exports.parse = S.parse;
1579
+ module.exports.populate = S.populate;
1580
+ __require.main === module && qe(process.argv.slice(2));
1508
1581
  }
1509
1582
  });
1510
1583
 
@@ -3579,17 +3652,17 @@ var require_visit = __commonJS({
3579
3652
  visit2.BREAK = BREAK;
3580
3653
  visit2.SKIP = SKIP;
3581
3654
  visit2.REMOVE = REMOVE;
3582
- function visit_(key, node, visitor, path26) {
3583
- const ctrl = callVisitor(key, node, visitor, path26);
3655
+ function visit_(key, node, visitor, path28) {
3656
+ const ctrl = callVisitor(key, node, visitor, path28);
3584
3657
  if (identity2.isNode(ctrl) || identity2.isPair(ctrl)) {
3585
- replaceNode(key, path26, ctrl);
3586
- return visit_(key, ctrl, visitor, path26);
3658
+ replaceNode(key, path28, ctrl);
3659
+ return visit_(key, ctrl, visitor, path28);
3587
3660
  }
3588
3661
  if (typeof ctrl !== "symbol") {
3589
3662
  if (identity2.isCollection(node)) {
3590
- path26 = Object.freeze(path26.concat(node));
3663
+ path28 = Object.freeze(path28.concat(node));
3591
3664
  for (let i2 = 0; i2 < node.items.length; ++i2) {
3592
- const ci = visit_(i2, node.items[i2], visitor, path26);
3665
+ const ci = visit_(i2, node.items[i2], visitor, path28);
3593
3666
  if (typeof ci === "number")
3594
3667
  i2 = ci - 1;
3595
3668
  else if (ci === BREAK)
@@ -3600,13 +3673,13 @@ var require_visit = __commonJS({
3600
3673
  }
3601
3674
  }
3602
3675
  } else if (identity2.isPair(node)) {
3603
- path26 = Object.freeze(path26.concat(node));
3604
- const ck = visit_("key", node.key, visitor, path26);
3676
+ path28 = Object.freeze(path28.concat(node));
3677
+ const ck = visit_("key", node.key, visitor, path28);
3605
3678
  if (ck === BREAK)
3606
3679
  return BREAK;
3607
3680
  else if (ck === REMOVE)
3608
3681
  node.key = null;
3609
- const cv = visit_("value", node.value, visitor, path26);
3682
+ const cv = visit_("value", node.value, visitor, path28);
3610
3683
  if (cv === BREAK)
3611
3684
  return BREAK;
3612
3685
  else if (cv === REMOVE)
@@ -3627,17 +3700,17 @@ var require_visit = __commonJS({
3627
3700
  visitAsync.BREAK = BREAK;
3628
3701
  visitAsync.SKIP = SKIP;
3629
3702
  visitAsync.REMOVE = REMOVE;
3630
- async function visitAsync_(key, node, visitor, path26) {
3631
- const ctrl = await callVisitor(key, node, visitor, path26);
3703
+ async function visitAsync_(key, node, visitor, path28) {
3704
+ const ctrl = await callVisitor(key, node, visitor, path28);
3632
3705
  if (identity2.isNode(ctrl) || identity2.isPair(ctrl)) {
3633
- replaceNode(key, path26, ctrl);
3634
- return visitAsync_(key, ctrl, visitor, path26);
3706
+ replaceNode(key, path28, ctrl);
3707
+ return visitAsync_(key, ctrl, visitor, path28);
3635
3708
  }
3636
3709
  if (typeof ctrl !== "symbol") {
3637
3710
  if (identity2.isCollection(node)) {
3638
- path26 = Object.freeze(path26.concat(node));
3711
+ path28 = Object.freeze(path28.concat(node));
3639
3712
  for (let i2 = 0; i2 < node.items.length; ++i2) {
3640
- const ci = await visitAsync_(i2, node.items[i2], visitor, path26);
3713
+ const ci = await visitAsync_(i2, node.items[i2], visitor, path28);
3641
3714
  if (typeof ci === "number")
3642
3715
  i2 = ci - 1;
3643
3716
  else if (ci === BREAK)
@@ -3648,13 +3721,13 @@ var require_visit = __commonJS({
3648
3721
  }
3649
3722
  }
3650
3723
  } else if (identity2.isPair(node)) {
3651
- path26 = Object.freeze(path26.concat(node));
3652
- const ck = await visitAsync_("key", node.key, visitor, path26);
3724
+ path28 = Object.freeze(path28.concat(node));
3725
+ const ck = await visitAsync_("key", node.key, visitor, path28);
3653
3726
  if (ck === BREAK)
3654
3727
  return BREAK;
3655
3728
  else if (ck === REMOVE)
3656
3729
  node.key = null;
3657
- const cv = await visitAsync_("value", node.value, visitor, path26);
3730
+ const cv = await visitAsync_("value", node.value, visitor, path28);
3658
3731
  if (cv === BREAK)
3659
3732
  return BREAK;
3660
3733
  else if (cv === REMOVE)
@@ -3681,23 +3754,23 @@ var require_visit = __commonJS({
3681
3754
  }
3682
3755
  return visitor;
3683
3756
  }
3684
- function callVisitor(key, node, visitor, path26) {
3757
+ function callVisitor(key, node, visitor, path28) {
3685
3758
  if (typeof visitor === "function")
3686
- return visitor(key, node, path26);
3759
+ return visitor(key, node, path28);
3687
3760
  if (identity2.isMap(node))
3688
- return visitor.Map?.(key, node, path26);
3761
+ return visitor.Map?.(key, node, path28);
3689
3762
  if (identity2.isSeq(node))
3690
- return visitor.Seq?.(key, node, path26);
3763
+ return visitor.Seq?.(key, node, path28);
3691
3764
  if (identity2.isPair(node))
3692
- return visitor.Pair?.(key, node, path26);
3765
+ return visitor.Pair?.(key, node, path28);
3693
3766
  if (identity2.isScalar(node))
3694
- return visitor.Scalar?.(key, node, path26);
3767
+ return visitor.Scalar?.(key, node, path28);
3695
3768
  if (identity2.isAlias(node))
3696
- return visitor.Alias?.(key, node, path26);
3769
+ return visitor.Alias?.(key, node, path28);
3697
3770
  return void 0;
3698
3771
  }
3699
- function replaceNode(key, path26, node) {
3700
- const parent = path26[path26.length - 1];
3772
+ function replaceNode(key, path28, node) {
3773
+ const parent = path28[path28.length - 1];
3701
3774
  if (identity2.isCollection(parent)) {
3702
3775
  parent.items[key] = node;
3703
3776
  } else if (identity2.isPair(parent)) {
@@ -4309,10 +4382,10 @@ var require_Collection = __commonJS({
4309
4382
  var createNode = require_createNode();
4310
4383
  var identity2 = require_identity();
4311
4384
  var Node = require_Node();
4312
- function collectionFromPath(schema, path26, value) {
4385
+ function collectionFromPath(schema, path28, value) {
4313
4386
  let v = value;
4314
- for (let i2 = path26.length - 1; i2 >= 0; --i2) {
4315
- const k = path26[i2];
4387
+ for (let i2 = path28.length - 1; i2 >= 0; --i2) {
4388
+ const k = path28[i2];
4316
4389
  if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
4317
4390
  const a2 = [];
4318
4391
  a2[k] = v;
@@ -4331,7 +4404,7 @@ var require_Collection = __commonJS({
4331
4404
  sourceObjects: /* @__PURE__ */ new Map()
4332
4405
  });
4333
4406
  }
4334
- var isEmptyPath = (path26) => path26 == null || typeof path26 === "object" && !!path26[Symbol.iterator]().next().done;
4407
+ var isEmptyPath = (path28) => path28 == null || typeof path28 === "object" && !!path28[Symbol.iterator]().next().done;
4335
4408
  var Collection = class extends Node.NodeBase {
4336
4409
  constructor(type, schema) {
4337
4410
  super(type);
@@ -4361,11 +4434,11 @@ var require_Collection = __commonJS({
4361
4434
  * be a Pair instance or a `{ key, value }` object, which may not have a key
4362
4435
  * that already exists in the map.
4363
4436
  */
4364
- addIn(path26, value) {
4365
- if (isEmptyPath(path26))
4437
+ addIn(path28, value) {
4438
+ if (isEmptyPath(path28))
4366
4439
  this.add(value);
4367
4440
  else {
4368
- const [key, ...rest] = path26;
4441
+ const [key, ...rest] = path28;
4369
4442
  const node = this.get(key, true);
4370
4443
  if (identity2.isCollection(node))
4371
4444
  node.addIn(rest, value);
@@ -4379,8 +4452,8 @@ var require_Collection = __commonJS({
4379
4452
  * Removes a value from the collection.
4380
4453
  * @returns `true` if the item was found and removed.
4381
4454
  */
4382
- deleteIn(path26) {
4383
- const [key, ...rest] = path26;
4455
+ deleteIn(path28) {
4456
+ const [key, ...rest] = path28;
4384
4457
  if (rest.length === 0)
4385
4458
  return this.delete(key);
4386
4459
  const node = this.get(key, true);
@@ -4394,8 +4467,8 @@ var require_Collection = __commonJS({
4394
4467
  * scalar values from their surrounding node; to disable set `keepScalar` to
4395
4468
  * `true` (collections are always returned intact).
4396
4469
  */
4397
- getIn(path26, keepScalar) {
4398
- const [key, ...rest] = path26;
4470
+ getIn(path28, keepScalar) {
4471
+ const [key, ...rest] = path28;
4399
4472
  const node = this.get(key, true);
4400
4473
  if (rest.length === 0)
4401
4474
  return !keepScalar && identity2.isScalar(node) ? node.value : node;
@@ -4413,8 +4486,8 @@ var require_Collection = __commonJS({
4413
4486
  /**
4414
4487
  * Checks if the collection includes a value with the key `key`.
4415
4488
  */
4416
- hasIn(path26) {
4417
- const [key, ...rest] = path26;
4489
+ hasIn(path28) {
4490
+ const [key, ...rest] = path28;
4418
4491
  if (rest.length === 0)
4419
4492
  return this.has(key);
4420
4493
  const node = this.get(key, true);
@@ -4424,8 +4497,8 @@ var require_Collection = __commonJS({
4424
4497
  * Sets a value in this collection. For `!!set`, `value` needs to be a
4425
4498
  * boolean to add/remove the item from the set.
4426
4499
  */
4427
- setIn(path26, value) {
4428
- const [key, ...rest] = path26;
4500
+ setIn(path28, value) {
4501
+ const [key, ...rest] = path28;
4429
4502
  if (rest.length === 0) {
4430
4503
  this.set(key, value);
4431
4504
  } else {
@@ -6940,9 +7013,9 @@ var require_Document = __commonJS({
6940
7013
  this.contents.add(value);
6941
7014
  }
6942
7015
  /** Adds a value to the document. */
6943
- addIn(path26, value) {
7016
+ addIn(path28, value) {
6944
7017
  if (assertCollection(this.contents))
6945
- this.contents.addIn(path26, value);
7018
+ this.contents.addIn(path28, value);
6946
7019
  }
6947
7020
  /**
6948
7021
  * Create a new `Alias` node, ensuring that the target `node` has the required anchor.
@@ -7017,14 +7090,14 @@ var require_Document = __commonJS({
7017
7090
  * Removes a value from the document.
7018
7091
  * @returns `true` if the item was found and removed.
7019
7092
  */
7020
- deleteIn(path26) {
7021
- if (Collection.isEmptyPath(path26)) {
7093
+ deleteIn(path28) {
7094
+ if (Collection.isEmptyPath(path28)) {
7022
7095
  if (this.contents == null)
7023
7096
  return false;
7024
7097
  this.contents = null;
7025
7098
  return true;
7026
7099
  }
7027
- return assertCollection(this.contents) ? this.contents.deleteIn(path26) : false;
7100
+ return assertCollection(this.contents) ? this.contents.deleteIn(path28) : false;
7028
7101
  }
7029
7102
  /**
7030
7103
  * Returns item at `key`, or `undefined` if not found. By default unwraps
@@ -7039,10 +7112,10 @@ var require_Document = __commonJS({
7039
7112
  * scalar values from their surrounding node; to disable set `keepScalar` to
7040
7113
  * `true` (collections are always returned intact).
7041
7114
  */
7042
- getIn(path26, keepScalar) {
7043
- if (Collection.isEmptyPath(path26))
7115
+ getIn(path28, keepScalar) {
7116
+ if (Collection.isEmptyPath(path28))
7044
7117
  return !keepScalar && identity2.isScalar(this.contents) ? this.contents.value : this.contents;
7045
- return identity2.isCollection(this.contents) ? this.contents.getIn(path26, keepScalar) : void 0;
7118
+ return identity2.isCollection(this.contents) ? this.contents.getIn(path28, keepScalar) : void 0;
7046
7119
  }
7047
7120
  /**
7048
7121
  * Checks if the document includes a value with the key `key`.
@@ -7053,10 +7126,10 @@ var require_Document = __commonJS({
7053
7126
  /**
7054
7127
  * Checks if the document includes a value at `path`.
7055
7128
  */
7056
- hasIn(path26) {
7057
- if (Collection.isEmptyPath(path26))
7129
+ hasIn(path28) {
7130
+ if (Collection.isEmptyPath(path28))
7058
7131
  return this.contents !== void 0;
7059
- return identity2.isCollection(this.contents) ? this.contents.hasIn(path26) : false;
7132
+ return identity2.isCollection(this.contents) ? this.contents.hasIn(path28) : false;
7060
7133
  }
7061
7134
  /**
7062
7135
  * Sets a value in this document. For `!!set`, `value` needs to be a
@@ -7073,13 +7146,13 @@ var require_Document = __commonJS({
7073
7146
  * Sets a value in this document. For `!!set`, `value` needs to be a
7074
7147
  * boolean to add/remove the item from the set.
7075
7148
  */
7076
- setIn(path26, value) {
7077
- if (Collection.isEmptyPath(path26)) {
7149
+ setIn(path28, value) {
7150
+ if (Collection.isEmptyPath(path28)) {
7078
7151
  this.contents = value;
7079
7152
  } else if (this.contents == null) {
7080
- this.contents = Collection.collectionFromPath(this.schema, Array.from(path26), value);
7153
+ this.contents = Collection.collectionFromPath(this.schema, Array.from(path28), value);
7081
7154
  } else if (assertCollection(this.contents)) {
7082
- this.contents.setIn(path26, value);
7155
+ this.contents.setIn(path28, value);
7083
7156
  }
7084
7157
  }
7085
7158
  /**
@@ -9040,9 +9113,9 @@ var require_cst_visit = __commonJS({
9040
9113
  visit2.BREAK = BREAK;
9041
9114
  visit2.SKIP = SKIP;
9042
9115
  visit2.REMOVE = REMOVE;
9043
- visit2.itemAtPath = (cst, path26) => {
9116
+ visit2.itemAtPath = (cst, path28) => {
9044
9117
  let item = cst;
9045
- for (const [field, index] of path26) {
9118
+ for (const [field, index] of path28) {
9046
9119
  const tok = item?.[field];
9047
9120
  if (tok && "items" in tok) {
9048
9121
  item = tok.items[index];
@@ -9051,23 +9124,23 @@ var require_cst_visit = __commonJS({
9051
9124
  }
9052
9125
  return item;
9053
9126
  };
9054
- visit2.parentCollection = (cst, path26) => {
9055
- const parent = visit2.itemAtPath(cst, path26.slice(0, -1));
9056
- const field = path26[path26.length - 1][0];
9127
+ visit2.parentCollection = (cst, path28) => {
9128
+ const parent = visit2.itemAtPath(cst, path28.slice(0, -1));
9129
+ const field = path28[path28.length - 1][0];
9057
9130
  const coll = parent?.[field];
9058
9131
  if (coll && "items" in coll)
9059
9132
  return coll;
9060
9133
  throw new Error("Parent collection not found");
9061
9134
  };
9062
- function _visit(path26, item, visitor) {
9063
- let ctrl = visitor(item, path26);
9135
+ function _visit(path28, item, visitor) {
9136
+ let ctrl = visitor(item, path28);
9064
9137
  if (typeof ctrl === "symbol")
9065
9138
  return ctrl;
9066
9139
  for (const field of ["key", "value"]) {
9067
9140
  const token = item[field];
9068
9141
  if (token && "items" in token) {
9069
9142
  for (let i2 = 0; i2 < token.items.length; ++i2) {
9070
- const ci = _visit(Object.freeze(path26.concat([[field, i2]])), token.items[i2], visitor);
9143
+ const ci = _visit(Object.freeze(path28.concat([[field, i2]])), token.items[i2], visitor);
9071
9144
  if (typeof ci === "number")
9072
9145
  i2 = ci - 1;
9073
9146
  else if (ci === BREAK)
@@ -9078,10 +9151,10 @@ var require_cst_visit = __commonJS({
9078
9151
  }
9079
9152
  }
9080
9153
  if (typeof ctrl === "function" && field === "key")
9081
- ctrl = ctrl(item, path26);
9154
+ ctrl = ctrl(item, path28);
9082
9155
  }
9083
9156
  }
9084
- return typeof ctrl === "function" ? ctrl(item, path26) : ctrl;
9157
+ return typeof ctrl === "function" ? ctrl(item, path28) : ctrl;
9085
9158
  }
9086
9159
  exports.visit = visit2;
9087
9160
  }
@@ -10383,14 +10456,14 @@ var require_parser = __commonJS({
10383
10456
  case "scalar":
10384
10457
  case "single-quoted-scalar":
10385
10458
  case "double-quoted-scalar": {
10386
- const fs20 = this.flowScalar(this.type);
10459
+ const fs22 = this.flowScalar(this.type);
10387
10460
  if (atNextItem || it.value) {
10388
- map.items.push({ start, key: fs20, sep: [] });
10461
+ map.items.push({ start, key: fs22, sep: [] });
10389
10462
  this.onKeyLine = true;
10390
10463
  } else if (it.sep) {
10391
- this.stack.push(fs20);
10464
+ this.stack.push(fs22);
10392
10465
  } else {
10393
- Object.assign(it, { key: fs20, sep: [] });
10466
+ Object.assign(it, { key: fs22, sep: [] });
10394
10467
  this.onKeyLine = true;
10395
10468
  }
10396
10469
  return;
@@ -10518,13 +10591,13 @@ var require_parser = __commonJS({
10518
10591
  case "scalar":
10519
10592
  case "single-quoted-scalar":
10520
10593
  case "double-quoted-scalar": {
10521
- const fs20 = this.flowScalar(this.type);
10594
+ const fs22 = this.flowScalar(this.type);
10522
10595
  if (!it || it.value)
10523
- fc.items.push({ start: [], key: fs20, sep: [] });
10596
+ fc.items.push({ start: [], key: fs22, sep: [] });
10524
10597
  else if (it.sep)
10525
- this.stack.push(fs20);
10598
+ this.stack.push(fs22);
10526
10599
  else
10527
- Object.assign(it, { key: fs20, sep: [] });
10600
+ Object.assign(it, { key: fs22, sep: [] });
10528
10601
  return;
10529
10602
  }
10530
10603
  case "flow-map-end":
@@ -10781,7 +10854,7 @@ var require_public_api = __commonJS({
10781
10854
  });
10782
10855
 
10783
10856
  // ../../node_modules/yaml/dist/index.js
10784
- var require_dist = __commonJS({
10857
+ var require_dist2 = __commonJS({
10785
10858
  "../../node_modules/yaml/dist/index.js"(exports) {
10786
10859
  "use strict";
10787
10860
  var composer = require_composer();
@@ -10935,13 +11008,13 @@ var require_min_release_age = __commonJS({
10935
11008
  return Number.isFinite(days) && days > 0 ? days * config_parse_1.DAY_MS : 0;
10936
11009
  }
10937
11010
  function probe(p) {
10938
- return new Promise((resolve16) => {
11011
+ return new Promise((resolve17) => {
10939
11012
  (0, node_child_process_1.exec)(p.command, { timeout: PROBE_TIMEOUT_MS2, windowsHide: true }, (err, stdout2) => {
10940
11013
  if (err) {
10941
- resolve16(0);
11014
+ resolve17(0);
10942
11015
  return;
10943
11016
  }
10944
- resolve16(p.parse(stdout2));
11017
+ resolve17(p.parse(stdout2));
10945
11018
  });
10946
11019
  });
10947
11020
  }
@@ -10974,12 +11047,12 @@ var require_registry = __commonJS({
10974
11047
  var node_https_1 = __importDefault(__require("node:https"));
10975
11048
  var REQUEST_TIMEOUT_MS = 1e4;
10976
11049
  function fetchRegistryInfo2(url) {
10977
- return new Promise((resolve16) => {
11050
+ return new Promise((resolve17) => {
10978
11051
  let resolved = false;
10979
11052
  const safeResolve = (value) => {
10980
11053
  if (!resolved) {
10981
11054
  resolved = true;
10982
- resolve16(value);
11055
+ resolve17(value);
10983
11056
  }
10984
11057
  };
10985
11058
  const req = node_https_1.default.get(url, { timeout: REQUEST_TIMEOUT_MS }, (res) => {
@@ -11073,7 +11146,7 @@ var require_pick_target = __commonJS({
11073
11146
  });
11074
11147
 
11075
11148
  // ../update-core/dist/index.js
11076
- var require_dist2 = __commonJS({
11149
+ var require_dist3 = __commonJS({
11077
11150
  "../update-core/dist/index.js"(exports) {
11078
11151
  "use strict";
11079
11152
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -12799,7 +12872,7 @@ function getStringFromEnv(key) {
12799
12872
  }
12800
12873
 
12801
12874
  // ../../node_modules/@opentelemetry/core/build/esm/version.js
12802
- var VERSION2 = "2.11.0";
12875
+ var VERSION2 = "2.12.0";
12803
12876
 
12804
12877
  // ../../node_modules/@opentelemetry/semantic-conventions/build/esm/stable_attributes.js
12805
12878
  var ATTR_EXCEPTION_MESSAGE = "exception.message";
@@ -12919,8 +12992,8 @@ var Deferred = class {
12919
12992
  _resolve;
12920
12993
  _reject;
12921
12994
  constructor() {
12922
- this._promise = new Promise((resolve16, reject) => {
12923
- this._resolve = resolve16;
12995
+ this._promise = new Promise((resolve17, reject) => {
12996
+ this._resolve = resolve17;
12924
12997
  this._reject = reject;
12925
12998
  });
12926
12999
  }
@@ -13605,7 +13678,7 @@ var LoggerMetrics = class {
13605
13678
  };
13606
13679
 
13607
13680
  // ../../node_modules/@opentelemetry/sdk-logs/build/esm/version.js
13608
- var VERSION3 = "0.222.0";
13681
+ var VERSION3 = "0.223.0";
13609
13682
 
13610
13683
  // ../../node_modules/@opentelemetry/sdk-logs/build/esm/internal/LoggerProviderSharedState.js
13611
13684
  var DEFAULT_LOGGER_CONFIG = {
@@ -13813,8 +13886,8 @@ var ExportOperation = class {
13813
13886
  _metrics;
13814
13887
  _exportScheduledResolve;
13815
13888
  constructor(exporter, logRecords, exportTimeoutMillis, metrics) {
13816
- this._exportScheduledPromise = new Promise((resolve16) => {
13817
- this._exportScheduledResolve = resolve16;
13889
+ this._exportScheduledPromise = new Promise((resolve17) => {
13890
+ this._exportScheduledResolve = resolve17;
13818
13891
  });
13819
13892
  this._exportCompleted = this._executeExport(exporter, logRecords, exportTimeoutMillis);
13820
13893
  this._metrics = metrics;
@@ -13839,7 +13912,7 @@ var ExportOperation = class {
13839
13912
  }
13840
13913
  }
13841
13914
  async _exportWithTimeout(exporter, logRecords, exportTimeoutMillis) {
13842
- return new Promise((resolve16, reject) => {
13915
+ return new Promise((resolve17, reject) => {
13843
13916
  const timer = setTimeout(() => {
13844
13917
  reject(new Error("Timeout"));
13845
13918
  }, exportTimeoutMillis);
@@ -13847,7 +13920,7 @@ var ExportOperation = class {
13847
13920
  this._metrics.finishLogs(logRecords.length, result.error);
13848
13921
  clearTimeout(timer);
13849
13922
  if (result.code === ExportResultCode.SUCCESS) {
13850
- resolve16();
13923
+ resolve17();
13851
13924
  } else {
13852
13925
  reject(result.error ?? new Error("BatchLogRecordProcessor: log record export failed"));
13853
13926
  }
@@ -14254,7 +14327,7 @@ var ATTR_SERVER_PORT = "server.port";
14254
14327
  var ATTR_ERROR_TYPE2 = "error.type";
14255
14328
 
14256
14329
  // ../../node_modules/@opentelemetry/otlp-exporter-base/build/esm/version.js
14257
- var VERSION4 = "0.222.0";
14330
+ var VERSION4 = "0.223.0";
14258
14331
 
14259
14332
  // ../../node_modules/@opentelemetry/otlp-exporter-base/build/esm/ExporterMetrics.js
14260
14333
  var componentCounter2 = /* @__PURE__ */ new Map();
@@ -14628,7 +14701,7 @@ function parseRetryAfterToMills(retryAfter) {
14628
14701
  var DEFAULT_USER_AGENT = `OTel-OTLP-Exporter-JavaScript/${VERSION4}`;
14629
14702
  var MAX_RESPONSE_BODY_SIZE = 4 * 1024 * 1024;
14630
14703
  function sendWithHttp(request, url, headers, compression, userAgent, agent, data, timeoutMillis) {
14631
- return new Promise((resolve16) => {
14704
+ return new Promise((resolve17) => {
14632
14705
  const parsedUrl = new URL(url);
14633
14706
  if (userAgent) {
14634
14707
  headers["User-Agent"] = `${userAgent} ${DEFAULT_USER_AGENT}`;
@@ -14647,7 +14720,7 @@ function sendWithHttp(request, url, headers, compression, userAgent, agent, data
14647
14720
  responseSize += chunk.length;
14648
14721
  if (responseSize > MAX_RESPONSE_BODY_SIZE) {
14649
14722
  const sizeError = new Error(`OTLP export response body exceeded size limit of ${MAX_RESPONSE_BODY_SIZE} bytes`);
14650
- resolve16({ status: "failure", error: sizeError });
14723
+ resolve17({ status: "failure", error: sizeError });
14651
14724
  res.destroy();
14652
14725
  return;
14653
14726
  }
@@ -14655,18 +14728,18 @@ function sendWithHttp(request, url, headers, compression, userAgent, agent, data
14655
14728
  });
14656
14729
  res.on("end", () => {
14657
14730
  if (res.statusCode && res.statusCode <= 299) {
14658
- resolve16({
14731
+ resolve17({
14659
14732
  status: "success",
14660
14733
  data: Buffer.concat(responseData)
14661
14734
  });
14662
14735
  } else if (res.statusCode && isExportHTTPErrorRetryable(res.statusCode)) {
14663
- resolve16({
14736
+ resolve17({
14664
14737
  status: "retryable",
14665
14738
  retryInMillis: parseRetryAfterToMills(res.headers["retry-after"])
14666
14739
  });
14667
14740
  } else {
14668
14741
  const error = new OTLPExporterError(res.statusMessage, res.statusCode, Buffer.concat(responseData).toString());
14669
- resolve16({
14742
+ resolve17({
14670
14743
  status: "failure",
14671
14744
  error
14672
14745
  });
@@ -14674,17 +14747,17 @@ function sendWithHttp(request, url, headers, compression, userAgent, agent, data
14674
14747
  });
14675
14748
  res.on("error", (error) => {
14676
14749
  if (res.statusCode && res.statusCode <= 299) {
14677
- resolve16({
14750
+ resolve17({
14678
14751
  status: "success"
14679
14752
  });
14680
14753
  } else if (res.statusCode && isExportHTTPErrorRetryable(res.statusCode)) {
14681
- resolve16({
14754
+ resolve17({
14682
14755
  status: "retryable",
14683
14756
  error,
14684
14757
  retryInMillis: parseRetryAfterToMills(res.headers["retry-after"])
14685
14758
  });
14686
14759
  } else {
14687
- resolve16({
14760
+ resolve17({
14688
14761
  status: "failure",
14689
14762
  error
14690
14763
  });
@@ -14693,26 +14766,26 @@ function sendWithHttp(request, url, headers, compression, userAgent, agent, data
14693
14766
  });
14694
14767
  req.setTimeout(timeoutMillis, () => {
14695
14768
  req.destroy();
14696
- resolve16({
14769
+ resolve17({
14697
14770
  status: "retryable",
14698
14771
  error: new Error("Request timed out")
14699
14772
  });
14700
14773
  });
14701
14774
  req.on("error", (error) => {
14702
14775
  if (isHttpTransportNetworkErrorRetryable(error)) {
14703
- resolve16({
14776
+ resolve17({
14704
14777
  status: "retryable",
14705
14778
  error
14706
14779
  });
14707
14780
  } else {
14708
- resolve16({
14781
+ resolve17({
14709
14782
  status: "failure",
14710
14783
  error
14711
14784
  });
14712
14785
  }
14713
14786
  });
14714
14787
  compressAndSend(req, compression, data, (error) => {
14715
- resolve16({
14788
+ resolve17({
14716
14789
  status: "failure",
14717
14790
  error
14718
14791
  });
@@ -14802,9 +14875,9 @@ var RetryingTransport = class {
14802
14875
  this._transport = transport;
14803
14876
  }
14804
14877
  retry(data, timeoutMillis, inMillis) {
14805
- return new Promise((resolve16, reject) => {
14878
+ return new Promise((resolve17, reject) => {
14806
14879
  setTimeout(() => {
14807
- this._transport.send(data, timeoutMillis).then(resolve16, reject);
14880
+ this._transport.send(data, timeoutMillis).then(resolve17, reject);
14808
14881
  }, inMillis);
14809
14882
  });
14810
14883
  }
@@ -14939,7 +15012,7 @@ function appendRootPathToUrlIfNeeded(url) {
14939
15012
  return void 0;
14940
15013
  }
14941
15014
  }
14942
- function appendResourcePathToUrl(url, path26) {
15015
+ function appendResourcePathToUrl(url, path28) {
14943
15016
  try {
14944
15017
  new URL(url);
14945
15018
  } catch {
@@ -14949,11 +15022,11 @@ function appendResourcePathToUrl(url, path26) {
14949
15022
  if (!url.endsWith("/")) {
14950
15023
  url = url + "/";
14951
15024
  }
14952
- url += path26;
15025
+ url += path28;
14953
15026
  try {
14954
15027
  new URL(url);
14955
15028
  } catch {
14956
- diag2.warn(`Configuration: Provided URL appended with '${path26}' is not a valid URL, using 'undefined' instead of '${url}'`);
15029
+ diag2.warn(`Configuration: Provided URL appended with '${path28}' is not a valid URL, using 'undefined' instead of '${url}'`);
14957
15030
  return void 0;
14958
15031
  }
14959
15032
  return url;
@@ -15228,7 +15301,7 @@ function updateConfig(mutate, scope = "global", options = {}) {
15228
15301
  }
15229
15302
 
15230
15303
  // ../configuration-core/src/secrets.ts
15231
- var import_dotenv = __toESM(require_main(), 1);
15304
+ var import_dotenv = __toESM(require_dist(), 1);
15232
15305
  import * as fs4 from "node:fs";
15233
15306
  import * as path5 from "node:path";
15234
15307
 
@@ -15374,7 +15447,7 @@ var CONFIG_SCHEMA = [
15374
15447
  // nominal here — the project scope of a global-only key is never read.
15375
15448
  {
15376
15449
  key: "scripts.maxTimeoutMs",
15377
- description: `Upper bound, in milliseconds, on the time limit a flow \`script\` step may ask for (default 300000 \u2014 five minutes). Bounds how long one script can occupy the host. Values below ${MIN_SCRIPT_TIMEOUT_MS} ms are refused: the step starts a Node process before the script runs, so a smaller ceiling ends a script that did nothing wrong.`,
15450
+ description: `Upper bound, in milliseconds, on the time limit an e2e test \`script\` step may ask for (default 300000 \u2014 five minutes). Bounds how long one script can occupy the host. Values below ${MIN_SCRIPT_TIMEOUT_MS} ms are refused: the step starts a Node process before the script runs, so a smaller ceiling ends a script that did nothing wrong.`,
15378
15451
  scopes: ["global"],
15379
15452
  parse: (raw) => {
15380
15453
  const value = asPositiveInteger(raw);
@@ -15387,7 +15460,7 @@ var CONFIG_SCHEMA = [
15387
15460
  },
15388
15461
  {
15389
15462
  key: "scripts.heapLimitMb",
15390
- description: `Old-space heap limit, in MiB, given to each flow \`script\` process (default 512). Values below ${MIN_SCRIPT_HEAP_LIMIT_MB} MiB are refused: that is already below what importing a real npm dependency needs, and under about 5 MiB the process dies inside V8's own startup before any script runs.`,
15463
+ description: `Old-space heap limit, in MiB, given to each e2e test \`script\` process (default 512). Values below ${MIN_SCRIPT_HEAP_LIMIT_MB} MiB are refused: that is already below what importing a real npm dependency needs, and under about 5 MiB the process dies inside V8's own startup before any script runs.`,
15391
15464
  scopes: ["global"],
15392
15465
  parse: (raw) => {
15393
15466
  const value = asPositiveInteger(raw);
@@ -15653,8 +15726,27 @@ var FLOW_FILE_NAME_PATTERN = new RegExp(`^${FLOW_NAME_CHARSET}\\.yaml$`);
15653
15726
  var SCRIPT_FILE_NAME_PATTERN = new RegExp(`^${FLOW_NAME_CHARSET}\\.mjs$`);
15654
15727
 
15655
15728
  // ../registry/src/flow-file-refs.ts
15729
+ import * as fs7 from "node:fs/promises";
15730
+ import * as path9 from "node:path";
15731
+
15732
+ // ../registry/src/e2e-dirs.ts
15656
15733
  import * as fs6 from "node:fs/promises";
15657
15734
  import * as path8 from "node:path";
15735
+ var E2E_DIR = path8.join(".argent", "e2e");
15736
+ var LEGACY_E2E_DIRS = Object.freeze([path8.join(".argent", "flows")]);
15737
+ var E2E_DIRS = Object.freeze([E2E_DIR, ...LEGACY_E2E_DIRS]);
15738
+ var E2E_DIR_NAMES = E2E_DIRS.map((dir) => path8.basename(dir));
15739
+
15740
+ // ../registry/src/tool-ids.ts
15741
+ var TOOL_ID_ALIASES = Object.freeze({
15742
+ "flow-start-recording": "e2e-start-recording",
15743
+ "flow-add-step": "e2e-add-step",
15744
+ "flow-add-echo": "e2e-add-echo",
15745
+ "flow-add-script": "e2e-add-script",
15746
+ "flow-finish-recording": "e2e-finish-recording",
15747
+ "flow-read-prerequisite": "e2e-read-prerequisite",
15748
+ "flow-execute": "e2e-execute"
15749
+ });
15658
15750
 
15659
15751
  // ../registry/src/failure-codes.ts
15660
15752
  var FAILURE_CODES = {
@@ -15773,6 +15865,11 @@ var FAILURE_CODES = {
15773
15865
  // a device that is not foldable, no hinge route, a remote simulator.
15774
15866
  IOS_FOLD_FAILED: "IOS_FOLD_FAILED",
15775
15867
  IOS_FOLD_UNSUPPORTED: "IOS_FOLD_UNSUPPORTED",
15868
+ // The hinge of a foldable Android emulator: the console refused the move or
15869
+ // the guest never committed the state vs. nothing to fold — a phone profile,
15870
+ // a physical device.
15871
+ ANDROID_FOLD_FAILED: "ANDROID_FOLD_FAILED",
15872
+ ANDROID_FOLD_UNSUPPORTED: "ANDROID_FOLD_UNSUPPORTED",
15776
15873
  PASTE_CLIPBOARD_SET_FAILED: "PASTE_CLIPBOARD_SET_FAILED",
15777
15874
  PASTE_CLIPBOARD_UNSUPPORTED: "PASTE_CLIPBOARD_UNSUPPORTED",
15778
15875
  SETTINGS_PERMISSION_UNSUPPORTED: "SETTINGS_PERMISSION_UNSUPPORTED",
@@ -16220,6 +16317,7 @@ var ALLOWED = {
16220
16317
  "tool:invoke": {
16221
16318
  device_provider: DEVICE_PROVIDER,
16222
16319
  tool: TOOL_NAME,
16320
+ alias_used: bool,
16223
16321
  tool_invocation_id: UUID,
16224
16322
  platform: PLATFORM,
16225
16323
  device_kind: DEVICE_KIND,
@@ -16228,6 +16326,7 @@ var ALLOWED = {
16228
16326
  "tool:complete": {
16229
16327
  device_provider: DEVICE_PROVIDER,
16230
16328
  tool: TOOL_NAME,
16329
+ alias_used: bool,
16231
16330
  tool_invocation_id: UUID,
16232
16331
  platform: PLATFORM,
16233
16332
  device_kind: DEVICE_KIND,
@@ -16237,6 +16336,7 @@ var ALLOWED = {
16237
16336
  "tool:fail": {
16238
16337
  device_provider: DEVICE_PROVIDER,
16239
16338
  tool: TOOL_NAME,
16339
+ alias_used: bool,
16240
16340
  tool_invocation_id: UUID,
16241
16341
  platform: PLATFORM,
16242
16342
  device_kind: DEVICE_KIND,
@@ -16255,6 +16355,7 @@ var ALLOWED = {
16255
16355
  },
16256
16356
  "cli:run_fail": {
16257
16357
  tool: TOOL_NAME,
16358
+ alias_used: bool,
16258
16359
  duration_ms: DURATION_MS,
16259
16360
  ...FAILURE_SIGNAL
16260
16361
  },
@@ -16351,9 +16452,9 @@ function isReplitAgent(env) {
16351
16452
  }
16352
16453
  var DEVIN_MARKER_PATH = "/opt/.devin";
16353
16454
  var JULES_MARKER_PATH = "/opt/environment_summary.sh";
16354
- function safeExists(fileExists, path26) {
16455
+ function safeExists(fileExists, path28) {
16355
16456
  try {
16356
- return fileExists(path26);
16457
+ return fileExists(path28);
16357
16458
  } catch {
16358
16459
  return false;
16359
16460
  }
@@ -16774,7 +16875,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
16774
16875
  var SESSION_ID = randomUUID4();
16775
16876
  function readCliVersion() {
16776
16877
  if (true) {
16777
- return "0.29.1-next.9";
16878
+ return "0.30.0";
16778
16879
  }
16779
16880
  return "0.0.0";
16780
16881
  }
@@ -16807,8 +16908,8 @@ function getBaseProps(runtime) {
16807
16908
 
16808
16909
  // ../telemetry/src/identity.ts
16809
16910
  import * as crypto2 from "node:crypto";
16810
- import * as fs7 from "node:fs";
16811
- import * as path9 from "node:path";
16911
+ import * as fs8 from "node:fs";
16912
+ import * as path10 from "node:path";
16812
16913
  var FINGERPRINT_PATTERN = /^[0-9a-f]{64}$/;
16813
16914
  var cached = null;
16814
16915
  var fingerprintResolved = null;
@@ -16915,66 +17016,66 @@ function resolveFingerprintOnce(resolveFingerprint) {
16915
17016
  function isCorruptIdFile(filePath) {
16916
17017
  let isRegularFile;
16917
17018
  try {
16918
- isRegularFile = fs7.lstatSync(filePath).isFile();
17019
+ isRegularFile = fs8.lstatSync(filePath).isFile();
16919
17020
  } catch {
16920
17021
  return false;
16921
17022
  }
16922
17023
  return isRegularFile && tryReadId(filePath) === null;
16923
17024
  }
16924
17025
  function writeIdFileAtomic(finalPath, id) {
16925
- fs7.mkdirSync(argentHomeDir(), { recursive: true });
17026
+ fs8.mkdirSync(argentHomeDir(), { recursive: true });
16926
17027
  let occupant;
16927
17028
  try {
16928
- occupant = fs7.lstatSync(finalPath);
17029
+ occupant = fs8.lstatSync(finalPath);
16929
17030
  } catch (err) {
16930
17031
  if (err.code !== "ENOENT") throw err;
16931
17032
  }
16932
17033
  if (occupant && !occupant.isFile()) {
16933
17034
  throw new Error("telemetry: refusing to replace a non-regular file at the identity path");
16934
17035
  }
16935
- const tmpPath = path9.join(
17036
+ const tmpPath = path10.join(
16936
17037
  argentHomeDir(),
16937
17038
  `.telemetry-id.tmp.${process.pid}.${crypto2.randomUUID()}`
16938
17039
  );
16939
- const fd = fs7.openSync(tmpPath, "wx", 384);
17040
+ const fd = fs8.openSync(tmpPath, "wx", 384);
16940
17041
  try {
16941
17042
  try {
16942
- fs7.writeSync(fd, id);
16943
- fs7.fsyncSync(fd);
17043
+ fs8.writeSync(fd, id);
17044
+ fs8.fsyncSync(fd);
16944
17045
  } finally {
16945
- fs7.closeSync(fd);
17046
+ fs8.closeSync(fd);
16946
17047
  }
16947
- fs7.renameSync(tmpPath, finalPath);
17048
+ fs8.renameSync(tmpPath, finalPath);
16948
17049
  } finally {
16949
17050
  try {
16950
- fs7.unlinkSync(tmpPath);
17051
+ fs8.unlinkSync(tmpPath);
16951
17052
  } catch {
16952
17053
  }
16953
17054
  }
16954
17055
  }
16955
17056
  function mintRandomId(finalPath) {
16956
- fs7.mkdirSync(argentHomeDir(), { recursive: true });
17057
+ fs8.mkdirSync(argentHomeDir(), { recursive: true });
16957
17058
  let value = crypto2.randomUUID();
16958
17059
  for (let attempt = 0; attempt < 3; attempt++) {
16959
- const tmpPath = path9.join(
17060
+ const tmpPath = path10.join(
16960
17061
  argentHomeDir(),
16961
17062
  `.telemetry-id.tmp.${process.pid}.${crypto2.randomUUID()}`
16962
17063
  );
16963
17064
  let fd;
16964
17065
  try {
16965
- fd = fs7.openSync(tmpPath, "wx", 384);
17066
+ fd = fs8.openSync(tmpPath, "wx", 384);
16966
17067
  } catch (err) {
16967
17068
  if (err.code === "EEXIST") continue;
16968
17069
  throw err;
16969
17070
  }
16970
17071
  try {
16971
17072
  try {
16972
- fs7.writeSync(fd, value);
16973
- fs7.fsyncSync(fd);
17073
+ fs8.writeSync(fd, value);
17074
+ fs8.fsyncSync(fd);
16974
17075
  } finally {
16975
- fs7.closeSync(fd);
17076
+ fs8.closeSync(fd);
16976
17077
  }
16977
- fs7.linkSync(tmpPath, finalPath);
17078
+ fs8.linkSync(tmpPath, finalPath);
16978
17079
  cached = { path: finalPath, id: value };
16979
17080
  return value;
16980
17081
  } catch (err) {
@@ -16993,7 +17094,7 @@ function mintRandomId(finalPath) {
16993
17094
  throw err;
16994
17095
  } finally {
16995
17096
  try {
16996
- fs7.unlinkSync(tmpPath);
17097
+ fs8.unlinkSync(tmpPath);
16997
17098
  } catch {
16998
17099
  }
16999
17100
  }
@@ -17001,12 +17102,12 @@ function mintRandomId(finalPath) {
17001
17102
  throw new Error("telemetry: failed to create identity after retries");
17002
17103
  }
17003
17104
  function claimCorruptOccupant(finalPath) {
17004
- const claimed = path9.join(
17105
+ const claimed = path10.join(
17005
17106
  argentHomeDir(),
17006
17107
  `.telemetry-id.corrupt.${process.pid}.${crypto2.randomUUID()}`
17007
17108
  );
17008
17109
  try {
17009
- fs7.renameSync(finalPath, claimed);
17110
+ fs8.renameSync(finalPath, claimed);
17010
17111
  } catch {
17011
17112
  return null;
17012
17113
  }
@@ -17015,7 +17116,7 @@ function claimCorruptOccupant(finalPath) {
17015
17116
  grabbed = tryReadId(claimed);
17016
17117
  } finally {
17017
17118
  try {
17018
- fs7.unlinkSync(claimed);
17119
+ fs8.unlinkSync(claimed);
17019
17120
  } catch {
17020
17121
  }
17021
17122
  }
@@ -17024,7 +17125,7 @@ function claimCorruptOccupant(finalPath) {
17024
17125
  function deleteAnonId() {
17025
17126
  cached = null;
17026
17127
  try {
17027
- fs7.unlinkSync(identityFilePath());
17128
+ fs8.unlinkSync(identityFilePath());
17028
17129
  } catch (err) {
17029
17130
  if (err.code !== "ENOENT") throw err;
17030
17131
  }
@@ -17032,9 +17133,9 @@ function deleteAnonId() {
17032
17133
  function tryReadId(filePath) {
17033
17134
  let raw;
17034
17135
  try {
17035
- const stats = fs7.lstatSync(filePath);
17136
+ const stats = fs8.lstatSync(filePath);
17036
17137
  if (!stats.isFile()) return null;
17037
- raw = fs7.readFileSync(filePath, "utf8");
17138
+ raw = fs8.readFileSync(filePath, "utf8");
17038
17139
  } catch (err) {
17039
17140
  if (err.code === "ENOENT") return null;
17040
17141
  return null;
@@ -17048,12 +17149,12 @@ function tryReadId(filePath) {
17048
17149
  import { execFileSync, spawn } from "node:child_process";
17049
17150
 
17050
17151
  // ../native-devtools-ios/src/index.ts
17051
- import * as path10 from "node:path";
17052
- import * as fs8 from "node:fs";
17053
- var DYLIB_DIR = process.env.ARGENT_NATIVE_DEVTOOLS_DIR ?? path10.join(__dirname, "..", "dylibs");
17054
- var BIN_DIR = process.env.ARGENT_SIMULATOR_SERVER_DIR ?? path10.join(__dirname, "..", "bin");
17055
- var DYLIB_TCP_DIR = process.env.ARGENT_NATIVE_DEVTOOLS_TCP_DIR ?? path10.join(DYLIB_DIR, "tcp");
17056
- var DYLIB_TVOS_DIR = path10.join(DYLIB_DIR, "tvos");
17152
+ import * as path11 from "node:path";
17153
+ import * as fs9 from "node:fs";
17154
+ var DYLIB_DIR = process.env.ARGENT_NATIVE_DEVTOOLS_DIR ?? path11.join(__dirname, "..", "dylibs");
17155
+ var BIN_DIR = process.env.ARGENT_SIMULATOR_SERVER_DIR ?? path11.join(__dirname, "..", "bin");
17156
+ var DYLIB_TCP_DIR = process.env.ARGENT_NATIVE_DEVTOOLS_TCP_DIR ?? path11.join(DYLIB_DIR, "tcp");
17157
+ var DYLIB_TVOS_DIR = path11.join(DYLIB_DIR, "tvos");
17057
17158
  function hostPlatformKey() {
17058
17159
  if (process.platform === "linux" && process.arch === "arm64") {
17059
17160
  return "linux-arm64";
@@ -17064,14 +17165,14 @@ function simulatorServerBinaryName() {
17064
17165
  return process.platform === "win32" ? "simulator-server.exe" : "simulator-server";
17065
17166
  }
17066
17167
  function platformBinDir() {
17067
- return path10.join(BIN_DIR, hostPlatformKey());
17168
+ return path11.join(BIN_DIR, hostPlatformKey());
17068
17169
  }
17069
17170
  function simulatorServerBinaryPath() {
17070
17171
  const binaryName = simulatorServerBinaryName();
17071
- const p = path10.join(platformBinDir(), binaryName);
17072
- if (!fs8.existsSync(p)) {
17073
- const flat = path10.join(BIN_DIR, binaryName);
17074
- const migrationHint = fs8.existsSync(flat) ? ` Found a binary at the old flat path ${flat}; move it to ${p} or update ARGENT_SIMULATOR_SERVER_DIR to point at the parent of the platform subdirectory.` : "";
17172
+ const p = path11.join(platformBinDir(), binaryName);
17173
+ if (!fs9.existsSync(p)) {
17174
+ const flat = path11.join(BIN_DIR, binaryName);
17175
+ const migrationHint = fs9.existsSync(flat) ? ` Found a binary at the old flat path ${flat}; move it to ${p} or update ARGENT_SIMULATOR_SERVER_DIR to point at the parent of the platform subdirectory.` : "";
17075
17176
  throw new Error(
17076
17177
  `simulator-server binary not found for platform "${hostPlatformKey()}" at ${p}. Supported hosts today: darwin, linux (x86_64 and arm64), win32.${migrationHint}`
17077
17178
  );
@@ -17100,12 +17201,12 @@ function resolveHostFingerprint() {
17100
17201
  }
17101
17202
  }
17102
17203
  function resolveHostFingerprintAsync() {
17103
- return new Promise((resolve16) => {
17204
+ return new Promise((resolve17) => {
17104
17205
  let binary;
17105
17206
  try {
17106
17207
  binary = simulatorServerBinaryPath();
17107
17208
  } catch {
17108
- resolve16(null);
17209
+ resolve17(null);
17109
17210
  return;
17110
17211
  }
17111
17212
  let settled = false;
@@ -17118,7 +17219,7 @@ function resolveHostFingerprintAsync() {
17118
17219
  child?.kill("SIGKILL");
17119
17220
  } catch {
17120
17221
  }
17121
- resolve16(value);
17222
+ resolve17(value);
17122
17223
  };
17123
17224
  const watchdog = setTimeout(() => finish(null), FINGERPRINT_TIMEOUT_MS);
17124
17225
  watchdog.unref?.();
@@ -17151,14 +17252,14 @@ function resolveHostFingerprintAsync() {
17151
17252
  }
17152
17253
 
17153
17254
  // ../telemetry/src/consent.ts
17154
- import * as fs9 from "node:fs";
17255
+ import * as fs10 from "node:fs";
17155
17256
  var cache = /* @__PURE__ */ new Map();
17156
17257
  var sessionOverride = null;
17157
17258
  function readConfigOverrideAt(filePath) {
17158
17259
  const miss = { mtimeMs: null, fingerprint: null, enabledOverride: null };
17159
17260
  let stats;
17160
17261
  try {
17161
- stats = fs9.lstatSync(filePath);
17262
+ stats = fs10.lstatSync(filePath);
17162
17263
  } catch {
17163
17264
  cache.set(filePath, miss);
17164
17265
  return null;
@@ -17175,7 +17276,7 @@ function readConfigOverrideAt(filePath) {
17175
17276
  }
17176
17277
  let parsedEnabled = null;
17177
17278
  try {
17178
- const raw = fs9.readFileSync(filePath, "utf8");
17279
+ const raw = fs10.readFileSync(filePath, "utf8");
17179
17280
  const json = JSON.parse(raw);
17180
17281
  if (json && typeof json === "object") {
17181
17282
  const t2 = json.telemetry;
@@ -17388,7 +17489,7 @@ var DRAIN_GRACE_MS = 250;
17388
17489
  async function raceDrain(client2, timeoutMs) {
17389
17490
  await Promise.race([
17390
17491
  client2.shutdown(timeoutMs),
17391
- new Promise((resolve16) => setTimeout(resolve16, timeoutMs + DRAIN_GRACE_MS).unref())
17492
+ new Promise((resolve17) => setTimeout(resolve17, timeoutMs + DRAIN_GRACE_MS).unref())
17392
17493
  ]);
17393
17494
  }
17394
17495
  async function shutdown(timeoutMs = SHORT_FLUSH_TIMEOUT_MS) {
@@ -17408,8 +17509,8 @@ async function shutdown(timeoutMs = SHORT_FLUSH_TIMEOUT_MS) {
17408
17509
  }
17409
17510
 
17410
17511
  // ../argent-installer/src/mcp-configs.ts
17411
- import * as fs16 from "node:fs";
17412
- import * as path17 from "node:path";
17512
+ import * as fs17 from "node:fs";
17513
+ import * as path18 from "node:path";
17413
17514
  import { execFileSync as execFileSync4 } from "node:child_process";
17414
17515
  import { homedir as homedir4 } from "node:os";
17415
17516
 
@@ -17423,8 +17524,8 @@ var CURSOR_ALLOWLIST_PATTERN = "argent:*";
17423
17524
 
17424
17525
  // ../argent-installer/src/utils.ts
17425
17526
  var import_semver3 = __toESM(require_semver2(), 1);
17426
- import * as fs15 from "node:fs";
17427
- import * as path16 from "node:path";
17527
+ import * as fs16 from "node:fs";
17528
+ import * as path17 from "node:path";
17428
17529
  import * as dns from "node:dns";
17429
17530
  import * as os2 from "node:os";
17430
17531
  import { execFileSync as execFileSync3, execSync } from "node:child_process";
@@ -18371,7 +18472,7 @@ function stringify(obj, { maxDepth = 1e3, numbersAsFloat = false, strictTemporal
18371
18472
  }
18372
18473
 
18373
18474
  // ../argent-installer/src/utils.ts
18374
- var import_yaml = __toESM(require_dist(), 1);
18475
+ var import_yaml = __toESM(require_dist2(), 1);
18375
18476
 
18376
18477
  // ../../node_modules/jsonc-parser/lib/esm/impl/scanner.js
18377
18478
  function createScanner(text2, ignoreTrivia = false) {
@@ -19169,12 +19270,12 @@ function parseTree(text2, errors = [], options = ParseOptions.DEFAULT) {
19169
19270
  }
19170
19271
  return result;
19171
19272
  }
19172
- function findNodeAtLocation(root, path26) {
19273
+ function findNodeAtLocation(root, path28) {
19173
19274
  if (!root) {
19174
19275
  return void 0;
19175
19276
  }
19176
19277
  let node = root;
19177
- for (let segment of path26) {
19278
+ for (let segment of path28) {
19178
19279
  if (typeof segment === "string") {
19179
19280
  if (node.type !== "object" || !Array.isArray(node.children)) {
19180
19281
  return void 0;
@@ -19528,14 +19629,14 @@ function getNodeType(value) {
19528
19629
 
19529
19630
  // ../../node_modules/jsonc-parser/lib/esm/impl/edit.js
19530
19631
  function setProperty(text2, originalPath, value, options) {
19531
- const path26 = originalPath.slice();
19632
+ const path28 = originalPath.slice();
19532
19633
  const errors = [];
19533
19634
  const root = parseTree(text2, errors);
19534
19635
  let parent = void 0;
19535
19636
  let lastSegment = void 0;
19536
- while (path26.length > 0) {
19537
- lastSegment = path26.pop();
19538
- parent = findNodeAtLocation(root, path26);
19637
+ while (path28.length > 0) {
19638
+ lastSegment = path28.pop();
19639
+ parent = findNodeAtLocation(root, path28);
19539
19640
  if (parent === void 0 && value !== void 0) {
19540
19641
  if (typeof lastSegment === "string") {
19541
19642
  value = { [lastSegment]: value };
@@ -19721,8 +19822,8 @@ var ParseErrorCode;
19721
19822
  ParseErrorCode2[ParseErrorCode2["InvalidEscapeCharacter"] = 15] = "InvalidEscapeCharacter";
19722
19823
  ParseErrorCode2[ParseErrorCode2["InvalidCharacter"] = 16] = "InvalidCharacter";
19723
19824
  })(ParseErrorCode || (ParseErrorCode = {}));
19724
- function modify(text2, path26, value, options) {
19725
- return setProperty(text2, path26, value, options);
19825
+ function modify(text2, path28, value, options) {
19826
+ return setProperty(text2, path28, value, options);
19726
19827
  }
19727
19828
  function applyEdits(text2, edits) {
19728
19829
  let sortedEdits = edits.slice(0).sort((a2, b) => {
@@ -19746,21 +19847,21 @@ function applyEdits(text2, edits) {
19746
19847
  }
19747
19848
 
19748
19849
  // ../argent-installer/src/package-root.ts
19749
- import * as fs10 from "node:fs";
19750
- import * as path11 from "node:path";
19751
- function resolvePackageRoot(dirname18) {
19752
- let current = path11.resolve(dirname18);
19850
+ import * as fs11 from "node:fs";
19851
+ import * as path12 from "node:path";
19852
+ function resolvePackageRoot(dirname19) {
19853
+ let current = path12.resolve(dirname19);
19753
19854
  while (true) {
19754
- if (fs10.existsSync(path11.join(current, "package.json"))) return current;
19755
- const parent = path11.dirname(current);
19756
- if (parent === current) return path11.resolve(dirname18);
19855
+ if (fs11.existsSync(path12.join(current, "package.json"))) return current;
19856
+ const parent = path12.dirname(current);
19857
+ if (parent === current) return path12.resolve(dirname19);
19757
19858
  current = parent;
19758
19859
  }
19759
19860
  }
19760
19861
 
19761
19862
  // ../argent-installer/src/package-manager.ts
19762
- import * as fs11 from "node:fs";
19763
- import * as path12 from "node:path";
19863
+ import * as fs12 from "node:fs";
19864
+ import * as path13 from "node:path";
19764
19865
  function formatShellCommand(cmd) {
19765
19866
  const parts = [cmd.bin, ...cmd.args.map((a2) => a2.includes(" ") ? `"${a2}"` : a2)];
19766
19867
  return parts.join(" ");
@@ -19780,7 +19881,7 @@ function asKnownPm(name) {
19780
19881
  }
19781
19882
  function pmFromPackageManagerField(dir) {
19782
19883
  try {
19783
- const pkg = JSON.parse(fs11.readFileSync(path12.join(dir, "package.json"), "utf8"));
19884
+ const pkg = JSON.parse(fs12.readFileSync(path13.join(dir, "package.json"), "utf8"));
19784
19885
  if (typeof pkg.packageManager === "string") {
19785
19886
  return asKnownPm(pkg.packageManager.split("@")[0]);
19786
19887
  }
@@ -19791,7 +19892,7 @@ function pmFromPackageManagerField(dir) {
19791
19892
  }
19792
19893
  function pmFromDevEngines(dir) {
19793
19894
  try {
19794
- const pkg = JSON.parse(fs11.readFileSync(path12.join(dir, "package.json"), "utf8"));
19895
+ const pkg = JSON.parse(fs12.readFileSync(path13.join(dir, "package.json"), "utf8"));
19795
19896
  const devEnginesPm = pkg.devEngines?.packageManager;
19796
19897
  const names = /* @__PURE__ */ new Set();
19797
19898
  for (const entry of Array.isArray(devEnginesPm) ? devEnginesPm : [devEnginesPm]) {
@@ -19804,7 +19905,7 @@ function pmFromDevEngines(dir) {
19804
19905
  }
19805
19906
  }
19806
19907
  function pmFromLockfile(dir) {
19807
- const has = (file) => fs11.existsSync(path12.join(dir, file));
19908
+ const has = (file) => fs12.existsSync(path13.join(dir, file));
19808
19909
  if (has("pnpm-lock.yaml")) return "pnpm";
19809
19910
  if (has("yarn.lock")) return "yarn";
19810
19911
  if (has("bun.lock") || has("bun.lockb")) return "bun";
@@ -19812,15 +19913,15 @@ function pmFromLockfile(dir) {
19812
19913
  return null;
19813
19914
  }
19814
19915
  function pmFromWorkspaceMarker(dir) {
19815
- return fs11.existsSync(path12.join(dir, "pnpm-workspace.yaml")) ? "pnpm" : null;
19916
+ return fs12.existsSync(path13.join(dir, "pnpm-workspace.yaml")) ? "pnpm" : null;
19816
19917
  }
19817
19918
  function detectProjectPackageManager(projectRoot) {
19818
- let dir = path12.resolve(projectRoot);
19919
+ let dir = path13.resolve(projectRoot);
19819
19920
  for (; ; ) {
19820
19921
  const pm = pmFromPackageManagerField(dir) ?? pmFromLockfile(dir) ?? pmFromDevEngines(dir) ?? pmFromWorkspaceMarker(dir);
19821
19922
  if (pm) return pm;
19822
- if (fs11.existsSync(path12.join(dir, ".git"))) break;
19823
- const parent = path12.dirname(dir);
19923
+ if (fs12.existsSync(path13.join(dir, ".git"))) break;
19924
+ const parent = path13.dirname(dir);
19824
19925
  if (parent === dir) break;
19825
19926
  dir = parent;
19826
19927
  }
@@ -19888,19 +19989,19 @@ function localUninstallCommand(pm, pkg) {
19888
19989
  }
19889
19990
 
19890
19991
  // ../argent-installer/src/preflight.ts
19891
- import * as fs12 from "node:fs";
19892
- import * as path13 from "node:path";
19992
+ import * as fs13 from "node:fs";
19993
+ import * as path14 from "node:path";
19893
19994
  function hasProjectPackageJson(projectRoot) {
19894
- return fs12.existsSync(path13.join(projectRoot, "package.json"));
19995
+ return fs13.existsSync(path14.join(projectRoot, "package.json"));
19895
19996
  }
19896
19997
  function isYarnPnp(projectRoot) {
19897
- return fs12.existsSync(path13.join(projectRoot, ".pnp.cjs")) || fs12.existsSync(path13.join(projectRoot, ".pnp.loader.mjs"));
19998
+ return fs13.existsSync(path14.join(projectRoot, ".pnp.cjs")) || fs13.existsSync(path14.join(projectRoot, ".pnp.loader.mjs"));
19898
19999
  }
19899
20000
 
19900
20001
  // ../argent-installer/src/topology.ts
19901
20002
  var import_semver2 = __toESM(require_semver2(), 1);
19902
- import * as fs13 from "node:fs";
19903
- import * as path14 from "node:path";
20003
+ import * as fs14 from "node:fs";
20004
+ import * as path15 from "node:path";
19904
20005
  import { createRequire } from "node:module";
19905
20006
  import { execFileSync as execFileSync2 } from "node:child_process";
19906
20007
  var TEMP_RUNNER_MARKERS = [
@@ -19932,9 +20033,9 @@ function getGloballyInstalledPackageRoot() {
19932
20033
  const binaryPath = getGlobalBinaryPath();
19933
20034
  if (!binaryPath) return null;
19934
20035
  try {
19935
- const realPath = fs13.realpathSync(binaryPath);
19936
- const root = resolvePackageRoot(path14.dirname(realPath));
19937
- const pkg = JSON.parse(fs13.readFileSync(path14.join(root, "package.json"), "utf8"));
20036
+ const realPath = fs14.realpathSync(binaryPath);
20037
+ const root = resolvePackageRoot(path15.dirname(realPath));
20038
+ const pkg = JSON.parse(fs14.readFileSync(path15.join(root, "package.json"), "utf8"));
19938
20039
  return pkg.name === PACKAGE_NAME ? root : null;
19939
20040
  } catch {
19940
20041
  return null;
@@ -19944,7 +20045,7 @@ function getGloballyInstalledVersion() {
19944
20045
  const pkgRoot = getGloballyInstalledPackageRoot();
19945
20046
  if (!pkgRoot) return null;
19946
20047
  try {
19947
- const pkg = JSON.parse(fs13.readFileSync(path14.join(pkgRoot, "package.json"), "utf8"));
20048
+ const pkg = JSON.parse(fs14.readFileSync(path15.join(pkgRoot, "package.json"), "utf8"));
19948
20049
  return pkg.version ?? null;
19949
20050
  } catch {
19950
20051
  return null;
@@ -19953,7 +20054,7 @@ function getGloballyInstalledVersion() {
19953
20054
  function readManifestDeclaration(projectRoot) {
19954
20055
  try {
19955
20056
  const pkg = JSON.parse(
19956
- fs13.readFileSync(path14.join(projectRoot, "package.json"), "utf8")
20057
+ fs14.readFileSync(path15.join(projectRoot, "package.json"), "utf8")
19957
20058
  );
19958
20059
  const spec = pkg.devDependencies?.[PACKAGE_NAME] ?? pkg.dependencies?.[PACKAGE_NAME] ?? pkg.optionalDependencies?.[PACKAGE_NAME];
19959
20060
  return typeof spec === "string" ? spec : null;
@@ -19966,11 +20067,11 @@ function isDeclaredLocally(projectRoot) {
19966
20067
  }
19967
20068
  function resolveLocalArgentDir(projectRoot) {
19968
20069
  try {
19969
- const req = createRequire(path14.join(projectRoot, "package.json"));
19970
- return path14.dirname(req.resolve(`${PACKAGE_NAME}/package.json`));
20070
+ const req = createRequire(path15.join(projectRoot, "package.json"));
20071
+ return path15.dirname(req.resolve(`${PACKAGE_NAME}/package.json`));
19971
20072
  } catch {
19972
- const plain = path14.join(projectRoot, "node_modules", PACKAGE_NAME);
19973
- return fs13.existsSync(path14.join(plain, "package.json")) ? plain : null;
20073
+ const plain = path15.join(projectRoot, "node_modules", PACKAGE_NAME);
20074
+ return fs14.existsSync(path15.join(plain, "package.json")) ? plain : null;
19974
20075
  }
19975
20076
  }
19976
20077
  function probeLocalInstall(projectRoot) {
@@ -19978,7 +20079,7 @@ function probeLocalInstall(projectRoot) {
19978
20079
  if (packageDir) {
19979
20080
  let version;
19980
20081
  try {
19981
- const pkg = JSON.parse(fs13.readFileSync(path14.join(packageDir, "package.json"), "utf8"));
20082
+ const pkg = JSON.parse(fs14.readFileSync(path15.join(packageDir, "package.json"), "utf8"));
19982
20083
  version = pkg.version ?? null;
19983
20084
  } catch {
19984
20085
  version = null;
@@ -20001,8 +20102,8 @@ function getLocallyInstalledVersion(projectRoot) {
20001
20102
  }
20002
20103
  function readLocalPackageVersionUncached(projectRoot) {
20003
20104
  try {
20004
- const pkgPath = path14.join(projectRoot, "node_modules", PACKAGE_NAME, "package.json");
20005
- const pkg = JSON.parse(fs13.readFileSync(pkgPath, "utf8"));
20105
+ const pkgPath = path15.join(projectRoot, "node_modules", PACKAGE_NAME, "package.json");
20106
+ const pkg = JSON.parse(fs14.readFileSync(pkgPath, "utf8"));
20006
20107
  return pkg.version ?? null;
20007
20108
  } catch {
20008
20109
  return null;
@@ -20010,7 +20111,7 @@ function readLocalPackageVersionUncached(projectRoot) {
20010
20111
  }
20011
20112
  function argentBinSubpath(pkgDir) {
20012
20113
  try {
20013
- const pkg = JSON.parse(fs13.readFileSync(path14.join(pkgDir, "package.json"), "utf8"));
20114
+ const pkg = JSON.parse(fs14.readFileSync(path15.join(pkgDir, "package.json"), "utf8"));
20014
20115
  if (typeof pkg.bin === "string") return pkg.bin;
20015
20116
  if (pkg.bin && typeof pkg.bin === "object") {
20016
20117
  return pkg.bin[MCP_BINARY_NAME] ?? Object.values(pkg.bin)[0] ?? null;
@@ -20027,28 +20128,28 @@ function getLocalArgentBinRelPath(projectRoot) {
20027
20128
  if (!binSub) return null;
20028
20129
  let root = projectRoot;
20029
20130
  try {
20030
- root = fs13.realpathSync(projectRoot);
20131
+ root = fs14.realpathSync(projectRoot);
20031
20132
  } catch {
20032
20133
  }
20033
- const stableRel = path14.join("node_modules", PACKAGE_NAME, binSub);
20034
- if (fs13.existsSync(path14.join(root, stableRel))) {
20035
- return stableRel.split(path14.sep).join("/");
20134
+ const stableRel = path15.join("node_modules", PACKAGE_NAME, binSub);
20135
+ if (fs14.existsSync(path15.join(root, stableRel))) {
20136
+ return stableRel.split(path15.sep).join("/");
20036
20137
  }
20037
- const abs = path14.join(pkgDir, binSub);
20038
- if (!fs13.existsSync(abs)) return null;
20039
- return path14.relative(root, abs).split(path14.sep).join("/");
20138
+ const abs = path15.join(pkgDir, binSub);
20139
+ if (!fs14.existsSync(abs)) return null;
20140
+ return path15.relative(root, abs).split(path15.sep).join("/");
20040
20141
  }
20041
20142
 
20042
20143
  // ../argent-installer/src/install-record.ts
20043
- import * as fs14 from "node:fs";
20044
- import * as path15 from "node:path";
20144
+ import * as fs15 from "node:fs";
20145
+ import * as path16 from "node:path";
20045
20146
  function getInstallRecordPath(projectRoot) {
20046
- return path15.join(projectRoot, ".argent", "install.json");
20147
+ return path16.join(projectRoot, ".argent", "install.json");
20047
20148
  }
20048
20149
  function readInstallRecord(projectRoot) {
20049
20150
  try {
20050
20151
  const parsed = JSON.parse(
20051
- fs14.readFileSync(getInstallRecordPath(projectRoot), "utf8")
20152
+ fs15.readFileSync(getInstallRecordPath(projectRoot), "utf8")
20052
20153
  );
20053
20154
  if (parsed && (parsed.mode === "local" || parsed.mode === "global")) return parsed;
20054
20155
  return null;
@@ -20058,17 +20159,17 @@ function readInstallRecord(projectRoot) {
20058
20159
  }
20059
20160
  function writeInstallRecord(projectRoot, record) {
20060
20161
  const recordPath = getInstallRecordPath(projectRoot);
20061
- fs14.mkdirSync(path15.dirname(recordPath), { recursive: true });
20062
- fs14.writeFileSync(recordPath, JSON.stringify(record, null, 2) + "\n");
20162
+ fs15.mkdirSync(path16.dirname(recordPath), { recursive: true });
20163
+ fs15.writeFileSync(recordPath, JSON.stringify(record, null, 2) + "\n");
20063
20164
  }
20064
20165
  function removeInstallRecord(projectRoot) {
20065
20166
  const recordPath = getInstallRecordPath(projectRoot);
20066
20167
  try {
20067
- if (!fs14.existsSync(recordPath)) return false;
20068
- fs14.rmSync(recordPath, { force: true });
20069
- const dir = path15.dirname(recordPath);
20168
+ if (!fs15.existsSync(recordPath)) return false;
20169
+ fs15.rmSync(recordPath, { force: true });
20170
+ const dir = path16.dirname(recordPath);
20070
20171
  try {
20071
- if (fs14.existsSync(dir) && fs14.readdirSync(dir).length === 0) fs14.rmdirSync(dir);
20172
+ if (fs15.existsSync(dir) && fs15.readdirSync(dir).length === 0) fs15.rmdirSync(dir);
20072
20173
  } catch {
20073
20174
  }
20074
20175
  return true;
@@ -20093,58 +20194,12 @@ function resolveInstallModeFromFlags(opts) {
20093
20194
  return null;
20094
20195
  }
20095
20196
 
20096
- // ../argent-installer/src/install-targets.ts
20097
- function parseTargetFlags(args) {
20098
- return { global: args.includes("--global"), local: args.includes("--local") };
20099
- }
20100
- function decideInstallTargets(ctx) {
20101
- const { flags } = ctx;
20102
- if (flags.global || flags.local) {
20103
- const targets = [];
20104
- if (flags.global) targets.push("global");
20105
- if (flags.local) targets.push("local");
20106
- return { kind: "targets", targets, reason: "flags" };
20107
- }
20108
- if (ctx.globalPresent && ctx.localPresent) {
20109
- if (ctx.nonInteractive) {
20110
- return {
20111
- kind: "targets",
20112
- targets: ctx.nonInteractiveBothDefault,
20113
- reason: "noninteractive-both"
20114
- };
20115
- }
20116
- return { kind: "prompt" };
20117
- }
20118
- return { kind: "targets", targets: [ctx.defaultTarget], reason: "single" };
20119
- }
20120
- async function promptInstallTargets(verb) {
20121
- const selected = await multiselect({
20122
- message: `argent is installed both globally and in this project. Which should ${verb === "update" ? "update" : "removal"} affect?`,
20123
- options: [
20124
- {
20125
- value: "global",
20126
- label: "Global install",
20127
- hint: "the argent command on your PATH"
20128
- },
20129
- {
20130
- value: "local",
20131
- label: "This project's devDependency",
20132
- hint: `${PACKAGE_NAME} in this project's node_modules`
20133
- }
20134
- ],
20135
- initialValues: verb === "update" ? ["global", "local"] : ["local"],
20136
- required: true
20137
- });
20138
- if (isCancel(selected)) return "cancel";
20139
- return selected;
20140
- }
20141
-
20142
20197
  // ../argent-installer/src/utils.ts
20143
20198
  var PACKAGE_ROOT = resolvePackageRoot(import.meta.dirname);
20144
20199
  function resolveBundledDir(dirName) {
20145
- const packagedDir = path16.join(PACKAGE_ROOT, dirName);
20146
- if (fs15.existsSync(packagedDir)) return packagedDir;
20147
- return path16.resolve(PACKAGE_ROOT, "..", "skills", dirName);
20200
+ const packagedDir = path17.join(PACKAGE_ROOT, dirName);
20201
+ if (fs16.existsSync(packagedDir)) return packagedDir;
20202
+ return path17.resolve(PACKAGE_ROOT, "..", "skills", dirName);
20148
20203
  }
20149
20204
  var SKILLS_DIR = resolveBundledDir("skills");
20150
20205
  var RULES_DIR = resolveBundledDir("rules");
@@ -20156,23 +20211,30 @@ function buildArgentSkillsSource(version) {
20156
20211
  }
20157
20212
  function listBundledSkills(skillsDir = SKILLS_DIR) {
20158
20213
  try {
20159
- return fs15.readdirSync(skillsDir, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => entry.name).filter((name) => fs15.existsSync(path16.join(skillsDir, name, "SKILL.md"))).sort();
20214
+ return fs16.readdirSync(skillsDir, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => entry.name).filter((name) => fs16.existsSync(path17.join(skillsDir, name, "SKILL.md"))).sort();
20160
20215
  } catch {
20161
20216
  return [];
20162
20217
  }
20163
20218
  }
20164
20219
  function getProjectSkillLockPath(cwd = process.cwd()) {
20165
- return path16.join(cwd, "skills-lock.json");
20220
+ return path17.join(cwd, "skills-lock.json");
20166
20221
  }
20167
20222
  function getGlobalSkillLockPath() {
20168
20223
  const xdgStateHome = process.env.XDG_STATE_HOME;
20169
- if (xdgStateHome) return path16.join(xdgStateHome, "skills", ".skill-lock.json");
20170
- return path16.join(os2.homedir(), ".agents", ".skill-lock.json");
20224
+ if (xdgStateHome) return path17.join(xdgStateHome, "skills", ".skill-lock.json");
20225
+ return path17.join(os2.homedir(), ".agents", ".skill-lock.json");
20171
20226
  }
20172
20227
  var ARGENT_SKILL_PREFIX = "argent-";
20228
+ var LEGACY_ARGENT_SKILL_NAMES = [
20229
+ "argent-create-flow",
20230
+ "argent-qa-flows",
20231
+ "argent-simulator-interact",
20232
+ "argent-simulator-setup",
20233
+ "argent-ios-profiler"
20234
+ ];
20173
20235
  function listArgentSkillsInLock(lockPath) {
20174
20236
  try {
20175
- const raw = fs15.readFileSync(lockPath, "utf8");
20237
+ const raw = fs16.readFileSync(lockPath, "utf8");
20176
20238
  const lock = JSON.parse(raw);
20177
20239
  const tracked = lock.skills ?? {};
20178
20240
  return Object.keys(tracked).filter((name) => name.startsWith(ARGENT_SKILL_PREFIX)).sort();
@@ -20196,20 +20258,20 @@ var PROJECT_ROOT_MARKERS = [
20196
20258
  "skills-lock.json"
20197
20259
  ];
20198
20260
  function resolveProjectRoot2(startDir, homeDir = os2.homedir()) {
20199
- const initialDir = path16.resolve(startDir);
20200
- const home = path16.resolve(homeDir);
20261
+ const initialDir = path17.resolve(startDir);
20262
+ const home = path17.resolve(homeDir);
20201
20263
  let currentDir = initialDir;
20202
20264
  while (true) {
20203
20265
  if (currentDir === home && currentDir !== initialDir) {
20204
20266
  return initialDir;
20205
20267
  }
20206
- if (PROJECT_ROOT_MARKERS.some((marker) => fs15.existsSync(path16.join(currentDir, marker)))) {
20268
+ if (PROJECT_ROOT_MARKERS.some((marker) => fs16.existsSync(path17.join(currentDir, marker)))) {
20207
20269
  return currentDir;
20208
20270
  }
20209
- if (fs15.existsSync(path16.join(currentDir, ".git"))) {
20271
+ if (fs16.existsSync(path17.join(currentDir, ".git"))) {
20210
20272
  return currentDir;
20211
20273
  }
20212
- const parentDir = path16.dirname(currentDir);
20274
+ const parentDir = path17.dirname(currentDir);
20213
20275
  if (parentDir === currentDir) {
20214
20276
  return initialDir;
20215
20277
  }
@@ -20217,20 +20279,20 @@ function resolveProjectRoot2(startDir, homeDir = os2.homedir()) {
20217
20279
  }
20218
20280
  }
20219
20281
  function readToml(filePath) {
20220
- if (!fs15.existsSync(filePath)) return {};
20282
+ if (!fs16.existsSync(filePath)) return {};
20221
20283
  try {
20222
- return parse(fs15.readFileSync(filePath, "utf8"));
20284
+ return parse(fs16.readFileSync(filePath, "utf8"));
20223
20285
  } catch {
20224
20286
  return {};
20225
20287
  }
20226
20288
  }
20227
20289
  function writeToml(filePath, data) {
20228
- fs15.mkdirSync(path16.dirname(filePath), { recursive: true });
20229
- fs15.writeFileSync(filePath, stringify(data) + "\n");
20290
+ fs16.mkdirSync(path17.dirname(filePath), { recursive: true });
20291
+ fs16.writeFileSync(filePath, stringify(data) + "\n");
20230
20292
  }
20231
20293
  function readYaml(filePath) {
20232
- if (!fs15.existsSync(filePath)) return new import_yaml.Document({});
20233
- const text2 = fs15.readFileSync(filePath, "utf8");
20294
+ if (!fs16.existsSync(filePath)) return new import_yaml.Document({});
20295
+ const text2 = fs16.readFileSync(filePath, "utf8");
20234
20296
  const doc = (0, import_yaml.parseDocument)(text2);
20235
20297
  if (doc.errors.length > 0) {
20236
20298
  const messages = doc.errors.map((e) => e.message).join("; ");
@@ -20239,20 +20301,20 @@ function readYaml(filePath) {
20239
20301
  return doc;
20240
20302
  }
20241
20303
  function writeYaml(filePath, doc) {
20242
- fs15.mkdirSync(path16.dirname(filePath), { recursive: true });
20243
- fs15.writeFileSync(filePath, doc.toString({ lineWidth: 0 }));
20304
+ fs16.mkdirSync(path17.dirname(filePath), { recursive: true });
20305
+ fs16.writeFileSync(filePath, doc.toString({ lineWidth: 0 }));
20244
20306
  }
20245
20307
  function readJson(filePath) {
20246
- if (!fs15.existsSync(filePath)) return {};
20308
+ if (!fs16.existsSync(filePath)) return {};
20247
20309
  try {
20248
- return JSON.parse(fs15.readFileSync(filePath, "utf8"));
20310
+ return JSON.parse(fs16.readFileSync(filePath, "utf8"));
20249
20311
  } catch {
20250
20312
  return {};
20251
20313
  }
20252
20314
  }
20253
20315
  function writeJson(filePath, data) {
20254
- fs15.mkdirSync(path16.dirname(filePath), { recursive: true });
20255
- fs15.writeFileSync(filePath, JSON.stringify(data, null, 2) + "\n");
20316
+ fs16.mkdirSync(path17.dirname(filePath), { recursive: true });
20317
+ fs16.writeFileSync(filePath, JSON.stringify(data, null, 2) + "\n");
20256
20318
  }
20257
20319
  var JSONC_FORMATTING = { tabSize: 2, insertSpaces: true };
20258
20320
  function setJsoncIn(text2, jsonPath, value) {
@@ -20260,8 +20322,8 @@ function setJsoncIn(text2, jsonPath, value) {
20260
20322
  return applyEdits(text2, edits);
20261
20323
  }
20262
20324
  function readJsoncFileRaw(filePath) {
20263
- if (!fs15.existsSync(filePath)) return { text: "{}", hadBom: false, wasEmpty: true };
20264
- let text2 = fs15.readFileSync(filePath, "utf8");
20325
+ if (!fs16.existsSync(filePath)) return { text: "{}", hadBom: false, wasEmpty: true };
20326
+ let text2 = fs16.readFileSync(filePath, "utf8");
20265
20327
  const hadBom = text2.charCodeAt(0) === 65279;
20266
20328
  if (hadBom) text2 = text2.slice(1);
20267
20329
  const wasEmpty = text2.trim() === "";
@@ -20281,16 +20343,16 @@ function isEmptyPlainObject(value) {
20281
20343
  }
20282
20344
  function rmEmptyDir(dirPath) {
20283
20345
  try {
20284
- if (!fs15.existsSync(dirPath)) return;
20285
- if (!fs15.statSync(dirPath).isDirectory()) return;
20286
- if (fs15.readdirSync(dirPath).length > 0) return;
20287
- fs15.rmdirSync(dirPath);
20346
+ if (!fs16.existsSync(dirPath)) return;
20347
+ if (!fs16.statSync(dirPath).isDirectory()) return;
20348
+ if (fs16.readdirSync(dirPath).length > 0) return;
20349
+ fs16.rmdirSync(dirPath);
20288
20350
  } catch {
20289
20351
  }
20290
20352
  }
20291
20353
  function readJsonc(filePath) {
20292
- if (!fs15.existsSync(filePath)) return {};
20293
- let raw = fs15.readFileSync(filePath, "utf8");
20354
+ if (!fs16.existsSync(filePath)) return {};
20355
+ let raw = fs16.readFileSync(filePath, "utf8");
20294
20356
  if (raw.charCodeAt(0) === 65279) raw = raw.slice(1);
20295
20357
  if (raw.trim() === "") return {};
20296
20358
  const parsed = parse3(raw, [], { allowTrailingComma: true });
@@ -20309,18 +20371,18 @@ function editJsoncFile(filePath, jsonPath, value) {
20309
20371
  }
20310
20372
  const parsed = parse3(text2, [], { allowTrailingComma: true });
20311
20373
  if (isEmptyPlainObject(parsed)) {
20312
- fs15.rmSync(filePath, { force: true });
20313
- rmEmptyDir(path16.dirname(filePath));
20374
+ fs16.rmSync(filePath, { force: true });
20375
+ rmEmptyDir(path17.dirname(filePath));
20314
20376
  return;
20315
20377
  }
20316
- fs15.mkdirSync(path16.dirname(filePath), { recursive: true });
20378
+ fs16.mkdirSync(path17.dirname(filePath), { recursive: true });
20317
20379
  const out = wasEmpty && !text2.endsWith("\n") ? text2 + "\n" : text2;
20318
- fs15.writeFileSync(filePath, (hadBom ? "\uFEFF" : "") + out);
20380
+ fs16.writeFileSync(filePath, (hadBom ? "\uFEFF" : "") + out);
20319
20381
  }
20320
20382
  var MAX_SYMLINK_HOPS = 40;
20321
20383
  function realpathOrSelf(p) {
20322
20384
  try {
20323
- return fs15.realpathSync(p);
20385
+ return fs16.realpathSync(p);
20324
20386
  } catch {
20325
20387
  return p;
20326
20388
  }
@@ -20330,13 +20392,13 @@ function resolveLinkedDestination(dest) {
20330
20392
  for (let hop = 0; hop < MAX_SYMLINK_HOPS; hop++) {
20331
20393
  let entry;
20332
20394
  try {
20333
- entry = fs15.lstatSync(current);
20395
+ entry = fs16.lstatSync(current);
20334
20396
  } catch {
20335
- return current === dest || dirExists(path16.dirname(current)) ? current : dest;
20397
+ return current === dest || dirExists(path17.dirname(current)) ? current : dest;
20336
20398
  }
20337
20399
  if (!entry.isSymbolicLink()) return current;
20338
20400
  try {
20339
- current = path16.resolve(realpathOrSelf(path16.dirname(current)), fs15.readlinkSync(current));
20401
+ current = path17.resolve(realpathOrSelf(path17.dirname(current)), fs16.readlinkSync(current));
20340
20402
  } catch {
20341
20403
  return dest;
20342
20404
  }
@@ -20344,32 +20406,32 @@ function resolveLinkedDestination(dest) {
20344
20406
  return dest;
20345
20407
  }
20346
20408
  function copyDir(src, dest) {
20347
- if (!fs15.existsSync(src)) return null;
20409
+ if (!fs16.existsSync(src)) return null;
20348
20410
  const target = resolveLinkedDestination(dest);
20349
20411
  copyTree(src, target);
20350
20412
  return target;
20351
20413
  }
20352
20414
  function copyTree(src, dest) {
20353
- const entries = fs15.readdirSync(src, { withFileTypes: true });
20354
- fs15.mkdirSync(dest, { recursive: true });
20415
+ const entries = fs16.readdirSync(src, { withFileTypes: true });
20416
+ fs16.mkdirSync(dest, { recursive: true });
20355
20417
  for (const entry of entries) {
20356
- const from = path16.join(src, entry.name);
20357
- const to = resolveLinkedDestination(path16.join(dest, entry.name));
20418
+ const from = path17.join(src, entry.name);
20419
+ const to = resolveLinkedDestination(path17.join(dest, entry.name));
20358
20420
  if (entry.isDirectory()) copyTree(from, to);
20359
- else fs15.copyFileSync(from, to);
20421
+ else fs16.copyFileSync(from, to);
20360
20422
  }
20361
20423
  }
20362
20424
  function dirExists(p) {
20363
20425
  try {
20364
- return fs15.statSync(p).isDirectory();
20426
+ return fs16.statSync(p).isDirectory();
20365
20427
  } catch {
20366
20428
  return false;
20367
20429
  }
20368
20430
  }
20369
20431
  function getInstalledVersion() {
20370
20432
  try {
20371
- const pkgPath = path16.join(PACKAGE_ROOT, "package.json");
20372
- const pkg = JSON.parse(fs15.readFileSync(pkgPath, "utf8"));
20433
+ const pkgPath = path17.join(PACKAGE_ROOT, "package.json");
20434
+ const pkg = JSON.parse(fs16.readFileSync(pkgPath, "utf8"));
20373
20435
  return pkg.version ?? null;
20374
20436
  } catch {
20375
20437
  return null;
@@ -20417,18 +20479,18 @@ async function isOnline(timeoutMs = PROBE_TIMEOUT_MS) {
20417
20479
  } catch {
20418
20480
  return false;
20419
20481
  }
20420
- return new Promise((resolve16) => {
20421
- const timer = setTimeout(() => resolve16(false), timeoutMs);
20482
+ return new Promise((resolve17) => {
20483
+ const timer = setTimeout(() => resolve17(false), timeoutMs);
20422
20484
  timer.unref();
20423
20485
  dns.lookup(host, (err) => {
20424
20486
  clearTimeout(timer);
20425
- resolve16(!err);
20487
+ resolve17(!err);
20426
20488
  });
20427
20489
  });
20428
20490
  }
20429
20491
 
20430
20492
  // ../argent-installer/src/mcp-configs.ts
20431
- var import_yaml2 = __toESM(require_dist(), 1);
20493
+ var import_yaml2 = __toESM(require_dist2(), 1);
20432
20494
 
20433
20495
  // ../argent-installer/node_modules/escape-string-regexp/index.js
20434
20496
  function escapeStringRegexp(string) {
@@ -20439,7 +20501,7 @@ function escapeStringRegexp(string) {
20439
20501
  }
20440
20502
 
20441
20503
  // ../argent-installer/src/mcp-configs.ts
20442
- var TOOL_SERVER_BUNDLE = path17.join(import.meta.dirname, "tool-server.cjs");
20504
+ var TOOL_SERVER_BUNDLE = path18.join(import.meta.dirname, "tool-server.cjs");
20443
20505
  function getAvailableToolIds() {
20444
20506
  const out = execFileSync4("node", [TOOL_SERVER_BUNDLE, "-t"], { encoding: "utf8" });
20445
20507
  const tools = JSON.parse(out);
@@ -20478,10 +20540,10 @@ function hasCustomizingEnv(entry) {
20478
20540
  }
20479
20541
  function removeDirIfEmpty(dirPath) {
20480
20542
  try {
20481
- if (!fs16.existsSync(dirPath)) return;
20482
- if (!fs16.statSync(dirPath).isDirectory()) return;
20483
- if (fs16.readdirSync(dirPath).length > 0) return;
20484
- fs16.rmdirSync(dirPath);
20543
+ if (!fs17.existsSync(dirPath)) return;
20544
+ if (!fs17.statSync(dirPath).isDirectory()) return;
20545
+ if (fs17.readdirSync(dirPath).length > 0) return;
20546
+ fs17.rmdirSync(dirPath);
20485
20547
  } catch {
20486
20548
  }
20487
20549
  }
@@ -20518,7 +20580,7 @@ function isArgentManagedEntry(entry) {
20518
20580
  return args.length === 1 && args[0] === "mcp";
20519
20581
  case "node": {
20520
20582
  if (args.length !== 2 || args[1] !== "mcp" || !args[0]) return false;
20521
- if (path17.isAbsolute(args[0])) return false;
20583
+ if (path18.isAbsolute(args[0])) return false;
20522
20584
  const normalized = args[0].split("\\").join("/");
20523
20585
  return normalized.includes(`node_modules/${PACKAGE_NAME}/`);
20524
20586
  }
@@ -20532,8 +20594,8 @@ function isArgentManagedEntry(entry) {
20532
20594
  }
20533
20595
  function writeTomlOrRemove(filePath, data) {
20534
20596
  if (Object.keys(data).length === 0) {
20535
- fs16.rmSync(filePath, { force: true });
20536
- removeDirIfEmpty(path17.dirname(filePath));
20597
+ fs17.rmSync(filePath, { force: true });
20598
+ removeDirIfEmpty(path18.dirname(filePath));
20537
20599
  return;
20538
20600
  }
20539
20601
  writeToml(filePath, data);
@@ -20542,12 +20604,12 @@ function dirHasEditorEvidence(dir, looksArgentOnly) {
20542
20604
  return dirExists(dir) && !looksArgentOnly(dir);
20543
20605
  }
20544
20606
  function fileHasEditorEvidence(filePath, looksArgentOnly) {
20545
- return fs16.existsSync(filePath) && !looksArgentOnly(filePath);
20607
+ return fs17.existsSync(filePath) && !looksArgentOnly(filePath);
20546
20608
  }
20547
20609
  function parseJsoncStrict(filePath) {
20548
20610
  let raw;
20549
20611
  try {
20550
- raw = fs16.readFileSync(filePath, "utf8");
20612
+ raw = fs17.readFileSync(filePath, "utf8");
20551
20613
  } catch {
20552
20614
  return null;
20553
20615
  }
@@ -20560,14 +20622,14 @@ function parseJsoncStrict(filePath) {
20560
20622
  }
20561
20623
  function parseTomlStrict(filePath) {
20562
20624
  try {
20563
- return parse(fs16.readFileSync(filePath, "utf8"));
20625
+ return parse(fs17.readFileSync(filePath, "utf8"));
20564
20626
  } catch {
20565
20627
  return null;
20566
20628
  }
20567
20629
  }
20568
20630
  function parseYamlStrict(filePath) {
20569
20631
  try {
20570
- const parsed = (0, import_yaml2.parse)(fs16.readFileSync(filePath, "utf8"));
20632
+ const parsed = (0, import_yaml2.parse)(fs17.readFileSync(filePath, "utf8"));
20571
20633
  if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) return null;
20572
20634
  return parsed;
20573
20635
  } catch {
@@ -20590,7 +20652,7 @@ function bundledManagedNames(kind) {
20590
20652
  if (cached2) return cached2;
20591
20653
  let names;
20592
20654
  try {
20593
- names = new Set(fs16.readdirSync(kind === "rules" ? RULES_DIR : AGENTS_DIR));
20655
+ names = new Set(fs17.readdirSync(kind === "rules" ? RULES_DIR : AGENTS_DIR));
20594
20656
  } catch {
20595
20657
  names = /* @__PURE__ */ new Set();
20596
20658
  }
@@ -20600,7 +20662,7 @@ function bundledManagedNames(kind) {
20600
20662
  function managedDirLooksArgentOnly(dir, kind) {
20601
20663
  let entries;
20602
20664
  try {
20603
- entries = fs16.readdirSync(dir);
20665
+ entries = fs17.readdirSync(dir);
20604
20666
  } catch {
20605
20667
  return false;
20606
20668
  }
@@ -20612,13 +20674,13 @@ function managedDirLooksArgentOnly(dir, kind) {
20612
20674
  function cursorDirLooksArgentOnly(dir) {
20613
20675
  let entries;
20614
20676
  try {
20615
- entries = fs16.readdirSync(dir);
20677
+ entries = fs17.readdirSync(dir);
20616
20678
  } catch {
20617
20679
  return false;
20618
20680
  }
20619
20681
  if (entries.length === 0) return false;
20620
20682
  return entries.every((entry) => {
20621
- const full = path17.join(dir, entry);
20683
+ const full = path18.join(dir, entry);
20622
20684
  if (entry === "mcp.json") {
20623
20685
  return jsonLooksArgentServerOnly(full, "mcpServers");
20624
20686
  }
@@ -20651,13 +20713,13 @@ function claudeSettingsLooksArgentOnly(filePath) {
20651
20713
  function claudeDirLooksArgentOnly(dir) {
20652
20714
  let entries;
20653
20715
  try {
20654
- entries = fs16.readdirSync(dir);
20716
+ entries = fs17.readdirSync(dir);
20655
20717
  } catch {
20656
20718
  return false;
20657
20719
  }
20658
20720
  if (entries.length === 0) return false;
20659
20721
  return entries.every((entry) => {
20660
- const full = path17.join(dir, entry);
20722
+ const full = path18.join(dir, entry);
20661
20723
  if (entry === "settings.json") return claudeSettingsLooksArgentOnly(full);
20662
20724
  if (entry === "rules" || entry === "agents" || entry === "skills") {
20663
20725
  return managedDirLooksArgentOnly(full, entry);
@@ -20668,25 +20730,25 @@ function claudeDirLooksArgentOnly(dir) {
20668
20730
  function vscodeDirLooksArgentOnly(dir) {
20669
20731
  let entries;
20670
20732
  try {
20671
- entries = fs16.readdirSync(dir);
20733
+ entries = fs17.readdirSync(dir);
20672
20734
  } catch {
20673
20735
  return false;
20674
20736
  }
20675
20737
  if (entries.length === 0) return false;
20676
20738
  return entries.every(
20677
- (entry) => entry === "mcp.json" && jsonLooksArgentServerOnly(path17.join(dir, entry), "servers")
20739
+ (entry) => entry === "mcp.json" && jsonLooksArgentServerOnly(path18.join(dir, entry), "servers")
20678
20740
  );
20679
20741
  }
20680
20742
  function windsurfDirLooksArgentOnly(dir) {
20681
20743
  let entries;
20682
20744
  try {
20683
- entries = fs16.readdirSync(dir);
20745
+ entries = fs17.readdirSync(dir);
20684
20746
  } catch {
20685
20747
  return false;
20686
20748
  }
20687
20749
  if (entries.length === 0) return false;
20688
20750
  return entries.every(
20689
- (entry) => entry === "mcp_config.json" && jsonLooksArgentServerOnly(path17.join(dir, entry), "mcpServers")
20751
+ (entry) => entry === "mcp_config.json" && jsonLooksArgentServerOnly(path18.join(dir, entry), "mcpServers")
20690
20752
  );
20691
20753
  }
20692
20754
  function zedSettingsLooksArgentOnly(filePath) {
@@ -20717,25 +20779,25 @@ function zedSettingsLooksArgentOnly(filePath) {
20717
20779
  function zedDirLooksArgentOnly(dir) {
20718
20780
  let entries;
20719
20781
  try {
20720
- entries = fs16.readdirSync(dir);
20782
+ entries = fs17.readdirSync(dir);
20721
20783
  } catch {
20722
20784
  return false;
20723
20785
  }
20724
20786
  if (entries.length === 0) return false;
20725
20787
  return entries.every(
20726
- (entry) => entry === "settings.json" && zedSettingsLooksArgentOnly(path17.join(dir, entry))
20788
+ (entry) => entry === "settings.json" && zedSettingsLooksArgentOnly(path18.join(dir, entry))
20727
20789
  );
20728
20790
  }
20729
20791
  function geminiDirLooksArgentOnly(dir) {
20730
20792
  let entries;
20731
20793
  try {
20732
- entries = fs16.readdirSync(dir);
20794
+ entries = fs17.readdirSync(dir);
20733
20795
  } catch {
20734
20796
  return false;
20735
20797
  }
20736
20798
  if (entries.length === 0) return false;
20737
20799
  return entries.every((entry) => {
20738
- const full = path17.join(dir, entry);
20800
+ const full = path18.join(dir, entry);
20739
20801
  if (entry === "settings.json") return jsonLooksArgentServerOnly(full, "mcpServers");
20740
20802
  if (entry === "rules" || entry === "agents") return managedDirLooksArgentOnly(full, entry);
20741
20803
  return false;
@@ -20754,48 +20816,48 @@ function hermesConfigLooksArgentOnly(filePath) {
20754
20816
  function hermesDirLooksArgentOnly(dir) {
20755
20817
  let entries;
20756
20818
  try {
20757
- entries = fs16.readdirSync(dir);
20819
+ entries = fs17.readdirSync(dir);
20758
20820
  } catch {
20759
20821
  return false;
20760
20822
  }
20761
20823
  if (entries.length === 0) return false;
20762
20824
  return entries.every(
20763
- (entry) => entry === "config.yaml" && hermesConfigLooksArgentOnly(path17.join(dir, entry))
20825
+ (entry) => entry === "config.yaml" && hermesConfigLooksArgentOnly(path18.join(dir, entry))
20764
20826
  );
20765
20827
  }
20766
20828
  function kiroDirLooksArgentOnly(dir) {
20767
20829
  let entries;
20768
20830
  try {
20769
- entries = fs16.readdirSync(dir);
20831
+ entries = fs17.readdirSync(dir);
20770
20832
  } catch {
20771
20833
  return false;
20772
20834
  }
20773
20835
  if (entries.length === 0) return false;
20774
20836
  return entries.every((entry) => {
20775
20837
  if (entry !== "settings") return false;
20776
- const settingsDir = path17.join(dir, entry);
20838
+ const settingsDir = path18.join(dir, entry);
20777
20839
  let settingsEntries;
20778
20840
  try {
20779
- settingsEntries = fs16.readdirSync(settingsDir);
20841
+ settingsEntries = fs17.readdirSync(settingsDir);
20780
20842
  } catch {
20781
20843
  return false;
20782
20844
  }
20783
20845
  if (settingsEntries.length === 0) return false;
20784
20846
  return settingsEntries.every(
20785
- (name) => name === "mcp.json" && jsonLooksArgentServerOnly(path17.join(settingsDir, name), "mcpServers")
20847
+ (name) => name === "mcp.json" && jsonLooksArgentServerOnly(path18.join(settingsDir, name), "mcpServers")
20786
20848
  );
20787
20849
  });
20788
20850
  }
20789
20851
  function codexDirLooksArgentOnly(dir) {
20790
20852
  let entries;
20791
20853
  try {
20792
- entries = fs16.readdirSync(dir);
20854
+ entries = fs17.readdirSync(dir);
20793
20855
  } catch {
20794
20856
  return false;
20795
20857
  }
20796
20858
  if (entries.length === 0) return false;
20797
20859
  return entries.every((entry) => {
20798
- const full = path17.join(dir, entry);
20860
+ const full = path18.join(dir, entry);
20799
20861
  if (entry === "config.toml") {
20800
20862
  const config = parseTomlStrict(full);
20801
20863
  if (config === null) return false;
@@ -20822,13 +20884,13 @@ function codexDirLooksArgentOnly(dir) {
20822
20884
  var cursorAdapter = {
20823
20885
  name: "Cursor",
20824
20886
  detect() {
20825
- return dirHasEditorEvidence(path17.join(homedir4(), ".cursor"), cursorDirLooksArgentOnly) || dirHasEditorEvidence(path17.join(process.cwd(), ".cursor"), cursorDirLooksArgentOnly);
20887
+ return dirHasEditorEvidence(path18.join(homedir4(), ".cursor"), cursorDirLooksArgentOnly) || dirHasEditorEvidence(path18.join(process.cwd(), ".cursor"), cursorDirLooksArgentOnly);
20826
20888
  },
20827
20889
  projectPath(root) {
20828
- return path17.join(root, ".cursor", "mcp.json");
20890
+ return path18.join(root, ".cursor", "mcp.json");
20829
20891
  },
20830
20892
  globalPath() {
20831
- return path17.join(homedir4(), ".cursor", "mcp.json");
20893
+ return path18.join(homedir4(), ".cursor", "mcp.json");
20832
20894
  },
20833
20895
  // Read and written as JSONC through readJsonc / editJsoncFile: path-targeted
20834
20896
  // text edits that preserve user comments and foreign servers.
@@ -20840,7 +20902,7 @@ var cursorAdapter = {
20840
20902
  });
20841
20903
  },
20842
20904
  remove(configPath) {
20843
- if (!fs16.existsSync(configPath)) return false;
20905
+ if (!fs17.existsSync(configPath)) return false;
20844
20906
  const config = readJsonc(configPath);
20845
20907
  const servers = config.mcpServers;
20846
20908
  if (!servers?.[MCP_SERVER_KEY]) return false;
@@ -20848,7 +20910,7 @@ var cursorAdapter = {
20848
20910
  return true;
20849
20911
  },
20850
20912
  getArgentEntry(configPath) {
20851
- if (!fs16.existsSync(configPath)) return null;
20913
+ if (!fs17.existsSync(configPath)) return null;
20852
20914
  const config = readJsonc(configPath);
20853
20915
  const servers = config.mcpServers;
20854
20916
  return normalizeServerEntry(servers?.[MCP_SERVER_KEY]);
@@ -20859,7 +20921,7 @@ var cursorAdapter = {
20859
20921
  // The allowlist lives in a separate ~/.cursor/permissions.json that may carry
20860
20922
  // the user's own rules, so edit that one key instead of rewriting the file.
20861
20923
  addAllowlist() {
20862
- const permPath = path17.join(homedir4(), ".cursor", "permissions.json");
20924
+ const permPath = path18.join(homedir4(), ".cursor", "permissions.json");
20863
20925
  const config = readJsonc(permPath);
20864
20926
  const list = Array.isArray(config.mcpAllowlist) ? config.mcpAllowlist : [];
20865
20927
  if (list.includes(CURSOR_ALLOWLIST_PATTERN)) return;
@@ -20867,8 +20929,8 @@ var cursorAdapter = {
20867
20929
  },
20868
20930
  removeAllowlist(_root, scope) {
20869
20931
  if (scope !== "global") return;
20870
- const permPath = path17.join(homedir4(), ".cursor", "permissions.json");
20871
- if (!fs16.existsSync(permPath)) return;
20932
+ const permPath = path18.join(homedir4(), ".cursor", "permissions.json");
20933
+ if (!fs17.existsSync(permPath)) return;
20872
20934
  const config = readJsonc(permPath);
20873
20935
  const list = Array.isArray(config.mcpAllowlist) ? config.mcpAllowlist : void 0;
20874
20936
  if (!list || !list.includes(CURSOR_ALLOWLIST_PATTERN)) return;
@@ -20879,16 +20941,16 @@ var cursorAdapter = {
20879
20941
  function claudeProjectKeysForRoot(projects, root) {
20880
20942
  const canonical = (value) => {
20881
20943
  try {
20882
- return fs16.realpathSync.native(value);
20944
+ return fs17.realpathSync.native(value);
20883
20945
  } catch {
20884
- return path17.resolve(value);
20946
+ return path18.resolve(value);
20885
20947
  }
20886
20948
  };
20887
20949
  const target = canonical(root);
20888
20950
  return Object.keys(projects).filter((key) => key === root || canonical(key) === target);
20889
20951
  }
20890
20952
  function claudeDisabledListFinding(settingsPath, label, projectConfined) {
20891
- if (!fs16.existsSync(settingsPath)) return null;
20953
+ if (!fs17.existsSync(settingsPath)) return null;
20892
20954
  const disabled = readJson(settingsPath).disabledMcpjsonServers;
20893
20955
  if (!Array.isArray(disabled) || !disabled.includes(MCP_SERVER_KEY)) return null;
20894
20956
  return {
@@ -20916,13 +20978,13 @@ var claudeAdapter = {
20916
20978
  name: "Claude Code",
20917
20979
  detect() {
20918
20980
  const mcpJsonArgentOnly = (p) => jsonLooksArgentServerOnly(p, "mcpServers");
20919
- return fileHasEditorEvidence(path17.join(process.cwd(), ".mcp.json"), mcpJsonArgentOnly) || fileHasEditorEvidence(path17.join(homedir4(), ".claude.json"), mcpJsonArgentOnly) || dirHasEditorEvidence(path17.join(process.cwd(), ".claude"), claudeDirLooksArgentOnly) || dirHasEditorEvidence(path17.join(homedir4(), ".claude"), claudeDirLooksArgentOnly);
20981
+ return fileHasEditorEvidence(path18.join(process.cwd(), ".mcp.json"), mcpJsonArgentOnly) || fileHasEditorEvidence(path18.join(homedir4(), ".claude.json"), mcpJsonArgentOnly) || dirHasEditorEvidence(path18.join(process.cwd(), ".claude"), claudeDirLooksArgentOnly) || dirHasEditorEvidence(path18.join(homedir4(), ".claude"), claudeDirLooksArgentOnly);
20920
20982
  },
20921
20983
  projectPath(root) {
20922
- return path17.join(root, ".mcp.json");
20984
+ return path18.join(root, ".mcp.json");
20923
20985
  },
20924
20986
  globalPath() {
20925
- return path17.join(homedir4(), ".claude.json");
20987
+ return path18.join(homedir4(), ".claude.json");
20926
20988
  },
20927
20989
  // JSONC is a superset of JSON, so this config shares the one comment- and
20928
20990
  // foreign-server-preserving write path (see the Cursor adapter).
@@ -20935,7 +20997,7 @@ var claudeAdapter = {
20935
20997
  });
20936
20998
  },
20937
20999
  remove(configPath) {
20938
- if (!fs16.existsSync(configPath)) return false;
21000
+ if (!fs17.existsSync(configPath)) return false;
20939
21001
  const config = readJsonc(configPath);
20940
21002
  const servers = config.mcpServers;
20941
21003
  if (!servers?.[MCP_SERVER_KEY]) return false;
@@ -20949,7 +21011,7 @@ var claudeAdapter = {
20949
21011
  return true;
20950
21012
  },
20951
21013
  getArgentEntry(configPath) {
20952
- if (!fs16.existsSync(configPath)) return null;
21014
+ if (!fs17.existsSync(configPath)) return null;
20953
21015
  const config = readJsonc(configPath);
20954
21016
  const servers = config.mcpServers;
20955
21017
  return normalizeServerEntry(servers?.[MCP_SERVER_KEY]);
@@ -20962,7 +21024,7 @@ var claudeAdapter = {
20962
21024
  // .mcp.json rejections (see claudeDisabledListFinding).
20963
21025
  findShadowingConfigs(root, writtenScope) {
20964
21026
  const findings = [];
20965
- const claudeJsonPath = path17.join(homedir4(), ".claude.json");
21027
+ const claudeJsonPath = path18.join(homedir4(), ".claude.json");
20966
21028
  const projects = readJson(claudeJsonPath).projects;
20967
21029
  if (isRecord(projects)) {
20968
21030
  for (const key of claudeProjectKeysForRoot(projects, root)) {
@@ -20999,9 +21061,9 @@ var claudeAdapter = {
20999
21061
  }
21000
21062
  if (writtenScope === "local") {
21001
21063
  const candidates = [
21002
- [path17.join(root, ".claude", "settings.json"), ".claude/settings.json", true],
21003
- [path17.join(root, ".claude", "settings.local.json"), ".claude/settings.local.json", true],
21004
- [path17.join(homedir4(), ".claude", "settings.json"), "~/.claude/settings.json", false]
21064
+ [path18.join(root, ".claude", "settings.json"), ".claude/settings.json", true],
21065
+ [path18.join(root, ".claude", "settings.local.json"), ".claude/settings.local.json", true],
21066
+ [path18.join(homedir4(), ".claude", "settings.json"), "~/.claude/settings.json", false]
21005
21067
  ];
21006
21068
  for (const [settingsPath, label, projectConfined] of candidates) {
21007
21069
  const finding = claudeDisabledListFinding(settingsPath, label, projectConfined);
@@ -21020,10 +21082,10 @@ var claudeAdapter = {
21020
21082
  var vscodeAdapter = {
21021
21083
  name: "VS Code",
21022
21084
  detect() {
21023
- return dirHasEditorEvidence(path17.join(process.cwd(), ".vscode"), vscodeDirLooksArgentOnly) || dirExists(path17.join(homedir4(), ".vscode"));
21085
+ return dirHasEditorEvidence(path18.join(process.cwd(), ".vscode"), vscodeDirLooksArgentOnly) || dirExists(path18.join(homedir4(), ".vscode"));
21024
21086
  },
21025
21087
  projectPath(root) {
21026
- return path17.join(root, ".vscode", "mcp.json");
21088
+ return path18.join(root, ".vscode", "mcp.json");
21027
21089
  },
21028
21090
  globalPath() {
21029
21091
  return null;
@@ -21039,7 +21101,7 @@ var vscodeAdapter = {
21039
21101
  });
21040
21102
  },
21041
21103
  remove(configPath) {
21042
- if (!fs16.existsSync(configPath)) return false;
21104
+ if (!fs17.existsSync(configPath)) return false;
21043
21105
  const config = readJsonc(configPath);
21044
21106
  const servers = config.servers;
21045
21107
  if (!servers?.[MCP_SERVER_KEY]) return false;
@@ -21047,7 +21109,7 @@ var vscodeAdapter = {
21047
21109
  return true;
21048
21110
  },
21049
21111
  getArgentEntry(configPath) {
21050
- if (!fs16.existsSync(configPath)) return null;
21112
+ if (!fs17.existsSync(configPath)) return null;
21051
21113
  const config = readJsonc(configPath);
21052
21114
  const servers = config.servers;
21053
21115
  return normalizeServerEntry(servers?.[MCP_SERVER_KEY]);
@@ -21060,7 +21122,7 @@ var vscodeAdapter = {
21060
21122
  findShadowingConfigs(_root, _writtenScope) {
21061
21123
  const findings = [];
21062
21124
  for (const userDir of vscodeUserDirs()) {
21063
- const configPath = path17.join(userDir, "mcp.json");
21125
+ const configPath = path18.join(userDir, "mcp.json");
21064
21126
  const entry = this.getArgentEntry(configPath);
21065
21127
  if (!entry) continue;
21066
21128
  findings.push({
@@ -21077,16 +21139,16 @@ var vscodeAdapter = {
21077
21139
  function vscodeUserDirs() {
21078
21140
  const bases = [];
21079
21141
  if (process.platform === "darwin") {
21080
- bases.push(path17.join(homedir4(), "Library", "Application Support"));
21142
+ bases.push(path18.join(homedir4(), "Library", "Application Support"));
21081
21143
  } else if (process.platform === "win32") {
21082
21144
  if (process.env.APPDATA) bases.push(process.env.APPDATA);
21083
21145
  } else {
21084
- bases.push(path17.join(homedir4(), ".config"));
21146
+ bases.push(path18.join(homedir4(), ".config"));
21085
21147
  }
21086
21148
  const dirs = [];
21087
21149
  for (const base of bases) {
21088
21150
  for (const product of ["Code", "Code - Insiders"]) {
21089
- const dir = path17.join(base, product, "User");
21151
+ const dir = path18.join(base, product, "User");
21090
21152
  if (dirExists(dir)) dirs.push(dir);
21091
21153
  }
21092
21154
  }
@@ -21096,7 +21158,7 @@ var windsurfAdapter = {
21096
21158
  name: "Windsurf",
21097
21159
  detect() {
21098
21160
  return dirHasEditorEvidence(
21099
- path17.join(homedir4(), ".codeium", "windsurf"),
21161
+ path18.join(homedir4(), ".codeium", "windsurf"),
21100
21162
  windsurfDirLooksArgentOnly
21101
21163
  );
21102
21164
  },
@@ -21104,7 +21166,7 @@ var windsurfAdapter = {
21104
21166
  return null;
21105
21167
  },
21106
21168
  globalPath() {
21107
- return path17.join(homedir4(), ".codeium", "windsurf", "mcp_config.json");
21169
+ return path18.join(homedir4(), ".codeium", "windsurf", "mcp_config.json");
21108
21170
  },
21109
21171
  // JSONC-safe writes (see the Cursor adapter).
21110
21172
  write(configPath, entry) {
@@ -21115,7 +21177,7 @@ var windsurfAdapter = {
21115
21177
  });
21116
21178
  },
21117
21179
  remove(configPath) {
21118
- if (!fs16.existsSync(configPath)) return false;
21180
+ if (!fs17.existsSync(configPath)) return false;
21119
21181
  const config = readJsonc(configPath);
21120
21182
  const servers = config.mcpServers;
21121
21183
  if (!servers?.[MCP_SERVER_KEY]) return false;
@@ -21123,7 +21185,7 @@ var windsurfAdapter = {
21123
21185
  return true;
21124
21186
  },
21125
21187
  getArgentEntry(configPath) {
21126
- if (!fs16.existsSync(configPath)) return null;
21188
+ if (!fs17.existsSync(configPath)) return null;
21127
21189
  const config = readJsonc(configPath);
21128
21190
  const servers = config.mcpServers;
21129
21191
  return normalizeServerEntry(servers?.[MCP_SERVER_KEY]);
@@ -21134,7 +21196,7 @@ var windsurfAdapter = {
21134
21196
  // Targets just the argent entry's alwaysAllow key, so comments and foreign
21135
21197
  // servers survive.
21136
21198
  addAllowlist() {
21137
- const configPath = path17.join(homedir4(), ".codeium", "windsurf", "mcp_config.json");
21199
+ const configPath = path18.join(homedir4(), ".codeium", "windsurf", "mcp_config.json");
21138
21200
  const config = readJsonc(configPath);
21139
21201
  const servers = config.mcpServers;
21140
21202
  if (!servers?.[MCP_SERVER_KEY]) return;
@@ -21142,8 +21204,8 @@ var windsurfAdapter = {
21142
21204
  },
21143
21205
  removeAllowlist(_root, scope) {
21144
21206
  if (scope !== "global") return;
21145
- const configPath = path17.join(homedir4(), ".codeium", "windsurf", "mcp_config.json");
21146
- if (!fs16.existsSync(configPath)) return;
21207
+ const configPath = path18.join(homedir4(), ".codeium", "windsurf", "mcp_config.json");
21208
+ if (!fs17.existsSync(configPath)) return;
21147
21209
  const config = readJsonc(configPath);
21148
21210
  const servers = config.mcpServers;
21149
21211
  const entry = servers?.[MCP_SERVER_KEY];
@@ -21154,13 +21216,13 @@ var windsurfAdapter = {
21154
21216
  var zedAdapter = {
21155
21217
  name: "Zed",
21156
21218
  detect() {
21157
- return dirHasEditorEvidence(path17.join(homedir4(), ".config", "zed"), zedDirLooksArgentOnly);
21219
+ return dirHasEditorEvidence(path18.join(homedir4(), ".config", "zed"), zedDirLooksArgentOnly);
21158
21220
  },
21159
21221
  projectPath(root) {
21160
- return path17.join(root, ".zed", "settings.json");
21222
+ return path18.join(root, ".zed", "settings.json");
21161
21223
  },
21162
21224
  globalPath() {
21163
- return path17.join(homedir4(), ".config", "zed", "settings.json");
21225
+ return path18.join(homedir4(), ".config", "zed", "settings.json");
21164
21226
  },
21165
21227
  // Read and written as JSONC through readJsonc / editJsoncFile so comments and
21166
21228
  // formatting outside the touched key survive (see the Cursor adapter).
@@ -21173,7 +21235,7 @@ var zedAdapter = {
21173
21235
  });
21174
21236
  },
21175
21237
  remove(configPath) {
21176
- if (!fs16.existsSync(configPath)) return false;
21238
+ if (!fs17.existsSync(configPath)) return false;
21177
21239
  const config = readJsonc(configPath);
21178
21240
  const servers = config.context_servers;
21179
21241
  if (!servers?.[MCP_SERVER_KEY]) return false;
@@ -21181,7 +21243,7 @@ var zedAdapter = {
21181
21243
  return true;
21182
21244
  },
21183
21245
  getArgentEntry(configPath) {
21184
- if (!fs16.existsSync(configPath)) return null;
21246
+ if (!fs17.existsSync(configPath)) return null;
21185
21247
  const config = readJsonc(configPath);
21186
21248
  const servers = config.context_servers;
21187
21249
  return normalizeServerEntry(servers?.[MCP_SERVER_KEY]);
@@ -21192,12 +21254,12 @@ var zedAdapter = {
21192
21254
  // Zed has no server-level wildcard for MCP tools — each tool would need its
21193
21255
  // own entry — so the global default is set to "allow" instead.
21194
21256
  addAllowlist(root, scope) {
21195
- const settingsPath = scope === "global" ? path17.join(homedir4(), ".config", "zed", "settings.json") : path17.join(root, ".zed", "settings.json");
21257
+ const settingsPath = scope === "global" ? path18.join(homedir4(), ".config", "zed", "settings.json") : path18.join(root, ".zed", "settings.json");
21196
21258
  editJsoncFile(settingsPath, ["agent", "tool_permissions", "default"], "allow");
21197
21259
  },
21198
21260
  removeAllowlist(root, scope) {
21199
- const settingsPath = scope === "global" ? path17.join(homedir4(), ".config", "zed", "settings.json") : path17.join(root, ".zed", "settings.json");
21200
- if (!fs16.existsSync(settingsPath)) return;
21261
+ const settingsPath = scope === "global" ? path18.join(homedir4(), ".config", "zed", "settings.json") : path18.join(root, ".zed", "settings.json");
21262
+ if (!fs17.existsSync(settingsPath)) return;
21201
21263
  const config = readJsonc(settingsPath);
21202
21264
  const perms = config.agent?.tool_permissions;
21203
21265
  if (!perms || perms.default !== "allow") return;
@@ -21207,13 +21269,13 @@ var zedAdapter = {
21207
21269
  var geminiAdapter = {
21208
21270
  name: "Gemini",
21209
21271
  detect() {
21210
- return dirHasEditorEvidence(path17.join(homedir4(), ".gemini"), geminiDirLooksArgentOnly) || dirHasEditorEvidence(path17.join(process.cwd(), ".gemini"), geminiDirLooksArgentOnly);
21272
+ return dirHasEditorEvidence(path18.join(homedir4(), ".gemini"), geminiDirLooksArgentOnly) || dirHasEditorEvidence(path18.join(process.cwd(), ".gemini"), geminiDirLooksArgentOnly);
21211
21273
  },
21212
21274
  projectPath(root) {
21213
- return path17.join(root, ".gemini", "settings.json");
21275
+ return path18.join(root, ".gemini", "settings.json");
21214
21276
  },
21215
21277
  globalPath() {
21216
- return path17.join(homedir4(), ".gemini", "settings.json");
21278
+ return path18.join(homedir4(), ".gemini", "settings.json");
21217
21279
  },
21218
21280
  // JSONC-safe writes (see the Cursor adapter).
21219
21281
  write(configPath, entry) {
@@ -21224,7 +21286,7 @@ var geminiAdapter = {
21224
21286
  });
21225
21287
  },
21226
21288
  remove(configPath) {
21227
- if (!fs16.existsSync(configPath)) return false;
21289
+ if (!fs17.existsSync(configPath)) return false;
21228
21290
  const config = readJsonc(configPath);
21229
21291
  const servers = config.mcpServers;
21230
21292
  if (!servers?.[MCP_SERVER_KEY]) return false;
@@ -21232,7 +21294,7 @@ var geminiAdapter = {
21232
21294
  return true;
21233
21295
  },
21234
21296
  getArgentEntry(configPath) {
21235
- if (!fs16.existsSync(configPath)) return null;
21297
+ if (!fs17.existsSync(configPath)) return null;
21236
21298
  const config = readJsonc(configPath);
21237
21299
  const servers = config.mcpServers;
21238
21300
  return normalizeServerEntry(servers?.[MCP_SERVER_KEY]);
@@ -21254,7 +21316,7 @@ var geminiAdapter = {
21254
21316
  },
21255
21317
  removeAllowlist(root, scope) {
21256
21318
  const configPath = scope === "global" ? this.globalPath() : this.projectPath(root);
21257
- if (!configPath || !fs16.existsSync(configPath)) {
21319
+ if (!configPath || !fs17.existsSync(configPath)) {
21258
21320
  return;
21259
21321
  }
21260
21322
  const config = readJsonc(configPath);
@@ -21268,13 +21330,13 @@ var CODEX_FILENAME = ".codex";
21268
21330
  var codexAdapter = {
21269
21331
  name: "Codex",
21270
21332
  detect() {
21271
- return dirHasEditorEvidence(path17.join(homedir4(), CODEX_FILENAME), codexDirLooksArgentOnly) || dirHasEditorEvidence(path17.join(process.cwd(), CODEX_FILENAME), codexDirLooksArgentOnly);
21333
+ return dirHasEditorEvidence(path18.join(homedir4(), CODEX_FILENAME), codexDirLooksArgentOnly) || dirHasEditorEvidence(path18.join(process.cwd(), CODEX_FILENAME), codexDirLooksArgentOnly);
21272
21334
  },
21273
21335
  projectPath(root) {
21274
- return path17.join(root, CODEX_FILENAME, "config.toml");
21336
+ return path18.join(root, CODEX_FILENAME, "config.toml");
21275
21337
  },
21276
21338
  globalPath() {
21277
- return path17.join(homedir4(), CODEX_FILENAME, "config.toml");
21339
+ return path18.join(homedir4(), CODEX_FILENAME, "config.toml");
21278
21340
  },
21279
21341
  write(configPath, entry) {
21280
21342
  const config = readToml(configPath);
@@ -21288,7 +21350,7 @@ var codexAdapter = {
21288
21350
  writeToml(configPath, config);
21289
21351
  },
21290
21352
  remove(configPath) {
21291
- if (!fs16.existsSync(configPath)) return false;
21353
+ if (!fs17.existsSync(configPath)) return false;
21292
21354
  const config = readToml(configPath);
21293
21355
  const servers = config.mcp_servers;
21294
21356
  if (!servers?.[MCP_SERVER_KEY]) return false;
@@ -21298,7 +21360,7 @@ var codexAdapter = {
21298
21360
  return true;
21299
21361
  },
21300
21362
  getArgentEntry(configPath) {
21301
- if (!fs16.existsSync(configPath)) return null;
21363
+ if (!fs17.existsSync(configPath)) return null;
21302
21364
  const config = readToml(configPath);
21303
21365
  const servers = config.mcp_servers;
21304
21366
  return normalizeServerEntry(servers?.[MCP_SERVER_KEY]);
@@ -21346,13 +21408,13 @@ var codexAdapter = {
21346
21408
  var hermesAdapter = {
21347
21409
  name: "Hermes",
21348
21410
  detect() {
21349
- return dirHasEditorEvidence(path17.join(homedir4(), ".hermes"), hermesDirLooksArgentOnly);
21411
+ return dirHasEditorEvidence(path18.join(homedir4(), ".hermes"), hermesDirLooksArgentOnly);
21350
21412
  },
21351
21413
  projectPath() {
21352
21414
  return null;
21353
21415
  },
21354
21416
  globalPath() {
21355
- return path17.join(homedir4(), ".hermes", "config.yaml");
21417
+ return path18.join(homedir4(), ".hermes", "config.yaml");
21356
21418
  },
21357
21419
  write(configPath, entry) {
21358
21420
  const doc = readYaml(configPath);
@@ -21371,7 +21433,7 @@ var hermesAdapter = {
21371
21433
  writeYaml(configPath, doc);
21372
21434
  },
21373
21435
  remove(configPath) {
21374
- if (!fs16.existsSync(configPath)) return false;
21436
+ if (!fs17.existsSync(configPath)) return false;
21375
21437
  const doc = readYaml(configPath);
21376
21438
  const servers = doc.get("mcp_servers");
21377
21439
  if (!(0, import_yaml2.isMap)(servers)) return false;
@@ -21384,7 +21446,7 @@ var hermesAdapter = {
21384
21446
  return true;
21385
21447
  },
21386
21448
  getArgentEntry(configPath) {
21387
- if (!fs16.existsSync(configPath)) return null;
21449
+ if (!fs17.existsSync(configPath)) return null;
21388
21450
  const doc = readYaml(configPath);
21389
21451
  const servers = doc.get("mcp_servers");
21390
21452
  if (!(0, import_yaml2.isMap)(servers)) return null;
@@ -21411,10 +21473,10 @@ function hasOpenCodeBinary() {
21411
21473
  }
21412
21474
  function pickOpencodeConfig(dir, candidates) {
21413
21475
  for (const name of candidates) {
21414
- const candidate = path17.join(dir, name);
21415
- if (fs16.existsSync(candidate)) return candidate;
21476
+ const candidate = path18.join(dir, name);
21477
+ if (fs17.existsSync(candidate)) return candidate;
21416
21478
  }
21417
- return path17.join(dir, "opencode.json");
21479
+ return path18.join(dir, "opencode.json");
21418
21480
  }
21419
21481
  var openCodeAdapter = {
21420
21482
  name: "opencode",
@@ -21425,7 +21487,7 @@ var openCodeAdapter = {
21425
21487
  return pickOpencodeConfig(root, OPENCODE_PROJECT_FILES);
21426
21488
  },
21427
21489
  globalPath() {
21428
- return pickOpencodeConfig(path17.join(homedir4(), ".config", "opencode"), OPENCODE_GLOBAL_FILES);
21490
+ return pickOpencodeConfig(path18.join(homedir4(), ".config", "opencode"), OPENCODE_GLOBAL_FILES);
21429
21491
  },
21430
21492
  write(configPath, entry) {
21431
21493
  editJsoncFile(configPath, ["mcp", MCP_SERVER_KEY], {
@@ -21436,7 +21498,7 @@ var openCodeAdapter = {
21436
21498
  });
21437
21499
  },
21438
21500
  remove(configPath) {
21439
- if (!fs16.existsSync(configPath)) return false;
21501
+ if (!fs17.existsSync(configPath)) return false;
21440
21502
  const config = readJsonc(configPath);
21441
21503
  const servers = config.mcp;
21442
21504
  if (!servers?.[MCP_SERVER_KEY]) return false;
@@ -21444,7 +21506,7 @@ var openCodeAdapter = {
21444
21506
  return true;
21445
21507
  },
21446
21508
  getArgentEntry(configPath) {
21447
- if (!fs16.existsSync(configPath)) return null;
21509
+ if (!fs17.existsSync(configPath)) return null;
21448
21510
  const config = readJsonc(configPath);
21449
21511
  const servers = config.mcp;
21450
21512
  return normalizeServerEntry(servers?.[MCP_SERVER_KEY]);
@@ -21459,7 +21521,7 @@ var openCodeAdapter = {
21459
21521
  },
21460
21522
  removeAllowlist(root, scope) {
21461
21523
  const configPath = scope === "global" ? this.globalPath() : this.projectPath(root);
21462
- if (!configPath || !fs16.existsSync(configPath)) return;
21524
+ if (!configPath || !fs17.existsSync(configPath)) return;
21463
21525
  const config = readJsonc(configPath);
21464
21526
  const tools = config.tools;
21465
21527
  if (!tools || !(OPENCODE_ALLOWLIST_PATTERN in tools)) return;
@@ -21470,13 +21532,13 @@ var KIRO_AUTO_APPROVE_ALL = ["*"];
21470
21532
  var kiroAdapter = {
21471
21533
  name: "Kiro",
21472
21534
  detect() {
21473
- return dirHasEditorEvidence(path17.join(homedir4(), ".kiro"), kiroDirLooksArgentOnly) || dirHasEditorEvidence(path17.join(process.cwd(), ".kiro"), kiroDirLooksArgentOnly);
21535
+ return dirHasEditorEvidence(path18.join(homedir4(), ".kiro"), kiroDirLooksArgentOnly) || dirHasEditorEvidence(path18.join(process.cwd(), ".kiro"), kiroDirLooksArgentOnly);
21474
21536
  },
21475
21537
  projectPath(root) {
21476
- return path17.join(root, ".kiro", "settings", "mcp.json");
21538
+ return path18.join(root, ".kiro", "settings", "mcp.json");
21477
21539
  },
21478
21540
  globalPath() {
21479
- return path17.join(homedir4(), ".kiro", "settings", "mcp.json");
21541
+ return path18.join(homedir4(), ".kiro", "settings", "mcp.json");
21480
21542
  },
21481
21543
  // Read and written as JSONC through readJsonc / editJsoncFile so comments and
21482
21544
  // foreign servers survive (see the Cursor adapter).
@@ -21488,7 +21550,7 @@ var kiroAdapter = {
21488
21550
  });
21489
21551
  },
21490
21552
  remove(configPath) {
21491
- if (!fs16.existsSync(configPath)) return false;
21553
+ if (!fs17.existsSync(configPath)) return false;
21492
21554
  const config = readJsonc(configPath);
21493
21555
  const servers = config.mcpServers;
21494
21556
  if (!servers?.[MCP_SERVER_KEY]) return false;
@@ -21496,7 +21558,7 @@ var kiroAdapter = {
21496
21558
  return true;
21497
21559
  },
21498
21560
  getArgentEntry(configPath) {
21499
- if (!fs16.existsSync(configPath)) return null;
21561
+ if (!fs17.existsSync(configPath)) return null;
21500
21562
  const config = readJsonc(configPath);
21501
21563
  const servers = config.mcpServers;
21502
21564
  return normalizeServerEntry(servers?.[MCP_SERVER_KEY]);
@@ -21520,7 +21582,7 @@ var kiroAdapter = {
21520
21582
  },
21521
21583
  removeAllowlist(root, scope) {
21522
21584
  const configPath = scope === "global" ? this.globalPath() : this.projectPath(root);
21523
- if (!configPath || !fs16.existsSync(configPath)) return;
21585
+ if (!configPath || !fs17.existsSync(configPath)) return;
21524
21586
  const config = readJsonc(configPath);
21525
21587
  const servers = config.mcpServers;
21526
21588
  const entry = servers?.[MCP_SERVER_KEY];
@@ -21565,7 +21627,7 @@ function findConfiguredAdapterScopes(adapters, projectRoot) {
21565
21627
  return results;
21566
21628
  }
21567
21629
  function addClaudePermission(root, scope) {
21568
- const settingsPath = scope === "global" ? path17.join(homedir4(), ".claude", "settings.json") : path17.join(root, ".claude", "settings.json");
21630
+ const settingsPath = scope === "global" ? path18.join(homedir4(), ".claude", "settings.json") : path18.join(root, ".claude", "settings.json");
21569
21631
  const config = readJsonc(settingsPath);
21570
21632
  const permissions = config.permissions ?? {};
21571
21633
  const allow = Array.isArray(permissions.allow) ? permissions.allow : [];
@@ -21573,8 +21635,8 @@ function addClaudePermission(root, scope) {
21573
21635
  editJsoncFile(settingsPath, ["permissions", "allow"], [...allow, PERMISSION_RULE]);
21574
21636
  }
21575
21637
  function removeClaudePermission(root, scope) {
21576
- const settingsPath = scope === "global" ? path17.join(homedir4(), ".claude", "settings.json") : path17.join(root, ".claude", "settings.json");
21577
- if (!fs16.existsSync(settingsPath)) return;
21638
+ const settingsPath = scope === "global" ? path18.join(homedir4(), ".claude", "settings.json") : path18.join(root, ".claude", "settings.json");
21639
+ if (!fs17.existsSync(settingsPath)) return;
21578
21640
  const config = readJsonc(settingsPath);
21579
21641
  const permissions = config?.permissions;
21580
21642
  const allow = permissions?.allow;
@@ -21589,11 +21651,11 @@ function formatCopyDestination(target, writtenPath, root) {
21589
21651
  }
21590
21652
  function formatManagedPathLabel(targetPath, root) {
21591
21653
  const home = homedir4();
21592
- if (targetPath === home || targetPath.startsWith(`${home}${path17.sep}`)) {
21654
+ if (targetPath === home || targetPath.startsWith(`${home}${path18.sep}`)) {
21593
21655
  return `~${targetPath.slice(home.length)}`;
21594
21656
  }
21595
- const relative5 = path17.relative(root, targetPath);
21596
- if (relative5 && !relative5.startsWith("..") && !path17.isAbsolute(relative5)) {
21657
+ const relative5 = path18.relative(root, targetPath);
21658
+ if (relative5 && !relative5.startsWith("..") && !path18.isAbsolute(relative5)) {
21597
21659
  return relative5;
21598
21660
  }
21599
21661
  return targetPath;
@@ -21607,7 +21669,7 @@ function addManagedTarget(targets, editorName, targetPath, root) {
21607
21669
  }
21608
21670
  function getAdapterBasePath(adapter, root, scope) {
21609
21671
  const configPath = scope === "global" ? adapter.globalPath() : adapter.projectPath(root);
21610
- return configPath ? path17.dirname(configPath) : null;
21672
+ return configPath ? path18.dirname(configPath) : null;
21611
21673
  }
21612
21674
  function getManagedContentTargets(adapters, root, scope) {
21613
21675
  const targets = {
@@ -21621,13 +21683,13 @@ function getManagedContentTargets(adapters, root, scope) {
21621
21683
  addManagedTarget(
21622
21684
  targets.skillTargets,
21623
21685
  "skills",
21624
- path17.join(workspaceBase, ".agents", "skills"),
21686
+ path18.join(workspaceBase, ".agents", "skills"),
21625
21687
  root
21626
21688
  );
21627
21689
  addManagedTarget(
21628
21690
  targets.skillsLockTargets,
21629
21691
  "skills",
21630
- path17.join(workspaceBase, "skills-lock.json"),
21692
+ path18.join(workspaceBase, "skills-lock.json"),
21631
21693
  root
21632
21694
  );
21633
21695
  for (const adapter of adapters) {
@@ -21635,21 +21697,21 @@ function getManagedContentTargets(adapters, root, scope) {
21635
21697
  case "Cursor": {
21636
21698
  const base = getAdapterBasePath(adapter, root, scope);
21637
21699
  if (!base) break;
21638
- addManagedTarget(targets.skillTargets, adapter.name, path17.join(base, "skills"), root);
21639
- addManagedTarget(targets.ruleTargets, adapter.name, path17.join(base, "rules"), root);
21700
+ addManagedTarget(targets.skillTargets, adapter.name, path18.join(base, "skills"), root);
21701
+ addManagedTarget(targets.ruleTargets, adapter.name, path18.join(base, "rules"), root);
21640
21702
  break;
21641
21703
  }
21642
21704
  case "Claude Code": {
21643
- const claudeBase = scope === "global" ? path17.join(homedir4(), ".claude") : path17.join(root, ".claude");
21644
- addManagedTarget(targets.skillTargets, adapter.name, path17.join(claudeBase, "skills"), root);
21645
- addManagedTarget(targets.ruleTargets, adapter.name, path17.join(claudeBase, "rules"), root);
21646
- addManagedTarget(targets.agentTargets, adapter.name, path17.join(claudeBase, "agents"), root);
21705
+ const claudeBase = scope === "global" ? path18.join(homedir4(), ".claude") : path18.join(root, ".claude");
21706
+ addManagedTarget(targets.skillTargets, adapter.name, path18.join(claudeBase, "skills"), root);
21707
+ addManagedTarget(targets.ruleTargets, adapter.name, path18.join(claudeBase, "rules"), root);
21708
+ addManagedTarget(targets.agentTargets, adapter.name, path18.join(claudeBase, "agents"), root);
21647
21709
  break;
21648
21710
  }
21649
21711
  case "Gemini": {
21650
- const geminiBase = scope === "global" ? path17.join(homedir4(), ".gemini") : path17.join(root, ".gemini");
21651
- addManagedTarget(targets.ruleTargets, adapter.name, path17.join(geminiBase, "rules"), root);
21652
- addManagedTarget(targets.agentTargets, adapter.name, path17.join(geminiBase, "agents"), root);
21712
+ const geminiBase = scope === "global" ? path18.join(homedir4(), ".gemini") : path18.join(root, ".gemini");
21713
+ addManagedTarget(targets.ruleTargets, adapter.name, path18.join(geminiBase, "rules"), root);
21714
+ addManagedTarget(targets.agentTargets, adapter.name, path18.join(geminiBase, "agents"), root);
21653
21715
  break;
21654
21716
  }
21655
21717
  case "Codex": {
@@ -21659,9 +21721,14 @@ function getManagedContentTargets(adapters, root, scope) {
21659
21721
  break;
21660
21722
  }
21661
21723
  case "opencode": {
21662
- const base = scope === "global" ? path17.join(homedir4(), ".config", "opencode") : path17.join(root, ".opencode");
21663
- addManagedTarget(targets.skillTargets, adapter.name, path17.join(base, "skills"), root);
21664
- addManagedTarget(targets.agentTargets, adapter.name, path17.join(base, "agents"), root);
21724
+ const base = scope === "global" ? path18.join(homedir4(), ".config", "opencode") : path18.join(root, ".opencode");
21725
+ addManagedTarget(targets.skillTargets, adapter.name, path18.join(base, "skills"), root);
21726
+ addManagedTarget(targets.agentTargets, adapter.name, path18.join(base, "agents"), root);
21727
+ break;
21728
+ }
21729
+ case "Kiro": {
21730
+ const kiroBase = scope === "global" ? path18.join(homedir4(), ".kiro") : path18.join(root, ".kiro");
21731
+ addManagedTarget(targets.skillTargets, adapter.name, path18.join(kiroBase, "skills"), root);
21665
21732
  break;
21666
21733
  }
21667
21734
  }
@@ -21675,12 +21742,12 @@ function stripFrontmatter(content) {
21675
21742
  return match ? content.slice(match[0].length).trim() : content.trim();
21676
21743
  }
21677
21744
  function readAndConcatRules(rulesDir) {
21678
- if (!fs16.existsSync(rulesDir)) return null;
21679
- const files = fs16.readdirSync(rulesDir).filter((f) => f.endsWith(".md")).sort();
21745
+ if (!fs17.existsSync(rulesDir)) return null;
21746
+ const files = fs17.readdirSync(rulesDir).filter((f) => f.endsWith(".md")).sort();
21680
21747
  if (files.length === 0) return null;
21681
21748
  const parts = [];
21682
21749
  for (const file of files) {
21683
- const raw = fs16.readFileSync(path17.join(rulesDir, file), "utf8");
21750
+ const raw = fs17.readFileSync(path18.join(rulesDir, file), "utf8");
21684
21751
  const stripped = stripFrontmatter(raw);
21685
21752
  if (stripped) parts.push(stripped);
21686
21753
  }
@@ -21715,7 +21782,7 @@ function injectCodexRules(configPath, rulesDir) {
21715
21782
  return configPath;
21716
21783
  }
21717
21784
  function removeCodexRules(configPath) {
21718
- if (!fs16.existsSync(configPath)) return false;
21785
+ if (!fs17.existsSync(configPath)) return false;
21719
21786
  const config = readToml(configPath);
21720
21787
  const existing = config.developer_instructions;
21721
21788
  if (!existing || !existing.includes(ARGENT_RULES_START)) return false;
@@ -21766,14 +21833,14 @@ function copyRulesAndAgents(adapters, root, scope, rulesDir, agentsDir) {
21766
21833
 
21767
21834
  // ../argent-installer/src/cli-record.ts
21768
21835
  var import_semver4 = __toESM(require_semver2(), 1);
21769
- import * as fs17 from "node:fs";
21770
- import * as path18 from "node:path";
21836
+ import * as fs18 from "node:fs";
21837
+ import * as path19 from "node:path";
21771
21838
  function cliRecordPath() {
21772
- return path18.join(argentHomeDir(), "cli.json");
21839
+ return path19.join(argentHomeDir(), "cli.json");
21773
21840
  }
21774
21841
  function readCliRecord() {
21775
21842
  try {
21776
- const parsed = JSON.parse(fs17.readFileSync(cliRecordPath(), "utf8"));
21843
+ const parsed = JSON.parse(fs18.readFileSync(cliRecordPath(), "utf8"));
21777
21844
  if (typeof parsed?.cli === "string" && typeof parsed?.node === "string") return parsed;
21778
21845
  return null;
21779
21846
  } catch {
@@ -21783,14 +21850,14 @@ function readCliRecord() {
21783
21850
  function resolveCliEntry(mode, projectRoot) {
21784
21851
  if (mode === "local") {
21785
21852
  const relative5 = getLocalArgentBinRelPath(projectRoot);
21786
- return relative5 ? path18.resolve(projectRoot, relative5) : null;
21853
+ return relative5 ? path19.resolve(projectRoot, relative5) : null;
21787
21854
  }
21788
21855
  const packageRoot = getGloballyInstalledPackageRoot();
21789
21856
  if (!packageRoot) return null;
21790
21857
  const binSub = argentBinSubpath(packageRoot);
21791
21858
  if (!binSub) return null;
21792
- const entry = path18.join(packageRoot, binSub);
21793
- return fs17.existsSync(entry) ? entry : null;
21859
+ const entry = path19.join(packageRoot, binSub);
21860
+ return fs18.existsSync(entry) ? entry : null;
21794
21861
  }
21795
21862
  function writeCliRecord(input) {
21796
21863
  const cli = resolveCliEntry(input.mode, input.projectRoot);
@@ -21806,10 +21873,10 @@ function writeCliRecord(input) {
21806
21873
  function persistCliRecord(record) {
21807
21874
  const file = cliRecordPath();
21808
21875
  try {
21809
- fs17.mkdirSync(path18.dirname(file), { recursive: true });
21876
+ fs18.mkdirSync(path19.dirname(file), { recursive: true });
21810
21877
  const temporary = `${file}.${process.pid}.tmp`;
21811
- fs17.writeFileSync(temporary, JSON.stringify(record, null, 2) + "\n");
21812
- fs17.renameSync(temporary, file);
21878
+ fs18.writeFileSync(temporary, JSON.stringify(record, null, 2) + "\n");
21879
+ fs18.renameSync(temporary, file);
21813
21880
  return file;
21814
21881
  } catch {
21815
21882
  return null;
@@ -21817,10 +21884,10 @@ function persistCliRecord(record) {
21817
21884
  }
21818
21885
  function healCliRecord(input) {
21819
21886
  try {
21820
- if (!fs17.existsSync(input.cli)) return null;
21887
+ if (!fs18.existsSync(input.cli)) return null;
21821
21888
  const existing = readCliRecord();
21822
21889
  if (existing) {
21823
- const alive = fs17.existsSync(existing.node) && fs17.existsSync(existing.cli);
21890
+ const alive = fs18.existsSync(existing.node) && fs18.existsSync(existing.cli);
21824
21891
  const ourVersion = import_semver4.default.valid(input.version);
21825
21892
  const theirVersion = import_semver4.default.valid(existing.version);
21826
21893
  const newerThanExisting = ourVersion !== null && (theirVersion === null || import_semver4.default.gt(ourVersion, theirVersion));
@@ -21841,11 +21908,11 @@ function removeCliRecordFor(installDir) {
21841
21908
  if (!installDir) return false;
21842
21909
  const record = readCliRecord();
21843
21910
  if (!record) return false;
21844
- const root = path18.resolve(installDir);
21845
- const relative5 = path18.relative(root, path18.resolve(record.cli));
21846
- if (relative5.startsWith("..") || path18.isAbsolute(relative5)) return false;
21911
+ const root = path19.resolve(installDir);
21912
+ const relative5 = path19.relative(root, path19.resolve(record.cli));
21913
+ if (relative5.startsWith("..") || path19.isAbsolute(relative5)) return false;
21847
21914
  try {
21848
- fs17.rmSync(cliRecordPath(), { force: true });
21915
+ fs18.rmSync(cliRecordPath(), { force: true });
21849
21916
  return true;
21850
21917
  } catch {
21851
21918
  return false;
@@ -22090,7 +22157,7 @@ var ShellCommandError = class extends Error {
22090
22157
  signal;
22091
22158
  };
22092
22159
  function runShellCommand(cmd, opts = {}) {
22093
- return new Promise((resolve16, reject) => {
22160
+ return new Promise((resolve17, reject) => {
22094
22161
  const child = spawn2(cmd.bin, cmd.args, {
22095
22162
  stdio: ["ignore", "pipe", "pipe"],
22096
22163
  shell: process.platform === "win32",
@@ -22101,7 +22168,7 @@ function runShellCommand(cmd, opts = {}) {
22101
22168
  stderr += chunk.toString();
22102
22169
  });
22103
22170
  child.on("close", (code, signal) => {
22104
- if (code === 0) resolve16();
22171
+ if (code === 0) resolve17();
22105
22172
  else
22106
22173
  reject(
22107
22174
  new ShellCommandError(
@@ -22117,6 +22184,8 @@ function runShellCommand(cmd, opts = {}) {
22117
22184
 
22118
22185
  // ../argent-installer/src/skills.ts
22119
22186
  import { execFileSync as execFileSync6 } from "node:child_process";
22187
+ import * as fs19 from "node:fs";
22188
+ import * as path20 from "node:path";
22120
22189
  var import_picocolors2 = __toESM(require_picocolors(), 1);
22121
22190
  function getScopeSpecs(projectRoot) {
22122
22191
  return [
@@ -22178,10 +22247,58 @@ function refreshArgentSkills(projectRoot) {
22178
22247
  result.pruneError = err instanceof Error ? err.message.split("\n")[0] : String(err);
22179
22248
  }
22180
22249
  }
22250
+ for (const name of pruneLegacySkillDirs(projectRoot, spec.scope, bundled)) {
22251
+ if (!result.pruned.includes(name)) result.pruned.push(name);
22252
+ }
22181
22253
  results.push(result);
22182
22254
  }
22183
22255
  return results;
22184
22256
  }
22257
+ function pruneLegacySkillDirs(projectRoot, scope, bundled = new Set(listBundledSkills())) {
22258
+ if (bundled.size === 0) return [];
22259
+ const legacy = LEGACY_ARGENT_SKILL_NAMES.filter((name) => !bundled.has(name));
22260
+ const { skillTargets } = getManagedContentTargets(
22261
+ ALL_ADAPTERS,
22262
+ projectRoot,
22263
+ scope === "global" ? "global" : "local"
22264
+ );
22265
+ const removed = /* @__PURE__ */ new Set();
22266
+ for (const { targetPath } of skillTargets) {
22267
+ for (const name of legacy) {
22268
+ const dir = path20.join(targetPath, name);
22269
+ try {
22270
+ if (!fs19.lstatSync(dir, { throwIfNoEntry: false })) continue;
22271
+ fs19.rmSync(dir, { recursive: true, force: true });
22272
+ removed.add(name);
22273
+ } catch {
22274
+ }
22275
+ }
22276
+ }
22277
+ const lockPath = scope === "global" ? getGlobalSkillLockPath() : getProjectSkillLockPath(projectRoot);
22278
+ for (const name of removeLockEntries(lockPath, legacy)) removed.add(name);
22279
+ return [...removed].sort();
22280
+ }
22281
+ function listTrackedLegacySkills(projectRoot, scope, bundled = new Set(listBundledSkills())) {
22282
+ if (bundled.size === 0) return [];
22283
+ const lockPath = scope === "global" ? getGlobalSkillLockPath() : getProjectSkillLockPath(projectRoot);
22284
+ return listArgentSkillsInLock(lockPath).filter(
22285
+ (name) => LEGACY_ARGENT_SKILL_NAMES.includes(name) && !bundled.has(name)
22286
+ );
22287
+ }
22288
+ function removeLockEntries(lockPath, names) {
22289
+ try {
22290
+ const lock = JSON.parse(fs19.readFileSync(lockPath, "utf8"));
22291
+ const skills = lock.skills;
22292
+ if (!skills) return [];
22293
+ const removed = names.filter((name) => name in skills);
22294
+ if (removed.length === 0) return [];
22295
+ for (const name of removed) delete skills[name];
22296
+ fs19.writeFileSync(lockPath, JSON.stringify(lock, null, 2) + "\n");
22297
+ return removed;
22298
+ } catch {
22299
+ return [];
22300
+ }
22301
+ }
22185
22302
  function formatSkillRefreshSummary(results) {
22186
22303
  const lines = [];
22187
22304
  for (const r2 of results) {
@@ -22544,7 +22661,7 @@ async function chooseAdapters(opts) {
22544
22661
  // ../argent-installer/src/init-scope.ts
22545
22662
  var import_picocolors5 = __toESM(require_picocolors(), 1);
22546
22663
  import { existsSync as existsSync13 } from "node:fs";
22547
- import { resolve as resolve10 } from "node:path";
22664
+ import { resolve as resolve11 } from "node:path";
22548
22665
  async function chooseScope(opts) {
22549
22666
  if (opts.installMode === "local") {
22550
22667
  return { scope: "local" };
@@ -22581,13 +22698,13 @@ async function chooseScope(opts) {
22581
22698
  placeholder: process.cwd(),
22582
22699
  validate(value) {
22583
22700
  if (!value?.trim()) return "Path cannot be empty.";
22584
- const resolved = resolve10(value.trim());
22701
+ const resolved = resolve11(value.trim());
22585
22702
  if (!existsSync13(resolved))
22586
22703
  return `Path does not exist: ${resolved}. Please verify and enter a valid path.`;
22587
22704
  }
22588
22705
  });
22589
22706
  if (isCancel(customPathInput)) throw new InitCancelled("scope");
22590
- return { scope: "custom", customRoot: resolve10(customPathInput.trim()) };
22707
+ return { scope: "custom", customRoot: resolve11(customPathInput.trim()) };
22591
22708
  }
22592
22709
 
22593
22710
  // ../argent-installer/src/init-mcp-write.ts
@@ -22876,6 +22993,7 @@ async function configureAllowlist(args) {
22876
22993
  // ../argent-installer/src/init-skills.ts
22877
22994
  var import_picocolors9 = __toESM(require_picocolors(), 1);
22878
22995
  import { spawn as spawn3 } from "node:child_process";
22996
+ import * as os3 from "node:os";
22879
22997
  async function runSkillsStep(args) {
22880
22998
  const { nonInteractive, fromTar, version, scope, customRoot } = args;
22881
22999
  log.step(import_picocolors9.default.bold("Step 2: Skills Installation"));
@@ -22963,6 +23081,33 @@ async function runSkillsStep(args) {
22963
23081
  spinner2.stop("Skills installed.");
22964
23082
  }
22965
23083
  skillOutcome = "success";
23084
+ const sourceIsBundled = skillsSource === SKILLS_DIR || version === getInstalledVersion();
23085
+ if (skillsMethod === "default" && sourceIsBundled) {
23086
+ const pruneRoot = scope === "global" ? os3.homedir() : skillsCwd ?? process.cwd();
23087
+ const pruneScope = scope === "global" ? "global" : "project";
23088
+ const tracked = listTrackedLegacySkills(pruneRoot, pruneScope);
23089
+ const removed = /* @__PURE__ */ new Set();
23090
+ if (tracked.length > 0) {
23091
+ const removeArgs = ["skills", "remove", "-y", ...scope === "global" ? ["-g"] : []];
23092
+ try {
23093
+ await runNpxSkills(
23094
+ withNpmForce([
23095
+ ...offlineWithCache ? ["--no-install"] : [],
23096
+ ...removeArgs,
23097
+ ...tracked
23098
+ ]),
23099
+ false,
23100
+ skillsCwd
23101
+ );
23102
+ for (const name of tracked) removed.add(name);
23103
+ } catch {
23104
+ }
23105
+ }
23106
+ for (const name of pruneLegacySkillDirs(pruneRoot, pruneScope)) removed.add(name);
23107
+ if (removed.size > 0) {
23108
+ log.info(import_picocolors9.default.dim(`Removed legacy skills: ${[...removed].sort().join(", ")}`));
23109
+ }
23110
+ }
22966
23111
  } catch (err) {
22967
23112
  if (skillsMethod === "default") {
22968
23113
  spinner2.stop(import_picocolors9.default.red("Skills installation failed."));
@@ -22982,7 +23127,7 @@ async function runSkillsStep(args) {
22982
23127
  return skillsMethod;
22983
23128
  }
22984
23129
  function runNpxSkills(args, interactive, cwd) {
22985
- return new Promise((resolve16, reject) => {
23130
+ return new Promise((resolve17, reject) => {
22986
23131
  const npxCmd = process.platform === "win32" ? "npx.cmd" : "npx";
22987
23132
  const child = spawn3(npxCmd, args, {
22988
23133
  env: npxChildEnv(),
@@ -23002,7 +23147,7 @@ function runNpxSkills(args, interactive, cwd) {
23002
23147
  }
23003
23148
  child.on("close", (code) => {
23004
23149
  if (code === 0) {
23005
- resolve16();
23150
+ resolve17();
23006
23151
  } else {
23007
23152
  const output = [stderr, stdout2].filter(Boolean).join("\n").trim();
23008
23153
  reject(new Error(output || `npx skills exited with code ${code}`));
@@ -23287,10 +23432,56 @@ function printBanner() {
23287
23432
  // ../argent-installer/src/update.ts
23288
23433
  var import_picocolors11 = __toESM(require_picocolors(), 1);
23289
23434
  var import_semver5 = __toESM(require_semver2(), 1);
23290
- import * as path24 from "node:path";
23435
+ import * as path26 from "node:path";
23436
+
23437
+ // ../argent-installer/src/install-targets.ts
23438
+ function parseTargetFlags(args) {
23439
+ return { global: args.includes("--global"), local: args.includes("--local") };
23440
+ }
23441
+ function decideInstallTargets(ctx) {
23442
+ const { flags } = ctx;
23443
+ if (flags.global || flags.local) {
23444
+ const targets = [];
23445
+ if (flags.global) targets.push("global");
23446
+ if (flags.local) targets.push("local");
23447
+ return { kind: "targets", targets, reason: "flags" };
23448
+ }
23449
+ if (ctx.globalPresent && ctx.localPresent) {
23450
+ if (ctx.nonInteractive) {
23451
+ return {
23452
+ kind: "targets",
23453
+ targets: ctx.nonInteractiveBothDefault,
23454
+ reason: "noninteractive-both"
23455
+ };
23456
+ }
23457
+ return { kind: "prompt" };
23458
+ }
23459
+ return { kind: "targets", targets: [ctx.defaultTarget], reason: "single" };
23460
+ }
23461
+ async function promptInstallTargets(verb) {
23462
+ const selected = await multiselect({
23463
+ message: `argent is installed both globally and in this project. Which should ${verb === "update" ? "update" : "removal"} affect?`,
23464
+ options: [
23465
+ {
23466
+ value: "global",
23467
+ label: "Global install",
23468
+ hint: "the argent command on your PATH"
23469
+ },
23470
+ {
23471
+ value: "local",
23472
+ label: "This project's devDependency",
23473
+ hint: `${PACKAGE_NAME} in this project's node_modules`
23474
+ }
23475
+ ],
23476
+ initialValues: verb === "update" ? ["global", "local"] : ["local"],
23477
+ required: true
23478
+ });
23479
+ if (isCancel(selected)) return "cancel";
23480
+ return selected;
23481
+ }
23291
23482
 
23292
23483
  // ../argent-installer/src/update-target.ts
23293
- var import_update_core = __toESM(require_dist2(), 1);
23484
+ var import_update_core = __toESM(require_dist3(), 1);
23294
23485
  async function resolveInstallableUpdateTarget(pm, current) {
23295
23486
  const info = await (0, import_update_core.fetchRegistryInfo)(`${NPM_REGISTRY}/${PACKAGE_NAME}`);
23296
23487
  if (info === null) return null;
@@ -23306,17 +23497,17 @@ async function resolveInstallableUpdateTarget(pm, current) {
23306
23497
 
23307
23498
  // ../argent-tools-client/src/launcher.ts
23308
23499
  import * as net from "node:net";
23309
- import * as fs18 from "node:fs";
23310
- import * as path19 from "node:path";
23500
+ import * as fs20 from "node:fs";
23501
+ import * as path21 from "node:path";
23311
23502
  import * as readline from "node:readline";
23312
- import { homedir as homedir5 } from "node:os";
23503
+ import { homedir as homedir6 } from "node:os";
23313
23504
  import { spawn as spawn4, execFileSync as execFileSync7 } from "node:child_process";
23314
23505
  import { createHash as createHash2, randomBytes } from "node:crypto";
23315
23506
  import { mkdir, writeFile, readFile, readdir as readdir2, unlink, rename, chmod } from "node:fs/promises";
23316
- var STATE_DIR = path19.join(homedir5(), ".argent");
23317
- var STATE_FILE = path19.join(STATE_DIR, "tool-server.json");
23318
- var LOG_FILE = path19.join(STATE_DIR, "tool-server.log");
23319
- var LOCK_FILE = path19.join(STATE_DIR, "tool-server.lock");
23507
+ var STATE_DIR = path21.join(homedir6(), ".argent");
23508
+ var STATE_FILE = path21.join(STATE_DIR, "tool-server.json");
23509
+ var LOG_FILE = path21.join(STATE_DIR, "tool-server.log");
23510
+ var LOCK_FILE = path21.join(STATE_DIR, "tool-server.lock");
23320
23511
  function isProcessAlive(pid) {
23321
23512
  try {
23322
23513
  process.kill(pid, 0);
@@ -23327,7 +23518,7 @@ function isProcessAlive(pid) {
23327
23518
  }
23328
23519
  function stateFileForBundle(bundlePath) {
23329
23520
  const key = createHash2("sha256").update(bundlePath).digest("hex").slice(0, 12);
23330
- return path19.join(STATE_DIR, `tool-server-${key}.json`);
23521
+ return path21.join(STATE_DIR, `tool-server-${key}.json`);
23331
23522
  }
23332
23523
  async function readStateFile(file) {
23333
23524
  try {
@@ -23369,7 +23560,7 @@ async function readAllToolsServerStates() {
23369
23560
  const out = [];
23370
23561
  for (const name of names) {
23371
23562
  if (!STATE_FILE_RE.test(name)) continue;
23372
- const file = path19.join(STATE_DIR, name);
23563
+ const file = path21.join(STATE_DIR, name);
23373
23564
  const state2 = await readStateFile(file);
23374
23565
  if (state2) out.push({ file, state: state2 });
23375
23566
  }
@@ -23415,21 +23606,21 @@ async function killToolServer(bundlePath) {
23415
23606
  return alive;
23416
23607
  }
23417
23608
  function isPathWithin(child, parent) {
23418
- const rel = path19.relative(parent, child);
23419
- return rel !== "" && !rel.startsWith("..") && !path19.isAbsolute(rel);
23609
+ const rel = path21.relative(parent, child);
23610
+ return rel !== "" && !rel.startsWith("..") && !path21.isAbsolute(rel);
23420
23611
  }
23421
23612
  function tryRealpath(p) {
23422
23613
  try {
23423
- return fs18.realpathSync(p);
23614
+ return fs20.realpathSync(p);
23424
23615
  } catch {
23425
23616
  return p;
23426
23617
  }
23427
23618
  }
23428
23619
  async function killToolServerForInstallDir(packageDir) {
23429
- const parents = /* @__PURE__ */ new Set([path19.resolve(packageDir), tryRealpath(packageDir)]);
23620
+ const parents = /* @__PURE__ */ new Set([path21.resolve(packageDir), tryRealpath(packageDir)]);
23430
23621
  let killed = 0;
23431
23622
  for (const { file, state: state2 } of await readAllToolsServerStates()) {
23432
- const bundles = /* @__PURE__ */ new Set([path19.resolve(state2.bundlePath), tryRealpath(state2.bundlePath)]);
23623
+ const bundles = /* @__PURE__ */ new Set([path21.resolve(state2.bundlePath), tryRealpath(state2.bundlePath)]);
23433
23624
  const matches2 = [...bundles].some((b) => [...parents].some((p) => isPathWithin(b, p)));
23434
23625
  if (!matches2) continue;
23435
23626
  const fresh = await readStateFile(file);
@@ -23447,7 +23638,7 @@ async function killToolServerForInstallDir(packageDir) {
23447
23638
  }
23448
23639
  return killed;
23449
23640
  }
23450
- var PS_BIN = ["/bin/ps", "/usr/bin/ps"].find((p) => fs18.existsSync(p)) ?? "ps";
23641
+ var PS_BIN = ["/bin/ps", "/usr/bin/ps"].find((p) => fs20.existsSync(p)) ?? "ps";
23451
23642
  var PS_WIDTH_FLAGS = ["-ww"];
23452
23643
  var PS_LOCALE = process.platform === "darwin" ? "en_US.UTF-8" : "C.UTF-8";
23453
23644
  function readProcessCommandLine(pid, flags = PS_WIDTH_FLAGS, env = { ...process.env, LC_ALL: PS_LOCALE }) {
@@ -23491,18 +23682,18 @@ function couldBeOurToolServer(pid, marker) {
23491
23682
  }
23492
23683
 
23493
23684
  // ../argent-tools-client/src/tools-client.ts
23494
- import * as path23 from "node:path";
23685
+ import * as path25 from "node:path";
23495
23686
 
23496
23687
  // ../argent-tools-client/src/link-config.ts
23497
- import * as path20 from "node:path";
23498
- import { homedir as homedir6 } from "node:os";
23688
+ import * as path22 from "node:path";
23689
+ import { homedir as homedir7 } from "node:os";
23499
23690
  import { mkdir as mkdir2, writeFile as writeFile2, readFile as readFile2, unlink as unlink2, chmod as chmod2 } from "node:fs/promises";
23500
- var LINK_DIR = path20.join(homedir6(), ".argent");
23501
- var LINK_FILE = path20.join(LINK_DIR, "link.json");
23691
+ var LINK_DIR = path22.join(homedir7(), ".argent");
23692
+ var LINK_FILE = path22.join(LINK_DIR, "link.json");
23502
23693
 
23503
23694
  // ../argent-tools-client/src/file-inputs.ts
23504
23695
  import { createHash as createHash3, randomUUID as randomUUID6 } from "node:crypto";
23505
- import { createReadStream, rmSync as rmSync6 } from "node:fs";
23696
+ import { createReadStream, rmSync as rmSync7 } from "node:fs";
23506
23697
  import {
23507
23698
  chmod as chmod3,
23508
23699
  lstat,
@@ -23511,16 +23702,16 @@ import {
23511
23702
  realpath as realpath2,
23512
23703
  rename as rename2,
23513
23704
  rm as rm2,
23514
- stat as stat2,
23705
+ stat as stat3,
23515
23706
  writeFile as writeFile3
23516
23707
  } from "node:fs/promises";
23517
23708
  import { constants, tmpdir } from "node:os";
23518
- import * as path21 from "node:path";
23709
+ import * as path23 from "node:path";
23519
23710
 
23520
23711
  // ../archive/src/index.ts
23521
23712
  import { execFile } from "node:child_process";
23522
23713
  import { rm, readdir as readdir3 } from "node:fs/promises";
23523
- import { basename as basename3, dirname as dirname12, join as join20, posix as posix2, resolve as resolve12, sep as sep4 } from "node:path";
23714
+ import { basename as basename4, dirname as dirname13, join as join22, posix as posix2, resolve as resolve13, sep as sep4 } from "node:path";
23524
23715
  import { promisify } from "node:util";
23525
23716
  var execFileAsync = promisify(execFile);
23526
23717
 
@@ -23528,16 +23719,16 @@ var execFileAsync = promisify(execFile);
23528
23719
  var MAX_CONTENT_BYTES = 32 * 1024 * 1024;
23529
23720
 
23530
23721
  // ../argent-tools-client/src/flow-files.ts
23531
- var import_yaml3 = __toESM(require_dist(), 1);
23532
- import { readdir as readdir4, readFile as readFile4, realpath as realpath3, stat as stat3 } from "node:fs/promises";
23533
- import * as path22 from "node:path";
23722
+ var import_yaml3 = __toESM(require_dist2(), 1);
23723
+ import { readdir as readdir4, readFile as readFile4, realpath as realpath3, stat as stat4 } from "node:fs/promises";
23724
+ import * as path24 from "node:path";
23534
23725
  var INLINE_MEMBERS_BYTES = 256 * 1024;
23535
23726
 
23536
23727
  // ../argent-tools-client/src/artifacts.ts
23537
- import { copyFile, mkdir as mkdir4, readFile as readFile5, realpath as realpath4, rm as rm3, stat as stat4, writeFile as writeFile4 } from "node:fs/promises";
23728
+ import { copyFile, mkdir as mkdir4, readFile as readFile5, realpath as realpath4, rm as rm3, stat as stat5, writeFile as writeFile4 } from "node:fs/promises";
23538
23729
  import { constants as fsConstants } from "node:fs";
23539
23730
  import { tmpdir as tmpdir2 } from "node:os";
23540
- import { basename as basename6, dirname as dirname16, extname as extname2, isAbsolute as isAbsolute8, join as join23, normalize as normalize2, resolve as resolve14, sep as sep6 } from "node:path";
23731
+ import { basename as basename7, dirname as dirname17, extname as extname2, isAbsolute as isAbsolute8, join as join26, normalize as normalize2, resolve as resolve15, sep as sep6 } from "node:path";
23541
23732
  import { createHash as createHash4 } from "node:crypto";
23542
23733
  var ALLOWED_SAVE_DIRS = /* @__PURE__ */ new Set([normalize2(".argent/recordings")]);
23543
23734
  var RECORDINGS_SAVE_DIR = normalize2(".argent/recordings");
@@ -23896,7 +24087,7 @@ async function update(args) {
23896
24087
  process.exit(1);
23897
24088
  }
23898
24089
  const rootOverride = getProjectRootOverride(args);
23899
- const projectRoot = rootOverride ? path24.resolve(rootOverride) : resolveProjectRoot2(process.cwd());
24090
+ const projectRoot = rootOverride ? path26.resolve(rootOverride) : resolveProjectRoot2(process.cwd());
23900
24091
  installMode = resolveInstallMode(projectRoot);
23901
24092
  const flags = parseTargetFlags(args);
23902
24093
  const localInstalled = installMode === "local" && probeLocalInstall(projectRoot).installed;
@@ -24078,9 +24269,9 @@ async function update(args) {
24078
24269
 
24079
24270
  // ../argent-installer/src/uninstall.ts
24080
24271
  var import_picocolors12 = __toESM(require_picocolors(), 1);
24081
- var import_yaml4 = __toESM(require_dist(), 1);
24082
- import * as fs19 from "node:fs";
24083
- import * as path25 from "node:path";
24272
+ var import_yaml4 = __toESM(require_dist2(), 1);
24273
+ import * as fs21 from "node:fs";
24274
+ import * as path27 from "node:path";
24084
24275
  var UNINSTALL_TOOLSERVER_STOP_FAILED = {
24085
24276
  error_code: FAILURE_CODES.UNINSTALL_TOOLSERVER_STOP_FAILED,
24086
24277
  failure_stage: "installer_uninstall_toolserver_stop",
@@ -24101,10 +24292,10 @@ var UNINSTALL_UNCLASSIFIED_FAILED = {
24101
24292
  };
24102
24293
  function removeDirIfEmpty2(dirPath) {
24103
24294
  try {
24104
- if (!fs19.existsSync(dirPath)) return false;
24105
- if (!fs19.statSync(dirPath).isDirectory()) return false;
24106
- if (fs19.readdirSync(dirPath).length > 0) return false;
24107
- fs19.rmdirSync(dirPath);
24295
+ if (!fs21.existsSync(dirPath)) return false;
24296
+ if (!fs21.statSync(dirPath).isDirectory()) return false;
24297
+ if (fs21.readdirSync(dirPath).length > 0) return false;
24298
+ fs21.rmdirSync(dirPath);
24108
24299
  return true;
24109
24300
  } catch {
24110
24301
  return false;
@@ -24114,9 +24305,9 @@ function collectBundledPaths(sourceDir) {
24114
24305
  const files = [];
24115
24306
  const directories = [];
24116
24307
  function walk(currentDir, relativeDir = "") {
24117
- for (const entry of fs19.readdirSync(currentDir, { withFileTypes: true })) {
24118
- const relativePath = relativeDir ? path25.join(relativeDir, entry.name) : entry.name;
24119
- const absolutePath = path25.join(currentDir, entry.name);
24308
+ for (const entry of fs21.readdirSync(currentDir, { withFileTypes: true })) {
24309
+ const relativePath = relativeDir ? path27.join(relativeDir, entry.name) : entry.name;
24310
+ const absolutePath = path27.join(currentDir, entry.name);
24120
24311
  if (entry.isDirectory()) {
24121
24312
  walk(absolutePath, relativePath);
24122
24313
  directories.push(relativePath);
@@ -24129,52 +24320,52 @@ function collectBundledPaths(sourceDir) {
24129
24320
  return { files, directories };
24130
24321
  }
24131
24322
  function removeBundledContent(sourceDir, targetDir) {
24132
- if (!fs19.existsSync(sourceDir) || !fs19.existsSync(targetDir)) {
24323
+ if (!fs21.existsSync(sourceDir) || !fs21.existsSync(targetDir)) {
24133
24324
  return { removedPaths: [], removedRoot: false };
24134
24325
  }
24135
24326
  const { files, directories } = collectBundledPaths(sourceDir);
24136
24327
  const removedPaths = [];
24137
24328
  for (const relativePath of files) {
24138
- const targetPath = path25.join(targetDir, relativePath);
24329
+ const targetPath = path27.join(targetDir, relativePath);
24139
24330
  try {
24140
- if (!fs19.existsSync(targetPath)) continue;
24141
- if (fs19.lstatSync(targetPath).isDirectory()) continue;
24142
- fs19.rmSync(targetPath, { force: true });
24331
+ if (!fs21.existsSync(targetPath)) continue;
24332
+ if (fs21.lstatSync(targetPath).isDirectory()) continue;
24333
+ fs21.rmSync(targetPath, { force: true });
24143
24334
  removedPaths.push(relativePath);
24144
24335
  } catch {
24145
24336
  }
24146
24337
  }
24147
24338
  directories.sort(
24148
- (a2, b) => b.split(path25.sep).length - a2.split(path25.sep).length || b.length - a2.length
24339
+ (a2, b) => b.split(path27.sep).length - a2.split(path27.sep).length || b.length - a2.length
24149
24340
  );
24150
24341
  for (const relativePath of directories) {
24151
- const targetPath = path25.join(targetDir, relativePath);
24342
+ const targetPath = path27.join(targetDir, relativePath);
24152
24343
  try {
24153
- if (!fs19.existsSync(targetPath)) continue;
24154
- if (!fs19.statSync(targetPath).isDirectory()) continue;
24155
- if (fs19.readdirSync(targetPath).length > 0) continue;
24156
- fs19.rmdirSync(targetPath);
24344
+ if (!fs21.existsSync(targetPath)) continue;
24345
+ if (!fs21.statSync(targetPath).isDirectory()) continue;
24346
+ if (fs21.readdirSync(targetPath).length > 0) continue;
24347
+ fs21.rmdirSync(targetPath);
24157
24348
  } catch {
24158
24349
  }
24159
24350
  }
24160
24351
  let removedRoot = false;
24161
24352
  try {
24162
- if (fs19.existsSync(targetDir) && fs19.statSync(targetDir).isDirectory()) {
24163
- if (fs19.readdirSync(targetDir).length === 0) {
24164
- fs19.rmdirSync(targetDir);
24353
+ if (fs21.existsSync(targetDir) && fs21.statSync(targetDir).isDirectory()) {
24354
+ if (fs21.readdirSync(targetDir).length === 0) {
24355
+ fs21.rmdirSync(targetDir);
24165
24356
  removedRoot = true;
24166
24357
  }
24167
24358
  }
24168
24359
  } catch {
24169
24360
  }
24170
24361
  if (removedRoot) {
24171
- removeDirIfEmpty2(path25.dirname(targetDir));
24362
+ removeDirIfEmpty2(path27.dirname(targetDir));
24172
24363
  }
24173
24364
  return { removedPaths, removedRoot };
24174
24365
  }
24175
24366
  function readBundledSkillName(skillFilePath, fallbackName) {
24176
24367
  try {
24177
- const content = fs19.readFileSync(skillFilePath, "utf8");
24368
+ const content = fs21.readFileSync(skillFilePath, "utf8");
24178
24369
  const frontmatter = content.match(/^---\r?\n([\s\S]*?)\r?\n---/)?.[1];
24179
24370
  if (!frontmatter) return fallbackName;
24180
24371
  const data = (0, import_yaml4.parse)(frontmatter);
@@ -24185,30 +24376,30 @@ function readBundledSkillName(skillFilePath, fallbackName) {
24185
24376
  }
24186
24377
  }
24187
24378
  function getBundledSkillNames(skillsDir) {
24188
- if (!fs19.existsSync(skillsDir)) return [];
24379
+ if (!fs21.existsSync(skillsDir)) return [];
24189
24380
  const skillNames = [];
24190
- for (const entry of fs19.readdirSync(skillsDir, { withFileTypes: true })) {
24381
+ for (const entry of fs21.readdirSync(skillsDir, { withFileTypes: true })) {
24191
24382
  if (!entry.isDirectory()) continue;
24192
- const skillFilePath = path25.join(skillsDir, entry.name, "SKILL.md");
24193
- if (!fs19.existsSync(skillFilePath)) continue;
24383
+ const skillFilePath = path27.join(skillsDir, entry.name, "SKILL.md");
24384
+ if (!fs21.existsSync(skillFilePath)) continue;
24194
24385
  skillNames.push(readBundledSkillName(skillFilePath, entry.name));
24195
24386
  }
24196
24387
  return [...new Set(skillNames)].sort();
24197
24388
  }
24198
24389
  function removeBundledSkillInstalls(skillNames, targetDir) {
24199
- if (!fs19.existsSync(targetDir)) {
24390
+ if (!fs21.existsSync(targetDir)) {
24200
24391
  return { removedPaths: [], removedRoot: false };
24201
24392
  }
24202
24393
  const removedPaths = [];
24203
24394
  for (const skillName of skillNames) {
24204
- const targetPath = path25.join(targetDir, skillName);
24395
+ const targetPath = path27.join(targetDir, skillName);
24205
24396
  try {
24206
- const stats = fs19.lstatSync(targetPath, { throwIfNoEntry: false });
24397
+ const stats = fs21.lstatSync(targetPath, { throwIfNoEntry: false });
24207
24398
  if (!stats) continue;
24208
24399
  if (stats.isDirectory() && !stats.isSymbolicLink()) {
24209
- fs19.rmSync(targetPath, { recursive: true, force: true });
24400
+ fs21.rmSync(targetPath, { recursive: true, force: true });
24210
24401
  } else {
24211
- fs19.rmSync(targetPath, { force: true });
24402
+ fs21.rmSync(targetPath, { force: true });
24212
24403
  }
24213
24404
  removedPaths.push(skillName);
24214
24405
  } catch {
@@ -24216,17 +24407,17 @@ function removeBundledSkillInstalls(skillNames, targetDir) {
24216
24407
  }
24217
24408
  const removedRoot = removeDirIfEmpty2(targetDir);
24218
24409
  if (removedRoot) {
24219
- removeDirIfEmpty2(path25.dirname(targetDir));
24410
+ removeDirIfEmpty2(path27.dirname(targetDir));
24220
24411
  }
24221
24412
  return { removedPaths, removedRoot };
24222
24413
  }
24223
24414
  function cleanupSkillsLockFile(lockPath, skillNames) {
24224
- if (!fs19.existsSync(lockPath)) {
24415
+ if (!fs21.existsSync(lockPath)) {
24225
24416
  return { removedSkills: [], removedFile: false };
24226
24417
  }
24227
24418
  let parsed;
24228
24419
  try {
24229
- parsed = JSON.parse(fs19.readFileSync(lockPath, "utf8"));
24420
+ parsed = JSON.parse(fs21.readFileSync(lockPath, "utf8"));
24230
24421
  } catch {
24231
24422
  return { removedSkills: [], removedFile: false };
24232
24423
  }
@@ -24253,10 +24444,10 @@ function cleanupSkillsLockFile(lockPath, skillNames) {
24253
24444
  parsed.skills && typeof parsed.skills === "object" && Object.keys(parsed.skills).length > 0
24254
24445
  );
24255
24446
  if (!hasSkills && otherKeys.length === 0) {
24256
- fs19.rmSync(lockPath, { force: true });
24447
+ fs21.rmSync(lockPath, { force: true });
24257
24448
  return { removedSkills, removedFile: true };
24258
24449
  }
24259
- fs19.writeFileSync(lockPath, JSON.stringify(parsed, null, 2) + "\n");
24450
+ fs21.writeFileSync(lockPath, JSON.stringify(parsed, null, 2) + "\n");
24260
24451
  return { removedSkills, removedFile: false };
24261
24452
  }
24262
24453
  function cleanupBundledSkills(skillNames, targets) {
@@ -24422,9 +24613,11 @@ async function uninstall(args) {
24422
24613
  };
24423
24614
  const localTargets = scopesToClean.has("local") ? getManagedContentTargets(ALL_ADAPTERS, projectRoot, "local") : emptyTargets;
24424
24615
  const globalTargets = scopesToClean.has("global") ? getManagedContentTargets(ALL_ADAPTERS, projectRoot, "global") : emptyTargets;
24425
- const bundledSkillNames = getBundledSkillNames(SKILLS_DIR);
24616
+ const argentSkillNames = [
24617
+ .../* @__PURE__ */ new Set([...getBundledSkillNames(SKILLS_DIR), ...LEGACY_ARGENT_SKILL_NAMES])
24618
+ ].sort();
24426
24619
  pruneResults.push(
24427
- ...cleanupBundledSkills(bundledSkillNames, [
24620
+ ...cleanupBundledSkills(argentSkillNames, [
24428
24621
  ...localTargets.skillTargets,
24429
24622
  ...globalTargets.skillTargets
24430
24623
  ])
@@ -24436,7 +24629,7 @@ async function uninstall(args) {
24436
24629
  try {
24437
24630
  const { removedSkills, removedFile } = cleanupSkillsLockFile(
24438
24631
  targetPath,
24439
- bundledSkillNames
24632
+ argentSkillNames
24440
24633
  );
24441
24634
  if (removedSkills.length === 0 && !removedFile) continue;
24442
24635
  const itemsLabel = removedSkills.length === 1 ? "skill" : "skills";