@jambonz/sdk 0.11.0 → 0.12.1

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 (45) 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/harness/index.cjs +843 -0
  8. package/dist/harness/index.cjs.map +1 -0
  9. package/dist/harness/index.d.cts +501 -0
  10. package/dist/harness/index.d.ts +501 -0
  11. package/dist/harness/index.js +832 -0
  12. package/dist/harness/index.js.map +1 -0
  13. package/dist/index.cjs +24 -0
  14. package/dist/index.cjs.map +1 -1
  15. package/dist/index.d.cts +4 -4
  16. package/dist/index.d.ts +4 -4
  17. package/dist/index.js +24 -0
  18. package/dist/index.js.map +1 -1
  19. package/dist/{rest-jYM4NgyN.d.cts → rest-qwPYz71v.d.ts} +29 -2
  20. package/dist/{rest-nkM1OQLd.d.ts → rest-rSaRlKBZ.d.cts} +29 -2
  21. package/dist/types/index.d.cts +163 -3
  22. package/dist/types/index.d.ts +163 -3
  23. package/dist/{verb-builder-D1rpCZ6y.d.ts → verb-builder-58TZ7DKD.d.cts} +2 -1
  24. package/dist/{verb-builder-Cbw6aUdF.d.cts → verb-builder-D20D5_vU.d.ts} +2 -1
  25. package/dist/{verbs-D0TgdJYZ.d.cts → verbs-YtIbYtiR.d.cts} +22 -1
  26. package/dist/{verbs-D0TgdJYZ.d.ts → verbs-YtIbYtiR.d.ts} +22 -1
  27. package/dist/webhook/index.cjs +3 -0
  28. package/dist/webhook/index.cjs.map +1 -1
  29. package/dist/webhook/index.d.cts +2 -2
  30. package/dist/webhook/index.d.ts +2 -2
  31. package/dist/webhook/index.js +3 -0
  32. package/dist/webhook/index.js.map +1 -1
  33. package/dist/websocket/index.cjs +20 -0
  34. package/dist/websocket/index.cjs.map +1 -1
  35. package/dist/websocket/index.d.cts +12 -3
  36. package/dist/websocket/index.d.ts +12 -3
  37. package/dist/websocket/index.js +20 -0
  38. package/dist/websocket/index.js.map +1 -1
  39. package/examples/harness/README.md +70 -0
  40. package/examples/harness/harness.ts +99 -0
  41. package/examples/harness/package.json +21 -0
  42. package/examples/harness/tsconfig.json +12 -0
  43. package/package.json +13 -2
  44. package/dist/session-DKaSRkIo.d.cts +0 -160
  45. 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-D0TgdJYZ.cjs';
1
+ import { A as ActionHook, _ as Verb, S as SayVerb, Y as TransferVerb } from './verbs-YtIbYtiR.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,4 @@
1
- import { A as ActionHook, _ as Verb, S as SayVerb, Y as TransferVerb } from './verbs-D0TgdJYZ.js';
1
+ import { A as ActionHook, _ as Verb, S as SayVerb, Y as TransferVerb } from './verbs-YtIbYtiR.cjs';
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-D0TgdJYZ.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-YtIbYtiR.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-jYM4NgyN.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-rSaRlKBZ.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-D0TgdJYZ.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-YtIbYtiR.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-nkM1OQLd.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-qwPYz71v.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-D0TgdJYZ.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-YtIbYtiR.cjs';
2
2
 
3
3
  /**
4
4
  * Schema-based validation using AJV.
@@ -61,6 +61,7 @@ declare class VerbBuilder {
61
61
  qwen_s2s(opts: Omit<LlmBaseOptions, 'vendor'>): this;
62
62
  gptlive_s2s(opts: Omit<LlmBaseOptions, 'vendor'>): this;
63
63
  nova_s2s(opts: Omit<LlmBaseOptions, 'vendor'>): this;
64
+ rime_s2s(opts: Omit<LlmBaseOptions, 'vendor'>): this;
64
65
  voicelive_s2s(opts: Omit<LlmBaseOptions, 'vendor'>): this;
65
66
  /** Shortcut for s2s with vendor='google'. */
66
67
  google_s2s(opts: Omit<LlmBaseOptions, 'vendor'>): this;
@@ -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-D0TgdJYZ.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-YtIbYtiR.js';
2
2
 
