sessionpipe-core 0.10.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../schema/v1.ts"],
4
- "sourcesContent": ["// SPDX-License-Identifier: Apache-2.0\n// The one source for the protocol's shapes. schemas/v1/*.json are GENERATED from\n// this file (`npm run schemas`); core's runtime types are inferred from it with\n// type-only imports, so zod never enters the zero-dependency bundle. Prose lives in\n// spec/PROTOCOL.md; a rule that is not encoded here is a MUST in words only.\nimport { z } from \"zod\";\n\nexport const PROTOCOL = 1;\n\n/** Dotted, lowercase. Unknown types MUST be accepted and stored. */\nexport const EventType = z\n .string()\n .regex(/^(?:native|[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+)$/, \"dotted lowercase type, or native\");\n\nexport const KNOWN_TYPES = [\n \"session.started\",\n \"session.heartbeat\",\n \"session.ended\",\n \"session.backfill\",\n \"session.forgotten\",\n \"turn.started\",\n \"turn.ended\",\n \"turn.transcript\",\n \"turn.progress\",\n \"tool.started\",\n \"tool.ended\",\n \"files.changed\",\n \"attention.needed\",\n \"attention.cleared\",\n \"subagent.started\",\n \"subagent.ended\",\n \"context.compacted\",\n \"native\",\n] as const;\n\n/** The lowest tier that carries each known type. */\nexport const TYPE_TIER: Record<(typeof KNOWN_TYPES)[number], 0 | 1 | 2 | 3> = {\n \"session.started\": 0,\n \"session.heartbeat\": 0,\n \"session.ended\": 0,\n \"session.backfill\": 0,\n \"session.forgotten\": 0,\n \"turn.started\": 0,\n \"turn.ended\": 0,\n \"turn.transcript\": 2,\n \"turn.progress\": 2,\n \"tool.started\": 1,\n \"tool.ended\": 1,\n \"files.changed\": 1,\n \"attention.needed\": 0,\n \"attention.cleared\": 0,\n \"subagent.started\": 1,\n \"subagent.ended\": 1,\n \"context.compacted\": 1,\n native: 3,\n};\n\nexport const HARNESS_NAMES = [\n \"claude-code\",\n \"codex\",\n \"gemini-cli\",\n \"antigravity\",\n \"devin\",\n \"cursor\",\n \"copilot-cli\",\n \"droid\",\n \"kiro\",\n \"opencode\",\n] as const;\n\nexport const Tier = z.int().min(0).max(3);\nexport const Ulid = z.string().regex(/^[0-9A-HJKMNP-TV-Z]{26}$/, \"ULID\");\nexport const Rfc3339 = z.iso.datetime({ offset: false, precision: 3 });\nexport const SessionId = z\n .string()\n .min(1)\n .max(128)\n .regex(/^[A-Za-z0-9._:-]+$/);\nexport const ToolName = z.string().regex(/^[A-Za-z0-9_.:-]{1,120}$/);\n\nexport const Harness = z.object({\n /** From the registry in ADAPTERS.md; a name outside it is allowed ([a-z0-9-]). */\n name: z.string().regex(/^[a-z][a-z0-9-]{0,39}$/),\n version: z.string().max(64).optional(),\n /** The harness's own event name (`PostToolUse`, `agentStop`). */\n event: z.string().max(64).optional(),\n});\n\nexport const Session = z.object({\n id: SessionId,\n /** Monotonic per session per sender; the dedup key with harness.name and id. */\n seq: z.int().min(0),\n machine: z.string().max(80).optional(),\n /** Home is written `~`. */\n cwd: z.string().max(1024).optional(),\n /** A remote URL with credentials stripped. */\n repo: z.string().max(512).optional(),\n branch: z.string().max(256).optional(),\n model: z.string().max(128).optional(),\n title: z.string().max(200).optional(),\n title_source: z.enum([\"custom\", \"harness\", \"first-ask\"]).optional(),\n url: z.url().max(1024).optional(),\n /** An id, never an email. */\n account_id: z.string().max(128).optional(),\n /** Whether a person attends the session, in the harness's own word. Absent = unknown, never false. */\n attended: z.boolean().optional(),\n parent_id: SessionId.nullable().optional(),\n /** `<harness>:<id>` of the session that started this one on purpose (a script running\n * `claude -p` for it), from the launcher's environment. Absent for a subagent, whose\n * launcher is its parent, and when nothing says. */\n launched_by: z\n .string()\n .regex(/^[a-z][a-z0-9-]{0,39}:[A-Za-z0-9._:-]{1,128}$/)\n .optional(),\n});\n\nexport const Privacy = z.object({\n /** The redaction rulesets that ran; `secrets@1` always above tier 0. */\n rulesets: z.array(z.string().regex(/^[a-z][a-z0-9-]*@\\d+$/)),\n pii: z.boolean(),\n});\n\nexport const Event = z.object({\n protocol: z.literal(PROTOCOL),\n id: Ulid,\n type: EventType,\n time: Rfc3339,\n tier: Tier,\n harness: Harness,\n session: Session,\n privacy: Privacy,\n /** Per type (see EventData); extra keys allowed and kept. */\n data: z.record(z.string(), z.unknown()),\n});\n\n// --- data per type --------------------------------------------------------------\n\nconst Loose = z.object({}).loose();\nexport const AttentionKind = z.enum([\"permission\", \"question\", \"elicitation\", \"idle\", \"error\"]);\n\nexport const EventData = z.object({\n \"session.started\": Loose.extend({ source: z.enum([\"startup\", \"resume\", \"clear\", \"compact\", \"fork\", \"unknown\"]) }),\n \"session.heartbeat\": Loose,\n \"session.ended\": Loose.extend({ reason: z.enum([\"clear\", \"logout\", \"exit\", \"other\"]) }),\n \"session.backfill\": Loose.extend({ started_at: Rfc3339, last_at: Rfc3339, turns: z.int().min(0).optional() }),\n \"session.forgotten\": Loose,\n \"turn.started\": Loose.extend({\n turn_id: z.string().max(128).optional(),\n prompt_chars: z.int().min(0).optional(),\n /** The harness's OWN word for who submitted the prompt, forwarded verbatim; not an enum\n * of this spec (Claude Code: user, sdk, system, loop_wakeup, schedule_wakeup,\n * poll_event), and a different vocabulary from session.started.source. A bare word:\n * tier 0 is not redacted, so the shape is the only guard. */\n submitted_by: z\n .string()\n .regex(/^[A-Za-z0-9][A-Za-z0-9_.-]{0,39}$/, \"a bare word, at most 40 characters\")\n .optional(),\n /** True when the prompt text is a block the harness wrote rather than words a person\n * typed; never a claim that no person caused the turn. */\n injected: z.boolean().optional(),\n }),\n \"turn.ended\": Loose.extend({\n turn_id: z.string().max(128).optional(),\n reason: z.enum([\"stop\", \"interrupt\", \"error\"]),\n /** The harness's error class when reason is error (rate_limit, overloaded, authentication_failed, server_error \u2026). */\n error: z.string().max(200).optional(),\n ms: z.int().min(0).optional(),\n /** Background work the harness reports still in flight as the turn ends, each of which wakes the session when it finishes (Claude Code: shell commands, monitors, subagents, workflows). Absent when the harness doesn't say. */\n background: z.int().min(0).optional(),\n }),\n \"turn.transcript\": Loose.extend({\n turn: z.int().min(0),\n user: z.string().max(20_000),\n assistant: z.string().max(20_000),\n at: Rfc3339,\n }),\n /** The turn still running: its prompt and what the assistant has said so far. A\n * later turn.progress for the same turn replaces it; the turn.transcript with the\n * same number supersedes it. Over 20 000 chars, the assistant side keeps its END. */\n \"turn.progress\": Loose.extend({\n turn: z.int().min(0),\n user: z.string().max(20_000),\n assistant: z.string().max(20_000),\n at: Rfc3339,\n }),\n \"tool.started\": Loose.extend({\n tool: ToolName,\n call_id: z.string().max(128).optional(),\n turn_id: z.string().max(128).optional(),\n /** Set when a subagent made the call. */\n agent_id: z.string().max(128).optional(),\n input: z.unknown().optional(),\n }),\n \"tool.ended\": Loose.extend({\n tool: ToolName,\n call_id: z.string().max(128).optional(),\n turn_id: z.string().max(128).optional(),\n agent_id: z.string().max(128).optional(),\n ms: z.int().min(0).optional(),\n ok: z.boolean(),\n error: z.string().max(2000).optional(),\n input: z.unknown().optional(),\n output: z.unknown().optional(),\n }),\n \"files.changed\": Loose.extend({ paths: z.array(z.string().max(1024)).max(500) }),\n \"attention.needed\": Loose.extend({\n attention_id: z.string().max(128),\n kind: AttentionKind,\n tool: ToolName.optional(),\n message: z.string().max(200).optional(),\n }),\n \"attention.cleared\": Loose.extend({\n attention_id: z.string().max(128),\n how: z.enum([\"answered\", \"cancelled\", \"timeout\", \"unknown\"]),\n }),\n \"subagent.started\": Loose.extend({ agent_id: z.string().max(128), agent_type: z.string().max(128).optional() }),\n \"subagent.ended\": Loose.extend({ agent_id: z.string().max(128), agent_type: z.string().max(128).optional() }),\n \"context.compacted\": Loose.extend({ trigger: z.enum([\"manual\", \"auto\"]) }),\n native: Loose,\n});\n\n// --- wire -----------------------------------------------------------------------\n\nexport const Batch = z.object({ events: z.array(Event).min(1).max(50) });\n\nexport const BatchResponse = z.object({\n accepted: z.int().min(0),\n duplicates: z.int().min(0),\n rejected: z.array(z.object({ id: Ulid, reason: z.string().max(200) })),\n max_tier: Tier,\n});\n\nexport const ErrorResponse = z.object({\n reason: z.string().max(200),\n supported: z.array(z.int()).optional(),\n max_tier: Tier.optional(),\n});\n\nexport const Capability = z.enum([\"events\", \"backfill\", \"forget\", \"control\", \"native\"]);\n\n// --- control (CONTROL.md) ---------------------------------------------------------\n\nconst B64Url = z.string().regex(/^[A-Za-z0-9_-]*$/, \"base64url, no padding\");\nexport const MachineId = z.string().regex(/^m_[A-Za-z0-9_-]{16,40}$/, \"m_ + 16\u201340 base64url\");\n/** `<harness>:<id>`; the id follows its adapter's rule (Claude Code: a UUID). */\nexport const SessionRef = z.string().regex(/^[a-z][a-z0-9-]{0,39}:[A-Za-z0-9._:-]{1,128}$/, \"<harness>:<session id>\");\nexport const ControlKind = z.enum([\"prompt\", \"permission.answer\", \"cancel\", \"start\", \"key.add\"]);\n/** The kinds of key a machine or a receiver handles (CONTROL.md \u00A72). Absent: passkeys only. */\nexport const KeyTypes = z\n .array(z.enum([\"passkey\", \"device\"]))\n .min(1)\n .max(2);\nexport const DeliveryMode = z.enum([\"sdk\", \"waiter\", \"turn\", \"api\", \"resume\", \"fork\"]);\n/** How much a started session may do without anyone approving it (CONTROL.md \u00A73.1),\n * narrowest first. Closed: nothing is wider than `auto`. */\nexport const StartPermission = z.enum([\"read\", \"safe\", \"edits\", \"auto\"]);\n/** What a start ran with, or gets by default: a level, or `inherit` (no permission flag,\n * the harness's own default) on a machine the person put in inherit mode. Never a\n * command's `permission`. */\nexport const RunLevel = z.enum([\"read\", \"safe\", \"edits\", \"auto\", \"inherit\"]);\n/** A model id as the harness names it, passed as one argument: never a leading dash. */\nexport const ModelId = z\n .string()\n .min(1)\n .max(100)\n .regex(/^[A-Za-z0-9][A-Za-z0-9._:/@[\\]-]*$/, \"a model id\");\nconst HarnessName = z.string().regex(/^[a-z][a-z0-9-]{0,39}$/);\n\n/** A file attached to a `start` (CONTROL.md \u00A73.1). The bytes wait on the receiver\n * (`GET {control}/files/{sha256}`); the signed hash is what the machine checks.\n * Beyond this shape the verifier also checks: the name's length after NFC, names\n * unique case-insensitively, and the sizes adding up to at most 50 MiB. */\nexport const ControlFile = z.object({\n /** Written as is (NFC) into the session's folder: no slash, backslash or control\n * character, not starting with a dot. */\n name: z\n .string()\n .min(1)\n .max(200)\n .regex(\n // biome-ignore lint/suspicious/noControlCharactersInRegex: control characters are what it rejects\n /^[^./\\\\\\x00-\\x1f\\x7f][^/\\\\\\x00-\\x1f\\x7f]*$/,\n \"a file name: no slash, backslash, control character or leading dot\",\n ),\n /** Media type, `type/subtype` (case-insensitive). */\n type: z\n .string()\n .min(1)\n .max(100)\n .regex(/^[A-Za-z0-9][A-Za-z0-9!#$&^_.+-]*\\/[A-Za-z0-9][A-Za-z0-9!#$&^_.+-]*$/, \"type/subtype\"),\n /** Bytes: 1 to 25 MiB. */\n size: z.int().min(1).max(26_214_400),\n /** SHA-256 of the bytes, base64url without padding. */\n sha256: z.string().regex(/^[A-Za-z0-9_-]{43}$/, \"43 base64url characters\"),\n});\n\n/** The signed command, as the device writes it. The machine verifies the EXACT string\n * it received (control.json `cmd`) and never re-serializes it. */\nexport const ControlCommand = z.object({\n v: z.literal(1),\n t: z.literal(\"sessionpipe.control\"),\n machine: MachineId,\n kind: ControlKind,\n session: SessionRef,\n /** prompt, start: the message for the model. */\n text: z.string().min(1).max(20_000).optional(),\n /** permission.answer: the attention_id being answered. */\n for: z.string().min(1).max(128).optional(),\n decision: z.enum([\"allow\", \"deny\"]).optional(),\n /** Shown to the model beside a decision. */\n note: z.string().max(2000).optional(),\n /** start: the folder the new session runs in: absolute, or `~` / `~/\u2026` under the\n * home of the user the machine's daemon runs as, as events write it. */\n cwd: z.string().max(1024).optional(),\n /** key.add (session `sessionpipe:keys`): the new device's key (a passkey or a device\n * key, control-key.json), which the machine trusts once a key it already trusts\n * signed this command. */\n key: z.lazy(() => ControlKey).optional(),\n /** key.add: what the person calls the device. */\n name: z.string().min(1).max(80).optional(),\n /** start, prompt: 1\u201310 files, together at most 50 MiB, downloaded and checked by hash\n * before the session starts or the message is delivered. On a prompt, only to a\n * machine whose hello says `prompt_files`. */\n files: z.array(ControlFile).min(1).max(10).optional(),\n /** start only: the level the new session runs at, at most the machine's mode. Send\n * it only to a machine whose hello advertises it for the harness (`start`). */\n permission: StartPermission.optional(),\n /** start only: the model the harness runs. As `permission`: only when advertised. */\n model: ModelId.optional(),\n /** At least 16 random bytes, base64url. */\n nonce: z.string().regex(/^[A-Za-z0-9_-]{22,64}$/),\n /** Epoch ms, the signing device's clock. */\n iat: z.int().min(1),\n});\n\n/** A day grant's signed string: a passkey vouches for a device key for \u2264 24 h. */\nexport const ControlGrant = z.object({\n v: z.literal(1),\n t: z.literal(\"sessionpipe.grant\"),\n /** The day key: P-256 SPKI, base64url. */\n pub: B64Url.min(1),\n iat: z.int().min(1),\n exp: z.int().min(1),\n /** The receiver's WebAuthn rp id (well-known control.signing.rp_id). */\n rp: z.string().min(1).max(253),\n});\n\n/** A WebAuthn assertion: credential id, authenticatorData, clientDataJSON, signature. */\nexport const ControlAssertion = z.object({\n cred: B64Url.min(1),\n ad: B64Url.min(1),\n cd: B64Url.min(1),\n sig: B64Url.min(1),\n});\n\n/** A device key's signature (CONTROL.md \u00A73.2): its id and 64 bytes r\u2016s over\n * `sessionpipe.device.v1\u23CE<purpose>\u23CE<rp id>\u23CE<challenge>`. Nothing else. The shape\n * only, like an assertion's: the machine reads the key from its own record and checks\n * the rest (a 43-character id, exactly 64 bytes), so a carrier never decides a kind. */\nexport const ControlDeviceSignature = z.strictObject({\n cred: B64Url.min(1),\n /** 64 bytes r\u2016s, base64url without padding. */\n sig: B64Url.min(1),\n});\n\n/** A key enrolled on a machine, closed: a passkey (credential id, COSE alg, SPKI), or a\n * device key an app holds in hardware (CONTROL.md \u00A72 \"Device keys\"), which names\n * itself by its SPKI's SHA-256 and says how it is held. A machine refuses any other\n * field or value, so a kind added later is refused by every machine that predates it. */\nexport const ControlKey = z.xor([\n z.strictObject({\n id: B64Url.min(16).max(1400),\n alg: z.union([z.literal(-7), z.literal(-257)]),\n spki: B64Url.min(1),\n }),\n z.strictObject({\n /** SHA-256 of the SPKI bytes, base64url without padding. */\n id: z.string().regex(/^[A-Za-z0-9_-]{43}$/, \"SHA-256 of the spki, base64url\"),\n alg: z.literal(-7),\n spki: B64Url.min(1),\n type: z.literal(\"device\"),\n /** The private key was made in a hardware key store and never leaves it. */\n store: z.literal(\"hardware\"),\n /** The store will not sign without verifying the person, every time. */\n uv: z.literal(\"each-use\"),\n }),\n]);\n\n/** One message as a receiver carries it: its own envelope around the signed bytes. */\nexport const ControlMessage = z.object({\n /** The receiver's id for this message; the ack key. Not signed: the nonce inside cmd is. */\n id: Ulid,\n /** The command string, exactly as signed (\u2264 48 000 characters). */\n cmd: z.string().min(1).max(48_000),\n /** The day key's ECDSA P-256 / SHA-256 signature over cmd: raw r\u2016s, base64url. */\n csig: B64Url.nullable().optional(),\n /** The grant vouching for the day key: its string plus the passkey's assertion over\n * sha256(str), or a device key's signature over it (CONTROL.md \u00A73.2). */\n grant: z\n .xor([\n ControlAssertion.extend({ str: z.string().min(1).max(2000) }),\n ControlDeviceSignature.extend({ str: z.string().min(1).max(2000) }),\n ])\n .nullable()\n .optional(),\n /** Instead of csig + grant: one passkey assertion (or device signature) over sha256(cmd). */\n confirm: z.xor([ControlAssertion, ControlDeviceSignature]).nullable().optional(),\n /** The receiver's clock. */\n at: Rfc3339,\n /** After this the machine MUST NOT act and acks `expired`; at most 24 h after `at`. */\n expires_at: Rfc3339,\n});\n\nexport const ControlPoll = z.object({ messages: z.array(ControlMessage) });\n\n/** `taken` is the one non-final outcome: the machine verified the message and is\n * delivering it (a headless resume can take minutes); a final ack follows. */\n/** `progress` (not final): the answer so far, whole, in `reply`, with a rising `seq`.\n * `taken` (not final): verified and being delivered. Every other outcome is final. */\nexport const ControlOutcome = z.enum([\"progress\", \"taken\", \"delivered\", \"expired\", \"unsupported\", \"failed\", \"refused\"]);\n\nexport const ControlAck = z.object({\n acks: z\n .array(\n z.object({\n id: Ulid,\n outcome: ControlOutcome,\n at: Rfc3339,\n /** delivered: how it reached the session. */\n mode: DeliveryMode.optional(),\n /** The session that took it, when not the one named (a fork's copy, a started session). */\n session: SessionRef.optional(),\n /** refused: the verifier's code, or the machine's own (`folder`, `no_attention`, `busy`);\n * failed: `file` when a start's attachment couldn't be fetched, checked or written,\n * `model` when the harness wouldn't run the start's model. */\n code: z\n .string()\n .regex(/^[a-z_]{1,40}$/)\n .optional(),\n detail: z.string().max(500).optional(),\n /** resume / fork / start: the agent's reply, redacted by the secrets ruleset. */\n reply: z.string().max(20_000).optional(),\n /** progress only: rises with every progress ack for this id; a receiver keeps the highest. */\n seq: z.int().min(0).optional(),\n /** taken, delivered of a start: the options it ran with (`model` only when one was\n * asked for). A receiver shows this, never what was asked. */\n applied: z.strictObject({ permission: RunLevel.optional(), model: ModelId.optional() }).optional(),\n }),\n )\n .min(1),\n});\n\n/** A harness account signed in on the machine: the id `session.account_id` carries,\n * and the email it signs in with, so a receiver the person paired with can name the\n * account rather than show an id. Only pair and hello carry it, never an event. */\nexport const HarnessAccount = z.object({\n harness: z.string().regex(/^[a-z][a-z0-9-]{0,39}$/),\n id: z.string().min(1).max(128),\n email: z.string().max(254).optional(),\n /** What to call an account that has no email: a Claude Code home that runs on\n * another API is named by its endpoint's host (`api.z.ai`). */\n name: z.string().min(1).max(200).optional(),\n});\n\n/** `POST {control}/pair`, sent with the person's sink token from their own terminal \u2014\n * or, where the receiver declares `control.open_pairing`, with no token and a\n * `poll_key` (CONTROL.md \u00A72). */\nexport const ControlPairStart = z.object({\n /** Open pairing: a random secret only this terminal knows. Status polls present it\n * as their bearer; the receiver keeps only a hash. */\n poll_key: z\n .string()\n .regex(/^[A-Za-z0-9_-]{22,128}$/)\n .optional(),\n /** Set when adding a key to a machine already paired. */\n machine: MachineId.optional(),\n name: z.string().min(1).max(80),\n harnesses: z.array(z.string().regex(/^[a-z][a-z0-9-]{0,39}$/)).max(20),\n modes: z.array(DeliveryMode),\n version: z.string().max(40),\n /** The folders the machine lets sessions run in, for the receiver's \"new session\"\n * picker. Informational: the machine checks its own list again. */\n folders: z.array(z.string().max(1024)).max(50).optional(),\n /** safe: nothing that needs approval runs unattended; auto: the harness's auto mode;\n * inherit: no permission flag, each harness's own default there. Chosen at the machine. */\n mode: z.enum([\"safe\", \"auto\", \"inherit\"]).optional(),\n /** The harness accounts signed in here, so the receiver's board can name each\n * `session.account_id` (CONTROL.md \u00A72). */\n accounts: z.array(HarnessAccount).max(20).optional(),\n /** The machine takes `files` on a start (downloads, checks and writes them). A\n * machine that doesn't say so may ignore them: a receiver SHOULD NOT send it files. */\n files: z.boolean().optional(),\n /** The kinds of key this machine takes (unique; absent means `[\"passkey\"]`). A\n * client offers a device key only to a machine that lists `device`. */\n key_types: KeyTypes.optional(),\n});\n\n/** The receiver's answer: where the person confirms, and the digits both screens show. */\nexport const ControlPairStarted = z.object({\n machine: MachineId,\n code: z.string().regex(/^[A-Za-z0-9_-]{6,32}$/),\n url: z.url(),\n /** Six digits the terminal and the receiver's page both show. */\n check: z.string().regex(/^\\d{6}$/),\n expires_at: Rfc3339,\n});\n\n/** `GET {control}/pair?code=\u2026` once the person confirmed. The machine verifies `proof`\n * over sha256(\"sessionpipe.pair:<machine>:<code>\") before it trusts `key`. */\nexport const ControlPaired = z.object({\n status: z.enum([\"pending\", \"paired\", \"expired\"]),\n /** The key approved, whole: a device key keeps its type, store and uv. */\n key: ControlKey.optional(),\n /** The key's proof: a passkey assertion, or a device signature for purpose `pair`. */\n proof: z.xor([ControlAssertion, ControlDeviceSignature]).optional(),\n /** The machine's own bearer for polls, acks and hello: opens nothing else. Minted\n * once, at the first pairing of a machine. */\n token: z.string().min(16).max(256).optional(),\n /** Optional: a key for the events lane (`sink add`), so the receiver's session board\n * shows this machine without a second step. Handed over once. */\n sink_token: z.string().min(16).max(256).optional(),\n /** Optional: who approved, in the receiver's words (a @handle), so the terminal can\n * say whose passkey it now trusts. */\n account: z.string().max(200).optional(),\n});\n\n/** `POST {control}/hello`: what the machine can do right now. */\nexport const ControlHello = z.object({\n name: z.string().min(1).max(80),\n harnesses: z.array(z.string().regex(/^[a-z][a-z0-9-]{0,39}$/)).max(20),\n modes: z.array(DeliveryMode),\n /** Credential ids of the keys enrolled on the machine. */\n keys: z.array(B64Url.min(16).max(1400)).max(50),\n version: z.string().max(40),\n /** Live sessions with a waiter parked on the daemon's socket. */\n waiting: z.array(SessionRef).max(500).optional(),\n /** As in control-pair.json: informational, re-checked on the machine. */\n folders: z.array(z.string().max(1024)).max(50).optional(),\n mode: z.enum([\"safe\", \"auto\", \"inherit\"]).optional(),\n /** As in control-pair.json: read again for every hello, so a new sign-in is named. */\n accounts: z.array(HarnessAccount).max(20).optional(),\n /** As in control-pair.json. */\n files: z.boolean().optional(),\n /** The machine takes `files` on a prompt too (CONTROL.md \u00A76 `prompt`). One that\n * doesn't say so refuses them: a receiver SHOULD NOT send it a prompt with files. */\n prompt_files: z.boolean().optional(),\n /** Per harness in `harnesses`: the options a start may carry (CONTROL.md \u00A72). No\n * entry: neither `permission` nor `model`. */\n start: z\n .record(\n HarnessName,\n z.object({\n /** The levels it starts at here, already capped by `mode`. */\n permissions: z.array(StartPermission).min(1).max(4).meta({ uniqueItems: true }),\n /** What a start that names none gets: one of `permissions`, or `inherit` on an\n * inherit machine. */\n permission: RunLevel,\n /** Model ids the harness offers here: a suggestion, not a promise. */\n models: z.array(ModelId).max(50).optional(),\n /** Any well-formed model is passed to the harness (which may still reject it). */\n any_model: z.boolean().optional(),\n }),\n )\n .refine((o) => Object.keys(o).length <= 50, \"at most 50 harnesses\")\n .meta({ maxProperties: 50 })\n .optional(),\n /** As in control-pair.json. */\n key_types: KeyTypes.optional(),\n});\n\nexport const WellKnown = z.object({\n protocol: z.array(z.int().min(1)).min(1),\n max_tier: Tier,\n capabilities: z.array(z.string().regex(/^[a-z][a-z0-9-]*$/)),\n auth: z.array(z.enum([\"bearer\"])).default([\"bearer\"]),\n endpoints: z.object({\n events: z.string(),\n control: z.string().optional(),\n native: z.string().optional(),\n }),\n batch: z.object({ max_events: z.int().min(1).max(50), max_bytes: z.int().min(1024).max(262_144) }),\n control: z\n .object({\n wait_max_s: z.int().min(1).max(60),\n /** Pairing may start with no token: the person approves the link signed in. */\n open_pairing: z.boolean().optional(),\n /** MCP servers (`mcp__<server>`) a session answering this receiver's message may\n * use without asking. MCP servers only: a daemon ignores anything else. */\n session_tools: z\n .array(z.string().regex(/^mcp__[A-Za-z0-9_-]{1,64}$/))\n .max(8)\n .optional(),\n /** How commands are signed: the WebAuthn rp id keys are enrolled for, and the algorithms. */\n signing: z.object({\n rp_id: z.string().min(1).max(253),\n algs: z.array(z.union([z.literal(-7), z.literal(-257)])).min(1),\n /** The kinds of key the receiver stores and carries whole (CONTROL.md \u00A72).\n * Absent means `[\"passkey\"]`. */\n key_types: KeyTypes.optional(),\n }),\n /** Informational: the receiver accepts `files` on a start and serves\n * `GET {control}/files/{sha256}`. */\n files: z.boolean().optional(),\n /** The receiver shows a machine in `inherit` mode as that, never as safe or auto.\n * A daemon pairs in, or switches to, `inherit` only with receivers that say so. */\n inherit: z.boolean().optional(),\n })\n .optional(),\n});\n\n/** What `npm run schemas` writes to schemas/v1/<name>.json. */\nexport const SCHEMAS = {\n event: Event,\n \"event-data\": EventData,\n batch: Batch,\n \"batch-response\": BatchResponse,\n error: ErrorResponse,\n \"well-known\": WellKnown,\n control: ControlMessage,\n \"control-command\": ControlCommand,\n \"control-grant\": ControlGrant,\n \"control-key\": ControlKey,\n \"control-poll\": ControlPoll,\n \"control-ack\": ControlAck,\n \"control-pair\": ControlPairStart,\n \"control-pair-started\": ControlPairStarted,\n \"control-paired\": ControlPaired,\n \"control-hello\": ControlHello,\n} as const;\n"],
5
- "mappings": ";;;AAKA,SAAS,SAAS;AAEX,IAAM,WAAW;AAGjB,IAAM,YAAY,EACtB,OAAO,EACP,MAAM,qDAAqD,kCAAkC;AAEzF,IAA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Ae;AAAA,EACf,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,gBAAgB;AAAA,EAChB,wBAAwB;AAAA,EACxB,kBAAkB;AAAA,EAClB,iBAAiB;AACnB;",
4
+ "sourcesContent": ["// SPDX-License-Identifier: Apache-2.0\n// The one source for the protocol's shapes. schemas/v1/*.json are GENERATED from\n// this file (`npm run schemas`); core's runtime types are inferred from it with\n// type-only imports, so zod never enters the zero-dependency bundle. Prose lives in\n// spec/PROTOCOL.md; a rule that is not encoded here is a MUST in words only.\nimport { z } from \"zod\";\n\nexport const PROTOCOL = 1;\n\n/** Dotted, lowercase. Unknown types MUST be accepted and stored. */\nexport const EventType = z\n .string()\n .regex(/^(?:native|[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+)$/, \"dotted lowercase type, or native\");\n\nexport const KNOWN_TYPES = [\n \"session.started\",\n \"session.heartbeat\",\n \"session.ended\",\n \"session.backfill\",\n \"session.forgotten\",\n \"turn.started\",\n \"turn.ended\",\n \"turn.transcript\",\n \"turn.progress\",\n \"tool.started\",\n \"tool.ended\",\n \"files.changed\",\n \"attention.needed\",\n \"attention.cleared\",\n \"subagent.started\",\n \"subagent.ended\",\n \"context.compacted\",\n \"limits.observed\",\n \"native\",\n] as const;\n\n/** The lowest tier that carries each known type. */\nexport const TYPE_TIER: Record<(typeof KNOWN_TYPES)[number], 0 | 1 | 2 | 3> = {\n \"session.started\": 0,\n \"session.heartbeat\": 0,\n \"session.ended\": 0,\n \"session.backfill\": 0,\n \"session.forgotten\": 0,\n \"turn.started\": 0,\n \"turn.ended\": 0,\n \"turn.transcript\": 2,\n \"turn.progress\": 2,\n \"tool.started\": 1,\n \"tool.ended\": 1,\n \"files.changed\": 1,\n \"attention.needed\": 0,\n \"attention.cleared\": 0,\n \"subagent.started\": 1,\n \"subagent.ended\": 1,\n \"context.compacted\": 1,\n \"limits.observed\": 1,\n native: 3,\n};\n\nexport const HARNESS_NAMES = [\n \"claude-code\",\n \"codex\",\n \"gemini-cli\",\n \"antigravity\",\n \"devin\",\n \"cursor\",\n \"copilot-cli\",\n \"droid\",\n \"kiro\",\n \"opencode\",\n] as const;\n\nexport const Tier = z.int().min(0).max(3);\nexport const Ulid = z.string().regex(/^[0-9A-HJKMNP-TV-Z]{26}$/, \"ULID\");\nexport const Rfc3339 = z.iso.datetime({ offset: false, precision: 3 });\nexport const SessionId = z\n .string()\n .min(1)\n .max(128)\n .regex(/^[A-Za-z0-9._:-]+$/);\nexport const ToolName = z.string().regex(/^[A-Za-z0-9_.:-]{1,120}$/);\n\nexport const Harness = z.object({\n /** From the registry in ADAPTERS.md; a name outside it is allowed ([a-z0-9-]). */\n name: z.string().regex(/^[a-z][a-z0-9-]{0,39}$/),\n version: z.string().max(64).optional(),\n /** The harness's own event name (`PostToolUse`, `agentStop`). */\n event: z.string().max(64).optional(),\n});\n\nexport const Session = z.object({\n id: SessionId,\n /** Monotonic per session per sender; the dedup key with harness.name and id. */\n seq: z.int().min(0),\n machine: z.string().max(80).optional(),\n /** Home is written `~`. */\n cwd: z.string().max(1024).optional(),\n /** A remote URL with credentials stripped. */\n repo: z.string().max(512).optional(),\n branch: z.string().max(256).optional(),\n model: z.string().max(128).optional(),\n title: z.string().max(200).optional(),\n title_source: z.enum([\"custom\", \"harness\", \"first-ask\"]).optional(),\n url: z.url().max(1024).optional(),\n /** An id, never an email. */\n account_id: z.string().max(128).optional(),\n /** Whether a person attends the session, in the harness's own word. Absent = unknown, never false. */\n attended: z.boolean().optional(),\n parent_id: SessionId.nullable().optional(),\n /** `<harness>:<id>` of the session that started this one on purpose (a script running\n * `claude -p` for it), from the launcher's environment. Absent for a subagent, whose\n * launcher is its parent, and when nothing says. */\n launched_by: z\n .string()\n .regex(/^[a-z][a-z0-9-]{0,39}:[A-Za-z0-9._:-]{1,128}$/)\n .optional(),\n});\n\nexport const Privacy = z.object({\n /** The redaction rulesets that ran; `secrets@1` always above tier 0. */\n rulesets: z.array(z.string().regex(/^[a-z][a-z0-9-]*@\\d+$/)),\n pii: z.boolean(),\n});\n\nexport const Event = z.object({\n protocol: z.literal(PROTOCOL),\n id: Ulid,\n type: EventType,\n time: Rfc3339,\n tier: Tier,\n harness: Harness,\n session: Session,\n privacy: Privacy,\n /** Per type (see EventData); extra keys allowed and kept. */\n data: z.record(z.string(), z.unknown()),\n});\n\n// --- data per type --------------------------------------------------------------\n\nconst Loose = z.object({}).loose();\nexport const AttentionKind = z.enum([\"permission\", \"question\", \"elicitation\", \"idle\", \"error\"]);\n\n/** One usage window of an account: `id` is the harness's own name for it (`five_hour`,\n * `seven_day`, `primary` \u2026); `used_percent` passes 100 once a spend limit is exceeded. */\nexport const LimitWindow = Loose.extend({\n id: z.string().regex(/^[a-z0-9_]{1,64}$/),\n used_percent: z.number().min(0),\n resets_at: Rfc3339.optional(),\n window_minutes: z.int().min(1).optional(),\n});\n\nexport const EventData = z.object({\n \"session.started\": Loose.extend({ source: z.enum([\"startup\", \"resume\", \"clear\", \"compact\", \"fork\", \"unknown\"]) }),\n \"session.heartbeat\": Loose,\n \"session.ended\": Loose.extend({ reason: z.enum([\"clear\", \"logout\", \"exit\", \"other\"]) }),\n \"session.backfill\": Loose.extend({ started_at: Rfc3339, last_at: Rfc3339, turns: z.int().min(0).optional() }),\n \"session.forgotten\": Loose,\n \"turn.started\": Loose.extend({\n turn_id: z.string().max(128).optional(),\n prompt_chars: z.int().min(0).optional(),\n /** The harness's OWN word for who submitted the prompt, forwarded verbatim; not an enum\n * of this spec (Claude Code: user, sdk, system, loop_wakeup, schedule_wakeup,\n * poll_event), and a different vocabulary from session.started.source. A bare word:\n * tier 0 is not redacted, so the shape is the only guard. */\n submitted_by: z\n .string()\n .regex(/^[A-Za-z0-9][A-Za-z0-9_.-]{0,39}$/, \"a bare word, at most 40 characters\")\n .optional(),\n /** True when the prompt text is a block the harness wrote rather than words a person\n * typed; never a claim that no person caused the turn. */\n injected: z.boolean().optional(),\n }),\n \"turn.ended\": Loose.extend({\n turn_id: z.string().max(128).optional(),\n reason: z.enum([\"stop\", \"interrupt\", \"error\"]),\n /** The harness's error class when reason is error (rate_limit, overloaded, authentication_failed, server_error \u2026). */\n error: z.string().max(200).optional(),\n ms: z.int().min(0).optional(),\n /** Background work the harness reports still in flight as the turn ends, each of which wakes the session when it finishes (Claude Code: shell commands, monitors, subagents, workflows). Absent when the harness doesn't say. */\n background: z.int().min(0).optional(),\n }),\n \"turn.transcript\": Loose.extend({\n turn: z.int().min(0),\n user: z.string().max(20_000),\n assistant: z.string().max(20_000),\n at: Rfc3339,\n }),\n /** The turn still running: its prompt and what the assistant has said so far. A\n * later turn.progress for the same turn replaces it; the turn.transcript with the\n * same number supersedes it. Over 20 000 chars, the assistant side keeps its END. */\n \"turn.progress\": Loose.extend({\n turn: z.int().min(0),\n user: z.string().max(20_000),\n assistant: z.string().max(20_000),\n at: Rfc3339,\n }),\n \"tool.started\": Loose.extend({\n tool: ToolName,\n call_id: z.string().max(128).optional(),\n turn_id: z.string().max(128).optional(),\n /** Set when a subagent made the call. */\n agent_id: z.string().max(128).optional(),\n input: z.unknown().optional(),\n }),\n \"tool.ended\": Loose.extend({\n tool: ToolName,\n call_id: z.string().max(128).optional(),\n turn_id: z.string().max(128).optional(),\n agent_id: z.string().max(128).optional(),\n ms: z.int().min(0).optional(),\n ok: z.boolean(),\n error: z.string().max(2000).optional(),\n input: z.unknown().optional(),\n output: z.unknown().optional(),\n }),\n \"files.changed\": Loose.extend({ paths: z.array(z.string().max(1024)).max(500) }),\n \"attention.needed\": Loose.extend({\n attention_id: z.string().max(128),\n kind: AttentionKind,\n tool: ToolName.optional(),\n message: z.string().max(200).optional(),\n }),\n \"attention.cleared\": Loose.extend({\n attention_id: z.string().max(128),\n how: z.enum([\"answered\", \"cancelled\", \"timeout\", \"unknown\"]),\n }),\n \"subagent.started\": Loose.extend({ agent_id: z.string().max(128), agent_type: z.string().max(128).optional() }),\n \"subagent.ended\": Loose.extend({ agent_id: z.string().max(128), agent_type: z.string().max(128).optional() }),\n \"context.compacted\": Loose.extend({ trigger: z.enum([\"manual\", \"auto\"]) }),\n /** The account's usage limits as the harness last reported them: one per window. */\n \"limits.observed\": Loose.extend({\n windows: z.array(LimitWindow).min(1).max(8),\n plan: z.string().max(64).optional(),\n /** The account the numbers belong to, as `session.account_id` spells it, when the\n * session was served by another account than its own (the pool, CONTROL.md \u00A72). */\n account_id: z.string().max(128).optional(),\n }),\n native: Loose,\n});\n\n// --- wire -----------------------------------------------------------------------\n\nexport const Batch = z.object({ events: z.array(Event).min(1).max(50) });\n\nexport const BatchResponse = z.object({\n accepted: z.int().min(0),\n duplicates: z.int().min(0),\n rejected: z.array(z.object({ id: Ulid, reason: z.string().max(200) })),\n max_tier: Tier,\n});\n\nexport const ErrorResponse = z.object({\n reason: z.string().max(200),\n supported: z.array(z.int()).optional(),\n max_tier: Tier.optional(),\n});\n\nexport const Capability = z.enum([\"events\", \"backfill\", \"forget\", \"control\", \"native\"]);\n\n// --- control (CONTROL.md) ---------------------------------------------------------\n\nconst B64Url = z.string().regex(/^[A-Za-z0-9_-]*$/, \"base64url, no padding\");\nexport const MachineId = z.string().regex(/^m_[A-Za-z0-9_-]{16,40}$/, \"m_ + 16\u201340 base64url\");\n/** `<harness>:<id>`; the id follows its adapter's rule (Claude Code: a UUID). */\nexport const SessionRef = z.string().regex(/^[a-z][a-z0-9-]{0,39}:[A-Za-z0-9._:-]{1,128}$/, \"<harness>:<session id>\");\nexport const ControlKind = z.enum([\"prompt\", \"permission.answer\", \"cancel\", \"start\", \"key.add\", \"pool\"]);\n/** What a `pool` command asks of the machine's account pool (CONTROL.md \u00A76 `pool`). */\nexport const PoolAction = z.enum([\n \"on\",\n \"off\",\n \"enable\",\n \"disable\",\n \"remove\",\n \"order\",\n \"refresh\",\n \"login.begin\",\n \"login.complete\",\n]);\n/** A pooled account's id: what `session.account_id` and `limits.observed.account_id`\n * carry for it (Claude Code: the account UUID), or a pending sign-in's id. */\nexport const PoolAccountId = z.string().regex(/^[A-Za-z0-9._:-]{1,128}$/, \"an account id\");\n/** The kinds of key a machine or a receiver handles (CONTROL.md \u00A72). Absent: passkeys only. */\nexport const KeyTypes = z\n .array(z.enum([\"passkey\", \"device\"]))\n .min(1)\n .max(2);\nexport const DeliveryMode = z.enum([\"sdk\", \"waiter\", \"turn\", \"api\", \"resume\", \"fork\"]);\n/** How much a started session may do without anyone approving it (CONTROL.md \u00A73.1),\n * narrowest first. Closed: nothing is wider than `auto`. */\nexport const StartPermission = z.enum([\"read\", \"safe\", \"edits\", \"auto\"]);\n/** What a start ran with, or gets by default: a level, or `inherit` (no permission flag,\n * the harness's own default) on a machine the person put in inherit mode. Never a\n * command's `permission`. */\nexport const RunLevel = z.enum([\"read\", \"safe\", \"edits\", \"auto\", \"inherit\"]);\n/** A model id as the harness names it, passed as one argument: never a leading dash. */\nexport const ModelId = z\n .string()\n .min(1)\n .max(100)\n .regex(/^[A-Za-z0-9][A-Za-z0-9._:/@[\\]-]*$/, \"a model id\");\nconst HarnessName = z.string().regex(/^[a-z][a-z0-9-]{0,39}$/);\n\n/** A file attached to a `start` (CONTROL.md \u00A73.1). The bytes wait on the receiver\n * (`GET {control}/files/{sha256}`); the signed hash is what the machine checks.\n * Beyond this shape the verifier also checks: the name's length after NFC, names\n * unique case-insensitively, and the sizes adding up to at most 50 MiB. */\nexport const ControlFile = z.object({\n /** Written as is (NFC) into the session's folder: no slash, backslash or control\n * character, not starting with a dot. */\n name: z\n .string()\n .min(1)\n .max(200)\n .regex(\n // biome-ignore lint/suspicious/noControlCharactersInRegex: control characters are what it rejects\n /^[^./\\\\\\x00-\\x1f\\x7f][^/\\\\\\x00-\\x1f\\x7f]*$/,\n \"a file name: no slash, backslash, control character or leading dot\",\n ),\n /** Media type, `type/subtype` (case-insensitive). */\n type: z\n .string()\n .min(1)\n .max(100)\n .regex(/^[A-Za-z0-9][A-Za-z0-9!#$&^_.+-]*\\/[A-Za-z0-9][A-Za-z0-9!#$&^_.+-]*$/, \"type/subtype\"),\n /** Bytes: 1 to 25 MiB. */\n size: z.int().min(1).max(26_214_400),\n /** SHA-256 of the bytes, base64url without padding. */\n sha256: z.string().regex(/^[A-Za-z0-9_-]{43}$/, \"43 base64url characters\"),\n});\n\n/** The signed command, as the device writes it. The machine verifies the EXACT string\n * it received (control.json `cmd`) and never re-serializes it. */\nexport const ControlCommand = z.object({\n v: z.literal(1),\n t: z.literal(\"sessionpipe.control\"),\n machine: MachineId,\n kind: ControlKind,\n session: SessionRef,\n /** prompt, start: the message for the model. */\n text: z.string().min(1).max(20_000).optional(),\n /** permission.answer: the attention_id being answered. */\n for: z.string().min(1).max(128).optional(),\n decision: z.enum([\"allow\", \"deny\"]).optional(),\n /** Shown to the model beside a decision. */\n note: z.string().max(2000).optional(),\n /** start: the folder the new session runs in: absolute, or `~` / `~/\u2026` under the\n * home of the user the machine's daemon runs as, as events write it. */\n cwd: z.string().max(1024).optional(),\n /** key.add (session `sessionpipe:keys`): the new device's key (a passkey or a device\n * key, control-key.json), which the machine trusts once a key it already trusts\n * signed this command. */\n key: z.lazy(() => ControlKey).optional(),\n /** key.add: what the person calls the device. */\n name: z.string().min(1).max(80).optional(),\n /** start, prompt: 1\u201310 files, together at most 50 MiB, downloaded and checked by hash\n * before the session starts or the message is delivered. On a prompt, only to a\n * machine whose hello says `prompt_files`. */\n files: z.array(ControlFile).min(1).max(10).optional(),\n /** start only: the level the new session runs at, at most the machine's mode. Send\n * it only to a machine whose hello advertises it for the harness (`start`). */\n permission: StartPermission.optional(),\n /** start only: the model the harness runs. As `permission`: only when advertised. */\n model: ModelId.optional(),\n /** pool (session `sessionpipe:pool`): what to do with the machine's account pool.\n * Each action takes exactly the fields CONTROL.md \u00A76 `pool` lists for it. */\n pool_action: PoolAction.optional(),\n /** enable, disable, remove, login.complete (the pending sign-in's id); refresh MAY. */\n pool_account: PoolAccountId.optional(),\n /** order: every account of the pool, once each, in the order wanted. */\n pool_order: z.array(PoolAccountId).min(1).max(20).meta({ uniqueItems: true }).optional(),\n /** login.complete: what the person pasted back from the sign-in page (`code#state`). */\n pool_code: z\n .string()\n .min(1)\n .max(512)\n .regex(/^[^\\r\\n]+$/, \"one line\")\n .optional(),\n /** At least 16 random bytes, base64url. */\n nonce: z.string().regex(/^[A-Za-z0-9_-]{22,64}$/),\n /** Epoch ms, the signing device's clock. */\n iat: z.int().min(1),\n});\n\n/** A day grant's signed string: a passkey vouches for a device key for \u2264 24 h. */\nexport const ControlGrant = z.object({\n v: z.literal(1),\n t: z.literal(\"sessionpipe.grant\"),\n /** The day key: P-256 SPKI, base64url. */\n pub: B64Url.min(1),\n iat: z.int().min(1),\n exp: z.int().min(1),\n /** The receiver's WebAuthn rp id (well-known control.signing.rp_id). */\n rp: z.string().min(1).max(253),\n});\n\n/** A WebAuthn assertion: credential id, authenticatorData, clientDataJSON, signature. */\nexport const ControlAssertion = z.object({\n cred: B64Url.min(1),\n ad: B64Url.min(1),\n cd: B64Url.min(1),\n sig: B64Url.min(1),\n});\n\n/** A device key's signature (CONTROL.md \u00A73.2): its id and 64 bytes r\u2016s over\n * `sessionpipe.device.v1\u23CE<purpose>\u23CE<rp id>\u23CE<challenge>`. Nothing else. The shape\n * only, like an assertion's: the machine reads the key from its own record and checks\n * the rest (a 43-character id, exactly 64 bytes), so a carrier never decides a kind. */\nexport const ControlDeviceSignature = z.strictObject({\n cred: B64Url.min(1),\n /** 64 bytes r\u2016s, base64url without padding. */\n sig: B64Url.min(1),\n});\n\n/** A key enrolled on a machine, closed: a passkey (credential id, COSE alg, SPKI), or a\n * device key an app holds in hardware (CONTROL.md \u00A72 \"Device keys\"), which names\n * itself by its SPKI's SHA-256 and says how it is held. A machine refuses any other\n * field or value, so a kind added later is refused by every machine that predates it. */\nexport const ControlKey = z.xor([\n z.strictObject({\n id: B64Url.min(16).max(1400),\n alg: z.union([z.literal(-7), z.literal(-257)]),\n spki: B64Url.min(1),\n }),\n z.strictObject({\n /** SHA-256 of the SPKI bytes, base64url without padding. */\n id: z.string().regex(/^[A-Za-z0-9_-]{43}$/, \"SHA-256 of the spki, base64url\"),\n alg: z.literal(-7),\n spki: B64Url.min(1),\n type: z.literal(\"device\"),\n /** The private key was made in a hardware key store and never leaves it. */\n store: z.literal(\"hardware\"),\n /** The store will not sign without verifying the person, every time. */\n uv: z.literal(\"each-use\"),\n }),\n]);\n\n/** One message as a receiver carries it: its own envelope around the signed bytes. */\nexport const ControlMessage = z.object({\n /** The receiver's id for this message; the ack key. Not signed: the nonce inside cmd is. */\n id: Ulid,\n /** The command string, exactly as signed (\u2264 48 000 characters). */\n cmd: z.string().min(1).max(48_000),\n /** The day key's ECDSA P-256 / SHA-256 signature over cmd: raw r\u2016s, base64url. */\n csig: B64Url.nullable().optional(),\n /** The grant vouching for the day key: its string plus the passkey's assertion over\n * sha256(str), or a device key's signature over it (CONTROL.md \u00A73.2). */\n grant: z\n .xor([\n ControlAssertion.extend({ str: z.string().min(1).max(2000) }),\n ControlDeviceSignature.extend({ str: z.string().min(1).max(2000) }),\n ])\n .nullable()\n .optional(),\n /** Instead of csig + grant: one passkey assertion (or device signature) over sha256(cmd). */\n confirm: z.xor([ControlAssertion, ControlDeviceSignature]).nullable().optional(),\n /** The receiver's clock. */\n at: Rfc3339,\n /** After this the machine MUST NOT act and acks `expired`; at most 24 h after `at`. */\n expires_at: Rfc3339,\n});\n\nexport const ControlPoll = z.object({ messages: z.array(ControlMessage) });\n\n/** `taken` is the one non-final outcome: the machine verified the message and is\n * delivering it (a headless resume can take minutes); a final ack follows. */\n/** `progress` (not final): the answer so far, whole, in `reply`, with a rising `seq`.\n * `taken` (not final): verified and being delivered. Every other outcome is final. */\nexport const ControlOutcome = z.enum([\"progress\", \"taken\", \"delivered\", \"expired\", \"unsupported\", \"failed\", \"refused\"]);\n\nexport const ControlAck = z.object({\n acks: z\n .array(\n z.object({\n id: Ulid,\n outcome: ControlOutcome,\n at: Rfc3339,\n /** delivered: how it reached the session. */\n mode: DeliveryMode.optional(),\n /** The session that took it, when not the one named (a fork's copy, a started session). */\n session: SessionRef.optional(),\n /** refused: the verifier's code, or the machine's own (`folder`, `no_attention`, `busy`);\n * failed: `file` when a start's attachment couldn't be fetched, checked or written,\n * `model` when the harness wouldn't run the start's model. */\n code: z\n .string()\n .regex(/^[a-z_]{1,40}$/)\n .optional(),\n detail: z.string().max(500).optional(),\n /** resume / fork / start: the agent's reply, redacted by the secrets ruleset. */\n reply: z.string().max(20_000).optional(),\n /** progress only: rises with every progress ack for this id; a receiver keeps the highest. */\n seq: z.int().min(0).optional(),\n /** taken, delivered of a start: the options it ran with (`model` only when one was\n * asked for). A receiver shows this, never what was asked. */\n applied: z.strictObject({ permission: RunLevel.optional(), model: ModelId.optional() }).optional(),\n }),\n )\n .min(1),\n});\n\n/** A harness account signed in on the machine: the id `session.account_id` carries,\n * and the email it signs in with, so a receiver the person paired with can name the\n * account rather than show an id. Only pair and hello carry it, never an event. */\nexport const HarnessAccount = z.object({\n harness: z.string().regex(/^[a-z][a-z0-9-]{0,39}$/),\n id: z.string().min(1).max(128),\n email: z.string().max(254).optional(),\n /** What to call an account that has no email: a Claude Code home that runs on\n * another API is named by its endpoint's host (`api.z.ai`). */\n name: z.string().min(1).max(200).optional(),\n});\n\n/** `POST {control}/pair`, sent with the person's sink token from their own terminal \u2014\n * or, where the receiver declares `control.open_pairing`, with no token and a\n * `poll_key` (CONTROL.md \u00A72). */\nexport const ControlPairStart = z.object({\n /** Open pairing: a random secret only this terminal knows. Status polls present it\n * as their bearer; the receiver keeps only a hash. */\n poll_key: z\n .string()\n .regex(/^[A-Za-z0-9_-]{22,128}$/)\n .optional(),\n /** Set when adding a key to a machine already paired. */\n machine: MachineId.optional(),\n name: z.string().min(1).max(80),\n harnesses: z.array(z.string().regex(/^[a-z][a-z0-9-]{0,39}$/)).max(20),\n modes: z.array(DeliveryMode),\n version: z.string().max(40),\n /** The folders the machine lets sessions run in, for the receiver's \"new session\"\n * picker. Informational: the machine checks its own list again. */\n folders: z.array(z.string().max(1024)).max(50).optional(),\n /** safe: nothing that needs approval runs unattended; auto: the harness's auto mode;\n * inherit: no permission flag, each harness's own default there. Chosen at the machine. */\n mode: z.enum([\"safe\", \"auto\", \"inherit\"]).optional(),\n /** The harness accounts signed in here, so the receiver's board can name each\n * `session.account_id` (CONTROL.md \u00A72). */\n accounts: z.array(HarnessAccount).max(20).optional(),\n /** The machine takes `files` on a start (downloads, checks and writes them). A\n * machine that doesn't say so may ignore them: a receiver SHOULD NOT send it files. */\n files: z.boolean().optional(),\n /** The kinds of key this machine takes (unique; absent means `[\"passkey\"]`). A\n * client offers a device key only to a machine that lists `device`. */\n key_types: KeyTypes.optional(),\n});\n\n/** The receiver's answer: where the person confirms, and the digits both screens show. */\nexport const ControlPairStarted = z.object({\n machine: MachineId,\n code: z.string().regex(/^[A-Za-z0-9_-]{6,32}$/),\n url: z.url(),\n /** Six digits the terminal and the receiver's page both show. */\n check: z.string().regex(/^\\d{6}$/),\n expires_at: Rfc3339,\n});\n\n/** `GET {control}/pair?code=\u2026` once the person confirmed. The machine verifies `proof`\n * over sha256(\"sessionpipe.pair:<machine>:<code>\") before it trusts `key`. */\nexport const ControlPaired = z.object({\n status: z.enum([\"pending\", \"paired\", \"expired\"]),\n /** The key approved, whole: a device key keeps its type, store and uv. */\n key: ControlKey.optional(),\n /** The key's proof: a passkey assertion, or a device signature for purpose `pair`. */\n proof: z.xor([ControlAssertion, ControlDeviceSignature]).optional(),\n /** The machine's own bearer for polls, acks and hello: opens nothing else. Minted\n * once, at the first pairing of a machine. */\n token: z.string().min(16).max(256).optional(),\n /** Optional: a key for the events lane (`sink add`), so the receiver's session board\n * shows this machine without a second step. Handed over once. */\n sink_token: z.string().min(16).max(256).optional(),\n /** Optional: who approved, in the receiver's words (a @handle), so the terminal can\n * say whose passkey it now trusts. */\n account: z.string().max(200).optional(),\n});\n\n/** One account in the machine's pool, as its hello lists it (CONTROL.md \u00A72 `pool`).\n * `id` is the string `session.account_id` and `limits.observed.account_id` carry, so\n * a receiver joins the three without a map. The email travels only here. */\nexport const PoolAccount = z.object({\n id: PoolAccountId,\n email: z.string().max(254).optional(),\n /** What the person calls it, when they named it. */\n label: z.string().min(1).max(80).optional(),\n enabled: z.boolean(),\n /** ready: has room; limited: every window the pool watches is used up until `until`;\n * error: needs the person (sign in again); disabled: turned off by the person. */\n status: z.enum([\"ready\", \"limited\", \"error\", \"disabled\"]),\n /** Serving new sessions right now. At most one account says so. */\n current: z.boolean().optional(),\n /** limited: when it has room again, where the machine knows. */\n until: Rfc3339.optional(),\n /** The account's freshest numbers, as limits.observed would carry them: from the\n * idle usage poll when no session asked recently, since an idle account's numbers\n * ride on no session and would reach no receiver otherwise. */\n windows: z.array(LimitWindow).min(1).max(8).optional(),\n /** limited or error only: what took the account out. A window's id (`seven_day`), or\n * `rejected` (the vendor's status) or `error` (sign in again) for the non-window causes. */\n limited_by: z\n .string()\n .regex(/^[a-z0-9_]{1,64}$/)\n .optional(),\n});\n\n/** The machine's account pool (CONTROL.md \u00A72 `pool`): present in EVERY hello of a daemon\n * that knows the pool (`on: false`, `accounts: []` when nothing is set up), so a\n * receiver tells \"no pool\" from \"an old daemon\"; `accounts` in the machine's order. */\nexport const ControlHelloPool = z.object({\n on: z.boolean(),\n /** The harness the pool serves. Only `claude-code` today. */\n harness: HarnessName,\n accounts: z.array(PoolAccount).max(20),\n});\n\n/** `POST {control}/hello`: what the machine can do right now. */\nexport const ControlHello = z.object({\n name: z.string().min(1).max(80),\n harnesses: z.array(z.string().regex(/^[a-z][a-z0-9-]{0,39}$/)).max(20),\n modes: z.array(DeliveryMode),\n /** Credential ids of the keys enrolled on the machine. */\n keys: z.array(B64Url.min(16).max(1400)).max(50),\n version: z.string().max(40),\n /** Live sessions with a waiter parked on the daemon's socket. */\n waiting: z.array(SessionRef).max(500).optional(),\n /** As in control-pair.json: informational, re-checked on the machine. */\n folders: z.array(z.string().max(1024)).max(50).optional(),\n mode: z.enum([\"safe\", \"auto\", \"inherit\"]).optional(),\n /** As in control-pair.json: read again for every hello, so a new sign-in is named. */\n accounts: z.array(HarnessAccount).max(20).optional(),\n /** As in control-pair.json. */\n files: z.boolean().optional(),\n /** The machine takes `files` on a prompt too (CONTROL.md \u00A76 `prompt`). One that\n * doesn't say so refuses them: a receiver SHOULD NOT send it a prompt with files. */\n prompt_files: z.boolean().optional(),\n /** Per harness in `harnesses`: the options a start may carry (CONTROL.md \u00A72). No\n * entry: neither `permission` nor `model`. */\n start: z\n .record(\n HarnessName,\n z.object({\n /** The levels it starts at here, already capped by `mode`. */\n permissions: z.array(StartPermission).min(1).max(4).meta({ uniqueItems: true }),\n /** What a start that names none gets: one of `permissions`, or `inherit` on an\n * inherit machine. */\n permission: RunLevel,\n /** Model ids the harness offers here: a suggestion, not a promise. */\n models: z.array(ModelId).max(50).optional(),\n /** Any well-formed model is passed to the harness (which may still reject it). */\n any_model: z.boolean().optional(),\n }),\n )\n .refine((o) => Object.keys(o).length <= 50, \"at most 50 harnesses\")\n .meta({ maxProperties: 50 })\n .optional(),\n /** As in control-pair.json. */\n key_types: KeyTypes.optional(),\n /** The machine's account pool, when its daemon has one; sent again the moment the\n * pool changes. A hello without it is a daemon that predates the pool. */\n pool: ControlHelloPool.optional(),\n});\n\nexport const WellKnown = z.object({\n protocol: z.array(z.int().min(1)).min(1),\n max_tier: Tier,\n capabilities: z.array(z.string().regex(/^[a-z][a-z0-9-]*$/)),\n auth: z.array(z.enum([\"bearer\"])).default([\"bearer\"]),\n endpoints: z.object({\n events: z.string(),\n control: z.string().optional(),\n native: z.string().optional(),\n }),\n batch: z.object({ max_events: z.int().min(1).max(50), max_bytes: z.int().min(1024).max(262_144) }),\n control: z\n .object({\n wait_max_s: z.int().min(1).max(60),\n /** Pairing may start with no token: the person approves the link signed in. */\n open_pairing: z.boolean().optional(),\n /** MCP servers (`mcp__<server>`) a session answering this receiver's message may\n * use without asking. MCP servers only: a daemon ignores anything else. */\n session_tools: z\n .array(z.string().regex(/^mcp__[A-Za-z0-9_-]{1,64}$/))\n .max(8)\n .optional(),\n /** How commands are signed: the WebAuthn rp id keys are enrolled for, and the algorithms. */\n signing: z.object({\n rp_id: z.string().min(1).max(253),\n algs: z.array(z.union([z.literal(-7), z.literal(-257)])).min(1),\n /** The kinds of key the receiver stores and carries whole (CONTROL.md \u00A72).\n * Absent means `[\"passkey\"]`. */\n key_types: KeyTypes.optional(),\n }),\n /** Informational: the receiver accepts `files` on a start and serves\n * `GET {control}/files/{sha256}`. */\n files: z.boolean().optional(),\n /** The receiver shows a machine in `inherit` mode as that, never as safe or auto.\n * A daemon pairs in, or switches to, `inherit` only with receivers that say so. */\n inherit: z.boolean().optional(),\n })\n .optional(),\n});\n\n/** What `npm run schemas` writes to schemas/v1/<name>.json. */\nexport const SCHEMAS = {\n event: Event,\n \"event-data\": EventData,\n batch: Batch,\n \"batch-response\": BatchResponse,\n error: ErrorResponse,\n \"well-known\": WellKnown,\n control: ControlMessage,\n \"control-command\": ControlCommand,\n \"control-grant\": ControlGrant,\n \"control-key\": ControlKey,\n \"control-poll\": ControlPoll,\n \"control-ack\": ControlAck,\n \"control-pair\": ControlPairStart,\n \"control-pair-started\": ControlPairStarted,\n \"control-paired\": ControlPaired,\n \"control-hello\": ControlHello,\n} as const;\n"],
5
+ "mappings": ";;;AAKA,SAAS,SAAS;AAEX,IAAM,WAAW;AAGjB,IAAM,YAAY,EACtB,OAAO,EACP,MAAM,qDAAqD,kCAAkC;AAEzF,IAAM,cAAc;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAGO,IAAM,YAAiE;AAAA,EAC5E,mBAAmB;AAAA,EACnB,qBAAqB;AAAA,EACrB,iBAAiB;AAAA,EACjB,oBAAoB;AAAA,EACpB,qBAAqB;AAAA,EACrB,gBAAgB;AAAA,EAChB,cA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ChC,CAAC,EACA,SAAS;AACd,CAAC;AAGM,IAAM,UAAU;AAAA,EACrB,OAAO;AAAA,EACP,cAAc;AAAA,EACd,OAAO;AAAA,EACP,kBAAkB;AAAA,EAClB,OAAO;AAAA,EACP,cAAc;AAAA,EACd,SAAS;AAAA,EACT,mBAAmB;AAAA,EACnB,iBAAiB;AAAA,EACjB,eAAe;AAAA,EACf,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,gBAAgB;AAAA,EAChB,wBAAwB;AAAA,EACxB,kBAAkB;AAAA,EAClB,iBAAiB;AACnB;",
6
6
  "names": []
