@vellumai/plugin-api 0.12.2 → 0.12.3-staging.1

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 +84 -0
  2. package/index.js +4 -0
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -101,6 +101,7 @@ declare const AnsweredQuestionSchema: z.ZodObject<{
101
101
  description: z.ZodOptional<z.ZodString>;
102
102
  }, z.core.$strip>>;
103
103
  freeTextPlaceholder: z.ZodOptional<z.ZodString>;
104
+ presentation: z.ZodOptional<z.ZodLiteral<"virtual_desktop">>;
104
105
  }, z.core.$strip>>;
105
106
  responses: z.ZodArray<z.ZodObject<{
106
107
  questionId: z.ZodString;
@@ -601,6 +602,9 @@ declare const AssistantConfigSchema: z.ZodObject<{
601
602
  bm25NormK: z.ZodDefault<z.ZodUnion<readonly [z.ZodNumber, z.ZodNull]>>;
602
603
  bypassForCore: z.ZodDefault<z.ZodBoolean>;
603
604
  }, z.core.$strip>>;
605
+ poolLog: z.ZodDefault<z.ZodObject<{
606
+ captureInput: z.ZodDefault<z.ZodBoolean>;
607
+ }, z.core.$strip>>;
604
608
  }, z.core.$strip>>;
605
609
  retrospective: z.ZodDefault<z.ZodObject<{
606
610
  enabled: z.ZodDefault<z.ZodBoolean>;
@@ -1661,6 +1665,8 @@ declare const AssistantEventEnvelopeSchema: z.ZodObject<{
1661
1665
  type: z.ZodLiteral<"conversation_title_updated">;
1662
1666
  conversationId: z.ZodString;
1663
1667
  title: z.ZodString;
1668
+ }, z.core.$strip>, z.ZodObject<{
1669
+ type: z.ZodLiteral<"desktop_activity_changed">;
1664
1670
  }, z.core.$strip>, z.ZodObject<{
1665
1671
  type: z.ZodLiteral<"disk_pressure_status_changed">;
1666
1672
  status: z.ZodObject<{
@@ -1760,6 +1766,7 @@ declare const AssistantEventEnvelopeSchema: z.ZodObject<{
1760
1766
  sandbox_file: "sandbox_file";
1761
1767
  tool_block: "tool_block";
1762
1768
  }>>;
1769
+ computerUseScreenshot: z.ZodOptional<z.ZodBoolean>;
1763
1770
  sizeBytes: z.ZodOptional<z.ZodNumber>;
1764
1771
  thumbnailData: z.ZodOptional<z.ZodString>;
1765
1772
  fileBacked: z.ZodOptional<z.ZodBoolean>;
@@ -2040,6 +2047,7 @@ declare const AssistantEventEnvelopeSchema: z.ZodObject<{
2040
2047
  sandbox_file: "sandbox_file";
2041
2048
  tool_block: "tool_block";
2042
2049
  }>>;
2050
+ computerUseScreenshot: z.ZodOptional<z.ZodBoolean>;
2043
2051
  sizeBytes: z.ZodOptional<z.ZodNumber>;
2044
2052
  thumbnailData: z.ZodOptional<z.ZodString>;
2045
2053
  fileBacked: z.ZodOptional<z.ZodBoolean>;
@@ -2169,6 +2177,7 @@ declare const AssistantEventEnvelopeSchema: z.ZodObject<{
2169
2177
  description: z.ZodOptional<z.ZodString>;
2170
2178
  }, z.core.$strip>>;
2171
2179
  freeTextPlaceholder: z.ZodOptional<z.ZodString>;
2180
+ presentation: z.ZodOptional<z.ZodLiteral<"virtual_desktop">>;
2172
2181
  }, z.core.$strip>>;
2173
2182
  question: z.ZodString;
2174
2183
  description: z.ZodOptional<z.ZodString>;
@@ -2433,6 +2442,7 @@ declare const AssistantEventEnvelopeSchema: z.ZodObject<{
2433
2442
  description: z.ZodOptional<z.ZodString>;
2434
2443
  }, z.core.$strip>>;
2435
2444
  freeTextPlaceholder: z.ZodOptional<z.ZodString>;
2445
+ presentation: z.ZodOptional<z.ZodLiteral<"virtual_desktop">>;
2436
2446
  }, z.core.$strip>>;
2437
2447
  responses: z.ZodArray<z.ZodObject<{
2438
2448
  questionId: z.ZodString;
@@ -3204,6 +3214,8 @@ declare const AssistantEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3204
3214
  type: z.ZodLiteral<"conversation_title_updated">;
3205
3215
  conversationId: z.ZodString;
3206
3216
  title: z.ZodString;
3217
+ }, z.core.$strip>, z.ZodObject<{
3218
+ type: z.ZodLiteral<"desktop_activity_changed">;
3207
3219
  }, z.core.$strip>, z.ZodObject<{
3208
3220
  type: z.ZodLiteral<"disk_pressure_status_changed">;
3209
3221
  status: z.ZodObject<{
@@ -3303,6 +3315,7 @@ declare const AssistantEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3303
3315
  sandbox_file: "sandbox_file";
3304
3316
  tool_block: "tool_block";
3305
3317
  }>>;
3318
+ computerUseScreenshot: z.ZodOptional<z.ZodBoolean>;
3306
3319
  sizeBytes: z.ZodOptional<z.ZodNumber>;
3307
3320
  thumbnailData: z.ZodOptional<z.ZodString>;
3308
3321
  fileBacked: z.ZodOptional<z.ZodBoolean>;
@@ -3583,6 +3596,7 @@ declare const AssistantEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3583
3596
  sandbox_file: "sandbox_file";
3584
3597
  tool_block: "tool_block";
3585
3598
  }>>;
3599
+ computerUseScreenshot: z.ZodOptional<z.ZodBoolean>;
3586
3600
  sizeBytes: z.ZodOptional<z.ZodNumber>;
3587
3601
  thumbnailData: z.ZodOptional<z.ZodString>;
3588
3602
  fileBacked: z.ZodOptional<z.ZodBoolean>;
@@ -3712,6 +3726,7 @@ declare const AssistantEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3712
3726
  description: z.ZodOptional<z.ZodString>;
3713
3727
  }, z.core.$strip>>;
