@vellumai/plugin-api 0.10.2 → 0.10.3-dev.202606252046.9075fd5

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 (2) hide show
  1. package/index.d.ts +273 -113
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -575,6 +575,27 @@ declare const CardSurfaceDataSchema: z.ZodObject<{
575
575
  templateData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
576
576
  }, z.core.$strip>;
577
577
 
578
+ /**
579
+ * Canonical channel-id vocabulary shared between the assistant daemon and the
580
+ * gateway.
581
+ *
582
+ * A "channel" is an external messaging surface an actor can reach the
583
+ * assistant through (Slack, Telegram, WhatsApp, phone, …) plus a couple of
584
+ * internal ids (`vellum` for native app conversations, `platform` for the
585
+ * internal control plane). This is the single source of truth for that set:
586
+ * the assistant adopts it wholesale as its `ChannelId`, and the gateway
587
+ * asserts its own (narrower) inbound list is a subset of it so the two sides
588
+ * cannot silently drift.
589
+ *
590
+ * Both packages depend on `@vellumai/service-contracts`, so hoisting the set
591
+ * here (rather than maintaining a copy on each side) means adding or renaming
592
+ * a channel happens in exactly one place.
593
+ *
594
+ * Note that a consumer may legitimately handle only a *subset* of these — the
595
+ * gateway, for example, never ingresses `platform`. Use a local list guarded
596
+ * by `satisfies readonly ChannelId[]` for those cases rather than redefining
597
+ * the union.
598
+ */
578
599
  declare const CHANNEL_IDS: readonly ["telegram", "phone", "vellum", "whatsapp", "slack", "email", "platform", "a2a"];
579
600
 
580
601
  /** Channel binding metadata exposed in conversation list APIs. */
@@ -1035,6 +1056,40 @@ declare interface ConversationListResponse {
1035
1056
  hasMore?: boolean;
1036
1057
  }
1037
1058
 
