@jambonz/sdk 0.10.1 → 0.12.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 (35) hide show
  1. package/dist/client/index.cjs +4 -0
  2. package/dist/client/index.cjs.map +1 -1
  3. package/dist/client/index.d.cts +4 -2
  4. package/dist/client/index.d.ts +4 -2
  5. package/dist/client/index.js +4 -0
  6. package/dist/client/index.js.map +1 -1
  7. package/dist/index.cjs +38 -0
  8. package/dist/index.cjs.map +1 -1
  9. package/dist/index.d.cts +4 -4
  10. package/dist/index.d.ts +4 -4
  11. package/dist/index.js +38 -0
  12. package/dist/index.js.map +1 -1
  13. package/dist/{rest-xZDo1JK7.d.cts → rest-0m9Hgjmn.d.cts} +29 -2
  14. package/dist/{rest-vYKAkq-I.d.ts → rest-CqS2POQv.d.ts} +29 -2
  15. package/dist/types/index.d.cts +163 -3
  16. package/dist/types/index.d.ts +163 -3
  17. package/dist/{verb-builder-QI7NMTys.d.ts → verb-builder-C1id83_f.d.cts} +4 -1
  18. package/dist/{verb-builder-B4MYgXyR.d.cts → verb-builder-YFevoXCs.d.ts} +4 -1
  19. package/dist/{verbs-DXiMUUe9.d.cts → verbs-DQ6zJ0bn.d.cts} +41 -2
  20. package/dist/{verbs-DXiMUUe9.d.ts → verbs-DQ6zJ0bn.d.ts} +41 -2
  21. package/dist/webhook/index.cjs +9 -0
  22. package/dist/webhook/index.cjs.map +1 -1
  23. package/dist/webhook/index.d.cts +2 -2
  24. package/dist/webhook/index.d.ts +2 -2
  25. package/dist/webhook/index.js +9 -0
  26. package/dist/webhook/index.js.map +1 -1
  27. package/dist/websocket/index.cjs +34 -0
  28. package/dist/websocket/index.cjs.map +1 -1
  29. package/dist/websocket/index.d.cts +14 -3
  30. package/dist/websocket/index.d.ts +14 -3
  31. package/dist/websocket/index.js +34 -0
  32. package/dist/websocket/index.js.map +1 -1
  33. package/package.json +2 -2
  34. package/dist/session-DKaSRkIo.d.cts +0 -160
  35. package/dist/session-DKaSRkIo.d.ts +0 -160
@@ -1,4 +1,4 @@
1
- import { A as ActionHook, _ as Verb, S as SayVerb, Y as TransferVerb } from './verbs-DXiMUUe9.js';
1
+ import { A as ActionHook, _ as Verb, S as SayVerb, Y as TransferVerb } from './verbs-DQ6zJ0bn.js';
2
2
 
3
3
  /**
4
4
  * Types for the jambonz REST API client.
@@ -130,6 +130,8 @@ interface UpdateCallRequest {
130
130
  transfer?: Omit<TransferVerb, 'verb'>;
131
131
  /** Tag metadata. */
132
132
  tag?: Record<string, unknown>;
133
+ /** Send input into a running Dialogflow CES session. */
134
+ dialogflow_update?: DialogflowUpdate;
133
135
  /** Mid-conversation agent update. */
134
136
  agent_update?: {
135
137
  type: 'update_instructions' | 'inject_context' | 'update_tools' | 'generate_reply';
@@ -143,6 +145,31 @@ interface UpdateCallRequest {
143
145
  interrupt?: boolean;
144
146
  };
145
147
  }
