@swmansion/argent 0.22.2-next.9 → 0.23.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.
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/dist/cli-cmds.mjs CHANGED
@@ -3292,6 +3292,14 @@ var CONFIG_SCHEMA = [
3292
3292
  // drained/reset, not just the file rewritten.
3293
3293
  manageCommand: "argent telemetry"
3294
3294
  },
3295
+ {
3296
+ key: "allowlist.enabled",
3297
+ description: "Whether `argent update` re-applies editor auto-approve allowlist rules. Unset (the default) keeps the current behavior: update refreshes the rules for editors that already have argent configured. Set to `false` to keep update from touching editor allowlists. `false` in either scope wins, so a committed project opt-out holds for every teammate.",
3298
+ scopes: ["project", "global"],
3299
+ parse: asBoolean,
3300
+ merge: "prioritize-restrictive",
3301
+ example: "false"
3302
+ },
3295
3303
  {
3296
3304
  key: "lens.agent",
3297
3305
  description: "Coding-agent id remembered by `argent lens` to skip the picker.",
@@ -7217,7 +7225,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
7217
7225
  var SESSION_ID2 = randomUUID5();
7218
7226
  function readCliVersion() {
7219
7227
  if (true) {
7220
- return "0.22.2-next.9";
7228
+ return "0.23.0";
7221
7229
  }
7222
7230
  return "0.0.0";
7223
7231
  }
@@ -15095,6 +15095,31 @@ function readConfigObject(scope = "global", options = {}) {
15095
15095
  }
15096
15096
  return {};
15097
15097
  }
15098
+ var FORBIDDEN_SEGMENTS = /* @__PURE__ */ new Set(["__proto__", "prototype", "constructor"]);
15099
+ function splitKey(dottedKey) {
15100
+ const parts = dottedKey.split(".");
15101
+ if (parts.length === 0 || parts.some((p) => p === "")) {
15102
+ throw new Error(`Invalid config key "${dottedKey}": empty path segment`);
15103
+ }
15104
+ for (const p of parts) {
15105
+ if (FORBIDDEN_SEGMENTS.has(p)) {
15106
+ throw new Error(`Invalid config key "${dottedKey}": forbidden segment "${p}"`);
15107
+ }
15108
+ }
15109
+ return parts;
15110
+ }
15111
+ function isPlainObject(value) {
15112
+ return !!value && typeof value === "object" && !Array.isArray(value);
15113
+ }
15114
+ function getAtPath(obj, dottedKey) {
15115
+ const parts = splitKey(dottedKey);
15116
+ let cur = obj;
15117
+ for (const part of parts) {
15118
+ if (!isPlainObject(cur)) return void 0;
15119
+ cur = cur[part];
15120
+ }
15121
+ return cur;
15122
+ }
15098
15123
  var LOCK_STALE_MS = 1e4;
15099
15124
  var LOCK_MAX_WAIT_MS = 2e3;
15100
15125
  var LOCK_RETRY_MS = 25;
@@ -15172,8 +15197,162 @@ var import_dotenv = __toESM(require_main(), 1);
15172
15197
  import * as fs4 from "node:fs";
15173
15198
  import * as path5 from "node:path";
15174
15199
 
