/** * Agent Harness — Runtime for managing agent definitions, runs, and decisions. * * Loads agent definitions from the graph (TrellisKernel), manages tool * registrations, executes runs, and records decision traces as kernel entities. * * @module trellis/core/agents */ import type { TrellisKernel } from '../kernel/trellis-kernel.js'; import type { AgentDef, ToolDef, ToolHandler, ToolResult, AgentRun, DecisionTrace, AgentHarnessConfig, RunTaskOptions } from './types.js'; export declare class AgentHarness { private kernel; private toolHandlers; private config; private runCounter; constructor(kernel: TrellisKernel, config?: AgentHarnessConfig); /** * Execute an autonomous task run using the configured LLM provider. * * When the configured contextManager is a GraphContextManager, conversations * are automatically created (or resumed) and linked to the agent run. Pass * `opts.conversationId` to resume an existing conversation. */ runAgentTask(agentId: string, input: string, opts?: RunTaskOptions): Promise; private _getAvailableTools; createAgent(def: Omit & { id?: string; capabilities?: string[]; tools?: string[]; }): Promise; getAgent(id: string): AgentDef | null; listAgents(status?: AgentDef['status']): AgentDef[]; registerTool(def: Omit & { id?: string; }, handler: ToolHandler): Promise; getToolHandler(toolId: string): ToolHandler | undefined; listTools(): ToolDef[]; startRun(agentId: string, input?: string): Promise; completeRun(runId: string, output?: string, tokenCount?: number): Promise; failRun(runId: string, error: string): Promise; getRun(runId: string): AgentRun | null; listRuns(agentId?: string): AgentRun[]; recordDecision(runId: string, toolName: string, input?: Record, output?: string, opts?: { rationale?: string; alternatives?: string[]; relatedEntities?: string[]; }): Promise; /** * Invoke a registered tool within a run, auto-recording a decision trace. */ invokeTool(runId: string, toolId: string, input: Record, opts?: { rationale?: string; relatedEntities?: string[]; }): Promise; getDecisionChain(entityId: string): DecisionTrace[]; private _buildDecisionTrace; } //# sourceMappingURL=harness.d.ts.map