import type { Trajectory, TrajectoryEvent, TrajectoryTurnDiff } from "./types.js"; /** Tool name used by the parent agent to launch a subagent. */ export declare const SUBAGENT_LAUNCH_TOOL = "task"; export type ValidatedTurnDiffs = { ok: true; records: readonly TrajectoryTurnDiff[]; } | { ok: false; error: string; }; /** * Validate optional persisted turn-diff evidence before a scoped grader uses * it. JSONL input and plugins can bypass TypeScript's discriminated union, so * reject ambiguity rather than letting a negative grader pass on bad evidence. */ export declare function validateTurnDiffs(value: unknown): ValidatedTurnDiffs; /** Returns the conversation turn for an event. Defaults to 0 for single-turn/legacy events. */ export declare function eventTurn(event: TrajectoryEvent): number; /** * Stamps `event.turn` on each event with the 0-based conversation turn it belongs * to, advancing the turn at every parent/root `user_message`. Events preceding the * first user message are left unstamped (so `eventTurn` reports them as turn 0). * A subagent-originated `user_message` (one carrying an `agentId`) does not advance * the parent turn counter, so it can't skew `scope`+`turn` composition. Mutates in place. */ export declare function stampConversationTurns(events: TrajectoryEvent[]): void; /** * Returns a view of `trajectory` containing only events from `turnIndex`, with * metrics recomputed and `output` set to that turn's last non-empty assistant message. * * This remains the public event-slicing helper and preserves every trajectory * field other than `raw`, matching its behavior before per-turn diff support. */ export declare function sliceTrajectoryToTurn(trajectory: Trajectory, turnIndex: number): Trajectory; /** * Internal grading projection that removes full-run diff sources before * injecting exactly one validated turn artifact. Unlike the public * {@link sliceTrajectoryToTurn} helper, this deliberately fails closed. */ export declare function sliceTrajectoryToTurnForGrading(trajectory: Trajectory, turnIndex: number, options: { allowCumulativeSingleTurnDiff: boolean; }): Trajectory; /** * Strip `workspacePatch` before JSONL serialization. It's always written to a * `workspace.patch` sidecar file by the trial runner, so inlining it would * duplicate potentially large (up to 64 MiB) content. Shared by every JSONL * writer (reporter, experiment runner) so they can't drift apart. */ export declare function stripWorkspacePatchForJsonl(trajectory: T): Omit; /** * Selects which agent's events a grader should see. * * - `"parent"` — only the parent/root agent (events with no `agentId`). * - `"subagent"` — only subagent events (any `agentId`), regardless of which. * - `{ agent }` — only the named subagent (matched against `agentId`). */ export type AgentScope = "parent" | "subagent" | { agent: string; }; /** Whether `event` belongs to the agent selected by `scope`. */ export declare function eventMatchesScope(event: TrajectoryEvent, scope: AgentScope): boolean; /** Returns a human-readable label for a scope, used in diagnostics. */ export declare function scopeLabel(scope: AgentScope): string; /** * Returns a view of `trajectory` containing only events from the agent selected * by `scope`, with metrics recomputed and `output` set to that agent's last * non-empty assistant message. Mirrors {@link sliceTrajectoryToTurn} so * scoping composes generically across trajectory graders. */ export declare function sliceTrajectoryToScope(trajectory: Trajectory, scope: AgentScope): Trajectory; //# sourceMappingURL=turn.d.ts.map