@vellumai/plugin-api 0.10.11-dev.202607221445.f732ea2 → 0.10.11-dev.202607221520.024d846

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 +267 -142
  2. package/index.js +1 -0
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -687,6 +687,9 @@ declare const AssistantConfigSchema: z.ZodObject<{
687
687
  rateLimit: z.ZodDefault<z.ZodObject<{
688
688
  maxRequestsPerMinute: z.ZodDefault<z.ZodNumber>;
689
689
  }, z.core.$strip>>;
690
+ apiRateLimit: z.ZodDefault<z.ZodObject<{
691
+ authenticatedMaxRequestsPerMinute: z.ZodDefault<z.ZodNumber>;
692
+ }, z.core.$strip>>;
690
693
  secretDetection: z.ZodDefault<z.ZodObject<{
691
694
  enabled: z.ZodDefault<z.ZodBoolean>;
692
695
  blockIngress: z.ZodDefault<z.ZodBoolean>;
@@ -1521,26 +1524,34 @@ declare const AvatarUpdatedEventSchema: z.ZodObject<{
1521
1524
  avatarPath: z.ZodString;
1522
1525
  }, z.core.$strip>;
1523
1526
 
1524
- declare interface BackgroundToolCompleted {
1525
- type: "background_tool_completed";
1526
- id: string;
1527
- conversationId: string;
1528
- status: "completed" | "failed" | "cancelled";
1529
- exitCode?: number | null;
1530
- output?: string;
1531
- completedAt: number;
1532
- }
1527
+ declare type BackgroundToolCompletedEvent = z.infer<typeof BackgroundToolCompletedEventSchema>;
1533
1528
 
1534
- declare type _BackgroundToolsServerMessages = BackgroundToolStarted | BackgroundToolCompleted;
1529
+ declare const BackgroundToolCompletedEventSchema: z.ZodObject<{
1530
+ type: z.ZodLiteral<"background_tool_completed">;
1531
+ id: z.ZodString;
1532
+ conversationId: z.ZodString;
1533
+ status: z.ZodEnum<{
1534
+ cancelled: "cancelled";
1535
+ failed: "failed";
1536
+ completed: "completed";
1537
+ }>;
1538
+ exitCode: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1539
+ output: z.ZodOptional<z.ZodString>;
1540
+ completedAt: z.ZodNumber;
1541
+ }, z.core.$strip>;
1535
1542
 
1536
- declare interface BackgroundToolStarted {
1537
- type: "background_tool_started";
1538
- id: string;
1539
- toolName: string;
1540
- conversationId: string;
1541
- command: string;
1542
- startedAt: number;
1543
- }
1543
+ declare type _BackgroundToolsServerMessages = BackgroundToolStartedEvent | BackgroundToolCompletedEvent;
1544
+
1545
+ declare type BackgroundToolStartedEvent = z.infer<typeof BackgroundToolStartedEventSchema>;
1546
+
1547
+ declare const BackgroundToolStartedEventSchema: z.ZodObject<{
1548
+ type: z.ZodLiteral<"background_tool_started">;
1549
+ id: z.ZodString;
1550
+ toolName: z.ZodString;
1551
+ conversationId: z.ZodString;
1552
+ command: z.ZodString;
1553
+ startedAt: z.ZodNumber;
1554
+ }, z.core.$strip>;
1544
1555
 
1545
1556
  /**
1546
1557
  * Media payload for an image or file content block. One unified type covers
@@ -4437,6 +4448,17 @@ declare const OpenPanelEventSchema: z.ZodObject<{
4437
4448
  surfaceId: z.ZodOptional<z.ZodString>;
4438
4449
  }, z.core.$strip>;
4439
4450
 
4451
+ /**
4452
+ * Open a streaming transcription session against the configured STT provider
4453
+ * (`services.stt.provider`).
4454
+ *
4455
+ * Returns a live {@link StreamingTranscriber} the caller drives with
4456
+ * `start` / `sendAudio` / `stop`, or `null` when no streaming session can be
4457
+ * opened — the provider is unknown, has no streaming adapter, or is missing
4458
+ * credentials.
4459
+ */
4460
+ export declare function openTranscriptionSession(): Promise<StreamingTranscriber | null>;
4461
+
4440
4462
  declare type OpenUrlEvent = z.infer<typeof OpenUrlEventSchema>;
4441
4463
 
4442
4464
  declare const OpenUrlEventSchema: z.ZodObject<{
@@ -5914,6 +5936,61 @@ declare interface StopInputContext {
5914
5936
  readonly exitReason: AgentLoopExitReason;
5915
5937
  }
5916
5938
 
5939
+ /**
5940
+ * Daemon-hosted streaming transcriber contract.
5941
+ *
5942
+ * Implementations manage a persistent session that accepts audio chunks
5943
+ * and emits partial/final transcript events. The runtime session
5944
+ * orchestrator (PR 5) drives this interface from the gateway WebSocket
5945
+ * path.
5946
+ *
5947
+ * Lifecycle:
5948
+ * 1. Call {@link start} to open the provider session.
5949
+ * 2. Feed audio chunks via {@link sendAudio}.
5950
+ * 3. Optionally call {@link finalizeUtterance} between utterances to
5951
+ * flush buffered audio into finals while keeping the stream open.
5952
+ * 4. Call {@link stop} when the client finishes recording.
5953
+ * 5. The `onEvent` callback receives server events until `closed`.
5954
+ */
5955
+ export declare interface StreamingTranscriber {
5956
+ /** Which provider backs this transcriber. */
5957
+ readonly providerId: SttProviderId;
5958
+ /** Which runtime boundary this transcriber operates in. */
5959
+ readonly boundaryId: "daemon-streaming";
5960
+ /**
5961
+ * Open the streaming session with the provider.
5962
+ *
5963
+ * Must be called once before {@link sendAudio}. Rejects if the
5964
+ * provider session cannot be established.
5965
+ */
5966
+ start(onEvent: (event: SttStreamServerEvent) => void): Promise<void>;
5967
+ /**
5968
+ * Feed a chunk of audio into the streaming session.
5969
+ *
5970
+ * Callers must not call this before {@link start} resolves or after
5971
+ * {@link stop} has been called.
5972
+ */
5973
+ sendAudio(audio: Buffer, mimeType: string): void;
5974
+ /**
5975
+ * Flush all buffered audio into final transcript(s) without closing
5976
+ * the stream.
5977
+ *
5978
+ * Emits `final` event(s) for pending audio followed by one `finalized`
5979
+ * event; the stream stays open for more audio. Optional — callers must
5980
+ * feature-detect this method and fall back to {@link stop} (full
5981
+ * teardown) when the provider does not support it.
5982
+ */
5983
+ finalizeUtterance?(): void;
5984
+ /**
5985
+ * Signal that the client has finished sending audio.
5986
+ *
5987
+ * The provider may emit additional final events after stop is called.
5988
+ * The session is fully closed when the `onEvent` callback receives a
5989
+ * `closed` event.
5990
+ */
5991
+ stop(): void;
5992
+ }
5993
+
5917
5994
  /**
5918
5995
  * Coerce stored message content into a single human-readable text string,
5919
5996
  * dropping non-text blocks (images, tool calls, tool results, thinking,
@@ -5931,6 +6008,112 @@ declare interface StopInputContext {
5931
6008
  */
5932
6009
  export declare function stringifyMessageContent(stored: string | ContentBlock[]): string;
5933
6010
 
6011
+ /**
6012
+ * Normalized error categories that callers can branch on without coupling to
6013
+ * provider-specific error shapes or HTTP status codes.
6014
+ */
6015
+ export declare type SttErrorCategory =
6016
+ /** The provider rejected the request due to invalid or missing credentials. */
6017
+ "auth"
6018
+ /** The provider rate-limited the request. */
6019
+ | "rate-limit"
6020
+ /** The request or response timed out. */
6021
+ | "timeout"
6022
+ /** The audio payload was rejected (unsupported format, too large, etc.). */
6023
+ | "invalid-audio"
6024
+ /** Any other provider-side or network failure. */
6025
+ | "provider-error";
6026
+
6027
+ /**
6028
+ * Provider-agnostic speech-to-text domain types for daemon transcription.
6029
+ *
6030
+ * These types define the boundary between callers that need audio transcription
6031
+ * and the concrete STT provider implementations. The goal is to let daemon
6032
+ * callsites program against a single typed interface so that provider swaps are
6033
+ * localized to the adapter layer.
6034
+ *
6035
+ * Two execution modes are supported:
6036
+ * - **Batch** — a single audio buffer is sent and a final transcript returned.
6037
+ * - **Streaming** — audio chunks are sent over a persistent session, and the
6038
+ * provider emits partial/final transcript events in real time.
6039
+ */
6040
+ /**
6041
+ * Canonical provider identifiers for daemon-hosted STT backends.
6042
+ * Extend this union as new providers are integrated.
6043
+ */
6044
+ export declare type SttProviderId = "openai-whisper" | "deepgram" | "google-gemini" | "xai" | "vellum";
6045
+
6046
+ /** The streaming session has closed (no more events will be emitted). */
6047
+ export declare interface SttStreamServerClosedEvent {
6048
+ readonly type: "closed";
6049
+ }
6050
+
6051
+ /** An error occurred during streaming transcription. */
6052
+ export declare interface SttStreamServerErrorEvent {
6053
+ readonly type: "error";
6054
+ /** Normalized error category for caller branching. */
6055
+ readonly category: SttErrorCategory;
6056
+ /** Human-readable error description. */
6057
+ readonly message: string;
6058
+ }
6059
+
6060
+ /**
6061
+ * Events that the daemon streaming session emits to the client.
6062
+ *
6063
+ * The discriminated `type` field allows clients to handle partial
6064
+ * and final transcripts, errors, and session lifecycle signals in a
6065
+ * type-safe manner.
6066
+ */
6067
+ export declare type SttStreamServerEvent = SttStreamServerPartialEvent | SttStreamServerFinalEvent | SttStreamServerFinalizedEvent | SttStreamServerErrorEvent | SttStreamServerClosedEvent;
6068
+
6069
+ /**
6070
+ * A final (committed) transcript — this segment will not be revised.
6071
+ */
6072
+ export declare interface SttStreamServerFinalEvent {
6073
+ readonly type: "final";
6074
+ /** Committed transcript text for a completed speech segment. */
6075
+ readonly text: string;
6076
+ readonly speakerLabel?: string;
6077
+ /**
6078
+ * Provider-emitted confidence score in [0, 1]. Undefined when the
6079
+ * provider does not surface confidence on this chunk.
6080
+ */
6081
+ readonly confidence?: number;
6082
+ /**
6083
+ * True when this final is the flush response to
6084
+ * {@link StreamingTranscriber.finalizeUtterance} — i.e. it commits audio
6085
+ * that was buffered before the finalize request, not new speech.
6086
+ * Undefined on ordinary finals and on providers without finalize.
6087
+ */
6088
+ readonly fromFinalize?: boolean;
6089
+ }
6090
+
6091
+ /**
6092
+ * All provider-buffered audio has been flushed into `final` event(s) in
6093
+ * response to {@link StreamingTranscriber.finalizeUtterance}. Emitted
6094
+ * exactly once per finalize request, after the flushed `final` event(s).
6095
+ * The stream stays open and continues to accept audio.
6096
+ */
6097
+ export declare interface SttStreamServerFinalizedEvent {
6098
+ readonly type: "finalized";
6099
+ }
6100
+
6101
+ /**
6102
+ * A partial (interim) transcript — may be revised by subsequent
6103
+ * partial or final events.
6104
+ */
6105
+ export declare interface SttStreamServerPartialEvent {
6106
+ readonly type: "partial";
6107
+ /** Interim transcript text. May change with subsequent events. */
6108
+ readonly text: string;
6109
+ readonly speakerLabel?: string;
6110
+ /**
6111
+ * Provider-emitted confidence score in [0, 1]. Undefined when the
6112
+ * provider does not surface confidence on interim chunks.
6113
+ */
6114
+ readonly confidence?: number;
6115
+ }
6116
+
5934
6117
  declare interface SubagentDetailResponse {
5935
6118
  type: "subagent_detail_response";
5936
6119
  subagentId: string;
@@ -7180,136 +7363,78 @@ export declare interface WebSearchToolResultContent {
7180
7363
  content: unknown;
7181
7364
  }
7182
7365
 
7183
- /**
7184
- * Terminal push for a workflow run. Carries the final status, counts, token
7185
- * usage, and a human-readable result/error summary the originating
7186
- * conversation also receives via an agent wake.
7187
- */
7188
- declare interface WorkflowCompleted {
7189
- type: "workflow_completed";
7190
- runId: string;
7191
- /**
7192
- * Originating conversation id, when launched from one; lets `broadcastMessage`
7193
- * auto-scope + seq-stamp the event to that conversation's SSE stream. Omitted
7194
- * for a conversationless run (e.g. a scheduled workflow), which broadcasts
7195
- * unscoped for raw SSE listeners and the DB record.
7196
- */
7197
- conversationId?: string;
7198
- status: WorkflowRunStatus;
7199
- agentsSpawned: number;
7200
- inputTokens: number;
7201
- outputTokens: number;
7202
- /** Human-readable result-or-error summary. */
7203
- summary?: string;
7204
- }
7366
+ declare type WorkflowCompletedEvent = z.infer<typeof WorkflowCompletedEventSchema>;
7205
7367
 
7206
- /**
7207
- * A leaf agent within a workflow run has finished. `seq` matches the
7208
- * corresponding `workflow_leaf_started` event.
7209
- */
7210
- declare interface WorkflowLeafFinished {
7211
- type: "workflow_leaf_finished";
7212
- runId: string;
7213
- /**
7214
- * Originating conversation id; lets `broadcastMessage` auto-scope +
7215
- * seq-stamp the event to the conversation's SSE stream.
7216
- */
7217
- conversationId: string;
7218
- seq: number;
7219
- status: "completed" | "failed";
7220
- /** Leaf label, for client display. */
7221
- label?: string;
7222
- inputTokens?: number;
7223
- outputTokens?: number;
7224
- /** Short summary of the leaf's result, for client display. */
7225
- resultSummary?: string;
7226
- }
7368
+ declare const WorkflowCompletedEventSchema: z.ZodObject<{
7369
+ type: z.ZodLiteral<"workflow_completed">;
7370
+ runId: z.ZodString;
7371
+ conversationId: z.ZodOptional<z.ZodString>;
7372
+ status: z.ZodEnum<{
7373
+ failed: "failed";
7374
+ aborted: "aborted";
7375
+ completed: "completed";
7376
+ running: "running";
7377
+ interrupted: "interrupted";
7378
+ cap_exceeded: "cap_exceeded";
7379
+ }>;
7380
+ agentsSpawned: z.ZodNumber;
7381
+ inputTokens: z.ZodNumber;
7382
+ outputTokens: z.ZodNumber;
7383
+ summary: z.ZodOptional<z.ZodString>;
7384
+ }, z.core.$strict>;
7227
7385
 
7228
- /**
7229
- * A leaf agent within a workflow run has started. `seq` orders leaves within
7230
- * the run for stable client-side tree placement.
7231
- */
7232
- declare interface WorkflowLeafStarted {
7233
- type: "workflow_leaf_started";
7234
- runId: string;
7235
- /**
7236
- * Originating conversation id; lets `broadcastMessage` auto-scope +
7237
- * seq-stamp the event to the conversation's SSE stream.
7238
- */
7239
- conversationId: string;
7240
- seq: number;
7241
- /** Leaf label, for client display. */
7242
- label?: string;
7243
- /** Phase the leaf belongs to, when the workflow declares phases. */
7244
- phase?: string;
7245
- /** Short summary of the leaf's prompt, for client display. */
7246
- promptSummary?: string;
7247
- }
7386
+ declare type WorkflowLeafFinishedEvent = z.infer<typeof WorkflowLeafFinishedEventSchema>;
7248
7387
 
7249
- /**
7250
- * Progress push for an in-flight workflow run. Maps the engine's
7251
- * `onProgress` (`phase`/`log`) callback plus the current usage snapshot into a
7252
- * single wire event. `phase` carries the latest `phase(title)`; `message`
7253
- * carries the latest `log(msg)`; only one is set per emission.
7254
- */
7255
- declare interface WorkflowProgress {
7256
- type: "workflow_progress";
7257
- runId: string;
7258
- /**
7259
- * Originating conversation id, when launched from one; lets `broadcastMessage`
7260
- * auto-scope + seq-stamp the event to that conversation's SSE stream. Omitted
7261
- * for a conversationless run (e.g. a scheduled workflow), which broadcasts
7262
- * unscoped for raw SSE listeners and the DB record.
7263
- */
7264
- conversationId?: string;
7265
- /** Latest phase title, when this emission came from a `phase(...)` call. */
7266
- phase?: string;
7267
- /** Run label (the workflow's `meta.name`), for client display. */
7268
- label?: string;
7269
- /** Live agent count at emission time. */
7270
- agentsSpawned: number;
7271
- /** Latest log line, when this emission came from a `log(...)` call. */
7272
- message?: string;
7273
- }
7388
+ declare const WorkflowLeafFinishedEventSchema: z.ZodObject<{
7389
+ type: z.ZodLiteral<"workflow_leaf_finished">;
7390
+ runId: z.ZodString;
7391
+ conversationId: z.ZodString;
7392
+ seq: z.ZodNumber;
7393
+ status: z.ZodEnum<{
7394
+ failed: "failed";
7395
+ completed: "completed";
7396
+ }>;
7397
+ label: z.ZodOptional<z.ZodString>;
7398
+ inputTokens: z.ZodOptional<z.ZodNumber>;
7399
+ outputTokens: z.ZodOptional<z.ZodNumber>;
7400
+ resultSummary: z.ZodOptional<z.ZodString>;
7401
+ }, z.core.$strict>;
7274
7402
 
7275
- /**
7276
- * Typed persistence for the workflow orchestration engine.
7277
- *
7278
- * Two tables (created by migration 282):
7279
- *
7280
- * - `workflow_runs` — one row per orchestration run (a sandboxed script that
7281
- * spawns parallel leaf agents), tracking lifecycle status and token usage.
7282
- * - `workflow_journal` — append-only `(run_id, seq)` log of every leaf call
7283
- * (agent / host function / nested workflow). On resume after a daemon
7284
- * restart, the engine replays cached results for the unchanged call prefix
7285
- * instead of re-spawning agents.
7286
- *
7287
- * This module is pure persistence — no `workflows` feature-flag logic. Callers
7288
- * (the engine, a later PR) own gating.
7289
- */
7290
- declare type WorkflowRunStatus = "running" | "completed" | "failed" | "aborted" | "cap_exceeded" | "interrupted";
7403
+ declare type WorkflowLeafStartedEvent = z.infer<typeof WorkflowLeafStartedEventSchema>;
7291
7404
 
7292
- declare type _WorkflowsServerMessages = WorkflowProgress | WorkflowCompleted | WorkflowStarted | WorkflowLeafStarted | WorkflowLeafFinished;
7405
+ declare const WorkflowLeafStartedEventSchema: z.ZodObject<{
7406
+ type: z.ZodLiteral<"workflow_leaf_started">;
7407
+ runId: z.ZodString;
7408
+ conversationId: z.ZodString;
7409
+ seq: z.ZodNumber;
7410
+ label: z.ZodOptional<z.ZodString>;
7411
+ phase: z.ZodOptional<z.ZodString>;
7412
+ promptSummary: z.ZodOptional<z.ZodString>;
7413
+ }, z.core.$strict>;
7293
7414
 
7294
- /**
7295
- * A workflow run has started. Emitted once at launch, before any leaf events.
7296
- */
7297
- declare interface WorkflowStarted {
7298
- type: "workflow_started";
7299
- runId: string;
7300
- /**
7301
- * Originating conversation id; lets `broadcastMessage` auto-scope +
7302
- * seq-stamp the event to the conversation's SSE stream.
7303
- */
7304
- conversationId: string;
7305
- /**
7306
- * Tool-use id of the `skill_execute` block that launched this run, for
7307
- * anchoring the inline workflow card to the exact spawn tool call.
7308
- */
7309
- toolUseId?: string;
7310
- /** Run label (the workflow's `meta.name`), for client display. */
7311
- label?: string;
7312
- }
7415
+ declare type WorkflowProgressEvent = z.infer<typeof WorkflowProgressEventSchema>;
7416
+
7417
+ declare const WorkflowProgressEventSchema: z.ZodObject<{
7418
+ type: z.ZodLiteral<"workflow_progress">;
7419
+ runId: z.ZodString;
7420
+ conversationId: z.ZodOptional<z.ZodString>;
7421
+ agentsSpawned: z.ZodNumber;
7422
+ phase: z.ZodOptional<z.ZodString>;
7423
+ label: z.ZodOptional<z.ZodString>;
7424
+ message: z.ZodOptional<z.ZodString>;
7425
+ }, z.core.$strict>;
7426
+
7427
+ declare type _WorkflowsServerMessages = WorkflowProgressEvent | WorkflowCompletedEvent | WorkflowStartedEvent | WorkflowLeafStartedEvent | WorkflowLeafFinishedEvent;
7428
+
7429
+ declare type WorkflowStartedEvent = z.infer<typeof WorkflowStartedEventSchema>;
7430
+
7431
+ declare const WorkflowStartedEventSchema: z.ZodObject<{
7432
+ type: z.ZodLiteral<"workflow_started">;
7433
+ runId: z.ZodString;
7434
+ conversationId: z.ZodString;
7435
+ toolUseId: z.ZodOptional<z.ZodString>;
7436
+ label: z.ZodOptional<z.ZodString>;
7437
+ }, z.core.$strict>;
7313
7438
 
7314
7439
  declare interface WorkResultDiff {
7315
7440
  label?: string;
package/index.js CHANGED
@@ -31,6 +31,7 @@ export const lastToolResultUserMessageIndex = api.lastToolResultUserMessageIndex
31
31
  export const listCatalogSkills = api.listCatalogSkills;
32
32
  export const listConversations = api.listConversations;
33
33
  export const listInstalledSkills = api.listInstalledSkills;
34
+ export const openTranscriptionSession = api.openTranscriptionSession;
34
35
  export const parseMessageMetadata = api.parseMessageMetadata;
35
36
  export const quarantineRefusedExchanges = api.quarantineRefusedExchanges;
36
37
  export const resolveCredential = api.resolveCredential;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vellumai/plugin-api",
3
- "version": "0.10.11-dev.202607221445.f732ea2",
3
+ "version": "0.10.11-dev.202607221520.024d846",
4
4
  "description": "Public TypeScript authoring contract for Vellum assistant plugins.",
5
5
  "license": "MIT",
6
6
  "type": "module",