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