@vellumai/plugin-api 0.11.11-staging.3 → 0.12.0-dev.202609110124.4b134bf

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 +102 -15
  2. package/index.js +1 -0
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -1077,15 +1077,7 @@ declare const AssistantConfigSchema: z.ZodObject<{
1077
1077
  enabled: z.ZodDefault<z.ZodBoolean>;
1078
1078
  text: z.ZodDefault<z.ZodString>;
1079
1079
  }, z.core.$strip>>;
1080
- safety: z.ZodDefault<z.ZodObject<{
1081
- denyCategories: z.ZodDefault<z.ZodArray<z.ZodString>>;
1082
- }, z.core.$strip>>;
1083
1080
  voice: z.ZodDefault<z.ZodObject<{
1084
- interruptSensitivity: z.ZodDefault<z.ZodEnum<{
1085
- low: "low";
1086
- medium: "medium";
1087
- high: "high";
1088
- }>>;
1089
1081
  telephonyStreaming: z.ZodDefault<z.ZodBoolean>;
1090
1082
  utteranceEndMs: z.ZodDefault<z.ZodNumber>;
1091
1083
  }, z.core.$strip>>;
@@ -1100,10 +1092,6 @@ declare const AssistantConfigSchema: z.ZodObject<{
1100
1092
  }, z.core.$strip>>;
1101
1093
  }, z.core.$strip>>;
