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
46
47
48
49
50
51
52
53
54
55
56
57
//! # paladin-ports
//!
//! Port trait definitions for the Paladin multi-agent orchestration framework.
//!
//! This crate sits at the **application boundary** of the hexagonal architecture,
//! defining the abstract contracts (ports) that connect the core domain to external
//! infrastructure. It depends only on [`paladin-core`] and standard utility crates —
//! never on infrastructure SDKs, database drivers, or LLM provider libraries.
//!
//! ## Hexagonal Architecture Position
//!
//! ```text
//! ┌─────────────────────────────────────────────────────────┐
//! │ Infrastructure Layer │
//! │ (adapters: OpenAI, SQLite, Redis, MinIO, MCP, …) │
//! │ implements ↓ these ports │
//! ├─────────────────────────────────────────────────────────┤
//! │ paladin-ports ◄── YOU ARE HERE │
//! │ output/: LlmPort, GarrisonPort, CitadelPort, … │
//! │ input/: ContentInputPort, DocumentPort, … │
//! │ depends on ↓ │
//! ├─────────────────────────────────────────────────────────┤
//! │ paladin-core │
//! │ (domain entities, value objects, aggregates) │
//! └─────────────────────────────────────────────────────────┘
//! ```
//!
//! ## Modules
//!
//! - [`output`] — Port traits implemented by infrastructure adapters (LLM providers,
//! storage backends, queue brokers, tool registries, etc.)
//! - [`input`] — Port traits representing API boundaries into the application
//! (content ingestion, RPC services, document processing, etc.)
//!
//! ## Dependency Policy
//!
//! `paladin-ports` must **never** introduce dependencies on:
//! - LLM provider SDKs (`openai`, `anthropic`, etc.)
//! - Database drivers (`sqlx`, `redis`, etc.)
//! - Storage clients (`aws-sdk-s3`, `minio`, etc.)
//! - HTTP clients (`reqwest`) in an infrastructure capacity
//!
//! All such dependencies belong exclusively in the infrastructure adapters that
//! implement these port traits.
// Some port files contain cross-crate doc links (e.g. `crate::infrastructure::…`)
// that resolved in the original `paladin` crate but are unavailable in this
// isolated crate. Downgrade from deny → warn so `cargo doc` still succeeds.
/// Input port traits — defines how external stimuli enter the application.
/// Output port traits — defines how the application reaches external systems.