@vellumai/plugin-api 0.11.2-dev.202608051637.aae860e → 0.11.2-dev.202608051838.a2809c6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.d.ts +50 -3
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -2533,6 +2533,12 @@ export declare class AssistantEventHub {
2533
2533
  * delivery to remaining subscribers.
2534
2534
  */
2535
2535
  publish(event: AssistantEventEnvelope, options?: AssistantEventPublishOptions): Promise<void>;
2536
+ /**
2537
+ * Yield every active client entry with the given clientId. `subscribe`
2538
+ * disposes any prior entries for the same clientId, so at most one entry
2539
+ * matches.
2540
+ */
2541
+ private activeClientEntries;
2536
2542
  /**
2537
2543
  * Return the active client subscriber with the given clientId, or
2538
2544
  * `undefined` if no such subscriber exists.
@@ -2547,6 +2553,19 @@ export declare class AssistantEventHub {
2547
2553
  * authenticated user identity that opened the target client's SSE stream.
2548
2554
  */
2549
2555
  getActorPrincipalIdForClient(clientId: string): string | undefined;
2556
+ /**
2557
+ * Fill a missing `actorPrincipalId` on a live client subscription.
2558
+ *
2559
+ * Used by the SSE dev-bypass self-heal: when the guardian-delivery cache is
2560
+ * cold at subscribe time, the registration lands without a principal; the
2561
+ * route resolves it async and patches the record here. Keyed by
2562
+ * `connectionId` (not clientId) so a reconnect race cannot patch the
2563
+ * subscription that replaced the one being healed. No-op when the
2564
+ * connection is gone or already carries a principal: this only fills a
2565
+ * missing value, never overwrites one. The value must come from the
2566
+ * daemon's own server-side guardian lookup, never from client input.
2567
+ */
2568
+ fillClientActorPrincipalId(connectionId: string, actorPrincipalId: string): void;
2550
2569
  /**
2551
2570
  * Returns true when at least one active subscriber would receive the given
2552
2571
  * event based on the same conversation matching rules as publish().
@@ -2576,6 +2595,12 @@ export declare class AssistantEventHub {
2576
2595
  * Touch a client subscriber — update `lastActiveAt`. Used by heartbeat.
2577
2596
  */
2578
2597
  touchClient(clientId: string): void;
2598
+ /**
2599
+ * Record the desktop presence state reported by a client. `reportedAt`
2600
+ * always advances. Returns true when at least one active client entry
2601
+ * matched.
2602
+ */
2603
+ setClientPresence(clientId: string, state: DesktopPresenceState): boolean;
2579
2604
  /**
2580
2605
  * Force-disconnect a client by disposing all subscribers for the given
2581
2606
  * `clientId`. Returns the number of disposed entries.
@@ -4031,6 +4056,17 @@ declare interface ClientEntry extends BaseSubscriberEntry {
4031
4056
  * service-token connections that have no principal.
4032
4057
  */
4033
4058
  actorPrincipalId?: string;
4059
+ /**
4060
+ * Last desktop presence reported by this client, for clients that report it.
4061
+ * In-memory only, so consumers must fail open when it is absent.
4062
+ */
4063
+ presence?: ClientPresence;
4064
+ }
4065
+
4066
+ declare interface ClientPresence {
4067
+ state: DesktopPresenceState;
4068
+ /** When the daemon last heard from the client. Drives staleness. */
4069
+ reportedAt: Date;
4034
4070
  }
4035
4071
 
4036
4072
  declare interface CliOptionHelp {
@@ -4189,6 +4225,14 @@ export declare class CredentialResolutionError extends Error {
4189
4225
  */
4190
4226
  export declare function deleteConversation(id: string): Promise<void>;
4191
4227
 
4228
+ /**
4229
+ * The presence states a desktop client may report. Single runtime source: the
4230
+ * stored type and the route's wire enum both derive from this tuple.
4231
+ */
4232
+ declare const DESKTOP_PRESENCE_STATES: readonly ["active", "idle", "away"];
4233
+
4234
+ declare type DesktopPresenceState = (typeof DESKTOP_PRESENCE_STATES)[number];
4235
+
4192
4236
  declare interface DiffInfo {
4193
4237
  filePath: string;
4194
4238
  oldContent: string;
@@ -4978,6 +5022,7 @@ declare const messageMetadataSchema: z.ZodObject<{
4978
5022
  userMessageInterface: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<"telegram" | "phone" | "whatsapp" | "slack" | "email" | "a2a" | "discord" | "macos" | "ios" | "cli" | "web" | "chrome-extension" | "route" | null, string>> & z.ZodType<"telegram" | "phone" | "whatsapp" | "slack" | "email" | "a2a" | "discord" | "macos" | "ios" | "cli" | "web" | "chrome-extension" | "route", string, z.core.$ZodTypeInternals<"telegram" | "phone" | "whatsapp" | "slack" | "email" | "a2a" | "discord" | "macos" | "ios" | "cli" | "web" | "chrome-extension" | "route", string>>>;
4979
5023
  assistantMessageInterface: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<"telegram" | "phone" | "whatsapp" | "slack" | "email" | "a2a" | "discord" | "macos" | "ios" | "cli" | "web" | "chrome-extension" | "route" | null, string>> & z.ZodType<"telegram" | "phone" | "whatsapp" | "slack" | "email" | "a2a" | "discord" | "macos" | "ios" | "cli" | "web" | "chrome-extension" | "route", string, z.core.$ZodTypeInternals<"telegram" | "phone" | "whatsapp" | "slack" | "email" | "a2a" | "discord" | "macos" | "ios" | "cli" | "web" | "chrome-extension" | "route", string>>>;
4980
5024
  client: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
5025
+ clientOsFromRequest: z.ZodOptional<z.ZodBoolean>;
4981
5026
  subagentNotification: z.ZodOptional<z.ZodObject<{
4982
5027
  subagentId: z.ZodString;
4983
5028
  label: z.ZodString;
@@ -6799,10 +6844,12 @@ export declare interface ToolContext {
6799
6844
  invokingCallSite?: LLMCallSite;
6800
6845
  /**
6801
6846
  * Canonical principal ID of the actor on whose behalf this tool invocation
6802
- * is running. Sourced from `conversation.trustContext.guardianPrincipalId`.
6847
+ * is running — the turn's actor principal, falling back to the trust
6848
+ * context's `guardianPrincipalId` (see `resolveTurnActorPrincipalId`).
6803
6849
  * Used by host proxies to bind cross-client targeted execution to the same
6804
- * authenticated user identity. May be undefined for legacy/internal flows
6805
- * with no resolved actor identity.
6850
+ * authenticated user identity, so it must resolve to the SAME principal a
6851
+ * desktop client registers with on its SSE stream. May be undefined for
6852
+ * legacy/internal flows with no resolved actor identity.
6806
6853
  * @legacy
6807
6854
  */
6808
6855
  sourceActorPrincipalId?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vellumai/plugin-api",
3
- "version": "0.11.2-dev.202608051637.aae860e",
3
+ "version": "0.11.2-dev.202608051838.a2809c6",
4
4
  "description": "Public TypeScript authoring contract for Vellum assistant plugins.",
5
5
  "license": "MIT",
6
6
  "type": "module",