/** * 执行过程 — DeepSeek-style per-hop think-then-act for Agim Agent. * * When on, Agim forces the provider thinking channel (even if /think is off) * and surfaces each hop's reasoning as reflect activity while the harness * keeps calling tools. The HTML fence is a fallback for models with no * thinking trace — not the primary path. * * Env: AGIM_STEP_REFLECT=on|off|disabled (default on). * Session: session.stepReflect true|false overrides env (both persist). * `disabled` is an ops kill switch. */ export declare const STEP_REFLECT_STEER_PREFIX = "[step-reflect]"; export type StepReflectEnv = 'on' | 'off' | 'disabled'; export type StepReflectStance = 'keep' | 'adjust' | 'stop'; export type StepReflectThinkingLevel = 'off' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh'; export interface StepReflectRecord { stance: StepReflectStance; next: string; at: number; } export interface ParsedStepReflect { observed: string; stance: StepReflectStance; next: string; risk?: string; } export type ThinkingStreamEvent = { kind: 'start'; } | { kind: 'delta'; delta: string; } | { kind: 'end'; }; export declare function resolveStepReflectEnv(): StepReflectEnv; export declare function isStepReflectDisabled(): boolean; /** Effective on/off for this session. `disabled` always wins. */ export declare function isStepReflectEnabled(session?: { stepReflect?: boolean; } | null): boolean; /** * DeepSeek-style: step-reflect on + a reasoning-capable model forces at least * `high`. `/think high|max` still wins. Off when the backend cannot think. */ export declare function resolveStepReflectThinkingLevel(current: StepReflectThinkingLevel, opts: { enabled: boolean; modelReasoning: boolean; }): StepReflectThinkingLevel; /** Read / ask / todo / reserved `agim_reflect` skip the non-thinking fallback steer. */ export declare function isStepReflectExemptTool(toolName: string): boolean; /** True when any tool in this act is not exempt (write / exec / call_agent / …). */ export declare function actNeedsReflect(toolNames: readonly string[]): boolean; export declare function parseStepReflectFence(text: string): ParsedStepReflect | null; /** Pull plain text from a pi / OpenAI-style assistant content payload. */ export declare function extractAssistantText(content: unknown): string; /** Pull provider thinking / reasoning blocks (pi `{ type: 'thinking' }`). */ export declare function extractAssistantThinking(content: unknown): string; export declare function classifyThinkingStreamEvent(ev: unknown): ThinkingStreamEvent | null; export declare function summarizeThinkingLine(thinking: string, max?: number): string; /** Turn a thinking trace into a reflect card (stance is informational, not a gate). */ export declare function stepReflectFromThinking(thinking: string): ParsedStepReflect | null; export declare function formatStepReflectSteer(): string; /** Append incoming reflects onto a step; same `at` updates in place (live hop). */ export declare function mergeStepReflects(prev: readonly StepReflectRecord[] | undefined, incoming: readonly StepReflectRecord[] | undefined): StepReflectRecord[] | undefined; //# sourceMappingURL=step-reflect.d.ts.map