@jambonz/sdk 0.1.26 → 0.1.28

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 (36) hide show
  1. package/dist/client/index.cjs +9 -0
  2. package/dist/client/index.cjs.map +1 -1
  3. package/dist/client/index.d.cts +8 -2
  4. package/dist/client/index.d.ts +8 -2
  5. package/dist/client/index.js +9 -0
  6. package/dist/client/index.js.map +1 -1
  7. package/dist/index.cjs +18 -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 +18 -0
  12. package/dist/index.js.map +1 -1
  13. package/dist/{rest-DzbjthIp.d.ts → rest-Bm5uZqIB.d.ts} +9 -1
  14. package/dist/{rest-CQaCWVvC.d.cts → rest-VprW36o-.d.cts} +9 -1
  15. package/dist/{session-B6KvPS3U.d.cts → session-DVGHbtan.d.cts} +46 -2
  16. package/dist/{session-B6KvPS3U.d.ts → session-DVGHbtan.d.ts} +46 -2
  17. package/dist/types/index.d.cts +3 -3
  18. package/dist/types/index.d.ts +3 -3
  19. package/dist/{verb-builder-Cs3DsBTO.d.ts → verb-builder-CnqpQcT3.d.ts} +1 -1
  20. package/dist/{verb-builder-CDtXPHlG.d.cts → verb-builder-DHzc_LPM.d.cts} +1 -1
  21. package/dist/{verbs-B0sjXLLN.d.cts → verbs-DB-J_0eQ.d.cts} +9 -0
  22. package/dist/{verbs-B0sjXLLN.d.ts → verbs-DB-J_0eQ.d.ts} +9 -0
  23. package/dist/webhook/index.d.cts +2 -2
  24. package/dist/webhook/index.d.ts +2 -2
  25. package/dist/websocket/index.cjs +9 -0
  26. package/dist/websocket/index.cjs.map +1 -1
  27. package/dist/websocket/index.d.cts +9 -3
  28. package/dist/websocket/index.d.ts +9 -3
  29. package/dist/websocket/index.js +9 -0
  30. package/dist/websocket/index.js.map +1 -1
  31. package/package.json +1 -1
  32. package/schema/callbacks/pipeline-turn.schema.json +88 -46
  33. package/schema/components/synthesizer.schema.json +2 -2
  34. package/schema/jambonz-app.schema.json +1 -1
  35. package/schema/verbs/config.schema.json +1 -1
  36. package/schema/verbs/pipeline.schema.json +62 -0
@@ -94,7 +94,51 @@ interface TtsStreamingEvent {
94
94
  bargein?: boolean;
95
95
  }
96
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' | 'tts:streaming-event' | 'tts:tokens-result' | 'jambonz:error';
97
+ type WsMessageType = 'session:new' | 'session:adulting' | 'session:reconnect' | 'session:redirect' | 'verb:hook' | 'dial:confirm' | 'call:status' | 'verb:status' | 'llm:event' | 'llm:tool-call' | 'pipeline:event' | 'pipeline:tool-call' | 'tts:streaming-event' | 'tts:tokens-result' | 'jambonz:error';
98
+ /** Pipeline eventHook event types. */
99
+ type PipelineEventType = 'turn_end' | 'user_transcript' | 'agent_response' | 'user_interruption';
100
+ /** Preflight (early generation) metrics. */
101
+ interface PipelinePreflightMetrics {
102
+ result: 'hit' | 'miss' | 'pending';
103
+ tokens?: number;
104
+ }
105
+ /** Per-turn latency metrics (all values in milliseconds). */
106
+ interface PipelineTurnLatency {
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?: PipelinePreflightMetrics;
117
+ }
118
+ /** Payload for pipeline:event turn_end messages. */
119
+ interface PipelineTurnEndEvent {
120
+ type: 'turn_end';
121
+ transcript: string;
122
+ response: string;
123
+ interrupted: boolean;
124
+ latency: PipelineTurnLatency;
125
+ }
126
+ /** Payload for pipeline:event user_transcript messages. */
127
+ interface PipelineUserTranscriptEvent {
128
+ type: 'user_transcript';
129
+ transcript: string;
130
+ }
131
+ /** Payload for pipeline:event agent_response messages. */
132
+ interface PipelineAgentResponseEvent {
133
+ type: 'agent_response';
134
+ response: string;
135
+ }
136
+ /** Payload for pipeline:event user_interruption messages. */
137
+ interface PipelineUserInterruptionEvent {
138
+ type: 'user_interruption';
139
+ }
140
+ /** Union of all pipeline eventHook payloads. */
141
+ type PipelineEvent = PipelineTurnEndEvent | PipelineUserTranscriptEvent | PipelineAgentResponseEvent | PipelineUserInterruptionEvent;
98
142
  /** Inbound WebSocket message from jambonz. */
