@epam/ai-dial-chat-hooks 1.3.0-dev.244 → 1.3.0-dev.246

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 (60) hide show
  1. package/conversation/scheduled-task-grouping.d.ts +48 -0
  2. package/conversation/scheduled-task-grouping.d.ts.map +1 -0
  3. package/conversation/scheduled-task-grouping.js +40 -0
  4. package/conversation/useConversationDiscovery/useConversationDiscovery.d.ts +22 -0
  5. package/conversation/useConversationDiscovery/useConversationDiscovery.d.ts.map +1 -0
  6. package/conversation/useConversationDiscovery/useConversationDiscovery.js +60 -0
  7. package/conversation/useConversationPanelItems/useConversationPanelItems.d.ts.map +1 -1
  8. package/conversation/useConversationPanelItems/useConversationPanelItems.js +4 -1
  9. package/conversation/useEntityPreselection/useEntityPreselection.d.ts +108 -0
  10. package/conversation/useEntityPreselection/useEntityPreselection.d.ts.map +1 -0
  11. package/conversation/useEntityPreselection/useEntityPreselection.js +78 -0
  12. package/conversation.js +4 -1
  13. package/entry-points/conversation.d.ts +3 -0
  14. package/entry-points/conversation.d.ts.map +1 -1
  15. package/entry-points/file-manager-canvas.d.ts +1 -0
  16. package/entry-points/file-manager-canvas.d.ts.map +1 -1
  17. package/entry-points/file-manager.d.ts +1 -0
  18. package/entry-points/file-manager.d.ts.map +1 -1
  19. package/entry-points/scheduled-tasks.d.ts +1 -0
  20. package/entry-points/scheduled-tasks.d.ts.map +1 -1
  21. package/entry-points/skill-editor.d.ts +1 -0
  22. package/entry-points/skill-editor.d.ts.map +1 -1
  23. package/entry-points/utils.d.ts +2 -0
  24. package/entry-points/utils.d.ts.map +1 -1
  25. package/entry-points/viewport-layout.d.ts +1 -0
  26. package/entry-points/viewport-layout.d.ts.map +1 -1
  27. package/file-manager-canvas.js +3 -1
  28. package/file-manager.js +3 -2
  29. package/files/browser-download.d.ts +9 -0
  30. package/files/browser-download.d.ts.map +1 -0
  31. package/files/browser-download.js +23 -0
  32. package/files/useDialFilePreview/useDialFilePreview.d.ts +33 -0
  33. package/files/useDialFilePreview/useDialFilePreview.d.ts.map +1 -0
  34. package/files/useDialFilePreview/useDialFilePreview.js +45 -0
  35. package/files/useFileAttachmentModalState/useFileAttachmentModalState.d.ts +25 -0
  36. package/files/useFileAttachmentModalState/useFileAttachmentModalState.d.ts.map +1 -0
  37. package/files/useFileAttachmentModalState/useFileAttachmentModalState.js +19 -0
  38. package/index.d.ts +10 -0
  39. package/index.d.ts.map +1 -1
  40. package/index.js +13 -3
  41. package/mcp-apps/useMcpAppHostContext/useMcpAppHostContext.d.ts +3 -2
  42. package/mcp-apps/useMcpAppHostContext/useMcpAppHostContext.d.ts.map +1 -1
  43. package/package.json +17 -21
  44. package/scheduled-task/scheduled-task-preparation.d.ts +1 -1
  45. package/scheduled-task/useScheduledTaskSkillDisplayNames/useScheduledTaskSkillDisplayNames.d.ts +17 -0
  46. package/scheduled-task/useScheduledTaskSkillDisplayNames/useScheduledTaskSkillDisplayNames.d.ts.map +1 -0
  47. package/scheduled-task/useScheduledTaskSkillDisplayNames/useScheduledTaskSkillDisplayNames.js +29 -0
  48. package/scheduled-tasks.js +2 -1
  49. package/shared/usePersistedState/usePersistedState.d.ts +28 -0
  50. package/shared/usePersistedState/usePersistedState.d.ts.map +1 -0
  51. package/shared/usePersistedState/usePersistedState.js +24 -0
  52. package/skill-editor/useSkillFileSystemPicker/useSkillFileSystemPicker.d.ts +23 -0
  53. package/skill-editor/useSkillFileSystemPicker/useSkillFileSystemPicker.d.ts.map +1 -0
  54. package/skill-editor/useSkillFileSystemPicker/useSkillFileSystemPicker.js +43 -0
  55. package/skill-editor.js +2 -1
  56. package/utils.js +3 -1
  57. package/viewport-layout/canvas-width.d.ts +39 -0
  58. package/viewport-layout/canvas-width.d.ts.map +1 -0
  59. package/viewport-layout/canvas-width.js +23 -0
  60. package/viewport-layout.js +2 -1
