@llmnative/agentico 0.17.1 → 0.17.2

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
@@ -316,6 +316,10 @@ var Ee = {
316
316
  continueWithoutAiFallback: "Continuing without AI — using the deterministic result.",
317
317
  oneStep: "1 step",
318
318
  steps: "{count} steps",
319
+ reasoningNow: "Reasoning…",
320
+ reasonedFor: "Reasoned for {seconds} s",
321
+ reasoned: "Reasoned",
322
+ processDetails: "Reasoning and steps",
319
323
  stepsLabel: "Steps of the agent",
320
324
  newInstance: "New \"{label}\" instance",
321
325
  chatHistory: "Chat history",
@@ -388,6 +392,10 @@ var Ee = {
388
392
  continueWithoutAiFallback: "Continuo senza AI — uso il risultato deterministico.",
389
393
  oneStep: "1 passo",
390
394
  steps: "{count} passi",
395
+ reasoningNow: "Sta ragionando…",
396
+ reasonedFor: "Ha ragionato {seconds} s",
397
+ reasoned: "Ha ragionato",
398
+ processDetails: "Ragionamento e passi",
391
399
  stepsLabel: "Passi dell'agente",
392
400
  newInstance: "Nuova istanza di \"{label}\"",
393
401
  chatHistory: "Storico chat",
@@ -460,6 +468,10 @@ var Ee = {
460
468
  continueWithoutAiFallback: "Weiter ohne AI — das deterministische Ergebnis wird verwendet.",
461
469
  oneStep: "1 Schritt",
462
470
  steps: "{count} Schritte",
471
+ reasoningNow: "Denkt nach…",
472
+ reasonedFor: "{seconds} s nachgedacht",
473
+ reasoned: "Nachgedacht",
474
+ processDetails: "Überlegungen und Schritte",
463
475
  stepsLabel: "Schritte des Agenten",
464
476
  newInstance: "Neue Instanz von \"{label}\"",
465
477
  chatHistory: "Chatverlauf",
@@ -975,103 +987,136 @@ function gt({ author: e, size: t = 20 }) {
975
987
  title: e.name
976
988
  });
977
989
  }
978
- function _t({ speaker: e }) {
979
- return /* @__PURE__ */ z("div", {
980
- className: "flex items-center gap-1.5 pt-1 text-xs font-medium text-foreground",
981
- children: [/* @__PURE__ */ R(gt, {
982
- author: e,
983
- size: 18
984
- }), /* @__PURE__ */ R("span", {
985
- className: "truncate",
986
- children: e.name
987
- })]
990
+ var _t = "w-6";
991
+ function vt(e) {
992
+ if (!e || e.kind !== "thinking" || !e.parts) return [];
993
+ let t = [];
994
+ for (let n of e.parts) {
995
+ if (n.type !== "reasoning" && n.type !== "tool") break;
996
+ t.push(n);
997
+ }
998
+ return t;
999
+ }
1000
+ function yt({ parts: e, open: t, onToggle: n }) {
1001
+ 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");
1002
+ return /* @__PURE__ */ z("button", {
1003
+ type: "button",
1004
+ onClick: n,
1005
+ "aria-expanded": t,
1006
+ title: r.processDetails,
1007
+ className: "inline-flex min-w-0 items-center gap-1 rounded text-xs text-muted-foreground hover:text-foreground",
1008
+ children: [
1009
+ /* @__PURE__ */ R(f, {
1010
+ name: u ? "loader-circle" : d ? "circle-alert" : i.length ? "brain" : "list-checks",
1011
+ size: 12,
1012
+ className: `shrink-0 ${u ? "animate-spin" : ""}`
1013
+ }),
1014
+ /* @__PURE__ */ R("span", {
1015
+ className: "truncate",
1016
+ children: l.join(" · ")
1017
+ }),
1018
+ /* @__PURE__ */ R(f, {
1019
+ name: t ? "chevron-up" : "chevron-down",
1020
+ size: 12,
1021
+ className: "shrink-0"
1022
+ })
1023
+ ]
988
1024
  });
989
1025
  }
990
- function vt({ entry: e, pinned: n = !0, actions: r, cut: i = !1, showAuthor: a = !1 }) {
1026
+ function bt({ entry: e, pinned: n = !0, actions: r, cut: i = !1, showAuthor: a = !1 }) {
991
1027
  let o = $(), s = F(null), [c, l] = I(!1), [u, d] = I(!1);
992
1028
  N(() => {
993
1029
  let e = s.current;
994
1030
  e && d(e.scrollHeight > 97);
995
1031
  }, [e.detail, e.attachmentNames]);
996
- let p = u && !c;
997
- return /* @__PURE__ */ z("div", {
998
- 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`,
999
- children: [
1000
- r?.available(e) && /* @__PURE__ */ z("span", {
1001
- className: "flex shrink-0 items-center",
1002
- children: [i && /* @__PURE__ */ R(t, {
1003
- icon: "rotate-ccw",
1004
- ariaLabel: o.retry,
1005
- title: o.retry,
1006
- variant: "link",
1007
- className: "p-1 text-muted-foreground hover:text-foreground",
1008
- disabled: r.disabled,
1009
- onClick: () => r.onRetry(e)
1010
- }), /* @__PURE__ */ R("span", {
1011
- className: "opacity-0 transition-opacity focus-within:opacity-100 group-hover:opacity-100",
1012
- children: /* @__PURE__ */ R(t, {
1013
- icon: "pencil",
1014
- ariaLabel: o.editMessage,
1015
- title: o.editMessage,
1016
- variant: "link",
1017
- className: "p-1 text-muted-foreground hover:text-foreground",
1018
- disabled: r.disabled,
1019
- onClick: () => r.onEdit(e)
1020
- })
1021
- })]
1022
- }),
1023
- a && /* @__PURE__ */ R("span", {
1024
- className: "mt-0.5 shrink-0",
1025
- children: e.author ? /* @__PURE__ */ R(gt, { author: e.author }) : /* @__PURE__ */ R("span", {
1032
+ let p = u && !c, m = r?.available(e) && i ? /* @__PURE__ */ R(t, {
1033
+ icon: "rotate-ccw",
1034
+ ariaLabel: o.retry,
1035
+ title: o.retry,
1036
+ variant: "link",
1037
+ className: "p-1 text-muted-foreground hover:text-foreground",
1038
+ disabled: r.disabled,
1039
+ onClick: () => r.onRetry(e)
1040
+ }) : null, h = r?.available(e) ? /* @__PURE__ */ R("span", {
1041
+ className: "opacity-0 transition-opacity focus-within:opacity-100 group-hover:opacity-100",
1042
+ children: /* @__PURE__ */ R(t, {
1043
+ icon: "pencil",
1044
+ ariaLabel: o.editMessage,
1045
+ title: o.editMessage,
1046
+ variant: "link",
1047
+ className: "p-1 text-muted-foreground hover:text-foreground",
1048
+ disabled: r.disabled,
1049
+ onClick: () => r.onEdit(e)
1050
+ })
1051
+ }) : null, g = (t) => /* @__PURE__ */ z("div", {
1052
+ className: `${t ? "w-full" : "max-w-[85%]"} rounded-lg bg-primary/10 text-xs text-foreground`,
1053
+ children: [/* @__PURE__ */ z("div", {
1054
+ ref: s,
1055
+ className: `space-y-1 px-2.5 pt-1.5 ${p ? "overflow-hidden" : ""}`,
1056
+ style: p ? { maxHeight: mt } : void 0,
1057
+ children: [e.attachmentNames && e.attachmentNames.length > 0 && /* @__PURE__ */ R("div", {
1058
+ className: "flex flex-wrap gap-1",
1059
+ children: e.attachmentNames.map((e, t) => /* @__PURE__ */ z("span", {
1060
+ className: "inline-flex items-center gap-1 rounded-md bg-primary/15 px-1.5 py-0.5 text-[11px] text-foreground",
1061
+ children: [/* @__PURE__ */ R(f, {
1062
+ name: "paperclip",
1063
+ size: 10,
1064
+ className: "shrink-0"
1065
+ }), /* @__PURE__ */ R("span", {
1066
+ className: "max-w-[160px] truncate",
1067
+ children: e
1068
+ })]
1069
+ }, t))
1070
+ }), /* @__PURE__ */ R(ut, { text: e.detail ?? "" })]
1071
+ }), u && /* @__PURE__ */ z("button", {
1072
+ type: "button",
1073
+ onClick: () => l((e) => !e),
1074
+ className: "relative flex w-full items-center justify-center rounded-b-lg py-1 text-muted-foreground hover:bg-primary/15",
1075
+ title: c ? "Comprimi" : "Espandi",
1076
+ children: [p && /* @__PURE__ */ R("div", { className: "pointer-events-none absolute inset-x-0 -top-4 h-4 bg-gradient-to-t from-primary/10 to-transparent" }), /* @__PURE__ */ R(f, {
1077
+ name: c ? "chevron-up" : "chevron-down",
1078
+ size: 12
1079
+ })]
1080
+ })]
1081
+ });
1082
+ return a ? /* @__PURE__ */ z("div", {
1083
+ className: `${n ? "sticky top-0 z-20 border-b border-border/40" : ""} group flex items-start gap-2 bg-background py-1.5`,
1084
+ children: [/* @__PURE__ */ z("span", {
1085
+ className: `flex shrink-0 flex-col items-center ${_t}`,
1086
+ children: [
1087
+ e.author ? /* @__PURE__ */ R(gt, { author: e.author }) : /* @__PURE__ */ R("span", {
1026
1088
  className: "flex h-5 w-5 items-center justify-center rounded-full bg-muted text-muted-foreground",
1027
1089
  "aria-hidden": !0,
1028
1090
  children: /* @__PURE__ */ R(f, {
1029
1091
  name: "user",
1030
1092
  size: 12
1031
1093
  })
1032
- })
1033
- }),
1034
- /* @__PURE__ */ z("div", {
1035
- className: "max-w-[85%] rounded-lg bg-primary/10 text-xs text-foreground",
1036
- children: [/* @__PURE__ */ z("div", {
1037
- ref: s,
1038
- className: `space-y-1 px-2.5 pt-1.5 ${p ? "overflow-hidden" : ""}`,
1039
- style: p ? { maxHeight: mt } : void 0,
1040
- children: [e.attachmentNames && e.attachmentNames.length > 0 && /* @__PURE__ */ R("div", {
1041
- className: "flex flex-wrap gap-1",
1042
- children: e.attachmentNames.map((e, t) => /* @__PURE__ */ z("span", {
1043
- className: "inline-flex items-center gap-1 rounded-md bg-primary/15 px-1.5 py-0.5 text-[11px] text-foreground",
1044
- children: [/* @__PURE__ */ R(f, {
1045
- name: "paperclip",
1046
- size: 10,
1047
- className: "shrink-0"
1048
- }), /* @__PURE__ */ R("span", {
1049
- className: "max-w-[160px] truncate",
1050
- children: e
1051
- })]
1052
- }, t))
1053
- }), /* @__PURE__ */ R(ut, { text: e.detail ?? "" })]
1054
- }), u && /* @__PURE__ */ z("button", {
1055
- type: "button",
1056
- onClick: () => l((e) => !e),
1057
- className: "relative flex w-full items-center justify-center rounded-b-lg py-1 text-muted-foreground hover:bg-primary/15",
1058
- title: c ? "Comprimi" : "Espandi",
1059
- children: [p && /* @__PURE__ */ R("div", { className: "pointer-events-none absolute inset-x-0 -top-4 h-4 bg-gradient-to-t from-primary/10 to-transparent" }), /* @__PURE__ */ R(f, {
1060
- name: c ? "chevron-up" : "chevron-down",
1061
- size: 12
1062
- })]
1063
- })]
1064
- })
1065
- ]
1094
+ }),
1095
+ m,
1096
+ h
1097
+ ]
1098
+ }), /* @__PURE__ */ z("div", {
1099
+ className: "min-w-0 flex-1",
1100
+ children: [e.author && /* @__PURE__ */ R("div", {
1101
+ className: "pb-0.5 text-xs font-medium text-foreground",
1102
+ children: e.author.name
1103
+ }), g(!0)]
1104
+ })]
1105
+ }) : /* @__PURE__ */ z("div", {
1106
+ 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`,
1107
+ children: [r?.available(e) && /* @__PURE__ */ z("span", {
1108
+ className: "flex shrink-0 items-center",
1109
+ children: [m, h]
1110
+ }), g(!1)]
1066
1111
  });
1067
1112
  }
1068
- var yt = {
1113
+ var xt = {
1069
1114
  running: "loader-circle",
1070
1115
  done: "check",
1071
1116
  error: "x",
1072
1117
  stopped: "circle-slash"
1073
1118
  };
1074
- function bt({ steps: e }) {
1119
+ function St({ steps: e }) {
1075
1120
  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 }));
1076
1121
  return /* @__PURE__ */ R(b, {
1077
1122
  ariaLabel: t.stepsLabel,
@@ -1087,12 +1132,12 @@ function bt({ steps: e }) {
1087
1132
  className: e.status === "error" ? "text-destructive" : void 0,
1088
1133
  children: e.label
1089
1134
  }),
1090
- icon: yt[e.status]
1135
+ icon: xt[e.status]
1091
1136
  }))
1092
1137
  }]
1093
1138
  });