3
3
  /**
4
4
  * Schema-based validation using AJV.
@@ -61,6 +61,7 @@ declare class VerbBuilder {
61
61
  qwen_s2s(opts: Omit<LlmBaseOptions, 'vendor'>): this;
62
62
  gptlive_s2s(opts: Omit<LlmBaseOptions, 'vendor'>): this;
63
63
  nova_s2s(opts: Omit<LlmBaseOptions, 'vendor'>): this;
64
+ rime_s2s(opts: Omit<LlmBaseOptions, 'vendor'>): this;
64
65
  voicelive_s2s(opts: Omit<LlmBaseOptions, 'vendor'>): this;
65
66
  /** Shortcut for s2s with vendor='google'. */
66
67
  google_s2s(opts: Omit<LlmBaseOptions, 'vendor'>): this;
@@ -140,9 +140,12 @@ interface Recognizer {
140
140
  elevenlabsOptions?: Record<string, unknown>;
141
141
  verbioOptions?: Record<string, unknown>;
142
142
  gradiumOptions?: Record<string, unknown>;
143
+ giggyOptions?: Record<string, unknown>;
143
144
  mistralOptions?: Record<string, unknown>;
144
145
  modulateOptions?: Record<string, unknown>;
145
146
  zoomOptions?: Record<string, unknown>;
147
+ /** Paxa Labs options; only when the recognizer vendor is 'paxa'. */
148
+ paxaOptions?: Record<string, unknown>;
146
149
  customOptions?: Record<string, unknown>;
147
150
  }
148
151
  /** Call target for the dial verb. */
@@ -386,6 +389,19 @@ interface AgentLlmOptions {
386
389
  maxTokens?: number;
387
390
  /** Sampling temperature. */
388
391
  temperature?: number;
392
+ /**
393
+ * @deprecated Has no effect. Set the vendor's own thinking parameter in
394
+ * `vendorParams` instead, e.g. `{ reasoning_effort: 'none' }` for openai.
395
+ */
396
+ reasoningEffort?: 'minimal' | 'low' | 'medium' | 'high';
397
+ /**
398
+ * Vendor-specific request parameters, passed to the vendor as-is, e.g.
399
+ * `{ provider: { sort: 'latency' } }` for openrouter. Added to the request
400
+ * body (OpenAI-compatible vendors) or generation config (google,
401
+ * vertex-gemini); never overrides a field jambonz sets. Ignored by
402
+ * anthropic and bedrock.
403
+ */
404
+ vendorParams?: Record<string, unknown>;
389
405
  /** Tools / functions the model may call. */
390
406
  tools?: (LlmTool | LlmToolOpenAIWrapped)[];
391
407
  }
@@ -420,6 +436,8 @@ interface LlmBaseOptions {
420
436
  apiKey?: string;
421
437
  [key: string]: unknown;
422
438
  };
439
+ /** With no auth: the label of the account's speech-to-speech credential to use (e.g. openai_s2s); omit for the unlabelled one. */
440
+ label?: string;
423
441
  /** Additional connection options (e.g. custom base URLs). */
424
442
  connectOptions?: Record<string, unknown>;
425
443
  /** LLM configuration including messages, temperature, tools. */
