feat(pilot): frontend API client — patchScript + inline createSession
sessionSuggestedFixesApi.patchScript(sessionId, fixId, script, params?) hits the new PATCH /script endpoint. scriptBuilder.createSession accepts an optional options bag with origin + aiSessionId, defaulting to standalone when omitted so legacy callers stay behavior-preserving. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -7,9 +7,21 @@ import type {
|
||||
} from '@/types'
|
||||
import type { ScriptTemplateDetail } from '@/types'
|
||||
|
||||
export interface CreateSessionOptions {
|
||||
origin?: 'standalone' | 'pilot_inline'
|
||||
aiSessionId?: string
|
||||
}
|
||||
|
||||
export const scriptBuilderApi = {
|
||||
async createSession(language: string): Promise<ScriptBuilderSessionDetail> {
|
||||
const { data } = await apiClient.post('/scripts/builder/sessions', { language })
|
||||
async createSession(
|
||||
language: string,
|
||||
options?: CreateSessionOptions,
|
||||
): Promise<ScriptBuilderSessionDetail> {
|
||||
const { data } = await apiClient.post('/scripts/builder/sessions', {
|
||||
language,
|
||||
origin: options?.origin,
|
||||
ai_session_id: options?.aiSessionId,
|
||||
})
|
||||
return data
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user