Skip to main content
Agent is an alias for AgentRuntime from @cline/agents.

Constructor

AgentRuntimeConfig accepts either:
  • a prebuilt model: AgentModel, or
  • providerId, modelId, and optional provider credentials (apiKey, baseUrl, headers).
Common fields:

Methods

run(input)

Starts a run with input.

continue(input?)

Continues with optional new input.

abort(reason?)

Aborts the active run.

subscribe(listener)

Subscribes to AgentRuntimeEvent events.

restore(messages)

Replaces conversation history and resets runtime state while preserving tools, hooks, model, agent identity, and subscribers.

snapshot()

Returns an AgentRuntimeStateSnapshot.

AgentRunResult

Factories