@@ -492,6 +510,9 @@ interface GptliveS2sVerb extends LlmBaseOptions {
492
510
  interface NovaS2sVerb extends LlmBaseOptions {
493
511
  verb: 'nova_s2s';
494
512
  }
513
+ interface RimeS2sVerb extends LlmBaseOptions {
514
+ verb: 'rime_s2s';
515
+ }
495
516
  interface VoiceliveS2sVerb extends LlmBaseOptions {
496
517
  verb: 'voicelive_s2s';
497
518
  }
@@ -1132,7 +1153,7 @@ interface MessageVerb {
1132
1153
  actionHook?: ActionHook;
1133
1154
  }
1134
1155
  /** Any jambonz verb. Discriminated on the 'verb' property. */
1135
- 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;
1156
+ type Verb = AnswerVerb | AlertVerb | ConfigVerb | SayVerb | PlayVerb | GatherVerb | DialVerb | ListenVerb | StreamVerb | LlmVerb | S2sVerb | OpenaiS2sVerb | GoogleS2sVerb | ElevenlabsS2sVerb | DeepgramS2sVerb | UltravoxS2sVerb | QwenS2sVerb | GptliveS2sVerb | NovaS2sVerb | RimeS2sVerb | VoiceliveS2sVerb | DialogflowVerb | AgentVerb | ConferenceVerb | RoomVerb | TranscribeVerb | EnqueueVerb | DequeueVerb | DtmfVerb | DubVerb | HangupVerb | LeaveVerb | MessageVerb | PauseVerb | RedirectVerb | TagVerb | SipDeclineVerb | SipRequestVerb | SipReferVerb | TransferVerb;
1136
1157
  /** A jambonz application — an array of verbs executed sequentially. */
1137
1158
  type JambonzApp = Verb[];
1138
1159
  /** All valid verb names. */
@@ -140,9 +140,12 @@ interface Recognizer {
140
140
  elevenlabsOptions?: Record<string, unknown>;
141
141
  verbioOptions?: Record<string, unknown>;
142
142
  gradiumOptions?: Record<string, unknown>;
143
+ giggyOptions?: Record<string, unknown>;
143
144
  mistralOptions?: Record<string, unknown>;
144
145
  modulateOptions?: Record<string, unknown>;
145
146
  zoomOptions?: Record<string, unknown>;
147
+ /** Paxa Labs options; only when the recognizer vendor is 'paxa'. */
148
+ paxaOptions?: Record<string, unknown>;
146
149
  customOptions?: Record<string, unknown>;
147
150
  }
148
151
  /** Call target for the dial verb. */
@@ -386,6 +389,19 @@ interface AgentLlmOptions {
386
389
  maxTokens?: number;
387
390
  /** Sampling temperature. */
388
391
  temperature?: number;
392
+ /**
393
+ * @deprecated Has no effect. Set the vendor's own thinking parameter in
394
+ * `vendorParams` instead, e.g. `{ reasoning_effort: 'none' }` for openai.
395
+ */
396
+ reasoningEffort?: 'minimal' | 'low' | 'medium' | 'high';
397
+ /**
398
+ * Vendor-specific request parameters, passed to the vendor as-is, e.g.
399
+ * `{ provider: { sort: 'latency' } }` for openrouter. Added to the request
400
+ * body (OpenAI-compatible vendors) or generation config (google,
401
+ * vertex-gemini); never overrides a field jambonz sets. Ignored by
402
+ * anthropic and bedrock.
403
+ */
404
+ vendorParams?: Record<string, unknown>;
389
405
  /** Tools / functions the model may call. */
390
406
  tools?: (LlmTool | LlmToolOpenAIWrapped)[];
391
407
  }
@@ -420,6 +436,8 @@ interface LlmBaseOptions {
420
436
  apiKey?: string;
421
437
  [key: string]: unknown;
422
438
  };
439
+ /** With no auth: the label of the account's speech-to-speech credential to use (e.g. openai_s2s); omit for the unlabelled one. */
440
+ label?: string;
423
441
  /** Additional connection options (e.g. custom base URLs). */
424
442
  connectOptions?: Record<string, unknown>;
425
443
  /** LLM configuration including messages, temperature, tools. */
@@ -492,6 +510,9 @@ interface GptliveS2sVerb extends LlmBaseOptions {
492
510
  interface NovaS2sVerb extends LlmBaseOptions {
493
511
  verb: 'nova_s2s';
494
512
  }
513
+ interface RimeS2sVerb extends LlmBaseOptions {
514
+ verb: 'rime_s2s';
515
+ }
495
516
  interface VoiceliveS2sVerb extends LlmBaseOptions {
496
517
  verb: 'voicelive_s2s';
497
518
  }
@@ -1132,7 +1153,7 @@ interface MessageVerb {
1132
1153
  actionHook?: ActionHook;
1133
1154
  }
1134
1155
  /** Any jambonz verb. Discriminated on the 'verb' property. */
1135
- 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;
1156
+ type Verb = AnswerVerb | AlertVerb | ConfigVerb | SayVerb | PlayVerb | GatherVerb | DialVerb | ListenVerb | StreamVerb | LlmVerb | S2sVerb | OpenaiS2sVerb | GoogleS2sVerb | ElevenlabsS2sVerb | DeepgramS2sVerb | UltravoxS2sVerb | QwenS2sVerb | GptliveS2sVerb | NovaS2sVerb | RimeS2sVerb | VoiceliveS2sVerb | DialogflowVerb | AgentVerb | ConferenceVerb | RoomVerb | TranscribeVerb | EnqueueVerb | DequeueVerb | DtmfVerb | DubVerb | HangupVerb | LeaveVerb | MessageVerb | PauseVerb | RedirectVerb | TagVerb | SipDeclineVerb | SipRequestVerb | SipReferVerb | TransferVerb;
1136
1157
  /** A jambonz application — an array of verbs executed sequentially. */
1137
1158
  type JambonzApp = Verb[];
1138
1159
  /** All valid verb names. */
@@ -145,6 +145,9 @@ var VerbBuilder = class {
145
145
  nova_s2s(opts) {
146
146
  return this.addVerb({ verb: "nova_s2s", ...opts });
147
147
  }
148
+ rime_s2s(opts) {
149
+ return this.addVerb({ verb: "rime_s2s", ...opts });
150
+ }
148
151
  voicelive_s2s(opts) {
149
152
  return this.addVerb({ verb: "voicelive_s2s", ...opts });
150
153
  }