Skip to content

Class: AgentInstanceManager

Prefactor TypeScript SDK


Prefactor TypeScript SDK / @prefactor/core / AgentInstanceManager

Defined in: packages/core/src/agent/instance-manager.ts:20

Coordinates agent instance lifecycle and schema registration for a transport.

new AgentInstanceManager(transport, options): AgentInstanceManager

Defined in: packages/core/src/agent/instance-manager.ts:24

Transport

AgentInstanceManagerOptions

AgentInstanceManager

ensureTokenValid(): Promise<void>

Defined in: packages/core/src/agent/instance-manager.ts:36

Validates the configured API token against the Prefactor ping endpoint.

Runs once per manager instance; subsequent calls return the same promise.

Promise<void>

When the token is invalid, expired, or unauthorized.


registerSchema(schema): void

Defined in: packages/core/src/agent/instance-manager.ts:45

Record<string, unknown>

void


startInstance(options?): void

Defined in: packages/core/src/agent/instance-manager.ts:61

AgentInstanceOptions = {}

void


finishInstance(): void

Defined in: packages/core/src/agent/instance-manager.ts:70

void


recordQuality(options): void

Defined in: packages/core/src/agent/instance-manager.ts:78

Records a quality payload on the agent instance for a named quality schema. A null payload removes the recorded value for that name.

AgentInstanceRecordQualityOptions

void


getAgentInstanceId(): string | null

Defined in: packages/core/src/agent/instance-manager.ts:85

string | null