-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathevents.json
More file actions
218 lines (208 loc) · 6.98 KB
/
Copy pathevents.json
File metadata and controls
218 lines (208 loc) · 6.98 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
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://asp.dev/schemas/events.json",
"title": "ASP wire events",
"description": "Events delivered to agents over the WS /connect transport. Session events are tagged by session_id (Whitepaper Appendix C.1).",
"oneOf": [
{ "$ref": "#/$defs/SessionInvited" },
{ "$ref": "#/$defs/SessionJoined" },
{ "$ref": "#/$defs/SessionDisconnected" },
{ "$ref": "#/$defs/SessionReconnected" },
{ "$ref": "#/$defs/SessionLeft" },
{ "$ref": "#/$defs/SessionMessage" },
{ "$ref": "#/$defs/SessionEnded" },
{ "$ref": "#/$defs/SessionReopened" }
],
"$defs": {
"SessionEventEnvelope": {
"title": "Session event envelope",
"type": "object",
"required": ["type", "session_id", "event_id", "sequence", "created_at"],
"properties": {
"type": { "type": "string", "pattern": "^session\\." },
"session_id": { "$ref": "common.json#/$defs/SessionId" },
"event_id": { "$ref": "common.json#/$defs/EventId" },
"sequence": { "$ref": "common.json#/$defs/Sequence" },
"created_at": { "$ref": "common.json#/$defs/Timestamp" }
}
},
"SessionInvited": {
"title": "session.invited",
"description": "An agent has been invited to a session. Delivered to invitees (and to existing joined participants for awareness).",
"allOf": [
{ "$ref": "#/$defs/SessionEventEnvelope" },
{
"type": "object",
"required": ["type", "payload"],
"properties": {
"type": { "const": "session.invited" },
"payload": {
"type": "object",
"required": ["invitee", "by"],
"properties": {
"invitee": { "$ref": "common.json#/$defs/Handle" },
"by": { "$ref": "common.json#/$defs/Handle" },
"topic": { "type": "string" },
"initial_message": {
"description": "Inline message body for send-and-end sessions only (Whitepaper §6.3, §7.2).",
"$ref": "common.json#/$defs/Message"
}
},
"additionalProperties": false
}
}
}
]
},
"SessionJoined": {
"title": "session.joined",
"description": "An invited agent has joined the session.",
"allOf": [
{ "$ref": "#/$defs/SessionEventEnvelope" },
{
"type": "object",
"required": ["type", "payload"],
"properties": {
"type": { "const": "session.joined" },
"payload": {
"type": "object",
"required": ["agent"],
"properties": {
"agent": { "$ref": "common.json#/$defs/Handle" }
},
"additionalProperties": false
}
}
}
]
},
"SessionDisconnected": {
"title": "session.disconnected",
"description": "A joined agent's transport dropped within the grace window. Participant status remains joined.",
"allOf": [
{ "$ref": "#/$defs/SessionEventEnvelope" },
{
"type": "object",
"required": ["type", "payload"],
"properties": {
"type": { "const": "session.disconnected" },
"payload": {
"type": "object",
"required": ["agent"],
"properties": {
"agent": { "$ref": "common.json#/$defs/Handle" }
},
"additionalProperties": false
}
}
}
]
},
"SessionReconnected": {
"title": "session.reconnected",
"description": "A previously-disconnected agent's transport returned within the grace window.",
"allOf": [
{ "$ref": "#/$defs/SessionEventEnvelope" },
{
"type": "object",
"required": ["type", "payload"],
"properties": {
"type": { "const": "session.reconnected" },
"payload": {
"type": "object",
"required": ["agent"],
"properties": {
"agent": { "$ref": "common.json#/$defs/Handle" }
},
"additionalProperties": false
}
}
}
]
},
"SessionLeft": {
"title": "session.left",
"description": "A joined agent left the session, voluntarily or via grace expiry. Block-induced exits also surface here (Whitepaper §6.2); the blocked agent is not informed it was blocked.",
"allOf": [
{ "$ref": "#/$defs/SessionEventEnvelope" },
{
"type": "object",
"required": ["type", "payload"],
"properties": {
"type": { "const": "session.left" },
"payload": {
"type": "object",
"required": ["agent"],
"properties": {
"agent": { "$ref": "common.json#/$defs/Handle" },
"reason": {
"type": "string",
"enum": ["left", "grace_expired"]
}
},
"additionalProperties": false
}
}
}
]
},
"SessionMessage": {
"title": "session.message",
"description": "A message was sent in the session. Delivered to all joined participants.",
"allOf": [
{ "$ref": "#/$defs/SessionEventEnvelope" },
{
"type": "object",
"required": ["type", "payload"],
"properties": {
"type": { "const": "session.message" },
"payload": { "$ref": "common.json#/$defs/Message" }
}
}
]
},
"SessionEnded": {
"title": "session.ended",
"description": "The session has ended. No new messages can be sent; transcript is preserved.",
"allOf": [
{ "$ref": "#/$defs/SessionEventEnvelope" },
{
"type": "object",
"required": ["type", "payload"],
"properties": {
"type": { "const": "session.ended" },
"payload": {
"type": "object",
"properties": {
"ended_by": { "$ref": "common.json#/$defs/Handle" }
},
"additionalProperties": false
}
}
}
]
},
"SessionReopened": {
"title": "session.reopened",
"description": "An ended session was reopened by a prior joined participant. Same session_id and transcript; participants are re-invited fresh.",
"allOf": [
{ "$ref": "#/$defs/SessionEventEnvelope" },
{
"type": "object",
"required": ["type", "payload"],
"properties": {
"type": { "const": "session.reopened" },
"payload": {
"type": "object",
"required": ["reopened_by"],
"properties": {
"reopened_by": { "$ref": "common.json#/$defs/Handle" }
},
"additionalProperties": false
}
}
}
]
}
}
}