@pipedog/core 0.0.0 → 0.1.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 (698) hide show
  1. package/LICENSE +25 -0
  2. package/NOTICE +9 -0
  3. package/dist/adapters/base_llm_adapter.d.ts +266 -0
  4. package/dist/adapters/base_llm_adapter.js +489 -0
  5. package/dist/adapters/index.d.ts +2 -0
  6. package/dist/adapters/index.js +8 -0
  7. package/dist/adapters/schemas/direct_function.d.ts +202 -0
  8. package/dist/adapters/schemas/direct_function.js +302 -0
  9. package/dist/adapters/schemas/function_schema.d.ts +67 -0
  10. package/dist/adapters/schemas/function_schema.js +72 -0
  11. package/dist/adapters/schemas/index.d.ts +2 -0
  12. package/dist/adapters/schemas/index.js +8 -0
  13. package/dist/adapters/schemas/tools_schema.d.ts +57 -0
  14. package/dist/adapters/schemas/tools_schema.js +79 -0
  15. package/dist/adapters/services/index.d.ts +2 -0
  16. package/dist/adapters/services/index.js +8 -0
  17. package/dist/adapters/services/open_ai_adapter.d.ts +147 -0
  18. package/dist/adapters/services/open_ai_adapter.js +250 -0
  19. package/dist/audio/dtmf/dtmf_data.d.ts +3 -0
  20. package/dist/audio/dtmf/dtmf_data.js +22 -0
  21. package/dist/audio/dtmf/index.d.ts +2 -0
  22. package/dist/audio/dtmf/index.js +8 -0
  23. package/dist/audio/dtmf/types.d.ts +31 -0
  24. package/dist/audio/dtmf/types.js +35 -0
  25. package/dist/audio/dtmf/utils.d.ts +13 -0
  26. package/dist/audio/dtmf/utils.js +62 -0
  27. package/dist/audio/filters/base_audio_filter.d.ts +51 -0
  28. package/dist/audio/filters/base_audio_filter.js +17 -0
  29. package/dist/audio/filters/index.d.ts +2 -0
  30. package/dist/audio/filters/index.js +8 -0
  31. package/dist/audio/index.d.ts +2 -0
  32. package/dist/audio/index.js +8 -0
  33. package/dist/audio/krisp_instance.d.ts +95 -0
  34. package/dist/audio/krisp_instance.js +229 -0
  35. package/dist/audio/mixers/base_audio_mixer.d.ts +56 -0
  36. package/dist/audio/mixers/base_audio_mixer.js +16 -0
  37. package/dist/audio/mixers/index.d.ts +2 -0
  38. package/dist/audio/mixers/index.js +8 -0
  39. package/dist/audio/resamplers/base_audio_resampler.d.ts +46 -0
  40. package/dist/audio/resamplers/base_audio_resampler.js +35 -0
  41. package/dist/audio/resamplers/index.d.ts +2 -0
  42. package/dist/audio/resamplers/index.js +8 -0
  43. package/dist/audio/resamplers/resampy_resampler.d.ts +10 -0
  44. package/dist/audio/resamplers/resampy_resampler.js +15 -0
  45. package/dist/audio/resamplers/soxr_resampler.d.ts +54 -0
  46. package/dist/audio/resamplers/soxr_resampler.js +69 -0
  47. package/dist/audio/resamplers/soxr_stream_resampler.d.ts +75 -0
  48. package/dist/audio/resamplers/soxr_stream_resampler.js +146 -0
  49. package/dist/audio/turn/base_turn_analyzer.d.ts +84 -0
  50. package/dist/audio/turn/base_turn_analyzer.js +61 -0
  51. package/dist/audio/turn/index.d.ts +2 -0
  52. package/dist/audio/turn/index.js +8 -0
  53. package/dist/audio/turn/smart_turn/_whisper_features.d.ts +30 -0
  54. package/dist/audio/turn/smart_turn/_whisper_features.js +225 -0
  55. package/dist/audio/turn/smart_turn/base_smart_turn.d.ts +94 -0
  56. package/dist/audio/turn/smart_turn/base_smart_turn.js +239 -0
  57. package/dist/audio/turn/smart_turn/local_smart_turn_v3.d.ts +76 -0
  58. package/dist/audio/turn/smart_turn/local_smart_turn_v3.js +143 -0
  59. package/dist/audio/utils.d.ts +224 -0
  60. package/dist/audio/utils.js +634 -0
  61. package/dist/audio/vad/data/index.d.ts +2 -0
  62. package/dist/audio/vad/data/index.js +8 -0
  63. package/dist/audio/vad/index.d.ts +2 -0
  64. package/dist/audio/vad/index.js +8 -0
  65. package/dist/audio/vad/vad_analyzer.d.ts +126 -0
  66. package/dist/audio/vad/vad_analyzer.js +211 -0
  67. package/dist/audio/vad/vad_controller.d.ts +143 -0
  68. package/dist/audio/vad/vad_controller.js +228 -0
  69. package/dist/audio/volume.d.ts +38 -0
  70. package/dist/audio/volume.js +75 -0
  71. package/dist/bus/adapters/base.d.ts +35 -0
  72. package/dist/bus/adapters/base.js +19 -0
  73. package/dist/bus/adapters/index.d.ts +10 -0
  74. package/dist/bus/adapters/index.js +15 -0
  75. package/dist/bus/adapters/llm_context_adapter.d.ts +36 -0
  76. package/dist/bus/adapters/llm_context_adapter.js +82 -0
  77. package/dist/bus/adapters/tools_schema_adapter.d.ts +25 -0
  78. package/dist/bus/adapters/tools_schema_adapter.js +70 -0
  79. package/dist/bus/bridge_processor.d.ts +111 -0
  80. package/dist/bus/bridge_processor.js +166 -0
  81. package/dist/bus/bus.d.ts +110 -0
  82. package/dist/bus/bus.js +200 -0
  83. package/dist/bus/index.d.ts +22 -0
  84. package/dist/bus/index.js +27 -0
  85. package/dist/bus/local/async_queue.d.ts +12 -0
  86. package/dist/bus/local/async_queue.js +21 -0
  87. package/dist/bus/local/index.d.ts +3 -0
  88. package/dist/bus/local/index.js +8 -0
  89. package/dist/bus/messages.d.ts +378 -0
  90. package/dist/bus/messages.js +357 -0
  91. package/dist/bus/network/index.d.ts +16 -0
  92. package/dist/bus/network/index.js +21 -0
  93. package/dist/bus/queue.d.ts +27 -0
  94. package/dist/bus/queue.js +51 -0
  95. package/dist/bus/serializers/base.d.ts +25 -0
  96. package/dist/bus/serializers/base.js +14 -0
  97. package/dist/bus/serializers/index.d.ts +9 -0
  98. package/dist/bus/serializers/index.js +14 -0
  99. package/dist/bus/serializers/json.d.ts +77 -0
  100. package/dist/bus/serializers/json.js +367 -0
  101. package/dist/bus/subscriber.d.ts +46 -0
  102. package/dist/bus/subscriber.js +27 -0
  103. package/dist/bus/ui/index.d.ts +3 -0
  104. package/dist/bus/ui/index.js +8 -0
  105. package/dist/bus/ui/messages.d.ts +186 -0
  106. package/dist/bus/ui/messages.js +171 -0
  107. package/dist/classifiers/base_classifier.d.ts +263 -0
  108. package/dist/classifiers/base_classifier.js +346 -0
  109. package/dist/classifiers/cloudflare/clef/classifier.d.ts +70 -0
  110. package/dist/classifiers/cloudflare/clef/classifier.js +204 -0
  111. package/dist/classifiers/cloudflare/clef/client.d.ts +104 -0
  112. package/dist/classifiers/cloudflare/clef/client.js +234 -0
  113. package/dist/classifiers/cloudflare/clef/index.d.ts +2 -0
  114. package/dist/classifiers/cloudflare/clef/index.js +8 -0
  115. package/dist/classifiers/cloudflare/index.d.ts +2 -0
  116. package/dist/classifiers/cloudflare/index.js +8 -0
  117. package/dist/classifiers/http_client.d.ts +70 -0
  118. package/dist/classifiers/http_client.js +161 -0
  119. package/dist/classifiers/index.d.ts +2 -0
  120. package/dist/classifiers/index.js +8 -0
  121. package/dist/classifiers/jev/classifier.d.ts +8 -0
  122. package/dist/classifiers/jev/classifier.js +13 -0
  123. package/dist/classifiers/jev/client.d.ts +8 -0
  124. package/dist/classifiers/jev/client.js +13 -0
  125. package/dist/classifiers/jev/index.d.ts +2 -0
  126. package/dist/classifiers/jev/index.js +8 -0
  127. package/dist/classifiers/llm/classifier.d.ts +72 -0
  128. package/dist/classifiers/llm/classifier.js +304 -0
  129. package/dist/classifiers/llm/index.d.ts +2 -0
  130. package/dist/classifiers/llm/index.js +8 -0
  131. package/dist/classifiers/openai/decisions/classifier.d.ts +77 -0
  132. package/dist/classifiers/openai/decisions/classifier.js +241 -0
  133. package/dist/classifiers/openai/decisions/client.d.ts +108 -0
  134. package/dist/classifiers/openai/decisions/client.js +234 -0
  135. package/dist/classifiers/openai/decisions/index.d.ts +2 -0
  136. package/dist/classifiers/openai/decisions/index.js +8 -0
  137. package/dist/classifiers/openai/index.d.ts +2 -0
  138. package/dist/classifiers/openai/index.js +8 -0
  139. package/dist/classifiers/typesafe/index.d.ts +2 -0
  140. package/dist/classifiers/typesafe/index.js +8 -0
  141. package/dist/classifiers/typesafe/jev/classifier.d.ts +70 -0
  142. package/dist/classifiers/typesafe/jev/classifier.js +220 -0
  143. package/dist/classifiers/typesafe/jev/client.d.ts +105 -0
  144. package/dist/classifiers/typesafe/jev/client.js +233 -0
  145. package/dist/classifiers/typesafe/jev/index.d.ts +2 -0
  146. package/dist/classifiers/typesafe/jev/index.js +8 -0
  147. package/dist/clocks/base_clock.d.ts +13 -0
  148. package/dist/clocks/base_clock.js +14 -0
  149. package/dist/clocks/index.d.ts +2 -0
  150. package/dist/clocks/index.js +8 -0
  151. package/dist/clocks/system_clock.d.ts +15 -0
  152. package/dist/clocks/system_clock.js +25 -0
  153. package/dist/frames/frames.d.ts +2533 -0
  154. package/dist/frames/frames.js +2485 -0
  155. package/dist/frames/index.d.ts +2 -0
  156. package/dist/frames/index.js +8 -0
  157. package/dist/frames/protobufs/frames_pb2.d.ts +229 -0
  158. package/dist/frames/protobufs/frames_pb2.js +466 -0
  159. package/dist/index.d.ts +11 -0
  160. package/dist/index.js +56 -0
  161. package/dist/metrics/index.d.ts +2 -0
  162. package/dist/metrics/index.js +8 -0
  163. package/dist/metrics/metrics.d.ts +276 -0
  164. package/dist/metrics/metrics.js +254 -0
  165. package/dist/observers/base_observer.d.ts +173 -0
  166. package/dist/observers/base_observer.js +151 -0
  167. package/dist/observers/error_observer.d.ts +75 -0
  168. package/dist/observers/error_observer.js +87 -0
  169. package/dist/observers/function_call_observer.d.ts +157 -0
  170. package/dist/observers/function_call_observer.js +222 -0
  171. package/dist/observers/index.d.ts +2 -0
  172. package/dist/observers/index.js +8 -0
  173. package/dist/observers/loggers/debug_log_observer.d.ts +91 -0
  174. package/dist/observers/loggers/debug_log_observer.js +228 -0
  175. package/dist/observers/loggers/index.d.ts +2 -0
  176. package/dist/observers/loggers/index.js +8 -0
  177. package/dist/observers/loggers/llm_log_observer.d.ts +24 -0
  178. package/dist/observers/loggers/llm_log_observer.js +110 -0
  179. package/dist/observers/loggers/metrics_log_observer.d.ts +85 -0
  180. package/dist/observers/loggers/metrics_log_observer.js +186 -0
  181. package/dist/observers/loggers/transcription_log_observer.d.ts +23 -0
  182. package/dist/observers/loggers/transcription_log_observer.js +74 -0
  183. package/dist/observers/service_metrics_observer.d.ts +168 -0
  184. package/dist/observers/service_metrics_observer.js +236 -0
  185. package/dist/observers/speaking_observer.d.ts +104 -0
  186. package/dist/observers/speaking_observer.js +150 -0
  187. package/dist/observers/startup_timing_observer.d.ts +221 -0
  188. package/dist/observers/startup_timing_observer.js +365 -0
  189. package/dist/observers/turn_tracking_observer.d.ts +78 -0
  190. package/dist/observers/turn_tracking_observer.js +189 -0
  191. package/dist/observers/user_bot_latency_observer.d.ts +411 -0
  192. package/dist/observers/user_bot_latency_observer.js +974 -0
  193. package/dist/pipeline/base_pipeline.d.ts +49 -0
  194. package/dist/pipeline/base_pipeline.js +101 -0
  195. package/dist/pipeline/capabilities.d.ts +76 -0
  196. package/dist/pipeline/capabilities.js +97 -0
  197. package/dist/pipeline/index.d.ts +2 -0
  198. package/dist/pipeline/index.js +8 -0
  199. package/dist/pipeline/job_context.d.ts +317 -0
  200. package/dist/pipeline/job_context.js +450 -0
  201. package/dist/pipeline/job_decorator.d.ts +54 -0
  202. package/dist/pipeline/job_decorator.js +92 -0
  203. package/dist/pipeline/llm_switcher.d.ts +84 -0
  204. package/dist/pipeline/llm_switcher.js +107 -0
  205. package/dist/pipeline/llm_with_backend.d.ts +435 -0
  206. package/dist/pipeline/llm_with_backend.js +806 -0
  207. package/dist/pipeline/parallel_pipeline.d.ts +83 -0
  208. package/dist/pipeline/parallel_pipeline.js +200 -0
  209. package/dist/pipeline/pipeline.d.ts +126 -0
  210. package/dist/pipeline/pipeline.js +196 -0
  211. package/dist/pipeline/service_switcher.d.ts +287 -0
  212. package/dist/pipeline/service_switcher.js +509 -0
  213. package/dist/pipeline/sync_parallel_pipeline.d.ts +192 -0
  214. package/dist/pipeline/sync_parallel_pipeline.js +387 -0
  215. package/dist/pipeline/worker.d.ts +814 -0
  216. package/dist/pipeline/worker.js +1639 -0
  217. package/dist/pipeline/worker_observer.d.ts +131 -0
  218. package/dist/pipeline/worker_observer.js +274 -0
  219. package/dist/pipeline/worker_ready_decorator.d.ts +45 -0
  220. package/dist/pipeline/worker_ready_decorator.js +76 -0
  221. package/dist/processors/aggregators/async_tool_messages.d.ts +146 -0
  222. package/dist/processors/aggregators/async_tool_messages.js +291 -0
  223. package/dist/processors/aggregators/dtmf_aggregator.d.ts +61 -0
  224. package/dist/processors/aggregators/dtmf_aggregator.js +144 -0
  225. package/dist/processors/aggregators/gated.d.ts +43 -0
  226. package/dist/processors/aggregators/gated.js +86 -0
  227. package/dist/processors/aggregators/gated_llm_context.d.ts +42 -0
  228. package/dist/processors/aggregators/gated_llm_context.js +86 -0
  229. package/dist/processors/aggregators/index.d.ts +2 -0
  230. package/dist/processors/aggregators/index.js +8 -0
  231. package/dist/processors/aggregators/llm_context.d.ts +370 -0
  232. package/dist/processors/aggregators/llm_context.js +580 -0
  233. package/dist/processors/aggregators/llm_context_summarizer.d.ts +219 -0
  234. package/dist/processors/aggregators/llm_context_summarizer.js +447 -0
  235. package/dist/processors/aggregators/llm_response.d.ts +37 -0
  236. package/dist/processors/aggregators/llm_response.js +71 -0
  237. package/dist/processors/aggregators/llm_response_universal.d.ts +966 -0
  238. package/dist/processors/aggregators/llm_response_universal.js +2394 -0
  239. package/dist/processors/aggregators/llm_text_processor.d.ts +53 -0
  240. package/dist/processors/aggregators/llm_text_processor.js +102 -0
  241. package/dist/processors/aggregators/sentence.d.ts +39 -0
  242. package/dist/processors/aggregators/sentence.js +69 -0
  243. package/dist/processors/async_generator.d.ts +42 -0
  244. package/dist/processors/async_generator.js +76 -0
  245. package/dist/processors/audio/audio_buffer_processor.d.ts +241 -0
  246. package/dist/processors/audio/audio_buffer_processor.js +565 -0
  247. package/dist/processors/audio/index.d.ts +2 -0
  248. package/dist/processors/audio/index.js +8 -0
  249. package/dist/processors/audio/vad_processor.d.ts +67 -0
  250. package/dist/processors/audio/vad_processor.js +103 -0
  251. package/dist/processors/consumer_processor.d.ts +49 -0
  252. package/dist/processors/consumer_processor.js +85 -0
  253. package/dist/processors/filters/frame_filter.d.ts +39 -0
  254. package/dist/processors/filters/frame_filter.js +52 -0
  255. package/dist/processors/filters/function_filter.d.ts +59 -0
  256. package/dist/processors/filters/function_filter.js +78 -0
  257. package/dist/processors/filters/identity_filter.d.ts +33 -0
  258. package/dist/processors/filters/identity_filter.js +37 -0
  259. package/dist/processors/filters/index.d.ts +2 -0
  260. package/dist/processors/filters/index.js +8 -0
  261. package/dist/processors/filters/null_filter.d.ts +34 -0
  262. package/dist/processors/filters/null_filter.js +47 -0
  263. package/dist/processors/filters/wake_notifier_filter.d.ts +48 -0
  264. package/dist/processors/filters/wake_notifier_filter.js +49 -0
  265. package/dist/processors/frame_processor.d.ts +360 -0
  266. package/dist/processors/frame_processor.js +932 -0
  267. package/dist/processors/frameworks/index.d.ts +2 -0
  268. package/dist/processors/frameworks/index.js +8 -0
  269. package/dist/processors/frameworks/rtvi/frames.d.ts +241 -0
  270. package/dist/processors/frameworks/rtvi/frames.js +259 -0
  271. package/dist/processors/frameworks/rtvi/index.d.ts +6 -0
  272. package/dist/processors/frameworks/rtvi/index.js +11 -0
  273. package/dist/processors/frameworks/rtvi/models.d.ts +1741 -0
  274. package/dist/processors/frameworks/rtvi/models.js +1807 -0
  275. package/dist/processors/frameworks/rtvi/observer.d.ts +340 -0
  276. package/dist/processors/frameworks/rtvi/observer.js +1113 -0
  277. package/dist/processors/frameworks/rtvi/processor.d.ts +182 -0
  278. package/dist/processors/frameworks/rtvi/processor.js +676 -0
  279. package/dist/processors/idle_frame_processor.d.ts +44 -0
  280. package/dist/processors/idle_frame_processor.js +86 -0
  281. package/dist/processors/index.d.ts +2 -0
  282. package/dist/processors/index.js +8 -0
  283. package/dist/processors/logger.d.ts +42 -0
  284. package/dist/processors/logger.js +87 -0
  285. package/dist/processors/metrics/frame_processor_metrics.d.ts +172 -0
  286. package/dist/processors/metrics/frame_processor_metrics.js +372 -0
  287. package/dist/processors/metrics/index.d.ts +2 -0
  288. package/dist/processors/metrics/index.js +8 -0
  289. package/dist/processors/producer_processor.d.ts +68 -0
  290. package/dist/processors/producer_processor.js +78 -0
  291. package/dist/processors/text_transformer.d.ts +30 -0
  292. package/dist/processors/text_transformer.js +48 -0
  293. package/dist/registry/index.d.ts +3 -0
  294. package/dist/registry/index.js +8 -0
  295. package/dist/registry/registry.d.ts +69 -0
  296. package/dist/registry/registry.js +149 -0
  297. package/dist/registry/types.d.ts +47 -0
  298. package/dist/registry/types.js +39 -0
  299. package/dist/serializers/base_serializer.d.ts +94 -0
  300. package/dist/serializers/base_serializer.js +82 -0
  301. package/dist/serializers/index.d.ts +2 -0
  302. package/dist/serializers/index.js +8 -0
  303. package/dist/services/ai_service.d.ts +145 -0
  304. package/dist/services/ai_service.js +262 -0
  305. package/dist/services/anthropic/index.d.ts +2 -0
  306. package/dist/services/anthropic/index.js +7 -0
  307. package/dist/services/assemblyai/index.d.ts +2 -0
  308. package/dist/services/assemblyai/index.js +7 -0
  309. package/dist/services/asyncai/index.d.ts +2 -0
  310. package/dist/services/asyncai/index.js +7 -0
  311. package/dist/services/aws/index.d.ts +2 -0
  312. package/dist/services/aws/index.js +7 -0
  313. package/dist/services/azure/index.d.ts +2 -0
  314. package/dist/services/azure/index.js +7 -0
  315. package/dist/services/baseten/index.d.ts +2 -0
  316. package/dist/services/baseten/index.js +7 -0
  317. package/dist/services/bland/index.d.ts +2 -0
  318. package/dist/services/bland/index.js +7 -0
  319. package/dist/services/camb/index.d.ts +2 -0
  320. package/dist/services/camb/index.js +7 -0
  321. package/dist/services/cartesia/index.d.ts +2 -0
  322. package/dist/services/cartesia/index.js +7 -0
  323. package/dist/services/cerebras/index.d.ts +2 -0
  324. package/dist/services/cerebras/index.js +7 -0
  325. package/dist/services/crusoe/index.d.ts +2 -0
  326. package/dist/services/crusoe/index.js +7 -0
  327. package/dist/services/deepgram/index.d.ts +2 -0
  328. package/dist/services/deepgram/index.js +7 -0
  329. package/dist/services/deepseek/index.d.ts +2 -0
  330. package/dist/services/deepseek/index.js +7 -0
  331. package/dist/services/elevenlabs/index.d.ts +2 -0
  332. package/dist/services/elevenlabs/index.js +7 -0
  333. package/dist/services/fal/index.d.ts +2 -0
  334. package/dist/services/fal/index.js +7 -0
  335. package/dist/services/fireworks/index.d.ts +2 -0
  336. package/dist/services/fireworks/index.js +7 -0
  337. package/dist/services/fish/index.d.ts +2 -0
  338. package/dist/services/fish/index.js +7 -0
  339. package/dist/services/funasr/index.d.ts +3 -0
  340. package/dist/services/funasr/index.js +8 -0
  341. package/dist/services/gladia/index.d.ts +2 -0
  342. package/dist/services/gladia/index.js +7 -0
  343. package/dist/services/google/index.d.ts +2 -0
  344. package/dist/services/google/index.js +7 -0
  345. package/dist/services/gradium/index.d.ts +2 -0
  346. package/dist/services/gradium/index.js +7 -0
  347. package/dist/services/grok/index.d.ts +2 -0
  348. package/dist/services/grok/index.js +7 -0
  349. package/dist/services/groq/index.d.ts +2 -0
  350. package/dist/services/groq/index.js +7 -0
  351. package/dist/services/heygen/index.d.ts +2 -0
  352. package/dist/services/heygen/index.js +7 -0
  353. package/dist/services/hume/index.d.ts +2 -0
  354. package/dist/services/hume/index.js +7 -0
  355. package/dist/services/image_service.d.ts +52 -0
  356. package/dist/services/image_service.js +60 -0
  357. package/dist/services/inception/index.d.ts +2 -0
  358. package/dist/services/inception/index.js +7 -0
  359. package/dist/services/index.d.ts +2 -0
  360. package/dist/services/index.js +8 -0
  361. package/dist/services/inworld/index.d.ts +2 -0
  362. package/dist/services/inworld/index.js +7 -0
  363. package/dist/services/keenable/index.d.ts +2 -0
  364. package/dist/services/keenable/index.js +7 -0
  365. package/dist/services/kokoro/index.d.ts +2 -0
  366. package/dist/services/kokoro/index.js +7 -0
  367. package/dist/services/llm_service.d.ts +1106 -0
  368. package/dist/services/llm_service.js +2231 -0
  369. package/dist/services/mem0/index.d.ts +2 -0
  370. package/dist/services/mem0/index.js +7 -0
  371. package/dist/services/meta/index.d.ts +2 -0
  372. package/dist/services/meta/index.js +7 -0
  373. package/dist/services/minimax/index.d.ts +2 -0
  374. package/dist/services/minimax/index.js +7 -0
  375. package/dist/services/mistral/index.d.ts +2 -0
  376. package/dist/services/mistral/index.js +7 -0
  377. package/dist/services/moondream/index.d.ts +2 -0
  378. package/dist/services/moondream/index.js +7 -0
  379. package/dist/services/moonshine/index.d.ts +2 -0
  380. package/dist/services/moonshine/index.js +7 -0
  381. package/dist/services/nebius/index.d.ts +2 -0
  382. package/dist/services/nebius/index.js +7 -0
  383. package/dist/services/neuphonic/index.d.ts +2 -0
  384. package/dist/services/neuphonic/index.js +7 -0
  385. package/dist/services/novita/index.d.ts +2 -0
  386. package/dist/services/novita/index.js +7 -0
  387. package/dist/services/nvidia/index.d.ts +2 -0
  388. package/dist/services/nvidia/index.js +11 -0
  389. package/dist/services/ollama/index.d.ts +2 -0
  390. package/dist/services/ollama/index.js +7 -0
  391. package/dist/services/openai/index.d.ts +2 -0
  392. package/dist/services/openai/index.js +7 -0
  393. package/dist/services/openclaw/index.d.ts +14 -0
  394. package/dist/services/openclaw/index.js +19 -0
  395. package/dist/services/openrouter/index.d.ts +2 -0
  396. package/dist/services/openrouter/index.js +7 -0
  397. package/dist/services/perplexity/index.d.ts +2 -0
  398. package/dist/services/perplexity/index.js +7 -0
  399. package/dist/services/piper/index.d.ts +2 -0
  400. package/dist/services/piper/index.js +7 -0
  401. package/dist/services/pocket_tts/index.d.ts +2 -0
  402. package/dist/services/pocket_tts/index.js +7 -0
  403. package/dist/services/qwen/index.d.ts +2 -0
  404. package/dist/services/qwen/index.js +7 -0
  405. package/dist/services/resembleai/index.d.ts +2 -0
  406. package/dist/services/resembleai/index.js +7 -0
  407. package/dist/services/rime/index.d.ts +2 -0
  408. package/dist/services/rime/index.js +7 -0
  409. package/dist/services/sambanova/index.d.ts +2 -0
  410. package/dist/services/sambanova/index.js +7 -0
  411. package/dist/services/sarvam/index.d.ts +2 -0
  412. package/dist/services/sarvam/index.js +7 -0
  413. package/dist/services/settings.d.ts +356 -0
  414. package/dist/services/settings.js +437 -0
  415. package/dist/services/simli/index.d.ts +2 -0
  416. package/dist/services/simli/index.js +7 -0
  417. package/dist/services/smallest/index.d.ts +2 -0
  418. package/dist/services/smallest/index.js +7 -0
  419. package/dist/services/soniox/index.d.ts +2 -0
  420. package/dist/services/soniox/index.js +7 -0
  421. package/dist/services/speechify/index.d.ts +2 -0
  422. package/dist/services/speechify/index.js +7 -0
  423. package/dist/services/speechmatics/index.d.ts +2 -0
  424. package/dist/services/speechmatics/index.js +7 -0
  425. package/dist/services/stt_latency.d.ts +62 -0
  426. package/dist/services/stt_latency.js +71 -0
  427. package/dist/services/stt_service.d.ts +601 -0
  428. package/dist/services/stt_service.js +1044 -0
  429. package/dist/services/tavus/index.d.ts +2 -0
  430. package/dist/services/tavus/index.js +7 -0
  431. package/dist/services/together/index.d.ts +2 -0
  432. package/dist/services/together/index.js +7 -0
  433. package/dist/services/tts_service.d.ts +909 -0
  434. package/dist/services/tts_service.js +2018 -0
  435. package/dist/services/ultravox/index.d.ts +2 -0
  436. package/dist/services/ultravox/index.js +9 -0
  437. package/dist/services/vision_service.d.ts +56 -0
  438. package/dist/services/vision_service.js +62 -0
  439. package/dist/services/websocket_service.d.ts +213 -0
  440. package/dist/services/websocket_service.js +654 -0
  441. package/dist/services/whisper/index.d.ts +2 -0
  442. package/dist/services/whisper/index.js +9 -0
  443. package/dist/services/xai/index.d.ts +2 -0
  444. package/dist/services/xai/index.js +9 -0
  445. package/dist/services/xtts/index.d.ts +2 -0
  446. package/dist/services/xtts/index.js +9 -0
  447. package/dist/tests/index.d.ts +2 -0
  448. package/dist/tests/index.js +8 -0
  449. package/dist/tests/utils.d.ts +123 -0
  450. package/dist/tests/utils.js +212 -0
  451. package/dist/transcriptions/index.d.ts +2 -0
  452. package/dist/transcriptions/index.js +8 -0
  453. package/dist/transcriptions/language.d.ts +376 -0
  454. package/dist/transcriptions/language.js +543 -0
  455. package/dist/transports/base_input.d.ts +149 -0
  456. package/dist/transports/base_input.js +338 -0
  457. package/dist/transports/base_output.d.ts +432 -0
  458. package/dist/transports/base_output.js +1231 -0
  459. package/dist/transports/base_transport.d.ts +223 -0
  460. package/dist/transports/base_transport.js +167 -0
  461. package/dist/transports/daily/index.d.ts +2 -0
  462. package/dist/transports/daily/index.js +9 -0
  463. package/dist/transports/heygen/index.d.ts +2 -0
  464. package/dist/transports/heygen/index.js +9 -0
  465. package/dist/transports/index.d.ts +2 -0
  466. package/dist/transports/index.js +8 -0
  467. package/dist/transports/lemonslice/index.d.ts +2 -0
  468. package/dist/transports/lemonslice/index.js +9 -0
  469. package/dist/transports/livekit/index.d.ts +2 -0
  470. package/dist/transports/livekit/index.js +9 -0
  471. package/dist/transports/local/index.d.ts +2 -0
  472. package/dist/transports/local/index.js +9 -0
  473. package/dist/transports/moq/index.d.ts +2 -0
  474. package/dist/transports/moq/index.js +9 -0
  475. package/dist/transports/smallwebrtc/index.d.ts +2 -0
  476. package/dist/transports/smallwebrtc/index.js +9 -0
  477. package/dist/transports/tavus/index.d.ts +2 -0
  478. package/dist/transports/tavus/index.js +9 -0
  479. package/dist/transports/video_in_sampler.d.ts +157 -0
  480. package/dist/transports/video_in_sampler.js +258 -0
  481. package/dist/transports/vonage/index.d.ts +2 -0
  482. package/dist/transports/vonage/index.js +9 -0
  483. package/dist/transports/websocket/index.d.ts +2 -0
  484. package/dist/transports/websocket/index.js +9 -0
  485. package/dist/transports/whatsapp/index.d.ts +2 -0
  486. package/dist/transports/whatsapp/index.js +9 -0
  487. package/dist/turns/eager_end_of_turn_mixin.d.ts +70 -0
  488. package/dist/turns/eager_end_of_turn_mixin.js +122 -0
  489. package/dist/turns/empty_user_turn.d.ts +55 -0
  490. package/dist/turns/empty_user_turn.js +53 -0
  491. package/dist/turns/index.d.ts +2 -0
  492. package/dist/turns/index.js +8 -0
  493. package/dist/turns/speculation_gate.d.ts +169 -0
  494. package/dist/turns/speculation_gate.js +294 -0
  495. package/dist/turns/types.d.ts +33 -0
  496. package/dist/turns/types.js +35 -0
  497. package/dist/turns/user_idle_controller.d.ts +94 -0
  498. package/dist/turns/user_idle_controller.js +187 -0
  499. package/dist/turns/user_mute/always_user_mute_strategy.d.ts +15 -0
  500. package/dist/turns/user_mute/always_user_mute_strategy.js +29 -0
  501. package/dist/turns/user_mute/base_user_mute_strategy.d.ts +39 -0
  502. package/dist/turns/user_mute/base_user_mute_strategy.js +45 -0
  503. package/dist/turns/user_mute/first_speech_user_mute_strategy.d.ts +28 -0
  504. package/dist/turns/user_mute/first_speech_user_mute_strategy.js +52 -0
  505. package/dist/turns/user_mute/function_call_user_mute_strategy.d.ts +25 -0
  506. package/dist/turns/user_mute/function_call_user_mute_strategy.js +50 -0
  507. package/dist/turns/user_mute/index.d.ts +6 -0
  508. package/dist/turns/user_mute/index.js +11 -0
  509. package/dist/turns/user_mute/mute_until_first_bot_complete_user_mute_strategy.d.ts +43 -0
  510. package/dist/turns/user_mute/mute_until_first_bot_complete_user_mute_strategy.js +76 -0
  511. package/dist/turns/user_start/base_user_turn_start_strategy.d.ts +135 -0
  512. package/dist/turns/user_start/base_user_turn_start_strategy.js +134 -0
  513. package/dist/turns/user_start/external_user_turn_start_strategy.d.ts +45 -0
  514. package/dist/turns/user_start/external_user_turn_start_strategy.js +64 -0
  515. package/dist/turns/user_start/index.d.ts +8 -0
  516. package/dist/turns/user_start/index.js +16 -0
  517. package/dist/turns/user_start/krisp_viva_ip_user_turn_start_strategy.d.ts +133 -0
  518. package/dist/turns/user_start/krisp_viva_ip_user_turn_start_strategy.js +243 -0
  519. package/dist/turns/user_start/min_words_user_turn_start_strategy.d.ts +60 -0
  520. package/dist/turns/user_start/min_words_user_turn_start_strategy.js +102 -0
  521. package/dist/turns/user_start/transcription_user_turn_start_strategy.d.ts +29 -0
  522. package/dist/turns/user_start/transcription_user_turn_start_strategy.js +43 -0
  523. package/dist/turns/user_start/vad_user_turn_start_strategy.d.ts +20 -0
  524. package/dist/turns/user_start/vad_user_turn_start_strategy.js +31 -0
  525. package/dist/turns/user_start/wake_phrase_user_turn_start_strategy.d.ts +141 -0
  526. package/dist/turns/user_start/wake_phrase_user_turn_start_strategy.js +238 -0
  527. package/dist/turns/user_stop/base_user_turn_stop_strategy.d.ts +174 -0
  528. package/dist/turns/user_stop/base_user_turn_stop_strategy.js +170 -0
  529. package/dist/turns/user_stop/deferred_user_turn_stop_strategy.d.ts +81 -0
  530. package/dist/turns/user_stop/deferred_user_turn_stop_strategy.js +107 -0
  531. package/dist/turns/user_stop/eager_match_policy.d.ts +36 -0
  532. package/dist/turns/user_stop/eager_match_policy.js +50 -0
  533. package/dist/turns/user_stop/eager_user_turn_stop_strategy.d.ts +84 -0
  534. package/dist/turns/user_stop/eager_user_turn_stop_strategy.js +154 -0
  535. package/dist/turns/user_stop/external_user_turn_completion_stop_strategy.d.ts +45 -0
  536. package/dist/turns/user_stop/external_user_turn_completion_stop_strategy.js +55 -0
  537. package/dist/turns/user_stop/external_user_turn_stop_strategy.d.ts +115 -0
  538. package/dist/turns/user_stop/external_user_turn_stop_strategy.js +205 -0
  539. package/dist/turns/user_stop/index.d.ts +10 -0
  540. package/dist/turns/user_stop/index.js +15 -0
  541. package/dist/turns/user_stop/llm_turn_completion_user_turn_stop_strategy.d.ts +44 -0
  542. package/dist/turns/user_stop/llm_turn_completion_user_turn_stop_strategy.js +59 -0
  543. package/dist/turns/user_stop/speech_timeout_user_turn_stop_strategy.d.ts +140 -0
  544. package/dist/turns/user_stop/speech_timeout_user_turn_stop_strategy.js +303 -0
  545. package/dist/turns/user_stop/turn_analyzer_user_turn_stop_strategy.d.ts +135 -0
  546. package/dist/turns/user_stop/turn_analyzer_user_turn_stop_strategy.js +332 -0
  547. package/dist/turns/user_turn_completion_mixin.d.ts +147 -0
  548. package/dist/turns/user_turn_completion_mixin.js +591 -0
  549. package/dist/turns/user_turn_controller.d.ts +134 -0
  550. package/dist/turns/user_turn_controller.js +335 -0
  551. package/dist/turns/user_turn_processor.d.ts +87 -0
  552. package/dist/turns/user_turn_processor.js +180 -0
  553. package/dist/turns/user_turn_strategies.d.ts +187 -0
  554. package/dist/turns/user_turn_strategies.js +222 -0
  555. package/dist/utils/async_tool_cancellation.d.ts +35 -0
  556. package/dist/utils/async_tool_cancellation.js +78 -0
  557. package/dist/utils/asyncio/index.d.ts +2 -0
  558. package/dist/utils/asyncio/index.js +7 -0
  559. package/dist/utils/asyncio/task_manager.d.ts +49 -0
  560. package/dist/utils/asyncio/task_manager.js +105 -0
  561. package/dist/utils/base_object.d.ts +76 -0
  562. package/dist/utils/base_object.js +154 -0
  563. package/dist/utils/context/aggregated_frame_sequencer.d.ts +491 -0
  564. package/dist/utils/context/aggregated_frame_sequencer.js +803 -0
  565. package/dist/utils/context/audio_context_manager.d.ts +131 -0
  566. package/dist/utils/context/audio_context_manager.js +233 -0
  567. package/dist/utils/context/index.d.ts +2 -0
  568. package/dist/utils/context/index.js +7 -0
  569. package/dist/utils/context/llm_context_summarization.d.ts +258 -0
  570. package/dist/utils/context/llm_context_summarization.js +511 -0
  571. package/dist/utils/context/text_segment_map.d.ts +611 -0
  572. package/dist/utils/context/text_segment_map.js +1132 -0
  573. package/dist/utils/context/word_completion_tracker.d.ts +273 -0
  574. package/dist/utils/context/word_completion_tracker.js +441 -0
  575. package/dist/utils/context/word_timestamp_tracker.d.ts +72 -0
  576. package/dist/utils/context/word_timestamp_tracker.js +98 -0
  577. package/dist/utils/deprecation.d.ts +28 -0
  578. package/dist/utils/deprecation.js +75 -0
  579. package/dist/utils/env.d.ts +38 -0
  580. package/dist/utils/env.js +62 -0
  581. package/dist/utils/errors.d.ts +75 -0
  582. package/dist/utils/errors.js +202 -0
  583. package/dist/utils/file_resolver.d.ts +126 -0
  584. package/dist/utils/file_resolver.js +314 -0
  585. package/dist/utils/file_storage.d.ts +99 -0
  586. package/dist/utils/file_storage.js +100 -0
  587. package/dist/utils/frame_queue.d.ts +36 -0
  588. package/dist/utils/frame_queue.js +66 -0
  589. package/dist/utils/http.d.ts +39 -0
  590. package/dist/utils/http.js +53 -0
  591. package/dist/utils/image.d.ts +15 -0
  592. package/dist/utils/image.js +30 -0
  593. package/dist/utils/index.d.ts +2 -0
  594. package/dist/utils/index.js +8 -0
  595. package/dist/utils/log_config.d.ts +34 -0
  596. package/dist/utils/log_config.js +76 -0
  597. package/dist/utils/logger.d.ts +40 -0
  598. package/dist/utils/logger.js +91 -0
  599. package/dist/utils/mixin.d.ts +14 -0
  600. package/dist/utils/mixin.js +63 -0
  601. package/dist/utils/network.d.ts +73 -0
  602. package/dist/utils/network.js +90 -0
  603. package/dist/utils/security/allowed_origins.d.ts +16 -0
  604. package/dist/utils/security/allowed_origins.js +34 -0
  605. package/dist/utils/security/index.d.ts +2 -0
  606. package/dist/utils/security/index.js +7 -0
  607. package/dist/utils/security/redaction.d.ts +27 -0
  608. package/dist/utils/security/redaction.js +123 -0
  609. package/dist/utils/security/ssrf.d.ts +79 -0
  610. package/dist/utils/security/ssrf.js +327 -0
  611. package/dist/utils/shared.d.ts +35 -0
  612. package/dist/utils/shared.js +136 -0
  613. package/dist/utils/startup.d.ts +17 -0
  614. package/dist/utils/startup.js +130 -0
  615. package/dist/utils/string.d.ts +116 -0
  616. package/dist/utils/string.js +460 -0
  617. package/dist/utils/sync/base_notifier.d.ts +25 -0
  618. package/dist/utils/sync/base_notifier.js +16 -0
  619. package/dist/utils/sync/event_notifier.d.ts +38 -0
  620. package/dist/utils/sync/event_notifier.js +51 -0
  621. package/dist/utils/sync/index.d.ts +2 -0
  622. package/dist/utils/sync/index.js +7 -0
  623. package/dist/utils/text/alnum_utils.d.ts +109 -0
  624. package/dist/utils/text/alnum_utils.js +262 -0
  625. package/dist/utils/text/base_text_aggregator.d.ts +146 -0
  626. package/dist/utils/text/base_text_aggregator.js +102 -0
  627. package/dist/utils/text/base_text_filter.d.ts +54 -0
  628. package/dist/utils/text/base_text_filter.js +50 -0
  629. package/dist/utils/text/index.d.ts +2 -0
  630. package/dist/utils/text/index.js +7 -0
  631. package/dist/utils/text/markdown_text_filter.d.ts +147 -0
  632. package/dist/utils/text/markdown_text_filter.js +522 -0
  633. package/dist/utils/text/markup_utils.d.ts +54 -0
  634. package/dist/utils/text/markup_utils.js +156 -0
  635. package/dist/utils/text/pattern_pair_aggregator.d.ts +251 -0
  636. package/dist/utils/text/pattern_pair_aggregator.js +478 -0
  637. package/dist/utils/text/phonemes.d.ts +60 -0
  638. package/dist/utils/text/phonemes.js +172 -0
  639. package/dist/utils/text/simple_text_aggregator.d.ts +135 -0
  640. package/dist/utils/text/simple_text_aggregator.js +254 -0
  641. package/dist/utils/text/skip_tags_aggregator.d.ts +85 -0
  642. package/dist/utils/text/skip_tags_aggregator.js +147 -0
  643. package/dist/utils/text/transforms/pronunciations.d.ts +65 -0
  644. package/dist/utils/text/transforms/pronunciations.js +111 -0
  645. package/dist/utils/text/word_timestamp_utils.d.ts +26 -0
  646. package/dist/utils/text/word_timestamp_utils.js +52 -0
  647. package/dist/utils/time.d.ts +13 -0
  648. package/dist/utils/time.js +31 -0
  649. package/dist/utils/tracing/index.d.ts +3 -0
  650. package/dist/utils/tracing/index.js +8 -0
  651. package/dist/utils/tracing/service_attributes.d.ts +198 -0
  652. package/dist/utils/tracing/service_attributes.js +434 -0
  653. package/dist/utils/tracing/service_decorators.d.ts +214 -0
  654. package/dist/utils/tracing/service_decorators.js +1662 -0
  655. package/dist/utils/tracing/setup.d.ts +95 -0
  656. package/dist/utils/tracing/setup.js +110 -0
  657. package/dist/utils/tracing/tracing_context.d.ts +55 -0
  658. package/dist/utils/tracing/tracing_context.js +97 -0
  659. package/dist/utils/tracing/turn_trace_observer.d.ts +90 -0
  660. package/dist/utils/tracing/turn_trace_observer.js +219 -0
  661. package/dist/utils/types.d.ts +80 -0
  662. package/dist/utils/types.js +108 -0
  663. package/dist/utils/utils.d.ts +5 -0
  664. package/dist/utils/utils.js +22 -0
  665. package/dist/utils/yaml.d.ts +64 -0
  666. package/dist/utils/yaml.js +41 -0
  667. package/dist/version.d.ts +3 -0
  668. package/dist/version.js +7 -0
  669. package/dist/workers/base_worker.d.ts +772 -0
  670. package/dist/workers/base_worker.js +1298 -0
  671. package/dist/workers/index.d.ts +2 -0
  672. package/dist/workers/index.js +8 -0
  673. package/dist/workers/llm/backend_llm_worker.d.ts +552 -0
  674. package/dist/workers/llm/backend_llm_worker.js +1055 -0
  675. package/dist/workers/llm/index.d.ts +6 -0
  676. package/dist/workers/llm/index.js +11 -0
  677. package/dist/workers/llm/llm_context_worker.d.ts +66 -0
  678. package/dist/workers/llm/llm_context_worker.js +72 -0
  679. package/dist/workers/llm/llm_worker.d.ts +180 -0
  680. package/dist/workers/llm/llm_worker.js +323 -0
  681. package/dist/workers/llm/tool_decorator.d.ts +68 -0
  682. package/dist/workers/llm/tool_decorator.js +60 -0
  683. package/dist/workers/runner.d.ts +268 -0
  684. package/dist/workers/runner.js +489 -0
  685. package/dist/workers/ui/index.d.ts +22 -0
  686. package/dist/workers/ui/index.js +27 -0
  687. package/dist/workers/ui/ui_event_decorator.d.ts +43 -0
  688. package/dist/workers/ui/ui_event_decorator.js +75 -0
  689. package/dist/workers/ui/ui_job_context.d.ts +12 -0
  690. package/dist/workers/ui/ui_job_context.js +17 -0
  691. package/dist/workers/ui/ui_prompts.d.ts +21 -0
  692. package/dist/workers/ui/ui_prompts.js +41 -0
  693. package/dist/workers/ui/ui_tools.d.ts +32 -0
  694. package/dist/workers/ui/ui_tools.js +112 -0
  695. package/dist/workers/ui/ui_worker.d.ts +571 -0
  696. package/dist/workers/ui/ui_worker.js +1156 -0
  697. package/package.json +46 -3
  698. package/README.md +0 -5
