-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathasyncapi.yaml
More file actions
465 lines (443 loc) · 13.9 KB
/
asyncapi.yaml
File metadata and controls
465 lines (443 loc) · 13.9 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
asyncapi: 3.0.0
info:
title: GABP Events
version: 1.1.0
description: |
AsyncAPI specification for GABP (Game Agent Bridge Protocol) events.
This specification describes the event channels available in GABP for
real-time communication between game mods and automation bridges.
contact:
name: GABP Maintainers
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0.html
defaultContentType: application/json
channels:
events:
address: 'events/{channel}'
title: GABP Event Channel
description: Generic event channel for GABP events
parameters:
channel:
description: The event channel name (e.g., 'player/move', 'world/block_change')
schema:
type: string
pattern: '^[a-z]+(/[a-z_]+)*$'
examples:
- 'player/move'
- 'world/block_change'
- 'inventory/update'
messages:
eventMessage:
$ref: '#/components/messages/EventMessage'
'player/move':
address: 'player/move'
title: Player Movement Events
description: Events triggered when players move in the game world
messages:
playerMoveEvent:
$ref: '#/components/messages/PlayerMoveEvent'
'world/block_change':
address: 'world/block_change'
title: World Block Change Events
description: Events triggered when blocks are placed, broken, or modified
messages:
blockChangeEvent:
$ref: '#/components/messages/BlockChangeEvent'
'inventory/update':
address: 'inventory/update'
title: Inventory Update Events
description: Events triggered when player inventories change
messages:
inventoryUpdateEvent:
$ref: '#/components/messages/InventoryUpdateEvent'
'attention/opened':
address: 'attention/opened'
title: Attention Opened Events
description: Summarized attention items that just opened
messages:
attentionOpenedEvent:
$ref: '#/components/messages/AttentionOpenedEvent'
'attention/updated':
address: 'attention/updated'
title: Attention Updated Events
description: Meaningful updates to a currently open attention item
messages:
attentionUpdatedEvent:
$ref: '#/components/messages/AttentionUpdatedEvent'
'attention/cleared':
address: 'attention/cleared'
title: Attention Cleared Events
description: Attention items that were cleared or otherwise no longer gate execution
messages:
attentionClearedEvent:
$ref: '#/components/messages/AttentionClearedEvent'
operations:
subscribeToEvents:
action: receive
channel:
$ref: '#/channels/events'
summary: Subscribe to GABP events
description: |
Receive events from subscribed channels. Events are delivered in sequence
order per channel using the `seq` field.
components:
messages:
EventMessage:
name: EventMessage
title: GABP Event Message
summary: Base GABP event message format
contentType: application/json
payload:
$ref: '#/components/schemas/EventMessage'
PlayerMoveEvent:
name: PlayerMoveEvent
title: Player Movement Event
summary: Player position and movement update
contentType: application/json
payload:
allOf:
- $ref: '#/components/schemas/EventMessage'
- type: object
properties:
channel:
const: 'player/move'
payload:
$ref: '#/components/schemas/PlayerMovePayload'
BlockChangeEvent:
name: BlockChangeEvent
title: Block Change Event
summary: World block modification event
contentType: application/json
payload:
allOf:
- $ref: '#/components/schemas/EventMessage'
- type: object
properties:
channel:
const: 'world/block_change'
payload:
$ref: '#/components/schemas/BlockChangePayload'
InventoryUpdateEvent:
name: InventoryUpdateEvent
title: Inventory Update Event
summary: Player inventory change event
contentType: application/json
payload:
allOf:
- $ref: '#/components/schemas/EventMessage'
- type: object
properties:
channel:
const: 'inventory/update'
payload:
$ref: '#/components/schemas/InventoryUpdatePayload'
AttentionOpenedEvent:
name: AttentionOpenedEvent
title: Attention Opened Event
summary: A summarized attention item has opened
contentType: application/json
payload:
allOf:
- $ref: '#/components/schemas/EventMessage'
- type: object
properties:
channel:
const: 'attention/opened'
payload:
$ref: '#/components/schemas/AttentionPayload'
AttentionUpdatedEvent:
name: AttentionUpdatedEvent
title: Attention Updated Event
summary: A summarized attention item has changed meaningfully
contentType: application/json
payload:
allOf:
- $ref: '#/components/schemas/EventMessage'
- type: object
properties:
channel:
const: 'attention/updated'
payload:
$ref: '#/components/schemas/AttentionPayload'
AttentionClearedEvent:
name: AttentionClearedEvent
title: Attention Cleared Event
summary: A summarized attention item has been cleared
contentType: application/json
payload:
allOf:
- $ref: '#/components/schemas/EventMessage'
- type: object
properties:
channel:
const: 'attention/cleared'
payload:
$ref: '#/components/schemas/AttentionPayload'
schemas:
EventMessage:
type: object
title: GABP Event Message
description: Base schema for all GABP event messages
required:
- v
- id
- type
- channel
- seq
- payload
properties:
v:
type: string
const: 'gabp/1'
description: Protocol version identifier
id:
type: string
format: uuid
description: Unique event identifier
type:
type: string
const: 'event'
description: Message type
channel:
type: string
minLength: 1
description: Event channel name
seq:
type: integer
minimum: 0
description: Sequence number for this channel
payload:
type: object
description: Event-specific data
timestamp:
type: string
format: date-time
description: Optional ISO 8601 timestamp when event occurred
additionalProperties: false
PlayerMovePayload:
type: object
title: Player Movement Payload
description: Data payload for player movement events
required:
- playerId
- position
properties:
playerId:
type: string
description: Unique player identifier
position:
type: object
required: [x, y, z]
properties:
x:
type: number
description: X coordinate
y:
type: number
description: Y coordinate
z:
type: number
description: Z coordinate
additionalProperties: false
velocity:
type: object
properties:
x:
type: number
description: X velocity component
y:
type: number
description: Y velocity component
z:
type: number
description: Z velocity component
additionalProperties: false
rotation:
type: object
properties:
yaw:
type: number
minimum: -180
maximum: 180
description: Yaw rotation in degrees
pitch:
type: number
minimum: -90
maximum: 90
description: Pitch rotation in degrees
additionalProperties: false
additionalProperties: false
BlockChangePayload:
type: object
title: Block Change Payload
description: Data payload for block change events
required:
- position
- action
properties:
position:
type: object
required: [x, y, z]
properties:
x:
type: integer
description: Block X coordinate
y:
type: integer
description: Block Y coordinate
z:
type: integer
description: Block Z coordinate
additionalProperties: false
action:
type: string
enum: [place, break, replace]
description: Type of block change
oldBlockType:
type: string
description: Previous block type (for break/replace actions)
newBlockType:
type: string
description: New block type (for place/replace actions)
playerId:
type: string
description: Player who caused the change (if applicable)
tool:
type: string
description: Tool used for the action (if applicable)
additionalProperties: false
InventoryUpdatePayload:
type: object
title: Inventory Update Payload
description: Data payload for inventory update events
required:
- playerId
- action
properties:
playerId:
type: string
description: Player whose inventory changed
action:
type: string
enum: [add, remove, move, update]
description: Type of inventory change
slot:
type: integer
minimum: 0
description: Inventory slot number
item:
type: object
properties:
type:
type: string
description: Item type identifier
count:
type: integer
minimum: 0
description: Number of items
metadata:
type: object
description: Item-specific metadata
additionalProperties: false
previousItem:
type: object
description: Previous item in slot (for replace actions)
properties:
type:
type: string
count:
type: integer
minimum: 0
metadata:
type: object
additionalProperties: false
additionalProperties: false
AttentionPayload:
type: object
title: GABP Attention Payload
description: Summarized attention item payload for attention lifecycle channels
required:
- attentionId
- state
- severity
- blocking
- stateInvalidated
- summary
- openedAtSequence
- latestSequence
- totalUrgentEntries
properties:
attentionId:
type: string
minLength: 1
description: Stable identifier for this attention item
state:
type: string
enum: [open, cleared]
description: Lifecycle state of the attention item
severity:
type: string
enum: [info, warning, error, fatal]
description: Highest summarized severity for this attention item
blocking:
type: boolean
description: Whether bridge-side execution should be gated while this item is open
stateInvalidated:
type: boolean
description: Whether prior game-state assumptions should be treated as stale
summary:
type: string
minLength: 1
description: Compact semantic summary of what requires attention
causalOperationId:
type: string
description: Optional operation identifier associated with this attention item
causalMethod:
type: string
description: Optional method, tool, or capability identifier associated with this attention item
openedAtSequence:
type: integer
minimum: 0
description: First diagnostics-plane sequence associated with this attention item
latestSequence:
type: integer
minimum: 0
description: Latest diagnostics-plane sequence associated with this attention item
diagnosticsCursor:
type: integer
minimum: 0
description: Optional cursor the bridge can use to inspect more detailed diagnostics
totalUrgentEntries:
type: integer
minimum: 0
description: Total number of summarized urgent entries represented by this item
sample:
type: array
description: Optional representative sample of summarized urgent entries
items:
type: object
required:
- level
- message
- repeatCount
- latestSequence
properties:
level:
type: string
enum: [info, warning, error, fatal]
description: Severity level for the sampled entry
message:
type: string
minLength: 1
description: Representative message text
repeatCount:
type: integer
minimum: 1
description: Number of similar entries summarized by this sample
latestSequence:
type: integer
minimum: 0
description: Latest diagnostics-plane sequence represented by this sample
additionalProperties: false
additionalProperties: false