Skip to content

brandon-coproduct/transducer-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

transducer-api

Protocol Buffer definitions and generated Rust code for the Transducer distributed executor service.

What is Transducer?

Transducer is a distributed executor system for Claude Code workloads. The name comes from automata theory: a finite-state machine that transforms input into output. Transducer agents connect to an orchestrator and execute work using Claude Code, transforming work assignments into execution results.

Architecture

Orchestrator (Server)          Transducer Agents (Clients)
┌─────────────────────┐        ┌─────────────────────────┐
│  gRPC Server        │◄──────►│  gRPC Client            │
│  - Push work        │  mTLS  │  - Register             │
│  - Track progress   │        │  - Heartbeat            │
│  - Collect results  │        │  - Execute via Claude   │
└─────────────────────┘        └─────────────────────────┘

Installation

Add to your Cargo.toml:

[dependencies]
transducer-api = "0.1"

Usage

Client (Transducer Agent)

use transducer_api::{
    TransducerServiceClient, RegisterRequest,
    TransducerCapabilities, TransducerMetadata,
};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let mut client = TransducerServiceClient::connect("http://localhost:4003").await?;

    let response = client.register(RegisterRequest {
        transducer_id: "my-agent".into(),
        capabilities: Some(TransducerCapabilities {
            supported_work_types: vec!["fix_issue".into(), "custom".into()],
            max_concurrent: 2,
            available_tools: vec!["bash".into(), "read".into(), "edit".into()],
            can_access_network: true,
            can_write_files: true,
            model_id: "claude-sonnet-4-20250514".into(),
            max_context_tokens: 200_000,
        }),
        metadata: Some(TransducerMetadata {
            hostname: hostname::get()?.to_string_lossy().into(),
            region: "local".into(),
            ..Default::default()
        }),
    }).await?;

    println!("Registered as: {}", response.into_inner().transducer_id);
    Ok(())
}

Server (Orchestrator)

use transducer_api::{TransducerService, TransducerServiceServer};
use tonic::{Request, Response, Status};

struct MyOrchestrator;

#[tonic::async_trait]
impl TransducerService for MyOrchestrator {
    async fn register(
        &self,
        request: Request<transducer_api::RegisterRequest>,
    ) -> Result<Response<transducer_api::RegisterResponse>, Status> {
        let req = request.into_inner();
        Ok(Response::new(transducer_api::RegisterResponse {
            success: true,
            transducer_id: req.transducer_id,
            error: String::new(),
            ttl_secs: 60,
        }))
    }

    // Implement other methods...
}

API Reference

Service Methods

Method Description
Register Register a transducer with the orchestrator
Heartbeat Bidirectional stream for health and control signals
ReceiveWork Server-push stream of work assignments
ReportProgress Report execution progress mid-flight
SubmitResult Submit completed work results
ListTransducers List registered transducers (admin)
GetStats Get aggregate statistics (admin)
Deregister Gracefully deregister a transducer

Key Types

  • TransducerCapabilities - Describes what a transducer can do
  • TransducerMetadata - Labels and routing information
  • WorkAssignment - Work to be executed
  • ExecutionConfig - Per-execution configuration
  • TokenUsage - Token consumption metrics

Security

Transducer supports SPIFFE/SPIRE mTLS authentication for zero-trust workload identity. In production:

  1. Transducers obtain X.509 SVIDs from the local SPIRE agent
  2. The orchestrator verifies transducer identity via the trust bundle
  3. All communication is encrypted and mutually authenticated

Related Projects

License

MIT OR Apache-2.0

About

gRPC/Protobuf definitions for the Transducer distributed executor system

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages