sessionpipe-core 0.12.0 → 0.13.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 +26 -11
- package/dist/control.js.map +3 -3
- package/dist/index.js +271 -71
- package/dist/index.js.map +4 -4
- package/dist/schema/v1.d.ts +75 -1
- package/dist/schema/v1.d.ts.map +1 -1
- package/dist/schema.js +77 -10
- package/dist/schema.js.map +2 -2
- package/dist/service.js +1 -1
- package/dist/src/adapters/acp-control.d.ts.map +1 -1
- package/dist/src/adapters/claude-code-control.d.ts +136 -6
- package/dist/src/adapters/claude-code-control.d.ts.map +1 -1
- package/dist/src/adapters/headless.d.ts +3 -1
- package/dist/src/adapters/headless.d.ts.map +1 -1
- package/dist/src/adapters/types.d.ts +6 -0
- package/dist/src/adapters/types.d.ts.map +1 -1
- package/dist/src/control/verify.d.ts +3 -0
- package/dist/src/control/verify.d.ts.map +1 -1
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/launched-by.d.ts +20 -3
- package/dist/src/launched-by.d.ts.map +1 -1
- package/dist/src/privacy/filter.d.ts.map +1 -1
- package/dist/src/readers/transcripts.d.ts +11 -1
- package/dist/src/readers/transcripts.d.ts.map +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/schema/v1.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { z } from "zod";
|
|
|
2
2
|
export declare const PROTOCOL = 1;
|
|
3
3
|
/** Dotted, lowercase. Unknown types MUST be accepted and stored. */
|
|
4
4
|
export declare const EventType: z.ZodString;
|
|
5
|
-
export declare const KNOWN_TYPES: readonly ["session.started", "session.heartbeat", "session.ended", "session.backfill", "session.forgotten", "turn.started", "turn.ended", "turn.transcript", "turn.progress", "tool.started", "tool.ended", "files.changed", "attention.needed", "attention.cleared", "subagent.started", "subagent.ended", "context.compacted", "limits.observed", "native"];
|
|
5
|
+
export declare const KNOWN_TYPES: readonly ["session.started", "session.heartbeat", "session.ended", "session.backfill", "session.forgotten", "turn.started", "turn.ended", "turn.transcript", "turn.progress", "tool.started", "tool.ended", "files.changed", "attention.needed", "attention.cleared", "subagent.started", "subagent.ended", "context.compacted", "limits.observed", "delegation.started", "delegation.ended", "native"];
|
|
6
6
|
/** The lowest tier that carries each known type. */
|
|
7
7
|
export declare const TYPE_TIER: Record<(typeof KNOWN_TYPES)[number], 0 | 1 | 2 | 3>;
|
|
8
8
|
export declare const HARNESS_NAMES: readonly ["claude-code", "codex", "gemini-cli", "antigravity", "devin", "cursor", "copilot-cli", "droid", "kiro", "opencode"];
|
|
@@ -35,6 +35,7 @@ export declare const Session: z.ZodObject<{
|
|
|
35
35
|
attended: z.ZodOptional<z.ZodBoolean>;
|
|
36
36
|
parent_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
37
37
|
launched_by: z.ZodOptional<z.ZodString>;
|
|
38
|
+
delegated_by: z.ZodOptional<z.ZodString>;
|
|
38
39
|
}, z.core.$strip>;
|
|
39
40
|
export declare const Privacy: z.ZodObject<{
|
|
40
41
|
rulesets: z.ZodArray<z.ZodString>;
|
|
@@ -70,6 +71,7 @@ export declare const Event: z.ZodObject<{
|
|
|
70
71
|
attended: z.ZodOptional<z.ZodBoolean>;
|
|
71
72
|
parent_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
72
73
|
launched_by: z.ZodOptional<z.ZodString>;
|
|
74
|
+
delegated_by: z.ZodOptional<z.ZodString>;
|
|
73
75
|
}, z.core.$strip>;
|
|
74
76
|
privacy: z.ZodObject<{
|
|
75
77
|
rulesets: z.ZodArray<z.ZodString>;
|
|
@@ -140,12 +142,14 @@ export declare const EventData: z.ZodObject<{
|
|
|
140
142
|
user: z.ZodString;
|
|
141
143
|
assistant: z.ZodString;
|
|
142
144
|
at: z.ZodISODateTime;
|
|
145
|
+
injected: z.ZodOptional<z.ZodLiteral<true>>;
|
|
143
146
|
}, z.core.$loose>;
|
|
144
147
|
"turn.progress": z.ZodObject<{
|
|
145
148
|
turn: z.ZodInt;
|
|
146
149
|
user: z.ZodString;
|
|
147
150
|
assistant: z.ZodString;
|
|
148
151
|
at: z.ZodISODateTime;
|
|
152
|
+
injected: z.ZodOptional<z.ZodLiteral<true>>;
|
|
149
153
|
}, z.core.$loose>;
|
|
150
154
|
"tool.started": z.ZodObject<{
|
|
151
155
|
tool: z.ZodString;
|
|
@@ -214,6 +218,29 @@ export declare const EventData: z.ZodObject<{
|
|
|
214
218
|
plan: z.ZodOptional<z.ZodString>;
|
|
215
219
|
account_id: z.ZodOptional<z.ZodString>;
|
|
216
220
|
}, z.core.$loose>;
|
|
221
|
+
"delegation.started": z.ZodObject<{
|
|
222
|
+
ask_id: z.ZodString;
|
|
223
|
+
via: z.ZodEnum<{
|
|
224
|
+
ask: "ask";
|
|
225
|
+
handoff: "handoff";
|
|
226
|
+
}>;
|
|
227
|
+
harness: z.ZodString;
|
|
228
|
+
to: z.ZodOptional<z.ZodString>;
|
|
229
|
+
text: z.ZodOptional<z.ZodString>;
|
|
230
|
+
}, z.core.$loose>;
|
|
231
|
+
"delegation.ended": z.ZodObject<{
|
|
232
|
+
ask_id: z.ZodString;
|
|
233
|
+
to: z.ZodOptional<z.ZodString>;
|
|
234
|
+
ok: z.ZodBoolean;
|
|
235
|
+
ms: z.ZodInt;
|
|
236
|
+
error: z.ZodOptional<z.ZodString>;
|
|
237
|
+
relayed: z.ZodOptional<z.ZodEnum<{
|
|
238
|
+
delivered: "delivered";
|
|
239
|
+
failed: "failed";
|
|
240
|
+
unsupported: "unsupported";
|
|
241
|
+
}>>;
|
|
242
|
+
reply: z.ZodOptional<z.ZodString>;
|
|
243
|
+
}, z.core.$loose>;
|
|
217
244
|
native: z.ZodObject<{}, z.core.$loose>;
|
|
218
245
|
}, z.core.$strip>;
|
|
219
246
|
export declare const Batch: z.ZodObject<{
|
|
@@ -247,6 +274,7 @@ export declare const Batch: z.ZodObject<{
|
|
|
247
274
|
attended: z.ZodOptional<z.ZodBoolean>;
|
|
248
275
|
parent_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
249
276
|
launched_by: z.ZodOptional<z.ZodString>;
|
|
277
|
+
delegated_by: z.ZodOptional<z.ZodString>;
|
|
250
278
|
}, z.core.$strip>;
|
|
251
279
|
privacy: z.ZodObject<{
|
|
252
280
|
rulesets: z.ZodArray<z.ZodString>;
|
|
@@ -310,6 +338,7 @@ export declare const KeyTypes: z.ZodArray<z.ZodEnum<{
|
|
|
310
338
|
export declare const DeliveryMode: z.ZodEnum<{
|
|
311
339
|
api: "api";
|
|
312
340
|
fork: "fork";
|
|
341
|
+
inbox: "inbox";
|
|
313
342
|
resume: "resume";
|
|
314
343
|
sdk: "sdk";
|
|
315
344
|
turn: "turn";
|
|
@@ -408,6 +437,7 @@ export declare const ControlCommand: z.ZodObject<{
|
|
|
408
437
|
pool_account: z.ZodOptional<z.ZodString>;
|
|
409
438
|
pool_order: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
410
439
|
pool_code: z.ZodOptional<z.ZodString>;
|
|
440
|
+
reply_to: z.ZodOptional<z.ZodString>;
|
|
411
441
|
nonce: z.ZodString;
|
|
412
442
|
iat: z.ZodInt;
|
|
413
443
|
}, z.core.$strip>;
|
|
@@ -537,12 +567,14 @@ export declare const ControlAck: z.ZodObject<{
|
|
|
537
567
|
mode: z.ZodOptional<z.ZodEnum<{
|
|
538
568
|
api: "api";
|
|
539
569
|
fork: "fork";
|
|
570
|
+
inbox: "inbox";
|
|
540
571
|
resume: "resume";
|
|
541
572
|
sdk: "sdk";
|
|
542
573
|
turn: "turn";
|
|
543
574
|
waiter: "waiter";
|
|
544
575
|
}>>;
|
|
545
576
|
session: z.ZodOptional<z.ZodString>;
|
|
577
|
+
copy_of: z.ZodOptional<z.ZodString>;
|
|
546
578
|
code: z.ZodOptional<z.ZodString>;
|
|
547
579
|
detail: z.ZodOptional<z.ZodString>;
|
|
548
580
|
reply: z.ZodOptional<z.ZodString>;
|
|
@@ -579,6 +611,7 @@ export declare const ControlPairStart: z.ZodObject<{
|
|
|
579
611
|
modes: z.ZodArray<z.ZodEnum<{
|
|
580
612
|
api: "api";
|
|
581
613
|
fork: "fork";
|
|
614
|
+
inbox: "inbox";
|
|
582
615
|
resume: "resume";
|
|
583
616
|
sdk: "sdk";
|
|
584
617
|
turn: "turn";
|
|
@@ -602,6 +635,8 @@ export declare const ControlPairStart: z.ZodObject<{
|
|
|
602
635
|
device: "device";
|
|
603
636
|
passkey: "passkey";
|
|
604
637
|
}>>>;
|
|
638
|
+
ask: z.ZodOptional<z.ZodBoolean>;
|
|
639
|
+
handoff: z.ZodOptional<z.ZodBoolean>;
|
|
605
640
|
}, z.core.$strip>;
|
|
606
641
|
/** The receiver's answer: where the person confirms, and the digits both screens show. */
|
|
607
642
|
export declare const ControlPairStarted: z.ZodObject<{
|
|
@@ -703,6 +738,7 @@ export declare const ControlHello: z.ZodObject<{
|
|
|
703
738
|
modes: z.ZodArray<z.ZodEnum<{
|
|
704
739
|
api: "api";
|
|
705
740
|
fork: "fork";
|
|
741
|
+
inbox: "inbox";
|
|
706
742
|
resume: "resume";
|
|
707
743
|
sdk: "sdk";
|
|
708
744
|
turn: "turn";
|
|
@@ -771,6 +807,8 @@ export declare const ControlHello: z.ZodObject<{
|
|
|
771
807
|
limited_by: z.ZodOptional<z.ZodString>;
|
|
772
808
|
}, z.core.$strip>>;
|
|
773
809
|
}, z.core.$strip>>;
|
|
810
|
+
ask: z.ZodOptional<z.ZodBoolean>;
|
|
811
|
+
handoff: z.ZodOptional<z.ZodBoolean>;
|
|
774
812
|
}, z.core.$strip>;
|
|
775
813
|
export declare const WellKnown: z.ZodObject<{
|
|
776
814
|
protocol: z.ZodArray<z.ZodInt>;
|
|
@@ -836,6 +874,7 @@ export declare const SCHEMAS: {
|
|
|
836
874
|
attended: z.ZodOptional<z.ZodBoolean>;
|
|
837
875
|
parent_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
838
876
|
launched_by: z.ZodOptional<z.ZodString>;
|
|
877
|
+
delegated_by: z.ZodOptional<z.ZodString>;
|
|
839
878
|
}, z.core.$strip>;
|
|
840
879
|
privacy: z.ZodObject<{
|
|
841
880
|
rulesets: z.ZodArray<z.ZodString>;
|
|
@@ -891,12 +930,14 @@ export declare const SCHEMAS: {
|
|
|
891
930
|
user: z.ZodString;
|
|
892
931
|
assistant: z.ZodString;
|
|
893
932
|
at: z.ZodISODateTime;
|
|
933
|
+
injected: z.ZodOptional<z.ZodLiteral<true>>;
|
|
894
934
|
}, z.core.$loose>;
|
|
895
935
|
"turn.progress": z.ZodObject<{
|
|
896
936
|
turn: z.ZodInt;
|
|
897
937
|
user: z.ZodString;
|
|
898
938
|
assistant: z.ZodString;
|
|
899
939
|
at: z.ZodISODateTime;
|
|
940
|
+
injected: z.ZodOptional<z.ZodLiteral<true>>;
|
|
900
941
|
}, z.core.$loose>;
|
|
901
942
|
"tool.started": z.ZodObject<{
|
|
902
943
|
tool: z.ZodString;
|
|
@@ -965,6 +1006,29 @@ export declare const SCHEMAS: {
|
|
|
965
1006
|
plan: z.ZodOptional<z.ZodString>;
|
|
966
1007
|
account_id: z.ZodOptional<z.ZodString>;
|
|
967
1008
|
}, z.core.$loose>;
|
|
1009
|
+
"delegation.started": z.ZodObject<{
|
|
1010
|
+
ask_id: z.ZodString;
|
|
1011
|
+
via: z.ZodEnum<{
|
|
1012
|
+
ask: "ask";
|
|
1013
|
+
handoff: "handoff";
|
|
1014
|
+
}>;
|
|
1015
|
+
harness: z.ZodString;
|
|
1016
|
+
to: z.ZodOptional<z.ZodString>;
|
|
1017
|
+
text: z.ZodOptional<z.ZodString>;
|
|
1018
|
+
}, z.core.$loose>;
|
|
1019
|
+
"delegation.ended": z.ZodObject<{
|
|
1020
|
+
ask_id: z.ZodString;
|
|
1021
|
+
to: z.ZodOptional<z.ZodString>;
|
|
1022
|
+
ok: z.ZodBoolean;
|
|
1023
|
+
ms: z.ZodInt;
|
|
1024
|
+
error: z.ZodOptional<z.ZodString>;
|
|
1025
|
+
relayed: z.ZodOptional<z.ZodEnum<{
|
|
1026
|
+
delivered: "delivered";
|
|
1027
|
+
failed: "failed";
|
|
1028
|
+
unsupported: "unsupported";
|
|
1029
|
+
}>>;
|
|
1030
|
+
reply: z.ZodOptional<z.ZodString>;
|
|
1031
|
+
}, z.core.$loose>;
|
|
968
1032
|
native: z.ZodObject<{}, z.core.$loose>;
|
|
969
1033
|
}, z.core.$strip>;
|
|
970
1034
|
readonly batch: z.ZodObject<{
|
|
@@ -998,6 +1062,7 @@ export declare const SCHEMAS: {
|
|
|
998
1062
|
attended: z.ZodOptional<z.ZodBoolean>;
|
|
999
1063
|
parent_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1000
1064
|
launched_by: z.ZodOptional<z.ZodString>;
|
|
1065
|
+
delegated_by: z.ZodOptional<z.ZodString>;
|
|
1001
1066
|
}, z.core.$strip>;
|
|
1002
1067
|
privacy: z.ZodObject<{
|
|
1003
1068
|
rulesets: z.ZodArray<z.ZodString>;
|
|
@@ -1140,6 +1205,7 @@ export declare const SCHEMAS: {
|
|
|
1140
1205
|
pool_account: z.ZodOptional<z.ZodString>;
|
|
1141
1206
|
pool_order: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1142
1207
|
pool_code: z.ZodOptional<z.ZodString>;
|
|
1208
|
+
reply_to: z.ZodOptional<z.ZodString>;
|
|
1143
1209
|
nonce: z.ZodString;
|
|
1144
1210
|
iat: z.ZodInt;
|
|
1145
1211
|
}, z.core.$strip>;
|
|
@@ -1208,12 +1274,14 @@ export declare const SCHEMAS: {
|
|
|
1208
1274
|
mode: z.ZodOptional<z.ZodEnum<{
|
|
1209
1275
|
api: "api";
|
|
1210
1276
|
fork: "fork";
|
|
1277
|
+
inbox: "inbox";
|
|
1211
1278
|
resume: "resume";
|
|
1212
1279
|
sdk: "sdk";
|
|
1213
1280
|
turn: "turn";
|
|
1214
1281
|
waiter: "waiter";
|
|
1215
1282
|
}>>;
|
|
1216
1283
|
session: z.ZodOptional<z.ZodString>;
|
|
1284
|
+
copy_of: z.ZodOptional<z.ZodString>;
|
|
1217
1285
|
code: z.ZodOptional<z.ZodString>;
|
|
1218
1286
|
detail: z.ZodOptional<z.ZodString>;
|
|
1219
1287
|
reply: z.ZodOptional<z.ZodString>;
|
|
@@ -1238,6 +1306,7 @@ export declare const SCHEMAS: {
|
|
|
1238
1306
|
modes: z.ZodArray<z.ZodEnum<{
|
|
1239
1307
|
api: "api";
|
|
1240
1308
|
fork: "fork";
|
|
1309
|
+
inbox: "inbox";
|
|
1241
1310
|
resume: "resume";
|
|
1242
1311
|
sdk: "sdk";
|
|
1243
1312
|
turn: "turn";
|
|
@@ -1261,6 +1330,8 @@ export declare const SCHEMAS: {
|
|
|
1261
1330
|
device: "device";
|
|
1262
1331
|
passkey: "passkey";
|
|
1263
1332
|
}>>>;
|
|
1333
|
+
ask: z.ZodOptional<z.ZodBoolean>;
|
|
1334
|
+
handoff: z.ZodOptional<z.ZodBoolean>;
|
|
1264
1335
|
}, z.core.$strip>;
|
|
1265
1336
|
readonly "control-pair-started": z.ZodObject<{
|
|
1266
1337
|
machine: z.ZodString;
|
|
@@ -1306,6 +1377,7 @@ export declare const SCHEMAS: {
|
|
|
1306
1377
|
modes: z.ZodArray<z.ZodEnum<{
|
|
1307
1378
|
api: "api";
|
|
1308
1379
|
fork: "fork";
|
|
1380
|
+
inbox: "inbox";
|
|
1309
1381
|
resume: "resume";
|
|
1310
1382
|
sdk: "sdk";
|
|
1311
1383
|
turn: "turn";
|
|
@@ -1374,6 +1446,8 @@ export declare const SCHEMAS: {
|
|
|
1374
1446
|
limited_by: z.ZodOptional<z.ZodString>;
|
|
1375
1447
|
}, z.core.$strip>>;
|
|
1376
1448
|
}, z.core.$strip>>;
|
|
1449
|
+
ask: z.ZodOptional<z.ZodBoolean>;
|
|
1450
|
+
handoff: z.ZodOptional<z.ZodBoolean>;
|
|
1377
1451
|
}, z.core.$strip>;
|
|
1378
1452
|
};
|
|
1379
1453
|
//# sourceMappingURL=v1.d.ts.map
|
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,YACtB,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,QAAQ,CACA,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,
|
|
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,YACtB,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB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;;;;;;;;;;;;;;;;;;aACZ,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;aACP,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aACjB,eAAe;;;;;;;;aACf,aAAa;;;;;;;;;;;;aACb,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aACd,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aACb,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aACd,sBAAsB;;;;;;;aACtB,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAChB,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACP,CAAC"}
|
package/dist/schema.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// sessionpipe-core 0.
|
|
1
|
+
// sessionpipe-core 0.13.0 · Apache-2.0 · https://sessionpipe.org
|
|
2
2
|
|
|
3
3
|
// schema/v1.ts
|
|
4
4
|
import { z } from "zod";
|
|
@@ -23,6 +23,8 @@ var KNOWN_TYPES = [
|
|
|
23
23
|
"subagent.ended",
|
|
24
24
|
"context.compacted",
|
|
25
25
|
"limits.observed",
|
|
26
|
+
"delegation.started",
|
|
27
|
+
"delegation.ended",
|
|
26
28
|
"native"
|
|
27
29
|
];
|
|
28
30
|
var TYPE_TIER = {
|
|
@@ -44,6 +46,8 @@ var TYPE_TIER = {
|
|
|
44
46
|
"subagent.ended": 1,
|
|
45
47
|
"context.compacted": 1,
|
|
46
48
|
"limits.observed": 1,
|
|
49
|
+
"delegation.started": 0,
|
|
50
|
+
"delegation.ended": 0,
|
|
47
51
|
native: 3
|
|
48
52
|
};
|
|
49
53
|
var HARNESS_NAMES = [
|
|
@@ -92,7 +96,12 @@ var Session = z.object({
|
|
|
92
96
|
/** `<harness>:<id>` of the session that started this one on purpose (a script running
|
|
93
97
|
* `claude -p` for it), from the launcher's environment. Absent for a subagent, whose
|
|
94
98
|
* launcher is its parent, and when nothing says. */
|
|
95
|
-
launched_by: z.string().regex(/^[a-z][a-z0-9-]{0,39}:[A-Za-z0-9._:-]{1,128}$/).optional()
|
|
99
|
+
launched_by: z.string().regex(/^[a-z][a-z0-9-]{0,39}:[A-Za-z0-9._:-]{1,128}$/).optional(),
|
|
100
|
+
/** `<harness>:<id>` of the session this one answers: the machine's daemon started or
|
|
101
|
+
* resumed it for that session's ask, or for a handoff (CONTROL.md §6, §13), and the
|
|
102
|
+
* child's environment says so. On every event of the child. Lineage across
|
|
103
|
+
* harnesses, as `parent_id` is within one; never authority, never a subagent. */
|
|
104
|
+
delegated_by: z.string().regex(/^[a-z][a-z0-9-]{0,39}:[A-Za-z0-9._:-]{1,128}$/).optional()
|
|
96
105
|
});
|
|
97
106
|
var Privacy = z.object({
|
|
98
107
|
/** The redaction rulesets that ran; `secrets@1` always above tier 0. */
|
|
@@ -134,7 +143,9 @@ var EventData = z.object({
|
|
|
134
143
|
* tier 0 is not redacted, so the shape is the only guard. */
|
|
135
144
|
submitted_by: z.string().regex(/^[A-Za-z0-9][A-Za-z0-9_.-]{0,39}$/, "a bare word, at most 40 characters").optional(),
|
|
136
145
|
/** True when the prompt text is a block the harness wrote rather than words a person
|
|
137
|
-
* typed; never a claim that no person caused the turn.
|
|
146
|
+
* typed; never a claim that no person caused the turn. `injected` on
|
|
147
|
+
* turn.transcript says the same of a turn's ask, for the other way an ask arrives
|
|
148
|
+
* from somewhere other than this session's own keyboard (CONTROL.md §6.3). */
|
|
138
149
|
injected: z.boolean().optional()
|
|
139
150
|
}),
|
|
140
151
|
"turn.ended": Loose.extend({
|
|
@@ -150,7 +161,14 @@ var EventData = z.object({
|
|
|
150
161
|
turn: z.int().min(0),
|
|
151
162
|
user: z.string().max(2e4),
|
|
152
163
|
assistant: z.string().max(2e4),
|
|
153
|
-
at: Rfc3339
|
|
164
|
+
at: Rfc3339,
|
|
165
|
+
/** The ask reached the session from somewhere other than its own keyboard: another
|
|
166
|
+
* local session handed it over or a channel pushed it, the two ways a control
|
|
167
|
+
* daemon reaches a session in place (CONTROL.md §6.3, §8). The words are the
|
|
168
|
+
* person's; the arrival was not. Absent means a turn asked for where the session
|
|
169
|
+
* runs. Like turn.started's `injected`, and never a claim that no person is behind
|
|
170
|
+
* the ask. */
|
|
171
|
+
injected: z.literal(true).optional()
|
|
154
172
|
}),
|
|
155
173
|
/** The turn still running: its prompt and what the assistant has said so far. A
|
|
156
174
|
* later turn.progress for the same turn replaces it; the turn.transcript with the
|
|
@@ -159,7 +177,11 @@ var EventData = z.object({
|
|
|
159
177
|
turn: z.int().min(0),
|
|
160
178
|
user: z.string().max(2e4),
|
|
161
179
|
assistant: z.string().max(2e4),
|
|
162
|
-
at: Rfc3339
|
|
180
|
+
at: Rfc3339,
|
|
181
|
+
/** As on turn.transcript: the ask reached the session from somewhere other than its
|
|
182
|
+
* own keyboard. A running turn says it too, or a board would show the person's
|
|
183
|
+
* relayed words as typed there until the turn ends. */
|
|
184
|
+
injected: z.literal(true).optional()
|
|
163
185
|
}),
|
|
164
186
|
"tool.started": Loose.extend({
|
|
165
187
|
tool: ToolName,
|
|
@@ -207,6 +229,32 @@ var EventData = z.object({
|
|
|
207
229
|
* session was served by another account than its own (the pool, CONTROL.md §2). */
|
|
208
230
|
account_id: z.string().max(128).optional()
|
|
209
231
|
}),
|
|
232
|
+
/** The daemon on this machine took an ask from this session (CONTROL.md §13), or a
|
|
233
|
+
* command with `reply_to` naming it (§6). On the asking session, with its own seq. */
|
|
234
|
+
"delegation.started": Loose.extend({
|
|
235
|
+
ask_id: Ulid,
|
|
236
|
+
via: z.enum(["ask", "handoff"]),
|
|
237
|
+
/** The agent asked. */
|
|
238
|
+
harness: z.string().regex(/^[a-z][a-z0-9-]{0,39}$/),
|
|
239
|
+
/** The session that answers, once known: at once for a handoff or an ask to an
|
|
240
|
+
* existing session; for a new session, when the harness reveals its id. */
|
|
241
|
+
to: z.string().regex(/^[a-z][a-z0-9-]{0,39}:[A-Za-z0-9._:-]{1,128}$/).optional(),
|
|
242
|
+
/** Tier 1: what was asked, cut to 200 characters, redacted. */
|
|
243
|
+
text: z.string().max(200).optional()
|
|
244
|
+
}),
|
|
245
|
+
/** The asked agent's turn ended, or the ask failed before one. */
|
|
246
|
+
"delegation.ended": Loose.extend({
|
|
247
|
+
ask_id: Ulid,
|
|
248
|
+
to: z.string().regex(/^[a-z][a-z0-9-]{0,39}:[A-Za-z0-9._:-]{1,128}$/).optional(),
|
|
249
|
+
ok: z.boolean(),
|
|
250
|
+
ms: z.int().min(0),
|
|
251
|
+
/** When not ok: why, in at most 200 characters. */
|
|
252
|
+
error: z.string().max(200).optional(),
|
|
253
|
+
/** A handoff only: whether the answer reached `reply_to`. */
|
|
254
|
+
relayed: z.enum(["delivered", "unsupported", "failed"]).optional(),
|
|
255
|
+
/** Tier 2: the answer, redacted. */
|
|
256
|
+
reply: z.string().max(2e4).optional()
|
|
257
|
+
}),
|
|
210
258
|
native: Loose
|
|
211
259
|
});
|
|
212
260
|
var Batch = z.object({ events: z.array(Event).min(1).max(50) });
|
|
@@ -239,7 +287,7 @@ var PoolAction = z.enum([
|
|
|
239
287
|
]);
|
|
240
288
|
var PoolAccountId = z.string().regex(/^[A-Za-z0-9._:-]{1,128}$/, "an account id");
|
|
241
289
|
var KeyTypes = z.array(z.enum(["passkey", "device"])).min(1).max(2);
|
|
242
|
-
var DeliveryMode = z.enum(["sdk", "waiter", "turn", "api", "resume", "fork"]);
|
|
290
|
+
var DeliveryMode = z.enum(["sdk", "waiter", "turn", "inbox", "api", "resume", "fork"]);
|
|
243
291
|
var StartPermission = z.enum(["read", "safe", "edits", "auto"]);
|
|
244
292
|
var RunLevel = z.enum(["read", "safe", "edits", "auto", "inherit"]);
|
|
245
293
|
var ModelId = z.string().min(1).max(100).regex(/^[A-Za-z0-9][A-Za-z0-9._:/@[\]-]*$/, "a model id");
|
|
@@ -299,6 +347,10 @@ var ControlCommand = z.object({
|
|
|
299
347
|
pool_order: z.array(PoolAccountId).min(1).max(20).meta({ uniqueItems: true }).optional(),
|
|
300
348
|
/** login.complete: what the person pasted back from the sign-in page (`code#state`). */
|
|
301
349
|
pool_code: z.string().min(1).max(512).regex(/^[^\r\n]+$/, "one line").optional(),
|
|
350
|
+
/** start, prompt: a session on the same machine that gets the answer as a message
|
|
351
|
+
* once the command's turn ends (CONTROL.md §6, a handoff). Never the command's own
|
|
352
|
+
* session. Send it only to a machine whose hello says `handoff`. */
|
|
353
|
+
reply_to: SessionRef.optional(),
|
|
302
354
|
/** At least 16 random bytes, base64url. */
|
|
303
355
|
nonce: z.string().regex(/^[A-Za-z0-9_-]{22,64}$/),
|
|
304
356
|
/** Epoch ms, the signing device's clock. */
|
|
@@ -375,9 +427,14 @@ var ControlAck = z.object({
|
|
|
375
427
|
mode: DeliveryMode.optional(),
|
|
376
428
|
/** The session that took it, when not the one named (a fork's copy, a started session). */
|
|
377
429
|
session: SessionRef.optional(),
|
|
378
|
-
/**
|
|
430
|
+
/** The answer came from a COPY of the session the command named, which this
|
|
431
|
+
* names: the person is owed the fact that their words went somewhere else. */
|
|
432
|
+
copy_of: SessionRef.optional(),
|
|
433
|
+
/** refused: the verifier's code, or the machine's own (`folder`, `no_attention`, `busy`,
|
|
434
|
+
* `ambiguous_home` when one session id is filed in several of the harness's accounts);
|
|
379
435
|
* failed: `file` when a start's attachment couldn't be fetched, checked or written,
|
|
380
|
-
* `model` when the harness wouldn't run the start's model
|
|
436
|
+
* `model` when the harness wouldn't run the start's model, `held` when a message was
|
|
437
|
+
* written into a live session's own inbox and that session didn't take it (§6.3). */
|
|
381
438
|
code: z.string().regex(/^[a-z_]{1,40}$/).optional(),
|
|
382
439
|
detail: z.string().max(500).optional(),
|
|
383
440
|
/** resume / fork / start: the agent's reply, redacted by the secrets ruleset. */
|
|
@@ -422,7 +479,13 @@ var ControlPairStart = z.object({
|
|
|
422
479
|
files: z.boolean().optional(),
|
|
423
480
|
/** The kinds of key this machine takes (unique; absent means `["passkey"]`). A
|
|
424
481
|
* client offers a device key only to a machine that lists `device`. */
|
|
425
|
-
key_types: KeyTypes.optional()
|
|
482
|
+
key_types: KeyTypes.optional(),
|
|
483
|
+
/** Sessions on this machine may ask another agent through its daemon (CONTROL.md
|
|
484
|
+
* §13). Informational: a receiver can neither start an ask nor switch it. */
|
|
485
|
+
ask: z.boolean().optional(),
|
|
486
|
+
/** The machine takes `reply_to` on a prompt or a start (CONTROL.md §6). One that
|
|
487
|
+
* doesn't say so refuses it: a receiver SHOULD NOT send it one. */
|
|
488
|
+
handoff: z.boolean().optional()
|
|
426
489
|
});
|
|
427
490
|
var ControlPairStarted = z.object({
|
|
428
491
|
machine: MachineId,
|
|
@@ -514,7 +577,11 @@ var ControlHello = z.object({
|
|
|
514
577
|
key_types: KeyTypes.optional(),
|
|
515
578
|
/** The machine's account pool, when its daemon has one; sent again the moment the
|
|
516
579
|
* pool changes. A hello without it is a daemon that predates the pool. */
|
|
517
|
-
pool: ControlHelloPool.optional()
|
|
580
|
+
pool: ControlHelloPool.optional(),
|
|
581
|
+
/** As in control-pair.json; read again for every hello, so `sessionpipe ask off` shows. */
|
|
582
|
+
ask: z.boolean().optional(),
|
|
583
|
+
/** As in control-pair.json. */
|
|
584
|
+
handoff: z.boolean().optional()
|
|
518
585
|
});
|
|
519
586
|
var WellKnown = z.object({
|
|
520
587
|
protocol: z.array(z.int().min(1)).min(1),
|