--- name: openmotion-onboarding description: Guide cloud MCP login, open the template library, and show the welcome and three curated template preview cards; accept current-chat MCP activation separately. --- # OpenMotion onboarding Follow the [shared cloud connection & onboarding contract](../../docs/install.md#installation-success-reply). If OAuth login is still required on a host with a built-in browser, prefer opening `authorizationUrl` in that built-in browser—via host OAuth RPC or `codex mcp login --no-browser openmotion` with stdin kept open so it suppresses the default system browser launch—(falling back to the system browser if unavailable or blocked) so editor tabs inherit the same session; keep built-in vs. system browser session isolation silent unless the user asks or encounters a sign-in/workspace gate. Open the cloud template library once and deliver the maintained localized welcome with three curated template preview cards. Accept current-chat MCP tool activation independently; registration or a later connected chat does not prove tools hot-loaded in the current turn. 1. **Use the cloud onboarding endpoint.** Derive `LANG` (`zh`, `en`, `ja`, `ko`, `fr`, `es`, `pt`, else `en`) from the user's latest request. Call `GET /api/onboarding/prepare?lang=` once (using the active deployment `` from the connected MCP server, fetched `/install.md` guide, or `payload.studioUrl` in `https://releases.open-design.ai/open-motion/desktop/config/stable.json` when starting from GitHub with no explicit origin) to freeze three distinct curated IDs/order, `libraryUrl`, localized welcome copy, `inlineHtmlUrl`, `inlineHtmlSha256`, and template metadata. Preserve those exact three IDs on retries by passing `&templates=id1,id2,id3`; never resample or substitute built-ins. 2. **Verify connection only as needed.** If `openmotion_get_project` is natively available in this chat, call it once (an empty project list is normal for a newly authorized OAuth client). If MCP registration + OAuth login just finished and this chat has not hot-loaded tools yet, report that refresh/new-chat step honestly without blocking onboarding or restarting the host. 3. **Open the cloud template library once.** Call `openmotion_open_preview({ target: "templates", action: "open" })` when native tools are active, otherwise use `prepare.libraryUrl`. Open or reuse it once in the host's right-hand browser pane when available; do not add extra snapshots, screenshots, or media audits. On hosts without a right-hand browser pane (or if opening fails/is unconfirmed), never claim the library opened on the right—show the clickable `libraryUrl` with the truthful heading. 4. **Deliver the best supported card route.** - **Native MCP App** (when `openmotion_show_template_recommendations` is discovered): invoke it with `prepare.cardPresentation.arguments` (`onboarding: true`) after confirmed right-hand library opening, or `cardsOnlyArguments` (`onboarding: false`) plus `prepare.noSidebarWelcomeMarkdown` otherwise. Never duplicate the welcome when `onboarding: true`. - **Self-contained HTML (`visualize` / Codex default)**: download `prepare.inlineHtmlUrl` via `curl -fsSL` into the chat's explicitly permitted visualization directory, verify SHA-256 equals `prepare.inlineHtmlSha256` and bytes `< 1,000,000`, then emit `prepare.welcomeMarkdown` (or `prepare.noSidebarWelcomeMarkdown`) verbatim followed by `visualize{"path":""}`. - **Text fallback**: when no card surface is supported or presentation fails, emit `prepare.fallbackWelcomeMarkdown` (or `prepare.noSidebarTextWelcomeMarkdown`) plus the exact three items from `prepare.templates` (title, summary, clickable `previewUrl`) in order and briefly explain the card limitation. Connecting and onboarding never authorize creating or exporting a project. Continue an accepted user selection through [accepted template selection](../../docs/install.md#completion-boundary-and-next-turn).