@aleph-alpha/chat-kit 5.12.0 → 6.0.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 (69) hide show
  1. package/dist/{CkHistory.vue_vue_type_script_setup_true_lang-CImSzLYs.js → CkHistory.vue_vue_type_script_setup_true_lang-D9Ph9eYp.js} +115 -31
  2. package/dist/adapters/responses-api.d.ts +1 -1
  3. package/dist/adapters/responses-api.d.ts.map +1 -1
  4. package/dist/adapters/responses-api.js +9 -7
  5. package/dist/chat-kit.css +12 -12
  6. package/dist/components/base/CkCitation/CkCitation.stories.d.ts +1 -4
  7. package/dist/components/base/CkCitation/CkCitation.stories.d.ts.map +1 -1
  8. package/dist/components/base/CkCitation/CkCitation.vue.d.ts.map +1 -1
  9. package/dist/components/base/CkCitation/types.d.ts +6 -1
  10. package/dist/components/base/CkCitation/types.d.ts.map +1 -1
  11. package/dist/components/base/CkCitationCard/CkCitationCard.stories.d.ts +13 -2
  12. package/dist/components/base/CkCitationCard/CkCitationCard.stories.d.ts.map +1 -1
  13. package/dist/components/base/CkCitationCard/CkCitationCard.vue.d.ts +1 -0
  14. package/dist/components/base/CkCitationCard/CkCitationCard.vue.d.ts.map +1 -1
  15. package/dist/components/base/CkCitationCard/types.d.ts +6 -1
  16. package/dist/components/base/CkCitationCard/types.d.ts.map +1 -1
  17. package/dist/components/base/CkCitationLabel/CkCitationLabel.vue.d.ts.map +1 -1
  18. package/dist/components/base/CkHistoryItem/CkHistoryItem.vue.d.ts.map +1 -1
  19. package/dist/components/base/CkHistoryWrapper/CkHistoryWrapper.vue.d.ts.map +1 -1
  20. package/dist/components/base/CkMarkdownRenderer/CkMarkdownRenderer.stories.d.ts.map +1 -1
  21. package/dist/components/index.js +1 -1
  22. package/dist/composables/fileUpload/useFileUpload.d.ts.map +1 -1
  23. package/dist/composables/index.js +1 -1
  24. package/dist/composables/useChat.d.ts.map +1 -1
  25. package/dist/composables/useConversations.d.ts.map +1 -1
  26. package/dist/composables/useIsTruncated.d.ts +22 -0
  27. package/dist/composables/useIsTruncated.d.ts.map +1 -0
  28. package/dist/handlers/index.js +1 -1
  29. package/dist/handlers/useChatKitLabels.d.ts +35 -1
  30. package/dist/handlers/useChatKitLabels.d.ts.map +1 -1
  31. package/dist/{index-Dn4ctxk8.js → index-C72e57-5.js} +48 -24
  32. package/dist/index.js +3 -3
  33. package/dist/test-utils/createTextPlugin.d.ts +7 -1
  34. package/dist/test-utils/createTextPlugin.d.ts.map +1 -1
  35. package/dist/{useChatKitLabels-CMOr3Kjq.js → useChatKitLabels-368lodS5.js} +1 -1
  36. package/package.json +4 -4
  37. package/src/adapters/responses-api.spec.ts +86 -0
  38. package/src/adapters/responses-api.ts +13 -9
  39. package/src/components/base/CkCitation/CkCitation.spec.ts +3 -3
  40. package/src/components/base/CkCitation/CkCitation.stories.ts +85 -3
  41. package/src/components/base/CkCitation/CkCitation.vue +5 -1
  42. package/src/components/base/CkCitation/types.ts +6 -1
  43. package/src/components/base/CkCitationCard/CkCitationCard.spec.ts +37 -0
  44. package/src/components/base/CkCitationCard/CkCitationCard.stories.ts +30 -3
  45. package/src/components/base/CkCitationCard/CkCitationCard.vue +54 -12
  46. package/src/components/base/CkCitationCard/types.ts +6 -1
  47. package/src/components/base/CkCitationLabel/CkCitationLabel.spec.ts +3 -3
  48. package/src/components/base/CkCitationLabel/CkCitationLabel.vue +7 -6
  49. package/src/components/base/CkConversationLayout/CkConversationLayout.spec.ts +1 -5
  50. package/src/components/base/CkCopyMessageButton/CkCopyMessageButton.spec.ts +1 -1
  51. package/src/components/base/CkFeedbackButton/CkFeedbackButton.vue +3 -3
  52. package/src/components/base/CkFeedbackDialog/CkFeedbackDialog.spec.ts +1 -1
  53. package/src/components/base/CkFeedbackDialog/CkFeedbackDialog.vue +9 -9
  54. package/src/components/base/CkHistoryItem/CkHistoryItem.vue +5 -7
  55. package/src/components/base/CkHistoryWrapper/CkHistoryWrapper.vue +2 -1
  56. package/src/components/base/CkMarkdownRenderer/CkMarkdownRenderer.stories.ts +9 -4
  57. package/src/components/base/CkMarkdownRenderer/CkMarkdownRenderer.vue +1 -1
  58. package/src/components/base/CkModelSelector/CkModelSelector.vue +3 -3
  59. package/src/composables/fileUpload/useFileUpload.ts +45 -30
  60. package/src/composables/fileUpload/useFileUploadWrapper.spec.ts +1 -1
  61. package/src/composables/fileUpload/useFileUploadWrapper.ts +3 -3
  62. package/src/composables/useChat.ts +3 -1
  63. package/src/composables/useConversations.ts +8 -5
  64. package/src/composables/useIsTruncated.ts +82 -0
  65. package/src/handlers/useChatKitLabels.spec.ts +0 -1
  66. package/src/handlers/useChatKitLabels.ts +2 -2
  67. package/src/handlers/useMarkdownParser.ts +1 -1
  68. package/src/test-setup.ts +3 -3
  69. package/src/test-utils/createTextPlugin.ts +11 -3
