@swmansion/argent 0.7.0 → 0.8.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 +1 -1
- package/agents/argent-environment-inspector.md +0 -1
- package/bin/ax-service +0 -0
- package/dist/cli.js +2 -10
- package/dist/cli.js.map +1 -1
- package/dist/fatal-handlers.d.ts +3 -0
- package/dist/fatal-handlers.js +75 -0
- package/dist/fatal-handlers.js.map +1 -0
- package/dist/installer.mjs +1473 -1371
- package/dist/mcp-server.mjs +156 -49
- package/dist/tool-server.cjs +603 -183
- package/dylibs/libArgentInjectionBootstrap.dylib +0 -0
- package/dylibs/libKeyboardPatch.dylib +0 -0
- package/dylibs/libNativeDevtoolsIos.dylib +0 -0
- package/package.json +6 -5
- package/rules/argent.md +15 -2
- package/scripts/postinstall.cjs +0 -1
- package/skills/argent-create-flow/SKILL.md +2 -2
- package/skills/argent-device-interact/SKILL.md +1 -1
- package/skills/argent-ios-simulator-setup/SKILL.md +1 -1
- package/skills/argent-metro-debugger/SKILL.md +6 -6
- package/skills/argent-metro-debugger/references/failure-scenarios.md +2 -2
- package/skills/argent-react-native-app-workflow/SKILL.md +14 -13
- package/skills/argent-react-native-optimization/SKILL.md +2 -2
- package/skills/argent-test-ui-flow/SKILL.md +3 -1
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@ npx @swmansion/argent init
|
|
|
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.
|
|
21
|
-
- **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
|
|
21
|
+
- **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.
|
|
22
22
|
|
|
23
23
|
> **Tip:** Once installed, ask your assistant _"What can Argent do?"_ - it will walk you through all capabilities available.
|
|
24
24
|
|
|
@@ -11,7 +11,6 @@ description: >
|
|
|
11
11
|
Use proactively at session start when required to gather the environment information.
|
|
12
12
|
If subagent delegation is not available, run the steps in the main thread instead.
|
|
13
13
|
The main agent is responsible for persisting the result to project memory.
|
|
14
|
-
model: haiku
|
|
15
14
|
---
|
|
16
15
|
|
|
17
16
|
You are the **environment-inspector** subagent. Your job is to inspect a mobile app
|
package/bin/ax-service
CHANGED
|
Binary file
|
package/dist/cli.js
CHANGED
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
import * as fs from "node:fs";
|
|
23
23
|
import * as path from "node:path";
|
|
24
24
|
import { BUNDLED_RUNTIME_PATHS } from "./bundled-paths.js";
|
|
25
|
+
import { installFatalHandlers } from "./fatal-handlers.js";
|
|
25
26
|
const PACKAGE_NAME = "@swmansion/argent";
|
|
26
27
|
function getInstalledVersion() {
|
|
27
28
|
try {
|
|
@@ -37,16 +38,7 @@ function getInstalledVersion() {
|
|
|
37
38
|
}
|
|
38
39
|
const [, , command, ...rest] = process.argv;
|
|
39
40
|
const isMcpServer = command === "mcp";
|
|
40
|
-
|
|
41
|
-
process.stderr.write(`[argent] Uncaught exception: ${err.stack ?? err}\n`);
|
|
42
|
-
if (!isMcpServer)
|
|
43
|
-
process.exit(1);
|
|
44
|
-
});
|
|
45
|
-
process.on("unhandledRejection", (reason) => {
|
|
46
|
-
process.stderr.write(`[argent] Unhandled rejection: ${reason instanceof Error ? (reason.stack ?? reason.message) : reason}\n`);
|
|
47
|
-
if (!isMcpServer)
|
|
48
|
-
process.exit(1);
|
|
49
|
-
});
|
|
41
|
+
installFatalHandlers({ isMcpServer });
|
|
50
42
|
function printHelp() {
|
|
51
43
|
const version = getInstalledVersion() ?? "unknown";
|
|
52
44
|
console.log(`
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAIlC,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,MAAM,YAAY,GAAG,mBAAmB,CAAC;AAEzC,SAAS,mBAAmB;IAC1B,IAAI,CAAC;QACH,uEAAuE;QACvE,oDAAoD;QACpD,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;QACxE,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,CAAyB,CAAC;QACjF,OAAO,GAAG,CAAC,OAAO,IAAI,IAAI,CAAC;IAC7B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,MAAM,CAAC,EAAE,AAAD,EAAG,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;AAC5C,MAAM,WAAW,GAAG,OAAO,KAAK,KAAK,CAAC;AAEtC,
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAIlC,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE3D,MAAM,YAAY,GAA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AAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACnB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// Process-level handlers for uncaughtException and unhandledRejection.
|
|
2
|
+
//
|
|
3
|
+
// In MCP-server mode we do NOT exit on every uncaught error — many are
|
|
4
|
+
// transient and the editor expects the server to keep running. But the naive
|
|
5
|
+
// version (`stderr.write(...); if (!isMcp) exit`) burns 100% CPU when stderr
|
|
6
|
+
// itself is broken (e.g. the parent process is gone): the write emits an
|
|
7
|
+
// async 'error' event on the stream, which without a listener becomes another
|
|
8
|
+
// uncaughtException, runs the handler, writes to the same broken stream, ...
|
|
9
|
+
//
|
|
10
|
+
// The fix has three pieces:
|
|
11
|
+
// 1. `'error'` listeners on stdout/stderr — broken stdio is fatal; exit
|
|
12
|
+
// before the failure round-trips into uncaughtException. This is what
|
|
13
|
+
// breaks the production loop.
|
|
14
|
+
// 2. try/catch around `stderr.write` — synchronous write failures also exit
|
|
15
|
+
// cleanly instead of escaping into another uncaughtException.
|
|
16
|
+
// 3. try/catch around the formatter — a throwing `.stack` getter or
|
|
17
|
+
// `toString` (the production trace pointed at defaultPrepareStackTrace)
|
|
18
|
+
// can't take down the handler.
|
|
19
|
+
//
|
|
20
|
+
// When stdio is unusable we cannot tell the parent process what went wrong,
|
|
21
|
+
// so we leave a breadcrumb on disk at `~/.argent/mcp-fatal.log`. Sibling of
|
|
22
|
+
// the other persistent argent diagnostic logs (`tool-server.log`, etc.).
|
|
23
|
+
import * as fs from "node:fs";
|
|
24
|
+
import * as os from "node:os";
|
|
25
|
+
import * as path from "node:path";
|
|
26
|
+
let installed = false;
|
|
27
|
+
const FATAL_LOG_PATH = path.join(os.homedir(), ".argent", "mcp-fatal.log");
|
|
28
|
+
function appendFatalLog(label, detail) {
|
|
29
|
+
try {
|
|
30
|
+
fs.mkdirSync(path.dirname(FATAL_LOG_PATH), { recursive: true });
|
|
31
|
+
const line = `[${new Date().toISOString()}] pid=${process.pid} ${label}: ${detail}\n`;
|
|
32
|
+
fs.appendFileSync(FATAL_LOG_PATH, line);
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
// Last-resort log — if even this write fails (read-only fs, missing home),
|
|
36
|
+
// there is nothing more we can do. Swallow so we still exit cleanly.
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
export function installFatalHandlers(opts) {
|
|
40
|
+
if (installed)
|
|
41
|
+
return;
|
|
42
|
+
installed = true;
|
|
43
|
+
for (const stream of [process.stdout, process.stderr]) {
|
|
44
|
+
const name = stream === process.stdout ? "stdout" : "stderr";
|
|
45
|
+
stream.on("error", (err) => {
|
|
46
|
+
appendFatalLog(`Broken ${name}`, String(err?.stack ?? err));
|
|
47
|
+
process.exit(1);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
function reportFatal(label, getDetail) {
|
|
51
|
+
let detail;
|
|
52
|
+
try {
|
|
53
|
+
try {
|
|
54
|
+
detail = getDetail();
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
detail = "<failed to format>";
|
|
58
|
+
}
|
|
59
|
+
process.stderr.write(`[argent] ${label}: ${detail}\n`);
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
appendFatalLog(label, detail);
|
|
63
|
+
process.exit(1);
|
|
64
|
+
}
|
|
65
|
+
if (!opts.isMcpServer)
|
|
66
|
+
process.exit(1);
|
|
67
|
+
}
|
|
68
|
+
process.on("uncaughtException", (err) => {
|
|
69
|
+
reportFatal("Uncaught exception", () => String(err?.stack ?? err));
|
|
70
|
+
});
|
|
71
|
+
process.on("unhandledRejection", (reason) => {
|
|
72
|
+
reportFatal("Unhandled rejection", () => reason instanceof Error ? (reason.stack ?? reason.message) : String(reason));
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingUR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