Pebbling Protocol Types
The Pebbling Protocol defines a comprehensive set of type definitions for communication between agents and the Pebbling framework. These types ensure type-safe, structured communication across all system components.Core Communication Types
Message Parts
The protocol supports multi-part messages with different content types:TextPart
FilePart
DataPart
Core Protocol Entities
Artifacts
Artifacts represent the final output generated by an agent after completing a task. They are immutable data structures containing the results of agent execution.- Immutable: Once created, artifacts cannot be modified
- Multi-part: Can contain text, files, and structured data
- Streamable: Parts can be appended during streaming responses
- Traceable: Each artifact has a unique ID for reference
Messages
Messages represent all non-result communication in the Pebbling protocol, carrying operational content like instructions, status updates, and metadata.- User Instructions: Task requests with context and files
- Agent Communication: Status updates, thoughts, coordination
- System Messages: Errors, warnings, protocol information
- Context Sharing: Background information, references, metadata
Tasks
Tasks serve as the primary coordination mechanism, managing the complete lifecycle from request to completion.- Message Exchange: Facilitate communication between clients and agents
- State Management: Track task progress and execution status
- Artifact Collection: Gather and organize agent-generated outputs
- History Tracking: Maintain complete conversation and decision trail
- Creation: Client initiates task with initial message/requirements
- Processing: Agent processes messages and updates status
- Communication: Bidirectional message exchange as needed
- Artifact Generation: Agent produces deliverable outputs
- Completion: Final status update and artifact delivery
Contexts
Contexts serve as conversation containers, managing the complete interaction lifecycle between clients and agents.- Session Management: Group related tasks under a unified conversation
- History Preservation: Maintain complete message history across tasks
- Context Continuity: Preserve conversation state and references
- Metadata Tracking: Store session-level information and preferences
File Types
FileWithBytes
FileWithUri
Task Status
Type Aliases
Task States
Roles
Run Modes
Trust Levels
Error Codes
Negotiation Status
Identity Provider
Security & Authentication
The protocol supports multiple security schemes for API authentication:HTTP Security Scheme
API Key Security Scheme
OAuth2 Security Scheme
Agent Execution & Credits
The protocol includes types for managing agent execution costs and credit-based billing:Agent Execution Cost
Execution Request/Response
Negotiation System
The protocol supports agent-to-agent negotiations:Negotiation Proposal
Negotiation Session
Push Notifications
Support for real-time notifications outside of connected sessions:Event Types
The protocol defines events for real-time updates:Task Status Update Event
Task Artifact Update Event
JSON-RPC Protocol
The protocol uses JSON-RPC 2.0 for communication:Base JSON-RPC Types
Predefined Error Types
- JSONParseError (-32700): Failed to parse JSON payload
- InvalidRequestError (-32600): Request validation failed
- MethodNotFoundError (-32601): Method not available
- InvalidParamsError (-32602): Invalid parameters
- InternalError (-32603): Internal server error
- TaskNotFoundError (-32001): Task ID not found
- TaskNotCancelableError (-32002): Task cannot be canceled
- ContextNotFoundError (-32003): Context ID not found
- ContextNotCancelableError (-32004): Context cannot be canceled
- PushNotificationNotSupportedError (-32005): Push notifications not supported
- UnsupportedOperationError (-32006): Operation not supported
- ContentTypeNotSupportedError (-32007): Content type not supported
- InvalidAgentResponseError (-32008): Agent response invalid
Request/Response Types
Agent System
Agent Identity
Agent Trust
Agent Capabilities
Agent Card
Parameter Types
Message Configuration
Task Parameters
Context Parameters
Push Notification Parameters
Union Types
Discriminated Unions
Implementation Notes
- All types use Pydantic for validation and serialization
- CamelCase conversion is handled automatically via
alias_generator
- UUID types ensure unique identification across the system
- TypedDict provides static type checking while maintaining runtime flexibility
- Discriminated unions enable type-safe polymorphism for different message/artifact types
- Generic types allow for flexible request/response patterns
- TypeAdapters are provided for runtime validation and serialization