Skip to main content

Module dcp

Module dcp 

Source
Expand description

DCP (Development Context Protocol) Integration

This module provides integration with the DCP crate for high-performance AI tool communication. DCP is our MCP competitor with 10-1000x performance improvements while maintaining backward compatibility.

§Features

  • Binary Message Envelope (BME) protocol support
  • Zero-Copy Tool Invocation (ZCTI)
  • MCP compatibility via McpAdapter
  • Capability manifest support
  • Ed25519 signing for secure tool definitions

§Usage

use driven::dcp::{DcpClient, DcpConfig};

let config = DcpConfig::default();
let mut client = DcpClient::new(config);

// Connect to a DCP server
client.connect("tcp://localhost:9000")?;

// Invoke a tool
let result = client.invoke_tool(tool_id, &args)?;

// Or use MCP fallback
let result = client.invoke_tool_mcp(&json_rpc_request)?;

Modules§

ChunkFlags
Chunk flag constants
Flags
Flag bits

Structs§

BinaryMessageEnvelope
Binary Message Envelope - 8 bytes fixed header
CapabilityManifest
Pre-computed capability manifest
CapabilityStats
Statistics about the current capability manifest
DcpClient
DCP client for AI tool communication
DcpConfig
DCP client configuration
DcpMessage
DCP message representing a complete binary message with envelope and payload
JsonRpcError
JSON-RPC 2.0 error object
JsonRpcParser
JSON-RPC parser
JsonRpcRequest
JSON-RPC 2.0 request
JsonRpcResponse
JSON-RPC 2.0 response
McpAdapter
MCP to DCP adapter
SharedArgBuffer
Shared memory buffer for zero-copy argument passing
SignedInvocation
Signed invocation with replay protection
SignedToolDef
Ed25519 signed tool definition
Signer
Ed25519 signer for creating signatures
StreamAssembler
Stream assembler for handling chunked streaming messages
StreamBuilder
Stream builder for creating chunked streaming messages
StreamChunk
Binary stream chunk - 7 bytes header
ToolDefinition
Tool definition
ToolInvocation
Zero-copy tool invocation
Verifier
Ed25519 verifier for checking signatures
ZctiBuilder
Zero-Copy Tool Invocation (ZCTI) builder
ZctiReader
Zero-Copy Tool Invocation (ZCTI) reader

Enums§

AdapterError
Adapter errors
ArgType
Argument types encoded in arg_layout
ConnectionState
Connection state
InvocationResult
Result of a tool invocation
MessageType
Message types enumeration
Protocol
Protocol type
RequestId
JSON-RPC request ID (can be string, number, or null)

Functions§

create_envelope
Create a Binary Message Envelope
parse_envelope
Parse a Binary Message Envelope from bytes