gemi 0.131.0 → 0.133.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 (230) hide show
  1. package/dist/ai/AgentController.d.ts +73 -0
  2. package/dist/ai/AgentController.d.ts.map +1 -1
  3. package/dist/ai/AgentProvider.d.ts +25 -0
  4. package/dist/ai/AgentProvider.d.ts.map +1 -1
  5. package/dist/ai/VoiceBridge.d.ts +365 -0
  6. package/dist/ai/VoiceBridge.d.ts.map +1 -0
  7. package/dist/ai/index.d.ts +13 -0
  8. package/dist/ai/index.d.ts.map +1 -1
  9. package/dist/ai/index.js +18 -18
  10. package/dist/ai/index.js.map +11 -6
  11. package/dist/ai/providers/endpoints.d.ts +19 -0
  12. package/dist/ai/providers/endpoints.d.ts.map +1 -1
  13. package/dist/ai/providers/realtime.d.ts +272 -0
  14. package/dist/ai/providers/realtime.d.ts.map +1 -0
  15. package/dist/ai/providers/sideband.d.ts +254 -0
  16. package/dist/ai/providers/sideband.d.ts.map +1 -0
  17. package/dist/ai/runtime.d.ts.map +1 -1
  18. package/dist/ai/types.d.ts +15 -0
  19. package/dist/ai/types.d.ts.map +1 -1
  20. package/dist/ai/voice/index.d.ts +23 -0
  21. package/dist/ai/voice/index.d.ts.map +1 -0
  22. package/dist/ai/voice/index.js +433 -0
  23. package/dist/ai/voice/index.js.map +1 -0
  24. package/dist/ai/voice/state.d.ts +34 -0
  25. package/dist/ai/voice/state.d.ts.map +1 -0
  26. package/dist/ai/voice/useVoiceSession.d.ts +82 -0
  27. package/dist/ai/voice/useVoiceSession.d.ts.map +1 -0
  28. package/dist/ai/voice/voiceCall.d.ts +57 -0
  29. package/dist/ai/voice/voiceCall.d.ts.map +1 -0
  30. package/dist/ai/voice/wire.d.ts +66 -0
  31. package/dist/ai/voice/wire.d.ts.map +1 -0
  32. package/dist/ai/voiceConfig.d.ts +70 -0
  33. package/dist/ai/voiceConfig.d.ts.map +1 -0
  34. package/dist/ai/voiceMcp.d.ts +89 -0
  35. package/dist/ai/voiceMcp.d.ts.map +1 -0
  36. package/dist/ai/voiceStore.d.ts +52 -0
  37. package/dist/ai/voiceStore.d.ts.map +1 -0
  38. package/dist/app/index.js +1 -1
  39. package/dist/bun/plugin.js +1 -1
  40. package/dist/bun/preload.js +1 -1
  41. package/dist/{chunk-4gmhx2ba.js → chunk-0eamc2tr.js} +2 -2
  42. package/dist/{chunk-4gmhx2ba.js.map → chunk-0eamc2tr.js.map} +1 -1
  43. package/dist/{chunk-2x0n3ze1.js → chunk-0gg4e94v.js} +2 -2
  44. package/dist/{chunk-2x0n3ze1.js.map → chunk-0gg4e94v.js.map} +1 -1
  45. package/dist/{chunk-p642ja42.js → chunk-0rhf4g12.js} +3 -3
  46. package/dist/{chunk-p642ja42.js.map → chunk-0rhf4g12.js.map} +1 -1
  47. package/dist/{chunk-dxm5gxqk.js → chunk-1awxdnb6.js} +1 -1
  48. package/dist/{chunk-2senwsdq.js → chunk-2cnawkke.js} +12 -12
  49. package/dist/{chunk-2senwsdq.js.map → chunk-2cnawkke.js.map} +3 -3
  50. package/dist/{chunk-fxm8fqh9.js → chunk-33hdxe7v.js} +1 -1
  51. package/dist/{chunk-63xekerg.js → chunk-3g5q0cj5.js} +2 -2
  52. package/dist/{chunk-63xekerg.js.map → chunk-3g5q0cj5.js.map} +1 -1
  53. package/dist/{chunk-xjs72pb0.js → chunk-3h37f124.js} +2 -2
  54. package/dist/{chunk-xjs72pb0.js.map → chunk-3h37f124.js.map} +1 -1
  55. package/dist/{chunk-65fq5a9d.js → chunk-4278e429.js} +2 -2
  56. package/dist/{chunk-65fq5a9d.js.map → chunk-4278e429.js.map} +1 -1
  57. package/dist/chunk-47e7fbsp.js +5 -0
  58. package/dist/{chunk-mvka90rq.js.map → chunk-47e7fbsp.js.map} +1 -1
  59. package/dist/{chunk-p6b0cyf8.js → chunk-4pvv8qs0.js} +2 -2
  60. package/dist/{chunk-p6b0cyf8.js.map → chunk-4pvv8qs0.js.map} +1 -1
  61. package/dist/{chunk-rjyw1thg.js → chunk-4t41m5f1.js} +2 -2
  62. package/dist/{chunk-rjyw1thg.js.map → chunk-4t41m5f1.js.map} +1 -1
  63. package/dist/{chunk-f21v4n2v.js → chunk-53rr32zm.js} +1 -1
  64. package/dist/{chunk-xhvknqvn.js → chunk-5pdgh9a1.js} +2 -2
  65. package/dist/{chunk-xhvknqvn.js.map → chunk-5pdgh9a1.js.map} +1 -1
  66. package/dist/{chunk-e4ay1vg9.js → chunk-65j32dtn.js} +2 -2
  67. package/dist/{chunk-e4ay1vg9.js.map → chunk-65j32dtn.js.map} +1 -1
  68. package/dist/{chunk-jxvec7jc.js → chunk-6fr6j338.js} +2 -2
  69. package/dist/{chunk-jxvec7jc.js.map → chunk-6fr6j338.js.map} +1 -1
  70. package/dist/{chunk-jd1afbrs.js → chunk-6hz63ts4.js} +4 -4
  71. package/dist/{chunk-jd1afbrs.js.map → chunk-6hz63ts4.js.map} +1 -1
  72. package/dist/{chunk-4z0rt6ws.js → chunk-6qty7at2.js} +2 -2
  73. package/dist/{chunk-4z0rt6ws.js.map → chunk-6qty7at2.js.map} +1 -1
  74. package/dist/{chunk-pzb3agv9.js → chunk-7nxnyw7x.js} +2 -2
  75. package/dist/{chunk-pzb3agv9.js.map → chunk-7nxnyw7x.js.map} +1 -1
  76. package/dist/{chunk-7n0zn5h4.js → chunk-8ryrjtn0.js} +2 -2
  77. package/dist/{chunk-7n0zn5h4.js.map → chunk-8ryrjtn0.js.map} +1 -1
  78. package/dist/{chunk-c1gq2ttb.js → chunk-8sde8337.js} +2 -2
  79. package/dist/{chunk-c1gq2ttb.js.map → chunk-8sde8337.js.map} +1 -1
  80. package/dist/{chunk-cggywjzz.js → chunk-99a4e6zf.js} +2 -2
  81. package/dist/{chunk-cggywjzz.js.map → chunk-99a4e6zf.js.map} +1 -1
  82. package/dist/chunk-b6yb3svm.js +6 -0
  83. package/dist/{chunk-539w9yt3.js.map → chunk-b6yb3svm.js.map} +2 -2
  84. package/dist/{chunk-822p54vc.js → chunk-beb265c9.js} +2 -2
  85. package/dist/{chunk-822p54vc.js.map → chunk-beb265c9.js.map} +1 -1
  86. package/dist/{chunk-hdgbh8hn.js → chunk-cxsvzqd4.js} +2 -2
  87. package/dist/{chunk-hdgbh8hn.js.map → chunk-cxsvzqd4.js.map} +1 -1
  88. package/dist/{chunk-pahr13xg.js → chunk-dt95z6et.js} +2 -2
  89. package/dist/{chunk-pahr13xg.js.map → chunk-dt95z6et.js.map} +1 -1
  90. package/dist/{chunk-hr8annr1.js → chunk-feajsgns.js} +2 -2
  91. package/dist/{chunk-hr8annr1.js.map → chunk-feajsgns.js.map} +1 -1
  92. package/dist/{chunk-2tda49mv.js → chunk-ff60bzvf.js} +2 -2
  93. package/dist/{chunk-2tda49mv.js.map → chunk-ff60bzvf.js.map} +1 -1
  94. package/dist/{chunk-b00z33zg.js → chunk-gng5e7pd.js} +1 -1
  95. package/dist/{chunk-mz73066c.js → chunk-gqgpwb88.js} +2 -2
  96. package/dist/{chunk-mz73066c.js.map → chunk-gqgpwb88.js.map} +1 -1
  97. package/dist/{chunk-h0xye69a.js → chunk-ha15x5ns.js} +2 -2
  98. package/dist/{chunk-h0xye69a.js.map → chunk-ha15x5ns.js.map} +1 -1
  99. package/dist/{chunk-d5g1caxb.js → chunk-hb9hm8za.js} +3 -3
  100. package/dist/{chunk-d5g1caxb.js.map → chunk-hb9hm8za.js.map} +1 -1
  101. package/dist/{chunk-8fvt7kys.js → chunk-hf492gg2.js} +1 -1
  102. package/dist/{chunk-fgtr9cds.js → chunk-hj88dcss.js} +3 -3
  103. package/dist/{chunk-fgtr9cds.js.map → chunk-hj88dcss.js.map} +1 -1
  104. package/dist/{chunk-hnf11jhc.js → chunk-j5g7qc5f.js} +2 -2
  105. package/dist/{chunk-hnf11jhc.js.map → chunk-j5g7qc5f.js.map} +1 -1
  106. package/dist/{chunk-e1fhy2h5.js → chunk-jgx8ggbz.js} +2 -2
  107. package/dist/{chunk-e1fhy2h5.js.map → chunk-jgx8ggbz.js.map} +1 -1
  108. package/dist/{chunk-35zw2s61.js → chunk-jx2mgvvt.js} +3 -3
  109. package/dist/{chunk-35zw2s61.js.map → chunk-jx2mgvvt.js.map} +1 -1
  110. package/dist/{chunk-w26cw41m.js → chunk-jx5zx48j.js} +2 -2
  111. package/dist/{chunk-w26cw41m.js.map → chunk-jx5zx48j.js.map} +1 -1
  112. package/dist/{chunk-z1gjgr1c.js → chunk-jy9dkgt0.js} +2 -2
  113. package/dist/{chunk-z1gjgr1c.js.map → chunk-jy9dkgt0.js.map} +1 -1
  114. package/dist/{chunk-7j48ymk1.js → chunk-k2xeskp6.js} +2 -2
  115. package/dist/{chunk-7j48ymk1.js.map → chunk-k2xeskp6.js.map} +1 -1
  116. package/dist/{chunk-jxmc33m9.js → chunk-ka991yx4.js} +2 -2
  117. package/dist/{chunk-jxmc33m9.js.map → chunk-ka991yx4.js.map} +1 -1
  118. package/dist/{chunk-65s63bdh.js → chunk-krk880my.js} +2 -2
  119. package/dist/{chunk-65s63bdh.js.map → chunk-krk880my.js.map} +1 -1
  120. package/dist/{chunk-x4yq0c9v.js → chunk-m9vwg9j1.js} +3 -3
  121. package/dist/{chunk-x4yq0c9v.js.map → chunk-m9vwg9j1.js.map} +1 -1
  122. package/dist/{chunk-x07rp3fc.js → chunk-mpqvmge4.js} +1 -1
  123. package/dist/{chunk-n7sbwpce.js → chunk-mw7ft5bs.js} +2 -2
  124. package/dist/{chunk-n7sbwpce.js.map → chunk-mw7ft5bs.js.map} +1 -1
  125. package/dist/{chunk-v5esvs66.js → chunk-njpnstck.js} +2 -2
  126. package/dist/{chunk-v5esvs66.js.map → chunk-njpnstck.js.map} +1 -1
  127. package/dist/{chunk-p320fd3g.js → chunk-p82868xx.js} +2 -2
  128. package/dist/{chunk-p320fd3g.js.map → chunk-p82868xx.js.map} +1 -1
  129. package/dist/{chunk-jbd723h1.js → chunk-pm8wjatv.js} +3 -3
  130. package/dist/{chunk-jbd723h1.js.map → chunk-pm8wjatv.js.map} +1 -1
  131. package/dist/{chunk-t227jn4b.js → chunk-q15f5g86.js} +2 -2
  132. package/dist/{chunk-t227jn4b.js.map → chunk-q15f5g86.js.map} +1 -1
  133. package/dist/{chunk-838cdh6v.js → chunk-qfra7gah.js} +2 -2
  134. package/dist/{chunk-838cdh6v.js.map → chunk-qfra7gah.js.map} +1 -1
  135. package/dist/{chunk-aprjvzrz.js → chunk-rnp5k8m3.js} +2 -2
  136. package/dist/{chunk-aprjvzrz.js.map → chunk-rnp5k8m3.js.map} +1 -1
  137. package/dist/{chunk-qz89m7ss.js → chunk-rzqft8q8.js} +2 -2
  138. package/dist/{chunk-qz89m7ss.js.map → chunk-rzqft8q8.js.map} +1 -1
  139. package/dist/{chunk-zc5962gh.js → chunk-s025aycr.js} +2 -2
  140. package/dist/{chunk-zc5962gh.js.map → chunk-s025aycr.js.map} +1 -1
  141. package/dist/{chunk-y14weak4.js → chunk-s21kn0x8.js} +2 -2
  142. package/dist/{chunk-y14weak4.js.map → chunk-s21kn0x8.js.map} +1 -1
  143. package/dist/{chunk-3wnczt5w.js → chunk-s55t7rxw.js} +2 -2
  144. package/dist/{chunk-3wnczt5w.js.map → chunk-s55t7rxw.js.map} +1 -1
  145. package/dist/{chunk-fzs7g6mc.js → chunk-s782bzeq.js} +2 -2
  146. package/dist/{chunk-fzs7g6mc.js.map → chunk-s782bzeq.js.map} +1 -1
  147. package/dist/{chunk-77ymcf7q.js → chunk-sa6cxt3g.js} +2 -2
  148. package/dist/{chunk-77ymcf7q.js.map → chunk-sa6cxt3g.js.map} +1 -1
  149. package/dist/{chunk-dz76qhx8.js → chunk-swwkdm75.js} +2 -2
  150. package/dist/{chunk-dz76qhx8.js.map → chunk-swwkdm75.js.map} +1 -1
  151. package/dist/{chunk-58mg4rpd.js → chunk-t33yh84d.js} +2 -2
  152. package/dist/{chunk-58mg4rpd.js.map → chunk-t33yh84d.js.map} +1 -1
  153. package/dist/{chunk-mym7egdq.js → chunk-vnw91fe1.js} +2 -2
  154. package/dist/{chunk-mym7egdq.js.map → chunk-vnw91fe1.js.map} +1 -1
  155. package/dist/{chunk-4wda9teq.js → chunk-w1cksc5z.js} +3 -3
  156. package/dist/{chunk-4wda9teq.js.map → chunk-w1cksc5z.js.map} +1 -1
  157. package/dist/chunk-wevj4981.js +122 -0
  158. package/dist/{chunk-fx7r6pdf.js.map → chunk-wevj4981.js.map} +3 -3
  159. package/dist/{chunk-ayjfs5mm.js → chunk-wrsf2abe.js} +2 -2
  160. package/dist/{chunk-ayjfs5mm.js.map → chunk-wrsf2abe.js.map} +1 -1
  161. package/dist/{chunk-j1wc4afr.js → chunk-x16ckgq1.js} +2 -2
  162. package/dist/{chunk-j1wc4afr.js.map → chunk-x16ckgq1.js.map} +1 -1
  163. package/dist/{chunk-gnaxedwh.js → chunk-x51tegk3.js} +2 -2
  164. package/dist/{chunk-gnaxedwh.js.map → chunk-x51tegk3.js.map} +1 -1
  165. package/dist/{chunk-qspam5cf.js → chunk-x5hj0mqp.js} +2 -2
  166. package/dist/{chunk-qspam5cf.js.map → chunk-x5hj0mqp.js.map} +1 -1
  167. package/dist/{chunk-dp2yz8bj.js → chunk-x9bk5s21.js} +2 -2
  168. package/dist/{chunk-dp2yz8bj.js.map → chunk-x9bk5s21.js.map} +1 -1
  169. package/dist/{chunk-p462p2xe.js → chunk-xvvsc58s.js} +2 -2
  170. package/dist/{chunk-p462p2xe.js.map → chunk-xvvsc58s.js.map} +1 -1
  171. package/dist/{chunk-0g5f8ymy.js → chunk-xymr3asa.js} +2 -2
  172. package/dist/{chunk-0g5f8ymy.js.map → chunk-xymr3asa.js.map} +1 -1
  173. package/dist/{chunk-j4y0sjdc.js → chunk-ysc7ykss.js} +2 -2
  174. package/dist/{chunk-j4y0sjdc.js.map → chunk-ysc7ykss.js.map} +1 -1
  175. package/dist/{chunk-3xy41vc0.js → chunk-z61dj480.js} +3 -3
  176. package/dist/{chunk-3xy41vc0.js.map → chunk-z61dj480.js.map} +1 -1
  177. package/dist/{chunk-0q68t71d.js → chunk-z9xxthp1.js} +3 -3
  178. package/dist/{chunk-0q68t71d.js.map → chunk-z9xxthp1.js.map} +1 -1
  179. package/dist/{chunk-47eav3ex.js → chunk-zv5qyrqg.js} +2 -2
  180. package/dist/{chunk-47eav3ex.js.map → chunk-zv5qyrqg.js.map} +1 -1
  181. package/dist/{chunk-asmszzkp.js → chunk-zyhmn3hy.js} +3 -3
  182. package/dist/{chunk-asmszzkp.js.map → chunk-zyhmn3hy.js.map} +1 -1
  183. package/dist/{chunk-zzgt759n.js → chunk-zypmy8yq.js} +2 -2
  184. package/dist/{chunk-zzgt759n.js.map → chunk-zypmy8yq.js.map} +1 -1
  185. package/dist/config/index.js +1 -1
  186. package/dist/console/run.js +2 -2
  187. package/dist/console/run.js.map +1 -1
  188. package/dist/container/index.js +2 -2
  189. package/dist/container/index.js.map +1 -1
  190. package/dist/database/index.js +2 -2
  191. package/dist/database/index.js.map +1 -1
  192. package/dist/email/index.js +2 -2
  193. package/dist/email/index.js.map +1 -1
  194. package/dist/facades/index.js +2 -2
  195. package/dist/facades/index.js.map +1 -1
  196. package/dist/foundation/index.js +2 -2
  197. package/dist/foundation/index.js.map +1 -1
  198. package/dist/http/ApiRouter.d.ts +27 -5
  199. package/dist/http/ApiRouter.d.ts.map +1 -1
  200. package/dist/http/index.js +2 -2
  201. package/dist/http/index.js.map +1 -1
  202. package/dist/i18n/dictionaryRuntime.js +2 -2
  203. package/dist/i18n/dictionaryRuntime.js.map +1 -1
  204. package/dist/i18n/index.js +2 -2
  205. package/dist/i18n/index.js.map +1 -1
  206. package/dist/kernel/index.js +2 -2
  207. package/dist/kernel/index.js.map +1 -1
  208. package/dist/orm/defaults.d.ts.map +1 -1
  209. package/dist/orm/index.js +3 -3
  210. package/dist/orm/index.js.map +3 -3
  211. package/dist/server/index.js +2 -2
  212. package/dist/server/index.js.map +1 -1
  213. package/dist/services/index.js +2 -2
  214. package/dist/services/index.js.map +1 -1
  215. package/dist/services/queue/work.js +2 -2
  216. package/dist/services/queue/work.js.map +1 -1
  217. package/dist/stats/route-table.js +1 -1
  218. package/dist/support/index.js +2 -2
  219. package/dist/support/index.js.map +1 -1
  220. package/dist/vitest/index.js +1 -1
  221. package/package.json +2 -1
  222. package/dist/chunk-539w9yt3.js +0 -6
  223. package/dist/chunk-fx7r6pdf.js +0 -122
  224. package/dist/chunk-mvka90rq.js +0 -5
  225. /package/dist/{chunk-dxm5gxqk.js.map → chunk-1awxdnb6.js.map} +0 -0
  226. /package/dist/{chunk-fxm8fqh9.js.map → chunk-33hdxe7v.js.map} +0 -0
  227. /package/dist/{chunk-f21v4n2v.js.map → chunk-53rr32zm.js.map} +0 -0
  228. /package/dist/{chunk-b00z33zg.js.map → chunk-gng5e7pd.js.map} +0 -0
  229. /package/dist/{chunk-8fvt7kys.js.map → chunk-hf492gg2.js.map} +0 -0
  230. /package/dist/{chunk-x07rp3fc.js.map → chunk-mpqvmge4.js.map} +0 -0
