Repository navigation
Expand file tree
/
Copy pathasyncapi.yaml
More file actions
1524 lines (1514 loc) · 51.6 KB
/
Copy pathasyncapi.yaml
File metadata and controls
1524 lines (1514 loc) · 51.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
asyncapi: 3.1.0
info:
title: OpenBot live channels
version: 0.1.0
license:
name: MIT
url: https://opensource.org/license/mit
description: >-
Everything live in OpenBot runs on WebSockets, and this file describes
every one of them: a Bot's run as it streams into a conversation, what
changed in a person's conversations, a Bot's screen, its terminal, a voice
call, and what the Recorder captures. It is the companion of
api/openapi.yaml, which describes the REST API, and
the two are one API: the REST operations hand out what a socket needs, and
the sockets carry what changes afterwards.
A run streams through CopilotKit Intelligence's realtime gateway, which
OpenBot uses as it ships, and so does what the Recorder captures. A voice
call's socket is the voice service's own. The other sockets are served by
OpenBot itself, under the organization's address like every REST resource
(/api/v2/organizations/{organizationId}/...), and are signed in to the
same three ways: the web app's session, an API key, or an app's access
token. A browser cannot set a header on a WebSocket, so the web app uses
its session; everything else sends Authorization: Bearer on the request
that opens the socket.
A voice call that the server sets up over WebRTC has no socket to
describe: its audio and its events travel on a peer connection, which is
outside what AsyncAPI describes. The REST operation that starts a call
says which of the two a deployment uses.
Every operation is written from the server's side, as AsyncAPI has it:
`send` is a message the server sends and a client receives, `receive` is a
message a client sends.
This file is the single source of truth for the sockets. A change that
breaks an existing client fails the pull request, and the frames a real
server sends are checked against it.
defaultContentType: application/json
servers:
openbot:
host: 127.0.0.1:3001
protocol: ws
description: >-
An OpenBot server on this machine (the default local port). The sockets
are on the same address as the REST API, over wss wherever the API is
served over https.
security:
- $ref: "#/components/securitySchemes/webSession"
intelligenceGateway:
host: 127.0.0.1:4401
pathname: /client
protocol: ws
description: >-
CopilotKit Intelligence's realtime gateway, where runs stream. Its
address is never configured in a client: the REST answer that carries a
join token carries the address to dial with it (realtime.clientUrl).
Where Intelligence runs beside an OpenBot, that address is OpenBot's
own, so a client dials one host: either /api/intelligence/client, which
OpenBot relays, or /client, which the deployment's edge sends straight
to the gateway. The relayed address also asks who is connecting, with
the same credential that made the join token: the web app's session, an
app's access token (conversations:read) or an API key, the last two as
Authorization: Bearer on the request that opens the socket, or a key in
an x-api-key header. So a script that holds only an API key mints a
join token with it and opens the socket with it. A credential that is
not valid is answered 401 before the socket opens. A join token the
gateway refuses, because it was used already or has expired, closes the
relayed socket with code 1008 and the reason "This join token has been
used or has expired. Ask for a new one."; 1011 means the gateway could
not be reached at all.
security:
- $ref: "#/components/securitySchemes/joinToken"
voiceService:
host: api.x.ai
pathname: /v1/realtime
protocol: wss
description: >-
The voice service's realtime socket, for a deployment whose calls run on
Grok Voice. It is not OpenBot's: a client dials it directly, with the
address and the one-call secret the REST operation that starts a call
answers, and OpenBot carries none of the audio.
security:
- $ref: "#/components/securitySchemes/voiceClientSecret"
channels:
conversationEvents:
address: /api/v2/organizations/{organizationId}/conversation-events
title: Conversation events
description: >-
What changed in the signed-in person's conversations, as it happens: a
new message, a Bot starting or finishing work, a rename, a pin, a
removal. One socket per signed-in person and tab. The server only ever
sends; anything a client sends is ignored. Nothing is replayed: on
opening the socket, and again on a resync message, a client reads its
conversations afresh over REST.
servers:
- $ref: "#/servers/openbot"
parameters:
organizationId:
$ref: "#/components/parameters/organizationId"
bindings:
ws:
method: GET
bindingVersion: 0.1.0
messages:
conversationActivity:
$ref: "#/components/messages/ConversationActivity"
conversationResync:
$ref: "#/components/messages/ConversationResync"
botScreen:
address: /api/v2/organizations/{organizationId}/computers/{botId}/screen
title: A Bot's screen
description: >-
The screen of a Bot's computer, live, and the person's mouse and
keyboard going back to it. Frames are whole pictures, so a viewer shows
the newest and needs nothing before it. Input is taken only while the
person has control of the computer. One viewer at a time per person and
Bot: a newer one replaces the older, which is told so. An app whose
access token may watch a Bot's computer and not use it (computers:read
without computers:write) is sent the screen, and its input is answered
with an input error and goes no further.
servers:
- $ref: "#/servers/openbot"
parameters:
organizationId:
$ref: "#/components/parameters/organizationId"
botId:
$ref: "#/components/parameters/botId"
bindings:
ws:
method: GET
bindingVersion: 0.1.0
messages:
screenHello:
$ref: "#/components/messages/ScreenHello"
screenFrame:
$ref: "#/components/messages/ScreenFrame"
screenError:
$ref: "#/components/messages/ScreenError"
screenInputError:
$ref: "#/components/messages/ScreenInputError"
screenFrameReceived:
$ref: "#/components/messages/ScreenFrameReceived"
screenMouse:
$ref: "#/components/messages/ScreenMouse"
screenWheel:
$ref: "#/components/messages/ScreenWheel"
screenKey:
$ref: "#/components/messages/ScreenKey"
screenText:
$ref: "#/components/messages/ScreenText"
botTerminal:
address: /api/v2/organizations/{organizationId}/computers/{botId}/terminal
title: A Bot's terminal
description: >-
The terminal on a Bot's computer. The terminal's own bytes arrive as
binary frames; everything else is a JSON text frame. A snapshot message
means "clear, and draw what follows", and ready means the viewer is live.
Typing is taken only while the person has control of the computer. An
app whose access token may watch a Bot's computer and not use it is sent
the terminal, and its typing and resizing are answered with an error and
go no further.
servers:
- $ref: "#/servers/openbot"
parameters:
organizationId:
$ref: "#/components/parameters/organizationId"
botId:
$ref: "#/components/parameters/botId"
bindings:
ws:
method: GET
bindingVersion: 0.1.0
messages:
terminalOutput:
$ref: "#/components/messages/TerminalOutput"
terminalSnapshot:
$ref: "#/components/messages/TerminalSnapshot"
terminalReady:
$ref: "#/components/messages/TerminalReady"
terminalError:
$ref: "#/components/messages/TerminalError"
terminalInput:
$ref: "#/components/messages/TerminalInput"
terminalResize:
$ref: "#/components/messages/TerminalResize"
terminalAck:
$ref: "#/components/messages/TerminalAck"
threadStream:
address: /websocket
title: A conversation's runs
description: >-
A Bot's runs in one conversation thread, as AG-UI events, on the
gateway's socket for clients. The socket speaks the Phoenix Channels
protocol, version 2: every frame is a JSON array of five items, [join
reference, reference, topic, event, payload]. The topic is the one the
REST answer gave as realtime.topic, and a join token opens exactly one
thread. The topic names the thread as the gateway knows it, which in an
organization other than default is not the threadId a client has, so a
client uses the topic as given and never makes one from threadId.
A client joins the topic, and the gateway answers with connected, then
replays what the thread already holds as ag_ui_event messages, then says
replay_complete, and from there on sends events as they happen. A run in
progress is replayed from its start, so a reload, or a second tab or
device of the same person, shows the whole of it. Every event carries an
id (metadata.cpki_event_id): a client that reconnects sends the last one
it saw and is sent only what came after, and it drops any id it has
already drawn.
servers:
- $ref: "#/servers/intelligenceGateway"
bindings:
ws:
method: GET
query:
type: object
required:
- join_token
- vsn
properties:
join_token:
type: string
description: >-
The join token from the REST answer. It works once and for
about half a minute, so every connection, and every
reconnection, starts with a new one.
vsn:
type: string
const: 2.0.0
description: The Phoenix Channels protocol version.
bindingVersion: 0.1.0
messages:
threadJoin:
$ref: "#/components/messages/ThreadJoin"
threadReply:
$ref: "#/components/messages/ThreadReply"
threadHeartbeat:
$ref: "#/components/messages/ThreadHeartbeat"
threadConnected:
$ref: "#/components/messages/ThreadConnected"
threadAgUiEvent:
$ref: "#/components/messages/ThreadAgUiEvent"
threadReplayComplete:
$ref: "#/components/messages/ThreadReplayComplete"
threadStreamIdle:
$ref: "#/components/messages/ThreadStreamIdle"
threadReplayFailed:
$ref: "#/components/messages/ThreadReplayFailed"
threadExpired:
$ref: "#/components/messages/ThreadExpired"
threadStopRun:
$ref: "#/components/messages/ThreadStopRun"
threadLeave:
$ref: "#/components/messages/ThreadLeave"
threadClose:
$ref: "#/components/messages/ThreadClose"
threadError:
$ref: "#/components/messages/ThreadError"
trajectoryCapture:
address: /websocket
title: What the Recorder captures
description: >-
The Recorder sending what a person does in their browser, as they record
it, on the gateway's socket for clients: the same socket and frames as a
conversation's runs, on the topic trajectory:{trajectoryId}. The
Recorder asks OpenBot for a pass first, which carries a join token for
one trajectory and the address to dial, and asks again for every
connection. It joins the topic, then sends its events in batches, each
answered by a reply; a batch with no reply is sent again, and the
gateway drops what it already holds by each event's sequence number.
servers:
- $ref: "#/servers/intelligenceGateway"
bindings:
ws:
method: GET
query:
type: object
required:
- join_token
- vsn
properties:
join_token:
type: string
description: The join token from the Recorder's pass. It works once.
vsn:
type: string
const: 2.0.0
description: The Phoenix Channels protocol version.
bindingVersion: 0.1.0
messages:
trajectoryJoin:
$ref: "#/components/messages/TrajectoryJoin"
trajectoryEvents:
$ref: "#/components/messages/TrajectoryEvents"
trajectoryReply:
$ref: "#/components/messages/TrajectoryReply"
voiceCall:
address: /
title: A voice call
description: >-
A call with a Bot on the voice service's realtime socket: the person's
audio in, the Bot's audio and its words out, as JSON events. Every event
has a type, and the events are the voice service's own, described in its
documentation (https://docs.x.ai/docs/guides/voice). A client sends
session.update first, with the session the REST answer carried, then
input_audio_buffer.append with the person's audio as base64 PCM at
24 kHz, input_audio_buffer.clear when muted, and
conversation.item.truncate when the person talks over the Bot. It
receives, among others, session.updated, response.created,
input_audio_buffer.speech_started, response.output_audio.delta with the
Bot's audio, and response.output_audio_transcript.delta and .done with
its words.
servers:
- $ref: "#/servers/voiceService"
bindings:
ws:
method: GET
query:
type: object
required:
- model
properties:
model:
type: string
description: The voice model, as the REST answer's address names it.
bindingVersion: 0.1.0
messages:
voiceClientEvent:
$ref: "#/components/messages/VoiceClientEvent"
voiceServiceEvent:
$ref: "#/components/messages/VoiceServiceEvent"
operations:
sendConversationEvents:
action: send
title: Tell a person what changed in their conversations
summary: A conversation the person is in changed, or everything may have.
security:
- $ref: "#/components/securitySchemes/webSession"
- $ref: "#/components/securitySchemes/apiKey"
- $ref: "#/components/securitySchemes/conversationsRead"
channel:
$ref: "#/channels/conversationEvents"
messages:
- $ref: "#/channels/conversationEvents/messages/conversationActivity"
- $ref: "#/channels/conversationEvents/messages/conversationResync"
sendBotScreen:
action: send
title: Show a Bot's screen
summary: The screen's pictures, and why something could not be shown or done.
security:
- $ref: "#/components/securitySchemes/webSession"
- $ref: "#/components/securitySchemes/apiKey"
- $ref: "#/components/securitySchemes/computersRead"
channel:
$ref: "#/channels/botScreen"
messages:
- $ref: "#/channels/botScreen/messages/screenHello"
- $ref: "#/channels/botScreen/messages/screenFrame"
- $ref: "#/channels/botScreen/messages/screenError"
- $ref: "#/channels/botScreen/messages/screenInputError"
receiveBotScreenInput:
action: receive
title: Take a person's mouse and keyboard
summary: The person's input to the Bot's computer, and each picture's receipt.
security:
- $ref: "#/components/securitySchemes/webSession"
- $ref: "#/components/securitySchemes/apiKey"
- $ref: "#/components/securitySchemes/computersWrite"
channel:
$ref: "#/channels/botScreen"
messages:
- $ref: "#/channels/botScreen/messages/screenFrameReceived"
- $ref: "#/channels/botScreen/messages/screenMouse"
- $ref: "#/channels/botScreen/messages/screenWheel"
- $ref: "#/channels/botScreen/messages/screenKey"
- $ref: "#/channels/botScreen/messages/screenText"
sendBotTerminal:
action: send
title: Show a Bot's terminal
summary: The terminal's bytes, and when to clear, when it is live and what went wrong.
security:
- $ref: "#/components/securitySchemes/webSession"
- $ref: "#/components/securitySchemes/apiKey"
- $ref: "#/components/securitySchemes/computersRead"
channel:
$ref: "#/channels/botTerminal"
messages:
- $ref: "#/channels/botTerminal/messages/terminalOutput"
- $ref: "#/channels/botTerminal/messages/terminalSnapshot"
- $ref: "#/channels/botTerminal/messages/terminalReady"
- $ref: "#/channels/botTerminal/messages/terminalError"
receiveBotTerminalInput:
action: receive
title: Take a person's typing
summary: What the person typed, the size of their terminal, and how much they have drawn.
security:
- $ref: "#/components/securitySchemes/webSession"
- $ref: "#/components/securitySchemes/apiKey"
- $ref: "#/components/securitySchemes/computersWrite"
channel:
$ref: "#/channels/botTerminal"
messages:
- $ref: "#/channels/botTerminal/messages/terminalInput"
- $ref: "#/channels/botTerminal/messages/terminalResize"
- $ref: "#/channels/botTerminal/messages/terminalAck"
sendThreadStream:
action: send
title: Stream a conversation's runs
summary: The thread's AG-UI events, replayed and then live, with the markers between.
channel:
$ref: "#/channels/threadStream"
messages:
- $ref: "#/channels/threadStream/messages/threadReply"
- $ref: "#/channels/threadStream/messages/threadConnected"
- $ref: "#/channels/threadStream/messages/threadAgUiEvent"
- $ref: "#/channels/threadStream/messages/threadReplayComplete"
- $ref: "#/channels/threadStream/messages/threadStreamIdle"
- $ref: "#/channels/threadStream/messages/threadReplayFailed"
- $ref: "#/channels/threadStream/messages/threadExpired"
- $ref: "#/channels/threadStream/messages/threadClose"
- $ref: "#/channels/threadStream/messages/threadError"
receiveThreadCommands:
action: receive
title: Join a thread, keep the socket alive, stop a run, leave
summary: What a client sends on the gateway's socket.
channel:
$ref: "#/channels/threadStream"
messages:
- $ref: "#/channels/threadStream/messages/threadJoin"
- $ref: "#/channels/threadStream/messages/threadHeartbeat"
- $ref: "#/channels/threadStream/messages/threadStopRun"
- $ref: "#/channels/threadStream/messages/threadLeave"
receiveTrajectoryEvents:
action: receive
title: Take what the Recorder captured
summary: The Recorder joins a trajectory's topic and sends its events in batches.
channel:
$ref: "#/channels/trajectoryCapture"
messages:
- $ref: "#/channels/trajectoryCapture/messages/trajectoryJoin"
- $ref: "#/channels/trajectoryCapture/messages/trajectoryEvents"
sendTrajectoryReplies:
action: send
title: Answer the Recorder
summary: The gateway's answer to a join and to each batch.
channel:
$ref: "#/channels/trajectoryCapture"
messages:
- $ref: "#/channels/trajectoryCapture/messages/trajectoryReply"
receiveVoiceCall:
action: receive
title: Take a person's side of a call
summary: The session, the person's audio, and what they interrupt.
channel:
$ref: "#/channels/voiceCall"
messages:
- $ref: "#/channels/voiceCall/messages/voiceClientEvent"
sendVoiceCall:
action: send
title: Send a Bot's side of a call
summary: The Bot's audio and words, and what the voice service heard.
channel:
$ref: "#/channels/voiceCall"
messages:
- $ref: "#/channels/voiceCall/messages/voiceServiceEvent"
components:
securitySchemes:
webSession:
type: httpApiKey
in: cookie
name: better-auth.session_token
description: >-
The web app's server-side session, sent with the request that opens
the socket. Served over HTTPS the cookie is
__Secure-better-auth.session_token. A single-user install signs its
one person in without a cookie. A request from another site is
refused before the socket opens.
apiKey:
type: http
scheme: bearer
description: >-
An API key a person made for automation, sent as Authorization:
Bearer on the request that opens the socket. It acts as that person,
with everything they may do.
conversationsRead:
type: oauth2
description: >-
An access token one of OpenBot's apps holds (Desktop, mobile, the
CLI), from OAuth 2.1 authorization code with PKCE, sent as
Authorization: Bearer on the request that opens the socket. The
person allowed the app to see their conversations.
flows:
authorizationCode:
authorizationUrl: http://127.0.0.1:3001/api/auth/oauth2/authorize
tokenUrl: http://127.0.0.1:3001/api/auth/oauth2/token
refreshUrl: http://127.0.0.1:3001/api/auth/oauth2/token
availableScopes:
conversations:read: Read the signed-in person's conversations, and watch a Bot's runs in them.
scopes:
- conversations:read
computersRead:
type: oauth2
description: >-
An app's access token, as above. The person allowed the app to watch
their Bots' screens and terminals.
flows:
authorizationCode:
authorizationUrl: http://127.0.0.1:3001/api/auth/oauth2/authorize
tokenUrl: http://127.0.0.1:3001/api/auth/oauth2/token
refreshUrl: http://127.0.0.1:3001/api/auth/oauth2/token
availableScopes:
computers:read: Watch the signed-in person's Bots' screens and terminals.
computers:write: Use the mouse and keyboard on the signed-in person's Bots' computers.
scopes:
- computers:read
computersWrite:
type: oauth2
description: >-
An app's access token, as above. The person allowed the app to use
their Bots' computers as well as watch them.
flows:
authorizationCode:
authorizationUrl: http://127.0.0.1:3001/api/auth/oauth2/authorize
tokenUrl: http://127.0.0.1:3001/api/auth/oauth2/token
refreshUrl: http://127.0.0.1:3001/api/auth/oauth2/token
availableScopes:
computers:read: Watch the signed-in person's Bots' screens and terminals.
computers:write: Use the mouse and keyboard on the signed-in person's Bots' computers.
scopes:
- computers:read
- computers:write
joinToken:
type: httpApiKey
in: query
name: join_token
description: >-
A join token for one thread or one trajectory, handed out by OpenBot
to somebody who may have it. It works once and for about half a
minute.
voiceClientSecret:
type: httpApiKey
in: header
name: Sec-WebSocket-Protocol
description: >-
The one-call secret from the REST operation that starts a call, sent
as the socket's subprotocol: xai-client-secret.{secret}.
parameters:
organizationId:
description: >-
The organization, by its id or its slug, which the caller must be a
member of. One the caller is not in answers as one that does not
exist, default included.
botId:
description: The Bot whose computer it is.
messages:
ConversationActivity:
name: conversationActivity
title: Conversation activity
summary: One conversation changed.
payload:
$ref: "#/components/schemas/ConversationActivity"
ConversationResync:
name: conversationResync
title: Resync
summary: >-
Changes may have been missed, and they cannot be sent again. Read the
conversations afresh.
payload:
$ref: "#/components/schemas/ConversationResync"
ScreenHello:
name: screenHello
title: Hello
summary: The first message, saying how the stream is paced.
payload:
$ref: "#/components/schemas/ScreenHello"
ScreenFrame:
name: screenFrame
title: Frame
summary: The screen as it is now, as one picture.
payload:
$ref: "#/components/schemas/ScreenFrame"
ScreenError:
name: screenError
title: Screen error
summary: The screen cannot be shown, and why.
payload:
$ref: "#/components/schemas/ScreenError"
ScreenInputError:
name: screenInputError
title: Input error
summary: The person's input was not applied, and why.
payload:
$ref: "#/components/schemas/ScreenInputError"
ScreenFrameReceived:
name: screenFrameReceived
title: Frame received
summary: >-
The viewer drew a frame and is ready for the next. Sent once per frame
when hello said frames are confirmed.
payload:
$ref: "#/components/schemas/ScreenFrameReceived"
ScreenMouse:
name: screenMouse
title: Mouse
summary: A mouse button pressed or released, or the pointer moved.
payload:
$ref: "#/components/schemas/ScreenMouse"
ScreenWheel:
name: screenWheel
title: Wheel
summary: The wheel turned.
payload:
$ref: "#/components/schemas/ScreenWheel"
ScreenKey:
name: screenKey
title: Key
summary: A key went down or came up.
payload:
$ref: "#/components/schemas/ScreenKey"
ScreenText:
name: screenText
title: Text
summary: Text to type as it is, such as a paste.
payload:
$ref: "#/components/schemas/ScreenText"
TerminalOutput:
name: terminalOutput
title: Terminal output
summary: The terminal's own bytes, in a binary frame, to write as they are.
contentType: application/octet-stream
payload:
type: string
format: binary
TerminalSnapshot:
name: terminalSnapshot
title: Snapshot
summary: Clear the terminal; the bytes that follow draw it as it is now.
payload:
$ref: "#/components/schemas/TerminalSnapshot"
TerminalReady:
name: terminalReady
title: Ready
summary: The snapshot is over and the viewer is live.
payload:
$ref: "#/components/schemas/TerminalReady"
TerminalError:
name: terminalError
title: Terminal error
summary: Something was refused or failed, and whether trying again can help.
payload:
$ref: "#/components/schemas/TerminalError"
TerminalInput:
name: terminalInput
title: Input
summary: What the person typed.
payload:
$ref: "#/components/schemas/TerminalInput"
TerminalResize:
name: terminalResize
title: Resize
summary: The size the viewer's terminal fits, which the shell takes.
payload:
$ref: "#/components/schemas/TerminalResize"
TerminalAck:
name: terminalAck
title: Acknowledge
summary: How many bytes the viewer has drawn since it last said, which paces the output.
payload:
$ref: "#/components/schemas/TerminalAck"
ThreadJoin:
name: threadJoin
title: Join a thread
summary: Ask for the thread's events, from the start or from the last one seen.
payload:
$ref: "#/components/schemas/ThreadJoinFrame"
ThreadReply:
name: threadReply
title: Reply
summary: The gateway's answer to a join, a heartbeat or a stop.
payload:
$ref: "#/components/schemas/ThreadReplyFrame"
ThreadHeartbeat:
name: threadHeartbeat
title: Heartbeat
summary: Keeps the socket open. Sent at least every 30 seconds.
payload:
$ref: "#/components/schemas/ThreadHeartbeatFrame"
ThreadConnected:
name: threadConnected
title: Connected
summary: The join was accepted; the replay follows.
payload:
$ref: "#/components/schemas/ThreadConnectedFrame"
ThreadAgUiEvent:
name: threadAgUiEvent
title: AG-UI event
summary: One event of a run, replayed or live.
payload:
$ref: "#/components/schemas/ThreadAgUiEventFrame"
ThreadReplayComplete:
name: threadReplayComplete
title: Replay complete
summary: Everything the thread already held has been sent; what follows is live.
payload:
$ref: "#/components/schemas/ThreadReplayCompleteFrame"
ThreadStreamIdle:
name: threadStreamIdle
title: Stream idle
summary: No run is in progress in the thread.
payload:
$ref: "#/components/schemas/ThreadStreamIdleFrame"
ThreadReplayFailed:
name: threadReplayFailed
title: Replay failed
summary: The thread's events could not be replayed. Read its messages over REST and join again.
payload:
$ref: "#/components/schemas/ThreadReplayFailedFrame"
ThreadExpired:
name: threadExpired
title: Expired
summary: The connection's time is up. Ask for a new join token and connect again.
payload:
$ref: "#/components/schemas/ThreadExpiredFrame"
ThreadStopRun:
name: threadStopRun
title: Stop a run
summary: Stop the run in progress, keeping what it has written.
payload:
$ref: "#/components/schemas/ThreadStopRunFrame"
ThreadLeave:
name: threadLeave
title: Leave a thread
summary: Stop receiving the thread's events, keeping the socket.
payload:
$ref: "#/components/schemas/ThreadLeaveFrame"
ThreadClose:
name: threadClose
title: Closed
summary: The gateway closed the thread's topic, after a leave or at the end of the connection's time.
payload:
$ref: "#/components/schemas/ThreadCloseFrame"
ThreadError:
name: threadError
title: Topic error
summary: The thread's topic failed on the gateway. Ask for a new join token and connect again.
payload:
$ref: "#/components/schemas/ThreadErrorFrame"
TrajectoryJoin:
name: trajectoryJoin
title: Join a trajectory
summary: Open the trajectory's topic before sending to it.
payload:
$ref: "#/components/schemas/TrajectoryJoinFrame"
TrajectoryEvents:
name: trajectoryEvents
title: Captured events
summary: One batch of what the person did, oldest first.
payload:
$ref: "#/components/schemas/TrajectoryEventsFrame"
TrajectoryReply:
name: trajectoryReply
title: Reply
summary: Whether the join or the batch was taken.
payload:
$ref: "#/components/schemas/TrajectoryReplyFrame"
VoiceClientEvent:
name: voiceClientEvent
title: An event from the person's side
summary: The session, the person's audio, a mute, or an interruption.
payload:
$ref: "#/components/schemas/VoiceEvent"
VoiceServiceEvent:
name: voiceServiceEvent
title: An event from the voice service
summary: The Bot's audio or words, or what the service heard and did.
payload:
$ref: "#/components/schemas/VoiceEvent"
schemas:
ConversationActivity:
type: object
description: >-
One conversation changed. Every message carries the conversation's
newest message; the optional members say what else this one is about.
required:
- channelId
- memberIds
- lastMessage
- lastMessageAt
- lastMessageAgentId
properties:
channelId:
type: string
description: The conversation.
memberIds:
type: array
description: The people this message was sent to.
items:
type: string
lastMessage:
type:
- string
- "null"
description: The newest message's text on one line, or null when there is none.
lastMessageAt:
type:
- string
- "null"
format: date-time
description: When the newest message was written.
lastMessageAgentId:
type:
- string
- "null"
description: The Bot that wrote the newest message, or null when a person did.
firstLine:
type: string
description: A Bot's reply, its first line as plain text. Only on a Bot's message.
summary:
type:
- string
- "null"
description: What the conversation is called now. Null when its name was cleared.
opening:
type: string
description: A person's first words, which name the conversation until it has a summary.
deleted:
type: boolean
const: true
description: The conversation was removed for everybody in it.
pinned:
type: boolean
description: This person pinned or unpinned the conversation.
busy:
type: boolean
description: A turn started (true) or ended (false) in the conversation.
work:
type: array
description: >-
Everything the conversation is waiting on right now, the whole
list. Sent only to the person whose work it is.
items:
$ref: "#/components/schemas/ConversationWork"
workAt:
type: string
description: >-
When work was read, in UTC to the microsecond and of fixed width,
so two compare as text. Messages can arrive out of order: keep the
list with the latest stamp.
ConversationWork:
type: object
description: Something a conversation is waiting on.
required:
- kind
- key
- botId
- botName
- since
properties:
kind:
type: string
enum:
- handoff
- routine
description: A Bot that was asked and has not answered yet, or a routine that is running.
key:
type: string
description: Stable for this piece of work, so two asks of one Bot are two entries.
botId:
type: string
description: The Bot that was asked, or the Bot the routine runs as.
botName:
type:
- string
- "null"
description: The Bot's name when the work started.
routineId:
type: string
description: The routine. Only on a routine.
since:
type: string
format: date-time
description: When the work started.
ConversationResync:
type: object
required:
- resync
additionalProperties: false
properties:
resync:
type: boolean
const: true
ScreenHello:
type: object
required:
- type
- confirmFrames
properties:
type:
type: string
const: hello
confirmFrames:
type: boolean
description: >-
When true, the next frame is sent only after the viewer says it
received the last.
ScreenFrame:
type: object
required:
- type
- data
- width
- height
properties:
type:
type: string
const: frame
data:
type: string
contentEncoding: base64
contentMediaType: image/jpeg
description: The picture, a JPEG in base64.
width:
type: number
description: The screen's width in pixels, which mouse positions are measured in.
height:
type: number
description: The screen's height in pixels.
ScreenError:
type: object
required:
- type
- error
properties:
type:
type: string
const: error
error:
type: string
description: Why, in words a person can read.
ScreenInputError:
type: object
required:
- type
- error
properties:
type:
type: string
const: input-error
error:
type: string
description: Why, in words a person can read.
ScreenFrameReceived:
type: object
required:
- type
additionalProperties: false
properties:
type:
type: string
const: frame-received
ScreenMouse:
type: object
required:
- type
- event
- x
- "y"
properties:
type:
type: string
const: mouse
event:
type: string
enum:
- pressed
- released
- moved
x:
type: number
description: Across, in the screen's pixels.
"y":
type: number
description: Down, in the screen's pixels.
button:
type: string
enum:
- none
- left
- right
- middle
description: The button this is about; none for a move with nothing held.
buttons:
type: integer
description: "Every button held, as a sum: left 1, right 2, middle 4."
clickCount: