@xpert-ai/chatkit-types 0.8.0 → 0.10.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
@@ -36,6 +36,46 @@ export declare interface ApprovalHostReference {
36
36
  expiresAt: number;
37
37
  }
38
38
 
39
+ /** IDs are resource identifiers, not a closed list of bundled presets. */
40
+ export declare type AssistantAppearance = {
41
+ version: 1;
42
+ kind: 'image';
43
+ } | {
44
+ version: 1;
45
+ kind: 'character';
46
+ id: string;
47
+ color: string;
48
+ config?: AssistantCharacterConfig;
49
+ } | {
50
+ version: 1;
51
+ kind: 'pet';
52
+ id: string;
53
+ /** Sprite layout version; omitted by legacy v1 avatars. */
54
+ spriteVersionNumber?: 1 | 2;
55
+ asset?: {
56
+ type: 'sprite-atlas' | 'animated-image';
57
+ url: string;
58
+ };
59
+ };
60
+
61
+ export declare type AssistantCharacterConfig = {
62
+ shape: 'round' | 'pebble' | 'pill' | 'drop' | 'flame' | 'triangle' | 'square' | 'bag' | 'star' | 'heart' | 'cloud' | 'clover';
63
+ eyes: 'oval' | 'toon' | 'pill' | 'dot' | 'ring' | 'happy' | 'sleepy' | 'wink' | 'plus' | 'slash' | 'squint';
64
+ mouth: 'none' | 'smile' | 'open' | 'neutral' | 'o';
65
+ motion: 'float' | 'bounce' | 'sway' | 'none';
66
+ eyeSize: number;
67
+ eyeSpacing: number;
68
+ brows?: 'none' | 'flat' | 'angry' | 'worried' | 'raised';
69
+ ink?: 'auto' | 'dark' | 'light';
70
+ tilt?: number;
71
+ speed?: number;
72
+ blink?: boolean;
73
+ };
74
+
75
+ export declare type AssistantCustomizeEffect = {
76
+ assistantId: string;
77
+ };
78
+
39
79
  /**
40
80
  * strategies to host files before attaching them to messages.
41
81
  */
@@ -220,6 +260,8 @@ export declare type ChatFileChange = {
220
260
  updatedAt?: string;
221
261
  };
222
262
 
263
+ export declare const CHATKIT_ASSISTANT_CUSTOMIZE_EFFECT = "assistant.customize";
264
+
223
265
  export declare const CHATKIT_TASK_SUMMARY_OPEN_RESOURCE_EFFECT: "task_summary.open_resource";
224
266
 
