@epam/ai-dial-chat-hooks 1.2.0-dev.11 → 1.2.0-dev.112

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 (58) hide show
  1. package/api-error/api-error.js +5 -4
  2. package/attachment/useAttachmentValidation/useAttachmentValidation.js +26 -19
  3. package/attachments.d.ts +10 -4
  4. package/catalog/map-deployment-to-catalog-item.js +2 -2
  5. package/catalog/map-skill-to-catalog-item.js +30 -27
  6. package/catalog/publish.js +2 -1
  7. package/catalog/useApplicationCredentials/useApplicationCredentials.js +39 -0
  8. package/catalog/useSkillDetailsPanelData/useSkillDetailsPanelData.js +39 -39
  9. package/catalog/useSkillItemDetails.js +17 -13
  10. package/catalog.d.ts +42 -5
  11. package/catalog.js +6 -5
  12. package/conversation/conversation-transfer/queue.js +8 -5
  13. package/conversation/stage.js +23 -0
  14. package/conversation/useAttachmentUpload/useAttachmentUpload.js +12 -5
  15. package/conversation/useConversationHandlers/useConversationHandlers.js +13 -17
  16. package/conversation/useConversationImport/useConversationImport.js +1 -1
  17. package/conversation/useConversationScroll/useConversationScroll.js +68 -64
  18. package/conversation/useConversationStream/apply-chunk.js +1 -1
  19. package/conversation/useConversationStream/useConversationStream.js +5 -1
  20. package/conversation-overlay.d.ts +7 -0
  21. package/conversation-overlay.js +2 -0
  22. package/conversation.d.ts +108 -5
  23. package/conversation.js +24 -23
  24. package/file-manager-canvas.d.ts +398 -0
  25. package/file-manager-canvas.js +2 -0
  26. package/file-manager.d.ts +71 -330
  27. package/file-manager.js +15 -15
  28. package/files/attachment-canvas.js +51 -13
  29. package/files/attachment-types.js +14 -13
  30. package/files/useDialFileManagerTabConfig/useDialFileManagerTabConfig.js +1 -5
  31. package/files/useFileAttachmentPicker/useFileAttachmentPicker.js +43 -0
  32. package/index.d.ts +717 -31
  33. package/index.js +123 -111
  34. package/mcp-apps/useMcpAppHostAdapter/useMcpAppHostAdapter.js +7 -5
  35. package/mcp-apps/useMcpAppHostContext/useMcpAppHostContext.js +1 -1
  36. package/mcp-apps/useMcpAppTools/useMcpAppTools.js +1 -1
  37. package/mcp-apps/useOpenMcpAppCanvas/useOpenMcpAppCanvas.js +25 -23
  38. package/mcp-apps.d.ts +8 -6
  39. package/package.json +37 -18
  40. package/scheduled-task/scheduled-task-description.js +77 -0
  41. package/scheduled-task/scheduled-task-preparation.js +24 -0
  42. package/scheduled-task/scheduled-task-trigger.js +7 -2
  43. package/scheduled-task/scheduled-tasks-api-client.js +19 -0
  44. package/scheduled-task/use-scheduled-task-runs.js +82 -0
  45. package/scheduled-task/use-scheduled-tasks.js +93 -0
  46. package/scheduled-tasks.d.ts +180 -3
  47. package/scheduled-tasks.js +7 -2
  48. package/skill/skill.js +10 -7
  49. package/skill/useSkillArchiveImport/useSkillArchiveImport.js +75 -0
  50. package/skill/useSkillEditorLoad.js +29 -28
  51. package/skill/useSkillEditorSubmit.js +92 -75
  52. package/skill-editor.d.ts +107 -0
  53. package/skill-editor.js +9 -8
  54. package/usage/map-usage-data-to-dashboard.js +66 -0
  55. package/usage/map-user-usage-to-model-limits.js +160 -0
  56. package/usage.d.ts +120 -0
  57. package/usage.js +3 -0
  58. package/utils.d.ts +3 -1
@@ -26,9 +26,16 @@ var o = 700, s = 5, c = (e) => t(e.split("/").filter(Boolean).pop() ?? "file").r
26
26
  })).url,
27
27
  name: a.fileName
28
28
  };
