@aleph-alpha/chat-kit 0.1.0 → 0.3.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.
Files changed (55) hide show
  1. package/dist/{ChatInput.vue_vue_type_script_setup_true_lang-DVCUwptr.js → ChatInput.vue_vue_type_script_setup_true_lang-BCa2ePSm.js} +160 -34
  2. package/dist/components/base/ChatConversationLayout/ChatConversationLayout.vue.d.ts +1 -0
  3. package/dist/components/base/ChatConversationLayout/ChatConversationLayout.vue.d.ts.map +1 -1
  4. package/dist/components/base/MarkdownRenderer/MarkdownRenderer.stories.d.ts +13 -0
  5. package/dist/components/base/MarkdownRenderer/MarkdownRenderer.stories.d.ts.map +1 -0
  6. package/dist/components/base/MarkdownRenderer/MarkdownRenderer.vue.d.ts +38 -0
  7. package/dist/components/base/MarkdownRenderer/MarkdownRenderer.vue.d.ts.map +1 -0
  8. package/dist/components/base/MarkdownRenderer/index.d.ts +3 -0
  9. package/dist/components/base/MarkdownRenderer/index.d.ts.map +1 -0
  10. package/dist/components/base/MarkdownRenderer/types.d.ts +36 -0
  11. package/dist/components/base/MarkdownRenderer/types.d.ts.map +1 -0
  12. package/dist/components/base/PromptActionButton/PromptActionButton.vue.d.ts +1 -1
  13. package/dist/components/base/PromptActionButton/PromptActionButton.vue.d.ts.map +1 -1
  14. package/dist/components/base/UserMessage/UserMessage.vue.d.ts.map +1 -1
  15. package/dist/components/base/index.d.ts +2 -0
  16. package/dist/components/base/index.d.ts.map +1 -1
  17. package/dist/components/composed/ChatConversation/ChatConversation.stories.d.ts +2 -0
  18. package/dist/components/composed/ChatConversation/ChatConversation.stories.d.ts.map +1 -1
  19. package/dist/components/composed/ChatConversation/ChatConversation.vue.d.ts +10 -0
  20. package/dist/components/composed/ChatConversation/ChatConversation.vue.d.ts.map +1 -1
  21. package/dist/components/composed/ChatConversation/defaultAgentMarkdownClasses.d.ts +3 -0
  22. package/dist/components/composed/ChatConversation/defaultAgentMarkdownClasses.d.ts.map +1 -0
  23. package/dist/components/composed/ChatConversation/index.d.ts +1 -0
  24. package/dist/components/composed/ChatConversation/index.d.ts.map +1 -1
  25. package/dist/components/composed/ChatConversation/types.d.ts +5 -0
  26. package/dist/components/composed/ChatConversation/types.d.ts.map +1 -1
  27. package/dist/components/composed/index.d.ts +1 -1
  28. package/dist/components/composed/index.d.ts.map +1 -1
  29. package/dist/components/index.d.ts +3 -3
  30. package/dist/components/index.d.ts.map +1 -1
  31. package/dist/components/index.js +7 -5
  32. package/dist/composables/index.d.ts +1 -0
  33. package/dist/composables/index.d.ts.map +1 -1
  34. package/dist/composables/index.js +3 -2
  35. package/dist/composables/useChatKitLabels.d.ts +20 -8
  36. package/dist/composables/useChatKitLabels.d.ts.map +1 -1
  37. package/dist/composables/useMarkdownParser.d.ts +6 -0
  38. package/dist/composables/useMarkdownParser.d.ts.map +1 -0
  39. package/dist/handlers/conversationTree.d.ts +16 -0
  40. package/dist/handlers/conversationTree.d.ts.map +1 -0
  41. package/dist/handlers/index.js +1 -1
  42. package/dist/handlers/useMessageHandler.d.ts +23 -11
  43. package/dist/handlers/useMessageHandler.d.ts.map +1 -1
  44. package/dist/index.d.ts +4 -4
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/index.js +11 -8
  47. package/dist/test-utils/createTextPlugin.d.ts +2 -0
  48. package/dist/test-utils/createTextPlugin.d.ts.map +1 -0
  49. package/dist/types.d.ts +16 -9
  50. package/dist/types.d.ts.map +1 -1
  51. package/dist/useChatKitLabels-xZXcnxZZ.js +13740 -0
  52. package/dist/useMessageHandler-Day_sdpQ.js +193 -0
  53. package/package.json +19 -9
  54. package/dist/useChatKitLabels-Bi0szl2l.js +0 -18
  55. package/dist/useMessageHandler-BdcOcw0w.js +0 -73
