@llmnative/agentico 0.10.0 → 0.10.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
@@ -279,143 +279,8 @@ function be() {
279
279
  };
280
280
  }
281
281
  //#endregion
282
- //#region src/domain/entityChatStore.ts
283
- var xe = "llmnative.agentico.entityChat";
284
- function Se(e) {
285
- xe = e.storageKey;
286
- }
287
- function Ce(e) {
288
- if (!e || typeof e != "object") return null;
289
- let t = e;
290
- if (typeof t.entityId != "string") return null;
291
- let n = t.scopeId ?? t.tenantId;
292
- if (typeof n != "string") return null;
293
- let { tenantId: r, ...i } = t;
294
- return {
295
- ...i,
296
- scopeId: n
297
- };
298
- }
299
- function we() {
300
- try {
301
- let e = localStorage.getItem(xe);
302
- if (!e) return [];
303
- let t = JSON.parse(e);
304
- return Array.isArray(t) ? t.map(Ce).filter((e) => e !== null) : [];
305
- } catch {
306
- return [];
307
- }
308
- }
309
- var Te = /* @__PURE__ */ new Set();
310
- function Ee(e) {
311
- return Te.add(e), () => {
312
- Te.delete(e);
313
- };
314
- }
315
- function De(e) {
316
- try {
317
- localStorage.setItem(xe, JSON.stringify(e));
318
- } catch {}
319
- for (let e of [...Te]) e();
320
- }
321
- var Oe = (e, t, n) => `${e}:${t}:${n}`;
322
- function ke(e, t, n) {
323
- let r = Oe(e, t, n);
324
- return we().find((e) => Oe(e.scopeId, e.subagentId, e.entityId) === r) ?? null;
325
- }
326
- function Ae(e) {
327
- let t = Oe(e.scopeId, e.subagentId, e.entityId), n = we(), r = n.find((e) => Oe(e.scopeId, e.subagentId, e.entityId) === t), i = Date.now(), a = n.filter((e) => e !== r);
328
- a.push({
329
- ...e,
330
- savedAt: i,
331
- startedAt: r ? Pe(r) : i,
332
- ...r?.name ? {
333
- name: r.name,
334
- namedBy: r.namedBy
335
- } : {}
336
- }), De(a);
337
- }
338
- var je = (e) => e.name || e.title || e.entityId, Me = (e) => e.activity.some((e) => e.kind === "user" && !!e.detail?.trim());
339
- function Ne(e, t, n, r, i = "person") {
340
- let a = Oe(e, t, n), o = we(), s = o.find((e) => Oe(e.scopeId, e.subagentId, e.entityId) === a);
341
- if (!s || i === "model" && s.namedBy === "person") return !1;
342
- let c = r.trim().replace(/\s+/g, " ").slice(0, 120), { name: l, namedBy: u, ...d } = s, f = c ? {
343
- ...d,
344
- name: c,
345
- namedBy: i
346
- } : d;
347
- return De(o.map((e) => e === s ? f : e)), !0;
348
- }
349
- var Pe = (e) => e.startedAt ?? e.savedAt;
350
- function Fe(e, t, n) {
351
- let r = Oe(e, t, n);
352
- De(we().filter((e) => Oe(e.scopeId, e.subagentId, e.entityId) !== r));
353
- }
354
- function Ie(e) {
355
- return we().filter((t) => t.scopeId === e).sort((e, t) => Pe(t) - Pe(e));
356
- }
357
- var Le = (e, t) => `entitychat-${e}-${t}`, Re = {
358
- modelLabel: "Modell",
359
- modelsLoading: "Wird geladen…",
360
- noModelsAvailable: "Keine Modelle verfügbar",
361
- noProviderConnected: "Kein AI-Provider verbunden",
362
- selectModelPlaceholder: "Modell wählen…",
363
- orchestratorStarterHint: "Sag Agentico, was du erreichen willst — es wählt das passende Werkzeug und fragt nach den nötigen Angaben.",
364
- orchestratorStarterPlaceholder: "Beschreibe, was du tun möchtest…",
365
- destinationPickerTitle: "Ergebnis speichern in…",
366
- destinationApplying: "Wird gespeichert…",
367
- destinationNoScope: "Kein Ziel ausgewählt — vor dem Speichern eines auswählen.",
368
- unknownDestination: "Unbekanntes Ziel: {id}",
369
- exportJson: "Als JSON exportieren",
370
- orchestratorUnavailable: "AI nicht verfügbar — öffne das benötigte Werkzeug direkt auf seiner Seite.",
371
- orchestratorContinueWithoutAi: "Weiter ohne AI.",
372
- orchestratorPreparing: "{label} wird vorbereitet…",
373
- orchestratorCollecting: "Parameter für {label} werden gesammelt…",
374
- thinking: "Denke nach…",
375
- stopped: "Vom Benutzer abgebrochen.",
376
- toolRequest: "Werkzeugausführung angefordert",
377
- modelRequestError: "Fehler bei der Anfrage an das Modell",
378
- noProviderResponse: "Keine Antwort vom AI-Provider.",
379
- noActiveSession: "Keine aktive Sitzung — zuerst run() aufrufen.",
380
- approvalHeader: "Freigabe",
381
- approve: "Freigeben",
382
- reject: "Ablehnen",
383
- approveQuestion: "Freigeben? {action}",
384
- requestInProgress: "Eine andere Anfrage läuft bereits.",
385
- invalidResponse: "Ungültige AI-Antwort.",
386
- responseReceived: "Antwort erhalten",
387
- noProviderAvailable: "Kein AI-Provider verfügbar.",
388
- tooManyToolTurns: "Zu viele aufeinanderfolgende Werkzeugaufrufe — das bisher gesammelte deterministische Ergebnis wird verwendet.",
389
- aiDisabledFallback: "AI deaktiviert — das deterministische Ergebnis wird verwendet.",
390
- continueWithoutAiFallback: "Weiter ohne AI — das deterministische Ergebnis wird verwendet.",
391
- oneStep: "1 Schritt",
392
- steps: "{count} Schritte",
393
- stepsLabel: "Schritte des Agenten",
394
- newInstance: "Neue Instanz von \"{label}\"",
395
- chatHistory: "Chatverlauf",
396
- renameChat: "Umbenennen",
397
- chatTitleLabel: "Titel",
398
- chatTitleHint: "Leer: der aus dem Chat geschriebene Titel.",
399
- chatStarted: "Begonnen am {at}",
400
- chatLastMessage: "letzte Nachricht am {at}",
401
- newChat: "Neuer Chat",
402
- searchChats: "Chats durchsuchen…",
403
- messagePlaceholder: "Nachricht schreiben…",
404
- unsavedConversationConfirm: "Diese Unterhaltung wurde nicht gespeichert und geht verloren. Fortfahren?",
405
- noSavedChats: "Noch keine gespeicherten Chats.",
406
- archiveChat: "Archivieren",
407
- noResults: "Keine Ergebnisse.",
408
- retry: "Erneut versuchen",
409
- retryMessage: "Erneut versuchen.",
410
- continueWithoutAi: "Ohne AI fortfahren",
411
- resumeWithAi: "Mit AI fortsetzen",
412
- openPanel: "Agentenbereich öffnen",
413
- closePanel: "Agentenbereich schließen",
414
- resizePanel: "Agent-Bereich in der Größe ändern",
415
- resizePanelHint: "Ziehen zum Ändern der Größe, Doppelklick zum Zurücksetzen",
416
- pendingQuestions: "Fragen des Agenten",
417
- stop: "Stoppen"
418
- }, ze = {
282
+ //#region src/i18n/en.ts
283
+ var xe = {
419
284
  modelLabel: "Model",
420
285
  modelsLoading: "Loading…",
421
286
  noModelsAvailable: "No models available",
@@ -476,7 +341,7 @@ var Le = (e, t) => `entitychat-${e}-${t}`, Re = {
476
341
  resizePanelHint: "Drag to resize, double-click to reset",
477
342
  pendingQuestions: "Questions of the agent",
478
343
  stop: "Stop"
479
- }, Be = {
344
+ }, Se = {
480
345
  modelLabel: "Modello",
481
346
  modelsLoading: "Caricamento…",
482
347
  noModelsAvailable: "Nessun modello disponibile",
@@ -537,22 +402,164 @@ var Le = (e, t) => `entitychat-${e}-${t}`, Re = {
537
402
  resizePanelHint: "Trascina per ridimensionare, doppio clic per ripristinare",
538
403
  pendingQuestions: "Domande dell'agente",
539
404
  stop: "Ferma"
540
- }, Ve = {
541
- en: { agentico: ze },
542
- it: { agentico: Be },
543
- de: { agentico: Re }
405
+ }, Ce = {
406
+ modelLabel: "Modell",
407
+ modelsLoading: "Wird geladen…",
408
+ noModelsAvailable: "Keine Modelle verfügbar",
409
+ noProviderConnected: "Kein AI-Provider verbunden",
410
+ selectModelPlaceholder: "Modell wählen…",
411
+ orchestratorStarterHint: "Sag Agentico, was du erreichen willst — es wählt das passende Werkzeug und fragt nach den nötigen Angaben.",
412
+ orchestratorStarterPlaceholder: "Beschreibe, was du tun möchtest…",
413
+ destinationPickerTitle: "Ergebnis speichern in…",
414
+ destinationApplying: "Wird gespeichert…",
415
+ destinationNoScope: "Kein Ziel ausgewählt — vor dem Speichern eines auswählen.",
416
+ unknownDestination: "Unbekanntes Ziel: {id}",
417
+ exportJson: "Als JSON exportieren",
418
+ orchestratorUnavailable: "AI nicht verfügbar — öffne das benötigte Werkzeug direkt auf seiner Seite.",
419
+ orchestratorContinueWithoutAi: "Weiter ohne AI.",
420
+ orchestratorPreparing: "{label} wird vorbereitet…",
421
+ orchestratorCollecting: "Parameter für {label} werden gesammelt…",
422
+ thinking: "Denke nach…",
423
+ stopped: "Vom Benutzer abgebrochen.",
424
+ toolRequest: "Werkzeugausführung angefordert",
425
+ modelRequestError: "Fehler bei der Anfrage an das Modell",
426
+ noProviderResponse: "Keine Antwort vom AI-Provider.",
427
+ noActiveSession: "Keine aktive Sitzung — zuerst run() aufrufen.",
428
+ approvalHeader: "Freigabe",
429
+ approve: "Freigeben",
430
+ reject: "Ablehnen",
431
+ approveQuestion: "Freigeben? {action}",
432
+ requestInProgress: "Eine andere Anfrage läuft bereits.",
433
+ invalidResponse: "Ungültige AI-Antwort.",
434
+ responseReceived: "Antwort erhalten",
435
+ noProviderAvailable: "Kein AI-Provider verfügbar.",
436
+ tooManyToolTurns: "Zu viele aufeinanderfolgende Werkzeugaufrufe — das bisher gesammelte deterministische Ergebnis wird verwendet.",
437
+ aiDisabledFallback: "AI deaktiviert — das deterministische Ergebnis wird verwendet.",
438
+ continueWithoutAiFallback: "Weiter ohne AI — das deterministische Ergebnis wird verwendet.",
439
+ oneStep: "1 Schritt",
440
+ steps: "{count} Schritte",
441
+ stepsLabel: "Schritte des Agenten",
442
+ newInstance: "Neue Instanz von \"{label}\"",
443
+ chatHistory: "Chatverlauf",
444
+ renameChat: "Umbenennen",
445
+ chatTitleLabel: "Titel",
446
+ chatTitleHint: "Leer: der aus dem Chat geschriebene Titel.",
447
+ chatStarted: "Begonnen am {at}",
448
+ chatLastMessage: "letzte Nachricht am {at}",
449
+ newChat: "Neuer Chat",
450
+ searchChats: "Chats durchsuchen…",
451
+ messagePlaceholder: "Nachricht schreiben…",
452
+ unsavedConversationConfirm: "Diese Unterhaltung wurde nicht gespeichert und geht verloren. Fortfahren?",
453
+ noSavedChats: "Noch keine gespeicherten Chats.",
454
+ archiveChat: "Archivieren",
455
+ noResults: "Keine Ergebnisse.",
456
+ retry: "Erneut versuchen",
457
+ retryMessage: "Erneut versuchen.",
458
+ continueWithoutAi: "Ohne AI fortfahren",
459
+ resumeWithAi: "Mit AI fortsetzen",
460
+ openPanel: "Agentenbereich öffnen",
461
+ closePanel: "Agentenbereich schließen",
462
+ resizePanel: "Agent-Bereich in der Größe ändern",
463
+ resizePanelHint: "Ziehen zum Ändern der Größe, Doppelklick zum Zurücksetzen",
464
+ pendingQuestions: "Fragen des Agenten",
465
+ stop: "Stoppen"
466
+ }, we = "llmnative.agentico.entityChat";
467
+ function Te(e) {
468
+ we = e.storageKey;
469
+ }
470
+ function Ee(e) {
471
+ if (!e || typeof e != "object") return null;
472
+ let t = e;
473
+ if (typeof t.entityId != "string") return null;
474
+ let n = t.scopeId ?? t.tenantId;
475
+ if (typeof n != "string") return null;
476
+ let { tenantId: r, ...i } = t;
477
+ return {
478
+ ...i,
479
+ scopeId: n
480
+ };
481
+ }
482
+ function De() {
483
+ try {
484
+ let e = localStorage.getItem(we);
485
+ if (!e) return [];
486
+ let t = JSON.parse(e);
487
+ return Array.isArray(t) ? t.map(Ee).filter((e) => e !== null) : [];
488
+ } catch {
489
+ return [];
490
+ }
491
+ }
492
+ var Oe = /* @__PURE__ */ new Set();
493
+ function ke(e) {
494
+ return Oe.add(e), () => {
495
+ Oe.delete(e);
496
+ };
497
+ }
498
+ function Ae(e) {
499
+ try {
500
+ localStorage.setItem(we, JSON.stringify(e));
501
+ } catch {}
502
+ for (let e of [...Oe]) e();
503
+ }
504
+ var je = (e, t, n) => `${e}:${t}:${n}`;
505
+ function Me(e, t, n) {
506
+ let r = je(e, t, n);
507
+ return De().find((e) => je(e.scopeId, e.subagentId, e.entityId) === r) ?? null;
508
+ }
509
+ function Ne(e) {
510
+ let t = je(e.scopeId, e.subagentId, e.entityId), n = De(), r = n.find((e) => je(e.scopeId, e.subagentId, e.entityId) === t), i = Date.now(), a = n.filter((e) => e !== r);
511
+ a.push({
512
+ ...e,
513
+ savedAt: i,
514
+ startedAt: r ? Ve(r) : i,
515
+ ...r?.name ? {
516
+ name: r.name,
517
+ namedBy: r.namedBy
518
+ } : {}
519
+ }), Ae(a);
520
+ }
521
+ var Pe = new Set([
522
+ xe,
523
+ Se,
524
+ Ce
525
+ ].map((e) => e.retryMessage.trim().toLowerCase())), Fe = (e) => e.kind === "user" && !!e.detail?.trim() && !e.retry && !Pe.has(e.detail.trim().toLowerCase()), Ie = (e) => {
526
+ let t = (e.activity.find(Fe)?.detail ?? "").trim().split("\n")[0].trim();
527
+ return t.length > 80 ? `${t.slice(0, 80).trimEnd()}…` : t;
528
+ }, Le = (e) => e.name || Ie(e) || e.title || e.entityId, Re = (e) => e.activity.some(Fe), ze = (e) => e.kind === "user" && !Fe(e) && !!e.detail?.trim();
529
+ function Be(e, t, n, r, i = "person") {
530
+ let a = je(e, t, n), o = De(), s = o.find((e) => je(e.scopeId, e.subagentId, e.entityId) === a);
531
+ if (!s || i === "model" && s.namedBy === "person") return !1;
532
+ let c = r.trim().replace(/\s+/g, " ").slice(0, 120), { name: l, namedBy: u, ...d } = s, f = c ? {
533
+ ...d,
534
+ name: c,
535
+ namedBy: i
536
+ } : d;
537
+ return Ae(o.map((e) => e === s ? f : e)), !0;
538
+ }
539
+ var Ve = (e) => e.startedAt ?? e.savedAt;
540
+ function He(e, t, n) {
541
+ let r = je(e, t, n);
542
+ Ae(De().filter((e) => je(e.scopeId, e.subagentId, e.entityId) !== r));
543
+ }
544
+ function Ue(e) {
545
+ return De().filter((t) => t.scopeId === e).sort((e, t) => Ve(t) - Ve(e));
546
+ }
547
+ var We = (e, t) => `entitychat-${e}-${t}`, Ge = {
548
+ en: { agentico: xe },
549
+ it: { agentico: Se },
550
+ de: { agentico: Ce }
544
551
  };
545
552
  function Q() {
546
553
  let { dict: e } = S(), t = e.agentico;
547
554
  return t ? {
548
- ...ze,
555
+ ...xe,
549
556
  ...t
550
- } : ze;
557
+ } : xe;
551
558
  }
552
559
  //#endregion
553
560
  //#region src/presentation/AgenticoContext.tsx
554
- var He = "agentico-orchestrator", Ue = w(null);
555
- function We({ children: e, scope: t = null }) {
561
+ var Ke = "agentico-orchestrator", qe = w(null);
562
+ function Je({ children: e, scope: t = null }) {
556
563
  let [n, r] = j(null), i = A(null);
557
564
  D(() => {
558
565
  i.current = n;
@@ -626,7 +633,7 @@ function We({ children: e, scope: t = null }) {
626
633
  let c = i.current;
627
634
  if (!c || c.id !== n) return;
628
635
  let l = c.agent.snapshot();
629
- l && (Ae({
636
+ l && (Ne({
630
637
  scopeId: a,
631
638
  subagentId: e,
632
639
  entityId: t,
@@ -645,7 +652,7 @@ function We({ children: e, scope: t = null }) {
645
652
  snapshot: n
646
653
  }), Y(crypto.randomUUID());
647
654
  }, [u]), [ie, ae] = j(null), [oe, se] = j(null), Z = T((e, t) => {
648
- u(), c(He), ae({
655
+ u(), c(Ke), ae({
649
656
  subagentId: e,
650
657
  extraDestinations: t
651
658
  }), se(crypto.randomUUID());
@@ -739,19 +746,19 @@ function We({ children: e, scope: t = null }) {
739
746
  pe,
740
747
  he
741
748
  ]);
742
- return /* @__PURE__ */ N(Ue.Provider, {
749
+ return /* @__PURE__ */ N(qe.Provider, {
743
750
  value: ye,
744
751
  children: e
745
752
  });
746
753
  }
747
754
  function $() {
748
- let e = E(Ue);
755
+ let e = E(qe);
749
756
  if (!e) throw Error("useAgentico must be used inside AgenticoProvider");
750
757
  return e;
751
758
  }
752
759
  //#endregion
753
760
  //#region src/presentation/AgentActivityLog.tsx
754
- function Ge(e) {
761
+ function Ye(e) {
755
762
  let t = e.search(/[{[]/);
756
763
  if (t === -1) return [{
757
764
  type: "text",
@@ -797,18 +804,18 @@ function Ge(e) {
797
804
  language: "json"
798
805
  });
799
806
  let u = e.slice(s + 1);
800
- return u.trim() && l.push(...Ge(u)), l;
807
+ return u.trim() && l.push(...Ye(u)), l;
801
808
  }
802
- function Ke(e) {
809
+ function Xe(e) {
803
810
  let t = [], n = /```(\w+)?\n?([\s\S]*?)```/g, r = 0, i;
804
- for (; i = n.exec(e);) i.index > r && t.push(...Ge(e.slice(r, i.index))), t.push({
811
+ for (; i = n.exec(e);) i.index > r && t.push(...Ye(e.slice(r, i.index))), t.push({
805
812
  type: "code",
806
813
  content: i[2].replace(/\n$/, ""),
807
814
  language: i[1]
808
815
  }), r = n.lastIndex;
809
- return r < e.length && t.push(...Ge(e.slice(r))), t;
816
+ return r < e.length && t.push(...Ye(e.slice(r))), t;
810
817
  }
811
- function qe({ content: e, language: t }) {
818
+ function Ze({ content: e, language: t }) {
812
819
  let [n, r] = j(!1);
813
820
  return /* @__PURE__ */ P("div", {
814
821
  className: `relative cursor-pointer rounded-md ${n ? "max-h-80 overflow-y-auto" : "max-h-28 overflow-hidden"}`,
@@ -823,9 +830,9 @@ function qe({ content: e, language: t }) {
823
830
  }), !n && /* @__PURE__ */ N("div", { className: "pointer-events-none absolute inset-x-0 bottom-0 h-6 bg-gradient-to-t from-muted/30 to-transparent" })]
824
831
  });
825
832
  }
826
- function Je({ text: e, tone: t }) {
827
- let n = Ke(e);
828
- return /* @__PURE__ */ N(M, { children: n.map((e, n) => e.type === "code" ? /* @__PURE__ */ N(qe, {
833
+ function Qe({ text: e, tone: t }) {
834
+ let n = Xe(e);
835
+ return /* @__PURE__ */ N(M, { children: n.map((e, n) => e.type === "code" ? /* @__PURE__ */ N(Ze, {
829
836
  content: e.content,
830
837
  language: e.language
831
838
  }, n) : e.content.trim() && /* @__PURE__ */ N(r, {
@@ -834,7 +841,7 @@ function Je({ text: e, tone: t }) {
834
841
  className: "break-words text-xs leading-relaxed"
835
842
  }, n)) });
836
843
  }
837
- function Ye({ status: e }) {
844
+ function $e({ status: e }) {
838
845
  return e === "running" ? /* @__PURE__ */ N("span", { className: "inline-block h-3 w-3 shrink-0 animate-spin rounded-full border-2 border-current border-t-transparent" }) : e === "done" ? /* @__PURE__ */ N(d, {
839
846
  name: "check",
840
847
  size: 12,
@@ -849,11 +856,11 @@ function Ye({ status: e }) {
849
856
  className: "shrink-0 text-destructive"
850
857
  });
851
858
  }
852
- function Xe(e, t) {
859
+ function et(e, t) {
853
860
  return e.status === "running" ? t.thinking : e.status === "error" ? t.modelRequestError : e.status === "stopped" ? t.stopped : e.detail ? t.responseReceived : e.toolNames && e.toolNames.length > 0 ? e.toolNames.join(" · ") : t.toolRequest;
854
861
  }
855
- var Ze = 96;
856
- function Qe({ entry: e, pinned: t = !0 }) {
862
+ var tt = 96;
863
+ function nt({ entry: e, pinned: t = !0 }) {
857
864
  let n = A(null), [r, i] = j(!1), [a, o] = j(!1);
858
865
  O(() => {
859
866
  let e = n.current;
@@ -867,7 +874,7 @@ function Qe({ entry: e, pinned: t = !0 }) {
867
874
  children: [/* @__PURE__ */ P("div", {
868
875
  ref: n,
869
876
  className: `space-y-1 px-2.5 pt-1.5 ${s ? "overflow-hidden" : ""}`,
870
- style: s ? { maxHeight: Ze } : void 0,
877
+ style: s ? { maxHeight: tt } : void 0,
871
878
  children: [e.attachmentNames && e.attachmentNames.length > 0 && /* @__PURE__ */ N("div", {
872
879
  className: "flex flex-wrap gap-1",
873
880
  children: e.attachmentNames.map((e, t) => /* @__PURE__ */ P("span", {
@@ -881,7 +888,7 @@ function Qe({ entry: e, pinned: t = !0 }) {
881
888
  children: e
882
889
  })]
883
890
  }, t))
884
- }), /* @__PURE__ */ N(Je, { text: e.detail ?? "" })]
891
+ }), /* @__PURE__ */ N(Qe, { text: e.detail ?? "" })]
885
892
  }), a && /* @__PURE__ */ P("button", {
886
893
  type: "button",
887
894
  onClick: () => i((e) => !e),
@@ -895,13 +902,13 @@ function Qe({ entry: e, pinned: t = !0 }) {
895
902
  })
896
903
  });
897
904
  }
898
- var $e = {
905
+ var rt = {
899
906
  running: "loader-circle",
900
907
  done: "check",
901
908
  error: "x",
902
909
  stopped: "circle-slash"
903
910
  };
904
- function et({ steps: e }) {
911
+ function it({ steps: e }) {
905
912
  let t = Q(), n = e.filter((e) => e.status === "running").at(-1), r = e.some((e) => e.status === "error"), i = n?.label ?? (e.length === 1 ? t.oneStep : _(t.steps, { count: e.length }));
906
913
  return /* @__PURE__ */ N(h, {
907
914
  ariaLabel: t.stepsLabel,
@@ -917,12 +924,12 @@ function et({ steps: e }) {
917
924
  className: e.status === "error" ? "text-destructive" : void 0,
918
925
  children: e.label
919
926
  }),
920
- icon: $e[e.status]
927
+ icon: rt[e.status]
921
928
  }))
922
929
  }]
923
930
  });
924
931
  }
925
- function tt(e, t) {
932
+ function at(e, t) {
926
933
  let n = e.at(-1);
927
934
  if (!n || n.kind !== "thinking" || !n.parts || n.status === "stopped" || n.status === "error") return null;
928
935
  let r = [...n.parts].reverse().find((e) => e.type === "questions");
@@ -931,7 +938,7 @@ function tt(e, t) {
931
938
  part: r
932
939
  };
933
940
  }
934
- function nt({ entry: e, part: t, questions: n, autoFocus: r, className: a }) {
941
+ function ot({ entry: e, part: t, questions: n, autoFocus: r, className: a }) {
935
942
  let o = !!n?.canAnswer(e.id);
936
943
  return /* @__PURE__ */ N(i, {
937
944
  questions: t.questions,
@@ -942,7 +949,7 @@ function nt({ entry: e, part: t, questions: n, autoFocus: r, className: a }) {
942
949
  className: a ?? "text-xs"
943
950
  });
944
951
  }
945
- function rt({ entry: e, questions: t, hiddenPartId: n }) {
952
+ function st({ entry: e, questions: t, hiddenPartId: n }) {
946
953
  let i = (e.parts ?? []).filter((e) => e.type !== "questions" || e.id !== n), o = [];
947
954
  for (let e of i) {
948
955
  let t = o.at(-1);
@@ -957,7 +964,7 @@ function rt({ entry: e, questions: t, hiddenPartId: n }) {
957
964
  return /* @__PURE__ */ N("div", {
958
965
  className: "space-y-2",
959
966
  children: o.map((n) => {
960
- if ("steps" in n) return /* @__PURE__ */ N(et, { steps: n.steps }, n.key);
967
+ if ("steps" in n) return /* @__PURE__ */ N(it, { steps: n.steps }, n.key);
961
968
  let { part: i } = n;
962
969
  return i.type === "text" ? i.text.trim() ? /* @__PURE__ */ N(r, {
963
970
  content: i.text,
@@ -968,7 +975,7 @@ function rt({ entry: e, questions: t, hiddenPartId: n }) {
968
975
  streaming: i.streaming,
969
976
  duration: i.duration,
970
977
  className: "my-0"
971
- }, n.key) : /* @__PURE__ */ N(nt, {
978
+ }, n.key) : /* @__PURE__ */ N(ot, {
972
979
  entry: e,
973
980
  part: i,
974
981
  questions: t
@@ -976,13 +983,13 @@ function rt({ entry: e, questions: t, hiddenPartId: n }) {
976
983
  })
977
984
  });
978
985
  }
979
- function it({ entry: e, questions: t, hiddenPartId: n }) {
986
+ function ct({ entry: e, questions: t, hiddenPartId: n }) {
980
987
  let i = Q();
981
988
  if (e.kind === "thinking" && e.parts) {
982
989
  let r = e.status === "error" || e.status === "stopped" || e.status === "running" && e.parts.length === 0;
983
990
  return /* @__PURE__ */ P("li", {
984
991
  className: "text-xs text-muted-foreground",
985
- children: [e.parts.length > 0 && /* @__PURE__ */ N(rt, {
992
+ children: [e.parts.length > 0 && /* @__PURE__ */ N(st, {
986
993
  entry: e,
987
994
  questions: t,
988
995
  hiddenPartId: n
@@ -990,15 +997,15 @@ function it({ entry: e, questions: t, hiddenPartId: n }) {
990
997
  className: `flex items-start gap-1.5 ${e.parts.length > 0 ? "mt-1" : ""}`,
991
998
  children: [/* @__PURE__ */ N("span", {
992
999
  className: "pt-px",
993
- children: /* @__PURE__ */ N(Ye, { status: e.status })
1000
+ children: /* @__PURE__ */ N($e, { status: e.status })
994
1001
  }), /* @__PURE__ */ N("span", {
995
1002
  className: "min-w-0 flex-1 whitespace-pre-wrap break-words",
996
- children: Xe(e, i)
1003
+ children: et(e, i)
997
1004
  })]
998
1005
  })]
999
1006
  });
1000
1007
  }
1001
- let a = e.kind === "thinking" && e.detail ? Ke(e.detail) : [], o = a.filter((e) => e.type === "code"), s = a.filter((e) => e.type === "text" && e.content.trim()), c = e.kind === "thinking" ? Xe(e, i) : e.label;
1008
+ let a = e.kind === "thinking" && e.detail ? Xe(e.detail) : [], o = a.filter((e) => e.type === "code"), s = a.filter((e) => e.type === "text" && e.content.trim()), c = e.kind === "thinking" ? et(e, i) : e.label;
1002
1009
  return /* @__PURE__ */ P("li", {
1003
1010
  className: "text-xs text-muted-foreground",
1004
1011
  children: [
@@ -1006,7 +1013,7 @@ function it({ entry: e, questions: t, hiddenPartId: n }) {
1006
1013
  className: "flex items-start gap-1.5",
1007
1014
  children: [/* @__PURE__ */ N("span", {
1008
1015
  className: "pt-px",
1009
- children: /* @__PURE__ */ N(Ye, { status: e.status })
1016
+ children: /* @__PURE__ */ N($e, { status: e.status })
1010
1017
  }), /* @__PURE__ */ N("span", {
1011
1018
  className: "min-w-0 flex-1 whitespace-pre-wrap break-words",
1012
1019
  children: c
@@ -1014,7 +1021,7 @@ function it({ entry: e, questions: t, hiddenPartId: n }) {
1014
1021
  }),
1015
1022
  o.length > 0 && /* @__PURE__ */ N("div", {
1016
1023
  className: "mt-1 ml-[18px] space-y-1",
1017
- children: o.map((e, t) => /* @__PURE__ */ N(qe, {
1024
+ children: o.map((e, t) => /* @__PURE__ */ N(Ze, {
1018
1025
  content: e.content,
1019
1026
  language: e.language
1020
1027
  }, t))
@@ -1030,7 +1037,7 @@ function it({ entry: e, questions: t, hiddenPartId: n }) {
1030
1037
  ]
1031
1038
  });
1032
1039
  }
1033
- function at({ activity: e, questions: t, docked: n, pinUserMessages: r = !0 }) {
1040
+ function lt({ activity: e, questions: t, docked: n, pinUserMessages: r = !0 }) {
1034
1041
  if (e.length === 0) return null;
1035
1042
  let i = [];
1036
1043
  for (let t of e) t.kind === "user" || i.length === 0 ? i.push(t.kind === "user" ? {
@@ -1039,12 +1046,12 @@ function at({ activity: e, questions: t, docked: n, pinUserMessages: r = !0 }) {
1039
1046
  } : { entries: [t] }) : i[i.length - 1].entries.push(t);
1040
1047
  return /* @__PURE__ */ N("ul", {
1041
1048
  className: "space-y-0.5",
1042
- children: i.map((e) => /* @__PURE__ */ P("li", { children: [e.user && /* @__PURE__ */ N(Qe, {
1049
+ children: i.map((e) => /* @__PURE__ */ P("li", { children: [e.user && /* @__PURE__ */ N(nt, {
1043
1050
  entry: e.user,
1044
1051
  pinned: r
1045
1052
  }), e.entries.length > 0 && /* @__PURE__ */ N("ul", {
1046
1053
  className: "space-y-0.5",
1047
- children: e.entries.map((e) => /* @__PURE__ */ N(it, {
1054
+ children: e.entries.map((e) => /* @__PURE__ */ N(ct, {
1048
1055
  entry: e,
1049
1056
  questions: t,
1050
1057
  hiddenPartId: n?.entry.id === e.id ? n.part.id : void 0
@@ -1054,55 +1061,55 @@ function at({ activity: e, questions: t, docked: n, pinUserMessages: r = !0 }) {
1054
1061
  }
1055
1062
  //#endregion
1056
1063
  //#region src/presentation/panelWidth.ts
1057
- var ot = 420, st = 320, ct = "60vw", lt = "agentico:panel-width";
1058
- function ut(e, t) {
1064
+ var ut = 420, dt = 320, ft = "60vw", pt = "agentico:panel-width";
1065
+ function mt(e, t) {
1059
1066
  if (typeof e == "number") return e;
1060
1067
  let n = Number.parseFloat(e);
1061
1068
  return Number.isFinite(n) ? Math.round(n / 100 * t) : Infinity;
1062
1069
  }
1063
- function dt(e, t, n) {
1070
+ function ht(e, t, n) {
1064
1071
  return Math.round(Math.min(Math.max(e, t), Math.max(t, n)));
1065
1072
  }
1066
- function ft() {
1073
+ function gt() {
1067
1074
  try {
1068
- let e = window.localStorage.getItem(lt), t = e === null ? NaN : Number(e);
1075
+ let e = window.localStorage.getItem(pt), t = e === null ? NaN : Number(e);
1069
1076
  return Number.isFinite(t) && t > 0 ? t : null;
1070
1077
  } catch {
1071
1078
  return null;
1072
1079
  }
1073
1080
  }
1074
- function pt(e) {
1081
+ function _t(e) {
1075
1082
  try {
1076
- e === null ? window.localStorage.removeItem(lt) : window.localStorage.setItem(lt, String(e));
1083
+ e === null ? window.localStorage.removeItem(pt) : window.localStorage.setItem(pt, String(e));
1077
1084
  } catch {}
1078
1085
  }
1079
- function mt() {
1086
+ function vt() {
1080
1087
  return typeof window > "u" ? Infinity : window.innerWidth;
1081
1088
  }
1082
- function ht({ defaultWidth: e = 420, minWidth: t = 320, maxWidth: n = ct, onWidthChange: r }) {
1083
- let [i, a] = j(mt), [o, s] = j(() => ft() ?? e);
1089
+ function yt({ defaultWidth: e = 420, minWidth: t = 320, maxWidth: n = ft, onWidthChange: r }) {
1090
+ let [i, a] = j(vt), [o, s] = j(() => gt() ?? e);
1084
1091
  D(() => {
1085
1092
  if (typeof window > "u") return;
1086
1093
  let e = () => a(window.innerWidth);
1087
1094
  return window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
1088
1095
  }, []);
1089
- let c = t, l = Math.max(c, ut(n, i)), u = dt(o, c, l);
1096
+ let c = t, l = Math.max(c, mt(n, i)), u = ht(o, c, l);
1090
1097
  return D(() => {
1091
1098
  r?.(u);
1092
1099
  }, [u]), {
1093
1100
  width: u,
1094
1101
  min: c,
1095
1102
  max: l,
1096
- set: T((e) => s(dt(e, c, l)), [c, l]),
1097
- commit: T((e) => pt(dt(e, c, l)), [c, l]),
1103
+ set: T((e) => s(ht(e, c, l)), [c, l]),
1104
+ commit: T((e) => _t(ht(e, c, l)), [c, l]),
1098
1105
  reset: T(() => {
1099
- s(e), pt(null);
1106
+ s(e), _t(null);
1100
1107
  }, [e])
1101
1108
  };
1102
1109
  }
1103
1110
  //#endregion
1104
1111
  //#region src/presentation/AgenticoResizeHandle.tsx
1105
- function gt({ width: e, min: t, max: n, onResize: r, onCommit: i, onReset: a }) {
1112
+ function bt({ width: e, min: t, max: n, onResize: r, onCommit: i, onReset: a }) {
1106
1113
  let o = Q(), s = A(null), [c, l] = j(!1), u = (e) => Math.round(Math.min(Math.max(e, t), Math.max(t, n))), d = (e) => {
1107
1114
  let t = s.current;
1108
1115
  if (t && t.pointerId === e.pointerId) {
@@ -1160,7 +1167,7 @@ function gt({ width: e, min: t, max: n, onResize: r, onCommit: i, onReset: a })
1160
1167
  }
1161
1168
  //#endregion
1162
1169
  //#region src/presentation/AgenticoToggle.tsx
1163
- function _t({ className: e = "" }) {
1170
+ function xt({ className: e = "" }) {
1164
1171
  let { isOpen: n, toggleOpen: r, task: i } = $(), a = Q(), o = i?.agent.running ?? !1;
1165
1172
  return /* @__PURE__ */ N(t, {
1166
1173
  icon: "bot",
@@ -1173,21 +1180,21 @@ function _t({ className: e = "" }) {
1173
1180
  }
1174
1181
  //#endregion
1175
1182
  //#region src/presentation/useAIModelCatalog.ts
1176
- var vt = "llmnative-cms.selectedAIModel";
1177
- function yt() {
1183
+ var St = "llmnative-cms.selectedAIModel";
1184
+ function Ct() {
1178
1185
  try {
1179
- return localStorage.getItem(vt) ?? "";
1186
+ return localStorage.getItem(St) ?? "";
1180
1187
  } catch {
1181
1188
  return "";
1182
1189
  }
1183
1190
  }
1184
- function bt(e) {
1191
+ function wt(e) {
1185
1192
  try {
1186
- e ? localStorage.setItem(vt, e) : localStorage.removeItem(vt);
1193
+ e ? localStorage.setItem(St, e) : localStorage.removeItem(St);
1187
1194
  } catch {}
1188
1195
  }
1189
- function xt() {
1190
- let e = b()?.registry ?? {}, t = Object.keys(e).length > 0, [n, r] = j({}), [i, a] = j(!1), [o, s] = j(yt);
1196
+ function Tt() {
1197
+ let e = b()?.registry ?? {}, t = Object.keys(e).length > 0, [n, r] = j({}), [i, a] = j(!1), [o, s] = j(Ct);
1191
1198
  return D(() => {
1192
1199
  if (!t) {
1193
1200
  r({});
@@ -1198,7 +1205,7 @@ function xt() {
1198
1205
  if (n) return;
1199
1206
  r(e.modelsByProvider);
1200
1207
  let t = Object.values(e.modelsByProvider).flat();
1201
- s((e) => t.some((t) => t.id === e) ? e : (bt(""), ""));
1208
+ s((e) => t.some((t) => t.id === e) ? e : (wt(""), ""));
1202
1209
  }).catch((e) => {
1203
1210
  console.error("useAIModelCatalog: getAIModelCatalog failed", e), n || r({});
1204
1211
  }).finally(() => {
@@ -1212,17 +1219,17 @@ function xt() {
1212
1219
  modelsLoading: i,
1213
1220
  selectedModel: o,
1214
1221
  setSelectedModel: (e) => {
1215
- bt(e), s(e);
1222
+ wt(e), s(e);
1216
1223
  }
1217
1224
  };
1218
1225
  }
1219
1226
  //#endregion
1220
1227
  //#region src/domain/approval.ts
1221
- var St = "approval";
1222
- function Ct(e, t) {
1228
+ var Et = "approval";
1229
+ function Dt(e, t) {
1223
1230
  return typeof e.needsApproval == "function" ? e.needsApproval(t) : e.needsApproval === !0;
1224
1231
  }
1225
- function wt(e, t, n) {
1232
+ function Ot(e, t, n) {
1226
1233
  let r = e[0]?.values ?? [], i = r.filter((e) => e !== t && e !== n).join(" ").trim();
1227
1234
  return {
1228
1235
  approved: r.includes(t) && !r.includes(n),
@@ -1231,12 +1238,12 @@ function wt(e, t, n) {
1231
1238
  }
1232
1239
  //#endregion
1233
1240
  //#region src/presentation/useAgent.ts
1234
- var Tt = 20, Et = 26e4;
1235
- function Dt(e) {
1236
- return e.filter((e) => !m.isTextAttachment(e.mimeType) || e.base64.length <= Et);
1241
+ var kt = 20, At = 26e4;
1242
+ function jt(e) {
1243
+ return e.filter((e) => !m.isTextAttachment(e.mimeType) || e.base64.length <= At);
1237
1244
  }
1238
- function Ot(e, t = {}) {
1239
- let { defaultEnabled: n = !1 } = t, [r, i] = j(n), { hasProviders: a, modelsByProvider: o, modelsLoading: s, selectedModel: c, setSelectedModel: l } = xt(), [u, d] = j(!1), [f, p] = j(null), [h, g] = j(!1), [_, y] = j([]), x = A([]), S = (e) => {
1245
+ function Mt(e, t = {}) {
1246
+ let { defaultEnabled: n = !1 } = t, [r, i] = j(n), { hasProviders: a, modelsByProvider: o, modelsLoading: s, selectedModel: c, setSelectedModel: l } = Tt(), [u, d] = j(!1), [f, p] = j(null), [h, g] = j(!1), [_, y] = j([]), x = A([]), S = (e) => {
1240
1247
  y((t) => {
1241
1248
  let n = typeof e == "function" ? e(t) : e;
1242
1249
  return x.current = n, n;
@@ -1410,7 +1417,7 @@ function Ot(e, t = {}) {
1410
1417
  let l = s ? v(s) : H, u = l ? N[l.provider] : null;
1411
1418
  if (!u || !l) return p(T.current.noProviderAvailable), null;
1412
1419
  n?.length && (c.attachmentsRef.current = [...c.attachmentsRef.current ?? [], ...n]);
1413
- let d = (n ?? []).filter((e) => m.isTextAttachment(e.mimeType)).map((e) => e.base64.length <= Et ? `\n\n[File allegato: ${e.name}]\n${m.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(""), f = Dt(n ?? []), h = c.tools.map((e) => ({
1420
+ let d = (n ?? []).filter((e) => m.isTextAttachment(e.mimeType)).map((e) => e.base64.length <= At ? `\n\n[File allegato: ${e.name}]\n${m.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(""), f = jt(n ?? []), h = c.tools.map((e) => ({
1414
1421
  name: e.name,
1415
1422
  description: e.description,
1416
1423
  inputSchema: K(e.inputSchema)
@@ -1423,7 +1430,7 @@ function Ot(e, t = {}) {
1423
1430
  status: "running",
1424
1431
  parts: [{
1425
1432
  type: "questions",
1426
- id: St,
1433
+ id: Et,
1427
1434
  questions: [{
1428
1435
  header: i.approvalHeader,
1429
1436
  question: i.approveQuestion.replace("{action}", o),
@@ -1432,7 +1439,7 @@ function Ot(e, t = {}) {
1432
1439
  }]
1433
1440
  }]
1434
1441
  }]);
1435
- let s = `${a}:${St}`;
1442
+ let s = `${a}:${Et}`;
1436
1443
  return new Promise((e, t) => {
1437
1444
  let n = () => {
1438
1445
  C.current.delete(s), b(a, "stopped"), t(new DOMException("The turn was stopped.", "AbortError"));
@@ -1443,7 +1450,7 @@ function Ot(e, t = {}) {
1443
1450
  }
1444
1451
  r.addEventListener("abort", n, { once: !0 }), C.current.set(s, {
1445
1452
  resolve: (t) => {
1446
- r.removeEventListener("abort", n), b(a, "done"), e(wt(t, i.approve, i.reject));
1453
+ r.removeEventListener("abort", n), b(a, "done"), e(Ot(t, i.approve, i.reject));
1447
1454
  },
1448
1455
  reject: t
1449
1456
  });
@@ -1458,7 +1465,7 @@ function Ot(e, t = {}) {
1458
1465
  } : i));
1459
1466
  try {
1460
1467
  let n = c.history, r = t;
1461
- for (let t = 0; t < Tt; t++) {
1468
+ for (let t = 0; t < kt; t++) {
1462
1469
  let i = crypto.randomUUID();
1463
1470
  S((e) => [...e, {
1464
1471
  id: i,
@@ -1517,7 +1524,7 @@ function Ot(e, t = {}) {
1517
1524
  let s = /* @__PURE__ */ new Map();
1518
1525
  for (let t of a.toolCalls) {
1519
1526
  let n = _.get(t.name);
1520
- if (n && Ct(n, t.input)) try {
1527
+ if (n && Dt(n, t.input)) try {
1521
1528
  s.set(t.id, await g(t.id, n, t.input, y.signal));
1522
1529
  } catch {
1523
1530
  return e.fallback(c.params, c.context);
@@ -1691,7 +1698,8 @@ function Ot(e, t = {}) {
1691
1698
  label: "Tu",
1692
1699
  status: "done",
1693
1700
  detail: t,
1694
- ...n?.attachments?.length ? { attachmentNames: n.attachments.map((e) => e.name) } : {}
1701
+ ...n?.attachments?.length ? { attachmentNames: n.attachments.map((e) => e.name) } : {},
1702
+ ...n?.retry ? { retry: !0 } : {}
1695
1703
  }]);
1696
1704
  try {
1697
1705
  if (q) return await le(t, !1, n?.model || void 0);
@@ -1751,23 +1759,23 @@ function Ot(e, t = {}) {
1751
1759
  }
1752
1760
  //#endregion
1753
1761
  //#region src/domain/orchestrator/prompt.ts
1754
- function kt() {
1762
+ function Nt() {
1755
1763
  let e = X();
1756
1764
  return [e.responseRulesHeading, ...e.responseRules.map((e) => `- ${e}`)].join("\n");
1757
1765
  }
1758
- function At(e, t, n) {
1766
+ function Pt(e, t, n) {
1759
1767
  let r = X(), i = n ? `\n${r.pageContextHeading}\n${r.pageContextIntro}\n${n}\n` : "";
1760
1768
  return `${r.orchestratorIntro}
1761
1769
 
1762
1770
  ${r.toolsHeading}
1763
1771
  ${t}
1764
1772
  ${i}
1765
- ${kt()}
1773
+ ${Nt()}
1766
1774
 
1767
1775
  ${r.userRequestHeading}
1768
1776
  ${e}`;
1769
1777
  }
1770
- function jt(e, t) {
1778
+ function Ft(e, t) {
1771
1779
  return t ? {
1772
1780
  kind: "handoff",
1773
1781
  ...t
@@ -1778,27 +1786,27 @@ function jt(e, t) {
1778
1786
  }
1779
1787
  //#endregion
1780
1788
  //#region src/domain/orchestrator/agenticoOrchestratorAgent.ts
1781
- function Mt(e) {
1789
+ function It(e) {
1782
1790
  return V().filter((t) => !t.onlyWhenAnchored || e === t.id);
1783
1791
  }
1784
- function Nt(e) {
1792
+ function Lt(e) {
1785
1793
  return {
1786
1794
  buildContext(e) {
1787
1795
  return {
1788
- cliCatalog: le(Mt(e.scopedSubagentId)),
1796
+ cliCatalog: le(It(e.scopedSubagentId)),
1789
1797
  handoff: { current: null },
1790
1798
  collected: {}
1791
1799
  };
1792
1800
  },
1793
1801
  buildPrompt({ userGoal: e, pageContext: t }, { cliCatalog: n }) {
1794
- return At(e, n, t);
1802
+ return Pt(e, n, t);
1795
1803
  },
1796
1804
  buildFollowUpPrompt(e, t, { cliCatalog: n }) {
1797
- return `${e}\n\n${kt()}\n\n${X().toolsHeading}\n${n}`;
1805
+ return `${e}\n\n${Nt()}\n\n${X().toolsHeading}\n${n}`;
1798
1806
  },
1799
1807
  parseResponse(e, t, n) {
1800
1808
  let r = n.handoff.current;
1801
- return n.handoff.current = null, jt(e, r);
1809
+ return n.handoff.current = null, Ft(e, r);
1802
1810
  },
1803
1811
  fallback() {
1804
1812
  return {
@@ -1814,7 +1822,7 @@ function Nt(e) {
1814
1822
  attachmentsRef: r,
1815
1823
  collected: n.collected,
1816
1824
  proxyFetch: y
1817
- }), a = t.scopedSubagentId ? H(t.scopedSubagentId) : null, o = a ? i.filter((e) => (a.crossAgentToolIds ?? []).includes(e.name)) : i, s = Mt(t.scopedSubagentId).flatMap((t) => t.commands.map((r) => ({
1825
+ }), a = t.scopedSubagentId ? H(t.scopedSubagentId) : null, o = a ? i.filter((e) => (a.crossAgentToolIds ?? []).includes(e.name)) : i, s = It(t.scopedSubagentId).flatMap((t) => t.commands.map((r) => ({
1818
1826
  name: `${t.id}_${r.name}`,
1819
1827
  description: `${t.label}: ${r.summary}`,
1820
1828
  inputSchema: r.inputSchema,
@@ -1838,12 +1846,12 @@ function Nt(e) {
1838
1846
  }
1839
1847
  //#endregion
1840
1848
  //#region src/presentation/deriveHistoryTitle.ts
1841
- function Pt(e, t) {
1849
+ function Rt(e, t) {
1842
1850
  return e.deriveHistoryTitle?.(t) ?? e.label;
1843
1851
  }
1844
1852
  //#endregion
1845
1853
  //#region src/presentation/ResultDestinationPicker.tsx
1846
- function Ft({ manifest: e, result: t, meta: n, taskId: r, initiallyApplied: i, onApplied: a, extraDestinations: o }) {
1854
+ function zt({ manifest: e, result: t, meta: n, taskId: r, initiallyApplied: i, onApplied: a, extraDestinations: o }) {
1847
1855
  let s = Q(), c = $(), l = c.scope, u = C(), [d, f] = j(null), [p, m] = j(new Set(i ?? [])), [h, g] = j(null), v = be(), y = /* @__PURE__ */ new Map();
1848
1856
  e.destinationIds.forEach((e) => {
1849
1857
  let t = v[e];
@@ -1861,7 +1869,7 @@ function Ft({ manifest: e, result: t, meta: n, taskId: r, initiallyApplied: i, o
1861
1869
  storageProvider: l?.storageProvider ?? null,
1862
1870
  proxyFetch: u
1863
1871
  }, n);
1864
- m((e) => new Set(e).add(i)), a?.(i), d?.id && c.commitEntityChat(e.id, d.id, r, l?.id, n, Pt(e, n));
1872
+ m((e) => new Set(e).add(i)), a?.(i), d?.id && c.commitEntityChat(e.id, d.id, r, l?.id, n, Rt(e, n));
1865
1873
  } catch (e) {
1866
1874
  g(e instanceof Error ? e.message : String(e));
1867
1875
  } finally {
@@ -1894,16 +1902,16 @@ function Ft({ manifest: e, result: t, meta: n, taskId: r, initiallyApplied: i, o
1894
1902
  }
1895
1903
  //#endregion
1896
1904
  //#region src/presentation/reports/subagentReportRegistry.tsx
1897
- var It = {};
1898
- function Lt(e) {
1899
- Object.assign(It, e);
1905
+ var Bt = {};
1906
+ function Vt(e) {
1907
+ Object.assign(Bt, e);
1900
1908
  }
1901
- function Rt(e) {
1902
- return It[e];
1909
+ function Ht(e) {
1910
+ return Bt[e];
1903
1911
  }
1904
1912
  //#endregion
1905
1913
  //#region src/presentation/reports/GenericResultPreview.tsx
1906
- function zt({ result: e }) {
1914
+ function Ut({ result: e }) {
1907
1915
  let [t, n] = j(!1);
1908
1916
  return /* @__PURE__ */ P("div", {
1909
1917
  className: `relative cursor-pointer rounded-md border border-border/60 ${t ? "max-h-80 overflow-y-auto" : "max-h-28 overflow-hidden"}`,
@@ -1920,7 +1928,7 @@ function zt({ result: e }) {
1920
1928
  }
1921
1929
  //#endregion
1922
1930
  //#region src/presentation/liveAnchorDestination.ts
1923
- function Bt(e, t, n) {
1931
+ function Wt(e, t, n) {
1924
1932
  return e.length === 0 ? null : {
1925
1933
  id: "live-component",
1926
1934
  label: "Applica al componente aperto",
@@ -1931,38 +1939,38 @@ function Bt(e, t, n) {
1931
1939
  }
1932
1940
  //#endregion
1933
1941
  //#region src/presentation/subagentControls.ts
1934
- var Vt = {};
1935
- function Ht(e) {
1936
- Object.assign(Vt, e);
1942
+ var Gt = {};
1943
+ function Kt(e) {
1944
+ Object.assign(Gt, e);
1937
1945
  }
1938
- function Ut(e) {
1939
- return Vt[e];
1946
+ function qt(e) {
1947
+ return Gt[e];
1940
1948
  }
1941
1949
  //#endregion
1942
1950
  //#region src/presentation/chatTitles.ts
1943
- function Wt(e, t = 6e3) {
1944
- let n = e.filter((e) => (e.kind === "user" || e.kind === "thinking") && e.detail?.trim()).map((e) => `${e.kind === "user" ? "Person" : "Agent"}: ${e.detail.trim()}`).join("\n\n");
1951
+ function Jt(e, t = 6e3) {
1952
+ let n = e.filter((e) => (e.kind === "user" || e.kind === "thinking") && e.detail?.trim() && !ze(e)).map((e) => `${e.kind === "user" ? "Person" : "Agent"}: ${e.detail.trim()}`).join("\n\n");
1945
1953
  return n.length > t ? `${n.slice(0, t * .7)}\n\n[…]\n\n${n.slice(-t * .3)}` : n;
1946
1954
  }
1947
- function Gt(e) {
1955
+ function Yt(e) {
1948
1956
  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);
1949
1957
  }
1950
- function Kt(e, t) {
1958
+ function Xt(e, t) {
1951
1959
  try {
1952
1960
  return e.definition.executor?.catalogProviders?.(e.toParams(t));
1953
1961
  } catch {
1954
1962
  return;
1955
1963
  }
1956
1964
  }
1957
- function qt(e, t, n, r, i) {
1958
- let a = Kt(e, t), o = (e) => {
1965
+ function Zt(e, t, n, r, i) {
1966
+ let a = Xt(e, t), o = (e) => {
1959
1967
  let t = e ? v(e) : null;
1960
1968
  return !(!t || !i[t.provider] || a && !a.includes(t.provider));
1961
1969
  };
1962
1970
  return o(n) ? n : Object.values(r).flat().map((e) => e.id).find(o);
1963
1971
  }
1964
- function Jt(e) {
1965
- let t = b()?.registry ?? {}, { modelsByProvider: n, selectedModel: r } = xt(), i = A({
1972
+ function Qt(e) {
1973
+ let t = b()?.registry ?? {}, { modelsByProvider: n, selectedModel: r } = Tt(), i = A({
1966
1974
  registry: t,
1967
1975
  modelsByProvider: n,
1968
1976
  selectedModel: r
@@ -1974,18 +1982,18 @@ function Jt(e) {
1974
1982
  };
1975
1983
  let a = A(/* @__PURE__ */ new Set()), o = T(async (t, n, r) => {
1976
1984
  if (!e) return !1;
1977
- let o = ke(e, t, n), s = H(t), c = `${e}:${t}:${n}`;
1978
- if (!o || !s?.autoTitle || o.name || !Me(o) || a.current.has(c)) return !1;
1979
- let { registry: l, modelsByProvider: u, selectedModel: d } = i.current, f = qt(s, o.params, r ?? d, u, l), p = f ? v(f) : null;
1985
+ let o = Me(e, t, n), s = H(t), c = `${e}:${t}:${n}`;
1986
+ if (!o || !s?.autoTitle || o.name || !Re(o) || a.current.has(c)) return !1;
1987
+ let { registry: l, modelsByProvider: u, selectedModel: d } = i.current, f = Zt(s, o.params, r ?? d, u, l), p = f ? v(f) : null;
1980
1988
  if (!p) return !1;
1981
1989
  a.current.add(c);
1982
1990
  try {
1983
1991
  let r = await l[p.provider].complete({
1984
- prompt: X().chatTitle.replace("{chat}", Wt(o.activity)),
1992
+ prompt: X().chatTitle.replace("{chat}", Jt(o.activity)),
1985
1993
  model: p.model,
1986
1994
  history: []
1987
- }), i = r && r.type === "text" ? Gt(r.text) : "";
1988
- return i ? Ne(e, t, n, i, "model") : !1;
1995
+ }), i = r && r.type === "text" ? Yt(r.text) : "";
1996
+ return i ? Be(e, t, n, i, "model") : !1;
1989
1997
  } catch {
1990
1998
  return !1;
1991
1999
  } finally {
@@ -1993,12 +2001,12 @@ function Jt(e) {
1993
2001
  }
1994
2002
  }, [e]), s = Object.keys(n).length > 0;
1995
2003
  return D(() => {
1996
- e && s && !Yt.has(e) && (Yt.add(e), (async () => {
1997
- for (let t of Ie(e)) {
2004
+ e && s && !$t.has(e) && ($t.add(e), (async () => {
2005
+ for (let t of Ue(e)) {
1998
2006
  let n = H(t.subagentId);
1999
2007
  if (n?.autoTitle) {
2000
- if (n.definition.conversational && !Me(t)) {
2001
- Fe(e, t.subagentId, t.entityId);
2008
+ if (n.definition.conversational && !Re(t)) {
2009
+ He(e, t.subagentId, t.entityId);
2002
2010
  continue;
2003
2011
  }
2004
2012
  t.name || await o(t.subagentId, t.entityId);
@@ -2011,15 +2019,15 @@ function Jt(e) {
2011
2019
  o
2012
2020
  ]), o;
2013
2021
  }
2014
- var Yt = /* @__PURE__ */ new Set(), Xt = () => ({});
2015
- function Zt({ manifest: e, params: t, extraDestinations: n, precedingActivity: r, taskId: i, resumeSeed: a, model: o, openingMessage: s }) {
2016
- let c = Ot(e.definition, { defaultEnabled: !0 }), l = $(), u = l.scope, d = C(), f = A(i ?? `subagent-${e.id}-${crypto.randomUUID()}`).current, [p, m] = j(null), h = (t) => {
2022
+ var $t = /* @__PURE__ */ new Set(), en = () => ({});
2023
+ function tn({ manifest: e, params: t, extraDestinations: n, precedingActivity: r, taskId: i, resumeSeed: a, model: o, openingMessage: s }) {
2024
+ let c = Mt(e.definition, { defaultEnabled: !0 }), l = $(), u = l.scope, d = C(), f = A(i ?? `subagent-${e.id}-${crypto.randomUUID()}`).current, [p, m] = j(null), h = (t) => {
2017
2025
  e.definition.conversational || m(t);
2018
- }, [g, _] = j([]), [v, y] = j(null), b = Rt(e.id), x = b?.kind === "selection" ? b : null, [S, w] = j(null), T = A(!1), E = A(0), O = A(null);
2026
+ }, [g, _] = j([]), [v, y] = j(null), b = Ht(e.id), x = b?.kind === "selection" ? b : null, [S, w] = j(null), T = A(!1), E = A(0), O = A(null);
2019
2027
  p && p !== O.current && (O.current = p, E.current = (r?.length ?? 0) + c.activity.length);
2020
2028
  let F = A(!1), ee = c.remote || !c.hasProviders || c.selectedModel !== "";
2021
2029
  D(() => {
2022
- !T.current && ee && (T.current = !0, a ? c.resume(e.toParams(t), a) : (o && c.setSelectedModel(o), c.run(e.toParams(t), {
2030
+ !T.current && ee && (T.current = !0, a ? (W.current = !0, c.resume(e.toParams(t), a)) : (o && c.setSelectedModel(o), c.run(e.toParams(t), {
2023
2031
  model: o,
2024
2032
  openingMessage: s
2025
2033
  }).then((e) => {
@@ -2039,7 +2047,7 @@ function Zt({ manifest: e, params: t, extraDestinations: n, precedingActivity: r
2039
2047
  ...t,
2040
2048
  pinnedEntityId: r
2041
2049
  }).then((n) => {
2042
- n?.id && l.commitEntityChat(e.id, n.id, f, u.id, t, Pt(e, t));
2050
+ n?.id && l.commitEntityChat(e.id, n.id, f, u.id, t, Rt(e, t));
2043
2051
  }).catch((e) => y(e instanceof Error ? e.message : String(e))));
2044
2052
  });
2045
2053
  }, [
@@ -2058,51 +2066,55 @@ function Zt({ manifest: e, params: t, extraDestinations: n, precedingActivity: r
2058
2066
  p,
2059
2067
  x,
2060
2068
  S
2061
- ]), z = k(() => l.componentAnchors.filter((t) => t.subagentId === e.id && t.onResult), [l.componentAnchors, e.id]), B = k(() => Bt(z, t, f), [
2069
+ ]), z = k(() => l.componentAnchors.filter((t) => t.subagentId === e.id && t.onResult), [l.componentAnchors, e.id]), B = k(() => Wt(z, t, f), [
2062
2070
  z,
2063
2071
  t,
2064
2072
  f
2065
- ]), te = k(() => B ? [B, ...n ?? []] : n, [B, n]), V = e.chatEntityId?.(t), H = Jt(u?.id), U = A(!1);
2073
+ ]), te = k(() => B ? [B, ...n ?? []] : n, [B, n]), V = e.chatEntityId?.(t), H = Qt(u?.id), U = A(!1), W = A(!1);
2066
2074
  D(() => {
2067
2075
  let n = U.current && !c.running;
2068
2076
  if (U.current = c.running, !n || !V || !u) return;
2077
+ if (W.current) {
2078
+ W.current = !1;
2079
+ return;
2080
+ }
2069
2081
  let i = c.snapshot();
2070
2082
  if (!i) return;
2071
2083
  let a = [...r ?? [], ...i.activity];
2072
- e.autoTitle && e.definition.conversational && !Me({ activity: a }) || (Ae({
2084
+ e.autoTitle && e.definition.conversational && !Re({ activity: a }) || (Ne({
2073
2085
  scopeId: u.id,
2074
2086
  subagentId: e.id,
2075
2087
  entityId: V,
2076
2088
  params: t,
2077
- title: Pt(e, t),
2089
+ title: Rt(e, t),
2078
2090
  history: i.history,
2079
2091
  activity: a
2080
2092
  }), e.autoTitle && H(e.id, V, c.selectedModel));
2081
2093
  }, [c.running]);
2082
- let W = () => {
2094
+ let G = () => {
2083
2095
  F.current = !0, c.running && c.stop(), l.closeTask(f);
2084
- }, G = A(Ut(e.id) ?? Xt).current, K = G({
2096
+ }, K = A(qt(e.id) ?? en).current, q = K({
2085
2097
  params: t,
2086
2098
  taskId: f,
2087
2099
  running: c.running,
2088
- close: W
2089
- }), q = (e) => {
2100
+ close: G
2101
+ }), ne = (e) => {
2090
2102
  _((t) => t.includes(e) ? t : [...t, e]);
2091
2103
  };
2092
2104
  return D(() => {
2093
2105
  F.current || l.openTask({
2094
2106
  id: f,
2095
- title: Pt(e, t),
2107
+ title: Rt(e, t),
2096
2108
  icon: e.icon,
2097
2109
  agent: c,
2098
2110
  onApplied: (e) => h(e),
2099
2111
  precedingActivity: r,
2100
2112
  panelExtraAnchorIndex: E.current,
2101
- onDismiss: W,
2113
+ onDismiss: G,
2102
2114
  ...V ? { savedToDisk: !0 } : {},
2103
- panelActions: K.content,
2104
- composerActions: K.actions,
2105
- composerCommands: K.commands,
2115
+ panelActions: q.content,
2116
+ composerActions: q.actions,
2117
+ composerCommands: q.commands,
2106
2118
  panelExtra: p ? /* @__PURE__ */ P(M, { children: [
2107
2119
  x && S ? /* @__PURE__ */ N(x.Report, {
2108
2120
  result: p,
@@ -2111,18 +2123,18 @@ function Zt({ manifest: e, params: t, extraDestinations: n, precedingActivity: r
2111
2123
  }) : b?.kind === "editable" ? /* @__PURE__ */ N(b.Report, {
2112
2124
  result: p,
2113
2125
  onResultChange: L
2114
- }) : /* @__PURE__ */ N(zt, { result: R }),
2126
+ }) : /* @__PURE__ */ N(Ut, { result: R }),
2115
2127
  v && /* @__PURE__ */ P("p", {
2116
2128
  className: "text-xs text-destructive",
2117
2129
  children: ["Salvataggio automatico non riuscito: ", v]
2118
2130
  }),
2119
- /* @__PURE__ */ N(Ft, {
2131
+ /* @__PURE__ */ N(zt, {
2120
2132
  manifest: e,
2121
2133
  result: R,
2122
2134
  meta: t,
2123
2135
  taskId: f,
2124
2136
  initiallyApplied: g,
2125
- onApplied: q,
2137
+ onApplied: ne,
2126
2138
  extraDestinations: te
2127
2139
  })
2128
2140
  ] }) : void 0
@@ -2148,23 +2160,23 @@ function Zt({ manifest: e, params: t, extraDestinations: n, precedingActivity: r
2148
2160
  n,
2149
2161
  r,
2150
2162
  v,
2151
- K.content,
2152
- K.actions,
2153
- K.commands
2163
+ q.content,
2164
+ q.actions,
2165
+ q.commands
2154
2166
  ]), D(() => () => {
2155
2167
  l.closeTask(f);
2156
2168
  }, [l.closeTask, f]), null;
2157
2169
  }
2158
2170
  //#endregion
2159
2171
  //#region src/presentation/OrchestratorRunner.tsx
2160
- function Qt({ userGoal: e }) {
2161
- let t = Q(), n = Ot(k(() => Nt({
2172
+ function nn({ userGoal: e }) {
2173
+ let t = Q(), n = Mt(k(() => Lt({
2162
2174
  unavailable: t.orchestratorUnavailable,
2163
2175
  continueWithoutAi: t.orchestratorContinueWithoutAi,
2164
2176
  preparing: t.orchestratorPreparing,
2165
2177
  collecting: t.orchestratorCollecting
2166
2178
  }), []), { defaultEnabled: !0 }), r = $(), [i, a] = j(null), o = A(!1), s = !n.hasProviders || n.selectedModel !== "", c = A(r.pendingExtraDestinations), l = A(r.pendingAttachments), u = A(r.pendingModel), d = A(r.pendingScopedSubagentId ?? r.scopedSubagentId ?? void 0), f = A(r.pendingCarryOver), p = A(!1), m = (e) => {
2167
- e && typeof e == "object" && e.kind === "handoff" && (a(e), r.closeTask(He));
2179
+ e && typeof e == "object" && e.kind === "handoff" && (a(e), r.closeTask(Ke));
2168
2180
  };
2169
2181
  D(() => {
2170
2182
  !o.current && s && (o.current = !0, u.current && n.setSelectedModel(u.current), n.run({
@@ -2180,7 +2192,7 @@ function Qt({ userGoal: e }) {
2180
2192
  }));
2181
2193
  }, [s]), D(() => {
2182
2194
  p.current || r.openTask({
2183
- id: He,
2195
+ id: Ke,
2184
2196
  title: "Agentico",
2185
2197
  icon: "bot",
2186
2198
  agent: n,
@@ -2188,7 +2200,7 @@ function Qt({ userGoal: e }) {
2188
2200
  scopedSubagentId: d.current,
2189
2201
  precedingActivity: f.current?.activity,
2190
2202
  onDismiss: () => {
2191
- p.current = !0, n.running && n.stop(), r.closeTask(He);
2203
+ p.current = !0, n.running && n.stop(), r.closeTask(Ke);
2192
2204
  }
2193
2205
  });
2194
2206
  }, [
@@ -2201,12 +2213,12 @@ function Qt({ userGoal: e }) {
2201
2213
  n.hasProviders,
2202
2214
  r.openTask
2203
2215
  ]), D(() => () => {
2204
- r.closeTask(He);
2216
+ r.closeTask(Ke);
2205
2217
  }, [r.closeTask]);
2206
2218
  let h = k(() => [...f.current?.activity ?? [], ...n.activity], [n.activity]);
2207
2219
  if (!i) return null;
2208
2220
  let g = H(i.subagentId);
2209
- return g ? /* @__PURE__ */ N(Zt, {
2221
+ return g ? /* @__PURE__ */ N(tn, {
2210
2222
  manifest: g,
2211
2223
  params: i.params,
2212
2224
  extraDestinations: c.current,
@@ -2217,8 +2229,8 @@ function Qt({ userGoal: e }) {
2217
2229
  }
2218
2230
  //#endregion
2219
2231
  //#region src/presentation/ManualEntryRunner.tsx
2220
- function $t({ manifest: e, extraDestinations: n }) {
2221
- let r = Ot(e.definition, { defaultEnabled: !1 }), i = Q(), a = $(), o = A(`manual-${e.id}-${crypto.randomUUID()}`).current, [s, c] = j(null), [l, u] = j([]), d = Rt(e.id), f = d?.kind === "selection" ? d : null, [p, m] = j(null), [h, g] = j(null), _ = A(!1), v = (t) => {
2232
+ function rn({ manifest: e, extraDestinations: n }) {
2233
+ let r = Mt(e.definition, { defaultEnabled: !1 }), i = Q(), a = $(), o = A(`manual-${e.id}-${crypto.randomUUID()}`).current, [s, c] = j(null), [l, u] = j([]), d = Ht(e.id), f = d?.kind === "selection" ? d : null, [p, m] = j(null), [h, g] = j(null), _ = A(!1), v = (t) => {
2222
2234
  if (!e.manualEntry) return;
2223
2235
  let n;
2224
2236
  try {
@@ -2245,7 +2257,7 @@ function $t({ manifest: e, extraDestinations: n }) {
2245
2257
  p
2246
2258
  ]), S = (e) => {
2247
2259
  u((t) => t.includes(e) ? t : [...t, e]);
2248
- }, C = k(() => a.componentAnchors.filter((t) => t.subagentId === e.id && t.onResult), [a.componentAnchors, e.id]), w = k(() => h ? Bt(C, h, o) : null, [
2260
+ }, C = k(() => a.componentAnchors.filter((t) => t.subagentId === e.id && t.onResult), [a.componentAnchors, e.id]), w = k(() => h ? Wt(C, h, o) : null, [
2249
2261
  C,
2250
2262
  h,
2251
2263
  o
@@ -2274,8 +2286,8 @@ function $t({ manifest: e, extraDestinations: n }) {
2274
2286
  }) : d?.kind === "editable" ? /* @__PURE__ */ N(d.Report, {
2275
2287
  result: s,
2276
2288
  onResultChange: b
2277
- }) : /* @__PURE__ */ N(zt, { result: x }),
2278
- /* @__PURE__ */ N(Ft, {
2289
+ }) : /* @__PURE__ */ N(Ut, { result: x }),
2290
+ /* @__PURE__ */ N(zt, {
2279
2291
  manifest: e,
2280
2292
  result: x,
2281
2293
  meta: h ?? {},
@@ -2312,7 +2324,7 @@ function $t({ manifest: e, extraDestinations: n }) {
2312
2324
  }
2313
2325
  //#endregion
2314
2326
  //#region src/presentation/Agentico.tsx
2315
- function en(e, t) {
2327
+ function an(e, t) {
2316
2328
  return Object.values(e).flat().map((e) => {
2317
2329
  let n = t?.(e.provider, e.providerLabel ?? e.provider);
2318
2330
  return {
@@ -2324,7 +2336,7 @@ function en(e, t) {
2324
2336
  };
2325
2337
  });
2326
2338
  }
2327
- function tn({ task: e }) {
2339
+ function on({ task: e }) {
2328
2340
  let t = Q(), [n, r] = j(""), { agent: i, onApplied: a, manualEntry: s } = e, c = i.running, l = (e) => {
2329
2341
  if (r(""), s) {
2330
2342
  s.onSubmit(e.text);
@@ -2336,7 +2348,7 @@ function tn({ task: e }) {
2336
2348
  }).then((e) => {
2337
2349
  e && a(e);
2338
2350
  });
2339
- }, u = !!s || i.remote && i.remoteModels.length === 0, d = i.alongside && i.remoteModels.some((e) => e.value === i.selectedModel), f = !u && !i.remote && !d && i.hasProviders && !i.selectedModel, p = u ? [] : i.remote ? i.remoteModels : i.alongside ? [...i.remoteModels, ...en(i.modelsByProvider, i.catalogGroup)] : en(i.modelsByProvider);
2351
+ }, u = !!s || i.remote && i.remoteModels.length === 0, d = i.alongside && i.remoteModels.some((e) => e.value === i.selectedModel), f = !u && !i.remote && !d && i.hasProviders && !i.selectedModel, p = u ? [] : i.remote ? i.remoteModels : i.alongside ? [...i.remoteModels, ...an(i.modelsByProvider, i.catalogGroup)] : an(i.modelsByProvider);
2340
2352
  return /* @__PURE__ */ N(o, {
2341
2353
  value: n,
2342
2354
  onChange: r,
@@ -2356,8 +2368,8 @@ function tn({ task: e }) {
2356
2368
  maxHeight: 220
2357
2369
  });
2358
2370
  }
2359
- function nn() {
2360
- let { startOrchestrator: e } = $(), t = Q(), [n, r] = j(""), { hasProviders: i, modelsByProvider: a, selectedModel: s, setSelectedModel: c } = xt(), l = (t) => {
2371
+ function sn() {
2372
+ let { startOrchestrator: e } = $(), t = Q(), [n, r] = j(""), { hasProviders: i, modelsByProvider: a, selectedModel: s, setSelectedModel: c } = Tt(), l = (t) => {
2361
2373
  t.text.trim() && (e(t.text.trim(), {
2362
2374
  attachments: t.files.length > 0 ? t.files : void 0,
2363
2375
  model: t.model || void 0
@@ -2370,7 +2382,7 @@ function nn() {
2370
2382
  disabled: !n.trim() || u,
2371
2383
  onSubmit: l,
2372
2384
  attachments: !0,
2373
- models: en(a),
2385
+ models: an(a),
2374
2386
  selectedModel: s,
2375
2387
  onModelChange: c,
2376
2388
  modelPlaceholder: t.selectModelPlaceholder,
@@ -2378,17 +2390,17 @@ function nn() {
2378
2390
  maxHeight: 220
2379
2391
  });
2380
2392
  }
2381
- function rn({ chat: e, onClose: t }) {
2393
+ function cn({ chat: e, onClose: t }) {
2382
2394
  let n = Q(), r = x();
2383
2395
  return /* @__PURE__ */ N(p, {
2384
2396
  title: n.renameChat,
2385
2397
  size: "sm",
2386
2398
  onClose: t,
2387
- onSave: () => (Ne(e.scopeId, e.subagentId, e.entityId, String(r.record?.title ?? je(e)), "person"), t(), Promise.resolve(!0)),
2399
+ onSave: () => (Be(e.scopeId, e.subagentId, e.entityId, String(r.record?.title ?? Le(e)), "person"), t(), Promise.resolve(!0)),
2388
2400
  children: /* @__PURE__ */ P(u, {
2389
2401
  appearance: "empty",
2390
2402
  controller: r,
2391
- defaultValues: { title: je(e) },
2403
+ defaultValues: { title: Le(e) },
2392
2404
  footer: !1,
2393
2405
  children: [/* @__PURE__ */ N(f, {
2394
2406
  name: "title",
@@ -2401,7 +2413,7 @@ function rn({ chat: e, onClose: t }) {
2401
2413
  })
2402
2414
  });
2403
2415
  }
2404
- function an(e, t, n = Date.now()) {
2416
+ function ln(e, t, n = Date.now()) {
2405
2417
  let r = Math.round((e - n) / 1e3), i = new Intl.RelativeTimeFormat(t, {
2406
2418
  numeric: "auto",
2407
2419
  style: "short"
@@ -2413,7 +2425,7 @@ function an(e, t, n = Date.now()) {
2413
2425
  ]) if (Math.abs(r) >= t) return i.format(Math.round(r / t), e);
2414
2426
  return i.format(0, "minute");
2415
2427
  }
2416
- function on({ card: e }) {
2428
+ function un({ card: e }) {
2417
2429
  let t = Q();
2418
2430
  return e.humanSummaryOnly ? /* @__PURE__ */ P("div", {
2419
2431
  className: "space-y-2 rounded-lg border border-border/60 p-3",
@@ -2469,7 +2481,7 @@ function on({ card: e }) {
2469
2481
  ]
2470
2482
  });
2471
2483
  }
2472
- function sn({ messages: e }) {
2484
+ function dn({ messages: e }) {
2473
2485
  return /* @__PURE__ */ N("div", {
2474
2486
  className: "space-y-2 rounded-lg border border-border/60 p-3",
2475
2487
  children: e.map((e, t) => /* @__PURE__ */ N("p", {
@@ -2478,10 +2490,10 @@ function sn({ messages: e }) {
2478
2490
  }, t))
2479
2491
  });
2480
2492
  }
2481
- function cn({ scopeId: e, currentTaskId: n, open: r, onOpenChange: i, onSelect: a, onNewChat: o, onArchivedCurrent: s }) {
2493
+ function fn({ scopeId: e, currentTaskId: n, open: r, onOpenChange: i, onSelect: a, onNewChat: o, onArchivedCurrent: s }) {
2482
2494
  let u = Q(), { locale: f } = S(), [p, m] = j(""), [h, g] = j(0);
2483
- D(() => Ee(() => g((e) => e + 1)), []);
2484
- let _ = k(() => r ? Ie(e) : [], [
2495
+ D(() => ke(() => g((e) => e + 1)), []);
2496
+ let _ = k(() => r ? Ue(e) : [], [
2485
2497
  e,
2486
2498
  r,
2487
2499
  h
@@ -2493,13 +2505,13 @@ function cn({ scopeId: e, currentTaskId: n, open: r, onOpenChange: i, onSelect:
2493
2505
  } catch {
2494
2506
  return;
2495
2507
  }
2496
- Fe(e, t.subagentId, t.entityId), n === Le(t.subagentId, t.entityId) && s(), g((e) => e + 1);
2508
+ He(e, t.subagentId, t.entityId), n === We(t.subagentId, t.entityId) && s(), g((e) => e + 1);
2497
2509
  }
2498
2510
  }, x = k(() => {
2499
2511
  let e = p.trim().toLowerCase();
2500
2512
  return e ? _.filter((t) => {
2501
2513
  let n = H(t.subagentId)?.label ?? t.subagentId;
2502
- return je(t).toLowerCase().includes(e) || n.toLowerCase().includes(e);
2514
+ return Le(t).toLowerCase().includes(e) || n.toLowerCase().includes(e);
2503
2515
  }) : _;
2504
2516
  }, [_, p]);
2505
2517
  return /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N(c, {
@@ -2542,10 +2554,10 @@ function cn({ scopeId: e, currentTaskId: n, open: r, onOpenChange: i, onSelect:
2542
2554
  className: "px-2 py-3 text-center text-xs text-muted-foreground",
2543
2555
  children: _.length === 0 ? u.noSavedChats : u.noResults
2544
2556
  }) : x.map((e) => {
2545
- let t = H(e.subagentId), r = n === Le(e.subagentId, e.entityId);
2557
+ let t = H(e.subagentId), r = n === We(e.subagentId, e.entityId);
2546
2558
  return /* @__PURE__ */ N(l, {
2547
2559
  icon: r ? "check" : t?.icon ?? "bot",
2548
- className: r ? "bg-accent font-medium" : void 0,
2560
+ className: r ? "bg-accent font-semibold text-primary" : void 0,
2549
2561
  actions: [{
2550
2562
  icon: "pencil",
2551
2563
  label: u.renameChat,
@@ -2560,33 +2572,27 @@ function cn({ scopeId: e, currentTaskId: n, open: r, onOpenChange: i, onSelect:
2560
2572
  onClick: () => a(e.subagentId, e.entityId, e),
2561
2573
  children: /* @__PURE__ */ P("span", {
2562
2574
  className: "flex min-w-0 flex-1 items-center justify-between gap-2",
2563
- children: [/* @__PURE__ */ P("span", {
2575
+ children: [/* @__PURE__ */ N("span", {
2564
2576
  className: "min-w-0 truncate",
2565
- children: [
2566
- /* @__PURE__ */ N("span", {
2567
- className: "text-muted-foreground",
2568
- children: t?.label ?? e.subagentId
2569
- }),
2570
- " · ",
2571
- je(e)
2572
- ]
2577
+ title: `${t?.label ?? e.subagentId} · ${Le(e)}`,
2578
+ children: Le(e)
2573
2579
  }), /* @__PURE__ */ N("span", {
2574
2580
  className: "shrink-0 text-xs text-muted-foreground",
2575
- title: `${u.chatStarted.replace("{at}", new Date(Pe(e)).toLocaleString(f))} · ${u.chatLastMessage.replace("{at}", new Date(e.savedAt).toLocaleString(f))}`,
2576
- children: an(Pe(e), f)
2581
+ title: `${u.chatStarted.replace("{at}", new Date(Ve(e)).toLocaleString(f))} · ${u.chatLastMessage.replace("{at}", new Date(e.savedAt).toLocaleString(f))}`,
2582
+ children: ln(Ve(e), f)
2577
2583
  })]
2578
2584
  })
2579
2585
  }, `${e.subagentId}:${e.entityId}`);
2580
2586
  })
2581
- }), v && /* @__PURE__ */ N(rn, {
2587
+ }), v && /* @__PURE__ */ N(cn, {
2582
2588
  chat: v,
2583
2589
  onClose: () => y(null)
2584
2590
  })] });
2585
2591
  }
2586
- function ln({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}) {
2592
+ function pn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}) {
2587
2593
  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: v, pendingExtraDestinations: y, pendingResumeWithAI: b, resumeWithAIRunId: x, pendingStart: S, startRunId: C, scope: w } = $(), T = Q(), E = A(null), [O, k] = j(!1);
2588
- Jt(w?.id);
2589
- let F = ht({
2594
+ Qt(w?.id);
2595
+ let F = yt({
2590
2596
  defaultWidth: e,
2591
2597
  minWidth: n,
2592
2598
  maxWidth: r,
@@ -2598,7 +2604,7 @@ function ln({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
2598
2604
  onAnswer: (e, t, n) => a.agent.answerQuestions(e, t, n).then((e) => {
2599
2605
  e && a.onApplied(e);
2600
2606
  })
2601
- } : void 0, W = U ? tt(I, U.canAnswer) : null, G = a?.id === "agentico-orchestrator" && a.scopedSubagentId ? H(a.scopedSubagentId) : void 0, K = G?.manualEntry ? G : null, q = A(!0);
2607
+ } : void 0, W = U ? at(I, U.canAnswer) : null, G = a?.id === "agentico-orchestrator" && a.scopedSubagentId ? H(a.scopedSubagentId) : void 0, K = G?.manualEntry ? G : null, q = A(!0);
2602
2608
  D(() => {
2603
2609
  let e = E.current;
2604
2610
  if (!e) return;
@@ -2628,22 +2634,22 @@ function ln({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
2628
2634
  });
2629
2635
  return n.observe(t), () => n.disconnect();
2630
2636
  }, [a?.id, o]);
2631
- let Y = s ? /* @__PURE__ */ N(Qt, { userGoal: s }, c) : null, re = f ? H(f.subagentId) : void 0, ie = f && re ? /* @__PURE__ */ N(Zt, {
2637
+ let Y = s ? /* @__PURE__ */ N(nn, { userGoal: s }, c) : null, re = f ? H(f.subagentId) : void 0, ie = f && re ? /* @__PURE__ */ N(tn, {
2632
2638
  manifest: re,
2633
2639
  params: f.snapshot.params,
2634
- taskId: Le(f.subagentId, f.entityId),
2640
+ taskId: We(f.subagentId, f.entityId),
2635
2641
  resumeSeed: {
2636
2642
  history: f.snapshot.history,
2637
2643
  activity: f.snapshot.activity
2638
2644
  }
2639
- }, p) : null, X = g ? H(g.subagentId) : void 0, ae = g && X ? /* @__PURE__ */ N($t, {
2645
+ }, p) : null, X = g ? H(g.subagentId) : void 0, ae = g && X ? /* @__PURE__ */ N(rn, {
2640
2646
  manifest: X,
2641
2647
  extraDestinations: g.extraDestinations
2642
- }, _) : null, oe = b ? H(b.subagentId) : void 0, se = b && oe ? /* @__PURE__ */ N(Zt, {
2648
+ }, _) : null, oe = b ? H(b.subagentId) : void 0, se = b && oe ? /* @__PURE__ */ N(tn, {
2643
2649
  manifest: oe,
2644
2650
  params: b.params,
2645
2651
  extraDestinations: b.extraDestinations
2646
- }, x) : null, Z = S ? H(S.subagentId) : void 0, ce = S && Z ? /* @__PURE__ */ N(Zt, {
2652
+ }, x) : null, Z = S ? H(S.subagentId) : void 0, ce = S && Z ? /* @__PURE__ */ N(tn, {
2647
2653
  manifest: Z,
2648
2654
  params: S.params,
2649
2655
  taskId: S.taskId,
@@ -2659,7 +2665,7 @@ function ln({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
2659
2665
  style: { width: F.width },
2660
2666
  className: "relative flex h-full shrink-0 flex-col border-l border-border bg-background",
2661
2667
  children: [
2662
- /* @__PURE__ */ N(gt, {
2668
+ /* @__PURE__ */ N(bt, {
2663
2669
  width: F.width,
2664
2670
  min: F.min,
2665
2671
  max: F.max,
@@ -2674,7 +2680,7 @@ function ln({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
2674
2680
  className: "min-w-0 flex-1 truncate text-lg font-semibold leading-tight",
2675
2681
  children: a ? a.title : "Agentico"
2676
2682
  }),
2677
- w && /* @__PURE__ */ N(cn, {
2683
+ w && /* @__PURE__ */ N(fn, {
2678
2684
  scopeId: w.id,
2679
2685
  currentTaskId: a?.id ?? null,
2680
2686
  open: O,
@@ -2683,7 +2689,7 @@ function ln({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
2683
2689
  onSelect: (e, t, n) => h(e, t, n),
2684
2690
  onArchivedCurrent: m
2685
2691
  }),
2686
- /* @__PURE__ */ N(_t, {})
2692
+ /* @__PURE__ */ N(xt, {})
2687
2693
  ]
2688
2694
  }),
2689
2695
  /* @__PURE__ */ N("div", {
@@ -2697,7 +2703,7 @@ function ln({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
2697
2703
  className: "text-xs text-muted-foreground",
2698
2704
  children: a.manualEntry.prompt
2699
2705
  }),
2700
- /* @__PURE__ */ N(at, {
2706
+ /* @__PURE__ */ N(lt, {
2701
2707
  activity: z,
2702
2708
  questions: U,
2703
2709
  docked: W,
@@ -2707,7 +2713,7 @@ function ln({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
2707
2713
  className: "mt-3",
2708
2714
  children: a.panelExtra
2709
2715
  }),
2710
- B.length > 0 && /* @__PURE__ */ N(at, {
2716
+ B.length > 0 && /* @__PURE__ */ N(lt, {
2711
2717
  activity: B,
2712
2718
  questions: U,
2713
2719
  docked: W,
@@ -2725,7 +2731,7 @@ function ln({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
2725
2731
  variant: "secondary",
2726
2732
  className: "shrink-0",
2727
2733
  onClick: () => {
2728
- a.agent.sendMessage(T.retryMessage).then((e) => {
2734
+ a.agent.sendMessage(T.retryMessage, { retry: !0 }).then((e) => {
2729
2735
  e && a.onApplied(e);
2730
2736
  });
2731
2737
  }
@@ -2745,7 +2751,7 @@ function ln({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
2745
2751
  })
2746
2752
  ]
2747
2753
  })
2748
- ] }) : d.length > 0 ? /* @__PURE__ */ N(sn, { messages: d }) : u ? /* @__PURE__ */ N(on, { card: u }) : /* @__PURE__ */ N("p", {
2754
+ ] }) : d.length > 0 ? /* @__PURE__ */ N(dn, { messages: d }) : u ? /* @__PURE__ */ N(un, { card: u }) : /* @__PURE__ */ N("p", {
2749
2755
  className: "text-xs text-muted-foreground",
2750
2756
  children: l ?? T.orchestratorStarterHint
2751
2757
  })
@@ -2761,7 +2767,7 @@ function ln({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
2761
2767
  }),
2762
2768
  /* @__PURE__ */ N("div", {
2763
2769
  className: "min-h-0 overflow-y-auto px-4 py-3",
2764
- children: /* @__PURE__ */ N(nt, {
2770
+ children: /* @__PURE__ */ N(ot, {
2765
2771
  entry: W.entry,
2766
2772
  part: W.part,
2767
2773
  questions: U,
@@ -2783,7 +2789,7 @@ function ln({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
2783
2789
  children: [a?.panelActions && /* @__PURE__ */ N("div", {
2784
2790
  className: "mb-2",
2785
2791
  children: a.panelActions
2786
- }), a ? /* @__PURE__ */ N(tn, { task: a }, a.id) : /* @__PURE__ */ N(nn, {})]
2792
+ }), a ? /* @__PURE__ */ N(on, { task: a }, a.id) : /* @__PURE__ */ N(sn, {})]
2787
2793
  })
2788
2794
  ]
2789
2795
  })
@@ -2797,13 +2803,13 @@ function ln({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
2797
2803
  }
2798
2804
  //#endregion
2799
2805
  //#region src/presentation/useAgenticoPageContext.ts
2800
- function un(e, t) {
2806
+ function mn(e, t) {
2801
2807
  let { setPageContext: n } = $(), r = A(crypto.randomUUID()).current;
2802
2808
  D(() => (n(r, e, t ?? null), () => n(r, null)), [e, t]);
2803
2809
  }
2804
2810
  //#endregion
2805
2811
  //#region src/presentation/useSubagentComponentContext.ts
2806
- function dn(e, t, n, r, i = !0, a) {
2812
+ function hn(e, t, n, r, i = !0, a) {
2807
2813
  let { registerComponentAnchor: o } = $(), s = A(crypto.randomUUID()).current, c = A(n);
2808
2814
  c.current = n, D(() => {
2809
2815
  if (i) return o(s, {
@@ -2822,6 +2828,6 @@ function dn(e, t, n, r, i = !0, a) {
2822
2828
  ]);
2823
2829
  }
2824
2830
  //#endregion
2825
- export { ct as AGENTICO_MAX_WIDTH, st as AGENTICO_MIN_WIDTH, ot as AGENTICO_WIDTH, lt as AGENTICO_WIDTH_STORAGE_KEY, ln as Agentico, We as AgenticoProvider, _t as AgenticoToggle, ee as DEFAULT_REASONING_PART_ID, F as DEFAULT_TEXT_PART_ID, ge as JSON_EXPORT_DESTINATION_ID, de as MICRO_PROMPT_REGISTRY, He as ORCHESTRATOR_TASK_ID, ue as SUMMARY_MICRO_PROMPT, Re as agenticoDe, ze as agenticoEn, Be as agenticoIt, J as agenticoPromptsEn, Y as agenticoPromptsIt, Ve as agenticoTranslations, fe as applyMicroPrompts, Me as chatHasPersonMessage, Pe as chatStartedAt, je as chatTitle, ie as configureAgenticoPrompts, Se as configureEntityChatStore, G as createCrossAgentTools, z as defineSubagent, Le as entityChatTaskId, pe as extractErrorMessage, me as extractJsonBlock, H as findSubagentManifest, R as formatQuestionAnswers, X as getAgenticoPrompts, be as getDestinationRegistry, ke as getEntityChat, Ut as getSubagentControls, V as getSubagentRegistry, Rt as getSubagentReport, _e as jsonExportDestination, Ie as listEntityChats, L as messagePartsText, Ee as onEntityChatsChange, W as registerCrossAgentTools, ye as registerDestinations, Ht as registerSubagentControls, Lt as registerSubagentReports, te as registerSubagents, Fe as removeEntityChat, Ne as renameEntityChat, le as renderRegistryCli, ce as renderSubagentCli, ae as resetAgenticoPrompts, Ae as saveEntityChat, K as toJsonSchema, q as toMcpTool, I as upsertMessagePart, Ot as useAgent, $ as useAgentico, Q as useAgenticoI18n, un as useAgenticoPageContext, dn as useSubagentComponentContext };
2831
+ export { ft as AGENTICO_MAX_WIDTH, dt as AGENTICO_MIN_WIDTH, ut as AGENTICO_WIDTH, pt as AGENTICO_WIDTH_STORAGE_KEY, pn as Agentico, Je as AgenticoProvider, xt as AgenticoToggle, ee as DEFAULT_REASONING_PART_ID, F as DEFAULT_TEXT_PART_ID, ge as JSON_EXPORT_DESTINATION_ID, de as MICRO_PROMPT_REGISTRY, Ke as ORCHESTRATOR_TASK_ID, ue as SUMMARY_MICRO_PROMPT, Ce as agenticoDe, xe as agenticoEn, Se as agenticoIt, J as agenticoPromptsEn, Y as agenticoPromptsIt, Ge as agenticoTranslations, fe as applyMicroPrompts, Re as chatHasPersonMessage, Ve as chatStartedAt, Le as chatTitle, ie as configureAgenticoPrompts, Te as configureEntityChatStore, G as createCrossAgentTools, z as defineSubagent, We as entityChatTaskId, pe as extractErrorMessage, me as extractJsonBlock, H as findSubagentManifest, R as formatQuestionAnswers, X as getAgenticoPrompts, be as getDestinationRegistry, Me as getEntityChat, qt as getSubagentControls, V as getSubagentRegistry, Ht as getSubagentReport, _e as jsonExportDestination, Ue as listEntityChats, L as messagePartsText, ke as onEntityChatsChange, W as registerCrossAgentTools, ye as registerDestinations, Kt as registerSubagentControls, Vt as registerSubagentReports, te as registerSubagents, He as removeEntityChat, Be as renameEntityChat, le as renderRegistryCli, ce as renderSubagentCli, ae as resetAgenticoPrompts, Ne as saveEntityChat, K as toJsonSchema, q as toMcpTool, I as upsertMessagePart, Mt as useAgent, $ as useAgentico, Q as useAgenticoI18n, mn as useAgenticoPageContext, hn as useSubagentComponentContext };
2826
2832
 
2827
2833
  //# sourceMappingURL=index.mjs.map