@burdenoff/microfe-botmanor 2026.821.1 → 2026.925.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/dist/botlit/BotlitRoutes.js.map +1 -1
  2. package/dist/botlit/BotmanorRoot.js.map +1 -1
  3. package/dist/botlit/BotmanorRootInner.js +4 -4
  4. package/dist/botlit/BotmanorRootInner.js.map +1 -1
  5. package/dist/botlit/components/ErrorState.js +33 -29
  6. package/dist/botlit/components/ErrorState.js.map +1 -1
  7. package/dist/botlit/components/RouteLoader.js +52 -48
  8. package/dist/botlit/components/RouteLoader.js.map +1 -1
  9. package/dist/botlit/components/VersionHistoryPanel.js +74 -77
  10. package/dist/botlit/components/VersionHistoryPanel.js.map +1 -1
  11. package/dist/botlit/components/WorkspaceRequired.js +31 -30
  12. package/dist/botlit/components/WorkspaceRequired.js.map +1 -1
  13. package/dist/botlit/hooks/internal/workspaceGateway.js.map +1 -1
  14. package/dist/botlit/hooks/useConversations.js.map +1 -1
  15. package/dist/botlit/hooks/useLLMProviders.js.map +1 -1
  16. package/dist/botlit/pages/A2AAgentDetailPage.js +1 -1
  17. package/dist/botlit/pages/A2AAgentDetailPage.js.map +1 -1
  18. package/dist/botlit/pages/A2ARegistryPage.js +116 -124
  19. package/dist/botlit/pages/A2ARegistryPage.js.map +1 -1
  20. package/dist/botlit/pages/AgentDetailPage.js +169 -172
  21. package/dist/botlit/pages/AgentDetailPage.js.map +1 -1
  22. package/dist/botlit/pages/AgentsListPage.js +96 -90
  23. package/dist/botlit/pages/AgentsListPage.js.map +1 -1
  24. package/dist/botlit/pages/BotChannelsTab.js.map +1 -1
  25. package/dist/botlit/pages/BotDetailPage.js +228 -231
  26. package/dist/botlit/pages/BotDetailPage.js.map +1 -1
  27. package/dist/botlit/pages/BotWorkflowTab.js +84 -87
  28. package/dist/botlit/pages/BotWorkflowTab.js.map +1 -1
  29. package/dist/botlit/pages/BotsListPage.js +144 -147
  30. package/dist/botlit/pages/BotsListPage.js.map +1 -1
  31. package/dist/botlit/pages/BucketsPage.js +3 -3
  32. package/dist/botlit/pages/BucketsPage.js.map +1 -1
  33. package/dist/botlit/pages/ChannelDetailPage.js +1 -1
  34. package/dist/botlit/pages/ChannelDetailPage.js.map +1 -1
  35. package/dist/botlit/pages/ChannelsPage.js +156 -149
  36. package/dist/botlit/pages/ChannelsPage.js.map +1 -1
  37. package/dist/botlit/pages/ChatPage.js +126 -129
  38. package/dist/botlit/pages/ChatPage.js.map +1 -1
  39. package/dist/botlit/pages/DashboardPage.js +111 -114
  40. package/dist/botlit/pages/DashboardPage.js.map +1 -1
  41. package/dist/botlit/pages/ExecutionsPage.js +163 -159
  42. package/dist/botlit/pages/ExecutionsPage.js.map +1 -1
  43. package/dist/botlit/pages/InstalledPackagesPage.js +3 -3
  44. package/dist/botlit/pages/InstalledPackagesPage.js.map +1 -1
  45. package/dist/botlit/pages/KnowledgeBasesPage.js +84 -78
  46. package/dist/botlit/pages/KnowledgeBasesPage.js.map +1 -1
  47. package/dist/botlit/pages/MCPServersPage.js +159 -154
  48. package/dist/botlit/pages/MCPServersPage.js.map +1 -1
  49. package/dist/botlit/pages/PoliciesPage.js +119 -114
  50. package/dist/botlit/pages/PoliciesPage.js.map +1 -1
  51. package/dist/botlit/pages/RetrievalProfilesPage.js +102 -109
  52. package/dist/botlit/pages/RetrievalProfilesPage.js.map +1 -1
  53. package/dist/botlit/pages/SettingsPage.js +144 -159
  54. package/dist/botlit/pages/SettingsPage.js.map +1 -1
  55. package/dist/botlit/pages/SkillsPage.js +122 -105
  56. package/dist/botlit/pages/SkillsPage.js.map +1 -1
  57. package/dist/botlit/pages/StorePage.js +176 -175
  58. package/dist/botlit/pages/StorePage.js.map +1 -1
  59. package/dist/botlit/providers/BotlitProvider.js.map +1 -1
  60. package/dist/botlit/store/botlitStore.js +1 -1
  61. package/dist/botlit/store/botlitStore.js.map +1 -1
  62. package/dist/botlit/utils/navigation.js.map +1 -1
  63. package/dist/shared/hooks/useTr.js +14 -0
  64. package/dist/shared/hooks/useTr.js.map +1 -0
  65. package/package.json +33 -9
@@ -1,138 +1,135 @@
1
- import { useAgentVersions as e, usePublishAgentVersion as t, useRollbackAgentVersion as n } from "../hooks/useAgents.js";
2
- import { formatRelativeTime as r } from "../utils/formatters.js";
3
- import { Card as i, CardContent as a, CardDescription as o, CardHeader as s, CardTitle as c } from "./Card.js";
4
- import { Button as l } from "./Button.js";
5
- import { Badge as u } from "./Badge.js";
6
- import { useState as d } from "react";
7
- import { AlertDialog as f, AlertDialogAction as p, AlertDialogCancel as m, AlertDialogContent as h, AlertDialogDescription as g, AlertDialogFooter as _, AlertDialogHeader as v, AlertDialogTitle as y, Dialog as b, DialogContent as x, DialogDescription as S, DialogFooter as C, DialogHeader as w, DialogTitle as T, Textarea as E } from "@burdenoff/fe-libs/ui";
8
- import { jsx as D, jsxs as O } from "react/jsx-runtime";
9
- import { CheckCircle2 as k, History as A, Rocket as j, RotateCcw as M } from "lucide-react";
10
- import { useI18n as N } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
1
+ import { useTr as e } from "../../shared/hooks/useTr.js";
2
+ import { useAgentVersions as t, usePublishAgentVersion as n, useRollbackAgentVersion as r } from "../hooks/useAgents.js";
3
+ import { formatRelativeTime as i } from "../utils/formatters.js";
4
+ import { Card as a, CardContent as o, CardDescription as s, CardHeader as c, CardTitle as l } from "./Card.js";
5
+ import { Button as u } from "./Button.js";
6
+ import { Badge as d } from "./Badge.js";
7
+ import { useState as f } from "react";
8
+ import { AlertDialog as p, AlertDialogAction as m, AlertDialogCancel as h, AlertDialogContent as g, AlertDialogDescription as _, AlertDialogFooter as v, AlertDialogHeader as y, AlertDialogTitle as b, Dialog as x, DialogContent as S, DialogDescription as C, DialogFooter as w, DialogHeader as T, DialogTitle as E, Textarea as D } from "@burdenoff/fe-libs/ui";
9
+ import { jsx as O, jsxs as k } from "react/jsx-runtime";
10
+ import { CheckCircle2 as A, History as j, Rocket as M, RotateCcw as N } from "lucide-react";
11
11
  import { toast as P } from "sonner";
12
12
  //#region src/botlit/components/VersionHistoryPanel.tsx
13
13
  function F(e) {
14
14
  return e === "DRAFT" ? "secondary" : e === "PUBLISHED" ? "success" : "outline";
15
15
  }
