@swmansion/argent 0.6.0 → 0.7.0-next.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
  </p>
7
7
  <br/>
8
8
 
9
- **[Argent](https://argent.swmansion.com)** is an **agentic toolkit** that gives your AI assistant direct access to iOS Simulators. Ask it to tap a button, run a profiler or reproduce an issue manually - all from within your CLI, without switching context.
9
+ **[Argent](https://argent.swmansion.com)** is an **agentic toolkit** that gives your AI assistant direct access to iOS Simulators and Android Emulators. Ask it to tap a button, run a profiler or reproduce an issue manually - all from within your CLI, without switching context.
10
10
 
11
11
  ```bash
12
12
  npx @swmansion/argent init
@@ -14,7 +14,7 @@ npx @swmansion/argent init
14
14
 
15
15
  ## Capabilities
16
16
 
17
- - **Autonomous iOS development** - Allow your agent to work with iOS apps on its own - let it build, open, interact with the app and debug it. Ask for reproducing issues, testing features manually, profiling your app and much more, without ever interrupting your work.
17
+ - **Autonomous iOS and Android development** - Allow your agent to work with iOS and Android apps on its own - let it build, open, interact with the app and debug it. Ask for reproducing issues, testing features manually, profiling your app and much more, without ever interrupting your work.
18
18
  - **UI interaction** - Give your agent full control toolkit - tapping, swiping, pinching, typing, gestures, hardware buttons and all other gears included. Let it navigate your app exactly as a user would, without lifting a finger.
19
19
  - **Profiling with batteries included** - Argent can perform and analyze both React-Native and Xcode Instruments profiling sessions. Get comprehensive summaries and ask to optimise your app where you find fit.
20
20
  - **Debugging and diagnostics** - Let your agent inspect logs, capture crash reports, and reproduce failing states on the simulator, so you can jump straight to the fix.
@@ -33,8 +33,9 @@ npx @swmansion/argent init
33
33
 
34
34
  #### Prerequisites
35
35
 
36
- - macOS with **Xcode** installed
37
36
  - **Node.js 18** or later
37
+ - For iOS: macOS with **Xcode** installed
38
+ - For Android: **Android SDK Platform Tools** (`adb`) on `PATH`, and the **Android Emulator** package if you want to boot AVDs from Argent. Create AVDs via Android Studio or `avdmanager`.
38
39
 
39
40
  #### Run `init` in your project
40
41
 
@@ -45,7 +45,7 @@ but required by the main agent, fill it in by manual inspection of the project.
45
45
  - `expo` in dependencies or `app.json` with `expo` key → Expo project
46
46
  - `pubspec.yaml` present → Flutter project
47
47
  - `ios/*.xcodeproj` or `ios/*.xcworkspace` without `react-native` → native iOS
48
- - `android/build.gradle` without `react-native` → native Android
48
+ - `android/build.gradle` or `android/build.gradle.kts` without `react-native` → native Android
49
49
  - None of the above → classify based on what you find (web app, library, etc.)
50
50
 
51
51
  3. **Explore beyond the snapshot.** Use Read, Glob, Grep, and Bash to fill
@@ -64,7 +64,7 @@ but required by the main agent, fill it in by manual inspection of the project.
64
64
  flows (`.maestro/`).
65
65
  - For Flutter: `pubspec.yaml`, `analysis_options.yaml`, `lib/` structure.
66
66
  - For native iOS: Xcode project/workspace, schemes, `Podfile`, `Package.swift`.
67
- - For native Android: `build.gradle`, `settings.gradle`, flavor configs.
67
+ - For native Android: `build.gradle` / `build.gradle.kts`, `settings.gradle` / `settings.gradle.kts`, flavor configs.
68
68
 
69
69
  4. **Populate every field** in the output schema below. Use `null` for
70
70
  genuinely unknown values or fields that do not apply to this project type.
@@ -89,6 +89,8 @@ Return a JSON object with these top-level fields:
89
89
  | `startup_commands` | array | `[{ command, context }]` — concrete dev server start commands |
90
90
  | `build_commands` | array | `[{ command, platform, context }]` — build commands per platform |
91
91
  | `argent_workflow` | object | `{ start_dev_server, build_ios, build_android, notes }` — exact commands for Argent |
92
+ | `ios_has_podfile` | bool | True when `ios/Podfile` exists |
93
+ | `android_has_gradle` | bool | True when `android/gradlew` exists |
92
94
  | `configs` | object | Paths to metro, babel, app, tsconfig, pubspec, xcode, gradle configs (`null` if absent) |
93
95
  | `metro_port` | number\|null | From config or default 8081; `null` for non-RN |
94
96
  | `env_resolution` | object | `{ env_files, strategy, notes }` |
@@ -41,5 +41,5 @@ Look for these beyond the obvious lint/test configs, regardless of project type:
41
41
  - `lint-staged` config — what runs on commit
42
42
  - CI config files — the CI steps are ground truth for what "passing" means
43
43
  - `Podfile` / `Package.swift` — iOS dependency management
44
- - `build.gradle` / `settings.gradle` — Android build config and flavor definitions
44
+ - `build.gradle` / `build.gradle.kts` / `settings.gradle` / `settings.gradle.kts` — Android build config and flavor definitions (Groovy or Kotlin DSL)
45
45
  - `pubspec.yaml` / `analysis_options.yaml` — Flutter project config and lint rules
package/bin/ax-service CHANGED
Binary file
Binary file
package/dist/cli-cmds.mjs CHANGED
@@ -459,7 +459,7 @@ Invoke a tool exposed by the argent tool-server. Run \`argent tools\` to list
459
459
  available tools, or \`argent tools describe <name>\` to see one tool's flags.
460
460
 
461
461
  Examples:
462
- argent run list-simulators
462
+ argent run list-devices
463
463
  argent run gesture-tap --udid <UDID> --x 0.5 --y 0.5
464
464
  argent run screenshot --udid <UDID> --out ./screen.png
465
465
  argent run run-sequence --udid <UDID> --steps-json '[{"tool":"button","args":{"button":"home"}}]'
@@ -10392,7 +10392,7 @@ ${l}
10392
10392
  var import_picocolors2 = __toESM(require_picocolors(), 1);
10393
10393
  import { existsSync as existsSync3 } from "node:fs";
10394
10394
  import { resolve as resolve2 } from "node:path";
10395
- import { execSync as execSync2, spawn } from "node:child_process";
10395
+ import { spawn } from "node:child_process";
10396
10396
 
10397
10397
  // ../argent-installer/src/mcp-configs.ts
10398
10398
  import * as fs2 from "node:fs";
@@ -12825,6 +12825,28 @@ function isNewerVersion(candidate, current) {
12825
12825
  if (!import_semver.default.valid(candidate) || !import_semver.default.valid(current)) return false;
12826
12826
  return import_semver.default.gt(candidate, current);
12827
12827
  }
12828
+ var TEMP_RUNNER_MARKERS = [
12829
+ "_npx",
12830
+ "/dlx-",
12831
+ "\\dlx-",
12832
+ "bun/install/cache",
12833
+ ".bun\\install\\cache"
12834
+ ];
12835
+ function isTempRunnerPath(binaryPath) {
12836
+ return TEMP_RUNNER_MARKERS.some((marker) => binaryPath.includes(marker));
12837
+ }
12838
+ function isGloballyInstalled() {
12839
+ try {
12840
+ const cmd = process.platform === "win32" ? "where" : "which -a";
12841
+ const output = execSync(`${cmd} ${MCP_BINARY_NAME}`, {
12842
+ encoding: "utf8",
12843
+ stdio: ["ignore", "pipe", "ignore"]
12844
+ });
12845
+ return output.split(/\r?\n/).map((line) => line.trim()).filter(Boolean).some((line) => !isTempRunnerPath(line));
12846
+ } catch {
12847
+ return false;
12848
+ }
12849
+ }
12828
12850
  function isSkillsCliAvailable() {
12829
12851
  try {
12830
12852
  execSync("npx --no-install skills --version", {
@@ -13700,25 +13722,6 @@ function formatSkillRefreshSummary(results) {
13700
13722
  }
13701
13723
 
13702
13724
  // ../argent-installer/src/init.ts
13703
- var TEMP_RUNNER_MARKERS = [
13704
- "_npx",
13705
- "/dlx-",
13706
- "\\dlx-",
13707
- "bun/install/cache",
13708
- ".bun\\install\\cache"
13709
- ];
13710
- function isGloballyInstalled() {
13711
- try {
13712
- const cmd = process.platform === "win32" ? "where" : "which";
13713
- const binaryPath = execSync2(`${cmd} ${MCP_BINARY_NAME}`, {
13714
- encoding: "utf8",
13715
- stdio: ["ignore", "pipe", "ignore"]
13716
- }).trim();
13717
- return !TEMP_RUNNER_MARKERS.some((marker) => binaryPath.includes(marker));
13718
- } catch {
13719
- return false;
13720
- }
13721
- }
13722
13725
  function runShellCommand(cmd) {
13723
13726
  return new Promise((resolve3, reject) => {
13724
13727
  const isWin = process.platform === "win32";
@@ -14246,8 +14249,9 @@ async function killToolServer() {
14246
14249
  async function update(args) {
14247
14250
  const nonInteractive = args.includes("--yes") || args.includes("-y");
14248
14251
  Wt2(import_picocolors3.default.bgCyan(import_picocolors3.default.black(" argent update ")));
14249
- const installed = getInstalledVersion();
14250
- if (!installed) {
14252
+ const globallyInstalled = isGloballyInstalled();
14253
+ const installed = globallyInstalled ? getInstalledVersion() : null;
14254
+ if (globallyInstalled && !installed) {
14251
14255
  R2.error("Could not determine installed version.");
14252
14256
  process.exit(1);
14253
14257
  }
@@ -14262,21 +14266,28 @@ async function update(args) {
14262
14266
  process.exit(1);
14263
14267
  }
14264
14268
  spinner.stop("Version check complete.");
14265
- R2.info(`Installed: ${import_picocolors3.default.cyan(`v${installed}`)}`);
14269
+ if (installed) {
14270
+ R2.info(`Installed: ${import_picocolors3.default.cyan(`v${installed}`)}`);
14271
+ } else {
14272
+ R2.warn(`${PACKAGE_NAME} is not installed globally.`);
14273
+ }
14266
14274
  R2.info(`Latest: ${import_picocolors3.default.cyan(`v${latest}`)}`);
14267
- if (isNewerVersion(latest, installed)) {
14268
- R2.warn(`Update available: ${import_picocolors3.default.yellow(`v${installed}`)} -> ${import_picocolors3.default.green(`v${latest}`)}`);
14275
+ const needsInstall = !installed || isNewerVersion(latest, installed);
14276
+ if (needsInstall) {
14277
+ if (installed) {
14278
+ R2.warn(`Update available: ${import_picocolors3.default.yellow(`v${installed}`)} -> ${import_picocolors3.default.green(`v${latest}`)}`);
14279
+ }
14269
14280
  const pm = detectPackageManager();
14270
14281
  const cmd = globalInstallCommand(pm, `${PACKAGE_NAME}@${latest}`);
14271
14282
  const cmdStr = formatShellCommand(cmd);
14272
14283
  if (!nonInteractive) {
14273
14284
  R2.message(import_picocolors3.default.dim(" Press y for yes, n for no, enter to confirm."));
14274
14285
  const proceed = await Rt({
14275
- message: `Update to v${latest}?`,
14286
+ message: installed ? `Update to v${latest}?` : `Install ${PACKAGE_NAME}@${latest} globally?`,
14276
14287
  initialValue: true
14277
14288
  });
14278
14289
  if (Ct(proceed) || !proceed) {
14279
- Nt("Update cancelled.");
14290
+ Nt(installed ? "Update cancelled." : "Install cancelled.");
14280
14291
  process.exit(0);
14281
14292
  }
14282
14293
  }
@@ -14288,7 +14299,7 @@ async function update(args) {
14288
14299
  env: { ...process.env, ARGENT_SKIP_POSTINSTALL: "1" }
14289
14300
  });
14290
14301
  } catch (err) {
14291
- R2.error(`Update failed: ${err}`);
14302
+ R2.error(`${installed ? "Update" : "Install"} failed: ${err}`);
14292
14303
  process.exit(1);
14293
14304
  }
14294
14305
  } else {
@@ -14230,7 +14230,7 @@ async function startMcpServer(options) {
14230
14230
  { name: "argent", version: "0.5.3" },
14231
14231
  {
14232
14232
  capabilities: { tools: {} },
14233
- instructions: "Argent \u2014 iOS Simulator Control for interacting, testing, profiling and debugging mobile applications. Always use discovery tools (describe / debugger-component-tree / screenshot) before tapping \u2014 never guess coordinates. On session end: call stop-all-simulator-servers and perform any necessary cleanup. Full guidance is in the argent rule loaded from .claude/rules/argent.md."
14233
+ instructions: "Argent \u2014 iOS Simulator and Android Emulator control for interacting, testing, profiling and debugging mobile applications. Always use discovery tools (describe / debugger-component-tree / screenshot) before tapping \u2014 never guess coordinates. On session end: call stop-all-simulator-servers and perform any necessary cleanup. Full guidance is in the argent rule loaded from .claude/rules/argent.md."
14234
14234
  }
14235
14235
  );
14236
14236
  server.setRequestHandler(ListToolsRequestSchema, async () => {