@agentium/harness. Types such as ChatMessage, RunContext, and ExecutionServices come from @agentium/core. A ? marks an optional field.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Agentium 4.0.0 · Upgrade from 3.x.
Versioned events, terminal results, replay cursors, and bounded event retention.
@agentium/harness. Types such as ChatMessage, RunContext, and ExecutionServices come from @agentium/core. A ? marks an optional field.
export interface HarnessEvent {
schemaVersion: 1;
eventId: string;
sequence: number;
timestamp: number;
sessionId: string;
runId: string;
attemptId: string;
parentRunId?: string;
rootRunId: string;
payload: HarnessEventPayload;
}
export type HarnessEventPayload = {
type: "run.started";
driverId: string;
} | {
type: "text.delta";
text: string;
} | {
type: "model.complete";
providerId: string;
modelId: string;
usage: TokenUsage;
} | {
type: "tool.complete";
toolName: string;
toolCallId: string;
denied: boolean;
} | {
type: "control";
operation: "cancel" | "follow_up" | "steer" | "replace";
reason?: string;
} | {
type: "completion";
action: string;
reason: string;
} | {
type: "run.terminal";
result: HarnessResult;
};
export interface HarnessReason {
code: string;
message: string;
}
export interface HarnessResult {
status: HarnessStatus;
text: string;
structured?: unknown;
artifacts?: readonly {
id: string;
mimeType?: string;
}[];
reason?: HarnessReason;
usage: TokenUsage;
runId: string;
sessionId: string;
finalCursor: number;
cleanupDiagnostics?: readonly string[];
}
export type HarnessStatus = "completed" | "failed" | "cancelled" | "stopped" | "awaiting_input";
export declare class HarnessEventGapError extends Error {
readonly earliestCursor: number;
readonly code = "event_gap";
constructor(earliestCursor: number);
}
/** Bounded in-process history; no durability, network delivery, or audio backpressure promise. */
export declare class InMemoryHarnessEventStore {
readonly capacity: number;
readonly durable = false;
constructor(identity: Omit<HarnessEvent, "schemaVersion" | "eventId" | "sequence" | "timestamp" | "payload">, capacity?: number);
get cursor(): number;
append(payload: HarnessEventPayload): HarnessEvent;
events(options?: {
after?: number;
}): AsyncGenerator<HarnessEvent>;
}