@@ -1,6 +1,6 @@
1
- import { defineComponent, openBlock, createBlock, unref, createElementBlock, createElementVNode, normalizeClass, renderSlot, createCommentVNode, mergeProps, withCtx, computed, createVNode, toDisplayString, resolveDynamicComponent, createTextVNode, ref, onBeforeUnmount, useSlots, onMounted, nextTick, onUnmounted, watch, Fragment, renderList, normalizeStyle, Transition, createStaticVNode, Teleport, withModifiers, toValue, h, toRefs, useId, useAttrs, useTemplateRef, onUpdated, createSlots, normalizeProps, guardReactiveProps, Comment, Text } from "vue";
2
- import { UiIcon, UiButton, UiFileType, UiPopover, UiPopoverTrigger, UiPopoverContent, UiTooltip, formatFileSize, UiDialog, UiDialogContent, UiDialogDescription, UiFieldLabel, UiToggleGroup, UiToggleGroupItem, UiField, UiTextarea, UiFileItem, UiProgress, Primitive, UiFloatActions, UiFloatActionItems, UiCodeBlock, UiAvatar, UiAvatarImage, UiSpinner, UiAvatarFallback, UiSidebarPopoverMenu, UiSidebarPopoverMenuItem } from "@aleph-alpha/ui-library";
3
- import { u as useChatKitLabels, d as defaultChatKitLabels, r as remarkCitations, b as useMarkdownParser } from "./useChatKitLabels-CMOr3Kjq.js";
1
+ import { defineComponent, openBlock, createBlock, unref, createElementBlock, createElementVNode, normalizeClass, renderSlot, createCommentVNode, mergeProps, withCtx, ref, watch, onScopeDispose, computed, useTemplateRef, createVNode, toDisplayString, resolveDynamicComponent, onBeforeUnmount, useSlots, onMounted, nextTick, onUnmounted, Fragment, renderList, normalizeStyle, Transition, createStaticVNode, Teleport, withModifiers, toValue, h, toRefs, useId, createTextVNode, useAttrs, onUpdated, createSlots, normalizeProps, guardReactiveProps, Comment, Text } from "vue";
2
+ import { UiIcon, UiButton, UiFileType, UiTooltip, UiPopover, UiPopoverTrigger, UiPopoverContent, formatFileSize, UiDialog, UiDialogContent, UiDialogDescription, UiFieldLabel, UiToggleGroup, UiToggleGroupItem, UiField, UiTextarea, UiFileItem, UiProgress, Primitive, UiFloatActions, UiFloatActionItems, UiCodeBlock, UiAvatar, UiAvatarImage, UiSpinner, UiAvatarFallback, UiSidebarPopoverMenu, UiSidebarPopoverMenuItem } from "@aleph-alpha/ui-library";
3
+ import { u as useChatKitLabels, d as defaultChatKitLabels, r as remarkCitations, b as useMarkdownParser } from "./useChatKitLabels-368lodS5.js";
4
4
  const MINUTE = 60;
