@swmansion/argent 0.34.1-next.4 → 0.34.1-next.40
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/LICENSE +1 -0
- package/assets/ios-screen-stream/Info.plist +12 -0
- package/assets/ios-screen-stream/ios-screen-stream.swift +321 -0
- package/bin/argent-android-devtools-0.4.0.apk +0 -0
- package/bin/darwin/argent-macos-helper +0 -0
- package/bin/darwin/ax-service +0 -0
- package/bin/darwin/simulator-server +0 -0
- package/bin/darwin/tvos-ax-service +0 -0
- package/bin/darwin/tvos-hid-daemon +0 -0
- package/bin/linux/simulator-server +0 -0
- package/bin/linux-arm64/simulator-server +0 -0
- package/bin/network-inspector/network-inspector.jar +0 -0
- package/bin/tcp/ax-service +0 -0
- package/bin/win32/simulator-server.exe +0 -0
- package/dist/cli-cmds.mjs +923 -558
- package/dist/client.js +345 -179
- package/dist/flow-script-runner.mjs +1 -0
- package/dist/installer-help.js +4 -0
- package/dist/installer-help.js.map +1 -1
- package/dist/installer.mjs +1219 -922
- package/dist/ios-device-runner/ArgentRunner/ArgentRunnerUITests/ArgentLaunchPerformanceTests.swift +21 -0
- package/dist/ios-device-runner/ArgentRunner/ArgentRunnerUITests/ArgentRunnerSession+Commands.swift +9 -3
- package/dist/mcp-server.mjs +558 -712
- package/dist/preview-ui/index.html +28 -2
- package/dist/tool-args.generated.d.ts +58 -12
- package/dist/tool-server.cjs +11444 -5226
- package/dylibs/libArgentAudio.dylib +0 -0
- package/dylibs/libArgentInjectionBootstrap.dylib +0 -0
- package/dylibs/libKeyboardPatch.dylib +0 -0
- package/dylibs/libNativeDevtoolsIos.dylib +0 -0
- package/dylibs/macos/libArgentInjectionBootstrap.dylib +0 -0
- package/dylibs/macos/libNativeDevtoolsMacos.dylib +0 -0
- package/dylibs/tcp/libArgentInjectionBootstrap.dylib +0 -0
- package/dylibs/tcp/libKeyboardPatch.dylib +0 -0
- package/dylibs/tcp/libNativeDevtoolsIos.dylib +0 -0
- package/dylibs/tvos/libArgentInjectionBootstrap.dylib +0 -0
- package/dylibs/tvos/libKeyboardPatch.dylib +0 -0
- package/dylibs/tvos/libNativeDevtoolsIos.dylib +0 -0
- package/package.json +1 -1
- package/rules/argent.md +6 -23
- package/skills/argent-create-e2e/references/e2e-yaml.md +2 -2
- package/skills/argent-create-e2e/references/live-authoring.md +1 -1
- package/skills/argent-device-interact/SKILL.md +22 -21
- package/skills/argent-device-interact/references/foldables.md +22 -0
- package/skills/argent-ios-device-interact/SKILL.md +2 -2
- package/skills/argent-macos-app-interact/SKILL.md +15 -5
- package/skills/argent-macos-app-interact/references/e2e.md +1 -1
- package/skills/argent-metro-debugger/SKILL.md +1 -1
- package/skills/argent-native-profiler/SKILL.md +14 -2
- package/skills/argent-react-native-app-workflow/SKILL.md +1 -1
- package/skills/argent-react-native-optimization/SKILL.md +10 -1
- package/skills/argent-react-native-profiler/SKILL.md +4 -3
- package/skills/argent-screen-recording/SKILL.md +3 -2
- package/skills/argent-screenshot-diff/SKILL.md +1 -1
|
@@ -3488,6 +3488,10 @@
|
|
|
3488
3488
|
const j = await d.json();
|
|
3489
3489
|
if (j && j.tree) {
|
|
3490
3490
|
vp.tree = j.tree;
|
|
3491
|
+
// The tree is drawn over the stream, in the screen's
|
|
3492
|
+
// portrait-native space; screenshots are upright. Kept to
|
|
3493
|
+
// turn a frame for cropping one (see vpUprightFrame).
|
|
3494
|
+
vp.uiOrientation = j.uiOrientation || null;
|
|
3491
3495
|
vp.treeAt = Date.now();
|
|
3492
3496
|
describeWarmupPending = false;
|
|
3493
3497
|
// A right-click that landed before the tree was loaded waits
|
|
@@ -3632,6 +3636,27 @@
|
|
|
3632
3636
|
// into a chip. Letterboxed (no distortion). Falls back to the full,
|
|
3633
3637
|
// contained image when the element isn't matched on-screen or the agent
|
|
3634
3638
|
// supplied a data: URI (treated as author-made art, shown whole).
|
|
3639
|
+
// A frame of the preview's describe tree (the screen's portrait-native
|
|
3640
|
+
// space) in the UI's upright space, the space of screenshots. The same
|
|
3641
|
+
// map as the tool-server's nativeFrameToUi.
|
|
3642
|
+
function vpUprightFrame(f, orientation) {
|
|
3643
|
+
switch (orientation) {
|
|
3644
|
+
case "landscapeRight":
|
|
3645
|
+
return { x: f.y, y: 1 - f.x - f.width, width: f.height, height: f.width };
|
|
3646
|
+
case "landscapeLeft":
|
|
3647
|
+
return { x: 1 - f.y - f.height, y: f.x, width: f.height, height: f.width };
|
|
3648
|
+
case "portraitUpsideDown":
|
|
3649
|
+
return {
|
|
3650
|
+
x: 1 - f.x - f.width,
|
|
3651
|
+
y: 1 - f.y - f.height,
|
|
3652
|
+
width: f.width,
|
|
3653
|
+
height: f.height,
|
|
3654
|
+
};
|
|
3655
|
+
default:
|
|
3656
|
+
return { x: f.x, y: f.y, width: f.width, height: f.height };
|
|
3657
|
+
}
|
|
3658
|
+
}
|
|
3659
|
+
|
|
3635
3660
|
function applyThumbCrop(tw, frame) {
|
|
3636
3661
|
const im = tw.querySelector(".thumb-img");
|
|
3637
3662
|
if (!im || !im.naturalWidth || !im.naturalHeight) return;
|
|
@@ -5133,8 +5158,9 @@
|
|
|
5133
5158
|
};
|
|
5134
5159
|
}
|
|
5135
5160
|
if (p._node && !vp.thumbFrames[p.id]) {
|
|
5136
|
-
|
|
5137
|
-
|
|
5161
|
+
// The thumbnail crops a screenshot, which is upright, while the
|
|
5162
|
+
// tree's frame is in the stream's portrait-native space.
|
|
5163
|
+
vp.thumbFrames[p.id] = vpUprightFrame(p._node.frame, vp.uiOrientation);
|
|
5138
5164
|
}
|
|
5139
5165
|
}
|
|
5140
5166
|
layoutCards();
|
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
export interface ArgentToolArgs {
|
|
2
|
+
"audio-input": {
|
|
3
|
+
/** Target iOS Simulator UDID from `list-devices`. */
|
|
4
|
+
udid: string;
|
|
5
|
+
/** `file` plays `path`, `tone` a sine wave, `microphone` restores the real microphone. */
|
|
6
|
+
source: "file" | "tone" | "microphone";
|
|
7
|
+
/** Audio file, required for source=file. */
|
|
8
|
+
path?: string;
|
|
9
|
+
/** source=file only. Times the file plays. Default 1. */
|
|
10
|
+
plays?: number;
|
|
11
|
+
/** source=tone only. Default 1000. */
|
|
12
|
+
frequencyHz?: number;
|
|
13
|
+
/** source=tone only. Default 0.4. */
|
|
14
|
+
amplitude?: number;
|
|
15
|
+
/** App under test; the result then reports `appReady`. */
|
|
16
|
+
bundleId?: string;
|
|
17
|
+
};
|
|
2
18
|
"await-screen-idle": {
|
|
3
19
|
/** Target device id from `list-devices` (iOS UDID, Android serial, HarmonyOS id, Mac app id, or Chromium id). */
|
|
4
20
|
udid: string;
|
|
@@ -6,7 +22,7 @@ export interface ArgentToolArgs {
|
|
|
6
22
|
timeoutMs?: number;
|
|
7
23
|
/** How often to re-read the tree (default 200). */
|
|
8
24
|
pollIntervalMs?: number;
|
|
9
|
-
/** The screen must hold the same content for at least this long to count as settled (default 250). */
|
|
25
|
+
/** The screen must hold the same content for at least this long to count as settled (default 250); 0 settles on the first non-empty read. */
|
|
10
26
|
minStableMs?: number;
|
|
11
27
|
};
|
|
12
28
|
"await-ui-element": {
|
|
@@ -127,8 +143,6 @@ export interface ArgentToolArgs {
|
|
|
127
143
|
port?: number;
|
|
128
144
|
/** Device id from list-devices: the SAME id you passed to debugger-connect (iOS simulator UDID or Android serial). */
|
|
129
145
|
device_id: string;
|
|
130
|
-
/** iOS simulator UDID from list-devices. Pass it when device_id is a logicalDeviceId (two or more devices share one Metro), so that the tap coordinates of a landscape UI are on the screen's axes. Give the UDID of the simulator that shows the app. */
|
|
131
|
-
udid?: string;
|
|
132
146
|
/** When true, only components visible on screen are returned. Set to false to include all mounted components, including those scrolled off-screen, e.g. to understand the full page structure. */
|
|
133
147
|
onScreenOnly?: boolean;
|
|
134
148
|
/** Maximum total nodes to include. When exceeded, intermediate single-child wrapper chains are collapsed to preserve both root structure and leaf elements. Default: no limit. */
|
|
@@ -324,6 +338,8 @@ export interface ArgentToolArgs {
|
|
|
324
338
|
"gesture-custom": {
|
|
325
339
|
/** Target device id from `list-devices` (iOS UDID or Android serial). */
|
|
326
340
|
udid: string;
|
|
341
|
+
/** Starting edge in upright screen coordinates for a single-finger system gesture on a local iOS simulator. */
|
|
342
|
+
edge?: "top" | "right" | "bottom" | "left";
|
|
327
343
|
/** Touch events, dispatched in order. */
|
|
328
344
|
events: Array<{
|
|
329
345
|
/** Touch event type */
|
|
@@ -439,6 +455,8 @@ export interface ArgentToolArgs {
|
|
|
439
455
|
clickCount?: number;
|
|
440
456
|
/** Mouse button, Mac app only: "right" is a right-click, for example to open a context menu; any other device refuses it. Default "left". */
|
|
441
457
|
button?: "left" | "right";
|
|
458
|
+
/** Keys held throughout a click or multi-click gesture. Mac apps only. An empty list leaves the click unmodified. */
|
|
459
|
+
modifiers?: Array<"control" | "option" | "shift" | "command">;
|
|
442
460
|
};
|
|
443
461
|
keyboard: {
|
|
444
462
|
/** Target device id from `list-devices` (iOS UDID, Android serial, Vega serial, HarmonyOS id, Mac app id, or Chromium id). */
|
|
@@ -541,6 +559,18 @@ export interface ArgentToolArgs {
|
|
|
541
559
|
/** Target device id from `list-devices` (iOS UDID, Mac app id or Android serial). */
|
|
542
560
|
device_id: string;
|
|
543
561
|
};
|
|
562
|
+
"native-profiler-launch-analysis": {
|
|
563
|
+
/** measure: time five launches with XCTest. profile: record one Instruments App Launch trace. */
|
|
564
|
+
mode: "measure" | "profile";
|
|
565
|
+
/** Bundle ID of the Release build already installed on the device. The tool does not build or install the app. */
|
|
566
|
+
bundle_id: string;
|
|
567
|
+
/** Connected iPhone UDID; required for a physical-device run. With allow_simulator, a booted simulator UDID also works. */
|
|
568
|
+
device_id?: string;
|
|
569
|
+
/** Explicitly allow a booted simulator when no iPhone is selected. */
|
|
570
|
+
allow_simulator?: boolean;
|
|
571
|
+
/** profile mode only: App Launch trace recording length in seconds (default 8). Rejected in measure mode. */
|
|
572
|
+
duration_seconds?: number;
|
|
573
|
+
};
|
|
544
574
|
"native-profiler-start": {
|
|
545
575
|
/** Target device id from `list-devices` (iOS UDID, Mac app id or Android serial). */
|
|
546
576
|
device_id: string;
|
|
@@ -560,7 +590,7 @@ export interface ArgentToolArgs {
|
|
|
560
590
|
udid: string;
|
|
561
591
|
/** Bundle ID of the app (on a Mac app, the bundle id in the device id) */
|
|
562
592
|
bundleId: string;
|
|
563
|
-
/** Raw X coordinate in points, on the
|
|
593
|
+
/** Raw X coordinate in points, on the axes of the UI as the user sees it (the axes of screenshots and describe frames); on a Mac app, points from the top-left of the area describe reports. NOT normalized [0,1] tap space. */
|
|
564
594
|
x: number;
|
|
565
595
|
/** Raw Y coordinate in points, on the same axes as x. NOT normalized [0,1] tap space. */
|
|
566
596
|
y: number;
|
|
@@ -582,7 +612,7 @@ export interface ArgentToolArgs {
|
|
|
582
612
|
udid: string;
|
|
583
613
|
/** Bundle ID of the app (on a Mac app, the bundle id in the device id) */
|
|
584
614
|
bundleId: string;
|
|
585
|
-
/** Raw X coordinate in points, on the
|
|
615
|
+
/** Raw X coordinate in points, on the axes of the UI as the user sees it (the axes of screenshots and describe frames); on a Mac app, points from the top-left of the area describe reports. NOT normalized [0,1] tap space. */
|
|
586
616
|
x: number;
|
|
587
617
|
/** Raw Y coordinate in points, on the same axes as x. NOT normalized [0,1] tap space. */
|
|
588
618
|
y: number;
|
|
@@ -601,6 +631,22 @@ export interface ArgentToolArgs {
|
|
|
601
631
|
/** true returns the view that would receive a touch at the point: it respects userInteractionEnabled, close to UIKit hit-testing. Default false: the deepest visible view. */
|
|
602
632
|
hitTest?: boolean;
|
|
603
633
|
};
|
|
634
|
+
"network-conditions": {
|
|
635
|
+
/** Target device id from `list-devices`: an iOS simulator UDID, an Android emulator serial, or a Chromium id. */
|
|
636
|
+
udid: string;
|
|
637
|
+
/** iOS only, and required there: the bundle id of the app to throttle. */
|
|
638
|
+
bundleId?: string;
|
|
639
|
+
/** iOS only: the Metro port the throttle leaves alone. Omit it to use this device's port (8081 by default). */
|
|
640
|
+
port?: number;
|
|
641
|
+
/** Minimum time in milliseconds from sending a request to its response. iOS and Chromium only. */
|
|
642
|
+
latencyMs?: number;
|
|
643
|
+
/** Download limit in kilobits per second. iOS and Chromium only. */
|
|
644
|
+
downloadKbps?: number;
|
|
645
|
+
/** Upload limit in kilobits per second. iOS and Chromium only. */
|
|
646
|
+
uploadKbps?: number;
|
|
647
|
+
/** Make requests fail as if the network were down. On Android, ports forwarded with adb reverse stay reachable. */
|
|
648
|
+
offline?: boolean;
|
|
649
|
+
};
|
|
604
650
|
"open-url": {
|
|
605
651
|
/** Target device id from `list-devices` (iOS UDID, Android serial, HarmonyOS id, or Chromium id). */
|
|
606
652
|
udid: string;
|
|
@@ -638,7 +684,7 @@ export interface ArgentToolArgs {
|
|
|
638
684
|
end: number;
|
|
639
685
|
};
|
|
640
686
|
/** Commit index */
|
|
641
|
-
commit_index?: number;
|
|
687
|
+
commit_index?: number | null;
|
|
642
688
|
/** Max results to return. Defaults to 20 for by_component / by_time_range, which count commits, and render_counts, which counts components. by_index counts individual fibers and returns all of them unless this is set; a small cap there can show less than the analyze report it is meant to expand on. */
|
|
643
689
|
top_n?: number;
|
|
644
690
|
};
|
|
@@ -680,12 +726,12 @@ export interface ArgentToolArgs {
|
|
|
680
726
|
app_process?: string;
|
|
681
727
|
};
|
|
682
728
|
"profiler-stack-query": {
|
|
683
|
-
/** Target device id from `list-devices` (iOS
|
|
729
|
+
/** Target device id from `list-devices` (iOS UDID, Mac app id or Android serial). */
|
|
684
730
|
device_id: string;
|
|
685
731
|
/** Query mode; see Modes in the tool description. */
|
|
686
732
|
mode: "hang_stacks" | "function_callers" | "thread_breakdown" | "leak_stacks";
|
|
687
733
|
/** 0-based index into the hang list */
|
|
688
|
-
hang_index?: number;
|
|
734
|
+
hang_index?: number | null;
|
|
689
735
|
/** Native function name */
|
|
690
736
|
function_name?: string;
|
|
691
737
|
/** Thread filter. thread_breakdown: case-insensitive substring match. function_callers: exact raw thread name (e.g. ".blueskyweb.app"), or "main" for the UI thread; omit to search ALL threads (each result is tagged with its thread). Run thread_breakdown first to see the exact raw names. */
|
|
@@ -843,7 +889,7 @@ export interface ArgentToolArgs {
|
|
|
843
889
|
}>;
|
|
844
890
|
};
|
|
845
891
|
"screen-recording-start": {
|
|
846
|
-
/** Target device id from `list-devices` (iOS Simulator UDID or Android serial). */
|
|
892
|
+
/** Target device id from `list-devices` (iOS Simulator UDID, cabled iPhone UDID, or Android serial). */
|
|
847
893
|
udid: string;
|
|
848
894
|
/** Auto-stop cap in seconds (default 180). Set it to slightly more than the interaction you plan to capture. */
|
|
849
895
|
timeLimitSeconds?: number;
|
|
@@ -853,13 +899,13 @@ export interface ArgentToolArgs {
|
|
|
853
899
|
showTouches?: boolean;
|
|
854
900
|
};
|
|
855
901
|
"screen-recording-stop": {
|
|
856
|
-
/** Target device id from `list-devices` (iOS Simulator UDID or Android serial). */
|
|
902
|
+
/** Target device id from `list-devices` (iOS Simulator UDID, cabled iPhone UDID, or Android serial). */
|
|
857
903
|
udid: string;
|
|
858
904
|
};
|
|
859
905
|
screenshot: {
|
|
860
906
|
/** Target device id from `list-devices` (iOS UDID, Android serial, Apple TV UDID, Vega serial, HarmonyOS id, Mac app id, or Chromium id). */
|
|
861
907
|
udid: string;
|
|
862
|
-
/** Orientation override for the screenshot (on Chromium it rotates the captured image).
|
|
908
|
+
/** Orientation override for the screenshot (on Chromium it rotates the captured image). Rarely needed: on Android and iOS simulators the capture already follows the UI's orientation, the space describe frames and gesture coordinates use, and an override can make the image disagree with them. Rejected on HarmonyOS, which captures the display in its current orientation and has no override. Ignored on physical iPhones. */
|
|
863
909
|
rotation?: "Portrait" | "LandscapeLeft" | "LandscapeRight" | "PortraitUpsideDown";
|
|
864
910
|
/** Scale factor. Defaults to ARGENT_SCREENSHOT_SCALE env var, or 0.25 if unset for iOS/Android/HarmonyOS. On a local Apple TV simulator, an Android TV or Vega, with neither set, the capture is downscaled to a 576 px long side (0.15 of a 4K capture). On Chromium the default is 1.0 (no downscale); pass <1 to opt in. Downscaling on Chromium requires the optional `sharp` dependency. On a Mac app the default is one pixel per window point, downscaled to a 768 px long side for a larger window. */
|
|
865
911
|
scale?: number;
|
|
@@ -940,7 +986,7 @@ export interface ArgentToolArgs {
|
|
|
940
986
|
/** Device id from list-devices (iOS simulator UDID or Android serial), the same id used with debugger-connect. */
|
|
941
987
|
device_id: string;
|
|
942
988
|
/** Page index (0-based) or "latest" for the most recent page. Each page contains up to 50 entries. */
|
|
943
|
-
pageIndex?: number | "latest";
|
|
989
|
+
pageIndex?: number | "latest" | null;
|
|
944
990
|
};
|
|
945
991
|
"view-network-request-details": {
|
|
946
992
|
/** Metro port. Omit it to use this device's port (8081 by default). Ignored for Chromium, whose CDP port is in device_id. */
|