@vellumai/plugin-api 0.11.4-dev.202608202208.97289f6 → 0.11.4-dev.202608202341.f06cdd5

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 +35 -0
  2. package/index.js +1 -0
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -4536,6 +4536,9 @@ export declare function getModelProfiles(): ModelProfileInfo[];
4536
4536
  * When the VELLUM_WORKSPACE_DIR env var is set, returns that value (used in
4537
4537
  * containerized deployments where the workspace is a separate volume).
4538
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.
4539
4542
  */
4540
4543
  export declare function getWorkspaceDir(): string;
4541
4544
 
@@ -5216,6 +5219,7 @@ declare type MessageMetadata = ReturnType<parseMessageMetadata_2>;
5216
5219
  declare type MessageMetadata_2 = z.infer<typeof messageMetadataSchema>;
5217
5220
 
5218
5221
  declare const messageMetadataSchema: z.ZodObject<{
5222
+ sentAt: z.ZodOptional<z.ZodNumber>;
5219
5223
  userMessageChannel: z.ZodOptional<z.ZodEnum<{
5220
5224
  phone: "phone";
5221
5225
  platform: "platform";
@@ -5403,6 +5407,37 @@ export declare function parseMessageMetadata(metadataJson: string | null): Promi
5403
5407
  */
5404
5408
  declare function parseMessageMetadata_2(metadataJson: string | null): MessageMetadata_2 | undefined;
5405
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
+
5406
5441
  /**
5407
5442
  * The subset of {@link AssistantEventHub} workspace plugins may use. Picking
5408
5443
  * method signatures off the class keeps the facade in sync with the hub while
package/index.js CHANGED
@@ -40,6 +40,7 @@ export const listConversations = api.listConversations;
40
40
  export const listInstalledSkills = api.listInstalledSkills;
41
41
  export const openTranscriptionSession = api.openTranscriptionSession;
42
42
  export const parseMessageMetadata = api.parseMessageMetadata;
43
+ export const persistSystemCard = api.persistSystemCard;
43
44
  export const publishEvent = api.publishEvent;
44
45
  export const quarantineRefusedExchanges = api.quarantineRefusedExchanges;
45
46
  export const queryIndex = api.queryIndex;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vellumai/plugin-api",
3
- "version": "0.11.4-dev.202608202208.97289f6",
3
+ "version": "0.11.4-dev.202608202341.f06cdd5",
4
4
  "description": "Public TypeScript authoring contract for Vellum assistant plugins.",
5
5
  "license": "MIT",
6
6
  "type": "module",