@vellumai/plugin-api 0.10.8 → 0.10.9-dev.202607152124.584d617

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 +222 -219
  2. package/index.js +3 -0
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -245,15 +245,15 @@ declare const AssistantActivityStateEventSchema: z.ZodObject<{
245
245
  reason: z.ZodEnum<{
246
246
  thinking_delta: "thinking_delta";
247
247
  generation_cancelled: "generation_cancelled";
248
+ tool_use_start: "tool_use_start";
249
+ message_complete: "message_complete";
248
250
  message_dequeued: "message_dequeued";
249
251
  first_text_delta: "first_text_delta";
250
- tool_use_start: "tool_use_start";
251
252
  preview_start: "preview_start";
252
253
  tool_result_received: "tool_result_received";
253
254
  confirmation_requested: "confirmation_requested";
254
255
  confirmation_resolved: "confirmation_resolved";
255
256
  context_compacting: "context_compacting";
256
- message_complete: "message_complete";
257
257
  error_terminal: "error_terminal";
258
258
  }>;
259
259
  requestId: z.ZodOptional<z.ZodString>;
@@ -304,8 +304,12 @@ declare const AssistantConfigSchema: z.ZodObject<{
304
304
  }>>;
305
305
  }, z.core.$strip>>;
306
306
  stt: z.ZodDefault<z.ZodObject<{
307
- mode: z.ZodDefault<z.ZodLiteral<"your-own">>;
307
+ mode: z.ZodDefault<z.ZodEnum<{
308
+ managed: "managed";
309
+ "your-own": "your-own";
310
+ }>>;
308
311
  provider: z.ZodEnum<{
312
+ vellum: "vellum";
309
313
  deepgram: "deepgram";
310
314
  "google-gemini": "google-gemini";
311
315
  "openai-whisper": "openai-whisper";
@@ -314,8 +318,12 @@ declare const AssistantConfigSchema: z.ZodObject<{
314
318
  providers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
315
319
  }, z.core.$strip>>;
316
320
  tts: z.ZodDefault<z.ZodObject<{
317
- mode: z.ZodDefault<z.ZodLiteral<"your-own">>;
321
+ mode: z.ZodDefault<z.ZodEnum<{
322
+ managed: "managed";
323
+ "your-own": "your-own";
324
+ }>>;
318
325
  provider: z.ZodDefault<z.ZodEnum<{
326
+ vellum: "vellum";
319
327
  deepgram: "deepgram";
320
328
  xai: "xai";
321
329
  elevenlabs: "elevenlabs";
@@ -362,6 +370,7 @@ declare const AssistantConfigSchema: z.ZodObject<{
362
370
  sampleRate: z.ZodDefault<z.ZodNumber>;
363
371
  bitRate: z.ZodDefault<z.ZodNumber>;
364
372
  }, z.core.$strip>>;
373
+ vellum: z.ZodDefault<z.ZodObject<{}, z.core.$strip>>;
365
374
  }, z.core.$strip>>;
366
375
  }, z.core.$strip>>;
367
376
  "google-oauth": z.ZodDefault<z.ZodObject<{
@@ -526,9 +535,6 @@ declare const AssistantConfigSchema: z.ZodObject<{
526
535
  fastConcurrency?: number | undefined;
527
536
  embedConcurrency?: number | undefined;
528
537
  }>>>;
529
- worker: z.ZodDefault<z.ZodObject<{
530
- enabled: z.ZodDefault<z.ZodBoolean>;
531
- }, z.core.$strip>>;
532
538
  retention: z.ZodDefault<z.ZodObject<{
533
539
  keepRawForever: z.ZodDefault<z.ZodBoolean>;
534
540
  }, z.core.$strip>>;
@@ -661,6 +667,7 @@ declare const AssistantConfigSchema: z.ZodObject<{
661
667
  minCooldownMs: z.ZodDefault<z.ZodNumber>;
662
668
  keepSupersededRuns: z.ZodDefault<z.ZodBoolean>;
663
669
  matchConversationProfile: z.ZodDefault<z.ZodBoolean>;
670
+ promptPath: z.ZodDefault<z.ZodNullable<z.ZodString>>;
664
671
  }, z.core.$strip>>;
665
672
  }, z.core.$strip>>;
666
673
  monitoring: z.ZodDefault<z.ZodObject<{
@@ -671,11 +678,6 @@ declare const AssistantConfigSchema: z.ZodObject<{
671
678
  pluginSourceScanIntervalMs: z.ZodDefault<z.ZodNumber>;
672
679
  baselineSnapshotIntervalMs: z.ZodDefault<z.ZodNumber>;
673
680
  }, z.core.$strip>>;
674
- schedules: z.ZodDefault<z.ZodObject<{
675
- worker: z.ZodDefault<z.ZodObject<{
676
- enabled: z.ZodDefault<z.ZodBoolean>;
677
- }, z.core.$strip>>;
678
- }, z.core.$strip>>;
679
681
  migrations: z.ZodDefault<z.ZodObject<{
680
682
  worker: z.ZodDefault<z.ZodObject<{
681
683
  enabled: z.ZodDefault<z.ZodBoolean>;
@@ -1131,10 +1133,10 @@ declare const AssistantConfigSchema: z.ZodObject<{
1131
1133
  }, z.core.$strip>>;
1132
1134
  install: z.ZodDefault<z.ZodObject<{
1133
1135
  nodeManager: z.ZodDefault<z.ZodEnum<{
1134
- bun: "bun";
1135
1136
  npm: "npm";
1136
1137
  pnpm: "pnpm";
1137
1138
  yarn: "yarn";
1139
+ bun: "bun";
1138
1140
  }>>;
1139
1141
  }, z.core.$strip>>;
1140
1142
  allowBundled: z.ZodDefault<z.ZodNullable<z.ZodArray<z.ZodString>>>;
@@ -1162,6 +1164,7 @@ declare const AssistantConfigSchema: z.ZodObject<{
1162
1164
  turnCommitMaxWaitMs: z.ZodDefault<z.ZodNumber>;
1163
1165
  failureBackoffBaseMs: z.ZodDefault<z.ZodNumber>;
1164
1166
  failureBackoffMaxMs: z.ZodDefault<z.ZodNumber>;
1167
+ maxFileSizeBytes: z.ZodDefault<z.ZodNumber>;
1165
1168
  interactiveGitTimeoutMs: z.ZodDefault<z.ZodNumber>;
1166
1169
  enrichmentQueueSize: z.ZodDefault<z.ZodNumber>;
1167
1170
  enrichmentConcurrency: z.ZodDefault<z.ZodNumber>;
@@ -1252,6 +1255,7 @@ declare const AssistantConfigSchema: z.ZodObject<{
1252
1255
  bargeInMinSpeechMs: z.ZodDefault<z.ZodNumber>;
1253
1256
  }, z.core.$strip>>;
1254
1257
  maxSessionDurationSeconds: z.ZodDefault<z.ZodNumber>;
1258
+ archiveAudio: z.ZodDefault<z.ZodBoolean>;
1255
1259
  }, z.core.$strip>>;
1256
1260
  whatsapp: z.ZodDefault<z.ZodObject<{
1257
1261
  phoneNumber: z.ZodDefault<z.ZodString>;
@@ -1518,30 +1522,6 @@ export declare interface AssistantEventSubscription {
1518
1522
  readonly connectionId: string;
1519
1523
  }
1520
1524
 
1521
- declare interface AssistantInboxEscalationResponse {
1522
- type: "assistant_inbox_escalation_response";
1523
- success: boolean;
1524
- error?: string;
1525
- /** List of escalations (returned on list). */
1526
- escalations?: Array<{
1527
- id: string;
1528
- runId: string;
1529
- conversationId: string;
1530
- channel: string;
1531
- requesterExternalUserId: string;
1532
- requesterChatId: string;
1533
- status: string;
1534
- requestSummary?: string;
1535
- createdAt: number;
1536
- }>;
1537
- /** Decision result (returned on decide). */
1538
- decision?: {
1539
- id: string;
1540
- status: string;
1541
- decidedAt: number;
1542
- };
1543
- }
1544
-
1545
1525
  /**
1546
1526
  * Managed skill authored by the assistant's retrospective. Identical shape to a
1547
1527
  * custom skill — it stays managed/deletable — but carries a distinct origin so
@@ -1911,6 +1891,12 @@ declare interface ClawhubSlimSkill extends SlimSkillBase {
1911
1891
 
1912
1892
  export declare const CLI_COMMAND_HELP: readonly CliCommandHelp[];
1913
1893
 
1894
+ declare interface CliArgumentHelp {
1895
+ /** Commander argument spec, e.g. `"<channel>"` or `"[value]"`. */
1896
+ name: string;
1897
+ description: string;
1898
+ }
1899
+
1914
1900
  /**
1915
1901
  * Fully declarative description of a top-level `assistant` CLI command and its
1916
1902
  * subcommands. Plain data by design — no action handlers — so plugins (e.g. the
@@ -1920,7 +1906,21 @@ export declare const CLI_COMMAND_HELP: readonly CliCommandHelp[];
1920
1906
  */
1921
1907
  declare interface CliCommandHelp {
1922
1908
  name: string;
1909
+ /**
1910
+ * Positional-argument spec appended to the name at registration, e.g.
1911
+ * `"<command>"`. Use {@link commandSpec} to build the Commander registration
1912
+ * string; `name` stays the bare command name so consumers (dedup, slugs,
1913
+ * rendering) never parse argument syntax out of it.
1914
+ */
1915
+ args?: string;
1923
1916
  description: string;
1917
+ /**
1918
+ * Positional arguments that carry their own description, applied via
1919
+ * Commander's `argument(name, description)` (rendered in the generated
1920
+ * `Arguments:` help section). Use `args` instead when the positional needs
1921
+ * no description.
1922
+ */
1923
+ arguments?: CliArgumentHelp[];
1924
1924
  /** Options declared directly on the top-level command. */
1925
1925
  options?: CliOptionHelp[];
1926
1926
  /** Extra help appended after the option list (`addHelpText("after", …)`). */
@@ -1962,15 +1962,30 @@ declare interface CliOptionHelp {
1962
1962
  /** When true, applied via `requiredOption` (missing → error) rather than `option`. */
1963
1963
  required?: boolean;
1964
1964
  /** Default value passed to `option(flags, description, defaultValue)`. */
1965
- defaultValue?: string;
1965
+ defaultValue?: string | number | boolean;
1966
+ /** Allowed values, applied via Commander's `Option.choices()` (invalid → error). */
1967
+ choices?: readonly string[];
1966
1968
  }
1967
1969
 
1968
1970
  declare interface CliSubcommandHelp {
1969
1971
  name: string;
1972
+ /** Positional-argument spec, e.g. `"<path>"` — see {@link CliCommandHelp.args}. */
1973
+ args?: string;
1970
1974
  description: string;
1975
+ /**
1976
+ * Positional arguments that carry their own description, applied via
1977
+ * Commander's `argument(name, description)` (rendered in the generated
1978
+ * `Arguments:` help section). Use `args` instead when the positional needs
1979
+ * no description.
1980
+ */
1981
+ arguments?: CliArgumentHelp[];
1971
1982
  options?: CliOptionHelp[];
1972
1983
  /** Extra help appended after the option list (`addHelpText("after", …)`). */
1973
1984
  helpText?: string;
1985
+ /** When true, this subcommand runs when the parent is invoked without one. */
1986
+ isDefault?: boolean;
1987
+ /** Nested subcommand groups (e.g. `avatar character update`). */
1988
+ subcommands?: CliSubcommandHelp[];
1974
1989
  }
1975
1990
 
1976
1991
  declare type CompactionCircuitClosedEvent = z.infer<typeof CompactionCircuitClosedEventSchema>;
@@ -2428,7 +2443,7 @@ declare interface ConversationSearchResultItem {
2428
2443
  matchingMessages: ConversationSearchMatchingMessage[];
2429
2444
  }
2430
2445
 
2431
- declare type _ConversationsServerMessages = AuthResult | PongMessage | AssistantStatusMessage | GenerationCancelledEvent | GenerationHandoffEvent | ModelInfo | HistoryResponse | UndoComplete | UsageUpdateEvent | UsageProgressEvent | UsageResponse | ContextCompacted | CompactionCircuitOpenEvent | CompactionCircuitClosedEvent | ConversationErrorEvent | ConversationNoticeEvent | ConversationInfo | ConversationTitleUpdatedEvent | ConversationListResponse | ConversationsClearResponse | ConversationSearchResponse | MessageContentResponse | ConversationListInvalidatedEvent | ScheduleConversationCreated | OpenConversation;
2446
+ declare type _ConversationsServerMessages = AuthResult | PongMessage | AssistantStatusMessage | GenerationCancelledEvent | GenerationHandoffEvent | ModelInfo | HistoryResponse | UndoComplete | UsageUpdateEvent | UsageProgressEvent | UsageResponse | ContextCompacted | CompactionCircuitOpenEvent | CompactionCircuitClosedEvent | ConversationErrorEvent | ConversationNoticeEvent | ConversationInfo | ConversationTitleUpdatedEvent | ConversationListResponse | ConversationsClearResponse | ConversationSearchResponse | MessageContentResponse | ConversationListInvalidatedEvent | ScheduleConversationCreated | OpenConversationEvent;
2432
2447
 
2433
2448
  declare type ConversationTitleUpdatedEvent = z.infer<typeof ConversationTitleUpdatedEventSchema>;
2434
2449
 
@@ -2696,7 +2711,7 @@ declare const ErrorEventSchema: z.ZodObject<{
2696
2711
  conversationId: z.ZodOptional<z.ZodString>;
2697
2712
  }, z.core.$strip>;
2698
2713
 
2699
- export declare function extractTextFromStoredMessageContent(raw: string): string;
2714
+ export declare function extractTextFromStoredMessageContent(raw: string | ContentBlock[]): string;
2700
2715
 
2701
2716
  export declare interface FileContent {
2702
2717
  type: "file";
@@ -2919,8 +2934,8 @@ declare interface GuardianDecisionPrompt {
2919
2934
  conversationId: string;
2920
2935
  callSessionId: string | null;
2921
2936
  /**
2922
- * Canonical request kind (e.g. 'tool_approval', 'pending_question').
2923
- * Present when the prompt originates from the canonical guardian request
2937
+ * Guardian request kind (e.g. 'tool_approval', 'pending_question').
2938
+ * Present when the prompt originates from the guardian request
2924
2939
  * store. Absent for legacy-only prompts.
2925
2940
  */
2926
2941
  kind?: string;
@@ -3417,10 +3432,10 @@ declare interface HostFileWriteRequest {
3417
3432
 
3418
3433
  /**
3419
3434
  * Host proxy capabilities that an interface can support. The macOS client
3420
- * supports all five; the chrome-extension interface only supports
3435
+ * supports all of them; the chrome-extension interface only supports
3421
3436
  * host_browser (via the Chrome DevTools Protocol proxy).
3422
3437
  */
3423
- declare type HostProxyCapability = "host_bash" | "host_file" | "host_cu" | "host_browser" | "host_app_control";
3438
+ declare type HostProxyCapability = "host_bash" | "host_file" | "host_cu" | "host_browser" | "host_app_control" | "host_ui_snapshot";
3424
3439
 
3425
3440
  declare interface HostTransferCancelRequest {
3426
3441
  type: "host_transfer_cancel";
@@ -3456,6 +3471,29 @@ declare interface HostTransferToSandboxRequest {
3456
3471
  sourcePath: string;
3457
3472
  }
3458
3473
 
3474
+ declare interface HostUiSnapshotCancelMessage {
3475
+ type: "host_ui_snapshot_cancel";
3476
+ requestId: string;
3477
+ }
3478
+
3479
+ declare interface HostUiSnapshotRequestMessage {
3480
+ type: "host_ui_snapshot_request";
3481
+ requestId: string;
3482
+ view: HostUiSnapshotView;
3483
+ /**
3484
+ * Validated workspace-theme tokens to apply on the stage. The daemon reads
3485
+ * them from ui/theme.json at request time so the capture reflects the
3486
+ * current file even before connected clients refetch. Absent when no valid
3487
+ * theme exists — the stage renders the built-in base theme.
3488
+ */
3489
+ tokens?: Record<string, string>;
3490
+ }
3491
+
3492
+ declare type _HostUiSnapshotServerMessages = HostUiSnapshotRequestMessage | HostUiSnapshotCancelMessage;
3493
+
3494
+ /** Staged compositions the web client can render for capture. */
3495
+ declare type HostUiSnapshotView = "sampler" | "chat";
3496
+
3459
3497
  declare type IdentityChangedEvent = z.infer<typeof IdentityChangedEventSchema>;
3460
3498
 
3461
3499
  declare const IdentityChangedEventSchema: z.ZodObject<{
@@ -3493,7 +3531,7 @@ declare interface ImageEmbeddingInput {
3493
3531
  mimeType: string;
3494
3532
  }
3495
3533
 
3496
- declare type _InboxServerMessages = ContactsInviteResponse | AssistantInboxEscalationResponse;
3534
+ declare type _InboxServerMessages = ContactsInviteResponse;
3497
3535
 
3498
3536
  declare interface IngressConfigResponse {
3499
3537
  type: "ingress_config_response";
@@ -3594,7 +3632,7 @@ declare const InteractionResolvedEventSchema: z.ZodObject<{
3594
3632
  kind: z.ZodString;
3595
3633
  }, z.core.$strip>;
3596
3634
 
3597
- declare const INTERFACE_IDS: readonly ["macos", "ios", "cli", "telegram", "phone", "web", "whatsapp", "slack", "email", "chrome-extension", "a2a"];
3635
+ declare const INTERFACE_IDS: readonly ["macos", "ios", "cli", "telegram", "phone", "web", "whatsapp", "slack", "email", "chrome-extension", "a2a", "route"];
3598
3636
 
3599
3637
  declare type InterfaceId = (typeof INTERFACE_IDS)[number];
3600
3638
 
@@ -3856,8 +3894,8 @@ declare const messageMetadataSchema: z.ZodObject<{
3856
3894
  platform: "platform";
3857
3895
  a2a: "a2a";
3858
3896
  }>>;
3859
- userMessageInterface: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<"telegram" | "phone" | "whatsapp" | "slack" | "email" | "a2a" | "macos" | "ios" | "cli" | "web" | "chrome-extension" | null, string>> & z.ZodType<"telegram" | "phone" | "whatsapp" | "slack" | "email" | "a2a" | "macos" | "ios" | "cli" | "web" | "chrome-extension", string, z.core.$ZodTypeInternals<"telegram" | "phone" | "whatsapp" | "slack" | "email" | "a2a" | "macos" | "ios" | "cli" | "web" | "chrome-extension", string>>>;
3860
- assistantMessageInterface: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<"telegram" | "phone" | "whatsapp" | "slack" | "email" | "a2a" | "macos" | "ios" | "cli" | "web" | "chrome-extension" | null, string>> & z.ZodType<"telegram" | "phone" | "whatsapp" | "slack" | "email" | "a2a" | "macos" | "ios" | "cli" | "web" | "chrome-extension", string, z.core.$ZodTypeInternals<"telegram" | "phone" | "whatsapp" | "slack" | "email" | "a2a" | "macos" | "ios" | "cli" | "web" | "chrome-extension", string>>>;
3897
+ userMessageInterface: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<"telegram" | "phone" | "whatsapp" | "slack" | "email" | "a2a" | "macos" | "ios" | "cli" | "web" | "chrome-extension" | "route" | null, string>> & z.ZodType<"telegram" | "phone" | "whatsapp" | "slack" | "email" | "a2a" | "macos" | "ios" | "cli" | "web" | "chrome-extension" | "route", string, z.core.$ZodTypeInternals<"telegram" | "phone" | "whatsapp" | "slack" | "email" | "a2a" | "macos" | "ios" | "cli" | "web" | "chrome-extension" | "route", string>>>;
3898
+ assistantMessageInterface: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<"telegram" | "phone" | "whatsapp" | "slack" | "email" | "a2a" | "macos" | "ios" | "cli" | "web" | "chrome-extension" | "route" | null, string>> & z.ZodType<"telegram" | "phone" | "whatsapp" | "slack" | "email" | "a2a" | "macos" | "ios" | "cli" | "web" | "chrome-extension" | "route", string, z.core.$ZodTypeInternals<"telegram" | "phone" | "whatsapp" | "slack" | "email" | "a2a" | "macos" | "ios" | "cli" | "web" | "chrome-extension" | "route", string>>>;
3861
3899
  client: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3862
3900
  subagentNotification: z.ZodOptional<z.ZodObject<{
3863
3901
  subagentId: z.ZodString;
@@ -3882,6 +3920,7 @@ declare const messageMetadataSchema: z.ZodObject<{
3882
3920
  trusted_contact: "trusted_contact";
3883
3921
  unverified_contact: "unverified_contact";
3884
3922
  }>>;
3923
+ model: z.ZodOptional<z.ZodString>;
3885
3924
  provenanceSourceChannel: z.ZodOptional<z.ZodEnum<{
3886
3925
  vellum: "vellum";
3887
3926
  telegram: "telegram";
@@ -3960,8 +3999,13 @@ declare interface MessageRow {
3960
3999
  id: string;
3961
4000
  conversationId: string;
3962
4001
  role: string;
3963
- /** Resolved content — always inline JSON, never a raw `{ ref }`. */
3964
- content: string;
4002
+ /**
4003
+ * Typed content blocks, resolved at the row-fetch chokepoint by
4004
+ * `resolveMessageContentBlocks`: inline JSON parses, file-backed
4005
+ * `{ ref }` rows fold their delta file, and legacy plain strings arrive
4006
+ * wrapped in a single text block.
4007
+ */
4008
+ content: ContentBlock[];
3965
4009
  createdAt: number;
3966
4010
  metadata: string | null;
3967
4011
  clientMessageId: string | null;
@@ -4129,22 +4173,15 @@ declare interface OpenBundleResponse {
4129
4173
  bundleSizeBytes: number;
4130
4174
  }
4131
4175
 
4132
- /**
4133
- * Server push — instructs the client to open and focus a conversation. If
4134
- * the conversation isn't already present in the client's sidebar list (e.g.
4135
- * it was just created via `POST /v1/conversations`), the client should stub
4136
- * a sidebar entry using the provided `title` before navigating.
4137
- */
4138
- declare interface OpenConversation {
4139
- type: "open_conversation";
4140
- conversationId: string;
4141
- /** Optional conversation title; supplied when the client may not yet have the conversation in its list. */
4142
- title?: string;
4143
- /** Optional message ID to scroll to after focus. */
4144
- anchorMessageId?: string;
4145
- /** When `false`, the client should register the conversation in its sidebar (so it's visible and navigable) but must NOT switch focus to it. Omitting the field defaults to `true` for backward compatibility with existing single-target 'jump to conversation' callers. */
4146
- focus?: boolean;
4147
- }
4176
+ declare type OpenConversationEvent = z.infer<typeof OpenConversationEventSchema>;
4177
+
4178
+ declare const OpenConversationEventSchema: z.ZodObject<{
4179
+ type: z.ZodLiteral<"open_conversation">;
4180
+ conversationId: z.ZodString;
4181
+ title: z.ZodOptional<z.ZodString>;
4182
+ anchorMessageId: z.ZodOptional<z.ZodString>;
4183
+ focus: z.ZodOptional<z.ZodBoolean>;
4184
+ }, z.core.$strip>;
4148
4185
 
4149
4186
  declare type OpenPanelEvent = z.infer<typeof OpenPanelEventSchema>;
4150
4187
 
@@ -4868,6 +4905,63 @@ export declare enum RiskLevel {
4868
4905
  */
4869
4906
  declare type RiskLevel_2 = "safe" | "low" | "medium" | "high" | "critical" | "unknown";
4870
4907
 
4908
+ /**
4909
+ * Run a full conversation agent-loop turn: persist the user message, execute
4910
+ * the agent loop (history, tools, compaction, injections), and return the
4911
+ * assistant's full content-block response.
4912
+ *
4913
+ * When `conversationId` is omitted, a new conversation is created and its ID
4914
+ * is returned in the result.
4915
+ *
4916
+ * Events are fanned out to SSE/event-hub subscribers via `broadcastMessage`
4917
+ * (the same path the daemon's HTTP message route uses) while also being
4918
+ * collected internally so the caller receives the final response content.
4919
+ * For streaming use cases, subscribe to the conversation's events via the
4920
+ * host event hub (`assistantEventHub`).
4921
+ *
4922
+ * If the conversation is currently processing another turn, the message is
4923
+ * queued via `enqueueMessage` and the result carries `queued: true` with
4924
+ * empty content -- the queued turn will execute automatically when the
4925
+ * current turn finishes.
4926
+ */
4927
+ export declare function runConversationTurn(options: RunConversationTurnOptions): Promise<RunConversationTurnResult>;
4928
+
4929
+ export declare interface RunConversationTurnOptions {
4930
+ /**
4931
+ * Conversation to run the turn in. If omitted, a new conversation is
4932
+ * created (its ID is generated with `uuidv7` and returned in the result).
4933
+ */
4934
+ conversationId?: string;
4935
+ /**
4936
+ * User message content blocks for this turn. Text blocks become the
4937
+ * user message body; image/file blocks are resolved to inline
4938
+ * attachments. Other block types (tool_use, tool_result, thinking) are
4939
+ * ignored as they are not valid user input.
4940
+ */
4941
+ content: ContentBlock[];
4942
+ /**
4943
+ * LLM call-site for inference profile resolution. Defaults to
4944
+ * `"mainAgent"` inside the agent loop when omitted.
4945
+ */
4946
+ callSite?: LLMCallSite;
4947
+ /**
4948
+ * Abort signal. When aborted, the conversation's internal abort
4949
+ * controller fires, terminating the in-flight agent loop.
4950
+ */
4951
+ signal?: AbortSignal;
4952
+ }
4953
+
4954
+ export declare interface RunConversationTurnResult {
4955
+ /** The assistant's full content blocks for this turn (text, tool_use, etc.). */
4956
+ content: ContentBlock[];
4957
+ /** The user message row ID assigned by the persistence layer. */
4958
+ userMessageId: string;
4959
+ /** The conversation this turn ran in. */
4960
+ conversationId: string;
4961
+ /** True when the message was queued because the conversation was busy. */
4962
+ queued?: boolean;
4963
+ }
4964
+
4871
4965
  /**
4872
4966
  * Emitted when the compaction circuit breaker trips. After three consecutive
4873
4967
  * summary-LLM failures (with local fallback covering each), auto-compaction is
@@ -5036,6 +5130,18 @@ export declare interface SendMessageConfig {
5036
5130
  * stripped before any provider wire request.
5037
5131
  */
5038
5132
  selectionSeed?: string;
5133
+ /**
5134
+ * Per-conversation prompt-cache key for providers with explicit prompt
5135
+ * caching (sent as the OpenAI `prompt_cache_key` request param). Set by
5136
+ * `RetryProvider` from `selectionSeed` (the durable conversation id) for
5137
+ * the `openai` and `openrouter` providers — GPT-5.6+ requires the key for
5138
+ * reliable breakpoint matching, and OpenAI's ~15 req/min-per-key routing
5139
+ * guidance is satisfied by per-conversation ids. A non-wire field for
5140
+ * every other provider client (the Anthropic client strips it, covering
5141
+ * OpenRouter's `anthropic/*` delegation); the request param is omitted
5142
+ * when absent.
5143
+ */
5144
+ promptCacheKey?: string;
5039
5145
  /**
5040
5146
  * Internal per-request HTTP headers for managed-proxy usage attribution.
5041
5147
  * Provider clients may pass these through SDK request options only when the
@@ -5097,7 +5203,7 @@ declare interface SensitiveOutputBinding {
5097
5203
 
5098
5204
  declare type SensitiveOutputKind = "invite_code";
5099
5205
 
5100
- declare type ServerMessage = _ConversationsServerMessages | _MessagesServerMessages | _SurfacesServerMessages | _SkillsServerMessages | _AppsServerMessages | _IntegrationsServerMessages | _ComputerUseServerMessages | _ContactsServerMessages | _WorkItemsServerMessages | _SubagentsServerMessages | _DocumentsServerMessages | _DocumentCommentsServerMessages | _GuardianActionsServerMessages | _SyncInvalidationServerMessages | _HomeServerMessages | _HostAppControlServerMessages | _HostBashServerMessages | _HostBrowserServerMessages | _HostCuServerMessages | _HostFileServerMessages | _HostTransferServerMessages | _MemoryServerMessages | _WorkspaceServerMessages | _SchedulesServerMessages | _SettingsServerMessages | _DiagnosticsServerMessages | _InboxServerMessages | _NotificationsServerMessages | _UpgradesServerMessages | _AcpServerMessages | _BackgroundToolsServerMessages | _BookmarksServerMessages | _WorkflowsServerMessages | DiskPressureStatusChangedEvent | HookEvent | SubagentEvent;
5206
+ declare type ServerMessage = _ConversationsServerMessages | _MessagesServerMessages | _SurfacesServerMessages | _SkillsServerMessages | _AppsServerMessages | _IntegrationsServerMessages | _ComputerUseServerMessages | _ContactsServerMessages | _SubagentsServerMessages | _DocumentsServerMessages | _DocumentCommentsServerMessages | _GuardianActionsServerMessages | _SyncInvalidationServerMessages | _HomeServerMessages | _HostAppControlServerMessages | _HostBashServerMessages | _HostBrowserServerMessages | _HostCuServerMessages | _HostFileServerMessages | _HostTransferServerMessages | _HostUiSnapshotServerMessages | _MemoryServerMessages | _WorkspaceServerMessages | _SchedulesServerMessages | _SettingsServerMessages | _DiagnosticsServerMessages | _InboxServerMessages | _NotificationsServerMessages | _UpgradesServerMessages | _AcpServerMessages | _BackgroundToolsServerMessages | _BookmarksServerMessages | _WorkflowsServerMessages | DiskPressureStatusChangedEvent | HookEvent | SubagentEvent;
5101
5207
 
5102
5208
  export declare interface ServerToolUseContent {
5103
5209
  type: "server_tool_use";
@@ -5427,7 +5533,7 @@ declare interface StopInputContext {
5427
5533
  * Parse failures fall back to returning the raw input trimmed (the
5428
5534
  * legacy-string path).
5429
5535
  */
5430
- export declare function stringifyMessageContent(stored: string): string;
5536
+ export declare function stringifyMessageContent(stored: string | ContentBlock[]): string;
5431
5537
 
5432
5538
  declare interface SubagentDetailResponse {
5433
5539
  type: "subagent_detail_response";
@@ -5518,6 +5624,29 @@ declare type _SyncInvalidationServerMessages = SyncChangedEvent;
5518
5624
  /** Re-sync one persisted message into the conversation's disk view. */
5519
5625
  export declare function syncMessageToDisk(conversationId: string, messageId: string, createdAtMs: number): Promise<void>;
5520
5626
 
5627
+ /**
5628
+ * Synthesize text to audio using the globally configured TTS provider.
5629
+ *
5630
+ * 1. Resolves the active provider and its config via `tts-config-resolver`.
5631
+ * 2. Looks up the provider adapter in the registry.
5632
+ * 3. Delegates to the adapter's `synthesize` method.
5633
+ *
5634
+ * Throws {@link TtsSynthesisError} when the provider is not registered
5635
+ * or synthesis fails.
5636
+ */
5637
+ export declare function synthesizeText(options: SynthesizeTextOptions): Promise<TtsSynthesisResult>;
5638
+
5639
+ export declare interface SynthesizeTextOptions {
5640
+ /** Text to speak. Sanitized internally — callers can pass raw model output. */
5641
+ text: string;
5642
+ /** Product surface requesting synthesis. */
5643
+ useCase: TtsUseCase;
5644
+ /** Optional voice override (provider-specific identifier). */
5645
+ voiceId?: string;
5646
+ /** Optional abort signal. */
5647
+ signal?: AbortSignal;
5648
+ }
5649
+
5521
5650
  declare interface TableCellValue {
5522
5651
  text: string;
5523
5652
  icon?: string;
@@ -5544,19 +5673,6 @@ declare interface TableSurfaceData {
5544
5673
  caption?: string;
5545
5674
  }
5546
5675
 
5547
- /** Server push — broadcast when a task run creates a conversation. */
5548
- declare interface TaskRunConversationCreated {
5549
- type: "task_run_conversation_created";
5550
- conversationId: string;
5551
- workItemId: string;
5552
- title: string;
5553
- }
5554
-
5555
- /** Server push — lightweight invalidation signal: the task queue has been mutated, refetch your list. */
5556
- declare interface TasksChanged {
5557
- type: "tasks_changed";
5558
- }
5559
-
5560
5676
  declare interface TelegramConfigResponse {
5561
5677
  type: "telegram_config_response";
5562
5678
  success: boolean;
@@ -6205,6 +6321,31 @@ declare const trustClassSchema: z.ZodEnum<{
6205
6321
  unverified_contact: "unverified_contact";
6206
6322
  }>;
6207
6323
 
6324
+ export declare class TtsSynthesisError extends Error {
6325
+ readonly code: TtsSynthesisErrorCode;
6326
+ constructor(code: TtsSynthesisErrorCode, message: string);
6327
+ }
6328
+
6329
+ declare type TtsSynthesisErrorCode = "TTS_PROVIDER_NOT_CONFIGURED" | "TTS_SYNTHESIS_FAILED";
6330
+
6331
+ /** Output of a completed TTS synthesis call. */
6332
+ export declare interface TtsSynthesisResult {
6333
+ /** Complete audio buffer. */
6334
+ audio: Buffer;
6335
+ /** MIME type of the returned audio (e.g. `"audio/mpeg"`, `"audio/wav"`). */
6336
+ contentType: string;
6337
+ }
6338
+
6339
+ /**
6340
+ * Describes the product surface that is requesting synthesis so providers
6341
+ * can tailor format, latency, and quality trade-offs.
6342
+ */
6343
+ declare type TtsUseCase =
6344
+ /** Real-time phone call — prioritize low latency and streaming. */
6345
+ "phone-call"
6346
+ /** In-app message playback — buffer-oriented, higher quality acceptable. */
6347
+ | "message-playback";
6348
+
6208
6349
  declare interface UiSurfaceComplete {
6209
6350
  type: "ui_surface_complete";
6210
6351
  conversationId: string;
@@ -6726,144 +6867,6 @@ declare interface WorkflowStarted {
6726
6867
  label?: string;
6727
6868
  }
6728
6869
 
6729
- declare interface WorkItemApprovePermissionsResponse {
6730
- type: "work_item_approve_permissions_response";
6731
- id: string;
6732
- success: boolean;
6733
- error?: string;
6734
- }
6735
-
6736
- declare interface WorkItemCancelResponse {
6737
- type: "work_item_cancel_response";
6738
- id: string;
6739
- success: boolean;
6740
- error?: string;
6741
- }
6742
-
6743
- declare interface WorkItemDeleteResponse {
6744
- type: "work_item_delete_response";
6745
- id: string;
6746
- success: boolean;
6747
- }
6748
-
6749
- declare interface WorkItemGetResponse {
6750
- type: "work_item_get_response";
6751
- item: {
6752
- id: string;
6753
- taskId: string;
6754
- title: string;
6755
- notes: string | null;
6756
- status: string;
6757
- priorityTier: number;
6758
- sortIndex: number | null;
6759
- lastRunId: string | null;
6760
- lastRunConversationId: string | null;
6761
- lastRunStatus: string | null;
6762
- sourceType: string | null;
6763
- sourceId: string | null;
6764
- createdAt: number;
6765
- updatedAt: number;
6766
- } | null;
6767
- }
6768
-
6769
- declare interface WorkItemOutputResponse {
6770
- type: "work_item_output_response";
6771
- id: string;
6772
- success: boolean;
6773
- error?: string;
6774
- output?: {
6775
- title: string;
6776
- status: string;
6777
- runId: string | null;
6778
- conversationId: string | null;
6779
- completedAt: number | null;
6780
- summary: string;
6781
- highlights: string[];
6782
- };
6783
- }
6784
-
6785
- declare interface WorkItemPreflightResponse {
6786
- type: "work_item_preflight_response";
6787
- id: string;
6788
- success: boolean;
6789
- error?: string;
6790
- permissions?: {
6791
- tool: string;
6792
- description: string;
6793
- riskLevel: "low" | "medium" | "high";
6794
- currentDecision: "allow" | "deny" | "prompt";
6795
- }[];
6796
- }
6797
-
6798
- declare type WorkItemRunTaskErrorCode = "not_found" | "already_running" | "invalid_status" | "no_task" | "permission_required";
6799
-
6800
- declare interface WorkItemRunTaskResponse {
6801
- type: "work_item_run_task_response";
6802
- id: string;
6803
- lastRunId: string;
6804
- success: boolean;
6805
- error?: string;
6806
- /** Structured error code so the client can deterministically re-enable buttons or show contextual UI. */
6807
- errorCode?: WorkItemRunTaskErrorCode;
6808
- }
6809
-
6810
- declare interface WorkItemsListResponse {
6811
- type: "work_items_list_response";
6812
- items: Array<{
6813
- id: string;
6814
- taskId: string;
6815
- title: string;
6816
- notes: string | null;
6817
- status: string;
6818
- priorityTier: number;
6819
- sortIndex: number | null;
6820
- lastRunId: string | null;
6821
- lastRunConversationId: string | null;
6822
- lastRunStatus: string | null;
6823
- sourceType: string | null;
6824
- sourceId: string | null;
6825
- createdAt: number;
6826
- updatedAt: number;
6827
- }>;
6828
- }
6829
-
6830
- declare type _WorkItemsServerMessages = WorkItemsListResponse | WorkItemGetResponse | WorkItemUpdateResponse | WorkItemDeleteResponse | WorkItemRunTaskResponse | WorkItemOutputResponse | WorkItemPreflightResponse | WorkItemApprovePermissionsResponse | WorkItemCancelResponse | WorkItemStatusChanged | TaskRunConversationCreated | TasksChanged;
6831
-
6832
- /** Server push — broadcast when a work item status changes (e.g. running -> awaiting_review). */
6833
- declare interface WorkItemStatusChanged {
6834
- type: "work_item_status_changed";
6835
- item: {
6836
- id: string;
6837
- taskId: string;
6838
- title: string;
6839
- status: string;
6840
- lastRunId: string | null;
6841
- lastRunConversationId: string | null;
6842
- lastRunStatus: string | null;
6843
- updatedAt: number;
6844
- };
6845
- }
6846
-
6847
- declare interface WorkItemUpdateResponse {
6848
- type: "work_item_update_response";
6849
- item: {
6850
- id: string;
6851
- taskId: string;
6852
- title: string;
6853
- notes: string | null;
6854
- status: string;
6855
- priorityTier: number;
6856
- sortIndex: number | null;
6857
- lastRunId: string | null;
6858
- lastRunConversationId: string | null;
6859
- lastRunStatus: string | null;
6860
- sourceType: string | null;
6861
- sourceId: string | null;
6862
- createdAt: number;
6863
- updatedAt: number;
6864
- } | null;
6865
- }
6866
-
6867
6870
  declare interface WorkResultDiff {
6868
6871
  label?: string;
6869
6872
  before?: 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;
@@ -25,8 +26,10 @@ export const listInstalledSkills = api.listInstalledSkills;
25
26
  export const parseMessageMetadata = api.parseMessageMetadata;
26
27
  export const resolveMediaSourceData = api.resolveMediaSourceData;
27
28
  export const resolveUserName = api.resolveUserName;
29
+ export const runConversationTurn = api.runConversationTurn;
28
30
  export const searchMessageIdsLexical = api.searchMessageIdsLexical;
29
31
  export const selectedBackendSupportsMultimodal = api.selectedBackendSupportsMultimodal;
30
32
  export const stringifyMessageContent = api.stringifyMessageContent;
31
33
  export const syncMessageToDisk = api.syncMessageToDisk;
34
+ export const synthesizeText = api.synthesizeText;
32
35
  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.8",
3
+ "version": "0.10.9-dev.202607152124.584d617",
4
4
  "description": "Public TypeScript authoring contract for Vellum assistant plugins.",
5
5
  "license": "MIT",
6
6
  "type": "module",