99
143
  interface WsMessage {
100
144
  type: WsMessageType;
@@ -113,4 +157,4 @@ interface WsResponse {
113
157
  data?: unknown;
114
158
  }
115
159
 
116
- export type { CallSession as C, TtsStreamingEvent as T, WsMessage as W, TtsStreamingEventType as a, WsMessageType as b, WsResponse as c };
160
+ export type { CallSession as C, PipelineAgentResponseEvent as P, TtsStreamingEvent as T, WsMessage as W, PipelineEvent as a, PipelineEventType as b, PipelinePreflightMetrics as c, PipelineTurnEndEvent as d, PipelineTurnLatency as e, PipelineUserInterruptionEvent as f, PipelineUserTranscriptEvent as g, TtsStreamingEventType as h, WsMessageType as i, WsResponse as j };
@@ -94,7 +94,51 @@ interface TtsStreamingEvent {
94
94
  bargein?: boolean;
95
95
  }
96
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' | 'tts:streaming-event' | 'tts:tokens-result' | 'jambonz:error';
97
+ type WsMessageType = 'session:new' | 'session:adulting' | 'session:reconnect' | 'session:redirect' | 'verb:hook' | 'dial:confirm' | 'call:status' | 'verb:status' | 'llm:event' | 'llm:tool-call' | 'pipeline:event' | 'pipeline:tool-call' | 'tts:streaming-event' | 'tts:tokens-result' | 'jambonz:error';
98
+ /** Pipeline eventHook event types. */
99
+ type PipelineEventType = 'turn_end' | 'user_transcript' | 'agent_response' | 'user_interruption';
100
+ /** Preflight (early generation) metrics. */
101
+ interface PipelinePreflightMetrics {
102
+ result: 'hit' | 'miss' | 'pending';
103
+ tokens?: number;
104
+ }
105
+ /** Per-turn latency metrics (all values in milliseconds). */
106
+ interface PipelineTurnLatency {
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?: PipelinePreflightMetrics;
117
+ }
118
+ /** Payload for pipeline:event turn_end messages. */
119
+ interface PipelineTurnEndEvent {
120
+ type: 'turn_end';
121
+ transcript: string;
122
+ response: string;
123
+ interrupted: boolean;
124
+ latency: PipelineTurnLatency;
125
+ }
126
+ /** Payload for pipeline:event user_transcript messages. */
127
+ interface PipelineUserTranscriptEvent {
128
+ type: 'user_transcript';
129
+ transcript: string;
130
+ }
131
+ /** Payload for pipeline:event agent_response messages. */
132
+ interface PipelineAgentResponseEvent {
133
+ type: 'agent_response';
134
+ response: string;
135
+ }
136
+ /** Payload for pipeline:event user_interruption messages. */
137
+ interface PipelineUserInterruptionEvent {
138
+ type: 'user_interruption';
139
+ }
140
+ /** Union of all pipeline eventHook payloads. */
141
+ type PipelineEvent = PipelineTurnEndEvent | PipelineUserTranscriptEvent | PipelineAgentResponseEvent | PipelineUserInterruptionEvent;
98
142
  /** Inbound WebSocket message from jambonz. */
99
143
  interface WsMessage {
100
144
  type: WsMessageType;
@@ -113,4 +157,4 @@ interface WsResponse {
113
157
  data?: unknown;
114
158
  }
115
159
 
116
- export type { CallSession as C, TtsStreamingEvent as T, WsMessage as W, TtsStreamingEventType as a, WsMessageType as b, WsResponse as c };
160
+ export type { CallSession as C, PipelineAgentResponseEvent as P, TtsStreamingEvent as T, WsMessage as W, PipelineEvent as a, PipelineEventType as b, PipelinePreflightMetrics as c, PipelineTurnEndEvent as d, PipelineTurnLatency as e, PipelineUserInterruptionEvent as f, PipelineUserTranscriptEvent as g, TtsStreamingEventType as h, WsMessageType as i, WsResponse as j };
@@ -1,4 +1,4 @@
1
- export { A as ActionHook, a as ActionHookDelayAction, b as ActionHookObject, c as AlertVerb, d as Amd, e as AmdTimers, f as AnswerVerb, g as Auth, B as BidirectionalAudio, C as ConferenceVerb, h as ConfigVerb, D as DequeueVerb, i as DialVerb, j as DtmfVerb, k as DubVerb, E as EnqueueVerb, F as FillerNoise, G as GatherVerb, H as HangupVerb, J as JambonzApp, L as LeaveVerb, l as ListenVerb, m as LlmVerb, M as McpServerConfig, n as MessageVerb, P as PauseVerb, o as PipelineVerb, p as PlayVerb, R as Recognizer, q as RedirectVerb, S as SayVerb, r as SipDeclineVerb, s as SipReferVerb, t as SipRequestVerb, u as StreamVerb, v as Synthesizer, T as TagVerb, w as Target, x as TranscribeVerb, V as Vad, y as Verb, z as VerbName } from '../verbs-B0sjXLLN.cjs';
2
- export { C as CallSession, T as TtsStreamingEvent, a as TtsStreamingEventType, W as WsMessage, b as WsMessageType, c as WsResponse } from '../session-B6KvPS3U.cjs';
1
+ export { A as ActionHook, a as ActionHookDelayAction, b as ActionHookObject, c as AlertVerb, d as Amd, e as AmdTimers, f as AnswerVerb, g as Auth, B as BidirectionalAudio, C as ConferenceVerb, h as ConfigVerb, D as DequeueVerb, i as DialVerb, j as DtmfVerb, k as DubVerb, E as EnqueueVerb, F as FillerNoise, G as GatherVerb, H as HangupVerb, J as JambonzApp, L as LeaveVerb, l as ListenVerb, m as LlmVerb, M as McpServerConfig, n as MessageVerb, P as PauseVerb, o as PipelineVerb, p as PlayVerb, R as Recognizer, q as RedirectVerb, S as SayVerb, r as SipDeclineVerb, s as SipReferVerb, t as SipRequestVerb, u as StreamVerb, v as Synthesizer, T as TagVerb, w as Target, x as TranscribeVerb, V as Vad, y as Verb, z as VerbName } from '../verbs-DB-J_0eQ.cjs';
2
+ export { C as CallSession, P as PipelineAgentResponseEvent, a as PipelineEvent, b as PipelineEventType, c as PipelinePreflightMetrics, d as PipelineTurnEndEvent, e as PipelineTurnLatency, f as PipelineUserInterruptionEvent, g as PipelineUserTranscriptEvent, T as TtsStreamingEvent, h as TtsStreamingEventType, W as WsMessage, i as WsMessageType, j as WsResponse } from '../session-DVGHbtan.cjs';
3
3
  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-CQaCWVvC.cjs';
4
+ export { C as CallCount, a as CallInfo, b as CreateCallRequest, L as ListCallsFilter, Q as QueueInfo, U as UpdateCallRequest } from '../rest-VprW36o-.cjs';
@@ -1,4 +1,4 @@
1
- export { A as ActionHook, a as ActionHookDelayAction, b as ActionHookObject, c as AlertVerb, d as Amd, e as AmdTimers, f as AnswerVerb, g as Auth, B as BidirectionalAudio, C as ConferenceVerb, h as ConfigVerb, D as DequeueVerb, i as DialVerb, j as DtmfVerb, k as DubVerb, E as EnqueueVerb, F as FillerNoise, G as GatherVerb, H as HangupVerb, J as JambonzApp, L as LeaveVerb, l as ListenVerb, m as LlmVerb, M as McpServerConfig, n as MessageVerb, P as PauseVerb, o as PipelineVerb, p as PlayVerb, R as Recognizer, q as RedirectVerb, S as SayVerb, r as SipDeclineVerb, s as SipReferVerb, t as SipRequestVerb, u as StreamVerb, v as Synthesizer, T as TagVerb, w as Target, x as TranscribeVerb, V as Vad, y as Verb, z as VerbName } from '../verbs-B0sjXLLN.js';
2
- export { C as CallSession, T as TtsStreamingEvent, a as TtsStreamingEventType, W as WsMessage, b as WsMessageType, c as WsResponse } from '../session-B6KvPS3U.js';
1
+ export { A as ActionHook, a as ActionHookDelayAction, b as ActionHookObject, c as AlertVerb, d as Amd, e as AmdTimers, f as AnswerVerb, g as Auth, B as BidirectionalAudio, C as ConferenceVerb, h as ConfigVerb, D as DequeueVerb, i as DialVerb, j as DtmfVerb, k as DubVerb, E as EnqueueVerb, F as FillerNoise, G as GatherVerb, H as HangupVerb, J as JambonzApp, L as LeaveVerb, l as ListenVerb, m as LlmVerb, M as McpServerConfig, n as MessageVerb, P as PauseVerb, o as PipelineVerb, p as PlayVerb, R as Recognizer, q as RedirectVerb, S as SayVerb, r as SipDeclineVerb, s as SipReferVerb, t as SipRequestVerb, u as StreamVerb, v as Synthesizer, T as TagVerb, w as Target, x as TranscribeVerb, V as Vad, y as Verb, z as VerbName } from '../verbs-DB-J_0eQ.js';
2
+ export { C as CallSession, P as PipelineAgentResponseEvent, a as PipelineEvent, b as PipelineEventType, c as PipelinePreflightMetrics, d as PipelineTurnEndEvent, e as PipelineTurnLatency, f as PipelineUserInterruptionEvent, g as PipelineUserTranscriptEvent, T as TtsStreamingEvent, h as TtsStreamingEventType, W as WsMessage, i as WsMessageType, j as WsResponse } from '../session-DVGHbtan.js';
3
3
  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-DzbjthIp.js';
4
+ export { C as CallCount, a as CallInfo, b as CreateCallRequest, L as ListCallsFilter, Q as QueueInfo, U as UpdateCallRequest } from '../rest-Bm5uZqIB.js';
@@ -1,4 +1,4 @@
1
- import { y as Verb, S as SayVerb, p as PlayVerb, G as GatherVerb, m as LlmVerb, I as S2sVerb, K as LlmBaseOptions, N as DialogflowVerb, o as PipelineVerb, l as ListenVerb, u as StreamVerb, x as TranscribeVerb, i as DialVerb, C as ConferenceVerb, E as EnqueueVerb, D as DequeueVerb, H as HangupVerb, q as RedirectVerb, P as PauseVerb, L as LeaveVerb, r as SipDeclineVerb, t as SipRequestVerb, s as SipReferVerb, h as ConfigVerb, f as AnswerVerb, c as AlertVerb, T as TagVerb, j as DtmfVerb, k as DubVerb, n as MessageVerb } from './verbs-B0sjXLLN.js';
1
+ import { y as Verb, S as SayVerb, p as PlayVerb, G as GatherVerb, m as LlmVerb, I as S2sVerb, K as LlmBaseOptions, N as DialogflowVerb, o as PipelineVerb, l as ListenVerb, u as StreamVerb, x as TranscribeVerb, i as DialVerb, C as ConferenceVerb, E as EnqueueVerb, D as DequeueVerb, H as HangupVerb, q as RedirectVerb, P as PauseVerb, L as LeaveVerb, r as SipDeclineVerb, t as SipRequestVerb, s as SipReferVerb, h as ConfigVerb, f as AnswerVerb, c as AlertVerb, T as TagVerb, j as DtmfVerb, k as DubVerb, n as MessageVerb } from './verbs-DB-J_0eQ.js';
2
2
 
3
3
  /**
4
4
  * Schema-based validation using AJV.
@@ -1,4 +1,4 @@
1
- import { y as Verb, S as SayVerb, p as PlayVerb, G as GatherVerb, m as LlmVerb, I as S2sVerb, K as LlmBaseOptions, N as DialogflowVerb, o as PipelineVerb, l as ListenVerb, u as StreamVerb, x as TranscribeVerb, i as DialVerb, C as ConferenceVerb, E as EnqueueVerb, D as DequeueVerb, H as HangupVerb, q as RedirectVerb, P as PauseVerb, L as LeaveVerb, r as SipDeclineVerb, t as SipRequestVerb, s as SipReferVerb, h as ConfigVerb, f as AnswerVerb, c as AlertVerb, T as TagVerb, j as DtmfVerb, k as DubVerb, n as MessageVerb } from './verbs-B0sjXLLN.cjs';
1
+ import { y as Verb, S as SayVerb, p as PlayVerb, G as GatherVerb, m as LlmVerb, I as S2sVerb, K as LlmBaseOptions, N as DialogflowVerb, o as PipelineVerb, l as ListenVerb, u as StreamVerb, x as TranscribeVerb, i as DialVerb, C as ConferenceVerb, E as EnqueueVerb, D as DequeueVerb, H as HangupVerb, q as RedirectVerb, P as PauseVerb, L as LeaveVerb, r as SipDeclineVerb, t as SipRequestVerb, s as SipReferVerb, h as ConfigVerb, f as AnswerVerb, c as AlertVerb, T as TagVerb, j as DtmfVerb, k as DubVerb, n as MessageVerb } from './verbs-DB-J_0eQ.cjs';
2
2
 
3
3
  /**
4
4
  * Schema-based validation using AJV.
@@ -468,6 +468,15 @@ interface PipelineVerb {
468
468
  greeting?: boolean;
469
469
  /** Speculatively prompt the LLM on final transcript before Krisp end-of-turn. Default: false. */
470
470
  earlyGeneration?: boolean;
471
+ /** Enable server-side noise isolation to reduce background noise on call audio. Defaults to inbound (caller) audio; set direction to 'write' for outbound. */
472
+ noiseIsolation?: 'krisp' | 'rnnoise' | {
473
+ mode: string;
474
+ level?: number;
475
+ direction?: 'read' | 'write';
476
+ model?: string;
477
+ };
478
+ /** External MCP servers that provide tools to the LLM. */
479
+ mcpServers?: McpServerConfig[];
471
480
  }
472
481
  interface ListenVerb {
473
482
  verb: 'listen';
@@ -468,6 +468,15 @@ interface PipelineVerb {
468
468
  greeting?: boolean;
469
469
  /** Speculatively prompt the LLM on final transcript before Krisp end-of-turn. Default: false. */
470
470
  earlyGeneration?: boolean;
471
+ /** Enable server-side noise isolation to reduce background noise on call audio. Defaults to inbound (caller) audio; set direction to 'write' for outbound. */
472
+ noiseIsolation?: 'krisp' | 'rnnoise' | {
473
+ mode: string;
474
+ level?: number;
475
+ direction?: 'read' | 'write';
476
+ model?: string;
477
+ };
478
+ /** External MCP servers that provide tools to the LLM. */
479
+ mcpServers?: McpServerConfig[];
471
480
  }
472
481
  interface ListenVerb {
473
482
  verb: 'listen';
@@ -1,5 +1,5 @@
1
- import { b as VerbBuilder, c as VerbBuilderOptions } from '../verb-builder-CDtXPHlG.cjs';
2
- import { J as JambonzApp } from '../verbs-B0sjXLLN.cjs';
1
+ import { b as VerbBuilder, c as VerbBuilderOptions } from '../verb-builder-DHzc_LPM.cjs';
2
+ import { J as JambonzApp } from '../verbs-DB-J_0eQ.cjs';
3
3
  import { IncomingMessage, ServerResponse } from 'http';
4
4
  import { a as EnvVarSchema } from '../common-BSJZX7WO.cjs';
5
5
 
@@ -1,5 +1,5 @@
1
- import { b as VerbBuilder, c as VerbBuilderOptions } from '../verb-builder-Cs3DsBTO.js';
2
- import { J as JambonzApp } from '../verbs-B0sjXLLN.js';
1
+ import { b as VerbBuilder, c as VerbBuilderOptions } from '../verb-builder-CnqpQcT3.js';
2
+ import { J as JambonzApp } from '../verbs-DB-J_0eQ.js';
3
3
  import { IncomingMessage, ServerResponse } from 'http';
4
4
  import { a as EnvVarSchema } from '../common-BSJZX7WO.js';
5
5
 
@@ -658,6 +658,13 @@ var Session = class extends events.EventEmitter {
658
658
  injectMute(status, callSid) {
659
659
  this.injectCommand("mute:status", { mute_status: status }, callSid);
660
660
  }
661
+ /** Enable or disable server-side noise isolation. */
662
+ injectNoiseIsolation(status, opts, callSid) {
663
+ this.injectCommand("noiseIsolation:status", {
664
+ noise_isolation_status: status,
665
+ ...opts
666
+ }, callSid);
667
+ }
661
668
  /** Pause or resume audio streaming (listen/stream). */
662
669
  injectListenStatus(status, callSid) {
663
670
  this.injectCommand("listen:status", { listen_status: status }, callSid);
@@ -819,6 +826,8 @@ var Session = class extends events.EventEmitter {
819
826
  break;
820
827
  case "llm:event":
821
828
  case "llm:tool-call":
829
+ case "pipeline:event":
830
+ case "pipeline:tool-call":
822
831
  if (hook) {
823
832
  this.emit(hook, data);
824
833
  }