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

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 +337 -196
  2. package/index.js +1 -0
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -1,64 +1,80 @@
1
1
  import { z } from 'zod';
2
2
 
3
- declare type _AcpServerMessages = AcpSessionSpawned | AcpSessionUpdate | AcpSessionCompleted | AcpSessionError | AcpSessionUsage;
3
+ declare type _AcpServerMessages = AcpSessionSpawnedEvent | AcpSessionUpdateEvent | AcpSessionCompletedEvent | AcpSessionErrorEvent | AcpSessionUsageEvent;
4
4
 
5
- declare interface AcpSessionCompleted {
6
- type: "acp_session_completed";
7
- acpSessionId: string;
8
- stopReason: "end_turn" | "max_tokens" | "max_turn_requests" | "refusal" | "cancelled";
9
- }
5
+ declare type AcpSessionCompletedEvent = z.infer<typeof AcpSessionCompletedEventSchema>;
10
6
 
11
- declare interface AcpSessionError {
12
- type: "acp_session_error";
13
- acpSessionId: string;
14
- error: string;
15
- }
7
+ declare const AcpSessionCompletedEventSchema: z.ZodObject<{
8
+ type: z.ZodLiteral<"acp_session_completed">;
9
+ acpSessionId: z.ZodString;
10
+ stopReason: z.ZodEnum<{
11
+ cancelled: "cancelled";
12
+ end_turn: "end_turn";
13
+ max_tokens: "max_tokens";
14
+ max_turn_requests: "max_turn_requests";
15
+ refusal: "refusal";
16
+ }>;
17
+ }, z.core.$strict>;
16
18
 
17
- declare interface AcpSessionSpawned {
18
- type: "acp_session_spawned";
19
- acpSessionId: string;
20
- agent: string;
21
- parentConversationId: string;
22
- /** Tool-use id of the `acp_spawn` call that spawned this session. */
23
- parentToolUseId?: string;
24
- /** Objective text for the spawned session. */
25
- task?: string;
26
- }
19
+ declare type AcpSessionErrorEvent = z.infer<typeof AcpSessionErrorEventSchema>;
27
20
 
28
- declare interface AcpSessionUpdate {
29
- type: "acp_session_update";
30
- acpSessionId: string;
31
- updateType: "agent_message_chunk" | "agent_thought_chunk" | "user_message_chunk" | "tool_call" | "tool_call_update" | "plan";
32
- content?: string;
33
- toolCallId?: string;
34
- toolTitle?: string;
35
- toolKind?: string;
36
- toolStatus?: string;
37
- /** Optional raw input parameters sent to the tool (ACP `rawInput`); shape is tool-specific. */
38
- rawInput?: unknown;
39
- /** Optional raw output returned by the tool (ACP `rawOutput`); shape is tool-specific. */
40
- rawOutput?: unknown;
41
- /** Files touched by this tool call (for the file-diff affordance). */
42
- locations?: {
43
- path: string;
44
- line?: number;
45
- }[];
46
- /** Stable id for the message this chunk belongs to. */
47
- messageId?: string;
48
- /** Monotonic ordering hint within the session. */
49
- seq?: number;
50
- }
21
+ declare const AcpSessionErrorEventSchema: z.ZodObject<{
22
+ type: z.ZodLiteral<"acp_session_error">;
23
+ acpSessionId: z.ZodString;
24
+ error: z.ZodString;
25
+ }, z.core.$strict>;
51
26
 
