@llmnative/agentico 0.19.0 → 0.20.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.
package/dist/index.mjs CHANGED
@@ -1,10 +1,10 @@
1
1
  import { zodToJsonSchema as e } from "zod-to-json-schema";
2
2
  import { ActionButton as t, Badge as n, Card as r, ChatMarkdown as i, ChatQuestions as a, ChatReasoning as o, Chatbot as s, Code as c, Dropdown as l, DropdownItem as u, Form as d, Icon as f, Identicon as p, ImageAvatar as m, Input as h, LoadingButton as g, Modal as _, ModalYesNo as v, PromptUtils as y, Tree as b, getAIModelCatalog as x, interpolate as S, parseAIModelRef as C, proxyFetch as w, useAIProviderRegistry as T, useFormController as ee, useI18n as E, useProxy as D } from "@llmnative/react";
3
- import O, { createContext as te, useCallback as k, useContext as A, useEffect as j, useLayoutEffect as M, useMemo as N, useRef as P, useState as F } from "react";
4
- import { Fragment as I, jsx as L, jsxs as R } from "react/jsx-runtime";
3
+ import O, { createContext as te, useCallback as k, useContext as A, useEffect as j, useLayoutEffect as ne, useMemo as M, useRef as N, useState as P } from "react";
4
+ import { Fragment as F, jsx as I, jsxs as L } from "react/jsx-runtime";
5
5
  //#region src/domain/messageParts.ts
