@swmansion/argent 0.30.2-next.9 → 0.31.1-next.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/bin/darwin/simulator-server +0 -0
- package/bin/linux/simulator-server +0 -0
- package/bin/linux-arm64/simulator-server +0 -0
- package/bin/win32/simulator-server.exe +0 -0
- package/dist/cli-cmds.mjs +25 -8
- package/dist/client.js +22 -5
- package/dist/installer.mjs +2 -1
- package/dist/mcp-server.mjs +83 -22
- package/dist/tool-args.generated.d.ts +2 -0
- package/dist/tool-server.cjs +521 -139
- package/package.json +1 -1
- package/skills/argent-device-interact/references/harmonyos.md +43 -0
- package/skills/argent-native-profiler/SKILL.md +1 -0
- package/skills/argent-react-native-profiler/SKILL.md +2 -0
package/package.json
CHANGED
|
@@ -66,6 +66,49 @@ Only `enter` (alias `return`), `backspace` (alias `delete`), `space`, `arrow-lef
|
|
|
66
66
|
- `reinstall-app` takes one `.hap` file as `appPath` and the bundle name from its `module.json` as `bundleId`; a mismatch is refused before anything is uninstalled. A multi-module `.app` bundle is not accepted.
|
|
67
67
|
- `open-url` resolves any scheme through `aa start -U`, and every result carries a `note`: `aa` reports success whenever the system accepts the URI. A web URL can leave the screen unchanged, and `tel:` / `mailto:` can leave a "No options to open with" dialog over it. Confirm with `describe` or `screenshot` before treating the link as followed. It fails whenever `aa` refuses the URI, as it does a scheme nothing claims.
|
|
68
68
|
|
|
69
|
+
## Building and signing a HAP
|
|
70
|
+
|
|
71
|
+
Both blocks below use the default macOS install, the only layout verified; elsewhere point `C` and the Java path at the matching DevEco Studio directories. The build assumes the module `entry` and the product `default`, which the output path depends on. Build from the project root without the IDE:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
C=/Applications/DevEco-Studio.app/Contents
|
|
75
|
+
export DEVECO_SDK_HOME=$C/sdk PATH=$C/tools/node/bin:$C/tools/ohpm/bin:$C/jbr/Contents/Home/bin:$PATH
|
|
76
|
+
ohpm install --all
|
|
77
|
+
rm -rf entry/build/default/outputs
|
|
78
|
+
node $C/tools/hvigor/bin/hvigorw.js --mode module -p module=entry@default -p product=default -p buildMode=debug assembleHap --no-daemon
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
With no `signingConfigs` in `build-profile.json5` this writes `entry/build/default/outputs/default/entry-default-unsigned.hap`. A `signingConfigs` naming key files this machine lacks (DevEco writes absolute paths under its author's `~/.ohos/config`) fails the build at `SignHap`, e.g. `Invalid storeFile value`, after that HAP is written; sign it below. Any other failed build leaves no HAP.
|
|
82
|
+
|
|
83
|
+
The emulator installs any HAP, including an unsigned one or one whose signature fails verification, so an emulator install proves nothing about signing. A phone refuses an unsigned HAP (`9568320 error: no signature file`). Sign it with a debug profile for the app's bundle name that lists the phone's UDID (`hdc -t <connectKey> shell bm get --udid`, last line; `hdc` is in `$C/sdk/default/openharmony/toolchains`). `L` below is `$C/sdk/default/openharmony/toolchains/lib`, set in the signing block.
|
|
84
|
+
|
|
85
|
+
**Test keys, no account.** `$L/OpenHarmony.p12` (password `123456`) is OpenHarmony's public test PKI; use it for development only. A HAP signed this way installs and launches on a HarmonyOS 6.0 phone.
|
|
86
|
+
|
|
87
|
+
1. Certificate chain `app-chain.cer`, leaf first: the `bundle-info.development-certificate` from `$L/UnsgnedDebugProfileTemplate.json`, then the `OpenHarmony Application CA` and `OpenHarmony Application Root CA` certificates from `$L/OpenHarmonyProfileDebug.pem`.
|
|
88
|
+
2. Profile `profile.json`: a copy of the template with your `bundle-info.bundle-name`, the phone's UDID in `debug-info.device-ids`, and a current `validity` window in epoch seconds (the template's expired in January 2024).
|
|
89
|
+
3. Sign the profile, then the HAP, from the project root with DevEco's Java:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
C=/Applications/DevEco-Studio.app/Contents L=$C/sdk/default/openharmony/toolchains/lib
|
|
93
|
+
export PATH=$C/jbr/Contents/Home/bin:$PATH
|
|
94
|
+
rm -f app-signed.hap
|
|
95
|
+
java -jar $L/hap-sign-tool.jar sign-profile -mode localSign -signAlg SHA256withECDSA \
|
|
96
|
+
-keystoreFile $L/OpenHarmony.p12 -keystorePwd 123456 -keyPwd 123456 \
|
|
97
|
+
-keyAlias "openharmony application profile debug" -profileCertFile $L/OpenHarmonyProfileDebug.pem \
|
|
98
|
+
-inFile profile.json -outFile profile.p7b &&
|
|
99
|
+
java -jar $L/hap-sign-tool.jar sign-app -mode localSign -signAlg SHA256withECDSA -signCode 1 \
|
|
100
|
+
-keystoreFile $L/OpenHarmony.p12 -keystorePwd 123456 -keyPwd 123456 \
|
|
101
|
+
-keyAlias "openharmony application release" -appCertFile app-chain.cer -profileFile profile.p7b \
|
|
102
|
+
-inFile entry/build/default/outputs/default/entry-default-unsigned.hap -outFile app-signed.hap
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
**Real keys, Huawei ID.** These need the user's Huawei account; ask before using it.
|
|
106
|
+
|
|
107
|
+
- DevEco Studio: sign in, connect the phone, and tick _Automatically generate signature_ under File > Project Structure > Project > Signing Configs. Tick _Support HarmonyOS_ too if it is offered; without it the signature is an OpenHarmony one. It writes `signingConfigs` into `build-profile.json5`, and the build above then emits `entry-default-signed.hap`.
|
|
108
|
+
- AppGallery Connect: create a `.p12` and CSR (DevEco: Build > Generate Key and CSR), then request a debug certificate (`.cer`) from the CSR, register the phone's UDID and the app, and request a debug profile (`.p7b`) for that app, that certificate and the device. Run the signing block without `sign-profile`, giving `sign-app` your `.p12`, key alias, passwords, `.cer` and `.p7b`; AppGallery Connect has already signed the profile.
|
|
109
|
+
|
|
110
|
+
In the signing block's shell, `java -jar $L/hap-sign-tool.jar verify-app -inFile <hap> -outCertChain c.cer -outProfile p.p7b` checks the signature on the host, but not that the profile's bundle name matches the HAP's. A phone refuses that mismatch with `9568329 verify signature failed`, so only an install proves the phone accepts a HAP. Install it with `reinstall-app` (`appPath` the HAP's absolute path, `bundleId` its bundle name), then `launch-app` it. `reinstall-app` uninstalls first, so a HAP the phone refuses also costs the installed copy and its data; to keep them, install with `hdc -t <connectKey> install <hap>` instead, which leaves the installed copy on a refusal.
|
|
111
|
+
|
|
69
112
|
## E2E tests
|
|
70
113
|
|
|
71
114
|
The e2e runner (`e2e-execute`, skill `argent-create-e2e`) runs on HarmonyOS only when you name the device: `device: "harmony-<connectKey>"` (`--device` on the CLI). A HarmonyOS device is never auto-resolved, and `platform` / `--platform` does not accept `harmony`. HarmonyOS is not an authorable platform either: `when: { platform: harmony }` and a `harmony:` launch-map key are rejected when the YAML is parsed, so launch with a bare app id or `native:`.
|
|
@@ -57,6 +57,7 @@ You do not need to derive `app_process` manually; just make sure the app is laun
|
|
|
57
57
|
|
|
58
58
|
Call `native-profiler-start` with `device_id` (iOS UDID or Android serial). The tool auto-detects the running app and saves the trace to `/tmp/argent-profiler-cwd/` with a timestamped filename.
|
|
59
59
|
Let the user interact with the app or drive interaction via simulator tools (see `argent-device-interact` skill).
|
|
60
|
+
While a profiler records, interaction tools return no automatic screenshot or element tree, so the capture does not load the app. Call `screenshot` or `describe` when you need to see the screen; interaction tools still wait for the screen to settle before they return, so add no wait of your own; on an Android emulator each screenshot during a profile takes one frame in about 100 ms and does not wake the screen capture; on a physical Android device it takes about 150–200 ms and briefly wakes the device screen capture, so take them sparingly there.
|
|
60
61
|
|
|
61
62
|
### Step 2: Stop and export
|
|
62
63
|
|
|
@@ -88,6 +88,8 @@ Mind the react-native and ios-native profiler selection mentioned above when sta
|
|
|
88
88
|
- if session is marked as "stale", you may overtake it without prompting the user for allowance
|
|
89
89
|
- if session is NOT "stale" - before taking action and terminating the other session, **stop and ask user what you should do**, explaining the situation.
|
|
90
90
|
|
|
91
|
+
While a profiler records, interaction tools return no automatic screenshot or element tree, so the capture does not load the app. Call `screenshot` or `describe` when you need to see the screen; interaction tools still wait for the screen to settle before they return, so add no wait of your own; on an Android emulator each screenshot during a profile takes one frame in about 100 ms and does not wake the screen capture; on a physical Android device it takes about 150–200 ms and briefly wakes the device screen capture, so take them sparingly there.
|
|
92
|
+
|
|
91
93
|
#### Annotate every interaction
|
|
92
94
|
|
|
93
95
|
After each `gesture-tap` or `gesture-swipe` call, record an annotation using the returned `timestampMs`. Compute `offsetMs = timestampMs - startedAtEpochMs`. Do this for _every_ interaction, including back-navigation swipes, not just the primary action. Pass all collected annotations to `react-profiler-analyze` in Step 3.
|