@fonoster/common 0.27.0 → 0.31.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.
Files changed (209) hide show
  1. package/dist/{voice/PlayDtmf.d.ts → agents/index.d.ts} +3 -5
  2. package/dist/{assistants → agents}/index.js +2 -6
  3. package/dist/agents/sessionAgentSchema.d.ts +755 -0
  4. package/dist/agents/sessionAgentSchema.js +117 -0
  5. package/dist/{voice/Dial.d.ts → calls/index.d.ts} +16 -13
  6. package/dist/calls/index.js +44 -0
  7. package/dist/cellsecrets/index.d.ts +91 -0
  8. package/dist/cellsecrets/index.js +299 -0
  9. package/dist/config/cli/check.d.ts +6 -0
  10. package/dist/config/cli/check.js +202 -0
  11. package/dist/config/cli/envFile.d.ts +23 -0
  12. package/dist/config/cli/envFile.js +81 -0
  13. package/dist/config/cli/exposure.d.ts +10 -0
  14. package/dist/config/cli/exposure.js +93 -0
  15. package/dist/config/cli/index.d.ts +2 -0
  16. package/dist/{identity/tokenHasAccessKeyId.js → config/cli/index.js} +7 -8
  17. package/dist/config/cli/info.d.ts +6 -0
  18. package/dist/config/cli/info.js +62 -0
  19. package/dist/config/cli/init.d.ts +9 -0
  20. package/dist/config/cli/init.js +152 -0
  21. package/dist/config/cli/main.d.ts +11 -0
  22. package/dist/config/cli/main.js +155 -0
  23. package/dist/config/cli/render.d.ts +44 -0
  24. package/dist/config/cli/render.js +129 -0
  25. package/dist/config/cli/secrets.d.ts +21 -0
  26. package/dist/config/cli/secrets.js +117 -0
  27. package/dist/config/cli/types.d.ts +24 -0
  28. package/dist/config/cli/types.js +7 -0
  29. package/dist/{assistants/index.d.ts → config/configHints.d.ts} +8 -7
  30. package/dist/config/configHints.js +47 -0
  31. package/dist/{voice → config}/index.d.ts +11 -13
  32. package/dist/{voice → config}/index.js +11 -13
  33. package/dist/config/interpolateEnv.d.ts +34 -0
  34. package/dist/config/interpolateEnv.js +70 -0
  35. package/dist/config/loadServiceConfig.d.ts +28 -0
  36. package/dist/config/loadServiceConfig.js +112 -0
  37. package/dist/config/logsSchema.d.ts +76 -0
  38. package/dist/config/logsSchema.js +49 -0
  39. package/dist/config/natsConnection.d.ts +53 -0
  40. package/dist/config/natsConnection.js +58 -0
  41. package/dist/config/parseConfigFile.d.ts +7 -0
  42. package/dist/config/parseConfigFile.js +60 -0
  43. package/dist/config/resolveConfigFile.d.ts +17 -0
  44. package/dist/config/resolveConfigFile.js +54 -0
  45. package/dist/config/resolveSecretRefs.d.ts +35 -0
  46. package/dist/config/resolveSecretRefs.js +129 -0
  47. package/dist/{assistants/audioFiltersSchema.d.ts → config/strictDeep.d.ts} +9 -12
  48. package/dist/config/strictDeep.js +58 -0
  49. package/dist/config/telemetrySchema.d.ts +39 -0
  50. package/dist/config/telemetrySchema.js +44 -0
  51. package/dist/config/toJsonSchema.d.ts +30 -0
  52. package/dist/config/toJsonSchema.js +161 -0
  53. package/dist/constants.d.ts +1 -6
  54. package/dist/constants.js +4 -7
  55. package/dist/envs.d.ts +2 -1
  56. package/dist/envs.js +13 -11
  57. package/dist/errors/handleZodError.js +3 -1
  58. package/dist/filters/index.d.ts +70 -0
  59. package/dist/filters/index.js +101 -0
  60. package/dist/identity/createAuthInterceptor.d.ts +9 -2
  61. package/dist/identity/createAuthInterceptor.js +36 -30
  62. package/dist/identity/hasAccess.d.ts +9 -3
  63. package/dist/identity/hasAccess.js +32 -8
  64. package/dist/identity/index.d.ts +1 -0
  65. package/dist/identity/index.js +1 -0
  66. package/dist/identity/isValidToken.d.ts +12 -2
  67. package/dist/identity/isValidToken.js +25 -9
  68. package/dist/identity/roles.js +33 -7
  69. package/dist/identity/types.d.ts +6 -1
  70. package/dist/identity/types.js +1 -0
  71. package/dist/{assistants/LanguageModelProvider.js → identity/verifyAccessToken.d.ts} +10 -11
  72. package/dist/identity/verifyAccessToken.js +44 -0
  73. package/dist/index.d.ts +15 -2
  74. package/dist/index.js +18 -3
  75. package/dist/net/assertPublicDestination.d.ts +52 -0
  76. package/dist/net/assertPublicDestination.js +342 -0
  77. package/dist/{voice/StopSay.d.ts → net/index.d.ts} +1 -6
  78. package/dist/net/index.js +35 -0
  79. package/dist/notifications/createSendEmail.js +3 -1
  80. package/dist/protos/applications.proto +138 -3
  81. package/dist/protos/authz.proto +26 -4
  82. package/dist/protos/billing.proto +92 -0
  83. package/dist/protos/calls.proto +4 -0
  84. package/dist/protos/capabilities.proto +102 -0
  85. package/dist/protos/identity.proto +26 -1
  86. package/dist/protos/providers.proto +139 -0
  87. package/dist/protos/roomr.proto +146 -0
  88. package/dist/protos/session.proto +194 -0
  89. package/dist/protos/usage.proto +59 -0
  90. package/dist/protos/webhooks.proto +140 -0
  91. package/dist/{utils/types.d.ts → regions/hub/index.d.ts} +1 -5
  92. package/dist/regions/hub/index.js +35 -0
  93. package/dist/regions/hub/natsJwt.d.ts +63 -0
  94. package/dist/regions/hub/natsJwt.js +195 -0
  95. package/dist/registry/Registry.d.ts +87 -0
  96. package/dist/registry/Registry.js +432 -0
  97. package/dist/registry/cli.d.ts +20 -0
  98. package/dist/registry/cli.js +436 -0
  99. package/dist/registry/features.d.ts +31 -0
  100. package/dist/registry/features.js +38 -0
  101. package/dist/registry/index.d.ts +24 -0
  102. package/dist/registry/index.js +40 -0
  103. package/dist/registry/prisma.d.ts +67 -0
  104. package/dist/registry/prisma.js +399 -0
  105. package/dist/registry/stores.d.ts +21 -0
  106. package/dist/{assistants/languageModelConfigSchema.js → registry/stores.js} +55 -38
  107. package/dist/registry/types.d.ts +110 -0
  108. package/dist/{assistants/LanguageModelProvider.d.ts → registry/types.js} +6 -8
  109. package/dist/registry/workspaceKeys.d.ts +41 -0
  110. package/dist/registry/workspaceKeys.js +64 -0
  111. package/dist/roomr/health.d.ts +9 -0
  112. package/dist/{assistants/eventsHookSchema.js → roomr/health.js} +22 -18
  113. package/dist/roomr/index.d.ts +75 -0
  114. package/dist/roomr/index.js +146 -0
  115. package/dist/roomr/session.d.ts +133 -0
  116. package/dist/roomr/session.js +132 -0
  117. package/dist/session/index.d.ts +19 -0
  118. package/dist/session/index.js +35 -0
  119. package/dist/session/schema.d.ts +2140 -0
  120. package/dist/session/schema.js +448 -0
  121. package/dist/sessions/index.d.ts +96 -0
  122. package/dist/sessions/index.js +197 -0
  123. package/dist/telemetry.d.ts +76 -0
  124. package/dist/telemetry.js +360 -0
  125. package/dist/types.d.ts +3 -5
  126. package/dist/{voice/Gather.d.ts → usage/CallUsage.d.ts} +19 -18
  127. package/dist/usage/CallUsage.js +76 -0
  128. package/dist/usage/index.d.ts +22 -0
  129. package/dist/usage/index.js +38 -0
  130. package/dist/usage/meters.d.ts +113 -0
  131. package/dist/usage/meters.js +90 -0
  132. package/dist/usage/types.d.ts +159 -0
  133. package/dist/usage/types.js +84 -0
  134. package/dist/usage/usageId.d.ts +6 -0
  135. package/dist/usage/usageId.js +45 -0
  136. package/dist/utils/{findIntegrationsCredentials.js → WriteBehind.d.ts} +13 -10
  137. package/dist/utils/WriteBehind.js +64 -0
  138. package/dist/utils/index.d.ts +1 -3
  139. package/dist/utils/index.js +1 -3
  140. package/dist/utils/{createFetchSingleCallByCallId.d.ts → logUnhandledRejections.d.ts} +8 -4
  141. package/dist/{assistants/audioFiltersSchema.js → utils/logUnhandledRejections.js} +17 -12
  142. package/dist/utils/withErrorHandling.js +1 -1
  143. package/dist/validators/calls.d.ts +3 -0
  144. package/dist/validators/calls.js +12 -2
  145. package/dist/validators/identity.d.ts +37 -8
  146. package/dist/validators/identity.js +22 -3
  147. package/dist/validators/index.d.ts +1 -0
  148. package/dist/validators/index.js +1 -0
  149. package/dist/validators/sip.d.ts +40 -0
  150. package/dist/validators/sip.js +99 -0
  151. package/dist/validators/sipnet/credentials.d.ts +2 -2
  152. package/dist/validators/sipnet/domains.js +7 -7
  153. package/dist/validators/sipnet/trunks.d.ts +14 -14
  154. package/dist/validators/sipnet/trunks.js +4 -2
  155. package/dist/webhooks/Dispatcher.d.ts +87 -0
  156. package/dist/webhooks/Dispatcher.js +225 -0
  157. package/dist/webhooks/bus.d.ts +68 -0
  158. package/dist/webhooks/bus.js +178 -0
  159. package/dist/webhooks/events.d.ts +66 -0
  160. package/dist/webhooks/events.js +62 -0
  161. package/dist/webhooks/index.d.ts +23 -0
  162. package/dist/webhooks/index.js +39 -0
  163. package/dist/webhooks/prisma.d.ts +55 -0
  164. package/dist/webhooks/prisma.js +242 -0
  165. package/dist/webhooks/signing.d.ts +8 -0
  166. package/dist/webhooks/signing.js +53 -0
  167. package/package.json +25 -11
  168. package/schema/session.v1.json +871 -0
  169. package/dist/assistants/assistantSchema.d.ts +0 -739
  170. package/dist/assistants/assistantSchema.js +0 -37
  171. package/dist/assistants/conversationSettingsSchema.d.ts +0 -122
  172. package/dist/assistants/conversationSettingsSchema.js +0 -133
  173. package/dist/assistants/eventsHookSchema.d.ts +0 -38
  174. package/dist/assistants/languageModelConfigSchema.d.ts +0 -206
  175. package/dist/identity/tokenHasAccessKeyId.d.ts +0 -2
  176. package/dist/protos/voice.proto +0 -557
  177. package/dist/utils/createFetchSingleCallByCallId.js +0 -33
  178. package/dist/utils/findIntegrationsCredentials.d.ts +0 -23
  179. package/dist/utils/types.js +0 -2
  180. package/dist/voice/Dial.js +0 -20
  181. package/dist/voice/Gather.js +0 -9
  182. package/dist/voice/Mute.d.ts +0 -31
  183. package/dist/voice/Mute.js +0 -9
  184. package/dist/voice/Play.d.ts +0 -30
  185. package/dist/voice/Play.js +0 -2
  186. package/dist/voice/PlayDtmf.js +0 -2
  187. package/dist/voice/PlaybackControl.d.ts +0 -31
  188. package/dist/voice/PlaybackControl.js +0 -11
  189. package/dist/voice/Record.d.ts +0 -36
  190. package/dist/voice/Record.js +0 -7
  191. package/dist/voice/Say.d.ts +0 -28
  192. package/dist/voice/Say.js +0 -2
  193. package/dist/voice/StopSay.js +0 -2
  194. package/dist/voice/Stream.d.ts +0 -53
  195. package/dist/voice/Stream.js +0 -19
  196. package/dist/voice/StreamGather.d.ts +0 -34
  197. package/dist/voice/StreamGather.js +0 -9
  198. package/dist/voice/Verb.d.ts +0 -27
  199. package/dist/voice/Verb.js +0 -2
  200. package/dist/voice/voice.d.ts +0 -171
  201. package/dist/voice/voice.js +0 -65
  202. package/dist/{assistants → agents}/testCasesSchema.d.ts +4 -4
  203. /package/dist/{assistants → agents}/testCasesSchema.js +0 -0
  204. /package/dist/{assistants → agents}/tools/index.d.ts +0 -0
  205. /package/dist/{assistants → agents}/tools/index.js +0 -0
  206. /package/dist/{assistants → agents}/tools/propertySchema.d.ts +0 -0
  207. /package/dist/{assistants → agents}/tools/propertySchema.js +0 -0
  208. /package/dist/{assistants → agents}/tools/toolSchema.d.ts +0 -0
  209. /package/dist/{assistants → agents}/tools/toolSchema.js +0 -0