7
7
  }
package/dist/service.js CHANGED
@@ -1,4 +1,4 @@
1
- // sessionpipe-core 0.10.0 · Apache-2.0 · https://sessionpipe.org
1
+ // sessionpipe-core 0.11.0 · Apache-2.0 · https://sessionpipe.org
2
2
 
3
3
  // src/service/index.ts
4
4
  import { execFileSync } from "node:child_process";
@@ -0,0 +1,116 @@
1
+ import type { DataOf } from "../types.js";
2
+ export type LimitWindow = DataOf<"limits.observed">["windows"][number];
3
+ /** Claude Code 2.1.312's own prod endpoints. bb signs in at claude.ai/oauth/authorize with
4
+ * console.anthropic.com's callback and token URL, which still answer; the paste-back code
5
+ * works the same at either. */
6
+ export declare const POOL_ENDPOINTS: {
7
+ readonly authorize: "https://claude.com/cai/oauth/authorize";
8
+ readonly token: "https://platform.claude.com/v1/oauth/token";
9
+ readonly callback: "https://platform.claude.com/oauth/code/callback";
10
+ readonly profile: "https://api.anthropic.com/api/oauth/profile";
11
+ readonly usage: "https://api.anthropic.com/api/oauth/usage";
12
+ readonly api: "https://api.anthropic.com";
13
+ readonly clientId: "9d1c250a-e61b-44d9-88ed-5944d1962f5e";
14
+ readonly scopes: readonly ["user:inference", "user:profile", "org:create_api_key", "user:sessions:claude_code", "user:mcp_servers", "user:file_upload"];
15
+ readonly beta: "oauth-2025-04-20";
16
+ };
17
+ export interface PoolCredential {
18
+ access: string;
19
+ refresh: string;
20
+ /** Epoch milliseconds. */
21
+ expires_at: number;
22
+ }
23
+ export type PoolStatus = "allowed" | "allowed_warning" | "rejected";
24
+ export interface PoolLimits {
25
+ windows: LimitWindow[];
26
+ /** The account as a whole. */
27
+ status?: PoolStatus;
28
+ /** On a refusal: the window that refused (`five_hour`, `seven_day`, …) and when it resets. */
29
+ claim?: string;
30
+ resets_at?: string;
31
+ observed_at: number;
32
+ }
33
+ export interface PoolProfile {
34
+ account_uuid: string;
35
+ email: string;
36
+ org?: string;
37
+ plan?: string;
38
+ }
39
+ export interface ImportableLogin {
40
+ /** The Claude Code config dir the login belongs to. */
41
+ dir: string;
42
+ credential: PoolCredential;
43
+ /** From the dir's .claude.json; absent when that file has no login (fetchProfile fills it). */
44
+ account_uuid?: string;
45
+ email?: string;
46
+ source: "keychain" | "file";
47
+ }
48
+ /** The person has to sign in (again): a refused code, a dead refresh token, a 401. */
49
+ export declare class PoolAuthError extends Error {
50
+ }
51
+ /** Anthropic did not answer properly right now; the same call may work in a minute. */
52
+ export declare class PoolUpstreamError extends Error {
53
+ }
54
+ type HeaderBag = Headers | Record<string, string | string[] | undefined>;
55
+ /** The account's limits from a response's headers; null when the limiter did not run
56
+ * (no `anthropic-ratelimit-unified-*` header at all). A window needs a readable
57
+ * utilization; a status or a reset alone is kept on the account. */
58
+ export declare function readLimits(headers: HeaderBag, now: number): PoolLimits | null;
59
+ /** The usage endpoint's JSON: `{five_hour: {utilization, resets_at}, seven_day: {…},
60
+ * seven_day_<model>: {…}, …}`, utilization a percent already. Any other key shaped
61
+ * like a window passes through under its own id; null when none is. */
62
+ export declare function usageLimits(json: unknown, now: number): PoolLimits | null;
63
+ /** `metadata.user_id` of a request body (parsed, or the raw bytes): the session to pin
64
+ * on and the account the body claims. null when the body carries none. */
65
+ export declare function parseUserId(body: unknown): {
66
+ session?: string;
67
+ account?: string;
68
+ } | null;
69
+ /** The body with the account part of `metadata.user_id` set to `accountUuid`, the same
70
+ * bytes when there is nothing to rewrite. Done on the string, not a parse/stringify
71
+ * round trip: Claude Code's bodies are JSON.stringify output and would survive one, but
72
+ * a body a person built by hand (an SDK, a `CLAUDE_CODE_EXTRA_BODY`) can carry number
73
+ * forms and escapes a round trip rewrites, and a prompt cache is keyed on bytes. The
74
+ * only change is the UUID inside that one string literal. */
75
+ export declare function withAccount(body: Buffer, accountUuid: string): Buffer;
76
+ /** The request's headers as they go to Anthropic: the serving account's bearer in place
77
+ * of the pool's own token, the OAuth beta present, hop-by-hop and the ones the sender
78
+ * sets (host, content-length) gone. Our token and any x-api-key never go through. */
79
+ export declare function upstreamHeaders(req: Record<string, string | string[] | undefined>, access: string): Record<string, string>;
80
+ /** PKCE, as Claude Code builds its own sign-in URL (the same parameters in the same
81
+ * order; `code=true` asks for the paste-back page). 32 random bytes base64url is a
82
+ * 43-character verifier, inside RFC 7636's 43–128. */
83
+ export declare function beginLogin(random?: (n: number) => Buffer): {
84
+ url: string;
85
+ verifier: string;
86
+ state: string;
87
+ };
88
+ type Fetch = typeof globalThis.fetch;
89
+ /** Exchange the pasted code for a credential and read whose it is. */
90
+ export declare function completeLogin(code: string, pending: {
91
+ verifier: string;
92
+ state: string;
93
+ }, fetch: Fetch, now: () => number): Promise<{
94
+ credential: PoolCredential;
95
+ profile: PoolProfile;
96
+ }>;
97
+ /** A fresh access token. 400/401 means the refresh token is dead (revoked, expired,
98
+ * used elsewhere): the person signs in again. Anything else is Anthropic's moment. */
99
+ export declare function refreshCredential(cred: PoolCredential, fetch: Fetch, now: () => number): Promise<PoolCredential>;
100
+ /** Whose token this is: `{account: {uuid, email, …}, organization: {name, …}}`. */
101
+ export declare function fetchProfile(access: string, fetch: Fetch): Promise<PoolProfile>;
102
+ /** The account's windows from the usage endpoint; null when it reports none. */
103
+ export declare function fetchUsage(access: string, fetch: Fetch, now: () => number): Promise<PoolLimits | null>;
104
+ /** The keychain service Claude Code keeps a config dir's login under: bare for the
105
+ * default dir, suffixed with 8 hex of sha256(dir) when CLAUDE_CONFIG_DIR names one. */
106
+ export declare function keychainService(dir: string, home: string, platform?: NodeJS.Platform): string;
107
+ type ReadFile = (file: string) => string;
108
+ /** Every Claude Code login on this machine the pool could copy, one per config dir
109
+ * (claudeDirs): the credential from the keychain (macOS) or `.credentials.json`, and
110
+ * who it is from the dir's .claude.json. `exec` runs `security` and returns stdout; it
111
+ * is the only thing that touches the keychain, so a test hands in a fake. Returns []
112
+ * on any failure and never throws: an import that finds nothing is a message, not a
113
+ * crash, and a token never reaches a log through here. */
114
+ export declare function importableLogins(env: NodeJS.ProcessEnv, exec: (cmd: string, args: string[]) => string, readFile?: ReadFile, platform?: NodeJS.Platform): ImportableLogin[];
115
+ export {};
116
+ //# sourceMappingURL=claude-code-pool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"claude-code-pool.d.ts","sourceRoot":"","sources":["../../../src/adapters/claude-code-pool.ts"],"names":[],"mappings":"AAmCA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAG1C,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvE;;gCAEgC;AAChC,eAAO,MAAM,cAAc;aACzB,SAAS,EAAE,wCAAwC;aACnD,KAAK,EAAE,4CAA4C;aACnD,QAAQ,EAAE,iDAAiD;aAC3D,OAAO,EAAE,6CAA6C;aACtD,KAAK,EAAE,2CAA2C;aAClD,GAAG,EAAE,2BAA2B;aAChC,QAAQ,EAAE,sCAAsC;aAGhD,MAAM,YACJ,gBAAgB,EAChB,cAAc,EACd,oBAAoB,EACpB,2BAA2B,EAC3B,kBAAkB,EAClB,kBAAkB;aAEpB,IAAI,EAAE,kBAAkB;CAChB,CAAC;AAEX,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,0BAA0B;IAC1B,UAAU,EAAE,MAAM,CAAC;CACpB;AACD,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,iBAAi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EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAM5G;AAKD;wFACwF;AACxF,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAM,CAAC,QAA2B,GAAG,MAAM,CAQ/G;AA+BD,KAAK,QAAQ,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;AAGzC;;;;;2DAK2D;AAC3D,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,MAAM,CAAC,UAAU,EACtB,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,MAAM,EAC7C,QAAQ,GAAE,QAAmB,EAC7B,QAAQ,GAAE,MAAM,CAAC,QAA2B,GAC3C,eAAe,EAAE,CA+BnB"}
@@ -1,4 +1,4 @@
1
- import type { HarnessAccount } from "../types.js";
1
+ import type { DataOf, HarnessAccount } from "../types.js";
2
2
  import type { Adapter, FactsState, SessionFacts } from "./types.js";
