import type { Message } from "@bastani/pi-ai/compat"; import type { AgentToolResult } from "@earendil-works/pi-agent-core"; import type { AgentScope } from "./agents.ts"; export interface UsageStats { input: number; output: number; cacheRead: number; cacheWrite: number; cost: number; contextTokens: number; turns: number; } export interface SingleResult { agent: string; agentSource: "user" | "project" | "unknown"; task: string; exitCode: number; messages: Message[]; stderr: string; usage: UsageStats; model?: string; stopReason?: string; errorMessage?: string; } export interface SubagentDetails { mode: "single" | "parallel"; agentScope: AgentScope; projectAgentsDir: string | null; results: SingleResult[]; } export type OnUpdateCallback = (partial: AgentToolResult) => void;