TypeScript SDK
Use Circuit CLI to create and deploy agents using this SDK
Install the SDK
bun add @circuitorg/agent-sdkAgent Constructor
Agent ConstructorSignature
new Agent({
runFunction: (agent: AgentContext) => Promise<void>,
unwindFunction?: (agent: AgentContext) => Promise<void>
});Parameters
Param
Type
Description
Examples
import { Agent, type AgentContext, type CurrentPosition } from "@circuitorg/agent-sdk";
async function run(agent: AgentContext): Promise<void> {
await agent.log("Starting execution");
}
async function unwind(agent: AgentContext, positions: CurrentPosition[]): Promise<void> {
await agent.log("Unwinding execution");
}
const agent = new Agent({
runFunction: run,
unwindFunction: unwind
});
// For Circuit deployment
export default agent.getExport();AgentContext Interface
AgentContext InterfaceSession Data
Property
Type
Description
Core Methods
Method
Description
Namespace
Namespace
Description
Last updated