agentic-mobile-kit 0.7.15 → 0.7.16

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentic-mobile-kit",
3
- "version": "0.7.15",
3
+ "version": "0.7.16",
4
4
  "description": "One setup for AI-assisted development of React Native apps, bare or Expo: shared rules and workflows for Claude Code, Codex and Antigravity, git hooks, device checks with screenshots, and release tooling for the App Store and Google Play.",
5
5
  "license": "MIT",
6
6
  "author": "prakashpro1",
@@ -12,6 +12,7 @@
12
12
  # plan how many devices this machine's memory can check at the same time, and the commands to run:
13
13
  # one per device, in rounds when they don't all fit, the flows split into parts when there's room
14
14
  # --spec <id> run .maestro/<id>*.yaml and save evidence in .amk/evidence/<id>/
15
+ # --flow <file> run only this flow: a path in the project, or anywhere (an absolute path)
15
16
  # --label <n> evidence folder name (default: the spec id, or no-spec)
16
17
  # --flavor <name> Android product flavor to check (default: the first one in build.gradle)
17
18
  # --scheme <name> iOS scheme to check (default: the one named like the workspace)
@@ -76,6 +77,10 @@ if [ -n "$part" ]; then
76
77
  fi
77
78
 
78
79
  root=$(pwd)
80
+ # --flow: a path in the project, or an absolute one (C:/… on Windows too); a Windows path's backslashes become slashes
81
+ case $flow in *\\*) flow=$(printf '%s' "$flow" | tr '\\' /) ;; esac
82
+ case $flow in "" | /* | [A-Za-z]:/*) ;; *) flow=$root/$flow ;; esac
83
+ [ -z "$flow" ] || [ -f "$flow" ] || { echo "verify: no flow file $flow"; exit 2; }
79
84
  . scripts/amk/maestro-env.sh
80
85
  # runs without a spec or a label (verify.sh quick, mostly) share one folder, so they don't push out a feature's
81
86
  evidence="$root/.amk/evidence/${label:-${spec:-no-spec}}"
@@ -97,7 +102,7 @@ status=0
97
102
 
98
103
  flow_files() {
99
104
  {
100
- if [ -n "$flow" ]; then echo "$root/$flow"
105
+ if [ -n "$flow" ]; then echo "$flow"
101
106
  elif [ -n "$spec" ]; then find "$root/.maestro" -maxdepth 1 -iname "$spec*.yaml" 2>/dev/null | sort
102
107
  else find "$root/.maestro" -maxdepth 1 -name '*.yaml' 2>/dev/null | sort
103
108
  fi
@@ -182,13 +187,27 @@ run_flow() { # screen device app_id file name orientation
182
187
  # pressing the last button of the app's own alerts too, such as a Delete. Maestro never answers an app's alerts.
183
188
  # So one that says to leave permissions alone comes first, where it never runs (on Android only)
184
189
  on_complete="" turn=""
190
+ # what's beside the flow, and below it in the project (its subflows): only beside it, for a flow outside the
191
+ # project, whose folder may hold anything
192
+ case $4 in "$root"/*) depth="" ;; *) depth="-maxdepth 1" ;; esac
193
+ # a flow that turns airplane mode on and fails before turning it off leaves the device offline, and an offline
194
+ # device doesn't open a development-signed app: every later flow would fail as if the team weren't trusted.
195
+ # maestro-runner runs this one's onFlowComplete, not the flow's own. It looks for the switch on Settings' main page,
196
+ # but Settings opens on the page it was last left on: restarted, it opens on its main page (for the flow's own
197
+ # setAirplaneMode too). Optional, so a flow that passed never fails here. A few seconds, so only where flows use it
198
+ if find "$(dirname "$4")" $depth \( -path "$root/.amk" -o -name node_modules \) -prune -o \( -name '*.yaml' -o -name '*.yml' \) \
199
+ -exec grep -qs setAirplaneMode {} \; -print | grep -q .; then
200
+ xcrun devicectl device process launch --device "$2" --terminate-existing com.apple.Preferences > /dev/null 2>&1 || true
201
+ on_complete=' - setAirplaneMode:\n value: disabled\n optional: true\n'
202
+ fi
185
203
  if [ "$6" != PORTRAIT ]; then
186
204
  # WebDriverAgent turns the device, then fails the step unless the app in front turned too: here the home
187
205
  # screen, which most iPhones never turn. Whether the app turned shows in its screenshots. It knows
188
206
  # LANDSCAPE_LEFT only as "landscape"
189
- on_complete='onFlowComplete:\n - setOrientation:\n orientation: PORTRAIT\n optional: true\n'
207
+ on_complete="$on_complete"' - setOrientation:\n orientation: PORTRAIT\n optional: true\n'
190
208
  turn='- setOrientation:\n orientation: landscape\n optional: true\n'
191
209
  fi
210
+ [ -z "$on_complete" ] || on_complete="onFlowComplete:\n$on_complete"
192
211
  printf "appId: %s\n${on_complete}---\n- runFlow:\n when:\n platform: Android\n commands:\n - launchApp:\n permissions:\n all: unset\n${turn}- runFlow: '%s'\n" "$3" "$native" > "$debug/screen.yaml"
193
212
  target=$debug/screen.yaml
194
213
  elif [ "$6" != PORTRAIT ]; then
@@ -200,7 +219,7 @@ run_flow() { # screen device app_id file name orientation
200
219
  if is_real "$2"; then
201
220
  # it also saves each named screenshot next to its flow file: the ones it makes there move to its log folder, so
202
221
  # the project stays as it was (they're in its report too)
203
- pngs() { find "$(dirname "$4")" \( -path "$root/.amk" -o -name node_modules \) -prune -o -name '*.png' -print | sort; }
222
+ pngs() { find "$(dirname "$4")" $depth \( -path "$root/.amk" -o -name node_modules \) -prune -o -name '*.png' -print | sort; }
204
223
  pngs "$@" > "$debug/.pngs"
205
224
  # with the app's build: on a real device, clearState installs the app again
206
225
  MAESTRO_RUNNER_NO_TELEMETRY=1 DO_NOT_TRACK=1 npx -y "$runner" --platform ios --driver wda --device "$2" \
@@ -568,7 +587,7 @@ launch_check() {
568
587
  tries=$((tries + 1))
569
588
  case $said in
570
589
  *'explicitly trusted'*) [ "$tries" -lt 3 ] || {
571
- echo "ios: $1 doesn't open apps from this team yet: on it, Settings > General > VPN & Device Management > Developer App > Trust, then run this again"
590
+ echo "ios: $1 doesn't open apps from this team: on it, trust the team (Settings > General > VPN & Device Management > Developer App > Trust), and turn airplane mode off (offline, it doesn't open apps signed for development). Then run this again"
572
591
  return 1; } ;;
573
592
  *) echo "ios: the app didn't open on $1 (is it unlocked?), see ${log#"$root"/}"; return 1 ;;
574
593
  esac
@@ -1,6 +1,10 @@
1
1
  # Copy to .maestro/<id>.yaml. verify.sh runs it on iOS and Android and keeps the screenshots as evidence.
2
2
  # Tap by testID (give every interactive element one); tapping by text can hit a label instead of the control.
3
3
  # Test logins: ${MAESTRO_EMAIL}, ${MAESTRO_PASSWORD} and the like, set in .maestro/.env.local, which isn't committed.
4
+ # On a real iPhone (maestro-runner): text with an apostrophe can't be searched for (use a testID), and permission
5
+ # prompts aren't answered for the flow (tapOn: { text: "Allow", optional: true }). setAirplaneMode works only on an
6
+ # iPhone in English (it looks for "Airplane Mode" in Settings) and leaves Settings in front: launchApp: { stopApp: false }
7
+ # brings the app back. verify.sh opens Settings on its main page before such a flow, and turns airplane mode off after.
4
8
  appId: ${APP_ID} # set by verify.sh
5
9
  ---
6
10
  - launchApp: