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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/*
lib.rs — The crate root of yo-core (phi-core).
RUST QUIRK: `mod` vs `use` — Declaration vs Import
`mod foo;` — "this crate has a module called foo, load it from foo.rs (or foo/mod.rs)"
Python analogy: nothing direct, but closest is the implicit __init__.py that
makes a directory a package. In Rust, you must explicitly declare every module.
`pub mod foo;` — same, but the module is publicly accessible to crate users.
Private modules (without `pub`) can still be used inside this crate.
`use foo::Bar;` — "bring Bar into scope by name" (no declaration, just aliasing)
Python analogy: `from foo import Bar`
`pub use foo::Bar;` — "bring Bar into scope AND re-export it as part of THIS module's public API"
Python analogy: `from foo import Bar` in __init__.py (making it top-level)
RUST QUIRK: `pub use types::*;`
The `*` glob re-export makes every public item in `types` available directly from `yo_core::`.
So users can write `use yo_core::AgentTool` instead of `use yo_core::types::AgentTool`.
This is a deliberate ergonomic choice — types are the most-used exports, so flattening them
to the crate root reduces import noise.
RUST QUIRK: `#[cfg(feature = "openapi")]`
Feature flags gate optional compilation. The `openapi` feature is listed in Cargo.toml under
`[features]`. Without it, the openapi module is completely absent from the compiled binary —
zero size, zero compile time. This is Rust's equivalent of optional dependencies / extras.
Cargo.toml: [features] openapi = ["dep:utoipa"]
Enable: cargo build --features openapi
In code: #[cfg(feature = "openapi")] pub mod openapi;
Architecture summary: the `pub use` lines below define the "public API surface" of phi-core.
Everything a library user needs should be reachable without knowing internal module paths.
*/
// retry.rs moved to provider/retry.rs
// skills.rs moved to context/skills.rs
// Feature-gated OpenAPI integration. Enabled with: cargo build --features openapi
// Re-export the most-used types at the crate root for ergonomic imports.
// Users write `use phi_core::Agent` / `use phi_core::BasicAgent` instead of
// navigating internal module paths.
pub use ;
pub use ;
pub use SubAgentTool;
pub use ;
pub use ;
pub use SkillSet;
pub use ;
pub use RetryConfig;
pub use ;
pub use *; // glob re-export: ALL public items from types become top-level exports