pub trait WorkspaceFacade: Send + Sync {
// Required methods
fn list_peers(&self) -> Vec<PeerStatus>;
fn whoami(&self, caller: &SessionSlot) -> Option<PeerStatus>;
fn deliver_peer_prompt(
&self,
caller: &SessionSlot,
target_project: &str,
wrapped: WrappedPrompt,
) -> Result<(), DeliverError>;
fn handoff(
&self,
caller: &SessionSlot,
note: String,
) -> Result<(), HandoffError>;
}Expand description
The narrow workspace-state surface peer-coordination tools call into. See module docs for design rationale.
Required Methods§
Sourcefn list_peers(&self) -> Vec<PeerStatus>
fn list_peers(&self) -> Vec<PeerStatus>
Snapshot of every configured project’s peer status, in forge.toml declaration order. Computed fresh on each call.
Sourcefn whoami(&self, caller: &SessionSlot) -> Option<PeerStatus>
fn whoami(&self, caller: &SessionSlot) -> Option<PeerStatus>
Identity of the calling session. Returns None when caller
doesn’t resolve to any known project (defensive - the tools
closure-bind a real key at spawn time, so this should be
Some in practice).
Sourcefn deliver_peer_prompt(
&self,
caller: &SessionSlot,
target_project: &str,
wrapped: WrappedPrompt,
) -> Result<(), DeliverError>
fn deliver_peer_prompt( &self, caller: &SessionSlot, target_project: &str, wrapped: WrappedPrompt, ) -> Result<(), DeliverError>
Deliver a wrapped peer prompt to target_project.
The answer is the handler’s own: Ok(()) once the target’s session
took the prompt or it was parked for a spawn the handler kicked off,
Err(UnknownTarget) for a project not in forge.toml, and
Err(DispatchFailed) when the handler refused the delivery. A
delivery that never left forge is never Ok (#2342).
Sourcefn handoff(
&self,
caller: &SessionSlot,
note: String,
) -> Result<(), HandoffError>
fn handoff( &self, caller: &SessionSlot, note: String, ) -> Result<(), HandoffError>
The exit call: the note is accepted only while a handoff is running on
the caller’s own seat. A handoff starts at /handoff or at the
automatic trigger (fill or compaction), which dispatch the command
directly; no caller starts one through here.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl WorkspaceFacade for MockWorkspaceFacade
testing only.