6
- var ne = "text", z = "reasoning";
7
- function B(e, t, n) {
6
+ var re = "text", R = "reasoning";
7
+ function ie(e, t, n) {
8
8
  let r = e.findIndex((e) => e.type === t.type && e.id === t.id);
9
9
  if (r >= 0) return e.map((e, n) => n === r ? t : e);
10
10
  let i = t.type === "reasoning" || !n ? e : e.map((e) => e.type === "reasoning" && e.streaming ? n(e) : e), a = i.findIndex((e) => e.type === "text" && e.id === "text");
@@ -14,15 +14,15 @@ function B(e, t, n) {
14
14
  ...i.slice(a)
15
15
  ] : [...i, t];
16
16
  }
17
- function V(e) {
17
+ function z(e) {
18
18
  return e.filter((e) => e.type === "text").map((e) => e.text).filter(Boolean).join("\n\n");
19
19
  }
20
- function re(e, t) {
20
+ function B(e, t) {
21
21
  return t.map((t, n) => `${t.header ?? e[n]?.header ?? e[n]?.question ?? t.id ?? `${n + 1}`}: ${t.values.join(", ")}`).join("\n");
22
22
  }
23
23
  //#endregion
24
24
  //#region src/domain/defineSubagent.ts
25
- function ie(e) {
25
+ function V(e) {
26
26
  return e;
27
27
  }
28
28
  //#endregion
@@ -43,30 +43,30 @@ var G = [];
43
43
  function K(...e) {
44
44
  G = e;
45
45
  }
46
- function oe(e) {
46
+ function q(e) {
47
47
  return G.flatMap((t) => t(e));
48
48
  }
49
49
  //#endregion
50
50
  //#region src/domain/mcpTool.ts
51
- function se(t) {
51
+ function oe(t) {
52
52
  let { $schema: n, ...r } = e(t, {
53
53
  target: "jsonSchema7",
54
54
  $refStrategy: "none"
55
55
  });
56
56
  return r;
57
57
  }
58
- function ce(e, t, n, r) {
58
+ function se(e, t, n, r) {
59
59
  return {
60
60
  name: e,
61
61
  description: t,
62
- inputSchema: se(n),
63
- ...r ? { outputSchema: se(r) } : {}
62
+ inputSchema: oe(n),
63
+ ...r ? { outputSchema: oe(r) } : {}
64
64
  };
65
65
  }
66
66
  //#endregion
67
67
  //#region src/domain/subagentUsageCard.ts
68
- function le(e) {
69
- let t = se(e.inputSchema), n = t.properties ?? {}, r = new Set(t.required ?? []);
68
+ function ce(e) {
69
+ let t = oe(e.inputSchema), n = t.properties ?? {}, r = new Set(t.required ?? []);
70
70
  return Object.entries(n).map(([t, n]) => {
71
71
  let i = typeof n.description == "string" ? n.description : "";
72
72
  return {
@@ -80,7 +80,7 @@ function le(e) {
80
80
  }
81
81
  //#endregion
82
82
  //#region src/domain/prompts.ts
83
- var ue = {
83
+ var le = {
84
84
  orchestratorIntro: "You are Agentico, the orchestrator of this application's tools. Your job is to understand what the user wants to achieve and, once every required parameter is collected, start the right tool among those listed below — do not carry it out yourself \"in words\", invoke it as a tool.",
85
85
  responseRules: [
86
86
  "BEFORE asking for any parameter, check the \"Page context\" below (if present): if a parameter required by the command is already there or can be deduced from it with reasonable certainty, USE it directly — do not ask the user again. Only ask for parameters that cannot be derived from the context.",
@@ -110,7 +110,7 @@ var ue = {
110
110
  ].join(" "),
111
111
  multipleCandidates: "Several subagents are candidates on this page — ask the user which one they mean if their message does not make it clear, before going on.",
112
112
  chatTitle: "Write a title for this chat, as a list of chats shows it: 3 to 6 words saying what it is about, in the language the person writes in. Answer with the title only: no quotes, no final period.\n\n{chat}"
113
- }, de = {
113
+ }, ue = {
114
114
  orchestratorIntro: "Sei Agentico, l'orchestratore dei tool di questa applicazione. Il tuo compito è capire cosa vuole ottenere l'utente e, una volta raccolti tutti i parametri necessari, avviare il tool giusto tra quelli elencati sotto — non eseguirlo tu stesso \"a parole\", invocalo come strumento.",
115
115
  responseRules: [
116
116
  "PRIMA di chiedere qualunque parametro, controlla il \"Contesto pagina\" (se presente) qui sotto: se un parametro richiesto dal comando è già lì o si può dedurre da lì con ragionevole certezza (es. l'utente sta guardando lo storico di un tool specifico, o un'esecuzione passata con parametri simili), USALO direttamente — non chiederlo di nuovo all'utente. Chiedi solo i parametri che NON emergono in nessun modo dal contesto.",
@@ -140,18 +140,18 @@ var ue = {
140
140
  ].join(" "),
141
141
  multipleCandidates: "Più subagent sono candidati su questa pagina — chiedi all'utente quale intende se non è chiaro dal suo messaggio, prima di procedere.",
142
142
  chatTitle: "Scrivi un titolo per questa chat, come lo mostra un elenco di chat: da 3 a 6 parole che dicono di cosa parla, nella lingua in cui scrive la persona. Rispondi solo con il titolo: niente virgolette, niente punto finale.\n\n{chat}"
143
- }, q = ue;
143
+ }, de = le;
144
144
  function fe(e) {
145
- q = {
146
- ...q,
145
+ de = {
146
+ ...de,
147
147
  ...e
148
148
  };
149
149
  }
150
150
  function J() {
151
- return q;
151
+ return de;
152
152
  }
153
153
  function pe() {
154
- q = ue;
154
+ de = le;
155
155
  }
156
156
  //#endregion
157
157
  //#region src/domain/cli/renderManifestCli.ts
@@ -159,7 +159,7 @@ function me(e, t) {
159
159
  return `${e} ${t.map((e) => e.required ? `--${e.key} <${e.type}>` : `[--${e.key} <${e.type}>]`).join(" ")}`.trim();
160
160
  }
161
161
  function he(e, t) {
162
- let n = le(t), r = me(t.name, n), i = n.map((e) => ` --${e.key} <${e.type}> (${e.required ? "required" : "optional"})${e.description ? ` — ${e.description}` : ""}`);
162
+ let n = ce(t), r = me(t.name, n), i = n.map((e) => ` --${e.key} <${e.type}> (${e.required ? "required" : "optional"})${e.description ? ` — ${e.description}` : ""}`);
163
163
  return [
164
164
  `COMMAND: ${e} ${t.name}`,
165
165
  ` ${t.summary}`,
@@ -700,11 +700,11 @@ function $() {
700
700
  //#region src/presentation/AgenticoContext.tsx
701
701
  var lt = "agentico-orchestrator", ut = te(null);
702
702
  function dt({ children: e, scope: t = null, person: n = null, threadEvents: r = null }) {
703
- let [i, a] = F(null), o = P(null);
703
+ let [i, a] = P(null), o = N(null);
704
704
  j(() => {
705
705
  o.current = i;
706
706
  }, [i]);
707
- let [s, c] = F(!1), l = t?.id;
707
+ let [s, c] = P(!1), l = t?.id;
708
708
  j(() => {
709
709
  l && Le(l).catch(() => void 0);
710
710
  }, [l]);
@@ -718,8 +718,13 @@ function dt({ children: e, scope: t = null, person: n = null, threadEvents: r =
718
718
  a(n);
719
719
  }, []), d = k((e) => {
720
720
  a((t) => t && t.id === e ? null : t);
721
- }, []), f = k(() => c((e) => !e), []), p = k(() => c(!0), []), [m, h] = F(null), [g, _] = F(void 0), [v, y] = F(void 0), [b, x] = F(void 0), [S, C] = F(null), [w, T] = F(null), [ee, E] = F(void 0), [D, O] = F([]), te = k((e, t, n = null) => {
722
- O((r) => {
721
+ }, []), f = k(() => c((e) => !e), []), p = k(() => c(!0), []), [m, h] = P(null), g = k((e) => {
722
+ c(!0), h((t) => ({
723
+ text: e,
724
+ nonce: (t?.nonce ?? 0) + 1
725
+ }));
726
+ }, []), [_, v] = P(null), [y, b] = P(void 0), [x, S] = P(void 0), [C, w] = P(void 0), [T, ee] = P(null), [E, D] = P(null), [O, te] = P(void 0), [A, ne] = P([]), F = k((e, t, n = null) => {
727
+ ne((r) => {
723
728
  let i = r.filter((t) => t.id !== e);
724
729
  return t ? [...i, {
725
730
  id: e,
@@ -727,29 +732,29 @@ function dt({ children: e, scope: t = null, person: n = null, threadEvents: r =
727
732
  card: n
728
733
  }] : i;
729
734
  });
730
- }, []), A = D.length > 0 ? D[D.length - 1] : null, [M, I] = F([]), R = k((e, t) => {
731
- I((n) => {
735
+ }, []), L = A.length > 0 ? A[A.length - 1] : null, [re, R] = P([]), ie = k((e, t) => {
736
+ R((n) => {
732
737
  let r = n.filter((t) => t.id !== e);
733
738
  return t ? [...r, {
734
739
  id: e,
735
740
  ...t
736
741
  }] : r;
737
742
  });
738
- }, []), ne = N(() => M.map((e) => ({
743
+ }, []), z = M(() => re.map((e) => ({
739
744
  subagentId: e.subagentId,
740
745
  componentKey: e.componentKey,
741
746
  onResult: e.onResult,
742
747
  pinnedEntityId: e.pinnedEntityId
743
- })), [M]), z = N(() => {
748
+ })), [re]), B = M(() => {
744
749
  let e = /* @__PURE__ */ new Map();
745
- for (let t of M) e.set(t.subagentId, {
750
+ for (let t of re) e.set(t.subagentId, {
746
751
  subagentId: t.subagentId,
747
752
  componentKey: t.componentKey,
748
753
  onResult: t.onResult,
749
754
  contextInfo: t.contextInfo
750
755
  });
751
756
  return [...e.values()];
752
- }, [M]), B = N(() => z.map((e) => {
757
+ }, [re]), V = M(() => B.map((e) => {
753
758
  let t = W(e.subagentId)?.componentContexts?.[e.componentKey];
754
759
  if (!t) return null;
755
760
  let n = e.contextInfo ? `${t.agenticoHint}\n${e.contextInfo}` : t.agenticoHint;
@@ -758,21 +763,21 @@ function dt({ children: e, scope: t = null, person: n = null, threadEvents: r =
758
763
  agenticoHint: n,
759
764
  userMessage: t.userMessage
760
765
  };
761
- }).filter((e) => e !== null), [z]), V = N(() => B.map((e) => e.userMessage), [B]), re = N(() => {
762
- if (B.length === 0) return null;
763
- if (B.length === 1) return B[0].agenticoHint;
764
- let e = B.map((e, t) => `${t + 1}. ${e.agenticoHint}`).join("\n");
766
+ }).filter((e) => e !== null), [B]), H = M(() => V.map((e) => e.userMessage), [V]), U = M(() => {
767
+ if (V.length === 0) return null;
768
+ if (V.length === 1) return V[0].agenticoHint;
769
+ let e = V.map((e, t) => `${t + 1}. ${e.agenticoHint}`).join("\n");
765
770
  return `${J().multipleCandidates}\n\n${e}`;
766
- }, [B]) ?? A?.text ?? null, ie = B.length > 0 ? null : A?.card ?? null, H = N(() => [...new Set(ne.map((e) => e.subagentId))], [ne]), U = H.length === 1 ? H[0] : H.length === 0 ? A?.card?.subagentId ?? null : null, ae = k((e, t) => {
771
+ }, [V]) ?? L?.text ?? null, ae = V.length > 0 ? null : L?.card ?? null, G = M(() => [...new Set(z.map((e) => e.subagentId))], [z]), K = G.length === 1 ? G[0] : G.length === 0 ? L?.card?.subagentId ?? null : null, q = k((e, t) => {
767
772
  p();
768
773
  let n = o.current;
769
774
  if (n?.id === "agentico-orchestrator") return;
770
- let r = U && n?.id.startsWith(`subagent-${U}-`) ? n : void 0;
771
- T(r ? {
775
+ let r = K && n?.id.startsWith(`subagent-${K}-`) ? n : void 0;
776
+ D(r ? {
772
777
  taskId: r.id,
773
778
  activity: [...r.precedingActivity ?? [], ...r.agent.activity]
774
- } : null), h(e), _(t?.extraDestinations), y(t?.attachments), x(t?.model), E(t?.scopedSubagentId), C(crypto.randomUUID());
775
- }, [p, U]), G = k((e, t, n, r, i, s) => {
779
+ } : null), v(e), b(t?.extraDestinations), S(t?.attachments), w(t?.model), te(t?.scopedSubagentId), ee(crypto.randomUUID());
780
+ }, [p, K]), oe = k((e, t, n, r, i, s) => {
776
781
  if (!n || !r) return;
777
782
  let c = o.current;
778
783
  if (!c || c.id !== n) return;
@@ -789,113 +794,117 @@ function dt({ children: e, scope: t = null, person: n = null, threadEvents: r =
789
794
  ...e,
790
795
  savedToDisk: !0
791
796
  } : e));
792
- }, []), [K, oe] = F(null), [se, ce] = F(null), le = k((e, t, n) => {
793
- p(), oe({
797
+ }, []), [se, ce] = P(null), [le, ue] = P(null), de = k((e, t, n) => {
798
+ p(), ce({
794
799
  subagentId: e,
795
800
  entityId: t,
796
801
  snapshot: n
797
- }), ce(crypto.randomUUID());
798
- }, [p]), [ue, de] = F(null), [q, fe] = F(null), pe = k((e, t) => {
799
- p(), d(lt), de({
802
+ }), ue(crypto.randomUUID());
803
+ }, [p]), [fe, pe] = P(null), [me, he] = P(null), Y = k((e, t) => {
804
+ p(), d(lt), pe({
800
805
  subagentId: e,
801
806
  extraDestinations: t
802
- }), fe(crypto.randomUUID());
803
- }, [p, d]), [me, he] = F(null), [Y, ge] = F(null), _e = k((e, t, n) => {
804
- de(null), he({
807
+ }), he(crypto.randomUUID());
808
+ }, [p, d]), [ge, _e] = P(null), [X, ve] = P(null), ye = k((e, t, n) => {
809
+ pe(null), _e({
805
810
  subagentId: e,
806
811
  params: t,
807
812
  extraDestinations: n
808
- }), ge(crypto.randomUUID());
809
- }, []), [X, ve] = F(null), [ye, be] = F(null), xe = k((e, t, n) => {
810
- p(), ve({
813
+ }), ve(crypto.randomUUID());
814
+ }, []), [be, xe] = P(null), [Se, Ce] = P(null), we = k((e, t, n) => {
815
+ p(), xe({
811
816
  subagentId: e,
812
817
  params: t,
813
818
  ...n
814
- }), be(crypto.randomUUID());
815
- }, [p]), Se = k(() => {
819
+ }), Ce(crypto.randomUUID());
820
+ }, [p]), Te = k(() => {
816
821
  let e = o.current;
817
822
  e && e.onDismiss();
818
- }, []), Ce = N(() => ({
823
+ }, []), Ee = M(() => ({
819
824
  scope: t,
820
825
  person: n,
821
826
  threadEvents: r,
827
+ compose: g,
828
+ draft: m,
822
829
  task: i,
823
830
  isOpen: s,
824
831
  openTask: u,
825
832
  closeTask: d,
826
833
  toggleOpen: f,
827
- pendingGoal: m,
828
- startOrchestrator: ae,
829
- pageContext: re,
830
- pageContextCard: ie,
831
- setPageContext: te,
832
- scopedSubagentId: U,
833
- pendingScopedSubagentId: ee,
834
- componentAnchors: ne,
835
- anchoredUserMessages: V,
836
- registerComponentAnchor: R,
834
+ pendingGoal: _,
835
+ startOrchestrator: q,
836
+ pageContext: U,
837
+ pageContextCard: ae,
838
+ setPageContext: F,
839
+ scopedSubagentId: K,
840
+ pendingScopedSubagentId: O,
841
+ componentAnchors: z,
842
+ anchoredUserMessages: H,
843
+ registerComponentAnchor: ie,
837
844
  openPanel: p,
838
- pendingExtraDestinations: g,
839
- pendingAttachments: v,
840
- pendingModel: b,
841
- orchestratorRunId: S,
842
- pendingCarryOver: w,
843
- commitEntityChat: G,
844
- resumeEntityChat: le,
845
- pendingResume: K,
846
- resumeRunId: se,
847
- dismissForeignTask: Se,
848
- pendingManualEntry: ue,
849
- manualEntryRunId: q,
850
- startManualEntry: pe,
851
- pendingResumeWithAI: me,
852
- resumeWithAIRunId: Y,
853
- resumeWithAI: _e,
854
- startSubagent: xe,
855
- pendingStart: X,
856
- startRunId: ye
845
+ pendingExtraDestinations: y,
846
+ pendingAttachments: x,
847
+ pendingModel: C,
848
+ orchestratorRunId: T,
849
+ pendingCarryOver: E,
850
+ commitEntityChat: oe,
851
+ resumeEntityChat: de,
852
+ pendingResume: se,
853
+ resumeRunId: le,
854
+ dismissForeignTask: Te,
855
+ pendingManualEntry: fe,
856
+ manualEntryRunId: me,
857
+ startManualEntry: Y,
858
+ pendingResumeWithAI: ge,
859
+ resumeWithAIRunId: X,
860
+ resumeWithAI: ye,
861
+ startSubagent: we,
862
+ pendingStart: be,
863
+ startRunId: Se
857
864
  }), [
858
865
  t,
859
866
  n,
860
867
  r,
868
+ g,
869
+ m,
861
870
  i,
862
871
  s,
863
872
  u,
864
873
  d,
865
874
  f,
866
- m,
875
+ _,
876
+ q,
877
+ U,
867
878
  ae,
868
- re,
879
+ F,
880
+ K,
881
+ O,
882
+ z,
883
+ H,
869
884
  ie,
870
- te,
871
- U,
872
- ee,
873
- ne,
874
- V,
875
- R,
876
885
  p,
877
- g,
878
- v,
879
- b,
880
- S,
881
- w,
882
- G,
883
- le,
884
- K,
886
+ y,
887
+ x,
888
+ C,
889
+ T,
890
+ E,
891
+ oe,
892
+ de,
885
893
  se,
886
- Se,
887
- ue,
888
- q,
889
- pe,
894
+ le,
895
+ Te,
896
+ fe,
890
897
  me,
891
898
  Y,
892
- _e,
893
- xe,
899
+ ge,
894
900
  X,
895
- ye
901
+ ye,
902
+ we,
903
+ be,
904
+ Se
896
905
  ]);
897
- return /* @__PURE__ */ L(ut.Provider, {
898
- value: Ce,
906
+ return /* @__PURE__ */ I(ut.Provider, {
907
+ value: Ee,
899
908
  children: e
900
909
  });
901
910
  }
@@ -908,7 +917,7 @@ function ft() {
908
917
  //#region src/presentation/ThreadEvents.tsx
909
918
  var pt = "llmnative.agentico.threadEvents";
910
919
  function mt() {
911
- let [e, t] = F(() => {
920
+ let [e, t] = P(() => {
912
921
  try {
913
922
  return localStorage.getItem(pt) !== "off";
914
923
  } catch {
@@ -923,7 +932,7 @@ function mt() {
923
932
  }];
924
933
  }
925
934
  function ht(e, t, n, r = !0) {
926
- let { threadEvents: i } = ft(), [a, o] = F([]);
935
+ let { threadEvents: i } = ft(), [a, o] = P([]);
927
936
  return j(() => {
928
937
  if (!i || !e || !r) {
929
938
  o([]);
@@ -948,82 +957,116 @@ function ht(e, t, n, r = !0) {
948
957
  ]), a;
949
958
  }
950
959
  function gt({ event: e }) {
951
- let t = $(), { locale: r } = E(), [a, o] = F(!1), s = new Date(e.at).toLocaleString(r, {
960
+ let t = $(), { locale: r } = E(), [a, o] = P(!!e.open), { threadEvents: s, task: c, compose: l } = ft(), [u, d] = P(null), p = async (t) => {
961
+ if (s?.onAction) {
962
+ d(t);
963
+ try {
964
+ await s.onAction(e, t, {
965
+ compose: l,
966
+ send: async (e) => {
967
+ if (!c || c.agent.running) {
968
+ l(e);
969
+ return;
970
+ }
971
+ let t = await c.agent.sendMessage(e);
972
+ t && c.onApplied(t);
973
+ }
974
+ });
975
+ } finally {
976
+ d(null);
977
+ }
978
+ }
979
+ }, m = new Date(e.at).toLocaleString(r, {
952
980
  dateStyle: "short",
953
981
  timeStyle: "short"
954
982
  });
955
- return /* @__PURE__ */ R("li", {
983
+ return /* @__PURE__ */ L("li", {
956
984
  className: "flex items-start gap-2 py-1 text-xs",
957
985
  "aria-label": `${e.author.name}: ${e.title}`,
958
986
  "aria-busy": e.running || void 0,
959
- children: [/* @__PURE__ */ L("span", {
987
+ children: [/* @__PURE__ */ I("span", {
960
988
  className: "flex w-6 shrink-0 justify-center pt-px",
961
- children: /* @__PURE__ */ L(Dt, { author: e.author })
962
- }), /* @__PURE__ */ R("div", {
989
+ children: /* @__PURE__ */ I(Dt, { author: e.author })
990
+ }), /* @__PURE__ */ L("div", {
963
991
  className: `min-w-0 flex-1 rounded-md border px-2 py-1 ${e.running ? "border-primary/40 bg-primary/5" : "border-border/60 bg-muted/30"}`,
964
- children: [/* @__PURE__ */ R("div", {
965
- className: "flex min-w-0 flex-wrap items-center gap-x-1.5 gap-y-0.5",
966
- children: [
967
- /* @__PURE__ */ L("span", {
968
- className: "font-medium text-foreground",
969
- children: e.author.name
970
- }),
971
- e.running ? /* @__PURE__ */ L(f, {
972
- name: "loader-circle",
973
- size: 12,
974
- className: "shrink-0 animate-spin text-primary",
975
- "aria-label": t.eventRunning
976
- }) : e.icon && /* @__PURE__ */ L(f, {
977
- name: e.icon,
978
- size: 12,
979
- className: "shrink-0 text-muted-foreground"
980
- }),
981
- /* @__PURE__ */ L("span", {
982
- className: "min-w-0 break-words text-muted-foreground",
983
- children: e.title
984
- }),
985
- e.badge && /* @__PURE__ */ L(n, {
986
- variant: e.badge.variant ?? "light",
987
- children: e.badge.label
988
- }),
989
- /* @__PURE__ */ R("span", {
990
- className: "ms-auto flex shrink-0 items-center gap-1 text-[11px] text-muted-foreground",
991
- children: [
992
- /* @__PURE__ */ L("time", {
993
- dateTime: new Date(e.at).toISOString(),
994
- children: s
995
- }),
996
- e.body && /* @__PURE__ */ L("button", {
997
- type: "button",
998
- onClick: () => o((e) => !e),
999
- "aria-expanded": a,
1000
- title: a ? t.eventLess : t.eventMore,
1001
- className: "rounded hover:text-foreground",
1002
- children: /* @__PURE__ */ L(f, {
1003
- name: a ? "chevron-up" : "chevron-down",
1004
- size: 12
1005
- })
1006
- }),
1007
- e.href && /* @__PURE__ */ L("a", {
1008
- href: e.href,
1009
- target: "_blank",
1010
- rel: "noreferrer",
1011
- title: t.eventOpen,
1012
- "aria-label": t.eventOpen,
1013
- className: "rounded hover:text-foreground",
1014
- children: /* @__PURE__ */ L(f, {
1015
- name: "external-link",
1016
- size: 12
992
+ children: [
993
+ /* @__PURE__ */ L("div", {
994
+ className: "flex min-w-0 flex-wrap items-center gap-x-1.5 gap-y-0.5",
995
+ children: [
996
+ /* @__PURE__ */ I("span", {
997
+ className: "font-medium text-foreground",
998
+ children: e.author.name
999
+ }),
1000
+ e.running ? /* @__PURE__ */ I(f, {
1001
+ name: "loader-circle",
1002
+ size: 12,
1003
+ className: "shrink-0 animate-spin text-primary",
1004
+ "aria-label": t.eventRunning
1005
+ }) : e.icon && /* @__PURE__ */ I(f, {
1006
+ name: e.icon,
1007
+ size: 12,
1008
+ className: "shrink-0 text-muted-foreground"
1009
+ }),
1010
+ /* @__PURE__ */ I("span", {
1011
+ className: "min-w-0 break-words text-muted-foreground",
1012
+ children: e.title
1013
+ }),
1014
+ e.badge && /* @__PURE__ */ I(n, {
1015
+ variant: e.badge.variant ?? "light",
1016
+ children: e.badge.label
1017
+ }),
1018
+ /* @__PURE__ */ L("span", {
1019
+ className: "ms-auto flex shrink-0 items-center gap-1 text-[11px] text-muted-foreground",
1020
+ children: [
1021
+ /* @__PURE__ */ I("time", {
1022
+ dateTime: new Date(e.at).toISOString(),
1023
+ children: m
1024
+ }),
1025
+ e.body && /* @__PURE__ */ I("button", {
1026
+ type: "button",
1027
+ onClick: () => o((e) => !e),
1028
+ "aria-expanded": a,
1029
+ title: a ? t.eventLess : t.eventMore,
1030
+ className: "rounded hover:text-foreground",
1031
+ children: /* @__PURE__ */ I(f, {
1032
+ name: a ? "chevron-up" : "chevron-down",
1033
+ size: 12
1034
+ })
1035
+ }),
1036
+ e.href && /* @__PURE__ */ I("a", {
1037
+ href: e.href,
1038
+ target: "_blank",
1039
+ rel: "noreferrer",
1040
+ title: t.eventOpen,
1041
+ "aria-label": t.eventOpen,
1042
+ className: "rounded hover:text-foreground",
1043
+ children: /* @__PURE__ */ I(f, {
1044
+ name: "external-link",
1045
+ size: 12
1046
+ })
1017
1047
  })
1018
- })
1019
- ]
1020
- })
1021
- ]
1022
- }), a && e.body && /* @__PURE__ */ L(i, {
1023
- content: e.body,
1024
- tone: "muted",
1025
- className: "mt-1 break-words text-xs leading-relaxed"
1026
- })]
1048
+ ]
1049
+ })
1050
+ ]
1051
+ }),
1052
+ a && e.body && /* @__PURE__ */ I(i, {
1053
+ content: e.body,
1054
+ tone: "muted",
1055
+ className: "mt-1 break-words text-xs leading-relaxed"
1056
+ }),
1057
+ e.actions && e.actions.length > 0 && s?.onAction && /* @__PURE__ */ I("div", {
1058
+ className: "mt-1.5 flex flex-wrap gap-1.5",
1059
+ children: e.actions.map((e) => /* @__PURE__ */ I(g, {
1060
+ label: e.label,
1061
+ ...e.icon ? { icon: e.icon } : {},
1062
+ variant: e.primary ? "primary" : "outline-primary",
1063
+ className: "px-2 py-0.5 text-xs",
1064
+ loading: u === e.id,
1065
+ disabled: u !== null || !!c?.agent.running,
1066
+ onClick: () => p(e.id)
1067
+ }, e.id))
1068
+ })
1069
+ ]
1027
1070
  })]
1028
1071
  });
1029
1072
  }
@@ -1087,39 +1130,39 @@ function vt(e) {
1087
1130
  return r < e.length && t.push(..._t(e.slice(r))), t;
1088
1131
  }
1089
1132
  function yt({ content: e, language: t }) {
1090
- let [n, r] = F(!1);
1091
- return /* @__PURE__ */ R("div", {
1133
+ let [n, r] = P(!1);
1134
+ return /* @__PURE__ */ L("div", {
1092
1135
  className: `relative cursor-pointer rounded-md ${n ? "max-h-80 overflow-y-auto" : "max-h-28 overflow-hidden"}`,
1093
1136
  onClick: () => r((e) => !e),
1094
1137
  title: n ? "Clic per comprimere" : "Clic per espandere",
1095
- children: [/* @__PURE__ */ L(c, {
1138
+ children: [/* @__PURE__ */ I(c, {
1096
1139
  language: t,
1097
1140
  showCopy: n,
1098
1141
  background: "transparent",
1099
1142
  className: "!text-[11px]",
1100
1143
  children: e
1101
- }), !n && /* @__PURE__ */ L("div", { className: "pointer-events-none absolute inset-x-0 bottom-0 h-6 bg-gradient-to-t from-muted/30 to-transparent" })]
1144
+ }), !n && /* @__PURE__ */ I("div", { className: "pointer-events-none absolute inset-x-0 bottom-0 h-6 bg-gradient-to-t from-muted/30 to-transparent" })]
1102
1145
  });
1103
1146
  }
1104
1147
  function bt({ text: e, tone: t }) {
1105
1148
  let n = vt(e);
1106
- return /* @__PURE__ */ L(I, { children: n.map((e, n) => e.type === "code" ? /* @__PURE__ */ L(yt, {
1149
+ return /* @__PURE__ */ I(F, { children: n.map((e, n) => e.type === "code" ? /* @__PURE__ */ I(yt, {
1107
1150
  content: e.content,
1108
1151
  language: e.language
1109
- }, n) : e.content.trim() && /* @__PURE__ */ L(i, {
1152
+ }, n) : e.content.trim() && /* @__PURE__ */ I(i, {
1110
1153
  content: e.content.trim(),
1111
1154
  tone: t,
1112
1155
  className: "break-words text-xs leading-relaxed"
1113
1156
  }, n)) });
1114
1157
  }
1115
1158
  function xt() {
1116
- let [e] = F(() => Date.now()), [t, n] = F(e);
1159
+ let [e] = P(() => Date.now()), [t, n] = P(e);
1117
1160
  j(() => {
1118
1161
  let e = setInterval(() => n(Date.now()), 1e3);
1119
1162
  return () => clearInterval(e);
1120
1163
  }, []);
1121
1164
  let r = Math.floor((t - e) / 1e3);
1122
- return r < 10 ? null : /* @__PURE__ */ R("span", {
1165
+ return r < 10 ? null : /* @__PURE__ */ L("span", {
1123
1166
  className: "tabular-nums",
1124
1167
  children: [
1125
1168
  " · ",
@@ -1130,15 +1173,15 @@ function xt() {
1130
1173
  });
1131
1174
  }
1132
1175
  function St({ status: e }) {
1133
- return e === "running" ? /* @__PURE__ */ L("span", { className: "inline-block h-3 w-3 shrink-0 animate-spin rounded-full border-2 border-current border-t-transparent" }) : e === "done" ? /* @__PURE__ */ L(f, {
1176
+ return e === "running" ? /* @__PURE__ */ I("span", { className: "inline-block h-3 w-3 shrink-0 animate-spin rounded-full border-2 border-current border-t-transparent" }) : e === "done" ? /* @__PURE__ */ I(f, {
1134
1177
  name: "check",
1135
1178
  size: 12,
1136
1179
  className: "shrink-0 text-green-600"
1137
- }) : e === "stopped" ? /* @__PURE__ */ L(f, {
1180
+ }) : e === "stopped" ? /* @__PURE__ */ I(f, {
1138
1181
  name: "circle-slash",
1139
1182
  size: 12,
1140
1183
  className: "shrink-0 text-muted-foreground"
1141
- }) : /* @__PURE__ */ L(f, {
1184
+ }) : /* @__PURE__ */ I(f, {
1142
1185
  name: "x",
1143
1186
  size: 12,
1144
1187
  className: "shrink-0 text-destructive"
@@ -1149,25 +1192,25 @@ function Ct(e, t) {
1149
1192
  }
1150
1193
  var wt = 96, Tt = (e) => e.some((e) => e.status === "stopped" || e.status === "error");
1151
1194
  function Et({ previews: e }) {
1152
- let [t, n] = F(null);
1153
- return /* @__PURE__ */ R(I, { children: [/* @__PURE__ */ L("div", {
1195
+ let [t, n] = P(null);
1196
+ return /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I("div", {
1154
1197
  className: "flex flex-wrap gap-1.5",
1155
- children: e.map((e) => /* @__PURE__ */ L("button", {
1198
+ children: e.map((e) => /* @__PURE__ */ I("button", {
1156
1199
  type: "button",
1157
1200
  onClick: () => n(e),
1158
1201
  title: e.name,
1159
1202
  className: "overflow-hidden rounded-md border border-border/60 bg-background",
1160
- children: /* @__PURE__ */ L("img", {
1203
+ children: /* @__PURE__ */ I("img", {
1161
1204
  src: e.src,
1162
1205
  alt: e.name,
1163
1206
  className: "block max-h-40 max-w-full object-contain"
1164
1207
  })
1165
1208
  }, e.name))
1166
- }), t && /* @__PURE__ */ L(_, {
1209
+ }), t && /* @__PURE__ */ I(_, {
1167
1210
  title: t.name,
1168
1211
  size: "lg",
1169
1212
  onClose: () => n(null),
1170
- children: /* @__PURE__ */ L("img", {
1213
+ children: /* @__PURE__ */ I("img", {
1171
1214
  src: t.src,
1172
1215
  alt: t.name,
1173
1216
  className: "mx-auto block max-h-[70vh] max-w-full object-contain"
@@ -1175,13 +1218,13 @@ function Et({ previews: e }) {
1175
1218
  })] });
1176
1219
  }
1177
1220
  function Dt({ author: e, size: t = 20 }) {
1178
- return e.avatarUrl ? /* @__PURE__ */ L(m, {
1221
+ return e.avatarUrl ? /* @__PURE__ */ I(m, {
1179
1222
  src: e.avatarUrl,
1180
1223
  title: e.name,
1181
1224
  alt: e.name,
1182
1225
  width: t,
1183
1226
  height: t
1184
- }) : /* @__PURE__ */ L(p, {
1227
+ }) : /* @__PURE__ */ I(p, {
1185
1228
  value: e.name,
1186
1229
  size: t,
1187
1230
  title: e.name
@@ -1199,23 +1242,23 @@ function kt(e) {
1199
1242
  }
1200
1243
  function At({ parts: e, open: t, onToggle: n }) {
1201
1244
  let r = $(), i = e.filter((e) => e.type === "reasoning"), a = e.filter((e) => e.type === "tool"), o = i.some((e) => e.streaming), s = a.filter((e) => e.status === "running").at(-1), c = Math.round(i.reduce((e, t) => e + (t.duration ?? 0), 0)), l = [...i.length ? [o ? r.reasoningNow : c > 0 ? S(r.reasonedFor, { seconds: c }) : r.reasoned] : [], ...a.length ? [s?.label ?? (a.length === 1 ? r.oneStep : S(r.steps, { count: a.length }))] : []], u = o || !!s, d = a.some((e) => e.status === "error");
1202
- return /* @__PURE__ */ R("button", {
1245
+ return /* @__PURE__ */ L("button", {
1203
1246
  type: "button",
1204
1247
  onClick: n,
1205
1248
  "aria-expanded": t,
1206
1249
  title: r.processDetails,
1207
1250
  className: "inline-flex min-w-0 items-center gap-1 rounded text-xs text-muted-foreground hover:text-foreground",
1208
1251
  children: [
1209
- /* @__PURE__ */ L(f, {
1252
+ /* @__PURE__ */ I(f, {
1210
1253
  name: u ? "loader-circle" : d ? "circle-alert" : i.length ? "brain" : "list-checks",
1211
1254
  size: 12,
1212
1255
  className: `shrink-0 ${u ? "animate-spin" : ""}`
1213
1256
  }),
1214
- /* @__PURE__ */ L("span", {
1257
+ /* @__PURE__ */ I("span", {
1215
1258
  className: "truncate",
1216
1259
  children: l.join(" · ")
1217
1260
  }),
1218
- /* @__PURE__ */ L(f, {
1261
+ /* @__PURE__ */ I(f, {
1219
1262
  name: t ? "chevron-up" : "chevron-down",
1220
1263
  size: 12,
1221
1264
  className: "shrink-0"
@@ -1224,12 +1267,12 @@ function At({ parts: e, open: t, onToggle: n }) {
1224
1267
  });
1225
1268
  }
1226
1269
  function jt({ entry: e, pinned: n = !0, actions: r, cut: i = !1, showAuthor: a = !1 }) {
1227
- let o = $(), s = P(null), [c, l] = F(!1), [u, d] = F(!1);
1228
- M(() => {
1270
+ let o = $(), s = N(null), [c, l] = P(!1), [u, d] = P(!1);
1271
+ ne(() => {
1229
1272
  let e = s.current;
1230
1273
  e && d(e.scrollHeight > 97);
1231
1274
  }, [e.detail, e.attachmentNames]);
1232
- let p = u && !c, m = r?.available(e) && i ? /* @__PURE__ */ L(t, {
1275
+ let p = u && !c, m = r?.available(e) && i ? /* @__PURE__ */ I(t, {
1233
1276
  icon: "rotate-ccw",
1234
1277
  ariaLabel: o.retry,
1235
1278
  title: o.retry,
@@ -1237,9 +1280,9 @@ function jt({ entry: e, pinned: n = !0, actions: r, cut: i = !1, showAuthor: a =
1237
1280
  className: "p-1 text-muted-foreground hover:text-foreground",
1238
1281
  disabled: r.disabled,
1239
1282
  onClick: () => r.onRetry(e)
1240
- }) : null, h = r?.available(e) ? /* @__PURE__ */ L("span", {
1283
+ }) : null, h = r?.available(e) ? /* @__PURE__ */ I("span", {
1241
1284
  className: "opacity-0 transition-opacity focus-within:opacity-100 group-hover:opacity-100",
1242
- children: /* @__PURE__ */ L(t, {
1285
+ children: /* @__PURE__ */ I(t, {
1243
1286
  icon: "pencil",
1244
1287
  ariaLabel: o.editMessage,
1245
1288
  title: o.editMessage,
@@ -1248,50 +1291,50 @@ function jt({ entry: e, pinned: n = !0, actions: r, cut: i = !1, showAuthor: a =
1248
1291
  disabled: r.disabled,
1249
1292
  onClick: () => r.onEdit(e)
1250
1293
  })
1251
- }) : null, g = (t) => /* @__PURE__ */ R("div", {
1294
+ }) : null, g = (t) => /* @__PURE__ */ L("div", {
1252
1295
  className: `${t ? "w-full" : "max-w-[85%]"} rounded-lg bg-primary/10 text-xs text-foreground`,
1253
- children: [/* @__PURE__ */ R("div", {
1296
+ children: [/* @__PURE__ */ L("div", {
1254
1297
  ref: s,
1255
1298
  className: `space-y-1 px-2.5 pt-1.5 ${p ? "overflow-hidden" : ""}`,
1256
1299
  style: p ? { maxHeight: wt } : void 0,
1257
1300
  children: [
1258
- e.attachmentPreviews && e.attachmentPreviews.length > 0 && /* @__PURE__ */ L(Et, { previews: e.attachmentPreviews }),
1259
- e.attachmentNames && e.attachmentNames.some((t) => !e.attachmentPreviews?.some((e) => e.name === t)) && /* @__PURE__ */ L("div", {
1301
+ e.attachmentPreviews && e.attachmentPreviews.length > 0 && /* @__PURE__ */ I(Et, { previews: e.attachmentPreviews }),
1302
+ e.attachmentNames && e.attachmentNames.some((t) => !e.attachmentPreviews?.some((e) => e.name === t)) && /* @__PURE__ */ I("div", {
1260
1303
  className: "flex flex-wrap gap-1",
1261
- children: e.attachmentNames.filter((t) => !e.attachmentPreviews?.some((e) => e.name === t)).map((e, t) => /* @__PURE__ */ R("span", {
1304
+ children: e.attachmentNames.filter((t) => !e.attachmentPreviews?.some((e) => e.name === t)).map((e, t) => /* @__PURE__ */ L("span", {
1262
1305
  className: "inline-flex items-center gap-1 rounded-md bg-primary/15 px-1.5 py-0.5 text-[11px] text-foreground",
1263
- children: [/* @__PURE__ */ L(f, {
1306
+ children: [/* @__PURE__ */ I(f, {
1264
1307
  name: "paperclip",
1265
1308
  size: 10,
1266
1309
  className: "shrink-0"
1267
- }), /* @__PURE__ */ L("span", {
1310
+ }), /* @__PURE__ */ I("span", {
1268
1311
  className: "max-w-[160px] truncate",
1269
1312
  children: e
1270
1313
  })]
1271
1314
  }, t))
1272
1315
  }),
1273
- /* @__PURE__ */ L(bt, { text: e.detail ?? "" })
1316
+ /* @__PURE__ */ I(bt, { text: e.detail ?? "" })
1274
1317
  ]
1275
- }), u && /* @__PURE__ */ R("button", {
1318
+ }), u && /* @__PURE__ */ L("button", {
1276
1319
  type: "button",
1277
1320
  onClick: () => l((e) => !e),
1278
1321
  className: "relative flex w-full items-center justify-center rounded-b-lg py-1 text-muted-foreground hover:bg-primary/15",
1279
1322
  title: c ? "Comprimi" : "Espandi",
1280
- children: [p && /* @__PURE__ */ L("div", { className: "pointer-events-none absolute inset-x-0 -top-4 h-4 bg-gradient-to-t from-primary/10 to-transparent" }), /* @__PURE__ */ L(f, {
1323
+ children: [p && /* @__PURE__ */ I("div", { className: "pointer-events-none absolute inset-x-0 -top-4 h-4 bg-gradient-to-t from-primary/10 to-transparent" }), /* @__PURE__ */ I(f, {
1281
1324
  name: c ? "chevron-up" : "chevron-down",
1282
1325
  size: 12
1283
1326
  })]
1284
1327
  })]
1285
1328
  });
1286
- return a ? /* @__PURE__ */ R("div", {
1329
+ return a ? /* @__PURE__ */ L("div", {
1287
1330
  className: `${n ? "sticky top-0 z-20 border-b border-border/40" : ""} group flex items-start gap-2 bg-background py-1.5`,
1288
- children: [/* @__PURE__ */ R("span", {
1331
+ children: [/* @__PURE__ */ L("span", {
1289
1332
  className: `flex shrink-0 flex-col items-center ${Ot}`,
1290
1333
  children: [
1291
- e.author ? /* @__PURE__ */ L(Dt, { author: e.author }) : /* @__PURE__ */ L("span", {
1334
+ e.author ? /* @__PURE__ */ I(Dt, { author: e.author }) : /* @__PURE__ */ I("span", {
1292
1335
  className: "flex h-5 w-5 items-center justify-center rounded-full bg-muted text-muted-foreground",
1293
1336
  "aria-hidden": !0,
1294
- children: /* @__PURE__ */ L(f, {
1337
+ children: /* @__PURE__ */ I(f, {
1295
1338
  name: "user",
1296
1339
  size: 12
1297
1340
  })
@@ -1299,16 +1342,16 @@ function jt({ entry: e, pinned: n = !0, actions: r, cut: i = !1, showAuthor: a =
1299
1342
  m,
1300
1343
  h
1301
1344
  ]
1302
- }), /* @__PURE__ */ R("div", {
1345
+ }), /* @__PURE__ */ L("div", {
1303
1346
  className: "min-w-0 flex-1",
1304
- children: [e.author && /* @__PURE__ */ L("div", {
1347
+ children: [e.author && /* @__PURE__ */ I("div", {
1305
1348
  className: "pb-0.5 text-xs font-medium text-foreground",
1306
1349
  children: e.author.name
1307
1350
  }), g(!0)]
1308
1351
  })]
1309
- }) : /* @__PURE__ */ R("div", {
1352
+ }) : /* @__PURE__ */ L("div", {
1310
1353
  className: `${n ? "sticky top-0 z-20 border-b border-border/40" : ""} group flex items-start justify-end gap-1 bg-background py-1.5`,
1311
- children: [r?.available(e) && /* @__PURE__ */ R("span", {
1354
+ children: [r?.available(e) && /* @__PURE__ */ L("span", {
1312
1355
  className: "flex shrink-0 items-center",
1313
1356
  children: [m, h]
1314
1357
  }), g(!1)]
@@ -1322,7 +1365,7 @@ var Mt = {
1322
1365
  };
1323
1366
  function Nt({ steps: e }) {
1324
1367
  let t = $(), n = e.filter((e) => e.status === "running").at(-1), r = e.some((e) => e.status === "error"), i = n?.label ?? (e.length === 1 ? t.oneStep : S(t.steps, { count: e.length }));
1325
- return /* @__PURE__ */ L(b, {
1368
+ return /* @__PURE__ */ I(b, {
1326
1369
  ariaLabel: t.stepsLabel,
1327
1370
  selectedId: null,
1328
1371
  itemClassName: "py-0.5 text-xs text-muted-foreground",
@@ -1332,7 +1375,7 @@ function Nt({ steps: e }) {
1332
1375
  icon: n ? "loader-circle" : r ? "circle-alert" : "list-checks",
1333
1376
  children: e.map((e) => ({
1334
1377
  id: e.id,
1335
- label: /* @__PURE__ */ L("span", {
1378
+ label: /* @__PURE__ */ I("span", {
1336
1379
  className: e.status === "error" ? "text-destructive" : void 0,
1337
1380
  children: e.label
1338
1381
  }),
@@ -1342,30 +1385,30 @@ function Nt({ steps: e }) {
1342
1385
  });
1343
1386
  }
1344
1387
  function Pt({ entry: e, part: a, questions: o }) {
1345
- let s = $(), [c, l] = F(!1), u = !!(o?.onCardAction && o.canAnswer(e.id) && !a.outcome), d = a.outcome?.status === "done" ? "text-success" : a.outcome?.status === "error" ? "text-destructive" : "text-muted-foreground";
1346
- return /* @__PURE__ */ R(r, {
1388
+ let s = $(), [c, l] = P(!1), u = !!(o?.onCardAction && o.canAnswer(e.id) && !a.outcome), d = a.outcome?.status === "done" ? "text-success" : a.outcome?.status === "error" ? "text-destructive" : "text-muted-foreground";
1389
+ return /* @__PURE__ */ L(r, {
1347
1390
  headerClassName: "flex items-center justify-between gap-2 px-3 py-2",
1348
1391
  bodyClassName: "px-3 py-2",
1349
- header: /* @__PURE__ */ R(I, { children: [/* @__PURE__ */ L("span", {
1392
+ header: /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I("span", {
1350
1393
  className: "min-w-0 text-xs font-semibold text-foreground",
1351
1394
  children: a.title
1352
- }), a.badge && /* @__PURE__ */ L(n, {
1395
+ }), a.badge && /* @__PURE__ */ I(n, {
1353
1396
  variant: a.badge.variant ?? "info",
1354
1397
  children: a.badge.label
1355
1398
  })] }),
1356
- footer: /* @__PURE__ */ R("div", {
1399
+ footer: /* @__PURE__ */ L("div", {
1357
1400
  className: "space-y-1.5 px-3 py-2",
1358
- children: [/* @__PURE__ */ R("div", {
1401
+ children: [/* @__PURE__ */ L("div", {
1359
1402
  className: "flex items-center gap-1",
1360
1403
  children: [
1361
- a.details && /* @__PURE__ */ L(t, {
1404
+ a.details && /* @__PURE__ */ I(t, {
1362
1405
  icon: "eye",
1363
1406
  ariaLabel: s.cardView,
1364
1407
  title: s.cardView,
1365
1408
  variant: "outline-secondary",
1366
1409
  onClick: () => l(!0)
1367
1410
  }),
1368
- (a.actions ?? []).filter((e) => e.variant !== "primary" && e.icon).map((t) => /* @__PURE__ */ L(g, {
1411
+ (a.actions ?? []).filter((e) => e.variant !== "primary" && e.icon).map((t) => /* @__PURE__ */ I(g, {
1369
1412
  icon: t.icon,
1370
1413
  ariaLabel: t.label,
1371
1414
  title: t.label,
@@ -1373,9 +1416,9 @@ function Pt({ entry: e, part: a, questions: o }) {
1373
1416
  disabled: !u,
1374
1417
  onClick: () => o.onCardAction(e.id, a.id, t.id)
1375
1418
  }, t.id)),
1376
- /* @__PURE__ */ L("span", {
1419
+ /* @__PURE__ */ I("span", {
1377
1420
  className: "ms-auto flex items-center gap-1",
1378
- children: (a.actions ?? []).filter((e) => e.variant === "primary" || !e.icon).map((t) => /* @__PURE__ */ L(g, {
1421
+ children: (a.actions ?? []).filter((e) => e.variant === "primary" || !e.icon).map((t) => /* @__PURE__ */ I(g, {
1379
1422
  ...t.icon ? { icon: t.icon } : {},
1380
1423
  label: t.label,
1381
1424
  variant: t.variant ?? "outline-primary",
@@ -1384,9 +1427,9 @@ function Pt({ entry: e, part: a, questions: o }) {
1384
1427
  }, t.id))
1385
1428
  })
1386
1429
  ]
1387
- }), a.outcome && /* @__PURE__ */ R("p", {
1430
+ }), a.outcome && /* @__PURE__ */ L("p", {
1388
1431
  className: `text-xs ${d}`,
1389
- children: [a.outcome.text, a.outcome.link && /* @__PURE__ */ R(I, { children: [" ", /* @__PURE__ */ L("a", {
1432
+ children: [a.outcome.text, a.outcome.link && /* @__PURE__ */ L(F, { children: [" ", /* @__PURE__ */ I("a", {
1390
1433
  className: "underline",
1391
1434
  href: a.outcome.link.url,
1392
1435
  target: "_blank",
@@ -1395,20 +1438,20 @@ function Pt({ entry: e, part: a, questions: o }) {
1395
1438
  })] })]
1396
1439
  })]
1397
1440
  }),
1398
- children: [a.body ? /* @__PURE__ */ L(i, {
1441
+ children: [a.body ? /* @__PURE__ */ I(i, {
1399
1442
  content: a.body,
1400
1443
  className: "break-words text-xs leading-relaxed text-foreground"
1401
- }) : null, c && a.details && /* @__PURE__ */ L(_, {
1444
+ }) : null, c && a.details && /* @__PURE__ */ I(_, {
1402
1445
  title: a.title,
1403
1446
  position: "right",
1404
1447
  size: "lg",
1405
1448
  onClose: () => l(!1),
1406
- footer: /* @__PURE__ */ L(t, {
1449
+ footer: /* @__PURE__ */ I(t, {
1407
1450
  label: s.cardClose,
1408
1451
  variant: "outline-secondary",
1409
1452
  onClick: () => l(!1)
1410
1453
  }),
1411
- children: /* @__PURE__ */ L(i, {
1454
+ children: /* @__PURE__ */ I(i, {
1412
1455
  content: a.details,
1413
1456
  className: "break-words text-sm leading-relaxed text-foreground"
1414
1457
  })
@@ -1426,7 +1469,7 @@ function Ft(e, t) {
1426
1469
  }
1427
1470
  function It({ entry: e, part: t, questions: n, autoFocus: r, className: i }) {
1428
1471
  let o = !!n?.canAnswer(e.id);
1429
- return /* @__PURE__ */ L(a, {
1472
+ return /* @__PURE__ */ I(a, {
1430
1473
  questions: t.questions,
1431
1474
  ...t.answers ? { answers: t.answers } : {},
1432
1475
  disabled: !t.answers && !o,
@@ -1447,25 +1490,25 @@ function Lt({ entry: e, questions: t, hiddenPartId: n, skip: r }) {
1447
1490
  part: e
1448
1491
  });
1449
1492
  }
1450
- return /* @__PURE__ */ L("div", {
1493
+ return /* @__PURE__ */ I("div", {
1451
1494
  className: "space-y-2",
1452
1495
  children: s.map((n) => {
1453
- if ("steps" in n) return /* @__PURE__ */ L(Nt, { steps: n.steps }, n.key);
1496
+ if ("steps" in n) return /* @__PURE__ */ I(Nt, { steps: n.steps }, n.key);
1454
1497
  let { part: r } = n;
1455
- return r.type === "text" ? r.text.trim() ? /* @__PURE__ */ L(i, {
1498
+ return r.type === "text" ? r.text.trim() ? /* @__PURE__ */ I(i, {
1456
1499
  content: r.text,
1457
1500
  streaming: r.streaming,
1458
1501
  className: "break-words text-xs leading-relaxed text-foreground"
1459
- }, n.key) : null : r.type === "reasoning" ? /* @__PURE__ */ L(o, {
1502
+ }, n.key) : null : r.type === "reasoning" ? /* @__PURE__ */ I(o, {
1460
1503
  content: r.text,
1461
1504
  streaming: r.streaming,
1462
1505
  duration: r.duration,
1463
1506
  className: "my-0"
1464
- }, n.key) : r.type === "card" ? /* @__PURE__ */ L(Pt, {
1507
+ }, n.key) : r.type === "card" ? /* @__PURE__ */ I(Pt, {
1465
1508
  entry: e,
1466
1509
  part: r,
1467
1510
  questions: t
1468
- }, n.key) : /* @__PURE__ */ L(It, {
1511
+ }, n.key) : /* @__PURE__ */ I(It, {
1469
1512
  entry: e,
1470
1513
  part: r,
1471
1514
  questions: t
@@ -1477,49 +1520,49 @@ function Rt({ entry: e, questions: t, hiddenPartId: n, skip: r }) {
1477
1520
  let a = $();
1478
1521
  if (e.kind === "thinking" && e.parts) {
1479
1522
  let i = e.status === "error" || e.status === "stopped" || e.status === "running", o = r ? e.parts.filter((e) => !r.has(e.id)).length : e.parts.length;
1480
- return /* @__PURE__ */ R("li", {
1523
+ return /* @__PURE__ */ L("li", {
1481
1524
  className: "text-xs text-muted-foreground",
1482
- children: [o > 0 && /* @__PURE__ */ L(Lt, {
1525
+ children: [o > 0 && /* @__PURE__ */ I(Lt, {
1483
1526
  entry: e,
1484
1527
  questions: t,
1485
1528
  hiddenPartId: n,
1486
1529
  skip: r
1487
- }), i && /* @__PURE__ */ R("div", {
1530
+ }), i && /* @__PURE__ */ L("div", {
1488
1531
  className: `flex items-start gap-1.5 ${o > 0 ? "mt-1" : ""}`,
1489
- children: [/* @__PURE__ */ L("span", {
1532
+ children: [/* @__PURE__ */ I("span", {
1490
1533
  className: "pt-px",
1491
- children: /* @__PURE__ */ L(St, { status: e.status })
1492
- }), /* @__PURE__ */ R("span", {
1534
+ children: /* @__PURE__ */ I(St, { status: e.status })
1535
+ }), /* @__PURE__ */ L("span", {
1493
1536
  className: "min-w-0 flex-1 whitespace-pre-wrap break-words",
1494
- children: [Ct(e, a), e.status === "running" && /* @__PURE__ */ L(xt, {})]
1537
+ children: [Ct(e, a), e.status === "running" && /* @__PURE__ */ I(xt, {})]
1495
1538
  })]
1496
1539
  })]
1497
1540
  });
1498
1541
  }
1499
1542
  let o = e.kind === "thinking" && e.detail ? vt(e.detail) : [], s = o.filter((e) => e.type === "code"), c = o.filter((e) => e.type === "text" && e.content.trim()), l = e.kind === "thinking" ? Ct(e, a) : e.label;
1500
- return /* @__PURE__ */ R("li", {
1543
+ return /* @__PURE__ */ L("li", {
1501
1544
  className: "text-xs text-muted-foreground",
1502
1545
  children: [
1503
- /* @__PURE__ */ R("div", {
1546
+ /* @__PURE__ */ L("div", {
1504
1547
  className: "flex items-start gap-1.5",
1505
- children: [/* @__PURE__ */ L("span", {
1548
+ children: [/* @__PURE__ */ I("span", {
1506
1549
  className: "pt-px",
1507
- children: /* @__PURE__ */ L(St, { status: e.status })
1508
- }), /* @__PURE__ */ L("span", {
1550
+ children: /* @__PURE__ */ I(St, { status: e.status })
1551
+ }), /* @__PURE__ */ I("span", {
1509
1552
  className: "min-w-0 flex-1 whitespace-pre-wrap break-words",
1510
1553
  children: l
1511
1554
  })]
1512
1555
  }),
1513
- s.length > 0 && /* @__PURE__ */ L("div", {
1556
+ s.length > 0 && /* @__PURE__ */ I("div", {
1514
1557
  className: "mt-1 ml-[18px] space-y-1",
1515
- children: s.map((e, t) => /* @__PURE__ */ L(yt, {
1558
+ children: s.map((e, t) => /* @__PURE__ */ I(yt, {
1516
1559
  content: e.content,
1517
1560
  language: e.language
1518
1561
  }, t))
1519
1562
  }),
1520
- c.length > 0 && /* @__PURE__ */ L("div", {
1563
+ c.length > 0 && /* @__PURE__ */ I("div", {
1521
1564
  className: "mt-1 ml-[18px] space-y-2",
1522
- children: c.map((e, t) => /* @__PURE__ */ L(i, {
1565
+ children: c.map((e, t) => /* @__PURE__ */ I(i, {
1523
1566
  content: e.content.trim(),
1524
1567
  tone: "muted",
1525
1568
  className: "break-words text-xs leading-relaxed"
@@ -1529,20 +1572,20 @@ function Rt({ entry: e, questions: t, hiddenPartId: n, skip: r }) {
1529
1572
  });
1530
1573
  }
1531
1574
  function zt({ parts: e }) {
1532
- return /* @__PURE__ */ L("div", {
1575
+ return /* @__PURE__ */ I("div", {
1533
1576
  className: "mb-1 space-y-1 border-l-2 border-border pl-2 text-xs text-muted-foreground",
1534
- children: e.map((e) => e.type === "reasoning" ? /* @__PURE__ */ L(i, {
1577
+ children: e.map((e) => e.type === "reasoning" ? /* @__PURE__ */ I(i, {
1535
1578
  content: e.text,
1536
1579
  tone: "muted",
1537
1580
  streaming: e.streaming,
1538
1581
  className: "break-words text-xs leading-relaxed"
1539
- }, e.id) : e.type === "tool" ? /* @__PURE__ */ R("div", {
1582
+ }, e.id) : e.type === "tool" ? /* @__PURE__ */ L("div", {
1540
1583
  className: "flex items-start gap-1.5",
1541
- children: [/* @__PURE__ */ L(f, {
1584
+ children: [/* @__PURE__ */ I(f, {
1542
1585
  name: Mt[e.status],
1543
1586
  size: 12,
1544
1587
  className: `mt-0.5 shrink-0 ${e.status === "running" ? "animate-spin" : ""}`
1545
- }), /* @__PURE__ */ L("span", {
1588
+ }), /* @__PURE__ */ I("span", {
1546
1589
  className: `min-w-0 break-words ${e.status === "error" ? "text-destructive" : ""}`,
1547
1590
  children: e.label
1548
1591
  })]
@@ -1550,30 +1593,30 @@ function zt({ parts: e }) {
1550
1593
  });
1551
1594
  }
1552
1595
  function Bt({ speaker: e, entries: t, questions: n, docked: r }) {
1553
- let i = kt(t[0]), a = i.length ? new Set(i.map((e) => e.id)) : void 0, [o, s] = F(!1);
1554
- return /* @__PURE__ */ R("div", {
1596
+ let i = kt(t[0]), a = i.length ? new Set(i.map((e) => e.id)) : void 0, [o, s] = P(!1);
1597
+ return /* @__PURE__ */ L("div", {
1555
1598
  className: "flex items-start gap-2 pt-1.5",
1556
- children: [/* @__PURE__ */ L("span", {
1599
+ children: [/* @__PURE__ */ I("span", {
1557
1600
  className: `flex shrink-0 justify-center pt-px ${Ot}`,
1558
- children: /* @__PURE__ */ L(Dt, { author: e })
1559
- }), /* @__PURE__ */ R("div", {
1601
+ children: /* @__PURE__ */ I(Dt, { author: e })
1602
+ }), /* @__PURE__ */ L("div", {
1560
1603
  className: "min-w-0 flex-1",
1561
1604
  children: [
1562
- /* @__PURE__ */ R("div", {
1605
+ /* @__PURE__ */ L("div", {
1563
1606
  className: "flex min-w-0 flex-wrap items-center gap-x-2 pb-0.5",
1564
- children: [/* @__PURE__ */ L("span", {
1607
+ children: [/* @__PURE__ */ I("span", {
1565
1608
  className: "truncate text-xs font-medium text-foreground",
1566
1609
  children: e.name
1567
- }), i.length > 0 && /* @__PURE__ */ L(At, {
1610
+ }), i.length > 0 && /* @__PURE__ */ I(At, {
1568
1611
  parts: i,
1569
1612
  open: o,
1570
1613
  onToggle: () => s((e) => !e)
1571
1614
  })]
1572
1615
  }),
1573
- o && i.length > 0 && /* @__PURE__ */ L(zt, { parts: i }),
1574
- /* @__PURE__ */ L("ul", {
1616
+ o && i.length > 0 && /* @__PURE__ */ I(zt, { parts: i }),
1617
+ /* @__PURE__ */ I("ul", {
1575
1618
  className: "space-y-0.5",
1576
- children: t.map((e, t) => /* @__PURE__ */ L(Rt, {
1619
+ children: t.map((e, t) => /* @__PURE__ */ I(Rt, {
1577
1620
  entry: e,
1578
1621
  questions: n,
1579
1622
  hiddenPartId: r?.entry.id === e.id ? r.part.id : void 0,
@@ -1592,27 +1635,27 @@ function Vt({ activity: e, questions: t, docked: n, pinUserMessages: r = !0, mes
1592
1635
  entries: []
1593
1636
  } : { entries: [t] }) : l[l.length - 1].entries.push(t);
1594
1637
  let u = rt(l.map((e) => (e.user ?? e.entries[0])?.at), s ?? []);
1595
- return /* @__PURE__ */ R("ul", {
1638
+ return /* @__PURE__ */ L("ul", {
1596
1639
  className: "space-y-0.5",
1597
- children: [l.map((e, o) => /* @__PURE__ */ R(O.Fragment, { children: [u[o].map((e) => /* @__PURE__ */ L(gt, { event: e }, e.id)), /* @__PURE__ */ R("li", { children: [e.user && /* @__PURE__ */ L(jt, {
1640
+ children: [l.map((e, o) => /* @__PURE__ */ L(O.Fragment, { children: [u[o].map((e) => /* @__PURE__ */ I(gt, { event: e }, e.id)), /* @__PURE__ */ L("li", { children: [e.user && /* @__PURE__ */ I(jt, {
1598
1641
  entry: e.user,
1599
1642
  pinned: r,
1600
1643
  actions: i,
1601
1644
  cut: Tt(e.entries),
1602
1645
  showAuthor: c
1603
- }), a && e.entries.length > 0 ? /* @__PURE__ */ L(Bt, {
1646
+ }), a && e.entries.length > 0 ? /* @__PURE__ */ I(Bt, {
1604
1647
  speaker: a,
1605
1648
  entries: e.entries,
1606
1649
  questions: t,
1607
1650
  docked: n
1608
- }) : e.entries.length > 0 && /* @__PURE__ */ L("ul", {
1651
+ }) : e.entries.length > 0 && /* @__PURE__ */ I("ul", {
1609
1652
  className: "space-y-0.5",
1610
- children: e.entries.map((e) => /* @__PURE__ */ L(Rt, {
1653
+ children: e.entries.map((e) => /* @__PURE__ */ I(Rt, {
1611
1654
  entry: e,
1612
1655
  questions: t,
1613
1656
  hiddenPartId: n?.entry.id === e.id ? n.part.id : void 0
1614
1657
  }, e.id))
1615
- })] })] }, e.user?.id ?? e.entries[0]?.id)), u[l.length].map((e) => /* @__PURE__ */ L(gt, { event: e }, e.id))]
1658
+ })] })] }, e.user?.id ?? e.entries[0]?.id)), u[l.length].map((e) => /* @__PURE__ */ I(gt, { event: e }, e.id))]
1616
1659
  });
1617
1660
  }
1618
1661
  //#endregion
@@ -1643,7 +1686,7 @@ function Xt() {
1643
1686
  return typeof window > "u" ? Infinity : window.innerWidth;
1644
1687
  }
1645
1688
  function Zt({ defaultWidth: e = 420, minWidth: t = 320, maxWidth: n = Wt, onWidthChange: r }) {
1646
- let [i, a] = F(Xt), [o, s] = F(() => Jt() ?? e);
1689
+ let [i, a] = P(Xt), [o, s] = P(() => Jt() ?? e);
1647
1690
  j(() => {
1648
1691
  if (typeof window > "u") return;
1649
1692
  let e = () => a(window.innerWidth);
@@ -1666,7 +1709,7 @@ function Zt({ defaultWidth: e = 420, minWidth: t = 320, maxWidth: n = Wt, onWidt
1666
1709
  //#endregion
1667
1710
  //#region src/presentation/AgenticoResizeHandle.tsx
1668
1711
  function Qt({ width: e, min: t, max: n, onResize: r, onCommit: i, onReset: a }) {
1669
- let o = $(), s = P(null), [c, l] = F(!1), u = (e) => Math.round(Math.min(Math.max(e, t), Math.max(t, n))), d = (e) => {
1712
+ let o = $(), s = N(null), [c, l] = P(!1), u = (e) => Math.round(Math.min(Math.max(e, t), Math.max(t, n))), d = (e) => {
1670
1713
  let t = s.current;
1671
1714
  if (t && t.pointerId === e.pointerId) {
1672
1715
  s.current = null, l(!1), document.body.style.removeProperty("cursor"), document.body.style.removeProperty("user-select");
@@ -1676,7 +1719,7 @@ function Qt({ width: e, min: t, max: n, onResize: r, onCommit: i, onReset: a })
1676
1719
  i(t.last);
1677
1720
  }
1678
1721
  };
1679
- return /* @__PURE__ */ L("div", {
1722
+ return /* @__PURE__ */ I("div", {
1680
1723
  role: "separator",
1681
1724
  "aria-orientation": "vertical",
1682
1725
  "aria-label": o.resizePanel,
@@ -1715,7 +1758,7 @@ function Qt({ width: e, min: t, max: n, onResize: r, onCommit: i, onReset: a })
1715
1758
  let c = u(s);
1716
1759
  r(c), i(c);
1717
1760
  },
1718
- children: /* @__PURE__ */ L("span", {
1761
+ children: /* @__PURE__ */ I("span", {
1719
1762
  "aria-hidden": !0,
1720
1763
  className: `h-full w-0.5 transition-colors ${c ? "bg-primary" : "bg-transparent group-hover:bg-primary/50 group-focus-visible:bg-primary"}`
1721
1764
  })
@@ -1725,7 +1768,7 @@ function Qt({ width: e, min: t, max: n, onResize: r, onCommit: i, onReset: a })
1725
1768
  //#region src/presentation/AgenticoToggle.tsx
1726
1769
  function $t({ className: e = "" }) {
1727
1770
  let { isOpen: n, toggleOpen: r, task: i } = ft(), a = $(), o = i?.agent.running ?? !1;
1728
- return /* @__PURE__ */ L(t, {
1771
+ return /* @__PURE__ */ I(t, {
1729
1772
  icon: "bot",
1730
1773
  ariaLabel: n ? a.closePanel : a.openPanel,
1731
1774
  title: n ? a.closePanel : a.openPanel,
@@ -1750,7 +1793,7 @@ function nn(e) {
1750
1793
  } catch {}
1751
1794
  }
1752
1795
  function rn() {
1753
- let e = T()?.registry ?? {}, t = Object.keys(e).length > 0, [n, r] = F({}), [i, a] = F(!1), [o, s] = F(tn);
1796
+ let e = T()?.registry ?? {}, t = Object.keys(e).length > 0, [n, r] = P({}), [i, a] = P(!1), [o, s] = P(tn);
1754
1797
  return j(() => {
1755
1798
  if (!t) {
1756
1799
  r({});
@@ -1812,9 +1855,9 @@ function dn(e) {
1812
1855
  });
1813
1856
  }
1814
1857
  function fn(e, t = {}) {
1815
- let { defaultEnabled: n = !1 } = t, r = P(t.author);
1858
+ let { defaultEnabled: n = !1 } = t, r = N(t.author);
1816
1859
  r.current = t.author;
1817
- let [i, a] = F(n), { hasProviders: o, modelsByProvider: s, modelsLoading: c, selectedModel: l, setSelectedModel: u } = rn(), [d, f] = F(!1), [p, m] = F(null), [h, g] = F(!1), [_, v] = F([]), b = P([]), x = (e, t) => {
1860
+ let [i, a] = P(n), { hasProviders: o, modelsByProvider: s, modelsLoading: c, selectedModel: l, setSelectedModel: u } = rn(), [d, f] = P(!1), [p, m] = P(null), [h, g] = P(!1), [_, v] = P([]), b = N([]), x = (e, t) => {
1818
1861
  v((n) => {
1819
1862
  let r = typeof e == "function" ? e(n) : e;
1820
1863
  if (t?.stamp !== !1) {
@@ -1836,23 +1879,23 @@ function fn(e, t = {}) {
1836
1879
  attachmentPreviews: t
1837
1880
  } : n));
1838
1881
  });
1839
- }, w = P(/* @__PURE__ */ new Map()), ee = $(), E = P(ee);
1882
+ }, w = N(/* @__PURE__ */ new Map()), ee = $(), E = N(ee);
1840
1883
  E.current = ee;
1841
- let D = P(null), O = P(!1), te = P(null), k = P(null), A = P(null), j = () => {
1884
+ let D = N(null), O = N(!1), te = N(null), k = N(null), A = N(null), j = () => {
1842
1885
  A.current?.abort();
1843
- }, M = T()?.registry ?? {}, [I, L] = F(void 0), R = P(void 0), z = (e, t) => {
1886
+ }, ne = T()?.registry ?? {}, [F, I] = P(void 0), L = N(void 0), R = (e, t) => {
1844
1887
  if (!t) return !1;
1845
1888
  if (!e) return !0;
1846
1889
  let n = C(t);
1847
1890
  return !!n && e.includes(n.provider);
1848
- }, ie = N(() => I ? Object.fromEntries(Object.entries(s).map(([e, t]) => [e, t.filter((e) => I.includes(e.provider))]).filter(([, e]) => e.length)) : s, [I, s]), H = z(I, l) ? l : Object.values(ie).flat()[0]?.id ?? "", U = i && H ? C(H) : null, ae = U ? M[U.provider] : null, W = e.executor, G = !!W?.alongside, K = !!W && !G, oe = !W || !!W.canRewind, ce = !!W?.attachments, le = async (e) => ce && e?.length ? Promise.all(e.map((e) => y.fileToAttachment(e))) : void 0, ue = P([]), de = (e) => !!e && ue.current.some((t) => t.value === e), q = P(!1), [fe, pe] = F([]), [me, he] = F(""), Y = P(""), ge = (e) => {
1891
+ }, V = M(() => F ? Object.fromEntries(Object.entries(s).map(([e, t]) => [e, t.filter((e) => F.includes(e.provider))]).filter(([, e]) => e.length)) : s, [F, s]), H = R(F, l) ? l : Object.values(V).flat()[0]?.id ?? "", U = i && H ? C(H) : null, ae = U ? ne[U.provider] : null, W = e.executor, G = !!W?.alongside, K = !!W && !G, q = !W || !!W.canRewind, se = !!W?.attachments, ce = async (e) => se && e?.length ? Promise.all(e.map((e) => y.fileToAttachment(e))) : void 0, le = N([]), ue = (e) => !!e && le.current.some((t) => t.value === e), de = N(!1), [fe, pe] = P([]), [me, he] = P(""), Y = N(""), ge = (e) => {
1849
1892
  Y.current = e, he(e);
1850
1893
  }, _e = (e) => {
1851
1894
  let t = W?.models?.(e) ?? [];
1852
- ue.current = t, pe(t);
1895
+ le.current = t, pe(t);
1853
1896
  let n = W?.catalogProviders?.(e);
1854
- R.current = n, L(n);
1855
- let r = G && !z(n, l) ? t[0]?.value : void 0;
1897
+ L.current = n, I(n);
1898
+ let r = G && !R(n, l) ? t[0]?.value : void 0;
1856
1899
  ge(W?.defaultModel?.(e) ?? r ?? "");
1857
1900
  }, X = async (e, t, n, r, i) => {
1858
1901
  let a = D.current;
@@ -1873,14 +1916,14 @@ function fn(e, t = {}) {
1873
1916
  duration: e.duration ?? l(e.id)
1874
1917
  }), d = (e, t) => x((n) => n.map((n) => {
1875
1918
  if (n.id !== s) return n;
1876
- let r = e(n.parts ?? []), i = V(r);
1919
+ let r = e(n.parts ?? []), i = z(r);
1877
1920
  return {
1878
1921
  ...n,
1879
1922
  parts: r,
1880
1923
  ...t ? { status: t } : {},
1881
1924
  ...i ? { detail: i } : {}
1882
1925
  };
1883
- })), f = (e) => d((t) => B(t, e, u)), p = !1, h = (e, t) => {
1926
+ })), f = (e) => d((t) => ie(t, e, u)), p = !1, h = (e, t) => {
1884
1927
  t?.id && t.id !== "text" && (p = !0), f({
1885
1928
  type: "text",
1886
1929
  id: t?.id ?? "text",
@@ -1928,9 +1971,9 @@ function fn(e, t = {}) {
1928
1971
  });
1929
1972
  }));
1930
1973
  }, ee = (e, t) => {
1931
- d((n) => (t && !p ? B(n, {
1974
+ d((n) => (t && !p ? ie(n, {
1932
1975
  type: "text",
1933
- id: ne,
1976
+ id: re,
1934
1977
  text: t,
1935
1978
  streaming: !1
1936
1979
  }, u) : n).map((t) => t.type === "reasoning" && t.streaming ? u(t) : t.type === "text" && t.streaming ? {
@@ -2021,21 +2064,21 @@ function fn(e, t = {}) {
2021
2064
  return await X("", !1, void 0, {
2022
2065
  id: t,
2023
2066
  answers: n,
2024
- historyText: re(r.questions, n)
2067
+ historyText: B(r.questions, n)
2025
2068
  });
2026
2069
  } finally {
2027
2070
  O.current = !1, f(!1);
2028
2071
  }
2029
2072
  }, Se = async (t, n, r) => {
2030
- let i = R.current, a = Object.values(s).flat().find((e) => !i || i.includes(e.provider))?.id, o = r && z(i, r) ? r : z(i, H) ? void 0 : a, c = o ? C(o) : U, l = c && D.current ? W?.catalogReasoning?.(D.current.params, c.provider) : void 0, u = l ? { reasoning: l } : {}, d = D.current;
2073
+ let i = L.current, a = Object.values(s).flat().find((e) => !i || i.includes(e.provider))?.id, o = r && R(i, r) ? r : R(i, H) ? void 0 : a, c = o ? C(o) : U, l = c && D.current ? W?.catalogReasoning?.(D.current.params, c.provider) : void 0, u = l ? { reasoning: l } : {}, d = D.current;
2031
2074
  if (!d) return m(E.current.noActiveSession), null;
2032
- let f = o ? C(o) : U, p = f ? M[f.provider] : null;
2075
+ let f = o ? C(o) : U, p = f ? ne[f.provider] : null;
2033
2076
  if (!p || !f) return m(E.current.noProviderAvailable), null;
2034
2077
  n?.length && (d.attachmentsRef.current = [...d.attachmentsRef.current ?? [], ...n]);
2035
2078
  let h = (n ?? []).filter((e) => y.isTextAttachment(e.mimeType)).map((e) => e.base64.length <= ln ? `\n\n[File allegato: ${e.name}]\n${y.decodeBase64Text(e.base64)}` : `\n\n[File allegato: ${e.name} — troppo grande per essere incollato qui. Usa uno dei tool di lettura file disponibili (es. list_csv_columns/extract_csv_column) per leggerne il contenuto prima di chiedere altro all'utente.]`).join(""), g = un(n ?? []), _ = d.tools.map((e) => ({
2036
2079
  name: e.name,
2037
2080
  description: e.description,
2038
- inputSchema: se(e.inputSchema)
2081
+ inputSchema: oe(e.inputSchema)
2039
2082
  })), v = (e, t, n, r) => {
2040
2083
  let i = E.current, a = `approval-${e}`, o = t.describeApproval?.(n) ?? t.describeInvocation?.(n) ?? t.name;
2041
2084
  x((e) => [...e, {
@@ -2272,13 +2315,13 @@ function fn(e, t = {}) {
2272
2315
  history: [],
2273
2316
  logId: crypto.randomUUID(),
2274
2317
  attachmentsRef: a
2275
- }, K) return g(!0), _e(t), await X(n?.openingMessage ?? "", !0, void 0, void 0, await le(n?.attachments));
2318
+ }, K) return g(!0), _e(t), await X(n?.openingMessage ?? "", !0, void 0, void 0, await ce(n?.attachments));
2276
2319
  if (G) {
2277
- _e(t), q.current = !1;
2320
+ _e(t), de.current = !1;
2278
2321
  let e = n?.model || Y.current;
2279
- if (de(e)) return g(!0), q.current = !0, await X(n?.openingMessage ?? "", !0, e, void 0, await le(n?.attachments));
2322
+ if (ue(e)) return g(!0), de.current = !0, await X(n?.openingMessage ?? "", !0, e, void 0, await ce(n?.attachments));
2280
2323
  }
2281
- let s = n?.model || void 0, c = s ? !!M[C(s)?.provider ?? ""] : !!ae;
2324
+ let s = n?.model || void 0, c = s ? !!ne[C(s)?.provider ?? ""] : !!ae;
2282
2325
  if (!i || !c) {
2283
2326
  g(!1);
2284
2327
  let n = e.fallback(t, r);
@@ -2312,7 +2355,7 @@ function fn(e, t = {}) {
2312
2355
  history: n.history,
2313
2356
  logId: crypto.randomUUID(),
2314
2357
  attachmentsRef: a
2315
- }, (K || G) && _e(t), q.current = !1, g(K || G || i && !!ae);
2358
+ }, (K || G) && _e(t), de.current = !1, g(K || G || i && !!ae);
2316
2359
  } catch (e) {
2317
2360
  m(be(e));
2318
2361
  } finally {
@@ -2337,11 +2380,11 @@ function fn(e, t = {}) {
2337
2380
  historyAt: i.history.length
2338
2381
  }]);
2339
2382
  try {
2340
- if (K) return await X(t, !1, n?.model || void 0, void 0, await le(n?.attachments));
2383
+ if (K) return await X(t, !1, n?.model || void 0, void 0, await ce(n?.attachments));
2341
2384
  let r = n?.model || (G ? Y.current : "");
2342
- if (G && de(r)) {
2343
- let e = !q.current;
2344
- return q.current = !0, await X(t, e, r, void 0, await le(n?.attachments));
2385
+ if (G && ue(r)) {
2386
+ let e = !de.current;
2387
+ return de.current = !0, await X(t, e, r, void 0, await ce(n?.attachments));
2345
2388
  }
2346
2389
  te.current &&= {
2347
2390
  ...te.current,
@@ -2356,7 +2399,7 @@ function fn(e, t = {}) {
2356
2399
  }
2357
2400
  }, Ee = (e) => {
2358
2401
  let t = D.current, n = _.findIndex((t) => t.id === e), r = _[n], i = r?.detail?.trim();
2359
- if (!oe || !t || !r || r.kind !== "user" || !i) return;
2402
+ if (!q || !t || !r || r.kind !== "user" || !i) return;
2360
2403
  if (r.historyAt !== void 0) return r.historyAt;
2361
2404
  let a = _.slice(0, n).filter((e) => e.kind === "user" && e.detail?.trim() === i).length, o = 0;
2362
2405
  for (let e = 0; e < t.history.length; e += 1) {
@@ -2399,9 +2442,9 @@ function fn(e, t = {}) {
2399
2442
  hasProviders: o,
2400
2443
  selectedModel: K || G && me ? me : H,
2401
2444
  setSelectedModel: K ? ge : G ? (e) => {
2402
- de(e) ? ge(e) : (ge(""), u(e));
2445
+ ue(e) ? ge(e) : (ge(""), u(e));
2403
2446
  } : u,
2404
- modelsByProvider: ie,
2447
+ modelsByProvider: V,
2405
2448
  modelsLoading: c,
2406
2449
  running: d,
2407
2450
  error: p,
@@ -2420,9 +2463,9 @@ function fn(e, t = {}) {
2420
2463
  answerQuestions: xe,
2421
2464
  cardAction: ve,
2422
2465
  rewind: Oe,
2423
- canRewind: oe,
2466
+ canRewind: q,
2424
2467
  rewindable: De,
2425
- executorAttachments: ce,
2468
+ executorAttachments: se,
2426
2469
  offersFallback: e.offersFallback !== !1
2427
2470
  };
2428
2471
  }
@@ -2487,7 +2530,7 @@ function _n(e) {
2487
2530
  return t.kind === "chat" ? t.message : e.continueWithoutAi;
2488
2531
  },
2489
2532
  getTools(t, n, r) {
2490
- let i = oe({
2533
+ let i = q({
2491
2534
  attachmentsRef: r,
2492
2535
  collected: n.collected,
2493
2536
  proxyFetch: w
@@ -2521,7 +2564,7 @@ function vn(e, t) {
2521
2564
  //#endregion
2522
2565
  //#region src/presentation/ResultDestinationPicker.tsx
2523
2566
  function yn({ manifest: e, result: t, meta: n, taskId: r, initiallyApplied: i, onApplied: a, extraDestinations: o }) {
2524
- let s = $(), c = ft(), l = c.scope, u = D(), [d, f] = F(null), [p, m] = F(new Set(i ?? [])), [h, g] = F(null), _ = De(), v = /* @__PURE__ */ new Map();
2567
+ let s = $(), c = ft(), l = c.scope, u = D(), [d, f] = P(null), [p, m] = P(new Set(i ?? [])), [h, g] = P(null), _ = De(), v = /* @__PURE__ */ new Map();
2525
2568
  e.destinationIds.forEach((e) => {
2526
2569
  let t = _[e];
2527
2570
  t && v.set(e, t);
@@ -2545,16 +2588,16 @@ function yn({ manifest: e, result: t, meta: n, taskId: r, initiallyApplied: i, o
2545
2588
  f(null);
2546
2589
  }
2547
2590
  };
2548
- return /* @__PURE__ */ R("div", {
2591
+ return /* @__PURE__ */ L("div", {
2549
2592
  className: "space-y-2",
2550
2593
  children: [
2551
- /* @__PURE__ */ L("p", {
2594
+ /* @__PURE__ */ I("p", {
2552
2595
  className: "text-xs font-medium text-muted-foreground",
2553
2596
  children: s.destinationPickerTitle
2554
2597
  }),
2555
- /* @__PURE__ */ L("div", {
2598
+ /* @__PURE__ */ I("div", {
2556
2599
  className: "flex flex-wrap gap-2",
2557
- children: y.map((e) => /* @__PURE__ */ L("button", {
2600
+ children: y.map((e) => /* @__PURE__ */ I("button", {
2558
2601
  type: "button",
2559
2602
  disabled: d !== null,
2560
2603
  onClick: () => void b(e.id),
@@ -2562,7 +2605,7 @@ function yn({ manifest: e, result: t, meta: n, taskId: r, initiallyApplied: i, o
2562
2605
  children: d === e.id ? s.destinationApplying : `${p.has(e.id) ? "✓ " : ""}${e.id === "json-export" ? s.exportJson : e.label}`
2563
2606
  }, e.id))
2564
2607
  }),
2565
- h && /* @__PURE__ */ L("p", {
2608
+ h && /* @__PURE__ */ I("p", {
2566
2609
  className: "text-xs text-destructive",
2567
2610
  children: h
2568
2611
  })
@@ -2581,18 +2624,18 @@ function Sn(e) {
2581
2624
  //#endregion
2582
2625
  //#region src/presentation/reports/GenericResultPreview.tsx
2583
2626
  function Cn({ result: e }) {
2584
- let [t, n] = F(!1);
2585
- return /* @__PURE__ */ R("div", {
2627
+ let [t, n] = P(!1);
2628
+ return /* @__PURE__ */ L("div", {
2586
2629
  className: `relative cursor-pointer rounded-md border border-border/60 ${t ? "max-h-80 overflow-y-auto" : "max-h-28 overflow-hidden"}`,
2587
2630
  onClick: () => n((e) => !e),
2588
2631
  title: t ? "Clic per comprimere" : "Clic per espandere",
2589
- children: [/* @__PURE__ */ L(c, {
2632
+ children: [/* @__PURE__ */ I(c, {
2590
2633
  language: "json",
2591
2634
  showCopy: t,
2592
2635
  background: "transparent",
2593
2636
  className: "!text-[11px]",
2594
2637
  children: JSON.stringify(e, null, 2)
2595
- }), !t && /* @__PURE__ */ L("div", { className: "pointer-events-none absolute inset-x-0 bottom-0 h-6 bg-gradient-to-t from-muted/30 to-transparent" })]
2638
+ }), !t && /* @__PURE__ */ I("div", { className: "pointer-events-none absolute inset-x-0 bottom-0 h-6 bg-gradient-to-t from-muted/30 to-transparent" })]
2596
2639
  });
2597
2640
  }
2598
2641
  //#endregion
@@ -2639,7 +2682,7 @@ function jn(e, t, n, r, i) {
2639
2682
  return o(n) ? n : Object.values(r).flat().map((e) => e.id).find(o);
2640
2683
  }
2641
2684
  function Mn(e) {
2642
- let t = T()?.registry ?? {}, { modelsByProvider: n, selectedModel: r } = rn(), i = P({
2685
+ let t = T()?.registry ?? {}, { modelsByProvider: n, selectedModel: r } = rn(), i = N({
2643
2686
  registry: t,
2644
2687
  modelsByProvider: n,
2645
2688
  selectedModel: r
@@ -2649,7 +2692,7 @@ function Mn(e) {
2649
2692
  modelsByProvider: n,
2650
2693
  selectedModel: r
2651
2694
  };
2652
- let a = P(/* @__PURE__ */ new Set()), o = k(async (t, n, r) => {
2695
+ let a = N(/* @__PURE__ */ new Set()), o = k(async (t, n, r) => {
2653
2696
  if (!e) return !1;
2654
2697
  let o = Ue(e, t, n), s = W(t), c = `${e}:${t}:${n}`;
2655
2698
  if (!o || !s?.autoTitle || o.name || !Ye(o) || a.current.has(c)) return !1;
@@ -2693,11 +2736,11 @@ function Fn({ manifest: e, params: t, extraDestinations: n, precedingActivity: r
2693
2736
  let c = ft(), l = fn(e.definition, {
2694
2737
  defaultEnabled: !0,
2695
2738
  ...c.person ? { author: c.person } : {}
2696
- }), u = e.thread?.(t) || void 0, d = e.speaker?.(t), f = c.scope, p = D(), m = P(i ?? `subagent-${e.id}-${crypto.randomUUID()}`).current, [h, g] = F(null), _ = (t) => {
2739
+ }), u = e.thread?.(t) || void 0, d = e.speaker?.(t), f = c.scope, p = D(), m = N(i ?? `subagent-${e.id}-${crypto.randomUUID()}`).current, [h, g] = P(null), _ = (t) => {
2697
2740
  e.definition.conversational || g(t);
2698
- }, [v, y] = F([]), [b, x] = F(null), S = Sn(e.id), C = S?.kind === "selection" ? S : null, [w, T] = F(null), ee = P(!1), E = P(0), O = P(null);
2741
+ }, [v, y] = P([]), [b, x] = P(null), S = Sn(e.id), C = S?.kind === "selection" ? S : null, [w, T] = P(null), ee = N(!1), E = N(0), O = N(null);
2699
2742
  h && h !== O.current && (O.current = h, E.current = (r?.length ?? 0) + l.activity.length);
2700
- let te = P(!1), k = l.remote || !l.hasProviders || l.selectedModel !== "";
2743
+ let te = N(!1), k = l.remote || !l.hasProviders || l.selectedModel !== "";
2701
2744
  j(() => {
2702
2745
  !ee.current && k && (ee.current = !0, a ? (U.current = !0, l.resume(e.toParams(t), a)) : (o && l.setSelectedModel(o), l.run(e.toParams(t), {
2703
2746
  model: o,
@@ -2734,18 +2777,18 @@ function Fn({ manifest: e, params: t, extraDestinations: n, precedingActivity: r
2734
2777
  ...n,
2735
2778
  [e]: t
2736
2779
  });
2737
- }, M = (e) => _(e), ne = N(() => h && C && w ? C.applySelection(h, w) : h, [
2780
+ }, ne = (e) => _(e), re = M(() => h && C && w ? C.applySelection(h, w) : h, [
2738
2781
  h,
2739
2782
  C,
2740
2783
  w
2741
- ]), z = N(() => c.componentAnchors.filter((t) => t.subagentId === e.id && t.onResult), [c.componentAnchors, e.id]), B = N(() => wn(z, t, m), [
2742
- z,
2784
+ ]), R = M(() => c.componentAnchors.filter((t) => t.subagentId === e.id && t.onResult), [c.componentAnchors, e.id]), ie = M(() => wn(R, t, m), [
2785
+ R,
2743
2786
  t,
2744
2787
  m
2745
- ]), V = N(() => B ? [B, ...n ?? []] : n, [B, n]), re = e.chatEntityId?.(t), ie = Mn(f?.id), H = P(!1), U = P(!1);
2788
+ ]), z = M(() => ie ? [ie, ...n ?? []] : n, [ie, n]), B = e.chatEntityId?.(t), V = Mn(f?.id), H = N(!1), U = N(!1);
2746
2789
  j(() => {
2747
2790
  let n = !H.current && l.running, i = H.current && !l.running;
2748
- if (H.current = l.running, !n && !i || !re || !f) return;
2791
+ if (H.current = l.running, !n && !i || !B || !f) return;
2749
2792
  if (U.current) {
2750
2793
  i && (U.current = !1);
2751
2794
  return;
@@ -2756,21 +2799,37 @@ function Fn({ manifest: e, params: t, extraDestinations: n, precedingActivity: r
2756
2799
  e.autoTitle && e.definition.conversational && !Ye({ activity: o }) || (We({
2757
2800
  scopeId: f.id,
2758
2801
  subagentId: e.id,
2759
- entityId: re,
2802
+ entityId: B,
2760
2803
  params: t,
2761
2804
  title: vn(e, t),
2762
2805
  history: a.history,
2763
2806
  activity: o
2764
- }), i && e.autoTitle && ie(e.id, re, l.selectedModel));
2807
+ }), i && e.autoTitle && V(e.id, B, l.selectedModel));
2765
2808
  }, [l.running]);
2766
- let ae = () => {
2809
+ let ae = l.activity.flatMap((e) => (e.parts ?? []).flatMap((e) => e.type === "card" && e.outcome ? [`${e.id}:${e.outcome.status}`] : [])).join(","), W = N(ae);
2810
+ j(() => {
2811
+ if (ae === W.current || (W.current = ae, !ae || !B || !f || l.running || U.current)) return;
2812
+ let n = l.snapshot();
2813
+ if (!n) return;
2814
+ let i = [...r ?? [], ...n.activity];
2815
+ e.autoTitle && e.definition.conversational && !Ye({ activity: i }) || We({
2816
+ scopeId: f.id,
2817
+ subagentId: e.id,
2818
+ entityId: B,
2819
+ params: t,
2820
+ title: vn(e, t),
2821
+ history: n.history,
2822
+ activity: i
2823
+ });
2824
+ }, [ae]);
2825
+ let G = () => {
2767
2826
  te.current = !0, l.running && l.stop(), c.closeTask(m);
2768
- }, W = P(Dn(e.id) ?? Pn).current, G = W({
2827
+ }, K = N(Dn(e.id) ?? Pn).current, q = K({
2769
2828
  params: t,
2770
2829
  taskId: m,
2771
2830
  running: l.running,
2772
- close: ae
2773
- }), K = (e) => {
2831
+ close: G
2832
+ }), oe = (e) => {
2774
2833
  y((t) => t.includes(e) ? t : [...t, e]);
2775
2834
  };
2776
2835
  return j(() => {
@@ -2782,34 +2841,34 @@ function Fn({ manifest: e, params: t, extraDestinations: n, precedingActivity: r
2782
2841
  onApplied: (e) => _(e),
2783
2842
  precedingActivity: r,
2784
2843
  panelExtraAnchorIndex: E.current,
2785
- onDismiss: ae,
2844
+ onDismiss: G,
2786
2845
  ...u ? { thread: u } : {},
2787
2846
  ...d ? { speaker: d } : {},
2788
- ...re ? { savedToDisk: !0 } : {},
2789
- panelActions: G.content,
2790
- composerActions: G.actions,
2791
- composerCommands: G.commands,
2792
- panelExtra: h ? /* @__PURE__ */ R(I, { children: [
2793
- C && w ? /* @__PURE__ */ L(C.Report, {
2847
+ ...B ? { savedToDisk: !0 } : {},
2848
+ panelActions: q.content,
2849
+ composerActions: q.actions,
2850
+ composerCommands: q.commands,
2851
+ panelExtra: h ? /* @__PURE__ */ L(F, { children: [
2852
+ C && w ? /* @__PURE__ */ I(C.Report, {
2794
2853
  result: h,
2795
2854
  selection: w,
2796
2855
  onChange: A
2797
- }) : S?.kind === "editable" ? /* @__PURE__ */ L(S.Report, {
2856
+ }) : S?.kind === "editable" ? /* @__PURE__ */ I(S.Report, {
2798
2857
  result: h,
2799
- onResultChange: M
2800
- }) : /* @__PURE__ */ L(Cn, { result: ne }),
2801
- b && /* @__PURE__ */ R("p", {
2858
+ onResultChange: ne
2859
+ }) : /* @__PURE__ */ I(Cn, { result: re }),
2860
+ b && /* @__PURE__ */ L("p", {
2802
2861
  className: "text-xs text-destructive",
2803
2862
  children: ["Salvataggio automatico non riuscito: ", b]
2804
2863
  }),
2805
- /* @__PURE__ */ L(yn, {
2864
+ /* @__PURE__ */ I(yn, {
2806
2865
  manifest: e,
2807
- result: ne,
2866
+ result: re,
2808
2867
  meta: t,
2809
2868
  taskId: m,
2810
2869
  initiallyApplied: v,
2811
- onApplied: K,
2812
- extraDestinations: V
2870
+ onApplied: oe,
2871
+ extraDestinations: z
2813
2872
  })
2814
2873
  ] }) : void 0
2815
2874
  });
@@ -2828,15 +2887,15 @@ function Fn({ manifest: e, params: t, extraDestinations: n, precedingActivity: r
2828
2887
  e,
2829
2888
  t,
2830
2889
  h,
2831
- ne,
2890
+ re,
2832
2891
  w,
2833
2892
  v,
2834
2893
  n,
2835
2894
  r,
2836
2895
  b,
2837
- G.content,
2838
- G.actions,
2839
- G.commands
2896
+ q.content,
2897
+ q.actions,
2898
+ q.commands
2840
2899
  ]), j(() => () => {
2841
2900
  c.closeTask(m);
2842
2901
  }, [c.closeTask, m]), null;
@@ -2844,7 +2903,7 @@ function Fn({ manifest: e, params: t, extraDestinations: n, precedingActivity: r
2844
2903
  //#endregion
2845
2904
  //#region src/presentation/OrchestratorRunner.tsx
2846
2905
  function In({ userGoal: e }) {
2847
- let t = $(), n = N(() => _n({
2906
+ let t = $(), n = M(() => _n({
2848
2907
  unavailable: t.orchestratorUnavailable,
2849
2908
  continueWithoutAi: t.orchestratorContinueWithoutAi,
2850
2909
  preparing: t.orchestratorPreparing,
@@ -2852,7 +2911,7 @@ function In({ userGoal: e }) {
2852
2911
  }), []), r = ft(), i = fn(n, {
2853
2912
  defaultEnabled: !0,
2854
2913
  ...r.person ? { author: r.person } : {}
2855
- }), [a, o] = F(null), s = P(!1), c = !i.hasProviders || i.selectedModel !== "", l = P(r.pendingExtraDestinations), u = P(r.pendingAttachments), d = P(r.pendingModel), f = P(r.pendingScopedSubagentId ?? r.scopedSubagentId ?? void 0), p = P(r.pendingCarryOver), m = P(!1), h = (e) => {
2914
+ }), [a, o] = P(null), s = N(!1), c = !i.hasProviders || i.selectedModel !== "", l = N(r.pendingExtraDestinations), u = N(r.pendingAttachments), d = N(r.pendingModel), f = N(r.pendingScopedSubagentId ?? r.scopedSubagentId ?? void 0), p = N(r.pendingCarryOver), m = N(!1), h = (e) => {
2856
2915
  e && typeof e == "object" && e.kind === "handoff" && (o(e), r.closeTask(lt));
2857
2916
  };
2858
2917
  j(() => {
@@ -2892,10 +2951,10 @@ function In({ userGoal: e }) {
2892
2951
  ]), j(() => () => {
2893
2952
  r.closeTask(lt);
2894
2953
  }, [r.closeTask]);
2895
- let g = N(() => [...p.current?.activity ?? [], ...i.activity], [i.activity]);
2954
+ let g = M(() => [...p.current?.activity ?? [], ...i.activity], [i.activity]);
2896
2955
  if (!a) return null;
2897
2956
  let _ = W(a.subagentId);
2898
- return _ ? /* @__PURE__ */ L(Fn, {
2957
+ return _ ? /* @__PURE__ */ I(Fn, {
2899
2958
  manifest: _,
2900
2959
  params: a.params,
2901
2960
  extraDestinations: l.current,
@@ -2910,7 +2969,7 @@ function Ln({ manifest: e, extraDestinations: n }) {
2910
2969
  let r = ft(), i = fn(e.definition, {
2911
2970
  defaultEnabled: !1,
2912
2971
  ...r.person ? { author: r.person } : {}
2913
- }), a = $(), o = P(`manual-${e.id}-${crypto.randomUUID()}`).current, [s, c] = F(null), [l, u] = F([]), d = Sn(e.id), f = d?.kind === "selection" ? d : null, [p, m] = F(null), [h, g] = F(null), _ = P(!1), v = (t) => {
2972
+ }), a = $(), o = N(`manual-${e.id}-${crypto.randomUUID()}`).current, [s, c] = P(null), [l, u] = P([]), d = Sn(e.id), f = d?.kind === "selection" ? d : null, [p, m] = P(null), [h, g] = P(null), _ = N(!1), v = (t) => {
2914
2973
  if (!e.manualEntry) return;
2915
2974
  let n;
2916
2975
  try {
@@ -2931,17 +2990,17 @@ function Ln({ manifest: e, extraDestinations: n }) {
2931
2990
  ...n,
2932
2991
  [e]: t
2933
2992
  });
2934
- }, b = (e) => c(e), x = N(() => s && f && p ? f.applySelection(s, p) : s, [
2993
+ }, b = (e) => c(e), x = M(() => s && f && p ? f.applySelection(s, p) : s, [
2935
2994
  s,
2936
2995
  f,
2937
2996
  p
2938
2997
  ]), S = (e) => {
2939
2998
  u((t) => t.includes(e) ? t : [...t, e]);
2940
- }, C = N(() => r.componentAnchors.filter((t) => t.subagentId === e.id && t.onResult), [r.componentAnchors, e.id]), w = N(() => h ? wn(C, h, o) : null, [
2999
+ }, C = M(() => r.componentAnchors.filter((t) => t.subagentId === e.id && t.onResult), [r.componentAnchors, e.id]), w = M(() => h ? wn(C, h, o) : null, [
2941
3000
  C,
2942
3001
  h,
2943
3002
  o
2944
- ]), T = N(() => w ? [w, ...n ?? []] : n, [w, n]);
3003
+ ]), T = M(() => w ? [w, ...n ?? []] : n, [w, n]);
2945
3004
  return j(() => {
2946
3005
  _.current || r.openTask({
2947
3006
  id: o,
@@ -2956,18 +3015,18 @@ function Ln({ manifest: e, extraDestinations: n }) {
2956
3015
  onDismiss: () => {
2957
3016
  _.current = !0, i.running && i.stop(), r.closeTask(o);
2958
3017
  },
2959
- panelExtra: s ? /* @__PURE__ */ R("div", {
3018
+ panelExtra: s ? /* @__PURE__ */ L("div", {
2960
3019
  className: "space-y-2",
2961
3020
  children: [
2962
- f && p ? /* @__PURE__ */ L(f.Report, {
3021
+ f && p ? /* @__PURE__ */ I(f.Report, {
2963
3022
  result: s,
2964
3023
  selection: p,
2965
3024
  onChange: y
2966
- }) : d?.kind === "editable" ? /* @__PURE__ */ L(d.Report, {
3025
+ }) : d?.kind === "editable" ? /* @__PURE__ */ I(d.Report, {
2967
3026
  result: s,
2968
3027
  onResultChange: b
2969
- }) : /* @__PURE__ */ L(Cn, { result: x }),
2970
- /* @__PURE__ */ L(yn, {
3028
+ }) : /* @__PURE__ */ I(Cn, { result: x }),
3029
+ /* @__PURE__ */ I(yn, {
2971
3030
  manifest: e,
2972
3031
  result: x,
2973
3032
  meta: h ?? {},
@@ -2976,7 +3035,7 @@ function Ln({ manifest: e, extraDestinations: n }) {
2976
3035
  onApplied: S,
2977
3036
  extraDestinations: T
2978
3037
  }),
2979
- i.hasProviders && /* @__PURE__ */ L(t, {
3038
+ i.hasProviders && /* @__PURE__ */ I(t, {
2980
3039
  label: a.resumeWithAi,
2981
3040
  variant: "outline-secondary",
2982
3041
  className: "text-xs",
@@ -3005,30 +3064,30 @@ function Ln({ manifest: e, extraDestinations: n }) {
3005
3064
  //#endregion
3006
3065
  //#region src/presentation/EarlierSessions.tsx
3007
3066
  function Rn({ title: e, meta: t, action: n }) {
3008
- return /* @__PURE__ */ R("div", {
3067
+ return /* @__PURE__ */ L("div", {
3009
3068
  role: "separator",
3010
3069
  "aria-label": e,
3011
3070
  className: "my-3 flex items-center gap-2 text-[11px] text-muted-foreground",
3012
3071
  children: [
3013
- /* @__PURE__ */ L("span", { className: "h-px flex-1 bg-border" }),
3014
- /* @__PURE__ */ R("span", {
3072
+ /* @__PURE__ */ I("span", { className: "h-px flex-1 bg-border" }),
3073
+ /* @__PURE__ */ L("span", {
3015
3074
  className: "flex min-w-0 max-w-[75%] flex-col items-center text-center",
3016
3075
  children: [
3017
- /* @__PURE__ */ L("span", {
3076
+ /* @__PURE__ */ I("span", {
3018
3077
  className: "max-w-full truncate font-medium text-foreground",
3019
3078
  children: e
3020
3079
  }),
3021
- t && /* @__PURE__ */ L("span", { children: t }),
3080
+ t && /* @__PURE__ */ I("span", { children: t }),
3022
3081
  n
3023
3082
  ]
3024
3083
  }),
3025
- /* @__PURE__ */ L("span", { className: "h-px flex-1 bg-border" })
3084
+ /* @__PURE__ */ I("span", { className: "h-px flex-1 bg-border" })
3026
3085
  ]
3027
3086
  });
3028
3087
  }
3029
3088
  function zn({ chat: e, thread: t, from: n, showEvents: r }) {
3030
3089
  let i = ht(t, n, e.savedAt, r);
3031
- return /* @__PURE__ */ L(Vt, {
3090
+ return /* @__PURE__ */ I(Vt, {
3032
3091
  activity: e.activity,
3033
3092
  pinUserMessages: !1,
3034
3093
  speaker: W(e.subagentId)?.speaker?.(e.params),
@@ -3036,27 +3095,27 @@ function zn({ chat: e, thread: t, from: n, showEvents: r }) {
3036
3095
  });
3037
3096
  }
3038
3097
  function Bn({ scopeId: e, thread: n, taskId: r, scrollRef: i, onLoad: a, onContinue: o, busy: s = !1, showEvents: c = !0 }) {
3039
- let l = $(), { locale: u } = E(), [d, f] = F(0);
3098
+ let l = $(), { locale: u } = E(), [d, f] = P(0);
3040
3099
  j(() => Ve(() => f((e) => e + 1)), []);
3041
- let p = N(() => nt(e, n, r), [
3100
+ let p = M(() => nt(e, n, r), [
3042
3101
  e,
3043
3102
  n,
3044
3103
  r,
3045
3104
  d
3046
- ]), [m, h] = F(0);
3105
+ ]), [m, h] = P(0);
3047
3106
  j(() => h(0), [r, n]);
3048
- let g = m < p.length, _ = P(null), v = () => {
3107
+ let g = m < p.length, _ = N(null), v = () => {
3049
3108
  let e = i.current;
3050
3109
  e && (_.current = {
3051
3110
  height: e.scrollHeight,
3052
3111
  top: e.scrollTop
3053
3112
  }), a?.(), h((e) => Math.min(e + 1, p.length));
3054
- }, y = P(v);
3055
- y.current = v, M(() => {
3113
+ }, y = N(v);
3114
+ y.current = v, ne(() => {
3056
3115
  let e = i.current, t = _.current;
3057
3116
  _.current = null, e && t && (e.scrollTop = t.top + (e.scrollHeight - t.height));
3058
3117
  }, [m, i]);
3059
- let b = P(null);
3118
+ let b = N(null);
3060
3119
  if (j(() => {
3061
3120
  let e = i.current, t = b.current;
3062
3121
  if (!e || !t || !g || typeof IntersectionObserver > "u") return;
@@ -3085,11 +3144,11 @@ function Bn({ scopeId: e, thread: n, taskId: r, scrollRef: i, onLoad: a, onConti
3085
3144
  let t = p[p.indexOf(e) + 1];
3086
3145
  return t ? t.savedAt : Q(e);
3087
3146
  };
3088
- return /* @__PURE__ */ R("div", { children: [
3089
- g && /* @__PURE__ */ L("div", {
3147
+ return /* @__PURE__ */ L("div", { children: [
3148
+ g && /* @__PURE__ */ I("div", {
3090
3149
  ref: b,
3091
3150
  className: "flex justify-center pb-1",
3092
- children: /* @__PURE__ */ L(t, {
3151
+ children: /* @__PURE__ */ I(t, {
3093
3152
  icon: "history",
3094
3153
  label: l.earlierSession,
3095
3154
  variant: "link",
@@ -3097,26 +3156,26 @@ function Bn({ scopeId: e, thread: n, taskId: r, scrollRef: i, onLoad: a, onConti
3097
3156
  onClick: v
3098
3157
  })
3099
3158
  }),
3100
- C.map((e) => /* @__PURE__ */ R("section", {
3159
+ C.map((e) => /* @__PURE__ */ L("section", {
3101
3160
  "aria-label": Je(e),
3102
- children: [/* @__PURE__ */ L(Rn, {
3161
+ children: [/* @__PURE__ */ I(Rn, {
3103
3162
  title: Je(e),
3104
3163
  meta: S(l.sessionOf, { at: x(Q(e)) }),
3105
- action: /* @__PURE__ */ L(t, {
3164
+ action: /* @__PURE__ */ I(t, {
3106
3165
  label: l.continueSession,
3107
3166
  variant: "link",
3108
3167
  className: "text-[11px]",
3109
3168
  disabled: s,
3110
3169
  onClick: () => o(e)
3111
3170
  })
3112
- }), /* @__PURE__ */ L(zn, {
3171
+ }), /* @__PURE__ */ I(zn, {
3113
3172
  chat: e,
3114
3173
  thread: n,
3115
3174
  from: w(e),
3116
3175
  showEvents: c
3117
3176
  })]
3118
3177
  }, `${e.subagentId}:${e.entityId}`)),
3119
- m > 0 && /* @__PURE__ */ L(Rn, { title: l.thisSession })
3178
+ m > 0 && /* @__PURE__ */ I(Rn, { title: l.thisSession })
3120
3179
  ] });
3121
3180
  }
3122
3181
  //#endregion
@@ -3134,11 +3193,15 @@ function Vn(e, t) {
3134
3193
  });
3135
3194
  }
3136
3195
  function Hn({ task: e, editing: n, onCancelEdit: r, onSendEdit: i }) {
3137
- let a = $(), [o, c] = F(""), { agent: l, onApplied: u, manualEntry: d } = e, p = l.running;
3196
+ let a = $(), [o, c] = P(""), { agent: l, onApplied: u, manualEntry: d } = e, p = l.running;
3138
3197
  j(() => {
3139
3198
  n && c(n.detail ?? "");
3140
3199
  }, [n]);
3141
- let m = (e) => {
3200
+ let { draft: m } = ft(), h = N(m?.nonce ?? 0);
3201
+ j(() => {
3202
+ m && m.nonce !== h.current && (h.current = m.nonce, c(m.text));
3203
+ }, [m]);
3204
+ let g = (e) => {
3142
3205
  if (c(""), n && i) {
3143
3206
  i(n, e.text);
3144
3207
  return;
@@ -3153,20 +3216,20 @@ function Hn({ task: e, editing: n, onCancelEdit: r, onSendEdit: i }) {
3153
3216
  }).then((e) => {
3154
3217
  e && u(e);
3155
3218
  });
3156
- }, h = !!d || l.remote && l.remoteModels.length === 0, g = l.alongside && l.remoteModels.some((e) => e.value === l.selectedModel), _ = !h && !l.remote && !g && l.hasProviders && !l.selectedModel, v = h ? [] : l.remote ? l.remoteModels : l.alongside ? [...l.remoteModels, ...Vn(l.modelsByProvider, l.catalogGroup)] : Vn(l.modelsByProvider);
3157
- return /* @__PURE__ */ R(I, { children: [n && /* @__PURE__ */ R("div", {
3219
+ }, _ = !!d || l.remote && l.remoteModels.length === 0, v = l.alongside && l.remoteModels.some((e) => e.value === l.selectedModel), y = !_ && !l.remote && !v && l.hasProviders && !l.selectedModel, b = _ ? [] : l.remote ? l.remoteModels : l.alongside ? [...l.remoteModels, ...Vn(l.modelsByProvider, l.catalogGroup)] : Vn(l.modelsByProvider);
3220
+ return /* @__PURE__ */ L(F, { children: [n && /* @__PURE__ */ L("div", {
3158
3221
  className: "mb-2 flex items-center gap-2 text-xs text-muted-foreground",
3159
3222
  children: [
3160
- /* @__PURE__ */ L(f, {
3223
+ /* @__PURE__ */ I(f, {
3161
3224
  name: "pencil",
3162
3225
  size: 12,
3163
3226
  className: "shrink-0"
3164
3227
  }),
3165
- /* @__PURE__ */ L("span", {
3228
+ /* @__PURE__ */ I("span", {
3166
3229
  className: "flex-1",
3167
3230
  children: a.editingMessage
3168
3231
  }),
3169
- /* @__PURE__ */ L(t, {
3232
+ /* @__PURE__ */ I(t, {
3170
3233
  label: a.cancelEdit,
3171
3234
  variant: "link",
3172
3235
  className: "p-0 text-xs",
@@ -3175,17 +3238,17 @@ function Hn({ task: e, editing: n, onCancelEdit: r, onSendEdit: i }) {
3175
3238
  }
3176
3239
  })
3177
3240
  ]
3178
- }), /* @__PURE__ */ L(s, {
3241
+ }), /* @__PURE__ */ I(s, {
3179
3242
  value: o,
3180
3243
  onChange: c,
3181
3244
  placeholder: d?.prompt ?? a.messagePlaceholder,
3182
3245
  running: p,
3183
3246
  onStop: l.stop,
3184
- disabled: !o.trim() || _,
3185
- onSubmit: m,
3186
- attachments: !d && (l.remote || g ? l.executorAttachments : !0),
3187
- models: v,
3188
- selectedModel: h ? "" : l.selectedModel,
3247
+ disabled: !o.trim() || y,
3248
+ onSubmit: g,
3249
+ attachments: !d && (l.remote || v ? l.executorAttachments : !0),
3250
+ models: b,
3251
+ selectedModel: _ ? "" : l.selectedModel,
3189
3252
  actions: e.composerActions,
3190
3253
  commands: e.composerCommands,
3191
3254
  onModelChange: l.setSelectedModel,
@@ -3195,13 +3258,13 @@ function Hn({ task: e, editing: n, onCancelEdit: r, onSendEdit: i }) {
3195
3258
  })] });
3196
3259
  }
3197
3260
  function Un() {
3198
- let { startOrchestrator: e } = ft(), t = $(), [n, r] = F(""), { hasProviders: i, modelsByProvider: a, selectedModel: o, setSelectedModel: c } = rn(), l = (t) => {
3261
+ let { startOrchestrator: e } = ft(), t = $(), [n, r] = P(""), { hasProviders: i, modelsByProvider: a, selectedModel: o, setSelectedModel: c } = rn(), l = (t) => {
3199
3262
  t.text.trim() && (e(t.text.trim(), {
3200
3263
  attachments: t.files.length > 0 ? t.files : void 0,
3201
3264
  model: t.model || void 0
3202
3265
  }), r(""));
3203
3266
  }, u = i && !o;
3204
- return /* @__PURE__ */ L(s, {
3267
+ return /* @__PURE__ */ I(s, {
3205
3268
  value: n,
3206
3269
  onChange: r,
3207
3270
  placeholder: t.orchestratorStarterPlaceholder,
@@ -3218,21 +3281,21 @@ function Un() {
3218
3281
  }
3219
3282
  function Wn({ chat: e, onClose: t }) {
3220
3283
  let n = $(), r = ee();
3221
- return /* @__PURE__ */ L(_, {
3284
+ return /* @__PURE__ */ I(_, {
3222
3285
  title: n.renameChat,
3223
3286
  size: "sm",
3224
3287
  onClose: t,
3225
3288
  onSave: () => (Ze(e.scopeId, e.subagentId, e.entityId, String(r.record?.title ?? Je(e)), "person"), t(), Promise.resolve(!0)),
3226
- children: /* @__PURE__ */ R(d, {
3289
+ children: /* @__PURE__ */ L(d, {
3227
3290
  appearance: "empty",
3228
3291
  controller: r,
3229
3292
  defaultValues: { title: Je(e) },
3230
3293
  footer: !1,
3231
- children: [/* @__PURE__ */ L(h, {
3294
+ children: [/* @__PURE__ */ I(h, {
3232
3295
  name: "title",
3233
3296
  label: n.chatTitleLabel,
3234
3297
  placeholder: e.title
3235
- }), /* @__PURE__ */ L("p", {
3298
+ }), /* @__PURE__ */ I("p", {
3236
3299
  className: "text-xs text-muted-foreground",
3237
3300
  children: n.chatTitleHint
3238
3301
  })]
@@ -3253,53 +3316,53 @@ function Gn(e, t, n = Date.now()) {
3253
3316
  }
3254
3317
  function Kn({ card: e }) {
3255
3318
  let t = $();
3256
- return e.humanSummaryOnly ? /* @__PURE__ */ R("div", {
3319
+ return e.humanSummaryOnly ? /* @__PURE__ */ L("div", {
3257
3320
  className: "space-y-2 rounded-lg border border-border/60 p-3",
3258
- children: [/* @__PURE__ */ R("p", {
3321
+ children: [/* @__PURE__ */ L("p", {
3259
3322
  className: "text-xs font-medium text-foreground",
3260
3323
  children: [
3261
3324
  "\"",
3262
3325
  e.label,
3263
3326
  "\""
3264
3327
  ]
3265
- }), /* @__PURE__ */ L("p", {
3328
+ }), /* @__PURE__ */ I("p", {
3266
3329
  className: "text-xs text-muted-foreground",
3267
3330
  children: e.humanSummary
3268
3331
  })]
3269
- }) : /* @__PURE__ */ R("div", {
3332
+ }) : /* @__PURE__ */ L("div", {
3270
3333
  className: "space-y-2 rounded-lg border border-border/60 p-3",
3271
3334
  children: [
3272
- /* @__PURE__ */ L("p", {
3335
+ /* @__PURE__ */ I("p", {
3273
3336
  className: "text-xs font-medium text-foreground",
3274
3337
  children: S(t.newInstance, { label: e.label })
3275
3338
  }),
3276
- /* @__PURE__ */ L("p", {
3339
+ /* @__PURE__ */ I("p", {
3277
3340
  className: "text-xs text-muted-foreground",
3278
3341
  children: e.humanSummary
3279
3342
  }),
3280
- e.fields.length > 0 && /* @__PURE__ */ L("ul", {
3343
+ e.fields.length > 0 && /* @__PURE__ */ I("ul", {
3281
3344
  className: "space-y-1",
3282
- children: e.fields.map((e) => /* @__PURE__ */ R("li", {
3345
+ children: e.fields.map((e) => /* @__PURE__ */ L("li", {
3283
3346
  className: "flex items-start gap-1.5 text-xs",
3284
- children: [/* @__PURE__ */ L(n, {
3347
+ children: [/* @__PURE__ */ I(n, {
3285
3348
  variant: e.required ? "primary" : "secondary",
3286
3349
  className: "mt-px shrink-0",
3287
3350
  children: e.required ? "richiesto" : "opzionale"
3288
- }), /* @__PURE__ */ R("span", {
3351
+ }), /* @__PURE__ */ L("span", {
3289
3352
  className: "min-w-0",
3290
- children: [/* @__PURE__ */ L("span", {
3353
+ children: [/* @__PURE__ */ I("span", {
3291
3354
  className: "font-mono text-foreground",
3292
3355
  children: e.key
3293
- }), e.humanDescription ? /* @__PURE__ */ R("span", {
3356
+ }), e.humanDescription ? /* @__PURE__ */ L("span", {
3294
3357
  className: "text-muted-foreground",
3295
3358
  children: [" — ", e.humanDescription]
3296
3359
  }) : null]
3297
3360
  })]
3298
3361
  }, e.key))
3299
3362
  }),
3300
- e.example && /* @__PURE__ */ R("p", {
3363
+ e.example && /* @__PURE__ */ L("p", {
3301
3364
  className: "text-xs text-muted-foreground",
3302
- children: ["Esempio: ", /* @__PURE__ */ L("span", {
3365
+ children: ["Esempio: ", /* @__PURE__ */ I("span", {
3303
3366
  className: "font-mono",
3304
3367
  children: e.example
3305
3368
  })]
@@ -3308,22 +3371,22 @@ function Kn({ card: e }) {
3308
3371
  });
3309
3372
  }
3310
3373
  function qn({ messages: e }) {
3311
- return /* @__PURE__ */ L("div", {
3374
+ return /* @__PURE__ */ I("div", {
3312
3375
  className: "space-y-2 rounded-lg border border-border/60 p-3",
3313
- children: e.map((e, t) => /* @__PURE__ */ L("p", {
3376
+ children: e.map((e, t) => /* @__PURE__ */ I("p", {
3314
3377
  className: "text-xs text-muted-foreground",
3315
3378
  children: e
3316
3379
  }, t))
3317
3380
  });
3318
3381
  }
3319
3382
  function Jn({ scopeId: e, currentTaskId: n, open: r, onOpenChange: i, onSelect: a, onNewChat: o, onArchivedCurrent: s }) {
3320
- let c = $(), { locale: d } = E(), [p, m] = F(""), [h, g] = F(0);
3383
+ let c = $(), { locale: d } = E(), [p, m] = P(""), [h, g] = P(0);
3321
3384
  j(() => Ve(() => g((e) => e + 1)), []);
3322
- let _ = N(() => r ? $e(e) : [], [
3385
+ let _ = M(() => r ? $e(e) : [], [
3323
3386
  e,
3324
3387
  r,
3325
3388
  h
3326
- ]), [v, y] = F(null), b = async (t) => {
3389
+ ]), [v, y] = P(null), b = async (t) => {
3327
3390
  let r = W(t.subagentId), i = await r?.confirmArchive?.(t.entityId, t.params);
3328
3391
  if (!i || window.confirm(i)) {
3329
3392
  try {
@@ -3333,14 +3396,14 @@ function Jn({ scopeId: e, currentTaskId: n, open: r, onOpenChange: i, onSelect:
3333
3396
  }
3334
3397
  Qe(e, t.subagentId, t.entityId), n === et(t.subagentId, t.entityId) && s(), g((e) => e + 1);
3335
3398
  }
3336
- }, x = N(() => {
3399
+ }, x = M(() => {
3337
3400
  let e = p.trim().toLowerCase();
3338
3401
  return e ? _.filter((t) => {
3339
3402
  let n = W(t.subagentId)?.label ?? t.subagentId;
3340
3403
  return Je(t).toLowerCase().includes(e) || n.toLowerCase().includes(e);
3341
3404
  }) : _;
3342
3405
  }, [_, p]);
3343
- return /* @__PURE__ */ R(I, { children: [/* @__PURE__ */ L(l, {
3406
+ return /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I(l, {
3344
3407
  trigger: {
3345
3408
  icon: "history",
3346
3409
  title: c.chatHistory
@@ -3351,22 +3414,22 @@ function Jn({ scopeId: e, currentTaskId: n, open: r, onOpenChange: i, onSelect:
3351
3414
  position: "end",
3352
3415
  strategy: "absolute",
3353
3416
  menuClassName: "w-[380px] max-h-[70vh] overflow-y-auto",
3354
- header: /* @__PURE__ */ R("div", {
3417
+ header: /* @__PURE__ */ L("div", {
3355
3418
  className: "flex items-center gap-2 px-1 pb-1.5",
3356
3419
  children: [
3357
- /* @__PURE__ */ L(f, {
3420
+ /* @__PURE__ */ I(f, {
3358
3421
  name: "search",
3359
3422
  size: 14,
3360
3423
  className: "shrink-0 text-muted-foreground"
3361
3424
  }),
3362
- /* @__PURE__ */ L("input", {
3425
+ /* @__PURE__ */ I("input", {
3363
3426
  autoFocus: !0,
3364
3427
  value: p,
3365
3428
  onChange: (e) => m(e.target.value),
3366
3429
  placeholder: c.searchChats,
3367
3430
  className: "min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground"
3368
3431
  }),
3369
- /* @__PURE__ */ L(t, {
3432
+ /* @__PURE__ */ I(t, {
3370
3433
  icon: "square-pen",
3371
3434
  ariaLabel: c.newChat,
3372
3435
  title: c.newChat,
@@ -3376,12 +3439,12 @@ function Jn({ scopeId: e, currentTaskId: n, open: r, onOpenChange: i, onSelect:
3376
3439
  })
3377
3440
  ]
3378
3441
  }),
3379
- children: x.length === 0 ? /* @__PURE__ */ L("p", {
3442
+ children: x.length === 0 ? /* @__PURE__ */ I("p", {
3380
3443
  className: "px-2 py-3 text-center text-xs text-muted-foreground",
3381
3444
  children: _.length === 0 ? c.noSavedChats : c.noResults
3382
3445
  }) : x.map((e) => {
3383
3446
  let t = W(e.subagentId), r = n === et(e.subagentId, e.entityId);
3384
- return /* @__PURE__ */ L(u, {
3447
+ return /* @__PURE__ */ I(u, {
3385
3448
  icon: r ? "check" : t?.icon ?? "bot",
3386
3449
  className: r ? "bg-accent font-semibold text-primary" : void 0,
3387
3450
  actions: [{
@@ -3396,13 +3459,13 @@ function Jn({ scopeId: e, currentTaskId: n, open: r, onOpenChange: i, onSelect:
3396
3459
  onClick: () => void b(e)
3397
3460
  }],
3398
3461
  onClick: () => a(e.subagentId, e.entityId, e),
3399
- children: /* @__PURE__ */ R("span", {
3462
+ children: /* @__PURE__ */ L("span", {
3400
3463
  className: "flex min-w-0 flex-1 items-center justify-between gap-2",
3401
- children: [/* @__PURE__ */ L("span", {
3464
+ children: [/* @__PURE__ */ I("span", {
3402
3465
  className: "min-w-0 truncate",
3403
3466
  title: `${t?.label ?? e.subagentId} · ${Je(e)}`,
3404
3467
  children: Je(e)
3405
- }), /* @__PURE__ */ L("span", {
3468
+ }), /* @__PURE__ */ I("span", {
3406
3469
  className: "shrink-0 text-xs text-muted-foreground",
3407
3470
  title: `${c.chatStarted.replace("{at}", new Date(Q(e)).toLocaleString(d))} · ${c.chatLastMessage.replace("{at}", new Date(e.savedAt).toLocaleString(d))}`,
3408
3471
  children: Gn(Q(e), d)
@@ -3410,40 +3473,40 @@ function Jn({ scopeId: e, currentTaskId: n, open: r, onOpenChange: i, onSelect:
3410
3473
  })
3411
3474
  }, `${e.subagentId}:${e.entityId}`);
3412
3475
  })
3413
- }), v && /* @__PURE__ */ L(Wn, {
3476
+ }), v && /* @__PURE__ */ I(Wn, {
3414
3477
  chat: v,
3415
3478
  onClose: () => y(null)
3416
3479
  })] });
3417
3480
  }
3418
3481
  function Yn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}) {
3419
- let { task: a, isOpen: o, pendingGoal: s, orchestratorRunId: c, pageContext: l, pageContextCard: u, anchoredUserMessages: d, pendingResume: f, resumeRunId: p, dismissForeignTask: m, resumeEntityChat: h, pendingManualEntry: g, manualEntryRunId: _, startManualEntry: y, pendingExtraDestinations: b, pendingResumeWithAI: x, resumeWithAIRunId: S, pendingStart: C, startRunId: w, scope: T, threadEvents: ee } = ft(), E = $(), D = P(null), [O, te] = F(!1), [k, A] = F(null), [M, ne] = F(null);
3482
+ let { task: a, isOpen: o, pendingGoal: s, orchestratorRunId: c, pageContext: l, pageContextCard: u, anchoredUserMessages: d, pendingResume: f, resumeRunId: p, dismissForeignTask: m, resumeEntityChat: h, pendingManualEntry: g, manualEntryRunId: _, startManualEntry: y, pendingExtraDestinations: b, pendingResumeWithAI: x, resumeWithAIRunId: S, pendingStart: C, startRunId: w, scope: T, threadEvents: ee } = ft(), E = $(), D = N(null), [O, te] = P(!1), [k, A] = P(null), [ne, re] = P(null);
3420
3483
  j(() => {
3421
- A(null), ne(null);
3484
+ A(null), re(null);
3422
3485
  }, [a?.id]), Mn(T?.id);
3423
- let z = Zt({
3486
+ let R = Zt({
3424
3487
  defaultWidth: e,
3425
3488
  minWidth: n,
3426
3489
  maxWidth: r,
3427
3490
  onWidthChange: i
3428
- }), B = () => {
3491
+ }), ie = () => {
3429
3492
  (!a || a.agent.running || a.savedToDisk || window.confirm(E.unsavedConversationConfirm)) && (m(), te(!1));
3430
- }, V = a ? [...a.precedingActivity ?? [], ...a.agent.activity] : [], re = V.length, ie = Math.max(0, Math.min(a?.panelExtraAnchorIndex ?? re, re)), H = V.slice(0, ie), U = V.slice(ie), ae = !!(a && !a.agent.running && a.agent.error), [G, K] = mt(), oe = P({ at: Date.now() });
3431
- oe.current.id !== a?.id && (oe.current = {
3493
+ }, z = a ? [...a.precedingActivity ?? [], ...a.agent.activity] : [], B = z.length, V = Math.max(0, Math.min(a?.panelExtraAnchorIndex ?? B, B)), H = z.slice(0, V), U = z.slice(V), ae = !!(a && !a.agent.running && a.agent.error), [G, K] = mt(), q = N({ at: Date.now() });
3494
+ q.current.id !== a?.id && (q.current = {
3432
3495
  id: a?.id,
3433
3496
  at: Date.now()
3434
3497
  });
3435
- let se = N(() => {
3436
- if (!T || !a?.thread) return oe.current.at;
3498
+ let oe = M(() => {
3499
+ if (!T || !a?.thread) return q.current.at;
3437
3500
  let e = nt(T.id, a.thread, a.id)[0];
3438
3501
  if (e) return e.savedAt;
3439
3502
  let t = $e(T.id).find((e) => et(e.subagentId, e.entityId) === a.id);
3440
- return t ? Q(t) : V.find((e) => e.at !== void 0)?.at ?? oe.current.at;
3503
+ return t ? Q(t) : z.find((e) => e.at !== void 0)?.at ?? q.current.at;
3441
3504
  }, [
3442
3505
  T?.id,
3443
3506
  a?.thread,
3444
3507
  a?.id,
3445
- re === 0
3446
- ]), ce = ht(a?.thread, se, Infinity, G), le = U.find((e) => e.at !== void 0)?.at, ue = U.length === 0 || le === void 0 ? ce : ce.filter((e) => e.at < le), de = U.length === 0 || le === void 0 ? [] : ce.filter((e) => e.at >= le), q = (e, t) => {
3508
+ B === 0
3509
+ ]), se = ht(a?.thread, oe, Infinity, G), ce = U.find((e) => e.at !== void 0)?.at, le = U.length === 0 || ce === void 0 ? se : se.filter((e) => e.at < ce), ue = U.length === 0 || ce === void 0 ? [] : se.filter((e) => e.at >= ce), de = (e, t) => {
3447
3510
  a && (A(null), a.agent.rewind(e.id, t).then((e) => {
3448
3511
  e && a.onApplied(e);
3449
3512
  }));
@@ -3452,11 +3515,11 @@ function Yn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
3452
3515
  return [...new Set(n.filter(Boolean))];
3453
3516
  }, J = (e, t) => {
3454
3517
  let n = fe(e);
3455
- n.length ? ne({
3518
+ n.length ? re({
3456
3519
  entry: e,
3457
3520
  steps: n,
3458
3521
  ...t === void 0 ? {} : { text: t }
3459
- }) : q(e, t);
3522
+ }) : de(e, t);
3460
3523
  }, pe = a ? {
3461
3524
  available: (e) => a.agent.activity.some((t) => t.id === e.id) && a.agent.rewindable(e.id),
3462
3525
  disabled: a.agent.running,
@@ -3468,7 +3531,7 @@ function Yn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
3468
3531
  e && a.onApplied(e);
3469
3532
  }),
3470
3533
  onCardAction: (e, t, n) => a.agent.cardAction(e, t, n)
3471
- } : void 0, Y = he ? Ft(V, he.canAnswer) : null, ge = a?.id === "agentico-orchestrator" && a.scopedSubagentId ? W(a.scopedSubagentId) : void 0, _e = ge?.manualEntry ? ge : null, X = P(!0);
3534
+ } : void 0, Y = he ? Ft(z, he.canAnswer) : null, ge = a?.id === "agentico-orchestrator" && a.scopedSubagentId ? W(a.scopedSubagentId) : void 0, _e = ge?.manualEntry ? ge : null, X = N(!0);
3472
3535
  j(() => {
3473
3536
  let e = D.current;
3474
3537
  if (!e) return;
@@ -3480,16 +3543,16 @@ function Yn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
3480
3543
  let e = D.current;
3481
3544
  e && (X.current = !0, e.scrollTop = e.scrollHeight);
3482
3545
  }, [a?.id]);
3483
- let ve = V.at(-1)?.detail?.length ?? 0;
3546
+ let ve = z.at(-1)?.detail?.length ?? 0;
3484
3547
  j(() => {
3485
3548
  let e = D.current;
3486
3549
  e && X.current && (e.scrollTop = e.scrollHeight);
3487
3550
  }, [
3488
- re,
3551
+ B,
3489
3552
  ae,
3490
3553
  ve
3491
3554
  ]);
3492
- let ye = P(null);
3555
+ let ye = N(null);
3493
3556
  j(() => {
3494
3557
  let e = D.current, t = ye.current;
3495
3558
  if (!e || !t || typeof ResizeObserver > "u") return;
@@ -3498,7 +3561,7 @@ function Yn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
3498
3561
  });
3499
3562
  return n.observe(t), () => n.disconnect();
3500
3563
  }, [a?.id, o]);
3501
- let be = s ? /* @__PURE__ */ L(In, { userGoal: s }, c) : null, xe = f ? W(f.subagentId) : void 0, Se = f && xe ? /* @__PURE__ */ L(Fn, {
3564
+ let be = s ? /* @__PURE__ */ I(In, { userGoal: s }, c) : null, xe = f ? W(f.subagentId) : void 0, Se = f && xe ? /* @__PURE__ */ I(Fn, {
3502
3565
  manifest: xe,
3503
3566
  params: f.snapshot.params,
3504
3567
  taskId: et(f.subagentId, f.entityId),
@@ -3506,45 +3569,45 @@ function Yn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
3506
3569
  history: f.snapshot.history,
3507
3570
  activity: f.snapshot.activity
3508
3571
  }
3509
- }, p) : null, Ce = g ? W(g.subagentId) : void 0, we = g && Ce ? /* @__PURE__ */ L(Ln, {
3572
+ }, p) : null, Ce = g ? W(g.subagentId) : void 0, we = g && Ce ? /* @__PURE__ */ I(Ln, {
3510
3573
  manifest: Ce,
3511
3574
  extraDestinations: g.extraDestinations
3512
- }, _) : null, Te = x ? W(x.subagentId) : void 0, Ee = x && Te ? /* @__PURE__ */ L(Fn, {
3575
+ }, _) : null, Te = x ? W(x.subagentId) : void 0, Ee = x && Te ? /* @__PURE__ */ I(Fn, {
3513
3576
  manifest: Te,
3514
3577
  params: x.params,
3515
3578
  extraDestinations: x.extraDestinations
3516
- }, S) : null, De = C ? W(C.subagentId) : void 0, Oe = C && De ? /* @__PURE__ */ L(Fn, {
3579
+ }, S) : null, De = C ? W(C.subagentId) : void 0, Oe = C && De ? /* @__PURE__ */ I(Fn, {
3517
3580
  manifest: De,
3518
3581
  params: C.params,
3519
3582
  taskId: C.taskId,
3520
3583
  openingMessage: C.openingMessage
3521
3584
  }, w) : null;
3522
- return o ? /* @__PURE__ */ R(I, { children: [
3585
+ return o ? /* @__PURE__ */ L(F, { children: [
3523
3586
  be,
3524
3587
  Se,
3525
3588
  we,
3526
3589
  Ee,
3527
3590
  Oe,
3528
- /* @__PURE__ */ R("div", {
3529
- style: { width: z.width },
3591
+ /* @__PURE__ */ L("div", {
3592
+ style: { width: R.width },
3530
3593
  className: "relative flex h-full shrink-0 flex-col border-l border-border bg-background",
3531
3594
  children: [
3532
- /* @__PURE__ */ L(Qt, {
3533
- width: z.width,
3534
- min: z.min,
3535
- max: z.max,
3536
- onResize: z.set,
3537
- onCommit: z.commit,
3538
- onReset: z.reset
3595
+ /* @__PURE__ */ I(Qt, {
3596
+ width: R.width,
3597
+ min: R.min,
3598
+ max: R.max,
3599
+ onResize: R.set,
3600
+ onCommit: R.commit,
3601
+ onReset: R.reset
3539
3602
  }),
3540
- /* @__PURE__ */ R("div", {
3603
+ /* @__PURE__ */ L("div", {
3541
3604
  className: "flex min-h-[60px] items-center gap-1 border-b border-border/60 px-4 py-3",
3542
3605
  children: [
3543
- /* @__PURE__ */ L("span", {
3606
+ /* @__PURE__ */ I("span", {
3544
3607
  className: "min-w-0 flex-1 truncate text-lg font-semibold leading-tight",
3545
3608
  children: a ? a.title : "Agentico"
3546
3609
  }),
3547
- a?.thread && ee && /* @__PURE__ */ L(t, {
3610
+ a?.thread && ee && /* @__PURE__ */ I(t, {
3548
3611
  icon: G ? "activity" : "message-square",
3549
3612
  ariaLabel: G ? E.hideEvents : E.showEvents,
3550
3613
  title: G ? E.hideEvents : E.showEvents,
@@ -3552,26 +3615,26 @@ function Yn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
3552
3615
  className: `p-1 ${G ? "text-primary" : "text-muted-foreground"}`,
3553
3616
  onClick: () => K(!G)
3554
3617
  }),
3555
- T && /* @__PURE__ */ L(Jn, {
3618
+ T && /* @__PURE__ */ I(Jn, {
3556
3619
  scopeId: T.id,
3557
3620
  currentTaskId: a?.id ?? null,
3558
3621
  open: O,
3559
3622
  onOpenChange: te,
3560
- onNewChat: B,
3623
+ onNewChat: ie,
3561
3624
  onSelect: (e, t, n) => h(e, t, n),
3562
3625
  onArchivedCurrent: m
3563
3626
  }),
3564
- /* @__PURE__ */ L($t, {})
3627
+ /* @__PURE__ */ I($t, {})
3565
3628
  ]
3566
3629
  }),
3567
- /* @__PURE__ */ L("div", {
3630
+ /* @__PURE__ */ I("div", {
3568
3631
  ref: D,
3569
3632
  className: `flex-1 overflow-y-auto px-3 pb-2 ${Y ? "min-h-24" : "min-h-0"}`,
3570
- children: /* @__PURE__ */ L("div", {
3633
+ children: /* @__PURE__ */ I("div", {
3571
3634
  ref: ye,
3572
3635
  className: "pt-2",
3573
- children: a ? /* @__PURE__ */ R(I, { children: [
3574
- T && a.thread && /* @__PURE__ */ L(Bn, {
3636
+ children: a ? /* @__PURE__ */ L(F, { children: [
3637
+ T && a.thread && /* @__PURE__ */ I(Bn, {
3575
3638
  scopeId: T.id,
3576
3639
  thread: a.thread,
3577
3640
  taskId: a.id,
@@ -3583,40 +3646,40 @@ function Yn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
3583
3646
  },
3584
3647
  onContinue: (e) => h(e.subagentId, e.entityId, e)
3585
3648
  }),
3586
- a.manualEntry && V.length === 0 && /* @__PURE__ */ L("p", {
3649
+ a.manualEntry && z.length === 0 && /* @__PURE__ */ I("p", {
3587
3650
  className: "text-xs text-muted-foreground",
3588
3651
  children: a.manualEntry.prompt
3589
3652
  }),
3590
- /* @__PURE__ */ L(Vt, {
3653
+ /* @__PURE__ */ I(Vt, {
3591
3654
  activity: H,
3592
3655
  questions: he,
3593
3656
  docked: Y,
3594
3657
  pinUserMessages: !Y,
3595
3658
  messageActions: pe,
3596
3659
  speaker: a.speaker,
3597
- events: ue
3660
+ events: le
3598
3661
  }),
3599
- a.panelExtra && /* @__PURE__ */ L("div", {
3662
+ a.panelExtra && /* @__PURE__ */ I("div", {
3600
3663
  className: "mt-3",
3601
3664
  children: a.panelExtra
3602
3665
  }),
3603
- U.length > 0 && /* @__PURE__ */ L(Vt, {
3666
+ U.length > 0 && /* @__PURE__ */ I(Vt, {
3604
3667
  activity: U,
3605
3668
  questions: he,
3606
3669
  docked: Y,
3607
3670
  pinUserMessages: !Y,
3608
3671
  messageActions: pe,
3609
3672
  speaker: a.speaker,
3610
- events: de
3673
+ events: ue
3611
3674
  }),
3612
- !a.agent.running && a.agent.error && /* @__PURE__ */ R("div", {
3675
+ !a.agent.running && a.agent.error && /* @__PURE__ */ L("div", {
3613
3676
  className: "mt-2 flex items-center gap-2",
3614
3677
  children: [
3615
- /* @__PURE__ */ L("p", {
3678
+ /* @__PURE__ */ I("p", {
3616
3679
  className: "flex-1 text-xs text-destructive",
3617
3680
  children: a.agent.error
3618
3681
  }),
3619
- /* @__PURE__ */ L(t, {
3682
+ /* @__PURE__ */ I(t, {
3620
3683
  label: E.retry,
3621
3684
  variant: "secondary",
3622
3685
  className: "shrink-0",
@@ -3631,7 +3694,7 @@ function Yn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
3631
3694
  });
3632
3695
  }
3633
3696
  }),
3634
- !a.agent.remote && a.agent.offersFallback !== !1 && /* @__PURE__ */ L(t, {
3697
+ !a.agent.remote && a.agent.offersFallback !== !1 && /* @__PURE__ */ I(t, {
3635
3698
  label: E.continueWithoutAi,
3636
3699
  variant: "secondary",
3637
3700
  className: "shrink-0",
@@ -3646,32 +3709,32 @@ function Yn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
3646
3709
  })
3647
3710
  ]
3648
3711
  })
3649
- ] }) : d.length > 0 ? /* @__PURE__ */ L(qn, { messages: d }) : u ? /* @__PURE__ */ L(Kn, { card: u }) : /* @__PURE__ */ L("p", {
3712
+ ] }) : d.length > 0 ? /* @__PURE__ */ I(qn, { messages: d }) : u ? /* @__PURE__ */ I(Kn, { card: u }) : /* @__PURE__ */ I("p", {
3650
3713
  className: "text-xs text-muted-foreground",
3651
3714
  children: l ?? E.orchestratorStarterHint
3652
3715
  })
3653
3716
  })
3654
3717
  }),
3655
- a && Y ? /* @__PURE__ */ R("section", {
3718
+ a && Y ? /* @__PURE__ */ L("section", {
3656
3719
  "aria-label": E.pendingQuestions,
3657
3720
  className: "flex min-h-0 shrink flex-col border-t border-border/60",
3658
3721
  children: [
3659
- a.panelActions && /* @__PURE__ */ L("div", {
3722
+ a.panelActions && /* @__PURE__ */ I("div", {
3660
3723
  className: "shrink-0 px-4 pt-3",
3661
3724
  children: a.panelActions
3662
3725
  }),
3663
- /* @__PURE__ */ L("div", {
3726
+ /* @__PURE__ */ I("div", {
3664
3727
  className: "min-h-0 overflow-y-auto px-4 py-3",
3665
- children: /* @__PURE__ */ L(It, {
3728
+ children: /* @__PURE__ */ I(It, {
3666
3729
  entry: Y.entry,
3667
3730
  part: Y.part,
3668
3731
  questions: he,
3669
3732
  autoFocus: !0
3670
3733
  }, `${Y.entry.id}:${Y.part.id}`)
3671
3734
  }),
3672
- a.agent.running && /* @__PURE__ */ L("div", {
3735
+ a.agent.running && /* @__PURE__ */ I("div", {
3673
3736
  className: "flex shrink-0 justify-end px-4 pb-3",
3674
- children: /* @__PURE__ */ L(t, {
3737
+ children: /* @__PURE__ */ I(t, {
3675
3738
  icon: "square",
3676
3739
  label: E.stop,
3677
3740
  variant: "secondary",
@@ -3679,33 +3742,33 @@ function Yn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
3679
3742
  })
3680
3743
  })
3681
3744
  ]
3682
- }) : /* @__PURE__ */ R("div", {
3745
+ }) : /* @__PURE__ */ L("div", {
3683
3746
  className: "border-t border-border/60 px-4 py-3",
3684
- children: [a?.panelActions && /* @__PURE__ */ L("div", {
3747
+ children: [a?.panelActions && /* @__PURE__ */ I("div", {
3685
3748
  className: "mb-2",
3686
3749
  children: a.panelActions
3687
- }), a ? /* @__PURE__ */ L(Hn, {
3750
+ }), a ? /* @__PURE__ */ I(Hn, {
3688
3751
  task: a,
3689
3752
  editing: k,
3690
3753
  onCancelEdit: () => A(null),
3691
3754
  onSendEdit: (e, t) => J(e, t)
3692
- }, a.id) : /* @__PURE__ */ L(Un, {})]
3755
+ }, a.id) : /* @__PURE__ */ I(Un, {})]
3693
3756
  }),
3694
- M && /* @__PURE__ */ R(v, {
3757
+ ne && /* @__PURE__ */ L(v, {
3695
3758
  title: E.rewindTitle,
3696
- onClose: () => ne(null),
3697
- onYes: async () => (q(M.entry, M.text), !0),
3698
- children: [/* @__PURE__ */ L("p", {
3759
+ onClose: () => re(null),
3760
+ onYes: async () => (de(ne.entry, ne.text), !0),
3761
+ children: [/* @__PURE__ */ I("p", {
3699
3762
  className: "text-sm",
3700
3763
  children: E.rewindText
3701
- }), /* @__PURE__ */ L("ul", {
3764
+ }), /* @__PURE__ */ I("ul", {
3702
3765
  className: "mt-2 list-disc space-y-0.5 ps-5 text-sm text-muted-foreground",
3703
- children: M.steps.slice(0, 8).map((e) => /* @__PURE__ */ L("li", { children: e }, e))
3766
+ children: ne.steps.slice(0, 8).map((e) => /* @__PURE__ */ I("li", { children: e }, e))
3704
3767
  })]
3705
3768
  })
3706
3769
  ]
3707
3770
  })
3708
- ] }) : /* @__PURE__ */ R(I, { children: [
3771
+ ] }) : /* @__PURE__ */ L(F, { children: [
3709
3772
  be,
3710
3773
  Se,
3711
3774
  we,
@@ -3716,13 +3779,13 @@ function Yn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
3716
3779
  //#endregion
3717
3780
  //#region src/presentation/useAgenticoPageContext.ts
3718
3781
  function Xn(e, t) {
3719
- let { setPageContext: n } = ft(), r = P(crypto.randomUUID()).current;
3782
+ let { setPageContext: n } = ft(), r = N(crypto.randomUUID()).current;
3720
3783
  j(() => (n(r, e, t ?? null), () => n(r, null)), [e, t]);
3721
3784
  }
3722
3785
  //#endregion
3723
3786
  //#region src/presentation/useSubagentComponentContext.ts
3724
3787
  function Zn(e, t, n, r, i = !0, a) {
3725
- let { registerComponentAnchor: o } = ft(), s = P(crypto.randomUUID()).current, c = P(n);
3788
+ let { registerComponentAnchor: o } = ft(), s = N(crypto.randomUUID()).current, c = N(n);
3726
3789
  c.current = n, j(() => {
3727
3790
  if (i) return o(s, {
3728
3791
  subagentId: e,
@@ -3740,6 +3803,6 @@ function Zn(e, t, n, r, i = !0, a) {
3740
3803
  ]);
3741
3804
  }
3742
3805
  //#endregion
3743
- export { Wt as AGENTICO_MAX_WIDTH, Ut as AGENTICO_MIN_WIDTH, Ht as AGENTICO_WIDTH, Gt as AGENTICO_WIDTH_STORAGE_KEY, Yn as Agentico, dt as AgenticoProvider, $t as AgenticoToggle, z as DEFAULT_REASONING_PART_ID, ne as DEFAULT_TEXT_PART_ID, Ce as JSON_EXPORT_DESTINATION_ID, ve as MICRO_PROMPT_REGISTRY, lt as ORCHESTRATOR_TASK_ID, at as PREVIEW_LIMIT, it as PREVIEW_MAX, X as SUMMARY_MICRO_PROMPT, Ae as agenticoDe, Oe as agenticoEn, ke as agenticoIt, ue as agenticoPromptsEn, de as agenticoPromptsIt, ct as agenticoTranslations, ye as applyMicroPrompts, Ye as chatHasPersonMessage, Q as chatStartedAt, tt as chatThreadOf, Je as chatTitle, fe as configureAgenticoPrompts, Ne as configureEntityChatStore, oe as createCrossAgentTools, ie as defineSubagent, nt as earlierSessions, et as entityChatTaskId, be as extractErrorMessage, xe as extractJsonBlock, W as findSubagentManifest, re as formatQuestionAnswers, J as getAgenticoPrompts, De as getDestinationRegistry, Ue as getEntityChat, Dn as getSubagentControls, ae as getSubagentRegistry, Sn as getSubagentReport, Pe as hasEntityChatBackend, st as imagePreviews, we as jsonExportDestination, $e as listEntityChats, V as messagePartsText, Ve as onEntityChatsChange, rt as placeEvents, K as registerCrossAgentTools, Ee as registerDestinations, En as registerSubagentControls, xn as registerSubagentReports, U as registerSubagents, Qe as removeEntityChat, Ze as renameEntityChat, _e as renderRegistryCli, ge as renderSubagentCli, pe as resetAgenticoPrompts, We as saveEntityChat, Le as syncEntityChats, se as toJsonSchema, ce as toMcpTool, B as upsertMessagePart, fn as useAgent, ft as useAgentico, $ as useAgenticoI18n, Xn as useAgenticoPageContext, Zn as useSubagentComponentContext };
3806
+ export { Wt as AGENTICO_MAX_WIDTH, Ut as AGENTICO_MIN_WIDTH, Ht as AGENTICO_WIDTH, Gt as AGENTICO_WIDTH_STORAGE_KEY, Yn as Agentico, dt as AgenticoProvider, $t as AgenticoToggle, R as DEFAULT_REASONING_PART_ID, re as DEFAULT_TEXT_PART_ID, Ce as JSON_EXPORT_DESTINATION_ID, ve as MICRO_PROMPT_REGISTRY, lt as ORCHESTRATOR_TASK_ID, at as PREVIEW_LIMIT, it as PREVIEW_MAX, X as SUMMARY_MICRO_PROMPT, Ae as agenticoDe, Oe as agenticoEn, ke as agenticoIt, le as agenticoPromptsEn, ue as agenticoPromptsIt, ct as agenticoTranslations, ye as applyMicroPrompts, Ye as chatHasPersonMessage, Q as chatStartedAt, tt as chatThreadOf, Je as chatTitle, fe as configureAgenticoPrompts, Ne as configureEntityChatStore, q as createCrossAgentTools, V as defineSubagent, nt as earlierSessions, et as entityChatTaskId, be as extractErrorMessage, xe as extractJsonBlock, W as findSubagentManifest, B as formatQuestionAnswers, J as getAgenticoPrompts, De as getDestinationRegistry, Ue as getEntityChat, Dn as getSubagentControls, ae as getSubagentRegistry, Sn as getSubagentReport, Pe as hasEntityChatBackend, st as imagePreviews, we as jsonExportDestination, $e as listEntityChats, z as messagePartsText, Ve as onEntityChatsChange, rt as placeEvents, K as registerCrossAgentTools, Ee as registerDestinations, En as registerSubagentControls, xn as registerSubagentReports, U as registerSubagents, Qe as removeEntityChat, Ze as renameEntityChat, _e as renderRegistryCli, ge as renderSubagentCli, pe as resetAgenticoPrompts, We as saveEntityChat, Le as syncEntityChats, oe as toJsonSchema, se as toMcpTool, ie as upsertMessagePart, fn as useAgent, ft as useAgentico, $ as useAgenticoI18n, Xn as useAgenticoPageContext, Zn as useSubagentComponentContext };
3744
3807
 
3745
3808
  //# sourceMappingURL=index.mjs.map