@llmnative/agentico 0.13.1 → 0.13.3

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
@@ -1003,32 +1003,46 @@ function pt({ entry: e, part: a, questions: o }) {
1003
1003
  children: a.badge.label
1004
1004
  })] }),
1005
1005
  footer: /* @__PURE__ */ I("div", {
1006
- className: "flex flex-wrap items-center gap-2 px-3 py-2",
1007
- children: [
1008
- a.details && /* @__PURE__ */ F(t, {
1009
- icon: "eye",
1010
- label: s.cardView,
1011
- variant: "outline-secondary",
1012
- onClick: () => l(!0)
1013
- }),
1014
- (a.actions ?? []).map((t) => /* @__PURE__ */ F(m, {
1015
- ...t.icon ? { icon: t.icon } : {},
1016
- label: t.label,
1017
- variant: t.variant ?? "outline-primary",
1018
- disabled: !u,
1019
- onClick: () => o.onCardAction(e.id, a.id, t.id)
1020
- }, t.id)),
1021
- a.outcome && /* @__PURE__ */ I("span", {
1022
- className: `text-xs ${d}`,
1023
- children: [a.outcome.text, a.outcome.link && /* @__PURE__ */ I(P, { children: [" ", /* @__PURE__ */ F("a", {
1024
- className: "underline",
1025
- href: a.outcome.link.url,
1026
- target: "_blank",
1027
- rel: "noopener noreferrer",
1028
- children: a.outcome.link.label
1029
- })] })]
1030
- })
1031
- ]
1006
+ className: "space-y-1.5 px-3 py-2",
1007
+ children: [/* @__PURE__ */ I("div", {
1008
+ className: "flex items-center gap-1",
1009
+ children: [
1010
+ a.details && /* @__PURE__ */ F(t, {
1011
+ icon: "eye",
1012
+ ariaLabel: s.cardView,
1013
+ title: s.cardView,
1014
+ variant: "outline-secondary",
1015
+ onClick: () => l(!0)
1016
+ }),
1017
+ (a.actions ?? []).filter((e) => e.variant !== "primary" && e.icon).map((t) => /* @__PURE__ */ F(m, {
1018
+ icon: t.icon,
1019
+ ariaLabel: t.label,
1020
+ title: t.label,
1021
+ variant: t.variant ?? "outline-secondary",
1022
+ disabled: !u,
1023
+ onClick: () => o.onCardAction(e.id, a.id, t.id)
1024
+ }, t.id)),
1025
+ /* @__PURE__ */ F("span", {
1026
+ className: "ms-auto flex items-center gap-1",
1027
+ children: (a.actions ?? []).filter((e) => e.variant === "primary" || !e.icon).map((t) => /* @__PURE__ */ F(m, {
1028
+ ...t.icon ? { icon: t.icon } : {},
1029
+ label: t.label,
1030
+ variant: t.variant ?? "outline-primary",
1031
+ disabled: !u,
1032
+ onClick: () => o.onCardAction(e.id, a.id, t.id)
1033
+ }, t.id))
1034
+ })
1035
+ ]
1036
+ }), a.outcome && /* @__PURE__ */ I("p", {
1037
+ className: `text-xs ${d}`,
1038
+ children: [a.outcome.text, a.outcome.link && /* @__PURE__ */ I(P, { children: [" ", /* @__PURE__ */ F("a", {
1039
+ className: "underline",
1040
+ href: a.outcome.link.url,
1041
+ target: "_blank",
1042
+ rel: "noopener noreferrer",
1043
+ children: a.outcome.link.label
1044
+ })] })]
1045
+ })]
1032
1046
  }),
