@jambonz/sdk 0.11.0 → 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.
- package/dist/client/index.cjs +4 -0
- package/dist/client/index.cjs.map +1 -1
- package/dist/client/index.d.cts +4 -2
- package/dist/client/index.d.ts +4 -2
- package/dist/client/index.js +4 -0
- package/dist/client/index.js.map +1 -1
- package/dist/index.cjs +17 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -1
- package/dist/{rest-nkM1OQLd.d.ts → rest-0m9Hgjmn.d.cts} +29 -2
- package/dist/{rest-jYM4NgyN.d.cts → rest-CqS2POQv.d.ts} +29 -2
- package/dist/types/index.d.cts +163 -3
- package/dist/types/index.d.ts +163 -3
- package/dist/{verb-builder-Cbw6aUdF.d.cts → verb-builder-C1id83_f.d.cts} +1 -1
- package/dist/{verb-builder-D1rpCZ6y.d.ts → verb-builder-YFevoXCs.d.ts} +1 -1
- package/dist/{verbs-D0TgdJYZ.d.cts → verbs-DQ6zJ0bn.d.cts} +14 -0
- package/dist/{verbs-D0TgdJYZ.d.ts → verbs-DQ6zJ0bn.d.ts} +14 -0
- package/dist/webhook/index.d.cts +2 -2
- package/dist/webhook/index.d.ts +2 -2
- package/dist/websocket/index.cjs +13 -0
- package/dist/websocket/index.cjs.map +1 -1
- package/dist/websocket/index.d.cts +11 -3
- package/dist/websocket/index.d.ts +11 -3
- package/dist/websocket/index.js +13 -0
- package/dist/websocket/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/session-DKaSRkIo.d.cts +0 -160
- 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-
|
|
1
|
+
import { A as ActionHook, _ as Verb, S as SayVerb, Y as TransferVerb } from './verbs-DQ6zJ0bn.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,4 @@
|
|
|
1
|
-
import { A as ActionHook, _ as Verb, S as SayVerb, Y as TransferVerb } from './verbs-
|
|
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 };
|
package/dist/types/index.d.cts
CHANGED
|
@@ -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-
|
|
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-
|
|
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 };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -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-
|
|
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-
|
|
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-
|
|
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.
|
|
@@ -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-
|
|
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.
|
|
@@ -140,6 +140,7 @@ 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>;
|
|
@@ -386,6 +387,19 @@ interface AgentLlmOptions {
|
|
|
386
387
|
maxTokens?: number;
|
|
387
388
|
/** Sampling temperature. */
|
|
388
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>;
|
|
389
403
|
/** Tools / functions the model may call. */
|
|
390
404
|
tools?: (LlmTool | LlmToolOpenAIWrapped)[];
|
|
391
405
|
}
|
|
@@ -140,6 +140,7 @@ 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>;
|
|
@@ -386,6 +387,19 @@ interface AgentLlmOptions {
|
|
|
386
387
|
maxTokens?: number;
|
|
387
388
|
/** Sampling temperature. */
|
|
388
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>;
|
|
389
403
|
/** Tools / functions the model may call. */
|
|
390
404
|
tools?: (LlmTool | LlmToolOpenAIWrapped)[];
|
|
391
405
|
}
|
package/dist/webhook/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { b as VerbBuilder, c as VerbBuilderOptions } from '../verb-builder-
|
|
2
|
-
import { J as JambonzApp } from '../verbs-
|
|
1
|
+
import { b as VerbBuilder, c as VerbBuilderOptions } from '../verb-builder-C1id83_f.cjs';
|
|
2
|
+
import { J as JambonzApp } from '../verbs-DQ6zJ0bn.cjs';
|
|
3
3
|
import { IncomingMessage, ServerResponse } from 'http';
|
|
4
4
|
import { a as EnvVarSchema } from '../common-BSJZX7WO.cjs';
|
|
5
5
|
|
package/dist/webhook/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { b as VerbBuilder, c as VerbBuilderOptions } from '../verb-builder-
|
|
2
|
-
import { J as JambonzApp } from '../verbs-
|
|
1
|
+
import { b as VerbBuilder, c as VerbBuilderOptions } from '../verb-builder-YFevoXCs.js';
|
|
2
|
+
import { J as JambonzApp } from '../verbs-DQ6zJ0bn.js';
|
|
3
3
|
import { IncomingMessage, ServerResponse } from 'http';
|
|
4
4
|
import { a as EnvVarSchema } from '../common-BSJZX7WO.js';
|
|
5
5
|
|
package/dist/websocket/index.cjs
CHANGED
|
@@ -735,6 +735,19 @@ var Session = class extends events.EventEmitter {
|
|
|
735
735
|
data
|
|
736
736
|
});
|
|
737
737
|
}
|
|
738
|
+
/**
|
|
739
|
+
* Send input into a running Dialogflow CES session mid-call.
|
|
740
|
+
* CES only. Variables and dtmf go at once; an event or text is held by
|
|
741
|
+
* jambonz until the agent's current turn ends, because CES drops one sent
|
|
742
|
+
* mid-reply.
|
|
743
|
+
*/
|
|
744
|
+
updateDialogflow(data) {
|
|
745
|
+
this.wsSend({
|
|
746
|
+
type: "command",
|
|
747
|
+
command: "dialogflow:update",
|
|
748
|
+
data
|
|
749
|
+
});
|
|
750
|
+
}
|
|
738
751
|
/**
|
|
739
752
|
* Reconfigure STT (speech-to-text) settings mid-call.
|
|
740
753
|
* Currently supports updating language hints for Deepgram Flux Multilingual.
|