5
5
  const HOUR = 60 * MINUTE;
6
6
  const DAY = 24 * HOUR;
@@ -181,13 +181,59 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
181
181
  };
182
182
  }
183
183
  });
184
+ const measurers = /* @__PURE__ */ new WeakMap();
185
+ let sharedObserver;
186
+ function getSharedObserver() {
187
+ if (typeof ResizeObserver === "undefined") return void 0;
188
+ sharedObserver ??= new ResizeObserver((entries) => {
189
+ for (const entry of entries) measurers.get(entry.target)?.();
190
+ });
191
+ return sharedObserver;
192
+ }
193
+ function watchElement(el, measure) {
194
+ measurers.set(el, measure);
195
+ getSharedObserver()?.observe(el);
196
+ }
197
+ function unwatchElement(el) {
198
+ measurers.delete(el);
199
+ getSharedObserver()?.unobserve(el);
200
+ }
201
+ function useIsTruncated(elementRef, watchSource) {
202
+ const isTruncated = ref(false);
203
+ function measure() {
204
+ const el = elementRef.value;
205
+ isTruncated.value = el ? el.scrollWidth - el.clientWidth >= 1 : false;
206
+ }
207
+ if (watchSource) watch(watchSource, measure, { flush: "post" });
208
+ watch(
209
+ elementRef,
210
+ (el, previous) => {
211
+ if (previous) unwatchElement(previous);
212
+ if (el) watchElement(el, measure);
213
+ measure();
214
+ },
215
+ { immediate: true, flush: "post" }
216
+ );
217
+ onScopeDispose(() => {
218
+ if (elementRef.value) unwatchElement(elementRef.value);
219
+ });
220
+ return isTruncated;
221
+ }
184
222
  const _hoisted_1$d = { class: "ck-citation-card flex w-[22.5rem] max-w-[90vw] flex-col gap-2 rounded-md bg-background-surface-floating px-6 pb-6 pt-4 shadow-md" };
