@jambonz/sdk 0.3.1 → 0.4.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/AGENTS.md +6 -0
- package/dist/client/index.d.cts +2 -2
- package/dist/client/index.d.ts +2 -2
- package/dist/index.cjs +11 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/dist/{rest-BvOtq44O.d.cts → rest-CwkBZto9.d.cts} +1 -1
- package/dist/{rest-DAAEUWsa.d.ts → rest-DevN7TD1.d.ts} +1 -1
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/{verb-builder-D5XRbTtu.d.ts → verb-builder-BRsGhe7j.d.ts} +1 -1
- package/dist/{verb-builder-CFPD9yWI.d.cts → verb-builder-DoLeroIU.d.cts} +1 -1
- package/dist/{verbs-DKy6nGIH.d.cts → verbs-mXzecf0-.d.cts} +56 -2
- package/dist/{verbs-DKy6nGIH.d.ts → verbs-mXzecf0-.d.ts} +56 -2
- package/dist/webhook/index.d.cts +2 -2
- package/dist/webhook/index.d.ts +2 -2
- package/dist/websocket/index.cjs +11 -1
- package/dist/websocket/index.cjs.map +1 -1
- package/dist/websocket/index.d.cts +14 -4
- package/dist/websocket/index.d.ts +14 -4
- package/dist/websocket/index.js +11 -1
- package/dist/websocket/index.js.map +1 -1
- package/package.json +2 -2
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as ActionHook, a as ActionHookDelayAction, b as ActionHookObject, c as
|
|
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 HangupVerb, J as JambonzApp, L as LeaveVerb, o as ListenVerb, p as LlmMessage, q as LlmTool, r as LlmToolOpenAIWrapped, s as LlmToolOutputData, t as LlmVerb, M as McpServerConfig, u as MessageVerb, P as PauseVerb, v as PlayVerb, R as Recognizer, w as RedirectVerb, S as SayVerb, x as SipDeclineVerb, y as SipReferVerb, z as SipRequestVerb, I as StreamVerb, K as Synthesizer, T as TagVerb, N as Target, O as TranscribeVerb, V as Vad, Q as Verb, U as VerbName } from '../verbs-mXzecf0-.js';
|
|
2
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';
|
|
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-
|
|
4
|
+
export { C as CallCount, a as CallInfo, b as CreateCallRequest, L as ListCallsFilter, Q as QueueInfo, U as UpdateCallRequest } from '../rest-DevN7TD1.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Q as Verb, S as SayVerb, v as PlayVerb, G as GatherVerb, t as LlmVerb, W as S2sVerb, X as LlmBaseOptions, Y as DialogflowVerb, e as AgentVerb, o as ListenVerb, I as StreamVerb, O as TranscribeVerb, l as DialVerb, C as ConferenceVerb, E as EnqueueVerb, D as DequeueVerb, H as HangupVerb, w as RedirectVerb, P as PauseVerb, L as LeaveVerb, x as SipDeclineVerb, z as SipRequestVerb, y as SipReferVerb, k as ConfigVerb, i as AnswerVerb, f as AlertVerb, T as TagVerb, m as DtmfVerb, n as DubVerb, u as MessageVerb } from './verbs-mXzecf0-.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Schema-based validation using AJV.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Q as Verb, S as SayVerb, v as PlayVerb, G as GatherVerb, t as LlmVerb, W as S2sVerb, X as LlmBaseOptions, Y as DialogflowVerb, e as AgentVerb, o as ListenVerb, I as StreamVerb, O as TranscribeVerb, l as DialVerb, C as ConferenceVerb, E as EnqueueVerb, D as DequeueVerb, H as HangupVerb, w as RedirectVerb, P as PauseVerb, L as LeaveVerb, x as SipDeclineVerb, z as SipRequestVerb, y as SipReferVerb, k as ConfigVerb, i as AnswerVerb, f as AlertVerb, T as TagVerb, m as DtmfVerb, n as DubVerb, u as MessageVerb } from './verbs-mXzecf0-.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Schema-based validation using AJV.
|
|
@@ -340,6 +340,60 @@ interface McpServerConfig {
|
|
|
340
340
|
auth?: Record<string, unknown>;
|
|
341
341
|
roots?: Record<string, unknown>[];
|
|
342
342
|
}
|
|
343
|
+
/** A conversation-history message passed via `llmOptions.messages`. */
|
|
344
|
+
interface LlmMessage {
|
|
345
|
+
role: 'system' | 'user' | 'assistant' | 'tool';
|
|
346
|
+
content: string | unknown;
|
|
347
|
+
[key: string]: unknown;
|
|
348
|
+
}
|
|
349
|
+
/** Tool / function definition (MCP-flat canonical shape). */
|
|
350
|
+
interface LlmTool {
|
|
351
|
+
name: string;
|
|
352
|
+
description?: string;
|
|
353
|
+
parameters?: Record<string, unknown>;
|
|
354
|
+
}
|
|
355
|
+
/** OpenAI-wrapped tool shape — also accepted for back-compat. */
|
|
356
|
+
interface LlmToolOpenAIWrapped {
|
|
357
|
+
type: 'function';
|
|
358
|
+
function: LlmTool;
|
|
359
|
+
}
|
|
360
|
+
/** Canonical tool-output payload carried by `llm:tool-output` commands. */
|
|
361
|
+
interface LlmToolOutputData {
|
|
362
|
+
result?: unknown;
|
|
363
|
+
[key: string]: unknown;
|
|
364
|
+
}
|
|
365
|
+
/** Per-call LLM configuration for the agent verb. */
|
|
366
|
+
interface AgentLlmOptions {
|
|
367
|
+
/** System prompt. Placed vendor-appropriately by the feature-server wrapper. */
|
|
368
|
+
systemPrompt?: string;
|
|
369
|
+
/** Seed conversation history. A role:'system' entry is extracted into systemPrompt. */
|
|
370
|
+
messages?: LlmMessage[];
|
|
371
|
+
/** Alias of `messages` (historical). */
|
|
372
|
+
initialMessages?: LlmMessage[];
|
|
373
|
+
/** Maximum tokens the model may generate per turn. */
|
|
374
|
+
maxTokens?: number;
|
|
375
|
+
/** Sampling temperature. */
|
|
376
|
+
temperature?: number;
|
|
377
|
+
/** Tools / functions the model may call. */
|
|
378
|
+
tools?: (LlmTool | LlmToolOpenAIWrapped)[];
|
|
379
|
+
}
|
|
380
|
+
/** `llm` block on the agent verb. */
|
|
381
|
+
interface AgentLlm {
|
|
382
|
+
vendor: 'openai' | 'anthropic' | 'google' | 'vertex-gemini' | 'vertex-openai' | 'bedrock' | 'deepseek';
|
|
383
|
+
model: string;
|
|
384
|
+
label?: string;
|
|
385
|
+
auth?: {
|
|
386
|
+
apiKey?: string;
|
|
387
|
+
[key: string]: unknown;
|
|
388
|
+
};
|
|
389
|
+
connectOptions?: {
|
|
390
|
+
timeout?: number;
|
|
391
|
+
maxRetries?: number;
|
|
392
|
+
endpoint?: string;
|
|
393
|
+
baseURL?: string;
|
|
394
|
+
};
|
|
395
|
+
llmOptions?: AgentLlmOptions;
|
|
396
|
+
}
|
|
343
397
|
/** Shared properties for llm, s2s, and vendor-specific s2s verbs. */
|
|
344
398
|
interface LlmBaseOptions {
|
|
345
399
|
id?: string;
|
|
@@ -457,7 +511,7 @@ interface AgentVerb {
|
|
|
457
511
|
sticky?: boolean;
|
|
458
512
|
};
|
|
459
513
|
/** LLM configuration. */
|
|
460
|
-
llm:
|
|
514
|
+
llm: AgentLlm;
|
|
461
515
|
/** Webhook when agent ends. */
|
|
462
516
|
actionHook?: ActionHook;
|
|
463
517
|
/** Webhook for agent events. */
|
|
@@ -888,4 +942,4 @@ type JambonzApp = Verb[];
|
|
|
888
942
|
/** All valid verb names. */
|
|
889
943
|
type VerbName = Verb['verb'];
|
|
890
944
|
|
|
891
|
-
export type { ActionHook as A, BidirectionalAudio as B, ConferenceVerb as C, DequeueVerb as D, EnqueueVerb as E, FillerNoise as F, GatherVerb as G, HangupVerb as H,
|
|
945
|
+
export type { ActionHook as A, BidirectionalAudio as B, ConferenceVerb as C, DequeueVerb as D, EnqueueVerb as E, FillerNoise as F, GatherVerb as G, HangupVerb as H, StreamVerb as I, JambonzApp as J, Synthesizer as K, LeaveVerb as L, McpServerConfig as M, Target as N, TranscribeVerb as O, PauseVerb as P, Verb as Q, Recognizer as R, SayVerb as S, TagVerb as T, VerbName as U, Vad as V, S2sVerb as W, LlmBaseOptions as X, DialogflowVerb as Y, ActionHookDelayAction as a, ActionHookObject as b, AgentLlm as c, AgentLlmOptions as d, AgentVerb as e, AlertVerb as f, Amd as g, AmdTimers as h, AnswerVerb as i, Auth as j, ConfigVerb as k, DialVerb as l, DtmfVerb as m, DubVerb as n, ListenVerb as o, LlmMessage as p, LlmTool as q, LlmToolOpenAIWrapped as r, LlmToolOutputData as s, LlmVerb as t, MessageVerb as u, PlayVerb as v, RedirectVerb as w, SipDeclineVerb as x, SipReferVerb as y, SipRequestVerb as z };
|
|
@@ -340,6 +340,60 @@ interface McpServerConfig {
|
|
|
340
340
|
auth?: Record<string, unknown>;
|
|
341
341
|
roots?: Record<string, unknown>[];
|
|
342
342
|
}
|
|
343
|
+
/** A conversation-history message passed via `llmOptions.messages`. */
|
|
344
|
+
interface LlmMessage {
|
|
345
|
+
role: 'system' | 'user' | 'assistant' | 'tool';
|
|
346
|
+
content: string | unknown;
|
|
347
|
+
[key: string]: unknown;
|
|
348
|
+
}
|
|
349
|
+
/** Tool / function definition (MCP-flat canonical shape). */
|
|
350
|
+
interface LlmTool {
|
|
351
|
+
name: string;
|
|
352
|
+
description?: string;
|
|
353
|
+
parameters?: Record<string, unknown>;
|
|
354
|
+
}
|
|
355
|
+
/** OpenAI-wrapped tool shape — also accepted for back-compat. */
|
|
356
|
+
interface LlmToolOpenAIWrapped {
|
|
357
|
+
type: 'function';
|
|
358
|
+
function: LlmTool;
|
|
359
|
+
}
|
|
360
|
+
/** Canonical tool-output payload carried by `llm:tool-output` commands. */
|
|
361
|
+
interface LlmToolOutputData {
|
|
362
|
+
result?: unknown;
|
|
363
|
+
[key: string]: unknown;
|
|
364
|
+
}
|
|
365
|
+
/** Per-call LLM configuration for the agent verb. */
|
|
366
|
+
interface AgentLlmOptions {
|
|
367
|
+
/** System prompt. Placed vendor-appropriately by the feature-server wrapper. */
|
|
368
|
+
systemPrompt?: string;
|
|
369
|
+
/** Seed conversation history. A role:'system' entry is extracted into systemPrompt. */
|
|
370
|
+
messages?: LlmMessage[];
|
|
371
|
+
/** Alias of `messages` (historical). */
|
|
372
|
+
initialMessages?: LlmMessage[];
|
|
373
|
+
/** Maximum tokens the model may generate per turn. */
|
|
374
|
+
maxTokens?: number;
|
|
375
|
+
/** Sampling temperature. */
|
|
376
|
+
temperature?: number;
|
|
377
|
+
/** Tools / functions the model may call. */
|
|
378
|
+
tools?: (LlmTool | LlmToolOpenAIWrapped)[];
|
|
379
|
+
}
|
|
380
|
+
/** `llm` block on the agent verb. */
|
|
381
|
+
interface AgentLlm {
|
|
382
|
+
vendor: 'openai' | 'anthropic' | 'google' | 'vertex-gemini' | 'vertex-openai' | 'bedrock' | 'deepseek';
|
|
383
|
+
model: string;
|
|
384
|
+
label?: string;
|
|
385
|
+
auth?: {
|
|
386
|
+
apiKey?: string;
|
|
387
|
+
[key: string]: unknown;
|
|
388
|
+
};
|
|
389
|
+
connectOptions?: {
|
|
390
|
+
timeout?: number;
|
|
391
|
+
maxRetries?: number;
|
|
392
|
+
endpoint?: string;
|
|
393
|
+
baseURL?: string;
|
|
394
|
+
};
|
|
395
|
+
llmOptions?: AgentLlmOptions;
|
|
396
|
+
}
|
|
343
397
|
/** Shared properties for llm, s2s, and vendor-specific s2s verbs. */
|
|
344
398
|
interface LlmBaseOptions {
|
|
345
399
|
id?: string;
|
|
@@ -457,7 +511,7 @@ interface AgentVerb {
|
|
|
457
511
|
sticky?: boolean;
|
|
458
512
|
};
|
|
459
513
|
/** LLM configuration. */
|
|
460
|
-
llm:
|
|
514
|
+
llm: AgentLlm;
|
|
461
515
|
/** Webhook when agent ends. */
|
|
462
516
|
actionHook?: ActionHook;
|
|
463
517
|
/** Webhook for agent events. */
|
|
@@ -888,4 +942,4 @@ type JambonzApp = Verb[];
|
|
|
888
942
|
/** All valid verb names. */
|
|
889
943
|
type VerbName = Verb['verb'];
|
|
890
944
|
|
|
891
|
-
export type { ActionHook as A, BidirectionalAudio as B, ConferenceVerb as C, DequeueVerb as D, EnqueueVerb as E, FillerNoise as F, GatherVerb as G, HangupVerb as H,
|
|
945
|
+
export type { ActionHook as A, BidirectionalAudio as B, ConferenceVerb as C, DequeueVerb as D, EnqueueVerb as E, FillerNoise as F, GatherVerb as G, HangupVerb as H, StreamVerb as I, JambonzApp as J, Synthesizer as K, LeaveVerb as L, McpServerConfig as M, Target as N, TranscribeVerb as O, PauseVerb as P, Verb as Q, Recognizer as R, SayVerb as S, TagVerb as T, VerbName as U, Vad as V, S2sVerb as W, LlmBaseOptions as X, DialogflowVerb as Y, ActionHookDelayAction as a, ActionHookObject as b, AgentLlm as c, AgentLlmOptions as d, AgentVerb as e, AlertVerb as f, Amd as g, AmdTimers as h, AnswerVerb as i, Auth as j, ConfigVerb as k, DialVerb as l, DtmfVerb as m, DubVerb as n, ListenVerb as o, LlmMessage as p, LlmTool as q, LlmToolOpenAIWrapped as r, LlmToolOutputData as s, LlmVerb as t, MessageVerb as u, PlayVerb as v, RedirectVerb as w, SipDeclineVerb as x, SipReferVerb as y, SipRequestVerb as z };
|
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-DoLeroIU.cjs';
|
|
2
|
+
import { J as JambonzApp } from '../verbs-mXzecf0-.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-BRsGhe7j.js';
|
|
2
|
+
import { J as JambonzApp } from '../verbs-mXzecf0-.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
|
@@ -639,7 +639,17 @@ var Session = class extends events.EventEmitter {
|
|
|
639
639
|
data
|
|
640
640
|
});
|
|
641
641
|
}
|
|
642
|
-
/**
|
|
642
|
+
/**
|
|
643
|
+
* Send tool output to an active LLM conversation.
|
|
644
|
+
*
|
|
645
|
+
* Canonical wire shape (validated by `@jambonz/schema`):
|
|
646
|
+
* `{type: 'command', command: 'llm:tool-output', tool_call_id, data}`
|
|
647
|
+
*
|
|
648
|
+
* `data` should be an object; `{result: ...}` is the preferred carrier but
|
|
649
|
+
* any object shape is accepted (feature-server JSON-stringifies it into the
|
|
650
|
+
* tool_result on the wire). For caller convenience, a non-object `data`
|
|
651
|
+
* argument is wrapped as `{result: data}` before send.
|
|
652
|
+
*/
|
|
643
653
|
sendToolOutput(toolCallId, data) {
|
|
644
654
|
const payload = typeof data === "object" && data !== null ? data : { result: data };
|
|
645
655
|
this.wsSend({
|