@swmansion/argent 0.34.1-next.2 → 0.34.1-next.21

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 (39) hide show
  1. package/LICENSE +1 -0
  2. package/bin/argent-android-devtools-0.4.0.apk +0 -0
  3. package/bin/darwin/argent-macos-helper +0 -0
  4. package/bin/darwin/ax-service +0 -0
  5. package/bin/darwin/tvos-ax-service +0 -0
  6. package/bin/darwin/tvos-hid-daemon +0 -0
  7. package/bin/network-inspector/network-inspector.jar +0 -0
  8. package/bin/tcp/ax-service +0 -0
  9. package/dist/cli-cmds.mjs +111 -25
  10. package/dist/client.js +58 -10
  11. package/dist/installer-help.js +4 -0
  12. package/dist/installer-help.js.map +1 -1
  13. package/dist/installer.mjs +230 -160
  14. package/dist/ios-device-runner/ArgentRunner/ArgentRunnerUITests/ArgentLaunchPerformanceTests.swift +21 -0
  15. package/dist/ios-device-runner/ArgentRunner/ArgentRunnerUITests/ArgentRunnerSession+Commands.swift +9 -3
  16. package/dist/mcp-server.mjs +68 -15
  17. package/dist/tool-args.generated.d.ts +31 -1
  18. package/dist/tool-server.cjs +5433 -2503
  19. package/dylibs/libArgentAudio.dylib +0 -0
  20. package/dylibs/libArgentInjectionBootstrap.dylib +0 -0
  21. package/dylibs/libKeyboardPatch.dylib +0 -0
  22. package/dylibs/libNativeDevtoolsIos.dylib +0 -0
  23. package/dylibs/macos/libArgentInjectionBootstrap.dylib +0 -0
  24. package/dylibs/macos/libNativeDevtoolsMacos.dylib +0 -0
  25. package/dylibs/tcp/libArgentInjectionBootstrap.dylib +0 -0
  26. package/dylibs/tcp/libKeyboardPatch.dylib +0 -0
  27. package/dylibs/tcp/libNativeDevtoolsIos.dylib +0 -0
  28. package/dylibs/tvos/libArgentInjectionBootstrap.dylib +0 -0
  29. package/dylibs/tvos/libKeyboardPatch.dylib +0 -0
  30. package/dylibs/tvos/libNativeDevtoolsIos.dylib +0 -0
  31. package/package.json +1 -1
  32. package/rules/argent.md +6 -23
  33. package/skills/argent-ios-device-interact/SKILL.md +2 -2
  34. package/skills/argent-macos-app-interact/SKILL.md +15 -5
  35. package/skills/argent-macos-app-interact/references/e2e.md +1 -1
  36. package/skills/argent-native-profiler/SKILL.md +14 -2
  37. package/skills/argent-react-native-app-workflow/SKILL.md +1 -1
  38. package/skills/argent-react-native-optimization/SKILL.md +10 -1
  39. package/skills/argent-react-native-profiler/SKILL.md +4 -3
@@ -15203,31 +15203,6 @@ function readConfigObject(scope = "global", options = {}) {
15203
15203
  }
15204
15204
  return {};
15205
15205
  }
15206
- var FORBIDDEN_SEGMENTS = /* @__PURE__ */ new Set(["__proto__", "prototype", "constructor"]);
15207
- function splitKey(dottedKey) {
15208
- const parts = dottedKey.split(".");
15209
- if (parts.length === 0 || parts.some((p) => p === "")) {
15210
- throw new Error(`Invalid config key "${dottedKey}": empty path segment`);
15211
- }
15212
- for (const p of parts) {
15213
- if (FORBIDDEN_SEGMENTS.has(p)) {
15214
- throw new Error(`Invalid config key "${dottedKey}": forbidden segment "${p}"`);
15215
- }
15216
- }
15217
- return parts;
15218
- }
15219
- function isPlainObject(value) {
15220
- return !!value && typeof value === "object" && !Array.isArray(value);
15221
- }
15222
- function getAtPath(obj, dottedKey) {
15223
- const parts = splitKey(dottedKey);
15224
- let cur = obj;
15225
- for (const part of parts) {
15226
- if (!isPlainObject(cur)) return void 0;
15227
- cur = cur[part];
15228
- }
15229
- return cur;
15230
- }
15231
15206
  var LOCK_STALE_MS = 1e4;
15232
15207
  var LOCK_MAX_WAIT_MS = 2e3;
15233
15208
  var LOCK_RETRY_MS = 25;
@@ -15305,57 +15280,6 @@ var import_dotenv = __toESM(require_dist(), 1);
15305
15280
  import * as fs4 from "node:fs";
15306
15281
  import * as path5 from "node:path";
15307
15282
 
15308
- // ../configuration-core/src/merge.ts
15309
- function mergeRestrictive(local, global2) {
15310
- if (local === void 0) return global2;
15311
- if (global2 === void 0) return local;
15312
- if (typeof local === "boolean" && typeof global2 === "boolean") {
15313
- return local && global2;
15314
- }
15315
- if (typeof local === "number" && typeof global2 === "number") {
15316
- return Math.min(local, global2);
15317
- }
15318
- return local;
15319
- }
15320
- function toArray(value) {
15321
- return Array.isArray(value) ? value : null;
15322
- }
15323
- function mergeUnion(local, global2) {
15324
- const l2 = toArray(local);
15325
- const g = toArray(global2);
15326
- if (l2 === null && g === null) return local ?? global2;
15327
- const merged = [...g ?? [], ...l2 ?? []];
15328
- return Array.from(new Set(merged));
15329
- }
15330
- function mergeIntersection(local, global2) {
15331
- const l2 = toArray(local);
15332
- const g = toArray(global2);
15333
- if (l2 === null && g === null) return local ?? global2;
15334
- if (l2 === null) return global2;
15335
- if (g === null) return local;
15336
- const globalSet = new Set(g);
15337
- return l2.filter((item) => globalSet.has(item));
15338
- }
15339
- function applyMergePolicy(policy, local, global2) {
15340
- if (typeof policy === "function") return policy({ local, global: global2 });
15341
- switch (policy) {
15342
- case "prioritize-local":
15343
- return local ?? global2;
15344
- case "prioritize-global":
15345
- return global2 ?? local;
15346
- case "prioritize-restrictive":
15347
- return mergeRestrictive(local, global2);
15348
- case "union":
15349
- return mergeUnion(local, global2);
15350
- case "intersection":
15351
- return mergeIntersection(local, global2);
15352
- default: {
15353
- const _exhaustive = policy;
15354
- return _exhaustive;
15355
- }
15356
- }
15357
- }
15358
-
15359
15283
  // ../configuration-core/src/config-schema.ts