52
- declare interface AcpSessionUsage {
53
- type: "acp_session_usage";
54
- acpSessionId: string;
55
- usedTokens: number;
56
- contextSize: number;
57
- costAmount?: number;
58
- costCurrency?: string;
59
- inputTokens?: number;
60
- outputTokens?: number;
61
- }
27
+ declare type AcpSessionSpawnedEvent = z.infer<typeof AcpSessionSpawnedEventSchema>;
28
+
29
+ declare const AcpSessionSpawnedEventSchema: z.ZodObject<{
30
+ type: z.ZodLiteral<"acp_session_spawned">;
31
+ acpSessionId: z.ZodString;
32
+ agent: z.ZodString;
33
+ parentConversationId: z.ZodString;
34
+ parentToolUseId: z.ZodOptional<z.ZodString>;
35
+ task: z.ZodOptional<z.ZodString>;
36
+ }, z.core.$strict>;
37
+
38
+ declare type AcpSessionUpdateEvent = z.infer<typeof AcpSessionUpdateEventSchema>;
39
+
40
+ declare const AcpSessionUpdateEventSchema: z.ZodObject<{
41
+ type: z.ZodLiteral<"acp_session_update">;
42
+ acpSessionId: z.ZodString;
43
+ updateType: z.ZodEnum<{
44
+ plan: "plan";
45
+ agent_message_chunk: "agent_message_chunk";
46
+ agent_thought_chunk: "agent_thought_chunk";
47
+ user_message_chunk: "user_message_chunk";
48
+ tool_call: "tool_call";
49
+ tool_call_update: "tool_call_update";
50
+ }>;
51
+ content: z.ZodOptional<z.ZodString>;
52
+ toolCallId: z.ZodOptional<z.ZodString>;
53
+ toolTitle: z.ZodOptional<z.ZodString>;
54
+ toolKind: z.ZodOptional<z.ZodString>;
55
+ toolStatus: z.ZodOptional<z.ZodString>;
56
+ rawInput: z.ZodOptional<z.ZodUnknown>;
57
+ rawOutput: z.ZodOptional<z.ZodUnknown>;
58
+ locations: z.ZodOptional<z.ZodArray<z.ZodObject<{
59
+ path: z.ZodString;
60
+ line: z.ZodOptional<z.ZodNumber>;
61
+ }, z.core.$strip>>>;
62
+ messageId: z.ZodOptional<z.ZodString>;
63
+ seq: z.ZodOptional<z.ZodNumber>;
64
+ }, z.core.$strict>;
65
+
66
+ declare type AcpSessionUsageEvent = z.infer<typeof AcpSessionUsageEventSchema>;
67
+
68
+ declare const AcpSessionUsageEventSchema: z.ZodObject<{
69
+ type: z.ZodLiteral<"acp_session_usage">;
70
+ acpSessionId: z.ZodString;
71
+ usedTokens: z.ZodNumber;
72
+ contextSize: z.ZodNumber;
73
+ inputTokens: z.ZodOptional<z.ZodNumber>;
74
+ outputTokens: z.ZodOptional<z.ZodNumber>;
75
+ costAmount: z.ZodOptional<z.ZodNumber>;
76
+ costCurrency: z.ZodOptional<z.ZodString>;
77
+ }, z.core.$strict>;
62
78
 
