/** * One visit of an `agent` node: who runs it, the turn it is asked, and the * attempts `retry:` allows. * * A failed attempt is classified by our code, from what it knows rather than * from what a message says: the run's stop, a `fail-fast` cut, the subagent's * own stop, the deadline this attempt was given, and otherwise the provider. */ import { type Agent } from "../../agent.ts"; import type { GitResult } from "../../git/index.ts"; import { type Usage } from "../../usage.ts"; import type { CheckedAgentNode } from "../checked.ts"; import { type Ended } from "./ended.ts"; import type { Held } from "./frames.ts"; import type { Here } from "./walk.ts"; /** One attempt about to be asked, as the run's deadline sees it: its visit, its node's address, its subagent. */ export type Attempt = { readonly path: string; readonly at: string; readonly subagent: string; readonly ms: number; }; /** What an agent visit needs from the run around it. */ export type AgentRun = { /** The run's signal: aborted, nothing starts and nothing catches the failure. */ readonly signal: AbortSignal; /** The bound of one attempt of `node`, in milliseconds. */ timeoutFor(node: CheckedAgentNode): number; /** The deadline of one attempt. */ deadline(attempt: Attempt): AbortSignal; /** A subagent of `agent` for `node`, spawned for the visit `path` in `tree`, with the tools it answers with, its transcript left in `home`. */ open(agent: Agent, node: CheckedAgentNode, path: string, tree: string | undefined, home: string): Promise; /** What `tree` changed since `HEAD`, as `diff` reads it. */ diff(tree: string | undefined): Promise>; }; /** How an agent visit ended, with what it cost and who ran it. */ export type AgentVisit = { readonly ended: Ended; readonly usage: Usage; readonly agent?: string; readonly subagent?: string; readonly model?: string; }; /** * Visits `node` at `path`. A node with `memory:` resumes its scope's * subagent; any other gets a fresh one. */ export declare function visitAgent(run: AgentRun, node: CheckedAgentNode, path: string, at: Here): Promise; //# sourceMappingURL=agent.d.ts.map