@truefoundry/trueforge-ui 0.3.0 → 0.4.0-rc.0
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 +27 -0
- package/NOTICE +1 -1
- package/README.md +26 -89
- package/dist/{AgentCodeSnippets-EK7KMIY2.js → AgentCodeSnippets-BPC6TD7K.js} +7 -7
- package/dist/AgentMetricChart-T6DZZ37Y.js +15 -0
- package/dist/{AgentOverview-5UPMYHT2.js → AgentOverview-BFU7EO4Y.js} +7 -7
- package/dist/{AgentSessionEventTimeline-V6NPCYMW.js → AgentSessionEventTimeline-ATVBTYDF.js} +7 -7
- package/dist/{AgentSessionEventTimelineChart-YQWZBQCG.js → AgentSessionEventTimelineChart-H577STKW.js} +7 -7
- package/dist/{AgentSessions-WNYVVB6Q.js → AgentSessions-GDLBXFIK.js} +8 -8
- package/dist/{ConnectorSettings-O4I24244.js → ConnectorSettings-FYNF6J3F.js} +7 -7
- package/dist/{DockLayout-JMBZVMGB.js → DockLayout-SGUOMZ5E.js} +10 -10
- package/dist/{DrawerLayout-E6G3IF6R.js → DrawerLayout-MJJYQDCW.js} +11 -11
- package/dist/{ModelSettings-ZVXMXIU4.js → ModelSettings-6EW7U2MP.js} +9 -9
- package/dist/ModelSettings-6EW7U2MP.js.map +1 -0
- package/dist/OpenUiFenceBlock-BZPFNXWZ.js +9 -0
- package/dist/{SandboxSettings-H6BA2DJQ.js → SandboxSettings-HQVBGHXZ.js} +7 -7
- package/dist/SchedulesPage-ZO3PJY4J.js +15 -0
- package/dist/{SettingsBuilder-VA3VGWZC.js → SettingsBuilder-FODMI7HG.js} +20 -11
- package/dist/SettingsBuilder-FODMI7HG.js.map +1 -0
- package/dist/{ShellRouteSync-ZT4PBE6T.js → ShellRouteSync-4I5BP2VY.js} +4 -4
- package/dist/{SidebarLayout-ICXEN7ZL.js → SidebarLayout-ZLWG2YGO.js} +12 -12
- package/dist/{SkillSettings-F5JGGFXR.js → SkillSettings-AFSAOU6O.js} +7 -7
- package/dist/{TrueForgeUIWithRouter-MKJ7IEWG.js → TrueForgeUIWithRouter-RQX5XWGI.js} +9 -9
- package/dist/WebSearchSettings-BW4CWGRR.js +322 -0
- package/dist/WebSearchSettings-BW4CWGRR.js.map +1 -0
- package/dist/{WidgetLayout-J7ZRW3V3.js → WidgetLayout-WIPKUIL4.js} +10 -10
- package/dist/chunk-6UACSIIY.js +587 -0
- package/dist/chunk-6UACSIIY.js.map +1 -0
- package/dist/{chunk-U7WONUMR.js → chunk-7S7A3PNP.js} +6 -4
- package/dist/chunk-7S7A3PNP.js.map +1 -0
- package/dist/{chunk-VTOW2UIX.js → chunk-GHXA46A2.js} +78 -43
- package/dist/chunk-GHXA46A2.js.map +1 -0
- package/dist/{chunk-7AAO4UDQ.js → chunk-HCGDDQ4G.js} +5 -5
- package/dist/chunk-HCGDDQ4G.js.map +1 -0
- package/dist/{chunk-SCIEO6CF.js → chunk-HDMBSLDC.js} +2 -2
- package/dist/{chunk-KZK2PQ4A.js → chunk-MLMR26WQ.js} +244 -152
- package/dist/chunk-MLMR26WQ.js.map +1 -0
- package/dist/{chunk-BREN6OSX.js → chunk-Q22RHDYS.js} +42 -61
- package/dist/chunk-Q22RHDYS.js.map +1 -0
- package/dist/{chunk-WFIA627Q.js → chunk-QKFMAQ7O.js} +2 -2
- package/dist/{chunk-7VWUB5OV.js → chunk-TFQWCBFQ.js} +12 -12
- package/dist/chunk-TFQWCBFQ.js.map +1 -0
- package/dist/{chunk-JEAULQNF.js → chunk-TJGGIEF6.js} +3 -3
- package/dist/{chunk-KDCVFHPZ.js → chunk-TX6PB3DY.js} +3 -3
- package/dist/{chunk-MEW7WZ7Q.js → chunk-VBZXCX7Y.js} +253 -99
- package/dist/chunk-VBZXCX7Y.js.map +1 -0
- package/dist/{chunk-QI4HGU5E.js → chunk-Y47LJKXD.js} +13 -19
- package/dist/{chunk-QI4HGU5E.js.map → chunk-Y47LJKXD.js.map} +1 -1
- package/dist/{chunk-MB7Z5FPI.js → chunk-YN5ZBBQM.js} +9 -9
- package/dist/{chunk-UN7WPTTK.js → chunk-ZYJ2SBF7.js} +2 -2
- package/dist/createTrueForgeServer-DiSooQdh.d.ts +42 -0
- package/dist/index.d.ts +45 -39
- package/dist/index.js +43 -43
- package/dist/index.js.map +1 -1
- package/dist/plugins/trueforge-agent-server-adapter/index.d.ts +57 -894
- package/dist/plugins/trueforge-agent-server-adapter/index.js +110 -7
- 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/AgentMetricChart-UZCYOC4M.js +0 -15
- package/dist/ModelSettings-ZVXMXIU4.js.map +0 -1
- package/dist/OpenUiFenceBlock-F3YVDKAG.js +0 -9
- package/dist/SchedulesPage-FS2QZ5KB.js +0 -15
- package/dist/SettingsBuilder-VA3VGWZC.js.map +0 -1
- package/dist/chunk-7AAO4UDQ.js.map +0 -1
- package/dist/chunk-7VWUB5OV.js.map +0 -1
- package/dist/chunk-BREN6OSX.js.map +0 -1
- package/dist/chunk-KZK2PQ4A.js.map +0 -1
- package/dist/chunk-MEW7WZ7Q.js.map +0 -1
- package/dist/chunk-NXK4XW4U.js +0 -587
- package/dist/chunk-NXK4XW4U.js.map +0 -1
- package/dist/chunk-U7WONUMR.js.map +0 -1
- package/dist/chunk-VTOW2UIX.js.map +0 -1
- package/dist/createTrueFoundryServer-B_FYhSdn.d.ts +0 -42
- /package/dist/{AgentCodeSnippets-EK7KMIY2.js.map → AgentCodeSnippets-BPC6TD7K.js.map} +0 -0
- /package/dist/{AgentMetricChart-UZCYOC4M.js.map → AgentMetricChart-T6DZZ37Y.js.map} +0 -0
- /package/dist/{AgentOverview-5UPMYHT2.js.map → AgentOverview-BFU7EO4Y.js.map} +0 -0
- /package/dist/{AgentSessionEventTimeline-V6NPCYMW.js.map → AgentSessionEventTimeline-ATVBTYDF.js.map} +0 -0
- /package/dist/{AgentSessionEventTimelineChart-YQWZBQCG.js.map → AgentSessionEventTimelineChart-H577STKW.js.map} +0 -0
- /package/dist/{AgentSessions-WNYVVB6Q.js.map → AgentSessions-GDLBXFIK.js.map} +0 -0
- /package/dist/{ConnectorSettings-O4I24244.js.map → ConnectorSettings-FYNF6J3F.js.map} +0 -0
- /package/dist/{DockLayout-JMBZVMGB.js.map → DockLayout-SGUOMZ5E.js.map} +0 -0
- /package/dist/{DrawerLayout-E6G3IF6R.js.map → DrawerLayout-MJJYQDCW.js.map} +0 -0
- /package/dist/{OpenUiFenceBlock-F3YVDKAG.js.map → OpenUiFenceBlock-BZPFNXWZ.js.map} +0 -0
- /package/dist/{SandboxSettings-H6BA2DJQ.js.map → SandboxSettings-HQVBGHXZ.js.map} +0 -0
- /package/dist/{SchedulesPage-FS2QZ5KB.js.map → SchedulesPage-ZO3PJY4J.js.map} +0 -0
- /package/dist/{ShellRouteSync-ZT4PBE6T.js.map → ShellRouteSync-4I5BP2VY.js.map} +0 -0
- /package/dist/{SidebarLayout-ICXEN7ZL.js.map → SidebarLayout-ZLWG2YGO.js.map} +0 -0
- /package/dist/{SkillSettings-F5JGGFXR.js.map → SkillSettings-AFSAOU6O.js.map} +0 -0
- /package/dist/{TrueForgeUIWithRouter-MKJ7IEWG.js.map → TrueForgeUIWithRouter-RQX5XWGI.js.map} +0 -0
- /package/dist/{WidgetLayout-J7ZRW3V3.js.map → WidgetLayout-WIPKUIL4.js.map} +0 -0
- /package/dist/{chunk-SCIEO6CF.js.map → chunk-HDMBSLDC.js.map} +0 -0
- /package/dist/{chunk-WFIA627Q.js.map → chunk-QKFMAQ7O.js.map} +0 -0
- /package/dist/{chunk-JEAULQNF.js.map → chunk-TJGGIEF6.js.map} +0 -0
- /package/dist/{chunk-KDCVFHPZ.js.map → chunk-TX6PB3DY.js.map} +0 -0
- /package/dist/{chunk-MB7Z5FPI.js.map → chunk-YN5ZBBQM.js.map} +0 -0
- /package/dist/{chunk-UN7WPTTK.js.map → chunk-ZYJ2SBF7.js.map} +0 -0
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
SEARCH_AGENTS_PAGE_SIZE,
|
|
3
|
-
replaceScheduleShareSearch,
|
|
4
|
-
searchAllAgents,
|
|
5
|
-
useSearchAgentsList
|
|
6
|
-
} from "./chunk-UN7WPTTK.js";
|
|
7
1
|
import {
|
|
8
2
|
Icon,
|
|
9
3
|
PageHeader,
|
|
@@ -14,7 +8,13 @@ import {
|
|
|
14
8
|
sidebarRailButtonClassName,
|
|
15
9
|
useCompactLayout,
|
|
16
10
|
useDraftCatalog
|
|
17
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-TX6PB3DY.js";
|
|
12
|
+
import {
|
|
13
|
+
SEARCH_AGENTS_PAGE_SIZE,
|
|
14
|
+
replaceScheduleShareSearch,
|
|
15
|
+
searchAllAgents,
|
|
16
|
+
useSearchAgentsList
|
|
17
|
+
} from "./chunk-ZYJ2SBF7.js";
|
|
18
18
|
import {
|
|
19
19
|
SESSION_CUSTOM_RANGE_MAX_DAYS,
|
|
20
20
|
SESSION_SHARE_CHANGE_EVENT,
|
|
@@ -43,13 +43,13 @@ import {
|
|
|
43
43
|
useServer,
|
|
44
44
|
useServerCapabilities,
|
|
45
45
|
useShellMode
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-7S7A3PNP.js";
|
|
47
47
|
import {
|
|
48
48
|
useAuiState
|
|
49
49
|
} from "./chunk-M6MHLVSO.js";
|
|
50
50
|
import {
|
|
51
51
|
OpenUiFenceBlock
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-QKFMAQ7O.js";
|
|
53
53
|
import {
|
|
54
54
|
ThemeContext,
|
|
55
55
|
ThemeProvider,
|
|
@@ -57,7 +57,7 @@ import {
|
|
|
57
57
|
useOptionalContentClassNames,
|
|
58
58
|
useOptionalThemeMode,
|
|
59
59
|
useOptionalThemePreset
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-6UACSIIY.js";
|
|
61
61
|
|
|
62
62
|
// src/theme/brand.tsx
|
|
63
63
|
import { useContext } from "react";
|
|
@@ -471,7 +471,7 @@ function LightTooltip({
|
|
|
471
471
|
}
|
|
472
472
|
|
|
473
473
|
// src/theme/SlotsProvider.tsx
|
|
474
|
-
import { createContext as createContext8, useContext as useContext9, useMemo as
|
|
474
|
+
import { createContext as createContext8, useContext as useContext9, useMemo as useMemo18 } from "react";
|
|
475
475
|
|
|
476
476
|
// src/theme/defaultSlots.ts
|
|
477
477
|
import { lazy } from "react";
|
|
@@ -704,6 +704,8 @@ import { jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
|
704
704
|
var DEFAULT_TITLE = "MCP Authentication Required";
|
|
705
705
|
function McpAuthPrompt({
|
|
706
706
|
servers,
|
|
707
|
+
connectedServerIds,
|
|
708
|
+
continueLoading = false,
|
|
707
709
|
onConnect,
|
|
708
710
|
onContinue,
|
|
709
711
|
readOnly = false,
|
|
@@ -726,12 +728,27 @@ function McpAuthPrompt({
|
|
|
726
728
|
/* @__PURE__ */ jsx10("span", { className: "shrink-0 text-xs font-semibold text-text-secondary", children: ":" }),
|
|
727
729
|
/* @__PURE__ */ jsx10("span", { className: "truncate font-sans font-medium text-text-primary", children: server.name })
|
|
728
730
|
] }),
|
|
729
|
-
/* @__PURE__ */ jsxs6(
|
|
730
|
-
"
|
|
731
|
-
|
|
732
|
-
] })
|
|
731
|
+
connectedServerIds?.has(server.id) ? /* @__PURE__ */ jsxs6("span", { className: "inline-flex shrink-0 items-center gap-1 text-xs text-success-bg", children: [
|
|
732
|
+
/* @__PURE__ */ jsx10(Icon, { name: "check", size: "0.875rem" }),
|
|
733
|
+
"Connected"
|
|
734
|
+
] }) : /* @__PURE__ */ jsxs6(
|
|
735
|
+
Button.Primary,
|
|
736
|
+
{
|
|
737
|
+
size: "small",
|
|
738
|
+
disabled: readOnly,
|
|
739
|
+
onClick: () => onConnect(server.id),
|
|
740
|
+
className: "shrink-0",
|
|
741
|
+
children: [
|
|
742
|
+
"Connect",
|
|
743
|
+
/* @__PURE__ */ jsx10(Icon, { name: "external-link", size: "0.75em", className: "ml-1" })
|
|
744
|
+
]
|
|
745
|
+
}
|
|
746
|
+
)
|
|
733
747
|
] }, server.id)),
|
|
734
|
-
onContinue && /* @__PURE__ */ jsx10("div", { className: "flex justify-end border-t border-border pt-2", children: /* @__PURE__ */
|
|
748
|
+
onContinue && /* @__PURE__ */ jsx10("div", { className: "flex justify-end border-t border-border pt-2", children: /* @__PURE__ */ jsxs6(Button.Primary, { size: "small", disabled: readOnly || continueLoading, onClick: onContinue, children: [
|
|
749
|
+
continueLoading ? /* @__PURE__ */ jsx10(Icon, { name: "loader", className: "animate-spin" }) : null,
|
|
750
|
+
"Continue"
|
|
751
|
+
] }) })
|
|
735
752
|
] })
|
|
736
753
|
]
|
|
737
754
|
}
|
|
@@ -2532,7 +2549,20 @@ function AgentSessionDetailHeader({
|
|
|
2532
2549
|
] });
|
|
2533
2550
|
}
|
|
2534
2551
|
|
|
2552
|
+
// src/atoms/lib/dateFormat.ts
|
|
2553
|
+
function formatAbsoluteDateTime(date) {
|
|
2554
|
+
return new Intl.DateTimeFormat(void 0, {
|
|
2555
|
+
month: "short",
|
|
2556
|
+
day: "numeric",
|
|
2557
|
+
year: "numeric",
|
|
2558
|
+
hour: "numeric",
|
|
2559
|
+
minute: "2-digit",
|
|
2560
|
+
hour12: true
|
|
2561
|
+
}).format(date);
|
|
2562
|
+
}
|
|
2563
|
+
|
|
2535
2564
|
// src/atoms/lib/threadListMeta.ts
|
|
2565
|
+
var MAX_SESSION_TITLE_LENGTH = 50;
|
|
2536
2566
|
function formatRelativeShort(date, now = /* @__PURE__ */ new Date()) {
|
|
2537
2567
|
const diffMs = Math.max(0, now.getTime() - date.getTime());
|
|
2538
2568
|
const minutes = Math.floor(diffMs / 6e4);
|
|
@@ -2602,7 +2632,9 @@ function AgentSessionListRow({
|
|
|
2602
2632
|
canDelete = true
|
|
2603
2633
|
}) {
|
|
2604
2634
|
const PermissionGuard2 = useSlot("PermissionGuard");
|
|
2605
|
-
const
|
|
2635
|
+
const activityAt = new Date(lastActivityAt);
|
|
2636
|
+
const relative = formatRelativeShort(activityAt);
|
|
2637
|
+
const absolute = formatAbsoluteDateTime(activityAt);
|
|
2606
2638
|
return /* @__PURE__ */ jsxs22(
|
|
2607
2639
|
"div",
|
|
2608
2640
|
{
|
|
@@ -2673,7 +2705,7 @@ function AgentSessionListRow({
|
|
|
2673
2705
|
/* @__PURE__ */ jsx32("span", { className: "truncate", children: agentName }),
|
|
2674
2706
|
/* @__PURE__ */ jsx32("span", { "aria-hidden": "true", children: "\xB7" })
|
|
2675
2707
|
] }) : null,
|
|
2676
|
-
/* @__PURE__ */ jsx32("span", { children: relative })
|
|
2708
|
+
/* @__PURE__ */ jsx32(Tooltip, { content: absolute, side: "bottom", children: /* @__PURE__ */ jsx32("span", { children: relative }) })
|
|
2677
2709
|
] }),
|
|
2678
2710
|
/* @__PURE__ */ jsx32("span", { className: "shrink-0 tabular-nums", children: formatSessionListMetrics(metrics) })
|
|
2679
2711
|
]
|
|
@@ -2841,7 +2873,7 @@ function AgentSessionMetricsStrip({ metrics }) {
|
|
|
2841
2873
|
metrics.totalCostUsd == null ? "@min-[48rem]:grid-cols-7" : "@min-[48rem]:grid-cols-8"
|
|
2842
2874
|
),
|
|
2843
2875
|
children: [
|
|
2844
|
-
/* @__PURE__ */ jsx34(SessionMetricTile, { id: "turns", label: "Turns", value: metrics.totalTurns }),
|
|
2876
|
+
/* @__PURE__ */ jsx34(SessionMetricTile, { id: "turns", label: metrics.totalTurns > 1 ? "Turns" : "Turn", value: metrics.totalTurns }),
|
|
2845
2877
|
/* @__PURE__ */ jsx34(
|
|
2846
2878
|
SessionMetricTile,
|
|
2847
2879
|
{
|
|
@@ -4712,7 +4744,7 @@ function ChatFileDownload({
|
|
|
4712
4744
|
}
|
|
4713
4745
|
|
|
4714
4746
|
// src/hooks/useChatChromeActionsVisible.ts
|
|
4715
|
-
import {
|
|
4747
|
+
import { useTrueForgeAgentSpec } from "@truefoundry/trueforge-assistant-ui-runtime";
|
|
4716
4748
|
|
|
4717
4749
|
// src/utils/isNewChatView.ts
|
|
4718
4750
|
var isNewChatView = (s) => s.thread.messages.length === 0 && (!s.thread.isLoading || s.threads.isLoading) && s.threadListItem.remoteId == null;
|
|
@@ -4743,7 +4775,7 @@ function useNamedAgentHeaderVisible() {
|
|
|
4743
4775
|
}
|
|
4744
4776
|
function useSaveAgentVisible() {
|
|
4745
4777
|
const shell = useOptionalShellMode();
|
|
4746
|
-
const { agentSpec } =
|
|
4778
|
+
const { agentSpec } = useTrueForgeAgentSpec();
|
|
4747
4779
|
if (shell == null || shell.mode.status !== "active" || !shell.mode.isMutable || !shell.mode.isCreateAgent) {
|
|
4748
4780
|
return false;
|
|
4749
4781
|
}
|
|
@@ -5826,7 +5858,7 @@ function DraftModelCatalogPanel({
|
|
|
5826
5858
|
id: listboxId,
|
|
5827
5859
|
role: "listbox",
|
|
5828
5860
|
"aria-label": "Select model",
|
|
5829
|
-
className: "flex min-h-0 flex-
|
|
5861
|
+
className: "flex min-h-0 flex-auto flex-col overflow-y-auto p-1",
|
|
5830
5862
|
children: filtered.length === 0 ? /* @__PURE__ */ jsx62(
|
|
5831
5863
|
DraftCatalogEmptyState,
|
|
5832
5864
|
{
|
|
@@ -6828,7 +6860,7 @@ function AgentInstructionsDrawer({
|
|
|
6828
6860
|
import { useEffect as useEffect16, useRef as useRef11, useState as useState28 } from "react";
|
|
6829
6861
|
|
|
6830
6862
|
// src/hooks/useMcpAuth.ts
|
|
6831
|
-
import { useCallback as useCallback9, useEffect as useEffect15,
|
|
6863
|
+
import { useCallback as useCallback9, useEffect as useEffect15, useRef as useRef10, useState as useState27 } from "react";
|
|
6832
6864
|
var MCP_AUTH_POPUP_CHANNEL = "truefoundry-mcp-auth-popup";
|
|
6833
6865
|
var generatePopupUid = () => `mcp-oauth-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`;
|
|
6834
6866
|
var isPopupMessage = (value) => {
|
|
@@ -6838,47 +6870,99 @@ var isPopupMessage = (value) => {
|
|
|
6838
6870
|
};
|
|
6839
6871
|
var useMCPAuth = ({ callbackPath } = {}) => {
|
|
6840
6872
|
const { connectorCatalog } = useCatalogServer();
|
|
6873
|
+
const server = useOptionalServer();
|
|
6841
6874
|
const toaster = useToasterOptional();
|
|
6842
|
-
const [
|
|
6843
|
-
const
|
|
6844
|
-
const
|
|
6845
|
-
|
|
6846
|
-
|
|
6847
|
-
|
|
6875
|
+
const [loadingCount, setLoadingCount] = useState27(0);
|
|
6876
|
+
const activeAttemptsRef = useRef10(/* @__PURE__ */ new Set());
|
|
6877
|
+
const popupCleanupRef = useRef10(/* @__PURE__ */ new Set());
|
|
6878
|
+
useEffect15(() => {
|
|
6879
|
+
const activeAttempts = activeAttemptsRef.current;
|
|
6880
|
+
const popupCleanups = popupCleanupRef.current;
|
|
6881
|
+
return () => {
|
|
6882
|
+
activeAttempts.clear();
|
|
6883
|
+
for (const cleanup of popupCleanups) cleanup();
|
|
6884
|
+
popupCleanups.clear();
|
|
6885
|
+
};
|
|
6848
6886
|
}, []);
|
|
6849
|
-
|
|
6887
|
+
const loadConnector = useCallback9(
|
|
6888
|
+
async (integrationId) => {
|
|
6889
|
+
if (server?.getMcpConnector !== void 0) {
|
|
6890
|
+
return server.getMcpConnector({ connectorId: integrationId });
|
|
6891
|
+
}
|
|
6892
|
+
return connectorCatalog.getConnector({ id: integrationId });
|
|
6893
|
+
},
|
|
6894
|
+
[connectorCatalog, server]
|
|
6895
|
+
);
|
|
6896
|
+
const reportVerifiedSuccess = useCallback9(
|
|
6897
|
+
async ({
|
|
6898
|
+
integrationId,
|
|
6899
|
+
callback,
|
|
6900
|
+
attempt
|
|
6901
|
+
}) => {
|
|
6902
|
+
try {
|
|
6903
|
+
const connector = await loadConnector(integrationId);
|
|
6904
|
+
if (!activeAttemptsRef.current.has(attempt)) return;
|
|
6905
|
+
if (!connector.authenticated) {
|
|
6906
|
+
throw new Error("The MCP server is not authenticated yet. Please try again.");
|
|
6907
|
+
}
|
|
6908
|
+
callback(true);
|
|
6909
|
+
} catch (error) {
|
|
6910
|
+
if (!activeAttemptsRef.current.has(attempt)) return;
|
|
6911
|
+
toaster?.showError(error);
|
|
6912
|
+
callback(false);
|
|
6913
|
+
}
|
|
6914
|
+
},
|
|
6915
|
+
[loadConnector, toaster]
|
|
6916
|
+
);
|
|
6850
6917
|
const openAuthPopup = useCallback9(
|
|
6851
|
-
(
|
|
6852
|
-
|
|
6918
|
+
({
|
|
6919
|
+
authorizationEndpoint,
|
|
6920
|
+
integrationId,
|
|
6921
|
+
callback,
|
|
6922
|
+
attempt,
|
|
6923
|
+
popupUid
|
|
6924
|
+
}) => {
|
|
6853
6925
|
const channel = new BroadcastChannel(MCP_AUTH_POPUP_CHANNEL);
|
|
6854
6926
|
let popup = null;
|
|
6855
|
-
const
|
|
6927
|
+
const cleanupChannel = () => {
|
|
6856
6928
|
channel.close();
|
|
6929
|
+
popupCleanupRef.current.delete(cleanupWithPopup);
|
|
6930
|
+
};
|
|
6931
|
+
const cleanupWithPopup = () => {
|
|
6932
|
+
cleanupChannel();
|
|
6857
6933
|
popup?.close();
|
|
6858
6934
|
};
|
|
6859
6935
|
channel.onmessage = (event) => {
|
|
6860
6936
|
if (!isPopupMessage(event.data) || event.data.popupUid !== popupUid) return;
|
|
6861
|
-
|
|
6862
|
-
|
|
6863
|
-
|
|
6864
|
-
|
|
6937
|
+
const { isSuccess } = event.data;
|
|
6938
|
+
cleanupChannel();
|
|
6939
|
+
if (!isSuccess) {
|
|
6940
|
+
if (activeAttemptsRef.current.delete(attempt)) callback(false);
|
|
6941
|
+
return;
|
|
6865
6942
|
}
|
|
6943
|
+
void reportVerifiedSuccess({ integrationId, callback, attempt }).finally(() => {
|
|
6944
|
+
activeAttemptsRef.current.delete(attempt);
|
|
6945
|
+
});
|
|
6866
6946
|
};
|
|
6867
|
-
|
|
6947
|
+
popupCleanupRef.current.add(cleanupWithPopup);
|
|
6868
6948
|
popup = window.open(authorizationEndpoint, "_blank", "popup=true");
|
|
6869
6949
|
if (!popup) {
|
|
6870
|
-
|
|
6950
|
+
cleanupWithPopup();
|
|
6871
6951
|
throw new Error("Popup blocked. Please allow pop-ups to authorize the MCP server.");
|
|
6872
6952
|
}
|
|
6873
6953
|
popup.focus();
|
|
6874
6954
|
},
|
|
6875
|
-
[
|
|
6955
|
+
[reportVerifiedSuccess]
|
|
6876
6956
|
);
|
|
6877
6957
|
const handleAuthorize = useCallback9(
|
|
6878
6958
|
async (integrationId, callback) => {
|
|
6879
6959
|
if (!integrationId) return;
|
|
6960
|
+
const attempt = {};
|
|
6961
|
+
const popupUid = generatePopupUid();
|
|
6962
|
+
activeAttemptsRef.current.add(attempt);
|
|
6963
|
+
setLoadingCount((count) => count + 1);
|
|
6964
|
+
let popupOpened = false;
|
|
6880
6965
|
try {
|
|
6881
|
-
setIsOAuthLoading(true);
|
|
6882
6966
|
const callbackUrl = callbackPath ? new URL(callbackPath, window.location.origin) : new URL(window.location.href);
|
|
6883
6967
|
callbackUrl.searchParams.set("screenType", "mcp-auth");
|
|
6884
6968
|
callbackUrl.searchParams.set("integrationId", integrationId);
|
|
@@ -6887,27 +6971,31 @@ var useMCPAuth = ({ callbackPath } = {}) => {
|
|
|
6887
6971
|
id: integrationId,
|
|
6888
6972
|
returnTo: `${callbackUrl.pathname}${callbackUrl.search}`
|
|
6889
6973
|
});
|
|
6974
|
+
if (!activeAttemptsRef.current.has(attempt)) return;
|
|
6890
6975
|
if ("status" in result && result.status?.toUpperCase() === "AUTHENTICATED" || "authenticated" in result && result.authenticated) {
|
|
6891
|
-
callback
|
|
6976
|
+
await reportVerifiedSuccess({ integrationId, callback, attempt });
|
|
6892
6977
|
return;
|
|
6893
6978
|
}
|
|
6894
6979
|
const authorizationEndpoint = "authorization_endpoint" in result ? result.authorization_endpoint : void 0;
|
|
6895
6980
|
if (!authorizationEndpoint) {
|
|
6896
6981
|
throw new Error("The MCP server did not return an authorization URL.");
|
|
6897
6982
|
}
|
|
6898
|
-
openAuthPopup(authorizationEndpoint, callback);
|
|
6983
|
+
openAuthPopup({ authorizationEndpoint, integrationId, callback, attempt, popupUid });
|
|
6984
|
+
popupOpened = true;
|
|
6899
6985
|
} catch (error) {
|
|
6986
|
+
if (!activeAttemptsRef.current.has(attempt)) return;
|
|
6900
6987
|
toaster?.showError(error);
|
|
6901
6988
|
callback(false);
|
|
6902
6989
|
} finally {
|
|
6903
|
-
|
|
6990
|
+
if (activeAttemptsRef.current.has(attempt)) setLoadingCount((count) => count - 1);
|
|
6991
|
+
if (!popupOpened) activeAttemptsRef.current.delete(attempt);
|
|
6904
6992
|
}
|
|
6905
6993
|
},
|
|
6906
|
-
[callbackPath, connectorCatalog, openAuthPopup,
|
|
6994
|
+
[callbackPath, connectorCatalog, openAuthPopup, reportVerifiedSuccess, toaster]
|
|
6907
6995
|
);
|
|
6908
6996
|
return {
|
|
6909
6997
|
handleAuthorize,
|
|
6910
|
-
isOAuthLoading
|
|
6998
|
+
isOAuthLoading: loadingCount > 0
|
|
6911
6999
|
};
|
|
6912
7000
|
};
|
|
6913
7001
|
|
|
@@ -7583,7 +7671,7 @@ function AgentMcpEditorContent({
|
|
|
7583
7671
|
}
|
|
7584
7672
|
|
|
7585
7673
|
// src/atoms/draft/AgentModelConfigModal.tsx
|
|
7586
|
-
import { useMemo as
|
|
7674
|
+
import { useMemo as useMemo6 } from "react";
|
|
7587
7675
|
|
|
7588
7676
|
// src/atoms/primitives/CenteredModal.tsx
|
|
7589
7677
|
import { useEffect as useEffect17, useId as useId7, useRef as useRef12 } from "react";
|
|
@@ -7664,7 +7752,7 @@ function CenteredModal({
|
|
|
7664
7752
|
}
|
|
7665
7753
|
)
|
|
7666
7754
|
] }),
|
|
7667
|
-
/* @__PURE__ */ jsx70("div", { className: "flex min-h-0 flex-
|
|
7755
|
+
/* @__PURE__ */ jsx70("div", { className: "flex min-h-0 flex-auto flex-col overflow-x-hidden overflow-y-auto", children }),
|
|
7668
7756
|
footer ? /* @__PURE__ */ jsx70("div", { className: "shrink-0 border-t border-border px-5 py-3", children: footer }) : null
|
|
7669
7757
|
]
|
|
7670
7758
|
}
|
|
@@ -7686,7 +7774,7 @@ function AgentModelConfigModal({
|
|
|
7686
7774
|
}) {
|
|
7687
7775
|
const AgentModelEditorContent2 = useSlot("AgentModelEditorContent");
|
|
7688
7776
|
const AgentModelSettingsContent2 = useSlot("AgentModelSettingsContent");
|
|
7689
|
-
const model =
|
|
7777
|
+
const model = useMemo6(() => models.find((item) => item.name === spec.model.name), [models, spec.model.name]);
|
|
7690
7778
|
const selectingModel = editor === "model";
|
|
7691
7779
|
return /* @__PURE__ */ jsx71(
|
|
7692
7780
|
CenteredModal,
|
|
@@ -7714,7 +7802,7 @@ function AgentModelConfigModal({
|
|
|
7714
7802
|
}
|
|
7715
7803
|
|
|
7716
7804
|
// src/atoms/draft/AgentModelEditorContent.tsx
|
|
7717
|
-
import { useCallback as useCallback10, useId as useId8, useMemo as
|
|
7805
|
+
import { useCallback as useCallback10, useId as useId8, useMemo as useMemo7, useState as useState29 } from "react";
|
|
7718
7806
|
|
|
7719
7807
|
// src/atoms/draft/reasoningEffort.ts
|
|
7720
7808
|
function hasReasoningEfforts(efforts) {
|
|
@@ -7759,12 +7847,12 @@ function AgentModelEditorContent({
|
|
|
7759
7847
|
}) {
|
|
7760
7848
|
const listboxId = useId8();
|
|
7761
7849
|
const compact = useCompactLayout();
|
|
7762
|
-
const selectedModel =
|
|
7763
|
-
const providers =
|
|
7850
|
+
const selectedModel = useMemo7(() => models.find((model) => model.name === spec.model.name), [models, spec.model.name]);
|
|
7851
|
+
const providers = useMemo7(() => Array.from(new Set(models.map((model) => model.provider.name))), [models]);
|
|
7764
7852
|
const [provider, setProvider] = useState29(selectedModel?.provider.name ?? providers[0] ?? "");
|
|
7765
7853
|
const [compactProvider, setCompactProvider] = useState29(null);
|
|
7766
7854
|
const needle = normalizeModelSearchText(query);
|
|
7767
|
-
const matchingProviders =
|
|
7855
|
+
const matchingProviders = useMemo7(
|
|
7768
7856
|
() => providers.map((name) => {
|
|
7769
7857
|
const providerModels = models.filter((model) => model.provider.name === name);
|
|
7770
7858
|
return {
|
|
@@ -7774,16 +7862,16 @@ function AgentModelEditorContent({
|
|
|
7774
7862
|
}).filter((item) => item.models.length > 0),
|
|
7775
7863
|
[models, needle, providers]
|
|
7776
7864
|
);
|
|
7777
|
-
const visibleProviders =
|
|
7778
|
-
const effectiveProvider =
|
|
7865
|
+
const visibleProviders = useMemo7(() => matchingProviders.map((item) => item.name), [matchingProviders]);
|
|
7866
|
+
const effectiveProvider = useMemo7(
|
|
7779
7867
|
() => visibleProviders.includes(provider) ? provider : selectedModel && visibleProviders.includes(selectedModel.provider.name) ? selectedModel.provider.name : visibleProviders[0] ?? "",
|
|
7780
7868
|
[provider, selectedModel, visibleProviders]
|
|
7781
7869
|
);
|
|
7782
|
-
const visibleModels =
|
|
7870
|
+
const visibleModels = useMemo7(
|
|
7783
7871
|
() => matchingProviders.find((item) => item.name === effectiveProvider)?.models ?? [],
|
|
7784
7872
|
[effectiveProvider, matchingProviders]
|
|
7785
7873
|
);
|
|
7786
|
-
const compactModels =
|
|
7874
|
+
const compactModels = useMemo7(() => {
|
|
7787
7875
|
if (compactProvider === null) return [];
|
|
7788
7876
|
const providerModels = models.filter((model) => model.provider.name === compactProvider);
|
|
7789
7877
|
return needle ? providerModels.filter((model) => modelMatchesQuery({ model, needle })) : providerModels;
|
|
@@ -7814,13 +7902,13 @@ function AgentModelEditorContent({
|
|
|
7814
7902
|
] });
|
|
7815
7903
|
if (compact) {
|
|
7816
7904
|
if (compactProvider === null) {
|
|
7817
|
-
return /* @__PURE__ */ jsxs56("div", { className: "flex min-h-0 flex-
|
|
7905
|
+
return /* @__PURE__ */ jsxs56("div", { className: "flex min-h-0 flex-auto flex-col", children: [
|
|
7818
7906
|
/* @__PURE__ */ jsxs56("div", { className: "shrink-0 border-b border-border px-3 py-2", children: [
|
|
7819
7907
|
/* @__PURE__ */ jsx72("p", { className: "text-text-primary mb-2 text-base font-medium", children: "Select provider" }),
|
|
7820
7908
|
search
|
|
7821
7909
|
] }),
|
|
7822
7910
|
error ? /* @__PURE__ */ jsx72("p", { className: "text-failure-bg px-3 pt-3 text-sm", children: error }) : null,
|
|
7823
|
-
/* @__PURE__ */ jsx72("div", { className: "min-h-0 flex-
|
|
7911
|
+
/* @__PURE__ */ jsx72("div", { className: "min-h-0 flex-auto overflow-y-auto p-2", children: visibleProviders.length === 0 ? /* @__PURE__ */ jsx72("p", { className: "text-text-secondary px-2 py-6 text-center text-sm", role: "status", children: loading ? "Loading\u2026" : "No providers" }) : visibleProviders.map((name) => {
|
|
7824
7912
|
const providerModel = models.find((model) => model.provider.name === name);
|
|
7825
7913
|
return /* @__PURE__ */ jsxs56(
|
|
7826
7914
|
"button",
|
|
@@ -7839,7 +7927,7 @@ function AgentModelEditorContent({
|
|
|
7839
7927
|
}) })
|
|
7840
7928
|
] });
|
|
7841
7929
|
}
|
|
7842
|
-
return /* @__PURE__ */ jsxs56("div", { className: "flex min-h-0 flex-
|
|
7930
|
+
return /* @__PURE__ */ jsxs56("div", { className: "flex min-h-0 flex-auto flex-col", children: [
|
|
7843
7931
|
/* @__PURE__ */ jsxs56("div", { className: "shrink-0 border-b border-border px-3 py-2", children: [
|
|
7844
7932
|
/* @__PURE__ */ jsxs56("div", { className: "mb-2 flex items-center gap-1", children: [
|
|
7845
7933
|
/* @__PURE__ */ jsx72(
|
|
@@ -8739,13 +8827,13 @@ function useIsMobile() {
|
|
|
8739
8827
|
}
|
|
8740
8828
|
|
|
8741
8829
|
// src/atoms/draft/DraftReasoningEffortSelector.tsx
|
|
8742
|
-
import {
|
|
8830
|
+
import { useTrueForgeAgentSpec as useTrueForgeAgentSpec2, useTrueForgeUpdateAgentSpec } from "@truefoundry/trueforge-assistant-ui-runtime";
|
|
8743
8831
|
import { useEffect as useEffect18, useId as useId9, useRef as useRef14, useState as useState32 } from "react";
|
|
8744
8832
|
import { Fragment as Fragment13, jsx as jsx83, jsxs as jsxs63 } from "react/jsx-runtime";
|
|
8745
8833
|
function DraftReasoningEffortSelector({ disabled, isRunning }) {
|
|
8746
8834
|
const { models, ensureLoaded } = useDraftCatalog();
|
|
8747
|
-
const { agentSpec } =
|
|
8748
|
-
const updateAgentSpec =
|
|
8835
|
+
const { agentSpec } = useTrueForgeAgentSpec2();
|
|
8836
|
+
const updateAgentSpec = useTrueForgeUpdateAgentSpec();
|
|
8749
8837
|
const [open, setOpen] = useState32(false);
|
|
8750
8838
|
const containerRef = useRef14(null);
|
|
8751
8839
|
const clearedStickyEffortForModelRef = useRef14(null);
|
|
@@ -8907,8 +8995,8 @@ function DraftComposerRightSection({ disabled, isRunning }) {
|
|
|
8907
8995
|
}
|
|
8908
8996
|
|
|
8909
8997
|
// src/atoms/draft/DraftCompositeSelector.tsx
|
|
8910
|
-
import {
|
|
8911
|
-
import { useCallback as useCallback11, useEffect as useEffect19, useId as useId10, useMemo as
|
|
8998
|
+
import { useTrueForgeAgentSpec as useTrueForgeAgentSpec3, useTrueForgeUpdateAgentSpec as useTrueForgeUpdateAgentSpec2 } from "@truefoundry/trueforge-assistant-ui-runtime";
|
|
8999
|
+
import { useCallback as useCallback11, useEffect as useEffect19, useId as useId10, useMemo as useMemo8, useRef as useRef15, useState as useState33 } from "react";
|
|
8912
9000
|
import { Fragment as Fragment14, jsx as jsx85, jsxs as jsxs65 } from "react/jsx-runtime";
|
|
8913
9001
|
function draftMountsFromSpec(value) {
|
|
8914
9002
|
if (!Array.isArray(value)) return [];
|
|
@@ -9091,8 +9179,8 @@ function DraftCompositeSelector({ disabled, isRunning, onAttach }) {
|
|
|
9091
9179
|
const capabilities = useServerCapabilities();
|
|
9092
9180
|
const settingsCatalog = useOptionalCatalogServer();
|
|
9093
9181
|
const shell = useOptionalShellMode();
|
|
9094
|
-
const { agentSpec } =
|
|
9095
|
-
const updateAgentSpec =
|
|
9182
|
+
const { agentSpec } = useTrueForgeAgentSpec3();
|
|
9183
|
+
const updateAgentSpec = useTrueForgeUpdateAgentSpec2();
|
|
9096
9184
|
const [open, setOpen] = useState33(false);
|
|
9097
9185
|
const [tab, setTab] = useState33("connectors");
|
|
9098
9186
|
const [query, setQuery] = useState33("");
|
|
@@ -9117,14 +9205,14 @@ function DraftCompositeSelector({ disabled, isRunning, onAttach }) {
|
|
|
9117
9205
|
const canConfigureConnectors = settingsEnabled && settingsCatalog?.connectorCatalog != null;
|
|
9118
9206
|
const canConfigureSkills = settingsEnabled && settingsCatalog?.skillCatalog != null;
|
|
9119
9207
|
const canConfigureSandbox = settingsEnabled && settingsCatalog?.sandboxCatalog != null;
|
|
9120
|
-
const specMcp =
|
|
9121
|
-
const specSkills =
|
|
9208
|
+
const specMcp = useMemo8(() => draftMountsFromSpec(agentSpec?.mcpServers), [agentSpec?.mcpServers]);
|
|
9209
|
+
const specSkills = useMemo8(() => draftMountsFromSpec(agentSpec?.skills), [agentSpec?.skills]);
|
|
9122
9210
|
const selectedMcp = open ? localMcp : specMcp;
|
|
9123
9211
|
const selectedSkills = open ? localSkills : specSkills;
|
|
9124
|
-
const selectedMcpIds =
|
|
9212
|
+
const selectedMcpIds = useMemo8(() => new Set(selectedMcp.map((m) => m.id)), [selectedMcp]);
|
|
9125
9213
|
const hasValidModel = Boolean(agentSpec?.model?.name.trim());
|
|
9126
9214
|
const toolsCount = selectedMcp.length + selectedSkills.length;
|
|
9127
|
-
const toolsTooltip =
|
|
9215
|
+
const toolsTooltip = useMemo8(() => {
|
|
9128
9216
|
const formatNames = (items) => {
|
|
9129
9217
|
const names = items.map((item) => item.name);
|
|
9130
9218
|
if (names.length <= 4) return names.join(", ");
|
|
@@ -9191,11 +9279,11 @@ function DraftCompositeSelector({ disabled, isRunning, onAttach }) {
|
|
|
9191
9279
|
};
|
|
9192
9280
|
}, [open, setOpenAndFlush]);
|
|
9193
9281
|
useEffect19(() => () => clearFlushTimer(), [clearFlushTimer]);
|
|
9194
|
-
const catalogConnectors =
|
|
9282
|
+
const catalogConnectors = useMemo8(
|
|
9195
9283
|
() => connectorsWithSelectedStubs({ connectors, selected: selectedMcp }),
|
|
9196
9284
|
[connectors, selectedMcp]
|
|
9197
9285
|
);
|
|
9198
|
-
const filteredConnectors =
|
|
9286
|
+
const filteredConnectors = useMemo8(() => {
|
|
9199
9287
|
const needle = query.trim().toLowerCase();
|
|
9200
9288
|
const matches = needle ? catalogConnectors.filter(
|
|
9201
9289
|
(c) => c.name.toLowerCase().includes(needle) || (c.description?.toLowerCase().includes(needle) ?? false)
|
|
@@ -9204,26 +9292,26 @@ function DraftCompositeSelector({ disabled, isRunning, onAttach }) {
|
|
|
9204
9292
|
(left, right) => Number(isUnauthenticatedDcrConnector(left)) - Number(isUnauthenticatedDcrConnector(right))
|
|
9205
9293
|
);
|
|
9206
9294
|
}, [catalogConnectors, query]);
|
|
9207
|
-
const filteredSkills =
|
|
9295
|
+
const filteredSkills = useMemo8(() => {
|
|
9208
9296
|
const needle = query.trim().toLowerCase();
|
|
9209
9297
|
if (!needle) return skills;
|
|
9210
9298
|
return skills.filter(
|
|
9211
9299
|
(skill) => skill.name.toLowerCase().includes(needle) || (skillRepoName(skill)?.toLowerCase().includes(needle) ?? false) || (skill.description?.toLowerCase().includes(needle) ?? false)
|
|
9212
9300
|
);
|
|
9213
9301
|
}, [skills, query]);
|
|
9214
|
-
const pinnedSelectedConnectors =
|
|
9302
|
+
const pinnedSelectedConnectors = useMemo8(
|
|
9215
9303
|
() => filteredConnectors.filter((c) => pinnedMcpIds.has(c.id)),
|
|
9216
9304
|
[filteredConnectors, pinnedMcpIds]
|
|
9217
9305
|
);
|
|
9218
|
-
const pinnedAvailableConnectors =
|
|
9306
|
+
const pinnedAvailableConnectors = useMemo8(
|
|
9219
9307
|
() => filteredConnectors.filter((c) => !pinnedMcpIds.has(c.id)),
|
|
9220
9308
|
[filteredConnectors, pinnedMcpIds]
|
|
9221
9309
|
);
|
|
9222
|
-
const pinnedSelectedSkills =
|
|
9310
|
+
const pinnedSelectedSkills = useMemo8(
|
|
9223
9311
|
() => filteredSkills.filter((s) => pinnedSkillIds.has(skillFamilyId(s.id))),
|
|
9224
9312
|
[filteredSkills, pinnedSkillIds]
|
|
9225
9313
|
);
|
|
9226
|
-
const pinnedAvailableSkills =
|
|
9314
|
+
const pinnedAvailableSkills = useMemo8(
|
|
9227
9315
|
() => filteredSkills.filter((s) => !pinnedSkillIds.has(skillFamilyId(s.id))),
|
|
9228
9316
|
[filteredSkills, pinnedSkillIds]
|
|
9229
9317
|
);
|
|
@@ -9461,13 +9549,13 @@ function DraftCompositeSelector({ disabled, isRunning, onAttach }) {
|
|
|
9461
9549
|
}
|
|
9462
9550
|
|
|
9463
9551
|
// src/atoms/draft/DraftModelSelector.tsx
|
|
9464
|
-
import {
|
|
9552
|
+
import { useTrueForgeAgentSpec as useTrueForgeAgentSpec4, useTrueForgeUpdateAgentSpec as useTrueForgeUpdateAgentSpec3 } from "@truefoundry/trueforge-assistant-ui-runtime";
|
|
9465
9553
|
import { useEffect as useEffect20, useId as useId11, useRef as useRef16, useState as useState34 } from "react";
|
|
9466
9554
|
import { jsx as jsx86, jsxs as jsxs66 } from "react/jsx-runtime";
|
|
9467
9555
|
function DraftModelSelector({ disabled, isRunning }) {
|
|
9468
9556
|
const { models, loading, ensureLoaded } = useDraftCatalog();
|
|
9469
|
-
const { agentSpec } =
|
|
9470
|
-
const updateAgentSpec =
|
|
9557
|
+
const { agentSpec } = useTrueForgeAgentSpec4();
|
|
9558
|
+
const updateAgentSpec = useTrueForgeUpdateAgentSpec3();
|
|
9471
9559
|
const catalog = useOptionalCatalogServer();
|
|
9472
9560
|
const shell = useOptionalShellMode();
|
|
9473
9561
|
const [open, setOpen] = useState34(false);
|
|
@@ -9585,12 +9673,12 @@ var HistoryLoader = forwardRef(
|
|
|
9585
9673
|
HistoryLoader.displayName = "HistoryLoader";
|
|
9586
9674
|
|
|
9587
9675
|
// src/atoms/Markdown.tsx
|
|
9588
|
-
import { useMemo as
|
|
9676
|
+
import { useMemo as useMemo9, useRef as useRef17 } from "react";
|
|
9589
9677
|
import ReactMarkdown from "react-markdown";
|
|
9590
9678
|
import remarkGfm from "remark-gfm";
|
|
9591
9679
|
import { Fragment as Fragment15, jsx as jsx88 } from "react/jsx-runtime";
|
|
9592
9680
|
function preloadMarkdownOpenUI() {
|
|
9593
|
-
return import("./OpenUiFenceBlock-
|
|
9681
|
+
return import("./OpenUiFenceBlock-BZPFNXWZ.js");
|
|
9594
9682
|
}
|
|
9595
9683
|
var LARGE_STREAMING_FENCE_CHARS = 8 * 1024;
|
|
9596
9684
|
function getActiveStreamingFenceCode(content) {
|
|
@@ -9691,7 +9779,7 @@ function Markdown({
|
|
|
9691
9779
|
const SyntaxHighlighter2 = useSlot("SyntaxHighlighter");
|
|
9692
9780
|
const activeFenceCodeRef = useRef17(null);
|
|
9693
9781
|
activeFenceCodeRef.current = isStreaming === true ? getActiveStreamingFenceCode(content) : null;
|
|
9694
|
-
const components =
|
|
9782
|
+
const components = useMemo9(
|
|
9695
9783
|
() => makeComponents({
|
|
9696
9784
|
isStreaming,
|
|
9697
9785
|
getActiveFenceCode: () => activeFenceCodeRef.current,
|
|
@@ -9795,22 +9883,12 @@ function formatTime(date) {
|
|
|
9795
9883
|
hour12: true
|
|
9796
9884
|
}).format(date);
|
|
9797
9885
|
}
|
|
9798
|
-
function formatFullDate(date) {
|
|
9799
|
-
return new Intl.DateTimeFormat(void 0, {
|
|
9800
|
-
month: "short",
|
|
9801
|
-
day: "numeric",
|
|
9802
|
-
year: "numeric",
|
|
9803
|
-
hour: "numeric",
|
|
9804
|
-
minute: "2-digit",
|
|
9805
|
-
hour12: true
|
|
9806
|
-
}).format(date);
|
|
9807
|
-
}
|
|
9808
9886
|
function MessageTimestamp({ createdAt, className }) {
|
|
9809
9887
|
const date = toDate(createdAt);
|
|
9810
9888
|
if (date == null) {
|
|
9811
9889
|
return null;
|
|
9812
9890
|
}
|
|
9813
|
-
return /* @__PURE__ */ jsx92(LightTooltip, { title:
|
|
9891
|
+
return /* @__PURE__ */ jsx92(LightTooltip, { title: formatAbsoluteDateTime(date), size: "fit", side: "bottom", children: /* @__PURE__ */ jsx92("span", { className: cn("text-xs font-medium cursor-pointer leading-normal shrink-0 text-text-secondary", className), children: formatTime(date) }) });
|
|
9814
9892
|
}
|
|
9815
9893
|
|
|
9816
9894
|
// src/atoms/MonacoEditorCore.tsx
|
|
@@ -10038,7 +10116,7 @@ function PermissionGuard({
|
|
|
10038
10116
|
}
|
|
10039
10117
|
|
|
10040
10118
|
// src/atoms/SandboxArtifactDownload.tsx
|
|
10041
|
-
import { useMemo as
|
|
10119
|
+
import { useMemo as useMemo10 } from "react";
|
|
10042
10120
|
import { jsx as jsx95 } from "react/jsx-runtime";
|
|
10043
10121
|
var PREFIX = "sandbox_artifacts";
|
|
10044
10122
|
var PAIR_RE = /\[([^\]]*)\]\(([^)]*)\)/g;
|
|
@@ -10073,7 +10151,7 @@ function SandboxArtifactDownload({
|
|
|
10073
10151
|
sandboxDownloadReadOnlyTooltip
|
|
10074
10152
|
}) {
|
|
10075
10153
|
const ChatFileDownload2 = useSlot("ChatFileDownload");
|
|
10076
|
-
const artifacts =
|
|
10154
|
+
const artifacts = useMemo10(() => parseSandboxArtifacts(code), [code]);
|
|
10077
10155
|
if (artifacts.length === 0) return null;
|
|
10078
10156
|
return /* @__PURE__ */ jsx95(
|
|
10079
10157
|
ChatFileDownload2,
|
|
@@ -10291,15 +10369,15 @@ function SandboxToolCallCard({
|
|
|
10291
10369
|
|
|
10292
10370
|
// src/atoms/SaveAgentButton.tsx
|
|
10293
10371
|
import {
|
|
10294
|
-
|
|
10295
|
-
|
|
10296
|
-
|
|
10297
|
-
} from "@truefoundry/assistant-ui-runtime";
|
|
10372
|
+
useTrueForgeAdoptAgentSpec,
|
|
10373
|
+
useTrueForgeAgentSpec as useTrueForgeAgentSpec6,
|
|
10374
|
+
useTrueForgeFlushAgentSpec
|
|
10375
|
+
} from "@truefoundry/trueforge-assistant-ui-runtime";
|
|
10298
10376
|
import { useRef as useRef20, useState as useState37 } from "react";
|
|
10299
10377
|
|
|
10300
10378
|
// src/atoms/draft/AgentConfigInstructionsContext.tsx
|
|
10301
|
-
import {
|
|
10302
|
-
import { createContext as createContext5, useCallback as useCallback13, useContext as useContext6, useMemo as
|
|
10379
|
+
import { useTrueForgeAgentSpec as useTrueForgeAgentSpec5, useTrueForgeUpdateAgentSpec as useTrueForgeUpdateAgentSpec4 } from "@truefoundry/trueforge-assistant-ui-runtime";
|
|
10380
|
+
import { createContext as createContext5, useCallback as useCallback13, useContext as useContext6, useMemo as useMemo11 } from "react";
|
|
10303
10381
|
|
|
10304
10382
|
// src/hooks/useDebouncedAgentInstructions.ts
|
|
10305
10383
|
import { useCallback as useCallback12, useEffect as useEffect22, useRef as useRef19, useState as useState36 } from "react";
|
|
@@ -10359,14 +10437,14 @@ function useDebouncedAgentInstructions({
|
|
|
10359
10437
|
import { jsx as jsx97 } from "react/jsx-runtime";
|
|
10360
10438
|
var AgentConfigInstructionsContext = createContext5(null);
|
|
10361
10439
|
function AgentConfigInstructionsProvider({ children }) {
|
|
10362
|
-
const { agentSpec } =
|
|
10363
|
-
const updateAgentSpec =
|
|
10440
|
+
const { agentSpec } = useTrueForgeAgentSpec5();
|
|
10441
|
+
const updateAgentSpec = useTrueForgeUpdateAgentSpec4();
|
|
10364
10442
|
const commit = useCallback13((instructions) => updateAgentSpec?.({ instructions }), [updateAgentSpec]);
|
|
10365
10443
|
const { draft, onChange, flush } = useDebouncedAgentInstructions({
|
|
10366
10444
|
value: agentSpec?.instructions ?? "",
|
|
10367
10445
|
onCommit: commit
|
|
10368
10446
|
});
|
|
10369
|
-
const value =
|
|
10447
|
+
const value = useMemo11(() => ({ draft, onChange, flush }), [draft, flush, onChange]);
|
|
10370
10448
|
return /* @__PURE__ */ jsx97(AgentConfigInstructionsContext.Provider, { value, children });
|
|
10371
10449
|
}
|
|
10372
10450
|
function useAgentConfigInstructions() {
|
|
@@ -10397,11 +10475,11 @@ function SaveAgentButtonContent({
|
|
|
10397
10475
|
children,
|
|
10398
10476
|
instructionsOverride
|
|
10399
10477
|
}) {
|
|
10400
|
-
const { agentSpec, draftSessionId } =
|
|
10478
|
+
const { agentSpec, draftSessionId } = useTrueForgeAgentSpec6();
|
|
10401
10479
|
const agentSpecRef = useRef20(agentSpec);
|
|
10402
10480
|
agentSpecRef.current = agentSpec;
|
|
10403
|
-
const flushAgentSpec =
|
|
10404
|
-
const adoptAgentSpec =
|
|
10481
|
+
const flushAgentSpec = useTrueForgeFlushAgentSpec();
|
|
10482
|
+
const adoptAgentSpec = useTrueForgeAdoptAgentSpec();
|
|
10405
10483
|
const builder = useOptionalServer();
|
|
10406
10484
|
const shell = useOptionalShellMode();
|
|
10407
10485
|
const agentId = shell?.mode.status === "active" ? shell.mode.agentId : void 0;
|
|
@@ -10832,7 +10910,7 @@ import {
|
|
|
10832
10910
|
isValidElement as isValidElement2,
|
|
10833
10911
|
memo,
|
|
10834
10912
|
useCallback as useCallback14,
|
|
10835
|
-
useMemo as
|
|
10913
|
+
useMemo as useMemo12,
|
|
10836
10914
|
useState as useState38
|
|
10837
10915
|
} from "react";
|
|
10838
10916
|
import { Prism as PrismHighlighter } from "react-syntax-highlighter";
|
|
@@ -11849,7 +11927,7 @@ function SyntaxHighlighterImpl({ code, language, darkTheme, className, showLineN
|
|
|
11849
11927
|
const classNames = useOptionalContentClassNames();
|
|
11850
11928
|
const style = darkTheme ? one_dark_default : one_light_default;
|
|
11851
11929
|
const [copied, setCopied] = useState38(false);
|
|
11852
|
-
const displayCode =
|
|
11930
|
+
const displayCode = useMemo12(() => stripTrailingNewline(code), [code]);
|
|
11853
11931
|
const handleCopy = useCallback14(() => {
|
|
11854
11932
|
void navigator.clipboard.writeText(code).then(() => {
|
|
11855
11933
|
setCopied(true);
|
|
@@ -11962,6 +12040,12 @@ function ThreadListShell({ header, children, className }) {
|
|
|
11962
12040
|
|
|
11963
12041
|
// src/atoms/ThreadListRow.tsx
|
|
11964
12042
|
import { jsx as jsx108, jsxs as jsxs79 } from "react/jsx-runtime";
|
|
12043
|
+
function ThreadListAgentName({ agentName }) {
|
|
12044
|
+
return /* @__PURE__ */ jsxs79("span", { className: "mt-0.5 flex min-w-0 items-center gap-1 text-[0.75rem] text-text-secondary", children: [
|
|
12045
|
+
/* @__PURE__ */ jsx108(Icon, { name: "bot", className: "shrink-0" }),
|
|
12046
|
+
/* @__PURE__ */ jsx108("span", { className: "truncate", children: agentName })
|
|
12047
|
+
] });
|
|
12048
|
+
}
|
|
11965
12049
|
function ThreadListRow({
|
|
11966
12050
|
title,
|
|
11967
12051
|
active,
|
|
@@ -12000,10 +12084,7 @@ function ThreadListRow({
|
|
|
12000
12084
|
}),
|
|
12001
12085
|
children: /* @__PURE__ */ jsxs79("span", { className: "min-w-0 flex-1", children: [
|
|
12002
12086
|
/* @__PURE__ */ jsx108("span", { className: "block truncate text-sm font-normal text-text-primary", children: title }),
|
|
12003
|
-
agentName != null ? /* @__PURE__ */
|
|
12004
|
-
/* @__PURE__ */ jsx108(Icon, { name: "bot", className: "shrink-0" }),
|
|
12005
|
-
/* @__PURE__ */ jsx108("span", { className: "truncate", children: agentName })
|
|
12006
|
-
] }) : null
|
|
12087
|
+
agentName != null ? /* @__PURE__ */ jsx108(ThreadListAgentName, { agentName }) : null
|
|
12007
12088
|
] })
|
|
12008
12089
|
}
|
|
12009
12090
|
),
|
|
@@ -12363,7 +12444,7 @@ import {
|
|
|
12363
12444
|
useCallback as useCallback16,
|
|
12364
12445
|
useContext as useContext7,
|
|
12365
12446
|
useEffect as useEffect24,
|
|
12366
|
-
useMemo as
|
|
12447
|
+
useMemo as useMemo13,
|
|
12367
12448
|
useRef as useRef22,
|
|
12368
12449
|
useState as useState40
|
|
12369
12450
|
} from "react";
|
|
@@ -12373,7 +12454,7 @@ import { parse as parsePartialJson } from "partial-json";
|
|
|
12373
12454
|
var SUB_AGENT_TOOL_NAME = "create_sub_agent";
|
|
12374
12455
|
var ASK_USER_TOOL_NAME = "ask_user_question";
|
|
12375
12456
|
var SANDBOX_TOOL_NAMES = /* @__PURE__ */ new Set(["exec", "sandbox_exec"]);
|
|
12376
|
-
var MCP_META_TOOLS = /* @__PURE__ */ new Set(["call_tool", "list_tools", "get_tool_info"]);
|
|
12457
|
+
var MCP_META_TOOLS = /* @__PURE__ */ new Set(["call_tool", "list_tools", "get_tool_info", "get_tool_output_schema"]);
|
|
12377
12458
|
var APPROVAL_OPTION_DEFAULT_LABELS = {
|
|
12378
12459
|
"allow-once": "Allow",
|
|
12379
12460
|
"allow-always": "Always allow",
|
|
@@ -12541,11 +12622,14 @@ function resolveSubAgentMeta(part) {
|
|
|
12541
12622
|
};
|
|
12542
12623
|
}
|
|
12543
12624
|
function mcpDisplayName(toolName, mcpServer, innerToolName) {
|
|
12625
|
+
if (toolName === "list_tools" && mcpServer) {
|
|
12626
|
+
return `list_tools (${mcpServer})`;
|
|
12627
|
+
}
|
|
12544
12628
|
if (toolName === "call_tool" && innerToolName) {
|
|
12545
12629
|
return mcpServer ? `call_tool: ${innerToolName} (${mcpServer})` : `call_tool: ${innerToolName}`;
|
|
12546
12630
|
}
|
|
12547
|
-
if (toolName === "get_tool_info" && innerToolName && mcpServer) {
|
|
12548
|
-
return
|
|
12631
|
+
if ((toolName === "get_tool_info" || toolName === "get_tool_output_schema") && innerToolName && mcpServer) {
|
|
12632
|
+
return `${toolName}: ${innerToolName} (${mcpServer})`;
|
|
12549
12633
|
}
|
|
12550
12634
|
return toolName;
|
|
12551
12635
|
}
|
|
@@ -12654,7 +12738,7 @@ function ApprovalFocusProvider({ children }) {
|
|
|
12654
12738
|
},
|
|
12655
12739
|
[messages, startFlash]
|
|
12656
12740
|
);
|
|
12657
|
-
const api =
|
|
12741
|
+
const api = useMemo13(
|
|
12658
12742
|
() => ({
|
|
12659
12743
|
registerTarget,
|
|
12660
12744
|
registerExpand,
|
|
@@ -13214,8 +13298,8 @@ function AgentMetricsContainer({
|
|
|
13214
13298
|
|
|
13215
13299
|
// src/containers/AgentSessionTimelineContainer.tsx
|
|
13216
13300
|
import { ThreadPrimitive } from "@assistant-ui/react";
|
|
13217
|
-
import { convertTurnsToThreadMessages } from "@truefoundry/assistant-ui-runtime";
|
|
13218
|
-
import { Suspense as Suspense3, useCallback as useCallback22, useEffect as useEffect30, useMemo as
|
|
13301
|
+
import { convertTurnsToThreadMessages } from "@truefoundry/trueforge-assistant-ui-runtime";
|
|
13302
|
+
import { Suspense as Suspense3, useCallback as useCallback22, useEffect as useEffect30, useMemo as useMemo17, useRef as useRef29, useState as useState51 } from "react";
|
|
13219
13303
|
|
|
13220
13304
|
// src/utils/buildSessionMetrics.ts
|
|
13221
13305
|
function segmentDurationMs(segment) {
|
|
@@ -13607,11 +13691,15 @@ function getSubAgentDescription(event) {
|
|
|
13607
13691
|
function toolCallDescription(toolCall) {
|
|
13608
13692
|
const fn = isRecord2(toolCall.function) ? toolCall.function : void 0;
|
|
13609
13693
|
const name = typeof fn?.name === "string" ? fn.name : "";
|
|
13694
|
+
const argumentsJson = typeof fn?.arguments === "string" ? fn.arguments : void 0;
|
|
13610
13695
|
if (SANDBOX_TOOL_NAMES.has(name) || name === "code_sandbox") {
|
|
13611
|
-
const argumentsJson = typeof fn?.arguments === "string" ? fn.arguments : void 0;
|
|
13612
13696
|
const intent = parseSandboxArgs(argumentsJson).intent?.trim();
|
|
13613
13697
|
return intent != null && intent.length > 0 ? intent : name;
|
|
13614
13698
|
}
|
|
13699
|
+
if (MCP_META_TOOLS.has(name)) {
|
|
13700
|
+
const { mcpServer, innerToolName } = parseMcpToolArgs(argumentsJson);
|
|
13701
|
+
return mcpDisplayName(name, mcpServer, innerToolName);
|
|
13702
|
+
}
|
|
13615
13703
|
return name;
|
|
13616
13704
|
}
|
|
13617
13705
|
|
|
@@ -13977,7 +14065,7 @@ function buildSessionTurnViews(itemsAsc) {
|
|
|
13977
14065
|
// src/containers/AssistantMessageContainer.tsx
|
|
13978
14066
|
import { useActionBarCopy, useMessageError, useThreadIsRunning } from "@assistant-ui/core/react";
|
|
13979
14067
|
import { MessagePrimitive as MessagePrimitive2, useAuiState as useAuiState6 } from "@assistant-ui/react";
|
|
13980
|
-
import {
|
|
14068
|
+
import { useTrueForgeResumeUnavailable } from "@truefoundry/trueforge-assistant-ui-runtime";
|
|
13981
14069
|
|
|
13982
14070
|
// src/utils/computeAgentStepsSplit.ts
|
|
13983
14071
|
function computeAgentStepsSplit(parts, isRunning) {
|
|
@@ -14057,8 +14145,8 @@ import {
|
|
|
14057
14145
|
useAuiState as useAuiState3,
|
|
14058
14146
|
useSmooth
|
|
14059
14147
|
} from "@assistant-ui/react";
|
|
14060
|
-
import {
|
|
14061
|
-
import { useCallback as useCallback17, useMemo as
|
|
14148
|
+
import { useTrueForgeDownloadSandboxFile } from "@truefoundry/trueforge-assistant-ui-runtime";
|
|
14149
|
+
import { useCallback as useCallback17, useMemo as useMemo14, useRef as useRef26 } from "react";
|
|
14062
14150
|
|
|
14063
14151
|
// src/hooks/useThrottledMarkdownText.ts
|
|
14064
14152
|
import { useEffect as useEffect27, useRef as useRef25, useState as useState44 } from "react";
|
|
@@ -14131,7 +14219,7 @@ function triggerBrowserDownload(blob, filename) {
|
|
|
14131
14219
|
function AssistantTextContainer() {
|
|
14132
14220
|
const Markdown2 = useSlot("Markdown");
|
|
14133
14221
|
const toaster = useToasterOptional();
|
|
14134
|
-
const downloadSandboxFile =
|
|
14222
|
+
const downloadSandboxFile = useTrueForgeDownloadSandboxFile();
|
|
14135
14223
|
const downloadRef = useRef26({ downloadSandboxFile, toaster });
|
|
14136
14224
|
downloadRef.current = { downloadSandboxFile, toaster };
|
|
14137
14225
|
const partState = useAuiState3((s) => s.part);
|
|
@@ -14169,7 +14257,7 @@ function AssistantTextContainer() {
|
|
|
14169
14257
|
}
|
|
14170
14258
|
}
|
|
14171
14259
|
}, []);
|
|
14172
|
-
return
|
|
14260
|
+
return useMemo14(
|
|
14173
14261
|
() => /* @__PURE__ */ jsx122(Markdown2, { content: text, isStreaming, onDownloadArtifact: handleDownloadArtifact }),
|
|
14174
14262
|
[Markdown2, text, isStreaming, handleDownloadArtifact]
|
|
14175
14263
|
);
|
|
@@ -14265,7 +14353,7 @@ import {
|
|
|
14265
14353
|
MessagePrimitive,
|
|
14266
14354
|
useToolCallElapsed
|
|
14267
14355
|
} from "@assistant-ui/react";
|
|
14268
|
-
import {
|
|
14356
|
+
import { useTrueForgeRespondToToolApproval } from "@truefoundry/trueforge-assistant-ui-runtime";
|
|
14269
14357
|
import { useCallback as useCallback21, useState as useState49 } from "react";
|
|
14270
14358
|
|
|
14271
14359
|
// src/containers/nestedApprovalBridge.ts
|
|
@@ -14276,12 +14364,12 @@ function useNestedApprovalBridge() {
|
|
|
14276
14364
|
}
|
|
14277
14365
|
|
|
14278
14366
|
// src/containers/SandboxToolCallContainer.tsx
|
|
14279
|
-
import { useMemo as
|
|
14367
|
+
import { useMemo as useMemo15, useState as useState46 } from "react";
|
|
14280
14368
|
import { jsx as jsx125 } from "react/jsx-runtime";
|
|
14281
14369
|
function SandboxToolCallContainer(props) {
|
|
14282
14370
|
const SandboxToolCallCard2 = useSlot("SandboxToolCallCard");
|
|
14283
14371
|
const [viewMode, setViewMode] = useState46("terminal");
|
|
14284
|
-
const hasContent =
|
|
14372
|
+
const hasContent = useMemo15(() => {
|
|
14285
14373
|
if (viewMode === "code") return Boolean(props.argsJson || props.resultJson);
|
|
14286
14374
|
return Boolean(props.command || props.resultText || props.resultJson);
|
|
14287
14375
|
}, [props.argsJson, props.command, props.resultJson, props.resultText, viewMode]);
|
|
@@ -14289,7 +14377,7 @@ function SandboxToolCallContainer(props) {
|
|
|
14289
14377
|
}
|
|
14290
14378
|
|
|
14291
14379
|
// src/containers/ToolApprovalContainer.tsx
|
|
14292
|
-
import { useCallback as useCallback19, useMemo as
|
|
14380
|
+
import { useCallback as useCallback19, useMemo as useMemo16, useState as useState47 } from "react";
|
|
14293
14381
|
import { jsx as jsx126 } from "react/jsx-runtime";
|
|
14294
14382
|
function ToolApprovalContainer({
|
|
14295
14383
|
toolName = "",
|
|
@@ -14304,7 +14392,7 @@ function ToolApprovalContainer({
|
|
|
14304
14392
|
const [selectedDenyOptionId, setSelectedDenyOptionId] = useState47(null);
|
|
14305
14393
|
const [denialReason, setDenialReason] = useState47("");
|
|
14306
14394
|
const [showReasonError, setShowReasonError] = useState47(false);
|
|
14307
|
-
const approveOptions =
|
|
14395
|
+
const approveOptions = useMemo16(
|
|
14308
14396
|
() => options.filter((option) => option.isAllow).map((option, index) => ({
|
|
14309
14397
|
...option,
|
|
14310
14398
|
variant: index === 0 ? "primary" : "secondary",
|
|
@@ -14312,7 +14400,7 @@ function ToolApprovalContainer({
|
|
|
14312
14400
|
})),
|
|
14313
14401
|
[options]
|
|
14314
14402
|
);
|
|
14315
|
-
const denyOptions =
|
|
14403
|
+
const denyOptions = useMemo16(
|
|
14316
14404
|
() => options.filter((option) => !option.isAllow).map((option) => ({
|
|
14317
14405
|
...option,
|
|
14318
14406
|
variant: "secondary",
|
|
@@ -14447,7 +14535,7 @@ function NestedSubAgentAssistantMessage() {
|
|
|
14447
14535
|
}
|
|
14448
14536
|
function ToolApprovalSlot({ part }) {
|
|
14449
14537
|
const isNestedReadonly = useNestedApprovalBridge();
|
|
14450
|
-
const respondToNestedApproval =
|
|
14538
|
+
const respondToNestedApproval = useTrueForgeRespondToToolApproval();
|
|
14451
14539
|
const respond = (response) => {
|
|
14452
14540
|
if (!isNestedReadonly) {
|
|
14453
14541
|
part.respondToApproval(response);
|
|
@@ -14691,7 +14779,7 @@ function AssistantMessageContainer() {
|
|
|
14691
14779
|
const MessageErrorBanner2 = useSlot("MessageErrorBanner");
|
|
14692
14780
|
const MessageIndicator2 = useSlot("MessageIndicator");
|
|
14693
14781
|
const isThreadRunning = useThreadIsRunning();
|
|
14694
|
-
const resumeUnavailable =
|
|
14782
|
+
const resumeUnavailable = useTrueForgeResumeUnavailable();
|
|
14695
14783
|
const error = useMessageError();
|
|
14696
14784
|
const createdAt = useAuiState6((s) => s.message.createdAt);
|
|
14697
14785
|
const isMessageRunning = useAuiState6((s) => s.message.status?.type === "running");
|
|
@@ -14911,7 +14999,7 @@ function UserMessageContainer() {
|
|
|
14911
14999
|
}
|
|
14912
15000
|
|
|
14913
15001
|
// src/containers/AgentSessionTimelineContainer.tsx
|
|
14914
|
-
import {
|
|
15002
|
+
import { jsx as jsx133, jsxs as jsxs89 } from "react/jsx-runtime";
|
|
14915
15003
|
function ReadOnlyMarkdown(props) {
|
|
14916
15004
|
return /* @__PURE__ */ jsx133(
|
|
14917
15005
|
Markdown,
|
|
@@ -14923,9 +15011,11 @@ function ReadOnlyMarkdown(props) {
|
|
|
14923
15011
|
}
|
|
14924
15012
|
);
|
|
14925
15013
|
}
|
|
15014
|
+
function ReadOnlyUserMessageActionBar({ isCopied, onCopy, createdAt, className }) {
|
|
15015
|
+
return /* @__PURE__ */ jsx133(MessageActionBar, { isCopied, onCopy, createdAt, className });
|
|
15016
|
+
}
|
|
14926
15017
|
var READ_ONLY_SLOT_OVERRIDES = {
|
|
14927
|
-
UserMessageActionBar:
|
|
14928
|
-
MessageActionBar: () => /* @__PURE__ */ jsx133(Fragment22, {}),
|
|
15018
|
+
UserMessageActionBar: ReadOnlyUserMessageActionBar,
|
|
14929
15019
|
Markdown: ReadOnlyMarkdown
|
|
14930
15020
|
};
|
|
14931
15021
|
function turnIdFromMessage(message) {
|
|
@@ -15000,10 +15090,10 @@ function AgentSessionTimelineContainer({ sessionId, events, listMetrics }) {
|
|
|
15000
15090
|
const [messages, setMessages] = useState51();
|
|
15001
15091
|
const [loadFailed, setLoadFailed] = useState51(false);
|
|
15002
15092
|
const sectionRefs = useRef29(/* @__PURE__ */ new Map());
|
|
15003
|
-
const turnViews =
|
|
15004
|
-
const projectionEvents =
|
|
15005
|
-
const timelineSegments =
|
|
15006
|
-
const sessionMetrics =
|
|
15093
|
+
const turnViews = useMemo17(() => buildSessionTurnViews(events), [events]);
|
|
15094
|
+
const projectionEvents = useMemo17(() => buildProjectionEvents(events, turnViews), [events, turnViews]);
|
|
15095
|
+
const timelineSegments = useMemo17(() => buildSessionTimelineSegments(turnViews), [turnViews]);
|
|
15096
|
+
const sessionMetrics = useMemo17(
|
|
15007
15097
|
() => buildSessionMetrics({ turns: turnViews, segments: timelineSegments, listMetrics }),
|
|
15008
15098
|
[listMetrics, timelineSegments, turnViews]
|
|
15009
15099
|
);
|
|
@@ -15085,28 +15175,28 @@ function SessionTurnSection({
|
|
|
15085
15175
|
}
|
|
15086
15176
|
|
|
15087
15177
|
// src/theme/defaultSlots.ts
|
|
15088
|
-
var AgentOverview = lazy(() => import("./AgentOverview-
|
|
15178
|
+
var AgentOverview = lazy(() => import("./AgentOverview-BFU7EO4Y.js"));
|
|
15089
15179
|
var AgentSessions = lazy(async () => {
|
|
15090
|
-
const mod = await import("./AgentSessions-
|
|
15180
|
+
const mod = await import("./AgentSessions-GDLBXFIK.js");
|
|
15091
15181
|
return { default: mod.AgentSessions };
|
|
15092
15182
|
});
|
|
15093
15183
|
var AgentCodeSnippets = lazy(
|
|
15094
|
-
() => import("./AgentCodeSnippets-
|
|
15184
|
+
() => import("./AgentCodeSnippets-BPC6TD7K.js")
|
|
15095
15185
|
);
|
|
15096
15186
|
var SchedulesPage = lazy(async () => {
|
|
15097
|
-
const mod = await import("./SchedulesPage-
|
|
15187
|
+
const mod = await import("./SchedulesPage-ZO3PJY4J.js");
|
|
15098
15188
|
return { default: mod.SchedulesPage };
|
|
15099
15189
|
});
|
|
15100
15190
|
var AgentSessionEventTimeline = lazy(async () => {
|
|
15101
|
-
const mod = await import("./AgentSessionEventTimeline-
|
|
15191
|
+
const mod = await import("./AgentSessionEventTimeline-ATVBTYDF.js");
|
|
15102
15192
|
return { default: mod.AgentSessionEventTimeline };
|
|
15103
15193
|
});
|
|
15104
15194
|
var AgentSessionEventTimelineChart = lazy(async () => {
|
|
15105
|
-
const mod = await import("./AgentSessionEventTimelineChart-
|
|
15195
|
+
const mod = await import("./AgentSessionEventTimelineChart-H577STKW.js");
|
|
15106
15196
|
return { default: mod.AgentSessionEventTimelineChart };
|
|
15107
15197
|
});
|
|
15108
15198
|
var AgentMetricChart = lazy(async () => {
|
|
15109
|
-
const mod = await import("./AgentMetricChart-
|
|
15199
|
+
const mod = await import("./AgentMetricChart-T6DZZ37Y.js");
|
|
15110
15200
|
return { default: mod.AgentMetricChart };
|
|
15111
15201
|
});
|
|
15112
15202
|
var defaultSlots = {
|
|
@@ -15237,7 +15327,7 @@ function SlotsProvider({
|
|
|
15237
15327
|
}) {
|
|
15238
15328
|
const parentSlots = useContext9(SlotsContext);
|
|
15239
15329
|
const inheritedTheme = useContext9(ThemeModeContext);
|
|
15240
|
-
const resolved =
|
|
15330
|
+
const resolved = useMemo18(() => ({ ...parentSlots, ...overrides }), [parentSlots, overrides]);
|
|
15241
15331
|
const slotsTree = /* @__PURE__ */ jsx134(SlotsProviderContents, { slots: resolved, inheritedTheme, theme, children });
|
|
15242
15332
|
const hasParentTheme = inheritedTheme !== void 0;
|
|
15243
15333
|
if (theme !== void 0 || !hasParentTheme) {
|
|
@@ -15317,6 +15407,8 @@ export {
|
|
|
15317
15407
|
AgentMetricStatistics,
|
|
15318
15408
|
AgentMetricsView,
|
|
15319
15409
|
AgentOverviewCard,
|
|
15410
|
+
formatAbsoluteDateTime,
|
|
15411
|
+
MAX_SESSION_TITLE_LENGTH,
|
|
15320
15412
|
threadListIndicesByRecency,
|
|
15321
15413
|
readThreadAgentName,
|
|
15322
15414
|
threadListItemIsMutable,
|
|
@@ -15489,4 +15581,4 @@ export {
|
|
|
15489
15581
|
UserMessageContainer,
|
|
15490
15582
|
defaultSlots
|
|
15491
15583
|
};
|
|
15492
|
-
//# sourceMappingURL=chunk-
|
|
15584
|
+
//# sourceMappingURL=chunk-MLMR26WQ.js.map
|