1059
+ declare type ConversationNoticeEvent = z.infer<typeof ConversationNoticeEventSchema>;
1060
+
1061
+ declare const ConversationNoticeEventSchema: z.ZodObject<{
1062
+ type: z.ZodLiteral<"conversation_notice">;
1063
+ conversationId: z.ZodString;
1064
+ source: z.ZodEnum<{
1065
+ memory_v3: "memory_v3";
1066
+ }>;
1067
+ code: z.ZodEnum<{
1068
+ PROVIDER_NETWORK: "PROVIDER_NETWORK";
1069
+ PROVIDER_RATE_LIMIT: "PROVIDER_RATE_LIMIT";
1070
+ MANAGED_USAGE_LIMIT: "MANAGED_USAGE_LIMIT";
1071
+ PROVIDER_OVERLOADED: "PROVIDER_OVERLOADED";
1072
+ PROVIDER_API: "PROVIDER_API";
1073
+ IMAGE_TOO_LARGE: "IMAGE_TOO_LARGE";
1074
+ PROVIDER_BILLING: "PROVIDER_BILLING";
1075
+ PROVIDER_ORDERING: "PROVIDER_ORDERING";
1076
+ PROVIDER_WEB_SEARCH: "PROVIDER_WEB_SEARCH";
1077
+ PROVIDER_NOT_CONFIGURED: "PROVIDER_NOT_CONFIGURED";
1078
+ PROVIDER_INVALID_KEY: "PROVIDER_INVALID_KEY";
1079
+ MANAGED_KEY_INVALID: "MANAGED_KEY_INVALID";
1080
+ CONTEXT_TOO_LARGE: "CONTEXT_TOO_LARGE";
1081
+ BUDGET_YIELD_UNRECOVERED: "BUDGET_YIELD_UNRECOVERED";
1082
+ MAX_TOKENS_REACHED: "MAX_TOKENS_REACHED";
1083
+ CONVERSATION_ABORTED: "CONVERSATION_ABORTED";
1084
+ CONVERSATION_PROCESSING_FAILED: "CONVERSATION_PROCESSING_FAILED";
1085
+ DISK_SPACE_CRITICAL: "DISK_SPACE_CRITICAL";
1086
+ REGENERATE_FAILED: "REGENERATE_FAILED";
1087
+ UNKNOWN: "UNKNOWN";
1088
+ }>;
1089
+ userMessage: z.ZodString;
1090
+ errorCategory: z.ZodOptional<z.ZodString>;
1091
+ }, z.core.$strip>;
1092
+
1038
1093
  declare interface ConversationsClearResponse {
1039
1094
  type: "conversations_clear_response";
1040
1095
  cleared: number;
@@ -1061,7 +1116,7 @@ declare interface ConversationSearchResultItem {
1061
1116
  matchingMessages: ConversationSearchMatchingMessage[];
1062
1117
  }
1063
1118
 
1064
- declare type _ConversationsServerMessages = AuthResult | PongMessage | AssistantStatusMessage | GenerationCancelledEvent | GenerationHandoffEvent | ModelInfo | HistoryResponse | UndoComplete | UsageUpdateEvent | UsageProgressEvent | UsageResponse | ContextCompacted | CompactionCircuitOpenEvent | CompactionCircuitClosedEvent | ConversationErrorEvent | ConversationInfo | ConversationTitleUpdatedEvent | ConversationListResponse | ConversationsClearResponse | ConversationSearchResponse | MessageContentResponse | ConversationListInvalidatedEvent | ScheduleConversationCreated | OpenConversation;
1119
+ declare type _ConversationsServerMessages = AuthResult | PongMessage | AssistantStatusMessage | GenerationCancelledEvent | GenerationHandoffEvent | ModelInfo | HistoryResponse | UndoComplete | UsageUpdateEvent | UsageProgressEvent | UsageResponse | ContextCompacted | CompactionCircuitOpenEvent | CompactionCircuitClosedEvent | ConversationErrorEvent | ConversationNoticeEvent | ConversationInfo | ConversationTitleUpdatedEvent | ConversationListResponse | ConversationsClearResponse | ConversationSearchResponse | MessageContentResponse | ConversationListInvalidatedEvent | ScheduleConversationCreated | OpenConversation;
1065
1120
 
1066
1121
  declare type ConversationTitleUpdatedEvent = z.infer<typeof ConversationTitleUpdatedEventSchema>;
1067
1122
 
@@ -1245,21 +1300,13 @@ declare interface DocumentSaveResponse {
1245
1300
  declare type _DocumentsServerMessages = DocumentEditorShow | DocumentEditorUpdateEvent | DocumentSaveResponse | DocumentLoadResponse | DocumentListResponse;
1246
1301
 
1247
1302
  /**
1248
- * Whether a profile's resolved model can process image input.
1303
+ * Whether the given model or profile can process image input.
1249
1304
  *
1250
- * Resolution mirrors the host's call-site resolver:
1251
- * - The profile's `(provider, model)` fields are merged over `llm.default` so
1252
- * a profile that only sets `model` (or only `provider`) inherits the other
1253
- * from the workspace default.
1254
- * - When `provider` is still missing but `model` is a known catalog model,
1255
- * the provider is inferred via `getCatalogProviderForModel` (same logic as
1256
- * the resolver's `withImpliedProviderForKnownModel`).
1257
- * - For a mix profile, returns `true` if any constituent arm supports vision
1258
- * (the mix can route to it) and `false` only if every arm is text-only.
1259
- * - Unknown `(provider, model)` pairs default to `true` (fail-open), matching
1260
- * the config GET route's `enrichProfilesWithVisionFlag`.
1305
+ * `modelOrProfile` may be a concrete model id, a profile key, or a
1306
+ * {@link ModelProfileInfo}. A bare string is resolved as a model id first and,
1307
+ * failing that, as a profile key. Returns `false` when nothing resolves.
1261
1308
  */
1262
- export declare function doesSupportVision(profile: ModelProfileInfo): boolean;
1309
+ export declare function doesSupportVision(modelOrProfile: ModelProfileInfo | string): boolean;
1263
1310
 
1264
1311
  declare interface DynamicPagePreview {
1265
1312
  title: string;
@@ -1378,12 +1425,14 @@ export declare interface FileContent {
1378
1425
  _attachmentId?: string;
1379
1426
  }
1380
1427
 
1381
- declare interface FileUploadSurfaceData {
1382
- prompt: string;
1383
- acceptedTypes?: string[];
1384
- maxFiles?: number;
1385
- maxSizeBytes?: number;
1386
- }
1428
+ declare type FileUploadSurfaceData = z.infer<typeof FileUploadSurfaceDataSchema>;
1429
+
1430
+ declare const FileUploadSurfaceDataSchema: z.ZodObject<{
1431
+ prompt: z.ZodOptional<z.ZodCoercedString<unknown>>;
1432
+ acceptedTypes: z.ZodPipe<z.ZodTransform<string[] | undefined, unknown>, z.ZodOptional<z.ZodArray<z.ZodString>>>;
1433
+ maxFiles: z.ZodCatch<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
1434
+ maxSizeBytes: z.ZodCatch<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
1435
+ }, z.core.$strip>;
1387
1436
 
1388
1437
  declare interface FilingConfigResponse {
1389
1438
  type: "filing_config_response";
@@ -1740,6 +1789,32 @@ declare const HomeFeedUpdatedEventSchema: z.ZodObject<{
1740
1789
 
1741
1790
  declare type _HomeServerMessages = RelationshipStateUpdatedEvent | HomeFeedUpdatedEvent;
1742
1791
 
1792
+ /**
1793
+ * A plugin lifecycle hook. Receives a per-lifecycle context shape and may
1794
+ * either mutate `ctx` in place (returning `void`) or return a *partial*
1795
+ * context whose fields are merged onto the threaded context — only the keys
1796
+ * it returns are overwritten, every other field is preserved. Returning a
1797
+ * partial lets a hook edit just the subset of fields it cares about without
1798
+ * having to re-specify the rest. The merged context is threaded to the next
1799
+ * hook in the chain (e.g. `user-prompt-submit`).
1800
+ *
1801
+ * Because an omitted key means "keep the existing value", every field on a
1802
+ * context shape is required (no `?`-optional or `| undefined` members): a
1803
+ * present key always carries a concrete value, so "absent from the returned
1804
+ * partial" is never ambiguous with "explicitly cleared". Fields that can be
1805
+ * empty model that with `| null`, not `| undefined`.
1806
+ *
1807
+ * Each known hook key has a documented context shape:
1808
+ * - `init` — {@link InitContext}
1809
+ * - `shutdown` — {@link ShutdownContext}
1810
+ * - `user-prompt-submit` — {@link UserPromptSubmitContext}
1811
+ * - `pre-model-call` — {@link PreModelCallContext}
1812
+ * - `post-tool-use` — {@link PostToolUseContext}
1813
+ * - `stop` — {@link StopContext}
1814
+ * - `post-model-call` — {@link PostModelCallContext}
1815
+ */
1816
+ export declare type HookFunction<TCtx = unknown> = (ctx: TCtx) => Promise<Partial<TCtx> | void>;
1817
+
1743
1818
  /** Union of every hook name declared in {@link HOOKS}. */
1744
1819
  export declare type HookName = (typeof HOOKS)[keyof typeof HOOKS];
1745
1820
 
@@ -2090,6 +2165,27 @@ declare interface IngressConfigResponse {
2090
2165
  error?: string;
2091
2166
  }
2092
2167
 
2168
+ /**
2169
+ * Context passed to `Plugin.init()` during bootstrap. Carries the resolved
2170
+ * config, a pino-compatible logger scoped to the plugin, a per-plugin
2171
+ * writable data directory, and the assistant's version metadata.
2172
+ */
2173
+ export declare interface InitContext {
2174
+ /** Parsed config for this plugin (may be `unknown` until the manifest validates). */
2175
+ config: unknown;
2176
+ /** Pino-compatible child logger bound to `{ plugin: <name> }`. */
2177
+ logger: PluginLogger;
2178
+ /** Absolute path to `<workspaceDir>/plugins-data/<plugin>/` (created by bootstrap). */
2179
+ pluginStorageDir: string;
2180
+ /**
2181
+ * Assistant semver. Plugins can compare against this for defensive
2182
+ * runtime checks — but the canonical compat contract is the host
2183
+ * version against the plugin's `peerDependencies["@vellumai/plugin-api"]`
2184
+ * semver range, enforced at load time by the external-plugin loader.
2185
+ */
2186
+ assistantVersion: string;
2187
+ }
2188
+
2093
2189
  declare interface IntegrationConnectResult {
2094
2190
  type: "integration_connect_result";
2095
2191
  integrationId: string;
@@ -2195,7 +2291,6 @@ declare const LLMCallSiteEnum: z.ZodEnum<{
2195
2291
  meetConsentMonitor: "meetConsentMonitor";
2196
2292
  meetChatOpportunity: "meetChatOpportunity";
2197
2293
  inference: "inference";
2198
- advisor: "advisor";
2199
2294
  vision: "vision";
2200
2295
  trustRuleSuggestion: "trustRuleSuggestion";
2201
2296
  homeGreeting: "homeGreeting";
@@ -2675,55 +2770,6 @@ declare interface PlatformDisconnected {
2675
2770
  type: "platform_disconnected";
2676
2771
  }
2677
2772
 
2678
- /**
2679
- * A plugin lifecycle hook. Receives a per-lifecycle context shape and may
2680
- * either mutate `ctx` in place (returning `void`) or return a *partial*
2681
- * context whose fields are merged onto the threaded context — only the keys
2682
- * it returns are overwritten, every other field is preserved. Returning a
2683
- * partial lets a hook edit just the subset of fields it cares about without
2684
- * having to re-specify the rest. The merged context is threaded to the next
2685
- * hook in the chain (e.g. `user-prompt-submit`).
2686
- *
2687
- * Because an omitted key means "keep the existing value", every field on a
2688
- * context shape is required (no `?`-optional or `| undefined` members): a
2689
- * present key always carries a concrete value, so "absent from the returned
2690
- * partial" is never ambiguous with "explicitly cleared". Fields that can be
2691
- * empty model that with `| null`, not `| undefined`.
2692
- *
2693
- * Each known hook key has a documented context shape:
2694
- * - `init` — {@link PluginInitContext}
2695
- * - `shutdown` — {@link PluginShutdownContext}
2696
- * - `user-prompt-submit` — {@link UserPromptSubmitContext}
2697
- * - `pre-model-call` — {@link PreModelCallContext}
2698
- * - `post-tool-use` — {@link PostToolUseContext}
2699
- * - `stop` — {@link StopContext}
2700
- * - `post-model-call` — {@link PostModelCallContext}
2701
- */
2702
- export declare type PluginHookFn<TCtx = unknown> = (ctx: TCtx) => Promise<Partial<TCtx> | void>;
2703
-
2704
- /**
2705
- * Context passed to `Plugin.init()` during bootstrap. Carries resolved
2706
- * config/credentials, a pino-compatible logger scoped to the plugin, a
2707
- * per-plugin writable data directory, and the assistant's version metadata.
2708
- */
2709
- export declare interface PluginInitContext {
2710
- /** Parsed config for this plugin (may be `unknown` until the manifest validates). */
2711
- config: unknown;
2712
- /** Resolved credential values keyed by the entries of `manifest.requiresCredential`. */
2713
- credentials: Record<string, string>;
2714
- /** Pino-compatible child logger bound to `{ plugin: <name> }`. */
2715
- logger: PluginLogger;
2716
- /** Absolute path to `<workspaceDir>/plugins-data/<plugin>/` (created by bootstrap). */
2717
- pluginStorageDir: string;
2718
- /**
2719
- * Assistant semver. Plugins can compare against this for defensive
2720
- * runtime checks — but the canonical compat contract is the host
2721
- * version against the plugin's `peerDependencies["@vellumai/plugin-api"]`
2722
- * semver range, enforced at load time by the external-plugin loader.
2723
- */
2724
- assistantVersion: string;
2725
- }
2726
-
2727
2773
  /**
2728
2774
  * Minimal pino-compatible logger surface handed to plugin hooks. The host
2729
2775
  * supplies a pino child logger bound to `{ plugin: <name> }`; this
@@ -2743,23 +2789,6 @@ export declare interface PluginLogger {
2743
2789
  debug(obj: Record<string, unknown>, msg?: string): void;
2744
2790
  }
2745
2791
 
2746
- /**
2747
- * Context passed to the `shutdown` hook during daemon teardown. Kept
2748
- * intentionally narrower than {@link PluginInitContext} — most teardown
2749
- * paths only need to know which assistant version they're shutting
2750
- * down against (e.g. for version-conditional cleanup of state files
2751
- * written by a previous boot).
2752
- *
2753
- * Additional fields may be added as concrete plugin needs surface; the
2754
- * `assistantVersion` field mirrors the init context's so plugins that
2755
- * stash a version stamp at init can compare against the same name on
2756
- * tear-down without keeping their own copy.
2757
- */
2758
- export declare interface PluginShutdownContext {
2759
- /** Assistant semver for compatibility checks inside the plugin. */
2760
- assistantVersion: string;
2761
- }
2762
-
2763
2792
  declare interface PongMessage {
2764
2793
  type: "pong";
2765
2794
  }
@@ -2778,7 +2807,7 @@ declare interface PongMessage {
2778
2807
  * their own injected context the same way.
2779
2808
  *
2780
2809
  * The hook re-injects by mutating `history` in place (or returning a new
2781
- * context with a replacement `history`) — see {@link PluginHookFn}'s
2810
+ * context with a replacement `history`) — see {@link HookFunction}'s
2782
2811
  * polymorphic return shape. The agent loop reads the settled `history` back off
2783
2812
  * the context and resumes the turn from it. Multiple plugins' hooks chain in
2784
2813
  * registration order, each seeing the previous plugin's edits.
@@ -2925,7 +2954,7 @@ export declare type PostModelCallDecision = "continue" | "stop";
2925
2954
  *
2926
2955
  * The hook may transform the result either by mutating `toolResponse` in
2927
2956
  * place (e.g. reassigning `toolResponse.content`) or by returning a new
2928
- * context with a fresh `toolResponse` — see {@link PluginHookFn}'s
2957
+ * context with a fresh `toolResponse` — see {@link HookFunction}'s
2929
2958
  * polymorphic return shape. The daemon threads the final `toolResponse`
2930
2959
  * into the provider-bound history.
2931
2960
  *
@@ -3057,6 +3086,28 @@ export declare interface Provider {
3057
3086
  * Falls back to `name` when unset.
3058
3087
  */
3059
3088
  tokenEstimationProvider?: string;
3089
+ /**
3090
+ * True when this provider instance was constructed to run web search
3091
+ * server-side (provider-native). The native search only activates when a
3092
+ * `web_search`-named tool is passed in the request, so callers that want to
3093
+ * enable web search on a one-shot completion (e.g. the advisor consult) check
3094
+ * this first — passing the tool to a non-native instance would surface an
3095
+ * unexecutable client tool call. Absent/false on providers without it.
3096
+ */
3097
+ supportsNativeWebSearch?: boolean;
3098
+ /**
3099
+ * Per-call native web-search capability for the provider/model this specific
3100
+ * request will route to. Unlike the static {@link supportsNativeWebSearch}
3101
+ * flag — fixed to the DEFAULT provider/model at construction — this consults
3102
+ * the resolved call-site (`options.config.callSite` + `overrideProfile`) so a
3103
+ * routing wrapper reports the ROUTED target's capability. Callers that gate a
3104
+ * `web_search` server tool on a possibly-routed call (e.g. the advisor
3105
+ * consult, whose `advisorProfile` may point at a different provider/model)
3106
+ * must use this rather than the construction-time snapshot. Optional: wrappers
3107
+ * forward it to their inner provider; leaf providers may omit it, in which
3108
+ * case callers fall back to {@link supportsNativeWebSearch}.
3109
+ */
3110
+ supportsNativeWebSearchFor?(options?: SendMessageOptions): boolean;
3060
3111
  sendMessage(messages: Message[], options?: SendMessageOptions): Promise<ProviderResponse>;
3061
3112
  /**
3062
3113
  * Exact prompt-token count from the provider's own tokenizer, for the
@@ -3512,6 +3563,23 @@ declare interface ShowPlatformLogin {
3512
3563
  type: "show_platform_login";
3513
3564
  }
3514
3565
 
3566
+ /**
3567
+ * Context passed to the `shutdown` hook during daemon teardown. Kept
3568
+ * intentionally narrower than {@link InitContext} — most teardown
3569
+ * paths only need to know which assistant version they're shutting
3570
+ * down against (e.g. for version-conditional cleanup of state files
3571
+ * written by a previous boot).
3572
+ *
3573
+ * Additional fields may be added as concrete plugin needs surface; the
3574
+ * `assistantVersion` field mirrors the init context's so plugins that
3575
+ * stash a version stamp at init can compare against the same name on
3576
+ * tear-down without keeping their own copy.
3577
+ */
3578
+ export declare interface ShutdownContext {
3579
+ /** Assistant semver for compatibility checks inside the plugin. */
3580
+ assistantVersion: string;
3581
+ }
3582
+
3515
3583
  declare interface SignBundlePayloadRequest {
3516
3584
  type: "sign_bundle_payload";
3517
3585
  requestId: string;
@@ -3839,6 +3907,26 @@ declare interface ToolActivityMetadata {
3839
3907
  webFetch?: WebFetchMetadata;
3840
3908
  }
3841
3909
 
3910
+ /**
3911
+ * Runtime context passed as the second argument to every tool's `execute`.
3912
+ *
3913
+ * The fields fall into two groups:
3914
+ *
3915
+ * - A small, stable core that we are comfortable exposing to any tool —
3916
+ * including workspace- and plugin-authored tools via `@vellumai/plugin-api`:
3917
+ * `conversationId`, `workingDir`, `requestId`, `signal`, `onOutput`,
3918
+ * `assistantId`, `isInteractive`.
3919
+ * - Everything tagged `@legacy` below: host-internal routing, permission,
3920
+ * trust, requester-identity, proxy, and telemetry metadata that historically
3921
+ * accreted on this single context. These are NOT a surface we want third-party
3922
+ * tools to depend on; we are triaging them post-launch with the goal of
3923
+ * moving them off the public context (or removing them) over time. Grep for
3924
+ * `@legacy` to enumerate the set. Do not add new fields here — extend the
3925
+ * stable core only when a field is genuinely safe and stable to expose.
3926
+ *
3927
+ * The daemon constructs and passes the full object to every tool at runtime; a
3928
+ * tool that only reads the stable core is unaffected by the eventual cleanup.
3929
+ */
3842
3930
  export declare interface ToolContext {
3843
3931
  /** Identifier of the conversation this tool invocation belongs to. */
3844
3932
  conversationId: string;
@@ -3852,23 +3940,44 @@ export declare interface ToolContext {
3852
3940
  onOutput?: (chunk: string) => void;
3853
3941
  /** Logical assistant scope for multi-assistant routing. */
3854
3942
  assistantId?: string;
3855
- /** When set, the tool execution is part of a task run. Used to retrieve ephemeral permission rules. */
3943
+ /** True when an interactive client is connected (not just a no-op callback). */
3944
+ isInteractive?: boolean;
3945
+ /**
3946
+ * When set, the tool execution is part of a task run. Used to retrieve ephemeral permission rules.
3947
+ * @legacy
3948
+ */
3856
3949
  taskRunId?: string;
3857
3950
  /**
3858
3951
  * Model attribution snapshot for the conversation at invocation time
3859
3952
  * (provider/model/profile that issued this tool call). Used by tool
3860
3953
  * telemetry; never sent to the tool itself.
3954
+ * @legacy
3861
3955
  */
3862
3956
  attribution?: UsageAttributionSnapshot | null;
3863
- /** Optional callback for tool lifecycle events (start/prompt/deny/execute/error). */
3957
+ /**
3958
+ * Optional callback for tool lifecycle events (start/prompt/deny/execute/error).
3959
+ * @legacy
3960
+ */
3864
3961
  onToolLifecycleEvent?: ToolLifecycleEventHandler;
3865
- /** Optional resolver for proxy tools - delegates execution to an external client. */
3962
+ /**
3963
+ * Optional resolver for proxy tools - delegates execution to an external client.
3964
+ * @legacy
3965
+ */
3866
3966
  proxyToolResolver?: ProxyToolResolver;
3867
- /** When set, only tools in this set may execute. Tools outside the set are blocked with an error. */
3967
+ /**
3968
+ * When set, only tools in this set may execute. Tools outside the set are blocked with an error.
3969
+ * @legacy
3970
+ */
3868
3971
  allowedToolNames?: Set<string>;
3869
- /** True when this turn is restricted to storage cleanup-safe tools. */
3972
+ /**
3973
+ * True when this turn is restricted to storage cleanup-safe tools.
3974
+ * @legacy
3975
+ */
3870
3976
  diskPressureCleanupModeActive?: boolean;
3871
- /** Prompt the user for a secret value via native SecureField UI. */
3977
+ /**
3978
+ * Prompt the user for a secret value via native SecureField UI.
3979
+ * @legacy
3980
+ */
3872
3981
  requestSecret?: (params: {
3873
3982
  service: string;
3874
3983
  field: string;
@@ -3879,14 +3988,18 @@ export declare interface ToolContext {
3879
3988
  allowedTools?: string[];
3880
3989
  allowedDomains?: string[];
3881
3990
  }) => Promise<SecretPromptResult>;
3882
- /** Optional callback to send a message to the connected client (e.g. open_url). */
3991
+ /**
3992
+ * Optional callback to send a message to the connected client (e.g. open_url).
3993
+ * @legacy
3994
+ */
3883
3995
  sendToClient?: (msg: {
3884
3996
  type: string;
3885
3997
  [key: string]: unknown;
3886
3998
  }) => void;
3887
- /** True when an interactive client is connected (not just a no-op callback). */
3888
- isInteractive?: boolean;
3889
- /** When true, tools with side effects should always prompt for confirmation. */
3999
+ /**
4000
+ * When true, tools with side effects should always prompt for confirmation.
4001
+ * @legacy
4002
+ */
3890
4003
  forcePromptSideEffects?: boolean;
3891
4004
  /**
3892
4005
  * When true, the tool requires a fresh interactive approval for every
@@ -3897,26 +4010,46 @@ export declare interface ToolContext {
3897
4010
  * temporary override options in the prompt UI. Used by
3898
4011
  * `manage_secure_command_tool` to ensure a human reviews each secure
3899
4012
  * bundle installation.
4013
+ * @legacy
3900
4014
  */
3901
4015
  requireFreshApproval?: boolean;
3902
- /** Approval callback for proxy policy decisions that require user confirmation. */
4016
+ /**
4017
+ * Approval callback for proxy policy decisions that require user confirmation.
4018
+ * @legacy
4019
+ */
3903
4020
  proxyApprovalCallback?: ProxyApprovalCallback;
3904
- /** Optional principal identifier propagated to sub-tool confirmation flows. */
4021
+ /**
4022
+ * Optional principal identifier propagated to sub-tool confirmation flows.
4023
+ * @legacy
4024
+ */
3905
4025
  principal?: string;
3906
4026
  /**
3907
4027
  * Trust classification of the actor who initiated this tool invocation.
3908
4028
  * Determines permission level: guardians self-approve, trusted contacts
3909
4029
  * may escalate to guardian for approval, unknown actors are fail-closed.
3910
4030
  * See {@link TrustClass} in actor-trust-resolver.ts for value semantics.
4031
+ * @legacy
3911
4032
  */
3912
4033
  trustClass: TrustClass;
3913
- /** Channel through which the tool invocation originates (e.g. 'telegram', 'phone'). Used for scoped grant consumption. */
4034
+ /**
4035
+ * Channel through which the tool invocation originates (e.g. 'telegram', 'phone'). Used for scoped grant consumption.
4036
+ * @legacy
4037
+ */
3914
4038
  executionChannel?: string;
3915
- /** Voice/call session ID, if the invocation originates from a call. Used for scoped grant consumption. */
4039
+ /**
4040
+ * Voice/call session ID, if the invocation originates from a call. Used for scoped grant consumption.
4041
+ * @legacy
4042
+ */
3916
4043
  callSessionId?: string;
3917
- /** True when the tool invocation was triggered by a user clicking a surface action button (not a regular message). */
4044
+ /**
4045
+ * True when the tool invocation was triggered by a user clicking a surface action button (not a regular message).
4046
+ * @legacy
4047
+ */
3918
4048
  triggeredBySurfaceAction?: boolean;
3919
- /** True when the user explicitly approved this tool invocation via the interactive permission prompt (not auto-approved by trust rules or temporary overrides). */
4049
+ /**
4050
+ * True when the user explicitly approved this tool invocation via the interactive permission prompt (not auto-approved by trust rules or temporary overrides).
4051
+ * @legacy
4052
+ */
3920
4053
  approvedViaPrompt?: boolean;
3921
4054
  /**
3922
4055
  * True when the invocation is inside a scheduled task run whose
@@ -3924,21 +4057,43 @@ export declare interface ToolContext {
3924
4057
  * Tools that normally require a surface-action click (e.g. bulk archive,
3925
4058
  * unsubscribe) may treat this as equivalent consent, since the user
3926
4059
  * already reviewed the tool list when the task was saved.
4060
+ * @legacy
3927
4061
  */
3928
4062
  batchAuthorizedByTask?: boolean;
3929
- /** External user ID of the requester (non-guardian actor). Used for scoped grant consumption. */
4063
+ /**
4064
+ * External user ID of the requester (non-guardian actor). Used for scoped grant consumption.
4065
+ * @legacy
4066
+ */
3930
4067
  requesterExternalUserId?: string;
3931
- /** Chat ID of the requester (non-guardian actor). Used for tool grant request escalation notifications. */
4068
+ /**
4069
+ * Chat ID of the requester (non-guardian actor). Used for tool grant request escalation notifications.
4070
+ * @legacy
4071
+ */
3932
4072
  requesterChatId?: string;
3933
- /** Human-readable identifier for the requester (e.g., @username). */
4073
+ /**
4074
+ * Human-readable identifier for the requester (e.g., @username).
4075
+ * @legacy
4076
+ */
3934
4077
  requesterIdentifier?: string;
3935
- /** Preferred display name for the requester. */
4078
+ /**
4079
+ * Preferred display name for the requester.
4080
+ * @legacy
4081
+ */
3936
4082
  requesterDisplayName?: string;
3937
- /** Slack channel ID for channel-scoped permission enforcement. When set, tools are checked against the channel's permission profile. */
4083
+ /**
4084
+ * Slack channel ID for channel-scoped permission enforcement. When set, tools are checked against the channel's permission profile.
4085
+ * @legacy
4086
+ */
3938
4087
  channelPermissionChannelId?: string;
3939
- /** The tool_use block ID from the LLM response, used to correlate confirmation prompts with specific tool invocations. */
4088
+ /**
4089
+ * The tool_use block ID from the LLM response, used to correlate confirmation prompts with specific tool invocations.
4090
+ * @legacy
4091
+ */
3940
4092
  toolUseId?: string;
3941
- /** True when the assistant is running as a platform-managed remote instance. Used to auto-approve sandboxed bash tools. */
4093
+ /**
4094
+ * True when the assistant is running as a platform-managed remote instance. Used to auto-approve sandboxed bash tools.
4095
+ * @legacy
4096
+ */
3942
4097
  isPlatformHosted?: boolean;
3943
4098
  /**
3944
4099
  * The interface ID of the connected client driving the current turn (e.g.
@@ -3946,6 +4101,7 @@ export declare interface ToolContext {
3946
4101
  * transport preference — for example, macOS-originated turns prefer the
3947
4102
  * user's real Chrome session via the paired extension before falling back
3948
4103
  * to cdp-inspect or local Playwright.
4104
+ * @legacy
3949
4105
  */
3950
4106
  transportInterface?: InterfaceId;
3951
4107
  /**
@@ -3956,6 +4112,7 @@ export declare interface ToolContext {
3956
4112
  * has `inferenceProfile` set — the override only flows through the
3957
4113
  * in-memory `SubagentConfig.overrideProfile` chain. See
3958
4114
  * `executeSubagentSpawn` in tools/subagent/spawn.ts.
4115
+ * @legacy
3959
4116
  */
3960
4117
  overrideProfile?: string;
3961
4118
  /**
@@ -3964,6 +4121,7 @@ export declare interface ToolContext {
3964
4121
  * default a spawned subagent's inference profile to the profile the invoking
3965
4122
  * turn resolved to, so subagents match whatever agent invoked them rather
3966
4123
  * than always falling back to the static `subagentSpawn` call-site default.
4124
+ * @legacy
3967
4125
  */
3968
4126
  invokingCallSite?: LLMCallSite;
3969
4127
  /**
@@ -3972,6 +4130,7 @@ export declare interface ToolContext {
3972
4130
  * Used by host proxies to bind cross-client targeted execution to the same
3973
4131
  * authenticated user identity. May be undefined for legacy/internal flows
3974
4132
  * with no resolved actor identity.
4133
+ * @legacy
3975
4134
  */
3976
4135
  sourceActorPrincipalId?: string;
3977
4136
  }
@@ -4024,6 +4183,7 @@ declare const ToolDefinitionSchema: z.ZodObject<{
4024
4183
  host: "host";
4025
4184
  }>>;
4026
4185
  execute: z.ZodOptional<z.ZodCustom<(input: Record<string, unknown>, context: ToolContext) => Promise<ToolExecutionResult>, (input: Record<string, unknown>, context: ToolContext) => Promise<ToolExecutionResult>>>;
4186
+ exclusive: z.ZodOptional<z.ZodBoolean>;
4027
4187
  }, z.core.$strip>;
4028
4188
 
4029
4189
  /**
@@ -4687,7 +4847,7 @@ declare const UserMessageEchoEventSchema: z.ZodObject<{
4687
4847
  *
4688
4848
  * The hook may transform `latestMessages` either by mutating it in place
4689
4849
  * (`push` / `splice` / `length = 0`) or by returning a new context with
4690
- * a fresh `latestMessages` array — see {@link PluginHookFn}'s polymorphic
4850
+ * a fresh `latestMessages` array — see {@link HookFunction}'s polymorphic
4691
4851
  * return shape. The daemon threads the final `latestMessages` value into
4692
4852
  * `agentLoop.run()` as the run-messages argument.
4693
4853
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vellumai/plugin-api",
3
- "version": "0.10.2",
3
+ "version": "0.10.3-dev.202606252046.9075fd5",
4
4
  "description": "Public TypeScript authoring contract for Vellum assistant plugins.",
5
5
  "license": "MIT",
6
6
  "type": "module",