3
3
  export declare const CLAUDE_EVENTS: readonly ["SessionStart", "UserPromptSubmit", "PreToolUse", "PostToolUse", "PostToolUseFailure", "PermissionRequest", "Notification", "Stop", "SubagentStart", "SubagentStop", "PreCompact", "PostCompact", "SessionEnd", "StopFailure"];
4
4
  /** Every Claude Code config dir on this machine. `home` follows the env's HOME, so a
@@ -6,6 +6,11 @@ export declare const CLAUDE_EVENTS: readonly ["SessionStart", "UserPromptSubmit"
6
6
  * once rewrote a real settings.json with its fake hook paths on every run. */
7
7
  export declare function claudeDirs(env?: NodeJS.ProcessEnv, home?: string): string[];
8
8
  export declare const claudeCode: Adapter;
9
+ /** The status line's `rate_limits`: `five_hour`, `seven_day` and, behind a gateway,
10
+ * `spend_limit`, each with `used_percentage` and `resets_at` in epoch seconds. Only
11
+ * Pro and Max accounts (or a gateway) have them, and only after a session's first
12
+ * response; a window drops out once it resets. */
13
+ export declare function claudeLimits(rl: unknown): DataOf<"limits.observed"> | null;
9
14
  /** Another harness reading this settings file, not Claude Code. Several harnesses
10
15
  * import `~/.claude/settings.json` hooks, so our entries there can be run by a tool
11
16
  * that has its own adapter: it would arrive under the wrong name, with ids that mean
@@ -25,6 +30,20 @@ export declare function appTitle(text: string): string;
25
30
  * name or custom-title) → Claude Code's own title (registry "auto" name or
26
31
  * ai-title) → the first ask, marked first-ask so a real title later replaces it. */
