@pellux/goodvibes-sdk 0.25.6 → 0.25.8

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 (114) hide show
  1. package/dist/_internal/contracts/artifacts/operator-contract.json +280 -4
  2. package/dist/_internal/contracts/generated/foundation-metadata.d.ts +2 -2
  3. package/dist/_internal/contracts/generated/foundation-metadata.js +2 -2
  4. package/dist/_internal/contracts/generated/operator-contract.d.ts.map +1 -1
  5. package/dist/_internal/contracts/generated/operator-contract.js +280 -4
  6. package/dist/_internal/contracts/generated/operator-method-ids.d.ts +1 -1
  7. package/dist/_internal/contracts/generated/operator-method-ids.d.ts.map +1 -1
  8. package/dist/_internal/contracts/generated/operator-method-ids.js +2 -0
  9. package/dist/_internal/contracts/zod-schemas/providers.d.ts +132 -0
  10. package/dist/_internal/contracts/zod-schemas/providers.d.ts.map +1 -1
  11. package/dist/_internal/contracts/zod-schemas/providers.js +16 -0
  12. package/dist/_internal/daemon/context.d.ts +1 -0
  13. package/dist/_internal/daemon/context.d.ts.map +1 -1
  14. package/dist/_internal/daemon/media-route-types.d.ts +10 -0
  15. package/dist/_internal/daemon/media-route-types.d.ts.map +1 -1
  16. package/dist/_internal/daemon/media-routes.d.ts +1 -1
  17. package/dist/_internal/daemon/media-routes.d.ts.map +1 -1
  18. package/dist/_internal/daemon/media-routes.js +91 -10
  19. package/dist/_internal/daemon/operator.d.ts +1 -1
  20. package/dist/_internal/daemon/operator.d.ts.map +1 -1
  21. package/dist/_internal/daemon/operator.js +2 -0
  22. package/dist/_internal/platform/adapters/ntfy/index.js +13 -2
  23. package/dist/_internal/platform/adapters/types.d.ts +2 -0
  24. package/dist/_internal/platform/adapters/types.d.ts.map +1 -1
  25. package/dist/_internal/platform/batch/index.d.ts +4 -0
  26. package/dist/_internal/platform/batch/index.d.ts.map +1 -0
  27. package/dist/_internal/platform/batch/index.js +2 -0
  28. package/dist/_internal/platform/batch/manager.d.ts +41 -0
  29. package/dist/_internal/platform/batch/manager.d.ts.map +1 -0
  30. package/dist/_internal/platform/batch/manager.js +400 -0
  31. package/dist/_internal/platform/batch/types.d.ts +85 -0
  32. package/dist/_internal/platform/batch/types.d.ts.map +1 -0
  33. package/dist/_internal/platform/batch/types.js +10 -0
  34. package/dist/_internal/platform/channels/builtin/plugins.d.ts.map +1 -1
  35. package/dist/_internal/platform/channels/builtin/plugins.js +1 -0
  36. package/dist/_internal/platform/channels/reply-pipeline.d.ts +9 -1
  37. package/dist/_internal/platform/channels/reply-pipeline.d.ts.map +1 -1
  38. package/dist/_internal/platform/channels/reply-pipeline.js +156 -6
  39. package/dist/_internal/platform/companion/companion-chat-manager.d.ts +2 -1
  40. package/dist/_internal/platform/companion/companion-chat-manager.d.ts.map +1 -1
  41. package/dist/_internal/platform/companion/companion-chat-manager.js +21 -0
  42. package/dist/_internal/platform/companion/companion-chat-routes.d.ts +1 -0
  43. package/dist/_internal/platform/companion/companion-chat-routes.d.ts.map +1 -1
  44. package/dist/_internal/platform/companion/companion-chat-routes.js +76 -0
  45. package/dist/_internal/platform/companion/companion-chat-types.d.ts +9 -0
  46. package/dist/_internal/platform/companion/companion-chat-types.d.ts.map +1 -1
  47. package/dist/_internal/platform/companion/index.d.ts +1 -1
  48. package/dist/_internal/platform/companion/index.d.ts.map +1 -1
  49. package/dist/_internal/platform/config/schema-domain-core.d.ts +6 -0
  50. package/dist/_internal/platform/config/schema-domain-core.d.ts.map +1 -1
  51. package/dist/_internal/platform/config/schema-domain-core.js +30 -0
  52. package/dist/_internal/platform/config/schema-domain-runtime.d.ts +19 -0
  53. package/dist/_internal/platform/config/schema-domain-runtime.d.ts.map +1 -1
  54. package/dist/_internal/platform/config/schema-domain-runtime.js +118 -0
  55. package/dist/_internal/platform/config/schema-types.d.ts +33 -2
  56. package/dist/_internal/platform/config/schema-types.d.ts.map +1 -1
  57. package/dist/_internal/platform/config/schema.d.ts.map +1 -1
  58. package/dist/_internal/platform/config/schema.js +3 -0
  59. package/dist/_internal/platform/control-plane/method-catalog-control-core.d.ts.map +1 -1
  60. package/dist/_internal/platform/control-plane/method-catalog-control-core.js +17 -0
  61. package/dist/_internal/platform/control-plane/method-catalog-media.d.ts.map +1 -1
  62. package/dist/_internal/platform/control-plane/method-catalog-media.js +17 -0
  63. package/dist/_internal/platform/control-plane/routes/operator.d.ts +1 -1
  64. package/dist/_internal/platform/control-plane/routes/operator.d.ts.map +1 -1
  65. package/dist/_internal/platform/control-plane/routes/operator.js +2 -0
  66. package/dist/_internal/platform/daemon/facade-composition.d.ts +2 -0
  67. package/dist/_internal/platform/daemon/facade-composition.d.ts.map +1 -1
  68. package/dist/_internal/platform/daemon/facade-composition.js +10 -0
  69. package/dist/_internal/platform/daemon/http/batch-routes.d.ts +8 -0
  70. package/dist/_internal/platform/daemon/http/batch-routes.d.ts.map +1 -0
  71. package/dist/_internal/platform/daemon/http/batch-routes.js +113 -0
  72. package/dist/_internal/platform/daemon/http/provider-routes.d.ts +3 -0
  73. package/dist/_internal/platform/daemon/http/provider-routes.d.ts.map +1 -1
  74. package/dist/_internal/platform/daemon/http/provider-routes.js +79 -20
  75. package/dist/_internal/platform/daemon/http/router-route-contexts.d.ts.map +1 -1
  76. package/dist/_internal/platform/daemon/http/router-route-contexts.js +1 -0
  77. package/dist/_internal/platform/daemon/http/router.d.ts +4 -0
  78. package/dist/_internal/platform/daemon/http/router.d.ts.map +1 -1
  79. package/dist/_internal/platform/daemon/http/router.js +15 -0
  80. package/dist/_internal/platform/daemon/http/runtime-route-types.d.ts +2 -0
  81. package/dist/_internal/platform/daemon/http/runtime-route-types.d.ts.map +1 -1
  82. package/dist/_internal/platform/daemon/surface-actions.d.ts +6 -0
  83. package/dist/_internal/platform/daemon/surface-actions.d.ts.map +1 -1
  84. package/dist/_internal/platform/daemon/surface-actions.js +13 -0
  85. package/dist/_internal/platform/daemon/surface-delivery.d.ts +3 -0
  86. package/dist/_internal/platform/daemon/surface-delivery.d.ts.map +1 -1
  87. package/dist/_internal/platform/daemon/surface-delivery.js +42 -6
  88. package/dist/_internal/platform/daemon/types.d.ts +2 -0
  89. package/dist/_internal/platform/daemon/types.d.ts.map +1 -1
  90. package/dist/_internal/platform/providers/anthropic.d.ts +13 -1
  91. package/dist/_internal/platform/providers/anthropic.d.ts.map +1 -1
  92. package/dist/_internal/platform/providers/anthropic.js +219 -1
  93. package/dist/_internal/platform/providers/interface.d.ts +48 -0
  94. package/dist/_internal/platform/providers/interface.d.ts.map +1 -1
  95. package/dist/_internal/platform/providers/openai.d.ts +13 -1
  96. package/dist/_internal/platform/providers/openai.d.ts.map +1 -1
  97. package/dist/_internal/platform/providers/openai.js +189 -1
  98. package/dist/_internal/platform/version.js +1 -1
  99. package/dist/_internal/platform/voice/index.d.ts +1 -1
  100. package/dist/_internal/platform/voice/index.d.ts.map +1 -1
  101. package/dist/_internal/platform/voice/providers/elevenlabs.d.ts.map +1 -1
  102. package/dist/_internal/platform/voice/providers/elevenlabs.js +150 -4
  103. package/dist/_internal/platform/voice/service.d.ts +2 -1
  104. package/dist/_internal/platform/voice/service.d.ts.map +1 -1
  105. package/dist/_internal/platform/voice/service.js +7 -0
  106. package/dist/_internal/platform/voice/types.d.ts +18 -1
  107. package/dist/_internal/platform/voice/types.d.ts.map +1 -1
  108. package/dist/index.d.ts +2 -0
  109. package/dist/index.d.ts.map +1 -1
  110. package/dist/index.js +1 -0
  111. package/dist/workers.d.ts +40 -0
  112. package/dist/workers.d.ts.map +1 -0
  113. package/dist/workers.js +144 -0
  114. package/package.json +5 -1
