Skip to main content

inline_sdk/
lib.rs

1//! Thin Rust SDK for Inline.
2//!
3//! This crate contains the reusable pieces for API calls, uploads, client
4//! metadata, and the realtime RPC transport. It deliberately stays lower-level
5//! than the future stateful `inline-client` crate: callers own cache and sync
6//! policy here.
7//!
8//! The SDK follows normal Rust library logging practice: it emits diagnostics
9//! through the `log` facade and never initializes a logger. Parent applications
10//! decide whether to install `env_logger`, `tracing-log`, a platform logger, or
11//! no logger at all. SDK logs avoid bearer tokens, auth challenges, request and
12//! response bodies, local file paths, URL query strings, message text, and
13//! attachment contents. Public `Debug` implementations on token-bearing SDK
14//! types, URL-bearing builders/errors, and local-file upload inputs redact
15//! secret fields, credentials, query strings, and local paths for the same
16//! reason.
17//!
18//! Public error enums are `#[non_exhaustive]` so the SDK can add more precise
19//! API and transport failures without a breaking release. Match specific
20//! variants when useful and keep a fallback arm for future variants.
21//!
22//! ```no_run
23//! use inline_sdk::{ApiClient, ClientIdentity};
24//!
25//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
26//! let api = ApiClient::builder("https://api.inline.chat")
27//!     .identity(ClientIdentity::try_new("my-agent", "0.1.0")?)
28//!     .build()?;
29//! # let _ = api;
30//! # Ok(())
31//! # }
32//! ```
33
34#![warn(missing_docs)]
35#![forbid(unsafe_code)]
36
37pub mod api;
38pub mod client_info;
39pub mod realtime;
40
41pub use api::{
42    ApiClient, ApiClientBuilder, ApiError, CreateLinearIssueInput, CreateLinearIssueResult,
43    CreateNotionTaskInput, CreateNotionTaskResult, CreatePrivateChatResult, DEFAULT_API_TIMEOUT,
44    PeerId, ReadMessagesInput, ReadMessagesResult, SendCodeResult, UploadFileInput,
45    UploadFileResult, UploadFileType, UploadFileTypeParseError, UploadVideoMetadata,
46    VerifyCodeResult,
47};
48pub use client_info::{AuthMetadata, ClientIdentity, ClientIdentityError};
49pub use inline_protocol::proto;
50pub use realtime::{
51    DEFAULT_CONNECT_TIMEOUT, DEFAULT_RPC_TIMEOUT, RealtimeClient, RealtimeClientBuilder,
52    RealtimeError, RpcRequest,
53};
54
55/// Convenient imports for common SDK consumers.
56pub mod prelude {
57    pub use crate::{
58        ApiClient, ApiClientBuilder, ApiError, AuthMetadata, ClientIdentity, ClientIdentityError,
59        CreateLinearIssueInput, CreateLinearIssueResult, CreateNotionTaskInput,
60        CreateNotionTaskResult, CreatePrivateChatResult, DEFAULT_API_TIMEOUT,
61        DEFAULT_CONNECT_TIMEOUT, DEFAULT_RPC_TIMEOUT, PeerId, ReadMessagesInput,
62        ReadMessagesResult, RealtimeClient, RealtimeClientBuilder, RealtimeError, RpcRequest,
63        SendCodeResult, UploadFileInput, UploadFileResult, UploadFileType,
64        UploadFileTypeParseError, UploadVideoMetadata, VerifyCodeResult, proto,
65    };
66}