@swmansion/argent 0.9.0 → 0.11.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.
Files changed (37) hide show
  1. package/README.md +53 -10
  2. package/assets/argent.tracecfg.pbtxt +133 -0
  3. package/assets/queries/README.md +93 -0
  4. package/assets/queries/cpu-hotspots.sql +106 -0
  5. package/assets/queries/function-callers.sql +62 -0
  6. package/assets/queries/hang-folds-batched.sql +88 -0
  7. package/assets/queries/hang-main-thread-samples.sql +32 -0
  8. package/assets/queries/hang-state-breakdown.sql +44 -0
  9. package/assets/queries/memory-rss.sql +25 -0
  10. package/assets/queries/thread-breakdown.sql +34 -0
  11. package/assets/queries/trace-bounds.sql +6 -0
  12. package/assets/queries/ui-hangs.sql +59 -0
  13. package/assets/trace-processor/LICENSE +235 -0
  14. package/assets/trace-processor/SHA256SUMS +4 -0
  15. package/assets/trace-processor/engine.mjs +42423 -0
  16. package/assets/trace-processor/engine_bundle.node.js +11130 -0
  17. package/assets/trace-processor/trace_processor.wasm +0 -0
  18. package/{dist → bin}/argent-android-devtools-0.1.0.apk +0 -0
  19. package/bin/argent-simulator-server.cjs +56 -0
  20. package/bin/{ax-service → darwin/ax-service} +0 -0
  21. package/bin/{simulator-server → darwin/simulator-server} +0 -0
  22. package/bin/linux/simulator-server +0 -0
  23. package/dist/cli-cmds.mjs +2540 -85
  24. package/dist/cli.d.ts +6 -0
  25. package/dist/cli.js +23 -2
  26. package/dist/cli.js.map +1 -1
  27. package/dist/installer.mjs +241 -107
  28. package/dist/mcp-server.mjs +440 -110
  29. package/dist/tool-server.cjs +4297 -1895
  30. package/dylibs/libArgentInjectionBootstrap.dylib +0 -0
  31. package/dylibs/libKeyboardPatch.dylib +0 -0
  32. package/dylibs/libNativeDevtoolsIos.dylib +0 -0
  33. package/package.json +3 -3
  34. package/skills/argent-android-emulator-setup/SKILL.md +1 -1
  35. package/skills/argent-native-profiler/SKILL.md +5 -5
  36. /package/{dist → assets}/Argent.tracetemplate +0 -0
  37. /package/{manifest.json → assets/manifest.json} +0 -0
@@ -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