/**
* The minimal contract an agent must satisfy to be served by Agentium's
* runtime (registry, Express/Socket.IO gateways, queue workers, observability).
*
* The first-party `Agent` class satisfies this structurally, but so can any
* external implementation — a LangGraph graph, a Claude Agent SDK agent, or
* plain custom code. Use `defineExternalAgent()` for a convenient way to wrap
* custom run logic into this shape.
*
* Optional metadata fields light up extra runtime features when present
* (provider-specific API key routing, swagger docs, approval endpoints,
* checkpoint endpoints, correction capture).
*/
export interface ServableAgent {
readonly kind: "agent";
readonly name: string;
run(input: MessageContent, opts?: RunOpts): Promise<RunOutput>;
stream(input: MessageContent, opts?: RunOpts): AsyncIterable<StreamChunk>;
/** Event bus for observability (tracing, metrics, approval streams). */
readonly eventBus?: EventBus;
readonly modelId?: string;
readonly providerId?: string;
readonly tools?: ReadonlyArray<{
name: string;
description?: string;
}>;
readonly instructions?: unknown;
readonly hasStructuredOutput?: boolean;
readonly structuredOutputSchema?: unknown;
/** MemoryManager (or compatible) — enables the corrections endpoint. */
readonly memory?: unknown;
/** HITL approval manager — enables the approval endpoints. */
readonly approvalManager?: unknown;
/** Checkpoint manager — enables the checkpoint endpoints. */
readonly checkpointManager?: unknown;
}