@vellumai/plugin-api 0.10.7-dev.202607092039.003f549 → 0.10.7-dev.202607092235.9deedf4
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.
- package/index.d.ts +338 -0
- package/index.js +15 -0
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -60,6 +60,40 @@ declare interface AcpSessionUsage {
|
|
|
60
60
|
outputTokens?: number;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
+
/**
|
|
64
|
+
* Append a message to a conversation. This is the low-level insert: it
|
|
65
|
+
* persists and indexes the row only — it does not project the message into
|
|
66
|
+
* the conversation's disk view and does not notify connected clients, so
|
|
67
|
+
* background/internal writes stay silent. A user-visible append pairs this
|
|
68
|
+
* with `syncMessageToDisk` and a client notification, as the host's own
|
|
69
|
+
* out-of-pipeline writers do.
|
|
70
|
+
*/
|
|
71
|
+
export declare function addMessage(conversationId: string, role: MessageRole, content: string, options?: AddMessageOptions): Promise<AddMessageResult>;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Persist a message and run post-insert side effects (memory indexing,
|
|
75
|
+
* attention projection). Delegates the core insert + retry logic to
|
|
76
|
+
* {@link insertMessageCore}.
|
|
77
|
+
*/
|
|
78
|
+
declare function addMessage_2(conversationId: string, role: MessageRole, content: string, options?: AddMessageOptions): Promise<InsertedMessage>;
|
|
79
|
+
|
|
80
|
+
/** Options for {@link addMessage}. Only `skipIndexing` and `clientMessageId`
|
|
81
|
+
* have defaults; `metadata` is genuinely optional. */
|
|
82
|
+
declare interface AddMessageOptions {
|
|
83
|
+
metadata?: Record<string, unknown>;
|
|
84
|
+
skipIndexing?: boolean;
|
|
85
|
+
/** Client-generated nonce for idempotent inserts. When provided,
|
|
86
|
+
* duplicate inserts for the same `(conversationId, clientMessageId)`
|
|
87
|
+
* pair are silently skipped. */
|
|
88
|
+
clientMessageId?: string;
|
|
89
|
+
/** Pre-assigned message ID. When omitted, one is generated
|
|
90
|
+
* internally. Pass the same value as `requestId` for user turns so
|
|
91
|
+
* the persisted row ID matches the runtime correlation ID. */
|
|
92
|
+
id?: string;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
declare type AddMessageResult = Awaited<ReturnType<addMessage_2>>;
|
|
96
|
+
|
|
63
97
|
/**
|
|
64
98
|
* Why an agent turn reached a terminal state. Supplied to the `stop` hook via
|
|
65
99
|
* {@link StopContext.exitReason} and emitted on the `agent_loop_exit` event,
|
|
@@ -200,6 +234,19 @@ declare interface AppUpdatePreviewResponse {
|
|
|
200
234
|
appId: string;
|
|
201
235
|
}
|
|
202
236
|
|
|
237
|
+
/**
|
|
238
|
+
* How {@link listConversations} (and friends) treats archived rows.
|
|
239
|
+
*
|
|
240
|
+
* - `"active"` — exclude rows with a non-null `archivedAt`. The default
|
|
241
|
+
* for sidebar lists, restore, CLI pickers, and anything user-facing.
|
|
242
|
+
* - `"archived"` — return ONLY archived rows. Powers the Archive page
|
|
243
|
+
* so it does not have to pull the entire conversation history and
|
|
244
|
+
* filter client-side.
|
|
245
|
+
* - `"all"` — include both. Reserved for migrations and back-compat
|
|
246
|
+
* call sites that genuinely want everything in one query.
|
|
247
|
+
*/
|
|
248
|
+
declare type ArchiveStatusFilter = "active" | "archived" | "all";
|
|
249
|
+
|
|
203
250
|
declare type AssistantActivityStateEvent = z.infer<typeof AssistantActivityStateEventSchema>;
|
|
204
251
|
|
|
205
252
|
declare const AssistantActivityStateEventSchema: z.ZodObject<{
|
|
@@ -1207,6 +1254,7 @@ declare const AssistantConfigSchema: z.ZodObject<{
|
|
|
1207
1254
|
high: "high";
|
|
1208
1255
|
}>>;
|
|
1209
1256
|
telephonyStreaming: z.ZodDefault<z.ZodBoolean>;
|
|
1257
|
+
utteranceEndMs: z.ZodDefault<z.ZodNumber>;
|
|
1210
1258
|
}, z.core.$strip>>;
|
|
1211
1259
|
callerIdentity: z.ZodDefault<z.ZodObject<{
|
|
1212
1260
|
allowPerCallOverride: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -1227,6 +1275,7 @@ declare const AssistantConfigSchema: z.ZodObject<{
|
|
|
1227
1275
|
speechEnergyThreshold: z.ZodDefault<z.ZodNumber>;
|
|
1228
1276
|
silenceThresholdMs: z.ZodDefault<z.ZodNumber>;
|
|
1229
1277
|
maxTurnDurationMs: z.ZodDefault<z.ZodNumber>;
|
|
1278
|
+
bargeInMinSpeechMs: z.ZodDefault<z.ZodNumber>;
|
|
1230
1279
|
}, z.core.$strip>>;
|
|
1231
1280
|
maxSessionDurationSeconds: z.ZodDefault<z.ZodNumber>;
|
|
1232
1281
|
}, z.core.$strip>>;
|
|
@@ -1725,6 +1774,13 @@ declare interface BookmarkSummary {
|
|
|
1725
1774
|
createdAt: number;
|
|
1726
1775
|
}
|
|
1727
1776
|
|
|
1777
|
+
/**
|
|
1778
|
+
* Build a model-facing excerpt of stored message content around a query,
|
|
1779
|
+
* preserving external-content envelopes so third-party boundaries stay
|
|
1780
|
+
* visible.
|
|
1781
|
+
*/
|
|
1782
|
+
export declare function buildMessageExcerpt(rawContent: string, query: string): Promise<string>;
|
|
1783
|
+
|
|
1728
1784
|
declare interface BundleAppResponse {
|
|
1729
1785
|
type: "bundle_app_response";
|
|
1730
1786
|
bundlePath: string;
|
|
@@ -2131,6 +2187,9 @@ declare interface ContextCompacted {
|
|
|
2131
2187
|
summaryHadMemoryEcho?: boolean;
|
|
2132
2188
|
}
|
|
2133
2189
|
|
|
2190
|
+
/** How a conversation was created / its execution mode. */
|
|
2191
|
+
declare type ConversationCreateType = "standard" | "background" | "scheduled";
|
|
2192
|
+
|
|
2134
2193
|
/**
|
|
2135
2194
|
* The full `conversation-deleted` context a hook receives — the dispatching
|
|
2136
2195
|
* call site's {@link ConversationDeletedInputContext} plus the
|
|
@@ -2298,6 +2357,41 @@ declare const ConversationNoticeEventSchema: z.ZodObject<{
|
|
|
2298
2357
|
errorCategory: z.ZodOptional<z.ZodString>;
|
|
2299
2358
|
}, z.core.$strip>;
|
|
2300
2359
|
|
|
2360
|
+
export declare interface ConversationRow {
|
|
2361
|
+
id: string;
|
|
2362
|
+
title: string | null;
|
|
2363
|
+
createdAt: number;
|
|
2364
|
+
updatedAt: number;
|
|
2365
|
+
totalInputTokens: number;
|
|
2366
|
+
totalOutputTokens: number;
|
|
2367
|
+
totalEstimatedCost: number;
|
|
2368
|
+
contextSummary: string | null;
|
|
2369
|
+
contextCompactedMessageCount: number;
|
|
2370
|
+
contextCompactedAt: number | null;
|
|
2371
|
+
historyStrippedAt: number | null;
|
|
2372
|
+
slackContextCompactionWatermarkTs: string | null;
|
|
2373
|
+
slackContextCompactionWatermarkAt: number | null;
|
|
2374
|
+
conversationType: string;
|
|
2375
|
+
source: string;
|
|
2376
|
+
memoryScopeId: string;
|
|
2377
|
+
originChannel: string | null;
|
|
2378
|
+
originInterface: string | null;
|
|
2379
|
+
forkParentConversationId: string | null;
|
|
2380
|
+
forkParentMessageId: string | null;
|
|
2381
|
+
isAutoTitle: number;
|
|
2382
|
+
scheduleJobId: string | null;
|
|
2383
|
+
lastMessageAt: number | null;
|
|
2384
|
+
archivedAt: number | null;
|
|
2385
|
+
surfacedAt: number | null;
|
|
2386
|
+
inferenceProfile: string | null;
|
|
2387
|
+
/** Parsed plugin-id list scoping this chat; null = default (all globally-enabled). */
|
|
2388
|
+
enabledPlugins: string[] | null;
|
|
2389
|
+
inferenceProfileSessionId: string | null;
|
|
2390
|
+
inferenceProfileExpiresAt: number | null;
|
|
2391
|
+
lastNotifiedInferenceProfile: string | null;
|
|
2392
|
+
processingStartedAt: number | null;
|
|
2393
|
+
}
|
|
2394
|
+
|
|
2301
2395
|
declare interface ConversationsClearResponse {
|
|
2302
2396
|
type: "conversations_clear_response";
|
|
2303
2397
|
cleared: number;
|
|
@@ -2336,6 +2430,9 @@ declare const ConversationTitleUpdatedEventSchema: z.ZodObject<{
|
|
|
2336
2430
|
|
|
2337
2431
|
declare type ConversationType = "standard" | "background" | "scheduled";
|
|
2338
2432
|
|
|
2433
|
+
/** Read-side alias of {@link ConversationCreateType}. */
|
|
2434
|
+
declare type ConversationType_2 = ConversationCreateType;
|
|
2435
|
+
|
|
2339
2436
|
declare interface CopyBlockSurfaceData {
|
|
2340
2437
|
text: string;
|
|
2341
2438
|
label?: string;
|
|
@@ -2346,6 +2443,15 @@ declare interface CustomSlimSkill extends SlimSkillBase {
|
|
|
2346
2443
|
origin: "custom";
|
|
2347
2444
|
}
|
|
2348
2445
|
|
|
2446
|
+
/**
|
|
2447
|
+
* Delete a conversation, yielding the event loop between row batches, and
|
|
2448
|
+
* enqueue vector-store cleanup for the memory segments and summaries the
|
|
2449
|
+
* delete cascaded away — the same vector-cleanup pairing the host's delete
|
|
2450
|
+
* route performs, so facade callers never leave semantic vectors behind. The lexical-index
|
|
2451
|
+
* purge runs inside the delete itself via the persistence hook.
|
|
2452
|
+
*/
|
|
2453
|
+
export declare function deleteConversation(id: string): Promise<void>;
|
|
2454
|
+
|
|
2349
2455
|
declare type _DiagnosticsServerMessages = EnvVarsResponse | DictationResponse;
|
|
2350
2456
|
|
|
2351
2457
|
declare interface DictationResponse {
|
|
@@ -2580,6 +2686,8 @@ declare const ErrorEventSchema: z.ZodObject<{
|
|
|
2580
2686
|
conversationId: z.ZodOptional<z.ZodString>;
|
|
2581
2687
|
}, z.core.$strip>;
|
|
2582
2688
|
|
|
2689
|
+
export declare function extractTextFromStoredMessageContent(raw: string): string;
|
|
2690
|
+
|
|
2583
2691
|
export declare interface FileContent {
|
|
2584
2692
|
type: "file";
|
|
2585
2693
|
source: MediaSource_2;
|
|
@@ -2723,6 +2831,18 @@ export declare function getConfiguredProvider(callSite: LLMCallSite, opts?: {
|
|
|
2723
2831
|
forceOverrideProfile?: boolean;
|
|
2724
2832
|
}): Promise<Provider | null>;
|
|
2725
2833
|
|
|
2834
|
+
/** Look up a conversation row by id. */
|
|
2835
|
+
export declare function getConversation(id: string): Promise<ConversationRow | null>;
|
|
2836
|
+
|
|
2837
|
+
/**
|
|
2838
|
+
* Absolute path of a conversation's disk-view directory under the workspace
|
|
2839
|
+
* naming scheme (timestamp-first, derived from id + creation time).
|
|
2840
|
+
*/
|
|
2841
|
+
export declare function getConversationDirPath(id: string, createdAtMs: number): Promise<string>;
|
|
2842
|
+
|
|
2843
|
+
/** All messages of a conversation in insertion order. */
|
|
2844
|
+
export declare function getMessages(conversationId: string): Promise<MessageRow[]>;
|
|
2845
|
+
|
|
2726
2846
|
/**
|
|
2727
2847
|
* List the workspace inference profiles a plugin can route to, in the order the
|
|
2728
2848
|
* `/model` picker presents them (`llm.profileOrder` first, then the rest
|
|
@@ -2804,6 +2924,9 @@ declare interface GuardianDecisionPrompt {
|
|
|
2804
2924
|
executionTarget?: "sandbox" | "host";
|
|
2805
2925
|
}
|
|
2806
2926
|
|
|
2927
|
+
/** Whether the text tokenizes to at least one lexical search token. */
|
|
2928
|
+
export declare function hasLexicalTokens(text: string): Promise<boolean>;
|
|
2929
|
+
|
|
2807
2930
|
declare interface HeartbeatAlert {
|
|
2808
2931
|
type: "heartbeat_alert";
|
|
2809
2932
|
title: string;
|
|
@@ -3409,6 +3532,18 @@ export declare interface InitContext {
|
|
|
3409
3532
|
assistantVersion: string;
|
|
3410
3533
|
}
|
|
3411
3534
|
|
|
3535
|
+
/** Shape returned by {@link insertMessageCore} and its public wrappers. */
|
|
3536
|
+
declare interface InsertedMessage {
|
|
3537
|
+
id: string;
|
|
3538
|
+
conversationId: string;
|
|
3539
|
+
role: MessageRole;
|
|
3540
|
+
content: string;
|
|
3541
|
+
createdAt: number;
|
|
3542
|
+
metadata?: string;
|
|
3543
|
+
clientMessageId?: string;
|
|
3544
|
+
deduplicated: boolean;
|
|
3545
|
+
}
|
|
3546
|
+
|
|
3412
3547
|
declare interface IntegrationConnectResult {
|
|
3413
3548
|
type: "integration_connect_result";
|
|
3414
3549
|
integrationId: string;
|
|
@@ -3453,6 +3588,9 @@ declare const INTERFACE_IDS: readonly ["macos", "ios", "cli", "telegram", "phone
|
|
|
3453
3588
|
|
|
3454
3589
|
declare type InterfaceId = (typeof INTERFACE_IDS)[number];
|
|
3455
3590
|
|
|
3591
|
+
/** Whether the conversation currently has a turn in flight. */
|
|
3592
|
+
export declare function isConversationProcessing(id: string): Promise<boolean>;
|
|
3593
|
+
|
|
3456
3594
|
/**
|
|
3457
3595
|
* Provider stop-reason classification.
|
|
3458
3596
|
*
|
|
@@ -3486,6 +3624,9 @@ export declare function isMaxTokensStopReason(stopReason: string | null | undefi
|
|
|
3486
3624
|
*/
|
|
3487
3625
|
export declare function listCatalogSkills(): Promise<ResolvedSkillEntry[]>;
|
|
3488
3626
|
|
|
3627
|
+
/** List conversation rows, newest first. */
|
|
3628
|
+
export declare function listConversations(limit?: number, conversationType?: ConversationType_2, offset?: number, archiveStatus?: ArchiveStatusFilter, originChannel?: string): Promise<ConversationRow[]>;
|
|
3629
|
+
|
|
3489
3630
|
/**
|
|
3490
3631
|
* The locally installed skill catalog with resolved states. Includes every
|
|
3491
3632
|
* catalog entry — skills dropped by flag gating or the bundled allowlist are
|
|
@@ -3659,6 +3800,124 @@ declare const MessageDequeuedEventSchema: z.ZodObject<{
|
|
|
3659
3800
|
requestId: z.ZodString;
|
|
3660
3801
|
}, z.core.$strip>;
|
|
3661
3802
|
|
|
3803
|
+
declare type MessageLexicalSearchResult = Awaited<ReturnType<searchMessageIdsLexical_2>>[number];
|
|
3804
|
+
|
|
3805
|
+
declare interface MessageLexicalSearchResult_2 {
|
|
3806
|
+
messageId: string;
|
|
3807
|
+
score: number;
|
|
3808
|
+
}
|
|
3809
|
+
|
|
3810
|
+
/**
|
|
3811
|
+
* Plugin-facing facade over the host conversation store: reads and writes on
|
|
3812
|
+
* conversations and their message history, plus the lexical message-search
|
|
3813
|
+
* surface. Every operation takes explicit parameters and resolves nothing
|
|
3814
|
+
* from config, so the wrappers are pure pass-throughs.
|
|
3815
|
+
*
|
|
3816
|
+
* The store modules are loaded via dynamic `import()` inside each wrapper —
|
|
3817
|
+
* they carry the DB/drizzle import graph and are among the most
|
|
3818
|
+
* partial-mocked modules in the test suite, so importing this module (which
|
|
3819
|
+
* every `@vellumai/plugin-api` consumer does transitively) must not force
|
|
3820
|
+
* their named exports to resolve at instantiation. All type imports above are
|
|
3821
|
+
* erased at compile time. Async for that reason, including the wrappers whose
|
|
3822
|
+
* underlying functions are synchronous.
|
|
3823
|
+
*/
|
|
3824
|
+
declare type MessageMetadata = ReturnType<parseMessageMetadata_2>;
|
|
3825
|
+
|
|
3826
|
+
/** Validated shape of a persisted message's `metadata` column. */
|
|
3827
|
+
declare type MessageMetadata_2 = z.infer<typeof messageMetadataSchema>;
|
|
3828
|
+
|
|
3829
|
+
declare const messageMetadataSchema: z.ZodObject<{
|
|
3830
|
+
userMessageChannel: z.ZodOptional<z.ZodEnum<{
|
|
3831
|
+
vellum: "vellum";
|
|
3832
|
+
telegram: "telegram";
|
|
3833
|
+
phone: "phone";
|
|
3834
|
+
whatsapp: "whatsapp";
|
|
3835
|
+
slack: "slack";
|
|
3836
|
+
email: "email";
|
|
3837
|
+
platform: "platform";
|
|
3838
|
+
a2a: "a2a";
|
|
3839
|
+
}>>;
|
|
3840
|
+
assistantMessageChannel: z.ZodOptional<z.ZodEnum<{
|
|
3841
|
+
vellum: "vellum";
|
|
3842
|
+
telegram: "telegram";
|
|
3843
|
+
phone: "phone";
|
|
3844
|
+
whatsapp: "whatsapp";
|
|
3845
|
+
slack: "slack";
|
|
3846
|
+
email: "email";
|
|
3847
|
+
platform: "platform";
|
|
3848
|
+
a2a: "a2a";
|
|
3849
|
+
}>>;
|
|
3850
|
+
userMessageInterface: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<"telegram" | "phone" | "whatsapp" | "slack" | "email" | "a2a" | "macos" | "ios" | "cli" | "web" | "chrome-extension" | null, string>> & z.ZodType<"telegram" | "phone" | "whatsapp" | "slack" | "email" | "a2a" | "macos" | "ios" | "cli" | "web" | "chrome-extension", string, z.core.$ZodTypeInternals<"telegram" | "phone" | "whatsapp" | "slack" | "email" | "a2a" | "macos" | "ios" | "cli" | "web" | "chrome-extension", string>>>;
|
|
3851
|
+
assistantMessageInterface: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<"telegram" | "phone" | "whatsapp" | "slack" | "email" | "a2a" | "macos" | "ios" | "cli" | "web" | "chrome-extension" | null, string>> & z.ZodType<"telegram" | "phone" | "whatsapp" | "slack" | "email" | "a2a" | "macos" | "ios" | "cli" | "web" | "chrome-extension", string, z.core.$ZodTypeInternals<"telegram" | "phone" | "whatsapp" | "slack" | "email" | "a2a" | "macos" | "ios" | "cli" | "web" | "chrome-extension", string>>>;
|
|
3852
|
+
client: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
3853
|
+
subagentNotification: z.ZodOptional<z.ZodObject<{
|
|
3854
|
+
subagentId: z.ZodString;
|
|
3855
|
+
label: z.ZodString;
|
|
3856
|
+
status: z.ZodEnum<{
|
|
3857
|
+
completed: "completed";
|
|
3858
|
+
failed: "failed";
|
|
3859
|
+
running: "running";
|
|
3860
|
+
aborted: "aborted";
|
|
3861
|
+
}>;
|
|
3862
|
+
error: z.ZodOptional<z.ZodString>;
|
|
3863
|
+
conversationId: z.ZodOptional<z.ZodString>;
|
|
3864
|
+
objective: z.ZodOptional<z.ZodString>;
|
|
3865
|
+
}, z.core.$strip>>;
|
|
3866
|
+
acpNotification: z.ZodOptional<z.ZodObject<{
|
|
3867
|
+
acpSessionId: z.ZodString;
|
|
3868
|
+
agent: z.ZodOptional<z.ZodString>;
|
|
3869
|
+
}, z.core.$strip>>;
|
|
3870
|
+
provenanceTrustClass: z.ZodOptional<z.ZodEnum<{
|
|
3871
|
+
unknown: "unknown";
|
|
3872
|
+
guardian: "guardian";
|
|
3873
|
+
trusted_contact: "trusted_contact";
|
|
3874
|
+
unverified_contact: "unverified_contact";
|
|
3875
|
+
}>>;
|
|
3876
|
+
provenanceSourceChannel: z.ZodOptional<z.ZodEnum<{
|
|
3877
|
+
vellum: "vellum";
|
|
3878
|
+
telegram: "telegram";
|
|
3879
|
+
phone: "phone";
|
|
3880
|
+
whatsapp: "whatsapp";
|
|
3881
|
+
slack: "slack";
|
|
3882
|
+
email: "email";
|
|
3883
|
+
platform: "platform";
|
|
3884
|
+
a2a: "a2a";
|
|
3885
|
+
}>>;
|
|
3886
|
+
provenanceGuardianExternalUserId: z.ZodOptional<z.ZodString>;
|
|
3887
|
+
provenanceRequesterIdentifier: z.ZodOptional<z.ZodString>;
|
|
3888
|
+
automated: z.ZodOptional<z.ZodBoolean>;
|
|
3889
|
+
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
3890
|
+
backgroundToolCompletion: z.ZodOptional<z.ZodObject<{
|
|
3891
|
+
id: z.ZodString;
|
|
3892
|
+
toolName: z.ZodString;
|
|
3893
|
+
conversationId: z.ZodString;
|
|
3894
|
+
command: z.ZodString;
|
|
3895
|
+
startedAt: z.ZodNumber;
|
|
3896
|
+
status: z.ZodEnum<{
|
|
3897
|
+
cancelled: "cancelled";
|
|
3898
|
+
completed: "completed";
|
|
3899
|
+
failed: "failed";
|
|
3900
|
+
}>;
|
|
3901
|
+
exitCode: z.ZodNullable<z.ZodNumber>;
|
|
3902
|
+
output: z.ZodString;
|
|
3903
|
+
completedAt: z.ZodNumber;
|
|
3904
|
+
}, z.core.$strip>>;
|
|
3905
|
+
forkSourceMessageId: z.ZodOptional<z.ZodString>;
|
|
3906
|
+
imageSourcePaths: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
3907
|
+
attachmentStoredPaths: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
3908
|
+
memoryInjectedBlock: z.ZodOptional<z.ZodString>;
|
|
3909
|
+
memoryV3InjectedBlock: z.ZodOptional<z.ZodString>;
|
|
3910
|
+
turnContextBlock: z.ZodOptional<z.ZodString>;
|
|
3911
|
+
pkbSystemReminderBlock: z.ZodOptional<z.ZodString>;
|
|
3912
|
+
workspaceBlock: z.ZodOptional<z.ZodString>;
|
|
3913
|
+
nowScratchpadBlock: z.ZodOptional<z.ZodString>;
|
|
3914
|
+
pkbContextBlock: z.ZodOptional<z.ZodString>;
|
|
3915
|
+
memoryV2StaticBlock: z.ZodOptional<z.ZodString>;
|
|
3916
|
+
backgroundTurnBlock: z.ZodOptional<z.ZodString>;
|
|
3917
|
+
channelCapabilitiesBlock: z.ZodOptional<z.ZodString>;
|
|
3918
|
+
nonInteractiveContextBlock: z.ZodOptional<z.ZodString>;
|
|
3919
|
+
}, z.core.$loose>;
|
|
3920
|
+
|
|
3662
3921
|
declare type MessageQueuedDeletedEvent = z.infer<typeof MessageQueuedDeletedEventSchema>;
|
|
3663
3922
|
|
|
3664
3923
|
declare const MessageQueuedDeletedEventSchema: z.ZodObject<{
|
|
@@ -3685,6 +3944,19 @@ declare const MessageRequestCompleteEventSchema: z.ZodObject<{
|
|
|
3685
3944
|
runStillActive: z.ZodOptional<z.ZodBoolean>;
|
|
3686
3945
|
}, z.core.$strip>;
|
|
3687
3946
|
|
|
3947
|
+
/** Allowed values for the `role` column on `messages`. */
|
|
3948
|
+
declare type MessageRole = "user" | "assistant" | "system";
|
|
3949
|
+
|
|
3950
|
+
declare interface MessageRow {
|
|
3951
|
+
id: string;
|
|
3952
|
+
conversationId: string;
|
|
3953
|
+
role: string;
|
|
3954
|
+
content: string;
|
|
3955
|
+
createdAt: number;
|
|
3956
|
+
metadata: string | null;
|
|
3957
|
+
clientMessageId: string | null;
|
|
3958
|
+
}
|
|
3959
|
+
|
|
3688
3960
|
declare type _MessagesServerMessages = UserMessageEchoEvent | AssistantTurnStartEvent | AssistantTextDeltaEvent | AssistantThinkingDeltaEvent | ToolUseStartEvent | ToolUsePreviewStartEvent | ToolOutputChunkEvent | ToolInputDelta | ToolResultEvent | ConfirmationRequestEvent | SecretRequestEvent | QuestionRequestEvent | MessageCompleteEvent | ErrorEvent_2 | MessageQueuedEvent | MessageDequeuedEvent | MessageRequestCompleteEvent | MessageQueuedDeletedEvent | MessageSteered | SuggestionResponse | ConfirmationStateChanged | AssistantActivityStateEvent | ConversationInferenceProfileUpdated | InteractionResolvedEvent;
|
|
3689
3961
|
|
|
3690
3962
|
declare interface MessageSteered {
|
|
@@ -3901,6 +4173,19 @@ declare interface OwnerInfo {
|
|
|
3901
4173
|
*/
|
|
3902
4174
|
declare type OwnerKind = "default" | "skill" | "mcp" | "plugin" | "workspace";
|
|
3903
4175
|
|
|
4176
|
+
/** Parse a stored message-metadata JSON string; undefined when absent/invalid. */
|
|
4177
|
+
export declare function parseMessageMetadata(metadataJson: string | null): Promise<MessageMetadata>;
|
|
4178
|
+
|
|
4179
|
+
/**
|
|
4180
|
+
* Parse a persisted message's metadata JSON against {@link messageMetadataSchema}
|
|
4181
|
+
* — the single source of truth for its shape — returning the validated fields,
|
|
4182
|
+
* or `undefined` when the column is absent, not valid JSON, or fails validation.
|
|
4183
|
+
* The single place the raw JSON.parse + safeParse dance lives, so callers read
|
|
4184
|
+
* typed fields (e.g. `provenanceTrustClass`, `automated`, `subagentNotification`)
|
|
4185
|
+
* instead of re-implementing it.
|
|
4186
|
+
*/
|
|
4187
|
+
declare function parseMessageMetadata_2(metadataJson: string | null): MessageMetadata_2 | undefined;
|
|
4188
|
+
|
|
3904
4189
|
declare interface PartnerAudit {
|
|
3905
4190
|
risk: RiskLevel_2;
|
|
3906
4191
|
alerts?: number;
|
|
@@ -4618,6 +4903,36 @@ declare interface SchedulesListResponse {
|
|
|
4618
4903
|
|
|
4619
4904
|
declare type _SchedulesServerMessages = SchedulesListResponse | HeartbeatAlert | HeartbeatConversationCreated | HeartbeatConfigResponse | HeartbeatRunsListResponse | HeartbeatRunNowResponse | HeartbeatChecklistResponse | HeartbeatChecklistWriteResponse | FilingConfigResponse | FilingRunNowResponse;
|
|
4620
4905
|
|
|
4906
|
+
/** Sparse lexical search over stored message text; ranked message-id hits. */
|
|
4907
|
+
export declare function searchMessageIdsLexical(query: string, limit: number, opts?: {
|
|
4908
|
+
conversationId?: string;
|
|
4909
|
+
}): Promise<MessageLexicalSearchResult[]>;
|
|
4910
|
+
|
|
4911
|
+
/**
|
|
4912
|
+
* Resolve message-id candidates for `query` from the Qdrant lexical index,
|
|
4913
|
+
* ranked by sparse similarity score (highest first).
|
|
4914
|
+
*
|
|
4915
|
+
* This is a **pure lexical candidate generator**: it returns the top-`limit`
|
|
4916
|
+
* message ids by sparse score with NO visibility, source, or
|
|
4917
|
+
* active-conversation filtering (the only scoping it applies is the optional
|
|
4918
|
+
* `conversationId` restriction). Those exclusions (active conversation,
|
|
4919
|
+
* private conversations, non-message sources) live in SQL at the read sites.
|
|
4920
|
+
*
|
|
4921
|
+
* Callers that apply such post-retrieval SQL filters MUST over-fetch: pass an
|
|
4922
|
+
* inflated `limit` (the `QDRANT_RECALL_CANDIDATE_MULTIPLIER` /
|
|
4923
|
+
* `QDRANT_SEARCH_CANDIDATE_LIMIT` pattern the read sites use) and re-limit
|
|
4924
|
+
* after filtering in SQL. Applying the caller's real limit here first would
|
|
4925
|
+
* let excluded rows consume the candidate slots and drop valid visible
|
|
4926
|
+
* matches below the fold.
|
|
4927
|
+
*
|
|
4928
|
+
* @param query free-text search query
|
|
4929
|
+
* @param limit maximum number of candidates to return
|
|
4930
|
+
* @param opts.conversationId restrict results to a single conversation
|
|
4931
|
+
*/
|
|
4932
|
+
declare function searchMessageIdsLexical_2(query: string, limit: number, opts?: {
|
|
4933
|
+
conversationId?: string;
|
|
4934
|
+
}): Promise<MessageLexicalSearchResult_2[]>;
|
|
4935
|
+
|
|
4621
4936
|
/**
|
|
4622
4937
|
* Result vocabulary for a secret prompt: how the value is delivered and the
|
|
4623
4938
|
* outcome of the prompt. Kept in a leaf module (no runtime dependencies) so
|
|
@@ -5085,6 +5400,23 @@ declare interface StopInputContext {
|
|
|
5085
5400
|
readonly exitReason: AgentLoopExitReason;
|
|
5086
5401
|
}
|
|
5087
5402
|
|
|
5403
|
+
/**
|
|
5404
|
+
* Coerce stored message content into a single human-readable text string,
|
|
5405
|
+
* dropping non-text blocks (images, tool calls, tool results, thinking,
|
|
5406
|
+
* …). Used by call sites that want only the spoken text — sweep-model
|
|
5407
|
+
* context, RAG backfill, bookmark previews. For richer renderings that
|
|
5408
|
+
* include tool metadata, use {@link extractTextFromStoredMessageContent}
|
|
5409
|
+
* instead.
|
|
5410
|
+
*
|
|
5411
|
+
* Handles the two on-disk shapes:
|
|
5412
|
+
* - Modern rows: JSON-serialized `ContentBlock[]`
|
|
5413
|
+
* - Legacy rows: plain string
|
|
5414
|
+
*
|
|
5415
|
+
* Parse failures fall back to returning the raw input trimmed (the
|
|
5416
|
+
* legacy-string path).
|
|
5417
|
+
*/
|
|
5418
|
+
export declare function stringifyMessageContent(stored: string): string;
|
|
5419
|
+
|
|
5088
5420
|
declare interface SubagentDetailResponse {
|
|
5089
5421
|
type: "subagent_detail_response";
|
|
5090
5422
|
subagentId: string;
|
|
@@ -5171,6 +5503,9 @@ declare const SyncChangedEventSchema: z.ZodObject<{
|
|
|
5171
5503
|
|
|
5172
5504
|
declare type _SyncInvalidationServerMessages = SyncChangedEvent;
|
|
5173
5505
|
|
|
5506
|
+
/** Re-sync one persisted message into the conversation's disk view. */
|
|
5507
|
+
export declare function syncMessageToDisk(conversationId: string, messageId: string, createdAtMs: number): Promise<void>;
|
|
5508
|
+
|
|
5174
5509
|
declare interface TableCellValue {
|
|
5175
5510
|
text: string;
|
|
5176
5511
|
icon?: string;
|
|
@@ -5987,6 +6322,9 @@ declare interface UnpublishPageResponse {
|
|
|
5987
6322
|
error?: string;
|
|
5988
6323
|
}
|
|
5989
6324
|
|
|
6325
|
+
/** Merge the given keys into a message's metadata JSON. */
|
|
6326
|
+
export declare function updateMessageMetadata(messageId: string, updates: Record<string, unknown>): Promise<void>;
|
|
6327
|
+
|
|
5990
6328
|
declare type _UpgradesServerMessages = ServiceGroupUpdateStarting | ServiceGroupUpdateProgress | ServiceGroupUpdateComplete;
|
|
5991
6329
|
|
|
5992
6330
|
declare type UsageAttributionProfileSource = "call_site" | "conversation" | "active" | "default" | "unknown";
|
package/index.js
CHANGED
|
@@ -2,15 +2,30 @@
|
|
|
2
2
|
const api = globalThis[Symbol.for("vellum.plugin-api")] ?? {};
|
|
3
3
|
export const HOOKS = api.HOOKS;
|
|
4
4
|
export const RiskLevel = api.RiskLevel;
|
|
5
|
+
export const addMessage = api.addMessage;
|
|
5
6
|
export const assistantEventHub = api.assistantEventHub;
|
|
7
|
+
export const buildMessageExcerpt = api.buildMessageExcerpt;
|
|
8
|
+
export const deleteConversation = api.deleteConversation;
|
|
6
9
|
export const doesSupportVision = api.doesSupportVision;
|
|
7
10
|
export const embedAndUpsert = api.embedAndUpsert;
|
|
11
|
+
export const extractTextFromStoredMessageContent = api.extractTextFromStoredMessageContent;
|
|
8
12
|
export const getAssistantName = api.getAssistantName;
|
|
9
13
|
export const getConfiguredProvider = api.getConfiguredProvider;
|
|
14
|
+
export const getConversation = api.getConversation;
|
|
15
|
+
export const getConversationDirPath = api.getConversationDirPath;
|
|
16
|
+
export const getMessages = api.getMessages;
|
|
10
17
|
export const getModelProfiles = api.getModelProfiles;
|
|
18
|
+
export const hasLexicalTokens = api.hasLexicalTokens;
|
|
19
|
+
export const isConversationProcessing = api.isConversationProcessing;
|
|
11
20
|
export const isMaxTokensStopReason = api.isMaxTokensStopReason;
|
|
12
21
|
export const listCatalogSkills = api.listCatalogSkills;
|
|
22
|
+
export const listConversations = api.listConversations;
|
|
13
23
|
export const listInstalledSkills = api.listInstalledSkills;
|
|
24
|
+
export const parseMessageMetadata = api.parseMessageMetadata;
|
|
14
25
|
export const resolveMediaSourceData = api.resolveMediaSourceData;
|
|
15
26
|
export const resolveUserName = api.resolveUserName;
|
|
27
|
+
export const searchMessageIdsLexical = api.searchMessageIdsLexical;
|
|
16
28
|
export const selectedBackendSupportsMultimodal = api.selectedBackendSupportsMultimodal;
|
|
29
|
+
export const stringifyMessageContent = api.stringifyMessageContent;
|
|
30
|
+
export const syncMessageToDisk = api.syncMessageToDisk;
|
|
31
|
+
export const updateMessageMetadata = api.updateMessageMetadata;
|
package/package.json
CHANGED