185
- const _hoisted_2$8 = { class: "flex items-center gap-2" };
186
- const _hoisted_3$7 = ["title"];
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 = {
223
+ const _hoisted_2$8 = { class: "flex min-w-0 items-center gap-3 py-0.5" };
224
+ const _hoisted_3$7 = { class: "line-clamp-6 break-words text-sm leading-5 text-content-on-surface-secondary" };
225
+ const _hoisted_4$7 = {
189
226
  key: 0,
190
- class: "text-sm leading-5 text-content-on-surface-muted"
227
+ class: "flex items-center gap-1.5 text-sm leading-5 text-content-on-surface-muted"
228
+ };
229
+ const _hoisted_5$4 = {
230
+ key: 1,
231
+ "aria-hidden": "true",
232
+ class: "shrink-0 text-border-input-strong"
233
+ };
234
+ const _hoisted_6$4 = {
235
+ key: 2,
236
+ class: "shrink-0"
191
237
  };
192
238
  const _sfc_main$p = /* @__PURE__ */ defineComponent({
193
239
  ...{
@@ -198,6 +244,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
198
244
  fileName: {},
199
245
  snippet: {},
200
246
  locationLabel: { default: void 0 },
247
+ collectionName: { default: void 0 },
201
248
  url: { default: void 0 },
202
249
  openSourceLabel: { default: void 0 }
203
250
  },
@@ -209,6 +256,13 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
209
256
  const openSourceAriaLabel = computed(
210
257
  () => props.openSourceLabel ?? labels.value.citationOpenSource ?? defaultChatKitLabels.citationOpenSource
211
258
  );
259
+ const fileNameRef = useTemplateRef("fileNameRef");
260
+ const collectionRef = useTemplateRef("collectionRef");
261
+ const isFileNameTruncated = useIsTruncated(fileNameRef, () => props.fileName);
262
+ const isCollectionTruncated = useIsTruncated(
263
+ collectionRef,
264
+ () => props.collectionName
265
+ );
212
266
  function handleOpen() {
213
267
  if (props.url) {
214
268
  emit("open-source", props.url);
@@ -221,10 +275,20 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
221
275
  filename: __props.fileName,
222
276
  class: "shrink-0"
223
277
  }, null, 8, ["filename"]),
224
- createElementVNode("p", {
225
- class: "min-w-0 truncate text-sm font-medium text-content-on-surface-primary",
226
- title: __props.fileName
227
- }, toDisplayString(__props.fileName), 9, _hoisted_3$7),
278
+ createVNode(unref(UiTooltip), {
279
+ content: __props.fileName,
280
+ disabled: !unref(isFileNameTruncated),
281
+ align: "start"
282
+ }, {
283
+ default: withCtx(() => [
284
+ createElementVNode("p", {
285
+ ref_key: "fileNameRef",
286
+ ref: fileNameRef,
287
+ class: "min-w-0 truncate text-sm font-medium leading-4 text-content-on-surface-primary"
288
+ }, toDisplayString(__props.fileName), 513)
289
+ ]),
290
+ _: 1
291
+ }, 8, ["content", "disabled"]),
228
292
  __props.url ? (openBlock(), createBlock(unref(UiButton), {
229
293
  key: 0,
230
294
  variant: "ghost",
@@ -243,8 +307,26 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
243
307
  _: 1
244
308
  }, 8, ["aria-label"])) : createCommentVNode("", true)
245
309
  ]),
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)
310
+ createElementVNode("p", _hoisted_3$7, toDisplayString(__props.snippet), 1),
311
+ __props.collectionName || __props.locationLabel ? (openBlock(), createElementBlock("p", _hoisted_4$7, [
312
+ __props.collectionName ? (openBlock(), createBlock(unref(UiTooltip), {
313
+ key: 0,
314
+ content: __props.collectionName,
315
+ disabled: !unref(isCollectionTruncated),
316
+ align: "start"
317
+ }, {
318
+ default: withCtx(() => [
319
+ createElementVNode("span", {
320
+ ref_key: "collectionRef",
321
+ ref: collectionRef,
322
+ class: "min-w-0 truncate"
323
+ }, toDisplayString(__props.collectionName), 513)
324
+ ]),
325
+ _: 1
326
+ }, 8, ["content", "disabled"])) : createCommentVNode("", true),
327
+ __props.collectionName && __props.locationLabel ? (openBlock(), createElementBlock("span", _hoisted_5$4, " | ")) : createCommentVNode("", true),
328
+ __props.locationLabel ? (openBlock(), createElementBlock("span", _hoisted_6$4, toDisplayString(__props.locationLabel), 1)) : createCommentVNode("", true)
329
+ ])) : createCommentVNode("", true)
248
330
  ]);
249
331
  };
250
332
  }
