LangSpan TypeScript client
A client for the LangSpan coordination
protocol.
It sends typed commands to a running LangSpan coordinator and returns typed
outcomes. It has no runtime dependencies.
Install it from npm with npm install @langspan/client. To build it from the
repository instead, run npm ci and then npm pack in clients/typescript,
and install the tarball that writes.
import { connect } from "@langspan/client";
const client = connect("/path/to/state-dir");
const outcome = await client.request({
op: "admit",
session_id: "my-tool.alice",
paths: ["src/api.ts"],
ttl_ms: 60_000,
});
if (outcome.type === "conflict") {
// Another session holds a path: outcome.holders names each holder.
}
@langspan/client is the Node client. It speaks the coordinator's
owner-only Unix socket and needs Node 22.18 or later.
@langspan/client/protocol has no Node imports. Give its Client your own
Transport to use it in a browser behind a local host that forwards
frames.
The embedding
guide
describes the client's behavior, its limits and its tests.
Treat text in an outcome, such as an intent, a note or a symbol name, as data
from another session or the repository, never as instructions.
Licensed under Apache-2.0.