@xpert-ai/chatkit-types 0.10.0 → 0.11.0

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 CHANGED
@@ -202,6 +202,15 @@ export declare type Button = {
202
202
  disabled?: boolean;
203
203
  };
204
204
 
205
+ /** A persisted timeline event. It is never submitted as a model input. */
206
+ export declare type CallEndedContent = {
207
+ type: 'call_ended';
208
+ sessionId: string;
209
+ startedAt: string | null;
210
+ endedAt: string;
211
+ durationSeconds: number;
212
+ };
213
+
205
214
  export declare type Caption = {
206
215
  type: 'Caption';
207
216
  key?: string;
@@ -597,6 +606,8 @@ export declare type ChatKitOptions = {
597
606
  * @default false
598
607
  */
599
608
  pet?: boolean | ChatKitPetOptions;
609
+ /** Realtime voice controls in the assistant's appearance panel. */
610
+ realtimeVoice?: RealtimeVoiceOptions;
600
611
  /**
601
612
  * The ID of the thread to show when ChatKit is mounted or opened for the first time.
602
613
  * Passing `null` will show the new thread view.
@@ -1442,6 +1453,12 @@ export declare type Col = {
1442
1453
 
1443
1454
  export declare type ColorScheme = 'light' | 'dark';
1444
1455
 
1456
+ export declare type CompletedVoiceCall = {
1457
+ id: string;
1458
+ threadId: string;
1459
+ content: CallEndedContent;
1460
+ };
1461
+
1445
1462
  /** Reason codes emitted by context-compression events. */
1446
1463
  export declare type ContextCompressionReason = 'no_messages' | 'no_unprotected_history' | 'no_token_gain' | 'summary_invalid' | 'summary_input_budget' | 'summary_output_budget' | 'summary_work_limit' | 'summary_constraints_lost' | 'summary_service_error' | 'retry_deferred' | 'context_budget_exceeded' | 'context_validation_failed';
1447
1464
 
@@ -1937,6 +1954,8 @@ export declare type InterruptRequest = ToolCallRequest | ClientToolRequest | HIT
1937
1954
 
1938
1955
  export declare function isApprovalHostReference(value: unknown): value is ApprovalHostReference;
1939
1956
 
1957
+ export declare function isCallEndedContent(value: unknown): value is CallEndedContent;
1958
+
1940
1959
  export declare function isClientToolInterrupt(value: unknown): value is ClientToolInterrupt;
1941
1960
 
1942
1961
  export declare function isClientToolInterruptPayload(value: unknown): value is ClientToolInterruptPayload;
@@ -2252,6 +2271,47 @@ export declare type RadioGroup = {
2252
2271
 
2253
2272
  declare type RadiusValue = '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | 'full' | '100%' | 'none';
2254
2273
 
2274
+ export declare type RealtimeVoiceCall = {
2275
+ id: string;
2276
+ assistantId: string;
2277
+ threadId: string | null;
2278
+ name: string;
2279
+ state: 'connecting' | 'listening' | 'speaking' | 'ended' | 'error';
2280
+ muted: boolean;
2281
+ startedAt?: string;
2282
+ caption?: string;
2283
+ /** Safe, localized host diagnostic; never a raw supplier error. */
2284
+ notice?: string;
2285
+ tasks?: {
2286
+ id: string;
2287
+ label: string;
2288
+ text?: string;
2289
+ pending?: boolean;
2290
+ }[];
2291
+ };
2292
+
2293
+ export declare type RealtimeVoiceCommand = {
2294
+ type: 'start';
2295
+ assistantId: string;
2296
+ threadId: string | null;
2297
+ } | {
2298
+ type: 'mute';
2299
+ callId: string;
2300
+ muted: boolean;
2301
+ } | {
2302
+ type: 'interrupt' | 'end' | 'dismiss' | 'open';
2303
+ callId: string;
2304
+ };
2305
+
2306
+ /** The host owns audio and authentication; ChatKit owns the call surfaces. */
2307
+ export declare type RealtimeVoiceOptions = {
2308
+ enabled: boolean;
2309
+ call?: RealtimeVoiceCall | null;
2310
+ /** Server-confirmed records, merged by ID until conversation history catches up. */
2311
+ completed?: CompletedVoiceCall[];
2312
+ onCommand: (command: RealtimeVoiceCommand) => void | Promise<void>;
2313
+ };
2314
+
2255
2315
  export declare const REQUEST_USER_INPUT_RESULT_PURPOSE_IMPLEMENTATION_CONFIRMATION = "implementation_confirmation";
2256
2316
 
2257
2317
  export declare const REQUEST_USER_INPUT_RESULT_PURPOSE_PLAN_CLARIFICATION = "plan_clarification";
@@ -2853,7 +2913,7 @@ export declare type TMessageContent = string | TMessageContentComplex[];
2853
2913
  /**
2854
2914
  * Enhance {@link MessageContentComplex} in Langchain.js
2855
2915
  */
2856
- export declare type TMessageContentComplex = (TMessageContentText | TMessageContentReasoning | MessageContentImageUrl | TMessageContentComponent | TMessageContentFileActivity | TMessageContentResourceCard | TMessageContentMemory | (Record<string, any> & {
2916
+ export declare type TMessageContentComplex = (CallEndedContent | TMessageContentText | TMessageContentReasoning | MessageContentImageUrl | TMessageContentComponent | TMessageContentFileActivity | TMessageContentResourceCard | TMessageContentMemory | (Record<string, any> & {
2857
2917
  type?: 'text' | 'image_url' | string;
2858
2918
  }) | (Record<string, any> & {
2859
2919
  type?: never;
package/dist/index.js CHANGED
@@ -1110,6 +1110,9 @@ function countFileChangeLines(report) {
1110
1110
  }
1111
1111
  return { status: "ready", added: m - previous[m], removed: n - previous[m] };
1112
1112
  }
1113
+ function isCallEndedContent(value) {
1114
+ return !!value && typeof value === "object" && "type" in value && value.type === "call_ended" && "sessionId" in value && typeof value.sessionId === "string" && "startedAt" in value && (value.startedAt === null || typeof value.startedAt === "string" && Number.isFinite(Date.parse(value.startedAt))) && "endedAt" in value && typeof value.endedAt === "string" && Number.isFinite(Date.parse(value.endedAt)) && "durationSeconds" in value && typeof value.durationSeconds === "number" && Number.isFinite(value.durationSeconds) && value.durationSeconds >= 0;
1115
+ }
1113
1116
  export {
1114
1117
  CHATKIT_ASSISTANT_CUSTOMIZE_EFFECT,
1115
1118
  CHATKIT_TASK_SUMMARY_OPEN_RESOURCE_EFFECT,
@@ -1142,6 +1145,7 @@ export {
1142
1145
  getMessageSkillUsages,
1143
1146
  getPinnedPetPosition,
1144
1147
  isApprovalHostReference,
1148
+ isCallEndedContent,
1145
1149
  isClientToolInterrupt,
1146
1150
  isClientToolInterruptPayload,
1147
1151
  isClientToolInterruptTask,