@truefoundry/trueforge-ui 0.3.0-rc.2 → 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 +50 -0
- package/README.md +17 -9
- package/dist/{AgentCodeSnippets-637HQUXD.js → AgentCodeSnippets-N546FNNS.js} +38 -23
- package/dist/AgentCodeSnippets-N546FNNS.js.map +1 -0
- package/dist/AgentMetricChart-YWJYVYYA.js +15 -0
- package/dist/{AgentOverview-3FJ5EE6N.js → AgentOverview-VF74XC7I.js} +7 -7
- package/dist/{AgentSessionEventTimeline-VELWUYPR.js → AgentSessionEventTimeline-RFR6LQMY.js} +8 -8
- package/dist/{AgentSessionEventTimeline-VELWUYPR.js.map → AgentSessionEventTimeline-RFR6LQMY.js.map} +1 -1
- package/dist/{AgentSessionEventTimelineChart-CUKETHWM.js → AgentSessionEventTimelineChart-27CQF6FX.js} +12 -12
- package/dist/AgentSessionEventTimelineChart-27CQF6FX.js.map +1 -0
- package/dist/{AgentSessions-T7MOGOTZ.js → AgentSessions-4IVX2SGD.js} +36 -12
- package/dist/AgentSessions-4IVX2SGD.js.map +1 -0
- package/dist/{ConnectorSettings-ESZ2RSRG.js → ConnectorSettings-R5VEP7BO.js} +156 -116
- package/dist/ConnectorSettings-R5VEP7BO.js.map +1 -0
- package/dist/{DockLayout-NLFNU6F2.js → DockLayout-F44RWGEY.js} +10 -10
- package/dist/{DrawerLayout-PR3SMKA6.js → DrawerLayout-SQ323AVM.js} +13 -11
- package/dist/DrawerLayout-SQ323AVM.js.map +1 -0
- package/dist/{ModelSettings-LYW64IRR.js → ModelSettings-6QLS63HM.js} +10 -10
- package/dist/{ModelSettings-LYW64IRR.js.map → ModelSettings-6QLS63HM.js.map} +1 -1
- package/dist/OpenUiFenceBlock-4ROX3G4X.js +9 -0
- package/dist/{SandboxSettings-DF64LHYI.js → SandboxSettings-OLKDXIQS.js} +9 -9
- package/dist/SchedulesPage-TMOTK6DR.js +15 -0
- package/dist/{SettingsBuilder-LSXK2VN4.js → SettingsBuilder-GISAH2WU.js} +8 -8
- package/dist/{ShellRouteSync-B22IAV2W.js → ShellRouteSync-EN33DUQ7.js} +157 -22
- package/dist/ShellRouteSync-EN33DUQ7.js.map +1 -0
- package/dist/{SidebarLayout-XW6LXB7R.js → SidebarLayout-35K4AKTC.js} +74 -53
- package/dist/SidebarLayout-35K4AKTC.js.map +1 -0
- package/dist/{SkillSettings-64VXUO6J.js → SkillSettings-JSX2BTII.js} +18 -13
- package/dist/SkillSettings-JSX2BTII.js.map +1 -0
- package/dist/{TrueForgeUIWithRouter-3TSLV22Q.js → TrueForgeUIWithRouter-6VCR7ES3.js} +9 -9
- package/dist/{WidgetLayout-Q5P7PYSJ.js → WidgetLayout-RKBSN2FZ.js} +10 -10
- package/dist/{chunk-YQO2NMJ3.js → chunk-2O5EJ6QS.js} +4096 -2825
- 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-SQGT43Z3.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-LGRHHFHN.js → chunk-F5QVQIBH.js} +166 -45
- package/dist/chunk-F5QVQIBH.js.map +1 -0
- package/dist/{chunk-I3AL54MA.js → chunk-GIPFF6FZ.js} +28 -24
- package/dist/chunk-GIPFF6FZ.js.map +1 -0
- package/dist/{chunk-GXYAOAK5.js → chunk-GSJAYYLR.js} +219 -162
- package/dist/chunk-GSJAYYLR.js.map +1 -0
- package/dist/{chunk-VJ7BZGAF.js → chunk-J5BPHEDT.js} +2 -2
- package/dist/chunk-KR7WYHVF.js +195 -0
- package/dist/chunk-KR7WYHVF.js.map +1 -0
- package/dist/{chunk-VUMGMGKZ.js → chunk-LUG7E6BL.js} +52 -8
- 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-FQK2XVVE.js → chunk-PT4EENB3.js} +224 -72
- package/dist/chunk-PT4EENB3.js.map +1 -0
- package/dist/{chunk-H6WTY5PM.js → chunk-Q6TCT7ZJ.js} +17 -227
- package/dist/chunk-Q6TCT7ZJ.js.map +1 -0
- package/dist/{chunk-5I2COQNL.js → chunk-XLFOXQKZ.js} +13 -11
- package/dist/chunk-XLFOXQKZ.js.map +1 -0
- package/dist/{chunk-G2TUAD65.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 +291 -89
- package/dist/index.js +63 -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 -35
- 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-YWJYVYYA.js.map} +0 -0
- /package/dist/{AgentOverview-3FJ5EE6N.js.map → AgentOverview-VF74XC7I.js.map} +0 -0
- /package/dist/{DockLayout-NLFNU6F2.js.map → DockLayout-F44RWGEY.js.map} +0 -0
- /package/dist/{OpenUiFenceBlock-JEPNPJ7U.js.map → OpenUiFenceBlock-4ROX3G4X.js.map} +0 -0
- /package/dist/{SandboxSettings-DF64LHYI.js.map → SandboxSettings-OLKDXIQS.js.map} +0 -0
- /package/dist/{SchedulesPage-WQU4H25F.js.map → SchedulesPage-TMOTK6DR.js.map} +0 -0
- /package/dist/{SettingsBuilder-LSXK2VN4.js.map → SettingsBuilder-GISAH2WU.js.map} +0 -0
- /package/dist/{TrueForgeUIWithRouter-3TSLV22Q.js.map → TrueForgeUIWithRouter-6VCR7ES3.js.map} +0 -0
- /package/dist/{WidgetLayout-Q5P7PYSJ.js.map → WidgetLayout-RKBSN2FZ.js.map} +0 -0
- /package/dist/{chunk-VJ7BZGAF.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-GXYAOAK5.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,
|
|
@@ -101,11 +108,11 @@ import {
|
|
|
101
108
|
DEFAULT_TABLE_PAGE_SIZE,
|
|
102
109
|
DraftAgentConfigTrigger,
|
|
103
110
|
DraftCapabilitiesPanel,
|
|
111
|
+
DraftComposerActionsMenu,
|
|
104
112
|
DraftComposerLeftSection,
|
|
105
113
|
DraftComposerRightSection,
|
|
106
114
|
DraftCompositeSelector,
|
|
107
115
|
DraftModelSelector,
|
|
108
|
-
DropdownMenuItem,
|
|
109
116
|
HistoryLoader,
|
|
110
117
|
MCP_AUTH_POPUP_CHANNEL,
|
|
111
118
|
Markdown,
|
|
@@ -117,17 +124,17 @@ import {
|
|
|
117
124
|
MessageListSkeleton,
|
|
118
125
|
MessageTimestamp,
|
|
119
126
|
MonacoEditorCore,
|
|
127
|
+
PermissionGuard,
|
|
120
128
|
PopoverSelect,
|
|
121
129
|
ReasoningContainer,
|
|
130
|
+
ResponsiveDropdownMenu,
|
|
122
131
|
ResumeUnavailable,
|
|
123
132
|
SandboxArtifactDownload,
|
|
124
133
|
SandboxToolCallCard,
|
|
125
134
|
SaveAgentButton,
|
|
126
135
|
SaveAgentForm,
|
|
127
|
-
SaveAgentFormFields,
|
|
128
136
|
SchedulesButton,
|
|
129
137
|
ScrollToBottomButton,
|
|
130
|
-
SearchInput_default,
|
|
131
138
|
SelectAgentEmptyState,
|
|
132
139
|
SessionsBrowserButton,
|
|
133
140
|
SessionsPage,
|
|
@@ -165,43 +172,38 @@ import {
|
|
|
165
172
|
ToolCallContentBlockContainer,
|
|
166
173
|
ToolGroupCard,
|
|
167
174
|
USER_MESSAGE_ATTACHMENT_PREVIEW_REM,
|
|
175
|
+
UserAvatar,
|
|
168
176
|
UserMessageActionBar,
|
|
169
177
|
UserMessageBubble,
|
|
170
178
|
UserMessageContainer,
|
|
171
179
|
UserMessageEdit,
|
|
172
180
|
WelcomeScreen,
|
|
173
|
-
canReuseMutableShell,
|
|
174
181
|
computeAgentStepsSplit,
|
|
175
182
|
defaultSlots,
|
|
183
|
+
findSubAgentAncestorsForApproval,
|
|
176
184
|
preloadMarkdownOpenUI,
|
|
177
|
-
readThreadAgentName,
|
|
178
185
|
resolveBrandChrome,
|
|
179
|
-
themePortalRoot,
|
|
180
|
-
threadListIndicesByRecency,
|
|
181
|
-
threadListItemIsMutable,
|
|
182
186
|
useBrandName,
|
|
183
|
-
useIsMobile,
|
|
184
187
|
useMCPAuth,
|
|
185
|
-
|
|
188
|
+
useOptionalCurrentUser,
|
|
189
|
+
useResourcePermissions,
|
|
186
190
|
useSlot,
|
|
187
191
|
useThemeMode,
|
|
188
192
|
useToaster,
|
|
189
193
|
useToasterOptional
|
|
190
|
-
} from "./chunk-
|
|
191
|
-
import "./chunk-
|
|
194
|
+
} from "./chunk-2O5EJ6QS.js";
|
|
195
|
+
import "./chunk-KR7WYHVF.js";
|
|
192
196
|
import {
|
|
193
197
|
DraftCatalogProvider,
|
|
194
198
|
Icon,
|
|
195
|
-
auiButtonClass,
|
|
196
|
-
getErrorMessage,
|
|
197
199
|
registerIcons,
|
|
198
|
-
useCompactLayout,
|
|
199
200
|
useDraftCatalog
|
|
200
|
-
} from "./chunk-
|
|
201
|
+
} from "./chunk-Q6TCT7ZJ.js";
|
|
201
202
|
import {
|
|
202
203
|
DEFAULT_AGENT_CONFIG,
|
|
203
204
|
ServerProvider,
|
|
204
205
|
ShellModeProvider,
|
|
206
|
+
getErrorMessage,
|
|
205
207
|
libraryAgentId,
|
|
206
208
|
shellIsCreateAgent,
|
|
207
209
|
shellIsMutable,
|
|
@@ -211,6 +213,7 @@ import {
|
|
|
211
213
|
useOptionalAgentMetricsServer,
|
|
212
214
|
useOptionalAgentSessionsServer,
|
|
213
215
|
useOptionalCatalogServer,
|
|
216
|
+
useOptionalPermissionsServer,
|
|
214
217
|
useOptionalScheduleServer,
|
|
215
218
|
useOptionalServer,
|
|
216
219
|
useOptionalShellMode,
|
|
@@ -218,25 +221,24 @@ import {
|
|
|
218
221
|
useServer,
|
|
219
222
|
useServerCapabilities,
|
|
220
223
|
useShellMode
|
|
221
|
-
} from "./chunk-
|
|
224
|
+
} from "./chunk-PT4EENB3.js";
|
|
222
225
|
import {
|
|
223
226
|
useAui,
|
|
224
227
|
useAuiState
|
|
225
228
|
} from "./chunk-M6MHLVSO.js";
|
|
226
229
|
import {
|
|
227
230
|
OpenUiFenceBlock
|
|
228
|
-
} from "./chunk-
|
|
231
|
+
} from "./chunk-J5BPHEDT.js";
|
|
229
232
|
import {
|
|
230
233
|
PRESETS,
|
|
231
234
|
ThemeProvider,
|
|
232
|
-
cn,
|
|
233
235
|
resolvePresetTokens,
|
|
234
236
|
useBrand,
|
|
235
237
|
useContentClassNames,
|
|
236
238
|
useOptionalContentClassNames,
|
|
237
239
|
useTheme,
|
|
238
240
|
useThemeIcons
|
|
239
|
-
} from "./chunk-
|
|
241
|
+
} from "./chunk-LXJMINS6.js";
|
|
240
242
|
|
|
241
243
|
// src/icons/agent-2.svg
|
|
242
244
|
import * as React from "react";
|
|
@@ -400,454 +402,14 @@ var PostMcpOauthScreen = () => {
|
|
|
400
402
|
};
|
|
401
403
|
var PostMcpOauthScreen_default = PostMcpOauthScreen;
|
|
402
404
|
|
|
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
405
|
// src/containers/ToolGroupContainer.tsx
|
|
844
|
-
import { useAuiState as
|
|
845
|
-
import { useState as
|
|
846
|
-
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";
|
|
847
409
|
function ToolGroupContainer({ children, group }) {
|
|
848
410
|
const ToolGroupCard2 = useSlot("ToolGroupCard");
|
|
849
411
|
const toolCallCount = group.indices.length;
|
|
850
|
-
const active =
|
|
412
|
+
const active = useAuiState2((s) => {
|
|
851
413
|
if (s.message.status?.type !== "running") return false;
|
|
852
414
|
const lastIndex = s.message.parts.length - 1;
|
|
853
415
|
if (lastIndex < 0) return false;
|
|
@@ -855,13 +417,13 @@ function ToolGroupContainer({ children, group }) {
|
|
|
855
417
|
const lastGroupIndex = group.indices[group.indices.length - 1];
|
|
856
418
|
return lastGroupIndex !== void 0 && lastIndex >= group.indices[0] && lastIndex <= lastGroupIndex;
|
|
857
419
|
});
|
|
858
|
-
const [expanded, setExpanded] =
|
|
859
|
-
const [prevActive, setPrevActive] =
|
|
420
|
+
const [expanded, setExpanded] = useState2(true);
|
|
421
|
+
const [prevActive, setPrevActive] = useState2(active);
|
|
860
422
|
if (active !== prevActive) {
|
|
861
423
|
setPrevActive(active);
|
|
862
424
|
if (active) setExpanded(true);
|
|
863
425
|
}
|
|
864
|
-
return /* @__PURE__ */
|
|
426
|
+
return /* @__PURE__ */ jsx11(
|
|
865
427
|
ToolGroupCard2,
|
|
866
428
|
{
|
|
867
429
|
toolCallCount,
|
|
@@ -875,20 +437,20 @@ function ToolGroupContainer({ children, group }) {
|
|
|
875
437
|
|
|
876
438
|
// src/containers/TrueForgeUI.tsx
|
|
877
439
|
import { lazy, Suspense } from "react";
|
|
878
|
-
import { jsx as
|
|
440
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
879
441
|
var TrueForgeUIWithRouter = lazy(
|
|
880
|
-
() => import("./TrueForgeUIWithRouter-
|
|
442
|
+
() => import("./TrueForgeUIWithRouter-6VCR7ES3.js").then((m) => ({ default: m.TrueForgeUIWithRouter }))
|
|
881
443
|
);
|
|
882
444
|
function TrueForgeUI(props) {
|
|
883
445
|
const isMcpAuthScreen = typeof window !== "undefined" && new URLSearchParams(window.location.search).get("screenType") === "mcp-auth";
|
|
884
446
|
if (isMcpAuthScreen) {
|
|
885
|
-
return /* @__PURE__ */
|
|
447
|
+
return /* @__PURE__ */ jsx12(SlotsProvider, { overrides: props.overrides, theme: props.theme, children: /* @__PURE__ */ jsx12(PostMcpOauthScreen_default, {}) });
|
|
886
448
|
}
|
|
887
449
|
const { withRouter, ...rest } = props;
|
|
888
450
|
if (withRouter) {
|
|
889
|
-
return /* @__PURE__ */
|
|
451
|
+
return /* @__PURE__ */ jsx12(Suspense, { fallback: /* @__PURE__ */ jsx12(ServerInitLoader, { className: props.className }), children: /* @__PURE__ */ jsx12(TrueForgeUIWithRouter, { ...rest }) });
|
|
890
452
|
}
|
|
891
|
-
return /* @__PURE__ */
|
|
453
|
+
return /* @__PURE__ */ jsx12(TrueForgeUIShell, { ...rest });
|
|
892
454
|
}
|
|
893
455
|
|
|
894
456
|
// src/index.ts
|
|
@@ -897,6 +459,7 @@ import {
|
|
|
897
459
|
trueFoundryAttachmentAdapter,
|
|
898
460
|
useTrueFoundryAgentRuntime,
|
|
899
461
|
useTrueFoundryAgentSpec,
|
|
462
|
+
useTrueFoundryApprovals,
|
|
900
463
|
useTrueFoundryCancel,
|
|
901
464
|
useTrueFoundryDownloadSandboxFile,
|
|
902
465
|
useTrueFoundryHistoryPagination,
|
|
@@ -911,6 +474,7 @@ export {
|
|
|
911
474
|
AgentConfigEditors,
|
|
912
475
|
AgentConfigPanel,
|
|
913
476
|
AgentConfigSection,
|
|
477
|
+
AgentCustomParametersEditor,
|
|
914
478
|
AgentDetailsHeader,
|
|
915
479
|
AgentDetailsPage,
|
|
916
480
|
AgentDetailsTabs,
|
|
@@ -928,8 +492,8 @@ export {
|
|
|
928
492
|
AgentOverviewCard,
|
|
929
493
|
AgentResourceConfigModal,
|
|
930
494
|
AgentResourceEditorContent,
|
|
495
|
+
AgentRuntimeConfigDrawer,
|
|
931
496
|
AgentRuntimeConfigFields,
|
|
932
|
-
AgentRuntimeConfigModal,
|
|
933
497
|
AgentRuntimeEditorContent,
|
|
934
498
|
AgentSessionsFilters,
|
|
935
499
|
AgentSkillsEditorContent,
|
|
@@ -937,6 +501,8 @@ export {
|
|
|
937
501
|
AgentStepsContainer,
|
|
938
502
|
AgentsLibrary,
|
|
939
503
|
AgentsLibraryButton,
|
|
504
|
+
ApprovalNavBanner,
|
|
505
|
+
ApprovalNavContainer,
|
|
940
506
|
AskUserContainer,
|
|
941
507
|
AssistantMessageBubble,
|
|
942
508
|
AssistantMessageContainer,
|
|
@@ -969,6 +535,7 @@ export {
|
|
|
969
535
|
DraftAgentConfigTrigger,
|
|
970
536
|
DraftCapabilitiesPanel,
|
|
971
537
|
DraftCatalogProvider,
|
|
538
|
+
DraftComposerActionsMenu,
|
|
972
539
|
DraftComposerLeftSection,
|
|
973
540
|
DraftComposerRightSection,
|
|
974
541
|
DraftCompositeSelector,
|
|
@@ -990,16 +557,17 @@ export {
|
|
|
990
557
|
MonacoEditorCore,
|
|
991
558
|
OpenUiFenceBlock,
|
|
992
559
|
PRESETS,
|
|
560
|
+
PermissionGuard,
|
|
993
561
|
PopoverSelect,
|
|
994
562
|
PostMcpOauthScreen_default as PostMcpOauthScreen,
|
|
995
563
|
ReasoningContainer,
|
|
564
|
+
ResponsiveDropdownMenu,
|
|
996
565
|
ResumeUnavailable,
|
|
997
566
|
ResumeUnavailableContainer,
|
|
998
567
|
SandboxArtifactDownload,
|
|
999
568
|
SandboxToolCallCard,
|
|
1000
569
|
SaveAgentButton,
|
|
1001
570
|
SaveAgentForm,
|
|
1002
|
-
SaveAgentFormFields,
|
|
1003
571
|
ScheduleFormDrawer,
|
|
1004
572
|
ScheduleFormFields,
|
|
1005
573
|
ScheduleLastRunsCell,
|
|
@@ -1055,6 +623,7 @@ export {
|
|
|
1055
623
|
TrueForgeUI,
|
|
1056
624
|
TrueFoundryChatProvider,
|
|
1057
625
|
USER_MESSAGE_ATTACHMENT_PREVIEW_REM,
|
|
626
|
+
UserAvatar,
|
|
1058
627
|
UserEditComposerContainer,
|
|
1059
628
|
UserMessageActionBar,
|
|
1060
629
|
UserMessageBubble,
|
|
@@ -1064,6 +633,7 @@ export {
|
|
|
1064
633
|
computeAgentStepsSplit,
|
|
1065
634
|
createTrueFoundryServer,
|
|
1066
635
|
defaultSlots,
|
|
636
|
+
findSubAgentAncestorsForApproval,
|
|
1067
637
|
getErrorMessage,
|
|
1068
638
|
isCreateAgentMetadataValue,
|
|
1069
639
|
libraryAgentId,
|
|
@@ -1079,6 +649,7 @@ export {
|
|
|
1079
649
|
trueFoundryAttachmentAdapter,
|
|
1080
650
|
useAgentMetricsServer,
|
|
1081
651
|
useAgentSessionsServer,
|
|
652
|
+
useApprovalNav,
|
|
1082
653
|
useAui,
|
|
1083
654
|
useAuiState,
|
|
1084
655
|
useBrand,
|
|
@@ -1093,10 +664,13 @@ export {
|
|
|
1093
664
|
useOptionalAgentSessionsServer,
|
|
1094
665
|
useOptionalCatalogServer,
|
|
1095
666
|
useOptionalContentClassNames,
|
|
667
|
+
useOptionalCurrentUser,
|
|
1096
668
|
useOptionalCustomActionRenderers,
|
|
669
|
+
useOptionalPermissionsServer,
|
|
1097
670
|
useOptionalScheduleServer,
|
|
1098
671
|
useOptionalServer,
|
|
1099
672
|
useOptionalShellMode,
|
|
673
|
+
useResourcePermissions,
|
|
1100
674
|
useScheduleServer,
|
|
1101
675
|
useServer,
|
|
1102
676
|
useServerCapabilities,
|
|
@@ -1109,6 +683,7 @@ export {
|
|
|
1109
683
|
useToasterOptional,
|
|
1110
684
|
useTrueFoundryAgentRuntime,
|
|
1111
685
|
useTrueFoundryAgentSpec,
|
|
686
|
+
useTrueFoundryApprovals,
|
|
1112
687
|
useTrueFoundryCancel,
|
|
1113
688
|
useTrueFoundryDownloadSandboxFile,
|
|
1114
689
|
useTrueFoundryHistoryPagination,
|