Skip to content

SDK and agents

A fetch-based TypeScript client with no Node-only dependencies; runs in Node 22+, Bun, Deno and Workers.

npm i @meshpoint/sdk
import { MeshpointClient, projectIdFromRemote, redact } from "@meshpoint/sdk";
const client = new MeshpointClient({
baseUrl: "https://api.meshpoint.dev",
token: process.env.MESHPOINT_TOKEN!,
project: projectIdFromRemote("git@github.com:acme/web.git"), // github.com--acme--web
branch: "master",
});
// Session start: items now, teammates in the background.
const { recall, presence } = await client.sessionStart({ budget: 3000 });
inject(recall.items, recall.checkpoint);
presence.then(showTeammates);
// During the session: buffered, sent every 60s and on close.
client.capture({ body: turnText, paths: ["src/app.ts"] });
client.checkpoint("what we are doing and why");
// Distilled knowledge, written directly.
await client.putItems([{ id: "dec-1", kind: "decision", title: "Use KV for recall", body: "..." }]);
await client.close();

Behaviour:

  • capture() never sends by itself. Turns go out every flushIntervalMs (default 60 s), when the buffer reaches flushMaxTurns (default 200), on flush() and on close(). A failed flush keeps the turns in order for the next attempt and reports to onError; after ten intervals of failure the oldest turns are dropped.
  • recall() is served from the edge and can be up to 60 s stale at a distant region. recall({ fresh: true }) reads the origin.
  • sessionStart() returns recall and a presence promise that never rejects.
  • capture(), checkpoint() and putItems() run every body through redact() before sending, so credentials never leave the process. redact() is exported for your own use. See Data and privacy.
  • projectIdFromRemote() flattens any clone URL of one repository to one id.

Agents onboard a machine by fetching one file and following it:

Fetch https://meshpoint.dev/skills/meshpoint-setup/SKILL.md and follow it.

The skill installs the CLI, signs in (device code when there is no browser), connects every harness it finds, runs meshpoint doctor, and reports. It never uses sudo and never asks for a token. Keep your own onboarding instructions pointing at it rather than copying its steps; it changes with the CLI.

Every adapter translates a harness’s events onto five operations of one session object: start (inject recall and presence), user (spool the prompt), assistant (spool the reply and touched paths), nudge (ask for a checkpoint when due) and end (send the spool). Hook-style harnesses run meshpoint tap <harness> once per event with the payload on stdin; in-process harnesses call the same object directly.

If your harness runs shell hooks and speaks the Claude Code hook protocol (event names, additionalContext, Stop decision: block), meshpoint tap claude-code may already work; Codex did. Otherwise the pieces you need are: a session id, the working directory (for the project and branch), the prompt text, the reply text and edited paths, and events for session start, stop, compaction and end. The meshpoint skill goes wherever your harness loads skills from.

The adapters for the seven supported harnesses are the reference implementations; the CLI package ships them under dist/<harness>/.