@@ -150,4 +150,23 @@ export declare function openAITarget(config: ProviderConfig, defaults?: TargetDe
150
150
  */
151
151
  export declare function azureResourceBase(config: AzureConfig): string;
152
152
  export declare function azureTarget(config: AzureConfig, defaults?: TargetDefaults): ProviderTarget;
153
+ /**
154
+ * Azure's realtime surface, which is the GA `/openai/v1` one regardless of the
155
+ * configured api-version.
156
+ *
157
+ * WHY NOT `azureTarget`. A dated api-version routes `azureTarget` to the older
158
+ * `/openai/...` path (see `azurePath`), and that path has no `realtime/calls`:
159
+ * the WebRTC "unified interface", the client secrets and the call's sideband
160
+ * socket are documented on `/openai/v1/realtime/...` only, and the documented
161
+ * URLs carry no `api-version` at all. An app that pinned a dated version for
162
+ * its Responses calls must not lose voice for it, so this target ignores the
163
+ * version and keeps everything else — the resource base and, above all, the
164
+ * per-request credential — from the one place that resolves them.
165
+ *
166
+ * NOT YET MEASURED against a real Azure realtime deployment (there was none to
167
+ * measure when this was written). The shape follows Azure's GA realtime
168
+ * documentation; when a deployment exists, the transcripts belong here as they
169
+ * do on `azureBase`.
170
+ */
171
+ export declare function azureRealtimeTarget(config: AzureConfig, defaults?: TargetDefaults): ProviderTarget;
153
172
  //# sourceMappingURL=endpoints.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"endpoints.d.ts","sourceRoot":"","sources":["../../../ai/providers/endpoints.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,cAAc,GAAG;IACzC;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;CAClC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,uEAAuE;IACvE,IAAI,EAAE,MAAM,CAAC;IACb,0DAA0D;IAC1D,KAAK,EAAE,MAAM,CAAC;IACd,gFAAgF;IAChF,OAAO,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC/C,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;gEAIgE;AAChE,eAAO,MAAM,kBAAkB,SAAU,CAAC;AAC1C,eAAO,MAAM,mBAAmB,IAAI,CAAC;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AmB,GAAG,cAAc,CAoB9F;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,WAAW,EACnB,QAAQ,GAAE,cAAmB,GAC5B,cAAc,CAGhB"}
@@ -0,0 +1,272 @@
1
+ import { type JSONSchema, type Schema } from "../Schema";
2
+ import type { AgentError, Usage } from "../types";
3
+ import type { ProviderTarget } from "./endpoints";
4
+ import { type FetchLike } from "./http";
5
+ import { RealtimeSideband, type RealtimeSidebandOptions, type WebSocketFactory } from "./sideband";
6
+ /**
7
+ * Realtime (voice) calls on OpenAI's Realtime API and Azure OpenAI's GA
8
+ * `/openai/v1/realtime` surface (#921).
9
+ *
10
+ * EXPERIMENTAL until a live call has run on Azure and on OpenAI: the request
11
+ * shapes below follow the vendors' documentation and are tested against
12
+ * fixtures only. Names and defaults may change in a minor release.
13
+ *
14
+ * THE SHAPE, and why the server holds every key. The browser makes a WebRTC
15
+ * SDP offer and posts it to the app's own route. The route posts that offer,
16
+ * together with the session config (model, instructions, tools, voice, turn
17
+ * detection, transcription), to `/realtime/calls` with the **server's**
18
+ * credential, and hands back the vendor's SDP answer. So no key or ephemeral
19
+ * secret reaches the browser, and the browser does not choose the model or the
20
+ * prompt when the call starts. It can still read the session (the data channel
21
+ * delivers `session.created` with the instructions and tool schemas) and send
22
+ * its own `session.update` / `response.create`, so instructions must hold no
23
+ * secrets, and metering on the sideband, not the prompt, is what bounds a
24
+ * misbehaving client. The server then opens the call's sideband —
25
+ * `wss://…/realtime?call_id=…` — and that is where tool calls run and usage
26
+ * arrives, which is why metering never has to trust the browser.
27
+ *
28
+ * WHAT THIS FILE IS VERIFIED AGAINST. The documented protocol only, through
29
+ * recorded fixtures; there was no Azure realtime deployment to measure when it
30
+ * was written, and no live key was used. `providers/__fixtures__/realtime-*`
31
+ * hold the request and response shapes the tests assert. When a deployment
32
+ * exists, the measurements belong in this comment, as they are on `azureBase`.
33
+ *
34
+ * POST {base}/realtime/calls multipart: sdp, session (JSON)
35
+ * → 201, body: the SDP answer, `Location: …/realtime/calls/{call_id}`
36
+ * (the "unified" flow: OpenAI's documented server-side shape)
37
+ * POST {base}/realtime/calls application/sdp: the raw offer,
38
+ * `Authorization: Bearer <ephemeral secret>` → 201 + `Location`
39
+ * (the "ephemeral" flow: Azure's documented server-proxied shape; the
40
+ * session goes into the client secret, minted server-side first)
41
+ * POST {base}/realtime/client_secrets { expires_after, session }
42
+ * → { value, expires_at, session }
43
+ * POST {base}/realtime/calls/{call_id}/hangup
44
+ * WSS {base}/realtime?call_id={call_id} the sideband (see `sideband.ts`)
45
+ *
46
+ * `{base}` is `https://api.openai.com/v1` or `https://<resource>/openai/v1`,
47
+ * from `endpoints.ts` like every other call — this file appends paths and
48
+ * nothing else.
49
+ */
50
+ /** Call creation is a handshake, not work: a vendor that has not answered an
51
+ * SDP offer in this long has not started a call worth waiting for. */
52
+ export declare const DEFAULT_REALTIME_TIMEOUT_MS = 30000;
53
+ /** The vendor's documented bounds for an ephemeral secret, and its default. */
54
+ export declare const CLIENT_SECRET_MIN_SECONDS = 10;
55
+ export declare const CLIENT_SECRET_MAX_SECONDS = 7200;
56
+ export declare const CLIENT_SECRET_DEFAULT_SECONDS = 600;
57
+ /** A function the voice model may call. Its arguments arrive on the sideband
58
+ * as `response.function_call_arguments.done`. */
59
+ export type RealtimeTool = {
60
+ name: string;
61
+ description?: string;
62
+ /** A gemi schema (`s.object(...)`) or a plain JSON Schema object. */
63
+ parameters?: Schema<unknown> | JSONSchema | Record<string, unknown>;
64
+ };
65
+ export type RealtimeTurnDetection = {
66
+ type: "semantic_vad";
67
+ eagerness?: "low" | "medium" | "high" | "auto";
68
+ createResponse?: boolean;
69
+ interruptResponse?: boolean;
70
+ } | {
71
+ type: "server_vad";
72
+ threshold?: number;
73
+ prefixPaddingMs?: number;
74
+ silenceDurationMs?: number;
75
+ idleTimeoutMs?: number;
76
+ createResponse?: boolean;
77
+ interruptResponse?: boolean;
78
+ };
79
+ /**
80
+ * A realtime session, in gemi's names. Mapped onto the vendor's GA `session`
81
+ * object (`type: "realtime"`, `audio.input`, `audio.output`, …) by
82
+ * `toVendorSession`.
83
+ *
84
+ * Only the fields an app is likely to set are named. `vendor` is merged into
85
+ * the vendor object last, for anything else the vendor adds, so a new field
86
+ * does not need a gemi release.
87
+ */
88
+ export type RealtimeSession = {
89
+ /** Defaults to the provider's model (the deployment, on Azure). */
90
+ model?: string;
91
+ instructions?: string;
92
+ voice?: string;
93
+ /** `["audio"]` by default on the vendor's side. */
94
+ outputModalities?: ("audio" | "text")[];
95
+ tools?: RealtimeTool[];
96
+ toolChoice?: "auto" | "none" | "required" | {
97
+ name: string;
98
+ };
99
+ /** `null` turns voice activity detection off, for push-to-talk: the client
100
+ * then commits the input buffer itself. */
101
+ turnDetection?: RealtimeTurnDetection | null;
102
+ /** Transcribe what the user says, so captions and transcripts exist. */
103
+ transcription?: {
104
+ model: string;
105
+ language?: string;
106
+ prompt?: string;
107
+ } | null;
108
+ noiseReduction?: "near_field" | "far_field" | null;
109
+ speed?: number;
110
+ maxOutputTokens?: number | "inf";
111
+ /** e.g. `"auto"`, or the vendor's retention-ratio object. */
112
+ truncation?: "auto" | "disabled" | Record<string, unknown>;
113
+ /** Merged into the vendor's session object last. */
114
+ vendor?: Record<string, unknown>;
115
+ };
116
+ /**
117
+ * gemi's session onto the vendor's.
118
+ *
119
+ * `model` is written only when there is one: a `session.update` on a live call
120
+ * must not try to change the model, and `createCall` always passes the
121
+ * provider's.
122
+ */
123
+ export declare function toVendorSession(session: RealtimeSession, model?: string): Record<string, unknown>;
124
+ /**
125
+ * A realtime `response.done`'s `usage` onto gemi's.
126
+ *
127
+ * Its own mapper for the reason `toImageUsage` is: the totals share names with
128
+ * the Responses API's, the details do not. Realtime documents
129
+ * `input_token_details` / `output_token_details` (no `s`), with `audio_tokens`,
130
+ * `text_tokens`, `cached_tokens` and a `cached_tokens_details` split. Both
131
+ * spellings are read, because the Responses API's `input_tokens_details` is one
132
+ * typo away and a vendor normalizing later must not zero the audio share.
133
+ */
134
+ export declare function toRealtimeUsage(raw: any): Usage;
135
+ /**
136
+ * What a realtime HTTP call failed with, as a normalized code. A promise has
137
+ * nowhere else to put it — the same reasoning as `ImageRequestError`, and the
138
+ * vendor's body is on `cause` rather than in `message` for the same reason.
139
+ */
140
+ export declare class RealtimeRequestError extends Error {
141
+ readonly code: AgentError["code"];
142
+ readonly retryable: boolean;
143
+ /** The HTTP status, when the vendor answered one. */
144
+ readonly status?: number;
145
+ constructor(error: AgentError, options?: {
146
+ cause?: unknown;
147
+ status?: number;
148
+ });
149
+ }
150
+ /**
151
+ * How `createCall` talks to the vendor. Both run server-side, and neither hands
152
+ * the browser a credential.
153
+ *
154
+ * - `"unified"`: one multipart POST (`sdp` + `session`) with the server's key.
155
+ * OpenAI documents this one.
156
+ * - `"ephemeral"`: mint a short-lived client secret carrying the session, then
157
+ * POST the raw SDP (`application/sdp`) with that secret as the Bearer. Azure
158
+ * documents this one ("Azure OpenAI expects application/sdp, not form
159
+ * data"), so it is Azure's default. The secret is used once, by the server,
160
+ * and dropped.
161
+ */
162
+ export type RealtimeCallFlow = "unified" | "ephemeral";
163
+ export type CreateCallParams = {
164
+ /** The browser's SDP offer, verbatim. */
165
+ sdp: string;
166
+ /** Overrides the client's flow for this call. */
167
+ flow?: RealtimeCallFlow;
168
+ /**
169
+ * Azure only: `?webrtcfilter=on`, which limits what the browser's data
170
+ * channel receives (no instructions, no function calls, no `response.done`).
171
+ * Keeps the prompt private, but the browser then cannot show "working" from
172
+ * the events alone.
173
+ */
174
+ webrtcFilter?: boolean;
175
+ session?: RealtimeSession;
176
+ /**
177
+ * A stable, non-identifying id for the end user (e.g. a hash of their id),
178
+ * sent as `OpenAI-Safety-Identifier` so abuse is attributed to a user and not
179
+ * to the whole app.
180
+ */
181
+ safetyIdentifier?: string;
182
+ signal?: AbortSignal;
183
+ };
184
+ export type CreateCallResult = {
185
+ /** Hand this back to the browser for `setRemoteDescription`. */
186
+ sdpAnswer: string;
187
+ /** The call's id, for the sideband and for `hangup`. */
188
+ callId: string;
189
+ };
190
+ export type ClientSecretParams = {
191
+ session?: RealtimeSession;
192
+ /** 10–7200, default 600. */
193
+ ttlSeconds?: number;
194
+ signal?: AbortSignal;
195
+ };
196
+ export type ClientSecret = {
197
+ value: string;
198
+ /** Unix seconds. */
199
+ expiresAt: number;
200
+ /** The session the vendor resolved, verbatim. */
201
+ session: unknown;
202
+ };
203
+ export type RealtimeClientOptions = {
204
+ /** The model a call uses when its session names none. The deployment, on Azure. */
205
+ model: string;
206
+ /** `"unified"` by default; `AzureOpenAIProvider` passes `"ephemeral"`. See
207
+ * `RealtimeCallFlow`. */
208
+ callFlow?: RealtimeCallFlow;
209
+ /** Injected by tests. Defaults to the global `fetch`. */
210
+ fetchImpl?: FetchLike;
211
+ /** Injected by tests. Defaults to the global `WebSocket` (Bun's, which takes
212
+ * `headers`). */
213
+ webSocket?: WebSocketFactory;
214
+ };
215
+ /**
216
+ * The realtime surface of one provider. `OpenAIProvider#realtime` and
217
+ * `AzureOpenAIProvider#realtime` return one of these, built on the provider's
218
+ * resolved `ProviderTarget`, so the host, the credential and Azure's `/openai`
219
+ * handling come from `endpoints.ts`.
220
+ *
221
+ * @experimental Not yet verified against a live Azure or OpenAI call.
222
+ */
223
+ export declare class RealtimeClient {
224
+ readonly model: string;
225
+ private readonly target;
226
+ private readonly options;
227
+ constructor(target: ProviderTarget, options: RealtimeClientOptions);
228
+ /** `https://…/v1/realtime/calls` etc. Exposed for logs and tests. */
229
+ url(path: string): string;
230
+ /** The sideband's URL for a call: the HTTP base with a `wss` scheme. */
231
+ sidebandUrl(callId: string): string;
232
+ /**
233
+ * Starts a WebRTC call from the browser's SDP offer, server-side.
234
+ *
235
+ * Not retried on a timeout: a call the vendor created and we hung up on is
236
+ * not one the browser can join, and a second offer starts a second call.
237
+ * A 429 or 5xx is retried, since those say no call was made.
238
+ */
239
+ createCall(params: CreateCallParams): Promise<CreateCallResult>;
240
+ /**
241
+ * An ephemeral secret for apps that let the browser connect on its own. The
242
+ * browser then receives the function calls, and its reported usage is not
243
+ * something to bill from — prefer `createCall` plus the sideband.
244
+ */
245
+ clientSecret(params?: ClientSecretParams): Promise<ClientSecret>;
246
+ /**
247
+ * Ends a call for everyone: the browser's peer connection closes and so does
248
+ * any sideband.
249
+ *
250
+ * A 404 counts as "already over" only when its body says the *call* was not
251
+ * found. Any other 404 — a route the vendor does not have (Azure does not
252
+ * document `/hangup`), a wrong deployment — throws, because treating it as
253
+ * success would let the caller drop the sideband, the only thing metering
254
+ * the call, while the call goes on.
255
+ */
256
+ hangup(callId: string, options?: {
257
+ signal?: AbortSignal;
258
+ }): Promise<void>;
259
+ /**
260
+ * The call's server-side control channel. Opens at once; events sent before
261
+ * it is open are queued. See `RealtimeSideband`.
262
+ */
263
+ sideband(callId: string, options?: RealtimeSidebandOptions): RealtimeSideband;
264
+ private request;
265
+ }
266
+ /**
267
+ * A hangup's 404 that names the call, not the route: an error body whose code
268
+ * or message is about the call (or its id). A bare 404, or "Resource not
269
+ * found", is a route the vendor does not serve.
270
+ */
271
+ export declare function isCallNotFound(error: unknown, callId: string): boolean;
272
+ //# sourceMappingURL=realtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"realtime.d.ts","sourceRoot":"","sources":["../../../ai/providers/realtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,UAAU,EAAE,KAAK,MAAM,EAAE,MAAM,WAAW,CAAC;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,KAAK,uBAAuB,EAAE,KAAK,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,CAAC,QAAQ,CAAC,MAAM,CAAiB;IACxC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAwB;gBAEpC,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,qBAAqB;IAMlE,qEAAqE;IACrE,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAIzB,wEAAwE;IACxE,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAMnC;;;;;;OAMG;IACG,UAAU,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAuCrE;;;;OAIG;IACG,YAAY,CAAC,MAAM,GAAE,kBAAuB,GAAG,OAAO,CAAC,YAAY,CAAC;IAmC1E;;;;;;;;;OASG;IACG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAA;KAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAanF;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,uBAA4B,GAAG,gBAAgB;YAWnE,OAAO;CAiBtB;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAStE"}
@@ -0,0 +1,254 @@
1
+ import type { Usage } from "../types";
2
+ import type { RealtimeSession } from "./realtime";
3
+ /**
4
+ * A realtime call's sideband: the server's own WebSocket to a call the browser
5
+ * joined over WebRTC (`wss://…/realtime?call_id=…`).
6
+ *
7
+ * WHY IT EXISTS. The browser holds the audio; the server holds the authority.
8
+ * Every function call the voice model makes arrives here, and so does every
9
+ * `response.done` with its usage — so tools run with the server's checks and
10
+ * metering does not depend on what a browser chooses to report. The server can
11
+ * also end the call (`hangup`), which a browser-only design cannot.
12
+ *
13
+ * THE EVENTS ARE THE VENDOR'S, as documented for the GA Realtime API, with two
14
+ * additions and one normalisation:
15
+ *
16
+ * - `response.done` gains `usage`, gemi's `Usage` (audio tokens included).
17
+ * - `sideband.reconnected` and `sideband.closed` are gemi's own, so a consumer
18
+ * iterating events learns about the connection in the same loop.
19
+ * - The beta names for transcript and text deltas are renamed to the GA ones
20
+ * (`response.audio_transcript.delta` → `response.output_audio_transcript.delta`),
21
+ * so code written against one surface does not miss events on the other.
22
+ *
23
+ * Keeping the vendor's names — rather than mapping each event onto gemi's — is
24
+ * a deliberate trade: the protocol has some forty server events, the vendor
25
+ * adds more, and a mapping layer would drop every one it did not know. An
26
+ * unknown event arrives as itself, with its own `type`.
27
+ *
28
+ * VERIFIED against the documented protocol through fixtures only; see
29
+ * `realtime.ts`. Whether Azure accepts `call_id` on its sideband the way OpenAI
30
+ * does is the open question #921 records.
31
+ */
32
+ /** The vendor's error envelope on an `error` event. */
33
+ export type RealtimeErrorDetail = {
34
+ type?: string;
35
+ code?: string;
36
+ message: string;
37
+ param?: string;
38
+ event_id?: string;
39
+ };
40
+ export type RealtimeServerEvent = {
41
+ type: "session.created" | "session.updated";
42
+ event_id?: string;
43
+ session: Record<string, any>;
44
+ } | {
45
+ type: "error";
46
+ event_id?: string;
47
+ error: RealtimeErrorDetail;
48
+ } | {
49
+ type: "input_audio_buffer.speech_started";
50
+ item_id: string;
51
+ audio_start_ms?: number;
52
+ } | {
53
+ type: "input_audio_buffer.speech_stopped";
54
+ item_id: string;
55
+ audio_end_ms?: number;
56
+ } | {
57
+ type: "input_audio_buffer.committed";
58
+ item_id: string;
59
+ previous_item_id?: string | null;
60
+ } | {
61
+ type: "conversation.item.input_audio_transcription.delta";
62
+ item_id: string;
63
+ delta: string;
64
+ } | {
65
+ type: "conversation.item.input_audio_transcription.completed";
66
+ item_id: string;
67
+ transcript: string;
68
+ /** The vendor's, verbatim: `{ type: "tokens", … }` or `{ type: "duration", seconds }`. */
69
+ usage?: Record<string, any>;
70
+ /** gemi's: a token-billed transcription's usage, mapped (audio tokens in
71
+ * `audioInputTokens`). Billed apart from `response.done`'s, at the
72
+ * transcription model's rates. */
73
+ transcriptionUsage?: Usage;
74
+ /** gemi's: a duration-billed transcription's seconds. */
75
+ transcriptionSeconds?: number;
76
+ } | {
77
+ type: "response.created";
78
+ response: Record<string, any>;
79
+ } | {
80
+ type: "response.output_audio_transcript.delta" | "response.output_text.delta";
81
+ response_id: string;
82
+ item_id: string;
83
+ delta: string;
84
+ } | {
85
+ type: "response.output_audio_transcript.done";
86
+ response_id: string;
87
+ item_id: string;
88
+ transcript: string;
89
+ } | {
90
+ type: "response.output_text.done";
91
+ response_id: string;
92
+ item_id: string;
93
+ text: string;
94
+ } | {
95
+ type: "response.function_call_arguments.done";
96
+ response_id: string;
97
+ item_id: string;
98
+ /** The id the `function_call_output` must answer. */
99
+ call_id: string;
100
+ name: string;
101
+ /** JSON, as the model wrote it. Untrusted: parse and validate. */
102
+ arguments: string;
103
+ } | {
104
+ type: "response.done";
105
+ response: {
106
+ id: string;
107
+ status: "completed" | "cancelled" | "failed" | "incomplete" | (string & {});
108
+ status_details?: Record<string, any> | null;
109
+ output?: Record<string, any>[];
110
+ usage?: Record<string, any>;
111
+ [key: string]: unknown;
112
+ };
113
+ /** gemi's: the response's usage, mapped. Absent when the vendor sent none. */
114
+ usage?: Usage;
115
+ } | {
116
+ type: "output_audio_buffer.started" | "output_audio_buffer.stopped";
117
+ response_id?: string;
118
+ } | {
119
+ type: "sideband.reconnected";
120
+ attempt: number;
121
+ } | {
122
+ type: "sideband.closed";
123
+ code: number;
124
+ reason: string;
125
+ /** `true` when this side closed it (`close()` / `hangup()`). */
126
+ byClient: boolean;
127
+ };
128
+ /** Any event, including ones gemi has no type for. Narrow on `type`. */
129
+ export type RealtimeEvent = RealtimeServerEvent | {
130
+ type: string;
131
+ [key: string]: unknown;
132
+ };
133
+ /** One frame off the socket onto a `RealtimeEvent`. `undefined` for a frame
134
+ * that is not a JSON object with a `type`. Exported for tests. */
135
+ export declare function parseRealtimeEvent(data: unknown): RealtimeEvent | undefined;
136
+ /** A client event as the vendor documents it. `send` takes any of them. */
137
+ export type RealtimeClientEvent = {
138
+ type: string;
139
+ [key: string]: unknown;
140
+ };
141
+ export type RealtimeResponseOptions = {
142
+ /** Instructions for this response only, e.g. "Say this in one sentence." */
143
+ instructions?: string;
144
+ toolChoice?: "auto" | "none" | "required" | {
145
+ name: string;
146
+ };
147
+ outputModalities?: ("audio" | "text")[];
148
+ /** `"none"` makes an out-of-band response that is not added to the
149
+ * conversation. */
150
+ conversation?: "auto" | "none";
151
+ metadata?: Record<string, string>;
152
+ /** Merged into the vendor's `response` object last. */
153
+ vendor?: Record<string, unknown>;
154
+ };
155
+ /** The part of the WHATWG `WebSocket` the sideband uses. */
156
+ export type WebSocketLike = {
157
+ readonly readyState: number;
158
+ send(data: string): void;
159
+ close(code?: number, reason?: string): void;
160
+ addEventListener(type: "open" | "message" | "close" | "error", listener: (event: any) => void): void;
161
+ };
162
+ /** Opens a socket with headers. Bun's `WebSocket` takes `{ headers }` as its
163
+ * second argument, which is what the default uses. */
164
+ export type WebSocketFactory = (url: string, init: {
165
+ headers: Record<string, string>;
166
+ }) => WebSocketLike;
167
+ export type RealtimeSidebandOptions = {
168
+ /**
169
+ * Re-opening a dropped sideband by `callId`. The call itself survives a lost
170
+ * control socket, but a call nobody is metering is the thing this exists to
171
+ * prevent, so a consumer that gives up should `hangup()`.
172
+ *
173
+ * Only an abnormal close is retried. A normal close (1000) is the vendor
174
+ * saying the call is over.
175
+ */
176
+ reconnect?: {
177
+ attempts?: number;
178
+ delayMs?: number;
179
+ };
180
+ webSocket?: WebSocketFactory;
181
+ };
182
+ type SidebandInit = RealtimeSidebandOptions & {
183
+ callId: string;
184
+ url: string;
185
+ headers: () => Promise<Record<string, string>>;
186
+ hangup: () => Promise<void>;
187
+ };
188
+ export declare class RealtimeSideband implements AsyncIterable<RealtimeEvent> {
189
+ readonly callId: string;
190
+ /** Resolves when the socket first opens; rejects when it never does. */
191
+ readonly ready: Promise<void>;
192
+ /** Resolves with the final `sideband.closed` event. */
193
+ readonly closed: Promise<Extract<RealtimeServerEvent, {
194
+ type: "sideband.closed";
195
+ }>>;
196
+ private readonly init;
197
+ private socket?;
198
+ private finalEvent?;
199
+ private outbox;
200
+ private subscribers;
201
+ private listeners;
202
+ /** Events that arrived before anyone subscribed, handed to the first one. */
203
+ private backlog;
204
+ private closing;
205
+ private finished;
206
+ private everOpened;
207
+ private failures;
208
+ private resolveReady;
209
+ private rejectReady;
210
+ private resolveClosed;
211
+ constructor(init: SidebandInit);
212
+ /** Sends a client event; queued while the socket is (re)connecting. */
213
+ send(event: RealtimeClientEvent): void;
214
+ updateSession(session: RealtimeSession): void;
215
+ /** Adds an item to the conversation without asking for a response. */
216
+ addItem(item: Record<string, unknown>): void;
217
+ /**
218
+ * A quiet note for the voice model (a `system` message): context it can use
219
+ * on its next answer, without making it speak now.
220
+ */
221
+ addNote(text: string): void;
222
+ /** Answers a function call. `output` is sent as-is when a string, as JSON
223
+ * otherwise. Call `createResponse()` after it for the model to speak. */
224
+ functionOutput(callId: string, output: unknown): void;
225
+ createResponse(options?: RealtimeResponseOptions): void;
226
+ cancelResponse(responseId?: string): void;
227
+ /** Calls `listener` for every event from now on. Returns an unsubscribe. */
228
+ on(listener: (event: RealtimeEvent) => void): () => void;
229
+ /**
230
+ * Every event, in order, until the sideband closes for good (the last one is
231
+ * `sideband.closed`). Each iterator gets the events from the moment it
232
+ * starts; the first one also gets any that arrived before it.
233
+ */
234
+ [Symbol.asyncIterator](): AsyncIterator<RealtimeEvent>;
235
+ /** Closes this side's control socket. The call goes on; another process can
236
+ * open its own sideband by `callId`. */
237
+ close(code?: number, reason?: string): void;
238
+ /**
239
+ * Ends the call for everyone, then closes the socket.
240
+ *
241
+ * When the vendor refuses the hangup, the socket stays open and the error is
242
+ * thrown: the call may still be running, and this socket is what meters it.
243
+ * The caller decides whether to retry or to wait for the vendor to close it.
244
+ * A sideband the vendor already closed normally (the call is over) needs no
245
+ * hangup, so its failure is ignored.
246
+ */
247
+ hangup(): Promise<void>;
248
+ private open;
249
+ private dropped;
250
+ private finish;
251
+ private emit;
252
+ }
253
+ export {};
254
+ //# sourceMappingURL=sideband.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sideband.d.ts","sourceRoot":"","sources":["../../../ai/providers/sideband.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAGlD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAIH,uDAAuD;AACvD,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAC3B;IAAE,IAAI,EAAE,iBAAiB,GAAG,iBAAiB,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAAE,GAChG;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,mBAAmB,CAAA;CAAE,GAChE;IAAE,IAAI,EAAE,mCAAmC,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,cAAc,CAAC,EAAE,MAAM,CAAA;CAAE,GACvF;IAAE,IAAI,EAAE,mCAAmC,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,GACrF;IAAE,IAAI,EAAE,8BAA8B,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAC3F;IAAE,IAAI,EAAE,mDAAmD,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AC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC,CASjF;AAID,wBAAgB,UAAU,IAAI,KAAK,CAElC;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,GAAG,SAAS,GAAG,KAAK,CAerE;AAcD;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAoCjD;AACD;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC,CAE7F;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAC3B,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,EACjB,IAAI,EAAE,MAAM,GACX;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,CAAC,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,UAAU,CAAA;CAAE,CAW3D;AAID;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGhD;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,GAAG,WAAW,EAAE,KAAK,EAAE,MAAM,QAS1F;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE,MAAM,GAAG,SAAS,EAAE,KAAK,EAAE,MAAM,QAS3F"}
@@ -62,6 +62,21 @@ export type Usage = {
62
62
  */
63
63
  imageInputTokens?: number;
64
64
  imageOutputTokens?: number;
65
+ /**
66
+ * How much of `inputTokens` / `outputTokens` was audio, on a realtime (voice)
67
+ * response. A breakdown like `imageInputTokens`, not a separate bucket: the
68
+ * vendor's `input_tokens` already includes them.
69
+ *
70
+ * `cachedAudioInputTokens` is the audio share of `cachedInputTokens`. It is
71
+ * its own field because audio is priced several times higher than text and
72
+ * its cached rate is a small fraction of the uncached one, so a voice
73
+ * session cannot be priced from the totals.
74
+ *
75
+ * Absent on usage from a text or image call.
76
+ */
77
+ audioInputTokens?: number;
78
+ cachedAudioInputTokens?: number;
79
+ audioOutputTokens?: number;
65
80
  totalTokens: number;
66
81
  };
67
82
  export type FinishReason = "stop" | "length"
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../ai/types.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAEhE;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,SAAS,GAAG;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAChF,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AAEnD,MAAM,MAAM,KAAK,GAAG;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,kEAAkE;IAClE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,YAAY,GACpB,MAAM,GACN,QAAQ;AACV;6EAC6E;GAC3E,WAAW;AACb;iEACiE;GAC/D,gBAAgB,GAChB,SAAS,GACT,OAAO;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