mirror of
https://github.com/lWolvesl/claw-code.git
synced 2026-04-02 07:41:52 +08:00
31 lines
1.1 KiB
Rust
31 lines
1.1 KiB
Rust
mod client;
|
|
mod error;
|
|
mod prompt_cache;
|
|
mod sse;
|
|
mod types;
|
|
|
|
pub use client::{
|
|
oauth_token_is_expired, read_base_url, resolve_saved_oauth_token, resolve_startup_auth_source,
|
|
AnthropicClient, AuthSource, MessageStream, OAuthTokenSet,
|
|
};
|
|
pub use error::ApiError;
|
|
pub use prompt_cache::{
|
|
CacheBreakEvent, PromptCache, PromptCacheConfig, PromptCachePaths, PromptCacheRecord,
|
|
PromptCacheStats,
|
|
};
|
|
pub use sse::{parse_frame, SseParser};
|
|
pub use types::{
|
|
ContentBlockDelta, ContentBlockDeltaEvent, ContentBlockStartEvent, ContentBlockStopEvent,
|
|
InputContentBlock, InputMessage, MessageDelta, MessageDeltaEvent, MessageRequest,
|
|
MessageResponse, MessageStartEvent, MessageStopEvent, OutputContentBlock, StreamEvent,
|
|
ToolChoice, ToolDefinition, ToolResultContentBlock, Usage,
|
|
};
|
|
|
|
#[cfg(test)]
|
|
pub(crate) fn test_env_lock() -> std::sync::MutexGuard<'static, ()> {
|
|
static LOCK: std::sync::OnceLock<std::sync::Mutex<()>> = std::sync::OnceLock::new();
|
|
LOCK.get_or_init(|| std::sync::Mutex::new(()))
|
|
.lock()
|
|
.unwrap_or_else(std::sync::PoisonError::into_inner)
|
|
}
|