@truefoundry/trueforge-ui 0.1.0-rc.1 → 0.1.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.
Files changed (51) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/dist/{ConnectorSettings-ADACLWQI.js → ConnectorSettings-H37ZFC6Z.js} +35 -12
  3. package/dist/ConnectorSettings-H37ZFC6Z.js.map +1 -0
  4. package/dist/{DockLayout-BH5XX2AQ.js → DockLayout-KEMFRWIR.js} +8 -8
  5. package/dist/{DrawerLayout-O2XZQCG4.js → DrawerLayout-ZVWCKEIS.js} +8 -8
  6. package/dist/{ModelSettings-LKFJVUYQ.js → ModelSettings-QJMYHCMD.js} +5 -5
  7. package/dist/OpenUiFenceBlock-XFBUGPKQ.js +9 -0
  8. package/dist/{SandboxSettings-H5MDAE47.js → SandboxSettings-BUBMLW7Q.js} +159 -65
  9. package/dist/SandboxSettings-BUBMLW7Q.js.map +1 -0
  10. package/dist/{SettingsBuilder-3JOLC56Z.js → SettingsBuilder-26XSGIHK.js} +7 -7
  11. package/dist/{SidebarLayout-G6BGD7EY.js → SidebarLayout-F3XFXW7B.js} +8 -8
  12. package/dist/{SkillSettings-4VB42CVG.js → SkillSettings-IRMGDFRG.js} +5 -5
  13. package/dist/{WidgetLayout-ABSXZUSQ.js → WidgetLayout-SZMABKIR.js} +8 -8
  14. package/dist/{chunk-EFGSH3MO.js → chunk-7EEOWDLE.js} +7 -7
  15. package/dist/chunk-DTF7ZMUJ.js +567 -0
  16. package/dist/chunk-DTF7ZMUJ.js.map +1 -0
  17. package/dist/{chunk-3PTFNAQK.js → chunk-H7DR64W3.js} +46 -31
  18. package/dist/chunk-H7DR64W3.js.map +1 -0
  19. package/dist/{chunk-FDBJNXH2.js → chunk-HT5HKQXE.js} +2 -2
  20. package/dist/{chunk-VJTCFZNM.js → chunk-LRQHHZDX.js} +4 -4
  21. package/dist/{chunk-Z27F4LBZ.js → chunk-QGNLP2EE.js} +163 -71
  22. package/dist/chunk-QGNLP2EE.js.map +1 -0
  23. package/dist/{chunk-U5GBGEGN.js → chunk-XAZ5HJXV.js} +83 -9
  24. package/dist/chunk-XAZ5HJXV.js.map +1 -0
  25. package/dist/index.d.ts +6 -2
  26. package/dist/index.js +112 -17
  27. package/dist/index.js.map +1 -1
  28. package/dist/plugins/trueforge-agent-server-adapter/index.d.ts +42 -28
  29. package/dist/plugins/trueforge-agent-server-adapter/index.js +27 -16
  30. package/dist/plugins/trueforge-agent-server-adapter/index.js.map +1 -1
  31. package/dist/styles.css +1 -1
  32. package/package.json +4 -4
  33. package/dist/ConnectorSettings-ADACLWQI.js.map +0 -1
  34. package/dist/OpenUiFenceBlock-A2CWCPOP.js +0 -9
  35. package/dist/SandboxSettings-H5MDAE47.js.map +0 -1
  36. package/dist/chunk-3PTFNAQK.js.map +0 -1
  37. package/dist/chunk-U5GBGEGN.js.map +0 -1
  38. package/dist/chunk-WMRZSULD.js +0 -567
  39. package/dist/chunk-WMRZSULD.js.map +0 -1
  40. package/dist/chunk-Z27F4LBZ.js.map +0 -1
  41. /package/dist/{DockLayout-BH5XX2AQ.js.map → DockLayout-KEMFRWIR.js.map} +0 -0
  42. /package/dist/{DrawerLayout-O2XZQCG4.js.map → DrawerLayout-ZVWCKEIS.js.map} +0 -0
  43. /package/dist/{ModelSettings-LKFJVUYQ.js.map → ModelSettings-QJMYHCMD.js.map} +0 -0
  44. /package/dist/{OpenUiFenceBlock-A2CWCPOP.js.map → OpenUiFenceBlock-XFBUGPKQ.js.map} +0 -0
  45. /package/dist/{SettingsBuilder-3JOLC56Z.js.map → SettingsBuilder-26XSGIHK.js.map} +0 -0
  46. /package/dist/{SidebarLayout-G6BGD7EY.js.map → SidebarLayout-F3XFXW7B.js.map} +0 -0
  47. /package/dist/{SkillSettings-4VB42CVG.js.map → SkillSettings-IRMGDFRG.js.map} +0 -0
  48. /package/dist/{WidgetLayout-ABSXZUSQ.js.map → WidgetLayout-SZMABKIR.js.map} +0 -0
  49. /package/dist/{chunk-EFGSH3MO.js.map → chunk-7EEOWDLE.js.map} +0 -0
  50. /package/dist/{chunk-FDBJNXH2.js.map → chunk-HT5HKQXE.js.map} +0 -0
  51. /package/dist/{chunk-VJTCFZNM.js.map → chunk-LRQHHZDX.js.map} +0 -0