27
32
  export declare function claudeFacts(file: string, sessionId: string, hints: Record<string, unknown>, state: FactsState): SessionFacts;
33
+ /** claude.ai's name for a session with a claude.ai link, unless the person named it
34
+ * here: `{title, title_source: "harness"}`, or nothing. */
35
+ export declare function claudeRemoteFacts(id: string, local: SessionFacts, transcript: string | undefined, state: FactsState, env: NodeJS.ProcessEnv, now?: number): Promise<Partial<SessionFacts>>;
36
+ /** The access token Claude Code signed in to `dir` with: from the macOS keychain, else
37
+ * from `<dir>/.credentials.json`. Never written anywhere, never logged. One that has
38
+ * expired is not refreshed, since that would rotate Claude Code's own login: the lookup
39
+ * waits for Claude Code to refresh it. */
40
+ export declare function claudeAiToken(dir: string, env: NodeJS.ProcessEnv, now: number): string | null;
41
+ /** claude.ai's name for the session `bridge` (`session_…`), from the endpoint Claude Code
42
+ * reads a session from: a string, null when it has none yet, undefined when it couldn't
43
+ * be asked or wouldn't say (offline, a 401 or 404, an answer about another session), so
44
+ * the last answer stands. The token goes to api.anthropic.com alone: a redirect is
45
+ * refused, never followed. */
46
+ export declare function claudeAiTitle(bridge: string, token: string): Promise<string | null | undefined>;
28
47
  /** For tests: each hook runs in a fresh process; a test that edits the registry mid-run clears the cache. */