@@ -1,11 +1,13 @@
1
- import { A, _, a, b, c, d, e, f } from "../ChatInput.vue_vue_type_script_setup_true_lang-DVCUwptr.js";
1
+ import { A, _, a, b, c, d, e, f, g, h } from "../ChatInput.vue_vue_type_script_setup_true_lang-BCa2ePSm.js";
2
2
  export {
3
3
  A as AgentMessage,
4
4
  _ as ChatConversation,
5
5
  a as ChatConversationLayout,
6
6
  b as ChatInput,
7
- c as PromptActionButton,
8
- d as PromptInput,
9
- e as PromptInputDisclaimer,
10
- f as UserMessage
7
+ c as MarkdownRenderer,
8
+ d as PromptActionButton,
9
+ e as PromptInput,
10
+ f as PromptInputDisclaimer,
11
+ g as UserMessage,
12
+ h as defaultAgentMarkdownClasses
11
13
  };
@@ -1,4 +1,5 @@
1
1
  export { useChat } from './useChat';
2
+ export { useMarkdownParser } from './useMarkdownParser';
2
3
  export { provideChatKitLabels, useChatKitLabels, defaultChatKitLabels, CHAT_KIT_LABELS, } from './useChatKitLabels';
3
4
  export type { ChatKitLabels } from './useChatKitLabels';
4
5
  export type { ChatActions, ChatState, UseChatReturn } from './types';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/composables/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/composables/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC"}
@@ -1,9 +1,10 @@
1
1
  import { u } from "../useChat-CtN_iBTc.js";
2
- import { C, d, p, u as u2 } from "../useChatKitLabels-Bi0szl2l.js";
2
+ import { C, d, p, u as u2, a } from "../useChatKitLabels-xZXcnxZZ.js";
3
3
  export {
4
4
  C as CHAT_KIT_LABELS,
5
5
  d as defaultChatKitLabels,
6
6
  p as provideChatKitLabels,
7
7
  u as useChat,
8
- u2 as useChatKitLabels
8
+ u2 as useChatKitLabels,
9
+ a as useMarkdownParser
9
10
  };
@@ -1,4 +1,4 @@
1
- import type { InjectionKey } from 'vue';
1
+ import type { ComputedRef, InjectionKey, Ref } from 'vue';
2
2
  /**
3
3
  * All user-facing strings in ChatKit that may need translation.
4
4
  *
@@ -10,33 +10,45 @@ import type { InjectionKey } from 'vue';
10
10
  * import { provideChatKitLabels } from '@aleph-alpha/chat-kit';
11
11
  *
12
12
  * const { t } = useI18n();
13
- * provideChatKitLabels({
13
+ * provideChatKitLabels(() => ({
14
14
  * agentAvatarAlt: t('chat.agentAvatarAlt'),
15
15
  * inputPlaceholder: t('chat.inputPlaceholder'),
16
- * });
16
+ * }));
17
17
  * ```
18
18
  */
19
- export interface ChatKitLabels {
19
+ export type ChatKitLabels = {
20
20
  /** Alt text for the agent avatar image */
21
21
  agentAvatarAlt: string;
22
+ /** Alt text for the loading avatar image */
23
+ agentLoadingAvatarAlt: string;
22
24
  /** Placeholder text for the chat input field */
23
25
  inputPlaceholder: string;
24
- }
26
+ };
25
27
  /** English defaults used when no labels are provided by the consumer. */
