Expand description
Channel-based Agent handle - the public consumer surface.
Agent::spawn constructs a ForgeSdkBridge under the hood and
spawns one background task: the command dispatcher, which
drains mpsc::UnboundedReceiver<AgentCommand> and calls the matching
inherent method on the bridge. The bridgeβs AgentEvent
receiver is handed back to consumers via take_events().
Direct-return accessors (config_dir, settings_documents, etc.)
live on AgentHandle as method passthroughs to the bridge.
Re-exportsΒ§
use std::collections::HashMap;πuse std::path::Path;πuse std::path::PathBuf;πuse std::sync::Arc;πuse forge_primitives::AgentCommand;πuse forge_primitives::PermissionMode;πuse parking_lot::Mutex;πuse tokio::sync::mpsc;πuse tracing::Instrument;πuse crate::forge_sdk_bridge::ForgeSdkBridge;π
StructsΒ§
- Agent
- Agent factory - wraps a private
ForgeSdkBridgebehind a channel API. - Agent
Handle - Handle returned by
Agent::spawn. Owns the channels + a thin passthrough to the bridgeβs direct-return accessors.
EnumsΒ§
- Agent
Error - Errors surfaced from
AgentHandleβs fire-and-forget command methods. The underlyingclaudesubprocess work flows back asynchronously via the events stream - these are dispatch-time failures only.
FunctionsΒ§
- decode_
launch_ πsettings - Decode launch settings off the dispatcher channel. Symmetric to the
encode-side
?-propagation inAgentHandle::new_session. - dispatch π
- Dispatch one
AgentCommandto the matchingForgeSdkBridgemethod. Internal - kept onanyhowbecause the bridge surface itself returnsanyhow::Resultand the dispatcher task only logs the error before continuing. The public AgentHandle surface above uses the typedAgentError. - dispatch_
commands π