@@ -273,16 +355,17 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
273
355
  role: isButton.value ? void 0 : "img",
274
356
  "aria-label": resolvedAriaLabel.value,
275
357
  class: normalizeClass([
276
- "ck-citation mx-px inline-flex h-5 min-w-5 items-center justify-center rounded-sm px-1 align-middle text-sm leading-4 tabular-nums transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
358
+ "ck-citation ui-focus-ring mx-px inline-flex h-5 min-w-5 items-center justify-center rounded-sm border border-transparent px-1 align-middle text-sm leading-4 tabular-nums transition-colors",
277
359
  // The static chip is part of the prose: it must stay selectable so the
278
360
  // number survives a copy of the surrounding text. A control shouldn't
279
361
  // start a text selection on click, so button mode keeps `select-none`.
280
- isButton.value ? "select-none" : "",
281
- __props.selected ? "bg-background-accent-soft text-black" : "bg-background-accent-yellow text-background-status-warning"
362
+ // Only the control gets the hover layer; a static chip has no hover state.
363
+ isButton.value ? "select-none hover-layer hover-layer-default" : "",
364
+ __props.selected ? "bg-background-accent-soft text-content-on-accent-soft" : "bg-background-surface-citation text-content-on-surface-primary"
282
365
  ])
283
366
  }, {
284
367
  default: withCtx(() => [
285
- createTextVNode(toDisplayString(__props.index), 1)
368
+ createElementVNode("span", null, toDisplayString(__props.index), 1)
286
369
  ]),
287
370
  _: 1
288
371
  }, 8, ["type", "role", "aria-label", "class"]);
@@ -296,7 +379,7 @@ const _export_sfc = (sfc, props) => {
296
379
  }
297
380
  return target;
298
381
  };
299
- const CkCitationLabel = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-66d74063"]]);
382
+ const CkCitationLabel = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-66ed453e"]]);
300
383
  const CLOSE_DELAY_MS = 80;
301
384
  const _sfc_main$n = /* @__PURE__ */ defineComponent({
302
385
  ...{
@@ -311,6 +394,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
311
394
  fileName: {},
312
395
  snippet: {},
313
396
  locationLabel: { default: void 0 },
397
+ collectionName: {},
314
398
  url: { default: void 0 }
315
399
  },
316
400
  emits: ["open-source"],
@@ -372,7 +456,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
372
456
  createVNode(unref(CkCitationLabel), {
373
457
  as: "button",
374
458
  index: __props.index,
375
- selected: __props.selected,
459
+ selected: __props.selected || open.value,
376
460
  "aria-label": __props.ariaLabel,
377
461
  onKeydown: onTriggerKeydown,
378
462
  onMouseenter: onPointerEnter,
@@ -397,10 +481,11 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
397
481
  "file-name": __props.fileName,
398
482
  snippet: __props.snippet,
399
483
  "location-label": __props.locationLabel,
484
+ "collection-name": __props.collectionName,
400
485
  url: __props.url,
401
486
  "open-source-label": __props.openSourceLabel,
402
487
  onOpenSource: _cache[0] || (_cache[0] = (u) => emit("open-source", u))
403
- }, null, 8, ["file-name", "snippet", "location-label", "url", "open-source-label"])
488
+ }, null, 8, ["file-name", "snippet", "location-label", "collection-name", "url", "open-source-label"])
404
489
  ]),
405
490
  _: 1
406
491
  })
@@ -1074,7 +1159,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
1074
1159
  };
1075
1160
  }
1076
1161
  });
1077
- const CkFeedbackButton = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-b9bc1c41"]]);
1162
+ const CkFeedbackButton = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-c4c638c3"]]);
1078
1163
  function useCitationRendering(citations, onOpenSource) {
1079
1164
  const sourcesByIndex = computed(
1080
1165
  () => new Map(
@@ -1467,7 +1552,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
1467
1552
  };
1468
1553
  }
1469
1554
  });
