feat: mid-session status updates — ticket notes, client updates, email drafts
Engineers can now generate AI-powered status updates during active FlowPilot
sessions and after resolve/escalate. Three audiences (Ticket Notes, Client
Update, Email Draft) with Quick/Detailed length options. Copy to clipboard
with one click. Client names auto-inserted from intake/PSA context.
Backend: new endpoint POST /ai-sessions/{id}/status-update with audience-aware
system prompts. Frontend: StatusUpdateModal with 2-step selection flow,
Share Update button in action bar, Share Resolution/Escalation on completed
sessions. Also updates Solutions Library spec with Community tier design.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -10,6 +10,8 @@ import type {
|
||||
ResolveSessionRequest,
|
||||
EscalateSessionRequest,
|
||||
SessionDocumentation,
|
||||
StatusUpdateRequest,
|
||||
StatusUpdateResponse,
|
||||
} from '@/types/ai-session'
|
||||
import { toast } from '@/lib/toast'
|
||||
|
||||
@@ -31,6 +33,7 @@ export interface UseFlowPilotSession {
|
||||
resumeOwnSession: () => Promise<void>
|
||||
abandonSession: () => Promise<void>
|
||||
rateSession: (rating: number, feedback?: string) => Promise<void>
|
||||
generateStatusUpdate: (data: StatusUpdateRequest) => Promise<StatusUpdateResponse>
|
||||
loadSession: (sessionId: string) => Promise<void>
|
||||
|
||||
// Derived
|
||||
@@ -214,6 +217,17 @@ export function useFlowPilotSession(): UseFlowPilotSession {
|
||||
}
|
||||
}, [session])
|
||||
|
||||
const generateStatusUpdate = useCallback(async (data: StatusUpdateRequest): Promise<StatusUpdateResponse> => {
|
||||
if (!session) throw new Error('No active session')
|
||||
try {
|
||||
return await aiSessionsApi.generateStatusUpdate(session.id, data)
|
||||
} catch (e: unknown) {
|
||||
const message = e instanceof Error ? e.message : 'Failed to generate status update'
|
||||
toast.error(message)
|
||||
throw e
|
||||
}
|
||||
}, [session])
|
||||
|
||||
const loadSession = useCallback(async (sessionId: string) => {
|
||||
setIsLoading(true)
|
||||
setError(null)
|
||||
@@ -260,6 +274,7 @@ export function useFlowPilotSession(): UseFlowPilotSession {
|
||||
resumeOwnSession,
|
||||
abandonSession,
|
||||
rateSession,
|
||||
generateStatusUpdate,
|
||||
loadSession,
|
||||
isActive,
|
||||
canResolve,
|
||||
|
||||
Reference in New Issue
Block a user