Give the Expert a platform tool to move the onboarding phase
- Dominant language
- JavaScript
- Stars
- 400
- Forks
- 89
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 149
Description
Part of #8364.
The frontend tracks the onboarding phase in `frontend/src/stores/ux.js` (`onboardingStage`: `intake` to `building` to `done`), but nothing lets the Expert move it. `startOnboardingBuild()` (the `building` transition) has no caller, and there is no way back to `intake` at all.
Add a frontend `ui_` tool (like `ui_navigate`) that sets the onboarding phase to a target value. It lives at `frontend/src/mcp/tools/onboarding.ts` (modeled on `frontend/src/mcp/tools/navigation.ts`), registered in `frontend/src/mcp/tools/index.ts`; its handler runs in the user's Expert browser tab and calls the `ux.js` store, so the UI reacts. No new dispatch plumbing is needed: `AutomationsService.dispatch` already routes any registered tool. Mark the tool `audience: expert` so the caller-filtering work (FlowFuse/engineering#315) keeps it from `mcp` callers.
The tool takes a `phase` argument (`intake` | `building` | `done`) and maps it:
* `building` to `startOnboardingBuild()`
* `done` to `endOnboarding()`
* `intake` to a new `resumeOnboardingIntake()` action that sets `intake`, re-raises the navigation intent so the UI returns to the onboarding page, leaves `isNewlyCreatedUser` untouched, and preserves the already-provisioned instance.
The Expert calls this tool the same way it calls `ui_navigate`: to reach `building` on entering the editor, back to `intake` when the user wants to add more before building, and `done` at handover.
### Done when
* A frontend `audience: expert` `ui_` tool sets the onboarding phase; the FlowFuse/engineering#315 filter keeps it from `mcp` callers.
* `phase: building` and `phase: done` drive `startOnboardingBuild()` and `endOnboarding()`, and the UI follows.
* `phase: intake` moves a user in `building` back to the onboarding page via a new `resumeOnboardingIntake()` action, without restarting onboarding and without tearing down the provisioned instance.
* The Expert calls the tool at all three transitions.
### Worth knowing
Depends on FlowFuse/engineering#315 for the `audience` marker. It runs in the user's Expert tab like `ui_navigate`, reached over that tab's own session; there is no tab pinning (pinning is a third-party concept the Expert does not use, which is why the browser-session tools are hidden from it). The skip path stays as-is (`endOnboarding()` called directly).
Contributor guide
Assessment
This issue has not been assessed yet.