1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//! [`AgentFactoryPort`] — materialize an [`AgentPort`] from a typed
//! descriptor.
//!
//! Callers (the composition root and the `RegisterAgent` RPC) do not
//! construct agent implementations directly; they hand a descriptor to
//! this factory and receive a live handle back. That keeps the set of
//! wired providers (vLLM, Anthropic, OpenAI, rule-based, human-in-the-
//! loop, …) behind Cargo features at the adapter layer, exactly like
//! every other provider-specific concern in this crate.
//!
//! The `kind` field in [`AgentDescriptor`] names the provider the
//! factory should dispatch to. Adapters return
//! [`DomainError::InvariantViolated`] when asked for a kind they do
//! not support; the composition root is responsible for wiring a
//! factory that recognises every kind the deployment intends to accept.
use Arc;
use async_trait;
use ;
use crateDomainError;
use crateAgentPort;
use crate;
/// Everything the factory needs to build a live agent. Mirrors the
/// `AgentSummary` proto, but kept in domain shapes so use cases never
/// touch wire types.