63
79
  /**
64
80
  * Append a message to a conversation. This is the low-level insert: it
@@ -687,6 +703,9 @@ declare const AssistantConfigSchema: z.ZodObject<{
687
703
  rateLimit: z.ZodDefault<z.ZodObject<{
688
704
  maxRequestsPerMinute: z.ZodDefault<z.ZodNumber>;
689
705
  }, z.core.$strip>>;
706
+ apiRateLimit: z.ZodDefault<z.ZodObject<{
707
+ authenticatedMaxRequestsPerMinute: z.ZodDefault<z.ZodNumber>;
708
+ }, z.core.$strip>>;
690
709
  secretDetection: z.ZodDefault<z.ZodObject<{
691
710
  enabled: z.ZodDefault<z.ZodBoolean>;
692
711
  blockIngress: z.ZodDefault<z.ZodBoolean>;
@@ -1521,26 +1540,34 @@ declare const AvatarUpdatedEventSchema: z.ZodObject<{
1521
1540
  avatarPath: z.ZodString;
1522
1541
  }, z.core.$strip>;
1523
1542
 
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
- }
1543
+ declare type BackgroundToolCompletedEvent = z.infer<typeof BackgroundToolCompletedEventSchema>;
1533
1544
 
1534
- declare type _BackgroundToolsServerMessages = BackgroundToolStarted | BackgroundToolCompleted;
1545
+ declare const BackgroundToolCompletedEventSchema: z.ZodObject<{
1546
+ type: z.ZodLiteral<"background_tool_completed">;
1547
+ id: z.ZodString;
1548
+ conversationId: z.ZodString;
1549
+ status: z.ZodEnum<{
1550
+ cancelled: "cancelled";
1551
+ failed: "failed";
1552
+ completed: "completed";
1553
+ }>;
1554
+ exitCode: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1555
+ output: z.ZodOptional<z.ZodString>;
1556
+ completedAt: z.ZodNumber;
1557
+ }, z.core.$strip>;
1535
1558
 
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
- }
1559
+ declare type _BackgroundToolsServerMessages = BackgroundToolStartedEvent | BackgroundToolCompletedEvent;
1560
+
1561
+ declare type BackgroundToolStartedEvent = z.infer<typeof BackgroundToolStartedEventSchema>;
1562
+
1563
+ declare const BackgroundToolStartedEventSchema: z.ZodObject<{
1564
+ type: z.ZodLiteral<"background_tool_started">;
1565
+ id: z.ZodString;
1566
+ toolName: z.ZodString;
1567
+ conversationId: z.ZodString;
1568
+ command: z.ZodString;
1569
+ startedAt: z.ZodNumber;
1570
+ }, z.core.$strip>;
1544
1571
 
1545
1572
  /**
1546
1573
  * Media payload for an image or file content block. One unified type covers
@@ -4437,6 +4464,17 @@ declare const OpenPanelEventSchema: z.ZodObject<{
4437
4464
  surfaceId: z.ZodOptional<z.ZodString>;
4438
4465
  }, z.core.$strip>;
4439
4466
 
4467
+ /**
4468
+ * Open a streaming transcription session against the configured STT provider
4469
+ * (`services.stt.provider`).
4470
+ *
4471
+ * Returns a live {@link StreamingTranscriber} the caller drives with
4472
+ * `start` / `sendAudio` / `stop`, or `null` when no streaming session can be
4473
+ * opened — the provider is unknown, has no streaming adapter, or is missing
4474
+ * credentials.
4475
+ */
4476
+ export declare function openTranscriptionSession(): Promise<StreamingTranscriber | null>;
4477
+
4440
4478
  declare type OpenUrlEvent = z.infer<typeof OpenUrlEventSchema>;
4441
4479
 