29
- } catch (t) {
30
- if (l(t)) {
29
+ } catch (c) {
30
+ if (l(c)) {
31
31
  if (i.markTaken(a.fileName), o < s) {
32
+ if (t.listFiles) try {
33
+ let e = await t.listFiles({
34
+ bucket: u,
35
+ path: a.path.slice(0, a.path.lastIndexOf("/"))
36
+ });
37
+ for (let t of e.items) i.markTaken(t.name);
38
+ } catch {}
32
39
  a = i.allocate(n);
33
40
  continue;
34
41
  }
@@ -38,10 +45,10 @@ var o = 700, s = 5, c = (e) => t(e.split("/").filter(Boolean).pop() ?? "file").r
38
45
  let e = p.current.splice(0);
39
46
  d?.(e), m.current = null;
40
47
  }, f);
41
- let n = t instanceof Error ? t : /* @__PURE__ */ Error("Network upload failed");
42
- throw n.errorReason = r.Network, n;
48
+ let t = c instanceof Error ? c : /* @__PURE__ */ Error("Network upload failed");
49
+ throw t.errorReason = r.Network, t;
43
50
  }
44
- throw t;
51
+ throw c;
45
52
  }
46
53
  }, [
47
54
  u,
@@ -44,23 +44,19 @@ var p = ({ conversation: p, conversationId: m, bucket: h, isStreaming: g, startS
44
44
  if (g || !m || !p || e === -1 || p.messages[e]?.role !== c.Assistant) return;
45
45
  let t = p.messages[e - 1];
46
46
  if (!t || t.role !== c.User) return;
47
- let n = C();
48
- v((t) => {
49
- if (!t) return t;
50
- let r = {
51
- ...t.messages[e],
52
- content: "",
53
- custom_content: void 0,
54
- wasStoppedByUser: void 0,
55
- stoppedWithoutContent: void 0,
56
- streamErrorMessage: void 0,
57
- deploymentId: n
58
- }, i = {
59
- ...t,
60
- messages: [...t.messages.slice(0, e), r]
61
- };
62
- return y.current = i, i;
63
- }), A((t) => new Set([...t].filter((t) => t < e))), _(m, t.content, e, n, t.custom_content, l(), f.Regenerate);
47
+ let n = C(), r = {
48
+ ...p.messages[e],
49
+ content: "",
50
+ custom_content: void 0,
51
+ wasStoppedByUser: void 0,
52
+ stoppedWithoutContent: void 0,
53
+ streamErrorMessage: void 0,
54
+ deploymentId: n
55
+ }, i = {
56
+ ...p,
57
+ messages: [...p.messages.slice(0, e), r]
58
+ };
59
+ y.current = i, v(i), A((t) => new Set([...t].filter((t) => t < e))), _(m, t.content, e, n, t.custom_content, l(), f.Regenerate);
64
60
  }, [
65
61
  p,
66
62
  m,
@@ -191,7 +191,7 @@ var b = 5, x = 5, S = (e) => /\.(dial|zip)$/i.test(e.name), C = (e) => new Promi
191
191
  jobId: n,
192
192
  code: t.AttachmentSkipped,
193
193
  names: [...j]
194
- }), A.length > 0 ? D.failJob(n, h.Unknown) : j.size > 0 ? D.warnJob(n, t.AttachmentSkipped) : D.succeedJob(n);
194
+ }), A.length > 0 ? D.failJob(n, h.Unknown) : j.size > 0 ? D.warnJob(n, t.AttachmentSkipped, [...j]) : D.succeedJob(n);
195
195
  }
