/** * Semantic activity derived from Harness-native model and tool presentation. * * Two authorities, because Harness publishes two. Durable `SessionEvent`s own * the turn/step lifecycle, so they are what returns the model to `waiting`; the * agent-scoped `agent/assistant-stream` frames are the only place live model * output exists, so they are what says `thinking` or `responding`. Folding both * through one reducer would need a union of a durable log event and a transient * frame, and the caller already knows which of the two it is holding. * @module dshline/activity */ import type { AssistantStreamFrame } from '@deepseek-ai/dsh-agent'; import type { SessionEvent } from '@deepseek-ai/dsh-session'; import type { ToolCallView } from '@deepseek-ai/dsh-tools'; /** The model-side phase visible while no pending tool invocation outranks it. */ export type ModelPhase = 'waiting' | 'thinking' | 'responding'; /** The conservative activity vocabulary derived from a pending tool's view. */ export type ToolActivity = 'reading' | 'searching' | 'fetching' | 'editing' | 'running' | 'working'; /** One presentation word for the status line's current activity. */ export type ActivityWord = ModelPhase | ToolActivity; /** * Fold one committed session event into the model's lifecycle phase. * * Only boundaries appear here. A durable log event never says the model is * producing output — under session format v2 the log's Assistant records are * settlements, not deltas — so every branch of this reducer returns the model * to `waiting` or preserves what the live frames established. * @param phase - the phase before this event. * @param event - one event from the live session feed. * @returns the phase after the event, preserving it for unknown future events. */ export declare function modelPhaseAfter(phase: ModelPhase, event: SessionEvent): ModelPhase; /** * Fold one live assistant-stream frame into the model's current phase. * * This is process-local presentation, not history: the frames exist so a reader * can see the model working, and they are the only authority that can say which * kind of output is arriving right now. * @param phase - the phase before this frame. * @param frame - one ordered frame for the attached agent's current attempt. * @returns the phase after the frame. */ export declare function modelPhaseAfterFrame(phase: ModelPhase, frame: AssistantStreamFrame): ModelPhase; /** * Classify one resolved call presentation without interpreting its tool name or text. * @param view - the call view returned by the definition that actually ran. * @returns the semantic tool activity, conservatively falling back to `working`. */ export declare function toolActivity(view: ToolCallView | undefined): ToolActivity; /** * Choose the status word, letting an outstanding tool invocation outrank the model. * @param phase - the latest model-side phase. * @param pending - the aggregate activity of pending tool invocations. * @returns the tool activity when present, otherwise the model phase. */ export declare function primaryActivity(phase: ModelPhase, pending: ToolActivity | undefined): ActivityWord; //# sourceMappingURL=activity.d.ts.map