@vellumai/plugin-api 0.10.5-dev.202607042025.8a04d0b → 0.10.5-staging.2

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 +43 -145
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -533,30 +533,6 @@ declare interface BaseAssistantEvent<TMessage = unknown> {
533
533
  message: TMessage;
534
534
  }
535
535
 
536
- /**
537
- * Capabilities shared by every chain-hook context (`user-prompt-submit`,
538
- * `post-compact`, `post-tool-use`, `stop`, `pre-model-call`,
539
- * `post-model-call`).
540
- *
541
- * Both are stamped onto each hook's draft by the pipeline (`runHook`) before
542
- * the hook runs, bound to that hook's identity — dispatching call sites
543
- * construct the `XInputContext` shapes and never supply these.
544
- */
545
- declare interface BaseHookContext {
546
- /**
547
- * Logger bound to the emitting hook — pre-tagged with the hook name and
548
- * owning plugin (plus `conversationId` / `requestId` when the dispatching
549
- * context carries them), so hook log lines are attributed without manual
550
- * tagging.
551
- */
552
- readonly logger: PluginLogger;
553
- /**
554
- * Per-hook `hook_event` emitter, bound to this hook's owner — see
555
- * {@link HookBroadcast}.
556
- */
557
- readonly broadcast: HookBroadcast;
558
- }
559
-
560
536
  declare interface BaseSubscriberEntry {
561
537
  filter: AssistantEventFilter;
562
538
  callback: AssistantEventCallback;
@@ -1851,36 +1827,6 @@ declare const HomeFeedUpdatedEventSchema: z.ZodObject<{
1851
1827
 
1852
1828
  declare type _HomeServerMessages = RelationshipStateUpdatedEvent | HomeFeedUpdatedEvent;
1853
1829
 
1854
- /**
1855
- * Emit a `hook_event` to any UI watching the conversation the hook runs in —
1856
- * e.g. progress while the hook does work the user can feel (memory
1857
- * selection). The daemon stamps the conversation, the hook name, and the
1858
- * emitting hook's owner; the hook supplies only `detail`, an arbitrary
1859
- * JSON-serializable record whose shape it and its client renderer agree on.
1860
- *
1861
- * Best-effort and fire-and-forget: it never blocks or fails the turn, and
1862
- * cannot emit any other event type or target another conversation — the emit
1863
- * surface is bound to the turn. Contexts without a `conversationId` emit an
1864
- * unscoped `hook_event`.
1865
- */
1866
- export declare type HookBroadcast = (detail: Record<string, unknown>) => void;
1867
-
1868
- declare type HookEvent = z.infer<typeof HookEventSchema>;
1869
-
1870
- declare const HookEventSchema: z.ZodObject<{
1871
- type: z.ZodLiteral<"hook_event">;
1872
- conversationId: z.ZodOptional<z.ZodString>;
1873
- hookName: z.ZodString;
1874
- owner: z.ZodObject<{
1875
- kind: z.ZodEnum<{
1876
- plugin: "plugin";
1877
- workspace: "workspace";
1878
- }>;
1879
- id: z.ZodString;
1880
- }, z.core.$strip>;
1881
- detail: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1882
- }, z.core.$strip>;
1883
-
1884
1830
  /**
1885
1831
  * A plugin lifecycle hook. Receives a per-lifecycle context shape and may
1886
1832
  * either mutate `ctx` in place (returning `void`) or return a *partial*
@@ -1900,7 +1846,6 @@ declare const HookEventSchema: z.ZodObject<{
1900
1846
  * - `init` — {@link InitContext}
1901
1847
  * - `shutdown` — {@link ShutdownContext}
1902
1848
  * - `user-prompt-submit` — {@link UserPromptSubmitContext}
1903
- * - `post-compact` — {@link PostCompactContext}
1904
1849
  * - `pre-model-call` — {@link PreModelCallContext}
1905
1850
  * - `post-tool-use` — {@link PostToolUseContext}
1906
1851
  * - `stop` — {@link StopContext}
@@ -2721,7 +2666,6 @@ declare const OpenPanelEventSchema: z.ZodObject<{
2721
2666
  panelType: z.ZodString;
2722
2667
  data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2723
2668
  conversationId: z.ZodOptional<z.ZodString>;
2724
- surfaceId: z.ZodOptional<z.ZodString>;
2725
2669
  }, z.core.$strip>;
2726
2670
 
2727
2671
  declare type OpenUrlEvent = z.infer<typeof OpenUrlEventSchema>;
@@ -2795,14 +2739,6 @@ declare interface PongMessage {
2795
2739
  type: "pong";
2796
2740
  }
2797
2741
 
2798
- /**
2799
- * The full `post-compact` context a hook receives — the dispatching call
2800
- * site's {@link PostCompactInputContext} plus the pipeline-stamped
2801
- * {@link BaseHookContext} capabilities.
2802
- */
2803
- export declare interface PostCompactContext extends PostCompactInputContext, BaseHookContext {
2804
- }
2805
-
2806
2742
  /**
2807
2743
  * Context passed to the `post-compact` hook. Fires after the agent loop
2808
2744
  * compacts a conversation mid-turn — once the running history has been
@@ -2817,12 +2753,12 @@ export declare interface PostCompactContext extends PostCompactInputContext, Bas
2817
2753
  * their own injected context the same way.
2818
2754
  *
2819
2755
  * The hook re-injects by mutating `history` in place (or returning a new
2820
- * context with a replacement `history`) — see `HookFunction`'s
2756
+ * context with a replacement `history`) — see {@link HookFunction}'s
2821
2757
  * polymorphic return shape. The agent loop reads the settled `history` back off
2822
2758
  * the context and resumes the turn from it. Multiple plugins' hooks chain in
2823
2759
  * registration order, each seeing the previous plugin's edits.
2824
2760
  */
2825
- declare interface PostCompactInputContext {
2761
+ export declare interface PostCompactContext {
2826
2762
  /**
2827
2763
  * The compacted message history to re-inject onto. Hooks mutate this in
2828
2764
  * place (or return a new context with a replacement) to re-apply context
@@ -2861,28 +2797,6 @@ declare interface PostCompactInputContext {
2861
2797
  readonly injectionMode?: "full" | "minimal";
2862
2798
  }
2863
2799
 
2864
- /**
2865
- * The full `post-model-call` context a hook receives — the dispatching call
2866
- * site's {@link PostModelCallInputContext} plus the pipeline-stamped
2867
- * {@link BaseHookContext} capabilities.
2868
- */
2869
- export declare interface PostModelCallContext extends PostModelCallInputContext, BaseHookContext {
2870
- }
2871
-
2872
- /**
2873
- * Binary outcome of the `post-model-call` hook. The agent loop seeds it to
2874
- * `"stop"` and acts on the value the chain settles on:
2875
- *
2876
- * - `"stop"` — accept the model-call outcome. On a finalized reply the loop
2877
- * keeps the (possibly transformed) message; on a rejection it
2878
- * surfaces the error. This is the default.
2879
- * - `"continue"` — re-query the model. The hook is responsible for leaving
2880
- * {@link PostModelCallContext.messages} as the history the next
2881
- * iteration should send (append a follow-up turn, or replace
2882
- * the array with a repaired one).
2883
- */
2884
- export declare type PostModelCallDecision = "continue" | "stop";
2885
-
2886
2800
  /**
2887
2801
  * Context passed to the `post-model-call` hook. Fires at every model-call
2888
2802
  * outcome — the seam where the loop reacts to what the provider returned:
@@ -2914,7 +2828,7 @@ export declare type PostModelCallDecision = "continue" | "stop";
2914
2828
  * the outcome is treated as `"stop"`). Multiple plugins' hooks chain in
2915
2829
  * registration order — each sees the previous hook's `decision` and mutations.
2916
2830
  */
2917
- declare interface PostModelCallInputContext {
2831
+ export declare interface PostModelCallContext {
2918
2832
  /** Conversation ID the message belongs to. */
2919
2833
  readonly conversationId: string;
2920
2834
  /** The call site this message serves — `"mainAgent"` for the user-facing reply; `null` when untagged. */
@@ -2957,15 +2871,23 @@ declare interface PostModelCallInputContext {
2957
2871
  * actionable outcomes (see the interface docstring).
2958
2872
  */
2959
2873
  decision: PostModelCallDecision;
2874
+ /** Logger scoped to the current turn (tag structured fields with `{ plugin }`). */
2875
+ readonly logger: PluginLogger;
2960
2876
  }
2961
2877
 
2962
2878
  /**
2963
- * The full `post-tool-use` context a hook receives the dispatching call
2964
- * site's {@link PostToolUseInputContext} plus the pipeline-stamped
2965
- * {@link BaseHookContext} capabilities.
2879
+ * Binary outcome of the `post-model-call` hook. The agent loop seeds it to
2880
+ * `"stop"` and acts on the value the chain settles on:
2881
+ *
2882
+ * - `"stop"` — accept the model-call outcome. On a finalized reply the loop
2883
+ * keeps the (possibly transformed) message; on a rejection it
2884
+ * surfaces the error. This is the default.
2885
+ * - `"continue"` — re-query the model. The hook is responsible for leaving
2886
+ * {@link PostModelCallContext.messages} as the history the next
2887
+ * iteration should send (append a follow-up turn, or replace
2888
+ * the array with a repaired one).
2966
2889
  */
2967
- export declare interface PostToolUseContext extends PostToolUseInputContext, BaseHookContext {
2968
- }
2890
+ export declare type PostModelCallDecision = "continue" | "stop";
2969
2891
 
2970
2892
  /**
2971
2893
  * Context passed to the `post-tool-use` hook. Fires once per tool result —
@@ -2975,7 +2897,7 @@ export declare interface PostToolUseContext extends PostToolUseInputContext, Bas
2975
2897
  *
2976
2898
  * The hook may transform the result either by mutating `toolResponse` in
2977
2899
  * place (e.g. reassigning `toolResponse.content`) or by returning a new
2978
- * context with a fresh `toolResponse` — see `HookFunction`'s
2900
+ * context with a fresh `toolResponse` — see {@link HookFunction}'s
2979
2901
  * polymorphic return shape. The daemon threads the final `toolResponse`
2980
2902
  * into the provider-bound history.
2981
2903
  *
@@ -2987,7 +2909,7 @@ export declare interface PostToolUseContext extends PostToolUseInputContext, Bas
2987
2909
  * can swap in a smarter strategy (e.g. a summarizer) or observe results for
2988
2910
  * side effects.
2989
2911
  */
2990
- declare interface PostToolUseInputContext {
2912
+ export declare interface PostToolUseContext {
2991
2913
  /** Conversation ID the tool ran on. */
2992
2914
  readonly conversationId: string;
2993
2915
  /**
@@ -3047,14 +2969,12 @@ declare interface PostToolUseInputContext {
3047
2969
  * receiving a precomputed limit.
3048
2970
  */
3049
2971
  readonly maxInputTokens: number;
3050
- }
3051
-
3052
- /**
3053
- * The full `pre-model-call` context a hook receives — the dispatching call
3054
- * site's {@link PreModelCallInputContext} plus the pipeline-stamped
3055
- * {@link BaseHookContext} capabilities.
3056
- */
3057
- export declare interface PreModelCallContext extends PreModelCallInputContext, BaseHookContext {
2972
+ /**
2973
+ * Logger scoped to the current turn. The same instance is shared by
2974
+ * every hook in the chain, so plugins should tag their structured log
2975
+ * fields (e.g. `{ plugin: "<name>" }`) for attribution.
2976
+ */
2977
+ readonly logger: PluginLogger;
3058
2978
  }
3059
2979
 
3060
2980
  /**
@@ -3070,7 +2990,7 @@ export declare interface PreModelCallContext extends PreModelCallInputContext, B
3070
2990
  * Mutate the context in place or return a new one; throwing is contained by the
3071
2991
  * loop (the call proceeds with the original request).
3072
2992
  */
3073
- declare interface PreModelCallInputContext {
2993
+ export declare interface PreModelCallContext {
3074
2994
  /** Conversation ID the call belongs to. */
3075
2995
  readonly conversationId: string;
3076
2996
  /**
@@ -3109,6 +3029,8 @@ declare interface PreModelCallInputContext {
3109
3029
  * redaction that needs the full message — instead of leaking the raw stream.
3110
3030
  */
3111
3031
  deferAssistantOutput: boolean;
3032
+ /** Logger scoped to the current turn (tag structured fields with `{ plugin }`). */
3033
+ readonly logger: PluginLogger;
3112
3034
  }
3113
3035
 
3114
3036
  declare interface ProcessEntry extends BaseSubscriberEntry {
@@ -3412,14 +3334,6 @@ declare interface SecretPromptResult {
3412
3334
  delivery: SecretDelivery;
3413
3335
  /** When set, the prompt could not be delivered and the value is null due to a delivery failure (not user cancellation). */
3414
3336
  error?: "unsupported_channel";
3415
- /**
3416
- * Why `value` is null. `"cancelled"` = the user explicitly dismissed the
3417
- * prompt (a valid flow, not a failure); `"timed_out"` = no response within
3418
- * the permission-timeout window. Only meaningful when `value` is null and
3419
- * `error` is unset. Lets callers distinguish a deliberate cancel from a
3420
- * genuine failure instead of treating both as an error.
3421
- */
3422
- reason?: "cancelled" | "timed_out";
3423
3337
  }
3424
3338
 
3425
3339
  declare type SecretRequestEvent = z.infer<typeof SecretRequestEventSchema>;
@@ -3537,7 +3451,7 @@ declare interface SensitiveOutputBinding {
3537
3451
 
3538
3452
  declare type SensitiveOutputKind = "invite_code";
3539
3453
 
3540
- declare type ServerMessage = _ConversationsServerMessages | _MessagesServerMessages | _SurfacesServerMessages | _SkillsServerMessages | _AppsServerMessages | _IntegrationsServerMessages | _ComputerUseServerMessages | _ContactsServerMessages | _WorkItemsServerMessages | _SubagentsServerMessages | _DocumentsServerMessages | _DocumentCommentsServerMessages | _GuardianActionsServerMessages | _SyncInvalidationServerMessages | _HomeServerMessages | _HostAppControlServerMessages | _HostBashServerMessages | _HostBrowserServerMessages | _HostCuServerMessages | _HostFileServerMessages | _HostTransferServerMessages | _MemoryServerMessages | _WorkspaceServerMessages | _SchedulesServerMessages | _SettingsServerMessages | _DiagnosticsServerMessages | _InboxServerMessages | _NotificationsServerMessages | _UpgradesServerMessages | _AcpServerMessages | _BackgroundToolsServerMessages | _BookmarksServerMessages | _WorkflowsServerMessages | DiskPressureStatusChangedEvent | HookEvent | SubagentEvent;
3454
+ declare type ServerMessage = _ConversationsServerMessages | _MessagesServerMessages | _SurfacesServerMessages | _SkillsServerMessages | _AppsServerMessages | _IntegrationsServerMessages | _ComputerUseServerMessages | _ContactsServerMessages | _WorkItemsServerMessages | _SubagentsServerMessages | _DocumentsServerMessages | _DocumentCommentsServerMessages | _GuardianActionsServerMessages | _SyncInvalidationServerMessages | _HomeServerMessages | _HostAppControlServerMessages | _HostBashServerMessages | _HostBrowserServerMessages | _HostCuServerMessages | _HostFileServerMessages | _HostTransferServerMessages | _MemoryServerMessages | _WorkspaceServerMessages | _SchedulesServerMessages | _SettingsServerMessages | _DiagnosticsServerMessages | _InboxServerMessages | _NotificationsServerMessages | _UpgradesServerMessages | _AcpServerMessages | _BackgroundToolsServerMessages | _BookmarksServerMessages | _WorkflowsServerMessages | DiskPressureStatusChangedEvent | SubagentEvent;
3541
3455
 
3542
3456
  export declare interface ServerToolUseContent {
3543
3457
  type: "server_tool_use";
@@ -3758,14 +3672,6 @@ declare interface SoundsConfigUpdated {
3758
3672
  type: "sounds_config_updated";
3759
3673
  }
3760
3674
 
3761
- /**
3762
- * The full `stop` context a hook receives — the dispatching call site's
3763
- * {@link StopInputContext} plus the pipeline-stamped {@link BaseHookContext}
3764
- * capabilities.
3765
- */
3766
- export declare interface StopContext extends StopInputContext, BaseHookContext {
3767
- }
3768
-
3769
3675
  /**
3770
3676
  * Context passed to the `stop` hook — the loop's definitive terminal hook.
3771
3677
  *
@@ -3786,7 +3692,7 @@ export declare interface StopContext extends StopInputContext, BaseHookContext {
3786
3692
  *
3787
3693
  * Multiple plugins' hooks chain in registration order over the same context.
3788
3694
  */
3789
- declare interface StopInputContext {
3695
+ export declare interface StopContext {
3790
3696
  /** Conversation ID the run belongs to. */
3791
3697
  readonly conversationId: string;
3792
3698
  /**
@@ -3809,6 +3715,12 @@ declare interface StopInputContext {
3809
3715
  * control transfer that re-enters the loop and so never reaches this hook.
3810
3716
  */
3811
3717
  readonly exitReason: AgentLoopExitReason;
3718
+ /**
3719
+ * Logger scoped to the current turn. The same instance is shared by
3720
+ * every hook in the chain, so plugins should tag their structured log
3721
+ * fields (e.g. `{ plugin: "<name>" }`) for attribution.
3722
+ */
3723
+ readonly logger: PluginLogger;
3812
3724
  }
3813
3725
 
3814
3726
  declare interface SubagentDetailResponse {
@@ -4915,14 +4827,6 @@ declare const UserMessageEchoEventSchema: z.ZodObject<{
4915
4827
  clientMessageId: z.ZodOptional<z.ZodString>;
4916
4828
  }, z.core.$strict>;
4917
4829
 
4918
- /**
4919
- * The full `user-prompt-submit` context a hook receives — the dispatching
4920
- * call site's {@link UserPromptSubmitInputContext} plus the pipeline-stamped
4921
- * {@link BaseHookContext} capabilities.
4922
- */
4923
- export declare interface UserPromptSubmitContext extends UserPromptSubmitInputContext, BaseHookContext {
4924
- }
4925
-
4926
4830
  /**
4927
4831
  * Context passed to the `user-prompt-submit` hook. Fires once per user
4928
4832
  * turn, after the agent loop has prepared the message list (PKB / NOW /
@@ -4932,7 +4836,7 @@ export declare interface UserPromptSubmitContext extends UserPromptSubmitInputCo
4932
4836
  *
4933
4837
  * The hook may transform `latestMessages` either by mutating it in place
4934
4838
  * (`push` / `splice` / `length = 0`) or by returning a new context with
4935
- * a fresh `latestMessages` array — see `HookFunction`'s polymorphic
4839
+ * a fresh `latestMessages` array — see {@link HookFunction}'s polymorphic
4936
4840
  * return shape. The daemon threads the final `latestMessages` value into
4937
4841
  * `agentLoop.run()` as the run-messages argument.
4938
4842
  *
@@ -4945,7 +4849,7 @@ export declare interface UserPromptSubmitContext extends UserPromptSubmitInputCo
4945
4849
  * hook sees the previous plugin's mutations (whether by reassignment or
4946
4850
  * in-place mutation).
4947
4851
  */
4948
- declare interface UserPromptSubmitInputContext {
4852
+ export declare interface UserPromptSubmitContext {
4949
4853
  /** Conversation ID the user prompt was submitted on. */
4950
4854
  readonly conversationId: string;
4951
4855
  /**
@@ -4953,14 +4857,6 @@ declare interface UserPromptSubmitInputContext {
4953
4857
  * attach turn-scoped metadata to the originating message (e.g. recording an
4954
4858
  * injected memory block so it survives a conversation reload) key off this
4955
4859
  * row id rather than the in-memory message arrays, whose entries carry no id.
4956
- *
4957
- * @deprecated This field is always identical to {@link requestId}; use
4958
- * `requestId` instead. Every path that starts an agent loop persists the
4959
- * triggering user message under the turn's request ID before running, so
4960
- * the message row id and the request's correlation ID are the same UUID.
4961
- * This holds for the standard submit, queue-drain, subagent, voice, wake,
4962
- * and conversation-analysis paths alike. This field will be removed in a
4963
- * future API version.
4964
4860
  */
4965
4861
  readonly userMessageId: string;
4966
4862
  /**
@@ -4968,10 +4864,6 @@ declare interface UserPromptSubmitInputContext {
4968
4864
  * runtime injection forward it onto the injector turn context so the
4969
4865
  * assembled blocks are attributed to the originating request; it is fixed
4970
4866
  * for the turn and cannot be recovered from the message arrays.
4971
- *
4972
- * As of the requestId/userMessageId merge, this value is also the
4973
- * persisted row ID of the user message, so hooks that previously
4974
- * keyed off {@link userMessageId} can use `requestId` directly.
4975
4867
  */
4976
4868
  readonly requestId: string;
4977
4869
  /**
@@ -5019,6 +4911,12 @@ declare interface UserPromptSubmitInputContext {
5019
4911
  * may mutate this in place or replace it by returning a new context.
5020
4912
  */
5021
4913
  latestMessages: Message[];
4914
+ /**
4915
+ * Logger scoped to the current turn. The same instance is shared by
4916
+ * every hook in the chain, so plugins should tag their structured log
4917
+ * fields (e.g. `{ plugin: "<name>" }`) for attribution.
4918
+ */
4919
+ readonly logger: PluginLogger;
5022
4920
  }
5023
4921
 
5024
4922
  declare interface VellumSlimSkill extends SlimSkillBase {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vellumai/plugin-api",
3
- "version": "0.10.5-dev.202607042025.8a04d0b",
3
+ "version": "0.10.5-staging.2",
4
4
  "description": "Public TypeScript authoring contract for Vellum assistant plugins.",
5
5
  "license": "MIT",
6
6
  "type": "module",