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
scripts/ ← shared helpers, including validate-mobile-files.js for skill-owned changed-file validation
29
+
scripts/ ← shared helpers: validate-mobile-files.js for skill-owned changed-file validation, metro-session.js for cross-host Metro session ownership/logging
30
30
hooks/ ← Validator implementations invoked explicitly by mobile workflows
31
31
```
32
32
@@ -73,6 +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 wrapper heartbeat proves ownership.
76
77
77
78
## Decisions made
78
79
@@ -83,6 +84,7 @@ Do not add preparation rewrites for `scheme`, `package`, `bundleIdentifier`, `sr
83
84
- ✅ Connection model: per-environment connections, with platform-specific auth (`expo-msal-intune` on native, `expo-auth-session` on web)
84
85
- ✅ Auth: `/create-mobile-app` resolves the tenant from the selected Power Platform environment (`scripts/resolve-environment.js`), writes that tenant to `auth.config.json`, then lets the user paste an app registration client ID, create one from the Power Apps Wrap page and paste it, or skip auth for later. `/set-app-registration-native` is a manual helper for the same Wrap-page + pasted-client-ID flow.
- ✅ Template is supplied as a fresh `pa-wrap-tools/templates/expo-app-standalone` folder before `/create-mobile-app` runs; users materialize it with `degit`, run `npm install`, then invoke the skill from that folder. The skill validates/prepares the folder and runs `npx power-apps init`.
87
89
- ✅ `brand/` directory convention: `/design-system` (Step 6.75) writes `brand/design-system.md` (spec), `brand/tokens.ts` (importable Tamagui tokens), and `brand/design-system.html` (visual gallery). Screen-builders MUST read `brand/design-system.md` if present; `## Negatives` = HARD RULES. `/create-mobile-app` Step 9b imports `brand/tokens.ts` via `skills/design-system/references/tamagui-integration.md`. Projects without `brand/` fall back to `## Design Direction` only — no breakage.
88
90
- ✅ Offline profile creation is **author-only in v0.1** — `/setup-offline-profile` and `/enable-tables-offline` POST `mobileofflineprofile` / `mobileofflineprofileitem` / `mobileofflineprofileitemassociation` to Dataverse and write `offline-profile.json` to the project, but do NOT scaffold offline runtime code (SQLite store, sync engine, write queue) into the generated app. Runtime support is gated on upstream `@microsoft/power-apps-native-host` confirmation.
@@ -106,7 +118,7 @@ After the prereq sanity check passes:
106
118
> /create-mobile-app build me a small notes app
107
119
```
108
120
109
-
Expected: ~6 prompts (wizard + gates), then~5 minutes of scaffolding, table creation, and parallel screen builds. End state: a working Notes app with `npm run dev`ready to go. If anything fails, the [memory bank](#glossary) remembers where you left off — re-run the same command and it resumes.
121
+
Expected: ~6 prompts (wizard + gates), then~5 minutes of scaffolding, table creation, and parallel screen builds. End state: a working Notes app with a project-local Metro session ready to scan and debug. If anything fails, the [memory bank](#glossary) remembers where you left off — re-run the same command and it resumes.
110
122
111
123
## Quick examples
112
124
@@ -125,7 +137,7 @@ What happens:
125
137
4. **4 approval gates** — data model → native capabilities → connectors → screens (with a visual `_plan_preview.html` of every screen before any code is written)
6. **Scaffold + build** — validates the prepared template folder, runs `npx power-apps init`, verifies installed dependencies, generates schemas, builds Dataverse tables, wires connectors, spawns N parallel screen-builders for the TSX
128
-
7. **Dev server** — `npm run dev`starts Metro; scan the QR with your native dev client on a device
140
+
7. **Dev server** — the plugin starts a portable Metro session; scan the QR with your native dev client and use `/debug-app` against its persisted sanitized log
129
141
130
142
End state: a working app you can iterate on with hot reload. ~5–12 minutes for the planning gates, then scaffolding runs.
131
143
@@ -213,6 +225,7 @@ Example edit flows:
213
225
|`/add-native`| ✅ v0 | Add a supported native capability/control (camera, image-picker, barcode/QR scanner, document-picker, PDF viewer/report, pen/signature, secure-store, file-system, sharing, etc.) — verifies the module already ships in the template and writes typed wrappers under `src/native/` without installing native packages or editing `app.config.js`|
214
226
|`/list-connections`| ✅ v0 | Finds or creates a Power Platform connection ID, or resolves a solution connection reference, for`npx power-apps add-data-source`. Use when adding non-Dataverse connectors or re-binding after a 401. |
215
227
|`/edit-app`| ✅ v0 | Post-generation app editor — updates affected sections of `native-app-plan.md`, applies Dataverse/native/design/connector changes, rebuilds affected screens, runs verification, updates `memory-bank.md`, and regenerates `preview.html` when UI changed. `--plan-only` preserves the old docs-only behavior. |
228
+
|`/debug-app`| ✅ v0 | Monitors the wrapper-owned `.expo/metro-session/metro.log` with a durable byte cursor, diagnoses runtime and silent data-path failures, applies bounded fixes, and verifies against newly appended output without depending on host terminal IDs. |
216
229
|`/deploy`| ✅ v0 | Build + push — `npm run build`then`npx power-apps push` to the env in`power.config.json`. **Does not** drive `expo run:ios` or `expo run:android` (out of scope for v0). |
217
230
|`/open-wrap-url`| ✅ v0 | Opens the Wrap URL in browser for an app ID using `https://make.powerapps.com/environments/<envID>/wrap?appID=<appID>`. Requires both `--app-id` and `--env-id`. |
0 commit comments