Crate xfiles

Crate xfiles 

Source
Expand description

§xfiles - Twitter as a filesystem for agents

xfiles is a Rust crate that treats Twitter as a public, append-only, log-structured filesystem. Tweets become “files”, replies become “commits”, and a local SQLite index keeps traversal fast.

§Features

  • Tweet = file root
  • Reply = commit
  • Append-only versioning
  • SQLite graph index
  • History, read, write APIs
  • Chunking for long content

§Example

use xfiles::{XFS, OpenMode};

let mut fs = XFS::connect(
    "@myagent",
    "api_key",
    "api_secret",
    "access_token",
    "access_token_secret"
).await?;
let mut file = fs.open("memory.txt", OpenMode::Create).await?;
file.write(b"Day 1: Agent bootstrapped").await?;

Re-exports§

pub use error::Result;
pub use error::XFilesError;
pub use fs::XFile;
pub use fs::chunk::TWEET_MAX_SIZE;
pub use dag::Commit;
pub use dag::TweetId;
pub use remote::RemoteAdapter;
pub use remote::MockAdapter;

Modules§

dag
DAG (Directed Acyclic Graph) layer for commit history
error
Error types for xfiles
fs
Filesystem abstraction layer
remote
Remote API adapter layer
store
Local storage layer (SQLite index + cache)
util
Utility functions and helpers

Structs§

XFS
Main filesystem interface

Enums§

OpenMode
File open mode