@craftedxp/sdk-node 0.18.0 → 0.20.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/README.md CHANGED
@@ -283,6 +283,8 @@ for await (const call of client.calls.listAll({ agentId })) {
283
283
 
284
284
  ## Changelog
285
285
 
286
+ - **0.20.0** — `speech.synthesize()` / `enqueue()` accept an `emotion` preset (`hype | shout | disappointed | warm | calm`) for emotional TTS voices.
287
+ - **0.19.0** — type-only: `CallTokenMintResult.transport` widened to `'ws' | 'webrtc' | 'livekit'` (server returns `'livekit'` when the platform media edge is LiveKit Cloud; client SDKs that don't know it fall back to `'ws'`); `CallRecord.transport` added. No runtime change; drop-in for 0.18.0 consumers.
286
288
  - **Unreleased** _(forward-looking)_ — `isPersonal?: boolean` on `Agent` and `AgentCreateInput` (and so on `AgentUpdateInput`). Assistant-only: when `true`, the learning tools (`remember_fact`, `add_correction`, `add_skill_hint`) are live on every `ct_`-token call rather than only on `mode=learning`. Server-side field — no runtime change in this package.
287
289
  - **Unreleased** _(forward-looking)_ — Per-call `agentSpeaksFirst` override on `callTokens.mint` (0.18.0, publish pending; server support 2026-09-02).
288
290
  - **0.17.0** — `channel` on `CallTokenMintInput` / `CallTokenMintResult` / `CallRecord` widened to include `'multimodal'` (typed turns + live audio in one WS session). Type-only plumbing in this package — accepted at mint (assistant-only, same gate as `'text'`) and threaded through; the server's handler semantics for it shipped 2026-09-01 (phase 2/3); `chatsFor(token)` (HTTP+SSE) always rejects a `'multimodal'` token. No runtime change in this package.
package/dist/index.d.mts CHANGED
@@ -249,6 +249,13 @@ interface CatalogListInput {
249
249
  userTags?: string[];
250
250
  }
251
251
  type CallStatus = 'queued' | 'ringing' | 'in_progress' | 'completed' | 'failed' | 'no_answer';
252
+ /**
253
+ * Media path a call was carried over. Shared by {@link CallRecord.transport}
254
+ * (what actually served the call) and {@link CallTokenMintResult.transport}
255
+ * (what the server tells the client to use). `'livekit'` was added in 0.19.0
256
+ * (phase 35 media edge).
257
+ */
258
+ type CallTransport = 'ws' | 'webrtc' | 'livekit';
252
259
  type EndReason = 'caller_hung_up' | 'agent_ended' | 'max_duration' | 'silence_timeout' | 'error';
253
260
  interface TranscriptTurn {
254
261
  role: 'user' | 'assistant';
@@ -286,6 +293,8 @@ interface CallRecord {
286
293
  endedAt?: number;
287
294
  durationSeconds?: number;
288
295
  endReason?: EndReason;
296
+ /** Media path that served the call (phase 35): 'livekit' = LiveKit tracks + WS control; 'webrtc' = the Cloud Run-hosted WebRTC route; 'ws' = plain WebSocket audio (also what gateway-proxied WebRTC calls record). Absent on telephony calls and records created before 2026-09-05. */
297
+ transport?: CallTransport;
289
298
  transcript?: TranscriptTurn[];
290
299
  summary?: string;
291
300
  structuredData?: Record<string, unknown>;
@@ -449,8 +458,14 @@ interface CallTokenMintResult {
449
458
  * SDK's `fetchToken` (rich return form) so it can dispatch correctly
450
459
  * without a second round-trip. Always present in the response;
451
460
  * defaults to `'ws'` for legacy agent docs missing the field.
461
+ *
462
+ * `'livekit'` (0.19.0, phase 35): the server's media edge is LiveKit
463
+ * Cloud — a client SDK that supports it joins a per-call LiveKit room
464
+ * for audio while control frames stay on the call WebSocket; client SDKs
465
+ * that don't recognise it fall back to `'ws'`. `webrtcGatewayBase` is
466
+ * only present for `'webrtc'`.
452
467
  */
453
- transport?: 'ws' | 'webrtc';
468
+ transport?: CallTransport;
454
469
  /**
455
470
  * Signaling gateway base URL when `transport === 'webrtc'` AND the
456
471
  * server has `WEBRTC_GATEWAY_BASE` configured. Forward alongside
@@ -704,6 +719,8 @@ interface SpeechSynthesizeInput {
704
719
  text?: string;
705
720
  context?: Record<string, unknown>;
706
721
  instructions?: string;
722
+ /** Emotion preset for emotional TTS voices (IndexTTS2, Hume). */
723
+ emotion?: 'hype' | 'shout' | 'disappointed' | 'warm' | 'calm';
707
724
  format?: 'mp3' | 'wav' | 'ogg';
708
725
  sampleRate?: 16000 | 24000 | 48000;
709
726
  idempotencyKey?: string;
@@ -1033,4 +1050,4 @@ declare class PlatformError extends Error {
1033
1050
 
1034
1051
  declare const verifyWebhookSignature: (rawBody: Buffer | string, signatureHeader: string, secret: string) => boolean;
1035
1052
 
1036
- export { type Agent, type AgentCreateInput, type AgentEndpointing, type AgentHttpTool, type AgentModel, type AgentRecording, type AgentTool, type AgentTranscriber, type AgentType, type AgentUpdateInput, type AgentVoice, type AgentWebhooksResource, type AgentsResource, type AnalysisWire, type ApiErrorCode, type BuildJoinUrlOptions, type CallListFilters, type CallRecord, type CallRecordingUrlResponse, type CallStatus, type CallSummary, type CallTokenMintInput, type CallTokenMintResult, type CallTokenSummary, type CallTokensResource, type CallsResource, type CatalogAgent, type CatalogListInput, type Chat, type ChatEvent, type ChatsResource, type CostBreakdown, type CreateRoomInput, type CreateRoomResponse, type CreateSpaceInput, type CreditsResource, type EndReason, type EndpointingMode, type GuestRole, type JoinUrlStyle, type KnowledgeBase, type KnowledgeBaseFile, type KnowledgeBasesResource, type LedgerEntry, type ListAnalysisResponse, type ListRoomsResponse, type ListSpacesResponse, type ListUtterancesResponse, type LlmProvider, type MeResource, type MeResponse, type OrgsResource, PlatformClient, type PlatformClientOptions, PlatformError, type PlatformEventName, type RecordingConfig, type RecordingMeta, type RecordingMode, type RoomDoc, type RoomEndReason, type RoomEventAck, type RoomListFilters, type RoomMetricsWire, type RoomStatus, type RoomTranscriptOptions, type RoomsResource, type SpaceKind, type SpacePatch, type SpaceView, type SpacesResource, type SpeechAsset, type SpeechFailedEvent, type SpeechJob, type SpeechListInput, type SpeechReadyEvent, type SpeechResource, type SpeechSynthesizeInput, type StartChatInput, type SttProvider, type TranscriptTurn, type TtsProvider, type UtteranceWire, type WebhookConfig, type WebhookCreateInput, type WebhookDelivery, type WebhookUpdateInput, type WebhooksResource, type WorkerStatus, buildJoinUrl, verifyWebhookSignature };
1053
+ export { type Agent, type AgentCreateInput, type AgentEndpointing, type AgentHttpTool, type AgentModel, type AgentRecording, type AgentTool, type AgentTranscriber, type AgentType, type AgentUpdateInput, type AgentVoice, type AgentWebhooksResource, type AgentsResource, type AnalysisWire, type ApiErrorCode, type BuildJoinUrlOptions, type CallListFilters, type CallRecord, type CallRecordingUrlResponse, type CallStatus, type CallSummary, type CallTokenMintInput, type CallTokenMintResult, type CallTokenSummary, type CallTokensResource, type CallTransport, type CallsResource, type CatalogAgent, type CatalogListInput, type Chat, type ChatEvent, type ChatsResource, type CostBreakdown, type CreateRoomInput, type CreateRoomResponse, type CreateSpaceInput, type CreditsResource, type EndReason, type EndpointingMode, type GuestRole, type JoinUrlStyle, type KnowledgeBase, type KnowledgeBaseFile, type KnowledgeBasesResource, type LedgerEntry, type ListAnalysisResponse, type ListRoomsResponse, type ListSpacesResponse, type ListUtterancesResponse, type LlmProvider, type MeResource, type MeResponse, type OrgsResource, PlatformClient, type PlatformClientOptions, PlatformError, type PlatformEventName, type RecordingConfig, type RecordingMeta, type RecordingMode, type RoomDoc, type RoomEndReason, type RoomEventAck, type RoomListFilters, type RoomMetricsWire, type RoomStatus, type RoomTranscriptOptions, type RoomsResource, type SpaceKind, type SpacePatch, type SpaceView, type SpacesResource, type SpeechAsset, type SpeechFailedEvent, type SpeechJob, type SpeechListInput, type SpeechReadyEvent, type SpeechResource, type SpeechSynthesizeInput, type StartChatInput, type SttProvider, type TranscriptTurn, type TtsProvider, type UtteranceWire, type WebhookConfig, type WebhookCreateInput, type WebhookDelivery, type WebhookUpdateInput, type WebhooksResource, type WorkerStatus, buildJoinUrl, verifyWebhookSignature };
package/dist/index.d.ts CHANGED
@@ -249,6 +249,13 @@ interface CatalogListInput {
249
249
  userTags?: string[];
250
250
  }
251
251
  type CallStatus = 'queued' | 'ringing' | 'in_progress' | 'completed' | 'failed' | 'no_answer';
252
+ /**
253
+ * Media path a call was carried over. Shared by {@link CallRecord.transport}
254
+ * (what actually served the call) and {@link CallTokenMintResult.transport}
255
+ * (what the server tells the client to use). `'livekit'` was added in 0.19.0
256
+ * (phase 35 media edge).
257
+ */
258
+ type CallTransport = 'ws' | 'webrtc' | 'livekit';
252
259
  type EndReason = 'caller_hung_up' | 'agent_ended' | 'max_duration' | 'silence_timeout' | 'error';
253
260
  interface TranscriptTurn {
254
261
  role: 'user' | 'assistant';
@@ -286,6 +293,8 @@ interface CallRecord {
286
293
  endedAt?: number;
287
294
  durationSeconds?: number;
288
295
  endReason?: EndReason;
296
+ /** Media path that served the call (phase 35): 'livekit' = LiveKit tracks + WS control; 'webrtc' = the Cloud Run-hosted WebRTC route; 'ws' = plain WebSocket audio (also what gateway-proxied WebRTC calls record). Absent on telephony calls and records created before 2026-09-05. */
297
+ transport?: CallTransport;
289
298
  transcript?: TranscriptTurn[];
290
299
  summary?: string;
291
300
  structuredData?: Record<string, unknown>;
@@ -449,8 +458,14 @@ interface CallTokenMintResult {
449
458
  * SDK's `fetchToken` (rich return form) so it can dispatch correctly
450
459
  * without a second round-trip. Always present in the response;
451
460
  * defaults to `'ws'` for legacy agent docs missing the field.
461
+ *
462
+ * `'livekit'` (0.19.0, phase 35): the server's media edge is LiveKit
463
+ * Cloud — a client SDK that supports it joins a per-call LiveKit room
464
+ * for audio while control frames stay on the call WebSocket; client SDKs
465
+ * that don't recognise it fall back to `'ws'`. `webrtcGatewayBase` is
466
+ * only present for `'webrtc'`.
452
467
  */
453
- transport?: 'ws' | 'webrtc';
468
+ transport?: CallTransport;
454
469
  /**
455
470
  * Signaling gateway base URL when `transport === 'webrtc'` AND the
456
471
  * server has `WEBRTC_GATEWAY_BASE` configured. Forward alongside
@@ -704,6 +719,8 @@ interface SpeechSynthesizeInput {
704
719
  text?: string;
705
720
  context?: Record<string, unknown>;
706
721
  instructions?: string;
722
+ /** Emotion preset for emotional TTS voices (IndexTTS2, Hume). */
723
+ emotion?: 'hype' | 'shout' | 'disappointed' | 'warm' | 'calm';
707
724
  format?: 'mp3' | 'wav' | 'ogg';
708
725
  sampleRate?: 16000 | 24000 | 48000;
709
726
  idempotencyKey?: string;
@@ -1033,4 +1050,4 @@ declare class PlatformError extends Error {
1033
1050
 
1034
1051
  declare const verifyWebhookSignature: (rawBody: Buffer | string, signatureHeader: string, secret: string) => boolean;
1035
1052
 
1036
- export { type Agent, type AgentCreateInput, type AgentEndpointing, type AgentHttpTool, type AgentModel, type AgentRecording, type AgentTool, type AgentTranscriber, type AgentType, type AgentUpdateInput, type AgentVoice, type AgentWebhooksResource, type AgentsResource, type AnalysisWire, type ApiErrorCode, type BuildJoinUrlOptions, type CallListFilters, type CallRecord, type CallRecordingUrlResponse, type CallStatus, type CallSummary, type CallTokenMintInput, type CallTokenMintResult, type CallTokenSummary, type CallTokensResource, type CallsResource, type CatalogAgent, type CatalogListInput, type Chat, type ChatEvent, type ChatsResource, type CostBreakdown, type CreateRoomInput, type CreateRoomResponse, type CreateSpaceInput, type CreditsResource, type EndReason, type EndpointingMode, type GuestRole, type JoinUrlStyle, type KnowledgeBase, type KnowledgeBaseFile, type KnowledgeBasesResource, type LedgerEntry, type ListAnalysisResponse, type ListRoomsResponse, type ListSpacesResponse, type ListUtterancesResponse, type LlmProvider, type MeResource, type MeResponse, type OrgsResource, PlatformClient, type PlatformClientOptions, PlatformError, type PlatformEventName, type RecordingConfig, type RecordingMeta, type RecordingMode, type RoomDoc, type RoomEndReason, type RoomEventAck, type RoomListFilters, type RoomMetricsWire, type RoomStatus, type RoomTranscriptOptions, type RoomsResource, type SpaceKind, type SpacePatch, type SpaceView, type SpacesResource, type SpeechAsset, type SpeechFailedEvent, type SpeechJob, type SpeechListInput, type SpeechReadyEvent, type SpeechResource, type SpeechSynthesizeInput, type StartChatInput, type SttProvider, type TranscriptTurn, type TtsProvider, type UtteranceWire, type WebhookConfig, type WebhookCreateInput, type WebhookDelivery, type WebhookUpdateInput, type WebhooksResource, type WorkerStatus, buildJoinUrl, verifyWebhookSignature };
1053
+ export { type Agent, type AgentCreateInput, type AgentEndpointing, type AgentHttpTool, type AgentModel, type AgentRecording, type AgentTool, type AgentTranscriber, type AgentType, type AgentUpdateInput, type AgentVoice, type AgentWebhooksResource, type AgentsResource, type AnalysisWire, type ApiErrorCode, type BuildJoinUrlOptions, type CallListFilters, type CallRecord, type CallRecordingUrlResponse, type CallStatus, type CallSummary, type CallTokenMintInput, type CallTokenMintResult, type CallTokenSummary, type CallTokensResource, type CallTransport, type CallsResource, type CatalogAgent, type CatalogListInput, type Chat, type ChatEvent, type ChatsResource, type CostBreakdown, type CreateRoomInput, type CreateRoomResponse, type CreateSpaceInput, type CreditsResource, type EndReason, type EndpointingMode, type GuestRole, type JoinUrlStyle, type KnowledgeBase, type KnowledgeBaseFile, type KnowledgeBasesResource, type LedgerEntry, type ListAnalysisResponse, type ListRoomsResponse, type ListSpacesResponse, type ListUtterancesResponse, type LlmProvider, type MeResource, type MeResponse, type OrgsResource, PlatformClient, type PlatformClientOptions, PlatformError, type PlatformEventName, type RecordingConfig, type RecordingMeta, type RecordingMode, type RoomDoc, type RoomEndReason, type RoomEventAck, type RoomListFilters, type RoomMetricsWire, type RoomStatus, type RoomTranscriptOptions, type RoomsResource, type SpaceKind, type SpacePatch, type SpaceView, type SpacesResource, type SpeechAsset, type SpeechFailedEvent, type SpeechJob, type SpeechListInput, type SpeechReadyEvent, type SpeechResource, type SpeechSynthesizeInput, type StartChatInput, type SttProvider, type TranscriptTurn, type TtsProvider, type UtteranceWire, type WebhookConfig, type WebhookCreateInput, type WebhookDelivery, type WebhookUpdateInput, type WebhooksResource, type WorkerStatus, buildJoinUrl, verifyWebhookSignature };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@craftedxp/sdk-node",
3
- "version": "0.18.0",
3
+ "version": "0.20.0",
4
4
  "description": "Node.js / TypeScript SDK for the voice agent platform. Server-side API client — mint call tokens, manage agents, query calls, upload knowledge-base docs.",
5
5
  "author": "Crafted XP",
6
6
  "license": "MIT",