@llmnative/agentico 0.19.0 → 0.20.1
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/README.md +1 -0
- package/dist/index.js +13 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +606 -540
- package/dist/index.mjs.map +1 -1
- package/dist/types/domain/threadEvents.d.ts +20 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/presentation/AgenticoContext.d.ts +7 -0
- package/llms.txt +1 -0
- package/package.json +1 -1
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, Card as r, ChatMarkdown as i, ChatQuestions as a, ChatReasoning as o, Chatbot as s, Code as c, Dropdown as l, DropdownItem as u, Form as d, Icon as f, Identicon as p, ImageAvatar as m, Input as h, LoadingButton as g, Modal as _, ModalYesNo as v, PromptUtils as y, Tree as b, getAIModelCatalog as x, interpolate as S, parseAIModelRef as C, proxyFetch as w, useAIProviderRegistry as T, useFormController as ee, useI18n as E, useProxy as D } from "@llmnative/react";
|
|
3
|
-
import O, { createContext as te, useCallback as k, useContext as A, useEffect as j, useLayoutEffect as
|
|
4
|
-
import { Fragment as
|
|
3
|
+
import O, { createContext as te, useCallback as k, useContext as A, useEffect as j, useLayoutEffect as ne, useMemo as M, useRef as N, useState as P } from "react";
|
|
4
|
+
import { Fragment as F, jsx as I, jsxs as L } from "react/jsx-runtime";
|
|
5
5
|
//#region src/domain/messageParts.ts
|
|
6
|
-
var
|
|
7
|
-
function
|
|
6
|
+
var re = "text", R = "reasoning";
|
|
7
|
+
function ie(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,15 +14,15 @@ function B(e, t, n) {
|
|
|
14
14
|
...i.slice(a)
|
|
15
15
|
] : [...i, t];
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function z(e) {
|
|
18
18
|
return e.filter((e) => e.type === "text").map((e) => e.text).filter(Boolean).join("\n\n");
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function B(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
|
|
25
|
+
function V(e) {
|
|
26
26
|
return e;
|
|
27
27
|
}
|
|
28
28
|
//#endregion
|
|
@@ -43,30 +43,30 @@ var G = [];
|
|
|
43
43
|
function K(...e) {
|
|
44
44
|
G = e;
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function q(e) {
|
|
47
47
|
return G.flatMap((t) => t(e));
|
|
48
48
|
}
|
|
49
49
|
//#endregion
|
|
50
50
|
//#region src/domain/mcpTool.ts
|
|
51
|
-
function
|
|
51
|
+
function oe(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
|
|
58
|
+
function se(e, t, n, r) {
|
|
59
59
|
return {
|
|
60
60
|
name: e,
|
|
61
61
|
description: t,
|
|
62
|
-
inputSchema:
|
|
63
|
-
...r ? { outputSchema:
|
|
62
|
+
inputSchema: oe(n),
|
|
63
|
+
...r ? { outputSchema: oe(r) } : {}
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
66
|
//#endregion
|
|
67
67
|
//#region src/domain/subagentUsageCard.ts
|
|
68
|
-
function
|
|
69
|
-
let t =
|
|
68
|
+
function ce(e) {
|
|
69
|
+
let t = oe(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 le(e) {
|
|
|
80
80
|
}
|
|
81
81
|
//#endregion
|
|
82
82
|
//#region src/domain/prompts.ts
|
|
83
|
-
var
|
|
83
|
+
var le = {
|
|
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 ue = {
|
|
|
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
|
-
},
|
|
113
|
+
}, ue = {
|
|
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,18 +140,18 @@ var ue = {
|
|
|
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
|
-
},
|
|
143
|
+
}, de = le;
|
|
144
144
|
function fe(e) {
|
|
145
|
-
|
|
146
|
-
...
|
|
145
|
+
de = {
|
|
146
|
+
...de,
|
|
147
147
|
...e
|
|
148
148
|
};
|
|
149
149
|
}
|
|
150
150
|
function J() {
|
|
151
|
-
return
|
|
151
|
+
return de;
|
|
152
152
|
}
|
|
153
153
|
function pe() {
|
|
154
|
-
|
|
154
|
+
de = le;
|
|
155
155
|
}
|
|
156
156
|
//#endregion
|
|
157
157
|
//#region src/domain/cli/renderManifestCli.ts
|
|
@@ -159,7 +159,7 @@ function me(e, t) {
|
|
|
159
159
|
return `${e} ${t.map((e) => e.required ? `--${e.key} <${e.type}>` : `[--${e.key} <${e.type}>]`).join(" ")}`.trim();
|
|
160
160
|
}
|
|
161
161
|
function he(e, t) {
|
|
162
|
-
let n =
|
|
162
|
+
let n = ce(t), r = me(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}`,
|
|
@@ -700,11 +700,11 @@ function $() {
|
|
|
700
700
|
//#region src/presentation/AgenticoContext.tsx
|
|
701
701
|
var lt = "agentico-orchestrator", ut = te(null);
|
|
702
702
|
function dt({ children: e, scope: t = null, person: n = null, threadEvents: r = null }) {
|
|
703
|
-
let [i, a] =
|
|
703
|
+
let [i, a] = P(null), o = N(null);
|
|
704
704
|
j(() => {
|
|
705
705
|
o.current = i;
|
|
706
706
|
}, [i]);
|
|
707
|
-
let [s, c] =
|
|
707
|
+
let [s, c] = P(!1), l = t?.id;
|
|
708
708
|
j(() => {
|
|
709
709
|
l && Le(l).catch(() => void 0);
|
|
710
710
|
}, [l]);
|
|
@@ -718,8 +718,13 @@ function dt({ children: e, scope: t = null, person: n = null, threadEvents: r =
|
|
|
718
718
|
a(n);
|
|
719
719
|
}, []), d = k((e) => {
|
|
720
720
|
a((t) => t && t.id === e ? null : t);
|
|
721
|
-
}, []), f = k(() => c((e) => !e), []), p = k(() => c(!0), []), [m, h] =
|
|
722
|
-
|
|
721
|
+
}, []), f = k(() => c((e) => !e), []), p = k(() => c(!0), []), [m, h] = P(null), g = k((e) => {
|
|
722
|
+
c(!0), h((t) => ({
|
|
723
|
+
text: e,
|
|
724
|
+
nonce: (t?.nonce ?? 0) + 1
|
|
725
|
+
}));
|
|
726
|
+
}, []), [_, v] = P(null), [y, b] = P(void 0), [x, S] = P(void 0), [C, w] = P(void 0), [T, ee] = P(null), [E, D] = P(null), [O, te] = P(void 0), [A, ne] = P([]), F = k((e, t, n = null) => {
|
|
727
|
+
ne((r) => {
|
|
723
728
|
let i = r.filter((t) => t.id !== e);
|
|
724
729
|
return t ? [...i, {
|
|
725
730
|
id: e,
|
|
@@ -727,29 +732,29 @@ function dt({ children: e, scope: t = null, person: n = null, threadEvents: r =
|
|
|
727
732
|
card: n
|
|
728
733
|
}] : i;
|
|
729
734
|
});
|
|
730
|
-
}, []),
|
|
731
|
-
|
|
735
|
+
}, []), L = A.length > 0 ? A[A.length - 1] : null, [re, R] = P([]), ie = k((e, t) => {
|
|
736
|
+
R((n) => {
|
|
732
737
|
let r = n.filter((t) => t.id !== e);
|
|
733
738
|
return t ? [...r, {
|
|
734
739
|
id: e,
|
|
735
740
|
...t
|
|
736
741
|
}] : r;
|
|
737
742
|
});
|
|
738
|
-
}, []),
|
|
743
|
+
}, []), z = M(() => re.map((e) => ({
|
|
739
744
|
subagentId: e.subagentId,
|
|
740
745
|
componentKey: e.componentKey,
|
|
741
746
|
onResult: e.onResult,
|
|
742
747
|
pinnedEntityId: e.pinnedEntityId
|
|
743
|
-
})), [
|
|
748
|
+
})), [re]), B = M(() => {
|
|
744
749
|
let e = /* @__PURE__ */ new Map();
|
|
745
|
-
for (let t of
|
|
750
|
+
for (let t of re) e.set(t.subagentId, {
|
|
746
751
|
subagentId: t.subagentId,
|
|
747
752
|
componentKey: t.componentKey,
|
|
748
753
|
onResult: t.onResult,
|
|
749
754
|
contextInfo: t.contextInfo
|
|
750
755
|
});
|
|
751
756
|
return [...e.values()];
|
|
752
|
-
}, [
|
|
757
|
+
}, [re]), V = M(() => B.map((e) => {
|
|
753
758
|
let t = W(e.subagentId)?.componentContexts?.[e.componentKey];
|
|
754
759
|
if (!t) return null;
|
|
755
760
|
let n = e.contextInfo ? `${t.agenticoHint}\n${e.contextInfo}` : t.agenticoHint;
|
|
@@ -758,21 +763,21 @@ function dt({ children: e, scope: t = null, person: n = null, threadEvents: r =
|
|
|
758
763
|
agenticoHint: n,
|
|
759
764
|
userMessage: t.userMessage
|
|
760
765
|
};
|
|
761
|
-
}).filter((e) => e !== null), [
|
|
762
|
-
if (
|
|
763
|
-
if (
|
|
764
|
-
let e =
|
|
766
|
+
}).filter((e) => e !== null), [B]), H = M(() => V.map((e) => e.userMessage), [V]), U = M(() => {
|
|
767
|
+
if (V.length === 0) return null;
|
|
768
|
+
if (V.length === 1) return V[0].agenticoHint;
|
|
769
|
+
let e = V.map((e, t) => `${t + 1}. ${e.agenticoHint}`).join("\n");
|
|
765
770
|
return `${J().multipleCandidates}\n\n${e}`;
|
|
766
|
-
}, [
|
|
771
|
+
}, [V]) ?? L?.text ?? null, ae = V.length > 0 ? null : L?.card ?? null, G = M(() => [...new Set(z.map((e) => e.subagentId))], [z]), K = G.length === 1 ? G[0] : G.length === 0 ? L?.card?.subagentId ?? null : null, q = k((e, t) => {
|
|
767
772
|
p();
|
|
768
773
|
let n = o.current;
|
|
769
774
|
if (n?.id === "agentico-orchestrator") return;
|
|
770
|
-
let r =
|
|
771
|
-
|
|
775
|
+
let r = K && n?.id.startsWith(`subagent-${K}-`) ? n : void 0;
|
|
776
|
+
D(r ? {
|
|
772
777
|
taskId: r.id,
|
|
773
778
|
activity: [...r.precedingActivity ?? [], ...r.agent.activity]
|
|
774
|
-
} : null),
|
|
775
|
-
}, [p,
|
|
779
|
+
} : null), v(e), b(t?.extraDestinations), S(t?.attachments), w(t?.model), te(t?.scopedSubagentId), ee(crypto.randomUUID());
|
|
780
|
+
}, [p, K]), oe = k((e, t, n, r, i, s) => {
|
|
776
781
|
if (!n || !r) return;
|
|
777
782
|
let c = o.current;
|
|
778
783
|
if (!c || c.id !== n) return;
|
|
@@ -789,113 +794,117 @@ function dt({ children: e, scope: t = null, person: n = null, threadEvents: r =
|
|
|
789
794
|
...e,
|
|
790
795
|
savedToDisk: !0
|
|
791
796
|
} : e));
|
|
792
|
-
}, []), [
|
|
793
|
-
p(),
|
|
797
|
+
}, []), [se, ce] = P(null), [le, ue] = P(null), de = k((e, t, n) => {
|
|
798
|
+
p(), ce({
|
|
794
799
|
subagentId: e,
|
|
795
800
|
entityId: t,
|
|
796
801
|
snapshot: n
|
|
797
|
-
}),
|
|
798
|
-
}, [p]), [
|
|
799
|
-
p(), d(lt),
|
|
802
|
+
}), ue(crypto.randomUUID());
|
|
803
|
+
}, [p]), [fe, pe] = P(null), [me, he] = P(null), Y = k((e, t) => {
|
|
804
|
+
p(), d(lt), pe({
|
|
800
805
|
subagentId: e,
|
|
801
806
|
extraDestinations: t
|
|
802
|
-
}),
|
|
803
|
-
}, [p, d]), [
|
|
804
|
-
|
|
807
|
+
}), he(crypto.randomUUID());
|
|
808
|
+
}, [p, d]), [ge, _e] = P(null), [X, ve] = P(null), ye = k((e, t, n) => {
|
|
809
|
+
pe(null), _e({
|
|
805
810
|
subagentId: e,
|
|
806
811
|
params: t,
|
|
807
812
|
extraDestinations: n
|
|
808
|
-
}),
|
|
809
|
-
}, []), [
|
|
810
|
-
p(),
|
|
813
|
+
}), ve(crypto.randomUUID());
|
|
814
|
+
}, []), [be, xe] = P(null), [Se, Ce] = P(null), we = k((e, t, n) => {
|
|
815
|
+
p(), xe({
|
|
811
816
|
subagentId: e,
|
|
812
817
|
params: t,
|
|
813
818
|
...n
|
|
814
|
-
}),
|
|
815
|
-
}, [p]),
|
|
819
|
+
}), Ce(crypto.randomUUID());
|
|
820
|
+
}, [p]), Te = k(() => {
|
|
816
821
|
let e = o.current;
|
|
817
822
|
e && e.onDismiss();
|
|
818
|
-
}, []),
|
|
823
|
+
}, []), Ee = M(() => ({
|
|
819
824
|
scope: t,
|
|
820
825
|
person: n,
|
|
821
826
|
threadEvents: r,
|
|
827
|
+
compose: g,
|
|
828
|
+
draft: m,
|
|
822
829
|
task: i,
|
|
823
830
|
isOpen: s,
|
|
824
831
|
openTask: u,
|
|
825
832
|
closeTask: d,
|
|
826
833
|
toggleOpen: f,
|
|
827
|
-
pendingGoal:
|
|
828
|
-
startOrchestrator:
|
|
829
|
-
pageContext:
|
|
830
|
-
pageContextCard:
|
|
831
|
-
setPageContext:
|
|
832
|
-
scopedSubagentId:
|
|
833
|
-
pendingScopedSubagentId:
|
|
834
|
-
componentAnchors:
|
|
835
|
-
anchoredUserMessages:
|
|
836
|
-
registerComponentAnchor:
|
|
834
|
+
pendingGoal: _,
|
|
835
|
+
startOrchestrator: q,
|
|
836
|
+
pageContext: U,
|
|
837
|
+
pageContextCard: ae,
|
|
838
|
+
setPageContext: F,
|
|
839
|
+
scopedSubagentId: K,
|
|
840
|
+
pendingScopedSubagentId: O,
|
|
841
|
+
componentAnchors: z,
|
|
842
|
+
anchoredUserMessages: H,
|
|
843
|
+
registerComponentAnchor: ie,
|
|
837
844
|
openPanel: p,
|
|
838
|
-
pendingExtraDestinations:
|
|
839
|
-
pendingAttachments:
|
|
840
|
-
pendingModel:
|
|
841
|
-
orchestratorRunId:
|
|
842
|
-
pendingCarryOver:
|
|
843
|
-
commitEntityChat:
|
|
844
|
-
resumeEntityChat:
|
|
845
|
-
pendingResume:
|
|
846
|
-
resumeRunId:
|
|
847
|
-
dismissForeignTask:
|
|
848
|
-
pendingManualEntry:
|
|
849
|
-
manualEntryRunId:
|
|
850
|
-
startManualEntry:
|
|
851
|
-
pendingResumeWithAI:
|
|
852
|
-
resumeWithAIRunId:
|
|
853
|
-
resumeWithAI:
|
|
854
|
-
startSubagent:
|
|
855
|
-
pendingStart:
|
|
856
|
-
startRunId:
|
|
845
|
+
pendingExtraDestinations: y,
|
|
846
|
+
pendingAttachments: x,
|
|
847
|
+
pendingModel: C,
|
|
848
|
+
orchestratorRunId: T,
|
|
849
|
+
pendingCarryOver: E,
|
|
850
|
+
commitEntityChat: oe,
|
|
851
|
+
resumeEntityChat: de,
|
|
852
|
+
pendingResume: se,
|
|
853
|
+
resumeRunId: le,
|
|
854
|
+
dismissForeignTask: Te,
|
|
855
|
+
pendingManualEntry: fe,
|
|
856
|
+
manualEntryRunId: me,
|
|
857
|
+
startManualEntry: Y,
|
|
858
|
+
pendingResumeWithAI: ge,
|
|
859
|
+
resumeWithAIRunId: X,
|
|
860
|
+
resumeWithAI: ye,
|
|
861
|
+
startSubagent: we,
|
|
862
|
+
pendingStart: be,
|
|
863
|
+
startRunId: Se
|
|
857
864
|
}), [
|
|
858
865
|
t,
|
|
859
866
|
n,
|
|
860
867
|
r,
|
|
868
|
+
g,
|
|
869
|
+
m,
|
|
861
870
|
i,
|
|
862
871
|
s,
|
|
863
872
|
u,
|
|
864
873
|
d,
|
|
865
874
|
f,
|
|
866
|
-
|
|
875
|
+
_,
|
|
876
|
+
q,
|
|
877
|
+
U,
|
|
867
878
|
ae,
|
|
868
|
-
|
|
879
|
+
F,
|
|
880
|
+
K,
|
|
881
|
+
O,
|
|
882
|
+
z,
|
|
883
|
+
H,
|
|
869
884
|
ie,
|
|
870
|
-
te,
|
|
871
|
-
U,
|
|
872
|
-
ee,
|
|
873
|
-
ne,
|
|
874
|
-
V,
|
|
875
|
-
R,
|
|
876
885
|
p,
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
K,
|
|
886
|
+
y,
|
|
887
|
+
x,
|
|
888
|
+
C,
|
|
889
|
+
T,
|
|
890
|
+
E,
|
|
891
|
+
oe,
|
|
892
|
+
de,
|
|
885
893
|
se,
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
pe,
|
|
894
|
+
le,
|
|
895
|
+
Te,
|
|
896
|
+
fe,
|
|
890
897
|
me,
|
|
891
898
|
Y,
|
|
892
|
-
|
|
893
|
-
xe,
|
|
899
|
+
ge,
|
|
894
900
|
X,
|
|
895
|
-
ye
|
|
901
|
+
ye,
|
|
902
|
+
we,
|
|
903
|
+
be,
|
|
904
|
+
Se
|
|
896
905
|
]);
|
|
897
|
-
return /* @__PURE__ */
|
|
898
|
-
value:
|
|
906
|
+
return /* @__PURE__ */ I(ut.Provider, {
|
|
907
|
+
value: Ee,
|
|
899
908
|
children: e
|
|
900
909
|
});
|
|
901
910
|
}
|
|
@@ -908,7 +917,7 @@ function ft() {
|
|
|
908
917
|
//#region src/presentation/ThreadEvents.tsx
|
|
909
918
|
var pt = "llmnative.agentico.threadEvents";
|
|
910
919
|
function mt() {
|
|
911
|
-
let [e, t] =
|
|
920
|
+
let [e, t] = P(() => {
|
|
912
921
|
try {
|
|
913
922
|
return localStorage.getItem(pt) !== "off";
|
|
914
923
|
} catch {
|
|
@@ -923,7 +932,7 @@ function mt() {
|
|
|
923
932
|
}];
|
|
924
933
|
}
|
|
925
934
|
function ht(e, t, n, r = !0) {
|
|
926
|
-
let { threadEvents: i } = ft(), [a, o] =
|
|
935
|
+
let { threadEvents: i } = ft(), [a, o] = P([]);
|
|
927
936
|
return j(() => {
|
|
928
937
|
if (!i || !e || !r) {
|
|
929
938
|
o([]);
|
|
@@ -948,82 +957,116 @@ function ht(e, t, n, r = !0) {
|
|
|
948
957
|
]), a;
|
|
949
958
|
}
|
|
950
959
|
function gt({ event: e }) {
|
|
951
|
-
let t = $(), { locale: r } = E(), [a, o] =
|
|
960
|
+
let t = $(), { locale: r } = E(), [a, o] = P(!!e.open), { threadEvents: s, task: c, compose: l } = ft(), [u, d] = P(null), p = async (t) => {
|
|
961
|
+
if (s?.onAction) {
|
|
962
|
+
d(t);
|
|
963
|
+
try {
|
|
964
|
+
await s.onAction(e, t, {
|
|
965
|
+
compose: l,
|
|
966
|
+
send: async (e) => {
|
|
967
|
+
if (!c || c.agent.running) {
|
|
968
|
+
l(e);
|
|
969
|
+
return;
|
|
970
|
+
}
|
|
971
|
+
let t = await c.agent.sendMessage(e);
|
|
972
|
+
t && c.onApplied(t);
|
|
973
|
+
}
|
|
974
|
+
});
|
|
975
|
+
} finally {
|
|
976
|
+
d(null);
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
}, m = new Date(e.at).toLocaleString(r, {
|
|
952
980
|
dateStyle: "short",
|
|
953
981
|
timeStyle: "short"
|
|
954
982
|
});
|
|
955
|
-
return /* @__PURE__ */
|
|
983
|
+
return /* @__PURE__ */ L("li", {
|
|
956
984
|
className: "flex items-start gap-2 py-1 text-xs",
|
|
957
985
|
"aria-label": `${e.author.name}: ${e.title}`,
|
|
958
986
|
"aria-busy": e.running || void 0,
|
|
959
|
-
children: [/* @__PURE__ */
|
|
987
|
+
children: [/* @__PURE__ */ I("span", {
|
|
960
988
|
className: "flex w-6 shrink-0 justify-center pt-px",
|
|
961
|
-
children: /* @__PURE__ */
|
|
962
|
-
}), /* @__PURE__ */
|
|
989
|
+
children: /* @__PURE__ */ I(Dt, { author: e.author })
|
|
990
|
+
}), /* @__PURE__ */ L("div", {
|
|
963
991
|
className: `min-w-0 flex-1 rounded-md border px-2 py-1 ${e.running ? "border-primary/40 bg-primary/5" : "border-border/60 bg-muted/30"}`,
|
|
964
|
-
children: [
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
992
|
+
children: [
|
|
993
|
+
/* @__PURE__ */ L("div", {
|
|
994
|
+
className: "flex min-w-0 flex-wrap items-center gap-x-1.5 gap-y-0.5",
|
|
995
|
+
children: [
|
|
996
|
+
/* @__PURE__ */ I("span", {
|
|
997
|
+
className: "font-medium text-foreground",
|
|
998
|
+
children: e.author.name
|
|
999
|
+
}),
|
|
1000
|
+
e.running ? /* @__PURE__ */ I(f, {
|
|
1001
|
+
name: "loader-circle",
|
|
1002
|
+
size: 12,
|
|
1003
|
+
className: "shrink-0 animate-spin text-primary",
|
|
1004
|
+
"aria-label": t.eventRunning
|
|
1005
|
+
}) : e.icon && /* @__PURE__ */ I(f, {
|
|
1006
|
+
name: e.icon,
|
|
1007
|
+
size: 12,
|
|
1008
|
+
className: "shrink-0 text-muted-foreground"
|
|
1009
|
+
}),
|
|
1010
|
+
/* @__PURE__ */ I("span", {
|
|
1011
|
+
className: "min-w-0 break-words text-muted-foreground",
|
|
1012
|
+
children: e.title
|
|
1013
|
+
}),
|
|
1014
|
+
e.badge && /* @__PURE__ */ I(n, {
|
|
1015
|
+
variant: e.badge.variant ?? "light",
|
|
1016
|
+
children: e.badge.label
|
|
1017
|
+
}),
|
|
1018
|
+
/* @__PURE__ */ L("span", {
|
|
1019
|
+
className: "ms-auto flex shrink-0 items-center gap-1 text-[11px] text-muted-foreground",
|
|
1020
|
+
children: [
|
|
1021
|
+
/* @__PURE__ */ I("time", {
|
|
1022
|
+
dateTime: new Date(e.at).toISOString(),
|
|
1023
|
+
children: m
|
|
1024
|
+
}),
|
|
1025
|
+
e.body && /* @__PURE__ */ I("button", {
|
|
1026
|
+
type: "button",
|
|
1027
|
+
onClick: () => o((e) => !e),
|
|
1028
|
+
"aria-expanded": a,
|
|
1029
|
+
title: a ? t.eventLess : t.eventMore,
|
|
1030
|
+
className: "rounded hover:text-foreground",
|
|
1031
|
+
children: /* @__PURE__ */ I(f, {
|
|
1032
|
+
name: a ? "chevron-up" : "chevron-down",
|
|
1033
|
+
size: 12
|
|
1034
|
+
})
|
|
1035
|
+
}),
|
|
1036
|
+
e.href && /* @__PURE__ */ I("a", {
|
|
1037
|
+
href: e.href,
|
|
1038
|
+
target: "_blank",
|
|
1039
|
+
rel: "noreferrer",
|
|
1040
|
+
title: t.eventOpen,
|
|
1041
|
+
"aria-label": t.eventOpen,
|
|
1042
|
+
className: "rounded hover:text-foreground",
|
|
1043
|
+
children: /* @__PURE__ */ I(f, {
|
|
1044
|
+
name: "external-link",
|
|
1045
|
+
size: 12
|
|
1046
|
+
})
|
|
1017
1047
|
})
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1048
|
+
]
|
|
1049
|
+
})
|
|
1050
|
+
]
|
|
1051
|
+
}),
|
|
1052
|
+
a && e.body && /* @__PURE__ */ I(i, {
|
|
1053
|
+
content: e.body,
|
|
1054
|
+
tone: "muted",
|
|
1055
|
+
className: "mt-1 break-words text-xs leading-relaxed"
|
|
1056
|
+
}),
|
|
1057
|
+
e.actions && e.actions.length > 0 && s?.onAction && /* @__PURE__ */ I("div", {
|
|
1058
|
+
className: "mt-1.5 flex flex-wrap gap-1.5",
|
|
1059
|
+
children: e.actions.map((e) => /* @__PURE__ */ I(g, {
|
|
1060
|
+
label: e.label,
|
|
1061
|
+
...e.icon ? { icon: e.icon } : {},
|
|
1062
|
+
variant: e.primary ? "primary" : "outline-primary",
|
|
1063
|
+
className: "px-2 py-0.5 text-xs",
|
|
1064
|
+
loading: u === e.id,
|
|
1065
|
+
disabled: u !== null || !!c?.agent.running,
|
|
1066
|
+
onClick: () => p(e.id)
|
|
1067
|
+
}, e.id))
|
|
1068
|
+
})
|
|
1069
|
+
]
|
|
1027
1070
|
})]
|
|
1028
1071
|
});
|
|
1029
1072
|
}
|
|
@@ -1087,39 +1130,39 @@ function vt(e) {
|
|
|
1087
1130
|
return r < e.length && t.push(..._t(e.slice(r))), t;
|
|
1088
1131
|
}
|
|
1089
1132
|
function yt({ content: e, language: t }) {
|
|
1090
|
-
let [n, r] =
|
|
1091
|
-
return /* @__PURE__ */
|
|
1133
|
+
let [n, r] = P(!1);
|
|
1134
|
+
return /* @__PURE__ */ L("div", {
|
|
1092
1135
|
className: `relative cursor-pointer rounded-md ${n ? "max-h-80 overflow-y-auto" : "max-h-28 overflow-hidden"}`,
|
|
1093
1136
|
onClick: () => r((e) => !e),
|
|
1094
1137
|
title: n ? "Clic per comprimere" : "Clic per espandere",
|
|
1095
|
-
children: [/* @__PURE__ */
|
|
1138
|
+
children: [/* @__PURE__ */ I(c, {
|
|
1096
1139
|
language: t,
|
|
1097
1140
|
showCopy: n,
|
|
1098
1141
|
background: "transparent",
|
|
1099
1142
|
className: "!text-[11px]",
|
|
1100
1143
|
children: e
|
|
1101
|
-
}), !n && /* @__PURE__ */
|
|
1144
|
+
}), !n && /* @__PURE__ */ I("div", { className: "pointer-events-none absolute inset-x-0 bottom-0 h-6 bg-gradient-to-t from-muted/30 to-transparent" })]
|
|
1102
1145
|
});
|
|
1103
1146
|
}
|
|
1104
1147
|
function bt({ text: e, tone: t }) {
|
|
1105
1148
|
let n = vt(e);
|
|
1106
|
-
return /* @__PURE__ */
|
|
1149
|
+
return /* @__PURE__ */ I(F, { children: n.map((e, n) => e.type === "code" ? /* @__PURE__ */ I(yt, {
|
|
1107
1150
|
content: e.content,
|
|
1108
1151
|
language: e.language
|
|
1109
|
-
}, n) : e.content.trim() && /* @__PURE__ */
|
|
1152
|
+
}, n) : e.content.trim() && /* @__PURE__ */ I(i, {
|
|
1110
1153
|
content: e.content.trim(),
|
|
1111
1154
|
tone: t,
|
|
1112
1155
|
className: "break-words text-xs leading-relaxed"
|
|
1113
1156
|
}, n)) });
|
|
1114
1157
|
}
|
|
1115
1158
|
function xt() {
|
|
1116
|
-
let [e] =
|
|
1159
|
+
let [e] = P(() => Date.now()), [t, n] = P(e);
|
|
1117
1160
|
j(() => {
|
|
1118
1161
|
let e = setInterval(() => n(Date.now()), 1e3);
|
|
1119
1162
|
return () => clearInterval(e);
|
|
1120
1163
|
}, []);
|
|
1121
1164
|
let r = Math.floor((t - e) / 1e3);
|
|
1122
|
-
return r < 10 ? null : /* @__PURE__ */
|
|
1165
|
+
return r < 10 ? null : /* @__PURE__ */ L("span", {
|
|
1123
1166
|
className: "tabular-nums",
|
|
1124
1167
|
children: [
|
|
1125
1168
|
" · ",
|
|
@@ -1130,15 +1173,15 @@ function xt() {
|
|
|
1130
1173
|
});
|
|
1131
1174
|
}
|
|
1132
1175
|
function St({ status: e }) {
|
|
1133
|
-
return e === "running" ? /* @__PURE__ */
|
|
1176
|
+
return e === "running" ? /* @__PURE__ */ I("span", { className: "inline-block h-3 w-3 shrink-0 animate-spin rounded-full border-2 border-current border-t-transparent" }) : e === "done" ? /* @__PURE__ */ I(f, {
|
|
1134
1177
|
name: "check",
|
|
1135
1178
|
size: 12,
|
|
1136
1179
|
className: "shrink-0 text-green-600"
|
|
1137
|
-
}) : e === "stopped" ? /* @__PURE__ */
|
|
1180
|
+
}) : e === "stopped" ? /* @__PURE__ */ I(f, {
|
|
1138
1181
|
name: "circle-slash",
|
|
1139
1182
|
size: 12,
|
|
1140
1183
|
className: "shrink-0 text-muted-foreground"
|
|
1141
|
-
}) : /* @__PURE__ */
|
|
1184
|
+
}) : /* @__PURE__ */ I(f, {
|
|
1142
1185
|
name: "x",
|
|
1143
1186
|
size: 12,
|
|
1144
1187
|
className: "shrink-0 text-destructive"
|
|
@@ -1149,25 +1192,25 @@ function Ct(e, t) {
|
|
|
1149
1192
|
}
|
|
1150
1193
|
var wt = 96, Tt = (e) => e.some((e) => e.status === "stopped" || e.status === "error");
|
|
1151
1194
|
function Et({ previews: e }) {
|
|
1152
|
-
let [t, n] =
|
|
1153
|
-
return /* @__PURE__ */
|
|
1195
|
+
let [t, n] = P(null);
|
|
1196
|
+
return /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I("div", {
|
|
1154
1197
|
className: "flex flex-wrap gap-1.5",
|
|
1155
|
-
children: e.map((e) => /* @__PURE__ */
|
|
1198
|
+
children: e.map((e) => /* @__PURE__ */ I("button", {
|
|
1156
1199
|
type: "button",
|
|
1157
1200
|
onClick: () => n(e),
|
|
1158
1201
|
title: e.name,
|
|
1159
1202
|
className: "overflow-hidden rounded-md border border-border/60 bg-background",
|
|
1160
|
-
children: /* @__PURE__ */
|
|
1203
|
+
children: /* @__PURE__ */ I("img", {
|
|
1161
1204
|
src: e.src,
|
|
1162
1205
|
alt: e.name,
|
|
1163
1206
|
className: "block max-h-40 max-w-full object-contain"
|
|
1164
1207
|
})
|
|
1165
1208
|
}, e.name))
|
|
1166
|
-
}), t && /* @__PURE__ */
|
|
1209
|
+
}), t && /* @__PURE__ */ I(_, {
|
|
1167
1210
|
title: t.name,
|
|
1168
1211
|
size: "lg",
|
|
1169
1212
|
onClose: () => n(null),
|
|
1170
|
-
children: /* @__PURE__ */
|
|
1213
|
+
children: /* @__PURE__ */ I("img", {
|
|
1171
1214
|
src: t.src,
|
|
1172
1215
|
alt: t.name,
|
|
1173
1216
|
className: "mx-auto block max-h-[70vh] max-w-full object-contain"
|
|
@@ -1175,13 +1218,13 @@ function Et({ previews: e }) {
|
|
|
1175
1218
|
})] });
|
|
1176
1219
|
}
|
|
1177
1220
|
function Dt({ author: e, size: t = 20 }) {
|
|
1178
|
-
return e.avatarUrl ? /* @__PURE__ */
|
|
1221
|
+
return e.avatarUrl ? /* @__PURE__ */ I(m, {
|
|
1179
1222
|
src: e.avatarUrl,
|
|
1180
1223
|
title: e.name,
|
|
1181
1224
|
alt: e.name,
|
|
1182
1225
|
width: t,
|
|
1183
1226
|
height: t
|
|
1184
|
-
}) : /* @__PURE__ */
|
|
1227
|
+
}) : /* @__PURE__ */ I(p, {
|
|
1185
1228
|
value: e.name,
|
|
1186
1229
|
size: t,
|
|
1187
1230
|
title: e.name
|
|
@@ -1199,23 +1242,23 @@ function kt(e) {
|
|
|
1199
1242
|
}
|
|
1200
1243
|
function At({ parts: e, open: t, onToggle: n }) {
|
|
1201
1244
|
let r = $(), i = e.filter((e) => e.type === "reasoning"), a = e.filter((e) => e.type === "tool"), o = i.some((e) => e.streaming), s = a.filter((e) => e.status === "running").at(-1), c = Math.round(i.reduce((e, t) => e + (t.duration ?? 0), 0)), l = [...i.length ? [o ? r.reasoningNow : c > 0 ? S(r.reasonedFor, { seconds: c }) : r.reasoned] : [], ...a.length ? [s?.label ?? (a.length === 1 ? r.oneStep : S(r.steps, { count: a.length }))] : []], u = o || !!s, d = a.some((e) => e.status === "error");
|
|
1202
|
-
return /* @__PURE__ */
|
|
1245
|
+
return /* @__PURE__ */ L("button", {
|
|
1203
1246
|
type: "button",
|
|
1204
1247
|
onClick: n,
|
|
1205
1248
|
"aria-expanded": t,
|
|
1206
1249
|
title: r.processDetails,
|
|
1207
1250
|
className: "inline-flex min-w-0 items-center gap-1 rounded text-xs text-muted-foreground hover:text-foreground",
|
|
1208
1251
|
children: [
|
|
1209
|
-
/* @__PURE__ */
|
|
1252
|
+
/* @__PURE__ */ I(f, {
|
|
1210
1253
|
name: u ? "loader-circle" : d ? "circle-alert" : i.length ? "brain" : "list-checks",
|
|
1211
1254
|
size: 12,
|
|
1212
1255
|
className: `shrink-0 ${u ? "animate-spin" : ""}`
|
|
1213
1256
|
}),
|
|
1214
|
-
/* @__PURE__ */
|
|
1257
|
+
/* @__PURE__ */ I("span", {
|
|
1215
1258
|
className: "truncate",
|
|
1216
1259
|
children: l.join(" · ")
|
|
1217
1260
|
}),
|
|
1218
|
-
/* @__PURE__ */
|
|
1261
|
+
/* @__PURE__ */ I(f, {
|
|
1219
1262
|
name: t ? "chevron-up" : "chevron-down",
|
|
1220
1263
|
size: 12,
|
|
1221
1264
|
className: "shrink-0"
|
|
@@ -1224,12 +1267,12 @@ function At({ parts: e, open: t, onToggle: n }) {
|
|
|
1224
1267
|
});
|
|
1225
1268
|
}
|
|
1226
1269
|
function jt({ entry: e, pinned: n = !0, actions: r, cut: i = !1, showAuthor: a = !1 }) {
|
|
1227
|
-
let o = $(), s =
|
|
1228
|
-
|
|
1270
|
+
let o = $(), s = N(null), [c, l] = P(!1), [u, d] = P(!1);
|
|
1271
|
+
ne(() => {
|
|
1229
1272
|
let e = s.current;
|
|
1230
1273
|
e && d(e.scrollHeight > 97);
|
|
1231
1274
|
}, [e.detail, e.attachmentNames]);
|
|
1232
|
-
let p = u && !c, m = r?.available(e) && i ? /* @__PURE__ */
|
|
1275
|
+
let p = u && !c, m = r?.available(e) && i ? /* @__PURE__ */ I(t, {
|
|
1233
1276
|
icon: "rotate-ccw",
|
|
1234
1277
|
ariaLabel: o.retry,
|
|
1235
1278
|
title: o.retry,
|
|
@@ -1237,9 +1280,9 @@ function jt({ entry: e, pinned: n = !0, actions: r, cut: i = !1, showAuthor: a =
|
|
|
1237
1280
|
className: "p-1 text-muted-foreground hover:text-foreground",
|
|
1238
1281
|
disabled: r.disabled,
|
|
1239
1282
|
onClick: () => r.onRetry(e)
|
|
1240
|
-
}) : null, h = r?.available(e) ? /* @__PURE__ */
|
|
1283
|
+
}) : null, h = r?.available(e) ? /* @__PURE__ */ I("span", {
|
|
1241
1284
|
className: "opacity-0 transition-opacity focus-within:opacity-100 group-hover:opacity-100",
|
|
1242
|
-
children: /* @__PURE__ */
|
|
1285
|
+
children: /* @__PURE__ */ I(t, {
|
|
1243
1286
|
icon: "pencil",
|
|
1244
1287
|
ariaLabel: o.editMessage,
|
|
1245
1288
|
title: o.editMessage,
|
|
@@ -1248,67 +1291,70 @@ function jt({ entry: e, pinned: n = !0, actions: r, cut: i = !1, showAuthor: a =
|
|
|
1248
1291
|
disabled: r.disabled,
|
|
1249
1292
|
onClick: () => r.onEdit(e)
|
|
1250
1293
|
})
|
|
1251
|
-
}) : null, g = (t) => /* @__PURE__ */
|
|
1294
|
+
}) : null, g = (t) => /* @__PURE__ */ L("div", {
|
|
1252
1295
|
className: `${t ? "w-full" : "max-w-[85%]"} rounded-lg bg-primary/10 text-xs text-foreground`,
|
|
1253
|
-
children: [/* @__PURE__ */
|
|
1296
|
+
children: [/* @__PURE__ */ L("div", {
|
|
1254
1297
|
ref: s,
|
|
1255
1298
|
className: `space-y-1 px-2.5 pt-1.5 ${p ? "overflow-hidden" : ""}`,
|
|
1256
1299
|
style: p ? { maxHeight: wt } : void 0,
|
|
1257
1300
|
children: [
|
|
1258
|
-
e.attachmentPreviews && e.attachmentPreviews.length > 0 && /* @__PURE__ */
|
|
1259
|
-
e.attachmentNames && e.attachmentNames.some((t) => !e.attachmentPreviews?.some((e) => e.name === t)) && /* @__PURE__ */
|
|
1301
|
+
e.attachmentPreviews && e.attachmentPreviews.length > 0 && /* @__PURE__ */ I(Et, { previews: e.attachmentPreviews }),
|
|
1302
|
+
e.attachmentNames && e.attachmentNames.some((t) => !e.attachmentPreviews?.some((e) => e.name === t)) && /* @__PURE__ */ I("div", {
|
|
1260
1303
|
className: "flex flex-wrap gap-1",
|
|
1261
|
-
children: e.attachmentNames.filter((t) => !e.attachmentPreviews?.some((e) => e.name === t)).map((e, t) => /* @__PURE__ */
|
|
1304
|
+
children: e.attachmentNames.filter((t) => !e.attachmentPreviews?.some((e) => e.name === t)).map((e, t) => /* @__PURE__ */ L("span", {
|
|
1262
1305
|
className: "inline-flex items-center gap-1 rounded-md bg-primary/15 px-1.5 py-0.5 text-[11px] text-foreground",
|
|
1263
|
-
children: [/* @__PURE__ */
|
|
1306
|
+
children: [/* @__PURE__ */ I(f, {
|
|
1264
1307
|
name: "paperclip",
|
|
1265
1308
|
size: 10,
|
|
1266
1309
|
className: "shrink-0"
|
|
1267
|
-
}), /* @__PURE__ */
|
|
1310
|
+
}), /* @__PURE__ */ I("span", {
|
|
1268
1311
|
className: "max-w-[160px] truncate",
|
|
1269
1312
|
children: e
|
|
1270
1313
|
})]
|
|
1271
1314
|
}, t))
|
|
1272
1315
|
}),
|
|
1273
|
-
/* @__PURE__ */
|
|
1316
|
+
/* @__PURE__ */ I(bt, { text: e.detail ?? "" })
|
|
1274
1317
|
]
|
|
1275
|
-
}), u && /* @__PURE__ */
|
|
1318
|
+
}), u && /* @__PURE__ */ L("button", {
|
|
1276
1319
|
type: "button",
|
|
1277
1320
|
onClick: () => l((e) => !e),
|
|
1278
1321
|
className: "relative flex w-full items-center justify-center rounded-b-lg py-1 text-muted-foreground hover:bg-primary/15",
|
|
1279
1322
|
title: c ? "Comprimi" : "Espandi",
|
|
1280
|
-
children: [p && /* @__PURE__ */
|
|
1323
|
+
children: [p && /* @__PURE__ */ I("div", { className: "pointer-events-none absolute inset-x-0 -top-4 h-4 bg-gradient-to-t from-primary/10 to-transparent" }), /* @__PURE__ */ I(f, {
|
|
1281
1324
|
name: c ? "chevron-up" : "chevron-down",
|
|
1282
1325
|
size: 12
|
|
1283
1326
|
})]
|
|
1284
1327
|
})]
|
|
1285
1328
|
});
|
|
1286
|
-
return a ? /* @__PURE__ */
|
|
1329
|
+
return a ? /* @__PURE__ */ L("div", {
|
|
1287
1330
|
className: `${n ? "sticky top-0 z-20 border-b border-border/40" : ""} group flex items-start gap-2 bg-background py-1.5`,
|
|
1288
|
-
children: [/* @__PURE__ */
|
|
1331
|
+
children: [/* @__PURE__ */ I("span", {
|
|
1289
1332
|
className: `flex shrink-0 flex-col items-center ${Ot}`,
|
|
1290
|
-
children:
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
m,
|
|
1300
|
-
h
|
|
1301
|
-
]
|
|
1302
|
-
}), /* @__PURE__ */ R("div", {
|
|
1333
|
+
children: e.author ? /* @__PURE__ */ I(Dt, { author: e.author }) : /* @__PURE__ */ I("span", {
|
|
1334
|
+
className: "flex h-5 w-5 items-center justify-center rounded-full bg-muted text-muted-foreground",
|
|
1335
|
+
"aria-hidden": !0,
|
|
1336
|
+
children: /* @__PURE__ */ I(f, {
|
|
1337
|
+
name: "user",
|
|
1338
|
+
size: 12
|
|
1339
|
+
})
|
|
1340
|
+
})
|
|
1341
|
+
}), /* @__PURE__ */ L("div", {
|
|
1303
1342
|
className: "min-w-0 flex-1",
|
|
1304
|
-
children: [e.author && /* @__PURE__ */ L("div", {
|
|
1305
|
-
className: "
|
|
1306
|
-
children:
|
|
1343
|
+
children: [(e.author || m || h) && /* @__PURE__ */ L("div", {
|
|
1344
|
+
className: "flex min-h-5 items-center gap-0.5 pb-0.5",
|
|
1345
|
+
children: [
|
|
1346
|
+
e.author && /* @__PURE__ */ I("span", {
|
|
1347
|
+
className: "me-1 truncate text-xs font-medium text-foreground",
|
|
1348
|
+
children: e.author.name
|
|
1349
|
+
}),
|
|
1350
|
+
m,
|
|
1351
|
+
h
|
|
1352
|
+
]
|
|
1307
1353
|
}), g(!0)]
|
|
1308
1354
|
})]
|
|
1309
|
-
}) : /* @__PURE__ */
|
|
1355
|
+
}) : /* @__PURE__ */ L("div", {
|
|
1310
1356
|
className: `${n ? "sticky top-0 z-20 border-b border-border/40" : ""} group flex items-start justify-end gap-1 bg-background py-1.5`,
|
|
1311
|
-
children: [r?.available(e) && /* @__PURE__ */
|
|
1357
|
+
children: [r?.available(e) && /* @__PURE__ */ L("span", {
|
|
1312
1358
|
className: "flex shrink-0 items-center",
|
|
1313
1359
|
children: [m, h]
|
|
1314
1360
|
}), g(!1)]
|
|
@@ -1322,7 +1368,7 @@ var Mt = {
|
|
|
1322
1368
|
};
|
|
1323
1369
|
function Nt({ steps: e }) {
|
|
1324
1370
|
let t = $(), n = e.filter((e) => e.status === "running").at(-1), r = e.some((e) => e.status === "error"), i = n?.label ?? (e.length === 1 ? t.oneStep : S(t.steps, { count: e.length }));
|
|
1325
|
-
return /* @__PURE__ */
|
|
1371
|
+
return /* @__PURE__ */ I(b, {
|
|
1326
1372
|
ariaLabel: t.stepsLabel,
|
|
1327
1373
|
selectedId: null,
|
|
1328
1374
|
itemClassName: "py-0.5 text-xs text-muted-foreground",
|
|
@@ -1332,7 +1378,7 @@ function Nt({ steps: e }) {
|
|
|
1332
1378
|
icon: n ? "loader-circle" : r ? "circle-alert" : "list-checks",
|
|
1333
1379
|
children: e.map((e) => ({
|
|
1334
1380
|
id: e.id,
|
|
1335
|
-
label: /* @__PURE__ */
|
|
1381
|
+
label: /* @__PURE__ */ I("span", {
|
|
1336
1382
|
className: e.status === "error" ? "text-destructive" : void 0,
|
|
1337
1383
|
children: e.label
|
|
1338
1384
|
}),
|
|
@@ -1342,30 +1388,30 @@ function Nt({ steps: e }) {
|
|
|
1342
1388
|
});
|
|
1343
1389
|
}
|
|
1344
1390
|
function Pt({ entry: e, part: a, questions: o }) {
|
|
1345
|
-
let s = $(), [c, l] =
|
|
1346
|
-
return /* @__PURE__ */
|
|
1391
|
+
let s = $(), [c, l] = P(!1), u = !!(o?.onCardAction && o.canAnswer(e.id) && !a.outcome), d = a.outcome?.status === "done" ? "text-success" : a.outcome?.status === "error" ? "text-destructive" : "text-muted-foreground";
|
|
1392
|
+
return /* @__PURE__ */ L(r, {
|
|
1347
1393
|
headerClassName: "flex items-center justify-between gap-2 px-3 py-2",
|
|
1348
1394
|
bodyClassName: "px-3 py-2",
|
|
1349
|
-
header: /* @__PURE__ */
|
|
1395
|
+
header: /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I("span", {
|
|
1350
1396
|
className: "min-w-0 text-xs font-semibold text-foreground",
|
|
1351
1397
|
children: a.title
|
|
1352
|
-
}), a.badge && /* @__PURE__ */
|
|
1398
|
+
}), a.badge && /* @__PURE__ */ I(n, {
|
|
1353
1399
|
variant: a.badge.variant ?? "info",
|
|
1354
1400
|
children: a.badge.label
|
|
1355
1401
|
})] }),
|
|
1356
|
-
footer: /* @__PURE__ */
|
|
1402
|
+
footer: /* @__PURE__ */ L("div", {
|
|
1357
1403
|
className: "space-y-1.5 px-3 py-2",
|
|
1358
|
-
children: [/* @__PURE__ */
|
|
1404
|
+
children: [/* @__PURE__ */ L("div", {
|
|
1359
1405
|
className: "flex items-center gap-1",
|
|
1360
1406
|
children: [
|
|
1361
|
-
a.details && /* @__PURE__ */
|
|
1407
|
+
a.details && /* @__PURE__ */ I(t, {
|
|
1362
1408
|
icon: "eye",
|
|
1363
1409
|
ariaLabel: s.cardView,
|
|
1364
1410
|
title: s.cardView,
|
|
1365
1411
|
variant: "outline-secondary",
|
|
1366
1412
|
onClick: () => l(!0)
|
|
1367
1413
|
}),
|
|
1368
|
-
(a.actions ?? []).filter((e) => e.variant !== "primary" && e.icon).map((t) => /* @__PURE__ */
|
|
1414
|
+
(a.actions ?? []).filter((e) => e.variant !== "primary" && e.icon).map((t) => /* @__PURE__ */ I(g, {
|
|
1369
1415
|
icon: t.icon,
|
|
1370
1416
|
ariaLabel: t.label,
|
|
1371
1417
|
title: t.label,
|
|
@@ -1373,9 +1419,9 @@ function Pt({ entry: e, part: a, questions: o }) {
|
|
|
1373
1419
|
disabled: !u,
|
|
1374
1420
|
onClick: () => o.onCardAction(e.id, a.id, t.id)
|
|
1375
1421
|
}, t.id)),
|
|
1376
|
-
/* @__PURE__ */
|
|
1422
|
+
/* @__PURE__ */ I("span", {
|
|
1377
1423
|
className: "ms-auto flex items-center gap-1",
|
|
1378
|
-
children: (a.actions ?? []).filter((e) => e.variant === "primary" || !e.icon).map((t) => /* @__PURE__ */
|
|
1424
|
+
children: (a.actions ?? []).filter((e) => e.variant === "primary" || !e.icon).map((t) => /* @__PURE__ */ I(g, {
|
|
1379
1425
|
...t.icon ? { icon: t.icon } : {},
|
|
1380
1426
|
label: t.label,
|
|
1381
1427
|
variant: t.variant ?? "outline-primary",
|
|
@@ -1384,9 +1430,9 @@ function Pt({ entry: e, part: a, questions: o }) {
|
|
|
1384
1430
|
}, t.id))
|
|
1385
1431
|
})
|
|
1386
1432
|
]
|
|
1387
|
-
}), a.outcome && /* @__PURE__ */
|
|
1433
|
+
}), a.outcome && /* @__PURE__ */ L("p", {
|
|
1388
1434
|
className: `text-xs ${d}`,
|
|
1389
|
-
children: [a.outcome.text, a.outcome.link && /* @__PURE__ */
|
|
1435
|
+
children: [a.outcome.text, a.outcome.link && /* @__PURE__ */ L(F, { children: [" ", /* @__PURE__ */ I("a", {
|
|
1390
1436
|
className: "underline",
|
|
1391
1437
|
href: a.outcome.link.url,
|
|
1392
1438
|
target: "_blank",
|
|
@@ -1395,20 +1441,20 @@ function Pt({ entry: e, part: a, questions: o }) {
|
|
|
1395
1441
|
})] })]
|
|
1396
1442
|
})]
|
|
1397
1443
|
}),
|
|
1398
|
-
children: [a.body ? /* @__PURE__ */
|
|
1444
|
+
children: [a.body ? /* @__PURE__ */ I(i, {
|
|
1399
1445
|
content: a.body,
|
|
1400
1446
|
className: "break-words text-xs leading-relaxed text-foreground"
|
|
1401
|
-
}) : null, c && a.details && /* @__PURE__ */
|
|
1447
|
+
}) : null, c && a.details && /* @__PURE__ */ I(_, {
|
|
1402
1448
|
title: a.title,
|
|
1403
1449
|
position: "right",
|
|
1404
1450
|
size: "lg",
|
|
1405
1451
|
onClose: () => l(!1),
|
|
1406
|
-
footer: /* @__PURE__ */
|
|
1452
|
+
footer: /* @__PURE__ */ I(t, {
|
|
1407
1453
|
label: s.cardClose,
|
|
1408
1454
|
variant: "outline-secondary",
|
|
1409
1455
|
onClick: () => l(!1)
|
|
1410
1456
|
}),
|
|
1411
|
-
children: /* @__PURE__ */
|
|
1457
|
+
children: /* @__PURE__ */ I(i, {
|
|
1412
1458
|
content: a.details,
|
|
1413
1459
|
className: "break-words text-sm leading-relaxed text-foreground"
|
|
1414
1460
|
})
|
|
@@ -1426,7 +1472,7 @@ function Ft(e, t) {
|
|
|
1426
1472
|
}
|
|
1427
1473
|
function It({ entry: e, part: t, questions: n, autoFocus: r, className: i }) {
|
|
1428
1474
|
let o = !!n?.canAnswer(e.id);
|
|
1429
|
-
return /* @__PURE__ */
|
|
1475
|
+
return /* @__PURE__ */ I(a, {
|
|
1430
1476
|
questions: t.questions,
|
|
1431
1477
|
...t.answers ? { answers: t.answers } : {},
|
|
1432
1478
|
disabled: !t.answers && !o,
|
|
@@ -1447,25 +1493,25 @@ function Lt({ entry: e, questions: t, hiddenPartId: n, skip: r }) {
|
|
|
1447
1493
|
part: e
|
|
1448
1494
|
});
|
|
1449
1495
|
}
|
|
1450
|
-
return /* @__PURE__ */
|
|
1496
|
+
return /* @__PURE__ */ I("div", {
|
|
1451
1497
|
className: "space-y-2",
|
|
1452
1498
|
children: s.map((n) => {
|
|
1453
|
-
if ("steps" in n) return /* @__PURE__ */
|
|
1499
|
+
if ("steps" in n) return /* @__PURE__ */ I(Nt, { steps: n.steps }, n.key);
|
|
1454
1500
|
let { part: r } = n;
|
|
1455
|
-
return r.type === "text" ? r.text.trim() ? /* @__PURE__ */
|
|
1501
|
+
return r.type === "text" ? r.text.trim() ? /* @__PURE__ */ I(i, {
|
|
1456
1502
|
content: r.text,
|
|
1457
1503
|
streaming: r.streaming,
|
|
1458
1504
|
className: "break-words text-xs leading-relaxed text-foreground"
|
|
1459
|
-
}, n.key) : null : r.type === "reasoning" ? /* @__PURE__ */
|
|
1505
|
+
}, n.key) : null : r.type === "reasoning" ? /* @__PURE__ */ I(o, {
|
|
1460
1506
|
content: r.text,
|
|
1461
1507
|
streaming: r.streaming,
|
|
1462
1508
|
duration: r.duration,
|
|
1463
1509
|
className: "my-0"
|
|
1464
|
-
}, n.key) : r.type === "card" ? /* @__PURE__ */
|
|
1510
|
+
}, n.key) : r.type === "card" ? /* @__PURE__ */ I(Pt, {
|
|
1465
1511
|
entry: e,
|
|
1466
1512
|
part: r,
|
|
1467
1513
|
questions: t
|
|
1468
|
-
}, n.key) : /* @__PURE__ */
|
|
1514
|
+
}, n.key) : /* @__PURE__ */ I(It, {
|
|
1469
1515
|
entry: e,
|
|
1470
1516
|
part: r,
|
|
1471
1517
|
questions: t
|
|
@@ -1477,49 +1523,49 @@ function Rt({ entry: e, questions: t, hiddenPartId: n, skip: r }) {
|
|
|
1477
1523
|
let a = $();
|
|
1478
1524
|
if (e.kind === "thinking" && e.parts) {
|
|
1479
1525
|
let i = e.status === "error" || e.status === "stopped" || e.status === "running", o = r ? e.parts.filter((e) => !r.has(e.id)).length : e.parts.length;
|
|
1480
|
-
return /* @__PURE__ */
|
|
1526
|
+
return /* @__PURE__ */ L("li", {
|
|
1481
1527
|
className: "text-xs text-muted-foreground",
|
|
1482
|
-
children: [o > 0 && /* @__PURE__ */
|
|
1528
|
+
children: [o > 0 && /* @__PURE__ */ I(Lt, {
|
|
1483
1529
|
entry: e,
|
|
1484
1530
|
questions: t,
|
|
1485
1531
|
hiddenPartId: n,
|
|
1486
1532
|
skip: r
|
|
1487
|
-
}), i && /* @__PURE__ */
|
|
1533
|
+
}), i && /* @__PURE__ */ L("div", {
|
|
1488
1534
|
className: `flex items-start gap-1.5 ${o > 0 ? "mt-1" : ""}`,
|
|
1489
|
-
children: [/* @__PURE__ */
|
|
1535
|
+
children: [/* @__PURE__ */ I("span", {
|
|
1490
1536
|
className: "pt-px",
|
|
1491
|
-
children: /* @__PURE__ */
|
|
1492
|
-
}), /* @__PURE__ */
|
|
1537
|
+
children: /* @__PURE__ */ I(St, { status: e.status })
|
|
1538
|
+
}), /* @__PURE__ */ L("span", {
|
|
1493
1539
|
className: "min-w-0 flex-1 whitespace-pre-wrap break-words",
|
|
1494
|
-
children: [Ct(e, a), e.status === "running" && /* @__PURE__ */
|
|
1540
|
+
children: [Ct(e, a), e.status === "running" && /* @__PURE__ */ I(xt, {})]
|
|
1495
1541
|
})]
|
|
1496
1542
|
})]
|
|
1497
1543
|
});
|
|
1498
1544
|
}
|
|
1499
1545
|
let o = e.kind === "thinking" && e.detail ? vt(e.detail) : [], s = o.filter((e) => e.type === "code"), c = o.filter((e) => e.type === "text" && e.content.trim()), l = e.kind === "thinking" ? Ct(e, a) : e.label;
|
|
1500
|
-
return /* @__PURE__ */
|
|
1546
|
+
return /* @__PURE__ */ L("li", {
|
|
1501
1547
|
className: "text-xs text-muted-foreground",
|
|
1502
1548
|
children: [
|
|
1503
|
-
/* @__PURE__ */
|
|
1549
|
+
/* @__PURE__ */ L("div", {
|
|
1504
1550
|
className: "flex items-start gap-1.5",
|
|
1505
|
-
children: [/* @__PURE__ */
|
|
1551
|
+
children: [/* @__PURE__ */ I("span", {
|
|
1506
1552
|
className: "pt-px",
|
|
1507
|
-
children: /* @__PURE__ */
|
|
1508
|
-
}), /* @__PURE__ */
|
|
1553
|
+
children: /* @__PURE__ */ I(St, { status: e.status })
|
|
1554
|
+
}), /* @__PURE__ */ I("span", {
|
|
1509
1555
|
className: "min-w-0 flex-1 whitespace-pre-wrap break-words",
|
|
1510
1556
|
children: l
|
|
1511
1557
|
})]
|
|
1512
1558
|
}),
|
|
1513
|
-
s.length > 0 && /* @__PURE__ */
|
|
1559
|
+
s.length > 0 && /* @__PURE__ */ I("div", {
|
|
1514
1560
|
className: "mt-1 ml-[18px] space-y-1",
|
|
1515
|
-
children: s.map((e, t) => /* @__PURE__ */
|
|
1561
|
+
children: s.map((e, t) => /* @__PURE__ */ I(yt, {
|
|
1516
1562
|
content: e.content,
|
|
1517
1563
|
language: e.language
|
|
1518
1564
|
}, t))
|
|
1519
1565
|
}),
|
|
1520
|
-
c.length > 0 && /* @__PURE__ */
|
|
1566
|
+
c.length > 0 && /* @__PURE__ */ I("div", {
|
|
1521
1567
|
className: "mt-1 ml-[18px] space-y-2",
|
|
1522
|
-
children: c.map((e, t) => /* @__PURE__ */
|
|
1568
|
+
children: c.map((e, t) => /* @__PURE__ */ I(i, {
|
|
1523
1569
|
content: e.content.trim(),
|
|
1524
1570
|
tone: "muted",
|
|
1525
1571
|
className: "break-words text-xs leading-relaxed"
|
|
@@ -1529,20 +1575,20 @@ function Rt({ entry: e, questions: t, hiddenPartId: n, skip: r }) {
|
|
|
1529
1575
|
});
|
|
1530
1576
|
}
|
|
1531
1577
|
function zt({ parts: e }) {
|
|
1532
|
-
return /* @__PURE__ */
|
|
1578
|
+
return /* @__PURE__ */ I("div", {
|
|
1533
1579
|
className: "mb-1 space-y-1 border-l-2 border-border pl-2 text-xs text-muted-foreground",
|
|
1534
|
-
children: e.map((e) => e.type === "reasoning" ? /* @__PURE__ */
|
|
1580
|
+
children: e.map((e) => e.type === "reasoning" ? /* @__PURE__ */ I(i, {
|
|
1535
1581
|
content: e.text,
|
|
1536
1582
|
tone: "muted",
|
|
1537
1583
|
streaming: e.streaming,
|
|
1538
1584
|
className: "break-words text-xs leading-relaxed"
|
|
1539
|
-
}, e.id) : e.type === "tool" ? /* @__PURE__ */
|
|
1585
|
+
}, e.id) : e.type === "tool" ? /* @__PURE__ */ L("div", {
|
|
1540
1586
|
className: "flex items-start gap-1.5",
|
|
1541
|
-
children: [/* @__PURE__ */
|
|
1587
|
+
children: [/* @__PURE__ */ I(f, {
|
|
1542
1588
|
name: Mt[e.status],
|
|
1543
1589
|
size: 12,
|
|
1544
1590
|
className: `mt-0.5 shrink-0 ${e.status === "running" ? "animate-spin" : ""}`
|
|
1545
|
-
}), /* @__PURE__ */
|
|
1591
|
+
}), /* @__PURE__ */ I("span", {
|
|
1546
1592
|
className: `min-w-0 break-words ${e.status === "error" ? "text-destructive" : ""}`,
|
|
1547
1593
|
children: e.label
|
|
1548
1594
|
})]
|
|
@@ -1550,30 +1596,30 @@ function zt({ parts: e }) {
|
|
|
1550
1596
|
});
|
|
1551
1597
|
}
|
|
1552
1598
|
function Bt({ speaker: e, entries: t, questions: n, docked: r }) {
|
|
1553
|
-
let i = kt(t[0]), a = i.length ? new Set(i.map((e) => e.id)) : void 0, [o, s] =
|
|
1554
|
-
return /* @__PURE__ */
|
|
1599
|
+
let i = kt(t[0]), a = i.length ? new Set(i.map((e) => e.id)) : void 0, [o, s] = P(!1);
|
|
1600
|
+
return /* @__PURE__ */ L("div", {
|
|
1555
1601
|
className: "flex items-start gap-2 pt-1.5",
|
|
1556
|
-
children: [/* @__PURE__ */
|
|
1602
|
+
children: [/* @__PURE__ */ I("span", {
|
|
1557
1603
|
className: `flex shrink-0 justify-center pt-px ${Ot}`,
|
|
1558
|
-
children: /* @__PURE__ */
|
|
1559
|
-
}), /* @__PURE__ */
|
|
1604
|
+
children: /* @__PURE__ */ I(Dt, { author: e })
|
|
1605
|
+
}), /* @__PURE__ */ L("div", {
|
|
1560
1606
|
className: "min-w-0 flex-1",
|
|
1561
1607
|
children: [
|
|
1562
|
-
/* @__PURE__ */
|
|
1608
|
+
/* @__PURE__ */ L("div", {
|
|
1563
1609
|
className: "flex min-w-0 flex-wrap items-center gap-x-2 pb-0.5",
|
|
1564
|
-
children: [/* @__PURE__ */
|
|
1610
|
+
children: [/* @__PURE__ */ I("span", {
|
|
1565
1611
|
className: "truncate text-xs font-medium text-foreground",
|
|
1566
1612
|
children: e.name
|
|
1567
|
-
}), i.length > 0 && /* @__PURE__ */
|
|
1613
|
+
}), i.length > 0 && /* @__PURE__ */ I(At, {
|
|
1568
1614
|
parts: i,
|
|
1569
1615
|
open: o,
|
|
1570
1616
|
onToggle: () => s((e) => !e)
|
|
1571
1617
|
})]
|
|
1572
1618
|
}),
|
|
1573
|
-
o && i.length > 0 && /* @__PURE__ */
|
|
1574
|
-
/* @__PURE__ */
|
|
1619
|
+
o && i.length > 0 && /* @__PURE__ */ I(zt, { parts: i }),
|
|
1620
|
+
/* @__PURE__ */ I("ul", {
|
|
1575
1621
|
className: "space-y-0.5",
|
|
1576
|
-
children: t.map((e, t) => /* @__PURE__ */
|
|
1622
|
+
children: t.map((e, t) => /* @__PURE__ */ I(Rt, {
|
|
1577
1623
|
entry: e,
|
|
1578
1624
|
questions: n,
|
|
1579
1625
|
hiddenPartId: r?.entry.id === e.id ? r.part.id : void 0,
|
|
@@ -1592,27 +1638,27 @@ function Vt({ activity: e, questions: t, docked: n, pinUserMessages: r = !0, mes
|
|
|
1592
1638
|
entries: []
|
|
1593
1639
|
} : { entries: [t] }) : l[l.length - 1].entries.push(t);
|
|
1594
1640
|
let u = rt(l.map((e) => (e.user ?? e.entries[0])?.at), s ?? []);
|
|
1595
|
-
return /* @__PURE__ */
|
|
1641
|
+
return /* @__PURE__ */ L("ul", {
|
|
1596
1642
|
className: "space-y-0.5",
|
|
1597
|
-
children: [l.map((e, o) => /* @__PURE__ */
|
|
1643
|
+
children: [l.map((e, o) => /* @__PURE__ */ L(O.Fragment, { children: [u[o].map((e) => /* @__PURE__ */ I(gt, { event: e }, e.id)), /* @__PURE__ */ L("li", { children: [e.user && /* @__PURE__ */ I(jt, {
|
|
1598
1644
|
entry: e.user,
|
|
1599
1645
|
pinned: r,
|
|
1600
1646
|
actions: i,
|
|
1601
1647
|
cut: Tt(e.entries),
|
|
1602
1648
|
showAuthor: c
|
|
1603
|
-
}), a && e.entries.length > 0 ? /* @__PURE__ */
|
|
1649
|
+
}), a && e.entries.length > 0 ? /* @__PURE__ */ I(Bt, {
|
|
1604
1650
|
speaker: a,
|
|
1605
1651
|
entries: e.entries,
|
|
1606
1652
|
questions: t,
|
|
1607
1653
|
docked: n
|
|
1608
|
-
}) : e.entries.length > 0 && /* @__PURE__ */
|
|
1654
|
+
}) : e.entries.length > 0 && /* @__PURE__ */ I("ul", {
|
|
1609
1655
|
className: "space-y-0.5",
|
|
1610
|
-
children: e.entries.map((e) => /* @__PURE__ */
|
|
1656
|
+
children: e.entries.map((e) => /* @__PURE__ */ I(Rt, {
|
|
1611
1657
|
entry: e,
|
|
1612
1658
|
questions: t,
|
|
1613
1659
|
hiddenPartId: n?.entry.id === e.id ? n.part.id : void 0
|
|
1614
1660
|
}, e.id))
|
|
1615
|
-
})] })] }, e.user?.id ?? e.entries[0]?.id)), u[l.length].map((e) => /* @__PURE__ */
|
|
1661
|
+
})] })] }, e.user?.id ?? e.entries[0]?.id)), u[l.length].map((e) => /* @__PURE__ */ I(gt, { event: e }, e.id))]
|
|
1616
1662
|
});
|
|
1617
1663
|
}
|
|
1618
1664
|
//#endregion
|
|
@@ -1643,7 +1689,7 @@ function Xt() {
|
|
|
1643
1689
|
return typeof window > "u" ? Infinity : window.innerWidth;
|
|
1644
1690
|
}
|
|
1645
1691
|
function Zt({ defaultWidth: e = 420, minWidth: t = 320, maxWidth: n = Wt, onWidthChange: r }) {
|
|
1646
|
-
let [i, a] =
|
|
1692
|
+
let [i, a] = P(Xt), [o, s] = P(() => Jt() ?? e);
|
|
1647
1693
|
j(() => {
|
|
1648
1694
|
if (typeof window > "u") return;
|
|
1649
1695
|
let e = () => a(window.innerWidth);
|
|
@@ -1666,7 +1712,7 @@ function Zt({ defaultWidth: e = 420, minWidth: t = 320, maxWidth: n = Wt, onWidt
|
|
|
1666
1712
|
//#endregion
|
|
1667
1713
|
//#region src/presentation/AgenticoResizeHandle.tsx
|
|
1668
1714
|
function Qt({ width: e, min: t, max: n, onResize: r, onCommit: i, onReset: a }) {
|
|
1669
|
-
let o = $(), s =
|
|
1715
|
+
let o = $(), s = N(null), [c, l] = P(!1), u = (e) => Math.round(Math.min(Math.max(e, t), Math.max(t, n))), d = (e) => {
|
|
1670
1716
|
let t = s.current;
|
|
1671
1717
|
if (t && t.pointerId === e.pointerId) {
|
|
1672
1718
|
s.current = null, l(!1), document.body.style.removeProperty("cursor"), document.body.style.removeProperty("user-select");
|
|
@@ -1676,7 +1722,7 @@ function Qt({ width: e, min: t, max: n, onResize: r, onCommit: i, onReset: a })
|
|
|
1676
1722
|
i(t.last);
|
|
1677
1723
|
}
|
|
1678
1724
|
};
|
|
1679
|
-
return /* @__PURE__ */
|
|
1725
|
+
return /* @__PURE__ */ I("div", {
|
|
1680
1726
|
role: "separator",
|
|
1681
1727
|
"aria-orientation": "vertical",
|
|
1682
1728
|
"aria-label": o.resizePanel,
|
|
@@ -1715,7 +1761,7 @@ function Qt({ width: e, min: t, max: n, onResize: r, onCommit: i, onReset: a })
|
|
|
1715
1761
|
let c = u(s);
|
|
1716
1762
|
r(c), i(c);
|
|
1717
1763
|
},
|
|
1718
|
-
children: /* @__PURE__ */
|
|
1764
|
+
children: /* @__PURE__ */ I("span", {
|
|
1719
1765
|
"aria-hidden": !0,
|
|
1720
1766
|
className: `h-full w-0.5 transition-colors ${c ? "bg-primary" : "bg-transparent group-hover:bg-primary/50 group-focus-visible:bg-primary"}`
|
|
1721
1767
|
})
|
|
@@ -1725,7 +1771,7 @@ function Qt({ width: e, min: t, max: n, onResize: r, onCommit: i, onReset: a })
|
|
|
1725
1771
|
//#region src/presentation/AgenticoToggle.tsx
|
|
1726
1772
|
function $t({ className: e = "" }) {
|
|
1727
1773
|
let { isOpen: n, toggleOpen: r, task: i } = ft(), a = $(), o = i?.agent.running ?? !1;
|
|
1728
|
-
return /* @__PURE__ */
|
|
1774
|
+
return /* @__PURE__ */ I(t, {
|
|
1729
1775
|
icon: "bot",
|
|
1730
1776
|
ariaLabel: n ? a.closePanel : a.openPanel,
|
|
1731
1777
|
title: n ? a.closePanel : a.openPanel,
|
|
@@ -1750,7 +1796,7 @@ function nn(e) {
|
|
|
1750
1796
|
} catch {}
|
|
1751
1797
|
}
|
|
1752
1798
|
function rn() {
|
|
1753
|
-
let e = T()?.registry ?? {}, t = Object.keys(e).length > 0, [n, r] =
|
|
1799
|
+
let e = T()?.registry ?? {}, t = Object.keys(e).length > 0, [n, r] = P({}), [i, a] = P(!1), [o, s] = P(tn);
|
|
1754
1800
|
return j(() => {
|
|
1755
1801
|
if (!t) {
|
|
1756
1802
|
r({});
|
|
@@ -1812,9 +1858,9 @@ function dn(e) {
|
|
|
1812
1858
|
});
|
|
1813
1859
|
}
|
|
1814
1860
|
function fn(e, t = {}) {
|
|
1815
|
-
let { defaultEnabled: n = !1 } = t, r =
|
|
1861
|
+
let { defaultEnabled: n = !1 } = t, r = N(t.author);
|
|
1816
1862
|
r.current = t.author;
|
|
1817
|
-
let [i, a] =
|
|
1863
|
+
let [i, a] = P(n), { hasProviders: o, modelsByProvider: s, modelsLoading: c, selectedModel: l, setSelectedModel: u } = rn(), [d, f] = P(!1), [p, m] = P(null), [h, g] = P(!1), [_, v] = P([]), b = N([]), x = (e, t) => {
|
|
1818
1864
|
v((n) => {
|
|
1819
1865
|
let r = typeof e == "function" ? e(n) : e;
|
|
1820
1866
|
if (t?.stamp !== !1) {
|
|
@@ -1836,23 +1882,23 @@ function fn(e, t = {}) {
|
|
|
1836
1882
|
attachmentPreviews: t
|
|
1837
1883
|
} : n));
|
|
1838
1884
|
});
|
|
1839
|
-
}, w =
|
|
1885
|
+
}, w = N(/* @__PURE__ */ new Map()), ee = $(), E = N(ee);
|
|
1840
1886
|
E.current = ee;
|
|
1841
|
-
let D =
|
|
1887
|
+
let D = N(null), O = N(!1), te = N(null), k = N(null), A = N(null), j = () => {
|
|
1842
1888
|
A.current?.abort();
|
|
1843
|
-
},
|
|
1889
|
+
}, ne = T()?.registry ?? {}, [F, I] = P(void 0), L = N(void 0), R = (e, t) => {
|
|
1844
1890
|
if (!t) return !1;
|
|
1845
1891
|
if (!e) return !0;
|
|
1846
1892
|
let n = C(t);
|
|
1847
1893
|
return !!n && e.includes(n.provider);
|
|
1848
|
-
},
|
|
1894
|
+
}, V = M(() => F ? Object.fromEntries(Object.entries(s).map(([e, t]) => [e, t.filter((e) => F.includes(e.provider))]).filter(([, e]) => e.length)) : s, [F, s]), H = R(F, l) ? l : Object.values(V).flat()[0]?.id ?? "", U = i && H ? C(H) : null, ae = U ? ne[U.provider] : null, W = e.executor, G = !!W?.alongside, K = !!W && !G, q = !W || !!W.canRewind, se = !!W?.attachments, ce = async (e) => se && e?.length ? Promise.all(e.map((e) => y.fileToAttachment(e))) : void 0, le = N([]), ue = (e) => !!e && le.current.some((t) => t.value === e), de = N(!1), [fe, pe] = P([]), [me, he] = P(""), Y = N(""), ge = (e) => {
|
|
1849
1895
|
Y.current = e, he(e);
|
|
1850
1896
|
}, _e = (e) => {
|
|
1851
1897
|
let t = W?.models?.(e) ?? [];
|
|
1852
|
-
|
|
1898
|
+
le.current = t, pe(t);
|
|
1853
1899
|
let n = W?.catalogProviders?.(e);
|
|
1854
|
-
|
|
1855
|
-
let r = G && !
|
|
1900
|
+
L.current = n, I(n);
|
|
1901
|
+
let r = G && !R(n, l) ? t[0]?.value : void 0;
|
|
1856
1902
|
ge(W?.defaultModel?.(e) ?? r ?? "");
|
|
1857
1903
|
}, X = async (e, t, n, r, i) => {
|
|
1858
1904
|
let a = D.current;
|
|
@@ -1873,14 +1919,14 @@ function fn(e, t = {}) {
|
|
|
1873
1919
|
duration: e.duration ?? l(e.id)
|
|
1874
1920
|
}), d = (e, t) => x((n) => n.map((n) => {
|
|
1875
1921
|
if (n.id !== s) return n;
|
|
1876
|
-
let r = e(n.parts ?? []), i =
|
|
1922
|
+
let r = e(n.parts ?? []), i = z(r);
|
|
1877
1923
|
return {
|
|
1878
1924
|
...n,
|
|
1879
1925
|
parts: r,
|
|
1880
1926
|
...t ? { status: t } : {},
|
|
1881
1927
|
...i ? { detail: i } : {}
|
|
1882
1928
|
};
|
|
1883
|
-
})), f = (e) => d((t) =>
|
|
1929
|
+
})), f = (e) => d((t) => ie(t, e, u)), p = !1, h = (e, t) => {
|
|
1884
1930
|
t?.id && t.id !== "text" && (p = !0), f({
|
|
1885
1931
|
type: "text",
|
|
1886
1932
|
id: t?.id ?? "text",
|
|
@@ -1928,9 +1974,9 @@ function fn(e, t = {}) {
|
|
|
1928
1974
|
});
|
|
1929
1975
|
}));
|
|
1930
1976
|
}, ee = (e, t) => {
|
|
1931
|
-
d((n) => (t && !p ?
|
|
1977
|
+
d((n) => (t && !p ? ie(n, {
|
|
1932
1978
|
type: "text",
|
|
1933
|
-
id:
|
|
1979
|
+
id: re,
|
|
1934
1980
|
text: t,
|
|
1935
1981
|
streaming: !1
|
|
1936
1982
|
}, u) : n).map((t) => t.type === "reasoning" && t.streaming ? u(t) : t.type === "text" && t.streaming ? {
|
|
@@ -2021,21 +2067,21 @@ function fn(e, t = {}) {
|
|
|
2021
2067
|
return await X("", !1, void 0, {
|
|
2022
2068
|
id: t,
|
|
2023
2069
|
answers: n,
|
|
2024
|
-
historyText:
|
|
2070
|
+
historyText: B(r.questions, n)
|
|
2025
2071
|
});
|
|
2026
2072
|
} finally {
|
|
2027
2073
|
O.current = !1, f(!1);
|
|
2028
2074
|
}
|
|
2029
2075
|
}, Se = async (t, n, r) => {
|
|
2030
|
-
let i =
|
|
2076
|
+
let i = L.current, a = Object.values(s).flat().find((e) => !i || i.includes(e.provider))?.id, o = r && R(i, r) ? r : R(i, H) ? void 0 : a, c = o ? C(o) : U, l = c && D.current ? W?.catalogReasoning?.(D.current.params, c.provider) : void 0, u = l ? { reasoning: l } : {}, d = D.current;
|
|
2031
2077
|
if (!d) return m(E.current.noActiveSession), null;
|
|
2032
|
-
let f = o ? C(o) : U, p = f ?
|
|
2078
|
+
let f = o ? C(o) : U, p = f ? ne[f.provider] : null;
|
|
2033
2079
|
if (!p || !f) return m(E.current.noProviderAvailable), null;
|
|
2034
2080
|
n?.length && (d.attachmentsRef.current = [...d.attachmentsRef.current ?? [], ...n]);
|
|
2035
2081
|
let h = (n ?? []).filter((e) => y.isTextAttachment(e.mimeType)).map((e) => e.base64.length <= ln ? `\n\n[File allegato: ${e.name}]\n${y.decodeBase64Text(e.base64)}` : `\n\n[File allegato: ${e.name} — troppo grande per essere incollato qui. Usa uno dei tool di lettura file disponibili (es. list_csv_columns/extract_csv_column) per leggerne il contenuto prima di chiedere altro all'utente.]`).join(""), g = un(n ?? []), _ = d.tools.map((e) => ({
|
|
2036
2082
|
name: e.name,
|
|
2037
2083
|
description: e.description,
|
|
2038
|
-
inputSchema:
|
|
2084
|
+
inputSchema: oe(e.inputSchema)
|
|
2039
2085
|
})), v = (e, t, n, r) => {
|
|
2040
2086
|
let i = E.current, a = `approval-${e}`, o = t.describeApproval?.(n) ?? t.describeInvocation?.(n) ?? t.name;
|
|
2041
2087
|
x((e) => [...e, {
|
|
@@ -2272,13 +2318,13 @@ function fn(e, t = {}) {
|
|
|
2272
2318
|
history: [],
|
|
2273
2319
|
logId: crypto.randomUUID(),
|
|
2274
2320
|
attachmentsRef: a
|
|
2275
|
-
}, K) return g(!0), _e(t), await X(n?.openingMessage ?? "", !0, void 0, void 0, await
|
|
2321
|
+
}, K) return g(!0), _e(t), await X(n?.openingMessage ?? "", !0, void 0, void 0, await ce(n?.attachments));
|
|
2276
2322
|
if (G) {
|
|
2277
|
-
_e(t),
|
|
2323
|
+
_e(t), de.current = !1;
|
|
2278
2324
|
let e = n?.model || Y.current;
|
|
2279
|
-
if (
|
|
2325
|
+
if (ue(e)) return g(!0), de.current = !0, await X(n?.openingMessage ?? "", !0, e, void 0, await ce(n?.attachments));
|
|
2280
2326
|
}
|
|
2281
|
-
let s = n?.model || void 0, c = s ? !!
|
|
2327
|
+
let s = n?.model || void 0, c = s ? !!ne[C(s)?.provider ?? ""] : !!ae;
|
|
2282
2328
|
if (!i || !c) {
|
|
2283
2329
|
g(!1);
|
|
2284
2330
|
let n = e.fallback(t, r);
|
|
@@ -2312,7 +2358,7 @@ function fn(e, t = {}) {
|
|
|
2312
2358
|
history: n.history,
|
|
2313
2359
|
logId: crypto.randomUUID(),
|
|
2314
2360
|
attachmentsRef: a
|
|
2315
|
-
}, (K || G) && _e(t),
|
|
2361
|
+
}, (K || G) && _e(t), de.current = !1, g(K || G || i && !!ae);
|
|
2316
2362
|
} catch (e) {
|
|
2317
2363
|
m(be(e));
|
|
2318
2364
|
} finally {
|
|
@@ -2337,11 +2383,11 @@ function fn(e, t = {}) {
|
|
|
2337
2383
|
historyAt: i.history.length
|
|
2338
2384
|
}]);
|
|
2339
2385
|
try {
|
|
2340
|
-
if (K) return await X(t, !1, n?.model || void 0, void 0, await
|
|
2386
|
+
if (K) return await X(t, !1, n?.model || void 0, void 0, await ce(n?.attachments));
|
|
2341
2387
|
let r = n?.model || (G ? Y.current : "");
|
|
2342
|
-
if (G &&
|
|
2343
|
-
let e = !
|
|
2344
|
-
return
|
|
2388
|
+
if (G && ue(r)) {
|
|
2389
|
+
let e = !de.current;
|
|
2390
|
+
return de.current = !0, await X(t, e, r, void 0, await ce(n?.attachments));
|
|
2345
2391
|
}
|
|
2346
2392
|
te.current &&= {
|
|
2347
2393
|
...te.current,
|
|
@@ -2356,7 +2402,7 @@ function fn(e, t = {}) {
|
|
|
2356
2402
|
}
|
|
2357
2403
|
}, Ee = (e) => {
|
|
2358
2404
|
let t = D.current, n = _.findIndex((t) => t.id === e), r = _[n], i = r?.detail?.trim();
|
|
2359
|
-
if (!
|
|
2405
|
+
if (!q || !t || !r || r.kind !== "user" || !i) return;
|
|
2360
2406
|
if (r.historyAt !== void 0) return r.historyAt;
|
|
2361
2407
|
let a = _.slice(0, n).filter((e) => e.kind === "user" && e.detail?.trim() === i).length, o = 0;
|
|
2362
2408
|
for (let e = 0; e < t.history.length; e += 1) {
|
|
@@ -2399,9 +2445,9 @@ function fn(e, t = {}) {
|
|
|
2399
2445
|
hasProviders: o,
|
|
2400
2446
|
selectedModel: K || G && me ? me : H,
|
|
2401
2447
|
setSelectedModel: K ? ge : G ? (e) => {
|
|
2402
|
-
|
|
2448
|
+
ue(e) ? ge(e) : (ge(""), u(e));
|
|
2403
2449
|
} : u,
|
|
2404
|
-
modelsByProvider:
|
|
2450
|
+
modelsByProvider: V,
|
|
2405
2451
|
modelsLoading: c,
|
|
2406
2452
|
running: d,
|
|
2407
2453
|
error: p,
|
|
@@ -2420,9 +2466,9 @@ function fn(e, t = {}) {
|
|
|
2420
2466
|
answerQuestions: xe,
|
|
2421
2467
|
cardAction: ve,
|
|
2422
2468
|
rewind: Oe,
|
|
2423
|
-
canRewind:
|
|
2469
|
+
canRewind: q,
|
|
2424
2470
|
rewindable: De,
|
|
2425
|
-
executorAttachments:
|
|
2471
|
+
executorAttachments: se,
|
|
2426
2472
|
offersFallback: e.offersFallback !== !1
|
|
2427
2473
|
};
|
|
2428
2474
|
}
|
|
@@ -2487,7 +2533,7 @@ function _n(e) {
|
|
|
2487
2533
|
return t.kind === "chat" ? t.message : e.continueWithoutAi;
|
|
2488
2534
|
},
|
|
2489
2535
|
getTools(t, n, r) {
|
|
2490
|
-
let i =
|
|
2536
|
+
let i = q({
|
|
2491
2537
|
attachmentsRef: r,
|
|
2492
2538
|
collected: n.collected,
|
|
2493
2539
|
proxyFetch: w
|
|
@@ -2521,7 +2567,7 @@ function vn(e, t) {
|
|
|
2521
2567
|
//#endregion
|
|
2522
2568
|
//#region src/presentation/ResultDestinationPicker.tsx
|
|
2523
2569
|
function yn({ manifest: e, result: t, meta: n, taskId: r, initiallyApplied: i, onApplied: a, extraDestinations: o }) {
|
|
2524
|
-
let s = $(), c = ft(), l = c.scope, u = D(), [d, f] =
|
|
2570
|
+
let s = $(), c = ft(), l = c.scope, u = D(), [d, f] = P(null), [p, m] = P(new Set(i ?? [])), [h, g] = P(null), _ = De(), v = /* @__PURE__ */ new Map();
|
|
2525
2571
|
e.destinationIds.forEach((e) => {
|
|
2526
2572
|
let t = _[e];
|
|
2527
2573
|
t && v.set(e, t);
|
|
@@ -2545,16 +2591,16 @@ function yn({ manifest: e, result: t, meta: n, taskId: r, initiallyApplied: i, o
|
|
|
2545
2591
|
f(null);
|
|
2546
2592
|
}
|
|
2547
2593
|
};
|
|
2548
|
-
return /* @__PURE__ */
|
|
2594
|
+
return /* @__PURE__ */ L("div", {
|
|
2549
2595
|
className: "space-y-2",
|
|
2550
2596
|
children: [
|
|
2551
|
-
/* @__PURE__ */
|
|
2597
|
+
/* @__PURE__ */ I("p", {
|
|
2552
2598
|
className: "text-xs font-medium text-muted-foreground",
|
|
2553
2599
|
children: s.destinationPickerTitle
|
|
2554
2600
|
}),
|
|
2555
|
-
/* @__PURE__ */
|
|
2601
|
+
/* @__PURE__ */ I("div", {
|
|
2556
2602
|
className: "flex flex-wrap gap-2",
|
|
2557
|
-
children: y.map((e) => /* @__PURE__ */
|
|
2603
|
+
children: y.map((e) => /* @__PURE__ */ I("button", {
|
|
2558
2604
|
type: "button",
|
|
2559
2605
|
disabled: d !== null,
|
|
2560
2606
|
onClick: () => void b(e.id),
|
|
@@ -2562,7 +2608,7 @@ function yn({ manifest: e, result: t, meta: n, taskId: r, initiallyApplied: i, o
|
|
|
2562
2608
|
children: d === e.id ? s.destinationApplying : `${p.has(e.id) ? "✓ " : ""}${e.id === "json-export" ? s.exportJson : e.label}`
|
|
2563
2609
|
}, e.id))
|
|
2564
2610
|
}),
|
|
2565
|
-
h && /* @__PURE__ */
|
|
2611
|
+
h && /* @__PURE__ */ I("p", {
|
|
2566
2612
|
className: "text-xs text-destructive",
|
|
2567
2613
|
children: h
|
|
2568
2614
|
})
|
|
@@ -2581,18 +2627,18 @@ function Sn(e) {
|
|
|
2581
2627
|
//#endregion
|
|
2582
2628
|
//#region src/presentation/reports/GenericResultPreview.tsx
|
|
2583
2629
|
function Cn({ result: e }) {
|
|
2584
|
-
let [t, n] =
|
|
2585
|
-
return /* @__PURE__ */
|
|
2630
|
+
let [t, n] = P(!1);
|
|
2631
|
+
return /* @__PURE__ */ L("div", {
|
|
2586
2632
|
className: `relative cursor-pointer rounded-md border border-border/60 ${t ? "max-h-80 overflow-y-auto" : "max-h-28 overflow-hidden"}`,
|
|
2587
2633
|
onClick: () => n((e) => !e),
|
|
2588
2634
|
title: t ? "Clic per comprimere" : "Clic per espandere",
|
|
2589
|
-
children: [/* @__PURE__ */
|
|
2635
|
+
children: [/* @__PURE__ */ I(c, {
|
|
2590
2636
|
language: "json",
|
|
2591
2637
|
showCopy: t,
|
|
2592
2638
|
background: "transparent",
|
|
2593
2639
|
className: "!text-[11px]",
|
|
2594
2640
|
children: JSON.stringify(e, null, 2)
|
|
2595
|
-
}), !t && /* @__PURE__ */
|
|
2641
|
+
}), !t && /* @__PURE__ */ I("div", { className: "pointer-events-none absolute inset-x-0 bottom-0 h-6 bg-gradient-to-t from-muted/30 to-transparent" })]
|
|
2596
2642
|
});
|
|
2597
2643
|
}
|
|
2598
2644
|
//#endregion
|
|
@@ -2639,7 +2685,7 @@ function jn(e, t, n, r, i) {
|
|
|
2639
2685
|
return o(n) ? n : Object.values(r).flat().map((e) => e.id).find(o);
|
|
2640
2686
|
}
|
|
2641
2687
|
function Mn(e) {
|
|
2642
|
-
let t = T()?.registry ?? {}, { modelsByProvider: n, selectedModel: r } = rn(), i =
|
|
2688
|
+
let t = T()?.registry ?? {}, { modelsByProvider: n, selectedModel: r } = rn(), i = N({
|
|
2643
2689
|
registry: t,
|
|
2644
2690
|
modelsByProvider: n,
|
|
2645
2691
|
selectedModel: r
|
|
@@ -2649,7 +2695,7 @@ function Mn(e) {
|
|
|
2649
2695
|
modelsByProvider: n,
|
|
2650
2696
|
selectedModel: r
|
|
2651
2697
|
};
|
|
2652
|
-
let a =
|
|
2698
|
+
let a = N(/* @__PURE__ */ new Set()), o = k(async (t, n, r) => {
|
|
2653
2699
|
if (!e) return !1;
|
|
2654
2700
|
let o = Ue(e, t, n), s = W(t), c = `${e}:${t}:${n}`;
|
|
2655
2701
|
if (!o || !s?.autoTitle || o.name || !Ye(o) || a.current.has(c)) return !1;
|
|
@@ -2693,11 +2739,11 @@ function Fn({ manifest: e, params: t, extraDestinations: n, precedingActivity: r
|
|
|
2693
2739
|
let c = ft(), l = fn(e.definition, {
|
|
2694
2740
|
defaultEnabled: !0,
|
|
2695
2741
|
...c.person ? { author: c.person } : {}
|
|
2696
|
-
}), u = e.thread?.(t) || void 0, d = e.speaker?.(t), f = c.scope, p = D(), m =
|
|
2742
|
+
}), u = e.thread?.(t) || void 0, d = e.speaker?.(t), f = c.scope, p = D(), m = N(i ?? `subagent-${e.id}-${crypto.randomUUID()}`).current, [h, g] = P(null), _ = (t) => {
|
|
2697
2743
|
e.definition.conversational || g(t);
|
|
2698
|
-
}, [v, y] =
|
|
2744
|
+
}, [v, y] = P([]), [b, x] = P(null), S = Sn(e.id), C = S?.kind === "selection" ? S : null, [w, T] = P(null), ee = N(!1), E = N(0), O = N(null);
|
|
2699
2745
|
h && h !== O.current && (O.current = h, E.current = (r?.length ?? 0) + l.activity.length);
|
|
2700
|
-
let te =
|
|
2746
|
+
let te = N(!1), k = l.remote || !l.hasProviders || l.selectedModel !== "";
|
|
2701
2747
|
j(() => {
|
|
2702
2748
|
!ee.current && k && (ee.current = !0, a ? (U.current = !0, l.resume(e.toParams(t), a)) : (o && l.setSelectedModel(o), l.run(e.toParams(t), {
|
|
2703
2749
|
model: o,
|
|
@@ -2734,18 +2780,18 @@ function Fn({ manifest: e, params: t, extraDestinations: n, precedingActivity: r
|
|
|
2734
2780
|
...n,
|
|
2735
2781
|
[e]: t
|
|
2736
2782
|
});
|
|
2737
|
-
},
|
|
2783
|
+
}, ne = (e) => _(e), re = M(() => h && C && w ? C.applySelection(h, w) : h, [
|
|
2738
2784
|
h,
|
|
2739
2785
|
C,
|
|
2740
2786
|
w
|
|
2741
|
-
]),
|
|
2742
|
-
|
|
2787
|
+
]), R = M(() => c.componentAnchors.filter((t) => t.subagentId === e.id && t.onResult), [c.componentAnchors, e.id]), ie = M(() => wn(R, t, m), [
|
|
2788
|
+
R,
|
|
2743
2789
|
t,
|
|
2744
2790
|
m
|
|
2745
|
-
]),
|
|
2791
|
+
]), z = M(() => ie ? [ie, ...n ?? []] : n, [ie, n]), B = e.chatEntityId?.(t), V = Mn(f?.id), H = N(!1), U = N(!1);
|
|
2746
2792
|
j(() => {
|
|
2747
2793
|
let n = !H.current && l.running, i = H.current && !l.running;
|
|
2748
|
-
if (H.current = l.running, !n && !i || !
|
|
2794
|
+
if (H.current = l.running, !n && !i || !B || !f) return;
|
|
2749
2795
|
if (U.current) {
|
|
2750
2796
|
i && (U.current = !1);
|
|
2751
2797
|
return;
|
|
@@ -2756,21 +2802,37 @@ function Fn({ manifest: e, params: t, extraDestinations: n, precedingActivity: r
|
|
|
2756
2802
|
e.autoTitle && e.definition.conversational && !Ye({ activity: o }) || (We({
|
|
2757
2803
|
scopeId: f.id,
|
|
2758
2804
|
subagentId: e.id,
|
|
2759
|
-
entityId:
|
|
2805
|
+
entityId: B,
|
|
2760
2806
|
params: t,
|
|
2761
2807
|
title: vn(e, t),
|
|
2762
2808
|
history: a.history,
|
|
2763
2809
|
activity: o
|
|
2764
|
-
}), i && e.autoTitle &&
|
|
2810
|
+
}), i && e.autoTitle && V(e.id, B, l.selectedModel));
|
|
2765
2811
|
}, [l.running]);
|
|
2766
|
-
let ae = () => {
|
|
2812
|
+
let ae = l.activity.flatMap((e) => (e.parts ?? []).flatMap((e) => e.type === "card" && e.outcome ? [`${e.id}:${e.outcome.status}`] : [])).join(","), W = N(ae);
|
|
2813
|
+
j(() => {
|
|
2814
|
+
if (ae === W.current || (W.current = ae, !ae || !B || !f || l.running || U.current)) return;
|
|
2815
|
+
let n = l.snapshot();
|
|
2816
|
+
if (!n) return;
|
|
2817
|
+
let i = [...r ?? [], ...n.activity];
|
|
2818
|
+
e.autoTitle && e.definition.conversational && !Ye({ activity: i }) || We({
|
|
2819
|
+
scopeId: f.id,
|
|
2820
|
+
subagentId: e.id,
|
|
2821
|
+
entityId: B,
|
|
2822
|
+
params: t,
|
|
2823
|
+
title: vn(e, t),
|
|
2824
|
+
history: n.history,
|
|
2825
|
+
activity: i
|
|
2826
|
+
});
|
|
2827
|
+
}, [ae]);
|
|
2828
|
+
let G = () => {
|
|
2767
2829
|
te.current = !0, l.running && l.stop(), c.closeTask(m);
|
|
2768
|
-
},
|
|
2830
|
+
}, K = N(Dn(e.id) ?? Pn).current, q = K({
|
|
2769
2831
|
params: t,
|
|
2770
2832
|
taskId: m,
|
|
2771
2833
|
running: l.running,
|
|
2772
|
-
close:
|
|
2773
|
-
}),
|
|
2834
|
+
close: G
|
|
2835
|
+
}), oe = (e) => {
|
|
2774
2836
|
y((t) => t.includes(e) ? t : [...t, e]);
|
|
2775
2837
|
};
|
|
2776
2838
|
return j(() => {
|
|
@@ -2782,34 +2844,34 @@ function Fn({ manifest: e, params: t, extraDestinations: n, precedingActivity: r
|
|
|
2782
2844
|
onApplied: (e) => _(e),
|
|
2783
2845
|
precedingActivity: r,
|
|
2784
2846
|
panelExtraAnchorIndex: E.current,
|
|
2785
|
-
onDismiss:
|
|
2847
|
+
onDismiss: G,
|
|
2786
2848
|
...u ? { thread: u } : {},
|
|
2787
2849
|
...d ? { speaker: d } : {},
|
|
2788
|
-
...
|
|
2789
|
-
panelActions:
|
|
2790
|
-
composerActions:
|
|
2791
|
-
composerCommands:
|
|
2792
|
-
panelExtra: h ? /* @__PURE__ */
|
|
2793
|
-
C && w ? /* @__PURE__ */
|
|
2850
|
+
...B ? { savedToDisk: !0 } : {},
|
|
2851
|
+
panelActions: q.content,
|
|
2852
|
+
composerActions: q.actions,
|
|
2853
|
+
composerCommands: q.commands,
|
|
2854
|
+
panelExtra: h ? /* @__PURE__ */ L(F, { children: [
|
|
2855
|
+
C && w ? /* @__PURE__ */ I(C.Report, {
|
|
2794
2856
|
result: h,
|
|
2795
2857
|
selection: w,
|
|
2796
2858
|
onChange: A
|
|
2797
|
-
}) : S?.kind === "editable" ? /* @__PURE__ */
|
|
2859
|
+
}) : S?.kind === "editable" ? /* @__PURE__ */ I(S.Report, {
|
|
2798
2860
|
result: h,
|
|
2799
|
-
onResultChange:
|
|
2800
|
-
}) : /* @__PURE__ */
|
|
2801
|
-
b && /* @__PURE__ */
|
|
2861
|
+
onResultChange: ne
|
|
2862
|
+
}) : /* @__PURE__ */ I(Cn, { result: re }),
|
|
2863
|
+
b && /* @__PURE__ */ L("p", {
|
|
2802
2864
|
className: "text-xs text-destructive",
|
|
2803
2865
|
children: ["Salvataggio automatico non riuscito: ", b]
|
|
2804
2866
|
}),
|
|
2805
|
-
/* @__PURE__ */
|
|
2867
|
+
/* @__PURE__ */ I(yn, {
|
|
2806
2868
|
manifest: e,
|
|
2807
|
-
result:
|
|
2869
|
+
result: re,
|
|
2808
2870
|
meta: t,
|
|
2809
2871
|
taskId: m,
|
|
2810
2872
|
initiallyApplied: v,
|
|
2811
|
-
onApplied:
|
|
2812
|
-
extraDestinations:
|
|
2873
|
+
onApplied: oe,
|
|
2874
|
+
extraDestinations: z
|
|
2813
2875
|
})
|
|
2814
2876
|
] }) : void 0
|
|
2815
2877
|
});
|
|
@@ -2828,15 +2890,15 @@ function Fn({ manifest: e, params: t, extraDestinations: n, precedingActivity: r
|
|
|
2828
2890
|
e,
|
|
2829
2891
|
t,
|
|
2830
2892
|
h,
|
|
2831
|
-
|
|
2893
|
+
re,
|
|
2832
2894
|
w,
|
|
2833
2895
|
v,
|
|
2834
2896
|
n,
|
|
2835
2897
|
r,
|
|
2836
2898
|
b,
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2899
|
+
q.content,
|
|
2900
|
+
q.actions,
|
|
2901
|
+
q.commands
|
|
2840
2902
|
]), j(() => () => {
|
|
2841
2903
|
c.closeTask(m);
|
|
2842
2904
|
}, [c.closeTask, m]), null;
|
|
@@ -2844,7 +2906,7 @@ function Fn({ manifest: e, params: t, extraDestinations: n, precedingActivity: r
|
|
|
2844
2906
|
//#endregion
|
|
2845
2907
|
//#region src/presentation/OrchestratorRunner.tsx
|
|
2846
2908
|
function In({ userGoal: e }) {
|
|
2847
|
-
let t = $(), n =
|
|
2909
|
+
let t = $(), n = M(() => _n({
|
|
2848
2910
|
unavailable: t.orchestratorUnavailable,
|
|
2849
2911
|
continueWithoutAi: t.orchestratorContinueWithoutAi,
|
|
2850
2912
|
preparing: t.orchestratorPreparing,
|
|
@@ -2852,7 +2914,7 @@ function In({ userGoal: e }) {
|
|
|
2852
2914
|
}), []), r = ft(), i = fn(n, {
|
|
2853
2915
|
defaultEnabled: !0,
|
|
2854
2916
|
...r.person ? { author: r.person } : {}
|
|
2855
|
-
}), [a, o] =
|
|
2917
|
+
}), [a, o] = P(null), s = N(!1), c = !i.hasProviders || i.selectedModel !== "", l = N(r.pendingExtraDestinations), u = N(r.pendingAttachments), d = N(r.pendingModel), f = N(r.pendingScopedSubagentId ?? r.scopedSubagentId ?? void 0), p = N(r.pendingCarryOver), m = N(!1), h = (e) => {
|
|
2856
2918
|
e && typeof e == "object" && e.kind === "handoff" && (o(e), r.closeTask(lt));
|
|
2857
2919
|
};
|
|
2858
2920
|
j(() => {
|
|
@@ -2892,10 +2954,10 @@ function In({ userGoal: e }) {
|
|
|
2892
2954
|
]), j(() => () => {
|
|
2893
2955
|
r.closeTask(lt);
|
|
2894
2956
|
}, [r.closeTask]);
|
|
2895
|
-
let g =
|
|
2957
|
+
let g = M(() => [...p.current?.activity ?? [], ...i.activity], [i.activity]);
|
|
2896
2958
|
if (!a) return null;
|
|
2897
2959
|
let _ = W(a.subagentId);
|
|
2898
|
-
return _ ? /* @__PURE__ */
|
|
2960
|
+
return _ ? /* @__PURE__ */ I(Fn, {
|
|
2899
2961
|
manifest: _,
|
|
2900
2962
|
params: a.params,
|
|
2901
2963
|
extraDestinations: l.current,
|
|
@@ -2910,7 +2972,7 @@ function Ln({ manifest: e, extraDestinations: n }) {
|
|
|
2910
2972
|
let r = ft(), i = fn(e.definition, {
|
|
2911
2973
|
defaultEnabled: !1,
|
|
2912
2974
|
...r.person ? { author: r.person } : {}
|
|
2913
|
-
}), a = $(), o =
|
|
2975
|
+
}), a = $(), o = N(`manual-${e.id}-${crypto.randomUUID()}`).current, [s, c] = P(null), [l, u] = P([]), d = Sn(e.id), f = d?.kind === "selection" ? d : null, [p, m] = P(null), [h, g] = P(null), _ = N(!1), v = (t) => {
|
|
2914
2976
|
if (!e.manualEntry) return;
|
|
2915
2977
|
let n;
|
|
2916
2978
|
try {
|
|
@@ -2931,17 +2993,17 @@ function Ln({ manifest: e, extraDestinations: n }) {
|
|
|
2931
2993
|
...n,
|
|
2932
2994
|
[e]: t
|
|
2933
2995
|
});
|
|
2934
|
-
}, b = (e) => c(e), x =
|
|
2996
|
+
}, b = (e) => c(e), x = M(() => s && f && p ? f.applySelection(s, p) : s, [
|
|
2935
2997
|
s,
|
|
2936
2998
|
f,
|
|
2937
2999
|
p
|
|
2938
3000
|
]), S = (e) => {
|
|
2939
3001
|
u((t) => t.includes(e) ? t : [...t, e]);
|
|
2940
|
-
}, C =
|
|
3002
|
+
}, C = M(() => r.componentAnchors.filter((t) => t.subagentId === e.id && t.onResult), [r.componentAnchors, e.id]), w = M(() => h ? wn(C, h, o) : null, [
|
|
2941
3003
|
C,
|
|
2942
3004
|
h,
|
|
2943
3005
|
o
|
|
2944
|
-
]), T =
|
|
3006
|
+
]), T = M(() => w ? [w, ...n ?? []] : n, [w, n]);
|
|
2945
3007
|
return j(() => {
|
|
2946
3008
|
_.current || r.openTask({
|
|
2947
3009
|
id: o,
|
|
@@ -2956,18 +3018,18 @@ function Ln({ manifest: e, extraDestinations: n }) {
|
|
|
2956
3018
|
onDismiss: () => {
|
|
2957
3019
|
_.current = !0, i.running && i.stop(), r.closeTask(o);
|
|
2958
3020
|
},
|
|
2959
|
-
panelExtra: s ? /* @__PURE__ */
|
|
3021
|
+
panelExtra: s ? /* @__PURE__ */ L("div", {
|
|
2960
3022
|
className: "space-y-2",
|
|
2961
3023
|
children: [
|
|
2962
|
-
f && p ? /* @__PURE__ */
|
|
3024
|
+
f && p ? /* @__PURE__ */ I(f.Report, {
|
|
2963
3025
|
result: s,
|
|
2964
3026
|
selection: p,
|
|
2965
3027
|
onChange: y
|
|
2966
|
-
}) : d?.kind === "editable" ? /* @__PURE__ */
|
|
3028
|
+
}) : d?.kind === "editable" ? /* @__PURE__ */ I(d.Report, {
|
|
2967
3029
|
result: s,
|
|
2968
3030
|
onResultChange: b
|
|
2969
|
-
}) : /* @__PURE__ */
|
|
2970
|
-
/* @__PURE__ */
|
|
3031
|
+
}) : /* @__PURE__ */ I(Cn, { result: x }),
|
|
3032
|
+
/* @__PURE__ */ I(yn, {
|
|
2971
3033
|
manifest: e,
|
|
2972
3034
|
result: x,
|
|
2973
3035
|
meta: h ?? {},
|
|
@@ -2976,7 +3038,7 @@ function Ln({ manifest: e, extraDestinations: n }) {
|
|
|
2976
3038
|
onApplied: S,
|
|
2977
3039
|
extraDestinations: T
|
|
2978
3040
|
}),
|
|
2979
|
-
i.hasProviders && /* @__PURE__ */
|
|
3041
|
+
i.hasProviders && /* @__PURE__ */ I(t, {
|
|
2980
3042
|
label: a.resumeWithAi,
|
|
2981
3043
|
variant: "outline-secondary",
|
|
2982
3044
|
className: "text-xs",
|
|
@@ -3005,30 +3067,30 @@ function Ln({ manifest: e, extraDestinations: n }) {
|
|
|
3005
3067
|
//#endregion
|
|
3006
3068
|
//#region src/presentation/EarlierSessions.tsx
|
|
3007
3069
|
function Rn({ title: e, meta: t, action: n }) {
|
|
3008
|
-
return /* @__PURE__ */
|
|
3070
|
+
return /* @__PURE__ */ L("div", {
|
|
3009
3071
|
role: "separator",
|
|
3010
3072
|
"aria-label": e,
|
|
3011
3073
|
className: "my-3 flex items-center gap-2 text-[11px] text-muted-foreground",
|
|
3012
3074
|
children: [
|
|
3013
|
-
/* @__PURE__ */
|
|
3014
|
-
/* @__PURE__ */
|
|
3075
|
+
/* @__PURE__ */ I("span", { className: "h-px flex-1 bg-border" }),
|
|
3076
|
+
/* @__PURE__ */ L("span", {
|
|
3015
3077
|
className: "flex min-w-0 max-w-[75%] flex-col items-center text-center",
|
|
3016
3078
|
children: [
|
|
3017
|
-
/* @__PURE__ */
|
|
3079
|
+
/* @__PURE__ */ I("span", {
|
|
3018
3080
|
className: "max-w-full truncate font-medium text-foreground",
|
|
3019
3081
|
children: e
|
|
3020
3082
|
}),
|
|
3021
|
-
t && /* @__PURE__ */
|
|
3083
|
+
t && /* @__PURE__ */ I("span", { children: t }),
|
|
3022
3084
|
n
|
|
3023
3085
|
]
|
|
3024
3086
|
}),
|
|
3025
|
-
/* @__PURE__ */
|
|
3087
|
+
/* @__PURE__ */ I("span", { className: "h-px flex-1 bg-border" })
|
|
3026
3088
|
]
|
|
3027
3089
|
});
|
|
3028
3090
|
}
|
|
3029
3091
|
function zn({ chat: e, thread: t, from: n, showEvents: r }) {
|
|
3030
3092
|
let i = ht(t, n, e.savedAt, r);
|
|
3031
|
-
return /* @__PURE__ */
|
|
3093
|
+
return /* @__PURE__ */ I(Vt, {
|
|
3032
3094
|
activity: e.activity,
|
|
3033
3095
|
pinUserMessages: !1,
|
|
3034
3096
|
speaker: W(e.subagentId)?.speaker?.(e.params),
|
|
@@ -3036,27 +3098,27 @@ function zn({ chat: e, thread: t, from: n, showEvents: r }) {
|
|
|
3036
3098
|
});
|
|
3037
3099
|
}
|
|
3038
3100
|
function Bn({ scopeId: e, thread: n, taskId: r, scrollRef: i, onLoad: a, onContinue: o, busy: s = !1, showEvents: c = !0 }) {
|
|
3039
|
-
let l = $(), { locale: u } = E(), [d, f] =
|
|
3101
|
+
let l = $(), { locale: u } = E(), [d, f] = P(0);
|
|
3040
3102
|
j(() => Ve(() => f((e) => e + 1)), []);
|
|
3041
|
-
let p =
|
|
3103
|
+
let p = M(() => nt(e, n, r), [
|
|
3042
3104
|
e,
|
|
3043
3105
|
n,
|
|
3044
3106
|
r,
|
|
3045
3107
|
d
|
|
3046
|
-
]), [m, h] =
|
|
3108
|
+
]), [m, h] = P(0);
|
|
3047
3109
|
j(() => h(0), [r, n]);
|
|
3048
|
-
let g = m < p.length, _ =
|
|
3110
|
+
let g = m < p.length, _ = N(null), v = () => {
|
|
3049
3111
|
let e = i.current;
|
|
3050
3112
|
e && (_.current = {
|
|
3051
3113
|
height: e.scrollHeight,
|
|
3052
3114
|
top: e.scrollTop
|
|
3053
3115
|
}), a?.(), h((e) => Math.min(e + 1, p.length));
|
|
3054
|
-
}, y =
|
|
3055
|
-
y.current = v,
|
|
3116
|
+
}, y = N(v);
|
|
3117
|
+
y.current = v, ne(() => {
|
|
3056
3118
|
let e = i.current, t = _.current;
|
|
3057
3119
|
_.current = null, e && t && (e.scrollTop = t.top + (e.scrollHeight - t.height));
|
|
3058
3120
|
}, [m, i]);
|
|
3059
|
-
let b =
|
|
3121
|
+
let b = N(null);
|
|
3060
3122
|
if (j(() => {
|
|
3061
3123
|
let e = i.current, t = b.current;
|
|
3062
3124
|
if (!e || !t || !g || typeof IntersectionObserver > "u") return;
|
|
@@ -3085,11 +3147,11 @@ function Bn({ scopeId: e, thread: n, taskId: r, scrollRef: i, onLoad: a, onConti
|
|
|
3085
3147
|
let t = p[p.indexOf(e) + 1];
|
|
3086
3148
|
return t ? t.savedAt : Q(e);
|
|
3087
3149
|
};
|
|
3088
|
-
return /* @__PURE__ */
|
|
3089
|
-
g && /* @__PURE__ */
|
|
3150
|
+
return /* @__PURE__ */ L("div", { children: [
|
|
3151
|
+
g && /* @__PURE__ */ I("div", {
|
|
3090
3152
|
ref: b,
|
|
3091
3153
|
className: "flex justify-center pb-1",
|
|
3092
|
-
children: /* @__PURE__ */
|
|
3154
|
+
children: /* @__PURE__ */ I(t, {
|
|
3093
3155
|
icon: "history",
|
|
3094
3156
|
label: l.earlierSession,
|
|
3095
3157
|
variant: "link",
|
|
@@ -3097,26 +3159,26 @@ function Bn({ scopeId: e, thread: n, taskId: r, scrollRef: i, onLoad: a, onConti
|
|
|
3097
3159
|
onClick: v
|
|
3098
3160
|
})
|
|
3099
3161
|
}),
|
|
3100
|
-
C.map((e) => /* @__PURE__ */
|
|
3162
|
+
C.map((e) => /* @__PURE__ */ L("section", {
|
|
3101
3163
|
"aria-label": Je(e),
|
|
3102
|
-
children: [/* @__PURE__ */
|
|
3164
|
+
children: [/* @__PURE__ */ I(Rn, {
|
|
3103
3165
|
title: Je(e),
|
|
3104
3166
|
meta: S(l.sessionOf, { at: x(Q(e)) }),
|
|
3105
|
-
action: /* @__PURE__ */
|
|
3167
|
+
action: /* @__PURE__ */ I(t, {
|
|
3106
3168
|
label: l.continueSession,
|
|
3107
3169
|
variant: "link",
|
|
3108
3170
|
className: "text-[11px]",
|
|
3109
3171
|
disabled: s,
|
|
3110
3172
|
onClick: () => o(e)
|
|
3111
3173
|
})
|
|
3112
|
-
}), /* @__PURE__ */
|
|
3174
|
+
}), /* @__PURE__ */ I(zn, {
|
|
3113
3175
|
chat: e,
|
|
3114
3176
|
thread: n,
|
|
3115
3177
|
from: w(e),
|
|
3116
3178
|
showEvents: c
|
|
3117
3179
|
})]
|
|
3118
3180
|
}, `${e.subagentId}:${e.entityId}`)),
|
|
3119
|
-
m > 0 && /* @__PURE__ */
|
|
3181
|
+
m > 0 && /* @__PURE__ */ I(Rn, { title: l.thisSession })
|
|
3120
3182
|
] });
|
|
3121
3183
|
}
|
|
3122
3184
|
//#endregion
|
|
@@ -3134,11 +3196,15 @@ function Vn(e, t) {
|
|
|
3134
3196
|
});
|
|
3135
3197
|
}
|
|
3136
3198
|
function Hn({ task: e, editing: n, onCancelEdit: r, onSendEdit: i }) {
|
|
3137
|
-
let a = $(), [o, c] =
|
|
3199
|
+
let a = $(), [o, c] = P(""), { agent: l, onApplied: u, manualEntry: d } = e, p = l.running;
|
|
3138
3200
|
j(() => {
|
|
3139
3201
|
n && c(n.detail ?? "");
|
|
3140
3202
|
}, [n]);
|
|
3141
|
-
let m = (
|
|
3203
|
+
let { draft: m } = ft(), h = N(m?.nonce ?? 0);
|
|
3204
|
+
j(() => {
|
|
3205
|
+
m && m.nonce !== h.current && (h.current = m.nonce, c(m.text));
|
|
3206
|
+
}, [m]);
|
|
3207
|
+
let g = (e) => {
|
|
3142
3208
|
if (c(""), n && i) {
|
|
3143
3209
|
i(n, e.text);
|
|
3144
3210
|
return;
|
|
@@ -3153,20 +3219,20 @@ function Hn({ task: e, editing: n, onCancelEdit: r, onSendEdit: i }) {
|
|
|
3153
3219
|
}).then((e) => {
|
|
3154
3220
|
e && u(e);
|
|
3155
3221
|
});
|
|
3156
|
-
},
|
|
3157
|
-
return /* @__PURE__ */
|
|
3222
|
+
}, _ = !!d || l.remote && l.remoteModels.length === 0, v = l.alongside && l.remoteModels.some((e) => e.value === l.selectedModel), y = !_ && !l.remote && !v && l.hasProviders && !l.selectedModel, b = _ ? [] : l.remote ? l.remoteModels : l.alongside ? [...l.remoteModels, ...Vn(l.modelsByProvider, l.catalogGroup)] : Vn(l.modelsByProvider);
|
|
3223
|
+
return /* @__PURE__ */ L(F, { children: [n && /* @__PURE__ */ L("div", {
|
|
3158
3224
|
className: "mb-2 flex items-center gap-2 text-xs text-muted-foreground",
|
|
3159
3225
|
children: [
|
|
3160
|
-
/* @__PURE__ */
|
|
3226
|
+
/* @__PURE__ */ I(f, {
|
|
3161
3227
|
name: "pencil",
|
|
3162
3228
|
size: 12,
|
|
3163
3229
|
className: "shrink-0"
|
|
3164
3230
|
}),
|
|
3165
|
-
/* @__PURE__ */
|
|
3231
|
+
/* @__PURE__ */ I("span", {
|
|
3166
3232
|
className: "flex-1",
|
|
3167
3233
|
children: a.editingMessage
|
|
3168
3234
|
}),
|
|
3169
|
-
/* @__PURE__ */
|
|
3235
|
+
/* @__PURE__ */ I(t, {
|
|
3170
3236
|
label: a.cancelEdit,
|
|
3171
3237
|
variant: "link",
|
|
3172
3238
|
className: "p-0 text-xs",
|
|
@@ -3175,17 +3241,17 @@ function Hn({ task: e, editing: n, onCancelEdit: r, onSendEdit: i }) {
|
|
|
3175
3241
|
}
|
|
3176
3242
|
})
|
|
3177
3243
|
]
|
|
3178
|
-
}), /* @__PURE__ */
|
|
3244
|
+
}), /* @__PURE__ */ I(s, {
|
|
3179
3245
|
value: o,
|
|
3180
3246
|
onChange: c,
|
|
3181
3247
|
placeholder: d?.prompt ?? a.messagePlaceholder,
|
|
3182
3248
|
running: p,
|
|
3183
3249
|
onStop: l.stop,
|
|
3184
|
-
disabled: !o.trim() ||
|
|
3185
|
-
onSubmit:
|
|
3186
|
-
attachments: !d && (l.remote ||
|
|
3187
|
-
models:
|
|
3188
|
-
selectedModel:
|
|
3250
|
+
disabled: !o.trim() || y,
|
|
3251
|
+
onSubmit: g,
|
|
3252
|
+
attachments: !d && (l.remote || v ? l.executorAttachments : !0),
|
|
3253
|
+
models: b,
|
|
3254
|
+
selectedModel: _ ? "" : l.selectedModel,
|
|
3189
3255
|
actions: e.composerActions,
|
|
3190
3256
|
commands: e.composerCommands,
|
|
3191
3257
|
onModelChange: l.setSelectedModel,
|
|
@@ -3195,13 +3261,13 @@ function Hn({ task: e, editing: n, onCancelEdit: r, onSendEdit: i }) {
|
|
|
3195
3261
|
})] });
|
|
3196
3262
|
}
|
|
3197
3263
|
function Un() {
|
|
3198
|
-
let { startOrchestrator: e } = ft(), t = $(), [n, r] =
|
|
3264
|
+
let { startOrchestrator: e } = ft(), t = $(), [n, r] = P(""), { hasProviders: i, modelsByProvider: a, selectedModel: o, setSelectedModel: c } = rn(), l = (t) => {
|
|
3199
3265
|
t.text.trim() && (e(t.text.trim(), {
|
|
3200
3266
|
attachments: t.files.length > 0 ? t.files : void 0,
|
|
3201
3267
|
model: t.model || void 0
|
|
3202
3268
|
}), r(""));
|
|
3203
3269
|
}, u = i && !o;
|
|
3204
|
-
return /* @__PURE__ */
|
|
3270
|
+
return /* @__PURE__ */ I(s, {
|
|
3205
3271
|
value: n,
|
|
3206
3272
|
onChange: r,
|
|
3207
3273
|
placeholder: t.orchestratorStarterPlaceholder,
|
|
@@ -3218,21 +3284,21 @@ function Un() {
|
|
|
3218
3284
|
}
|
|
3219
3285
|
function Wn({ chat: e, onClose: t }) {
|
|
3220
3286
|
let n = $(), r = ee();
|
|
3221
|
-
return /* @__PURE__ */
|
|
3287
|
+
return /* @__PURE__ */ I(_, {
|
|
3222
3288
|
title: n.renameChat,
|
|
3223
3289
|
size: "sm",
|
|
3224
3290
|
onClose: t,
|
|
3225
3291
|
onSave: () => (Ze(e.scopeId, e.subagentId, e.entityId, String(r.record?.title ?? Je(e)), "person"), t(), Promise.resolve(!0)),
|
|
3226
|
-
children: /* @__PURE__ */
|
|
3292
|
+
children: /* @__PURE__ */ L(d, {
|
|
3227
3293
|
appearance: "empty",
|
|
3228
3294
|
controller: r,
|
|
3229
3295
|
defaultValues: { title: Je(e) },
|
|
3230
3296
|
footer: !1,
|
|
3231
|
-
children: [/* @__PURE__ */
|
|
3297
|
+
children: [/* @__PURE__ */ I(h, {
|
|
3232
3298
|
name: "title",
|
|
3233
3299
|
label: n.chatTitleLabel,
|
|
3234
3300
|
placeholder: e.title
|
|
3235
|
-
}), /* @__PURE__ */
|
|
3301
|
+
}), /* @__PURE__ */ I("p", {
|
|
3236
3302
|
className: "text-xs text-muted-foreground",
|
|
3237
3303
|
children: n.chatTitleHint
|
|
3238
3304
|
})]
|
|
@@ -3253,53 +3319,53 @@ function Gn(e, t, n = Date.now()) {
|
|
|
3253
3319
|
}
|
|
3254
3320
|
function Kn({ card: e }) {
|
|
3255
3321
|
let t = $();
|
|
3256
|
-
return e.humanSummaryOnly ? /* @__PURE__ */
|
|
3322
|
+
return e.humanSummaryOnly ? /* @__PURE__ */ L("div", {
|
|
3257
3323
|
className: "space-y-2 rounded-lg border border-border/60 p-3",
|
|
3258
|
-
children: [/* @__PURE__ */
|
|
3324
|
+
children: [/* @__PURE__ */ L("p", {
|
|
3259
3325
|
className: "text-xs font-medium text-foreground",
|
|
3260
3326
|
children: [
|
|
3261
3327
|
"\"",
|
|
3262
3328
|
e.label,
|
|
3263
3329
|
"\""
|
|
3264
3330
|
]
|
|
3265
|
-
}), /* @__PURE__ */
|
|
3331
|
+
}), /* @__PURE__ */ I("p", {
|
|
3266
3332
|
className: "text-xs text-muted-foreground",
|
|
3267
3333
|
children: e.humanSummary
|
|
3268
3334
|
})]
|
|
3269
|
-
}) : /* @__PURE__ */
|
|
3335
|
+
}) : /* @__PURE__ */ L("div", {
|
|
3270
3336
|
className: "space-y-2 rounded-lg border border-border/60 p-3",
|
|
3271
3337
|
children: [
|
|
3272
|
-
/* @__PURE__ */
|
|
3338
|
+
/* @__PURE__ */ I("p", {
|
|
3273
3339
|
className: "text-xs font-medium text-foreground",
|
|
3274
3340
|
children: S(t.newInstance, { label: e.label })
|
|
3275
3341
|
}),
|
|
3276
|
-
/* @__PURE__ */
|
|
3342
|
+
/* @__PURE__ */ I("p", {
|
|
3277
3343
|
className: "text-xs text-muted-foreground",
|
|
3278
3344
|
children: e.humanSummary
|
|
3279
3345
|
}),
|
|
3280
|
-
e.fields.length > 0 && /* @__PURE__ */
|
|
3346
|
+
e.fields.length > 0 && /* @__PURE__ */ I("ul", {
|
|
3281
3347
|
className: "space-y-1",
|
|
3282
|
-
children: e.fields.map((e) => /* @__PURE__ */
|
|
3348
|
+
children: e.fields.map((e) => /* @__PURE__ */ L("li", {
|
|
3283
3349
|
className: "flex items-start gap-1.5 text-xs",
|
|
3284
|
-
children: [/* @__PURE__ */
|
|
3350
|
+
children: [/* @__PURE__ */ I(n, {
|
|
3285
3351
|
variant: e.required ? "primary" : "secondary",
|
|
3286
3352
|
className: "mt-px shrink-0",
|
|
3287
3353
|
children: e.required ? "richiesto" : "opzionale"
|
|
3288
|
-
}), /* @__PURE__ */
|
|
3354
|
+
}), /* @__PURE__ */ L("span", {
|
|
3289
3355
|
className: "min-w-0",
|
|
3290
|
-
children: [/* @__PURE__ */
|
|
3356
|
+
children: [/* @__PURE__ */ I("span", {
|
|
3291
3357
|
className: "font-mono text-foreground",
|
|
3292
3358
|
children: e.key
|
|
3293
|
-
}), e.humanDescription ? /* @__PURE__ */
|
|
3359
|
+
}), e.humanDescription ? /* @__PURE__ */ L("span", {
|
|
3294
3360
|
className: "text-muted-foreground",
|
|
3295
3361
|
children: [" — ", e.humanDescription]
|
|
3296
3362
|
}) : null]
|
|
3297
3363
|
})]
|
|
3298
3364
|
}, e.key))
|
|
3299
3365
|
}),
|
|
3300
|
-
e.example && /* @__PURE__ */
|
|
3366
|
+
e.example && /* @__PURE__ */ L("p", {
|
|
3301
3367
|
className: "text-xs text-muted-foreground",
|
|
3302
|
-
children: ["Esempio: ", /* @__PURE__ */
|
|
3368
|
+
children: ["Esempio: ", /* @__PURE__ */ I("span", {
|
|
3303
3369
|
className: "font-mono",
|
|
3304
3370
|
children: e.example
|
|
3305
3371
|
})]
|
|
@@ -3308,22 +3374,22 @@ function Kn({ card: e }) {
|
|
|
3308
3374
|
});
|
|
3309
3375
|
}
|
|
3310
3376
|
function qn({ messages: e }) {
|
|
3311
|
-
return /* @__PURE__ */
|
|
3377
|
+
return /* @__PURE__ */ I("div", {
|
|
3312
3378
|
className: "space-y-2 rounded-lg border border-border/60 p-3",
|
|
3313
|
-
children: e.map((e, t) => /* @__PURE__ */
|
|
3379
|
+
children: e.map((e, t) => /* @__PURE__ */ I("p", {
|
|
3314
3380
|
className: "text-xs text-muted-foreground",
|
|
3315
3381
|
children: e
|
|
3316
3382
|
}, t))
|
|
3317
3383
|
});
|
|
3318
3384
|
}
|
|
3319
3385
|
function Jn({ scopeId: e, currentTaskId: n, open: r, onOpenChange: i, onSelect: a, onNewChat: o, onArchivedCurrent: s }) {
|
|
3320
|
-
let c = $(), { locale: d } = E(), [p, m] =
|
|
3386
|
+
let c = $(), { locale: d } = E(), [p, m] = P(""), [h, g] = P(0);
|
|
3321
3387
|
j(() => Ve(() => g((e) => e + 1)), []);
|
|
3322
|
-
let _ =
|
|
3388
|
+
let _ = M(() => r ? $e(e) : [], [
|
|
3323
3389
|
e,
|
|
3324
3390
|
r,
|
|
3325
3391
|
h
|
|
3326
|
-
]), [v, y] =
|
|
3392
|
+
]), [v, y] = P(null), b = async (t) => {
|
|
3327
3393
|
let r = W(t.subagentId), i = await r?.confirmArchive?.(t.entityId, t.params);
|
|
3328
3394
|
if (!i || window.confirm(i)) {
|
|
3329
3395
|
try {
|
|
@@ -3333,14 +3399,14 @@ function Jn({ scopeId: e, currentTaskId: n, open: r, onOpenChange: i, onSelect:
|
|
|
3333
3399
|
}
|
|
3334
3400
|
Qe(e, t.subagentId, t.entityId), n === et(t.subagentId, t.entityId) && s(), g((e) => e + 1);
|
|
3335
3401
|
}
|
|
3336
|
-
}, x =
|
|
3402
|
+
}, x = M(() => {
|
|
3337
3403
|
let e = p.trim().toLowerCase();
|
|
3338
3404
|
return e ? _.filter((t) => {
|
|
3339
3405
|
let n = W(t.subagentId)?.label ?? t.subagentId;
|
|
3340
3406
|
return Je(t).toLowerCase().includes(e) || n.toLowerCase().includes(e);
|
|
3341
3407
|
}) : _;
|
|
3342
3408
|
}, [_, p]);
|
|
3343
|
-
return /* @__PURE__ */
|
|
3409
|
+
return /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I(l, {
|
|
3344
3410
|
trigger: {
|
|
3345
3411
|
icon: "history",
|
|
3346
3412
|
title: c.chatHistory
|
|
@@ -3351,22 +3417,22 @@ function Jn({ scopeId: e, currentTaskId: n, open: r, onOpenChange: i, onSelect:
|
|
|
3351
3417
|
position: "end",
|
|
3352
3418
|
strategy: "absolute",
|
|
3353
3419
|
menuClassName: "w-[380px] max-h-[70vh] overflow-y-auto",
|
|
3354
|
-
header: /* @__PURE__ */
|
|
3420
|
+
header: /* @__PURE__ */ L("div", {
|
|
3355
3421
|
className: "flex items-center gap-2 px-1 pb-1.5",
|
|
3356
3422
|
children: [
|
|
3357
|
-
/* @__PURE__ */
|
|
3423
|
+
/* @__PURE__ */ I(f, {
|
|
3358
3424
|
name: "search",
|
|
3359
3425
|
size: 14,
|
|
3360
3426
|
className: "shrink-0 text-muted-foreground"
|
|
3361
3427
|
}),
|
|
3362
|
-
/* @__PURE__ */
|
|
3428
|
+
/* @__PURE__ */ I("input", {
|
|
3363
3429
|
autoFocus: !0,
|
|
3364
3430
|
value: p,
|
|
3365
3431
|
onChange: (e) => m(e.target.value),
|
|
3366
3432
|
placeholder: c.searchChats,
|
|
3367
3433
|
className: "min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground"
|
|
3368
3434
|
}),
|
|
3369
|
-
/* @__PURE__ */
|
|
3435
|
+
/* @__PURE__ */ I(t, {
|
|
3370
3436
|
icon: "square-pen",
|
|
3371
3437
|
ariaLabel: c.newChat,
|
|
3372
3438
|
title: c.newChat,
|
|
@@ -3376,12 +3442,12 @@ function Jn({ scopeId: e, currentTaskId: n, open: r, onOpenChange: i, onSelect:
|
|
|
3376
3442
|
})
|
|
3377
3443
|
]
|
|
3378
3444
|
}),
|
|
3379
|
-
children: x.length === 0 ? /* @__PURE__ */
|
|
3445
|
+
children: x.length === 0 ? /* @__PURE__ */ I("p", {
|
|
3380
3446
|
className: "px-2 py-3 text-center text-xs text-muted-foreground",
|
|
3381
3447
|
children: _.length === 0 ? c.noSavedChats : c.noResults
|
|
3382
3448
|
}) : x.map((e) => {
|
|
3383
3449
|
let t = W(e.subagentId), r = n === et(e.subagentId, e.entityId);
|
|
3384
|
-
return /* @__PURE__ */
|
|
3450
|
+
return /* @__PURE__ */ I(u, {
|
|
3385
3451
|
icon: r ? "check" : t?.icon ?? "bot",
|
|
3386
3452
|
className: r ? "bg-accent font-semibold text-primary" : void 0,
|
|
3387
3453
|
actions: [{
|
|
@@ -3396,13 +3462,13 @@ function Jn({ scopeId: e, currentTaskId: n, open: r, onOpenChange: i, onSelect:
|
|
|
3396
3462
|
onClick: () => void b(e)
|
|
3397
3463
|
}],
|
|
3398
3464
|
onClick: () => a(e.subagentId, e.entityId, e),
|
|
3399
|
-
children: /* @__PURE__ */
|
|
3465
|
+
children: /* @__PURE__ */ L("span", {
|
|
3400
3466
|
className: "flex min-w-0 flex-1 items-center justify-between gap-2",
|
|
3401
|
-
children: [/* @__PURE__ */
|
|
3467
|
+
children: [/* @__PURE__ */ I("span", {
|
|
3402
3468
|
className: "min-w-0 truncate",
|
|
3403
3469
|
title: `${t?.label ?? e.subagentId} · ${Je(e)}`,
|
|
3404
3470
|
children: Je(e)
|
|
3405
|
-
}), /* @__PURE__ */
|
|
3471
|
+
}), /* @__PURE__ */ I("span", {
|
|
3406
3472
|
className: "shrink-0 text-xs text-muted-foreground",
|
|
3407
3473
|
title: `${c.chatStarted.replace("{at}", new Date(Q(e)).toLocaleString(d))} · ${c.chatLastMessage.replace("{at}", new Date(e.savedAt).toLocaleString(d))}`,
|
|
3408
3474
|
children: Gn(Q(e), d)
|
|
@@ -3410,40 +3476,40 @@ function Jn({ scopeId: e, currentTaskId: n, open: r, onOpenChange: i, onSelect:
|
|
|
3410
3476
|
})
|
|
3411
3477
|
}, `${e.subagentId}:${e.entityId}`);
|
|
3412
3478
|
})
|
|
3413
|
-
}), v && /* @__PURE__ */
|
|
3479
|
+
}), v && /* @__PURE__ */ I(Wn, {
|
|
3414
3480
|
chat: v,
|
|
3415
3481
|
onClose: () => y(null)
|
|
3416
3482
|
})] });
|
|
3417
3483
|
}
|
|
3418
3484
|
function Yn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}) {
|
|
3419
|
-
let { task: a, isOpen: o, pendingGoal: s, orchestratorRunId: c, pageContext: l, pageContextCard: u, anchoredUserMessages: d, pendingResume: f, resumeRunId: p, dismissForeignTask: m, resumeEntityChat: h, pendingManualEntry: g, manualEntryRunId: _, startManualEntry: y, pendingExtraDestinations: b, pendingResumeWithAI: x, resumeWithAIRunId: S, pendingStart: C, startRunId: w, scope: T, threadEvents: ee } = ft(), E = $(), D =
|
|
3485
|
+
let { task: a, isOpen: o, pendingGoal: s, orchestratorRunId: c, pageContext: l, pageContextCard: u, anchoredUserMessages: d, pendingResume: f, resumeRunId: p, dismissForeignTask: m, resumeEntityChat: h, pendingManualEntry: g, manualEntryRunId: _, startManualEntry: y, pendingExtraDestinations: b, pendingResumeWithAI: x, resumeWithAIRunId: S, pendingStart: C, startRunId: w, scope: T, threadEvents: ee } = ft(), E = $(), D = N(null), [O, te] = P(!1), [k, A] = P(null), [ne, re] = P(null);
|
|
3420
3486
|
j(() => {
|
|
3421
|
-
A(null),
|
|
3487
|
+
A(null), re(null);
|
|
3422
3488
|
}, [a?.id]), Mn(T?.id);
|
|
3423
|
-
let
|
|
3489
|
+
let R = Zt({
|
|
3424
3490
|
defaultWidth: e,
|
|
3425
3491
|
minWidth: n,
|
|
3426
3492
|
maxWidth: r,
|
|
3427
3493
|
onWidthChange: i
|
|
3428
|
-
}),
|
|
3494
|
+
}), ie = () => {
|
|
3429
3495
|
(!a || a.agent.running || a.savedToDisk || window.confirm(E.unsavedConversationConfirm)) && (m(), te(!1));
|
|
3430
|
-
},
|
|
3431
|
-
|
|
3496
|
+
}, z = a ? [...a.precedingActivity ?? [], ...a.agent.activity] : [], B = z.length, V = Math.max(0, Math.min(a?.panelExtraAnchorIndex ?? B, B)), H = z.slice(0, V), U = z.slice(V), ae = !!(a && !a.agent.running && a.agent.error), [G, K] = mt(), q = N({ at: Date.now() });
|
|
3497
|
+
q.current.id !== a?.id && (q.current = {
|
|
3432
3498
|
id: a?.id,
|
|
3433
3499
|
at: Date.now()
|
|
3434
3500
|
});
|
|
3435
|
-
let
|
|
3436
|
-
if (!T || !a?.thread) return
|
|
3501
|
+
let oe = M(() => {
|
|
3502
|
+
if (!T || !a?.thread) return q.current.at;
|
|
3437
3503
|
let e = nt(T.id, a.thread, a.id)[0];
|
|
3438
3504
|
if (e) return e.savedAt;
|
|
3439
3505
|
let t = $e(T.id).find((e) => et(e.subagentId, e.entityId) === a.id);
|
|
3440
|
-
return t ? Q(t) :
|
|
3506
|
+
return t ? Q(t) : z.find((e) => e.at !== void 0)?.at ?? q.current.at;
|
|
3441
3507
|
}, [
|
|
3442
3508
|
T?.id,
|
|
3443
3509
|
a?.thread,
|
|
3444
3510
|
a?.id,
|
|
3445
|
-
|
|
3446
|
-
]),
|
|
3511
|
+
B === 0
|
|
3512
|
+
]), se = ht(a?.thread, oe, Infinity, G), ce = U.find((e) => e.at !== void 0)?.at, le = U.length === 0 || ce === void 0 ? se : se.filter((e) => e.at < ce), ue = U.length === 0 || ce === void 0 ? [] : se.filter((e) => e.at >= ce), de = (e, t) => {
|
|
3447
3513
|
a && (A(null), a.agent.rewind(e.id, t).then((e) => {
|
|
3448
3514
|
e && a.onApplied(e);
|
|
3449
3515
|
}));
|
|
@@ -3452,11 +3518,11 @@ function Yn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
|
|
|
3452
3518
|
return [...new Set(n.filter(Boolean))];
|
|
3453
3519
|
}, J = (e, t) => {
|
|
3454
3520
|
let n = fe(e);
|
|
3455
|
-
n.length ?
|
|
3521
|
+
n.length ? re({
|
|
3456
3522
|
entry: e,
|
|
3457
3523
|
steps: n,
|
|
3458
3524
|
...t === void 0 ? {} : { text: t }
|
|
3459
|
-
}) :
|
|
3525
|
+
}) : de(e, t);
|
|
3460
3526
|
}, pe = a ? {
|
|
3461
3527
|
available: (e) => a.agent.activity.some((t) => t.id === e.id) && a.agent.rewindable(e.id),
|
|
3462
3528
|
disabled: a.agent.running,
|
|
@@ -3468,7 +3534,7 @@ function Yn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
|
|
|
3468
3534
|
e && a.onApplied(e);
|
|
3469
3535
|
}),
|
|
3470
3536
|
onCardAction: (e, t, n) => a.agent.cardAction(e, t, n)
|
|
3471
|
-
} : void 0, Y = he ? Ft(
|
|
3537
|
+
} : void 0, Y = he ? Ft(z, he.canAnswer) : null, ge = a?.id === "agentico-orchestrator" && a.scopedSubagentId ? W(a.scopedSubagentId) : void 0, _e = ge?.manualEntry ? ge : null, X = N(!0);
|
|
3472
3538
|
j(() => {
|
|
3473
3539
|
let e = D.current;
|
|
3474
3540
|
if (!e) return;
|
|
@@ -3480,16 +3546,16 @@ function Yn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
|
|
|
3480
3546
|
let e = D.current;
|
|
3481
3547
|
e && (X.current = !0, e.scrollTop = e.scrollHeight);
|
|
3482
3548
|
}, [a?.id]);
|
|
3483
|
-
let ve =
|
|
3549
|
+
let ve = z.at(-1)?.detail?.length ?? 0;
|
|
3484
3550
|
j(() => {
|
|
3485
3551
|
let e = D.current;
|
|
3486
3552
|
e && X.current && (e.scrollTop = e.scrollHeight);
|
|
3487
3553
|
}, [
|
|
3488
|
-
|
|
3554
|
+
B,
|
|
3489
3555
|
ae,
|
|
3490
3556
|
ve
|
|
3491
3557
|
]);
|
|
3492
|
-
let ye =
|
|
3558
|
+
let ye = N(null);
|
|
3493
3559
|
j(() => {
|
|
3494
3560
|
let e = D.current, t = ye.current;
|
|
3495
3561
|
if (!e || !t || typeof ResizeObserver > "u") return;
|
|
@@ -3498,7 +3564,7 @@ function Yn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
|
|
|
3498
3564
|
});
|
|
3499
3565
|
return n.observe(t), () => n.disconnect();
|
|
3500
3566
|
}, [a?.id, o]);
|
|
3501
|
-
let be = s ? /* @__PURE__ */
|
|
3567
|
+
let be = s ? /* @__PURE__ */ I(In, { userGoal: s }, c) : null, xe = f ? W(f.subagentId) : void 0, Se = f && xe ? /* @__PURE__ */ I(Fn, {
|
|
3502
3568
|
manifest: xe,
|
|
3503
3569
|
params: f.snapshot.params,
|
|
3504
3570
|
taskId: et(f.subagentId, f.entityId),
|
|
@@ -3506,45 +3572,45 @@ function Yn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
|
|
|
3506
3572
|
history: f.snapshot.history,
|
|
3507
3573
|
activity: f.snapshot.activity
|
|
3508
3574
|
}
|
|
3509
|
-
}, p) : null, Ce = g ? W(g.subagentId) : void 0, we = g && Ce ? /* @__PURE__ */
|
|
3575
|
+
}, p) : null, Ce = g ? W(g.subagentId) : void 0, we = g && Ce ? /* @__PURE__ */ I(Ln, {
|
|
3510
3576
|
manifest: Ce,
|
|
3511
3577
|
extraDestinations: g.extraDestinations
|
|
3512
|
-
}, _) : null, Te = x ? W(x.subagentId) : void 0, Ee = x && Te ? /* @__PURE__ */
|
|
3578
|
+
}, _) : null, Te = x ? W(x.subagentId) : void 0, Ee = x && Te ? /* @__PURE__ */ I(Fn, {
|
|
3513
3579
|
manifest: Te,
|
|
3514
3580
|
params: x.params,
|
|
3515
3581
|
extraDestinations: x.extraDestinations
|
|
3516
|
-
}, S) : null, De = C ? W(C.subagentId) : void 0, Oe = C && De ? /* @__PURE__ */
|
|
3582
|
+
}, S) : null, De = C ? W(C.subagentId) : void 0, Oe = C && De ? /* @__PURE__ */ I(Fn, {
|
|
3517
3583
|
manifest: De,
|
|
3518
3584
|
params: C.params,
|
|
3519
3585
|
taskId: C.taskId,
|
|
3520
3586
|
openingMessage: C.openingMessage
|
|
3521
3587
|
}, w) : null;
|
|
3522
|
-
return o ? /* @__PURE__ */
|
|
3588
|
+
return o ? /* @__PURE__ */ L(F, { children: [
|
|
3523
3589
|
be,
|
|
3524
3590
|
Se,
|
|
3525
3591
|
we,
|
|
3526
3592
|
Ee,
|
|
3527
3593
|
Oe,
|
|
3528
|
-
/* @__PURE__ */
|
|
3529
|
-
style: { width:
|
|
3594
|
+
/* @__PURE__ */ L("div", {
|
|
3595
|
+
style: { width: R.width },
|
|
3530
3596
|
className: "relative flex h-full shrink-0 flex-col border-l border-border bg-background",
|
|
3531
3597
|
children: [
|
|
3532
|
-
/* @__PURE__ */
|
|
3533
|
-
width:
|
|
3534
|
-
min:
|
|
3535
|
-
max:
|
|
3536
|
-
onResize:
|
|
3537
|
-
onCommit:
|
|
3538
|
-
onReset:
|
|
3598
|
+
/* @__PURE__ */ I(Qt, {
|
|
3599
|
+
width: R.width,
|
|
3600
|
+
min: R.min,
|
|
3601
|
+
max: R.max,
|
|
3602
|
+
onResize: R.set,
|
|
3603
|
+
onCommit: R.commit,
|
|
3604
|
+
onReset: R.reset
|
|
3539
3605
|
}),
|
|
3540
|
-
/* @__PURE__ */
|
|
3606
|
+
/* @__PURE__ */ L("div", {
|
|
3541
3607
|
className: "flex min-h-[60px] items-center gap-1 border-b border-border/60 px-4 py-3",
|
|
3542
3608
|
children: [
|
|
3543
|
-
/* @__PURE__ */
|
|
3609
|
+
/* @__PURE__ */ I("span", {
|
|
3544
3610
|
className: "min-w-0 flex-1 truncate text-lg font-semibold leading-tight",
|
|
3545
3611
|
children: a ? a.title : "Agentico"
|
|
3546
3612
|
}),
|
|
3547
|
-
a?.thread && ee && /* @__PURE__ */
|
|
3613
|
+
a?.thread && ee && /* @__PURE__ */ I(t, {
|
|
3548
3614
|
icon: G ? "activity" : "message-square",
|
|
3549
3615
|
ariaLabel: G ? E.hideEvents : E.showEvents,
|
|
3550
3616
|
title: G ? E.hideEvents : E.showEvents,
|
|
@@ -3552,26 +3618,26 @@ function Yn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
|
|
|
3552
3618
|
className: `p-1 ${G ? "text-primary" : "text-muted-foreground"}`,
|
|
3553
3619
|
onClick: () => K(!G)
|
|
3554
3620
|
}),
|
|
3555
|
-
T && /* @__PURE__ */
|
|
3621
|
+
T && /* @__PURE__ */ I(Jn, {
|
|
3556
3622
|
scopeId: T.id,
|
|
3557
3623
|
currentTaskId: a?.id ?? null,
|
|
3558
3624
|
open: O,
|
|
3559
3625
|
onOpenChange: te,
|
|
3560
|
-
onNewChat:
|
|
3626
|
+
onNewChat: ie,
|
|
3561
3627
|
onSelect: (e, t, n) => h(e, t, n),
|
|
3562
3628
|
onArchivedCurrent: m
|
|
3563
3629
|
}),
|
|
3564
|
-
/* @__PURE__ */
|
|
3630
|
+
/* @__PURE__ */ I($t, {})
|
|
3565
3631
|
]
|
|
3566
3632
|
}),
|
|
3567
|
-
/* @__PURE__ */
|
|
3633
|
+
/* @__PURE__ */ I("div", {
|
|
3568
3634
|
ref: D,
|
|
3569
3635
|
className: `flex-1 overflow-y-auto px-3 pb-2 ${Y ? "min-h-24" : "min-h-0"}`,
|
|
3570
|
-
children: /* @__PURE__ */
|
|
3636
|
+
children: /* @__PURE__ */ I("div", {
|
|
3571
3637
|
ref: ye,
|
|
3572
3638
|
className: "pt-2",
|
|
3573
|
-
children: a ? /* @__PURE__ */
|
|
3574
|
-
T && a.thread && /* @__PURE__ */
|
|
3639
|
+
children: a ? /* @__PURE__ */ L(F, { children: [
|
|
3640
|
+
T && a.thread && /* @__PURE__ */ I(Bn, {
|
|
3575
3641
|
scopeId: T.id,
|
|
3576
3642
|
thread: a.thread,
|
|
3577
3643
|
taskId: a.id,
|
|
@@ -3583,40 +3649,40 @@ function Yn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
|
|
|
3583
3649
|
},
|
|
3584
3650
|
onContinue: (e) => h(e.subagentId, e.entityId, e)
|
|
3585
3651
|
}),
|
|
3586
|
-
a.manualEntry &&
|
|
3652
|
+
a.manualEntry && z.length === 0 && /* @__PURE__ */ I("p", {
|
|
3587
3653
|
className: "text-xs text-muted-foreground",
|
|
3588
3654
|
children: a.manualEntry.prompt
|
|
3589
3655
|
}),
|
|
3590
|
-
/* @__PURE__ */
|
|
3656
|
+
/* @__PURE__ */ I(Vt, {
|
|
3591
3657
|
activity: H,
|
|
3592
3658
|
questions: he,
|
|
3593
3659
|
docked: Y,
|
|
3594
3660
|
pinUserMessages: !Y,
|
|
3595
3661
|
messageActions: pe,
|
|
3596
3662
|
speaker: a.speaker,
|
|
3597
|
-
events:
|
|
3663
|
+
events: le
|
|
3598
3664
|
}),
|
|
3599
|
-
a.panelExtra && /* @__PURE__ */
|
|
3665
|
+
a.panelExtra && /* @__PURE__ */ I("div", {
|
|
3600
3666
|
className: "mt-3",
|
|
3601
3667
|
children: a.panelExtra
|
|
3602
3668
|
}),
|
|
3603
|
-
U.length > 0 && /* @__PURE__ */
|
|
3669
|
+
U.length > 0 && /* @__PURE__ */ I(Vt, {
|
|
3604
3670
|
activity: U,
|
|
3605
3671
|
questions: he,
|
|
3606
3672
|
docked: Y,
|
|
3607
3673
|
pinUserMessages: !Y,
|
|
3608
3674
|
messageActions: pe,
|
|
3609
3675
|
speaker: a.speaker,
|
|
3610
|
-
events:
|
|
3676
|
+
events: ue
|
|
3611
3677
|
}),
|
|
3612
|
-
!a.agent.running && a.agent.error && /* @__PURE__ */
|
|
3678
|
+
!a.agent.running && a.agent.error && /* @__PURE__ */ L("div", {
|
|
3613
3679
|
className: "mt-2 flex items-center gap-2",
|
|
3614
3680
|
children: [
|
|
3615
|
-
/* @__PURE__ */
|
|
3681
|
+
/* @__PURE__ */ I("p", {
|
|
3616
3682
|
className: "flex-1 text-xs text-destructive",
|
|
3617
3683
|
children: a.agent.error
|
|
3618
3684
|
}),
|
|
3619
|
-
/* @__PURE__ */
|
|
3685
|
+
/* @__PURE__ */ I(t, {
|
|
3620
3686
|
label: E.retry,
|
|
3621
3687
|
variant: "secondary",
|
|
3622
3688
|
className: "shrink-0",
|
|
@@ -3631,7 +3697,7 @@ function Yn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
|
|
|
3631
3697
|
});
|
|
3632
3698
|
}
|
|
3633
3699
|
}),
|
|
3634
|
-
!a.agent.remote && a.agent.offersFallback !== !1 && /* @__PURE__ */
|
|
3700
|
+
!a.agent.remote && a.agent.offersFallback !== !1 && /* @__PURE__ */ I(t, {
|
|
3635
3701
|
label: E.continueWithoutAi,
|
|
3636
3702
|
variant: "secondary",
|
|
3637
3703
|
className: "shrink-0",
|
|
@@ -3646,32 +3712,32 @@ function Yn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
|
|
|
3646
3712
|
})
|
|
3647
3713
|
]
|
|
3648
3714
|
})
|
|
3649
|
-
] }) : d.length > 0 ? /* @__PURE__ */
|
|
3715
|
+
] }) : d.length > 0 ? /* @__PURE__ */ I(qn, { messages: d }) : u ? /* @__PURE__ */ I(Kn, { card: u }) : /* @__PURE__ */ I("p", {
|
|
3650
3716
|
className: "text-xs text-muted-foreground",
|
|
3651
3717
|
children: l ?? E.orchestratorStarterHint
|
|
3652
3718
|
})
|
|
3653
3719
|
})
|
|
3654
3720
|
}),
|
|
3655
|
-
a && Y ? /* @__PURE__ */
|
|
3721
|
+
a && Y ? /* @__PURE__ */ L("section", {
|
|
3656
3722
|
"aria-label": E.pendingQuestions,
|
|
3657
3723
|
className: "flex min-h-0 shrink flex-col border-t border-border/60",
|
|
3658
3724
|
children: [
|
|
3659
|
-
a.panelActions && /* @__PURE__ */
|
|
3725
|
+
a.panelActions && /* @__PURE__ */ I("div", {
|
|
3660
3726
|
className: "shrink-0 px-4 pt-3",
|
|
3661
3727
|
children: a.panelActions
|
|
3662
3728
|
}),
|
|
3663
|
-
/* @__PURE__ */
|
|
3729
|
+
/* @__PURE__ */ I("div", {
|
|
3664
3730
|
className: "min-h-0 overflow-y-auto px-4 py-3",
|
|
3665
|
-
children: /* @__PURE__ */
|
|
3731
|
+
children: /* @__PURE__ */ I(It, {
|
|
3666
3732
|
entry: Y.entry,
|
|
3667
3733
|
part: Y.part,
|
|
3668
3734
|
questions: he,
|
|
3669
3735
|
autoFocus: !0
|
|
3670
3736
|
}, `${Y.entry.id}:${Y.part.id}`)
|
|
3671
3737
|
}),
|
|
3672
|
-
a.agent.running && /* @__PURE__ */
|
|
3738
|
+
a.agent.running && /* @__PURE__ */ I("div", {
|
|
3673
3739
|
className: "flex shrink-0 justify-end px-4 pb-3",
|
|
3674
|
-
children: /* @__PURE__ */
|
|
3740
|
+
children: /* @__PURE__ */ I(t, {
|
|
3675
3741
|
icon: "square",
|
|
3676
3742
|
label: E.stop,
|
|
3677
3743
|
variant: "secondary",
|
|
@@ -3679,33 +3745,33 @@ function Yn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
|
|
|
3679
3745
|
})
|
|
3680
3746
|
})
|
|
3681
3747
|
]
|
|
3682
|
-
}) : /* @__PURE__ */
|
|
3748
|
+
}) : /* @__PURE__ */ L("div", {
|
|
3683
3749
|
className: "border-t border-border/60 px-4 py-3",
|
|
3684
|
-
children: [a?.panelActions && /* @__PURE__ */
|
|
3750
|
+
children: [a?.panelActions && /* @__PURE__ */ I("div", {
|
|
3685
3751
|
className: "mb-2",
|
|
3686
3752
|
children: a.panelActions
|
|
3687
|
-
}), a ? /* @__PURE__ */
|
|
3753
|
+
}), a ? /* @__PURE__ */ I(Hn, {
|
|
3688
3754
|
task: a,
|
|
3689
3755
|
editing: k,
|
|
3690
3756
|
onCancelEdit: () => A(null),
|
|
3691
3757
|
onSendEdit: (e, t) => J(e, t)
|
|
3692
|
-
}, a.id) : /* @__PURE__ */
|
|
3758
|
+
}, a.id) : /* @__PURE__ */ I(Un, {})]
|
|
3693
3759
|
}),
|
|
3694
|
-
|
|
3760
|
+
ne && /* @__PURE__ */ L(v, {
|
|
3695
3761
|
title: E.rewindTitle,
|
|
3696
|
-
onClose: () =>
|
|
3697
|
-
onYes: async () => (
|
|
3698
|
-
children: [/* @__PURE__ */
|
|
3762
|
+
onClose: () => re(null),
|
|
3763
|
+
onYes: async () => (de(ne.entry, ne.text), !0),
|
|
3764
|
+
children: [/* @__PURE__ */ I("p", {
|
|
3699
3765
|
className: "text-sm",
|
|
3700
3766
|
children: E.rewindText
|
|
3701
|
-
}), /* @__PURE__ */
|
|
3767
|
+
}), /* @__PURE__ */ I("ul", {
|
|
3702
3768
|
className: "mt-2 list-disc space-y-0.5 ps-5 text-sm text-muted-foreground",
|
|
3703
|
-
children:
|
|
3769
|
+
children: ne.steps.slice(0, 8).map((e) => /* @__PURE__ */ I("li", { children: e }, e))
|
|
3704
3770
|
})]
|
|
3705
3771
|
})
|
|
3706
3772
|
]
|
|
3707
3773
|
})
|
|
3708
|
-
] }) : /* @__PURE__ */
|
|
3774
|
+
] }) : /* @__PURE__ */ L(F, { children: [
|
|
3709
3775
|
be,
|
|
3710
3776
|
Se,
|
|
3711
3777
|
we,
|
|
@@ -3716,13 +3782,13 @@ function Yn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
|
|
|
3716
3782
|
//#endregion
|
|
3717
3783
|
//#region src/presentation/useAgenticoPageContext.ts
|
|
3718
3784
|
function Xn(e, t) {
|
|
3719
|
-
let { setPageContext: n } = ft(), r =
|
|
3785
|
+
let { setPageContext: n } = ft(), r = N(crypto.randomUUID()).current;
|
|
3720
3786
|
j(() => (n(r, e, t ?? null), () => n(r, null)), [e, t]);
|
|
3721
3787
|
}
|
|
3722
3788
|
//#endregion
|
|
3723
3789
|
//#region src/presentation/useSubagentComponentContext.ts
|
|
3724
3790
|
function Zn(e, t, n, r, i = !0, a) {
|
|
3725
|
-
let { registerComponentAnchor: o } = ft(), s =
|
|
3791
|
+
let { registerComponentAnchor: o } = ft(), s = N(crypto.randomUUID()).current, c = N(n);
|
|
3726
3792
|
c.current = n, j(() => {
|
|
3727
3793
|
if (i) return o(s, {
|
|
3728
3794
|
subagentId: e,
|
|
@@ -3740,6 +3806,6 @@ function Zn(e, t, n, r, i = !0, a) {
|
|
|
3740
3806
|
]);
|
|
3741
3807
|
}
|
|
3742
3808
|
//#endregion
|
|
3743
|
-
export { Wt as AGENTICO_MAX_WIDTH, Ut as AGENTICO_MIN_WIDTH, Ht as AGENTICO_WIDTH, Gt as AGENTICO_WIDTH_STORAGE_KEY, Yn as Agentico, dt as AgenticoProvider, $t as AgenticoToggle,
|
|
3809
|
+
export { Wt as AGENTICO_MAX_WIDTH, Ut as AGENTICO_MIN_WIDTH, Ht as AGENTICO_WIDTH, Gt as AGENTICO_WIDTH_STORAGE_KEY, Yn as Agentico, dt as AgenticoProvider, $t as AgenticoToggle, R as DEFAULT_REASONING_PART_ID, re as DEFAULT_TEXT_PART_ID, Ce as JSON_EXPORT_DESTINATION_ID, ve as MICRO_PROMPT_REGISTRY, lt as ORCHESTRATOR_TASK_ID, at as PREVIEW_LIMIT, it as PREVIEW_MAX, X as SUMMARY_MICRO_PROMPT, Ae as agenticoDe, Oe as agenticoEn, ke as agenticoIt, le as agenticoPromptsEn, ue as agenticoPromptsIt, ct as agenticoTranslations, ye as applyMicroPrompts, Ye as chatHasPersonMessage, Q as chatStartedAt, tt as chatThreadOf, Je as chatTitle, fe as configureAgenticoPrompts, Ne as configureEntityChatStore, q as createCrossAgentTools, V as defineSubagent, nt as earlierSessions, et as entityChatTaskId, be as extractErrorMessage, xe as extractJsonBlock, W as findSubagentManifest, B as formatQuestionAnswers, J as getAgenticoPrompts, De as getDestinationRegistry, Ue as getEntityChat, Dn as getSubagentControls, ae as getSubagentRegistry, Sn as getSubagentReport, Pe as hasEntityChatBackend, st as imagePreviews, we as jsonExportDestination, $e as listEntityChats, z as messagePartsText, Ve as onEntityChatsChange, rt as placeEvents, K as registerCrossAgentTools, Ee as registerDestinations, En as registerSubagentControls, xn as registerSubagentReports, U as registerSubagents, Qe as removeEntityChat, Ze as renameEntityChat, _e as renderRegistryCli, ge as renderSubagentCli, pe as resetAgenticoPrompts, We as saveEntityChat, Le as syncEntityChats, oe as toJsonSchema, se as toMcpTool, ie as upsertMessagePart, fn as useAgent, ft as useAgentico, $ as useAgenticoI18n, Xn as useAgenticoPageContext, Zn as useSubagentComponentContext };
|
|
3744
3810
|
|
|
3745
3811
|
//# sourceMappingURL=index.mjs.map
|