@@ -0,0 +1,48 @@
1
+ /** Timestamped conversation used for immutable scheduled-run grouping. */
2
+ export interface ScheduledTaskConversation {
3
+ /** Host conversation identity. */
4
+ id: string;
5
+ /** Creation timestamp; absent values sort last. */
6
+ createdAt?: number;
7
+ /** Last update timestamp. */
8
+ updatedAt: number;
9
+ }
10
+ /** Host policies for grouping scheduled runs. */
11
+ export interface GroupScheduledTaskConversationsOptions<T> {
12
+ /** Owner-qualified task key, or undefined for an ordinary conversation. */
13
+ getGroupKey: (item: T) => string | undefined;
14
+ /** Whether this item may be hidden behind another run. */
15
+ isCollapsible: (item: T) => boolean;
16
+ /** Compares host IDs, including their encoding variants. */
17
+ conversationIdsMatch: (left: string, right: string) => boolean;
18
+ }
19
+ /** Grouping policies and the currently active conversation. */
20
+ export interface CollapseScheduledTaskConversationsOptions<T> extends GroupScheduledTaskConversationsOptions<T> {
21
+ /** Active conversation identity, when present. */
22
+ activeConversationId?: string;
23
+ }
24
+ /** A grouped run and its representative status. */
25
+ export interface ScheduledTaskRun<T> {
26
+ /** Original conversation object. */
27
+ item: T;
28
+ /** Host-provided task key. */
29
+ groupKey: string;
30
+ /** Whether this is the group's newest run. */
31
+ isRepresentative: boolean;
32
+ }
33
+ /** Immutable grouping reusable across active-conversation changes. */
34
+ export interface ScheduledTaskGrouping<T> extends GroupScheduledTaskConversationsOptions<T> {
35
+ /** Collapsed conversations in original order. */
36
+ collapsed: T[];
37
+ /** Eligible runs in original order. */
38
+ runs: ScheduledTaskRun<T>[];
39
+ /** Complete original list. */
40
+ items: readonly T[];
41
+ }
42
+ /** Selects each eligible group's newest run, preserving input order and objects. */
43
+ export declare const groupScheduledTaskConversations: <T extends ScheduledTaskConversation>(items: readonly T[], options: GroupScheduledTaskConversationsOptions<T>) => ScheduledTaskGrouping<T>;
44
+ /** Substitutes an active older run; returns the original collapsed array when unchanged. */
45
+ export declare const applyActiveScheduledTaskRun: <T extends ScheduledTaskConversation>(grouping: ScheduledTaskGrouping<T>, activeConversationId: string | undefined) => T[];
46
+ /** Collapses scheduled runs using host policies and the active conversation. */
47
+ export declare const collapseScheduledTaskConversations: <T extends ScheduledTaskConversation>(items: readonly T[], options: CollapseScheduledTaskConversationsOptions<T>) => T[];
48
+ //# sourceMappingURL=scheduled-task-grouping.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scheduled-task-grouping.d.ts","sourceRoot":"","sources":["../../src/conversation/scheduled-task-grouping.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,MAAM,WAAW,yBAAyB;IACxC,kCAAkC;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,mDAAmD;IACnD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6BAA6B;IAC7B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,iDAAiD;AACjD,MAAM,WAAW,sCAAsC,CAAC,CAAC;IACvD,2EAA2E;IAC3E,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,GAAG,SAAS,CAAC;IAC7C,0DAA0D;IAC1D,aAAa,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC;IACpC,4DAA4D;IAC5D,oBAAoB,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;CAChE;AAED,+DAA+D;AAC/D,MAAM,WAAW,yCAAyC,CACxD,CAAC,CACD,SAAQ,sCAAsC,CAAC,CAAC,CAAC;IACjD,kDAAkD;IAClD,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,mDAAmD;AACnD,MAAM,WAAW,gBAAgB,CAAC,CAAC;IACjC,oCAAoC;IACpC,IAAI,EAAE,CAAC,CAAC;IACR,8BAA8B;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,8CAA8C;IAC9C,gBAAgB,EAAE,OAAO,CAAC;CAC3B;AAED,sEAAsE;AACtE,MAAM,WAAW,qBAAqB,CACpC,CAAC,CACD,SAAQ,sCAAsC,CAAC,CAAC,CAAC;IACjD,iDAAiD;IACjD,SAAS,EAAE,CAAC,EAAE,CAAC;IACf,uCAAuC;IACvC,IAAI,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC;IAC5B,8BAA8B;IAC9B,KAAK,EAAE,SAAS,CAAC,EAAE,CAAC;CACrB;AA0BD,oFAAoF;AACpF,eAAO,MAAM,+BAA+B,GAC1C,CAAC,SAAS,yBAAyB,EAEnC,OAAO,SAAS,CAAC,EAAE,EACnB,SAAS,sCAAsC,CAAC,CAAC,CAAC,KACjD,qBAAqB,CAAC,CAAC,CAqBzB,CAAC;AAEF,4FAA4F;AAC5F,eAAO,MAAM,2BAA2B,GACtC,CAAC,SAAS,yBAAyB,EAEnC,UAAU,qBAAqB,CAAC,CAAC,CAAC,EAClC,sBAAsB,MAAM,GAAG,SAAS,KACvC,CAAC,EAYH,CAAC;AAEF,gFAAgF;AAChF,eAAO,MAAM,kCAAkC,GAC7C,CAAC,SAAS,yBAAyB,EAEnC,OAAO,SAAS,CAAC,EAAE,EACnB,SAAS,yCAAyC,CAAC,CAAC,CAAC,KACpD,CAAC,EAID,CAAC"}
@@ -0,0 +1,40 @@
1
+ //#region src/conversation/scheduled-task-grouping.ts
2
+ var e = (e, t) => {
3
+ let n = e.createdAt ?? -Infinity, r = t.createdAt ?? -Infinity;
4
+ return n === r ? e.updatedAt === t.updatedAt ? e.id === t.id ? 0 : t.id > e.id ? 1 : -1 : t.updatedAt - e.updatedAt : r > n ? 1 : -1;
5
+ }, t = (e, t, n) => e.filter((e) => {
6
+ if (!n.isCollapsible(e)) return !0;
7
+ let r = n.getGroupKey(e);
8
+ return r === void 0 || t.get(r) === e;
9
+ }), n = (n, r) => {
10
+ let i = /* @__PURE__ */ new Map(), a = [];
11
+ for (let t of n) {
12
+ if (!r.isCollapsible(t)) continue;
13
+ let n = r.getGroupKey(t);
14
+ if (n === void 0) continue;
15
+ a.push({
16
+ item: t,
17
+ groupKey: n
18
+ });
19
+ let o = i.get(n);
20
+ (!o || e(t, o) < 0) && i.set(n, t);
21
+ }
22
+ return {
23
+ ...r,
24
+ items: n,
25
+ collapsed: t(n, i, r),
26
+ runs: a.map((e) => ({
27
+ ...e,
28
+ isRepresentative: i.get(e.groupKey) === e.item
29
+ }))
30
+ };
31
+ }, r = (e, n) => {
32
+ if (n === void 0) return e.collapsed;
33
+ let r = e.runs.find(({ item: t }) => e.conversationIdsMatch(t.id, n));
34
+ if (!r || r.isRepresentative) return e.collapsed;
35
+ let i = /* @__PURE__ */ new Map();
36
+ for (let t of e.runs) t.isRepresentative && i.set(t.groupKey, t.item);
37
+ return i.set(r.groupKey, r.item), t(e.items, i, e);
38
+ }, i = (e, t) => r(n(e, t), t.activeConversationId);
39
+ //#endregion
40
+ export { r as applyActiveScheduledTaskRun, i as collapseScheduledTaskConversations, n as groupScheduledTaskConversations };
@@ -0,0 +1,22 @@
1
+ /** Inputs for a session-scoped discovery retry loop. */
2
+ export interface UseConversationDiscoveryOptions {
3
+ /** Current complete listing. */
4
+ items: readonly {
5
+ id: string;
6
+ }[];
7
+ /** Refreshes the listing. Initial failures propagate to the caller. */
8
+ refresh: () => Promise<void>;
9
+ /** Opaque identity; changing it retires all previous work. */
10
+ sessionKey: unknown;
11
+ /** Converts host IDs to a comparable identity. */
12
+ normalizeId: (id: string) => string;
13
+ /** Receives retry failures for the current session. */
14
+ onError?: (error: unknown) => void;
15
+ /** Additional retries per missing ID. Defaults to five. */
16
+ retryCount?: number;
17
+ /** Delay after settlement, in milliseconds. Defaults to 2000. */
18
+ retryDelayMs?: number;
19
+ }
20
+ /** Refreshes expected conversations using one bounded retry loop per session. */
21
+ export declare const useConversationDiscovery: ({ items: conversations, refresh, sessionKey, normalizeId, onError, retryCount, retryDelayMs, }: UseConversationDiscoveryOptions) => ((expectedIds?: readonly string[]) => Promise<void>);
22
+ //# sourceMappingURL=useConversationDiscovery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useConversationDiscovery.d.ts","sourceRoot":"","sources":["../../../src/conversation/useConversationDiscovery/useConversationDiscovery.ts"],"names":[],"mappings":"AAYA,wDAAwD;AACxD,MAAM,WAAW,+BAA+B;IAC9C,gCAAgC;IAChC,KAAK,EAAE,SAAS;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACjC,uEAAuE;IACvE,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B,8DAA8D;IAC9D,UAAU,EAAE,OAAO,CAAC;IACpB,kDAAkD;IAClD,WAAW,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,CAAC;IACpC,uDAAuD;IACvD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACnC,2DAA2D;IAC3D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iEAAiE;IACjE,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AACD,iFAAiF;AACjF,eAAO,MAAM,wBAAwB,GAAI,gGAQtC,+BAA+B,KAAG,CAAC,CACpC,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,KAC5B,OAAO,CAAC,IAAI,CAAC,CAkFjB,CAAC"}
@@ -0,0 +1,60 @@
1
+ import { useCallback as e, useLayoutEffect as t, useRef as n } from "react";
2
+ //#region src/conversation/useConversationDiscovery/useConversationDiscovery.ts
3
+ var r = 2e3, i = 5, a = ({ items: a, refresh: o, sessionKey: s, normalizeId: c, onError: l, retryCount: u = i, retryDelayMs: d = r }) => {
4
+ let f = n(null), p = n(/* @__PURE__ */ new Set());
5
+ t(() => {
6
+ let e = {
7
+ pending: /* @__PURE__ */ new Map(),
8
+ inFlight: !1,
9
+ retired: !1
10
+ };
11
+ return f.current = e, () => {
12
+ e.retired = !0, clearTimeout(e.timer);
13
+ };
14
+ }, [s]), t(() => {
15
+ p.current = new Set(a.map(({ id: e }) => c(e)));
16
+ }, [a, c]);
17
+ let m = e((e) => {
18
+ let t = () => {
19
+ for (let [t, n] of e.pending) (p.current.has(t) || n === 0) && e.pending.delete(t);
20
+ }, n = () => {
21
+ t(), !(e.retired || e.timer || e.inFlight || e.pending.size === 0) && (e.timer = setTimeout(() => {
22
+ e.timer = void 0, r();
23
+ }, d));
24
+ }, r = async () => {
25
+ if (t(), !(e.retired || e.pending.size === 0)) {
26
+ for (let [t, n] of e.pending) e.pending.set(t, n - 1);
27
+ e.inFlight = !0;
28
+ try {
29
+ await o();
30
+ } catch (t) {
31
+ e.retired || l?.(t);
32
+ } finally {
33
+ e.inFlight = !1, n();
34
+ }
35
+ }
36
+ };
37
+ n();
38
+ }, [
39
+ o,
40
+ l,
41
+ d
42
+ ]);
43
+ return e(async (e = []) => {
44
+ let t = f.current;
45
+ if (t && !t.retired) {
46
+ for (let n of e) {
47
+ let e = c(n);
48
+ !p.current.has(e) && !t.pending.has(e) && t.pending.set(e, u);
49
+ }
50
+ await o(), m(t);
51
+ }
52
+ }, [
53
+ o,
54
+ m,
55
+ c,
56
+ u
57
+ ]);
58
+ };
59
+ //#endregion
60
+ export { a as useConversationDiscovery };
@@ -1 +1 @@
1
- {"version":3,"file":"useConversationPanelItems.d.ts","sourceRoot":"","sources":["../../../src/conversation/useConversationPanelItems/useConversationPanelItems.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,iBAAiB,EAClB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,EAA8B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAOnE;;GAEG;AACH,eAAO,MAAM,qBAAqB,GAChC,MAAM,IAAI,CAAC,uBAAuB,EAAE,cAAc,GAAG,iBAAiB,CAAC,KACtE,SAIF,CAAC;AAEF,oFAAoF;AACpF,MAAM,WAAW,kCAAkC;IACjD,0EAA0E;IAC1E,qBAAqB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,CAAC;IAC9C,sFAAsF;IACtF,cAAc,EAAE,CACd,UAAU,EAAE,iBAAiB,GAAG,SAAS,KACtC,MAAM,GAAG,SAAS,CAAC;IACxB;;;OAGG;IACH,kBAAkB,EAAE,CAClB,UAAU,EAAE,iBAAiB,GAAG,SAAS,EACzC,QAAQ,EAAE,MAAM,KACb,MAAM,GAAG,SAAS,CAAC;IACxB,6EAA6E;IAC7E,WAAW,EAAE,CAAC,mBAAmB,EAAE,MAAM,KAAK,MAAM,CAAC;IACrD;;;;OAIG;IACH,uBAAuB,CAAC,EAAE,CACxB,IAAI,EAAE,uBAAuB,KAC1B;QAAE,WAAW,CAAC,EAAE,SAAS,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,GAAG,SAAS,CAAC;CACjE;AAED,0DAA0D;AAC1D,MAAM,WAAW,+BAAgC,SAAQ,kCAAkC;IACzF,0CAA0C;IAC1C,KAAK,EAAE,uBAAuB,EAAE,CAAC;IACjC,gEAAgE;IAChE,WAAW,EAAE,iBAAiB,EAAE,CAAC;IACjC,8EAA8E;IAC9E,oBAAoB,EAAE,OAAO,CAAC;CAC/B;AA+BD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,yBAAyB,GAAI,gJASvC,+BAA+B;;;;;;;;;;;;GAiFjC,CAAC"}
1
+ {"version":3,"file":"useConversationPanelItems.d.ts","sourceRoot":"","sources":["../../../src/conversation/useConversationPanelItems/useConversationPanelItems.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,iBAAiB,EAClB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,EAA8B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAOnE;;GAEG;AACH,eAAO,MAAM,qBAAqB,GAChC,MAAM,IAAI,CAAC,uBAAuB,EAAE,cAAc,GAAG,iBAAiB,CAAC,KACtE,SAIF,CAAC;AAEF,oFAAoF;AACpF,MAAM,WAAW,kCAAkC;IACjD,0EAA0E;IAC1E,qBAAqB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,CAAC;IAC9C,sFAAsF;IACtF,cAAc,EAAE,CACd,UAAU,EAAE,iBAAiB,GAAG,SAAS,KACtC,MAAM,GAAG,SAAS,CAAC;IACxB;;;OAGG;IACH,kBAAkB,EAAE,CAClB,UAAU,EAAE,iBAAiB,GAAG,SAAS,EACzC,QAAQ,EAAE,MAAM,KACb,MAAM,GAAG,SAAS,CAAC;IACxB,6EAA6E;IAC7E,WAAW,EAAE,CAAC,mBAAmB,EAAE,MAAM,KAAK,MAAM,CAAC;IACrD;;;;OAIG;IACH,uBAAuB,CAAC,EAAE,CACxB,IAAI,EAAE,uBAAuB,KAC1B;QAAE,WAAW,CAAC,EAAE,SAAS,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,GAAG,SAAS,CAAC;CACjE;AAED,0DAA0D;AAC1D,MAAM,WAAW,+BAAgC,SAAQ,kCAAkC;IACzF,0CAA0C;IAC1C,KAAK,EAAE,uBAAuB,EAAE,CAAC;IACjC,gEAAgE;IAChE,WAAW,EAAE,iBAAiB,EAAE,CAAC;IACjC,8EAA8E;IAC9E,oBAAoB,EAAE,OAAO,CAAC;CAC/B;AA+BD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,yBAAyB,GAAI,gJASvC,+BAA+B;;;;;;;;;;;;GAmFjC,CAAC"}
@@ -20,7 +20,10 @@ var c = (e) => e.sharedWithMe ? i.Shared : e.publishedWithMe ? i.Organization :
20
20
  source: c(i),
21
21
  kind: u == null ? r.Chat : r.Task,
22
22
  href: h(a),
23
- ...u == null ? {} : {
23
+ ...u == null ? i.isUnread ? {
24
+ leadingIcon: void 0,
25
+ isUnread: !0
26
+ } : {} : {
24
27
  leadingIcon: u.leadingIcon,
25
28
  isUnread: u.isUnread
26
29
  }
@@ -0,0 +1,108 @@
1
+ /** Sources whose arrival values may be consumed. */
2
+ export declare enum EntityPreselectionSource {
3
+ Deployment = "deployment",
4
+ Skill = "skill",
5
+ Prompt = "prompt"
6
+ }
7
+ /** Failure outcomes interpreted by the host. */
8
+ export declare enum EntityPreselectionOutcome {
9
+ DeploymentUnavailable = "deployment-unavailable",
10
+ DeploymentsLoadFailed = "deployments-load-failed",
11
+ SkillUnavailable = "skill-unavailable",
12
+ SkillsLoadFailed = "skills-load-failed",
13
+ PromptUnavailable = "prompt-unavailable"
14
+ }
15
+ /** Parsed arrival values; the controller captures these once per mount. */
16
+ export interface EntityPreselectionSnapshot {
17
+ /** Requested deployment identity. */
18
+ deploymentId: string | null;
19
+ /** Requested skill reference. */
20
+ skillId: string | null;
21
+ /** Requested prompt identity. */
22
+ promptId: string | null;
23
+ /** Sources already provided by the host, which take precedence. */
24
+ superseded: readonly EntityPreselectionSource[];
25
+ /** Disables all application, consumption and outcome side effects. */
26
+ isDisabled: boolean;
27
+ }
28
+ /** Structural prompt passed to the host's composer or parameter popup. */
29
+ export interface EntityPreselectionPrompt {
30
+ /** Canonical identity. */
31
+ id: string;
32
+ /** Display name. */
33
+ name: string;
34
+ /** Optional description. */
35
+ description?: string;
36
+ /** Prompt content. */
37
+ content: string;
38
+ }
39
+ /** A resolved skill mention. */
40
+ export interface EntityPreselectionSkill {
41
+ /** Canonical reference. */
42
+ url: string;
43
+ /** Resolved display name. */
44
+ name: string;
45
+ }
46
+ /** Loaded prompt and parameter policy. */
47
+ export interface EntityPreselectionPromptResult {
48
+ /** Resolved prompt. */
49
+ prompt: EntityPreselectionPrompt;
50
+ /** Whether the host must ask for parameter values. */
51
+ hasParameters: boolean;
52
+ }
53
+ /** Host actions for applying resolved entities. */
54
+ export interface EntityPreselectionSinks {
55
+ /** Selects a deployment without persisting a preference. */
56
+ restoreSelectedItemId: (id: string) => void;
57
+ /** Inserts a skill mention. */
58
+ selectSkillByUrl: (url: string) => void;
59
+ /** Seeds combined prompt text and skill references. */
60
+ seedSkillMentions: (content: string, entries: {
61
+ url: string;
62
+ }[] | undefined) => void;
63
+ /** Seeds plain prompt text. */
64
+ seedComposerText: (text: string) => void;
65
+ /** Opens a parameterized prompt. */
66
+ openParametersPopup: (prompt: EntityPreselectionPrompt) => void;
67
+ }
68
+ /** Host listings, loaders and side-effect adapters. */
69
+ export interface UseEntityPreselectionOptions {
70
+ /** Parsed arrival snapshot. */
71
+ snapshot: EntityPreselectionSnapshot;
72
+ /** Whether the deployment listing is pending. */
73
+ isDeploymentsLoading: boolean;
74
+ /** Whether deployment loading failed. */
75
+ deploymentsError: unknown;
76
+ /** Looks up an eligible deployment in the current listing. */
77
+ resolveDeployment: (id: string) => {
78
+ id: string;
79
+ } | undefined;
80
+ /** Whether skill listing is pending. */
81
+ isSkillsLoading: boolean;
82
+ /** Whether skill loading failed. */
83
+ skillsError: unknown;
84
+ /** Whether skills are available in this host. */
85
+ isSkillsEnabled: boolean;
86
+ /** Looks up a valid skill in current listings. */
87
+ resolveSkill: (id: string) => EntityPreselectionSkill | undefined;
88
+ /** Whether prompts are available in this host. */
89
+ isPromptsEnabled: boolean;
90
+ /** Loads and adapts a prompt; undefined means unavailable. */
91
+ loadPrompt: (id: string, signal: AbortSignal) => Promise<EntityPreselectionPromptResult | undefined>;
92
+ /** Application sinks, read from the latest committed render. */
93
+ sinks: EntityPreselectionSinks;
94
+ /** Consumes supplied arrival sources, leaving URL/router policy to the host. */
95
+ onConsume: (sources: EntityPreselectionSource[]) => void;
96
+ /** Reports a typed failure, optional host error and original identity. */
97
+ onOutcome: (outcome: EntityPreselectionOutcome, id: string, error?: unknown) => void;
98
+ }
99
+ /** Deployment override flags for default-selection coordination. */
100
+ export interface UseEntityPreselectionResult {
101
+ /** Pending or successfully applied deployment override. */
102
+ isDeploymentOverrideActive: boolean;
103
+ /** Deployment resolution has not settled yet. */
104
+ isDeploymentPending: boolean;
105
+ }
106
+ /** Applies arrival entities once, preserving source precedence and ignoring retired work. */
107
+ export declare const useEntityPreselection: (options: UseEntityPreselectionOptions) => UseEntityPreselectionResult;
108
+ //# sourceMappingURL=useEntityPreselection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useEntityPreselection.d.ts","sourceRoot":"","sources":["../../../src/conversation/useEntityPreselection/useEntityPreselection.ts"],"names":[],"mappings":"AAEA,oDAAoD;AACpD,oBAAY,wBAAwB;IAClC,UAAU,eAAe;IACzB,KAAK,UAAU;IACf,MAAM,WAAW;CAClB;AACD,gDAAgD;AAChD,oBAAY,yBAAyB;IACnC,qBAAqB,2BAA2B;IAChD,qBAAqB,4BAA4B;IACjD,gBAAgB,sBAAsB;IACtC,gBAAgB,uBAAuB;IACvC,iBAAiB,uBAAuB;CACzC;AACD,2EAA2E;AAC3E,MAAM,WAAW,0BAA0B;IACzC,qCAAqC;IACrC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,iCAAiC;IACjC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,iCAAiC;IACjC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,mEAAmE;IACnE,UAAU,EAAE,SAAS,wBAAwB,EAAE,CAAC;IAChD,sEAAsE;IACtE,UAAU,EAAE,OAAO,CAAC;CACrB;AACD,0EAA0E;AAC1E,MAAM,WAAW,wBAAwB;IACvC,0BAA0B;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,oBAAoB;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,4BAA4B;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sBAAsB;IACtB,OAAO,EAAE,MAAM,CAAC;CACjB;AACD,gCAAgC;AAChC,MAAM,WAAW,uBAAuB;IACtC,2BAA2B;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,6BAA6B;IAC7B,IAAI,EAAE,MAAM,CAAC;CACd;AACD,0CAA0C;AAC1C,MAAM,WAAW,8BAA8B;IAC7C,uBAAuB;IACvB,MAAM,EAAE,wBAAwB,CAAC;IACjC,sDAAsD;IACtD,aAAa,EAAE,OAAO,CAAC;CACxB;AACD,mDAAmD;AACnD,MAAM,WAAW,uBAAuB;IACtC,4DAA4D;IAC5D,qBAAqB,EAAE,CAAC,EAAE,EA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,EAAE,KAAK,IAAI,CAAC;IACzD,0EAA0E;IAC1E,SAAS,EAAE,CACT,OAAO,EAAE,yBAAyB,EAClC,EAAE,EAAE,MAAM,EACV,KAAK,CAAC,EAAE,OAAO,KACZ,IAAI,CAAC;CACX;AACD,oEAAoE;AACpE,MAAM,WAAW,2BAA2B;IAC1C,2DAA2D;IAC3D,0BAA0B,EAAE,OAAO,CAAC;IACpC,iDAAiD;IACjD,mBAAmB,EAAE,OAAO,CAAC;CAC9B;AAQD,6FAA6F;AAC7F,eAAO,MAAM,qBAAqB,GAChC,SAAS,4BAA4B,KACpC,2BAsLF,CAAC"}
@@ -0,0 +1,78 @@
1
+ import { useEffect as e, useRef as t, useState as n } from "react";
2
+ //#region src/conversation/useEntityPreselection/useEntityPreselection.ts
3
+ var r = /* @__PURE__ */ function(e) {
4
+ return e.Deployment = "deployment", e.Skill = "skill", e.Prompt = "prompt", e;
5
+ }({}), i = /* @__PURE__ */ function(e) {
6
+ return e.DeploymentUnavailable = "deployment-unavailable", e.DeploymentsLoadFailed = "deployments-load-failed", e.SkillUnavailable = "skill-unavailable", e.SkillsLoadFailed = "skills-load-failed", e.PromptUnavailable = "prompt-unavailable", e;
7
+ }({}), a = (r) => {
8
+ let [i] = n(r.snapshot), a = (e, t) => !i.isDisabled && t !== null && !i.superseded.includes(e), [o, s] = n(() => a("deployment", i.deploymentId) ? "pending" : "idle"), [c, l] = n(() => ({ status: a("skill", i.skillId) ? "pending" : "idle" })), [u, d] = n(() => ({ status: a("prompt", i.promptId) ? "pending" : "idle" })), f = t(r);
9
+ e(() => {
10
+ f.current = r;
11
+ });
12
+ let p = t(!1), m = t(!1), h = t(!1), g = t(!1), _ = t(!1);
13
+ return e(() => {
14
+ if (i.isDisabled || p.current) return;
15
+ p.current = !0;
16
+ let e = {
17
+ deployment: i.deploymentId,
18
+ skill: i.skillId,
19
+ prompt: i.promptId
20
+ };
21
+ f.current.onConsume(i.superseded.filter((t) => !!e[t]));
22
+ }, [i]), e(() => {
23
+ if (o !== "pending" || r.isDeploymentsLoading || m.current) return;
24
+ m.current = !0;
25
+ let e = i.deploymentId ?? "", t = f.current, n = t.resolveDeployment(e);
26
+ n ? (t.sinks.restoreSelectedItemId(n.id), s("resolved")) : (t.onOutcome(t.deploymentsError == null ? "deployment-unavailable" : "deployments-load-failed", e), s("failed")), t.onConsume(["deployment"]);
27
+ }, [
28
+ o,
29
+ r.isDeploymentsLoading,
30
+ r.deploymentsError,
31
+ r.resolveDeployment,
32
+ i.deploymentId
33
+ ]), e(() => {
34
+ if (c.status !== "pending" || r.isSkillsLoading || h.current) return;
35
+ h.current = !0;
36
+ let e = i.skillId ?? "", t = f.current, n = t.isSkillsEnabled ? t.resolveSkill(e) : void 0;
37
+ n ? l({
38
+ status: "resolved",
39
+ value: n
40
+ }) : (t.onOutcome(t.isSkillsEnabled && t.skillsError != null ? "skills-load-failed" : "skill-unavailable", e), l({ status: "failed" }), t.onConsume(["skill"]));
41
+ }, [
42
+ c.status,
43
+ r.isSkillsLoading,
44
+ r.skillsError,
45
+ r.isSkillsEnabled,
46
+ r.resolveSkill,
47
+ i.skillId
48
+ ]), e(() => {
49
+ if (u.status !== "pending" || g.current) return;
50
+ let e = new AbortController(), t = i.promptId ?? "";
51
+ return (async () => {
52
+ let n, i;
53
+ try {
54
+ n = r.isPromptsEnabled ? await f.current.loadPrompt(t, e.signal) : void 0;
55
+ } catch (e) {
56
+ i = e;
57
+ }
58
+ e.signal.aborted || (g.current = !0, n ? d({
59
+ status: "resolved",
60
+ value: n
61
+ }) : (f.current.onOutcome("prompt-unavailable", t, i), d({ status: "failed" }), f.current.onConsume(["prompt"])));
62
+ })(), () => e.abort();
63
+ }, [
64
+ u.status,
65
+ r.isPromptsEnabled,
66
+ i.promptId
67
+ ]), e(() => {
68
+ if (_.current || c.status === "pending" || u.status === "pending" || !c.value && !u.value) return;
69
+ _.current = !0;
70
+ let { sinks: e, onConsume: t } = f.current, n = u.value?.prompt, r = [];
71
+ c.value && n ? (u.value?.hasParameters ? (e.selectSkillByUrl(c.value.url), e.openParametersPopup(n)) : e.seedSkillMentions(`/${c.value.name} ${n.content}`, [{ url: c.value.url }]), r.push("skill", "prompt")) : c.value ? (e.selectSkillByUrl(c.value.url), r.push("skill")) : n && (u.value?.hasParameters ? e.openParametersPopup(n) : e.seedComposerText(n.content), r.push("prompt")), t(r);
72
+ }, [c, u]), {
73
+ isDeploymentOverrideActive: o === "pending" || o === "resolved",
74
+ isDeploymentPending: o === "pending"
75
+ };
76
+ };
77
+ //#endregion
78
+ export { i as EntityPreselectionOutcome, r as EntityPreselectionSource, a as useEntityPreselection };
package/conversation.js CHANGED
@@ -32,4 +32,7 @@ import { isAwaitingGenerationResume as ue } from "./conversation/useConversation
32
32
  import { useConversationStream as de } from "./conversation/useConversationStream/useConversationStream.js";
33
33
  import { useChatSettingsFormConfig as fe } from "./useChatSettingsFormConfig/useChatSettingsFormConfig.js";
34
34
  import { useToolsMenu as pe } from "./useToolsMenu/useToolsMenu.js";
35
- export { q as AudioTranscriptionError, J as AudioTranscriptionErrorReason, s as DEFAULT_GENERATION_CONFLICT_MESSAGE, c as DEFAULT_GENERATION_PERSISTENCE_ERROR_MESSAGE, l as DEFAULT_STREAM_IDLE_TIMEOUT_MS, u as GenerationConflictError, d as GenerationPersistenceError, f as StopCompletionError, p as StreamInterruptedError, m as StreamUpstreamError, ce as applyChunkToMessages, X as attachmentToDto, Z as attachmentsToDtos, e as buildAnnouncementSignature, h as createChatStreamApi, C as createDeploymentChangedMessage, a as createMemoryConversationDraftStore, Q as createMessagePair, o as createWebStorageConversationDraftStore, L as deriveConversationRowActionState, y as findDeploymentForConversationId, _ as formatAppVersion, oe as getConversationPath, H as getConversationSource, w as getFormSchemaToolSyncKey, T as getLastDeploymentId, E as getLastUserMessageToolConfiguration, D as getLatestToolConfiguration, b as getModelIdCandidatesFromConversationId, x as getModelIdFromConversationId, M as getQuickAppConversationStarters, re as getStarterConversationText, ie as getStarterDisplayText, F as getStarterPopulateText, ae as getStarterSubmitText, I as getStartersFromSchema, S as getTimeOfDayGreeting, O as getToolConfigurationFromFormSchema, $ as hasActiveToolConfig, t as hasAnnouncementContent, n as hasStructuredAnnouncement, ee as isAnswerIncomplete, ue as isAwaitingGenerationResume, te as isMessageChanged, k as isMessageStreaming, N as mapStages, le as mergeStages, A as messageHasStages, j as normalizeResponseFormat, r as sanitizeAnnouncementHtml, i as sanitizeAnnouncementMessageHtml, v as sanitizeFooterHtml, ne as shouldRerunGenerationOnEdit, g as shouldWatchForDisplayNameUpdate, P as toStage, R as useActiveConversationSync, z as useAsyncConfirmDialog, K as useAttachmentUpload, fe as useChatSettingsFormConfig, B as useConversationComposerDraft, se as useConversationHandlers, V as useConversationLookupMaps, U as useConversationPanelItems, de as useConversationStream, W as useImportFilePicker, G as useMessageSelectionReply, pe as useToolsMenu, Y as useTranscribeAudio };
35
+ import { applyActiveScheduledTaskRun as me, collapseScheduledTaskConversations as he, groupScheduledTaskConversations as ge } from "./conversation/scheduled-task-grouping.js";
36
+ import { useConversationDiscovery as _e } from "./conversation/useConversationDiscovery/useConversationDiscovery.js";
37
+ import { EntityPreselectionOutcome as ve, EntityPreselectionSource as ye, useEntityPreselection as be } from "./conversation/useEntityPreselection/useEntityPreselection.js";
38
+ export { q as AudioTranscriptionError, J as AudioTranscriptionErrorReason, s as DEFAULT_GENERATION_CONFLICT_MESSAGE, c as DEFAULT_GENERATION_PERSISTENCE_ERROR_MESSAGE, l as DEFAULT_STREAM_IDLE_TIMEOUT_MS, ve as EntityPreselectionOutcome, ye as EntityPreselectionSource, u as GenerationConflictError, d as GenerationPersistenceError, f as StopCompletionError, p as StreamInterruptedError, m as StreamUpstreamError, me as applyActiveScheduledTaskRun, ce as applyChunkToMessages, X as attachmentToDto, Z as attachmentsToDtos, e as buildAnnouncementSignature, he as collapseScheduledTaskConversations, h as createChatStreamApi, C as createDeploymentChangedMessage, a as createMemoryConversationDraftStore, Q as createMessagePair, o as createWebStorageConversationDraftStore, L as deriveConversationRowActionState, y as findDeploymentForConversationId, _ as formatAppVersion, oe as getConversationPath, H as getConversationSource, w as getFormSchemaToolSyncKey, T as getLastDeploymentId, E as getLastUserMessageToolConfiguration, D as getLatestToolConfiguration, b as getModelIdCandidatesFromConversationId, x as getModelIdFromConversationId, M as getQuickAppConversationStarters, re as getStarterConversationText, ie as getStarterDisplayText, F as getStarterPopulateText, ae as getStarterSubmitText, I as getStartersFromSchema, S as getTimeOfDayGreeting, O as getToolConfigurationFromFormSchema, ge as groupScheduledTaskConversations, $ as hasActiveToolConfig, t as hasAnnouncementContent, n as hasStructuredAnnouncement, ee as isAnswerIncomplete, ue as isAwaitingGenerationResume, te as isMessageChanged, k as isMessageStreaming, N as mapStages, le as mergeStages, A as messageHasStages, j as normalizeResponseFormat, r as sanitizeAnnouncementHtml, i as sanitizeAnnouncementMessageHtml, v as sanitizeFooterHtml, ne as shouldRerunGenerationOnEdit, g as shouldWatchForDisplayNameUpdate, P as toStage, R as useActiveConversationSync, z as useAsyncConfirmDialog, K as useAttachmentUpload, fe as useChatSettingsFormConfig, B as useConversationComposerDraft, _e as useConversationDiscovery, se as useConversationHandlers, V as useConversationLookupMaps, U as useConversationPanelItems, de as useConversationStream, be as useEntityPreselection, W as useImportFilePicker, G as useMessageSelectionReply, pe as useToolsMenu, Y as useTranscribeAudio };
@@ -33,4 +33,7 @@ export { isAwaitingGenerationResume } from '../conversation/useConversationStrea
33
33
  export * from '../conversation/useConversationStream/useConversationStream';
34
34
  export * from '../useChatSettingsFormConfig/useChatSettingsFormConfig';
35
35
  export * from '../useToolsMenu/useToolsMenu';
36
+ export * from '../conversation/scheduled-task-grouping';
37
+ export * from '../conversation/useConversationDiscovery/useConversationDiscovery';
38
+ export * from '../conversation/useEntityPreselection/useEntityPreselection';
36
39
  //# sourceMappingURL=conversation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../src/entry-points/conversation.ts"],"names":[],"mappings":"AAAA,cAAc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{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../src/entry-points/conversation.ts"],"names":[],"mappings":"AAAA,cAAc,sCAAsC,CAAC;AACrD,cAAc,uDAAuD,CAAC;AACtE,cAAc,6DAA6D,CAAC;AAC5E,cAAc,wCAAwC,CAAC;AACvD,cAAc,oCAAoC,CAAC;AACnD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mDAAmD,CAAC;AAClE,cAAc,0BAA0B,CAAC;AACzC,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,mEAAmE,CAAC;AAClF,cAAc,iDAAiD,CAAC;AAChE,cAAc,uBAAuB,CAAC;AACtC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mFAAmF,CAAC;AAClG,cAAc,qEAAqE,CAAC;AACpF,cAAc,6DAA6D,CAAC;AAC5E,cAAc,2EAA2E,CAAC;AAC1F,cAAc,qEAAqE,CAAC;AACpF,cAAc,qEAAqE,CAAC;AACpF,cAAc,yDAAyD,CAAC;AACxE,cAAc,yDAAyD,CAAC;AACxE,cAAc,8DAA8D,CAAC;AAC7E,cAAc,uDAAuD,CAAC;AACtE,OAAO,EACL,iBAAiB,EACjB,eAAe,GAChB,MAAM,2DAA2D,CAAC;AACnE,OAAO,EACL,iBAAiB,EACjB,KAAK,WAAW,GACjB,MAAM,yDAAyD,CAAC;AACjE,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,2BAA2B,GAC5B,MAAM,uDAAuD,CAAC;AAC/D,OAAO,EACL,0BAA0B,EAC1B,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,wDAAwD,CAAC;AAChE,cAAc,iEAAiE,CAAC;AAChF,OAAO,EACL,oBAAoB,EACpB,WAAW,GACZ,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yDAAyD,CAAC;AAC9F,OAAO,EAAE,0BAA0B,EAAE,MAAM,yDAAyD,CAAC;AACrG,cAAc,6DAA6D,CAAC;AAC5E,cAAc,wDAAwD,CAAC;AACvE,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yCAAyC,CAAC;AACxD,cAAc,mEAAmE,CAAC;AAClF,cAAc,6DAA6D,CAAC"}
@@ -1,2 +1,3 @@
1
1
  export * from '../files/attachment-canvas';
2
+ export * from '../files/useDialFilePreview/useDialFilePreview';
2
3
  //# sourceMappingURL=file-manager-canvas.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"file-manager-canvas.d.ts","sourceRoot":"","sources":["../../src/entry-points/file-manager-canvas.ts"],"names":[],"mappings":"AAQA,cAAc,4BAA4B,CAAC"}
1
+ {"version":3,"file":"file-manager-canvas.d.ts","sourceRoot":"","sources":["../../src/entry-points/file-manager-canvas.ts"],"names":[],"mappings":"AAQA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gDAAgD,CAAC"}
@@ -28,4 +28,5 @@ export * from '../files/useDialFileUploadBatch/useDialFileUploadBatch';
28
28
  export * from '../files/useFileAttachmentPicker/useFileAttachmentPicker';
29
29
  export type { UseGridEditingScrollOptions, UseGridEditingScrollResult, } from '@epam/ai-dial-chat-shared';
30
30
  export { useGridEditingScroll } from '@epam/ai-dial-chat-shared';
31
+ export * from '../files/useFileAttachmentModalState/useFileAttachmentModalState';
31
32
  //# sourceMappingURL=file-manager.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"file-manager.d.ts","sourceRoot":"","sources":["../../src/entry-points/file-manager.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AACjD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,yCAAyC,CAAC;AACxD,cAAc,sCAAsC,CAAC;AACrD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2CAA2C,CAAC;AAC1D,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;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BAAsB,EACtB,uBAAuB,GACxB,MAAM,oBAAoB,CAAC;AAC5B,cAAc,gDAAgD,CAAC;AAC/D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,gEAAgE,CAAC;AAC/E,cAAc,kEAAkE,CAAC;AACjF,cAAc,kDAAkD,CAAC;AACjE,cAAc,oDAAoD,CAAC;AACnE,cAAc,gDAAgD,CAAC;AAC/D,cAAc,wDAAwD,CAAC;AACvE,cAAc,0DAA0D,CAAC;AACzE,YAAY,EACV,2BAA2B,EAC3B,0BAA0B,GAC3B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,cAAc,kEAAkE,CAAC"}
@@ -6,4 +6,5 @@ export * from '../scheduled-task/scheduled-task-trigger';
6
6
  export * from '../scheduled-task/check-scheduled-task-auth-session-error';
7
7
  export * from '../scheduled-task/use-scheduled-tasks';
8
8
  export * from '../scheduled-task/use-scheduled-task-runs';
9
+ export * from '../scheduled-task/useScheduledTaskSkillDisplayNames/useScheduledTaskSkillDisplayNames';
9
10
  //# sourceMappingURL=scheduled-tasks.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"scheduled-tasks.d.ts","sourceRoot":"","sources":["../../src/entry-points/scheduled-tasks.ts"],"names":[],"mappings":"AAAA,cAAc,0CAA0C,CAAC;AACzD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,0CAA0C,CAAC;AACzD,cAAc,2DAA2D,CAAC;AAC1E,cAAc,uCAAuC,CAAC;AACtD,cAAc,2CAA2C,CAAC"}
1
+ {"version":3,"file":"scheduled-tasks.d.ts","sourceRoot":"","sources":["../../src/entry-points/scheduled-tasks.ts"],"names":[],"mappings":"AAAA,cAAc,0CAA0C,CAAC;AACzD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,0CAA0C,CAAC;AACzD,cAAc,2DAA2D,CAAC;AAC1E,cAAc,uCAAuC,CAAC;AACtD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,uFAAuF,CAAC"}
@@ -6,4 +6,5 @@ export * from '../skill/useSkillEditorSubmit';
6
6
  export * from '../skill/useSkillFileActions';
7
7
  export * from '../skill/skill-manifest';
8
8
  export * from '../skill/useSkillArchiveImport/useSkillArchiveImport';
9
+ export * from '../skill-editor/useSkillFileSystemPicker/useSkillFileSystemPicker';
9
10
  //# sourceMappingURL=skill-editor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"skill-editor.d.ts","sourceRoot":"","sources":["../../src/entry-points/skill-editor.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sCAAsC,CAAC;AACrD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC;AACxC,cAAc,sDAAsD,CAAC"}
1
+ {"version":3,"file":"skill-editor.d.ts","sourceRoot":"","sources":["../../src/entry-points/skill-editor.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sCAAsC,CAAC;AACrD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC;AACxC,cAAc,sDAAsD,CAAC;AACrE,cAAc,mEAAmE,CAAC"}
@@ -14,4 +14,6 @@ export * from '../shared/formatting';
14
14
  export * from '../shared/locale';
15
15
  export * from '../shared/string-utils';
16
16
  export * from '../usage/useUsageData/useUsageData';
17
+ export * from '../files/browser-download';
18
+ export * from '../shared/usePersistedState/usePersistedState';
17
19
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/entry-points/utils.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,yCAAyC,CAAC;AACxD,cAAc,iDAAiD,CAAC;AAChE,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2CAA2C,CAAC;AAC1D,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oCAAoC,CAAC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/entry-points/utils.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,yCAAyC,CAAC;AACxD,cAAc,iDAAiD,CAAC;AAChE,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2CAA2C,CAAC;AAC1D,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oCAAoC,CAAC;AACnD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+CAA+C,CAAC"}
@@ -1,4 +1,5 @@
1
1
  export * from '../usePageFileDrag/usePageFileDrag';
2
2
  export * from '../usePanelMaxWidth/usePanelMaxWidth';
3
3
  export * from '../useViewportWidth/useViewportWidth';
4
+ export * from '../viewport-layout/canvas-width';
4
5
  //# sourceMappingURL=viewport-layout.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"viewport-layout.d.ts","sourceRoot":"","sources":["../../src/entry-points/viewport-layout.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAC;AACnD,cAAc,sCAAsC,CAAC;AACrD,cAAc,sCAAsC,CAAC"}
1
+ {"version":3,"file":"viewport-layout.d.ts","sourceRoot":"","sources":["../../src/entry-points/viewport-layout.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAC;AACnD,cAAc,sCAAsC,CAAC;AACrD,cAAc,sCAAsC,CAAC;AACrD,cAAc,iCAAiC,CAAC"}
@@ -1 +1,3 @@
1
- export { annotationToOoxmlCanvasContent, annotationToPdfCanvasContent, clearAttachmentCache, hasAttachmentTextSource, referenceAttachmentToPdfCanvasContent, resolveCodeCanvasContent, resolveGroupedVisualizerCanvasContent, resolveHtmlCanvasContent, resolveImageCanvasContent, resolveJsonCanvasContent, resolveMarkdownCanvasContent, resolveOoxmlCanvasContent, resolvePdfCanvasContent, resolveTextCanvasContent, resolveVisualizerCanvasContent } from "./files/attachment-canvas.js";
1
+ import { annotationToOoxmlCanvasContent as e, annotationToPdfCanvasContent as t, clearAttachmentCache as n, hasAttachmentTextSource as r, referenceAttachmentToPdfCanvasContent as i, resolveCodeCanvasContent as a, resolveGroupedVisualizerCanvasContent as o, resolveHtmlCanvasContent as s, resolveImageCanvasContent as c, resolveJsonCanvasContent as l, resolveMarkdownCanvasContent as u, resolveOoxmlCanvasContent as d, resolvePdfCanvasContent as f, resolveTextCanvasContent as p, resolveVisualizerCanvasContent as m } from "./files/attachment-canvas.js";
2
+ import { useDialFilePreview as h } from "./files/useDialFilePreview/useDialFilePreview.js";
3
+ export { e as annotationToOoxmlCanvasContent, t as annotationToPdfCanvasContent, n as clearAttachmentCache, r as hasAttachmentTextSource, i as referenceAttachmentToPdfCanvasContent, a as resolveCodeCanvasContent, o as resolveGroupedVisualizerCanvasContent, s as resolveHtmlCanvasContent, c as resolveImageCanvasContent, l as resolveJsonCanvasContent, u as resolveMarkdownCanvasContent, d as resolveOoxmlCanvasContent, f as resolvePdfCanvasContent, p as resolveTextCanvasContent, m as resolveVisualizerCanvasContent, h as useDialFilePreview };
package/file-manager.js CHANGED
@@ -26,5 +26,6 @@ import { useDialFileManager as we } from "./files/useDialFileManager/useDialFile
26
26
  import { useDialFileManagerSections as Te } from "./files/useDialFileManagerSections/useDialFileManagerSections.js";
27
27
  import { useDialFileManagerTabConfig as Ee } from "./files/useDialFileManagerTabConfig/useDialFileManagerTabConfig.js";
28
28
  import { useFileAttachmentPicker as De } from "./files/useFileAttachmentPicker/useFileAttachmentPicker.js";
29
- import { useGridEditingScroll as Oe } from "@epam/ai-dial-chat-shared";
30
- export { h as COLUMNS_MY_FILES, g as COLUMNS_ORGANIZATION, _ as COLUMNS_SHARED, v as CORE_PERMISSION_MAP, y as DATE_OPTIONS, b as DIAL_FILE_MANAGER_SECTION_TABS, d as DialFilesApiUploadMode, ge as DownloadDestinationType, f as FileManagerNotificationReason, p as FileNameValidationErrorReason, m as FileOperationKind, x as PATH_SEPARATOR_REGEXP, S as RESERVED_MARKER_NAME, C as UPLOAD_CONCURRENCY, G as UploadNetworkError, ue as annotationToDisplayAttachment, de as attachmentDtoToDisplayAttachment, fe as attachmentDtosToDisplayAttachments, q as buildFromCache, w as buildSharedItemVirtualPath, J as buildSharedSearchScope, ae as createFilesApiClient, K as createUploadFileWithProgress, ve as deriveActionProfile, T as dialCorePathToRelative, pe as dialFileToAttachment, me as dialFilesToAttachments, he as dialFolderPathToAttachment, Y as fetchByTab, X as fetchForSearch, E as findDialFileByPath, Z as findFirstSuccessfulCopyMoveItem, D as findFolderByVirtualPath, O as formatOperationFolderName, se as getUrlFileName, k as getVirtualPathName, A as hasDialFileWritePermission, j as hasForbiddenNameSymbols, M as hasSamePaths, N as isCopyMoveDuplicateAllowed, i as isDialFileAcceptType, e as isDialFileId, t as isDialFolderId, ce as isExternalSourcePreviewable, P as isShareActionsAllowed, Q as mapCorePermissions, $ as mapFileMetadataToDialFile, ee as mapSearchItem, te as mergeCreatedFolderIntoCache, a as mimeTypesToAttachmentExtensionLabels, o as mimeTypesToDialFileAcceptTypes, s as mimeTypesToFileAccept, F as normalizeVirtualPath, oe as openAnnotationAttachment, I as parseNewFolderVirtualPath, U as prepareCopyItems, _e as prepareDownloadDestination, W as prepareMoveRenameItems, V as resolveDialFileApiPath, n as resolveDialFileBucketAndPath, le as resolveExternalSourceContentType, L as resolveOwnerCoords, r as resolveRelativeDialFilePath, R as resolveSectionByPath, ne as resolveTransferFailureReason, re as resolveUploadFailureReason, c as sanitizeFileName, l as splitFileNameExtension, u as trimFileNameToByteLimit, z as unionPathSets, ie as updateEntry, ye as useDialFileListing, we as useDialFileManager, Te as useDialFileManagerSections, Ee as useDialFileManagerTabConfig, be as useDialFileMetadata, xe as useDialFileMutations, Se as useDialFileSharing, Ce as useDialFileUploadBatch, De as useFileAttachmentPicker, Oe as useGridEditingScroll, H as virtualPathToApiPath, B as withRoutableRootLabels };
29
+ import { useFileAttachmentModalState as Oe } from "./files/useFileAttachmentModalState/useFileAttachmentModalState.js";
30
+ import { useGridEditingScroll as ke } from "@epam/ai-dial-chat-shared";
31
+ export { h as COLUMNS_MY_FILES, g as COLUMNS_ORGANIZATION, _ as COLUMNS_SHARED, v as CORE_PERMISSION_MAP, y as DATE_OPTIONS, b as DIAL_FILE_MANAGER_SECTION_TABS, d as DialFilesApiUploadMode, ge as DownloadDestinationType, f as FileManagerNotificationReason, p as FileNameValidationErrorReason, m as FileOperationKind, x as PATH_SEPARATOR_REGEXP, S as RESERVED_MARKER_NAME, C as UPLOAD_CONCURRENCY, G as UploadNetworkError, ue as annotationToDisplayAttachment, de as attachmentDtoToDisplayAttachment, fe as attachmentDtosToDisplayAttachments, q as buildFromCache, w as buildSharedItemVirtualPath, J as buildSharedSearchScope, ae as createFilesApiClient, K as createUploadFileWithProgress, ve as deriveActionProfile, T as dialCorePathToRelative, pe as dialFileToAttachment, me as dialFilesToAttachments, he as dialFolderPathToAttachment, Y as fetchByTab, X as fetchForSearch, E as findDialFileByPath, Z as findFirstSuccessfulCopyMoveItem, D as findFolderByVirtualPath, O as formatOperationFolderName, se as getUrlFileName, k as getVirtualPathName, A as hasDialFileWritePermission, j as hasForbiddenNameSymbols, M as hasSamePaths, N as isCopyMoveDuplicateAllowed, i as isDialFileAcceptType, e as isDialFileId, t as isDialFolderId, ce as isExternalSourcePreviewable, P as isShareActionsAllowed, Q as mapCorePermissions, $ as mapFileMetadataToDialFile, ee as mapSearchItem, te as mergeCreatedFolderIntoCache, a as mimeTypesToAttachmentExtensionLabels, o as mimeTypesToDialFileAcceptTypes, s as mimeTypesToFileAccept, F as normalizeVirtualPath, oe as openAnnotationAttachment, I as parseNewFolderVirtualPath, U as prepareCopyItems, _e as prepareDownloadDestination, W as prepareMoveRenameItems, V as resolveDialFileApiPath, n as resolveDialFileBucketAndPath, le as resolveExternalSourceContentType, L as resolveOwnerCoords, r as resolveRelativeDialFilePath, R as resolveSectionByPath, ne as resolveTransferFailureReason, re as resolveUploadFailureReason, c as sanitizeFileName, l as splitFileNameExtension, u as trimFileNameToByteLimit, z as unionPathSets, ie as updateEntry, ye as useDialFileListing, we as useDialFileManager, Te as useDialFileManagerSections, Ee as useDialFileManagerTabConfig, be as useDialFileMetadata, xe as useDialFileMutations, Se as useDialFileSharing, Ce as useDialFileUploadBatch, Oe as useFileAttachmentModalState, De as useFileAttachmentPicker, ke as useGridEditingScroll, H as virtualPathToApiPath, B as withRoutableRootLabels };
@@ -0,0 +1,9 @@
1
+ import { DownloadDestination } from './download-destination';
2
+ /**
3
+ * Writes `response` to disk and returns the file name it was saved under — the
4
+ * `Content-Disposition` name when the response carries one, otherwise
5
+ * `fallbackName`. Callers report the returned name so a confirmation names what
6
+ * is actually on disk rather than what was requested.
7
+ */
8
+ export declare const triggerBrowserDownload: (response: Response, fallbackName: string, destination?: DownloadDestination) => Promise<string>;
9
+ //# sourceMappingURL=browser-download.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser-download.d.ts","sourceRoot":"","sources":["../../src/files/browser-download.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,wBAAwB,CAAC;AA2BhC;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,GACjC,UAAU,QAAQ,EAClB,cAAc,MAAM,EACpB,cAAa,mBAEZ,KACA,OAAO,CAAC,MAAM,CAqBhB,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { DownloadDestinationType as e } from "./download-destination.js";
2
+ import { triggerBlobDownload as t } from "@epam/ai-dial-chat-shared";
3
+ //#region src/files/browser-download.ts
4
+ var n = /filename\*\s*=\s*UTF-8''([^;\n]+)/i, r = (e) => {
5
+ if (!e) return null;
6
+ let t = n.exec(e)?.[1];
7
+ if (t) try {
8
+ let e = decodeURIComponent(t.trim()).replace(/[/\\]/g, "").trim();
9
+ if (e) return e;
10
+ } catch {}
11
+ let r = /filename(?!\*)[^;=\n]*=(?:(\\?['"])(.*?)\1|([^;\n]*))/i.exec(e), i = r?.[2] ?? r?.[3];
12
+ return i && i.replace(/[/\\]/g, "").trim() || null;
13
+ }, i = async (n, i, a = { type: e.Blob }) => {
14
+ if (a.type === e.Cancelled) return i;
15
+ if (a.type === e.Stream) {
16
+ if (n.body == null) throw await a.writable.abort("Response has no readable stream"), Error("Response has no readable stream");
17
+ return await n.body.pipeTo(a.writable), i;
18
+ }
19
+ let o = r(n.headers.get("Content-Disposition")) ?? i, s = await n.blob();
20
+ return t(s, o), o;
21
+ };
22
+ //#endregion
23
+ export { i as triggerBrowserDownload };
@@ -0,0 +1,33 @@
1
+ import { Attachment } from '@epam/ai-dial-chat-shared';
2
+ import { DialFile, FileManagerGridRow } from '@epam/ai-dial-react-file-manager';
3
+ /** Host data and canvas operations for file preview. */
4
+ export interface UseDialFilePreviewOptions {
5
+ /** Current folder tree. */
6
+ items: DialFile[];
7
+ /** Current search hits. Defaults to null. */
8
+ searchResults?: DialFile[] | null;
9
+ /** Default file bucket. */
10
+ bucket: string;
11
+ /** Supported filename extensions, chosen by the host. */
12
+ previewExtensions: string[];
13
+ /** Starts a request and returns its commit guard. */
14
+ startRequest: () => () => boolean;
15
+ /** Opens an attachment, consulting the guard before committing. */
16
+ openAttachment: (attachment: Attachment, isCurrent: () => boolean) => Promise<boolean>;
17
+ /** Opens an unsupported preview with an optional download URL. */
18
+ openUnsupported: (name: string, id: string | undefined, url?: string) => void;
19
+ /** Resolves a download URL for an unsupported attachment. */
20
+ resolveUrl: (attachment: Attachment) => string | undefined;
21
+ }
22
+ /** Stable grid callbacks and the supplied extension policy. */
23
+ export interface UseDialFilePreviewResult {
24
+ /** Previews a file from either current listing. */
25
+ onPreview: (path?: string) => void;
26
+ /** Previews the clicked row. */
27
+ onFileClick: (row: FileManagerGridRow) => void;
28
+ /** Host-provided extension policy. */
29
+ previewExtensions: string[];
30
+ }
31
+ /** Previews current files while rejecting stale or unmounted completions. */
32
+ export declare const useDialFilePreview: ({ items, searchResults, bucket, previewExtensions, startRequest, openAttachment, openUnsupported, resolveUrl, }: UseDialFilePreviewOptions) => UseDialFilePreviewResult;
33
+ //# sourceMappingURL=useDialFilePreview.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDialFilePreview.d.ts","sourceRoot":"","sources":["../../../src/files/useDialFilePreview/useDialFilePreview.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,EACV,QAAQ,EACR,kBAAkB,EACnB,MAAM,kCAAkC,CAAC;AAM1C,wDAAwD;AACxD,MAAM,WAAW,yBAAyB;IACxC,2BAA2B;IAC3B,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,6CAA6C;IAC7C,aAAa,CAAC,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;IAClC,2BAA2B;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,yDAAyD;IACzD,iBAAiB,EAAE,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