import type { TurnOutcome } from '@xopcai/gateway-contract'; import type { TurnPlanStep, TurnPlanStatus } from '../tools/update-plan-tool.js'; import type { TurnCheckpointDiff } from './checkpoint.js'; import type { ExternalRuntimeToolResult } from './types.js'; export declare const MAX_EXTERNAL_TOOL_TEXT = 32000; export type NormalizedFileChange = { path: string; kind: 'create' | 'update' | 'delete' | 'rename'; diff: string; added: number; removed: number; }; /** * Convert an absolute path inside the workspace into a clean POSIX-style relative path * so tool headers, diff cards, and turn summaries stay concise and user-friendly. */ export declare function toWorkspaceRelativePath(rawPath: string, cwd: string): string; /** * Strip common non-interactive shell wrappers (`/bin/zsh -lc "..."`, `bash -c '...'`) * so command cards show the real command while keeping the raw command available if needed. */ export declare function unwrapShellCommand(rawCommand: string): { displayCommand: string; rawCommand?: string; }; export declare function normalizeChangeKind(raw: string | undefined): NormalizedFileChange['kind']; export declare function countDiffLines(diff: string): { added: number; removed: number; }; export declare function summarizeFileChanges(rawChanges: ReadonlyArray<{ path: string; kind?: string; diff?: string; }>, cwd: string): { changes: NormalizedFileChange[]; files: string[]; primaryPath?: string; diff: string; added: number; removed: number; }; export declare function buildNormalizedApplyPatchResult(input: { id: string; isError: boolean; cwd: string; rawChanges: ReadonlyArray<{ path: string; kind?: string; diff?: string; }>; fallbackOutput?: string; }): ExternalRuntimeToolResult; export declare function buildNormalizedExecCommandResult(input: { id: string; isError: boolean; cwd: string; command: string; rawCommand?: string; execCwd?: string; exitCode: number | null; durationMs?: number; output: string; }): ExternalRuntimeToolResult; export declare function normalizePlanStatus(raw: unknown): TurnPlanStatus; export declare function normalizeExternalPlanSteps(rawSteps: ReadonlyArray<{ id?: string; step: string; status: unknown; }>): TurnPlanStep[]; export declare class ExternalTurnOutcomeAggregator { private readonly filesByPath; private readonly diffs; private totalAdded; private totalRemoved; private readonly evidence; recordToolResult(toolName: string, result: ExternalRuntimeToolResult): void; private gitCheckpointDiff?; applyGitCheckpointDiff(checkpoint: TurnCheckpointDiff): void; buildOutcome(input: { outcomeId: string; runId: string; status: TurnOutcome['status']; summary?: string; }): TurnOutcome; }