148
+ /**
149
+ * Input for a running Dialogflow CES session (`dialogflow:update` command /
150
+ * `dialogflow_update` call-update key). At most one of `event`, `text`, `dtmf`,
151
+ * plus optional `variables`; at least one field is required.
152
+ */
153
+ type DialogflowUpdate = {
154
+ variables?: Record<string, unknown>;
155
+ } & ({
156
+ event: string;
157
+ text?: never;
158
+ dtmf?: never;
159
+ } | {
160
+ text: string;
161
+ event?: never;
162
+ dtmf?: never;
163
+ } | {
164
+ dtmf: string;
165
+ event?: never;
166
+ text?: never;
167
+ } | {
168
+ variables: Record<string, unknown>;
169
+ event?: never;
170
+ text?: never;
171
+ dtmf?: never;
172
+ });
146
173
  interface ListCallsFilter {
147
174
  /** Filter by call direction. */
148
175
  direction?: 'inbound' | 'outbound';
@@ -179,4 +206,4 @@ interface QueueInfo {
179
206
  length: string;
180
207
  }
181
208
 
182
- export type { CallCount as C, ListCallsFilter as L, QueueInfo as Q, UpdateCallRequest as U, CallInfo as a, CreateCallRequest as b };
209
+ export type { CallCount as C, DialogflowUpdate as D, ListCallsFilter as L, QueueInfo as Q, UpdateCallRequest as U, CallInfo as a, CreateCallRequest as b };
@@ -1,4 +1,164 @@
1
- export { A as ActionHook, a as ActionHookDelayAction, b as ActionHookObject, c as AgentLlm, d as AgentLlmOptions, e as AgentVerb, f as AlertVerb, g as Amd, h as AmdTimers, i as AnswerVerb, j as Auth, B as BidirectionalAudio, C as ConferenceVerb, k as ConfigVerb, D as DequeueVerb, l as DialVerb, m as DtmfVerb, n as DubVerb, E as EnqueueVerb, F as FillerNoise, G as GatherVerb, H as Handoff, o as HangupVerb, J as JambonzApp, L as LeaveVerb, p as ListenVerb, q as LlmMessage, r as LlmTool, s as LlmToolOpenAIWrapped, t as LlmToolOutputData, u as LlmVendor, v as LlmVerb, M as McpServerConfig, w as MessageVerb, P as PauseVerb, x as PlayVerb, R as Recognizer, y as RedirectVerb, S as SayVerb, z as SipDeclineVerb, I as SipReferVerb, K as SipRequestVerb, N as StreamVerb, O as Synthesizer, T as TagVerb, Q as Target, U as TranscribeVerb, V as TransferConfirm, W as TransferDisposition, X as TransferOptions, Y as TransferVerb, Z as Vad, _ as Verb, $ as VerbName } from '../verbs-DXiMUUe9.cjs';
2
- export { A as AgentEvent, a as AgentEventType, b as AgentLlmResponseEvent, c as AgentPreflightMetrics, d as AgentTurnEndEvent, e as AgentTurnLatency, f as AgentUserInterruptionEvent, g as AgentUserTranscriptEvent, C as CallSession, T as TtsStreamingEvent, h as TtsStreamingEventType, W as WsMessage, i as WsMessageType, j as WsResponse } from '../session-DKaSRkIo.cjs';
1
+ export { A as ActionHook, a as ActionHookDelayAction, b as ActionHookObject, c as AgentLlm, d as AgentLlmOptions, e as AgentVerb, f as AlertVerb, g as Amd, h as AmdTimers, i as AnswerVerb, j as Auth, B as BidirectionalAudio, C as ConferenceVerb, k as ConfigVerb, D as DequeueVerb, l as DialVerb, m as DtmfVerb, n as DubVerb, E as EnqueueVerb, F as FillerNoise, G as GatherVerb, H as Handoff, o as HangupVerb, J as JambonzApp, L as LeaveVerb, p as ListenVerb, q as LlmMessage, r as LlmTool, s as LlmToolOpenAIWrapped, t as LlmToolOutputData, u as LlmVendor, v as LlmVerb, M as McpServerConfig, w as MessageVerb, P as PauseVerb, x as PlayVerb, R as Recognizer, y as RedirectVerb, S as SayVerb, z as SipDeclineVerb, I as SipReferVerb, K as SipRequestVerb, N as StreamVerb, O as Synthesizer, T as TagVerb, Q as Target, U as TranscribeVerb, V as TransferConfirm, W as TransferDisposition, X as TransferOptions, Y as TransferVerb, Z as Vad, _ as Verb, $ as VerbName } from '../verbs-DQ6zJ0bn.cjs';
3
2
  export { E as EnvVarDef, a as EnvVarSchema, L as Logger } from '../common-BSJZX7WO.cjs';
4
- export { C as CallCount, a as CallInfo, b as CreateCallRequest, L as ListCallsFilter, Q as QueueInfo, U as UpdateCallRequest } from '../rest-xZDo1JK7.cjs';
3
+ export { C as CallCount, a as CallInfo, b as CreateCallRequest, D as DialogflowUpdate, L as ListCallsFilter, Q as QueueInfo, U as UpdateCallRequest } from '../rest-0m9Hgjmn.cjs';
4
+
5
+ /**
6
+ * Types for call session data received from jambonz.
7
+ */
8
+ /** Call session data provided in webhook requests and WebSocket session:new messages. */
9
+ interface CallSession {
10
+ /** Unique call identifier. */
11
+ call_sid: string;
12
+ /** Account identifier. */
13
+ account_sid: string;
14
+ /** Application identifier. */
15
+ application_sid: string;
16
+ /** Call direction. */
17
+ direction: 'inbound' | 'outbound';
18
+ /** Caller phone number or SIP URI. */
19
+ from: string;
20
+ /** Called phone number or SIP URI. */
21
+ to: string;
22
+ /** SIP Call-ID header. */
23
+ call_id: string;
24
+ /** SIP response status code. */
25
+ sip_status: number;
26
+ /** SIP reason phrase. */
27
+ sip_reason?: string;
28
+ /** Caller display name from the SIP From header. */
29
+ caller_name?: string;
30
+ /** Caller ID value (phone number or SIP user). */
31
+ caller_id?: string;
32
+ /** Call status. */
33
+ call_status?: string;
34
+ /** Name of the originating SIP trunk as configured in jambonz. */
35
+ originating_sip_trunk_name?: string;
36
+ /** IP address of the originating SIP trunk. */
37
+ originating_sip_ip?: string;
38
+ /** Service provider SID. */
39
+ service_provider_sid?: string;
40
+ /** Distributed tracing ID. */
41
+ trace_id?: string;
42
+ /** Call SID of the parent call (present for adulting / child call scenarios). */
43
+ parent_call_sid?: string;
44
+ /** jambonz REST API base URL for mid-call control. */
45
+ api_base_url?: string;
46
+ /**
47
+ * Raw SIP INVITE message (drachtio SipRequest, serialized).
48
+ * Only present for WebSocket and HTTP POST transports.
49
+ * See https://drachtio.org/api#sip-request for the full API.
50
+ */
51
+ sip?: {
52
+ /** SIP headers as key-value pairs. Custom X-* headers are included. */
53
+ headers: Record<string, string>;
54
+ /** SIP message body (typically SDP). */
55
+ body?: string;
56
+ /** SIP method (always 'INVITE' for session:new). */
57
+ method?: string;
58
+ /** Request-URI from the SIP INVITE. */
59
+ uri?: string;
60
+ /** Phone number extracted from the Request-URI. */
61
+ calledNumber?: string;
62
+ /** Calling phone number from P-Asserted-Identity or From header. */
63
+ callingNumber?: string;
64
+ /** Transport protocol (e.g. 'udp', 'tcp', 'tls'). */
65
+ protocol?: string;
66
+ /** IP address of the sender. */
67
+ source_address?: string;
68
+ /** Port of the sender. */
69
+ source_port?: string | number;
70
+ };
71
+ /** Application environment variables configured in the jambonz portal. */
72
+ env_vars?: Record<string, string>;
73
+ /** Default speech settings for the account. */
74
+ defaults?: {
75
+ synthesizer?: {
76
+ vendor?: string;
77
+ language?: string;
78
+ voice?: string;
79
+ };
80
+ recognizer?: {
81
+ vendor?: string;
82
+ language?: string;
83
+ };
84
+ };
85
+ /** Custom data attached via the REST API when creating an outbound call. */
86
+ customerData?: Record<string, unknown>;
87
+ /** Additional properties. */
88
+ [key: string]: unknown;
89
+ }
90
+ /** TTS streaming event types sent by jambonz. */
91
+ type TtsStreamingEventType = 'stream_open' | 'stream_paused' | 'stream_resumed' | 'stream_closed' | 'user_interruption' | 'tts_spoken';
92
+ /** Payload for tts:streaming-event messages. */
93
+ interface TtsStreamingEvent {
94
+ event_type: TtsStreamingEventType;
95
+ /** The actual text spoken via TTS (present for tts_spoken events). */
96
+ text?: string;
97
+ /** Whether the user interrupted the TTS playout (present for tts_spoken events). */
98
+ bargein?: boolean;
99
+ }
100
+ /** WebSocket message types received from jambonz. */
101
+ type WsMessageType = 'session:new' | 'session:adulting' | 'session:reconnect' | 'session:redirect' | 'verb:hook' | 'dial:confirm' | 'call:status' | 'verb:status' | 'llm:event' | 'llm:tool-call' | 'agent:event' | 'agent:tool-call' | 'tts:streaming-event' | 'tts:tokens-result' | 'jambonz:error';
102
+ /** Agent eventHook event types. */
103
+ type AgentEventType = 'turn_end' | 'user_transcript' | 'llm_response' | 'user_interruption';
104
+ /** Preflight (early generation) metrics. */
105
+ interface AgentPreflightMetrics {
106
+ result: 'hit' | 'miss' | 'pending';
107
+ tokens?: number;
108
+ }
109
+ /** Per-turn latency metrics (all values in milliseconds). */
110
+ interface AgentTurnLatency {
111
+ /** STT processing latency: stop talking to final transcript received. */
112
+ transcriber_latency?: number;
113
+ /** Additional wait after transcript for end-of-turn detection. */
114
+ turn_detection_latency?: number;
115
+ /** LLM latency: wait for first token after ready to prompt. Absent on preflight hit. */
116
+ model_latency?: number;
117
+ /** TTS engine latency: first text sent to TTS until first audio received. */
118
+ voice_latency?: number;
119
+ /** Early generation metrics. */
120
+ preflight?: AgentPreflightMetrics;
121
+ }
122
+ /** Payload for agent:event turn_end messages. */
123
+ interface AgentTurnEndEvent {
124
+ type: 'turn_end';
125
+ transcript: string;
126
+ response: string;
127
+ interrupted: boolean;
128
+ latency: AgentTurnLatency;
129
+ }
130
+ /** Payload for agent:event user_transcript messages. */
131
+ interface AgentUserTranscriptEvent {
132
+ type: 'user_transcript';
133
+ transcript: string;
134
+ }
135
+ /** Payload for agent:event llm_response messages. */
136
+ interface AgentLlmResponseEvent {
137
+ type: 'llm_response';
138
+ response: string;
139
+ }
140
+ /** Payload for agent:event user_interruption messages. */
141
+ interface AgentUserInterruptionEvent {
142
+ type: 'user_interruption';
143
+ }
144
+ /** Union of all agent eventHook payloads. */
145
+ type AgentEvent = AgentTurnEndEvent | AgentUserTranscriptEvent | AgentLlmResponseEvent | AgentUserInterruptionEvent;
146
+ /** Inbound WebSocket message from jambonz. */
147
+ interface WsMessage {
148
+ type: WsMessageType;
149
+ msgid: string;
150
+ call_sid?: string;
151
+ hook?: string;
152
+ data?: Record<string, unknown>;
153
+ b3?: string;
154
+ }
155
+ /** Outbound WebSocket message to jambonz. */
156
+ interface WsResponse {
157
+ type: 'ack' | 'command';
158
+ msgid?: string;
159
+ command?: string;
160
+ queueCommand?: boolean;
161
+ data?: unknown;
162
+ }
163
+
164
+ export type { AgentEvent, AgentEventType, AgentLlmResponseEvent, AgentPreflightMetrics, AgentTurnEndEvent, AgentTurnLatency, AgentUserInterruptionEvent, AgentUserTranscriptEvent, CallSession, TtsStreamingEvent, TtsStreamingEventType, WsMessage, WsMessageType, WsResponse };
@@ -1,4 +1,164 @@
1
- export { A as ActionHook, a as ActionHookDelayAction, b as ActionHookObject, c as AgentLlm, d as AgentLlmOptions, e as AgentVerb, f as AlertVerb, g as Amd, h as AmdTimers, i as AnswerVerb, j as Auth, B as BidirectionalAudio, C as ConferenceVerb, k as ConfigVerb, D as DequeueVerb, l as DialVerb, m as DtmfVerb, n as DubVerb, E as EnqueueVerb, F as FillerNoise, G as GatherVerb, H as Handoff, o as HangupVerb, J as JambonzApp, L as LeaveVerb, p as ListenVerb, q as LlmMessage, r as LlmTool, s as LlmToolOpenAIWrapped, t as LlmToolOutputData, u as LlmVendor, v as LlmVerb, M as McpServerConfig, w as MessageVerb, P as PauseVerb, x as PlayVerb, R as Recognizer, y as RedirectVerb, S as SayVerb, z as SipDeclineVerb, I as SipReferVerb, K as SipRequestVerb, N as StreamVerb, O as Synthesizer, T as TagVerb, Q as Target, U as TranscribeVerb, V as TransferConfirm, W as TransferDisposition, X as TransferOptions, Y as TransferVerb, Z as Vad, _ as Verb, $ as VerbName } from '../verbs-DXiMUUe9.js';
2
- export { A as AgentEvent, a as AgentEventType, b as AgentLlmResponseEvent, c as AgentPreflightMetrics, d as AgentTurnEndEvent, e as AgentTurnLatency, f as AgentUserInterruptionEvent, g as AgentUserTranscriptEvent, C as CallSession, T as TtsStreamingEvent, h as TtsStreamingEventType, W as WsMessage, i as WsMessageType, j as WsResponse } from '../session-DKaSRkIo.js';
1
+ export { A as ActionHook, a as ActionHookDelayAction, b as ActionHookObject, c as AgentLlm, d as AgentLlmOptions, e as AgentVerb, f as AlertVerb, g as Amd, h as AmdTimers, i as AnswerVerb, j as Auth, B as BidirectionalAudio, C as ConferenceVerb, k as ConfigVerb, D as DequeueVerb, l as DialVerb, m as DtmfVerb, n as DubVerb, E as EnqueueVerb, F as FillerNoise, G as GatherVerb, H as Handoff, o as HangupVerb, J as JambonzApp, L as LeaveVerb, p as ListenVerb, q as LlmMessage, r as LlmTool, s as LlmToolOpenAIWrapped, t as LlmToolOutputData, u as LlmVendor, v as LlmVerb, M as McpServerConfig, w as MessageVerb, P as PauseVerb, x as PlayVerb, R as Recognizer, y as RedirectVerb, S as SayVerb, z as SipDeclineVerb, I as SipReferVerb, K as SipRequestVerb, N as StreamVerb, O as Synthesizer, T as TagVerb, Q as Target, U as TranscribeVerb, V as TransferConfirm, W as TransferDisposition, X as TransferOptions, Y as TransferVerb, Z as Vad, _ as Verb, $ as VerbName } from '../verbs-DQ6zJ0bn.js';
3
2
  export { E as EnvVarDef, a as EnvVarSchema, L as Logger } from '../common-BSJZX7WO.js';
4
- export { C as CallCount, a as CallInfo, b as CreateCallRequest, L as ListCallsFilter, Q as QueueInfo, U as UpdateCallRequest } from '../rest-vYKAkq-I.js';
3
+ export { C as CallCount, a as CallInfo, b as CreateCallRequest, D as DialogflowUpdate, L as ListCallsFilter, Q as QueueInfo, U as UpdateCallRequest } from '../rest-CqS2POQv.js';
4
+
5
+ /**
6
+ * Types for call session data received from jambonz.
7
+ */
8
+ /** Call session data provided in webhook requests and WebSocket session:new messages. */
9
+ interface CallSession {
10
+ /** Unique call identifier. */
11
+ call_sid: string;
12
+ /** Account identifier. */
13
+ account_sid: string;
14
+ /** Application identifier. */
15
+ application_sid: string;
16
+ /** Call direction. */
17
+ direction: 'inbound' | 'outbound';
18
+ /** Caller phone number or SIP URI. */
19
+ from: string;
20
+ /** Called phone number or SIP URI. */
21
+ to: string;
22
+ /** SIP Call-ID header. */
23
+ call_id: string;
24
+ /** SIP response status code. */
25
+ sip_status: number;
26
+ /** SIP reason phrase. */
27
+ sip_reason?: string;
28
+ /** Caller display name from the SIP From header. */
29
+ caller_name?: string;
30
+ /** Caller ID value (phone number or SIP user). */
31
+ caller_id?: string;
32
+ /** Call status. */
33
+ call_status?: string;
34
+ /** Name of the originating SIP trunk as configured in jambonz. */
35
+ originating_sip_trunk_name?: string;
36
+ /** IP address of the originating SIP trunk. */
37
+ originating_sip_ip?: string;
38
+ /** Service provider SID. */
39
+ service_provider_sid?: string;
40
+ /** Distributed tracing ID. */
41
+ trace_id?: string;
42
+ /** Call SID of the parent call (present for adulting / child call scenarios). */
43
+ parent_call_sid?: string;
44
+ /** jambonz REST API base URL for mid-call control. */
45
+ api_base_url?: string;
46
+ /**
47
+ * Raw SIP INVITE message (drachtio SipRequest, serialized).
48
+ * Only present for WebSocket and HTTP POST transports.
49
+ * See https://drachtio.org/api#sip-request for the full API.
50
+ */
51
+ sip?: {
52
+ /** SIP headers as key-value pairs. Custom X-* headers are included. */
53
+ headers: Record<string, string>;
54
+ /** SIP message body (typically SDP). */
55
+ body?: string;
56
+ /** SIP method (always 'INVITE' for session:new). */
57
+ method?: string;
58
+ /** Request-URI from the SIP INVITE. */
59
+ uri?: string;
60
+ /** Phone number extracted from the Request-URI. */
61
+ calledNumber?: string;
62
+ /** Calling phone number from P-Asserted-Identity or From header. */
63
+ callingNumber?: string;
64
+ /** Transport protocol (e.g. 'udp', 'tcp', 'tls'). */
65
+ protocol?: string;
66
+ /** IP address of the sender. */
67
+ source_address?: string;
68
+ /** Port of the sender. */
69
+ source_port?: string | number;
70
+ };
71
+ /** Application environment variables configured in the jambonz portal. */
72
+ env_vars?: Record<string, string>;
73
+ /** Default speech settings for the account. */
74
+ defaults?: {
75
+ synthesizer?: {
76
+ vendor?: string;
77
+ language?: string;
78
+ voice?: string;
79
+ };
80
+ recognizer?: {
81
+ vendor?: string;
82
+ language?: string;
83
+ };
84
+ };
85
+ /** Custom data attached via the REST API when creating an outbound call. */
86
+ customerData?: Record<string, unknown>;
87
+ /** Additional properties. */
88
+ [key: string]: unknown;
89
+ }
90
+ /** TTS streaming event types sent by jambonz. */
91
+ type TtsStreamingEventType = 'stream_open' | 'stream_paused' | 'stream_resumed' | 'stream_closed' | 'user_interruption' | 'tts_spoken';
92
+ /** Payload for tts:streaming-event messages. */
93
+ interface TtsStreamingEvent {
94
+ event_type: TtsStreamingEventType;
95
+ /** The actual text spoken via TTS (present for tts_spoken events). */
96
+ text?: string;
97
+ /** Whether the user interrupted the TTS playout (present for tts_spoken events). */
98
+ bargein?: boolean;
99
+ }
100
+ /** WebSocket message types received from jambonz. */
101
+ type WsMessageType = 'session:new' | 'session:adulting' | 'session:reconnect' | 'session:redirect' | 'verb:hook' | 'dial:confirm' | 'call:status' | 'verb:status' | 'llm:event' | 'llm:tool-call' | 'agent:event' | 'agent:tool-call' | 'tts:streaming-event' | 'tts:tokens-result' | 'jambonz:error';
102
+ /** Agent eventHook event types. */
103
+ type AgentEventType = 'turn_end' | 'user_transcript' | 'llm_response' | 'user_interruption';
104
+ /** Preflight (early generation) metrics. */
105
+ interface AgentPreflightMetrics {
106
+ result: 'hit' | 'miss' | 'pending';
107
+ tokens?: number;
108
+ }
109
+ /** Per-turn latency metrics (all values in milliseconds). */
110
+ interface AgentTurnLatency {
111
+ /** STT processing latency: stop talking to final transcript received. */
112
+ transcriber_latency?: number;
113
+ /** Additional wait after transcript for end-of-turn detection. */
114
+ turn_detection_latency?: number;
115
+ /** LLM latency: wait for first token after ready to prompt. Absent on preflight hit. */
116
+ model_latency?: number;
117
+ /** TTS engine latency: first text sent to TTS until first audio received. */
118
+ voice_latency?: number;
119
+ /** Early generation metrics. */
120
+ preflight?: AgentPreflightMetrics;
121
+ }
122
+ /** Payload for agent:event turn_end messages. */
123
+ interface AgentTurnEndEvent {
124
+ type: 'turn_end';
125
+ transcript: string;
126
+ response: string;
127
+ interrupted: boolean;
128
+ latency: AgentTurnLatency;
129
+ }
130
+ /** Payload for agent:event user_transcript messages. */
131
+ interface AgentUserTranscriptEvent {
132
+ type: 'user_transcript';
133
+ transcript: string;
134
+ }
135
+ /** Payload for agent:event llm_response messages. */
136
+ interface AgentLlmResponseEvent {
137
+ type: 'llm_response';
138
+ response: string;
139
+ }
140
+ /** Payload for agent:event user_interruption messages. */
141
+ interface AgentUserInterruptionEvent {
142
+ type: 'user_interruption';
143
+ }
144
+ /** Union of all agent eventHook payloads. */
145
+ type AgentEvent = AgentTurnEndEvent | AgentUserTranscriptEvent | AgentLlmResponseEvent | AgentUserInterruptionEvent;
146
+ /** Inbound WebSocket message from jambonz. */
147
+ interface WsMessage {
148
+ type: WsMessageType;
149
+ msgid: string;
150
+ call_sid?: string;
151
+ hook?: string;
152
+ data?: Record<string, unknown>;
153
+ b3?: string;
154
+ }
155
+ /** Outbound WebSocket message to jambonz. */
156
+ interface WsResponse {
157
+ type: 'ack' | 'command';
158
+ msgid?: string;
159
+ command?: string;
160
+ queueCommand?: boolean;
161
+ data?: unknown;
162
+ }
163
+
164
+ export type { AgentEvent, AgentEventType, AgentLlmResponseEvent, AgentPreflightMetrics, AgentTurnEndEvent, AgentTurnLatency, AgentUserInterruptionEvent, AgentUserTranscriptEvent, CallSession, TtsStreamingEvent, TtsStreamingEventType, WsMessage, WsMessageType, WsResponse };
@@ -1,4 +1,4 @@
1
- import { _ as Verb, S as SayVerb, x as PlayVerb, G as GatherVerb, v as LlmVerb, a0 as S2sVerb, a1 as LlmBaseOptions, a2 as DialogflowVerb, e as AgentVerb, p as ListenVerb, N as StreamVerb, U as TranscribeVerb, l as DialVerb, C as ConferenceVerb, a3 as RoomVerb, E as EnqueueVerb, D as DequeueVerb, o as HangupVerb, y as RedirectVerb, P as PauseVerb, L as LeaveVerb, z as SipDeclineVerb, K as SipRequestVerb, I as SipReferVerb, Y as TransferVerb, k as ConfigVerb, i as AnswerVerb, f as AlertVerb, T as TagVerb, m as DtmfVerb, n as DubVerb, w as MessageVerb } from './verbs-DXiMUUe9.js';
1
+ import { _ as Verb, S as SayVerb, x as PlayVerb, G as GatherVerb, v as LlmVerb, a0 as S2sVerb, a1 as LlmBaseOptions, a2 as DialogflowVerb, e as AgentVerb, p as ListenVerb, N as StreamVerb, U as TranscribeVerb, l as DialVerb, C as ConferenceVerb, a3 as RoomVerb, E as EnqueueVerb, D as DequeueVerb, o as HangupVerb, y as RedirectVerb, P as PauseVerb, L as LeaveVerb, z as SipDeclineVerb, K as SipRequestVerb, I as SipReferVerb, Y as TransferVerb, k as ConfigVerb, i as AnswerVerb, f as AlertVerb, T as TagVerb, m as DtmfVerb, n as DubVerb, w as MessageVerb } from './verbs-DQ6zJ0bn.cjs';
2
2
 
3
3
  /**
4
4
  * Schema-based validation using AJV.
@@ -59,6 +59,9 @@ declare class VerbBuilder {
59
59
  /** Shortcut for s2s with vendor='openai'. */
60
60
  openai_s2s(opts: Omit<LlmBaseOptions, 'vendor'>): this;
61
61
  qwen_s2s(opts: Omit<LlmBaseOptions, 'vendor'>): this;
62
+ gptlive_s2s(opts: Omit<LlmBaseOptions, 'vendor'>): this;
63
+ nova_s2s(opts: Omit<LlmBaseOptions, 'vendor'>): this;
64
+ voicelive_s2s(opts: Omit<LlmBaseOptions, 'vendor'>): this;
62
65
  /** Shortcut for s2s with vendor='google'. */
63
66
  google_s2s(opts: Omit<LlmBaseOptions, 'vendor'>): this;
64
67
  /** Shortcut for s2s with vendor='elevenlabs'. */
@@ -1,4 +1,4 @@
1
- import { _ as Verb, S as SayVerb, x as PlayVerb, G as GatherVerb, v as LlmVerb, a0 as S2sVerb, a1 as LlmBaseOptions, a2 as DialogflowVerb, e as AgentVerb, p as ListenVerb, N as StreamVerb, U as TranscribeVerb, l as DialVerb, C as ConferenceVerb, a3 as RoomVerb, E as EnqueueVerb, D as DequeueVerb, o as HangupVerb, y as RedirectVerb, P as PauseVerb, L as LeaveVerb, z as SipDeclineVerb, K as SipRequestVerb, I as SipReferVerb, Y as TransferVerb, k as ConfigVerb, i as AnswerVerb, f as AlertVerb, T as TagVerb, m as DtmfVerb, n as DubVerb, w as MessageVerb } from './verbs-DXiMUUe9.cjs';
1
+ import { _ as Verb, S as SayVerb, x as PlayVerb, G as GatherVerb, v as LlmVerb, a0 as S2sVerb, a1 as LlmBaseOptions, a2 as DialogflowVerb, e as AgentVerb, p as ListenVerb, N as StreamVerb, U as TranscribeVerb, l as DialVerb, C as ConferenceVerb, a3 as RoomVerb, E as EnqueueVerb, D as DequeueVerb, o as HangupVerb, y as RedirectVerb, P as PauseVerb, L as LeaveVerb, z as SipDeclineVerb, K as SipRequestVerb, I as SipReferVerb, Y as TransferVerb, k as ConfigVerb, i as AnswerVerb, f as AlertVerb, T as TagVerb, m as DtmfVerb, n as DubVerb, w as MessageVerb } from './verbs-DQ6zJ0bn.js';
2
2
 
3
3
  /**
4
4
  * Schema-based validation using AJV.
@@ -59,6 +59,9 @@ declare class VerbBuilder {
59
59
  /** Shortcut for s2s with vendor='openai'. */
60
60
  openai_s2s(opts: Omit<LlmBaseOptions, 'vendor'>): this;
61
61
  qwen_s2s(opts: Omit<LlmBaseOptions, 'vendor'>): this;
62
+ gptlive_s2s(opts: Omit<LlmBaseOptions, 'vendor'>): this;
63
+ nova_s2s(opts: Omit<LlmBaseOptions, 'vendor'>): this;
64
+ voicelive_s2s(opts: Omit<LlmBaseOptions, 'vendor'>): this;
62
65
  /** Shortcut for s2s with vendor='google'. */
63
66
  google_s2s(opts: Omit<LlmBaseOptions, 'vendor'>): this;
64
67
  /** Shortcut for s2s with vendor='elevenlabs'. */
@@ -139,6 +139,11 @@ interface Recognizer {
139
139
  gladiaOptions?: Record<string, unknown>;
140
140
  elevenlabsOptions?: Record<string, unknown>;
141
141
  verbioOptions?: Record<string, unknown>;
142
+ gradiumOptions?: Record<string, unknown>;
143
+ giggyOptions?: Record<string, unknown>;
144
+ mistralOptions?: Record<string, unknown>;
145
+ modulateOptions?: Record<string, unknown>;
146
+ zoomOptions?: Record<string, unknown>;
142
147
  customOptions?: Record<string, unknown>;
143
148
  }
144
149
  /** Call target for the dial verb. */
@@ -382,6 +387,19 @@ interface AgentLlmOptions {
382
387
  maxTokens?: number;
383
388
  /** Sampling temperature. */
384
389
  temperature?: number;
390
+ /**
391
+ * @deprecated Has no effect. Set the vendor's own thinking parameter in
392
+ * `vendorParams` instead, e.g. `{ reasoning_effort: 'none' }` for openai.
393
+ */
394
+ reasoningEffort?: 'minimal' | 'low' | 'medium' | 'high';
395
+ /**
396
+ * Vendor-specific request parameters, passed to the vendor as-is, e.g.
397
+ * `{ provider: { sort: 'latency' } }` for openrouter. Added to the request
398
+ * body (OpenAI-compatible vendors) or generation config (google,
399
+ * vertex-gemini); never overrides a field jambonz sets. Ignored by
400
+ * anthropic and bedrock.
401
+ */
402
+ vendorParams?: Record<string, unknown>;
385
403
  /** Tools / functions the model may call. */
386
404
  tools?: (LlmTool | LlmToolOpenAIWrapped)[];
387
405
  }
@@ -482,8 +500,21 @@ interface QwenS2sVerb extends LlmBaseOptions {
482
500
  [key: string]: unknown;
483
501
  };
484
502
  }
