orca/src/main/native-chat/transcript-watch-contract.ts

37 lines
1.0 KiB
TypeScript

import type {
AgentType,
NativeChatMessage,
NativeChatTurnLifecycle
} from '../../shared/native-chat-types'
import type { ResolveSessionFileOptions } from './session-file-resolver'
export type SubscribeNativeChatTranscriptArgs = ResolveSessionFileOptions & {
agent: AgentType
sessionId: string
onAppend: (messages: NativeChatMessage[], lifecycle?: NativeChatTurnLifecycle) => void
onInitialSnapshot?: (
messages: NativeChatMessage[],
hasMore: boolean,
beforeOffset: number,
/** Set when the initial drain could not deliver a transcript. */
error?: string,
lifecycle?: NativeChatTurnLifecycle
) => void
onReplace?: (
messages: NativeChatMessage[],
hasMore: boolean,
beforeOffset: number,
lifecycle?: NativeChatTurnLifecycle
) => void
initialLimit?: number
filePath?: string
debounceMs?: number
/** Test-only override for the production resolve-poll backoff. */
resolvePollIntervalMs?: number
}
export type NativeChatTranscriptSubscription = {
unsubscribe: () => void
watching: boolean
}