index
@providerprotocol/agents / index
@providerprotocol/agents - Unified Agent Protocol (UAP) 1.0 Implementation
UAP provides agent abstractions built on @providerprotocol/ai (UPP-1.2):
- Functional state management with immutable AgentState
- Decoupled execution strategies (loop, react, plan)
- Middleware pipeline for cross-cutting concerns
- Thread trees for branching conversations
Core Philosophy: “UAP is a pipe, not a nanny.” The protocol provides orchestration primitives; the developer provides the constraints.
Example
Section titled “Example”import { agent, AgentState } from '@providerprotocol/agents';import { react } from '@providerprotocol/agents/execution';import { logging } from '@providerprotocol/agents/middleware';import { anthropic } from '@providerprotocol/ai/anthropic';
const coder = agent({ model: anthropic('claude-sonnet-4-20250514'), execution: react(), tools: [Bash, Read, Write], system: 'You are an expert software engineer.', middleware: [logging({ level: 'info' })],});
const state = AgentState.initial();const { turn, state: newState } = await coder.generate('Fix the bug', state);console.log(turn.response.text);Classes
Section titled “Classes”Interfaces
Section titled “Interfaces”- Agent
- AgentOptions
- AgentRef
- AgentStateInterface
- AgentStateJSON
- AgentStrategy
- AgentStreamEvent
- AgentStreamResult
- CheckpointData
- CheckpointMetadata
- CheckpointStore
- CreateSubAgentToolOptions
- ExecutionContext
- ExecutionGroup
- ExecutionPlan
- ExecutionResult
- ExecutionStrategy
- FileCheckpointOptions
- GenerateResult
- InjectToolContextOptions
- LoggingOptions
- LoopOptions
- Middleware
- MiddlewareContext
- OrderedToolCall
- PlanOptions
- PlanStep
- ReactOptions
- SubagentEndEvent
- SubagentEventBase
- SubagentExecutionTrace
- SubagentExecutionTraceJSON
- SubagentInnerEvent
- SubagentStartEvent
- ThreadNodeJSON
- ThreadTreeJSON
- ToolDependencyOptions
- ToolExecutionContext
- ToolExecutionResult
- ToolExecutionTrace
- ToolWithDependencies
Type Aliases
Section titled “Type Aliases”- ContextAwareToolRun
- OnSubagentEvent
- PlanStepStatus
- SubagentEvent
- SubagentEventType
- SubAgentToolRun
- ToolExecutor
- UAPEventType
Functions
Section titled “Functions”- agent
- createSubAgentTool
- executeOrderedToolCalls
- hasCallDependencies
- hasToolDependencies
- injectToolContext
- isContextAwareTool
- orderToolCalls
- withToolContext
References
Section titled “References”ThreadNode
Section titled “ThreadNode”Re-exports ThreadNode
ThreadTree
Section titled “ThreadTree”Re-exports ThreadTree