@truefoundry/trueforge-ui 0.3.0-rc.0 → 0.3.0-rc.2
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 +68 -0
- package/README.md +21 -6
- package/dist/AgentCodeSnippets-637HQUXD.js +74 -0
- package/dist/AgentCodeSnippets-637HQUXD.js.map +1 -0
- package/dist/AgentMetricChart-4FYECRIN.js +15 -0
- package/dist/AgentOverview-3FJ5EE6N.js +167 -0
- package/dist/AgentOverview-3FJ5EE6N.js.map +1 -0
- package/dist/AgentSessionEventTimeline-VELWUYPR.js +88 -0
- package/dist/AgentSessionEventTimeline-VELWUYPR.js.map +1 -0
- package/dist/AgentSessionEventTimelineChart-CUKETHWM.js +591 -0
- package/dist/AgentSessionEventTimelineChart-CUKETHWM.js.map +1 -0
- package/dist/AgentSessions-T7MOGOTZ.js +275 -0
- package/dist/AgentSessions-T7MOGOTZ.js.map +1 -0
- package/dist/{ConnectorSettings-FXQ5B7TN.js → ConnectorSettings-ESZ2RSRG.js} +19 -21
- package/dist/ConnectorSettings-ESZ2RSRG.js.map +1 -0
- package/dist/{DockLayout-LBNQJZNF.js → DockLayout-NLFNU6F2.js} +11 -10
- package/dist/{DockLayout-LBNQJZNF.js.map → DockLayout-NLFNU6F2.js.map} +1 -1
- package/dist/DrawerLayout-PR3SMKA6.js +184 -0
- package/dist/DrawerLayout-PR3SMKA6.js.map +1 -0
- package/dist/{ModelSettings-4L4LOQJA.js → ModelSettings-LYW64IRR.js} +20 -24
- package/dist/ModelSettings-LYW64IRR.js.map +1 -0
- package/dist/OpenUiFenceBlock-JEPNPJ7U.js +9 -0
- package/dist/OpenUiFenceBlock-JEPNPJ7U.js.map +1 -0
- package/dist/{SandboxSettings-Z4ZG6ZX4.js → SandboxSettings-DF64LHYI.js} +16 -18
- package/dist/SandboxSettings-DF64LHYI.js.map +1 -0
- package/dist/SchedulesPage-WQU4H25F.js +15 -0
- package/dist/SchedulesPage-WQU4H25F.js.map +1 -0
- package/dist/{SettingsBuilder-WF7ZWKQW.js → SettingsBuilder-LSXK2VN4.js} +26 -22
- package/dist/SettingsBuilder-LSXK2VN4.js.map +1 -0
- package/dist/ShellRouteSync-B22IAV2W.js +255 -0
- package/dist/ShellRouteSync-B22IAV2W.js.map +1 -0
- package/dist/SidebarLayout-XW6LXB7R.js +309 -0
- package/dist/SidebarLayout-XW6LXB7R.js.map +1 -0
- package/dist/{SkillSettings-3EPPC3IT.js → SkillSettings-64VXUO6J.js} +14 -15
- package/dist/SkillSettings-64VXUO6J.js.map +1 -0
- package/dist/{TrueForgeUIWithRouter-NZ4FGPE4.js → TrueForgeUIWithRouter-3TSLV22Q.js} +14 -10
- package/dist/{TrueForgeUIWithRouter-NZ4FGPE4.js.map → TrueForgeUIWithRouter-3TSLV22Q.js.map} +1 -1
- package/dist/{WidgetLayout-3QZ357FL.js → WidgetLayout-Q5P7PYSJ.js} +17 -13
- package/dist/WidgetLayout-Q5P7PYSJ.js.map +1 -0
- package/dist/chunk-5I2COQNL.js +119 -0
- package/dist/chunk-5I2COQNL.js.map +1 -0
- package/dist/chunk-BWHOZFIV.js +587 -0
- package/dist/chunk-BWHOZFIV.js.map +1 -0
- package/dist/chunk-DJUFS2BW.js +27 -0
- package/dist/chunk-DJUFS2BW.js.map +1 -0
- package/dist/chunk-FQK2XVVE.js +880 -0
- package/dist/chunk-FQK2XVVE.js.map +1 -0
- package/dist/chunk-G2TUAD65.js +555 -0
- package/dist/chunk-G2TUAD65.js.map +1 -0
- package/dist/chunk-GXYAOAK5.js +1357 -0
- package/dist/chunk-GXYAOAK5.js.map +1 -0
- package/dist/{chunk-FJ5RSSMA.js → chunk-H6WTY5PM.js} +196 -32
- package/dist/chunk-H6WTY5PM.js.map +1 -0
- package/dist/chunk-I3AL54MA.js +180 -0
- package/dist/chunk-I3AL54MA.js.map +1 -0
- package/dist/{chunk-WREC7D54.js → chunk-LGRHHFHN.js} +120 -32
- package/dist/chunk-LGRHHFHN.js.map +1 -0
- package/dist/chunk-NHHSZB5N.js +74 -0
- package/dist/chunk-NHHSZB5N.js.map +1 -0
- package/dist/{chunk-CFLVPV5M.js → chunk-QC42MLAK.js} +7 -2
- package/dist/chunk-QC42MLAK.js.map +1 -0
- package/dist/chunk-RDXBMTP5.js +32 -0
- package/dist/chunk-RDXBMTP5.js.map +1 -0
- package/dist/chunk-SFZNIO6U.js +18 -0
- package/dist/chunk-SFZNIO6U.js.map +1 -0
- package/dist/chunk-SQGT43Z3.js +200 -0
- package/dist/chunk-SQGT43Z3.js.map +1 -0
- package/dist/{chunk-B52K63AW.js → chunk-VJ7BZGAF.js} +2 -2
- package/dist/chunk-VUMGMGKZ.js +252 -0
- package/dist/chunk-VUMGMGKZ.js.map +1 -0
- package/dist/chunk-Y6S4OVVQ.js +16 -0
- package/dist/chunk-Y6S4OVVQ.js.map +1 -0
- package/dist/chunk-YQO2NMJ3.js +13341 -0
- package/dist/chunk-YQO2NMJ3.js.map +1 -0
- package/dist/{createTrueFoundryServer-B72bU-J7.d.ts → createTrueFoundryServer-CmZnBh_l.d.ts} +15 -4
- package/dist/index.d.ts +1024 -24
- package/dist/index.js +691 -67
- package/dist/index.js.map +1 -1
- package/dist/plugins/trueforge-agent-server-adapter/index.d.ts +552 -8
- package/dist/plugins/trueforge-agent-server-adapter/index.js +504 -188
- package/dist/plugins/trueforge-agent-server-adapter/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +9 -8
- package/dist/ConnectorSettings-FXQ5B7TN.js.map +0 -1
- package/dist/DrawerLayout-Q6UK4VMI.js +0 -159
- package/dist/DrawerLayout-Q6UK4VMI.js.map +0 -1
- package/dist/ModelSettings-4L4LOQJA.js.map +0 -1
- package/dist/OpenUiFenceBlock-6UIIAVBX.js +0 -9
- package/dist/SandboxSettings-Z4ZG6ZX4.js.map +0 -1
- package/dist/SettingsBuilder-WF7ZWKQW.js.map +0 -1
- package/dist/ShellRouteSync-T4WLY57Q.js +0 -172
- package/dist/ShellRouteSync-T4WLY57Q.js.map +0 -1
- package/dist/SidebarLayout-3WZ3CVON.js +0 -256
- package/dist/SidebarLayout-3WZ3CVON.js.map +0 -1
- package/dist/SkillSettings-3EPPC3IT.js.map +0 -1
- package/dist/WidgetLayout-3QZ357FL.js.map +0 -1
- package/dist/chunk-36KOSC2J.js +0 -567
- package/dist/chunk-36KOSC2J.js.map +0 -1
- package/dist/chunk-3S6KHO7H.js +0 -2121
- package/dist/chunk-3S6KHO7H.js.map +0 -1
- package/dist/chunk-7L63OK3O.js +0 -91
- package/dist/chunk-7L63OK3O.js.map +0 -1
- package/dist/chunk-CFLVPV5M.js.map +0 -1
- package/dist/chunk-FJ5RSSMA.js.map +0 -1
- package/dist/chunk-OSV3HI5M.js +0 -6891
- package/dist/chunk-OSV3HI5M.js.map +0 -1
- package/dist/chunk-WQULF5AT.js +0 -460
- package/dist/chunk-WQULF5AT.js.map +0 -1
- package/dist/chunk-WREC7D54.js.map +0 -1
- package/dist/chunk-YIWUG6MC.js +0 -101
- package/dist/chunk-YIWUG6MC.js.map +0 -1
- package/dist/chunk-ZXOADNF3.js +0 -75
- package/dist/chunk-ZXOADNF3.js.map +0 -1
- /package/dist/{OpenUiFenceBlock-6UIIAVBX.js.map → AgentMetricChart-4FYECRIN.js.map} +0 -0
- /package/dist/{chunk-B52K63AW.js.map → chunk-VJ7BZGAF.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,35 +1,23 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
|
-
AgentStepsContainer,
|
|
4
3
|
AskUserContainer,
|
|
5
|
-
AssistantMessageContainer,
|
|
6
|
-
AssistantTextContainer,
|
|
7
|
-
ComposerAttachmentPickerContainer,
|
|
8
|
-
ComposerAttachmentsContainer,
|
|
9
4
|
ComposerContainer,
|
|
10
5
|
CustomActionContainer,
|
|
11
6
|
HistoryLoaderContainer,
|
|
12
7
|
McpAuthContainer,
|
|
13
|
-
MessageAttachmentsContainer,
|
|
14
|
-
ReasoningContainer,
|
|
15
8
|
ResumeUnavailableContainer,
|
|
16
9
|
Thread,
|
|
17
10
|
ThreadContainer,
|
|
18
|
-
ThreadListContainer,
|
|
19
|
-
ToolApprovalContainer,
|
|
20
|
-
ToolCallContainer,
|
|
21
|
-
ToolCallContentBlockContainer,
|
|
22
11
|
UserEditComposerContainer,
|
|
23
|
-
UserMessageContainer,
|
|
24
|
-
computeAgentStepsSplit,
|
|
25
12
|
threadHasPendingMcpAuth,
|
|
26
13
|
useComposerPauseView
|
|
27
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-G2TUAD65.js";
|
|
28
15
|
import {
|
|
29
16
|
ServerInitLoader,
|
|
30
17
|
TrueForgeUIShell,
|
|
31
18
|
TrueFoundryChatProvider
|
|
32
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-LGRHHFHN.js";
|
|
20
|
+
import "./chunk-DJUFS2BW.js";
|
|
33
21
|
import {
|
|
34
22
|
ComposerBusyProvider,
|
|
35
23
|
CustomActionRenderersProvider,
|
|
@@ -37,17 +25,60 @@ import {
|
|
|
37
25
|
useOptionalCustomActionRenderers
|
|
38
26
|
} from "./chunk-BSIPI3KV.js";
|
|
39
27
|
import {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
28
|
+
AgentMetricChart
|
|
29
|
+
} from "./chunk-5I2COQNL.js";
|
|
30
|
+
import {
|
|
31
|
+
ScheduleFormDrawer,
|
|
32
|
+
ScheduleFormFields,
|
|
33
|
+
ScheduleLastRunsCell,
|
|
34
|
+
ScheduleRunChip,
|
|
35
|
+
ScheduleStatusBadge,
|
|
36
|
+
SchedulesPage,
|
|
37
|
+
TestScheduleScreen
|
|
38
|
+
} from "./chunk-GXYAOAK5.js";
|
|
43
39
|
import {
|
|
44
40
|
createTrueFoundryServer
|
|
45
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-QC42MLAK.js";
|
|
42
|
+
import "./chunk-Y6S4OVVQ.js";
|
|
43
|
+
import {
|
|
44
|
+
IS_CREATE_AGENT_METADATA_KEY,
|
|
45
|
+
isCreateAgentMetadataValue,
|
|
46
|
+
readSessionIsCreateAgent,
|
|
47
|
+
sessionIsCreateAgent
|
|
48
|
+
} from "./chunk-RDXBMTP5.js";
|
|
46
49
|
import {
|
|
50
|
+
AgentCodeBlock,
|
|
51
|
+
AgentConfigEditors,
|
|
52
|
+
AgentConfigPanel,
|
|
53
|
+
AgentConfigSection,
|
|
54
|
+
AgentDetailsHeader,
|
|
55
|
+
AgentDetailsPage,
|
|
56
|
+
AgentDetailsTabs,
|
|
57
|
+
AgentDetailsUnavailable,
|
|
58
|
+
AgentInstructionsDrawer,
|
|
59
|
+
AgentMcpEditorContent,
|
|
60
|
+
AgentMetricCard,
|
|
61
|
+
AgentMetricsContainer,
|
|
62
|
+
AgentMetricsTimeRangeFilter,
|
|
63
|
+
AgentMetricsView,
|
|
64
|
+
AgentModelConfigModal,
|
|
65
|
+
AgentModelEditorContent,
|
|
66
|
+
AgentModelSettingsContent,
|
|
67
|
+
AgentOverviewCard,
|
|
68
|
+
AgentResourceConfigModal,
|
|
69
|
+
AgentResourceEditorContent,
|
|
70
|
+
AgentRuntimeConfigFields,
|
|
71
|
+
AgentRuntimeConfigModal,
|
|
72
|
+
AgentRuntimeEditorContent,
|
|
73
|
+
AgentSessionsFilters,
|
|
74
|
+
AgentSkillsEditorContent,
|
|
47
75
|
AgentStepsCard,
|
|
76
|
+
AgentStepsContainer,
|
|
48
77
|
AgentsLibrary,
|
|
49
78
|
AgentsLibraryButton,
|
|
50
79
|
AssistantMessageBubble,
|
|
80
|
+
AssistantMessageContainer,
|
|
81
|
+
AssistantTextContainer,
|
|
51
82
|
AttachmentCard,
|
|
52
83
|
AttachmentPickerButton,
|
|
53
84
|
AttachmentPreviewDialog,
|
|
@@ -56,39 +87,65 @@ import {
|
|
|
56
87
|
AvatarImage,
|
|
57
88
|
BottomSheet,
|
|
58
89
|
BrandLogo,
|
|
90
|
+
Button,
|
|
59
91
|
CenteredModal,
|
|
60
92
|
ChatFileDownload,
|
|
61
93
|
ClearChatButton,
|
|
62
94
|
CodeEditor,
|
|
95
|
+
ComposerAttachmentPickerContainer,
|
|
96
|
+
ComposerAttachmentsContainer,
|
|
63
97
|
ComposerLeftSection,
|
|
64
98
|
ComposerRightSection,
|
|
65
99
|
ComposerSendButton,
|
|
66
100
|
ComposerShell,
|
|
101
|
+
DEFAULT_TABLE_PAGE_SIZE,
|
|
102
|
+
DraftAgentConfigTrigger,
|
|
103
|
+
DraftCapabilitiesPanel,
|
|
67
104
|
DraftComposerLeftSection,
|
|
68
105
|
DraftComposerRightSection,
|
|
69
106
|
DraftCompositeSelector,
|
|
70
107
|
DraftModelSelector,
|
|
108
|
+
DropdownMenuItem,
|
|
71
109
|
HistoryLoader,
|
|
72
110
|
MCP_AUTH_POPUP_CHANNEL,
|
|
73
111
|
Markdown,
|
|
74
112
|
MessageActionBar,
|
|
113
|
+
MessageAttachmentsContainer,
|
|
75
114
|
MessageErrorBanner,
|
|
76
115
|
MessageGroup,
|
|
77
116
|
MessageIndicator,
|
|
78
117
|
MessageListSkeleton,
|
|
79
118
|
MessageTimestamp,
|
|
80
119
|
MonacoEditorCore,
|
|
120
|
+
PopoverSelect,
|
|
121
|
+
ReasoningContainer,
|
|
81
122
|
ResumeUnavailable,
|
|
82
123
|
SandboxArtifactDownload,
|
|
83
124
|
SandboxToolCallCard,
|
|
84
125
|
SaveAgentButton,
|
|
126
|
+
SaveAgentForm,
|
|
127
|
+
SaveAgentFormFields,
|
|
128
|
+
SchedulesButton,
|
|
85
129
|
ScrollToBottomButton,
|
|
130
|
+
SearchInput_default,
|
|
86
131
|
SelectAgentEmptyState,
|
|
132
|
+
SessionsBrowserButton,
|
|
133
|
+
SessionsPage,
|
|
87
134
|
ShellActionsActionSlot,
|
|
135
|
+
SideDrawer,
|
|
88
136
|
SlotsProvider,
|
|
89
137
|
SubAgentCard,
|
|
90
138
|
Switch,
|
|
91
139
|
SyntaxHighlighter,
|
|
140
|
+
TABLE_PAGE_SIZE_OPTIONS,
|
|
141
|
+
Table,
|
|
142
|
+
TableBody,
|
|
143
|
+
TableCell,
|
|
144
|
+
TableHead,
|
|
145
|
+
TableHeader,
|
|
146
|
+
TablePagination,
|
|
147
|
+
TableRow,
|
|
148
|
+
TableTokenPagination,
|
|
92
149
|
ThreadComposerAreaShell,
|
|
93
150
|
ThreadListEmptyState,
|
|
94
151
|
ThreadListNewButton,
|
|
@@ -101,58 +158,85 @@ import {
|
|
|
101
158
|
ToastStack,
|
|
102
159
|
ToasterProvider,
|
|
103
160
|
ToolApprovalBar,
|
|
161
|
+
ToolApprovalContainer,
|
|
104
162
|
ToolCallCard,
|
|
163
|
+
ToolCallContainer,
|
|
105
164
|
ToolCallContentBlock,
|
|
165
|
+
ToolCallContentBlockContainer,
|
|
106
166
|
ToolGroupCard,
|
|
107
167
|
USER_MESSAGE_ATTACHMENT_PREVIEW_REM,
|
|
108
168
|
UserMessageActionBar,
|
|
109
169
|
UserMessageBubble,
|
|
170
|
+
UserMessageContainer,
|
|
110
171
|
UserMessageEdit,
|
|
111
172
|
WelcomeScreen,
|
|
173
|
+
canReuseMutableShell,
|
|
174
|
+
computeAgentStepsSplit,
|
|
112
175
|
defaultSlots,
|
|
113
176
|
preloadMarkdownOpenUI,
|
|
177
|
+
readThreadAgentName,
|
|
114
178
|
resolveBrandChrome,
|
|
179
|
+
themePortalRoot,
|
|
180
|
+
threadListIndicesByRecency,
|
|
181
|
+
threadListItemIsMutable,
|
|
115
182
|
useBrandName,
|
|
183
|
+
useIsMobile,
|
|
116
184
|
useMCPAuth,
|
|
185
|
+
useSearchAgentsList,
|
|
117
186
|
useSlot,
|
|
118
187
|
useThemeMode,
|
|
119
188
|
useToaster,
|
|
120
189
|
useToasterOptional
|
|
121
|
-
} from "./chunk-
|
|
190
|
+
} from "./chunk-YQO2NMJ3.js";
|
|
191
|
+
import "./chunk-NHHSZB5N.js";
|
|
122
192
|
import {
|
|
123
193
|
DraftCatalogProvider,
|
|
124
194
|
Icon,
|
|
195
|
+
auiButtonClass,
|
|
125
196
|
getErrorMessage,
|
|
126
197
|
registerIcons,
|
|
198
|
+
useCompactLayout,
|
|
127
199
|
useDraftCatalog
|
|
128
|
-
} from "./chunk-
|
|
200
|
+
} from "./chunk-H6WTY5PM.js";
|
|
129
201
|
import {
|
|
130
202
|
DEFAULT_AGENT_CONFIG,
|
|
131
203
|
ServerProvider,
|
|
132
204
|
ShellModeProvider,
|
|
133
205
|
libraryAgentId,
|
|
206
|
+
shellIsCreateAgent,
|
|
134
207
|
shellIsMutable,
|
|
208
|
+
useAgentMetricsServer,
|
|
209
|
+
useAgentSessionsServer,
|
|
135
210
|
useCatalogServer,
|
|
211
|
+
useOptionalAgentMetricsServer,
|
|
212
|
+
useOptionalAgentSessionsServer,
|
|
136
213
|
useOptionalCatalogServer,
|
|
214
|
+
useOptionalScheduleServer,
|
|
137
215
|
useOptionalServer,
|
|
138
216
|
useOptionalShellMode,
|
|
217
|
+
useScheduleServer,
|
|
139
218
|
useServer,
|
|
140
219
|
useServerCapabilities,
|
|
141
220
|
useShellMode
|
|
142
|
-
} from "./chunk-
|
|
221
|
+
} from "./chunk-FQK2XVVE.js";
|
|
222
|
+
import {
|
|
223
|
+
useAui,
|
|
224
|
+
useAuiState
|
|
225
|
+
} from "./chunk-M6MHLVSO.js";
|
|
143
226
|
import {
|
|
144
227
|
OpenUiFenceBlock
|
|
145
|
-
} from "./chunk-
|
|
228
|
+
} from "./chunk-VJ7BZGAF.js";
|
|
146
229
|
import {
|
|
147
230
|
PRESETS,
|
|
148
231
|
ThemeProvider,
|
|
232
|
+
cn,
|
|
149
233
|
resolvePresetTokens,
|
|
150
234
|
useBrand,
|
|
151
235
|
useContentClassNames,
|
|
152
236
|
useOptionalContentClassNames,
|
|
153
237
|
useTheme,
|
|
154
238
|
useThemeIcons
|
|
155
|
-
} from "./chunk-
|
|
239
|
+
} from "./chunk-BWHOZFIV.js";
|
|
156
240
|
|
|
157
241
|
// src/icons/agent-2.svg
|
|
158
242
|
import * as React from "react";
|
|
@@ -184,47 +268,65 @@ import { jsx as jsx4 } from "react/jsx-runtime";
|
|
|
184
268
|
var SvgCompare = (props) => /* @__PURE__ */ jsx4("svg", { width: "1em", height: "1em", viewBox: "0 0 14 17", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: /* @__PURE__ */ jsx4("path", { d: "M5.09091 16.5V15.0455H1.45455C1.05455 15.0455 0.712121 14.903 0.427273 14.6182C0.142424 14.3333 0 13.9909 0 13.5909V3.40909C0 3.00909 0.142424 2.66667 0.427273 2.38182C0.712121 2.09697 1.05455 1.95455 1.45455 1.95455H5.09091V0.5H6.54545V16.5H5.09091ZM8 15.0455V13.5909L11.6364 13.5909V3.40909H8V1.95455H11.6364C12.0364 1.95455 12.3788 2.09697 12.6636 2.38182C12.9485 2.66667 13.0909 3.00909 13.0909 3.40909V13.5909C13.0909 13.9909 12.9485 14.3333 12.6636 14.6182C12.3788 14.903 12.0364 15.0455 11.6364 15.0455H8Z", fill: "currentColor" }) });
|
|
185
269
|
var compare_default = SvgCompare;
|
|
186
270
|
|
|
187
|
-
// src/icons/
|
|
271
|
+
// src/icons/empty.svg
|
|
188
272
|
import * as React5 from "react";
|
|
189
273
|
import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
190
|
-
var
|
|
191
|
-
/* @__PURE__ */
|
|
192
|
-
|
|
193
|
-
|
|
274
|
+
var SvgEmpty = (props) => /* @__PURE__ */ jsxs2("svg", { width: "1em", height: "1em", viewBox: "0 0 22 25", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [
|
|
275
|
+
/* @__PURE__ */ jsx5("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M10.4824 12.432L21.0265 6.20004L10.5441 0L0 6.20004L10.4824 12.432Z", fill: "#ECF2F9" }),
|
|
276
|
+
/* @__PURE__ */ jsx5("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M10.4729 11.7499L19.75 6.23584L10.5271 0.749939L1.25 6.23584L10.4729 11.7499Z", fill: "#FDFEFF" }),
|
|
277
|
+
/* @__PURE__ */ jsx5("path", { d: "M10.5 11.7499V0.749939L19.75 6.24994L10.5 11.7499Z", fill: "url(#paint0_linear_10651_178757)" }),
|
|
278
|
+
/* @__PURE__ */ jsx5("path", { d: "M10.5 11.7499V0.749939L1.25 6.24994L10.5 11.7499Z", fill: "#0E1623" }),
|
|
279
|
+
/* @__PURE__ */ jsx5("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M0 6.20001V18.686L10.5441 25V12.4319L0 6.20001Z", fill: "#CEE0F8" }),
|
|
280
|
+
/* @__PURE__ */ jsx5("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M21.0265 6.20001V18.686L10.4824 25V12.4319L21.0265 6.20001Z", fill: "#82A0CE" }),
|
|
281
|
+
/* @__PURE__ */ jsx5("path", { d: "M10.4973 11.7478L4.64099 8.26706V8.95172L10.4973 12.4126L15.8148 9.27748V8.59062L10.4973 11.7478Z", fill: "#ECF2F9" }),
|
|
282
|
+
/* @__PURE__ */ jsx5("defs", { children: /* @__PURE__ */ jsxs2("linearGradient", { id: "paint0_linear_10651_178757", x1: 15.0834, y1: 2.10412, x2: 15.125, y2: 11.7499, gradientUnits: "userSpaceOnUse", children: [
|
|
283
|
+
/* @__PURE__ */ jsx5("stop", { stopColor: "#5E7BAA" }),
|
|
284
|
+
/* @__PURE__ */ jsx5("stop", { offset: 1, stopColor: "#030407" })
|
|
285
|
+
] }) })
|
|
286
|
+
] });
|
|
287
|
+
var empty_default = SvgEmpty;
|
|
288
|
+
|
|
289
|
+
// src/icons/mcp-server.svg
|
|
290
|
+
import * as React6 from "react";
|
|
291
|
+
import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
292
|
+
var SvgMcpServer = (props) => /* @__PURE__ */ jsxs3("svg", { width: "1em", height: "1em", viewBox: "0 0 14 14", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", ...props, children: [
|
|
293
|
+
/* @__PURE__ */ jsxs3("g", { clipPath: "url(#clip0_5446_3655)", children: [
|
|
294
|
+
/* @__PURE__ */ jsx6("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M9.15174 1.36702C8.86989 1.09272 8.49212 0.939234 8.09883 0.939234C7.70553 0.939234 7.32776 1.09272 7.04591 1.36702L1.43074 6.87369C1.33678 6.96502 1.21091 7.01611 1.07987 7.01611C0.948831 7.01611 0.822958 6.96502 0.728994 6.87369C0.68299 6.82895 0.646423 6.77544 0.621453 6.71633C0.596483 6.65721 0.583618 6.59369 0.583618 6.52952C0.583618 6.46535 0.596483 6.40183 0.621453 6.34272C0.646423 6.2836 0.68299 6.23009 0.728994 6.18536L6.34416 0.678689C6.81387 0.221585 7.44341 -0.0341797 8.09883 -0.0341797C8.75424 -0.0341797 9.38379 0.221585 9.85349 0.678689C10.1253 0.943 10.3306 1.26791 10.4527 1.62683C10.5748 1.98575 10.6101 2.36848 10.5558 2.74369C10.936 2.68962 11.3235 2.72356 11.6885 2.8429C12.0535 2.96224 12.3863 3.16379 12.6611 3.43202L12.6902 3.46119C12.9203 3.68489 13.1031 3.95243 13.2279 4.248C13.3528 4.54357 13.4171 4.86117 13.4171 5.18202C13.4171 5.50288 13.3528 5.82048 13.2279 6.11605C13.1031 6.41162 12.9203 6.67916 12.6902 6.90286L7.61174 11.8828C7.59642 11.8977 7.58423 11.9155 7.57591 11.9352C7.56759 11.9549 7.5633 11.976 7.5633 11.9974C7.5633 12.0188 7.56759 12.0399 7.57591 12.0596C7.58423 12.0793 7.59642 12.0971 7.61174 12.112L8.65474 13.1352C8.70075 13.1799 8.73731 13.2334 8.76228 13.2926C8.78725 13.3517 8.80012 13.4152 8.80012 13.4794C8.80012 13.5435 8.78725 13.607 8.76228 13.6662C8.73731 13.7253 8.70075 13.7788 8.65474 13.8235C8.56078 13.9149 8.43491 13.9659 8.30387 13.9659C8.17283 13.9659 8.04696 13.9149 7.95299 13.8235L6.90999 12.8009C6.80257 12.6966 6.71717 12.5717 6.65886 12.4337C6.60054 12.2957 6.5705 12.1475 6.5705 11.9977C6.5705 11.8479 6.60054 11.6996 6.65886 11.5617C6.71717 11.4237 6.80257 11.2988 6.90999 11.1944L11.9885 6.21394C12.1264 6.07968 12.2361 5.91914 12.3109 5.74181C12.3858 5.56447 12.4244 5.37393 12.4244 5.18144C12.4244 4.98895 12.3858 4.79841 12.3109 4.62107C12.2361 4.44374 12.1264 4.2832 11.9885 4.14894L11.9593 4.12036C11.6778 3.84634 11.3005 3.69287 10.9076 3.69254C10.5148 3.69222 10.1372 3.84506 9.85524 4.11861L5.67158 8.22177L5.67041 8.22294L5.61324 8.27952C5.51925 8.37103 5.39326 8.42223 5.26208 8.42223C5.1309 8.42223 5.0049 8.37103 4.91091 8.27952C4.86491 8.23478 4.82834 8.18128 4.80337 8.12216C4.7784 8.06305 4.76553 7.99953 4.76553 7.93536C4.76553 7.87118 4.7784 7.80766 4.80337 7.74855C4.82834 7.68944 4.86491 7.63593 4.91091 7.59119L9.15349 3.43027C9.29105 3.29592 9.40033 3.1354 9.47488 2.95816C9.54943 2.78093 9.58776 2.59056 9.58759 2.39828C9.58743 2.206 9.54878 2.0157 9.47393 1.83859C9.39907 1.66147 9.28953 1.50114 9.15174 1.36702Z", fill: "currentColor" }),
|
|
295
|
+
/* @__PURE__ */ jsx6("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M8.44964 2.74425C8.49564 2.69951 8.53221 2.646 8.55718 2.58689C8.58215 2.52777 8.59501 2.46425 8.59501 2.40008C8.59501 2.33591 8.58215 2.27239 8.55718 2.21328C8.53221 2.15416 8.49564 2.10066 8.44964 2.05592C8.35564 1.96441 8.22965 1.91321 8.09847 1.91321C7.96729 1.91321 7.84129 1.96441 7.7473 2.05592L3.59455 6.12875C3.36454 6.35245 3.1817 6.61999 3.05685 6.91556C2.932 7.21113 2.86768 7.52873 2.86768 7.84958C2.86768 8.17044 2.932 8.48804 3.05685 8.78361C3.1817 9.07918 3.36454 9.34672 3.59455 9.57042C4.06433 10.0274 4.69385 10.2831 5.34922 10.2831C6.00459 10.2831 6.63411 10.0274 7.10389 9.57042L11.2572 5.49758C11.3032 5.45284 11.3398 5.39934 11.3648 5.34022C11.3897 5.28111 11.4026 5.21759 11.4026 5.15342C11.4026 5.08925 11.3897 5.02573 11.3648 4.96661C11.3398 4.9075 11.3032 4.85399 11.2572 4.80925C11.1632 4.71774 11.0372 4.66654 10.9061 4.66654C10.7749 4.66654 10.6489 4.71774 10.5549 4.80925L6.40214 8.88208C6.12029 9.15639 5.74252 9.30987 5.34922 9.30987C4.95592 9.30987 4.57815 9.15639 4.2963 8.88208C4.15836 8.74782 4.04873 8.58729 3.97386 8.40995C3.899 8.23261 3.86043 8.04207 3.86043 7.84958C3.86043 7.65709 3.899 7.46655 3.97386 7.28922C4.04873 7.11188 4.15836 6.95134 4.2963 6.81708L8.44964 2.74425Z", fill: "currentColor" })
|
|
194
296
|
] }),
|
|
195
|
-
/* @__PURE__ */
|
|
297
|
+
/* @__PURE__ */ jsx6("defs", { children: /* @__PURE__ */ jsx6("clipPath", { id: "clip0_5446_3655", children: /* @__PURE__ */ jsx6("rect", { width: 14, height: 14, fill: "white" }) }) })
|
|
196
298
|
] });
|
|
197
299
|
var mcp_server_default = SvgMcpServer;
|
|
198
300
|
|
|
199
301
|
// src/icons/search-globe.svg
|
|
200
|
-
import * as
|
|
201
|
-
import { jsx as
|
|
202
|
-
var SvgSearchGlobe = (props) => /* @__PURE__ */
|
|
302
|
+
import * as React7 from "react";
|
|
303
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
304
|
+
var SvgSearchGlobe = (props) => /* @__PURE__ */ jsx7("svg", { width: "1em", height: "1em", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: /* @__PURE__ */ jsx7("path", { d: "M7 0C10.8555 0 14 3.14453 14 7C14 10.8828 10.8555 14 7 14C3.11719 14 0 10.8828 0 7C0 3.14453 3.11719 0 7 0ZM7 12.6875C7.19141 12.6875 7.71094 12.4961 8.28516 11.375C8.53125 10.8828 8.72266 10.3086 8.88672 9.625H5.08594C5.25 10.3086 5.44141 10.8828 5.6875 11.375C6.26172 12.4961 6.78125 12.6875 7 12.6875ZM4.86719 8.3125H9.10547C9.16016 7.90234 9.1875 7.46484 9.1875 7C9.1875 6.5625 9.16016 6.125 9.10547 5.6875H4.86719C4.8125 6.125 4.8125 6.5625 4.8125 7C4.8125 7.46484 4.8125 7.90234 4.86719 8.3125ZM8.88672 4.375C8.72266 3.71875 8.53125 3.14453 8.28516 2.65234C7.71094 1.53125 7.19141 1.3125 7 1.3125C6.78125 1.3125 6.26172 1.53125 5.6875 2.65234C5.44141 3.14453 5.25 3.71875 5.08594 4.375H8.88672ZM10.418 5.6875C10.4727 6.125 10.5 6.5625 10.5 7C10.5 7.46484 10.4727 7.90234 10.418 8.3125H12.5234C12.6328 7.90234 12.6875 7.46484 12.6875 7C12.6875 6.5625 12.6328 6.125 12.5234 5.6875H10.418ZM9.35156 1.83203C9.73438 2.54297 10.0352 3.41797 10.2266 4.375H12.0312C11.457 3.25391 10.5 2.35156 9.35156 1.83203ZM4.62109 1.83203C3.47266 2.35156 2.51562 3.25391 1.94141 4.375H3.74609C3.9375 3.41797 4.23828 2.54297 4.62109 1.83203ZM1.3125 7C1.3125 7.46484 1.33984 7.90234 1.44922 8.3125H3.55469C3.5 7.90234 3.5 7.46484 3.5 7C3.5 6.5625 3.5 6.125 3.55469 5.6875H1.44922C1.33984 6.125 1.3125 6.5625 1.3125 7ZM12.0312 9.625H10.2266C10.0352 10.6094 9.73438 11.4844 9.35156 12.1953C10.5 11.6758 11.457 10.7734 12.0312 9.625ZM3.74609 9.625H1.94141C2.51562 10.7734 3.47266 11.6758 4.62109 12.1953C4.23828 11.4844 3.9375 10.6094 3.74609 9.625Z", fill: "currentColor" }) });
|
|
203
305
|
var search_globe_default = SvgSearchGlobe;
|
|
204
306
|
|
|
205
307
|
// src/icons/trueforge-logomark-dark.svg
|
|
206
|
-
import * as
|
|
207
|
-
import { jsx as
|
|
208
|
-
var SvgTrueforgeLogomarkDark = (props) => /* @__PURE__ */
|
|
209
|
-
/* @__PURE__ */
|
|
210
|
-
/* @__PURE__ */
|
|
211
|
-
/* @__PURE__ */
|
|
212
|
-
/* @__PURE__ */
|
|
308
|
+
import * as React8 from "react";
|
|
309
|
+
import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
310
|
+
var SvgTrueforgeLogomarkDark = (props) => /* @__PURE__ */ jsxs4("svg", { width: "1em", height: "1em", viewBox: "0 0 120 120", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [
|
|
311
|
+
/* @__PURE__ */ jsxs4("g", { clipPath: "url(#clip0_10581_4008)", children: [
|
|
312
|
+
/* @__PURE__ */ jsx8("path", { d: "M-0.000793457 0.015625L39.9992 20.0156V40L19.9992 40V80.0156H39.9992V100.016L-0.000793457 120.016V0.015625Z", fill: "white" }),
|
|
313
|
+
/* @__PURE__ */ jsx8("path", { d: "M119.999 0L79.9992 20V40H99.9992V80H79.9992V100L119.999 120V0Z", fill: "white" }),
|
|
314
|
+
/* @__PURE__ */ jsx8("path", { d: "M59.9955 39.8193C61.054 45.6178 63.1935 50.1614 66.5756 53.5215C69.9439 56.868 74.4722 58.9678 80.2035 60.0088C74.4696 61.0714 69.9413 63.2075 66.5736 66.5752C63.1938 69.955 61.0542 74.5036 59.9955 80.2666C58.9314 74.5031 56.7838 69.9547 53.3988 66.5752C50.026 63.2078 45.4965 61.0704 39.7709 60.0078C45.4938 58.9668 50.0235 56.8676 53.3969 53.5215C56.7841 50.1616 58.9316 45.6182 59.9955 39.8193Z", fill: "white", stroke: "white", strokeWidth: 1.6, strokeLinejoin: "round" })
|
|
213
315
|
] }),
|
|
214
|
-
/* @__PURE__ */
|
|
316
|
+
/* @__PURE__ */ jsx8("defs", { children: /* @__PURE__ */ jsx8("clipPath", { id: "clip0_10581_4008", children: /* @__PURE__ */ jsx8("rect", { width: 120, height: 120, fill: "white" }) }) })
|
|
215
317
|
] });
|
|
216
318
|
var trueforge_logomark_dark_default = SvgTrueforgeLogomarkDark;
|
|
217
319
|
|
|
218
320
|
// src/icons/trueforge-logomark-light.svg
|
|
219
|
-
import * as
|
|
220
|
-
import { jsx as
|
|
221
|
-
var SvgTrueforgeLogomarkLight = (props) => /* @__PURE__ */
|
|
222
|
-
/* @__PURE__ */
|
|
223
|
-
/* @__PURE__ */
|
|
224
|
-
/* @__PURE__ */
|
|
225
|
-
/* @__PURE__ */
|
|
321
|
+
import * as React9 from "react";
|
|
322
|
+
import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
323
|
+
var SvgTrueforgeLogomarkLight = (props) => /* @__PURE__ */ jsxs5("svg", { width: "1em", height: "1em", viewBox: "0 0 140 140", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [
|
|
324
|
+
/* @__PURE__ */ jsxs5("g", { clipPath: "url(#clip0_10581_1729)", children: [
|
|
325
|
+
/* @__PURE__ */ jsx9("path", { d: "M-0.000976562 0.0195312L46.6657 23.3529V46.668L23.3324 46.668V93.3529H46.6657V116.686L-0.000976562 140.02V0.0195312Z", fill: "#05090E" }),
|
|
326
|
+
/* @__PURE__ */ jsx9("path", { d: "M139.999 0L93.3324 23.3333V46.6667H116.666V93.3333H93.3324V116.667L139.999 140V0Z", fill: "#05090E" }),
|
|
327
|
+
/* @__PURE__ */ jsx9("path", { d: "M69.9941 46.4561C71.2291 53.2208 73.7252 58.5213 77.6709 62.4414C81.6 66.345 86.8814 68.7951 93.5664 70.0098C86.8784 71.2497 81.5974 73.7435 77.6689 77.6719C73.7259 81.615 71.2293 86.921 69.9941 93.6445C68.7527 86.9203 66.2461 81.6138 62.2969 77.6709C58.3624 73.7429 53.0791 71.2496 46.4004 70.0098C53.076 68.7952 58.3597 66.3456 62.2949 62.4424C66.2468 58.5225 68.7529 53.2215 69.9941 46.4561Z", fill: "#6D58FB", stroke: "#6D58FB", strokeWidth: 1.86667, strokeLinejoin: "round" })
|
|
226
328
|
] }),
|
|
227
|
-
/* @__PURE__ */
|
|
329
|
+
/* @__PURE__ */ jsx9("defs", { children: /* @__PURE__ */ jsx9("clipPath", { id: "clip0_10581_1729", children: /* @__PURE__ */ jsx9("rect", { width: 140, height: 140, fill: "white" }) }) })
|
|
228
330
|
] });
|
|
229
331
|
var trueforge_logomark_light_default = SvgTrueforgeLogomarkLight;
|
|
230
332
|
|
|
@@ -232,25 +334,43 @@ var trueforge_logomark_light_default = SvgTrueforgeLogomarkLight;
|
|
|
232
334
|
registerIcons({
|
|
233
335
|
"mcp-server": mcp_server_default,
|
|
234
336
|
"agent-2": agent_2_default,
|
|
337
|
+
// Prefer the custom agent glyph over Lucide Bot for bot/robot aliases.
|
|
338
|
+
bot: agent_2_default,
|
|
339
|
+
robot: agent_2_default,
|
|
235
340
|
compare: compare_default,
|
|
236
341
|
ai: ai_default,
|
|
237
342
|
searchGlobe: search_globe_default,
|
|
238
343
|
"brain-regular": brain_regular_default,
|
|
344
|
+
empty: empty_default,
|
|
239
345
|
"trueforge-logomark-light": trueforge_logomark_light_default,
|
|
240
346
|
"trueforge-logomark-dark": trueforge_logomark_dark_default
|
|
241
347
|
});
|
|
242
348
|
|
|
243
349
|
// src/containers/McpOauthContainer/PostMcpOauthScreen.tsx
|
|
244
350
|
import { useEffect, useState } from "react";
|
|
245
|
-
import { jsx as
|
|
351
|
+
import { jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
246
352
|
var BROADCAST_RETRY_DELAY_MS = 1e3;
|
|
247
353
|
var WINDOW_CLOSE_DELAY_MS = 5e3;
|
|
354
|
+
function resolvePopupSuccess(searchParams) {
|
|
355
|
+
if (searchParams.get("error")) {
|
|
356
|
+
return false;
|
|
357
|
+
}
|
|
358
|
+
const flag = searchParams.get("isSuccess")?.toLowerCase();
|
|
359
|
+
if (flag === "true") {
|
|
360
|
+
return true;
|
|
361
|
+
}
|
|
362
|
+
if (flag === "false") {
|
|
363
|
+
return false;
|
|
364
|
+
}
|
|
365
|
+
const code = searchParams.get("code");
|
|
366
|
+
return code != null && code.length > 0;
|
|
367
|
+
}
|
|
248
368
|
var PostMcpOauthScreen = () => {
|
|
249
369
|
const [result, setResult] = useState();
|
|
250
370
|
useEffect(() => {
|
|
251
371
|
const searchParams = new URLSearchParams(window.location.search);
|
|
252
372
|
const popupUid = searchParams.get("pUid");
|
|
253
|
-
const isSuccess2 = searchParams
|
|
373
|
+
const isSuccess2 = resolvePopupSuccess(searchParams);
|
|
254
374
|
setResult(popupUid ? { popupUid, isSuccess: isSuccess2 } : null);
|
|
255
375
|
const broadcastResult = () => {
|
|
256
376
|
if (!popupUid) return;
|
|
@@ -272,22 +392,462 @@ var PostMcpOauthScreen = () => {
|
|
|
272
392
|
const isSuccess = !!result?.isSuccess;
|
|
273
393
|
const title = result === void 0 ? "Completing authorization" : isSuccess ? "Authorization successful" : "Authorization failed";
|
|
274
394
|
const description = result === void 0 ? "Please wait while the authorization result is confirmed." : result === null ? "The authorization result is invalid. You can close this window and try again." : isSuccess ? "The MCP server is now connected. This window will close automatically." : "The MCP server could not be authorized. You can close this window and try again.";
|
|
275
|
-
return /* @__PURE__ */
|
|
276
|
-
result === void 0 ? /* @__PURE__ */
|
|
277
|
-
/* @__PURE__ */
|
|
278
|
-
/* @__PURE__ */
|
|
395
|
+
return /* @__PURE__ */ jsx10("main", { className: "flex min-h-screen items-center justify-center bg-primary-bg p-6", children: /* @__PURE__ */ jsxs6("div", { className: "flex w-full max-w-md flex-col items-center gap-3 rounded-2xl border border-border bg-card-bg p-8 text-center shadow-sm", children: [
|
|
396
|
+
result === void 0 ? /* @__PURE__ */ jsx10(Icon, { name: "oauth-loading", className: "size-16 animate-spin text-text-secondary" }) : isSuccess ? /* @__PURE__ */ jsx10(Icon, { name: "oauth-success", className: "size-16 text-success-bg" }) : /* @__PURE__ */ jsx10(Icon, { name: "oauth-error", className: "size-16 text-failure-bg" }),
|
|
397
|
+
/* @__PURE__ */ jsx10("h1", { className: "text-2xl font-semibold text-text-primary", children: title }),
|
|
398
|
+
/* @__PURE__ */ jsx10("p", { className: "text-sm leading-6 text-text-secondary", children: description })
|
|
279
399
|
] }) });
|
|
280
400
|
};
|
|
281
401
|
var PostMcpOauthScreen_default = PostMcpOauthScreen;
|
|
282
402
|
|
|
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
|
+
|
|
283
843
|
// src/containers/ToolGroupContainer.tsx
|
|
284
|
-
import { useAuiState as
|
|
285
|
-
import { useState as
|
|
286
|
-
import { jsx as
|
|
844
|
+
import { useAuiState as useAuiState3 } from "@assistant-ui/react";
|
|
845
|
+
import { useState as useState4 } from "react";
|
|
846
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
287
847
|
function ToolGroupContainer({ children, group }) {
|
|
288
848
|
const ToolGroupCard2 = useSlot("ToolGroupCard");
|
|
289
849
|
const toolCallCount = group.indices.length;
|
|
290
|
-
const active =
|
|
850
|
+
const active = useAuiState3((s) => {
|
|
291
851
|
if (s.message.status?.type !== "running") return false;
|
|
292
852
|
const lastIndex = s.message.parts.length - 1;
|
|
293
853
|
if (lastIndex < 0) return false;
|
|
@@ -295,13 +855,13 @@ function ToolGroupContainer({ children, group }) {
|
|
|
295
855
|
const lastGroupIndex = group.indices[group.indices.length - 1];
|
|
296
856
|
return lastGroupIndex !== void 0 && lastIndex >= group.indices[0] && lastIndex <= lastGroupIndex;
|
|
297
857
|
});
|
|
298
|
-
const [expanded, setExpanded] =
|
|
299
|
-
const [prevActive, setPrevActive] =
|
|
858
|
+
const [expanded, setExpanded] = useState4(true);
|
|
859
|
+
const [prevActive, setPrevActive] = useState4(active);
|
|
300
860
|
if (active !== prevActive) {
|
|
301
861
|
setPrevActive(active);
|
|
302
862
|
if (active) setExpanded(true);
|
|
303
863
|
}
|
|
304
|
-
return /* @__PURE__ */
|
|
864
|
+
return /* @__PURE__ */ jsx13(
|
|
305
865
|
ToolGroupCard2,
|
|
306
866
|
{
|
|
307
867
|
toolCallCount,
|
|
@@ -315,20 +875,20 @@ function ToolGroupContainer({ children, group }) {
|
|
|
315
875
|
|
|
316
876
|
// src/containers/TrueForgeUI.tsx
|
|
317
877
|
import { lazy, Suspense } from "react";
|
|
318
|
-
import { jsx as
|
|
878
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
319
879
|
var TrueForgeUIWithRouter = lazy(
|
|
320
|
-
() => import("./TrueForgeUIWithRouter-
|
|
880
|
+
() => import("./TrueForgeUIWithRouter-3TSLV22Q.js").then((m) => ({ default: m.TrueForgeUIWithRouter }))
|
|
321
881
|
);
|
|
322
882
|
function TrueForgeUI(props) {
|
|
323
883
|
const isMcpAuthScreen = typeof window !== "undefined" && new URLSearchParams(window.location.search).get("screenType") === "mcp-auth";
|
|
324
884
|
if (isMcpAuthScreen) {
|
|
325
|
-
return /* @__PURE__ */
|
|
885
|
+
return /* @__PURE__ */ jsx14(SlotsProvider, { overrides: props.overrides, theme: props.theme, children: /* @__PURE__ */ jsx14(PostMcpOauthScreen_default, {}) });
|
|
326
886
|
}
|
|
327
887
|
const { withRouter, ...rest } = props;
|
|
328
888
|
if (withRouter) {
|
|
329
|
-
return /* @__PURE__ */
|
|
889
|
+
return /* @__PURE__ */ jsx14(Suspense, { fallback: /* @__PURE__ */ jsx14(ServerInitLoader, { className: props.className }), children: /* @__PURE__ */ jsx14(TrueForgeUIWithRouter, { ...rest }) });
|
|
330
890
|
}
|
|
331
|
-
return /* @__PURE__ */
|
|
891
|
+
return /* @__PURE__ */ jsx14(TrueForgeUIShell, { ...rest });
|
|
332
892
|
}
|
|
333
893
|
|
|
334
894
|
// src/index.ts
|
|
@@ -347,6 +907,32 @@ import {
|
|
|
347
907
|
useTrueFoundryUpdateAgentSpec
|
|
348
908
|
} from "@truefoundry/assistant-ui-runtime";
|
|
349
909
|
export {
|
|
910
|
+
AgentCodeBlock,
|
|
911
|
+
AgentConfigEditors,
|
|
912
|
+
AgentConfigPanel,
|
|
913
|
+
AgentConfigSection,
|
|
914
|
+
AgentDetailsHeader,
|
|
915
|
+
AgentDetailsPage,
|
|
916
|
+
AgentDetailsTabs,
|
|
917
|
+
AgentDetailsUnavailable,
|
|
918
|
+
AgentInstructionsDrawer,
|
|
919
|
+
AgentMcpEditorContent,
|
|
920
|
+
AgentMetricCard,
|
|
921
|
+
AgentMetricChart,
|
|
922
|
+
AgentMetricsContainer,
|
|
923
|
+
AgentMetricsTimeRangeFilter,
|
|
924
|
+
AgentMetricsView,
|
|
925
|
+
AgentModelConfigModal,
|
|
926
|
+
AgentModelEditorContent,
|
|
927
|
+
AgentModelSettingsContent,
|
|
928
|
+
AgentOverviewCard,
|
|
929
|
+
AgentResourceConfigModal,
|
|
930
|
+
AgentResourceEditorContent,
|
|
931
|
+
AgentRuntimeConfigFields,
|
|
932
|
+
AgentRuntimeConfigModal,
|
|
933
|
+
AgentRuntimeEditorContent,
|
|
934
|
+
AgentSessionsFilters,
|
|
935
|
+
AgentSkillsEditorContent,
|
|
350
936
|
AgentStepsCard,
|
|
351
937
|
AgentStepsContainer,
|
|
352
938
|
AgentsLibrary,
|
|
@@ -363,6 +949,7 @@ export {
|
|
|
363
949
|
AvatarImage,
|
|
364
950
|
BottomSheet,
|
|
365
951
|
BrandLogo,
|
|
952
|
+
Button,
|
|
366
953
|
CenteredModal,
|
|
367
954
|
ChatFileDownload,
|
|
368
955
|
ClearChatButton,
|
|
@@ -378,6 +965,9 @@ export {
|
|
|
378
965
|
CustomActionContainer,
|
|
379
966
|
CustomActionRenderersProvider,
|
|
380
967
|
DEFAULT_AGENT_CONFIG,
|
|
968
|
+
DEFAULT_TABLE_PAGE_SIZE,
|
|
969
|
+
DraftAgentConfigTrigger,
|
|
970
|
+
DraftCapabilitiesPanel,
|
|
381
971
|
DraftCatalogProvider,
|
|
382
972
|
DraftComposerLeftSection,
|
|
383
973
|
DraftComposerRightSection,
|
|
@@ -385,6 +975,7 @@ export {
|
|
|
385
975
|
DraftModelSelector,
|
|
386
976
|
HistoryLoader,
|
|
387
977
|
HistoryLoaderContainer,
|
|
978
|
+
IS_CREATE_AGENT_METADATA_KEY,
|
|
388
979
|
Icon,
|
|
389
980
|
MCP_AUTH_POPUP_CHANNEL,
|
|
390
981
|
Markdown,
|
|
@@ -399,6 +990,7 @@ export {
|
|
|
399
990
|
MonacoEditorCore,
|
|
400
991
|
OpenUiFenceBlock,
|
|
401
992
|
PRESETS,
|
|
993
|
+
PopoverSelect,
|
|
402
994
|
PostMcpOauthScreen_default as PostMcpOauthScreen,
|
|
403
995
|
ReasoningContainer,
|
|
404
996
|
ResumeUnavailable,
|
|
@@ -406,15 +998,37 @@ export {
|
|
|
406
998
|
SandboxArtifactDownload,
|
|
407
999
|
SandboxToolCallCard,
|
|
408
1000
|
SaveAgentButton,
|
|
1001
|
+
SaveAgentForm,
|
|
1002
|
+
SaveAgentFormFields,
|
|
1003
|
+
ScheduleFormDrawer,
|
|
1004
|
+
ScheduleFormFields,
|
|
1005
|
+
ScheduleLastRunsCell,
|
|
1006
|
+
ScheduleRunChip,
|
|
1007
|
+
ScheduleStatusBadge,
|
|
1008
|
+
SchedulesButton,
|
|
1009
|
+
SchedulesPage,
|
|
409
1010
|
ScrollToBottomButton,
|
|
410
1011
|
SelectAgentEmptyState,
|
|
411
1012
|
ServerProvider,
|
|
1013
|
+
SessionsBrowserButton,
|
|
1014
|
+
SessionsPage,
|
|
412
1015
|
ShellActionsActionSlot,
|
|
413
1016
|
ShellModeProvider,
|
|
1017
|
+
SideDrawer,
|
|
414
1018
|
SlotsProvider,
|
|
415
1019
|
SubAgentCard,
|
|
416
1020
|
Switch,
|
|
417
1021
|
SyntaxHighlighter,
|
|
1022
|
+
TABLE_PAGE_SIZE_OPTIONS,
|
|
1023
|
+
Table,
|
|
1024
|
+
TableBody,
|
|
1025
|
+
TableCell,
|
|
1026
|
+
TableHead,
|
|
1027
|
+
TableHeader,
|
|
1028
|
+
TablePagination,
|
|
1029
|
+
TableRow,
|
|
1030
|
+
TableTokenPagination,
|
|
1031
|
+
TestScheduleScreen,
|
|
418
1032
|
ThemeProvider,
|
|
419
1033
|
Thread,
|
|
420
1034
|
ThreadComposerAreaShell,
|
|
@@ -451,14 +1065,20 @@ export {
|
|
|
451
1065
|
createTrueFoundryServer,
|
|
452
1066
|
defaultSlots,
|
|
453
1067
|
getErrorMessage,
|
|
1068
|
+
isCreateAgentMetadataValue,
|
|
454
1069
|
libraryAgentId,
|
|
455
1070
|
mergeAgentSpec,
|
|
456
1071
|
preloadMarkdownOpenUI,
|
|
1072
|
+
readSessionIsCreateAgent,
|
|
457
1073
|
resolveBrandChrome,
|
|
458
1074
|
resolvePresetTokens,
|
|
1075
|
+
sessionIsCreateAgent,
|
|
1076
|
+
shellIsCreateAgent,
|
|
459
1077
|
shellIsMutable,
|
|
460
1078
|
threadHasPendingMcpAuth,
|
|
461
1079
|
trueFoundryAttachmentAdapter,
|
|
1080
|
+
useAgentMetricsServer,
|
|
1081
|
+
useAgentSessionsServer,
|
|
462
1082
|
useAui,
|
|
463
1083
|
useAuiState,
|
|
464
1084
|
useBrand,
|
|
@@ -469,11 +1089,15 @@ export {
|
|
|
469
1089
|
useContentClassNames,
|
|
470
1090
|
useDraftCatalog,
|
|
471
1091
|
useMCPAuth,
|
|
1092
|
+
useOptionalAgentMetricsServer,
|
|
1093
|
+
useOptionalAgentSessionsServer,
|
|
472
1094
|
useOptionalCatalogServer,
|
|
473
1095
|
useOptionalContentClassNames,
|
|
474
1096
|
useOptionalCustomActionRenderers,
|
|
1097
|
+
useOptionalScheduleServer,
|
|
475
1098
|
useOptionalServer,
|
|
476
1099
|
useOptionalShellMode,
|
|
1100
|
+
useScheduleServer,
|
|
477
1101
|
useServer,
|
|
478
1102
|
useServerCapabilities,
|
|
479
1103
|
useShellMode,
|