1470
- const CkFeedbackDialog = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-175a7cb9"]]);
1555
+ const CkFeedbackDialog = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-fce18e3e"]]);
1471
1556
  const _sfc_main$e = /* @__PURE__ */ defineComponent({
1472
1557
  ...{
1473
1558
  name: "CkFileItemRow",
@@ -1874,13 +1959,11 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
1874
1959
  props.actionPopoverContentClass
1875
1960
  ]);
1876
1961
  const passthroughAttrs = computed(() => {
1877
- const {
1878
- class: _class,
1879
- as: _as,
1880
- asChild: _asChild,
1881
- "as-child": _asChildAttr,
1882
- ...rest
1883
- } = attrs;
1962
+ const rest = { ...attrs };
1963
+ delete rest.class;
1964
+ delete rest.as;
1965
+ delete rest.asChild;
1966
+ delete rest["as-child"];
1884
1967
  return rest;
1885
1968
  });
1886
1969
  const primitiveAs = computed(() => attrs.as ?? "button");
@@ -2038,7 +2121,8 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
2038
2121
  return [baseClass, props.withGap ? "gap-1" : void 0, consumerClass].filter(Boolean).join(" ");
2039
2122
  });
2040
2123
  const passthroughAttrs = computed(() => {
2041
- const { class: _class, ...rest } = attrs;
2124
+ const rest = { ...attrs };
2125
+ delete rest.class;
2042
2126
  return rest;
2043
2127
  });
2044
2128
  return (_ctx, _cache) => {
@@ -92,7 +92,7 @@ export interface ResponseToolDescriptor {
92
92
  * than visible content. The list enumerates the values chat-kit recognises
93
93
  * today; extend it as new tool kinds are introduced upstream.
94
94
  */
95
- export type ResponseOutputToolType = 'mcp_list_tools' | 'mcp_call' | 'tool_call' | 'function_call' | 'web_search_call' | 'file_search_call' | 'code_interpreter_call' | 'image_generation_call' | 'local_shell_call';
95
+ export type ResponseOutputToolType = 'mcp_list_tools' | 'mcp_call' | 'tool_call' | 'function_call' | 'web_search_call' | 'file_search_call' | 'code_interpreter_call' | 'image_generation_call' | 'local_shell_call' | 'shell_call' | 'fetch_url';
96
96
  /**
97
97
  * Server-provided rendering hints for a tool invocation. The server emits a
98
98
  * human-readable `text` (e.g. "Searching the web…") and a lucide.dev `icon`
@@ -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,WAAW,EACZ,MAAM,UAAU,CAAC;AAMlB;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,aAAa,GAAG,MAAM,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,kBAAkB,EAAE,CAAC;CACpC;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,cAAc,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,kBAAkB,EAAE,CAAC;CACpC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,0BA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3C,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;AA0XD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,cAAc,EAAE,GAC1B,wBAAwB,CAwB1B"}
@@ -49,15 +49,17 @@ function toAssistantParts(resp) {
49
49
  parts.push(textPart(text, out.id || void 0));
50
50
  break;
51
51
  }
52
- // Actual tool invocations surface as tool parts. `mcp_list_tools` is
53
- // informational discovery (the server advertising tools) rather than
54
- // a call the assistant made, so it is intentionally skipped.
55
- case "mcp_call":
56
- case "function_call":
57
- case "tool_call": {
52
+ // Discovery catalog, not a call the assistant made.
53
+ case "mcp_list_tools":
54
+ break;
55
+ // Every other `ResponseOutputTool` is an invocation — function /
56
+ // MCP / hosted builtins (`web_search_call`, `file_search_call`,
57
+ // `shell_call`, …). Hosts used to coerce those to `tool_call`
58
+ // before calling this adapter; converting them here keeps the
59
+ // stored item type intact for citations.
60
+ default:
58
61
  parts.push(toolPart(out));
59
62
  break;
60
- }
61
63
  }
62
64
  }
63
65
  return parts;