225
267
  export declare interface ChatKitApprovalsOptions {
@@ -231,6 +273,18 @@ export declare interface ChatKitApprovalsOptions {
231
273
  onAction?: (input: ApprovalActionRequest) => Promise<void> | void;
232
274
  }
233
275
 
276
+ /** Computer shortcuts in the Assistant details dialog. Remote targets use registered View keys. */
277
+ export declare type ChatKitAssistantComputers = {
278
+ cloud?: {
279
+ viewKey: string;
280
+ };
281
+ /** Host-reported local Shell state; opening emits assistant.computer.open with kind: local. */
282
+ local?: {
283
+ name?: string;
284
+ status: 'loading' | 'unavailable' | 'disabled' | 'ready' | 'connected' | 'error';
285
+ };
286
+ };
287
+
234
288
  export declare type ChatKitClientSecretObject = {
235
289
  secret: string;
236
290
  organizationId?: string;
@@ -460,6 +514,14 @@ export declare type ChatKitMessageNavigationOptions = {
460
514
  enabled?: boolean;
461
515
  };
462
516
 
517
+ /** Rendering policy only; never changes messages, execution or model context. */
518
+ export declare type ChatKitMessagePresentationOptions = {
519
+ /** Defaults to the existing transcript presentation. */
520
+ mode?: 'transcript' | 'bubbles';
521
+ /** Collapse the process before the final answer. Only applies to transcript. */
522
+ collapseProcess?: boolean;
523
+ };
524
+
463
525
  export declare type ChatKitOptions = {
464
526
  /**
465
527
  * ChatKit iframe URL for web component integrations.
@@ -513,10 +575,7 @@ export declare type ChatKitOptions = {
513
575
  */
514
576
  messageNavigation?: ChatKitMessageNavigationOptions;
515
577
  /** Message presentation only; never changes stored messages or model context. */
516
- messagePresentation?: {
517
- /** Collapse the process preceding each final assistant answer. Default: false. */
518
- collapseProcess?: boolean;
519
- };
578
+ messagePresentation?: ChatKitMessagePresentationOptions;
520
579
  /**
521
580
  * Optional Xpert Remote Views workbench.
522
581
  *
@@ -576,6 +635,15 @@ export declare type ChatKitOptions = {
576
635
  */
577
636
  header?: {
578
637
  enabled?: boolean;
638
+ /** Center the published Assistant character in bubble mode. Defaults to true. */
639
+ character?: {
640
+ enabled?: boolean;
641
+ /** Shows customization actions, emitted as the assistant.customize public effect. */
642
+ customizable?: boolean;
643
+ computers?: ChatKitAssistantComputers;
644
+ /** Honor an explicit reduced-animation preference in addition to the OS setting. */
645
+ reducedMotion?: boolean;
646
+ };
579
647
  /** Enable native Electron dragging/OS double-click behavior on unused chat and Workbench header space. Defaults to false. */
580
648
  windowDrag?: boolean;
581
649
  /**
@@ -791,6 +859,8 @@ export declare type ChatKitPetBoundsPadding = {
791
859
  export declare type ChatKitPetCharacter = {
792
860
  type: 'sprite-atlas';
793
861
  src: string;
862
+ /** v1: 8 × 9; v2: 8 × 11, with 16 directional poses in the final two rows. */
863
+ spriteVersionNumber?: 1 | 2;
794
864
  atlas?: ChatKitPetSpriteAtlas;
795
865
  };
796
866
 
@@ -1005,6 +1075,11 @@ export declare type ChatKitThreadReference = {
1005
1075
  };
1006
1076
 
1007
1077
  export declare type ChatKitWorkbenchClientCommandRequest = {
1078
+ /** User-clicked persisted resource; hosts resolve its canonical target from message history. */
1079
+ resourceCard?: {
1080
+ messageId: string;
1081
+ id: string;
1082
+ };
1008
1083
  commandKey: string;
1009
1084
  payload?: unknown;
1010
1085
  hostType: 'agent';
@@ -1034,9 +1109,8 @@ export declare type ChatKitWorkbenchOptions = {
1034
1109
  */
1035
1110
  enabled?: boolean;
1036
1111
  /**
1037
- * Show a vertical strip of available remote-view icons at the right edge of
1038
- * chat while the workbench is closed. Clicking an icon opens that view.
1039
- * Requires `workbench.enabled`. Disabled by default.
1112
+ * @deprecated Views now open from the stacked-tabs button in the chat header.
1113
+ * This option is retained for compatibility and no longer renders a view rail.
1040
1114
  */
1041
1115
  viewRail?: {
1042
1116
  enabled?: boolean;
@@ -1375,9 +1449,25 @@ declare type ControlSize = '3xs' | '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2
1375
1449
 
1376
1450
  declare type ControlVariant = 'solid' | 'soft' | 'outline' | 'ghost';
1377
1451
 
1452
+ /** Presentation of a committed business resource; distinct from versioned file Artifacts. */
1453
+ export declare interface ConversationResourceCard {
1454
+ resource: {
1455
+ namespace: string;
1456
+ type: string;
1457
+ id: string;
1458
+ artifactId?: string;
1459
+ };
1460
+ title: string;
1461
+ description?: string;
1462
+ icon?: IconDefinition;
1463
+ open: ResourceCardOpenTarget;
1464
+ }
1465
+
1378
1466
  /** Exact line LCS with bounded CPU/memory. Unknown text never becomes zero changes. */
1379
1467
  export declare function countFileChangeLines(report: FileChangeReport): FileChangeLineStats;
1380
1468
 
1469
+ export declare function createResourceCardContent(card: ConversationResourceCard): TMessageContentResourceCard;
1470
+
1381
1471
  declare type CustomApiConfig = {
1382
1472
  /**
1383
1473
  * The URL (relative or absolute) of the ChatKit API. The configured endpoint
@@ -1409,6 +1499,10 @@ declare type CustomApiConfig = {
1409
1499
  xpertId?: string;
1410
1500
  };
1411
1501
 
1502
+ export declare function customCharacterSvg(appearance: Extract<AssistantAppearance, {
1503
+ kind: 'character';
1504
+ }>, state?: string, animate?: boolean): string;
1505
+
1412
1506
  export declare type DatePicker = {
1413
1507
  type: 'DatePicker';
1414
1508
  key?: string;
@@ -1440,6 +1534,8 @@ export declare const DEFAULT_PET_SPRITESHEET_URL = "/pets/boba/spritesheet.webp"
1440
1534
 
1441
1535
  export declare const DEFAULT_PET_STORAGE_KEY = "chatkit:pet:position:v1";
1442
1536
 
1537
+ export declare const defaultCharacterConfig: AssistantCharacterConfig;
1538
+
1443
1539
  export declare type Divider = {
1444
1540
  type: 'Divider';
1445
1541
  key?: string;
@@ -1871,6 +1967,8 @@ export declare function isLangGraphInterruptPayload(value: unknown): value is La
1871
1967
 
1872
1968
  export declare function isLangGraphInterruptTask(value: unknown): value is LangGraphInterruptTask;
1873
1969
 
1970
+ export declare function isResourceCardContent(value: unknown): boolean;
1971
+
1874
1972
  export declare function isToolCallInterrupt(value: unknown): value is ToolCallInterrupt;
1875
1973
 
1876
1974
  export declare function isToolCallInterruptPayload(value: unknown): value is ToolCallInterruptPayload;
@@ -1948,7 +2046,7 @@ export declare function mergeChatSkillUsages(...groups: ReadonlyArray<readonly C
1948
2046
  /** Collapse observed operations to the net change, retaining immutable first/last review references. */
1949
2047
  export declare function mergeFileChanges(items: ChatFileChange[]): ChatFileChange[];
1950
2048
 
1951
- export declare function mergePetSpriteAtlas(override?: ChatKitPetSpriteAtlas): PetSpriteAtlasDefinition;
2049
+ export declare function mergePetSpriteAtlas(override?: ChatKitPetSpriteAtlas, spriteVersionNumber?: 1 | 2): PetSpriteAtlasDefinition;
1952
2050
 
1953
2051
  export declare type MessageContentImageUrl = {
1954
2052
  type: 'image_url';
@@ -2019,10 +2117,17 @@ export declare function normalizeRequestLanguage(locale?: string | null): string
2019
2117
 
2020
2118
  export declare function normalizeThreadReference(value: unknown): ChatKitThreadReference | null;
2021
2119
 
2120
+ export declare function parseAssistantAppearance(value: unknown): AssistantAppearance | undefined;
2121
+
2022
2122
  export declare function parseFileActivityContent(value: unknown): TMessageContentFileActivity | null;
2023
2123
 
2024
2124
  export declare function parseFileChangeReport(value: unknown): FileChangeReport | null;
2025
2125
 
2126
+ /** JSON boundary: copy only supported fields, never executable commands or host URLs. */
2127
+ export declare function parseResourceCard(value: unknown): ConversationResourceCard | null;
2128
+
2129
+ export declare function parseResourceCardContent(value: unknown): TMessageContentResourceCard | null;
2130
+
2026
2131
  export declare const PET_ANIMATION_NAMES: readonly ["idle", "running-right", "running-left", "waving", "jumping", "failed", "waiting", "running", "review"];
2027
2132
 
2028
2133
  export declare type PetFrameAnimationDefinition = {
@@ -2031,6 +2136,12 @@ export declare type PetFrameAnimationDefinition = {
2031
2136
  frameDurations: readonly number[];
2032
2137
  };
2033
2138
 
2139
+ /** v2's 16 poses are clockwise from up; a central dead zone restores idle. */
2140
+ export declare function petLookFrame(dx: number, dy: number, deadZone?: number): {
2141
+ row: number;
2142
+ column: number;
2143
+ } | null;
2144
+
2034
2145
  export declare type PetPosition = {
2035
2146
  x: number;
2036
2147
  y: number;
@@ -2207,6 +2318,21 @@ export declare function resolveLocalizedText(value: unknown, language?: string):
2207
2318
 
2208
2319
  export declare function resolvePetCharacter(character: ChatKitPetCharacter): ResolvedPetCharacter | null;
2209
2320
 
2321
+ export declare function resourceCardId(card: ConversationResourceCard): string;
2322
+
2323
+ export declare type ResourceCardOpenTarget = {
2324
+ viewKey: string;
2325
+ selectionId?: string;
2326
+ parameters?: Record<string, ResourceCardScalar | ResourceCardScalar[]>;
2327
+ } & ({
2328
+ target: 'workbench.view';
2329
+ } | {
2330
+ target: 'assistant.project';
2331
+ projectId: string;
2332
+ });
2333
+
2334
+ export declare type ResourceCardScalar = string | number | boolean | null;
2335
+
2210
2336
  export declare type Row = {
2211
2337
  type: 'Row';
2212
2338
  key?: string;
@@ -2727,7 +2853,7 @@ export declare type TMessageContent = string | TMessageContentComplex[];
2727
2853
  /**
2728
2854
  * Enhance {@link MessageContentComplex} in Langchain.js
2729
2855
  */
2730
- export declare type TMessageContentComplex = (TMessageContentText | TMessageContentReasoning | MessageContentImageUrl | TMessageContentComponent | TMessageContentFileActivity | TMessageContentMemory | (Record<string, any> & {
2856
+ export declare type TMessageContentComplex = (TMessageContentText | TMessageContentReasoning | MessageContentImageUrl | TMessageContentComponent | TMessageContentFileActivity | TMessageContentResourceCard | TMessageContentMemory | (Record<string, any> & {
2731
2857
  type?: 'text' | 'image_url' | string;
2732
2858
  }) | (Record<string, any> & {
2733
2859
  type?: never;
@@ -2790,6 +2916,15 @@ export declare type TMessageContentReasoning = {
2790
2916
  text: string;
2791
2917
  };
2792
2918
 
2919
+ export declare interface TMessageContentResourceCard {
2920
+ type: 'resource_card';
2921
+ id: string;
2922
+ data: ConversationResourceCard;
2923
+ /** Bound by the server, never supplied by an emitting plugin. */
2924
+ messageId?: string;
2925
+ executionId?: string;
2926
+ }
2927
+
2793
2928
  export declare type TMessageContentText = {
2794
2929
  id?: string;
2795
2930
  xpertName?: string;
@@ -2900,7 +3035,7 @@ export declare type ToolOutputImageAttachment = {
2900
3035
 
2901
3036
  export declare type ToolOutputImageMimeType = 'image/png' | 'image/jpeg' | 'image/webp';
2902
3037
 
2903
- export declare type ToolOutputImageSource = 'knowledge-document' | 'sandbox';
3038
+ export declare type ToolOutputImageSource = 'knowledge-document' | 'sandbox' | 'tool';
2904
3039
 
2905
3040
  /**
2906
3041
  * UI-only ToolMessage artifact. ToolMessage content remains the compact
@@ -2992,6 +3127,9 @@ export declare type TXpertChatTarget = {
2992
3127
  /** Receipts are immutable terminal facts; replay replaces by identity, never appends a second operation. */
2993
3128
  export declare function upsertFileActivityContent<T>(content: T[], receipt: TMessageContentFileActivity): (T | TMessageContentFileActivity)[];
2994
3129
 
3130
+ /** Identity is local to one reply. Repeat emissions replace the snapshot in place. */
3131
+ export declare function upsertResourceCardContent<T>(parts: T[], card: TMessageContentResourceCard): (T | TMessageContentResourceCard)[];
3132
+
2995
3133
  export declare type UserMessageContent = unknown;
2996
3134
 
2997
3135
  export declare type WidgetComponent = TextComponent | Title | Caption | Badge | Markdown | Box | Row | Col | Divider | Icon | Image_2 | Button | Checkbox | Spacer | Select | DatePicker | Form | Input | Label | RadioGroup | Textarea | Transition;