From fc53b05824dec0e7c6f4864670fea3024df60d37 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 21 Aug 2026 23:02:19 +0000 Subject: [PATCH] fix: call relocated /seam/wizard/v1 inference endpoints seam-connect moved the wizard inference proxy and token-exchange endpoints off the internal namespace onto the public /seam/wizard/v1/* surface (seamapi/seam-connect#17275): - inference base URL: /internal/wizard_inference -> /seam/wizard (the agent SDK still appends /v1/messages) - token exchange: /internal/wizard_inference/session -> /seam/wizard/v1/session The session response is now a single top-level wizard_session object with the Console onboarding answers nested inside it, rather than a sibling key; parse it from wizard_session.onboarding. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01FRfRgiwY7rMtMenkS4Yk7Y --- src/lib/api.test.ts | 15 +++++++++++---- src/lib/api.ts | 17 ++++++++++------- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/lib/api.test.ts b/src/lib/api.test.ts index d064d72..bb55ea2 100644 --- a/src/lib/api.test.ts +++ b/src/lib/api.test.ts @@ -25,11 +25,18 @@ test('uses the workspace SDK and its raw client', async () => { name: 'Test', is_sandbox: true, } + const onboarding = { + org_type: 'startup', + primary_goal: null, + use_case: null, + build_target: null, + embed_customer_portal: null, + device_categories: ['locks'], + } get.mockResolvedValue(workspace) post.mockResolvedValue({ data: { - wizard_session: { token: 'token', expires_at: 'tomorrow' }, - onboarding: null, + wizard_session: { token: 'token', expires_at: 'tomorrow', onboarding }, }, }) @@ -37,7 +44,7 @@ test('uses the workspace SDK and its raw client', async () => { await expect(exchangeWizardInferenceToken('seam_key')).resolves.toEqual({ token: 'token', expires_at: 'tomorrow', - onboarding: null, + onboarding, }) - expect(post).toHaveBeenCalledWith('/internal/wizard_inference/session', {}) + expect(post).toHaveBeenCalledWith('/seam/wizard/v1/session', {}) }) diff --git a/src/lib/api.ts b/src/lib/api.ts index a1fde2e..eec6e49 100644 --- a/src/lib/api.ts +++ b/src/lib/api.ts @@ -52,12 +52,12 @@ export function looksLikeSeamApiKey(value: string): boolean { } // Base URL for Seam-hosted inference. The embedded agent's SDK appends -// /v1/messages; the exchange endpoint below lives at /session. +// /v1/messages; the exchange endpoint below lives at /v1/session. export function getInferenceBaseUrl(): string { - return `${getApiBaseUrl()}/internal/wizard_inference` + return `${getApiBaseUrl()}/seam/wizard` } -// The Console-collected onboarding answers Seam returns alongside the token, so +// The Console-collected onboarding answers Seam returns within the session, so // the wizard can pre-fill its plan instead of re-asking (null if none recorded). export interface WizardOnboarding { org_type: string | null @@ -82,9 +82,12 @@ export async function exchangeWizardInferenceToken( ): Promise { try { const { data: body } = await getApi(apiKey).client.post<{ - wizard_session?: { token: string; expires_at: string } - onboarding?: WizardOnboarding | null - }>('/internal/wizard_inference/session', {}) + wizard_session?: { + token: string + expires_at: string + onboarding?: WizardOnboarding | null + } + }>('/seam/wizard/v1/session', {}) if (body.wizard_session == null) { throw new ApiKeyError( 'Unexpected response from Seam starting the AI session.', @@ -93,7 +96,7 @@ export async function exchangeWizardInferenceToken( return { token: body.wizard_session.token, expires_at: body.wizard_session.expires_at, - onboarding: body.onboarding ?? null, + onboarding: body.wizard_session.onboarding ?? null, } } catch (error) { if (error instanceof ApiKeyError) throw error