( clientDataRoot: string, rootPath: string, cwd: string, locale: UiLocale, hostProfileId?: string, )
| 131 | } |
| 132 | |
| 133 | async function runFirstRunOnboarding( |
| 134 | clientDataRoot: string, |
| 135 | rootPath: string, |
| 136 | cwd: string, |
| 137 | locale: UiLocale, |
| 138 | hostProfileId?: string, |
| 139 | ): Promise<boolean> { |
| 140 | const connected = await connectRuntimeHostCli({ |
| 141 | clientDataRoot, |
| 142 | rootPath, |
| 143 | surface: 'tui', |
| 144 | ...(hostProfileId ? { profileId: hostProfileId } : {}), |
| 145 | }); |
| 146 | try { |
| 147 | await runMakaPiTui({ |
| 148 | driver: createFirstRunSessionDriver(), |
| 149 | title: 'Maka', |
| 150 | cwd, |
| 151 | locale, |
| 152 | model: '', |
| 153 | connectionSlug: '', |
| 154 | permissionMode: 'ask', |
| 155 | firstRun: true, |
| 156 | turnActivity: { |
| 157 | activities: new SessionActivityRegistry(), |
| 158 | } satisfies MakaPiTuiTurnActivitySurface, |
| 159 | onboarding: createRuntimeHostOnboardingSurface(connected.connection), |
| 160 | }); |
| 161 | return (await readRuntimeHostConnectionCatalog(connected.connection)).defaultTarget !== null; |
| 162 | } finally { |
| 163 | await connected.close(); |
| 164 | } |
| 165 | } |
| 166 | |
| 167 | function createFirstRunSessionDriver(): MakaSessionDriver { |
| 168 | const unavailable = async (): Promise<never> => { |
no test coverage detected