### Run Domain Relay Example Source: https://github.com/aukilabs/auki-sdk/blob/develop/crates/auki-domain-relay/README.md Starts the auki-domain-relay example with specified listen addresses for native TCP and WebSocket. ```sh cargo run -p auki-domain-relay --example domain_relay -- \ /ip4/0.0.0.0/tcp/4001 \ /ip4/0.0.0.0/tcp/4002/ws ``` -------------------------------- ### Construct Peer and Start Session in Python Source: https://github.com/aukilabs/auki-sdk/wiki/Quickstart Initialize a Peer object with a storage root and start a session. The session ID is then printed. ```python from auki_session import Peer peer = Peer("galbot-01", "galbot-ctrl").with_storage_root("/data/auki/galbot-01") session = peer.start_session() print("session_id:", session.session_id) ``` -------------------------------- ### Initialize Peer and Start Session Source: https://github.com/aukilabs/auki-sdk/blob/develop/bindings/python/auki-session-py/README.md Demonstrates how to initialize a Peer with a storage root and register frame and sensor, then start a session. The Peer represents a long-lived identity, while the session is a temporary instance. ```python from auki_session import Peer, FrameDef, HeadSpec, SensorLogSpec peer = Peer("12D3KooW...", "galbot-ctrl").with_storage_root("/data/auki") frame = peer.register_frame("head_left_optical", FrameDef.ros_optical()) sensor = peer.register_sensor("head_left_rgb", {"kind": "camera", "type": "rgb", ...}) session = peer.start_session() ``` -------------------------------- ### Install and Build Browser Domain Package Source: https://github.com/aukilabs/auki-sdk/blob/develop/docs/superpowers/plans/2026-05-19-browser-domain-peer-adapter.md Steps to install dependencies and build the auki-domain-browser package. This is expected to fail initially as the main index file is not yet created. ```bash cd crates/auki-domain-browser npm install npm run build ``` -------------------------------- ### Construct Peer and Start Session in Rust Source: https://github.com/aukilabs/auki-sdk/wiki/Quickstart Create a new Peer instance with a storage root and start a new session. The session ID is printed to the console. ```rust use auki_session::Peer; let peer = Peer::new("galbot-01", "galbot-ctrl") .with_storage_root("/data/auki/galbot-01".into()); let session = peer.start_session().unwrap(); println!("session_id: {}", session.session_id()); ``` -------------------------------- ### Initialize Auki SDK, Register Sensor, and Start Session Source: https://github.com/aukilabs/auki-sdk/blob/develop/VISION.md This Rust code demonstrates initializing the SDK by loading or minting a seed, creating a wallet and peer identity, registering a frame and a camera sensor, and starting a session. It also shows how to register a sensor log with specific retention policies and inspect the advertised catalog. ```rust use std::time::Duration; use auki_registry::{Camera, SensorBody}; use auki_session::{FrameDef, HeadSpec, Peer, SensorLogSpec}; let seed = auki_identity::load_or_mint_seed(&seed_path)?; let wallet = auki_identity::Wallet::from_seed(seed.to_vec())?; let identity = auki_network::PeerIdentity::from_wallet(wallet); let peer = Peer::new(identity.peer_id().to_string(), "galbot-ctrl") .with_storage_root("/data/auki/galbot-01".into()); let frame = peer.register_frame("head_left_camera_optical", FrameDef::ros_optical())?; let sensor = peer.register_sensor("head_left_rgb", SensorBody::Camera({ r#type: "rgb".into(), width: 1920, height: 1200, frame_rate_hz: 30, pixel_format: "rgb8".into(), color_space: "srgb".into(), intrinsics_model: "pinhole".into(), distortion_model: "brown_conrady".into(), frame: frame.clone(), }))?; // Mints a ULID session_id and auto-registers the session's // monotonic + UTC clocks (#284) — no hand-rolled session clock. let session = peer.start_session()?; let _log = session.register_sensor_log(SensorLogSpec { sensor, clock: session.monotonic_clock(), frame: Some(frame), head: HeadSpec::Rolling { retention_ns: 5_000_000_000 }, segment_duration: Duration::from_secs(1), retention: Duration::from_secs(5), })?; // The catalog is what other peers see over /auki/resources/0.2.0 // once `auki_domain::Domain::join(&peer, &session, config)` puts // this pair online. for row in auki_domain::catalog_of(&peer, &session) { println!("{} owns {} ({})", row.source_peer_id, row.resource_id, row.state); } ``` -------------------------------- ### Rust WebRTC Direct Probe Listener Setup Source: https://github.com/aukilabs/auki-sdk/blob/develop/docs/superpowers/plans/2026-05-19-browser-webrtc-probe-stream.md Sets up a native WebRTC direct probe listener. This code initializes the peer identity, specifies the listening address, and starts the listener. ```rust use auki_network::{PeerIdentity, browser_probe}; #[tokio::main(flavor = "current_thread")] async fn main() -> Result<(), Box> { let seed = [41u8; 32]; let identity = PeerIdentity::from_seed(&seed); let listen_addr = "/ip4/0.0.0.0/udp/0/webrtc-direct".parse()?; eprintln!("peer_id={}", identity.peer_id()); browser_probe::listen_and_serve(identity, listen_addr).await?; Ok(()) } ``` -------------------------------- ### Setup: Verify Existing Domain-Clock Baseline Source: https://github.com/aukilabs/auki-sdk/blob/develop/docs/superpowers/plans/2026-05-21-game-grade-domain-time-hardening.md Confirm that all existing tests for the auki-time, auki-domain, and auki-diagnostic-app crates pass before proceeding with the hardening implementation. ```bash cargo test -p auki-time car go test -p auki-domain cargo test -p auki-diagnostic-app ``` -------------------------------- ### Rust Command to Run Browser Probe Listener Source: https://github.com/aukilabs/auki-sdk/blob/develop/docs/superpowers/plans/2026-05-19-browser-webrtc-probe-stream.md Command to execute the browser probe listener example. This will start the listener and output the listening address to stderr. ```bash cargo run -p auki-network --features browser_probe --example browser_probe_listener ``` -------------------------------- ### Bash Start Native Browser Join Listener Source: https://github.com/aukilabs/auki-sdk/blob/develop/docs/superpowers/plans/2026-05-22-browser-roster-presence-control-plane.md Start the native browser join listener using Cargo. This command is part of the acceptance smoke test setup. ```bash cargo run -p auki-network --example browser_join_listener --features browser_probe,join_protocol ``` -------------------------------- ### Setup: Switch to Develop Branch and Create New Branch Source: https://github.com/aukilabs/auki-sdk/blob/develop/docs/superpowers/plans/2026-05-21-game-grade-domain-time-hardening.md Before implementing the plan, ensure your local develop branch is up-to-date and create a new feature branch for the changes. ```bash git fetch origin git switch develop git pull --ff-only origin develop git switch -c codex/game-grade-domain-time-hardening ``` -------------------------------- ### Start a new Session Source: https://github.com/aukilabs/auki-sdk/wiki/Glossary Illustrates starting a new session using the Peer entry point. A new session is assigned a unique ULID session_id and automatically registers monotonic and UTC clocks. ```rust use auki_session::Session; use auki_network::Peer; // Assume peer is already initialized and connected let peer = Peer::new(); let session = peer.start_session(); // The session_id is a fresh ULID let session_id = session.session_id(); ``` -------------------------------- ### Install auki-registry-py Source: https://github.com/aukilabs/auki-sdk/blob/develop/docs/superpowers/plans/2026-05-22-auki-geometry-py.md Install the auki-registry-py package if it's not already present in your Python environment. This is a prerequisite for using some geometry functions. ```bash maturin develop -m bindings/python/auki-registry-py/Cargo.toml ``` -------------------------------- ### Example Catalog Output Source: https://github.com/aukilabs/auki-sdk/wiki/Quickstart An example of the output when inspecting the catalog of resources. ```text galbot-01 owns head_left_rgb (live) ``` -------------------------------- ### Setup UniFFI Scaffolding for Swift Binding Crate Source: https://github.com/aukilabs/auki-sdk/blob/develop/docs/superpowers/specs/2026-05-20-sdk-swift-binding-expansion-design.md Initializes UniFFI scaffolding within the Swift binding crate. This is a minimal setup required for the binding crate to function. ```rust uniffi::setup_scaffolding!(); ``` -------------------------------- ### Live Detection Log Example Source: https://github.com/aukilabs/auki-sdk/blob/develop/dataproducts.md An example of a live detection log, which records the output of a detection model (e.g., YOLOv8) applied to sensor input. It links to the input sensor and the detector used. ```json { "available": { "bytes": 250000, "duration_ns": 5000000000, "entries": 150 }, "head": { "kind": "rolling", "retention_ns": 5000000000 }, "manifest": { "clock": { "hash": "…", "id": "session/sdk_clock", "peer_id": "galbot" }, "detector": { "hash": "…", "id": "yolo_v8", "peer_id": "galbot" }, "input_log": { "resource_id": "head_left_rgb", "source_peer_id": "galbot" }, "input_sensor": { "hash": "…", "id": "head_left_rgb", "peer_id": "galbot" } }, "resource_id": "yolo_v8@head_left_rgb", "source_peer_id": "galbot", "state": "live", "variant": "detection_log", "writer_peer_id": "galbot" } ``` -------------------------------- ### Sensor Log Configuration Examples Source: https://github.com/aukilabs/auki-sdk/blob/develop/docs/control-api.md Illustrates different configurations for sensor logs based on retention and duration settings, affecting data storage and capture limits. ```text Unbounded capture — runs forever, keeps everything. Rolling pre-roll buffer — runs forever, evicts segments older than 30s. Time-boxed capture — runs for 60s, keeps everything. Time-boxed buffer — runs for 60s, keeps only the last 30s on disk. ``` -------------------------------- ### Initialize and Start Peer Audio Session Source: https://github.com/aukilabs/auki-sdk/blob/develop/crates/auki-network-browser-wasm/scripts/browser_full_peer_audio.html Initializes the WASM module and starts a new browser domain session for peer-to-peer audio communication. It sets up participant metadata, declares local audio sensors, and returns session details. ```javascript import init, { BrowserDomainSession } from "../pkg-web/auki_network_browser_wasm.js"; await init(); window.startAudioPeer = async ({ seed, discoveryUrl, domainName, displayName }) => { const session = new BrowserDomainSession(new Uint8Array(seed)); const snapshots = []; window.session = session; window.latestSnapshot = null; const unsubscribe = session.observeParticipants((snapshot) => { snapshots.push(snapshot); window.latestSnapshot = snapshot; }); const join = await session.joinDomain(discoveryUrl, domainName); await session.setParticipantMetadata({ appId: "park", displayName }); await session.declareLocalSensors([ { id: "audio", kind: "audio", label: "Microphone", publishable: true, subscribable: true, }, ]); await new Promise((resolve) => setTimeout(resolve, 250)); return { peerId: session.peerId(), join, snapshots, debug: session.debugState(), unsubscribe, }; }; ``` -------------------------------- ### Origin Log Header Example Source: https://github.com/aukilabs/auki-sdk/wiki/Concept-Peer-Owned-Logs Demonstrates the JSON structure for an origin log header where the source and writer peer IDs are the same. ```json { "source_peer_id": "galbot", "writer_peer_id": "galbot", ... } ``` -------------------------------- ### Auki SDK Directory Structure Example Source: https://github.com/aukilabs/auki-sdk/blob/develop/VISION.md Illustrates the typical file organization within an Auki SDK application, showing the placement of registries and session-specific logs. ```plaintext / ├── registries/ │ ├── sensors//.json ← shared across all sessions of this app │ ├── clocks//.json │ └── frames//.json └── / ├── timetransform_logs/__/ │ ├── log_manifest.json │ └── segments/.seg ← one TT log per session ├── sensorlogs/ │ ├── / ← one sensor stream per log │ │ ├── log_manifest.json │ │ └── segments/.seg │ ├── / │ │ └── ... │ └── / ├── poselogs/ │ ├── __/ ← one (from_frame_id, to_frame_id) pair per log │ │ ├── log_manifest.json │ │ └── segments/.seg │ └── __/ └── detection_logs/ └── __/ ← slashes in detector_id become "__" ├── log_manifest.json └── segments/.seg ``` -------------------------------- ### Build auki-network with swift-bindings feature Source: https://github.com/aukilabs/auki-sdk/blob/develop/docs/superpowers/plans/2026-05-20-spec1-pra-auki-identity-swift.md This command attempts to build the `auki-network` crate with the `swift-bindings` feature enabled. It is used to verify the initial setup and expected failure. ```bash cargo build --features swift-bindings -p auki-network ``` -------------------------------- ### Python Domain Clock Source Example Source: https://github.com/aukilabs/auki-sdk/blob/develop/docs/superpowers/plans/2026-05-19-domain-clock-heartbeat-time-sync.md Demonstrates how to access and print properties of the domain clock source in Python. Ensure the manager object is initialized before calling this. ```python clock = manager.domain_clock_source() print(clock.cluster_name) print(clock.clock_id) print(clock.backing_clock_id) ``` -------------------------------- ### Verify Initial Crate Compilation Source: https://github.com/aukilabs/auki-sdk/blob/develop/docs/superpowers/plans/2026-05-27-216-schema-and-api-placement.md Attempt to build the `auki-session` crate after initial setup. An expected error indicates that the stub modules are not yet implemented. ```bash cargo build -p auki-session ``` -------------------------------- ### Rust UniFFI Setup and Custom Types Source: https://github.com/aukilabs/auki-sdk/blob/develop/docs/superpowers/plans/2026-05-22-spec1-prb-auki-network-swift.md Demonstrates the use of `uniffi::setup_scaffolding!()` and `uniffi::custom_type!()` for exposing Rust types like `PeerId` and `Multiaddr` to other languages via UniFFI. ```rust uniffi::setup_scaffolding!(); uniffi::custom_type!(PeerId, String, ...); uniffi::custom_type!(Multiaddr, String, ...); ``` -------------------------------- ### GET /api/sensor_logs Source: https://github.com/aukilabs/auki-sdk/blob/develop/docs/control-api.md Retrieves a list of sensor logs. Supports filtering by start time and provides information about log liveness and extent. ```APIDOC ## GET /api/sensor_logs ### Description Retrieves a list of sensor logs. Consumers can determine if a log is still being written by checking if `stopped_at_ns` is null and `session_id` matches the live session. The extent of a log can be calculated using `(stopped_at_ns or session_now_ns) - started_at_ns`. ### Method GET ### Endpoint /api/sensor_logs ### Parameters #### Query Parameters - **started_after** (nanoseconds) - Optional - Filter logs that started after this nanosecond timestamp. The interpretation of this value depends on the clock used by the daemon. - **started_before** (nanoseconds) - Optional - Filter logs that started before this nanosecond timestamp. The interpretation of this value depends on the clock used by the daemon. ### Response #### Success Response (200) - **stopped_at_ns** (integer or null) - The nanosecond timestamp when the log stopped being written, or null if the log is still active. - **session_id** (string) - The identifier of the session this log belongs to. - **started_at_ns** (integer) - The nanosecond timestamp when the log started. - **duration_ns** (integer) - The configured cap for the log duration in nanoseconds. #### Response Example { "logs": [ { "stopped_at_ns": null, "session_id": "live_session_123", "started_at_ns": 1678886400000000000, "duration_ns": 3600000000000 }, { "stopped_at_ns": 1678882800000000000, "session_id": "past_session_456", "started_at_ns": 1678879200000000000, "duration_ns": 3600000000000 } ] } ### Error Handling - **400 Bad Request**: If filter parameters are invalid. - **500 Internal Server Error**: If the daemon encounters an unexpected error. ``` -------------------------------- ### Run Tests and Build Source: https://github.com/aukilabs/auki-sdk/blob/develop/docs/superpowers/plans/2026-05-19-browser-domain-peer-adapter.md Commands to execute the tests for the browser domain peer and build the package to verify the implementation and ensure all tests pass. ```bash cd crates/auki-domain-browser npm run test -- src/peer.test.ts npm run test npm run build ``` -------------------------------- ### Materialized Sensor Log Manifest Example Source: https://github.com/aukilabs/auki-sdk/blob/develop/docs/superpowers/specs/2026-05-27-216-schema-and-api-placement-design.md An example of a materialized sensor log manifest, showing how data from a specific peer is described. ```json { "source_peer_id": "galbot", "writer_peer_id": "park", "app_id": "park-vis", "session_id": "01HV-park-session", "sensor": { "peer_id": "galbot", "id": "head_left_rgb", "hash": "…" }, "clock": { "peer_id": "galbot", "id": "session/sdk_clock", "hash": "…" }, "frame": { "peer_id": "galbot", "id": "head_left_camera_optical", "hash": "…" }, "segment_duration_ns": 10000000000, "retention_ns": 300000000000 } ``` -------------------------------- ### Verify existing features and default build Source: https://github.com/aukilabs/auki-sdk/blob/develop/docs/superpowers/plans/2026-05-20-spec1-pra-auki-identity-swift.md These commands ensure that adding the `swift-bindings` feature has not broken existing build configurations, including the default build and other features like `swarm` and `discovery_client`. ```bash cargo build -p auki-network cargo build --features swarm -p auki-network cargo build --features discovery_client -p auki-network cargo build --features "swarm,discovery_client" -p auki-network cargo test -p auki-network ``` -------------------------------- ### Verify and Build Command Source: https://github.com/aukilabs/auki-sdk/blob/develop/docs/superpowers/plans/2026-05-19-browser-domain-peer-adapter.md Commands to verify the implementation by running tests and building the project. ```bash cd crates/auki-domain-browser npm run test -- src/discovery.test.ts npm run build ``` -------------------------------- ### Rust: Initialize Native App Peer and Session Source: https://github.com/aukilabs/auki-sdk/blob/develop/skills/auki-sdk-app-builder/SKILL.md This snippet demonstrates the core steps for initializing a native Auki SDK application. It covers loading or minting identity seeds, creating a wallet and peer identity, registering sensors and frames, and starting a session. ```rust let seed = auki_identity::load_or_mint_seed(&identity_seed_path)?; let wallet = auki_identity::Wallet::from_seed(seed.to_vec())?; let identity = auki_network::PeerIdentity::from_wallet(wallet); let peer_id = identity.peer_id().to_string(); let peer = auki_session::Peer::new(peer_id, app_id) .with_storage_root(storage_root); let frame = peer.register_frame("head_left_camera_optical", FrameDef::ros_optical())?; let sensor = peer.register_sensor("head_left_rgb", sensor_body)?; let session = peer.start_session()?; // mints session_id + monotonic/UTC clocks let clock = session.monotonic_clock(); let log = session.register_sensor_log(SensorLogSpec { sensor, clock, frame: Some(frame), head, segment_duration, retention, })?; ``` -------------------------------- ### Catalog Row Example Source: https://github.com/aukilabs/auki-sdk/wiki/Concept-Peer-Owned-Logs An example of a catalog row entry, specifying source and writer peer IDs, resource ID, and variant. This format is used for resource discovery and management. ```json { "source_peer_id": "galbot", "writer_peer_id": "park", "resource_id": "head_left_rgb", "variant": "sensor_log", ... } ``` -------------------------------- ### Run Tests and Build Source: https://github.com/aukilabs/auki-sdk/blob/develop/docs/superpowers/plans/2026-05-19-browser-domain-peer-adapter.md Commands to run the identity tests and build the browser domain package. Verifies the implementation and ensures the package is ready for use. ```bash cd crates/auki-domain-browser npm run test -- src/identity.test.ts npm run build ``` -------------------------------- ### Commit Browser Peer Contract Installer Source: https://github.com/aukilabs/auki-sdk/blob/develop/docs/superpowers/plans/2026-05-19-browser-domain-peer-adapter.md Stages and commits changes related to the browser peer contract installer. Includes adding relevant files and a descriptive commit message. ```bash git add crates/auki-domain-browser crates/changelog.md changelog.md git commit -m "feat: add browser peer contract installer" ``` -------------------------------- ### Rust: Interact with Auki Domain Catalog and Joining Source: https://github.com/aukilabs/auki-sdk/blob/develop/skills/auki-sdk-app-builder/SKILL.md This snippet shows how to access the catalog of available resources within a domain and how to join a domain. It also includes leaving a domain. ```rust let rows = auki_domain::catalog_of(&peer, &session); let domain = auki_domain::Domain::join(&peer, &session, domain_config).await?; let served_rows = domain.catalog(); domain.leave().await?; ``` -------------------------------- ### Verify Default-Feature Build and Feature Combinations Source: https://github.com/aukilabs/auki-sdk/blob/develop/docs/superpowers/plans/2026-05-20-spec1-pra-auki-identity-swift.md Build and test the network crate with default features and various existing feature combinations to ensure compatibility and prevent regressions. This step confirms that the changes do not break existing functionality. ```bash cargo build -p auki-network ``` ```bash cargo build --features swarm -p auki-network ``` ```bash cargo build --features discovery_client -p auki-network ``` ```bash cargo test -p auki-network ``` -------------------------------- ### Main Entry Point for Diagnostic App Source: https://github.com/aukilabs/auki-sdk/blob/develop/docs/superpowers/plans/2026-05-20-diagnostic-app.md Sets up the native window and runs the main application loop for the Auki Diagnostics app. ```rust mod app_state; mod flash; mod sdk_runtime; mod ui; use app_state::DiagnosticApp; fn main() -> eframe::Result<()> { let options = eframe::NativeOptions { viewport: egui::ViewportBuilder::default() .with_title("Auki Diagnostics") .with_inner_size([1120.0, 760.0]), ..Default::default() }; eframe::run_native( "Auki Diagnostics", options, Box::new(|cc| Ok(Box::new(DiagnosticApp::new(cc)))), ) } ``` -------------------------------- ### Install Auki Browser Peer Globally Source: https://github.com/aukilabs/auki-sdk/blob/develop/docs/superpowers/plans/2026-05-19-browser-domain-peer-adapter.md Installs the Auki browser peer factory into the global window object. This function is used to make the peer factory accessible globally in the browser environment. ```typescript import type { BrowserDomainPeer, BrowserDomainPeerFactory } from "./contract"; declare global { interface Window { aukiBrowserPeer?: BrowserDomainPeerFactory; } } export function installAukiBrowserPeer(createPeer: () => Promise): void { window.aukiBrowserPeer = { createPeer }; } ``` -------------------------------- ### Initial Crate Library File Source: https://github.com/aukilabs/auki-sdk/blob/develop/docs/superpowers/plans/2026-05-27-216-schema-and-api-placement.md Create the main library file (`lib.rs`) for the `auki-session` crate. It includes module declarations and public re-exports of key types, with a doc comment referencing a design document. ```rust //! Session — per-process declarative API for the Auki SDK. //! //! Apps construct a [`Session`], register their sensors / clocks / frames / //! detectors and the logs they own, then join a domain to advertise them. //! See `docs/superpowers/specs/2026-05-27-216-schema-and-api-placement-design.md`. mod session; mod registry_store; mod log_specs; mod log_handles; mod materialization; pub use session::Session; pub use registry_store::RegistryStore; pub use log_specs::{HeadSpec, SensorLogSpec, PoseLogSpec, TimeTransformLogSpec, DetectionLogSpec}; pub use log_handles::{SensorLogHandle, PoseLogHandle, TimeTransformLogHandle, DetectionLogHandle, MaterializedLogHandle}; pub use materialization::MaterializationError; ``` -------------------------------- ### Install Auki Browser Peer Global Factory Source: https://github.com/aukilabs/auki-sdk/blob/develop/docs/superpowers/plans/2026-05-19-browser-domain-peer-adapter.md Installs a global factory function for creating Auki browser peer instances. This is typically used in browser environments to make the peer functionality accessible globally. ```typescript import { describe, expect, it, beforeEach } from "vitest"; import { installAukiBrowserPeer } from "./installGlobal"; import type { BrowserDomainPeer } from "./contract"; declare global { interface Window { aukiBrowserPeer?: { createPeer(): Promise }; } } describe("installAukiBrowserPeer", () => { beforeEach(() => { delete window.aukiBrowserPeer; }); it("installs a Park-compatible global factory", async () => { const peer = {} as BrowserDomainPeer; installAukiBrowserPeer(() => Promise.resolve(peer)); await expect(window.aukiBrowserPeer?.createPeer()).resolves.toBe(peer); }); }); ``` -------------------------------- ### Build and Test Swift Bindings Source: https://github.com/aukilabs/auki-sdk/blob/develop/docs/superpowers/plans/2026-05-22-spec1-prb-auki-network-swift.md Commands to build the `auki-network` crate with Swift bindings enabled and run its library tests. ```bash cargo build --features swift-bindings,swarm,discovery_client -p auki-network cargo test -p auki-network --features discovery_client --lib ``` -------------------------------- ### Session Initialization and Configuration Source: https://github.com/aukilabs/auki-sdk/blob/develop/docs/superpowers/specs/2026-05-27-216-schema-and-api-placement-design.md Methods for creating a new session and configuring its storage root. ```APIDOC ## `Session::new` and `Session::with_storage_root` ### Description Initializes a new `Session` instance with a given `PeerId` and application ID, and optionally sets a custom storage root path. ### Methods - `Session::new(peer_id: PeerId, app_id: impl Into) -> Self` - `Session::with_storage_root(self, root: PathBuf) -> Self` ### Parameters - `peer_id` (PeerId): The unique identifier for the peer. - `app_id` (impl Into): The application identifier. - `root` (PathBuf): The path to the storage root directory. ``` -------------------------------- ### Verify Build and Test Source: https://github.com/aukilabs/auki-sdk/blob/develop/docs/superpowers/plans/2026-05-22-spec1-prb-auki-network-swift.md Commands to build the `auki-network` crate with the `swift-bindings` feature and run the `allowed_peer_constructs_with_string_inputs` test in the `auki-network-swift` package to confirm the annotation was successful. ```bash cargo build --features swift-bindings,swarm -p auki-network cargo test -p auki-network-swift allowed_peer_constructs_with_string_inputs ``` -------------------------------- ### Get Clock Registry Entry Source: https://github.com/aukilabs/auki-sdk/blob/develop/VISION.md Retrieves a hash-pinned Clock Registry entry. ```APIDOC ## GET /api/registries/clocks// ### Description Hash-pinned Clock Registry entry, served verbatim, immutable. ### Method GET ### Endpoint /api/registries/clocks// ### Parameters #### Path Parameters - **clock_id** (string) - Required - The ID of the clock. - **clock_hash** (string) - Required - The hash of the clock data. ### Response #### Success Response (200) - The raw content of the Clock Registry entry. ``` -------------------------------- ### Verify Binding Crate Build and Tests Source: https://github.com/aukilabs/auki-sdk/blob/develop/docs/superpowers/plans/2026-05-22-spec1-prb-auki-network-swift.md Commands to build the `auki-network-swift` crate and run its tests. This step ensures that all changes, including the removal of Stage 1 hand-wrappers and the update of tests, have been successfully integrated and that the crate functions as expected. ```bash cargo build -p auki-network-swift cargo test -p auki-network-swift ``` -------------------------------- ### Get Sensor Registry Entry Source: https://github.com/aukilabs/auki-sdk/blob/develop/VISION.md Retrieves a hash-pinned Sensor Registry entry. ```APIDOC ## GET /api/registries/sensors// ### Description Hash-pinned Sensor Registry entry, served verbatim, immutable. ### Method GET ### Endpoint /api/registries/sensors// ### Parameters #### Path Parameters - **sensor_id** (string) - Required - The ID of the sensor. - **sensor_hash** (string) - Required - The hash of the sensor data. ### Response #### Success Response (200) - The raw content of the Sensor Registry entry. ``` -------------------------------- ### GET /api/sensor_logs Source: https://github.com/aukilabs/auki-sdk/blob/develop/docs/control-api.md Retrieves all sensor logs enumerated by the daemon across all sessions on disk. ```APIDOC ## GET /api/sensor_logs ### Description Retrieves all sensor logs enumerated by the daemon across all sessions on disk. ### Method GET ### Endpoint /api/sensor_logs ### Parameters #### Query Parameters - **session_id** (string) - Optional - Filter logs by session ID. ### Response #### Success Response (200) - **sensor_log_id** (string) - The ID of the sensor log. - **session_id** (string) - The ID of the session. - **sensor_id** (string) - The ID of the sensor. - **sensor_hash** (string) - The hash of the sensor data. - **clock_id** (string) - The ID of the clock used for timestamps. - **clock_hash** (string) - The hash of the clock. - **retention_ns** (integer) - The retention period in nanoseconds. - **duration_ns** (integer) - The duration of the log in nanoseconds. - **started_at_ns** (integer) - The start time in nanoseconds on the associated clock. - **stopped_at_ns** (integer | null) - The stop time in nanoseconds on the associated clock, or null if the log is live. ``` -------------------------------- ### Run Auki Domain and Session Tests and Build Workspace Source: https://github.com/aukilabs/auki-sdk/blob/develop/docs/superpowers/plans/2026-05-27-216-schema-and-api-placement.md Verifies that tests for both auki-domain and auki-session pass and that the entire workspace builds successfully. ```bash cargo test -p auki-domain -p auki-session cargo build --workspace ``` -------------------------------- ### Build and Test Swift Bindings Source: https://github.com/aukilabs/auki-sdk/blob/develop/docs/superpowers/plans/2026-05-22-spec1-prb-auki-network-swift.md Verify the successful compilation and testing of the Auki network with Swift bindings and swarm features enabled. ```bash cargo build --features swift-bindings,swarm -p auki-network cargo test -p auki-network --features swift-bindings,swarm --lib cargo test -p auki-network-swift network_runtime_is_uniffi_object ``` -------------------------------- ### Commit Changes Source: https://github.com/aukilabs/auki-sdk/blob/develop/docs/superpowers/plans/2026-05-20-diagnostic-app.md Git commands to stage and commit the scaffolded diagnostic example app files. ```bash git add Cargo.toml examples/diagnostic-app git commit -m "feat: scaffold diagnostic example app" ``` -------------------------------- ### App-Side Session and Sensor Registration Source: https://github.com/aukilabs/auki-sdk/blob/develop/docs/superpowers/specs/2026-05-27-216-schema-and-api-placement-design.md Demonstrates how to initialize a session, register a camera sensor with its intrinsic properties, a clock, and a frame definition, then set up a sensor log for data retention and joining a domain. ```rust let mut session = Session::new(self_peer_id, "boosterapp"); let sensor = session.register_sensor("head_left_rgb", SensorBody::Camera { r#type: "rgb".to_string(), width: 1920, height: 1200, frame_rate_hz: 30, pixel_format: "rgb8".to_string(), color_space: "srgb".to_string(), intrinsics_model: "pinhole".to_string(), distortion_model: "brown_conrady".to_string(), frame: head_left_camera_optical_ref.clone(), })?; let clock = session.register_clock("sdk_clock", ClockBody::MonotonicClock { /* … */ })?; let frame = session.register_frame("head_left_camera_optical", FrameDef::ros_optical())?; let log = session.register_sensor_log(SensorLogSpec { sensor, clock, frame: Some(frame), head: HeadSpec::Rolling { retention_ns: 5_000_000_000 }, segment_duration: Duration::from_secs(1), retention: Duration::from_secs(5), })?; session.join_domain(cluster_config).await?; log.write(camera_frame)?; ``` -------------------------------- ### Get Latest Camera Frame Source: https://github.com/aukilabs/auki-sdk/blob/develop/VISION.md Retrieves the latest captured camera frame as a JPEG image. ```APIDOC ## GET /api/preview/latest.jpg ### Description Latest captured camera frame as JPEG (poll-based; `503` if none yet). ### Method GET ### Endpoint /api/preview/latest.jpg ### Response #### Success Response (200) - JPEG image data of the latest camera frame. #### Error Response (503) - Returned if no camera frame is available yet. ``` -------------------------------- ### Changelog Entry for auki-identity-swift Source: https://github.com/aukilabs/auki-sdk/blob/develop/docs/superpowers/plans/2026-05-20-spec1-pra-auki-identity-swift.md Example of a changelog entry for the auki-identity-swift crate, detailing its initial release and features. ```markdown # Changelog — auki-identity-swift Append-only changelog for this crate. See [CLAUDE.md](../../../CLAUDE.md) for the format and propagation rules. Latest entry on top. --- ### Nils's claude · **New crate: auki-identity-swift (PR A of Spec 1).** Thin scaffolding host for the Swift binding to `auki-identity::Wallet` and the identity-shaped slice of `auki-network::PeerIdentity`. UniFFI 0.31 proc-macros live on the upstream types behind a new `swift-bindings` cargo feature; this crate is `uniffi::setup_scaffolding!()` + `pub use` re-exports + per-component docs + `build-xcframework.sh`. Surface at PR A: `Wallet::{new, from_seed, seed, wallet_id_str}` and `PeerIdentity::{from_wallet, peer_id_string}`. Discovery / NetworkRuntime / stream surface land in PR B (`auki-network-swift` expansion); ClusterManager in PR C (`auki-domain-swift`). ``` -------------------------------- ### Python Dependency for Auki SDK Source: https://github.com/aukilabs/auki-sdk/wiki/Quickstart Install the Auki session Python binding from source using pip. ```bash pip install "auki-session @ git+https://github.com/aukilabs/auki-sdk.git@v0.0.57#subdirectory=bindings/python/auki-session-py" ``` -------------------------------- ### Add Workspace Member to Cargo.toml Source: https://github.com/aukilabs/auki-sdk/blob/develop/docs/superpowers/plans/2026-05-20-diagnostic-app.md Add the example package to the root Cargo.toml members list to include it in the workspace. ```toml "examples/diagnostic-app", ``` -------------------------------- ### Get Meters Per Unit Source: https://github.com/aukilabs/auki-sdk/blob/develop/docs/superpowers/specs/2026-05-22-auki-geometry-py-design.md Retrieves the scaling factor for a given unit. Raises GeometryError for unknown units. ```python auki_geometry.meters_per_unit(unit: str) -> float ``` -------------------------------- ### Live Movable Pose Log Example Source: https://github.com/aukilabs/auki-sdk/blob/develop/dataproducts.md Illustrates a live pose log where the writer mode is 'movable'. This is used for tracking dynamic poses, such as those of a robot's gripper relative to an object. ```json { "available": { "bytes": 18000000, "duration_ns": 30000000000, "entries": 5000 }, "head": { "kind": "fixed", "started_at_ns": 1733836800000000000 }, "manifest": { "clock": { "hash": "…", "id": "session/sdk_clock", "peer_id": "galbot" }, "expected_rate_hz": 30, "from_frame": { "hash": "…", "id": "left_gripper", "peer_id": "galbot" }, "source": { "kind": "manual" }, "to_frame": { "hash": "…", "id": "object_pose", "peer_id": "galbot" } }, "pose": { "writer_mode": "movable" }, "resource_id": "left_gripper->object_pose", "source_peer_id": "galbot", "state": "live", "variant": "pose_log", "writer_peer_id": "galbot" } ``` -------------------------------- ### GET /api/preview/latest.jpg Source: https://github.com/aukilabs/auki-sdk/blob/develop/docs/control-api.md Fetches the most recent frame captured by the daemon, encoded as a JPEG image. This endpoint is designed for polling. ```APIDOC ## GET /api/preview/latest.jpg ### Description Most recent frame captured by the daemon, encoded as JPEG. Poll-based — see [v1 design choices](#v1-design-choices-deliberate) for why no streaming. ### Method GET ### Endpoint /api/preview/latest.jpg ### Response #### Success Response (200 OK) - **image/jpeg** — the latest frame. #### Error Response (503 Service Unavailable) - **application/json** — no frame captured yet (daemon just started, no source data). ``` -------------------------------- ### Run Initial Build and Test Source: https://github.com/aukilabs/auki-sdk/blob/develop/docs/superpowers/plans/2026-05-20-diagnostic-app.md Commands to execute the initial build and test suite for the auki-diagnostic-app package. ```bash cargo test -p auki-diagnostic-app cargo check -p auki-diagnostic-app ``` -------------------------------- ### Build and Test Swift Bindings Source: https://github.com/aukilabs/auki-sdk/blob/develop/docs/superpowers/plans/2026-05-22-spec1-prb-auki-network-swift.md Commands to build the Auki Network with Swift bindings and run specific tests to verify the `StreamSubscriptionAudio` functionality. ```bash cargo build --features swift-bindings,swarm -p auki-network cargo test -p auki-network-swift stream_subscription_audio_wraps_typed_subscription ``` -------------------------------- ### Materialized Log Header Example Source: https://github.com/aukilabs/auki-sdk/wiki/Concept-Peer-Owned-Logs Illustrates the JSON structure for a materialized log header, showing a different writer_peer_id from the source_peer_id. ```json { "source_peer_id": "galbot", "writer_peer_id": "park", ... } ``` -------------------------------- ### Verify Build and Test After Doc Files Source: https://github.com/aukilabs/auki-sdk/blob/develop/docs/superpowers/plans/2026-05-20-spec1-pra-auki-identity-swift.md Command to run tests for the auki-identity-swift crate to ensure that the addition of documentation files does not affect compilation or test execution. ```bash cargo test -p auki-identity-swift ``` -------------------------------- ### Verify iOS Rust Targets Source: https://github.com/aukilabs/auki-sdk/blob/develop/docs/superpowers/plans/2026-05-20-spec1-pra-auki-identity-swift.md Check if the necessary iOS Rust targets are installed. If not, add them using the provided command. ```bash rustup target list --installed | grep apple-ios ``` ```bash rustup target add aarch64-apple-ios aarch64-apple-ios-sim x86_64-ios ``` -------------------------------- ### Verify Swift Bindings with Swarm and Discovery Client Source: https://github.com/aukilabs/auki-sdk/blob/develop/docs/superpowers/plans/2026-05-22-spec1-prb-auki-network-swift.md Builds and tests the auki-network crate with specific features enabled: swift-bindings, swarm, and discovery_client. This verifies compatibility of these features. ```bash cargo build --features swift-bindings,swarm,discovery_client -p auki-network cargo test --features swift-bindings,swarm,discovery_client -p auki-network --lib ```