196
196
  }, [
197
197
  l,
@@ -1,121 +1,125 @@
1
1
  import { useCallback as e, useEffect as t, useLayoutEffect as n, useRef as r, useState as i } from "react";
2
2
  //#region src/conversation/useConversationScroll/useConversationScroll.ts
3
3
  var a = 80, o = 1, s = ({ messages: s, isAssistantTyping: c, conversationId: l }) => {
4
- let [u, d] = i(!1), f = r(null), p = r(null), m = r(null), h = r(!1), g = r(!1), _ = r(null), v = r(/* @__PURE__ */ new Map()), y = e((e, t) => {
5
- t ? v.current.set(e, t) : v.current.delete(e);
6
- }, []), b = r(null), x = e((e) => {
7
- b.current = e;
8
- }, []), S = e((e, t) => {
4
+ let [u, d] = i(!1), f = r(null), p = r(null), m = r(null), h = r(!1), g = r(!1), _ = r(null), v = r(!0), y = r(/* @__PURE__ */ new Map()), b = e((e, t) => {
5
+ t ? y.current.set(e, t) : y.current.delete(e);
6
+ }, []), x = r(null), S = e((e) => {
7
+ x.current = e;
8
+ }, []), C = e((e, t) => {
9
9
  let n = f.current;
10
10
  n && n.scrollTo({
11
11
  top: e,
12
12
  behavior: t ? "instant" : "smooth"
13
13
  });
14
- }, []), C = e(() => {
15
- m.current && (m.current.style.height = "0px"), h.current = !1, g.current = !1, _.current = null;
16
14
  }, []), w = e(() => {
15
+ m.current && (m.current.style.height = "0px"), h.current = !1, g.current = !1, _.current = null;
16
+ }, []), T = e(() => {
17
17
  let e = f.current, t = p.current;
18
18
  if (!e || !t) return null;
19
19
  let n = e.getBoundingClientRect(), r = t.getBoundingClientRect();
20
20
  return e.scrollTop + (r.bottom - n.top) - e.clientHeight;
21
- }, []), T = e((e = !1) => {
22
- let t = w();
23
- t != null && S(Math.max(t, 0), e);
24
- }, [S, w]), E = e(() => {
21
+ }, []), E = e((e = !1) => {
22
+ let t = T();
23
+ t != null && C(Math.max(t, 0), e);
24
+ }, [C, T]), D = e(() => {
25
25
  let e = f.current, t = p.current;
26
26
  if (!e || !t) return null;
27
27
  let n = e.getBoundingClientRect();
28
28
  return t.getBoundingClientRect().bottom - n.top - e.clientHeight;
29
- }, []), D = e(() => {
29
+ }, []), O = e(() => {
30
30
  if (!g.current) return;
31
- let e = E();
32
- e == null || e < -1 || C();
33
- }, [C, E]), O = e((e) => {
34
- let t = f.current, n = v.current.get(e);
31
+ let e = D();
32
+ e == null || e < -1 || w();
33
+ }, [w, D]), k = e((e) => {
34
+ let t = f.current, n = y.current.get(e);
35
35
  if (!t || !n) return null;
36
36
  let r = t.getBoundingClientRect(), i = n.getBoundingClientRect(), a = t.scrollTop + (i.top - r.top);
37
37
  return Math.max(a, 0);
38
- }, []), k = e((e, t = !1) => {
39
- let n = O(e);
40
- n != null && S(n, t);
41
- }, [O, S]), A = e(() => {
42
- let e = w();
38
+ }, []), A = e((e, t = !1) => {
39
+ let n = k(e);
40
+ n != null && C(n, t);
41
+ }, [k, C]), j = e(() => {
42
+ let e = T();
43
43
  return e == null ? null : Math.max(e, 0);
44
- }, [w]), j = e(() => {
44
+ }, [T]), M = e(() => {
45
45
  if (!h.current) return null;
46
- let e = _.current, t = A();
46
+ let e = _.current, t = j();
47
47
  return e == null || t == null ? null : Math.max(e, t);
48
- }, [A]), M = e(() => {
49
- let e = f.current, t = j();
48
+ }, [j]), N = e(() => {
49
+ let e = f.current, t = M();
50
50
  !e || t == null || e.scrollTop > t + o && (e.scrollTop = t);
51
- }, [j]), N = e((e) => {
52
- let t = m.current, n = A();
51
+ }, [M]), P = e((e) => {
52
+ let t = m.current, n = j();
53
53
  if (!t || n == null) return;
54
54
  let r = Math.max(e - n, 0);
55
55
  t.style.height = `${r}px`, h.current = r > 0, g.current = !1, _.current = r > 0 ? e : null;
56
- }, [A]), P = e((e) => {
57
- let t = O(e);
58
- t != null && (N(t), k(e, !1));
56
+ }, [j]), F = e((e) => {
57
+ let t = k(e);
58
+ t != null && (P(t), A(e, !1));
59
59
  }, [
60
- N,
61
- O,
62
- k
63
- ]), F = e(() => {
64
- let e = E();
65
- e != null && d(e >= a);
66
- }, [E]), I = r(s.length), L = r(null);
60
+ P,
61
+ k,
62
+ A
63
+ ]), I = e(() => {
64
+ let e = D();
65
+ if (e == null) return;
66
+ let t = e < a;
67
+ v.current = t, d(!t);
68
+ }, [D]), L = r(s.length), R = r(null);
67
69
  n(() => {
68
- let e = s.length !== I.current, t = l !== L.current, n = () => {
69
- I.current = s.length, L.current = l;
70
+ let e = s.length !== L.current, t = l !== R.current, n = () => {
71
+ L.current = s.length, R.current = l;
70
72
  };
71
- t && C();
72
- let r = b.current;
73
- if (r != null && v.current.has(r)) {
74
- b.current = null, P(r), n();
73
+ t && w();
74
+ let r = x.current;
75
+ if (r != null && y.current.has(r)) {
76
+ x.current = null, F(r), n();
75
77
  return;
76
78
  }
77
- c || ((e || t) && T(!1), n());
79
+ c || ((e || t) && E(!1), n());
78
80
  }, [
79
81
  s,
80
82
  c,
81
83
  l,
82
- T,
83
- P,
84
- C
84
+ E,
85
+ F,
86
+ w
85
87
  ]), n(() => {
86
- !c && h.current && (g.current = !0, D());
87
- }, [c, D]);
88
- let R = e(() => {
89
- M(), D(), F();
88
+ !c && h.current && (g.current = !0, O());
89
+ }, [c, O]);
90
+ let z = e(() => {
91
+ N(), O(), I();
90
92
  }, [
91
- M,
92
- D,
93
- F
93
+ N,
94
+ O,
95
+ I
94
96
  ]);
95
97
  return t(() => {
96
98
  let e = f.current;
97
- if (e) return e.addEventListener("scroll", R, { passive: !0 }), () => e.removeEventListener("scroll", R);
98
- }, [R]), t(() => {
99
+ if (e) return e.addEventListener("scroll", z, { passive: !0 }), () => e.removeEventListener("scroll", z);
100
+ }, [z]), t(() => {
99
101
  let e = p.current;
100
102
  if (!e) return;
101
103
  let t = new ResizeObserver(() => {
102
- M(), D(), F();
104
+ let e = v.current && !h.current;
105
+ N(), e && E(!0), O(), I();
103
106
  });
104
107
  return t.observe(e), () => t.disconnect();
105
108
  }, [
106
- M,
107
- D,
108
- F
109
+ N,
110
+ O,
111
+ I,
112
+ E
109
113
  ]), {
110
114
  containerRef: f,
111
115
  contentRef: p,
112
116
  spacerRef: m,
113
- setMessageRef: y,
117
+ setMessageRef: b,
114
118
  isScrollButtonVisible: u,
115
119
  scrollToBottom: e(() => {
116
- T(!1);
117
- }, [T]),
118
- armAnchor: x
120
+ E(!1);
121
+ }, [E]),
122
+ armAnchor: S
119
123
  };
120
124
  };
121
125
  //#endregion
@@ -75,4 +75,4 @@ var t = (e) => {
75
75
  });
