diff options
| author | t <t@tjp.lol> | 2026-06-07 11:39:14 -0600 |
|---|---|---|
| committer | t <t@tjp.lol> | 2026-06-07 11:39:14 -0600 |
| commit | 457ee6a0d56c5a0470e77fca79d3e85f65f51fec (patch) | |
| tree | 4f513379a10fb9db2c792d99933a85f4f7991459 /libpanto/src/root.zig | |
| parent | b14859b9726185ab873356390068e887b7f486d3 (diff) | |
Add public.zig as the libpanto root; delete root.zig
public.zig is now the sole exported root (build.zig points the panto module
at it). It defines the curated public API allowlist: behavioral facades
(Agent/Stream/Conversation wrapping a pointer to the heap-pinned internal),
the ResultParts struct, Pricing, the session seam, and data-type aliases
for the Config/Conversation/Event families.
A clearly-marked transitional block re-exports the internal module
namespaces and the freestanding result-part helpers the panto CLI still
imports directly; Phase 4 trims these as the CLI migrates onto the curated
surface. Stream.Phase is now pub so State can alias it. The refAllDecls
test contract moved from root.zig into public.zig.
Diffstat (limited to 'libpanto/src/root.zig')
| -rw-r--r-- | libpanto/src/root.zig | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/libpanto/src/root.zig b/libpanto/src/root.zig deleted file mode 100644 index fb8c1df..0000000 --- a/libpanto/src/root.zig +++ /dev/null @@ -1,67 +0,0 @@ -const std = @import("std"); - -pub const conversation = @import("conversation.zig"); -pub const provider = @import("provider.zig"); -pub const stream = @import("stream.zig"); -pub const agent = @import("agent.zig"); -pub const config = @import("config.zig"); -pub const sse = @import("sse.zig"); -pub const tool = @import("tool.zig"); -pub const tool_source = @import("tool_source.zig"); -pub const tool_registry = @import("tool_registry.zig"); -pub const session = @import("session.zig"); -pub const session_manager = @import("file_system_jsonl_store.zig"); -pub const session_store = @import("session_store.zig"); -pub const null_store = @import("null_store.zig"); -pub const turn_persist = @import("turn_persist.zig"); -pub const pricing = @import("pricing.zig"); -pub const compaction = @import("compaction.zig"); -pub const image = @import("image.zig"); - -// Re-exports for ergonomic embedder use. -pub const Tool = tool.Tool; -pub const ResultPart = tool.ResultPart; -pub const MediaPart = tool.MediaPart; -pub const freeResultParts = tool.freeResultParts; -pub const textResult = tool.textResult; -pub const ownedTextResult = tool.ownedTextResult; -pub const ToolSource = tool_source.ToolSource; -pub const ToolDecl = tool_source.ToolDecl; -pub const ToolCall = tool_source.Call; -pub const ToolCallResult = tool_source.CallResult; -pub const ToolRegistry = tool_registry.ToolRegistry; -pub const Config = config.Config; -pub const ProviderConfig = config.ProviderConfig; - -// Re-export the pull-streaming surface for embedders. -pub const Event = stream.Event; -pub const Stream = agent.Stream; -pub const Agent = agent.Agent; - -// Internal modules. Not part of the public API — callers drive turns via -// the `Agent` (which holds a swappable `*const Config`): `agent.run()` -// returns a `*Stream` whose `next()` pulls one `Event` at a time. The -// process-global HTTP client is initialized with `config.initHttp` / torn -// down with `config.deinitHttp`. These impls are exposed here only so -// `refAllDecls` picks up their tests. -const openai_chat_json = @import("openai_chat_json.zig"); -const provider_openai_chat = @import("provider_openai_chat.zig"); -const anthropic_messages_json = @import("anthropic_messages_json.zig"); -const provider_anthropic_messages = @import("provider_anthropic_messages.zig"); - -test { - // Test contract: deliberate error-path tests should not produce visible - // log output. Library code logs at `.err` for genuine production failures - // and `.warn` for expected-failure paths exercised by tests; the test - // runner's logger gates on `std.testing.log_level`, which defaults to - // `.warn`. Raising it to `.err` silences expected warnings without - // changing production behavior. Anything that *should* be visible in a - // passing test must use `std.debug.print` or assert via the testing API. - std.testing.log_level = .err; - - std.testing.refAllDecls(@This()); - std.testing.refAllDecls(openai_chat_json); - std.testing.refAllDecls(provider_openai_chat); - std.testing.refAllDecls(anthropic_messages_json); - std.testing.refAllDecls(provider_anthropic_messages); -} |
