# proto_rune v0.3.0 - Table of Contents

> ATProtocol and Bluesky SDK and Bot framework for Elixir

## Pages

- Guides
  - [Getting Started with ProtoRune](getting-started.md)
  - [Authentication](authentication.md)
  - [Posting Content](posting-content.md)
  - [Bot Development](bot-development.md)
  - [Repository Operations (Advanced)](repository-operations.md)
  - [Understanding XRPC and Low-Level API Usage](xrpc.md)

- Cheatsheets
  - [Bluesky with proto_rune](bluesky.md)

- Development
  - [ProtoRune](readme.md)
  - [Contributing to ProtoRune](contributing.md)
  - [LICENSE](license.md)

## Modules

- [ProtoRune](ProtoRune.md): Main API for ProtoRune - Elixir SDK for AT Protocol.
- [ProtoRune.Atproto.Identity](ProtoRune.Atproto.Identity.md): Implements AT Protocol identity management operations.
- [ProtoRune.Atproto.Identity.Behaviour](ProtoRune.Atproto.Identity.Behaviour.md): Defines the behaviour for AT Protocol identity management operations.
- [ProtoRune.Atproto.Identity.Cache](ProtoRune.Atproto.Identity.Cache.md): Provides caching for AT Protocol identity resolution results.
- [ProtoRune.Atproto.Identity.DIDResolver](ProtoRune.Atproto.Identity.DIDResolver.md): Handles DID resolution for AT Protocol identities.
- [ProtoRune.Atproto.Identity.HandleResolver](ProtoRune.Atproto.Identity.HandleResolver.md): Handles AT Protocol handle resolution to DIDs through DNS and HTTPS methods.
- [ProtoRune.Atproto.OAuth](ProtoRune.Atproto.OAuth.md): AT Protocol OAuth 2.0 authorization flow.
- [ProtoRune.Atproto.OAuth.Client](ProtoRune.Atproto.OAuth.Client.md): An AT Protocol OAuth public client.
- [ProtoRune.Atproto.OAuth.DPoP](ProtoRune.Atproto.OAuth.DPoP.md): DPoP (Demonstrating Proof of Possession, RFC 9449) support for the
AT Protocol OAuth flow.
- [ProtoRune.Atproto.OAuth.PKCE](ProtoRune.Atproto.OAuth.PKCE.md): Proof Key for Code Exchange (PKCE) helpers for the AT Protocol OAuth flow.
- [ProtoRune.Atproto.OAuth.Session](ProtoRune.Atproto.OAuth.Session.md): An OAuth-authenticated AT Protocol session.
- [ProtoRune.Atproto.Repo](ProtoRune.Atproto.Repo.md): Low-level `com.atproto.repo` operations.
- [ProtoRune.Atproto.Session](ProtoRune.Atproto.Session.md): An authenticated AT Protocol session.
- [ProtoRune.Bot](ProtoRune.Bot.md): The `ProtoRune.Bot` module provides the foundational behavior and macros for building bots
in the ProtoRune ecosystem. It defines the basic structure for bots and ensures that every bot
adheres to a consistent interface, with customizable event handling, identifier, and password
retrieval.
- [ProtoRune.Bot.Firehose](ProtoRune.Bot.Firehose.md): A GenServer module that streams real-time events from the ATProto firehose and
dispatches them to the bot server.
- [ProtoRune.Bot.Poller](ProtoRune.Bot.Poller.md): A GenServer module that handles periodic polling of notifications for a bot, and dispatches
these notifications to the appropriate handler functions within the bot.
- [ProtoRune.Bot.Server](ProtoRune.Bot.Server.md): The `ProtoRune.Bot.Server` module is responsible for managing bot processes in ProtoRune.
It handles bot initialization, session management, and event/message dispatching. This
module also integrates with the polling system to retrieve real-time notifications from
ATProto and Bluesky services.
- [ProtoRune.Bsky](ProtoRune.Bsky.md): High-level Bluesky API helpers.
- [ProtoRune.CAR](ProtoRune.CAR.md): Reader for CAR (Content Addressable aRchive) v1 data.
- [ProtoRune.CBOR](ProtoRune.CBOR.md): Minimal CBOR (RFC 8949) decoder.
- [ProtoRune.CID](ProtoRune.CID.md): CID (Content Identifier) values as they appear in the ATProto event stream.
- [ProtoRune.Case](ProtoRune.Case.md): Yeah, in house string casing

- [ProtoRune.Config](ProtoRune.Config.md): The `ProtoRune.Config` module provides configuration options for the ProtoRune library.

