You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Browse filesBrowse the repository at this point in the historyBrowse files
Shubham Agarwal
committed
refactor(mobile-app): wire dev through Metro capture path
Manual `npm run dev` previously bypassed the wrapper. That made the PR
unreliable: a user could start raw Expo on 8081, then /debug-app would
see no state and start a second wrapped Metro on 8082, watching the wrong
log while the actual app continued to emit errors elsewhere.
/create-mobile-app now installs a project-local copy of metro-session.js
and patches the created app's package.json so `npm run dev` uses wrapper
foreground mode. The agent path still uses `start`, which runs detached
so the skill can return after QR generation. `dev:expo` remains as the
explicit raw Expo escape hatch for humans who want terminal-native Expo
behavior and do not need debug log capture.
The wrapper now has a `dev` command that runs foreground Metro through
the same state/log pipeline as detached `start`, mirrors sanitized output
back to the terminal, and preserves the same status/tail behavior for
/debug-app. A regression test starts foreground dev, waits for wrapper
state, verifies tail can read the captured log, then stops the session.
This also trims the redaction implementation. Instead of a structured
JSON/escaped-string parser, persisted logs now use a blunt line-level
scrubber for auth/secrets/token/key/signed-query patterns. It over-redacts
some diagnostics, but it is far smaller and fails safe: sensitive lines
are dropped before hitting disk or model context.
Docs and skill guidance now point actual app runs at `npm run dev`, with
`dev:expo` documented only as the no-capture escape hatch.
Validation: 49 mobile script tests pass; all repository validators pass.
Copy file name to clipboardExpand all lines: plugins/mobile-apps/AGENTS.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -73,7 +73,7 @@ Do not add preparation rewrites for `scheme`, `package`, `bundleIdentifier`, `sr
73
73
-`DONE_WITH_CONCERNS` requires at least one concern. If none, use `DONE`.
74
74
- Special early-return signals (`INDUSTRY_CONFIRM_REQUESTED:`, `DESIGN_VIBE_REQUESTED:`) pre-date this protocol and remain in effect — they are special-cased "ask the user one question and re-spawn me" handoffs, not terminal returns.
75
75
- The canonical orchestrator handler lives in [`skills/create-mobile-app/SKILL.md`](./skills/create-mobile-app/SKILL.md) Step 3.0. Future skills that spawn agents should reference it rather than duplicating the switch.
76
-
11.**Metro lifecycle is project-local** — `/create-mobile-app`starts Metro through `scripts/metro-session.js`; `/debug-app` reads `.expo/metro-session/state.json` and the sanitized `metro.log` with a persisted byte cursor. Do not restore required `BashOutput`/terminal-ID behavior. Host terminal APIs may be optional conveniences only. Never write unsanitized Metro output to disk, and never signal a recorded PID unless the port probe proves the process is still ours.
76
+
11.**Metro lifecycle is project-local** — `/create-mobile-app`installs `scripts/metro-session.js` into the generated app and wires `npm run dev` through it; `/debug-app` reads `.expo/metro-session/state.json` and the sanitized `metro.log` with a persisted byte cursor. Do not restore required `BashOutput`/terminal-ID behavior. Host terminal APIs may be optional conveniences only. Never write unsanitized Metro output to disk, and never signal a recorded PID unless the port probe proves the process is still ours.
0 commit comments