sessionpipe-core 0.11.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 +357 -116
- package/dist/index.js.map +4 -4
- package/dist/schema/v1.d.ts +77 -1
- package/dist/schema/v1.d.ts.map +1 -1
- package/dist/schema.js +83 -11
- 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/claude-code.d.ts +6 -0
- package/dist/src/adapters/claude-code.d.ts.map +1 -1
- package/dist/src/adapters/codex-control.d.ts.map +1 -1
- package/dist/src/adapters/gemini-cli.d.ts +3 -2
- package/dist/src/adapters/gemini-cli.d.ts.map +1 -1
- package/dist/src/adapters/headless.d.ts +26 -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;
|
|
@@ -196,6 +200,7 @@ export declare const EventData: z.ZodObject<{
|
|
|
196
200
|
"subagent.ended": z.ZodObject<{
|
|
197
201
|
agent_id: z.ZodString;
|
|
198
202
|
agent_type: z.ZodOptional<z.ZodString>;
|
|
203
|
+
background: z.ZodOptional<z.ZodInt>;
|
|
199
204
|
}, z.core.$loose>;
|
|
200
205
|
"context.compacted": z.ZodObject<{
|
|
201
206
|
trigger: z.ZodEnum<{
|
|
@@ -213,6 +218,29 @@ export declare const EventData: z.ZodObject<{
|
|
|
213
218
|
plan: z.ZodOptional<z.ZodString>;
|
|
214
219
|
account_id: z.ZodOptional<z.ZodString>;
|
|
215
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>;
|
|
216
244
|
native: z.ZodObject<{}, z.core.$loose>;
|
|
217
245
|
}, z.core.$strip>;
|
|
218
246
|
export declare const Batch: z.ZodObject<{
|
|
@@ -246,6 +274,7 @@ export declare const Batch: z.ZodObject<{
|
|
|
246
274
|
attended: z.ZodOptional<z.ZodBoolean>;
|
|
247
275
|
parent_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
248
276
|
launched_by: z.ZodOptional<z.ZodString>;
|
|
277
|
+
delegated_by: z.ZodOptional<z.ZodString>;
|
|
249
278
|
}, z.core.$strip>;
|
|
250
279
|
privacy: z.ZodObject<{
|
|
251
280
|
rulesets: z.ZodArray<z.ZodString>;
|
|
@@ -309,6 +338,7 @@ export declare const KeyTypes: z.ZodArray<z.ZodEnum<{
|
|
|
309
338
|
export declare const DeliveryMode: z.ZodEnum<{
|
|
310
339
|
api: "api";
|
|
311
340
|
fork: "fork";
|
|
341
|
+
inbox: "inbox";
|
|
312
342
|
resume: "resume";
|
|
313
343
|
sdk: "sdk";
|
|
314
344
|
turn: "turn";
|
|
@@ -407,6 +437,7 @@ export declare const ControlCommand: z.ZodObject<{
|
|
|
407
437
|
pool_account: z.ZodOptional<z.ZodString>;
|
|
408
438
|
pool_order: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
409
439
|
pool_code: z.ZodOptional<z.ZodString>;
|
|
440
|
+
reply_to: z.ZodOptional<z.ZodString>;
|
|
410
441
|
nonce: z.ZodString;
|
|
411
442
|
iat: z.ZodInt;
|
|
412
443
|
}, z.core.$strip>;
|
|
@@ -536,12 +567,14 @@ export declare const ControlAck: z.ZodObject<{
|
|
|
536
567
|
mode: z.ZodOptional<z.ZodEnum<{
|
|
537
568
|
api: "api";
|
|
538
569
|
fork: "fork";
|
|
570
|
+
inbox: "inbox";
|
|
539
571
|
resume: "resume";
|
|
540
572
|
sdk: "sdk";
|
|
541
573
|
turn: "turn";
|
|
542
574
|
waiter: "waiter";
|
|
543
575
|
}>>;
|
|
544
576
|
session: z.ZodOptional<z.ZodString>;
|
|
577
|
+
copy_of: z.ZodOptional<z.ZodString>;
|
|
545
578
|
code: z.ZodOptional<z.ZodString>;
|
|
546
579
|
detail: z.ZodOptional<z.ZodString>;
|
|
547
580
|
reply: z.ZodOptional<z.ZodString>;
|
|
@@ -578,6 +611,7 @@ export declare const ControlPairStart: z.ZodObject<{
|
|
|
578
611
|
modes: z.ZodArray<z.ZodEnum<{
|
|
579
612
|
api: "api";
|
|
580
613
|
fork: "fork";
|
|
614
|
+
inbox: "inbox";
|
|
581
615
|
resume: "resume";
|
|
582
616
|
sdk: "sdk";
|
|
583
617
|
turn: "turn";
|
|
@@ -601,6 +635,8 @@ export declare const ControlPairStart: z.ZodObject<{
|
|
|
601
635
|
device: "device";
|
|
602
636
|
passkey: "passkey";
|
|
603
637
|
}>>>;
|
|
638
|
+
ask: z.ZodOptional<z.ZodBoolean>;
|
|
639
|
+
handoff: z.ZodOptional<z.ZodBoolean>;
|
|
604
640
|
}, z.core.$strip>;
|
|
605
641
|
/** The receiver's answer: where the person confirms, and the digits both screens show. */
|
|
606
642
|
export declare const ControlPairStarted: z.ZodObject<{
|
|
@@ -702,6 +738,7 @@ export declare const ControlHello: z.ZodObject<{
|
|
|
702
738
|
modes: z.ZodArray<z.ZodEnum<{
|
|
703
739
|
api: "api";
|
|
704
740
|
fork: "fork";
|
|
741
|
+
inbox: "inbox";
|
|
705
742
|
resume: "resume";
|
|
706
743
|
sdk: "sdk";
|
|
707
744
|
turn: "turn";
|
|
@@ -770,6 +807,8 @@ export declare const ControlHello: z.ZodObject<{
|
|
|
770
807
|
limited_by: z.ZodOptional<z.ZodString>;
|
|
771
808
|
}, z.core.$strip>>;
|
|
772
809
|
}, z.core.$strip>>;
|
|
810
|
+
ask: z.ZodOptional<z.ZodBoolean>;
|
|
811
|
+
handoff: z.ZodOptional<z.ZodBoolean>;
|
|
773
812
|
}, z.core.$strip>;
|
|
774
813
|
export declare const WellKnown: z.ZodObject<{
|
|
775
814
|
protocol: z.ZodArray<z.ZodInt>;
|
|
@@ -835,6 +874,7 @@ export declare const SCHEMAS: {
|
|
|
835
874
|
attended: z.ZodOptional<z.ZodBoolean>;
|
|
836
875
|
parent_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
837
876
|
launched_by: z.ZodOptional<z.ZodString>;
|
|
877
|
+
delegated_by: z.ZodOptional<z.ZodString>;
|
|
838
878
|
}, z.core.$strip>;
|
|
839
879
|
privacy: z.ZodObject<{
|
|
840
880
|
rulesets: z.ZodArray<z.ZodString>;
|
|
@@ -890,12 +930,14 @@ export declare const SCHEMAS: {
|
|
|
890
930
|
user: z.ZodString;
|
|
891
931
|
assistant: z.ZodString;
|
|
892
932
|
at: z.ZodISODateTime;
|
|
933
|
+
injected: z.ZodOptional<z.ZodLiteral<true>>;
|
|
893
934
|
}, z.core.$loose>;
|
|
894
935
|
"turn.progress": z.ZodObject<{
|
|
895
936
|
turn: z.ZodInt;
|
|
896
937
|
user: z.ZodString;
|
|
897
938
|
assistant: z.ZodString;
|
|
898
939
|
at: z.ZodISODateTime;
|
|
940
|
+
injected: z.ZodOptional<z.ZodLiteral<true>>;
|
|
899
941
|
}, z.core.$loose>;
|
|
900
942
|
"tool.started": z.ZodObject<{
|
|
901
943
|
tool: z.ZodString;
|
|
@@ -946,6 +988,7 @@ export declare const SCHEMAS: {
|
|
|
946
988
|
"subagent.ended": z.ZodObject<{
|
|
947
989
|
agent_id: z.ZodString;
|
|
948
990
|
agent_type: z.ZodOptional<z.ZodString>;
|
|
991
|
+
background: z.ZodOptional<z.ZodInt>;
|
|
949
992
|
}, z.core.$loose>;
|
|
950
993
|
"context.compacted": z.ZodObject<{
|
|
951
994
|
trigger: z.ZodEnum<{
|
|
@@ -963,6 +1006,29 @@ export declare const SCHEMAS: {
|
|
|
963
1006
|
plan: z.ZodOptional<z.ZodString>;
|
|
964
1007
|
account_id: z.ZodOptional<z.ZodString>;
|
|
965
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>;
|
|
966
1032
|
native: z.ZodObject<{}, z.core.$loose>;
|
|
967
1033
|
}, z.core.$strip>;
|
|
968
1034
|
readonly batch: z.ZodObject<{
|
|
@@ -996,6 +1062,7 @@ export declare const SCHEMAS: {
|
|
|
996
1062
|
attended: z.ZodOptional<z.ZodBoolean>;
|
|
997
1063
|
parent_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
998
1064
|
launched_by: z.ZodOptional<z.ZodString>;
|
|
1065
|
+
delegated_by: z.ZodOptional<z.ZodString>;
|
|
999
1066
|
}, z.core.$strip>;
|
|
1000
1067
|
privacy: z.ZodObject<{
|
|
1001
1068
|
rulesets: z.ZodArray<z.ZodString>;
|
|
@@ -1138,6 +1205,7 @@ export declare const SCHEMAS: {
|
|
|
1138
1205
|
pool_account: z.ZodOptional<z.ZodString>;
|
|
1139
1206
|
pool_order: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1140
1207
|
pool_code: z.ZodOptional<z.ZodString>;
|
|
1208
|
+
reply_to: z.ZodOptional<z.ZodString>;
|
|
1141
1209
|
nonce: z.ZodString;
|
|
1142
1210
|
iat: z.ZodInt;
|
|
1143
1211
|
}, z.core.$strip>;
|
|
@@ -1206,12 +1274,14 @@ export declare const SCHEMAS: {
|
|
|
1206
1274
|
mode: z.ZodOptional<z.ZodEnum<{
|
|
1207
1275
|
api: "api";
|
|
1208
1276
|
fork: "fork";
|
|
1277
|
+
inbox: "inbox";
|
|
1209
1278
|
resume: "resume";
|
|
1210
1279
|
sdk: "sdk";
|
|
1211
1280
|
turn: "turn";
|
|
1212
1281
|
waiter: "waiter";
|
|
1213
1282
|
}>>;
|
|
1214
1283
|
session: z.ZodOptional<z.ZodString>;
|
|
1284
|
+
copy_of: z.ZodOptional<z.ZodString>;
|
|
1215
1285
|
code: z.ZodOptional<z.ZodString>;
|
|
1216
1286
|
detail: z.ZodOptional<z.ZodString>;
|
|
1217
1287
|
reply: z.ZodOptional<z.ZodString>;
|
|
@@ -1236,6 +1306,7 @@ export declare const SCHEMAS: {
|
|
|
1236
1306
|
modes: z.ZodArray<z.ZodEnum<{
|
|
1237
1307
|
api: "api";
|
|
1238
1308
|
fork: "fork";
|
|
1309
|
+
inbox: "inbox";
|
|
1239
1310
|
resume: "resume";
|
|
1240
1311
|
sdk: "sdk";
|
|
1241
1312
|
turn: "turn";
|
|
@@ -1259,6 +1330,8 @@ export declare const SCHEMAS: {
|
|
|
1259
1330
|
device: "device";
|
|
1260
1331
|
passkey: "passkey";
|
|
1261
1332
|
}>>>;
|
|
1333
|
+
ask: z.ZodOptional<z.ZodBoolean>;
|
|
1334
|
+
handoff: z.ZodOptional<z.ZodBoolean>;
|
|
1262
1335
|
}, z.core.$strip>;
|
|
1263
1336
|
readonly "control-pair-started": z.ZodObject<{
|
|
1264
1337
|
machine: z.ZodString;
|
|
@@ -1304,6 +1377,7 @@ export declare const SCHEMAS: {
|
|
|
1304
1377
|
modes: z.ZodArray<z.ZodEnum<{
|
|
1305
1378
|
api: "api";
|
|
1306
1379
|
fork: "fork";
|
|
1380
|
+
inbox: "inbox";
|
|
1307
1381
|
resume: "resume";
|
|
1308
1382
|
sdk: "sdk";
|
|
1309
1383
|
turn: "turn";
|
|
@@ -1372,6 +1446,8 @@ export declare const SCHEMAS: {
|
|
|
1372
1446
|
limited_by: z.ZodOptional<z.ZodString>;
|
|
1373
1447
|
}, z.core.$strip>>;
|
|
1374
1448
|
}, z.core.$strip>>;
|
|
1449
|
+
ask: z.ZodOptional<z.ZodBoolean>;
|
|
1450
|
+
handoff: z.ZodOptional<z.ZodBoolean>;
|
|
1375
1451
|
}, z.core.$strip>;
|
|
1376
1452
|
};
|
|
1377
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,m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;;;;;;;;;;;;;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,
|
|
@@ -192,7 +214,12 @@ var EventData = z.object({
|
|
|
192
214
|
how: z.enum(["answered", "cancelled", "timeout", "unknown"])
|
|
193
215
|
}),
|
|
194
216
|
"subagent.started": Loose.extend({ agent_id: z.string().max(128), agent_type: z.string().max(128).optional() }),
|
|
195
|
-
"subagent.ended": Loose.extend({
|
|
217
|
+
"subagent.ended": Loose.extend({
|
|
218
|
+
agent_id: z.string().max(128),
|
|
219
|
+
agent_type: z.string().max(128).optional(),
|
|
220
|
+
/** Background work still in flight once this subagent is out of it, counted as `turn.ended.background` is. Absent when the harness doesn't say. */
|
|
221
|
+
background: z.int().min(0).optional()
|
|
222
|
+
}),
|
|
196
223
|
"context.compacted": Loose.extend({ trigger: z.enum(["manual", "auto"]) }),
|
|
197
224
|
/** The account's usage limits as the harness last reported them: one per window. */
|
|
198
225
|
"limits.observed": Loose.extend({
|
|
@@ -202,6 +229,32 @@ var EventData = z.object({
|
|
|
202
229
|
* session was served by another account than its own (the pool, CONTROL.md §2). */
|
|
203
230
|
account_id: z.string().max(128).optional()
|
|
204
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
|
+
}),
|
|
205
258
|
native: Loose
|
|
206
259
|
});
|
|
207
260
|
var Batch = z.object({ events: z.array(Event).min(1).max(50) });
|
|
@@ -234,7 +287,7 @@ var PoolAction = z.enum([
|
|
|
234
287
|
]);
|
|
235
288
|
var PoolAccountId = z.string().regex(/^[A-Za-z0-9._:-]{1,128}$/, "an account id");
|
|
236
289
|
var KeyTypes = z.array(z.enum(["passkey", "device"])).min(1).max(2);
|
|
237
|
-
var DeliveryMode = z.enum(["sdk", "waiter", "turn", "api", "resume", "fork"]);
|
|
290
|
+
var DeliveryMode = z.enum(["sdk", "waiter", "turn", "inbox", "api", "resume", "fork"]);
|
|
238
291
|
var StartPermission = z.enum(["read", "safe", "edits", "auto"]);
|
|
239
292
|
var RunLevel = z.enum(["read", "safe", "edits", "auto", "inherit"]);
|
|
240
293
|
var ModelId = z.string().min(1).max(100).regex(/^[A-Za-z0-9][A-Za-z0-9._:/@[\]-]*$/, "a model id");
|
|
@@ -294,6 +347,10 @@ var ControlCommand = z.object({
|
|
|
294
347
|
pool_order: z.array(PoolAccountId).min(1).max(20).meta({ uniqueItems: true }).optional(),
|
|
295
348
|
/** login.complete: what the person pasted back from the sign-in page (`code#state`). */
|
|
296
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(),
|
|
297
354
|
/** At least 16 random bytes, base64url. */
|
|
298
355
|
nonce: z.string().regex(/^[A-Za-z0-9_-]{22,64}$/),
|
|
299
356
|
/** Epoch ms, the signing device's clock. */
|
|
@@ -370,9 +427,14 @@ var ControlAck = z.object({
|
|
|
370
427
|
mode: DeliveryMode.optional(),
|
|
371
428
|
/** The session that took it, when not the one named (a fork's copy, a started session). */
|
|
372
429
|
session: SessionRef.optional(),
|
|
373
|
-
/**
|
|
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);
|
|
374
435
|
* failed: `file` when a start's attachment couldn't be fetched, checked or written,
|
|
375
|
-
* `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). */
|
|
376
438
|
code: z.string().regex(/^[a-z_]{1,40}$/).optional(),
|
|
377
439
|
detail: z.string().max(500).optional(),
|
|
378
440
|
/** resume / fork / start: the agent's reply, redacted by the secrets ruleset. */
|
|
@@ -417,7 +479,13 @@ var ControlPairStart = z.object({
|
|
|
417
479
|
files: z.boolean().optional(),
|
|
418
480
|
/** The kinds of key this machine takes (unique; absent means `["passkey"]`). A
|
|
419
481
|
* client offers a device key only to a machine that lists `device`. */
|
|
420
|
-
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()
|
|
421
489
|
});
|
|
422
490
|
var ControlPairStarted = z.object({
|
|
423
491
|
machine: MachineId,
|
|
@@ -509,7 +577,11 @@ var ControlHello = z.object({
|
|
|
509
577
|
key_types: KeyTypes.optional(),
|
|
510
578
|
/** The machine's account pool, when its daemon has one; sent again the moment the
|
|
511
579
|
* pool changes. A hello without it is a daemon that predates the pool. */
|
|
512
|
-
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()
|
|
513
585
|
});
|
|
514
586
|
var WellKnown = z.object({
|
|
515
587
|
protocol: z.array(z.int().min(1)).min(1),
|