Q176: onboarding progress survives a restart, and an unfinished setup reopens
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
43dcb1e7d3
commit
fd79f059ca
20 files changed
+341
-71
No files matched your search
@@ -7,6 +7,14 @@ const id = z.string();
|
||||
const nullableId = z.string().nullable();
|
||||
|
||||
export const organizationContracts = {
|
||||
saveOnboardingDraft: z.strictObject({
|
||||
draft: z.strictObject({
|
||||
step: z.enum(["welcome", "provider", "company", "mode", "mission"]), companyName: z.string(), companyDescription: z.string(), employeeName: z.string(),
|
||||
workspacePath: z.string(), executionMode: z.enum(["ai_ceo", "ai_cofounder"]), providerKey: z.string(), providerBaseUrl: z.string(), providerModel: z.string(),
|
||||
goalTitle: z.string(), goalDescription: z.string(),
|
||||
}).nullable(),
|
||||
}),
|
||||
completeSetup: z.strictObject({ orgId: id }),
|
||||
bootstrapOnboarding: z.strictObject({
|
||||
companyName: z.string(), companyDescription: z.string(), employeeName: z.string(), workspacePath: z.string(),
|
||||
executionMode: z.enum(["ai_ceo", "ai_cofounder"]), autoApproveHires: z.boolean(), reviewDeliverables: z.boolean(),
|
||||
|
||||
@@ -41,6 +41,7 @@ import { cancelQueuedRun } from "../services/run-cancel";
|
||||
import { runHistory } from "../services/run-history";
|
||||
import { deleteWorkspace, setPrimaryWorkspace, updateWorkspace } from "../services/workspace-admin";
|
||||
import { setProviderModel } from "../services/provider-default-model";
|
||||
import { completeSetup, saveOnboardingDraft } from "../services/onboarding-progress";
|
||||
import { providerDisconnectImpact } from "../services/provider-disconnect-impact";
|
||||
|
||||
export interface IpcDeps {
|
||||
@@ -141,6 +142,15 @@ export function registerIpcHandlers(deps: IpcDeps): void {
|
||||
handle("createOrganization", (input) => mutate(() => organization.createOrganization(input)));
|
||||
handle("setActiveOrganization", (input) => mutate(() => organization.setActiveOrganization(input.orgId)));
|
||||
handle("setUiPreferences", (input) => mutate(() => organization.updateUiPreferences(input)));
|
||||
handle("saveOnboardingDraft", (input) => {
|
||||
try {
|
||||
saveOnboardingDraft(deps.connection.db, input.draft);
|
||||
return ok(null);
|
||||
} catch (error) {
|
||||
return fail("onboarding_draft_failed", error instanceof Error ? error.message : String(error));
|
||||
}
|
||||
});
|
||||
handle("completeSetup", (input) => mutate(() => completeSetup(deps.connection.db, input.orgId)));
|
||||
handle("runningSessionCount", () => ok((deps.connection.db.prepare("select count(*) as n from task_runs where state = 'running'").get() as { n: number }).n));
|
||||
// Chromium's locale is fixed at launch; the reply goes out before the process exits.
|
||||
handle("relaunchApp", () => {
|
||||
|
||||
Reference in new issue
Block a user