16
16
  var I = ({ agentId: I, draftVersionId: L, currentVersionId: ee, onChanged: R }) => {
17
- let { t: z } = N(), B = (e, t) => {
18
- let n = z(e);
19
- return n === e ? t : n;
20
- }, { data: V, loading: H, refetch: U } = e(I), [W, G] = t(), [K, q] = n(), [J, Y] = d(!1), [X, Z] = d(""), [Q, $] = d(null), te = async () => {
17
+ let z = e(), { data: B, loading: V, refetch: H } = t(I), [U, W] = n(), [G, K] = r(), [q, J] = f(!1), [Y, X] = f(""), [Z, Q] = f(null), $ = async () => {
21
18
  if (L) try {
22
- let e = await W({
19
+ let e = await U({
23
20
  agentId: I,
24
21
  versionId: L,
25
- changelog: X
22
+ changelog: Y
26
23
  });
27
- P.success(`${B("botlit.agentDetail.versions.publishSuccessPrefix", "Published version")} ${e.version}`), Y(!1), Z(""), await U(), R?.();
24
+ P.success(`${z("botlit.agentDetail.versions.publishSuccessPrefix", "Published version")} ${e.version}`), J(!1), X(""), await H(), R?.();
28
25
  } catch (e) {
29
- P.error(e instanceof Error ? e.message : B("botlit.agentDetail.versions.publishError", "Failed to publish version"));
26
+ P.error(e instanceof Error ? e.message : z("botlit.agentDetail.versions.publishError", "Failed to publish version"));
30
27
  }
31
- }, ne = async () => {
32
- if (Q) try {
33
- let e = await K({
28
+ }, te = async () => {
29
+ if (Z) try {
30
+ let e = await G({
34
31
  agentId: I,
35
- targetVersionId: Q.id
32
+ targetVersionId: Z.id
36
33
  });
37
- P.success(`${B("botlit.agentDetail.versions.rollbackSuccessPrefix", "Rolled back to version")} ${Q.version} (${B("botlit.agentDetail.versions.rollbackSuccessSuffix", "now")} ${e.version})`), $(null), await U(), R?.();
34
+ P.success(`${z("botlit.agentDetail.versions.rollbackSuccessPrefix", "Rolled back to version")} ${Z.version} (${z("botlit.agentDetail.versions.rollbackSuccessSuffix", "now")} ${e.version})`), Q(null), await H(), R?.();
38
35
  } catch (e) {
39
- P.error(e instanceof Error ? e.message : B("botlit.agentDetail.versions.rollbackError", "Failed to roll back agent version"));
36
+ P.error(e instanceof Error ? e.message : z("botlit.agentDetail.versions.rollbackError", "Failed to roll back agent version"));
40
37
  }
41
38
  };
42
- return /* @__PURE__ */ O("div", {
39
+ return /* @__PURE__ */ k("div", {
43
40
  className: "space-y-6",
44
41
  children: [
45
- /* @__PURE__ */ O(i, { children: [/* @__PURE__ */ O(s, {
42
+ /* @__PURE__ */ k(a, { children: [/* @__PURE__ */ k(c, {
46
43
  className: "flex flex-row items-start justify-between gap-4",
47
- children: [/* @__PURE__ */ O("div", { children: [/* @__PURE__ */ O(c, {
44
+ children: [/* @__PURE__ */ k("div", { children: [/* @__PURE__ */ k(l, {
48
45
  className: "flex items-center gap-2",
49
- children: [/* @__PURE__ */ D(A, { size: 18 }), B("botlit.agentDetail.versions.title", "Version History")]
50
- }), /* @__PURE__ */ D(o, { children: B("botlit.agentDetail.versions.description", "Every published configuration change, with a diff-able changelog. Publish the current draft or roll back to any prior version.") })] }), L && /* @__PURE__ */ D(l, {
51
- leftIcon: /* @__PURE__ */ D(j, { size: 16 }),
52
- onClick: () => Y(!0),
53
- children: B("botlit.agentDetail.versions.publishDraft", "Publish Draft")
46
+ children: [/* @__PURE__ */ O(j, { size: 18 }), z("botlit.agentDetail.versions.title", "Version History")]
47
+ }), /* @__PURE__ */ O(s, { children: z("botlit.agentDetail.versions.description", "Every published configuration change, with a diff-able changelog. Publish the current draft or roll back to any prior version.") })] }), L && /* @__PURE__ */ O(u, {
48
+ leftIcon: /* @__PURE__ */ O(M, { size: 16 }),
49
+ onClick: () => J(!0),
50
+ children: z("botlit.agentDetail.versions.publishDraft", "Publish Draft")
54
51
  })]
55
- }), /* @__PURE__ */ D(a, { children: H ? /* @__PURE__ */ D("div", { className: "h-32 bg-bg-sunken motion-safe:animate-vc-shimmer rounded-lg" }) : V.length === 0 ? /* @__PURE__ */ D("p", {
52
+ }), /* @__PURE__ */ O(o, { children: V ? /* @__PURE__ */ O("div", { className: "h-32 bg-bg-sunken motion-safe:animate-vc-shimmer rounded-lg" }) : B.length === 0 ? /* @__PURE__ */ O("p", {
56
53
  className: "text-text-secondary",
57
- children: B("botlit.agentDetail.versions.empty", "No version history yet.")
58
- }) : /* @__PURE__ */ D("ul", {
54
+ children: z("botlit.agentDetail.versions.empty", "No version history yet.")
55
+ }) : /* @__PURE__ */ O("ul", {
59
56
  className: "space-y-3",
60
- children: V.map((e) => {
57
+ children: B.map((e) => {
61
58
  let t = e.id === ee, n = e.status !== "DRAFT" && !t;
62
- return /* @__PURE__ */ O("li", {
59
+ return /* @__PURE__ */ k("li", {
63
60
  className: "flex items-start justify-between gap-4 p-4 border border-border-subtle rounded-lg",
64
- children: [/* @__PURE__ */ O("div", {
61
+ children: [/* @__PURE__ */ k("div", {
65
62
  className: "space-y-1 min-w-0",
66
63
  children: [
67
- /* @__PURE__ */ O("div", {
64
+ /* @__PURE__ */ k("div", {
68
65
  className: "flex items-center gap-2 flex-wrap",
69
66
  children: [
70
- /* @__PURE__ */ O("span", {
67
+ /* @__PURE__ */ k("span", {
71
68
  className: "font-mono font-medium",
72
69
  children: ["v", e.version]
73
70
  }),
74
- /* @__PURE__ */ D(u, {
71
+ /* @__PURE__ */ O(d, {
75
72
  variant: F(e.status),
76
73
  children: e.status
77
74
  }),
78
- t && /* @__PURE__ */ O(u, {
75
+ t && /* @__PURE__ */ k(d, {
79
76
  variant: "outline",
80
77
  className: "flex items-center gap-1",
81
- children: [/* @__PURE__ */ D(k, { size: 12 }), B("botlit.agentDetail.versions.liveNow", "Live now")]
78
+ children: [/* @__PURE__ */ O(A, { size: 12 }), z("botlit.agentDetail.versions.liveNow", "Live now")]
82
79
  })
83
80
  ]
84
81
  }),
85
- /* @__PURE__ */ D("p", {
82
+ /* @__PURE__ */ O("p", {
86
83
  className: "text-sm text-text-secondary break-words",
87
- children: e.changelog || B("botlit.agentDetail.versions.noChangelog", "No description")
84
+ children: e.changelog || z("botlit.agentDetail.versions.noChangelog", "No description")
88
85
  }),
89
- /* @__PURE__ */ D("p", {
86
+ /* @__PURE__ */ O("p", {
90
87
  className: "text-xs text-text-secondary",
91
- children: e.status === "DRAFT" ? `${B("botlit.agentDetail.versions.updated", "Updated")} ${r(e.createdAt)}` : `${B("botlit.agentDetail.versions.published", "Published")} ${r(e.publishedAt ?? e.createdAt)}`
88
+ children: e.status === "DRAFT" ? `${z("botlit.agentDetail.versions.updated", "Updated")} ${i(e.createdAt)}` : `${z("botlit.agentDetail.versions.published", "Published")} ${i(e.publishedAt ?? e.createdAt)}`
92
89
  })
93
90
  ]
94
- }), n && /* @__PURE__ */ D(l, {
91
+ }), n && /* @__PURE__ */ O(u, {
95
92
  variant: "outline",
96
93
  size: "sm",
97
- leftIcon: /* @__PURE__ */ D(M, { size: 14 }),
98
- onClick: () => $(e),
99
- children: B("botlit.agentDetail.versions.rollback", "Roll back")
94
+ leftIcon: /* @__PURE__ */ O(N, { size: 14 }),
95
+ onClick: () => Q(e),
96
+ children: z("botlit.agentDetail.versions.rollback", "Roll back")
100
97
  })]
101
98
  }, e.id);
102
99
  })
103
100
  }) })] }),
104
- /* @__PURE__ */ D(b, {
105
- open: J,
106
- onOpenChange: Y,
107
- children: /* @__PURE__ */ O(x, { children: [
108
- /* @__PURE__ */ O(w, { children: [/* @__PURE__ */ D(T, { children: B("botlit.agentDetail.versions.publishDialog.title", "Publish this version") }), /* @__PURE__ */ D(S, { children: B("botlit.agentDetail.versions.publishDialog.description", "This makes the draft's prompt, model, tools, and policy settings live for the agent. Describe what changed.") })] }),
109
- /* @__PURE__ */ D(E, {
110
- value: X,
111
- onChange: (e) => Z(e.target.value),
112
- placeholder: B("botlit.agentDetail.versions.publishDialog.placeholder", "e.g. Tightened the system prompt and switched to gpt-4o"),
101
+ /* @__PURE__ */ O(x, {
102
+ open: q,
103
+ onOpenChange: J,
104
+ children: /* @__PURE__ */ k(S, { children: [
105
+ /* @__PURE__ */ k(T, { children: [/* @__PURE__ */ O(E, { children: z("botlit.agentDetail.versions.publishDialog.title", "Publish this version") }), /* @__PURE__ */ O(C, { children: z("botlit.agentDetail.versions.publishDialog.description", "This makes the draft's prompt, model, tools, and policy settings live for the agent. Describe what changed.") })] }),
106
+ /* @__PURE__ */ O(D, {
107
+ value: Y,
108
+ onChange: (e) => X(e.target.value),
109
+ placeholder: z("botlit.agentDetail.versions.publishDialog.placeholder", "e.g. Tightened the system prompt and switched to gpt-4o"),
113
110
  rows: 4
114
111
  }),
115
- /* @__PURE__ */ O(C, { children: [/* @__PURE__ */ D(l, {
112
+ /* @__PURE__ */ k(w, { children: [/* @__PURE__ */ O(u, {
116
113
  variant: "outline",
117
- onClick: () => Y(!1),
118
- children: B("botlit.common.cancel", "Cancel")
119
- }), /* @__PURE__ */ D(l, {
120
- isLoading: G.loading,
121
- onClick: () => void te(),
122
- children: B("botlit.agentDetail.versions.publishDialog.confirm", "Publish")
114
+ onClick: () => J(!1),
115
+ children: z("botlit.common.cancel", "Cancel")
116
+ }), /* @__PURE__ */ O(u, {
117
+ isLoading: W.loading,
118
+ onClick: () => void $(),
119
+ children: z("botlit.agentDetail.versions.publishDialog.confirm", "Publish")
123
120
  })] })
124
121
  ] })
125
122
  }),
126
- /* @__PURE__ */ D(f, {
127
- open: Q !== null,
128
- onOpenChange: (e) => !e && $(null),
129
- children: /* @__PURE__ */ O(h, { children: [/* @__PURE__ */ O(v, { children: [/* @__PURE__ */ D(y, { children: B("botlit.agentDetail.versions.rollbackDialog.title", "Roll back to this version?") }), /* @__PURE__ */ D(g, { children: Q && `${B("botlit.agentDetail.versions.rollbackDialog.descriptionPrefix", "This immediately restores the agent to version")} ${Q.version}${B("botlit.agentDetail.versions.rollbackDialog.descriptionSuffix", ". The current live config is kept in history and can be restored the same way.")}` })] }), /* @__PURE__ */ O(_, { children: [/* @__PURE__ */ D(m, {
130
- onClick: () => $(null),
131
- children: B("botlit.common.cancel", "Cancel")
132
- }), /* @__PURE__ */ D(p, {
133
- disabled: q.loading,
134
- onClick: () => void ne(),
135
- children: B("botlit.agentDetail.versions.rollbackDialog.confirm", "Roll back")
123
+ /* @__PURE__ */ O(p, {
124
+ open: Z !== null,
125
+ onOpenChange: (e) => !e && Q(null),
126
+ children: /* @__PURE__ */ k(g, { children: [/* @__PURE__ */ k(y, { children: [/* @__PURE__ */ O(b, { children: z("botlit.agentDetail.versions.rollbackDialog.title", "Roll back to this version?") }), /* @__PURE__ */ O(_, { children: Z && `${z("botlit.agentDetail.versions.rollbackDialog.descriptionPrefix", "This immediately restores the agent to version")} ${Z.version}${z("botlit.agentDetail.versions.rollbackDialog.descriptionSuffix", ". The current live config is kept in history and can be restored the same way.")}` })] }), /* @__PURE__ */ k(v, { children: [/* @__PURE__ */ O(h, {
127
+ onClick: () => Q(null),
128
+ children: z("botlit.common.cancel", "Cancel")
129
+ }), /* @__PURE__ */ O(m, {
130
+ disabled: K.loading,
131
+ onClick: () => void te(),
132
+ children: z("botlit.agentDetail.versions.rollbackDialog.confirm", "Roll back")
136
133
  })] })] })
137
134
  })
138
135
  ]
@@ -1 +1 @@
1
- {"version":3,"file":"VersionHistoryPanel.js","names":[],"sources":["../../../src/botlit/components/VersionHistoryPanel.tsx"],"sourcesContent":["/**\n * Version History Panel (BOFF-4381)\n * @module botlit/components\n *\n * Real, discoverable UI for agent versioning: shows the full version\n * history (draft/published/historical), lets a workspace admin publish the\n * current draft with a changelog, and roll back to any prior published\n * version with a confirmation step.\n */\n\nimport { useState, type FC } from 'react';\nimport { History, Rocket, RotateCcw, CheckCircle2 } from 'lucide-react';\nimport { toast } from 'sonner';\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n Dialog,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n Textarea,\n} from '@burdenoff/fe-libs/ui';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { Card, CardContent, CardHeader, CardTitle, CardDescription } from './Card';\nimport { Button } from './Button';\nimport { Badge } from './Badge';\nimport {\n useAgentVersions,\n usePublishAgentVersion,\n useRollbackAgentVersion,\n type AgentVersionRecord,\n} from '../hooks/useAgents';\nimport { formatRelativeTime } from '../utils/formatters';\n\ninterface VersionHistoryPanelProps {\n agentId: string;\n /** The agent's current draft version id (if any) — enables the Publish action. */\n draftVersionId?: string | null;\n /** The agent's current live (published) version id — hidden from the rollback list. */\n currentVersionId?: string | null;\n /** Called after a successful publish or rollback so the caller can refetch the agent itself. */\n onChanged?: () => void;\n}\n\nfunction versionStatusVariant(\n status: AgentVersionRecord['status']\n): 'secondary' | 'success' | 'outline' {\n if (status === 'DRAFT') return 'secondary';\n if (status === 'PUBLISHED') return 'success';\n return 'outline';\n}\n\nexport const VersionHistoryPanel: FC<VersionHistoryPanelProps> = ({\n agentId,\n draftVersionId,\n currentVersionId,\n onChanged,\n}) => {\n const { t: translate } = useI18n();\n const t = (key: string, fallback: string): string => {\n const value = translate(key);\n return value === key ? fallback : value;\n };\n\n const { data: versions, loading, refetch } = useAgentVersions(agentId);\n const [publishAgentVersion, publishState] = usePublishAgentVersion();\n const [rollbackAgentVersion, rollbackState] = useRollbackAgentVersion();\n\n const [publishOpen, setPublishOpen] = useState(false);\n const [changelogDraft, setChangelogDraft] = useState('');\n const [rollbackTarget, setRollbackTarget] = useState<AgentVersionRecord | null>(null);\n\n const handlePublish = async (): Promise<void> => {\n if (!draftVersionId) return;\n try {\n const published = await publishAgentVersion({\n agentId,\n versionId: draftVersionId,\n changelog: changelogDraft,\n });\n toast.success(\n `${t('botlit.agentDetail.versions.publishSuccessPrefix', 'Published version')} ${published.version}`\n );\n setPublishOpen(false);\n setChangelogDraft('');\n await refetch();\n onChanged?.();\n } catch (err: unknown) {\n toast.error(\n err instanceof Error\n ? err.message\n : t('botlit.agentDetail.versions.publishError', 'Failed to publish version')\n );\n }\n };\n\n const handleRollback = async (): Promise<void> => {\n if (!rollbackTarget) return;\n try {\n const restored = await rollbackAgentVersion({ agentId, targetVersionId: rollbackTarget.id });\n toast.success(\n `${t('botlit.agentDetail.versions.rollbackSuccessPrefix', 'Rolled back to version')} ${rollbackTarget.version} (${t('botlit.agentDetail.versions.rollbackSuccessSuffix', 'now')} ${restored.version})`\n );\n setRollbackTarget(null);\n await refetch();\n onChanged?.();\n } catch (err: unknown) {\n toast.error(\n err instanceof Error\n ? err.message\n : t('botlit.agentDetail.versions.rollbackError', 'Failed to roll back agent version')\n );\n }\n };\n\n return (\n <div className=\"space-y-6\">\n <Card>\n <CardHeader className=\"flex flex-row items-start justify-between gap-4\">\n <div>\n <CardTitle className=\"flex items-center gap-2\">\n <History size={18} />\n {t('botlit.agentDetail.versions.title', 'Version History')}\n </CardTitle>\n <CardDescription>\n {t(\n 'botlit.agentDetail.versions.description',\n 'Every published configuration change, with a diff-able changelog. Publish the current draft or roll back to any prior version.'\n )}\n </CardDescription>\n </div>\n {draftVersionId && (\n <Button leftIcon={<Rocket size={16} />} onClick={() => setPublishOpen(true)}>\n {t('botlit.agentDetail.versions.publishDraft', 'Publish Draft')}\n </Button>\n )}\n </CardHeader>\n <CardContent>\n {loading ? (\n <div className=\"h-32 bg-bg-sunken motion-safe:animate-vc-shimmer rounded-lg\" />\n ) : versions.length === 0 ? (\n <p className=\"text-text-secondary\">\n {t('botlit.agentDetail.versions.empty', 'No version history yet.')}\n </p>\n ) : (\n <ul className=\"space-y-3\">\n {versions.map((version) => {\n const isCurrent = version.id === currentVersionId;\n const canRollback = version.status !== 'DRAFT' && !isCurrent;\n return (\n <li\n key={version.id}\n className=\"flex items-start justify-between gap-4 p-4 border border-border-subtle rounded-lg\"\n >\n <div className=\"space-y-1 min-w-0\">\n <div className=\"flex items-center gap-2 flex-wrap\">\n <span className=\"font-mono font-medium\">v{version.version}</span>\n <Badge variant={versionStatusVariant(version.status)}>\n {version.status}\n </Badge>\n {isCurrent && (\n <Badge variant=\"outline\" className=\"flex items-center gap-1\">\n <CheckCircle2 size={12} />\n {t('botlit.agentDetail.versions.liveNow', 'Live now')}\n </Badge>\n )}\n </div>\n <p className=\"text-sm text-text-secondary break-words\">\n {version.changelog ||\n t('botlit.agentDetail.versions.noChangelog', 'No description')}\n </p>\n <p className=\"text-xs text-text-secondary\">\n {version.status === 'DRAFT'\n ? `${t('botlit.agentDetail.versions.updated', 'Updated')} ${formatRelativeTime(version.createdAt)}`\n : `${t('botlit.agentDetail.versions.published', 'Published')} ${formatRelativeTime(version.publishedAt ?? version.createdAt)}`}\n </p>\n </div>\n {canRollback && (\n <Button\n variant=\"outline\"\n size=\"sm\"\n leftIcon={<RotateCcw size={14} />}\n onClick={() => setRollbackTarget(version)}\n >\n {t('botlit.agentDetail.versions.rollback', 'Roll back')}\n </Button>\n )}\n </li>\n );\n })}\n </ul>\n )}\n </CardContent>\n </Card>\n\n {/* Publish dialog */}\n <Dialog open={publishOpen} onOpenChange={setPublishOpen}>\n <DialogContent>\n <DialogHeader>\n <DialogTitle>\n {t('botlit.agentDetail.versions.publishDialog.title', 'Publish this version')}\n </DialogTitle>\n <DialogDescription>\n {t(\n 'botlit.agentDetail.versions.publishDialog.description',\n \"This makes the draft's prompt, model, tools, and policy settings live for the agent. Describe what changed.\"\n )}\n </DialogDescription>\n </DialogHeader>\n <Textarea\n value={changelogDraft}\n onChange={(e) => setChangelogDraft(e.target.value)}\n placeholder={t(\n 'botlit.agentDetail.versions.publishDialog.placeholder',\n 'e.g. Tightened the system prompt and switched to gpt-4o'\n )}\n rows={4}\n />\n <DialogFooter>\n <Button variant=\"outline\" onClick={() => setPublishOpen(false)}>\n {t('botlit.common.cancel', 'Cancel')}\n </Button>\n <Button isLoading={publishState.loading} onClick={() => void handlePublish()}>\n {t('botlit.agentDetail.versions.publishDialog.confirm', 'Publish')}\n </Button>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n\n {/* Rollback confirmation */}\n <AlertDialog\n open={rollbackTarget !== null}\n onOpenChange={(open) => !open && setRollbackTarget(null)}\n >\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>\n {t('botlit.agentDetail.versions.rollbackDialog.title', 'Roll back to this version?')}\n </AlertDialogTitle>\n <AlertDialogDescription>\n {rollbackTarget &&\n `${t('botlit.agentDetail.versions.rollbackDialog.descriptionPrefix', 'This immediately restores the agent to version')} ${rollbackTarget.version}${t('botlit.agentDetail.versions.rollbackDialog.descriptionSuffix', '. The current live config is kept in history and can be restored the same way.')}`}\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel onClick={() => setRollbackTarget(null)}>\n {t('botlit.common.cancel', 'Cancel')}\n </AlertDialogCancel>\n <AlertDialogAction\n disabled={rollbackState.loading}\n onClick={() => void handleRollback()}\n >\n {t('botlit.agentDetail.versions.rollbackDialog.confirm', 'Roll back')}\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;AAoDA,SAAS,EACP,GACqC;AAGrC,QAFI,MAAW,UAAgB,cAC3B,MAAW,cAAoB,YAC5B;;AAGT,IAAa,KAAqD,EAChE,YACA,mBACA,sBACA,mBACI;CACJ,IAAM,EAAE,GAAG,MAAc,GAAS,EAC5B,KAAK,GAAa,MAA6B;EACnD,IAAM,IAAQ,EAAU,EAAI;AAC5B,SAAO,MAAU,IAAM,IAAW;IAG9B,EAAE,MAAM,GAAU,YAAS,eAAY,EAAiB,EAAQ,EAChE,CAAC,GAAqB,KAAgB,GAAwB,EAC9D,CAAC,GAAsB,KAAiB,GAAyB,EAEjE,CAAC,GAAa,KAAkB,EAAS,GAAM,EAC/C,CAAC,GAAgB,KAAqB,EAAS,GAAG,EAClD,CAAC,GAAgB,KAAqB,EAAoC,KAAK,EAE/E,KAAg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lit/components/VersionHistoryPanel.tsx"],"sourcesContent":["/**\n * Version History Panel (BOFF-4381)\n * @module botlit/components\n *\n * Real, discoverable UI for agent versioning: shows the full version\n * history (draft/published/historical), lets a workspace admin publish the\n * current draft with a changelog, and roll back to any prior published\n * version with a confirmation step.\n */\n\nimport { useState, type FC } from 'react';\nimport { History, Rocket, RotateCcw, CheckCircle2 } from 'lucide-react';\nimport { toast } from 'sonner';\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n Dialog,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n Textarea,\n} from '@burdenoff/fe-libs/ui';\nimport { useTr } from '../../shared/hooks/useTr';\nimport { Card, CardContent, CardHeader, CardTitle, CardDescription } from './Card';\nimport { Button } from './Button';\nimport { Badge } from './Badge';\nimport {\n useAgentVersions,\n usePublishAgentVersion,\n useRollbackAgentVersion,\n type AgentVersionRecord,\n} from '../hooks/useAgents';\nimport { formatRelativeTime } from '../utils/formatters';\n\ninterface VersionHistoryPanelProps {\n agentId: string;\n /** The agent's current draft version id (if any) — enables the Publish action. */\n draftVersionId?: string | null;\n /** The agent's current live (published) version id — hidden from the rollback list. */\n currentVersionId?: string | null;\n /** Called after a successful publish or rollback so the caller can refetch the agent itself. */\n onChanged?: () => void;\n}\n\nfunction versionStatusVariant(\n status: AgentVersionRecord['status']\n): 'secondary' | 'success' | 'outline' {\n if (status === 'DRAFT') return 'secondary';\n if (status === 'PUBLISHED') return 'success';\n return 'outline';\n}\n\nexport const VersionHistoryPanel: FC<VersionHistoryPanelProps> = ({\n agentId,\n draftVersionId,\n currentVersionId,\n onChanged,\n}) => {\n const t = useTr();\n\n const { data: versions, loading, refetch } = useAgentVersions(agentId);\n const [publishAgentVersion, publishState] = usePublishAgentVersion();\n const [rollbackAgentVersion, rollbackState] = useRollbackAgentVersion();\n\n const [publishOpen, setPublishOpen] = useState(false);\n const [changelogDraft, setChangelogDraft] = useState('');\n const [rollbackTarget, setRollbackTarget] = useState<AgentVersionRecord | null>(null);\n\n const handlePublish = async (): Promise<void> => {\n if (!draftVersionId) return;\n try {\n const published = await publishAgentVersion({\n agentId,\n versionId: draftVersionId,\n changelog: changelogDraft,\n });\n toast.success(\n `${t('botlit.agentDetail.versions.publishSuccessPrefix', 'Published version')} ${published.version}`\n );\n setPublishOpen(false);\n setChangelogDraft('');\n await refetch();\n onChanged?.();\n } catch (err: unknown) {\n toast.error(\n err instanceof Error\n ? err.message\n : t('botlit.agentDetail.versions.publishError', 'Failed to publish version')\n );\n }\n };\n\n const handleRollback = async (): Promise<void> => {\n if (!rollbackTarget) return;\n try {\n const restored = await rollbackAgentVersion({ agentId, targetVersionId: rollbackTarget.id });\n toast.success(\n `${t('botlit.agentDetail.versions.rollbackSuccessPrefix', 'Rolled back to version')} ${rollbackTarget.version} (${t('botlit.agentDetail.versions.rollbackSuccessSuffix', 'now')} ${restored.version})`\n );\n setRollbackTarget(null);\n await refetch();\n onChanged?.();\n } catch (err: unknown) {\n toast.error(\n err instanceof Error\n ? err.message\n : t('botlit.agentDetail.versions.rollbackError', 'Failed to roll back agent version')\n );\n }\n };\n\n return (\n <div className=\"space-y-6\">\n <Card>\n <CardHeader className=\"flex flex-row items-start justify-between gap-4\">\n <div>\n <CardTitle className=\"flex items-center gap-2\">\n <History size={18} />\n {t('botlit.agentDetail.versions.title', 'Version History')}\n </CardTitle>\n <CardDescription>\n {t(\n 'botlit.agentDetail.versions.description',\n 'Every published configuration change, with a diff-able changelog. Publish the current draft or roll back to any prior version.'\n )}\n </CardDescription>\n </div>\n {draftVersionId && (\n <Button leftIcon={<Rocket size={16} />} onClick={() => setPublishOpen(true)}>\n {t('botlit.agentDetail.versions.publishDraft', 'Publish Draft')}\n </Button>\n )}\n </CardHeader>\n <CardContent>\n {loading ? (\n <div className=\"h-32 bg-bg-sunken motion-safe:animate-vc-shimmer rounded-lg\" />\n ) : versions.length === 0 ? (\n <p className=\"text-text-secondary\">\n {t('botlit.agentDetail.versions.empty', 'No version history yet.')}\n </p>\n ) : (\n <ul className=\"space-y-3\">\n {versions.map((version) => {\n const isCurrent = version.id === currentVersionId;\n const canRollback = version.status !== 'DRAFT' && !isCurrent;\n return (\n <li\n key={version.id}\n className=\"flex items-start justify-between gap-4 p-4 border border-border-subtle rounded-lg\"\n >\n <div className=\"space-y-1 min-w-0\">\n <div className=\"flex items-center gap-2 flex-wrap\">\n <span className=\"font-mono font-medium\">v{version.version}</span>\n <Badge variant={versionStatusVariant(version.status)}>\n {version.status}\n </Badge>\n {isCurrent && (\n <Badge variant=\"outline\" className=\"flex items-center gap-1\">\n <CheckCircle2 size={12} />\n {t('botlit.agentDetail.versions.liveNow', 'Live now')}\n </Badge>\n )}\n </div>\n <p className=\"text-sm text-text-secondary break-words\">\n {version.changelog ||\n t('botlit.agentDetail.versions.noChangelog', 'No description')}\n </p>\n <p className=\"text-xs text-text-secondary\">\n {version.status === 'DRAFT'\n ? `${t('botlit.agentDetail.versions.updated', 'Updated')} ${formatRelativeTime(version.createdAt)}`\n : `${t('botlit.agentDetail.versions.published', 'Published')} ${formatRelativeTime(version.publishedAt ?? version.createdAt)}`}\n </p>\n </div>\n {canRollback && (\n <Button\n variant=\"outline\"\n size=\"sm\"\n leftIcon={<RotateCcw size={14} />}\n onClick={() => setRollbackTarget(version)}\n >\n {t('botlit.agentDetail.versions.rollback', 'Roll back')}\n </Button>\n )}\n </li>\n );\n })}\n </ul>\n )}\n </CardContent>\n </Card>\n\n {/* Publish dialog */}\n <Dialog open={publishOpen} onOpenChange={setPublishOpen}>\n <DialogContent>\n <DialogHeader>\n <DialogTitle>\n {t('botlit.agentDetail.versions.publishDialog.title', 'Publish this version')}\n </DialogTitle>\n <DialogDescription>\n {t(\n 'botlit.agentDetail.versions.publishDialog.description',\n \"This makes the draft's prompt, model, tools, and policy settings live for the agent. Describe what changed.\"\n )}\n </DialogDescription>\n </DialogHeader>\n <Textarea\n value={changelogDraft}\n onChange={(e) => setChangelogDraft(e.target.value)}\n placeholder={t(\n 'botlit.agentDetail.versions.publishDialog.placeholder',\n 'e.g. Tightened the system prompt and switched to gpt-4o'\n )}\n rows={4}\n />\n <DialogFooter>\n <Button variant=\"outline\" onClick={() => setPublishOpen(false)}>\n {t('botlit.common.cancel', 'Cancel')}\n </Button>\n <Button isLoading={publishState.loading} onClick={() => void handlePublish()}>\n {t('botlit.agentDetail.versions.publishDialog.confirm', 'Publish')}\n </Button>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n\n {/* Rollback confirmation */}\n <AlertDialog\n open={rollbackTarget !== null}\n onOpenChange={(open) => !open && setRollbackTarget(null)}\n >\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>\n {t('botlit.agentDetail.versions.rollbackDialog.title', 'Roll back to this version?')}\n </AlertDialogTitle>\n <AlertDialogDescription>\n {rollbackTarget &&\n `${t('botlit.agentDetail.versions.rollbackDialog.descriptionPrefix', 'This immediately restores the agent to version')} ${rollbackTarget.version}${t('botlit.agentDetail.versions.rollbackDialog.descriptionSuffix', '. The current live config is kept in history and can be restored the same way.')}`}\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel onClick={() => setRollbackTarget(null)}>\n {t('botlit.common.cancel', 'Cancel')}\n </AlertDialogCancel>\n <AlertDialogAction\n disabled={rollbackState.loading}\n onClick={() => void handleRollback()}\n >\n {t('botlit.agentDetail.versions.rollbackDialog.confirm', 'Roll back')}\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;AAoDA,SAAS,EACP,GACqC;AAGrC,QAFI,MAAW,UAAgB,cAC3B,MAAW,cAAoB,YAC5B;;AAGT,IAAa,KAAqD,EAChE,YACA,mBACA,sBACA,mBACI;CACJ,IAAM,IAAI,GAAO,EAEX,EAAE,MAAM,GAA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AAwB,SAAS;KAClB,CAAA,EACpB,kBAAC,GAAD;KACE,UAAU,EAAc;KACxB,eAAe,KAAK,IAAgB;eAEnC,EAAE,sDAAsD,YAAY;KACnD,CAAA,CACF,EAAA,CAAA,CACD,EAAA,CAAA;IACT,CAAA;GACV"}
@@ -1,63 +1,64 @@
1
- import { joinPath as e } from "../utils/navigation.js";
2
- import { EmphasisPanel as t, IllustratedEmptyState as n, NextSteps as r, PagePurpose as i } from "@burdenoff/fe-libs/ui";
3
- import { jsx as a, jsxs as o } from "react/jsx-runtime";
4
- import { Bot as s, MessagesSquare as c, Sparkles as l } from "lucide-react";
1
+ import { useTr as e } from "../../shared/hooks/useTr.js";
2
+ import { joinPath as t } from "../utils/navigation.js";
3
+ import { EmphasisPanel as n, IllustratedEmptyState as r, NextSteps as i, PagePurpose as a } from "@burdenoff/fe-libs/ui";
4
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
5
+ import { Bot as c, MessagesSquare as l, Sparkles as u } from "lucide-react";
5
6
  //#region src/botlit/components/WorkspaceRequired.tsx
6
- var u = ({ basePath: u, navigate: d }) => {
7
- let f = (t) => {
8
- d?.(e(u, t));
7
+ var d = ({ basePath: d, navigate: f }) => {
8
+ let p = e(), m = (e) => {
9
+ f?.(t(d, e));
9
10
  };
10
- return /* @__PURE__ */ o("div", {
11
+ return /* @__PURE__ */ s("div", {
11
12
  className: "mx-auto flex h-full min-h-[60vh] w-full max-w-2xl flex-col justify-center gap-6 px-4 py-10",
12
13
  children: [
13
- /* @__PURE__ */ a(i, {
14
- icon: /* @__PURE__ */ a(s, {
14
+ /* @__PURE__ */ o(a, {
15
+ icon: /* @__PURE__ */ o(c, {
15
16
  className: "size-4",
16
17
  "aria-hidden": "true"
17
18
  }),
18
- children: "Botlit is where you build and run AI agents — you give an agent a prompt, a model, the knowledge it may read and the tools it may call, then publish it to a channel such as web chat, Slack or an API so your team and customers can talk to it."
19
+ children: p("workspaceRequired.purpose", "BotManor is where you build and run AI agents — you give an agent a prompt, a model, the knowledge it may read and the tools it may call, then publish it to a channel such as web chat, Slack or an API so your team and customers can talk to it.")
19
20
  }),
20
- /* @__PURE__ */ a(t, {
21
+ /* @__PURE__ */ o(n, {
21
22
  className: "p-6",
22
- children: /* @__PURE__ */ a(n, {
23
+ children: /* @__PURE__ */ o(r, {
23
24
  illustration: "onboarding",
24
- title: "Pick a workspace to start building",
25
- description: "Agents, knowledge bases and channels live inside a workspace so they stay scoped to the right team. Select or create an active workspace from the shell to load your Botlit workspace."
25
+ title: p("workspaceRequired.emptyTitle", "Pick a workspace to start building"),
26
+ description: p("workspaceRequired.emptyDescription", "Agents, knowledge bases and channels live inside a workspace so they stay scoped to the right team. Select or create an active workspace from the shell to load your BotManor workspace.")
26
27
  })
27
28
  }),
28
- /* @__PURE__ */ a(r, {
29
+ /* @__PURE__ */ o(i, {
29
30
  storageKey: "botlit-get-started",
30
- title: "Once your workspace is active",
31
+ title: p("workspaceRequired.nextStepsTitle", "Once your workspace is active"),
31
32
  steps: [
32
33
  {
33
34
  id: "open-agents",
34
- label: "Open your agents",
35
- description: "Browse, search and manage every agent in this workspace.",
36
- icon: /* @__PURE__ */ a(s, {
35
+ label: p("workspaceRequired.openAgents", "Open your agents"),
36
+ description: p("workspaceRequired.openAgentsDescription", "Browse, search and manage every agent in this workspace."),
37
+ icon: /* @__PURE__ */ o(c, {
37
38
  className: "size-4",
38
39
  "aria-hidden": "true"
39
40
  }),
40
- onClick: () => f("agents")
41
+ onClick: () => m("agents")
41
42
  },
42
43
  {
43
44
  id: "build-agent",
44
- label: "Build an agent",
45
- description: "Pick a model, write the prompt and wire up the tools it may call.",
46
- icon: /* @__PURE__ */ a(l, {
45
+ label: p("workspaceRequired.buildAgent", "Build an agent"),
46
+ description: p("workspaceRequired.buildAgentDescription", "Pick a model, write the prompt and wire up the tools it may call."),
47
+ icon: /* @__PURE__ */ o(u, {
47
48
  className: "size-4",
48
49
  "aria-hidden": "true"
49
50
  }),
50
- onClick: () => f("agents/new")
51
+ onClick: () => m("agents/new")
51
52
  },
52
53
  {
53
54
  id: "connect-channel",
54
- label: "Connect a channel",
55
- description: "Publish an agent to web chat, Slack or an API so people can reach it.",
56
- icon: /* @__PURE__ */ a(c, {
55
+ label: p("workspaceRequired.connectChannel", "Connect a channel"),
56
+ description: p("workspaceRequired.connectChannelDescription", "Publish an agent to web chat, Slack or an API so people can reach it."),
57
+ icon: /* @__PURE__ */ o(l, {
57
58
  className: "size-4",
58
59
  "aria-hidden": "true"
59
60
  }),
60
- onClick: () => f("channels")
61
+ onClick: () => m("channels")
61
62
  }
62
63
  ]
63
64
  })
@@ -65,6 +66,6 @@ var u = ({ basePath: u, navigate: d }) => {
65
66
  });
66
67
  };
67
68
  //#endregion
68
- export { u as WorkspaceRequired };
69
+ export { d as WorkspaceRequired };
69
70
 
70
71
  //# sourceMappingURL=WorkspaceRequired.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"WorkspaceRequired.js","names":[],"sources":["../../../src/botlit/components/WorkspaceRequired.tsx"],"sourcesContent":["/**\n * Workspace Required Gate\n * @module botlit/components\n */\n\nimport type { FC } from 'react';\nimport { Bot, MessagesSquare, Sparkles } from 'lucide-react';\nimport {\n EmphasisPanel,\n IllustratedEmptyState,\n NextSteps,\n PagePurpose,\n} from '@burdenoff/fe-libs/ui';\nimport { joinPath } from '../utils/navigation';\n\n/**\n * Shown when Botlit is mounted without an active workspace.\n *\n * Every Botlit query is workspace-scoped and every write is rejected without\n * `x-workspace-id`, so the module genuinely cannot run — but a single muted\n * sentence in a tall empty region reads as a broken page. This uses the shared\n * guidance pattern (purpose → illustrated zero state → next steps) so the user\n * is told what Botlit is for and what to do next, and the steps land on real\n * routes the moment a workspace becomes active.\n */\nexport interface WorkspaceRequiredProps {\n /** Absolute path Botlit is mounted at in the host shell, e.g. `/botlit`. */\n basePath: string;\n /** Host shell navigation. Absent in standalone/dev mounts. */\n navigate?: (path: string) => void;\n}\n\nexport const WorkspaceRequired: FC<WorkspaceRequiredProps> = ({ basePath, navigate }) => {\n const go = (relativePath: string) => {\n navigate?.(joinPath(basePath, relativePath));\n };\n\n return (\n <div className=\"mx-auto flex h-full min-h-[60vh] w-full max-w-2xl flex-col justify-center gap-6 px-4 py-10\">\n {/* The 'story': plain-language purpose of this module for a first-time user. */}\n <PagePurpose icon={<Bot className=\"size-4\" aria-hidden=\"true\" />}>\n Botlit is where you build and run AI agents — you give an agent a prompt, a model, the\n knowledge it may read and the tools it may call, then publish it to a channel such as web\n chat, Slack or an API so your team and customers can talk to it.\n </PagePurpose>\n\n {/* The single emphasis zone for this screen: the get-started callout. */}\n <EmphasisPanel className=\"p-6\">\n <IllustratedEmptyState\n illustration=\"onboarding\"\n title=\"Pick a workspace to start building\"\n description=\"Agents, knowledge bases and channels live inside a workspace so they stay scoped to the right team. Select or create an active workspace from the shell to load your Botlit workspace.\"\n />\n </EmphasisPanel>\n\n {/* Dismissable, reopenable next-step guidance wired to real routes. */}\n <NextSteps\n storageKey=\"botlit-get-started\"\n title=\"Once your workspace is active\"\n steps={[\n {\n id: 'open-agents',\n label: 'Open your agents',\n description: 'Browse, search and manage every agent in this workspace.',\n icon: <Bot className=\"size-4\" aria-hidden=\"true\" />,\n onClick: () => go('agents'),\n },\n {\n id: 'build-agent',\n label: 'Build an agent',\n description: 'Pick a model, write the prompt and wire up the tools it may call.',\n icon: <Sparkles className=\"size-4\" aria-hidden=\"true\" />,\n onClick: () => go('agents/new'),\n },\n {\n id: 'connect-channel',\n label: 'Connect a channel',\n description: 'Publish an agent to web chat, Slack or an API so people can reach it.',\n icon: <MessagesSquare className=\"size-4\" aria-hidden=\"true\" />,\n onClick: () => go('channels'),\n },\n ]}\n />\n </div>\n );\n};\n"],"mappings":";;;;;AAgCA,IAAa,KAAiD,EAAE,aAAU,kBAAe;CACvF,IAAM,KAAM,MAAyB;AACnC,MAAW,EAAS,GAAU,EAAa,CAAC;;AAG9C,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf;GAEE,kBAAC,GAAD;IAAa,MAAM,kBAAC,GAAD;KAAK,WAAU;KAAS,eAAY;KAAS,CAAA;cAAE;IAIpD,CAAA;GAGd,kBAAC,GAAD;IAAe,WAAU;cACvB,kBAAC,GAAD;KACE,cAAa;KACb,OAAM;KACN,aAAY;KACZ,CAAA;IACY,CAAA;GAGhB,kBAAC,GAAD;IACE,YAAW;IACX,OAAM;IACN,OAAO;KACL;MACE,IAAI;MACJ,OAAO;MACP,aAAa;MACb,MAAM,kBAAC,GAAD;OAAK,WAAU;OAAS,eAAY;OAAS,CAAA;MACnD,eAAe,EAAG,SAAS;MAC5B;KACD;MACE,IAAI;MACJ,OAAO;MACP,aAAa;MACb,MAAM,kBAAC,GAAD;OAAU,WAAU;OAAS,eAAY;OAAS,CAAA;MACxD,eAAe,EAAG,aAAa;MAChC;KACD;MACE,IAAI;MACJ,OAAO;MACP,aAAa;MACb,MAAM,kBAAC,GAAD;OAAgB,WAAU;OAAS,eAAY;OAAS,CAAA;MAC9D,eAAe,EAAG,WAAW;MAC9B;KACF;IACD,CAAA;GACE"}
1
+ {"version":3,"file":"WorkspaceRequired.js","names":[],"sources":["../../../src/botlit/components/WorkspaceRequired.tsx"],"sourcesContent":["/**\n * Workspace Required Gate\n * @module botlit/components\n */\n\nimport type { FC } from 'react';\nimport { Bot, MessagesSquare, Sparkles } from 'lucide-react';\nimport {\n EmphasisPanel,\n IllustratedEmptyState,\n NextSteps,\n PagePurpose,\n} from '@burdenoff/fe-libs/ui';\nimport { useTr } from '../../shared/hooks/useTr';\nimport { joinPath } from '../utils/navigation';\n\n/**\n * Shown when BotManor is mounted without an active workspace.\n *\n * Every BotManor query is workspace-scoped and every write is rejected without\n * `x-workspace-id`, so the module genuinely cannot run — but a single muted\n * sentence in a tall empty region reads as a broken page. This uses the shared\n * guidance pattern (purpose → illustrated zero state → next steps) so the user\n * is told what BotManor is for and what to do next, and the steps land on real\n * routes the moment a workspace becomes active.\n */\nexport interface WorkspaceRequiredProps {\n /** Absolute path BotManor is mounted at in the host shell, e.g. `/botlit`. */\n basePath: string;\n /** Host shell navigation. Absent in standalone/dev mounts. */\n navigate?: (path: string) => void;\n}\n\nexport const WorkspaceRequired: FC<WorkspaceRequiredProps> = ({ basePath, navigate }) => {\n const t = useTr();\n const go = (relativePath: string) => {\n navigate?.(joinPath(basePath, relativePath));\n };\n\n return (\n <div className=\"mx-auto flex h-full min-h-[60vh] w-full max-w-2xl flex-col justify-center gap-6 px-4 py-10\">\n {/* The 'story': plain-language purpose of this module for a first-time user. */}\n <PagePurpose icon={<Bot className=\"size-4\" aria-hidden=\"true\" />}>\n {t(\n 'workspaceRequired.purpose',\n 'BotManor is where you build and run AI agents — you give an agent a prompt, a model, the knowledge it may read and the tools it may call, then publish it to a channel such as web chat, Slack or an API so your team and customers can talk to it.'\n )}\n </PagePurpose>\n\n {/* The single emphasis zone for this screen: the get-started callout. */}\n <EmphasisPanel className=\"p-6\">\n <IllustratedEmptyState\n illustration=\"onboarding\"\n title={t('workspaceRequired.emptyTitle', 'Pick a workspace to start building')}\n description={t(\n 'workspaceRequired.emptyDescription',\n 'Agents, knowledge bases and channels live inside a workspace so they stay scoped to the right team. Select or create an active workspace from the shell to load your BotManor workspace.'\n )}\n />\n </EmphasisPanel>\n\n {/* Dismissable, reopenable next-step guidance wired to real routes. */}\n <NextSteps\n storageKey=\"botlit-get-started\"\n title={t('workspaceRequired.nextStepsTitle', 'Once your workspace is active')}\n steps={[\n {\n id: 'open-agents',\n label: t('workspaceRequired.openAgents', 'Open your agents'),\n description: t(\n 'workspaceRequired.openAgentsDescription',\n 'Browse, search and manage every agent in this workspace.'\n ),\n icon: <Bot className=\"size-4\" aria-hidden=\"true\" />,\n onClick: () => go('agents'),\n },\n {\n id: 'build-agent',\n label: t('workspaceRequired.buildAgent', 'Build an agent'),\n description: t(\n 'workspaceRequired.buildAgentDescription',\n 'Pick a model, write the prompt and wire up the tools it may call.'\n ),\n icon: <Sparkles className=\"size-4\" aria-hidden=\"true\" />,\n onClick: () => go('agents/new'),\n },\n {\n id: 'connect-channel',\n label: t('workspaceRequired.connectChannel', 'Connect a channel'),\n description: t(\n 'workspaceRequired.connectChannelDescription',\n 'Publish an agent to web chat, Slack or an API so people can reach it.'\n ),\n icon: <MessagesSquare className=\"size-4\" aria-hidden=\"true\" />,\n onClick: () => go('channels'),\n },\n ]}\n />\n </div>\n );\n};\n"],"mappings":";;;;;;AAiCA,IAAa,KAAiD,EAAE,aAAU,kBAAe;CACvF,IAAM,IAAI,GAAO,EACX,KAAM,MAAyB;AACnC,MAAW,EAAS,GAAU,EAAa,CAAC;;AAG9C,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf;GAEE,kBAAC,GAAD;IAAa,MAAM,kBAAC,GAAD;KAAK,WAAU;KAAS,eAAY;KAAS,CAAA;cAC7D,EACC,6BACA,sPACD;IACW,CAAA;GAGd,kBAAC,GAAD;IAAe,WAAU;cACvB,kBAAC,GAAD;KACE,cAAa;KACb,OAAO,EAAE,gCAAgC,qCAAqC;KAC9E,aAAa,EACX,sCACA,2LACD;KACD,CAAA;IACY,CAAA;GAGhB,kBAAC,GAAD;IACE,YAAW;IACX,OAAO,EAAE,oCAAoC,gCAAgC;IAC7E,OAAO;KACL;MACE,IAAI;MACJ,OAAO,EAAE,gCAAgC,mBAAmB;MAC5D,aAAa,EACX,2CACA,2DACD;MACD,MAAM,kBAAC,GAAD;OAAK,WAAU;OAAS,eAAY;OAAS,CAAA;MACnD,eAAe,EAAG,SAAS;MAC5B;KACD;MACE,IAAI;MACJ,OAAO,EAAE,gCAAgC,iBAAiB;MAC1D,aAAa,EACX,2CACA,oEACD;MACD,MAAM,kBAAC,GAAD;OAAU,WAAU;OAAS,eAAY;OAAS,CAAA;MACxD,eAAe,EAAG,aAAa;MAChC;KACD;MACE,IAAI;MACJ,OAAO,EAAE,oCAAoC,oBAAoB;MACjE,aAAa,EACX,+CACA,wEACD;MACD,MAAM,kBAAC,GAAD;OAAgB,WAAU;OAAS,eAAY;OAAS,CAAA;MAC9D,eAAe,EAAG,WAAW;MAC9B;KACF;IACD,CAAA;GACE"}
@@ -1 +1 @@
1
- {"version":3,"file":"workspaceGateway.js","names":[],"sources":["../../../../src/botlit/hooks/internal/workspaceGateway.ts"],"sourcesContent":["/**\n * Workspace gateway hook primitives\n * @module botlit/hooks/internal\n *\n * Every Botlit hook talks to the workspace public gateway through the Apollo\n * client the shell installs (`useGatewayClient('workspace')`) — never through a\n * client of its own. These primitives capture the exact shape used by the\n * reference hooks (`useAgents`, `useBots`): `network-only` reads, an explicit\n * `Error` in state rather than a thrown promise, and a `refetch` the caller can\n * run after a mutation.\n */\n\nimport type { ApolloClient, DocumentNode } from '@apollo/client';\nimport { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';\nimport { useGatewayClient } from '@burdenoff/fe-libs/shared/graphql';\n\nimport { useBotlit } from '../../providers/BotlitProvider';\n\nexport type WorkspaceClient = ApolloClient;\n\n/** Apollo client for the workspace gateway, provided by the host shell. */\nexport function useWorkspaceClient(): WorkspaceClient {\n return useGatewayClient('workspace');\n}\n\n/** Current workspace id from the Botlit context (undefined until the shell resolves it). */\nexport function useWorkspaceId(): string | undefined {\n return useBotlit().workspaceId;\n}\n\nexport interface QueryResult<T> {\n data: T;\n loading: boolean;\n /** Set only when the request FAILED. An empty `data` with no `error` means \"no records yet\". */\n error: Error | undefined;\n refetch: () => Promise<void>;\n}\n\nexport interface MutationState<T> {\n data: T | undefined;\n loading: boolean;\n error: Error | undefined;\n}\n\nfunction toError(cause: unknown, fallbackMessage: string): Error {\n if (cause instanceof Error) return cause;\n return new Error(fallbackMessage);\n}\n\n/** Keeps a mutable ref pointing at the latest value without re-running effects. */\nfunction useLatest<T>(value: T): { readonly current: T } {\n const ref = useRef(value);\n useLayoutEffect(() => {\n ref.current = value;\n }, [value]);\n return ref;\n}\n\nexport interface WorkspaceQueryOptions<TData, TResult> {\n /** Generated GraphQL document (see `src/generated/wspace-operations.ts`). */\n document: DocumentNode;\n /** Must be referentially stable — memoize at the call site. */\n variables: Record<string, unknown> | undefined;\n /** Projects the raw payload onto the record shape the UI consumes. */\n select: (data: TData | undefined) => TResult;\n /** Value held while disabled or before the first successful read. */\n fallback: TResult;\n /** When false the request is skipped (e.g. no workspace id / no entity id yet). */\n enabled: boolean;\n /** Used when the thrown value is not an Error. */\n errorMessage: string;\n}\n\n/**\n * Reads from the workspace gateway and keeps `{ data, loading, error, refetch }`\n * in sync. `error` is reserved for real failures so callers can tell an empty\n * collection apart from a failed request.\n */\nexport function useWorkspaceQuery<TData, TResult>(\n options: WorkspaceQueryOptions<TData, TResult>\n): QueryResult<TResult> {\n const { document, variables, enabled, errorMessage } = options;\n const client = useWorkspaceClient();\n const selectRef = useLatest(options.select);\n const fallbackRef = useLatest(options.fallback);\n\n const [data, setData] = useState<TResult>(options.fallback);\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<Error | undefined>();\n\n const refetch = useCallback(async () => {\n if (!enabled) {\n setData(fallbackRef.current);\n setError(undefined);\n return;\n }\n\n setLoading(true);\n setError(undefined);\n try {\n const result = await client.query<TData>({\n query: document,\n variables,\n fetchPolicy: 'network-only',\n });\n setData(selectRef.current(result.data ?? undefined));\n } catch (queryError) {\n setData(fallbackRef.current);\n setError(toError(queryError, errorMessage));\n } finally {\n setLoading(false);\n }\n // fallbackRef/selectRef are stable refs by construction\n }, [client, document, variables, enabled, errorMessage, fallbackRef, selectRef]);\n\n useEffect(() => {\n void refetch();\n }, [refetch]);\n\n return { data, loading, error, refetch };\n}\n\nexport interface WorkspaceMutationOptions<TData, TInput, TResult> {\n /** Generated GraphQL document (see `src/generated/wspace-operations.ts`). */\n document: DocumentNode;\n /** Maps the caller's input onto GraphQL variables. */\n variables: (input: TInput) => Record<string, unknown>;\n /** Projects the raw payload onto the record shape the UI consumes. */\n select: (data: TData | undefined) => TResult | undefined;\n /** Thrown (and stored) when the payload is missing or the request fails. */\n errorMessage: string;\n}\n\n/**\n * Writes to the workspace gateway. Returns the `[mutate, state]` tuple used by\n * the reference hooks. `mutate` REJECTS on failure so callers cannot mistake a\n * failed write for a successful one.\n */\nexport function useWorkspaceMutation<TData, TInput, TResult>(\n options: WorkspaceMutationOptions<TData, TInput, TResult>\n): readonly [(input: TInput) => Promise<TResult>, MutationState<TResult>] {\n const { document, errorMessage } = options;\n const client = useWorkspaceClient();\n const variablesRef = useLatest(options.variables);\n const selectRef = useLatest(options.select);\n\n const [state, setState] = useState<MutationState<TResult>>({\n data: undefined,\n loading: false,\n error: undefined,\n });\n\n const mutate = useCallback(\n async (input: TInput): Promise<TResult> => {\n setState({ data: undefined, loading: true, error: undefined });\n try {\n const result = await client.mutate<TData>({\n mutation: document,\n variables: variablesRef.current(input),\n });\n const selected = selectRef.current(result.data ?? undefined);\n if (selected === undefined) {\n throw new Error(errorMessage);\n }\n setState({ data: selected, loading: false, error: undefined });\n return selected;\n } catch (mutationError) {\n const failure = toError(mutationError, errorMessage);\n setState({ data: undefined, loading: false, error: failure });\n throw failure;\n }\n },\n [client, document, errorMessage, selectRef, variablesRef]\n );\n\n return [mutate, state] as const;\n}\n"],"mappings":";;;;AAqBA,SAAgB,IAAsC;AACpD,QAAO,EAAiB,YAAY;;AAItC,SAAgB,IAAqC;AACnD,QAAO,GAAW,CAAC;;AAiBrB,SAAS,EAAQ,GAAgB,GAAgC;AAE/D,QADI,aAAiB,QAAc,IACxB,MAAM,EAAgB;;AAInC,SAAS,EAAa,GAAmC;CACvD,IAAM,IAAM,EAAO,EAAM;AAIzB,QAHA,QAAsB;AACpB,IAAI,UAAU;IACb,CAAC,EAAM,CAAC,EACJ;;AAuBT,SAAgB,EACd,GACsB;CACtB,IAAM,EAAE,aAAU,cAAW,YAAS,oBAAiB,GACjD,IAAS,GAAoB,EAC7B,IAAY,EAAU,EAAQ,OAAO,EACrC,IAAc,EAAU,EAAQ,SAAS,EAEzC,CAAC,GAAM,KAAW,EAAkB,EAAQ,SAAS,EACrD,CAAC,GAAS,KAAc,EAAS,GAAM,EACvC,CAAC,GAAO,KAAY,GA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Ae,EAAa;AAEpD,SADA,EAAS;IAAE,MAAM,KAAA;IAAW,SAAS;IAAO,OAAO;IAAS,CAAC,EACvD;;IAGV;EAAC;EAAQ;EAAU;EAAc;EAAW;EAAa,CAC1D,EAEe,EAAM"}
1
+ {"version":3,"file":"workspaceGateway.js","names":[],"sources":["../../../../src/botlit/hooks/internal/workspaceGateway.ts"],"sourcesContent":["/**\n * Workspace gateway hook primitives\n * @module botlit/hooks/internal\n *\n * Every BotManor hook talks to the workspace public gateway through the Apollo\n * client the shell installs (`useGatewayClient('workspace')`) — never through a\n * client of its own. These primitives capture the exact shape used by the\n * reference hooks (`useAgents`, `useBots`): `network-only` reads, an explicit\n * `Error` in state rather than a thrown promise, and a `refetch` the caller can\n * run after a mutation.\n */\n\nimport type { ApolloClient, DocumentNode } from '@apollo/client';\nimport { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';\nimport { useGatewayClient } from '@burdenoff/fe-libs/shared/graphql';\n\nimport { useBotlit } from '../../providers/BotlitProvider';\n\nexport type WorkspaceClient = ApolloClient;\n\n/** Apollo client for the workspace gateway, provided by the host shell. */\nexport function useWorkspaceClient(): WorkspaceClient {\n return useGatewayClient('workspace');\n}\n\n/** Current workspace id from the BotManor context (undefined until the shell resolves it). */\nexport function useWorkspaceId(): string | undefined {\n return useBotlit().workspaceId;\n}\n\nexport interface QueryResult<T> {\n data: T;\n loading: boolean;\n /** Set only when the request FAILED. An empty `data` with no `error` means \"no records yet\". */\n error: Error | undefined;\n refetch: () => Promise<void>;\n}\n\nexport interface MutationState<T> {\n data: T | undefined;\n loading: boolean;\n error: Error | undefined;\n}\n\nfunction toError(cause: unknown, fallbackMessage: string): Error {\n if (cause instanceof Error) return cause;\n return new Error(fallbackMessage);\n}\n\n/** Keeps a mutable ref pointing at the latest value without re-running effects. */\nfunction useLatest<T>(value: T): { readonly current: T } {\n const ref = useRef(value);\n useLayoutEffect(() => {\n ref.current = value;\n }, [value]);\n return ref;\n}\n\nexport interface WorkspaceQueryOptions<TData, TResult> {\n /** Generated GraphQL document (see `src/generated/wspace-operations.ts`). */\n document: DocumentNode;\n /** Must be referentially stable — memoize at the call site. */\n variables: Record<string, unknown> | undefined;\n /** Projects the raw payload onto the record shape the UI consumes. */\n select: (data: TData | undefined) => TResult;\n /** Value held while disabled or before the first successful read. */\n fallback: TResult;\n /** When false the request is skipped (e.g. no workspace id / no entity id yet). */\n enabled: boolean;\n /** Used when the thrown value is not an Error. */\n errorMessage: string;\n}\n\n/**\n * Reads from the workspace gateway and keeps `{ data, loading, error, refetch }`\n * in sync. `error` is reserved for real failures so callers can tell an empty\n * collection apart from a failed request.\n */\nexport function useWorkspaceQuery<TData, TResult>(\n options: WorkspaceQueryOptions<TData, TResult>\n): QueryResult<TResult> {\n const { document, variables, enabled, errorMessage } = options;\n const client = useWorkspaceClient();\n const selectRef = useLatest(options.select);\n const fallbackRef = useLatest(options.fallback);\n\n const [data, setData] = useState<TResult>(options.fallback);\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<Error | undefined>();\n\n const refetch = useCallback(async () => {\n if (!enabled) {\n setData(fallbackRef.current);\n setError(undefined);\n return;\n }\n\n setLoading(true);\n setError(undefined);\n try {\n const result = await client.query<TData>({\n query: document,\n variables,\n fetchPolicy: 'network-only',\n });\n setData(selectRef.current(result.data ?? undefined));\n } catch (queryError) {\n setData(fallbackRef.current);\n setError(toError(queryError, errorMessage));\n } finally {\n setLoading(false);\n }\n // fallbackRef/selectRef are stable refs by construction\n }, [client, document, variables, enabled, errorMessage, fallbackRef, selectRef]);\n\n useEffect(() => {\n void refetch();\n }, [refetch]);\n\n return { data, loading, error, refetch };\n}\n\nexport interface WorkspaceMutationOptions<TData, TInput, TResult> {\n /** Generated GraphQL document (see `src/generated/wspace-operations.ts`). */\n document: DocumentNode;\n /** Maps the caller's input onto GraphQL variables. */\n variables: (input: TInput) => Record<string, unknown>;\n /** Projects the raw payload onto the record shape the UI consumes. */\n select: (data: TData | undefined) => TResult | undefined;\n /** Thrown (and stored) when the payload is missing or the request fails. */\n errorMessage: string;\n}\n\n/**\n * Writes to the workspace gateway. Returns the `[mutate, state]` tuple used by\n * the reference hooks. `mutate` REJECTS on failure so callers cannot mistake a\n * failed write for a successful one.\n */\nexport function useWorkspaceMutation<TData, TInput, TResult>(\n options: WorkspaceMutationOptions<TData, TInput, TResult>\n): readonly [(input: TInput) => Promise<TResult>, MutationState<TResult>] {\n const { document, errorMessage } = options;\n const client = useWorkspaceClient();\n const variablesRef = useLatest(options.variables);\n const selectRef = useLatest(options.select);\n\n const [state, setState] = useState<MutationState<TResult>>({\n data: undefined,\n loading: false,\n error: undefined,\n });\n\n const mutate = useCallback(\n async (input: TInput): Promise<TResult> => {\n setState({ data: undefined, loading: true, error: undefined });\n try {\n const result = await client.mutate<TData>({\n mutation: document,\n variables: variablesRef.current(input),\n });\n const selected = selectRef.current(result.data ?? undefined);\n if (selected === undefined) {\n throw new Error(errorMessage);\n }\n setState({ data: selected, loading: false, error: undefined });\n return selected;\n } catch (mutationError) {\n const failure = toError(mutationError, errorMessage);\n setState({ data: undefined, loading: false, error: failure });\n throw failure;\n }\n },\n [client, document, errorMessage, selectRef, variablesRef]\n );\n\n return [mutate, state] as const;\n}\n"],"mappings":";;;;AAqBA,SAAgB,IAAsC;AACpD,QAAO,EAAiB,YAAY;;AAItC,SAAgB,IAAqC;AACnD,QAAO,GAAW,CAAC;;AAiBrB,SAAS,EAAQ,GAAgB,GAAgC;AAE/D,QADI,aAAiB,QAAc,IACxB,MAAM,EAAgB;;AAInC,SAAS,EAAa,GAAmC;CACvD,IAAM,IAAM,EAAO,EAAM;AAIzB,QAHA,QAAsB;AACpB,IAAI,UAAU;IACb,CAAC,EAAM,CAAC,EACJ;;AAuBT,SAAgB,EACd,GACsB;CACtB,IAAM,EAAE,aAAU,cAAW,YAAS,oBAAiB,GACjD,IAAS,GAAoB,EAC7B,IAAY,EAAU,EAAQ,OAAO,EACrC,IAAc,EAAU,EAAQ,SAAS,EAEzC,CAAC,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E,MAAM;IAAU,SAAS;IAAO,OAAO,KAAA;IAAW,CAAC,EACvD;WACA,GAAe;GACtB,IAAM,IAAU,EAAQ,GAAe,EAAa;AAEpD,SADA,EAAS;IAAE,MAAM,KAAA;IAAW,SAAS;IAAO,OAAO;IAAS,CAAC,EACvD;;IAGV;EAAC;EAAQ;EAAU;EAAc;EAAW;EAAa,CAC1D,EAEe,EAAM"}
@@ -1 +1 @@
1
- {"version":3,"file":"useConversations.js","names":[],"sources":["../../../src/botlit/hooks/useConversations.ts"],"sourcesContent":["import { gql, type ApolloClient } from '@apollo/client';\nimport { useCallback, useState } from 'react';\nimport { useGatewayClient } from '@burdenoff/fe-libs/shared/graphql';\n\nconst CHAT_WITH_AGENT_DOCUMENT = gql`\n mutation ChatWithAgent($input: ChatWithAgentInput!) {\n chatWithAgent(input: $input) {\n executionId\n message\n tokensUsed\n model\n conversationId\n }\n }\n`;\n\ntype WorkspaceClient = ApolloClient;\n\ninterface ChatResponse {\n executionId: string;\n message: string;\n tokensUsed?: number | null;\n model?: string | null;\n conversationId?: string | null;\n}\n\ninterface ChatWithAgentData {\n chatWithAgent: ChatResponse;\n}\n\nfunction getWorkspaceClient(client: unknown): WorkspaceClient {\n return client as WorkspaceClient;\n}\n\nexport const conversationKeys = {\n all: ['conversations'] as const,\n lists: () => [...conversationKeys.all, 'list'] as const,\n list: (filter?: Record<string, unknown>) => [...conversationKeys.lists(), filter] as const,\n details: () => [...conversationKeys.all, 'detail'] as const,\n detail: (id: string) => [...conversationKeys.details(), id] as const,\n};\n\n/**\n * Conversations moved to `microfe-conversations`; the Botlit routes redirect\n * there. These stubs keep the (unrouted) legacy pages compiling without\n * pretending to fetch anything.\n */\nconst NO_CONVERSATIONS: ConversationSummary[] = [];\n\nexport interface ConversationSummary {\n id: string;\n title: string;\n status: string;\n agentId?: string | null;\n messages: unknown[];\n updatedAt: string;\n}\n\nexport function useConversations(_filter?: Record<string, unknown>) {\n return { data: NO_CONVERSATIONS, loading: false, error: undefined };\n}\n\nexport function useConversation(_conversationId: string | undefined) {\n return { data: null, loading: false, error: undefined };\n}\n\nexport function useSendMessage() {\n const client = getWorkspaceClient(useGatewayClient('workspace'));\n const [isSending, setIsSending] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n\n const sendMessage = useCallback(\n async (input: { conversationId?: string; agentId: string; content: string }) => {\n setIsSending(true);\n setError(null);\n try {\n const result = await client.mutate<ChatWithAgentData>({\n mutation: CHAT_WITH_AGENT_DOCUMENT,\n variables: {\n input: {\n conversationId: input.conversationId ?? null,\n agentId: input.agentId,\n message: input.content,\n },\n },\n });\n\n const response = result.data?.chatWithAgent;\n if (!response) {\n throw new Error('Failed to send message');\n }\n\n return response;\n } catch (mutationError) {\n const nextError =\n mutationError instanceof Error ? mutationError : new Error('Failed to send message');\n setError(nextError);\n throw nextError;\n } finally {\n setIsSending(false);\n }\n },\n [client]\n );\n\n return {\n sendMessage,\n isSending,\n error,\n };\n}\n"],"mappings":";;;;AAIA,IAAM,IAA2B,CAAG;;;;;;;;;;;AA0BpC,SAAS,EAAmB,GAAkC;AAC5D,QAAO;;AAgBT,IAAM,IAA0C,EAAE;AAWlD,SAAgB,EAAiB,GAAmC;AAClE,QAAO;EAAE,MAAM;EAAkB,SAAS;EAAO,OAAO,KAAA;EAAW;;AAGrE,SAAgB,EAAgB,GAAqC;AACnE,QAAO;EAAE,MAAM;EAAM,SAAS;EAAO,OAAO,KAAA;EAAW;;AAGzD,SAAgB,IAAiB;CAC/B,IAAM,IAAS,EAAmB,EAAiB,YAAY,CAAC,EAC1D,CAAC,GAAW,KAAgB,EAAS,GAAM,EAC3C,CAAC,GAAO,KAAY,EAAuB,KAAK;AAoCtD,QAAO;EACL,aAnCkB,EAClB,OAAO,MAAyE;AAE9E,GADA,EAAa,GAAK,EAClB,EAAS,KAAK;AACd,OAAI;IAYF,IAAM,KAXS,MAAM,EAAO,OAA0B;KACpD,UAAU;KACV,WAAW,EACT,OAAO;MACL,gBAAgB,EAAM,kBAAkB;MACxC,SAAS,EAAM;MACf,SAAS,EAAM;MAChB,EACF;KACF,CAAC,EAEsB,MAAM;AAC9B,QAAI,CAAC,EACH,OAAU,MAAM,yBAAyB;AAG3C,WAAO;YACA,GAAe;IACtB,IAAM,IACJ,aAAyB,QAAQ,IAAgB,gBAAI,MAAM,yBAAyB;AAEtF,UADA,EAAS,EAAU,EACb;aACE;AACR,MAAa,GAAM;;KAGvB,CAAC,EAAO,CACT;EAIC;EACA;EACD"}
1
+ {"version":3,"file":"useConversations.js","names":[],"sources":["../../../src/botlit/hooks/useConversations.ts"],"sourcesContent":["import { gql, type ApolloClient } from '@apollo/client';\nimport { useCallback, useState } from 'react';\nimport { useGatewayClient } from '@burdenoff/fe-libs/shared/graphql';\n\nconst CHAT_WITH_AGENT_DOCUMENT = gql`\n mutation ChatWithAgent($input: ChatWithAgentInput!) {\n chatWithAgent(input: $input) {\n executionId\n message\n tokensUsed\n model\n conversationId\n }\n }\n`;\n\ntype WorkspaceClient = ApolloClient;\n\ninterface ChatResponse {\n executionId: string;\n message: string;\n tokensUsed?: number | null;\n model?: string | null;\n conversationId?: string | null;\n}\n\ninterface ChatWithAgentData {\n chatWithAgent: ChatResponse;\n}\n\nfunction getWorkspaceClient(client: unknown): WorkspaceClient {\n return client as WorkspaceClient;\n}\n\nexport const conversationKeys = {\n all: ['conversations'] as const,\n lists: () => [...conversationKeys.all, 'list'] as const,\n list: (filter?: Record<string, unknown>) => [...conversationKeys.lists(), filter] as const,\n details: () => [...conversationKeys.all, 'detail'] as const,\n detail: (id: string) => [...conversationKeys.details(), id] as const,\n};\n\n/**\n * Conversations moved to `microfe-conversations`; the BotManor routes redirect\n * there. These stubs keep the (unrouted) legacy pages compiling without\n * pretending to fetch anything.\n */\nconst NO_CONVERSATIONS: ConversationSummary[] = [];\n\nexport interface ConversationSummary {\n id: string;\n title: string;\n status: string;\n agentId?: string | null;\n messages: unknown[];\n updatedAt: string;\n}\n\nexport function useConversations(_filter?: Record<string, unknown>) {\n return { data: NO_CONVERSATIONS, loading: false, error: undefined };\n}\n\nexport function useConversation(_conversationId: string | undefined) {\n return { data: null, loading: false, error: undefined };\n}\n\nexport function useSendMessage() {\n const client = getWorkspaceClient(useGatewayClient('workspace'));\n const [isSending, setIsSending] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n\n const sendMessage = useCallback(\n async (input: { conversationId?: string; agentId: string; content: string }) => {\n setIsSending(true);\n setError(null);\n try {\n const result = await client.mutate<ChatWithAgentData>({\n mutation: CHAT_WITH_AGENT_DOCUMENT,\n variables: {\n input: {\n conversationId: input.conversationId ?? null,\n agentId: input.agentId,\n message: input.content,\n },\n },\n });\n\n const response = result.data?.chatWithAgent;\n if (!response) {\n throw new Error('Failed to send message');\n }\n\n return response;\n } catch (mutationError) {\n const nextError =\n mutationError instanceof Error ? mutationError : new Error('Failed to send message');\n setError(nextError);\n throw nextError;\n } finally {\n setIsSending(false);\n }\n },\n [client]\n );\n\n return {\n sendMessage,\n isSending,\n error,\n };\n}\n"],"mappings":";;;;AAIA,IAAM,IAA2B,CAAG;;;;;;;;;;;AA0BpC,SAAS,EAAmB,GAAkC;AAC5D,QAAO;;AAgBT,IAAM,IAA0C,EAAE;AAWlD,SAAgB,EAAiB,GAAmC;AAClE,QAAO;EAAE,MAAM;EAAkB,SAAS;EAAO,OAAO,KAAA;EAAW;;AAGrE,SAAgB,EAAgB,GAAqC;AACnE,QAAO;EAAE,MAAM;EAAM,SAAS;EAAO,OAAO,KAAA;EAAW;;AAGzD,SAAgB,IAAiB;CAC/B,IAAM,IAAS,EAAmB,EAAiB,YAAY,CAAC,EAC1D,CAAC,GAAW,KAAgB,EAAS,GAAM,EAC3C,CAAC,GAAO,KAAY,EAAuB,KAAK;AAoCtD,QAAO;EACL,aAnCkB,EAClB,OAAO,MAAyE;AAE9E,GADA,EAAa,GAAK,EAClB,EAAS,KAAK;AACd,OAAI;IAYF,IAAM,KAXS,MAAM,EAAO,OAA0B;KACpD,UAAU;KACV,WAAW,EACT,OAAO;MACL,gBAAgB,EAAM,kBAAkB;MACxC,SAAS,EAAM;MACf,SAAS,EAAM;MAChB,EACF;KACF,CAAC,EAEsB,MAAM;AAC9B,QAAI,CAAC,EACH,OAAU,MAAM,yBAAyB;AAG3C,WAAO;YACA,GAAe;IACtB,IAAM,IACJ,aAAyB,QAAQ,IAAgB,gBAAI,MAAM,yBAAyB;AAEtF,UADA,EAAS,EAAU,EACb;aACE;AACR,MAAa,GAAM;;KAGvB,CAAC,EAAO,CACT;EAIC;EACA;EACD"}
@@ -1 +1 @@
1
- {"version":3,"file":"useLLMProviders.js","names":[],"sources":["../../../src/botlit/hooks/useLLMProviders.ts"],"sourcesContent":["/**\n * LLM Providers Hooks\n * @module botlit/hooks\n *\n * These go through the shell's workspace gateway client like every other Botlit\n * hook. They deliberately do NOT use the generated `useQuery`/`useMutation`\n * wrappers: `BotmanorRoot` only mounts an `<ApolloProvider>` in standalone mode,\n * so an Apollo React hook throws \"Could not find client in the context\" the\n * moment the MFE is mounted by an app shell — which is every production route.\n */\n\nimport { useCallback, useMemo } from 'react';\nimport {\n CreateBotlitLlmProviderDocument,\n DeleteLlmProviderDocument,\n GetLlmProviderDocument,\n ListLlmModelsDocument,\n ListLlmProvidersDocument,\n TestLlmConnectionDocument,\n UpdateLlmProviderDocument,\n type CreateBotlitLlmProviderMutation,\n type DeleteLlmProviderMutation,\n type GetLlmProviderQuery,\n type ListLlmModelsQuery,\n type ListLlmProvidersQuery,\n type TestLlmConnectionMutation,\n type UpdateLlmProviderMutation,\n} from '../../generated/wspace-operations';\nimport type {\n CreateBotlitLlmModelInput,\n CreateBotlitLlmProviderInput,\n UpdateBotlitLlmProviderInput,\n} from '../../generated/wspace-types';\nimport { buildMutationInput, fieldsOf, type GraphQLInput } from './internal/mutationInput';\nimport {\n useWorkspaceId,\n useWorkspaceMutation,\n useWorkspaceQuery,\n type QueryResult,\n} from './internal/workspaceGateway';\n\nconst LIST_LIMIT = 50;\n\nexport interface LLMProviderRecord {\n id: string;\n name: string;\n type: string;\n isActive: boolean;\n apiEndpoint?: string | null;\n credentialsHash?: string | null;\n connectionId?: string | null;\n metadata?: Record<string, unknown> | null;\n createdAt: string;\n updatedAt: string;\n workspaceId: string;\n}\n\nexport interface LLMModelRecord {\n id: string;\n name: string;\n modelId: string;\n providerId: string;\n contextWindow: number;\n maxOutputTokens: number;\n inputPricePerMToken: number;\n outputPricePerMToken: number;\n isActive: boolean;\n supportsStreaming: boolean;\n supportsFunctionCalling: boolean;\n supportsVision: boolean;\n createdAt: string;\n updatedAt: string;\n}\n\n/** `CreateBotlitLLMProviderInput` minus the `workspaceId` the hook supplies. */\nexport type ConfigureLLMProviderVariables = Omit<\n GraphQLInput<CreateBotlitLlmProviderInput>,\n 'workspaceId'\n>;\n\nconst NO_PROVIDERS: LLMProviderRecord[] = [];\nconst NO_MODELS: LLMModelRecord[] = [];\n\nconst CREATE_PROVIDER_FIELDS = fieldsOf<CreateBotlitLlmProviderInput>({\n apiEndpoint: true,\n connectionId: true,\n credentials: true,\n metadata: true,\n name: true,\n type: true,\n workspaceId: true,\n});\n\nconst UPDATE_PROVIDER_FIELDS = fieldsOf<UpdateBotlitLlmProviderInput>({\n apiEndpoint: true,\n connectionId: true,\n credentials: true,\n isActive: true,\n metadata: true,\n name: true,\n});\n\nexport const llmProviderKeys = {\n all: ['llmProviders'] as const,\n lists: () => [...llmProviderKeys.all, 'list'] as const,\n details: () => [...llmProviderKeys.all, 'detail'] as const,\n detail: (id: string) => [...llmProviderKeys.details(), id] as const,\n};\n\nexport function useLLMProviders(): QueryResult<LLMProviderRecord[]> {\n const workspaceId = useWorkspaceId();\n\n const variables = useMemo(() => ({ pagination: { limit: LIST_LIMIT, offset: 0 } }), []);\n\n return useWorkspaceQuery<ListLlmProvidersQuery, LLMProviderRecord[]>({\n document: ListLlmProvidersDocument,\n variables,\n select: (data) => data?.listLLMProviders ?? NO_PROVIDERS,\n fallback: NO_PROVIDERS,\n enabled: Boolean(workspaceId),\n errorMessage: 'Failed to load LLM providers',\n });\n}\n\nexport function useLLMProvider(\n providerId: string | undefined\n): QueryResult<LLMProviderRecord | null> {\n const variables = useMemo(() => ({ id: providerId ?? '' }), [providerId]);\n\n return useWorkspaceQuery<GetLlmProviderQuery, LLMProviderRecord | null>({\n document: GetLlmProviderDocument,\n variables,\n select: (data) => data?.getLLMProvider ?? null,\n fallback: null,\n enabled: Boolean(providerId),\n errorMessage: 'Failed to load LLM provider',\n });\n}\n\nexport function useLLMModels(filters?: { providerId?: string }): QueryResult<LLMModelRecord[]> {\n const workspaceId = useWorkspaceId();\n const providerId = filters?.providerId;\n\n const variables = useMemo(\n () => ({\n filters: providerId ? { providerId } : undefined,\n pagination: { limit: LIST_LIMIT, offset: 0 },\n }),\n [providerId]\n );\n\n return useWorkspaceQuery<ListLlmModelsQuery, LLMModelRecord[]>({\n document: ListLlmModelsDocument,\n variables,\n select: (data) => data?.listLLMModels ?? NO_MODELS,\n fallback: NO_MODELS,\n enabled: Boolean(workspaceId),\n errorMessage: 'Failed to load LLM models',\n });\n}\n\n/**\n * Creates a provider, or updates the one whose id the caller passes.\n * `UpdateBotlitLLMProviderInput` has no `type`/`workspaceId`, so the update\n * payload is projected onto the fields that input actually declares.\n */\nexport function useConfigureLLMProvider() {\n const workspaceId = useWorkspaceId();\n\n const [create, createState] = useWorkspaceMutation<\n CreateBotlitLlmProviderMutation,\n ConfigureLLMProviderVariables,\n LLMProviderRecord\n >({\n document: CreateBotlitLlmProviderDocument,\n variables: (input) => ({\n input: buildMutationInput({ ...input, workspaceId }, CREATE_PROVIDER_FIELDS),\n }),\n select: (data) => data?.createBotlitLLMProvider,\n errorMessage: 'Failed to create the LLM provider',\n });\n\n const [update, updateState] = useWorkspaceMutation<\n UpdateLlmProviderMutation,\n { providerId: string; input: ConfigureLLMProviderVariables },\n LLMProviderRecord\n >({\n document: UpdateLlmProviderDocument,\n variables: ({ providerId, input }) => ({\n id: providerId,\n input: buildMutationInput(input, UPDATE_PROVIDER_FIELDS),\n }),\n select: (data) => data?.updateLLMProvider,\n errorMessage: 'Failed to update the LLM provider',\n });\n\n const configureProvider = useCallback(\n async (input: ConfigureLLMProviderVariables, existingId?: string) =>\n existingId ? update({ providerId: existingId, input }) : create(input),\n [create, update]\n );\n\n return {\n configureProvider,\n isConfiguring: createState.loading || updateState.loading,\n error: createState.error ?? updateState.error,\n };\n}\n\nexport function useDeleteLLMProvider() {\n return useWorkspaceMutation<DeleteLlmProviderMutation, string, boolean>({\n document: DeleteLlmProviderDocument,\n variables: (providerId) => ({ id: providerId }),\n select: (data) => data?.deleteLLMProvider,\n errorMessage: 'Failed to delete the LLM provider',\n });\n}\n\nexport function useTestLLMConnection() {\n return useWorkspaceMutation<TestLlmConnectionMutation, string, boolean>({\n document: TestLlmConnectionDocument,\n variables: (providerId) => ({ id: providerId }),\n select: (data) => data?.testLlmConnection,\n errorMessage: 'Failed to test the LLM connection',\n });\n}\n\n/**\n * `createBotlitLLMModel` is not published on the supergraph — models are\n * catalogued by the service, so the UI cannot add custom ones yet.\n */\nexport function useCreateLLMModel() {\n const createModel = useCallback(async (_input: CreateBotlitLlmModelInput): Promise<never> => {\n throw new Error(\"Custom model creation isn't available yet.\");\n }, []);\n\n return { createModel, isCreating: false, error: undefined };\n}\n"],"mappings":";;;;;AAyCA,IAAM,IAAa,IAuCb,IAAoC,EAAE,EACtC,IAA8B,EAAE,EAEhC,IAAyB,EAAuC;CACpE,aAAa;CACb,cAAc;CACd,aAAa;CACb,UAAU;CACV,MAAM;CACN,MAAM;CACN,aAAa;CACd,CAAC,EAEI,IAAyB,EAAuC;CACpE,aAAa;CACb,cAAc;CACd,aAAa;CACb,UAAU;CACV,UAAU;CACV,MAAM;CACP,CAAC;AASF,SAAgB,IAAoD;CAClE,IAAM,IAAc,GAAgB;AAIpC,QAAO,EAA8D;EACnE,UAAU;EACV,WAJgB,SAAe,EAAE,YAAY;GAAE,OAAO;GAAY,QAAQ;GAAG,EAAE,GAAG,EAAE,CAAC;EAKrF,SAAS,MAAS,GAAM,oBAAoB;EAC5C,UAAU;EACV,SAAS,EAAQ;EACjB,cAAc;EACf,CAAC;;AAkBJ,SAAgB,EAAa,GAAkE;CAC7F,IAAM,IAAc,GAAgB,EAC9B,IAAa,GAAS;AAU5B,QAAO,EAAwD;EAC7D,UAAU;EACV,WAVgB,SACT;GACL,SAAS,IAAa,EAAE,eAAY,GAAG,KAAA;GACvC,YAAY;IAAE,OAAO;IAAY,QAAQ;IAAG;GAC7C,GACD,CAAC,EAAW,CACb;EAKC,SAAS,MAAS,GAAM,iBAAiB;EACzC,UAAU;EACV,SAAS,EAAQ;EACjB,cAAc;EACf,CAAC;;AAQJ,SAAgB,IAA0B;CACxC,IAAM,IAAc,GAAgB,EAE9B,CAAC,GAAQ,KAAe,EAI5B;EACA,UAAU;EACV,YAAY,OAAW,EACrB,OAAO,EAAmB;GAAE,GAAG;GAAO;GAAa,EAAE,EAAuB,EAC7E;EACD,SAAS,MAAS,GAAM;EACxB,cAAc;EACf,CAAC,EAEI,CAAC,GAAQ,KAAe,EAI5B;EACA,UAAU;EACV,YAAY,EAAE,eAAY,gBAAa;GACrC,IAAI;GACJ,OAAO,EAAmB,GAAO,EAAuB;GACzD;EACD,SAAS,MAAS,GAAM;EACxB,cAAc;EACf,CAAC;AAQF,QAAO;EACL,mBAPwB,EACxB,OAAO,GAAsC,MAC3C,IAAa,EAAO;GAAE,YAAY;GAAY;GAAO,CAAC,GAAG,EAAO,EAAM,EACxE,CAAC,GAAQ,EAAO,CACjB;EAIC,eAAe,EAAY,WAAW,EAAY;EAClD,OAAO,EAAY,SAAS,EAAY;EACzC"}
1
+ {"version":3,"file":"useLLMProviders.js","names":[],"sources":["../../../src/botlit/hooks/useLLMProviders.ts"],"sourcesContent":["/**\n * LLM Providers Hooks\n * @module botlit/hooks\n *\n * These go through the shell's workspace gateway client like every other BotManor\n * hook. They deliberately do NOT use the generated `useQuery`/`useMutation`\n * wrappers: `BotmanorRoot` only mounts an `<ApolloProvider>` in standalone mode,\n * so an Apollo React hook throws \"Could not find client in the context\" the\n * moment the MFE is mounted by an app shell — which is every production route.\n */\n\nimport { useCallback, useMemo } from 'react';\nimport {\n CreateBotlitLlmProviderDocument,\n DeleteLlmProviderDocument,\n GetLlmProviderDocument,\n ListLlmModelsDocument,\n ListLlmProvidersDocument,\n TestLlmConnectionDocument,\n UpdateLlmProviderDocument,\n type CreateBotlitLlmProviderMutation,\n type DeleteLlmProviderMutation,\n type GetLlmProviderQuery,\n type ListLlmModelsQuery,\n type ListLlmProvidersQuery,\n type TestLlmConnectionMutation,\n type UpdateLlmProviderMutation,\n} from '../../generated/wspace-operations';\nimport type {\n CreateBotlitLlmModelInput,\n CreateBotlitLlmProviderInput,\n UpdateBotlitLlmProviderInput,\n} from '../../generated/wspace-types';\nimport { buildMutationInput, fieldsOf, type GraphQLInput } from './internal/mutationInput';\nimport {\n useWorkspaceId,\n useWorkspaceMutation,\n useWorkspaceQuery,\n type QueryResult,\n} from './internal/workspaceGateway';\n\nconst LIST_LIMIT = 50;\n\nexport interface LLMProviderRecord {\n id: string;\n name: string;\n type: string;\n isActive: boolean;\n apiEndpoint?: string | null;\n credentialsHash?: string | null;\n connectionId?: string | null;\n metadata?: Record<string, unknown> | null;\n createdAt: string;\n updatedAt: string;\n workspaceId: string;\n}\n\nexport interface LLMModelRecord {\n id: string;\n name: string;\n modelId: string;\n providerId: string;\n contextWindow: number;\n maxOutputTokens: number;\n inputPricePerMToken: number;\n outputPricePerMToken: number;\n isActive: boolean;\n supportsStreaming: boolean;\n supportsFunctionCalling: boolean;\n supportsVision: boolean;\n createdAt: string;\n updatedAt: string;\n}\n\n/** `CreateBotlitLLMProviderInput` minus the `workspaceId` the hook supplies. */\nexport type ConfigureLLMProviderVariables = Omit<\n GraphQLInput<CreateBotlitLlmProviderInput>,\n 'workspaceId'\n>;\n\nconst NO_PROVIDERS: LLMProviderRecord[] = [];\nconst NO_MODELS: LLMModelRecord[] = [];\n\nconst CREATE_PROVIDER_FIELDS = fieldsOf<CreateBotlitLlmProviderInput>({\n apiEndpoint: true,\n connectionId: true,\n credentials: true,\n metadata: true,\n name: true,\n type: true,\n workspaceId: true,\n});\n\nconst UPDATE_PROVIDER_FIELDS = fieldsOf<UpdateBotlitLlmProviderInput>({\n apiEndpoint: true,\n connectionId: true,\n credentials: true,\n isActive: true,\n metadata: true,\n name: true,\n});\n\nexport const llmProviderKeys = {\n all: ['llmProviders'] as const,\n lists: () => [...llmProviderKeys.all, 'list'] as const,\n details: () => [...llmProviderKeys.all, 'detail'] as const,\n detail: (id: string) => [...llmProviderKeys.details(), id] as const,\n};\n\nexport function useLLMProviders(): QueryResult<LLMProviderRecord[]> {\n const workspaceId = useWorkspaceId();\n\n const variables = useMemo(() => ({ pagination: { limit: LIST_LIMIT, offset: 0 } }), []);\n\n return useWorkspaceQuery<ListLlmProvidersQuery, LLMProviderRecord[]>({\n document: ListLlmProvidersDocument,\n variables,\n select: (data) => data?.listLLMProviders ?? NO_PROVIDERS,\n fallback: NO_PROVIDERS,\n enabled: Boolean(workspaceId),\n errorMessage: 'Failed to load LLM providers',\n });\n}\n\nexport function useLLMProvider(\n providerId: string | undefined\n): QueryResult<LLMProviderRecord | null> {\n const variables = useMemo(() => ({ id: providerId ?? '' }), [providerId]);\n\n return useWorkspaceQuery<GetLlmProviderQuery, LLMProviderRecord | null>({\n document: GetLlmProviderDocument,\n variables,\n select: (data) => data?.getLLMProvider ?? null,\n fallback: null,\n enabled: Boolean(providerId),\n errorMessage: 'Failed to load LLM provider',\n });\n}\n\nexport function useLLMModels(filters?: { providerId?: string }): QueryResult<LLMModelRecord[]> {\n const workspaceId = useWorkspaceId();\n const providerId = filters?.providerId;\n\n const variables = useMemo(\n () => ({\n filters: providerId ? { providerId } : undefined,\n pagination: { limit: LIST_LIMIT, offset: 0 },\n }),\n [providerId]\n );\n\n return useWorkspaceQuery<ListLlmModelsQuery, LLMModelRecord[]>({\n document: ListLlmModelsDocument,\n variables,\n select: (data) => data?.listLLMModels ?? NO_MODELS,\n fallback: NO_MODELS,\n enabled: Boolean(workspaceId),\n errorMessage: 'Failed to load LLM models',\n });\n}\n\n/**\n * Creates a provider, or updates the one whose id the caller passes.\n * `UpdateBotlitLLMProviderInput` has no `type`/`workspaceId`, so the update\n * payload is projected onto the fields that input actually declares.\n */\nexport function useConfigureLLMProvider() {\n const workspaceId = useWorkspaceId();\n\n const [create, createState] = useWorkspaceMutation<\n CreateBotlitLlmProviderMutation,\n ConfigureLLMProviderVariables,\n LLMProviderRecord\n >({\n document: CreateBotlitLlmProviderDocument,\n variables: (input) => ({\n input: buildMutationInput({ ...input, workspaceId }, CREATE_PROVIDER_FIELDS),\n }),\n select: (data) => data?.createBotlitLLMProvider,\n errorMessage: 'Failed to create the LLM provider',\n });\n\n const [update, updateState] = useWorkspaceMutation<\n UpdateLlmProviderMutation,\n { providerId: string; input: ConfigureLLMProviderVariables },\n LLMProviderRecord\n >({\n document: UpdateLlmProviderDocument,\n variables: ({ providerId, input }) => ({\n id: providerId,\n input: buildMutationInput(input, UPDATE_PROVIDER_FIELDS),\n }),\n select: (data) => data?.updateLLMProvider,\n errorMessage: 'Failed to update the LLM provider',\n });\n\n const configureProvider = useCallback(\n async (input: ConfigureLLMProviderVariables, existingId?: string) =>\n existingId ? update({ providerId: existingId, input }) : create(input),\n [create, update]\n );\n\n return {\n configureProvider,\n isConfiguring: createState.loading || updateState.loading,\n error: createState.error ?? updateState.error,\n };\n}\n\nexport function useDeleteLLMProvider() {\n return useWorkspaceMutation<DeleteLlmProviderMutation, string, boolean>({\n document: DeleteLlmProviderDocument,\n variables: (providerId) => ({ id: providerId }),\n select: (data) => data?.deleteLLMProvider,\n errorMessage: 'Failed to delete the LLM provider',\n });\n}\n\nexport function useTestLLMConnection() {\n return useWorkspaceMutation<TestLlmConnectionMutation, string, boolean>({\n document: TestLlmConnectionDocument,\n variables: (providerId) => ({ id: providerId }),\n select: (data) => data?.testLlmConnection,\n errorMessage: 'Failed to test the LLM connection',\n });\n}\n\n/**\n * `createBotlitLLMModel` is not published on the supergraph — models are\n * catalogued by the service, so the UI cannot add custom ones yet.\n */\nexport function useCreateLLMModel() {\n const createModel = useCallback(async (_input: CreateBotlitLlmModelInput): Promise<never> => {\n throw new Error(\"Custom model creation isn't available yet.\");\n }, []);\n\n return { createModel, isCreating: false, error: undefined };\n}\n"],"mappings":";;;;;AAyCA,IAAM,IAAa,IAuCb,IAAoC,EAAE,EACtC,IAA8B,EAAE,EAEhC,IAAyB,EAAuC;CACpE,aAAa;CACb,cAAc;CACd,aAAa;CACb,UAAU;CACV,MAAM;CACN,MAAM;CACN,aAAa;CACd,CAAC,EAEI,IAAyB,EAAuC;CACpE,aAAa;CACb,cAAc;CACd,aAAa;CACb,UAAU;CACV,UAAU;CACV,MAAM;CACP,CAAC;AASF,SAAgB,IAAoD;CAClE,IAAM,IAAc,GAAgB;AAIpC,QAAO,EAA8D;EACnE,UAAU;EACV,WAJgB,SAAe,EAAE,YAAY;GAAE,OAAO;GAAY,QAAQ;GAAG,EAAE,GAAG,EAAE,CAAC;EAKrF,SAAS,MAAS,GAAM,oBAAoB;EAC5C,UAAU;EACV,SAAS,EAAQ;EACjB,cAAc;EACf,CAAC;;AAkBJ,SAAgB,EAAa,GAAkE;CAC7F,IAAM,IAAc,GAAgB,EAC9B,IAAa,GAAS;AAU5B,QAAO,EAAwD;EAC7D,UAAU;EACV,WAVgB,SACT;GACL,SAAS,IAAa,EAAE,eAAY,GAAG,KAAA;GACvC,YAAY;IAAE,OAAO;IAAY,QAAQ;IAAG;GAC7C,GACD,CAAC,EAAW,CACb;EAKC,SAAS,MAAS,GAAM,iBAAiB;EACzC,UAAU;EACV,SAAS,EAAQ;EACjB,cAAc;EACf,CAAC;;AAQJ,SAAgB,IAA0B;CACxC,IAAM,IAAc,GAAgB,EAE9B,CAAC,GAAQ,KAAe,EAI5B;EACA,UAAU;EACV,YAAY,OAAW,EACrB,OAAO,EAAmB;GAAE,GAAG;GAAO;GAAa,EAAE,EAAuB,EAC7E;EACD,SAAS,MAAS,GAAM;EACxB,cAAc;EACf,CAAC,EAEI,CAAC,GAAQ,KAAe,EAI5B;EACA,UAAU;EACV,YAAY,EAAE,eAAY,gBAAa;GACrC,IAAI;GACJ,OAAO,EAAmB,GAAO,EAAuB;GACzD;EACD,SAAS,MAAS,GAAM;EACxB,cAAc;EACf,CAAC;AAQF,QAAO;EACL,mBAPwB,EACxB,OAAO,GAAsC,MAC3C,IAAa,EAAO;GAAE,YAAY;GAAY;GAAO,CAAC,GAAG,EAAO,EAAM,EACxE,CAAC,GAAQ,EAAO,CACjB;EAIC,eAAe,EAAY,WAAW,EAAY;EAClD,OAAO,EAAY,SAAS,EAAY;EACzC"}
@@ -218,7 +218,7 @@ var B = ({ isNew: F = !1 }) => {
218
218
  children: [
219
219
  /* @__PURE__ */ D(T, {
220
220
  icon: /* @__PURE__ */ D(A, { size: 18 }),
221
- children: "This is one external agent registered in your A2A network. Inspect its public agent card — the skills it advertises, its provider and trust level — and decide how your own agents may delegate work to it. Keeping this entry accurate is what lets Botlit safely hand off tasks to agents outside your workspace."
221
+ children: "This is one external agent registered in your A2A network. Inspect its public agent card — the skills it advertises, its provider and trust level — and decide how your own agents may delegate work to it. Keeping this entry accurate is what lets BotManor safely hand off tasks to agents outside your workspace."
222
222
  }),
223
223
  K && /* @__PURE__ */ O(r, { children: [/* @__PURE__ */ D(o, { children: /* @__PURE__ */ D(s, { children: "Basic Information" }) }), /* @__PURE__ */ O(i, {
224
224
  className: "space-y-4",