@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,160 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Types for call session data received from jambonz.
|
|
3
|
-
*/
|
|
4
|
-
/** Call session data provided in webhook requests and WebSocket session:new messages. */
|
|
5
|
-
interface CallSession {
|
|
6
|
-
/** Unique call identifier. */
|
|
7
|
-
call_sid: string;
|
|
8
|
-
/** Account identifier. */
|
|
9
|
-
account_sid: string;
|
|
10
|
-
/** Application identifier. */
|
|
11
|
-
application_sid: string;
|
|
12
|
-
/** Call direction. */
|
|
13
|
-
direction: 'inbound' | 'outbound';
|
|
14
|
-
/** Caller phone number or SIP URI. */
|
|
15
|
-
from: string;
|
|
16
|
-
/** Called phone number or SIP URI. */
|
|
17
|
-
to: string;
|
|
18
|
-
/** SIP Call-ID header. */
|
|
19
|
-
call_id: string;
|
|
20
|
-
/** SIP response status code. */
|
|
21
|
-
sip_status: number;
|
|
22
|
-
/** SIP reason phrase. */
|
|
23
|
-
sip_reason?: string;
|
|
24
|
-
/** Caller display name from the SIP From header. */
|
|
25
|
-
caller_name?: string;
|
|
26
|
-
/** Caller ID value (phone number or SIP user). */
|
|
27
|
-
caller_id?: string;
|
|
28
|
-
/** Call status. */
|
|
29
|
-
call_status?: string;
|
|
30
|
-
/** Name of the originating SIP trunk as configured in jambonz. */
|
|
31
|
-
originating_sip_trunk_name?: string;
|
|
32
|
-
/** IP address of the originating SIP trunk. */
|
|
33
|
-
originating_sip_ip?: string;
|
|
34
|
-
/** Service provider SID. */
|
|
35
|
-
service_provider_sid?: string;
|
|
36
|
-
/** Distributed tracing ID. */
|
|
37
|
-
trace_id?: string;
|
|
38
|
-
/** Call SID of the parent call (present for adulting / child call scenarios). */
|
|
39
|
-
parent_call_sid?: string;
|
|
40
|
-
/** jambonz REST API base URL for mid-call control. */
|
|
41
|
-
api_base_url?: string;
|
|
42
|
-
/**
|
|
43
|
-
* Raw SIP INVITE message (drachtio SipRequest, serialized).
|
|
44
|
-
* Only present for WebSocket and HTTP POST transports.
|
|
45
|
-
* See https://drachtio.org/api#sip-request for the full API.
|
|
46
|
-
*/
|
|
47
|
-
sip?: {
|
|
48
|
-
/** SIP headers as key-value pairs. Custom X-* headers are included. */
|
|
49
|
-
headers: Record<string, string>;
|
|
50
|
-
/** SIP message body (typically SDP). */
|
|
51
|
-
body?: string;
|
|
52
|
-
/** SIP method (always 'INVITE' for session:new). */
|
|
53
|
-
method?: string;
|
|
54
|
-
/** Request-URI from the SIP INVITE. */
|
|
55
|
-
uri?: string;
|
|
56
|
-
/** Phone number extracted from the Request-URI. */
|
|
57
|
-
calledNumber?: string;
|
|
58
|
-
/** Calling phone number from P-Asserted-Identity or From header. */
|
|
59
|
-
callingNumber?: string;
|
|
60
|
-
/** Transport protocol (e.g. 'udp', 'tcp', 'tls'). */
|
|
61
|
-
protocol?: string;
|
|
62
|
-
/** IP address of the sender. */
|
|
63
|
-
source_address?: string;
|
|
64
|
-
/** Port of the sender. */
|
|
65
|
-
source_port?: string | number;
|
|
66
|
-
};
|
|
67
|
-
/** Application environment variables configured in the jambonz portal. */
|
|
68
|
-
env_vars?: Record<string, string>;
|
|
69
|
-
/** Default speech settings for the account. */
|
|
70
|
-
defaults?: {
|
|
71
|
-
synthesizer?: {
|
|
72
|
-
vendor?: string;
|
|
73
|
-
language?: string;
|
|
74
|
-
voice?: string;
|
|
75
|
-
};
|
|
76
|
-
recognizer?: {
|
|
77
|
-
vendor?: string;
|
|
78
|
-
language?: string;
|
|
79
|
-
};
|
|
80
|
-
};
|
|
81
|
-
/** Custom data attached via the REST API when creating an outbound call. */
|
|
82
|
-
customerData?: Record<string, unknown>;
|
|
83
|
-
/** Additional properties. */
|
|
84
|
-
[key: string]: unknown;
|
|
85
|
-
}
|
|
86
|
-
/** TTS streaming event types sent by jambonz. */
|
|
87
|
-
type TtsStreamingEventType = 'stream_open' | 'stream_paused' | 'stream_resumed' | 'stream_closed' | 'user_interruption' | 'tts_spoken';
|
|
88
|
-
/** Payload for tts:streaming-event messages. */
|
|
89
|
-
interface TtsStreamingEvent {
|
|
90
|
-
event_type: TtsStreamingEventType;
|
|
91
|
-
/** The actual text spoken via TTS (present for tts_spoken events). */
|
|
92
|
-
text?: string;
|
|
93
|
-
/** Whether the user interrupted the TTS playout (present for tts_spoken events). */
|
|
94
|
-
bargein?: boolean;
|
|
95
|
-
}
|
|
96
|
-
/** WebSocket message types received from jambonz. */
|
|
97
|
-
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';
|
|
98
|
-
/** Agent eventHook event types. */
|
|
99
|
-
type AgentEventType = 'turn_end' | 'user_transcript' | 'llm_response' | 'user_interruption';
|
|
100
|
-
/** Preflight (early generation) metrics. */
|
|
101
|
-
interface AgentPreflightMetrics {
|
|
102
|
-
result: 'hit' | 'miss' | 'pending';
|
|
103
|
-
tokens?: number;
|
|
104
|
-
}
|
|
105
|
-
/** Per-turn latency metrics (all values in milliseconds). */
|
|
106
|
-
interface AgentTurnLatency {
|
|
107
|
-
/** STT processing latency: stop talking to final transcript received. */
|
|
108
|
-
transcriber_latency?: number;
|
|
109
|
-
/** Additional wait after transcript for end-of-turn detection. */
|
|
110
|
-
turn_detection_latency?: number;
|
|
111
|
-
/** LLM latency: wait for first token after ready to prompt. Absent on preflight hit. */
|
|
112
|
-
model_latency?: number;
|
|
113
|
-
/** TTS engine latency: first text sent to TTS until first audio received. */
|
|
114
|
-
voice_latency?: number;
|
|
115
|
-
/** Early generation metrics. */
|
|
116
|
-
preflight?: AgentPreflightMetrics;
|
|
117
|
-
}
|
|
118
|
-
/** Payload for agent:event turn_end messages. */
|
|
119
|
-
interface AgentTurnEndEvent {
|
|
120
|
-
type: 'turn_end';
|
|
121
|
-
transcript: string;
|
|
122
|
-
response: string;
|
|
123
|
-
interrupted: boolean;
|
|
124
|
-
latency: AgentTurnLatency;
|
|
125
|
-
}
|
|
126
|
-
/** Payload for agent:event user_transcript messages. */
|
|
127
|
-
interface AgentUserTranscriptEvent {
|
|
128
|
-
type: 'user_transcript';
|
|
129
|
-
transcript: string;
|
|
130
|
-
}
|
|
131
|
-
/** Payload for agent:event llm_response messages. */
|
|
132
|
-
interface AgentLlmResponseEvent {
|
|
133
|
-
type: 'llm_response';
|
|
134
|
-
response: string;
|
|
135
|
-
}
|
|
136
|
-
/** Payload for agent:event user_interruption messages. */
|
|
137
|
-
interface AgentUserInterruptionEvent {
|
|
138
|
-
type: 'user_interruption';
|
|
139
|
-
}
|
|
140
|
-
/** Union of all agent eventHook payloads. */
|
|
141
|
-
type AgentEvent = AgentTurnEndEvent | AgentUserTranscriptEvent | AgentLlmResponseEvent | AgentUserInterruptionEvent;
|
|
142
|
-
/** Inbound WebSocket message from jambonz. */
|
|
143
|
-
interface WsMessage {
|
|
144
|
-
type: WsMessageType;
|
|
145
|
-
msgid: string;
|
|
146
|
-
call_sid?: string;
|
|
147
|
-
hook?: string;
|
|
148
|
-
data?: Record<string, unknown>;
|
|
149
|
-
b3?: string;
|
|
150
|
-
}
|
|
151
|
-
/** Outbound WebSocket message to jambonz. */
|
|
152
|
-
interface WsResponse {
|
|
153
|
-
type: 'ack' | 'command';
|
|
154
|
-
msgid?: string;
|
|
155
|
-
command?: string;
|
|
156
|
-
queueCommand?: boolean;
|
|
157
|
-
data?: unknown;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
export type { AgentEvent as A, CallSession as C, TtsStreamingEvent as T, WsMessage as W, AgentEventType as a, AgentLlmResponseEvent as b, AgentPreflightMetrics as c, AgentTurnEndEvent as d, AgentTurnLatency as e, AgentUserInterruptionEvent as f, AgentUserTranscriptEvent as g, TtsStreamingEventType as h, WsMessageType as i, WsResponse as j };
|
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Types for call session data received from jambonz.
|
|
3
|
-
*/
|
|
4
|
-
/** Call session data provided in webhook requests and WebSocket session:new messages. */
|
|
5
|
-
interface CallSession {
|
|
6
|
-
/** Unique call identifier. */
|
|
7
|
-
call_sid: string;
|
|
8
|
-
/** Account identifier. */
|
|
9
|
-
account_sid: string;
|
|
10
|
-
/** Application identifier. */
|
|
11
|
-
application_sid: string;
|
|
12
|
-
/** Call direction. */
|
|
13
|
-
direction: 'inbound' | 'outbound';
|
|
14
|
-
/** Caller phone number or SIP URI. */
|
|
15
|
-
from: string;
|
|
16
|
-
/** Called phone number or SIP URI. */
|
|
17
|
-
to: string;
|
|
18
|
-
/** SIP Call-ID header. */
|
|
19
|
-
call_id: string;
|
|
20
|
-
/** SIP response status code. */
|
|
21
|
-
sip_status: number;
|
|
22
|
-
/** SIP reason phrase. */
|
|
23
|
-
sip_reason?: string;
|
|
24
|
-
/** Caller display name from the SIP From header. */
|
|
25
|
-
caller_name?: string;
|
|
26
|
-
/** Caller ID value (phone number or SIP user). */
|
|
27
|
-
caller_id?: string;
|
|
28
|
-
/** Call status. */
|
|
29
|
-
call_status?: string;
|
|
30
|
-
/** Name of the originating SIP trunk as configured in jambonz. */
|
|
31
|
-
originating_sip_trunk_name?: string;
|
|
32
|
-
/** IP address of the originating SIP trunk. */
|
|
33
|
-
originating_sip_ip?: string;
|
|
34
|
-
/** Service provider SID. */
|
|
35
|
-
service_provider_sid?: string;
|
|
36
|
-
/** Distributed tracing ID. */
|
|
37
|
-
trace_id?: string;
|
|
38
|
-
/** Call SID of the parent call (present for adulting / child call scenarios). */
|
|
39
|
-
parent_call_sid?: string;
|
|
40
|
-
/** jambonz REST API base URL for mid-call control. */
|
|
41
|
-
api_base_url?: string;
|
|
42
|
-
/**
|
|
43
|
-
* Raw SIP INVITE message (drachtio SipRequest, serialized).
|
|
44
|
-
* Only present for WebSocket and HTTP POST transports.
|
|
45
|
-
* See https://drachtio.org/api#sip-request for the full API.
|
|
46
|
-
*/
|
|
47
|
-
sip?: {
|
|
48
|
-
/** SIP headers as key-value pairs. Custom X-* headers are included. */
|
|
49
|
-
headers: Record<string, string>;
|
|
50
|
-
/** SIP message body (typically SDP). */
|
|
51
|
-
body?: string;
|
|
52
|
-
/** SIP method (always 'INVITE' for session:new). */
|
|
53
|
-
method?: string;
|
|
54
|
-
/** Request-URI from the SIP INVITE. */
|
|
55
|
-
uri?: string;
|
|
56
|
-
/** Phone number extracted from the Request-URI. */
|
|
57
|
-
calledNumber?: string;
|
|
58
|
-
/** Calling phone number from P-Asserted-Identity or From header. */
|
|
59
|
-
callingNumber?: string;
|
|
60
|
-
/** Transport protocol (e.g. 'udp', 'tcp', 'tls'). */
|
|
61
|
-
protocol?: string;
|
|
62
|
-
/** IP address of the sender. */
|
|
63
|
-
source_address?: string;
|
|
64
|
-
/** Port of the sender. */
|
|
65
|
-
source_port?: string | number;
|
|
66
|
-
};
|
|
67
|
-
/** Application environment variables configured in the jambonz portal. */
|
|
68
|
-
env_vars?: Record<string, string>;
|
|
69
|
-
/** Default speech settings for the account. */
|
|
70
|
-
defaults?: {
|
|
71
|
-
synthesizer?: {
|
|
72
|
-
vendor?: string;
|
|
73
|
-
language?: string;
|
|
74
|
-
voice?: string;
|
|
75
|
-
};
|
|
76
|
-
recognizer?: {
|
|
77
|
-
vendor?: string;
|
|
78
|
-
language?: string;
|
|
79
|
-
};
|
|
80
|
-
};
|
|
81
|
-
/** Custom data attached via the REST API when creating an outbound call. */
|
|
82
|
-
customerData?: Record<string, unknown>;
|
|
83
|
-
/** Additional properties. */
|
|
84
|
-
[key: string]: unknown;
|
|
85
|
-
}
|
|
86
|
-
/** TTS streaming event types sent by jambonz. */
|
|
87
|
-
type TtsStreamingEventType = 'stream_open' | 'stream_paused' | 'stream_resumed' | 'stream_closed' | 'user_interruption' | 'tts_spoken';
|
|
88
|
-
/** Payload for tts:streaming-event messages. */
|
|
89
|
-
interface TtsStreamingEvent {
|
|
90
|
-
event_type: TtsStreamingEventType;
|
|
91
|
-
/** The actual text spoken via TTS (present for tts_spoken events). */
|
|
92
|
-
text?: string;
|
|
93
|
-
/** Whether the user interrupted the TTS playout (present for tts_spoken events). */
|
|
94
|
-
bargein?: boolean;
|
|
95
|
-
}
|
|
96
|
-
/** WebSocket message types received from jambonz. */
|
|
97
|
-
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';
|
|
98
|
-
/** Agent eventHook event types. */
|
|
99
|
-
type AgentEventType = 'turn_end' | 'user_transcript' | 'llm_response' | 'user_interruption';
|
|
100
|
-
/** Preflight (early generation) metrics. */
|
|
101
|
-
interface AgentPreflightMetrics {
|
|
102
|
-
result: 'hit' | 'miss' | 'pending';
|
|
103
|
-
tokens?: number;
|
|
104
|
-
}
|
|
105
|
-
/** Per-turn latency metrics (all values in milliseconds). */
|
|
106
|
-
interface AgentTurnLatency {
|
|
107
|
-
/** STT processing latency: stop talking to final transcript received. */
|
|
108
|
-
transcriber_latency?: number;
|
|
109
|
-
/** Additional wait after transcript for end-of-turn detection. */
|
|
110
|
-
turn_detection_latency?: number;
|
|
111
|
-
/** LLM latency: wait for first token after ready to prompt. Absent on preflight hit. */
|
|
112
|
-
model_latency?: number;
|
|
113
|
-
/** TTS engine latency: first text sent to TTS until first audio received. */
|
|
114
|
-
voice_latency?: number;
|
|
115
|
-
/** Early generation metrics. */
|
|
116
|
-
preflight?: AgentPreflightMetrics;
|
|
117
|
-
}
|
|
118
|
-
/** Payload for agent:event turn_end messages. */
|
|
119
|
-
interface AgentTurnEndEvent {
|
|
120
|
-
type: 'turn_end';
|
|
121
|
-
transcript: string;
|
|
122
|
-
response: string;
|
|
123
|
-
interrupted: boolean;
|
|
124
|
-
latency: AgentTurnLatency;
|
|
125
|
-
}
|
|
126
|
-
/** Payload for agent:event user_transcript messages. */
|
|
127
|
-
interface AgentUserTranscriptEvent {
|
|
128
|
-
type: 'user_transcript';
|
|
129
|
-
transcript: string;
|
|
130
|
-
}
|
|
131
|
-
/** Payload for agent:event llm_response messages. */
|
|
132
|
-
interface AgentLlmResponseEvent {
|
|
133
|
-
type: 'llm_response';
|
|
134
|
-
response: string;
|
|
135
|
-
}
|
|
136
|
-
/** Payload for agent:event user_interruption messages. */
|
|
137
|
-
interface AgentUserInterruptionEvent {
|
|
138
|
-
type: 'user_interruption';
|
|
139
|
-
}
|
|
140
|
-
/** Union of all agent eventHook payloads. */
|
|
141
|
-
type AgentEvent = AgentTurnEndEvent | AgentUserTranscriptEvent | AgentLlmResponseEvent | AgentUserInterruptionEvent;
|
|
142
|
-
/** Inbound WebSocket message from jambonz. */
|
|
143
|
-
interface WsMessage {
|
|
144
|
-
type: WsMessageType;
|
|
145
|
-
msgid: string;
|
|
146
|
-
call_sid?: string;
|
|
147
|
-
hook?: string;
|
|
148
|
-
data?: Record<string, unknown>;
|
|
149
|
-
b3?: string;
|
|
150
|
-
}
|
|
151
|
-
/** Outbound WebSocket message to jambonz. */
|
|
152
|
-
interface WsResponse {
|
|
153
|
-
type: 'ack' | 'command';
|
|
154
|
-
msgid?: string;
|
|
155
|
-
command?: string;
|
|
156
|
-
queueCommand?: boolean;
|
|
157
|
-
data?: unknown;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
export type { AgentEvent as A, CallSession as C, TtsStreamingEvent as T, WsMessage as W, AgentEventType as a, AgentLlmResponseEvent as b, AgentPreflightMetrics as c, AgentTurnEndEvent as d, AgentTurnLatency as e, AgentUserInterruptionEvent as f, AgentUserTranscriptEvent as g, TtsStreamingEventType as h, WsMessageType as i, WsResponse as j };
|