@vellumai/plugin-api 0.11.4-staging.4 → 0.11.5-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 +257 -67
  2. package/index.js +3 -0
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -127,9 +127,9 @@ declare const AssistantConfigSchema: z.ZodObject<{
127
127
  inference: z.ZodDefault<z.ZodObject<{}, z.core.$strip>>;
128
128
  "image-generation": z.ZodDefault<z.ZodObject<{
129
129
  provider: z.ZodDefault<z.ZodEnum<{
130
+ vellum: "vellum";
130
131
  openai: "openai";
131
132
  gemini: "gemini";
132
- vellum: "vellum";
133
133
  }>>;
134
134
  model: z.ZodDefault<z.ZodString>;
135
135
  }, z.core.$strip>>;
@@ -601,9 +601,9 @@ declare const AssistantConfigSchema: z.ZodObject<{
601
601
  low: "low";
602
602
  medium: "medium";
603
603
  high: "high";
604
+ none: "none";
604
605
  xhigh: "xhigh";
605
606
  max: "max";
606
- none: "none";
607
607
  }>>;
608
608
  speed: z.ZodOptional<z.ZodEnum<{
609
609
  standard: "standard";
@@ -723,9 +723,9 @@ declare const AssistantConfigSchema: z.ZodObject<{
723
723
  low: "low";
724
724
  medium: "medium";
725
725
  high: "high";
726
+ none: "none";
726
727
  xhigh: "xhigh";
727
728
  max: "max";
728
- none: "none";
729
729
  }>>;
730
730
  speed: z.ZodOptional<z.ZodEnum<{
731
731
  standard: "standard";
@@ -1171,8 +1171,8 @@ declare const AssistantConfigSchema: z.ZodObject<{
1171
1171
  plugins: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1172
1172
  pluginUpdates: z.ZodDefault<z.ZodObject<{
1173
1173
  mode: z.ZodDefault<z.ZodEnum<{
1174
- auto: "auto";
1175
1174
  manual: "manual";
1175
+ auto: "auto";
1176
1176
  }>>;
1177
1177
  strategy: z.ZodDefault<z.ZodEnum<{
1178
1178
  theirs: "theirs";
@@ -1240,12 +1240,12 @@ declare const AssistantEventEnvelopeSchema: z.ZodObject<{
1240
1240
  type: z.ZodLiteral<"acp_session_update">;
1241
1241
  acpSessionId: z.ZodString;
1242
1242
  updateType: z.ZodEnum<{
1243
+ plan: "plan";
1243
1244
  agent_message_chunk: "agent_message_chunk";
1244
1245
  agent_thought_chunk: "agent_thought_chunk";
1245
1246
  user_message_chunk: "user_message_chunk";
1246
1247
  tool_call: "tool_call";
1247
1248
  tool_call_update: "tool_call_update";
1248
- plan: "plan";
1249
1249
  }>;
1250
1250
  content: z.ZodOptional<z.ZodString>;
1251
1251
  toolCallId: z.ZodOptional<z.ZodString>;
@@ -1331,8 +1331,8 @@ declare const AssistantEventEnvelopeSchema: z.ZodObject<{
1331
1331
  id: z.ZodString;
1332
1332
  conversationId: z.ZodString;
1333
1333
  status: z.ZodEnum<{
1334
- completed: "completed";
1335
1334
  cancelled: "cancelled";
1335
+ completed: "completed";
1336
1336
  failed: "failed";
1337
1337
  }>;
1338
1338
  exitCode: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
@@ -1424,18 +1424,18 @@ declare const AssistantEventEnvelopeSchema: z.ZodObject<{
1424
1424
  conversationId: z.ZodString;
1425
1425
  requestId: z.ZodString;
1426
1426
  state: z.ZodEnum<{
1427
- timed_out: "timed_out";
1428
1427
  pending: "pending";
1429
1428
  approved: "approved";
1430
1429
  denied: "denied";
1430
+ timed_out: "timed_out";
1431
1431
  resolved_stale: "resolved_stale";
1432
1432
  }>;
1433
1433
  source: z.ZodEnum<{
1434
+ timeout: "timeout";
1434
1435
  system: "system";
1435
1436
  button: "button";
1436
1437
  inline_nl: "inline_nl";
1437
1438
  auto_deny: "auto_deny";
1438
- timeout: "timeout";
1439
1439
  }>;
1440
1440
  causedByRequestId: z.ZodOptional<z.ZodString>;
1441
1441
  decisionText: z.ZodOptional<z.ZodString>;
@@ -1510,9 +1510,9 @@ declare const AssistantEventEnvelopeSchema: z.ZodObject<{
1510
1510
  }, z.core.$strip>, z.ZodObject<{
1511
1511
  type: z.ZodLiteral<"conversation_list_invalidated">;
1512
1512
  reason: z.ZodEnum<{
1513
+ deleted: "deleted";
1513
1514
  created: "created";
1514
1515
  renamed: "renamed";
1515
- deleted: "deleted";
1516
1516
  reordered: "reordered";
1517
1517
  seen_changed: "seen_changed";
1518
1518
  }>;
@@ -1555,9 +1555,9 @@ declare const AssistantEventEnvelopeSchema: z.ZodObject<{
1555
1555
  enabled: z.ZodBoolean;
1556
1556
  state: z.ZodEnum<{
1557
1557
  unknown: "unknown";
1558
+ ok: "ok";
1558
1559
  disabled: "disabled";
1559
1560
  critical: "critical";
1560
- ok: "ok";
1561
1561
  warning: "warning";
1562
1562
  }>;
1563
1563
  locked: z.ZodBoolean;
@@ -1672,8 +1672,8 @@ declare const AssistantEventEnvelopeSchema: z.ZodObject<{
1672
1672
  hookName: z.ZodString;
1673
1673
  owner: z.ZodObject<{
1674
1674
  kind: z.ZodEnum<{
1675
- plugin: "plugin";
1676
1675
  workspace: "workspace";
1676
+ plugin: "plugin";
1677
1677
  }>;
1678
1678
  id: z.ZodString;
1679
1679
  }, z.core.$strip>;
@@ -1865,9 +1865,9 @@ declare const AssistantEventEnvelopeSchema: z.ZodObject<{
1865
1865
  requestId: z.ZodString;
1866
1866
  conversationId: z.ZodString;
1867
1867
  state: z.ZodEnum<{
1868
+ approved: "approved";
1868
1869
  cancelled: "cancelled";
1869
1870
  superseded: "superseded";
1870
- approved: "approved";
1871
1871
  rejected: "rejected";
1872
1872
  answered: "answered";
1873
1873
  }>;
@@ -2091,6 +2091,25 @@ declare const AssistantEventEnvelopeSchema: z.ZodObject<{
2091
2091
  }, z.core.$strip>, z.ZodObject<{
2092
2092
  type: z.ZodLiteral<"relationship_state_updated">;
2093
2093
  updatedAt: z.ZodString;
2094
+ }, z.core.$strip>, z.ZodObject<{
2095
+ type: z.ZodLiteral<"resource_pressure_status_changed">;
2096
+ status: z.ZodObject<{
2097
+ enabled: z.ZodBoolean;
2098
+ state: z.ZodEnum<{
2099
+ unknown: "unknown";
2100
+ ok: "ok";
2101
+ disabled: "disabled";
2102
+ elevated: "elevated";
2103
+ }>;
2104
+ cpuPercent: z.ZodNullable<z.ZodNumber>;
2105
+ memoryPercent: z.ZodNullable<z.ZodNumber>;
2106
+ cpuElevated: z.ZodBoolean;
2107
+ memoryElevated: z.ZodBoolean;
2108
+ cpuThresholdPercent: z.ZodNumber;
2109
+ memoryThresholdPercent: z.ZodNumber;
2110
+ lastCheckedAt: z.ZodNullable<z.ZodString>;
2111
+ error: z.ZodNullable<z.ZodString>;
2112
+ }, z.core.$strip>;
2094
2113
  }, z.core.$strip>, z.ZodObject<{
2095
2114
  type: z.ZodLiteral<"schedule_conversation_created">;
2096
2115
  conversationId: z.ZodString;
@@ -2160,9 +2179,9 @@ declare const AssistantEventEnvelopeSchema: z.ZodObject<{
2160
2179
  type: z.ZodLiteral<"subagent_status_changed">;
2161
2180
  subagentId: z.ZodString;
2162
2181
  status: z.ZodEnum<{
2182
+ pending: "pending";
2163
2183
  completed: "completed";
2164
2184
  failed: "failed";
2165
- pending: "pending";
2166
2185
  running: "running";
2167
2186
  awaiting_input: "awaiting_input";
2168
2187
  aborted: "aborted";
@@ -2605,6 +2624,12 @@ export declare class AssistantEventHub {
2605
2624
  * matched.
2606
2625
  */
2607
2626
  setClientPresence(clientId: string, state: DesktopPresenceState): boolean;
2627
+ /**
2628
+ * Record the web tab visibility/focused-conversation reported by a client.
2629
+ * `reportedAt` always advances. Returns true when at least one active
2630
+ * client entry matched.
2631
+ */
2632
+ setClientWebPresence(clientId: string, report: WebPresenceReport): boolean;
2608
2633
  /**
2609
2634
  * Force-disconnect a client by disposing all subscribers for the given
2610
2635
  * `clientId`. Returns the number of disposed entries.
@@ -2636,15 +2661,16 @@ declare const AssistantEventPublishOptionsSchema: z.ZodObject<{
2636
2661
  }>>;
2637
2662
  targetClientId: z.ZodOptional<z.ZodString>;
2638
2663
  targetInterfaceId: z.ZodOptional<z.ZodEnum<{
2639
- plugin: "plugin";
2640
- telegram: "telegram";
2641
2664
  phone: "phone";
2665
+ a2a: "a2a";
2642
2666
  whatsapp: "whatsapp";
2667
+ discord: "discord";
2668
+ telegram: "telegram";
2643
2669
  slack: "slack";
2644
2670
  email: "email";
2645
- a2a: "a2a";
2646
- discord: "discord";
2671
+ plugin: "plugin";
2647
2672
  macos: "macos";
2673
+ windows: "windows";
2648
2674
  ios: "ios";
2649
2675
  cli: "cli";
2650
2676
  web: "web";
@@ -2698,12 +2724,12 @@ declare const AssistantEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2698
2724
  type: z.ZodLiteral<"acp_session_update">;
2699
2725
  acpSessionId: z.ZodString;
2700
2726
  updateType: z.ZodEnum<{
2727
+ plan: "plan";
2701
2728
  agent_message_chunk: "agent_message_chunk";
2702
2729
  agent_thought_chunk: "agent_thought_chunk";
2703
2730
  user_message_chunk: "user_message_chunk";
2704
2731
  tool_call: "tool_call";
2705
2732
  tool_call_update: "tool_call_update";
2706
- plan: "plan";
2707
2733
  }>;
2708
2734
  content: z.ZodOptional<z.ZodString>;
2709
2735
  toolCallId: z.ZodOptional<z.ZodString>;
@@ -2789,8 +2815,8 @@ declare const AssistantEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2789
2815
  id: z.ZodString;
2790
2816
  conversationId: z.ZodString;
2791
2817
  status: z.ZodEnum<{
2792
- completed: "completed";
2793
2818
  cancelled: "cancelled";
2819
+ completed: "completed";
2794
2820
  failed: "failed";
2795
2821
  }>;
2796
2822
  exitCode: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
@@ -2882,18 +2908,18 @@ declare const AssistantEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2882
2908
  conversationId: z.ZodString;
2883
2909
  requestId: z.ZodString;
2884
2910
  state: z.ZodEnum<{
2885
- timed_out: "timed_out";
2886
2911
  pending: "pending";
2887
2912
  approved: "approved";
2888
2913
  denied: "denied";
2914
+ timed_out: "timed_out";
2889
2915
  resolved_stale: "resolved_stale";
2890
2916
  }>;
2891
2917
  source: z.ZodEnum<{
2918
+ timeout: "timeout";
2892
2919
  system: "system";
2893
2920
  button: "button";
2894
2921
  inline_nl: "inline_nl";
2895
2922
  auto_deny: "auto_deny";
2896
- timeout: "timeout";
2897
2923
  }>;
2898
2924
  causedByRequestId: z.ZodOptional<z.ZodString>;
2899
2925
  decisionText: z.ZodOptional<z.ZodString>;
@@ -2968,9 +2994,9 @@ declare const AssistantEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2968
2994
  }, z.core.$strip>, z.ZodObject<{
2969
2995
  type: z.ZodLiteral<"conversation_list_invalidated">;
2970
2996
  reason: z.ZodEnum<{
2997
+ deleted: "deleted";
2971
2998
  created: "created";
2972
2999
  renamed: "renamed";
2973
- deleted: "deleted";
2974
3000
  reordered: "reordered";
2975
3001
  seen_changed: "seen_changed";
2976
3002
  }>;
@@ -3013,9 +3039,9 @@ declare const AssistantEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3013
3039
  enabled: z.ZodBoolean;
3014
3040
  state: z.ZodEnum<{
3015
3041
  unknown: "unknown";
3042
+ ok: "ok";
3016
3043
  disabled: "disabled";
3017
3044
  critical: "critical";
3018
- ok: "ok";
3019
3045
  warning: "warning";
3020
3046
  }>;
3021
3047
  locked: z.ZodBoolean;
@@ -3130,8 +3156,8 @@ declare const AssistantEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3130
3156
  hookName: z.ZodString;
3131
3157
  owner: z.ZodObject<{
3132
3158
  kind: z.ZodEnum<{
3133
- plugin: "plugin";
3134
3159
  workspace: "workspace";
3160
+ plugin: "plugin";
3135
3161
  }>;
3136
3162
  id: z.ZodString;
3137
3163
  }, z.core.$strip>;
@@ -3323,9 +3349,9 @@ declare const AssistantEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3323
3349
  requestId: z.ZodString;
3324
3350
  conversationId: z.ZodString;
3325
3351
  state: z.ZodEnum<{
3352
+ approved: "approved";
3326
3353
  cancelled: "cancelled";
3327
3354
  superseded: "superseded";
3328
- approved: "approved";
3329
3355
  rejected: "rejected";
3330
3356
  answered: "answered";
3331
3357
  }>;
@@ -3549,6 +3575,25 @@ declare const AssistantEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3549
3575
  }, z.core.$strip>, z.ZodObject<{
3550
3576
  type: z.ZodLiteral<"relationship_state_updated">;
3551
3577
  updatedAt: z.ZodString;
3578
+ }, z.core.$strip>, z.ZodObject<{
3579
+ type: z.ZodLiteral<"resource_pressure_status_changed">;
3580
+ status: z.ZodObject<{
3581
+ enabled: z.ZodBoolean;
3582
+ state: z.ZodEnum<{
3583
+ unknown: "unknown";
3584
+ ok: "ok";
3585
+ disabled: "disabled";
3586
+ elevated: "elevated";
3587
+ }>;
3588
+ cpuPercent: z.ZodNullable<z.ZodNumber>;
3589
+ memoryPercent: z.ZodNullable<z.ZodNumber>;
3590
+ cpuElevated: z.ZodBoolean;
3591
+ memoryElevated: z.ZodBoolean;
3592
+ cpuThresholdPercent: z.ZodNumber;
3593
+ memoryThresholdPercent: z.ZodNumber;
3594
+ lastCheckedAt: z.ZodNullable<z.ZodString>;
3595
+ error: z.ZodNullable<z.ZodString>;
3596
+ }, z.core.$strip>;
3552
3597
  }, z.core.$strip>, z.ZodObject<{
3553
3598
  type: z.ZodLiteral<"schedule_conversation_created">;
3554
3599
  conversationId: z.ZodString;
@@ -3618,9 +3663,9 @@ declare const AssistantEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3618
3663
  type: z.ZodLiteral<"subagent_status_changed">;
3619
3664
  subagentId: z.ZodString;
3620
3665
  status: z.ZodEnum<{
3666
+ pending: "pending";
3621
3667
  completed: "completed";
3622
3668
  failed: "failed";
3623
- pending: "pending";
3624
3669
  running: "running";
3625
3670
  awaiting_input: "awaiting_input";
3626
3671
  aborted: "aborted";
@@ -4107,6 +4152,11 @@ declare interface ClientEntry extends BaseSubscriberEntry {
4107
4152
  * In-memory only, so consumers must fail open when it is absent.
4108
4153
  */
4109
4154
  presence?: ClientPresence;
4155
+ /**
4156
+ * Last web tab visibility/focus reported by this client, for clients that
4157
+ * report it. In-memory only, so consumers must fail open when it is absent.
4158
+ */
4159
+ webPresence?: ClientWebPresence;
4110
4160
  }
4111
4161
 
4112
4162
  declare interface ClientPresence {
@@ -4115,6 +4165,11 @@ declare interface ClientPresence {
4115
4165
  reportedAt: Date;
4116
4166
  }
4117
4167
 
4168
+ declare interface ClientWebPresence extends WebPresenceReport {
4169
+ /** When the daemon last heard from the client. Drives staleness. */
4170
+ reportedAt: Date;
4171
+ }
4172
+
4118
4173
  declare interface CliOptionHelp {
4119
4174
  /** Commander flag spec, e.g. `"--path <file>"` or `"-l, --limit <n>"`. */
4120
4175
  flags: string;
@@ -4284,13 +4339,14 @@ export declare function createLiveVoiceConnection(options: {
4284
4339
  *
4285
4340
  * ## Plugin scoping
4286
4341
  *
4287
- * When a plugin is in context — its hook or tool is executing, tracked by
4288
- * {@link ../plugins/plugin-execution-context.getCurrentPluginName} — resolution
4289
- * is restricted: the plugin may only resolve credentials whose `field` equals
4290
- * the plugin's own manifest name. A plugin named `acme` can therefore read
4291
- * `openai/acme` or `stripe/acme` but not `openai/api_key`. Outside any plugin
4292
- * context (host-internal callers, CLI, tests) the resolver is unscoped and
4293
- * behaves like a direct reveal.
4342
+ * When a plugin is in context (its hook, tool, or one of its own
4343
+ * `/x/plugins/<name>/` routes is executing, tracked by
4344
+ * {@link ../plugins/plugin-execution-context.getCurrentPluginName}), resolution
4345
+ * is restricted: the plugin may only resolve credentials whose `service`
4346
+ * equals its manifest name (`imessage/api_key` for plugin `imessage`). It
4347
+ * cannot read another service (`openai/api_key`, `openai/imessage`). Outside
4348
+ * any plugin context (host-internal callers, CLI, tests) the resolver is
4349
+ * unscoped and behaves like a direct reveal.
4294
4350
  */
4295
4351
  /**
4296
4352
  * Raised when a credential cannot be resolved: the reference does not match a
@@ -4301,6 +4357,45 @@ export declare class CredentialResolutionError extends Error {
4301
4357
  constructor(message: string);
4302
4358
  }
4303
4359
 
4360
+ /**
4361
+ * Plugin-facing credential storage.
4362
+ *
4363
+ * {@link storeCredential} writes a credential's plaintext to the secure store,
4364
+ * the same write `assistant credentials set` performs, naming it either by an
4365
+ * existing credential's UUID or by a `"service/field"` string, the same
4366
+ * vocabulary {@link ./resolve-credential.resolveCredential} reads back. A
4367
+ * plugin that obtains a token for itself (an OAuth exchange it drives, a key a
4368
+ * user hands it through its own route) persists it here instead of inventing
4369
+ * its own on-disk secret file.
4370
+ *
4371
+ * ## Plugin scoping
4372
+ *
4373
+ * A plugin may only write credentials whose `service` equals its manifest
4374
+ * name (`imessage/api_key` for plugin `imessage`). It cannot write another
4375
+ * service (`openai/api_key`, `openai/imessage`). The name comes from the
4376
+ * execution context
4377
+ * ({@link ../plugins/plugin-execution-context.getCurrentPluginName}), which the
4378
+ * host establishes around a plugin's hook, tool, and route invocations.
4379
+ *
4380
+ * Unlike the read path, this **fails closed**: with no plugin in context there
4381
+ * is nobody to scope the write to, so it is refused rather than treated as an
4382
+ * unscoped host write. A plugin's module body is evaluated by the loader
4383
+ * outside any context, and an unscoped branch there would let top-level code
4384
+ * overwrite the user's own credentials. Host-internal callers that legitimately
4385
+ * write unscoped (the `credentials/set` route, the CLI behind it) compose
4386
+ * {@link ../tools/credentials/store.storeCredentialValue} directly. This
4387
+ * matches the plugin-owned index (`indexDocument`), which likewise requires a
4388
+ * context because a write with no owner has nothing to attribute.
4389
+ */
4390
+ /**
4391
+ * Raised when a credential cannot be stored: the reference is malformed, the
4392
+ * value is empty or invalid for its service, the secure backend rejected the
4393
+ * write, or the calling plugin is not permitted to write the credential.
4394
+ */
4395
+ export declare class CredentialStoreError extends Error {
4396
+ constructor(message: string);
4397
+ }
4398
+
4304
4399
  /**
4305
4400
  * Delete a conversation, yielding the event loop between row batches, and
4306
4401
  * enqueue vector-store cleanup for the memory segments and summaries the
@@ -4441,6 +4536,9 @@ export declare function getModelProfiles(): ModelProfileInfo[];
4441
4536
  * When the VELLUM_WORKSPACE_DIR env var is set, returns that value (used in
4442
4537
  * containerized deployments where the workspace is a separate volume).
4443
4538
  * Otherwise falls back to ~/.vellum/workspace.
4539
+ *
4540
+ * In test processes the resolved directory must live under `os.tmpdir()`
4541
+ * (see the live-workspace guard above); anything else throws.
4444
4542
  */
4445
4543
  export declare function getWorkspaceDir(): string;
4446
4544
 
@@ -4550,9 +4648,9 @@ export declare const HOOKS: {
4550
4648
  };
4551
4649
 
4552
4650
  /**
4553
- * Host proxy capabilities that an interface can support. The macOS client
4554
- * supports all of them; the chrome-extension interface only supports
4555
- * host_browser (via the Chrome DevTools Protocol proxy).
4651
+ * Host proxy capabilities that an interface can support. macOS supports all
4652
+ * of them, Windows withholds app control, and chrome-extension supports only
4653
+ * host_browser through the Chrome DevTools Protocol proxy.
4556
4654
  */
4557
4655
  declare const HOST_PROXY_CAPABILITIES: readonly ["host_bash", "host_file", "host_cu", "host_browser", "host_app_control", "host_ui_snapshot"];
4558
4656
 
@@ -4657,7 +4755,7 @@ declare interface InsertedMessage {
4657
4755
  deduplicated: boolean;
4658
4756
  }
4659
4757
 
4660
- declare const INTERFACE_IDS: readonly ["macos", "ios", "cli", "telegram", "phone", "web", "whatsapp", "slack", "email", "chrome-extension", "a2a", "discord", "route", "plugin"];
4758
+ declare const INTERFACE_IDS: readonly ["macos", "windows", "ios", "cli", "telegram", "phone", "web", "whatsapp", "slack", "email", "chrome-extension", "a2a", "discord", "route", "plugin"];
4661
4759
 
4662
4760
  declare type InterfaceId = (typeof INTERFACE_IDS)[number];
4663
4761
 
@@ -5121,32 +5219,33 @@ declare type MessageMetadata = ReturnType<parseMessageMetadata_2>;
5121
5219
  declare type MessageMetadata_2 = z.infer<typeof messageMetadataSchema>;
5122
5220
 
5123
5221
  declare const messageMetadataSchema: z.ZodObject<{
5222
+ sentAt: z.ZodOptional<z.ZodNumber>;
5124
5223
  userMessageChannel: z.ZodOptional<z.ZodEnum<{
5125
- plugin: "plugin";
5126
- vellum: "vellum";
5127
- platform: "platform";
5128
- telegram: "telegram";
5129
5224
  phone: "phone";
5225
+ platform: "platform";
5226
+ a2a: "a2a";
5227
+ vellum: "vellum";
5130
5228
  whatsapp: "whatsapp";
5229
+ discord: "discord";
5230
+ telegram: "telegram";
5131
5231
  slack: "slack";
5132
5232
  email: "email";
5133
- a2a: "a2a";
5134
- discord: "discord";
5233
+ plugin: "plugin";
5135
5234
  }>>;
5136
5235
  assistantMessageChannel: z.ZodOptional<z.ZodEnum<{
5137
- plugin: "plugin";
5138
- vellum: "vellum";
5139
- platform: "platform";
5140
- telegram: "telegram";
5141
5236
  phone: "phone";
5237
+ platform: "platform";
5238
+ a2a: "a2a";
5239
+ vellum: "vellum";
5142
5240
  whatsapp: "whatsapp";
5241
+ discord: "discord";
5242
+ telegram: "telegram";
5143
5243
  slack: "slack";
5144
5244
  email: "email";
5145
- a2a: "a2a";
5146
- discord: "discord";
5245
+ plugin: "plugin";
5147
5246
  }>>;
5148
- userMessageInterface: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<"plugin" | "telegram" | "phone" | "whatsapp" | "slack" | "email" | "a2a" | "discord" | "macos" | "ios" | "cli" | "web" | "chrome-extension" | "route" | null, string>> & z.ZodType<"plugin" | "telegram" | "phone" | "whatsapp" | "slack" | "email" | "a2a" | "discord" | "macos" | "ios" | "cli" | "web" | "chrome-extension" | "route", string, z.core.$ZodTypeInternals<"plugin" | "telegram" | "phone" | "whatsapp" | "slack" | "email" | "a2a" | "discord" | "macos" | "ios" | "cli" | "web" | "chrome-extension" | "route", string>>>;
5149
- assistantMessageInterface: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<"plugin" | "telegram" | "phone" | "whatsapp" | "slack" | "email" | "a2a" | "discord" | "macos" | "ios" | "cli" | "web" | "chrome-extension" | "route" | null, string>> & z.ZodType<"plugin" | "telegram" | "phone" | "whatsapp" | "slack" | "email" | "a2a" | "discord" | "macos" | "ios" | "cli" | "web" | "chrome-extension" | "route", string, z.core.$ZodTypeInternals<"plugin" | "telegram" | "phone" | "whatsapp" | "slack" | "email" | "a2a" | "discord" | "macos" | "ios" | "cli" | "web" | "chrome-extension" | "route", string>>>;
5247
+ userMessageInterface: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<"phone" | "a2a" | "whatsapp" | "discord" | "telegram" | "slack" | "email" | "plugin" | "macos" | "windows" | "ios" | "cli" | "web" | "chrome-extension" | "route" | null, string>> & z.ZodType<"phone" | "a2a" | "whatsapp" | "discord" | "telegram" | "slack" | "email" | "plugin" | "macos" | "windows" | "ios" | "cli" | "web" | "chrome-extension" | "route", string, z.core.$ZodTypeInternals<"phone" | "a2a" | "whatsapp" | "discord" | "telegram" | "slack" | "email" | "plugin" | "macos" | "windows" | "ios" | "cli" | "web" | "chrome-extension" | "route", string>>>;
5248
+ assistantMessageInterface: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<"phone" | "a2a" | "whatsapp" | "discord" | "telegram" | "slack" | "email" | "plugin" | "macos" | "windows" | "ios" | "cli" | "web" | "chrome-extension" | "route" | null, string>> & z.ZodType<"phone" | "a2a" | "whatsapp" | "discord" | "telegram" | "slack" | "email" | "plugin" | "macos" | "windows" | "ios" | "cli" | "web" | "chrome-extension" | "route", string, z.core.$ZodTypeInternals<"phone" | "a2a" | "whatsapp" | "discord" | "telegram" | "slack" | "email" | "plugin" | "macos" | "windows" | "ios" | "cli" | "web" | "chrome-extension" | "route", string>>>;
5150
5249
  client: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
5151
5250
  clientOsFromRequest: z.ZodOptional<z.ZodBoolean>;
5152
5251
  subagentNotification: z.ZodOptional<z.ZodObject<{
@@ -5174,16 +5273,16 @@ declare const messageMetadataSchema: z.ZodObject<{
5174
5273
  }>>;
5175
5274
  model: z.ZodOptional<z.ZodString>;
5176
5275
  provenanceSourceChannel: z.ZodOptional<z.ZodEnum<{
5177
- plugin: "plugin";
5178
- vellum: "vellum";
5179
- platform: "platform";
5180
- telegram: "telegram";
5181
5276
  phone: "phone";
5277
+ platform: "platform";
5278
+ a2a: "a2a";
5279
+ vellum: "vellum";
5182
5280
  whatsapp: "whatsapp";
5281
+ discord: "discord";
5282
+ telegram: "telegram";
5183
5283
  slack: "slack";
5184
5284
  email: "email";
5185
- a2a: "a2a";
5186
- discord: "discord";
5285
+ plugin: "plugin";
5187
5286
  }>>;
5188
5287
  provenanceGuardianExternalUserId: z.ZodOptional<z.ZodString>;
5189
5288
  provenanceRequesterIdentifier: z.ZodOptional<z.ZodString>;
@@ -5200,8 +5299,8 @@ declare const messageMetadataSchema: z.ZodObject<{
5200
5299
  command: z.ZodString;
5201
5300
  startedAt: z.ZodNumber;
5202
5301
  status: z.ZodEnum<{
5203
- completed: "completed";
5204
5302
  cancelled: "cancelled";
5303
+ completed: "completed";
5205
5304
  failed: "failed";
5206
5305
  }>;
5207
5306
  exitCode: z.ZodNullable<z.ZodNumber>;
@@ -5308,6 +5407,37 @@ export declare function parseMessageMetadata(metadataJson: string | null): Promi
5308
5407
  */
5309
5408
  declare function parseMessageMetadata_2(metadataJson: string | null): MessageMetadata_2 | undefined;
5310
5409
 
5410
+ /**
5411
+ * Plugin-facing facade over the host's system-card writer: a daemon-authored
5412
+ * transcript notice, persisted as an assistant row stamped
5413
+ * `messageKind: "system_card"` so clients render it as a standalone system
5414
+ * notice rather than assistant-persona speech. Plugins use it to tell the user
5415
+ * about something the turn did to their input that the model's own reply
5416
+ * cannot explain (e.g. an attachment the turn could not send).
5417
+ *
5418
+ * The writer is loaded through a dynamic `import()` inside the wrapper, for the
5419
+ * same reason `persistence/conversation-plugin-facade.ts` does: it carries the
5420
+ * DB/drizzle import graph, whose named exports must not be forced to resolve
5421
+ * merely because a plugin imported `@vellumai/plugin-api`. Suites that
5422
+ * partial-mock a module in that graph would otherwise fail to instantiate.
5423
+ */
5424
+ /**
5425
+ * Persist a system card in a conversation's transcript and announce it to
5426
+ * connected clients through the sync invalidation that drives a refetch.
5427
+ * Returns the persisted message id.
5428
+ *
5429
+ * A plugin card is non-terminal: it never emits `message_complete`, so a card
5430
+ * written from a hook that runs inside a turn leaves that turn's streaming and
5431
+ * processing state untouched. It is also not appended to the conversation's
5432
+ * in-memory working history, so it cannot leave a trailing assistant message
5433
+ * for the turn's next provider call to continue from.
5434
+ */
5435
+ export declare function persistSystemCard(opts: {
5436
+ conversationId: string;
5437
+ text: string;
5438
+ metadata: Record<string, unknown>;
5439
+ }): Promise<string>;
5440
+
5311
5441
  /**
5312
5442
  * The subset of {@link AssistantEventHub} workspace plugins may use. Picking
5313
5443
  * method signatures off the class keeps the facade in sync with the hub while
@@ -6083,6 +6213,23 @@ export declare function resolveUserName(workspaceDir: string): string | null;
6083
6213
  */
6084
6214
  export declare function resolveWebhookUrl(options: WebhookUrlOptions): Promise<string>;
6085
6215
 
6216
+ declare type RiskAllowlistOption = z.infer<typeof RiskAllowlistOptionSchema>;
6217
+
6218
+ /** Minimatch ladder for the "always allow" prompt option (what a rule matches). */
6219
+ declare const RiskAllowlistOptionSchema: z.ZodObject<{
6220
+ label: z.ZodString;
6221
+ description: z.ZodString;
6222
+ pattern: z.ZodString;
6223
+ }, z.core.$strip>;
6224
+
6225
+ declare type RiskDirectoryScopeOption = z.infer<typeof RiskDirectoryScopeOptionSchema>;
6226
+
6227
+ /** Directory ladder for filesystem operations; `scope` is a path glob or `everywhere`. */
6228
+ declare const RiskDirectoryScopeOptionSchema: z.ZodObject<{
6229
+ scope: z.ZodString;
6230
+ label: z.ZodString;
6231
+ }, z.core.$strip>;
6232
+
6086
6233
  export declare enum RiskLevel {
6087
6234
  Low = "low",
6088
6235
  Medium = "medium",
@@ -6510,6 +6657,43 @@ declare interface StopInputContext {
6510
6657
  readonly exitReason: AgentLoopExitReason;
6511
6658
  }
6512
6659
 
6660
+ /**
6661
+ * Store a credential's plaintext value, creating it or replacing the value of
6662
+ * an existing one.
6663
+ *
6664
+ * @param ref A credential UUID (an existing credential) or a `"service/field"`
6665
+ * string (created when no such credential exists).
6666
+ * @param value The plaintext value. Edge whitespace is trimmed.
6667
+ * @returns The identity of the stored credential, which
6668
+ * {@link ./resolve-credential.resolveCredential} accepts as a ref.
6669
+ * @throws {CredentialStoreError} when no plugin is in context, the ref is
6670
+ * malformed or names no credential, the value is empty or invalid for its
6671
+ * service, the store rejects the write, or the calling plugin is not scoped
6672
+ * to the credential.
6673
+ */
6674
+ export declare function storeCredential(ref: string, value: string, options?: StoreCredentialOptions): Promise<StoredCredentialRef>;
6675
+
6676
+ export declare interface StoreCredentialOptions {
6677
+ /** Human-friendly alias shown in credential listings. */
6678
+ label?: string;
6679
+ /** What the credential is for, surfaced to the agent. */
6680
+ description?: string;
6681
+ /**
6682
+ * Skip the retroactive sweep that removes the value from recent transcripts.
6683
+ * The sweep exists because a secret is often pasted into chat before it is
6684
+ * stored; pass `true` only for a value that provably never transited a
6685
+ * conversation, such as a token minted by an OAuth refresh.
6686
+ */
6687
+ skipTranscriptScrub?: boolean;
6688
+ }
6689
+
6690
+ /** Identity of the credential that was written. */
6691
+ export declare interface StoredCredentialRef {
6692
+ credentialId: string;
6693
+ service: string;
6694
+ field: string;
6695
+ }
6696
+
6513
6697
  /**
6514
6698
  * Daemon-hosted streaming transcriber contract.
6515
6699
  *
@@ -7288,16 +7472,9 @@ export declare interface ToolExecutionResult {
7288
7472
  * wildcards) — what the gateway actually matches against. Mirrors
7289
7473
  * the `allowlistOptions` field on `ConfirmationRequest` SSE events.
7290
7474
  */
7291
- riskAllowlistOptions?: Array<{
7292
- label: string;
7293
- description: string;
7294
- pattern: string;
7295
- }>;
7475
+ riskAllowlistOptions?: RiskAllowlistOption[];
7296
7476
  /** Directory scope ladder for the rule editor (narrowest to broadest). */
7297
- riskDirectoryScopeOptions?: Array<{
7298
- scope: string;
7299
- label: string;
7300
- }>;
7477
+ riskDirectoryScopeOptions?: RiskDirectoryScopeOption[];
7301
7478
  /** Structured activity metadata for client rendering (web search, web fetch, etc).
7302
7479
  * Populated by daemon-internal tools; plugins must not set this. */
7303
7480
  activityMetadata?: ToolActivityMetadata;
@@ -7597,6 +7774,19 @@ export declare interface WebhookUrlOptions {
7597
7774
  sourceIdentifier?: string;
7598
7775
  }
7599
7776
 
7777
+ /**
7778
+ * Web tab visibility and conversation focus, as reported by a `web`-interface
7779
+ * client (a browser tab or the Electron renderer). Distinct from
7780
+ * {@link ClientPresence}: scoped to a single conversation rather than app-wide
7781
+ * attendance, and reported by the shared web renderer rather than the macOS
7782
+ * host-proxy bridge. See `runtime/web-presence.ts` for the read-side policy.
7783
+ */
7784
+ declare interface WebPresenceReport {
7785
+ visible: boolean;
7786
+ /** The conversation currently focused (chat composer on screen), or `null`. */
7787
+ focusedConversationId: string | null;
7788
+ }
7789
+
7600
7790
  declare interface WebSearchMetadata {
7601
7791
  query: string;
7602
7792
  provider: WebSearchProviderId;
package/index.js CHANGED
@@ -2,6 +2,7 @@
2
2
  const api = globalThis[Symbol.for("vellum.plugin-api")] ?? {};
3
3
  export const CLI_COMMAND_HELP = api.CLI_COMMAND_HELP;
4
4
  export const CredentialResolutionError = api.CredentialResolutionError;
5
+ export const CredentialStoreError = api.CredentialStoreError;
5
6
  export const HOOKS = api.HOOKS;
6
7
  export const INTERNAL_NUDGE_OUTPUT_SUPPRESSION = api.INTERNAL_NUDGE_OUTPUT_SUPPRESSION;
7
8
  export const REFUSAL_FALLBACK_TEXT = api.REFUSAL_FALLBACK_TEXT;
@@ -39,6 +40,7 @@ export const listConversations = api.listConversations;
39
40
  export const listInstalledSkills = api.listInstalledSkills;
40
41
  export const openTranscriptionSession = api.openTranscriptionSession;
41
42
  export const parseMessageMetadata = api.parseMessageMetadata;
43
+ export const persistSystemCard = api.persistSystemCard;
42
44
  export const publishEvent = api.publishEvent;
43
45
  export const quarantineRefusedExchanges = api.quarantineRefusedExchanges;
44
46
  export const queryIndex = api.queryIndex;
@@ -51,6 +53,7 @@ export const resolveWebhookUrl = api.resolveWebhookUrl;
51
53
  export const runConversationTurn = api.runConversationTurn;
52
54
  export const searchMessageIdsLexical = api.searchMessageIdsLexical;
53
55
  export const selectedBackendSupportsMultimodal = api.selectedBackendSupportsMultimodal;
56
+ export const storeCredential = api.storeCredential;
54
57
  export const stringifyMessageContent = api.stringifyMessageContent;
55
58
  export const sweepOrphanedGraphNodePoints = api.sweepOrphanedGraphNodePoints;
56
59
  export const syncMessageToDisk = api.syncMessageToDisk;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vellumai/plugin-api",
3
- "version": "0.11.4-staging.4",
3
+ "version": "0.11.5-staging.1",
4
4
  "description": "Public TypeScript authoring contract for Vellum assistant plugins.",
5
5
  "license": "MIT",
6
6
  "type": "module",