@@ -1,4 +1,4 @@
1
- import OpenAI from 'openai';
1
+ import OpenAI, { toFile } from 'openai';
2
2
  import { mapOpenAIStopReason } from './stop-reason-maps.js';
3
3
  import { ProviderError } from '../types/errors.js';
4
4
  import { withRetry } from '../utils/retry.js';
@@ -15,12 +15,23 @@ const NOOP_CACHE_HIT_TRACKER = {
15
15
  export class OpenAIProvider {
16
16
  name = 'openai';
17
17
  models = [];
18
+ batch;
18
19
  client;
20
+ apiKey;
19
21
  embeddingModel = 'text-embedding-3-small';
20
22
  cacheHitTracker;
21
23
  constructor(apiKey, cacheHitTracker = NOOP_CACHE_HIT_TRACKER) {
24
+ this.apiKey = apiKey;
22
25
  this.client = new OpenAI({ apiKey });
23
26
  this.cacheHitTracker = cacheHitTracker;
27
+ this.batch = {
28
+ kind: 'provider-batch',
29
+ endpoints: ['/v1/chat/completions'],
30
+ createChatBatch: (input) => this.createChatBatch(input),
31
+ retrieveBatch: (providerBatchId) => this.retrieveBatch(providerBatchId),
32
+ cancelBatch: (providerBatchId) => this.cancelBatch(providerBatchId),
33
+ getResults: (providerBatchId) => this.getBatchResults(providerBatchId),
34
+ };
24
35
  }
25
36
  async chat(params) {
26
37
  const { messages, tools, model, maxTokens, signal, systemPrompt, onDelta, reasoningEffort: _reasoningEffort } = params;
@@ -163,6 +174,9 @@ export class OpenAIProvider {
163
174
  },
164
175
  };
165
176
  }
177
+ isConfigured() {
178
+ return this.apiKey.trim().length > 0;
179
+ }
166
180
  async describeRuntime(deps) {
167
181
  const configured = Boolean(process.env.OPENAI_API_KEY || process.env.OPENAI_KEY);
168
182
  const { buildStandardProviderAuthRoutes } = await import('./runtime-metadata.js');
@@ -189,6 +203,15 @@ export class OpenAIProvider {
189
203
  streaming: true,
190
204
  toolCalling: true,
191
205
  parallelTools: true,
206
+ batch: {
207
+ supported: true,
208
+ discount: 'Provider-side Batch API pricing is discounted versus live API pricing where OpenAI offers the discount.',
209
+ completionWindow: '24h',
210
+ endpoints: ['/v1/chat/completions'],
211
+ maxRequestsPerProviderBatch: 50_000,
212
+ maxInputBytes: 200 * 1024 * 1024,
213
+ notes: ['Batch requests are asynchronous and non-streaming. Results are correlated by custom_id.'],
214
+ },
192
215
  notes: ['Embeddings use the OpenAI embeddings API.'],
193
216
  },
194
217
  policy: {
@@ -200,4 +223,169 @@ export class OpenAIProvider {
200
223
  },
201
224
  };
202
225
  }
226
+ async createChatBatch(input) {
227
+ const lines = input.requests.map((request) => JSON.stringify({
228
+ custom_id: request.customId,
229
+ method: 'POST',
230
+ url: '/v1/chat/completions',
231
+ body: this.toOpenAIBatchChatBody(request.params),
232
+ })).join('\n') + '\n';
233
+ const file = await this.client.files.create({
234
+ file: await toFile(new Blob([lines], { type: 'application/jsonl' }), 'goodvibes-openai-chat-batch.jsonl'),
235
+ purpose: 'batch',
236
+ });
237
+ const metadata = input.metadata && Object.keys(input.metadata).length > 0 ? input.metadata : undefined;
238
+ const batch = await this.client.batches.create({
239
+ input_file_id: file.id,
240
+ endpoint: '/v1/chat/completions',
241
+ completion_window: input.completionWindow ?? '24h',
242
+ ...(metadata ? { metadata } : {}),
243
+ });
244
+ return {
245
+ providerBatchId: batch.id,
246
+ status: this.mapOpenAIBatchStatus(batch.status),
247
+ raw: batch,
248
+ };
249
+ }
250
+ async retrieveBatch(providerBatchId) {
251
+ const batch = await this.client.batches.retrieve(providerBatchId);
252
+ return {
253
+ providerBatchId: batch.id,
254
+ status: this.mapOpenAIBatchStatus(batch.status),
255
+ resultAvailable: typeof batch.output_file_id === 'string' || typeof batch.error_file_id === 'string',
256
+ raw: batch,
257
+ };
258
+ }
259
+ async cancelBatch(providerBatchId) {
260
+ const batch = await this.client.batches.cancel(providerBatchId);
261
+ return {
262
+ providerBatchId: batch.id,
263
+ status: this.mapOpenAIBatchStatus(batch.status),
264
+ resultAvailable: typeof batch.output_file_id === 'string' || typeof batch.error_file_id === 'string',
265
+ raw: batch,
266
+ };
267
+ }
268
+ async getBatchResults(providerBatchId) {
269
+ const batch = await this.client.batches.retrieve(providerBatchId);
270
+ const results = [];
271
+ if (typeof batch.output_file_id === 'string' && batch.output_file_id.length > 0) {
272
+ results.push(...await this.readOpenAIBatchResultFile(batch.output_file_id, false));
273
+ }
274
+ if (typeof batch.error_file_id === 'string' && batch.error_file_id.length > 0) {
275
+ results.push(...await this.readOpenAIBatchResultFile(batch.error_file_id, true));
276
+ }
277
+ return results;
278
+ }
279
+ toOpenAIBatchChatBody(params) {
280
+ const openaiMessages = toOpenAIMessages(params.messages, params.systemPrompt);
281
+ const openaiTools = params.tools && params.tools.length > 0 ? toOpenAITools(params.tools) : undefined;
282
+ return {
283
+ model: params.model,
284
+ messages: openaiMessages,
285
+ ...(openaiTools ? { tools: openaiTools } : {}),
286
+ ...(params.maxTokens ? { max_tokens: params.maxTokens } : {}),
287
+ stream: false,
288
+ };
289
+ }
290
+ mapOpenAIBatchStatus(status) {
291
+ if (status === 'completed')
292
+ return 'completed';
293
+ if (status === 'failed')
294
+ return 'failed';
295
+ if (status === 'cancelled' || status === 'cancelling')
296
+ return 'cancelled';
297
+ if (status === 'expired')
298
+ return 'expired';
299
+ if (status === 'in_progress' || status === 'finalizing')
300
+ return 'running';
301
+ return 'submitted';
302
+ }
303
+ async readOpenAIBatchResultFile(fileId, forceFailed) {
304
+ const response = await this.client.files.content(fileId);
305
+ const text = await response.text();
306
+ const lines = text.split('\n').map((line) => line.trim()).filter(Boolean);
307
+ const results = [];
308
+ for (const line of lines) {
309
+ try {
310
+ const parsed = JSON.parse(line);
311
+ results.push(this.parseOpenAIBatchResult(parsed, forceFailed));
312
+ }
313
+ catch (error) {
314
+ results.push({
315
+ customId: `unparseable:${crypto.randomUUID()}`,
316
+ status: 'failed',
317
+ error: {
318
+ message: `Unable to parse OpenAI batch result line: ${summarizeError(error)}`,
319
+ },
320
+ raw: line,
321
+ });
322
+ }
323
+ }
324
+ return results;
325
+ }
326
+ parseOpenAIBatchResult(parsed, forceFailed) {
327
+ const customId = typeof parsed['custom_id'] === 'string' ? parsed['custom_id'] : `unknown:${crypto.randomUUID()}`;
328
+ const response = toRecord(parsed['response']);
329
+ const statusCode = typeof response['status_code'] === 'number' ? response['status_code'] : 0;
330
+ const body = toRecord(response['body']);
331
+ const error = parsed['error'] ?? body['error'];
332
+ if (forceFailed || statusCode >= 400 || error !== undefined) {
333
+ const errorRecord = toRecord(error);
334
+ return {
335
+ customId,
336
+ status: 'failed',
337
+ error: {
338
+ message: typeof errorRecord['message'] === 'string' ? errorRecord['message'] : `OpenAI batch request failed${statusCode ? ` with status ${statusCode}` : ''}`,
339
+ ...(typeof errorRecord['code'] === 'string' ? { code: errorRecord['code'] } : {}),
340
+ raw: error ?? parsed,
341
+ },
342
+ raw: parsed,
343
+ };
344
+ }
345
+ return {
346
+ customId,
347
+ status: 'succeeded',
348
+ response: this.openAIBatchBodyToChatResponse(body),
349
+ raw: parsed,
350
+ };
351
+ }
352
+ openAIBatchBodyToChatResponse(body) {
353
+ const choices = Array.isArray(body['choices']) ? body['choices'] : [];
354
+ const firstChoice = toRecord(choices[0]);
355
+ const message = toRecord(firstChoice['message']);
356
+ const content = message['content'];
357
+ const responseText = typeof content === 'string'
358
+ ? content
359
+ : Array.isArray(content)
360
+ ? content.map((part) => {
361
+ const record = toRecord(part);
362
+ return typeof record['text'] === 'string' ? record['text'] : '';
363
+ }).join('')
364
+ : '';
365
+ const rawToolCalls = Array.isArray(message['tool_calls'])
366
+ ? message['tool_calls'].map((entry) => toRecord(entry))
367
+ : [];
368
+ const usage = toRecord(body['usage']);
369
+ const promptDetails = toRecord(usage['prompt_tokens_details']);
370
+ const rawFinishReason = typeof firstChoice['finish_reason'] === 'string' ? firstChoice['finish_reason'] : undefined;
371
+ const stopReason = rawFinishReason ? mapOpenAIStopReason(rawFinishReason) : (responseText ? 'completed' : 'unknown');
372
+ return {
373
+ content: responseText,
374
+ toolCalls: rawToolCalls.length > 0 ? fromOpenAIToolCalls(rawToolCalls) : [],
375
+ usage: {
376
+ inputTokens: typeof usage['prompt_tokens'] === 'number' ? usage['prompt_tokens'] : 0,
377
+ outputTokens: typeof usage['completion_tokens'] === 'number' ? usage['completion_tokens'] : 0,
378
+ ...(typeof promptDetails['cached_tokens'] === 'number' && promptDetails['cached_tokens'] > 0
379
+ ? { cacheReadTokens: promptDetails['cached_tokens'] }
380
+ : {}),
381
+ },
382
+ stopReason,
383
+ ...(rawFinishReason ? { providerStopReason: rawFinishReason } : {}),
384
+ };
385
+ }
386
+ }
387
+ function toRecord(value) {
388
+ return value !== null && typeof value === 'object' && !Array.isArray(value)
389
+ ? value
390
+ : {};
203
391
  }
