summaryrefslogtreecommitdiff
path: root/libpanto/src/root.zig
blob: b882be5941390c64cb198e990b59ff1d7e98e5be (plain)
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
const std = @import("std");

pub const conversation = @import("conversation.zig");
pub const provider = @import("provider.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("session_manager.zig");
pub const pricing = @import("pricing.zig");
pub const compaction = @import("compaction.zig");

// Re-exports for ergonomic embedder use.
pub const Tool = tool.Tool;
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;

// Internal modules. Not part of the public API — callers drive turns via
// `provider.streamStep(allocator, io, &config, conv, receiver)` (or via the
// `Agent`, which holds a swappable `*const Config`). 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);
}