@vellumai/plugin-api 0.10.7-dev.202607101252.74ea83d → 0.10.7-dev.202607101459.27388eb

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 (3) hide show
  1. package/index.d.ts +49 -0
  2. package/index.js +2 -0
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -3882,6 +3882,7 @@ declare const messageMetadataSchema: z.ZodObject<{
3882
3882
  trusted_contact: "trusted_contact";
3883
3883
  unverified_contact: "unverified_contact";
3884
3884
  }>>;
3885
+ model: z.ZodOptional<z.ZodString>;
3885
3886
  provenanceSourceChannel: z.ZodOptional<z.ZodEnum<{
3886
3887
  vellum: "vellum";
3887
3888
  telegram: "telegram";
@@ -5518,6 +5519,29 @@ declare type _SyncInvalidationServerMessages = SyncChangedEvent;
5518
5519
  /** Re-sync one persisted message into the conversation's disk view. */
5519
5520
  export declare function syncMessageToDisk(conversationId: string, messageId: string, createdAtMs: number): Promise<void>;
5520
5521
 
5522
+ /**
5523
+ * Synthesize text to audio using the globally configured TTS provider.
5524
+ *
5525
+ * 1. Resolves the active provider and its config via `tts-config-resolver`.
5526
+ * 2. Looks up the provider adapter in the registry.
5527
+ * 3. Delegates to the adapter's `synthesize` method.
5528
+ *
5529
+ * Throws {@link TtsSynthesisError} when the provider is not registered
5530
+ * or synthesis fails.
5531
+ */
5532
+ export declare function synthesizeText(options: SynthesizeTextOptions): Promise<TtsSynthesisResult>;
5533
+
5534
+ export declare interface SynthesizeTextOptions {
5535
+ /** Text to speak. Sanitized internally — callers can pass raw model output. */
5536
+ text: string;
5537
+ /** Product surface requesting synthesis. */
5538
+ useCase: TtsUseCase;
5539
+ /** Optional voice override (provider-specific identifier). */
5540
+ voiceId?: string;
5541
+ /** Optional abort signal. */
5542
+ signal?: AbortSignal;
5543
+ }
5544
+
5521
5545
  declare interface TableCellValue {
5522
5546
  text: string;
5523
5547
  icon?: string;
@@ -6205,6 +6229,31 @@ declare const trustClassSchema: z.ZodEnum<{
6205
6229
  unverified_contact: "unverified_contact";
6206
6230
  }>;
6207
6231
 
6232
+ export declare class TtsSynthesisError extends Error {
6233
+ readonly code: TtsSynthesisErrorCode;
6234
+ constructor(code: TtsSynthesisErrorCode, message: string);
6235
+ }
6236
+
6237
+ declare type TtsSynthesisErrorCode = "TTS_PROVIDER_NOT_CONFIGURED" | "TTS_SYNTHESIS_FAILED";
6238
+
6239
+ /** Output of a completed TTS synthesis call. */
6240
+ export declare interface TtsSynthesisResult {
6241
+ /** Complete audio buffer. */
6242
+ audio: Buffer;
6243
+ /** MIME type of the returned audio (e.g. `"audio/mpeg"`, `"audio/wav"`). */
6244
+ contentType: string;
6245
+ }
6246
+
6247
+ /**
6248
+ * Describes the product surface that is requesting synthesis so providers
6249
+ * can tailor format, latency, and quality trade-offs.
6250
+ */
6251
+ declare type TtsUseCase =
6252
+ /** Real-time phone call — prioritize low latency and streaming. */
6253
+ "phone-call"
6254
+ /** In-app message playback — buffer-oriented, higher quality acceptable. */
6255
+ | "message-playback";
6256
+
6208
6257
  declare interface UiSurfaceComplete {
6209
6258
  type: "ui_surface_complete";
6210
6259
  conversationId: string;
package/index.js CHANGED
@@ -3,6 +3,7 @@ const api = globalThis[Symbol.for("vellum.plugin-api")] ?? {};
3
3
  export const CLI_COMMAND_HELP = api.CLI_COMMAND_HELP;
4
4
  export const HOOKS = api.HOOKS;
5
5
  export const RiskLevel = api.RiskLevel;
6
+ export const TtsSynthesisError = api.TtsSynthesisError;
6
7
  export const addMessage = api.addMessage;
7
8
  export const assistantEventHub = api.assistantEventHub;
8
9
  export const buildMessageExcerpt = api.buildMessageExcerpt;
@@ -29,4 +30,5 @@ export const searchMessageIdsLexical = api.searchMessageIdsLexical;
29
30
  export const selectedBackendSupportsMultimodal = api.selectedBackendSupportsMultimodal;
30
31
  export const stringifyMessageContent = api.stringifyMessageContent;
31
32
  export const syncMessageToDisk = api.syncMessageToDisk;
33
+ export const synthesizeText = api.synthesizeText;
32
34
  export const updateMessageMetadata = api.updateMessageMetadata;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vellumai/plugin-api",
3
- "version": "0.10.7-dev.202607101252.74ea83d",
3
+ "version": "0.10.7-dev.202607101459.27388eb",
4
4
  "description": "Public TypeScript authoring contract for Vellum assistant plugins.",
5
5
  "license": "MIT",
6
6
  "type": "module",