Skip to content
Koma

TypeScript

The package is @koma/sdk. It needs Node.js 22 or newer, and it is ESM.

import { Client } from "@koma/sdk";
 
const client = new Client({ executable: "koma" });

Hello must list configure. A current TypeScript client rejects an older Koma binary at handshake. That is stricter than Python probe.

Method names on the session are camel case where the wire is snake case. You call waitTurn and interruptAndSubmit. The frames on the wire still say interrupt_and_submit. You do not write those frames yourself.

events takes an abort signal. Abort it to stop reading. waitTurn polls and does not consume that iterator.

for await (const event of session.events({ signal })) {
  if (event.event === "output_append") process.stdout.write(event.text);
}

Build a tarball from src-core-sdk/typescript, then npm install that tarball. The declarations and the runtime are the same package.