feat(setup): first-run wizard — admin, GitHub App, tunnel, done (#71)

* feat(setup): first-run wizard — admin, GitHub App, tunnel, done

- GET /api/v1/setup/status (public): has_users, needs_setup,
  has_github_app, has_tunnel. app_settings.setup_completed flag; installs
  with existing projects auto-complete so upgrades never see the wizard.
- POST /api/v1/setup/complete records the flag.
- /setup page: progress rail + four steps — create admin (links into the
  bootstrap sign-up with redirect back), GitHub App manifest flow,
  optional Cloudflare tunnel token, finish. Every optional step is
  skippable; nothing blocks.
- PlatformShell redirects signed-in users to /setup while needs_setup.
- The GitHub App callback honors a sessionStorage return marker set by
  the wizard so provisioning resumes at /setup instead of /settings.
- OpenAPI documents both endpoints.

Verified live: status reports auto-completed on this install,
complete persists the flag, response shape matches the client.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(setup): wizard step-state coverage

Five cases across the state machine: fresh-install account prompt,
sign-in resume, git-provider step, tunnel step, and finish.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
Tomáš DvořákandDevin authored and GitHub committed 2026-10-10 02:17:41 +02:00
1 parent 985d22798c
commit c4307034ec
11 files changed
+622 -4

No files matched your search

+17
View File
@@ -499,6 +499,23 @@ export async function pingServer(): Promise<void> {
}
}
export type SetupStatus = {
has_users: boolean;
setup_completed: boolean;
needs_setup: boolean;
has_github_app: boolean;
has_tunnel: boolean;
signup_enabled: boolean;
};
export async function getSetupStatus(): Promise<SetupStatus> {
return requestJson<SetupStatus>('/setup/status');
}
export async function completeSetup(): Promise<void> {
await requestJson('/setup/complete', { method: 'POST', body: JSON.stringify({}) });
}
export function getAgentPublicBaseUrl(): string {
return `${API_ROOT}/api/agents`;
}