@qredence/fleet 0.5.1 → 0.5.5
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/CHANGELOG.md +7 -0
- package/bin/fleet-prime.mjs +6 -0
- package/dist/web/client/assets/action-swap-roll-DX5o_33Q.js +1 -0
- package/dist/web/client/assets/artifacts-panel-C3yewUBP.js +1 -0
- package/dist/web/client/assets/{chat-CsepBQwy.js → chat-W-yOMyG_.js} +1 -1
- package/dist/web/client/assets/chat-command-palette-D0xDK1j4.js +1 -0
- package/dist/web/client/assets/command-CQzrtjyj.js +2 -0
- package/dist/web/client/assets/{fleet-pi-tool-renderer-BD_ZAjlG.js → fleet-pi-tool-renderer-B0Y7ou0U.js} +16 -16
- package/dist/web/client/assets/generative-text-renderer-SS9c1kNX.js +6 -0
- package/dist/web/client/assets/globals-D_Hy9bT1.css +2 -0
- package/dist/web/client/assets/{index-DweoFRMs.js → index-C9FloFgj.js} +2 -2
- package/dist/web/client/assets/{ipython-tool-BfeIa0nK.js → ipython-tool-BrMePqD-.js} +1 -1
- package/dist/web/client/assets/{openui-renderer-DlUo6ehT.js → openui-renderer-CCfQqUfE.js} +5 -5
- package/dist/web/client/assets/{prime-agent-artifacts-CHGb5V_j.js → prime-agent-artifacts-C-g1VPiW.js} +1 -1
- package/dist/web/client/assets/range-65lubOFp.js +2 -0
- package/dist/web/client/assets/repl-panel-CCh4ly7J.js +1 -0
- package/dist/web/client/assets/routes-DSTyx_J0.js +16 -0
- package/dist/web/client/assets/session-insights-panel-CQdT90Op.js +1 -0
- package/dist/web/client/assets/subagent-chat-panel-D-qw4uWb.js +1 -0
- package/dist/web/client/assets/subagent-transcript-C7oRwEEP.js +1 -0
- package/dist/web/client/assets/subagents-panel-aSMWZP9p.js +1 -0
- package/dist/web/client/assets/{tool-result-CBzwwUE9.js → tool-result-C2NvnN32.js} +3 -3
- package/dist/web/server/{_tanstack-start-manifest_v-bDUlyKY0-KFW35JRO.js → _tanstack-start-manifest_v-DZc7dwm7-6ZQLGXB7.js} +13 -13
- package/dist/web/server/{artifacts-panel-D9w1DHAN-FGRDCYU2.js → artifacts-panel-Bt7YUzm4-NCBMXJ25.js} +15 -15
- package/dist/web/server/{chat-command-palette-BaenPkCN-BHSOPGU4.js → chat-command-palette-Co1L3rUY-RQLNME4T.js} +33 -12
- package/dist/web/server/{chunk-KPNGZR2R.js → chunk-2V6B62OF.js} +204 -204
- package/dist/web/server/{chunk-44IVTHDV.js → chunk-3HUI75QM.js} +60 -60
- package/dist/web/server/{chunk-5AVQZ4AZ.js → chunk-4UBOIY2S.js} +2 -1
- package/dist/web/server/{chunk-Y6LJ4WBI.js → chunk-56HSKUBD.js} +699 -691
- package/dist/web/server/{chunk-RPROZ2JC.js → chunk-5RQ6QAZX.js} +133 -133
- package/dist/web/server/{chunk-PWK2HJIV.js → chunk-6D524OCJ.js} +175 -175
- package/dist/web/server/{chunk-FBOO3G67.js → chunk-AECEK3K7.js} +6 -6
- package/dist/web/server/{chunk-VHCAD46L.js → chunk-AWFOBHH4.js} +4 -4
- package/dist/web/server/{chunk-FVWDJNXR.js → chunk-BEMDNODD.js} +1 -1
- package/dist/web/server/{chunk-X2TUFLTP.js → chunk-BLVCDQ7E.js} +438 -438
- package/dist/web/server/{chunk-EIVNRYP3.js → chunk-FZRBAPUM.js} +2 -2
- package/dist/web/server/chunk-KOIPYBJF.js +3773 -0
- package/dist/web/server/{chunk-XYYNYFFD.js → chunk-LSIHVSUT.js} +2 -2
- package/dist/web/server/{chunk-H64JLONZ.js → chunk-PDRD2X5G.js} +2 -2
- package/dist/web/server/{chunk-FE4KN6T2.js → chunk-RX62LUDV.js} +4 -4
- package/dist/web/server/chunk-SR65ARVS.js +192 -0
- package/dist/web/server/{chunk-WK7CQS2N.js → chunk-SZ65K4CO.js} +48 -48
- package/dist/web/server/{chunk-DO3TVNGA.js → chunk-TO3YPLNZ.js} +6 -6
- package/dist/web/server/{chunk-3IKSPTYI.js → chunk-UKINNXJY.js} +2 -2
- package/dist/web/server/{chunk-M2FGGPNA.js → chunk-VGDP4YDU.js} +70 -45
- package/dist/web/server/{chunk-PCJ5EKFE.js → chunk-VRLTWOVJ.js} +11 -6
- package/dist/web/server/{chunk-HBZ6YKRB.js → chunk-WN77JNYY.js} +2 -2
- package/dist/web/server/{chunk-2U7PWSJX.js → chunk-WZNZQNI4.js} +231 -3633
- package/dist/web/server/{chunk-B2F6MLVZ.js → chunk-XFVL5ITL.js} +2246 -2228
- package/dist/web/server/{chunk-3GSFXWL5.js → chunk-XLCTCC4W.js} +3 -3
- package/dist/web/server/{chunk-AZZHUVJR.js → chunk-Y4MHIA7B.js} +18 -26
- package/dist/web/server/{fleet-pi-tool-renderer-lJvZWmBJ-4M5YI6VS.js → fleet-pi-tool-renderer-CE45vM6T-2UQN6RJM.js} +11 -9
- package/dist/web/server/{fork-picker-dialog-BZzfxdQd-Y725VJ7G.js → fork-picker-dialog-DCzuGelH-TN2Q5OXI.js} +5 -5
- package/dist/web/server/{openui-renderer-Cg4RSE9k-7BTJIYZJ.js → openui-renderer-c36_GYes-HX46N4M5.js} +11 -11
- package/dist/web/server/{repl-panel-BEQrC2ef-V3YEZ7EO.js → repl-panel-D9E8nkQy-L45ZNG2V.js} +4 -3
- package/dist/web/server/{router-CEahIUpn-SRG7XKIH.js → router-_ZpegqiQ-QIE44PIB.js} +1737 -1370
- package/dist/web/server/{routes-BznemByz-F4DJAYIM.js → routes-Ct81-8Tq-LHRMOS7R.js} +2882 -2330
- package/dist/web/server/server.js +3 -3
- package/dist/web/server/{session-insights-panel-JfeTHE0d-3HZB3ZWI.js → session-insights-panel-BHZyKDTo-LRMAMA3O.js} +4 -2
- package/dist/web/server/{settings-dialog-DgeBMORv-7SRSENPM.js → settings-dialog-B4uUS6f--AZ4I4ZOT.js} +142 -142
- package/dist/web/server/{start-CLAD7RcD-56S4BWMM.js → start-BYVnok_H-IA6TWGA3.js} +1 -1
- package/dist/web/server/subagent-chat-panel-C97S3WID-DLOAD5TG.js +63 -0
- package/dist/web/server/subagents-panel-iHpvMIZy-LI6XK66M.js +181 -0
- package/dist/web/server/{workspace-panel-y54P79_B-VPIYUXF6.js → workspace-panel-CHPoiXEo-YB4WS3MK.js} +2 -2
- package/package.json +5 -5
- package/dist/web/client/assets/artifacts-panel-CX62LQ13.js +0 -1
- package/dist/web/client/assets/chat-command-palette-C4sSf8Kg.js +0 -1
- package/dist/web/client/assets/collapsible-DmyYcezk.js +0 -1
- package/dist/web/client/assets/command-CB6emP8m.js +0 -2
- package/dist/web/client/assets/conversation-turns-ByFoWPXe.js +0 -6
- package/dist/web/client/assets/globals-CqqQdk2S.css +0 -2
- package/dist/web/client/assets/range-vSJ7Ux_5.js +0 -2
- package/dist/web/client/assets/repl-panel-DiGS6uCw.js +0 -1
- package/dist/web/client/assets/routes-CxlNCi_v.js +0 -16
- package/dist/web/client/assets/session-insights-panel-DwmwiikS.js +0 -1
- package/dist/web/client/assets/subagents-panel-DGnsK6Nx.js +0 -1
- package/dist/web/server/chunk-ZEVZFLIY.js +0 -334
- package/dist/web/server/subagents-panel-CzZe3co7-2VZ5JTWF.js +0 -332
|
@@ -1,332 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
FleetGenerativeTextRenderer,
|
|
3
|
-
FleetSubagentList,
|
|
4
|
-
FleetToolTimeline,
|
|
5
|
-
Message,
|
|
6
|
-
MessageBubble,
|
|
7
|
-
MessageBubbleContent,
|
|
8
|
-
MessageContent,
|
|
9
|
-
MessageScroller,
|
|
10
|
-
UserMessage,
|
|
11
|
-
buildAssistantElements,
|
|
12
|
-
groupMessages,
|
|
13
|
-
normalizeAssistantToolParts,
|
|
14
|
-
orderedRlmChildren,
|
|
15
|
-
rlmStatusIcon
|
|
16
|
-
} from "./chunk-Y6LJ4WBI.js";
|
|
17
|
-
import {
|
|
18
|
-
FleetPiToolRenderer
|
|
19
|
-
} from "./chunk-PCJ5EKFE.js";
|
|
20
|
-
import {
|
|
21
|
-
PI_TOOL_RENDERERS
|
|
22
|
-
} from "./chunk-44IVTHDV.js";
|
|
23
|
-
import "./chunk-P66QQWUM.js";
|
|
24
|
-
import {
|
|
25
|
-
RefreshCw
|
|
26
|
-
} from "./chunk-EIVNRYP3.js";
|
|
27
|
-
import "./chunk-WK7CQS2N.js";
|
|
28
|
-
import "./chunk-DBXYBYBP.js";
|
|
29
|
-
import "./chunk-5WZFFNFY.js";
|
|
30
|
-
import {
|
|
31
|
-
Bot
|
|
32
|
-
} from "./chunk-74QOI457.js";
|
|
33
|
-
import "./chunk-2H6A6Z7F.js";
|
|
34
|
-
import "./chunk-YRWVQ7BW.js";
|
|
35
|
-
import {
|
|
36
|
-
derivePrimeAgentArtifactRuns
|
|
37
|
-
} from "./chunk-5AVQZ4AZ.js";
|
|
38
|
-
import "./chunk-3IKSPTYI.js";
|
|
39
|
-
import "./chunk-PWK2HJIV.js";
|
|
40
|
-
import "./chunk-QJBEWT4E.js";
|
|
41
|
-
import "./chunk-FAGDMGLK.js";
|
|
42
|
-
import "./chunk-6RJYXDSD.js";
|
|
43
|
-
import "./chunk-PKCTG7EW.js";
|
|
44
|
-
import {
|
|
45
|
-
ChevronRight
|
|
46
|
-
} from "./chunk-7QCDOBZ3.js";
|
|
47
|
-
import "./chunk-NFRJDPB3.js";
|
|
48
|
-
import "./chunk-LESNF5O4.js";
|
|
49
|
-
import "./chunk-QLY3L4A2.js";
|
|
50
|
-
import "./chunk-NLIUTTKL.js";
|
|
51
|
-
import {
|
|
52
|
-
Button
|
|
53
|
-
} from "./chunk-RPROZ2JC.js";
|
|
54
|
-
import "./chunk-XYYNYFFD.js";
|
|
55
|
-
import "./chunk-X2TUFLTP.js";
|
|
56
|
-
import "./chunk-ST5I2PLN.js";
|
|
57
|
-
import {
|
|
58
|
-
CircleAlert
|
|
59
|
-
} from "./chunk-7APYEQIO.js";
|
|
60
|
-
import "./chunk-M2FGGPNA.js";
|
|
61
|
-
import "./chunk-G5BCQQ5N.js";
|
|
62
|
-
import "./chunk-BYXBJQAS.js";
|
|
63
|
-
import "./chunk-E26EAQIM.js";
|
|
64
|
-
import {
|
|
65
|
-
cn
|
|
66
|
-
} from "./chunk-DJMHPJBP.js";
|
|
67
|
-
import "./chunk-UQVZJSZZ.js";
|
|
68
|
-
import "./chunk-JDCCC7A7.js";
|
|
69
|
-
import "./chunk-L547YHC4.js";
|
|
70
|
-
import "./chunk-MLKGABMK.js";
|
|
71
|
-
|
|
72
|
-
// web/app/dist/server/assets/subagents-panel-CzZe3co7.js
|
|
73
|
-
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
74
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
75
|
-
function transcriptStatus(child) {
|
|
76
|
-
if (child.status === "running") return "streaming";
|
|
77
|
-
if (child.status === "error") return "error";
|
|
78
|
-
return "ready";
|
|
79
|
-
}
|
|
80
|
-
function SubagentTurnView({ turn, isLast, isStreaming, artifacts, presentation }) {
|
|
81
|
-
const assistantElements = useMemo(() => turn.assistants.flatMap((message, index) => buildAssistantElements(normalizeAssistantToolParts(message.parts ?? []), {
|
|
82
|
-
messageId: message.id,
|
|
83
|
-
isLast: isLast && index === turn.assistants.length - 1,
|
|
84
|
-
isStreaming,
|
|
85
|
-
suppressQuestionTool: true,
|
|
86
|
-
ToolRendererComponent: FleetPiToolRenderer,
|
|
87
|
-
TextRendererComponent: FleetGenerativeTextRenderer,
|
|
88
|
-
toolRenderers: PI_TOOL_RENDERERS
|
|
89
|
-
})), [
|
|
90
|
-
isLast,
|
|
91
|
-
isStreaming,
|
|
92
|
-
turn.assistants
|
|
93
|
-
]);
|
|
94
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
95
|
-
className: "flex flex-col gap-3",
|
|
96
|
-
children: [turn.user ? /* @__PURE__ */ jsx(Message, {
|
|
97
|
-
from: "user",
|
|
98
|
-
children: /* @__PURE__ */ jsx(MessageContent, { children: /* @__PURE__ */ jsx(UserMessage, {
|
|
99
|
-
message: turn.user,
|
|
100
|
-
enableImagePreview: false
|
|
101
|
-
}) })
|
|
102
|
-
}) : null, turn.assistants.length > 0 ? /* @__PURE__ */ jsx(Message, {
|
|
103
|
-
from: "assistant",
|
|
104
|
-
children: /* @__PURE__ */ jsx(MessageContent, { children: /* @__PURE__ */ jsx(MessageBubble, {
|
|
105
|
-
variant: "ghost",
|
|
106
|
-
children: /* @__PURE__ */ jsxs(MessageBubbleContent, { children: [
|
|
107
|
-
isLast ? /* @__PURE__ */ jsx(FleetToolTimeline, {
|
|
108
|
-
messages: turn.assistants,
|
|
109
|
-
artifacts,
|
|
110
|
-
streaming: isStreaming
|
|
111
|
-
}) : null,
|
|
112
|
-
/* @__PURE__ */ jsx("div", {
|
|
113
|
-
className: "flex flex-col gap-3",
|
|
114
|
-
children: assistantElements
|
|
115
|
-
}),
|
|
116
|
-
isLast && presentation ? /* @__PURE__ */ jsx(FleetSubagentList, {
|
|
117
|
-
children: presentation.rlmChildren,
|
|
118
|
-
tree: presentation.rlmTree
|
|
119
|
-
}) : null
|
|
120
|
-
] })
|
|
121
|
-
}) })
|
|
122
|
-
}) : null]
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
function ChildTranscript({ child, parentSessionId, transcript, onRefresh }) {
|
|
126
|
-
const turns = useMemo(() => transcript?.status === "ready" ? groupMessages(transcript.messages) : [], [transcript]);
|
|
127
|
-
const childStatus = transcriptStatus(child);
|
|
128
|
-
const artifactRuns = useMemo(() => transcript?.status === "ready" ? derivePrimeAgentArtifactRuns(transcript.messages, transcript.presentation, childStatus) : [], [childStatus, transcript]);
|
|
129
|
-
const artifacts = useMemo(() => artifactRuns.flatMap((run) => run.artifacts), [artifactRuns]);
|
|
130
|
-
return /* @__PURE__ */ jsxs("section", {
|
|
131
|
-
"aria-label": `Subagent thread: ${child.label}`,
|
|
132
|
-
className: "space-y-2",
|
|
133
|
-
children: [/* @__PURE__ */ jsxs("div", {
|
|
134
|
-
className: "flex min-w-0 items-start gap-2 rounded-md border border-border/60 bg-background px-2.5 py-2",
|
|
135
|
-
children: [
|
|
136
|
-
/* @__PURE__ */ jsx(Bot, { className: "mt-0.5 size-3.5 shrink-0 text-foreground/45" }),
|
|
137
|
-
/* @__PURE__ */ jsxs("div", {
|
|
138
|
-
className: "min-w-0 flex-1",
|
|
139
|
-
children: [
|
|
140
|
-
/* @__PURE__ */ jsxs("div", {
|
|
141
|
-
className: "flex min-w-0 items-center gap-2",
|
|
142
|
-
children: [/* @__PURE__ */ jsx("span", {
|
|
143
|
-
className: "min-w-0 flex-1 truncate text-xs font-medium text-foreground/80",
|
|
144
|
-
children: child.sessionName || child.label
|
|
145
|
-
}), /* @__PURE__ */ jsx("span", {
|
|
146
|
-
className: "shrink-0 text-[10px] capitalize text-foreground/45",
|
|
147
|
-
children: child.status
|
|
148
|
-
})]
|
|
149
|
-
}),
|
|
150
|
-
child.model ? /* @__PURE__ */ jsx("p", {
|
|
151
|
-
className: "truncate font-mono text-[10px] text-foreground/40",
|
|
152
|
-
children: child.model
|
|
153
|
-
}) : null,
|
|
154
|
-
child.answerPreview || child.recap ? /* @__PURE__ */ jsx("p", {
|
|
155
|
-
className: "mt-1 line-clamp-3 whitespace-pre-wrap text-[11px] leading-4 text-foreground/55",
|
|
156
|
-
children: child.answerPreview ?? child.recap
|
|
157
|
-
}) : null
|
|
158
|
-
]
|
|
159
|
-
}),
|
|
160
|
-
/* @__PURE__ */ jsx(Button, {
|
|
161
|
-
type: "button",
|
|
162
|
-
variant: "ghost",
|
|
163
|
-
size: "icon-sm",
|
|
164
|
-
className: "shrink-0 text-foreground/40 hover:text-foreground/70",
|
|
165
|
-
"aria-label": `Refresh ${child.label} thread`,
|
|
166
|
-
title: `Refresh ${child.label} thread`,
|
|
167
|
-
onClick: onRefresh,
|
|
168
|
-
children: /* @__PURE__ */ jsx(RefreshCw, { className: cn("size-3.5", transcript?.status === "loading" && "animate-spin") })
|
|
169
|
-
})
|
|
170
|
-
]
|
|
171
|
-
}), !parentSessionId ? /* @__PURE__ */ jsx("p", {
|
|
172
|
-
className: "rounded-md border border-dashed border-border/70 px-3 py-3 text-[11px] leading-4 text-foreground/45",
|
|
173
|
-
children: "This subagent thread is unavailable until the parent session is active."
|
|
174
|
-
}) : transcript?.status === "loading" ? /* @__PURE__ */ jsx("div", {
|
|
175
|
-
className: "flex min-h-32 items-center justify-center rounded-md border border-dashed border-border/70 text-[11px] text-foreground/45",
|
|
176
|
-
children: "Loading subagent thread\u2026"
|
|
177
|
-
}) : transcript?.status === "error" ? /* @__PURE__ */ jsxs("div", {
|
|
178
|
-
role: "alert",
|
|
179
|
-
className: "flex items-start gap-2 rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-[11px] leading-4 text-destructive",
|
|
180
|
-
children: [/* @__PURE__ */ jsx(CircleAlert, { className: "mt-0.5 size-3.5 shrink-0" }), /* @__PURE__ */ jsx("span", { children: transcript?.error?.message ?? "Unable to load this subagent thread." })]
|
|
181
|
-
}) : turns.length === 0 ? /* @__PURE__ */ jsx("p", {
|
|
182
|
-
className: "rounded-md border border-dashed border-border/70 px-3 py-3 text-[11px] leading-4 text-foreground/45",
|
|
183
|
-
children: "This subagent thread has no messages yet."
|
|
184
|
-
}) : /* @__PURE__ */ jsx("div", {
|
|
185
|
-
className: "h-96 min-h-64 max-h-[calc(100svh-18rem)] rounded-md border border-border/60 bg-background",
|
|
186
|
-
children: /* @__PURE__ */ jsx(MessageScroller, {
|
|
187
|
-
label: `Transcript for ${child.label}`,
|
|
188
|
-
followOutput: false,
|
|
189
|
-
smooth: false,
|
|
190
|
-
contentClassName: "flex flex-col gap-4 px-2.5 py-3",
|
|
191
|
-
children: turns.map((turn, index) => {
|
|
192
|
-
const isLast = index === turns.length - 1;
|
|
193
|
-
return /* @__PURE__ */ jsx(SubagentTurnView, {
|
|
194
|
-
turn,
|
|
195
|
-
isLast,
|
|
196
|
-
isStreaming: isLast && childStatus === "streaming",
|
|
197
|
-
artifacts: isLast ? artifacts : [],
|
|
198
|
-
presentation: isLast ? transcript?.presentation : void 0
|
|
199
|
-
}, turn.user?.id ?? `subagent-turn-${index}`);
|
|
200
|
-
})
|
|
201
|
-
})
|
|
202
|
-
})]
|
|
203
|
-
});
|
|
204
|
-
}
|
|
205
|
-
function SubagentsPanelContent({ agents, loadSession, parentSessionId, tree }) {
|
|
206
|
-
const ordered = useMemo(() => orderedRlmChildren(agents, tree), [agents, tree]);
|
|
207
|
-
const [selectedAgentId, setSelectedAgentId] = useState(null);
|
|
208
|
-
const [transcripts, setTranscripts] = useState({});
|
|
209
|
-
const requestVersions = useRef(/* @__PURE__ */ new Map());
|
|
210
|
-
const selectedAgent = ordered.find((agent) => agent.id === selectedAgentId) ?? ordered[0];
|
|
211
|
-
useEffect(() => {
|
|
212
|
-
if (selectedAgentId && ordered.some((agent) => agent.id === selectedAgentId)) return;
|
|
213
|
-
setSelectedAgentId(ordered[0]?.id ?? null);
|
|
214
|
-
}, [ordered, selectedAgentId]);
|
|
215
|
-
const loadTranscript = useCallback(async (agent, force = false) => {
|
|
216
|
-
if (!parentSessionId) return;
|
|
217
|
-
const requestKey = `${parentSessionId}:${agent.id}:${agent.status}:${agent.timestamp}`;
|
|
218
|
-
const current = transcripts[agent.id];
|
|
219
|
-
if (!force && current?.requestKey === requestKey) return;
|
|
220
|
-
const version = (requestVersions.current.get(agent.id) ?? 0) + 1;
|
|
221
|
-
requestVersions.current.set(agent.id, version);
|
|
222
|
-
setTranscripts((previous) => ({
|
|
223
|
-
...previous,
|
|
224
|
-
[agent.id]: {
|
|
225
|
-
requestKey,
|
|
226
|
-
status: "loading",
|
|
227
|
-
messages: []
|
|
228
|
-
}
|
|
229
|
-
}));
|
|
230
|
-
try {
|
|
231
|
-
const response = await loadSession(parentSessionId, agent.id);
|
|
232
|
-
if (requestVersions.current.get(agent.id) !== version) return;
|
|
233
|
-
setTranscripts((previous) => ({
|
|
234
|
-
...previous,
|
|
235
|
-
[agent.id]: {
|
|
236
|
-
requestKey,
|
|
237
|
-
status: "ready",
|
|
238
|
-
messages: response.messages,
|
|
239
|
-
presentation: response.presentation
|
|
240
|
-
}
|
|
241
|
-
}));
|
|
242
|
-
} catch (error) {
|
|
243
|
-
if (requestVersions.current.get(agent.id) !== version) return;
|
|
244
|
-
setTranscripts((previous) => ({
|
|
245
|
-
...previous,
|
|
246
|
-
[agent.id]: {
|
|
247
|
-
requestKey,
|
|
248
|
-
status: "error",
|
|
249
|
-
messages: [],
|
|
250
|
-
error: error instanceof Error ? error : new Error(String(error))
|
|
251
|
-
}
|
|
252
|
-
}));
|
|
253
|
-
}
|
|
254
|
-
}, [
|
|
255
|
-
loadSession,
|
|
256
|
-
parentSessionId,
|
|
257
|
-
transcripts
|
|
258
|
-
]);
|
|
259
|
-
useEffect(() => {
|
|
260
|
-
if (selectedAgent) loadTranscript(selectedAgent);
|
|
261
|
-
}, [
|
|
262
|
-
loadTranscript,
|
|
263
|
-
selectedAgent?.id,
|
|
264
|
-
selectedAgent?.status,
|
|
265
|
-
selectedAgent?.timestamp
|
|
266
|
-
]);
|
|
267
|
-
if (ordered.length === 0) return /* @__PURE__ */ jsx("section", {
|
|
268
|
-
"aria-label": "Subagents",
|
|
269
|
-
className: "flex min-h-36 items-center rounded-md border border-dashed border-border/70 px-4 text-center text-[12px] leading-5 text-foreground/45",
|
|
270
|
-
children: "Subagent threads will appear here when Prime delegates work."
|
|
271
|
-
});
|
|
272
|
-
return /* @__PURE__ */ jsxs("section", {
|
|
273
|
-
"aria-label": "Subagents",
|
|
274
|
-
className: "space-y-2 pb-1",
|
|
275
|
-
children: [
|
|
276
|
-
/* @__PURE__ */ jsxs("div", {
|
|
277
|
-
className: "flex min-w-0 items-center gap-2 rounded-sm bg-foreground/5 px-2 py-1.5",
|
|
278
|
-
children: [
|
|
279
|
-
/* @__PURE__ */ jsx(Bot, { className: "size-3.5 shrink-0 text-foreground/45" }),
|
|
280
|
-
/* @__PURE__ */ jsx("span", {
|
|
281
|
-
className: "min-w-0 flex-1 truncate text-label font-medium text-foreground/70",
|
|
282
|
-
children: "Invoked subagents"
|
|
283
|
-
}),
|
|
284
|
-
/* @__PURE__ */ jsx("span", {
|
|
285
|
-
className: "shrink-0 text-[10px] text-foreground/40",
|
|
286
|
-
children: ordered.length
|
|
287
|
-
})
|
|
288
|
-
]
|
|
289
|
-
}),
|
|
290
|
-
/* @__PURE__ */ jsx("div", {
|
|
291
|
-
className: "space-y-0.5",
|
|
292
|
-
"data-testid": "subagent-thread-list",
|
|
293
|
-
children: ordered.map((agent) => {
|
|
294
|
-
const selected = agent.id === selectedAgent?.id;
|
|
295
|
-
return /* @__PURE__ */ jsxs(Button, {
|
|
296
|
-
type: "button",
|
|
297
|
-
variant: "ghost",
|
|
298
|
-
size: "sm",
|
|
299
|
-
"aria-pressed": selected,
|
|
300
|
-
className: cn("flex w-full min-w-0 items-center gap-2 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-foreground/5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", selected && "bg-foreground/8"),
|
|
301
|
-
style: { paddingLeft: `${8 + Math.max(0, agent.depth ?? 0) * 12}px` },
|
|
302
|
-
onClick: () => setSelectedAgentId(agent.id),
|
|
303
|
-
children: [
|
|
304
|
-
/* @__PURE__ */ jsx("span", {
|
|
305
|
-
className: "shrink-0",
|
|
306
|
-
children: rlmStatusIcon(agent.status)
|
|
307
|
-
}),
|
|
308
|
-
/* @__PURE__ */ jsx("span", {
|
|
309
|
-
className: "min-w-0 flex-1 truncate text-xs text-foreground/80",
|
|
310
|
-
children: agent.label
|
|
311
|
-
}),
|
|
312
|
-
/* @__PURE__ */ jsx(ChevronRight, { className: "size-3 shrink-0 text-foreground/30" }),
|
|
313
|
-
/* @__PURE__ */ jsx("span", {
|
|
314
|
-
className: "shrink-0 text-[10px] capitalize text-foreground/45",
|
|
315
|
-
children: agent.status
|
|
316
|
-
})
|
|
317
|
-
]
|
|
318
|
-
}, agent.id);
|
|
319
|
-
})
|
|
320
|
-
}),
|
|
321
|
-
selectedAgent ? /* @__PURE__ */ jsx(ChildTranscript, {
|
|
322
|
-
child: selectedAgent,
|
|
323
|
-
parentSessionId,
|
|
324
|
-
transcript: transcripts[selectedAgent.id],
|
|
325
|
-
onRefresh: () => void loadTranscript(selectedAgent, true)
|
|
326
|
-
}) : null
|
|
327
|
-
]
|
|
328
|
-
});
|
|
329
|
-
}
|
|
330
|
-
export {
|
|
331
|
-
SubagentsPanelContent
|
|
332
|
-
};
|