@shogo-ai/voice 1.10.0 → 2.4.2

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 (68) hide show
  1. package/README.md +89 -0
  2. package/dist/{chunk-S3S2RNO6.js → chunk-BI6SL35K.js} +1 -184
  3. package/dist/chunk-IOFWML5L.js +1078 -0
  4. package/dist/chunk-KMSL5PWK.js +540 -0
  5. package/dist/chunk-ME3SIZZU.js +581 -0
  6. package/dist/{chunk-T3T4EBWY.js → chunk-RALZRMFL.js} +6 -2
  7. package/dist/chunk-TQOBJMEK.js +17 -0
  8. package/dist/chunk-U5UC7ZVS.js +988 -0
  9. package/dist/chunk-UW7VQ3S6.js +148 -0
  10. package/dist/chunk-ZAW6F3YT.js +172 -0
  11. package/dist/index.cjs +748 -25
  12. package/dist/index.d.cts +396 -3
  13. package/dist/index.d.ts +396 -3
  14. package/dist/index.js +63 -3
  15. package/dist/live/client.cjs +173 -0
  16. package/dist/live/client.d.cts +132 -0
  17. package/dist/live/client.d.ts +132 -0
  18. package/dist/live/client.js +9 -0
  19. package/dist/native/index.d.cts +5 -2
  20. package/dist/native/index.d.ts +5 -2
  21. package/dist/native/index.js +15 -11
  22. package/dist/{organicParticlesShaders-DIva0vBO.d.ts → organicParticlesShaders-seZq7jYX.d.cts} +1 -421
  23. package/dist/{organicParticlesShaders-DIva0vBO.d.cts → organicParticlesShaders-seZq7jYX.d.ts} +1 -421
  24. package/dist/particlesConfig-0YbdPOdY.d.cts +223 -0
  25. package/dist/particlesConfig-0YbdPOdY.d.ts +223 -0
  26. package/dist/react/conversation.cjs +789 -0
  27. package/dist/react/conversation.d.cts +134 -0
  28. package/dist/react/conversation.d.ts +134 -0
  29. package/dist/react/conversation.js +13 -0
  30. package/dist/react/index.cjs +374 -36
  31. package/dist/react/index.d.cts +10 -141
  32. package/dist/react/index.d.ts +10 -141
  33. package/dist/react/index.js +23 -770
  34. package/dist/react/visuals.cjs +1048 -0
  35. package/dist/react/visuals.d.cts +70 -0
  36. package/dist/react/visuals.d.ts +70 -0
  37. package/dist/react/visuals.js +10 -0
  38. package/dist/route/agent.cjs +1047 -85
  39. package/dist/route/agent.js +3 -3
  40. package/dist/route/audio-tags.cjs +1047 -85
  41. package/dist/route/audio-tags.js +3 -3
  42. package/dist/route/index.cjs +1051 -85
  43. package/dist/route/index.d.cts +19 -3
  44. package/dist/route/index.d.ts +19 -3
  45. package/dist/route/index.js +3 -3
  46. package/dist/route/music.cjs +1047 -85
  47. package/dist/route/music.js +3 -3
  48. package/dist/route/op.cjs +2127 -0
  49. package/dist/route/op.d.cts +43 -0
  50. package/dist/route/op.d.ts +43 -0
  51. package/dist/route/op.js +27 -0
  52. package/dist/route/signed-url.cjs +1047 -85
  53. package/dist/route/signed-url.js +3 -3
  54. package/dist/route/tts-preview.cjs +1047 -85
  55. package/dist/route/tts-preview.d.cts +6 -4
  56. package/dist/route/tts-preview.d.ts +6 -4
  57. package/dist/route/tts-preview.js +3 -3
  58. package/dist/server.cjs +1047 -85
  59. package/dist/server.d.cts +40 -8
  60. package/dist/server.d.ts +40 -8
  61. package/dist/server.js +2 -2
  62. package/dist/types-Bfhu-aQH.d.cts +199 -0
  63. package/dist/types-Bfhu-aQH.d.ts +199 -0
  64. package/dist/{types-W9y6eMj3.d.ts → types-CadjTXNH.d.cts} +193 -12
  65. package/dist/{types-W9y6eMj3.d.cts → types-CadjTXNH.d.ts} +193 -12
  66. package/package.json +21 -1
  67. package/dist/chunk-B4JC3DK2.js +0 -529
  68. package/dist/chunk-O362EJQR.js +0 -524
