sessionpipe-core 0.12.0 → 0.13.1
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 +550 -175
- package/dist/index.js.map +4 -4
- package/dist/schema/v1.d.ts +87 -1
- package/dist/schema/v1.d.ts.map +1 -1
- package/dist/schema.js +86 -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/antigravity.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.map +1 -1
- package/dist/src/adapters/claude-shaped.d.ts +10 -0
- package/dist/src/adapters/claude-shaped.d.ts.map +1 -1
- package/dist/src/adapters/codex.d.ts.map +1 -1
- package/dist/src/adapters/devin.d.ts +1 -1
- package/dist/src/adapters/devin.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 +8 -1
- package/dist/src/adapters/types.d.ts.map +1 -1
- package/dist/src/config.d.ts +15 -1
- package/dist/src/config.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 +4 -4
- 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/outbox.d.ts +35 -2
- package/dist/src/outbox.d.ts.map +1 -1
- package/dist/src/privacy/filter.d.ts.map +1 -1
- package/dist/src/privacy/pii.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;
|
|
@@ -179,6 +183,7 @@ export declare const EventData: z.ZodObject<{
|
|
|
179
183
|
}>;
|
|
180
184
|
tool: z.ZodOptional<z.ZodString>;
|
|
181
185
|
message: z.ZodOptional<z.ZodString>;
|
|
186
|
+
agent_id: z.ZodOptional<z.ZodString>;
|
|
182
187
|
}, z.core.$loose>;
|
|
183
188
|
"attention.cleared": z.ZodObject<{
|
|
184
189
|
attention_id: z.ZodString;
|
|
@@ -214,6 +219,29 @@ export declare const EventData: z.ZodObject<{
|
|
|
214
219
|
plan: z.ZodOptional<z.ZodString>;
|
|
215
220
|
account_id: z.ZodOptional<z.ZodString>;
|
|
216
221
|
}, z.core.$loose>;
|
|
222
|
+
"delegation.started": z.ZodObject<{
|
|
223
|
+
ask_id: z.ZodString;
|
|
224
|
+
via: z.ZodEnum<{
|
|
225
|
+
ask: "ask";
|
|
226
|
+
handoff: "handoff";
|
|
227
|
+
}>;
|
|
228
|
+
harness: z.ZodString;
|
|
229
|
+
to: z.ZodOptional<z.ZodString>;
|
|
230
|
+
text: z.ZodOptional<z.ZodString>;
|
|
231
|
+
}, z.core.$loose>;
|
|
232
|
+
"delegation.ended": z.ZodObject<{
|
|
233
|
+
ask_id: z.ZodString;
|
|
234
|
+
to: z.ZodOptional<z.ZodString>;
|
|
235
|
+
ok: z.ZodBoolean;
|
|
236
|
+
ms: z.ZodInt;
|
|
237
|
+
error: z.ZodOptional<z.ZodString>;
|
|
238
|
+
relayed: z.ZodOptional<z.ZodEnum<{
|
|
239
|
+
delivered: "delivered";
|
|
240
|
+
failed: "failed";
|
|
241
|
+
unsupported: "unsupported";
|
|
242
|
+
}>>;
|
|
243
|
+
reply: z.ZodOptional<z.ZodString>;
|
|
244
|
+
}, z.core.$loose>;
|
|
217
245
|
native: z.ZodObject<{}, z.core.$loose>;
|
|
218
246
|
}, z.core.$strip>;
|
|
219
247
|
export declare const Batch: z.ZodObject<{
|
|
@@ -247,6 +275,7 @@ export declare const Batch: z.ZodObject<{
|
|
|
247
275
|
attended: z.ZodOptional<z.ZodBoolean>;
|
|
248
276
|
parent_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
249
277
|
launched_by: z.ZodOptional<z.ZodString>;
|
|
278
|
+
delegated_by: z.ZodOptional<z.ZodString>;
|
|
250
279
|
}, z.core.$strip>;
|
|
251
280
|
privacy: z.ZodObject<{
|
|
252
281
|
rulesets: z.ZodArray<z.ZodString>;
|
|
@@ -310,6 +339,7 @@ export declare const KeyTypes: z.ZodArray<z.ZodEnum<{
|
|
|
310
339
|
export declare const DeliveryMode: z.ZodEnum<{
|
|
311
340
|
api: "api";
|
|
312
341
|
fork: "fork";
|
|
342
|
+
inbox: "inbox";
|
|
313
343
|
resume: "resume";
|
|
314
344
|
sdk: "sdk";
|
|
315
345
|
turn: "turn";
|
|
@@ -408,6 +438,7 @@ export declare const ControlCommand: z.ZodObject<{
|
|
|
408
438
|
pool_account: z.ZodOptional<z.ZodString>;
|
|
409
439
|
pool_order: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
410
440
|
pool_code: z.ZodOptional<z.ZodString>;
|
|
441
|
+
reply_to: z.ZodOptional<z.ZodString>;
|
|
411
442
|
nonce: z.ZodString;
|
|
412
443
|
iat: z.ZodInt;
|
|
413
444
|
}, z.core.$strip>;
|
|
@@ -537,12 +568,14 @@ export declare const ControlAck: z.ZodObject<{
|
|
|
537
568
|
mode: z.ZodOptional<z.ZodEnum<{
|
|
538
569
|
api: "api";
|
|
539
570
|
fork: "fork";
|
|
571
|
+
inbox: "inbox";
|
|
540
572
|
resume: "resume";
|
|
541
573
|
sdk: "sdk";
|
|
542
574
|
turn: "turn";
|
|
543
575
|
waiter: "waiter";
|
|
544
576
|
}>>;
|
|
545
577
|
session: z.ZodOptional<z.ZodString>;
|
|
578
|
+
copy_of: z.ZodOptional<z.ZodString>;
|
|
546
579
|
code: z.ZodOptional<z.ZodString>;
|
|
547
580
|
detail: z.ZodOptional<z.ZodString>;
|
|
548
581
|
reply: z.ZodOptional<z.ZodString>;
|
|
@@ -579,6 +612,7 @@ export declare const ControlPairStart: z.ZodObject<{
|
|
|
579
612
|
modes: z.ZodArray<z.ZodEnum<{
|
|
580
613
|
api: "api";
|
|
581
614
|
fork: "fork";
|
|
615
|
+
inbox: "inbox";
|
|
582
616
|
resume: "resume";
|
|
583
617
|
sdk: "sdk";
|
|
584
618
|
turn: "turn";
|
|
@@ -602,6 +636,8 @@ export declare const ControlPairStart: z.ZodObject<{
|
|
|
602
636
|
device: "device";
|
|
603
637
|
passkey: "passkey";
|
|
604
638
|
}>>>;
|
|
639
|
+
ask: z.ZodOptional<z.ZodBoolean>;
|
|
640
|
+
handoff: z.ZodOptional<z.ZodBoolean>;
|
|
605
641
|
}, z.core.$strip>;
|
|
606
642
|
/** The receiver's answer: where the person confirms, and the digits both screens show. */
|
|
607
643
|
export declare const ControlPairStarted: z.ZodObject<{
|
|
@@ -703,6 +739,7 @@ export declare const ControlHello: z.ZodObject<{
|
|
|
703
739
|
modes: z.ZodArray<z.ZodEnum<{
|
|
704
740
|
api: "api";
|
|
705
741
|
fork: "fork";
|
|
742
|
+
inbox: "inbox";
|
|
706
743
|
resume: "resume";
|
|
707
744
|
sdk: "sdk";
|
|
708
745
|
turn: "turn";
|
|
@@ -771,6 +808,8 @@ export declare const ControlHello: z.ZodObject<{
|
|
|
771
808
|
limited_by: z.ZodOptional<z.ZodString>;
|
|
772
809
|
}, z.core.$strip>>;
|
|
773
810
|
}, z.core.$strip>>;
|
|
811
|
+
ask: z.ZodOptional<z.ZodBoolean>;
|
|
812
|
+
handoff: z.ZodOptional<z.ZodBoolean>;
|
|
774
813
|
}, z.core.$strip>;
|
|
775
814
|
export declare const WellKnown: z.ZodObject<{
|
|
776
815
|
protocol: z.ZodArray<z.ZodInt>;
|
|
@@ -788,6 +827,11 @@ export declare const WellKnown: z.ZodObject<{
|
|
|
788
827
|
max_events: z.ZodInt;
|
|
789
828
|
max_bytes: z.ZodInt;
|
|
790
829
|
}, z.core.$strip>;
|
|
830
|
+
tools: z.ZodOptional<z.ZodEnum<{
|
|
831
|
+
all: "all";
|
|
832
|
+
beat: "beat";
|
|
833
|
+
main: "main";
|
|
834
|
+
}>>;
|
|
791
835
|
control: z.ZodOptional<z.ZodObject<{
|
|
792
836
|
wait_max_s: z.ZodInt;
|
|
793
837
|
open_pairing: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -836,6 +880,7 @@ export declare const SCHEMAS: {
|
|
|
836
880
|
attended: z.ZodOptional<z.ZodBoolean>;
|
|
837
881
|
parent_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
838
882
|
launched_by: z.ZodOptional<z.ZodString>;
|
|
883
|
+
delegated_by: z.ZodOptional<z.ZodString>;
|
|
839
884
|
}, z.core.$strip>;
|
|
840
885
|
privacy: z.ZodObject<{
|
|
841
886
|
rulesets: z.ZodArray<z.ZodString>;
|
|
@@ -891,12 +936,14 @@ export declare const SCHEMAS: {
|
|
|
891
936
|
user: z.ZodString;
|
|
892
937
|
assistant: z.ZodString;
|
|
893
938
|
at: z.ZodISODateTime;
|
|
939
|
+
injected: z.ZodOptional<z.ZodLiteral<true>>;
|
|
894
940
|
}, z.core.$loose>;
|
|
895
941
|
"turn.progress": z.ZodObject<{
|
|
896
942
|
turn: z.ZodInt;
|
|
897
943
|
user: z.ZodString;
|
|
898
944
|
assistant: z.ZodString;
|
|
899
945
|
at: z.ZodISODateTime;
|
|
946
|
+
injected: z.ZodOptional<z.ZodLiteral<true>>;
|
|
900
947
|
}, z.core.$loose>;
|
|
901
948
|
"tool.started": z.ZodObject<{
|
|
902
949
|
tool: z.ZodString;
|
|
@@ -930,6 +977,7 @@ export declare const SCHEMAS: {
|
|
|
930
977
|
}>;
|
|
931
978
|
tool: z.ZodOptional<z.ZodString>;
|
|
932
979
|
message: z.ZodOptional<z.ZodString>;
|
|
980
|
+
agent_id: z.ZodOptional<z.ZodString>;
|
|
933
981
|
}, z.core.$loose>;
|
|
934
982
|
"attention.cleared": z.ZodObject<{
|
|
935
983
|
attention_id: z.ZodString;
|
|
@@ -965,6 +1013,29 @@ export declare const SCHEMAS: {
|
|
|
965
1013
|
plan: z.ZodOptional<z.ZodString>;
|
|
966
1014
|
account_id: z.ZodOptional<z.ZodString>;
|
|
967
1015
|
}, z.core.$loose>;
|
|
1016
|
+
"delegation.started": z.ZodObject<{
|
|
1017
|
+
ask_id: z.ZodString;
|
|
1018
|
+
via: z.ZodEnum<{
|
|
1019
|
+
ask: "ask";
|
|
1020
|
+
handoff: "handoff";
|
|
1021
|
+
}>;
|
|
1022
|
+
harness: z.ZodString;
|
|
1023
|
+
to: z.ZodOptional<z.ZodString>;
|
|
1024
|
+
text: z.ZodOptional<z.ZodString>;
|
|
1025
|
+
}, z.core.$loose>;
|
|
1026
|
+
"delegation.ended": z.ZodObject<{
|
|
1027
|
+
ask_id: z.ZodString;
|
|
1028
|
+
to: z.ZodOptional<z.ZodString>;
|
|
1029
|
+
ok: z.ZodBoolean;
|
|
1030
|
+
ms: z.ZodInt;
|
|
1031
|
+
error: z.ZodOptional<z.ZodString>;
|
|
1032
|
+
relayed: z.ZodOptional<z.ZodEnum<{
|
|
1033
|
+
delivered: "delivered";
|
|
1034
|
+
failed: "failed";
|
|
1035
|
+
unsupported: "unsupported";
|
|
1036
|
+
}>>;
|
|
1037
|
+
reply: z.ZodOptional<z.ZodString>;
|
|
1038
|
+
}, z.core.$loose>;
|
|
968
1039
|
native: z.ZodObject<{}, z.core.$loose>;
|
|
969
1040
|
}, z.core.$strip>;
|
|
970
1041
|
readonly batch: z.ZodObject<{
|
|
@@ -998,6 +1069,7 @@ export declare const SCHEMAS: {
|
|
|
998
1069
|
attended: z.ZodOptional<z.ZodBoolean>;
|
|
999
1070
|
parent_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1000
1071
|
launched_by: z.ZodOptional<z.ZodString>;
|
|
1072
|
+
delegated_by: z.ZodOptional<z.ZodString>;
|
|
1001
1073
|
}, z.core.$strip>;
|
|
1002
1074
|
privacy: z.ZodObject<{
|
|
1003
1075
|
rulesets: z.ZodArray<z.ZodString>;
|
|
@@ -1036,6 +1108,11 @@ export declare const SCHEMAS: {
|
|
|
1036
1108
|
max_events: z.ZodInt;
|
|
1037
1109
|
max_bytes: z.ZodInt;
|
|
1038
1110
|
}, z.core.$strip>;
|
|
1111
|
+
tools: z.ZodOptional<z.ZodEnum<{
|
|
1112
|
+
all: "all";
|
|
1113
|
+
beat: "beat";
|
|
1114
|
+
main: "main";
|
|
1115
|
+
}>>;
|
|
1039
1116
|
control: z.ZodOptional<z.ZodObject<{
|
|
1040
1117
|
wait_max_s: z.ZodInt;
|
|
1041
1118
|
open_pairing: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -1140,6 +1217,7 @@ export declare const SCHEMAS: {
|
|
|
1140
1217
|
pool_account: z.ZodOptional<z.ZodString>;
|
|
1141
1218
|
pool_order: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1142
1219
|
pool_code: z.ZodOptional<z.ZodString>;
|
|
1220
|
+
reply_to: z.ZodOptional<z.ZodString>;
|
|
1143
1221
|
nonce: z.ZodString;
|
|
1144
1222
|
iat: z.ZodInt;
|
|
1145
1223
|
}, z.core.$strip>;
|
|
@@ -1208,12 +1286,14 @@ export declare const SCHEMAS: {
|
|
|
1208
1286
|
mode: z.ZodOptional<z.ZodEnum<{
|
|
1209
1287
|
api: "api";
|
|
1210
1288
|
fork: "fork";
|
|
1289
|
+
inbox: "inbox";
|
|
1211
1290
|
resume: "resume";
|
|
1212
1291
|
sdk: "sdk";
|
|
1213
1292
|
turn: "turn";
|
|
1214
1293
|
waiter: "waiter";
|
|
1215
1294
|
}>>;
|
|
1216
1295
|
session: z.ZodOptional<z.ZodString>;
|
|
1296
|
+
copy_of: z.ZodOptional<z.ZodString>;
|
|
1217
1297
|
code: z.ZodOptional<z.ZodString>;
|
|
1218
1298
|
detail: z.ZodOptional<z.ZodString>;
|
|
1219
1299
|
reply: z.ZodOptional<z.ZodString>;
|
|
@@ -1238,6 +1318,7 @@ export declare const SCHEMAS: {
|
|
|
1238
1318
|
modes: z.ZodArray<z.ZodEnum<{
|
|
1239
1319
|
api: "api";
|
|
1240
1320
|
fork: "fork";
|
|
1321
|
+
inbox: "inbox";
|
|
1241
1322
|
resume: "resume";
|
|
1242
1323
|
sdk: "sdk";
|
|
1243
1324
|
turn: "turn";
|
|
@@ -1261,6 +1342,8 @@ export declare const SCHEMAS: {
|
|
|
1261
1342
|
device: "device";
|
|
1262
1343
|
passkey: "passkey";
|
|
1263
1344
|
}>>>;
|
|
1345
|
+
ask: z.ZodOptional<z.ZodBoolean>;
|
|
1346
|
+
handoff: z.ZodOptional<z.ZodBoolean>;
|
|
1264
1347
|
}, z.core.$strip>;
|
|
1265
1348
|
readonly "control-pair-started": z.ZodObject<{
|
|
1266
1349
|
machine: z.ZodString;
|
|
@@ -1306,6 +1389,7 @@ export declare const SCHEMAS: {
|
|
|
1306
1389
|
modes: z.ZodArray<z.ZodEnum<{
|
|
1307
1390
|
api: "api";
|
|
1308
1391
|
fork: "fork";
|
|
1392
|
+
inbox: "inbox";
|
|
1309
1393
|
resume: "resume";
|
|
1310
1394
|
sdk: "sdk";
|
|
1311
1395
|
turn: "turn";
|
|
@@ -1374,6 +1458,8 @@ export declare const SCHEMAS: {
|
|
|
1374
1458
|
limited_by: z.ZodOptional<z.ZodString>;
|
|
1375
1459
|
}, z.core.$strip>>;
|
|
1376
1460
|
}, z.core.$strip>>;
|
|
1461
|
+
ask: z.ZodOptional<z.ZodBoolean>;
|
|
1462
|
+
handoff: z.ZodOptional<z.ZodBoolean>;
|
|
1377
1463
|
}, z.core.$strip>;
|
|
1378
1464
|
};
|
|
1379
1465
|
//# 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"],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BA4CpB,CAAC;AAEH,+DAA+D;AAC/D,eAAO,MAAM,OAAO;aAClB,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aACL,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aACZ,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aACL,gBAAgB;;;;;;;;;aAChB,KAAK;;;;;aACL,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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.1 · 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,
|
|
@@ -185,7 +207,9 @@ var EventData = z.object({
|
|
|
185
207
|
attention_id: z.string().max(128),
|
|
186
208
|
kind: AttentionKind,
|
|
187
209
|
tool: ToolName.optional(),
|
|
188
|
-
message: z.string().max(200).optional()
|
|
210
|
+
message: z.string().max(200).optional(),
|
|
211
|
+
/** Set when a subagent asked. */
|
|
212
|
+
agent_id: z.string().max(128).optional()
|
|
189
213
|
}),
|
|
190
214
|
"attention.cleared": Loose.extend({
|
|
191
215
|
attention_id: z.string().max(128),
|
|
@@ -207,6 +231,32 @@ var EventData = z.object({
|
|
|
207
231
|
* session was served by another account than its own (the pool, CONTROL.md §2). */
|
|
208
232
|
account_id: z.string().max(128).optional()
|
|
209
233
|
}),
|
|
234
|
+
/** The daemon on this machine took an ask from this session (CONTROL.md §13), or a
|
|
235
|
+
* command with `reply_to` naming it (§6). On the asking session, with its own seq. */
|
|
236
|
+
"delegation.started": Loose.extend({
|
|
237
|
+
ask_id: Ulid,
|
|
238
|
+
via: z.enum(["ask", "handoff"]),
|
|
239
|
+
/** The agent asked. */
|
|
240
|
+
harness: z.string().regex(/^[a-z][a-z0-9-]{0,39}$/),
|
|
241
|
+
/** The session that answers, once known: at once for a handoff or an ask to an
|
|
242
|
+
* existing session; for a new session, when the harness reveals its id. */
|
|
243
|
+
to: z.string().regex(/^[a-z][a-z0-9-]{0,39}:[A-Za-z0-9._:-]{1,128}$/).optional(),
|
|
244
|
+
/** Tier 1: what was asked, cut to 200 characters, redacted. */
|
|
245
|
+
text: z.string().max(200).optional()
|
|
246
|
+
}),
|
|
247
|
+
/** The asked agent's turn ended, or the ask failed before one. */
|
|
248
|
+
"delegation.ended": Loose.extend({
|
|
249
|
+
ask_id: Ulid,
|
|
250
|
+
to: z.string().regex(/^[a-z][a-z0-9-]{0,39}:[A-Za-z0-9._:-]{1,128}$/).optional(),
|
|
251
|
+
ok: z.boolean(),
|
|
252
|
+
ms: z.int().min(0),
|
|
253
|
+
/** When not ok: why, in at most 200 characters. */
|
|
254
|
+
error: z.string().max(200).optional(),
|
|
255
|
+
/** A handoff only: whether the answer reached `reply_to`. */
|
|
256
|
+
relayed: z.enum(["delivered", "unsupported", "failed"]).optional(),
|
|
257
|
+
/** Tier 2: the answer, redacted. */
|
|
258
|
+
reply: z.string().max(2e4).optional()
|
|
259
|
+
}),
|
|
210
260
|
native: Loose
|
|
211
261
|
});
|
|
212
262
|
var Batch = z.object({ events: z.array(Event).min(1).max(50) });
|
|
@@ -239,7 +289,7 @@ var PoolAction = z.enum([
|
|
|
239
289
|
]);
|
|
240
290
|
var PoolAccountId = z.string().regex(/^[A-Za-z0-9._:-]{1,128}$/, "an account id");
|
|
241
291
|
var KeyTypes = z.array(z.enum(["passkey", "device"])).min(1).max(2);
|
|
242
|
-
var DeliveryMode = z.enum(["sdk", "waiter", "turn", "api", "resume", "fork"]);
|
|
292
|
+
var DeliveryMode = z.enum(["sdk", "waiter", "turn", "inbox", "api", "resume", "fork"]);
|
|
243
293
|
var StartPermission = z.enum(["read", "safe", "edits", "auto"]);
|
|
244
294
|
var RunLevel = z.enum(["read", "safe", "edits", "auto", "inherit"]);
|
|
245
295
|
var ModelId = z.string().min(1).max(100).regex(/^[A-Za-z0-9][A-Za-z0-9._:/@[\]-]*$/, "a model id");
|
|
@@ -299,6 +349,10 @@ var ControlCommand = z.object({
|
|
|
299
349
|
pool_order: z.array(PoolAccountId).min(1).max(20).meta({ uniqueItems: true }).optional(),
|
|
300
350
|
/** login.complete: what the person pasted back from the sign-in page (`code#state`). */
|
|
301
351
|
pool_code: z.string().min(1).max(512).regex(/^[^\r\n]+$/, "one line").optional(),
|
|
352
|
+
/** start, prompt: a session on the same machine that gets the answer as a message
|
|
353
|
+
* once the command's turn ends (CONTROL.md §6, a handoff). Never the command's own
|
|
354
|
+
* session. Send it only to a machine whose hello says `handoff`. */
|
|
355
|
+
reply_to: SessionRef.optional(),
|
|
302
356
|
/** At least 16 random bytes, base64url. */
|
|
303
357
|
nonce: z.string().regex(/^[A-Za-z0-9_-]{22,64}$/),
|
|
304
358
|
/** Epoch ms, the signing device's clock. */
|
|
@@ -375,9 +429,14 @@ var ControlAck = z.object({
|
|
|
375
429
|
mode: DeliveryMode.optional(),
|
|
376
430
|
/** The session that took it, when not the one named (a fork's copy, a started session). */
|
|
377
431
|
session: SessionRef.optional(),
|
|
378
|
-
/**
|
|
432
|
+
/** The answer came from a COPY of the session the command named, which this
|
|
433
|
+
* names: the person is owed the fact that their words went somewhere else. */
|
|
434
|
+
copy_of: SessionRef.optional(),
|
|
435
|
+
/** refused: the verifier's code, or the machine's own (`folder`, `no_attention`, `busy`,
|
|
436
|
+
* `ambiguous_home` when one session id is filed in several of the harness's accounts);
|
|
379
437
|
* 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
|
|
438
|
+
* `model` when the harness wouldn't run the start's model, `held` when a message was
|
|
439
|
+
* written into a live session's own inbox and that session didn't take it (§6.3). */
|
|
381
440
|
code: z.string().regex(/^[a-z_]{1,40}$/).optional(),
|
|
382
441
|
detail: z.string().max(500).optional(),
|
|
383
442
|
/** resume / fork / start: the agent's reply, redacted by the secrets ruleset. */
|
|
@@ -422,7 +481,13 @@ var ControlPairStart = z.object({
|
|
|
422
481
|
files: z.boolean().optional(),
|
|
423
482
|
/** The kinds of key this machine takes (unique; absent means `["passkey"]`). A
|
|
424
483
|
* client offers a device key only to a machine that lists `device`. */
|
|
425
|
-
key_types: KeyTypes.optional()
|
|
484
|
+
key_types: KeyTypes.optional(),
|
|
485
|
+
/** Sessions on this machine may ask another agent through its daemon (CONTROL.md
|
|
486
|
+
* §13). Informational: a receiver can neither start an ask nor switch it. */
|
|
487
|
+
ask: z.boolean().optional(),
|
|
488
|
+
/** The machine takes `reply_to` on a prompt or a start (CONTROL.md §6). One that
|
|
489
|
+
* doesn't say so refuses it: a receiver SHOULD NOT send it one. */
|
|
490
|
+
handoff: z.boolean().optional()
|
|
426
491
|
});
|
|
427
492
|
var ControlPairStarted = z.object({
|
|
428
493
|
machine: MachineId,
|
|
@@ -514,7 +579,11 @@ var ControlHello = z.object({
|
|
|
514
579
|
key_types: KeyTypes.optional(),
|
|
515
580
|
/** The machine's account pool, when its daemon has one; sent again the moment the
|
|
516
581
|
* pool changes. A hello without it is a daemon that predates the pool. */
|
|
517
|
-
pool: ControlHelloPool.optional()
|
|
582
|
+
pool: ControlHelloPool.optional(),
|
|
583
|
+
/** As in control-pair.json; read again for every hello, so `sessionpipe ask off` shows. */
|
|
584
|
+
ask: z.boolean().optional(),
|
|
585
|
+
/** As in control-pair.json. */
|
|
586
|
+
handoff: z.boolean().optional()
|
|
518
587
|
});
|
|
519
588
|
var WellKnown = z.object({
|
|
520
589
|
protocol: z.array(z.int().min(1)).min(1),
|
|
@@ -527,6 +596,12 @@ var WellKnown = z.object({
|
|
|
527
596
|
native: z.string().optional()
|
|
528
597
|
}),
|
|
529
598
|
batch: z.object({ max_events: z.int().min(1).max(50), max_bytes: z.int().min(1024).max(262144) }),
|
|
599
|
+
/** The tool events the receiver would rather be sent (PROTOCOL.md §4, *Thinned tool
|
|
600
|
+
* events*): `all`, every one (what an absent field means); `main`, a subagent's thinned
|
|
601
|
+
* to at most one `tool.ended` per session per minute; `beat`, every session's thinned
|
|
602
|
+
* so. A sender honours it unless the sink's owner chose otherwise; a sender that
|
|
603
|
+
* predates the field sends every tool event. */
|
|
604
|
+
tools: z.enum(["all", "main", "beat"]).optional(),
|
|
530
605
|
control: z.object({
|
|
531
606
|
wait_max_s: z.int().min(1).max(60),
|
|
532
607
|
/** Pairing may start with no token: the person approves the link signed in. */
|