npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@reasonabletech/lattice-client

v0.0.1

Published

TypeScript SDK for the Lattice Cloud gateway

Readme

@reasonabletech/lattice-client

TypeScript SDK for calling the Lattice Cloud gateway.

Overview

This package is for external or internal callers that need to talk to the Lattice Cloud gateway through a typed client instead of hand-written fetch calls. It wraps gateway requests with request construction, response parsing, and structured client errors. Use it from developer tools, platform services, or tests that submit compute work or inspect gateway-owned runtime state.

Import Surface

  • @reasonabletech/lattice-client exposes the gateway client and its client configuration/error types.
  • Shared protocol types come from @lovelace-ai/compute; use that package when no HTTP client behavior is needed.
  • Callers must provide environment-specific base URLs, credentials, and fetch behavior where appropriate.

Usage

Construct the client at the application or service boundary where credentials and gateway URL are already known.

import { LatticeClient } from "@reasonabletech/lattice-client";

const client = new LatticeClient({
  baseUrl: "https://lattice.example.com",
  credential: { kind: "apiKey", apiKey },
});

Personal-runtime dispatch (generateTextForPersonalRuntime, chatCompleteForPersonalRuntime) requires an OAuth user access token as the credential, not an API key. An API key identifies which developer is calling, not which end user's device to route to — a personal-runtime call made with an API key throws PersonalRuntimeRequiresUserTokenError before any network call.

const client = new LatticeClient({
  baseUrl: "https://lattice.example.com",
  credential: { kind: "oauth", accessToken },
});

Do not bury default gateway URLs in this package. Hosted apps and operators own deployment-specific configuration.

Realtime subscriptions

subscribeRealtimeSession streams a session's action-stream as typed RealtimeSessionEvents. It reconnects with backoff on a dropped connection, resuming from the last frame's sequence via Last-Event-ID so no events are missed; a terminal stream_error frame throws a LatticeError.

for await (const event of client.subscribeRealtimeSession("sess_123")) {
  if (event.type === "action.delta") process.stdout.write(event.delta);
}

Public API

The client API is a typed HTTP boundary over the Lattice gateway. It should remain thin over the shared compute protocol and report failures through structured client errors. If gateway behavior changes, update this README, the generated API docs, and the gateway-facing tests in the same work.

Development

Run package checks from the repository root with pnpm --filter @reasonabletech/lattice-client typecheck, pnpm --filter @reasonabletech/lattice-client lint, and pnpm --filter @reasonabletech/lattice-client test. Update this README when top-level usage, import boundaries, or package ownership changes. Use generated API documentation for symbol-level detail instead of duplicating export catalogs here.

Related Documentation

License

MIT