@@ -0,0 +1,871 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://fonoster.com/schemas/session/v1.json",
4
+ "title": "fonoster.session.v1",
5
+ "description": "Messages of the Fonoster session protocol (a stream with protocol fonoster). Unknown types and fields must be ignored.",
6
+ "protocol": "fonoster.session.v1",
7
+ "appBridgeToApp": {
8
+ "session.start": {
9
+ "type": "object",
10
+ "required": [
11
+ "type",
12
+ "protocol",
13
+ "sessionRef",
14
+ "callRef",
15
+ "appRef",
16
+ "direction",
17
+ "from",
18
+ "to",
19
+ "metadata",
20
+ "handoff",
21
+ "audio",
22
+ "tracks",
23
+ "speech"
24
+ ],
25
+ "properties": {
26
+ "type": {
27
+ "const": "session.start"
28
+ },
29
+ "protocol": {
30
+ "const": "fonoster.session.v1"
31
+ },
32
+ "sessionRef": {
33
+ "type": "string"
34
+ },
35
+ "callRef": {
36
+ "type": "string"
37
+ },
38
+ "appRef": {
39
+ "type": "string"
40
+ },
41
+ "direction": {
42
+ "enum": [
43
+ "inbound",
44
+ "outbound"
45
+ ]
46
+ },
47
+ "from": {
48
+ "type": "string"
49
+ },
50
+ "to": {
51
+ "type": "string"
52
+ },
53
+ "metadata": {
54
+ "type": "object"
55
+ },
56
+ "handoff": {
57
+ "oneOf": [
58
+ {
59
+ "type": "null"
60
+ },
61
+ {
62
+ "type": "object"
63
+ }
64
+ ]
65
+ },
66
+ "traceparent": {
67
+ "type": "string"
68
+ },
69
+ "audio": {
70
+ "type": "object",
71
+ "required": [
72
+ "codec",
73
+ "rate"
74
+ ],
75
+ "properties": {
76
+ "codec": {
77
+ "enum": [
78
+ "pcm16",
79
+ "pcmu"
80
+ ]
81
+ },
82
+ "rate": {
83
+ "enum": [
84
+ 8000,
85
+ 16000,
86
+ 24000
87
+ ]
88
+ }
89
+ }
90
+ },
91
+ "tracks": {
92
+ "type": "array",
93
+ "items": {
94
+ "type": "object",
95
+ "required": [
96
+ "id",
97
+ "side",
98
+ "kind",
99
+ "codec"
100
+ ],
101
+ "properties": {
102
+ "id": {
103
+ "type": "integer",
104
+ "minimum": 0,
105
+ "maximum": 255
106
+ },
107
+ "side": {
108
+ "enum": [
109
+ "inbound",
110
+ "outbound"
111
+ ]
112
+ },
113
+ "kind": {
114
+ "enum": [
115
+ "audio"
116
+ ]
117
+ },
118
+ "codec": {
119
+ "type": "string"
120
+ }
121
+ }
122
+ }
123
+ },
124
+ "speech": {
125
+ "type": "object",
126
+ "required": [
127
+ "voice",
128
+ "language"
129
+ ],
130
+ "properties": {
131
+ "voice": {
132
+ "type": "string"
133
+ },
134
+ "language": {
135
+ "type": "string"
136
+ }
137
+ }
138
+ }
139
+ }
140
+ },
141
+ "session.end": {
142
+ "type": "object",
143
+ "required": [
144
+ "type",
145
+ "reason"
146
+ ],
147
+ "properties": {
148
+ "type": {
149
+ "const": "session.end"
150
+ },
151
+ "reason": {
152
+ "enum": [
153
+ "caller_hangup",
154
+ "app_hangup",
155
+ "transfer",
156
+ "handoff",
157
+ "error",
158
+ "timeout"
159
+ ]
160
+ }
161
+ }
162
+ },
163
+ "error": {
164
+ "type": "object",
165
+ "required": [
166
+ "type",
167
+ "code",
168
+ "message",
169
+ "fatal"
170
+ ],
171
+ "properties": {
172
+ "type": {
173
+ "const": "error"
174
+ },
175
+ "code": {
176
+ "type": "string"
177
+ },
178
+ "message": {
179
+ "type": "string"
180
+ },
181
+ "fatal": {
182
+ "type": "boolean"
183
+ },
184
+ "relatesTo": {
185
+ "type": "string",
186
+ "minLength": 1,
187
+ "maxLength": 128
188
+ }
189
+ }
190
+ },
191
+ "turn.user_started": {
192
+ "type": "object",
193
+ "required": [
194
+ "type"
195
+ ],
196
+ "properties": {
197
+ "type": {
198
+ "const": "turn.user_started"
199
+ }
200
+ }
201
+ },
202
+ "turn.likely_ended": {
203
+ "type": "object",
204
+ "required": [
205
+ "type",
206
+ "text"
207
+ ],
208
+ "properties": {
209
+ "type": {
210
+ "const": "turn.likely_ended"
211
+ },
212
+ "text": {
213
+ "type": "string"
214
+ }
215
+ }
216
+ },
217
+ "turn.ended": {
218
+ "type": "object",
219
+ "required": [
220
+ "type",
221
+ "text",
222
+ "language",
223
+ "confidence",
224
+ "durationMs"
225
+ ],
226
+ "properties": {
227
+ "type": {
228
+ "const": "turn.ended"
229
+ },
230
+ "text": {
231
+ "type": "string"
232
+ },
233
+ "language": {
234
+ "type": "string"
235
+ },
236
+ "confidence": {
237
+ "type": "number",
238
+ "minimum": 0,
239
+ "maximum": 1
240
+ },
241
+ "durationMs": {
242
+ "type": "number",
243
+ "minimum": 0
244
+ },
245
+ "abandoned": {
246
+ "type": "boolean"
247
+ }
248
+ }
249
+ },
250
+ "turn.resumed": {
251
+ "type": "object",
252
+ "required": [
253
+ "type"
254
+ ],
255
+ "properties": {
256
+ "type": {
257
+ "const": "turn.resumed"
258
+ }
259
+ }
260
+ },
261
+ "turn.backchannel": {
262
+ "type": "object",
263
+ "required": [
264
+ "type",
265
+ "text"
266
+ ],
267
+ "properties": {
268
+ "type": {
269
+ "const": "turn.backchannel"
270
+ },
271
+ "text": {
272
+ "type": "string"
273
+ }
274
+ }
275
+ },
276
+ "turn.estimate": {
277
+ "type": "object",
278
+ "required": [
279
+ "type",
280
+ "eot",
281
+ "speaking",
282
+ "kind"
283
+ ],
284
+ "properties": {
285
+ "type": {
286
+ "const": "turn.estimate"
287
+ },
288
+ "eot": {
289
+ "type": "number",
290
+ "minimum": 0,
291
+ "maximum": 1
292
+ },
293
+ "speaking": {
294
+ "type": "boolean"
295
+ },
296
+ "kind": {
297
+ "enum": [
298
+ "speech",
299
+ "backchannel",
300
+ "interruption",
301
+ "none"
302
+ ]
303
+ }
304
+ }
305
+ },
306
+ "transcript.partial": {
307
+ "type": "object",
308
+ "required": [
309
+ "type",
310
+ "text"
311
+ ],
312
+ "properties": {
313
+ "type": {
314
+ "const": "transcript.partial"
315
+ },
316
+ "text": {
317
+ "type": "string"
318
+ },
319
+ "language": {
320
+ "type": "string"
321
+ }
322
+ }
323
+ },
324
+ "output.started": {
325
+ "type": "object",
326
+ "required": [
327
+ "type",
328
+ "id"
329
+ ],
330
+ "properties": {
331
+ "type": {
332
+ "const": "output.started"
333
+ },
334
+ "id": {
335
+ "type": "string",
336
+ "minLength": 1,
337
+ "maxLength": 128
338
+ }
339
+ }
340
+ },
341
+ "output.done": {
342
+ "type": "object",
343
+ "required": [
344
+ "type",
345
+ "id"
346
+ ],
347
+ "properties": {
348
+ "type": {
349
+ "const": "output.done"
350
+ },
351
+ "id": {
352
+ "type": "string",
353
+ "minLength": 1,
354
+ "maxLength": 128
355
+ },
356
+ "heardMs": {
357
+ "type": "number",
358
+ "minimum": 0
359
+ }
360
+ }
361
+ },
362
+ "output.interrupted": {
363
+ "type": "object",
364
+ "required": [
365
+ "type",
366
+ "id",
367
+ "heardText",
368
+ "heardMs"
369
+ ],
370
+ "properties": {
371
+ "type": {
372
+ "const": "output.interrupted"
373
+ },
374
+ "id": {
375
+ "type": "string",
376
+ "minLength": 1,
377
+ "maxLength": 128
378
+ },
379
+ "heardText": {
380
+ "type": "string"
381
+ },
382
+ "heardMs": {
383
+ "type": "number",
384
+ "minimum": 0
385
+ }
386
+ }
387
+ },
388
+ "mark": {
389
+ "type": "object",
390
+ "required": [
391
+ "type",
392
+ "name",
393
+ "cleared"
394
+ ],
395
+ "properties": {
396
+ "type": {
397
+ "const": "mark"
398
+ },
399
+ "name": {
400
+ "type": "string"
401
+ },
402
+ "cleared": {
403
+ "type": "boolean"
404
+ }
405
+ }
406
+ },
407
+ "dtmf": {
408
+ "type": "object",
409
+ "required": [
410
+ "type",
411
+ "digit"
412
+ ],
413
+ "properties": {
414
+ "type": {
415
+ "const": "dtmf"
416
+ },
417
+ "digit": {
418
+ "type": "string",
419
+ "pattern": "^[0-9A-D*#]$"
420
+ }
421
+ }
422
+ },
423
+ "transfer.answered": {
424
+ "type": "object",
425
+ "required": [
426
+ "type",
427
+ "relatesTo"
428
+ ],
429
+ "properties": {
430
+ "type": {
431
+ "const": "transfer.answered"
432
+ },
433
+ "relatesTo": {
434
+ "type": "string",
435
+ "minLength": 1,
436
+ "maxLength": 128
437
+ }
438
+ }
439
+ },
440
+ "amd.result": {
441
+ "type": "object",
442
+ "required": [
443
+ "type",
444
+ "status",
445
+ "confidence",
446
+ "detector",
447
+ "audioMs"
448
+ ],
449
+ "properties": {
450
+ "type": {
451
+ "const": "amd.result"
452
+ },
453
+ "status": {
454
+ "enum": [
455
+ "human",
456
+ "voicemail",
457
+ "ivr",
458
+ "machine",
459
+ "unknown"
460
+ ]
461
+ },
462
+ "confidence": {
463
+ "type": "number",
464
+ "minimum": 0,
465
+ "maximum": 1
466
+ },
467
+ "detector": {
468
+ "type": "string"
469
+ },
470
+ "audioMs": {
471
+ "type": "number",
472
+ "minimum": 0
473
+ },
474
+ "speechOnsetMs": {
475
+ "type": "number",
476
+ "minimum": 0
477
+ },
478
+ "reason": {
479
+ "type": "string"
480
+ }
481
+ }
482
+ }
483
+ },
484
+ "appToAppBridge": {
485
+ "speak": {
486
+ "type": "object",
487
+ "required": [
488
+ "type",
489
+ "text"
490
+ ],
491
+ "properties": {
492
+ "type": {
493
+ "const": "speak"
494
+ },
495
+ "id": {
496
+ "type": "string",
497
+ "minLength": 1,
498
+ "maxLength": 128
499
+ },
500
+ "text": {
501
+ "type": "string"
502
+ },
503
+ "last": {
504
+ "type": "boolean"
505
+ },
506
+ "voice": {
507
+ "type": "string",
508
+ "minLength": 1
509
+ },
510
+ "language": {
511
+ "type": "string",
512
+ "minLength": 1
513
+ },
514
+ "interruptible": {
515
+ "type": "boolean"
516
+ },
517
+ "preempt": {
518
+ "type": "boolean"
519
+ }
520
+ }
521
+ },
522
+ "play": {
523
+ "type": "object",
524
+ "required": [
525
+ "type",
526
+ "url"
527
+ ],
528
+ "properties": {
529
+ "type": {
530
+ "const": "play"
531
+ },
532
+ "id": {
533
+ "type": "string",
534
+ "minLength": 1,
535
+ "maxLength": 128
536
+ },
537
+ "url": {
538
+ "type": "string",
539
+ "pattern": "^https?://"
540
+ },
541
+ "loop": {
542
+ "type": "boolean"
543
+ },
544
+ "interruptible": {
545
+ "type": "boolean"
546
+ },
547
+ "preempt": {
548
+ "type": "boolean"
549
+ }
550
+ }
551
+ },
552
+ "listen.update": {
553
+ "type": "object",
554
+ "required": [
555
+ "type"
556
+ ],
557
+ "properties": {
558
+ "type": {
559
+ "const": "listen.update"
560
+ },
561
+ "id": {
562
+ "type": "string",
563
+ "minLength": 1,
564
+ "maxLength": 128
565
+ },
566
+ "language": {
567
+ "type": "string",
568
+ "minLength": 1
569
+ },
570
+ "hints": {
571
+ "type": "array",
572
+ "items": {
573
+ "type": "string"
574
+ }
575
+ },
576
+ "patience": {
577
+ "enum": [
578
+ "low",
579
+ "normal",
580
+ "high"
581
+ ]
582
+ }
583
+ }
584
+ },
585
+ "subscribe": {
586
+ "type": "object",
587
+ "required": [
588
+ "type",
589
+ "events"
590
+ ],
591
+ "properties": {
592
+ "type": {
593
+ "const": "subscribe"
594
+ },
595
+ "id": {
596
+ "type": "string",
597
+ "minLength": 1,
598
+ "maxLength": 128
599
+ },
600
+ "events": {
601
+ "type": "array",
602
+ "items": {
603
+ "type": "string"
604
+ }
605
+ }
606
+ }
607
+ },
608
+ "mark": {
609
+ "type": "object",
610
+ "required": [
611
+ "type",
612
+ "name"
613
+ ],
614
+ "properties": {
615
+ "type": {
616
+ "const": "mark"
617
+ },
618
+ "name": {
619
+ "type": "string",
620
+ "minLength": 1
621
+ }
622
+ }
623
+ },
624
+ "clear": {
625
+ "type": "object",
626
+ "required": [
627
+ "type"
628
+ ],
629
+ "properties": {
630
+ "type": {
631
+ "const": "clear"
632
+ },
633
+ "id": {
634
+ "type": "string",
635
+ "minLength": 1,
636
+ "maxLength": 128
637
+ }
638
+ }
639
+ },
640
+ "hangup": {
641
+ "type": "object",
642
+ "required": [
643
+ "type"
644
+ ],
645
+ "properties": {
646
+ "type": {
647
+ "const": "hangup"
648
+ },
649
+ "id": {
650
+ "type": "string",
651
+ "minLength": 1,
652
+ "maxLength": 128
653
+ }
654
+ }
655
+ },
656
+ "dtmf.send": {
657
+ "type": "object",
658
+ "required": [
659
+ "type",
660
+ "digits"
661
+ ],
662
+ "properties": {
663
+ "type": {
664
+ "const": "dtmf.send"
665
+ },
666
+ "id": {
667
+ "type": "string",
668
+ "minLength": 1,
669
+ "maxLength": 128
670
+ },
671
+ "digits": {
672
+ "type": "string",
673
+ "pattern": "^[0-9A-D*#w]+$"
674
+ }
675
+ }
676
+ },
677
+ "transfer": {
678
+ "type": "object",
679
+ "required": [
680
+ "type",
681
+ "to"
682
+ ],
683
+ "properties": {
684
+ "type": {
685
+ "const": "transfer"
686
+ },
687
+ "id": {
688
+ "type": "string",
689
+ "minLength": 1,
690
+ "maxLength": 128
691
+ },
692
+ "to": {
693
+ "type": "string",
694
+ "minLength": 1
695
+ },
696
+ "headers": {
697
+ "type": "object",
698
+ "additionalProperties": {
699
+ "type": "string"
700
+ }
701
+ },
702
+ "mode": {
703
+ "enum": [
704
+ "cold",
705
+ "warm",
706
+ "refer"
707
+ ]
708
+ },
709
+ "music": {
710
+ "type": "string"
711
+ }
712
+ }
713
+ },
714
+ "transfer.complete": {
715
+ "type": "object",
716
+ "required": [
717
+ "type",
718
+ "id"
719
+ ],
720
+ "properties": {
721
+ "type": {
722
+ "const": "transfer.complete"
723
+ },
724
+ "id": {
725
+ "type": "string",
726
+ "minLength": 1,
727
+ "maxLength": 128
728
+ }
729
+ }
730
+ },
731
+ "hold": {
732
+ "type": "object",
733
+ "required": [
734
+ "type"
735
+ ],
736
+ "properties": {
737
+ "type": {
738
+ "const": "hold"
739
+ },
740
+ "id": {
741
+ "type": "string",
742
+ "minLength": 1,
743
+ "maxLength": 128
744
+ },
745
+ "music": {
746
+ "type": "string"
747
+ }
748
+ }
749
+ },
750
+ "resume": {
751
+ "type": "object",
752
+ "required": [
753
+ "type"
754
+ ],
755
+ "properties": {
756
+ "type": {
757
+ "const": "resume"
758
+ },
759
+ "id": {
760
+ "type": "string",
761
+ "minLength": 1,
762
+ "maxLength": 128
763
+ }
764
+ }
765
+ },
766
+ "handoff": {
767
+ "type": "object",
768
+ "required": [
769
+ "type",
770
+ "app"
771
+ ],
772
+ "properties": {
773
+ "type": {
774
+ "const": "handoff"
775
+ },
776
+ "id": {
777
+ "type": "string",
778
+ "minLength": 1,
779
+ "maxLength": 128
780
+ },
781
+ "app": {
782
+ "type": "string",
783
+ "minLength": 1
784
+ },
785
+ "payload": {
786
+ "type": "object"
787
+ }
788
+ }
789
+ },
790
+ "record.note": {
791
+ "type": "object",
792
+ "required": [
793
+ "type",
794
+ "data"
795
+ ],
796
+ "properties": {
797
+ "type": {
798
+ "const": "record.note"
799
+ },
800
+ "id": {
801
+ "type": "string",
802
+ "minLength": 1,
803
+ "maxLength": 128
804
+ },
805
+ "data": {
806
+ "type": "object"
807
+ }
808
+ }
809
+ },
810
+ "usage.report": {
811
+ "type": "object",
812
+ "required": [
813
+ "type",
814
+ "lines"
815
+ ],
816
+ "properties": {
817
+ "type": {
818
+ "const": "usage.report"
819
+ },
820
+ "id": {
821
+ "type": "string",
822
+ "minLength": 1,
823
+ "maxLength": 128
824
+ },
825
+ "lines": {
826
+ "type": "array",
827
+ "minItems": 1,
828
+ "maxItems": 64,
829
+ "items": {
830
+ "type": "object",
831
+ "required": [
832
+ "meter",
833
+ "quantity",
834
+ "provider",
835
+ "keySource"
836
+ ],
837
+ "additionalProperties": false,
838
+ "properties": {
839
+ "meter": {
840
+ "enum": [
841
+ "llm.tokens.in",
842
+ "llm.tokens.out",
843
+ "llm.tokens.cached",
844
+ "embedding.tokens"
845
+ ]
846
+ },
847
+ "quantity": {
848
+ "type": "integer",
849
+ "minimum": 0
850
+ },
851
+ "provider": {
852
+ "type": "string",
853
+ "minLength": 1
854
+ },
855
+ "model": {
856
+ "type": "string",
857
+ "minLength": 1
858
+ },
859
+ "keySource": {
860
+ "enum": [
861
+ "platform",
862
+ "workspace"
863
+ ]
864
+ }
865
+ }
866
+ }
867
+ }
868
+ }
869
+ }
870
+ }
871
+ }