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