@swmansion/argent 0.9.0 → 0.10.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.
- package/README.md +49 -9
- package/bin/argent-simulator-server.cjs +56 -0
- package/bin/{ax-service → darwin/ax-service} +0 -0
- package/bin/{simulator-server → darwin/simulator-server} +0 -0
- package/bin/linux/simulator-server +0 -0
- package/dist/argent-android-devtools-0.1.0.apk +0 -0
- package/dist/cli-cmds.mjs +2364 -76
- package/dist/cli.d.ts +6 -0
- package/dist/cli.js +23 -2
- package/dist/cli.js.map +1 -1
- package/dist/installer.mjs +232 -107
- package/dist/mcp-server.mjs +163 -51
- package/dist/tool-server.cjs +1491 -946
- package/dylibs/libArgentInjectionBootstrap.dylib +0 -0
- package/dylibs/libKeyboardPatch.dylib +0 -0
- package/dylibs/libNativeDevtoolsIos.dylib +0 -0
- package/package.json +2 -2
- package/skills/argent-android-emulator-setup/SKILL.md +1 -1
package/README.md
CHANGED
|
@@ -37,6 +37,43 @@ npx @swmansion/argent init
|
|
|
37
37
|
- For iOS: macOS with **Xcode** installed
|
|
38
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`.
|
|
39
39
|
|
|
40
|
+
##### Linux host: extra prerequisites for Android emulators
|
|
41
|
+
|
|
42
|
+
Argent runs Android emulators on Linux but the default install can be slow if a few host-side knobs aren't right. Cover these once and the experience matches macOS:
|
|
43
|
+
|
|
44
|
+
- **KVM access.** The emulator falls back to slow software emulation (TCG) without `/dev/kvm`. Make sure virtualization is enabled in BIOS/UEFI (`vmx` for Intel, `svm` for AMD in `/proc/cpuinfo`) and that your user can read/write `/dev/kvm` — on most distros that means joining the `kvm` group:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
sudo usermod -aG kvm "$USER"
|
|
48
|
+
# log out and back in so the new group takes effect
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
- **GPU mode (`-gpu swiftshader` on Linux, override available).** The Android emulator's Linux GPU story is messy: `-gpu auto` frequently resolves to lavapipe (slow software Vulkan via host libvulkan, ~10× cold-boot regression on flagship hardware), and `-gpu host` silently produces a corrupted or black emulator window on hosts with non-trivial GL stacks — dual-GPU / Optimus laptops, NVIDIA + Mesa coexistence via libglvnd, Wayland sessions on hybrid graphics, headless / containerized hosts. The failure mode is invisible to argent's framebuffer-based screenshot tool, so an agent reports success while the developer sees a black window.
|
|
52
|
+
|
|
53
|
+
Argent picks `-gpu swiftshader` on Linux for universal compatibility: it sidesteps the host GL stack entirely and renders via the emulator's bundled SwiftShader. On modern multi-core machines this is indistinguishably smooth from hardware-accelerated `-gpu host` (and far faster than lavapipe).
|
|
54
|
+
|
|
55
|
+
Override with the `ARGENT_EMULATOR_GPU_MODE` env var if you've verified `-gpu host` works on your machine (typical single-GPU Mesa box with a healthy X session):
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
ARGENT_EMULATOR_GPU_MODE=host argent ...
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Argent's boot-device preflight prints a warning if `/dev/kvm` isn't usable — the condition that causes a 10–50× TCG-vs-KVM slowdown.
|
|
62
|
+
|
|
63
|
+
- **System image.** Prefer the `default` or `google_apis` variants of `x86_64` system images for headless agent workflows; `google_apis_playstore` adds noticeable boot-time CPU churn from Play services. Always pick `x86_64` on Intel/AMD hosts — ARM images run via QEMU translation and are dramatically slower.
|
|
64
|
+
|
|
65
|
+
- **AVD config.** AVDs created via `avdmanager create avd` default to `hw.gpu.enabled=no`. Argent overrides this with an explicit `-gpu` arg at launch (so the on-disk config doesn't need editing). For the smoothest experience under heavy native builds (gradle compilations alongside the AVD), bump the AVD's RAM and CPU count — edit `~/.android/avd/<name>.avd/config.ini`:
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
hw.ramSize = 8192
|
|
69
|
+
hw.cpu.ncore = 6
|
|
70
|
+
vm.heapSize = 512
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Stock 2 GB / 4 vCPU AVDs can be CPU-starved into wedged-system_server states by a concurrent gradle/Kotlin compile.
|
|
74
|
+
|
|
75
|
+
- **Headless / CI mode (`ARGENT_EMULATOR_NO_WINDOW=1`).** Argent shows the emulator window by default so a local developer can see the AVD UI. In a headless context — CI runner, container, or a Wayland-only session where the emulator's bundled Qt has no `wayland` platform plugin and SIGABRTs on the crash-consent dialog — opt out by exporting `ARGENT_EMULATOR_NO_WINDOW=1` before starting the tool-server. This appends `-no-window` to the spawn args, selecting `qemu-system-x86_64-headless` which doesn't need a Qt window. Argent's screencap-based screenshot tool reads the in-memory framebuffer correctly without a visible window.
|
|
76
|
+
|
|
40
77
|
#### Run `init` in your project
|
|
41
78
|
|
|
42
79
|
From your project root:
|
|
@@ -60,14 +97,17 @@ argent init
|
|
|
60
97
|
|
|
61
98
|
## CLI Reference
|
|
62
99
|
|
|
63
|
-
| Command | Description
|
|
64
|
-
| ------------------ |
|
|
65
|
-
| `argent init` | Install globally and configure MCP in the current workspace
|
|
66
|
-
| `argent install` | Alias for `init` command
|
|
67
|
-
| `argent update` | Pull the latest version and refresh workspace configuration
|
|
68
|
-
| `argent remove` | Unregister the MCP server and uninstall the package
|
|
69
|
-
| `argent uninstall` | Alias for `remove` command
|
|
70
|
-
| `argent mcp` | Start MCP server instance, used internally by agent
|
|
100
|
+
| Command | Description |
|
|
101
|
+
| ------------------ | ---------------------------------------------------------------------- |
|
|
102
|
+
| `argent init` | Install globally and configure MCP in the current workspace |
|
|
103
|
+
| `argent install` | Alias for `init` command |
|
|
104
|
+
| `argent update` | Pull the latest version and refresh workspace configuration |
|
|
105
|
+
| `argent remove` | Unregister the MCP server and uninstall the package |
|
|
106
|
+
| `argent uninstall` | Alias for `remove` command |
|
|
107
|
+
| `argent mcp` | Start MCP server instance, used internally by agent |
|
|
108
|
+
| `argent enable` | Enable a predefined feature flag (`--scope project` for project-local) |
|
|
109
|
+
| `argent disable` | Disable a feature flag (`--scope project` for project-local) |
|
|
110
|
+
| `argent flags` | List available feature flags and their state |
|
|
71
111
|
|
|
72
112
|
## Supported Editors
|
|
73
113
|
|
|
@@ -99,7 +139,7 @@ Argent uses a mixed licensing model.
|
|
|
99
139
|
|
|
100
140
|
**Source code** is released under the [Apache License 2.0](LICENSE.txt).
|
|
101
141
|
|
|
102
|
-
**Proprietary binaries** (the `bin
|
|
142
|
+
**Proprietary binaries** (the per-platform `bin/<platform>/simulator-server` and `bin/darwin/ax-service` executables and the `.dylib` files in `native-devtools-ios`) are the intellectual property of Software Mansion S.A. and are licensed solely for use within this project. Decompiling, reverse-engineering, or redistributing them without explicit written permission is prohibited.
|
|
103
143
|
|
|
104
144
|
By using Argent, you acknowledge and agree to this structure. See [LICENSE](https://github.com/software-mansion/argent/blob/main/LICENSE.txt) for full details.
|
|
105
145
|
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
// Thin dispatcher exposed as the `argent-simulator-server` bin entry in
|
|
5
|
+
// package.json. Picks the platform-specific simulator-server binary at
|
|
6
|
+
// invocation time and execs it with the caller's args. Required because
|
|
7
|
+
// npm's `bin` field resolves to a single file regardless of host platform,
|
|
8
|
+
// but the binary itself is platform-specific (Mach-O for darwin, ELF for
|
|
9
|
+
// linux). The native-devtools-ios resolver uses the same per-platform
|
|
10
|
+
// subdirectory layout, so a stable layout lives in exactly one place.
|
|
11
|
+
|
|
12
|
+
const { spawn } = require("node:child_process");
|
|
13
|
+
const path = require("node:path");
|
|
14
|
+
const fs = require("node:fs");
|
|
15
|
+
|
|
16
|
+
const binary = path.join(__dirname, process.platform, "simulator-server");
|
|
17
|
+
if (!fs.existsSync(binary)) {
|
|
18
|
+
console.error(
|
|
19
|
+
`argent-simulator-server: no binary for platform "${process.platform}" at ${binary}.\n` +
|
|
20
|
+
`Supported hosts today: darwin, linux.`
|
|
21
|
+
);
|
|
22
|
+
process.exit(1);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const child = spawn(binary, process.argv.slice(2), { stdio: "inherit" });
|
|
26
|
+
|
|
27
|
+
// Forward termination signals so a supervisor that signals only the dispatcher
|
|
28
|
+
// PID (systemd, `kill -TERM <pid>`, container stop) doesn't orphan the child.
|
|
29
|
+
// Ctrl+C in a TTY already broadcasts to the whole process group so the child
|
|
30
|
+
// receives it too — these handlers cover the non-TTY case where the parent
|
|
31
|
+
// would otherwise exit alone and leave the binary reparented to init.
|
|
32
|
+
/** @type {NodeJS.Signals[]} */
|
|
33
|
+
const FORWARDED_SIGNALS = ["SIGTERM", "SIGINT", "SIGHUP"];
|
|
34
|
+
for (const sig of FORWARDED_SIGNALS) {
|
|
35
|
+
process.on(sig, () => {
|
|
36
|
+
if (!child.killed) {
|
|
37
|
+
try {
|
|
38
|
+
child.kill(sig);
|
|
39
|
+
} catch {
|
|
40
|
+
// Already exited between the signal arriving and us forwarding it.
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
child.on("exit", (code, signal) => {
|
|
47
|
+
if (signal) {
|
|
48
|
+
process.kill(process.pid, signal);
|
|
49
|
+
} else {
|
|
50
|
+
process.exit(code ?? 1);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
child.on("error", (err) => {
|
|
54
|
+
console.error(`argent-simulator-server: failed to spawn ${binary}: ${err.message}`);
|
|
55
|
+
process.exit(1);
|
|
56
|
+
});
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|