@llmnative/agentico 0.13.2 → 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.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +95 -82
- package/dist/index.mjs.map +1 -1
- package/dist/types/presentation/useAgent.d.ts +2 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1381,7 +1381,20 @@ var Rt = 20, zt = 26e4;
|
|
|
1381
1381
|
function Bt(e) {
|
|
1382
1382
|
return e.filter((e) => !g.isTextAttachment(e.mimeType) || e.base64.length <= zt);
|
|
1383
1383
|
}
|
|
1384
|
-
function Vt(e
|
|
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 = {}) {
|
|
1385
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) => {
|
|
1386
1399
|
v((t) => {
|
|
1387
1400
|
let n = typeof e == "function" ? e(t) : e;
|
|
@@ -1846,7 +1859,7 @@ function Vt(e, t = {}) {
|
|
|
1846
1859
|
p(T.current.requestInProgress);
|
|
1847
1860
|
return;
|
|
1848
1861
|
}
|
|
1849
|
-
D.current = !0, p(null), x(n.activity), d(!0);
|
|
1862
|
+
D.current = !0, p(null), x(Vt(n.activity)), d(!0);
|
|
1850
1863
|
try {
|
|
1851
1864
|
let i = await e.buildContext(t), a = { current: void 0 }, o = e.getTools?.(t, i, a) ?? [];
|
|
1852
1865
|
E.current = {
|
|
@@ -1935,23 +1948,23 @@ function Vt(e, t = {}) {
|
|
|
1935
1948
|
}
|
|
1936
1949
|
//#endregion
|
|
1937
1950
|
//#region src/domain/orchestrator/prompt.ts
|
|
1938
|
-
function
|
|
1951
|
+
function Ut() {
|
|
1939
1952
|
let e = X();
|
|
1940
1953
|
return [e.responseRulesHeading, ...e.responseRules.map((e) => `- ${e}`)].join("\n");
|
|
1941
1954
|
}
|
|
1942
|
-
function
|
|
1955
|
+
function Wt(e, t, n) {
|
|
1943
1956
|
let r = X(), i = n ? `\n${r.pageContextHeading}\n${r.pageContextIntro}\n${n}\n` : "";
|
|
1944
1957
|
return `${r.orchestratorIntro}
|
|
1945
1958
|
|
|
1946
1959
|
${r.toolsHeading}
|
|
1947
1960
|
${t}
|
|
1948
1961
|
${i}
|
|
1949
|
-
${
|
|
1962
|
+
${Ut()}
|
|
1950
1963
|
|
|
1951
1964
|
${r.userRequestHeading}
|
|
1952
1965
|
${e}`;
|
|
1953
1966
|
}
|
|
1954
|
-
function
|
|
1967
|
+
function Gt(e, t) {
|
|
1955
1968
|
return t ? {
|
|
1956
1969
|
kind: "handoff",
|
|
1957
1970
|
...t
|
|
@@ -1962,27 +1975,27 @@ function Wt(e, t) {
|
|
|
1962
1975
|
}
|
|
1963
1976
|
//#endregion
|
|
1964
1977
|
//#region src/domain/orchestrator/agenticoOrchestratorAgent.ts
|
|
1965
|
-
function
|
|
1978
|
+
function Kt(e) {
|
|
1966
1979
|
return U().filter((t) => !t.onlyWhenAnchored || e === t.id);
|
|
1967
1980
|
}
|
|
1968
|
-
function
|
|
1981
|
+
function qt(e) {
|
|
1969
1982
|
return {
|
|
1970
1983
|
buildContext(e) {
|
|
1971
1984
|
return {
|
|
1972
|
-
cliCatalog: de(
|
|
1985
|
+
cliCatalog: de(Kt(e.scopedSubagentId)),
|
|
1973
1986
|
handoff: { current: null },
|
|
1974
1987
|
collected: {}
|
|
1975
1988
|
};
|
|
1976
1989
|
},
|
|
1977
1990
|
buildPrompt({ userGoal: e, pageContext: t }, { cliCatalog: n }) {
|
|
1978
|
-
return
|
|
1991
|
+
return Wt(e, n, t);
|
|
1979
1992
|
},
|
|
1980
1993
|
buildFollowUpPrompt(e, t, { cliCatalog: n }) {
|
|
1981
|
-
return `${e}\n\n${
|
|
1994
|
+
return `${e}\n\n${Ut()}\n\n${X().toolsHeading}\n${n}`;
|
|
1982
1995
|
},
|
|
1983
1996
|
parseResponse(e, t, n) {
|
|
1984
1997
|
let r = n.handoff.current;
|
|
1985
|
-
return n.handoff.current = null,
|
|
1998
|
+
return n.handoff.current = null, Gt(e, r);
|
|
1986
1999
|
},
|
|
1987
2000
|
fallback() {
|
|
1988
2001
|
return {
|
|
@@ -1998,7 +2011,7 @@ function Kt(e) {
|
|
|
1998
2011
|
attachmentsRef: r,
|
|
1999
2012
|
collected: n.collected,
|
|
2000
2013
|
proxyFetch: x
|
|
2001
|
-
}), a = t.scopedSubagentId ? W(t.scopedSubagentId) : null, o = a ? i.filter((e) => (a.crossAgentToolIds ?? []).includes(e.name)) : i, s =
|
|
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) => ({
|
|
2002
2015
|
name: `${t.id}_${r.name}`,
|
|
2003
2016
|
description: `${t.label}: ${r.summary}`,
|
|
2004
2017
|
inputSchema: r.inputSchema,
|
|
@@ -2022,12 +2035,12 @@ function Kt(e) {
|
|
|
2022
2035
|
}
|
|
2023
2036
|
//#endregion
|
|
2024
2037
|
//#region src/presentation/deriveHistoryTitle.ts
|
|
2025
|
-
function
|
|
2038
|
+
function Jt(e, t) {
|
|
2026
2039
|
return e.deriveHistoryTitle?.(t) ?? e.label;
|
|
2027
2040
|
}
|
|
2028
2041
|
//#endregion
|
|
2029
2042
|
//#region src/presentation/ResultDestinationPicker.tsx
|
|
2030
|
-
function
|
|
2043
|
+
function Yt({ manifest: e, result: t, meta: n, taskId: r, initiallyApplied: i, onApplied: a, extraDestinations: o }) {
|
|
2031
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();
|
|
2032
2045
|
e.destinationIds.forEach((e) => {
|
|
2033
2046
|
let t = _[e];
|
|
@@ -2045,7 +2058,7 @@ function Jt({ manifest: e, result: t, meta: n, taskId: r, initiallyApplied: i, o
|
|
|
2045
2058
|
storageProvider: l?.storageProvider ?? null,
|
|
2046
2059
|
proxyFetch: u
|
|
2047
2060
|
}, n);
|
|
2048
|
-
m((e) => new Set(e).add(i)), a?.(i), d?.id && c.commitEntityChat(e.id, d.id, r, l?.id, 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));
|
|
2049
2062
|
} catch (e) {
|
|
2050
2063
|
g(e instanceof Error ? e.message : String(e));
|
|
2051
2064
|
} finally {
|
|
@@ -2078,16 +2091,16 @@ function Jt({ manifest: e, result: t, meta: n, taskId: r, initiallyApplied: i, o
|
|
|
2078
2091
|
}
|
|
2079
2092
|
//#endregion
|
|
2080
2093
|
//#region src/presentation/reports/subagentReportRegistry.tsx
|
|
2081
|
-
var
|
|
2082
|
-
function Xt(e) {
|
|
2083
|
-
Object.assign(Yt, e);
|
|
2084
|
-
}
|
|
2094
|
+
var Xt = {};
|
|
2085
2095
|
function Zt(e) {
|
|
2086
|
-
|
|
2096
|
+
Object.assign(Xt, e);
|
|
2097
|
+
}
|
|
2098
|
+
function Qt(e) {
|
|
2099
|
+
return Xt[e];
|
|
2087
2100
|
}
|
|
2088
2101
|
//#endregion
|
|
2089
2102
|
//#region src/presentation/reports/GenericResultPreview.tsx
|
|
2090
|
-
function
|
|
2103
|
+
function $t({ result: e }) {
|
|
2091
2104
|
let [t, n] = N(!1);
|
|
2092
2105
|
return /* @__PURE__ */ I("div", {
|
|
2093
2106
|
className: `relative cursor-pointer rounded-md border border-border/60 ${t ? "max-h-80 overflow-y-auto" : "max-h-28 overflow-hidden"}`,
|
|
@@ -2104,7 +2117,7 @@ function Qt({ result: e }) {
|
|
|
2104
2117
|
}
|
|
2105
2118
|
//#endregion
|
|
2106
2119
|
//#region src/presentation/liveAnchorDestination.ts
|
|
2107
|
-
function
|
|
2120
|
+
function en(e, t, n) {
|
|
2108
2121
|
return e.length === 0 ? null : {
|
|
2109
2122
|
id: "live-component",
|
|
2110
2123
|
label: "Applica al componente aperto",
|
|
@@ -2115,37 +2128,37 @@ function $t(e, t, n) {
|
|
|
2115
2128
|
}
|
|
2116
2129
|
//#endregion
|
|
2117
2130
|
//#region src/presentation/subagentControls.ts
|
|
2118
|
-
var
|
|
2119
|
-
function tn(e) {
|
|
2120
|
-
Object.assign(en, e);
|
|
2121
|
-
}
|
|
2131
|
+
var tn = {};
|
|
2122
2132
|
function nn(e) {
|
|
2123
|
-
|
|
2133
|
+
Object.assign(tn, e);
|
|
2134
|
+
}
|
|
2135
|
+
function rn(e) {
|
|
2136
|
+
return tn[e];
|
|
2124
2137
|
}
|
|
2125
2138
|
//#endregion
|
|
2126
2139
|
//#region src/presentation/chatTitles.ts
|
|
2127
|
-
function
|
|
2140
|
+
function an(e, t = 6e3) {
|
|
2128
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");
|
|
2129
2142
|
return n.length > t ? `${n.slice(0, t * .7)}\n\n[…]\n\n${n.slice(-t * .3)}` : n;
|
|
2130
2143
|
}
|
|
2131
|
-
function
|
|
2144
|
+
function on(e) {
|
|
2132
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);
|
|
2133
2146
|
}
|
|
2134
|
-
function
|
|
2147
|
+
function sn(e, t) {
|
|
2135
2148
|
try {
|
|
2136
2149
|
return e.definition.executor?.catalogProviders?.(e.toParams(t));
|
|
2137
2150
|
} catch {
|
|
2138
2151
|
return;
|
|
2139
2152
|
}
|
|
2140
2153
|
}
|
|
2141
|
-
function
|
|
2142
|
-
let a =
|
|
2154
|
+
function cn(e, t, n, r, i) {
|
|
2155
|
+
let a = sn(e, t), o = (e) => {
|
|
2143
2156
|
let t = e ? b(e) : null;
|
|
2144
2157
|
return !(!t || !i[t.provider] || a && !a.includes(t.provider));
|
|
2145
2158
|
};
|
|
2146
2159
|
return o(n) ? n : Object.values(r).flat().map((e) => e.id).find(o);
|
|
2147
2160
|
}
|
|
2148
|
-
function
|
|
2161
|
+
function ln(e) {
|
|
2149
2162
|
let t = S()?.registry ?? {}, { modelsByProvider: n, selectedModel: r } = Pt(), i = M({
|
|
2150
2163
|
registry: t,
|
|
2151
2164
|
modelsByProvider: n,
|
|
@@ -2160,15 +2173,15 @@ function cn(e) {
|
|
|
2160
2173
|
if (!e) return !1;
|
|
2161
2174
|
let o = Re(e, t, n), s = W(t), c = `${e}:${t}:${n}`;
|
|
2162
2175
|
if (!o || !s?.autoTitle || o.name || !We(o) || a.current.has(c)) return !1;
|
|
2163
|
-
let { registry: l, modelsByProvider: u, selectedModel: d } = i.current, f =
|
|
2176
|
+
let { registry: l, modelsByProvider: u, selectedModel: d } = i.current, f = cn(s, o.params, r ?? d, u, l), p = f ? b(f) : null;
|
|
2164
2177
|
if (!p) return !1;
|
|
2165
2178
|
a.current.add(c);
|
|
2166
2179
|
try {
|
|
2167
2180
|
let r = await l[p.provider].complete({
|
|
2168
|
-
prompt: X().chatTitle.replace("{chat}",
|
|
2181
|
+
prompt: X().chatTitle.replace("{chat}", an(o.activity)),
|
|
2169
2182
|
model: p.model,
|
|
2170
2183
|
history: []
|
|
2171
|
-
}), i = r && r.type === "text" ?
|
|
2184
|
+
}), i = r && r.type === "text" ? on(r.text) : "";
|
|
2172
2185
|
return i ? Ke(e, t, n, i, "model") : !1;
|
|
2173
2186
|
} catch {
|
|
2174
2187
|
return !1;
|
|
@@ -2177,7 +2190,7 @@ function cn(e) {
|
|
|
2177
2190
|
}
|
|
2178
2191
|
}, [e]), s = Object.keys(n).length > 0;
|
|
2179
2192
|
return k(() => {
|
|
2180
|
-
e && s && !
|
|
2193
|
+
e && s && !un.has(e) && (un.add(e), (async () => {
|
|
2181
2194
|
for (let t of Ye(e)) {
|
|
2182
2195
|
let n = W(t.subagentId);
|
|
2183
2196
|
if (n?.autoTitle) {
|
|
@@ -2195,11 +2208,11 @@ function cn(e) {
|
|
|
2195
2208
|
o
|
|
2196
2209
|
]), o;
|
|
2197
2210
|
}
|
|
2198
|
-
var
|
|
2199
|
-
function
|
|
2200
|
-
let c =
|
|
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) => {
|
|
2201
2214
|
e.definition.conversational || m(t);
|
|
2202
|
-
}, [g, _] = N([]), [v, y] = N(null), b =
|
|
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);
|
|
2203
2216
|
p && p !== D.current && (D.current = p, E.current = (r?.length ?? 0) + c.activity.length);
|
|
2204
2217
|
let O = M(!1), A = c.remote || !c.hasProviders || c.selectedModel !== "";
|
|
2205
2218
|
k(() => {
|
|
@@ -2223,7 +2236,7 @@ function dn({ manifest: e, params: t, extraDestinations: n, precedingActivity: r
|
|
|
2223
2236
|
...t,
|
|
2224
2237
|
pinnedEntityId: r
|
|
2225
2238
|
}).then((n) => {
|
|
2226
|
-
n?.id && l.commitEntityChat(e.id, n.id, f, u.id, t,
|
|
2239
|
+
n?.id && l.commitEntityChat(e.id, n.id, f, u.id, t, Jt(e, t));
|
|
2227
2240
|
}).catch((e) => y(e instanceof Error ? e.message : String(e))));
|
|
2228
2241
|
});
|
|
2229
2242
|
}, [
|
|
@@ -2242,11 +2255,11 @@ function dn({ manifest: e, params: t, extraDestinations: n, precedingActivity: r
|
|
|
2242
2255
|
p,
|
|
2243
2256
|
x,
|
|
2244
2257
|
S
|
|
2245
|
-
]), ee = j(() => l.componentAnchors.filter((t) => t.subagentId === e.id && t.onResult), [l.componentAnchors, e.id]), B = j(() =>
|
|
2258
|
+
]), ee = j(() => l.componentAnchors.filter((t) => t.subagentId === e.id && t.onResult), [l.componentAnchors, e.id]), B = j(() => en(ee, t, f), [
|
|
2246
2259
|
ee,
|
|
2247
2260
|
t,
|
|
2248
2261
|
f
|
|
2249
|
-
]), te = j(() => B ? [B, ...n ?? []] : n, [B, n]), V = e.chatEntityId?.(t), H =
|
|
2262
|
+
]), te = j(() => B ? [B, ...n ?? []] : n, [B, n]), V = e.chatEntityId?.(t), H = ln(u?.id), U = M(!1), W = M(!1);
|
|
2250
2263
|
k(() => {
|
|
2251
2264
|
let n = !U.current && c.running, i = U.current && !c.running;
|
|
2252
2265
|
if (U.current = c.running, !n && !i || !V || !u) return;
|
|
@@ -2262,14 +2275,14 @@ function dn({ manifest: e, params: t, extraDestinations: n, precedingActivity: r
|
|
|
2262
2275
|
subagentId: e.id,
|
|
2263
2276
|
entityId: V,
|
|
2264
2277
|
params: t,
|
|
2265
|
-
title:
|
|
2278
|
+
title: Jt(e, t),
|
|
2266
2279
|
history: a.history,
|
|
2267
2280
|
activity: o
|
|
2268
2281
|
}), i && e.autoTitle && H(e.id, V, c.selectedModel));
|
|
2269
2282
|
}, [c.running]);
|
|
2270
2283
|
let G = () => {
|
|
2271
2284
|
O.current = !0, c.running && c.stop(), l.closeTask(f);
|
|
2272
|
-
}, K = M(
|
|
2285
|
+
}, K = M(rn(e.id) ?? dn).current, q = K({
|
|
2273
2286
|
params: t,
|
|
2274
2287
|
taskId: f,
|
|
2275
2288
|
running: c.running,
|
|
@@ -2280,7 +2293,7 @@ function dn({ manifest: e, params: t, extraDestinations: n, precedingActivity: r
|
|
|
2280
2293
|
return k(() => {
|
|
2281
2294
|
O.current || l.openTask({
|
|
2282
2295
|
id: f,
|
|
2283
|
-
title:
|
|
2296
|
+
title: Jt(e, t),
|
|
2284
2297
|
icon: e.icon,
|
|
2285
2298
|
agent: c,
|
|
2286
2299
|
onApplied: (e) => h(e),
|
|
@@ -2299,12 +2312,12 @@ function dn({ manifest: e, params: t, extraDestinations: n, precedingActivity: r
|
|
|
2299
2312
|
}) : b?.kind === "editable" ? /* @__PURE__ */ F(b.Report, {
|
|
2300
2313
|
result: p,
|
|
2301
2314
|
onResultChange: R
|
|
2302
|
-
}) : /* @__PURE__ */ F(
|
|
2315
|
+
}) : /* @__PURE__ */ F($t, { result: z }),
|
|
2303
2316
|
v && /* @__PURE__ */ I("p", {
|
|
2304
2317
|
className: "text-xs text-destructive",
|
|
2305
2318
|
children: ["Salvataggio automatico non riuscito: ", v]
|
|
2306
2319
|
}),
|
|
2307
|
-
/* @__PURE__ */ F(
|
|
2320
|
+
/* @__PURE__ */ F(Yt, {
|
|
2308
2321
|
manifest: e,
|
|
2309
2322
|
result: z,
|
|
2310
2323
|
meta: t,
|
|
@@ -2345,8 +2358,8 @@ function dn({ manifest: e, params: t, extraDestinations: n, precedingActivity: r
|
|
|
2345
2358
|
}
|
|
2346
2359
|
//#endregion
|
|
2347
2360
|
//#region src/presentation/OrchestratorRunner.tsx
|
|
2348
|
-
function
|
|
2349
|
-
let t = $(), n =
|
|
2361
|
+
function pn({ userGoal: e }) {
|
|
2362
|
+
let t = $(), n = Ht(j(() => qt({
|
|
2350
2363
|
unavailable: t.orchestratorUnavailable,
|
|
2351
2364
|
continueWithoutAi: t.orchestratorContinueWithoutAi,
|
|
2352
2365
|
preparing: t.orchestratorPreparing,
|
|
@@ -2394,7 +2407,7 @@ function fn({ userGoal: e }) {
|
|
|
2394
2407
|
let h = j(() => [...f.current?.activity ?? [], ...n.activity], [n.activity]);
|
|
2395
2408
|
if (!i) return null;
|
|
2396
2409
|
let g = W(i.subagentId);
|
|
2397
|
-
return g ? /* @__PURE__ */ F(
|
|
2410
|
+
return g ? /* @__PURE__ */ F(fn, {
|
|
2398
2411
|
manifest: g,
|
|
2399
2412
|
params: i.params,
|
|
2400
2413
|
extraDestinations: c.current,
|
|
@@ -2405,8 +2418,8 @@ function fn({ userGoal: e }) {
|
|
|
2405
2418
|
}
|
|
2406
2419
|
//#endregion
|
|
2407
2420
|
//#region src/presentation/ManualEntryRunner.tsx
|
|
2408
|
-
function
|
|
2409
|
-
let r =
|
|
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) => {
|
|
2410
2423
|
if (!e.manualEntry) return;
|
|
2411
2424
|
let n;
|
|
2412
2425
|
try {
|
|
@@ -2433,7 +2446,7 @@ function pn({ manifest: e, extraDestinations: n }) {
|
|
|
2433
2446
|
p
|
|
2434
2447
|
]), S = (e) => {
|
|
2435
2448
|
u((t) => t.includes(e) ? t : [...t, e]);
|
|
2436
|
-
}, C = j(() => a.componentAnchors.filter((t) => t.subagentId === e.id && t.onResult), [a.componentAnchors, e.id]), w = j(() => h ?
|
|
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, [
|
|
2437
2450
|
C,
|
|
2438
2451
|
h,
|
|
2439
2452
|
o
|
|
@@ -2462,8 +2475,8 @@ function pn({ manifest: e, extraDestinations: n }) {
|
|
|
2462
2475
|
}) : d?.kind === "editable" ? /* @__PURE__ */ F(d.Report, {
|
|
2463
2476
|
result: s,
|
|
2464
2477
|
onResultChange: b
|
|
2465
|
-
}) : /* @__PURE__ */ F(
|
|
2466
|
-
/* @__PURE__ */ F(
|
|
2478
|
+
}) : /* @__PURE__ */ F($t, { result: x }),
|
|
2479
|
+
/* @__PURE__ */ F(Yt, {
|
|
2467
2480
|
manifest: e,
|
|
2468
2481
|
result: x,
|
|
2469
2482
|
meta: h ?? {},
|
|
@@ -2500,7 +2513,7 @@ function pn({ manifest: e, extraDestinations: n }) {
|
|
|
2500
2513
|
}
|
|
2501
2514
|
//#endregion
|
|
2502
2515
|
//#region src/presentation/Agentico.tsx
|
|
2503
|
-
function
|
|
2516
|
+
function hn(e, t) {
|
|
2504
2517
|
return Object.values(e).flat().map((e) => {
|
|
2505
2518
|
let n = t?.(e.provider, e.providerLabel ?? e.provider);
|
|
2506
2519
|
return {
|
|
@@ -2512,7 +2525,7 @@ function mn(e, t) {
|
|
|
2512
2525
|
};
|
|
2513
2526
|
});
|
|
2514
2527
|
}
|
|
2515
|
-
function
|
|
2528
|
+
function gn({ task: e }) {
|
|
2516
2529
|
let t = $(), [n, r] = N(""), { agent: i, onApplied: a, manualEntry: o } = e, c = i.running, l = (e) => {
|
|
2517
2530
|
if (r(""), o) {
|
|
2518
2531
|
o.onSubmit(e.text);
|
|
@@ -2524,7 +2537,7 @@ function hn({ task: e }) {
|
|
|
2524
2537
|
}).then((e) => {
|
|
2525
2538
|
e && a(e);
|
|
2526
2539
|
});
|
|
2527
|
-
}, 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, ...
|
|
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);
|
|
2528
2541
|
return /* @__PURE__ */ F(s, {
|
|
2529
2542
|
value: n,
|
|
2530
2543
|
onChange: r,
|
|
@@ -2544,7 +2557,7 @@ function hn({ task: e }) {
|
|
|
2544
2557
|
maxHeight: 220
|
|
2545
2558
|
});
|
|
2546
2559
|
}
|
|
2547
|
-
function
|
|
2560
|
+
function _n() {
|
|
2548
2561
|
let { startOrchestrator: e } = tt(), t = $(), [n, r] = N(""), { hasProviders: i, modelsByProvider: a, selectedModel: o, setSelectedModel: c } = Pt(), l = (t) => {
|
|
2549
2562
|
t.text.trim() && (e(t.text.trim(), {
|
|
2550
2563
|
attachments: t.files.length > 0 ? t.files : void 0,
|
|
@@ -2558,7 +2571,7 @@ function gn() {
|
|
|
2558
2571
|
disabled: !n.trim() || u,
|
|
2559
2572
|
onSubmit: l,
|
|
2560
2573
|
attachments: !0,
|
|
2561
|
-
models:
|
|
2574
|
+
models: hn(a),
|
|
2562
2575
|
selectedModel: o,
|
|
2563
2576
|
onModelChange: c,
|
|
2564
2577
|
modelPlaceholder: t.selectModelPlaceholder,
|
|
@@ -2566,7 +2579,7 @@ function gn() {
|
|
|
2566
2579
|
maxHeight: 220
|
|
2567
2580
|
});
|
|
2568
2581
|
}
|
|
2569
|
-
function
|
|
2582
|
+
function vn({ chat: e, onClose: t }) {
|
|
2570
2583
|
let n = $(), r = C();
|
|
2571
2584
|
return /* @__PURE__ */ F(h, {
|
|
2572
2585
|
title: n.renameChat,
|
|
@@ -2589,7 +2602,7 @@ function _n({ chat: e, onClose: t }) {
|
|
|
2589
2602
|
})
|
|
2590
2603
|
});
|
|
2591
2604
|
}
|
|
2592
|
-
function
|
|
2605
|
+
function yn(e, t, n = Date.now()) {
|
|
2593
2606
|
let r = Math.round((e - n) / 1e3), i = new Intl.RelativeTimeFormat(t, {
|
|
2594
2607
|
numeric: "auto",
|
|
2595
2608
|
style: "short"
|
|
@@ -2601,7 +2614,7 @@ function vn(e, t, n = Date.now()) {
|
|
|
2601
2614
|
]) if (Math.abs(r) >= t) return i.format(Math.round(r / t), e);
|
|
2602
2615
|
return i.format(0, "minute");
|
|
2603
2616
|
}
|
|
2604
|
-
function
|
|
2617
|
+
function bn({ card: e }) {
|
|
2605
2618
|
let t = $();
|
|
2606
2619
|
return e.humanSummaryOnly ? /* @__PURE__ */ I("div", {
|
|
2607
2620
|
className: "space-y-2 rounded-lg border border-border/60 p-3",
|
|
@@ -2657,7 +2670,7 @@ function yn({ card: e }) {
|
|
|
2657
2670
|
]
|
|
2658
2671
|
});
|
|
2659
2672
|
}
|
|
2660
|
-
function
|
|
2673
|
+
function xn({ messages: e }) {
|
|
2661
2674
|
return /* @__PURE__ */ F("div", {
|
|
2662
2675
|
className: "space-y-2 rounded-lg border border-border/60 p-3",
|
|
2663
2676
|
children: e.map((e, t) => /* @__PURE__ */ F("p", {
|
|
@@ -2666,7 +2679,7 @@ function bn({ messages: e }) {
|
|
|
2666
2679
|
}, t))
|
|
2667
2680
|
});
|
|
2668
2681
|
}
|
|
2669
|
-
function
|
|
2682
|
+
function Sn({ scopeId: e, currentTaskId: n, open: r, onOpenChange: i, onSelect: a, onNewChat: o, onArchivedCurrent: s }) {
|
|
2670
2683
|
let c = $(), { locale: d } = w(), [p, m] = N(""), [h, g] = N(0);
|
|
2671
2684
|
k(() => Ie(() => g((e) => e + 1)), []);
|
|
2672
2685
|
let _ = j(() => r ? Ye(e) : [], [
|
|
@@ -2755,19 +2768,19 @@ function xn({ scopeId: e, currentTaskId: n, open: r, onOpenChange: i, onSelect:
|
|
|
2755
2768
|
}), /* @__PURE__ */ F("span", {
|
|
2756
2769
|
className: "shrink-0 text-xs text-muted-foreground",
|
|
2757
2770
|
title: `${c.chatStarted.replace("{at}", new Date(qe(e)).toLocaleString(d))} · ${c.chatLastMessage.replace("{at}", new Date(e.savedAt).toLocaleString(d))}`,
|
|
2758
|
-
children:
|
|
2771
|
+
children: yn(qe(e), d)
|
|
2759
2772
|
})]
|
|
2760
2773
|
})
|
|
2761
2774
|
}, `${e.subagentId}:${e.entityId}`);
|
|
2762
2775
|
})
|
|
2763
|
-
}), v && /* @__PURE__ */ F(
|
|
2776
|
+
}), v && /* @__PURE__ */ F(vn, {
|
|
2764
2777
|
chat: v,
|
|
2765
2778
|
onClose: () => y(null)
|
|
2766
2779
|
})] });
|
|
2767
2780
|
}
|
|
2768
|
-
function
|
|
2781
|
+
function Cn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}) {
|
|
2769
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);
|
|
2770
|
-
|
|
2783
|
+
ln(w?.id);
|
|
2771
2784
|
let A = Ot({
|
|
2772
2785
|
defaultWidth: e,
|
|
2773
2786
|
minWidth: n,
|
|
@@ -2811,7 +2824,7 @@ function Sn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
|
|
|
2811
2824
|
});
|
|
2812
2825
|
return n.observe(t), () => n.disconnect();
|
|
2813
2826
|
}, [a?.id, o]);
|
|
2814
|
-
let J = s ? /* @__PURE__ */ F(
|
|
2827
|
+
let J = s ? /* @__PURE__ */ F(pn, { userGoal: s }, c) : null, ie = f ? W(f.subagentId) : void 0, ae = f && ie ? /* @__PURE__ */ F(fn, {
|
|
2815
2828
|
manifest: ie,
|
|
2816
2829
|
params: f.snapshot.params,
|
|
2817
2830
|
taskId: Xe(f.subagentId, f.entityId),
|
|
@@ -2819,14 +2832,14 @@ function Sn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
|
|
|
2819
2832
|
history: f.snapshot.history,
|
|
2820
2833
|
activity: f.snapshot.activity
|
|
2821
2834
|
}
|
|
2822
|
-
}, p) : null, Y = g ? W(g.subagentId) : void 0, oe = g && Y ? /* @__PURE__ */ F(
|
|
2835
|
+
}, p) : null, Y = g ? W(g.subagentId) : void 0, oe = g && Y ? /* @__PURE__ */ F(mn, {
|
|
2823
2836
|
manifest: Y,
|
|
2824
2837
|
extraDestinations: g.extraDestinations
|
|
2825
|
-
}, _) : null, X = b ? W(b.subagentId) : void 0, Z = b && X ? /* @__PURE__ */ F(
|
|
2838
|
+
}, _) : null, X = b ? W(b.subagentId) : void 0, Z = b && X ? /* @__PURE__ */ F(fn, {
|
|
2826
2839
|
manifest: X,
|
|
2827
2840
|
params: b.params,
|
|
2828
2841
|
extraDestinations: b.extraDestinations
|
|
2829
|
-
}, x) : null, se = S ? W(S.subagentId) : void 0, ce = S && se ? /* @__PURE__ */ F(
|
|
2842
|
+
}, x) : null, se = S ? W(S.subagentId) : void 0, ce = S && se ? /* @__PURE__ */ F(fn, {
|
|
2830
2843
|
manifest: se,
|
|
2831
2844
|
params: S.params,
|
|
2832
2845
|
taskId: S.taskId,
|
|
@@ -2857,7 +2870,7 @@ function Sn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
|
|
|
2857
2870
|
className: "min-w-0 flex-1 truncate text-lg font-semibold leading-tight",
|
|
2858
2871
|
children: a ? a.title : "Agentico"
|
|
2859
2872
|
}),
|
|
2860
|
-
w && /* @__PURE__ */ F(
|
|
2873
|
+
w && /* @__PURE__ */ F(Sn, {
|
|
2861
2874
|
scopeId: w.id,
|
|
2862
2875
|
currentTaskId: a?.id ?? null,
|
|
2863
2876
|
open: D,
|
|
@@ -2928,7 +2941,7 @@ function Sn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
|
|
|
2928
2941
|
})
|
|
2929
2942
|
]
|
|
2930
2943
|
})
|
|
2931
|
-
] }) : d.length > 0 ? /* @__PURE__ */ F(
|
|
2944
|
+
] }) : d.length > 0 ? /* @__PURE__ */ F(xn, { messages: d }) : u ? /* @__PURE__ */ F(bn, { card: u }) : /* @__PURE__ */ F("p", {
|
|
2932
2945
|
className: "text-xs text-muted-foreground",
|
|
2933
2946
|
children: l ?? T.orchestratorStarterHint
|
|
2934
2947
|
})
|
|
@@ -2966,7 +2979,7 @@ function Sn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
|
|
|
2966
2979
|
children: [a?.panelActions && /* @__PURE__ */ F("div", {
|
|
2967
2980
|
className: "mb-2",
|
|
2968
2981
|
children: a.panelActions
|
|
2969
|
-
}), a ? /* @__PURE__ */ F(
|
|
2982
|
+
}), a ? /* @__PURE__ */ F(gn, { task: a }, a.id) : /* @__PURE__ */ F(_n, {})]
|
|
2970
2983
|
})
|
|
2971
2984
|
]
|
|
2972
2985
|
})
|
|
@@ -2980,13 +2993,13 @@ function Sn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
|
|
|
2980
2993
|
}
|
|
2981
2994
|
//#endregion
|
|
2982
2995
|
//#region src/presentation/useAgenticoPageContext.ts
|
|
2983
|
-
function
|
|
2996
|
+
function wn(e, t) {
|
|
2984
2997
|
let { setPageContext: n } = tt(), r = M(crypto.randomUUID()).current;
|
|
2985
2998
|
k(() => (n(r, e, t ?? null), () => n(r, null)), [e, t]);
|
|
2986
2999
|
}
|
|
2987
3000
|
//#endregion
|
|
2988
3001
|
//#region src/presentation/useSubagentComponentContext.ts
|
|
2989
|
-
function
|
|
3002
|
+
function Tn(e, t, n, r, i = !0, a) {
|
|
2990
3003
|
let { registerComponentAnchor: o } = tt(), s = M(crypto.randomUUID()).current, c = M(n);
|
|
2991
3004
|
c.current = n, k(() => {
|
|
2992
3005
|
if (i) return o(s, {
|
|
@@ -3005,6 +3018,6 @@ function wn(e, t, n, r, i = !0, a) {
|
|
|
3005
3018
|
]);
|
|
3006
3019
|
}
|
|
3007
3020
|
//#endregion
|
|
3008
|
-
export { xt as AGENTICO_MAX_WIDTH, bt as AGENTICO_MIN_WIDTH, yt as AGENTICO_WIDTH, St as AGENTICO_WIDTH_STORAGE_KEY,
|
|
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 };
|
|
3009
3022
|
|
|
3010
3023
|
//# sourceMappingURL=index.mjs.map
|