@@ -0,0 +1,2485 @@
1
+ // Copyright (c) 2024-2026, Daily
2
+ // Copyright (c) 2026, pipedog contributors
3
+ // SPDX-License-Identifier: BSD-2-Clause
4
+ //
5
+ // Ported from pipecat: src/pipecat/frames/frames.py
6
+ /**
7
+ * Core frame definitions for the Pipecat framework.
8
+ *
9
+ * Contains all frame types used throughout the pipeline system, including
10
+ * data frames, system frames, and control frames for audio, video, text, and
11
+ * LLM processing.
12
+ *
13
+ * Porting notes (see docs/CONVENTIONS.md, "Frames"):
14
+ * - Python dataclass fields become class fields; `init=True` fields are read
15
+ * from the constructor's options object (`new TextFrame({ text: "hi" })`),
16
+ * `init=False` fields are plain field initializers.
17
+ * - `__post_init__` overrides become field initializers or constructor code
18
+ * in the subclass (they run base-first, like the `super().__post_init__()` chain).
19
+ * - Non-Frame dataclass mixins (AudioRawFrame, ImageRawFrame, ...) use
20
+ * `defineMixin`; a second concrete Frame base uses `addVirtualBase`.
21
+ * - `__str__` becomes `toString()`.
22
+ */
23
+ import { time } from "@pipedog/asyncio";
24
+ import { KeypadEntry } from "../audio/dtmf/types.js";
25
+ import { ErrorCategory } from "../utils/errors.js";
26
+ import { addVirtualBase, defineMixin } from "../utils/mixin.js";
27
+ import { redactSecrets } from "../utils/security/redaction.js";
28
+ import { TextType } from "../utils/text/base_text_aggregator.js";
29
+ import { nanosecondsToStr } from "../utils/time.js";
30
+ import { objCount, objId } from "../utils/utils.js";
31
+ // Upstream modules import `TextType` through `pipecat.frames.frames`.
32
+ export { TextType };
33
+ /** Format a presentation timestamp (nanoseconds) to a human-readable string. */
34
+ export function formatPts(pts) {
35
+ return pts ? nanosecondsToStr(pts) : null;
36
+ }
37
+ /**
38
+ * Base frame class for all frames in the Pipecat pipeline.
39
+ *
40
+ * All frames automatically receive unique identifiers, names, and metadata.
41
+ *
42
+ * - `id`: unique identifier for the frame instance.
43
+ * - `name`: class name and instance count.
44
+ * - `pts`: presentation timestamp in nanoseconds.
45
+ * - `broadcastSiblingId`: id of the paired frame when broadcast in both
46
+ * directions; set by `broadcastFrame()` / `broadcastFrameInstance()`.
47
+ * - `metadata`: arbitrary frame metadata.
48
+ * - `transportSource` / `transportDestination`: transport routing names.
49
+ * - `interruptible`: whether an interruption may drop this frame from a
50
+ * processor's queue or cancel its processing. Subclasses that are
51
+ * uninterruptible by default declare `override interruptible = false`.
52
+ */
53
+ export class Frame {
54
+ id = objId();
55
+ name = `${this.constructor.name}#${objCount(this)}`;
56
+ pts = null;
57
+ broadcastSiblingId = null;
58
+ metadata = {};
59
+ transportSource = null;
60
+ transportDestination = null;
61
+ interruptible = true;
62
+ // Options are accepted (and ignored) so every frame constructor has the
63
+ // same shape, which mixins and `broadcastFrame(FrameClass, options)` rely on.
64
+ constructor(_options) { }
65
+ toString() {
66
+ return this.name;
67
+ }
68
+ }
69
+ /** Give a copied frame a fresh `id` and `name`, as dataclass re-construction does. */
70
+ export function renewFrameIdentity(frame) {
71
+ frame.id = objId();
72
+ frame.name = `${frame.constructor.name}#${objCount(frame)}`;
73
+ }
74
+ /**
75
+ * System frame class for immediate processing.
76
+ *
77
+ * Takes higher priority than other frames. System frames are handled in order
78
+ * and are not affected by user interruptions.
79
+ */
80
+ export class SystemFrame extends Frame {
81
+ }
82
+ /**
83
+ * Data frame class for processing data in order.
84
+ *
85
+ * Processed in order; usually contains data such as LLM context, text, audio
86
+ * or images. Data frames are cancelled by user interruptions.
87
+ */
88
+ export class DataFrame extends Frame {
89
+ }
90
+ /**
91
+ * Control frame class for processing control information in order.
92
+ *
93
+ * Like data frames, processed in order; usually contains control information
94
+ * such as settings updates or ending the pipeline after everything is flushed.
95
+ * Cancelled by user interruptions.
96
+ */
97
+ export class ControlFrame extends Frame {
98
+ }
99
+ export const AudioRawFrame = defineMixin("AudioRawFrame", (Base) => {
100
+ class AudioRawFrameMixin extends Base {
101
+ audio;
102
+ sampleRate;
103
+ numChannels;
104
+ numFrames = 0;
105
+ constructor(...args) {
106
+ super(...args);
107
+ const options = args[0];
108
+ this.audio = options.audio;
109
+ this.sampleRate = options.sampleRate;
110
+ this.numChannels = options.numChannels;
111
+ this.numFrames = Math.trunc(this.audio.length / (this.numChannels * 2));
112
+ }
113
+ }
114
+ return AudioRawFrameMixin;
115
+ });
116
+ export const ImageRawFrame = defineMixin("ImageRawFrame", (Base) => {
117
+ class ImageRawFrameMixin extends Base {
118
+ image;
119
+ size;
120
+ format;
121
+ constructor(...args) {
122
+ super(...args);
123
+ const options = args[0];
124
+ this.image = options.image;
125
+ this.size = options.size;
126
+ this.format = options.format;
127
+ }
128
+ }
129
+ return ImageRawFrameMixin;
130
+ });
131
+ //
132
+ // Data frames.
133
+ //
134
+ /**
135
+ * Audio data frame for output to transport.
136
+ *
137
+ * A chunk of raw audio that will be played by the output transport. If the
138
+ * transport supports multiple audio destinations (e.g. multiple audio tracks)
139
+ * the destination name can be specified in `transportDestination`.
140
+ */
141
+ export class OutputAudioRawFrame extends AudioRawFrame(DataFrame) {
142
+ constructor(options) {
143
+ super(options);
144
+ }
145
+ toString() {
146
+ const pts = formatPts(this.pts);
147
+ return `${this.name}(pts: ${pts}, destination: ${this.transportDestination}, size: ${this.audio.length}, frames: ${this.numFrames}, sample_rate: ${this.sampleRate}, channels: ${this.numChannels})`;
148
+ }
149
+ }
150
+ /**
151
+ * Text data frame for passing text through the pipeline.
152
+ *
153
+ * Emitted by LLM services, consumed by context aggregators, TTS services and
154
+ * more.
155
+ *
156
+ * - `skipTts`: whether this text should be skipped by the TTS service.
157
+ * - `includesInterFrameSpaces`: whether any necessary inter-frame
158
+ * (leading/trailing) spaces are already included in the text.
159
+ * - `appendToContext`: whether this text should be appended to the LLM context.
160
+ */
161
+ export class TextFrame extends DataFrame {
162
+ text;
163
+ skipTts = null;
164
+ includesInterFrameSpaces = false;
165
+ appendToContext = true;
166
+ constructor(options) {
167
+ super(options);
168
+ this.text = options.text;
169
+ }
170
+ toString() {
171
+ const pts = formatPts(this.pts);
172
+ return `${this.name}(pts: ${pts}, text: [${this.text}])`;
173
+ }
174
+ }
175
+ /** Text frame generated by LLM services. */
176
+ export class LLMTextFrame extends TextFrame {
177
+ // LLM services send text frames with all necessary spaces included.
178
+ includesInterFrameSpaces = true;
179
+ }
180
+ /** Format an image size the way upstream prints a `(width, height)` tuple. */
181
+ function formatSize(size) {
182
+ return `(${size[0]}, ${size[1]})`;
183
+ }
184
+ /** Validate one DTMF character, like constructing `KeypadEntry(c)` upstream. */
185
+ function toKeypadEntry(value) {
186
+ if (!Object.values(KeypadEntry).includes(value)) {
187
+ throw new Error(`'${value}' is not a valid KeypadEntry`);
188
+ }
189
+ return value;
190
+ }
191
+ export const FileRawFrame = defineMixin("FileRawFrame", (Base) => {
192
+ class FileRawFrameMixin extends Base {
193
+ file;
194
+ type;
195
+ filename;
196
+ format;
197
+ constructor(...args) {
198
+ super(...args);
199
+ const options = args[0];
200
+ this.file = options.file;
201
+ this.type = options.type;
202
+ this.filename = options.filename;
203
+ this.format = options.format;
204
+ }
205
+ }
206
+ return FileRawFrameMixin;
207
+ });
208
+ export const DTMFFrame = defineMixin("DTMFFrame", (Base) => {
209
+ class DTMFFrameMixin extends Base {
210
+ }
211
+ return DTMFFrameMixin;
212
+ });
213
+ //
214
+ // Data frames (continued).
215
+ //
216
+ /**
217
+ * Image data frame for output to transport.
218
+ *
219
+ * An image that will be shown by the transport. If the transport supports
220
+ * multiple video destinations (e.g. multiple video tracks) the destination
221
+ * name can be specified in `transportDestination`.
222
+ *
223
+ * - `syncWithAudio`: if true, the image is queued with audio frames so it is
224
+ * only displayed after all preceding audio has been sent. Defaults to false
225
+ * (image is displayed immediately when the output transport receives it).
226
+ */
227
+ export class OutputImageRawFrame extends ImageRawFrame(DataFrame) {
228
+ syncWithAudio = false;
229
+ constructor(options) {
230
+ super(options);
231
+ }
232
+ toString() {
233
+ const pts = formatPts(this.pts);
234
+ return `${this.name}(pts: ${pts}, destination: ${this.transportDestination}, size: ${formatSize(this.size)}, format: ${this.format})`;
235
+ }
236
+ }
237
+ /**
238
+ * Audio data frame generated by Text-to-Speech services.
239
+ *
240
+ * A chunk of output audio generated by a TTS service, ready for playback.
241
+ *
242
+ * - `contextId`: unique identifier for the TTS context that generated this audio.
243
+ */
244
+ export class TTSAudioRawFrame extends OutputAudioRawFrame {
245
+ contextId;
246
+ constructor(options) {
247
+ super(options);
248
+ this.contextId = options.contextId ?? null;
249
+ }
250
+ }
251
+ /**
252
+ * An audio frame part of a speech audio stream.
253
+ *
254
+ * This frame is part of a continuous stream of audio frames containing speech.
255
+ * The audio stream might also contain silence frames, so a process to
256
+ * distinguish between speech and silence might be needed.
257
+ */
258
+ export class SpeechOutputAudioRawFrame extends OutputAudioRawFrame {
259
+ }
260
+ /**
261
+ * Image frame with an associated URL.
262
+ *
263
+ * An output image with an associated URL. These images are usually generated
264
+ * by third-party services that provide a URL to download the image.
265
+ *
266
+ * - `url`: URL where the image can be downloaded from.
267
+ */
268
+ export class URLImageRawFrame extends OutputImageRawFrame {
269
+ url;
270
+ constructor(options) {
271
+ super(options);
272
+ this.url = options.url ?? null;
273
+ }
274
+ toString() {
275
+ const pts = formatPts(this.pts);
276
+ return `${this.name}(pts: ${pts}, url: ${this.url}, size: ${formatSize(this.size)}, format: ${this.format})`;
277
+ }
278
+ }
279
+ /**
280
+ * Animated sprite frame containing multiple images.
281
+ *
282
+ * An animated sprite that will be shown by the transport if the transport's
283
+ * camera is enabled. Will play at the framerate specified in the transport's
284
+ * `cameraOutFramerate` constructor parameter.
285
+ *
286
+ * - `images`: list of image frames that make up the sprite animation.
287
+ */
288
+ export class SpriteFrame extends DataFrame {
289
+ images;
290
+ constructor(options) {
291
+ super(options);
292
+ this.images = options.images;
293
+ }
294
+ toString() {
295
+ const pts = formatPts(this.pts);
296
+ return `${this.name}(pts: ${pts}, size: ${this.images.length})`;
297
+ }
298
+ }
299
+ /**
300
+ * Sideband marker emitted by an LLM service.
301
+ *
302
+ * A marker is short, structured assistant output that should be persisted in
303
+ * the conversation context but should not flow through the standard text path
304
+ * (TTS, transcript). The assistant aggregator writes the marker to the context
305
+ * so the LLM can self-condition on prior markers on subsequent turns.
306
+ *
307
+ * The primary use today is the `filterIncompleteUserTurns` protocol, where
308
+ * `UserTurnCompletionLLMServiceMixin` emits the turn-completion markers
309
+ * ● / ◐ / ○ on every response. The frame is intentionally generic so other
310
+ * components — STT services with built-in turn signals, end-of-turn
311
+ * classifiers, custom annotations, etc. — can use the same mechanism to inject
312
+ * sideband signals into the assistant context.
313
+ *
314
+ * - `marker`: the marker payload (typically a short string such as a single
315
+ * character).
316
+ * - `appendToContextImmediately`: if true, the marker is written to the
317
+ * context as its own standalone assistant message as soon as it's received.
318
+ * If false, the marker is appended to the running assistant aggregation and
319
+ * flushed to the context together with the following text as a single
320
+ * message (e.g. for the ● case the context message ends up as
321
+ * "● <response>").
322
+ */
323
+ export class LLMMarkerFrame extends DataFrame {
324
+ marker;
325
+ appendToContextImmediately;
326
+ constructor(options) {
327
+ super(options);
328
+ this.marker = options.marker;
329
+ this.appendToContextImmediately = options.appendToContextImmediately ?? true;
330
+ }
331
+ }
332
+ /**
333
+ * What a marker-reading LLM service made of one whole response.
334
+ *
335
+ * Pushed when the response ends, after the `LLMMarkerFrame` and the spoken
336
+ * text: the marker it found, what it meant, and the raw text the LLM produced
337
+ * before anything was held back. A diagnostic, for consumers that check how
338
+ * well the LLM follows the marker protocol; it plays no part in the
339
+ * conversation.
340
+ *
341
+ * - `raw`: the response text as the LLM produced it, markers included.
342
+ * - `marker`: the marker found, or null when the response carried none.
343
+ * - `kind`: what the marker meant, in the emitter's own vocabulary, for
344
+ * consumers that should not depend on the marker text (which is
345
+ * configurable). The turn-completion mixin uses `"complete"`, `"short"` and
346
+ * `"long"`.
347
+ * - `markers`: every marker the emitter recognizes, so a consumer can find
348
+ * them in `raw` without knowing the emitter's configuration.
349
+ */
350
+ export class LLMMarkerResponseFrame extends DataFrame {
351
+ raw;
352
+ marker;
353
+ kind;
354
+ markers;
355
+ constructor(options) {
356
+ super(options);
357
+ this.raw = options.raw;
358
+ this.marker = options.marker ?? null;
359
+ this.kind = options.kind ?? null;
360
+ this.markers = options.markers ?? [];
361
+ }
362
+ }
363
+ /**
364
+ * Text frame representing an aggregation of TextFrames.
365
+ *
366
+ * This frame contains multiple TextFrames aggregated together for processing
367
+ * or output along with a field to indicate what kind of text they make.
368
+ *
369
+ * - `textType`: the kind of text, such as a sentence, a word or a custom type
370
+ * like `"code"`.
371
+ * - `contextId`: unique identifier for the TTS context that generated this text.
372
+ * - `rawText`: the full matched text including start/end pattern delimiters,
373
+ * set when this frame was produced from a PatternMatch (e.g. a
374
+ * `<code>...</code>` block). Null for ordinary sentence aggregations.
375
+ * - `willBeSpoken`: whether the TTS service will speak this frame. Set to true
376
+ * by the TTS service just before synthesis. Defaults to false.
377
+ */
378
+ export class AggregatedTextFrame extends TextFrame {
379
+ textType;
380
+ contextId;
381
+ rawText;
382
+ willBeSpoken = false;
383
+ constructor(options) {
384
+ super(options);
385
+ this.textType = options.textType;
386
+ this.contextId = options.contextId ?? null;
387
+ this.rawText = options.rawText ?? null;
388
+ }
389
+ }
390
+ /** Text frame generated by vision services. */
391
+ export class VisionTextFrame extends LLMTextFrame {
392
+ }
393
+ /**
394
+ * Text frame generated by Text-to-Speech services.
395
+ *
396
+ * - `segmentId`: ID of the AggregatedTextFrame this text is part of, when the
397
+ * TTS service built it from one. A word reported by the TTS carries the ID
398
+ * of the sentence or other segment it was spoken in.
399
+ */
400
+ export class TTSTextFrame extends AggregatedTextFrame {
401
+ segmentId;
402
+ constructor(options) {
403
+ super(options);
404
+ this.segmentId = options.segmentId ?? null;
405
+ }
406
+ }
407
+ /**
408
+ * Progress frame emitted alongside each TTSTextFrame during word-timestamp playback.
409
+ *
410
+ * Carries the spoken-so-far / remaining-text breakdown for the active
411
+ * AggregatedTextFrame slot, enabling downstream consumers (e.g. the RTVI
412
+ * observer) to do word-level highlighting without coupling to internal
413
+ * sequencer state.
414
+ *
415
+ * - `segmentId`: ID of the AggregatedTextFrame being spoken.
416
+ * - `contextId`: TTS context this frame belongs to.
417
+ * - `text`: full original text of the source AggregatedTextFrame.
418
+ * - `textType`: text type of the source AggregatedTextFrame.
419
+ * - `accumulatedText`: text already spoken in this slot (including the current word).
420
+ * - `remainingText`: text not yet spoken in this slot.
421
+ */
422
+ export class AggregatedTextProgressFrame extends DataFrame {
423
+ segmentId;
424
+ contextId;
425
+ text;
426
+ textType;
427
+ accumulatedText;
428
+ remainingText;
429
+ constructor(options) {
430
+ super(options);
431
+ this.segmentId = options.segmentId;
432
+ this.contextId = options.contextId;
433
+ this.text = options.text;
434
+ this.textType = options.textType;
435
+ this.accumulatedText = options.accumulatedText;
436
+ this.remainingText = options.remainingText;
437
+ }
438
+ }
439
+ /**
440
+ * Text frame containing speech transcription data.
441
+ *
442
+ * A text frame with transcription-specific data. The `result` field contains
443
+ * the result from the STT service if available.
444
+ *
445
+ * - `userId`: identifier for the user who spoke.
446
+ * - `timestamp`: when the transcription occurred.
447
+ * - `language`: detected or specified language of the speech.
448
+ * - `result`: raw result from the STT service.
449
+ * - `finalized`: whether this is the final transcription for an utterance.
450
+ * Set by STT services that support commit/finalize signals.
451
+ */
452
+ export class TranscriptionFrame extends TextFrame {
453
+ userId;
454
+ timestamp;
455
+ language;
456
+ result;
457
+ finalized;
458
+ constructor(options) {
459
+ super(options);
460
+ this.userId = options.userId;
461
+ this.timestamp = options.timestamp;
462
+ this.language = options.language ?? null;
463
+ this.result = options.result ?? null;
464
+ this.finalized = options.finalized ?? false;
465
+ }
466
+ toString() {
467
+ return `${this.name}(user: ${this.userId}, text: [${this.text}], language: ${this.language}, timestamp: ${this.timestamp})`;
468
+ }
469
+ }
470
+ /**
471
+ * Text frame containing partial/interim transcription data.
472
+ *
473
+ * A text frame with interim transcription-specific data that represents
474
+ * partial results before final transcription. The `result` field contains the
475
+ * result from the STT service if available.
476
+ *
477
+ * - `userId`: identifier for the user who spoke.
478
+ * - `timestamp`: when the interim transcription occurred.
479
+ * - `language`: detected or specified language of the speech.
480
+ * - `result`: raw result from the STT service.
481
+ */
482
+ export class InterimTranscriptionFrame extends TextFrame {
483
+ userId;
484
+ timestamp;
485
+ language;
486
+ result;
487
+ constructor(options) {
488
+ super(options);
489
+ this.userId = options.userId;
490
+ this.timestamp = options.timestamp;
491
+ this.language = options.language ?? null;
492
+ this.result = options.result ?? null;
493
+ }
494
+ toString() {
495
+ return `${this.name}(user: ${this.userId}, text: [${this.text}], language: ${this.language}, timestamp: ${this.timestamp})`;
496
+ }
497
+ }
498
+ /**
499
+ * Transcript of a turn a service predicts has ended, before it commits.
500
+ *
501
+ * Some STT services emit a provisional end of turn ahead of the real one, so a
502
+ * response can be generated during the gap. The prediction may be withdrawn
503
+ * (`EagerEndOfTurnCancelFrame`) and the committed transcript may differ from
504
+ * this one, so nothing produced from it may reach the user or the context
505
+ * until it is confirmed. See `EagerUserTurnStopStrategy`.
506
+ *
507
+ * - `userId`: identifier for the user who spoke.
508
+ * - `timestamp`: when the eager end of turn occurred.
509
+ * - `language`: detected or specified language of the speech.
510
+ * - `result`: raw result from the STT service.
511
+ */
512
+ export class EagerTranscriptionFrame extends TextFrame {
513
+ userId;
514
+ timestamp;
515
+ language;
516
+ result;
517
+ constructor(options) {
518
+ super(options);
519
+ this.userId = options.userId;
520
+ this.timestamp = options.timestamp;
521
+ this.language = options.language ?? null;
522
+ this.result = options.result ?? null;
523
+ }
524
+ toString() {
525
+ return `${this.name}(user: ${this.userId}, text: [${this.text}], language: ${this.language}, timestamp: ${this.timestamp})`;
526
+ }
527
+ }
528
+ /**
529
+ * Text frame containing translated transcription data.
530
+ *
531
+ * A text frame with translated transcription data that will be placed in the
532
+ * transport's receive queue when a participant speaks.
533
+ *
534
+ * - `userId`: identifier for the user who spoke.
535
+ * - `timestamp`: when the translation occurred.
536
+ * - `language`: target language of the translation.
537
+ */
538
+ export class TranslationFrame extends TextFrame {
539
+ userId;
540
+ timestamp;
541
+ language;
542
+ constructor(options) {
543
+ super(options);
544
+ this.userId = options.userId;
545
+ this.timestamp = options.timestamp;
546
+ this.language = options.language ?? null;
547
+ }
548
+ toString() {
549
+ return `${this.name}(user: ${this.userId}, text: [${this.text}], language: ${this.language}, timestamp: ${this.timestamp})`;
550
+ }
551
+ }
552
+ /**
553
+ * A short acknowledgment the user said while the bot talks, such as "mhm".
554
+ *
555
+ * Pushed in place of a transcription, so the bot keeps talking and the
556
+ * acknowledgment stays out of the LLM context.
557
+ *
558
+ * - `text`: what the user said.
559
+ * - `userId`: identifier for the user who spoke.
560
+ * - `timestamp`: when the user said it.
561
+ */
562
+ export class UserBackchannelFrame extends DataFrame {
563
+ text;
564
+ userId;
565
+ timestamp;
566
+ constructor(options) {
567
+ super(options);
568
+ this.text = options.text;
569
+ this.userId = options.userId;
570
+ this.timestamp = options.timestamp;
571
+ }
572
+ toString() {
573
+ return `${this.name}(user: ${this.userId}, text: [${this.text}], timestamp: ${this.timestamp})`;
574
+ }
575
+ }
576
+ /**
577
+ * Timestamp information for assistant messages in LLM context.
578
+ *
579
+ * - `timestamp`: timestamp when the assistant message was created.
580
+ */
581
+ export class LLMContextAssistantTimestampFrame extends DataFrame {
582
+ timestamp;
583
+ constructor(options) {
584
+ super(options);
585
+ this.timestamp = options.timestamp;
586
+ }
587
+ }
588
+ /**
589
+ * The aggregated text of a completed assistant turn.
590
+ *
591
+ * Broadcast by the LLM assistant aggregator when a turn ends, carrying the
592
+ * same text that is stored in the LLM context. Processors upstream and
593
+ * downstream (e.g. STT services) can handle this frame to react to each
594
+ * completed bot reply without needing a separate observer.
595
+ *
596
+ * - `text`: the assistant's aggregated spoken text for this turn.
597
+ * - `timestamp`: ISO-8601 timestamp of when the assistant turn started.
598
+ */
599
+ export class LLMContextAssistantTurnFrame extends DataFrame {
600
+ text;
601
+ timestamp;
602
+ constructor(options) {
603
+ super(options);
604
+ this.text = options.text;
605
+ this.timestamp = options.timestamp;
606
+ }
607
+ }
608
+ /**
609
+ * The aggregated text of a user turn, as written to the LLM context.
610
+ *
611
+ * Broadcast by the LLM user aggregator each time it writes what the user said
612
+ * to the context, so it holds what the bot heard: a transcription the
613
+ * aggregator leaves out, such as one while the user is muted, is not in it.
614
+ *
615
+ * - `text`: the user's aggregated transcript for this turn.
616
+ * - `timestamp`: ISO-8601 timestamp of when the user turn started.
617
+ */
618
+ export class LLMContextUserTurnFrame extends DataFrame {
619
+ text;
620
+ timestamp;
621
+ constructor(options) {
622
+ super(options);
623
+ this.text = options.text;
624
+ this.timestamp = options.timestamp;
625
+ }
626
+ }
627
+ /**
628
+ * Frame containing a universal LLM context.
629
+ *
630
+ * Used as a signal to LLM services to ingest the provided context and generate
631
+ * a response based on it.
632
+ *
633
+ * - `context`: the LLM context containing messages, tools, and configuration.
634
+ * - `speculation`: whether this inference is speculative, run from a
635
+ * provisional context that is not part of the conversation. Its response
636
+ * must not reach the user or the context until the turn is confirmed, and
637
+ * the service must not execute tool calls for it.
638
+ */
639
+ export class LLMContextFrame extends Frame {
640
+ context;
641
+ speculation;
642
+ constructor(options) {
643
+ super(options);
644
+ this.context = options.context;
645
+ this.speculation = options.speculation ?? false;
646
+ }
647
+ }
648
+ /**
649
+ * Frame indicating the start of an LLM thought.
650
+ *
651
+ * - `appendToContext`: whether the thought should be appended to the LLM
652
+ * context. If it is appended, the `llm` field is required, since it will be
653
+ * appended as an `LLMSpecificMessage`.
654
+ * - `llm`: optional identifier of the LLM provider for LLM-specific handling.
655
+ * Only required if `appendToContext` is true, as the thought is appended to
656
+ * context as an `LLMSpecificMessage`.
657
+ */
658
+ export class LLMThoughtStartFrame extends ControlFrame {
659
+ appendToContext;
660
+ llm;
661
+ constructor(options = {}) {
662
+ super(options);
663
+ this.appendToContext = options.appendToContext ?? false;
664
+ this.llm = options.llm ?? null;
665
+ if (this.appendToContext && this.llm === null) {
666
+ throw new Error("When append_to_context is True, llm must be set");
667
+ }
668
+ }
669
+ toString() {
670
+ const pts = formatPts(this.pts);
671
+ return `${this.name}(pts: ${pts}, append_to_context: ${this.appendToContext}, llm: ${this.llm})`;
672
+ }
673
+ }
674
+ /**
675
+ * Frame containing the text (or text chunk) of an LLM thought.
676
+ *
677
+ * Note that despite this containing text, it is a DataFrame and not a
678
+ * TextFrame, to avoid most typical text processing, such as TTS.
679
+ *
680
+ * - `text`: the text (or text chunk) of the thought.
681
+ */
682
+ export class LLMThoughtTextFrame extends DataFrame {
683
+ text;
684
+ // Assume that thought text chunks include all necessary spaces
685
+ includesInterFrameSpaces = true;
686
+ constructor(options) {
687
+ super(options);
688
+ this.text = options.text;
689
+ }
690
+ toString() {
691
+ const pts = formatPts(this.pts);
692
+ return `${this.name}(pts: ${pts}, thought text: ${this.text})`;
693
+ }
694
+ }
695
+ /**
696
+ * Frame indicating the end of an LLM thought.
697
+ *
698
+ * - `signature`: optional signature associated with the thought. This is used
699
+ * by Anthropic, which includes a signature at the end of each thought.
700
+ */
701
+ export class LLMThoughtEndFrame extends ControlFrame {
702
+ signature;
703
+ constructor(options = {}) {
704
+ super(options);
705
+ this.signature = options.signature ?? null;
706
+ }
707
+ toString() {
708
+ const pts = formatPts(this.pts);
709
+ return `${this.name}(pts: ${pts}, signature: ${this.signature})`;
710
+ }
711
+ }
712
+ /**
713
+ * Frame to trigger LLM processing with current context.
714
+ *
715
+ * A frame that instructs the LLM service to process the current context and
716
+ * generate a response.
717
+ */
718
+ export class LLMRunFrame extends DataFrame {
719
+ }
720
+ /**
721
+ * Frame containing LLM messages to append to current context.
722
+ *
723
+ * A frame containing a list of LLM messages that need to be added to the
724
+ * current context.
725
+ *
726
+ * - `messages`: list of context messages to append.
727
+ * - `runLlm`: whether the context update should be sent to the LLM.
728
+ */
729
+ export class LLMMessagesAppendFrame extends DataFrame {
730
+ messages;
731
+ runLlm;
732
+ constructor(options) {
733
+ super(options);
734
+ this.messages = options.messages;
735
+ this.runLlm = options.runLlm ?? null;
736
+ }
737
+ }
738
+ /**
739
+ * Frame containing LLM messages to replace current context.
740
+ *
741
+ * A frame containing a list of new LLM messages to replace the current
742
+ * context LLM messages.
743
+ *
744
+ * - `messages`: list of context messages to replace current context.
745
+ * - `runLlm`: whether the context update should be sent to the LLM.
746
+ */
747
+ export class LLMMessagesUpdateFrame extends DataFrame {
748
+ messages;
749
+ runLlm;
750
+ constructor(options) {
751
+ super(options);
752
+ this.messages = options.messages;
753
+ this.runLlm = options.runLlm ?? null;
754
+ }
755
+ }
756
+ /**
757
+ * Frame containing a transform function to modify the current context's LLM messages.
758
+ *
759
+ * A frame containing a transform function that takes the context's current
760
+ * list of LLM messages and returns a modified list.
761
+ *
762
+ * - `transform`: a function that takes a list of messages and returns a
763
+ * modified list.
764
+ * - `runLlm`: whether the context update should be sent to the LLM.
765
+ */
766
+ export class LLMMessagesTransformFrame extends DataFrame {
767
+ transform;
768
+ runLlm;
769
+ constructor(options) {
770
+ super(options);
771
+ this.transform = options.transform;
772
+ this.runLlm = options.runLlm ?? null;
773
+ }
774
+ }
775
+ /**
776
+ * Frame containing tools for LLM function calling.
777
+ *
778
+ * Used to change the set of tools advertised to the LLM mid-conversation.
779
+ *
780
+ * - `tools`: the tools to advertise. May be a `ToolsSchema`, a plain list of
781
+ * direct functions and/or `FunctionSchema` objects (normalized to a
782
+ * `ToolsSchema`, with direct-function handlers auto-registered), or
783
+ * `NOT_GIVEN` to clear tools. Provider-native tools travel in a
784
+ * `ToolsSchema`'s `customTools`, keyed by adapter type.
785
+ */
786
+ export class LLMSetToolsFrame extends DataFrame {
787
+ tools;
788
+ constructor(options) {
789
+ super(options);
790
+ this.tools = options.tools;
791
+ }
792
+ }
793
+ /**
794
+ * Frame containing tool choice configuration for LLM function calling.
795
+ *
796
+ * - `toolChoice`: tool choice setting - 'none', 'auto', 'required', or
797
+ * specific tool dict.
798
+ */
799
+ export class LLMSetToolChoiceFrame extends DataFrame {
800
+ toolChoice;
801
+ constructor(options) {
802
+ super(options);
803
+ this.toolChoice = options.toolChoice;
804
+ }
805
+ }
806
+ /**
807
+ * Frame to enable/disable prompt caching in LLMs.
808
+ *
809
+ * - `enable`: whether to enable prompt caching.
810
+ */
811
+ export class LLMEnablePromptCachingFrame extends DataFrame {
812
+ enable;
813
+ constructor(options) {
814
+ super(options);
815
+ this.enable = options.enable;
816
+ }
817
+ }
818
+ /**
819
+ * Frame to configure LLM output.
820
+ *
821
+ * This frame is used to configure how the LLM produces output. For example, it
822
+ * can tell the LLM to generate tokens that should be added to the context but
823
+ * not spoken by the TTS service (if one is present in the pipeline).
824
+ *
825
+ * - `skipTts`: whether LLM tokens should skip the TTS service (if any).
826
+ */
827
+ export class LLMConfigureOutputFrame extends DataFrame {
828
+ skipTts;
829
+ constructor(options) {
830
+ super(options);
831
+ this.skipTts = options.skipTts;
832
+ }
833
+ }
834
+ /**
835
+ * Properties for configuring function call result behavior.
836
+ *
837
+ * - `runLlm`: whether to run the LLM after receiving this result.
838
+ * - `onContextUpdated`: callback to execute when context is updated.
839
+ * - `isFinal`: whether this is the final result for the function call. When
840
+ * false the result is treated as an intermediate update. Defaults to true.
841
+ * Only meaningful for async function calls (`cancelOnInterruption: false`).
842
+ * A speech-to-speech service takes one output per call, so it puts an
843
+ * intermediate result to its model some other way — a conversation item, a
844
+ * text event, a response that keeps the call open — and `runLlm` says
845
+ * whether the model should answer it or just take it in. A service that
846
+ * can't do that at all says so with
847
+ * `acceptsIntermediateFunctionCallResults` and drops intermediate results
848
+ * with a warning.
849
+ */
850
+ export class FunctionCallResultProperties {
851
+ runLlm;
852
+ onContextUpdated;
853
+ isFinal;
854
+ constructor(options = {}) {
855
+ this.runLlm = options.runLlm ?? null;
856
+ this.onContextUpdated = options.onContextUpdated ?? null;
857
+ this.isFinal = options.isFinal ?? true;
858
+ }
859
+ }
860
+ /**
861
+ * Frame containing the result of an LLM function call.
862
+ *
863
+ * This is an uninterruptible frame because once a result is generated we
864
+ * always want to update the context.
865
+ *
866
+ * - `functionName`: name of the function that was executed.
867
+ * - `toolCallId`: unique identifier for the function call.
868
+ * - `arguments`: arguments that were passed to the function.
869
+ * - `result`: the result returned by the function.
870
+ * - `runLlm`: whether to run the LLM after this result.
871
+ * - `properties`: additional properties for result handling.
872
+ * - `error`: what went wrong, when the call ended because its handler raised.
873
+ * The `result` is then a stand-in message written for the LLM to read,
874
+ * rather than anything the handler returned.
875
+ */
876
+ export class FunctionCallResultFrame extends DataFrame {
877
+ interruptible = false;
878
+ functionName;
879
+ toolCallId;
880
+ arguments;
881
+ result;
882
+ runLlm;
883
+ properties;
884
+ error;
885
+ constructor(options) {
886
+ super(options);
887
+ this.functionName = options.functionName;
888
+ this.toolCallId = options.toolCallId;
889
+ this.arguments = options.arguments;
890
+ this.result = options.result;
891
+ this.runLlm = options.runLlm ?? null;
892
+ this.properties = options.properties ?? null;
893
+ this.error = options.error ?? null;
894
+ }
895
+ }
896
+ /**
897
+ * Frame containing text that should be spoken by TTS.
898
+ *
899
+ * A frame that contains text that should be spoken by the TTS service in the
900
+ * pipeline (if any).
901
+ *
902
+ * Set `interruptible = false` on the frame to preserve its synthesis and
903
+ * generated audio and text through interruptions.
904
+ *
905
+ * - `text`: the text to be spoken.
906
+ * - `appendToContext`: whether the spoken text should be appended to the LLM
907
+ * context. Defaults to true.
908
+ * - `textType`: the text type of the text frames the TTS service pushes for
909
+ * the spoken text, a sentence by default. A custom type lets them be told
910
+ * apart, for example to keep them from the client with
911
+ * `RTVIObserverParams.skipTextTypes`.
912
+ */
913
+ export class TTSSpeakFrame extends DataFrame {
914
+ text;
915
+ appendToContext;
916
+ textType;
917
+ constructor(options) {
918
+ super(options);
919
+ this.text = options.text;
920
+ this.appendToContext = options.appendToContext ?? true;
921
+ this.textType = options.textType ?? TextType.SENTENCE;
922
+ }
923
+ }
924
+ /**
925
+ * A short acknowledgment for the bot to say while the user talks, such as "Mm-hmm.".
926
+ *
927
+ * The TTS service speaks it like any `TTSSpeakFrame`, and its text frames
928
+ * have type `TextType.BACKCHANNEL`. Interruptions don't cut it off unless
929
+ * `interruptible` is set to true on the frame.
930
+ *
931
+ * - `appendToContext`: whether the spoken text should be appended to the LLM
932
+ * context. Defaults to false.
933
+ */
934
+ export class BotBackchannelFrame extends TTSSpeakFrame {
935
+ textType = TextType.BACKCHANNEL;
936
+ interruptible = false;
937
+ constructor(options) {
938
+ super(options);
939
+ this.appendToContext = options.appendToContext ?? false;
940
+ }
941
+ }
942
+ /**
943
+ * Frame containing transport-specific message data.
944
+ *
945
+ * - `message`: the transport message payload.
946
+ */
947
+ export class OutputTransportMessageFrame extends DataFrame {
948
+ message;
949
+ constructor(options) {
950
+ super(options);
951
+ this.message = options.message;
952
+ }
953
+ toString() {
954
+ return `${this.name}(message: ${this.message})`;
955
+ }
956
+ }
957
+ /**
958
+ * DTMF keypress output frame for transport queuing.
959
+ *
960
+ * - `button`: convenience shortcut for sending a single DTMF keypad entry.
961
+ * Equivalent to `buttons: [button]`. If both `buttons` and `button` are
962
+ * provided, `buttons` takes precedence.
963
+ * - `buttons`: sequence of one or more DTMF keypad buttons to send. Use
964
+ * `fromString()` to build this from a string like `"123#"`.
965
+ */
966
+ export class OutputDTMFFrame extends DTMFFrame(DataFrame) {
967
+ button;
968
+ buttons;
969
+ constructor(options = {}) {
970
+ super(options);
971
+ this.button = options.button ?? null;
972
+ this.buttons = options.buttons ?? null;
973
+ if (this.buttons === null && this.button !== null) {
974
+ this.buttons = [this.button];
975
+ }
976
+ if (!this.buttons || this.buttons.length === 0) {
977
+ throw new Error(`${this.constructor.name} requires \`buttons\` or \`button\` to be set`);
978
+ }
979
+ }
980
+ toString() {
981
+ return `${this.name}(buttons: ${this.toDialString()})`;
982
+ }
983
+ /**
984
+ * Build an `OutputDTMFFrame` from a string of DTMF characters.
985
+ *
986
+ * @param buttons A string like `"123#"`. Each character must be a valid
987
+ * `KeypadEntry` value.
988
+ * @param options Additional options forwarded to the frame constructor.
989
+ * @returns A frame of this class with `buttons` populated as a list of `KeypadEntry`.
990
+ */
991
+ static fromString(buttons, options = {}) {
992
+ return new this({ ...options, buttons: [...buttons].map(toKeypadEntry) });
993
+ }
994
+ /**
995
+ * Return the frame's `buttons` as a dial string. Upstream's `to_string()`;
996
+ * renamed because `toString()` is the JS `__str__`.
997
+ *
998
+ * @returns A string such as `"123#"` formed by concatenating each
999
+ * `KeypadEntry` in `buttons`, or an empty string if `buttons` is not set.
1000
+ */
1001
+ toDialString() {
1002
+ return this.buttons ? this.buttons.join("") : "";
1003
+ }
1004
+ }
1005
+ //
1006
+ // System frames
1007
+ //
1008
+ /**
1009
+ * Initial frame to start pipeline processing.
1010
+ *
1011
+ * This is the first frame that should be pushed down a pipeline to initialize
1012
+ * all processors. Processors read the pipeline configuration from
1013
+ * `FrameProcessorSetup`.
1014
+ */
1015
+ export class StartFrame extends SystemFrame {
1016
+ }
1017
+ /**
1018
+ * Frame indicating pipeline should stop immediately.
1019
+ *
1020
+ * Indicates that a pipeline needs to stop right away without processing
1021
+ * remaining queued frames.
1022
+ *
1023
+ * - `reason`: optional reason for pushing a cancel frame.
1024
+ */
1025
+ export class CancelFrame extends SystemFrame {
1026
+ reason;
1027
+ constructor(options = {}) {
1028
+ super(options);
1029
+ this.reason = options.reason ?? null;
1030
+ }
1031
+ toString() {
1032
+ return `${this.name}(reason: ${this.reason})`;
1033
+ }
1034
+ }
1035
+ /**
1036
+ * Frame notifying of errors in the pipeline.
1037
+ *
1038
+ * This is used to notify upstream that an error has occurred downstream in the
1039
+ * pipeline.
1040
+ *
1041
+ * - `error`: description of the error that occurred. Credentials it quotes
1042
+ * (an API key, a signed URL's signature, an auth header) are masked, since
1043
+ * the description is logged and reported wherever the error goes.
1044
+ * - `processor`: the frame processor that generated the error.
1045
+ * - `exception`: the exception that occurred.
1046
+ * - `category`: what kind of failure this was, drawn from `ErrorCategory`:
1047
+ * rejected credentials, an unreachable provider, a malformed request and so
1048
+ * on. Null means nobody has said yet, which invites the category to be
1049
+ * worked out from the exception; set it to `ErrorCategory.UNKNOWN` to
1050
+ * report an error whose cause can't be attributed. Always set by the time
1051
+ * the frame travels.
1052
+ */
1053
+ export class ErrorFrame extends SystemFrame {
1054
+ error;
1055
+ processor;
1056
+ exception;
1057
+ category;
1058
+ constructor(options) {
1059
+ super(options);
1060
+ this.error = typeof options.error === "string" ? redactSecrets(options.error) : options.error;
1061
+ this.processor = options.processor ?? null;
1062
+ this.exception = options.exception ?? null;
1063
+ this.category = options.category ?? null;
1064
+ }
1065
+ toString() {
1066
+ const category = this.category && this.category !== ErrorCategory.UNKNOWN
1067
+ ? `, category: ${this.category.value}`
1068
+ : "";
1069
+ return `${this.name}(error: ${this.error}${category})`;
1070
+ }
1071
+ }
1072
+ /**
1073
+ * Frame to pause frame processing immediately.
1074
+ *
1075
+ * This frame is used to pause frame processing for the given processor as
1076
+ * fast as possible. Pausing frame processing will keep frames in the internal
1077
+ * queue which will then be processed when frame processing is resumed with
1078
+ * `FrameProcessorResumeFrame`.
1079
+ *
1080
+ * - `processor`: the frame processor to pause.
1081
+ */
1082
+ export class FrameProcessorPauseUrgentFrame extends SystemFrame {
1083
+ processor;
1084
+ constructor(options) {
1085
+ super(options);
1086
+ this.processor = options.processor;
1087
+ }
1088
+ }
1089
+ /**
1090
+ * Frame to resume frame processing immediately.
1091
+ *
1092
+ * This frame is used to resume frame processing for the given processor if it
1093
+ * was previously paused as fast as possible. After resuming frame processing
1094
+ * all queued frames will be processed in the order received.
1095
+ *
1096
+ * Note: this frame is now equivalent to FrameProcessorResumeFrame, which was
1097
+ * changed to a SystemFrame to fix a bug where resume frames would get stuck in
1098
+ * the blocked processing queue.
1099
+ *
1100
+ * - `processor`: the frame processor to resume.
1101
+ */
1102
+ export class FrameProcessorResumeUrgentFrame extends SystemFrame {
1103
+ processor;
1104
+ constructor(options) {
1105
+ super(options);
1106
+ this.processor = options.processor;
1107
+ }
1108
+ }
1109
+ /**
1110
+ * Frame pushed to interrupt the pipeline.
1111
+ *
1112
+ * This frame is used to interrupt the pipeline. For example, when a user
1113
+ * starts speaking to cancel any in-progress bot output. It can also be pushed
1114
+ * by any processor.
1115
+ */
1116
+ export class InterruptionFrame extends SystemFrame {
1117
+ }
1118
+ /**
1119
+ * Frame indicating that the user turn has started.
1120
+ *
1121
+ * Emitted when the user turn starts, which usually means that some
1122
+ * transcriptions are already available.
1123
+ */
1124
+ export class UserStartedSpeakingFrame extends SystemFrame {
1125
+ }
1126
+ /**
1127
+ * Frame indicating that the user turn has ended.
1128
+ *
1129
+ * Emitted when the user turn ends. This usually coincides with the start of
1130
+ * the bot turn. A `SpeculationGate` releases whatever speculative response it
1131
+ * is holding on this frame, since the turn that response answers has now
1132
+ * ended.
1133
+ */
1134
+ export class UserStoppedSpeakingFrame extends SystemFrame {
1135
+ }
1136
+ /**
1137
+ * Frame withdrawing an eager end of turn.
1138
+ *
1139
+ * Emitted when a service reports the user resumed speaking after an eager end
1140
+ * of turn, or when the committed transcript doesn't match the eager one. The
1141
+ * LLM service stops generating, and its `SpeculationGate` discards what it was
1142
+ * holding — which is everything the response produced, so nothing further
1143
+ * down the pipeline has anything to undo.
1144
+ *
1145
+ * A system frame so it overtakes the speculative output it cancels.
1146
+ */
1147
+ export class EagerEndOfTurnCancelFrame extends SystemFrame {
1148
+ }
1149
+ /**
1150
+ * Frame indicating that the user has been muted.
1151
+ *
1152
+ * Emitted when a mute strategy activates, suppressing user frames (audio,
1153
+ * transcription, interruption) from propagating through the pipeline.
1154
+ */
1155
+ export class UserMuteStartedFrame extends SystemFrame {
1156
+ }
1157
+ /**
1158
+ * Frame indicating that the user has been unmuted.
1159
+ *
1160
+ * Emitted when a mute strategy deactivates, allowing user frames to propagate
1161
+ * through the pipeline again.
1162
+ */
1163
+ export class UserMuteStoppedFrame extends SystemFrame {
1164
+ }
1165
+ /**
1166
+ * Frame indicating the user is speaking.
1167
+ *
1168
+ * Emitted by VAD to indicate the user is speaking.
1169
+ */
1170
+ export class UserSpeakingFrame extends SystemFrame {
1171
+ }
1172
+ /**
1173
+ * Frame indicating that the user turn is semantically complete.
1174
+ *
1175
+ * Emitted by any component that can judge conversational turn completeness —
1176
+ * for example an LLM with turn-completion markers, an STT service with
1177
+ * built-in turn detection, or a dedicated end-of-turn classifier. Stop
1178
+ * strategies that gate the user-turn-stop event on an external completeness
1179
+ * signal (e.g. `LLMTurnCompletionUserTurnStopStrategy`) consume this frame to
1180
+ * finalize the turn. Producers should emit this frame only when they judge the
1181
+ * turn complete; an absence of this frame means the turn is not yet considered
1182
+ * complete.
1183
+ */
1184
+ export class UserTurnInferenceCompletedFrame extends SystemFrame {
1185
+ }
1186
+ /**
1187
+ * Frame emitted when VAD definitively detects user started speaking.
1188
+ *
1189
+ * - `startSecs`: the VAD `startSecs` duration that was used to confirm the
1190
+ * user started speaking. This represents the speech duration that had to
1191
+ * elapse before the VAD determined speech began.
1192
+ * - `timestamp`: wall-clock time when the VAD made its determination.
1193
+ */
1194
+ export class VADUserStartedSpeakingFrame extends SystemFrame {
1195
+ startSecs;
1196
+ timestamp;
1197
+ constructor(options = {}) {
1198
+ super(options);
1199
+ this.startSecs = options.startSecs ?? 0.0;
1200
+ this.timestamp = options.timestamp ?? time();
1201
+ }
1202
+ }
1203
+ /**
1204
+ * Frame emitted when VAD definitively detects user stopped speaking.
1205
+ *
1206
+ * - `stopSecs`: the VAD `stopSecs` duration that was used to confirm the user
1207
+ * stopped speaking. This represents the silence duration that had to elapse
1208
+ * before the VAD determined speech ended.
1209
+ * - `timestamp`: wall-clock time when the VAD made its determination.
1210
+ */
1211
+ export class VADUserStoppedSpeakingFrame extends SystemFrame {
1212
+ stopSecs;
1213
+ timestamp;
1214
+ constructor(options = {}) {
1215
+ super(options);
1216
+ this.stopSecs = options.stopSecs ?? 0.0;
1217
+ this.timestamp = options.timestamp ?? time();
1218
+ }
1219
+ }
1220
+ /**
1221
+ * Frame proposing that the user turn has started.
1222
+ *
1223
+ * Emitted by a component with its own turn detection — typically an STT or
1224
+ * realtime LLM service whose provider reports speech boundaries. It is a
1225
+ * proposal, not a decision: an `ExternalUserTurnStartStrategy` resolves it
1226
+ * into a `UserStartedSpeakingFrame` and broadcasts the interruption.
1227
+ *
1228
+ * This is a system frame because resolving it broadcasts an interruption,
1229
+ * which must preempt queued frames rather than wait behind them. Its
1230
+ * end-of-turn counterpart has the opposite requirement and is a control
1231
+ * frame; see `ProposedUserStoppedSpeakingFrame`.
1232
+ */
1233
+ export class ProposedUserStartedSpeakingFrame extends SystemFrame {
1234
+ }
1235
+ /**
1236
+ * Frame proposing that the user turn has ended.
1237
+ *
1238
+ * The end-of-turn counterpart to `ProposedUserStartedSpeakingFrame`, resolved
1239
+ * into a `UserStoppedSpeakingFrame` by an `ExternalUserTurnStopStrategy`.
1240
+ *
1241
+ * This is a control frame so it stays ordered against the final
1242
+ * `TranscriptionFrame`. A service with its own turn detection pushes that
1243
+ * transcript and then proposes the stop, and the turn strategy needs that text
1244
+ * in hand to close the turn on.
1245
+ */
1246
+ export class ProposedUserStoppedSpeakingFrame extends ControlFrame {
1247
+ }
1248
+ /**
1249
+ * Frame indicating the bot started speaking.
1250
+ *
1251
+ * Emitted upstream and downstream by the BaseTransportOutput to indicate the
1252
+ * bot started speaking.
1253
+ */
1254
+ export class BotStartedSpeakingFrame extends SystemFrame {
1255
+ }
1256
+ /**
1257
+ * Frame indicating the bot stopped speaking.
1258
+ *
1259
+ * Emitted upstream and downstream by the BaseTransportOutput to indicate the
1260
+ * bot stopped speaking.
1261
+ */
1262
+ export class BotStoppedSpeakingFrame extends SystemFrame {
1263
+ }
1264
+ /**
1265
+ * Frame indicating the bot is currently speaking.
1266
+ *
1267
+ * Emitted upstream and downstream by the BaseOutputTransport while the bot is
1268
+ * still speaking. This can be used, for example, to detect when a user is
1269
+ * idle. That is, while the bot is speaking we don't want to trigger any user
1270
+ * idle timeout since the user might be listening.
1271
+ */
1272
+ export class BotSpeakingFrame extends SystemFrame {
1273
+ }
1274
+ /**
1275
+ * Frame containing performance metrics data.
1276
+ *
1277
+ * Emitted by processors that can compute metrics like latencies.
1278
+ *
1279
+ * - `data`: list of metrics data collected by the processor.
1280
+ */
1281
+ export class MetricsFrame extends SystemFrame {
1282
+ data;
1283
+ constructor(options) {
1284
+ super(options);
1285
+ this.data = options.data;
1286
+ }
1287
+ }
1288
+ /**
1289
+ * Represents a function call returned by the LLM.
1290
+ *
1291
+ * Represents a function call returned by the LLM to be registered for execution.
1292
+ *
1293
+ * - `functionName`: the name of the function to call.
1294
+ * - `toolCallId`: a unique identifier for the function call.
1295
+ * - `arguments`: the arguments to pass to the function.
1296
+ * - `context`: the LLM context when the function call was made.
1297
+ */
1298
+ export class FunctionCallFromLLM {
1299
+ functionName;
1300
+ toolCallId;
1301
+ arguments;
1302
+ context;
1303
+ constructor(options) {
1304
+ this.functionName = options.functionName;
1305
+ this.toolCallId = options.toolCallId;
1306
+ this.arguments = options.arguments;
1307
+ this.context = options.context;
1308
+ }
1309
+ }
1310
+ /**
1311
+ * Frame signaling that function call execution is starting.
1312
+ *
1313
+ * A frame signaling that one or more function call execution is going to
1314
+ * start.
1315
+ *
1316
+ * - `functionCalls`: sequence of function calls that will be executed.
1317
+ */
1318
+ export class FunctionCallsStartedFrame extends SystemFrame {
1319
+ functionCalls;
1320
+ constructor(options) {
1321
+ super(options);
1322
+ this.functionCalls = options.functionCalls;
1323
+ }
1324
+ }
1325
+ /**
1326
+ * A function call made outside this pipeline, as announced to it.
1327
+ *
1328
+ * What `ExternalFunctionCallsStartedFrame` carries, one per call.
1329
+ *
1330
+ * - `functionName`: name of the function called.
1331
+ * - `toolCallId`: unique identifier of the call.
1332
+ */
1333
+ export class ExternalFunctionCall {
1334
+ functionName;
1335
+ toolCallId;
1336
+ constructor(options) {
1337
+ this.functionName = options.functionName;
1338
+ this.toolCallId = options.toolCallId;
1339
+ }
1340
+ }
1341
+ /**
1342
+ * Function calls were made outside this pipeline: `FunctionCallsStartedFrame`'s counterpart.
1343
+ *
1344
+ * Nothing in the pipeline acts on one; observers report it as they report the
1345
+ * pipeline's own. The calls ran elsewhere, e.g. in a backend worker's pipeline
1346
+ * on behalf of a tool here, and belong to that pipeline's conversation, not
1347
+ * this one. Like its counterpart it carries every call announced together,
1348
+ * which may be one. Each call's later phases come as
1349
+ * `ExternalFunctionCallInProgressFrame`, `ExternalFunctionCallResultFrame` and
1350
+ * `ExternalFunctionCallCancelFrame`.
1351
+ *
1352
+ * - `functionCalls`: the calls made.
1353
+ */
1354
+ export class ExternalFunctionCallsStartedFrame extends SystemFrame {
1355
+ functionCalls;
1356
+ constructor(options) {
1357
+ super(options);
1358
+ this.functionCalls = options.functionCalls;
1359
+ }
1360
+ }
1361
+ /**
1362
+ * An external function call is running: `FunctionCallInProgressFrame`'s counterpart.
1363
+ *
1364
+ * Nothing in the pipeline acts on one; observers report it as they report the
1365
+ * pipeline's own. The call ran elsewhere, e.g. in a backend worker's pipeline
1366
+ * on behalf of a tool here, and belongs to that pipeline's conversation, not
1367
+ * this one.
1368
+ *
1369
+ * - `functionName`: name of the function called.
1370
+ * - `toolCallId`: unique identifier of the call.
1371
+ * - `arguments`: arguments passed to the function.
1372
+ */
1373
+ export class ExternalFunctionCallInProgressFrame extends SystemFrame {
1374
+ functionName;
1375
+ toolCallId;
1376
+ arguments;
1377
+ constructor(options) {
1378
+ super(options);
1379
+ this.functionName = options.functionName;
1380
+ this.toolCallId = options.toolCallId;
1381
+ this.arguments = options.arguments;
1382
+ }
1383
+ }
1384
+ /**
1385
+ * An external function call produced a result: `FunctionCallResultFrame`'s counterpart.
1386
+ *
1387
+ * Nothing in the pipeline acts on one; observers report it as they report the
1388
+ * pipeline's own.
1389
+ *
1390
+ * - `functionName`: name of the function called.
1391
+ * - `toolCallId`: unique identifier of the call.
1392
+ * - `arguments`: arguments passed to the function.
1393
+ * - `result`: the result.
1394
+ * - `isFinal`: whether this result completes the call, or is one of a stream
1395
+ * of intermediate results before the final one.
1396
+ */
1397
+ export class ExternalFunctionCallResultFrame extends SystemFrame {
1398
+ functionName;
1399
+ toolCallId;
1400
+ arguments;
1401
+ result;
1402
+ isFinal;
1403
+ constructor(options) {
1404
+ super(options);
1405
+ this.functionName = options.functionName;
1406
+ this.toolCallId = options.toolCallId;
1407
+ this.arguments = options.arguments;
1408
+ this.result = options.result;
1409
+ this.isFinal = options.isFinal ?? true;
1410
+ }
1411
+ }
1412
+ /**
1413
+ * An external function call was cancelled: `FunctionCallCancelFrame`'s counterpart.
1414
+ *
1415
+ * Nothing in the pipeline acts on one; observers report it as they report the
1416
+ * pipeline's own.
1417
+ *
1418
+ * - `functionName`: name of the function called.
1419
+ * - `toolCallId`: unique identifier of the call.
1420
+ */
1421
+ export class ExternalFunctionCallCancelFrame extends SystemFrame {
1422
+ functionName;
1423
+ toolCallId;
1424
+ constructor(options) {
1425
+ super(options);
1426
+ this.functionName = options.functionName;
1427
+ this.toolCallId = options.toolCallId;
1428
+ }
1429
+ }
1430
+ /**
1431
+ * Frame signaling that a function call has been cancelled.
1432
+ *
1433
+ * - `functionName`: name of the function that was cancelled.
1434
+ * - `toolCallId`: unique identifier for the cancelled function call.
1435
+ * - `runLlm`: whether to run the LLM after this cancellation. Only a call
1436
+ * cancelled by its own timeout sets this: an interruption must not trigger
1437
+ * inference, and a cancellation the LLM asked for already runs inference
1438
+ * through the result of the tool that requested it.
1439
+ */
1440
+ export class FunctionCallCancelFrame extends SystemFrame {
1441
+ functionName;
1442
+ toolCallId;
1443
+ runLlm;
1444
+ constructor(options) {
1445
+ super(options);
1446
+ this.functionName = options.functionName;
1447
+ this.toolCallId = options.toolCallId;
1448
+ this.runLlm = options.runLlm ?? false;
1449
+ }
1450
+ }
1451
+ /**
1452
+ * Frame to mute/unmute the Speech-to-Text service.
1453
+ *
1454
+ * - `mute`: whether to mute (true) or unmute (false) the STT service.
1455
+ */
1456
+ export class STTMuteFrame extends SystemFrame {
1457
+ mute;
1458
+ constructor(options) {
1459
+ super(options);
1460
+ this.mute = options.mute;
1461
+ }
1462
+ }
1463
+ /**
1464
+ * Frame for transport messages received from external sources.
1465
+ *
1466
+ * - `message`: the urgent transport message payload.
1467
+ */
1468
+ export class InputTransportMessageFrame extends SystemFrame {
1469
+ message;
1470
+ constructor(options) {
1471
+ super(options);
1472
+ this.message = options.message;
1473
+ }
1474
+ toString() {
1475
+ return `${this.name}(message: ${this.message})`;
1476
+ }
1477
+ }
1478
+ /**
1479
+ * Frame for urgent transport messages that need to be sent immediately.
1480
+ *
1481
+ * - `message`: the urgent transport message payload.
1482
+ */
1483
+ export class OutputTransportMessageUrgentFrame extends SystemFrame {
1484
+ message;
1485
+ constructor(options) {
1486
+ super(options);
1487
+ this.message = options.message;
1488
+ }
1489
+ toString() {
1490
+ return `${this.name}(message: ${this.message})`;
1491
+ }
1492
+ }
1493
+ /**
1494
+ * Frame requesting an image from a specific user.
1495
+ *
1496
+ * A frame to request an image from the given user. The request might come
1497
+ * with a text that can be later used to describe the requested image.
1498
+ *
1499
+ * - `userId`: identifier of the user to request image from.
1500
+ * - `text`: an optional text associated to the image request.
1501
+ * - `appendToContext`: whether the requested image should be appended to the
1502
+ * LLM context.
1503
+ * - `videoSource`: specific video source to capture from.
1504
+ * - `functionName`: name of function that generated this request (if any).
1505
+ * - `toolCallId`: tool call ID if generated by function call (if any).
1506
+ * - `resultCallback`: optional callback to invoke when the image is retrieved.
1507
+ */
1508
+ export class UserImageRequestFrame extends SystemFrame {
1509
+ userId;
1510
+ text;
1511
+ appendToContext;
1512
+ videoSource;
1513
+ functionName;
1514
+ toolCallId;
1515
+ resultCallback;
1516
+ constructor(options) {
1517
+ super(options);
1518
+ this.userId = options.userId;
1519
+ this.text = options.text ?? null;
1520
+ this.appendToContext = options.appendToContext ?? null;
1521
+ this.videoSource = options.videoSource ?? null;
1522
+ this.functionName = options.functionName ?? null;
1523
+ this.toolCallId = options.toolCallId ?? null;
1524
+ this.resultCallback = options.resultCallback ?? null;
1525
+ }
1526
+ toString() {
1527
+ return `${this.name}(user: ${this.userId}, text: ${this.text}, append_to_context: ${this.appendToContext}, ${this.videoSource})`;
1528
+ }
1529
+ }
1530
+ /**
1531
+ * Raw audio input frame from transport.
1532
+ *
1533
+ * A chunk of audio usually coming from an input transport. If the transport
1534
+ * supports multiple audio sources (e.g. multiple audio tracks) the source name
1535
+ * will be specified in `transportSource`.
1536
+ */
1537
+ export class InputAudioRawFrame extends AudioRawFrame(SystemFrame) {
1538
+ constructor(options) {
1539
+ super(options);
1540
+ }
1541
+ toString() {
1542
+ const pts = formatPts(this.pts);
1543
+ return `${this.name}(pts: ${pts}, source: ${this.transportSource}, size: ${this.audio.length}, frames: ${this.numFrames}, sample_rate: ${this.sampleRate}, channels: ${this.numChannels})`;
1544
+ }
1545
+ }
1546
+ /**
1547
+ * Raw image input frame from transport.
1548
+ *
1549
+ * An image usually coming from an input transport. If the transport supports
1550
+ * multiple video sources (e.g. multiple video tracks) the source name will be
1551
+ * specified in `transportSource`.
1552
+ */
1553
+ export class InputImageRawFrame extends ImageRawFrame(SystemFrame) {
1554
+ constructor(options) {
1555
+ super(options);
1556
+ }
1557
+ toString() {
1558
+ const pts = formatPts(this.pts);
1559
+ return `${this.name}(pts: ${pts}, source: ${this.transportSource}, size: ${formatSize(this.size)}, format: ${this.format})`;
1560
+ }
1561
+ }
1562
+ /**
1563
+ * Raw file input frame.
1564
+ *
1565
+ * A file usually coming from RTVI.
1566
+ */
1567
+ export class InputFileRawFrame extends FileRawFrame(SystemFrame) {
1568
+ constructor(options) {
1569
+ super(options);
1570
+ }
1571
+ toString() {
1572
+ const pts = formatPts(this.pts);
1573
+ return `${this.name}(pts: ${pts}, type: ${this.type})`;
1574
+ }
1575
+ }
1576
+ /**
1577
+ * Raw text input frame from transport.
1578
+ *
1579
+ * Text input usually coming from user typing or programmatic text injection
1580
+ * that should be sent to LLM services as input, similar to how
1581
+ * InputAudioRawFrame and InputImageRawFrame represent user audio and video
1582
+ * input.
1583
+ *
1584
+ * Upstream inherits from both `SystemFrame` and `TextFrame`; here it extends
1585
+ * `SystemFrame`, carries `TextFrame`'s fields, and `instanceof TextFrame`
1586
+ * holds through `addVirtualBase`.
1587
+ */
1588
+ export class InputTextRawFrame extends SystemFrame {
1589
+ text;
1590
+ skipTts = null;
1591
+ includesInterFrameSpaces = false;
1592
+ appendToContext = true;
1593
+ constructor(options) {
1594
+ super(options);
1595
+ this.text = options.text;
1596
+ }
1597
+ toString() {
1598
+ const pts = formatPts(this.pts);
1599
+ return `${this.name}(pts: ${pts}, source: ${this.transportSource}, text: [${this.text}])`;
1600
+ }
1601
+ }
1602
+ addVirtualBase(InputTextRawFrame, TextFrame);
1603
+ /**
1604
+ * Raw audio input frame associated with a specific user.
1605
+ *
1606
+ * A chunk of audio, usually coming from an input transport, associated to a user.
1607
+ *
1608
+ * - `userId`: identifier of the user who provided this audio.
1609
+ */
1610
+ export class UserAudioRawFrame extends InputAudioRawFrame {
1611
+ userId;
1612
+ constructor(options) {
1613
+ super(options);
1614
+ this.userId = options.userId ?? "";
1615
+ }
1616
+ toString() {
1617
+ const pts = formatPts(this.pts);
1618
+ return `${this.name}(pts: ${pts}, user: ${this.userId}, source: ${this.transportSource}, size: ${this.audio.length}, frames: ${this.numFrames}, sample_rate: ${this.sampleRate}, channels: ${this.numChannels})`;
1619
+ }
1620
+ }
1621
+ /**
1622
+ * Raw image input frame associated with a specific user.
1623
+ *
1624
+ * An image associated to a user, potentially in response to an image request.
1625
+ *
1626
+ * - `userId`: identifier of the user who provided this image.
1627
+ * - `text`: an optional text associated to this image.
1628
+ * - `appendToContext`: whether the requested image should be appended to the
1629
+ * LLM context.
1630
+ * - `request`: the original image request frame if this is a response.
1631
+ * - `runLlm`: whether appending this image should trigger an LLM completion.
1632
+ * Null (the default) preserves the old unconditional-trigger behavior; only
1633
+ * an explicit false suppresses it.
1634
+ */
1635
+ export class UserImageRawFrame extends InputImageRawFrame {
1636
+ userId;
1637
+ text;
1638
+ appendToContext;
1639
+ request;
1640
+ runLlm;
1641
+ constructor(options) {
1642
+ super(options);
1643
+ this.userId = options.userId ?? "";
1644
+ this.text = options.text ?? null;
1645
+ this.appendToContext = options.appendToContext ?? null;
1646
+ this.request = options.request ?? null;
1647
+ this.runLlm = options.runLlm ?? null;
1648
+ }
1649
+ toString() {
1650
+ const pts = formatPts(this.pts);
1651
+ return `${this.name}(pts: ${pts}, user: ${this.userId}, source: ${this.transportSource}, size: ${formatSize(this.size)}, format: ${this.format}, text: ${this.text}, append_to_context: ${this.appendToContext})`;
1652
+ }
1653
+ }
1654
+ /**
1655
+ * Raw file input frame associated with a specific user.
1656
+ *
1657
+ * A file associated to a user.
1658
+ *
1659
+ * - `userId`: identifier of the user who provided this file.
1660
+ * - `text`: text associated to this file.
1661
+ * - `appendToContext`: whether the requested file should be appended to the
1662
+ * LLM context.
1663
+ * - `customOptions`: dictionary of custom llm-specific options to be used when
1664
+ * processing this file, like 'detail' in openAI or 'citations' in Bedrock.
1665
+ * - `runLlm`: whether appending this file should trigger an LLM completion.
1666
+ * Null (the default) preserves the old unconditional-trigger behavior; only
1667
+ * an explicit false suppresses it.
1668
+ */
1669
+ export class UserFileRawFrame extends InputFileRawFrame {
1670
+ userId;
1671
+ text;
1672
+ appendToContext;
1673
+ customOptions;
1674
+ runLlm;
1675
+ constructor(options) {
1676
+ super(options);
1677
+ this.userId = options.userId ?? "";
1678
+ this.text = options.text ?? "";
1679
+ this.appendToContext = options.appendToContext ?? null;
1680
+ this.customOptions = options.customOptions ?? null;
1681
+ this.runLlm = options.runLlm ?? null;
1682
+ }
1683
+ toString() {
1684
+ const pts = formatPts(this.pts);
1685
+ return `${this.name}(pts: ${pts}, user: ${this.userId}, format: ${this.format}, type: ${this.type}, text: ${this.text}, append_to_context: ${this.appendToContext})`;
1686
+ }
1687
+ }
1688
+ /**
1689
+ * Frame containing an image generated by the assistant.
1690
+ *
1691
+ * Contains both the raw frame for display (superclass functionality) as well
1692
+ * as the original image, which can get used directly in LLM contexts.
1693
+ *
1694
+ * - `originalData`: the original image data, which can get used directly in
1695
+ * an LLM context message without further encoding.
1696
+ * - `originalMimeType`: the MIME type of the original image data.
1697
+ */
1698
+ export class AssistantImageRawFrame extends OutputImageRawFrame {
1699
+ originalData;
1700
+ originalMimeType;
1701
+ constructor(options) {
1702
+ super(options);
1703
+ this.originalData = options.originalData ?? null;
1704
+ this.originalMimeType = options.originalMimeType ?? null;
1705
+ }
1706
+ }
1707
+ /**
1708
+ * DTMF keypress input frame from transport.
1709
+ *
1710
+ * - `button`: the DTMF keypad entry that was pressed.
1711
+ */
1712
+ export class InputDTMFFrame extends DTMFFrame(SystemFrame) {
1713
+ button;
1714
+ constructor(options) {
1715
+ super(options);
1716
+ this.button = options.button;
1717
+ }
1718
+ toString() {
1719
+ return `${this.name}(tone: ${this.button})`;
1720
+ }
1721
+ }
1722
+ /**
1723
+ * DTMF keypress output frame for immediate sending.
1724
+ *
1725
+ * - `button`: convenience shortcut for sending a single DTMF keypad entry.
1726
+ * Equivalent to `buttons: [button]`. If both `buttons` and `button` are
1727
+ * provided, `buttons` takes precedence.
1728
+ * - `buttons`: sequence of one or more DTMF keypad buttons to send. Use
1729
+ * `fromString()` to build this from a string like `"123#"`.
1730
+ */
1731
+ export class OutputDTMFUrgentFrame extends DTMFFrame(SystemFrame) {
1732
+ button;
1733
+ buttons;
1734
+ constructor(options = {}) {
1735
+ super(options);
1736
+ this.button = options.button ?? null;
1737
+ this.buttons = options.buttons ?? null;
1738
+ if (this.buttons === null && this.button !== null) {
1739
+ this.buttons = [this.button];
1740
+ }
1741
+ if (!this.buttons || this.buttons.length === 0) {
1742
+ throw new Error(`${this.constructor.name} requires \`buttons\` or \`button\` to be set`);
1743
+ }
1744
+ }
1745
+ toString() {
1746
+ return `${this.name}(buttons: ${this.toDialString()})`;
1747
+ }
1748
+ /**
1749
+ * Build an `OutputDTMFUrgentFrame` from a string of DTMF characters.
1750
+ *
1751
+ * @param buttons A string like `"123#"`. Each character must be a valid
1752
+ * `KeypadEntry` value.
1753
+ * @param options Additional options forwarded to the frame constructor.
1754
+ * @returns A frame of this class with `buttons` populated as a list of `KeypadEntry`.
1755
+ */
1756
+ static fromString(buttons, options = {}) {
1757
+ return new this({ ...options, buttons: [...buttons].map(toKeypadEntry) });
1758
+ }
1759
+ /**
1760
+ * Return the frame's `buttons` as a dial string. Upstream's `to_string()`;
1761
+ * renamed because `toString()` is the JS `__str__`.
1762
+ *
1763
+ * @returns A string such as `"123#"` formed by concatenating each
1764
+ * `KeypadEntry` in `buttons`, or an empty string if `buttons` is not set.
1765
+ */
1766
+ toDialString() {
1767
+ return this.buttons ? this.buttons.join("") : "";
1768
+ }
1769
+ }
1770
+ /**
1771
+ * Frame for notifying processors of speech control parameter changes.
1772
+ *
1773
+ * This includes parameters for both VAD (Voice Activity Detection) and
1774
+ * turn-taking analysis. It allows downstream processors to adjust their
1775
+ * behavior based on updated interaction control settings.
1776
+ *
1777
+ * - `vadParams`: current VAD parameters.
1778
+ * - `turnParams`: current turn-taking analysis parameters.
1779
+ */
1780
+ export class SpeechControlParamsFrame extends SystemFrame {
1781
+ vadParams;
1782
+ turnParams;
1783
+ constructor(options = {}) {
1784
+ super(options);
1785
+ this.vadParams = options.vadParams ?? null;
1786
+ this.turnParams = options.turnParams ?? null;
1787
+ }
1788
+ }
1789
+ /**
1790
+ * Base metadata frame for services.
1791
+ *
1792
+ * Broadcast by services at pipeline start to share service-specific
1793
+ * configuration and performance characteristics with downstream processors.
1794
+ *
1795
+ * - `serviceName`: the name of the service broadcasting this metadata.
1796
+ * - `userTurnStrategies`: user turn strategies the service recommends, e.g.
1797
+ * `ExternalUserTurnStrategies` for a service that does its own server-side
1798
+ * end-of-turn detection. The user aggregator applies them unless the user
1799
+ * passed their own `userTurnStrategies`, which always wins. Null leaves the
1800
+ * defaults in place.
1801
+ */
1802
+ export class ServiceMetadataFrame extends SystemFrame {
1803
+ serviceName;
1804
+ userTurnStrategies;
1805
+ constructor(options) {
1806
+ super(options);
1807
+ this.serviceName = options.serviceName;
1808
+ this.userTurnStrategies = options.userTurnStrategies ?? null;
1809
+ }
1810
+ }
1811
+ /**
1812
+ * Metadata from STT service.
1813
+ *
1814
+ * Broadcast by STT services to inform downstream processors (like turn
1815
+ * strategies) about STT latency characteristics.
1816
+ *
1817
+ * - `ttfsP99Latency`: time to final segment P99 latency in seconds. This is
1818
+ * the expected time from when speech ends to when the final transcript is
1819
+ * received, at the 99th percentile.
1820
+ */
1821
+ export class STTMetadataFrame extends ServiceMetadataFrame {
1822
+ ttfsP99Latency;
1823
+ constructor(options) {
1824
+ super(options);
1825
+ this.ttfsP99Latency = options.ttfsP99Latency;
1826
+ }
1827
+ }
1828
+ /**
1829
+ * Metadata broadcast by an LLM service at pipeline start.
1830
+ *
1831
+ * - `isRealtimeService`: whether the broadcasting service is a realtime
1832
+ * (speech-to-speech) LLM service.
1833
+ */
1834
+ export class LLMServiceMetadataFrame extends ServiceMetadataFrame {
1835
+ isRealtimeService;
1836
+ constructor(options) {
1837
+ super(options);
1838
+ this.isRealtimeService = options.isRealtimeService ?? false;
1839
+ }
1840
+ }
1841
+ /**
1842
+ * Request a service to re-emit its metadata frames.
1843
+ *
1844
+ * Used by ServiceSwitcher when switching active services to ensure downstream
1845
+ * processors receive updated metadata from the newly active service. Services
1846
+ * that receive this frame should re-push their metadata frame (e.g.,
1847
+ * STTMetadataFrame for STT services).
1848
+ *
1849
+ * - `service`: the target service that should re-emit its metadata.
1850
+ */
1851
+ export class ServiceSwitcherRequestMetadataFrame extends ControlFrame {
1852
+ service;
1853
+ constructor(options) {
1854
+ super(options);
1855
+ this.service = options.service;
1856
+ }
1857
+ }
1858
+ //
1859
+ // Worker frames
1860
+ //
1861
+ /**
1862
+ * Base frame for worker frames.
1863
+ *
1864
+ * This is a base class for frames that are handled by the pipeline worker.
1865
+ * This might result in a corresponding frame sent downstream (e.g.
1866
+ * `InterruptionWorkerFrame` / `InterruptionFrame` or `EndWorkerFrame` /
1867
+ * `EndFrame`). Push these frames downstream (the default direction) so frames
1868
+ * queued ahead of them are processed first; pushing them upstream is also
1869
+ * supported.
1870
+ */
1871
+ export class WorkerFrame extends ControlFrame {
1872
+ }
1873
+ /**
1874
+ * Base frame for worker system frames.
1875
+ *
1876
+ * This is a base class for system frames that are handled by the pipeline
1877
+ * worker. This might result in a corresponding frame sent downstream (e.g.
1878
+ * `InterruptionWorkerFrame` / `InterruptionFrame` or `CancelWorkerFrame` /
1879
+ * `CancelFrame`). They can be pushed in either direction (downstream is the
1880
+ * default); being system frames, they are processed immediately either way.
1881
+ */
1882
+ export class WorkerSystemFrame extends SystemFrame {
1883
+ }
1884
+ /**
1885
+ * Frame to request graceful pipeline worker closure.
1886
+ *
1887
+ * This is used to notify the pipeline worker that the pipeline should be
1888
+ * closed nicely (flushing all the queued frames) by pushing an EndFrame
1889
+ * downstream. Push this frame downstream (the default direction) so frames
1890
+ * queued ahead of it are flushed before the pipeline ends.
1891
+ *
1892
+ * - `reason`: optional reason for pushing an end frame.
1893
+ */
1894
+ export class EndWorkerFrame extends WorkerFrame {
1895
+ interruptible = false;
1896
+ reason;
1897
+ constructor(options = {}) {
1898
+ super(options);
1899
+ this.reason = options.reason ?? null;
1900
+ }
1901
+ toString() {
1902
+ return `${this.name}(reason: ${this.reason})`;
1903
+ }
1904
+ }
1905
+ /**
1906
+ * Frame to request pipeline worker stop while keeping processors running.
1907
+ *
1908
+ * This is used to notify the pipeline worker that it should be stopped as
1909
+ * soon as possible (flushing all the queued frames) but that the pipeline
1910
+ * processors should be kept in a running state. Push this frame downstream
1911
+ * (the default direction) so frames queued ahead of it are flushed first.
1912
+ */
1913
+ export class StopWorkerFrame extends WorkerFrame {
1914
+ interruptible = false;
1915
+ }
1916
+ /**
1917
+ * Frame to request immediate pipeline worker cancellation.
1918
+ *
1919
+ * This is used to notify the pipeline worker that the pipeline should be
1920
+ * stopped immediately by pushing a CancelFrame downstream. It can be pushed in
1921
+ * either direction; being a system frame, it is processed immediately.
1922
+ *
1923
+ * - `reason`: optional reason for pushing a cancel frame.
1924
+ */
1925
+ export class CancelWorkerFrame extends WorkerSystemFrame {
1926
+ reason;
1927
+ constructor(options = {}) {
1928
+ super(options);
1929
+ this.reason = options.reason ?? null;
1930
+ }
1931
+ toString() {
1932
+ return `${this.name}(reason: ${this.reason})`;
1933
+ }
1934
+ }
1935
+ /**
1936
+ * Frame indicating the pipeline should be interrupted.
1937
+ *
1938
+ * The pipeline worker converts this into an `InterruptionFrame` and sends it
1939
+ * downstream. It can be pushed in either direction; being a system frame, it
1940
+ * is processed immediately.
1941
+ */
1942
+ export class InterruptionWorkerFrame extends WorkerSystemFrame {
1943
+ }
1944
+ /**
1945
+ * Frame indicating pipeline has ended and should shut down.
1946
+ *
1947
+ * Indicates that a pipeline has ended and frame processors and pipelines
1948
+ * should be shut down. If the transport receives this frame, it will stop
1949
+ * sending frames to its output channel(s) and close all its threads. Note,
1950
+ * that this is a control frame, which means it will be received in the order
1951
+ * it was sent.
1952
+ *
1953
+ * This frame is uninterruptible so it is not lost when an InterruptionFrame
1954
+ * is processed. Terminal frames must survive interruption to guarantee proper
1955
+ * pipeline shutdown.
1956
+ *
1957
+ * - `reason`: optional reason for pushing an end frame.
1958
+ */
1959
+ export class EndFrame extends ControlFrame {
1960
+ interruptible = false;
1961
+ reason;
1962
+ constructor(options = {}) {
1963
+ super(options);
1964
+ this.reason = options.reason ?? null;
1965
+ }
1966
+ toString() {
1967
+ return `${this.name}(reason: ${this.reason})`;
1968
+ }
1969
+ }
1970
+ /**
1971
+ * Frame indicating pipeline should stop but keep processors running.
1972
+ *
1973
+ * Indicates that a pipeline should be stopped but that the pipeline processors
1974
+ * should be kept in a running state. This is normally queued from the
1975
+ * pipeline task.
1976
+ *
1977
+ * This frame is uninterruptible so it is not lost when an InterruptionFrame
1978
+ * is processed. Terminal frames must survive interruption to guarantee proper
1979
+ * pipeline control.
1980
+ */
1981
+ export class StopFrame extends ControlFrame {
1982
+ interruptible = false;
1983
+ }
1984
+ /**
1985
+ * Probe frame used to flush all in-flight frames from the pipeline.
1986
+ *
1987
+ * Pushed downstream; the pipeline worker's sink bounces it back upstream, the
1988
+ * source turns it around, and the worker sets `event` when it reaches the sink
1989
+ * a second time. Once that fires, every frame queued ahead of the probe has
1990
+ * been processed, along with anything a processor started by pushing
1991
+ * upstream. Useful to wait for the pipeline to drain (e.g. after an
1992
+ * interruption) before injecting a new frame.
1993
+ *
1994
+ * This frame is uninterruptible so the probe survives an InterruptionFrame and
1995
+ * still completes its trip.
1996
+ *
1997
+ * - `event`: set by the worker when the probe completes its round-trip. The
1998
+ * initiator awaits it to know the pipeline has drained. Carried on the frame
1999
+ * so concurrent flushes stay isolated (each awaits its own).
2000
+ * - `returning`: whether the probe is on its second pass downstream, after
2001
+ * having been back up to the source. Work a processor starts by pushing
2002
+ * upstream — an LLM run triggered by a function call result, say — only
2003
+ * reaches the sink after that turnaround, so the probe makes the trip twice
2004
+ * and settles on the second arrival.
2005
+ * - `origin`: name of the worker that started the flush. A probe that crosses
2006
+ * into another pipeline is answered there, out of sight of whoever is
2007
+ * waiting, so the answering worker reports progress back to this name.
2008
+ */
2009
+ export class PipelineFlushFrame extends ControlFrame {
2010
+ interruptible = false;
2011
+ event;
2012
+ returning;
2013
+ origin;
2014
+ constructor(options = {}) {
2015
+ super(options);
2016
+ this.event = options.event ?? null;
2017
+ this.returning = options.returning ?? false;
2018
+ this.origin = options.origin ?? null;
2019
+ }
2020
+ }
2021
+ /**
2022
+ * Frame indicating the bot has connected to the transport service.
2023
+ *
2024
+ * Pushed downstream by SFU transports (Daily, LiveKit, HeyGen, Tavus) when the
2025
+ * bot successfully joins the room. Non-SFU transports do not emit this frame.
2026
+ */
2027
+ export class BotConnectedFrame extends SystemFrame {
2028
+ }
2029
+ /**
2030
+ * Frame indicating that a client has connected to the transport.
2031
+ *
2032
+ * Pushed downstream by the input transport when a client (participant)
2033
+ * connects. Used by observers to measure transport readiness timing.
2034
+ */
2035
+ export class ClientConnectedFrame extends SystemFrame {
2036
+ }
2037
+ /**
2038
+ * Frame indicating that the output transport is ready.
2039
+ *
2040
+ * Indicates that the output transport is ready and able to receive frames.
2041
+ */
2042
+ export class OutputTransportReadyFrame extends ControlFrame {
2043
+ }
2044
+ /**
2045
+ * Frame asking the input transport to start audio input streaming.
2046
+ *
2047
+ * Pushed downstream (e.g. by `RTVIProcessor` once the client is ready) so a
2048
+ * `BaseInputTransport` begins streaming audio from its source. Replaces
2049
+ * calling `BaseInputTransport.startAudioInStreaming()` directly, keeping
2050
+ * cross-processor communication frame-based.
2051
+ */
2052
+ export class InputTransportStartAudioStreamingFrame extends ControlFrame {
2053
+ }
2054
+ /**
2055
+ * Frame used by pipeline task to monitor pipeline health.
2056
+ *
2057
+ * This frame is used by the pipeline task as a mechanism to know if the
2058
+ * pipeline is running properly.
2059
+ *
2060
+ * - `timestamp`: timestamp when the heartbeat was generated.
2061
+ */
2062
+ export class HeartbeatFrame extends ControlFrame {
2063
+ timestamp;
2064
+ constructor(options) {
2065
+ super(options);
2066
+ this.timestamp = options.timestamp;
2067
+ }
2068
+ }
2069
+ /**
2070
+ * Frame to pause frame processing for a specific processor.
2071
+ *
2072
+ * This frame is used to pause frame processing for the given processor.
2073
+ * Pausing frame processing will keep frames in the internal queue which will
2074
+ * then be processed when frame processing is resumed with
2075
+ * `FrameProcessorResumeFrame`.
2076
+ *
2077
+ * - `processor`: the frame processor to pause.
2078
+ */
2079
+ export class FrameProcessorPauseFrame extends ControlFrame {
2080
+ processor;
2081
+ constructor(options) {
2082
+ super(options);
2083
+ this.processor = options.processor;
2084
+ }
2085
+ }
2086
+ /**
2087
+ * Frame to resume frame processing for a specific processor.
2088
+ *
2089
+ * This frame is used to resume frame processing for the given processor if it
2090
+ * was previously paused. After resuming frame processing all queued frames
2091
+ * will be processed in the order received.
2092
+ *
2093
+ * This is a SystemFrame to ensure it bypasses the blocked processing queue
2094
+ * when the processor is paused. Otherwise, the resume frame would get queued
2095
+ * and never processed.
2096
+ *
2097
+ * Note: this frame is now equivalent to FrameProcessorResumeUrgentFrame.
2098
+ *
2099
+ * - `processor`: the frame processor to resume.
2100
+ */
2101
+ export class FrameProcessorResumeFrame extends SystemFrame {
2102
+ processor;
2103
+ constructor(options) {
2104
+ super(options);
2105
+ this.processor = options.processor;
2106
+ }
2107
+ }
2108
+ /**
2109
+ * Frame indicating the beginning of an LLM response.
2110
+ *
2111
+ * Used to indicate the beginning of an LLM response. Followed by one or more
2112
+ * TextFrames and a final LLMFullResponseEndFrame.
2113
+ *
2114
+ * - `skipTts`: whether the response should be skipped by the TTS service.
2115
+ */
2116
+ export class LLMFullResponseStartFrame extends ControlFrame {
2117
+ skipTts = null;
2118
+ }
2119
+ /**
2120
+ * Frame indicating the end of an LLM response.
2121
+ *
2122
+ * - `skipTts`: whether the response should be skipped by the TTS service.
2123
+ */
2124
+ export class LLMFullResponseEndFrame extends ControlFrame {
2125
+ skipTts = null;
2126
+ }
2127
+ /**
2128
+ * Frame that forces the LLM assistant aggregator to push its current aggregation to context.
2129
+ *
2130
+ * When received by `LLMAssistantAggregator`, any text that has been
2131
+ * accumulated in the aggregation buffer is immediately committed to the
2132
+ * conversation context as an assistant message, without waiting for an
2133
+ * `LLMFullResponseEndFrame`.
2134
+ */
2135
+ export class LLMAssistantPushAggregationFrame extends ControlFrame {
2136
+ }
2137
+ /**
2138
+ * Frame requesting on-demand context summarization.
2139
+ *
2140
+ * Push this frame into the pipeline to trigger a manual context summarization.
2141
+ *
2142
+ * - `config`: optional per-request override for summary generation settings
2143
+ * (prompt, token budget, messages to keep). If null, the summarizer's
2144
+ * default `LLMContextSummaryConfig` is used.
2145
+ */
2146
+ export class LLMSummarizeContextFrame extends ControlFrame {
2147
+ config;
2148
+ constructor(options = {}) {
2149
+ super(options);
2150
+ this.config = options.config ?? null;
2151
+ }
2152
+ }
2153
+ /**
2154
+ * Frame requesting context summarization from an LLM service.
2155
+ *
2156
+ * Sent by aggregators to LLM services when conversation context needs to be
2157
+ * compressed. The LLM service generates a summary of older messages while
2158
+ * preserving recent conversation history.
2159
+ *
2160
+ * - `requestId`: unique identifier to match this request with its response.
2161
+ * Used to handle async responses and avoid race conditions.
2162
+ * - `context`: the full LLM context containing all messages to analyze and
2163
+ * summarize.
2164
+ * - `minMessagesToKeep`: number of recent messages to preserve uncompressed.
2165
+ * These messages will not be included in the summary.
2166
+ * - `targetContextTokens`: maximum token size for the generated summary. This
2167
+ * value is passed directly to the LLM as the max_tokens parameter when
2168
+ * generating the summary text.
2169
+ * - `summarizationPrompt`: system prompt instructing the LLM how to generate
2170
+ * the summary.
2171
+ * - `summarizationTimeout`: maximum time in seconds for the LLM to generate a
2172
+ * summary. When null, a default timeout of 120s is applied.
2173
+ */
2174
+ export class LLMContextSummaryRequestFrame extends ControlFrame {
2175
+ requestId;
2176
+ context;
2177
+ minMessagesToKeep;
2178
+ targetContextTokens;
2179
+ summarizationPrompt;
2180
+ summarizationTimeout;
2181
+ constructor(options) {
2182
+ super(options);
2183
+ this.requestId = options.requestId;
2184
+ this.context = options.context;
2185
+ this.minMessagesToKeep = options.minMessagesToKeep;
2186
+ this.targetContextTokens = options.targetContextTokens;
2187
+ this.summarizationPrompt = options.summarizationPrompt;
2188
+ this.summarizationTimeout = options.summarizationTimeout ?? null;
2189
+ }
2190
+ }
2191
+ /**
2192
+ * Frame containing the result of context summarization.
2193
+ *
2194
+ * Sent by LLM services back to aggregators after generating a summary.
2195
+ * Contains the formatted summary message and metadata about what was
2196
+ * summarized.
2197
+ *
2198
+ * - `requestId`: identifier matching the original request. Used to correlate
2199
+ * async responses.
2200
+ * - `summary`: the formatted summary message ready to be inserted into context.
2201
+ * - `lastSummarizedIndex`: index (0-based) of the last message that was
2202
+ * included in the summary. Messages after this index are preserved.
2203
+ * - `error`: error message if summarization failed, null on success.
2204
+ */
2205
+ export class LLMContextSummaryResultFrame extends ControlFrame {
2206
+ interruptible = false;
2207
+ requestId;
2208
+ summary;
2209
+ lastSummarizedIndex;
2210
+ error;
2211
+ constructor(options) {
2212
+ super(options);
2213
+ this.requestId = options.requestId;
2214
+ this.summary = options.summary;
2215
+ this.lastSummarizedIndex = options.lastSummarizedIndex;
2216
+ this.error = options.error ?? null;
2217
+ }
2218
+ }
2219
+ /**
2220
+ * Frame signaling that a function call is currently executing.
2221
+ *
2222
+ * This is an uninterruptible frame because we always want to update the
2223
+ * context.
2224
+ *
2225
+ * - `functionName`: name of the function being executed.
2226
+ * - `toolCallId`: unique identifier for this function call.
2227
+ * - `arguments`: arguments passed to the function.
2228
+ * - `cancelOnInterruption`: whether to cancel this call if interrupted. When
2229
+ * false the call is treated as asynchronous: the conversation is not held
2230
+ * while it runs, and a result that arrives after the conversation has moved
2231
+ * on is injected via a developer message. A result that arrives before then
2232
+ * settles in place like a synchronous call's.
2233
+ * - `groupId`: identifier shared by all function calls originating from the
2234
+ * same LLM response batch. Used to determine when the last call in a group
2235
+ * completes so the LLM can be triggered exactly once.
2236
+ */
2237
+ export class FunctionCallInProgressFrame extends ControlFrame {
2238
+ interruptible = false;
2239
+ functionName;
2240
+ toolCallId;
2241
+ arguments;
2242
+ cancelOnInterruption;
2243
+ groupId;
2244
+ constructor(options) {
2245
+ super(options);
2246
+ this.functionName = options.functionName;
2247
+ this.toolCallId = options.toolCallId;
2248
+ this.arguments = options.arguments;
2249
+ this.cancelOnInterruption = options.cancelOnInterruption ?? false;
2250
+ this.groupId = options.groupId ?? null;
2251
+ }
2252
+ }
2253
+ /**
2254
+ * Frame indicating the beginning of a vision model response.
2255
+ *
2256
+ * Used to indicate the beginning of a vision model response. Followed by one
2257
+ * or more VisionTextFrames and a final VisionFullResponseEndFrame.
2258
+ */
2259
+ export class VisionFullResponseStartFrame extends LLMFullResponseStartFrame {
2260
+ }
2261
+ /** Frame indicating the end of a Vision model response. */
2262
+ export class VisionFullResponseEndFrame extends LLMFullResponseEndFrame {
2263
+ }
2264
+ /**
2265
+ * Frame indicating the beginning of a TTS response.
2266
+ *
2267
+ * Used to indicate the beginning of a TTS response. Following
2268
+ * TTSAudioRawFrames are part of the TTS response until a TTSStoppedFrame.
2269
+ * These frames can be used for aggregating audio frames in a transport to
2270
+ * optimize the size of frames sent to the session, without needing to control
2271
+ * this in the TTS service.
2272
+ *
2273
+ * - `contextId`: unique identifier for this TTS context.
2274
+ * - `appendToContext`: whether the spoken text for this response will be
2275
+ * appended to the LLM context. Mirrors the value carried by the response's
2276
+ * TTSTextFrames.
2277
+ */
2278
+ export class TTSStartedFrame extends ControlFrame {
2279
+ contextId;
2280
+ appendToContext;
2281
+ constructor(options = {}) {
2282
+ super(options);
2283
+ this.contextId = options.contextId ?? null;
2284
+ this.appendToContext = options.appendToContext ?? true;
2285
+ }
2286
+ }
2287
+ /**
2288
+ * Frame indicating the end of a TTS response.
2289
+ *
2290
+ * - `contextId`: unique identifier for this TTS context.
2291
+ */
2292
+ export class TTSStoppedFrame extends ControlFrame {
2293
+ contextId;
2294
+ constructor(options = {}) {
2295
+ super(options);
2296
+ this.contextId = options.contextId ?? null;
2297
+ }
2298
+ }
2299
+ /**
2300
+ * Base frame for updating service settings.
2301
+ *
2302
+ * `TSettings` is covariant upstream so a bare `ServiceUpdateSettingsFrame`
2303
+ * annotation still accepts the subclasses. Gotcha: `delta` is mutable, so
2304
+ * writing through the base type is unsound and goes unreported — treat a
2305
+ * base-typed frame as read-only.
2306
+ *
2307
+ * - `delta`: `ServiceSettings` delta-mode object describing the fields to change.
2308
+ * - `service`: optional target service instance. When provided, only that
2309
+ * service will apply the settings; other services will forward the frame
2310
+ * unchanged.
2311
+ * - `reachInactiveServices`: whether these settings should reach every service
2312
+ * a `ServiceSwitcher` manages, rather than only the active one. Set this for
2313
+ * provider-neutral settings that must survive a service switch.
2314
+ */
2315
+ export class ServiceUpdateSettingsFrame extends ControlFrame {
2316
+ interruptible = false;
2317
+ delta;
2318
+ service;
2319
+ reachInactiveServices;
2320
+ constructor(options = {}) {
2321
+ super(options);
2322
+ this.delta = options.delta ?? null;
2323
+ this.service = options.service ?? null;
2324
+ this.reachInactiveServices = options.reachInactiveServices ?? false;
2325
+ }
2326
+ }
2327
+ /** Frame for updating LLM service settings. */
2328
+ export class LLMUpdateSettingsFrame extends ServiceUpdateSettingsFrame {
2329
+ }
2330
+ /** Frame for updating TTS service settings. */
2331
+ export class TTSUpdateSettingsFrame extends ServiceUpdateSettingsFrame {
2332
+ }
2333
+ /** Frame for updating STT service settings. */
2334
+ export class STTUpdateSettingsFrame extends ServiceUpdateSettingsFrame {
2335
+ }
2336
+ /**
2337
+ * Frame for updating the user idle timeout at runtime.
2338
+ *
2339
+ * Setting timeout to 0 disables idle detection. Setting a positive value
2340
+ * enables it. Updates apply immediately: a running idle timer restarts with
2341
+ * the new duration, and if the bot is waiting for the user to speak the timer
2342
+ * is armed right away.
2343
+ *
2344
+ * - `timeout`: the new idle timeout in seconds. 0 disables idle detection.
2345
+ */
2346
+ export class UserIdleTimeoutUpdateFrame extends SystemFrame {
2347
+ timeout;
2348
+ constructor(options) {
2349
+ super(options);
2350
+ this.timeout = options.timeout;
2351
+ }
2352
+ }
2353
+ /**
2354
+ * Frame for updating VAD parameters.
2355
+ *
2356
+ * A control frame containing a request to update VAD params. Intended to be
2357
+ * pushed upstream from RTVI processor.
2358
+ *
2359
+ * - `params`: new VAD parameters to apply.
2360
+ */
2361
+ export class VADParamsUpdateFrame extends ControlFrame {
2362
+ params;
2363
+ constructor(options) {
2364
+ super(options);
2365
+ this.params = options.params;
2366
+ }
2367
+ }
2368
+ /** Base control frame for audio filter operations. */
2369
+ export class FilterControlFrame extends ControlFrame {
2370
+ }
2371
+ /**
2372
+ * Frame for updating audio filter settings.
2373
+ *
2374
+ * - `settings`: dictionary of filter setting name to value mappings.
2375
+ */
2376
+ export class FilterUpdateSettingsFrame extends FilterControlFrame {
2377
+ settings;
2378
+ constructor(options) {
2379
+ super(options);
2380
+ this.settings = options.settings;
2381
+ }
2382
+ }
2383
+ /**
2384
+ * Frame for enabling/disabling audio filters at runtime.
2385
+ *
2386
+ * - `enable`: whether to enable (true) or disable (false) the filter.
2387
+ */
2388
+ export class FilterEnableFrame extends FilterControlFrame {
2389
+ enable;
2390
+ constructor(options) {
2391
+ super(options);
2392
+ this.enable = options.enable;
2393
+ }
2394
+ }
2395
+ /** Frame instructing audio buffer processors to start recording. */
2396
+ export class AudioBufferStartRecordingFrame extends ControlFrame {
2397
+ interruptible = false;
2398
+ }
2399
+ /** Frame instructing audio buffer processors to stop recording and flush. */
2400
+ export class AudioBufferStopRecordingFrame extends ControlFrame {
2401
+ interruptible = false;
2402
+ }
2403
+ /** Base control frame for audio mixer operations. */
2404
+ export class MixerControlFrame extends ControlFrame {
2405
+ }
2406
+ /**
2407
+ * Frame for updating audio mixer settings.
2408
+ *
2409
+ * - `settings`: dictionary of mixer setting name to value mappings.
2410
+ */
2411
+ export class MixerUpdateSettingsFrame extends MixerControlFrame {
2412
+ settings;
2413
+ constructor(options) {
2414
+ super(options);
2415
+ this.settings = options.settings;
2416
+ }
2417
+ }
2418
+ /**
2419
+ * Frame for enabling/disabling audio mixer at runtime.
2420
+ *
2421
+ * - `enable`: whether to enable (true) or disable (false) the mixer.
2422
+ */
2423
+ export class MixerEnableFrame extends MixerControlFrame {
2424
+ enable;
2425
+ constructor(options) {
2426
+ super(options);
2427
+ this.enable = options.enable;
2428
+ }
2429
+ }
2430
+ /**
2431
+ * Frame that sets the volume of the output transport's audio.
2432
+ *
2433
+ * The volume holds until the next `VolumeFrame`, and starts at the
2434
+ * transport's `audioOutVolume`. Audio plays at the volume times the gain set
2435
+ * by `VolumeGainFrame`. The frame takes effect in order with the audio before
2436
+ * it, and an interruption doesn't drop it.
2437
+ *
2438
+ * - `volume`: the volume, as a multiplier on the audio's samples: 1.0 leaves
2439
+ * it unchanged, 0.5 halves it.
2440
+ */
2441
+ export class VolumeFrame extends ControlFrame {
2442
+ volume;
2443
+ interruptible = false;
2444
+ constructor(options) {
2445
+ super(options);
2446
+ this.volume = options.volume;
2447
+ }
2448
+ }
2449
+ /**
2450
+ * Frame that sets a gain on the output transport's volume.
2451
+ *
2452
+ * A gain adjusts the volume for some audio and is reset afterwards, for
2453
+ * example `new VolumeGainFrame({ gain: 0.5 })` before a `TTSSpeakFrame` and
2454
+ * `new VolumeGainFrame({ gain: 1.0 })` after it, which plays that utterance at
2455
+ * half the volume without changing the volume set by `VolumeFrame`. The frame
2456
+ * takes effect in order with the audio before it, and an interruption doesn't
2457
+ * drop it.
2458
+ *
2459
+ * - `gain`: the gain, as a multiplier on the volume: 1.0 leaves it unchanged,
2460
+ * 0.5 halves it.
2461
+ */
2462
+ export class VolumeGainFrame extends ControlFrame {
2463
+ gain;
2464
+ interruptible = false;
2465
+ constructor(options) {
2466
+ super(options);
2467
+ this.gain = options.gain;
2468
+ }
2469
+ }
2470
+ /** A base class for frames that affect ServiceSwitcher behavior. */
2471
+ export class ServiceSwitcherFrame extends ControlFrame {
2472
+ }
2473
+ /**
2474
+ * A frame to request a manual switch in the active service in a ServiceSwitcher.
2475
+ *
2476
+ * Handled by ServiceSwitcherStrategyManual to switch the active service.
2477
+ */
2478
+ export class ManuallySwitchServiceFrame extends ServiceSwitcherFrame {
2479
+ service;
2480
+ constructor(options) {
2481
+ super(options);
2482
+ this.service = options.service;
2483
+ }
2484
+ }
2485
+ //# sourceMappingURL=frames.js.map