- [ProtoRune.Firehose](ProtoRune.Firehose.md): Real-time event stream client for the ATProto firehose.
- [ProtoRune.Firehose.Event](ProtoRune.Firehose.Event.md): A single event decoded from the ATProto firehose.
- [ProtoRune.Firehose.Frame](ProtoRune.Firehose.Frame.md): Decodes firehose WebSocket frames into `ProtoRune.Firehose.Event` structs.
- [ProtoRune.Firehose.Transport](ProtoRune.Firehose.Transport.md): Behaviour for the WebSocket transport used by `ProtoRune.Firehose`.
- [ProtoRune.Firehose.Transport.Gun](ProtoRune.Firehose.Transport.Gun.md): `ProtoRune.Firehose.Transport` implementation backed by `:gun`.
- [ProtoRune.HTTPClient](ProtoRune.HTTPClient.md): The `HTTPClient` module handles HTTP requests to external services. It provides a simple interface for making GET and POST requests and handling responses.
- [ProtoRune.HTTPClient.Adapter](ProtoRune.HTTPClient.Adapter.md): The `HTTPClient.Adapter` module provides an adapter interface for HTTP clients. It defines the behaviour that must be implemented by any HTTP client adapter.

- [ProtoRune.HTTPClient.Adapters.Req](ProtoRune.HTTPClient.Adapters.Req.md): The `HTTPClient.Adapters.Req` module provides an adapter for the Req library. It implements the `HTTPClient.Adapter` behaviour and defines the `request/3` function to make HTTP requests using Req.

- [ProtoRune.HTTPClient.Backoff](ProtoRune.HTTPClient.Backoff.md): Pure helpers to compute retry delays for rate limited (HTTP 429) responses.
- [ProtoRune.HTTPClient.RateLimiter](ProtoRune.HTTPClient.RateLimiter.md): Tracks outgoing requests per key (usually the target host) in fixed
one-minute windows and throttles callers once a configurable limit is
reached.
- [ProtoRune.Lexicon](ProtoRune.Lexicon.md): Type definitions for the Intermediate Representation (IR) of AT Protocol Lexicons.
This structure serves as a bridge between raw lexicon JSON and generated Elixir code.

- [ProtoRune.Lexicon.Generator](ProtoRune.Lexicon.Generator.md): Generates Elixir modules with Peri schemas from AT Protocol lexicon definitions.
- [ProtoRune.Lexicon.TypeMapper](ProtoRune.Lexicon.TypeMapper.md): Maps ATProto lexicon types to Peri schema types.
- [ProtoRune.RichText](ProtoRune.RichText.md): Builder for AT Protocol rich text with facets.
- [ProtoRune.Security](ProtoRune.Security.md): Safe defaults for persisting AT Protocol session tokens.
- [ProtoRune.Security.Crypto](ProtoRune.Security.Crypto.md): Authenticated encryption utilities for session tokens at rest.
- [ProtoRune.Security.TokenStore](ProtoRune.Security.TokenStore.md): Behaviour for pluggable token storage backends.
- [ProtoRune.Security.TokenStore.Dets](ProtoRune.Security.TokenStore.Dets.md): DETS-based `ProtoRune.Security.TokenStore` backend.
- [ProtoRune.Varint](ProtoRune.Varint.md): Unsigned LEB128 variable-length integer encoding.
- [ProtoRune.XRPC.Client](ProtoRune.XRPC.Client.md): The `XRPC.Client` module handles executing queries and procedures in the XRPC system. It interacts with external services through HTTP requests and performs response validation and schema parsing. The client supports both GET and POST requests, depending on whether the request is a query or a procedure.
- [ProtoRune.XRPC.Config](ProtoRune.XRPC.Config.md): Provides fallback configuration for XRPC when service URL is not explicit.

- [ProtoRune.XRPC.DSL](ProtoRune.XRPC.DSL.md): The `XRPC.DSL` module provides macros to define queries and procedures for interacting with the XRPC system, simplifying the creation of API methods for querying or performing procedures. It supports building custom XRPC queries and procedures by encoding method names and dynamically generating functions based on user-defined parameters.
- [ProtoRune.XRPC.Procedure](ProtoRune.XRPC.Procedure.md): The `XRPC.Procedure` module represents a procedure in the XRPC system, encapsulating the method name, request body, and a parser for validating the body. It provides functions to create and manipulate procedure structures.
- [ProtoRune.XRPC.Query](ProtoRune.XRPC.Query.md): The `XRPC.Query` module is responsible for defining and managing queries in the XRPC system. It encapsulates the method, parameters, headers, and an optional parser, providing functions to create and manipulate query structures.

## Mix Tasks

- [mix proto_rune.gen.lexicons](Mix.Tasks.ProtoRune.Gen.Lexicons.md): Generates Peri schema modules from ATProto lexicon JSON files.