29
48
  export declare const _resetClaudeCaches: () => void;
30
49
  //# sourceMappingURL=claude-code.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"claude-code.d.ts","sourceRoot":"","sources":["../../../src/adapters/claude-code.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAA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AAC5D,wBAAsB,iBAAiB,CACrC,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,YAAY,EACnB,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,KAAK,EAAE,UAAU,EACjB,GAAG,EAAE,MAAM,CAAC,UAAU,EACtB,GAAG,SAAa,GACf,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAehC;AAmBD;;;2CAG2C;AAC3C,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,UAAU,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAwC7F;AAMD;;;;+BAI+B;AAC/B,wBAAsB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,CAqBrG;AAED,6GAA6G;AAC7G,eAAO,MAAM,kBAAkB,QAAO,IAIrC,CAAC"}
@@ -26,6 +26,7 @@ export type JsonFile = {
26
26
  indent: string;
27
27
  eol: string;
28
28
  finalNewline: boolean;
29
+ bom: boolean;
29
30
  } | {
30
31
  ok: true;
31
32
  existed: false;
@@ -34,6 +35,7 @@ export type JsonFile = {
34
35
  indent: " ";
35
36
  eol: "\n";
36
37
  finalNewline: true;
38
+ bom: false;
37
39
  } | {
38
40
  ok: false;
39
41
  existed: true;
@@ -47,6 +49,7 @@ export declare function formatJson(value: unknown, f: {
47
49
  indent: string;
48
50
  eol: string;
49
51
  finalNewline: boolean;
52
+ bom?: boolean;
50
53
  }): string;
51
54
  /** Back-compat helper for callers that only read. */
52
55
  export declare function readJson(file: string): Record<string, unknown>;
@@ -1 +1 @@
1
- {"version":3,"file":"claude-shaped.d.ts","sourceRoot":"","sources":["../../../src/adapters/claude-shaped.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE7D,MAAM,WAAW,mBAAmB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AAO,CAAA;CAAE,GACvE,MAAM,CAGR;AAED,qDAAqD;AACrD,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAG9D;AAUD,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,SAAS,MAAM,EAAE,EACzB,GAAG,EAAE,WAAW,EAChB,CAAC,EAAE,mBAAmB,GACrB,aAAa,CAyCf;AAED,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,SAAS,MAAM,EAAE,EACzB,IAAI,GAAE;IAAE,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAAO,GAC3C,aAAa,CAyBf;AAED,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,SAAS,MAAM,EAAE,EACzB,GAAG,EAAE,WAAW,EAChB,CAAC,EAAE,mBAAmB,GACrB,SAAS,GAAG,OAAO,GAAG,SAAS,CAiBjC"}
@@ -13,7 +13,8 @@ export interface Notify {
13
13
  }
14
14
  /** notify as Codex sees it; `misplaced` for a line of ours inside a table. */
15
15
  export declare function readNotify(text: string): Notify | null;
16
- /** Put `line` at the top level: before the first table, or at the end of a file that has none. */
16
+ /** Put `line` at the top level: before the first table, or at the end of a file that has
17
+ * none. The line takes the file's own line end, so a CRLF file stays one. */
17
18
  export declare function insertTopLevel(text: string, line: string): string;
18
19
  /** The config with `line` as its notify, for a config whose notify is ours or absent. */
19
20
  export declare function withNotify(text: string, line: string): string;
@@ -1 +1 @@
1
- {"version":3,"file":"codex-config.d.ts","sourceRoot":"","sources":["../../../src/adapters/codex-config.ts"],"names":[],"mappings":"AASA,gFAAgF;AAChF,eAAO,MAAM,IAAI,QAA0D,CAAC;AAoC5E,+CAA+C;AAC/C,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,G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AAE,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,GAAG,MAAM,EAAE,CAM5E;AACD,qFAAqF;AACrF,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEpD;AACD,8FAA8F;AAC9F,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAGnE;AACD,eAAO,MAAM,aAAa,SAAU,MAAM,EAAE,GAAG,IAAI,KAAG,OAC6C,CAAC"}
@@ -1,3 +1,4 @@
1
+ import type { DataOf } from "../types.js";
1
2
  import type { Adapter, SessionFacts } from "./types.js";
2
3
  export declare const CODEX_EVENTS: readonly ["SessionStart", "UserPromptSubmit", "PreToolUse", "PostToolUse", "PermissionRequest", "Stop", "Interrupt", "SubagentStart", "SubagentStop", "PreCompact", "PostCompact", "SessionEnd"];
3
4
  /** The rollout file of one thread: `<CODEX_HOME>/sessions/YYYY/MM/DD/rollout-<time>-<thread
@@ -5,6 +6,14 @@ export declare const CODEX_EVENTS: readonly ["SessionStart", "UserPromptSubmit",
5
6
  * short or odd one never matches some other session's file. */
6
7
  export declare function findRollout(threadId: string, env?: NodeJS.ProcessEnv): string | null;
7
8
  export declare const codex: Adapter;
9
+ /** The account's limits from the last `token_count` that carries them (recorded
10
+ * 2026-10-21, codex-cli 0.163): `rate_limits.primary` / `secondary`, each with
11
+ * `used_percent`, `window_minutes` and `resets_at` in epoch seconds, and `plan_type`.
12
+ * Every turn writes one, so the tail is enough. Codex keeps one snapshot and overwrites
13
+ * it with whichever bucket the server named last (`limit_id`: `codex`, or a model's own
14
+ * such as `codex_other`), so only the account's `codex` bucket is read, never another's
15
+ * windows under its names. */
16
+ export declare function codexLimits(file: string): DataOf<"limits.observed"> | null;
8
17
  /** Codex keeps no title; its first real ask stands in. A fork's replay is not its ask. */
9
18
  export declare function codexFacts(file: string): SessionFacts;
10
19
  //# sourceMappingURL=codex.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"codex.d.ts","sourceRoot":"","sources":["../../../src/adapters/codex.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EACV,OAAO,EAOP,YAAY,EACb,MAAM,YAAY,CAAC;AAGpB,eAAO,MAAM,YAAY,YACvB,cAAc,EACd,kBAAkB,EAClB,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,MAAM,EACN,WAAW,EACX,eAAe,EACf,cAAc,EACd,YAAY,EACZ,aAAa,EACb,YAAY,CACJ,CAAC;AAmFX;;gEAEgE;AAChE,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,GAAG,IAAI,CAwBjG;AAeD,eAAO,MAAM,KAAK,EAAE,OAwMnB,CAAC;AAOF,0FAA0F;AAC1F,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CA2DrD"}
1
+ {"version":3,"file":"codex.d.ts","sourceRoot":"","sources":["../../../src/adapters/codex.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAI1C,OAAO,KAAK,EACV,OAAO,EAOP,YAAY,EACb,MAAM,YAAY,CAAC;AAGpB,eAAO,MAAM,YAAY,YACvB,cAAc,EACd,kBAAkB,EAClB,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,MAAM,EACN,WAAW,EACX,eAAe,EACf,cAAc,EACd,YAAY,EACZ,aAAa,EACb,YAAY,CACJ,CAAC;AAmFX;;gEAEgE;AAChE,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,GAAG,IAAI,CAwBjG;AAeD,eAAO,MAAM,KAAK,EAAE,OA0MnB,CAAC;AAWF;;;;;;+BAM+B;AAC/B,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,iBAAiB,CAAC,GAAG,IAAI,CA0B1E;AAED,0FAA0F;AAC1F,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CA2DrD"}
@@ -1,5 +1,8 @@
1
1
  import type { Adapter } from "./types.js";
2
2
  export declare const GEMINI_EVENTS: readonly ["SessionStart", "BeforeAgent", "BeforeTool", "AfterTool", "Notification", "AfterAgent", "PreCompress", "SessionEnd"];
3
+ /** `gemini --version`. On Windows the CLI is npm's gemini.cmd shim, which only a shell runs
4
+ * (node refuses a bare spawn of a .cmd), so there it is looked up on PATH and run through one. */
5
+ export declare function geminiVersion(platform?: NodeJS.Platform, env?: NodeJS.ProcessEnv): string;
3
6
  /** Before 0.46 the hooks system is off unless tools.enableHooks is true (issue #11). */
4
7
  export declare function geminiHooksActive(settingsFile: string): {
5
8
  active: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"gemini-cli.d.ts","sourceRoot":"","sources":["../../../src/adapters/gemini-cli.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,OAAO,EAAuD,MAAM,YAAY,CAAC;AAG/F,eAAO,MAAM,aAAa,YACxB,cAAc,EACd,aAAa,EACb,YAAY,EACZ,WAAW,EACX,cAAc,EACd,YAAY,EACZ,aAAa,EACb,YAAY,CACJ,CAAC;AAOX,wFAAwF;AACxF,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,MAAM,GAAG;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CA2B1F;AAED,eAAO,MAAM,SAAS,EAAE,OAiJvB,CAAC"}
1
+ {"version":3,"file":"gemini-cli.d.ts","sourceRoot":"","sources":["../../../src/adapters/gemini-cli.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,OAAO,EAAuD,MAAM,YAAY,CAAC;AAG/F,eAAO,MAAM,aAAa,YACxB,cAAc,EACd,aAAa,EACb,YAAY,EACZ,WAAW,EACX,cAAc,EACd,YAAY,EACZ,aAAa,EACb,YAAY,CACJ,CAAC;AAOX;mGACmG;AACnG,wBAAgB,aAAa,CAC3B,QAAQ,GAAE,MAAM,CAAC,QAA2B,EAC5C,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,MAAM,CAiBR;AAED,wFAAwF;AACxF,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,MAAM,GAAG;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAoB1F;AAED,eAAO,MAAM,SAAS,EAAE,OAiJvB,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { Session } from "../types.js";
1
+ import type { DataOf, Session } from "../types.js";
2
2
  export interface HookInput {
3
3
  /** [harness, event, ...] as the hook was invoked. */
4
4
  argv: string[];
@@ -54,6 +54,8 @@ export interface BackfillRow {
54
54
  started_at: number;
55
55
  last_at: number;
56
56
  turns?: number;
57
+ /** The file the row was read from, for what `remoteFacts` asks about it. Never sent. */
58
+ transcript?: string;
57
59
  }
58
60
  /** The command a hook entry runs: absolute node, absolute script, then args. */
59
61
  export type HookCommand = (args: string[]) => {
@@ -76,6 +78,9 @@ export interface InstallOptions {
76
78
  /** Files sessionpipe created on an earlier install (from the config), so
77
79
  * uninstall may delete them once they are empty again. */
78
80
  created?: string[];
81
+ /** Claude Code: make sessionpipe its status line, the one place it reports the
82
+ * account's limits (`limits.observed`); false takes ours away again. */
83
+ statusLine?: boolean | undefined;
79
84
  }
80
85
  export type InstalledState = "current" | "stale" | "missing" | "misplaced" | "inactive";
81
86
  export interface InstalledReport {
@@ -104,7 +109,19 @@ export interface Adapter {
104
109
  facts(session: {
105
110
  id: string;
106
111
  } & Partial<Session>, transcript: string | undefined, hints: Record<string, unknown>, state: FactsState, env?: NodeJS.ProcessEnv): SessionFacts;
112
+ /** What only the harness's own service knows about a session (claude.ai's name for a
113
+ * Claude Code session), asked over the network with the person's own sign-in. The
114
+ * worker calls it after `facts`, and only when the person turned it on (config.json
115
+ * `remote_titles`); never on the hook path. What it returns replaces what `facts`
116
+ * found; an empty object leaves it. Never rejects: a service it can't ask, or a
117
+ * sign-in it can't read, is an empty object. */
118
+ remoteFacts?(session: {
119
+ id: string;
120
+ } & Partial<Session>, local: SessionFacts, transcript: string | undefined, state: FactsState, env?: NodeJS.ProcessEnv): Promise<Partial<SessionFacts>>;
107
121
  backfill(sinceMs: number, env?: NodeJS.ProcessEnv): BackfillRow[];
122
+ /** The account's limits as the transcript last recorded them (`limits.observed` data),
123
+ * for a harness that writes them there; null when it holds none. */
124
+ limits?(transcript: string): DataOf<"limits.observed"> | null;
108
125
  }
109
126
  /** Small per-session memory the facts pass keeps under <state>/facts/. */
110
127
  export interface FactsState {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/adapters/types.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C,MAAM,WAAW,SAAS;IACxB,qDAAqD;IACrD,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IACxC,GAAG,EAAE,MAAM,CAAC;CACb;AAED,iFAAiF;AACjF,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,yDAAyD;IACzD,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC3C,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,qEAAqE;IACrE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,wDAAwD;IACxD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iEAAiE;IACjE,KAAK,CAAC,EAAE,MA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AAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/D,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;CAC9E"}
@@ -22,12 +22,18 @@ export interface SinkConfig {
22
22
  export interface Config {
23
23
  machine?: string;
24
24
  sinks: SinkConfig[];
25
+ /** `status_line`: Claude Code's status line is ours (install --status-line). */
25
26
  harnesses: Record<string, {
26
27
  enabled?: boolean;
27
28
  created?: string[];
29
+ status_line?: boolean;
28
30
  }>;
29
31
  update_check?: boolean;
30
32
  keep_days?: number;
33
+ /** Ask a harness's own service for a session's name (an adapter's `remoteFacts`):
34
+ * claude.ai's, for Claude Code. Off unless the person turns it on (`sessionpipe
35
+ * titles on`): it means reading the harness's sign-in token on this machine. */
36
+ remote_titles?: boolean;
31
37
  }
32
38
  export declare const DEFAULT_CONFIG: Config;
33
39
  export declare function readConfig(file?: string): Config;