Skip to main content

Import

Examples

Basic agent

Agent with tools

Agent with materialized runtime tools

Agent with skills

Streaming API route

Multi-agent composition

API

agent(config)

Agent helper. Returns: Agent

createHostedRunEventWriterCapability(input)

Create an exact-run event-writer capability from a credential verified by trusted ingress. General user API tokens are not run-event credentials. The returned frozen object does not expose or serialize the credential. Returns: HostedRunEventWriterCapability

agent.generate(input)

Run the agent and return a complete response. Accepts a string or message array as input. Returns: Promise<AgentResponse>

agent.stream(input)

Run the agent and stream the response. Returns a result with .toDataStreamResponse() for API routes. Returns: Promise<AgentStreamResult>

agent.respond(request)

Handle an incoming HTTP request and return a streaming Response. Reads messages from the request body. Returns: Promise<Response>

agent.getMemory()

Get the agent’s memory instance. Returns: Memory<Message>

agent.getMemoryStats()

Get memory usage statistics (message count, estimated tokens, type). Returns: Promise<{ totalMessages: number; estimatedTokens: number; type: string }>

agent.clearMemory()

Clear all stored messages from memory. Returns: Promise<void>

hostedRunEventWriterCapability.mintChildRunEventWriterCapability(childRunId, abortSignal)

Exchange this run’s authority for an exact direct-child capability. Returns: Promise<HostedRunEventWriterCapability>

Type Reference

ParsedHostedChatRequest

Request payload for parsed hosted chat.

PrepareHostedConversationRootRunContextInput

Input for hosted root-run preparation.

HostedDurableChildForkRunContextInput

Input for a hosted durable child fork context.

ExecuteHostedChildForkWithPreparedToolsInput

Input for a hosted child fork whose tools are already prepared. Durable execution requires a capability bound to durableChildRun.childRunId.

ExecuteHostedDurableChildForkInput

Input for bootstrapping and executing a hosted durable child fork. runEventWriterCapability carries exact-parent authority; this helper mints the exact-child capability only after the child run is persisted.

DefaultHostedInvokeAgentToolOptions

Options for the default hosted invoke-agent tool. runEventWriterCapability carries the current parent run’s authority and is delegated internally after each durable child run is persisted.

HostedDurableRunStartExecutionInput

Input delivered to a hosted durable-run starter after request isolation.

HostedAgentServiceDetachedExecutionInput

Input delivered to a hosted agent-service detached execution callback.

Exports

Components

Functions

Classes

Types

Constants

Deep imports

These import paths group focused functionality under this module. Each is a separate barrel; import only what you need.

veryfront/agent/identity

Components

Functions

Types