@livekit/agents 1.1.0 → 1.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.
- package/dist/audio.cjs +89 -3
- package/dist/audio.cjs.map +1 -1
- package/dist/audio.d.cts +36 -1
- package/dist/audio.d.ts +36 -1
- package/dist/audio.d.ts.map +1 -1
- package/dist/audio.js +76 -2
- package/dist/audio.js.map +1 -1
- package/dist/beta/index.cjs +29 -0
- package/dist/beta/index.cjs.map +1 -0
- package/dist/beta/index.d.cts +2 -0
- package/dist/beta/index.d.ts +2 -0
- package/dist/beta/index.d.ts.map +1 -0
- package/dist/beta/index.js +7 -0
- package/dist/beta/index.js.map +1 -0
- package/dist/beta/workflows/index.cjs +29 -0
- package/dist/beta/workflows/index.cjs.map +1 -0
- package/dist/beta/workflows/index.d.cts +2 -0
- package/dist/beta/workflows/index.d.ts +2 -0
- package/dist/beta/workflows/index.d.ts.map +1 -0
- package/dist/beta/workflows/index.js +7 -0
- package/dist/beta/workflows/index.js.map +1 -0
- package/dist/beta/workflows/task_group.cjs +162 -0
- package/dist/beta/workflows/task_group.cjs.map +1 -0
- package/dist/beta/workflows/task_group.d.cts +32 -0
- package/dist/beta/workflows/task_group.d.ts +32 -0
- package/dist/beta/workflows/task_group.d.ts.map +1 -0
- package/dist/beta/workflows/task_group.js +138 -0
- package/dist/beta/workflows/task_group.js.map +1 -0
- package/dist/cli.cjs +44 -46
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.d.cts +3 -3
- package/dist/cli.d.ts +3 -3
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +45 -47
- package/dist/cli.js.map +1 -1
- package/dist/connection_pool.cjs +242 -0
- package/dist/connection_pool.cjs.map +1 -0
- package/dist/connection_pool.d.cts +123 -0
- package/dist/connection_pool.d.ts +123 -0
- package/dist/connection_pool.d.ts.map +1 -0
- package/dist/connection_pool.js +218 -0
- package/dist/connection_pool.js.map +1 -0
- package/dist/connection_pool.test.cjs +256 -0
- package/dist/connection_pool.test.cjs.map +1 -0
- package/dist/connection_pool.test.js +255 -0
- package/dist/connection_pool.test.js.map +1 -0
- package/dist/constants.cjs +30 -0
- package/dist/constants.cjs.map +1 -1
- package/dist/constants.d.cts +10 -0
- package/dist/constants.d.ts +10 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +20 -0
- package/dist/constants.js.map +1 -1
- package/dist/cpu.cjs +189 -0
- package/dist/cpu.cjs.map +1 -0
- package/dist/cpu.d.cts +24 -0
- package/dist/cpu.d.ts +24 -0
- package/dist/cpu.d.ts.map +1 -0
- package/dist/cpu.js +152 -0
- package/dist/cpu.js.map +1 -0
- package/dist/cpu.test.cjs +227 -0
- package/dist/cpu.test.cjs.map +1 -0
- package/dist/cpu.test.js +204 -0
- package/dist/cpu.test.js.map +1 -0
- package/dist/http_server.cjs +9 -6
- package/dist/http_server.cjs.map +1 -1
- package/dist/http_server.d.cts +5 -1
- package/dist/http_server.d.ts +5 -1
- package/dist/http_server.d.ts.map +1 -1
- package/dist/http_server.js +9 -6
- package/dist/http_server.js.map +1 -1
- package/dist/index.cjs +24 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +15 -11
- package/dist/index.d.ts +15 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -9
- package/dist/index.js.map +1 -1
- package/dist/inference/api_protos.cjs +70 -2
- package/dist/inference/api_protos.cjs.map +1 -1
- package/dist/inference/api_protos.d.cts +373 -32
- package/dist/inference/api_protos.d.ts +373 -32
- package/dist/inference/api_protos.d.ts.map +1 -1
- package/dist/inference/api_protos.js +62 -2
- package/dist/inference/api_protos.js.map +1 -1
- package/dist/inference/index.cjs +8 -0
- package/dist/inference/index.cjs.map +1 -1
- package/dist/inference/index.d.cts +3 -4
- package/dist/inference/index.d.ts +3 -4
- package/dist/inference/index.d.ts.map +1 -1
- package/dist/inference/index.js +18 -3
- package/dist/inference/index.js.map +1 -1
- package/dist/inference/interruption/defaults.cjs +81 -0
- package/dist/inference/interruption/defaults.cjs.map +1 -0
- package/dist/inference/interruption/defaults.d.cts +19 -0
- package/dist/inference/interruption/defaults.d.ts +19 -0
- package/dist/inference/interruption/defaults.d.ts.map +1 -0
- package/dist/inference/interruption/defaults.js +46 -0
- package/dist/inference/interruption/defaults.js.map +1 -0
- package/dist/inference/interruption/errors.cjs +44 -0
- package/dist/inference/interruption/errors.cjs.map +1 -0
- package/dist/inference/interruption/errors.d.cts +12 -0
- package/dist/inference/interruption/errors.d.ts +12 -0
- package/dist/inference/interruption/errors.d.ts.map +1 -0
- package/dist/inference/interruption/errors.js +20 -0
- package/dist/inference/interruption/errors.js.map +1 -0
- package/dist/inference/interruption/http_transport.cjs +163 -0
- package/dist/inference/interruption/http_transport.cjs.map +1 -0
- package/dist/inference/interruption/http_transport.d.cts +63 -0
- package/dist/inference/interruption/http_transport.d.ts +63 -0
- package/dist/inference/interruption/http_transport.d.ts.map +1 -0
- package/dist/inference/interruption/http_transport.js +137 -0
- package/dist/inference/interruption/http_transport.js.map +1 -0
- package/dist/inference/interruption/interruption_cache_entry.cjs +58 -0
- package/dist/inference/interruption/interruption_cache_entry.cjs.map +1 -0
- package/dist/inference/interruption/interruption_cache_entry.d.cts +30 -0
- package/dist/inference/interruption/interruption_cache_entry.d.ts +30 -0
- package/dist/inference/interruption/interruption_cache_entry.d.ts.map +1 -0
- package/dist/inference/interruption/interruption_cache_entry.js +34 -0
- package/dist/inference/interruption/interruption_cache_entry.js.map +1 -0
- package/dist/inference/interruption/interruption_detector.cjs +198 -0
- package/dist/inference/interruption/interruption_detector.cjs.map +1 -0
- package/dist/inference/interruption/interruption_detector.d.cts +59 -0
- package/dist/inference/interruption/interruption_detector.d.ts +59 -0
- package/dist/inference/interruption/interruption_detector.d.ts.map +1 -0
- package/dist/inference/interruption/interruption_detector.js +164 -0
- package/dist/inference/interruption/interruption_detector.js.map +1 -0
- package/dist/inference/interruption/interruption_stream.cjs +368 -0
- package/dist/inference/interruption/interruption_stream.cjs.map +1 -0
- package/dist/inference/interruption/interruption_stream.d.cts +46 -0
- package/dist/inference/interruption/interruption_stream.d.ts +46 -0
- package/dist/inference/interruption/interruption_stream.d.ts.map +1 -0
- package/dist/inference/interruption/interruption_stream.js +344 -0
- package/dist/inference/interruption/interruption_stream.js.map +1 -0
- package/dist/inference/interruption/types.cjs +17 -0
- package/dist/inference/interruption/types.cjs.map +1 -0
- package/dist/inference/interruption/types.d.cts +66 -0
- package/dist/inference/interruption/types.d.ts +66 -0
- package/dist/inference/interruption/types.d.ts.map +1 -0
- package/dist/inference/interruption/types.js +1 -0
- package/dist/inference/interruption/types.js.map +1 -0
- package/dist/inference/interruption/utils.cjs +130 -0
- package/dist/inference/interruption/utils.cjs.map +1 -0
- package/dist/inference/interruption/utils.d.cts +41 -0
- package/dist/inference/interruption/utils.d.ts +41 -0
- package/dist/inference/interruption/utils.d.ts.map +1 -0
- package/dist/inference/interruption/utils.js +105 -0
- package/dist/inference/interruption/utils.js.map +1 -0
- package/dist/inference/interruption/utils.test.cjs +105 -0
- package/dist/inference/interruption/utils.test.cjs.map +1 -0
- package/dist/inference/interruption/utils.test.js +104 -0
- package/dist/inference/interruption/utils.test.js.map +1 -0
- package/dist/inference/interruption/ws_transport.cjs +342 -0
- package/dist/inference/interruption/ws_transport.cjs.map +1 -0
- package/dist/inference/interruption/ws_transport.d.cts +33 -0
- package/dist/inference/interruption/ws_transport.d.ts +33 -0
- package/dist/inference/interruption/ws_transport.d.ts.map +1 -0
- package/dist/inference/interruption/ws_transport.js +308 -0
- package/dist/inference/interruption/ws_transport.js.map +1 -0
- package/dist/inference/llm.cjs +106 -66
- package/dist/inference/llm.cjs.map +1 -1
- package/dist/inference/llm.d.cts +65 -43
- package/dist/inference/llm.d.ts +65 -43
- package/dist/inference/llm.d.ts.map +1 -1
- package/dist/inference/llm.js +100 -66
- package/dist/inference/llm.js.map +1 -1
- package/dist/inference/stt.cjs +319 -170
- package/dist/inference/stt.cjs.map +1 -1
- package/dist/inference/stt.d.cts +64 -15
- package/dist/inference/stt.d.ts +64 -15
- package/dist/inference/stt.d.ts.map +1 -1
- package/dist/inference/stt.js +319 -170
- package/dist/inference/stt.js.map +1 -1
- package/dist/inference/stt.test.cjs +218 -0
- package/dist/inference/stt.test.cjs.map +1 -0
- package/dist/inference/stt.test.js +217 -0
- package/dist/inference/stt.test.js.map +1 -0
- package/dist/inference/tts.cjs +249 -71
- package/dist/inference/tts.cjs.map +1 -1
- package/dist/inference/tts.d.cts +55 -16
- package/dist/inference/tts.d.ts +55 -16
- package/dist/inference/tts.d.ts.map +1 -1
- package/dist/inference/tts.js +249 -77
- package/dist/inference/tts.js.map +1 -1
- package/dist/inference/tts.test.cjs +233 -0
- package/dist/inference/tts.test.cjs.map +1 -0
- package/dist/inference/tts.test.js +232 -0
- package/dist/inference/tts.test.js.map +1 -0
- package/dist/inference/utils.cjs +26 -7
- package/dist/inference/utils.cjs.map +1 -1
- package/dist/inference/utils.d.cts +14 -1
- package/dist/inference/utils.d.ts +14 -1
- package/dist/inference/utils.d.ts.map +1 -1
- package/dist/inference/utils.js +18 -2
- package/dist/inference/utils.js.map +1 -1
- package/dist/ipc/inference_proc_executor.cjs +6 -3
- package/dist/ipc/inference_proc_executor.cjs.map +1 -1
- package/dist/ipc/inference_proc_executor.d.ts.map +1 -1
- package/dist/ipc/inference_proc_executor.js +6 -3
- package/dist/ipc/inference_proc_executor.js.map +1 -1
- package/dist/ipc/inference_proc_lazy_main.cjs +13 -1
- package/dist/ipc/inference_proc_lazy_main.cjs.map +1 -1
- package/dist/ipc/inference_proc_lazy_main.js +13 -1
- package/dist/ipc/inference_proc_lazy_main.js.map +1 -1
- package/dist/ipc/job_proc_executor.cjs +6 -1
- package/dist/ipc/job_proc_executor.cjs.map +1 -1
- package/dist/ipc/job_proc_executor.d.ts.map +1 -1
- package/dist/ipc/job_proc_executor.js +6 -1
- package/dist/ipc/job_proc_executor.js.map +1 -1
- package/dist/ipc/job_proc_lazy_main.cjs +89 -17
- package/dist/ipc/job_proc_lazy_main.cjs.map +1 -1
- package/dist/ipc/job_proc_lazy_main.js +68 -18
- package/dist/ipc/job_proc_lazy_main.js.map +1 -1
- package/dist/ipc/supervised_proc.cjs +34 -8
- package/dist/ipc/supervised_proc.cjs.map +1 -1
- package/dist/ipc/supervised_proc.d.cts +8 -0
- package/dist/ipc/supervised_proc.d.ts +8 -0
- package/dist/ipc/supervised_proc.d.ts.map +1 -1
- package/dist/ipc/supervised_proc.js +34 -8
- package/dist/ipc/supervised_proc.js.map +1 -1
- package/dist/ipc/supervised_proc.test.cjs +145 -0
- package/dist/ipc/supervised_proc.test.cjs.map +1 -0
- package/dist/ipc/supervised_proc.test.js +122 -0
- package/dist/ipc/supervised_proc.test.js.map +1 -0
- package/dist/job.cjs +109 -1
- package/dist/job.cjs.map +1 -1
- package/dist/job.d.cts +14 -0
- package/dist/job.d.ts +14 -0
- package/dist/job.d.ts.map +1 -1
- package/dist/job.js +99 -1
- package/dist/job.js.map +1 -1
- package/dist/language.cjs +394 -0
- package/dist/language.cjs.map +1 -0
- package/dist/language.d.cts +15 -0
- package/dist/language.d.ts +15 -0
- package/dist/language.d.ts.map +1 -0
- package/dist/language.js +363 -0
- package/dist/language.js.map +1 -0
- package/dist/language.test.cjs +43 -0
- package/dist/language.test.cjs.map +1 -0
- package/dist/language.test.js +49 -0
- package/dist/language.test.js.map +1 -0
- package/dist/llm/chat_context.cjs +274 -3
- package/dist/llm/chat_context.cjs.map +1 -1
- package/dist/llm/chat_context.d.cts +86 -2
- package/dist/llm/chat_context.d.ts +86 -2
- package/dist/llm/chat_context.d.ts.map +1 -1
- package/dist/llm/chat_context.js +273 -3
- package/dist/llm/chat_context.js.map +1 -1
- package/dist/llm/chat_context.test.cjs +574 -0
- package/dist/llm/chat_context.test.cjs.map +1 -1
- package/dist/llm/chat_context.test.js +574 -0
- package/dist/llm/chat_context.test.js.map +1 -1
- package/dist/llm/fallback_adapter.cjs +278 -0
- package/dist/llm/fallback_adapter.cjs.map +1 -0
- package/dist/llm/fallback_adapter.d.cts +73 -0
- package/dist/llm/fallback_adapter.d.ts +73 -0
- package/dist/llm/fallback_adapter.d.ts.map +1 -0
- package/dist/llm/fallback_adapter.js +254 -0
- package/dist/llm/fallback_adapter.js.map +1 -0
- package/dist/llm/fallback_adapter.test.cjs +176 -0
- package/dist/llm/fallback_adapter.test.cjs.map +1 -0
- package/dist/llm/fallback_adapter.test.js +175 -0
- package/dist/llm/fallback_adapter.test.js.map +1 -0
- package/dist/llm/index.cjs +9 -0
- package/dist/llm/index.cjs.map +1 -1
- package/dist/llm/index.d.cts +4 -3
- package/dist/llm/index.d.ts +4 -3
- package/dist/llm/index.d.ts.map +1 -1
- package/dist/llm/index.js +11 -1
- package/dist/llm/index.js.map +1 -1
- package/dist/llm/llm.cjs +65 -11
- package/dist/llm/llm.cjs.map +1 -1
- package/dist/llm/llm.d.cts +13 -2
- package/dist/llm/llm.d.ts +13 -2
- package/dist/llm/llm.d.ts.map +1 -1
- package/dist/llm/llm.js +65 -11
- package/dist/llm/llm.js.map +1 -1
- package/dist/llm/provider_format/google.cjs +6 -2
- package/dist/llm/provider_format/google.cjs.map +1 -1
- package/dist/llm/provider_format/google.d.cts +1 -1
- package/dist/llm/provider_format/google.d.ts +1 -1
- package/dist/llm/provider_format/google.d.ts.map +1 -1
- package/dist/llm/provider_format/google.js +6 -2
- package/dist/llm/provider_format/google.js.map +1 -1
- package/dist/llm/provider_format/google.test.cjs +48 -0
- package/dist/llm/provider_format/google.test.cjs.map +1 -1
- package/dist/llm/provider_format/google.test.js +54 -1
- package/dist/llm/provider_format/google.test.js.map +1 -1
- package/dist/llm/provider_format/index.cjs +2 -0
- package/dist/llm/provider_format/index.cjs.map +1 -1
- package/dist/llm/provider_format/index.d.cts +2 -2
- package/dist/llm/provider_format/index.d.ts +2 -2
- package/dist/llm/provider_format/index.d.ts.map +1 -1
- package/dist/llm/provider_format/index.js +6 -1
- package/dist/llm/provider_format/index.js.map +1 -1
- package/dist/llm/provider_format/openai.cjs +126 -24
- package/dist/llm/provider_format/openai.cjs.map +1 -1
- package/dist/llm/provider_format/openai.d.cts +1 -0
- package/dist/llm/provider_format/openai.d.ts +1 -0
- package/dist/llm/provider_format/openai.d.ts.map +1 -1
- package/dist/llm/provider_format/openai.js +124 -23
- package/dist/llm/provider_format/openai.js.map +1 -1
- package/dist/llm/provider_format/openai.test.cjs +393 -0
- package/dist/llm/provider_format/openai.test.cjs.map +1 -1
- package/dist/llm/provider_format/openai.test.js +400 -2
- package/dist/llm/provider_format/openai.test.js.map +1 -1
- package/dist/llm/provider_format/utils.cjs +5 -4
- package/dist/llm/provider_format/utils.cjs.map +1 -1
- package/dist/llm/provider_format/utils.d.ts.map +1 -1
- package/dist/llm/provider_format/utils.js +5 -4
- package/dist/llm/provider_format/utils.js.map +1 -1
- package/dist/llm/realtime.cjs +3 -0
- package/dist/llm/realtime.cjs.map +1 -1
- package/dist/llm/realtime.d.cts +15 -1
- package/dist/llm/realtime.d.ts +15 -1
- package/dist/llm/realtime.d.ts.map +1 -1
- package/dist/llm/realtime.js +3 -0
- package/dist/llm/realtime.js.map +1 -1
- package/dist/llm/remote_chat_context.cjs.map +1 -1
- package/dist/llm/remote_chat_context.d.cts +2 -0
- package/dist/llm/remote_chat_context.d.ts +2 -0
- package/dist/llm/remote_chat_context.d.ts.map +1 -1
- package/dist/llm/remote_chat_context.js.map +1 -1
- package/dist/llm/tool_context.cjs +50 -2
- package/dist/llm/tool_context.cjs.map +1 -1
- package/dist/llm/tool_context.d.cts +47 -11
- package/dist/llm/tool_context.d.ts +47 -11
- package/dist/llm/tool_context.d.ts.map +1 -1
- package/dist/llm/tool_context.js +48 -3
- package/dist/llm/tool_context.js.map +1 -1
- package/dist/llm/tool_context.test.cjs +197 -0
- package/dist/llm/tool_context.test.cjs.map +1 -1
- package/dist/llm/tool_context.test.js +175 -0
- package/dist/llm/tool_context.test.js.map +1 -1
- package/dist/llm/utils.cjs +18 -12
- package/dist/llm/utils.cjs.map +1 -1
- package/dist/llm/utils.d.cts +2 -3
- package/dist/llm/utils.d.ts +2 -3
- package/dist/llm/utils.d.ts.map +1 -1
- package/dist/llm/utils.js +18 -12
- package/dist/llm/utils.js.map +1 -1
- package/dist/llm/zod-utils.cjs +102 -0
- package/dist/llm/zod-utils.cjs.map +1 -0
- package/dist/llm/zod-utils.d.cts +65 -0
- package/dist/llm/zod-utils.d.ts +65 -0
- package/dist/llm/zod-utils.d.ts.map +1 -0
- package/dist/llm/zod-utils.js +64 -0
- package/dist/llm/zod-utils.js.map +1 -0
- package/dist/llm/zod-utils.test.cjs +472 -0
- package/dist/llm/zod-utils.test.cjs.map +1 -0
- package/dist/llm/zod-utils.test.js +455 -0
- package/dist/llm/zod-utils.test.js.map +1 -0
- package/dist/log.cjs +45 -14
- package/dist/log.cjs.map +1 -1
- package/dist/log.d.cts +8 -1
- package/dist/log.d.ts +8 -1
- package/dist/log.d.ts.map +1 -1
- package/dist/log.js +45 -15
- package/dist/log.js.map +1 -1
- package/dist/metrics/base.cjs.map +1 -1
- package/dist/metrics/base.d.cts +75 -19
- package/dist/metrics/base.d.ts +75 -19
- package/dist/metrics/base.d.ts.map +1 -1
- package/dist/metrics/index.cjs +5 -0
- package/dist/metrics/index.cjs.map +1 -1
- package/dist/metrics/index.d.cts +2 -1
- package/dist/metrics/index.d.ts +2 -1
- package/dist/metrics/index.d.ts.map +1 -1
- package/dist/metrics/index.js +6 -0
- package/dist/metrics/index.js.map +1 -1
- package/dist/metrics/model_usage.cjs +189 -0
- package/dist/metrics/model_usage.cjs.map +1 -0
- package/dist/metrics/model_usage.d.cts +92 -0
- package/dist/metrics/model_usage.d.ts +92 -0
- package/dist/metrics/model_usage.d.ts.map +1 -0
- package/dist/metrics/model_usage.js +164 -0
- package/dist/metrics/model_usage.js.map +1 -0
- package/dist/metrics/model_usage.test.cjs +474 -0
- package/dist/metrics/model_usage.test.cjs.map +1 -0
- package/dist/metrics/model_usage.test.js +476 -0
- package/dist/metrics/model_usage.test.js.map +1 -0
- package/dist/metrics/usage_collector.cjs +5 -2
- package/dist/metrics/usage_collector.cjs.map +1 -1
- package/dist/metrics/usage_collector.d.cts +10 -1
- package/dist/metrics/usage_collector.d.ts +10 -1
- package/dist/metrics/usage_collector.d.ts.map +1 -1
- package/dist/metrics/usage_collector.js +5 -2
- package/dist/metrics/usage_collector.js.map +1 -1
- package/dist/metrics/utils.cjs +23 -7
- package/dist/metrics/utils.cjs.map +1 -1
- package/dist/metrics/utils.d.ts.map +1 -1
- package/dist/metrics/utils.js +23 -7
- package/dist/metrics/utils.js.map +1 -1
- package/dist/stream/deferred_stream.cjs +31 -10
- package/dist/stream/deferred_stream.cjs.map +1 -1
- package/dist/stream/deferred_stream.d.cts +6 -1
- package/dist/stream/deferred_stream.d.ts +6 -1
- package/dist/stream/deferred_stream.d.ts.map +1 -1
- package/dist/stream/deferred_stream.js +31 -10
- package/dist/stream/deferred_stream.js.map +1 -1
- package/dist/stream/deferred_stream.test.cjs +2 -2
- package/dist/stream/deferred_stream.test.cjs.map +1 -1
- package/dist/stream/deferred_stream.test.js +2 -2
- package/dist/stream/deferred_stream.test.js.map +1 -1
- package/dist/stream/index.cjs +3 -0
- package/dist/stream/index.cjs.map +1 -1
- package/dist/stream/index.d.cts +1 -0
- package/dist/stream/index.d.ts +1 -0
- package/dist/stream/index.d.ts.map +1 -1
- package/dist/stream/index.js +2 -0
- package/dist/stream/index.js.map +1 -1
- package/dist/stream/multi_input_stream.cjs +139 -0
- package/dist/stream/multi_input_stream.cjs.map +1 -0
- package/dist/stream/multi_input_stream.d.cts +55 -0
- package/dist/stream/multi_input_stream.d.ts +55 -0
- package/dist/stream/multi_input_stream.d.ts.map +1 -0
- package/dist/stream/multi_input_stream.js +115 -0
- package/dist/stream/multi_input_stream.js.map +1 -0
- package/dist/stream/multi_input_stream.test.cjs +344 -0
- package/dist/stream/multi_input_stream.test.cjs.map +1 -0
- package/dist/stream/multi_input_stream.test.js +343 -0
- package/dist/stream/multi_input_stream.test.js.map +1 -0
- package/dist/stream/stream_channel.cjs +39 -1
- package/dist/stream/stream_channel.cjs.map +1 -1
- package/dist/stream/stream_channel.d.cts +5 -2
- package/dist/stream/stream_channel.d.ts +5 -2
- package/dist/stream/stream_channel.d.ts.map +1 -1
- package/dist/stream/stream_channel.js +39 -1
- package/dist/stream/stream_channel.js.map +1 -1
- package/dist/stream/stream_channel.test.cjs +27 -0
- package/dist/stream/stream_channel.test.cjs.map +1 -1
- package/dist/stream/stream_channel.test.js +27 -0
- package/dist/stream/stream_channel.test.js.map +1 -1
- package/dist/stt/stream_adapter.cjs +24 -9
- package/dist/stt/stream_adapter.cjs.map +1 -1
- package/dist/stt/stream_adapter.d.cts +7 -3
- package/dist/stt/stream_adapter.d.ts +7 -3
- package/dist/stt/stream_adapter.d.ts.map +1 -1
- package/dist/stt/stream_adapter.js +24 -9
- package/dist/stt/stream_adapter.js.map +1 -1
- package/dist/stt/stt.cjs +86 -19
- package/dist/stt/stt.cjs.map +1 -1
- package/dist/stt/stt.d.cts +60 -5
- package/dist/stt/stt.d.ts +60 -5
- package/dist/stt/stt.d.ts.map +1 -1
- package/dist/stt/stt.js +88 -21
- package/dist/stt/stt.js.map +1 -1
- package/dist/telemetry/index.cjs +72 -0
- package/dist/telemetry/index.cjs.map +1 -0
- package/dist/telemetry/index.d.cts +7 -0
- package/dist/telemetry/index.d.ts +7 -0
- package/dist/telemetry/index.d.ts.map +1 -0
- package/dist/telemetry/index.js +37 -0
- package/dist/telemetry/index.js.map +1 -0
- package/dist/telemetry/logging.cjs +65 -0
- package/dist/telemetry/logging.cjs.map +1 -0
- package/dist/telemetry/logging.d.cts +21 -0
- package/dist/telemetry/logging.d.ts +21 -0
- package/dist/telemetry/logging.d.ts.map +1 -0
- package/dist/telemetry/logging.js +40 -0
- package/dist/telemetry/logging.js.map +1 -0
- package/dist/telemetry/otel_http_exporter.cjs +166 -0
- package/dist/telemetry/otel_http_exporter.cjs.map +1 -0
- package/dist/telemetry/otel_http_exporter.d.cts +63 -0
- package/dist/telemetry/otel_http_exporter.d.ts +63 -0
- package/dist/telemetry/otel_http_exporter.d.ts.map +1 -0
- package/dist/telemetry/otel_http_exporter.js +142 -0
- package/dist/telemetry/otel_http_exporter.js.map +1 -0
- package/dist/telemetry/pino_otel_transport.cjs +217 -0
- package/dist/telemetry/pino_otel_transport.cjs.map +1 -0
- package/dist/telemetry/pino_otel_transport.d.cts +58 -0
- package/dist/telemetry/pino_otel_transport.d.ts +58 -0
- package/dist/telemetry/pino_otel_transport.d.ts.map +1 -0
- package/dist/telemetry/pino_otel_transport.js +189 -0
- package/dist/telemetry/pino_otel_transport.js.map +1 -0
- package/dist/telemetry/trace_types.cjs +233 -0
- package/dist/telemetry/trace_types.cjs.map +1 -0
- package/dist/telemetry/trace_types.d.cts +74 -0
- package/dist/telemetry/trace_types.d.ts +74 -0
- package/dist/telemetry/trace_types.d.ts.map +1 -0
- package/dist/telemetry/trace_types.js +141 -0
- package/dist/telemetry/trace_types.js.map +1 -0
- package/dist/telemetry/traces.cjs +484 -0
- package/dist/telemetry/traces.cjs.map +1 -0
- package/dist/telemetry/traces.d.cts +116 -0
- package/dist/telemetry/traces.d.ts +116 -0
- package/dist/telemetry/traces.d.ts.map +1 -0
- package/dist/telemetry/traces.js +449 -0
- package/dist/telemetry/traces.js.map +1 -0
- package/dist/telemetry/utils.cjs +86 -0
- package/dist/telemetry/utils.cjs.map +1 -0
- package/dist/telemetry/utils.d.cts +5 -0
- package/dist/telemetry/utils.d.ts +5 -0
- package/dist/telemetry/utils.d.ts.map +1 -0
- package/dist/telemetry/utils.js +51 -0
- package/dist/telemetry/utils.js.map +1 -0
- package/dist/tokenize/basic/sentence.cjs +3 -3
- package/dist/tokenize/basic/sentence.cjs.map +1 -1
- package/dist/tokenize/basic/sentence.js +3 -3
- package/dist/tokenize/basic/sentence.js.map +1 -1
- package/dist/tokenize/tokenizer.test.cjs +3 -1
- package/dist/tokenize/tokenizer.test.cjs.map +1 -1
- package/dist/tokenize/tokenizer.test.js +3 -1
- package/dist/tokenize/tokenizer.test.js.map +1 -1
- package/dist/transcription.cjs.map +1 -1
- package/dist/transcription.d.cts +6 -0
- package/dist/transcription.d.ts +6 -0
- package/dist/transcription.d.ts.map +1 -1
- package/dist/transcription.js.map +1 -1
- package/dist/tts/fallback_adapter.cjs +466 -0
- package/dist/tts/fallback_adapter.cjs.map +1 -0
- package/dist/tts/fallback_adapter.d.cts +110 -0
- package/dist/tts/fallback_adapter.d.ts +110 -0
- package/dist/tts/fallback_adapter.d.ts.map +1 -0
- package/dist/tts/fallback_adapter.js +442 -0
- package/dist/tts/fallback_adapter.js.map +1 -0
- package/dist/tts/index.cjs +3 -0
- package/dist/tts/index.cjs.map +1 -1
- package/dist/tts/index.d.cts +1 -0
- package/dist/tts/index.d.ts +1 -0
- package/dist/tts/index.d.ts.map +1 -1
- package/dist/tts/index.js +2 -0
- package/dist/tts/index.js.map +1 -1
- package/dist/tts/stream_adapter.cjs +25 -8
- package/dist/tts/stream_adapter.cjs.map +1 -1
- package/dist/tts/stream_adapter.d.cts +6 -3
- package/dist/tts/stream_adapter.d.ts +6 -3
- package/dist/tts/stream_adapter.d.ts.map +1 -1
- package/dist/tts/stream_adapter.js +25 -8
- package/dist/tts/stream_adapter.js.map +1 -1
- package/dist/tts/tts.cjs +189 -57
- package/dist/tts/tts.cjs.map +1 -1
- package/dist/tts/tts.d.cts +58 -6
- package/dist/tts/tts.d.ts +58 -6
- package/dist/tts/tts.d.ts.map +1 -1
- package/dist/tts/tts.js +191 -59
- package/dist/tts/tts.js.map +1 -1
- package/dist/types.cjs +24 -32
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +45 -10
- package/dist/types.d.ts +45 -10
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +20 -30
- package/dist/types.js.map +1 -1
- package/dist/utils.cjs +122 -26
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +41 -1
- package/dist/utils.d.ts +41 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +117 -25
- package/dist/utils.js.map +1 -1
- package/dist/utils.test.cjs +73 -1
- package/dist/utils.test.cjs.map +1 -1
- package/dist/utils.test.js +74 -10
- package/dist/utils.test.js.map +1 -1
- package/dist/vad.cjs +35 -15
- package/dist/vad.cjs.map +1 -1
- package/dist/vad.d.cts +15 -5
- package/dist/vad.d.ts +15 -5
- package/dist/vad.d.ts.map +1 -1
- package/dist/vad.js +35 -15
- package/dist/vad.js.map +1 -1
- package/dist/version.cjs +1 -1
- package/dist/version.cjs.map +1 -1
- package/dist/version.d.cts +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/dist/voice/agent.cjs +258 -35
- package/dist/voice/agent.cjs.map +1 -1
- package/dist/voice/agent.d.cts +54 -13
- package/dist/voice/agent.d.ts +54 -13
- package/dist/voice/agent.d.ts.map +1 -1
- package/dist/voice/agent.js +254 -34
- package/dist/voice/agent.js.map +1 -1
- package/dist/voice/agent.test.cjs +314 -0
- package/dist/voice/agent.test.cjs.map +1 -1
- package/dist/voice/agent.test.js +316 -2
- package/dist/voice/agent.test.js.map +1 -1
- package/dist/voice/agent_activity.cjs +1116 -385
- package/dist/voice/agent_activity.cjs.map +1 -1
- package/dist/voice/agent_activity.d.cts +72 -11
- package/dist/voice/agent_activity.d.ts +72 -11
- package/dist/voice/agent_activity.d.ts.map +1 -1
- package/dist/voice/agent_activity.js +1119 -383
- package/dist/voice/agent_activity.js.map +1 -1
- package/dist/voice/agent_activity.test.cjs +135 -0
- package/dist/voice/agent_activity.test.cjs.map +1 -0
- package/dist/voice/agent_activity.test.js +134 -0
- package/dist/voice/agent_activity.test.js.map +1 -0
- package/dist/voice/agent_session.cjs +550 -90
- package/dist/voice/agent_session.cjs.map +1 -1
- package/dist/voice/agent_session.d.cts +185 -25
- package/dist/voice/agent_session.d.ts +185 -25
- package/dist/voice/agent_session.d.ts.map +1 -1
- package/dist/voice/agent_session.js +556 -91
- package/dist/voice/agent_session.js.map +1 -1
- package/dist/voice/audio_recognition.cjs +605 -46
- package/dist/voice/audio_recognition.cjs.map +1 -1
- package/dist/voice/audio_recognition.d.cts +96 -4
- package/dist/voice/audio_recognition.d.ts +96 -4
- package/dist/voice/audio_recognition.d.ts.map +1 -1
- package/dist/voice/audio_recognition.js +611 -47
- package/dist/voice/audio_recognition.js.map +1 -1
- package/dist/voice/audio_recognition_span.test.cjs +295 -0
- package/dist/voice/audio_recognition_span.test.cjs.map +1 -0
- package/dist/voice/audio_recognition_span.test.js +299 -0
- package/dist/voice/audio_recognition_span.test.js.map +1 -0
- package/dist/voice/avatar/datastream_io.cjs +7 -1
- package/dist/voice/avatar/datastream_io.cjs.map +1 -1
- package/dist/voice/avatar/datastream_io.d.cts +1 -0
- package/dist/voice/avatar/datastream_io.d.ts +1 -0
- package/dist/voice/avatar/datastream_io.d.ts.map +1 -1
- package/dist/voice/avatar/datastream_io.js +7 -1
- package/dist/voice/avatar/datastream_io.js.map +1 -1
- package/dist/voice/background_audio.cjs +367 -0
- package/dist/voice/background_audio.cjs.map +1 -0
- package/dist/voice/background_audio.d.cts +123 -0
- package/dist/voice/background_audio.d.ts +123 -0
- package/dist/voice/background_audio.d.ts.map +1 -0
- package/dist/voice/background_audio.js +343 -0
- package/dist/voice/background_audio.js.map +1 -0
- package/dist/voice/events.cjs +3 -0
- package/dist/voice/events.cjs.map +1 -1
- package/dist/voice/events.d.cts +16 -9
- package/dist/voice/events.d.ts +16 -9
- package/dist/voice/events.d.ts.map +1 -1
- package/dist/voice/events.js +3 -0
- package/dist/voice/events.js.map +1 -1
- package/dist/voice/generation.cjs +205 -41
- package/dist/voice/generation.cjs.map +1 -1
- package/dist/voice/generation.d.cts +21 -5
- package/dist/voice/generation.d.ts +21 -5
- package/dist/voice/generation.d.ts.map +1 -1
- package/dist/voice/generation.js +215 -43
- package/dist/voice/generation.js.map +1 -1
- package/dist/voice/generation_tools.test.cjs +236 -0
- package/dist/voice/generation_tools.test.cjs.map +1 -0
- package/dist/voice/generation_tools.test.js +235 -0
- package/dist/voice/generation_tools.test.js.map +1 -0
- package/dist/voice/index.cjs +33 -2
- package/dist/voice/index.cjs.map +1 -1
- package/dist/voice/index.d.cts +8 -2
- package/dist/voice/index.d.ts +8 -2
- package/dist/voice/index.d.ts.map +1 -1
- package/dist/voice/index.js +19 -2
- package/dist/voice/index.js.map +1 -1
- package/dist/voice/interruption_detection.test.cjs +114 -0
- package/dist/voice/interruption_detection.test.cjs.map +1 -0
- package/dist/voice/interruption_detection.test.js +113 -0
- package/dist/voice/interruption_detection.test.js.map +1 -0
- package/dist/voice/io.cjs +66 -6
- package/dist/voice/io.cjs.map +1 -1
- package/dist/voice/io.d.cts +67 -7
- package/dist/voice/io.d.ts +67 -7
- package/dist/voice/io.d.ts.map +1 -1
- package/dist/voice/io.js +62 -5
- package/dist/voice/io.js.map +1 -1
- package/dist/voice/recorder_io/index.cjs +23 -0
- package/dist/voice/recorder_io/index.cjs.map +1 -0
- package/dist/voice/recorder_io/index.d.cts +2 -0
- package/dist/voice/recorder_io/index.d.ts +2 -0
- package/dist/voice/recorder_io/index.d.ts.map +1 -0
- package/dist/voice/recorder_io/index.js +2 -0
- package/dist/voice/recorder_io/index.js.map +1 -0
- package/dist/voice/recorder_io/recorder_io.cjs +607 -0
- package/dist/voice/recorder_io/recorder_io.cjs.map +1 -0
- package/dist/voice/recorder_io/recorder_io.d.cts +106 -0
- package/dist/voice/recorder_io/recorder_io.d.ts +106 -0
- package/dist/voice/recorder_io/recorder_io.d.ts.map +1 -0
- package/dist/voice/recorder_io/recorder_io.js +573 -0
- package/dist/voice/recorder_io/recorder_io.js.map +1 -0
- package/dist/voice/remote_session.cjs +922 -0
- package/dist/voice/remote_session.cjs.map +1 -0
- package/dist/voice/remote_session.d.cts +108 -0
- package/dist/voice/remote_session.d.ts +108 -0
- package/dist/voice/remote_session.d.ts.map +1 -0
- package/dist/voice/remote_session.js +887 -0
- package/dist/voice/remote_session.js.map +1 -0
- package/dist/voice/report.cjs +88 -0
- package/dist/voice/report.cjs.map +1 -0
- package/dist/voice/report.d.cts +49 -0
- package/dist/voice/report.d.ts +49 -0
- package/dist/voice/report.d.ts.map +1 -0
- package/dist/voice/report.js +63 -0
- package/dist/voice/report.js.map +1 -0
- package/dist/voice/report.test.cjs +121 -0
- package/dist/voice/report.test.cjs.map +1 -0
- package/dist/voice/report.test.js +120 -0
- package/dist/voice/report.test.js.map +1 -0
- package/dist/voice/room_io/_input.cjs +40 -7
- package/dist/voice/room_io/_input.cjs.map +1 -1
- package/dist/voice/room_io/_input.d.cts +5 -2
- package/dist/voice/room_io/_input.d.ts +5 -2
- package/dist/voice/room_io/_input.d.ts.map +1 -1
- package/dist/voice/room_io/_input.js +41 -8
- package/dist/voice/room_io/_input.js.map +1 -1
- package/dist/voice/room_io/_output.cjs +19 -11
- package/dist/voice/room_io/_output.cjs.map +1 -1
- package/dist/voice/room_io/_output.d.cts +7 -4
- package/dist/voice/room_io/_output.d.ts +7 -4
- package/dist/voice/room_io/_output.d.ts.map +1 -1
- package/dist/voice/room_io/_output.js +20 -12
- package/dist/voice/room_io/_output.js.map +1 -1
- package/dist/voice/room_io/room_io.cjs +33 -6
- package/dist/voice/room_io/room_io.cjs.map +1 -1
- package/dist/voice/room_io/room_io.d.cts +29 -9
- package/dist/voice/room_io/room_io.d.ts +29 -9
- package/dist/voice/room_io/room_io.d.ts.map +1 -1
- package/dist/voice/room_io/room_io.js +33 -7
- package/dist/voice/room_io/room_io.js.map +1 -1
- package/dist/voice/speech_handle.cjs +22 -4
- package/dist/voice/speech_handle.cjs.map +1 -1
- package/dist/voice/speech_handle.d.cts +17 -2
- package/dist/voice/speech_handle.d.ts +17 -2
- package/dist/voice/speech_handle.d.ts.map +1 -1
- package/dist/voice/speech_handle.js +21 -4
- package/dist/voice/speech_handle.js.map +1 -1
- package/dist/voice/testing/fake_llm.cjs +127 -0
- package/dist/voice/testing/fake_llm.cjs.map +1 -0
- package/dist/voice/testing/fake_llm.d.cts +30 -0
- package/dist/voice/testing/fake_llm.d.ts +30 -0
- package/dist/voice/testing/fake_llm.d.ts.map +1 -0
- package/dist/voice/testing/fake_llm.js +103 -0
- package/dist/voice/testing/fake_llm.js.map +1 -0
- package/dist/voice/testing/index.cjs +57 -0
- package/dist/voice/testing/index.cjs.map +1 -0
- package/dist/voice/testing/index.d.cts +21 -0
- package/dist/voice/testing/index.d.ts +21 -0
- package/dist/voice/testing/index.d.ts.map +1 -0
- package/dist/voice/testing/index.js +35 -0
- package/dist/voice/testing/index.js.map +1 -0
- package/dist/voice/testing/run_result.cjs +817 -0
- package/dist/voice/testing/run_result.cjs.map +1 -0
- package/dist/voice/testing/run_result.d.cts +385 -0
- package/dist/voice/testing/run_result.d.ts +385 -0
- package/dist/voice/testing/run_result.d.ts.map +1 -0
- package/dist/voice/testing/run_result.js +790 -0
- package/dist/voice/testing/run_result.js.map +1 -0
- package/dist/voice/testing/types.cjs +46 -0
- package/dist/voice/testing/types.cjs.map +1 -0
- package/dist/voice/testing/types.d.cts +83 -0
- package/dist/voice/testing/types.d.ts +83 -0
- package/dist/voice/testing/types.d.ts.map +1 -0
- package/dist/voice/testing/types.js +19 -0
- package/dist/voice/testing/types.js.map +1 -0
- package/dist/voice/transcription/synchronizer.cjs +139 -15
- package/dist/voice/transcription/synchronizer.cjs.map +1 -1
- package/dist/voice/transcription/synchronizer.d.cts +35 -4
- package/dist/voice/transcription/synchronizer.d.ts +35 -4
- package/dist/voice/transcription/synchronizer.d.ts.map +1 -1
- package/dist/voice/transcription/synchronizer.js +143 -16
- package/dist/voice/transcription/synchronizer.js.map +1 -1
- package/dist/voice/transcription/synchronizer.test.cjs +151 -0
- package/dist/voice/transcription/synchronizer.test.cjs.map +1 -0
- package/dist/voice/transcription/synchronizer.test.js +150 -0
- package/dist/voice/transcription/synchronizer.test.js.map +1 -0
- package/dist/voice/turn_config/endpointing.cjs +33 -0
- package/dist/voice/turn_config/endpointing.cjs.map +1 -0
- package/dist/voice/turn_config/endpointing.d.cts +30 -0
- package/dist/voice/turn_config/endpointing.d.ts +30 -0
- package/dist/voice/turn_config/endpointing.d.ts.map +1 -0
- package/dist/voice/turn_config/endpointing.js +9 -0
- package/dist/voice/turn_config/endpointing.js.map +1 -0
- package/dist/voice/turn_config/interruption.cjs +37 -0
- package/dist/voice/turn_config/interruption.cjs.map +1 -0
- package/dist/voice/turn_config/interruption.d.cts +53 -0
- package/dist/voice/turn_config/interruption.d.ts +53 -0
- package/dist/voice/turn_config/interruption.d.ts.map +1 -0
- package/dist/voice/turn_config/interruption.js +13 -0
- package/dist/voice/turn_config/interruption.js.map +1 -0
- package/dist/voice/turn_config/turn_handling.cjs +35 -0
- package/dist/voice/turn_config/turn_handling.cjs.map +1 -0
- package/dist/voice/turn_config/turn_handling.d.cts +36 -0
- package/dist/voice/turn_config/turn_handling.d.ts +36 -0
- package/dist/voice/turn_config/turn_handling.d.ts.map +1 -0
- package/dist/voice/turn_config/turn_handling.js +11 -0
- package/dist/voice/turn_config/turn_handling.js.map +1 -0
- package/dist/voice/turn_config/utils.cjs +157 -0
- package/dist/voice/turn_config/utils.cjs.map +1 -0
- package/dist/voice/turn_config/utils.d.cts +37 -0
- package/dist/voice/turn_config/utils.d.ts +37 -0
- package/dist/voice/turn_config/utils.d.ts.map +1 -0
- package/dist/voice/turn_config/utils.js +131 -0
- package/dist/voice/turn_config/utils.js.map +1 -0
- package/dist/voice/turn_config/utils.test.cjs +128 -0
- package/dist/voice/turn_config/utils.test.cjs.map +1 -0
- package/dist/voice/turn_config/utils.test.js +127 -0
- package/dist/voice/turn_config/utils.test.js.map +1 -0
- package/dist/voice/utils.cjs +47 -0
- package/dist/voice/utils.cjs.map +1 -0
- package/dist/voice/utils.d.cts +4 -0
- package/dist/voice/utils.d.ts +4 -0
- package/dist/voice/utils.d.ts.map +1 -0
- package/dist/voice/utils.js +23 -0
- package/dist/voice/utils.js.map +1 -0
- package/dist/worker.cjs +44 -52
- package/dist/worker.cjs.map +1 -1
- package/dist/worker.d.cts +18 -8
- package/dist/worker.d.ts +18 -8
- package/dist/worker.d.ts.map +1 -1
- package/dist/worker.js +43 -43
- package/dist/worker.js.map +1 -1
- package/package.json +32 -12
- package/resources/NOTICE +2 -0
- package/resources/keyboard-typing.ogg +0 -0
- package/resources/keyboard-typing2.ogg +0 -0
- package/resources/office-ambience.ogg +0 -0
- package/src/audio.ts +132 -1
- package/src/beta/index.ts +9 -0
- package/src/beta/workflows/index.ts +9 -0
- package/src/beta/workflows/task_group.ts +194 -0
- package/src/cli.ts +57 -66
- package/src/connection_pool.test.ts +346 -0
- package/src/connection_pool.ts +307 -0
- package/src/constants.ts +14 -0
- package/src/cpu.test.ts +239 -0
- package/src/cpu.ts +173 -0
- package/src/http_server.ts +18 -6
- package/src/index.ts +15 -13
- package/src/inference/api_protos.ts +85 -2
- package/src/inference/index.ts +32 -4
- package/src/inference/interruption/defaults.ts +51 -0
- package/src/inference/interruption/errors.ts +25 -0
- package/src/inference/interruption/http_transport.ts +206 -0
- package/src/inference/interruption/interruption_cache_entry.ts +50 -0
- package/src/inference/interruption/interruption_detector.ts +204 -0
- package/src/inference/interruption/interruption_stream.ts +467 -0
- package/src/inference/interruption/types.ts +84 -0
- package/src/inference/interruption/utils.test.ts +132 -0
- package/src/inference/interruption/utils.ts +137 -0
- package/src/inference/interruption/ws_transport.ts +406 -0
- package/src/inference/llm.ts +214 -163
- package/src/inference/stt.test.ts +253 -0
- package/src/inference/stt.ts +449 -208
- package/src/inference/tts.test.ts +267 -0
- package/src/inference/tts.ts +377 -115
- package/src/inference/utils.ts +30 -2
- package/src/ipc/inference_proc_executor.ts +11 -3
- package/src/ipc/inference_proc_lazy_main.ts +13 -1
- package/src/ipc/job_proc_executor.ts +11 -1
- package/src/ipc/job_proc_lazy_main.ts +86 -20
- package/src/ipc/supervised_proc.test.ts +153 -0
- package/src/ipc/supervised_proc.ts +39 -10
- package/src/job.ts +120 -1
- package/src/language.test.ts +62 -0
- package/src/language.ts +380 -0
- package/src/llm/__snapshots__/zod-utils.test.ts.snap +559 -0
- package/src/llm/chat_context.test.ts +655 -0
- package/src/llm/chat_context.ts +412 -2
- package/src/llm/fallback_adapter.test.ts +238 -0
- package/src/llm/fallback_adapter.ts +391 -0
- package/src/llm/index.ts +11 -0
- package/src/llm/llm.ts +77 -12
- package/src/llm/provider_format/google.test.ts +72 -1
- package/src/llm/provider_format/google.ts +10 -6
- package/src/llm/provider_format/index.ts +7 -2
- package/src/llm/provider_format/openai.test.ts +480 -2
- package/src/llm/provider_format/openai.ts +152 -21
- package/src/llm/provider_format/utils.ts +11 -5
- package/src/llm/realtime.ts +23 -2
- package/src/llm/remote_chat_context.ts +2 -2
- package/src/llm/tool_context.test.ts +210 -1
- package/src/llm/tool_context.ts +115 -17
- package/src/llm/utils.ts +24 -16
- package/src/llm/zod-utils.test.ts +577 -0
- package/src/llm/zod-utils.ts +153 -0
- package/src/log.ts +71 -19
- package/src/metrics/base.ts +78 -19
- package/src/metrics/index.ts +12 -0
- package/src/metrics/model_usage.test.ts +545 -0
- package/src/metrics/model_usage.ts +262 -0
- package/src/metrics/usage_collector.ts +14 -3
- package/src/metrics/utils.ts +27 -7
- package/src/stream/deferred_stream.test.ts +3 -3
- package/src/stream/deferred_stream.ts +43 -11
- package/src/stream/index.ts +1 -0
- package/src/stream/multi_input_stream.test.ts +545 -0
- package/src/stream/multi_input_stream.ts +172 -0
- package/src/stream/stream_channel.test.ts +37 -0
- package/src/stream/stream_channel.ts +43 -3
- package/src/stt/stream_adapter.ts +30 -9
- package/src/stt/stt.ts +131 -22
- package/src/telemetry/index.ts +28 -0
- package/src/telemetry/logging.ts +55 -0
- package/src/telemetry/otel_http_exporter.ts +218 -0
- package/src/telemetry/pino_otel_transport.ts +265 -0
- package/src/telemetry/trace_types.ts +109 -0
- package/src/telemetry/traces.ts +673 -0
- package/src/telemetry/utils.ts +61 -0
- package/src/tokenize/basic/sentence.ts +3 -3
- package/src/tokenize/tokenizer.test.ts +4 -0
- package/src/transcription.ts +6 -0
- package/src/tts/fallback_adapter.ts +579 -0
- package/src/tts/index.ts +1 -0
- package/src/tts/stream_adapter.ts +38 -8
- package/src/tts/tts.ts +245 -62
- package/src/types.ts +62 -33
- package/src/utils.test.ts +90 -10
- package/src/utils.ts +176 -31
- package/src/vad.ts +42 -18
- package/src/version.ts +1 -1
- package/src/voice/agent.test.ts +347 -2
- package/src/voice/agent.ts +346 -44
- package/src/voice/agent_activity.test.ts +194 -0
- package/src/voice/agent_activity.ts +1457 -388
- package/src/voice/agent_session.ts +817 -112
- package/src/voice/audio_recognition.ts +845 -70
- package/src/voice/audio_recognition_span.test.ts +341 -0
- package/src/voice/avatar/datastream_io.ts +9 -1
- package/src/voice/background_audio.ts +494 -0
- package/src/voice/events.ts +27 -7
- package/src/voice/generation.ts +310 -56
- package/src/voice/generation_tools.test.ts +268 -0
- package/src/voice/index.ts +17 -3
- package/src/voice/interruption_detection.test.ts +151 -0
- package/src/voice/io.ts +115 -12
- package/src/voice/recorder_io/index.ts +4 -0
- package/src/voice/recorder_io/recorder_io.ts +783 -0
- package/src/voice/remote_session.ts +1083 -0
- package/src/voice/report.test.ts +136 -0
- package/src/voice/report.ts +140 -0
- package/src/voice/room_io/_input.ts +45 -10
- package/src/voice/room_io/_output.ts +26 -14
- package/src/voice/room_io/room_io.ts +67 -22
- package/src/voice/speech_handle.ts +38 -6
- package/src/voice/testing/fake_llm.ts +138 -0
- package/src/voice/testing/index.ts +52 -0
- package/src/voice/testing/run_result.ts +995 -0
- package/src/voice/testing/types.ts +118 -0
- package/src/voice/transcription/synchronizer.test.ts +206 -0
- package/src/voice/transcription/synchronizer.ts +204 -19
- package/src/voice/turn_config/endpointing.ts +33 -0
- package/src/voice/turn_config/interruption.ts +56 -0
- package/src/voice/turn_config/turn_handling.ts +45 -0
- package/src/voice/turn_config/utils.test.ts +148 -0
- package/src/voice/turn_config/utils.ts +167 -0
- package/src/voice/utils.ts +29 -0
- package/src/worker.ts +92 -78
- package/src/llm/__snapshots__/utils.test.ts.snap +0 -65
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var interruption_exports = {};
|
|
20
|
+
__export(interruption_exports, {
|
|
21
|
+
defaultInterruptionOptions: () => defaultInterruptionOptions
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(interruption_exports);
|
|
24
|
+
const defaultInterruptionOptions = {
|
|
25
|
+
enabled: true,
|
|
26
|
+
mode: void 0,
|
|
27
|
+
discardAudioIfUninterruptible: true,
|
|
28
|
+
minDuration: 500,
|
|
29
|
+
minWords: 0,
|
|
30
|
+
falseInterruptionTimeout: 2e3,
|
|
31
|
+
resumeFalseInterruption: true
|
|
32
|
+
};
|
|
33
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
34
|
+
0 && (module.exports = {
|
|
35
|
+
defaultInterruptionOptions
|
|
36
|
+
});
|
|
37
|
+
//# sourceMappingURL=interruption.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/voice/turn_config/interruption.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2026 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Configuration for interruption handling.\n */\nexport interface InterruptionOptions {\n /**\n * Whether interruptions are enabled.\n * @defaultValue true\n */\n enabled: boolean;\n /**\n * Interruption handling strategy. `\"adaptive\"` for ML-based detection, `\"vad\"` for simple\n * voice-activity detection. `undefined` means auto-detect.\n * @defaultValue undefined\n */\n mode: 'adaptive' | 'vad' | undefined;\n /**\n * When `true`, buffered audio is dropped while the agent is speaking and cannot be interrupted.\n * @defaultValue true\n */\n discardAudioIfUninterruptible: boolean;\n /**\n * Minimum speech length in milliseconds to register as an interruption.\n * @defaultValue 500\n */\n minDuration: number;\n /**\n * Minimum number of words to consider an interruption, only used if STT is enabled.\n * @defaultValue 0\n */\n minWords: number;\n /**\n * If set, emit an `agentFalseInterruption` event after this amount of time if the user is\n * silent and no user transcript is detected after the interruption. Set to `undefined` to\n * disable. The value is in milliseconds.\n * @defaultValue 2000\n */\n falseInterruptionTimeout: number;\n /**\n * Whether to resume the false interruption after the `falseInterruptionTimeout`.\n * @defaultValue true\n */\n resumeFalseInterruption: boolean;\n}\n\nexport const defaultInterruptionOptions = {\n enabled: true,\n mode: undefined,\n discardAudioIfUninterruptible: true,\n minDuration: 500,\n minWords: 0,\n falseInterruptionTimeout: 2000,\n resumeFalseInterruption: true,\n} as const satisfies InterruptionOptions;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA+CO,MAAM,6BAA6B;AAAA,EACxC,SAAS;AAAA,EACT,MAAM;AAAA,EACN,+BAA+B;AAAA,EAC/B,aAAa;AAAA,EACb,UAAU;AAAA,EACV,0BAA0B;AAAA,EAC1B,yBAAyB;AAC3B;","names":[]}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration for interruption handling.
|
|
3
|
+
*/
|
|
4
|
+
export interface InterruptionOptions {
|
|
5
|
+
/**
|
|
6
|
+
* Whether interruptions are enabled.
|
|
7
|
+
* @defaultValue true
|
|
8
|
+
*/
|
|
9
|
+
enabled: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Interruption handling strategy. `"adaptive"` for ML-based detection, `"vad"` for simple
|
|
12
|
+
* voice-activity detection. `undefined` means auto-detect.
|
|
13
|
+
* @defaultValue undefined
|
|
14
|
+
*/
|
|
15
|
+
mode: 'adaptive' | 'vad' | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* When `true`, buffered audio is dropped while the agent is speaking and cannot be interrupted.
|
|
18
|
+
* @defaultValue true
|
|
19
|
+
*/
|
|
20
|
+
discardAudioIfUninterruptible: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Minimum speech length in milliseconds to register as an interruption.
|
|
23
|
+
* @defaultValue 500
|
|
24
|
+
*/
|
|
25
|
+
minDuration: number;
|
|
26
|
+
/**
|
|
27
|
+
* Minimum number of words to consider an interruption, only used if STT is enabled.
|
|
28
|
+
* @defaultValue 0
|
|
29
|
+
*/
|
|
30
|
+
minWords: number;
|
|
31
|
+
/**
|
|
32
|
+
* If set, emit an `agentFalseInterruption` event after this amount of time if the user is
|
|
33
|
+
* silent and no user transcript is detected after the interruption. Set to `undefined` to
|
|
34
|
+
* disable. The value is in milliseconds.
|
|
35
|
+
* @defaultValue 2000
|
|
36
|
+
*/
|
|
37
|
+
falseInterruptionTimeout: number;
|
|
38
|
+
/**
|
|
39
|
+
* Whether to resume the false interruption after the `falseInterruptionTimeout`.
|
|
40
|
+
* @defaultValue true
|
|
41
|
+
*/
|
|
42
|
+
resumeFalseInterruption: boolean;
|
|
43
|
+
}
|
|
44
|
+
export declare const defaultInterruptionOptions: {
|
|
45
|
+
readonly enabled: true;
|
|
46
|
+
readonly mode: undefined;
|
|
47
|
+
readonly discardAudioIfUninterruptible: true;
|
|
48
|
+
readonly minDuration: 500;
|
|
49
|
+
readonly minWords: 0;
|
|
50
|
+
readonly falseInterruptionTimeout: 2000;
|
|
51
|
+
readonly resumeFalseInterruption: true;
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=interruption.d.ts.map
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration for interruption handling.
|
|
3
|
+
*/
|
|
4
|
+
export interface InterruptionOptions {
|
|
5
|
+
/**
|
|
6
|
+
* Whether interruptions are enabled.
|
|
7
|
+
* @defaultValue true
|
|
8
|
+
*/
|
|
9
|
+
enabled: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Interruption handling strategy. `"adaptive"` for ML-based detection, `"vad"` for simple
|
|
12
|
+
* voice-activity detection. `undefined` means auto-detect.
|
|
13
|
+
* @defaultValue undefined
|
|
14
|
+
*/
|
|
15
|
+
mode: 'adaptive' | 'vad' | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* When `true`, buffered audio is dropped while the agent is speaking and cannot be interrupted.
|
|
18
|
+
* @defaultValue true
|
|
19
|
+
*/
|
|
20
|
+
discardAudioIfUninterruptible: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Minimum speech length in milliseconds to register as an interruption.
|
|
23
|
+
* @defaultValue 500
|
|
24
|
+
*/
|
|
25
|
+
minDuration: number;
|
|
26
|
+
/**
|
|
27
|
+
* Minimum number of words to consider an interruption, only used if STT is enabled.
|
|
28
|
+
* @defaultValue 0
|
|
29
|
+
*/
|
|
30
|
+
minWords: number;
|
|
31
|
+
/**
|
|
32
|
+
* If set, emit an `agentFalseInterruption` event after this amount of time if the user is
|
|
33
|
+
* silent and no user transcript is detected after the interruption. Set to `undefined` to
|
|
34
|
+
* disable. The value is in milliseconds.
|
|
35
|
+
* @defaultValue 2000
|
|
36
|
+
*/
|
|
37
|
+
falseInterruptionTimeout: number;
|
|
38
|
+
/**
|
|
39
|
+
* Whether to resume the false interruption after the `falseInterruptionTimeout`.
|
|
40
|
+
* @defaultValue true
|
|
41
|
+
*/
|
|
42
|
+
resumeFalseInterruption: boolean;
|
|
43
|
+
}
|
|
44
|
+
export declare const defaultInterruptionOptions: {
|
|
45
|
+
readonly enabled: true;
|
|
46
|
+
readonly mode: undefined;
|
|
47
|
+
readonly discardAudioIfUninterruptible: true;
|
|
48
|
+
readonly minDuration: 500;
|
|
49
|
+
readonly minWords: 0;
|
|
50
|
+
readonly falseInterruptionTimeout: 2000;
|
|
51
|
+
readonly resumeFalseInterruption: true;
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=interruption.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interruption.d.ts","sourceRoot":"","sources":["../../../src/voice/turn_config/interruption.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,IAAI,EAAE,UAAU,GAAG,KAAK,GAAG,SAAS,CAAC;IACrC;;;OAGG;IACH,6BAA6B,EAAE,OAAO,CAAC;IACvC;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;OAKG;IACH,wBAAwB,EAAE,MAAM,CAAC;IACjC;;;OAGG;IACH,uBAAuB,EAAE,OAAO,CAAC;CAClC;AAED,eAAO,MAAM,0BAA0B;;;;;;;;CAQC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const defaultInterruptionOptions = {
|
|
2
|
+
enabled: true,
|
|
3
|
+
mode: void 0,
|
|
4
|
+
discardAudioIfUninterruptible: true,
|
|
5
|
+
minDuration: 500,
|
|
6
|
+
minWords: 0,
|
|
7
|
+
falseInterruptionTimeout: 2e3,
|
|
8
|
+
resumeFalseInterruption: true
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
defaultInterruptionOptions
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=interruption.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/voice/turn_config/interruption.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2026 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Configuration for interruption handling.\n */\nexport interface InterruptionOptions {\n /**\n * Whether interruptions are enabled.\n * @defaultValue true\n */\n enabled: boolean;\n /**\n * Interruption handling strategy. `\"adaptive\"` for ML-based detection, `\"vad\"` for simple\n * voice-activity detection. `undefined` means auto-detect.\n * @defaultValue undefined\n */\n mode: 'adaptive' | 'vad' | undefined;\n /**\n * When `true`, buffered audio is dropped while the agent is speaking and cannot be interrupted.\n * @defaultValue true\n */\n discardAudioIfUninterruptible: boolean;\n /**\n * Minimum speech length in milliseconds to register as an interruption.\n * @defaultValue 500\n */\n minDuration: number;\n /**\n * Minimum number of words to consider an interruption, only used if STT is enabled.\n * @defaultValue 0\n */\n minWords: number;\n /**\n * If set, emit an `agentFalseInterruption` event after this amount of time if the user is\n * silent and no user transcript is detected after the interruption. Set to `undefined` to\n * disable. The value is in milliseconds.\n * @defaultValue 2000\n */\n falseInterruptionTimeout: number;\n /**\n * Whether to resume the false interruption after the `falseInterruptionTimeout`.\n * @defaultValue true\n */\n resumeFalseInterruption: boolean;\n}\n\nexport const defaultInterruptionOptions = {\n enabled: true,\n mode: undefined,\n discardAudioIfUninterruptible: true,\n minDuration: 500,\n minWords: 0,\n falseInterruptionTimeout: 2000,\n resumeFalseInterruption: true,\n} as const satisfies InterruptionOptions;\n"],"mappings":"AA+CO,MAAM,6BAA6B;AAAA,EACxC,SAAS;AAAA,EACT,MAAM;AAAA,EACN,+BAA+B;AAAA,EAC/B,aAAa;AAAA,EACb,UAAU;AAAA,EACV,0BAA0B;AAAA,EAC1B,yBAAyB;AAC3B;","names":[]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var turn_handling_exports = {};
|
|
20
|
+
__export(turn_handling_exports, {
|
|
21
|
+
defaultTurnHandlingOptions: () => defaultTurnHandlingOptions
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(turn_handling_exports);
|
|
24
|
+
var import_endpointing = require("./endpointing.cjs");
|
|
25
|
+
var import_interruption = require("./interruption.cjs");
|
|
26
|
+
const defaultTurnHandlingOptions = {
|
|
27
|
+
turnDetection: void 0,
|
|
28
|
+
interruption: import_interruption.defaultInterruptionOptions,
|
|
29
|
+
endpointing: import_endpointing.defaultEndpointingOptions
|
|
30
|
+
};
|
|
31
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
32
|
+
0 && (module.exports = {
|
|
33
|
+
defaultTurnHandlingOptions
|
|
34
|
+
});
|
|
35
|
+
//# sourceMappingURL=turn_handling.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/voice/turn_config/turn_handling.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2026 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\nimport type { TurnDetectionMode } from '../agent_session.js';\nimport { type EndpointingOptions, defaultEndpointingOptions } from './endpointing.js';\nimport { type InterruptionOptions, defaultInterruptionOptions } from './interruption.js';\n\n/**\n * Configuration for the turn handling system. Used to configure the turn taking behavior of the\n * session.\n */\nexport interface TurnHandlingOptions {\n /**\n * Strategy for deciding when the user has finished speaking.\n *\n * - `\"stt\"` – rely on speech-to-text end-of-utterance cues\n * - `\"vad\"` – rely on Voice Activity Detection start/stop cues\n * - `\"realtime_llm\"` – use server-side detection from a realtime LLM\n * - `\"manual\"` – caller controls turn boundaries explicitly\n *\n * If not set, the session chooses the best available mode in priority order\n * `realtime_llm → vad → stt → manual`; it automatically falls back if the necessary model\n * is missing.\n */\n turnDetection: TurnDetectionMode | undefined;\n /**\n * Configuration for endpointing.\n */\n endpointing: Partial<EndpointingOptions>;\n /**\n * Configuration for interruption handling.\n */\n interruption: Partial<InterruptionOptions>;\n}\n\nexport interface InternalTurnHandlingOptions extends TurnHandlingOptions {\n endpointing: EndpointingOptions;\n interruption: InterruptionOptions;\n}\n\nexport const defaultTurnHandlingOptions: InternalTurnHandlingOptions = {\n turnDetection: undefined,\n interruption: defaultInterruptionOptions,\n endpointing: defaultEndpointingOptions,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,yBAAmE;AACnE,0BAAqE;AAmC9D,MAAM,6BAA0D;AAAA,EACrE,eAAe;AAAA,EACf,cAAc;AAAA,EACd,aAAa;AACf;","names":[]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { TurnDetectionMode } from '../agent_session.js';
|
|
2
|
+
import { type EndpointingOptions } from './endpointing.js';
|
|
3
|
+
import { type InterruptionOptions } from './interruption.js';
|
|
4
|
+
/**
|
|
5
|
+
* Configuration for the turn handling system. Used to configure the turn taking behavior of the
|
|
6
|
+
* session.
|
|
7
|
+
*/
|
|
8
|
+
export interface TurnHandlingOptions {
|
|
9
|
+
/**
|
|
10
|
+
* Strategy for deciding when the user has finished speaking.
|
|
11
|
+
*
|
|
12
|
+
* - `"stt"` – rely on speech-to-text end-of-utterance cues
|
|
13
|
+
* - `"vad"` – rely on Voice Activity Detection start/stop cues
|
|
14
|
+
* - `"realtime_llm"` – use server-side detection from a realtime LLM
|
|
15
|
+
* - `"manual"` – caller controls turn boundaries explicitly
|
|
16
|
+
*
|
|
17
|
+
* If not set, the session chooses the best available mode in priority order
|
|
18
|
+
* `realtime_llm → vad → stt → manual`; it automatically falls back if the necessary model
|
|
19
|
+
* is missing.
|
|
20
|
+
*/
|
|
21
|
+
turnDetection: TurnDetectionMode | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Configuration for endpointing.
|
|
24
|
+
*/
|
|
25
|
+
endpointing: Partial<EndpointingOptions>;
|
|
26
|
+
/**
|
|
27
|
+
* Configuration for interruption handling.
|
|
28
|
+
*/
|
|
29
|
+
interruption: Partial<InterruptionOptions>;
|
|
30
|
+
}
|
|
31
|
+
export interface InternalTurnHandlingOptions extends TurnHandlingOptions {
|
|
32
|
+
endpointing: EndpointingOptions;
|
|
33
|
+
interruption: InterruptionOptions;
|
|
34
|
+
}
|
|
35
|
+
export declare const defaultTurnHandlingOptions: InternalTurnHandlingOptions;
|
|
36
|
+
//# sourceMappingURL=turn_handling.d.ts.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { TurnDetectionMode } from '../agent_session.js';
|
|
2
|
+
import { type EndpointingOptions } from './endpointing.js';
|
|
3
|
+
import { type InterruptionOptions } from './interruption.js';
|
|
4
|
+
/**
|
|
5
|
+
* Configuration for the turn handling system. Used to configure the turn taking behavior of the
|
|
6
|
+
* session.
|
|
7
|
+
*/
|
|
8
|
+
export interface TurnHandlingOptions {
|
|
9
|
+
/**
|
|
10
|
+
* Strategy for deciding when the user has finished speaking.
|
|
11
|
+
*
|
|
12
|
+
* - `"stt"` – rely on speech-to-text end-of-utterance cues
|
|
13
|
+
* - `"vad"` – rely on Voice Activity Detection start/stop cues
|
|
14
|
+
* - `"realtime_llm"` – use server-side detection from a realtime LLM
|
|
15
|
+
* - `"manual"` – caller controls turn boundaries explicitly
|
|
16
|
+
*
|
|
17
|
+
* If not set, the session chooses the best available mode in priority order
|
|
18
|
+
* `realtime_llm → vad → stt → manual`; it automatically falls back if the necessary model
|
|
19
|
+
* is missing.
|
|
20
|
+
*/
|
|
21
|
+
turnDetection: TurnDetectionMode | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Configuration for endpointing.
|
|
24
|
+
*/
|
|
25
|
+
endpointing: Partial<EndpointingOptions>;
|
|
26
|
+
/**
|
|
27
|
+
* Configuration for interruption handling.
|
|
28
|
+
*/
|
|
29
|
+
interruption: Partial<InterruptionOptions>;
|
|
30
|
+
}
|
|
31
|
+
export interface InternalTurnHandlingOptions extends TurnHandlingOptions {
|
|
32
|
+
endpointing: EndpointingOptions;
|
|
33
|
+
interruption: InterruptionOptions;
|
|
34
|
+
}
|
|
35
|
+
export declare const defaultTurnHandlingOptions: InternalTurnHandlingOptions;
|
|
36
|
+
//# sourceMappingURL=turn_handling.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"turn_handling.d.ts","sourceRoot":"","sources":["../../../src/voice/turn_config/turn_handling.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,KAAK,kBAAkB,EAA6B,MAAM,kBAAkB,CAAC;AACtF,OAAO,EAAE,KAAK,mBAAmB,EAA8B,MAAM,mBAAmB,CAAC;AAEzF;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;;;;;;;;OAWG;IACH,aAAa,EAAE,iBAAiB,GAAG,SAAS,CAAC;IAC7C;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACzC;;OAEG;IACH,YAAY,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;CAC5C;AAED,MAAM,WAAW,2BAA4B,SAAQ,mBAAmB;IACtE,WAAW,EAAE,kBAAkB,CAAC;IAChC,YAAY,EAAE,mBAAmB,CAAC;CACnC;AAED,eAAO,MAAM,0BAA0B,EAAE,2BAIxC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { defaultEndpointingOptions } from "./endpointing.js";
|
|
2
|
+
import { defaultInterruptionOptions } from "./interruption.js";
|
|
3
|
+
const defaultTurnHandlingOptions = {
|
|
4
|
+
turnDetection: void 0,
|
|
5
|
+
interruption: defaultInterruptionOptions,
|
|
6
|
+
endpointing: defaultEndpointingOptions
|
|
7
|
+
};
|
|
8
|
+
export {
|
|
9
|
+
defaultTurnHandlingOptions
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=turn_handling.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/voice/turn_config/turn_handling.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2026 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\nimport type { TurnDetectionMode } from '../agent_session.js';\nimport { type EndpointingOptions, defaultEndpointingOptions } from './endpointing.js';\nimport { type InterruptionOptions, defaultInterruptionOptions } from './interruption.js';\n\n/**\n * Configuration for the turn handling system. Used to configure the turn taking behavior of the\n * session.\n */\nexport interface TurnHandlingOptions {\n /**\n * Strategy for deciding when the user has finished speaking.\n *\n * - `\"stt\"` – rely on speech-to-text end-of-utterance cues\n * - `\"vad\"` – rely on Voice Activity Detection start/stop cues\n * - `\"realtime_llm\"` – use server-side detection from a realtime LLM\n * - `\"manual\"` – caller controls turn boundaries explicitly\n *\n * If not set, the session chooses the best available mode in priority order\n * `realtime_llm → vad → stt → manual`; it automatically falls back if the necessary model\n * is missing.\n */\n turnDetection: TurnDetectionMode | undefined;\n /**\n * Configuration for endpointing.\n */\n endpointing: Partial<EndpointingOptions>;\n /**\n * Configuration for interruption handling.\n */\n interruption: Partial<InterruptionOptions>;\n}\n\nexport interface InternalTurnHandlingOptions extends TurnHandlingOptions {\n endpointing: EndpointingOptions;\n interruption: InterruptionOptions;\n}\n\nexport const defaultTurnHandlingOptions: InternalTurnHandlingOptions = {\n turnDetection: undefined,\n interruption: defaultInterruptionOptions,\n endpointing: defaultEndpointingOptions,\n};\n"],"mappings":"AAIA,SAAkC,iCAAiC;AACnE,SAAmC,kCAAkC;AAmC9D,MAAM,6BAA0D;AAAA,EACrE,eAAe;AAAA,EACf,cAAc;AAAA,EACd,aAAa;AACf;","names":[]}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var utils_exports = {};
|
|
20
|
+
__export(utils_exports, {
|
|
21
|
+
mergeWithDefaults: () => mergeWithDefaults,
|
|
22
|
+
migrateLegacyOptions: () => migrateLegacyOptions,
|
|
23
|
+
migrateTurnHandling: () => migrateTurnHandling,
|
|
24
|
+
stripUndefined: () => stripUndefined
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(utils_exports);
|
|
27
|
+
var import_log = require("../../log.cjs");
|
|
28
|
+
var import_agent_session = require("../agent_session.cjs");
|
|
29
|
+
var import_endpointing = require("./endpointing.cjs");
|
|
30
|
+
var import_interruption = require("./interruption.cjs");
|
|
31
|
+
var import_turn_handling = require("./turn_handling.cjs");
|
|
32
|
+
const defaultSessionOptions = {
|
|
33
|
+
maxToolSteps: 3,
|
|
34
|
+
preemptiveGeneration: true,
|
|
35
|
+
userAwayTimeout: 15,
|
|
36
|
+
aecWarmupDuration: 3e3,
|
|
37
|
+
turnHandling: {},
|
|
38
|
+
useTtsAlignedTranscript: true
|
|
39
|
+
};
|
|
40
|
+
const defaultLegacyVoiceOptions = {
|
|
41
|
+
minEndpointingDelay: import_turn_handling.defaultTurnHandlingOptions.endpointing.minDelay,
|
|
42
|
+
maxEndpointingDelay: import_turn_handling.defaultTurnHandlingOptions.endpointing.maxDelay,
|
|
43
|
+
maxToolSteps: defaultSessionOptions.maxToolSteps,
|
|
44
|
+
preemptiveGeneration: defaultSessionOptions.preemptiveGeneration
|
|
45
|
+
};
|
|
46
|
+
function migrateLegacyOptions(legacyOptions) {
|
|
47
|
+
var _a, _b, _c;
|
|
48
|
+
const logger = (0, import_log.log)();
|
|
49
|
+
const {
|
|
50
|
+
voiceOptions,
|
|
51
|
+
turnDetection,
|
|
52
|
+
stt,
|
|
53
|
+
vad,
|
|
54
|
+
llm,
|
|
55
|
+
tts,
|
|
56
|
+
userData,
|
|
57
|
+
connOptions,
|
|
58
|
+
...sessionOptions
|
|
59
|
+
} = legacyOptions;
|
|
60
|
+
if (voiceOptions !== void 0) {
|
|
61
|
+
logger.warn(
|
|
62
|
+
"voiceOptions is deprecated, use top-level SessionOptions fields on AgentSessionOptions instead"
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
const turnHandling = {
|
|
66
|
+
interruption: {
|
|
67
|
+
discardAudioIfUninterruptible: voiceOptions == null ? void 0 : voiceOptions.discardAudioIfUninterruptible,
|
|
68
|
+
minDuration: voiceOptions == null ? void 0 : voiceOptions.minInterruptionDuration,
|
|
69
|
+
minWords: voiceOptions == null ? void 0 : voiceOptions.minInterruptionWords,
|
|
70
|
+
...(_a = sessionOptions.turnHandling) == null ? void 0 : _a.interruption
|
|
71
|
+
},
|
|
72
|
+
endpointing: {
|
|
73
|
+
minDelay: voiceOptions == null ? void 0 : voiceOptions.minEndpointingDelay,
|
|
74
|
+
maxDelay: voiceOptions == null ? void 0 : voiceOptions.maxEndpointingDelay,
|
|
75
|
+
...(_b = sessionOptions.turnHandling) == null ? void 0 : _b.endpointing
|
|
76
|
+
},
|
|
77
|
+
turnDetection: ((_c = sessionOptions == null ? void 0 : sessionOptions.turnHandling) == null ? void 0 : _c.turnDetection) ?? turnDetection
|
|
78
|
+
};
|
|
79
|
+
if ((voiceOptions == null ? void 0 : voiceOptions.allowInterruptions) === false && turnHandling.interruption.enabled === void 0) {
|
|
80
|
+
turnHandling.interruption.enabled = false;
|
|
81
|
+
}
|
|
82
|
+
const migratedVoiceOptions = {};
|
|
83
|
+
if ((voiceOptions == null ? void 0 : voiceOptions.maxToolSteps) !== void 0) {
|
|
84
|
+
migratedVoiceOptions.maxToolSteps = voiceOptions.maxToolSteps;
|
|
85
|
+
}
|
|
86
|
+
if ((voiceOptions == null ? void 0 : voiceOptions.preemptiveGeneration) !== void 0) {
|
|
87
|
+
migratedVoiceOptions.preemptiveGeneration = voiceOptions.preemptiveGeneration;
|
|
88
|
+
}
|
|
89
|
+
if ((voiceOptions == null ? void 0 : voiceOptions.userAwayTimeout) !== void 0) {
|
|
90
|
+
migratedVoiceOptions.userAwayTimeout = voiceOptions.userAwayTimeout;
|
|
91
|
+
}
|
|
92
|
+
const legacyVoiceOptions = { ...defaultLegacyVoiceOptions, ...voiceOptions };
|
|
93
|
+
const agentSessionOptions = {
|
|
94
|
+
stt,
|
|
95
|
+
vad,
|
|
96
|
+
llm,
|
|
97
|
+
tts,
|
|
98
|
+
userData,
|
|
99
|
+
connOptions,
|
|
100
|
+
...defaultSessionOptions,
|
|
101
|
+
...migratedVoiceOptions,
|
|
102
|
+
...sessionOptions,
|
|
103
|
+
turnHandling: mergeWithDefaults(turnHandling),
|
|
104
|
+
// repopulate the deprecated voice options with migrated options for backwards compatibility
|
|
105
|
+
voiceOptions: legacyVoiceOptions
|
|
106
|
+
};
|
|
107
|
+
return { agentSessionOptions, legacyVoiceOptions };
|
|
108
|
+
}
|
|
109
|
+
function stripUndefined(obj) {
|
|
110
|
+
return Object.fromEntries(Object.entries(obj).filter(([, v]) => v !== void 0));
|
|
111
|
+
}
|
|
112
|
+
function mergeWithDefaults(config) {
|
|
113
|
+
return {
|
|
114
|
+
turnDetection: config.turnDetection ?? import_turn_handling.defaultTurnHandlingOptions.turnDetection,
|
|
115
|
+
endpointing: { ...import_endpointing.defaultEndpointingOptions, ...stripUndefined(config.endpointing) },
|
|
116
|
+
interruption: { ...import_interruption.defaultInterruptionOptions, ...stripUndefined(config.interruption) }
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
function migrateTurnHandling(opts) {
|
|
120
|
+
if (opts.turnHandling !== void 0) {
|
|
121
|
+
return opts.turnHandling;
|
|
122
|
+
}
|
|
123
|
+
const migrated = {};
|
|
124
|
+
const endpointing = {};
|
|
125
|
+
if (opts.minEndpointingDelay !== void 0) {
|
|
126
|
+
endpointing.minDelay = opts.minEndpointingDelay;
|
|
127
|
+
}
|
|
128
|
+
if (opts.maxEndpointingDelay !== void 0) {
|
|
129
|
+
endpointing.maxDelay = opts.maxEndpointingDelay;
|
|
130
|
+
}
|
|
131
|
+
if (Object.keys(endpointing).length > 0) {
|
|
132
|
+
migrated.endpointing = endpointing;
|
|
133
|
+
}
|
|
134
|
+
const interruption = {};
|
|
135
|
+
if (opts.allowInterruptions === false) {
|
|
136
|
+
interruption.enabled = false;
|
|
137
|
+
}
|
|
138
|
+
if (Object.keys(interruption).length > 0) {
|
|
139
|
+
migrated.interruption = interruption;
|
|
140
|
+
}
|
|
141
|
+
if (opts.turnDetection !== void 0) {
|
|
142
|
+
migrated.turnDetection = opts.turnDetection;
|
|
143
|
+
}
|
|
144
|
+
return {
|
|
145
|
+
...migrated.endpointing ? { endpointing: migrated.endpointing } : {},
|
|
146
|
+
...migrated.interruption ? { interruption: migrated.interruption } : {},
|
|
147
|
+
...migrated.turnDetection !== void 0 ? { turnDetection: migrated.turnDetection } : {}
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
151
|
+
0 && (module.exports = {
|
|
152
|
+
mergeWithDefaults,
|
|
153
|
+
migrateLegacyOptions,
|
|
154
|
+
migrateTurnHandling,
|
|
155
|
+
stripUndefined
|
|
156
|
+
});
|
|
157
|
+
//# sourceMappingURL=utils.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/voice/turn_config/utils.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2026 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\nimport { log } from '../../log.js';\nimport {\n type AgentSessionOptions,\n type InternalSessionOptions,\n type TurnDetectionMode,\n type VoiceOptions,\n} from '../agent_session.js';\nimport { defaultEndpointingOptions } from './endpointing.js';\nimport { defaultInterruptionOptions } from './interruption.js';\nimport { type TurnHandlingOptions, defaultTurnHandlingOptions } from './turn_handling.js';\n\nconst defaultSessionOptions = {\n maxToolSteps: 3,\n preemptiveGeneration: true,\n userAwayTimeout: 15.0,\n aecWarmupDuration: 3000,\n turnHandling: {},\n useTtsAlignedTranscript: true,\n} as const satisfies AgentSessionOptions;\n\nconst defaultLegacyVoiceOptions: VoiceOptions = {\n minEndpointingDelay: defaultTurnHandlingOptions.endpointing.minDelay,\n maxEndpointingDelay: defaultTurnHandlingOptions.endpointing.maxDelay,\n maxToolSteps: defaultSessionOptions.maxToolSteps,\n preemptiveGeneration: defaultSessionOptions.preemptiveGeneration,\n};\n\nexport function migrateLegacyOptions<UserData>(legacyOptions: AgentSessionOptions<UserData>): {\n agentSessionOptions: InternalSessionOptions<UserData>;\n legacyVoiceOptions: VoiceOptions;\n} {\n const logger = log();\n const {\n voiceOptions,\n turnDetection,\n stt,\n vad,\n llm,\n tts,\n userData,\n connOptions,\n ...sessionOptions\n } = legacyOptions;\n\n if (voiceOptions !== undefined) {\n logger.warn(\n 'voiceOptions is deprecated, use top-level SessionOptions fields on AgentSessionOptions instead',\n );\n }\n\n const turnHandling: TurnHandlingOptions = {\n interruption: {\n discardAudioIfUninterruptible: voiceOptions?.discardAudioIfUninterruptible,\n minDuration: voiceOptions?.minInterruptionDuration,\n minWords: voiceOptions?.minInterruptionWords,\n ...sessionOptions.turnHandling?.interruption,\n },\n endpointing: {\n minDelay: voiceOptions?.minEndpointingDelay,\n maxDelay: voiceOptions?.maxEndpointingDelay,\n ...sessionOptions.turnHandling?.endpointing,\n },\n\n turnDetection: sessionOptions?.turnHandling?.turnDetection ?? turnDetection,\n } as const;\n\n if (\n voiceOptions?.allowInterruptions === false &&\n turnHandling.interruption.enabled === undefined\n ) {\n turnHandling.interruption.enabled = false;\n }\n\n const migratedVoiceOptions: AgentSessionOptions<UserData> = {};\n\n if (voiceOptions?.maxToolSteps !== undefined) {\n migratedVoiceOptions.maxToolSteps = voiceOptions.maxToolSteps;\n }\n if (voiceOptions?.preemptiveGeneration !== undefined) {\n migratedVoiceOptions.preemptiveGeneration = voiceOptions.preemptiveGeneration;\n }\n if (voiceOptions?.userAwayTimeout !== undefined) {\n migratedVoiceOptions.userAwayTimeout = voiceOptions.userAwayTimeout;\n }\n\n const legacyVoiceOptions = { ...defaultLegacyVoiceOptions, ...voiceOptions };\n\n const agentSessionOptions = {\n stt,\n vad,\n llm,\n tts,\n userData,\n connOptions,\n ...defaultSessionOptions,\n ...migratedVoiceOptions,\n ...sessionOptions,\n turnHandling: mergeWithDefaults(turnHandling),\n // repopulate the deprecated voice options with migrated options for backwards compatibility\n voiceOptions: legacyVoiceOptions,\n };\n\n return { agentSessionOptions, legacyVoiceOptions };\n}\n\n/** Remove keys whose value is `undefined` so they don't shadow defaults when spread. */\nexport function stripUndefined<T extends object>(obj: T): Partial<T> {\n return Object.fromEntries(Object.entries(obj).filter(([, v]) => v !== undefined)) as Partial<T>;\n}\n\nexport function mergeWithDefaults(config: TurnHandlingOptions) {\n return {\n turnDetection: config.turnDetection ?? defaultTurnHandlingOptions.turnDetection,\n endpointing: { ...defaultEndpointingOptions, ...stripUndefined(config.endpointing) },\n interruption: { ...defaultInterruptionOptions, ...stripUndefined(config.interruption) },\n } as const;\n}\n\n/**\n * Build a partial {@link TurnHandlingOptions} from deprecated Agent constructor fields.\n * Mirrors the Python Agent compatibility path, but keeps the JS API surface explicit.\n */\nexport function migrateTurnHandling(opts: {\n turnDetection?: TurnDetectionMode;\n allowInterruptions?: boolean;\n minEndpointingDelay?: number;\n maxEndpointingDelay?: number;\n turnHandling?: TurnHandlingOptions;\n}): Partial<TurnHandlingOptions> {\n if (opts.turnHandling !== undefined) {\n return opts.turnHandling;\n }\n\n const migrated: Partial<TurnHandlingOptions> = {};\n\n const endpointing: Partial<TurnHandlingOptions['endpointing']> = {};\n if (opts.minEndpointingDelay !== undefined) {\n endpointing.minDelay = opts.minEndpointingDelay;\n }\n if (opts.maxEndpointingDelay !== undefined) {\n endpointing.maxDelay = opts.maxEndpointingDelay;\n }\n if (Object.keys(endpointing).length > 0) {\n migrated.endpointing = endpointing;\n }\n\n const interruption: Partial<TurnHandlingOptions['interruption']> = {};\n if (opts.allowInterruptions === false) {\n interruption.enabled = false;\n }\n if (Object.keys(interruption).length > 0) {\n migrated.interruption = interruption;\n }\n\n if (opts.turnDetection !== undefined) {\n migrated.turnDetection = opts.turnDetection;\n }\n\n return {\n ...(migrated.endpointing ? { endpointing: migrated.endpointing } : {}),\n ...(migrated.interruption ? { interruption: migrated.interruption } : {}),\n ...(migrated.turnDetection !== undefined ? { turnDetection: migrated.turnDetection } : {}),\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,iBAAoB;AACpB,2BAKO;AACP,yBAA0C;AAC1C,0BAA2C;AAC3C,2BAAqE;AAErE,MAAM,wBAAwB;AAAA,EAC5B,cAAc;AAAA,EACd,sBAAsB;AAAA,EACtB,iBAAiB;AAAA,EACjB,mBAAmB;AAAA,EACnB,cAAc,CAAC;AAAA,EACf,yBAAyB;AAC3B;AAEA,MAAM,4BAA0C;AAAA,EAC9C,qBAAqB,gDAA2B,YAAY;AAAA,EAC5D,qBAAqB,gDAA2B,YAAY;AAAA,EAC5D,cAAc,sBAAsB;AAAA,EACpC,sBAAsB,sBAAsB;AAC9C;AAEO,SAAS,qBAA+B,eAG7C;AAjCF;AAkCE,QAAM,aAAS,gBAAI;AACnB,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,IAAI;AAEJ,MAAI,iBAAiB,QAAW;AAC9B,WAAO;AAAA,MACL;AAAA,IACF;AAAA,EACF;AAEA,QAAM,eAAoC;AAAA,IACxC,cAAc;AAAA,MACZ,+BAA+B,6CAAc;AAAA,MAC7C,aAAa,6CAAc;AAAA,MAC3B,UAAU,6CAAc;AAAA,MACxB,IAAG,oBAAe,iBAAf,mBAA6B;AAAA,IAClC;AAAA,IACA,aAAa;AAAA,MACX,UAAU,6CAAc;AAAA,MACxB,UAAU,6CAAc;AAAA,MACxB,IAAG,oBAAe,iBAAf,mBAA6B;AAAA,IAClC;AAAA,IAEA,iBAAe,sDAAgB,iBAAhB,mBAA8B,kBAAiB;AAAA,EAChE;AAEA,OACE,6CAAc,wBAAuB,SACrC,aAAa,aAAa,YAAY,QACtC;AACA,iBAAa,aAAa,UAAU;AAAA,EACtC;AAEA,QAAM,uBAAsD,CAAC;AAE7D,OAAI,6CAAc,kBAAiB,QAAW;AAC5C,yBAAqB,eAAe,aAAa;AAAA,EACnD;AACA,OAAI,6CAAc,0BAAyB,QAAW;AACpD,yBAAqB,uBAAuB,aAAa;AAAA,EAC3D;AACA,OAAI,6CAAc,qBAAoB,QAAW;AAC/C,yBAAqB,kBAAkB,aAAa;AAAA,EACtD;AAEA,QAAM,qBAAqB,EAAE,GAAG,2BAA2B,GAAG,aAAa;AAE3E,QAAM,sBAAsB;AAAA,IAC1B;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH,cAAc,kBAAkB,YAAY;AAAA;AAAA,IAE5C,cAAc;AAAA,EAChB;AAEA,SAAO,EAAE,qBAAqB,mBAAmB;AACnD;AAGO,SAAS,eAAiC,KAAoB;AACnE,SAAO,OAAO,YAAY,OAAO,QAAQ,GAAG,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,MAAM,MAAM,MAAS,CAAC;AAClF;AAEO,SAAS,kBAAkB,QAA6B;AAC7D,SAAO;AAAA,IACL,eAAe,OAAO,iBAAiB,gDAA2B;AAAA,IAClE,aAAa,EAAE,GAAG,8CAA2B,GAAG,eAAe,OAAO,WAAW,EAAE;AAAA,IACnF,cAAc,EAAE,GAAG,gDAA4B,GAAG,eAAe,OAAO,YAAY,EAAE;AAAA,EACxF;AACF;AAMO,SAAS,oBAAoB,MAMH;AAC/B,MAAI,KAAK,iBAAiB,QAAW;AACnC,WAAO,KAAK;AAAA,EACd;AAEA,QAAM,WAAyC,CAAC;AAEhD,QAAM,cAA2D,CAAC;AAClE,MAAI,KAAK,wBAAwB,QAAW;AAC1C,gBAAY,WAAW,KAAK;AAAA,EAC9B;AACA,MAAI,KAAK,wBAAwB,QAAW;AAC1C,gBAAY,WAAW,KAAK;AAAA,EAC9B;AACA,MAAI,OAAO,KAAK,WAAW,EAAE,SAAS,GAAG;AACvC,aAAS,cAAc;AAAA,EACzB;AAEA,QAAM,eAA6D,CAAC;AACpE,MAAI,KAAK,uBAAuB,OAAO;AACrC,iBAAa,UAAU;AAAA,EACzB;AACA,MAAI,OAAO,KAAK,YAAY,EAAE,SAAS,GAAG;AACxC,aAAS,eAAe;AAAA,EAC1B;AAEA,MAAI,KAAK,kBAAkB,QAAW;AACpC,aAAS,gBAAgB,KAAK;AAAA,EAChC;AAEA,SAAO;AAAA,IACL,GAAI,SAAS,cAAc,EAAE,aAAa,SAAS,YAAY,IAAI,CAAC;AAAA,IACpE,GAAI,SAAS,eAAe,EAAE,cAAc,SAAS,aAAa,IAAI,CAAC;AAAA,IACvE,GAAI,SAAS,kBAAkB,SAAY,EAAE,eAAe,SAAS,cAAc,IAAI,CAAC;AAAA,EAC1F;AACF;","names":[]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type AgentSessionOptions, type InternalSessionOptions, type TurnDetectionMode, type VoiceOptions } from '../agent_session.js';
|
|
2
|
+
import { type TurnHandlingOptions } from './turn_handling.js';
|
|
3
|
+
export declare function migrateLegacyOptions<UserData>(legacyOptions: AgentSessionOptions<UserData>): {
|
|
4
|
+
agentSessionOptions: InternalSessionOptions<UserData>;
|
|
5
|
+
legacyVoiceOptions: VoiceOptions;
|
|
6
|
+
};
|
|
7
|
+
/** Remove keys whose value is `undefined` so they don't shadow defaults when spread. */
|
|
8
|
+
export declare function stripUndefined<T extends object>(obj: T): Partial<T>;
|
|
9
|
+
export declare function mergeWithDefaults(config: TurnHandlingOptions): {
|
|
10
|
+
readonly turnDetection: TurnDetectionMode | undefined;
|
|
11
|
+
readonly endpointing: {
|
|
12
|
+
mode: "fixed" | "dynamic";
|
|
13
|
+
minDelay: number;
|
|
14
|
+
maxDelay: number;
|
|
15
|
+
};
|
|
16
|
+
readonly interruption: {
|
|
17
|
+
enabled: boolean;
|
|
18
|
+
mode: "vad" | "adaptive" | undefined;
|
|
19
|
+
discardAudioIfUninterruptible: boolean;
|
|
20
|
+
minDuration: number;
|
|
21
|
+
minWords: number;
|
|
22
|
+
falseInterruptionTimeout: number;
|
|
23
|
+
resumeFalseInterruption: boolean;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Build a partial {@link TurnHandlingOptions} from deprecated Agent constructor fields.
|
|
28
|
+
* Mirrors the Python Agent compatibility path, but keeps the JS API surface explicit.
|
|
29
|
+
*/
|
|
30
|
+
export declare function migrateTurnHandling(opts: {
|
|
31
|
+
turnDetection?: TurnDetectionMode;
|
|
32
|
+
allowInterruptions?: boolean;
|
|
33
|
+
minEndpointingDelay?: number;
|
|
34
|
+
maxEndpointingDelay?: number;
|
|
35
|
+
turnHandling?: TurnHandlingOptions;
|
|
36
|
+
}): Partial<TurnHandlingOptions>;
|
|
37
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type AgentSessionOptions, type InternalSessionOptions, type TurnDetectionMode, type VoiceOptions } from '../agent_session.js';
|
|
2
|
+
import { type TurnHandlingOptions } from './turn_handling.js';
|
|
3
|
+
export declare function migrateLegacyOptions<UserData>(legacyOptions: AgentSessionOptions<UserData>): {
|
|
4
|
+
agentSessionOptions: InternalSessionOptions<UserData>;
|
|
5
|
+
legacyVoiceOptions: VoiceOptions;
|
|
6
|
+
};
|
|
7
|
+
/** Remove keys whose value is `undefined` so they don't shadow defaults when spread. */
|
|
8
|
+
export declare function stripUndefined<T extends object>(obj: T): Partial<T>;
|
|
9
|
+
export declare function mergeWithDefaults(config: TurnHandlingOptions): {
|
|
10
|
+
readonly turnDetection: TurnDetectionMode | undefined;
|
|
11
|
+
readonly endpointing: {
|
|
12
|
+
mode: "fixed" | "dynamic";
|
|
13
|
+
minDelay: number;
|
|
14
|
+
maxDelay: number;
|
|
15
|
+
};
|
|
16
|
+
readonly interruption: {
|
|
17
|
+
enabled: boolean;
|
|
18
|
+
mode: "vad" | "adaptive" | undefined;
|
|
19
|
+
discardAudioIfUninterruptible: boolean;
|
|
20
|
+
minDuration: number;
|
|
21
|
+
minWords: number;
|
|
22
|
+
falseInterruptionTimeout: number;
|
|
23
|
+
resumeFalseInterruption: boolean;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Build a partial {@link TurnHandlingOptions} from deprecated Agent constructor fields.
|
|
28
|
+
* Mirrors the Python Agent compatibility path, but keeps the JS API surface explicit.
|
|
29
|
+
*/
|
|
30
|
+
export declare function migrateTurnHandling(opts: {
|
|
31
|
+
turnDetection?: TurnDetectionMode;
|
|
32
|
+
allowInterruptions?: boolean;
|
|
33
|
+
minEndpointingDelay?: number;
|
|
34
|
+
maxEndpointingDelay?: number;
|
|
35
|
+
turnHandling?: TurnHandlingOptions;
|
|
36
|
+
}): Partial<TurnHandlingOptions>;
|
|
37
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/voice/turn_config/utils.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,YAAY,EAClB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,KAAK,mBAAmB,EAA8B,MAAM,oBAAoB,CAAC;AAkB1F,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,aAAa,EAAE,mBAAmB,CAAC,QAAQ,CAAC,GAAG;IAC5F,mBAAmB,EAAE,sBAAsB,CAAC,QAAQ,CAAC,CAAC;IACtD,kBAAkB,EAAE,YAAY,CAAC;CAClC,CAyEA;AAED,wFAAwF;AACxF,wBAAgB,cAAc,CAAC,CAAC,SAAS,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAEnE;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,mBAAmB;;;;;;;;;;;;;;;;EAM5D;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE;IACxC,aAAa,CAAC,EAAE,iBAAiB,CAAC;IAClC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,YAAY,CAAC,EAAE,mBAAmB,CAAC;CACpC,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAmC/B"}
|