@@ -1,6 +1,6 @@
1
1
  import { readFileSync } from 'node:fs';
2
2
  import { join } from 'node:path';
3
- let version = '0.25.6';
3
+ let version = '0.25.8';
4
4
  try {
5
5
  const pkg = JSON.parse(readFileSync(join(import.meta.dir, '..', '..', 'package.json'), 'utf-8'));
6
6
  version = pkg.version ?? version;
@@ -1,4 +1,4 @@
1
- export type { VoiceAudioArtifact, VoiceAudioFormat, VoiceDescriptor, VoiceProvider, VoiceProviderCapability, VoiceProviderState, VoiceProviderStatus, VoiceRealtimeSession, VoiceRealtimeSessionRequest, VoiceSynthesisRequest, VoiceSynthesisResult, VoiceTranscriptionRequest, VoiceTranscriptionResult, } from './types.js';
1
+ export type { VoiceAudioArtifact, VoiceAudioChunk, VoiceAudioFormat, VoiceDescriptor, VoiceProvider, VoiceProviderCapability, VoiceProviderState, VoiceProviderStatus, VoiceRealtimeSession, VoiceRealtimeSessionRequest, VoiceSynthesisRequest, VoiceSynthesisResult, VoiceSynthesisStreamResult, VoiceTranscriptionRequest, VoiceTranscriptionResult, } from './types.js';
2
2
  export { VoiceProviderRegistry } from './provider-registry.js';
3
3
  export type { VoiceProviderDescriptor } from './provider-registry.js';
4
4
  export { VoiceService } from './service.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/voice/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,2BAA2B,EAC3B,qBAAqB,EACrB,oBAAoB,EACpB,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,YAAY,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,YAAY,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/voice/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,2BAA2B,EAC3B,qBAAqB,EACrB,oBAAoB,EACpB,0BAA0B,EAC1B,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,YAAY,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,YAAY,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"elevenlabs.d.ts","sourceRoot":"","sources":["../../../../../src/_internal/platform/voice/providers/elevenlabs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,aAAa,EAGd,MAAM,aAAa,CAAC;AAsGrB,wBAAgB,wBAAwB,IAAI,aAAa,CAkSxD"}
1
+ {"version":3,"file":"elevenlabs.d.ts","sourceRoot":"","sources":["../../../../../src/_internal/platform/voice/providers/elevenlabs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGV,aAAa,EAKd,MAAM,aAAa,CAAC;AA0LrB,wBAAgB,wBAAwB,IAAI,aAAa,CAgWxD"}
@@ -2,6 +2,9 @@ import { asRecord, buildStatus, estimateConfidenceFromAvgLogprob, inferFilename,
2
2
  import { instrumentedFetch } from '../../utils/fetch-with-timeout.js';
3
3
  const DEFAULT_ELEVENLABS_STT_MODEL = 'scribe_v2';
4
4
  const DEFAULT_ELEVENLABS_REALTIME_MODEL = 'scribe_v2_realtime';
5
+ const DEFAULT_ELEVENLABS_TTS_MODEL = 'eleven_multilingual_v2';
6
+ const DEFAULT_ELEVENLABS_VOICE = 'pMsXgVXv3BLzUgSXRplE';
7
+ const DEFAULT_ELEVENLABS_OUTPUT_FORMAT = 'mp3_44100_128';
5
8
  const ELEVENLABS_SINGLE_USE_TOKEN_TTL_MS = 15 * 60 * 1000;
6
9
  function normalizeBooleanString(value) {
7
10
  return typeof value === 'boolean' ? String(value) : undefined;
@@ -14,6 +17,86 @@ function asStringArray(value) {
14
17
  .map((entry) => entry.trim());
15
18
  return values.length > 0 ? values : undefined;
16
19
  }
20
+ function resolveElevenLabsOutputFormat(format) {
21
+ const normalized = format?.trim().toLowerCase();
22
+ if (!normalized)
23
+ return DEFAULT_ELEVENLABS_OUTPUT_FORMAT;
24
+ if (normalized.includes('_'))
25
+ return normalized;
26
+ switch (normalized) {
27
+ case 'mp3':
28
+ return DEFAULT_ELEVENLABS_OUTPUT_FORMAT;
29
+ case 'pcm':
30
+ case 'pcm16':
31
+ return 'pcm_16000';
32
+ case 'ulaw':
33
+ case 'mulaw':
34
+ return 'ulaw_8000';
35
+ case 'opus':
36
+ case 'ogg':
37
+ case 'webm':
38
+ return 'opus_48000_32';
39
+ default:
40
+ return DEFAULT_ELEVENLABS_OUTPUT_FORMAT;
41
+ }
42
+ }
43
+ function mimeTypeForElevenLabsOutputFormat(outputFormat) {
44
+ if (outputFormat.startsWith('pcm_'))
45
+ return 'audio/pcm';
46
+ if (outputFormat.startsWith('ulaw_'))
47
+ return 'audio/basic';
48
+ if (outputFormat.startsWith('opus_'))
49
+ return 'audio/ogg';
50
+ return 'audio/mpeg';
51
+ }
52
+ function artifactFormatForElevenLabsOutputFormat(outputFormat) {
53
+ if (outputFormat.startsWith('pcm_'))
54
+ return 'pcm16';
55
+ if (outputFormat.startsWith('ulaw_'))
56
+ return 'ulaw';
57
+ if (outputFormat.startsWith('opus_'))
58
+ return 'ogg';
59
+ return 'mp3';
60
+ }
61
+ function readVoiceSetting(metadata, camelKey, snakeKey, fallback) {
62
+ const value = metadata?.[camelKey] ?? metadata?.[snakeKey];
63
+ return typeof value === 'number' && Number.isFinite(value) ? value : fallback;
64
+ }
65
+ function readSpeakerBoost(metadata) {
66
+ const value = metadata?.['useSpeakerBoost'] ?? metadata?.['use_speaker_boost'];
67
+ return typeof value === 'boolean' ? value : true;
68
+ }
69
+ async function* streamResponseAudioChunks(response, input) {
70
+ const reader = response.body?.getReader();
71
+ if (!reader)
72
+ throw new Error('ElevenLabs streaming synthesis returned no response body');
73
+ let sequence = 0;
74
+ let completed = false;
75
+ try {
76
+ while (true) {
77
+ const { done, value } = await reader.read();
78
+ if (done) {
79
+ completed = true;
80
+ break;
81
+ }
82
+ if (!value || value.byteLength === 0)
83
+ continue;
84
+ sequence += 1;
85
+ yield {
86
+ data: value,
87
+ sequence,
88
+ mimeType: input.mimeType,
89
+ format: input.format,
90
+ metadata: input.metadata,
91
+ };
92
+ }
93
+ }
94
+ finally {
95
+ if (!completed)
96
+ await reader.cancel().catch(() => undefined);
97
+ reader.releaseLock();
98
+ }
99
+ }
17
100
  function parseElevenLabsTranscript(payload) {
18
101
  const text = trimToUndefined(payload.text);
19
102
  if (!text)
@@ -60,15 +143,17 @@ export function createElevenLabsProvider() {
60
143
  return {
61
144
  id: 'elevenlabs',
62
145
  label: 'ElevenLabs',
63
- capabilities: ['tts', 'stt', 'realtime', 'voice-list'],
146
+ capabilities: ['tts', 'tts-stream', 'stt', 'realtime', 'voice-list'],
64
147
  status() {
65
148
  const configured = readFirstEnv(envVars) !== null;
66
- return buildStatus('elevenlabs', 'ElevenLabs', ['tts', 'stt', 'realtime', 'voice-list'], configured, configured
149
+ return buildStatus('elevenlabs', 'ElevenLabs', ['tts', 'tts-stream', 'stt', 'realtime', 'voice-list'], configured, configured
67
150
  ? 'ElevenLabs speech, transcription, and realtime APIs are available.'
68
151
  : 'Set ELEVENLABS_API_KEY or XI_API_KEY to enable ElevenLabs speech and transcription.', {
69
152
  baseUrl: normalizeBaseUrl(readFirstEnv(baseUrlEnvVars), 'https://api.elevenlabs.io'),
153
+ defaultTtsModel: DEFAULT_ELEVENLABS_TTS_MODEL,
70
154
  defaultSttModel: DEFAULT_ELEVENLABS_STT_MODEL,
71
155
  defaultRealtimeModel: DEFAULT_ELEVENLABS_REALTIME_MODEL,
156
+ defaultOutputFormat: DEFAULT_ELEVENLABS_OUTPUT_FORMAT,
72
157
  });
73
158
  },
74
159
  async listVoices() {
@@ -98,7 +183,7 @@ export function createElevenLabsProvider() {
98
183
  if (!apiKey)
99
184
  throw new Error('ElevenLabs API key missing');
100
185
  const baseUrl = normalizeBaseUrl(readFirstEnv(baseUrlEnvVars), 'https://api.elevenlabs.io');
101
- const voiceId = request.voiceId?.trim() || 'pMsXgVXv3BLzUgSXRplE';
186
+ const voiceId = request.voiceId?.trim() || DEFAULT_ELEVENLABS_VOICE;
102
187
  const response = await instrumentedFetch(`${baseUrl}/v1/text-to-speech/${voiceId}`, {
103
188
  method: 'POST',
104
189
  headers: {
@@ -108,7 +193,7 @@ export function createElevenLabsProvider() {
108
193
  },
109
194
  body: JSON.stringify({
110
195
  text: request.text,
111
- model_id: request.modelId?.trim() || 'eleven_multilingual_v2',
196
+ model_id: request.modelId?.trim() || DEFAULT_ELEVENLABS_TTS_MODEL,
112
197
  voice_settings: {
113
198
  stability: 0.5,
114
199
  similarity_boost: 0.75,
@@ -133,6 +218,67 @@ export function createElevenLabsProvider() {
133
218
  metadata: { voiceId, baseUrl },
134
219
  };
135
220
  },
221
+ async synthesizeStream(request) {
222
+ const apiKey = readFirstEnv(envVars);
223
+ if (!apiKey)
224
+ throw new Error('ElevenLabs API key missing');
225
+ const baseUrl = normalizeBaseUrl(readFirstEnv(baseUrlEnvVars), 'https://api.elevenlabs.io');
226
+ const metadata = asRecord(request.metadata);
227
+ const voiceId = request.voiceId?.trim() || DEFAULT_ELEVENLABS_VOICE;
228
+ const modelId = request.modelId?.trim() || DEFAULT_ELEVENLABS_TTS_MODEL;
229
+ const outputFormat = resolveElevenLabsOutputFormat(request.format);
230
+ const mimeType = mimeTypeForElevenLabsOutputFormat(outputFormat);
231
+ const format = artifactFormatForElevenLabsOutputFormat(outputFormat);
232
+ const url = new URL(`${baseUrl}/v1/text-to-speech/${voiceId}/stream`);
233
+ url.searchParams.set('output_format', outputFormat);
234
+ if (metadata?.['enableLogging'] === false) {
235
+ url.searchParams.set('enable_logging', 'false');
236
+ }
237
+ const languageCode = trimToUndefined(metadata?.['languageCode']);
238
+ const body = {
239
+ text: request.text,
240
+ model_id: modelId,
241
+ voice_settings: {
242
+ stability: readVoiceSetting(metadata, 'stability', 'stability', 0.5),
243
+ similarity_boost: readVoiceSetting(metadata, 'similarityBoost', 'similarity_boost', 0.75),
244
+ style: readVoiceSetting(metadata, 'style', 'style', 0),
245
+ use_speaker_boost: readSpeakerBoost(metadata),
246
+ speed: request.speed ?? readVoiceSetting(metadata, 'speed', 'speed', 1),
247
+ },
248
+ ...(languageCode ? { language_code: languageCode } : {}),
249
+ };
250
+ const response = await instrumentedFetch(url, {
251
+ method: 'POST',
252
+ headers: {
253
+ 'xi-api-key': apiKey,
254
+ 'Content-Type': 'application/json',
255
+ Accept: mimeType,
256
+ },
257
+ signal: request.signal,
258
+ body: JSON.stringify(body),
259
+ });
260
+ if (!response.ok) {
261
+ const errorText = await response.text().catch(() => '');
262
+ throw new Error(`ElevenLabs streaming synthesis failed: HTTP ${response.status}${errorText ? `: ${errorText}` : ''}`);
263
+ }
264
+ const resultMetadata = {
265
+ baseUrl,
266
+ voiceId,
267
+ modelId,
268
+ outputFormat,
269
+ };
270
+ return {
271
+ providerId: 'elevenlabs',
272
+ mimeType,
273
+ format,
274
+ chunks: streamResponseAudioChunks(response, {
275
+ mimeType,
276
+ format,
277
+ metadata: resultMetadata,
278
+ }),
279
+ metadata: resultMetadata,
280
+ };
281
+ },
136
282
  async transcribe(request) {
137
283
  const apiKey = readFirstEnv(envVars);
138
284
  if (!apiKey)
@@ -1,5 +1,5 @@
1
1
  import { VoiceProviderRegistry } from './provider-registry.js';
2
- import type { VoiceDescriptor, VoiceRealtimeSession, VoiceRealtimeSessionRequest, VoiceSynthesisRequest, VoiceSynthesisResult, VoiceTranscriptionRequest, VoiceTranscriptionResult } from './types.js';
2
+ import type { VoiceDescriptor, VoiceRealtimeSession, VoiceRealtimeSessionRequest, VoiceSynthesisRequest, VoiceSynthesisResult, VoiceSynthesisStreamResult, VoiceTranscriptionRequest, VoiceTranscriptionResult } from './types.js';
3
3
  export interface VoiceServiceStatus {
4
4
  readonly enabled: boolean;
5
5
  readonly providerCount: number;
@@ -12,6 +12,7 @@ export declare class VoiceService {
12
12
  getStatus(enabled: boolean): Promise<VoiceServiceStatus>;
13
13
  listVoices(providerId?: string): Promise<readonly VoiceDescriptor[]>;
14
14
  synthesize(providerId: string | undefined, request: VoiceSynthesisRequest): Promise<VoiceSynthesisResult>;
15
+ synthesizeStream(providerId: string | undefined, request: VoiceSynthesisRequest): Promise<VoiceSynthesisStreamResult>;
15
16
  transcribe(providerId: string | undefined, request: VoiceTranscriptionRequest): Promise<VoiceTranscriptionResult>;
16
17
  openRealtimeSession(providerId: string | undefined, request: VoiceRealtimeSessionRequest): Promise<VoiceRealtimeSession>;
17
18
  }
@@ -1 +1 @@
1
- {"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/voice/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACpB,2BAA2B,EAC3B,qBAAqB,EACrB,oBAAoB,EACpB,yBAAyB,EACzB,wBAAwB,EACzB,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,kBAAkB;IACj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CAAC,SAAS,EAAE,OAAO,CAAC,UAAU,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IACzE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,qBAAa,YAAY;IACX,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBAAR,QAAQ,EAAE,qBAAqB;IAEtD,SAAS,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAUxD,UAAU,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,eAAe,EAAE,CAAC;IAYpE,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAQzG,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAQrH,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAQjH,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,EAAE,2BAA2B,GAAG,OAAO,CAAC,oBAAoB,CAAC;CAO/H"}
@@ -32,6 +32,13 @@ export class VoiceService {
32
32
  }
33
33
  return provider.synthesize(request);
34
34
  }
35
+ async synthesizeStream(providerId, request) {
36
+ const provider = this.registry.findProvider('tts-stream', providerId);
37
+ if (!provider?.synthesizeStream) {
38
+ throw new Error(providerId ? `Voice streaming TTS provider unavailable: ${providerId}` : 'No streaming voice TTS provider is registered');
39
+ }
40
+ return provider.synthesizeStream(request);
41
+ }
35
42
  async transcribe(providerId, request) {
36
43
  const provider = this.registry.findProvider('stt', providerId);
37
44
  if (!provider?.transcribe) {
@@ -1,5 +1,5 @@
1
1
  /** SDK-owned platform module. This implementation is maintained in goodvibes-sdk. */
2
- export type VoiceProviderCapability = 'tts' | 'stt' | 'realtime' | 'voice-list';
2
+ export type VoiceProviderCapability = 'tts' | 'tts-stream' | 'stt' | 'realtime' | 'voice-list';
3
3
  export type VoiceProviderState = 'healthy' | 'degraded' | 'disabled' | 'unconfigured';
4
4
  export type VoiceAudioFormat = 'wav' | 'mp3' | 'ogg' | 'webm' | 'pcm16' | 'flac';
5
5
  export interface VoiceProviderStatus {
@@ -33,6 +33,7 @@ export interface VoiceSynthesisRequest {
33
33
  readonly modelId?: string;
34
34
  readonly format?: VoiceAudioFormat | string;
35
35
  readonly speed?: number;
36
+ readonly signal?: AbortSignal;
36
37
  readonly metadata?: Record<string, unknown>;
37
38
  }
38
39
  export interface VoiceSynthesisResult {
@@ -40,6 +41,21 @@ export interface VoiceSynthesisResult {
40
41
  readonly audio: VoiceAudioArtifact;
41
42
  readonly metadata: Record<string, unknown>;
42
43
  }
44
+ export interface VoiceAudioChunk {
45
+ readonly data: Uint8Array;
46
+ readonly sequence: number;
47
+ readonly mimeType?: string;
48
+ readonly format?: VoiceAudioFormat | string;
49
+ readonly final?: boolean;
50
+ readonly metadata?: Record<string, unknown>;
51
+ }
52
+ export interface VoiceSynthesisStreamResult {
53
+ readonly providerId: string;
54
+ readonly mimeType: string;
55
+ readonly format: VoiceAudioFormat | string;
56
+ readonly chunks: AsyncIterable<VoiceAudioChunk>;
57
+ readonly metadata: Record<string, unknown>;
58
+ }
43
59
  export interface VoiceTranscriptionRequest {
44
60
  readonly audio: VoiceAudioArtifact;
45
61
  readonly language?: string;
@@ -83,6 +99,7 @@ export interface VoiceProvider {
83
99
  status?(): Promise<VoiceProviderStatus> | VoiceProviderStatus;
84
100
  listVoices?(): Promise<readonly VoiceDescriptor[]> | readonly VoiceDescriptor[];
85
101
  synthesize?(request: VoiceSynthesisRequest): Promise<VoiceSynthesisResult>;
102
+ synthesizeStream?(request: VoiceSynthesisRequest): Promise<VoiceSynthesisStreamResult> | VoiceSynthesisStreamResult;
86
103
  transcribe?(request: VoiceTranscriptionRequest): Promise<VoiceTranscriptionResult>;
87
104
  openRealtimeSession?(request: VoiceRealtimeSessionRequest): Promise<VoiceRealtimeSession>;
88
105
  }
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/voice/types.ts"],"names":[],"mappings":"AAAA,qFAAqF;AAErF,MAAM,MAAM,uBAAuB,GAAG,KAAK,GAAG,KAAK,GAAG,UAAU,GAAG,YAAY,CAAC;AAChF,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,cAAc,CAAC;AACtF,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAEjF,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,kBAAkB,CAAC;IACnC,QAAQ,CAAC,YAAY,EAAE,SAAS,uBAAuB,EAAE,CAAC;IAC1D,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC5C;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC5C;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,QAAQ,EAAE,MAA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,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC5C;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,YAAY,EAAE,SAAS,uBAAuB,EAAE,CAAC;IAC1D,MAAM,CAAC,IAAI,OAAO,CAAC,mBAAmB,CAAC,GAAG,mBAAmB,CAAC;IAC9D,UAAU,CAAC,IAAI,OAAO,CAAC,SAAS,eAAe,EAAE,CAAC,GAAG,SAAS,eAAe,EAAE,CAAC;IAChF,UAAU,CAAC,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAC3E,gBAAgB,CAAC,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,0BAA0B,CAAC,GAAG,0BAA0B,CAAC;IACpH,UAAU,CAAC,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;IACnF,mBAAmB,CAAC,CAAC,OAAO,EAAE,2BAA2B,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;CAC3F"}
package/dist/index.d.ts CHANGED
@@ -6,6 +6,8 @@ export type { BrowserGoodVibesSdkOptions } from './browser.js';
6
6
  export { createBrowserGoodVibesSdk } from './browser.js';
7
7
  export type { WebGoodVibesSdkOptions } from './web.js';
8
8
  export { createWebGoodVibesSdk } from './web.js';
9
+ export type { GoodVibesCloudflareExecutionContext, GoodVibesCloudflareMessageBatch, GoodVibesCloudflareQueue, GoodVibesCloudflareQueueMessage, GoodVibesCloudflareQueuePayload, GoodVibesCloudflareWorker, GoodVibesCloudflareWorkerEnv, GoodVibesCloudflareWorkerOptions, } from './workers.js';
10
+ export { createGoodVibesCloudflareWorker } from './workers.js';
9
11
  export type { ReactNativeGoodVibesRealtime, ReactNativeGoodVibesSdk, ReactNativeGoodVibesSdkOptions, } from './react-native.js';
10
12
  export { createReactNativeGoodVibesSdk } from './react-native.js';
11
13
  export type { ExpoGoodVibesSdkOptions } from './expo.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,iBAAiB,EACjB,YAAY,EACZ,wBAAwB,EACxB,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,YAAY,EACV,wBAAwB,EACxB,mBAAmB,EACnB,yBAAyB,EACzB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,uBAAuB,EACvB,yBAAyB,EACzB,sBAAsB,GACvB,MAAM,WAAW,CAAC;AACnB,YAAY,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AACzD,YAAY,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACjD,YAAY,EACV,4BAA4B,EAC5B,uBAAuB,EACvB,8BAA8B,GAC/B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,6BAA6B,EAAE,MAAM,mBAAmB,CAAC;AAClE,YAAY,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AACnD,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B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AC;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AACnD,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC"}
package/dist/index.js CHANGED
@@ -2,6 +2,7 @@ export { createGoodVibesSdk } from './client.js';
2
2
  export { createBrowserTokenStore, createGoodVibesAuthClient, createMemoryTokenStore, } from './auth.js';
3
3
  export { createBrowserGoodVibesSdk } from './browser.js';
4
4
  export { createWebGoodVibesSdk } from './web.js';
5
+ export { createGoodVibesCloudflareWorker } from './workers.js';
5
6
  export { createReactNativeGoodVibesSdk } from './react-native.js';
6
7
  export { createExpoGoodVibesSdk } from './expo.js';
7
8
  export * from './observer/index.js';
@@ -0,0 +1,40 @@
1
+ export interface GoodVibesCloudflareQueue<Body = unknown> {
2
+ send(message: Body): Promise<void>;
3
+ }
4
+ export interface GoodVibesCloudflareQueueMessage<Body = unknown> {
5
+ readonly body: Body;
6
+ ack?(): void;
7
+ retry?(): void;
8
+ }
9
+ export interface GoodVibesCloudflareMessageBatch<Body = unknown> {
10
+ readonly messages: readonly GoodVibesCloudflareQueueMessage<Body>[];
11
+ }
12
+ export interface GoodVibesCloudflareExecutionContext {
13
+ waitUntil(promise: Promise<unknown>): void;
14
+ }
15
+ export interface GoodVibesCloudflareWorkerEnv {
16
+ GOODVIBES_DAEMON_URL?: string;
17
+ GOODVIBES_OPERATOR_TOKEN?: string;
18
+ GOODVIBES_BATCH_QUEUE?: GoodVibesCloudflareQueue<GoodVibesCloudflareQueuePayload>;
19
+ }
20
+ export type GoodVibesCloudflareQueuePayload = {
21
+ readonly type: 'batch.tick';
22
+ readonly force?: boolean;
23
+ readonly enqueuedAt?: number;
24
+ } | {
25
+ readonly type: 'batch.job.create';
26
+ readonly body: Record<string, unknown>;
27
+ readonly enqueuedAt?: number;
28
+ };
29
+ export interface GoodVibesCloudflareWorkerOptions {
30
+ readonly daemonUrl?: string;
31
+ readonly authToken?: string;
32
+ readonly queueJobPayloads?: boolean;
33
+ }
34
+ export interface GoodVibesCloudflareWorker {
35
+ fetch(request: Request, env: GoodVibesCloudflareWorkerEnv, ctx: GoodVibesCloudflareExecutionContext): Promise<Response>;
36
+ queue(batch: GoodVibesCloudflareMessageBatch<GoodVibesCloudflareQueuePayload>, env: GoodVibesCloudflareWorkerEnv, ctx: GoodVibesCloudflareExecutionContext): Promise<void>;
37
+ scheduled(event: unknown, env: GoodVibesCloudflareWorkerEnv, ctx: GoodVibesCloudflareExecutionContext): Promise<void>;
38
+ }
39
+ export declare function createGoodVibesCloudflareWorker(options?: GoodVibesCloudflareWorkerOptions): GoodVibesCloudflareWorker;
40
+ //# sourceMappingURL=workers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workers.d.ts","sourceRoot":"","sources":["../src/workers.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,wBAAwB,CAAC,IAAI,GAAG,OAAO;IACtD,IAAI,CAAC,OAAO,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACpC;AAED,MAAM,WAAW,+BAA+B,CAAC,IAAI,GAAG,OAAO;IAC7D,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,GAAG,CAAC,IAAI,IAAI,CAAC;IACb,KAAK,CAAC,IAAI,IAAI,CAAC;CAChB;AAED,MAAM,WAAW,+BAA+B,CAAC,IAAI,GAAG,OAAO;IAC7D,QAAQ,CAAC,QAAQ,EAAE,SAAS,+BAA+B,CAAC,IAAI,CAAC,EAAE,CAAC;CACrE;AAED,MAAM,WAAW,mCAAmC;IAClD,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,IAAI,C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