@truefoundry/trueforge-ui 0.3.0-rc.0 → 0.3.0-rc.1
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 +48 -0
- package/README.md +14 -6
- package/dist/AgentCodeSnippets-NZOFJE57.js +74 -0
- package/dist/AgentCodeSnippets-NZOFJE57.js.map +1 -0
- package/dist/AgentMetricChart-JPU3MFQ2.js +15 -0
- package/dist/AgentOverview-EEBHJC32.js +167 -0
- package/dist/AgentOverview-EEBHJC32.js.map +1 -0
- package/dist/AgentSessionEventTimeline-26Z6IB3B.js +79 -0
- package/dist/AgentSessionEventTimeline-26Z6IB3B.js.map +1 -0
- package/dist/AgentSessionEventTimelineChart-CGCU7WBK.js +504 -0
- package/dist/AgentSessionEventTimelineChart-CGCU7WBK.js.map +1 -0
- package/dist/AgentSessions-3MPDZASK.js +275 -0
- package/dist/AgentSessions-3MPDZASK.js.map +1 -0
- package/dist/{ConnectorSettings-FXQ5B7TN.js → ConnectorSettings-MXFRWWR6.js} +8 -6
- package/dist/{ConnectorSettings-FXQ5B7TN.js.map → ConnectorSettings-MXFRWWR6.js.map} +1 -1
- package/dist/{DockLayout-LBNQJZNF.js → DockLayout-LM4AFMFY.js} +11 -10
- package/dist/{DockLayout-LBNQJZNF.js.map → DockLayout-LM4AFMFY.js.map} +1 -1
- package/dist/DrawerLayout-JR3O6RRB.js +184 -0
- package/dist/DrawerLayout-JR3O6RRB.js.map +1 -0
- package/dist/{ModelSettings-4L4LOQJA.js → ModelSettings-G7IFNC2Y.js} +8 -6
- package/dist/{ModelSettings-4L4LOQJA.js.map → ModelSettings-G7IFNC2Y.js.map} +1 -1
- package/dist/OpenUiFenceBlock-2TV5TQ6P.js +9 -0
- package/dist/OpenUiFenceBlock-2TV5TQ6P.js.map +1 -0
- package/dist/{SandboxSettings-Z4ZG6ZX4.js → SandboxSettings-NXAANMAX.js} +8 -6
- package/dist/{SandboxSettings-Z4ZG6ZX4.js.map → SandboxSettings-NXAANMAX.js.map} +1 -1
- package/dist/SchedulesPage-KKLUDO6B.js +15 -0
- package/dist/SchedulesPage-KKLUDO6B.js.map +1 -0
- package/dist/{SettingsBuilder-WF7ZWKQW.js → SettingsBuilder-L34IQ56S.js} +26 -22
- package/dist/SettingsBuilder-L34IQ56S.js.map +1 -0
- package/dist/{ShellRouteSync-T4WLY57Q.js → ShellRouteSync-CEBETGEJ.js} +95 -22
- package/dist/ShellRouteSync-CEBETGEJ.js.map +1 -0
- package/dist/SidebarLayout-A2HJPPHS.js +308 -0
- package/dist/SidebarLayout-A2HJPPHS.js.map +1 -0
- package/dist/{SkillSettings-3EPPC3IT.js → SkillSettings-FGGMSUNO.js} +8 -6
- package/dist/{SkillSettings-3EPPC3IT.js.map → SkillSettings-FGGMSUNO.js.map} +1 -1
- package/dist/{TrueForgeUIWithRouter-NZ4FGPE4.js → TrueForgeUIWithRouter-MZVJWJMB.js} +14 -10
- package/dist/{TrueForgeUIWithRouter-NZ4FGPE4.js.map → TrueForgeUIWithRouter-MZVJWJMB.js.map} +1 -1
- package/dist/{WidgetLayout-3QZ357FL.js → WidgetLayout-6QM45OQQ.js} +17 -13
- package/dist/WidgetLayout-6QM45OQQ.js.map +1 -0
- package/dist/chunk-2XPPBEYF.js +74 -0
- package/dist/chunk-2XPPBEYF.js.map +1 -0
- package/dist/chunk-6O6FWUDW.js +1376 -0
- package/dist/chunk-6O6FWUDW.js.map +1 -0
- package/dist/chunk-7Z2C2K7F.js +578 -0
- package/dist/chunk-7Z2C2K7F.js.map +1 -0
- package/dist/{chunk-WREC7D54.js → chunk-CYHJDKFB.js} +115 -32
- package/dist/chunk-CYHJDKFB.js.map +1 -0
- package/dist/chunk-DJUFS2BW.js +27 -0
- package/dist/chunk-DJUFS2BW.js.map +1 -0
- package/dist/chunk-DMMZSZTN.js +252 -0
- package/dist/chunk-DMMZSZTN.js.map +1 -0
- package/dist/chunk-FJW36PD7.js +180 -0
- package/dist/chunk-FJW36PD7.js.map +1 -0
- package/dist/chunk-M62XY4NC.js +555 -0
- package/dist/chunk-M62XY4NC.js.map +1 -0
- package/dist/{chunk-B52K63AW.js → chunk-MPNSO7E6.js} +2 -2
- 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-U7KURWW3.js +840 -0
- package/dist/chunk-U7KURWW3.js.map +1 -0
- package/dist/chunk-WVE3F724.js +200 -0
- package/dist/chunk-WVE3F724.js.map +1 -0
- package/dist/{chunk-FJ5RSSMA.js → chunk-XAU7QFG3.js} +178 -36
- package/dist/chunk-XAU7QFG3.js.map +1 -0
- package/dist/chunk-Y6S4OVVQ.js +16 -0
- package/dist/chunk-Y6S4OVVQ.js.map +1 -0
- package/dist/chunk-ZKNUMH2M.js +119 -0
- package/dist/chunk-ZKNUMH2M.js.map +1 -0
- package/dist/chunk-ZTMKFZQ3.js +13214 -0
- package/dist/chunk-ZTMKFZQ3.js.map +1 -0
- package/dist/{createTrueFoundryServer-B72bU-J7.d.ts → createTrueFoundryServer-CmZnBh_l.d.ts} +15 -4
- package/dist/index.d.ts +1002 -22
- package/dist/index.js +689 -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 +503 -188
- package/dist/plugins/trueforge-agent-server-adapter/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +8 -7
- package/dist/DrawerLayout-Q6UK4VMI.js +0 -159
- package/dist/DrawerLayout-Q6UK4VMI.js.map +0 -1
- package/dist/OpenUiFenceBlock-6UIIAVBX.js +0 -9
- package/dist/SettingsBuilder-WF7ZWKQW.js.map +0 -1
- 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/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-JPU3MFQ2.js.map} +0 -0
- /package/dist/{chunk-B52K63AW.js.map → chunk-MPNSO7E6.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-M62XY4NC.js";
|
|
28
15
|
import {
|
|
29
16
|
ServerInitLoader,
|
|
30
17
|
TrueForgeUIShell,
|
|
31
18
|
TrueFoundryChatProvider
|
|
32
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-CYHJDKFB.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-ZKNUMH2M.js";
|
|
30
|
+
import {
|
|
31
|
+
ScheduleFormDrawer,
|
|
32
|
+
ScheduleFormFields,
|
|
33
|
+
ScheduleLastRunsCell,
|
|
34
|
+
ScheduleRunChip,
|
|
35
|
+
ScheduleStatusBadge,
|
|
36
|
+
SchedulesPage,
|
|
37
|
+
TestScheduleScreen
|
|
38
|
+
} from "./chunk-6O6FWUDW.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,
|
|
@@ -60,35 +91,60 @@ import {
|
|
|
60
91
|
ChatFileDownload,
|
|
61
92
|
ClearChatButton,
|
|
62
93
|
CodeEditor,
|
|
94
|
+
ComposerAttachmentPickerContainer,
|
|
95
|
+
ComposerAttachmentsContainer,
|
|
63
96
|
ComposerLeftSection,
|
|
64
97
|
ComposerRightSection,
|
|
65
98
|
ComposerSendButton,
|
|
66
99
|
ComposerShell,
|
|
100
|
+
DEFAULT_TABLE_PAGE_SIZE,
|
|
101
|
+
DraftAgentConfigTrigger,
|
|
102
|
+
DraftCapabilitiesPanel,
|
|
67
103
|
DraftComposerLeftSection,
|
|
68
104
|
DraftComposerRightSection,
|
|
69
105
|
DraftCompositeSelector,
|
|
70
106
|
DraftModelSelector,
|
|
107
|
+
DropdownMenuItem,
|
|
71
108
|
HistoryLoader,
|
|
72
109
|
MCP_AUTH_POPUP_CHANNEL,
|
|
73
110
|
Markdown,
|
|
74
111
|
MessageActionBar,
|
|
112
|
+
MessageAttachmentsContainer,
|
|
75
113
|
MessageErrorBanner,
|
|
76
114
|
MessageGroup,
|
|
77
115
|
MessageIndicator,
|
|
78
116
|
MessageListSkeleton,
|
|
79
117
|
MessageTimestamp,
|
|
80
118
|
MonacoEditorCore,
|
|
119
|
+
PopoverSelect,
|
|
120
|
+
ReasoningContainer,
|
|
81
121
|
ResumeUnavailable,
|
|
82
122
|
SandboxArtifactDownload,
|
|
83
123
|
SandboxToolCallCard,
|
|
84
124
|
SaveAgentButton,
|
|
125
|
+
SaveAgentForm,
|
|
126
|
+
SaveAgentFormFields,
|
|
127
|
+
SchedulesButton,
|
|
85
128
|
ScrollToBottomButton,
|
|
129
|
+
SearchInput_default,
|
|
86
130
|
SelectAgentEmptyState,
|
|
131
|
+
SessionsBrowserButton,
|
|
132
|
+
SessionsPage,
|
|
87
133
|
ShellActionsActionSlot,
|
|
134
|
+
SideDrawer,
|
|
88
135
|
SlotsProvider,
|
|
89
136
|
SubAgentCard,
|
|
90
137
|
Switch,
|
|
91
138
|
SyntaxHighlighter,
|
|
139
|
+
TABLE_PAGE_SIZE_OPTIONS,
|
|
140
|
+
Table,
|
|
141
|
+
TableBody,
|
|
142
|
+
TableCell,
|
|
143
|
+
TableHead,
|
|
144
|
+
TableHeader,
|
|
145
|
+
TablePagination,
|
|
146
|
+
TableRow,
|
|
147
|
+
TableTokenPagination,
|
|
92
148
|
ThreadComposerAreaShell,
|
|
93
149
|
ThreadListEmptyState,
|
|
94
150
|
ThreadListNewButton,
|
|
@@ -101,58 +157,85 @@ import {
|
|
|
101
157
|
ToastStack,
|
|
102
158
|
ToasterProvider,
|
|
103
159
|
ToolApprovalBar,
|
|
160
|
+
ToolApprovalContainer,
|
|
104
161
|
ToolCallCard,
|
|
162
|
+
ToolCallContainer,
|
|
105
163
|
ToolCallContentBlock,
|
|
164
|
+
ToolCallContentBlockContainer,
|
|
106
165
|
ToolGroupCard,
|
|
107
166
|
USER_MESSAGE_ATTACHMENT_PREVIEW_REM,
|
|
108
167
|
UserMessageActionBar,
|
|
109
168
|
UserMessageBubble,
|
|
169
|
+
UserMessageContainer,
|
|
110
170
|
UserMessageEdit,
|
|
111
171
|
WelcomeScreen,
|
|
172
|
+
canReuseMutableShell,
|
|
173
|
+
computeAgentStepsSplit,
|
|
112
174
|
defaultSlots,
|
|
113
175
|
preloadMarkdownOpenUI,
|
|
176
|
+
readThreadAgentName,
|
|
114
177
|
resolveBrandChrome,
|
|
178
|
+
themePortalRoot,
|
|
179
|
+
threadListIndicesByRecency,
|
|
180
|
+
threadListItemIsMutable,
|
|
115
181
|
useBrandName,
|
|
182
|
+
useIsMobile,
|
|
116
183
|
useMCPAuth,
|
|
184
|
+
useSearchAgentsList,
|
|
117
185
|
useSlot,
|
|
118
186
|
useThemeMode,
|
|
119
187
|
useToaster,
|
|
120
188
|
useToasterOptional
|
|
121
|
-
} from "./chunk-
|
|
189
|
+
} from "./chunk-ZTMKFZQ3.js";
|
|
190
|
+
import "./chunk-2XPPBEYF.js";
|
|
122
191
|
import {
|
|
123
192
|
DraftCatalogProvider,
|
|
124
193
|
Icon,
|
|
194
|
+
auiButtonClass,
|
|
125
195
|
getErrorMessage,
|
|
126
196
|
registerIcons,
|
|
197
|
+
useCompactLayout,
|
|
127
198
|
useDraftCatalog
|
|
128
|
-
} from "./chunk-
|
|
199
|
+
} from "./chunk-XAU7QFG3.js";
|
|
129
200
|
import {
|
|
130
201
|
DEFAULT_AGENT_CONFIG,
|
|
131
202
|
ServerProvider,
|
|
132
203
|
ShellModeProvider,
|
|
133
204
|
libraryAgentId,
|
|
205
|
+
shellIsCreateAgent,
|
|
134
206
|
shellIsMutable,
|
|
207
|
+
useAgentMetricsServer,
|
|
208
|
+
useAgentSessionsServer,
|
|
135
209
|
useCatalogServer,
|
|
210
|
+
useOptionalAgentMetricsServer,
|
|
211
|
+
useOptionalAgentSessionsServer,
|
|
136
212
|
useOptionalCatalogServer,
|
|
213
|
+
useOptionalScheduleServer,
|
|
137
214
|
useOptionalServer,
|
|
138
215
|
useOptionalShellMode,
|
|
216
|
+
useScheduleServer,
|
|
139
217
|
useServer,
|
|
140
218
|
useServerCapabilities,
|
|
141
219
|
useShellMode
|
|
142
|
-
} from "./chunk-
|
|
220
|
+
} from "./chunk-U7KURWW3.js";
|
|
221
|
+
import {
|
|
222
|
+
useAui,
|
|
223
|
+
useAuiState
|
|
224
|
+
} from "./chunk-M6MHLVSO.js";
|
|
143
225
|
import {
|
|
144
226
|
OpenUiFenceBlock
|
|
145
|
-
} from "./chunk-
|
|
227
|
+
} from "./chunk-MPNSO7E6.js";
|
|
146
228
|
import {
|
|
147
229
|
PRESETS,
|
|
148
230
|
ThemeProvider,
|
|
231
|
+
cn,
|
|
149
232
|
resolvePresetTokens,
|
|
150
233
|
useBrand,
|
|
151
234
|
useContentClassNames,
|
|
152
235
|
useOptionalContentClassNames,
|
|
153
236
|
useTheme,
|
|
154
237
|
useThemeIcons
|
|
155
|
-
} from "./chunk-
|
|
238
|
+
} from "./chunk-7Z2C2K7F.js";
|
|
156
239
|
|
|
157
240
|
// src/icons/agent-2.svg
|
|
158
241
|
import * as React from "react";
|
|
@@ -184,47 +267,65 @@ import { jsx as jsx4 } from "react/jsx-runtime";
|
|
|
184
267
|
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
268
|
var compare_default = SvgCompare;
|
|
186
269
|
|
|
187
|
-
// src/icons/
|
|
270
|
+
// src/icons/empty.svg
|
|
188
271
|
import * as React5 from "react";
|
|
189
272
|
import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
190
|
-
var
|
|
191
|
-
/* @__PURE__ */
|
|
192
|
-
|
|
193
|
-
|
|
273
|
+
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: [
|
|
274
|
+
/* @__PURE__ */ jsx5("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M10.4824 12.432L21.0265 6.20004L10.5441 0L0 6.20004L10.4824 12.432Z", fill: "#ECF2F9" }),
|
|
275
|
+
/* @__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" }),
|
|
276
|
+
/* @__PURE__ */ jsx5("path", { d: "M10.5 11.7499V0.749939L19.75 6.24994L10.5 11.7499Z", fill: "url(#paint0_linear_10651_178757)" }),
|
|
277
|
+
/* @__PURE__ */ jsx5("path", { d: "M10.5 11.7499V0.749939L1.25 6.24994L10.5 11.7499Z", fill: "#0E1623" }),
|
|
278
|
+
/* @__PURE__ */ jsx5("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M0 6.20001V18.686L10.5441 25V12.4319L0 6.20001Z", fill: "#CEE0F8" }),
|
|
279
|
+
/* @__PURE__ */ jsx5("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M21.0265 6.20001V18.686L10.4824 25V12.4319L21.0265 6.20001Z", fill: "#82A0CE" }),
|
|
280
|
+
/* @__PURE__ */ jsx5("path", { d: "M10.4973 11.7478L4.64099 8.26706V8.95172L10.4973 12.4126L15.8148 9.27748V8.59062L10.4973 11.7478Z", fill: "#ECF2F9" }),
|
|
281
|
+
/* @__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: [
|
|
282
|
+
/* @__PURE__ */ jsx5("stop", { stopColor: "#5E7BAA" }),
|
|
283
|
+
/* @__PURE__ */ jsx5("stop", { offset: 1, stopColor: "#030407" })
|
|
284
|
+
] }) })
|
|
285
|
+
] });
|
|
286
|
+
var empty_default = SvgEmpty;
|
|
287
|
+
|
|
288
|
+
// src/icons/mcp-server.svg
|
|
289
|
+
import * as React6 from "react";
|
|
290
|
+
import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
291
|
+
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: [
|
|
292
|
+
/* @__PURE__ */ jsxs3("g", { clipPath: "url(#clip0_5446_3655)", children: [
|
|
293
|
+
/* @__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" }),
|
|
294
|
+
/* @__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
295
|
] }),
|
|
195
|
-
/* @__PURE__ */
|
|
296
|
+
/* @__PURE__ */ jsx6("defs", { children: /* @__PURE__ */ jsx6("clipPath", { id: "clip0_5446_3655", children: /* @__PURE__ */ jsx6("rect", { width: 14, height: 14, fill: "white" }) }) })
|
|
196
297
|
] });
|
|
197
298
|
var mcp_server_default = SvgMcpServer;
|
|
198
299
|
|
|
199
300
|
// src/icons/search-globe.svg
|
|
200
|
-
import * as
|
|
201
|
-
import { jsx as
|
|
202
|
-
var SvgSearchGlobe = (props) => /* @__PURE__ */
|
|
301
|
+
import * as React7 from "react";
|
|
302
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
303
|
+
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
304
|
var search_globe_default = SvgSearchGlobe;
|
|
204
305
|
|
|
205
306
|
// 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__ */
|
|
307
|
+
import * as React8 from "react";
|
|
308
|
+
import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
309
|
+
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: [
|
|
310
|
+
/* @__PURE__ */ jsxs4("g", { clipPath: "url(#clip0_10581_4008)", children: [
|
|
311
|
+
/* @__PURE__ */ jsx8("path", { d: "M-0.000793457 0.015625L39.9992 20.0156V40L19.9992 40V80.0156H39.9992V100.016L-0.000793457 120.016V0.015625Z", fill: "white" }),
|
|
312
|
+
/* @__PURE__ */ jsx8("path", { d: "M119.999 0L79.9992 20V40H99.9992V80H79.9992V100L119.999 120V0Z", fill: "white" }),
|
|
313
|
+
/* @__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
314
|
] }),
|
|
214
|
-
/* @__PURE__ */
|
|
315
|
+
/* @__PURE__ */ jsx8("defs", { children: /* @__PURE__ */ jsx8("clipPath", { id: "clip0_10581_4008", children: /* @__PURE__ */ jsx8("rect", { width: 120, height: 120, fill: "white" }) }) })
|
|
215
316
|
] });
|
|
216
317
|
var trueforge_logomark_dark_default = SvgTrueforgeLogomarkDark;
|
|
217
318
|
|
|
218
319
|
// 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__ */
|
|
320
|
+
import * as React9 from "react";
|
|
321
|
+
import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
322
|
+
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: [
|
|
323
|
+
/* @__PURE__ */ jsxs5("g", { clipPath: "url(#clip0_10581_1729)", children: [
|
|
324
|
+
/* @__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" }),
|
|
325
|
+
/* @__PURE__ */ jsx9("path", { d: "M139.999 0L93.3324 23.3333V46.6667H116.666V93.3333H93.3324V116.667L139.999 140V0Z", fill: "#05090E" }),
|
|
326
|
+
/* @__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
327
|
] }),
|
|
227
|
-
/* @__PURE__ */
|
|
328
|
+
/* @__PURE__ */ jsx9("defs", { children: /* @__PURE__ */ jsx9("clipPath", { id: "clip0_10581_1729", children: /* @__PURE__ */ jsx9("rect", { width: 140, height: 140, fill: "white" }) }) })
|
|
228
329
|
] });
|
|
229
330
|
var trueforge_logomark_light_default = SvgTrueforgeLogomarkLight;
|
|
230
331
|
|
|
@@ -232,25 +333,43 @@ var trueforge_logomark_light_default = SvgTrueforgeLogomarkLight;
|
|
|
232
333
|
registerIcons({
|
|
233
334
|
"mcp-server": mcp_server_default,
|
|
234
335
|
"agent-2": agent_2_default,
|
|
336
|
+
// Prefer the custom agent glyph over Lucide Bot for bot/robot aliases.
|
|
337
|
+
bot: agent_2_default,
|
|
338
|
+
robot: agent_2_default,
|
|
235
339
|
compare: compare_default,
|
|
236
340
|
ai: ai_default,
|
|
237
341
|
searchGlobe: search_globe_default,
|
|
238
342
|
"brain-regular": brain_regular_default,
|
|
343
|
+
empty: empty_default,
|
|
239
344
|
"trueforge-logomark-light": trueforge_logomark_light_default,
|
|
240
345
|
"trueforge-logomark-dark": trueforge_logomark_dark_default
|
|
241
346
|
});
|
|
242
347
|
|
|
243
348
|
// src/containers/McpOauthContainer/PostMcpOauthScreen.tsx
|
|
244
349
|
import { useEffect, useState } from "react";
|
|
245
|
-
import { jsx as
|
|
350
|
+
import { jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
246
351
|
var BROADCAST_RETRY_DELAY_MS = 1e3;
|
|
247
352
|
var WINDOW_CLOSE_DELAY_MS = 5e3;
|
|
353
|
+
function resolvePopupSuccess(searchParams) {
|
|
354
|
+
if (searchParams.get("error")) {
|
|
355
|
+
return false;
|
|
356
|
+
}
|
|
357
|
+
const flag = searchParams.get("isSuccess")?.toLowerCase();
|
|
358
|
+
if (flag === "true") {
|
|
359
|
+
return true;
|
|
360
|
+
}
|
|
361
|
+
if (flag === "false") {
|
|
362
|
+
return false;
|
|
363
|
+
}
|
|
364
|
+
const code = searchParams.get("code");
|
|
365
|
+
return code != null && code.length > 0;
|
|
366
|
+
}
|
|
248
367
|
var PostMcpOauthScreen = () => {
|
|
249
368
|
const [result, setResult] = useState();
|
|
250
369
|
useEffect(() => {
|
|
251
370
|
const searchParams = new URLSearchParams(window.location.search);
|
|
252
371
|
const popupUid = searchParams.get("pUid");
|
|
253
|
-
const isSuccess2 = searchParams
|
|
372
|
+
const isSuccess2 = resolvePopupSuccess(searchParams);
|
|
254
373
|
setResult(popupUid ? { popupUid, isSuccess: isSuccess2 } : null);
|
|
255
374
|
const broadcastResult = () => {
|
|
256
375
|
if (!popupUid) return;
|
|
@@ -272,22 +391,462 @@ var PostMcpOauthScreen = () => {
|
|
|
272
391
|
const isSuccess = !!result?.isSuccess;
|
|
273
392
|
const title = result === void 0 ? "Completing authorization" : isSuccess ? "Authorization successful" : "Authorization failed";
|
|
274
393
|
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__ */
|
|
394
|
+
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: [
|
|
395
|
+
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" }),
|
|
396
|
+
/* @__PURE__ */ jsx10("h1", { className: "text-2xl font-semibold text-text-primary", children: title }),
|
|
397
|
+
/* @__PURE__ */ jsx10("p", { className: "text-sm leading-6 text-text-secondary", children: description })
|
|
279
398
|
] }) });
|
|
280
399
|
};
|
|
281
400
|
var PostMcpOauthScreen_default = PostMcpOauthScreen;
|
|
282
401
|
|
|
402
|
+
// src/containers/ThreadListContainer.tsx
|
|
403
|
+
import {
|
|
404
|
+
ThreadListItemByIndexProvider,
|
|
405
|
+
ThreadListItemMorePrimitive,
|
|
406
|
+
ThreadListItemPrimitive,
|
|
407
|
+
ThreadListPrimitive,
|
|
408
|
+
useAui as useAui2,
|
|
409
|
+
useAuiState as useAuiState2
|
|
410
|
+
} from "@assistant-ui/react";
|
|
411
|
+
import { useCallback, useEffect as useEffect3, useMemo, useRef as useRef2, useState as useState3 } from "react";
|
|
412
|
+
|
|
413
|
+
// src/atoms/AgentHistoryFilterButton.tsx
|
|
414
|
+
import { useEffect as useEffect2, useId, useLayoutEffect, useRef, useState as useState2 } from "react";
|
|
415
|
+
import { createPortal } from "react-dom";
|
|
416
|
+
import { Fragment, jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
417
|
+
function AgentHistoryFilterButton() {
|
|
418
|
+
const shell = useOptionalShellMode();
|
|
419
|
+
const server = useOptionalServer();
|
|
420
|
+
const isMobile = useIsMobile();
|
|
421
|
+
const compact = useCompactLayout();
|
|
422
|
+
const useSheet = isMobile || compact;
|
|
423
|
+
const [open, setOpen] = useState2(false);
|
|
424
|
+
const [query, setQuery] = useState2("");
|
|
425
|
+
const [menuPos, setMenuPos] = useState2(null);
|
|
426
|
+
const buttonRef = useRef(null);
|
|
427
|
+
const menuRef = useRef(null);
|
|
428
|
+
const menuId = useId();
|
|
429
|
+
const enabled = shell?.isLibraryEnabled === true && server != null;
|
|
430
|
+
const selected = shell?.historyAgentFilter ?? null;
|
|
431
|
+
useEffect2(() => {
|
|
432
|
+
if (!open) setQuery("");
|
|
433
|
+
}, [open]);
|
|
434
|
+
const { agents, isInitialLoading, isSearching, loadingMore, hasMore, listRef, sentinelRef } = useSearchAgentsList({
|
|
435
|
+
enabled: open && enabled,
|
|
436
|
+
query
|
|
437
|
+
});
|
|
438
|
+
useLayoutEffect(() => {
|
|
439
|
+
if (!open || useSheet) {
|
|
440
|
+
setMenuPos(null);
|
|
441
|
+
return;
|
|
442
|
+
}
|
|
443
|
+
const update = () => {
|
|
444
|
+
const rect = buttonRef.current?.getBoundingClientRect();
|
|
445
|
+
if (!rect) return;
|
|
446
|
+
setMenuPos({ top: rect.top, left: rect.right + 4 });
|
|
447
|
+
};
|
|
448
|
+
update();
|
|
449
|
+
window.addEventListener("resize", update);
|
|
450
|
+
window.addEventListener("scroll", update, true);
|
|
451
|
+
return () => {
|
|
452
|
+
window.removeEventListener("resize", update);
|
|
453
|
+
window.removeEventListener("scroll", update, true);
|
|
454
|
+
};
|
|
455
|
+
}, [open, useSheet]);
|
|
456
|
+
useEffect2(() => {
|
|
457
|
+
if (!open || useSheet) return;
|
|
458
|
+
const handler = (e) => {
|
|
459
|
+
const target = e.target;
|
|
460
|
+
if (buttonRef.current?.contains(target) || menuRef.current?.contains(target)) return;
|
|
461
|
+
setOpen(false);
|
|
462
|
+
};
|
|
463
|
+
document.addEventListener("mousedown", handler);
|
|
464
|
+
return () => document.removeEventListener("mousedown", handler);
|
|
465
|
+
}, [open, useSheet]);
|
|
466
|
+
if (!enabled) return null;
|
|
467
|
+
const pick = (agentId) => {
|
|
468
|
+
shell?.setHistoryAgentFilter(agentId);
|
|
469
|
+
setOpen(false);
|
|
470
|
+
};
|
|
471
|
+
const filterBody = /* @__PURE__ */ jsxs7(Fragment, { children: [
|
|
472
|
+
/* @__PURE__ */ jsxs7("div", { className: "p-1", onMouseDown: (e) => e.stopPropagation(), children: [
|
|
473
|
+
/* @__PURE__ */ jsx11(SearchInput_default, { query, setQuery, placeholder: "Search agents" }),
|
|
474
|
+
isSearching ? /* @__PURE__ */ jsx11("p", { className: "text-text-secondary px-1 pt-1 text-[11px]", role: "status", children: "Searching\u2026" }) : null
|
|
475
|
+
] }),
|
|
476
|
+
/* @__PURE__ */ jsxs7(
|
|
477
|
+
"div",
|
|
478
|
+
{
|
|
479
|
+
ref: listRef,
|
|
480
|
+
className: cn("mt-1 overflow-y-auto", useSheet ? "min-h-0 flex-1 px-1 pb-2" : "min-h-48 max-h-64"),
|
|
481
|
+
children: [
|
|
482
|
+
query.trim() === "" ? /* @__PURE__ */ jsxs7(
|
|
483
|
+
DropdownMenuItem,
|
|
484
|
+
{
|
|
485
|
+
className: cn(
|
|
486
|
+
"justify-between",
|
|
487
|
+
selected == null && "bg-dropdown-selected-item-bg text-dropdown-selected-item-text"
|
|
488
|
+
),
|
|
489
|
+
onClick: () => pick(null),
|
|
490
|
+
children: [
|
|
491
|
+
"All chats",
|
|
492
|
+
selected == null ? /* @__PURE__ */ jsx11(Icon, { name: "check", className: "size-3.5 shrink-0" }) : null
|
|
493
|
+
]
|
|
494
|
+
}
|
|
495
|
+
) : null,
|
|
496
|
+
isInitialLoading ? /* @__PURE__ */ jsx11("p", { className: "px-2 py-3 text-center text-xs text-text-secondary", children: "Loading\u2026" }) : agents.length === 0 ? /* @__PURE__ */ jsx11("p", { className: "text-text-secondary px-2 py-6 text-center text-xs", role: "status", children: query.trim() ? `No agents match "${query.trim()}".` : "No agents yet." }) : /* @__PURE__ */ jsxs7(Fragment, { children: [
|
|
497
|
+
agents.map((agent) => {
|
|
498
|
+
const id = libraryAgentId(agent);
|
|
499
|
+
const active = selected === id;
|
|
500
|
+
return /* @__PURE__ */ jsxs7(
|
|
501
|
+
DropdownMenuItem,
|
|
502
|
+
{
|
|
503
|
+
className: cn(
|
|
504
|
+
"justify-between gap-2 text-left",
|
|
505
|
+
active && "bg-dropdown-selected-item-bg text-dropdown-selected-item-text"
|
|
506
|
+
),
|
|
507
|
+
onClick: () => pick(id),
|
|
508
|
+
children: [
|
|
509
|
+
/* @__PURE__ */ jsx11("span", { className: "min-w-0 truncate", children: agent.name }),
|
|
510
|
+
active ? /* @__PURE__ */ jsx11(Icon, { name: "check", className: "size-3.5 shrink-0" }) : null
|
|
511
|
+
]
|
|
512
|
+
},
|
|
513
|
+
id
|
|
514
|
+
);
|
|
515
|
+
}),
|
|
516
|
+
hasMore ? /* @__PURE__ */ jsx11("div", { ref: sentinelRef, className: "flex h-6 shrink-0 items-center justify-center", "aria-hidden": true, children: loadingMore ? /* @__PURE__ */ jsx11("span", { className: "text-text-secondary text-[11px]", role: "status", children: "Loading more\u2026" }) : null }) : null
|
|
517
|
+
] })
|
|
518
|
+
]
|
|
519
|
+
}
|
|
520
|
+
)
|
|
521
|
+
] });
|
|
522
|
+
return /* @__PURE__ */ jsxs7("div", { className: "relative shrink-0", children: [
|
|
523
|
+
/* @__PURE__ */ jsxs7(
|
|
524
|
+
"button",
|
|
525
|
+
{
|
|
526
|
+
ref: buttonRef,
|
|
527
|
+
type: "button",
|
|
528
|
+
"aria-label": selected != null ? `Filter chat history by agent (${selected})` : "Filter chat history by agent",
|
|
529
|
+
"aria-haspopup": useSheet ? "dialog" : "menu",
|
|
530
|
+
"aria-expanded": open,
|
|
531
|
+
"aria-controls": open ? menuId : void 0,
|
|
532
|
+
title: "Filter by agent",
|
|
533
|
+
className: auiButtonClass({
|
|
534
|
+
variant: "ghost",
|
|
535
|
+
size: "icon",
|
|
536
|
+
className: cn(
|
|
537
|
+
"relative size-7 shrink-0 text-text-secondary hover:bg-ghost-button-hover hover:text-ghost-button-text",
|
|
538
|
+
selected != null && "text-text-primary"
|
|
539
|
+
)
|
|
540
|
+
}),
|
|
541
|
+
onClick: () => setOpen((v) => !v),
|
|
542
|
+
children: [
|
|
543
|
+
/* @__PURE__ */ jsx11(Icon, { name: "funnel", className: "size-3.5" }),
|
|
544
|
+
selected != null ? /* @__PURE__ */ jsx11(
|
|
545
|
+
"span",
|
|
546
|
+
{
|
|
547
|
+
className: "bg-primary-button-bg absolute top-1 right-1 size-1.5 rounded-full",
|
|
548
|
+
"aria-hidden": true,
|
|
549
|
+
"data-testid": "history-filter-active-dot"
|
|
550
|
+
}
|
|
551
|
+
) : null
|
|
552
|
+
]
|
|
553
|
+
}
|
|
554
|
+
),
|
|
555
|
+
useSheet && open ? /* @__PURE__ */ jsx11(BottomSheet, { open: true, onOpenChange: setOpen, id: menuId, "aria-label": "Filter agents", children: /* @__PURE__ */ jsx11("div", { className: "flex min-h-0 flex-1 flex-col p-2", role: "menu", children: filterBody }) }) : null,
|
|
556
|
+
!useSheet && open && menuPos != null ? createPortal(
|
|
557
|
+
/* @__PURE__ */ jsx11(
|
|
558
|
+
"div",
|
|
559
|
+
{
|
|
560
|
+
ref: menuRef,
|
|
561
|
+
id: menuId,
|
|
562
|
+
role: "menu",
|
|
563
|
+
"aria-label": "Filter agents",
|
|
564
|
+
style: { top: menuPos.top, left: menuPos.left },
|
|
565
|
+
className: "font-sans-flex fixed z-50 w-56 rounded-md border border-border bg-card-bg p-1 text-text-primary shadow-md",
|
|
566
|
+
children: filterBody
|
|
567
|
+
}
|
|
568
|
+
),
|
|
569
|
+
themePortalRoot(buttonRef.current)
|
|
570
|
+
) : null
|
|
571
|
+
] });
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
// src/containers/ThreadListContainer.tsx
|
|
575
|
+
import { Fragment as Fragment2, jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
576
|
+
var deleteItemClass = "flex w-full cursor-pointer select-none items-center gap-2 rounded-md px-2 py-1.5 text-sm font-medium text-failure-bg outline-none transition-colors hover:bg-failure-bg/12 hover:text-failure-bg focus:bg-failure-bg/12 focus:text-failure-bg data-[highlighted]:bg-failure-bg/12 data-[highlighted]:text-failure-bg";
|
|
577
|
+
function ThreadListItemDeleteMenu() {
|
|
578
|
+
const compact = useCompactLayout();
|
|
579
|
+
const isMobile = useIsMobile();
|
|
580
|
+
const [sheetOpen, setSheetOpen] = useState3(false);
|
|
581
|
+
const [portalContainer, setPortalContainer] = useState3();
|
|
582
|
+
const useSheet = isMobile || compact;
|
|
583
|
+
const setTriggerElement = useCallback((element) => {
|
|
584
|
+
const themeRoot = element?.closest(".aui-theme-root");
|
|
585
|
+
setPortalContainer(themeRoot instanceof HTMLElement ? themeRoot : void 0);
|
|
586
|
+
}, []);
|
|
587
|
+
const moreButtonClass = auiButtonClass({
|
|
588
|
+
variant: "ghost",
|
|
589
|
+
size: "icon",
|
|
590
|
+
className: "size-7 shrink-0 text-text-secondary hover:bg-transparent hover:text-text-primary"
|
|
591
|
+
});
|
|
592
|
+
if (useSheet) {
|
|
593
|
+
return /* @__PURE__ */ jsxs8(Fragment2, { children: [
|
|
594
|
+
/* @__PURE__ */ jsx12(
|
|
595
|
+
"button",
|
|
596
|
+
{
|
|
597
|
+
type: "button",
|
|
598
|
+
"aria-label": "Session actions",
|
|
599
|
+
title: "Session actions",
|
|
600
|
+
"aria-haspopup": "dialog",
|
|
601
|
+
"aria-expanded": sheetOpen,
|
|
602
|
+
className: moreButtonClass,
|
|
603
|
+
onClick: () => setSheetOpen(true),
|
|
604
|
+
children: /* @__PURE__ */ jsx12(Icon, { name: "ellipsis", className: "size-3.5" })
|
|
605
|
+
}
|
|
606
|
+
),
|
|
607
|
+
sheetOpen ? /* @__PURE__ */ jsx12(BottomSheet, { open: true, onOpenChange: setSheetOpen, "aria-label": "Session actions", children: /* @__PURE__ */ jsx12("div", { className: "flex flex-col gap-1 p-2", role: "menu", children: /* @__PURE__ */ jsxs8(ThreadListItemPrimitive.Delete, { className: deleteItemClass, onClick: () => setSheetOpen(false), children: [
|
|
608
|
+
/* @__PURE__ */ jsx12(Icon, { name: "trash", className: "size-3.5" }),
|
|
609
|
+
"Delete"
|
|
610
|
+
] }) }) }) : null
|
|
611
|
+
] });
|
|
612
|
+
}
|
|
613
|
+
return /* @__PURE__ */ jsxs8(ThreadListItemMorePrimitive.Root, { sharedFocusGroup: true, children: [
|
|
614
|
+
/* @__PURE__ */ jsx12(
|
|
615
|
+
ThreadListItemMorePrimitive.Trigger,
|
|
616
|
+
{
|
|
617
|
+
ref: setTriggerElement,
|
|
618
|
+
"aria-label": "Session actions",
|
|
619
|
+
title: "Session actions",
|
|
620
|
+
className: moreButtonClass,
|
|
621
|
+
children: /* @__PURE__ */ jsx12(Icon, { name: "ellipsis", className: "size-3.5" })
|
|
622
|
+
}
|
|
623
|
+
),
|
|
624
|
+
/* @__PURE__ */ jsx12(
|
|
625
|
+
ThreadListItemMorePrimitive.Content,
|
|
626
|
+
{
|
|
627
|
+
portalProps: { container: portalContainer },
|
|
628
|
+
align: "end",
|
|
629
|
+
sideOffset: 4,
|
|
630
|
+
className: "font-sans-flex z-50 min-w-[8rem] rounded-md border border-border bg-card-bg p-1 text-text-primary shadow-md",
|
|
631
|
+
children: /* @__PURE__ */ jsx12(ThreadListItemPrimitive.Delete, { asChild: true, children: /* @__PURE__ */ jsxs8(ThreadListItemMorePrimitive.Item, { className: deleteItemClass, children: [
|
|
632
|
+
/* @__PURE__ */ jsx12(Icon, { name: "trash", className: "size-3.5" }),
|
|
633
|
+
"Delete"
|
|
634
|
+
] }) })
|
|
635
|
+
}
|
|
636
|
+
)
|
|
637
|
+
] });
|
|
638
|
+
}
|
|
639
|
+
function ThreadListItemRow({
|
|
640
|
+
onThreadOpen,
|
|
641
|
+
canDeleteSession
|
|
642
|
+
}) {
|
|
643
|
+
const aui = useAui2();
|
|
644
|
+
const shell = useOptionalShellMode();
|
|
645
|
+
const ThreadListRow2 = useSlot("ThreadListRow");
|
|
646
|
+
const id = useAuiState2((s) => s.threadListItem.id);
|
|
647
|
+
const remoteId = useAuiState2((s) => s.threadListItem.remoteId);
|
|
648
|
+
const title = useAuiState2((s) => s.threadListItem.title);
|
|
649
|
+
const lastMessageAt = useAuiState2((s) => s.threadListItem.lastMessageAt);
|
|
650
|
+
const custom = useAuiState2((s) => s.threadListItem.custom);
|
|
651
|
+
const mainThreadId = useAuiState2((s) => s.threads.mainThreadId);
|
|
652
|
+
const agentName = readThreadAgentName(custom);
|
|
653
|
+
const showDelete = canDeleteSession && remoteId != null;
|
|
654
|
+
const sidebarNavOpen = shell?.libraryOpen === true || shell?.sessionsOpen === true || shell?.schedulesOpen === true;
|
|
655
|
+
return /* @__PURE__ */ jsx12(ThreadListItemPrimitive.Root, { className: "min-w-0", children: /* @__PURE__ */ jsx12(
|
|
656
|
+
ThreadListRow2,
|
|
657
|
+
{
|
|
658
|
+
title: title ?? "New Chat",
|
|
659
|
+
active: id === mainThreadId && !sidebarNavOpen,
|
|
660
|
+
agentName,
|
|
661
|
+
lastMessageAt,
|
|
662
|
+
onSelect: () => {
|
|
663
|
+
onThreadOpen?.();
|
|
664
|
+
shell?.setSettingsOpen(false);
|
|
665
|
+
shell?.setLibraryOpen(false);
|
|
666
|
+
shell?.setSessionsOpen(false);
|
|
667
|
+
shell?.setSchedulesOpen(false);
|
|
668
|
+
const sessionMutable = threadListItemIsMutable(custom);
|
|
669
|
+
const sameImmutable = !sessionMutable && shell?.mode.status === "active" && !shell.mode.isMutable && (agentName == null ? shell.mode.agentName == null && shell.mode.agentId == null : shell.mode.agentName === agentName || shell.mode.agentId === agentName);
|
|
670
|
+
const sameMutable = canReuseMutableShell({
|
|
671
|
+
sessionMutable,
|
|
672
|
+
shellMutable: shell?.mode.status === "active" && shell.mode.isMutable,
|
|
673
|
+
...shell?.mode.status === "active" && shell.mode.isMutable ? { shellAgentName: shell.mode.agentName, shellAgentId: shell.mode.agentId } : {},
|
|
674
|
+
remoteId,
|
|
675
|
+
pendingSessionId: shell?.pendingSessionId
|
|
676
|
+
});
|
|
677
|
+
if ((sameImmutable || sameMutable) && remoteId != null) {
|
|
678
|
+
void Promise.resolve(aui.threads().switchToThread(id)).catch(() => void 0);
|
|
679
|
+
return;
|
|
680
|
+
}
|
|
681
|
+
if (remoteId != null) {
|
|
682
|
+
shell?.openHistorySession({
|
|
683
|
+
sessionId: remoteId,
|
|
684
|
+
isMutable: sessionMutable,
|
|
685
|
+
...agentName != null ? { agentName } : {}
|
|
686
|
+
});
|
|
687
|
+
return;
|
|
688
|
+
}
|
|
689
|
+
void Promise.resolve(aui.threads().switchToThread(id)).catch(() => void 0);
|
|
690
|
+
},
|
|
691
|
+
actions: showDelete ? /* @__PURE__ */ jsx12(ThreadListItemDeleteMenu, {}) : void 0
|
|
692
|
+
}
|
|
693
|
+
) });
|
|
694
|
+
}
|
|
695
|
+
function useThreadListIndicesByRecency() {
|
|
696
|
+
const threadIds = useAuiState2((s) => s.threads.threadIds);
|
|
697
|
+
const threadItems = useAuiState2((s) => s.threads.threadItems);
|
|
698
|
+
return useMemo(() => threadListIndicesByRecency({ threadIds, threadItems }), [threadIds, threadItems]);
|
|
699
|
+
}
|
|
700
|
+
function ThreadListItemsByRecency({
|
|
701
|
+
onThreadOpen,
|
|
702
|
+
canDeleteSession
|
|
703
|
+
}) {
|
|
704
|
+
const indices = useThreadListIndicesByRecency();
|
|
705
|
+
const threadIds = useAuiState2((s) => s.threads.threadIds);
|
|
706
|
+
return /* @__PURE__ */ jsx12(Fragment2, { children: indices.map((index) => {
|
|
707
|
+
const key = threadIds[index] ?? String(index);
|
|
708
|
+
return /* @__PURE__ */ jsx12(ThreadListItemByIndexProvider, { index, archived: false, children: /* @__PURE__ */ jsx12(ThreadListItemRow, { onThreadOpen, canDeleteSession }) }, key);
|
|
709
|
+
}) });
|
|
710
|
+
}
|
|
711
|
+
var THREAD_LIST_VIEWPORT_SLOT = "aui_thread-list-viewport";
|
|
712
|
+
var LOAD_MORE_BOTTOM_PX = 80;
|
|
713
|
+
function ChatHistorySection({ children, viewportRef }) {
|
|
714
|
+
const [expanded, setExpanded] = useState3(true);
|
|
715
|
+
const shell = useOptionalShellMode();
|
|
716
|
+
const showFilter = shell?.isLibraryEnabled === true;
|
|
717
|
+
return /* @__PURE__ */ jsxs8("div", { className: "flex min-h-0 flex-1 flex-col", children: [
|
|
718
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex shrink-0 items-center gap-1 px-1 py-1", children: [
|
|
719
|
+
/* @__PURE__ */ jsxs8(
|
|
720
|
+
"button",
|
|
721
|
+
{
|
|
722
|
+
type: "button",
|
|
723
|
+
"aria-expanded": expanded,
|
|
724
|
+
className: "flex min-w-0 flex-1 items-center gap-1 rounded-md px-1.5 py-1 text-left text-sm font-medium text-text-secondary hover:bg-ghost-button-hover hover:text-text-primary",
|
|
725
|
+
onClick: () => setExpanded((v) => !v),
|
|
726
|
+
children: [
|
|
727
|
+
/* @__PURE__ */ jsx12("span", { className: "truncate", children: "Chat History" }),
|
|
728
|
+
/* @__PURE__ */ jsx12(
|
|
729
|
+
Icon,
|
|
730
|
+
{
|
|
731
|
+
name: "chevron-down",
|
|
732
|
+
className: cn("size-3.5 shrink-0 transition-transform", !expanded && "-rotate-90")
|
|
733
|
+
}
|
|
734
|
+
)
|
|
735
|
+
]
|
|
736
|
+
}
|
|
737
|
+
),
|
|
738
|
+
showFilter ? /* @__PURE__ */ jsx12(AgentHistoryFilterButton, {}) : null
|
|
739
|
+
] }),
|
|
740
|
+
expanded ? /* @__PURE__ */ jsx12(
|
|
741
|
+
"div",
|
|
742
|
+
{
|
|
743
|
+
ref: viewportRef,
|
|
744
|
+
"data-slot": THREAD_LIST_VIEWPORT_SLOT,
|
|
745
|
+
className: "flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto",
|
|
746
|
+
children
|
|
747
|
+
}
|
|
748
|
+
) : null
|
|
749
|
+
] });
|
|
750
|
+
}
|
|
751
|
+
function ThreadListContainer({ onThreadOpen } = {}) {
|
|
752
|
+
const aui = useAui2();
|
|
753
|
+
const server = useOptionalServer();
|
|
754
|
+
const isLoading = useAuiState2((s) => s.threads.isLoading);
|
|
755
|
+
const isLoadingMore = useAuiState2((s) => s.threads.isLoadingMore);
|
|
756
|
+
const hasMore = useAuiState2((s) => s.threads.hasMore);
|
|
757
|
+
const threadIds = useAuiState2((s) => s.threads.threadIds);
|
|
758
|
+
const shell = useOptionalShellMode();
|
|
759
|
+
const ThreadListShell2 = useSlot("ThreadListShell");
|
|
760
|
+
const ThreadListNewButton2 = useSlot("ThreadListNewButton");
|
|
761
|
+
const AgentsLibraryButton2 = useSlot("AgentsLibraryButton");
|
|
762
|
+
const SessionsBrowserButton2 = useSlot("SessionsBrowserButton");
|
|
763
|
+
const SchedulesButton2 = useSlot("SchedulesButton");
|
|
764
|
+
const ThreadListRowSkeleton2 = useSlot("ThreadListRowSkeleton");
|
|
765
|
+
const ThreadListEmptyState2 = useSlot("ThreadListEmptyState");
|
|
766
|
+
const viewportRef = useRef2(null);
|
|
767
|
+
const hasMoreRef = useRef2(hasMore);
|
|
768
|
+
const auiRef = useRef2(aui);
|
|
769
|
+
hasMoreRef.current = hasMore;
|
|
770
|
+
auiRef.current = aui;
|
|
771
|
+
const showNewChat = shell?.isNewChatEnabled !== false;
|
|
772
|
+
const isIdle = shell?.mode.status === "idle";
|
|
773
|
+
const canDeleteSession = typeof server?.deleteSession === "function";
|
|
774
|
+
useEffect3(() => {
|
|
775
|
+
if (isIdle || isLoading || isLoadingMore) return;
|
|
776
|
+
const viewport = viewportRef.current;
|
|
777
|
+
if (!viewport) return;
|
|
778
|
+
let cancelled = false;
|
|
779
|
+
const tryLoadMore = () => {
|
|
780
|
+
if (cancelled || !hasMoreRef.current) return;
|
|
781
|
+
if (viewport.clientHeight <= 0) return;
|
|
782
|
+
const remaining = viewport.scrollHeight - viewport.scrollTop - viewport.clientHeight;
|
|
783
|
+
if (viewport.scrollHeight > viewport.clientHeight && remaining > LOAD_MORE_BOTTOM_PX) return;
|
|
784
|
+
void auiRef.current.threads().loadMore();
|
|
785
|
+
};
|
|
786
|
+
viewport.addEventListener("scroll", tryLoadMore, { passive: true });
|
|
787
|
+
const resizeObserver = typeof ResizeObserver === "undefined" ? void 0 : new ResizeObserver(() => tryLoadMore());
|
|
788
|
+
if (resizeObserver) {
|
|
789
|
+
resizeObserver.observe(viewport);
|
|
790
|
+
} else {
|
|
791
|
+
window.addEventListener("resize", tryLoadMore);
|
|
792
|
+
}
|
|
793
|
+
tryLoadMore();
|
|
794
|
+
return () => {
|
|
795
|
+
cancelled = true;
|
|
796
|
+
viewport.removeEventListener("scroll", tryLoadMore);
|
|
797
|
+
resizeObserver?.disconnect();
|
|
798
|
+
if (!resizeObserver) {
|
|
799
|
+
window.removeEventListener("resize", tryLoadMore);
|
|
800
|
+
}
|
|
801
|
+
};
|
|
802
|
+
}, [hasMore, isIdle, isLoading, isLoadingMore, threadIds.length]);
|
|
803
|
+
const handleNewChat = () => {
|
|
804
|
+
onThreadOpen?.();
|
|
805
|
+
shell?.setLibraryOpen(false);
|
|
806
|
+
shell?.setSessionsOpen(false);
|
|
807
|
+
if (shell?.isComposerEnabled) {
|
|
808
|
+
shell.openDraft();
|
|
809
|
+
return;
|
|
810
|
+
}
|
|
811
|
+
shell?.setSettingsOpen(false);
|
|
812
|
+
shell?.setSchedulesOpen(false);
|
|
813
|
+
void Promise.resolve(aui.threads().switchToNewThread()).catch(() => void 0);
|
|
814
|
+
};
|
|
815
|
+
let listBody;
|
|
816
|
+
if (isIdle) {
|
|
817
|
+
listBody = /* @__PURE__ */ jsx12(ThreadListEmptyState2, {});
|
|
818
|
+
} else if (isLoading) {
|
|
819
|
+
listBody = /* @__PURE__ */ jsx12(ThreadListRowSkeleton2, {});
|
|
820
|
+
} else if (threadIds.length === 0) {
|
|
821
|
+
listBody = /* @__PURE__ */ jsx12(ThreadListEmptyState2, {});
|
|
822
|
+
} else {
|
|
823
|
+
listBody = /* @__PURE__ */ jsx12(ThreadListPrimitive.Root, { className: "flex min-h-0 flex-col gap-0.5", children: /* @__PURE__ */ jsx12(ThreadListItemsByRecency, { onThreadOpen, canDeleteSession }) });
|
|
824
|
+
}
|
|
825
|
+
return /* @__PURE__ */ jsx12(
|
|
826
|
+
ThreadListShell2,
|
|
827
|
+
{
|
|
828
|
+
header: /* @__PURE__ */ jsxs8("div", { className: "flex flex-col gap-1", children: [
|
|
829
|
+
showNewChat ? /* @__PURE__ */ jsx12(ThreadListNewButton2, { onClick: handleNewChat }) : null,
|
|
830
|
+
/* @__PURE__ */ jsx12(AgentsLibraryButton2, {}),
|
|
831
|
+
/* @__PURE__ */ jsx12(SessionsBrowserButton2, {}),
|
|
832
|
+
/* @__PURE__ */ jsx12(SchedulesButton2, {})
|
|
833
|
+
] }),
|
|
834
|
+
children: /* @__PURE__ */ jsxs8(ChatHistorySection, { viewportRef, children: [
|
|
835
|
+
listBody,
|
|
836
|
+
!isIdle && hasMore ? /* @__PURE__ */ jsx12("div", { className: "h-4 shrink-0", "aria-hidden": true }) : null
|
|
837
|
+
] })
|
|
838
|
+
}
|
|
839
|
+
);
|
|
840
|
+
}
|
|
841
|
+
|
|
283
842
|
// src/containers/ToolGroupContainer.tsx
|
|
284
|
-
import { useAuiState as
|
|
285
|
-
import { useState as
|
|
286
|
-
import { jsx as
|
|
843
|
+
import { useAuiState as useAuiState3 } from "@assistant-ui/react";
|
|
844
|
+
import { useState as useState4 } from "react";
|
|
845
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
287
846
|
function ToolGroupContainer({ children, group }) {
|
|
288
847
|
const ToolGroupCard2 = useSlot("ToolGroupCard");
|
|
289
848
|
const toolCallCount = group.indices.length;
|
|
290
|
-
const active =
|
|
849
|
+
const active = useAuiState3((s) => {
|
|
291
850
|
if (s.message.status?.type !== "running") return false;
|
|
292
851
|
const lastIndex = s.message.parts.length - 1;
|
|
293
852
|
if (lastIndex < 0) return false;
|
|
@@ -295,13 +854,13 @@ function ToolGroupContainer({ children, group }) {
|
|
|
295
854
|
const lastGroupIndex = group.indices[group.indices.length - 1];
|
|
296
855
|
return lastGroupIndex !== void 0 && lastIndex >= group.indices[0] && lastIndex <= lastGroupIndex;
|
|
297
856
|
});
|
|
298
|
-
const [expanded, setExpanded] =
|
|
299
|
-
const [prevActive, setPrevActive] =
|
|
857
|
+
const [expanded, setExpanded] = useState4(true);
|
|
858
|
+
const [prevActive, setPrevActive] = useState4(active);
|
|
300
859
|
if (active !== prevActive) {
|
|
301
860
|
setPrevActive(active);
|
|
302
861
|
if (active) setExpanded(true);
|
|
303
862
|
}
|
|
304
|
-
return /* @__PURE__ */
|
|
863
|
+
return /* @__PURE__ */ jsx13(
|
|
305
864
|
ToolGroupCard2,
|
|
306
865
|
{
|
|
307
866
|
toolCallCount,
|
|
@@ -315,20 +874,20 @@ function ToolGroupContainer({ children, group }) {
|
|
|
315
874
|
|
|
316
875
|
// src/containers/TrueForgeUI.tsx
|
|
317
876
|
import { lazy, Suspense } from "react";
|
|
318
|
-
import { jsx as
|
|
877
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
319
878
|
var TrueForgeUIWithRouter = lazy(
|
|
320
|
-
() => import("./TrueForgeUIWithRouter-
|
|
879
|
+
() => import("./TrueForgeUIWithRouter-MZVJWJMB.js").then((m) => ({ default: m.TrueForgeUIWithRouter }))
|
|
321
880
|
);
|
|
322
881
|
function TrueForgeUI(props) {
|
|
323
882
|
const isMcpAuthScreen = typeof window !== "undefined" && new URLSearchParams(window.location.search).get("screenType") === "mcp-auth";
|
|
324
883
|
if (isMcpAuthScreen) {
|
|
325
|
-
return /* @__PURE__ */
|
|
884
|
+
return /* @__PURE__ */ jsx14(SlotsProvider, { overrides: props.overrides, theme: props.theme, children: /* @__PURE__ */ jsx14(PostMcpOauthScreen_default, {}) });
|
|
326
885
|
}
|
|
327
886
|
const { withRouter, ...rest } = props;
|
|
328
887
|
if (withRouter) {
|
|
329
|
-
return /* @__PURE__ */
|
|
888
|
+
return /* @__PURE__ */ jsx14(Suspense, { fallback: /* @__PURE__ */ jsx14(ServerInitLoader, { className: props.className }), children: /* @__PURE__ */ jsx14(TrueForgeUIWithRouter, { ...rest }) });
|
|
330
889
|
}
|
|
331
|
-
return /* @__PURE__ */
|
|
890
|
+
return /* @__PURE__ */ jsx14(TrueForgeUIShell, { ...rest });
|
|
332
891
|
}
|
|
333
892
|
|
|
334
893
|
// src/index.ts
|
|
@@ -347,6 +906,32 @@ import {
|
|
|
347
906
|
useTrueFoundryUpdateAgentSpec
|
|
348
907
|
} from "@truefoundry/assistant-ui-runtime";
|
|
349
908
|
export {
|
|
909
|
+
AgentCodeBlock,
|
|
910
|
+
AgentConfigEditors,
|
|
911
|
+
AgentConfigPanel,
|
|
912
|
+
AgentConfigSection,
|
|
913
|
+
AgentDetailsHeader,
|
|
914
|
+
AgentDetailsPage,
|
|
915
|
+
AgentDetailsTabs,
|
|
916
|
+
AgentDetailsUnavailable,
|
|
917
|
+
AgentInstructionsDrawer,
|
|
918
|
+
AgentMcpEditorContent,
|
|
919
|
+
AgentMetricCard,
|
|
920
|
+
AgentMetricChart,
|
|
921
|
+
AgentMetricsContainer,
|
|
922
|
+
AgentMetricsTimeRangeFilter,
|
|
923
|
+
AgentMetricsView,
|
|
924
|
+
AgentModelConfigModal,
|
|
925
|
+
AgentModelEditorContent,
|
|
926
|
+
AgentModelSettingsContent,
|
|
927
|
+
AgentOverviewCard,
|
|
928
|
+
AgentResourceConfigModal,
|
|
929
|
+
AgentResourceEditorContent,
|
|
930
|
+
AgentRuntimeConfigFields,
|
|
931
|
+
AgentRuntimeConfigModal,
|
|
932
|
+
AgentRuntimeEditorContent,
|
|
933
|
+
AgentSessionsFilters,
|
|
934
|
+
AgentSkillsEditorContent,
|
|
350
935
|
AgentStepsCard,
|
|
351
936
|
AgentStepsContainer,
|
|
352
937
|
AgentsLibrary,
|
|
@@ -378,6 +963,9 @@ export {
|
|
|
378
963
|
CustomActionContainer,
|
|
379
964
|
CustomActionRenderersProvider,
|
|
380
965
|
DEFAULT_AGENT_CONFIG,
|
|
966
|
+
DEFAULT_TABLE_PAGE_SIZE,
|
|
967
|
+
DraftAgentConfigTrigger,
|
|
968
|
+
DraftCapabilitiesPanel,
|
|
381
969
|
DraftCatalogProvider,
|
|
382
970
|
DraftComposerLeftSection,
|
|
383
971
|
DraftComposerRightSection,
|
|
@@ -385,6 +973,7 @@ export {
|
|
|
385
973
|
DraftModelSelector,
|
|
386
974
|
HistoryLoader,
|
|
387
975
|
HistoryLoaderContainer,
|
|
976
|
+
IS_CREATE_AGENT_METADATA_KEY,
|
|
388
977
|
Icon,
|
|
389
978
|
MCP_AUTH_POPUP_CHANNEL,
|
|
390
979
|
Markdown,
|
|
@@ -399,6 +988,7 @@ export {
|
|
|
399
988
|
MonacoEditorCore,
|
|
400
989
|
OpenUiFenceBlock,
|
|
401
990
|
PRESETS,
|
|
991
|
+
PopoverSelect,
|
|
402
992
|
PostMcpOauthScreen_default as PostMcpOauthScreen,
|
|
403
993
|
ReasoningContainer,
|
|
404
994
|
ResumeUnavailable,
|
|
@@ -406,15 +996,37 @@ export {
|
|
|
406
996
|
SandboxArtifactDownload,
|
|
407
997
|
SandboxToolCallCard,
|
|
408
998
|
SaveAgentButton,
|
|
999
|
+
SaveAgentForm,
|
|
1000
|
+
SaveAgentFormFields,
|
|
1001
|
+
ScheduleFormDrawer,
|
|
1002
|
+
ScheduleFormFields,
|
|
1003
|
+
ScheduleLastRunsCell,
|
|
1004
|
+
ScheduleRunChip,
|
|
1005
|
+
ScheduleStatusBadge,
|
|
1006
|
+
SchedulesButton,
|
|
1007
|
+
SchedulesPage,
|
|
409
1008
|
ScrollToBottomButton,
|
|
410
1009
|
SelectAgentEmptyState,
|
|
411
1010
|
ServerProvider,
|
|
1011
|
+
SessionsBrowserButton,
|
|
1012
|
+
SessionsPage,
|
|
412
1013
|
ShellActionsActionSlot,
|
|
413
1014
|
ShellModeProvider,
|
|
1015
|
+
SideDrawer,
|
|
414
1016
|
SlotsProvider,
|
|
415
1017
|
SubAgentCard,
|
|
416
1018
|
Switch,
|
|
417
1019
|
SyntaxHighlighter,
|
|
1020
|
+
TABLE_PAGE_SIZE_OPTIONS,
|
|
1021
|
+
Table,
|
|
1022
|
+
TableBody,
|
|
1023
|
+
TableCell,
|
|
1024
|
+
TableHead,
|
|
1025
|
+
TableHeader,
|
|
1026
|
+
TablePagination,
|
|
1027
|
+
TableRow,
|
|
1028
|
+
TableTokenPagination,
|
|
1029
|
+
TestScheduleScreen,
|
|
418
1030
|
ThemeProvider,
|
|
419
1031
|
Thread,
|
|
420
1032
|
ThreadComposerAreaShell,
|
|
@@ -451,14 +1063,20 @@ export {
|
|
|
451
1063
|
createTrueFoundryServer,
|
|
452
1064
|
defaultSlots,
|
|
453
1065
|
getErrorMessage,
|
|
1066
|
+
isCreateAgentMetadataValue,
|
|
454
1067
|
libraryAgentId,
|
|
455
1068
|
mergeAgentSpec,
|
|
456
1069
|
preloadMarkdownOpenUI,
|
|
1070
|
+
readSessionIsCreateAgent,
|
|
457
1071
|
resolveBrandChrome,
|
|
458
1072
|
resolvePresetTokens,
|
|
1073
|
+
sessionIsCreateAgent,
|
|
1074
|
+
shellIsCreateAgent,
|
|
459
1075
|
shellIsMutable,
|
|
460
1076
|
threadHasPendingMcpAuth,
|
|
461
1077
|
trueFoundryAttachmentAdapter,
|
|
1078
|
+
useAgentMetricsServer,
|
|
1079
|
+
useAgentSessionsServer,
|
|
462
1080
|
useAui,
|
|
463
1081
|
useAuiState,
|
|
464
1082
|
useBrand,
|
|
@@ -469,11 +1087,15 @@ export {
|
|
|
469
1087
|
useContentClassNames,
|
|
470
1088
|
useDraftCatalog,
|
|
471
1089
|
useMCPAuth,
|
|
1090
|
+
useOptionalAgentMetricsServer,
|
|
1091
|
+
useOptionalAgentSessionsServer,
|
|
472
1092
|
useOptionalCatalogServer,
|
|
473
1093
|
useOptionalContentClassNames,
|
|
474
1094
|
useOptionalCustomActionRenderers,
|
|
1095
|
+
useOptionalScheduleServer,
|
|
475
1096
|
useOptionalServer,
|
|
476
1097
|
useOptionalShellMode,
|
|
1098
|
+
useScheduleServer,
|
|
477
1099
|
useServer,
|
|
478
1100
|
useServerCapabilities,
|
|
479
1101
|
useShellMode,
|