@aleph-alpha/chat-kit 5.4.0 → 5.6.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 (38) hide show
  1. package/dist/{CkHistory.vue_vue_type_script_setup_true_lang-D9oP6oEj.js → CkHistory.vue_vue_type_script_setup_true_lang-DHzZgEn-.js} +28 -10
  2. package/dist/adapters/responses-api.d.ts +3 -1
  3. package/dist/adapters/responses-api.d.ts.map +1 -1
  4. package/dist/adapters/responses-api.js +158 -3
  5. package/dist/components/base/CkConversationLayout/CkConversationLayout.vue.d.ts +6 -0
  6. package/dist/components/base/CkConversationLayout/CkConversationLayout.vue.d.ts.map +1 -1
  7. package/dist/components/composed/CkConversation/CkConversation.vue.d.ts +6 -0
  8. package/dist/components/composed/CkConversation/CkConversation.vue.d.ts.map +1 -1
  9. package/dist/components/index.js +1 -1
  10. package/dist/composables/index.js +1 -1
  11. package/dist/handlers/index.js +1 -1
  12. package/dist/handlers/useMessageHandler.d.ts +7 -2
  13. package/dist/handlers/useMessageHandler.d.ts.map +1 -1
  14. package/dist/helpers/conversationTree.d.ts +44 -4
  15. package/dist/helpers/conversationTree.d.ts.map +1 -1
  16. package/dist/{index-CyrVnbS9.js → index-Hcwv9Hby.js} +3 -2
  17. package/dist/index.d.ts +1 -1
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +3 -3
  20. package/dist/services/types.d.ts +7 -0
  21. package/dist/services/types.d.ts.map +1 -1
  22. package/dist/types.d.ts +38 -0
  23. package/dist/types.d.ts.map +1 -1
  24. package/dist/{useMessageHandler-N50Yj-NU.js → useMessageHandler-Tellov3w.js} +112 -30
  25. package/package.json +2 -2
  26. package/src/adapters/arena.spec.ts +86 -0
  27. package/src/adapters/responses-api.ts +276 -2
  28. package/src/components/base/CkConversationLayout/CkConversationLayout.vue +30 -4
  29. package/src/components/composed/CkConversation/CkConversation.vue +10 -0
  30. package/src/composables/useConversations.spec.ts +2 -0
  31. package/src/composables/useConversations.ts +1 -0
  32. package/src/handlers/useMessageHandler.ts +46 -6
  33. package/src/helpers/comparison.spec.ts +114 -0
  34. package/src/helpers/conversationTree.spec.ts +98 -0
  35. package/src/helpers/conversationTree.ts +211 -26
  36. package/src/index.ts +2 -0
  37. package/src/services/types.ts +7 -0
  38. package/src/types.ts +40 -0
@@ -1,4 +1,4 @@
1
- import { defineComponent, openBlock, createBlock, unref, createElementBlock, createElementVNode, normalizeClass, renderSlot, createCommentVNode, mergeProps, withCtx, computed, createVNode, toDisplayString, ref, onBeforeUnmount, onMounted, nextTick, onUnmounted, watch, Fragment, renderList, normalizeStyle, Transition, createStaticVNode, Teleport, withModifiers, toValue, h, toRefs, useId, createTextVNode, useAttrs, useSlots, resolveDynamicComponent, useTemplateRef, onUpdated, createSlots, normalizeProps, guardReactiveProps, Comment, Text } from "vue";
1
+ import { defineComponent, openBlock, createBlock, unref, createElementBlock, createElementVNode, normalizeClass, renderSlot, createCommentVNode, mergeProps, withCtx, computed, createVNode, toDisplayString, ref, onBeforeUnmount, useSlots, onMounted, nextTick, onUnmounted, watch, Fragment, renderList, normalizeStyle, Transition, createStaticVNode, Teleport, withModifiers, toValue, h, toRefs, useId, createTextVNode, useAttrs, resolveDynamicComponent, useTemplateRef, onUpdated, createSlots, normalizeProps, guardReactiveProps, Comment, Text } from "vue";
2
2
  import { UiIcon, UiButton, UiFileType, UiPopover, UiPopoverTrigger, UiPopoverContent, UiTooltip, formatFileSize, UiDialog, UiDialogContent, UiDialogDescription, UiFieldLabel, UiToggleGroup, UiToggleGroupItem, UiField, UiTextarea, UiFileItem, UiProgress, Primitive, UiFloatActions, UiFloatActionItems, UiAvatar, UiAvatarImage, UiSpinner, UiAvatarFallback, UiSidebarPopoverMenu, UiSidebarPopoverMenuItem } from "@aleph-alpha/ui-library";
3
3
  import { u as useChatKitLabels, d as defaultChatKitLabels, r as remarkCitations, a as useMarkdownParser } from "./useChatKitLabels-DLy0BFx8.js";
4
4
  const MINUTE = 60;
@@ -185,7 +185,7 @@ const _hoisted_1$e = { class: "ck-citation-card flex w-[22.5rem] max-w-[90vw] fl
185
185
  const _hoisted_2$8 = { class: "flex items-center gap-2" };
186
186
  const _hoisted_3$7 = ["title"];
187
187
  const _hoisted_4$7 = { class: "line-clamp-6 break-words text-sm leading-5 text-content-on-surface-secondary" };
188
- const _hoisted_5$4 = {
188
+ const _hoisted_5$5 = {
189
189
  key: 0,
190
190
  class: "text-sm leading-5 text-content-on-surface-muted"
191
191
  };
@@ -244,7 +244,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
244
244
  }, 8, ["aria-label"])) : createCommentVNode("", true)
245
245
  ]),
246
246
  createElementVNode("p", _hoisted_4$7, toDisplayString(__props.snippet), 1),
247
- __props.locationLabel ? (openBlock(), createElementBlock("p", _hoisted_5$4, toDisplayString(__props.locationLabel), 1)) : createCommentVNode("", true)
247
+ __props.locationLabel ? (openBlock(), createElementBlock("p", _hoisted_5$5, toDisplayString(__props.locationLabel), 1)) : createCommentVNode("", true)
248
248
  ]);
