/** * SessionLoopSignals:tool-loop 执行循环的信号判断与调试摘要工具。 * * 关键点(中文) * - 这里只放“如何判断继续执行 / 如何输出调试摘要”的纯函数。 * - 不放 tool-loop 主流程,避免执行内核被大量辅助细节淹没。 * - 目标是让 tool-loop 保持“只看主链路就能理解”的结构。 */ import type { SessionMessageRecordV1 } from "../../executor/types/SessionRecords.js"; import type { JsonObject } from "../../types/common/Json.js"; /** * 单次 tool-loop 允许的最大 step 数。 */ export declare const MAX_TOOL_LOOP_STEPS = 64; /** * text-only 提醒续跑的最大次数。 * * 关键点(中文) * - 仅用于“模型明显承诺下一步、但没有实际调用工具”的兜底。 * - 设置较小上限,避免进入无界自催促循环。 */ export declare const MAX_TEXT_ONLY_CONTINUATIONS = 3; /** * 不完整响应自动恢复的最大次数。 * * 关键点(中文) * - 仅针对 provider 流异常结束这类“本该继续、但响应被截断”的情况。 * - 只补一次,避免在 provider 异常持续时进入长时间空转。 */ export declare const MAX_INCOMPLETE_RESPONSE_RECOVERIES = 1; /** * 生成日志友好的单行预览文本。 */ export declare function to_inline_preview(value: unknown): string; /** * 汇总单个 step 的关键信号,便于定位“为什么没有继续下一轮”。 */ export declare function summarize_step_for_debug(step_result: unknown): JsonObject; /** * 汇总最终 assistant UI 消息的调试摘要。 */ export declare function summarize_ui_message_for_debug(message: SessionMessageRecordV1 | null | undefined): JsonObject; /** * 合并多轮 assistant UI 消息。 * * 关键点(中文) * - 多 step 场景下,最终 assistant message 需要把各 step 的 UI part 串起来。 */ export declare function merge_assistant_ui_messages(base: SessionMessageRecordV1 | null, incoming: SessionMessageRecordV1): SessionMessageRecordV1; /** * 构造“不完整响应恢复”提示。 */ export declare function build_incomplete_response_recovery_nudge(recoveryIndex: number): string; /** * 检测“响应被中断但模型没有正常完成”的情况。 */ export declare function detect_incomplete_response(params: { step_result: unknown; assistant_message: SessionMessageRecordV1 | null | undefined; }): { reason: string; details: JsonObject; } | null; /** * 检测“只有口头计划,没有真正执行”的续跑信号。 */ export declare function detect_text_only_continuation_reason(step_result: unknown): string | null; /** * 构造“text-only 续跑”提示。 */ export declare function build_text_only_continuation_nudge(continuationIndex: number): string; //# sourceMappingURL=CoreEngineSignals.d.ts.map