my harness for niri
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

at master 36 lines 1.3 kB view raw
1import type { Message, RunnerState, UserMessage } from "../types.js" 2 3/** Generic decoded tool arguments object. */ 4export type ToolArgs = Record<string, any> 5 6/** Supported image detail levels for multimodal requests. */ 7export type ImageDetail = "auto" | "low" | "high" 8 9/** Mutable state consumed by the runner loop on each turn. */ 10export interface LoopState { 11 conversation: Message[] 12 pendingInputs: UserMessage[] 13 tokenCount: number 14 contextSize: number 15 toolInFlight: boolean 16} 17 18/** Lifecycle hooks injected by the runner orchestrator into the loop. */ 19export interface LoopHooks { 20 /** Waits for the next incoming event from any trigger source. */ 21 waitForEvent: () => Promise<UserMessage> 22 /** Injects an incoming event into the in-memory conversation. */ 23 injectIncomingEvent: (convId: number, event: UserMessage) => void 24 /** Flushes events deferred while a tool call was in flight. */ 25 flushDeferredEvents: () => void 26 /** Clears persisted session state when ending a run. */ 27 clearSession: () => Promise<void> 28 /** Persists the current in-memory session state. */ 29 saveSession: () => Promise<void> 30} 31 32/** Internal runtime state for the runner service. */ 33export interface RunnerStateInternal extends RunnerState { 34 toolInFlight: boolean 35 deferredEvents: UserMessage[] 36}