1033
1047
  children: [a.body ? /* @__PURE__ */ F(i, {
1034
1048
  content: a.body,
@@ -1367,7 +1381,20 @@ var Rt = 20, zt = 26e4;
1367
1381
  function Bt(e) {
1368
1382
  return e.filter((e) => !g.isTextAttachment(e.mimeType) || e.base64.length <= zt);
1369
1383
  }
1370
- function Vt(e, t = {}) {
1384
+ function Vt(e) {
1385
+ return e.map((e) => e.status !== "running" && !e.parts?.some((e) => e.type === "tool" && e.status === "running" || (e.type === "text" || e.type === "reasoning") && e.streaming) ? e : {
1386
+ ...e,
1387
+ status: e.status === "running" ? "stopped" : e.status,
1388
+ ...e.parts ? { parts: e.parts.map((e) => e.type === "tool" && e.status === "running" ? {
1389
+ ...e,
1390
+ status: "stopped"
1391
+ } : (e.type === "text" || e.type === "reasoning") && e.streaming ? {
1392
+ ...e,
1393
+ streaming: !1
1394
+ } : e) } : {}
1395
+ });
1396
+ }
1397
+ function Ht(e, t = {}) {
1371
1398
  let { defaultEnabled: n = !1 } = t, [r, i] = N(n), { hasProviders: a, modelsByProvider: o, modelsLoading: s, selectedModel: c, setSelectedModel: l } = Pt(), [u, d] = N(!1), [f, p] = N(null), [m, h] = N(!1), [_, v] = N([]), y = M([]), x = (e) => {
1372
1399
  v((t) => {
1373
1400
  let n = typeof e == "function" ? e(t) : e;
@@ -1832,7 +1859,7 @@ function Vt(e, t = {}) {
1832
1859
  p(T.current.requestInProgress);
1833
1860
  return;
1834
1861
  }
1835
- D.current = !0, p(null), x(n.activity), d(!0);
1862
+ D.current = !0, p(null), x(Vt(n.activity)), d(!0);
1836
1863
  try {
1837
1864
  let i = await e.buildContext(t), a = { current: void 0 }, o = e.getTools?.(t, i, a) ?? [];
1838
1865
  E.current = {
@@ -1921,23 +1948,23 @@ function Vt(e, t = {}) {
1921
1948
  }
1922
1949
  //#endregion
1923
1950
  //#region src/domain/orchestrator/prompt.ts
1924
- function Ht() {
1951
+ function Ut() {
1925
1952
  let e = X();
1926
1953
  return [e.responseRulesHeading, ...e.responseRules.map((e) => `- ${e}`)].join("\n");
1927
1954
  }
1928
- function Ut(e, t, n) {
1955
+ function Wt(e, t, n) {
1929
1956
  let r = X(), i = n ? `\n${r.pageContextHeading}\n${r.pageContextIntro}\n${n}\n` : "";
1930
1957
  return `${r.orchestratorIntro}
1931
1958
 
1932
1959
  ${r.toolsHeading}
1933
1960
  ${t}
1934
1961
  ${i}
1935
- ${Ht()}
1962
+ ${Ut()}
1936
1963
 
1937
1964
  ${r.userRequestHeading}
1938
1965
  ${e}`;
1939
1966
  }
1940
- function Wt(e, t) {
1967
+ function Gt(e, t) {
1941
1968
  return t ? {
1942
1969
  kind: "handoff",
1943
1970
  ...t
@@ -1948,27 +1975,27 @@ function Wt(e, t) {
1948
1975
  }
1949
1976
  //#endregion
1950
1977
  //#region src/domain/orchestrator/agenticoOrchestratorAgent.ts
1951
- function Gt(e) {
1978
+ function Kt(e) {
1952
1979
  return U().filter((t) => !t.onlyWhenAnchored || e === t.id);
1953
1980
  }
1954
- function Kt(e) {
1981
+ function qt(e) {
1955
1982
  return {
1956
1983
  buildContext(e) {
1957
1984
  return {
1958
- cliCatalog: de(Gt(e.scopedSubagentId)),
1985
+ cliCatalog: de(Kt(e.scopedSubagentId)),
1959
1986
  handoff: { current: null },
1960
1987
  collected: {}
1961
1988
  };
1962
1989
  },
1963
1990
  buildPrompt({ userGoal: e, pageContext: t }, { cliCatalog: n }) {
1964
- return Ut(e, n, t);
1991
+ return Wt(e, n, t);
1965
1992
  },
1966
1993
  buildFollowUpPrompt(e, t, { cliCatalog: n }) {
1967
- return `${e}\n\n${Ht()}\n\n${X().toolsHeading}\n${n}`;
1994
+ return `${e}\n\n${Ut()}\n\n${X().toolsHeading}\n${n}`;
1968
1995
  },
1969
1996
  parseResponse(e, t, n) {
1970
1997
  let r = n.handoff.current;
1971
- return n.handoff.current = null, Wt(e, r);
1998
+ return n.handoff.current = null, Gt(e, r);
1972
1999
  },
1973
2000
  fallback() {
1974
2001
  return {
@@ -1984,7 +2011,7 @@ function Kt(e) {
1984
2011
  attachmentsRef: r,
1985
2012
  collected: n.collected,
1986
2013
  proxyFetch: x
1987
- }), a = t.scopedSubagentId ? W(t.scopedSubagentId) : null, o = a ? i.filter((e) => (a.crossAgentToolIds ?? []).includes(e.name)) : i, s = Gt(t.scopedSubagentId).flatMap((t) => t.commands.map((r) => ({
2014
+ }), a = t.scopedSubagentId ? W(t.scopedSubagentId) : null, o = a ? i.filter((e) => (a.crossAgentToolIds ?? []).includes(e.name)) : i, s = Kt(t.scopedSubagentId).flatMap((t) => t.commands.map((r) => ({
1988
2015
  name: `${t.id}_${r.name}`,
1989
2016
  description: `${t.label}: ${r.summary}`,
1990
2017
  inputSchema: r.inputSchema,
@@ -2008,12 +2035,12 @@ function Kt(e) {
2008
2035
  }
2009
2036
  //#endregion
2010
2037
  //#region src/presentation/deriveHistoryTitle.ts
2011
- function qt(e, t) {
2038
+ function Jt(e, t) {
2012
2039
  return e.deriveHistoryTitle?.(t) ?? e.label;
2013
2040
  }
2014
2041
  //#endregion
2015
2042
  //#region src/presentation/ResultDestinationPicker.tsx
2016
- function Jt({ manifest: e, result: t, meta: n, taskId: r, initiallyApplied: i, onApplied: a, extraDestinations: o }) {
2043
+ function Yt({ manifest: e, result: t, meta: n, taskId: r, initiallyApplied: i, onApplied: a, extraDestinations: o }) {
2017
2044
  let s = $(), c = tt(), l = c.scope, u = T(), [d, f] = N(null), [p, m] = N(new Set(i ?? [])), [h, g] = N(null), _ = Se(), v = /* @__PURE__ */ new Map();
2018
2045
  e.destinationIds.forEach((e) => {
2019
2046
  let t = _[e];
@@ -2031,7 +2058,7 @@ function Jt({ manifest: e, result: t, meta: n, taskId: r, initiallyApplied: i, o
2031
2058
  storageProvider: l?.storageProvider ?? null,
2032
2059
  proxyFetch: u
2033
2060
  }, n);
2034
- m((e) => new Set(e).add(i)), a?.(i), d?.id && c.commitEntityChat(e.id, d.id, r, l?.id, n, qt(e, n));
2061
+ m((e) => new Set(e).add(i)), a?.(i), d?.id && c.commitEntityChat(e.id, d.id, r, l?.id, n, Jt(e, n));
2035
2062
  } catch (e) {
2036
2063
  g(e instanceof Error ? e.message : String(e));
2037
2064
  } finally {
@@ -2064,16 +2091,16 @@ function Jt({ manifest: e, result: t, meta: n, taskId: r, initiallyApplied: i, o
2064
2091
  }
2065
2092
  //#endregion
2066
2093
  //#region src/presentation/reports/subagentReportRegistry.tsx
2067
- var Yt = {};
2068
- function Xt(e) {
2069
- Object.assign(Yt, e);
2070
- }
2094
+ var Xt = {};
2071
2095
  function Zt(e) {
2072
- return Yt[e];
2096
+ Object.assign(Xt, e);
2097
+ }
2098
+ function Qt(e) {
2099
+ return Xt[e];
2073
2100
  }
2074
2101
  //#endregion
2075
2102
  //#region src/presentation/reports/GenericResultPreview.tsx
2076
- function Qt({ result: e }) {
2103
+ function $t({ result: e }) {
2077
2104
  let [t, n] = N(!1);
2078
2105
  return /* @__PURE__ */ I("div", {
2079
2106
  className: `relative cursor-pointer rounded-md border border-border/60 ${t ? "max-h-80 overflow-y-auto" : "max-h-28 overflow-hidden"}`,
@@ -2090,7 +2117,7 @@ function Qt({ result: e }) {
2090
2117
  }
2091
2118
  //#endregion
2092
2119
  //#region src/presentation/liveAnchorDestination.ts
2093
- function $t(e, t, n) {
2120
+ function en(e, t, n) {
2094
2121
  return e.length === 0 ? null : {
2095
2122
  id: "live-component",
2096
2123
  label: "Applica al componente aperto",
@@ -2101,37 +2128,37 @@ function $t(e, t, n) {
2101
2128
  }
2102
2129
  //#endregion
2103
2130
  //#region src/presentation/subagentControls.ts
2104
- var en = {};
2105
- function tn(e) {
2106
- Object.assign(en, e);
2107
- }
2131
+ var tn = {};
2108
2132
  function nn(e) {
2109
- return en[e];
2133
+ Object.assign(tn, e);
2134
+ }
2135
+ function rn(e) {
2136
+ return tn[e];
2110
2137
  }
2111
2138
  //#endregion
2112
2139
  //#region src/presentation/chatTitles.ts
2113
- function rn(e, t = 6e3) {
2140
+ function an(e, t = 6e3) {
2114
2141
  let n = e.filter((e) => (e.kind === "user" || e.kind === "thinking") && e.detail?.trim() && !Ge(e)).map((e) => `${e.kind === "user" ? "Person" : "Agent"}: ${e.detail.trim()}`).join("\n\n");
2115
2142
  return n.length > t ? `${n.slice(0, t * .7)}\n\n[…]\n\n${n.slice(-t * .3)}` : n;
2116
2143
  }
2117
- function an(e) {
2144
+ function on(e) {
2118
2145
  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);
2119
2146
  }
2120
- function on(e, t) {
2147
+ function sn(e, t) {
2121
2148
  try {
2122
2149
  return e.definition.executor?.catalogProviders?.(e.toParams(t));
2123
2150
  } catch {
2124
2151
  return;
2125
2152
  }
2126
2153
  }
2127
- function sn(e, t, n, r, i) {
2128
- let a = on(e, t), o = (e) => {
2154
+ function cn(e, t, n, r, i) {
2155
+ let a = sn(e, t), o = (e) => {
2129
2156
  let t = e ? b(e) : null;
2130
2157
  return !(!t || !i[t.provider] || a && !a.includes(t.provider));
2131
2158
  };
2132
2159
  return o(n) ? n : Object.values(r).flat().map((e) => e.id).find(o);
2133
2160
  }
2134
- function cn(e) {
2161
+ function ln(e) {
2135
2162
  let t = S()?.registry ?? {}, { modelsByProvider: n, selectedModel: r } = Pt(), i = M({
2136
2163
  registry: t,
2137
2164
  modelsByProvider: n,
@@ -2146,15 +2173,15 @@ function cn(e) {
2146
2173
  if (!e) return !1;
2147
2174
  let o = Re(e, t, n), s = W(t), c = `${e}:${t}:${n}`;
2148
2175
  if (!o || !s?.autoTitle || o.name || !We(o) || a.current.has(c)) return !1;
2149
- let { registry: l, modelsByProvider: u, selectedModel: d } = i.current, f = sn(s, o.params, r ?? d, u, l), p = f ? b(f) : null;
2176
+ let { registry: l, modelsByProvider: u, selectedModel: d } = i.current, f = cn(s, o.params, r ?? d, u, l), p = f ? b(f) : null;
2150
2177
  if (!p) return !1;
2151
2178
  a.current.add(c);
2152
2179
  try {
2153
2180
  let r = await l[p.provider].complete({
2154
- prompt: X().chatTitle.replace("{chat}", rn(o.activity)),
2181
+ prompt: X().chatTitle.replace("{chat}", an(o.activity)),
2155
2182
  model: p.model,
2156
2183
  history: []
2157
- }), i = r && r.type === "text" ? an(r.text) : "";
2184
+ }), i = r && r.type === "text" ? on(r.text) : "";
2158
2185
  return i ? Ke(e, t, n, i, "model") : !1;
2159
2186
  } catch {
2160
2187
  return !1;
@@ -2163,7 +2190,7 @@ function cn(e) {
2163
2190
  }
2164
2191
  }, [e]), s = Object.keys(n).length > 0;
2165
2192
  return k(() => {
2166
- e && s && !ln.has(e) && (ln.add(e), (async () => {
2193
+ e && s && !un.has(e) && (un.add(e), (async () => {
2167
2194
  for (let t of Ye(e)) {
2168
2195
  let n = W(t.subagentId);
2169
2196
  if (n?.autoTitle) {
@@ -2181,11 +2208,11 @@ function cn(e) {
2181
2208
  o
2182
2209
  ]), o;
2183
2210
  }
2184
- var ln = /* @__PURE__ */ new Set(), un = () => ({});
2185
- function dn({ manifest: e, params: t, extraDestinations: n, precedingActivity: r, taskId: i, resumeSeed: a, model: o, openingMessage: s }) {
2186
- let c = Vt(e.definition, { defaultEnabled: !0 }), l = tt(), u = l.scope, d = T(), f = M(i ?? `subagent-${e.id}-${crypto.randomUUID()}`).current, [p, m] = N(null), h = (t) => {
2211
+ var un = /* @__PURE__ */ new Set(), dn = () => ({});
2212
+ function fn({ manifest: e, params: t, extraDestinations: n, precedingActivity: r, taskId: i, resumeSeed: a, model: o, openingMessage: s }) {
2213
+ let c = Ht(e.definition, { defaultEnabled: !0 }), l = tt(), u = l.scope, d = T(), f = M(i ?? `subagent-${e.id}-${crypto.randomUUID()}`).current, [p, m] = N(null), h = (t) => {
2187
2214
  e.definition.conversational || m(t);
2188
- }, [g, _] = N([]), [v, y] = N(null), b = Zt(e.id), x = b?.kind === "selection" ? b : null, [S, C] = N(null), w = M(!1), E = M(0), D = M(null);
2215
+ }, [g, _] = N([]), [v, y] = N(null), b = Qt(e.id), x = b?.kind === "selection" ? b : null, [S, C] = N(null), w = M(!1), E = M(0), D = M(null);
2189
2216
  p && p !== D.current && (D.current = p, E.current = (r?.length ?? 0) + c.activity.length);
2190
2217
  let O = M(!1), A = c.remote || !c.hasProviders || c.selectedModel !== "";
2191
2218
  k(() => {
@@ -2209,7 +2236,7 @@ function dn({ manifest: e, params: t, extraDestinations: n, precedingActivity: r
2209
2236
  ...t,
2210
2237
  pinnedEntityId: r
2211
2238
  }).then((n) => {
2212
- n?.id && l.commitEntityChat(e.id, n.id, f, u.id, t, qt(e, t));
2239
+ n?.id && l.commitEntityChat(e.id, n.id, f, u.id, t, Jt(e, t));
2213
2240
  }).catch((e) => y(e instanceof Error ? e.message : String(e))));
2214
2241
  });
2215
2242
  }, [
@@ -2228,11 +2255,11 @@ function dn({ manifest: e, params: t, extraDestinations: n, precedingActivity: r
2228
2255
  p,
2229
2256
  x,
2230
2257
  S
2231
- ]), ee = j(() => l.componentAnchors.filter((t) => t.subagentId === e.id && t.onResult), [l.componentAnchors, e.id]), B = j(() => $t(ee, t, f), [
2258
+ ]), ee = j(() => l.componentAnchors.filter((t) => t.subagentId === e.id && t.onResult), [l.componentAnchors, e.id]), B = j(() => en(ee, t, f), [
2232
2259
  ee,
2233
2260
  t,
2234
2261
  f
2235
- ]), te = j(() => B ? [B, ...n ?? []] : n, [B, n]), V = e.chatEntityId?.(t), H = cn(u?.id), U = M(!1), W = M(!1);
2262
+ ]), te = j(() => B ? [B, ...n ?? []] : n, [B, n]), V = e.chatEntityId?.(t), H = ln(u?.id), U = M(!1), W = M(!1);
2236
2263
  k(() => {
2237
2264
  let n = !U.current && c.running, i = U.current && !c.running;
2238
2265
  if (U.current = c.running, !n && !i || !V || !u) return;
@@ -2248,14 +2275,14 @@ function dn({ manifest: e, params: t, extraDestinations: n, precedingActivity: r
2248
2275
  subagentId: e.id,
2249
2276
  entityId: V,
2250
2277
  params: t,
2251
- title: qt(e, t),
2278
+ title: Jt(e, t),
2252
2279
  history: a.history,
2253
2280
  activity: o
2254
2281
  }), i && e.autoTitle && H(e.id, V, c.selectedModel));
2255
2282
  }, [c.running]);
2256
2283
  let G = () => {
2257
2284
  O.current = !0, c.running && c.stop(), l.closeTask(f);
2258
- }, K = M(nn(e.id) ?? un).current, q = K({
2285
+ }, K = M(rn(e.id) ?? dn).current, q = K({
2259
2286
  params: t,
2260
2287
  taskId: f,
2261
2288
  running: c.running,
@@ -2266,7 +2293,7 @@ function dn({ manifest: e, params: t, extraDestinations: n, precedingActivity: r
2266
2293
  return k(() => {
2267
2294
  O.current || l.openTask({
2268
2295
  id: f,
2269
- title: qt(e, t),
2296
+ title: Jt(e, t),
2270
2297
  icon: e.icon,
2271
2298
  agent: c,
2272
2299
  onApplied: (e) => h(e),
@@ -2285,12 +2312,12 @@ function dn({ manifest: e, params: t, extraDestinations: n, precedingActivity: r
2285
2312
  }) : b?.kind === "editable" ? /* @__PURE__ */ F(b.Report, {
2286
2313
  result: p,
2287
2314
  onResultChange: R
2288
- }) : /* @__PURE__ */ F(Qt, { result: z }),
2315
+ }) : /* @__PURE__ */ F($t, { result: z }),
2289
2316
  v && /* @__PURE__ */ I("p", {
2290
2317
  className: "text-xs text-destructive",
2291
2318
  children: ["Salvataggio automatico non riuscito: ", v]
2292
2319
  }),
2293
- /* @__PURE__ */ F(Jt, {
2320
+ /* @__PURE__ */ F(Yt, {
2294
2321
  manifest: e,
2295
2322
  result: z,
2296
2323
  meta: t,
@@ -2331,8 +2358,8 @@ function dn({ manifest: e, params: t, extraDestinations: n, precedingActivity: r
2331
2358
  }
2332
2359
  //#endregion
2333
2360
  //#region src/presentation/OrchestratorRunner.tsx
2334
- function fn({ userGoal: e }) {
2335
- let t = $(), n = Vt(j(() => Kt({
2361
+ function pn({ userGoal: e }) {
2362
+ let t = $(), n = Ht(j(() => qt({
2336
2363
  unavailable: t.orchestratorUnavailable,
2337
2364
  continueWithoutAi: t.orchestratorContinueWithoutAi,
2338
2365
  preparing: t.orchestratorPreparing,
@@ -2380,7 +2407,7 @@ function fn({ userGoal: e }) {
2380
2407
  let h = j(() => [...f.current?.activity ?? [], ...n.activity], [n.activity]);
2381
2408
  if (!i) return null;
2382
2409
  let g = W(i.subagentId);
2383
- return g ? /* @__PURE__ */ F(dn, {
2410
+ return g ? /* @__PURE__ */ F(fn, {
2384
2411
  manifest: g,
2385
2412
  params: i.params,
2386
2413
  extraDestinations: c.current,
@@ -2391,8 +2418,8 @@ function fn({ userGoal: e }) {
2391
2418
  }
2392
2419
  //#endregion
2393
2420
  //#region src/presentation/ManualEntryRunner.tsx
2394
- function pn({ manifest: e, extraDestinations: n }) {
2395
- let r = Vt(e.definition, { defaultEnabled: !1 }), i = $(), a = tt(), o = M(`manual-${e.id}-${crypto.randomUUID()}`).current, [s, c] = N(null), [l, u] = N([]), d = Zt(e.id), f = d?.kind === "selection" ? d : null, [p, m] = N(null), [h, g] = N(null), _ = M(!1), v = (t) => {
2421
+ function mn({ manifest: e, extraDestinations: n }) {
2422
+ let r = Ht(e.definition, { defaultEnabled: !1 }), i = $(), a = tt(), o = M(`manual-${e.id}-${crypto.randomUUID()}`).current, [s, c] = N(null), [l, u] = N([]), d = Qt(e.id), f = d?.kind === "selection" ? d : null, [p, m] = N(null), [h, g] = N(null), _ = M(!1), v = (t) => {
2396
2423
  if (!e.manualEntry) return;
2397
2424
  let n;
2398
2425
  try {
@@ -2419,7 +2446,7 @@ function pn({ manifest: e, extraDestinations: n }) {
2419
2446
  p
2420
2447
  ]), S = (e) => {
2421
2448
  u((t) => t.includes(e) ? t : [...t, e]);
2422
- }, C = j(() => a.componentAnchors.filter((t) => t.subagentId === e.id && t.onResult), [a.componentAnchors, e.id]), w = j(() => h ? $t(C, h, o) : null, [
2449
+ }, C = j(() => a.componentAnchors.filter((t) => t.subagentId === e.id && t.onResult), [a.componentAnchors, e.id]), w = j(() => h ? en(C, h, o) : null, [
2423
2450
  C,
2424
2451
  h,
2425
2452
  o
@@ -2448,8 +2475,8 @@ function pn({ manifest: e, extraDestinations: n }) {
2448
2475
  }) : d?.kind === "editable" ? /* @__PURE__ */ F(d.Report, {
2449
2476
  result: s,
2450
2477
  onResultChange: b
2451
- }) : /* @__PURE__ */ F(Qt, { result: x }),
2452
- /* @__PURE__ */ F(Jt, {
2478
+ }) : /* @__PURE__ */ F($t, { result: x }),
2479
+ /* @__PURE__ */ F(Yt, {
2453
2480
  manifest: e,
2454
2481
  result: x,
2455
2482
  meta: h ?? {},
@@ -2486,7 +2513,7 @@ function pn({ manifest: e, extraDestinations: n }) {
2486
2513
  }
2487
2514
  //#endregion
2488
2515
  //#region src/presentation/Agentico.tsx
2489
- function mn(e, t) {
2516
+ function hn(e, t) {
2490
2517
  return Object.values(e).flat().map((e) => {
2491
2518
  let n = t?.(e.provider, e.providerLabel ?? e.provider);
2492
2519
  return {
@@ -2498,7 +2525,7 @@ function mn(e, t) {
2498
2525
  };
2499
2526
  });
2500
2527
  }
2501
- function hn({ task: e }) {
2528
+ function gn({ task: e }) {
2502
2529
  let t = $(), [n, r] = N(""), { agent: i, onApplied: a, manualEntry: o } = e, c = i.running, l = (e) => {
2503
2530
  if (r(""), o) {
2504
2531
  o.onSubmit(e.text);
@@ -2510,7 +2537,7 @@ function hn({ task: e }) {
2510
2537
  }).then((e) => {
2511
2538
  e && a(e);
2512
2539
  });
2513
- }, u = !!o || 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, ...mn(i.modelsByProvider, i.catalogGroup)] : mn(i.modelsByProvider);
2540
+ }, u = !!o || 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, ...hn(i.modelsByProvider, i.catalogGroup)] : hn(i.modelsByProvider);
2514
2541
  return /* @__PURE__ */ F(s, {
2515
2542
  value: n,
2516
2543
  onChange: r,
@@ -2530,7 +2557,7 @@ function hn({ task: e }) {
2530
2557
  maxHeight: 220
2531
2558
  });
2532
2559
  }
2533
- function gn() {
2560
+ function _n() {
2534
2561
  let { startOrchestrator: e } = tt(), t = $(), [n, r] = N(""), { hasProviders: i, modelsByProvider: a, selectedModel: o, setSelectedModel: c } = Pt(), l = (t) => {
2535
2562
  t.text.trim() && (e(t.text.trim(), {
2536
2563
  attachments: t.files.length > 0 ? t.files : void 0,
@@ -2544,7 +2571,7 @@ function gn() {
2544
2571
  disabled: !n.trim() || u,
2545
2572
  onSubmit: l,
2546
2573
  attachments: !0,
2547
- models: mn(a),
2574
+ models: hn(a),
2548
2575
  selectedModel: o,
2549
2576
  onModelChange: c,
2550
2577
  modelPlaceholder: t.selectModelPlaceholder,
@@ -2552,7 +2579,7 @@ function gn() {
2552
2579
  maxHeight: 220
2553
2580
  });
2554
2581
  }
2555
- function _n({ chat: e, onClose: t }) {
2582
+ function vn({ chat: e, onClose: t }) {
2556
2583
  let n = $(), r = C();
2557
2584
  return /* @__PURE__ */ F(h, {
2558
2585
  title: n.renameChat,
@@ -2575,7 +2602,7 @@ function _n({ chat: e, onClose: t }) {
2575
2602
  })
2576
2603
  });
2577
2604
  }
2578
- function vn(e, t, n = Date.now()) {
2605
+ function yn(e, t, n = Date.now()) {
2579
2606
  let r = Math.round((e - n) / 1e3), i = new Intl.RelativeTimeFormat(t, {
2580
2607
  numeric: "auto",
2581
2608
  style: "short"
@@ -2587,7 +2614,7 @@ function vn(e, t, n = Date.now()) {
2587
2614
  ]) if (Math.abs(r) >= t) return i.format(Math.round(r / t), e);
2588
2615
  return i.format(0, "minute");
2589
2616
  }
2590
- function yn({ card: e }) {
2617
+ function bn({ card: e }) {
2591
2618
  let t = $();
2592
2619
  return e.humanSummaryOnly ? /* @__PURE__ */ I("div", {
2593
2620
  className: "space-y-2 rounded-lg border border-border/60 p-3",
@@ -2643,7 +2670,7 @@ function yn({ card: e }) {
2643
2670
  ]
2644
2671
  });
2645
2672
  }
2646
- function bn({ messages: e }) {
2673
+ function xn({ messages: e }) {
2647
2674
  return /* @__PURE__ */ F("div", {
2648
2675
  className: "space-y-2 rounded-lg border border-border/60 p-3",
2649
2676
  children: e.map((e, t) => /* @__PURE__ */ F("p", {
@@ -2652,7 +2679,7 @@ function bn({ messages: e }) {
2652
2679
  }, t))
2653
2680
  });
2654
2681
  }
2655
- function xn({ scopeId: e, currentTaskId: n, open: r, onOpenChange: i, onSelect: a, onNewChat: o, onArchivedCurrent: s }) {
2682
+ function Sn({ scopeId: e, currentTaskId: n, open: r, onOpenChange: i, onSelect: a, onNewChat: o, onArchivedCurrent: s }) {
2656
2683
  let c = $(), { locale: d } = w(), [p, m] = N(""), [h, g] = N(0);
2657
2684
  k(() => Ie(() => g((e) => e + 1)), []);
2658
2685
  let _ = j(() => r ? Ye(e) : [], [
@@ -2741,19 +2768,19 @@ function xn({ scopeId: e, currentTaskId: n, open: r, onOpenChange: i, onSelect:
2741
2768
  }), /* @__PURE__ */ F("span", {
2742
2769
  className: "shrink-0 text-xs text-muted-foreground",
2743
2770
  title: `${c.chatStarted.replace("{at}", new Date(qe(e)).toLocaleString(d))} · ${c.chatLastMessage.replace("{at}", new Date(e.savedAt).toLocaleString(d))}`,
2744
- children: vn(qe(e), d)
2771
+ children: yn(qe(e), d)
2745
2772
  })]
2746
2773
  })
2747
2774
  }, `${e.subagentId}:${e.entityId}`);
2748
2775
  })
2749
- }), v && /* @__PURE__ */ F(_n, {
2776
+ }), v && /* @__PURE__ */ F(vn, {
2750
2777
  chat: v,
2751
2778
  onClose: () => y(null)
2752
2779
  })] });
2753
2780
  }
2754
- function Sn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}) {
2781
+ function Cn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}) {
2755
2782
  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 } = tt(), T = $(), E = M(null), [D, O] = N(!1);
2756
- cn(w?.id);
2783
+ ln(w?.id);
2757
2784
  let A = Ot({
2758
2785
  defaultWidth: e,
2759
2786
  minWidth: n,
@@ -2797,7 +2824,7 @@ function Sn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
2797
2824
  });
2798
2825
  return n.observe(t), () => n.disconnect();
2799
2826
  }, [a?.id, o]);
2800
- let J = s ? /* @__PURE__ */ F(fn, { userGoal: s }, c) : null, ie = f ? W(f.subagentId) : void 0, ae = f && ie ? /* @__PURE__ */ F(dn, {
2827
+ let J = s ? /* @__PURE__ */ F(pn, { userGoal: s }, c) : null, ie = f ? W(f.subagentId) : void 0, ae = f && ie ? /* @__PURE__ */ F(fn, {
2801
2828
  manifest: ie,
2802
2829
  params: f.snapshot.params,
2803
2830
  taskId: Xe(f.subagentId, f.entityId),
@@ -2805,14 +2832,14 @@ function Sn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
2805
2832
  history: f.snapshot.history,
2806
2833
  activity: f.snapshot.activity
2807
2834
  }
2808
- }, p) : null, Y = g ? W(g.subagentId) : void 0, oe = g && Y ? /* @__PURE__ */ F(pn, {
2835
+ }, p) : null, Y = g ? W(g.subagentId) : void 0, oe = g && Y ? /* @__PURE__ */ F(mn, {
2809
2836
  manifest: Y,
2810
2837
  extraDestinations: g.extraDestinations
2811
- }, _) : null, X = b ? W(b.subagentId) : void 0, Z = b && X ? /* @__PURE__ */ F(dn, {
2838
+ }, _) : null, X = b ? W(b.subagentId) : void 0, Z = b && X ? /* @__PURE__ */ F(fn, {
2812
2839
  manifest: X,
2813
2840
  params: b.params,
2814
2841
  extraDestinations: b.extraDestinations
2815
- }, x) : null, se = S ? W(S.subagentId) : void 0, ce = S && se ? /* @__PURE__ */ F(dn, {
2842
+ }, x) : null, se = S ? W(S.subagentId) : void 0, ce = S && se ? /* @__PURE__ */ F(fn, {
2816
2843
  manifest: se,
2817
2844
  params: S.params,
2818
2845
  taskId: S.taskId,
@@ -2843,7 +2870,7 @@ function Sn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
2843
2870
  className: "min-w-0 flex-1 truncate text-lg font-semibold leading-tight",
2844
2871
  children: a ? a.title : "Agentico"
2845
2872
  }),
2846
- w && /* @__PURE__ */ F(xn, {
2873
+ w && /* @__PURE__ */ F(Sn, {
2847
2874
  scopeId: w.id,
2848
2875
  currentTaskId: a?.id ?? null,
2849
2876
  open: D,
@@ -2914,7 +2941,7 @@ function Sn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
2914
2941
  })
2915
2942
  ]
2916
2943
  })
2917
- ] }) : d.length > 0 ? /* @__PURE__ */ F(bn, { messages: d }) : u ? /* @__PURE__ */ F(yn, { card: u }) : /* @__PURE__ */ F("p", {
2944
+ ] }) : d.length > 0 ? /* @__PURE__ */ F(xn, { messages: d }) : u ? /* @__PURE__ */ F(bn, { card: u }) : /* @__PURE__ */ F("p", {
2918
2945
  className: "text-xs text-muted-foreground",
2919
2946
  children: l ?? T.orchestratorStarterHint
2920
2947
  })
@@ -2952,7 +2979,7 @@ function Sn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
2952
2979
  children: [a?.panelActions && /* @__PURE__ */ F("div", {
2953
2980
  className: "mb-2",
2954
2981
  children: a.panelActions
2955
- }), a ? /* @__PURE__ */ F(hn, { task: a }, a.id) : /* @__PURE__ */ F(gn, {})]
2982
+ }), a ? /* @__PURE__ */ F(gn, { task: a }, a.id) : /* @__PURE__ */ F(_n, {})]
2956
2983
  })
2957
2984
  ]
2958
2985
  })
@@ -2966,13 +2993,13 @@ function Sn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
2966
2993
  }
2967
2994
  //#endregion
2968
2995
  //#region src/presentation/useAgenticoPageContext.ts
2969
- function Cn(e, t) {
2996
+ function wn(e, t) {
2970
2997
  let { setPageContext: n } = tt(), r = M(crypto.randomUUID()).current;
2971
2998
  k(() => (n(r, e, t ?? null), () => n(r, null)), [e, t]);
2972
2999
  }
2973
3000
  //#endregion
2974
3001
  //#region src/presentation/useSubagentComponentContext.ts
2975
- function wn(e, t, n, r, i = !0, a) {
3002
+ function Tn(e, t, n, r, i = !0, a) {
2976
3003
  let { registerComponentAnchor: o } = tt(), s = M(crypto.randomUUID()).current, c = M(n);
2977
3004
  c.current = n, k(() => {
2978
3005
  if (i) return o(s, {
@@ -2991,6 +3018,6 @@ function wn(e, t, n, r, i = !0, a) {
2991
3018
  ]);
2992
3019
  }
2993
3020
  //#endregion
2994
- export { xt as AGENTICO_MAX_WIDTH, bt as AGENTICO_MIN_WIDTH, yt as AGENTICO_WIDTH, St as AGENTICO_WIDTH_STORAGE_KEY, Sn as Agentico, et as AgenticoProvider, At as AgenticoToggle, R as DEFAULT_REASONING_PART_ID, L as DEFAULT_TEXT_PART_ID, ve as JSON_EXPORT_DESTINATION_ID, pe as MICRO_PROMPT_REGISTRY, Qe as ORCHESTRATOR_TASK_ID, fe as SUMMARY_MICRO_PROMPT, Te as agenticoDe, Ce as agenticoEn, we as agenticoIt, ie as agenticoPromptsEn, ae as agenticoPromptsIt, Ze as agenticoTranslations, me as applyMicroPrompts, We as chatHasPersonMessage, qe as chatStartedAt, Ue as chatTitle, oe as configureAgenticoPrompts, Oe as configureEntityChatStore, q as createCrossAgentTools, te as defineSubagent, Xe as entityChatTaskId, he as extractErrorMessage, ge as extractJsonBlock, W as findSubagentManifest, B as formatQuestionAnswers, X as getAgenticoPrompts, Se as getDestinationRegistry, Re as getEntityChat, nn as getSubagentControls, U as getSubagentRegistry, Zt as getSubagentReport, ke as hasEntityChatBackend, ye as jsonExportDestination, Ye as listEntityChats, ee as messagePartsText, Ie as onEntityChatsChange, K as registerCrossAgentTools, xe as registerDestinations, tn as registerSubagentControls, Xt as registerSubagentReports, H as registerSubagents, Je as removeEntityChat, Ke as renameEntityChat, de as renderRegistryCli, ue as renderSubagentCli, Z as resetAgenticoPrompts, ze as saveEntityChat, Me as syncEntityChats, ne as toJsonSchema, re as toMcpTool, z as upsertMessagePart, Vt as useAgent, tt as useAgentico, $ as useAgenticoI18n, Cn as useAgenticoPageContext, wn as useSubagentComponentContext };
3021
+ export { xt as AGENTICO_MAX_WIDTH, bt as AGENTICO_MIN_WIDTH, yt as AGENTICO_WIDTH, St as AGENTICO_WIDTH_STORAGE_KEY, Cn as Agentico, et as AgenticoProvider, At as AgenticoToggle, R as DEFAULT_REASONING_PART_ID, L as DEFAULT_TEXT_PART_ID, ve as JSON_EXPORT_DESTINATION_ID, pe as MICRO_PROMPT_REGISTRY, Qe as ORCHESTRATOR_TASK_ID, fe as SUMMARY_MICRO_PROMPT, Te as agenticoDe, Ce as agenticoEn, we as agenticoIt, ie as agenticoPromptsEn, ae as agenticoPromptsIt, Ze as agenticoTranslations, me as applyMicroPrompts, We as chatHasPersonMessage, qe as chatStartedAt, Ue as chatTitle, oe as configureAgenticoPrompts, Oe as configureEntityChatStore, q as createCrossAgentTools, te as defineSubagent, Xe as entityChatTaskId, he as extractErrorMessage, ge as extractJsonBlock, W as findSubagentManifest, B as formatQuestionAnswers, X as getAgenticoPrompts, Se as getDestinationRegistry, Re as getEntityChat, rn as getSubagentControls, U as getSubagentRegistry, Qt as getSubagentReport, ke as hasEntityChatBackend, ye as jsonExportDestination, Ye as listEntityChats, ee as messagePartsText, Ie as onEntityChatsChange, K as registerCrossAgentTools, xe as registerDestinations, nn as registerSubagentControls, Zt as registerSubagentReports, H as registerSubagents, Je as removeEntityChat, Ke as renameEntityChat, de as renderRegistryCli, ue as renderSubagentCli, Z as resetAgenticoPrompts, ze as saveEntityChat, Me as syncEntityChats, ne as toJsonSchema, re as toMcpTool, z as upsertMessagePart, Ht as useAgent, tt as useAgentico, $ as useAgenticoI18n, wn as useAgenticoPageContext, Tn as useSubagentComponentContext };
2995
3022
 
2996
3023
  //# sourceMappingURL=index.mjs.map