249
249
  };
250
250
  }
@@ -388,6 +388,11 @@ const _hoisted_4$6 = {
388
388
  key: 1,
389
389
  class: "flex min-w-0 justify-start"
390
390
  };
391
+ const _hoisted_5$4 = {
392
+ key: 0,
393
+ "data-message-row": "agent",
394
+ class: "flex min-w-0 justify-start"
395
+ };
391
396
  const _sfc_main$m = /* @__PURE__ */ defineComponent({
392
397
  ...{ name: "CkConversationLayout" },
393
398
  __name: "CkConversationLayout",
@@ -396,6 +401,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
396
401
  },
397
402
  setup(__props) {
398
403
  const props = __props;
404
+ const slots = useSlots();
399
405
  const scrollContainerRef = ref(null);
400
406
  const containerHeight = ref(0);
401
407
  const isAutoScrollEnabled = ref(true);
@@ -521,7 +527,8 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
521
527
  () => {
522
528
  if (props.messages.length === 0) return;
523
529
  const lastMessage = props.messages[props.messages.length - 1];
524
- if (lastMessage && lastMessage.role !== "user") {
530
+ const hasFooter = Boolean(slots["thread-footer"]);
531
+ if (lastMessage && lastMessage.role !== "user" || hasFooter) {
525
532
  nextTick(() => {
526
533
  updateSpacerHeight();
527
534
  if (isAutoScrollEnabled.value) {
@@ -537,7 +544,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
537
544
  return openBlock(), createElementBlock("div", _hoisted_1$c, [
538
545
  createElementVNode("div", {
539
546
  "aria-hidden": "true",
540
- class: normalizeClass(["pointer-events-none absolute inset-x-0 top-0 z-10 h-8 bg-gradient-to-b from-background-surface-primary to-transparent transition-opacity duration-200", showTopFade.value ? "opacity-100" : "opacity-0"])
547
+ class: normalizeClass(["pointer-events-none absolute inset-x-0 top-0 z-10 h-8 bg-gradient-to-b from-background-surface-secondary to-transparent transition-opacity duration-200", showTopFade.value ? "opacity-100" : "opacity-0"])
541
548
  }, null, 2),
542
549
  createElementVNode("div", {
543
550
  ref_key: "scrollContainerRef",
@@ -558,15 +565,18 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
558
565
  ]))
559
566
  ], 8, _hoisted_2$7);
560
567
  }), 128)),
568
+ _ctx.$slots["thread-footer"] ? (openBlock(), createElementBlock("div", _hoisted_5$4, [
569
+ renderSlot(_ctx.$slots, "thread-footer")
570
+ ])) : createCommentVNode("", true),
561
571
  hasBottomSpacer.value ? (openBlock(), createElementBlock("div", {
562
- key: 0,
572
+ key: 1,
563
573
  "aria-hidden": "true",
564
574
  style: normalizeStyle({ minHeight: `${spacerHeight.value}px` })
565
575
  }, null, 4)) : createCommentVNode("", true)
566
576
  ], 544),
567
577
  createElementVNode("div", {
568
578
  "aria-hidden": "true",
569
- class: normalizeClass(["pointer-events-none absolute inset-x-0 bottom-0 z-10 h-8 bg-gradient-to-t from-background-surface-primary to-transparent transition-opacity duration-200", showBottomFade.value ? "opacity-100" : "opacity-0"])
579
+ class: normalizeClass(["pointer-events-none absolute inset-x-0 bottom-0 z-10 h-8 bg-gradient-to-t from-background-surface-secondary to-transparent transition-opacity duration-200", showBottomFade.value ? "opacity-100" : "opacity-0"])
570
580
  }, null, 2)
571
581
  ]);
572
582
  };
@@ -2592,7 +2602,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
2592
2602
  return slot ? slot({ message }).some((vnode) => !isVNodeEmpty(vnode)) : false;
2593
2603
  }
2594
2604
  return (_ctx, _cache) => {
2595
- return openBlock(), createBlock(_sfc_main$m, { messages: __props.messages }, {
2605
+ return openBlock(), createBlock(_sfc_main$m, { messages: __props.messages }, createSlots({
2596
2606
  "user-message": withCtx(({ message }) => [
2597
2607
  createElementVNode("div", {
2598
2608
  class: normalizeClass({ "ml-8": hasIcon.value })
@@ -2718,8 +2728,16 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
2718
2728
  ]), 1032, ["bottom-separator"])
2719
2729
  ])
2720
2730
  ]),
2721
- _: 3
2722
- }, 8, ["messages"]);
2731
+ _: 2
2732
+ }, [
2733
+ _ctx.$slots["thread-footer"] ? {
2734
+ name: "thread-footer",
2735
+ fn: withCtx(() => [
2736
+ renderSlot(_ctx.$slots, "thread-footer")
2737
+ ]),
2738
+ key: "0"
2739
+ } : void 0
2740
+ ]), 1032, ["messages"]);
2723
2741
  };
2724
2742
  }
2725
2743
  });
@@ -260,5 +260,7 @@ export interface ResponseConversationTree extends ConversationTree {
260
260
  * return type is assignable to `ConversationTree`, so you can pipe it
261
261
  * straight into `useMessageHandler().setTree(...)`.
262
262
  */
263
- export declare function responsesToTree(responses: StoredResponse[]): ResponseConversationTree;
263
+ export declare function responsesToTree(responses: StoredResponse[], opts?: {
264
+ arenaWinners?: Record<string, string>;
265
+ }): ResponseConversationTree;
264
266
  //# sourceMappingURL=responses-api.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"responses-api.d.ts","sourceRoot":"","sources":["../../src/adapters/responses-api.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EACV,gBAAgB,EAEhB,eAAe,EAEf,WAA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AW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,YAAY,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9B,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,cAAc,EAAE,CAAC;CACxB;AAMD;;;;;;;;GAQG;AACH,MAAM,MAAM,2BAA2B,GAAG,eAAe,GAAG;IAC1D,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,yBAAyB,EAAE,CAAC;CAC3C,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,GAAG;IAChE,QAAQ,EAAE,2BAA2B,CAAC;CACvC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,WAAW,wBAAyB,SAAQ,gBAAgB;IAChE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;CAC5C;AA+VD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,cAAc,EAAE,EAC3B,IAAI,CAAC,EAAE;IAAE,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,GAC/C,wBAAwB,CAyB1B"}
@@ -184,7 +184,7 @@ function foldContinuation(parentNode, messageNodes) {
184
184
  }
185
185
  }