1102
1094
  liveVoice: z.ZodDefault<z.ZodObject<{
1103
- mode: z.ZodDefault<z.ZodEnum<{
1104
- ptt: "ptt";
1105
- "open-mic": "open-mic";
1106
- }>>;
1107
1095
  vad: z.ZodDefault<z.ZodObject<{
1108
1096
  speechEnergyThreshold: z.ZodDefault<z.ZodNumber>;
1109
1097
  noiseFloorMargin: z.ZodDefault<z.ZodNumber>;
@@ -1137,7 +1125,6 @@ declare const AssistantConfigSchema: z.ZodObject<{
1137
1125
  eagerEotThreshold: z.ZodOptional<z.ZodNumber>;
1138
1126
  eotTimeoutMs: z.ZodDefault<z.ZodNumber>;
1139
1127
  }, z.core.$strip>>;
1140
- maxSessionDurationSeconds: z.ZodDefault<z.ZodNumber>;
1141
1128
  archiveAudio: z.ZodDefault<z.ZodBoolean>;
1142
1129
  }, z.core.$strip>>;
1143
1130
  sight: z.ZodDefault<z.ZodObject<{
@@ -1375,6 +1362,7 @@ declare const AssistantEventEnvelopeSchema: z.ZodObject<{
1375
1362
  reason: z.ZodEnum<{
1376
1363
  thinking_delta: "thinking_delta";
1377
1364
  message_dequeued: "message_dequeued";
1365
+ message_interrupted: "message_interrupted";
1378
1366
  first_text_delta: "first_text_delta";
1379
1367
  tool_use_start: "tool_use_start";
1380
1368
  preview_start: "preview_start";
@@ -2049,6 +2037,10 @@ declare const AssistantEventEnvelopeSchema: z.ZodObject<{
2049
2037
  filePath: z.ZodOptional<z.ZodString>;
2050
2038
  }, z.core.$strip>>>;
2051
2039
  attachmentWarnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
2040
+ assistantTextVisibility: z.ZodOptional<z.ZodEnum<{
2041
+ private: "private";
2042
+ visible: "visible";
2043
+ }>>;
2052
2044
  }, z.core.$strip>, z.ZodObject<{
2053
2045
  type: z.ZodLiteral<"message_dequeued">;
2054
2046
  conversationId: z.ZodString;
@@ -2898,6 +2890,7 @@ declare const AssistantEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2898
2890
  reason: z.ZodEnum<{
2899
2891
  thinking_delta: "thinking_delta";
2900
2892
  message_dequeued: "message_dequeued";
2893
+ message_interrupted: "message_interrupted";
2901
2894
  first_text_delta: "first_text_delta";
2902
2895
  tool_use_start: "tool_use_start";
2903
2896
  preview_start: "preview_start";
@@ -3572,6 +3565,10 @@ declare const AssistantEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3572
3565
  filePath: z.ZodOptional<z.ZodString>;
3573
3566
  }, z.core.$strip>>>;
3574
3567
  attachmentWarnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
3568
+ assistantTextVisibility: z.ZodOptional<z.ZodEnum<{
3569
+ private: "private";
3570
+ visible: "visible";
3571
+ }>>;
3575
3572
  }, z.core.$strip>, z.ZodObject<{
3576
3573
  type: z.ZodLiteral<"message_dequeued">;
3577
3574
  conversationId: z.ZodString;
@@ -4238,6 +4235,18 @@ declare interface BaseSubscriberEntry {
4238
4235
  */
4239
4236
  export declare function buildMessageExcerpt(rawContent: string, query: string): Promise<string>;
4240
4237
 
4238
+ /**
4239
+ * The turn-cancellation guard every side-effecting tool calls, host tools and
4240
+ * plugin tools alike. It lives on the plugin API surface because that is the
4241
+ * only module a plugin may import from, and the guard must be one
4242
+ * implementation rather than a copy per side of the boundary.
4243
+ */
4244
+ /** The slice of a tool's context this guard reads. */
4245
+ export declare interface CancellableToolContext {
4246
+ /** Cooperative cancellation signal for the turn, when the caller supplies one. */
4247
+ signal?: AbortSignal;
4248
+ }
4249
+
4241
4250
  /**
4242
4251
  * Conversation-type axis within an adapter (the "channel-type" cascade
4243
4252
  * level): direct message, private channel/group, public channel. Adapters
@@ -4827,6 +4836,7 @@ export declare type HookBroadcast = (detail: Record<string, unknown>) => void;
4827
4836
  * - `post-model-call` — {@link PostModelCallContext}
4828
4837
  * - `conversation-deleted` — {@link ConversationDeletedContext}
4829
4838
  * - `conversations-cleared` — {@link ConversationsClearedContext}
4839
+ * - `message-deleted`: {@link MessageDeletedContext}
4830
4840
  */
4831
4841
  export declare type HookFunction<TCtx = unknown> = (ctx: TCtx) => Promise<Partial<TCtx> | void>;
4832
4842
 
@@ -4868,6 +4878,8 @@ export declare const HOOKS: {
4868
4878
  readonly CONVERSATION_DELETED: "conversation-deleted";
4869
4879
  /** Fires once when every conversation is wiped at once (the clear-all reset), after the main tables are cleared. Carries no `conversationId`; cleanup hooks wipe their own per-conversation state wholesale. */
4870
4880
  readonly CONVERSATIONS_CLEARED: "conversations-cleared";
4881
+ /** Fires once per deleted message row, after the row is removed, carrying the row's `(createdAt, id)` so a hook can settle state that pointed at it. Fire-and-forget cleanup signal, like `conversation-deleted`; whole-conversation deletes dispatch that hook instead. */
4882
+ readonly MESSAGE_DELETED: "message-deleted";
4871
4883
  };
4872
4884
 
4873
4885
  /**
@@ -5271,8 +5283,6 @@ declare interface LiveVoiceMetricsServerFrame extends LiveVoiceServerFrameBase {
5271
5283
  * condition as the two fields above.
5272
5284
  */
5273
5285
  readonly endpointDecisionSource?: "front-door" | "provider";
5274
- /** Which floor-holding ack actually spoke during the turn, if any. */
5275
- readonly ackSpoken?: "first_delta" | "tool_use";
5276
5286
  /**
5277
5287
  * Spoken progress narrations during the turn. Present only when at least
5278
5288
  * one progress update spoke (otherwise the field is absent, keeping frames
@@ -5513,6 +5523,37 @@ export declare interface Message {
5513
5523
  content: ContentBlock[];
5514
5524
  }
5515
5525
 
5526
+ /**
5527
+ * The full `message-deleted` context a hook receives: the dispatching call
5528
+ * site's {@link MessageDeletedInputContext} plus the pipeline-stamped
5529
+ * {@link BaseHookContext} capabilities.
5530
+ */
5531
+ export declare interface MessageDeletedContext extends MessageDeletedInputContext, BaseHookContext {
5532
+ }
5533
+
5534
+ /**
5535
+ * Context passed to the `message-deleted` hook. Fires once per deleted
5536
+ * message row, from the shared single-message delete primitive, after the row
5537
+ * is removed. Whole-conversation deletes dispatch `conversation-deleted`
5538
+ * instead.
5539
+ *
5540
+ * Fire-and-forget like `conversation-deleted`: the primitive is synchronous
5541
+ * and does not wait for the chain. The row is gone by the time a hook runs,
5542
+ * so the context carries the row's `createdAt` alongside its id. Together
5543
+ * they are the `(createdAt, id)` position the row held, which is what a hook
5544
+ * keeping a cursor on that row needs to record once the row can no longer be
5545
+ * looked up. The default memory plugin contributes a hook here that stamps
5546
+ * its retrospective cursor.
5547
+ */
5548
+ declare interface MessageDeletedInputContext {
5549
+ /** ID of the conversation that owned the row. */
5550
+ readonly conversationId: string;
5551
+ /** ID of the deleted message row. */
5552
+ readonly messageId: string;
5553
+ /** The deleted row's `createdAt`. */
5554
+ readonly createdAt: number;
5555
+ }
5556
+
5516
5557
  declare type MessageLexicalSearchResult = Awaited<ReturnType<searchMessageIdsLexical_2>>[number];
5517
5558
 
5518
5559
  declare interface MessageLexicalSearchResult_2 {
@@ -5611,6 +5652,7 @@ declare const messageMetadataSchema: z.ZodObject<{
5611
5652
  hidden: z.ZodOptional<z.ZodBoolean>;
5612
5653
  voiceSessionTurn: z.ZodOptional<z.ZodBoolean>;
5613
5654
  messageKind: z.ZodOptional<z.ZodString>;
5655
+ assistantTextVisibility: z.ZodOptional<z.ZodString>;
5614
5656
  providerErrorCode: z.ZodOptional<z.ZodString>;
5615
5657
  providerErrorCategory: z.ZodOptional<z.ZodString>;
5616
5658
  backgroundToolCompletion: z.ZodOptional<z.ZodObject<{
@@ -5631,6 +5673,7 @@ declare const messageMetadataSchema: z.ZodObject<{
5631
5673
  forkSourceMessageId: z.ZodOptional<z.ZodString>;
5632
5674
  imageSourcePaths: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
5633
5675
  attachmentStoredPaths: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
5676
+ interruptedPriorTurn: z.ZodOptional<z.ZodBoolean>;
5634
5677
  memoryInjectedBlock: z.ZodOptional<z.ZodString>;
5635
5678
  memoryV3InjectedBlock: z.ZodOptional<z.ZodString>;
5636
5679
  memoryV3InjectedBlockFormat: z.ZodOptional<z.ZodNumber>;
@@ -5947,6 +5990,28 @@ declare interface PostModelCallInputContext {
5947
5990
  messages: Message[];
5948
5991
  /** Provider-reported stop reason for the turn; `null` when not reported. */
5949
5992
  readonly stopReason: string | null;
5993
+ /**
5994
+ * True when this run's plain assistant text does not reach the user: the
5995
+ * turn routes its reply through the `send_user_message` tool instead, and
5996
+ * {@link content}'s text blocks are private working notes. A hook that
5997
+ * decides whether the user was answered must read this rather than assume
5998
+ * visible text was delivered. Absent or false on every ordinary run, so a
5999
+ * hook reads it as `=== true`.
6000
+ */
6001
+ readonly assistantTextSuppressed?: boolean;
6002
+ /**
6003
+ * Whether the user has already been told the OUTCOME of this run's work,
6004
+ * decided by the host so a hook cannot reach a different answer than the
6005
+ * loop does.
6006
+ *
6007
+ * True when the last response that called any tool reported on the work
6008
+ * before it: every one of its tool calls delivered a message to the user. A
6009
+ * response that sends a message alongside other tool calls is a progress
6010
+ * update, and a call the executor rejects (blank or non-string message)
6011
+ * delivers nothing, so neither counts. Absent on a host that does not
6012
+ * compute it, so a hook reads it as `=== true`.
6013
+ */
6014
+ readonly userToldOutcome?: boolean;
5950
6015
  /**
5951
6016
  * The provider rejection that ended the call, on a rejection outcome. Absent
5952
6017
  * on a finalized reply. A hook that recovers from a specific rejection class
@@ -7410,6 +7475,22 @@ export declare interface ThinkingContent {
7410
7475
  signature: string;
7411
7476
  }
7412
7477
 
7478
+ /**
7479
+ * Stop a side-effecting tool whose turn was cancelled before it acted.
7480
+ *
7481
+ * Call this immediately before the step that changes something the user would
7482
+ * notice: a write, a create/update/delete, a message send, a process spawn, a
7483
+ * paid provider call. The agent loop tells the model an aborted batch was
7484
+ * cancelled, so anything that lands after the abort is work the model believes
7485
+ * never happened.
7486
+ *
7487
+ * Throws the signal's own reason, which is the daemon's tagged abort reason
7488
+ * for a conversation abort and a `DOMException` named `AbortError` for a plain
7489
+ * one. The tool executor recognizes both and reports the call as an expected
7490
+ * cancellation rather than a tool failure.
7491
+ */
7492
+ export declare function throwIfCancelled(context: CancellableToolContext): void;
7493
+
7413
7494
  /** Discriminated container so future tools can add their own metadata. */
7414
7495
  declare interface ToolActivityMetadata {
7415
7496
  webSearch?: WebSearchMetadata;
@@ -7502,6 +7583,12 @@ export declare interface ToolContext {
7502
7583
  * @legacy
7503
7584
  */
7504
7585
  diskPressureCleanupModeActive?: boolean;
7586
+ /**
7587
+ * Whether this turn routes its user-facing text through `send_user_message`.
7588
+ * Read by the cleanup-mode gate, which keeps that tool callable on a gated
7589
+ * turn: the wire offers it, so the executor must not refuse it.
7590
+ */
7591
+ sendUserMessageActive?: boolean;
7505
7592
  /**
7506
7593
  * Prompt the user for a secret value via native SecureField UI.
7507
7594
  * @legacy
package/index.js CHANGED
@@ -61,4 +61,5 @@ export const stringifyMessageContent = api.stringifyMessageContent;
61
61
  export const sweepOrphanedGraphNodePoints = api.sweepOrphanedGraphNodePoints;
62
62
  export const syncMessageToDisk = api.syncMessageToDisk;
63
63
  export const synthesizeText = api.synthesizeText;
64
+ export const throwIfCancelled = api.throwIfCancelled;
64
65
  export const updateMessageMetadata = api.updateMessageMetadata;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vellumai/plugin-api",
3
- "version": "0.11.11-staging.3",
3
+ "version": "0.12.0-dev.202609110124.4b134bf",
4
4
  "description": "Public TypeScript authoring contract for Vellum assistant plugins.",
5
5
  "license": "MIT",
6
6
  "type": "module",