sessionpipe-core 0.1.1 → 0.2.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.
- package/dist/control.js +352 -0
- package/dist/control.js.map +7 -0
- package/dist/index.js +400 -38
- package/dist/index.js.map +4 -4
- package/dist/schema/v1.d.ts +338 -53
- package/dist/schema/v1.d.ts.map +1 -1
- package/dist/schema.js +149 -24
- package/dist/schema.js.map +2 -2
- package/dist/src/adapters/claude-code-control.d.ts +70 -0
- package/dist/src/adapters/claude-code-control.d.ts.map +1 -0
- package/dist/src/adapters/claude-code.d.ts.map +1 -1
- package/dist/src/adapters/claude-shaped.d.ts +3 -0
- package/dist/src/adapters/claude-shaped.d.ts.map +1 -1
- package/dist/src/adapters/index.d.ts +2 -0
- package/dist/src/adapters/index.d.ts.map +1 -1
- package/dist/src/config.d.ts +2 -0
- package/dist/src/config.d.ts.map +1 -1
- package/dist/src/control/index.d.ts +5 -0
- package/dist/src/control/index.d.ts.map +1 -0
- package/dist/src/control/verify.d.ts +171 -0
- package/dist/src/control/verify.d.ts.map +1 -0
- package/package.json +5 -1
package/dist/schema.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// sessionpipe-core 0.
|
|
1
|
+
// sessionpipe-core 0.2.0 · Apache-2.0 · https://sessionpipe.org
|
|
2
2
|
|
|
3
3
|
// schema/v1.ts
|
|
4
4
|
import { z } from "zod";
|
|
@@ -170,44 +170,150 @@ var ErrorResponse = z.object({
|
|
|
170
170
|
max_tier: Tier.optional()
|
|
171
171
|
});
|
|
172
172
|
var Capability = z.enum(["events", "backfill", "forget", "control", "native"]);
|
|
173
|
-
var
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
}),
|
|
183
|
-
batch: z.object({ max_events: z.int().min(1).max(50), max_bytes: z.int().min(1024).max(262144) }),
|
|
184
|
-
control: z.object({ wait_max_s: z.int().min(1).max(60) }).optional()
|
|
185
|
-
});
|
|
186
|
-
var ControlKind = z.enum(["permission.answer", "prompt", "cancel"]);
|
|
187
|
-
var ControlMessage = z.object({
|
|
188
|
-
id: Ulid,
|
|
173
|
+
var B64Url = z.string().regex(/^[A-Za-z0-9_-]*$/, "base64url, no padding");
|
|
174
|
+
var MachineId = z.string().regex(/^m_[A-Za-z0-9_-]{16,40}$/, "m_ + 16\u201340 base64url");
|
|
175
|
+
var SessionRef = z.string().regex(/^[a-z][a-z0-9-]{0,39}:[A-Za-z0-9._:-]{1,128}$/, "<harness>:<session id>");
|
|
176
|
+
var ControlKind = z.enum(["prompt", "permission.answer", "cancel", "start"]);
|
|
177
|
+
var DeliveryMode = z.enum(["sdk", "waiter", "turn", "api", "resume", "fork"]);
|
|
178
|
+
var ControlCommand = z.object({
|
|
179
|
+
v: z.literal(1),
|
|
180
|
+
t: z.literal("sessionpipe.control"),
|
|
181
|
+
machine: MachineId,
|
|
189
182
|
kind: ControlKind,
|
|
190
|
-
|
|
191
|
-
|
|
183
|
+
session: SessionRef,
|
|
184
|
+
/** prompt, start: the message for the model. */
|
|
185
|
+
text: z.string().min(1).max(4e3).optional(),
|
|
186
|
+
/** permission.answer: the attention_id being answered. */
|
|
187
|
+
for: z.string().min(1).max(128).optional(),
|
|
192
188
|
decision: z.enum(["allow", "deny"]).optional(),
|
|
193
|
-
/** The prompt text. */
|
|
194
|
-
text: z.string().max(2e4).optional(),
|
|
195
189
|
/** Shown to the model beside a decision. */
|
|
196
190
|
note: z.string().max(2e3).optional(),
|
|
191
|
+
/** start: the absolute folder the new session runs in. */
|
|
192
|
+
cwd: z.string().max(1024).optional(),
|
|
193
|
+
/** At least 16 random bytes, base64url. */
|
|
194
|
+
nonce: z.string().regex(/^[A-Za-z0-9_-]{22,64}$/),
|
|
195
|
+
/** Epoch ms, the signing device's clock. */
|
|
196
|
+
iat: z.int().min(1)
|
|
197
|
+
});
|
|
198
|
+
var ControlGrant = z.object({
|
|
199
|
+
v: z.literal(1),
|
|
200
|
+
t: z.literal("sessionpipe.grant"),
|
|
201
|
+
/** The day key: P-256 SPKI, base64url. */
|
|
202
|
+
pub: B64Url.min(1),
|
|
203
|
+
iat: z.int().min(1),
|
|
204
|
+
exp: z.int().min(1),
|
|
205
|
+
/** The receiver's WebAuthn rp id (well-known control.signing.rp_id). */
|
|
206
|
+
rp: z.string().min(1).max(253)
|
|
207
|
+
});
|
|
208
|
+
var ControlAssertion = z.object({
|
|
209
|
+
cred: B64Url.min(1),
|
|
210
|
+
ad: B64Url.min(1),
|
|
211
|
+
cd: B64Url.min(1),
|
|
212
|
+
sig: B64Url.min(1)
|
|
213
|
+
});
|
|
214
|
+
var ControlKey = z.object({
|
|
215
|
+
id: B64Url.min(16).max(1400),
|
|
216
|
+
alg: z.union([z.literal(-7), z.literal(-257)]),
|
|
217
|
+
spki: B64Url.min(1)
|
|
218
|
+
});
|
|
219
|
+
var ControlMessage = z.object({
|
|
220
|
+
/** The receiver's id for this message; the ack key. Not signed: the nonce inside cmd is. */
|
|
221
|
+
id: Ulid,
|
|
222
|
+
/** The command string, exactly as signed (≤ 12 000 characters). */
|
|
223
|
+
cmd: z.string().min(1).max(12e3),
|
|
224
|
+
/** The day key's ECDSA P-256 / SHA-256 signature over cmd: raw r‖s, base64url. */
|
|
225
|
+
csig: B64Url.nullable().optional(),
|
|
226
|
+
/** The grant vouching for the day key: its string plus the passkey's assertion over sha256(str). */
|
|
227
|
+
grant: ControlAssertion.extend({ str: z.string().min(1).max(2e3) }).nullable().optional(),
|
|
228
|
+
/** Instead of csig + grant: one passkey assertion over sha256(cmd). */
|
|
229
|
+
confirm: ControlAssertion.nullable().optional(),
|
|
230
|
+
/** The receiver's clock. */
|
|
197
231
|
at: Rfc3339,
|
|
232
|
+
/** After this the machine MUST NOT act and acks `expired`; at most 24 h after `at`. */
|
|
198
233
|
expires_at: Rfc3339
|
|
199
234
|
});
|
|
200
235
|
var ControlPoll = z.object({ messages: z.array(ControlMessage) });
|
|
236
|
+
var ControlOutcome = z.enum(["taken", "delivered", "expired", "unsupported", "failed", "refused"]);
|
|
201
237
|
var ControlAck = z.object({
|
|
202
238
|
acks: z.array(
|
|
203
239
|
z.object({
|
|
204
240
|
id: Ulid,
|
|
205
|
-
outcome:
|
|
241
|
+
outcome: ControlOutcome,
|
|
206
242
|
at: Rfc3339,
|
|
207
|
-
|
|
243
|
+
/** delivered: how it reached the session. */
|
|
244
|
+
mode: DeliveryMode.optional(),
|
|
245
|
+
/** The session that took it, when not the one named (a fork's copy, a started session). */
|
|
246
|
+
session: SessionRef.optional(),
|
|
247
|
+
/** refused: the verifier's code, or the machine's own (`folder`, `no_attention`, `busy`). */
|
|
248
|
+
code: z.string().regex(/^[a-z_]{1,40}$/).optional(),
|
|
249
|
+
detail: z.string().max(500).optional(),
|
|
250
|
+
/** resume / fork / start: the agent's reply, redacted by the secrets ruleset. */
|
|
251
|
+
reply: z.string().max(2e4).optional()
|
|
208
252
|
})
|
|
209
253
|
).min(1)
|
|
210
254
|
});
|
|
255
|
+
var ControlPairStart = z.object({
|
|
256
|
+
/** Set when adding a key to a machine already paired. */
|
|
257
|
+
machine: MachineId.optional(),
|
|
258
|
+
name: z.string().min(1).max(80),
|
|
259
|
+
harnesses: z.array(z.string().regex(/^[a-z][a-z0-9-]{0,39}$/)).max(20),
|
|
260
|
+
modes: z.array(DeliveryMode),
|
|
261
|
+
version: z.string().max(40),
|
|
262
|
+
/** The folders the machine lets sessions run in, for the receiver's "new session"
|
|
263
|
+
* picker. Informational: the machine checks its own list again. */
|
|
264
|
+
folders: z.array(z.string().max(1024)).max(50).optional(),
|
|
265
|
+
/** safe: nothing that needs approval runs unattended; auto: the harness's auto mode. */
|
|
266
|
+
mode: z.enum(["safe", "auto"]).optional()
|
|
267
|
+
});
|
|
268
|
+
var ControlPairStarted = z.object({
|
|
269
|
+
machine: MachineId,
|
|
270
|
+
code: z.string().regex(/^[A-Za-z0-9-]{6,32}$/),
|
|
271
|
+
url: z.url(),
|
|
272
|
+
/** Six digits the terminal and the receiver's page both show. */
|
|
273
|
+
check: z.string().regex(/^\d{6}$/),
|
|
274
|
+
expires_at: Rfc3339
|
|
275
|
+
});
|
|
276
|
+
var ControlPaired = z.object({
|
|
277
|
+
status: z.enum(["pending", "paired", "expired"]),
|
|
278
|
+
key: ControlKey.optional(),
|
|
279
|
+
proof: ControlAssertion.optional(),
|
|
280
|
+
/** The machine's own bearer for polls, acks and hello: opens nothing else. Minted
|
|
281
|
+
* once, at the first pairing of a machine. */
|
|
282
|
+
token: z.string().min(16).max(256).optional()
|
|
283
|
+
});
|
|
284
|
+
var ControlHello = z.object({
|
|
285
|
+
name: z.string().min(1).max(80),
|
|
286
|
+
harnesses: z.array(z.string().regex(/^[a-z][a-z0-9-]{0,39}$/)).max(20),
|
|
287
|
+
modes: z.array(DeliveryMode),
|
|
288
|
+
/** Credential ids of the keys enrolled on the machine. */
|
|
289
|
+
keys: z.array(B64Url.min(16).max(1400)).max(50),
|
|
290
|
+
version: z.string().max(40),
|
|
291
|
+
/** Live sessions with a waiter parked on the daemon's socket. */
|
|
292
|
+
waiting: z.array(SessionRef).max(500).optional(),
|
|
293
|
+
/** As in control-pair.json: informational, re-checked on the machine. */
|
|
294
|
+
folders: z.array(z.string().max(1024)).max(50).optional(),
|
|
295
|
+
mode: z.enum(["safe", "auto"]).optional()
|
|
296
|
+
});
|
|
297
|
+
var WellKnown = z.object({
|
|
298
|
+
protocol: z.array(z.int().min(1)).min(1),
|
|
299
|
+
max_tier: Tier,
|
|
300
|
+
capabilities: z.array(z.string().regex(/^[a-z][a-z0-9-]*$/)),
|
|
301
|
+
auth: z.array(z.enum(["bearer"])).default(["bearer"]),
|
|
302
|
+
endpoints: z.object({
|
|
303
|
+
events: z.string(),
|
|
304
|
+
control: z.string().optional(),
|
|
305
|
+
native: z.string().optional()
|
|
306
|
+
}),
|
|
307
|
+
batch: z.object({ max_events: z.int().min(1).max(50), max_bytes: z.int().min(1024).max(262144) }),
|
|
308
|
+
control: z.object({
|
|
309
|
+
wait_max_s: z.int().min(1).max(60),
|
|
310
|
+
/** How commands are signed: the WebAuthn rp id keys are enrolled for, and the algorithms. */
|
|
311
|
+
signing: z.object({
|
|
312
|
+
rp_id: z.string().min(1).max(253),
|
|
313
|
+
algs: z.array(z.union([z.literal(-7), z.literal(-257)])).min(1)
|
|
314
|
+
})
|
|
315
|
+
}).optional()
|
|
316
|
+
});
|
|
211
317
|
var SCHEMAS = {
|
|
212
318
|
event: Event,
|
|
213
319
|
"event-data": EventData,
|
|
@@ -216,8 +322,15 @@ var SCHEMAS = {
|
|
|
216
322
|
error: ErrorResponse,
|
|
217
323
|
"well-known": WellKnown,
|
|
218
324
|
control: ControlMessage,
|
|
325
|
+
"control-command": ControlCommand,
|
|
326
|
+
"control-grant": ControlGrant,
|
|
327
|
+
"control-key": ControlKey,
|
|
219
328
|
"control-poll": ControlPoll,
|
|
220
|
-
"control-ack": ControlAck
|
|
329
|
+
"control-ack": ControlAck,
|
|
330
|
+
"control-pair": ControlPairStart,
|
|
331
|
+
"control-pair-started": ControlPairStarted,
|
|
332
|
+
"control-paired": ControlPaired,
|
|
333
|
+
"control-hello": ControlHello
|
|
221
334
|
};
|
|
222
335
|
export {
|
|
223
336
|
AttentionKind,
|
|
@@ -225,9 +338,19 @@ export {
|
|
|
225
338
|
BatchResponse,
|
|
226
339
|
Capability,
|
|
227
340
|
ControlAck,
|
|
341
|
+
ControlAssertion,
|
|
342
|
+
ControlCommand,
|
|
343
|
+
ControlGrant,
|
|
344
|
+
ControlHello,
|
|
345
|
+
ControlKey,
|
|
228
346
|
ControlKind,
|
|
229
347
|
ControlMessage,
|
|
348
|
+
ControlOutcome,
|
|
349
|
+
ControlPairStart,
|
|
350
|
+
ControlPairStarted,
|
|
351
|
+
ControlPaired,
|
|
230
352
|
ControlPoll,
|
|
353
|
+
DeliveryMode,
|
|
231
354
|
ErrorResponse,
|
|
232
355
|
Event,
|
|
233
356
|
EventData,
|
|
@@ -235,12 +358,14 @@ export {
|
|
|
235
358
|
HARNESS_NAMES,
|
|
236
359
|
Harness,
|
|
237
360
|
KNOWN_TYPES,
|
|
361
|
+
MachineId,
|
|
238
362
|
PROTOCOL,
|
|
239
363
|
Privacy,
|
|
240
364
|
Rfc3339,
|
|
241
365
|
SCHEMAS,
|
|
242
366
|
Session,
|
|
243
367
|
SessionId,
|
|
368
|
+
SessionRef,
|
|
244
369
|
TYPE_TIER,
|
|
245
370
|
Tier,
|
|
246
371
|
ToolName,
|
package/dist/schema.js.map
CHANGED
|
@@ -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 \"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 \"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 \"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 parent_id: SessionId.nullable().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({ turn_id: z.string().max(128).optional(), prompt_chars: z.int().min(0).optional() }),\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 }),\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 \"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\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.object({ wait_max_s: z.int().min(1).max(60) }).optional(),\n});\n\nexport const ControlKind = z.enum([\"permission.answer\", \"prompt\", \"cancel\"]);\n\nexport const ControlMessage = z.object({\n id: Ulid,\n kind: ControlKind,\n /** The attention_id a permission answer is for. */\n for: z.string().max(128).optional(),\n decision: z.enum([\"allow\", \"deny\"]).optional(),\n /** The prompt text. */\n text: z.string().max(20_000).optional(),\n /** Shown to the model beside a decision. */\n note: z.string().max(2000).optional(),\n at: Rfc3339,\n expires_at: Rfc3339,\n});\n\nexport const ControlPoll = z.object({ messages: z.array(ControlMessage) });\n\nexport const ControlAck = z.object({\n acks: z\n .array(\n z.object({\n id: Ulid,\n outcome: z.enum([\"delivered\", \"expired\", \"unsupported\", \"failed\"]),\n at: Rfc3339,\n detail: z.string().max(500).optional(),\n }),\n )\n .min(1),\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-poll\": ControlPoll,\n \"control-ack\": ControlAck,\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;AACF;AAGO,IAAM,YAAiE;AAAA,EAC5E,mBAAmB;AAAA,EACnB,qBAAqB;AAAA,EACrB,iBAAiB;AAAA,EACjB,oBAAoB;AAAA,EACpB,qBAAqB;AAAA,EACrB,gBAAgB;AAAA,EAChB,cAAc;AAAA,EACd,mBAAmB;AAAA,EACnB,gBAAgB;AAAA,EAChB,cAAc;AAAA,EACd,iBAAiB;AAAA,EACjB,oBAAoB;AAAA,EACpB,qBAAqB;AAAA,EACrB,oBAAoB;AAAA,EACpB,kBAAkB;AAAA,EAClB,qBAAqB;AAAA,EACrB,QAAQ;AACV;A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E,IAAI,CAAC;AAAA,EACvB,YAAY,EAAE,IAAI,EAAE,IAAI,CAAC;AAAA,EACzB,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,MAAM,QAAQ,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;AAAA,EACrE,UAAU;AACZ,CAAC;AAEM,IAAM,gBAAgB,EAAE,OAAO;AAAA,EACpC,QAAQ,EAAE,OAAO,EAAE,IAAI,GAAG;AAAA,EAC1B,WAAW,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,SAAS;AAAA,EACrC,UAAU,KAAK,SAAS;AAC1B,CAAC;AAEM,IAAM,aAAa,EAAE,KAAK,CAAC,UAAU,YAAY,UAAU,WAAW,QAAQ,CAAC;
|
|
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 \"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 \"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 \"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 parent_id: SessionId.nullable().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({ turn_id: z.string().max(128).optional(), prompt_chars: z.int().min(0).optional() }),\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 }),\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 \"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\"]);\nexport const DeliveryMode = z.enum([\"sdk\", \"waiter\", \"turn\", \"api\", \"resume\", \"fork\"]);\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(4000).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 absolute folder the new session runs in. */\n cwd: z.string().max(1024).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 key enrolled on a machine: a passkey's credential id, COSE alg, SPKI. */\nexport const ControlKey = z.object({\n id: B64Url.min(16).max(1400),\n alg: z.union([z.literal(-7), z.literal(-257)]),\n spki: B64Url.min(1),\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 12 000 characters). */\n cmd: z.string().min(1).max(12_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 sha256(str). */\n grant: ControlAssertion.extend({ str: z.string().min(1).max(2000) })\n .nullable()\n .optional(),\n /** Instead of csig + grant: one passkey assertion over sha256(cmd). */\n confirm: ControlAssertion.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. */\nexport const ControlOutcome = z.enum([\"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 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 }),\n )\n .min(1),\n});\n\n/** `POST {control}/pair`, sent with the person's sink token from their own terminal. */\nexport const ControlPairStart = z.object({\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 mode: z.enum([\"safe\", \"auto\"]).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 key: ControlKey.optional(),\n proof: ControlAssertion.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});\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\"]).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 /** 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 }),\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;AACF;AAGO,IAAM,YAAiE;AAAA,EAC5E,mBAAmB;AAAA,EACnB,qBAAqB;AAAA,EACrB,iBAAiB;AAAA,EACjB,oBAAoB;AAAA,EACpB,qBAAqB;AAAA,EACrB,gBAAgB;AAAA,EAChB,cAAc;AAAA,EACd,mBAAmB;AAAA,EACnB,gBAAgB;AAAA,EAChB,cAAc;AAAA,EACd,iBAAiB;AAAA,EACjB,oBAAoB;AAAA,EACpB,qBAAqB;AAAA,EACrB,oBAAoB;AAAA,EACpB,kBAAkB;AAAA,EAClB,qBAAqB;AAAA,EACrB,QAAQ;AACV;AAEO,IAAM,gBAAgB;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,IAAM,OAAO,EAAE,IAAI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
|
+
/** The `claude` to run: on PATH, else where the installers put it, else the newest
|
|
4
|
+
* copy the desktop app ships. Null when this machine has none. */
|
|
5
|
+
export declare function findClaude(env?: NodeJS.ProcessEnv, home?: string): string | null;
|
|
6
|
+
export interface Caps {
|
|
7
|
+
hasMode: boolean;
|
|
8
|
+
modes: string[];
|
|
9
|
+
promptsNone: boolean;
|
|
10
|
+
fork: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare function parseCaps(help: string): Caps;
|
|
13
|
+
/** Permission flags for the machine's mode. Safe: `dontAsk` (nothing that needs
|
|
14
|
+
* approval runs). Auto: Claude Code's own auto mode, or a refusal. Never
|
|
15
|
+
* bypassPermissions — no path here writes it. */
|
|
16
|
+
export declare function modeFlags(mode: Mode, caps: Caps): {
|
|
17
|
+
args: string[];
|
|
18
|
+
} | {
|
|
19
|
+
error: string;
|
|
20
|
+
};
|
|
21
|
+
/** The env a headless turn runs with: ours, minus the markers that make Claude Code
|
|
22
|
+
* think it runs inside another session, with CLAUDE_CONFIG_DIR naming the account. */
|
|
23
|
+
export declare function claudeEnv(configDir?: string, env?: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
|
|
24
|
+
export declare function detectCaps(bin: string): Caps;
|
|
25
|
+
export interface Transcript {
|
|
26
|
+
file: string;
|
|
27
|
+
configDir: string;
|
|
28
|
+
project: string;
|
|
29
|
+
}
|
|
30
|
+
/** <config dir>/projects/<folder>/<session>.jsonl in any Claude Code config dir. */
|
|
31
|
+
export declare function findTranscript(session: string, dirs: string[]): Transcript | null;
|
|
32
|
+
/** The folder a session runs in, from its transcript's own records (never from a
|
|
33
|
+
* command): the `cwd` whose project name is the folder the transcript is filed
|
|
34
|
+
* under, else the first `cwd`. Streams; a line over 2 MB is skipped. */
|
|
35
|
+
export declare function sessionFolder(t: Transcript, cap?: number): string | null;
|
|
36
|
+
/** A Claude Code process holds this session right now: its registry file,
|
|
37
|
+
* <config>/sessions/<pid>.json, names it and the pid is alive (interactive and
|
|
38
|
+
* Agent SDK sessions both file one). */
|
|
39
|
+
export declare function liveProcess(session: string, configDir: string): boolean;
|
|
40
|
+
/** Written in the last 90 s, and not by a job of ours. */
|
|
41
|
+
export declare function recentlyWritten(file: string, ourLastEnd?: number, now?: number): boolean;
|
|
42
|
+
export interface RunResult {
|
|
43
|
+
error?: string;
|
|
44
|
+
code?: number | null;
|
|
45
|
+
signal?: NodeJS.Signals | null;
|
|
46
|
+
stdout?: string | null;
|
|
47
|
+
tooBig?: boolean;
|
|
48
|
+
stderr?: string;
|
|
49
|
+
timedOut?: boolean;
|
|
50
|
+
}
|
|
51
|
+
/** Run one headless turn in its own process group, holding at most 1 MB of stdout. */
|
|
52
|
+
export declare function runClaude(bin: string, args: string[], o: {
|
|
53
|
+
cwd: string;
|
|
54
|
+
env: NodeJS.ProcessEnv;
|
|
55
|
+
timeoutMs?: number;
|
|
56
|
+
}): Promise<RunResult>;
|
|
57
|
+
export interface ClaudeResult {
|
|
58
|
+
type?: string;
|
|
59
|
+
result?: unknown;
|
|
60
|
+
is_error?: boolean;
|
|
61
|
+
subtype?: string;
|
|
62
|
+
session_id?: unknown;
|
|
63
|
+
permission_denials?: {
|
|
64
|
+
tool_name?: unknown;
|
|
65
|
+
}[];
|
|
66
|
+
}
|
|
67
|
+
/** `--output-format json`: one result object, or an array whose last `result` entry it is. */
|
|
68
|
+
export declare function parseResult(stdout: string | null | undefined): ClaudeResult | null;
|
|
69
|
+
export declare const isUuid: (s: unknown) => s is string;
|
|
70
|
+
//# sourceMappingURL=claude-code-control.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-code-control.d.ts","sourceRoot":"","sources":["../../../src/adapters/claude-code-control.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,cAAc,QAAc,CAAC;AAK1C,MAAM,MAAM,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC;AAoBnC;mEACmE;AACnE,wBAAgB,UAAU,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB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M,YAAY,CAAC;AAGpB,eAAO,MAAM,aAAa,0OAehB,CAAC;
|
|
1
|
+
{"version":3,"file":"claude-code.d.ts","sourceRoot":"","sources":["../../../src/adapters/claude-code.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EACV,OAAO,EAEP,UAAU,EAKV,YAAY,EACb,MAAM,YAAY,CAAC;AAGpB,eAAO,MAAM,aAAa,0OAehB,CAAC;AAaX,oDAAoD;AACpD,wBAAgB,UAAU,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,EAAE,IAAI,SAAO,GAAG,MAAM,EAAE,CAiBtF;AAgBD,eAAO,MAAM,UAAU,EAAE,OAwMxB,CAAC;AA4EF;sEACsE;AACtE,wBAAgB,SAAS,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,GAAG,IAAI,CAa7E;AA4DD;yEACyE;AACzE,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAG7C;AA2DD;;qFAEqF;AACrF,wBAAgB,WAAW,CACzB,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,KAAK,EAAE,UAAU,GAChB,YAAY,CA6Fd;AAED,6GAA6G;AAC7G,eAAO,MAAM,kBAAkB,QAAO,IAGrC,CAAC"}
|
|
@@ -4,6 +4,9 @@ export interface ClaudeShapedOptions {
|
|
|
4
4
|
matcherFor: (event: string) => string | undefined;
|
|
5
5
|
/** Seconds (milliseconds for Gemini CLI). */
|
|
6
6
|
timeout: number;
|
|
7
|
+
/** A longer timeout for one event (Claude Code's PermissionRequest, which may wait
|
|
8
|
+
* for a verified control answer: spec/CONTROL.md §6). */
|
|
9
|
+
timeoutFor?: (event: string) => number | undefined;
|
|
7
10
|
/** Extra top-level keys the file must carry (Cursor/Copilot: version: 1). */
|
|
8
11
|
top?: Record<string, unknown>;
|
|
9
12
|
}
|
|
@@ -1 +1 @@
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MAAM,CAAC;IAAC,YAAY,EAAE,OAAO,CAAA;CAAE,GAAG,MAAM,CAG5G;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,CA0Bf;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"}
|
|
@@ -5,6 +5,8 @@ import { geminiCli } from "./gemini-cli.js";
|
|
|
5
5
|
import type { Adapter } from "./types.js";
|
|
6
6
|
export declare const ADAPTERS: readonly Adapter[];
|
|
7
7
|
export declare const adapterByName: (name: string) => Adapter | undefined;
|
|
8
|
+
export { claudeDirs } from "./claude-code.js";
|
|
9
|
+
export * as claudeControl from "./claude-code-control.js";
|
|
8
10
|
export type { Adapter, AdapterEvent, BackfillRow, FactsState, HookCommand, HookInput, HookResult, InstallReport, SessionFacts, TranscriptRead, Turn, } from "./types.js";
|
|
9
11
|
export { antigravity, claudeCode, codex, geminiCli };
|
|
10
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/index.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,YAAY,EACZ,WAAW,EACX,UAAU,EACV,WAAW,EACX,SAAS,EACT,UAAU,EACV,aAAa,EACb,YAAY,EACZ,cAAc,EACd,IAAI,GACL,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC"}
|
package/dist/src/config.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ export interface SinkConfig {
|
|
|
5
5
|
url: string;
|
|
6
6
|
tier: Tier;
|
|
7
7
|
pii?: boolean;
|
|
8
|
+
/** @deprecated Never set: control is per machine (spec/CONTROL.md §2). Kept so an
|
|
9
|
+
* older config still reads. */
|
|
8
10
|
control?: boolean;
|
|
9
11
|
token?: string;
|
|
10
12
|
/** whsec_… for Standard Webhooks signatures. */
|
package/dist/src/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAEvC,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,6CAA6C;IAC7C,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,IAAI,CAAC;IACX,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gDAAgD;IAChD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kEAAkE;IAClE,QAAQ,CAAC,EAAE,IAAI,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,MAAM;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,OAAO,CAA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