AgentOperations
The agent.* operations.
Extended by
Section titled “Extended by”Properties
Section titled “Properties”readonly agent: string;The agent's ID.
conversation
Section titled “conversation”readonly conversation: string | undefined;The conversation the methods act on. undefined for the agent's own history.
Methods
Section titled “Methods”read()
Section titled “read()”read(options?): Promise<AgentSnapshot>;Read what an agent is doing now.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options? |
CallOptions |
Returns
Section titled “Returns”Promise<AgentSnapshot>
define()
Section titled “define()”define(input?, options?): Promise<AgentSnapshot>;Define an agent.
Starts the agent the definition describes, or brings the one running to it from its next turn. A definition put again replaces the last. A key nothing here supports yet answers not_supported, naming it.
Acts on the agent, never a conversation.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input? |
AgentDefinition |
options? |
CallOptions |
Returns
Section titled “Returns”Promise<AgentSnapshot>
forget()
Section titled “forget()”forget(options?): Promise<void>;Forget an agent.
Acts on the agent, never a conversation.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options? |
CallOptions |
Returns
Section titled “Returns”Promise<void>
ask(input, options?): Promise<{ id: string; cursor: string;}>;Send an agent a message.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input |
Ask |
options? |
CallOptions |
Returns
Section titled “Returns”Promise<{
id: string;
cursor: string;
}>
decide()
Section titled “decide()”decide(input, options?): Promise<object[]>;Approve or reject the calls an agent waits on.
The decisions are taken together and recorded as the caller's. A rejection's reason is what the model is told in place of the call's answer. An approval's note is what it reads beside the answer.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input |
Decisions |
options? |
CallOptions |
Returns
Section titled “Returns”Promise<object[]>
authorization()
Section titled “authorization()”authorization(interrupt, options?): Promise<Authorization>;Read where a person authorizes a call.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
interrupt |
string |
options? |
CallOptions |
Returns
Section titled “Returns”Promise<Authorization>
cancel()
Section titled “cancel()”cancel(options?): Promise<void>;Stop what an agent is doing.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options? |
CallOptions |
Returns
Section titled “Returns”Promise<void>
events()
Section titled “events()”events(input?, options?): Promise<Events>;Read an agent's log.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
input? |
{ types?: string[]; after?: string; limit?: number; } |
- |
input.types? |
string[] |
The event types to read, as wardrik.run.completed, given once for each. Every type where left out. A wardrik.events.dropped comes whatever the types. |
input.after? |
string |
The cursor to read after: a page's next, the id of an event a stream gave, or a snapshot's cursor. |
input.limit? |
number |
How many to read, 100 unless set. |
options? |
CallOptions |
- |
Returns
Section titled “Returns”Promise<Events>
streamEvents()
Section titled “streamEvents()”streamEvents(input?, options?): EventStream;Like events, then follows each new event as it's written. Starts after after, or at
the end of the log. See EventStream.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
input? |
{ types?: string[]; after?: string; } |
- |
input.types? |
string[] |
The event types to read, as wardrik.run.completed, given once for each. Every type where left out. A wardrik.events.dropped comes whatever the types. |
input.after? |
string |
The cursor to read after: a page's next, the id of an event a stream gave, or a snapshot's cursor. |
options? |
StreamOptions |
- |
Returns
Section titled “Returns”timeline()
Section titled “timeline()”timeline(options?): Promise<Timeline>;Read an agent's conversation as a person reads it.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options? |
CallOptions |
Returns
Section titled “Returns”Promise<Timeline>
runs()
Section titled “runs()”runs(options?): Promise<Runs>;Read what an agent's runs did and cost.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options? |
CallOptions |
Returns
Section titled “Returns”Promise<Runs>
approve()
Section titled “approve()”approve( interrupt, input?, options?): Promise<object[]>;Approve a call an agent waits on.
agent.decide with one approval. Recorded as the caller's.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
interrupt |
string |
input? |
Approve |
options? |
CallOptions |
Returns
Section titled “Returns”Promise<object[]>
deny()
Section titled “deny()”deny( interrupt, input?, options?): Promise<object[]>;Reject a call an agent waits on.
agent.decide with one rejection. Recorded as the caller's.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
interrupt |
string |
input? |
Deny |
options? |
CallOptions |
Returns
Section titled “Returns”Promise<object[]>
definition()
Section titled “definition()”definition(options?): Promise<DefinitionRead>;Read an agent's definition.
Acts on the agent, never a conversation.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options? |
CallOptions |
Returns
Section titled “Returns”Promise<DefinitionRead>
spawn()
Section titled “spawn()”spawn(options?): Promise<AgentSummary>;Start an agent.
Acts on the agent, never a conversation.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options? |
CallOptions |
Returns
Section titled “Returns”Promise<AgentSummary>
stop()
Section titled “stop()”stop(options?): Promise<AgentSummary>;Stop an agent.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options? |
CallOptions |
Returns
Section titled “Returns”Promise<AgentSummary>
clear()
Section titled “clear()”clear(options?): Promise<AgentSnapshot>;Clear an agent's history.
Empties its history. The agent, its definition and its other conversations stay. Answers conflict while it runs a turn or waits on a person.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options? |
CallOptions |
Returns
Section titled “Returns”Promise<AgentSnapshot>
calls()
Section titled “calls()”calls(options?): Promise<object[]>;List the tool calls an agent is running.
Answers not_found while the agent sleeps.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options? |
CallOptions |
Returns
Section titled “Returns”Promise<object[]>
kill()
Section titled “kill()”kill(call, options?): Promise<void>;Stop one tool call.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
call |
string |
options? |
CallOptions |
Returns
Section titled “Returns”Promise<void>
triggerSet()
Section titled “triggerSet()”triggerSet( trigger, input?, options?): Promise<TriggerDefinition>;Set one of an agent's triggers.
Sets or changes one trigger of an agent with a definition, which keeps it; not_found where it has none. A trigger whose every and timezone stay keeps its next run.
Acts on the agent, never a conversation.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
trigger |
string |
input? |
TriggerDefinition |
options? |
CallOptions |
Returns
Section titled “Returns”Promise<TriggerDefinition>
triggerRemove()
Section titled “triggerRemove()”triggerRemove(trigger, options?): Promise<TriggerDefinition>;Remove one of an agent's triggers.
Acts on the agent, never a conversation.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
trigger |
string |
options? |
CallOptions |
Returns
Section titled “Returns”Promise<TriggerDefinition>
move()
Section titled “move()”move(input, options?): Promise<AgentSummary>;Move an agent to another node.
Starts the agent again on node, as it was. A turn it's taking ends, and what it waits on is abandoned, so ask it again once it's moved.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input |
Node |
options? |
CallOptions |
Returns
Section titled “Returns”Promise<AgentSummary>