sessionpipe-core 0.3.0 → 0.4.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 +19 -4
- package/dist/control.js.map +2 -2
- package/dist/index.js +37 -4
- package/dist/index.js.map +2 -2
- package/dist/schema/v1.d.ts +24 -0
- package/dist/schema/v1.d.ts.map +1 -1
- package/dist/schema.js +21 -7
- package/dist/schema.js.map +2 -2
- package/dist/src/adapters/claude-code-control.d.ts +6 -0
- package/dist/src/adapters/claude-code-control.d.ts.map +1 -1
- package/dist/src/adapters/claude-code.d.ts +3 -1
- package/dist/src/adapters/claude-code.d.ts.map +1 -1
- package/dist/src/control/verify.d.ts +13 -3
- package/dist/src/control/verify.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/schema/v1.d.ts
CHANGED
|
@@ -250,6 +250,7 @@ export declare const ControlKind: z.ZodEnum<{
|
|
|
250
250
|
"permission.answer": "permission.answer";
|
|
251
251
|
cancel: "cancel";
|
|
252
252
|
start: "start";
|
|
253
|
+
"key.add": "key.add";
|
|
253
254
|
}>;
|
|
254
255
|
export declare const DeliveryMode: z.ZodEnum<{
|
|
255
256
|
resume: "resume";
|
|
@@ -270,6 +271,7 @@ export declare const ControlCommand: z.ZodObject<{
|
|
|
270
271
|
"permission.answer": "permission.answer";
|
|
271
272
|
cancel: "cancel";
|
|
272
273
|
start: "start";
|
|
274
|
+
"key.add": "key.add";
|
|
273
275
|
}>;
|
|
274
276
|
session: z.ZodString;
|
|
275
277
|
text: z.ZodOptional<z.ZodString>;
|
|
@@ -280,6 +282,12 @@ export declare const ControlCommand: z.ZodObject<{
|
|
|
280
282
|
}>>;
|
|
281
283
|
note: z.ZodOptional<z.ZodString>;
|
|
282
284
|
cwd: z.ZodOptional<z.ZodString>;
|
|
285
|
+
key: z.ZodOptional<z.ZodObject<{
|
|
286
|
+
id: z.ZodString;
|
|
287
|
+
alg: z.ZodUnion<readonly [z.ZodLiteral<-7>, z.ZodLiteral<-257>]>;
|
|
288
|
+
spki: z.ZodString;
|
|
289
|
+
}, z.core.$strip>>;
|
|
290
|
+
name: z.ZodOptional<z.ZodString>;
|
|
283
291
|
nonce: z.ZodString;
|
|
284
292
|
iat: z.ZodInt;
|
|
285
293
|
}, z.core.$strip>;
|
|
@@ -350,7 +358,10 @@ export declare const ControlPoll: z.ZodObject<{
|
|
|
350
358
|
}, z.core.$strip>;
|
|
351
359
|
/** `taken` is the one non-final outcome: the machine verified the message and is
|
|
352
360
|
* delivering it (a headless resume can take minutes); a final ack follows. */
|
|
361
|
+
/** `progress` (not final): the answer so far, whole, in `reply`, with a rising `seq`.
|
|
362
|
+
* `taken` (not final): verified and being delivered. Every other outcome is final. */
|
|
353
363
|
export declare const ControlOutcome: z.ZodEnum<{
|
|
364
|
+
progress: "progress";
|
|
354
365
|
taken: "taken";
|
|
355
366
|
delivered: "delivered";
|
|
356
367
|
expired: "expired";
|
|
@@ -362,6 +373,7 @@ export declare const ControlAck: z.ZodObject<{
|
|
|
362
373
|
acks: z.ZodArray<z.ZodObject<{
|
|
363
374
|
id: z.ZodString;
|
|
364
375
|
outcome: z.ZodEnum<{
|
|
376
|
+
progress: "progress";
|
|
365
377
|
taken: "taken";
|
|
366
378
|
delivered: "delivered";
|
|
367
379
|
expired: "expired";
|
|
@@ -382,6 +394,7 @@ export declare const ControlAck: z.ZodObject<{
|
|
|
382
394
|
code: z.ZodOptional<z.ZodString>;
|
|
383
395
|
detail: z.ZodOptional<z.ZodString>;
|
|
384
396
|
reply: z.ZodOptional<z.ZodString>;
|
|
397
|
+
seq: z.ZodOptional<z.ZodInt>;
|
|
385
398
|
}, z.core.$strip>>;
|
|
386
399
|
}, z.core.$strip>;
|
|
387
400
|
/** `POST {control}/pair`, sent with the person's sink token from their own terminal —
|
|
@@ -478,6 +491,7 @@ export declare const WellKnown: z.ZodObject<{
|
|
|
478
491
|
control: z.ZodOptional<z.ZodObject<{
|
|
479
492
|
wait_max_s: z.ZodInt;
|
|
480
493
|
open_pairing: z.ZodOptional<z.ZodBoolean>;
|
|
494
|
+
session_tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
481
495
|
signing: z.ZodObject<{
|
|
482
496
|
rp_id: z.ZodString;
|
|
483
497
|
algs: z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<-7>, z.ZodLiteral<-257>]>>;
|
|
@@ -695,6 +709,7 @@ export declare const SCHEMAS: {
|
|
|
695
709
|
control: z.ZodOptional<z.ZodObject<{
|
|
696
710
|
wait_max_s: z.ZodInt;
|
|
697
711
|
open_pairing: z.ZodOptional<z.ZodBoolean>;
|
|
712
|
+
session_tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
698
713
|
signing: z.ZodObject<{
|
|
699
714
|
rp_id: z.ZodString;
|
|
700
715
|
algs: z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<-7>, z.ZodLiteral<-257>]>>;
|
|
@@ -730,6 +745,7 @@ export declare const SCHEMAS: {
|
|
|
730
745
|
"permission.answer": "permission.answer";
|
|
731
746
|
cancel: "cancel";
|
|
732
747
|
start: "start";
|
|
748
|
+
"key.add": "key.add";
|
|
733
749
|
}>;
|
|
734
750
|
session: z.ZodString;
|
|
735
751
|
text: z.ZodOptional<z.ZodString>;
|
|
@@ -740,6 +756,12 @@ export declare const SCHEMAS: {
|
|
|
740
756
|
}>>;
|
|
741
757
|
note: z.ZodOptional<z.ZodString>;
|
|
742
758
|
cwd: z.ZodOptional<z.ZodString>;
|
|
759
|
+
key: z.ZodOptional<z.ZodObject<{
|
|
760
|
+
id: z.ZodString;
|
|
761
|
+
alg: z.ZodUnion<readonly [z.ZodLiteral<-7>, z.ZodLiteral<-257>]>;
|
|
762
|
+
spki: z.ZodString;
|
|
763
|
+
}, z.core.$strip>>;
|
|
764
|
+
name: z.ZodOptional<z.ZodString>;
|
|
743
765
|
nonce: z.ZodString;
|
|
744
766
|
iat: z.ZodInt;
|
|
745
767
|
}, z.core.$strip>;
|
|
@@ -782,6 +804,7 @@ export declare const SCHEMAS: {
|
|
|
782
804
|
acks: z.ZodArray<z.ZodObject<{
|
|
783
805
|
id: z.ZodString;
|
|
784
806
|
outcome: z.ZodEnum<{
|
|
807
|
+
progress: "progress";
|
|
785
808
|
taken: "taken";
|
|
786
809
|
delivered: "delivered";
|
|
787
810
|
expired: "expired";
|
|
@@ -802,6 +825,7 @@ export declare const SCHEMAS: {
|
|
|
802
825
|
code: z.ZodOptional<z.ZodString>;
|
|
803
826
|
detail: z.ZodOptional<z.ZodString>;
|
|
804
827
|
reply: z.ZodOptional<z.ZodString>;
|
|
828
|
+
seq: z.ZodOptional<z.ZodInt>;
|
|
805
829
|
}, z.core.$strip>>;
|
|
806
830
|
}, z.core.$strip>;
|
|
807
831
|
readonly "control-pair": z.ZodObject<{
|
package/dist/schema/v1.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v1.d.ts","sourceRoot":"","sources":["../../schema/v1.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,QAAQ,IAAI,CAAC;AAE1B,oEAAoE;AACpE,eAAO,MAAM,SAAS,aAE2E,CAAC;AAElG,eAAO,MAAM,WAAW,2TAkBd,CAAC;AAEX,oDAAoD;AACpD,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAkBzE,CAAC;AAEF,eAAO,MAAM,aAAa,sHAUhB,CAAC;AAEX,eAAO,MAAM,IAAI,UAAwB,CAAC;AAC1C,eAAO,MAAM,IAAI,aAAuD,CAAC;AACzE,eAAO,MAAM,OAAO,kBAAkD,CAAC;AACvE,eAAO,MAAM,SAAS,aAIQ,CAAC;AAC/B,eAAO,MAAM,QAAQ,aAA+C,CAAC;AAErE,eAAO,MAAM,OAAO;;;;iBAMlB,CA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0.
|
|
1
|
+
// sessionpipe-core 0.4.0 · Apache-2.0 · https://sessionpipe.org
|
|
2
2
|
|
|
3
3
|
// schema/v1.ts
|
|
4
4
|
import { z } from "zod";
|
|
@@ -173,7 +173,7 @@ var Capability = z.enum(["events", "backfill", "forget", "control", "native"]);
|
|
|
173
173
|
var B64Url = z.string().regex(/^[A-Za-z0-9_-]*$/, "base64url, no padding");
|
|
174
174
|
var MachineId = z.string().regex(/^m_[A-Za-z0-9_-]{16,40}$/, "m_ + 16\u201340 base64url");
|
|
175
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"]);
|
|
176
|
+
var ControlKind = z.enum(["prompt", "permission.answer", "cancel", "start", "key.add"]);
|
|
177
177
|
var DeliveryMode = z.enum(["sdk", "waiter", "turn", "api", "resume", "fork"]);
|
|
178
178
|
var ControlCommand = z.object({
|
|
179
179
|
v: z.literal(1),
|
|
@@ -182,7 +182,7 @@ var ControlCommand = z.object({
|
|
|
182
182
|
kind: ControlKind,
|
|
183
183
|
session: SessionRef,
|
|
184
184
|
/** prompt, start: the message for the model. */
|
|
185
|
-
text: z.string().min(1).max(
|
|
185
|
+
text: z.string().min(1).max(2e4).optional(),
|
|
186
186
|
/** permission.answer: the attention_id being answered. */
|
|
187
187
|
for: z.string().min(1).max(128).optional(),
|
|
188
188
|
decision: z.enum(["allow", "deny"]).optional(),
|
|
@@ -190,6 +190,15 @@ var ControlCommand = z.object({
|
|
|
190
190
|
note: z.string().max(2e3).optional(),
|
|
191
191
|
/** start: the absolute folder the new session runs in. */
|
|
192
192
|
cwd: z.string().max(1024).optional(),
|
|
193
|
+
/** key.add (session `sessionpipe:keys`): the new device's passkey, which the machine
|
|
194
|
+
* trusts once a key it already trusts signed this command. */
|
|
195
|
+
key: z.object({
|
|
196
|
+
id: z.string().regex(/^[A-Za-z0-9_-]{16,1400}$/),
|
|
197
|
+
alg: z.union([z.literal(-7), z.literal(-257)]),
|
|
198
|
+
spki: z.string().regex(/^[A-Za-z0-9_-]{40,2000}$/)
|
|
199
|
+
}).optional(),
|
|
200
|
+
/** key.add: what the person calls the device. */
|
|
201
|
+
name: z.string().min(1).max(80).optional(),
|
|
193
202
|
/** At least 16 random bytes, base64url. */
|
|
194
203
|
nonce: z.string().regex(/^[A-Za-z0-9_-]{22,64}$/),
|
|
195
204
|
/** Epoch ms, the signing device's clock. */
|
|
@@ -219,8 +228,8 @@ var ControlKey = z.object({
|
|
|
219
228
|
var ControlMessage = z.object({
|
|
220
229
|
/** The receiver's id for this message; the ack key. Not signed: the nonce inside cmd is. */
|
|
221
230
|
id: Ulid,
|
|
222
|
-
/** The command string, exactly as signed (≤
|
|
223
|
-
cmd: z.string().min(1).max(
|
|
231
|
+
/** The command string, exactly as signed (≤ 48 000 characters). */
|
|
232
|
+
cmd: z.string().min(1).max(48e3),
|
|
224
233
|
/** The day key's ECDSA P-256 / SHA-256 signature over cmd: raw r‖s, base64url. */
|
|
225
234
|
csig: B64Url.nullable().optional(),
|
|
226
235
|
/** The grant vouching for the day key: its string plus the passkey's assertion over sha256(str). */
|
|
@@ -233,7 +242,7 @@ var ControlMessage = z.object({
|
|
|
233
242
|
expires_at: Rfc3339
|
|
234
243
|
});
|
|
235
244
|
var ControlPoll = z.object({ messages: z.array(ControlMessage) });
|
|
236
|
-
var ControlOutcome = z.enum(["taken", "delivered", "expired", "unsupported", "failed", "refused"]);
|
|
245
|
+
var ControlOutcome = z.enum(["progress", "taken", "delivered", "expired", "unsupported", "failed", "refused"]);
|
|
237
246
|
var ControlAck = z.object({
|
|
238
247
|
acks: z.array(
|
|
239
248
|
z.object({
|
|
@@ -248,7 +257,9 @@ var ControlAck = z.object({
|
|
|
248
257
|
code: z.string().regex(/^[a-z_]{1,40}$/).optional(),
|
|
249
258
|
detail: z.string().max(500).optional(),
|
|
250
259
|
/** resume / fork / start: the agent's reply, redacted by the secrets ruleset. */
|
|
251
|
-
reply: z.string().max(2e4).optional()
|
|
260
|
+
reply: z.string().max(2e4).optional(),
|
|
261
|
+
/** progress only: rises with every progress ack for this id; a receiver keeps the highest. */
|
|
262
|
+
seq: z.int().min(0).optional()
|
|
252
263
|
})
|
|
253
264
|
).min(1)
|
|
254
265
|
});
|
|
@@ -318,6 +329,9 @@ var WellKnown = z.object({
|
|
|
318
329
|
wait_max_s: z.int().min(1).max(60),
|
|
319
330
|
/** Pairing may start with no token: the person approves the link signed in. */
|
|
320
331
|
open_pairing: z.boolean().optional(),
|
|
332
|
+
/** MCP servers (`mcp__<server>`) a session answering this receiver's message may
|
|
333
|
+
* use without asking. MCP servers only: a daemon ignores anything else. */
|
|
334
|
+
session_tools: z.array(z.string().regex(/^mcp__[A-Za-z0-9_-]{1,64}$/)).max(8).optional(),
|
|
321
335
|
/** How commands are signed: the WebAuthn rp id keys are enrolled for, and the algorithms. */
|
|
322
336
|
signing: z.object({
|
|
323
337
|
rp_id: z.string().min(1).max(253),
|
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\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 \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 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 /** 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\"]).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 /** 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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AE,IAAI,EAAE,GAAG,WAAW,EAAE,IAAI,EAAE,IAAI,IAAI,EAAE,IAAI,MAAO,EAAE,CAAC;AAAA,EACjG,SAAS,EACN,OAAO;AAAA,IACN,YAAY,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE;AAAA;AAAA,IAEjC,cAAc,EAAE,QAAQ,EAAE,SAAS;AAAA;AAAA,IAEnC,SAAS,EAAE,OAAO;AAAA,MAChB,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,MAChC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC;AAAA,IAChE,CAAC;AAAA,EACH,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;",
|
|
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\", \"key.add\"]);\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(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 absolute folder the new session runs in. */\n cwd: z.string().max(1024).optional(),\n /** key.add (session `sessionpipe:keys`): the new device's passkey, which the machine\n * trusts once a key it already trusts signed this command. */\n key: z\n .object({\n id: z.string().regex(/^[A-Za-z0-9_-]{16,1400}$/),\n alg: z.union([z.literal(-7), z.literal(-257)]),\n spki: z.string().regex(/^[A-Za-z0-9_-]{40,2000}$/),\n })\n .optional(),\n /** key.add: what the person calls the device. */\n name: z.string().min(1).max(80).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 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 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. */\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 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 }),\n )\n .min(1),\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 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 /** 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\"]).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 }),\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,E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IAAI,EAAE;AAAA;AAAA,IAEjC,cAAc,EAAE,QAAQ,EAAE,SAAS;AAAA;AAAA;AAAA,IAGnC,eAAe,EACZ,MAAM,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC,EACpD,IAAI,CAAC,EACL,SAAS;AAAA;AAAA,IAEZ,SAAS,EAAE,OAAO;AAAA,MAChB,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,MAChC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC;AAAA,IAChE,CAAC;AAAA,EACH,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
|
}
|
|
@@ -8,6 +8,9 @@ export interface Caps {
|
|
|
8
8
|
modes: string[];
|
|
9
9
|
promptsNone: boolean;
|
|
10
10
|
fork: boolean;
|
|
11
|
+
/** `--output-format stream-json` with `--include-partial-messages`: the answer can be
|
|
12
|
+
* forwarded as it is written. Optional so older callers' literals still type. */
|
|
13
|
+
stream?: boolean;
|
|
11
14
|
}
|
|
12
15
|
export declare function parseCaps(help: string): Caps;
|
|
13
16
|
/** Permission flags for the machine's mode. Safe: `dontAsk` (nothing that needs
|
|
@@ -53,6 +56,9 @@ export declare function runClaude(bin: string, args: string[], o: {
|
|
|
53
56
|
cwd: string;
|
|
54
57
|
env: NodeJS.ProcessEnv;
|
|
55
58
|
timeoutMs?: number;
|
|
59
|
+
/** Streaming (`--output-format stream-json`): each stdout line as it arrives. Only
|
|
60
|
+
* the `result` line is kept for the RunResult, so a long stream never hits the cap. */
|
|
61
|
+
onLine?: (line: string) => void;
|
|
56
62
|
}): Promise<RunResult>;
|
|
57
63
|
export interface ClaudeResult {
|
|
58
64
|
type?: string;
|
|
@@ -1 +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,EAAE,IAAI,SAAe,GAAG,MAAM,GAAG,IAAI,CA2BnG;AAcD,MAAM,WAAW,IAAI;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,WAAW,EAAE,OAAO,CAAC;IACrB,IAAI,EAAE,OAAO,CAAC;
|
|
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,EAAE,IAAI,SAAe,GAAG,MAAM,GAAG,IAAI,CA2BnG;AAcD,MAAM,WAAW,IAAI;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,WAAW,EAAE,OAAO,CAAC;IACrB,IAAI,EAAE,OAAO,CAAC;IACd;sFACkF;IAClF,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;A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ACvB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,sFAAsF;AACtF,wBAAgB,SAAS,CACvB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EAAE,EACd,CAAC,EAAE;IACD,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC,UAAU,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;4FACwF;IACxF,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACjC,GACA,OAAO,CAAC,SAAS,CAAC,CAmGpB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,kBAAkB,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,EAAE,CAAC;CAChD;AAED,8FAA8F;AAC9F,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,YAAY,GAAG,IAAI,CAqBlF;AAED,eAAO,MAAM,MAAM,GAAI,GAAG,OAAO,KAAG,CAAC,IAAI,MAAkD,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { Adapter, FactsState, SessionFacts } from "./types.js";
|
|
2
2
|
export declare const CLAUDE_EVENTS: readonly ["SessionStart", "UserPromptSubmit", "PreToolUse", "PostToolUse", "PostToolUseFailure", "PermissionRequest", "Notification", "Stop", "SubagentStart", "SubagentStop", "PreCompact", "PostCompact", "SessionEnd", "StopFailure"];
|
|
3
|
-
/** Every Claude Code config dir on this machine.
|
|
3
|
+
/** Every Claude Code config dir on this machine. `home` follows the env's HOME, so a
|
|
4
|
+
* caller with its own env (a test) never reaches the real ~/.claude: the install test
|
|
5
|
+
* once rewrote a real settings.json with its fake hook paths on every run. */
|
|
4
6
|
export declare function claudeDirs(env?: NodeJS.ProcessEnv, home?: string): string[];
|
|
5
7
|
export declare const claudeCode: Adapter;
|
|
6
8
|
/** The Claude Code process that ran this hook: the nearest ancestor with a registry
|
|
@@ -1 +1 @@
|
|
|
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
|
|
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;;+EAE+E;AAC/E,wBAAgB,UAAU,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,EAAE,IAAI,SAAmB,GAAG,MAAM,EAAE,CAiBlG;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"}
|
|
@@ -11,16 +11,18 @@ export declare const RECEIVER_MAX_AGE_MS: number;
|
|
|
11
11
|
/** How long a machine remembers a nonce: longer than MACHINE_MAX_AGE_MS + SKEW_MS. */
|
|
12
12
|
export declare const NONCE_TTL_MS: number;
|
|
13
13
|
/** The whole command string, in UTF-16 code units (what JSON.parse sees). */
|
|
14
|
-
export declare const CMD_MAX =
|
|
14
|
+
export declare const CMD_MAX = 48000;
|
|
15
15
|
/** A prompt's text, in characters. */
|
|
16
|
-
export declare const TEXT_MAX =
|
|
16
|
+
export declare const TEXT_MAX = 20000;
|
|
17
17
|
/** A permission answer's note. */
|
|
18
18
|
export declare const NOTE_MAX = 2000;
|
|
19
19
|
/** A grant string. */
|
|
20
20
|
export declare const GRANT_STR_MAX = 2000;
|
|
21
21
|
export declare const COMMAND_TYPE = "sessionpipe.control";
|
|
22
22
|
export declare const GRANT_TYPE = "sessionpipe.grant";
|
|
23
|
-
export declare const CONTROL_KINDS: readonly ["prompt", "permission.answer", "cancel", "start"];
|
|
23
|
+
export declare const CONTROL_KINDS: readonly ["prompt", "permission.answer", "cancel", "start", "key.add"];
|
|
24
|
+
/** The session a `key.add` names: the machine's own key store, not a coding session. */
|
|
25
|
+
export declare const KEY_STORE_SESSION = "sessionpipe:keys";
|
|
24
26
|
export type ControlKind = (typeof CONTROL_KINDS)[number];
|
|
25
27
|
/** COSE algorithm ids a trusted key may use. */
|
|
26
28
|
export declare const ES256 = -7;
|
|
@@ -69,6 +71,14 @@ export interface ControlCommand {
|
|
|
69
71
|
decision?: "allow" | "deny";
|
|
70
72
|
note?: string;
|
|
71
73
|
cwd?: string;
|
|
74
|
+
/** key.add only: the passkey to trust from now on, as the receiver holds it. */
|
|
75
|
+
key?: {
|
|
76
|
+
id: string;
|
|
77
|
+
alg: -7 | -257;
|
|
78
|
+
spki: string;
|
|
79
|
+
};
|
|
80
|
+
/** key.add only: what the person calls the device ("iPhone"), for `control keys`. */
|
|
81
|
+
name?: string;
|
|
72
82
|
nonce: string;
|
|
73
83
|
iat: number;
|
|
74
84
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../../src/control/verify.ts"],"names":[],"mappings":"AAYA,mEAAmE;AACnE,eAAO,MAAM,YAAY,QAAgB,CAAC;AAC1C,4EAA4E;AAC5E,eAAO,MAAM,OAAO,QAAa,CAAC;AAClC;qEACqE;AACrE,eAAO,MAAM,kBAAkB,QAAgB,CAAC;AAChD;mCACmC;AACnC,eAAO,MAAM,mBAAmB,QAAc,CAAC;AAC/C,sFAAsF;AACtF,eAAO,MAAM,YAAY,QAAgB,CAAC;AAC1C,6EAA6E;AAC7E,eAAO,MAAM,OAAO,QAAS,CAAC;AAC9B,sCAAsC;AACtC,eAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../../src/control/verify.ts"],"names":[],"mappings":"AAYA,mEAAmE;AACnE,eAAO,MAAM,YAAY,QAAgB,CAAC;AAC1C,4EAA4E;AAC5E,eAAO,MAAM,OAAO,QAAa,CAAC;AAClC;qEACqE;AACrE,eAAO,MAAM,kBAAkB,QAAgB,CAAC;AAChD;mCACmC;AACnC,eAAO,MAAM,mBAAmB,QAAc,CAAC;AAC/C,sFAAsF;AACtF,eAAO,MAAM,YAAY,QAAgB,CAAC;AAC1C,6EAA6E;AAC7E,eAAO,MAAM,OAAO,QAAS,CAAC;AAC9B,sCAAsC;AACtC,eAAO,MAAM,QAAQ,QAAS,CAAC;AAC/B,kCAAkC;AAClC,eAAO,MAAM,QAAQ,OAAQ,CAAC;AAC9B,sBAAsB;AACtB,eAAO,MAAM,aAAa,OAAQ,CAAC;AAEnC,eAAO,MAAM,YAAY,wBAAwB,CAAC;AAClD,eAAO,MAAM,UAAU,sBAAsB,CAAC;AAC9C,eAAO,MAAM,aAAa,wEAAyE,CAAC;AACpG,wFAAwF;AACx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AG,EAAE,UAAU,CAAC;IAChB,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd,GAAG,OAAO,CAAC,KAAK,CAAC,CAGjB;AAID,KAAK,MAAM,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,GAAG,EAAE,cAAc,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,WAAW,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAQhG,gFAAgF;AAChF,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAIhE;AAED,qEAAqE;AACrE,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAOpF;AAED,0FAA0F;AAC1F,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAqEjD;AAMD,sDAAsD;AACtD,wBAAgB,UAAU,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,KAAK,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAiB9G;AAgBD;;;;;;;GAOG;AACH,wBAAsB,aAAa,CAAC,CAAC,EAAE,aAAa,GAAG,IAAI,GAAG,SAAS,EAAE,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,CA4C3G"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sessionpipe-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "sessionpipe core: protocol types, harness adapters, privacy filter and redaction rulesets, outbox and sinks. Zero runtime dependencies. (published unscoped until the @sessionpipe npm org exists; the code is the same)",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|