76
76
  };
77
77
  //#endregion
78
- export { o as applyChunkToMessages };
78
+ export { o as applyChunkToMessages, a as mergeStages };
@@ -86,7 +86,11 @@ var m = 2e4, h = ({ conversationId: h, state: { setConversation: g, conversation
86
86
  };
87
87
  (async () => {
88
88
  try {
89
- let e = x?.channelId ?? await x?.waitForChannel(m) ?? void 0;
89
+ let e = x?.channelId ?? await x?.waitForChannel(m) ?? void 0, t = N.current.has(h);
90
+ if (D.signal.aborted || E() || t) {
91
+ M.current.get(C)?.generationId === h && M.current.delete(C), E() || R(C), k.current === h && (k.current = null, A.current = null, O(null)), b(C, h), x?.notifyGenerationSettled?.(), t ? N.current.delete(h) : E() || S?.notifyGenerationEnd?.();
92
+ return;
93
+ }
90
94
  v.streamCompletion(C, o, l, F, u, h, f, T, e);
91
95
  } catch (e) {
92
96
  F.onError(e instanceof Error ? e : Error(String(e)));
@@ -0,0 +1,7 @@
1
+ import { Message } from '@epam/ai-dial-chat-shared';
2
+ import { OverlayChatMessage } from '@epam/ai-dial-chat-overlay';
3
+
4
+ /** Maps chat messages to the DIAL Chat Overlay protocol's message shape. */
5
+ export declare const toOverlayMessages: (messages: Message[]) => OverlayChatMessage[];
6
+
7
+ export { }
@@ -0,0 +1,2 @@
1
+ import { toOverlayMessages as e } from "./conversation/overlay-messages.js";
2
+ export { e as toOverlayMessages };
package/conversation.d.ts CHANGED
@@ -15,7 +15,6 @@ import { Message } from '@epam/ai-dial-chat-shared';
15
15
  import { MessageCustomContent } from '@epam/ai-dial-chat-shared';
16
16
  import { MessageRating } from '@epam/ai-dial-chat-shared';
17
17
  import { MutableRefObject } from 'react';
18
- import { OverlayChatMessage } from '@epam/ai-dial-chat-overlay';
19
18
  import { PublishHistoryEntry } from '@epam/ai-dial-publish-panel';
20
19
  import { RateApi } from '@epam/ai-dial-chat-api-client';
21
20
  import { ReactNode } from 'react';
@@ -24,6 +23,7 @@ import { RequestSkill } from '@epam/ai-dial-chat-shared';
24
23
  import { ResponseFormat } from '@epam/ai-dial-chat-shared';
25
24
  import { SendCompletionDtoModeEnum } from '@epam/ai-dial-chat-api-client';
26
25
  import { SetStateAction } from 'react';
26
+ import { Stage } from '@epam/ai-dial-chat-shared';
27
27
  import { StarterOption } from '@epam/ai-dial-chat-shared';
28
28
  import { StatusMessage } from '@epam/ai-dial-chat-shared';
29
29
  import { StreamChunk } from '@epam/ai-dial-chat-shared';
@@ -58,6 +58,25 @@ export declare interface AnnouncementListItemLink {
58
58
  href: string;
59
59
  }
60
60
 
61
+ /**
62
+ * Applies a single SSE stream chunk to the message list.
63
+ *
64
+ *
65
+ * Attachments are accumulated: each chunk's attachments are appended to the
66
+ * existing array rather than replacing it.
67
+ *
68
+ * Annotations are merged by `index`: partial `body.title` and `body.quote`
69
+ * strings are concatenated across chunks, matching the same delta-merge
70
+ * semantics used for stages.
71
+ *
72
+ * `state` is overwritten (not merged) by each chunk that carries one,
73
+ * matching the DIAL stateful-app contract.
74
+ *
75
+ * @returns Updated message array, or `null` when the chunk carries no
76
+ * actionable data (empty content, no form_schema, and no attachments).
77
+ */
78
+ export declare const applyChunkToMessages: (messages: Message[], messageIndex: number, chunk: StreamChunk) => Message[] | null;
79
+
61
80
  /** State and controls returned by `useAsyncConfirmDialog`. */
62
81
  export declare interface AsyncConfirmDialogControls<T> {
63
82
  /**
@@ -573,6 +592,29 @@ declare interface LocalModeValues {
573
592
  temperature: number;
574
593
  }
575
594
 
595
+ /**
596
+ * Returns the normalized stages of a raw stage array or a message-like
597
+ * payload (reading `custom_content.stages`, falling back to
598
+ * `customContent.stages`), or `undefined` when there are none.
599
+ */
600
+ export declare const mapStages: (source: RawStage[] | RawStageSource | null | undefined) => Stage[] | undefined;
601
+
602
+ /**
603
+ * Merges incoming stage deltas into an existing stage list, keyed by `index`.
604
+ *
605
+ * Partial `name` and `content` strings are concatenated across chunks;
606
+ * attachments are merged by their own `index` (concatenating partial `title`
607
+ * and `data`); every other field on the incoming delta overwrites the
608
+ * accumulated one. A brand-new stage whose first chunk carries `name: null`
609
+ * is normalized to `''`.
610
+ *
611
+ * Exported for hosts that keep a flattened `Stage[]` on the message instead
612
+ * of `Message.custom_content.stages` and therefore cannot reuse
613
+ * {@link applyChunkToMessages}. Prefer `useConversationStream` when the host
614
+ * can delegate the whole stream loop.
615
+ */
616
+ export declare const mergeStages: (existing: Stage[], incoming: Stage[]) => Stage[];
617
+
576
618
  /** True when `message` is an assistant message carrying at least one stage. */
577
619
  export declare const messageHasStages: (message: Message) => boolean;
578
620
 
@@ -606,6 +648,63 @@ export declare interface QuickAppConversationStartersSettings {
606
648
  isChatMessageInputDisabled: boolean;
607
649
  }
608
650
 
651
+ /**
652
+ * One stage as it arrives from the REST API or the SSE stream, before
653
+ * normalization. Structurally satisfied by the generated `StageDto` and by a
654
+ * raw stream delta, both of which omit `index`/`name`/`status` on the chunk
655
+ * that opens a stage.
656
+ */
657
+ export declare interface RawStage {
658
+ /** Ordering key. Defaults to `0` when absent. */
659
+ index?: number | null;
660
+ /** Stage title. `null` on the chunk that opens the stage. */
661
+ name?: string | null;
662
+ /** Terminal state as a raw wire string; anything other than `'completed'`/`'failed'` means still running. */
663
+ status?: string | null;
664
+ /** Additional stage text. */
665
+ content?: string | null;
666
+ /** Short source/category label shown beside the stage name. */
667
+ tag?: string | null;
668
+ /** Files produced or referenced by this stage. */
669
+ attachments?: RawStageAttachment[] | null;
670
+ }
671
+
672
+ /**
673
+ * One stage attachment as it arrives from the REST API or the SSE stream,
674
+ * before normalization: every field is optional and may be `null`.
675
+ */
676
+ export declare interface RawStageAttachment {
677
+ /** Zero-based position in the attachment list. */
678
+ index?: number | null;
679
+ /** MIME type of the attachment content. */
680
+ type?: string | null;
681
+ /** Display name shown in the UI. */
682
+ title?: string | null;
683
+ /** Inline base-64 encoded content. */
684
+ data?: string | null;
685
+ /** Remote URL pointing to the attachment content. */
686
+ url?: string | null;
687
+ /** MIME type of the referenced resource. */
688
+ reference_type?: string | null;
689
+ /** URL of an alternate reference resource. */
690
+ reference_url?: string | null;
691
+ }
692
+
693
+ /**
694
+ * Message-like payload carrying stages under either the wire's snake_case
695
+ * `custom_content` or a host's camelCased `customContent`.
696
+ */
697
+ export declare interface RawStageSource {
698
+ /** Custom content as the DIAL wire format spells it. */
699
+ custom_content?: {
700
+ stages?: RawStage[] | null;
701
+ } | null;
702
+ /** Custom content as a camelCasing host spells it. */
703
+ customContent?: {
704
+ stages?: RawStage[] | null;
705
+ } | null;
706
+ }
707
+
609
708
  /** State of one resource's recipient-count lookup. */
610
709
  declare interface RecipientsCountEntry {
611
710
  /** Where the lookup for this resource currently stands. */
@@ -662,8 +761,12 @@ export declare interface StreamCompletionOptions {
662
761
  signal: AbortSignal;
663
762
  }
664
763
 
665
- /** Maps chat messages to the DIAL Chat Overlay protocol's message shape. */
666
- export declare const toOverlayMessages: (messages: Message[]) => OverlayChatMessage[];
764
+ /**
765
+ * Returns a renderable `Stage` for one raw payload: `index` defaults to `0`,
766
+ * `name` to `''`, an unrecognized `status` to `null` (still running), and
767
+ * `content`/`tag`/`attachments` are passed through when present.
768
+ */
769
+ export declare const toStage: (stage: RawStage) => Stage;
667
770
 
668
771
  /** Request shape the host's selected-deployment recognition call accepts. */
669
772
  export declare interface TranscribeWithDeploymentParams {
@@ -728,8 +831,8 @@ export declare const useAttachmentUpload: ({ filesApi, bucket, onNetworkError, d
728
831
 
729
832
  /** Parameters for {@link useAttachmentUpload}. */
730
833
  export declare interface UseAttachmentUploadParams {
731
- /** Already-configured generated-client instance used to upload the file. */
732
- filesApi: Pick<FilesApi, 'uploadFile'>;
834
+ /** Already-configured client; optional listing skips stored names after a conflict. */
835
+ filesApi: Pick<FilesApi, 'uploadFile'> & Partial<Pick<FilesApi, 'listFiles'>>;
733
836
  /** DIAL Core bucket the file is uploaded into. */
734
837
  bucket: string | undefined;
735
838
  /** Called with batched filenames after a burst of network-error upload failures. */
package/conversation.js CHANGED
@@ -6,26 +6,27 @@ import { getModelIdFromConversationId as d } from "./conversation/get-model-id-f
6
6
  import { getTimeOfDayGreeting as f } from "./conversation/greeting.js";
7
7
  import { createDeploymentChangedMessage as p } from "./conversation/message-factory.js";
8
8
  import { getLastDeploymentId as m, getLastUserMessageToolConfiguration as h, isMessageStreaming as g, messageHasStages as _, normalizeResponseFormat as v } from "./conversation/message-utils.js";
9
- import { toOverlayMessages as y } from "./conversation/overlay-messages.js";
10
- import { getQuickAppConversationStarters as b } from "./conversation/quick-app-conversation-starters.js";
11
- import { getStarterPopulateText as x, getStartersFromSchema as S } from "./conversation/starter-option.js";
12
- import { deriveConversationRowActionState as C } from "./conversation/deriveConversationRowActionState/deriveConversationRowActionState.js";
13
- import { useActiveConversationSync as w } from "./conversation/useActiveConversationSync/useActiveConversationSync.js";
14
- import { useAsyncConfirmDialog as T } from "./conversation/useAsyncConfirmDialog/useAsyncConfirmDialog.js";
15
- import { useConversationLookupMaps as E } from "./conversation/useConversationLookupMaps/useConversationLookupMaps.js";
16
- import { getConversationSource as D, useConversationPanelItems as O } from "./conversation/useConversationPanelItems/useConversationPanelItems.js";
17
- import { useImportFilePicker as k } from "./conversation/useImportFilePicker/useImportFilePicker.js";
18
- import { useAttachmentUpload as A } from "./conversation/useAttachmentUpload/useAttachmentUpload.js";
19
- import { AudioTranscriptionError as j, AudioTranscriptionErrorReason as M } from "./conversation/useTranscribeAudio/audio-transcription-error.js";
20
- import { useTranscribeAudio as N } from "./conversation/useTranscribeAudio/useTranscribeAudio.js";
21
- import { attachmentToDto as P, attachmentsToDtos as F } from "./conversation/useConversationHandlers/attachment-to-dto.js";
22
- import { createMessagePair as I } from "./conversation/useConversationHandlers/message-factory.js";
23
- import { hasActiveToolConfig as L, isAnswerIncomplete as R, isMessageChanged as z, shouldRerunGenerationOnEdit as B } from "./conversation/useConversationHandlers/message-utils.js";
24
- import { getStarterConversationText as V, getStarterDisplayText as H, getStarterSubmitText as U } from "./conversation/useConversationHandlers/starter-option.js";
25
- import { getConversationPath as W } from "./conversation/useConversationStream/conversation-path.js";
26
- import { useConversationHandlers as G } from "./conversation/useConversationHandlers/useConversationHandlers.js";
27
- import { isAwaitingGenerationResume as K } from "./conversation/useConversationStream/generation-resume.js";
28
- import { useConversationStream as q } from "./conversation/useConversationStream/useConversationStream.js";
29
- import { useChatSettingsFormConfig as J } from "./useChatSettingsFormConfig/useChatSettingsFormConfig.js";
30
- import { useToolsMenu as Y } from "./useToolsMenu/useToolsMenu.js";
31
- export { j as AudioTranscriptionError, M as AudioTranscriptionErrorReason, a as DEFAULT_GENERATION_CONFLICT_MESSAGE, o as GenerationConflictError, P as attachmentToDto, F as attachmentsToDtos, e as buildAnnouncementSignature, s as createChatStreamApi, p as createDeploymentChangedMessage, I as createMessagePair, C as deriveConversationRowActionState, l as formatAppVersion, W as getConversationPath, D as getConversationSource, m as getLastDeploymentId, h as getLastUserMessageToolConfiguration, d as getModelIdFromConversationId, b as getQuickAppConversationStarters, V as getStarterConversationText, H as getStarterDisplayText, x as getStarterPopulateText, U as getStarterSubmitText, S as getStartersFromSchema, f as getTimeOfDayGreeting, L as hasActiveToolConfig, t as hasAnnouncementContent, n as hasStructuredAnnouncement, R as isAnswerIncomplete, K as isAwaitingGenerationResume, z as isMessageChanged, g as isMessageStreaming, _ as messageHasStages, v as normalizeResponseFormat, r as sanitizeAnnouncementHtml, i as sanitizeAnnouncementMessageHtml, u as sanitizeFooterHtml, B as shouldRerunGenerationOnEdit, c as shouldWatchForDisplayNameUpdate, y as toOverlayMessages, w as useActiveConversationSync, T as useAsyncConfirmDialog, A as useAttachmentUpload, J as useChatSettingsFormConfig, G as useConversationHandlers, E as useConversationLookupMaps, O as useConversationPanelItems, q as useConversationStream, k as useImportFilePicker, Y as useToolsMenu, N as useTranscribeAudio };
9
+ import { getQuickAppConversationStarters as y } from "./conversation/quick-app-conversation-starters.js";
10
+ import { mapStages as b, toStage as x } from "./conversation/stage.js";
11
+ import { getStarterPopulateText as S, getStartersFromSchema as C } from "./conversation/starter-option.js";
12
+ import { deriveConversationRowActionState as w } from "./conversation/deriveConversationRowActionState/deriveConversationRowActionState.js";
13
+ import { useActiveConversationSync as T } from "./conversation/useActiveConversationSync/useActiveConversationSync.js";
14
+ import { useAsyncConfirmDialog as E } from "./conversation/useAsyncConfirmDialog/useAsyncConfirmDialog.js";
15
+ import { useConversationLookupMaps as D } from "./conversation/useConversationLookupMaps/useConversationLookupMaps.js";
16
+ import { getConversationSource as O, useConversationPanelItems as k } from "./conversation/useConversationPanelItems/useConversationPanelItems.js";
17
+ import { useImportFilePicker as A } from "./conversation/useImportFilePicker/useImportFilePicker.js";
18
+ import { useAttachmentUpload as j } from "./conversation/useAttachmentUpload/useAttachmentUpload.js";
19
+ import { AudioTranscriptionError as M, AudioTranscriptionErrorReason as N } from "./conversation/useTranscribeAudio/audio-transcription-error.js";
20
+ import { useTranscribeAudio as P } from "./conversation/useTranscribeAudio/useTranscribeAudio.js";
21
+ import { attachmentToDto as F, attachmentsToDtos as I } from "./conversation/useConversationHandlers/attachment-to-dto.js";
22
+ import { createMessagePair as L } from "./conversation/useConversationHandlers/message-factory.js";
23
+ import { hasActiveToolConfig as R, isAnswerIncomplete as z, isMessageChanged as B, shouldRerunGenerationOnEdit as V } from "./conversation/useConversationHandlers/message-utils.js";
24
+ import { getStarterConversationText as H, getStarterDisplayText as U, getStarterSubmitText as W } from "./conversation/useConversationHandlers/starter-option.js";
25
+ import { getConversationPath as G } from "./conversation/useConversationStream/conversation-path.js";
26
+ import { useConversationHandlers as K } from "./conversation/useConversationHandlers/useConversationHandlers.js";
27
+ import { applyChunkToMessages as q, mergeStages as J } from "./conversation/useConversationStream/apply-chunk.js";
28
+ import { isAwaitingGenerationResume as Y } from "./conversation/useConversationStream/generation-resume.js";
29
+ import { useConversationStream as X } from "./conversation/useConversationStream/useConversationStream.js";
30
+ import { useChatSettingsFormConfig as Z } from "./useChatSettingsFormConfig/useChatSettingsFormConfig.js";
31
+ import { useToolsMenu as Q } from "./useToolsMenu/useToolsMenu.js";
32
+ export { M as AudioTranscriptionError, N as AudioTranscriptionErrorReason, a as DEFAULT_GENERATION_CONFLICT_MESSAGE, o as GenerationConflictError, q as applyChunkToMessages, F as attachmentToDto, I as attachmentsToDtos, e as buildAnnouncementSignature, s as createChatStreamApi, p as createDeploymentChangedMessage, L as createMessagePair, w as deriveConversationRowActionState, l as formatAppVersion, G as getConversationPath, O as getConversationSource, m as getLastDeploymentId, h as getLastUserMessageToolConfiguration, d as getModelIdFromConversationId, y as getQuickAppConversationStarters, H as getStarterConversationText, U as getStarterDisplayText, S as getStarterPopulateText, W as getStarterSubmitText, C as getStartersFromSchema, f as getTimeOfDayGreeting, R as hasActiveToolConfig, t as hasAnnouncementContent, n as hasStructuredAnnouncement, z as isAnswerIncomplete, Y as isAwaitingGenerationResume, B as isMessageChanged, g as isMessageStreaming, b as mapStages, J as mergeStages, _ as messageHasStages, v as normalizeResponseFormat, r as sanitizeAnnouncementHtml, i as sanitizeAnnouncementMessageHtml, u as sanitizeFooterHtml, V as shouldRerunGenerationOnEdit, c as shouldWatchForDisplayNameUpdate, x as toStage, T as useActiveConversationSync, E as useAsyncConfirmDialog, j as useAttachmentUpload, Z as useChatSettingsFormConfig, K as useConversationHandlers, D as useConversationLookupMaps, k as useConversationPanelItems, X as useConversationStream, A as useImportFilePicker, Q as useToolsMenu, P as useTranscribeAudio };