@vellumai/plugin-api 0.11.2-dev.202608051547.1e84946 → 0.11.2-dev.202608051734.355dff7

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 +53 -0
  2. package/index.js +1 -0
  3. 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;
@@ -4277,6 +4321,14 @@ export declare function getConversation(id: string): Promise<ConversationRow | n
4277
4321
  */
4278
4322
  export declare function getConversationDirPath(id: string, createdAtMs: number): Promise<string>;
4279
4323
 
4324
+ /**
4325
+ * The persisted `processing_started_at` stamp for a conversation, or null
4326
+ * when the conversation is idle (or the row does not exist). Lets background
4327
+ * consumers age-gate the processing flag: a stamp far in the past is a
4328
+ * stranded flag (a swallowed turn-end clear), not a live turn.
4329
+ */
4330
+ export declare function getConversationProcessingStartedAt(id: string): Promise<number | null>;
4331
+
4280
4332
  /** Fetch one document from the calling plugin's index, or null. */
4281
4333
  export declare function getDocument(documentId: string): Promise<IndexedDocument | null>;
4282
4334
 
@@ -4970,6 +5022,7 @@ declare const messageMetadataSchema: z.ZodObject<{
4970
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>>>;
4971
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>>>;
4972
5024
  client: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
5025
+ clientOsFromRequest: z.ZodOptional<z.ZodBoolean>;
4973
5026
  subagentNotification: z.ZodOptional<z.ZodObject<{
4974
5027
  subagentId: z.ZodString;
4975
5028
  label: z.ZodString;
package/index.js CHANGED
@@ -21,6 +21,7 @@ export const getAssistantName = api.getAssistantName;
21
21
  export const getConfiguredProvider = api.getConfiguredProvider;
22
22
  export const getConversation = api.getConversation;
23
23
  export const getConversationDirPath = api.getConversationDirPath;
24
+ export const getConversationProcessingStartedAt = api.getConversationProcessingStartedAt;
24
25
  export const getDocument = api.getDocument;
25
26
  export const getMessages = api.getMessages;
26
27
  export const getModelProfiles = api.getModelProfiles;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vellumai/plugin-api",
3
- "version": "0.11.2-dev.202608051547.1e84946",
3
+ "version": "0.11.2-dev.202608051734.355dff7",
4
4
  "description": "Public TypeScript authoring contract for Vellum assistant plugins.",
5
5
  "license": "MIT",
6
6
  "type": "module",