@@ -12,10 +12,10 @@ import {
12
12
  useOptionalServer,
13
13
  useOptionalShellMode,
14
14
  useServerCapabilities
15
- } from "./chunk-U5GBGEGN.js";
15
+ } from "./chunk-XAZ5HJXV.js";
16
16
  import {
17
17
  OpenUiFenceBlock
18
- } from "./chunk-FDBJNXH2.js";
18
+ } from "./chunk-HT5HKQXE.js";
19
19
  import {
20
20
  ThemeContext,
21
21
  ThemeProvider,
@@ -23,7 +23,7 @@ import {
23
23
  useOptionalContentClassNames,
24
24
  useOptionalThemeMode,
25
25
  useOptionalThemePreset
26
- } from "./chunk-WMRZSULD.js";
26
+ } from "./chunk-DTF7ZMUJ.js";
27
27
 
28
28
  // src/theme/brand.tsx
29
29
  import { useContext } from "react";
@@ -2212,6 +2212,8 @@ import { cloneElement, isValidElement, useLayoutEffect as useLayoutEffect2, useR
2212
2212
  import { createPortal } from "react-dom";
2213
2213
  import { jsx as jsx33, jsxs as jsxs23 } from "react/jsx-runtime";
2214
2214
  function themePortalRoot(from) {
2215
+ const dialog = from?.closest("dialog");
2216
+ if (dialog instanceof HTMLElement) return dialog;
2215
2217
  return from?.closest(".aui-theme-root") ?? document.body;
2216
2218
  }
2217
2219
  function Tooltip({ content, children, className, side = "top" }) {
@@ -2391,8 +2393,37 @@ function DraftCapabilitiesPanel({
2391
2393
  value,
2392
2394
  onChange,
2393
2395
  disabled = false,
2394
- divided = false
2396
+ divided = false,
2397
+ layout = "list"
2395
2398
  }) {
2399
+ if (layout === "cards") {
2400
+ return /* @__PURE__ */ jsx35("div", { className: "flex flex-col gap-2 sm:flex-row", children: CAPABILITIES.map((capability) => {
2401
+ const checked = value[capability.id];
2402
+ return /* @__PURE__ */ jsxs24(
2403
+ "div",
2404
+ {
2405
+ className: "border-border flex min-w-0 flex-col gap-2 rounded-lg border p-3 sm:flex-1",
2406
+ children: [
2407
+ /* @__PURE__ */ jsxs24("div", { className: "flex items-start justify-between gap-2", children: [
2408
+ /* @__PURE__ */ jsx35("p", { className: "text-text-primary text-sm font-medium", children: capability.label }),
2409
+ /* @__PURE__ */ jsx35(
2410
+ Switch,
2411
+ {
2412
+ checked,
2413
+ "aria-label": capability.label,
2414
+ disabled,
2415
+ className: "mt-0.5",
2416
+ onCheckedChange: (nextChecked) => onChange({ ...value, [capability.id]: nextChecked })
2417
+ }
2418
+ )
2419
+ ] }),
2420
+ /* @__PURE__ */ jsx35("p", { className: "text-text-secondary text-xs leading-snug", children: capability.description })
2421
+ ]
2422
+ },
2423
+ capability.id
2424
+ );
2425
+ }) });
2426
+ }
2396
2427
  return /* @__PURE__ */ jsx35("div", { className: cn("flex flex-col", divided && "overflow-hidden rounded-xl border border-border"), children: CAPABILITIES.map((capability, index) => {
2397
2428
  const checked = value[capability.id];
2398
2429
  return /* @__PURE__ */ jsxs24(
@@ -3304,7 +3335,7 @@ import ReactMarkdown from "react-markdown";
3304
3335
  import remarkGfm from "remark-gfm";
3305
3336
  import { Fragment as Fragment8, jsx as jsx41 } from "react/jsx-runtime";
3306
3337
  function preloadMarkdownOpenUI() {
3307
- return import("./OpenUiFenceBlock-A2CWCPOP.js");
3338
+ return import("./OpenUiFenceBlock-XFBUGPKQ.js");
3308
3339
  }
3309
3340
  var LARGE_STREAMING_FENCE_CHARS = 8 * 1024;
3310
3341
  function getActiveStreamingFenceCode(content) {
@@ -3977,32 +4008,94 @@ function editableMountsFromSpec(value) {
3977
4008
  }
3978
4009
  return mounts;
3979
4010
  }
3980
- function SummarySection({
3981
- icon,
3982
- title,
3983
- value,
4011
+ function ConfigSection({
4012
+ label,
3984
4013
  onEdit,
3985
- disabled
4014
+ disabled,
4015
+ children
3986
4016
  }) {
3987
- return /* @__PURE__ */ jsxs31("div", { className: "flex items-center gap-3 border-b border-border px-5 py-3.5 last:border-b-0", children: [
3988
- /* @__PURE__ */ jsx49(Icon, { name: icon, className: "text-text-secondary size-4 shrink-0" }),
3989
- /* @__PURE__ */ jsxs31("div", { className: "min-w-0 flex-1", children: [
3990
- /* @__PURE__ */ jsx49("p", { className: "text-text-primary text-sm font-medium", children: title }),
3991
- /* @__PURE__ */ jsx49("p", { className: "text-text-secondary mt-0.5 truncate text-xs", children: value })
4017
+ return /* @__PURE__ */ jsxs31("div", { className: "mb-3", children: [
4018
+ /* @__PURE__ */ jsxs31("div", { className: "mb-1.5 flex items-center justify-between", children: [
4019
+ /* @__PURE__ */ jsx49("span", { className: "text-text-secondary text-xs font-semibold tracking-wide uppercase", children: label }),
4020
+ /* @__PURE__ */ jsx49(
4021
+ "button",
4022
+ {
4023
+ type: "button",
4024
+ "aria-label": `Edit ${label}`,
4025
+ disabled,
4026
+ className: auiButtonClass({ variant: "ghost", size: "icon", className: "size-7" }),
4027
+ onClick: onEdit,
4028
+ children: /* @__PURE__ */ jsx49(Icon, { name: "pencil", className: "size-3.5" })
4029
+ }
4030
+ )
3992
4031
  ] }),
3993
- /* @__PURE__ */ jsx49(
3994
- "button",
3995
- {
3996
- type: "button",
3997
- "aria-label": `Edit ${title}`,
3998
- disabled,
3999
- className: auiButtonClass({ variant: "ghost", size: "icon", className: "size-8" }),
4000
- onClick: onEdit,
4001
- children: /* @__PURE__ */ jsx49(Icon, { name: "pencil", className: "size-3.5" })
4002
- }
4003
- )
4032
+ children
4004
4033
  ] });
4005
4034
  }
4035
+ var PRELOAD_TOOLS_COPY = {
4036
+ header: "Preload tools",
4037
+ on: "Tool definitions load into context upfront. No discovery step, but uses more context.",
4038
+ off: "The agent discovers tools on demand. Lighter context upfront, but a discovery step the first time it needs a tool."
4039
+ };
4040
+ function PreloadToggle({ on, disabled, onToggle }) {
4041
+ const label = `${PRELOAD_TOOLS_COPY.header} \xB7 ${on ? "ON" : "OFF"}`;
4042
+ const body = on ? PRELOAD_TOOLS_COPY.on : PRELOAD_TOOLS_COPY.off;
4043
+ return /* @__PURE__ */ jsx49(
4044
+ Tooltip,
4045
+ {
4046
+ className: "max-w-[17rem] whitespace-normal",
4047
+ content: /* @__PURE__ */ jsxs31("div", { className: "text-left", children: [
4048
+ /* @__PURE__ */ jsx49("p", { className: "mb-1 text-[11px] font-semibold tracking-wide uppercase", children: label }),
4049
+ /* @__PURE__ */ jsx49("p", { className: "text-xs leading-snug", children: body })
4050
+ ] }),
4051
+ children: /* @__PURE__ */ jsx49(
4052
+ "button",
4053
+ {
4054
+ type: "button",
4055
+ "aria-label": label,
4056
+ "aria-pressed": on,
4057
+ disabled,
4058
+ onClick: onToggle,
4059
+ className: cn(
4060
+ "flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-md border",
4061
+ "transition-[color,background-color,border-color,transform] active:scale-90",
4062
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring/40",
4063
+ "disabled:cursor-not-allowed disabled:opacity-50 disabled:active:scale-100",
4064
+ on ? "border-primary-button-bg/40 bg-primary-button-bg/10 text-primary-button-bg hover:border-primary-button-bg/70 hover:bg-primary-button-bg/20" : "border-border text-text-secondary hover:border-text-secondary/50 hover:bg-text-secondary/10 hover:text-text-primary"
4065
+ ),
4066
+ children: /* @__PURE__ */ jsx49(Icon, { name: "book-open", className: "size-3.5" })
4067
+ }
4068
+ )
4069
+ }
4070
+ );
4071
+ }
4072
+ function MountChips({
4073
+ mounts,
4074
+ disabled,
4075
+ emptyLabel,
4076
+ onTogglePreload
4077
+ }) {
4078
+ if (mounts.length === 0) {
4079
+ return /* @__PURE__ */ jsx49("p", { className: "text-text-secondary text-xs", children: emptyLabel });
4080
+ }
4081
+ return /* @__PURE__ */ jsx49("div", { className: "flex flex-wrap gap-2", children: mounts.map((mount) => {
4082
+ const on = Boolean(mount.value.preload);
4083
+ return /* @__PURE__ */ jsxs31(
4084
+ "span",
4085
+ {
4086
+ className: cn(
4087
+ "border-border flex items-center gap-2 rounded-lg border py-1 pr-2.5",
4088
+ onTogglePreload ? "pl-1.5" : "pl-2.5"
4089
+ ),
4090
+ children: [
4091
+ onTogglePreload ? /* @__PURE__ */ jsx49(PreloadToggle, { on, disabled, onToggle: () => onTogglePreload(mount.id) }) : null,
4092
+ /* @__PURE__ */ jsx49("span", { className: "text-text-primary text-sm", children: mount.name })
4093
+ ]
4094
+ },
4095
+ mount.id
4096
+ );
4097
+ }) });
4098
+ }
4006
4099
  function SaveAgentButton({ disabled = false, className, children = "Save Agent" }) {
4007
4100
  return /* @__PURE__ */ jsx49(DraftCatalogProvider, { children: /* @__PURE__ */ jsx49(SaveAgentButtonContent, { disabled, className, children }) });
4008
4101
  }
@@ -4034,6 +4127,10 @@ function SaveAgentButtonContent({
4034
4127
  const errorRef = useRef11(null);
4035
4128
  const mcpMounts = useMemo6(() => editableMountsFromSpec(draftSpec?.mcpServers), [draftSpec?.mcpServers]);
4036
4129
  const skillMounts = useMemo6(() => editableMountsFromSpec(draftSpec?.skills), [draftSpec?.skills]);
4130
+ const modelEntry = useMemo6(
4131
+ () => catalog.models.find((model) => model.name === draftSpec?.model.name),
4132
+ [catalog.models, draftSpec?.model.name]
4133
+ );
4037
4134
  useEffect13(() => {
4038
4135
  if (error === null) return;
4039
4136
  errorRef.current?.scrollIntoView?.({ block: "nearest", behavior: "smooth" });
@@ -4096,6 +4193,15 @@ function SaveAgentButtonContent({
4096
4193
  setSaving(false);
4097
4194
  }
4098
4195
  };
4196
+ const toggleMcpPreload = (id) => {
4197
+ if (draftSpec === null) return;
4198
+ const next = (draftSpec.mcpServers ?? []).map((item) => {
4199
+ const record = item;
4200
+ const itemId = typeof record.id === "string" ? record.id : record.name;
4201
+ return itemId === id ? { ...record, preload: record.preload !== true } : item;
4202
+ });
4203
+ setDraftSpec({ ...draftSpec, mcpServers: next });
4204
+ };
4099
4205
  const filteredConnectors = catalog.connectors.filter(
4100
4206
  (item) => `${item.name} ${item.description ?? ""}`.toLowerCase().includes(search.trim().toLowerCase())
4101
4207
  );
@@ -4125,12 +4231,11 @@ function SaveAgentButtonContent({
4125
4231
  open,
4126
4232
  onOpenChange: (next) => !next && close(),
4127
4233
  title: intent === "create" ? "Save agent" : "Update agent",
4128
- description: "Review the configuration before saving.",
4129
- className: "md:max-w-lg",
4234
+ className: "md:h-auto md:max-h-[85dvh] md:max-w-2xl",
4130
4235
  "aria-label": intent === "create" ? "Save agent" : "Update agent",
4131
- children: draftSpec ? /* @__PURE__ */ jsxs31("div", { className: "flex min-h-0 w-[min(32rem,calc(100vw-2rem))] flex-1 flex-col", children: [
4132
- /* @__PURE__ */ jsxs31("div", { className: "min-h-0 flex-1 overflow-y-auto px-5 py-4", children: [
4133
- /* @__PURE__ */ jsxs31("label", { className: "mb-4 block", children: [
4236
+ children: draftSpec ? /* @__PURE__ */ jsxs31("div", { className: "flex min-h-0 w-full flex-1 flex-col", children: [
4237
+ /* @__PURE__ */ jsxs31("div", { className: "min-h-0 flex-1 overflow-y-auto px-5 py-3", children: [
4238
+ /* @__PURE__ */ jsxs31("label", { className: "mb-3 block", children: [
4134
4239
  /* @__PURE__ */ jsx49("span", { className: "mb-1.5 block text-sm font-medium", children: "Agent name" }),
4135
4240
  /* @__PURE__ */ jsx49(
4136
4241
  "input",
@@ -4143,7 +4248,7 @@ function SaveAgentButtonContent({
4143
4248
  }
4144
4249
  )
4145
4250
  ] }),
4146
- /* @__PURE__ */ jsxs31("label", { className: "mb-4 block", children: [
4251
+ /* @__PURE__ */ jsxs31("label", { className: "mb-3 block", children: [
4147
4252
  /* @__PURE__ */ jsx49("span", { className: "mb-1.5 block text-sm font-medium", children: "Instructions" }),
4148
4253
  /* @__PURE__ */ jsx49(
4149
4254
  "textarea",
@@ -4151,53 +4256,39 @@ function SaveAgentButtonContent({
4151
4256
  value: draftSpec.instructions ?? "",
4152
4257
  disabled: saving,
4153
4258
  onChange: (event) => setDraftSpec({ ...draftSpec, instructions: event.target.value }),
4154
- rows: 4,
4259
+ rows: 5,
4155
4260
  placeholder: "You are a release notes writer for a platform team.",
4156
4261
  className: auiInputClass("resize-y py-2 disabled:opacity-60")
4157
4262
  }
4158
4263
  )
4159
4264
  ] }),
4160
- /* @__PURE__ */ jsxs31("div", { className: "mb-4", children: [
4161
- /* @__PURE__ */ jsx49("h3", { className: "mb-2 text-sm font-medium", children: "Configuration" }),
4162
- /* @__PURE__ */ jsxs31("div", { className: "overflow-hidden rounded-xl border border-border", children: [
4163
- /* @__PURE__ */ jsx49(
4164
- SummarySection,
4165
- {
4166
- icon: "cpu",
4167
- title: "Model",
4168
- value: draftSpec.model.name ? displayModelLabel2(draftSpec.model.name) : "Not selected",
4169
- disabled: saving,
4170
- onEdit: () => setEditor("model")
4171
- }
4172
- ),
4173
- /* @__PURE__ */ jsx49(
4174
- SummarySection,
4175
- {
4176
- icon: "plug",
4177
- title: "Connectors",
4178
- value: `${mcpMounts.length} selected`,
4179
- disabled: saving,
4180
- onEdit: () => setEditor("mcp")
4181
- }
4182
- ),
4183
- /* @__PURE__ */ jsx49(
4184
- SummarySection,
4185
- {
4186
- icon: "lightbulb",
4187
- title: "Skills",
4188
- value: `${skillMounts.length} selected`,
4189
- disabled: saving,
4190
- onEdit: () => setEditor("skills")
4191
- }
4192
- )
4193
- ] })
4194
- ] }),
4265
+ /* @__PURE__ */ jsx49(ConfigSection, { label: "Model", onEdit: () => setEditor("model"), disabled: saving, children: draftSpec.model.name ? /* @__PURE__ */ jsxs31("span", { className: "border-border inline-flex items-center gap-2 rounded-lg border py-1 pr-2.5 pl-2", children: [
4266
+ /* @__PURE__ */ jsx49(
4267
+ ProviderMark,
4268
+ {
4269
+ logo: modelEntry?.provider.logo,
4270
+ label: modelEntry?.provider.name ?? draftSpec.model.name,
4271
+ className: "size-5 text-[10px]"
4272
+ }
4273
+ ),
4274
+ /* @__PURE__ */ jsx49("span", { className: "text-text-primary text-sm", children: displayModelLabel2(draftSpec.model.name) })
4275
+ ] }) : /* @__PURE__ */ jsx49("p", { className: "text-text-secondary text-xs", children: "No model selected." }) }),
4276
+ /* @__PURE__ */ jsx49(ConfigSection, { label: "Connectors", onEdit: () => setEditor("mcp"), disabled: saving, children: /* @__PURE__ */ jsx49(
4277
+ MountChips,
4278
+ {
4279
+ mounts: mcpMounts,
4280
+ disabled: saving,
4281
+ emptyLabel: "No connectors added.",
4282
+ onTogglePreload: toggleMcpPreload
4283
+ }
4284
+ ) }),
4285
+ /* @__PURE__ */ jsx49(ConfigSection, { label: "Skills", onEdit: () => setEditor("skills"), disabled: saving, children: /* @__PURE__ */ jsx49(MountChips, { mounts: skillMounts, disabled: saving, emptyLabel: "No skills added." }) }),
4195
4286
  /* @__PURE__ */ jsxs31("div", { children: [
4196
- /* @__PURE__ */ jsx49("h3", { className: "mb-2 text-sm font-medium", children: "Capabilities" }),
4287
+ /* @__PURE__ */ jsx49("p", { className: "text-text-secondary mb-1.5 text-xs font-semibold tracking-wide uppercase", children: "Capabilities" }),
4197
4288
  /* @__PURE__ */ jsx49(
4198
4289
  DraftCapabilitiesPanel,
4199
4290
  {
4200
- divided: true,
4291
+ layout: "cards",
4201
4292
  value: readAgentCapabilities(draftSpec.config),
4202
4293
  disabled: saving,
4203
4294
  onChange: (values) => setDraftSpec({
@@ -6661,6 +6752,7 @@ export {
6661
6752
  ComposerShell,
6662
6753
  useIsMobile,
6663
6754
  BottomSheet,
6755
+ modelPatchWithReasoningEffort,
6664
6756
  DraftComposerLeftSection,
6665
6757
  DraftComposerRightSection,
6666
6758
  ToasterProvider,
@@ -6716,4 +6808,4 @@ export {
6716
6808
  WelcomeScreen,
6717
6809
  defaultSlots
6718
6810
  };
6719
- //# sourceMappingURL=chunk-Z27F4LBZ.js.map
6811
+ //# sourceMappingURL=chunk-QGNLP2EE.js.map