@vellumai/plugin-api 0.11.4 → 0.11.5-dev.202608220019.a778cf0

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 +276 -69
  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>>;
@@ -137,11 +137,13 @@ declare const AssistantConfigSchema: z.ZodObject<{
137
137
  provider: z.ZodDefault<z.ZodEnum<{
138
138
  [x: string]: string;
139
139
  }>>;
140
+ apiBase: z.ZodOptional<z.ZodString>;
140
141
  }, z.core.$strip>>;
141
142
  "web-fetch": z.ZodDefault<z.ZodObject<{
142
143
  provider: z.ZodDefault<z.ZodEnum<{
143
144
  [x: string]: string;
144
145
  }>>;
146
+ apiBase: z.ZodOptional<z.ZodString>;
145
147
  }, z.core.$strip>>;
146
148
  stt: z.ZodDefault<z.ZodObject<{
147
149
  provider: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodEnum<{
@@ -601,9 +603,9 @@ declare const AssistantConfigSchema: z.ZodObject<{
601
603
  low: "low";
602
604
  medium: "medium";
603
605
  high: "high";
606
+ none: "none";
604
607
  xhigh: "xhigh";
605
608
  max: "max";
606
- none: "none";
607
609
  }>>;
608
610
  speed: z.ZodOptional<z.ZodEnum<{
609
611
  standard: "standard";
@@ -662,6 +664,7 @@ declare const AssistantConfigSchema: z.ZodObject<{
662
664
  label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
663
665
  description: z.ZodOptional<z.ZodString>;
664
666
  provider_connection: z.ZodOptional<z.ZodString>;
667
+ allowUnlisted: z.ZodOptional<z.ZodBoolean>;
665
668
  status: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
666
669
  active: "active";
667
670
  disabled: "disabled";
@@ -723,9 +726,9 @@ declare const AssistantConfigSchema: z.ZodObject<{
723
726
  low: "low";
724
727
  medium: "medium";
725
728
  high: "high";
729
+ none: "none";
726
730
  xhigh: "xhigh";
727
731
  max: "max";
728
- none: "none";
729
732
  }>>;
730
733
  speed: z.ZodOptional<z.ZodEnum<{
731
734
  standard: "standard";
@@ -1171,8 +1174,8 @@ declare const AssistantConfigSchema: z.ZodObject<{
1171
1174
  plugins: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1172
1175
  pluginUpdates: z.ZodDefault<z.ZodObject<{
1173
1176
  mode: z.ZodDefault<z.ZodEnum<{
1174
- auto: "auto";
1175
1177
  manual: "manual";
1178
+ auto: "auto";
1176
1179
  }>>;
1177
1180
  strategy: z.ZodDefault<z.ZodEnum<{
1178
1181
  theirs: "theirs";
@@ -1240,12 +1243,12 @@ declare const AssistantEventEnvelopeSchema: z.ZodObject<{
1240
1243
  type: z.ZodLiteral<"acp_session_update">;
1241
1244
  acpSessionId: z.ZodString;
1242
1245
  updateType: z.ZodEnum<{
1246
+ plan: "plan";
1243
1247
  agent_message_chunk: "agent_message_chunk";
1244
1248
  agent_thought_chunk: "agent_thought_chunk";
1245
1249
  user_message_chunk: "user_message_chunk";
1246
1250
  tool_call: "tool_call";
1247
1251
  tool_call_update: "tool_call_update";
1248
- plan: "plan";
1249
1252
  }>;
1250
1253
  content: z.ZodOptional<z.ZodString>;
1251
1254
  toolCallId: z.ZodOptional<z.ZodString>;
@@ -1331,8 +1334,8 @@ declare const AssistantEventEnvelopeSchema: z.ZodObject<{
1331
1334
  id: z.ZodString;
1332
1335
  conversationId: z.ZodString;
1333
1336
  status: z.ZodEnum<{
1334
- completed: "completed";
1335
1337
  cancelled: "cancelled";
1338
+ completed: "completed";
1336
1339
  failed: "failed";
1337
1340
  }>;
1338
1341
  exitCode: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
@@ -1424,18 +1427,18 @@ declare const AssistantEventEnvelopeSchema: z.ZodObject<{
1424
1427
  conversationId: z.ZodString;
1425
1428
  requestId: z.ZodString;
1426
1429
  state: z.ZodEnum<{
1427
- timed_out: "timed_out";
1428
1430
  pending: "pending";
1429
1431
  approved: "approved";
1430
1432
  denied: "denied";
1433
+ timed_out: "timed_out";
1431
1434
  resolved_stale: "resolved_stale";
1432
1435
  }>;
1433
1436
  source: z.ZodEnum<{
1437
+ timeout: "timeout";
1434
1438
  system: "system";
1435
1439
  button: "button";
1436
1440
  inline_nl: "inline_nl";
1437
1441
  auto_deny: "auto_deny";
1438
- timeout: "timeout";
1439
1442
  }>;
1440
1443
  causedByRequestId: z.ZodOptional<z.ZodString>;
1441
1444
  decisionText: z.ZodOptional<z.ZodString>;
@@ -1510,9 +1513,9 @@ declare const AssistantEventEnvelopeSchema: z.ZodObject<{
1510
1513
  }, z.core.$strip>, z.ZodObject<{
1511
1514
  type: z.ZodLiteral<"conversation_list_invalidated">;
1512
1515
  reason: z.ZodEnum<{
1516
+ deleted: "deleted";
1513
1517
  created: "created";
1514
1518
  renamed: "renamed";
1515
- deleted: "deleted";
1516
1519
  reordered: "reordered";
1517
1520
  seen_changed: "seen_changed";
1518
1521
  }>;
@@ -1555,9 +1558,9 @@ declare const AssistantEventEnvelopeSchema: z.ZodObject<{
1555
1558
  enabled: z.ZodBoolean;
1556
1559
  state: z.ZodEnum<{
1557
1560
  unknown: "unknown";
1561
+ ok: "ok";
1558
1562
  disabled: "disabled";
1559
1563
  critical: "critical";
1560
- ok: "ok";
1561
1564
  warning: "warning";
1562
1565
  }>;
1563
1566
  locked: z.ZodBoolean;
@@ -1672,8 +1675,8 @@ declare const AssistantEventEnvelopeSchema: z.ZodObject<{
1672
1675
  hookName: z.ZodString;
1673
1676
  owner: z.ZodObject<{
1674
1677
  kind: z.ZodEnum<{
1675
- plugin: "plugin";
1676
1678
  workspace: "workspace";
1679
+ plugin: "plugin";
1677
1680
  }>;
1678
1681
  id: z.ZodString;
1679
1682
  }, z.core.$strip>;
@@ -1865,9 +1868,9 @@ declare const AssistantEventEnvelopeSchema: z.ZodObject<{
1865
1868
  requestId: z.ZodString;
1866
1869
  conversationId: z.ZodString;
1867
1870
  state: z.ZodEnum<{
1871
+ approved: "approved";
1868
1872
  cancelled: "cancelled";
1869
1873
  superseded: "superseded";
1870
- approved: "approved";
1871
1874
  rejected: "rejected";
1872
1875
  answered: "answered";
1873
1876
  }>;
@@ -2091,6 +2094,25 @@ declare const AssistantEventEnvelopeSchema: z.ZodObject<{
2091
2094
  }, z.core.$strip>, z.ZodObject<{
2092
2095
  type: z.ZodLiteral<"relationship_state_updated">;
2093
2096
  updatedAt: z.ZodString;
2097
+ }, z.core.$strip>, z.ZodObject<{
2098
+ type: z.ZodLiteral<"resource_pressure_status_changed">;
2099
+ status: z.ZodObject<{
2100
+ enabled: z.ZodBoolean;
2101
+ state: z.ZodEnum<{
2102
+ unknown: "unknown";
2103
+ ok: "ok";
2104
+ disabled: "disabled";
2105
+ elevated: "elevated";
2106
+ }>;
2107
+ cpuPercent: z.ZodNullable<z.ZodNumber>;
2108
+ memoryPercent: z.ZodNullable<z.ZodNumber>;
2109
+ cpuElevated: z.ZodBoolean;
2110
+ memoryElevated: z.ZodBoolean;
2111
+ cpuThresholdPercent: z.ZodNumber;
2112
+ memoryThresholdPercent: z.ZodNumber;
2113
+ lastCheckedAt: z.ZodNullable<z.ZodString>;
2114
+ error: z.ZodNullable<z.ZodString>;
2115
+ }, z.core.$strip>;
2094
2116
  }, z.core.$strip>, z.ZodObject<{
2095
2117
  type: z.ZodLiteral<"schedule_conversation_created">;
2096
2118
  conversationId: z.ZodString;
@@ -2160,9 +2182,9 @@ declare const AssistantEventEnvelopeSchema: z.ZodObject<{
2160
2182
  type: z.ZodLiteral<"subagent_status_changed">;
2161
2183
  subagentId: z.ZodString;
2162
2184
  status: z.ZodEnum<{
2185
+ pending: "pending";
2163
2186
  completed: "completed";
2164
2187
  failed: "failed";
2165
- pending: "pending";
2166
2188
  running: "running";
2167
2189
  awaiting_input: "awaiting_input";
2168
2190
  aborted: "aborted";
@@ -2247,6 +2269,7 @@ declare const AssistantEventEnvelopeSchema: z.ZodObject<{
2247
2269
  tavily: "tavily";
2248
2270
  keenable: "keenable";
2249
2271
  firecrawl: "firecrawl";
2272
+ fastcrw: "fastcrw";
2250
2273
  }>;
2251
2274
  resultCount: z.ZodNumber;
2252
2275
  durationMs: z.ZodNumber;
@@ -2268,6 +2291,7 @@ declare const AssistantEventEnvelopeSchema: z.ZodObject<{
2268
2291
  provider: z.ZodOptional<z.ZodEnum<{
2269
2292
  default: "default";
2270
2293
  firecrawl: "firecrawl";
2294
+ fastcrw: "fastcrw";
2271
2295
  }>>;
2272
2296
  status: z.ZodNumber;
2273
2297
  contentType: z.ZodOptional<z.ZodString>;
@@ -2408,6 +2432,11 @@ declare const AssistantEventEnvelopeSchema: z.ZodObject<{
2408
2432
  requestId: z.ZodOptional<z.ZodString>;
2409
2433
  clientMessageId: z.ZodOptional<z.ZodString>;
2410
2434
  }, z.core.$strict>, z.ZodObject<{
2435
+ type: z.ZodLiteral<"watch_retro_completed">;
2436
+ sessionId: z.ZodString;
2437
+ conversationId: z.ZodString;
2438
+ reportReady: z.ZodBoolean;
2439
+ }, z.core.$strip>, z.ZodObject<{
2411
2440
  type: z.ZodLiteral<"workflow_completed">;
2412
2441
  runId: z.ZodString;
2413
2442
  conversationId: z.ZodOptional<z.ZodString>;
@@ -2605,6 +2634,12 @@ export declare class AssistantEventHub {
2605
2634
  * matched.
2606
2635
  */
2607
2636
  setClientPresence(clientId: string, state: DesktopPresenceState): boolean;
2637
+ /**
2638
+ * Record the web tab visibility/focused-conversation reported by a client.
2639
+ * `reportedAt` always advances. Returns true when at least one active
2640
+ * client entry matched.
2641
+ */
2642
+ setClientWebPresence(clientId: string, report: WebPresenceReport): boolean;
2608
2643
  /**
2609
2644
  * Force-disconnect a client by disposing all subscribers for the given
2610
2645
  * `clientId`. Returns the number of disposed entries.
@@ -2636,15 +2671,16 @@ declare const AssistantEventPublishOptionsSchema: z.ZodObject<{
2636
2671
  }>>;
2637
2672
  targetClientId: z.ZodOptional<z.ZodString>;
2638
2673
  targetInterfaceId: z.ZodOptional<z.ZodEnum<{
2639
- plugin: "plugin";
2640
- telegram: "telegram";
2641
2674
  phone: "phone";
2675
+ a2a: "a2a";
2642
2676
  whatsapp: "whatsapp";
2677
+ discord: "discord";
2678
+ telegram: "telegram";
2643
2679
  slack: "slack";
2644
2680
  email: "email";
2645
- a2a: "a2a";
2646
- discord: "discord";
2681
+ plugin: "plugin";
2647
2682
  macos: "macos";
2683
+ windows: "windows";
2648
2684
  ios: "ios";
2649
2685
  cli: "cli";
2650
2686
  web: "web";
@@ -2698,12 +2734,12 @@ declare const AssistantEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2698
2734
  type: z.ZodLiteral<"acp_session_update">;
2699
2735
  acpSessionId: z.ZodString;
2700
2736
  updateType: z.ZodEnum<{
2737
+ plan: "plan";
2701
2738
  agent_message_chunk: "agent_message_chunk";
2702
2739
  agent_thought_chunk: "agent_thought_chunk";
2703
2740
  user_message_chunk: "user_message_chunk";
2704
2741
  tool_call: "tool_call";
2705
2742
  tool_call_update: "tool_call_update";
2706
- plan: "plan";
2707
2743
  }>;
2708
2744
  content: z.ZodOptional<z.ZodString>;
2709
2745
  toolCallId: z.ZodOptional<z.ZodString>;
@@ -2789,8 +2825,8 @@ declare const AssistantEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2789
2825
  id: z.ZodString;
2790
2826
  conversationId: z.ZodString;
2791
2827
  status: z.ZodEnum<{
2792
- completed: "completed";
2793
2828
  cancelled: "cancelled";
2829
+ completed: "completed";
2794
2830
  failed: "failed";
2795
2831
  }>;
2796
2832
  exitCode: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
@@ -2882,18 +2918,18 @@ declare const AssistantEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2882
2918
  conversationId: z.ZodString;
2883
2919
  requestId: z.ZodString;
2884
2920
  state: z.ZodEnum<{
2885
- timed_out: "timed_out";
2886
2921
  pending: "pending";
2887
2922
  approved: "approved";
2888
2923
  denied: "denied";
2924
+ timed_out: "timed_out";
2889
2925
  resolved_stale: "resolved_stale";
2890
2926
  }>;
2891
2927
  source: z.ZodEnum<{
2928
+ timeout: "timeout";
2892
2929
  system: "system";
2893
2930
  button: "button";
2894
2931
  inline_nl: "inline_nl";
2895
2932
  auto_deny: "auto_deny";
2896
- timeout: "timeout";
2897
2933
  }>;
2898
2934
  causedByRequestId: z.ZodOptional<z.ZodString>;
2899
2935
  decisionText: z.ZodOptional<z.ZodString>;
@@ -2968,9 +3004,9 @@ declare const AssistantEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2968
3004
  }, z.core.$strip>, z.ZodObject<{
2969
3005
  type: z.ZodLiteral<"conversation_list_invalidated">;
2970
3006
  reason: z.ZodEnum<{
3007
+ deleted: "deleted";
2971
3008
  created: "created";
2972
3009
  renamed: "renamed";
2973
- deleted: "deleted";
2974
3010
  reordered: "reordered";
2975
3011
  seen_changed: "seen_changed";
2976
3012
  }>;
@@ -3013,9 +3049,9 @@ declare const AssistantEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3013
3049
  enabled: z.ZodBoolean;
3014
3050
  state: z.ZodEnum<{
3015
3051
  unknown: "unknown";
3052
+ ok: "ok";
3016
3053
  disabled: "disabled";
3017
3054
  critical: "critical";
3018
- ok: "ok";
3019
3055
  warning: "warning";
3020
3056
  }>;
3021
3057
  locked: z.ZodBoolean;
@@ -3130,8 +3166,8 @@ declare const AssistantEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3130
3166
  hookName: z.ZodString;
3131
3167
  owner: z.ZodObject<{
3132
3168
  kind: z.ZodEnum<{
3133
- plugin: "plugin";
3134
3169
  workspace: "workspace";
3170
+ plugin: "plugin";
3135
3171
  }>;
3136
3172
  id: z.ZodString;
3137
3173
  }, z.core.$strip>;
@@ -3323,9 +3359,9 @@ declare const AssistantEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3323
3359
  requestId: z.ZodString;
3324
3360
  conversationId: z.ZodString;
3325
3361
  state: z.ZodEnum<{
3362
+ approved: "approved";
3326
3363
  cancelled: "cancelled";
3327
3364
  superseded: "superseded";
3328
- approved: "approved";
3329
3365
  rejected: "rejected";
3330
3366
  answered: "answered";
3331
3367
  }>;
@@ -3549,6 +3585,25 @@ declare const AssistantEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3549
3585
  }, z.core.$strip>, z.ZodObject<{
3550
3586
  type: z.ZodLiteral<"relationship_state_updated">;
3551
3587
  updatedAt: z.ZodString;
3588
+ }, z.core.$strip>, z.ZodObject<{
3589
+ type: z.ZodLiteral<"resource_pressure_status_changed">;
3590
+ status: z.ZodObject<{
3591
+ enabled: z.ZodBoolean;
3592
+ state: z.ZodEnum<{
3593
+ unknown: "unknown";
3594
+ ok: "ok";
3595
+ disabled: "disabled";
3596
+ elevated: "elevated";
3597
+ }>;
3598
+ cpuPercent: z.ZodNullable<z.ZodNumber>;
3599
+ memoryPercent: z.ZodNullable<z.ZodNumber>;
3600
+ cpuElevated: z.ZodBoolean;
3601
+ memoryElevated: z.ZodBoolean;
3602
+ cpuThresholdPercent: z.ZodNumber;
3603
+ memoryThresholdPercent: z.ZodNumber;
3604
+ lastCheckedAt: z.ZodNullable<z.ZodString>;
3605
+ error: z.ZodNullable<z.ZodString>;
3606
+ }, z.core.$strip>;
3552
3607
  }, z.core.$strip>, z.ZodObject<{
3553
3608
  type: z.ZodLiteral<"schedule_conversation_created">;
3554
3609
  conversationId: z.ZodString;
@@ -3618,9 +3673,9 @@ declare const AssistantEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3618
3673
  type: z.ZodLiteral<"subagent_status_changed">;
3619
3674
  subagentId: z.ZodString;
3620
3675
  status: z.ZodEnum<{
3676
+ pending: "pending";
3621
3677
  completed: "completed";
3622
3678
  failed: "failed";
3623
- pending: "pending";
3624
3679
  running: "running";
3625
3680
  awaiting_input: "awaiting_input";
3626
3681
  aborted: "aborted";
@@ -3705,6 +3760,7 @@ declare const AssistantEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3705
3760
  tavily: "tavily";
3706
3761
  keenable: "keenable";
3707
3762
  firecrawl: "firecrawl";
3763
+ fastcrw: "fastcrw";
3708
3764
  }>;
3709
3765
  resultCount: z.ZodNumber;
3710
3766
  durationMs: z.ZodNumber;
@@ -3726,6 +3782,7 @@ declare const AssistantEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3726
3782
  provider: z.ZodOptional<z.ZodEnum<{
3727
3783
  default: "default";
3728
3784
  firecrawl: "firecrawl";
3785
+ fastcrw: "fastcrw";
3729
3786
  }>>;
3730
3787
  status: z.ZodNumber;
3731
3788
  contentType: z.ZodOptional<z.ZodString>;
@@ -3866,6 +3923,11 @@ declare const AssistantEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3866
3923
  requestId: z.ZodOptional<z.ZodString>;
3867
3924
  clientMessageId: z.ZodOptional<z.ZodString>;
3868
3925
  }, z.core.$strict>, z.ZodObject<{
3926
+ type: z.ZodLiteral<"watch_retro_completed">;
3927
+ sessionId: z.ZodString;
3928
+ conversationId: z.ZodString;
3929
+ reportReady: z.ZodBoolean;
3930
+ }, z.core.$strip>, z.ZodObject<{
3869
3931
  type: z.ZodLiteral<"workflow_completed">;
3870
3932
  runId: z.ZodString;
3871
3933
  conversationId: z.ZodOptional<z.ZodString>;
@@ -4107,6 +4169,11 @@ declare interface ClientEntry extends BaseSubscriberEntry {
4107
4169
  * In-memory only, so consumers must fail open when it is absent.
4108
4170
  */
4109
4171
  presence?: ClientPresence;
4172
+ /**
4173
+ * Last web tab visibility/focus reported by this client, for clients that
4174
+ * report it. In-memory only, so consumers must fail open when it is absent.
4175
+ */
4176
+ webPresence?: ClientWebPresence;
4110
4177
  }
4111
4178
 
4112
4179
  declare interface ClientPresence {
@@ -4115,6 +4182,11 @@ declare interface ClientPresence {
4115
4182
  reportedAt: Date;
4116
4183
  }
4117
4184
 
4185
+ declare interface ClientWebPresence extends WebPresenceReport {
4186
+ /** When the daemon last heard from the client. Drives staleness. */
4187
+ reportedAt: Date;
4188
+ }
4189
+
4118
4190
  declare interface CliOptionHelp {
4119
4191
  /** Commander flag spec, e.g. `"--path <file>"` or `"-l, --limit <n>"`. */
4120
4192
  flags: string;
@@ -4284,13 +4356,14 @@ export declare function createLiveVoiceConnection(options: {
4284
4356
  *
4285
4357
  * ## Plugin scoping
4286
4358
  *
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.
4359
+ * When a plugin is in context (its hook, tool, or one of its own
4360
+ * `/x/plugins/<name>/` routes is executing, tracked by
4361
+ * {@link ../plugins/plugin-execution-context.getCurrentPluginName}), resolution
4362
+ * is restricted: the plugin may only resolve credentials whose `service`
4363
+ * equals its manifest name (`imessage/api_key` for plugin `imessage`). It
4364
+ * cannot read another service (`openai/api_key`, `openai/imessage`). Outside
4365
+ * any plugin context (host-internal callers, CLI, tests) the resolver is
4366
+ * unscoped and behaves like a direct reveal.
4294
4367
  */
4295
4368
  /**
4296
4369
  * Raised when a credential cannot be resolved: the reference does not match a
@@ -4301,6 +4374,45 @@ export declare class CredentialResolutionError extends Error {
4301
4374
  constructor(message: string);
4302
4375
  }
4303
4376
 
4377
+ /**
4378
+ * Plugin-facing credential storage.
4379
+ *
4380
+ * {@link storeCredential} writes a credential's plaintext to the secure store,
4381
+ * the same write `assistant credentials set` performs, naming it either by an
4382
+ * existing credential's UUID or by a `"service/field"` string, the same
4383
+ * vocabulary {@link ./resolve-credential.resolveCredential} reads back. A
4384
+ * plugin that obtains a token for itself (an OAuth exchange it drives, a key a
4385
+ * user hands it through its own route) persists it here instead of inventing
4386
+ * its own on-disk secret file.
4387
+ *
4388
+ * ## Plugin scoping
4389
+ *
4390
+ * A plugin may only write credentials whose `service` equals its manifest
4391
+ * name (`imessage/api_key` for plugin `imessage`). It cannot write another
4392
+ * service (`openai/api_key`, `openai/imessage`). The name comes from the
4393
+ * execution context
4394
+ * ({@link ../plugins/plugin-execution-context.getCurrentPluginName}), which the
4395
+ * host establishes around a plugin's hook, tool, and route invocations.
4396
+ *
4397
+ * Unlike the read path, this **fails closed**: with no plugin in context there
4398
+ * is nobody to scope the write to, so it is refused rather than treated as an
4399
+ * unscoped host write. A plugin's module body is evaluated by the loader
4400
+ * outside any context, and an unscoped branch there would let top-level code
4401
+ * overwrite the user's own credentials. Host-internal callers that legitimately
4402
+ * write unscoped (the `credentials/set` route, the CLI behind it) compose
4403
+ * {@link ../tools/credentials/store.storeCredentialValue} directly. This
4404
+ * matches the plugin-owned index (`indexDocument`), which likewise requires a
4405
+ * context because a write with no owner has nothing to attribute.
4406
+ */
4407
+ /**
4408
+ * Raised when a credential cannot be stored: the reference is malformed, the
4409
+ * value is empty or invalid for its service, the secure backend rejected the
4410
+ * write, or the calling plugin is not permitted to write the credential.
4411
+ */
4412
+ export declare class CredentialStoreError extends Error {
4413
+ constructor(message: string);
4414
+ }
4415
+
4304
4416
  /**
4305
4417
  * Delete a conversation, yielding the event loop between row batches, and
4306
4418
  * enqueue vector-store cleanup for the memory segments and summaries the
@@ -4441,6 +4553,9 @@ export declare function getModelProfiles(): ModelProfileInfo[];
4441
4553
  * When the VELLUM_WORKSPACE_DIR env var is set, returns that value (used in
4442
4554
  * containerized deployments where the workspace is a separate volume).
4443
4555
  * Otherwise falls back to ~/.vellum/workspace.
4556
+ *
4557
+ * In test processes the resolved directory must live under `os.tmpdir()`
4558
+ * (see the live-workspace guard above); anything else throws.
4444
4559
  */
4445
4560
  export declare function getWorkspaceDir(): string;
4446
4561
 
@@ -4550,9 +4665,9 @@ export declare const HOOKS: {
4550
4665
  };
4551
4666
 
4552
4667
  /**
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).
4668
+ * Host proxy capabilities that an interface can support. macOS supports all
4669
+ * of them, Windows withholds app control, and chrome-extension supports only
4670
+ * host_browser through the Chrome DevTools Protocol proxy.
4556
4671
  */
4557
4672
  declare const HOST_PROXY_CAPABILITIES: readonly ["host_bash", "host_file", "host_cu", "host_browser", "host_app_control", "host_ui_snapshot"];
4558
4673
 
@@ -4657,7 +4772,7 @@ declare interface InsertedMessage {
4657
4772
  deduplicated: boolean;
4658
4773
  }
4659
4774
 
4660
- declare const INTERFACE_IDS: readonly ["macos", "ios", "cli", "telegram", "phone", "web", "whatsapp", "slack", "email", "chrome-extension", "a2a", "discord", "route", "plugin"];
4775
+ declare const INTERFACE_IDS: readonly ["macos", "windows", "ios", "cli", "telegram", "phone", "web", "whatsapp", "slack", "email", "chrome-extension", "a2a", "discord", "route", "plugin"];
4661
4776
 
4662
4777
  declare type InterfaceId = (typeof INTERFACE_IDS)[number];
4663
4778
 
@@ -5121,32 +5236,33 @@ declare type MessageMetadata = ReturnType<parseMessageMetadata_2>;
5121
5236
  declare type MessageMetadata_2 = z.infer<typeof messageMetadataSchema>;
5122
5237
 
5123
5238
  declare const messageMetadataSchema: z.ZodObject<{
5239
+ sentAt: z.ZodOptional<z.ZodNumber>;
5124
5240
  userMessageChannel: z.ZodOptional<z.ZodEnum<{
5125
- plugin: "plugin";
5126
- vellum: "vellum";
5127
- platform: "platform";
5128
- telegram: "telegram";
5129
5241
  phone: "phone";
5242
+ platform: "platform";
5243
+ a2a: "a2a";
5244
+ vellum: "vellum";
5130
5245
  whatsapp: "whatsapp";
5246
+ discord: "discord";
5247
+ telegram: "telegram";
5131
5248
  slack: "slack";
5132
5249
  email: "email";
5133
- a2a: "a2a";
5134
- discord: "discord";
5250
+ plugin: "plugin";
5135
5251
  }>>;
5136
5252
  assistantMessageChannel: z.ZodOptional<z.ZodEnum<{
5137
- plugin: "plugin";
5138
- vellum: "vellum";
5139
- platform: "platform";
5140
- telegram: "telegram";
5141
5253
  phone: "phone";
5254
+ platform: "platform";
5255
+ a2a: "a2a";
5256
+ vellum: "vellum";
5142
5257
  whatsapp: "whatsapp";
5258
+ discord: "discord";
5259
+ telegram: "telegram";
5143
5260
  slack: "slack";
5144
5261
  email: "email";
5145
- a2a: "a2a";
5146
- discord: "discord";
5262
+ plugin: "plugin";
5147
5263
  }>>;
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>>>;
5264
+ 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>>>;
5265
+ 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
5266
  client: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
5151
5267
  clientOsFromRequest: z.ZodOptional<z.ZodBoolean>;
5152
5268
  subagentNotification: z.ZodOptional<z.ZodObject<{
@@ -5174,16 +5290,16 @@ declare const messageMetadataSchema: z.ZodObject<{
5174
5290
  }>>;
5175
5291
  model: z.ZodOptional<z.ZodString>;
5176
5292
  provenanceSourceChannel: z.ZodOptional<z.ZodEnum<{
5177
- plugin: "plugin";
5178
- vellum: "vellum";
5179
- platform: "platform";
5180
- telegram: "telegram";
5181
5293
  phone: "phone";
5294
+ platform: "platform";
5295
+ a2a: "a2a";
5296
+ vellum: "vellum";
5182
5297
  whatsapp: "whatsapp";
5298
+ discord: "discord";
5299
+ telegram: "telegram";
5183
5300
  slack: "slack";
5184
5301
  email: "email";
5185
- a2a: "a2a";
5186
- discord: "discord";
5302
+ plugin: "plugin";
5187
5303
  }>>;
5188
5304
  provenanceGuardianExternalUserId: z.ZodOptional<z.ZodString>;
5189
5305
  provenanceRequesterIdentifier: z.ZodOptional<z.ZodString>;
@@ -5200,8 +5316,8 @@ declare const messageMetadataSchema: z.ZodObject<{
5200
5316
  command: z.ZodString;
5201
5317
  startedAt: z.ZodNumber;
5202
5318
  status: z.ZodEnum<{
5203
- completed: "completed";
5204
5319
  cancelled: "cancelled";
5320
+ completed: "completed";
5205
5321
  failed: "failed";
5206
5322
  }>;
5207
5323
  exitCode: z.ZodNullable<z.ZodNumber>;
@@ -5308,6 +5424,37 @@ export declare function parseMessageMetadata(metadataJson: string | null): Promi
5308
5424
  */
5309
5425
  declare function parseMessageMetadata_2(metadataJson: string | null): MessageMetadata_2 | undefined;
5310
5426
 
5427
+ /**
5428
+ * Plugin-facing facade over the host's system-card writer: a daemon-authored
5429
+ * transcript notice, persisted as an assistant row stamped
5430
+ * `messageKind: "system_card"` so clients render it as a standalone system
5431
+ * notice rather than assistant-persona speech. Plugins use it to tell the user
5432
+ * about something the turn did to their input that the model's own reply
5433
+ * cannot explain (e.g. an attachment the turn could not send).
5434
+ *
5435
+ * The writer is loaded through a dynamic `import()` inside the wrapper, for the
5436
+ * same reason `persistence/conversation-plugin-facade.ts` does: it carries the
5437
+ * DB/drizzle import graph, whose named exports must not be forced to resolve
5438
+ * merely because a plugin imported `@vellumai/plugin-api`. Suites that
5439
+ * partial-mock a module in that graph would otherwise fail to instantiate.
5440
+ */
5441
+ /**
5442
+ * Persist a system card in a conversation's transcript and announce it to
5443
+ * connected clients through the sync invalidation that drives a refetch.
5444
+ * Returns the persisted message id.
5445
+ *
5446
+ * A plugin card is non-terminal: it never emits `message_complete`, so a card
5447
+ * written from a hook that runs inside a turn leaves that turn's streaming and
5448
+ * processing state untouched. It is also not appended to the conversation's
5449
+ * in-memory working history, so it cannot leave a trailing assistant message
5450
+ * for the turn's next provider call to continue from.
5451
+ */
5452
+ export declare function persistSystemCard(opts: {
5453
+ conversationId: string;
5454
+ text: string;
5455
+ metadata: Record<string, unknown>;
5456
+ }): Promise<string>;
5457
+
5311
5458
  /**
5312
5459
  * The subset of {@link AssistantEventHub} workspace plugins may use. Picking
5313
5460
  * method signatures off the class keeps the facade in sync with the hub while
@@ -6083,6 +6230,23 @@ export declare function resolveUserName(workspaceDir: string): string | null;
6083
6230
  */
6084
6231
  export declare function resolveWebhookUrl(options: WebhookUrlOptions): Promise<string>;
6085
6232
 
6233
+ declare type RiskAllowlistOption = z.infer<typeof RiskAllowlistOptionSchema>;
6234
+
6235
+ /** Minimatch ladder for the "always allow" prompt option (what a rule matches). */
6236
+ declare const RiskAllowlistOptionSchema: z.ZodObject<{
6237
+ label: z.ZodString;
6238
+ description: z.ZodString;
6239
+ pattern: z.ZodString;
6240
+ }, z.core.$strip>;
6241
+
6242
+ declare type RiskDirectoryScopeOption = z.infer<typeof RiskDirectoryScopeOptionSchema>;
6243
+
6244
+ /** Directory ladder for filesystem operations; `scope` is a path glob or `everywhere`. */
6245
+ declare const RiskDirectoryScopeOptionSchema: z.ZodObject<{
6246
+ scope: z.ZodString;
6247
+ label: z.ZodString;
6248
+ }, z.core.$strip>;
6249
+
6086
6250
  export declare enum RiskLevel {
6087
6251
  Low = "low",
6088
6252
  Medium = "medium",
@@ -6510,6 +6674,43 @@ declare interface StopInputContext {
6510
6674
  readonly exitReason: AgentLoopExitReason;
6511
6675
  }
6512
6676
 
6677
+ /**
6678
+ * Store a credential's plaintext value, creating it or replacing the value of
6679
+ * an existing one.
6680
+ *
6681
+ * @param ref A credential UUID (an existing credential) or a `"service/field"`
6682
+ * string (created when no such credential exists).
6683
+ * @param value The plaintext value. Edge whitespace is trimmed.
6684
+ * @returns The identity of the stored credential, which
6685
+ * {@link ./resolve-credential.resolveCredential} accepts as a ref.
6686
+ * @throws {CredentialStoreError} when no plugin is in context, the ref is
6687
+ * malformed or names no credential, the value is empty or invalid for its
6688
+ * service, the store rejects the write, or the calling plugin is not scoped
6689
+ * to the credential.
6690
+ */
6691
+ export declare function storeCredential(ref: string, value: string, options?: StoreCredentialOptions): Promise<StoredCredentialRef>;
6692
+
6693
+ export declare interface StoreCredentialOptions {
6694
+ /** Human-friendly alias shown in credential listings. */
6695
+ label?: string;
6696
+ /** What the credential is for, surfaced to the agent. */
6697
+ description?: string;
6698
+ /**
6699
+ * Skip the retroactive sweep that removes the value from recent transcripts.
6700
+ * The sweep exists because a secret is often pasted into chat before it is
6701
+ * stored; pass `true` only for a value that provably never transited a
6702
+ * conversation, such as a token minted by an OAuth refresh.
6703
+ */
6704
+ skipTranscriptScrub?: boolean;
6705
+ }
6706
+
6707
+ /** Identity of the credential that was written. */
6708
+ export declare interface StoredCredentialRef {
6709
+ credentialId: string;
6710
+ service: string;
6711
+ field: string;
6712
+ }
6713
+
6513
6714
  /**
6514
6715
  * Daemon-hosted streaming transcriber contract.
6515
6716
  *
@@ -7288,16 +7489,9 @@ export declare interface ToolExecutionResult {
7288
7489
  * wildcards) — what the gateway actually matches against. Mirrors
7289
7490
  * the `allowlistOptions` field on `ConfirmationRequest` SSE events.
7290
7491
  */
7291
- riskAllowlistOptions?: Array<{
7292
- label: string;
7293
- description: string;
7294
- pattern: string;
7295
- }>;
7492
+ riskAllowlistOptions?: RiskAllowlistOption[];
7296
7493
  /** Directory scope ladder for the rule editor (narrowest to broadest). */
7297
- riskDirectoryScopeOptions?: Array<{
7298
- scope: string;
7299
- label: string;
7300
- }>;
7494
+ riskDirectoryScopeOptions?: RiskDirectoryScopeOption[];
7301
7495
  /** Structured activity metadata for client rendering (web search, web fetch, etc).
7302
7496
  * Populated by daemon-internal tools; plugins must not set this. */
7303
7497
  activityMetadata?: ToolActivityMetadata;
@@ -7563,7 +7757,7 @@ declare interface WebFetchMetadata {
7563
7757
  }
7564
7758
 
7565
7759
  /** Provider that backed a `web_fetch` call. `default` is the built-in fetcher. */
7566
- declare type WebFetchProviderId = "default" | "firecrawl";
7760
+ declare type WebFetchProviderId = "default" | "firecrawl" | "fastcrw";
7567
7761
 
7568
7762
  /**
7569
7763
  * Public URL resolution for a plugin's own ingress route.
@@ -7597,6 +7791,19 @@ export declare interface WebhookUrlOptions {
7597
7791
  sourceIdentifier?: string;
7598
7792
  }
7599
7793
 
7794
+ /**
7795
+ * Web tab visibility and conversation focus, as reported by a `web`-interface
7796
+ * client (a browser tab or the Electron renderer). Distinct from
7797
+ * {@link ClientPresence}: scoped to a single conversation rather than app-wide
7798
+ * attendance, and reported by the shared web renderer rather than the macOS
7799
+ * host-proxy bridge. See `runtime/web-presence.ts` for the read-side policy.
7800
+ */
7801
+ declare interface WebPresenceReport {
7802
+ visible: boolean;
7803
+ /** The conversation currently focused (chat composer on screen), or `null`. */
7804
+ focusedConversationId: string | null;
7805
+ }
7806
+
7600
7807
  declare interface WebSearchMetadata {
7601
7808
  query: string;
7602
7809
  provider: WebSearchProviderId;
@@ -7607,7 +7814,7 @@ declare interface WebSearchMetadata {
7607
7814
  errorMessage?: string;
7608
7815
  }
7609
7816
 
7610
- declare type WebSearchProviderId = "anthropic-native" | "brave" | "perplexity" | "tavily" | "keenable" | "firecrawl";
7817
+ declare type WebSearchProviderId = "anthropic-native" | "brave" | "perplexity" | "tavily" | "keenable" | "firecrawl" | "fastcrw";
7611
7818
 
7612
7819
  declare interface WebSearchResultItem {
7613
7820
  rank: number;
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",
3
+ "version": "0.11.5-dev.202608220019.a778cf0",
4
4
  "description": "Public TypeScript authoring contract for Vellum assistant plugins.",
5
5
  "license": "MIT",
6
6
  "type": "module",