26
28
  export declare const defaultChatKitLabels: ChatKitLabels;
27
29
  /** Vue injection key for ChatKit labels. */
28
- export declare const CHAT_KIT_LABELS: InjectionKey<ChatKitLabels>;
30
+ export declare const CHAT_KIT_LABELS: InjectionKey<ComputedRef<ChatKitLabels>>;
31
+ type PartialLabels = Partial<ChatKitLabels>;
32
+ /** Only accepts `Ref`, `ComputedRef`, or a getter returning `Partial<ChatKitLabels>`. */
33
+ type ReactiveLabels = Ref<PartialLabels> | ComputedRef<PartialLabels> | (() => PartialLabels);
29
34
  /**
30
35
  * Provide ChatKit labels to all descendant components.
31
36
  * Call this in a parent component's `setup()` to override default English strings.
32
37
  *
38
+ * Only reactive sources are accepted (`Ref`, `ComputedRef`, or a getter function)
39
+ * so that labels update automatically when the consumer's locale changes.
40
+ *
33
41
  * Partial overrides are merged with the defaults so consumers only need to
34
42
  * supply the keys they want to translate.
35
43
  */
36
- export declare function provideChatKitLabels(labels: Partial<ChatKitLabels>): void;
44
+ export declare function provideChatKitLabels(labels: ReactiveLabels): void;
37
45
  /**
38
46
  * Retrieve ChatKit labels inside any ChatKit component.
39
47
  * Falls back to `defaultChatKitLabels` when no ancestor has provided labels.
48
+ *
49
+ * Returns a `ComputedRef` so that template bindings update automatically
50
+ * when the provided labels change (e.g. on locale switch).
40
51
  */
41
- export declare function useChatKitLabels(): ChatKitLabels;
52
+ export declare function useChatKitLabels(): ComputedRef<ChatKitLabels>;
53
+ export {};
42
54
  //# sourceMappingURL=useChatKitLabels.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useChatKitLabels.d.ts","sourceRoot":"","sources":["../../src/composables/useChatKitLabels.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,KAAK,CAAC;AAGxC;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,aAAa;IAC5B,0CAA0C;IAC1C,cAAc,EAAE,MAAM,CAAC;IACvB,gDAAgD;IAChD,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,yEAAyE;AACzE,eAAO,MAAM,oBAAoB,EAAE,aAGlC,CAAC;AAEF,4CAA4C;AAC5C,eAAO,MAAM,eAAe,EAAE,YAAY,CAAC,aAAa,CAA6B,CAAC;AAEtF;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,IAAI,CAEzE;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,aAAa,CAEhD"}