15200
+ // ../configuration-core/src/merge.ts
15201
+ function mergeRestrictive(local, global2) {
15202
+ if (local === void 0) return global2;
15203
+ if (global2 === void 0) return local;
15204
+ if (typeof local === "boolean" && typeof global2 === "boolean") {
15205
+ return local && global2;
15206
+ }
15207
+ if (typeof local === "number" && typeof global2 === "number") {
15208
+ return Math.min(local, global2);
15209
+ }
15210
+ return local;
15211
+ }
15212
+ function toArray(value) {
15213
+ return Array.isArray(value) ? value : null;
15214
+ }
15215
+ function mergeUnion(local, global2) {
15216
+ const l2 = toArray(local);
15217
+ const g = toArray(global2);
15218
+ if (l2 === null && g === null) return local ?? global2;
15219
+ const merged = [...g ?? [], ...l2 ?? []];
15220
+ return Array.from(new Set(merged));
15221
+ }
15222
+ function mergeIntersection(local, global2) {
15223
+ const l2 = toArray(local);
15224
+ const g = toArray(global2);
15225
+ if (l2 === null && g === null) return local ?? global2;
15226
+ if (l2 === null) return global2;
15227
+ if (g === null) return local;
15228
+ const globalSet = new Set(g);
15229
+ return l2.filter((item) => globalSet.has(item));
15230
+ }
15231
+ function applyMergePolicy(policy, local, global2) {
15232
+ if (typeof policy === "function") return policy({ local, global: global2 });
15233
+ switch (policy) {
15234
+ case "prioritize-local":
15235
+ return local ?? global2;
15236
+ case "prioritize-global":
15237
+ return global2 ?? local;
15238
+ case "prioritize-restrictive":
15239
+ return mergeRestrictive(local, global2);
15240
+ case "union":
15241
+ return mergeUnion(local, global2);
15242
+ case "intersection":
15243
+ return mergeIntersection(local, global2);
15244
+ default: {
15245
+ const _exhaustive = policy;
15246
+ return _exhaustive;
15247
+ }
15248
+ }
15249
+ }
15250
+
15251
+ // ../configuration-core/src/config-schema.ts
15252
+ function asBoolean(raw) {
15253
+ return typeof raw === "boolean" ? raw : void 0;
15254
+ }
15255
+ function asString(raw) {
15256
+ if (typeof raw !== "string") return void 0;
15257
+ const trimmed = raw.trim();
15258
+ return trimmed === "" ? void 0 : trimmed;
15259
+ }
15260
+ function asStringArray(raw) {
15261
+ if (!Array.isArray(raw)) return void 0;
15262
+ const out = [];
15263
+ for (const item of raw) {
15264
+ if (typeof item === "string" && item.trim() !== "") out.push(item.trim());
15265
+ }
15266
+ return out;
15267
+ }
15268
+ var CONFIG_SCHEMA = [
15269
+ {
15270
+ key: "telemetry.enabled",
15271
+ description: "Whether anonymous opt-out telemetry is enabled (on by default; environment opt-outs like DO_NOT_TRACK are not reflected here \u2014 `argent telemetry status` shows effective consent). `false` in either scope wins, so a committed project opt-out holds for every teammate.",
15272
+ scopes: ["project", "global"],
15273
+ parse: asBoolean,
15274
+ merge: "prioritize-restrictive",
15275
+ // Opt-out: consent.ts reads an unstored value as enabled, so the config
15276
+ // surface must show the same rather than "(unset)".
15277
+ default: true,
15278
+ // Opt-in/out goes through the dedicated command so the live client is
15279
+ // drained/reset, not just the file rewritten.
15280
+ manageCommand: "argent telemetry"
15281
+ },
15282
+ {
15283
+ key: "allowlist.enabled",
15284
+ description: "Whether `argent update` re-applies editor auto-approve allowlist rules. Unset (the default) keeps the current behavior: update refreshes the rules for editors that already have argent configured. Set to `false` to keep update from touching editor allowlists. `false` in either scope wins, so a committed project opt-out holds for every teammate.",
15285
+ scopes: ["project", "global"],
15286
+ parse: asBoolean,
15287
+ merge: "prioritize-restrictive",
15288
+ example: "false"
15289
+ },
15290
+ {
15291
+ key: "lens.agent",
15292
+ description: "Coding-agent id remembered by `argent lens` to skip the picker.",
15293
+ scopes: ["project", "global"],
15294
+ parse: asString,
15295
+ merge: "prioritize-local",
15296
+ example: "claude"
15297
+ },
15298
+ {
15299
+ key: "ios.additionalDeviceSets",
15300
+ description: "Additional CoreSimulator device-set directories whose simulators argent should see alongside the default set. Absolute paths (or ~/\u2026); relative entries resolve against the project root (project scope) or home (global scope).",
15301
+ scopes: ["project", "global"],
15302
+ parse: asStringArray,
15303
+ // Additive rather than shadowing: global baseline first, project extras
15304
+ // after, deduplicated. `getAdditionalIosDeviceSets` re-implements this union
15305
+ // (path resolution must precede dedup) and guards on the preset staying "union".
15306
+ merge: "union",
15307
+ example: '["~/DeviceSets/ci"]'
15308
+ },
15309
+ {
15310
+ key: "recordings.directory",
15311
+ description: "Directory where finished screen recordings (mp4) are saved on the client host. Absolute, `~`-prefixed, or relative to the project root (home dir when not in a project). Unset \u21D2 `.argent/recordings` under the project root.",
15312
+ scopes: ["project", "global"],
15313
+ parse: asString,
15314
+ // Resolved on the client (the machine the mp4 is persisted to), so with a
15315
+ // remote `argent link` tool-server it is the *client's* config that decides.
15316
+ merge: "prioritize-local",
15317
+ example: "~/Movies/argent"
15318
+ }
15319
+ ];
15320
+ function getConfigDefinition(key, registry = CONFIG_SCHEMA) {
15321
+ return registry.find((def) => def.key === key);
15322
+ }
15323
+
15175
15324
  // ../configuration-core/src/config-access.ts
