fix: update useFlowPilotSession return types for optional documentation

SessionCloseResponse.documentation is now nullable — update resolve/escalate
return types to match.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
chihlasm
2026-03-28 23:25:08 +00:00
parent 8c7a863f5f
commit 564d88e90f

View File

@@ -27,8 +27,8 @@ export interface UseFlowPilotSession {
// Actions // Actions
startSession: (intake: AISessionCreateRequest) => Promise<void> startSession: (intake: AISessionCreateRequest) => Promise<void>
respondToStep: (response: StepResponseRequest) => Promise<void> respondToStep: (response: StepResponseRequest) => Promise<void>
resolveSession: (data: ResolveSessionRequest) => Promise<SessionDocumentation> resolveSession: (data: ResolveSessionRequest) => Promise<SessionDocumentation | null>
escalateSession: (data: EscalateSessionRequest) => Promise<SessionDocumentation> escalateSession: (data: EscalateSessionRequest) => Promise<SessionDocumentation | null>
pauseSession: () => Promise<void> pauseSession: () => Promise<void>
resumeOwnSession: () => Promise<void> resumeOwnSession: () => Promise<void>
abandonSession: () => Promise<void> abandonSession: () => Promise<void>
@@ -134,7 +134,7 @@ export function useFlowPilotSession(): UseFlowPilotSession {
} }
}, [session]) }, [session])
const resolveSession = useCallback(async (data: ResolveSessionRequest): Promise<SessionDocumentation> => { const resolveSession = useCallback(async (data: ResolveSessionRequest): Promise<SessionDocumentation | null> => {
if (!session) throw new Error('No active session') if (!session) throw new Error('No active session')
setIsProcessing(true) setIsProcessing(true)
try { try {
@@ -156,7 +156,7 @@ export function useFlowPilotSession(): UseFlowPilotSession {
} }
}, [session]) }, [session])
const escalateSession = useCallback(async (data: EscalateSessionRequest): Promise<SessionDocumentation> => { const escalateSession = useCallback(async (data: EscalateSessionRequest): Promise<SessionDocumentation | null> => {
if (!session) throw new Error('No active session') if (!session) throw new Error('No active session')
setIsProcessing(true) setIsProcessing(true)
try { try {