mirror of
https://github.com/ewanc26/atpkt.git
synced 2026-07-21 15:33:19 +00:00
Mirror of github.com/ewanc26/atpkt
- Kotlin 99.7%
- Nix 0.3%
| .letta | ||
| gradle/wrapper | ||
| src | ||
| .gitattributes | ||
| .gitignore | ||
| AGENTS.md | ||
| build.gradle.kts | ||
| CONTRIBUTING.md | ||
| FEATURES.md | ||
| flake.lock | ||
| flake.nix | ||
| gradle.properties | ||
| gradlew | ||
| gradlew.bat | ||
| README.md | ||
| settings.gradle.kts | ||
| TRADEMARKS.md | ||
atpkt
Deprecated. This project is no longer maintained. Use atproto-kotlin instead.
A professional-grade, modular AT Protocol SDK for Kotlin.
Independent project; see the trademark notice.
Overview
atpkt provides the foundational building blocks for interacting with the Authenticated Transfer Protocol (AT Protocol). Designed with a library-first architecture, it decouples core networking, authentication, and repository management logic from specific service implementations.
Key Features
- High-Level Agent: Developer-friendly
AtpAgentwith namespaced access (e.g.,agent.app.bsky.feed.*). - OAuth2 & DPoP: Robust session management with
OAuthSessionManagerand persistentSessionStore. - Jetstream Streaming: High-efficiency, JSON-based real-time event streaming via
JetstreamClient. - Automated API Surface: 100% Lexicon coverage generated via KotlinPoet AST.
- Robust XRPC: Low-level
XrpcClientwith type-safe queries, procedures, and protocol error handling. - Identity Resolution: Full support for DID/PLC and handle resolution.
Architecture
atpkt follows a modular design inspired by atproto-js and atproto.blue:
- Core Library: Networking, XRPC client, and Session management.
- Namespaced API: Hierarchical access to protocol endpoints.
- Lexicon Registry: Auto-generation of type-safe Kotlin models from official schemas.
- Streaming: Reactive, authenticated WebSocket subscription client.
Getting Started
Installation
Add atpkt to your build.gradle.kts:
dependencies {
implementation("uk.ewancroft:atpkt:0.1.0")
}
Basic Usage
val agent = AtpAgent()
// Login and Session Management
val session = agent.login("handle.bsky.social", "app-password")
println("Logged in as ${session.did}")
// Using Namespaced API
val profile = agent.app.bsky.actor.getProfile(did = session.did)
println("Display Name: ${profile.displayName}")
Real-time Streaming (Jetstream)
val jetstream = JetstreamClient()
jetstream.subscribe(wantedCollections = listOf("app.bsky.feed.post"))
.collect { event ->
println("New Post from ${event.did}: ${event.commit?.record}")
}
Testing
The SDK includes a comprehensive test suite using Kotest and MockK.
Run tests with:
./gradlew test
Contributing
Please see CONTRIBUTING.md for guidelines on code generation and development workflows.