1
+ {"version":3,"file":"useChatKitLabels.d.ts","sourceRoot":"","sources":["../../src/composables/useChatKitLabels.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAG1D;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,0CAA0C;IAC1C,cAAc,EAAE,MAAM,CAAC;IACvB,4CAA4C;IAC5C,qBAAqB,EAAE,MAAM,CAAC;IAC9B,gDAAgD;IAChD,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,yEAAyE;AACzE,eAAO,MAAM,oBAAoB,EAAE,aAIlC,CAAC;AAEF,4CAA4C;AAC5C,eAAO,MAAM,eAAe,EAAE,YAAY,CAAC,WAAW,CAAC,aAAa,CAAC,CAA6B,CAAC;AAEnG,KAAK,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;AAE5C,yFAAyF;AACzF,KAAK,cAAc,GAAG,GAAG,CAAC,aAAa,CAAC,GAAG,WAAW,CAAC,aAAa,CAAC,GAAG,CAAC,MAAM,aAAa,CAAC,CAAC;AAE9F;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,CAKjE;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,IAAI,WAAW,CAAC,aAAa,CAAC,CAK7D"}
@@ -0,0 +1,6 @@
1
+ import { type MaybeRefOrGetter } from 'vue';
2
+ import { type PluggableList } from 'unified';
3
+ export declare function useMarkdownParser(source: MaybeRefOrGetter<string>, plugins: MaybeRefOrGetter<PluggableList | undefined>): {
4
+ html: import("vue").ComputedRef<string>;
5
+ };
6
+ //# sourceMappingURL=useMarkdownParser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMarkdownParser.d.ts","sourceRoot":"","sources":["../../src/composables/useMarkdownParser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,gBAAgB,EAAW,MAAM,KAAK,CAAC;AAC/D,OAAO,EAAW,KAAK,aAAa,EAAE,MAAM,SAAS,CAAC;AAiBtD,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,gBAAgB,CAAC,MAAM,CAAC,EAChC,OAAO,EAAE,gBAAgB,CAAC,aAAa,GAAG,SAAS,CAAC;;EAwBrD"}
@@ -0,0 +1,16 @@
1
+ import type { BaseMessage, ConversationTree, TreeMessage } from '../types';
2
+ export declare function createEmptyTree(): ConversationTree;
3
+ /**
4
+ * Walks from rootId following activeChildIndex at each node.
5
+ * Enriches each node with sibling metadata for the UI.
6
+ */
7
+ export declare function getLinearPath(tree: ConversationTree): BaseMessage[];
8
+ export declare function addNode(tree: ConversationTree, node: TreeMessage): void;
9
+ export declare function updateNode(tree: ConversationTree, id: string, updates: Partial<Pick<TreeMessage, 'content' | 'status' | 'role'>>): void;
10
+ export declare function updateNodeId(tree: ConversationTree, oldId: string, newId: string): void;
11
+ /**
12
+ * Navigate to a different branch by updating the parent's activeChildIndex
13
+ * to point at the target sibling.
14
+ */
15
+ export declare function navigate(tree: ConversationTree, targetId: string): void;
16
+ //# sourceMappingURL=conversationTree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conversationTree.d.ts","sourceRoot":"","sources":["../../src/handlers/conversationTree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE3E,wBAAgB,eAAe,IAAI,gBAAgB,CAElD;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,gBAAgB,GAAG,WAAW,EAAE,CAkCnE;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,WAAW,GAAG,IAAI,CAYvE;AAED,wBAAgB,UAAU,CACxB,IAAI,EAAE,gBAAgB,EACtB,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC,CAAC,GACjE,IAAI,CAON;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAsBvF;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAWvE"}
@@ -1,4 +1,4 @@
1
- import { u } from "../useMessageHandler-BdcOcw0w.js";
1
+ import { u } from "../useMessageHandler-Day_sdpQ.js";
2
2
  export {
3
3
  u as useMessageHandler
4
4
  };
@@ -1,5 +1,5 @@
1
- import type { BaseMessage, MessageRole, MessageStatus } from '../types';
2
- import { Ref } from 'vue';
1
+ import type { BaseMessage, ConversationTree, MessageRole, MessageStatus, TreeMessage } from '../types';
2
+ import { type Ref } from 'vue';
3
3
  export declare const useMessageHandler: () => {
4
4
  messages: Ref<BaseMessage[]>;
5
5
  currentUserMessage: Readonly<Ref<string, string>>;
@@ -10,18 +10,30 @@ export declare const useMessageHandler: () => {
10
10
  status: MessageStatus;
11
11
  }) => void;
12
12
  setCurrentUserMessage: (text: string) => void;
13
- getMessageById: (id: string) => {
14
- id: string;
15
- role: MessageRole;
16
- content: string;
17
- createdAt: Date;
18
- status: MessageStatus;
19
- } | undefined;
13
+ getMessageById: (id: string) => BaseMessage | undefined;
20
14
  clearCurrentUserMessage: () => void;
21
15
  commitUserMessage: () => BaseMessage;
22
- setMessages: (list: BaseMessage[]) => void;
23
- removeMessage: (id: string) => void;
24
16
  getLastUserMessage: () => BaseMessage | undefined;
17
+ updateMessageId: (oldId: string, newId: string) => void;
25
18
  clearMessages: () => void;
19
+ currentLeafId: import("vue").ComputedRef<string | null>;
20
+ tree: {
21
+ readonly nodes: {
22
+ readonly [x: string]: {
23
+ readonly id: string;
24
+ readonly parentId: string | null;
25
+ readonly childrenIds: readonly string[];
26
+ readonly activeChildIndex: number;
27
+ readonly role: MessageRole;
28
+ readonly content: string;
29
+ readonly status: MessageStatus;
30
+ readonly createdAt: Date;
31
+ };
32
+ };
33
+ readonly rootId: string | null;
34
+ };
35
+ setTree: (incoming: ConversationTree) => void;
36
+ addNode: (node: TreeMessage) => void;
37
+ navigate: (targetId: string) => void;
26
38
  };