503
+ interface GptliveS2sVerb extends LlmBaseOptions {
504
+ verb: 'gptlive_s2s';
505
+ }
506
+ interface NovaS2sVerb extends LlmBaseOptions {
507
+ verb: 'nova_s2s';
508
+ }
509
+ interface VoiceliveS2sVerb extends LlmBaseOptions {
510
+ verb: 'voicelive_s2s';
511
+ }
485
512
  interface DialogflowVerb {
486
513
  verb: 'dialogflow';
514
+ /** The deployment to use (CES). Omit to use the app's default. */
515
+ deployment?: string;
516
+ /** Names the conversation on the Dialogflow side; reuse it on a later dialogflow verb in the same call to resume the same conversation. */
517
+ sessionId?: string;
487
518
  id?: string;
488
519
  /** Google service account credentials as JSON object or stringified JSON. */
489
520
  credentials: Record<string, unknown> | string;
@@ -588,6 +619,10 @@ interface AgentVerb {
588
619
  greeting?: boolean;
589
620
  /** Speculatively prompt the LLM on final transcript before Krisp end-of-turn. Default: false. */
590
621
  earlyGeneration?: boolean;
622
+ /** false: the agent's text is never sent to TTS (e.g. an agent that drives a DTMF-only phone menu with tools). Text is still kept in history and llm_response events; toolFiller and earlyGeneration are turned off. Default: true. */
623
+ speak?: boolean;
624
+ /** Keep stage-direction-only paragraphs ('(silence)', '[No response needed]', '*pauses*') and <think>/<thinking>/<reasoning> blocks out of TTS. History and events keep the raw text. Default: true. */
625
+ speechCleanup?: boolean;
591
626
  /** Enable server-side noise isolation to reduce background noise on call audio. Defaults to inbound (caller) audio; set direction to 'write' for outbound. */
592
627
  noiseIsolation?: 'krisp' | 'rnnoise' | {
593
628
  mode: string;
@@ -597,8 +632,10 @@ interface AgentVerb {
597
632
  };
598
633
  /** External MCP servers that provide tools to the LLM. */
599
634
  mcpServers?: McpServerConfig[];
600
- /** Seconds to wait after assistant finishes speaking before prompting user to respond. 0 disables. Default: 0. */
635
+ /** Seconds to wait after assistant finishes speaking before prompting user to respond. 0 disables. Default: 12. */
601
636
  noResponseTimeout?: number;
637
+ /** End the agent after this many unanswered no-response prompts in a row (actionHook completionReason 'no_response'). Resets when the user speaks. 0 or unset: no limit. */
638
+ noResponseMaxPrompts?: number;
602
639
  /** Auto-adjust STT/TTS based on detected language. true=lock on first, 'always'=adapt every turn. */
603
640
  autoLockLanguage?: boolean | 'always';
604
641
  /** Per-language TTS overrides. Keys are BCP-47 codes (e.g., 'es', 'fr'). */
@@ -749,6 +786,8 @@ interface DialVerb {
749
786
  tag?: Record<string, unknown>;
750
787
  /** Forward P-Asserted-Identity header. */
751
788
  forwardPAI?: boolean;
789
+ /** Codec names, in preference order, to offer on the outbound INVITE (e.g. ['G722', 'PCMU']). */
790
+ codecs?: string[];
752
791
  }
753
792
  interface ConferenceVerb {
754
793
  verb: 'conference';
@@ -1107,7 +1146,7 @@ interface MessageVerb {
1107
1146
  actionHook?: ActionHook;
1108
1147
  }
1109
1148
  /** Any jambonz verb. Discriminated on the 'verb' property. */
1110
- type Verb = AnswerVerb | AlertVerb | ConfigVerb | SayVerb | PlayVerb | GatherVerb | DialVerb | ListenVerb | StreamVerb | LlmVerb | S2sVerb | OpenaiS2sVerb | GoogleS2sVerb | ElevenlabsS2sVerb | DeepgramS2sVerb | UltravoxS2sVerb | QwenS2sVerb | DialogflowVerb | AgentVerb | ConferenceVerb | RoomVerb | TranscribeVerb | EnqueueVerb | DequeueVerb | DtmfVerb | DubVerb | HangupVerb | LeaveVerb | MessageVerb | PauseVerb | RedirectVerb | TagVerb | SipDeclineVerb | SipRequestVerb | SipReferVerb | TransferVerb;
1149
+ type Verb = AnswerVerb | AlertVerb | ConfigVerb | SayVerb | PlayVerb | GatherVerb | DialVerb | ListenVerb | StreamVerb | LlmVerb | S2sVerb | OpenaiS2sVerb | GoogleS2sVerb | ElevenlabsS2sVerb | DeepgramS2sVerb | UltravoxS2sVerb | QwenS2sVerb | GptliveS2sVerb | NovaS2sVerb | VoiceliveS2sVerb | DialogflowVerb | AgentVerb | ConferenceVerb | RoomVerb | TranscribeVerb | EnqueueVerb | DequeueVerb | DtmfVerb | DubVerb | HangupVerb | LeaveVerb | MessageVerb | PauseVerb | RedirectVerb | TagVerb | SipDeclineVerb | SipRequestVerb | SipReferVerb | TransferVerb;
1111
1150
  /** A jambonz application — an array of verbs executed sequentially. */
1112
1151
  type JambonzApp = Verb[];
1113
1152
  /** All valid verb names. */
@@ -139,6 +139,11 @@ interface Recognizer {
139
139
  gladiaOptions?: Record<string, unknown>;
140
140
  elevenlabsOptions?: Record<string, unknown>;
141
141
  verbioOptions?: Record<string, unknown>;
142
+ gradiumOptions?: Record<string, unknown>;
143
+ giggyOptions?: Record<string, unknown>;
144
+ mistralOptions?: Record<string, unknown>;
145
+ modulateOptions?: Record<string, unknown>;
146
+ zoomOptions?: Record<string, unknown>;
142
147
  customOptions?: Record<string, unknown>;
143
148
  }
144
149
  /** Call target for the dial verb. */
@@ -382,6 +387,19 @@ interface AgentLlmOptions {
382
387
  maxTokens?: number;
383
388
  /** Sampling temperature. */
384
389
  temperature?: number;
390
+ /**
391
+ * @deprecated Has no effect. Set the vendor's own thinking parameter in
392
+ * `vendorParams` instead, e.g. `{ reasoning_effort: 'none' }` for openai.
393
+ */
394
+ reasoningEffort?: 'minimal' | 'low' | 'medium' | 'high';
395
+ /**
396
+ * Vendor-specific request parameters, passed to the vendor as-is, e.g.
397
+ * `{ provider: { sort: 'latency' } }` for openrouter. Added to the request
398
+ * body (OpenAI-compatible vendors) or generation config (google,
399
+ * vertex-gemini); never overrides a field jambonz sets. Ignored by
400
+ * anthropic and bedrock.
401
+ */
402
+ vendorParams?: Record<string, unknown>;
385
403
  /** Tools / functions the model may call. */
386
404
  tools?: (LlmTool | LlmToolOpenAIWrapped)[];
387
405
  }
@@ -482,8 +500,21 @@ interface QwenS2sVerb extends LlmBaseOptions {
482
500
  [key: string]: unknown;
483
501
  };
484
502
  }
503
+ interface GptliveS2sVerb extends LlmBaseOptions {
504
+ verb: 'gptlive_s2s';
505
+ }
506
+ interface NovaS2sVerb extends LlmBaseOptions {
507
+ verb: 'nova_s2s';
508
+ }
509
+ interface VoiceliveS2sVerb extends LlmBaseOptions {
510
+ verb: 'voicelive_s2s';
511
+ }
485
512
  interface DialogflowVerb {
486
513
  verb: 'dialogflow';
514
+ /** The deployment to use (CES). Omit to use the app's default. */
515
+ deployment?: string;
516
+ /** Names the conversation on the Dialogflow side; reuse it on a later dialogflow verb in the same call to resume the same conversation. */
517
+ sessionId?: string;
487
518
  id?: string;
488
519
  /** Google service account credentials as JSON object or stringified JSON. */
489
520
  credentials: Record<string, unknown> | string;
@@ -588,6 +619,10 @@ interface AgentVerb {
588
619
  greeting?: boolean;
589
620
  /** Speculatively prompt the LLM on final transcript before Krisp end-of-turn. Default: false. */
590
621
  earlyGeneration?: boolean;
622
+ /** false: the agent's text is never sent to TTS (e.g. an agent that drives a DTMF-only phone menu with tools). Text is still kept in history and llm_response events; toolFiller and earlyGeneration are turned off. Default: true. */
623
+ speak?: boolean;
624
+ /** Keep stage-direction-only paragraphs ('(silence)', '[No response needed]', '*pauses*') and <think>/<thinking>/<reasoning> blocks out of TTS. History and events keep the raw text. Default: true. */
625
+ speechCleanup?: boolean;
591
626
  /** Enable server-side noise isolation to reduce background noise on call audio. Defaults to inbound (caller) audio; set direction to 'write' for outbound. */
592
627
  noiseIsolation?: 'krisp' | 'rnnoise' | {
593
628
  mode: string;
@@ -597,8 +632,10 @@ interface AgentVerb {
597
632
  };
598
633
  /** External MCP servers that provide tools to the LLM. */
599
634
  mcpServers?: McpServerConfig[];
600
- /** Seconds to wait after assistant finishes speaking before prompting user to respond. 0 disables. Default: 0. */
635
+ /** Seconds to wait after assistant finishes speaking before prompting user to respond. 0 disables. Default: 12. */
601
636
  noResponseTimeout?: number;
637
+ /** End the agent after this many unanswered no-response prompts in a row (actionHook completionReason 'no_response'). Resets when the user speaks. 0 or unset: no limit. */
638
+ noResponseMaxPrompts?: number;
602
639
  /** Auto-adjust STT/TTS based on detected language. true=lock on first, 'always'=adapt every turn. */
603
640
  autoLockLanguage?: boolean | 'always';
604
641
  /** Per-language TTS overrides. Keys are BCP-47 codes (e.g., 'es', 'fr'). */
@@ -749,6 +786,8 @@ interface DialVerb {
749
786
  tag?: Record<string, unknown>;
750
787
  /** Forward P-Asserted-Identity header. */
751
788
  forwardPAI?: boolean;
789
+ /** Codec names, in preference order, to offer on the outbound INVITE (e.g. ['G722', 'PCMU']). */
790
+ codecs?: string[];
752
791
  }
753
792
  interface ConferenceVerb {
754
793
  verb: 'conference';
@@ -1107,7 +1146,7 @@ interface MessageVerb {
1107
1146
  actionHook?: ActionHook;
1108
1147
  }
1109
1148
  /** Any jambonz verb. Discriminated on the 'verb' property. */
1110
- type Verb = AnswerVerb | AlertVerb | ConfigVerb | SayVerb | PlayVerb | GatherVerb | DialVerb | ListenVerb | StreamVerb | LlmVerb | S2sVerb | OpenaiS2sVerb | GoogleS2sVerb | ElevenlabsS2sVerb | DeepgramS2sVerb | UltravoxS2sVerb | QwenS2sVerb | DialogflowVerb | AgentVerb | ConferenceVerb | RoomVerb | TranscribeVerb | EnqueueVerb | DequeueVerb | DtmfVerb | DubVerb | HangupVerb | LeaveVerb | MessageVerb | PauseVerb | RedirectVerb | TagVerb | SipDeclineVerb | SipRequestVerb | SipReferVerb | TransferVerb;
1149
+ type Verb = AnswerVerb | AlertVerb | ConfigVerb | SayVerb | PlayVerb | GatherVerb | DialVerb | ListenVerb | StreamVerb | LlmVerb | S2sVerb | OpenaiS2sVerb | GoogleS2sVerb | ElevenlabsS2sVerb | DeepgramS2sVerb | UltravoxS2sVerb | QwenS2sVerb | GptliveS2sVerb | NovaS2sVerb | VoiceliveS2sVerb | DialogflowVerb | AgentVerb | ConferenceVerb | RoomVerb | TranscribeVerb | EnqueueVerb | DequeueVerb | DtmfVerb | DubVerb | HangupVerb | LeaveVerb | MessageVerb | PauseVerb | RedirectVerb | TagVerb | SipDeclineVerb | SipRequestVerb | SipReferVerb | TransferVerb;
1111
1150
  /** A jambonz application — an array of verbs executed sequentially. */
1112
1151
  type JambonzApp = Verb[];
1113
1152
  /** All valid verb names. */
@@ -139,6 +139,15 @@ var VerbBuilder = class {
139
139
  qwen_s2s(opts) {
140
140
  return this.addVerb({ verb: "qwen_s2s", ...opts });
141
141
  }
142
+ gptlive_s2s(opts) {
143
+ return this.addVerb({ verb: "gptlive_s2s", ...opts });
144
+ }
145
+ nova_s2s(opts) {
146
+ return this.addVerb({ verb: "nova_s2s", ...opts });
147
+ }
148
+ voicelive_s2s(opts) {
149
+ return this.addVerb({ verb: "voicelive_s2s", ...opts });
150
+ }
142
151
  /** Shortcut for s2s with vendor='google'. */
143
152
  google_s2s(opts) {
144
153
  return this.addVerb({ verb: "google_s2s", ...opts });