Skip to content

Interface: Agent

Prefactor TypeScript SDK


Prefactor TypeScript SDK / @prefactor/openclaw-prefactor-plugin / Agent

Defined in: packages/openclaw-prefactor-plugin/src/agent.ts:157

HTTP client that manages AgentInstance lifecycle and span CRUD against the Prefactor API. Supports multiple concurrent sessions, each backed by its own AgentInstance, and automatically retries failed operations via a background replay queue.

AgentConfig with connection and retry settings.

Logger instance used for structured diagnostic output.

Key public methods:

resolveToolSpanType(toolName): string

Defined in: packages/openclaw-prefactor-plugin/src/agent.ts:429

Resolves a tool name to its span type. Returns the specific span type for supported tools, or the generic fallback.

string

string


stop(): void

Defined in: packages/openclaw-prefactor-plugin/src/agent.ts:470

void


emergencyCleanup(): Promise<void>

Defined in: packages/openclaw-prefactor-plugin/src/agent.ts:477

Promise<void>


finishAgentInstance(sessionKey, status?): Promise<void>

Defined in: packages/openclaw-prefactor-plugin/src/agent.ts:592

string

"complete" | "failed" | "cancelled"

Promise<void>


createSpan(sessionKey, schemaName, payload, parentSpanId?): Promise<string | null>

Defined in: packages/openclaw-prefactor-plugin/src/agent.ts:643

string

string

Record<string, unknown>

string | null

Promise<string | null>


finishSpan(sessionKey, spanId, status?, resultPayload?): Promise<void>

Defined in: packages/openclaw-prefactor-plugin/src/agent.ts:735

string

string

"complete" | "failed" | "cancelled"

Record<string, unknown>

Promise<void>


flushQueue(): Promise<void>

Defined in: packages/openclaw-prefactor-plugin/src/agent.ts:775

Promise<void>