15176
15325
  import * as path6 from "node:path";
15326
+ function readScopeValue(def, scope, options) {
15327
+ if (!def.scopes.includes(scope)) return void 0;
15328
+ const raw = getAtPath(readConfigObject(scope, options), def.key);
15329
+ return raw === void 0 ? void 0 : def.parse(raw);
15330
+ }
15331
+ function getConfigValue(def, options = {}) {
15332
+ const local = readScopeValue(def, "project", options);
15333
+ const global2 = readScopeValue(def, "global", options);
15334
+ const merged = applyMergePolicy(def.merge, local, global2);
15335
+ return merged ?? def.default;
15336
+ }
15337
+ function getConfigValueByKey(key, options = {}, registry = CONFIG_SCHEMA) {
15338
+ const def = requireDefinition(key, registry);
15339
+ return getConfigValue(def, options);
15340
+ }
15341
+ function requireDefinition(key, registry = CONFIG_SCHEMA) {
15342
+ const def = getConfigDefinition(key, registry);
15343
+ if (!def) {
15344
+ throw new UnknownConfigKeyError(key);
15345
+ }
15346
+ return def;
15347
+ }
15348
+ var UnknownConfigKeyError = class extends Error {
15349
+ constructor(key) {
15350
+ super(`Unknown configuration key "${key}".`);
15351
+ this.key = key;
15352
+ this.name = "UnknownConfigKeyError";
15353
+ }
15354
+ key;
15355
+ };
15177
15356
 
15178
15357
  // ../telemetry/src/paths.ts
15179
15358
  function identityFilePath() {
@@ -16431,7 +16610,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
16431
16610
  var SESSION_ID = randomUUID4();
16432
16611
  function readCliVersion() {
16433
16612
  if (true) {
16434
- return "0.22.2-next.9";
16613
+ return "0.23.0";
16435
16614
  }
16436
16615
  return "0.0.0";
16437
16616
  }
@@ -23372,12 +23551,15 @@ async function update(args) {
23372
23551
  )
23373
23552
  );
23374
23553
  }
