@truefoundry/trueforge-ui 0.3.0-rc.2 → 0.3.0-rc.4
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 +63 -0
- package/README.md +18 -10
- package/dist/{AgentCodeSnippets-637HQUXD.js → AgentCodeSnippets-U6KQWVBJ.js} +38 -23
- package/dist/AgentCodeSnippets-U6KQWVBJ.js.map +1 -0
- package/dist/AgentMetricChart-3D6FUFO6.js +15 -0
- package/dist/{AgentOverview-3FJ5EE6N.js → AgentOverview-RLJ6HZCN.js} +7 -7
- package/dist/{AgentSessionEventTimeline-VELWUYPR.js → AgentSessionEventTimeline-CDXRRUZQ.js} +8 -8
- package/dist/{AgentSessionEventTimeline-VELWUYPR.js.map → AgentSessionEventTimeline-CDXRRUZQ.js.map} +1 -1
- package/dist/{AgentSessionEventTimelineChart-CUKETHWM.js → AgentSessionEventTimelineChart-S2WX6ZEA.js} +12 -12
- package/dist/AgentSessionEventTimelineChart-S2WX6ZEA.js.map +1 -0
- package/dist/{AgentSessions-T7MOGOTZ.js → AgentSessions-UI3L7XY2.js} +72 -24
- package/dist/AgentSessions-UI3L7XY2.js.map +1 -0
- package/dist/{ConnectorSettings-ESZ2RSRG.js → ConnectorSettings-OIGAC2HU.js} +156 -116
- package/dist/ConnectorSettings-OIGAC2HU.js.map +1 -0
- package/dist/{DockLayout-NLFNU6F2.js → DockLayout-J5BRKMJZ.js} +10 -10
- package/dist/{DrawerLayout-PR3SMKA6.js → DrawerLayout-65YHGHIF.js} +13 -11
- package/dist/DrawerLayout-65YHGHIF.js.map +1 -0
- package/dist/{ModelSettings-LYW64IRR.js → ModelSettings-VP6WCMGT.js} +10 -10
- package/dist/{ModelSettings-LYW64IRR.js.map → ModelSettings-VP6WCMGT.js.map} +1 -1
- package/dist/OpenUiFenceBlock-UTDCTNTM.js +9 -0
- package/dist/{SandboxSettings-DF64LHYI.js → SandboxSettings-GTZT7LD6.js} +9 -9
- package/dist/SchedulesPage-ARWU7BZF.js +15 -0
- package/dist/{SettingsBuilder-LSXK2VN4.js → SettingsBuilder-A4BPYIFZ.js} +8 -8
- package/dist/{ShellRouteSync-B22IAV2W.js → ShellRouteSync-SSLGM35F.js} +157 -22
- package/dist/ShellRouteSync-SSLGM35F.js.map +1 -0
- package/dist/{SidebarLayout-XW6LXB7R.js → SidebarLayout-MFDOGAVJ.js} +74 -53
- package/dist/SidebarLayout-MFDOGAVJ.js.map +1 -0
- package/dist/{SkillSettings-64VXUO6J.js → SkillSettings-WQPUQ5TE.js} +18 -13
- package/dist/SkillSettings-WQPUQ5TE.js.map +1 -0
- package/dist/{TrueForgeUIWithRouter-3TSLV22Q.js → TrueForgeUIWithRouter-5CDICMCE.js} +9 -9
- package/dist/{WidgetLayout-Q5P7PYSJ.js → WidgetLayout-HE7E4UL5.js} +10 -10
- package/dist/{chunk-SQGT43Z3.js → chunk-2BDTG544.js} +21 -4
- package/dist/chunk-2BDTG544.js.map +1 -0
- package/dist/{chunk-YQO2NMJ3.js → chunk-2OKGEU6X.js} +4425 -2982
- package/dist/chunk-2OKGEU6X.js.map +1 -0
- package/dist/{chunk-FQK2XVVE.js → chunk-6CFZHEYH.js} +225 -72
- package/dist/chunk-6CFZHEYH.js.map +1 -0
- package/dist/{chunk-QC42MLAK.js → chunk-7AAO4UDQ.js} +4 -3
- package/dist/chunk-7AAO4UDQ.js.map +1 -0
- package/dist/chunk-E4GVP6PM.js +195 -0
- package/dist/chunk-E4GVP6PM.js.map +1 -0
- package/dist/{chunk-LGRHHFHN.js → chunk-F7ZAQIRE.js} +166 -45
- package/dist/chunk-F7ZAQIRE.js.map +1 -0
- package/dist/{chunk-VJ7BZGAF.js → chunk-GTTMLDCI.js} +2 -2
- package/dist/{chunk-5I2COQNL.js → chunk-IOPHQEUY.js} +13 -11
- package/dist/chunk-IOPHQEUY.js.map +1 -0
- package/dist/{chunk-G2TUAD65.js → chunk-KCYBMKQL.js} +235 -108
- package/dist/chunk-KCYBMKQL.js.map +1 -0
- package/dist/{chunk-H6WTY5PM.js → chunk-MAA7U4RF.js} +17 -227
- package/dist/chunk-MAA7U4RF.js.map +1 -0
- package/dist/{chunk-GXYAOAK5.js → chunk-MJULWIPI.js} +224 -162
- package/dist/chunk-MJULWIPI.js.map +1 -0
- package/dist/chunk-P7J2ABEP.js +587 -0
- package/dist/chunk-P7J2ABEP.js.map +1 -0
- package/dist/{chunk-VUMGMGKZ.js → chunk-TGKQRK3S.js} +52 -8
- package/dist/chunk-TGKQRK3S.js.map +1 -0
- package/dist/{chunk-I3AL54MA.js → chunk-VXKNS7FH.js} +28 -24
- package/dist/chunk-VXKNS7FH.js.map +1 -0
- package/dist/chunk-XO3FYN2W.js +517 -0
- package/dist/chunk-XO3FYN2W.js.map +1 -0
- package/dist/{createTrueFoundryServer-CmZnBh_l.d.ts → createTrueFoundryServer-B_FYhSdn.d.ts} +8 -5
- package/dist/index.d.ts +300 -89
- package/dist/index.js +65 -488
- package/dist/index.js.map +1 -1
- package/dist/plugins/trueforge-agent-server-adapter/index.d.ts +44 -13
- package/dist/plugins/trueforge-agent-server-adapter/index.js +73 -37
- package/dist/plugins/trueforge-agent-server-adapter/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +3 -3
- package/dist/AgentCodeSnippets-637HQUXD.js.map +0 -1
- package/dist/AgentMetricChart-4FYECRIN.js +0 -15
- package/dist/AgentSessionEventTimelineChart-CUKETHWM.js.map +0 -1
- package/dist/AgentSessions-T7MOGOTZ.js.map +0 -1
- package/dist/ConnectorSettings-ESZ2RSRG.js.map +0 -1
- package/dist/DrawerLayout-PR3SMKA6.js.map +0 -1
- package/dist/OpenUiFenceBlock-JEPNPJ7U.js +0 -9
- package/dist/SchedulesPage-WQU4H25F.js +0 -15
- package/dist/ShellRouteSync-B22IAV2W.js.map +0 -1
- package/dist/SidebarLayout-XW6LXB7R.js.map +0 -1
- package/dist/SkillSettings-64VXUO6J.js.map +0 -1
- package/dist/chunk-5I2COQNL.js.map +0 -1
- package/dist/chunk-BWHOZFIV.js +0 -587
- package/dist/chunk-BWHOZFIV.js.map +0 -1
- package/dist/chunk-FQK2XVVE.js.map +0 -1
- package/dist/chunk-G2TUAD65.js.map +0 -1
- package/dist/chunk-GXYAOAK5.js.map +0 -1
- package/dist/chunk-H6WTY5PM.js.map +0 -1
- package/dist/chunk-I3AL54MA.js.map +0 -1
- package/dist/chunk-LGRHHFHN.js.map +0 -1
- package/dist/chunk-NHHSZB5N.js +0 -74
- package/dist/chunk-NHHSZB5N.js.map +0 -1
- package/dist/chunk-QC42MLAK.js.map +0 -1
- package/dist/chunk-SFZNIO6U.js +0 -18
- package/dist/chunk-SFZNIO6U.js.map +0 -1
- package/dist/chunk-SQGT43Z3.js.map +0 -1
- package/dist/chunk-VUMGMGKZ.js.map +0 -1
- package/dist/chunk-YQO2NMJ3.js.map +0 -1
- /package/dist/{AgentMetricChart-4FYECRIN.js.map → AgentMetricChart-3D6FUFO6.js.map} +0 -0
- /package/dist/{AgentOverview-3FJ5EE6N.js.map → AgentOverview-RLJ6HZCN.js.map} +0 -0
- /package/dist/{DockLayout-NLFNU6F2.js.map → DockLayout-J5BRKMJZ.js.map} +0 -0
- /package/dist/{OpenUiFenceBlock-JEPNPJ7U.js.map → OpenUiFenceBlock-UTDCTNTM.js.map} +0 -0
- /package/dist/{SandboxSettings-DF64LHYI.js.map → SandboxSettings-GTZT7LD6.js.map} +0 -0
- /package/dist/{SchedulesPage-WQU4H25F.js.map → SchedulesPage-ARWU7BZF.js.map} +0 -0
- /package/dist/{SettingsBuilder-LSXK2VN4.js.map → SettingsBuilder-A4BPYIFZ.js.map} +0 -0
- /package/dist/{TrueForgeUIWithRouter-3TSLV22Q.js.map → TrueForgeUIWithRouter-5CDICMCE.js.map} +0 -0
- /package/dist/{WidgetLayout-Q5P7PYSJ.js.map → WidgetLayout-HE7E4UL5.js.map} +0 -0
- /package/dist/{chunk-VJ7BZGAF.js.map → chunk-GTTMLDCI.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
|
+
ThreadListContainer
|
|
4
|
+
} from "./chunk-XO3FYN2W.js";
|
|
5
|
+
import {
|
|
6
|
+
ApprovalNavContainer,
|
|
3
7
|
AskUserContainer,
|
|
4
8
|
ComposerContainer,
|
|
5
9
|
CustomActionContainer,
|
|
@@ -10,13 +14,14 @@ import {
|
|
|
10
14
|
ThreadContainer,
|
|
11
15
|
UserEditComposerContainer,
|
|
12
16
|
threadHasPendingMcpAuth,
|
|
17
|
+
useApprovalNav,
|
|
13
18
|
useComposerPauseView
|
|
14
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-KCYBMKQL.js";
|
|
15
20
|
import {
|
|
16
21
|
ServerInitLoader,
|
|
17
22
|
TrueForgeUIShell,
|
|
18
23
|
TrueFoundryChatProvider
|
|
19
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-F7ZAQIRE.js";
|
|
20
25
|
import "./chunk-DJUFS2BW.js";
|
|
21
26
|
import {
|
|
22
27
|
ComposerBusyProvider,
|
|
@@ -26,19 +31,10 @@ import {
|
|
|
26
31
|
} from "./chunk-BSIPI3KV.js";
|
|
27
32
|
import {
|
|
28
33
|
AgentMetricChart
|
|
29
|
-
} from "./chunk-
|
|
30
|
-
import {
|
|
31
|
-
ScheduleFormDrawer,
|
|
32
|
-
ScheduleFormFields,
|
|
33
|
-
ScheduleLastRunsCell,
|
|
34
|
-
ScheduleRunChip,
|
|
35
|
-
ScheduleStatusBadge,
|
|
36
|
-
SchedulesPage,
|
|
37
|
-
TestScheduleScreen
|
|
38
|
-
} from "./chunk-GXYAOAK5.js";
|
|
34
|
+
} from "./chunk-IOPHQEUY.js";
|
|
39
35
|
import {
|
|
40
36
|
createTrueFoundryServer
|
|
41
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-7AAO4UDQ.js";
|
|
42
38
|
import "./chunk-Y6S4OVVQ.js";
|
|
43
39
|
import {
|
|
44
40
|
IS_CREATE_AGENT_METADATA_KEY,
|
|
@@ -46,11 +42,21 @@ import {
|
|
|
46
42
|
readSessionIsCreateAgent,
|
|
47
43
|
sessionIsCreateAgent
|
|
48
44
|
} from "./chunk-RDXBMTP5.js";
|
|
45
|
+
import {
|
|
46
|
+
ScheduleFormDrawer,
|
|
47
|
+
ScheduleFormFields,
|
|
48
|
+
ScheduleLastRunsCell,
|
|
49
|
+
ScheduleRunChip,
|
|
50
|
+
ScheduleStatusBadge,
|
|
51
|
+
SchedulesPage,
|
|
52
|
+
TestScheduleScreen
|
|
53
|
+
} from "./chunk-MJULWIPI.js";
|
|
49
54
|
import {
|
|
50
55
|
AgentCodeBlock,
|
|
51
56
|
AgentConfigEditors,
|
|
52
57
|
AgentConfigPanel,
|
|
53
58
|
AgentConfigSection,
|
|
59
|
+
AgentCustomParametersEditor,
|
|
54
60
|
AgentDetailsHeader,
|
|
55
61
|
AgentDetailsPage,
|
|
56
62
|
AgentDetailsTabs,
|
|
@@ -58,6 +64,7 @@ import {
|
|
|
58
64
|
AgentInstructionsDrawer,
|
|
59
65
|
AgentMcpEditorContent,
|
|
60
66
|
AgentMetricCard,
|
|
67
|
+
AgentMetricStatistics,
|
|
61
68
|
AgentMetricsContainer,
|
|
62
69
|
AgentMetricsTimeRangeFilter,
|
|
63
70
|
AgentMetricsView,
|
|
@@ -67,8 +74,8 @@ import {
|
|
|
67
74
|
AgentOverviewCard,
|
|
68
75
|
AgentResourceConfigModal,
|
|
69
76
|
AgentResourceEditorContent,
|
|
77
|
+
AgentRuntimeConfigDrawer,
|
|
70
78
|
AgentRuntimeConfigFields,
|
|
71
|
-
AgentRuntimeConfigModal,
|
|
72
79
|
AgentRuntimeEditorContent,
|
|
73
80
|
AgentSessionsFilters,
|
|
74
81
|
AgentSkillsEditorContent,
|
|
@@ -76,6 +83,7 @@ import {
|
|
|
76
83
|
AgentStepsContainer,
|
|
77
84
|
AgentsLibrary,
|
|
78
85
|
AgentsLibraryButton,
|
|
86
|
+
ApprovalNavBanner,
|
|
79
87
|
AssistantMessageBubble,
|
|
80
88
|
AssistantMessageContainer,
|
|
81
89
|
AssistantTextContainer,
|
|
@@ -101,11 +109,11 @@ import {
|
|
|
101
109
|
DEFAULT_TABLE_PAGE_SIZE,
|
|
102
110
|
DraftAgentConfigTrigger,
|
|
103
111
|
DraftCapabilitiesPanel,
|
|
112
|
+
DraftComposerActionsMenu,
|
|
104
113
|
DraftComposerLeftSection,
|
|
105
114
|
DraftComposerRightSection,
|
|
106
115
|
DraftCompositeSelector,
|
|
107
116
|
DraftModelSelector,
|
|
108
|
-
DropdownMenuItem,
|
|
109
117
|
HistoryLoader,
|
|
110
118
|
MCP_AUTH_POPUP_CHANNEL,
|
|
111
119
|
Markdown,
|
|
@@ -117,17 +125,17 @@ import {
|
|
|
117
125
|
MessageListSkeleton,
|
|
118
126
|
MessageTimestamp,
|
|
119
127
|
MonacoEditorCore,
|
|
128
|
+
PermissionGuard,
|
|
120
129
|
PopoverSelect,
|
|
121
130
|
ReasoningContainer,
|
|
131
|
+
ResponsiveDropdownMenu,
|
|
122
132
|
ResumeUnavailable,
|
|
123
133
|
SandboxArtifactDownload,
|
|
124
134
|
SandboxToolCallCard,
|
|
125
135
|
SaveAgentButton,
|
|
126
136
|
SaveAgentForm,
|
|
127
|
-
SaveAgentFormFields,
|
|
128
137
|
SchedulesButton,
|
|
129
138
|
ScrollToBottomButton,
|
|
130
|
-
SearchInput_default,
|
|
131
139
|
SelectAgentEmptyState,
|
|
132
140
|
SessionsBrowserButton,
|
|
133
141
|
SessionsPage,
|
|
@@ -165,43 +173,38 @@ import {
|
|
|
165
173
|
ToolCallContentBlockContainer,
|
|
166
174
|
ToolGroupCard,
|
|
167
175
|
USER_MESSAGE_ATTACHMENT_PREVIEW_REM,
|
|
176
|
+
UserAvatar,
|
|
168
177
|
UserMessageActionBar,
|
|
169
178
|
UserMessageBubble,
|
|
170
179
|
UserMessageContainer,
|
|
171
180
|
UserMessageEdit,
|
|
172
181
|
WelcomeScreen,
|
|
173
|
-
canReuseMutableShell,
|
|
174
182
|
computeAgentStepsSplit,
|
|
175
183
|
defaultSlots,
|
|
184
|
+
findSubAgentAncestorsForApproval,
|
|
176
185
|
preloadMarkdownOpenUI,
|
|
177
|
-
readThreadAgentName,
|
|
178
186
|
resolveBrandChrome,
|
|
179
|
-
themePortalRoot,
|
|
180
|
-
threadListIndicesByRecency,
|
|
181
|
-
threadListItemIsMutable,
|
|
182
187
|
useBrandName,
|
|
183
|
-
useIsMobile,
|
|
184
188
|
useMCPAuth,
|
|
185
|
-
|
|
189
|
+
useOptionalCurrentUser,
|
|
190
|
+
useResourcePermissions,
|
|
186
191
|
useSlot,
|
|
187
192
|
useThemeMode,
|
|
188
193
|
useToaster,
|
|
189
194
|
useToasterOptional
|
|
190
|
-
} from "./chunk-
|
|
191
|
-
import "./chunk-
|
|
195
|
+
} from "./chunk-2OKGEU6X.js";
|
|
196
|
+
import "./chunk-E4GVP6PM.js";
|
|
192
197
|
import {
|
|
193
198
|
DraftCatalogProvider,
|
|
194
199
|
Icon,
|
|
195
|
-
auiButtonClass,
|
|
196
|
-
getErrorMessage,
|
|
197
200
|
registerIcons,
|
|
198
|
-
useCompactLayout,
|
|
199
201
|
useDraftCatalog
|
|
200
|
-
} from "./chunk-
|
|
202
|
+
} from "./chunk-MAA7U4RF.js";
|
|
201
203
|
import {
|
|
202
204
|
DEFAULT_AGENT_CONFIG,
|
|
203
205
|
ServerProvider,
|
|
204
206
|
ShellModeProvider,
|
|
207
|
+
getErrorMessage,
|
|
205
208
|
libraryAgentId,
|
|
206
209
|
shellIsCreateAgent,
|
|
207
210
|
shellIsMutable,
|
|
@@ -211,6 +214,7 @@ import {
|
|
|
211
214
|
useOptionalAgentMetricsServer,
|
|
212
215
|
useOptionalAgentSessionsServer,
|
|
213
216
|
useOptionalCatalogServer,
|
|
217
|
+
useOptionalPermissionsServer,
|
|
214
218
|
useOptionalScheduleServer,
|
|
215
219
|
useOptionalServer,
|
|
216
220
|
useOptionalShellMode,
|
|
@@ -218,25 +222,24 @@ import {
|
|
|
218
222
|
useServer,
|
|
219
223
|
useServerCapabilities,
|
|
220
224
|
useShellMode
|
|
221
|
-
} from "./chunk-
|
|
225
|
+
} from "./chunk-6CFZHEYH.js";
|
|
222
226
|
import {
|
|
223
227
|
useAui,
|
|
224
228
|
useAuiState
|
|
225
229
|
} from "./chunk-M6MHLVSO.js";
|
|
226
230
|
import {
|
|
227
231
|
OpenUiFenceBlock
|
|
228
|
-
} from "./chunk-
|
|
232
|
+
} from "./chunk-GTTMLDCI.js";
|
|
229
233
|
import {
|
|
230
234
|
PRESETS,
|
|
231
235
|
ThemeProvider,
|
|
232
|
-
cn,
|
|
233
236
|
resolvePresetTokens,
|
|
234
237
|
useBrand,
|
|
235
238
|
useContentClassNames,
|
|
236
239
|
useOptionalContentClassNames,
|
|
237
240
|
useTheme,
|
|
238
241
|
useThemeIcons
|
|
239
|
-
} from "./chunk-
|
|
242
|
+
} from "./chunk-P7J2ABEP.js";
|
|
240
243
|
|
|
241
244
|
// src/icons/agent-2.svg
|
|
242
245
|
import * as React from "react";
|
|
@@ -400,454 +403,14 @@ var PostMcpOauthScreen = () => {
|
|
|
400
403
|
};
|
|
401
404
|
var PostMcpOauthScreen_default = PostMcpOauthScreen;
|
|
402
405
|
|
|
403
|
-
// src/containers/ThreadListContainer.tsx
|
|
404
|
-
import {
|
|
405
|
-
ThreadListItemByIndexProvider,
|
|
406
|
-
ThreadListItemMorePrimitive,
|
|
407
|
-
ThreadListItemPrimitive,
|
|
408
|
-
ThreadListPrimitive,
|
|
409
|
-
useAui as useAui2,
|
|
410
|
-
useAuiState as useAuiState2
|
|
411
|
-
} from "@assistant-ui/react";
|
|
412
|
-
import { useCallback, useEffect as useEffect3, useMemo, useRef as useRef2, useState as useState3 } from "react";
|
|
413
|
-
|
|
414
|
-
// src/atoms/AgentHistoryFilterButton.tsx
|
|
415
|
-
import { useEffect as useEffect2, useId, useLayoutEffect, useRef, useState as useState2 } from "react";
|
|
416
|
-
import { createPortal } from "react-dom";
|
|
417
|
-
import { Fragment, jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
418
|
-
function AgentHistoryFilterButton() {
|
|
419
|
-
const shell = useOptionalShellMode();
|
|
420
|
-
const server = useOptionalServer();
|
|
421
|
-
const isMobile = useIsMobile();
|
|
422
|
-
const compact = useCompactLayout();
|
|
423
|
-
const useSheet = isMobile || compact;
|
|
424
|
-
const [open, setOpen] = useState2(false);
|
|
425
|
-
const [query, setQuery] = useState2("");
|
|
426
|
-
const [menuPos, setMenuPos] = useState2(null);
|
|
427
|
-
const buttonRef = useRef(null);
|
|
428
|
-
const menuRef = useRef(null);
|
|
429
|
-
const menuId = useId();
|
|
430
|
-
const enabled = shell?.isLibraryEnabled === true && server != null;
|
|
431
|
-
const selected = shell?.historyAgentFilter ?? null;
|
|
432
|
-
useEffect2(() => {
|
|
433
|
-
if (!open) setQuery("");
|
|
434
|
-
}, [open]);
|
|
435
|
-
const { agents, isInitialLoading, isSearching, loadingMore, hasMore, listRef, sentinelRef } = useSearchAgentsList({
|
|
436
|
-
enabled: open && enabled,
|
|
437
|
-
query
|
|
438
|
-
});
|
|
439
|
-
useLayoutEffect(() => {
|
|
440
|
-
if (!open || useSheet) {
|
|
441
|
-
setMenuPos(null);
|
|
442
|
-
return;
|
|
443
|
-
}
|
|
444
|
-
const update = () => {
|
|
445
|
-
const rect = buttonRef.current?.getBoundingClientRect();
|
|
446
|
-
if (!rect) return;
|
|
447
|
-
setMenuPos({ top: rect.top, left: rect.right + 4 });
|
|
448
|
-
};
|
|
449
|
-
update();
|
|
450
|
-
window.addEventListener("resize", update);
|
|
451
|
-
window.addEventListener("scroll", update, true);
|
|
452
|
-
return () => {
|
|
453
|
-
window.removeEventListener("resize", update);
|
|
454
|
-
window.removeEventListener("scroll", update, true);
|
|
455
|
-
};
|
|
456
|
-
}, [open, useSheet]);
|
|
457
|
-
useEffect2(() => {
|
|
458
|
-
if (!open || useSheet) return;
|
|
459
|
-
const handler = (e) => {
|
|
460
|
-
const target = e.target;
|
|
461
|
-
if (buttonRef.current?.contains(target) || menuRef.current?.contains(target)) return;
|
|
462
|
-
setOpen(false);
|
|
463
|
-
};
|
|
464
|
-
document.addEventListener("mousedown", handler);
|
|
465
|
-
return () => document.removeEventListener("mousedown", handler);
|
|
466
|
-
}, [open, useSheet]);
|
|
467
|
-
if (!enabled) return null;
|
|
468
|
-
const pick = (agentId) => {
|
|
469
|
-
shell?.setHistoryAgentFilter(agentId);
|
|
470
|
-
setOpen(false);
|
|
471
|
-
};
|
|
472
|
-
const filterBody = /* @__PURE__ */ jsxs7(Fragment, { children: [
|
|
473
|
-
/* @__PURE__ */ jsxs7("div", { className: "p-1", onMouseDown: (e) => e.stopPropagation(), children: [
|
|
474
|
-
/* @__PURE__ */ jsx11(SearchInput_default, { query, setQuery, placeholder: "Search agents" }),
|
|
475
|
-
isSearching ? /* @__PURE__ */ jsx11("p", { className: "text-text-secondary px-1 pt-1 text-[11px]", role: "status", children: "Searching\u2026" }) : null
|
|
476
|
-
] }),
|
|
477
|
-
/* @__PURE__ */ jsxs7(
|
|
478
|
-
"div",
|
|
479
|
-
{
|
|
480
|
-
ref: listRef,
|
|
481
|
-
className: cn("mt-1 overflow-y-auto", useSheet ? "min-h-0 flex-1 px-1 pb-2" : "min-h-48 max-h-64"),
|
|
482
|
-
children: [
|
|
483
|
-
query.trim() === "" ? /* @__PURE__ */ jsxs7(
|
|
484
|
-
DropdownMenuItem,
|
|
485
|
-
{
|
|
486
|
-
className: cn(
|
|
487
|
-
"justify-between",
|
|
488
|
-
selected == null && "bg-dropdown-selected-item-bg text-dropdown-selected-item-text"
|
|
489
|
-
),
|
|
490
|
-
onClick: () => pick(null),
|
|
491
|
-
children: [
|
|
492
|
-
"All chats",
|
|
493
|
-
selected == null ? /* @__PURE__ */ jsx11(Icon, { name: "check", className: "size-3.5 shrink-0" }) : null
|
|
494
|
-
]
|
|
495
|
-
}
|
|
496
|
-
) : null,
|
|
497
|
-
isInitialLoading ? /* @__PURE__ */ jsx11("p", { className: "px-2 py-3 text-center text-xs text-text-secondary", children: "Loading\u2026" }) : agents.length === 0 ? /* @__PURE__ */ jsx11("p", { className: "text-text-secondary px-2 py-6 text-center text-xs", role: "status", children: query.trim() ? `No agents match "${query.trim()}".` : "No agents yet." }) : /* @__PURE__ */ jsxs7(Fragment, { children: [
|
|
498
|
-
agents.map((agent) => {
|
|
499
|
-
const id = libraryAgentId(agent);
|
|
500
|
-
const active = selected === id;
|
|
501
|
-
return /* @__PURE__ */ jsxs7(
|
|
502
|
-
DropdownMenuItem,
|
|
503
|
-
{
|
|
504
|
-
className: cn(
|
|
505
|
-
"justify-between gap-2 text-left",
|
|
506
|
-
active && "bg-dropdown-selected-item-bg text-dropdown-selected-item-text"
|
|
507
|
-
),
|
|
508
|
-
onClick: () => pick(id),
|
|
509
|
-
children: [
|
|
510
|
-
/* @__PURE__ */ jsx11("span", { className: "min-w-0 truncate", children: agent.name }),
|
|
511
|
-
active ? /* @__PURE__ */ jsx11(Icon, { name: "check", className: "size-3.5 shrink-0" }) : null
|
|
512
|
-
]
|
|
513
|
-
},
|
|
514
|
-
id
|
|
515
|
-
);
|
|
516
|
-
}),
|
|
517
|
-
hasMore ? /* @__PURE__ */ jsx11("div", { ref: sentinelRef, className: "flex h-6 shrink-0 items-center justify-center", "aria-hidden": true, children: loadingMore ? /* @__PURE__ */ jsx11("span", { className: "text-text-secondary text-[11px]", role: "status", children: "Loading more\u2026" }) : null }) : null
|
|
518
|
-
] })
|
|
519
|
-
]
|
|
520
|
-
}
|
|
521
|
-
)
|
|
522
|
-
] });
|
|
523
|
-
return /* @__PURE__ */ jsxs7("div", { className: "relative shrink-0", children: [
|
|
524
|
-
/* @__PURE__ */ jsxs7(
|
|
525
|
-
"button",
|
|
526
|
-
{
|
|
527
|
-
ref: buttonRef,
|
|
528
|
-
type: "button",
|
|
529
|
-
"aria-label": selected != null ? `Filter chat history by agent (${selected})` : "Filter chat history by agent",
|
|
530
|
-
"aria-haspopup": useSheet ? "dialog" : "menu",
|
|
531
|
-
"aria-expanded": open,
|
|
532
|
-
"aria-controls": open ? menuId : void 0,
|
|
533
|
-
title: "Filter by agent",
|
|
534
|
-
className: auiButtonClass({
|
|
535
|
-
variant: "ghost",
|
|
536
|
-
size: "icon",
|
|
537
|
-
className: cn(
|
|
538
|
-
"relative size-7 shrink-0 text-text-secondary hover:bg-ghost-button-hover hover:text-ghost-button-text",
|
|
539
|
-
selected != null && "text-text-primary"
|
|
540
|
-
)
|
|
541
|
-
}),
|
|
542
|
-
onClick: () => setOpen((v) => !v),
|
|
543
|
-
children: [
|
|
544
|
-
/* @__PURE__ */ jsx11(Icon, { name: "funnel", className: "size-3.5" }),
|
|
545
|
-
selected != null ? /* @__PURE__ */ jsx11(
|
|
546
|
-
"span",
|
|
547
|
-
{
|
|
548
|
-
className: "bg-primary-button-bg absolute top-1 right-1 size-1.5 rounded-full",
|
|
549
|
-
"aria-hidden": true,
|
|
550
|
-
"data-testid": "history-filter-active-dot"
|
|
551
|
-
}
|
|
552
|
-
) : null
|
|
553
|
-
]
|
|
554
|
-
}
|
|
555
|
-
),
|
|
556
|
-
useSheet && open ? /* @__PURE__ */ jsx11(BottomSheet, { open: true, onOpenChange: setOpen, id: menuId, "aria-label": "Filter agents", children: /* @__PURE__ */ jsx11("div", { className: "flex min-h-0 flex-1 flex-col p-2", role: "menu", children: filterBody }) }) : null,
|
|
557
|
-
!useSheet && open && menuPos != null ? createPortal(
|
|
558
|
-
/* @__PURE__ */ jsx11(
|
|
559
|
-
"div",
|
|
560
|
-
{
|
|
561
|
-
ref: menuRef,
|
|
562
|
-
id: menuId,
|
|
563
|
-
role: "menu",
|
|
564
|
-
"aria-label": "Filter agents",
|
|
565
|
-
style: { top: menuPos.top, left: menuPos.left },
|
|
566
|
-
className: "font-sans-flex fixed z-50 w-56 rounded-md border border-border bg-card-bg p-1 text-text-primary shadow-md",
|
|
567
|
-
children: filterBody
|
|
568
|
-
}
|
|
569
|
-
),
|
|
570
|
-
themePortalRoot(buttonRef.current)
|
|
571
|
-
) : null
|
|
572
|
-
] });
|
|
573
|
-
}
|
|
574
|
-
|
|
575
|
-
// src/containers/ThreadListContainer.tsx
|
|
576
|
-
import { Fragment as Fragment2, jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
577
|
-
var deleteItemClass = "flex w-full cursor-pointer select-none items-center gap-2 rounded-md px-2 py-1.5 text-sm font-medium text-failure-bg outline-none transition-colors hover:bg-failure-bg/12 hover:text-failure-bg focus:bg-failure-bg/12 focus:text-failure-bg data-[highlighted]:bg-failure-bg/12 data-[highlighted]:text-failure-bg";
|
|
578
|
-
function ThreadListItemDeleteMenu() {
|
|
579
|
-
const compact = useCompactLayout();
|
|
580
|
-
const isMobile = useIsMobile();
|
|
581
|
-
const [sheetOpen, setSheetOpen] = useState3(false);
|
|
582
|
-
const [portalContainer, setPortalContainer] = useState3();
|
|
583
|
-
const useSheet = isMobile || compact;
|
|
584
|
-
const setTriggerElement = useCallback((element) => {
|
|
585
|
-
const themeRoot = element?.closest(".aui-theme-root");
|
|
586
|
-
setPortalContainer(themeRoot instanceof HTMLElement ? themeRoot : void 0);
|
|
587
|
-
}, []);
|
|
588
|
-
const moreButtonClass = auiButtonClass({
|
|
589
|
-
variant: "ghost",
|
|
590
|
-
size: "icon",
|
|
591
|
-
className: "size-7 shrink-0 text-text-secondary hover:bg-transparent hover:text-text-primary"
|
|
592
|
-
});
|
|
593
|
-
if (useSheet) {
|
|
594
|
-
return /* @__PURE__ */ jsxs8(Fragment2, { children: [
|
|
595
|
-
/* @__PURE__ */ jsx12(
|
|
596
|
-
"button",
|
|
597
|
-
{
|
|
598
|
-
type: "button",
|
|
599
|
-
"aria-label": "Session actions",
|
|
600
|
-
title: "Session actions",
|
|
601
|
-
"aria-haspopup": "dialog",
|
|
602
|
-
"aria-expanded": sheetOpen,
|
|
603
|
-
className: moreButtonClass,
|
|
604
|
-
onClick: () => setSheetOpen(true),
|
|
605
|
-
children: /* @__PURE__ */ jsx12(Icon, { name: "ellipsis", className: "size-3.5" })
|
|
606
|
-
}
|
|
607
|
-
),
|
|
608
|
-
sheetOpen ? /* @__PURE__ */ jsx12(BottomSheet, { open: true, onOpenChange: setSheetOpen, "aria-label": "Session actions", children: /* @__PURE__ */ jsx12("div", { className: "flex flex-col gap-1 p-2", role: "menu", children: /* @__PURE__ */ jsxs8(ThreadListItemPrimitive.Delete, { className: deleteItemClass, onClick: () => setSheetOpen(false), children: [
|
|
609
|
-
/* @__PURE__ */ jsx12(Icon, { name: "trash", className: "size-3.5" }),
|
|
610
|
-
"Delete"
|
|
611
|
-
] }) }) }) : null
|
|
612
|
-
] });
|
|
613
|
-
}
|
|
614
|
-
return /* @__PURE__ */ jsxs8(ThreadListItemMorePrimitive.Root, { sharedFocusGroup: true, children: [
|
|
615
|
-
/* @__PURE__ */ jsx12(
|
|
616
|
-
ThreadListItemMorePrimitive.Trigger,
|
|
617
|
-
{
|
|
618
|
-
ref: setTriggerElement,
|
|
619
|
-
"aria-label": "Session actions",
|
|
620
|
-
title: "Session actions",
|
|
621
|
-
className: moreButtonClass,
|
|
622
|
-
children: /* @__PURE__ */ jsx12(Icon, { name: "ellipsis", className: "size-3.5" })
|
|
623
|
-
}
|
|
624
|
-
),
|
|
625
|
-
/* @__PURE__ */ jsx12(
|
|
626
|
-
ThreadListItemMorePrimitive.Content,
|
|
627
|
-
{
|
|
628
|
-
portalProps: { container: portalContainer },
|
|
629
|
-
align: "end",
|
|
630
|
-
sideOffset: 4,
|
|
631
|
-
className: "font-sans-flex z-50 min-w-[8rem] rounded-md border border-border bg-card-bg p-1 text-text-primary shadow-md",
|
|
632
|
-
children: /* @__PURE__ */ jsx12(ThreadListItemPrimitive.Delete, { asChild: true, children: /* @__PURE__ */ jsxs8(ThreadListItemMorePrimitive.Item, { className: deleteItemClass, children: [
|
|
633
|
-
/* @__PURE__ */ jsx12(Icon, { name: "trash", className: "size-3.5" }),
|
|
634
|
-
"Delete"
|
|
635
|
-
] }) })
|
|
636
|
-
}
|
|
637
|
-
)
|
|
638
|
-
] });
|
|
639
|
-
}
|
|
640
|
-
function ThreadListItemRow({
|
|
641
|
-
onThreadOpen,
|
|
642
|
-
canDeleteSession
|
|
643
|
-
}) {
|
|
644
|
-
const aui = useAui2();
|
|
645
|
-
const shell = useOptionalShellMode();
|
|
646
|
-
const ThreadListRow2 = useSlot("ThreadListRow");
|
|
647
|
-
const id = useAuiState2((s) => s.threadListItem.id);
|
|
648
|
-
const remoteId = useAuiState2((s) => s.threadListItem.remoteId);
|
|
649
|
-
const title = useAuiState2((s) => s.threadListItem.title);
|
|
650
|
-
const lastMessageAt = useAuiState2((s) => s.threadListItem.lastMessageAt);
|
|
651
|
-
const custom = useAuiState2((s) => s.threadListItem.custom);
|
|
652
|
-
const mainThreadId = useAuiState2((s) => s.threads.mainThreadId);
|
|
653
|
-
const agentName = readThreadAgentName(custom);
|
|
654
|
-
const showDelete = canDeleteSession && remoteId != null;
|
|
655
|
-
const sidebarNavOpen = shell?.libraryOpen === true || shell?.sessionsOpen === true || shell?.schedulesOpen === true;
|
|
656
|
-
return /* @__PURE__ */ jsx12(ThreadListItemPrimitive.Root, { className: "min-w-0", children: /* @__PURE__ */ jsx12(
|
|
657
|
-
ThreadListRow2,
|
|
658
|
-
{
|
|
659
|
-
title: title ?? "New Chat",
|
|
660
|
-
active: id === mainThreadId && !sidebarNavOpen,
|
|
661
|
-
agentName,
|
|
662
|
-
lastMessageAt,
|
|
663
|
-
onSelect: () => {
|
|
664
|
-
onThreadOpen?.();
|
|
665
|
-
shell?.setSettingsOpen(false);
|
|
666
|
-
shell?.setLibraryOpen(false);
|
|
667
|
-
shell?.setSessionsOpen(false);
|
|
668
|
-
shell?.setSchedulesOpen(false);
|
|
669
|
-
const sessionMutable = threadListItemIsMutable(custom);
|
|
670
|
-
const sameImmutable = !sessionMutable && shell?.mode.status === "active" && !shell.mode.isMutable && (agentName == null ? shell.mode.agentName == null && shell.mode.agentId == null : shell.mode.agentName === agentName || shell.mode.agentId === agentName);
|
|
671
|
-
const sameMutable = canReuseMutableShell({
|
|
672
|
-
sessionMutable,
|
|
673
|
-
shellMutable: shell?.mode.status === "active" && shell.mode.isMutable,
|
|
674
|
-
...shell?.mode.status === "active" && shell.mode.isMutable ? { shellAgentName: shell.mode.agentName, shellAgentId: shell.mode.agentId } : {},
|
|
675
|
-
remoteId,
|
|
676
|
-
pendingSessionId: shell?.pendingSessionId
|
|
677
|
-
});
|
|
678
|
-
if ((sameImmutable || sameMutable) && remoteId != null) {
|
|
679
|
-
void Promise.resolve(aui.threads().switchToThread(id)).catch(() => void 0);
|
|
680
|
-
return;
|
|
681
|
-
}
|
|
682
|
-
if (remoteId != null) {
|
|
683
|
-
shell?.openHistorySession({
|
|
684
|
-
sessionId: remoteId,
|
|
685
|
-
isMutable: sessionMutable,
|
|
686
|
-
...agentName != null ? { agentName } : {}
|
|
687
|
-
});
|
|
688
|
-
return;
|
|
689
|
-
}
|
|
690
|
-
void Promise.resolve(aui.threads().switchToThread(id)).catch(() => void 0);
|
|
691
|
-
},
|
|
692
|
-
actions: showDelete ? /* @__PURE__ */ jsx12(ThreadListItemDeleteMenu, {}) : void 0
|
|
693
|
-
}
|
|
694
|
-
) });
|
|
695
|
-
}
|
|
696
|
-
function useThreadListIndicesByRecency() {
|
|
697
|
-
const threadIds = useAuiState2((s) => s.threads.threadIds);
|
|
698
|
-
const threadItems = useAuiState2((s) => s.threads.threadItems);
|
|
699
|
-
return useMemo(() => threadListIndicesByRecency({ threadIds, threadItems }), [threadIds, threadItems]);
|
|
700
|
-
}
|
|
701
|
-
function ThreadListItemsByRecency({
|
|
702
|
-
onThreadOpen,
|
|
703
|
-
canDeleteSession
|
|
704
|
-
}) {
|
|
705
|
-
const indices = useThreadListIndicesByRecency();
|
|
706
|
-
const threadIds = useAuiState2((s) => s.threads.threadIds);
|
|
707
|
-
return /* @__PURE__ */ jsx12(Fragment2, { children: indices.map((index) => {
|
|
708
|
-
const key = threadIds[index] ?? String(index);
|
|
709
|
-
return /* @__PURE__ */ jsx12(ThreadListItemByIndexProvider, { index, archived: false, children: /* @__PURE__ */ jsx12(ThreadListItemRow, { onThreadOpen, canDeleteSession }) }, key);
|
|
710
|
-
}) });
|
|
711
|
-
}
|
|
712
|
-
var THREAD_LIST_VIEWPORT_SLOT = "aui_thread-list-viewport";
|
|
713
|
-
var LOAD_MORE_BOTTOM_PX = 80;
|
|
714
|
-
function ChatHistorySection({ children, viewportRef }) {
|
|
715
|
-
const [expanded, setExpanded] = useState3(true);
|
|
716
|
-
const shell = useOptionalShellMode();
|
|
717
|
-
const showFilter = shell?.isLibraryEnabled === true;
|
|
718
|
-
return /* @__PURE__ */ jsxs8("div", { className: "flex min-h-0 flex-1 flex-col", children: [
|
|
719
|
-
/* @__PURE__ */ jsxs8("div", { className: "flex shrink-0 items-center gap-1 px-1 py-1", children: [
|
|
720
|
-
/* @__PURE__ */ jsxs8(
|
|
721
|
-
"button",
|
|
722
|
-
{
|
|
723
|
-
type: "button",
|
|
724
|
-
"aria-expanded": expanded,
|
|
725
|
-
className: "flex min-w-0 flex-1 items-center gap-1 rounded-md px-1.5 py-1 text-left text-sm font-medium text-text-secondary hover:bg-ghost-button-hover hover:text-text-primary",
|
|
726
|
-
onClick: () => setExpanded((v) => !v),
|
|
727
|
-
children: [
|
|
728
|
-
/* @__PURE__ */ jsx12("span", { className: "truncate", children: "Chat History" }),
|
|
729
|
-
/* @__PURE__ */ jsx12(
|
|
730
|
-
Icon,
|
|
731
|
-
{
|
|
732
|
-
name: "chevron-down",
|
|
733
|
-
className: cn("size-3.5 shrink-0 transition-transform", !expanded && "-rotate-90")
|
|
734
|
-
}
|
|
735
|
-
)
|
|
736
|
-
]
|
|
737
|
-
}
|
|
738
|
-
),
|
|
739
|
-
showFilter ? /* @__PURE__ */ jsx12(AgentHistoryFilterButton, {}) : null
|
|
740
|
-
] }),
|
|
741
|
-
expanded ? /* @__PURE__ */ jsx12(
|
|
742
|
-
"div",
|
|
743
|
-
{
|
|
744
|
-
ref: viewportRef,
|
|
745
|
-
"data-slot": THREAD_LIST_VIEWPORT_SLOT,
|
|
746
|
-
className: "flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto",
|
|
747
|
-
children
|
|
748
|
-
}
|
|
749
|
-
) : null
|
|
750
|
-
] });
|
|
751
|
-
}
|
|
752
|
-
function ThreadListContainer({ onThreadOpen } = {}) {
|
|
753
|
-
const aui = useAui2();
|
|
754
|
-
const server = useOptionalServer();
|
|
755
|
-
const isLoading = useAuiState2((s) => s.threads.isLoading);
|
|
756
|
-
const isLoadingMore = useAuiState2((s) => s.threads.isLoadingMore);
|
|
757
|
-
const hasMore = useAuiState2((s) => s.threads.hasMore);
|
|
758
|
-
const threadIds = useAuiState2((s) => s.threads.threadIds);
|
|
759
|
-
const shell = useOptionalShellMode();
|
|
760
|
-
const ThreadListShell2 = useSlot("ThreadListShell");
|
|
761
|
-
const ThreadListNewButton2 = useSlot("ThreadListNewButton");
|
|
762
|
-
const AgentsLibraryButton2 = useSlot("AgentsLibraryButton");
|
|
763
|
-
const SessionsBrowserButton2 = useSlot("SessionsBrowserButton");
|
|
764
|
-
const SchedulesButton2 = useSlot("SchedulesButton");
|
|
765
|
-
const ThreadListRowSkeleton2 = useSlot("ThreadListRowSkeleton");
|
|
766
|
-
const ThreadListEmptyState2 = useSlot("ThreadListEmptyState");
|
|
767
|
-
const viewportRef = useRef2(null);
|
|
768
|
-
const hasMoreRef = useRef2(hasMore);
|
|
769
|
-
const auiRef = useRef2(aui);
|
|
770
|
-
hasMoreRef.current = hasMore;
|
|
771
|
-
auiRef.current = aui;
|
|
772
|
-
const showNewChat = shell?.isNewChatEnabled !== false;
|
|
773
|
-
const isIdle = shell?.mode.status === "idle";
|
|
774
|
-
const canDeleteSession = typeof server?.deleteSession === "function";
|
|
775
|
-
useEffect3(() => {
|
|
776
|
-
if (isIdle || isLoading || isLoadingMore) return;
|
|
777
|
-
const viewport = viewportRef.current;
|
|
778
|
-
if (!viewport) return;
|
|
779
|
-
let cancelled = false;
|
|
780
|
-
const tryLoadMore = () => {
|
|
781
|
-
if (cancelled || !hasMoreRef.current) return;
|
|
782
|
-
if (viewport.clientHeight <= 0) return;
|
|
783
|
-
const remaining = viewport.scrollHeight - viewport.scrollTop - viewport.clientHeight;
|
|
784
|
-
if (viewport.scrollHeight > viewport.clientHeight && remaining > LOAD_MORE_BOTTOM_PX) return;
|
|
785
|
-
void auiRef.current.threads().loadMore();
|
|
786
|
-
};
|
|
787
|
-
viewport.addEventListener("scroll", tryLoadMore, { passive: true });
|
|
788
|
-
const resizeObserver = typeof ResizeObserver === "undefined" ? void 0 : new ResizeObserver(() => tryLoadMore());
|
|
789
|
-
if (resizeObserver) {
|
|
790
|
-
resizeObserver.observe(viewport);
|
|
791
|
-
} else {
|
|
792
|
-
window.addEventListener("resize", tryLoadMore);
|
|
793
|
-
}
|
|
794
|
-
tryLoadMore();
|
|
795
|
-
return () => {
|
|
796
|
-
cancelled = true;
|
|
797
|
-
viewport.removeEventListener("scroll", tryLoadMore);
|
|
798
|
-
resizeObserver?.disconnect();
|
|
799
|
-
if (!resizeObserver) {
|
|
800
|
-
window.removeEventListener("resize", tryLoadMore);
|
|
801
|
-
}
|
|
802
|
-
};
|
|
803
|
-
}, [hasMore, isIdle, isLoading, isLoadingMore, threadIds.length]);
|
|
804
|
-
const handleNewChat = () => {
|
|
805
|
-
onThreadOpen?.();
|
|
806
|
-
shell?.setLibraryOpen(false);
|
|
807
|
-
shell?.setSessionsOpen(false);
|
|
808
|
-
if (shell?.isComposerEnabled) {
|
|
809
|
-
shell.openDraft();
|
|
810
|
-
return;
|
|
811
|
-
}
|
|
812
|
-
shell?.setSettingsOpen(false);
|
|
813
|
-
shell?.setSchedulesOpen(false);
|
|
814
|
-
void Promise.resolve(aui.threads().switchToNewThread()).catch(() => void 0);
|
|
815
|
-
};
|
|
816
|
-
let listBody;
|
|
817
|
-
if (isIdle) {
|
|
818
|
-
listBody = /* @__PURE__ */ jsx12(ThreadListEmptyState2, {});
|
|
819
|
-
} else if (isLoading) {
|
|
820
|
-
listBody = /* @__PURE__ */ jsx12(ThreadListRowSkeleton2, {});
|
|
821
|
-
} else if (threadIds.length === 0) {
|
|
822
|
-
listBody = /* @__PURE__ */ jsx12(ThreadListEmptyState2, {});
|
|
823
|
-
} else {
|
|
824
|
-
listBody = /* @__PURE__ */ jsx12(ThreadListPrimitive.Root, { className: "flex min-h-0 flex-col gap-0.5", children: /* @__PURE__ */ jsx12(ThreadListItemsByRecency, { onThreadOpen, canDeleteSession }) });
|
|
825
|
-
}
|
|
826
|
-
return /* @__PURE__ */ jsx12(
|
|
827
|
-
ThreadListShell2,
|
|
828
|
-
{
|
|
829
|
-
header: /* @__PURE__ */ jsxs8("div", { className: "flex flex-col gap-1", children: [
|
|
830
|
-
showNewChat ? /* @__PURE__ */ jsx12(ThreadListNewButton2, { onClick: handleNewChat }) : null,
|
|
831
|
-
/* @__PURE__ */ jsx12(AgentsLibraryButton2, {}),
|
|
832
|
-
/* @__PURE__ */ jsx12(SessionsBrowserButton2, {}),
|
|
833
|
-
/* @__PURE__ */ jsx12(SchedulesButton2, {})
|
|
834
|
-
] }),
|
|
835
|
-
children: /* @__PURE__ */ jsxs8(ChatHistorySection, { viewportRef, children: [
|
|
836
|
-
listBody,
|
|
837
|
-
!isIdle && hasMore ? /* @__PURE__ */ jsx12("div", { className: "h-4 shrink-0", "aria-hidden": true }) : null
|
|
838
|
-
] })
|
|
839
|
-
}
|
|
840
|
-
);
|
|
841
|
-
}
|
|
842
|
-
|
|
843
406
|
// src/containers/ToolGroupContainer.tsx
|
|
844
|
-
import { useAuiState as
|
|
845
|
-
import { useState as
|
|
846
|
-
import { jsx as
|
|
407
|
+
import { useAuiState as useAuiState2 } from "@assistant-ui/react";
|
|
408
|
+
import { useState as useState2 } from "react";
|
|
409
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
847
410
|
function ToolGroupContainer({ children, group }) {
|
|
848
411
|
const ToolGroupCard2 = useSlot("ToolGroupCard");
|
|
849
412
|
const toolCallCount = group.indices.length;
|
|
850
|
-
const active =
|
|
413
|
+
const active = useAuiState2((s) => {
|
|
851
414
|
if (s.message.status?.type !== "running") return false;
|
|
852
415
|
const lastIndex = s.message.parts.length - 1;
|
|
853
416
|
if (lastIndex < 0) return false;
|
|
@@ -855,13 +418,13 @@ function ToolGroupContainer({ children, group }) {
|
|
|
855
418
|
const lastGroupIndex = group.indices[group.indices.length - 1];
|
|
856
419
|
return lastGroupIndex !== void 0 && lastIndex >= group.indices[0] && lastIndex <= lastGroupIndex;
|
|
857
420
|
});
|
|
858
|
-
const [expanded, setExpanded] =
|
|
859
|
-
const [prevActive, setPrevActive] =
|
|
421
|
+
const [expanded, setExpanded] = useState2(true);
|
|
422
|
+
const [prevActive, setPrevActive] = useState2(active);
|
|
860
423
|
if (active !== prevActive) {
|
|
861
424
|
setPrevActive(active);
|
|
862
425
|
if (active) setExpanded(true);
|
|
863
426
|
}
|
|
864
|
-
return /* @__PURE__ */
|
|
427
|
+
return /* @__PURE__ */ jsx11(
|
|
865
428
|
ToolGroupCard2,
|
|
866
429
|
{
|
|
867
430
|
toolCallCount,
|
|
@@ -875,20 +438,20 @@ function ToolGroupContainer({ children, group }) {
|
|
|
875
438
|
|
|
876
439
|
// src/containers/TrueForgeUI.tsx
|
|
877
440
|
import { lazy, Suspense } from "react";
|
|
878
|
-
import { jsx as
|
|
441
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
879
442
|
var TrueForgeUIWithRouter = lazy(
|
|
880
|
-
() => import("./TrueForgeUIWithRouter-
|
|
443
|
+
() => import("./TrueForgeUIWithRouter-5CDICMCE.js").then((m) => ({ default: m.TrueForgeUIWithRouter }))
|
|
881
444
|
);
|
|
882
445
|
function TrueForgeUI(props) {
|
|
883
446
|
const isMcpAuthScreen = typeof window !== "undefined" && new URLSearchParams(window.location.search).get("screenType") === "mcp-auth";
|
|
884
447
|
if (isMcpAuthScreen) {
|
|
885
|
-
return /* @__PURE__ */
|
|
448
|
+
return /* @__PURE__ */ jsx12(SlotsProvider, { overrides: props.overrides, theme: props.theme, children: /* @__PURE__ */ jsx12(PostMcpOauthScreen_default, {}) });
|
|
886
449
|
}
|
|
887
450
|
const { withRouter, ...rest } = props;
|
|
888
451
|
if (withRouter) {
|
|
889
|
-
return /* @__PURE__ */
|
|
452
|
+
return /* @__PURE__ */ jsx12(Suspense, { fallback: /* @__PURE__ */ jsx12(ServerInitLoader, { className: props.className }), children: /* @__PURE__ */ jsx12(TrueForgeUIWithRouter, { ...rest }) });
|
|
890
453
|
}
|
|
891
|
-
return /* @__PURE__ */
|
|
454
|
+
return /* @__PURE__ */ jsx12(TrueForgeUIShell, { ...rest });
|
|
892
455
|
}
|
|
893
456
|
|
|
894
457
|
// src/index.ts
|
|
@@ -897,6 +460,7 @@ import {
|
|
|
897
460
|
trueFoundryAttachmentAdapter,
|
|
898
461
|
useTrueFoundryAgentRuntime,
|
|
899
462
|
useTrueFoundryAgentSpec,
|
|
463
|
+
useTrueFoundryApprovals,
|
|
900
464
|
useTrueFoundryCancel,
|
|
901
465
|
useTrueFoundryDownloadSandboxFile,
|
|
902
466
|
useTrueFoundryHistoryPagination,
|
|
@@ -911,6 +475,7 @@ export {
|
|
|
911
475
|
AgentConfigEditors,
|
|
912
476
|
AgentConfigPanel,
|
|
913
477
|
AgentConfigSection,
|
|
478
|
+
AgentCustomParametersEditor,
|
|
914
479
|
AgentDetailsHeader,
|
|
915
480
|
AgentDetailsPage,
|
|
916
481
|
AgentDetailsTabs,
|
|
@@ -919,6 +484,7 @@ export {
|
|
|
919
484
|
AgentMcpEditorContent,
|
|
920
485
|
AgentMetricCard,
|
|
921
486
|
AgentMetricChart,
|
|
487
|
+
AgentMetricStatistics,
|
|
922
488
|
AgentMetricsContainer,
|
|
923
489
|
AgentMetricsTimeRangeFilter,
|
|
924
490
|
AgentMetricsView,
|
|
@@ -928,8 +494,8 @@ export {
|
|
|
928
494
|
AgentOverviewCard,
|
|
929
495
|
AgentResourceConfigModal,
|
|
930
496
|
AgentResourceEditorContent,
|
|
497
|
+
AgentRuntimeConfigDrawer,
|
|
931
498
|
AgentRuntimeConfigFields,
|
|
932
|
-
AgentRuntimeConfigModal,
|
|
933
499
|
AgentRuntimeEditorContent,
|
|
934
500
|
AgentSessionsFilters,
|
|
935
501
|
AgentSkillsEditorContent,
|
|
@@ -937,6 +503,8 @@ export {
|
|
|
937
503
|
AgentStepsContainer,
|
|
938
504
|
AgentsLibrary,
|
|
939
505
|
AgentsLibraryButton,
|
|
506
|
+
ApprovalNavBanner,
|
|
507
|
+
ApprovalNavContainer,
|
|
940
508
|
AskUserContainer,
|
|
941
509
|
AssistantMessageBubble,
|
|
942
510
|
AssistantMessageContainer,
|
|
@@ -969,6 +537,7 @@ export {
|
|
|
969
537
|
DraftAgentConfigTrigger,
|
|
970
538
|
DraftCapabilitiesPanel,
|
|
971
539
|
DraftCatalogProvider,
|
|
540
|
+
DraftComposerActionsMenu,
|
|
972
541
|
DraftComposerLeftSection,
|
|
973
542
|
DraftComposerRightSection,
|
|
974
543
|
DraftCompositeSelector,
|
|
@@ -990,16 +559,17 @@ export {
|
|
|
990
559
|
MonacoEditorCore,
|
|
991
560
|
OpenUiFenceBlock,
|
|
992
561
|
PRESETS,
|
|
562
|
+
PermissionGuard,
|
|
993
563
|
PopoverSelect,
|
|
994
564
|
PostMcpOauthScreen_default as PostMcpOauthScreen,
|
|
995
565
|
ReasoningContainer,
|
|
566
|
+
ResponsiveDropdownMenu,
|
|
996
567
|
ResumeUnavailable,
|
|
997
568
|
ResumeUnavailableContainer,
|
|
998
569
|
SandboxArtifactDownload,
|
|
999
570
|
SandboxToolCallCard,
|
|
1000
571
|
SaveAgentButton,
|
|
1001
572
|
SaveAgentForm,
|
|
1002
|
-
SaveAgentFormFields,
|
|
1003
573
|
ScheduleFormDrawer,
|
|
1004
574
|
ScheduleFormFields,
|
|
1005
575
|
ScheduleLastRunsCell,
|
|
@@ -1055,6 +625,7 @@ export {
|
|
|
1055
625
|
TrueForgeUI,
|
|
1056
626
|
TrueFoundryChatProvider,
|
|
1057
627
|
USER_MESSAGE_ATTACHMENT_PREVIEW_REM,
|
|
628
|
+
UserAvatar,
|
|
1058
629
|
UserEditComposerContainer,
|
|
1059
630
|
UserMessageActionBar,
|
|
1060
631
|
UserMessageBubble,
|
|
@@ -1064,6 +635,7 @@ export {
|
|
|
1064
635
|
computeAgentStepsSplit,
|
|
1065
636
|
createTrueFoundryServer,
|
|
1066
637
|
defaultSlots,
|
|
638
|
+
findSubAgentAncestorsForApproval,
|
|
1067
639
|
getErrorMessage,
|
|
1068
640
|
isCreateAgentMetadataValue,
|
|
1069
641
|
libraryAgentId,
|
|
@@ -1079,6 +651,7 @@ export {
|
|
|
1079
651
|
trueFoundryAttachmentAdapter,
|
|
1080
652
|
useAgentMetricsServer,
|
|
1081
653
|
useAgentSessionsServer,
|
|
654
|
+
useApprovalNav,
|
|
1082
655
|
useAui,
|
|
1083
656
|
useAuiState,
|
|
1084
657
|
useBrand,
|
|
@@ -1093,10 +666,13 @@ export {
|
|
|
1093
666
|
useOptionalAgentSessionsServer,
|
|
1094
667
|
useOptionalCatalogServer,
|
|
1095
668
|
useOptionalContentClassNames,
|
|
669
|
+
useOptionalCurrentUser,
|
|
1096
670
|
useOptionalCustomActionRenderers,
|
|
671
|
+
useOptionalPermissionsServer,
|
|
1097
672
|
useOptionalScheduleServer,
|
|
1098
673
|
useOptionalServer,
|
|
1099
674
|
useOptionalShellMode,
|
|
675
|
+
useResourcePermissions,
|
|
1100
676
|
useScheduleServer,
|
|
1101
677
|
useServer,
|
|
1102
678
|
useServerCapabilities,
|
|
@@ -1109,6 +685,7 @@ export {
|
|
|
1109
685
|
useToasterOptional,
|
|
1110
686
|
useTrueFoundryAgentRuntime,
|
|
1111
687
|
useTrueFoundryAgentSpec,
|
|
688
|
+
useTrueFoundryApprovals,
|
|
1112
689
|
useTrueFoundryCancel,
|
|
1113
690
|
useTrueFoundryDownloadSandboxFile,
|
|
1114
691
|
useTrueFoundryHistoryPagination,
|