@vellumai/plugin-api 0.9.0 → 0.10.0-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 +349 -14
  2. package/index.js +2 -0
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -524,8 +524,7 @@ declare type _BookmarksServerMessages = BookmarkCreated | BookmarkDeleted;
524
524
 
525
525
  /**
526
526
  * Wire-shape representation of a bookmark, joined with the bookmarked
527
- * message and its parent conversation. Mirrors
528
- * `clients/shared/Network/BookmarkSummary.swift` — dates are emitted as
527
+ * message and its parent conversation. Dates are emitted as
529
528
  * unix-millisecond integers, and the message preview is capped to keep
530
529
  * the list payload bounded.
531
530
  */
@@ -809,7 +808,6 @@ declare interface ContactChannelPayload {
809
808
  type: string;
810
809
  address: string;
811
810
  isPrimary: boolean;
812
- externalUserId?: string;
813
811
  status: string;
814
812
  policy: string;
815
813
  verifiedAt?: number;
@@ -920,9 +918,9 @@ declare interface ContextCompacted {
920
918
  * - `summaryCharCount`: length of the produced summary text.
921
919
  * - `summaryHeaderCount`: number of `## ` section headers in the summary.
922
920
  * - `summaryHadMemoryEcho`: `true` if the summary contains any runtime
923
- * injection tag (e.g. `<memory`, `<turn_context>`, `<workspace>`).
924
- * Should always be `false` `true` indicates the compaction strip
925
- * logic failed to remove an injected block from the summarizer input.
921
+ * injection tag (e.g. `<memory`, `<turn_context>`, `<workspace>`). The
922
+ * durable summary should be clean prose, so `true` flags an echoed or
923
+ * invented tag worth investigating.
926
924
  */
927
925
  summaryCharCount?: number;
928
926
  summaryHeaderCount?: number;
@@ -1471,6 +1469,32 @@ declare const GenerationHandoffEventSchema: z.ZodObject<{
1471
1469
  attachmentWarnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
1472
1470
  }, z.core.$strip>;
1473
1471
 
1472
+ /**
1473
+ * Resolve the configured provider through the registry.
1474
+ * Thin wrapper around `resolveConfiguredProvider()` for callsites
1475
+ * that only need the Provider instance.
1476
+ *
1477
+ * `callSite` is required — see `resolveConfiguredProvider`. Returns `null`
1478
+ * when no providers are available.
1479
+ */
1480
+ export declare function getConfiguredProvider(callSite: LLMCallSite, opts?: {
1481
+ overrideProfile?: string;
1482
+ forceOverrideProfile?: boolean;
1483
+ }): Promise<Provider | null>;
1484
+
1485
+ /**
1486
+ * List the workspace inference profiles a plugin can route to, in the order the
1487
+ * `/model` picker presents them (`llm.profileOrder` first, then the rest
1488
+ * alphabetically). Disabled profiles are included and flagged via
1489
+ * {@link ModelProfileInfo.isDisabled}; weighted "mix" profiles are included and
1490
+ * flagged via {@link ModelProfileInfo.isMix}, since a mix is itself a valid
1491
+ * routing target (it resolves to one constituent per conversation).
1492
+ *
1493
+ * Reads the live in-memory config, so the result reflects the current profile
1494
+ * set each time it is called.
1495
+ */
1496
+ export declare function getModelProfiles(): ModelProfileInfo[];
1497
+
1474
1498
  /**
1475
1499
  * Retrieve a secret from secure storage. Convenience wrapper over
1476
1500
  * `getSecureKeyResultAsync` that returns only the value.
@@ -1729,7 +1753,7 @@ export declare const HOOKS: {
1729
1753
  readonly SHUTDOWN: "shutdown";
1730
1754
  /** Fires once per user turn, immediately before the agent loop receives `runMessages`. */
1731
1755
  readonly USER_PROMPT_SUBMIT: "user-prompt-submit";
1732
- /** Fires immediately before each provider call. A hook may edit the outbound request (e.g. the system prompt) and opt the turn into deferred output streaming. */
1756
+ /** Fires immediately before each provider call. A hook may edit the outbound request (e.g. the system prompt), route the call to a different inference profile, and opt the turn into deferred output streaming. */
1733
1757
  readonly PRE_MODEL_CALL: "pre-model-call";
1734
1758
  /** Fires once per tool result, after the tool returns and before the result is sent to the provider. */
1735
1759
  readonly POST_TOOL_USE: "post-tool-use";
@@ -2112,7 +2136,7 @@ declare interface ListSurfaceData {
2112
2136
  selectionMode: "single" | "multiple" | "none";
2113
2137
  }
2114
2138
 
2115
- declare type LLMCallSite = z.infer<typeof LLMCallSiteEnum>;
2139
+ export declare type LLMCallSite = z.infer<typeof LLMCallSiteEnum>;
2116
2140
 
2117
2141
  /**
2118
2142
  * The complete set of LLM call-site identifiers the assistant emits.
@@ -2160,6 +2184,7 @@ declare const LLMCallSiteEnum: z.ZodEnum<{
2160
2184
  meetConsentMonitor: "meetConsentMonitor";
2161
2185
  meetChatOpportunity: "meetChatOpportunity";
2162
2186
  inference: "inference";
2187
+ advisor: "advisor";
2163
2188
  trustRuleSuggestion: "trustRuleSuggestion";
2164
2189
  homeGreeting: "homeGreeting";
2165
2190
  homeSuggestedPrompts: "homeSuggestedPrompts";
@@ -2453,6 +2478,33 @@ declare interface ModelInfo {
2453
2478
  }>;
2454
2479
  }
2455
2480
 
2481
+ /**
2482
+ * A workspace inference profile a plugin can route to. Returned by
2483
+ * {@link getModelProfiles}; {@link key} is the value a `pre-model-call` hook
2484
+ * assigns to `PreModelCallContext.modelProfile` to route a call. A model router
2485
+ * reads this list (typically at `init`) to learn which profiles exist before
2486
+ * mapping a classified message onto one.
2487
+ */
2488
+ export declare interface ModelProfileInfo {
2489
+ /** Profile key in `llm.profiles`; assignable to `PreModelCallContext.modelProfile`. */
2490
+ readonly key: string;
2491
+ /** Human-readable label, falling back to {@link key} when none is set. */
2492
+ readonly label: string;
2493
+ /** Author-supplied description, or `null` when none is set. */
2494
+ readonly description: string | null;
2495
+ /** Whether this is the workspace's active profile. */
2496
+ readonly isActive: boolean;
2497
+ /** Whether the profile is disabled; routing to it is rejected by the resolver. */
2498
+ readonly isDisabled: boolean;
2499
+ /**
2500
+ * Whether this is a weighted "mix" profile — an A/B blend that resolves to one
2501
+ * of its constituent profiles per conversation via a seeded weighted pick.
2502
+ * Routing to its {@link key} is valid; it directs the call into the blend
2503
+ * rather than at a single fixed model.
2504
+ */
2505
+ readonly isMix: boolean;
2506
+ }
2507
+
2456
2508
  declare type NavigateSettingsEvent = z.infer<typeof NavigateSettingsEventSchema>;
2457
2509
 
2458
2510
  declare const NavigateSettingsEventSchema: z.ZodObject<{
@@ -2929,8 +2981,9 @@ export declare interface PostToolUseContext {
2929
2981
  * and compaction work can share a conversation), hooks MUST self-gate on
2930
2982
  * {@link callSite} / {@link conversationId} before acting.
2931
2983
  *
2932
- * A hook may edit the outbound request by replacing {@link systemPrompt}, and may
2933
- * opt this turn into deferred output streaming via {@link deferAssistantOutput}.
2984
+ * A hook may edit the outbound request by replacing {@link systemPrompt}, route
2985
+ * the call to a different inference profile via {@link modelProfile}, and opt
2986
+ * this turn into deferred output streaming via {@link deferAssistantOutput}.
2934
2987
  * Mutate the context in place or return a new one; throwing is contained by the
2935
2988
  * loop (the call proceeds with the original request).
2936
2989
  */
@@ -2947,6 +3000,24 @@ export declare interface PreModelCallContext {
2947
3000
  * append a section); the loop sends the resulting value.
2948
3001
  */
2949
3002
  systemPrompt: string | null;
3003
+ /**
3004
+ * Inference profile to route THIS provider call to, named by its key in the
3005
+ * workspace `llm.profiles`. Seeded with the call's already-resolved override
3006
+ * profile, or `null` when none applies. A hook may replace it to select a
3007
+ * different profile per call — the lever a model router uses to map a
3008
+ * classified message onto a profile (model + provider connection + sampling
3009
+ * settings). For the user-facing `mainAgent` call the resolver layers the
3010
+ * named profile at the top of precedence (above the workspace active
3011
+ * profile), so the hook's choice wins; a key with no matching profile falls
3012
+ * through unchanged (no throw). Honored only when {@link callSite} is set.
3013
+ * Set to `null` to apply no override.
3014
+ *
3015
+ * Context-window sizing and overflow recovery for this call are computed from
3016
+ * the profile resolved before the hook runs. Routing a near-budget
3017
+ * conversation to a profile with a smaller context window relies on the loop's
3018
+ * overflow recovery (compact and retry) rather than proactive compaction.
3019
+ */
3020
+ modelProfile: string | null;
2950
3021
  /**
2951
3022
  * Seeded `false`. When a hook sets it `true`, the loop suppresses this turn's
2952
3023
  * live assistant `text_delta` stream; a `post-model-call` hook is then
@@ -2963,6 +3034,83 @@ declare interface ProcessEntry extends BaseSubscriberEntry {
2963
3034
  type: "process";
2964
3035
  }
2965
3036
 
3037
+ export declare interface Provider {
3038
+ name: string;
3039
+ /**
3040
+ * Provider key used by the local token estimator to select model-family
3041
+ * specific rules (e.g. Anthropic's `width * height / 750` image sizing).
3042
+ * Wrapper providers that route to another provider's API — e.g. OpenRouter
3043
+ * calling Anthropic's Messages endpoint for `anthropic/*` models — override
3044
+ * this so the estimator matches what the upstream API will actually charge.
3045
+ * Falls back to `name` when unset.
3046
+ */
3047
+ tokenEstimationProvider?: string;
3048
+ sendMessage(messages: Message[], options?: SendMessageOptions): Promise<ProviderResponse>;
3049
+ }
3050
+
3051
+ export declare type ProviderEvent = {
3052
+ type: "text_delta";
3053
+ text: string;
3054
+ } | {
3055
+ type: "thinking_delta";
3056
+ thinking: string;
3057
+ } | {
3058
+ type: "tool_use_preview_start";
3059
+ toolUseId: string;
3060
+ toolName: string;
3061
+ } | {
3062
+ type: "input_json_delta";
3063
+ toolName: string;
3064
+ toolUseId: string;
3065
+ accumulatedJson: string;
3066
+ } | {
3067
+ type: "server_tool_start";
3068
+ name: string;
3069
+ toolUseId: string;
3070
+ input: Record<string, unknown>;
3071
+ } | {
3072
+ type: "server_tool_complete";
3073
+ toolUseId: string;
3074
+ isError: boolean;
3075
+ content?: unknown[];
3076
+ /**
3077
+ * Finalized input for the server tool call (e.g. the actual query).
3078
+ * Anthropic streams `server_tool_use` block input via `input_json_delta`
3079
+ * events, so consumers reading the input at `server_tool_start` see `{}`.
3080
+ * The provider accumulates the JSON and surfaces it here once the block
3081
+ * stops, so downstream handlers can build accurate activity metadata.
3082
+ */
3083
+ resolvedInput?: Record<string, unknown>;
3084
+ /**
3085
+ * Provider-specific error code when `isError` is true (e.g. Anthropic's
3086
+ * `max_uses_exceeded`, `query_too_long`). Surfaced so user-facing
3087
+ * messages can be specific instead of a generic "Search failed".
3088
+ */
3089
+ errorCode?: string;
3090
+ /** Optional human-readable error message from the provider. */
3091
+ errorMessage?: string;
3092
+ };
3093
+
3094
+ export declare interface ProviderResponse {
3095
+ content: ContentBlock[];
3096
+ model: string;
3097
+ /** Provider that actually produced this response, which may differ from a wrapper provider name. */
3098
+ actualProvider?: string;
3099
+ usage: {
3100
+ /** Total input tokens (input_tokens + cache_creation + cache_read). */
3101
+ inputTokens: number;
3102
+ outputTokens: number;
3103
+ cacheCreationInputTokens?: number;
3104
+ cacheReadInputTokens?: number;
3105
+ reasoningTokens?: number;
3106
+ };
3107
+ stopReason: string;
3108
+ /** Raw JSON request body sent to the provider (for diagnostics logging). */
3109
+ rawRequest?: unknown;
3110
+ /** Raw JSON response body received from the provider (for diagnostics logging). */
3111
+ rawResponse?: unknown;
3112
+ }
3113
+
2966
3114
  /** Callback for proxy policy decisions requiring user confirmation. Returns true if approved. */
2967
3115
  declare type ProxyApprovalCallback = (request: ProxyApprovalRequest) => Promise<boolean>;
2968
3116
 
@@ -3168,6 +3316,96 @@ declare const SecretRequestEventSchema: z.ZodObject<{
3168
3316
  allowOneTimeSend: z.ZodOptional<z.ZodBoolean>;
3169
3317
  }, z.core.$strip>;
3170
3318
 
3319
+ export declare interface SendMessageConfig {
3320
+ model?: string;
3321
+ /**
3322
+ * LLM call-site identifier. `RetryProvider` resolves
3323
+ * provider/model/maxTokens/effort/speed/verbosity/temperature/thinking/
3324
+ * contextWindow via `resolveCallSiteConfig(callSite, config.llm)`, falling
3325
+ * back to `llm.default` when no callSite-specific entry is present.
3326
+ */
3327
+ callSite?: LLMCallSite;
3328
+ /**
3329
+ * Optional ad-hoc profile override applied per request. When set, the
3330
+ * resolver layers `llm.profiles[overrideProfile]` between the workspace's
3331
+ * `activeProfile` and the call-site's named profile (see
3332
+ * `resolveCallSiteConfig`). Used by per-conversation pinned profiles to
3333
+ * override the workspace default for a single send. Missing profile names
3334
+ * silently fall through.
3335
+ */
3336
+ overrideProfile?: string;
3337
+ /**
3338
+ * When true, the resolver floats `overrideProfile` above the call-site
3339
+ * layers (named site profile + call-site override) for non-main-agent call
3340
+ * sites — see `ResolveCallSiteOpts.forceOverrideProfile`. Used by callers
3341
+ * that must run a background call site under a specific conversation's
3342
+ * inference profile (e.g. fork-based memory retrospectives). A
3343
+ * resolution/routing-time concern only; stripped before any provider wire
3344
+ * request.
3345
+ */
3346
+ forceOverrideProfile?: boolean;
3347
+ /**
3348
+ * Per-conversation seed for deterministic `mix`-profile expansion. The agent
3349
+ * loop sets this to the conversation id so every resolver call this send
3350
+ * triggers — provider/transport selection, wire-param normalization, usage
3351
+ * attribution — picks the same mix constituent, stable across the
3352
+ * conversation's turns and retries. A resolution/routing-time concern only;
3353
+ * stripped before any provider wire request.
3354
+ */
3355
+ selectionSeed?: string;
3356
+ /**
3357
+ * Internal per-request HTTP headers for managed-proxy usage attribution.
3358
+ * Provider clients may pass these through SDK request options only when the
3359
+ * transport is Vellum-managed, and must never include this object in provider
3360
+ * JSON request bodies.
3361
+ */
3362
+ usageAttributionHeaders?: Record<string, string>;
3363
+ /**
3364
+ * Controls local usage-ledger writes for attributed provider calls.
3365
+ * Defaults to `auto`; conversation paths that aggregate usage separately
3366
+ * set `manual` to avoid double-counting.
3367
+ */
3368
+ usageTracking?: "auto" | "manual";
3369
+ effort?: "none" | "low" | "medium" | "high" | "xhigh" | "max";
3370
+ speed?: "standard" | "fast";
3371
+ verbosity?: "low" | "medium" | "high";
3372
+ /**
3373
+ * Wire-format `logit_bias` map (`{ "<tokenId>": bias }`). Set by
3374
+ * `RetryProvider` from a profile's `logitBias` preset and forwarded only on
3375
+ * the OpenAI-compatible (Fireworks) path; other providers ignore it.
3376
+ */
3377
+ logit_bias?: Record<string, number>;
3378
+ /**
3379
+ * When true, the most recent user message's content varies across
3380
+ * otherwise-identical turns (e.g. a per-turn memory block was injected into
3381
+ * it). The provider places the primary long-TTL cache breakpoint on the most
3382
+ * recent *stable* user message instead of the volatile latest one, so the
3383
+ * cached prefix stays reusable across turns. Default false — existing
3384
+ * behavior.
3385
+ */
3386
+ mutableLatestUserMessage?: boolean;
3387
+ /**
3388
+ * When true, the provider sends no prompt-cache breakpoints at all (and
3389
+ * strips any block-level `cache_control` markers callers stamped on
3390
+ * messages). For one-shot call sites whose prompts are unique per call or
3391
+ * whose call cadence exceeds the cache TTL, every breakpoint is a paid
3392
+ * cache write that will never be read — opting out saves the write
3393
+ * premium. Resolved per call site via `resolveCallSiteConfig` (see
3394
+ * `disableCache` in the LLM config schema); a per-call explicit value
3395
+ * wins. Default false — existing behavior.
3396
+ */
3397
+ disableCache?: boolean;
3398
+ [key: string]: unknown;
3399
+ }
3400
+
3401
+ export declare interface SendMessageOptions {
3402
+ tools?: ToolDefinition_2[];
3403
+ systemPrompt?: string;
3404
+ config?: SendMessageConfig;
3405
+ onEvent?: (event: ProviderEvent) => void;
3406
+ signal?: AbortSignal;
3407
+ }
3408
+
3171
3409
  declare interface SensitiveOutputBinding {
3172
3410
  kind: SensitiveOutputKind;
3173
3411
  placeholder: string;
@@ -3715,6 +3953,12 @@ export declare interface ToolContext {
3715
3953
  */
3716
3954
  export declare type ToolDefinition = z.infer<typeof ToolDefinitionSchema>;
3717
3955
 
3956
+ declare interface ToolDefinition_2 {
3957
+ name: string;
3958
+ description: string;
3959
+ input_schema: object;
3960
+ }
3961
+
3718
3962
  /**
3719
3963
  * Schema describing the shape of a {@link ToolDefinition}. All fields are
3720
3964
  * optional — loaders fill documented defaults for omitted fields via
@@ -4060,6 +4304,7 @@ declare const ToolResultEventSchema: z.ZodObject<{
4060
4304
  brave: "brave";
4061
4305
  perplexity: "perplexity";
4062
4306
  tavily: "tavily";
4307
+ firecrawl: "firecrawl";
4063
4308
  }>;
4064
4309
  resultCount: z.ZodNumber;
4065
4310
  durationMs: z.ZodNumber;
@@ -4078,6 +4323,10 @@ declare const ToolResultEventSchema: z.ZodObject<{
4078
4323
  webFetch: z.ZodOptional<z.ZodObject<{
4079
4324
  url: z.ZodString;
4080
4325
  finalUrl: z.ZodString;
4326
+ provider: z.ZodOptional<z.ZodEnum<{
4327
+ default: "default";
4328
+ firecrawl: "firecrawl";
4329
+ }>>;
4081
4330
  status: z.ZodNumber;
4082
4331
  contentType: z.ZodOptional<z.ZodString>;
4083
4332
  byteCount: z.ZodNumber;
@@ -4175,11 +4424,15 @@ declare const TraceEventSchema: z.ZodObject<{
4175
4424
  * - `'trusted_contact'`: The sender is an active contact with a channel
4176
4425
  * (not the guardian). Trusted contacts can invoke tools but require
4177
4426
  * guardian approval for sensitive operations.
4427
+ * - `'unverified_contact'`: The sender matches a contact channel whose
4428
+ * status is `pending` or `unverified` — known to the guardian but not yet
4429
+ * verified. Treated identically to `trusted_contact` for every downstream
4430
+ * capability/tool/approval decision; the distinction is admission-only.
4178
4431
  * - `'unknown'`: The sender has no contact record, no identity could be
4179
- * established, or the sender is an inactive/revoked contact. Unknown
4432
+ * established, or the sender is a blocked/revoked contact. Unknown
4180
4433
  * actors are fail-closed with no escalation path.
4181
4434
  */
4182
- declare type TrustClass = "guardian" | "trusted_contact" | "unknown";
4435
+ declare type TrustClass = "guardian" | "trusted_contact" | "unverified_contact" | "unknown";
4183
4436
 
4184
4437
  declare type TurnProfileAutoRoutedEvent = z.infer<typeof TurnProfileAutoRoutedEventSchema>;
4185
4438
 
@@ -4502,6 +4755,8 @@ declare interface VercelApiConfigResponse {
4502
4755
  declare interface WebFetchMetadata {
4503
4756
  url: string;
4504
4757
  finalUrl: string;
4758
+ /** Provider that served the fetch. Defaults to the built-in fetcher. */
4759
+ provider?: WebFetchProviderId;
4505
4760
  status: number;
4506
4761
  contentType?: string;
4507
4762
  byteCount: number;
@@ -4517,6 +4772,9 @@ declare interface WebFetchMetadata {
4517
4772
  mayRequireJavaScript?: boolean;
4518
4773
  }
4519
4774
 
4775
+ /** Provider that backed a `web_fetch` call. `default` is the built-in fetcher. */
4776
+ declare type WebFetchProviderId = "default" | "firecrawl";
4777
+
4520
4778
  declare interface WebSearchMetadata {
4521
4779
  query: string;
4522
4780
  provider: WebSearchProviderId;
@@ -4527,7 +4785,7 @@ declare interface WebSearchMetadata {
4527
4785
  errorMessage?: string;
4528
4786
  }
4529
4787
 
4530
- declare type WebSearchProviderId = "anthropic-native" | "brave" | "perplexity" | "tavily";
4788
+ declare type WebSearchProviderId = "anthropic-native" | "brave" | "perplexity" | "tavily" | "firecrawl";
4531
4789
 
4532
4790
  declare interface WebSearchResultItem {
4533
4791
  rank: number;
@@ -4554,6 +4812,13 @@ export declare interface WebSearchToolResultContent {
4554
4812
  declare interface WorkflowCompleted {
4555
4813
  type: "workflow_completed";
4556
4814
  runId: string;
4815
+ /**
4816
+ * Originating conversation id, when launched from one; lets `broadcastMessage`
4817
+ * auto-scope + seq-stamp the event to that conversation's SSE stream. Omitted
4818
+ * for a conversationless run (e.g. a scheduled workflow), which broadcasts
4819
+ * unscoped for raw SSE listeners and the DB record.
4820
+ */
4821
+ conversationId?: string;
4557
4822
  status: WorkflowRunStatus;
4558
4823
  agentsSpawned: number;
4559
4824
  inputTokens: number;
@@ -4562,6 +4827,49 @@ declare interface WorkflowCompleted {
4562
4827
  summary?: string;
4563
4828
  }
4564
4829
 
4830
+ /**
4831
+ * A leaf agent within a workflow run has finished. `seq` matches the
4832
+ * corresponding `workflow_leaf_started` event.
4833
+ */
4834
+ declare interface WorkflowLeafFinished {
4835
+ type: "workflow_leaf_finished";
4836
+ runId: string;
4837
+ /**
4838
+ * Originating conversation id; lets `broadcastMessage` auto-scope +
4839
+ * seq-stamp the event to the conversation's SSE stream.
4840
+ */
4841
+ conversationId: string;
4842
+ seq: number;
4843
+ status: "completed" | "failed";
4844
+ /** Leaf label, for client display. */
4845
+ label?: string;
4846
+ inputTokens?: number;
4847
+ outputTokens?: number;
4848
+ /** Short summary of the leaf's result, for client display. */
4849
+ resultSummary?: string;
4850
+ }
4851
+
4852
+ /**
4853
+ * A leaf agent within a workflow run has started. `seq` orders leaves within
4854
+ * the run for stable client-side tree placement.
4855
+ */
4856
+ declare interface WorkflowLeafStarted {
4857
+ type: "workflow_leaf_started";
4858
+ runId: string;
4859
+ /**
4860
+ * Originating conversation id; lets `broadcastMessage` auto-scope +
4861
+ * seq-stamp the event to the conversation's SSE stream.
4862
+ */
4863
+ conversationId: string;
4864
+ seq: number;
4865
+ /** Leaf label, for client display. */
4866
+ label?: string;
4867
+ /** Phase the leaf belongs to, when the workflow declares phases. */
4868
+ phase?: string;
4869
+ /** Short summary of the leaf's prompt, for client display. */
4870
+ promptSummary?: string;
4871
+ }
4872
+
4565
4873
  /**
4566
4874
  * Progress push for an in-flight workflow run. Maps the engine's
4567
4875
  * `onProgress` (`phase`/`log`) callback plus the current usage snapshot into a
@@ -4571,6 +4879,13 @@ declare interface WorkflowCompleted {
4571
4879
  declare interface WorkflowProgress {
4572
4880
  type: "workflow_progress";
4573
4881
  runId: string;
4882
+ /**
4883
+ * Originating conversation id, when launched from one; lets `broadcastMessage`
4884
+ * auto-scope + seq-stamp the event to that conversation's SSE stream. Omitted
4885
+ * for a conversationless run (e.g. a scheduled workflow), which broadcasts
4886
+ * unscoped for raw SSE listeners and the DB record.
4887
+ */
4888
+ conversationId?: string;
4574
4889
  /** Latest phase title, when this emission came from a `phase(...)` call. */
4575
4890
  phase?: string;
4576
4891
  /** Run label (the workflow's `meta.name`), for client display. */
@@ -4598,7 +4913,27 @@ declare interface WorkflowProgress {
4598
4913
  */
4599
4914
  declare type WorkflowRunStatus = "running" | "completed" | "failed" | "aborted" | "cap_exceeded" | "interrupted";
4600
4915
 
4601
- declare type _WorkflowsServerMessages = WorkflowProgress | WorkflowCompleted;
4916
+ declare type _WorkflowsServerMessages = WorkflowProgress | WorkflowCompleted | WorkflowStarted | WorkflowLeafStarted | WorkflowLeafFinished;
4917
+
4918
+ /**
4919
+ * A workflow run has started. Emitted once at launch, before any leaf events.
4920
+ */
4921
+ declare interface WorkflowStarted {
4922
+ type: "workflow_started";
4923
+ runId: string;
4924
+ /**
4925
+ * Originating conversation id; lets `broadcastMessage` auto-scope +
4926
+ * seq-stamp the event to the conversation's SSE stream.
4927
+ */
4928
+ conversationId: string;
4929
+ /**
4930
+ * Tool-use id of the `skill_execute` block that launched this run, for
4931
+ * anchoring the inline workflow card to the exact spawn tool call.
4932
+ */
4933
+ toolUseId?: string;
4934
+ /** Run label (the workflow's `meta.name`), for client display. */
4935
+ label?: string;
4936
+ }
4602
4937
 
4603
4938
  declare interface WorkItemApprovePermissionsResponse {
4604
4939
  type: "work_item_approve_permissions_response";
package/index.js CHANGED
@@ -3,4 +3,6 @@ const api = globalThis[Symbol.for("vellum.plugin-api")] ?? {};
3
3
  export const HOOKS = api.HOOKS;
4
4
  export const RiskLevel = api.RiskLevel;
5
5
  export const assistantEventHub = api.assistantEventHub;
6
+ export const getConfiguredProvider = api.getConfiguredProvider;
7
+ export const getModelProfiles = api.getModelProfiles;
6
8
  export const getSecureKeyAsync = api.getSecureKeyAsync;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vellumai/plugin-api",
3
- "version": "0.9.0",
3
+ "version": "0.10.0-staging.1",
4
4
  "description": "Public TypeScript authoring contract for Vellum assistant plugins.",
5
5
  "license": "MIT",
6
6
  "type": "module",