@xpert-ai/chatkit-types 0.3.10 → 0.3.12
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/dist/index.d.ts +69 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -261,6 +261,37 @@ export declare type ChatKitEvents = {
|
|
|
261
261
|
}>;
|
|
262
262
|
};
|
|
263
263
|
|
|
264
|
+
export declare type ChatKitGoalAdapter = {
|
|
265
|
+
getGoal: (params: {
|
|
266
|
+
threadId: string;
|
|
267
|
+
signal?: AbortSignal;
|
|
268
|
+
}) => Promise<ThreadGoal | null>;
|
|
269
|
+
setGoal: (params: {
|
|
270
|
+
threadId?: string | null;
|
|
271
|
+
assistantId: string;
|
|
272
|
+
objective: string;
|
|
273
|
+
runtimeCapabilities?: RuntimeCapabilitiesSelection | null;
|
|
274
|
+
signal?: AbortSignal;
|
|
275
|
+
}) => Promise<ChatKitGoalSetResult>;
|
|
276
|
+
updateGoal: (params: {
|
|
277
|
+
threadId: string;
|
|
278
|
+
objective?: string;
|
|
279
|
+
status?: ChatKitGoalCommandStatus;
|
|
280
|
+
signal?: AbortSignal;
|
|
281
|
+
}) => Promise<ThreadGoal>;
|
|
282
|
+
clearGoal: (params: {
|
|
283
|
+
threadId: string;
|
|
284
|
+
signal?: AbortSignal;
|
|
285
|
+
}) => Promise<ThreadGoal | null>;
|
|
286
|
+
};
|
|
287
|
+
|
|
288
|
+
export declare type ChatKitGoalCommandStatus = Extract<ThreadGoalStatus, 'active' | 'paused'>;
|
|
289
|
+
|
|
290
|
+
export declare type ChatKitGoalSetResult = {
|
|
291
|
+
threadId: string;
|
|
292
|
+
goal: ThreadGoal;
|
|
293
|
+
};
|
|
294
|
+
|
|
264
295
|
export declare type ChatKitI18nText = LocalizedText;
|
|
265
296
|
|
|
266
297
|
export declare type ChatKitImageReference = ChatKitReferenceBase & {
|
|
@@ -305,6 +336,12 @@ export declare type ChatKitOptions = {
|
|
|
305
336
|
* from this ChatKit instance.
|
|
306
337
|
*/
|
|
307
338
|
request?: ChatKitRequestOptions;
|
|
339
|
+
/**
|
|
340
|
+
* Optional persistent goal adapter used by runtime `/goal` commands.
|
|
341
|
+
* When omitted, ChatKit may use a platform-specific default adapter if the
|
|
342
|
+
* active client exposes one.
|
|
343
|
+
*/
|
|
344
|
+
goal?: ChatKitGoalAdapter;
|
|
308
345
|
/**
|
|
309
346
|
* Locale override for ChatKit UI. If not provided, the browser's locale
|
|
310
347
|
* will be used. If the locale is not supported, will fall back to English.
|
|
@@ -643,6 +680,7 @@ export declare type ChatKitSlashCommandAction = {
|
|
|
643
680
|
type: string;
|
|
644
681
|
payload?: Record<string, unknown>;
|
|
645
682
|
};
|
|
683
|
+
runtimeCapabilities?: unknown;
|
|
646
684
|
} | {
|
|
647
685
|
type: 'select_capability';
|
|
648
686
|
capability: ChatKitSlashCommandCapability;
|
|
@@ -1687,6 +1725,22 @@ declare type ThemeColor = {
|
|
|
1687
1725
|
light: string;
|
|
1688
1726
|
};
|
|
1689
1727
|
|
|
1728
|
+
export declare type ThreadGoal = {
|
|
1729
|
+
id?: string;
|
|
1730
|
+
conversationId?: string;
|
|
1731
|
+
threadId: string;
|
|
1732
|
+
objective: string;
|
|
1733
|
+
status: ThreadGoalStatus;
|
|
1734
|
+
tokensUsed: number;
|
|
1735
|
+
elapsedSeconds: number;
|
|
1736
|
+
continuationCount: number;
|
|
1737
|
+
statusUpdatedAt?: string | Date | null;
|
|
1738
|
+
completedAt?: string | Date | null;
|
|
1739
|
+
blockedAt?: string | Date | null;
|
|
1740
|
+
};
|
|
1741
|
+
|
|
1742
|
+
export declare type ThreadGoalStatus = 'active' | 'paused' | 'blocked' | 'usage_limited' | 'budget_limited' | 'complete';
|
|
1743
|
+
|
|
1690
1744
|
/**
|
|
1691
1745
|
* Command to resume with streaming after human decision
|
|
1692
1746
|
*/
|
|
@@ -1899,6 +1953,21 @@ export declare type TThreadContextUsageMetrics = {
|
|
|
1899
1953
|
currency?: string | null;
|
|
1900
1954
|
};
|
|
1901
1955
|
|
|
1956
|
+
export declare type TThreadGoalClearedEvent = {
|
|
1957
|
+
type: 'thread_goal_cleared';
|
|
1958
|
+
conversationId?: string;
|
|
1959
|
+
threadId: string;
|
|
1960
|
+
updatedAt: string;
|
|
1961
|
+
};
|
|
1962
|
+
|
|
1963
|
+
export declare type TThreadGoalUpdatedEvent = {
|
|
1964
|
+
type: 'thread_goal_updated';
|
|
1965
|
+
conversationId?: string;
|
|
1966
|
+
threadId: string;
|
|
1967
|
+
goal: ThreadGoal;
|
|
1968
|
+
updatedAt: string;
|
|
1969
|
+
};
|
|
1970
|
+
|
|
1902
1971
|
export declare type TXpertChatInterruptPatch = Pick<TInterruptCommand, 'agentKey' | 'toolCalls' | 'update'>;
|
|
1903
1972
|
|
|
1904
1973
|
export declare type TXpertChatResumeDecision = {
|