@vellumai/plugin-api 0.10.3 → 0.10.4-dev.202607010028.1a4efcc

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 +221 -232
  2. package/index.js +1 -0
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
 
3
- declare type _AcpServerMessages = AcpSessionSpawned | AcpSessionUpdate | AcpSessionCompleted | AcpSessionError;
3
+ declare type _AcpServerMessages = AcpSessionSpawned | AcpSessionUpdate | AcpSessionCompleted | AcpSessionError | AcpSessionUsage;
4
4
 
5
5
  declare interface AcpSessionCompleted {
6
6
  type: "acp_session_completed";
@@ -19,6 +19,10 @@ declare interface AcpSessionSpawned {
19
19
  acpSessionId: string;
20
20
  agent: string;
21
21
  parentConversationId: string;
22
+ /** Tool-use id of the `acp_spawn` call that spawned this session. */
23
+ parentToolUseId?: string;
24
+ /** Objective text for the spawned session. */
25
+ task?: string;
22
26
  }
23
27
 
24
28
  declare interface AcpSessionUpdate {
@@ -30,6 +34,30 @@ declare interface AcpSessionUpdate {
30
34
  toolTitle?: string;
31
35
  toolKind?: string;
32
36
  toolStatus?: string;
37
+ /** Optional raw input parameters sent to the tool (ACP `rawInput`); shape is tool-specific. */
38
+ rawInput?: unknown;
39
+ /** Optional raw output returned by the tool (ACP `rawOutput`); shape is tool-specific. */
40
+ rawOutput?: unknown;
41
+ /** Files touched by this tool call (for the file-diff affordance). */
42
+ locations?: {
43
+ path: string;
44
+ line?: number;
45
+ }[];
46
+ /** Stable id for the message this chunk belongs to. */
47
+ messageId?: string;
48
+ /** Monotonic ordering hint within the session. */
49
+ seq?: number;
50
+ }
51
+
52
+ declare interface AcpSessionUsage {
53
+ type: "acp_session_usage";
54
+ acpSessionId: string;
55
+ usedTokens: number;
56
+ contextSize: number;
57
+ costAmount?: number;
58
+ costCurrency?: string;
59
+ inputTokens?: number;
60
+ outputTokens?: number;
33
61
  }
34
62
 
35
63
  /**
@@ -224,47 +252,7 @@ declare interface AssistantAttention {
224
252
  }
225
253
 
226
254
  /** Daemon-side specialization of the generic event envelope. */
227
- export declare type AssistantEvent = AssistantEvent_2<ServerMessage>;
228
-
229
- /**
230
- * Assistant Events -- shared types and SSE framing helpers.
231
- *
232
- * This module is intentionally free of imports from `assistant/` or any
233
- * other repo-local module so it can be consumed by both the daemon and
234
- * isolated skill processes without circular references.
235
- *
236
- * The `AssistantEvent` interface is generic over the `message` payload so
237
- * the neutral package does not need to know about the daemon-side
238
- * `ServerMessage` discriminated union. Consumers that want narrower
239
- * typing can re-export a specialized alias, e.g.:
240
- *
241
- * type AssistantEvent = BaseAssistantEvent<ServerMessage>;
242
- */
243
- /**
244
- * A single assistant event wrapping an outbound message payload.
245
- *
246
- * Generic over the payload type so the neutral package has zero dependency
247
- * on daemon-side message schemas. The `TMessage` default of `unknown`
248
- * keeps the package importable without a type argument when the caller
249
- * does not care about message narrowing.
250
- */
251
- declare interface AssistantEvent_2<TMessage = unknown> {
252
- /** Globally unique event identifier (UUID). */
253
- id: string;
254
- /** Resolved conversation id when available. */
255
- conversationId?: string;
256
- /**
257
- * Monotonic per-conversation sequence number. Assigned by the daemon at
258
- * publish time for conversation-scoped events; absent for unscoped
259
- * broadcasts. Clients track the highest observed `seq` per conversation
260
- * and pass it back on reconnect to request replay of missed events.
261
- */
262
- seq?: number;
263
- /** ISO-8601 timestamp of when the event was emitted. */
264
- emittedAt: string;
265
- /** Outbound message payload. */
266
- message: TMessage;
267
- }
255
+ export declare type AssistantEvent = BaseAssistantEvent<ServerMessage>;
268
256
 
269
257
  export declare type AssistantEventCallback = (event: AssistantEvent) => void | Promise<void>;
270
258
 
@@ -403,12 +391,8 @@ export declare class AssistantEventHub {
403
391
  hasCapacity(): boolean;
404
392
  }
405
393
 
406
- /**
407
- * Singleton hub shared across the entire runtime process.
408
- *
409
- * Import and use this in daemon send paths and the SSE route.
410
- */
411
- export declare const assistantEventHub: AssistantEventHub;
394
+ /** The plugin-facing event hub. See module docs. */
395
+ export declare const assistantEventHub: PluginEventHub;
412
396
 
413
397
  /** Opaque handle returned by `subscribe`. Call `dispose()` to remove the subscription. */
414
398
  export declare interface AssistantEventSubscription {
@@ -448,6 +432,15 @@ declare interface AssistantInboxEscalationResponse {
448
432
  };
449
433
  }
450
434
 
435
+ /**
436
+ * Managed skill authored by the assistant's retrospective. Identical shape to a
437
+ * custom skill — it stays managed/deletable — but carries a distinct origin so
438
+ * the UI badges it as "Assistant's Memory" instead of "Custom".
439
+ */
440
+ declare interface AssistantMemorySlimSkill extends SlimSkillBase {
441
+ origin: "assistant-memory";
442
+ }
443
+
451
444
  declare interface AssistantStatusMessage {
452
445
  type: "assistant_status";
453
446
  version?: string;
@@ -494,6 +487,52 @@ declare const AvatarUpdatedEventSchema: z.ZodObject<{
494
487
  avatarPath: z.ZodString;
495
488
  }, z.core.$strip>;
496
489
 
490
+ declare interface BackgroundToolCompleted {
491
+ type: "background_tool_completed";
492
+ id: string;
493
+ conversationId: string;
494
+ status: "completed" | "failed" | "cancelled";
495
+ exitCode?: number | null;
496
+ output?: string;
497
+ completedAt: number;
498
+ }
499
+
500
+ declare type _BackgroundToolsServerMessages = BackgroundToolStarted | BackgroundToolCompleted;
501
+
502
+ declare interface BackgroundToolStarted {
503
+ type: "background_tool_started";
504
+ id: string;
505
+ toolName: string;
506
+ conversationId: string;
507
+ command: string;
508
+ startedAt: number;
509
+ }
510
+
511
+ /**
512
+ * A single assistant event wrapping an outbound message payload.
513
+ *
514
+ * Generic over the payload type. The `TMessage` default of `unknown` keeps
515
+ * the envelope nameable without a type argument when the caller does not
516
+ * care about message narrowing.
517
+ */
518
+ declare interface BaseAssistantEvent<TMessage = unknown> {
519
+ /** Globally unique event identifier (UUID). */
520
+ id: string;
521
+ /** Resolved conversation id when available. */
522
+ conversationId?: string;
523
+ /**
524
+ * Monotonic per-conversation sequence number. Assigned by the daemon at
525
+ * publish time for conversation-scoped events; absent for unscoped
526
+ * broadcasts. Clients track the highest observed `seq` per conversation
527
+ * and pass it back on reconnect to request replay of missed events.
528
+ */
529
+ seq?: number;
530
+ /** ISO-8601 timestamp of when the event was emitted. */
531
+ emittedAt: string;
532
+ /** Outbound message payload. */
533
+ message: TMessage;
534
+ }
535
+
497
536
  declare interface BaseSubscriberEntry {
498
537
  filter: AssistantEventFilter;
499
538
  callback: AssistantEventCallback;
@@ -972,7 +1011,6 @@ declare const ConversationErrorEventSchema: z.ZodObject<{
972
1011
  CONVERSATION_ABORTED: "CONVERSATION_ABORTED";
973
1012
  CONVERSATION_PROCESSING_FAILED: "CONVERSATION_PROCESSING_FAILED";
974
1013
  DISK_SPACE_CRITICAL: "DISK_SPACE_CRITICAL";
975
- REGENERATE_FAILED: "REGENERATE_FAILED";
976
1014
  UNKNOWN: "UNKNOWN";
977
1015
  }>;
978
1016
  userMessage: z.ZodString;
@@ -1083,7 +1121,6 @@ declare const ConversationNoticeEventSchema: z.ZodObject<{
1083
1121
  CONVERSATION_ABORTED: "CONVERSATION_ABORTED";
1084
1122
  CONVERSATION_PROCESSING_FAILED: "CONVERSATION_PROCESSING_FAILED";
1085
1123
  DISK_SPACE_CRITICAL: "DISK_SPACE_CRITICAL";
1086
- REGENERATE_FAILED: "REGENERATE_FAILED";
1087
1124
  UNKNOWN: "UNKNOWN";
1088
1125
  }>;
1089
1126
  userMessage: z.ZodString;
@@ -1163,9 +1200,9 @@ declare const DiskPressureStatusChangedEventSchema: z.ZodObject<{
1163
1200
  status: z.ZodObject<{
1164
1201
  enabled: z.ZodBoolean;
1165
1202
  state: z.ZodEnum<{
1166
- ok: "ok";
1167
1203
  unknown: "unknown";
1168
1204
  disabled: "disabled";
1205
+ ok: "ok";
1169
1206
  warning: "warning";
1170
1207
  critical: "critical";
1171
1208
  }>;
@@ -1353,27 +1390,26 @@ declare const ErrorEventSchema: z.ZodObject<{
1353
1390
  }, z.core.$strip>;
1354
1391
 
1355
1392
  /**
1356
- * Tool-related type declarations shared between the daemon and any
1357
- * skill-side package that needs to describe tools, permission risk, or tool
1358
- * execution results on the wire.
1393
+ * Tool-related type declarations: the neutral leaf module describing
1394
+ * tools, permission risk, and tool execution results.
1359
1395
  *
1360
- * Pure type-level declarations only (+ the `RiskLevel` enum, which is a value
1361
- * but is safely cross-package). No runtime helpers live here — the assistant
1362
- * keeps all behavior functions in `assistant/src/tools/` and re-exports the
1363
- * types from this file.
1396
+ * Pure type-level declarations only (+ the `RiskLevel` enum, which is a
1397
+ * value). No runtime helpers live here — the assistant keeps all behavior
1398
+ * functions in `assistant/src/tools/` and re-exports the types from this
1399
+ * file. This module imports nothing, so it can sit at the bottom of the
1400
+ * import graph and be consumed by `tools/types.ts`, `providers/types.ts`,
1401
+ * and `permissions/types.ts` without creating cycles.
1364
1402
  *
1365
1403
  * Heavy daemon-internal references (CES client, host-proxy classes, trust
1366
1404
  * classifications, interface IDs, content blocks, CES `ApprovalRequired`)
1367
- * are held as opaque `unknown` / broadened-`string` placeholders on this
1368
- * side so the contracts package never reaches into the assistant or the
1369
- * service-contracts runtime. The assistant redeclares `Tool`, `ToolContext`,
1370
- * `ToolExecutionResult`, `ToolExecutedEvent`, `ToolLifecycleEvent`,
1371
- * `ToolLifecycleEventHandler`, and `ProxyToolResolver` in
1372
- * `assistant/src/tools/types.ts` with the concrete types in place, so
1373
- * existing call sites keep their full type information. The two sides are
1374
- * structurally independent — no inheritance, no intersection — which
1375
- * avoids TypeScript's contravariance mismatches on lifecycle-event
1376
- * handlers.
1405
+ * are held as opaque `unknown` / broadened-`string` placeholders here. The
1406
+ * assistant redeclares `Tool`, `ToolContext`, `ToolExecutionResult`,
1407
+ * `ToolExecutedEvent`, `ToolLifecycleEvent`, `ToolLifecycleEventHandler`,
1408
+ * and `ProxyToolResolver` in `assistant/src/tools/types.ts` with the
1409
+ * concrete types in place, so existing call sites keep their full type
1410
+ * information. The two sides are structurally independent — no inheritance,
1411
+ * no intersection which avoids TypeScript's contravariance mismatches on
1412
+ * lifecycle-event handlers.
1377
1413
  */
1378
1414
  declare type ExecutionTarget = "sandbox" | "host";
1379
1415
 
@@ -1491,6 +1527,8 @@ declare interface FormSurfaceData {
1491
1527
  back?: string;
1492
1528
  submit?: string;
1493
1529
  };
1530
+ /** Progress indicator style for multi-page forms: segment bar or labeled tabs. */
1531
+ progressStyle?: "bar" | "tabs";
1494
1532
  }
1495
1533
 
1496
1534
  /** Response to a generate_avatar request indicating success or failure. */
@@ -2169,13 +2207,23 @@ declare interface IngressConfigResponse {
2169
2207
  * Context passed to `Plugin.init()` during bootstrap. Carries the resolved
2170
2208
  * config, a pino-compatible logger scoped to the plugin, a per-plugin
2171
2209
  * writable data directory, and the assistant's version metadata.
2210
+ *
2211
+ * For user-installed plugins, config is read from `<pluginDir>/config.json`
2212
+ * and `pluginStorageDir` points at `<pluginDir>/data/`. For first-party
2213
+ * default plugins and standalone workspace hooks, config comes from the
2214
+ * global `config.plugins.<name>` block and `pluginStorageDir` points at
2215
+ * `<workspaceDir>/plugins-data/<name>/`.
2172
2216
  */
2173
2217
  export declare interface InitContext {
2174
2218
  /** Parsed config for this plugin (may be `unknown` until the manifest validates). */
2175
2219
  config: unknown;
2176
2220
  /** Pino-compatible child logger bound to `{ plugin: <name> }`. */
2177
2221
  logger: PluginLogger;
2178
- /** Absolute path to `<workspaceDir>/plugins-data/<plugin>/` (created by bootstrap). */
2222
+ /**
2223
+ * Absolute path to the per-plugin writable data directory. For user plugins
2224
+ * this is `<pluginDir>/data/`; for defaults and workspace hooks it falls back
2225
+ * to `<workspaceDir>/plugins-data/<plugin>/`. Created by bootstrap.
2226
+ */
2179
2227
  pluginStorageDir: string;
2180
2228
  /**
2181
2229
  * Assistant semver. Plugins can compare against this for defensive
@@ -2230,6 +2278,23 @@ declare const INTERFACE_IDS: readonly ["macos", "ios", "cli", "telegram", "phone
2230
2278
 
2231
2279
  declare type InterfaceId = (typeof INTERFACE_IDS)[number];
2232
2280
 
2281
+ /**
2282
+ * Provider stop-reason classification.
2283
+ *
2284
+ * Providers report an output-length cutoff under several normalized
2285
+ * finish-reason strings; {@link isMaxTokensStopReason} folds them into a single
2286
+ * "was this turn truncated at the token cap?" predicate.
2287
+ *
2288
+ * Kept dependency-free so it can be re-exported through `@vellumai/plugin-api`
2289
+ * without pulling the agent loop (its other caller) into the plugin API's
2290
+ * module graph.
2291
+ */
2292
+ /**
2293
+ * Whether a provider stop reason denotes output truncated at the token cap.
2294
+ * Case- and whitespace-insensitive; a `null`/`undefined`/empty reason is false.
2295
+ */
2296
+ export declare function isMaxTokensStopReason(stopReason: string | null | undefined): boolean;
2297
+
2233
2298
  declare interface ListItem {
2234
2299
  id: string;
2235
2300
  title: string;
@@ -2288,10 +2353,7 @@ declare const LLMCallSiteEnum: z.ZodEnum<{
2288
2353
  styleAnalyzer: "styleAnalyzer";
2289
2354
  inviteInstructionGenerator: "inviteInstructionGenerator";
2290
2355
  skillCategoryInference: "skillCategoryInference";
2291
- meetConsentMonitor: "meetConsentMonitor";
2292
- meetChatOpportunity: "meetChatOpportunity";
2293
2356
  inference: "inference";
2294
- advisor: "advisor";
2295
2357
  vision: "vision";
2296
2358
  trustRuleSuggestion: "trustRuleSuggestion";
2297
2359
  homeGreeting: "homeGreeting";
@@ -2299,139 +2361,6 @@ declare const LLMCallSiteEnum: z.ZodEnum<{
2299
2361
  workflowLeaf: "workflowLeaf";
2300
2362
  }>;
2301
2363
 
2302
- /**
2303
- * The assistant successfully posted a chat message into the meeting via
2304
- * the bot's `/send_chat` endpoint. Emitted once per successful send so
2305
- * SSE-subscribed clients can render the outbound chat without waiting for
2306
- * the bot to echo it back through the transcript/chat stream.
2307
- */
2308
- declare interface MeetChatSent {
2309
- type: "meet.chat_sent";
2310
- meetingId: string;
2311
- /** The text that was posted into the meeting's chat. */
2312
- text: string;
2313
- }
2314
-
2315
- /** The bot hit a non-recoverable error (container crash, join failure, etc.). */
2316
- declare interface MeetError {
2317
- type: "meet.error";
2318
- meetingId: string;
2319
- /** Human-readable error detail. */
2320
- detail: string;
2321
- }
2322
-
2323
- /** The bot has successfully joined and is live in the meeting. */
2324
- declare interface MeetJoined {
2325
- type: "meet.joined";
2326
- meetingId: string;
2327
- }
2328
-
2329
- /** The bot has started attempting to join a meeting. */
2330
- declare interface MeetJoining {
2331
- type: "meet.joining";
2332
- meetingId: string;
2333
- /** The Meet URL the bot was asked to join. */
2334
- url: string;
2335
- }
2336
-
2337
- /** The bot has left the meeting. */
2338
- declare interface MeetLeft {
2339
- type: "meet.left";
2340
- meetingId: string;
2341
- /** Free-form reason passed to `leave()` (e.g. "user-requested", "timeout"). */
2342
- reason: string;
2343
- }
2344
-
2345
- /**
2346
- * Meet — server → client push messages for live meeting state.
2347
- *
2348
- * Emitted by the assistant daemon as the Meet-bot progresses through its
2349
- * lifecycle (joining → joined → left) and as in-meeting state changes
2350
- * (participants, active speaker, transcript chunks).
2351
- *
2352
- * Keep payloads small and client-actionable: these events power the
2353
- * macOS "In meeting" status panel and the conversation bridge's live
2354
- * transcript feed. A client that missed an event can always refetch
2355
- * authoritative state from the daemon's HTTP routes.
2356
- */
2357
- /** A single participant in a meeting. Shape mirrors the wire-level type. */
2358
- declare interface MeetParticipant {
2359
- /** Stable participant identifier (provider-specific). */
2360
- id: string;
2361
- /** Display name of the participant. */
2362
- name: string;
2363
- /** Whether the participant is the meeting host. */
2364
- isHost?: boolean;
2365
- /** Whether the participant is the bot itself. */
2366
- isSelf?: boolean;
2367
- }
2368
-
2369
- /** Participants joined and/or left the meeting since the last snapshot. */
2370
- declare interface MeetParticipantChanged {
2371
- type: "meet.participant_changed";
2372
- meetingId: string;
2373
- /** Participants who joined since the last snapshot. */
2374
- joined: MeetParticipant[];
2375
- /** Participants who left since the last snapshot. */
2376
- left: MeetParticipant[];
2377
- }
2378
-
2379
- declare type _MeetServerMessages = MeetJoining | MeetJoined | MeetParticipantChanged | MeetSpeakerChanged | MeetTranscriptChunk | MeetLeft | MeetChatSent | MeetError | MeetSpeakingStarted | MeetSpeakingEnded;
2380
-
2381
- /** The active speaker in the meeting changed. */
2382
- declare interface MeetSpeakerChanged {
2383
- type: "meet.speaker_changed";
2384
- meetingId: string;
2385
- /** Stable speaker identifier for the new active speaker. */
2386
- speakerId: string;
2387
- /** Display name of the new active speaker. */
2388
- speakerName: string;
2389
- }
2390
-
2391
- /**
2392
- * The assistant has finished (or cancelled) a TTS playback stream. Fired
2393
- * after the bot-side playback request settles — whether normally, via an
2394
- * explicit cancel, or due to an upstream error.
2395
- */
2396
- declare interface MeetSpeakingEnded {
2397
- type: "meet.speaking_ended";
2398
- meetingId: string;
2399
- /** Opaque stream identifier — matches `meet.speaking_started.streamId`. */
2400
- streamId: string;
2401
- /** Why the stream ended: natural completion, caller-initiated cancel, or an upstream error. */
2402
- reason: "completed" | "cancelled" | "error";
2403
- }
2404
-
2405
- /**
2406
- * The assistant has begun speaking into the meeting via the TTS bridge. Fired
2407
- * once per {@link MeetSessionManager.speak} invocation immediately before the
2408
- * synthesis stream starts flowing to the bot's `/play_audio` endpoint. Useful
2409
- * for clients that want to render a "speaking …" indicator.
2410
- */
2411
- declare interface MeetSpeakingStarted {
2412
- type: "meet.speaking_started";
2413
- meetingId: string;
2414
- /** Opaque stream identifier — matches `meet.speaking_ended.streamId`. */
2415
- streamId: string;
2416
- }
2417
-
2418
- /**
2419
- * A finalized chunk of transcribed speech. Interim chunks are filtered
2420
- * out before publication so clients only render stable text.
2421
- */
2422
- declare interface MeetTranscriptChunk {
2423
- type: "meet.transcript_chunk";
2424
- meetingId: string;
2425
- /** The transcribed text. */
2426
- text: string;
2427
- /** Human-readable speaker label, if the ASR provided one. */
2428
- speakerLabel?: string;
2429
- /** Stable speaker identifier across the meeting, if available. */
2430
- speakerId?: string;
2431
- /** ASR confidence in [0, 1], if available. */
2432
- confidence?: number;
2433
- }
2434
-
2435
2364
  declare interface MemoryRecalled {
2436
2365
  type: "memory_recalled";
2437
2366
  provider: string;
@@ -2771,6 +2700,13 @@ declare interface PlatformDisconnected {
2771
2700
  type: "platform_disconnected";
2772
2701
  }
2773
2702
 
2703
+ /**
2704
+ * The subset of {@link AssistantEventHub} workspace plugins may use. Picking
2705
+ * method signatures off the class keeps the facade in sync with the hub while
2706
+ * statically withholding everything else.
2707
+ */
2708
+ export declare type PluginEventHub = Pick<AssistantEventHub, "subscribe" | "publish" | "hasSubscribersForEvent">;
2709
+
2774
2710
  /**
2775
2711
  * Minimal pino-compatible logger surface handed to plugin hooks. The host
2776
2712
  * supplies a pino child logger bound to `{ plugin: <name> }`; this
@@ -2839,13 +2775,10 @@ export declare interface PostCompactContext {
2839
2775
  */
2840
2776
  readonly isNonInteractive: boolean;
2841
2777
  /**
2842
- * Active inference profile key to surface in the re-injected context, or
2843
- * `null` when the profile is unchanged since the one last announced to the
2844
- * model. Mirrors {@link UserPromptSubmitContext.modelProfileKey}: hooks that
2845
- * emit the `model_profile` grounding line resolve the human-readable label
2846
- * from this key rather than receiving the rendered string.
2778
+ * Effective inference profile identity for the model the compacted turn will
2779
+ * keep using. Mirrors {@link UserPromptSubmitContext.modelProfileKey}.
2847
2780
  */
2848
- readonly modelProfileKey: string | null;
2781
+ readonly modelProfileKey: string;
2849
2782
  /**
2850
2783
  * Volume of runtime injection to re-apply. `"full"` restores the complete
2851
2784
  * runtime context; `"minimal"` is the reduced volume overflow recovery's
@@ -2999,9 +2932,28 @@ export declare interface PostToolUseContext {
2999
2932
  * Model id reported by the provider for the assistant turn that issued
3000
2933
  * this tool call (e.g. `claude-opus-4-8`,
3001
2934
  * `accounts/fireworks/models/kimi-k2p6`). Hooks use it to vary coaching by
3002
- * model family — some models need earlier or firmer steering than others.
2935
+ * model family — each plugin owns its own model policy (e.g. which families
2936
+ * need firmer steering) and matches against this string directly.
3003
2937
  */
3004
2938
  readonly model: string;
2939
+ /**
2940
+ * The LLM call site driving this turn — `mainAgent` for a live user-facing
2941
+ * turn, `subagentSpawn` for a subagent, or a background site (e.g.
2942
+ * `heartbeatAgent`, `titleGenerate`). `null` when the run tagged none. A hook
2943
+ * that should only act on a live user-facing turn gates on
2944
+ * `callSite === "mainAgent"`; one that should skip subagents checks
2945
+ * `callSite === "subagentSpawn"`.
2946
+ */
2947
+ readonly callSite: LLMCallSite | null;
2948
+ /**
2949
+ * Whether the connected client can render dynamic UI surfaces this turn —
2950
+ * `true` unless the channel explicitly lacks the capability (SMS, phone,
2951
+ * email, and most chat bridges). A fact about what the model can *do* this
2952
+ * turn, not who is calling: a hook that prompts a surface tool (e.g. the
2953
+ * `ui_show` progress card) gates on this so it does not coach the model
2954
+ * toward a tool the channel filters out of the tool set.
2955
+ */
2956
+ readonly supportsDynamicUi: boolean;
3005
2957
  /**
3006
2958
  * The model's context-window size in tokens. Plugins derive their own
3007
2959
  * character budget from this (e.g. a share of the window) rather than
@@ -3096,6 +3048,19 @@ export declare interface Provider {
3096
3048
  * unexecutable client tool call. Absent/false on providers without it.
3097
3049
  */
3098
3050
  supportsNativeWebSearch?: boolean;
3051
+ /**
3052
+ * Per-call native web-search capability for the provider/model this specific
3053
+ * request will route to. Unlike the static {@link supportsNativeWebSearch}
3054
+ * flag — fixed to the DEFAULT provider/model at construction — this consults
3055
+ * the resolved call-site (`options.config.callSite` + `overrideProfile`) so a
3056
+ * routing wrapper reports the ROUTED target's capability. Callers that gate a
3057
+ * `web_search` server tool on a possibly-routed call (e.g. the advisor
3058
+ * consult, whose `advisorProfile` may point at a different provider/model)
3059
+ * must use this rather than the construction-time snapshot. Optional: wrappers
3060
+ * forward it to their inner provider; leaf providers may omit it, in which
3061
+ * case callers fall back to {@link supportsNativeWebSearch}.
3062
+ */
3063
+ supportsNativeWebSearchFor?(options?: SendMessageOptions): boolean;
3099
3064
  sendMessage(messages: Message[], options?: SendMessageOptions): Promise<ProviderResponse>;
3100
3065
  /**
3101
3066
  * Exact prompt-token count from the provider's own tokenizer, for the
@@ -3477,7 +3442,7 @@ declare interface SensitiveOutputBinding {
3477
3442
 
3478
3443
  declare type SensitiveOutputKind = "invite_code";
3479
3444
 
3480
- declare type ServerMessage = _ConversationsServerMessages | _MessagesServerMessages | _SurfacesServerMessages | _SkillsServerMessages | _AppsServerMessages | _IntegrationsServerMessages | _ComputerUseServerMessages | _ContactsServerMessages | _WorkItemsServerMessages | _SubagentsServerMessages | _DocumentsServerMessages | _DocumentCommentsServerMessages | _GuardianActionsServerMessages | _SyncInvalidationServerMessages | _HomeServerMessages | _HostAppControlServerMessages | _HostBashServerMessages | _HostBrowserServerMessages | _HostCuServerMessages | _HostFileServerMessages | _HostTransferServerMessages | _MeetServerMessages | _MemoryServerMessages | _WorkspaceServerMessages | _SchedulesServerMessages | _SettingsServerMessages | _DiagnosticsServerMessages | _InboxServerMessages | _NotificationsServerMessages | _UpgradesServerMessages | _AcpServerMessages | _BookmarksServerMessages | _WorkflowsServerMessages | DiskPressureStatusChangedEvent | SubagentEvent;
3445
+ 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;
3481
3446
 
3482
3447
  export declare interface ServerToolUseContent {
3483
3448
  type: "server_tool_use";
@@ -3552,22 +3517,34 @@ declare interface ShowPlatformLogin {
3552
3517
  }
3553
3518
 
3554
3519
  /**
3555
- * Context passed to the `shutdown` hook during daemon teardown. Kept
3556
- * intentionally narrower than {@link InitContext} — most teardown
3557
- * paths only need to know which assistant version they're shutting
3558
- * down against (e.g. for version-conditional cleanup of state files
3559
- * written by a previous boot).
3520
+ * Context passed to the `shutdown` hook. Kept intentionally narrower than
3521
+ * {@link InitContext} — teardown paths only need to know which assistant
3522
+ * version they're shutting down against (e.g. for version-conditional cleanup
3523
+ * of state files written by a previous boot) and {@link ShutdownReason why}
3524
+ * they're being torn down (so a plugin can, e.g., delete its state on
3525
+ * `uninstall` but preserve it across a plain `shutdown`).
3560
3526
  *
3561
- * Additional fields may be added as concrete plugin needs surface; the
3562
- * `assistantVersion` field mirrors the init context's so plugins that
3563
- * stash a version stamp at init can compare against the same name on
3564
- * tear-down without keeping their own copy.
3527
+ * The `assistantVersion` field mirrors the init context's so plugins that stash
3528
+ * a version stamp at init can compare against the same name on tear-down
3529
+ * without keeping their own copy.
3565
3530
  */
3566
3531
  export declare interface ShutdownContext {
3567
3532
  /** Assistant semver for compatibility checks inside the plugin. */
3568
3533
  assistantVersion: string;
3534
+ /** Why the plugin is shutting down. */
3535
+ reason: ShutdownReason;
3569
3536
  }
3570
3537
 
3538
+ /**
3539
+ * Why a plugin's `shutdown` hook is firing.
3540
+ *
3541
+ * - `shutdown` — the daemon is tearing down (process exit).
3542
+ * - `uninstall` — the plugin's directory was removed at runtime.
3543
+ * - `disable` — the plugin was disabled at runtime (e.g. a `.disabled`
3544
+ * sentinel was added, or a feature flag turned it off).
3545
+ */
3546
+ declare type ShutdownReason = "shutdown" | "uninstall" | "disable";
3547
+
3571
3548
  declare interface SignBundlePayloadRequest {
3572
3549
  type: "sign_bundle_payload";
3573
3550
  requestId: string;
@@ -3679,7 +3656,7 @@ declare interface SlimSkillBase {
3679
3656
  owner?: OwnerInfo;
3680
3657
  }
3681
3658
 
3682
- declare type SlimSkillResponse = VellumSlimSkill | ClawhubSlimSkill | SkillsshSlimSkill | CustomSlimSkill;
3659
+ declare type SlimSkillResponse = VellumSlimSkill | ClawhubSlimSkill | SkillsshSlimSkill | CustomSlimSkill | AssistantMemorySlimSkill;
3683
3660
 
3684
3661
  /** Sent by the daemon when sounds config or sound files change on disk. */
3685
3662
  declare interface SoundsConfigUpdated {
@@ -3776,7 +3753,7 @@ declare interface SubagentSpawned {
3776
3753
 
3777
3754
  declare type _SubagentsServerMessages = SubagentSpawned | SubagentStatusChanged | SubagentDetailResponse;
3778
3755
 
3779
- declare type SubagentStatus = "pending" | "running" | "awaiting_input" | "completed" | "failed" | "aborted";
3756
+ declare type SubagentStatus = "pending" | "running" | "awaiting_input" | "completed" | "failed" | "aborted" | "interrupted";
3780
3757
 
3781
3758
  declare interface SubagentStatusChanged {
3782
3759
  type: "subagent_status_changed";
@@ -4024,6 +4001,17 @@ export declare interface ToolContext {
4024
4001
  * @legacy
4025
4002
  */
4026
4003
  executionChannel?: string;
4004
+ /**
4005
+ * Origin tag of the turn driving this tool invocation (the conversation's
4006
+ * `TitleOrigin`, e.g. "memory_retrospective"). Set for background-job turns
4007
+ * that pass `requestOrigin` to `runBackgroundJob`, and for the
4008
+ * memory-retrospective wake (which pins it via {@link WakeToolContextPin}).
4009
+ * `buildPolicyContext` copies it onto the `PolicyContext` so the permission
4010
+ * checker can scope narrow non-interactive auto-grants (e.g. retrospective
4011
+ * skill authoring) to a specific internal origin. Unset for normal
4012
+ * interactive turns.
4013
+ */
4014
+ requestOrigin?: string;
4027
4015
  /**
4028
4016
  * Voice/call session ID, if the invocation originates from a call. Used for scoped grant consumption.
4029
4017
  * @legacy
@@ -4544,6 +4532,7 @@ declare const ToolUsePreviewStartEventSchema: z.ZodObject<{
4544
4532
  toolName: z.ZodString;
4545
4533
  conversationId: z.ZodOptional<z.ZodString>;
4546
4534
  messageId: z.ZodOptional<z.ZodString>;
4535
+ previewStartedAt: z.ZodOptional<z.ZodNumber>;
4547
4536
  }, z.core.$strip>;
4548
4537
 
4549
4538
  declare type ToolUseStartEvent = z.infer<typeof ToolUseStartEventSchema>;
@@ -4556,6 +4545,7 @@ declare const ToolUseStartEventSchema: z.ZodObject<{
4556
4545
  messageId: z.ZodOptional<z.ZodString>;
4557
4546
  conversationId: z.ZodOptional<z.ZodString>;
4558
4547
  startedAt: z.ZodOptional<z.ZodNumber>;
4548
+ previewStartedAt: z.ZodOptional<z.ZodNumber>;
4559
4549
  }, z.core.$strip>;
4560
4550
 
4561
4551
  declare type TraceEvent = z.infer<typeof TraceEventSchema>;
@@ -4587,9 +4577,9 @@ declare const TraceEventSchema: z.ZodObject<{
4587
4577
  }>;
4588
4578
  status: z.ZodOptional<z.ZodEnum<{
4589
4579
  error: "error";
4590
- info: "info";
4591
4580
  success: "success";
4592
4581
  warning: "warning";
4582
+ info: "info";
4593
4583
  }>>;
4594
4584
  summary: z.ZodString;
4595
4585
  attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
@@ -4866,14 +4856,13 @@ export declare interface UserPromptSubmitContext {
4866
4856
  */
4867
4857
  readonly requestId: string;
4868
4858
  /**
4869
- * Active inference profile key to surface in this turn's context, or `null`
4870
- * when the profile is unchanged since the one last announced to the model.
4871
- * Hooks that emit the `model_profile` grounding line resolve the
4872
- * human-readable label (and model id) from this key via the workspace LLM
4873
- * config rather than receiving the rendered string — the key is the minimal
4874
- * turn input the message arrays cannot carry.
4859
+ * Effective inference profile identity for the model this turn will use.
4860
+ * Named-profile configs receive a profile key; profileless configs receive
4861
+ * the resolved model id. Hooks that need model capabilities should resolve
4862
+ * them from this value rather than the workspace active profile, because a
4863
+ * conversation can be pinned to a different profile.
4875
4864
  */
4876
- readonly modelProfileKey: string | null;
4865
+ readonly modelProfileKey: string;
4877
4866
  /**
4878
4867
  * Whether the turn has no human present to answer clarification questions
4879
4868
  * (e.g. a scheduled, background, or headless run). Resolved once at turn
package/index.js CHANGED
@@ -6,3 +6,4 @@ export const assistantEventHub = api.assistantEventHub;
6
6
  export const doesSupportVision = api.doesSupportVision;
7
7
  export const getConfiguredProvider = api.getConfiguredProvider;
8
8
  export const getModelProfiles = api.getModelProfiles;
9
+ export const isMaxTokensStopReason = api.isMaxTokensStopReason;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vellumai/plugin-api",
3
- "version": "0.10.3",
3
+ "version": "0.10.4-dev.202607010028.1a4efcc",
4
4
  "description": "Public TypeScript authoring contract for Vellum assistant plugins.",
5
5
  "license": "MIT",
6
6
  "type": "module",