3714
3728
  freeTextPlaceholder: z.ZodOptional<z.ZodString>;
3729
+ presentation: z.ZodOptional<z.ZodLiteral<"virtual_desktop">>;
3715
3730
  }, z.core.$strip>>;
3716
3731
  question: z.ZodString;
3717
3732
  description: z.ZodOptional<z.ZodString>;
@@ -3976,6 +3991,7 @@ declare const AssistantEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3976
3991
  description: z.ZodOptional<z.ZodString>;
3977
3992
  }, z.core.$strip>>;
3978
3993
  freeTextPlaceholder: z.ZodOptional<z.ZodString>;
3994
+ presentation: z.ZodOptional<z.ZodLiteral<"virtual_desktop">>;
3979
3995
  }, z.core.$strip>>;
3980
3996
  responses: z.ZodArray<z.ZodObject<{
3981
3997
  questionId: z.ZodString;
@@ -4560,6 +4576,34 @@ export declare interface ConversationRow {
4560
4576
  */
4561
4577
  export declare type ConversationsClearedContext = BaseHookContext;
4562
4578
 
4579
+ /**
4580
+ * Per-conversation record of what the most recent live turn sent to the
4581
+ * provider that a fork wake cannot re-derive (`conversation_tool_surfaces`).
4582
+ *
4583
+ * The provider prompt cache is a byte-exact prefix match over
4584
+ * `tools -> system -> messages`, so a background wake that forks a
4585
+ * conversation can only reuse the source's cached prefix by sending the SAME
4586
+ * tools array under the SAME system prompt. Re-deriving either on the fork
4587
+ * cannot guarantee that: the fork may run in another process (a different
4588
+ * tool registry), with no connected clients (different host-tool gates),
4589
+ * under a presence the persisted message stamps do not encode, or under a
4590
+ * wake scope that cannot spawn subagents where the source could (the system
4591
+ * prompt's delegation section). Recording the resolved values and replaying
4592
+ * them verbatim can.
4593
+ */
4594
+ /** What a live turn sent that a replaying fork reproduces verbatim. */
4595
+ export declare interface ConversationToolSurface {
4596
+ /** The tool definitions the turn sent, exactly as resolved. */
4597
+ tools: ToolDefinition_2[];
4598
+ /**
4599
+ * Whether the turn's system prompt rendered the parallel-delegation
4600
+ * section (`01-parallel-tasks`), which the prompt derives from the same
4601
+ * resolved tool surface plus the turn's channel. `null` when unknown: the
4602
+ * turn ran on a system-prompt override, or the row predates the column.
4603
+ */
4604
+ delegateIndependentTasks: boolean | null;
4605
+ }
4606
+
4563
4607
  /** Read-side alias of {@link ConversationCreateType}. */
4564
4608
  declare type ConversationType = ConversationCreateType;
4565
4609
 
@@ -4767,6 +4811,15 @@ export declare function getConversationDirPath(id: string, createdAtMs: number):
4767
4811
  */
4768
4812
  export declare function getConversationProcessingStartedAt(id: string): Promise<number | null>;
4769
4813
 
4814
+ /**
4815
+ * The tool definitions the conversation's most recent live turn sent to the
4816
+ * provider, or `null` when none has been recorded. A projection of
4817
+ * {@link getRecordedConversationToolSurface}: a fork replaying the source's
4818
+ * request needs the whole record, whose delegation-section state the system
4819
+ * prompt tier of the provider cache prefix depends on.
4820
+ */
4821
+ export declare function getConversationToolSurface(conversationId: string): Promise<ToolDefinition_2[] | null>;
4822
+
4770
4823
  /** Fetch one document from the calling plugin's index, or null. */
4771
4824
  export declare function getDocument(documentId: string): Promise<IndexedDocument | null>;
4772
4825
 
@@ -4788,6 +4841,14 @@ export declare function getMessages(conversationId: string): Promise<MessageRow[
4788
4841
  */
4789
4842
  export declare function getModelProfiles(): ModelProfileInfo[];
4790
4843
 
4844
+ /**
4845
+ * What the conversation's most recent live turn sent to the provider that a
4846
+ * replaying fork reproduces verbatim (its tool definitions and the
4847
+ * delegation-section state of its system prompt), or `null` when none has
4848
+ * been recorded.
4849
+ */
4850
+ export declare function getRecordedConversationToolSurface(conversationId: string): Promise<ConversationToolSurface | null>;
4851
+
4791
4852
  /**
4792
4853
  * Returns the workspace root for user-facing state.
4793
4854
  *
@@ -5705,6 +5766,7 @@ declare const messageMetadataSchema: z.ZodObject<{
5705
5766
  automated: z.ZodOptional<z.ZodBoolean>;
5706
5767
  hidden: z.ZodOptional<z.ZodBoolean>;
5707
5768
  voiceSessionTurn: z.ZodOptional<z.ZodBoolean>;
5769
+ computerUseScreenshotAttachmentIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
5708
5770
  messageKind: z.ZodOptional<z.ZodString>;
5709
5771
  assistantTextVisibility: z.ZodOptional<z.ZodString>;
5710
5772
  providerErrorCode: z.ZodOptional<z.ZodString>;
@@ -5896,6 +5958,11 @@ export declare interface PluginLogger {
5896
5958
  debug(obj: Record<string, unknown>, msg?: string): void;
5897
5959
  }
5898
5960
 
5961
+ export declare class PluginTurnNotAdmittedError extends Error {
5962
+ readonly reason: string;
5963
+ constructor(reason: string);
5964
+ }
5965
+
5899
5966
  /**
5900
5967
  * The full `post-compact` context a hook receives — the dispatching call
5901
5968
  * site's {@link PostCompactInputContext} plus the pipeline-stamped
@@ -6780,6 +6847,23 @@ export declare interface RunConversationTurnResult {
6780
6847
  queued?: boolean;
6781
6848
  }
6782
6849
 
6850
+ /**
6851
+ * Slice a string like `String.prototype.slice`, but never cut a UTF-16
6852
+ * surrogate pair in half.
6853
+ *
6854
+ * If the character at `end - 1` is a high surrogate *and* there is more of
6855
+ * the string beyond `end` (so cutting would actually orphan it), `end` is
6856
+ * decremented by one.
6857
+ *
6858
+ * If the character at `start` is a low surrogate *and* `start > 0` (so we
6859
+ * would be starting mid-pair), `start` is incremented by one.
6860
+ *
6861
+ * When `end === str.length` we do not touch a trailing high surrogate: if it
6862
+ * was already orphaned upstream, repairing it here would silently mutate
6863
+ * content. That is the sanitizer's job, not this function's.
6864
+ */
6865
+ export declare function safeStringSlice(str: string, start?: number, end?: number): string;
6866
+
6783
6867
  /** Sparse lexical search over stored message text; ranked message-id hits. */
6784
6868
  export declare function searchMessageIdsLexical(query: string, limit: number, opts?: {
6785
6869
  conversationId?: string;
package/index.js CHANGED
@@ -5,6 +5,7 @@ export const CredentialResolutionError = api.CredentialResolutionError;
5
5
  export const CredentialStoreError = api.CredentialStoreError;
6
6
  export const HOOKS = api.HOOKS;
7
7
  export const INTERNAL_NUDGE_OUTPUT_SUPPRESSION = api.INTERNAL_NUDGE_OUTPUT_SUPPRESSION;
8
+ export const PluginTurnNotAdmittedError = api.PluginTurnNotAdmittedError;
8
9
  export const REFUSAL_FALLBACK_TEXT = api.REFUSAL_FALLBACK_TEXT;
9
10
  export const RiskLevel = api.RiskLevel;
10
11
  export const TtsSynthesisError = api.TtsSynthesisError;
@@ -25,9 +26,11 @@ export const getConfiguredProvider = api.getConfiguredProvider;
25
26
  export const getConversation = api.getConversation;
26
27
  export const getConversationDirPath = api.getConversationDirPath;
27
28
  export const getConversationProcessingStartedAt = api.getConversationProcessingStartedAt;
29
+ export const getConversationToolSurface = api.getConversationToolSurface;
28
30
  export const getDocument = api.getDocument;
29
31
  export const getMessages = api.getMessages;
30
32
  export const getModelProfiles = api.getModelProfiles;
33
+ export const getRecordedConversationToolSurface = api.getRecordedConversationToolSurface;
31
34
  export const getWorkspaceDir = api.getWorkspaceDir;
32
35
  export const hasLexicalTokens = api.hasLexicalTokens;
33
36
  export const indexDocument = api.indexDocument;
@@ -54,6 +57,7 @@ export const resolveOauthCallbackUrl = api.resolveOauthCallbackUrl;
54
57
  export const resolveUserName = api.resolveUserName;
55
58
  export const resolveWebhookUrl = api.resolveWebhookUrl;
56
59
  export const runConversationTurn = api.runConversationTurn;
60
+ export const safeStringSlice = api.safeStringSlice;
57
61
  export const searchMessageIdsLexical = api.searchMessageIdsLexical;
58
62
  export const selectedBackendSupportsMultimodal = api.selectedBackendSupportsMultimodal;
59
63
  export const storeCredential = api.storeCredential;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vellumai/plugin-api",
3
- "version": "0.12.2",
3
+ "version": "0.12.3-staging.1",
4
4
  "description": "Public TypeScript authoring contract for Vellum assistant plugins.",
5
5
  "license": "MIT",
6
6
  "type": "module",