23375
- for (const [scope, adapters] of adaptersByScope) {
23376
- for (const adapter of adapters) {
23377
- if (!adapter.addAllowlist) continue;
23378
- try {
23379
- adapter.addAllowlist(projectRoot, scope);
23380
- } catch {
23554
+ const allowlistDisabled = getConfigValueByKey("allowlist.enabled", { cwd: projectRoot }) === false;
23555
+ if (!allowlistDisabled) {
23556
+ for (const [scope, adapters] of adaptersByScope) {
23557
+ for (const adapter of adapters) {
23558
+ if (!adapter.addAllowlist) continue;
23559
+ try {
23560
+ adapter.addAllowlist(projectRoot, scope);
23561
+ } catch {
23562
+ }
23381
23563
  }
23382
23564
  }
23383
23565
  }
@@ -23388,6 +23570,11 @@ async function update(args) {
23388
23570
  ...copyRulesAndAgents(localAdapters, projectRoot, "local", RULES_DIR, AGENTS_DIR)
23389
23571
  ];
23390
23572
  spinner2.stop("Configuration refreshed.");
23573
+ if (allowlistDisabled) {
23574
+ log.info(
23575
+ import_picocolors11.default.dim("Left editor auto-approve allowlists alone (allowlist.enabled is false).")
23576
+ );
23577
+ }
23391
23578
  if (results.length > 0) {
23392
23579
  note(results.join("\n"), "MCP Configs Updated");
23393
23580
  }
@@ -17156,6 +17156,14 @@ var CONFIG_SCHEMA = [
17156
17156
  // drained/reset, not just the file rewritten.
17157
17157
  manageCommand: "argent telemetry"
17158
17158
  },
17159
+ {
17160
+ key: "allowlist.enabled",
17161
+ description: "Whether `argent update` re-applies editor auto-approve allowlist rules. Unset (the default) keeps the current behavior: update refreshes the rules for editors that already have argent configured. Set to `false` to keep update from touching editor allowlists. `false` in either scope wins, so a committed project opt-out holds for every teammate.",
17162
+ scopes: ["project", "global"],
17163
+ parse: asBoolean,
17164
+ merge: "prioritize-restrictive",
17165
+ example: "false"
17166
+ },
17159
17167
  {
17160
17168
  key: "lens.agent",
17161
17169
  description: "Coding-agent id remembered by `argent lens` to skip the picker.",
@@ -90302,6 +90302,14 @@ var CONFIG_SCHEMA = [
90302
90302
  // drained/reset, not just the file rewritten.
90303
90303
  manageCommand: "argent telemetry"
90304
90304
  },
90305
+ {
90306
+ key: "allowlist.enabled",
90307
+ description: "Whether `argent update` re-applies editor auto-approve allowlist rules. Unset (the default) keeps the current behavior: update refreshes the rules for editors that already have argent configured. Set to `false` to keep update from touching editor allowlists. `false` in either scope wins, so a committed project opt-out holds for every teammate.",
90308
+ scopes: ["project", "global"],
90309
+ parse: asBoolean,
90310
+ merge: "prioritize-restrictive",
90311
+ example: "false"
90312
+ },
90305
90313
  {
90306
90314
  key: "lens.agent",
90307
90315
  description: "Coding-agent id remembered by `argent lens` to skip the picker.",
@@ -93893,7 +93901,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
93893
93901
  var SESSION_ID = (0, import_node_crypto3.randomUUID)();
93894
93902
  function readCliVersion() {
93895
93903
  if (true) {
93896
- return "0.22.2-next.9";
93904
+ return "0.23.0";
93897
93905
  }
93898
93906
  return "0.0.0";
93899
93907
  }
@@ -95244,7 +95252,7 @@ var import_node_path5 = __toESM(require("node:path"));
95244
95252
  var import_semver2 = __toESM(require_semver2());
95245
95253
 
95246
95254
  // ../tool-server/package.json
95247
- var version2 = "0.22.1";
95255
+ var version2 = "0.23.0";
95248
95256
 
95249
95257
  // ../tool-server/src/utils/update-checker.ts
95250
95258
  var import_update_core = __toESM(require_dist4());
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swmansion/argent",
3
- "version": "0.22.2-next.9",
3
+ "version": "0.23.0",
4
4
  "mcpName": "io.github.software-mansion/argent",
5
5
  "description": "MCP server for iOS Simulator and Android Emulator control",
6
6
  "license": "Apache-2.0",