15360
15284
  import { isAbsolute } from "node:path";
15361
15285
  function asBoolean(raw) {
@@ -15393,14 +15317,6 @@ var CONFIG_SCHEMA = [
15393
15317
  // drained/reset, not just the file rewritten.
15394
15318
  manageCommand: "argent telemetry"
15395
15319
  },
15396
- {
15397
- key: "allowlist.enabled",
15398
- 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.",
15399
- scopes: ["project", "global"],
15400
- parse: asBoolean,
15401
- merge: "prioritize-restrictive",
15402
- example: "false"
15403
- },
15404
15320
  {
15405
15321
  key: "lens.agent",
15406
15322
  description: "Coding-agent id remembered by `argent lens` to skip the picker.",
@@ -15484,42 +15400,9 @@ var CONFIG_SCHEMA = [
15484
15400
  example: "512"
15485
15401
  }
15486
15402
  ];
15487
- function getConfigDefinition(key, registry = CONFIG_SCHEMA) {
15488
- return registry.find((def) => def.key === key);
15489
- }
15490
15403
 
15491
15404
  // ../configuration-core/src/config-access.ts
15492
15405
  import * as path6 from "node:path";
15493
- function readScopeValue(def, scope, options) {
15494
- if (!def.scopes.includes(scope)) return void 0;
15495
- const raw = getAtPath(readConfigObject(scope, options), def.key);
15496
- return raw === void 0 ? void 0 : def.parse(raw);
15497
- }
15498
- function getConfigValue(def, options = {}) {
15499
- const local = readScopeValue(def, "project", options);
15500
- const global2 = readScopeValue(def, "global", options);
15501
- const merged = applyMergePolicy(def.merge, local, global2);
15502
- return merged ?? def.default;
15503
- }
15504
- function getConfigValueByKey(key, options = {}, registry = CONFIG_SCHEMA) {
15505
- const def = requireDefinition(key, registry);
15506
- return getConfigValue(def, options);
15507
- }
15508
- function requireDefinition(key, registry = CONFIG_SCHEMA) {
15509
- const def = getConfigDefinition(key, registry);
15510
- if (!def) {
15511
- throw new UnknownConfigKeyError(key);
15512
- }
15513
- return def;
15514
- }
15515
- var UnknownConfigKeyError = class extends Error {
15516
- constructor(key) {
15517
- super(`Unknown configuration key "${key}".`);
15518
- this.key = key;
15519
- this.name = "UnknownConfigKeyError";
15520
- }
15521
- key;
15522
- };
15523
15406
 
15524
15407
  // ../telemetry/src/paths.ts
15525
15408
  function identityFilePath() {
@@ -15884,6 +15767,10 @@ var FAILURE_CODES = {
15884
15767
  AX_DAEMON_READY_TIMEOUT: "AX_DAEMON_READY_TIMEOUT",
15885
15768
  AX_DAEMON_EXITED_BEFORE_READY: "AX_DAEMON_EXITED_BEFORE_READY",
15886
15769
  AX_DAEMON_PROCESS_ERROR: "AX_DAEMON_PROCESS_ERROR",
15770
+ // The daemon died on a fault signal (SIGSEGV, SIGABRT, ...), before or after
15771
+ // it connected. Kept apart from the two codes above so a crash is not read
15772
+ // as an ordinary exit.
15773
+ AX_DAEMON_CRASHED: "AX_DAEMON_CRASHED",
15887
15774
  AX_FACTORY_OPTIONS_MISSING: "AX_FACTORY_OPTIONS_MISSING",
15888
15775
  AX_WRONG_PLATFORM: "AX_WRONG_PLATFORM",
15889
15776
  AX_DEVICE_ID_INVALID: "AX_DEVICE_ID_INVALID",
@@ -15966,6 +15853,7 @@ var FAILURE_CODES = {
15966
15853
  DEBUGGER_CDP_PROTOCOL_ERROR: "DEBUGGER_CDP_PROTOCOL_ERROR",
15967
15854
  DEBUGGER_CDP_CONNECT_FAILED: "DEBUGGER_CDP_CONNECT_FAILED",
15968
15855
  DEBUGGER_CDP_SOCKET_CLOSED_BEFORE_OPEN: "DEBUGGER_CDP_SOCKET_CLOSED_BEFORE_OPEN",
15856
+ DEBUGGER_CDP_ORIGIN_REJECTED: "DEBUGGER_CDP_ORIGIN_REJECTED",
15969
15857
  DEBUGGER_CDP_NOT_CONNECTED: "DEBUGGER_CDP_NOT_CONNECTED",
15970
15858
  DEBUGGER_CDP_REQUEST_TIMEOUT: "DEBUGGER_CDP_REQUEST_TIMEOUT",
15971
15859
  DEBUGGER_CDP_CONNECTION_CLOSED: "DEBUGGER_CDP_CONNECTION_CLOSED",
@@ -16040,6 +15928,32 @@ var FAILURE_CODES = {
16040
15928
  NATIVE_PROFILER_PERFETTO_PROCESS_ERROR: "NATIVE_PROFILER_PERFETTO_PROCESS_ERROR",
16041
15929
  NATIVE_PROFILER_PERFETTO_READY_TIMEOUT: "NATIVE_PROFILER_PERFETTO_READY_TIMEOUT",
16042
15930
  NATIVE_PROFILER_PERFETTO_READY_EXITED: "NATIVE_PROFILER_PERFETTO_READY_EXITED",
15931
+ /**
15932
+ * native-profiler-launch-analysis. Input problems use TOOL_INPUT_INVALID and
15933
+ * devicectl steps IOS_DEVICECTL_COMMAND_FAILED.
15934
+ * @see [workflow.ts](../../tool-server/src/utils/ios-launch-time/workflow.ts)
15935
+ */
15936
+ // Not macOS, or an Xcode that cannot record the launch on this target.
15937
+ LAUNCH_ANALYSIS_UNSUPPORTED_HOST: "LAUNCH_ANALYSIS_UNSUPPORTED_HOST",
15938
+ // No usable iPhone or simulator was selected, or Argent's runner holds it.
15939
+ LAUNCH_ANALYSIS_DEVICE_UNAVAILABLE: "LAUNCH_ANALYSIS_DEVICE_UNAVAILABLE",
15940
+ // The bundle_id app is not installed on the selected device.
15941
+ LAUNCH_ANALYSIS_APP_NOT_INSTALLED: "LAUNCH_ANALYSIS_APP_NOT_INSTALLED",
15942
+ // The runner's xcodebuild failed on code signing or provisioning.
15943
+ LAUNCH_ANALYSIS_SIGNING_FAILED: "LAUNCH_ANALYSIS_SIGNING_FAILED",
15944
+ // The iPhone's free developer profile has no slot for Argent's runner.
15945
+ LAUNCH_ANALYSIS_FREE_PROFILE_LIMIT: "LAUNCH_ANALYSIS_FREE_PROFILE_LIMIT",
15946
+ // simctl could not wait for boot, find, launch or terminate the app.
15947
+ LAUNCH_ANALYSIS_SIMCTL_FAILED: "LAUNCH_ANALYSIS_SIMCTL_FAILED",
15948
+ LAUNCH_ANALYSIS_RECORD_FAILED: "LAUNCH_ANALYSIS_RECORD_FAILED",
15949
+ // xctrace could not export the TOC, the CPU samples or the first-frame marker.
15950
+ LAUNCH_ANALYSIS_EXPORT_FAILED: "LAUNCH_ANALYSIS_EXPORT_FAILED",
15951
+ // The App Launch trace has no first frame of the app, so it has no launch window.
15952
+ LAUNCH_ANALYSIS_NO_FIRST_FRAME: "LAUNCH_ANALYSIS_NO_FIRST_FRAME",
15953
+ // The XCTest launch run of Argent's runner failed.
15954
+ LAUNCH_ANALYSIS_RUNNER_TEST_FAILED: "LAUNCH_ANALYSIS_RUNNER_TEST_FAILED",
15955
+ // The launch test ran, but Argent read no launch measurements from its result.
15956
+ LAUNCH_ANALYSIS_NO_SAMPLES: "LAUNCH_ANALYSIS_NO_SAMPLES",
16043
15957
  // iOS and Android share one capture path (simulator-server frames into
16044
15958
  // ffmpeg), so these name the failing stage, not the device family.
16045
15959
  SCREEN_RECORDING_FACTORY_OPTIONS_MISSING: "SCREEN_RECORDING_FACTORY_OPTIONS_MISSING",
@@ -16054,6 +15968,13 @@ var FAILURE_CODES = {
16054
15968
  SCREEN_RECORDING_SERVER_SHUTTING_DOWN: "SCREEN_RECORDING_SERVER_SHUTTING_DOWN",
16055
15969
  SCREEN_RECORDING_STREAM_UNAVAILABLE: "SCREEN_RECORDING_STREAM_UNAVAILABLE",
16056
15970
  SCREEN_RECORDING_FFMPEG_NOT_FOUND: "SCREEN_RECORDING_FFMPEG_NOT_FOUND",
15971
+ AUDIO_CLIP_CONVERSION_FAILED: "AUDIO_CLIP_CONVERSION_FAILED",
15972
+ AUDIO_HOOK_NOT_ACTIVE: "AUDIO_HOOK_NOT_ACTIVE",
15973
+ AUDIO_ENV_SETUP_FAILED: "AUDIO_ENV_SETUP_FAILED",
15974
+ AUDIO_WRONG_PLATFORM: "AUDIO_WRONG_PLATFORM",
15975
+ AUDIO_HOOK_UNAVAILABLE: "AUDIO_HOOK_UNAVAILABLE",
15976
+ AUDIO_INJECTION_NOT_OURS: "AUDIO_INJECTION_NOT_OURS",
15977
+ AUDIO_SIMULATOR_NOT_BOOTED: "AUDIO_SIMULATOR_NOT_BOOTED",
16057
15978
  FLOW_PROJECT_ROOT_INVALID: "FLOW_PROJECT_ROOT_INVALID",
16058
15979
  FLOW_NAME_INVALID: "FLOW_NAME_INVALID",
16059
15980
  FLOW_NO_ACTIVE_RECORDING: "FLOW_NO_ACTIVE_RECORDING",
@@ -16117,6 +16038,8 @@ var FAILURE_CODES = {
16117
16038
  MACOS_APP_BUNDLE_ID_MISMATCH: "MACOS_APP_BUNDLE_ID_MISMATCH",
16118
16039
  MACOS_APP_OPEN_URL_FAILED: "MACOS_APP_OPEN_URL_FAILED",
16119
16040
  MACOS_APP_FILE_ACCESS_FAILED: "MACOS_APP_FILE_ACCESS_FAILED",
16041
+ /** The app's loaded Argent library lacks support for the requested operation. */
16042
+ MACOS_APP_LIBRARY_OUTDATED: "MACOS_APP_LIBRARY_OUTDATED",
16120
16043
  KEYBOARD_KEY_UNSUPPORTED: "KEYBOARD_KEY_UNSUPPORTED",
16121
16044
  KEYBOARD_CHARACTER_UNSUPPORTED: "KEYBOARD_CHARACTER_UNSUPPORTED",
16122
16045
  KEYBOARD_TEXT_AND_KEY_COMBINED: "KEYBOARD_TEXT_AND_KEY_COMBINED",
@@ -16186,13 +16109,16 @@ var FAILURE_COMMANDS = [
16186
16109
  "ax_service",
16187
16110
  "simulator_server",
16188
16111
  "ffmpeg",
16112
+ "afconvert",
16189
16113
  "cdp",
16190
16114
  "electron",
16191
16115
  "npm",
16192
16116
  "npx",
16193
16117
  "unknown",
16194
16118
  "devicectl",
16195
- "xcodebuild"
16119
+ "xcodebuild",
16120
+ // `xcrun xcresulttool`, which reads an XCTest result bundle.
16121
+ "xcresulttool"
16196
16122
  ];
16197
16123
  var FAILURE_SIGNAL_NAMES = [
16198
16124
  "SIGABRT",
@@ -16241,7 +16167,8 @@ var DEVICE_KINDS = [
16241
16167
  "emulator",
16242
16168
  "vvd",
16243
16169
  "device",
16244
- "app"
16170
+ "app",
16171
+ "catalyst"
16245
16172
  ];
16246
16173
  var DEBUGGER_NOT_CONNECTED_REASONS = [
16247
16174
  "metro_not_running",
@@ -16379,7 +16306,8 @@ var ALLOWED = {
16379
16306
  install_mode: INSTALL_MODE
16380
16307
  },
16381
16308
  "installation:allowlist_decision": {
16382
- is_enabled: bool
16309
+ is_enabled: bool,
16310
+ decided_by: oneOf(["flag", "default", "prompt"])
16383
16311
  },
16384
16312
  "installation:stale_config_cleanup": {
16385
16313
  removed_count: COUNT,
@@ -16989,7 +16917,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
16989
16917
  var SESSION_ID = randomUUID4();
16990
16918
  function readCliVersion() {
16991
16919
  if (true) {
16992
- return "0.34.1-next.1";
16920
+ return "0.34.1-next.21";
16993
16921
  }
16994
16922
  return "0.0.0";
16995
16923
  }
@@ -20391,6 +20319,64 @@ var RETIRED_BUNDLED_PATHS = {
20391
20319
  ],
20392
20320
  rules: []
20393
20321
  };
20322
+ var RETIRED_GLOBAL_RULES = [
20323
+ {
20324
+ path: "argent.md",
20325
+ shipped: [
20326
+ "bfb07b5ad949f63ab9b41919f2c24c937b163c7644d6760fa8afda4f68c809f7",
20327
+ "90f6b24882ae077c8d5129652e7630c1b2a5651f5e800474d3b6e223222049f1",
20328
+ "cbf6cb5d898c14cd3460c85a15fd9ceeb7b3fed669df7e0932e61cad93a5a6fe",
20329
+ "ac8d19e2ece55ff6b7c554fd6a4a3eebc5a09af1eb95f6625f96781bb45505e2",
20330
+ "30bbef749f18d4fde7a5501941d58decf1e8abb2ca8c4e51f63e72bab3d863e2",
20331
+ "81663dc2f70aa2111388092e6027d27eddd89e9b5bdfb16043bdc96088d6850d",
20332
+ "5e3143dea13d15a9c80c7e24a1a3e4e1fb3ed34c8a077eccb74cb6e2a8a1c4a3",
20333
+ "51f8360f997c6bfcfb51c4c99d5f8b3a3b632ca4ca43a7f4ba5e7d8e8881798d",
20334
+ "5e27f0ed6dbdb4def30163387485b3c783c702bbc6594bc210d236454b6c5780",
20335
+ "06391305389e958b127a832de9977dc75a2164355a924bddb312b824656a8f72",
20336
+ "09ac21fd92efa4fc877e951475a0488a78ba4dbdfba63d6f1efd761c9f625866",
20337
+ "45fc6a4bf294af60e73ec9ab3c02219627767b5622467f7a57bb5b6976fd4126",
20338
+ "2f4eb998af8b5106b5fb49f19efd282d38366316c4a78f7123bc3d005c5848a4",
20339
+ "e425ebaafba2eeeb02f714d3e0b1ce19e0844fc4d661dbbd25bf6086ffc714b0",
20340
+ "d6cc846c1d3444bf8eaee6aa313a207e8c7a94391041df9d2a2908088c0191a7",
20341
+ "ad0f23a946e9bbc721a16b17a9516bf2570e7529094da0677f33ed63d43e0caa",
20342
+ "b1ce95af4c0e57cb478a148b6b8744ad4f8f15522441e566c0c6f7210c78fc79",
20343
+ "e3dc376ba736cef94de401bd5457c3df0192128164cbb44ac3e2ece57ad1af66",
20344
+ "aa43aeb338a5d0f50c425d8163dc697b9ffd7042539be05a67ed3ed85e8ba60f",
20345
+ "983f29ab70a565367bda4fbed705eb41fbe7b6767c70eb0569d2501f298e72c4",
20346
+ "251487afb2fda1707a27701be7fcc33b481e0176d43a4c946287a35595d26585",
20347
+ "933e657ec8789e57db8164fc2f58a692e9dc889bebd131eaa0f2017ef055add8",
20348
+ "35ea33df169b390d331733ab325dbf23b3804bc25927908e6050977563d7b10c",
20349
+ "7a89d0406784242b03ca187a2740898d4f69ccb7b76508ec373ad2aba5fb0a2c",
20350
+ "fa69c9e943572ab603b1318bc9a5c07f9d0e7c8f2cc208f6e29a6795991dab73",
20351
+ "192013fdee1954ba013985c022d91f37bbc34bf36ae4bcd76ab2cdf2f2b3f341",
20352
+ "4476fd58e33ede9cc938da7e954781fa8d5805f18cd71701cdaa4ec3bcabb085",
20353
+ "db80ca8efbe5dd775153ab39c63d4c387d1b5d864a1e7eae21fbd158f05d9e54",
20354
+ "32f3d3915f04fb43c4e835e076ec26ed7d88232f66963538308233c19055c951",
20355
+ "7aee698f1b8e5ed0399f45a72435961847b96097322e5f3391fd31adf03b8180",
20356
+ "1829b14538d913852bacb82a50d79cade45ea56c78fb2bc85e6e46f0f9ac6439",
20357
+ "c012bec1b6a225a0f03b7fc9133746d2130ce8f45cd1c2c86559bc31cafd81f7",
20358
+ "11f62b29badb21f0489e835975e5fa62b996188ed7194d01590b5eb6f020615b",
20359
+ "b83879ae5540a9e46140c5a1d0f93599e9aa48fbe752aba12db7a93cd8940834",
20360
+ "ec38c5e586782f376daec565302b3548fd22ea3236c384f9bb37b1d16bde3f39",
20361
+ "c40437e8afb99cc4cd6005ae3710d861b6f0af0da0f1de35499f4cb9ac790999",
20362
+ "4d62da692bc8735f3979f54e6c7e2c3b2e9d530e5898958aa41a869b5e9e6f11",
20363
+ "bec052b7cf7668da7f1cdddb5bae4c50b6db87ece0ec6930f1229e6e0bb8f96e",
20364
+ "0fffc00cc3d6fe32c93d857c8b4f8ad9754f7daf76c51cda6acc86aa5487e1e6",
20365
+ "1cb7d1f65d5014954a6d25bde4c9a271910ffed240899178b8dbf9e138ce83f3",
20366
+ "e3bc44c749ba6cecd50d1e4dc45c1dd3d896414982b339f07d62351c396e975d",
20367
+ "db0435ad74da7ba0e3ec362aab60c011ac24caa8aa9630dc77393058710c0deb",
20368
+ "aec395f5fdccc42c13ff39263ab101c5bebe68ed4181ee126a819c3a0a45aa94",
20369
+ "4867ae2b7f8bb207bad663759487b729be8bf58f9523d4589b885e5857966cc1",
20370
+ "5f9efed48536447a7ffc8d68b8a43eb20bceeb2adab884352f20cbbe5be37ac5",
20371
+ "51d5d412d5ff4edbc2dc837c33978d85678b5ff6461c987944469f535dbcc295",
20372
+ "d28de55c47c64bd9f7a7493825e1913f9fbf317976d6981f71ae24fb21631dea",
20373
+ "cb9a8c33b1dc6c1188674a1a846e97d1b3a58b2c386021b63139cfd33c1abe6c",
20374
+ "33bae8d5c6e38a730e15ceab19335145ed06988d475696690302daa1bf1221f3",
20375
+ "5f9b146efdac28c3d67a8b1fcdca3ab5950b69e7c74defa7dca5cbf4e44cc98a",
20376
+ "af428399983712d11e4cfc9999bd600ba5121f17acb1ce97f70e695ef68772b2"
20377
+ ]
20378
+ }
20379
+ ];
20394
20380
  function hashBundledContent(content) {
20395
20381
  return createHash2("sha256").update(content.replace(/\r\n/g, "\n")).digest("hex");
20396
20382
  }
@@ -20608,7 +20594,8 @@ function readRetiredFile(targetDir, relativePath) {
20608
20594
  function findRetiredFiles(retired, bundleDir, targetDir) {
20609
20595
  const found = [];
20610
20596
  for (const { path: relativePath, shipped } of retired) {
20611
- if (fs16.existsSync(path17.join(bundleDir, ...relativePath.split("/")))) continue;
20597
+ if (bundleDir !== null && fs16.existsSync(path17.join(bundleDir, ...relativePath.split("/"))))
20598
+ continue;
20612
20599
  const content = readRetiredFile(targetDir, relativePath);
20613
20600
  if (content === null) continue;
20614
20601
  const sha256 = hashBundledContent(content);
@@ -20735,6 +20722,21 @@ function getAvailableToolIds() {
20735
20722
  const tools = JSON.parse(out);
20736
20723
  return tools.map((t2) => t2.id);
20737
20724
  }
20725
+ function existingEntryKeys(configPath, serversKey, keys) {
20726
+ let entry;
20727
+ try {
20728
+ entry = readJsonc(configPath)[serversKey]?.[MCP_SERVER_KEY];
20729
+ } catch {
20730
+ return {};
20731
+ }
20732
+ if (!entry || typeof entry !== "object" || Array.isArray(entry)) return {};
20733
+ const kept = {};
20734
+ for (const key of keys) {
20735
+ const value = entry[key];
20736
+ if (value !== void 0) kept[key] = value;
20737
+ }
20738
+ return kept;
20739
+ }
20738
20740
  function buildMcpEntry(mode = { kind: "global" }) {
20739
20741
  switch (mode.kind) {
20740
20742
  case "local-node":
@@ -21110,6 +21112,13 @@ function codexDirLooksArgentOnly(dir) {
21110
21112
  return false;
21111
21113
  });
21112
21114
  }
21115
+ function cursorPermissionsPath() {
21116
+ return path18.join(homedir4(), ".cursor", "permissions.json");
21117
+ }
21118
+ function cursorPermissionsList() {
21119
+ const list = readJsonc(cursorPermissionsPath()).mcpAllowlist;
21120
+ return Array.isArray(list) ? list : null;
21121
+ }
21113
21122
  var cursorAdapter = {
21114
21123
  name: "Cursor",
21115
21124
  detect() {
@@ -21149,16 +21158,21 @@ var cursorAdapter = {
21149
21158
  },
21150
21159
  // The allowlist lives in a separate ~/.cursor/permissions.json that may carry
21151
21160
  // the user's own rules, so edit that one key instead of rewriting the file.
21161
+ // Only a file that already has an mcpAllowlist is edited. Once that key is
21162
+ // non-empty, Cursor enforces the file: Run Everything drops to Allowlist, and
21163
+ // the file's list replaces the in-IDE one. Under Run Everything the rule does
21164
+ // nothing anyway, and without the file the user approves argent in Cursor.
21165
+ allowlistSkipReason() {
21166
+ return cursorPermissionsList() === null ? "creating ~/.cursor/permissions.json would turn off Cursor's Run Everything mode; approve argent in Cursor instead" : null;
21167
+ },
21152
21168
  addAllowlist() {
21153
- const permPath = path18.join(homedir4(), ".cursor", "permissions.json");
21154
- const config = readJsonc(permPath);
21155
- const list = Array.isArray(config.mcpAllowlist) ? config.mcpAllowlist : [];
21156
- if (list.includes(CURSOR_ALLOWLIST_PATTERN)) return;
21157
- editJsoncFile(permPath, ["mcpAllowlist"], [...list, CURSOR_ALLOWLIST_PATTERN]);
21169
+ const list = cursorPermissionsList();
21170
+ if (list === null || list.includes(CURSOR_ALLOWLIST_PATTERN)) return;
21171
+ editJsoncFile(cursorPermissionsPath(), ["mcpAllowlist"], [...list, CURSOR_ALLOWLIST_PATTERN]);
21158
21172
  },
21159
21173
  removeAllowlist(_root, scope) {
21160
21174
  if (scope !== "global") return;
21161
- const permPath = path18.join(homedir4(), ".cursor", "permissions.json");
21175
+ const permPath = cursorPermissionsPath();
21162
21176
  if (!fs17.existsSync(permPath)) return;
21163
21177
  const config = readJsonc(permPath);
21164
21178
  const list = Array.isArray(config.mcpAllowlist) ? config.mcpAllowlist : void 0;
@@ -21411,7 +21425,8 @@ var windsurfAdapter = {
21411
21425
  editJsoncFile(configPath, ["mcpServers", MCP_SERVER_KEY], {
21412
21426
  command: entry.command,
21413
21427
  args: entry.args,
21414
- ...hasEnv(entry) ? { env: entry.env } : {}
21428
+ ...hasEnv(entry) ? { env: entry.env } : {},
21429
+ ...existingEntryKeys(configPath, "mcpServers", ["alwaysAllow"])
21415
21430
  });
21416
21431
  },
21417
21432
  remove(configPath) {
@@ -21523,7 +21538,8 @@ var geminiAdapter = {
21523
21538
  editJsoncFile(configPath, ["mcpServers", MCP_SERVER_KEY], {
21524
21539
  command: entry.command,
21525
21540
  args: entry.args,
21526
- ...hasEnv(entry) ? { env: entry.env } : {}
21541
+ ...hasEnv(entry) ? { env: entry.env } : {},
21542
+ ...existingEntryKeys(configPath, "mcpServers", ["trust"])
21527
21543
  });
21528
21544
  },
21529
21545
  remove(configPath) {
@@ -21582,10 +21598,12 @@ var codexAdapter = {
21582
21598
  write(configPath, entry) {
21583
21599
  const config = readToml(configPath);
21584
21600
  const servers = config.mcp_servers ?? {};
21601
+ const previous = servers[MCP_SERVER_KEY];
21585
21602
  servers[MCP_SERVER_KEY] = {
21586
21603
  command: entry.command,
21587
21604
  args: entry.args,
21588
- ...hasEnv(entry) ? { env: entry.env } : {}
21605
+ ...hasEnv(entry) ? { env: entry.env } : {},
21606
+ ...previous?.tools !== void 0 ? { tools: previous.tools } : {}
21589
21607
  };
21590
21608
  config.mcp_servers = servers;
21591
21609
  writeToml(configPath, config);
@@ -21627,6 +21645,27 @@ var codexAdapter = {
21627
21645
  }
21628
21646
  writeToml(configPath, config);
21629
21647
  },
21648
+ // Codex has no wildcard: each tool id is listed. A table with at least one
21649
+ // approved tool means the user kept the allowlist, so tools this version
21650
+ // added are approved too. Tools already listed keep the mode the user gave
21651
+ // them, and an emptied or removed table stays as it is.
21652
+ refreshAllowlist(root, scope) {
21653
+ const configPath = scope === "global" ? this.globalPath() : this.projectPath(root);
21654
+ if (!configPath || !fs17.existsSync(configPath)) return;
21655
+ const config = readToml(configPath);
21656
+ const toolsConfig = config.mcp_servers?.argent?.tools;
21657
+ if (!toolsConfig) return;
21658
+ const optedIn = Object.values(toolsConfig).some(
21659
+ (tool) => tool?.approval_mode === "approve"
21660
+ );
21661
+ if (!optedIn) return;
21662
+ const missing = getAvailableToolIds().filter((tool) => !(tool in toolsConfig));
21663
+ if (missing.length === 0) return;
21664
+ for (const tool of missing) {
21665
+ toolsConfig[tool] = { approval_mode: "approve" };
21666
+ }
21667
+ writeToml(configPath, config);
21668
+ },
21630
21669
  removeAllowlist(root, scope) {
21631
21670
  const configPath = scope === "global" ? this.globalPath() : this.projectPath(root);
21632
21671
  if (!configPath) {
@@ -21787,7 +21826,8 @@ var kiroAdapter = {
21787
21826
  editJsoncFile(configPath, ["mcpServers", MCP_SERVER_KEY], {
21788
21827
  command: entry.command,
21789
21828
  args: entry.args,
21790
- ...hasEnv(entry) ? { env: entry.env } : {}
21829
+ ...hasEnv(entry) ? { env: entry.env } : {},
21830
+ ...existingEntryKeys(configPath, "mcpServers", ["autoApprove"])
21791
21831
  });
21792
21832
  },
21793
21833
  remove(configPath) {
@@ -22051,18 +22091,29 @@ function removeCodexRules(configPath) {
22051
22091
  function findRetiredRulesAndAgents(scans, root, rulesDir, agentsDir) {
22052
22092
  const targets = scans.flatMap(({ adapters, scope }) => {
22053
22093
  const { ruleTargets, agentTargets } = getManagedContentTargets(adapters, root, scope);
22094
+ const globalRules = scope === "global";
22054
22095
  return [
22055
- ...ruleTargets.map((target) => ({ kind: "rules", target, bundleDir: rulesDir })),
22056
- ...agentTargets.map((target) => ({ kind: "agents", target, bundleDir: agentsDir }))
22096
+ ...ruleTargets.map((target) => ({
22097
+ kind: "rules",
22098
+ target,
22099
+ bundleDir: globalRules ? null : rulesDir,
22100
+ retired: globalRules ? [...RETIRED_BUNDLED_PATHS.rules, ...RETIRED_GLOBAL_RULES] : RETIRED_BUNDLED_PATHS.rules
22101
+ })),
22102
+ ...agentTargets.map((target) => ({
22103
+ kind: "agents",
22104
+ target,
22105
+ bundleDir: agentsDir,
22106
+ retired: RETIRED_BUNDLED_PATHS.agents
22107
+ }))
22057
22108
  ];
22058
22109
  });
22059
22110
  const found = [];
22060
22111
  const seen = /* @__PURE__ */ new Set();
22061
- for (const { kind, target, bundleDir } of targets) {
22112
+ for (const { kind, target, bundleDir, retired } of targets) {
22062
22113
  const dir = resolveLinkedDestination(target.targetPath);
22063
22114
  if (seen.has(`${kind}:${realpathOrSelf(dir)}`)) continue;
22064
22115
  seen.add(`${kind}:${realpathOrSelf(dir)}`);
22065
- const files = findRetiredFiles(RETIRED_BUNDLED_PATHS[kind], bundleDir, target.targetPath);
22116
+ const files = findRetiredFiles(retired, bundleDir, target.targetPath);
22066
22117
  if (files.length === 0) continue;
22067
22118
  found.push({ kind, target, location: formatCopyDestination(target, dir, root), files });
22068
22119
  }
@@ -22071,7 +22122,8 @@ function findRetiredRulesAndAgents(scans, root, rulesDir, agentsDir) {
22071
22122
  function copyRulesAndAgents(adapters, root, scope, rulesDir, agentsDir) {
22072
22123
  const results = [];
22073
22124
  const managedTargets = getManagedContentTargets(adapters, root, scope);
22074
- for (const target of managedTargets.ruleTargets) {
22125
+ const globalScope = scope === "global";
22126
+ for (const target of globalScope ? [] : managedTargets.ruleTargets) {
22075
22127
  try {
22076
22128
  const written = copyDir(rulesDir, target.targetPath);
22077
22129
  if (written) {
@@ -22092,6 +22144,16 @@ function copyRulesAndAgents(adapters, root, scope, rulesDir, agentsDir) {
22092
22144
  }
22093
22145
  }
22094
22146
  for (const target of managedTargets.codexConfigTargets) {
22147
+ if (globalScope) {
22148
+ try {
22149
+ if (removeCodexRules(target.targetPath)) {
22150
+ results.push(` Removed argent rules from ${target.targetPath} (developer_instructions)`);
22151
+ }
22152
+ } catch (err) {
22153
+ results.push(` Could not remove argent rules from ${target.targetPath}: ${err}`);
22154
+ }
22155
+ continue;
22156
+ }
22095
22157
  try {
22096
22158
  const injected = injectCodexRules(target.targetPath, rulesDir);
22097
22159
  if (injected) {
@@ -22324,6 +22386,7 @@ function parseInitArgs(args) {
22324
22386
  return {
22325
22387
  nonInteractive: args.includes("--yes") || args.includes("-y"),
22326
22388
  noTelemetry: args.includes("--no-telemetry"),
22389
+ noAllowlist: args.includes("--no-allowlist"),
22327
22390
  fromTar,
22328
22391
  wantsLocal: args.includes("--local"),
22329
22392
  wantsGlobal: args.includes("--global")
@@ -23308,11 +23371,15 @@ async function cleanupStaleMcpConfigs(args) {
23308
23371
  // ../argent-installer/src/init-allowlist.ts
23309
23372
  var import_picocolors9 = __toESM(require_picocolors(), 1);
23310
23373
  async function configureAllowlist(args) {
23311
- const { adapters, effectiveRoot, scope, nonInteractive } = args;
23374
+ const { adapters, effectiveRoot, scope, nonInteractive, noAllowlist = false } = args;
23312
23375
  const adaptersWithAllowlist = adapters.filter((a2) => a2.addAllowlist);
23313
23376
  const adaptersWithoutAllowlist = adapters.filter((a2) => !a2.addAllowlist);
23314
23377
  let enabled = false;
23315
- if (adaptersWithAllowlist.length > 0) {
23378
+ let decidedBy = "default";
23379
+ if (noAllowlist) {
23380
+ decidedBy = "flag";
23381
+ log.info(import_picocolors9.default.dim("Skipped editor auto-approve lists (--no-allowlist)."));
23382
+ } else if (adaptersWithAllowlist.length > 0) {
23316
23383
  log.info(
23317
23384
  `By default, editors ask for confirmation before running each MCP tool.
23318
23385
  Adding Argent to the auto-approve allowlist lets tools run without
@@ -23328,9 +23395,10 @@ async function configureAllowlist(args) {
23328
23395
  });
23329
23396
  if (isCancel(allowlistChoice)) throw new InitCancelled("allowlist");
23330
23397
  enabled = allowlistChoice;
23398
+ decidedBy = "prompt";
23331
23399
  }
23332
23400
  }
23333
- if (!enabled) return { enabled, lines: [] };
23401
+ if (!enabled) return { enabled, decidedBy, lines: [] };
23334
23402
  const lines = [];
23335
23403
  for (const adapter of adaptersWithAllowlist) {
23336
23404
  const hasPath = scope === "global" ? adapter.globalPath() : adapter.projectPath(effectiveRoot);
@@ -23339,6 +23407,11 @@ async function configureAllowlist(args) {
23339
23407
  continue;
23340
23408
  }
23341
23409
  try {
23410
+ const skipReason = adapter.allowlistSkipReason?.(effectiveRoot, scope) ?? null;
23411
+ if (skipReason) {
23412
+ lines.push(`${import_picocolors9.default.yellow("-")} ${adapter.name} ${import_picocolors9.default.dim(`(skipped - ${skipReason})`)}`);
23413
+ continue;
23414
+ }
23342
23415
  adapter.addAllowlist(effectiveRoot, scope);
23343
23416
  lines.push(`${import_picocolors9.default.green("+")} ${adapter.name}`);
23344
23417
  } catch (err) {
@@ -23350,7 +23423,7 @@ async function configureAllowlist(args) {
23350
23423
  `${import_picocolors9.default.yellow("-")} ${adapter.name} ${import_picocolors9.default.dim("(no auto-approve API - configure manually)")}`
23351
23424
  );
23352
23425
  }
23353
- return { enabled, lines };
23426
+ return { enabled, decidedBy, lines };
23354
23427
  }
23355
23428
 
23356
23429
  // ../argent-installer/src/init-skills.ts
@@ -23762,9 +23835,13 @@ async function init2(args) {
23762
23835
  adapters: writtenAdapters,
23763
23836
  effectiveRoot,
23764
23837
  scope: normalizedScope,
23765
- nonInteractive: parsed.nonInteractive
23838
+ nonInteractive: parsed.nonInteractive,
23839
+ noAllowlist: parsed.noAllowlist
23840
+ });
23841
+ track("installation:allowlist_decision", {
23842
+ is_enabled: allowlist.enabled,
23843
+ decided_by: allowlist.decidedBy
23766
23844
  });
23767
- track("installation:allowlist_decision", { is_enabled: allowlist.enabled });
23768
23845
  if (allowlist.enabled && allowlist.lines.length > 0) {
23769
23846
  note(allowlist.lines.join("\n"), "Tool Auto-Approval");
23770
23847
  }
@@ -23803,7 +23880,8 @@ async function init2(args) {
23803
23880
  scope,
23804
23881
  allowlistEnabled: allowlist.enabled,
23805
23882
  skills,
23806
- copiedRules: copyResults.length > 0,
23883
+ // A global install writes no rule, only removes old ones.
23884
+ copiedRules: normalizedScope === "local" && copyResults.length > 0,
23807
23885
  wroteProjectTelemetryOptOut
23808
23886
  });
23809
23887
  const skillsMissing = skillsAreMissing(skills);
@@ -24682,15 +24760,12 @@ async function update(args) {
24682
24760
  )
24683
24761
  );
24684
24762
  }
24685
- const allowlistDisabled = getConfigValueByKey("allowlist.enabled", { cwd: projectRoot }) === false;
24686
- if (!allowlistDisabled) {
24687
- for (const [scope, adapters] of adaptersByScope) {
24688
- for (const adapter of adapters) {
24689
- if (!adapter.addAllowlist) continue;
24690
- try {
24691
- adapter.addAllowlist(projectRoot, scope);
24692
- } catch {
24693
- }
24763
+ for (const [scope, adapters] of adaptersByScope) {
24764
+ for (const adapter of adapters) {
24765
+ if (!adapter.refreshAllowlist) continue;
24766
+ try {
24767
+ adapter.refreshAllowlist(projectRoot, scope);
24768
+ } catch {
24694
24769
  }
24695
24770
  }
24696
24771
  }
@@ -24701,11 +24776,6 @@ async function update(args) {
24701
24776
  ...copyRulesAndAgents(localAdapters, projectRoot, "local", RULES_DIR, AGENTS_DIR)
24702
24777
  ];
24703
24778
  spinner2.stop("Configuration refreshed.");
24704
- if (allowlistDisabled) {
24705
- log.info(
24706
- import_picocolors12.default.dim("Left editor auto-approve allowlists alone (allowlist.enabled is false).")
24707
- );
24708
- }
24709
24779
  if (results.length > 0) {
24710
24780
  note(results.join("\n"), "MCP Configs Updated");
24711
24781
  }
@@ -24830,8 +24900,8 @@ function removeBundledContent(sourceDir, targetDir) {
24830
24900
  for (const relativePath of files) {
24831
24901
  const targetPath = path29.join(targetDir, relativePath);
24832
24902
  try {
24833
- if (!fs21.existsSync(targetPath)) continue;
24834
- if (fs21.lstatSync(targetPath).isDirectory()) continue;
24903
+ const entry = fs21.lstatSync(targetPath, { throwIfNoEntry: false });
24904
+ if (!entry || entry.isDirectory()) continue;
24835
24905
  removePath(targetPath);
24836
24906
  removedPaths.push(relativePath);
24837
24907
  } catch {
@@ -0,0 +1,21 @@
1
+ import XCTest
2
+
3
+ final class ArgentLaunchPerformanceTests: XCTestCase {
4
+ func testLaunchDuration() {
5
+ guard let bundleID = ProcessInfo.processInfo.environment["ARGENT_LAUNCH_BUNDLE_ID"],
6
+ !bundleID.isEmpty
7
+ else {
8
+ XCTFail("Set TEST_RUNNER_ARGENT_LAUNCH_BUNDLE_ID to the installed app's bundle ID.")
9
+ return
10
+ }
11
+
12
+ let options = XCTMeasureOptions()
13
+ // Must match LAUNCH_ITERATIONS in native-profiler/launch-analysis/measure.ts.
14
+ options.iterationCount = 5
15
+ let app = XCUIApplication(bundleIdentifier: bundleID)
16
+
17
+ measure(metrics: [XCTApplicationLaunchMetric()], options: options) {
18
+ app.launch()
19
+ }
20
+ }
21
+ }