@ellipsis-dev/sdk 0.1.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.
@@ -0,0 +1,1427 @@
1
+ {
2
+ "$defs": {
3
+ "AgentSessionExitStatus": {
4
+ "description": "Why a terminal agent session ended \u2014 a finer-grained reason than `status`.\n\n`status` (AgentSessionStatus) is the lifecycle state: COMPLETED / ERROR /\nCANCELLED. `exit_status` explains *why* a run reached that terminal state, so\nthe UI and metrics can tell a budget cutoff apart from a crashed tool call or\na deliberate cancellation. It is None until the run reaches a terminal state.",
5
+ "enum": [
6
+ "completed",
7
+ "budget_hit",
8
+ "payment_required",
9
+ "tool_call_failed",
10
+ "lifecycle_hook_failed",
11
+ "missing_repo_access",
12
+ "missing_token_permissions",
13
+ "cancelled",
14
+ "interrupted",
15
+ "error",
16
+ "stopped"
17
+ ],
18
+ "title": "AgentSessionExitStatus",
19
+ "type": "string"
20
+ },
21
+ "AgentSessionPr": {
22
+ "description": "A pull request this session created, denormalized at capture time so\nsession surfaces render a labeled link without joining gh_prs. Live PR\nstate (open/merged/closed) is not stored here \u2014 read it from gh_prs where\na view needs it.",
23
+ "properties": {
24
+ "gh_pr_id": {
25
+ "anyOf": [
26
+ {
27
+ "type": "integer"
28
+ },
29
+ {
30
+ "type": "null"
31
+ }
32
+ ],
33
+ "default": null,
34
+ "title": "Gh Pr Id"
35
+ },
36
+ "number": {
37
+ "title": "Number",
38
+ "type": "integer"
39
+ },
40
+ "repo_full_name": {
41
+ "title": "Repo Full Name",
42
+ "type": "string"
43
+ },
44
+ "title": {
45
+ "anyOf": [
46
+ {
47
+ "type": "string"
48
+ },
49
+ {
50
+ "type": "null"
51
+ }
52
+ ],
53
+ "default": null,
54
+ "title": "Title"
55
+ },
56
+ "url": {
57
+ "title": "Url",
58
+ "type": "string"
59
+ }
60
+ },
61
+ "required": [
62
+ "gh_pr_id",
63
+ "number",
64
+ "repo_full_name",
65
+ "title",
66
+ "url"
67
+ ],
68
+ "title": "AgentSessionPr",
69
+ "type": "object"
70
+ },
71
+ "AgentSessionSource": {
72
+ "enum": [
73
+ "react",
74
+ "manual",
75
+ "api",
76
+ "cli",
77
+ "mention",
78
+ "cron",
79
+ "laptop"
80
+ ],
81
+ "title": "AgentSessionSource",
82
+ "type": "string"
83
+ },
84
+ "AgentSessionStatus": {
85
+ "enum": [
86
+ "scheduled",
87
+ "creating_sandbox",
88
+ "running",
89
+ "retrying",
90
+ "completed",
91
+ "error",
92
+ "cancelled",
93
+ "stopped"
94
+ ],
95
+ "title": "AgentSessionStatus",
96
+ "type": "string"
97
+ },
98
+ "AgentSessionWire": {
99
+ "properties": {
100
+ "agent_config_id": {
101
+ "anyOf": [
102
+ {
103
+ "type": "string"
104
+ },
105
+ {
106
+ "type": "null"
107
+ }
108
+ ],
109
+ "default": null,
110
+ "title": "Agent Config Id"
111
+ },
112
+ "attributed_user": {
113
+ "anyOf": [
114
+ {
115
+ "$ref": "#/$defs/GithubAccountSnippet"
116
+ },
117
+ {
118
+ "type": "null"
119
+ }
120
+ ],
121
+ "default": null
122
+ },
123
+ "attribution_id": {
124
+ "anyOf": [
125
+ {
126
+ "type": "string"
127
+ },
128
+ {
129
+ "type": "null"
130
+ }
131
+ ],
132
+ "default": null,
133
+ "title": "Attribution Id"
134
+ },
135
+ "attribution_type": {
136
+ "anyOf": [
137
+ {
138
+ "$ref": "#/$defs/AttributionType"
139
+ },
140
+ {
141
+ "type": "null"
142
+ }
143
+ ],
144
+ "default": null
145
+ },
146
+ "client_version": {
147
+ "anyOf": [
148
+ {
149
+ "type": "string"
150
+ },
151
+ {
152
+ "type": "null"
153
+ }
154
+ ],
155
+ "default": null,
156
+ "title": "Client Version"
157
+ },
158
+ "config_override": {
159
+ "anyOf": [
160
+ {
161
+ "additionalProperties": true,
162
+ "type": "object"
163
+ },
164
+ {
165
+ "type": "null"
166
+ }
167
+ ],
168
+ "default": null,
169
+ "title": "Config Override"
170
+ },
171
+ "context_repository": {
172
+ "anyOf": [
173
+ {
174
+ "type": "string"
175
+ },
176
+ {
177
+ "type": "null"
178
+ }
179
+ ],
180
+ "default": null,
181
+ "title": "Context Repository"
182
+ },
183
+ "cost_fee": {
184
+ "default": 0,
185
+ "title": "Cost Fee",
186
+ "type": "integer"
187
+ },
188
+ "cost_sandbox_cpu": {
189
+ "default": 0,
190
+ "title": "Cost Sandbox Cpu",
191
+ "type": "integer"
192
+ },
193
+ "cost_sandbox_memory": {
194
+ "default": 0,
195
+ "title": "Cost Sandbox Memory",
196
+ "type": "integer"
197
+ },
198
+ "cost_tokens": {
199
+ "title": "Cost Tokens",
200
+ "type": "integer"
201
+ },
202
+ "created_at": {
203
+ "format": "date-time",
204
+ "title": "Created At",
205
+ "type": "string"
206
+ },
207
+ "customer_id": {
208
+ "title": "Customer Id",
209
+ "type": "string"
210
+ },
211
+ "default_resolution": {
212
+ "anyOf": [
213
+ {
214
+ "$ref": "#/$defs/DefaultResolution"
215
+ },
216
+ {
217
+ "type": "null"
218
+ }
219
+ ],
220
+ "default": null
221
+ },
222
+ "exit_status": {
223
+ "anyOf": [
224
+ {
225
+ "$ref": "#/$defs/AgentSessionExitStatus"
226
+ },
227
+ {
228
+ "type": "null"
229
+ }
230
+ ],
231
+ "default": null
232
+ },
233
+ "harness": {
234
+ "$ref": "#/$defs/Harness"
235
+ },
236
+ "id": {
237
+ "title": "Id",
238
+ "type": "string"
239
+ },
240
+ "last_activity_at": {
241
+ "anyOf": [
242
+ {
243
+ "format": "date-time",
244
+ "type": "string"
245
+ },
246
+ {
247
+ "type": "null"
248
+ }
249
+ ],
250
+ "default": null,
251
+ "title": "Last Activity At"
252
+ },
253
+ "last_message_at": {
254
+ "anyOf": [
255
+ {
256
+ "format": "date-time",
257
+ "type": "string"
258
+ },
259
+ {
260
+ "type": "null"
261
+ }
262
+ ],
263
+ "default": null,
264
+ "title": "Last Message At"
265
+ },
266
+ "live_summary": {
267
+ "anyOf": [
268
+ {
269
+ "type": "string"
270
+ },
271
+ {
272
+ "type": "null"
273
+ }
274
+ ],
275
+ "default": null,
276
+ "title": "Live Summary"
277
+ },
278
+ "metadata": {
279
+ "additionalProperties": {
280
+ "type": "string"
281
+ },
282
+ "default": {},
283
+ "title": "Metadata",
284
+ "type": "object"
285
+ },
286
+ "output_prs": {
287
+ "anyOf": [
288
+ {
289
+ "items": {
290
+ "$ref": "#/$defs/AgentSessionPr"
291
+ },
292
+ "type": "array"
293
+ },
294
+ {
295
+ "type": "null"
296
+ }
297
+ ],
298
+ "default": null,
299
+ "title": "Output Prs"
300
+ },
301
+ "parent_agent_session_id": {
302
+ "anyOf": [
303
+ {
304
+ "type": "string"
305
+ },
306
+ {
307
+ "type": "null"
308
+ }
309
+ ],
310
+ "default": null,
311
+ "title": "Parent Agent Session Id"
312
+ },
313
+ "parent_kind": {
314
+ "anyOf": [
315
+ {
316
+ "$ref": "#/$defs/ParentKind"
317
+ },
318
+ {
319
+ "type": "null"
320
+ }
321
+ ],
322
+ "default": null
323
+ },
324
+ "prompt": {
325
+ "anyOf": [
326
+ {
327
+ "type": "string"
328
+ },
329
+ {
330
+ "type": "null"
331
+ }
332
+ ],
333
+ "default": null,
334
+ "title": "Prompt"
335
+ },
336
+ "replayed_from_session_id": {
337
+ "anyOf": [
338
+ {
339
+ "type": "string"
340
+ },
341
+ {
342
+ "type": "null"
343
+ }
344
+ ],
345
+ "default": null,
346
+ "title": "Replayed From Session Id"
347
+ },
348
+ "resolved_budget_cents": {
349
+ "title": "Resolved Budget Cents",
350
+ "type": "integer"
351
+ },
352
+ "resolved_budget_source": {
353
+ "$ref": "#/$defs/BudgetSource"
354
+ },
355
+ "sandbox_id": {
356
+ "anyOf": [
357
+ {
358
+ "type": "string"
359
+ },
360
+ {
361
+ "type": "null"
362
+ }
363
+ ],
364
+ "default": null,
365
+ "title": "Sandbox Id"
366
+ },
367
+ "session_key": {
368
+ "anyOf": [
369
+ {
370
+ "type": "string"
371
+ },
372
+ {
373
+ "type": "null"
374
+ }
375
+ ],
376
+ "default": null,
377
+ "title": "Session Key"
378
+ },
379
+ "session_state": {
380
+ "anyOf": [
381
+ {
382
+ "$ref": "#/$defs/SessionState"
383
+ },
384
+ {
385
+ "type": "null"
386
+ }
387
+ ],
388
+ "default": null
389
+ },
390
+ "source": {
391
+ "$ref": "#/$defs/AgentSessionSource"
392
+ },
393
+ "status": {
394
+ "$ref": "#/$defs/AgentSessionStatus"
395
+ },
396
+ "status_reason": {
397
+ "anyOf": [
398
+ {
399
+ "type": "string"
400
+ },
401
+ {
402
+ "type": "null"
403
+ }
404
+ ],
405
+ "default": null,
406
+ "title": "Status Reason"
407
+ },
408
+ "stopped_at": {
409
+ "anyOf": [
410
+ {
411
+ "format": "date-time",
412
+ "type": "string"
413
+ },
414
+ {
415
+ "type": "null"
416
+ }
417
+ ],
418
+ "default": null,
419
+ "title": "Stopped At"
420
+ },
421
+ "stopped_by": {
422
+ "anyOf": [
423
+ {
424
+ "type": "integer"
425
+ },
426
+ {
427
+ "type": "null"
428
+ }
429
+ ],
430
+ "default": null,
431
+ "title": "Stopped By"
432
+ },
433
+ "stopped_by_user": {
434
+ "anyOf": [
435
+ {
436
+ "$ref": "#/$defs/GithubAccountSnippet"
437
+ },
438
+ {
439
+ "type": "null"
440
+ }
441
+ ],
442
+ "default": null
443
+ },
444
+ "surface": {
445
+ "anyOf": [
446
+ {
447
+ "$ref": "#/$defs/SessionSurface"
448
+ },
449
+ {
450
+ "type": "null"
451
+ }
452
+ ],
453
+ "default": null
454
+ },
455
+ "tokens_cache_creation": {
456
+ "default": 0,
457
+ "title": "Tokens Cache Creation",
458
+ "type": "integer"
459
+ },
460
+ "tokens_cache_read": {
461
+ "default": 0,
462
+ "title": "Tokens Cache Read",
463
+ "type": "integer"
464
+ },
465
+ "tokens_input": {
466
+ "default": 0,
467
+ "title": "Tokens Input",
468
+ "type": "integer"
469
+ },
470
+ "tokens_model": {
471
+ "title": "Tokens Model",
472
+ "type": "string"
473
+ },
474
+ "tokens_output": {
475
+ "default": 0,
476
+ "title": "Tokens Output",
477
+ "type": "integer"
478
+ },
479
+ "tokens_total": {
480
+ "default": 0,
481
+ "title": "Tokens Total",
482
+ "type": "integer"
483
+ },
484
+ "updated_at": {
485
+ "format": "date-time",
486
+ "title": "Updated At",
487
+ "type": "string"
488
+ },
489
+ "webhook_id": {
490
+ "anyOf": [
491
+ {
492
+ "type": "string"
493
+ },
494
+ {
495
+ "type": "null"
496
+ }
497
+ ],
498
+ "default": null,
499
+ "title": "Webhook Id"
500
+ },
501
+ "webhook_type": {
502
+ "anyOf": [
503
+ {
504
+ "$ref": "#/$defs/WebhookType"
505
+ },
506
+ {
507
+ "type": "null"
508
+ }
509
+ ],
510
+ "default": null
511
+ }
512
+ },
513
+ "required": [
514
+ "agent_config_id",
515
+ "attributed_user",
516
+ "attribution_id",
517
+ "attribution_type",
518
+ "client_version",
519
+ "config_override",
520
+ "context_repository",
521
+ "cost_fee",
522
+ "cost_sandbox_cpu",
523
+ "cost_sandbox_memory",
524
+ "cost_tokens",
525
+ "created_at",
526
+ "customer_id",
527
+ "default_resolution",
528
+ "exit_status",
529
+ "harness",
530
+ "id",
531
+ "last_activity_at",
532
+ "last_message_at",
533
+ "live_summary",
534
+ "metadata",
535
+ "output_prs",
536
+ "parent_agent_session_id",
537
+ "parent_kind",
538
+ "prompt",
539
+ "replayed_from_session_id",
540
+ "resolved_budget_cents",
541
+ "resolved_budget_source",
542
+ "sandbox_id",
543
+ "session_key",
544
+ "session_state",
545
+ "source",
546
+ "status",
547
+ "status_reason",
548
+ "stopped_at",
549
+ "stopped_by",
550
+ "stopped_by_user",
551
+ "surface",
552
+ "tokens_cache_creation",
553
+ "tokens_cache_read",
554
+ "tokens_input",
555
+ "tokens_model",
556
+ "tokens_output",
557
+ "tokens_total",
558
+ "updated_at",
559
+ "webhook_id",
560
+ "webhook_type"
561
+ ],
562
+ "title": "AgentSessionWire",
563
+ "type": "object"
564
+ },
565
+ "AttributionType": {
566
+ "enum": [
567
+ "github_user",
568
+ "linear_user",
569
+ "slack_user",
570
+ "api_key"
571
+ ],
572
+ "title": "AttributionType",
573
+ "type": "string"
574
+ },
575
+ "BudgetSource": {
576
+ "description": "Which layer actually determined the enforced budget.\n\nNot derivable from the run row alone (the run does not store the config\ncents or the customer default), so we persist it for the UI / audit.",
577
+ "enum": [
578
+ "system",
579
+ "account",
580
+ "config",
581
+ "run"
582
+ ],
583
+ "title": "BudgetSource",
584
+ "type": "string"
585
+ },
586
+ "DefaultResolution": {
587
+ "description": "How a session that arrived with no explicit config source resolved its\nconfig (documents/eng/DEFAULT_CONFIGS.md \u00a74). Persisted on the session so\naudit and clients can say \"ran under X (repo default)\". A session started\nwith an explicit config/config_id/template_id never enters resolution and\nstores None.",
588
+ "enum": [
589
+ "repo_default",
590
+ "account_default",
591
+ "none"
592
+ ],
593
+ "title": "DefaultResolution",
594
+ "type": "string"
595
+ },
596
+ "DeltaFrame": {
597
+ "description": "Fire-and-forget partial assistant output for the current response.\nNo seq, never resumable; superseded by the committed record.",
598
+ "properties": {
599
+ "agent_turn_id": {
600
+ "anyOf": [
601
+ {
602
+ "type": "string"
603
+ },
604
+ {
605
+ "type": "null"
606
+ }
607
+ ],
608
+ "default": null,
609
+ "title": "Agent Turn Id"
610
+ },
611
+ "kind": {
612
+ "description": "What the partial text is. Known values: text ('thinking' reserved). Open vocabulary: ignore deltas with unknown kinds.",
613
+ "type": "string"
614
+ },
615
+ "output_tokens": {
616
+ "anyOf": [
617
+ {
618
+ "type": "integer"
619
+ },
620
+ {
621
+ "type": "null"
622
+ }
623
+ ],
624
+ "default": null,
625
+ "title": "Output Tokens"
626
+ },
627
+ "text": {
628
+ "anyOf": [
629
+ {
630
+ "type": "string"
631
+ },
632
+ {
633
+ "type": "null"
634
+ }
635
+ ],
636
+ "default": null,
637
+ "title": "Text"
638
+ },
639
+ "type": {
640
+ "const": "delta",
641
+ "default": "delta",
642
+ "title": "Type",
643
+ "type": "string"
644
+ }
645
+ },
646
+ "required": [
647
+ "agent_turn_id",
648
+ "kind",
649
+ "output_tokens",
650
+ "text",
651
+ "type"
652
+ ],
653
+ "title": "DeltaFrame",
654
+ "type": "object"
655
+ },
656
+ "DoneFrame": {
657
+ "description": "Terminal marker: the conversation is over, after the final session frame\ncarried the end state. Followed by close 1000.",
658
+ "properties": {
659
+ "type": {
660
+ "const": "done",
661
+ "default": "done",
662
+ "title": "Type",
663
+ "type": "string"
664
+ }
665
+ },
666
+ "required": [
667
+ "type"
668
+ ],
669
+ "title": "DoneFrame",
670
+ "type": "object"
671
+ },
672
+ "ErrorFrame": {
673
+ "description": "Terminal error marker, before close 1011. Curated copy only.",
674
+ "properties": {
675
+ "message": {
676
+ "title": "Message",
677
+ "type": "string"
678
+ },
679
+ "type": {
680
+ "const": "error",
681
+ "default": "error",
682
+ "title": "Type",
683
+ "type": "string"
684
+ }
685
+ },
686
+ "required": [
687
+ "message",
688
+ "type"
689
+ ],
690
+ "title": "ErrorFrame",
691
+ "type": "object"
692
+ },
693
+ "GithubAccountSnippet": {
694
+ "description": "Sometimes the GitHub API returns a user of github (can include bots)\nusing this snippet instead of the full GithubAccount model. One example,\nis when the API returns a pull request.\n\nThis is the least amount of info we need to represent a GitHub account.",
695
+ "properties": {
696
+ "avatar_url": {
697
+ "title": "Avatar Url",
698
+ "type": "string"
699
+ },
700
+ "id": {
701
+ "title": "Id",
702
+ "type": "integer"
703
+ },
704
+ "login": {
705
+ "title": "Login",
706
+ "type": "string"
707
+ },
708
+ "type": {
709
+ "$ref": "#/$defs/GithubAccountType"
710
+ }
711
+ },
712
+ "required": [
713
+ "avatar_url",
714
+ "id",
715
+ "login",
716
+ "type"
717
+ ],
718
+ "title": "GithubAccountSnippet",
719
+ "type": "object"
720
+ },
721
+ "GithubAccountType": {
722
+ "enum": [
723
+ "User",
724
+ "Organization",
725
+ "Bot",
726
+ "Mannequin"
727
+ ],
728
+ "title": "GithubAccountType",
729
+ "type": "string"
730
+ },
731
+ "Harness": {
732
+ "enum": [
733
+ "claude_code"
734
+ ],
735
+ "title": "Harness",
736
+ "type": "string"
737
+ },
738
+ "HeartbeatFrame": {
739
+ "description": "Sent after HEARTBEAT_SECONDS of idleness; doubles as the dead-socket\nprobe.",
740
+ "properties": {
741
+ "ts": {
742
+ "format": "date-time",
743
+ "title": "Ts",
744
+ "type": "string"
745
+ },
746
+ "type": {
747
+ "const": "heartbeat",
748
+ "default": "heartbeat",
749
+ "title": "Type",
750
+ "type": "string"
751
+ }
752
+ },
753
+ "required": [
754
+ "ts",
755
+ "type"
756
+ ],
757
+ "title": "HeartbeatFrame",
758
+ "type": "object"
759
+ },
760
+ "MessagesFrame": {
761
+ "description": "LWW snapshot of the OPEN inbox slice: all PENDING rows plus rows that\nflipped (delivered, re-pended) within this connection since the last frame.\nDeliberately not the full message history \u2014 delivered rows render through\ntheir transcript user-echo records; structural history stays on REST\n/turns (\u00a73.3).",
762
+ "properties": {
763
+ "messages": {
764
+ "items": {
765
+ "$ref": "#/$defs/SessionMessageWire"
766
+ },
767
+ "title": "Messages",
768
+ "type": "array"
769
+ },
770
+ "type": {
771
+ "const": "messages",
772
+ "default": "messages",
773
+ "title": "Type",
774
+ "type": "string"
775
+ }
776
+ },
777
+ "required": [
778
+ "messages",
779
+ "type"
780
+ ],
781
+ "title": "MessagesFrame",
782
+ "type": "object"
783
+ },
784
+ "ModelTokensInfo": {
785
+ "properties": {
786
+ "cache_creation_input_tokens": {
787
+ "default": 0,
788
+ "title": "Cache Creation Input Tokens",
789
+ "type": "integer"
790
+ },
791
+ "cache_read_input_tokens": {
792
+ "default": 0,
793
+ "title": "Cache Read Input Tokens",
794
+ "type": "integer"
795
+ },
796
+ "cost_usd": {
797
+ "default": 0,
798
+ "title": "Cost Usd",
799
+ "type": "number"
800
+ },
801
+ "input_tokens": {
802
+ "default": 0,
803
+ "title": "Input Tokens",
804
+ "type": "integer"
805
+ },
806
+ "output_tokens": {
807
+ "default": 0,
808
+ "title": "Output Tokens",
809
+ "type": "integer"
810
+ }
811
+ },
812
+ "required": [
813
+ "cache_creation_input_tokens",
814
+ "cache_read_input_tokens",
815
+ "cost_usd",
816
+ "input_tokens",
817
+ "output_tokens"
818
+ ],
819
+ "title": "ModelTokensInfo",
820
+ "type": "object"
821
+ },
822
+ "ParentKind": {
823
+ "description": "How a session relates to its predecessor (parent_agent_session_id) \u2014\nthe ONE \"preceded-by\" chain for every predecessor relationship. Routing\nreads this when the distinction matters.\n\nCONTINUATION \u2014 a follow-up in the same conversation surface (e.g. a Slack\nthread reply spawning a fresh session on the same thread).\nHANDOFF \u2014 a session started to take over work from another surface (e.g.\nlaptop \u2192 cloud handoff; later phase).\nRESUME \u2014 a conversation re-hosted on a new box after its sandbox was torn\ndown (interactive platform; later phase).",
824
+ "enum": [
825
+ "continuation",
826
+ "handoff",
827
+ "resume"
828
+ ],
829
+ "title": "ParentKind",
830
+ "type": "string"
831
+ },
832
+ "RecordsAppendFrame": {
833
+ "description": "Cursored append-only: raw records ordered by feed_seq, all sources.\nEvery record in the frame advances the resume cursor \u2014 including ones a\nclient renders as nothing (\u00a73.4).",
834
+ "properties": {
835
+ "records": {
836
+ "items": {
837
+ "$ref": "#/$defs/SessionRecordWire"
838
+ },
839
+ "title": "Records",
840
+ "type": "array"
841
+ },
842
+ "type": {
843
+ "const": "records_append",
844
+ "default": "records_append",
845
+ "title": "Type",
846
+ "type": "string"
847
+ }
848
+ },
849
+ "required": [
850
+ "records",
851
+ "type"
852
+ ],
853
+ "title": "RecordsAppendFrame",
854
+ "type": "object"
855
+ },
856
+ "RunStatus": {
857
+ "description": "What the current (or most recent) execution is doing (backs `run`).",
858
+ "enum": [
859
+ "scheduled",
860
+ "starting",
861
+ "working",
862
+ "waiting",
863
+ "done",
864
+ "failed",
865
+ "stopped",
866
+ "cancelled",
867
+ "retrying"
868
+ ],
869
+ "title": "RunStatus",
870
+ "type": "string"
871
+ },
872
+ "SessionFrame": {
873
+ "description": "LWW snapshot of the enriched public session (\u00a74.1) \u2014 the only way\nstatus/state/cost arrive. Resent whole on any field change.",
874
+ "properties": {
875
+ "session": {
876
+ "$ref": "#/$defs/AgentSessionWire"
877
+ },
878
+ "type": {
879
+ "const": "session",
880
+ "default": "session",
881
+ "title": "Type",
882
+ "type": "string"
883
+ }
884
+ },
885
+ "required": [
886
+ "session",
887
+ "type"
888
+ ],
889
+ "title": "SessionFrame",
890
+ "type": "object"
891
+ },
892
+ "SessionLiveness": {
893
+ "description": "The durable conversation axis (backs the surfaced `session` field).",
894
+ "enum": [
895
+ "alive",
896
+ "sleeping",
897
+ "closed"
898
+ ],
899
+ "title": "SessionLiveness",
900
+ "type": "string"
901
+ },
902
+ "SessionMessageStatus": {
903
+ "enum": [
904
+ "pending",
905
+ "delivered"
906
+ ],
907
+ "title": "SessionMessageStatus",
908
+ "type": "string"
909
+ },
910
+ "SessionMessageWire": {
911
+ "description": "The wire shape of one inbox message (\u00a73.3): what a queued chip renders\nand retires on. `author` is the message's attribution string; the webhook\nprovenance internals stay off the wire.",
912
+ "properties": {
913
+ "agent_session_id": {
914
+ "title": "Agent Session Id",
915
+ "type": "string"
916
+ },
917
+ "author": {
918
+ "anyOf": [
919
+ {
920
+ "type": "string"
921
+ },
922
+ {
923
+ "type": "null"
924
+ }
925
+ ],
926
+ "default": null,
927
+ "title": "Author"
928
+ },
929
+ "body": {
930
+ "title": "Body",
931
+ "type": "string"
932
+ },
933
+ "created_at": {
934
+ "format": "date-time",
935
+ "title": "Created At",
936
+ "type": "string"
937
+ },
938
+ "delivered_at": {
939
+ "anyOf": [
940
+ {
941
+ "format": "date-time",
942
+ "type": "string"
943
+ },
944
+ {
945
+ "type": "null"
946
+ }
947
+ ],
948
+ "default": null,
949
+ "title": "Delivered At"
950
+ },
951
+ "delivered_turn_id": {
952
+ "anyOf": [
953
+ {
954
+ "type": "string"
955
+ },
956
+ {
957
+ "type": "null"
958
+ }
959
+ ],
960
+ "default": null,
961
+ "title": "Delivered Turn Id"
962
+ },
963
+ "feed_seq": {
964
+ "anyOf": [
965
+ {
966
+ "type": "integer"
967
+ },
968
+ {
969
+ "type": "null"
970
+ }
971
+ ],
972
+ "default": null,
973
+ "title": "Feed Seq"
974
+ },
975
+ "id": {
976
+ "title": "Id",
977
+ "type": "string"
978
+ },
979
+ "sender_attribution_id": {
980
+ "anyOf": [
981
+ {
982
+ "type": "string"
983
+ },
984
+ {
985
+ "type": "null"
986
+ }
987
+ ],
988
+ "default": null,
989
+ "title": "Sender Attribution Id"
990
+ },
991
+ "sender_attribution_type": {
992
+ "anyOf": [
993
+ {
994
+ "$ref": "#/$defs/AttributionType"
995
+ },
996
+ {
997
+ "type": "null"
998
+ }
999
+ ],
1000
+ "default": null
1001
+ },
1002
+ "status": {
1003
+ "$ref": "#/$defs/SessionMessageStatus"
1004
+ }
1005
+ },
1006
+ "required": [
1007
+ "agent_session_id",
1008
+ "author",
1009
+ "body",
1010
+ "created_at",
1011
+ "delivered_at",
1012
+ "delivered_turn_id",
1013
+ "feed_seq",
1014
+ "id",
1015
+ "sender_attribution_id",
1016
+ "sender_attribution_type",
1017
+ "status"
1018
+ ],
1019
+ "title": "SessionMessageWire",
1020
+ "type": "object"
1021
+ },
1022
+ "SessionRecordWire": {
1023
+ "description": "The wire shape of one session record (\u00a73.3): the \u00a73.6 stable envelope +\nthe native `payload`, by explicit allowlist. Internal-only columns\n(`search_text`, `clis`, ingest bookkeeping, attribution denormalizations)\nare deliberately absent so internal model evolution stays free.",
1024
+ "properties": {
1025
+ "agent_session_id": {
1026
+ "title": "Agent Session Id",
1027
+ "type": "string"
1028
+ },
1029
+ "agent_turn_id": {
1030
+ "anyOf": [
1031
+ {
1032
+ "type": "string"
1033
+ },
1034
+ {
1035
+ "type": "null"
1036
+ }
1037
+ ],
1038
+ "default": null,
1039
+ "title": "Agent Turn Id"
1040
+ },
1041
+ "cost": {
1042
+ "anyOf": [
1043
+ {
1044
+ "type": "integer"
1045
+ },
1046
+ {
1047
+ "type": "null"
1048
+ }
1049
+ ],
1050
+ "default": null,
1051
+ "title": "Cost"
1052
+ },
1053
+ "created_at": {
1054
+ "format": "date-time",
1055
+ "title": "Created At",
1056
+ "type": "string"
1057
+ },
1058
+ "duration": {
1059
+ "anyOf": [
1060
+ {
1061
+ "type": "integer"
1062
+ },
1063
+ {
1064
+ "type": "null"
1065
+ }
1066
+ ],
1067
+ "default": null,
1068
+ "title": "Duration"
1069
+ },
1070
+ "feed_seq": {
1071
+ "title": "Feed Seq",
1072
+ "type": "integer"
1073
+ },
1074
+ "id": {
1075
+ "title": "Id",
1076
+ "type": "string"
1077
+ },
1078
+ "model": {
1079
+ "anyOf": [
1080
+ {
1081
+ "type": "string"
1082
+ },
1083
+ {
1084
+ "type": "null"
1085
+ }
1086
+ ],
1087
+ "default": null,
1088
+ "title": "Model"
1089
+ },
1090
+ "payload": {
1091
+ "additionalProperties": true,
1092
+ "title": "Payload",
1093
+ "type": "object"
1094
+ },
1095
+ "record_format": {
1096
+ "title": "Record Format",
1097
+ "type": "string"
1098
+ },
1099
+ "record_type": {
1100
+ "title": "Record Type",
1101
+ "type": "string"
1102
+ },
1103
+ "session_message_id": {
1104
+ "anyOf": [
1105
+ {
1106
+ "type": "string"
1107
+ },
1108
+ {
1109
+ "type": "null"
1110
+ }
1111
+ ],
1112
+ "default": null,
1113
+ "title": "Session Message Id"
1114
+ },
1115
+ "source": {
1116
+ "description": "Who wrote the record. Known values: claude_code (a native harness transcript record) | lifecycle (a platform notification). Open vocabulary: ignore records with unknown sources.",
1117
+ "type": "string"
1118
+ },
1119
+ "stream_seq": {
1120
+ "title": "Stream Seq",
1121
+ "type": "integer"
1122
+ },
1123
+ "tokens_info": {
1124
+ "anyOf": [
1125
+ {
1126
+ "$ref": "#/$defs/TokensInfo"
1127
+ },
1128
+ {
1129
+ "type": "null"
1130
+ }
1131
+ ],
1132
+ "default": null
1133
+ },
1134
+ "tools": {
1135
+ "anyOf": [
1136
+ {
1137
+ "items": {
1138
+ "type": "string"
1139
+ },
1140
+ "type": "array"
1141
+ },
1142
+ {
1143
+ "type": "null"
1144
+ }
1145
+ ],
1146
+ "default": null,
1147
+ "title": "Tools"
1148
+ }
1149
+ },
1150
+ "required": [
1151
+ "agent_session_id",
1152
+ "agent_turn_id",
1153
+ "cost",
1154
+ "created_at",
1155
+ "duration",
1156
+ "feed_seq",
1157
+ "id",
1158
+ "model",
1159
+ "payload",
1160
+ "record_format",
1161
+ "record_type",
1162
+ "session_message_id",
1163
+ "source",
1164
+ "stream_seq",
1165
+ "tokens_info",
1166
+ "tools"
1167
+ ],
1168
+ "title": "SessionRecordWire",
1169
+ "type": "object"
1170
+ },
1171
+ "SessionState": {
1172
+ "description": "Lifecycle of a keyed (multi-turn) session \u2014 the durable conversation.\nDistinct from AgentSessionStatus, which is per-execution (one turn's run) and\nmoves to agent_turns in a later slice. IDLE: alive, waiting for the next\nmessage. RUNNING: a turn is executing. CLOSED: the conversation is done and\nits sandbox/snapshots are torn down.",
1173
+ "enum": [
1174
+ "idle",
1175
+ "running",
1176
+ "closed"
1177
+ ],
1178
+ "title": "SessionState",
1179
+ "type": "string"
1180
+ },
1181
+ "SessionSurface": {
1182
+ "description": "The three fields we expose. All `None` for an un-keyed (laptop) session.\n\n`use_enum_values=True` (from CustomBaseModel) stores the members as their\nstring values, so this serializes to `{\"session\": \"alive\", \"run\": \"waiting\",\n\"status\": \"waiting\"}` \u2014 a plain object, not enum names.",
1183
+ "properties": {
1184
+ "run": {
1185
+ "anyOf": [
1186
+ {
1187
+ "$ref": "#/$defs/RunStatus"
1188
+ },
1189
+ {
1190
+ "type": "null"
1191
+ }
1192
+ ]
1193
+ },
1194
+ "session": {
1195
+ "anyOf": [
1196
+ {
1197
+ "$ref": "#/$defs/SessionLiveness"
1198
+ },
1199
+ {
1200
+ "type": "null"
1201
+ }
1202
+ ]
1203
+ },
1204
+ "status": {
1205
+ "anyOf": [
1206
+ {
1207
+ "type": "string"
1208
+ },
1209
+ {
1210
+ "type": "null"
1211
+ }
1212
+ ],
1213
+ "title": "Status"
1214
+ }
1215
+ },
1216
+ "required": [
1217
+ "run",
1218
+ "session",
1219
+ "status"
1220
+ ],
1221
+ "title": "SessionSurface",
1222
+ "type": "object"
1223
+ },
1224
+ "SnapshotFrame": {
1225
+ "description": "First frame after accept. Lean: session + open inbox only \u2014 records\nalways arrive via records_append (\u00a73.4).",
1226
+ "properties": {
1227
+ "earliest_feed_seq": {
1228
+ "anyOf": [
1229
+ {
1230
+ "type": "integer"
1231
+ },
1232
+ {
1233
+ "type": "null"
1234
+ }
1235
+ ],
1236
+ "title": "Earliest Feed Seq"
1237
+ },
1238
+ "messages": {
1239
+ "items": {
1240
+ "$ref": "#/$defs/SessionMessageWire"
1241
+ },
1242
+ "title": "Messages",
1243
+ "type": "array"
1244
+ },
1245
+ "protocol": {
1246
+ "default": 2,
1247
+ "title": "Protocol",
1248
+ "type": "integer"
1249
+ },
1250
+ "session": {
1251
+ "$ref": "#/$defs/AgentSessionWire"
1252
+ },
1253
+ "type": {
1254
+ "const": "snapshot",
1255
+ "default": "snapshot",
1256
+ "title": "Type",
1257
+ "type": "string"
1258
+ }
1259
+ },
1260
+ "required": [
1261
+ "earliest_feed_seq",
1262
+ "messages",
1263
+ "protocol",
1264
+ "session",
1265
+ "type"
1266
+ ],
1267
+ "title": "SnapshotFrame",
1268
+ "type": "object"
1269
+ },
1270
+ "TokensInfo": {
1271
+ "properties": {
1272
+ "cache_creation_input_tokens": {
1273
+ "default": 0,
1274
+ "title": "Cache Creation Input Tokens",
1275
+ "type": "integer"
1276
+ },
1277
+ "cache_read_input_tokens": {
1278
+ "default": 0,
1279
+ "title": "Cache Read Input Tokens",
1280
+ "type": "integer"
1281
+ },
1282
+ "cost_usd": {
1283
+ "default": 0,
1284
+ "title": "Cost Usd",
1285
+ "type": "number"
1286
+ },
1287
+ "initial_system_prompt_tokens": {
1288
+ "default": 0,
1289
+ "title": "Initial System Prompt Tokens",
1290
+ "type": "integer"
1291
+ },
1292
+ "input_tokens": {
1293
+ "default": 0,
1294
+ "title": "Input Tokens",
1295
+ "type": "integer"
1296
+ },
1297
+ "num_turns": {
1298
+ "default": 0,
1299
+ "title": "Num Turns",
1300
+ "type": "integer"
1301
+ },
1302
+ "output_tokens": {
1303
+ "default": 0,
1304
+ "title": "Output Tokens",
1305
+ "type": "integer"
1306
+ },
1307
+ "per_model": {
1308
+ "additionalProperties": {
1309
+ "$ref": "#/$defs/ModelTokensInfo"
1310
+ },
1311
+ "default": {},
1312
+ "title": "Per Model",
1313
+ "type": "object"
1314
+ },
1315
+ "per_turn": {
1316
+ "default": [],
1317
+ "items": {
1318
+ "$ref": "#/$defs/TurnTokensInfo"
1319
+ },
1320
+ "title": "Per Turn",
1321
+ "type": "array"
1322
+ },
1323
+ "thinking_tokens": {
1324
+ "default": 0,
1325
+ "title": "Thinking Tokens",
1326
+ "type": "integer"
1327
+ }
1328
+ },
1329
+ "required": [
1330
+ "cache_creation_input_tokens",
1331
+ "cache_read_input_tokens",
1332
+ "cost_usd",
1333
+ "initial_system_prompt_tokens",
1334
+ "input_tokens",
1335
+ "num_turns",
1336
+ "output_tokens",
1337
+ "per_model",
1338
+ "per_turn",
1339
+ "thinking_tokens"
1340
+ ],
1341
+ "title": "TokensInfo",
1342
+ "type": "object"
1343
+ },
1344
+ "TurnTokensInfo": {
1345
+ "properties": {
1346
+ "cache_creation_input_tokens": {
1347
+ "default": 0,
1348
+ "title": "Cache Creation Input Tokens",
1349
+ "type": "integer"
1350
+ },
1351
+ "cache_read_input_tokens": {
1352
+ "default": 0,
1353
+ "title": "Cache Read Input Tokens",
1354
+ "type": "integer"
1355
+ },
1356
+ "input_tokens": {
1357
+ "default": 0,
1358
+ "title": "Input Tokens",
1359
+ "type": "integer"
1360
+ },
1361
+ "output_tokens": {
1362
+ "default": 0,
1363
+ "title": "Output Tokens",
1364
+ "type": "integer"
1365
+ }
1366
+ },
1367
+ "required": [
1368
+ "cache_creation_input_tokens",
1369
+ "cache_read_input_tokens",
1370
+ "input_tokens",
1371
+ "output_tokens"
1372
+ ],
1373
+ "title": "TurnTokensInfo",
1374
+ "type": "object"
1375
+ },
1376
+ "WebhookType": {
1377
+ "enum": [
1378
+ "github.issue",
1379
+ "github.issue_comment",
1380
+ "github.push",
1381
+ "github.pull_request",
1382
+ "github.pull_request_comment",
1383
+ "github.pull_request_review",
1384
+ "github.pull_request_review_comment",
1385
+ "slack.app_mention",
1386
+ "slack.message",
1387
+ "slack.channel_created",
1388
+ "linear.issue",
1389
+ "linear.issue_comment",
1390
+ "sentry.event_alert",
1391
+ "sentry.metric_alert",
1392
+ "user.message"
1393
+ ],
1394
+ "title": "WebhookType",
1395
+ "type": "string"
1396
+ }
1397
+ },
1398
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1399
+ "description": "One server-to-client frame of the Ellipsis session stream protocol v2 (WS /v1/sessions/{id}/stream?protocol=2). Clients MUST ignore frames with unknown `type` values \u2014 additive frames are not a protocol break.",
1400
+ "oneOf": [
1401
+ {
1402
+ "$ref": "#/$defs/SnapshotFrame"
1403
+ },
1404
+ {
1405
+ "$ref": "#/$defs/RecordsAppendFrame"
1406
+ },
1407
+ {
1408
+ "$ref": "#/$defs/MessagesFrame"
1409
+ },
1410
+ {
1411
+ "$ref": "#/$defs/SessionFrame"
1412
+ },
1413
+ {
1414
+ "$ref": "#/$defs/DeltaFrame"
1415
+ },
1416
+ {
1417
+ "$ref": "#/$defs/HeartbeatFrame"
1418
+ },
1419
+ {
1420
+ "$ref": "#/$defs/DoneFrame"
1421
+ },
1422
+ {
1423
+ "$ref": "#/$defs/ErrorFrame"
1424
+ }
1425
+ ],
1426
+ "title": "SessionStreamFrame"
1427
+ }