186
186
  function linkResponse(state, resp) {
187
- const { treeNodes, tailMessageByResponse } = state;
187
+ const { treeNodes, tailMessageByResponse, userMessageByResponse } = state;
188
188
  const parentResponseId = resp.previous_response_id && tailMessageByResponse.has(resp.previous_response_id) ? resp.previous_response_id : null;
189
189
  let chainParent = parentResponseId !== null ? tailMessageByResponse.get(parentResponseId) ?? null : null;
190
190
  const isRootChain = chainParent === null;
@@ -199,6 +199,9 @@ function linkResponse(state, resp) {
199
199
  for (const node of messageNodes) {
200
200
  appendNode(treeNodes, node, chainParent);
201
201
  if (firstId === null) firstId = node.id;
202
+ if (node.role === "user" && !userMessageByResponse.has(resp.id)) {
203
+ userMessageByResponse.set(resp.id, node.id);
204
+ }
202
205
  chainParent = node.id;
203
206
  }
204
207
  if (firstId !== null && (state.rootMessageId === null || isRootChain)) {
@@ -206,19 +209,171 @@ function linkResponse(state, resp) {
206
209
  }
207
210
  tailMessageByResponse.set(resp.id, chainParent);
208
211
  }
209
- function responsesToTree(responses) {
212
+ function responsesToTree(responses, opts) {
210
213
  if (responses.length === 0) {
211
214
  return { nodes: {}, rootId: null };
212
215
  }
213
216
  const state = {
214
217
  treeNodes: {},
215
218
  tailMessageByResponse: /* @__PURE__ */ new Map(),
219
+ userMessageByResponse: /* @__PURE__ */ new Map(),
216
220
  rootMessageId: null
217
221
  };
218
222
  for (const resp of responses) {
219
223
  linkResponse(state, resp);
220
224
  }
221
- return { nodes: state.treeNodes, rootId: state.rootMessageId };
225
+ const rootId = collapseArenaComparisons(
226
+ state.treeNodes,
227
+ responses,
228
+ opts?.arenaWinners ?? {},
229
+ state.rootMessageId,
230
+ state.userMessageByResponse
231
+ );
232
+ return { nodes: state.treeNodes, rootId };
233
+ }
234
+ function parseArenaMeta(resp) {
235
+ const raw = resp.metadata?.arena;
236
+ let arena = raw;
237
+ if (typeof raw === "string") {
238
+ try {
239
+ arena = JSON.parse(raw);
240
+ } catch {
241
+ return null;
242
+ }
243
+ }
244
+ if (!arena || typeof arena !== "object") return null;
245
+ const a = arena;
246
+ if (typeof a.matchup_id !== "string") return null;
247
+ return {
248
+ matchupId: a.matchup_id,
249
+ modelId: typeof a.model_id === "string" ? a.model_id : void 0,
250
+ slot: typeof a.slot === "string" ? a.slot : void 0,
251
+ slotSeed: typeof a.slot_seed === "string" ? a.slot_seed : void 0,
252
+ variant: typeof a.variant === "string" ? a.variant : void 0
253
+ };
254
+ }
255
+ function collapseArenaComparisons(nodes, responses, arenaWinners, rootMessageId, userMessageByResponse) {
256
+ const userNodeFor = (responseId) => {
257
+ const id = userMessageByResponse.get(responseId);
258
+ return id ? nodes[id] : void 0;
259
+ };
260
+ let root = rootMessageId;
261
+ for (const [matchupId, group] of groupResponsesByMatchup(responses)) {
262
+ if (group.length < 2) continue;
263
+ try {
264
+ root = foldArenaGroup(
265
+ nodes,
266
+ group,
267
+ arenaWinners[matchupId],
268
+ userNodeFor,
269
+ root
270
+ );
271
+ } catch {
272
+ }
273
+ }
274
+ return root;
275
+ }
276
+ function groupResponsesByMatchup(responses) {
277
+ const groups = /* @__PURE__ */ new Map();
278
+ for (const resp of responses) {
279
+ const meta = parseArenaMeta(resp);
280
+ if (!meta) continue;
281
+ const group = groups.get(meta.matchupId) ?? [];
282
+ group.push(resp);
283
+ groups.set(meta.matchupId, group);
284
+ }
285
+ return groups;
286
+ }
287
+ function laneSlot(node) {
288
+ return node?.metadata.arena?.slot ?? "";
289
+ }
290
+ function compareLaneSlots(nodes, x, y) {
291
+ const sx = laneSlot(nodes[x]);
292
+ const sy = laneSlot(nodes[y]);
293
+ if (sx < sy) return -1;
294
+ if (sx > sy) return 1;
295
+ return 0;
296
+ }
297
+ function stampLaneAssistant(nodes, resp) {
298
+ const meta = parseArenaMeta(resp);
299
+ const assistant = nodes[getAssistantNodeId(resp)];
300
+ if (assistant && meta) {
301
+ assistant.metadata.arena = { modelId: meta.modelId, slot: meta.slot };
302
+ }
303
+ }
304
+ function attachLane(canonicalUser, assistant) {
305
+ assistant.parentId = canonicalUser.id;
306
+ if (!canonicalUser.childrenIds.includes(assistant.id)) {
307
+ canonicalUser.childrenIds.push(assistant.id);
308
+ }
309
+ }
310
+ function removeDuplicateUser(nodes, dupUser, sharedParentId, canonicalUserId, root) {
311
+ const parent = sharedParentId !== null ? nodes[sharedParentId] : void 0;
312
+ if (parent) {
313
+ parent.childrenIds = parent.childrenIds.filter((c) => c !== dupUser.id);
314
+ if (parent.activeChildIndex >= parent.childrenIds.length) {
315
+ parent.activeChildIndex = Math.max(0, parent.childrenIds.length - 1);
316
+ }
317
+ }
318
+ delete nodes[dupUser.id];
319
+ return root === dupUser.id ? canonicalUserId : root;
320
+ }
321
+ function activateForkNode(nodes, canonicalUser, sharedParentId, root) {
322
+ if (sharedParentId === null) return canonicalUser.id;
323
+ const parent = nodes[sharedParentId];
324
+ if (parent) {
325
+ const idx = parent.childrenIds.indexOf(canonicalUser.id);
326
+ if (idx !== -1) parent.activeChildIndex = idx;
327
+ }
328
+ return root;
329
+ }
330
+ function applyArenaWinner(canonicalUser, group, winnerRespId) {
331
+ if (!winnerRespId) return;
332
+ const winnerResp = group.find((r) => r.id === winnerRespId);
333
+ if (!winnerResp) return;
334
+ const winnerAssistantId = getAssistantNodeId(winnerResp);
335
+ const idx = canonicalUser.childrenIds.indexOf(winnerAssistantId);
336
+ if (idx === -1) return;
337
+ canonicalUser.comparisonWinnerId = winnerAssistantId;
338
+ canonicalUser.activeChildIndex = idx;
339
+ }
340
+ function foldArenaGroup(nodes, group, winnerRespId, userNodeFor, root) {
341
+ const first = group[0];
342
+ if (!first) return root;
343
+ const canonicalUser = userNodeFor(first.id);
344
+ if (!canonicalUser) return root;
345
+ const sharedParentId = canonicalUser.parentId;
346
+ const forkMeta = parseArenaMeta(first);
347
+ if (forkMeta) {
348
+ canonicalUser.metadata.arena = {
349
+ matchupId: forkMeta.matchupId,
350
+ slotSeed: forkMeta.slotSeed,
351
+ variant: forkMeta.variant
352
+ };
353
+ }
354
+ let newRoot = root;
355
+ for (const [i, resp] of group.entries()) {
356
+ stampLaneAssistant(nodes, resp);
357
+ if (i === 0) continue;
358
+ const assistant = nodes[getAssistantNodeId(resp)];
359
+ if (!assistant) continue;
360
+ attachLane(canonicalUser, assistant);
361
+ const dupUser = userNodeFor(resp.id);
362
+ if (dupUser && dupUser.id !== canonicalUser.id) {
363
+ newRoot = removeDuplicateUser(
364
+ nodes,
365
+ dupUser,
366
+ sharedParentId,
367
+ canonicalUser.id,
368
+ newRoot
369
+ );
370
+ }
371
+ }
372
+ canonicalUser.childrenIds.sort((x, y) => compareLaneSlots(nodes, x, y));
373
+ canonicalUser.comparing = true;
374
+ newRoot = activateForkNode(nodes, canonicalUser, sharedParentId, newRoot);
375
+ applyArenaWinner(canonicalUser, group, winnerRespId);
376
+ return newRoot;
222
377
  }
223
378
  export {
224
379
  responsesToTree
@@ -16,6 +16,12 @@ declare const __VLS_export: <T extends {
16
16
  'agent-message': (props: {
17
17
  message: T;
18
18
  }) => void;
19
+ /**
20
+ * Extra content appended after the last message, inside the scroll flow and
21
+ * aligned like an agent turn. Use for a trailing element that continues the
22
+ * thread but isn't a tree message (e.g. an in-progress preference comparison).
23
+ */
24
+ 'thread-footer': () => void;
19
25
  };
20
26
  emit: {};
21
27
  }>) => import("vue").VNode & {
@@ -1 +1 @@
1
- {"version":3,"file":"CkConversationLayout.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkConversationLayout/CkConversationLayout.vue"],"names":[],"mappings":"AA+PA,QAAA,MAAM,YAAY,GAAK,CAAC,SAAS;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EAC5D,aAAa,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,EAC9D,YAAY,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,EAC3G,gBAAgB,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,EAClE;WAsUO,OAAO,KAAK,EAAE,WAAW,GAAG,mBAAmB;kBAlU3C,CAAC,EAAE;MAkU2D,GAAG,CAAC,OAAO,UAAU,SAAS;QAAE,oBAAoB,EAAE,MAAM,CAAC,CAAA;KAAE,GAAG,CAAC,GAAG,EAAE,CAAC;YAC1I,CAAC,OAAO,EAAE,EAAE,KAAK,IAAI;WACtB,GAAG;;wBA/TO,CAAC,KAAK,EAAE;YAAE,OAAO,EAAE,CAAC,CAAA;SAAE,KAAK,IAAI;yBAC9B,CAAC,KAAK,EAAE;YAAE,OAAO,EAAE,CAAC,CAAA;SAAE,KAAK,IAAI;;UAgU3C,EAAE;EAEL,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAI,CAAC;wBACvD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,mBAAmB,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,GAAG,GAAG;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG;KAAG,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,CAAC,GAAG,EAAE,CAAC"}
1
+ {"version":3,"file":"CkConversationLayout.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkConversationLayout/CkConversationLayout.vue"],"names":[],"mappings":"AAyRA,QAAA,MAAM,YAAY,GAAK,CAAC,SAAS;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EAC5D,aAAa,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,EAC9D,YAAY,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,EAC3G,gBAAgB,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,EAClE;WAkWO,OAAO,KAAK,EAAE,WAAW,GAAG,mBAAmB;kBA9V3C,CAAC,EAAE;MA8V2D,GAAG,CAAC,OAAO,UAAU,SAAS;QAAE,oBAAoB,EAAE,MAAM,CAAC,CAAA;KAAE,GAAG,CAAC,GAAG,EAAE,CAAC;YAC1I,CAAC,OAAO,EAAE,EAAE,KAAK,IAAI;WACtB,GAAG;;wBA3VO,CAAC,KAAK,EAAE;YAAE,OAAO,EAAE,CAAC,CAAA;SAAE,KAAK,IAAI;yBAC9B,CAAC,KAAK,EAAE;YAAE,OAAO,EAAE,CAAC,CAAA;SAAE,KAAK,IAAI;QAChD;;;;WAIG;yBACc,MAAM,IAAI;;UAsVtB,EAAE;EAEL,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAI,CAAC;wBACvD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,mBAAmB,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,GAAG,GAAG;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG;KAAG,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,CAAC,GAAG,EAAE,CAAC"}
@@ -54,6 +54,12 @@ type __VLS_Slots = {
54
54
  code: string;
55
55
  language: string;
56
56
  }) => void;