@@ -1,529 +0,0 @@
1
- import {
2
- composeExpressivityBlock,
3
- stripExpressivityBlock
4
- } from "./chunk-Q3TJAJ54.js";
5
-
6
- // src/prompt.ts
7
- var DEFAULT_MEMORY_BLOCK = `# Memory
8
-
9
- Known context about this user from past conversations:
10
- {{user_context}}
11
-
12
- Memory retrieval is automatic \u2014 the top matching facts are already injected above. Never say "let me check my memory" or "searching memories."
13
-
14
- You have one tool:
15
- - add_memory(fact): save a concise, canonical fact about the user \u2014 preferences, decisions, personal details, follow-ups. Use short normalized phrasings like "favorite color: green" or "lives in Honolulu". Always call it when the user explicitly asks you to remember something.`;
16
- function stripMemoryBlock(prompt) {
17
- if (!prompt) return prompt;
18
- return prompt.replace(/\n*<!-- zix-memory-v\d+ -->[\s\S]*$/m, "").replace(/\n*# Memory\s*\n\s*Known context about this user[\s\S]*$/m, "").trimEnd();
19
- }
20
- function extractBasePrompt(prompt) {
21
- return stripExpressivityBlock(stripMemoryBlock(prompt));
22
- }
23
- function composeAgentPrompt(basePrompt, options = {}) {
24
- const { expressivity = "subtle", audioTags = null, memoryBlock = DEFAULT_MEMORY_BLOCK } = options;
25
- const stripped = extractBasePrompt(basePrompt);
26
- const expr = composeExpressivityBlock(expressivity, audioTags);
27
- const parts = [stripped];
28
- if (expr) parts.push(expr);
29
- if (memoryBlock) parts.push(memoryBlock);
30
- return parts.join("\n\n");
31
- }
32
-
33
- // src/elevenlabs.ts
34
- var DEFAULT_ELEVENLABS_BASE_URL = "https://api.elevenlabs.io";
35
- var CONVAI_SUPPORTED_TTS_MODELS = /* @__PURE__ */ new Set([
36
- "eleven_turbo_v2",
37
- "eleven_turbo_v2_5",
38
- "eleven_flash_v2",
39
- "eleven_flash_v2_5",
40
- "eleven_multilingual_v2"
41
- ]);
42
- var CONVAI_TTS_MODEL_FALLBACK = "eleven_turbo_v2_5";
43
- function resolveConvaiTtsModel(requested) {
44
- if (requested && CONVAI_SUPPORTED_TTS_MODELS.has(requested)) return requested;
45
- return CONVAI_TTS_MODEL_FALLBACK;
46
- }
47
- var DEFAULT_MUSIC_MODEL = "music_v1";
48
- var ElevenLabsApiError = class extends Error {
49
- constructor(message, status, body) {
50
- super(message);
51
- this.status = status;
52
- this.body = body;
53
- this.name = "ElevenLabsApiError";
54
- }
55
- };
56
- var ElevenLabsClient = class {
57
- constructor(config) {
58
- this.config = config;
59
- if (!config.apiKey) throw new Error("ElevenLabsClient: apiKey is required");
60
- this.baseUrl = (config.baseUrl ?? DEFAULT_ELEVENLABS_BASE_URL).replace(/\/+$/, "");
61
- this.fetchImpl = config.fetch ?? globalThis.fetch;
62
- if (typeof this.fetchImpl !== "function") {
63
- throw new Error("ElevenLabsClient: global fetch is unavailable; pass config.fetch");
64
- }
65
- }
66
- headers(extra = {}) {
67
- return {
68
- "xi-api-key": this.config.apiKey,
69
- ...extra
70
- };
71
- }
72
- /** Create a new convai agent. Returns the new `agent_id`. */
73
- async createAgent(params) {
74
- const prompt = composeAgentPrompt(params.systemPrompt, {
75
- expressivity: params.expressivity ?? "subtle",
76
- audioTags: params.audioTags ?? null,
77
- memoryBlock: params.memoryBlock
78
- });
79
- const ttsConfig = {
80
- voice_id: params.voiceId,
81
- model_id: resolveConvaiTtsModel(params.ttsModelId)
82
- };
83
- if (params.voiceSettings) ttsConfig.voice_settings = params.voiceSettings;
84
- const body = {
85
- name: `Companion-${params.characterName}-for-${params.displayName}`,
86
- conversation_config: {
87
- agent: {
88
- prompt: {
89
- prompt,
90
- ...params.tools ? { tools: params.tools } : {}
91
- },
92
- first_message: params.firstMessage,
93
- language: params.language ?? "en"
94
- },
95
- tts: ttsConfig
96
- },
97
- platform_settings: {
98
- overrides: {
99
- conversation_config_override: {
100
- agent: { prompt: { prompt: true }, first_message: true, language: true },
101
- tts: { voice_id: true },
102
- conversation: { text_only: true }
103
- }
104
- },
105
- dynamic_variables: {
106
- dynamic_variable_placeholders: {
107
- user_context: "No prior memories yet.",
108
- character_name: "",
109
- ...params.dynamicVariablePlaceholders ?? {}
110
- }
111
- }
112
- }
113
- };
114
- const res = await this.fetchImpl(`${this.baseUrl}/v1/convai/agents/create`, {
115
- method: "POST",
116
- headers: this.headers({ "content-type": "application/json" }),
117
- body: JSON.stringify(body)
118
- });
119
- if (!res.ok) {
120
- const text = await res.text();
121
- throw new ElevenLabsApiError(`createAgent failed: ${res.status}`, res.status, text);
122
- }
123
- const data = await res.json();
124
- return data.agent_id;
125
- }
126
- /** PATCH any subset of agent settings. Idempotent; only sends the keys you supply. */
127
- async patchAgent(agentId, params) {
128
- const body = {};
129
- if (params.displayName !== void 0 || params.characterName !== void 0) {
130
- body.name = `Companion-${params.characterName ?? ""}-for-${params.displayName ?? ""}`.replace(
131
- /-for-$/,
132
- ""
133
- );
134
- }
135
- const conv = {};
136
- const agent = {};
137
- const prompt = {};
138
- if (params.systemPrompt !== void 0) {
139
- prompt.prompt = composeAgentPrompt(params.systemPrompt, {
140
- expressivity: params.expressivity ?? "subtle",
141
- audioTags: params.audioTags ?? null,
142
- memoryBlock: params.memoryBlock
143
- });
144
- }
145
- if (params.tools) prompt.tools = params.tools;
146
- if (Object.keys(prompt).length) agent.prompt = prompt;
147
- if (params.firstMessage !== void 0) agent.first_message = params.firstMessage;
148
- if (Object.keys(agent).length) conv.agent = agent;
149
- const tts = {};
150
- if (params.voiceId !== void 0) tts.voice_id = params.voiceId;
151
- if (params.voiceSettings) tts.voice_settings = params.voiceSettings;
152
- if (params.ttsModelId !== void 0) tts.model_id = resolveConvaiTtsModel(params.ttsModelId);
153
- if (Object.keys(tts).length) conv.tts = tts;
154
- if (Object.keys(conv).length) body.conversation_config = conv;
155
- if (params.enableUserContextOverride) {
156
- body.platform_settings = {
157
- overrides: {
158
- conversation_config_override: {
159
- agent: { prompt: { prompt: true }, first_message: true, language: true },
160
- tts: { voice_id: true },
161
- conversation: { text_only: true }
162
- },
163
- custom_llm_extra_body: false,
164
- enable_conversation_initiation_client_data_from_webhook: false
165
- },
166
- dynamic_variables: {
167
- dynamic_variable_placeholders: {
168
- user_context: "No prior memories yet.",
169
- character_name: ""
170
- }
171
- }
172
- };
173
- }
174
- if (!Object.keys(body).length) return;
175
- const res = await this.fetchImpl(`${this.baseUrl}/v1/convai/agents/${encodeURIComponent(agentId)}`, {
176
- method: "PATCH",
177
- headers: this.headers({ "content-type": "application/json" }),
178
- body: JSON.stringify(body)
179
- });
180
- if (!res.ok) {
181
- const text = await res.text();
182
- throw new ElevenLabsApiError(`patchAgent failed: ${res.status}`, res.status, text);
183
- }
184
- }
185
- /**
186
- * Delete a convai agent. Best-effort: swallow errors so teardown during a
187
- * 500 response doesn't cascade into a second failure.
188
- */
189
- async deleteAgent(agentId) {
190
- try {
191
- await this.fetchImpl(`${this.baseUrl}/v1/convai/agents/${encodeURIComponent(agentId)}`, {
192
- method: "DELETE",
193
- headers: this.headers()
194
- });
195
- } catch {
196
- }
197
- }
198
- /** Fetch a short-lived signed URL the browser can use to start a session. */
199
- async getSignedUrl(agentId) {
200
- const res = await this.fetchImpl(
201
- `${this.baseUrl}/v1/convai/conversation/get-signed-url?agent_id=${encodeURIComponent(agentId)}`,
202
- { headers: this.headers() }
203
- );
204
- if (!res.ok) {
205
- const text = await res.text();
206
- throw new ElevenLabsApiError(`getSignedUrl failed: ${res.status}`, res.status, text);
207
- }
208
- const data = await res.json();
209
- return data.signed_url;
210
- }
211
- /**
212
- * One-shot TTS. Returns the raw audio bytes plus the model id that was
213
- * actually used (some models aren't available for every account, so we
214
- * fall back to `eleven_turbo_v2_5` on the first failure).
215
- */
216
- async textToSpeech(params) {
217
- const modelId = params.modelId && params.modelId.length > 0 ? params.modelId : "eleven_v3";
218
- const accept = params.accept ?? "audio/mpeg";
219
- const attempt = async (m) => {
220
- const res2 = await this.fetchImpl(
221
- `${this.baseUrl}/v1/text-to-speech/${encodeURIComponent(params.voiceId)}`,
222
- {
223
- method: "POST",
224
- headers: this.headers({ "content-type": "application/json", accept }),
225
- body: JSON.stringify({
226
- text: params.text,
227
- model_id: m,
228
- voice_settings: params.voiceSettings
229
- })
230
- }
231
- );
232
- return res2;
233
- };
234
- let res = await attempt(modelId);
235
- let used = modelId;
236
- if (!res.ok && modelId !== "eleven_turbo_v2_5") {
237
- res = await attempt("eleven_turbo_v2_5");
238
- used = "eleven_turbo_v2_5";
239
- }
240
- if (!res.ok) {
241
- const text = await res.text();
242
- throw new ElevenLabsApiError(`textToSpeech failed: ${res.status}`, res.status, text);
243
- }
244
- const audio = await res.arrayBuffer();
245
- const contentType = res.headers.get("content-type") ?? accept;
246
- return { audio, modelId: used, contentType };
247
- }
248
- /**
249
- * Low-level escape hatch for any ElevenLabs endpoint not covered by a
250
- * dedicated method (music, sound-generation, speech-to-text, dubbing,
251
- * voice-design, …). Handles auth, query encoding, JSON body encoding,
252
- * and JSON-vs-binary response parsing; non-2xx responses throw
253
- * {@link ElevenLabsApiError} like the typed methods do.
254
- *
255
- * @example
256
- * ```ts
257
- * const { json } = await el.request({ method: 'GET', path: '/v1/models' })
258
- * const { audio } = await el.request({
259
- * method: 'POST',
260
- * path: '/v1/sound-generation',
261
- * body: { text: 'door creak' },
262
- * accept: 'audio/mpeg',
263
- * })
264
- * ```
265
- */
266
- async request(opts) {
267
- const accept = opts.accept ?? "application/json";
268
- let url = `${this.baseUrl}${opts.path.startsWith("/") ? "" : "/"}${opts.path}`;
269
- if (opts.query) {
270
- const params = new URLSearchParams();
271
- for (const [k, v] of Object.entries(opts.query)) {
272
- if (v !== null && v !== void 0) params.set(k, String(v));
273
- }
274
- const qs = params.toString();
275
- if (qs) url += `${url.includes("?") ? "&" : "?"}${qs}`;
276
- }
277
- const headers = this.headers({ accept, ...opts.headers ?? {} });
278
- const init = { method: opts.method, headers };
279
- if (opts.body !== void 0 && opts.body !== null) {
280
- const isPlainPayload = typeof opts.body === "object" && !(opts.body instanceof ArrayBuffer) && !(opts.body instanceof Uint8Array) && !(typeof Blob !== "undefined" && opts.body instanceof Blob) && !(typeof FormData !== "undefined" && opts.body instanceof FormData);
281
- if (isPlainPayload) {
282
- headers["content-type"] = "application/json";
283
- init.body = JSON.stringify(opts.body);
284
- } else {
285
- init.body = opts.body;
286
- }
287
- }
288
- const res = await this.fetchImpl(url, init);
289
- if (!res.ok) {
290
- const text = await res.text();
291
- throw new ElevenLabsApiError(
292
- `request ${opts.method} ${opts.path} failed: ${res.status}`,
293
- res.status,
294
- text
295
- );
296
- }
297
- const contentType = res.headers.get("content-type") ?? accept;
298
- if (contentType.includes("application/json")) {
299
- return { status: res.status, contentType, json: await res.json() };
300
- }
301
- return { status: res.status, contentType, audio: await res.arrayBuffer() };
302
- }
303
- /**
304
- * Generate music via `POST /v1/music`. Provide exactly one of `prompt`
305
- * or `compositionPlan` (ElevenLabs returns 422 otherwise). Returns the
306
- * raw audio bytes plus the response content type.
307
- *
308
- * @example
309
- * ```ts
310
- * const { audio } = await el.composeMusic({
311
- * prompt: 'Upbeat synthwave with driving bass',
312
- * musicLengthMs: 30_000,
313
- * })
314
- * ```
315
- */
316
- async composeMusic(params) {
317
- const hasPrompt = typeof params.prompt === "string" && params.prompt.length > 0;
318
- const hasPlan = params.compositionPlan != null;
319
- if (hasPrompt === hasPlan) {
320
- throw new Error(
321
- "composeMusic: provide exactly one of `prompt` or `compositionPlan`"
322
- );
323
- }
324
- const body = {
325
- model_id: params.modelId ?? DEFAULT_MUSIC_MODEL
326
- };
327
- if (hasPrompt) {
328
- body.prompt = params.prompt;
329
- if (params.musicLengthMs !== void 0) body.music_length_ms = params.musicLengthMs;
330
- if (params.forceInstrumental !== void 0) {
331
- body.force_instrumental = params.forceInstrumental;
332
- }
333
- } else {
334
- body.composition_plan = params.compositionPlan;
335
- }
336
- const { audio, contentType } = await this.request({
337
- method: "POST",
338
- path: "/v1/music",
339
- body,
340
- accept: "audio/mpeg",
341
- ...params.outputFormat ? { query: { output_format: params.outputFormat } } : {}
342
- });
343
- if (!audio) {
344
- throw new ElevenLabsApiError(
345
- "composeMusic: expected audio bytes but got a JSON response",
346
- 500,
347
- ""
348
- );
349
- }
350
- return { audio, contentType };
351
- }
352
- /** Probe whether a given voice id still exists on the caller's account. */
353
- async voiceExists(voiceId) {
354
- const res = await this.fetchImpl(
355
- `${this.baseUrl}/v1/voices/${encodeURIComponent(voiceId)}`,
356
- { headers: this.headers() }
357
- );
358
- return res.ok;
359
- }
360
- /**
361
- * Register a Twilio phone number with an ElevenLabs agent. EL becomes
362
- * the SIP target for inbound calls to that number — Twilio bridges
363
- * the call via EL's native integration and we never have to run a
364
- * Media Streams ↔ convai WebSocket bridge ourselves.
365
- *
366
- * Returns the ElevenLabs `phone_number_id` (distinct from the Twilio
367
- * `sid`) which is the handle used by `outboundCall` + `deletePhoneNumber`.
368
- */
369
- async createPhoneNumberTwilio(params) {
370
- const body = {
371
- phone_number: params.phoneNumber,
372
- label: params.label ?? params.phoneNumber,
373
- provider: "twilio",
374
- sid: params.twilioAccountSid,
375
- token: params.twilioAuthToken
376
- };
377
- const res = await this.fetchImpl(
378
- `${this.baseUrl}/v1/convai/phone-numbers`,
379
- {
380
- method: "POST",
381
- headers: this.headers({ "content-type": "application/json" }),
382
- body: JSON.stringify(body)
383
- }
384
- );
385
- if (!res.ok) {
386
- const text = await res.text();
387
- throw new ElevenLabsApiError(
388
- `createPhoneNumberTwilio failed: ${res.status}`,
389
- res.status,
390
- text
391
- );
392
- }
393
- const data = await res.json();
394
- const id = data.phone_number_id ?? data.id;
395
- if (!id) {
396
- throw new ElevenLabsApiError(
397
- "createPhoneNumberTwilio returned no id",
398
- 500,
399
- JSON.stringify(data)
400
- );
401
- }
402
- const patchRes = await this.fetchImpl(
403
- `${this.baseUrl}/v1/convai/phone-numbers/${encodeURIComponent(id)}`,
404
- {
405
- method: "PATCH",
406
- headers: this.headers({ "content-type": "application/json" }),
407
- body: JSON.stringify({ agent_id: params.agentId })
408
- }
409
- );
410
- if (!patchRes.ok) {
411
- const text = await patchRes.text();
412
- try {
413
- await this.deletePhoneNumber(id);
414
- } catch {
415
- }
416
- throw new ElevenLabsApiError(
417
- `assignAgentToPhoneNumber failed: ${patchRes.status}`,
418
- patchRes.status,
419
- text
420
- );
421
- }
422
- return { phoneNumberId: id };
423
- }
424
- /** Detach a previously-registered phone number from ElevenLabs. */
425
- async deletePhoneNumber(phoneNumberId) {
426
- const res = await this.fetchImpl(
427
- `${this.baseUrl}/v1/convai/phone-numbers/${encodeURIComponent(phoneNumberId)}`,
428
- { method: "DELETE", headers: this.headers() }
429
- );
430
- if (!res.ok && res.status !== 404) {
431
- const text = await res.text();
432
- throw new ElevenLabsApiError(
433
- `deletePhoneNumber failed: ${res.status}`,
434
- res.status,
435
- text
436
- );
437
- }
438
- }
439
- /**
440
- * Place an outbound PSTN call via a previously-registered EL phone
441
- * number. EL drives Twilio (or a SIP trunk) under the hood — we just
442
- * hand it the destination number and the agent to bridge to. Returns
443
- * the Twilio `callSid` + EL `conversationId` for metering / tracing.
444
- *
445
- * As of 2026-Q2 the EL API uses provider-scoped routes:
446
- * - Twilio numbers → POST /v1/convai/twilio/outbound-call
447
- * - SIP numbers → POST /v1/convai/sip-trunk/outbound-call
448
- * and `agent_phone_number_id` is a body field (no longer a path
449
- * segment). The previous `/v1/convai/phone-numbers/{id}/outbound-call`
450
- * route now returns 404. Callers that don't know the provider can
451
- * look it up from `GET /v1/convai/phone-numbers/{id}` (`provider:
452
- * "twilio" | "sip_trunk"`); most hosted setups are Twilio, so that's
453
- * the default here.
454
- */
455
- async outboundCall(params) {
456
- const provider = params.provider ?? "twilio";
457
- const body = {
458
- agent_id: params.agentId,
459
- agent_phone_number_id: params.phoneNumberId,
460
- to_number: params.toNumber
461
- };
462
- if (params.dynamicVariables) {
463
- body.conversation_initiation_client_data = {
464
- dynamic_variables: params.dynamicVariables
465
- };
466
- }
467
- const res = await this.fetchImpl(
468
- `${this.baseUrl}/v1/convai/${provider}/outbound-call`,
469
- {
470
- method: "POST",
471
- headers: this.headers({ "content-type": "application/json" }),
472
- body: JSON.stringify(body)
473
- }
474
- );
475
- if (!res.ok) {
476
- const text = await res.text();
477
- throw new ElevenLabsApiError(
478
- `outboundCall failed: ${res.status}`,
479
- res.status,
480
- text
481
- );
482
- }
483
- const data = await res.json();
484
- const callSid = data.call_sid ?? data.callSid;
485
- const conversationId = data.conversation_id ?? data.conversationId;
486
- if (!callSid || !conversationId) {
487
- throw new ElevenLabsApiError(
488
- "outboundCall missing callSid or conversationId",
489
- 500,
490
- JSON.stringify(data)
491
- );
492
- }
493
- return { callSid, conversationId };
494
- }
495
- };
496
- var MEMORY_CLIENT_TOOLS = [
497
- {
498
- type: "client",
499
- name: "add_memory",
500
- description: "Save a concise canonical fact about the user (preferences, decisions, personal details, follow-ups). Use whenever the user shares something worth remembering.",
501
- expects_response: true,
502
- parameters: {
503
- type: "object",
504
- properties: {
505
- fact: {
506
- type: "string",
507
- description: 'A short normalized fact, e.g. "prefers window seats", "favorite color: green". Max 500 chars.'
508
- }
509
- },
510
- required: ["fact"]
511
- }
512
- }
513
- ];
514
-
515
- export {
516
- DEFAULT_MEMORY_BLOCK,
517
- stripMemoryBlock,
518
- extractBasePrompt,
519
- composeAgentPrompt,
520
- DEFAULT_ELEVENLABS_BASE_URL,
521
- CONVAI_SUPPORTED_TTS_MODELS,
522
- CONVAI_TTS_MODEL_FALLBACK,
523
- resolveConvaiTtsModel,
524
- DEFAULT_MUSIC_MODEL,
525
- ElevenLabsApiError,
526
- ElevenLabsClient,
527
- MEMORY_CLIENT_TOOLS
528
- };
529
- //# sourceMappingURL=chunk-B4JC3DK2.js.map