4442
4480
  declare const OpenUrlEventSchema: z.ZodObject<{
@@ -5914,6 +5952,61 @@ declare interface StopInputContext {
5914
5952
  readonly exitReason: AgentLoopExitReason;
5915
5953
  }
5916
5954
 
5955
+ /**
5956
+ * Daemon-hosted streaming transcriber contract.
5957
+ *
5958
+ * Implementations manage a persistent session that accepts audio chunks
5959
+ * and emits partial/final transcript events. The runtime session
5960
+ * orchestrator (PR 5) drives this interface from the gateway WebSocket
5961
+ * path.
5962
+ *
5963
+ * Lifecycle:
5964
+ * 1. Call {@link start} to open the provider session.
5965
+ * 2. Feed audio chunks via {@link sendAudio}.
5966
+ * 3. Optionally call {@link finalizeUtterance} between utterances to
5967
+ * flush buffered audio into finals while keeping the stream open.
5968
+ * 4. Call {@link stop} when the client finishes recording.
5969
+ * 5. The `onEvent` callback receives server events until `closed`.
5970
+ */
5971
+ export declare interface StreamingTranscriber {
5972
+ /** Which provider backs this transcriber. */
5973
+ readonly providerId: SttProviderId;
5974
+ /** Which runtime boundary this transcriber operates in. */
5975
+ readonly boundaryId: "daemon-streaming";
5976
+ /**
5977
+ * Open the streaming session with the provider.
5978
+ *
5979
+ * Must be called once before {@link sendAudio}. Rejects if the
5980
+ * provider session cannot be established.
5981
+ */
5982
+ start(onEvent: (event: SttStreamServerEvent) => void): Promise<void>;
5983
+ /**
5984
+ * Feed a chunk of audio into the streaming session.
5985
+ *
5986
+ * Callers must not call this before {@link start} resolves or after
5987
+ * {@link stop} has been called.
5988
+ */
5989
+ sendAudio(audio: Buffer, mimeType: string): void;
5990
+ /**
5991
+ * Flush all buffered audio into final transcript(s) without closing
5992
+ * the stream.
5993
+ *
5994
+ * Emits `final` event(s) for pending audio followed by one `finalized`
5995
+ * event; the stream stays open for more audio. Optional — callers must
5996
+ * feature-detect this method and fall back to {@link stop} (full
5997
+ * teardown) when the provider does not support it.
5998
+ */
5999
+ finalizeUtterance?(): void;
6000
+ /**
6001
+ * Signal that the client has finished sending audio.
6002
+ *
6003
+ * The provider may emit additional final events after stop is called.
6004
+ * The session is fully closed when the `onEvent` callback receives a
6005
+ * `closed` event.
6006
+ */
6007
+ stop(): void;
6008
+ }
6009
+
5917
6010
  /**
5918
6011
  * Coerce stored message content into a single human-readable text string,
5919
6012
  * dropping non-text blocks (images, tool calls, tool results, thinking,
@@ -5931,6 +6024,112 @@ declare interface StopInputContext {
5931
6024
  */
5932
6025
  export declare function stringifyMessageContent(stored: string | ContentBlock[]): string;
5933
6026
 
6027
+ /**
6028
+ * Normalized error categories that callers can branch on without coupling to
6029
+ * provider-specific error shapes or HTTP status codes.
6030
+ */
6031
+ export declare type SttErrorCategory =
6032
+ /** The provider rejected the request due to invalid or missing credentials. */
6033
+ "auth"
6034
+ /** The provider rate-limited the request. */
6035
+ | "rate-limit"
6036
+ /** The request or response timed out. */
6037
+ | "timeout"
6038
+ /** The audio payload was rejected (unsupported format, too large, etc.). */
6039
+ | "invalid-audio"
6040
+ /** Any other provider-side or network failure. */
6041
+ | "provider-error";
6042
+
6043
+ /**
6044
+ * Provider-agnostic speech-to-text domain types for daemon transcription.
6045
+ *
6046
+ * These types define the boundary between callers that need audio transcription
6047
+ * and the concrete STT provider implementations. The goal is to let daemon
6048
+ * callsites program against a single typed interface so that provider swaps are
6049
+ * localized to the adapter layer.
6050
+ *
6051
+ * Two execution modes are supported:
6052
+ * - **Batch** — a single audio buffer is sent and a final transcript returned.
6053
+ * - **Streaming** — audio chunks are sent over a persistent session, and the
6054
+ * provider emits partial/final transcript events in real time.
6055
+ */
6056
+ /**
6057
+ * Canonical provider identifiers for daemon-hosted STT backends.
6058
+ * Extend this union as new providers are integrated.
6059
+ */
6060
+ export declare type SttProviderId = "openai-whisper" | "deepgram" | "google-gemini" | "xai" | "vellum";
6061
+
6062
+ /** The streaming session has closed (no more events will be emitted). */
6063
+ export declare interface SttStreamServerClosedEvent {
6064
+ readonly type: "closed";
6065
+ }
6066
+
6067
+ /** An error occurred during streaming transcription. */
6068
+ export declare interface SttStreamServerErrorEvent {
6069
+ readonly type: "error";
6070
+ /** Normalized error category for caller branching. */
6071
+ readonly category: SttErrorCategory;
6072
+ /** Human-readable error description. */
6073
+ readonly message: string;
6074
+ }
6075
+
6076
+ /**
6077
+ * Events that the daemon streaming session emits to the client.
6078
+ *
6079
+ * The discriminated `type` field allows clients to handle partial
6080
+ * and final transcripts, errors, and session lifecycle signals in a
6081
+ * type-safe manner.
6082
+ */
6083
+ export declare type SttStreamServerEvent = SttStreamServerPartialEvent | SttStreamServerFinalEvent | SttStreamServerFinalizedEvent | SttStreamServerErrorEvent | SttStreamServerClosedEvent;
6084
+
6085
+ /**
6086
+ * A final (committed) transcript — this segment will not be revised.
6087
+ */
6088
+ export declare interface SttStreamServerFinalEvent {
6089
+ readonly type: "final";
6090
+ /** Committed transcript text for a completed speech segment. */
6091
+ readonly text: string;
6092
+ readonly speakerLabel?: string;
6093
+ /**
6094
+ * Provider-emitted confidence score in [0, 1]. Undefined when the
6095
+ * provider does not surface confidence on this chunk.
6096
+ */
6097
+ readonly confidence?: number;
6098
+ /**
6099
+ * True when this final is the flush response to
6100
+ * {@link StreamingTranscriber.finalizeUtterance} — i.e. it commits audio
6101
+ * that was buffered before the finalize request, not new speech.
6102
+ * Undefined on ordinary finals and on providers without finalize.
6103
+ */
6104
+ readonly fromFinalize?: boolean;
6105
+ }
6106
+
6107
+ /**
6108
+ * All provider-buffered audio has been flushed into `final` event(s) in
6109
+ * response to {@link StreamingTranscriber.finalizeUtterance}. Emitted
6110
+ * exactly once per finalize request, after the flushed `final` event(s).
6111
+ * The stream stays open and continues to accept audio.
6112
+ */
6113
+ export declare interface SttStreamServerFinalizedEvent {
6114
+ readonly type: "finalized";
6115
+ }
6116
+
6117
+ /**
6118
+ * A partial (interim) transcript — may be revised by subsequent
6119
+ * partial or final events.
6120
+ */
6121
+ export declare interface SttStreamServerPartialEvent {
6122
+ readonly type: "partial";
6123
+ /** Interim transcript text. May change with subsequent events. */
6124
+ readonly text: string;
6125
+ readonly speakerLabel?: string;
6126
+ /**
6127
+ * Provider-emitted confidence score in [0, 1]. Undefined when the
6128
+ * provider does not surface confidence on interim chunks.
6129
+ */
6130
+ readonly confidence?: number;
6131
+ }
6132
+
5934
6133
  declare interface SubagentDetailResponse {
5935
6134
  type: "subagent_detail_response";
5936
6135
  subagentId: string;
@@ -7180,136 +7379,78 @@ export declare interface WebSearchToolResultContent {
7180
7379
  content: unknown;
7181
7380
  }
7182
7381
 
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
- }
7382
+ declare type WorkflowCompletedEvent = z.infer<typeof WorkflowCompletedEventSchema>;
7205
7383
 
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
- }
7384
+ declare const WorkflowCompletedEventSchema: z.ZodObject<{
7385
+ type: z.ZodLiteral<"workflow_completed">;
7386
+ runId: z.ZodString;
7387
+ conversationId: z.ZodOptional<z.ZodString>;
7388
+ status: z.ZodEnum<{
7389
+ failed: "failed";
7390
+ aborted: "aborted";
7391
+ completed: "completed";
7392
+ running: "running";
7393
+ interrupted: "interrupted";
7394
+ cap_exceeded: "cap_exceeded";
7395
+ }>;
7396
+ agentsSpawned: z.ZodNumber;
7397
+ inputTokens: z.ZodNumber;
7398
+ outputTokens: z.ZodNumber;
7399
+ summary: z.ZodOptional<z.ZodString>;
7400
+ }, z.core.$strict>;
7227
7401
 
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
- }
7402
+ declare type WorkflowLeafFinishedEvent = z.infer<typeof WorkflowLeafFinishedEventSchema>;
7248
7403
 
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
- }
7404
+ declare const WorkflowLeafFinishedEventSchema: z.ZodObject<{
7405
+ type: z.ZodLiteral<"workflow_leaf_finished">;
7406
+ runId: z.ZodString;
7407
+ conversationId: z.ZodString;
7408
+ seq: z.ZodNumber;
7409
+ status: z.ZodEnum<{
7410
+ failed: "failed";
7411
+ completed: "completed";
7412
+ }>;
7413
+ label: z.ZodOptional<z.ZodString>;
7414
+ inputTokens: z.ZodOptional<z.ZodNumber>;
7415
+ outputTokens: z.ZodOptional<z.ZodNumber>;
7416
+ resultSummary: z.ZodOptional<z.ZodString>;
7417
+ }, z.core.$strict>;
7274
7418
 
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";
7419
+ declare type WorkflowLeafStartedEvent = z.infer<typeof WorkflowLeafStartedEventSchema>;
7291
7420
 