57
+ /**
58
+ * Trailing content appended after the last message, inside the scroll flow
59
+ * and aligned like an agent turn — e.g. an in-progress preference comparison
60
+ * that continues the thread but isn't a tree message.
61
+ */
62
+ 'thread-footer': () => void;
57
63
  };
58
64
  declare const __VLS_base: import("vue").DefineComponent<CkConversationProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CkConversationProps> & Readonly<{}>, {
59
65
  agentAvatarImage: string;
@@ -1 +1 @@
1
- {"version":3,"file":"CkConversation.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/composed/Ck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K,IAAI,CAAC;IAClE,qEAAqE;IACrE,0BAA0B,EAAE,CAAC,KAAK,EAAE;QAClC,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;KAClB,KAAK,IAAI,CAAC;CACZ,CAAC;AA+WF,QAAA,MAAM,UAAU;;;;6EAGd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AAWzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"CkConversation.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/composed/CkConversation/CkConversation.vue"],"names":[],"mappings":"AAuPA,OAAO,KAAK,EAAE,WAAW,EAAsB,MAAM,gBAAgB,CAAC;AAOtE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAkBnD,KAAK,WAAW,GAAG;IACjB,gDAAgD;IAChD,cAAc,EAAE,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,WAAW,CAAA;KAAE,KAAK,IAAI,CAAC;IAC1D,yDAAyD;IACzD,sBAAsB,EAAE,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,WAAW,CAAA;KAAE,KAAK,IAAI,CAAC;IAClE,iDAAiD;IACjD,eAAe,EAAE,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,WAAW,CAAA;KAAE,KAAK,IAAI,CAAC;IAC3D,oCAAoC;IACpC,oBAAoB,EAAE,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,WAAW,CAAA;KAAE,KAAK,IAAI,CAAC;IAChE,8EAA8E;IAC9E,4BAA4B,EAAE,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,WAAW,CAAA;KAAE,KAAK,IAAI,CAAC;IACxE,iFAAiF;IACjF,sBAAsB,EAAE,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,WAAW,CAAA;KAAE,KAAK,IAAI,CAAC;IAClE,6EAA6E;IAC7E,8BAA8B,EAAE,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,WAAW,CAAA;KAAE,KAAK,IAAI,CAAC;IAC1E;;;;OAIG;IACH,+BAA+B,EAAE,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,WAAW,CAAA;KAAE,KAAK,IAAI,CAAC;IAC3E;;;;OAIG;IACH,uBAAuB,EAAE,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,WAAW,CAAA;KAAE,KAAK,IAAI,CAAC;IACnE,mDAAmD;IACnD,sBAAsB,EAAE,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,WAAW,CAAA;KAAE,KAAK,IAAI,CAAC;IAClE,qEAAqE;IACrE,0BAA0B,EAAE,CAAC,KAAK,EAAE;QAClC,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;KAClB,KAAK,IAAI,CAAC;IACX;;;;OAIG;IACH,eAAe,EAAE,MAAM,IAAI,CAAC;CAC7B,CAAC;AAwXF,QAAA,MAAM,UAAU;;;;6EAGd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AAWzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
@@ -1,4 +1,4 @@
1
- import { _, a, C, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z } from "../CkHistory.vue_vue_type_script_setup_true_lang-D9oP6oEj.js";
1
+ import { _, a, C, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z } from "../CkHistory.vue_vue_type_script_setup_true_lang-DHzZgEn-.js";
2
2
  export {
3
3
  _ as CkAgentMessage,
4
4
  a as CkAgentMessageHeader,
@@ -1,4 +1,4 @@
1
- import { c, d, u, b, e, f } from "../index-CyrVnbS9.js";
1
+ import { c, d, u, b, e, f } from "../index-Hcwv9Hby.js";
2
2
  export {
3
3
  c as createDocumentUploadProvider,
4
4
  d as defaultDocumentUploadConfig,
@@ -1,4 +1,4 @@
1
- import { u } from "../useMessageHandler-N50Yj-NU.js";
1
+ import { u } from "../useMessageHandler-Tellov3w.js";
2
2
  import { C, d, n, p, r, b, u as u2, a } from "../useChatKitLabels-DLy0BFx8.js";
3
3
  export {
4
4
  C as CHAT_KIT_LABELS,
@@ -1,7 +1,8 @@
1
- import type { BaseMessage, ConversationTree, MessageContent, MessageMetadata, MessageRole, MessageStatus } from '../types';
1
+ import type { ActiveComparison, BaseMessage, ConversationTree, MessageContent, MessageMetadata, MessageRole, MessageStatus } from '../types';
2
2
  import { type Ref } from 'vue';
3
3
  export declare const useMessageHandler: () => {
4
4
  messages: Ref<BaseMessage[]>;
5
+ activeComparison: import("vue").ComputedRef<ActiveComparison | null>;
5
6
  currentUserMessage: Readonly<Ref<string, string>>;
6
7
  currentLeafId: import("vue").ComputedRef<string | null>;
7
8
  updateMessage: (message: {
@@ -11,6 +12,7 @@ export declare const useMessageHandler: () => {
11
12
  status: MessageStatus;
12
13
  metadata?: MessageMetadata;
13
14
  parentId?: string;
15
+ comparing?: boolean;
14
16
  }) => void;
15
17
  setCurrentUserMessage: (text: string) => void;
16
18
  getMessageById: (id: string) => BaseMessage | undefined;
@@ -23,8 +25,9 @@ export declare const useMessageHandler: () => {
23
25
  clearMessages: () => void;
24
26
  setTree: (incoming: ConversationTree) => void;
25
27
  navigate: (targetId: string) => void;
26
- cutBranchAfter: (messageId: string) => void;
28
+ cutBranchAfter: (messageId: string, keepChildId?: string) => void;
27
29
  cutBranchAt: (messageId: string) => void;
30
+ voteComparison: (parentId: string, winnerBranchId: string) => void;
28
31
  getTree: () => {
29
32
  readonly nodes: {
30
33
  readonly [x: string]: {
@@ -55,6 +58,8 @@ export declare const useMessageHandler: () => {
55
58
  readonly metadata?: {
56
59
  readonly [x: string]: Readonly<unknown>;
57
60
  } | undefined;
61
+ readonly comparing?: boolean | undefined;
62
+ readonly comparisonWinnerId?: string | undefined;
58
63
  };
59
64
  };
60
65
  readonly rootId: string | null;
@@ -1 +1 @@
1
- {"version":3,"file":"useMessageHandler.d.ts","sourceRoot":"","sources":["../../src/handlers/useMessageHandler.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EACV,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,WAAW,EACX,aAAa,EAEd,MAAM,UAAU,CAAC;AAClB,OAAO,EAAqC,KAAK,GAAG,EAAE,MAAM,KAAK,CAAC;AAElE,eAAO,MAAM,iBAAiB;cA0LJ,GAAG,CAAC,WAAW,EAAE,CAAC;;;6BAnGV;QAC9B,EAAE,EAAE,MAAM,CAAC;QACX,OAAO,EAAE,cAAc,EAAE,CAAC;QAC1B,IAAI,EAAE,WAAW,CAAC;QAClB,MAAM,EAAE,aAAa,CAAC;QACtB,QAAQ,CAAC,EAAE,eAAe,CAAC;QAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB;kCAtEoC,MAAM;yBAoGf,MAAM,KAAG,WAAW,GAAG,SAAS;;+BApF1B;QAChC,QAAQ,CAAC,EAAE,eAAe,CAAC;QAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,KAAG,WAAW;6BA+FiB,MAAM,SAAS,MAAM;;wBAiB1B,gBAAgB;yBAKf,MAAM;gCAQC,MAAM;6BAST,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyBvC,CAAC"}
1
+ {"version":3,"file":"useMessageHandler.d.ts","sourceRoot":"","sources":["../../src/handlers/useMessageHandler.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EACV,gBAAgB,EAChB,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,WAAW,EACX,aAAa,EAEd,MAAM,UAAU,CAAC;AAClB,OAAO,EAAqC,KAAK,GAAG,EAAE,MAAM,KAAK,CAAC;AAElE,eAAO,MAAM,iBAAiB;cA6NJ,GAAG,CAAC,WAAW,EAAE,CAAC;;;;6BA5HV;QAC9B,EAAE,EAAE,MAAM,CAAC;QACX,OAAO,EAAE,cAAc,EAAE,CAAC;QAC1B,IAAI,EAAE,WAAW,CAAC;QAClB,MAAM,EAAE,aAAa,CAAC;QACtB,QAAQ,CAAC,EAAE,eAAe,CAAC;QAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,SAAS,CAAC,EAAE,OAAO,CAAC;KACrB;kCAvEoC,MAAM;yBAgHf,MAAM,KAAG,WAAW,GAAG,SAAS;;+BAhG1B;QAChC,QAAQ,CAAC,EAAE,eAAe,CAAC;QAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,KAAG,WAAW;6BA2GiB,MAAM,SAAS,MAAM;;wBAiB1B,gBAAgB;yBAKf,MAAM;gCAYC,MAAM,gBAAgB,MAAM;6BAS/B,MAAM;+BAaJ,MAAM,kBAAkB,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuBjE,CAAC"}
@@ -1,11 +1,38 @@
1
- import type { BaseMessage, ConversationTree, TreeMessage } from '../types';
1
+ import type { ActiveComparison, BaseMessage, ConversationTree, TreeMessage } from '../types';
2
2
  export declare function createEmptyTree(): ConversationTree;
3
3
  /**
4
4
  * Walks from rootId following activeChildIndex at each node.
5
5
  * Enriches each node with sibling metadata for the UI.
6
+ *
7
+ * Comparison-unaware: it always descends the active child. Consumers that
8
+ * render comparisons should use {@link projectActivePath}, which stops the
9
+ * linear trunk at an active comparison fork and returns its lanes separately.
6
10
  */
7
11
  export declare function getLinearPath(tree: ConversationTree): BaseMessage[];
8
- export declare function addNode(tree: ConversationTree, node: TreeMessage): void;
12
+ /**
13
+ * Single-pass projection of the active view into a linear `trunk` plus (at
14
+ * most) one `activeComparison`. The trunk follows `activeChildIndex` from the
15
+ * root and **stops at an active comparison fork** (the fork parent is the last
16
+ * trunk item); that fork's children become the comparison lanes. History
17
+ * comparisons (voted + continued) are transparent — the trunk flows through
18
+ * the winner as ordinary linear messages.
19
+ */
20
+ export declare function projectActivePath(tree: ConversationTree): {
21
+ trunk: BaseMessage[];
22
+ activeComparison: ActiveComparison | null;
23
+ };
24
+ export declare function addNode(tree: ConversationTree, node: TreeMessage, opts?: {
25
+ activate?: boolean;
26
+ }): void;
27
+ /** Mark a node's children as an (unresolved) comparison. */
28
+ export declare function markComparison(tree: ConversationTree, parentId: string): void;
29
+ /**
30
+ * Record a comparison vote: set the winner (mirrored to `activeChildIndex`) and
31
+ * reveal. Leaves `comparing` set — the comparison stays a labelled, revealed
32
+ * view until the user continues past the winner (which collapses it to
33
+ * history). No-op if the parent/winner is unknown.
34
+ */
35
+ export declare function voteComparison(tree: ConversationTree, parentId: string, winnerBranchId: string): void;
9
36
  export declare function updateNode(tree: ConversationTree, id: string, updates: Partial<Pick<TreeMessage, 'content' | 'status' | 'role' | 'metadata'>>): void;
10
37
  export declare function updateNodeId(tree: ConversationTree, oldId: string, newId: string): void;
11
38
  /**
@@ -13,10 +40,20 @@ export declare function updateNodeId(tree: ConversationTree, oldId: string, newI
13
40
  * itself intact. The node's `childrenIds` is cleared and `activeChildIndex`
14
41
  * is reset to 0, which makes the node the new leaf of its branch.
15
42
  *
43
+ * Pass `keepChildId` (a *direct* child of the node) to exempt one branch: that
44
+ * child and its subtree survive and become the node's sole, active child while
45
+ * every sibling branch is dropped. Useful when picking a comparison winner and
46
+ * discarding the alternatives. An unknown or non-child `keepChildId` is ignored
47
+ * (every branch is removed, as with no exception).
48
+ *
49
+ * Either way the node is left with at most one child, so any comparison state
50
+ * on it (`comparing` / `comparisonWinnerId`) — impossible with a single lane —
51
+ * is cleared.
52
+ *
16
53
  * Useful when editing a message and discarding the conversation that was
17
54
  * generated after it.
18
55
  */
19
- export declare function cutBranchAfter(tree: ConversationTree, id: string): void;
56
+ export declare function cutBranchAfter(tree: ConversationTree, id: string, keepChildId?: string): void;
20
57
  /**
21
58
  * Remove the node with the given id *and* its entire subtree, then unlink it
22
59
  * from its parent. Unlike {@link cutBranchAfter} (which keeps the target and
@@ -25,7 +62,10 @@ export declare function cutBranchAfter(tree: ConversationTree, id: string): void
25
62
  * (e.g. an interrupted regenerate) without cropping the others.
26
63
  *
27
64
  * The parent's `activeChildIndex` is clamped to a remaining sibling so the
28
- * active path stays valid. Removing the root clears the tree.
65
+ * active path stays valid, and its comparison state is reconciled: the whole
66
+ * comparison is dropped once fewer than two lanes survive, and a dangling
67
+ * `comparisonWinnerId` is cleared when the removed branch was the winner.
68
+ * Removing the root clears the tree.
29
69
  *
30
70
  * Prefer {@link cutBranchAfter} when it fits the case: unlinking here scans
31
71
  * and splices the parent's `childrenIds` (O(siblings)), whereas
@@ -1 +1 @@
1
- {"version":3,"file":"conversationTree.d.ts","sourceRoot":"","sources":["../../src/helpers/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,CAmCnE;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,CACd,IAAI,CAAC,WAAW,EAAE,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC,CAC9D,GACA,IAAI,CAUN;AAED,wBAAgB,YAAY,CAC1B,IAAI,EAAE,gBAAgB,EACtB,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AAM,GACrB,IAAI,CAON;AAED,wBAAgB,UAAU,CACxB,IAAI,EAAE,gBAAgB,EACtB,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,OAAO,CACd,IAAI,CAAC,WAAW,EAAE,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC,CAC9D,GACA,IAAI,CAUN;AAED,wBAAgB,YAAY,CAC1B,IAAI,EAAE,gBAAgB,EACtB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,GACZ,IAAI,CAsBN;AAiBD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,gBAAgB,EACtB,EAAE,EAAE,MAAM,EACV,WAAW,CAAC,EAAE,MAAM,GACnB,IAAI,CAyBN;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,gBAAgB,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,CAuCpE;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAWvE"}
@@ -1,6 +1,6 @@
1
1
  import { g as generateId } from "./generateId-BHf0W4Rq.js";
2
2
  import { ref, shallowRef, computed, readonly, toRaw, toValue, watch } from "vue";
3
- import { u as useMessageHandler } from "./useMessageHandler-N50Yj-NU.js";
3
+ import { u as useMessageHandler } from "./useMessageHandler-Tellov3w.js";
4
4
  import "./katex.min-md74IFlY.js";
5
5
  function secondsToDate(seconds) {
6
6
  return new Date(seconds * 1e3);
@@ -188,7 +188,8 @@ function mapConversation(raw) {
188
188
  id: raw.id,
189
189
  title: raw.metadata?.title ?? "",
190
190
  createdAt: secondsToDate(raw.created_at),
191
- updatedAt: secondsToDate(raw.updated_at)
191
+ updatedAt: secondsToDate(raw.updated_at),
192
+ metadata: raw.metadata ?? null
192
193
  };
193
194
  }
194
195
  function mapConversationList(raw) {
package/dist/index.d.ts CHANGED
@@ -8,5 +8,5 @@ export type { DocumentUploadConfig, DocumentUploadProvider, FileEntry, FileStatu
8
8
  export { CkAgentMessage, CkAgentMessageHeader, CkHeaderActivityButton, CkCitation, CkCitationCard, CkConversation, CkConversationLayout, CkCopyMessageButton, CkDropZoneOverlay, CkFeedbackButton, CkFeedbackDialog, CkFileItemsList, CkHistory, CkHistoryItem, CkHistoryWrapper, CkMarkdownRenderer, CkMessageButton, CkModelSelector, CkPromptSendButton, CkPromptMenuButton, CkPromptStopButton, CkPromptInput, CkPromptInputDisclaimer, CkRegenerateMessageButton, CkSendIcon, CkStopIcon, CkUserMessage, CkEditableUserMessage, } from './components';
9
9
  export type { CkAgentMessageHeaderProps, CkHeaderActivityButtonProps, CkHeaderActivityButtonEmits, CkCitationProps, CkCitationEmits, CkCitationSource, CkCitationCardProps, CkCitationCardEmits, CkConversationLayoutProps, CkConversationProps, CkDropZoneOverlayProps, CkDropZoneOverlayEmits, CkDropZoneRejection, CkDropZoneRejectionReason, CkFeedbackButtonProps, CkFeedbackDialogEmits, CkFeedbackDialogProps, CkFeedbackDialogSubmitPayload, CkFeedbackReason, CkFeedbackSentiment, CkFeedbackValue, CkFileEntry, CkFileItemsListEmits, CkFileItemsListProps, CkHistoryEmits, CkHistoryItemEmits, CkHistoryItemProps, CkHistoryProps, CkHistoryWrapperProps, CkMarkdownElementClasses, CkMarkdownRendererProps, CkMarkdownRendererEmits, CkModelOption, CkModelSelectorProps, CkModelSelectorEmits, CkPromptMenuButtonProps, CkUserMessageProps, CkEditableUserMessageProps, CkEditableUserMessageEmits, } from './components';
10
10
  export { formatRelativeTime } from './helpers';
11
- export type { BaseMessage, Conversation, ConversationTree, MessageContent, MessageContentStatus, MessageMetadata, MessageReasoningContent, MessageRole, MessageStatus, MessageTextContent, MessageToolContent, TreeMessage, } from './types';
11
+ export type { ActiveComparison, BaseMessage, ComparisonLane, Conversation, ConversationTree, MessageContent, MessageContentStatus, MessageMetadata, MessageReasoningContent, MessageRole, MessageStatus, MessageTextContent, MessageToolContent, TreeMessage, } from './types';
12
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,WAAW,GACjB,MAAM,YAAY,CAAC;AASpB,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,GAChB,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGhD,OAAO,EACL,OAAO,EACP,uBAAuB,EACvB,gBAAgB,GACjB,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,WAAW,EACX,SAAS,EACT,mBAAmB,EACnB,uBAAuB,EACvB,cAAc,EACd,eAAe,EACf,aAAa,EACb,6BAA6B,EAC7B,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,QAAQ,EACR,4BAA4B,EAC5B,2BAA2B,EAC3B,gBAAgB,EAChB,kCAAkC,GACnC,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,oBAAoB,EACpB,sBAAsB,EACtB,SAAS,EACT,UAAU,GACX,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,sBAAsB,EACtB,UAAU,EACV,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACb,uBAAuB,EACvB,yBAAyB,EACzB,UAAU,EACV,UAAU,EACV,aAAa,EACb,qBAAqB,GACtB,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,yBAAyB,EACzB,2BAA2B,EAC3B,2BAA2B,EAC3B,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,yBAAyB,EACzB,mBAAmB,EACnB,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,EACnB,yBAAyB,EACzB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,6BAA6B,EAC7B,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,WAAW,EACX,oBAAoB,EACpB,oBAAoB,EACpB,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,EACd,qBAAqB,EACrB,wBAAwB,EACxB,uBAAuB,EACvB,uBAAuB,EACvB,aAAa,EACb,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EAClB,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAG/C,YAAY,EACV,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,oBAAoB,EACpB,eAAe,EACf,uBAAuB,EACvB,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,WAAW,GACZ,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,WAAW,GACjB,MAAM,YAAY,CAAC;AASpB,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,EAChB,oBA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WAAW,EACX,oBAAoB,EACpB,oBAAoB,EACpB,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,EACd,qBAAqB,EACrB,wBAAwB,EACxB,uBAAuB,EACvB,uBAAuB,EACvB,aAAa,EACb,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EAClB,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAG/C,YAAY,EACV,gBAAgB,EAChB,WAAW,EACX,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,oBAAoB,EACpB,eAAe,EACf,uBAAuB,EACvB,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,WAAW,GACZ,MAAM,SAAS,CAAC"}
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import { u } from "./useMessageHandler-N50Yj-NU.js";
1
+ import { u } from "./useMessageHandler-Tellov3w.js";
2
2
  import { C, d, p, u as u2, a } from "./useChatKitLabels-DLy0BFx8.js";
3
- import { S, c, d as d2, a as a2, u as u3, b, e, f } from "./index-CyrVnbS9.js";
4
- import { _, a as a3, C as C2, b as b2, c as c2, d as d3, e as e2, f as f2, g, h, i, j, k, l, m, n, o, p as p2, q, r, s, t, u as u4, v, w, x, y, z, A } from "./CkHistory.vue_vue_type_script_setup_true_lang-D9oP6oEj.js";
3
+ import { S, c, d as d2, a as a2, u as u3, b, e, f } from "./index-Hcwv9Hby.js";
4
+ import { _, a as a3, C as C2, b as b2, c as c2, d as d3, e as e2, f as f2, g, h, i, j, k, l, m, n, o, p as p2, q, r, s, t, u as u4, v, w, x, y, z, A } from "./CkHistory.vue_vue_type_script_setup_true_lang-DHzZgEn-.js";
5
5
  export {
6
6
  C as CHAT_KIT_LABELS,
7
7
  _ as CkAgentMessage,
@@ -25,6 +25,13 @@ export interface ConversationSummary {
25
25
  title: string;
26
26
  createdAt: Date;
27
27
  updatedAt: Date;
28
+ /**
29
+ * The raw conversation metadata, passed through untouched — including the
30
+ * `title` (also surfaced above as a convenience). Lets consumers read
31
+ * app-specific keys — e.g. arena winners — from a `fetchById` result without
32
+ * a second request. `null` when the server returned no metadata.
33
+ */
34
+ metadata?: Record<string, unknown> | null;
28
35
  }
29
36
  /**
30
37
  * Raw server response for a single conversation, in the OpenAI-style API
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/services/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEzE;;;;;;;GAOG;AACH,MAAM,WAAW,UAAU;IACzB,GAAG,CAAC,CAAC,EACH,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,GAC7C,OAAO,CAAC,CAAC,CAAC,CAAC;IACd,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAClD,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACrC;AAED;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;CACjB;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;IAC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