Native core bindings for Rocksky.
JVM Panama (java.lang.foreign) bindings to the shared Rust core's C ABI
(crates/rocksky-uniffi). AT Protocol PDS writes (scrobble fan-out, like,
follow, shout), AppView reads, and the identity hashes shared across every
Rocksky SDK. This is the write + dedup side; rocksky.client is the read/HTTP
side. Requires JDK 22+ (run with --enable-native-access=ALL-UNNAMED).
Native core bindings for Rocksky. JVM Panama (java.lang.foreign) bindings to the shared Rust core's C ABI (crates/rocksky-uniffi). AT Protocol PDS writes (scrobble fan-out, like, follow, shout), AppView reads, and the identity hashes shared across every Rocksky SDK. This is the write + dedup side; `rocksky.client` is the read/HTTP side. Requires JDK 22+ (run with --enable-native-access=ALL-UNNAMED).
Ergonomic wrappers for the authenticated app.rocksky.library.* API (uploaded
music). Build a client once with client and pass it to every call — the
access token is bound in the client, not repeated:
(def lib (library/client token)) (library/get-genres lib) (library/get-song lib song-id)
Optional params are keyword args merged into the request (camelCase keyword keys become the wire keys). Returns the parsed JSON payload.
Ergonomic wrappers for the authenticated app.rocksky.library.* API (uploaded music). Build a client once with `client` and pass it to every call — the access token is bound in the client, not repeated: (def lib (library/client token)) (library/get-genres lib) (library/get-song lib song-id) Optional params are keyword args merged into the request (camelCase keyword keys become the wire keys). Returns the parsed JSON payload.
Resolves the native rocksky-uniffi library, downloading a prebuilt from the GitHub release on first use when it isn't already present locally.
Order of preference:
The jar ships resources/rocksky/manifest.json (repo, release tag, one sha256 per target triple) — filled from the release artifacts by sdk/scripts/gen-uniffi-manifest.sh.
Resolves the native rocksky-uniffi library, downloading a prebuilt from the
GitHub release on first use when it isn't already present locally.
Order of preference:
1. $ROCKSKY_NATIVE_LIB, if set.
2. librocksky_uniffi.<ext> on the classpath (resources/) — a local
./build-core.sh dev build.
3. A checksum-verified copy in the user cache, downloaded on first load (the
published-jar path: the native lib is not bundled in the jar).
The jar ships resources/rocksky/manifest.json (repo, release tag, one sha256
per target triple) — filled from the release artifacts by
sdk/scripts/gen-uniffi-manifest.sh.Remote-control bindings: build a Rocksky-controllable player or a remote UI.
Two roles over the remote-control WebSocket (remote-ws/PROTOCOL.md), both
wrapping the shared Rust core's C ABI (crates/rocksky-uniffi) via JVM Panama
FFM — the same opaque-handle style as rocksky.core's agent:
Both use a poll model: a blocking next-command/next-event you loop on a
background thread. listen does that for you — pass a handler map and it spawns
a thread that dispatches parsed commands/events to your fns.
(def player (remote/connect-player token "My Player")) (remote/listen player {:play #(engine-play) :pause #(engine-pause) :seek (fn [ms] (engine-seek ms))}) (remote/set-now-playing player {:title "…" :artist "…" :durationMs 200000 :elapsedMs 0 :isPlaying true}) (remote/set-status player :playing)
(def ctl (remote/connect-controller token "My Controller")) (remote/listen ctl {:devices (fn [e] (render (get e "devices"))) :now-playing (fn [e] (show (get e "track")))}) (remote/set-primary ctl device-id) (remote/pause ctl device-id) ; nil/omitted target ⇒ broadcast
Records/commands/events are Clojure maps with camelCase string keys — the same
convention as rocksky.core. Requires JDK 22+ (run with
--enable-native-access=ALL-UNNAMED) and the native lib built with the
remote-player feature (the crate default).
Remote-control bindings: build a Rocksky-controllable player or a remote UI.
Two roles over the remote-control WebSocket (remote-ws/PROTOCOL.md), both
wrapping the shared Rust core's C ABI (crates/rocksky-uniffi) via JVM Panama
FFM — the same opaque-handle style as `rocksky.core`'s agent:
- a RemotePlayer advertises now-playing/status/queue and receives commands;
- a RemoteController lists devices, picks the primary, and sends commands.
Both use a poll model: a blocking `next-command`/`next-event` you loop on a
background thread. `listen` does that for you — pass a handler map and it spawns
a thread that dispatches parsed commands/events to your fns.
(def player (remote/connect-player token "My Player"))
(remote/listen player {:play #(engine-play)
:pause #(engine-pause)
:seek (fn [ms] (engine-seek ms))})
(remote/set-now-playing player {:title "…" :artist "…" :durationMs 200000
:elapsedMs 0 :isPlaying true})
(remote/set-status player :playing)
(def ctl (remote/connect-controller token "My Controller"))
(remote/listen ctl {:devices (fn [e] (render (get e "devices")))
:now-playing (fn [e] (show (get e "track")))})
(remote/set-primary ctl device-id)
(remote/pause ctl device-id) ; nil/omitted target ⇒ broadcast
Records/commands/events are Clojure maps with camelCase string keys — the same
convention as `rocksky.core`. Requires JDK 22+ (run with
--enable-native-access=ALL-UNNAMED) and the native lib built with the
`remote-player` feature (the crate default).cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |