@swmansion/argent 0.14.1-next.5 → 0.14.1-next.7
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 +42 -20
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +2 -2
- package/dist/tool-server.cjs +64 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,18 +9,32 @@
|
|
|
9
9
|
[](https://swm-delivery.com/www/delivery/ck-slug.php?zoneid=zone-gh-argent-2&n=1)
|
|
10
10
|
[](https://swm-delivery.com/www/delivery/ck-slug.php?zoneid=zone-gh-argent-3&n=1)
|
|
11
11
|
|
|
12
|
-
**[Argent](https://argent.swmansion.com)** is an **agentic toolkit** that gives your AI assistant direct access to iOS Simulators and Android
|
|
12
|
+
**[Argent](https://argent.swmansion.com)** is an **agentic toolkit** that gives your AI assistant direct access to iOS Simulators, Android emulators and physical devices, TVs (Apple TV, Android TV, Fire TV) and Electron/Chromium desktop and web apps. Ask it to tap a button, run a profiler or reproduce an issue manually - all from within your CLI, without switching context.
|
|
13
13
|
|
|
14
14
|
```bash
|
|
15
15
|
npx @swmansion/argent init
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
+
## Supported platforms
|
|
19
|
+
|
|
20
|
+
Argent drives a growing set of targets through a single toolkit, each with the right interaction model - touch, remote or mouse:
|
|
21
|
+
|
|
22
|
+
| Platform | Targets | Interaction |
|
|
23
|
+
| ----------------- | ----------------------------------------------------------------------- | ---------------- |
|
|
24
|
+
| **iOS** | Simulators | Touch / gesture |
|
|
25
|
+
| **Android** | Emulators (AVDs) and physical devices over adb | Touch / gesture |
|
|
26
|
+
| **TV** | Apple TV (tvOS), Android TV / Google TV, Amazon Fire TV (Vega) | D-pad / remote |
|
|
27
|
+
| **Desktop & web** | Electron and Chromium apps (incl. React Native Web / Expo web) over CDP | Mouse / keyboard |
|
|
28
|
+
|
|
18
29
|
## Capabilities
|
|
19
30
|
|
|
20
|
-
- **Autonomous
|
|
21
|
-
- **UI interaction** - Give your agent full control toolkit - tapping, swiping, pinching, typing, gestures
|
|
22
|
-
- **
|
|
23
|
-
- **
|
|
31
|
+
- **Autonomous mobile, TV and desktop development** - Allow your agent to work with iOS, Android, TV and Electron/web 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.
|
|
32
|
+
- **UI interaction** - Give your agent the full control toolkit - tapping, swiping, pinching, typing, gestures and hardware buttons on mobile; the directional remote on TV; mouse, scroll and drag on desktop/web. Let it navigate your app exactly as a user would, without lifting a finger.
|
|
33
|
+
- **Record & replay flows** - Capture a sequence of interactions once and let your agent replay it deterministically, so manual repros and smoke tests become repeatable.
|
|
34
|
+
- **Visual regression** - Diff two screenshots (or a saved baseline against a live capture) with OCR- and font-aware comparison to catch unintended UI changes.
|
|
35
|
+
- **Profiling with batteries included** - Argent can perform and analyze React Native (Hermes), React DevTools and native (Xcode Instruments / Android Perfetto) profiling sessions - down to fiber renders, CPU hotspots and cross-correlated commit-vs-hang reports. Get comprehensive summaries and ask to optimise your app where you find fit.
|
|
36
|
+
- **Debugging and diagnostics** - Let your agent inspect logs, capture network traffic (JS `fetch` and native), evaluate JS in the running app, walk the native UIKit and React component trees, and reproduce failing states - so you can jump straight to the fix.
|
|
37
|
+
- **Desktop & web control** - For Electron and Chromium apps your agent can drive tabs, read and write cookies and storage, walk the DOM and inspect network over the Chrome DevTools Protocol.
|
|
24
38
|
- **React Native out of the box** - Argent works with React Native apps natively, so your agent can build, launch, and iterate on your RN project the same way it would any native app - no extra setup required.
|
|
25
39
|
|
|
26
40
|
> **Tip:** Once installed, ask your assistant _"What can Argent do?"_ - it will walk you through all capabilities available.
|
|
@@ -37,8 +51,10 @@ npx @swmansion/argent init
|
|
|
37
51
|
#### Prerequisites
|
|
38
52
|
|
|
39
53
|
- **Node.js 20.11** or later
|
|
40
|
-
- For iOS: macOS with **Xcode** installed
|
|
41
|
-
- 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`.
|
|
54
|
+
- For iOS / tvOS: macOS with **Xcode** installed (Apple TV uses tvOS simulators — Xcode downloads the tvOS runtime on demand)
|
|
55
|
+
- For Android / Android TV: **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`.
|
|
56
|
+
- For Fire TV (Vega): the **Vega SDK** (`vega` CLI) on `PATH`
|
|
57
|
+
- For Electron / Chromium: nothing extra to control an already-running app - just launch it with `--remote-debugging-port`, or let Argent spawn your Electron app for you
|
|
42
58
|
|
|
43
59
|
##### Linux host: extra prerequisites for Android emulators
|
|
44
60
|
|
|
@@ -100,18 +116,24 @@ argent init
|
|
|
100
116
|
|
|
101
117
|
## CLI Reference
|
|
102
118
|
|
|
103
|
-
| Command | Description
|
|
104
|
-
| ------------------ |
|
|
105
|
-
| `argent init` | Install globally and configure MCP in the current workspace
|
|
106
|
-
| `argent install` | Alias for `init` command
|
|
107
|
-
| `argent update` | Pull the latest version and refresh workspace configuration
|
|
108
|
-
| `argent remove` | Unregister the MCP server and uninstall the package
|
|
109
|
-
| `argent uninstall` | Alias for `remove` command
|
|
110
|
-
| `argent mcp` | Start MCP server instance, used internally by agent
|
|
111
|
-
| `argent
|
|
112
|
-
| `argent
|
|
113
|
-
| `argent
|
|
114
|
-
| `argent
|
|
119
|
+
| Command | Description |
|
|
120
|
+
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
121
|
+
| `argent init` | Install globally and configure MCP in the current workspace |
|
|
122
|
+
| `argent install` | Alias for `init` command |
|
|
123
|
+
| `argent update` | Pull the latest version and refresh workspace configuration |
|
|
124
|
+
| `argent remove` | Unregister the MCP server and uninstall the package |
|
|
125
|
+
| `argent uninstall` | Alias for `remove` command |
|
|
126
|
+
| `argent mcp` | Start MCP server instance, used internally by agent |
|
|
127
|
+
| `argent tools` | List tools exposed by the tool-server (`describe <name>` for details) |
|
|
128
|
+
| `argent run` | Invoke a tool by name |
|
|
129
|
+
| `argent server` | Manage the shared tool-server: `start` / `status` / `stop` / `logs` |
|
|
130
|
+
| `argent lens` | Open Argent Lens bound to a fresh coding-agent session — Claude by default, `--agent` selects codex/gemini/opencode/cursor (macOS; behind the `argent-lens` flag — run `argent enable argent-lens` first) |
|
|
131
|
+
| `argent link` | Route client requests to a remote tool-server |
|
|
132
|
+
| `argent unlink` | Remove the persisted remote tool-server link |
|
|
133
|
+
| `argent enable` | Enable a predefined feature flag (`--scope project` for project-local) |
|
|
134
|
+
| `argent disable` | Disable a feature flag (`--scope project` for project-local) |
|
|
135
|
+
| `argent flags` | List available feature flags and their state |
|
|
136
|
+
| `argent telemetry` | Manage anonymous telemetry: `status` / `enable` / `disable` |
|
|
115
137
|
|
|
116
138
|
## Supported Editors
|
|
117
139
|
|
|
@@ -123,7 +145,7 @@ argent init
|
|
|
123
145
|
| Cursor | `.cursor/mcp.json` (project) or `~/.cursor/mcp.json` (global) |
|
|
124
146
|
| VS Code | `.vscode/mcp.json` |
|
|
125
147
|
| Windsurf | `~/.codeium/windsurf/mcp_config.json` (global) |
|
|
126
|
-
| Zed | `.zed/settings.json`
|
|
148
|
+
| Zed | `.zed/settings.json` (project) or `~/.config/zed/settings.json` (global) |
|
|
127
149
|
| Gemini CLI | `.gemini/settings.json` |
|
|
128
150
|
| Codex CLI | `.codex/config.toml` (project) or `~/.codex/config.toml` (global) |
|
|
129
151
|
| Hermes | `~/.hermes/config.yaml` (global) |
|
package/dist/cli.d.ts
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* argent run <tool> [flags] Invoke a tool by name
|
|
20
20
|
* argent server start [flags] Spawn a long-lived tool-server (foreground by default)
|
|
21
21
|
* argent server status|stop|logs Manage the shared tool-server
|
|
22
|
-
* argent lens Open Argent Lens bound to a fresh
|
|
22
|
+
* argent lens Open Argent Lens bound to a fresh coding-agent session (macOS)
|
|
23
23
|
* argent link [flags] Route client requests to a remote tool-server
|
|
24
24
|
* argent unlink Remove the persisted remote link
|
|
25
25
|
* argent enable <flag> Enable a feature flag (global by default)
|
package/dist/cli.js
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* argent run <tool> [flags] Invoke a tool by name
|
|
20
20
|
* argent server start [flags] Spawn a long-lived tool-server (foreground by default)
|
|
21
21
|
* argent server status|stop|logs Manage the shared tool-server
|
|
22
|
-
* argent lens Open Argent Lens bound to a fresh
|
|
22
|
+
* argent lens Open Argent Lens bound to a fresh coding-agent session (macOS)
|
|
23
23
|
* argent link [flags] Route client requests to a remote tool-server
|
|
24
24
|
* argent unlink Remove the persisted remote link
|
|
25
25
|
* argent enable <flag> Enable a feature flag (global by default)
|
|
@@ -63,7 +63,7 @@ Commands:
|
|
|
63
63
|
tools List tools exposed by the tool-server
|
|
64
64
|
run Invoke a tool by name (use \`argent run <tool> --help\` for flags)
|
|
65
65
|
server Manage the shared tool-server (start / status / stop / logs)
|
|
66
|
-
lens Open Argent Lens bound to a fresh
|
|
66
|
+
lens Open Argent Lens bound to a fresh coding-agent session (macOS)
|
|
67
67
|
link Route client requests to a remote tool-server
|
|
68
68
|
unlink Remove the persisted remote tool-server link
|
|
69
69
|
enable Enable a feature flag (global by default, --scope project for project)
|
package/dist/tool-server.cjs
CHANGED
|
@@ -15716,14 +15716,27 @@ var init_registry = __esm({
|
|
|
15716
15716
|
effectiveParams = parsed.data;
|
|
15717
15717
|
}
|
|
15718
15718
|
const aliasToRef = definition.services(effectiveParams);
|
|
15719
|
-
const
|
|
15720
|
-
|
|
15721
|
-
|
|
15722
|
-
|
|
15723
|
-
|
|
15724
|
-
}
|
|
15719
|
+
const refs = Object.entries(aliasToRef).map(([alias, ref]) => ({
|
|
15720
|
+
alias,
|
|
15721
|
+
urn: typeof ref === "string" ? ref : ref.urn,
|
|
15722
|
+
options: typeof ref === "string" ? void 0 : ref.options
|
|
15723
|
+
}));
|
|
15725
15724
|
const ctx = { ...options, artifacts: this.artifacts };
|
|
15726
|
-
const
|
|
15725
|
+
const runOnce = async () => {
|
|
15726
|
+
const resolvedServices = {};
|
|
15727
|
+
for (const { alias, urn, options: resolveOptions } of refs) {
|
|
15728
|
+
resolvedServices[alias] = await this.resolveService(urn, resolveOptions);
|
|
15729
|
+
}
|
|
15730
|
+
return definition.execute(resolvedServices, effectiveParams, ctx);
|
|
15731
|
+
};
|
|
15732
|
+
let result;
|
|
15733
|
+
try {
|
|
15734
|
+
result = await runOnce();
|
|
15735
|
+
} catch (execError) {
|
|
15736
|
+
const recovered = await this._recoverFailedServices(refs, execError);
|
|
15737
|
+
if (!recovered) throw execError;
|
|
15738
|
+
result = await runOnce();
|
|
15739
|
+
}
|
|
15727
15740
|
const duration3 = performance.now() - startTime;
|
|
15728
15741
|
this.events.emit("toolCompleted", id, toolInvocationId, duration3);
|
|
15729
15742
|
return result;
|
|
@@ -15763,6 +15776,30 @@ var init_registry = __esm({
|
|
|
15763
15776
|
tools: [...this.tools.keys()]
|
|
15764
15777
|
};
|
|
15765
15778
|
}
|
|
15779
|
+
/**
|
|
15780
|
+
* After a tool failed, ask each service it resolved whether the error means
|
|
15781
|
+
* that service's instance is dead (`blueprint.recoverable(error)`). Dispose
|
|
15782
|
+
* every one that says yes so the next `resolveService` re-creates it, and
|
|
15783
|
+
* report whether anything was disposed (i.e. whether a retry is worthwhile).
|
|
15784
|
+
*
|
|
15785
|
+
* Only currently-RUNNING nodes are considered: a service that already
|
|
15786
|
+
* errored/torn down during resolution needs no recovery here, and a URN this
|
|
15787
|
+
* tool never resolved must not be touched.
|
|
15788
|
+
*/
|
|
15789
|
+
async _recoverFailedServices(refs, error52) {
|
|
15790
|
+
let recoveredAny = false;
|
|
15791
|
+
for (const { urn } of refs) {
|
|
15792
|
+
const node = this.services.get(urn);
|
|
15793
|
+
if (!node || node.state !== "RUNNING" /* RUNNING */) continue;
|
|
15794
|
+
if (node.blueprint.recoverable?.(error52) !== true) continue;
|
|
15795
|
+
try {
|
|
15796
|
+
await this.disposeService(urn);
|
|
15797
|
+
recoveredAny = true;
|
|
15798
|
+
} catch {
|
|
15799
|
+
}
|
|
15800
|
+
}
|
|
15801
|
+
return recoveredAny;
|
|
15802
|
+
}
|
|
15766
15803
|
/**
|
|
15767
15804
|
* Tear down a single service by URN (and cascade to its dependents).
|
|
15768
15805
|
* After disposal the service returns to IDLE and can be re-resolved.
|
|
@@ -109737,6 +109774,26 @@ var simulatorServerBlueprint = {
|
|
|
109737
109774
|
getURN(device) {
|
|
109738
109775
|
return `${SIMULATOR_SERVER_NAMESPACE}:${device.id}`;
|
|
109739
109776
|
},
|
|
109777
|
+
/**
|
|
109778
|
+
* A cached simulator-server handle can outlive the thing it points at: when a
|
|
109779
|
+
* simulator is un-booted (or the native server crashes) the child process may
|
|
109780
|
+
* stay alive but stop listening on its API port, so every subsequent request
|
|
109781
|
+
* fails with `ECONNREFUSED` against the now-dead port — the exact "worked once,
|
|
109782
|
+
* then every call times out" symptom, unrecoverable until a human runs
|
|
109783
|
+
* `stop-simulator-server`. The process never emitting `exit` means the
|
|
109784
|
+
* registry's normal teardown (wired to `proc.on("exit")`) never fires.
|
|
109785
|
+
*
|
|
109786
|
+
* Treat a connection-refused failure as proof the instance is dead so the
|
|
109787
|
+
* registry disposes it (killing the wedged process) and re-spawns a fresh
|
|
109788
|
+
* simulator-server on the next call. Scoped to connection-refused only:
|
|
109789
|
+
* ECONNREFUSED means the request never reached the server, so retrying can't
|
|
109790
|
+
* double-apply a gesture. Timeouts and resets are deliberately excluded — the
|
|
109791
|
+
* request there may have taken effect, and a hung-but-listening server is a
|
|
109792
|
+
* different failure that respawning wouldn't fix.
|
|
109793
|
+
*/
|
|
109794
|
+
recoverable(error52) {
|
|
109795
|
+
return getFailureSignal(error52)?.network_failure === "connection_refused";
|
|
109796
|
+
},
|
|
109740
109797
|
async factory(_deps, _payload, options) {
|
|
109741
109798
|
const opts = options;
|
|
109742
109799
|
if (!opts?.device) {
|