@vellumai/plugin-api 0.11.7 → 0.11.8-dev.202609020238.afcca64

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 +146 -7
  2. package/index.js +2 -0
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -31,6 +31,17 @@ declare interface AddMessageOptions {
31
31
  * internally. Pass the same value as `requestId` for user turns so
32
32
  * the persisted row ID matches the runtime correlation ID. */
33
33
  id?: string;
34
+ /**
35
+ * Answered synchronously at the top of every insert attempt, immediately
36
+ * before that attempt's statement. False aborts with a
37
+ * {@link MessageInsertPreconditionError} and writes nothing.
38
+ *
39
+ * For a caller whose right to write can lapse while the insert is in
40
+ * flight. Per attempt rather than per call because contention retries the
41
+ * insert after an awaited backoff, and the world can move under a caller
42
+ * during that sleep.
43
+ */
44
+ insertPrecondition?: () => boolean;
34
45
  }
35
46
 
36
47
  declare type AddMessageResult = Awaited<ReturnType<addMessage_2>>;
@@ -1065,6 +1076,7 @@ declare const AssistantConfigSchema: z.ZodObject<{
1065
1076
  }>>;
1066
1077
  vad: z.ZodDefault<z.ZodObject<{
1067
1078
  speechEnergyThreshold: z.ZodDefault<z.ZodNumber>;
1079
+ noiseFloorMargin: z.ZodDefault<z.ZodNumber>;
1068
1080
  silenceThresholdMs: z.ZodDefault<z.ZodNumber>;
1069
1081
  maxTurnDurationMs: z.ZodDefault<z.ZodNumber>;
1070
1082
  bargeInMinSpeechMs: z.ZodDefault<z.ZodNumber>;
@@ -1098,6 +1110,9 @@ declare const AssistantConfigSchema: z.ZodObject<{
1098
1110
  maxSessionDurationSeconds: z.ZodDefault<z.ZodNumber>;
1099
1111
  archiveAudio: z.ZodDefault<z.ZodBoolean>;
1100
1112
  }, z.core.$strip>>;
1113
+ sight: z.ZodDefault<z.ZodObject<{
1114
+ keepLatestFrames: z.ZodDefault<z.ZodNumber>;
1115
+ }, z.core.$strip>>;
1101
1116
  whatsapp: z.ZodDefault<z.ZodObject<{
1102
1117
  phoneNumber: z.ZodDefault<z.ZodString>;
1103
1118
  deliverAuthBypass: z.ZodDefault<z.ZodBoolean>;
@@ -1479,6 +1494,34 @@ declare const AssistantEventEnvelopeSchema: z.ZodObject<{
1479
1494
  causedByRequestId: z.ZodOptional<z.ZodString>;
1480
1495
  decisionText: z.ZodOptional<z.ZodString>;
1481
1496
  toolUseId: z.ZodOptional<z.ZodString>;
1497
+ }, z.core.$strip>, z.ZodObject<{
1498
+ type: z.ZodLiteral<"contact_form_closed">;
1499
+ requestId: z.ZodString;
1500
+ reason: z.ZodEnum<{
1501
+ cancelled: "cancelled";
1502
+ timed_out: "timed_out";
1503
+ answered: "answered";
1504
+ }>;
1505
+ }, z.core.$strip>, z.ZodObject<{
1506
+ type: z.ZodLiteral<"contact_record_request">;
1507
+ requestId: z.ZodString;
1508
+ operation: z.ZodEnum<{
1509
+ delete: "delete";
1510
+ create: "create";
1511
+ update: "update";
1512
+ }>;
1513
+ contactId: z.ZodOptional<z.ZodString>;
1514
+ currentDisplayName: z.ZodOptional<z.ZodString>;
1515
+ currentNotes: z.ZodOptional<z.ZodString>;
1516
+ channels: z.ZodOptional<z.ZodArray<z.ZodObject<{
1517
+ type: z.ZodString;
1518
+ address: z.ZodString;
1519
+ }, z.core.$strip>>>;
1520
+ displayName: z.ZodOptional<z.ZodString>;
1521
+ notes: z.ZodOptional<z.ZodString>;
1522
+ notesProposed: z.ZodOptional<z.ZodBoolean>;
1523
+ label: z.ZodOptional<z.ZodString>;
1524
+ description: z.ZodOptional<z.ZodString>;
1482
1525
  }, z.core.$strip>, z.ZodObject<{
1483
1526
  type: z.ZodLiteral<"contact_request">;
1484
1527
  requestId: z.ZodString;
@@ -1488,6 +1531,7 @@ declare const AssistantEventEnvelopeSchema: z.ZodObject<{
1488
1531
  label: z.ZodOptional<z.ZodString>;
1489
1532
  description: z.ZodOptional<z.ZodString>;
1490
1533
  role: z.ZodOptional<z.ZodString>;
1534
+ verify: z.ZodOptional<z.ZodBoolean>;
1491
1535
  }, z.core.$strip>, z.ZodObject<{
1492
1536
  type: z.ZodLiteral<"contacts_changed">;
1493
1537
  }, z.core.$strip>, z.ZodObject<{
@@ -1907,8 +1951,8 @@ declare const AssistantEventEnvelopeSchema: z.ZodObject<{
1907
1951
  approved: "approved";
1908
1952
  cancelled: "cancelled";
1909
1953
  superseded: "superseded";
1910
- rejected: "rejected";
1911
1954
  answered: "answered";
1955
+ rejected: "rejected";
1912
1956
  }>;
1913
1957
  kind: z.ZodString;
1914
1958
  }, z.core.$strip>, z.ZodObject<{
@@ -2970,6 +3014,34 @@ declare const AssistantEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2970
3014
  causedByRequestId: z.ZodOptional<z.ZodString>;
2971
3015
  decisionText: z.ZodOptional<z.ZodString>;
2972
3016
  toolUseId: z.ZodOptional<z.ZodString>;
3017
+ }, z.core.$strip>, z.ZodObject<{
3018
+ type: z.ZodLiteral<"contact_form_closed">;
3019
+ requestId: z.ZodString;
3020
+ reason: z.ZodEnum<{
3021
+ cancelled: "cancelled";
3022
+ timed_out: "timed_out";
3023
+ answered: "answered";
3024
+ }>;
3025
+ }, z.core.$strip>, z.ZodObject<{
3026
+ type: z.ZodLiteral<"contact_record_request">;
3027
+ requestId: z.ZodString;
3028
+ operation: z.ZodEnum<{
3029
+ delete: "delete";
3030
+ create: "create";
3031
+ update: "update";
3032
+ }>;
3033
+ contactId: z.ZodOptional<z.ZodString>;
3034
+ currentDisplayName: z.ZodOptional<z.ZodString>;
3035
+ currentNotes: z.ZodOptional<z.ZodString>;
3036
+ channels: z.ZodOptional<z.ZodArray<z.ZodObject<{
3037
+ type: z.ZodString;
3038
+ address: z.ZodString;
3039
+ }, z.core.$strip>>>;
3040
+ displayName: z.ZodOptional<z.ZodString>;
3041
+ notes: z.ZodOptional<z.ZodString>;
3042
+ notesProposed: z.ZodOptional<z.ZodBoolean>;
3043
+ label: z.ZodOptional<z.ZodString>;
3044
+ description: z.ZodOptional<z.ZodString>;
2973
3045
  }, z.core.$strip>, z.ZodObject<{
2974
3046
  type: z.ZodLiteral<"contact_request">;
2975
3047
  requestId: z.ZodString;
@@ -2979,6 +3051,7 @@ declare const AssistantEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2979
3051
  label: z.ZodOptional<z.ZodString>;
2980
3052
  description: z.ZodOptional<z.ZodString>;
2981
3053
  role: z.ZodOptional<z.ZodString>;
3054
+ verify: z.ZodOptional<z.ZodBoolean>;
2982
3055
  }, z.core.$strip>, z.ZodObject<{
2983
3056
  type: z.ZodLiteral<"contacts_changed">;
2984
3057
  }, z.core.$strip>, z.ZodObject<{
@@ -3398,8 +3471,8 @@ declare const AssistantEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3398
3471
  approved: "approved";
3399
3472
  cancelled: "cancelled";
3400
3473
  superseded: "superseded";
3401
- rejected: "rejected";
3402
3474
  answered: "answered";
3475
+ rejected: "rejected";
3403
3476
  }>;
3404
3477
  kind: z.ZodString;
3405
3478
  }, z.core.$strip>, z.ZodObject<{
@@ -4030,6 +4103,26 @@ export declare interface AssistantEventSubscription {
4030
4103
  readonly connectionId: string;
4031
4104
  }
4032
4105
 
4106
+ /**
4107
+ * The `_attachmentId` property as a spreadable fragment, or nothing when there
4108
+ * is no usable id.
4109
+ *
4110
+ * Every producer of a media block faces the same choice: it either knows the
4111
+ * attachment row the block came from, or it does not, and the field has to be
4112
+ * absent rather than present-and-empty in the second case. This helper is the
4113
+ * one place that decision lives, so every producer answers it the same way.
4114
+ * Callers pass whatever id they hold: the source block's own
4115
+ * ({@link ImageContent._attachmentId}) when carrying it across a rebuild, or an
4116
+ * upload's row id when stamping a fresh block.
4117
+ *
4118
+ * Empty counts as absent, matching the read side, which requires a non-empty
4119
+ * string before it will treat the field as an id (see
4120
+ * `daemon/handlers/shared.ts`).
4121
+ */
4122
+ export declare function attachmentIdFragment(attachmentId: string | undefined): {
4123
+ _attachmentId?: string;
4124
+ };
4125
+
4033
4126
  export declare interface AudioEmbeddingInput {
4034
4127
  type: "audio";
4035
4128
  data: Buffer;
@@ -4744,6 +4837,19 @@ declare type HostProxyCapability = (typeof HOST_PROXY_CAPABILITIES)[number];
4744
4837
  export declare interface ImageContent {
4745
4838
  type: "image";
4746
4839
  source: MediaSource_2;
4840
+ /**
4841
+ * Internal id linking a base64 image block to a row in the attachments table,
4842
+ * the same correlation {@link FileContent._attachmentId} carries. A live turn
4843
+ * sends its uploads inline while persisting them as references, so this is
4844
+ * the only handle on the in-memory copy of an image whose stored form is a
4845
+ * `workspace_ref`; camera-frame retention matches on it. Redundant once the
4846
+ * block is a reference (use `source.attachmentId`).
4847
+ *
4848
+ * Never reaches a provider: every client builds its image payload out of
4849
+ * `source` alone (see the `case "image"` arms of the Anthropic, Gemini, and
4850
+ * both OpenAI clients), so top-level fields are dropped by construction.
4851
+ */
4852
+ _attachmentId?: string;
4747
4853
  }
4748
4854
 
4749
4855
  export declare interface ImageEmbeddingInput {
@@ -5032,11 +5138,12 @@ declare interface LiveVoiceErrorServerFrame extends LiveVoiceServerFrameBase {
5032
5138
  * daemons predating the field.
5033
5139
  *
5034
5140
  * It exists so an `unknown_type` is attributable. A client that sends more
5035
- * than one optional frame (today: `update_config` and `attach_image`) gets
5036
- * the same code for either, and without this has to assume which one was
5037
- * refused. The wrong assumption is silent in both directions: settings stop
5038
- * applying for a session, or a photo the user watched themselves take is
5039
- * dropped with nothing said.
5141
+ * than one optional frame (today: `update_config`, `attach_image`,
5142
+ * `attach_frame`, `sight_frame`, and `text`) gets the same code for any of
5143
+ * them, and without this has to assume which one was refused. The wrong
5144
+ * assumption is silent in both directions: settings stop applying for a
5145
+ * session, or a photo the user watched themselves take is dropped with
5146
+ * nothing said.
5040
5147
  */
5041
5148
  readonly frameType?: string;
5042
5149
  /**
@@ -5045,6 +5152,23 @@ declare interface LiveVoiceErrorServerFrame extends LiveVoiceServerFrameBase {
5045
5152
  * from older daemons) means the error is terminal for the session.
5046
5153
  */
5047
5154
  readonly recoverable?: boolean;
5155
+ /**
5156
+ * The attachment the refused frame named, present on `sight_frame`
5157
+ * rejections so the client can retire the exact keep that failed.
5158
+ *
5159
+ * `frameType` alone only narrows a rejection to the keep stream, and that
5160
+ * stream is the one place several sends are routinely outstanding at once:
5161
+ * the camera keeps shooting while a persist waits out a running turn, so a
5162
+ * client holding three unacknowledged keeps cannot tell which of them this
5163
+ * error is about. Naming the id is what turns "a frame failed" into "this
5164
+ * preview comes down".
5165
+ *
5166
+ * Optional, and no other error path populates it: a parse failure has no
5167
+ * id to name, and the other frames carrying an attachment have at most one
5168
+ * in flight, which `frameType` already identifies. Clients must tolerate
5169
+ * an absent id and must not gate any behavior on its presence.
5170
+ */
5171
+ readonly attachmentId?: string;
5048
5172
  }
5049
5173
 
5050
5174
  /**
@@ -5314,6 +5438,21 @@ declare const LLMCallSiteEnum: z.ZodEnum<{
5314
5438
  workflowLeaf: "workflowLeaf";
5315
5439
  }>;
5316
5440
 
5441
+ /**
5442
+ * The attachment row a media block came from, whichever of the two shapes it
5443
+ * is in, or undefined for a block that came from none (tool-generated and
5444
+ * assistant-authored media).
5445
+ *
5446
+ * A reference names its row on `source.attachmentId`; an inline block has
5447
+ * nowhere to put it but the top-level `_attachmentId`. Both are the same fact,
5448
+ * so anything asking "which attachment is this?" has to read both or it goes
5449
+ * blind on half the histories. Reading only `_attachmentId` in particular is
5450
+ * the sharp edge: it is absent on every reference block, so a rebuild that
5451
+ * flattens a reference to inline bytes drops the link unless it derives the id
5452
+ * through here first.
5453
+ */
5454
+ export declare function mediaBlockAttachmentId(block: ImageContent | FileContent): string | undefined;
5455
+
5317
5456
  declare type MediaSource_2 = Base64MediaSource | WorkspaceRefMediaSource;
5318
5457
 
5319
5458
  export declare interface Message {
package/index.js CHANGED
@@ -11,6 +11,7 @@ export const TtsSynthesisError = api.TtsSynthesisError;
11
11
  export const VOICE_ESCALATION_CONTINUATION_MESSAGE_KIND = api.VOICE_ESCALATION_CONTINUATION_MESSAGE_KIND;
12
12
  export const addMessage = api.addMessage;
13
13
  export const assistantEventHub = api.assistantEventHub;
14
+ export const attachmentIdFragment = api.attachmentIdFragment;
14
15
  export const buildMessageExcerpt = api.buildMessageExcerpt;
15
16
  export const createLiveVoiceConnection = api.createLiveVoiceConnection;
16
17
  export const deleteConversation = api.deleteConversation;
@@ -38,6 +39,7 @@ export const lastToolResultUserMessageIndex = api.lastToolResultUserMessageIndex
38
39
  export const listCatalogSkills = api.listCatalogSkills;
39
40
  export const listConversations = api.listConversations;
40
41
  export const listInstalledSkills = api.listInstalledSkills;
42
+ export const mediaBlockAttachmentId = api.mediaBlockAttachmentId;
41
43
  export const openTranscriptionSession = api.openTranscriptionSession;
42
44
  export const parseMessageMetadata = api.parseMessageMetadata;
43
45
  export const persistSystemCard = api.persistSystemCard;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vellumai/plugin-api",
3
- "version": "0.11.7",
3
+ "version": "0.11.8-dev.202609020238.afcca64",
4
4
  "description": "Public TypeScript authoring contract for Vellum assistant plugins.",
5
5
  "license": "MIT",
6
6
  "type": "module",