Skip to content
Back to skills

Laser Sdk Overview

ASecurity

Entry point for the Rust reference SDK, Python bindings, native TypeScript SDK, and laser-wire contract over Apache Iggy. Load this first for changes under wire, sdk, foreign, bdd, or examples, then route to the focused area skill.

  • 14 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added October 7, 2026
businesstypescriptpythonrustgosqlnodetestingapibackend

Works with

  • cursor
  • cli
  • api
  • mcp

Security analysis

A100/100

Scanned November 30, 2026

npx -y skills add laserdata/laser-sdk --skill laser-sdk-overview --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Laser Sdk Overview?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Laser Sdk Overview
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/laserdata-laser-sdk-overview/badge)](https://www.skillsdirectory.com/skills/laserdata-laser-sdk-overview)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: laser-sdk-overview
description: Entry point for the Rust reference SDK, Python bindings, native TypeScript SDK, and laser-wire contract over Apache Iggy. Load this first for changes under wire, sdk, foreign, bdd, or examples, then route to the focused area skill.
---

# LaserData - Laser SDK - Overview

Repo-wide rules (verification order, idiomatic-traits, no `cargo install`, no em dashes, BDD test naming) live in [AGENTS.md](../../../AGENTS.md). This file owns SDK-specific routing and the shared mental model.

## Contents

- [What this crate is](#what-this-crate-is)
- [Which skill to load](#which-skill-to-load)
- [The spine in one paragraph](#the-spine-in-one-paragraph)
- [Hard invariants](#hard-invariants)
- [Module map](#module-map)
- [Shipped vs planned](#shipped-vs-planned)
- [Cite by symbol, not line number](#cite-by-symbol-not-line-number)
- [Client behavior docs](#client-behavior-docs)

## What this crate is

Laser SDK uses an append-only log for source records. Projections, queries, key-value state, and forks provide views over that data. AGDX defines the shared exchange contract.

The workspace publishes `laser-wire`, the Rust `laser-sdk`, Python bindings, and a native TypeScript client, all at version `0.11.0`. The three clients expose streaming, managed, and agent surfaces. The native Go client under `foreign/go/` ports the wire contract, runs the shared scenarios and has its own capability section in the parity matrix. The [cross-SDK parity matrix](../../../docs/parity.md) maps Rust types, fields, error payloads, constants, and callable APIs to their Python and TypeScript forms, and reports unresolved mappings and peer-only APIs. Update it in the same change as any public API. Rust defines the codes, envelopes, dictionaries, limits, and reference files. Python calls the Rust implementation. TypeScript uses the same encoded files and behavior scenarios. The SDKs do not call language models.

`laser_sdk::prelude::*` imports the common accessors and types, the ones a workflow, memory, or session program names among them (`StepFn`, `StepContext`, `WorkflowOutcome`, `WorkflowBudget`, `InboxRoute`, `LastN`, `SessionStatus`, `MemoryItem`, `TopicRetention`). `laser_sdk::prelude::full::*` also imports bridge, projection, and memory types. Examples and integration tests use `full`. Application code can use the smaller prelude with explicit imports. `ReliableConsumer` is the public consumer, and `ReliableWorker` is its private message adapter.

Managed resource names are stream scoped by default: `ResourceNaming::Stream` sends `stream:<default stream>/<name>` for KV, memory, lease and fence namespaces, the key registry, graph names, projection and index ids, query indexes, fork ids, and the watch index filter, through `Laser::resource_name` and the wire `authz::scoped_resource` helper. `ResourceNaming::Bare` (Python `resource_naming="bare"`, TypeScript `resourceNaming("bare")`) opts out. Listings strip the caller's prefix. `Capabilities::stream_tenancy` reports a deployment that enforces the scoping.

`Laser::connect(connection_string)` opens a connection. `laser.scratch_stream(prefix)` (Python `async with`, TypeScript `await using` `scratchStream`) creates a `{prefix}-<8 hex>` stream for one run with a handle that uses it as the default stream, and deletes it at the end. `laser.stream(name)` selects a stream with `ensure()`, `delete()`, `get()`, `exists()`, `topics()`, and `topic(name)` methods. `laser.streams()` lists every readable stream. `Topic::get`, `exists`, `delete`, `partitions`, `add_partitions`, `delete_partitions`, and `consumer_groups` inspect and change one topic, and `ConsumerGroup::delete` removes a group. These return `StreamInfo`, `TopicInfo`, `PartitionInfo`, and `ConsumerGroupSummary` in all three SDKs, `get()` and `exists()` read a missing stream or topic as absent, and `topics()`, `partitions()`, and `consumer_groups()` fail with the stream-or-topic-not-found error. `Stream::rename`, `Topic::update`, and `Topic::delete_segments` change streams and topics. The `server` module (`sdk/src/server.rs`, Python `src/server.rs`, TypeScript `src/client/server.ts` over `src/iggy/server-admin.ts`) holds user, personal access token, statistics, client, cluster, snapshot, option catalog, and metadata change calls, each one Iggy command under the server's own permission checks. `laser.stream(name).topic(name)` addresses a topic explicitly. `laser.topic(name)` uses the default selected by `connect_with_stream` or `with_default_stream`. Without a default, it returns `NoStream`.

For `*.laserdata.cloud` and `*.laserdata.com`, Rust, Python, and TypeScript enable TLS unless `tls_ca_file=` already supplies a certificate. `sdk/certs/laserdata.crt` supplies the bundled CA through `include_bytes!`. `resolve_tls` and `is_laserdata_host` in `sdk/src/laser.rs` implement selection. The cached certificate must match the bundled bytes and reside in an owner-only directory. `LASER_TLS_CERT=<path>` selects a CA for any host. `LASER_NO_TLS=1` disables automatic TLS, while `0` and `false` do not.

Other hosts retain their connection-string configuration. `Laser::connect_env()` reads `LASER_CONNECTION_STRING` and optional `LASER_STREAM`, with a typed `Config` error for missing required input. `Laser::local()` targets `iggy:iggy@127.0.0.1:8090`. `Laser::connect_env_with_stream(stream)` reads the same variable and pins `stream` over `LASER_STREAM` (Python `connect_env(stream=)`, TypeScript `connectEnvWithStream`). Python and TypeScript provide the same two helpers (`connect_env`, `connectEnv`, `local`). `Laser::connection_events()` (`connection_events`, `connectionEvents`) reports connected, disconnected, signed in, signed out, and shutdown, and a leader change is never a disconnect ([connection events](../../../docs/client-behavior.md#connection-events)).

The `streaming` feature provides `publish()`, `publish_batch()`, `send(payload, headers, key)`, and `batch(messages, key)`. Typed and one-shot sends accept `impl Into<Vec<u8>>`. Continuous streaming uses `producer()`, `consumer(name, partition)`, and `consumer_group(group).consumer()`. `ProducerMessage` and `ConsumerMessage` retain `bytes::Bytes` for shared payload storage. These APIs support batching, server-held polls (`max_wait`, `min_count`, `max_bytes`), delays, retries, discovery, routing, replay, groups, and commits. `ProducerBuilder::sharding` picks the background shard with caller code (`sdk/src/stream/sharding.rs`), and `Encryption` (`sdk/src/stream/encryption.rs`) on `ProducerBuilder::encryption` and `ConsumerBuilder::encryption` seals each payload and header block in the Apache Iggy AES-256-GCM format, which the Python and TypeScript clients read too. `ProducerBuilder::idempotent` sends each batch with a producer id, epoch, and per-partition sequence, so a partition writes a resent batch once ([publish recovery](../../../docs/publish-recovery.md#idempotent-producers)).

`commit(&message)` stores an offset explicitly, and `next_within(timeout)` bounds a single-record wait. `replay()` creates a client-offset cursor, and `ensure(partitions, replication_factor)` creates the topic when absent (`None` takes the server's default factor, `Some(n)` is 1 to `MAX_REPLICATION_FACTOR` and at most the node count, checked before sending, `ProducerBuilder::replication_factor` for a producer-created topic). On a cluster wider than a topic's factor a node stores only the partitions it is a member of, and every read goes to the partition's primary, a member. In `sdk/src/typed.rs`, `.json::<T>()` and `.cbor::<T>()` select codecs. `.schema::<T>(id)` compiles a registered schema, rejects invalid values, and adds `agdx.ct` and `agdx.sid`. `records(reader_name)` reports `TypedDecodeError { position, source }` and continues past an invalid record.

Use `iggy_producer()`, `iggy_consumer()`, `iggy_consumer_group()`, `Laser::client()`, and `laser_sdk::iggy` for direct Iggy access. Examples include `native-streaming`, `event-analytics`, and `fleet-tape`. Default features are `streaming` and `provenance`. Agent and managed features are optional.

Every client uses standard Iggy transport, picked by the connection string scheme: Rust and Python speak TCP, QUIC and WebSocket, TypeScript TCP, and HTTP is refused ([client behavior](../../../docs/client-behavior.md#connections)). Managed reads use the non-replicated extension, and the three authorization writes use dedicated replicated operations. Managed calls return `LaserError::Unsupported` without a supporting backend. `BlobStore::put`, `BlobStore::get`, and one-shot managed calls use `Vec<u8>`. Conversion to Iggy `Bytes` occurs at the client-call boundary. `sdk/src/blob.rs` and `send_raw_with_response` define those paths.

## Which skill to load

- Wire contract types, codes, dictionaries, fixtures, the agent envelope (Agent Data Exchange Protocol), framing -> [wire-contract](../wire-contract/SKILL.md)
- Provenance runtime: `AgentTopic`, `Provenance` encode/decode, OTel/`agdx.*` aliasing, caps -> [provenance](../provenance/SKILL.md)
- `Laser` facade, reliable consumer, `Agent` builder, router, sessions, request/reply, shutdown -> [agent-runtime](../agent-runtime/SKILL.md)
- Reading the log back: `ContextAssembler`/policies, `ConversationState`, `Memory`/`LogMemory` -> [context-and-memory](../context-and-memory/SKILL.md)
- Example crate, the `LlmClient` seam, `TestIggy`, integration-test conventions -> [examples-and-testing](../examples-and-testing/SKILL.md)
- Consumer filters: `Topic::consumer_group()` handles, `group.filter()` administration, normal consumers and advanced readers, previews and tests, the saved-filter catalog and group bindings (`sdk/src/filters/`, feature `filters`), the `wire/src/filter/` contract and evaluator corpus, and the TypeScript and Python peers -> [consumer-filters](../consumer-filters/SKILL.md)
- Typed records and publish live under the `streaming` feature and `laser_sdk::stream`. Queryable indexing directives stay on those records because they are written at append time.
- Preserve all `SendMessagesResponse` confirmations across retries. Each identifies a stream, topic, partition, and base offset. The server can return none when it does not report offsets. Completion follows the topic durability policy.
- Query DSL and `query()` (managed deployment only: the `AGDX_QUERY` managed command off the log via `send_raw_with_response`, Apache Iggy without a managed backend returns `Unsupported`. No topic request/reply query path) -> [query](../query/SKILL.md)
- Logical schemas, tagged positional query results, offset paging, Arrow IPC publishing, and the matching HTTP surface -> [query](../query/SKILL.md) and [wire-contract](../wire-contract/SKILL.md)
- Managed key-value store (`Laser::kv`, get/set/delete/scan, optional expiry) over the `AGDX_KV_*` managed commands, backed by the managed backend in Laser Stack or LaserData Cloud (`kv` feature, independently selectable from `query`. Client-only, backend is managed-side) -> [kv](../kv/SKILL.md) (wire the AGDX spec)
- Sessions (`sdk/src/agent/session.rs`, `session_ops.rs`, `lease.rs`, `partitioning.rs`, feature `agent`): `laser.sessions()` creates, starts, opens, and submits sessions, `Session` writes lifecycle, model, tool, context, and state records on `agent.sessions`, and `SessionControl` writes operator requests on `agent.control`. `session_reads.rs` reads the managed session index (`get`, `list`, `events`, `state`, `links`, `sources`, `changes`, `watch`, `Session::status`) when the server announces `sessions`, and `Laser::read_at` fetches one record by source reference. The run registry is retired: there is no `runs()`, no `runs` feature, no `agent_workflow` capability, and no `registered()`. Workflows are root sessions with a child session per step. Read [agent-runtime](../agent-runtime/SKILL.md) and the AGDX spec section A15.
- Capability RBAC over the managed surfaces (`Laser::whoami` + the role/binding/history verbs in `sdk/src/rbac/`, `rbac` feature: `effect feature:action [on resource]` grants assembled through roles bound to the server-stamped user, deny-wins, default-deny). Server-native and journalled: the streaming server enforces feature+action+keyed-resource at the edge (`AGDX_AUTHZ_*` band, `authz` capability), orthogonal to Iggy's own `Permissions`. See [wire-contract](../wire-contract/SKILL.md) for the `authz` module.
- A2A, MCP, and AG-UI map external interfaces to AGDX. Features are `a2a-bridge`, `mcp-bridge`, and `agui`. Read [a2a-bridge](../a2a-bridge/SKILL.md) for task operations, cards, tools, and event rendering.
- The Python SDK under `foreign/python/` (PyO3 bindings over this crate), its maturin packaging, the `.pyi` stubs, the pytest suite, or the Python BDD runner -> [python-bindings](../python-bindings/SKILL.md)
- The native TypeScript SDK under `foreign/typescript/`, its Node transport, npm package, fixture port, Cucumber runner, and examples -> [typescript-sdk](../typescript-sdk/SKILL.md)
- For native Go work, read the [implementation status](../../../foreign/go/IMPLEMENTATION_STATUS.md) and [Go client guide](../../../foreign/go/README.md). The Go client uses the Apache Iggy Go SDK over TCP. The three Go modules are `foreign/go/`, `examples/go/`, and `bdd/go/`. `examples/go/` carries all 21 scenarios at step parity with the other clients, `bdd/go/` binds the shared steps to the client surface the Rust steps call, and `foreign/go/laser/lasertest` builds handler inputs for unit tests. The Go CI workflow checks wire compatibility, the minimum and stable Go versions, and the shared scenarios across deployments.

## The spine in one paragraph

`Provenance` requires `conversation_id` and encodes its fields into Iggy headers through the one wire header encoder. A session is a conversation, and the conversation ID selects the partition for agent records on `agent.sessions`, unless a declared `SessionLayout::PerAgentPartition` puts addressed work on the addressee's partition. Lifecycle and state always stay on the session's partition. Every record on `agent.sessions` carries its addressee in `agdx.to`, with `*` for every agent. `spawn_subconversation` and child sessions preserve the parent and root conversation. Replies carry the request's record id as `cause` and its full log position as `cause_at`. These fields support causal reconstruction.

## Hard invariants

- Ordering is per-partition only, which means per session in the default layout. No cross-conversation/-topic order. Context assembly orders best-effort by Iggy timestamp, deterministic on ties, not strictly chronological across topics (Apache Iggy cannot total-order).
- At-least-once + idempotent, never exactly-once. Handlers must tolerate redelivery. Dedup is a best-effort in-memory sliding window.
- The header set is a wire contract. Changing keys or the encode/decode breaks messages already on the log. Keys live in `wire/src/headers.rs`, and the encode/decode lives in [provenance](../provenance/SKILL.md).
- The fixture corpus pins the bytes. Any change under `wire/src/` that alters encoded bytes fails `wire/tests/wire_fixtures.rs`, and an intentional change regenerates (`just fixtures-regen`) and rides the release process.
- `ConversationId::derive` is versioned (FNV-1a + `DERIVE_VERSION`). Changing the algorithm without bumping the version remaps every `PerUser` conversation.

## Module map

The Structure section in [AGENTS.md](../../../AGENTS.md) lists modules. `stream.rs`, `typed.rs`, and `cursor.rs` provide streaming and replay. `provenance/` provides headers, and `agent/` provides the runtime. `context.rs`, `memory.rs`, and `agent/state.rs` read recorded state. `poll.rs` contains the shared bounded partition reader.

`govern.rs` defines `ActionGovernor`. `state_store.rs` defines `InMemoryStore`, `FileStore`, and KV state operations. `capabilities.rs` represents discovered support. `types/ids.rs` defines IDs and `MintUlid`.

`query/` provides operational queries. Their worker runs in the managed deployment. Read [query](../query/SKILL.md) and [wire-contract](../wire-contract/SKILL.md) for shared data types. Read [agent-runtime](../agent-runtime/SKILL.md) for `Deduplicator`, `Laser::capabilities`, and agent behavior.

## Shipped vs planned

The one canonical inventory lives in [AGENTS.md](../../../AGENTS.md#what-is-shipped-vs-planned), organized by area (core, RBAC, AGDX wire surface, dead letters, edge bridges, orchestration, planned). Read it there rather than a copy here, kept in one place so it does not drift.

## Cite by symbol, not line number

Refer to `Laser::send_agent`, `ReliableConsumer::run`, `keys::CONVERSATION_ID`, not line numbers. Lines drift, symbols do not.

## Client behavior docs

Connect and publish defaults, failure reports, and shared client behavior each have one owning page: [connect timeout and cleanup](../../../docs/connect-timeout.md), [publish recovery](../../../docs/publish-recovery.md), [producer statistics](../../../docs/producer-statistics.md), and [client behavior](../../../docs/client-behavior.md). Link to them instead of restating defaults here or in another skill.

Materialization setup lives in `sdk/src/materialize.rs`, `foreign/python/src/materialize.rs`, `foreign/typescript/src/managed/materialize.ts`, and `foreign/go/laser/materialize.go`. The shared scenarios are `bdd/scenarios/materialization.feature` and `bdd/scenarios/operational_sql.feature`. Keep append and keyed history, rejection policies, captured-target readiness, and explicit raw SQL dialects aligned in every client. Read `docs/client-behavior.md` from the repository root for the public contract.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in business →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.