Skip to content

symposium-dev/decaf-mod

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Decaf

Debouncing proxy for ACP. Agents often send AgentMessageChunk notifications word-by-word, creating a flood of tiny messages. Decaf coalesces these chunks, forwarding a single combined chunk every N milliseconds instead.

As a library

use decaf_mod::Decaf;
use std::time::Duration;

// In a proxy chain
ProxiesAndAgent::new(my_agent)
    .proxy(Decaf::new(Duration::from_millis(100)));

// Standalone
Decaf::new(Duration::from_millis(100))
    .run(transport)
    .await?;

Decaf implements ConnectTo<Conductor>, so it plugs directly into SACP proxy chains.

As a binary

decaf-mod [interval_ms]

Runs as an ACP proxy over stdin/stdout. The optional argument sets the debounce interval in milliseconds (default: 100).

How it works

Decaf intercepts AgentMessageChunk notifications from the agent side and buffers the text content per session. Buffered text is flushed to the client on three triggers:

  • Timer tick at the configured interval
  • Non-text notification from the agent (flush first to preserve ordering, then forward)
  • PromptResponse from the agent (flush before forwarding so no text is lost)

License

Licensed under either of Apache License, Version 2.0 or MIT License at your option.

About

"Debouncer" for ACP messages

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages