@treestructuredplanning/gateway 0.0.0-stage → 0.1.2

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.
@@ -0,0 +1,966 @@
1
+ {
2
+ "HubToGateway": {
3
+ "description": "The complete server-to-gateway frame; exported through OpenAPI.",
4
+ "discriminator": {
5
+ "mapping": {
6
+ "launch": "#/components/schemas/GatewayLaunchOffer",
7
+ "permit": "#/components/schemas/GatewayPermit",
8
+ "ping": "#/components/schemas/GatewayPing",
9
+ "resume": "#/components/schemas/GatewayResumeOffer",
10
+ "retire": "#/components/schemas/GatewayRetire",
11
+ "stop": "#/components/schemas/GatewayStopOffer"
12
+ },
13
+ "propertyName": "kind"
14
+ },
15
+ "oneOf": [
16
+ {
17
+ "$ref": "#/components/schemas/GatewayLaunchOffer"
18
+ },
19
+ {
20
+ "$ref": "#/components/schemas/GatewayStopOffer"
21
+ },
22
+ {
23
+ "$ref": "#/components/schemas/GatewayResumeOffer"
24
+ },
25
+ {
26
+ "$ref": "#/components/schemas/GatewayPing"
27
+ },
28
+ {
29
+ "$ref": "#/components/schemas/GatewayPermit"
30
+ },
31
+ {
32
+ "$ref": "#/components/schemas/GatewayRetire"
33
+ }
34
+ ],
35
+ "title": "HubToGateway"
36
+ },
37
+ "GatewayLaunchOffer": {
38
+ "additionalProperties": false,
39
+ "properties": {
40
+ "protocol_version": {
41
+ "const": 1,
42
+ "default": 1,
43
+ "title": "Protocol Version",
44
+ "type": "integer"
45
+ },
46
+ "ttl_ms": {
47
+ "minimum": 0,
48
+ "title": "Ttl Ms",
49
+ "type": "integer"
50
+ },
51
+ "kind": {
52
+ "const": "launch",
53
+ "default": "launch",
54
+ "title": "Kind",
55
+ "type": "string"
56
+ },
57
+ "command_id": {
58
+ "pattern": "^lc_[0-9a-f]{12}$",
59
+ "title": "Command Id",
60
+ "type": "string"
61
+ },
62
+ "action_id": {
63
+ "pattern": "^la_[0-9a-f]{12}$",
64
+ "title": "Action Id",
65
+ "type": "string"
66
+ },
67
+ "harness": {
68
+ "$ref": "#/components/schemas/HarnessKind"
69
+ },
70
+ "repository": {
71
+ "maxLength": 201,
72
+ "minLength": 3,
73
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9_-]*/[A-Za-z0-9][A-Za-z0-9_.-]*$",
74
+ "title": "Repository",
75
+ "type": "string"
76
+ },
77
+ "seed": {
78
+ "maxLength": 32000,
79
+ "minLength": 1,
80
+ "title": "Seed",
81
+ "type": "string"
82
+ },
83
+ "session_name": {
84
+ "pattern": "^tsp-[0-9a-f]{12}$",
85
+ "title": "Session Name",
86
+ "type": "string"
87
+ }
88
+ },
89
+ "required": [
90
+ "ttl_ms",
91
+ "command_id",
92
+ "action_id",
93
+ "harness",
94
+ "repository",
95
+ "seed",
96
+ "session_name"
97
+ ],
98
+ "title": "GatewayLaunchOffer",
99
+ "type": "object"
100
+ },
101
+ "HarnessKind": {
102
+ "type": "string",
103
+ "enum": [
104
+ "claude_code",
105
+ "codex"
106
+ ],
107
+ "title": "HarnessKind"
108
+ },
109
+ "GatewayStopOffer": {
110
+ "additionalProperties": false,
111
+ "properties": {
112
+ "protocol_version": {
113
+ "const": 1,
114
+ "default": 1,
115
+ "title": "Protocol Version",
116
+ "type": "integer"
117
+ },
118
+ "ttl_ms": {
119
+ "minimum": 0,
120
+ "title": "Ttl Ms",
121
+ "type": "integer"
122
+ },
123
+ "kind": {
124
+ "const": "stop",
125
+ "default": "stop",
126
+ "title": "Kind",
127
+ "type": "string"
128
+ },
129
+ "command_id": {
130
+ "pattern": "^lc_[0-9a-f]{12}$",
131
+ "title": "Command Id",
132
+ "type": "string"
133
+ },
134
+ "action_id": {
135
+ "pattern": "^la_[0-9a-f]{12}$",
136
+ "title": "Action Id",
137
+ "type": "string"
138
+ },
139
+ "session_ref": {
140
+ "maxLength": 128,
141
+ "minLength": 1,
142
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9_-]*$",
143
+ "title": "Session Ref",
144
+ "type": "string"
145
+ }
146
+ },
147
+ "required": [
148
+ "ttl_ms",
149
+ "command_id",
150
+ "action_id",
151
+ "session_ref"
152
+ ],
153
+ "title": "GatewayStopOffer",
154
+ "type": "object"
155
+ },
156
+ "GatewayResumeOffer": {
157
+ "additionalProperties": false,
158
+ "properties": {
159
+ "protocol_version": {
160
+ "const": 1,
161
+ "default": 1,
162
+ "title": "Protocol Version",
163
+ "type": "integer"
164
+ },
165
+ "ttl_ms": {
166
+ "minimum": 0,
167
+ "title": "Ttl Ms",
168
+ "type": "integer"
169
+ },
170
+ "kind": {
171
+ "const": "resume",
172
+ "default": "resume",
173
+ "title": "Kind",
174
+ "type": "string"
175
+ },
176
+ "command_id": {
177
+ "pattern": "^lc_[0-9a-f]{12}$",
178
+ "title": "Command Id",
179
+ "type": "string"
180
+ },
181
+ "action_id": {
182
+ "pattern": "^la_[0-9a-f]{12}$",
183
+ "title": "Action Id",
184
+ "type": "string"
185
+ },
186
+ "session_ref": {
187
+ "maxLength": 128,
188
+ "minLength": 1,
189
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9_-]*$",
190
+ "title": "Session Ref",
191
+ "type": "string"
192
+ },
193
+ "text": {
194
+ "anyOf": [
195
+ {
196
+ "maxLength": 4000,
197
+ "minLength": 1,
198
+ "type": "string"
199
+ },
200
+ {
201
+ "type": "null"
202
+ }
203
+ ],
204
+ "default": null,
205
+ "title": "Text"
206
+ }
207
+ },
208
+ "required": [
209
+ "ttl_ms",
210
+ "command_id",
211
+ "action_id",
212
+ "session_ref"
213
+ ],
214
+ "title": "GatewayResumeOffer",
215
+ "type": "object"
216
+ },
217
+ "GatewayPing": {
218
+ "additionalProperties": false,
219
+ "properties": {
220
+ "protocol_version": {
221
+ "const": 1,
222
+ "default": 1,
223
+ "title": "Protocol Version",
224
+ "type": "integer"
225
+ },
226
+ "kind": {
227
+ "const": "ping",
228
+ "default": "ping",
229
+ "title": "Kind",
230
+ "type": "string"
231
+ },
232
+ "nonce": {
233
+ "maxLength": 128,
234
+ "minLength": 1,
235
+ "title": "Nonce",
236
+ "type": "string"
237
+ }
238
+ },
239
+ "required": [
240
+ "nonce"
241
+ ],
242
+ "title": "GatewayPing",
243
+ "type": "object"
244
+ },
245
+ "GatewayPermit": {
246
+ "additionalProperties": false,
247
+ "description": "Execution grant, or the authoritative terminal receipt on denial.",
248
+ "properties": {
249
+ "protocol_version": {
250
+ "const": 1,
251
+ "default": 1,
252
+ "title": "Protocol Version",
253
+ "type": "integer"
254
+ },
255
+ "kind": {
256
+ "const": "permit",
257
+ "default": "permit",
258
+ "title": "Kind",
259
+ "type": "string"
260
+ },
261
+ "command_id": {
262
+ "pattern": "^lc_[0-9a-f]{12}$",
263
+ "title": "Command Id",
264
+ "type": "string"
265
+ },
266
+ "action_id": {
267
+ "pattern": "^la_[0-9a-f]{12}$",
268
+ "title": "Action Id",
269
+ "type": "string"
270
+ },
271
+ "allowed": {
272
+ "title": "Allowed",
273
+ "type": "boolean"
274
+ },
275
+ "receipt": {
276
+ "anyOf": [
277
+ {
278
+ "discriminator": {
279
+ "mapping": {
280
+ "ack": "#/components/schemas/GatewayAck",
281
+ "refused": "#/components/schemas/GatewayRefused"
282
+ },
283
+ "propertyName": "kind"
284
+ },
285
+ "oneOf": [
286
+ {
287
+ "$ref": "#/components/schemas/GatewayAck"
288
+ },
289
+ {
290
+ "$ref": "#/components/schemas/GatewayRefused"
291
+ }
292
+ ]
293
+ },
294
+ {
295
+ "type": "null"
296
+ }
297
+ ],
298
+ "default": null,
299
+ "title": "Receipt"
300
+ }
301
+ },
302
+ "required": [
303
+ "command_id",
304
+ "action_id",
305
+ "allowed"
306
+ ],
307
+ "title": "GatewayPermit",
308
+ "type": "object"
309
+ },
310
+ "GatewayAck": {
311
+ "additionalProperties": false,
312
+ "properties": {
313
+ "protocol_version": {
314
+ "const": 1,
315
+ "default": 1,
316
+ "title": "Protocol Version",
317
+ "type": "integer"
318
+ },
319
+ "kind": {
320
+ "const": "ack",
321
+ "default": "ack",
322
+ "title": "Kind",
323
+ "type": "string"
324
+ },
325
+ "command_id": {
326
+ "pattern": "^lc_[0-9a-f]{12}$",
327
+ "title": "Command Id",
328
+ "type": "string"
329
+ },
330
+ "action_id": {
331
+ "pattern": "^la_[0-9a-f]{12}$",
332
+ "title": "Action Id",
333
+ "type": "string"
334
+ }
335
+ },
336
+ "required": [
337
+ "command_id",
338
+ "action_id"
339
+ ],
340
+ "title": "GatewayAck",
341
+ "type": "object"
342
+ },
343
+ "GatewayRefused": {
344
+ "additionalProperties": false,
345
+ "properties": {
346
+ "protocol_version": {
347
+ "const": 1,
348
+ "default": 1,
349
+ "title": "Protocol Version",
350
+ "type": "integer"
351
+ },
352
+ "kind": {
353
+ "const": "refused",
354
+ "default": "refused",
355
+ "title": "Kind",
356
+ "type": "string"
357
+ },
358
+ "command_id": {
359
+ "pattern": "^lc_[0-9a-f]{12}$",
360
+ "title": "Command Id",
361
+ "type": "string"
362
+ },
363
+ "action_id": {
364
+ "pattern": "^la_[0-9a-f]{12}$",
365
+ "title": "Action Id",
366
+ "type": "string"
367
+ },
368
+ "reason": {
369
+ "$ref": "#/components/schemas/LaunchRefusalReason"
370
+ }
371
+ },
372
+ "required": [
373
+ "command_id",
374
+ "action_id",
375
+ "reason"
376
+ ],
377
+ "title": "GatewayRefused",
378
+ "type": "object"
379
+ },
380
+ "LaunchRefusalReason": {
381
+ "type": "string",
382
+ "enum": [
383
+ "workspace_untrusted",
384
+ "not_signed_in",
385
+ "repository_not_registered",
386
+ "harness_unavailable",
387
+ "unsupported_command",
388
+ "requester_mismatch",
389
+ "protocol_outdated",
390
+ "start_failed",
391
+ "shell_startup_timeout",
392
+ "shell_startup_failed",
393
+ "repository_folder_unavailable",
394
+ "harness_exited",
395
+ "start_uncertain",
396
+ "stop_failed",
397
+ "session_not_found",
398
+ "machine_offline",
399
+ "machine_revoked",
400
+ "control_in_flight",
401
+ "awaiting_observation",
402
+ "already_running",
403
+ "not_running",
404
+ "launch_expired",
405
+ "launch_withdrawn",
406
+ "control_expired",
407
+ "control_withdrawn"
408
+ ],
409
+ "title": "LaunchRefusalReason",
410
+ "description": "Why a gateway or the server refused a launch, stop or resume.\n\nThe start failures a gateway can prove are named for what went wrong:\n``shell_startup_timeout`` (the login shell was too slow to start and the\ngateway had no earlier environment to use instead), ``shell_startup_failed``\n(the login shell exited before running the harness),\n``repository_folder_unavailable`` (the registered folder could not be\nentered), ``harness_exited`` (the harness exited with an error while\nstarting) and ``start_uncertain`` (a retried attempt could not tell whether\nan earlier one started a session, so it did not start a second).\n``start_failed`` is what gateways before 0.1.2 send for all of these."
411
+ },
412
+ "GatewayRetire": {
413
+ "additionalProperties": false,
414
+ "description": "Forget local tracking for an action TSP has released or no longer resolves.\n\nIt ends tracking only: the gateway leaves any running session alone.",
415
+ "properties": {
416
+ "protocol_version": {
417
+ "const": 1,
418
+ "default": 1,
419
+ "title": "Protocol Version",
420
+ "type": "integer"
421
+ },
422
+ "kind": {
423
+ "const": "retire",
424
+ "default": "retire",
425
+ "title": "Kind",
426
+ "type": "string"
427
+ },
428
+ "action_id": {
429
+ "pattern": "^la_[0-9a-f]{12}$",
430
+ "title": "Action Id",
431
+ "type": "string"
432
+ }
433
+ },
434
+ "required": [
435
+ "action_id"
436
+ ],
437
+ "title": "GatewayRetire",
438
+ "type": "object"
439
+ },
440
+ "GatewayToHub": {
441
+ "description": "The complete gateway-to-server frame; exported through OpenAPI.",
442
+ "discriminator": {
443
+ "mapping": {
444
+ "ack": "#/components/schemas/GatewayAck",
445
+ "advertise": "#/components/schemas/GatewayAdvertise",
446
+ "claim": "#/components/schemas/GatewayClaim",
447
+ "hello": "#/components/schemas/GatewayHello",
448
+ "pong": "#/components/schemas/GatewayPong",
449
+ "refused": "#/components/schemas/GatewayRefused",
450
+ "session_update": "#/components/schemas/GatewaySessionUpdate"
451
+ },
452
+ "propertyName": "kind"
453
+ },
454
+ "oneOf": [
455
+ {
456
+ "$ref": "#/components/schemas/GatewayHello"
457
+ },
458
+ {
459
+ "$ref": "#/components/schemas/GatewayAdvertise"
460
+ },
461
+ {
462
+ "$ref": "#/components/schemas/GatewayAck"
463
+ },
464
+ {
465
+ "$ref": "#/components/schemas/GatewayClaim"
466
+ },
467
+ {
468
+ "$ref": "#/components/schemas/GatewaySessionUpdate"
469
+ },
470
+ {
471
+ "$ref": "#/components/schemas/GatewayRefused"
472
+ },
473
+ {
474
+ "$ref": "#/components/schemas/GatewayPong"
475
+ }
476
+ ],
477
+ "title": "GatewayToHub"
478
+ },
479
+ "GatewayHello": {
480
+ "additionalProperties": false,
481
+ "properties": {
482
+ "gateway_version": {
483
+ "maxLength": 80,
484
+ "minLength": 1,
485
+ "title": "Gateway Version",
486
+ "type": "string"
487
+ },
488
+ "protocol_version": {
489
+ "default": 1,
490
+ "minimum": 1,
491
+ "title": "Protocol Version",
492
+ "type": "integer"
493
+ },
494
+ "harnesses": {
495
+ "items": {
496
+ "$ref": "#/components/schemas/HarnessCapability"
497
+ },
498
+ "title": "Harnesses",
499
+ "type": "array"
500
+ },
501
+ "repositories": {
502
+ "items": {
503
+ "$ref": "#/components/schemas/AdvertisedRepository"
504
+ },
505
+ "title": "Repositories",
506
+ "type": "array"
507
+ },
508
+ "kind": {
509
+ "const": "hello",
510
+ "default": "hello",
511
+ "title": "Kind",
512
+ "type": "string"
513
+ }
514
+ },
515
+ "required": [
516
+ "gateway_version",
517
+ "harnesses",
518
+ "repositories"
519
+ ],
520
+ "title": "GatewayHello",
521
+ "type": "object"
522
+ },
523
+ "HarnessCapability": {
524
+ "properties": {
525
+ "harness": {
526
+ "$ref": "#/components/schemas/HarnessKind"
527
+ },
528
+ "harness_version": {
529
+ "anyOf": [
530
+ {
531
+ "type": "string",
532
+ "maxLength": 80,
533
+ "minLength": 1
534
+ },
535
+ {
536
+ "type": "null"
537
+ }
538
+ ],
539
+ "title": "Harness Version"
540
+ },
541
+ "available": {
542
+ "type": "boolean",
543
+ "title": "Available"
544
+ },
545
+ "signed_in": {
546
+ "anyOf": [
547
+ {
548
+ "type": "boolean"
549
+ },
550
+ {
551
+ "type": "null"
552
+ }
553
+ ],
554
+ "title": "Signed In"
555
+ },
556
+ "operations": {
557
+ "$ref": "#/components/schemas/HarnessOperations"
558
+ }
559
+ },
560
+ "additionalProperties": false,
561
+ "type": "object",
562
+ "required": [
563
+ "harness",
564
+ "available",
565
+ "operations"
566
+ ],
567
+ "title": "HarnessCapability"
568
+ },
569
+ "HarnessOperations": {
570
+ "properties": {
571
+ "start": {
572
+ "type": "boolean",
573
+ "title": "Start"
574
+ },
575
+ "stop": {
576
+ "type": "boolean",
577
+ "title": "Stop"
578
+ },
579
+ "resume": {
580
+ "type": "boolean",
581
+ "title": "Resume"
582
+ },
583
+ "attach_hint": {
584
+ "type": "boolean",
585
+ "title": "Attach Hint"
586
+ },
587
+ "answer_input": {
588
+ "type": "boolean",
589
+ "title": "Answer Input"
590
+ }
591
+ },
592
+ "additionalProperties": false,
593
+ "type": "object",
594
+ "required": [
595
+ "start",
596
+ "stop",
597
+ "resume",
598
+ "attach_hint",
599
+ "answer_input"
600
+ ],
601
+ "title": "HarnessOperations"
602
+ },
603
+ "AdvertisedRepository": {
604
+ "properties": {
605
+ "harness": {
606
+ "$ref": "#/components/schemas/HarnessKind"
607
+ },
608
+ "slug": {
609
+ "type": "string",
610
+ "maxLength": 201,
611
+ "minLength": 3,
612
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9_-]*/[A-Za-z0-9][A-Za-z0-9_.-]*$",
613
+ "title": "Slug"
614
+ },
615
+ "trust": {
616
+ "$ref": "#/components/schemas/RepositoryTrust"
617
+ },
618
+ "available": {
619
+ "type": "boolean",
620
+ "title": "Available"
621
+ },
622
+ "signed_in": {
623
+ "anyOf": [
624
+ {
625
+ "type": "boolean"
626
+ },
627
+ {
628
+ "type": "null"
629
+ }
630
+ ],
631
+ "title": "Signed In"
632
+ }
633
+ },
634
+ "additionalProperties": false,
635
+ "type": "object",
636
+ "required": [
637
+ "harness",
638
+ "slug",
639
+ "trust",
640
+ "available",
641
+ "signed_in"
642
+ ],
643
+ "title": "AdvertisedRepository"
644
+ },
645
+ "RepositoryTrust": {
646
+ "type": "string",
647
+ "enum": [
648
+ "trusted",
649
+ "untrusted",
650
+ "unknown"
651
+ ],
652
+ "title": "RepositoryTrust"
653
+ },
654
+ "GatewayAdvertise": {
655
+ "additionalProperties": false,
656
+ "properties": {
657
+ "protocol_version": {
658
+ "const": 1,
659
+ "default": 1,
660
+ "title": "Protocol Version",
661
+ "type": "integer"
662
+ },
663
+ "gateway_version": {
664
+ "maxLength": 80,
665
+ "minLength": 1,
666
+ "title": "Gateway Version",
667
+ "type": "string"
668
+ },
669
+ "harnesses": {
670
+ "items": {
671
+ "$ref": "#/components/schemas/HarnessCapability"
672
+ },
673
+ "title": "Harnesses",
674
+ "type": "array"
675
+ },
676
+ "repositories": {
677
+ "items": {
678
+ "$ref": "#/components/schemas/AdvertisedRepository"
679
+ },
680
+ "title": "Repositories",
681
+ "type": "array"
682
+ },
683
+ "kind": {
684
+ "const": "advertise",
685
+ "default": "advertise",
686
+ "title": "Kind",
687
+ "type": "string"
688
+ }
689
+ },
690
+ "required": [
691
+ "gateway_version",
692
+ "harnesses",
693
+ "repositories"
694
+ ],
695
+ "title": "GatewayAdvertise",
696
+ "type": "object"
697
+ },
698
+ "GatewayClaim": {
699
+ "additionalProperties": false,
700
+ "properties": {
701
+ "protocol_version": {
702
+ "const": 1,
703
+ "default": 1,
704
+ "title": "Protocol Version",
705
+ "type": "integer"
706
+ },
707
+ "kind": {
708
+ "const": "claim",
709
+ "default": "claim",
710
+ "title": "Kind",
711
+ "type": "string"
712
+ },
713
+ "command_id": {
714
+ "pattern": "^lc_[0-9a-f]{12}$",
715
+ "title": "Command Id",
716
+ "type": "string"
717
+ },
718
+ "action_id": {
719
+ "pattern": "^la_[0-9a-f]{12}$",
720
+ "title": "Action Id",
721
+ "type": "string"
722
+ }
723
+ },
724
+ "required": [
725
+ "command_id",
726
+ "action_id"
727
+ ],
728
+ "title": "GatewayClaim",
729
+ "type": "object"
730
+ },
731
+ "GatewaySessionUpdate": {
732
+ "additionalProperties": false,
733
+ "properties": {
734
+ "protocol_version": {
735
+ "const": 1,
736
+ "default": 1,
737
+ "title": "Protocol Version",
738
+ "type": "integer"
739
+ },
740
+ "kind": {
741
+ "const": "session_update",
742
+ "default": "session_update",
743
+ "title": "Kind",
744
+ "type": "string"
745
+ },
746
+ "action_id": {
747
+ "pattern": "^la_[0-9a-f]{12}$",
748
+ "title": "Action Id",
749
+ "type": "string"
750
+ },
751
+ "session_ref": {
752
+ "maxLength": 128,
753
+ "minLength": 1,
754
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9_-]*$",
755
+ "title": "Session Ref",
756
+ "type": "string"
757
+ },
758
+ "state": {
759
+ "$ref": "#/components/schemas/AgentSessionState"
760
+ },
761
+ "waiting_for": {
762
+ "anyOf": [
763
+ {
764
+ "maxLength": 240,
765
+ "minLength": 1,
766
+ "type": "string"
767
+ },
768
+ {
769
+ "type": "null"
770
+ }
771
+ ],
772
+ "default": null,
773
+ "title": "Waiting For"
774
+ },
775
+ "attach_hint": {
776
+ "anyOf": [
777
+ {
778
+ "$ref": "#/components/schemas/AttachHint"
779
+ },
780
+ {
781
+ "type": "null"
782
+ }
783
+ ],
784
+ "default": null
785
+ },
786
+ "resumed_as": {
787
+ "anyOf": [
788
+ {
789
+ "maxLength": 128,
790
+ "minLength": 1,
791
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9_-]*$",
792
+ "type": "string"
793
+ },
794
+ {
795
+ "type": "null"
796
+ }
797
+ ],
798
+ "default": null,
799
+ "title": "Resumed As"
800
+ },
801
+ "activity": {
802
+ "anyOf": [
803
+ {
804
+ "$ref": "#/components/schemas/GatewaySessionActivity"
805
+ },
806
+ {
807
+ "type": "null"
808
+ }
809
+ ],
810
+ "default": null,
811
+ "description": "Coarse, content-free activity the gateway derived locally; absent from gateways before 0.1.2 and when its reporting level is off."
812
+ }
813
+ },
814
+ "required": [
815
+ "action_id",
816
+ "session_ref",
817
+ "state"
818
+ ],
819
+ "title": "GatewaySessionUpdate",
820
+ "type": "object"
821
+ },
822
+ "AgentSessionState": {
823
+ "type": "string",
824
+ "enum": [
825
+ "starting",
826
+ "working",
827
+ "needs_input",
828
+ "done",
829
+ "failed",
830
+ "stopped",
831
+ "ended",
832
+ "unknown"
833
+ ],
834
+ "title": "AgentSessionState"
835
+ },
836
+ "AttachHint": {
837
+ "properties": {
838
+ "harness": {
839
+ "$ref": "#/components/schemas/HarnessKind"
840
+ },
841
+ "session_ref": {
842
+ "type": "string",
843
+ "maxLength": 128,
844
+ "minLength": 1,
845
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9_-]*$",
846
+ "title": "Session Ref"
847
+ }
848
+ },
849
+ "additionalProperties": false,
850
+ "type": "object",
851
+ "required": [
852
+ "harness",
853
+ "session_ref"
854
+ ],
855
+ "title": "AttachHint",
856
+ "description": "Path-free session identity; command rendering belongs to the consumer."
857
+ },
858
+ "GatewaySessionActivity": {
859
+ "additionalProperties": false,
860
+ "description": "The snapshot as the gateway sends it, relative to its own send time.",
861
+ "properties": {
862
+ "kind": {
863
+ "anyOf": [
864
+ {
865
+ "$ref": "#/components/schemas/SessionActivityKind"
866
+ },
867
+ {
868
+ "type": "null"
869
+ }
870
+ ],
871
+ "description": "What the session is doing now; null unless it is working."
872
+ },
873
+ "files_edited": {
874
+ "description": "Distinct files the session edited successfully.",
875
+ "maximum": 1000000,
876
+ "minimum": 0,
877
+ "title": "Files Edited",
878
+ "type": "integer"
879
+ },
880
+ "commands_run": {
881
+ "description": "Commands the session ran, reads excluded.",
882
+ "maximum": 1000000,
883
+ "minimum": 0,
884
+ "title": "Commands Run",
885
+ "type": "integer"
886
+ },
887
+ "idle_ms": {
888
+ "description": "Milliseconds since the session was last active, measured by the gateway when it sent the frame, so no clock skew reaches TSP.",
889
+ "minimum": 0,
890
+ "title": "Idle Ms",
891
+ "type": "integer"
892
+ }
893
+ },
894
+ "required": [
895
+ "kind",
896
+ "files_edited",
897
+ "commands_run",
898
+ "idle_ms"
899
+ ],
900
+ "title": "GatewaySessionActivity",
901
+ "type": "object"
902
+ },
903
+ "SessionActivityKind": {
904
+ "type": "string",
905
+ "enum": [
906
+ "thinking",
907
+ "reading",
908
+ "editing",
909
+ "running_command",
910
+ "using_plan",
911
+ "delegating",
912
+ "using_tool"
913
+ ],
914
+ "title": "SessionActivityKind",
915
+ "description": "What a working session is doing right now, as its harness shows it.\n\nReported only while the session is working. Waiting on the person is the\nsession's ``needs_input`` state, not a kind."
916
+ },
917
+ "GatewayPong": {
918
+ "additionalProperties": false,
919
+ "properties": {
920
+ "protocol_version": {
921
+ "const": 1,
922
+ "default": 1,
923
+ "title": "Protocol Version",
924
+ "type": "integer"
925
+ },
926
+ "kind": {
927
+ "const": "pong",
928
+ "default": "pong",
929
+ "title": "Kind",
930
+ "type": "string"
931
+ },
932
+ "nonce": {
933
+ "maxLength": 128,
934
+ "minLength": 1,
935
+ "title": "Nonce",
936
+ "type": "string"
937
+ }
938
+ },
939
+ "required": [
940
+ "nonce"
941
+ ],
942
+ "title": "GatewayPong",
943
+ "type": "object"
944
+ },
945
+ "GatewayMachineRegistered": {
946
+ "properties": {
947
+ "machine_id": {
948
+ "type": "string",
949
+ "pattern": "^mach_[0-9a-f]{12}$",
950
+ "title": "Machine Id"
951
+ },
952
+ "hub_path": {
953
+ "type": "string",
954
+ "pattern": "^/api/v1/gateway/machines/mach_[0-9a-f]{12}/hub$",
955
+ "title": "Hub Path"
956
+ }
957
+ },
958
+ "additionalProperties": false,
959
+ "type": "object",
960
+ "required": [
961
+ "machine_id",
962
+ "hub_path"
963
+ ],
964
+ "title": "GatewayMachineRegistered"
965
+ }
966
+ }