story-kit: merge 148_story_interactive_onboarding_guides_user_through_project_setup_after_init

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Dave
2026-02-24 15:34:31 +00:00
parent 81ac2f309a
commit 5567cdf480
7 changed files with 476 additions and 4 deletions

View File

@@ -63,7 +63,9 @@ export type WsResponse =
| { type: "agent_config_changed" }
| { type: "tool_activity"; tool_name: string }
/** Heartbeat response confirming the connection is alive. */
| { type: "pong" };
| { type: "pong" }
/** Sent on connect when the project still needs onboarding (specs are placeholders). */
| { type: "onboarding_status"; needs_onboarding: boolean };
export interface ProviderConfig {
provider: string;
@@ -280,6 +282,7 @@ export class ChatWebSocket {
message: string,
) => void;
private onAgentConfigChanged?: () => void;
private onOnboardingStatus?: (needsOnboarding: boolean) => void;
private connected = false;
private closeTimer?: number;
private wsPath = DEFAULT_WS_PATH;
@@ -355,6 +358,8 @@ export class ChatWebSocket {
data.message,
);
if (data.type === "agent_config_changed") this.onAgentConfigChanged?.();
if (data.type === "onboarding_status")
this.onOnboardingStatus?.(data.needs_onboarding);
if (data.type === "pong") {
window.clearTimeout(this.heartbeatTimeout);
this.heartbeatTimeout = undefined;
@@ -405,6 +410,7 @@ export class ChatWebSocket {
message: string,
) => void;
onAgentConfigChanged?: () => void;
onOnboardingStatus?: (needsOnboarding: boolean) => void;
},
wsPath = DEFAULT_WS_PATH,
) {
@@ -417,6 +423,7 @@ export class ChatWebSocket {
this.onActivity = handlers.onActivity;
this.onReconciliationProgress = handlers.onReconciliationProgress;
this.onAgentConfigChanged = handlers.onAgentConfigChanged;
this.onOnboardingStatus = handlers.onOnboardingStatus;
this.wsPath = wsPath;
this.shouldReconnect = true;