@llmnative/agentico 0.11.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,10 +1,10 @@
1
1
  import { zodToJsonSchema as e } from "zod-to-json-schema";
2
2
  import { ActionButton as t, Badge as n, ChatMarkdown as r, ChatQuestions as i, ChatReasoning as a, Chatbot as o, Code as s, Dropdown as c, DropdownItem as l, Form as u, Icon as d, Input as f, Modal as p, PromptUtils as m, Tree as h, getAIModelCatalog as g, interpolate as _, parseAIModelRef as v, proxyFetch as y, useAIProviderRegistry as b, useFormController as x, useI18n as S, useProxy as C } from "@llmnative/react";
3
3
  import { createContext as w, useCallback as T, useContext as E, useEffect as D, useLayoutEffect as O, useMemo as k, useRef as A, useState as j } from "react";
4
- import { Fragment as M, jsx as N, jsxs as P } from "react/jsx-runtime";
4
+ import { Fragment as ee, jsx as M, jsxs as N } from "react/jsx-runtime";
5
5
  //#region src/domain/messageParts.ts
6
- var F = "text", ee = "reasoning";
7
- function I(e, t, n) {
6
+ var P = "text", te = "reasoning";
7
+ function F(e, t, n) {
8
8
  let r = e.findIndex((e) => e.type === t.type && e.id === t.id);
9
9
  if (r >= 0) return e.map((e, n) => n === r ? t : e);
10
10
  let i = t.type === "reasoning" || !n ? e : e.map((e) => e.type === "reasoning" && e.streaming ? n(e) : e), a = i.findIndex((e) => e.type === "text" && e.id === "text");
@@ -14,59 +14,59 @@ function I(e, t, n) {
14
14
  ...i.slice(a)
15
15
  ] : [...i, t];
16
16
  }
17
- function L(e) {
17
+ function ne(e) {
18
18
  return e.filter((e) => e.type === "text").map((e) => e.text).filter(Boolean).join("\n\n");
19
19
  }
20
- function R(e, t) {
20
+ function I(e, t) {
21
21
  return t.map((t, n) => `${t.header ?? e[n]?.header ?? e[n]?.question ?? t.id ?? `${n + 1}`}: ${t.values.join(", ")}`).join("\n");
22
22
  }
23
23
  //#endregion
24
24
  //#region src/domain/defineSubagent.ts
25
- function z(e) {
25
+ function re(e) {
26
26
  return e;
27
27
  }
28
28
  //#endregion
29
29
  //#region src/domain/subagentRegistry.ts
30
- var B = [];
31
- function te(e) {
32
- B = e;
30
+ var L = [];
31
+ function ie(e) {
32
+ L = e;
33
33
  }
34
- function V() {
35
- return B.length === 0 && typeof console < "u" && console.warn("[agentico] getSubagentRegistry() letto a registro vuoto — registerSubagents() non è ancora stato chiamato?"), B;
34
+ function R() {
35
+ return L.length === 0 && typeof console < "u" && console.warn("[agentico] getSubagentRegistry() letto a registro vuoto — registerSubagents() non è ancora stato chiamato?"), L;
36
36
  }
37
- function H(e) {
38
- return B.find((t) => t.id === e);
37
+ function z(e) {
38
+ return L.find((t) => t.id === e);
39
39
  }
40
40
  //#endregion
41
41
  //#region src/domain/crossAgentTools.ts
42
- var U = [];
43
- function W(...e) {
44
- U = e;
42
+ var B = [];
43
+ function V(...e) {
44
+ B = e;
45
45
  }
46
- function G(e) {
47
- return U.flatMap((t) => t(e));
46
+ function H(e) {
47
+ return B.flatMap((t) => t(e));
48
48
  }
49
49
  //#endregion
50
50
  //#region src/domain/mcpTool.ts
51
- function K(t) {
51
+ function U(t) {
52
52
  let { $schema: n, ...r } = e(t, {
53
53
  target: "jsonSchema7",
54
54
  $refStrategy: "none"
55
55
  });
56
56
  return r;
57
57
  }
58
- function q(e, t, n, r) {
58
+ function W(e, t, n, r) {
59
59
  return {
60
60
  name: e,
61
61
  description: t,
62
- inputSchema: K(n),
63
- ...r ? { outputSchema: K(r) } : {}
62
+ inputSchema: U(n),
63
+ ...r ? { outputSchema: U(r) } : {}
64
64
  };
65
65
  }
66
66
  //#endregion
67
67
  //#region src/domain/subagentUsageCard.ts
68
- function ne(e) {
69
- let t = K(e.inputSchema), n = t.properties ?? {}, r = new Set(t.required ?? []);
68
+ function ae(e) {
69
+ let t = U(e.inputSchema), n = t.properties ?? {}, r = new Set(t.required ?? []);
70
70
  return Object.entries(n).map(([t, n]) => {
71
71
  let i = typeof n.description == "string" ? n.description : "";
72
72
  return {
@@ -80,7 +80,7 @@ function ne(e) {
80
80
  }
81
81
  //#endregion
82
82
  //#region src/domain/prompts.ts
83
- var J = {
83
+ var oe = {
84
84
  orchestratorIntro: "You are Agentico, the orchestrator of this application's tools. Your job is to understand what the user wants to achieve and, once every required parameter is collected, start the right tool among those listed below — do not carry it out yourself \"in words\", invoke it as a tool.",
85
85
  responseRules: [
86
86
  "BEFORE asking for any parameter, check the \"Page context\" below (if present): if a parameter required by the command is already there or can be deduced from it with reasonable certainty, USE it directly — do not ask the user again. Only ask for parameters that cannot be derived from the context.",
@@ -110,7 +110,7 @@ var J = {
110
110
  ].join(" "),
111
111
  multipleCandidates: "Several subagents are candidates on this page — ask the user which one they mean if their message does not make it clear, before going on.",
112
112
  chatTitle: "Write a title for this chat, as a list of chats shows it: 3 to 6 words saying what it is about, in the language the person writes in. Answer with the title only: no quotes, no final period.\n\n{chat}"
113
- }, Y = {
113
+ }, G = {
114
114
  orchestratorIntro: "Sei Agentico, l'orchestratore dei tool di questa applicazione. Il tuo compito è capire cosa vuole ottenere l'utente e, una volta raccolti tutti i parametri necessari, avviare il tool giusto tra quelli elencati sotto — non eseguirlo tu stesso \"a parole\", invocalo come strumento.",
115
115
  responseRules: [
116
116
  "PRIMA di chiedere qualunque parametro, controlla il \"Contesto pagina\" (se presente) qui sotto: se un parametro richiesto dal comando è già lì o si può dedurre da lì con ragionevole certezza (es. l'utente sta guardando lo storico di un tool specifico, o un'esecuzione passata con parametri simili), USALO direttamente — non chiederlo di nuovo all'utente. Chiedi solo i parametri che NON emergono in nessun modo dal contesto.",
@@ -140,26 +140,26 @@ var J = {
140
140
  ].join(" "),
141
141
  multipleCandidates: "Più subagent sono candidati su questa pagina — chiedi all'utente quale intende se non è chiaro dal suo messaggio, prima di procedere.",
142
142
  chatTitle: "Scrivi un titolo per questa chat, come lo mostra un elenco di chat: da 3 a 6 parole che dicono di cosa parla, nella lingua in cui scrive la persona. Rispondi solo con il titolo: niente virgolette, niente punto finale.\n\n{chat}"
143
- }, re = J;
144
- function ie(e) {
145
- re = {
146
- ...re,
143
+ }, se = oe;
144
+ function ce(e) {
145
+ se = {
146
+ ...se,
147
147
  ...e
148
148
  };
149
149
  }
150
- function X() {
151
- return re;
150
+ function K() {
151
+ return se;
152
152
  }
153
- function ae() {
154
- re = J;
153
+ function le() {
154
+ se = oe;
155
155
  }
156
156
  //#endregion
157
157
  //#region src/domain/cli/renderManifestCli.ts
158
- function oe(e, t) {
158
+ function ue(e, t) {
159
159
  return `${e} ${t.map((e) => e.required ? `--${e.key} <${e.type}>` : `[--${e.key} <${e.type}>]`).join(" ")}`.trim();
160
160
  }
161
- function se(e, t) {
162
- let n = ne(t), r = oe(t.name, n), i = n.map((e) => ` --${e.key} <${e.type}> (${e.required ? "required" : "optional"})${e.description ? ` — ${e.description}` : ""}`);
161
+ function q(e, t) {
162
+ let n = ae(t), r = ue(t.name, n), i = n.map((e) => ` --${e.key} <${e.type}> (${e.required ? "required" : "optional"})${e.description ? ` — ${e.description}` : ""}`);
163
163
  return [
164
164
  `COMMAND: ${e} ${t.name}`,
165
165
  ` ${t.summary}`,
@@ -171,46 +171,46 @@ function se(e, t) {
171
171
  ...i,
172
172
  "",
173
173
  " OUTPUT",
174
- Z(t.describeOutput(), 4),
174
+ J(t.describeOutput(), 4),
175
175
  (t.example, ""),
176
176
  t.example ? " EXAMPLE" : "",
177
177
  t.example ? ` ${t.example}` : ""
178
178
  ].filter((e) => e !== "").join("\n");
179
179
  }
180
- function Z(e, t) {
180
+ function J(e, t) {
181
181
  let n = " ".repeat(t);
182
182
  return e.split("\n").map((e) => e && n + e).join("\n");
183
183
  }
184
- function ce(e) {
184
+ function de(e) {
185
185
  return [
186
186
  "NAME",
187
187
  ` ${e.id} — ${e.label}`,
188
188
  "",
189
189
  "DESCRIPTION",
190
- Z(e.description, 2),
190
+ J(e.description, 2),
191
191
  "",
192
- ...e.commands.map((t) => se(e.id, t))
192
+ ...e.commands.map((t) => q(e.id, t))
193
193
  ].join("\n");
194
194
  }
195
- function le(e) {
196
- return e.length === 0 ? X().noToolsAvailable : e.map((e) => `${e.id} [${e.commands.map((e) => e.name).join("|")}] — ${e.label}: ${e.commands.map((e) => e.summary).join(" / ")}`).join("\n");
195
+ function Y(e) {
196
+ return e.length === 0 ? K().noToolsAvailable : e.map((e) => `${e.id} [${e.commands.map((e) => e.name).join("|")}] — ${e.label}: ${e.commands.map((e) => e.summary).join(" / ")}`).join("\n");
197
197
  }
198
198
  //#endregion
199
199
  //#region src/domain/microPrompts.ts
200
- var ue = {
200
+ var fe = {
201
201
  id: "closing-summary",
202
202
  get text() {
203
- return X().closingSummary;
203
+ return K().closingSummary;
204
204
  }
205
- }, de = { [ue.id]: ue };
206
- function fe(e, t) {
205
+ }, pe = { [fe.id]: fe };
206
+ function me(e, t) {
207
207
  if (!t || t.length === 0) return e;
208
- let n = t.map((e) => de[e]?.text).filter((e) => !!e);
208
+ let n = t.map((e) => pe[e]?.text).filter((e) => !!e);
209
209
  return n.length === 0 ? e : `${e}\n\n${n.join("\n")}`;
210
210
  }
211
211
  //#endregion
212
212
  //#region src/domain/extractErrorMessage.ts
213
- function pe(e) {
213
+ function X(e) {
214
214
  if (e instanceof Error) return e.message;
215
215
  if (typeof e == "object" && e) {
216
216
  let t = e;
@@ -229,13 +229,13 @@ function pe(e) {
229
229
  }
230
230
  //#endregion
231
231
  //#region src/domain/extractJsonBlock.ts
232
- function me(e) {
232
+ function he(e) {
233
233
  let t = e.match(/```(?:json)?\s*\n?([\s\S]*?)```/i);
234
234
  if (t) return t[1].trim();
235
235
  let n = e.replace(/^```json\s*/i, "").replace(/^```\s*/i, "").replace(/```\s*$/, "").trim();
236
- return he(n) ?? n;
236
+ return ge(n) ?? n;
237
237
  }
238
- function he(e) {
238
+ function ge(e) {
239
239
  let t = e.search(/[{[]/);
240
240
  if (t === -1) return null;
241
241
  let n = e[t], r = n === "{" ? "}" : "]", i = 0, a = !1, o = !1;
@@ -256,8 +256,8 @@ function he(e) {
256
256
  }
257
257
  //#endregion
258
258
  //#region src/domain/jsonExportDestination.ts
259
- var ge = "json-export", _e = {
260
- id: ge,
259
+ var _e = "json-export", ve = {
260
+ id: _e,
261
261
  label: "Export as JSON",
262
262
  async apply(e) {
263
263
  let t = new Blob([JSON.stringify(e, null, 2)], { type: "application/json" }), n = URL.createObjectURL(t);
@@ -268,19 +268,19 @@ var ge = "json-export", _e = {
268
268
  URL.revokeObjectURL(n);
269
269
  }
270
270
  }
271
- }, ve = {};
272
- function ye(e) {
273
- ve = e;
271
+ }, ye = {};
272
+ function be(e) {
273
+ ye = e;
274
274
  }
275
- function be() {
275
+ function xe() {
276
276
  return {
277
- [_e.id]: _e,
278
- ...ve
277
+ [ve.id]: ve,
278
+ ...ye
279
279
  };
280
280
  }
281
281
  //#endregion
282
282
  //#region src/i18n/en.ts
283
- var xe = {
283
+ var Se = {
284
284
  modelLabel: "Model",
285
285
  modelsLoading: "Loading…",
286
286
  noModelsAvailable: "No models available",
@@ -341,7 +341,7 @@ var xe = {
341
341
  resizePanelHint: "Drag to resize, double-click to reset",
342
342
  pendingQuestions: "Questions of the agent",
343
343
  stop: "Stop"
344
- }, Se = {
344
+ }, Ce = {
345
345
  modelLabel: "Modello",
346
346
  modelsLoading: "Caricamento…",
347
347
  noModelsAvailable: "Nessun modello disponibile",
@@ -402,7 +402,7 @@ var xe = {
402
402
  resizePanelHint: "Trascina per ridimensionare, doppio clic per ripristinare",
403
403
  pendingQuestions: "Domande dell'agente",
404
404
  stop: "Ferma"
405
- }, Ce = {
405
+ }, we = {
406
406
  modelLabel: "Modell",
407
407
  modelsLoading: "Wird geladen…",
408
408
  noModelsAvailable: "Keine Modelle verfügbar",
@@ -463,11 +463,39 @@ var xe = {
463
463
  resizePanelHint: "Ziehen zum Ändern der Größe, Doppelklick zum Zurücksetzen",
464
464
  pendingQuestions: "Fragen des Agenten",
465
465
  stop: "Stoppen"
466
- }, we = "llmnative.agentico.entityChat";
467
- function Te(e) {
468
- we = e.storageKey;
466
+ }, Te = "llmnative.agentico.entityChat", Ee;
467
+ function De(e) {
468
+ Te = e.storageKey, Ee = e.backend;
469
+ }
470
+ var Oe = () => !!Ee, ke = ({ synced: e, ...t }) => t;
471
+ function Ae(e) {
472
+ if (!Ee) return;
473
+ let t = Z(e.scopeId, e.subagentId, e.entityId);
474
+ Promise.resolve(Ee.save(ke(e))).then(() => {
475
+ let e = Ne(), n = e.find((e) => Z(e.scopeId, e.subagentId, e.entityId) === t);
476
+ n && !n.synced && Ie(e.map((e) => e === n ? {
477
+ ...e,
478
+ synced: !0
479
+ } : e));
480
+ }, () => void 0);
469
481
  }
470
- function Ee(e) {
482
+ async function je(e) {
483
+ if (!Ee) return;
484
+ let t = (await Ee.load(e)).map(Me).filter((t) => t !== null && t.scopeId === e), n = (e) => e.changedAt ?? e.savedAt, r = Ne(), i = r.filter((t) => t.scopeId !== e), a = r.filter((t) => t.scopeId === e), o = t.map((e) => {
485
+ let t = a.find((t) => Z(t.scopeId, t.subagentId, t.entityId) === Z(e.scopeId, e.subagentId, e.entityId));
486
+ return t && n(t) > n(e) ? (Ae(t), t) : {
487
+ ...e,
488
+ synced: !0
489
+ };
490
+ }), s = a.filter((e) => !e.synced && !t.some((t) => Z(t.scopeId, t.subagentId, t.entityId) === Z(e.scopeId, e.subagentId, e.entityId)));
491
+ Ie([
492
+ ...i,
493
+ ...o,
494
+ ...s
495
+ ]);
496
+ for (let e of s) Ae(e);
497
+ }
498
+ function Me(e) {
471
499
  if (!e || typeof e != "object") return null;
472
500
  let t = e;
473
501
  if (typeof t.entityId != "string") return null;
@@ -479,92 +507,102 @@ function Ee(e) {
479
507
  scopeId: n
480
508
  };
481
509
  }
482
- function De() {
510
+ function Ne() {
483
511
  try {
484
- let e = localStorage.getItem(we);
512
+ let e = localStorage.getItem(Te);
485
513
  if (!e) return [];
486
514
  let t = JSON.parse(e);
487
- return Array.isArray(t) ? t.map(Ee).filter((e) => e !== null) : [];
515
+ return Array.isArray(t) ? t.map(Me).filter((e) => e !== null) : [];
488
516
  } catch {
489
517
  return [];
490
518
  }
491
519
  }
492
- var Oe = /* @__PURE__ */ new Set();
493
- function ke(e) {
494
- return Oe.add(e), () => {
495
- Oe.delete(e);
520
+ var Pe = /* @__PURE__ */ new Set();
521
+ function Fe(e) {
522
+ return Pe.add(e), () => {
523
+ Pe.delete(e);
496
524
  };
497
525
  }
498
- function Ae(e) {
526
+ function Ie(e) {
499
527
  try {
500
- localStorage.setItem(we, JSON.stringify(e));
528
+ localStorage.setItem(Te, JSON.stringify(e));
501
529
  } catch {}
502
- for (let e of [...Oe]) e();
530
+ for (let e of [...Pe]) e();
503
531
  }
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;
532
+ var Z = (e, t, n) => `${e}:${t}:${n}`;
533
+ function Le(e, t, n) {
534
+ let r = Z(e, t, n);
535
+ return Ne().find((e) => Z(e.scopeId, e.subagentId, e.entityId) === r) ?? null;
508
536
  }
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({
537
+ function Re(e) {
538
+ let t = Z(e.scopeId, e.subagentId, e.entityId), n = Ne(), r = n.find((e) => Z(e.scopeId, e.subagentId, e.entityId) === t), i = Date.now(), a = n.filter((e) => e !== r), o = {
512
539
  ...e,
513
540
  savedAt: i,
514
- startedAt: r ? Ve(r) : i,
541
+ changedAt: i,
542
+ startedAt: r ? Ke(r) : i,
515
543
  ...r?.name ? {
516
544
  name: r.name,
517
545
  namedBy: r.namedBy
518
- } : {}
519
- }), Ae(a);
546
+ } : {},
547
+ ...r?.synced ? { synced: !0 } : {}
548
+ };
549
+ a.push(o), Ie(a), Ae(o);
520
550
  }
521
- var Pe = new Set([
522
- xe,
551
+ var ze = new Set([
523
552
  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();
553
+ Ce,
554
+ we
555
+ ].map((e) => e.retryMessage.trim().toLowerCase())), Be = (e) => e.kind === "user" && !!e.detail?.trim() && !e.retry && !ze.has(e.detail.trim().toLowerCase()), Ve = (e) => {
556
+ let t = (e.activity.find(Be)?.detail ?? "").trim().split("\n")[0].trim();
527
557
  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);
558
+ }, He = (e) => e.name || Ve(e) || e.title || e.entityId, Ue = (e) => e.activity.some(Be), We = (e) => e.kind === "user" && !Be(e) && !!e.detail?.trim();
559
+ function Ge(e, t, n, r, i = "person") {
560
+ let a = Z(e, t, n), o = Ne(), s = o.find((e) => Z(e.scopeId, e.subagentId, e.entityId) === a);
531
561
  if (!s || i === "model" && s.namedBy === "person") return !1;
532
562
  let c = r.trim().replace(/\s+/g, " ").slice(0, 120), { name: l, namedBy: u, ...d } = s, f = c ? {
533
563
  ...d,
534
564
  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 }
565
+ namedBy: i,
566
+ changedAt: Date.now()
567
+ } : {
568
+ ...d,
569
+ changedAt: Date.now()
570
+ };
571
+ return Ie(o.map((e) => e === s ? f : e)), Ae(f), !0;
572
+ }
573
+ var Ke = (e) => e.startedAt ?? e.savedAt;
574
+ function qe(e, t, n) {
575
+ let r = Z(e, t, n);
576
+ Ie(Ne().filter((e) => Z(e.scopeId, e.subagentId, e.entityId) !== r)), Ee && Promise.resolve(Ee.remove(e, t, n)).catch(() => void 0);
577
+ }
578
+ function Je(e) {
579
+ return Ne().filter((t) => t.scopeId === e).sort((e, t) => Ke(t) - Ke(e));
580
+ }
581
+ var Ye = (e, t) => `entitychat-${e}-${t}`, Xe = {
582
+ en: { agentico: Se },
583
+ it: { agentico: Ce },
584
+ de: { agentico: we }
551
585
  };
552
586
  function Q() {
553
587
  let { dict: e } = S(), t = e.agentico;
554
588
  return t ? {
555
- ...xe,
589
+ ...Se,
556
590
  ...t
557
- } : xe;
591
+ } : Se;
558
592
  }
559
593
  //#endregion
560
594
  //#region src/presentation/AgenticoContext.tsx
561
- var Ke = "agentico-orchestrator", qe = w(null);
562
- function Je({ children: e, scope: t = null }) {
595
+ var Ze = "agentico-orchestrator", Qe = w(null);
596
+ function $e({ children: e, scope: t = null }) {
563
597
  let [n, r] = j(null), i = A(null);
564
598
  D(() => {
565
599
  i.current = n;
566
600
  }, [n]);
567
- let [a, o] = j(!1), s = T((e) => {
601
+ let [a, o] = j(!1), s = t?.id;
602
+ D(() => {
603
+ s && je(s).catch(() => void 0);
604
+ }, [s]);
605
+ let c = T((e) => {
568
606
  let t = i.current;
569
607
  t && t.id !== e.id && t.onDismiss();
570
608
  let n = t && t.id === e.id && t.savedToDisk && e.savedToDisk === void 0 ? {
@@ -572,10 +610,10 @@ function Je({ children: e, scope: t = null }) {
572
610
  savedToDisk: !0
573
611
  } : e;
574
612
  r(n);
575
- }, []), c = T((e) => {
613
+ }, []), l = T((e) => {
576
614
  r((t) => t && t.id === e ? null : t);
577
- }, []), l = T(() => o((e) => !e), []), u = T(() => o(!0), []), [d, f] = j(null), [p, m] = j(void 0), [h, g] = j(void 0), [_, v] = j(void 0), [y, b] = j(null), [x, S] = j(null), [C, w] = j(void 0), [E, O] = j([]), M = T((e, t, n = null) => {
578
- O((r) => {
615
+ }, []), u = T(() => o((e) => !e), []), d = T(() => o(!0), []), [f, p] = j(null), [m, h] = j(void 0), [g, _] = j(void 0), [v, y] = j(void 0), [b, x] = j(null), [S, C] = j(null), [w, E] = j(void 0), [O, ee] = j([]), N = T((e, t, n = null) => {
616
+ ee((r) => {
579
617
  let i = r.filter((t) => t.id !== e);
580
618
  return t ? [...i, {
581
619
  id: e,
@@ -583,30 +621,30 @@ function Je({ children: e, scope: t = null }) {
583
621
  card: n
584
622
  }] : i;
585
623
  });
586
- }, []), P = E.length > 0 ? E[E.length - 1] : null, [F, ee] = j([]), I = T((e, t) => {
587
- ee((n) => {
624
+ }, []), P = O.length > 0 ? O[O.length - 1] : null, [te, F] = j([]), ne = T((e, t) => {
625
+ F((n) => {
588
626
  let r = n.filter((t) => t.id !== e);
589
627
  return t ? [...r, {
590
628
  id: e,
591
629
  ...t
592
630
  }] : r;
593
631
  });
594
- }, []), L = k(() => F.map((e) => ({
632
+ }, []), I = k(() => te.map((e) => ({
595
633
  subagentId: e.subagentId,
596
634
  componentKey: e.componentKey,
597
635
  onResult: e.onResult,
598
636
  pinnedEntityId: e.pinnedEntityId
599
- })), [F]), R = k(() => {
637
+ })), [te]), re = k(() => {
600
638
  let e = /* @__PURE__ */ new Map();
601
- for (let t of F) e.set(t.subagentId, {
639
+ for (let t of te) e.set(t.subagentId, {
602
640
  subagentId: t.subagentId,
603
641
  componentKey: t.componentKey,
604
642
  onResult: t.onResult,
605
643
  contextInfo: t.contextInfo
606
644
  });
607
645
  return [...e.values()];
608
- }, [F]), z = k(() => R.map((e) => {
609
- let t = H(e.subagentId)?.componentContexts?.[e.componentKey];
646
+ }, [te]), L = k(() => re.map((e) => {
647
+ let t = z(e.subagentId)?.componentContexts?.[e.componentKey];
610
648
  if (!t) return null;
611
649
  let n = e.contextInfo ? `${t.agenticoHint}\n${e.contextInfo}` : t.agenticoHint;
612
650
  return {
@@ -614,26 +652,26 @@ function Je({ children: e, scope: t = null }) {
614
652
  agenticoHint: n,
615
653
  userMessage: t.userMessage
616
654
  };
617
- }).filter((e) => e !== null), [R]), B = k(() => z.map((e) => e.userMessage), [z]), te = k(() => {
618
- if (z.length === 0) return null;
619
- if (z.length === 1) return z[0].agenticoHint;
620
- let e = z.map((e, t) => `${t + 1}. ${e.agenticoHint}`).join("\n");
621
- return `${X().multipleCandidates}\n\n${e}`;
622
- }, [z]) ?? P?.text ?? null, V = z.length > 0 ? null : P?.card ?? null, U = k(() => [...new Set(L.map((e) => e.subagentId))], [L]), W = U.length === 1 ? U[0] : U.length === 0 ? P?.card?.subagentId ?? null : null, G = T((e, t) => {
623
- u();
655
+ }).filter((e) => e !== null), [re]), ie = k(() => L.map((e) => e.userMessage), [L]), R = k(() => {
656
+ if (L.length === 0) return null;
657
+ if (L.length === 1) return L[0].agenticoHint;
658
+ let e = L.map((e, t) => `${t + 1}. ${e.agenticoHint}`).join("\n");
659
+ return `${K().multipleCandidates}\n\n${e}`;
660
+ }, [L]) ?? P?.text ?? null, B = L.length > 0 ? null : P?.card ?? null, V = k(() => [...new Set(I.map((e) => e.subagentId))], [I]), H = V.length === 1 ? V[0] : V.length === 0 ? P?.card?.subagentId ?? null : null, U = T((e, t) => {
661
+ d();
624
662
  let n = i.current;
625
663
  if (n?.id === "agentico-orchestrator") return;
626
- let r = W && n?.id.startsWith(`subagent-${W}-`) ? n : void 0;
627
- S(r ? {
664
+ let r = H && n?.id.startsWith(`subagent-${H}-`) ? n : void 0;
665
+ C(r ? {
628
666
  taskId: r.id,
629
667
  activity: [...r.precedingActivity ?? [], ...r.agent.activity]
630
- } : null), f(e), m(t?.extraDestinations), g(t?.attachments), v(t?.model), w(t?.scopedSubagentId), b(crypto.randomUUID());
631
- }, [u, W]), K = T((e, t, n, a, o, s) => {
668
+ } : null), p(e), h(t?.extraDestinations), _(t?.attachments), y(t?.model), E(t?.scopedSubagentId), x(crypto.randomUUID());
669
+ }, [d, H]), W = T((e, t, n, a, o, s) => {
632
670
  if (!n || !a) return;
633
671
  let c = i.current;
634
672
  if (!c || c.id !== n) return;
635
673
  let l = c.agent.snapshot();
636
- l && (Ne({
674
+ l && (Re({
637
675
  scopeId: a,
638
676
  subagentId: e,
639
677
  entityId: t,
@@ -645,120 +683,120 @@ function Je({ children: e, scope: t = null }) {
645
683
  ...e,
646
684
  savedToDisk: !0
647
685
  } : e));
648
- }, []), [q, ne] = j(null), [J, Y] = j(null), re = T((e, t, n) => {
649
- u(), ne({
686
+ }, []), [ae, oe] = j(null), [G, se] = j(null), ce = T((e, t, n) => {
687
+ d(), oe({
650
688
  subagentId: e,
651
689
  entityId: t,
652
690
  snapshot: n
653
- }), Y(crypto.randomUUID());
654
- }, [u]), [ie, ae] = j(null), [oe, se] = j(null), Z = T((e, t) => {
655
- u(), c(Ke), ae({
691
+ }), se(crypto.randomUUID());
692
+ }, [d]), [le, ue] = j(null), [q, J] = j(null), de = T((e, t) => {
693
+ d(), l(Ze), ue({
656
694
  subagentId: e,
657
695
  extraDestinations: t
658
- }), se(crypto.randomUUID());
659
- }, [u, c]), [ce, le] = j(null), [ue, de] = j(null), fe = T((e, t, n) => {
660
- ae(null), le({
696
+ }), J(crypto.randomUUID());
697
+ }, [d, l]), [Y, fe] = j(null), [pe, me] = j(null), X = T((e, t, n) => {
698
+ ue(null), fe({
661
699
  subagentId: e,
662
700
  params: t,
663
701
  extraDestinations: n
664
- }), de(crypto.randomUUID());
665
- }, []), [pe, me] = j(null), [he, ge] = j(null), _e = T((e, t, n) => {
666
- u(), me({
702
+ }), me(crypto.randomUUID());
703
+ }, []), [he, ge] = j(null), [_e, ve] = j(null), ye = T((e, t, n) => {
704
+ d(), ge({
667
705
  subagentId: e,
668
706
  params: t,
669
707
  ...n
670
- }), ge(crypto.randomUUID());
671
- }, [u]), ve = T(() => {
708
+ }), ve(crypto.randomUUID());
709
+ }, [d]), be = T(() => {
672
710
  let e = i.current;
673
711
  e && e.onDismiss();
674
- }, []), ye = k(() => ({
712
+ }, []), xe = k(() => ({
675
713
  scope: t,
676
714
  task: n,
677
715
  isOpen: a,
678
- openTask: s,
679
- closeTask: c,
680
- toggleOpen: l,
681
- pendingGoal: d,
682
- startOrchestrator: G,
683
- pageContext: te,
684
- pageContextCard: V,
685
- setPageContext: M,
686
- scopedSubagentId: W,
687
- pendingScopedSubagentId: C,
688
- componentAnchors: L,
689
- anchoredUserMessages: B,
690
- registerComponentAnchor: I,
691
- openPanel: u,
692
- pendingExtraDestinations: p,
693
- pendingAttachments: h,
694
- pendingModel: _,
695
- orchestratorRunId: y,
696
- pendingCarryOver: x,
697
- commitEntityChat: K,
698
- resumeEntityChat: re,
699
- pendingResume: q,
700
- resumeRunId: J,
701
- dismissForeignTask: ve,
702
- pendingManualEntry: ie,
703
- manualEntryRunId: oe,
704
- startManualEntry: Z,
705
- pendingResumeWithAI: ce,
706
- resumeWithAIRunId: ue,
707
- resumeWithAI: fe,
708
- startSubagent: _e,
709
- pendingStart: pe,
710
- startRunId: he
716
+ openTask: c,
717
+ closeTask: l,
718
+ toggleOpen: u,
719
+ pendingGoal: f,
720
+ startOrchestrator: U,
721
+ pageContext: R,
722
+ pageContextCard: B,
723
+ setPageContext: N,
724
+ scopedSubagentId: H,
725
+ pendingScopedSubagentId: w,
726
+ componentAnchors: I,
727
+ anchoredUserMessages: ie,
728
+ registerComponentAnchor: ne,
729
+ openPanel: d,
730
+ pendingExtraDestinations: m,
731
+ pendingAttachments: g,
732
+ pendingModel: v,
733
+ orchestratorRunId: b,
734
+ pendingCarryOver: S,
735
+ commitEntityChat: W,
736
+ resumeEntityChat: ce,
737
+ pendingResume: ae,
738
+ resumeRunId: G,
739
+ dismissForeignTask: be,
740
+ pendingManualEntry: le,
741
+ manualEntryRunId: q,
742
+ startManualEntry: de,
743
+ pendingResumeWithAI: Y,
744
+ resumeWithAIRunId: pe,
745
+ resumeWithAI: X,
746
+ startSubagent: ye,
747
+ pendingStart: he,
748
+ startRunId: _e
711
749
  }), [
712
750
  t,
713
751
  n,
714
752
  a,
715
- s,
716
753
  c,
717
754
  l,
718
- d,
719
- G,
720
- te,
721
- V,
722
- M,
723
- W,
724
- C,
725
- L,
755
+ u,
756
+ f,
757
+ U,
758
+ R,
726
759
  B,
760
+ N,
761
+ H,
762
+ w,
727
763
  I,
728
- u,
729
- p,
730
- h,
731
- _,
732
- y,
733
- x,
734
- K,
735
- re,
736
- q,
737
- J,
738
- ve,
739
764
  ie,
740
- oe,
741
- Z,
765
+ ne,
766
+ d,
767
+ m,
768
+ g,
769
+ v,
770
+ b,
771
+ S,
772
+ W,
742
773
  ce,
743
- ue,
744
- fe,
745
- _e,
774
+ ae,
775
+ G,
776
+ be,
777
+ le,
778
+ q,
779
+ de,
780
+ Y,
746
781
  pe,
747
- he
782
+ X,
783
+ ye,
784
+ he,
785
+ _e
748
786
  ]);
749
- return /* @__PURE__ */ N(qe.Provider, {
750
- value: ye,
787
+ return /* @__PURE__ */ M(Qe.Provider, {
788
+ value: xe,
751
789
  children: e
752
790
  });
753
791
  }
754
792
  function $() {
755
- let e = E(qe);
793
+ let e = E(Qe);
756
794
  if (!e) throw Error("useAgentico must be used inside AgenticoProvider");
757
795
  return e;
758
796
  }
759
797
  //#endregion
760
798
  //#region src/presentation/AgentActivityLog.tsx
761
- function Ye(e) {
799
+ function et(e) {
762
800
  let t = e.search(/[{[]/);
763
801
  if (t === -1) return [{
764
802
  type: "text",
@@ -804,97 +842,97 @@ function Ye(e) {
804
842
  language: "json"
805
843
  });
806
844
  let u = e.slice(s + 1);
807
- return u.trim() && l.push(...Ye(u)), l;
845
+ return u.trim() && l.push(...et(u)), l;
808
846
  }
809
- function Xe(e) {
847
+ function tt(e) {
810
848
  let t = [], n = /```(\w+)?\n?([\s\S]*?)```/g, r = 0, i;
811
- for (; i = n.exec(e);) i.index > r && t.push(...Ye(e.slice(r, i.index))), t.push({
849
+ for (; i = n.exec(e);) i.index > r && t.push(...et(e.slice(r, i.index))), t.push({
812
850
  type: "code",
813
851
  content: i[2].replace(/\n$/, ""),
814
852
  language: i[1]
815
853
  }), r = n.lastIndex;
816
- return r < e.length && t.push(...Ye(e.slice(r))), t;
854
+ return r < e.length && t.push(...et(e.slice(r))), t;
817
855
  }
818
- function Ze({ content: e, language: t }) {
856
+ function nt({ content: e, language: t }) {
819
857
  let [n, r] = j(!1);
820
- return /* @__PURE__ */ P("div", {
858
+ return /* @__PURE__ */ N("div", {
821
859
  className: `relative cursor-pointer rounded-md ${n ? "max-h-80 overflow-y-auto" : "max-h-28 overflow-hidden"}`,
822
860
  onClick: () => r((e) => !e),
823
861
  title: n ? "Clic per comprimere" : "Clic per espandere",
824
- children: [/* @__PURE__ */ N(s, {
862
+ children: [/* @__PURE__ */ M(s, {
825
863
  language: t,
826
864
  showCopy: n,
827
865
  background: "transparent",
828
866
  className: "!text-[11px]",
829
867
  children: e
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" })]
868
+ }), !n && /* @__PURE__ */ M("div", { className: "pointer-events-none absolute inset-x-0 bottom-0 h-6 bg-gradient-to-t from-muted/30 to-transparent" })]
831
869
  });
832
870
  }
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, {
871
+ function rt({ text: e, tone: t }) {
872
+ let n = tt(e);
873
+ return /* @__PURE__ */ M(ee, { children: n.map((e, n) => e.type === "code" ? /* @__PURE__ */ M(nt, {
836
874
  content: e.content,
837
875
  language: e.language
838
- }, n) : e.content.trim() && /* @__PURE__ */ N(r, {
876
+ }, n) : e.content.trim() && /* @__PURE__ */ M(r, {
839
877
  content: e.content.trim(),
840
878
  tone: t,
841
879
  className: "break-words text-xs leading-relaxed"
842
880
  }, n)) });
843
881
  }
844
- function $e({ status: e }) {
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, {
882
+ function it({ status: e }) {
883
+ return e === "running" ? /* @__PURE__ */ M("span", { className: "inline-block h-3 w-3 shrink-0 animate-spin rounded-full border-2 border-current border-t-transparent" }) : e === "done" ? /* @__PURE__ */ M(d, {
846
884
  name: "check",
847
885
  size: 12,
848
886
  className: "shrink-0 text-green-600"
849
- }) : e === "stopped" ? /* @__PURE__ */ N(d, {
887
+ }) : e === "stopped" ? /* @__PURE__ */ M(d, {
850
888
  name: "circle-slash",
851
889
  size: 12,
852
890
  className: "shrink-0 text-muted-foreground"
853
- }) : /* @__PURE__ */ N(d, {
891
+ }) : /* @__PURE__ */ M(d, {
854
892
  name: "x",
855
893
  size: 12,
856
894
  className: "shrink-0 text-destructive"
857
895
  });
858
896
  }
859
- function et(e, t) {
897
+ function at(e, t) {
860
898
  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;
861
899
  }
862
- var tt = 96;
863
- function nt({ entry: e, pinned: t = !0 }) {
900
+ var ot = 96;
901
+ function st({ entry: e, pinned: t = !0 }) {
864
902
  let n = A(null), [r, i] = j(!1), [a, o] = j(!1);
865
903
  O(() => {
866
904
  let e = n.current;
867
905
  e && o(e.scrollHeight > 97);
868
906
  }, [e.detail, e.attachmentNames]);
869
907
  let s = a && !r;
870
- return /* @__PURE__ */ N("div", {
908
+ return /* @__PURE__ */ M("div", {
871
909
  className: `${t ? "sticky top-0 z-20 border-b border-border/40" : ""} flex justify-end bg-background py-1.5`,
872
- children: /* @__PURE__ */ P("div", {
910
+ children: /* @__PURE__ */ N("div", {
873
911
  className: "max-w-[85%] rounded-lg bg-primary/10 text-xs text-foreground",
874
- children: [/* @__PURE__ */ P("div", {
912
+ children: [/* @__PURE__ */ N("div", {
875
913
  ref: n,
876
914
  className: `space-y-1 px-2.5 pt-1.5 ${s ? "overflow-hidden" : ""}`,
877
- style: s ? { maxHeight: tt } : void 0,
878
- children: [e.attachmentNames && e.attachmentNames.length > 0 && /* @__PURE__ */ N("div", {
915
+ style: s ? { maxHeight: ot } : void 0,
916
+ children: [e.attachmentNames && e.attachmentNames.length > 0 && /* @__PURE__ */ M("div", {
879
917
  className: "flex flex-wrap gap-1",
880
- children: e.attachmentNames.map((e, t) => /* @__PURE__ */ P("span", {
918
+ children: e.attachmentNames.map((e, t) => /* @__PURE__ */ N("span", {
881
919
  className: "inline-flex items-center gap-1 rounded-md bg-primary/15 px-1.5 py-0.5 text-[11px] text-foreground",
882
- children: [/* @__PURE__ */ N(d, {
920
+ children: [/* @__PURE__ */ M(d, {
883
921
  name: "paperclip",
884
922
  size: 10,
885
923
  className: "shrink-0"
886
- }), /* @__PURE__ */ N("span", {
924
+ }), /* @__PURE__ */ M("span", {
887
925
  className: "max-w-[160px] truncate",
888
926
  children: e
889
927
  })]
890
928
  }, t))
891
- }), /* @__PURE__ */ N(Qe, { text: e.detail ?? "" })]
892
- }), a && /* @__PURE__ */ P("button", {
929
+ }), /* @__PURE__ */ M(rt, { text: e.detail ?? "" })]
930
+ }), a && /* @__PURE__ */ N("button", {
893
931
  type: "button",
894
932
  onClick: () => i((e) => !e),
895
933
  className: "relative flex w-full items-center justify-center rounded-b-lg py-1 text-muted-foreground hover:bg-primary/15",
896
934
  title: r ? "Comprimi" : "Espandi",
897
- children: [s && /* @__PURE__ */ N("div", { className: "pointer-events-none absolute inset-x-0 -top-4 h-4 bg-gradient-to-t from-primary/10 to-transparent" }), /* @__PURE__ */ N(d, {
935
+ children: [s && /* @__PURE__ */ M("div", { className: "pointer-events-none absolute inset-x-0 -top-4 h-4 bg-gradient-to-t from-primary/10 to-transparent" }), /* @__PURE__ */ M(d, {
898
936
  name: r ? "chevron-up" : "chevron-down",
899
937
  size: 12
900
938
  })]
@@ -902,15 +940,15 @@ function nt({ entry: e, pinned: t = !0 }) {
902
940
  })
903
941
  });
904
942
  }
905
- var rt = {
943
+ var ct = {
906
944
  running: "loader-circle",
907
945
  done: "check",
908
946
  error: "x",
909
947
  stopped: "circle-slash"
910
948
  };
911
- function it({ steps: e }) {
949
+ function lt({ steps: e }) {
912
950
  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 }));
913
- return /* @__PURE__ */ N(h, {
951
+ return /* @__PURE__ */ M(h, {
914
952
  ariaLabel: t.stepsLabel,
915
953
  selectedId: null,
916
954
  itemClassName: "py-0.5 text-xs text-muted-foreground",
@@ -920,16 +958,16 @@ function it({ steps: e }) {
920
958
  icon: n ? "loader-circle" : r ? "circle-alert" : "list-checks",
921
959
  children: e.map((e) => ({
922
960
  id: e.id,
923
- label: /* @__PURE__ */ N("span", {
961
+ label: /* @__PURE__ */ M("span", {
924
962
  className: e.status === "error" ? "text-destructive" : void 0,
925
963
  children: e.label
926
964
  }),
927
- icon: rt[e.status]
965
+ icon: ct[e.status]
928
966
  }))
929
967
  }]
930
968
  });
931
969
  }
932
- function at(e, t) {
970
+ function ut(e, t) {
933
971
  let n = e.at(-1);
934
972
  if (!n || n.kind !== "thinking" || !n.parts || n.status === "stopped" || n.status === "error") return null;
935
973
  let r = [...n.parts].reverse().find((e) => e.type === "questions");
@@ -938,9 +976,9 @@ function at(e, t) {
938
976
  part: r
939
977
  };
940
978
  }
941
- function ot({ entry: e, part: t, questions: n, autoFocus: r, className: a }) {
979
+ function dt({ entry: e, part: t, questions: n, autoFocus: r, className: a }) {
942
980
  let o = !!n?.canAnswer(e.id);
943
- return /* @__PURE__ */ N(i, {
981
+ return /* @__PURE__ */ M(i, {
944
982
  questions: t.questions,
945
983
  ...t.answers ? { answers: t.answers } : {},
946
984
  disabled: !t.answers && !o,
@@ -949,7 +987,7 @@ function ot({ entry: e, part: t, questions: n, autoFocus: r, className: a }) {
949
987
  className: a ?? "text-xs"
950
988
  });
951
989
  }
952
- function st({ entry: e, questions: t, hiddenPartId: n }) {
990
+ function ft({ entry: e, questions: t, hiddenPartId: n }) {
953
991
  let i = (e.parts ?? []).filter((e) => e.type !== "questions" || e.id !== n), o = [];
954
992
  for (let e of i) {
955
993
  let t = o.at(-1);
@@ -961,21 +999,21 @@ function st({ entry: e, questions: t, hiddenPartId: n }) {
961
999
  part: e
962
1000
  });
963
1001
  }
964
- return /* @__PURE__ */ N("div", {
1002
+ return /* @__PURE__ */ M("div", {
965
1003
  className: "space-y-2",
966
1004
  children: o.map((n) => {
967
- if ("steps" in n) return /* @__PURE__ */ N(it, { steps: n.steps }, n.key);
1005
+ if ("steps" in n) return /* @__PURE__ */ M(lt, { steps: n.steps }, n.key);
968
1006
  let { part: i } = n;
969
- return i.type === "text" ? i.text.trim() ? /* @__PURE__ */ N(r, {
1007
+ return i.type === "text" ? i.text.trim() ? /* @__PURE__ */ M(r, {
970
1008
  content: i.text,
971
1009
  streaming: i.streaming,
972
1010
  className: "break-words text-xs leading-relaxed text-foreground"
973
- }, n.key) : null : i.type === "reasoning" ? /* @__PURE__ */ N(a, {
1011
+ }, n.key) : null : i.type === "reasoning" ? /* @__PURE__ */ M(a, {
974
1012
  content: i.text,
975
1013
  streaming: i.streaming,
976
1014
  duration: i.duration,
977
1015
  className: "my-0"
978
- }, n.key) : /* @__PURE__ */ N(ot, {
1016
+ }, n.key) : /* @__PURE__ */ M(dt, {
979
1017
  entry: e,
980
1018
  part: i,
981
1019
  questions: t
@@ -983,52 +1021,52 @@ function st({ entry: e, questions: t, hiddenPartId: n }) {
983
1021
  })
984
1022
  });
985
1023
  }
986
- function ct({ entry: e, questions: t, hiddenPartId: n }) {
1024
+ function pt({ entry: e, questions: t, hiddenPartId: n }) {
987
1025
  let i = Q();
988
1026
  if (e.kind === "thinking" && e.parts) {
989
1027
  let r = e.status === "error" || e.status === "stopped" || e.status === "running" && e.parts.length === 0;
990
- return /* @__PURE__ */ P("li", {
1028
+ return /* @__PURE__ */ N("li", {
991
1029
  className: "text-xs text-muted-foreground",
992
- children: [e.parts.length > 0 && /* @__PURE__ */ N(st, {
1030
+ children: [e.parts.length > 0 && /* @__PURE__ */ M(ft, {
993
1031
  entry: e,
994
1032
  questions: t,
995
1033
  hiddenPartId: n
996
- }), r && /* @__PURE__ */ P("div", {
1034
+ }), r && /* @__PURE__ */ N("div", {
997
1035
  className: `flex items-start gap-1.5 ${e.parts.length > 0 ? "mt-1" : ""}`,
998
- children: [/* @__PURE__ */ N("span", {
1036
+ children: [/* @__PURE__ */ M("span", {
999
1037
  className: "pt-px",
1000
- children: /* @__PURE__ */ N($e, { status: e.status })
1001
- }), /* @__PURE__ */ N("span", {
1038
+ children: /* @__PURE__ */ M(it, { status: e.status })
1039
+ }), /* @__PURE__ */ M("span", {
1002
1040
  className: "min-w-0 flex-1 whitespace-pre-wrap break-words",
1003
- children: et(e, i)
1041
+ children: at(e, i)
1004
1042
  })]
1005
1043
  })]
1006
1044
  });
1007
1045
  }
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;
1009
- return /* @__PURE__ */ P("li", {
1046
+ let a = e.kind === "thinking" && e.detail ? tt(e.detail) : [], o = a.filter((e) => e.type === "code"), s = a.filter((e) => e.type === "text" && e.content.trim()), c = e.kind === "thinking" ? at(e, i) : e.label;
1047
+ return /* @__PURE__ */ N("li", {
1010
1048
  className: "text-xs text-muted-foreground",
1011
1049
  children: [
1012
- /* @__PURE__ */ P("div", {
1050
+ /* @__PURE__ */ N("div", {
1013
1051
  className: "flex items-start gap-1.5",
1014
- children: [/* @__PURE__ */ N("span", {
1052
+ children: [/* @__PURE__ */ M("span", {
1015
1053
  className: "pt-px",
1016
- children: /* @__PURE__ */ N($e, { status: e.status })
1017
- }), /* @__PURE__ */ N("span", {
1054
+ children: /* @__PURE__ */ M(it, { status: e.status })
1055
+ }), /* @__PURE__ */ M("span", {
1018
1056
  className: "min-w-0 flex-1 whitespace-pre-wrap break-words",
1019
1057
  children: c
1020
1058
  })]
1021
1059
  }),
1022
- o.length > 0 && /* @__PURE__ */ N("div", {
1060
+ o.length > 0 && /* @__PURE__ */ M("div", {
1023
1061
  className: "mt-1 ml-[18px] space-y-1",
1024
- children: o.map((e, t) => /* @__PURE__ */ N(Ze, {
1062
+ children: o.map((e, t) => /* @__PURE__ */ M(nt, {
1025
1063
  content: e.content,
1026
1064
  language: e.language
1027
1065
  }, t))
1028
1066
  }),
1029
- s.length > 0 && /* @__PURE__ */ N("div", {
1067
+ s.length > 0 && /* @__PURE__ */ M("div", {
1030
1068
  className: "mt-1 ml-[18px] space-y-2",
1031
- children: s.map((e, t) => /* @__PURE__ */ N(r, {
1069
+ children: s.map((e, t) => /* @__PURE__ */ M(r, {
1032
1070
  content: e.content.trim(),
1033
1071
  tone: "muted",
1034
1072
  className: "break-words text-xs leading-relaxed"
@@ -1037,21 +1075,21 @@ function ct({ entry: e, questions: t, hiddenPartId: n }) {
1037
1075
  ]
1038
1076
  });
1039
1077
  }
1040
- function lt({ activity: e, questions: t, docked: n, pinUserMessages: r = !0 }) {
1078
+ function mt({ activity: e, questions: t, docked: n, pinUserMessages: r = !0 }) {
1041
1079
  if (e.length === 0) return null;
1042
1080
  let i = [];
1043
1081
  for (let t of e) t.kind === "user" || i.length === 0 ? i.push(t.kind === "user" ? {
1044
1082
  user: t,
1045
1083
  entries: []
1046
1084
  } : { entries: [t] }) : i[i.length - 1].entries.push(t);
1047
- return /* @__PURE__ */ N("ul", {
1085
+ return /* @__PURE__ */ M("ul", {
1048
1086
  className: "space-y-0.5",
1049
- children: i.map((e) => /* @__PURE__ */ P("li", { children: [e.user && /* @__PURE__ */ N(nt, {
1087
+ children: i.map((e) => /* @__PURE__ */ N("li", { children: [e.user && /* @__PURE__ */ M(st, {
1050
1088
  entry: e.user,
1051
1089
  pinned: r
1052
- }), e.entries.length > 0 && /* @__PURE__ */ N("ul", {
1090
+ }), e.entries.length > 0 && /* @__PURE__ */ M("ul", {
1053
1091
  className: "space-y-0.5",
1054
- children: e.entries.map((e) => /* @__PURE__ */ N(ct, {
1092
+ children: e.entries.map((e) => /* @__PURE__ */ M(pt, {
1055
1093
  entry: e,
1056
1094
  questions: t,
1057
1095
  hiddenPartId: n?.entry.id === e.id ? n.part.id : void 0
@@ -1061,55 +1099,55 @@ function lt({ activity: e, questions: t, docked: n, pinUserMessages: r = !0 }) {
1061
1099
  }
1062
1100
  //#endregion
1063
1101
  //#region src/presentation/panelWidth.ts
1064
- var ut = 420, dt = 320, ft = "60vw", pt = "agentico:panel-width";
1065
- function mt(e, t) {
1102
+ var ht = 420, gt = 320, _t = "60vw", vt = "agentico:panel-width";
1103
+ function yt(e, t) {
1066
1104
  if (typeof e == "number") return e;
1067
1105
  let n = Number.parseFloat(e);
1068
1106
  return Number.isFinite(n) ? Math.round(n / 100 * t) : Infinity;
1069
1107
  }
1070
- function ht(e, t, n) {
1108
+ function bt(e, t, n) {
1071
1109
  return Math.round(Math.min(Math.max(e, t), Math.max(t, n)));
1072
1110
  }
1073
- function gt() {
1111
+ function xt() {
1074
1112
  try {
1075
- let e = window.localStorage.getItem(pt), t = e === null ? NaN : Number(e);
1113
+ let e = window.localStorage.getItem(vt), t = e === null ? NaN : Number(e);
1076
1114
  return Number.isFinite(t) && t > 0 ? t : null;
1077
1115
  } catch {
1078
1116
  return null;
1079
1117
  }
1080
1118
  }
1081
- function _t(e) {
1119
+ function St(e) {
1082
1120
  try {
1083
- e === null ? window.localStorage.removeItem(pt) : window.localStorage.setItem(pt, String(e));
1121
+ e === null ? window.localStorage.removeItem(vt) : window.localStorage.setItem(vt, String(e));
1084
1122
  } catch {}
1085
1123
  }
1086
- function vt() {
1124
+ function Ct() {
1087
1125
  return typeof window > "u" ? Infinity : window.innerWidth;
1088
1126
  }
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);
1127
+ function wt({ defaultWidth: e = 420, minWidth: t = 320, maxWidth: n = _t, onWidthChange: r }) {
1128
+ let [i, a] = j(Ct), [o, s] = j(() => xt() ?? e);
1091
1129
  D(() => {
1092
1130
  if (typeof window > "u") return;
1093
1131
  let e = () => a(window.innerWidth);
1094
1132
  return window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
1095
1133
  }, []);
1096
- let c = t, l = Math.max(c, mt(n, i)), u = ht(o, c, l);
1134
+ let c = t, l = Math.max(c, yt(n, i)), u = bt(o, c, l);
1097
1135
  return D(() => {
1098
1136
  r?.(u);
1099
1137
  }, [u]), {
1100
1138
  width: u,
1101
1139
  min: c,
1102
1140
  max: l,
1103
- set: T((e) => s(ht(e, c, l)), [c, l]),
1104
- commit: T((e) => _t(ht(e, c, l)), [c, l]),
1141
+ set: T((e) => s(bt(e, c, l)), [c, l]),
1142
+ commit: T((e) => St(bt(e, c, l)), [c, l]),
1105
1143
  reset: T(() => {
1106
- s(e), _t(null);
1144
+ s(e), St(null);
1107
1145
  }, [e])
1108
1146
  };
1109
1147
  }
1110
1148
  //#endregion
1111
1149
  //#region src/presentation/AgenticoResizeHandle.tsx
1112
- function bt({ width: e, min: t, max: n, onResize: r, onCommit: i, onReset: a }) {
1150
+ function Tt({ width: e, min: t, max: n, onResize: r, onCommit: i, onReset: a }) {
1113
1151
  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) => {
1114
1152
  let t = s.current;
1115
1153
  if (t && t.pointerId === e.pointerId) {
@@ -1120,7 +1158,7 @@ function bt({ width: e, min: t, max: n, onResize: r, onCommit: i, onReset: a })
1120
1158
  i(t.last);
1121
1159
  }
1122
1160
  };
1123
- return /* @__PURE__ */ N("div", {
1161
+ return /* @__PURE__ */ M("div", {
1124
1162
  role: "separator",
1125
1163
  "aria-orientation": "vertical",
1126
1164
  "aria-label": o.resizePanel,
@@ -1159,7 +1197,7 @@ function bt({ width: e, min: t, max: n, onResize: r, onCommit: i, onReset: a })
1159
1197
  let c = u(s);
1160
1198
  r(c), i(c);
1161
1199
  },
1162
- children: /* @__PURE__ */ N("span", {
1200
+ children: /* @__PURE__ */ M("span", {
1163
1201
  "aria-hidden": !0,
1164
1202
  className: `h-full w-0.5 transition-colors ${c ? "bg-primary" : "bg-transparent group-hover:bg-primary/50 group-focus-visible:bg-primary"}`
1165
1203
  })
@@ -1167,9 +1205,9 @@ function bt({ width: e, min: t, max: n, onResize: r, onCommit: i, onReset: a })
1167
1205
  }
1168
1206
  //#endregion
1169
1207
  //#region src/presentation/AgenticoToggle.tsx
1170
- function xt({ className: e = "" }) {
1208
+ function Et({ className: e = "" }) {
1171
1209
  let { isOpen: n, toggleOpen: r, task: i } = $(), a = Q(), o = i?.agent.running ?? !1;
1172
- return /* @__PURE__ */ N(t, {
1210
+ return /* @__PURE__ */ M(t, {
1173
1211
  icon: "bot",
1174
1212
  ariaLabel: n ? a.closePanel : a.openPanel,
1175
1213
  title: n ? a.closePanel : a.openPanel,
@@ -1180,21 +1218,21 @@ function xt({ className: e = "" }) {
1180
1218
  }
1181
1219
  //#endregion
1182
1220
  //#region src/presentation/useAIModelCatalog.ts
1183
- var St = "llmnative-cms.selectedAIModel";
1184
- function Ct() {
1221
+ var Dt = "llmnative-cms.selectedAIModel";
1222
+ function Ot() {
1185
1223
  try {
1186
- return localStorage.getItem(St) ?? "";
1224
+ return localStorage.getItem(Dt) ?? "";
1187
1225
  } catch {
1188
1226
  return "";
1189
1227
  }
1190
1228
  }
1191
- function wt(e) {
1229
+ function kt(e) {
1192
1230
  try {
1193
- e ? localStorage.setItem(St, e) : localStorage.removeItem(St);
1231
+ e ? localStorage.setItem(Dt, e) : localStorage.removeItem(Dt);
1194
1232
  } catch {}
1195
1233
  }
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);
1234
+ function At() {
1235
+ let e = b()?.registry ?? {}, t = Object.keys(e).length > 0, [n, r] = j({}), [i, a] = j(!1), [o, s] = j(Ot);
1198
1236
  return D(() => {
1199
1237
  if (!t) {
1200
1238
  r({});
@@ -1205,7 +1243,7 @@ function Tt() {
1205
1243
  if (n) return;
1206
1244
  r(e.modelsByProvider);
1207
1245
  let t = Object.values(e.modelsByProvider).flat();
1208
- s((e) => t.some((t) => t.id === e) ? e : (wt(""), ""));
1246
+ s((e) => t.some((t) => t.id === e) ? e : (kt(""), ""));
1209
1247
  }).catch((e) => {
1210
1248
  console.error("useAIModelCatalog: getAIModelCatalog failed", e), n || r({});
1211
1249
  }).finally(() => {
@@ -1219,17 +1257,17 @@ function Tt() {
1219
1257
  modelsLoading: i,
1220
1258
  selectedModel: o,
1221
1259
  setSelectedModel: (e) => {
1222
- wt(e), s(e);
1260
+ kt(e), s(e);
1223
1261
  }
1224
1262
  };
1225
1263
  }
1226
1264
  //#endregion
1227
1265
  //#region src/domain/approval.ts
1228
- var Et = "approval";
1229
- function Dt(e, t) {
1266
+ var jt = "approval";
1267
+ function Mt(e, t) {
1230
1268
  return typeof e.needsApproval == "function" ? e.needsApproval(t) : e.needsApproval === !0;
1231
1269
  }
1232
- function Ot(e, t, n) {
1270
+ function Nt(e, t, n) {
1233
1271
  let r = e[0]?.values ?? [], i = r.filter((e) => e !== t && e !== n).join(" ").trim();
1234
1272
  return {
1235
1273
  approved: r.includes(t) && !r.includes(n),
@@ -1238,37 +1276,37 @@ function Ot(e, t, n) {
1238
1276
  }
1239
1277
  //#endregion
1240
1278
  //#region src/presentation/useAgent.ts
1241
- var kt = 20, At = 26e4;
1242
- function jt(e) {
1243
- return e.filter((e) => !m.isTextAttachment(e.mimeType) || e.base64.length <= At);
1279
+ var Pt = 20, Ft = 26e4;
1280
+ function It(e) {
1281
+ return e.filter((e) => !m.isTextAttachment(e.mimeType) || e.base64.length <= Ft);
1244
1282
  }
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) => {
1283
+ function Lt(e, t = {}) {
1284
+ let { defaultEnabled: n = !1 } = t, [r, i] = j(n), { hasProviders: a, modelsByProvider: o, modelsLoading: s, selectedModel: c, setSelectedModel: l } = At(), [u, d] = j(!1), [f, p] = j(null), [h, g] = j(!1), [_, y] = j([]), x = A([]), S = (e) => {
1247
1285
  y((t) => {
1248
1286
  let n = typeof e == "function" ? e(t) : e;
1249
1287
  return x.current = n, n;
1250
1288
  });
1251
1289
  }, C = A(/* @__PURE__ */ new Map()), w = Q(), T = A(w);
1252
1290
  T.current = w;
1253
- let E = A(null), D = A(!1), O = A(null), M = () => {
1291
+ let E = A(null), D = A(!1), O = A(null), ee = () => {
1254
1292
  O.current?.abort();
1255
- }, N = b()?.registry ?? {}, [P, ee] = j(void 0), z = A(void 0), B = (e, t) => {
1293
+ }, M = b()?.registry ?? {}, [N, te] = j(void 0), re = A(void 0), L = (e, t) => {
1256
1294
  if (!t) return !1;
1257
1295
  if (!e) return !0;
1258
1296
  let n = v(t);
1259
1297
  return !!n && e.includes(n.provider);
1260
- }, te = k(() => P ? Object.fromEntries(Object.entries(o).map(([e, t]) => [e, t.filter((e) => P.includes(e.provider))]).filter(([, e]) => e.length)) : o, [P, o]), V = B(P, c) ? c : Object.values(te).flat()[0]?.id ?? "", H = r && V ? v(V) : null, U = H ? N[H.provider] : null, W = e.executor, G = !!W?.alongside, q = !!W && !G, ne = A([]), J = (e) => !!e && ne.current.some((t) => t.value === e), Y = A(!1), [re, ie] = j([]), [ae, oe] = j(""), se = A(""), Z = (e) => {
1261
- se.current = e, oe(e);
1262
- }, ce = (e) => {
1263
- let t = W?.models?.(e) ?? [];
1264
- ne.current = t, ie(t);
1265
- let n = W?.catalogProviders?.(e);
1266
- z.current = n, ee(n);
1267
- let r = G && !B(n, c) ? t[0]?.value : void 0;
1268
- Z(W?.defaultModel?.(e) ?? r ?? "");
1269
- }, le = async (e, t, n, r) => {
1298
+ }, ie = k(() => N ? Object.fromEntries(Object.entries(o).map(([e, t]) => [e, t.filter((e) => N.includes(e.provider))]).filter(([, e]) => e.length)) : o, [N, o]), R = L(N, c) ? c : Object.values(ie).flat()[0]?.id ?? "", z = r && R ? v(R) : null, B = z ? M[z.provider] : null, V = e.executor, H = !!V?.alongside, W = !!V && !H, ae = A([]), oe = (e) => !!e && ae.current.some((t) => t.value === e), G = A(!1), [se, ce] = j([]), [le, ue] = j(""), q = A(""), J = (e) => {
1299
+ q.current = e, ue(e);
1300
+ }, de = (e) => {
1301
+ let t = V?.models?.(e) ?? [];
1302
+ ae.current = t, ce(t);
1303
+ let n = V?.catalogProviders?.(e);
1304
+ re.current = n, te(n);
1305
+ let r = H && !L(n, c) ? t[0]?.value : void 0;
1306
+ J(V?.defaultModel?.(e) ?? r ?? "");
1307
+ }, Y = async (e, t, n, r) => {
1270
1308
  let i = E.current;
1271
- if (!i || !W) return p(T.current.noActiveSession), null;
1309
+ if (!i || !V) return p(T.current.noActiveSession), null;
1272
1310
  let a = new AbortController();
1273
1311
  O.current = a;
1274
1312
  let o = crypto.randomUUID();
@@ -1285,14 +1323,14 @@ function Mt(e, t = {}) {
1285
1323
  duration: e.duration ?? c(e.id)
1286
1324
  }), u = (e, t) => S((n) => n.map((n) => {
1287
1325
  if (n.id !== o) return n;
1288
- let r = e(n.parts ?? []), i = L(r);
1326
+ let r = e(n.parts ?? []), i = ne(r);
1289
1327
  return {
1290
1328
  ...n,
1291
1329
  parts: r,
1292
1330
  ...t ? { status: t } : {},
1293
1331
  ...i ? { detail: i } : {}
1294
1332
  };
1295
- })), d = (e) => u((t) => I(t, e, l)), f = !1, m = (e, t) => {
1333
+ })), d = (e) => u((t) => F(t, e, l)), f = !1, m = (e, t) => {
1296
1334
  t?.id && t.id !== "text" && (f = !0), d({
1297
1335
  type: "text",
1298
1336
  id: t?.id ?? "text",
@@ -1337,9 +1375,9 @@ function Mt(e, t = {}) {
1337
1375
  });
1338
1376
  }));
1339
1377
  }, x = (e, t) => {
1340
- u((n) => (t && !f ? I(n, {
1378
+ u((n) => (t && !f ? F(n, {
1341
1379
  type: "text",
1342
- id: F,
1380
+ id: P,
1343
1381
  text: t,
1344
1382
  streaming: !1
1345
1383
  }, l) : n).map((t) => t.type === "reasoning" && t.streaming ? l(t) : t.type === "text" && t.streaming ? {
@@ -1353,13 +1391,13 @@ function Mt(e, t = {}) {
1353
1391
  _.clear();
1354
1392
  }, w = e || r?.historyText || "";
1355
1393
  try {
1356
- let o = await W.turn({
1394
+ let o = await V.turn({
1357
1395
  params: i.params,
1358
1396
  context: i.context,
1359
1397
  text: e,
1360
1398
  first: t,
1361
1399
  signal: a.signal,
1362
- ...n || se.current ? { model: n || se.current } : {},
1400
+ ...n || q.current ? { model: n || q.current } : {},
1363
1401
  ...r ? { answers: {
1364
1402
  id: r.id,
1365
1403
  answers: r.answers
@@ -1384,11 +1422,11 @@ function Mt(e, t = {}) {
1384
1422
  return i.history = [...i.history, ...w ? [{
1385
1423
  role: "user",
1386
1424
  content: w
1387
- }] : []], a.signal.aborted ? (x("stopped"), null) : (x("error"), p(pe(e)), null);
1425
+ }] : []], a.signal.aborted ? (x("stopped"), null) : (x("error"), p(X(e)), null);
1388
1426
  } finally {
1389
1427
  O.current = null;
1390
1428
  }
1391
- }, ue = async (e, t, n) => {
1429
+ }, fe = async (e, t, n) => {
1392
1430
  let r = x.current.find((t) => t.id === e)?.parts?.find((e) => e.type === "questions" && e.id === t);
1393
1431
  if (!r || r.type !== "questions") throw p(T.current.noActiveSession), Error(T.current.noActiveSession);
1394
1432
  let i = () => S((r) => r.map((r) => r.id === e ? {
@@ -1400,27 +1438,27 @@ function Mt(e, t = {}) {
1400
1438
  } : r)), a = `${e}:${t}`, o = C.current.get(a);
1401
1439
  if (o) return C.current.delete(a), i(), o.resolve(n), null;
1402
1440
  if (D.current) throw p(T.current.requestInProgress), Error(T.current.requestInProgress);
1403
- if (!q || !E.current) throw p(T.current.noActiveSession), Error(T.current.noActiveSession);
1441
+ if (!W || !E.current) throw p(T.current.noActiveSession), Error(T.current.noActiveSession);
1404
1442
  D.current = !0, d(!0), p(null), i();
1405
1443
  try {
1406
- return await le("", !1, void 0, {
1444
+ return await Y("", !1, void 0, {
1407
1445
  id: t,
1408
1446
  answers: n,
1409
- historyText: R(r.questions, n)
1447
+ historyText: I(r.questions, n)
1410
1448
  });
1411
1449
  } finally {
1412
1450
  D.current = !1, d(!1);
1413
1451
  }
1414
- }, de = async (t, n, r) => {
1415
- let i = z.current, a = Object.values(o).flat().find((e) => !i || i.includes(e.provider))?.id, s = r && B(i, r) ? r : B(i, V) ? void 0 : a, c = s ? v(s) : H, l = c && E.current ? W?.catalogReasoning?.(E.current.params, c.provider) : void 0, u = l ? { reasoning: l } : {}, d = E.current;
1452
+ }, pe = async (t, n, r) => {
1453
+ let i = re.current, a = Object.values(o).flat().find((e) => !i || i.includes(e.provider))?.id, s = r && L(i, r) ? r : L(i, R) ? void 0 : a, c = s ? v(s) : z, l = c && E.current ? V?.catalogReasoning?.(E.current.params, c.provider) : void 0, u = l ? { reasoning: l } : {}, d = E.current;
1416
1454
  if (!d) return p(T.current.noActiveSession), null;
1417
- let f = s ? v(s) : H, h = f ? N[f.provider] : null;
1455
+ let f = s ? v(s) : z, h = f ? M[f.provider] : null;
1418
1456
  if (!h || !f) return p(T.current.noProviderAvailable), null;
1419
1457
  n?.length && (d.attachmentsRef.current = [...d.attachmentsRef.current ?? [], ...n]);
1420
- let g = (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(""), _ = jt(n ?? []), y = d.tools.map((e) => ({
1458
+ let g = (n ?? []).filter((e) => m.isTextAttachment(e.mimeType)).map((e) => e.base64.length <= Ft ? `\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(""), _ = It(n ?? []), y = d.tools.map((e) => ({
1421
1459
  name: e.name,
1422
1460
  description: e.description,
1423
- inputSchema: K(e.inputSchema)
1461
+ inputSchema: U(e.inputSchema)
1424
1462
  })), b = (e, t, n, r) => {
1425
1463
  let i = T.current, a = `approval-${e}`, o = t.describeApproval?.(n) ?? t.describeInvocation?.(n) ?? t.name;
1426
1464
  S((e) => [...e, {
@@ -1430,7 +1468,7 @@ function Mt(e, t = {}) {
1430
1468
  status: "running",
1431
1469
  parts: [{
1432
1470
  type: "questions",
1433
- id: Et,
1471
+ id: jt,
1434
1472
  questions: [{
1435
1473
  header: i.approvalHeader,
1436
1474
  question: i.approveQuestion.replace("{action}", o),
@@ -1439,7 +1477,7 @@ function Mt(e, t = {}) {
1439
1477
  }]
1440
1478
  }]
1441
1479
  }]);
1442
- let s = `${a}:${Et}`;
1480
+ let s = `${a}:${jt}`;
1443
1481
  return new Promise((e, t) => {
1444
1482
  let n = () => {
1445
1483
  C.current.delete(s), D(a, "stopped"), t(new DOMException("The turn was stopped.", "AbortError"));
@@ -1450,7 +1488,7 @@ function Mt(e, t = {}) {
1450
1488
  }
1451
1489
  r.addEventListener("abort", n, { once: !0 }), C.current.set(s, {
1452
1490
  resolve: (t) => {
1453
- r.removeEventListener("abort", n), D(a, "done"), e(Ot(t, i.approve, i.reject));
1491
+ r.removeEventListener("abort", n), D(a, "done"), e(Nt(t, i.approve, i.reject));
1454
1492
  },
1455
1493
  reject: t
1456
1494
  });
@@ -1465,7 +1503,7 @@ function Mt(e, t = {}) {
1465
1503
  } : i));
1466
1504
  try {
1467
1505
  let n = d.history, r = t;
1468
- for (let t = 0; t < kt; t++) {
1506
+ for (let t = 0; t < Pt; t++) {
1469
1507
  let i = crypto.randomUUID();
1470
1508
  S((e) => [...e, {
1471
1509
  id: i,
@@ -1489,7 +1527,7 @@ function Mt(e, t = {}) {
1489
1527
  return d.history = [...n, ...r ? [{
1490
1528
  role: "user",
1491
1529
  content: r + g
1492
- }] : []], w.signal.aborted ? (D(i, "stopped"), e.fallback(d.params, d.context)) : (D(i, "error"), p(pe(t)), null);
1530
+ }] : []], w.signal.aborted ? (D(i, "stopped"), e.fallback(d.params, d.context)) : (D(i, "error"), p(X(t)), null);
1493
1531
  }
1494
1532
  if (d.history = [...n, ...r ? [{
1495
1533
  role: "user",
@@ -1525,7 +1563,7 @@ function Mt(e, t = {}) {
1525
1563
  let s = /* @__PURE__ */ new Map();
1526
1564
  for (let t of a.toolCalls) {
1527
1565
  let n = x.get(t.name);
1528
- if (n && Dt(n, t.input)) try {
1566
+ if (n && Mt(n, t.input)) try {
1529
1567
  s.set(t.id, await b(t.id, n, t.input, w.signal));
1530
1568
  } catch {
1531
1569
  return e.fallback(d.params, d.context);
@@ -1540,7 +1578,7 @@ function Mt(e, t = {}) {
1540
1578
  label: n,
1541
1579
  status: "stopped"
1542
1580
  }]);
1543
- let t = X().toolRejected.replace("{reason}", r.reason ? ` (${r.reason})` : "");
1581
+ let t = K().toolRejected.replace("{reason}", r.reason ? ` (${r.reason})` : "");
1544
1582
  return {
1545
1583
  toolCallId: e.id,
1546
1584
  name: e.name,
@@ -1570,7 +1608,7 @@ function Mt(e, t = {}) {
1570
1608
  return D(e.id, "error"), {
1571
1609
  toolCallId: e.id,
1572
1610
  name: e.name,
1573
- output: pe(t),
1611
+ output: X(t),
1574
1612
  isError: !0
1575
1613
  };
1576
1614
  }
@@ -1603,7 +1641,7 @@ function Mt(e, t = {}) {
1603
1641
  try {
1604
1642
  a = await h.complete({
1605
1643
  ...u,
1606
- prompt: fe(X().stopCallingTools, e.microPromptIds),
1644
+ prompt: me(K().stopCallingTools, e.microPromptIds),
1607
1645
  model: f.model,
1608
1646
  history: n,
1609
1647
  signal: w.signal,
@@ -1624,7 +1662,7 @@ function Mt(e, t = {}) {
1624
1662
  } finally {
1625
1663
  O.current = null;
1626
1664
  }
1627
- }, me = async (t, n) => {
1665
+ }, he = async (t, n) => {
1628
1666
  if (D.current) return p(T.current.requestInProgress), null;
1629
1667
  D.current = !0, p(null), S(n?.openingMessage ? [{
1630
1668
  id: crypto.randomUUID(),
@@ -1643,13 +1681,13 @@ function Mt(e, t = {}) {
1643
1681
  history: [],
1644
1682
  logId: crypto.randomUUID(),
1645
1683
  attachmentsRef: a
1646
- }, q) return g(!0), ce(t), await le(n?.openingMessage ?? "", !0);
1647
- if (G) {
1648
- ce(t), Y.current = !1;
1649
- let e = n?.model || se.current;
1650
- if (J(e)) return g(!0), Y.current = !0, await le(n?.openingMessage ?? "", !0, e);
1684
+ }, W) return g(!0), de(t), await Y(n?.openingMessage ?? "", !0);
1685
+ if (H) {
1686
+ de(t), G.current = !1;
1687
+ let e = n?.model || q.current;
1688
+ if (oe(e)) return g(!0), G.current = !0, await Y(n?.openingMessage ?? "", !0, e);
1651
1689
  }
1652
- let s = n?.model || void 0, c = s ? !!N[v(s)?.provider ?? ""] : !!U;
1690
+ let s = n?.model || void 0, c = s ? !!M[v(s)?.provider ?? ""] : !!B;
1653
1691
  if (!r || !c) {
1654
1692
  g(!1);
1655
1693
  let n = e.fallback(t, i);
@@ -1661,14 +1699,14 @@ function Mt(e, t = {}) {
1661
1699
  }]), n;
1662
1700
  }
1663
1701
  g(!0);
1664
- let l = n?.attachments?.length ? await Promise.all(n.attachments.map((e) => m.fileToAttachment(e))) : void 0, u = fe(e.buildPrompt(t, i), e.microPromptIds);
1665
- return await de(u, l, s);
1702
+ let l = n?.attachments?.length ? await Promise.all(n.attachments.map((e) => m.fileToAttachment(e))) : void 0, u = me(e.buildPrompt(t, i), e.microPromptIds);
1703
+ return await pe(u, l, s);
1666
1704
  } catch (e) {
1667
- return p(pe(e)), null;
1705
+ return p(X(e)), null;
1668
1706
  } finally {
1669
1707
  D.current = !1, d(!1);
1670
1708
  }
1671
- }, he = async (t, n) => {
1709
+ }, ge = async (t, n) => {
1672
1710
  if (D.current) {
1673
1711
  p(T.current.requestInProgress);
1674
1712
  return;
@@ -1683,13 +1721,13 @@ function Mt(e, t = {}) {
1683
1721
  history: n.history,
1684
1722
  logId: crypto.randomUUID(),
1685
1723
  attachmentsRef: a
1686
- }, (q || G) && ce(t), Y.current = !1, g(q || G || r && !!U);
1724
+ }, (W || H) && de(t), G.current = !1, g(W || H || r && !!B);
1687
1725
  } catch (e) {
1688
- p(pe(e));
1726
+ p(X(e));
1689
1727
  } finally {
1690
1728
  D.current = !1, d(!1);
1691
1729
  }
1692
- }, ge = async (t, n) => {
1730
+ }, _e = async (t, n) => {
1693
1731
  if (D.current) return p(T.current.requestInProgress), null;
1694
1732
  if (p(null), !t.trim()) return p("Messaggio vuoto."), null;
1695
1733
  let r = E.current;
@@ -1704,20 +1742,20 @@ function Mt(e, t = {}) {
1704
1742
  ...n?.retry ? { retry: !0 } : {}
1705
1743
  }]);
1706
1744
  try {
1707
- if (q) return await le(t, !1, n?.model || void 0);
1708
- let i = n?.model || (G ? se.current : "");
1709
- if (G && J(i)) {
1710
- let e = !Y.current;
1711
- return Y.current = !0, await le(t, e, i);
1745
+ if (W) return await Y(t, !1, n?.model || void 0);
1746
+ let i = n?.model || (H ? q.current : "");
1747
+ if (H && oe(i)) {
1748
+ let e = !G.current;
1749
+ return G.current = !0, await Y(t, e, i);
1712
1750
  }
1713
- let a = n?.attachments?.length ? await Promise.all(n.attachments.map((e) => m.fileToAttachment(e))) : void 0, o = fe(e.buildFollowUpPrompt(t, r.params, r.context), e.microPromptIds);
1714
- return await de(o, a, n?.model || void 0);
1751
+ let a = n?.attachments?.length ? await Promise.all(n.attachments.map((e) => m.fileToAttachment(e))) : void 0, o = me(e.buildFollowUpPrompt(t, r.params, r.context), e.microPromptIds);
1752
+ return await pe(o, a, n?.model || void 0);
1715
1753
  } catch (e) {
1716
- return p(pe(e)), null;
1754
+ return p(X(e)), null;
1717
1755
  } finally {
1718
1756
  D.current = !1, d(!1);
1719
1757
  }
1720
- }, _e = () => {
1758
+ }, ve = () => {
1721
1759
  let t = E.current;
1722
1760
  if (!t) return null;
1723
1761
  p(null);
@@ -1728,7 +1766,7 @@ function Mt(e, t = {}) {
1728
1766
  status: "done",
1729
1767
  label: e.describeFallback?.(n) ?? T.current.continueWithoutAiFallback
1730
1768
  }]), n;
1731
- }, ve = () => E.current ? {
1769
+ }, ye = () => E.current ? {
1732
1770
  history: E.current.history,
1733
1771
  activity: _
1734
1772
  } : null;
@@ -1736,48 +1774,48 @@ function Mt(e, t = {}) {
1736
1774
  enabled: r,
1737
1775
  setEnabled: i,
1738
1776
  hasProviders: a,
1739
- selectedModel: q || G && ae ? ae : V,
1740
- setSelectedModel: q ? Z : G ? (e) => {
1741
- J(e) ? Z(e) : (Z(""), l(e));
1777
+ selectedModel: W || H && le ? le : R,
1778
+ setSelectedModel: W ? J : H ? (e) => {
1779
+ oe(e) ? J(e) : (J(""), l(e));
1742
1780
  } : l,
1743
- modelsByProvider: te,
1781
+ modelsByProvider: ie,
1744
1782
  modelsLoading: s,
1745
1783
  running: u,
1746
1784
  error: f,
1747
1785
  canContinue: h,
1748
- remote: q,
1749
- remoteModels: re,
1750
- alongside: G,
1751
- ...W?.catalogGroup ? { catalogGroup: W.catalogGroup } : {},
1786
+ remote: W,
1787
+ remoteModels: se,
1788
+ alongside: H,
1789
+ ...V?.catalogGroup ? { catalogGroup: V.catalogGroup } : {},
1752
1790
  activity: _,
1753
- run: me,
1754
- resume: he,
1755
- sendMessage: ge,
1756
- stop: M,
1757
- runFallback: _e,
1758
- snapshot: ve,
1759
- answerQuestions: ue
1791
+ run: he,
1792
+ resume: ge,
1793
+ sendMessage: _e,
1794
+ stop: ee,
1795
+ runFallback: ve,
1796
+ snapshot: ye,
1797
+ answerQuestions: fe
1760
1798
  };
1761
1799
  }
1762
1800
  //#endregion
1763
1801
  //#region src/domain/orchestrator/prompt.ts
1764
- function Nt() {
1765
- let e = X();
1802
+ function Rt() {
1803
+ let e = K();
1766
1804
  return [e.responseRulesHeading, ...e.responseRules.map((e) => `- ${e}`)].join("\n");
1767
1805
  }
1768
- function Pt(e, t, n) {
1769
- let r = X(), i = n ? `\n${r.pageContextHeading}\n${r.pageContextIntro}\n${n}\n` : "";
1806
+ function zt(e, t, n) {
1807
+ let r = K(), i = n ? `\n${r.pageContextHeading}\n${r.pageContextIntro}\n${n}\n` : "";
1770
1808
  return `${r.orchestratorIntro}
1771
1809
 
1772
1810
  ${r.toolsHeading}
1773
1811
  ${t}
1774
1812
  ${i}
1775
- ${Nt()}
1813
+ ${Rt()}
1776
1814
 
1777
1815
  ${r.userRequestHeading}
1778
1816
  ${e}`;
1779
1817
  }
1780
- function Ft(e, t) {
1818
+ function Bt(e, t) {
1781
1819
  return t ? {
1782
1820
  kind: "handoff",
1783
1821
  ...t
@@ -1788,27 +1826,27 @@ function Ft(e, t) {
1788
1826
  }
1789
1827
  //#endregion
1790
1828
  //#region src/domain/orchestrator/agenticoOrchestratorAgent.ts
1791
- function It(e) {
1792
- return V().filter((t) => !t.onlyWhenAnchored || e === t.id);
1829
+ function Vt(e) {
1830
+ return R().filter((t) => !t.onlyWhenAnchored || e === t.id);
1793
1831
  }
1794
- function Lt(e) {
1832
+ function Ht(e) {
1795
1833
  return {
1796
1834
  buildContext(e) {
1797
1835
  return {
1798
- cliCatalog: le(It(e.scopedSubagentId)),
1836
+ cliCatalog: Y(Vt(e.scopedSubagentId)),
1799
1837
  handoff: { current: null },
1800
1838
  collected: {}
1801
1839
  };
1802
1840
  },
1803
1841
  buildPrompt({ userGoal: e, pageContext: t }, { cliCatalog: n }) {
1804
- return Pt(e, n, t);
1842
+ return zt(e, n, t);
1805
1843
  },
1806
1844
  buildFollowUpPrompt(e, t, { cliCatalog: n }) {
1807
- return `${e}\n\n${Nt()}\n\n${X().toolsHeading}\n${n}`;
1845
+ return `${e}\n\n${Rt()}\n\n${K().toolsHeading}\n${n}`;
1808
1846
  },
1809
1847
  parseResponse(e, t, n) {
1810
1848
  let r = n.handoff.current;
1811
- return n.handoff.current = null, Ft(e, r);
1849
+ return n.handoff.current = null, Bt(e, r);
1812
1850
  },
1813
1851
  fallback() {
1814
1852
  return {
@@ -1820,11 +1858,11 @@ function Lt(e) {
1820
1858
  return t.kind === "chat" ? t.message : e.continueWithoutAi;
1821
1859
  },
1822
1860
  getTools(t, n, r) {
1823
- let i = G({
1861
+ let i = H({
1824
1862
  attachmentsRef: r,
1825
1863
  collected: n.collected,
1826
1864
  proxyFetch: y
1827
- }), 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) => ({
1865
+ }), a = t.scopedSubagentId ? z(t.scopedSubagentId) : null, o = a ? i.filter((e) => (a.crossAgentToolIds ?? []).includes(e.name)) : i, s = Vt(t.scopedSubagentId).flatMap((t) => t.commands.map((r) => ({
1828
1866
  name: `${t.id}_${r.name}`,
1829
1867
  description: `${t.label}: ${r.summary}`,
1830
1868
  inputSchema: r.inputSchema,
@@ -1838,7 +1876,7 @@ function Lt(e) {
1838
1876
  params: i
1839
1877
  }, {
1840
1878
  status: "queued",
1841
- note: _(X().handoffQueued, { label: t.label })
1879
+ note: _(K().handoffQueued, { label: t.label })
1842
1880
  };
1843
1881
  }
1844
1882
  })));
@@ -1848,17 +1886,17 @@ function Lt(e) {
1848
1886
  }
1849
1887
  //#endregion
1850
1888
  //#region src/presentation/deriveHistoryTitle.ts
1851
- function Rt(e, t) {
1889
+ function Ut(e, t) {
1852
1890
  return e.deriveHistoryTitle?.(t) ?? e.label;
1853
1891
  }
1854
1892
  //#endregion
1855
1893
  //#region src/presentation/ResultDestinationPicker.tsx
1856
- function zt({ manifest: e, result: t, meta: n, taskId: r, initiallyApplied: i, onApplied: a, extraDestinations: o }) {
1857
- 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();
1894
+ function Wt({ manifest: e, result: t, meta: n, taskId: r, initiallyApplied: i, onApplied: a, extraDestinations: o }) {
1895
+ let s = Q(), c = $(), l = c.scope, u = C(), [d, f] = j(null), [p, m] = j(new Set(i ?? [])), [h, g] = j(null), v = xe(), y = /* @__PURE__ */ new Map();
1858
1896
  e.destinationIds.forEach((e) => {
1859
1897
  let t = v[e];
1860
1898
  t && y.set(e, t);
1861
- }), (o ?? []).forEach((e) => y.set(e.id, e)), y.set(_e.id, _e);
1899
+ }), (o ?? []).forEach((e) => y.set(e.id, e)), y.set(ve.id, ve);
1862
1900
  let b = Array.from(y.values()), x = async (i) => {
1863
1901
  f(i), g(null);
1864
1902
  try {
@@ -1871,23 +1909,23 @@ function zt({ manifest: e, result: t, meta: n, taskId: r, initiallyApplied: i, o
1871
1909
  storageProvider: l?.storageProvider ?? null,
1872
1910
  proxyFetch: u
1873
1911
  }, n);
1874
- m((e) => new Set(e).add(i)), a?.(i), d?.id && c.commitEntityChat(e.id, d.id, r, l?.id, n, Rt(e, n));
1912
+ m((e) => new Set(e).add(i)), a?.(i), d?.id && c.commitEntityChat(e.id, d.id, r, l?.id, n, Ut(e, n));
1875
1913
  } catch (e) {
1876
1914
  g(e instanceof Error ? e.message : String(e));
1877
1915
  } finally {
1878
1916
  f(null);
1879
1917
  }
1880
1918
  };
1881
- return /* @__PURE__ */ P("div", {
1919
+ return /* @__PURE__ */ N("div", {
1882
1920
  className: "space-y-2",
1883
1921
  children: [
1884
- /* @__PURE__ */ N("p", {
1922
+ /* @__PURE__ */ M("p", {
1885
1923
  className: "text-xs font-medium text-muted-foreground",
1886
1924
  children: s.destinationPickerTitle
1887
1925
  }),
1888
- /* @__PURE__ */ N("div", {
1926
+ /* @__PURE__ */ M("div", {
1889
1927
  className: "flex flex-wrap gap-2",
1890
- children: b.map((e) => /* @__PURE__ */ N("button", {
1928
+ children: b.map((e) => /* @__PURE__ */ M("button", {
1891
1929
  type: "button",
1892
1930
  disabled: d !== null,
1893
1931
  onClick: () => void x(e.id),
@@ -1895,7 +1933,7 @@ function zt({ manifest: e, result: t, meta: n, taskId: r, initiallyApplied: i, o
1895
1933
  children: d === e.id ? s.destinationApplying : `${p.has(e.id) ? "✓ " : ""}${e.id === "json-export" ? s.exportJson : e.label}`
1896
1934
  }, e.id))
1897
1935
  }),
1898
- h && /* @__PURE__ */ N("p", {
1936
+ h && /* @__PURE__ */ M("p", {
1899
1937
  className: "text-xs text-destructive",
1900
1938
  children: h
1901
1939
  })
@@ -1904,33 +1942,33 @@ function zt({ manifest: e, result: t, meta: n, taskId: r, initiallyApplied: i, o
1904
1942
  }
1905
1943
  //#endregion
1906
1944
  //#region src/presentation/reports/subagentReportRegistry.tsx
1907
- var Bt = {};
1908
- function Vt(e) {
1909
- Object.assign(Bt, e);
1945
+ var Gt = {};
1946
+ function Kt(e) {
1947
+ Object.assign(Gt, e);
1910
1948
  }
1911
- function Ht(e) {
1912
- return Bt[e];
1949
+ function qt(e) {
1950
+ return Gt[e];
1913
1951
  }
1914
1952
  //#endregion
1915
1953
  //#region src/presentation/reports/GenericResultPreview.tsx
1916
- function Ut({ result: e }) {
1954
+ function Jt({ result: e }) {
1917
1955
  let [t, n] = j(!1);
1918
- return /* @__PURE__ */ P("div", {
1956
+ return /* @__PURE__ */ N("div", {
1919
1957
  className: `relative cursor-pointer rounded-md border border-border/60 ${t ? "max-h-80 overflow-y-auto" : "max-h-28 overflow-hidden"}`,
1920
1958
  onClick: () => n((e) => !e),
1921
1959
  title: t ? "Clic per comprimere" : "Clic per espandere",
1922
- children: [/* @__PURE__ */ N(s, {
1960
+ children: [/* @__PURE__ */ M(s, {
1923
1961
  language: "json",
1924
1962
  showCopy: t,
1925
1963
  background: "transparent",
1926
1964
  className: "!text-[11px]",
1927
1965
  children: JSON.stringify(e, null, 2)
1928
- }), !t && /* @__PURE__ */ N("div", { className: "pointer-events-none absolute inset-x-0 bottom-0 h-6 bg-gradient-to-t from-muted/30 to-transparent" })]
1966
+ }), !t && /* @__PURE__ */ M("div", { className: "pointer-events-none absolute inset-x-0 bottom-0 h-6 bg-gradient-to-t from-muted/30 to-transparent" })]
1929
1967
  });
1930
1968
  }
1931
1969
  //#endregion
1932
1970
  //#region src/presentation/liveAnchorDestination.ts
1933
- function Wt(e, t, n) {
1971
+ function Yt(e, t, n) {
1934
1972
  return e.length === 0 ? null : {
1935
1973
  id: "live-component",
1936
1974
  label: "Applica al componente aperto",
@@ -1941,38 +1979,38 @@ function Wt(e, t, n) {
1941
1979
  }
1942
1980
  //#endregion
1943
1981
  //#region src/presentation/subagentControls.ts
1944
- var Gt = {};
1945
- function Kt(e) {
1946
- Object.assign(Gt, e);
1982
+ var Xt = {};
1983
+ function Zt(e) {
1984
+ Object.assign(Xt, e);
1947
1985
  }
1948
- function qt(e) {
1949
- return Gt[e];
1986
+ function Qt(e) {
1987
+ return Xt[e];
1950
1988
  }
1951
1989
  //#endregion
1952
1990
  //#region src/presentation/chatTitles.ts
1953
- function Jt(e, t = 6e3) {
1954
- 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");
1991
+ function $t(e, t = 6e3) {
1992
+ let n = e.filter((e) => (e.kind === "user" || e.kind === "thinking") && e.detail?.trim() && !We(e)).map((e) => `${e.kind === "user" ? "Person" : "Agent"}: ${e.detail.trim()}`).join("\n\n");
1955
1993
  return n.length > t ? `${n.slice(0, t * .7)}\n\n[…]\n\n${n.slice(-t * .3)}` : n;
1956
1994
  }
1957
- function Yt(e) {
1995
+ function en(e) {
1958
1996
  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);
1959
1997
  }
1960
- function Xt(e, t) {
1998
+ function tn(e, t) {
1961
1999
  try {
1962
2000
  return e.definition.executor?.catalogProviders?.(e.toParams(t));
1963
2001
  } catch {
1964
2002
  return;
1965
2003
  }
1966
2004
  }
1967
- function Zt(e, t, n, r, i) {
1968
- let a = Xt(e, t), o = (e) => {
2005
+ function nn(e, t, n, r, i) {
2006
+ let a = tn(e, t), o = (e) => {
1969
2007
  let t = e ? v(e) : null;
1970
2008
  return !(!t || !i[t.provider] || a && !a.includes(t.provider));
1971
2009
  };
1972
2010
  return o(n) ? n : Object.values(r).flat().map((e) => e.id).find(o);
1973
2011
  }
1974
- function Qt(e) {
1975
- let t = b()?.registry ?? {}, { modelsByProvider: n, selectedModel: r } = Tt(), i = A({
2012
+ function rn(e) {
2013
+ let t = b()?.registry ?? {}, { modelsByProvider: n, selectedModel: r } = At(), i = A({
1976
2014
  registry: t,
1977
2015
  modelsByProvider: n,
1978
2016
  selectedModel: r
@@ -1984,18 +2022,18 @@ function Qt(e) {
1984
2022
  };
1985
2023
  let a = A(/* @__PURE__ */ new Set()), o = T(async (t, n, r) => {
1986
2024
  if (!e) return !1;
1987
- let o = Me(e, t, n), s = H(t), c = `${e}:${t}:${n}`;
1988
- if (!o || !s?.autoTitle || o.name || !Re(o) || a.current.has(c)) return !1;
1989
- let { registry: l, modelsByProvider: u, selectedModel: d } = i.current, f = Zt(s, o.params, r ?? d, u, l), p = f ? v(f) : null;
2025
+ let o = Le(e, t, n), s = z(t), c = `${e}:${t}:${n}`;
2026
+ if (!o || !s?.autoTitle || o.name || !Ue(o) || a.current.has(c)) return !1;
2027
+ let { registry: l, modelsByProvider: u, selectedModel: d } = i.current, f = nn(s, o.params, r ?? d, u, l), p = f ? v(f) : null;
1990
2028
  if (!p) return !1;
1991
2029
  a.current.add(c);
1992
2030
  try {
1993
2031
  let r = await l[p.provider].complete({
1994
- prompt: X().chatTitle.replace("{chat}", Jt(o.activity)),
2032
+ prompt: K().chatTitle.replace("{chat}", $t(o.activity)),
1995
2033
  model: p.model,
1996
2034
  history: []
1997
- }), i = r && r.type === "text" ? Yt(r.text) : "";
1998
- return i ? Be(e, t, n, i, "model") : !1;
2035
+ }), i = r && r.type === "text" ? en(r.text) : "";
2036
+ return i ? Ge(e, t, n, i, "model") : !1;
1999
2037
  } catch {
2000
2038
  return !1;
2001
2039
  } finally {
@@ -2003,12 +2041,12 @@ function Qt(e) {
2003
2041
  }
2004
2042
  }, [e]), s = Object.keys(n).length > 0;
2005
2043
  return D(() => {
2006
- e && s && !$t.has(e) && ($t.add(e), (async () => {
2007
- for (let t of Ue(e)) {
2008
- let n = H(t.subagentId);
2044
+ e && s && !an.has(e) && (an.add(e), (async () => {
2045
+ for (let t of Je(e)) {
2046
+ let n = z(t.subagentId);
2009
2047
  if (n?.autoTitle) {
2010
- if (n.definition.conversational && !Re(t)) {
2011
- He(e, t.subagentId, t.entityId);
2048
+ if (n.definition.conversational && !Ue(t)) {
2049
+ qe(e, t.subagentId, t.entityId);
2012
2050
  continue;
2013
2051
  }
2014
2052
  t.name || await o(t.subagentId, t.entityId);
@@ -2021,23 +2059,23 @@ function Qt(e) {
2021
2059
  o
2022
2060
  ]), o;
2023
2061
  }
2024
- var $t = /* @__PURE__ */ new Set(), en = () => ({});
2025
- function tn({ manifest: e, params: t, extraDestinations: n, precedingActivity: r, taskId: i, resumeSeed: a, model: o, openingMessage: s }) {
2026
- 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) => {
2062
+ var an = /* @__PURE__ */ new Set(), on = () => ({});
2063
+ function sn({ manifest: e, params: t, extraDestinations: n, precedingActivity: r, taskId: i, resumeSeed: a, model: o, openingMessage: s }) {
2064
+ let c = Lt(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) => {
2027
2065
  e.definition.conversational || m(t);
2028
- }, [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);
2066
+ }, [g, _] = j([]), [v, y] = j(null), b = qt(e.id), x = b?.kind === "selection" ? b : null, [S, w] = j(null), T = A(!1), E = A(0), O = A(null);
2029
2067
  p && p !== O.current && (O.current = p, E.current = (r?.length ?? 0) + c.activity.length);
2030
- let F = A(!1), ee = c.remote || !c.hasProviders || c.selectedModel !== "";
2068
+ let P = A(!1), te = c.remote || !c.hasProviders || c.selectedModel !== "";
2031
2069
  D(() => {
2032
- !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), {
2070
+ !T.current && te && (T.current = !0, a ? (V.current = !0, c.resume(e.toParams(t), a)) : (o && c.setSelectedModel(o), c.run(e.toParams(t), {
2033
2071
  model: o,
2034
2072
  openingMessage: s
2035
2073
  }).then((e) => {
2036
2074
  e && h(e);
2037
2075
  })));
2038
- }, [ee]), D(() => {
2076
+ }, [te]), D(() => {
2039
2077
  if (!p || !u) return;
2040
- let n = e.autoApplyDestinationIds ?? [], r = l.componentAnchors.find((t) => t.subagentId === e.id && t.pinnedEntityId)?.pinnedEntityId, i = be();
2078
+ let n = e.autoApplyDestinationIds ?? [], r = l.componentAnchors.find((t) => t.subagentId === e.id && t.pinnedEntityId)?.pinnedEntityId, i = xe();
2041
2079
  n.forEach((n) => {
2042
2080
  let a = i[n];
2043
2081
  a && (y(null), a.apply(p, {
@@ -2049,7 +2087,7 @@ function tn({ manifest: e, params: t, extraDestinations: n, precedingActivity: r
2049
2087
  ...t,
2050
2088
  pinnedEntityId: r
2051
2089
  }).then((n) => {
2052
- n?.id && l.commitEntityChat(e.id, n.id, f, u.id, t, Rt(e, t));
2090
+ n?.id && l.commitEntityChat(e.id, n.id, f, u.id, t, Ut(e, t));
2053
2091
  }).catch((e) => y(e instanceof Error ? e.message : String(e))));
2054
2092
  });
2055
2093
  }, [
@@ -2059,85 +2097,85 @@ function tn({ manifest: e, params: t, extraDestinations: n, precedingActivity: r
2059
2097
  ]), D(() => {
2060
2098
  p && x && w(x.defaultSelection(p));
2061
2099
  }, [p, x]);
2062
- let I = (e, t) => {
2100
+ let F = (e, t) => {
2063
2101
  w((n) => n && {
2064
2102
  ...n,
2065
2103
  [e]: t
2066
2104
  });
2067
- }, L = (e) => h(e), R = k(() => p && x && S ? x.applySelection(p, S) : p, [
2105
+ }, ne = (e) => h(e), I = k(() => p && x && S ? x.applySelection(p, S) : p, [
2068
2106
  p,
2069
2107
  x,
2070
2108
  S
2071
- ]), z = k(() => l.componentAnchors.filter((t) => t.subagentId === e.id && t.onResult), [l.componentAnchors, e.id]), B = k(() => Wt(z, t, f), [
2072
- z,
2109
+ ]), re = k(() => l.componentAnchors.filter((t) => t.subagentId === e.id && t.onResult), [l.componentAnchors, e.id]), L = k(() => Yt(re, t, f), [
2110
+ re,
2073
2111
  t,
2074
2112
  f
2075
- ]), te = k(() => B ? [B, ...n ?? []] : n, [B, n]), V = e.chatEntityId?.(t), H = Qt(u?.id), U = A(!1), W = A(!1);
2113
+ ]), ie = k(() => L ? [L, ...n ?? []] : n, [L, n]), R = e.chatEntityId?.(t), z = rn(u?.id), B = A(!1), V = A(!1);
2076
2114
  D(() => {
2077
- let n = !U.current && c.running, i = U.current && !c.running;
2078
- if (U.current = c.running, !n && !i || !V || !u) return;
2079
- if (W.current) {
2080
- i && (W.current = !1);
2115
+ let n = !B.current && c.running, i = B.current && !c.running;
2116
+ if (B.current = c.running, !n && !i || !R || !u) return;
2117
+ if (V.current) {
2118
+ i && (V.current = !1);
2081
2119
  return;
2082
2120
  }
2083
2121
  let a = c.snapshot();
2084
2122
  if (!a) return;
2085
2123
  let o = [...r ?? [], ...a.activity];
2086
- e.autoTitle && e.definition.conversational && !Re({ activity: o }) || (Ne({
2124
+ e.autoTitle && e.definition.conversational && !Ue({ activity: o }) || (Re({
2087
2125
  scopeId: u.id,
2088
2126
  subagentId: e.id,
2089
- entityId: V,
2127
+ entityId: R,
2090
2128
  params: t,
2091
- title: Rt(e, t),
2129
+ title: Ut(e, t),
2092
2130
  history: a.history,
2093
2131
  activity: o
2094
- }), i && e.autoTitle && H(e.id, V, c.selectedModel));
2132
+ }), i && e.autoTitle && z(e.id, R, c.selectedModel));
2095
2133
  }, [c.running]);
2096
- let G = () => {
2097
- F.current = !0, c.running && c.stop(), l.closeTask(f);
2098
- }, K = A(qt(e.id) ?? en).current, q = K({
2134
+ let H = () => {
2135
+ P.current = !0, c.running && c.stop(), l.closeTask(f);
2136
+ }, U = A(Qt(e.id) ?? on).current, W = U({
2099
2137
  params: t,
2100
2138
  taskId: f,
2101
2139
  running: c.running,
2102
- close: G
2103
- }), ne = (e) => {
2140
+ close: H
2141
+ }), ae = (e) => {
2104
2142
  _((t) => t.includes(e) ? t : [...t, e]);
2105
2143
  };
2106
2144
  return D(() => {
2107
- F.current || l.openTask({
2145
+ P.current || l.openTask({
2108
2146
  id: f,
2109
- title: Rt(e, t),
2147
+ title: Ut(e, t),
2110
2148
  icon: e.icon,
2111
2149
  agent: c,
2112
2150
  onApplied: (e) => h(e),
2113
2151
  precedingActivity: r,
2114
2152
  panelExtraAnchorIndex: E.current,
2115
- onDismiss: G,
2116
- ...V ? { savedToDisk: !0 } : {},
2117
- panelActions: q.content,
2118
- composerActions: q.actions,
2119
- composerCommands: q.commands,
2120
- panelExtra: p ? /* @__PURE__ */ P(M, { children: [
2121
- x && S ? /* @__PURE__ */ N(x.Report, {
2153
+ onDismiss: H,
2154
+ ...R ? { savedToDisk: !0 } : {},
2155
+ panelActions: W.content,
2156
+ composerActions: W.actions,
2157
+ composerCommands: W.commands,
2158
+ panelExtra: p ? /* @__PURE__ */ N(ee, { children: [
2159
+ x && S ? /* @__PURE__ */ M(x.Report, {
2122
2160
  result: p,
2123
2161
  selection: S,
2124
- onChange: I
2125
- }) : b?.kind === "editable" ? /* @__PURE__ */ N(b.Report, {
2162
+ onChange: F
2163
+ }) : b?.kind === "editable" ? /* @__PURE__ */ M(b.Report, {
2126
2164
  result: p,
2127
- onResultChange: L
2128
- }) : /* @__PURE__ */ N(Ut, { result: R }),
2129
- v && /* @__PURE__ */ P("p", {
2165
+ onResultChange: ne
2166
+ }) : /* @__PURE__ */ M(Jt, { result: I }),
2167
+ v && /* @__PURE__ */ N("p", {
2130
2168
  className: "text-xs text-destructive",
2131
2169
  children: ["Salvataggio automatico non riuscito: ", v]
2132
2170
  }),
2133
- /* @__PURE__ */ N(zt, {
2171
+ /* @__PURE__ */ M(Wt, {
2134
2172
  manifest: e,
2135
- result: R,
2173
+ result: I,
2136
2174
  meta: t,
2137
2175
  taskId: f,
2138
2176
  initiallyApplied: g,
2139
- onApplied: ne,
2140
- extraDestinations: te
2177
+ onApplied: ae,
2178
+ extraDestinations: ie
2141
2179
  })
2142
2180
  ] }) : void 0
2143
2181
  });
@@ -2156,29 +2194,29 @@ function tn({ manifest: e, params: t, extraDestinations: n, precedingActivity: r
2156
2194
  e,
2157
2195
  t,
2158
2196
  p,
2159
- R,
2197
+ I,
2160
2198
  S,
2161
2199
  g,
2162
2200
  n,
2163
2201
  r,
2164
2202
  v,
2165
- q.content,
2166
- q.actions,
2167
- q.commands
2203
+ W.content,
2204
+ W.actions,
2205
+ W.commands
2168
2206
  ]), D(() => () => {
2169
2207
  l.closeTask(f);
2170
2208
  }, [l.closeTask, f]), null;
2171
2209
  }
2172
2210
  //#endregion
2173
2211
  //#region src/presentation/OrchestratorRunner.tsx
2174
- function nn({ userGoal: e }) {
2175
- let t = Q(), n = Mt(k(() => Lt({
2212
+ function cn({ userGoal: e }) {
2213
+ let t = Q(), n = Lt(k(() => Ht({
2176
2214
  unavailable: t.orchestratorUnavailable,
2177
2215
  continueWithoutAi: t.orchestratorContinueWithoutAi,
2178
2216
  preparing: t.orchestratorPreparing,
2179
2217
  collecting: t.orchestratorCollecting
2180
2218
  }), []), { 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) => {
2181
- e && typeof e == "object" && e.kind === "handoff" && (a(e), r.closeTask(Ke));
2219
+ e && typeof e == "object" && e.kind === "handoff" && (a(e), r.closeTask(Ze));
2182
2220
  };
2183
2221
  D(() => {
2184
2222
  !o.current && s && (o.current = !0, u.current && n.setSelectedModel(u.current), n.run({
@@ -2194,7 +2232,7 @@ function nn({ userGoal: e }) {
2194
2232
  }));
2195
2233
  }, [s]), D(() => {
2196
2234
  p.current || r.openTask({
2197
- id: Ke,
2235
+ id: Ze,
2198
2236
  title: "Agentico",
2199
2237
  icon: "bot",
2200
2238
  agent: n,
@@ -2202,7 +2240,7 @@ function nn({ userGoal: e }) {
2202
2240
  scopedSubagentId: d.current,
2203
2241
  precedingActivity: f.current?.activity,
2204
2242
  onDismiss: () => {
2205
- p.current = !0, n.running && n.stop(), r.closeTask(Ke);
2243
+ p.current = !0, n.running && n.stop(), r.closeTask(Ze);
2206
2244
  }
2207
2245
  });
2208
2246
  }, [
@@ -2215,12 +2253,12 @@ function nn({ userGoal: e }) {
2215
2253
  n.hasProviders,
2216
2254
  r.openTask
2217
2255
  ]), D(() => () => {
2218
- r.closeTask(Ke);
2256
+ r.closeTask(Ze);
2219
2257
  }, [r.closeTask]);
2220
2258
  let h = k(() => [...f.current?.activity ?? [], ...n.activity], [n.activity]);
2221
2259
  if (!i) return null;
2222
- let g = H(i.subagentId);
2223
- return g ? /* @__PURE__ */ N(tn, {
2260
+ let g = z(i.subagentId);
2261
+ return g ? /* @__PURE__ */ M(sn, {
2224
2262
  manifest: g,
2225
2263
  params: i.params,
2226
2264
  extraDestinations: c.current,
@@ -2231,8 +2269,8 @@ function nn({ userGoal: e }) {
2231
2269
  }
2232
2270
  //#endregion
2233
2271
  //#region src/presentation/ManualEntryRunner.tsx
2234
- function rn({ manifest: e, extraDestinations: n }) {
2235
- 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) => {
2272
+ function ln({ manifest: e, extraDestinations: n }) {
2273
+ let r = Lt(e.definition, { defaultEnabled: !1 }), i = Q(), a = $(), o = A(`manual-${e.id}-${crypto.randomUUID()}`).current, [s, c] = j(null), [l, u] = j([]), d = qt(e.id), f = d?.kind === "selection" ? d : null, [p, m] = j(null), [h, g] = j(null), _ = A(!1), v = (t) => {
2236
2274
  if (!e.manualEntry) return;
2237
2275
  let n;
2238
2276
  try {
@@ -2259,7 +2297,7 @@ function rn({ manifest: e, extraDestinations: n }) {
2259
2297
  p
2260
2298
  ]), S = (e) => {
2261
2299
  u((t) => t.includes(e) ? t : [...t, e]);
2262
- }, C = k(() => a.componentAnchors.filter((t) => t.subagentId === e.id && t.onResult), [a.componentAnchors, e.id]), w = k(() => h ? Wt(C, h, o) : null, [
2300
+ }, C = k(() => a.componentAnchors.filter((t) => t.subagentId === e.id && t.onResult), [a.componentAnchors, e.id]), w = k(() => h ? Yt(C, h, o) : null, [
2263
2301
  C,
2264
2302
  h,
2265
2303
  o
@@ -2278,18 +2316,18 @@ function rn({ manifest: e, extraDestinations: n }) {
2278
2316
  onDismiss: () => {
2279
2317
  _.current = !0, r.running && r.stop(), a.closeTask(o);
2280
2318
  },
2281
- panelExtra: s ? /* @__PURE__ */ P("div", {
2319
+ panelExtra: s ? /* @__PURE__ */ N("div", {
2282
2320
  className: "space-y-2",
2283
2321
  children: [
2284
- f && p ? /* @__PURE__ */ N(f.Report, {
2322
+ f && p ? /* @__PURE__ */ M(f.Report, {
2285
2323
  result: s,
2286
2324
  selection: p,
2287
2325
  onChange: y
2288
- }) : d?.kind === "editable" ? /* @__PURE__ */ N(d.Report, {
2326
+ }) : d?.kind === "editable" ? /* @__PURE__ */ M(d.Report, {
2289
2327
  result: s,
2290
2328
  onResultChange: b
2291
- }) : /* @__PURE__ */ N(Ut, { result: x }),
2292
- /* @__PURE__ */ N(zt, {
2329
+ }) : /* @__PURE__ */ M(Jt, { result: x }),
2330
+ /* @__PURE__ */ M(Wt, {
2293
2331
  manifest: e,
2294
2332
  result: x,
2295
2333
  meta: h ?? {},
@@ -2298,7 +2336,7 @@ function rn({ manifest: e, extraDestinations: n }) {
2298
2336
  onApplied: S,
2299
2337
  extraDestinations: T
2300
2338
  }),
2301
- r.hasProviders && /* @__PURE__ */ N(t, {
2339
+ r.hasProviders && /* @__PURE__ */ M(t, {
2302
2340
  label: i.resumeWithAi,
2303
2341
  variant: "outline-secondary",
2304
2342
  className: "text-xs",
@@ -2326,7 +2364,7 @@ function rn({ manifest: e, extraDestinations: n }) {
2326
2364
  }
2327
2365
  //#endregion
2328
2366
  //#region src/presentation/Agentico.tsx
2329
- function an(e, t) {
2367
+ function un(e, t) {
2330
2368
  return Object.values(e).flat().map((e) => {
2331
2369
  let n = t?.(e.provider, e.providerLabel ?? e.provider);
2332
2370
  return {
@@ -2338,7 +2376,7 @@ function an(e, t) {
2338
2376
  };
2339
2377
  });
2340
2378
  }
2341
- function on({ task: e }) {
2379
+ function dn({ task: e }) {
2342
2380
  let t = Q(), [n, r] = j(""), { agent: i, onApplied: a, manualEntry: s } = e, c = i.running, l = (e) => {
2343
2381
  if (r(""), s) {
2344
2382
  s.onSubmit(e.text);
@@ -2350,8 +2388,8 @@ function on({ task: e }) {
2350
2388
  }).then((e) => {
2351
2389
  e && a(e);
2352
2390
  });
2353
- }, 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);
2354
- return /* @__PURE__ */ N(o, {
2391
+ }, 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, ...un(i.modelsByProvider, i.catalogGroup)] : un(i.modelsByProvider);
2392
+ return /* @__PURE__ */ M(o, {
2355
2393
  value: n,
2356
2394
  onChange: r,
2357
2395
  placeholder: s?.prompt ?? t.messagePlaceholder,
@@ -2370,21 +2408,21 @@ function on({ task: e }) {
2370
2408
  maxHeight: 220
2371
2409
  });
2372
2410
  }
2373
- function sn() {
2374
- let { startOrchestrator: e } = $(), t = Q(), [n, r] = j(""), { hasProviders: i, modelsByProvider: a, selectedModel: s, setSelectedModel: c } = Tt(), l = (t) => {
2411
+ function fn() {
2412
+ let { startOrchestrator: e } = $(), t = Q(), [n, r] = j(""), { hasProviders: i, modelsByProvider: a, selectedModel: s, setSelectedModel: c } = At(), l = (t) => {
2375
2413
  t.text.trim() && (e(t.text.trim(), {
2376
2414
  attachments: t.files.length > 0 ? t.files : void 0,
2377
2415
  model: t.model || void 0
2378
2416
  }), r(""));
2379
2417
  }, u = i && !s;
2380
- return /* @__PURE__ */ N(o, {
2418
+ return /* @__PURE__ */ M(o, {
2381
2419
  value: n,
2382
2420
  onChange: r,
2383
2421
  placeholder: t.orchestratorStarterPlaceholder,
2384
2422
  disabled: !n.trim() || u,
2385
2423
  onSubmit: l,
2386
2424
  attachments: !0,
2387
- models: an(a),
2425
+ models: un(a),
2388
2426
  selectedModel: s,
2389
2427
  onModelChange: c,
2390
2428
  modelPlaceholder: t.selectModelPlaceholder,
@@ -2392,30 +2430,30 @@ function sn() {
2392
2430
  maxHeight: 220
2393
2431
  });
2394
2432
  }
2395
- function cn({ chat: e, onClose: t }) {
2433
+ function pn({ chat: e, onClose: t }) {
2396
2434
  let n = Q(), r = x();
2397
- return /* @__PURE__ */ N(p, {
2435
+ return /* @__PURE__ */ M(p, {
2398
2436
  title: n.renameChat,
2399
2437
  size: "sm",
2400
2438
  onClose: t,
2401
- onSave: () => (Be(e.scopeId, e.subagentId, e.entityId, String(r.record?.title ?? Le(e)), "person"), t(), Promise.resolve(!0)),
2402
- children: /* @__PURE__ */ P(u, {
2439
+ onSave: () => (Ge(e.scopeId, e.subagentId, e.entityId, String(r.record?.title ?? He(e)), "person"), t(), Promise.resolve(!0)),
2440
+ children: /* @__PURE__ */ N(u, {
2403
2441
  appearance: "empty",
2404
2442
  controller: r,
2405
- defaultValues: { title: Le(e) },
2443
+ defaultValues: { title: He(e) },
2406
2444
  footer: !1,
2407
- children: [/* @__PURE__ */ N(f, {
2445
+ children: [/* @__PURE__ */ M(f, {
2408
2446
  name: "title",
2409
2447
  label: n.chatTitleLabel,
2410
2448
  placeholder: e.title
2411
- }), /* @__PURE__ */ N("p", {
2449
+ }), /* @__PURE__ */ M("p", {
2412
2450
  className: "text-xs text-muted-foreground",
2413
2451
  children: n.chatTitleHint
2414
2452
  })]
2415
2453
  })
2416
2454
  });
2417
2455
  }
2418
- function ln(e, t, n = Date.now()) {
2456
+ function mn(e, t, n = Date.now()) {
2419
2457
  let r = Math.round((e - n) / 1e3), i = new Intl.RelativeTimeFormat(t, {
2420
2458
  numeric: "auto",
2421
2459
  style: "short"
@@ -2427,55 +2465,55 @@ function ln(e, t, n = Date.now()) {
2427
2465
  ]) if (Math.abs(r) >= t) return i.format(Math.round(r / t), e);
2428
2466
  return i.format(0, "minute");
2429
2467
  }
2430
- function un({ card: e }) {
2468
+ function hn({ card: e }) {
2431
2469
  let t = Q();
2432
- return e.humanSummaryOnly ? /* @__PURE__ */ P("div", {
2470
+ return e.humanSummaryOnly ? /* @__PURE__ */ N("div", {
2433
2471
  className: "space-y-2 rounded-lg border border-border/60 p-3",
2434
- children: [/* @__PURE__ */ P("p", {
2472
+ children: [/* @__PURE__ */ N("p", {
2435
2473
  className: "text-xs font-medium text-foreground",
2436
2474
  children: [
2437
2475
  "\"",
2438
2476
  e.label,
2439
2477
  "\""
2440
2478
  ]
2441
- }), /* @__PURE__ */ N("p", {
2479
+ }), /* @__PURE__ */ M("p", {
2442
2480
  className: "text-xs text-muted-foreground",
2443
2481
  children: e.humanSummary
2444
2482
  })]
2445
- }) : /* @__PURE__ */ P("div", {
2483
+ }) : /* @__PURE__ */ N("div", {
2446
2484
  className: "space-y-2 rounded-lg border border-border/60 p-3",
2447
2485
  children: [
2448
- /* @__PURE__ */ N("p", {
2486
+ /* @__PURE__ */ M("p", {
2449
2487
  className: "text-xs font-medium text-foreground",
2450
2488
  children: _(t.newInstance, { label: e.label })
2451
2489
  }),
2452
- /* @__PURE__ */ N("p", {
2490
+ /* @__PURE__ */ M("p", {
2453
2491
  className: "text-xs text-muted-foreground",
2454
2492
  children: e.humanSummary
2455
2493
  }),
2456
- e.fields.length > 0 && /* @__PURE__ */ N("ul", {
2494
+ e.fields.length > 0 && /* @__PURE__ */ M("ul", {
2457
2495
  className: "space-y-1",
2458
- children: e.fields.map((e) => /* @__PURE__ */ P("li", {
2496
+ children: e.fields.map((e) => /* @__PURE__ */ N("li", {
2459
2497
  className: "flex items-start gap-1.5 text-xs",
2460
- children: [/* @__PURE__ */ N(n, {
2498
+ children: [/* @__PURE__ */ M(n, {
2461
2499
  variant: e.required ? "primary" : "secondary",
2462
2500
  className: "mt-px shrink-0",
2463
2501
  children: e.required ? "richiesto" : "opzionale"
2464
- }), /* @__PURE__ */ P("span", {
2502
+ }), /* @__PURE__ */ N("span", {
2465
2503
  className: "min-w-0",
2466
- children: [/* @__PURE__ */ N("span", {
2504
+ children: [/* @__PURE__ */ M("span", {
2467
2505
  className: "font-mono text-foreground",
2468
2506
  children: e.key
2469
- }), e.humanDescription ? /* @__PURE__ */ P("span", {
2507
+ }), e.humanDescription ? /* @__PURE__ */ N("span", {
2470
2508
  className: "text-muted-foreground",
2471
2509
  children: [" — ", e.humanDescription]
2472
2510
  }) : null]
2473
2511
  })]
2474
2512
  }, e.key))
2475
2513
  }),
2476
- e.example && /* @__PURE__ */ P("p", {
2514
+ e.example && /* @__PURE__ */ N("p", {
2477
2515
  className: "text-xs text-muted-foreground",
2478
- children: ["Esempio: ", /* @__PURE__ */ N("span", {
2516
+ children: ["Esempio: ", /* @__PURE__ */ M("span", {
2479
2517
  className: "font-mono",
2480
2518
  children: e.example
2481
2519
  })]
@@ -2483,40 +2521,40 @@ function un({ card: e }) {
2483
2521
  ]
2484
2522
  });
2485
2523
  }
2486
- function dn({ messages: e }) {
2487
- return /* @__PURE__ */ N("div", {
2524
+ function gn({ messages: e }) {
2525
+ return /* @__PURE__ */ M("div", {
2488
2526
  className: "space-y-2 rounded-lg border border-border/60 p-3",
2489
- children: e.map((e, t) => /* @__PURE__ */ N("p", {
2527
+ children: e.map((e, t) => /* @__PURE__ */ M("p", {
2490
2528
  className: "text-xs text-muted-foreground",
2491
2529
  children: e
2492
2530
  }, t))
2493
2531
  });
2494
2532
  }
2495
- function fn({ scopeId: e, currentTaskId: n, open: r, onOpenChange: i, onSelect: a, onNewChat: o, onArchivedCurrent: s }) {
2533
+ function _n({ scopeId: e, currentTaskId: n, open: r, onOpenChange: i, onSelect: a, onNewChat: o, onArchivedCurrent: s }) {
2496
2534
  let u = Q(), { locale: f } = S(), [p, m] = j(""), [h, g] = j(0);
2497
- D(() => ke(() => g((e) => e + 1)), []);
2498
- let _ = k(() => r ? Ue(e) : [], [
2535
+ D(() => Fe(() => g((e) => e + 1)), []);
2536
+ let _ = k(() => r ? Je(e) : [], [
2499
2537
  e,
2500
2538
  r,
2501
2539
  h
2502
2540
  ]), [v, y] = j(null), b = async (t) => {
2503
- let r = H(t.subagentId), i = await r?.confirmArchive?.(t.entityId, t.params);
2541
+ let r = z(t.subagentId), i = await r?.confirmArchive?.(t.entityId, t.params);
2504
2542
  if (!i || window.confirm(i)) {
2505
2543
  try {
2506
2544
  await r?.onArchive?.(t.entityId, t.params);
2507
2545
  } catch {
2508
2546
  return;
2509
2547
  }
2510
- He(e, t.subagentId, t.entityId), n === We(t.subagentId, t.entityId) && s(), g((e) => e + 1);
2548
+ qe(e, t.subagentId, t.entityId), n === Ye(t.subagentId, t.entityId) && s(), g((e) => e + 1);
2511
2549
  }
2512
2550
  }, x = k(() => {
2513
2551
  let e = p.trim().toLowerCase();
2514
2552
  return e ? _.filter((t) => {
2515
- let n = H(t.subagentId)?.label ?? t.subagentId;
2516
- return Le(t).toLowerCase().includes(e) || n.toLowerCase().includes(e);
2553
+ let n = z(t.subagentId)?.label ?? t.subagentId;
2554
+ return He(t).toLowerCase().includes(e) || n.toLowerCase().includes(e);
2517
2555
  }) : _;
2518
2556
  }, [_, p]);
2519
- return /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N(c, {
2557
+ return /* @__PURE__ */ N(ee, { children: [/* @__PURE__ */ M(c, {
2520
2558
  trigger: {
2521
2559
  icon: "history",
2522
2560
  title: u.chatHistory
@@ -2527,22 +2565,22 @@ function fn({ scopeId: e, currentTaskId: n, open: r, onOpenChange: i, onSelect:
2527
2565
  position: "end",
2528
2566
  strategy: "absolute",
2529
2567
  menuClassName: "w-[380px] max-h-[70vh] overflow-y-auto",
2530
- header: /* @__PURE__ */ P("div", {
2568
+ header: /* @__PURE__ */ N("div", {
2531
2569
  className: "flex items-center gap-2 px-1 pb-1.5",
2532
2570
  children: [
2533
- /* @__PURE__ */ N(d, {
2571
+ /* @__PURE__ */ M(d, {
2534
2572
  name: "search",
2535
2573
  size: 14,
2536
2574
  className: "shrink-0 text-muted-foreground"
2537
2575
  }),
2538
- /* @__PURE__ */ N("input", {
2576
+ /* @__PURE__ */ M("input", {
2539
2577
  autoFocus: !0,
2540
2578
  value: p,
2541
2579
  onChange: (e) => m(e.target.value),
2542
2580
  placeholder: u.searchChats,
2543
2581
  className: "min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground"
2544
2582
  }),
2545
- /* @__PURE__ */ N(t, {
2583
+ /* @__PURE__ */ M(t, {
2546
2584
  icon: "square-pen",
2547
2585
  ariaLabel: u.newChat,
2548
2586
  title: u.newChat,
@@ -2552,12 +2590,12 @@ function fn({ scopeId: e, currentTaskId: n, open: r, onOpenChange: i, onSelect:
2552
2590
  })
2553
2591
  ]
2554
2592
  }),
2555
- children: x.length === 0 ? /* @__PURE__ */ N("p", {
2593
+ children: x.length === 0 ? /* @__PURE__ */ M("p", {
2556
2594
  className: "px-2 py-3 text-center text-xs text-muted-foreground",
2557
2595
  children: _.length === 0 ? u.noSavedChats : u.noResults
2558
2596
  }) : x.map((e) => {
2559
- let t = H(e.subagentId), r = n === We(e.subagentId, e.entityId);
2560
- return /* @__PURE__ */ N(l, {
2597
+ let t = z(e.subagentId), r = n === Ye(e.subagentId, e.entityId);
2598
+ return /* @__PURE__ */ M(l, {
2561
2599
  icon: r ? "check" : t?.icon ?? "bot",
2562
2600
  className: r ? "bg-accent font-semibold text-primary" : void 0,
2563
2601
  actions: [{
@@ -2572,163 +2610,163 @@ function fn({ scopeId: e, currentTaskId: n, open: r, onOpenChange: i, onSelect:
2572
2610
  onClick: () => void b(e)
2573
2611
  }],
2574
2612
  onClick: () => a(e.subagentId, e.entityId, e),
2575
- children: /* @__PURE__ */ P("span", {
2613
+ children: /* @__PURE__ */ N("span", {
2576
2614
  className: "flex min-w-0 flex-1 items-center justify-between gap-2",
2577
- children: [/* @__PURE__ */ N("span", {
2615
+ children: [/* @__PURE__ */ M("span", {
2578
2616
  className: "min-w-0 truncate",
2579
- title: `${t?.label ?? e.subagentId} · ${Le(e)}`,
2580
- children: Le(e)
2581
- }), /* @__PURE__ */ N("span", {
2617
+ title: `${t?.label ?? e.subagentId} · ${He(e)}`,
2618
+ children: He(e)
2619
+ }), /* @__PURE__ */ M("span", {
2582
2620
  className: "shrink-0 text-xs text-muted-foreground",
2583
- title: `${u.chatStarted.replace("{at}", new Date(Ve(e)).toLocaleString(f))} · ${u.chatLastMessage.replace("{at}", new Date(e.savedAt).toLocaleString(f))}`,
2584
- children: ln(Ve(e), f)
2621
+ title: `${u.chatStarted.replace("{at}", new Date(Ke(e)).toLocaleString(f))} · ${u.chatLastMessage.replace("{at}", new Date(e.savedAt).toLocaleString(f))}`,
2622
+ children: mn(Ke(e), f)
2585
2623
  })]
2586
2624
  })
2587
2625
  }, `${e.subagentId}:${e.entityId}`);
2588
2626
  })
2589
- }), v && /* @__PURE__ */ N(cn, {
2627
+ }), v && /* @__PURE__ */ M(pn, {
2590
2628
  chat: v,
2591
2629
  onClose: () => y(null)
2592
2630
  })] });
2593
2631
  }
2594
- function pn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}) {
2632
+ function vn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}) {
2595
2633
  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);
2596
- Qt(w?.id);
2597
- let F = yt({
2634
+ rn(w?.id);
2635
+ let P = wt({
2598
2636
  defaultWidth: e,
2599
2637
  minWidth: n,
2600
2638
  maxWidth: r,
2601
2639
  onWidthChange: i
2602
- }), ee = () => {
2640
+ }), te = () => {
2603
2641
  (!a || a.agent.running || a.savedToDisk || window.confirm(T.unsavedConversationConfirm)) && (m(), k(!1));
2604
- }, I = a ? [...a.precedingActivity ?? [], ...a.agent.activity] : [], L = I.length, R = Math.max(0, Math.min(a?.panelExtraAnchorIndex ?? L, L)), z = I.slice(0, R), B = I.slice(R), te = !!(a && !a.agent.running && a.agent.error), V = new Set(a?.agent.activity.map((e) => e.id) ?? []), U = a ? {
2605
- canAnswer: (e) => V.has(e),
2642
+ }, F = a ? [...a.precedingActivity ?? [], ...a.agent.activity] : [], ne = F.length, I = Math.max(0, Math.min(a?.panelExtraAnchorIndex ?? ne, ne)), re = F.slice(0, I), L = F.slice(I), ie = !!(a && !a.agent.running && a.agent.error), R = new Set(a?.agent.activity.map((e) => e.id) ?? []), B = a ? {
2643
+ canAnswer: (e) => R.has(e),
2606
2644
  onAnswer: (e, t, n) => a.agent.answerQuestions(e, t, n).then((e) => {
2607
2645
  e && a.onApplied(e);
2608
2646
  })
2609
- } : 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);
2647
+ } : void 0, V = B ? ut(F, B.canAnswer) : null, H = a?.id === "agentico-orchestrator" && a.scopedSubagentId ? z(a.scopedSubagentId) : void 0, U = H?.manualEntry ? H : null, W = A(!0);
2610
2648
  D(() => {
2611
2649
  let e = E.current;
2612
2650
  if (!e) return;
2613
2651
  let t = () => {
2614
- q.current = e.scrollHeight - e.scrollTop - e.clientHeight < 80;
2652
+ W.current = e.scrollHeight - e.scrollTop - e.clientHeight < 80;
2615
2653
  };
2616
2654
  return e.addEventListener("scroll", t), () => e.removeEventListener("scroll", t);
2617
2655
  }, [a?.id]), D(() => {
2618
2656
  let e = E.current;
2619
- e && (q.current = !0, e.scrollTop = e.scrollHeight);
2657
+ e && (W.current = !0, e.scrollTop = e.scrollHeight);
2620
2658
  }, [a?.id]);
2621
- let ne = I.at(-1)?.detail?.length ?? 0;
2659
+ let ae = F.at(-1)?.detail?.length ?? 0;
2622
2660
  D(() => {
2623
2661
  let e = E.current;
2624
- e && q.current && (e.scrollTop = e.scrollHeight);
2662
+ e && W.current && (e.scrollTop = e.scrollHeight);
2625
2663
  }, [
2626
- L,
2627
- te,
2628
- ne
2664
+ ne,
2665
+ ie,
2666
+ ae
2629
2667
  ]);
2630
- let J = A(null);
2668
+ let oe = A(null);
2631
2669
  D(() => {
2632
- let e = E.current, t = J.current;
2670
+ let e = E.current, t = oe.current;
2633
2671
  if (!e || !t || typeof ResizeObserver > "u") return;
2634
2672
  let n = new ResizeObserver(() => {
2635
- q.current && (e.scrollTop = e.scrollHeight);
2673
+ W.current && (e.scrollTop = e.scrollHeight);
2636
2674
  });
2637
2675
  return n.observe(t), () => n.disconnect();
2638
2676
  }, [a?.id, o]);
2639
- let Y = s ? /* @__PURE__ */ N(nn, { userGoal: s }, c) : null, re = f ? H(f.subagentId) : void 0, ie = f && re ? /* @__PURE__ */ N(tn, {
2640
- manifest: re,
2677
+ let G = s ? /* @__PURE__ */ M(cn, { userGoal: s }, c) : null, se = f ? z(f.subagentId) : void 0, ce = f && se ? /* @__PURE__ */ M(sn, {
2678
+ manifest: se,
2641
2679
  params: f.snapshot.params,
2642
- taskId: We(f.subagentId, f.entityId),
2680
+ taskId: Ye(f.subagentId, f.entityId),
2643
2681
  resumeSeed: {
2644
2682
  history: f.snapshot.history,
2645
2683
  activity: f.snapshot.activity
2646
2684
  }
2647
- }, p) : null, X = g ? H(g.subagentId) : void 0, ae = g && X ? /* @__PURE__ */ N(rn, {
2648
- manifest: X,
2685
+ }, p) : null, K = g ? z(g.subagentId) : void 0, le = g && K ? /* @__PURE__ */ M(ln, {
2686
+ manifest: K,
2649
2687
  extraDestinations: g.extraDestinations
2650
- }, _) : null, oe = b ? H(b.subagentId) : void 0, se = b && oe ? /* @__PURE__ */ N(tn, {
2651
- manifest: oe,
2688
+ }, _) : null, ue = b ? z(b.subagentId) : void 0, q = b && ue ? /* @__PURE__ */ M(sn, {
2689
+ manifest: ue,
2652
2690
  params: b.params,
2653
2691
  extraDestinations: b.extraDestinations
2654
- }, x) : null, Z = S ? H(S.subagentId) : void 0, ce = S && Z ? /* @__PURE__ */ N(tn, {
2655
- manifest: Z,
2692
+ }, x) : null, J = S ? z(S.subagentId) : void 0, de = S && J ? /* @__PURE__ */ M(sn, {
2693
+ manifest: J,
2656
2694
  params: S.params,
2657
2695
  taskId: S.taskId,
2658
2696
  openingMessage: S.openingMessage
2659
2697
  }, C) : null;
2660
- return o ? /* @__PURE__ */ P(M, { children: [
2661
- Y,
2662
- ie,
2663
- ae,
2664
- se,
2698
+ return o ? /* @__PURE__ */ N(ee, { children: [
2699
+ G,
2665
2700
  ce,
2666
- /* @__PURE__ */ P("div", {
2667
- style: { width: F.width },
2701
+ le,
2702
+ q,
2703
+ de,
2704
+ /* @__PURE__ */ N("div", {
2705
+ style: { width: P.width },
2668
2706
  className: "relative flex h-full shrink-0 flex-col border-l border-border bg-background",
2669
2707
  children: [
2670
- /* @__PURE__ */ N(bt, {
2671
- width: F.width,
2672
- min: F.min,
2673
- max: F.max,
2674
- onResize: F.set,
2675
- onCommit: F.commit,
2676
- onReset: F.reset
2708
+ /* @__PURE__ */ M(Tt, {
2709
+ width: P.width,
2710
+ min: P.min,
2711
+ max: P.max,
2712
+ onResize: P.set,
2713
+ onCommit: P.commit,
2714
+ onReset: P.reset
2677
2715
  }),
2678
- /* @__PURE__ */ P("div", {
2716
+ /* @__PURE__ */ N("div", {
2679
2717
  className: "flex min-h-[60px] items-center gap-1 border-b border-border/60 px-4 py-3",
2680
2718
  children: [
2681
- /* @__PURE__ */ N("span", {
2719
+ /* @__PURE__ */ M("span", {
2682
2720
  className: "min-w-0 flex-1 truncate text-lg font-semibold leading-tight",
2683
2721
  children: a ? a.title : "Agentico"
2684
2722
  }),
2685
- w && /* @__PURE__ */ N(fn, {
2723
+ w && /* @__PURE__ */ M(_n, {
2686
2724
  scopeId: w.id,
2687
2725
  currentTaskId: a?.id ?? null,
2688
2726
  open: O,
2689
2727
  onOpenChange: k,
2690
- onNewChat: ee,
2728
+ onNewChat: te,
2691
2729
  onSelect: (e, t, n) => h(e, t, n),
2692
2730
  onArchivedCurrent: m
2693
2731
  }),
2694
- /* @__PURE__ */ N(xt, {})
2732
+ /* @__PURE__ */ M(Et, {})
2695
2733
  ]
2696
2734
  }),
2697
- /* @__PURE__ */ N("div", {
2735
+ /* @__PURE__ */ M("div", {
2698
2736
  ref: E,
2699
- className: `flex-1 overflow-y-auto px-3 pb-2 ${W ? "min-h-24" : "min-h-0"}`,
2700
- children: /* @__PURE__ */ N("div", {
2701
- ref: J,
2737
+ className: `flex-1 overflow-y-auto px-3 pb-2 ${V ? "min-h-24" : "min-h-0"}`,
2738
+ children: /* @__PURE__ */ M("div", {
2739
+ ref: oe,
2702
2740
  className: "pt-2",
2703
- children: a ? /* @__PURE__ */ P(M, { children: [
2704
- a.manualEntry && I.length === 0 && /* @__PURE__ */ N("p", {
2741
+ children: a ? /* @__PURE__ */ N(ee, { children: [
2742
+ a.manualEntry && F.length === 0 && /* @__PURE__ */ M("p", {
2705
2743
  className: "text-xs text-muted-foreground",
2706
2744
  children: a.manualEntry.prompt
2707
2745
  }),
2708
- /* @__PURE__ */ N(lt, {
2709
- activity: z,
2710
- questions: U,
2711
- docked: W,
2712
- pinUserMessages: !W
2746
+ /* @__PURE__ */ M(mt, {
2747
+ activity: re,
2748
+ questions: B,
2749
+ docked: V,
2750
+ pinUserMessages: !V
2713
2751
  }),
2714
- a.panelExtra && /* @__PURE__ */ N("div", {
2752
+ a.panelExtra && /* @__PURE__ */ M("div", {
2715
2753
  className: "mt-3",
2716
2754
  children: a.panelExtra
2717
2755
  }),
2718
- B.length > 0 && /* @__PURE__ */ N(lt, {
2719
- activity: B,
2720
- questions: U,
2721
- docked: W,
2722
- pinUserMessages: !W
2756
+ L.length > 0 && /* @__PURE__ */ M(mt, {
2757
+ activity: L,
2758
+ questions: B,
2759
+ docked: V,
2760
+ pinUserMessages: !V
2723
2761
  }),
2724
- !a.agent.running && a.agent.error && /* @__PURE__ */ P("div", {
2762
+ !a.agent.running && a.agent.error && /* @__PURE__ */ N("div", {
2725
2763
  className: "mt-2 flex items-center gap-2",
2726
2764
  children: [
2727
- /* @__PURE__ */ N("p", {
2765
+ /* @__PURE__ */ M("p", {
2728
2766
  className: "flex-1 text-xs text-destructive",
2729
2767
  children: a.agent.error
2730
2768
  }),
2731
- /* @__PURE__ */ N(t, {
2769
+ /* @__PURE__ */ M(t, {
2732
2770
  label: T.retry,
2733
2771
  variant: "secondary",
2734
2772
  className: "shrink-0",
@@ -2738,13 +2776,13 @@ function pn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
2738
2776
  });
2739
2777
  }
2740
2778
  }),
2741
- !a.agent.remote && /* @__PURE__ */ N(t, {
2779
+ !a.agent.remote && /* @__PURE__ */ M(t, {
2742
2780
  label: T.continueWithoutAi,
2743
2781
  variant: "secondary",
2744
2782
  className: "shrink-0",
2745
2783
  onClick: () => {
2746
- if (K) {
2747
- v(K.id, y);
2784
+ if (U) {
2785
+ v(U.id, y);
2748
2786
  return;
2749
2787
  }
2750
2788
  let e = a.agent.runFallback();
@@ -2753,32 +2791,32 @@ function pn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
2753
2791
  })
2754
2792
  ]
2755
2793
  })
2756
- ] }) : d.length > 0 ? /* @__PURE__ */ N(dn, { messages: d }) : u ? /* @__PURE__ */ N(un, { card: u }) : /* @__PURE__ */ N("p", {
2794
+ ] }) : d.length > 0 ? /* @__PURE__ */ M(gn, { messages: d }) : u ? /* @__PURE__ */ M(hn, { card: u }) : /* @__PURE__ */ M("p", {
2757
2795
  className: "text-xs text-muted-foreground",
2758
2796
  children: l ?? T.orchestratorStarterHint
2759
2797
  })
2760
2798
  })
2761
2799
  }),
2762
- a && W ? /* @__PURE__ */ P("section", {
2800
+ a && V ? /* @__PURE__ */ N("section", {
2763
2801
  "aria-label": T.pendingQuestions,
2764
2802
  className: "flex min-h-0 shrink flex-col border-t border-border/60",
2765
2803
  children: [
2766
- a.panelActions && /* @__PURE__ */ N("div", {
2804
+ a.panelActions && /* @__PURE__ */ M("div", {
2767
2805
  className: "shrink-0 px-4 pt-3",
2768
2806
  children: a.panelActions
2769
2807
  }),
2770
- /* @__PURE__ */ N("div", {
2808
+ /* @__PURE__ */ M("div", {
2771
2809
  className: "min-h-0 overflow-y-auto px-4 py-3",
2772
- children: /* @__PURE__ */ N(ot, {
2773
- entry: W.entry,
2774
- part: W.part,
2775
- questions: U,
2810
+ children: /* @__PURE__ */ M(dt, {
2811
+ entry: V.entry,
2812
+ part: V.part,
2813
+ questions: B,
2776
2814
  autoFocus: !0
2777
- }, `${W.entry.id}:${W.part.id}`)
2815
+ }, `${V.entry.id}:${V.part.id}`)
2778
2816
  }),
2779
- a.agent.running && /* @__PURE__ */ N("div", {
2817
+ a.agent.running && /* @__PURE__ */ M("div", {
2780
2818
  className: "flex shrink-0 justify-end px-4 pb-3",
2781
- children: /* @__PURE__ */ N(t, {
2819
+ children: /* @__PURE__ */ M(t, {
2782
2820
  icon: "square",
2783
2821
  label: T.stop,
2784
2822
  variant: "secondary",
@@ -2786,32 +2824,32 @@ function pn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
2786
2824
  })
2787
2825
  })
2788
2826
  ]
2789
- }) : /* @__PURE__ */ P("div", {
2827
+ }) : /* @__PURE__ */ N("div", {
2790
2828
  className: "border-t border-border/60 px-4 py-3",
2791
- children: [a?.panelActions && /* @__PURE__ */ N("div", {
2829
+ children: [a?.panelActions && /* @__PURE__ */ M("div", {
2792
2830
  className: "mb-2",
2793
2831
  children: a.panelActions
2794
- }), a ? /* @__PURE__ */ N(on, { task: a }, a.id) : /* @__PURE__ */ N(sn, {})]
2832
+ }), a ? /* @__PURE__ */ M(dn, { task: a }, a.id) : /* @__PURE__ */ M(fn, {})]
2795
2833
  })
2796
2834
  ]
2797
2835
  })
2798
- ] }) : /* @__PURE__ */ P(M, { children: [
2799
- Y,
2800
- ie,
2801
- ae,
2802
- se,
2803
- ce
2836
+ ] }) : /* @__PURE__ */ N(ee, { children: [
2837
+ G,
2838
+ ce,
2839
+ le,
2840
+ q,
2841
+ de
2804
2842
  ] });
2805
2843
  }
2806
2844
  //#endregion
2807
2845
  //#region src/presentation/useAgenticoPageContext.ts
2808
- function mn(e, t) {
2846
+ function yn(e, t) {
2809
2847
  let { setPageContext: n } = $(), r = A(crypto.randomUUID()).current;
2810
2848
  D(() => (n(r, e, t ?? null), () => n(r, null)), [e, t]);
2811
2849
  }
2812
2850
  //#endregion
2813
2851
  //#region src/presentation/useSubagentComponentContext.ts
2814
- function hn(e, t, n, r, i = !0, a) {
2852
+ function bn(e, t, n, r, i = !0, a) {
2815
2853
  let { registerComponentAnchor: o } = $(), s = A(crypto.randomUUID()).current, c = A(n);
2816
2854
  c.current = n, D(() => {
2817
2855
  if (i) return o(s, {
@@ -2830,6 +2868,6 @@ function hn(e, t, n, r, i = !0, a) {
2830
2868
  ]);
2831
2869
  }
2832
2870
  //#endregion
2833
- 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 };
2871
+ export { _t as AGENTICO_MAX_WIDTH, gt as AGENTICO_MIN_WIDTH, ht as AGENTICO_WIDTH, vt as AGENTICO_WIDTH_STORAGE_KEY, vn as Agentico, $e as AgenticoProvider, Et as AgenticoToggle, te as DEFAULT_REASONING_PART_ID, P as DEFAULT_TEXT_PART_ID, _e as JSON_EXPORT_DESTINATION_ID, pe as MICRO_PROMPT_REGISTRY, Ze as ORCHESTRATOR_TASK_ID, fe as SUMMARY_MICRO_PROMPT, we as agenticoDe, Se as agenticoEn, Ce as agenticoIt, oe as agenticoPromptsEn, G as agenticoPromptsIt, Xe as agenticoTranslations, me as applyMicroPrompts, Ue as chatHasPersonMessage, Ke as chatStartedAt, He as chatTitle, ce as configureAgenticoPrompts, De as configureEntityChatStore, H as createCrossAgentTools, re as defineSubagent, Ye as entityChatTaskId, X as extractErrorMessage, he as extractJsonBlock, z as findSubagentManifest, I as formatQuestionAnswers, K as getAgenticoPrompts, xe as getDestinationRegistry, Le as getEntityChat, Qt as getSubagentControls, R as getSubagentRegistry, qt as getSubagentReport, Oe as hasEntityChatBackend, ve as jsonExportDestination, Je as listEntityChats, ne as messagePartsText, Fe as onEntityChatsChange, V as registerCrossAgentTools, be as registerDestinations, Zt as registerSubagentControls, Kt as registerSubagentReports, ie as registerSubagents, qe as removeEntityChat, Ge as renameEntityChat, Y as renderRegistryCli, de as renderSubagentCli, le as resetAgenticoPrompts, Re as saveEntityChat, je as syncEntityChats, U as toJsonSchema, W as toMcpTool, F as upsertMessagePart, Lt as useAgent, $ as useAgentico, Q as useAgenticoI18n, yn as useAgenticoPageContext, bn as useSubagentComponentContext };
2834
2872
 
2835
2873
  //# sourceMappingURL=index.mjs.map