You've already forked agentic-coding-workflow
改动
This commit is contained in:
@@ -11,6 +11,7 @@ export type StreamStatus = 'idle' | 'connecting' | 'streaming' | 'closed' | 'err
|
||||
export interface UseRunStreamReturn {
|
||||
status: Ref<StreamStatus>
|
||||
runStatus: Ref<RunState>
|
||||
exitCode: Ref<number | null>
|
||||
logs: Ref<LogLine[]>
|
||||
reconnect: () => void
|
||||
close: () => void
|
||||
@@ -24,11 +25,13 @@ interface WireFrame {
|
||||
text?: string
|
||||
ts?: string
|
||||
status?: RunState
|
||||
exit_code?: number
|
||||
}
|
||||
|
||||
export function useRunStream(profileId: string): UseRunStreamReturn {
|
||||
const status = ref<StreamStatus>('idle')
|
||||
const runStatus = ref<RunState>('stopped')
|
||||
const exitCode = ref<number | null>(null)
|
||||
const logs = ref<LogLine[]>([])
|
||||
const lastLogID = ref(0)
|
||||
|
||||
@@ -62,6 +65,7 @@ export function useRunStream(profileId: string): UseRunStreamReturn {
|
||||
|
||||
if (parsed.kind === 'state') {
|
||||
if (parsed.status) runStatus.value = parsed.status
|
||||
exitCode.value = parsed.exit_code ?? null
|
||||
return
|
||||
}
|
||||
if (parsed.kind === 'slow_consumer_disconnect') {
|
||||
@@ -124,5 +128,5 @@ export function useRunStream(profileId: string): UseRunStreamReturn {
|
||||
connect()
|
||||
onScopeDispose(close)
|
||||
|
||||
return { status, runStatus, logs, reconnect, close, clear }
|
||||
return { status, runStatus, exitCode, logs, reconnect, close, clear }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user