Skip to main content

Module api

Module api 

Source
Expand description

API service module - translated from api/

Re-exports§

pub use empty_usage::*;
pub use error_utils::*;
pub use errors::*;
pub use logging::*;
pub use usage::*;
pub use with_retry::*;

Modules§

empty_usage
Empty usage tracking - translated from emptyUsage.ts
error_utils
API error utilities Extracts connection error details and formats API errors
errors
API error types and utilities translated from TypeScript errors.ts
logging
API logging utilities Handles API query, error, and success logging with analytics
retry_helpers
String-based error predicates for retry decisions.
usage
Usage API - fetches utilization data from the API
with_retry
API retry utilities - canonical implementation translated from withRetry.ts

Structs§

DownloadResult
Result of a file download operation
File
File specification parsed from CLI args Format: –file=<file_id>:<relative_path>
FileMetadata
File metadata returned from list_files_created_after
FilesApiConfig
Configuration for the files API client

Enums§

UploadResult
Result of a file upload operation

Functions§

build_download_path
Normalizes a relative path, strips redundant prefixes, and builds the full download path under {basePath}/{session_id}/uploads/. Returns None if the path is invalid (e.g., path traversal).
download_and_save_file
Downloads a file and saves it to the session-specific workspace directory
download_session_files
Downloads all file attachments for a session
list_files_created_after
List files created after a given timestamp (1P/Cloud mode).
parse_file_specs
Parse file attachment specs from CLI arguments Format: <file_id>:<relative_path>
upload_file
Upload a single file to the Files API (BYOC mode)
upload_session_files
Upload multiple files (BYOC mode)