@north-light/crouter-api
v0.3.263
Published
Typed crtrd /v1 API contract — DTOs, route builders, the error contract, and the CrtrClient. Zero runtime dependencies.
Keywords
Readme
@north-light/crouter-api
The typed contract for crtrd's /v1 HTTP API — DTOs, route builders, the
error contract, and the CrtrClient transport. This is the client-side surface
external consumers (e.g. Northlight Core) use to talk to a crtrd instance
without depending on the full @north-light/crouter runtime.
Zero runtime dependencies: the built package is Node built-ins (node:http,
node:https, node:os, node:path) plus its own modules only. No install
scripts.
Private package (
"access": "restricted") published under the@north-lightorg. Not a general-purpose SDK.
Install
npm install @north-light/crouter-apiUsage
import { CrtrClient, type NodeSummaryDTO } from '@north-light/crouter-api';
// Talk to a remote crtrd over TCP (e.g. a Blaxel preview edge).
const client = new CrtrClient({ baseUrl: 'https://my-crtrd.example.com' });
const nodes: NodeSummaryDTO[] = await client.listNodes();CrtrClient also drives a local crtrd over its unix socket; see the
CrtrClientOptions type for socketPath, auth headers, and the onColdSocket
autostart hook.
What's exported
CrtrClient— typed HTTP client wrapping every/v1route.- DTOs — request/response types for nodes, lifecycle, messages, reports, subscriptions, focuses, triggers, config, attach, profiles, model-auth, canvas, worktree, and human-in-the-loop.
routes/API_VERSION— pure path builders for the/v1surface.ApiError/ErrorBody/isErrorBody— the error contract.
Source of truth & releases
The source lives in the crouter
repo at src/api/; this package is a build-and-publish mirror of that subtree
(it carries no source of its own). It is published by the publish-api.yml
GitHub Action when a tag matching api-vX.Y.Z is pushed — the tag version must
match this package's version.