7292
- declare type _WorkflowsServerMessages = WorkflowProgress | WorkflowCompleted | WorkflowStarted | WorkflowLeafStarted | WorkflowLeafFinished;
7421
+ declare const WorkflowLeafStartedEventSchema: z.ZodObject<{
7422
+ type: z.ZodLiteral<"workflow_leaf_started">;
7423
+ runId: z.ZodString;
7424
+ conversationId: z.ZodString;
7425
+ seq: z.ZodNumber;
7426
+ label: z.ZodOptional<z.ZodString>;
7427
+ phase: z.ZodOptional<z.ZodString>;
7428
+ promptSummary: z.ZodOptional<z.ZodString>;
7429
+ }, z.core.$strict>;
7293
7430
 
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
- }
7431
+ declare type WorkflowProgressEvent = z.infer<typeof WorkflowProgressEventSchema>;
7432
+
7433
+ declare const WorkflowProgressEventSchema: z.ZodObject<{
7434
+ type: z.ZodLiteral<"workflow_progress">;
7435
+ runId: z.ZodString;
7436
+ conversationId: z.ZodOptional<z.ZodString>;
7437
+ agentsSpawned: z.ZodNumber;
7438
+ phase: z.ZodOptional<z.ZodString>;
7439
+ label: z.ZodOptional<z.ZodString>;
7440
+ message: z.ZodOptional<z.ZodString>;
7441
+ }, z.core.$strict>;
7442
+
7443
+ declare type _WorkflowsServerMessages = WorkflowProgressEvent | WorkflowCompletedEvent | WorkflowStartedEvent | WorkflowLeafStartedEvent | WorkflowLeafFinishedEvent;
7444
+
7445
+ declare type WorkflowStartedEvent = z.infer<typeof WorkflowStartedEventSchema>;
7446
+
7447
+ declare const WorkflowStartedEventSchema: z.ZodObject<{
7448
+ type: z.ZodLiteral<"workflow_started">;
7449
+ runId: z.ZodString;
7450
+ conversationId: z.ZodString;
7451
+ toolUseId: z.ZodOptional<z.ZodString>;
7452
+ label: z.ZodOptional<z.ZodString>;
7453
+ }, z.core.$strict>;
7313
7454
 
7314
7455
  declare interface WorkResultDiff {
7315
7456
  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.202607221536.1496611",
4
4
  "description": "Public TypeScript authoring contract for Vellum assistant plugins.",
5
5
  "license": "MIT",
6
6
  "type": "module",