1094
1139
  }
1095
- function xt({ entry: e, part: a, questions: o }) {
1140
+ function Ct({ entry: e, part: a, questions: o }) {
1096
1141
  let s = $(), [c, l] = I(!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";
1097
1142
  return /* @__PURE__ */ z(r, {
1098
1143
  headerClassName: "flex items-center justify-between gap-2 px-3 py-2",
@@ -1166,7 +1211,7 @@ function xt({ entry: e, part: a, questions: o }) {
1166
1211
  })]
1167
1212
  });
1168
1213
  }
1169
- function St(e, t) {
1214
+ function wt(e, t) {
1170
1215
  let n = e.at(-1);
1171
1216
  if (!n || n.kind !== "thinking" || !n.parts || n.status === "stopped" || n.status === "error") return null;
1172
1217
  let r = [...n.parts].reverse().find((e) => e.type === "questions");
@@ -1175,7 +1220,7 @@ function St(e, t) {
1175
1220
  part: r
1176
1221
  };
1177
1222
  }
1178
- function Ct({ entry: e, part: t, questions: n, autoFocus: r, className: i }) {
1223
+ function Tt({ entry: e, part: t, questions: n, autoFocus: r, className: i }) {
1179
1224
  let o = !!n?.canAnswer(e.id);
1180
1225
  return /* @__PURE__ */ R(a, {
1181
1226
  questions: t.questions,
@@ -1186,22 +1231,22 @@ function Ct({ entry: e, part: t, questions: n, autoFocus: r, className: i }) {
1186
1231
  className: i ?? "text-xs"
1187
1232
  });
1188
1233
  }
1189
- function wt({ entry: e, questions: t, hiddenPartId: n }) {
1190
- let r = (e.parts ?? []).filter((e) => e.type !== "questions" || e.id !== n), a = [];
1191
- for (let e of r) {
1192
- let t = a.at(-1);
1193
- e.type === "tool" ? t && "steps" in t ? t.steps.push(e) : a.push({
1234
+ function Et({ entry: e, questions: t, hiddenPartId: n, skip: r }) {
1235
+ let a = (e.parts ?? []).filter((e) => (e.type !== "questions" || e.id !== n) && !r?.has(e.id)), s = [];
1236
+ for (let e of a) {
1237
+ let t = s.at(-1);
1238
+ e.type === "tool" ? t && "steps" in t ? t.steps.push(e) : s.push({
1194
1239
  key: `tool-${e.id}`,
1195
1240
  steps: [e]
1196
- }) : a.push({
1241
+ }) : s.push({
1197
1242
  key: `${e.type}-${e.id}`,
1198
1243
  part: e
1199
1244
  });
1200
1245
  }
1201
1246
  return /* @__PURE__ */ R("div", {
1202
1247
  className: "space-y-2",
1203
- children: a.map((n) => {
1204
- if ("steps" in n) return /* @__PURE__ */ R(bt, { steps: n.steps }, n.key);
1248
+ children: s.map((n) => {
1249
+ if ("steps" in n) return /* @__PURE__ */ R(St, { steps: n.steps }, n.key);
1205
1250
  let { part: r } = n;
1206
1251
  return r.type === "text" ? r.text.trim() ? /* @__PURE__ */ R(i, {
1207
1252
  content: r.text,
@@ -1212,11 +1257,11 @@ function wt({ entry: e, questions: t, hiddenPartId: n }) {
1212
1257
  streaming: r.streaming,
1213
1258
  duration: r.duration,
1214
1259
  className: "my-0"
1215
- }, n.key) : r.type === "card" ? /* @__PURE__ */ R(xt, {
1260
+ }, n.key) : r.type === "card" ? /* @__PURE__ */ R(Ct, {
1216
1261
  entry: e,
1217
1262
  part: r,
1218
1263
  questions: t
1219
- }, n.key) : /* @__PURE__ */ R(Ct, {
1264
+ }, n.key) : /* @__PURE__ */ R(Tt, {
1220
1265
  entry: e,
1221
1266
  part: r,
1222
1267
  questions: t
@@ -1224,29 +1269,30 @@ function wt({ entry: e, questions: t, hiddenPartId: n }) {
1224
1269
  })
1225
1270
  });
1226
1271
  }
1227
- function Tt({ entry: e, questions: t, hiddenPartId: n }) {
1228
- let r = $();
1272
+ function Dt({ entry: e, questions: t, hiddenPartId: n, skip: r }) {
1273
+ let a = $();
1229
1274
  if (e.kind === "thinking" && e.parts) {
1230
- let i = e.status === "error" || e.status === "stopped" || e.status === "running";
1275
+ 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;
1231
1276
  return /* @__PURE__ */ z("li", {
1232
1277
  className: "text-xs text-muted-foreground",
1233
- children: [e.parts.length > 0 && /* @__PURE__ */ R(wt, {
1278
+ children: [o > 0 && /* @__PURE__ */ R(Et, {
1234
1279
  entry: e,
1235
1280
  questions: t,
1236
- hiddenPartId: n
1281
+ hiddenPartId: n,
1282
+ skip: r
1237
1283
  }), i && /* @__PURE__ */ z("div", {
1238
- className: `flex items-start gap-1.5 ${e.parts.length > 0 ? "mt-1" : ""}`,
1284
+ className: `flex items-start gap-1.5 ${o > 0 ? "mt-1" : ""}`,
1239
1285
  children: [/* @__PURE__ */ R("span", {
1240
1286
  className: "pt-px",
1241
1287
  children: /* @__PURE__ */ R(ft, { status: e.status })
1242
1288
  }), /* @__PURE__ */ z("span", {
1243
1289
  className: "min-w-0 flex-1 whitespace-pre-wrap break-words",
1244
- children: [pt(e, r), e.status === "running" && /* @__PURE__ */ R(dt, {})]
1290
+ children: [pt(e, a), e.status === "running" && /* @__PURE__ */ R(dt, {})]
1245
1291
  })]
1246
1292
  })]
1247
1293
  });
1248
1294
  }
1249
- let a = e.kind === "thinking" && e.detail ? ct(e.detail) : [], o = a.filter((e) => e.type === "code"), s = a.filter((e) => e.type === "text" && e.content.trim()), c = e.kind === "thinking" ? pt(e, r) : e.label;
1295
+ let o = e.kind === "thinking" && e.detail ? ct(e.detail) : [], s = o.filter((e) => e.type === "code"), c = o.filter((e) => e.type === "text" && e.content.trim()), l = e.kind === "thinking" ? pt(e, a) : e.label;
1250
1296
  return /* @__PURE__ */ z("li", {
1251
1297
  className: "text-xs text-muted-foreground",
1252
1298
  children: [
@@ -1257,19 +1303,19 @@ function Tt({ entry: e, questions: t, hiddenPartId: n }) {
1257
1303
  children: /* @__PURE__ */ R(ft, { status: e.status })
1258
1304
  }), /* @__PURE__ */ R("span", {
1259
1305
  className: "min-w-0 flex-1 whitespace-pre-wrap break-words",
1260
- children: c
1306
+ children: l
1261
1307
  })]
1262
1308
  }),
1263
- o.length > 0 && /* @__PURE__ */ R("div", {
1309
+ s.length > 0 && /* @__PURE__ */ R("div", {
1264
1310
  className: "mt-1 ml-[18px] space-y-1",
1265
- children: o.map((e, t) => /* @__PURE__ */ R(lt, {
1311
+ children: s.map((e, t) => /* @__PURE__ */ R(lt, {
1266
1312
  content: e.content,
1267
1313
  language: e.language
1268
1314
  }, t))
1269
1315
  }),
1270
- s.length > 0 && /* @__PURE__ */ R("div", {
1316
+ c.length > 0 && /* @__PURE__ */ R("div", {
1271
1317
  className: "mt-1 ml-[18px] space-y-2",
1272
- children: s.map((e, t) => /* @__PURE__ */ R(i, {
1318
+ children: c.map((e, t) => /* @__PURE__ */ R(i, {
1273
1319
  content: e.content.trim(),
1274
1320
  tone: "muted",
1275
1321
  className: "break-words text-xs leading-relaxed"
@@ -1278,7 +1324,63 @@ function Tt({ entry: e, questions: t, hiddenPartId: n }) {
1278
1324
  ]
1279
1325
  });
1280
1326
  }
1281
- function Et({ activity: e, questions: t, docked: n, pinUserMessages: r = !0, messageActions: i, speaker: a, showAuthors: o }) {
1327
+ function Ot({ parts: e }) {
1328
+ return /* @__PURE__ */ R("div", {
1329
+ className: "mb-1 space-y-1 border-l-2 border-border pl-2 text-xs text-muted-foreground",
1330
+ children: e.map((e) => e.type === "reasoning" ? /* @__PURE__ */ R(i, {
1331
+ content: e.text,
1332
+ tone: "muted",
1333
+ streaming: e.streaming,
1334
+ className: "break-words text-xs leading-relaxed"
1335
+ }, e.id) : e.type === "tool" ? /* @__PURE__ */ z("div", {
1336
+ className: "flex items-start gap-1.5",
1337
+ children: [/* @__PURE__ */ R(f, {
1338
+ name: xt[e.status],
1339
+ size: 12,
1340
+ className: `mt-0.5 shrink-0 ${e.status === "running" ? "animate-spin" : ""}`
1341
+ }), /* @__PURE__ */ R("span", {
1342
+ className: `min-w-0 break-words ${e.status === "error" ? "text-destructive" : ""}`,
1343
+ children: e.label
1344
+ })]
1345
+ }, e.id) : null)
1346
+ });
1347
+ }
1348
+ function kt({ speaker: e, entries: t, questions: n, docked: r }) {
1349
+ let i = vt(t[0]), a = i.length ? new Set(i.map((e) => e.id)) : void 0, [o, s] = I(!1);
1350
+ return /* @__PURE__ */ z("div", {
1351
+ className: "flex items-start gap-2 pt-1.5",
1352
+ children: [/* @__PURE__ */ R("span", {
1353
+ className: `flex shrink-0 justify-center pt-px ${_t}`,
1354
+ children: /* @__PURE__ */ R(gt, { author: e })
1355
+ }), /* @__PURE__ */ z("div", {
1356
+ className: "min-w-0 flex-1",
1357
+ children: [
1358
+ /* @__PURE__ */ z("div", {
1359
+ className: "flex min-w-0 flex-wrap items-center gap-x-2 pb-0.5",
1360
+ children: [/* @__PURE__ */ R("span", {
1361
+ className: "truncate text-xs font-medium text-foreground",
1362
+ children: e.name
1363
+ }), i.length > 0 && /* @__PURE__ */ R(yt, {
1364
+ parts: i,
1365
+ open: o,
1366
+ onToggle: () => s((e) => !e)
1367
+ })]
1368
+ }),
1369
+ o && i.length > 0 && /* @__PURE__ */ R(Ot, { parts: i }),
1370
+ /* @__PURE__ */ R("ul", {
1371
+ className: "space-y-0.5",
1372
+ children: t.map((e, t) => /* @__PURE__ */ R(Dt, {
1373
+ entry: e,
1374
+ questions: n,
1375
+ hiddenPartId: r?.entry.id === e.id ? r.part.id : void 0,
1376
+ ...t === 0 && a ? { skip: a } : {}
1377
+ }, e.id))
1378
+ })
1379
+ ]
1380
+ })]
1381
+ });
1382
+ }
1383
+ function At({ activity: e, questions: t, docked: n, pinUserMessages: r = !0, messageActions: i, speaker: a, showAuthors: o }) {
1282
1384
  if (e.length === 0) return null;
1283
1385
  let s = o ?? (!!a || e.some((e) => e.kind === "user" && e.author)), c = [];
1284
1386
  for (let t of e) t.kind === "user" || c.length === 0 ? c.push(t.kind === "user" ? {
@@ -1287,77 +1389,78 @@ function Et({ activity: e, questions: t, docked: n, pinUserMessages: r = !0, mes
1287
1389
  } : { entries: [t] }) : c[c.length - 1].entries.push(t);
1288
1390
  return /* @__PURE__ */ R("ul", {
1289
1391
  className: "space-y-0.5",
1290
- children: c.map((e) => /* @__PURE__ */ z("li", { children: [
1291
- e.user && /* @__PURE__ */ R(vt, {
1292
- entry: e.user,
1293
- pinned: r,
1294
- actions: i,
1295
- cut: ht(e.entries),
1296
- showAuthor: s
1297
- }),
1298
- a && e.entries.length > 0 && /* @__PURE__ */ R(_t, { speaker: a }),
1299
- e.entries.length > 0 && /* @__PURE__ */ R("ul", {
1300
- className: "space-y-0.5",
1301
- children: e.entries.map((e) => /* @__PURE__ */ R(Tt, {
1302
- entry: e,
1303
- questions: t,
1304
- hiddenPartId: n?.entry.id === e.id ? n.part.id : void 0
1305
- }, e.id))
1306
- })
1307
- ] }, e.user?.id ?? e.entries[0]?.id))
1392
+ children: c.map((e) => /* @__PURE__ */ z("li", { children: [e.user && /* @__PURE__ */ R(bt, {
1393
+ entry: e.user,
1394
+ pinned: r,
1395
+ actions: i,
1396
+ cut: ht(e.entries),
1397
+ showAuthor: s
1398
+ }), a && e.entries.length > 0 ? /* @__PURE__ */ R(kt, {
1399
+ speaker: a,
1400
+ entries: e.entries,
1401
+ questions: t,
1402
+ docked: n
1403
+ }) : e.entries.length > 0 && /* @__PURE__ */ R("ul", {
1404
+ className: "space-y-0.5",
1405
+ children: e.entries.map((e) => /* @__PURE__ */ R(Dt, {
1406
+ entry: e,
1407
+ questions: t,
1408
+ hiddenPartId: n?.entry.id === e.id ? n.part.id : void 0
1409
+ }, e.id))
1410
+ })] }, e.user?.id ?? e.entries[0]?.id))
1308
1411
  });
1309
1412
  }
1310
1413
  //#endregion
1311
1414
  //#region src/presentation/panelWidth.ts
1312
- var Dt = 420, Ot = 320, kt = "60vw", At = "agentico:panel-width";
1313
- function jt(e, t) {
1415
+ var jt = 420, Mt = 320, Nt = "60vw", Pt = "agentico:panel-width";
1416
+ function Ft(e, t) {
1314
1417
  if (typeof e == "number") return e;
1315
1418
  let n = Number.parseFloat(e);
1316
1419
  return Number.isFinite(n) ? Math.round(n / 100 * t) : Infinity;
1317
1420
  }
1318
- function Mt(e, t, n) {
1421
+ function It(e, t, n) {
1319
1422
  return Math.round(Math.min(Math.max(e, t), Math.max(t, n)));
1320
1423
  }
1321
- function Nt() {
1424
+ function Lt() {
1322
1425
  try {
1323
- let e = window.localStorage.getItem(At), t = e === null ? NaN : Number(e);
1426
+ let e = window.localStorage.getItem(Pt), t = e === null ? NaN : Number(e);
1324
1427
  return Number.isFinite(t) && t > 0 ? t : null;
1325
1428
  } catch {
1326
1429
  return null;
1327
1430
  }
1328
1431
  }
1329
- function Pt(e) {
1432
+ function Rt(e) {
1330
1433
  try {
1331
- e === null ? window.localStorage.removeItem(At) : window.localStorage.setItem(At, String(e));
1434
+ e === null ? window.localStorage.removeItem(Pt) : window.localStorage.setItem(Pt, String(e));
1332
1435
  } catch {}
1333
1436
  }
1334
- function Ft() {
1437
+ function zt() {
1335
1438
  return typeof window > "u" ? Infinity : window.innerWidth;
1336
1439
  }
1337
- function It({ defaultWidth: e = 420, minWidth: t = 320, maxWidth: n = kt, onWidthChange: r }) {
1338
- let [i, a] = I(Ft), [o, s] = I(() => Nt() ?? e);
1440
+ function Bt({ defaultWidth: e = 420, minWidth: t = 320, maxWidth: n = Nt, onWidthChange: r }) {
1441
+ let [i, a] = I(zt), [o, s] = I(() => Lt() ?? e);
1339
1442
  M(() => {
1340
1443
  if (typeof window > "u") return;
1341
1444
  let e = () => a(window.innerWidth);
1342
1445
  return window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
1343
1446
  }, []);
1344
- let c = t, l = Math.max(c, jt(n, i)), u = Mt(o, c, l);
1447
+ let c = t, l = Math.max(c, Ft(n, i)), u = It(o, c, l);
1345
1448
  return M(() => {
1346
1449
  r?.(u);
1347
1450
  }, [u]), {
1348
1451
  width: u,
1349
1452
  min: c,
1350
1453
  max: l,
1351
- set: A((e) => s(Mt(e, c, l)), [c, l]),
1352
- commit: A((e) => Pt(Mt(e, c, l)), [c, l]),
1454
+ set: A((e) => s(It(e, c, l)), [c, l]),
1455
+ commit: A((e) => Rt(It(e, c, l)), [c, l]),
1353
1456
  reset: A(() => {
1354
- s(e), Pt(null);
1457
+ s(e), Rt(null);
1355
1458
  }, [e])
1356
1459
  };
1357
1460
  }
1358
1461
  //#endregion
1359
1462
  //#region src/presentation/AgenticoResizeHandle.tsx
1360
- function Lt({ width: e, min: t, max: n, onResize: r, onCommit: i, onReset: a }) {
1463
+ function Vt({ width: e, min: t, max: n, onResize: r, onCommit: i, onReset: a }) {
1361
1464
  let o = $(), s = F(null), [c, l] = I(!1), u = (e) => Math.round(Math.min(Math.max(e, t), Math.max(t, n))), d = (e) => {
1362
1465
  let t = s.current;
1363
1466
  if (t && t.pointerId === e.pointerId) {
@@ -1415,7 +1518,7 @@ function Lt({ width: e, min: t, max: n, onResize: r, onCommit: i, onReset: a })
1415
1518
  }
1416
1519
  //#endregion
1417
1520
  //#region src/presentation/AgenticoToggle.tsx
1418
- function Rt({ className: e = "" }) {
1521
+ function Ht({ className: e = "" }) {
1419
1522
  let { isOpen: n, toggleOpen: r, task: i } = ot(), a = $(), o = i?.agent.running ?? !1;
1420
1523
  return /* @__PURE__ */ R(t, {
1421
1524
  icon: "bot",
@@ -1428,21 +1531,21 @@ function Rt({ className: e = "" }) {
1428
1531
  }
1429
1532
  //#endregion
1430
1533
  //#region src/presentation/useAIModelCatalog.ts
1431
- var zt = "llmnative-cms.selectedAIModel";
1432
- function Bt() {
1534
+ var Ut = "llmnative-cms.selectedAIModel";
1535
+ function Wt() {
1433
1536
  try {
1434
- return localStorage.getItem(zt) ?? "";
1537
+ return localStorage.getItem(Ut) ?? "";
1435
1538
  } catch {
1436
1539
  return "";
1437
1540
  }
1438
1541
  }
1439
- function Vt(e) {
1542
+ function Gt(e) {
1440
1543
  try {
1441
- e ? localStorage.setItem(zt, e) : localStorage.removeItem(zt);
1544
+ e ? localStorage.setItem(Ut, e) : localStorage.removeItem(Ut);
1442
1545
  } catch {}
1443
1546
  }
1444
- function Ht() {
1445
- let e = T()?.registry ?? {}, t = Object.keys(e).length > 0, [n, r] = I({}), [i, a] = I(!1), [o, s] = I(Bt);
1547
+ function Kt() {
1548
+ let e = T()?.registry ?? {}, t = Object.keys(e).length > 0, [n, r] = I({}), [i, a] = I(!1), [o, s] = I(Wt);
1446
1549
  return M(() => {
1447
1550
  if (!t) {
1448
1551
  r({});
@@ -1453,7 +1556,7 @@ function Ht() {
1453
1556
  if (n) return;
1454
1557
  r(e.modelsByProvider);
1455
1558
  let t = Object.values(e.modelsByProvider).flat();
1456
- s((e) => t.some((t) => t.id === e) ? e : (Vt(""), ""));
1559
+ s((e) => t.some((t) => t.id === e) ? e : (Gt(""), ""));
1457
1560
  }).catch((e) => {
1458
1561
  console.error("useAIModelCatalog: getAIModelCatalog failed", e), n || r({});
1459
1562
  }).finally(() => {
@@ -1467,17 +1570,17 @@ function Ht() {
1467
1570
  modelsLoading: i,
1468
1571
  selectedModel: o,
1469
1572
  setSelectedModel: (e) => {
1470
- Vt(e), s(e);
1573
+ Gt(e), s(e);
1471
1574
  }
1472
1575
  };
1473
1576
  }
1474
1577
  //#endregion
1475
1578
  //#region src/domain/approval.ts
1476
- var Ut = "approval";
1477
- function Wt(e, t) {
1579
+ var qt = "approval";
1580
+ function Jt(e, t) {
1478
1581
  return typeof e.needsApproval == "function" ? e.needsApproval(t) : e.needsApproval === !0;
1479
1582
  }
1480
- function Gt(e, t, n) {
1583
+ function Yt(e, t, n) {
1481
1584
  let r = e[0]?.values ?? [], i = r.filter((e) => e !== t && e !== n).join(" ").trim();
1482
1585
  return {
1483
1586
  approved: r.includes(t) && !r.includes(n),
@@ -1486,11 +1589,11 @@ function Gt(e, t, n) {
1486
1589
  }
1487
1590
  //#endregion
1488
1591
  //#region src/presentation/useAgent.ts
1489
- var Kt = 20, qt = 26e4;
1490
- function Jt(e) {
1491
- return e.filter((e) => !y.isTextAttachment(e.mimeType) || e.base64.length <= qt);
1592
+ var Xt = 20, Zt = 26e4;
1593
+ function Qt(e) {
1594
+ return e.filter((e) => !y.isTextAttachment(e.mimeType) || e.base64.length <= Zt);
1492
1595
  }
1493
- function Yt(e) {
1596
+ function $t(e) {
1494
1597
  return e.map((e) => e.status !== "running" && !e.parts?.some((e) => e.type === "tool" && e.status === "running" || (e.type === "text" || e.type === "reasoning") && e.streaming) ? e : {
1495
1598
  ...e,
1496
1599
  status: e.status === "running" ? "stopped" : e.status,
@@ -1503,10 +1606,10 @@ function Yt(e) {
1503
1606
  } : e) } : {}
1504
1607
  });
1505
1608
  }
1506
- function Xt(e, t = {}) {
1609
+ function en(e, t = {}) {
1507
1610
  let { defaultEnabled: n = !1 } = t, r = F(t.author);
1508
1611
  r.current = t.author;
1509
- let [i, a] = I(n), { hasProviders: o, modelsByProvider: s, modelsLoading: c, selectedModel: l, setSelectedModel: u } = Ht(), [d, f] = I(!1), [p, m] = I(null), [h, g] = I(!1), [_, v] = I([]), b = F([]), x = (e) => {
1612
+ let [i, a] = I(n), { hasProviders: o, modelsByProvider: s, modelsLoading: c, selectedModel: l, setSelectedModel: u } = Kt(), [d, f] = I(!1), [p, m] = I(null), [h, g] = I(!1), [_, v] = I([]), b = F([]), x = (e) => {
1510
1613
  v((t) => {
1511
1614
  let n = typeof e == "function" ? e(t) : e;
1512
1615
  return b.current = n, n;
@@ -1707,7 +1810,7 @@ function Xt(e, t = {}) {
1707
1810
  let f = o ? C(o) : W, p = f ? N[f.provider] : null;
1708
1811
  if (!p || !f) return m(E.current.noProviderAvailable), null;
1709
1812
  n?.length && (d.attachmentsRef.current = [...d.attachmentsRef.current ?? [], ...n]);
1710
- let h = (n ?? []).filter((e) => y.isTextAttachment(e.mimeType)).map((e) => e.base64.length <= qt ? `\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 = Jt(n ?? []), _ = d.tools.map((e) => ({
1813
+ let h = (n ?? []).filter((e) => y.isTextAttachment(e.mimeType)).map((e) => e.base64.length <= Zt ? `\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 = Qt(n ?? []), _ = d.tools.map((e) => ({
1711
1814
  name: e.name,
1712
1815
  description: e.description,
1713
1816
  inputSchema: ae(e.inputSchema)
@@ -1720,7 +1823,7 @@ function Xt(e, t = {}) {
1720
1823
  status: "running",
1721
1824
  parts: [{
1722
1825
  type: "questions",
1723
- id: Ut,
1826
+ id: qt,
1724
1827
  questions: [{
1725
1828
  header: i.approvalHeader,
1726
1829
  question: i.approveQuestion.replace("{action}", o),
@@ -1729,7 +1832,7 @@ function Xt(e, t = {}) {
1729
1832
  }]
1730
1833
  }]
1731
1834
  }]);
1732
- let s = `${a}:${Ut}`;
1835
+ let s = `${a}:${qt}`;
1733
1836
  return new Promise((e, t) => {
1734
1837
  let n = () => {
1735
1838
  S.current.delete(s), T(a, "stopped"), t(new DOMException("The turn was stopped.", "AbortError"));
@@ -1740,7 +1843,7 @@ function Xt(e, t = {}) {
1740
1843
  }
1741
1844
  r.addEventListener("abort", n, { once: !0 }), S.current.set(s, {
1742
1845
  resolve: (t) => {
1743
- r.removeEventListener("abort", n), T(a, "done"), e(Gt(t, i.approve, i.reject));
1846
+ r.removeEventListener("abort", n), T(a, "done"), e(Yt(t, i.approve, i.reject));
1744
1847
  },
1745
1848
  reject: t
1746
1849
  });
@@ -1755,7 +1858,7 @@ function Xt(e, t = {}) {
1755
1858
  } : i));
1756
1859
  try {
1757
1860
  let n = d.history, r = t;
1758
- for (let t = 0; t < Kt; t++) {
1861
+ for (let t = 0; t < Xt; t++) {
1759
1862
  let i = crypto.randomUUID();
1760
1863
  x((e) => [...e, {
1761
1864
  id: i,
@@ -1815,7 +1918,7 @@ function Xt(e, t = {}) {
1815
1918
  let s = /* @__PURE__ */ new Map();
1816
1919
  for (let t of a.toolCalls) {
1817
1920
  let n = b.get(t.name);
1818
- if (n && Wt(n, t.input)) try {
1921
+ if (n && Jt(n, t.input)) try {
1819
1922
  s.set(t.id, await v(t.id, n, t.input, w.signal));
1820
1923
  } catch {
1821
1924
  return e.fallback(d.params, d.context);
@@ -1975,7 +2078,7 @@ function Xt(e, t = {}) {
1975
2078
  m(E.current.requestInProgress);
1976
2079
  return;
1977
2080
  }
1978
- O.current = !0, m(null), x(Yt(n.activity)), f(!0);
2081
+ O.current = !0, m(null), x($t(n.activity)), f(!0);
1979
2082
  try {
1980
2083
  let r = await e.buildContext(t), a = { current: void 0 }, o = e.getTools?.(t, r, a) ?? [];
1981
2084
  D.current = {
@@ -2101,23 +2204,23 @@ function Xt(e, t = {}) {
2101
2204
  }
2102
2205
  //#endregion
2103
2206
  //#region src/domain/orchestrator/prompt.ts
2104
- function Zt() {
2207
+ function tn() {
2105
2208
  let e = X();
2106
2209
  return [e.responseRulesHeading, ...e.responseRules.map((e) => `- ${e}`)].join("\n");
2107
2210
  }
2108
- function Qt(e, t, n) {
2211
+ function nn(e, t, n) {
2109
2212
  let r = X(), i = n ? `\n${r.pageContextHeading}\n${r.pageContextIntro}\n${n}\n` : "";
2110
2213
  return `${r.orchestratorIntro}
2111
2214
 
2112
2215
  ${r.toolsHeading}
2113
2216
  ${t}
2114
2217
  ${i}
2115
- ${Zt()}
2218
+ ${tn()}
2116
2219
 
2117
2220
  ${r.userRequestHeading}
2118
2221
  ${e}`;
2119
2222
  }
2120
- function $t(e, t) {
2223
+ function rn(e, t) {
2121
2224
  return t ? {
2122
2225
  kind: "handoff",
2123
2226
  ...t
@@ -2128,27 +2231,27 @@ function $t(e, t) {
2128
2231
  }
2129
2232
  //#endregion
2130
2233
  //#region src/domain/orchestrator/agenticoOrchestratorAgent.ts
2131
- function en(e) {
2234
+ function an(e) {
2132
2235
  return re().filter((t) => !t.onlyWhenAnchored || e === t.id);
2133
2236
  }
2134
- function tn(e) {
2237
+ function on(e) {
2135
2238
  return {
2136
2239
  buildContext(e) {
2137
2240
  return {
2138
- cliCatalog: he(en(e.scopedSubagentId)),
2241
+ cliCatalog: he(an(e.scopedSubagentId)),
2139
2242
  handoff: { current: null },
2140
2243
  collected: {}
2141
2244
  };
2142
2245
  },
2143
2246
  buildPrompt({ userGoal: e, pageContext: t }, { cliCatalog: n }) {
2144
- return Qt(e, n, t);
2247
+ return nn(e, n, t);
2145
2248
  },
2146
2249
  buildFollowUpPrompt(e, t, { cliCatalog: n }) {
2147
- return `${e}\n\n${Zt()}\n\n${X().toolsHeading}\n${n}`;
2250
+ return `${e}\n\n${tn()}\n\n${X().toolsHeading}\n${n}`;
2148
2251
  },
2149
2252
  parseResponse(e, t, n) {
2150
2253
  let r = n.handoff.current;
2151
- return n.handoff.current = null, $t(e, r);
2254
+ return n.handoff.current = null, rn(e, r);
2152
2255
  },
2153
2256
  fallback() {
2154
2257
  return {
@@ -2164,7 +2267,7 @@ function tn(e) {
2164
2267
  attachmentsRef: r,
2165
2268
  collected: n.collected,
2166
2269
  proxyFetch: w
2167
- }), a = t.scopedSubagentId ? G(t.scopedSubagentId) : null, o = a ? i.filter((e) => (a.crossAgentToolIds ?? []).includes(e.name)) : i, s = en(t.scopedSubagentId).flatMap((t) => t.commands.map((r) => ({
2270
+ }), a = t.scopedSubagentId ? G(t.scopedSubagentId) : null, o = a ? i.filter((e) => (a.crossAgentToolIds ?? []).includes(e.name)) : i, s = an(t.scopedSubagentId).flatMap((t) => t.commands.map((r) => ({
2168
2271
  name: `${t.id}_${r.name}`,
2169
2272
  description: `${t.label}: ${r.summary}`,
2170
2273
  inputSchema: r.inputSchema,
@@ -2188,12 +2291,12 @@ function tn(e) {
2188
2291
  }
2189
2292
  //#endregion
2190
2293
  //#region src/presentation/deriveHistoryTitle.ts
2191
- function nn(e, t) {
2294
+ function sn(e, t) {
2192
2295
  return e.deriveHistoryTitle?.(t) ?? e.label;
2193
2296
  }
2194
2297
  //#endregion
2195
2298
  //#region src/presentation/ResultDestinationPicker.tsx
2196
- function rn({ manifest: e, result: t, meta: n, taskId: r, initiallyApplied: i, onApplied: a, extraDestinations: o }) {
2299
+ function cn({ manifest: e, result: t, meta: n, taskId: r, initiallyApplied: i, onApplied: a, extraDestinations: o }) {
2197
2300
  let s = $(), c = ot(), l = c.scope, u = O(), [d, f] = I(null), [p, m] = I(new Set(i ?? [])), [h, g] = I(null), _ = Te(), v = /* @__PURE__ */ new Map();
2198
2301
  e.destinationIds.forEach((e) => {
2199
2302
  let t = _[e];
@@ -2211,7 +2314,7 @@ function rn({ manifest: e, result: t, meta: n, taskId: r, initiallyApplied: i, o
2211
2314
  storageProvider: l?.storageProvider ?? null,
2212
2315
  proxyFetch: u
2213
2316
  }, n);
2214
- m((e) => new Set(e).add(i)), a?.(i), d?.id && c.commitEntityChat(e.id, d.id, r, l?.id, n, nn(e, n));
2317
+ m((e) => new Set(e).add(i)), a?.(i), d?.id && c.commitEntityChat(e.id, d.id, r, l?.id, n, sn(e, n));
2215
2318
  } catch (e) {
2216
2319
  g(e instanceof Error ? e.message : String(e));
2217
2320
  } finally {
@@ -2244,16 +2347,16 @@ function rn({ manifest: e, result: t, meta: n, taskId: r, initiallyApplied: i, o
2244
2347
  }
2245
2348
  //#endregion
2246
2349
  //#region src/presentation/reports/subagentReportRegistry.tsx
2247
- var an = {};
2248
- function on(e) {
2249
- Object.assign(an, e);
2350
+ var ln = {};
2351
+ function un(e) {
2352
+ Object.assign(ln, e);
2250
2353
  }
2251
- function sn(e) {
2252
- return an[e];
2354
+ function dn(e) {
2355
+ return ln[e];
2253
2356
  }
2254
2357
  //#endregion
2255
2358
  //#region src/presentation/reports/GenericResultPreview.tsx
2256
- function cn({ result: e }) {
2359
+ function fn({ result: e }) {
2257
2360
  let [t, n] = I(!1);
2258
2361
  return /* @__PURE__ */ z("div", {
2259
2362
  className: `relative cursor-pointer rounded-md border border-border/60 ${t ? "max-h-80 overflow-y-auto" : "max-h-28 overflow-hidden"}`,
@@ -2270,7 +2373,7 @@ function cn({ result: e }) {
2270
2373
  }
2271
2374
  //#endregion
2272
2375
  //#region src/presentation/liveAnchorDestination.ts
2273
- function ln(e, t, n) {
2376
+ function pn(e, t, n) {
2274
2377
  return e.length === 0 ? null : {
2275
2378
  id: "live-component",
2276
2379
  label: "Applica al componente aperto",
@@ -2281,38 +2384,38 @@ function ln(e, t, n) {
2281
2384
  }
2282
2385
  //#endregion
2283
2386
  //#region src/presentation/subagentControls.ts
2284
- var un = {};
2285
- function dn(e) {
2286
- Object.assign(un, e);
2387
+ var mn = {};
2388
+ function hn(e) {
2389
+ Object.assign(mn, e);
2287
2390
  }
2288
- function fn(e) {
2289
- return un[e];
2391
+ function gn(e) {
2392
+ return mn[e];
2290
2393
  }
2291
2394
  //#endregion
2292
2395
  //#region src/presentation/chatTitles.ts
2293
- function pn(e, t = 6e3) {
2396
+ function _n(e, t = 6e3) {
2294
2397
  let n = e.filter((e) => (e.kind === "user" || e.kind === "thinking") && e.detail?.trim() && !Je(e)).map((e) => `${e.kind === "user" ? "Person" : "Agent"}: ${e.detail.trim()}`).join("\n\n");
2295
2398
  return n.length > t ? `${n.slice(0, t * .7)}\n\n[…]\n\n${n.slice(-t * .3)}` : n;
2296
2399
  }
2297
- function mn(e) {
2400
+ function vn(e) {
2298
2401
  return (e.trim().split("\n").map((e) => e.trim()).find(Boolean) ?? "").replace(/^(title|titolo)\s*:\s*/i, "").replace(/^#+\s*/, "").replace(/^["'«“]+|["'»”]+$/g, "").replace(/[.。]+$/, "").trim().slice(0, 80);
2299
2402
  }
2300
- function hn(e, t) {
2403
+ function yn(e, t) {
2301
2404
  try {
2302
2405
  return e.definition.executor?.catalogProviders?.(e.toParams(t));
2303
2406
  } catch {
2304
2407
  return;
2305
2408
  }
2306
2409
  }
2307
- function gn(e, t, n, r, i) {
2308
- let a = hn(e, t), o = (e) => {
2410
+ function bn(e, t, n, r, i) {
2411
+ let a = yn(e, t), o = (e) => {
2309
2412
  let t = e ? C(e) : null;
2310
2413
  return !(!t || !i[t.provider] || a && !a.includes(t.provider));
2311
2414
  };
2312
2415
  return o(n) ? n : Object.values(r).flat().map((e) => e.id).find(o);
2313
2416
  }
2314
- function _n(e) {
2315
- let t = T()?.registry ?? {}, { modelsByProvider: n, selectedModel: r } = Ht(), i = F({
2417
+ function xn(e) {
2418
+ let t = T()?.registry ?? {}, { modelsByProvider: n, selectedModel: r } = Kt(), i = F({
2316
2419
  registry: t,
2317
2420
  modelsByProvider: n,
2318
2421
  selectedModel: r
@@ -2326,15 +2429,15 @@ function _n(e) {
2326
2429
  if (!e) return !1;
2327
2430
  let o = Ve(e, t, n), s = G(t), c = `${e}:${t}:${n}`;
2328
2431
  if (!o || !s?.autoTitle || o.name || !qe(o) || a.current.has(c)) return !1;
2329
- let { registry: l, modelsByProvider: u, selectedModel: d } = i.current, f = gn(s, o.params, r ?? d, u, l), p = f ? C(f) : null;
2432
+ let { registry: l, modelsByProvider: u, selectedModel: d } = i.current, f = bn(s, o.params, r ?? d, u, l), p = f ? C(f) : null;
2330
2433
  if (!p) return !1;
2331
2434
  a.current.add(c);
2332
2435
  try {
2333
2436
  let r = await l[p.provider].complete({
2334
- prompt: X().chatTitle.replace("{chat}", pn(o.activity)),
2437
+ prompt: X().chatTitle.replace("{chat}", _n(o.activity)),
2335
2438
  model: p.model,
2336
2439
  history: []
2337
- }), i = r && r.type === "text" ? mn(r.text) : "";
2440
+ }), i = r && r.type === "text" ? vn(r.text) : "";
2338
2441
  return i ? Ye(e, t, n, i, "model") : !1;
2339
2442
  } catch {
2340
2443
  return !1;
@@ -2343,7 +2446,7 @@ function _n(e) {
2343
2446
  }
2344
2447
  }, [e]), s = Object.keys(n).length > 0;
2345
2448
  return M(() => {
2346
- e && s && !vn.has(e) && (vn.add(e), (async () => {
2449
+ e && s && !Sn.has(e) && (Sn.add(e), (async () => {
2347
2450
  for (let t of Qe(e)) {
2348
2451
  let n = G(t.subagentId);
2349
2452
  if (n?.autoTitle) {
@@ -2361,14 +2464,14 @@ function _n(e) {
2361
2464
  o
2362
2465
  ]), o;
2363
2466
  }
2364
- var vn = /* @__PURE__ */ new Set(), yn = () => ({});
2365
- function bn({ manifest: e, params: t, extraDestinations: n, precedingActivity: r, taskId: i, resumeSeed: a, model: o, openingMessage: s }) {
2366
- let c = ot(), l = Xt(e.definition, {
2467
+ var Sn = /* @__PURE__ */ new Set(), Cn = () => ({});
2468
+ function wn({ manifest: e, params: t, extraDestinations: n, precedingActivity: r, taskId: i, resumeSeed: a, model: o, openingMessage: s }) {
2469
+ let c = ot(), l = en(e.definition, {
2367
2470
  defaultEnabled: !0,
2368
2471
  ...c.person ? { author: c.person } : {}
2369
2472
  }), u = e.thread?.(t) || void 0, d = e.speaker?.(t), f = c.scope, p = O(), m = F(i ?? `subagent-${e.id}-${crypto.randomUUID()}`).current, [h, g] = I(null), _ = (t) => {
2370
2473
  e.definition.conversational || g(t);
2371
- }, [v, y] = I([]), [b, x] = I(null), S = sn(e.id), C = S?.kind === "selection" ? S : null, [w, T] = I(null), E = F(!1), D = F(0), k = F(null);
2474
+ }, [v, y] = I([]), [b, x] = I(null), S = dn(e.id), C = S?.kind === "selection" ? S : null, [w, T] = I(null), E = F(!1), D = F(0), k = F(null);
2372
2475
  h && h !== k.current && (k.current = h, D.current = (r?.length ?? 0) + l.activity.length);
2373
2476
  let A = F(!1), j = l.remote || !l.hasProviders || l.selectedModel !== "";
2374
2477
  M(() => {
@@ -2392,7 +2495,7 @@ function bn({ manifest: e, params: t, extraDestinations: n, precedingActivity: r
2392
2495
  ...t,
2393
2496
  pinnedEntityId: r
2394
2497
  }).then((n) => {
2395
- n?.id && c.commitEntityChat(e.id, n.id, m, f.id, t, nn(e, t));
2498
+ n?.id && c.commitEntityChat(e.id, n.id, m, f.id, t, sn(e, t));
2396
2499
  }).catch((e) => x(e instanceof Error ? e.message : String(e))));
2397
2500
  });
2398
2501
  }, [
@@ -2411,11 +2514,11 @@ function bn({ manifest: e, params: t, extraDestinations: n, precedingActivity: r
2411
2514
  h,
2412
2515
  C,
2413
2516
  w
2414
- ]), H = P(() => c.componentAnchors.filter((t) => t.subagentId === e.id && t.onResult), [c.componentAnchors, e.id]), ee = P(() => ln(H, t, m), [
2517
+ ]), H = P(() => c.componentAnchors.filter((t) => t.subagentId === e.id && t.onResult), [c.componentAnchors, e.id]), ee = P(() => pn(H, t, m), [
2415
2518
  H,
2416
2519
  t,
2417
2520
  m
2418
- ]), te = P(() => ee ? [ee, ...n ?? []] : n, [ee, n]), ne = e.chatEntityId?.(t), U = _n(f?.id), W = F(!1), re = F(!1);
2521
+ ]), te = P(() => ee ? [ee, ...n ?? []] : n, [ee, n]), ne = e.chatEntityId?.(t), U = xn(f?.id), W = F(!1), re = F(!1);
2419
2522
  M(() => {
2420
2523
  let n = !W.current && l.running, i = W.current && !l.running;
2421
2524
  if (W.current = l.running, !n && !i || !ne || !f) return;
@@ -2431,14 +2534,14 @@ function bn({ manifest: e, params: t, extraDestinations: n, precedingActivity: r
2431
2534
  subagentId: e.id,
2432
2535
  entityId: ne,
2433
2536
  params: t,
2434
- title: nn(e, t),
2537
+ title: sn(e, t),
2435
2538
  history: a.history,
2436
2539
  activity: o
2437
2540
  }), i && e.autoTitle && U(e.id, ne, l.selectedModel));
2438
2541
  }, [l.running]);
2439
2542
  let G = () => {
2440
2543
  A.current = !0, l.running && l.stop(), c.closeTask(m);
2441
- }, K = F(fn(e.id) ?? yn).current, q = K({
2544
+ }, K = F(gn(e.id) ?? Cn).current, q = K({
2442
2545
  params: t,
2443
2546
  taskId: m,
2444
2547
  running: l.running,
@@ -2449,7 +2552,7 @@ function bn({ manifest: e, params: t, extraDestinations: n, precedingActivity: r
2449
2552
  return M(() => {
2450
2553
  A.current || c.openTask({
2451
2554
  id: m,
2452
- title: nn(e, t),
2555
+ title: sn(e, t),
2453
2556
  icon: e.icon,
2454
2557
  agent: l,
2455
2558
  onApplied: (e) => _(e),
@@ -2470,12 +2573,12 @@ function bn({ manifest: e, params: t, extraDestinations: n, precedingActivity: r
2470
2573
  }) : S?.kind === "editable" ? /* @__PURE__ */ R(S.Report, {
2471
2574
  result: h,
2472
2575
  onResultChange: B
2473
- }) : /* @__PURE__ */ R(cn, { result: V }),
2576
+ }) : /* @__PURE__ */ R(fn, { result: V }),
2474
2577
  b && /* @__PURE__ */ z("p", {
2475
2578
  className: "text-xs text-destructive",
2476
2579
  children: ["Salvataggio automatico non riuscito: ", b]
2477
2580
  }),
2478
- /* @__PURE__ */ R(rn, {
2581
+ /* @__PURE__ */ R(cn, {
2479
2582
  manifest: e,
2480
2583
  result: V,
2481
2584
  meta: t,
@@ -2516,13 +2619,13 @@ function bn({ manifest: e, params: t, extraDestinations: n, precedingActivity: r
2516
2619
  }
2517
2620
  //#endregion
2518
2621
  //#region src/presentation/OrchestratorRunner.tsx
2519
- function xn({ userGoal: e }) {
2520
- let t = $(), n = P(() => tn({
2622
+ function Tn({ userGoal: e }) {
2623
+ let t = $(), n = P(() => on({
2521
2624
  unavailable: t.orchestratorUnavailable,
2522
2625
  continueWithoutAi: t.orchestratorContinueWithoutAi,
2523
2626
  preparing: t.orchestratorPreparing,
2524
2627
  collecting: t.orchestratorCollecting
2525
- }), []), r = ot(), i = Xt(n, {
2628
+ }), []), r = ot(), i = en(n, {
2526
2629
  defaultEnabled: !0,
2527
2630
  ...r.person ? { author: r.person } : {}
2528
2631
  }), [a, o] = I(null), s = F(!1), c = !i.hasProviders || i.selectedModel !== "", l = F(r.pendingExtraDestinations), u = F(r.pendingAttachments), d = F(r.pendingModel), f = F(r.pendingScopedSubagentId ?? r.scopedSubagentId ?? void 0), p = F(r.pendingCarryOver), m = F(!1), h = (e) => {
@@ -2568,7 +2671,7 @@ function xn({ userGoal: e }) {
2568
2671
  let g = P(() => [...p.current?.activity ?? [], ...i.activity], [i.activity]);
2569
2672
  if (!a) return null;
2570
2673
  let _ = G(a.subagentId);
2571
- return _ ? /* @__PURE__ */ R(bn, {
2674
+ return _ ? /* @__PURE__ */ R(wn, {
2572
2675
  manifest: _,
2573
2676
  params: a.params,
2574
2677
  extraDestinations: l.current,
@@ -2579,11 +2682,11 @@ function xn({ userGoal: e }) {
2579
2682
  }
2580
2683
  //#endregion
2581
2684
  //#region src/presentation/ManualEntryRunner.tsx
2582
- function Sn({ manifest: e, extraDestinations: n }) {
2583
- let r = ot(), i = Xt(e.definition, {
2685
+ function En({ manifest: e, extraDestinations: n }) {
2686
+ let r = ot(), i = en(e.definition, {
2584
2687
  defaultEnabled: !1,
2585
2688
  ...r.person ? { author: r.person } : {}
2586
- }), a = $(), o = F(`manual-${e.id}-${crypto.randomUUID()}`).current, [s, c] = I(null), [l, u] = I([]), d = sn(e.id), f = d?.kind === "selection" ? d : null, [p, m] = I(null), [h, g] = I(null), _ = F(!1), v = (t) => {
2689
+ }), a = $(), o = F(`manual-${e.id}-${crypto.randomUUID()}`).current, [s, c] = I(null), [l, u] = I([]), d = dn(e.id), f = d?.kind === "selection" ? d : null, [p, m] = I(null), [h, g] = I(null), _ = F(!1), v = (t) => {
2587
2690
  if (!e.manualEntry) return;
2588
2691
  let n;
2589
2692
  try {
@@ -2610,7 +2713,7 @@ function Sn({ manifest: e, extraDestinations: n }) {
2610
2713
  p
2611
2714
  ]), S = (e) => {
2612
2715
  u((t) => t.includes(e) ? t : [...t, e]);
2613
- }, C = P(() => r.componentAnchors.filter((t) => t.subagentId === e.id && t.onResult), [r.componentAnchors, e.id]), w = P(() => h ? ln(C, h, o) : null, [
2716
+ }, C = P(() => r.componentAnchors.filter((t) => t.subagentId === e.id && t.onResult), [r.componentAnchors, e.id]), w = P(() => h ? pn(C, h, o) : null, [
2614
2717
  C,
2615
2718
  h,
2616
2719
  o
@@ -2639,8 +2742,8 @@ function Sn({ manifest: e, extraDestinations: n }) {
2639
2742
  }) : d?.kind === "editable" ? /* @__PURE__ */ R(d.Report, {
2640
2743
  result: s,
2641
2744
  onResultChange: b
2642
- }) : /* @__PURE__ */ R(cn, { result: x }),
2643
- /* @__PURE__ */ R(rn, {
2745
+ }) : /* @__PURE__ */ R(fn, { result: x }),
2746
+ /* @__PURE__ */ R(cn, {
2644
2747
  manifest: e,
2645
2748
  result: x,
2646
2749
  meta: h ?? {},
@@ -2677,7 +2780,7 @@ function Sn({ manifest: e, extraDestinations: n }) {
2677
2780
  }
2678
2781
  //#endregion
2679
2782
  //#region src/presentation/EarlierSessions.tsx
2680
- function Cn({ title: e, meta: t, action: n }) {
2783
+ function Dn({ title: e, meta: t, action: n }) {
2681
2784
  return /* @__PURE__ */ z("div", {
2682
2785
  role: "separator",
2683
2786
  "aria-label": e,
@@ -2699,7 +2802,7 @@ function Cn({ title: e, meta: t, action: n }) {
2699
2802
  ]
2700
2803
  });
2701
2804
  }
2702
- function wn({ scopeId: e, thread: n, taskId: r, scrollRef: i, onLoad: a, onContinue: o, busy: s = !1 }) {
2805
+ function On({ scopeId: e, thread: n, taskId: r, scrollRef: i, onLoad: a, onContinue: o, busy: s = !1 }) {
2703
2806
  let c = $(), { locale: l } = D(), [u, d] = I(0);
2704
2807
  M(() => ze(() => d((e) => e + 1)), []);
2705
2808
  let f = P(() => tt(e, n, r), [
@@ -2760,7 +2863,7 @@ function wn({ scopeId: e, thread: n, taskId: r, scrollRef: i, onLoad: a, onConti
2760
2863
  }),
2761
2864
  x.map((e) => /* @__PURE__ */ z("section", {
2762
2865
  "aria-label": Ke(e),
2763
- children: [/* @__PURE__ */ R(Cn, {
2866
+ children: [/* @__PURE__ */ R(Dn, {
2764
2867
  title: Ke(e),
2765
2868
  meta: S(c.sessionOf, { at: b(Xe(e)) }),
2766
2869
  action: /* @__PURE__ */ R(t, {
@@ -2770,18 +2873,18 @@ function wn({ scopeId: e, thread: n, taskId: r, scrollRef: i, onLoad: a, onConti
2770
2873
  disabled: s,
2771
2874
  onClick: () => o(e)
2772
2875
  })
2773
- }), /* @__PURE__ */ R(Et, {
2876
+ }), /* @__PURE__ */ R(At, {
2774
2877
  activity: e.activity,
2775
2878
  pinUserMessages: !1,
2776
2879
  speaker: G(e.subagentId)?.speaker?.(e.params)
2777
2880
  })]
2778
2881
  }, `${e.subagentId}:${e.entityId}`)),
2779
- p > 0 && /* @__PURE__ */ R(Cn, { title: c.thisSession })
2882
+ p > 0 && /* @__PURE__ */ R(Dn, { title: c.thisSession })
2780
2883
  ] });
2781
2884
  }
2782
2885
  //#endregion
2783
2886
  //#region src/presentation/Agentico.tsx
2784
- function Tn(e, t) {
2887
+ function kn(e, t) {
2785
2888
  return Object.values(e).flat().map((e) => {
2786
2889
  let n = t?.(e.provider, e.providerLabel ?? e.provider);
2787
2890
  return {
@@ -2793,7 +2896,7 @@ function Tn(e, t) {
2793
2896
  };
2794
2897
  });
2795
2898
  }
2796
- function En({ task: e, editing: n, onCancelEdit: r, onSendEdit: i }) {
2899
+ function An({ task: e, editing: n, onCancelEdit: r, onSendEdit: i }) {
2797
2900
  let a = $(), [o, c] = I(""), { agent: l, onApplied: u, manualEntry: d } = e, p = l.running;
2798
2901
  M(() => {
2799
2902
  n && c(n.detail ?? "");
@@ -2813,7 +2916,7 @@ function En({ task: e, editing: n, onCancelEdit: r, onSendEdit: i }) {
2813
2916
  }).then((e) => {
2814
2917
  e && u(e);
2815
2918
  });
2816
- }, 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, ...Tn(l.modelsByProvider, l.catalogGroup)] : Tn(l.modelsByProvider);
2919
+ }, 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, ...kn(l.modelsByProvider, l.catalogGroup)] : kn(l.modelsByProvider);
2817
2920
  return /* @__PURE__ */ z(L, { children: [n && /* @__PURE__ */ z("div", {
2818
2921
  className: "mb-2 flex items-center gap-2 text-xs text-muted-foreground",
2819
2922
  children: [
@@ -2854,8 +2957,8 @@ function En({ task: e, editing: n, onCancelEdit: r, onSendEdit: i }) {
2854
2957
  maxHeight: 220
2855
2958
  })] });
2856
2959
  }
2857
- function Dn() {
2858
- let { startOrchestrator: e } = ot(), t = $(), [n, r] = I(""), { hasProviders: i, modelsByProvider: a, selectedModel: o, setSelectedModel: c } = Ht(), l = (t) => {
2960
+ function jn() {
2961
+ let { startOrchestrator: e } = ot(), t = $(), [n, r] = I(""), { hasProviders: i, modelsByProvider: a, selectedModel: o, setSelectedModel: c } = Kt(), l = (t) => {
2859
2962
  t.text.trim() && (e(t.text.trim(), {
2860
2963
  attachments: t.files.length > 0 ? t.files : void 0,
2861
2964
  model: t.model || void 0
@@ -2868,7 +2971,7 @@ function Dn() {
2868
2971
  disabled: !n.trim() || u,
2869
2972
  onSubmit: l,
2870
2973
  attachments: !0,
2871
- models: Tn(a),
2974
+ models: kn(a),
2872
2975
  selectedModel: o,
2873
2976
  onModelChange: c,
2874
2977
  modelPlaceholder: t.selectModelPlaceholder,
@@ -2876,7 +2979,7 @@ function Dn() {
2876
2979
  maxHeight: 220
2877
2980
  });
2878
2981
  }
2879
- function On({ chat: e, onClose: t }) {
2982
+ function Mn({ chat: e, onClose: t }) {
2880
2983
  let n = $(), r = E();
2881
2984
  return /* @__PURE__ */ R(_, {
2882
2985
  title: n.renameChat,
@@ -2899,7 +3002,7 @@ function On({ chat: e, onClose: t }) {
2899
3002
  })
2900
3003
  });
2901
3004
  }
2902
- function kn(e, t, n = Date.now()) {
3005
+ function Nn(e, t, n = Date.now()) {
2903
3006
  let r = Math.round((e - n) / 1e3), i = new Intl.RelativeTimeFormat(t, {
2904
3007
  numeric: "auto",
2905
3008
  style: "short"
@@ -2911,7 +3014,7 @@ function kn(e, t, n = Date.now()) {
2911
3014
  ]) if (Math.abs(r) >= t) return i.format(Math.round(r / t), e);
2912
3015
  return i.format(0, "minute");
2913
3016
  }
2914
- function An({ card: e }) {
3017
+ function Pn({ card: e }) {
2915
3018
  let t = $();
2916
3019
  return e.humanSummaryOnly ? /* @__PURE__ */ z("div", {
2917
3020
  className: "space-y-2 rounded-lg border border-border/60 p-3",
@@ -2967,7 +3070,7 @@ function An({ card: e }) {
2967
3070
  ]
2968
3071
  });
2969
3072
  }
2970
- function jn({ messages: e }) {
3073
+ function Fn({ messages: e }) {
2971
3074
  return /* @__PURE__ */ R("div", {
2972
3075
  className: "space-y-2 rounded-lg border border-border/60 p-3",
2973
3076
  children: e.map((e, t) => /* @__PURE__ */ R("p", {
@@ -2976,7 +3079,7 @@ function jn({ messages: e }) {
2976
3079
  }, t))
2977
3080
  });
2978
3081
  }
2979
- function Mn({ scopeId: e, currentTaskId: n, open: r, onOpenChange: i, onSelect: a, onNewChat: o, onArchivedCurrent: s }) {
3082
+ function In({ scopeId: e, currentTaskId: n, open: r, onOpenChange: i, onSelect: a, onNewChat: o, onArchivedCurrent: s }) {
2980
3083
  let c = $(), { locale: d } = D(), [p, m] = I(""), [h, g] = I(0);
2981
3084
  M(() => ze(() => g((e) => e + 1)), []);
2982
3085
  let _ = P(() => r ? Qe(e) : [], [
@@ -3065,22 +3168,22 @@ function Mn({ scopeId: e, currentTaskId: n, open: r, onOpenChange: i, onSelect:
3065
3168
  }), /* @__PURE__ */ R("span", {
3066
3169
  className: "shrink-0 text-xs text-muted-foreground",
3067
3170
  title: `${c.chatStarted.replace("{at}", new Date(Xe(e)).toLocaleString(d))} · ${c.chatLastMessage.replace("{at}", new Date(e.savedAt).toLocaleString(d))}`,
3068
- children: kn(Xe(e), d)
3171
+ children: Nn(Xe(e), d)
3069
3172
  })]
3070
3173
  })
3071
3174
  }, `${e.subagentId}:${e.entityId}`);
3072
3175
  })
3073
- }), v && /* @__PURE__ */ R(On, {
3176
+ }), v && /* @__PURE__ */ R(Mn, {
3074
3177
  chat: v,
3075
3178
  onClose: () => y(null)
3076
3179
  })] });
3077
3180
  }
3078
- function Nn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}) {
3181
+ function Ln({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}) {
3079
3182
  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 } = ot(), E = $(), D = F(null), [O, k] = I(!1), [A, j] = I(null), [N, P] = I(null);
3080
3183
  M(() => {
3081
3184
  j(null), P(null);
3082
- }, [a?.id]), _n(T?.id);
3083
- let B = It({
3185
+ }, [a?.id]), xn(T?.id);
3186
+ let B = Bt({
3084
3187
  defaultWidth: e,
3085
3188
  minWidth: n,
3086
3189
  maxWidth: r,
@@ -3112,7 +3215,7 @@ function Nn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
3112
3215
  e && a.onApplied(e);
3113
3216
  }),
3114
3217
  onCardAction: (e, t, n) => a.agent.cardAction(e, t, n)
3115
- } : void 0, J = oe ? St(H, oe.canAnswer) : null, se = a?.id === "agentico-orchestrator" && a.scopedSubagentId ? G(a.scopedSubagentId) : void 0, ce = se?.manualEntry ? se : null, Y = F(!0);
3218
+ } : void 0, J = oe ? wt(H, oe.canAnswer) : null, se = a?.id === "agentico-orchestrator" && a.scopedSubagentId ? G(a.scopedSubagentId) : void 0, ce = se?.manualEntry ? se : null, Y = F(!0);
3116
3219
  M(() => {
3117
3220
  let e = D.current;
3118
3221
  if (!e) return;
@@ -3142,7 +3245,7 @@ function Nn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
3142
3245
  });
3143
3246
  return n.observe(t), () => n.disconnect();
3144
3247
  }, [a?.id, o]);
3145
- let ue = s ? /* @__PURE__ */ R(xn, { userGoal: s }, c) : null, de = f ? G(f.subagentId) : void 0, fe = f && de ? /* @__PURE__ */ R(bn, {
3248
+ let ue = s ? /* @__PURE__ */ R(Tn, { userGoal: s }, c) : null, de = f ? G(f.subagentId) : void 0, fe = f && de ? /* @__PURE__ */ R(wn, {
3146
3249
  manifest: de,
3147
3250
  params: f.snapshot.params,
3148
3251
  taskId: $e(f.subagentId, f.entityId),
@@ -3150,14 +3253,14 @@ function Nn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
3150
3253
  history: f.snapshot.history,
3151
3254
  activity: f.snapshot.activity
3152
3255
  }
3153
- }, p) : null, pe = g ? G(g.subagentId) : void 0, me = g && pe ? /* @__PURE__ */ R(Sn, {
3256
+ }, p) : null, pe = g ? G(g.subagentId) : void 0, me = g && pe ? /* @__PURE__ */ R(En, {
3154
3257
  manifest: pe,
3155
3258
  extraDestinations: g.extraDestinations
3156
- }, _) : null, he = x ? G(x.subagentId) : void 0, Z = x && he ? /* @__PURE__ */ R(bn, {
3259
+ }, _) : null, he = x ? G(x.subagentId) : void 0, Z = x && he ? /* @__PURE__ */ R(wn, {
3157
3260
  manifest: he,
3158
3261
  params: x.params,
3159
3262
  extraDestinations: x.extraDestinations
3160
- }, S) : null, ge = C ? G(C.subagentId) : void 0, _e = C && ge ? /* @__PURE__ */ R(bn, {
3263
+ }, S) : null, ge = C ? G(C.subagentId) : void 0, _e = C && ge ? /* @__PURE__ */ R(wn, {
3161
3264
  manifest: ge,
3162
3265
  params: C.params,
3163
3266
  taskId: C.taskId,
@@ -3173,7 +3276,7 @@ function Nn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
3173
3276
  style: { width: B.width },
3174
3277
  className: "relative flex h-full shrink-0 flex-col border-l border-border bg-background",
3175
3278
  children: [
3176
- /* @__PURE__ */ R(Lt, {
3279
+ /* @__PURE__ */ R(Vt, {
3177
3280
  width: B.width,
3178
3281
  min: B.min,
3179
3282
  max: B.max,
@@ -3188,7 +3291,7 @@ function Nn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
3188
3291
  className: "min-w-0 flex-1 truncate text-lg font-semibold leading-tight",
3189
3292
  children: a ? a.title : "Agentico"
3190
3293
  }),
3191
- T && /* @__PURE__ */ R(Mn, {
3294
+ T && /* @__PURE__ */ R(In, {
3192
3295
  scopeId: T.id,
3193
3296
  currentTaskId: a?.id ?? null,
3194
3297
  open: O,
@@ -3197,7 +3300,7 @@ function Nn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
3197
3300
  onSelect: (e, t, n) => h(e, t, n),
3198
3301
  onArchivedCurrent: m
3199
3302
  }),
3200
- /* @__PURE__ */ R(Rt, {})
3303
+ /* @__PURE__ */ R(Ht, {})
3201
3304
  ]
3202
3305
  }),
3203
3306
  /* @__PURE__ */ R("div", {
@@ -3207,7 +3310,7 @@ function Nn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
3207
3310
  ref: X,
3208
3311
  className: "pt-2",
3209
3312
  children: a ? /* @__PURE__ */ z(L, { children: [
3210
- T && a.thread && /* @__PURE__ */ R(wn, {
3313
+ T && a.thread && /* @__PURE__ */ R(On, {
3211
3314
  scopeId: T.id,
3212
3315
  thread: a.thread,
3213
3316
  taskId: a.id,
@@ -3222,7 +3325,7 @@ function Nn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
3222
3325
  className: "text-xs text-muted-foreground",
3223
3326
  children: a.manualEntry.prompt
3224
3327
  }),
3225
- /* @__PURE__ */ R(Et, {
3328
+ /* @__PURE__ */ R(At, {
3226
3329
  activity: ne,
3227
3330
  questions: oe,
3228
3331
  docked: J,
@@ -3234,7 +3337,7 @@ function Nn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
3234
3337
  className: "mt-3",
3235
3338
  children: a.panelExtra
3236
3339
  }),
3237
- U.length > 0 && /* @__PURE__ */ R(Et, {
3340
+ U.length > 0 && /* @__PURE__ */ R(At, {
3238
3341
  activity: U,
3239
3342
  questions: oe,
3240
3343
  docked: J,
@@ -3279,7 +3382,7 @@ function Nn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
3279
3382
  })
3280
3383
  ]
3281
3384
  })
3282
- ] }) : d.length > 0 ? /* @__PURE__ */ R(jn, { messages: d }) : u ? /* @__PURE__ */ R(An, { card: u }) : /* @__PURE__ */ R("p", {
3385
+ ] }) : d.length > 0 ? /* @__PURE__ */ R(Fn, { messages: d }) : u ? /* @__PURE__ */ R(Pn, { card: u }) : /* @__PURE__ */ R("p", {
3283
3386
  className: "text-xs text-muted-foreground",
3284
3387
  children: l ?? E.orchestratorStarterHint
3285
3388
  })
@@ -3295,7 +3398,7 @@ function Nn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
3295
3398
  }),
3296
3399
  /* @__PURE__ */ R("div", {
3297
3400
  className: "min-h-0 overflow-y-auto px-4 py-3",
3298
- children: /* @__PURE__ */ R(Ct, {
3401
+ children: /* @__PURE__ */ R(Tt, {
3299
3402
  entry: J.entry,
3300
3403
  part: J.part,
3301
3404
  questions: oe,
@@ -3317,12 +3420,12 @@ function Nn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
3317
3420
  children: [a?.panelActions && /* @__PURE__ */ R("div", {
3318
3421
  className: "mb-2",
3319
3422
  children: a.panelActions
3320
- }), a ? /* @__PURE__ */ R(En, {
3423
+ }), a ? /* @__PURE__ */ R(An, {
3321
3424
  task: a,
3322
3425
  editing: A,
3323
3426
  onCancelEdit: () => j(null),
3324
3427
  onSendEdit: (e, t) => q(e, t)
3325
- }, a.id) : /* @__PURE__ */ R(Dn, {})]
3428
+ }, a.id) : /* @__PURE__ */ R(jn, {})]
3326
3429
  }),
3327
3430
  N && /* @__PURE__ */ z(v, {
3328
3431
  title: E.rewindTitle,
@@ -3348,13 +3451,13 @@ function Nn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
3348
3451
  }
3349
3452
  //#endregion
3350
3453
  //#region src/presentation/useAgenticoPageContext.ts
3351
- function Pn(e, t) {
3454
+ function Rn(e, t) {
3352
3455
  let { setPageContext: n } = ot(), r = F(crypto.randomUUID()).current;
3353
3456
  M(() => (n(r, e, t ?? null), () => n(r, null)), [e, t]);
3354
3457
  }
3355
3458
  //#endregion
3356
3459
  //#region src/presentation/useSubagentComponentContext.ts
3357
- function Fn(e, t, n, r, i = !0, a) {
3460
+ function zn(e, t, n, r, i = !0, a) {
3358
3461
  let { registerComponentAnchor: o } = ot(), s = F(crypto.randomUUID()).current, c = F(n);
3359
3462
  c.current = n, M(() => {
3360
3463
  if (i) return o(s, {
@@ -3373,6 +3476,6 @@ function Fn(e, t, n, r, i = !0, a) {
3373
3476
  ]);
3374
3477
  }
3375
3478
  //#endregion
3376
- export { kt as AGENTICO_MAX_WIDTH, Ot as AGENTICO_MIN_WIDTH, Dt as AGENTICO_WIDTH, At as AGENTICO_WIDTH_STORAGE_KEY, Nn as Agentico, at as AgenticoProvider, Rt as AgenticoToggle, V as DEFAULT_REASONING_PART_ID, B as DEFAULT_TEXT_PART_ID, xe as JSON_EXPORT_DESTINATION_ID, ge as MICRO_PROMPT_REGISTRY, rt as ORCHESTRATOR_TASK_ID, Z as SUMMARY_MICRO_PROMPT, Oe as agenticoDe, Ee as agenticoEn, De as agenticoIt, se as agenticoPromptsEn, ce as agenticoPromptsIt, nt as agenticoTranslations, _e as applyMicroPrompts, qe as chatHasPersonMessage, Xe as chatStartedAt, et as chatThreadOf, Ke as chatTitle, le as configureAgenticoPrompts, je as configureEntityChatStore, ie as createCrossAgentTools, ne as defineSubagent, tt as earlierSessions, $e as entityChatTaskId, ve as extractErrorMessage, ye as extractJsonBlock, G as findSubagentManifest, te as formatQuestionAnswers, X as getAgenticoPrompts, Te as getDestinationRegistry, Ve as getEntityChat, fn as getSubagentControls, re as getSubagentRegistry, sn as getSubagentReport, Me as hasEntityChatBackend, Se as jsonExportDestination, Qe as listEntityChats, ee as messagePartsText, ze as onEntityChatsChange, q as registerCrossAgentTools, we as registerDestinations, dn as registerSubagentControls, on as registerSubagentReports, W as registerSubagents, Ze as removeEntityChat, Ye as renameEntityChat, he as renderRegistryCli, me as renderSubagentCli, ue as resetAgenticoPrompts, He as saveEntityChat, Fe as syncEntityChats, ae as toJsonSchema, oe as toMcpTool, H as upsertMessagePart, Xt as useAgent, ot as useAgentico, $ as useAgenticoI18n, Pn as useAgenticoPageContext, Fn as useSubagentComponentContext };
3479
+ export { Nt as AGENTICO_MAX_WIDTH, Mt as AGENTICO_MIN_WIDTH, jt as AGENTICO_WIDTH, Pt as AGENTICO_WIDTH_STORAGE_KEY, Ln as Agentico, at as AgenticoProvider, Ht as AgenticoToggle, V as DEFAULT_REASONING_PART_ID, B as DEFAULT_TEXT_PART_ID, xe as JSON_EXPORT_DESTINATION_ID, ge as MICRO_PROMPT_REGISTRY, rt as ORCHESTRATOR_TASK_ID, Z as SUMMARY_MICRO_PROMPT, Oe as agenticoDe, Ee as agenticoEn, De as agenticoIt, se as agenticoPromptsEn, ce as agenticoPromptsIt, nt as agenticoTranslations, _e as applyMicroPrompts, qe as chatHasPersonMessage, Xe as chatStartedAt, et as chatThreadOf, Ke as chatTitle, le as configureAgenticoPrompts, je as configureEntityChatStore, ie as createCrossAgentTools, ne as defineSubagent, tt as earlierSessions, $e as entityChatTaskId, ve as extractErrorMessage, ye as extractJsonBlock, G as findSubagentManifest, te as formatQuestionAnswers, X as getAgenticoPrompts, Te as getDestinationRegistry, Ve as getEntityChat, gn as getSubagentControls, re as getSubagentRegistry, dn as getSubagentReport, Me as hasEntityChatBackend, Se as jsonExportDestination, Qe as listEntityChats, ee as messagePartsText, ze as onEntityChatsChange, q as registerCrossAgentTools, we as registerDestinations, hn as registerSubagentControls, un as registerSubagentReports, W as registerSubagents, Ze as removeEntityChat, Ye as renameEntityChat, he as renderRegistryCli, me as renderSubagentCli, ue as resetAgenticoPrompts, He as saveEntityChat, Fe as syncEntityChats, ae as toJsonSchema, oe as toMcpTool, H as upsertMessagePart, en as useAgent, ot as useAgentico, $ as useAgenticoI18n, Rn as useAgenticoPageContext, zn as useSubagentComponentContext };
3377
3480
 
3378
3481
  //# sourceMappingURL=index.mjs.map