@agorio/sdkDocs


Class: ShoppingAgent

Constructors

new ShoppingAgent()

new ShoppingAgent(options): ShoppingAgent

Parameters

options: AgentOptions

Returns

ShoppingAgent

Defined in

src/agent/shopping-agent.ts:107

Methods

getActiveMerchant()

getActiveMerchant(): null | string

Get the active merchant domain.

Returns

null | string

Defined in

src/agent/shopping-agent.ts:560


getCart()

getCart(): CartState

Get the current cart state (active merchant’s cart).

Returns

CartState

Defined in

src/agent/shopping-agent.ts:540


getMerchants()

getMerchants(): string[]

Get all discovered merchants.

Returns

string[]

Defined in

src/agent/shopping-agent.ts:553


getPlugins()

getPlugins(): string[]

Get the names of all registered plugins.

Returns

string[]

Defined in

src/agent/shopping-agent.ts:533


run()

run(task): Promise<AgentResult>

Run the agent with a user task.

The agent will use the LLM to reason about the task, call tools to interact with the UCP merchant, and return the final result.

Parameters

task: string

Returns

Promise<AgentResult>

Defined in

src/agent/shopping-agent.ts:222


runStream()

runStream(task): AsyncGenerator<AgentStreamEvent, any, any>

Run the agent with streaming output.

Yields AgentStreamEvent objects as the agent reasons and acts. If the LLM adapter supports chatStream(), text is streamed in real-time. Otherwise, falls back to chat() and emits the full text as a single delta.

Parameters

task: string

Returns

AsyncGenerator<AgentStreamEvent, any, any>

Defined in

src/agent/shopping-agent.ts:351