@truefoundry/trueforge-ui 0.1.0-rc.0 → 0.1.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +48 -0
- package/dist/{ConnectorSettings-CLBEWGQJ.js → ConnectorSettings-H37ZFC6Z.js} +36 -13
- package/dist/ConnectorSettings-H37ZFC6Z.js.map +1 -0
- package/dist/{DockLayout-WRF7EQLD.js → DockLayout-KEMFRWIR.js} +8 -8
- package/dist/{DrawerLayout-X2UXYTOS.js → DrawerLayout-ZVWCKEIS.js} +8 -8
- package/dist/{ModelSettings-IJ55QJQO.js → ModelSettings-QJMYHCMD.js} +8 -8
- package/dist/{ModelSettings-IJ55QJQO.js.map → ModelSettings-QJMYHCMD.js.map} +1 -1
- package/dist/OpenUiFenceBlock-XFBUGPKQ.js +9 -0
- package/dist/{SandboxSettings-S5XGZWOL.js → SandboxSettings-BUBMLW7Q.js} +160 -66
- package/dist/SandboxSettings-BUBMLW7Q.js.map +1 -0
- package/dist/{SettingsBuilder-64Y33NP3.js → SettingsBuilder-26XSGIHK.js} +25 -17
- package/dist/SettingsBuilder-26XSGIHK.js.map +1 -0
- package/dist/{SidebarLayout-M7HEOZVK.js → SidebarLayout-F3XFXW7B.js} +8 -8
- package/dist/{SkillSettings-MXK4ZEI7.js → SkillSettings-IRMGDFRG.js} +6 -6
- package/dist/{WidgetLayout-7MDOKLHU.js → WidgetLayout-SZMABKIR.js} +8 -8
- package/dist/{chunk-NBMP2XNL.js → chunk-7EEOWDLE.js} +7 -7
- package/dist/chunk-DTF7ZMUJ.js +567 -0
- package/dist/chunk-DTF7ZMUJ.js.map +1 -0
- package/dist/{chunk-UXZOL5GO.js → chunk-H7DR64W3.js} +47 -32
- package/dist/chunk-H7DR64W3.js.map +1 -0
- package/dist/{chunk-42GF723P.js → chunk-HT5HKQXE.js} +2 -2
- package/dist/{chunk-WFC3W4C3.js → chunk-LRQHHZDX.js} +4 -4
- package/dist/{chunk-XSHXH6EI.js → chunk-QGNLP2EE.js} +530 -519
- package/dist/chunk-QGNLP2EE.js.map +1 -0
- package/dist/{chunk-UHGSHDBM.js → chunk-XAZ5HJXV.js} +237 -8
- package/dist/chunk-XAZ5HJXV.js.map +1 -0
- package/dist/index.d.ts +11 -3
- package/dist/index.js +115 -20
- package/dist/index.js.map +1 -1
- package/dist/plugins/trueforge-agent-server-adapter/index.d.ts +47 -37
- package/dist/plugins/trueforge-agent-server-adapter/index.js +74 -42
- package/dist/plugins/trueforge-agent-server-adapter/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +3 -3
- package/dist/ConnectorSettings-CLBEWGQJ.js.map +0 -1
- package/dist/OpenUiFenceBlock-SLLZSTMJ.js +0 -9
- package/dist/SandboxSettings-S5XGZWOL.js.map +0 -1
- package/dist/SettingsBuilder-64Y33NP3.js.map +0 -1
- package/dist/chunk-UBOFEI77.js +0 -567
- package/dist/chunk-UBOFEI77.js.map +0 -1
- package/dist/chunk-UHGSHDBM.js.map +0 -1
- package/dist/chunk-UXZOL5GO.js.map +0 -1
- package/dist/chunk-XSHXH6EI.js.map +0 -1
- /package/dist/{DockLayout-WRF7EQLD.js.map → DockLayout-KEMFRWIR.js.map} +0 -0
- /package/dist/{DrawerLayout-X2UXYTOS.js.map → DrawerLayout-ZVWCKEIS.js.map} +0 -0
- /package/dist/{OpenUiFenceBlock-SLLZSTMJ.js.map → OpenUiFenceBlock-XFBUGPKQ.js.map} +0 -0
- /package/dist/{SidebarLayout-M7HEOZVK.js.map → SidebarLayout-F3XFXW7B.js.map} +0 -0
- /package/dist/{SkillSettings-MXK4ZEI7.js.map → SkillSettings-IRMGDFRG.js.map} +0 -0
- /package/dist/{WidgetLayout-7MDOKLHU.js.map → WidgetLayout-SZMABKIR.js.map} +0 -0
- /package/dist/{chunk-NBMP2XNL.js.map → chunk-7EEOWDLE.js.map} +0 -0
- /package/dist/{chunk-42GF723P.js.map → chunk-HT5HKQXE.js.map} +0 -0
- /package/dist/{chunk-WFC3W4C3.js.map → chunk-LRQHHZDX.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
threadHasPendingMcpAuth,
|
|
27
27
|
useComposerBusyState,
|
|
28
28
|
useComposerPauseView
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-H7DR64W3.js";
|
|
30
30
|
import {
|
|
31
31
|
useAui,
|
|
32
32
|
useAuiState
|
|
@@ -55,7 +55,6 @@ import {
|
|
|
55
55
|
ComposerRightSection,
|
|
56
56
|
ComposerSendButton,
|
|
57
57
|
ComposerShell,
|
|
58
|
-
DraftCatalogProvider,
|
|
59
58
|
DraftComposerLeftSection,
|
|
60
59
|
DraftComposerRightSection,
|
|
61
60
|
DraftCompositeSelector,
|
|
@@ -102,36 +101,38 @@ import {
|
|
|
102
101
|
UserMessageEdit,
|
|
103
102
|
WelcomeScreen,
|
|
104
103
|
defaultSlots,
|
|
105
|
-
|
|
104
|
+
modelPatchWithReasoningEffort,
|
|
106
105
|
preloadMarkdownOpenUI,
|
|
107
106
|
useBrandName,
|
|
108
|
-
useDraftCatalog,
|
|
109
107
|
useMCPAuth,
|
|
110
108
|
useSlot,
|
|
111
109
|
useThemeMode,
|
|
112
110
|
useToaster,
|
|
113
111
|
useToasterOptional
|
|
114
|
-
} from "./chunk-
|
|
112
|
+
} from "./chunk-QGNLP2EE.js";
|
|
115
113
|
import {
|
|
116
114
|
DEFAULT_AGENT_CONFIG,
|
|
115
|
+
DraftCatalogProvider,
|
|
117
116
|
Icon,
|
|
118
117
|
ServerProvider,
|
|
119
118
|
ShellModeProvider,
|
|
120
119
|
Spinner,
|
|
120
|
+
getErrorMessage,
|
|
121
121
|
libraryAgentId,
|
|
122
122
|
registerIcons,
|
|
123
123
|
shellIsMutable,
|
|
124
124
|
useCatalogServer,
|
|
125
|
+
useDraftCatalog,
|
|
125
126
|
useOptionalCatalogServer,
|
|
126
127
|
useOptionalServer,
|
|
127
128
|
useOptionalShellMode,
|
|
128
129
|
useServer,
|
|
129
130
|
useServerCapabilities,
|
|
130
131
|
useShellMode
|
|
131
|
-
} from "./chunk-
|
|
132
|
+
} from "./chunk-XAZ5HJXV.js";
|
|
132
133
|
import {
|
|
133
134
|
OpenUiFenceBlock
|
|
134
|
-
} from "./chunk-
|
|
135
|
+
} from "./chunk-HT5HKQXE.js";
|
|
135
136
|
import {
|
|
136
137
|
PRESETS,
|
|
137
138
|
ThemeProvider,
|
|
@@ -142,7 +143,7 @@ import {
|
|
|
142
143
|
useOptionalContentClassNames,
|
|
143
144
|
useTheme,
|
|
144
145
|
useThemeIcons
|
|
145
|
-
} from "./chunk-
|
|
146
|
+
} from "./chunk-DTF7ZMUJ.js";
|
|
146
147
|
|
|
147
148
|
// src/icons/agent-2.svg
|
|
148
149
|
import * as React from "react";
|
|
@@ -306,6 +307,97 @@ function ToolGroupContainer({ children, group }) {
|
|
|
306
307
|
// src/containers/TrueforgeUI.tsx
|
|
307
308
|
import { lazy, Suspense, useMemo as useMemo2 } from "react";
|
|
308
309
|
|
|
310
|
+
// src/atoms/draft/DraftSpecPreferenceBridge.tsx
|
|
311
|
+
import { useTrueFoundryAgentSpec, useTrueFoundryUpdateAgentSpec } from "@truefoundry/assistant-ui-runtime";
|
|
312
|
+
import { useEffect as useEffect2 } from "react";
|
|
313
|
+
function mountName(mount) {
|
|
314
|
+
const name = Reflect.get(mount, "name");
|
|
315
|
+
return typeof name === "string" ? name : null;
|
|
316
|
+
}
|
|
317
|
+
function filterMounts(mounts, availableNames) {
|
|
318
|
+
if (mounts === void 0) return void 0;
|
|
319
|
+
const filtered = mounts.filter((mount) => {
|
|
320
|
+
const name = mountName(mount);
|
|
321
|
+
return name !== null && availableNames.has(name);
|
|
322
|
+
});
|
|
323
|
+
return filtered.length === mounts.length ? mounts : filtered;
|
|
324
|
+
}
|
|
325
|
+
function reconcileDraftSpecPreferences({
|
|
326
|
+
agentSpec,
|
|
327
|
+
models,
|
|
328
|
+
skills,
|
|
329
|
+
connectors,
|
|
330
|
+
skillsEnabled
|
|
331
|
+
}) {
|
|
332
|
+
const update = {};
|
|
333
|
+
const selectedModel = agentSpec.model.name.trim();
|
|
334
|
+
if (!models.some((model) => model.name === selectedModel)) {
|
|
335
|
+
const fallback = models[0];
|
|
336
|
+
if (fallback !== void 0) {
|
|
337
|
+
update.model = modelPatchWithReasoningEffort(
|
|
338
|
+
fallback.name,
|
|
339
|
+
agentSpec.model.params,
|
|
340
|
+
fallback.properties.reasoningEfforts
|
|
341
|
+
);
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
const nextMcpServers = filterMounts(agentSpec.mcpServers, new Set(connectors.map((connector) => connector.name)));
|
|
345
|
+
if (nextMcpServers !== agentSpec.mcpServers) {
|
|
346
|
+
update.mcpServers = nextMcpServers;
|
|
347
|
+
}
|
|
348
|
+
if (skillsEnabled === false) {
|
|
349
|
+
if (agentSpec.skills !== void 0 && agentSpec.skills.length > 0) {
|
|
350
|
+
update.skills = [];
|
|
351
|
+
}
|
|
352
|
+
} else {
|
|
353
|
+
const nextSkills = filterMounts(agentSpec.skills, new Set(skills.map((skill) => skill.name)));
|
|
354
|
+
if (nextSkills !== agentSpec.skills) {
|
|
355
|
+
update.skills = nextSkills;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
return update;
|
|
359
|
+
}
|
|
360
|
+
function DraftSpecPreferenceBridge() {
|
|
361
|
+
const { mode, pendingSessionId, rememberDraftSpec } = useShellMode();
|
|
362
|
+
const { agentSpec } = useTrueFoundryAgentSpec();
|
|
363
|
+
const updateAgentSpec = useTrueFoundryUpdateAgentSpec();
|
|
364
|
+
const capabilities = useServerCapabilities();
|
|
365
|
+
const { models, skills, connectors, loaded, error, ensureLoaded } = useDraftCatalog();
|
|
366
|
+
const isPlainDraft = mode.status === "active" && mode.isMutable && mode.agentId == null && pendingSessionId == null;
|
|
367
|
+
useEffect2(() => {
|
|
368
|
+
if (isPlainDraft) ensureLoaded();
|
|
369
|
+
}, [ensureLoaded, isPlainDraft]);
|
|
370
|
+
useEffect2(() => {
|
|
371
|
+
if (isPlainDraft && agentSpec != null) {
|
|
372
|
+
rememberDraftSpec(agentSpec);
|
|
373
|
+
}
|
|
374
|
+
}, [agentSpec, isPlainDraft, rememberDraftSpec]);
|
|
375
|
+
useEffect2(() => {
|
|
376
|
+
if (!isPlainDraft || agentSpec == null || updateAgentSpec == null || !loaded || error != null) return;
|
|
377
|
+
const update = reconcileDraftSpecPreferences({
|
|
378
|
+
agentSpec,
|
|
379
|
+
models,
|
|
380
|
+
skills,
|
|
381
|
+
connectors,
|
|
382
|
+
skillsEnabled: capabilities?.skill.enabled
|
|
383
|
+
});
|
|
384
|
+
if (Object.keys(update).length > 0) {
|
|
385
|
+
updateAgentSpec(update);
|
|
386
|
+
}
|
|
387
|
+
}, [
|
|
388
|
+
agentSpec,
|
|
389
|
+
capabilities?.skill.enabled,
|
|
390
|
+
connectors,
|
|
391
|
+
error,
|
|
392
|
+
isPlainDraft,
|
|
393
|
+
loaded,
|
|
394
|
+
models,
|
|
395
|
+
skills,
|
|
396
|
+
updateAgentSpec
|
|
397
|
+
]);
|
|
398
|
+
return null;
|
|
399
|
+
}
|
|
400
|
+
|
|
309
401
|
// src/containers/TrueFoundryChatProvider.tsx
|
|
310
402
|
import { AssistantRuntimeProvider } from "@assistant-ui/react";
|
|
311
403
|
import {
|
|
@@ -367,7 +459,7 @@ function TrueFoundryChatProvider(props) {
|
|
|
367
459
|
|
|
368
460
|
// src/containers/useResolvedServer.ts
|
|
369
461
|
import { createTrueFoundryAgentUIServer } from "@truefoundry/assistant-ui-runtime/plugins/truefoundry-agent-server-adapter";
|
|
370
|
-
import { useEffect as
|
|
462
|
+
import { useEffect as useEffect3, useState as useState3 } from "react";
|
|
371
463
|
var DEFAULT_CAPABILITIES = {
|
|
372
464
|
data: {
|
|
373
465
|
sandbox: { enabled: true },
|
|
@@ -410,7 +502,7 @@ function useResolvedServer(config, onError) {
|
|
|
410
502
|
}
|
|
411
503
|
return { status: "loading", server: null, error: null };
|
|
412
504
|
});
|
|
413
|
-
|
|
505
|
+
useEffect3(() => {
|
|
414
506
|
if (directServer) {
|
|
415
507
|
setState({ status: "ready", server: directServer, error: null });
|
|
416
508
|
return;
|
|
@@ -471,10 +563,10 @@ function useResolvedServer(config, onError) {
|
|
|
471
563
|
|
|
472
564
|
// src/containers/TrueforgeUI.tsx
|
|
473
565
|
import { jsx as jsx12, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
474
|
-
var SidebarLayout = lazy(() => import("./SidebarLayout-
|
|
475
|
-
var DrawerLayout = lazy(() => import("./DrawerLayout-
|
|
476
|
-
var DockLayout = lazy(() => import("./DockLayout-
|
|
477
|
-
var WidgetLayout = lazy(() => import("./WidgetLayout-
|
|
566
|
+
var SidebarLayout = lazy(() => import("./SidebarLayout-F3XFXW7B.js").then((m) => ({ default: m.SidebarLayout })));
|
|
567
|
+
var DrawerLayout = lazy(() => import("./DrawerLayout-ZVWCKEIS.js").then((m) => ({ default: m.DrawerLayout })));
|
|
568
|
+
var DockLayout = lazy(() => import("./DockLayout-KEMFRWIR.js").then((m) => ({ default: m.DockLayout })));
|
|
569
|
+
var WidgetLayout = lazy(() => import("./WidgetLayout-SZMABKIR.js").then((m) => ({ default: m.WidgetLayout })));
|
|
478
570
|
function LayoutFallback({ className }) {
|
|
479
571
|
return /* @__PURE__ */ jsx12(
|
|
480
572
|
"div",
|
|
@@ -586,7 +678,10 @@ function ChatProviderFromShell({
|
|
|
586
678
|
agent,
|
|
587
679
|
listSessionsAgentId,
|
|
588
680
|
initialSessionId: pendingSessionId ?? hostInitialSessionId,
|
|
589
|
-
children: /* @__PURE__ */
|
|
681
|
+
children: /* @__PURE__ */ jsxs6(DraftCatalogProvider, { children: [
|
|
682
|
+
/* @__PURE__ */ jsx12(DraftSpecPreferenceBridge, {}),
|
|
683
|
+
children
|
|
684
|
+
] })
|
|
590
685
|
},
|
|
591
686
|
runtimeKey
|
|
592
687
|
);
|
|
@@ -597,7 +692,7 @@ function TrueforgeUI(props) {
|
|
|
597
692
|
}
|
|
598
693
|
function TrueforgeUIShell(props) {
|
|
599
694
|
const {
|
|
600
|
-
layout,
|
|
695
|
+
layout = "sidebar",
|
|
601
696
|
overrides,
|
|
602
697
|
theme,
|
|
603
698
|
className,
|
|
@@ -624,7 +719,7 @@ import {
|
|
|
624
719
|
mergeAgentSpec,
|
|
625
720
|
trueFoundryAttachmentAdapter as trueFoundryAttachmentAdapter2,
|
|
626
721
|
useTrueFoundryAgentRuntime as useTrueFoundryAgentRuntime2,
|
|
627
|
-
useTrueFoundryAgentSpec,
|
|
722
|
+
useTrueFoundryAgentSpec as useTrueFoundryAgentSpec2,
|
|
628
723
|
useTrueFoundryCancel,
|
|
629
724
|
useTrueFoundryDownloadSandboxFile,
|
|
630
725
|
useTrueFoundryHistoryPagination,
|
|
@@ -632,7 +727,7 @@ import {
|
|
|
632
727
|
useTrueFoundryRespondToToolApproval,
|
|
633
728
|
useTrueFoundryToolResponses,
|
|
634
729
|
useTrueFoundryTurnId,
|
|
635
|
-
useTrueFoundryUpdateAgentSpec
|
|
730
|
+
useTrueFoundryUpdateAgentSpec as useTrueFoundryUpdateAgentSpec2
|
|
636
731
|
} from "@truefoundry/assistant-ui-runtime";
|
|
637
732
|
export {
|
|
638
733
|
AgentStepsCard,
|
|
@@ -768,7 +863,7 @@ export {
|
|
|
768
863
|
useToaster,
|
|
769
864
|
useToasterOptional,
|
|
770
865
|
useTrueFoundryAgentRuntime2 as useTrueFoundryAgentRuntime,
|
|
771
|
-
useTrueFoundryAgentSpec,
|
|
866
|
+
useTrueFoundryAgentSpec2 as useTrueFoundryAgentSpec,
|
|
772
867
|
useTrueFoundryCancel,
|
|
773
868
|
useTrueFoundryDownloadSandboxFile,
|
|
774
869
|
useTrueFoundryHistoryPagination,
|
|
@@ -776,6 +871,6 @@ export {
|
|
|
776
871
|
useTrueFoundryRespondToToolApproval,
|
|
777
872
|
useTrueFoundryToolResponses,
|
|
778
873
|
useTrueFoundryTurnId,
|
|
779
|
-
useTrueFoundryUpdateAgentSpec
|
|
874
|
+
useTrueFoundryUpdateAgentSpec2 as useTrueFoundryUpdateAgentSpec
|
|
780
875
|
};
|
|
781
876
|
//# sourceMappingURL=index.js.map
|