27
39
  //# sourceMappingURL=useMessageHandler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useMessageHandler.d.ts","sourceRoot":"","sources":["../../src/handlers/useMessageHandler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACxE,OAAO,EAAY,GAAG,EAAO,MAAM,KAAK,CAAC;AAwBzC,eAAO,MAAM,iBAAiB;cA6DM,GAAG,CAAC,WAAW,EAAE,CAAC;;6BArCpB;QAC9B,EAAE,EAAE,MAAM,CAAC;QACX,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,EAAE,WAAW,CAAC;QAClB,MAAM,EAAE,aAAa,CAAC;KACvB;kCAzBoC,MAAM;yBAoCf,MAAM;;;;;;;;6BA5BJ,WAAW;wBAgCd,WAAW,EAAE;wBAIb,MAAM;8BAIF,WAAW,GAAG,SAAS;;CAqBvD,CAAC"}
1
+ {"version":3,"file":"useMessageHandler.d.ts","sourceRoot":"","sources":["../../src/handlers/useMessageHandler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,WAAW,EACX,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,WAAW,EACZ,MAAM,UAAU,CAAC;AAClB,OAAO,EAAqC,KAAK,GAAG,EAAE,MAAM,KAAK,CAAC;AAUlE,eAAO,MAAM,iBAAiB;cAkHJ,GAAG,CAAC,WAAW,EAAE,CAAC;;6BAnEV;QAC9B,EAAE,EAAE,MAAM,CAAC;QACX,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,EAAE,WAAW,CAAC;QAClB,MAAM,EAAE,aAAa,CAAC;KACvB;kCAzCoC,MAAM;yBAiEf,MAAM,KAAG,WAAW,GAAG,SAAS;;6BAzD9B,WAAW;8BAqEV,WAAW,GAAG,SAAS;6BAItB,MAAM,SAAS,MAAM;;;;;;;;;;;;;;;;;;wBAQ1B,gBAAgB;oBAKpB,WAAW;yBAIN,MAAM;CAsBnC,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  export { ChatService, type IChatService, type ChatConfig, type ChatMessage, type ChatResponse, type StreamEvent, } from './services';
2
- export { useChat } from './composables';
2
+ export { useChat, useMarkdownParser } from './composables';
3
3
  export { provideChatKitLabels, useChatKitLabels, defaultChatKitLabels, CHAT_KIT_LABELS, } from './composables';
4
4
  export type { ChatKitLabels, ChatActions, ChatState, UseChatReturn } from './composables';
5
5
  export { useMessageHandler } from './handlers';
6
- export { AgentMessage, ChatConversation, ChatConversationLayout, ChatInput, PromptActionButton, PromptInput, PromptInputDisclaimer, UserMessage, } from './components';
7
- export type { ChatConversationLayoutProps, ChatConversationProps, UserMessageProps, } from './components';
8
- export type { BaseMessage, MessageRole, MessageStatus } from './types';
6
+ export { AgentMessage, ChatConversation, ChatConversationLayout, ChatInput, MarkdownRenderer, PromptActionButton, PromptInput, PromptInputDisclaimer, UserMessage, defaultAgentMarkdownClasses, } from './components';
7
+ export type { ChatConversationLayoutProps, ChatConversationProps, MarkdownElementClasses, MarkdownRendererProps, UserMessageProps, } from './components';
8
+ export type { BaseMessage, ConversationTree, MessageRole, MessageStatus, TreeMessage, } from './types';
9
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,EACX,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,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,GAC5B,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,2BAA2B,EAC3B,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,cAAc,CAAC;AAGtB,YAAY,EACV,WAAW,EACX,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,WAAW,GACZ,MAAM,SAAS,CAAC"}
package/dist/index.js CHANGED
@@ -1,22 +1,25 @@
1
1
  import { C } from "./ChatService-LogwJNxh.js";
2
2
  import { u } from "./useChat-CtN_iBTc.js";
3
- import { C as C2, d, p, u as u2 } from "./useChatKitLabels-Bi0szl2l.js";
4
- import { u as u3 } from "./useMessageHandler-BdcOcw0w.js";
5
- import { A, _, a, b, c, d as d2, e, f } from "./ChatInput.vue_vue_type_script_setup_true_lang-DVCUwptr.js";
3
+ import { C as C2, d, p, u as u2, a } from "./useChatKitLabels-xZXcnxZZ.js";
4
+ import { u as u3 } from "./useMessageHandler-Day_sdpQ.js";
5
+ import { A, _, a as a2, b, c, d as d2, e, f, g, h } from "./ChatInput.vue_vue_type_script_setup_true_lang-BCa2ePSm.js";
6
6
  export {
7
7
  A as AgentMessage,
8
8
  C2 as CHAT_KIT_LABELS,
9
9
  _ as ChatConversation,
10
- a as ChatConversationLayout,
10
+ a2 as ChatConversationLayout,
11
11
  b as ChatInput,
12
12
  C as ChatService,
13
- c as PromptActionButton,
14
- d2 as PromptInput,
15
- e as PromptInputDisclaimer,
16
- f as UserMessage,
13
+ c as MarkdownRenderer,
14
+ d2 as PromptActionButton,
15
+ e as PromptInput,
16
+ f as PromptInputDisclaimer,
17
+ g as UserMessage,
18
+ h as defaultAgentMarkdownClasses,
17
19
  d as defaultChatKitLabels,
18
20
  p as provideChatKitLabels,
19
21
  u as useChat,
20
22
  u2 as useChatKitLabels,
23
+ a as useMarkdownParser,
21
24
  u3 as useMessageHandler
22
25
  };
@@ -0,0 +1,2 @@
1
+ export declare function createTextPlugin(transform: (text: string) => string): () => (tree: any) => void;
2
+ //# sourceMappingURL=createTextPlugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createTextPlugin.d.ts","sourceRoot":"","sources":["../../src/test-utils/createTextPlugin.ts"],"names":[],"mappings":"AAAA,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,UACpD,MAAM,GAAG,UAOxB"}
package/dist/types.d.ts CHANGED
@@ -1,22 +1,29 @@
1
1
  /**
2
2
  * Shared types used across the chat-kit package layers
3
3
  */
4
- /**
5
- * Role of a message in a chat conversation
6
- */
7
4
  export type MessageRole = 'user' | 'assistant' | 'system';
8
- /**
9
- * Status of a message
10
- */
11
5
  export type MessageStatus = 'started' | 'sending' | 'completed' | 'error';
12
- /**
13
- * Base message structure
14
- */
15
6
  export interface BaseMessage {
16
7
  id: string;
17
8
  role: MessageRole;
18
9
  content: string;
19
10
  createdAt: Date;
20
11
  status: MessageStatus;
12
+ siblingIds?: string[];
13
+ siblingIndex?: number;
14
+ }
15
+ export interface TreeMessage {
16
+ id: string;
17
+ parentId: string | null;
18
+ childrenIds: string[];
19
+ activeChildIndex: number;
20
+ role: MessageRole;
21
+ content: string;
22
+ status: MessageStatus;
23
+ createdAt: Date;
24
+ }
25
+ export interface ConversationTree {
26
+ nodes: Record<string, TreeMessage>;
27
+ rootId: string | null;
21
28
  }
22
29
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAC;AAE1D;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,CAAC;AAE1E;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,WAAW,CAAC;IACl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