@burdenoff/microfe-botmanor 2026.1124.1 → 2026.1127.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/dist/botlit/BotmanorRootInner.js +45 -44
  2. package/dist/botlit/BotmanorRootInner.js.map +1 -1
  3. package/dist/botlit/components/AgentA2APanel.js +63 -62
  4. package/dist/botlit/components/AgentA2APanel.js.map +1 -1
  5. package/dist/botlit/components/AgentBindingsPanel.js +125 -124
  6. package/dist/botlit/components/AgentBindingsPanel.js.map +1 -1
  7. package/dist/botlit/components/AgentFallbackModelsPicker.js +56 -55
  8. package/dist/botlit/components/AgentFallbackModelsPicker.js.map +1 -1
  9. package/dist/botlit/components/AiOperationsPanel.js.map +1 -1
  10. package/dist/botlit/components/AssistantChannelPanel.js +40 -39
  11. package/dist/botlit/components/AssistantChannelPanel.js.map +1 -1
  12. package/dist/botlit/components/AssistantRuntimeSetupPanel.js +36 -35
  13. package/dist/botlit/components/AssistantRuntimeSetupPanel.js.map +1 -1
  14. package/dist/botlit/components/BotAgentsPanel.js +104 -103
  15. package/dist/botlit/components/BotAgentsPanel.js.map +1 -1
  16. package/dist/botlit/components/BotFormFields.js +118 -117
  17. package/dist/botlit/components/BotFormFields.js.map +1 -1
  18. package/dist/botlit/components/BucketDialogs.js +110 -110
  19. package/dist/botlit/components/BucketDialogs.js.map +1 -1
  20. package/dist/botlit/components/ChannelRoutesPanel.js +29 -28
  21. package/dist/botlit/components/ChannelRoutesPanel.js.map +1 -1
  22. package/dist/botlit/components/CreateChannelRouteDialog.js +105 -105
  23. package/dist/botlit/components/CreateChannelRouteDialog.js.map +1 -1
  24. package/dist/botlit/components/DescribeBotDialog.js +86 -86
  25. package/dist/botlit/components/DescribeBotDialog.js.map +1 -1
  26. package/dist/botlit/components/EmptyState.d.ts +8 -0
  27. package/dist/botlit/components/EmptyState.js +43 -30
  28. package/dist/botlit/components/EmptyState.js.map +1 -1
  29. package/dist/botlit/components/HandoffConfigPanel.js +125 -124
  30. package/dist/botlit/components/HandoffConfigPanel.js.map +1 -1
  31. package/dist/botlit/components/HandoffTargetPickers.js +42 -41
  32. package/dist/botlit/components/HandoffTargetPickers.js.map +1 -1
  33. package/dist/botlit/components/KnowledgeBackendMigrationPanel.js +106 -105
  34. package/dist/botlit/components/KnowledgeBackendMigrationPanel.js.map +1 -1
  35. package/dist/botlit/components/KnowledgeRetrievalTestPanel.js +76 -75
  36. package/dist/botlit/components/KnowledgeRetrievalTestPanel.js.map +1 -1
  37. package/dist/botlit/components/KnowledgeSourceImportPanel.js +76 -75
  38. package/dist/botlit/components/KnowledgeSourceImportPanel.js.map +1 -1
  39. package/dist/botlit/components/ModelRegistrationPanel.js +70 -69
  40. package/dist/botlit/components/ModelRegistrationPanel.js.map +1 -1
  41. package/dist/botlit/components/StorePackageDraftCard.js +87 -86
  42. package/dist/botlit/components/StorePackageDraftCard.js.map +1 -1
  43. package/dist/botlit/components/SuggestionsPanel.js.map +1 -1
  44. package/dist/botlit/hooks/internal/workspaceGateway.d.ts +12 -0
  45. package/dist/botlit/hooks/internal/workspaceGateway.js +1 -1
  46. package/dist/botlit/hooks/internal/workspaceGateway.js.map +1 -1
  47. package/dist/botlit/hooks/useA2A.js +2 -1
  48. package/dist/botlit/hooks/useA2A.js.map +1 -1
  49. package/dist/botlit/hooks/useA2AConnections.js +30 -38
  50. package/dist/botlit/hooks/useA2AConnections.js.map +1 -1
  51. package/dist/botlit/hooks/useKnowledgeBases.js +91 -48
  52. package/dist/botlit/hooks/useKnowledgeBases.js.map +1 -1
  53. package/dist/botlit/pages/A2AAgentDetailPage.js +263 -262
  54. package/dist/botlit/pages/A2AAgentDetailPage.js.map +1 -1
  55. package/dist/botlit/pages/A2ARegistryPage.js +47 -46
  56. package/dist/botlit/pages/A2ARegistryPage.js.map +1 -1
  57. package/dist/botlit/pages/AgentBuilderPage.js +426 -425
  58. package/dist/botlit/pages/AgentBuilderPage.js.map +1 -1
  59. package/dist/botlit/pages/AgentDetailPage.js +1 -0
  60. package/dist/botlit/pages/AgentDetailPage.js.map +1 -1
  61. package/dist/botlit/pages/AgentsListPage.js +248 -247
  62. package/dist/botlit/pages/AgentsListPage.js.map +1 -1
  63. package/dist/botlit/pages/BotChannelsTab.js +324 -310
  64. package/dist/botlit/pages/BotChannelsTab.js.map +1 -1
  65. package/dist/botlit/pages/BotDetailPage.js +1 -0
  66. package/dist/botlit/pages/BotDetailPage.js.map +1 -1
  67. package/dist/botlit/pages/BotWorkflowTab.js +126 -121
  68. package/dist/botlit/pages/BotWorkflowTab.js.map +1 -1
  69. package/dist/botlit/pages/BotsListPage.js +1 -0
  70. package/dist/botlit/pages/BotsListPage.js.map +1 -1
  71. package/dist/botlit/pages/BucketDetailPage.js +1 -0
  72. package/dist/botlit/pages/BucketDetailPage.js.map +1 -1
  73. package/dist/botlit/pages/BucketsPage.js +1 -0
  74. package/dist/botlit/pages/BucketsPage.js.map +1 -1
  75. package/dist/botlit/pages/ChannelDetailPage.js +267 -266
  76. package/dist/botlit/pages/ChannelDetailPage.js.map +1 -1
  77. package/dist/botlit/pages/ChannelsPage.js +187 -186
  78. package/dist/botlit/pages/ChannelsPage.js.map +1 -1
  79. package/dist/botlit/pages/ChatPage.js +69 -68
  80. package/dist/botlit/pages/ChatPage.js.map +1 -1
  81. package/dist/botlit/pages/ExecutionDetailPage.js +1 -0
  82. package/dist/botlit/pages/ExecutionDetailPage.js.map +1 -1
  83. package/dist/botlit/pages/ExecutionsPage.js +191 -191
  84. package/dist/botlit/pages/ExecutionsPage.js.map +1 -1
  85. package/dist/botlit/pages/HandoffsPage.js +65 -64
  86. package/dist/botlit/pages/HandoffsPage.js.map +1 -1
  87. package/dist/botlit/pages/InstalledPackagesPage.js +146 -145
  88. package/dist/botlit/pages/InstalledPackagesPage.js.map +1 -1
  89. package/dist/botlit/pages/KnowledgeBaseDetailPage.js +235 -234
  90. package/dist/botlit/pages/KnowledgeBaseDetailPage.js.map +1 -1
  91. package/dist/botlit/pages/KnowledgeBasesPage.js +152 -151
  92. package/dist/botlit/pages/KnowledgeBasesPage.js.map +1 -1
  93. package/dist/botlit/pages/MCPServerDetailPage.js +180 -179
  94. package/dist/botlit/pages/MCPServerDetailPage.js.map +1 -1
  95. package/dist/botlit/pages/MCPServersPage.js +145 -145
  96. package/dist/botlit/pages/MCPServersPage.js.map +1 -1
  97. package/dist/botlit/pages/PoliciesPage.js.map +1 -1
  98. package/dist/botlit/pages/PolicyDetailPage.js +293 -292
  99. package/dist/botlit/pages/PolicyDetailPage.js.map +1 -1
  100. package/dist/botlit/pages/PromptStudioPage.js +229 -229
  101. package/dist/botlit/pages/PromptStudioPage.js.map +1 -1
  102. package/dist/botlit/pages/PromptTemplateDetailPage.js +280 -279
  103. package/dist/botlit/pages/PromptTemplateDetailPage.js.map +1 -1
  104. package/dist/botlit/pages/PromptTemplatesPage.js +31 -30
  105. package/dist/botlit/pages/PromptTemplatesPage.js.map +1 -1
  106. package/dist/botlit/pages/RetrievalProfileDetailPage.js +204 -203
  107. package/dist/botlit/pages/RetrievalProfileDetailPage.js.map +1 -1
  108. package/dist/botlit/pages/RetrievalProfilesPage.js.map +1 -1
  109. package/dist/botlit/pages/SettingsPage.js +153 -153
  110. package/dist/botlit/pages/SettingsPage.js.map +1 -1
  111. package/dist/botlit/pages/SkillDetailPage.js +305 -304
  112. package/dist/botlit/pages/SkillDetailPage.js.map +1 -1
  113. package/dist/botlit/pages/SkillsPage.js.map +1 -1
  114. package/dist/botlit/pages/StorePackageDetailPage.js +1 -0
  115. package/dist/botlit/pages/StorePackageDetailPage.js.map +1 -1
  116. package/dist/botlit/pages/StorePage.js +173 -173
  117. package/dist/botlit/pages/StorePage.js.map +1 -1
  118. package/dist/botlit/utils/confirmAction.d.ts +13 -11
  119. package/dist/botlit/utils/confirmAction.js +26 -4
  120. package/dist/botlit/utils/confirmAction.js.map +1 -1
  121. package/dist/generated/wspace-operations.d.ts +106 -42
  122. package/dist/generated/wspace-operations.js +198 -172
  123. package/dist/generated/wspace-operations.js.map +1 -1
  124. package/dist/generated/wspace-types.d.ts +9859 -49
  125. package/dist/generated/wspace-types.js.map +1 -1
  126. package/package.json +3 -3
@@ -3,86 +3,87 @@ import { useBotlit as t } from "../providers/BotlitProvider.js";
3
3
  import { graphqlErrorMessage as n } from "../utils/errors.js";
4
4
  import { Button as r } from "./Button.js";
5
5
  import { useState as i } from "react";
6
- import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
6
+ import { ThemedSelect as a } from "@burdenoff/fe-libs/ui";
7
+ import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
7
8
  // src/botlit/components/AssistantRuntimeSetupPanel.tsx
8
- function c({ agentId: e, onConfigured: n }) {
9
+ function l({ agentId: e, onConfigured: n }) {
9
10
  let { workspaceId: r, currentUser: i } = t();
10
- return /* @__PURE__ */ o(l, {
11
+ return /* @__PURE__ */ s(u, {
11
12
  agentId: e,
12
13
  onConfigured: n
13
14
  }, `${r}:${i?.id}:${e}`);
14
15
  }
15
- function l({ agentId: t, onConfigured: c }) {
16
- let { connections: l, configure: u } = e(t), [d, f] = i(""), [p, m] = i(""), [h, g] = i(!1);
17
- return /* @__PURE__ */ s("section", {
16
+ function u({ agentId: t, onConfigured: l }) {
17
+ let { connections: u, configure: d } = e(t), [f, p] = i(""), [m, h] = i(""), [g, _] = i(!1);
18
+ return /* @__PURE__ */ c("section", {
18
19
  className: "space-y-4 rounded-lg border border-border-default p-5",
19
20
  children: [
20
- /* @__PURE__ */ s("div", { children: [/* @__PURE__ */ o("h2", {
21
+ /* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("h2", {
21
22
  className: "text-lg font-semibold",
22
23
  children: "Assistant setup"
23
- }), /* @__PURE__ */ o("p", {
24
+ }), /* @__PURE__ */ s("p", {
24
25
  className: "text-sm text-text-secondary",
25
26
  children: "Connect this assistant to Fluidgrids for answers and recovery. Course teachers also receive content ingestion workflows."
26
27
  })] }),
27
- l.isPending ? /* @__PURE__ */ o("p", {
28
+ u.isPending ? /* @__PURE__ */ s("p", {
28
29
  role: "status",
29
30
  children: "Loading connections…"
30
- }) : l.isError ? /* @__PURE__ */ s("div", {
31
+ }) : u.isError ? /* @__PURE__ */ c("div", {
31
32
  role: "alert",
32
- children: [/* @__PURE__ */ o("p", { children: "Connections could not be loaded. Check your access and try again." }), /* @__PURE__ */ o(r, {
33
+ children: [/* @__PURE__ */ s("p", { children: "Connections could not be loaded. Check your access and try again." }), /* @__PURE__ */ s(r, {
33
34
  variant: "outline",
34
- onClick: () => void l.refetch(),
35
+ onClick: () => void u.refetch(),
35
36
  children: "Reload connections"
36
37
  })]
37
- }) : l.data?.length ? /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ s("label", {
38
+ }) : u.data?.length ? /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ c("label", {
38
39
  className: "grid gap-2 text-sm font-medium",
39
- children: ["Workflow connection", /* @__PURE__ */ s("select", {
40
+ children: ["Workflow connection", /* @__PURE__ */ c(a, {
40
41
  className: "h-10 rounded-md border border-border-default bg-bg-surface px-3",
41
- value: d,
42
- disabled: u.isPending,
42
+ value: f,
43
+ disabled: d.isPending,
43
44
  onChange: (e) => {
44
- f(e.target.value), m("");
45
+ p(e.target.value), h("");
45
46
  },
46
- children: [/* @__PURE__ */ o("option", {
47
+ children: [/* @__PURE__ */ s("option", {
47
48
  value: "",
48
49
  children: "Choose a connection"
49
- }), l.data.map((e) => /* @__PURE__ */ o("option", {
50
+ }), u.data.map((e) => /* @__PURE__ */ s("option", {
50
51
  value: e.id,
51
52
  children: e.name
52
53
  }, e.id))]
53
54
  })]
54
- }), /* @__PURE__ */ o(r, {
55
- disabled: !d,
56
- isLoading: u.isPending,
55
+ }), /* @__PURE__ */ s(r, {
56
+ disabled: !f,
57
+ isLoading: d.isPending,
57
58
  onClick: async () => {
58
- m(""), g(!1);
59
+ h(""), _(!1);
59
60
  try {
60
- let e = await u.mutateAsync(d);
61
- m(e.ready ? "Assistant configured and ready." : "Workflows configured. Activate the assistant and finish indexing its knowledge before using it."), c();
61
+ let e = await d.mutateAsync(f);
62
+ h(e.ready ? "Assistant configured and ready." : "Workflows configured. Activate the assistant and finish indexing its knowledge before using it."), l();
62
63
  } catch (e) {
63
- g(!0), m(n(e, "Setup could not be completed. Check the model, knowledge scope and your permissions, then try again."));
64
+ _(!0), h(n(e, "Setup could not be completed. Check the model, knowledge scope and your permissions, then try again."));
64
65
  }
65
66
  },
66
67
  children: "Configure assistant"
67
- })] }) : /* @__PURE__ */ s("div", {
68
+ })] }) : /* @__PURE__ */ c("div", {
68
69
  className: "space-y-2 text-sm",
69
70
  children: [
70
- /* @__PURE__ */ o("p", { children: "This workspace has no BotManor Assistant Runtime connection yet. The runtime lets FluidGrids answer questions and process knowledge imports for this assistant." }),
71
- /* @__PURE__ */ o("p", { children: "In Integrations, connect “BotManor Assistant Runtime”, then select “Reload connections”." }),
72
- /* @__PURE__ */ o(r, {
71
+ /* @__PURE__ */ s("p", { children: "This workspace has no BotManor Assistant Runtime connection yet. The runtime lets FluidGrids answer questions and process knowledge imports for this assistant." }),
72
+ /* @__PURE__ */ s("p", { children: "In Integrations, connect “BotManor Assistant Runtime”, then select “Reload connections”." }),
73
+ /* @__PURE__ */ s(r, {
73
74
  variant: "outline",
74
- onClick: () => void l.refetch(),
75
+ onClick: () => void u.refetch(),
75
76
  children: "Reload connections"
76
77
  })
77
78
  ]
78
79
  }),
79
- p && /* @__PURE__ */ o("p", {
80
- role: h ? "alert" : "status",
81
- children: p
80
+ m && /* @__PURE__ */ s("p", {
81
+ role: g ? "alert" : "status",
82
+ children: m
82
83
  })
83
84
  ]
84
85
  });
85
86
  }
86
- export { c as AssistantRuntimeSetupPanel };
87
+ export { l as AssistantRuntimeSetupPanel };
87
88
 
88
89
  //# sourceMappingURL=AssistantRuntimeSetupPanel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AssistantRuntimeSetupPanel.js","names":["_Fragment","Fragment$1","AssistantRuntimeSetupPanel","useBotlit","ScopedSetupPanel","workspaceId","currentUser","agentId","useAssistantRuntimeSetup","selected","setSelected","useState","message","setMessage","failed","setFailed","connections","Button","configure","event","connection","result","onConfigured","error","graphqlErrorMessage"],"sources":["../../../src/botlit/components/AssistantRuntimeSetupPanel.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { useAssistantRuntimeSetup } from '../hooks/useAssistantRuntimeSetup';\nimport { useBotlit } from '../providers/BotlitProvider';\nimport { graphqlErrorMessage } from '../utils/errors';\nimport { Button } from './Button';\n\nexport function AssistantRuntimeSetupPanel({\n agentId,\n onConfigured,\n}: {\n agentId: string;\n onConfigured: () => void;\n}) {\n const { workspaceId, currentUser } = useBotlit();\n return (\n <ScopedSetupPanel\n key={`${workspaceId}:${currentUser?.id}:${agentId}`}\n agentId={agentId}\n onConfigured={onConfigured}\n />\n );\n}\n\nfunction ScopedSetupPanel({\n agentId,\n onConfigured,\n}: {\n agentId: string;\n onConfigured: () => void;\n}) {\n const { connections, configure } = useAssistantRuntimeSetup(agentId);\n const [selected, setSelected] = useState('');\n const [message, setMessage] = useState('');\n const [failed, setFailed] = useState(false);\n return (\n <section className=\"space-y-4 rounded-lg border border-border-default p-5\">\n <div>\n <h2 className=\"text-lg font-semibold\">Assistant setup</h2>\n <p className=\"text-sm text-text-secondary\">\n Connect this assistant to Fluidgrids for answers and recovery. Course teachers also\n receive content ingestion workflows.\n </p>\n </div>\n {connections.isPending ? (\n <p role=\"status\">Loading connections…</p>\n ) : connections.isError ? (\n <div role=\"alert\">\n <p>Connections could not be loaded. Check your access and try again.</p>\n <Button variant=\"outline\" onClick={() => void connections.refetch()}>\n Reload connections\n </Button>\n </div>\n ) : !connections.data?.length ? (\n <div className=\"space-y-2 text-sm\">\n <p>\n This workspace has no BotManor Assistant Runtime connection yet. The runtime lets\n FluidGrids answer questions and process knowledge imports for this assistant.\n </p>\n <p>\n In Integrations, connect “BotManor Assistant Runtime”, then select “Reload connections”.\n </p>\n <Button variant=\"outline\" onClick={() => void connections.refetch()}>\n Reload connections\n </Button>\n </div>\n ) : (\n <>\n <label className=\"grid gap-2 text-sm font-medium\">\n Workflow connection\n <select\n className=\"h-10 rounded-md border border-border-default bg-bg-surface px-3\"\n value={selected}\n disabled={configure.isPending}\n onChange={(event) => {\n setSelected(event.target.value);\n setMessage('');\n }}\n >\n <option value=\"\">Choose a connection</option>\n {connections.data.map((connection) => (\n <option key={connection.id} value={connection.id}>\n {connection.name}\n </option>\n ))}\n </select>\n </label>\n <Button\n disabled={!selected}\n isLoading={configure.isPending}\n onClick={async () => {\n setMessage('');\n setFailed(false);\n try {\n const result = await configure.mutateAsync(selected);\n setMessage(\n result.ready\n ? 'Assistant configured and ready.'\n : 'Workflows configured. Activate the assistant and finish indexing its knowledge before using it.'\n );\n onConfigured();\n } catch (error) {\n setFailed(true);\n // The service names what is missing (model, provider key, connection or FluidGrids step).\n setMessage(\n graphqlErrorMessage(\n error,\n 'Setup could not be completed. Check the model, knowledge scope and your permissions, then try again.'\n )\n );\n }\n }}\n >\n Configure assistant\n </Button>\n </>\n )}\n {message && <p role={failed ? 'alert' : 'status'}>{message}</p>}\n </section>\n );\n}\n"],"mappings":";;;;;;;AAMA,SAAgBE,EAA2B,EACzC,YACA,mBAIC;CACD,IAAM,EAAE,gBAAa,mBAAgBC,EAAU;CAC/C,OACE,kBAACC,GAAD;EAEW;EACK;CACf,GAHM,GAAGC,EAAY,GAAGC,GAAa,GAAG,GAAGC,GAG3C;AAEL;AAEA,SAASH,EAAiB,EACxB,YACA,mBAIC;CACD,IAAM,EAAE,gBAAa,iBAAcI,EAAyBD,CAAO,GAC7D,CAACE,GAAUC,KAAeC,EAAS,EAAE,GACrC,CAACC,GAASC,KAAcF,EAAS,EAAE,GACnC,CAACG,GAAQC,KAAaJ,EAAS,EAAK;CAC1C,OACE,kBAAC,WAAD;EAAS,WAAU;EAAnB,UAAA;GACE,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,MAAD;IAAI,WAAU;IAAwB,UAAA;GAAmB,CAAA,GACzD,kBAAC,KAAD;IAAG,WAAU;IAA8B,UAAA;GAGxC,CAAA,CACA,EAAA,CAAA;GACJK,EAAY,YACX,kBAAC,KAAD;IAAG,MAAK;IAAS,UAAA;GAAuB,CAAA,IACtCA,EAAY,UACd,kBAAC,OAAD;IAAK,MAAK;IAAV,UAAA,CACE,kBAAC,KAAD,EAAA,UAAG,oEAAoE,CAAA,GACvE,kBAACC,GAAD;KAAQ,SAAQ;KAAU,eAAe,KAAKD,EAAY,QAAQ;KAAG,UAAA;IAE7D,CAAA,CACL;GACH,CAAA,IAACA,EAAY,MAAM,SAcrB,kBAAAhB,GAAA,EAAA,UAAA,CACE,kBAAC,SAAD;IAAO,WAAU;IAAjB,UAAA,CAAkD,uBAEhD,kBAAC,UAAD;KACE,WAAU;KACV,OAAOS;KACP,UAAUS,EAAU;KACpB,WAAW,MAAU;MAEnB,AADAR,EAAYS,EAAM,OAAO,KAAK,GAC9BN,EAAW,EAAE;KACf;KAPF,UAAA,CASE,kBAAC,UAAD;MAAQ,OAAM;MAAG,UAAA;KAA2B,CAAA,GAC3CG,EAAY,KAAK,KAAK,MACrB,kBAAC,UAAD;MAA4B,OAAOI,EAAW;MAC3C,UAAAA,EAAW;KACN,GAFKA,EAAW,EAEhB,CACT,CACK;IACH,CAAA,CAAA;GACP,CAAA,GAAA,kBAACH,GAAD;IACE,UAAU,CAACR;IACX,WAAWS,EAAU;IACrB,SAAS,YAAY;KAEnB,AADAL,EAAW,EAAE,GACbE,EAAU,EAAK;KACf,IAAI;MACF,IAAMM,IAAS,MAAMH,EAAU,YAAYT,CAAQ;MAMnD,AALAI,EACEQ,EAAO,QACH,oCACA,iGACN,GACAC,EAAa;KACf,SAASC,GAAO;MAGd,AAFAR,EAAU,EAAI,GAEdF,EACEW,EACED,GACA,sGACF,CACF;KACF;IACF;IACD,UAAA;GAEO,CAAA,CACR,EAAA,CAAA,IA7DF,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA;KACE,kBAAC,KAAD,EAAA,UAAG,kKAGA,CAAA;KACH,kBAAC,KAAD,EAAA,UAAG,2FAEA,CAAA;KACH,kBAACN,GAAD;MAAQ,SAAQ;MAAU,eAAe,KAAKD,EAAY,QAAQ;MAAG,UAAA;KAE7D,CAAA;IACL;GAEL,CAAA;GAkDDJ,KAAW,kBAAC,KAAD;IAAG,MAAME,IAAS,UAAU;IAAW,UAAAF;GAAW,CAAA;EACvD;;AAEb"}
1
+ {"version":3,"file":"AssistantRuntimeSetupPanel.js","names":["_Fragment","Fragment$1","AssistantRuntimeSetupPanel","useBotlit","ScopedSetupPanel","workspaceId","currentUser","agentId","useAssistantRuntimeSetup","selected","setSelected","useState","message","setMessage","failed","setFailed","connections","Button","ThemedSelect","configure","event","connection","result","onConfigured","error","graphqlErrorMessage"],"sources":["../../../src/botlit/components/AssistantRuntimeSetupPanel.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { useAssistantRuntimeSetup } from '../hooks/useAssistantRuntimeSetup';\nimport { useBotlit } from '../providers/BotlitProvider';\nimport { graphqlErrorMessage } from '../utils/errors';\nimport { Button } from './Button';\nimport { ThemedSelect } from '@burdenoff/fe-libs/ui';\n\nexport function AssistantRuntimeSetupPanel({\n agentId,\n onConfigured,\n}: {\n agentId: string;\n onConfigured: () => void;\n}) {\n const { workspaceId, currentUser } = useBotlit();\n return (\n <ScopedSetupPanel\n key={`${workspaceId}:${currentUser?.id}:${agentId}`}\n agentId={agentId}\n onConfigured={onConfigured}\n />\n );\n}\n\nfunction ScopedSetupPanel({\n agentId,\n onConfigured,\n}: {\n agentId: string;\n onConfigured: () => void;\n}) {\n const { connections, configure } = useAssistantRuntimeSetup(agentId);\n const [selected, setSelected] = useState('');\n const [message, setMessage] = useState('');\n const [failed, setFailed] = useState(false);\n return (\n <section className=\"space-y-4 rounded-lg border border-border-default p-5\">\n <div>\n <h2 className=\"text-lg font-semibold\">Assistant setup</h2>\n <p className=\"text-sm text-text-secondary\">\n Connect this assistant to Fluidgrids for answers and recovery. Course teachers also\n receive content ingestion workflows.\n </p>\n </div>\n {connections.isPending ? (\n <p role=\"status\">Loading connections…</p>\n ) : connections.isError ? (\n <div role=\"alert\">\n <p>Connections could not be loaded. Check your access and try again.</p>\n <Button variant=\"outline\" onClick={() => void connections.refetch()}>\n Reload connections\n </Button>\n </div>\n ) : !connections.data?.length ? (\n <div className=\"space-y-2 text-sm\">\n <p>\n This workspace has no BotManor Assistant Runtime connection yet. The runtime lets\n FluidGrids answer questions and process knowledge imports for this assistant.\n </p>\n <p>\n In Integrations, connect “BotManor Assistant Runtime”, then select “Reload connections”.\n </p>\n <Button variant=\"outline\" onClick={() => void connections.refetch()}>\n Reload connections\n </Button>\n </div>\n ) : (\n <>\n <label className=\"grid gap-2 text-sm font-medium\">\n Workflow connection\n <ThemedSelect\n className=\"h-10 rounded-md border border-border-default bg-bg-surface px-3\"\n value={selected}\n disabled={configure.isPending}\n onChange={(event) => {\n setSelected(event.target.value);\n setMessage('');\n }}\n >\n <option value=\"\">Choose a connection</option>\n {connections.data.map((connection) => (\n <option key={connection.id} value={connection.id}>\n {connection.name}\n </option>\n ))}\n </ThemedSelect>\n </label>\n <Button\n disabled={!selected}\n isLoading={configure.isPending}\n onClick={async () => {\n setMessage('');\n setFailed(false);\n try {\n const result = await configure.mutateAsync(selected);\n setMessage(\n result.ready\n ? 'Assistant configured and ready.'\n : 'Workflows configured. Activate the assistant and finish indexing its knowledge before using it.'\n );\n onConfigured();\n } catch (error) {\n setFailed(true);\n // The service names what is missing (model, provider key, connection or FluidGrids step).\n setMessage(\n graphqlErrorMessage(\n error,\n 'Setup could not be completed. Check the model, knowledge scope and your permissions, then try again.'\n )\n );\n }\n }}\n >\n Configure assistant\n </Button>\n </>\n )}\n {message && <p role={failed ? 'alert' : 'status'}>{message}</p>}\n </section>\n );\n}\n"],"mappings":";;;;;;;;AAOA,SAAgBE,EAA2B,EACzC,YACA,mBAIC;CACD,IAAM,EAAE,gBAAa,mBAAgBC,EAAU;CAC/C,OACE,kBAACC,GAAD;EAEW;EACK;CACf,GAHM,GAAGC,EAAY,GAAGC,GAAa,GAAG,GAAGC,GAG3C;AAEL;AAEA,SAASH,EAAiB,EACxB,YACA,mBAIC;CACD,IAAM,EAAE,gBAAa,iBAAcI,EAAyBD,CAAO,GAC7D,CAACE,GAAUC,KAAeC,EAAS,EAAE,GACrC,CAACC,GAASC,KAAcF,EAAS,EAAE,GACnC,CAACG,GAAQC,KAAaJ,EAAS,EAAK;CAC1C,OACE,kBAAC,WAAD;EAAS,WAAU;EAAnB,UAAA;GACE,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,MAAD;IAAI,WAAU;IAAwB,UAAA;GAAmB,CAAA,GACzD,kBAAC,KAAD;IAAG,WAAU;IAA8B,UAAA;GAGxC,CAAA,CACA,EAAA,CAAA;GACJK,EAAY,YACX,kBAAC,KAAD;IAAG,MAAK;IAAS,UAAA;GAAuB,CAAA,IACtCA,EAAY,UACd,kBAAC,OAAD;IAAK,MAAK;IAAV,UAAA,CACE,kBAAC,KAAD,EAAA,UAAG,oEAAoE,CAAA,GACvE,kBAACC,GAAD;KAAQ,SAAQ;KAAU,eAAe,KAAKD,EAAY,QAAQ;KAAG,UAAA;IAE7D,CAAA,CACL;GACH,CAAA,IAACA,EAAY,MAAM,SAcrB,kBAAAhB,GAAA,EAAA,UAAA,CACE,kBAAC,SAAD;IAAO,WAAU;IAAjB,UAAA,CAAkD,uBAEhD,kBAACkB,GAAD;KACE,WAAU;KACV,OAAOT;KACP,UAAUU,EAAU;KACpB,WAAW,MAAU;MAEnB,AADAT,EAAYU,EAAM,OAAO,KAAK,GAC9BP,EAAW,EAAE;KACf;KAPF,UAAA,CASE,kBAAC,UAAD;MAAQ,OAAM;MAAG,UAAA;KAA2B,CAAA,GAC3CG,EAAY,KAAK,KAAK,MACrB,kBAAC,UAAD;MAA4B,OAAOK,EAAW;MAC3C,UAAAA,EAAW;KACN,GAFKA,EAAW,EAEhB,CACT,CACW;IACT,CAAA,CAAA;GACP,CAAA,GAAA,kBAACJ,GAAD;IACE,UAAU,CAACR;IACX,WAAWU,EAAU;IACrB,SAAS,YAAY;KAEnB,AADAN,EAAW,EAAE,GACbE,EAAU,EAAK;KACf,IAAI;MACF,IAAMO,IAAS,MAAMH,EAAU,YAAYV,CAAQ;MAMnD,AALAI,EACES,EAAO,QACH,oCACA,iGACN,GACAC,EAAa;KACf,SAASC,GAAO;MAGd,AAFAT,EAAU,EAAI,GAEdF,EACEY,EACED,GACA,sGACF,CACF;KACF;IACF;IACD,UAAA;GAEO,CAAA,CACR,EAAA,CAAA,IA7DF,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA;KACE,kBAAC,KAAD,EAAA,UAAG,kKAGA,CAAA;KACH,kBAAC,KAAD,EAAA,UAAG,2FAEA,CAAA;KACH,kBAACP,GAAD;MAAQ,SAAQ;MAAU,eAAe,KAAKD,EAAY,QAAQ;MAAG,UAAA;KAE7D,CAAA;IACL;GAEL,CAAA;GAkDDJ,KAAW,kBAAC,KAAD;IAAG,MAAME,IAAS,UAAU;IAAW,UAAAF;GAAW,CAAA;EACvD;;AAEb"}
@@ -9,12 +9,13 @@ import { confirmAction as g } from "../utils/confirmAction.js";
9
9
  import { EMPTY_ROUTING_FORM as _, formatList as v, toRoutingInput as y, validateRoutingForm as b } from "../utils/botRouting.js";
10
10
  import "../permissions/index.js";
11
11
  import { useState as x } from "react";
12
- import { jsx as S, jsxs as C } from "react/jsx-runtime";
13
- import { Bot as w, Pencil as T, Plus as E, Trash2 as D } from "lucide-react";
14
- import { toast as O } from "sonner";
12
+ import { ThemedSelect as S } from "@burdenoff/fe-libs/ui";
13
+ import { jsx as C, jsxs as w } from "react/jsx-runtime";
14
+ import { Bot as T, Pencil as E, Plus as D, Trash2 as O } from "lucide-react";
15
+ import { toast as k } from "sonner";
15
16
  // src/botlit/components/BotAgentsPanel.tsx
16
- var k = "h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]";
17
- function A(e) {
17
+ var A = "h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]";
18
+ function ee(e) {
18
19
  return {
19
20
  agentId: e.agentId,
20
21
  priority: String(e.priority),
@@ -33,36 +34,36 @@ var j = ({ idPrefix: e, initial: t, agents: n, selectableAgents: r, submitLabel:
33
34
  let t = b(l, !!r);
34
35
  m(t), Object.keys(t).length > 0 || await o(l);
35
36
  };
36
- return /* @__PURE__ */ C("form", {
37
+ return /* @__PURE__ */ w("form", {
37
38
  noValidate: !0,
38
39
  onSubmit: (e) => void g(e),
39
40
  className: "grid gap-4 md:grid-cols-2",
40
41
  children: [
41
- r && /* @__PURE__ */ S(u, {
42
+ r && /* @__PURE__ */ C(u, {
42
43
  label: "Agent",
43
44
  htmlFor: `${e}-agent`,
44
45
  required: !0,
45
46
  error: p.agentId,
46
- children: /* @__PURE__ */ C("select", {
47
+ children: /* @__PURE__ */ w(S, {
47
48
  id: `${e}-agent`,
48
- className: k,
49
+ className: A,
49
50
  value: l.agentId,
50
51
  onChange: (e) => h("agentId", e.target.value),
51
- children: [/* @__PURE__ */ S("option", {
52
+ children: [/* @__PURE__ */ C("option", {
52
53
  value: "",
53
54
  children: "Choose an agent"
54
- }), r.map((e) => /* @__PURE__ */ S("option", {
55
+ }), r.map((e) => /* @__PURE__ */ C("option", {
55
56
  value: e.id,
56
57
  children: e.name
57
58
  }, e.id))]
58
59
  })
59
60
  }),
60
- /* @__PURE__ */ S(u, {
61
+ /* @__PURE__ */ C(u, {
61
62
  label: "Priority",
62
63
  htmlFor: `${e}-priority`,
63
64
  error: p.priority,
64
65
  description: "Lower numbers are tried first.",
65
- children: /* @__PURE__ */ S(d, {
66
+ children: /* @__PURE__ */ C(d, {
66
67
  id: `${e}-priority`,
67
68
  type: "number",
68
69
  inputMode: "numeric",
@@ -70,63 +71,63 @@ var j = ({ idPrefix: e, initial: t, agents: n, selectableAgents: r, submitLabel:
70
71
  onChange: (e) => h("priority", e.target.value)
71
72
  })
72
73
  }),
73
- /* @__PURE__ */ S(u, {
74
+ /* @__PURE__ */ C(u, {
74
75
  label: "Trigger keywords",
75
76
  htmlFor: `${e}-keywords`,
76
77
  description: "Comma separated. A message containing one is routed to this agent.",
77
- children: /* @__PURE__ */ S(d, {
78
+ children: /* @__PURE__ */ C(d, {
78
79
  id: `${e}-keywords`,
79
80
  value: l.keywords,
80
81
  placeholder: "billing, invoice",
81
82
  onChange: (e) => h("keywords", e.target.value)
82
83
  })
83
84
  }),
84
- /* @__PURE__ */ S(u, {
85
+ /* @__PURE__ */ C(u, {
85
86
  label: "Intent patterns",
86
87
  htmlFor: `${e}-intents`,
87
88
  error: p.intents,
88
89
  description: "Comma separated regular expressions.",
89
- children: /* @__PURE__ */ S(d, {
90
+ children: /* @__PURE__ */ C(d, {
90
91
  id: `${e}-intents`,
91
92
  value: l.intents,
92
93
  placeholder: "refund.*, cancel (my )?order",
93
94
  onChange: (e) => h("intents", e.target.value)
94
95
  })
95
96
  }),
96
- /* @__PURE__ */ S(u, {
97
+ /* @__PURE__ */ C(u, {
97
98
  label: "Fallback agent",
98
99
  htmlFor: `${e}-fallback`,
99
100
  error: p.fallbackAgentId,
100
101
  description: "Answers when this agent fails or times out.",
101
- children: /* @__PURE__ */ C("select", {
102
+ children: /* @__PURE__ */ w(S, {
102
103
  id: `${e}-fallback`,
103
- className: k,
104
+ className: A,
104
105
  value: l.fallbackAgentId,
105
106
  onChange: (e) => h("fallbackAgentId", e.target.value),
106
- children: [/* @__PURE__ */ S("option", {
107
+ children: [/* @__PURE__ */ C("option", {
107
108
  value: "",
108
109
  children: "No fallback"
109
- }), n.filter((e) => e.id !== l.agentId).map((e) => /* @__PURE__ */ S("option", {
110
+ }), n.filter((e) => e.id !== l.agentId).map((e) => /* @__PURE__ */ C("option", {
110
111
  value: e.id,
111
112
  children: e.name
112
113
  }, e.id))]
113
114
  })
114
115
  }),
115
- /* @__PURE__ */ C("label", {
116
+ /* @__PURE__ */ w("label", {
116
117
  className: "flex items-center gap-2 text-sm font-medium md:col-span-2",
117
- children: [/* @__PURE__ */ S("input", {
118
+ children: [/* @__PURE__ */ C("input", {
118
119
  type: "checkbox",
119
120
  checked: l.isActive,
120
121
  onChange: (e) => h("isActive", e.target.checked)
121
122
  }), "Route messages to this agent (active)"]
122
123
  }),
123
- /* @__PURE__ */ C("div", {
124
+ /* @__PURE__ */ w("div", {
124
125
  className: "flex gap-2 md:col-span-2",
125
- children: [/* @__PURE__ */ S(s, {
126
+ children: [/* @__PURE__ */ C(s, {
126
127
  type: "submit",
127
128
  isLoading: a,
128
129
  children: i
129
- }), c && /* @__PURE__ */ S(s, {
130
+ }), c && /* @__PURE__ */ C(s, {
130
131
  type: "button",
131
132
  variant: "outline",
132
133
  onClick: c,
@@ -136,197 +137,197 @@ var j = ({ idPrefix: e, initial: t, agents: n, selectableAgents: r, submitLabel:
136
137
  ]
137
138
  });
138
139
  }, M = ({ botId: u, defaultAgentId: d, agents: b, onDefaultAgentChange: M }) => {
139
- let N = t(), P = N(e.APP_UPDATE), F = N(e.APP_AGENT_CREATE), I = N(e.APP_AGENT_UPDATE), L = N(e.APP_AGENT_DELETE), R = f(u), [z, B] = p(), [V, H] = h(), [U] = m(), [W, G] = x(null), [K, q] = x(!1), [J, Y] = x(!1), X = (e) => b.find((t) => t.id === e)?.name ?? "Unknown agent", ee = new Set(R.data.map((e) => e.agentId)), Z = b.filter((e) => !ee.has(e.id)), Q = [...R.data].sort((e, t) => e.priority - t.priority), $ = b.find((e) => e.id === d), te = async (e) => {
140
+ let N = t(), P = N(e.APP_UPDATE), F = N(e.APP_AGENT_CREATE), I = N(e.APP_AGENT_UPDATE), L = N(e.APP_AGENT_DELETE), R = f(u), [te, z] = p(), [B, V] = h(), [H] = m(), [U, W] = x(null), [G, K] = x(!1), [q, J] = x(!1), Y = (e) => b.find((t) => t.id === e)?.name ?? "Unknown agent", X = new Set(R.data.map((e) => e.agentId)), Z = b.filter((e) => !X.has(e.id)), Q = [...R.data].sort((e, t) => e.priority - t.priority), $ = b.find((e) => e.id === d), ne = async (e) => {
140
141
  let t = e || null;
141
- Y(!0);
142
+ J(!0);
142
143
  try {
143
- await M(t), O.success(t ? `Default agent set to ${X(t)}` : "Default agent removed");
144
+ await M(t), k.success(t ? `Default agent set to ${Y(t)}` : "Default agent removed");
144
145
  } catch (e) {
145
- O.error(e instanceof Error ? e.message : "Failed to change the default agent");
146
+ k.error(e instanceof Error ? e.message : "Failed to change the default agent");
146
147
  } finally {
147
- Y(!1);
148
+ J(!1);
148
149
  }
149
- }, ne = async (e) => {
150
+ }, re = async (e) => {
150
151
  try {
151
- await z({
152
+ await te({
152
153
  botId: u,
153
154
  agentId: e.agentId,
154
155
  ...y(e)
155
- }), O.success(`${X(e.agentId)} linked to this bot`), q(!1), await R.refetch();
156
+ }), k.success(`${Y(e.agentId)} linked to this bot`), K(!1), await R.refetch();
156
157
  } catch (e) {
157
- O.error(e instanceof Error ? e.message : "Failed to link the agent");
158
+ k.error(e instanceof Error ? e.message : "Failed to link the agent");
158
159
  }
159
- }, re = async (e, t) => {
160
+ }, ie = async (e, t) => {
160
161
  try {
161
- await V({
162
+ await B({
162
163
  linkId: e.id,
163
164
  ...y(t)
164
- }), O.success(`Routing for ${X(e.agentId)} saved`), G(null), await R.refetch();
165
+ }), k.success(`Routing for ${Y(e.agentId)} saved`), W(null), await R.refetch();
165
166
  } catch (e) {
166
- O.error(e instanceof Error ? e.message : "Failed to save the routing");
167
+ k.error(e instanceof Error ? e.message : "Failed to save the routing");
167
168
  }
168
- }, ie = async (e) => {
169
- let t = X(e.agentId);
169
+ }, ae = async (e) => {
170
+ let t = Y(e.agentId);
170
171
  if (await g({
171
172
  title: "Remove agent?",
172
173
  message: `Remove ${t} from this bot? The agent itself is not deleted.`,
173
174
  confirmLabel: "Remove",
174
175
  cancelLabel: "Cancel"
175
176
  })) try {
176
- if (!await U(e.id)) {
177
- O.error(`${t} could not be removed from this bot.`), await R.refetch();
177
+ if (!await H(e.id)) {
178
+ k.error(`${t} could not be removed from this bot.`), await R.refetch();
178
179
  return;
179
180
  }
180
- e.agentId === d && await M(null), O.success(`${t} removed from this bot`), await R.refetch();
181
+ e.agentId === d && await M(null), k.success(`${t} removed from this bot`), await R.refetch();
181
182
  } catch (e) {
182
- O.error(e instanceof Error ? e.message : "Failed to remove the agent");
183
+ k.error(e instanceof Error ? e.message : "Failed to remove the agent");
183
184
  }
184
185
  };
185
- return /* @__PURE__ */ C("div", {
186
+ return /* @__PURE__ */ w("div", {
186
187
  className: "space-y-6",
187
- children: [/* @__PURE__ */ C(n, { children: [/* @__PURE__ */ C(a, { children: [/* @__PURE__ */ S(o, { children: "Default Agent" }), /* @__PURE__ */ S(i, { children: "Answers when no routing rule picks another agent" })] }), /* @__PURE__ */ C(r, {
188
+ children: [/* @__PURE__ */ w(n, { children: [/* @__PURE__ */ w(a, { children: [/* @__PURE__ */ C(o, { children: "Default Agent" }), /* @__PURE__ */ C(i, { children: "Answers when no routing rule picks another agent" })] }), /* @__PURE__ */ w(r, {
188
189
  className: "space-y-4",
189
190
  children: [
190
- $ && /* @__PURE__ */ C("div", {
191
+ $ && /* @__PURE__ */ w("div", {
191
192
  className: "flex items-center justify-between rounded-lg border border-border-subtle p-4",
192
- children: [/* @__PURE__ */ C("div", {
193
+ children: [/* @__PURE__ */ w("div", {
193
194
  className: "flex items-center gap-3",
194
- children: [/* @__PURE__ */ S(w, {
195
+ children: [/* @__PURE__ */ C(T, {
195
196
  size: 20,
196
197
  "aria-hidden": "true"
197
- }), /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("p", {
198
+ }), /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
198
199
  className: "font-medium",
199
200
  children: $.name
200
- }), /* @__PURE__ */ S(c, {
201
+ }), /* @__PURE__ */ C(c, {
201
202
  variant: "success",
202
203
  children: "Default"
203
204
  })] })]
204
- }), /* @__PURE__ */ S(l, { status: $.status })]
205
+ }), /* @__PURE__ */ C(l, { status: $.status })]
205
206
  }),
206
- /* @__PURE__ */ C("label", {
207
+ /* @__PURE__ */ w("label", {
207
208
  className: "grid gap-2 text-sm font-medium",
208
209
  htmlFor: "bot-default-agent",
209
- children: ["Default agent", /* @__PURE__ */ C("select", {
210
+ children: ["Default agent", /* @__PURE__ */ w(S, {
210
211
  id: "bot-default-agent",
211
- className: k,
212
+ className: A,
212
213
  value: d ?? "",
213
- disabled: !P || J,
214
- onChange: (e) => void te(e.target.value),
215
- children: [/* @__PURE__ */ S("option", {
214
+ disabled: !P || q,
215
+ onChange: (e) => void ne(e.target.value),
216
+ children: [/* @__PURE__ */ C("option", {
216
217
  value: "",
217
218
  children: "No default agent"
218
- }), b.map((e) => /* @__PURE__ */ S("option", {
219
+ }), b.map((e) => /* @__PURE__ */ C("option", {
219
220
  value: e.id,
220
221
  children: e.name
221
222
  }, e.id))]
222
223
  })]
223
224
  }),
224
- b.length === 0 && /* @__PURE__ */ S("p", {
225
+ b.length === 0 && /* @__PURE__ */ C("p", {
225
226
  className: "text-sm text-text-secondary",
226
227
  children: "No agents yet. Create an agent first."
227
228
  })
228
229
  ]
229
- })] }), /* @__PURE__ */ C(n, { children: [/* @__PURE__ */ S(a, { children: /* @__PURE__ */ C("div", {
230
+ })] }), /* @__PURE__ */ w(n, { children: [/* @__PURE__ */ C(a, { children: /* @__PURE__ */ w("div", {
230
231
  className: "flex items-start justify-between gap-4",
231
- children: [/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S(o, { children: "Linked Agents" }), /* @__PURE__ */ S(i, { children: "The specialists behind this bot and how messages are routed to them" })] }), F && !K && Z.length > 0 && /* @__PURE__ */ S(s, {
232
+ children: [/* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C(o, { children: "Linked Agents" }), /* @__PURE__ */ C(i, { children: "The specialists behind this bot and how messages are routed to them" })] }), F && !G && Z.length > 0 && /* @__PURE__ */ C(s, {
232
233
  size: "sm",
233
- leftIcon: /* @__PURE__ */ S(E, { size: 16 }),
234
- onClick: () => q(!0),
234
+ leftIcon: /* @__PURE__ */ C(D, { size: 16 }),
235
+ onClick: () => K(!0),
235
236
  children: "Link agent"
236
237
  })]
237
- }) }), /* @__PURE__ */ C(r, {
238
+ }) }), /* @__PURE__ */ w(r, {
238
239
  className: "space-y-4",
239
- children: [K && /* @__PURE__ */ S("div", {
240
+ children: [G && /* @__PURE__ */ C("div", {
240
241
  className: "rounded-lg border border-border-subtle p-4",
241
- children: /* @__PURE__ */ S(j, {
242
+ children: /* @__PURE__ */ C(j, {
242
243
  idPrefix: "bot-link-new",
243
244
  initial: _,
244
245
  agents: b,
245
246
  selectableAgents: Z,
246
247
  submitLabel: "Link agent",
247
- busy: B.loading,
248
- onSubmit: ne,
249
- onCancel: () => q(!1)
248
+ busy: z.loading,
249
+ onSubmit: re,
250
+ onCancel: () => K(!1)
250
251
  })
251
- }), R.loading && R.data.length === 0 ? /* @__PURE__ */ S("p", {
252
+ }), R.loading && R.data.length === 0 ? /* @__PURE__ */ C("p", {
252
253
  role: "status",
253
254
  className: "text-sm text-text-secondary",
254
255
  children: "Loading linked agents…"
255
- }) : R.error ? /* @__PURE__ */ C("div", {
256
+ }) : R.error ? /* @__PURE__ */ w("div", {
256
257
  role: "alert",
257
258
  className: "space-y-2",
258
- children: [/* @__PURE__ */ S("p", {
259
+ children: [/* @__PURE__ */ C("p", {
259
260
  className: "text-sm",
260
261
  children: R.error.message
261
- }), /* @__PURE__ */ S(s, {
262
+ }), /* @__PURE__ */ C(s, {
262
263
  size: "sm",
263
264
  variant: "outline",
264
265
  onClick: () => void R.refetch(),
265
266
  children: "Retry"
266
267
  })]
267
- }) : Q.length === 0 ? /* @__PURE__ */ S("p", {
268
+ }) : Q.length === 0 ? /* @__PURE__ */ C("p", {
268
269
  className: "text-sm text-text-secondary",
269
270
  children: "No agents linked yet. Link agents to route messages to specialists by keyword or intent."
270
- }) : /* @__PURE__ */ S("ul", {
271
+ }) : /* @__PURE__ */ C("ul", {
271
272
  className: "space-y-3",
272
- children: Q.map((e) => /* @__PURE__ */ S("li", {
273
+ children: Q.map((e) => /* @__PURE__ */ C("li", {
273
274
  className: "rounded-lg border border-border-subtle p-4",
274
- children: W === e.id ? /* @__PURE__ */ S(j, {
275
+ children: U === e.id ? /* @__PURE__ */ C(j, {
275
276
  idPrefix: `bot-link-${e.id}`,
276
- initial: A(e),
277
+ initial: ee(e),
277
278
  agents: b,
278
279
  submitLabel: "Save routing",
279
- busy: H.loading,
280
- onSubmit: (t) => re(e, t),
281
- onCancel: () => G(null)
282
- }) : /* @__PURE__ */ C("div", {
280
+ busy: V.loading,
281
+ onSubmit: (t) => ie(e, t),
282
+ onCancel: () => W(null)
283
+ }) : /* @__PURE__ */ w("div", {
283
284
  className: "flex flex-wrap items-start justify-between gap-4",
284
- children: [/* @__PURE__ */ C("div", {
285
+ children: [/* @__PURE__ */ w("div", {
285
286
  className: "space-y-1",
286
287
  children: [
287
- /* @__PURE__ */ C("p", {
288
+ /* @__PURE__ */ w("p", {
288
289
  className: "font-medium",
289
290
  children: [
290
- X(e.agentId),
291
+ Y(e.agentId),
291
292
  " ",
292
- /* @__PURE__ */ S(c, {
293
+ /* @__PURE__ */ C(c, {
293
294
  variant: e.isActive ? "success" : "secondary",
294
295
  children: e.isActive ? "Active" : "Inactive"
295
296
  })
296
297
  ]
297
298
  }),
298
- /* @__PURE__ */ C("p", {
299
+ /* @__PURE__ */ w("p", {
299
300
  className: "text-sm text-text-secondary",
300
301
  children: ["Priority ", e.priority]
301
302
  }),
302
- /* @__PURE__ */ C("p", {
303
+ /* @__PURE__ */ w("p", {
303
304
  className: "text-sm text-text-secondary",
304
305
  children: ["Keywords: ", v(e.triggerKeywords) || "none"]
305
306
  }),
306
- /* @__PURE__ */ C("p", {
307
+ /* @__PURE__ */ w("p", {
307
308
  className: "text-sm text-text-secondary",
308
309
  children: ["Intents: ", v(e.intentPatterns) || "none"]
309
310
  }),
310
- /* @__PURE__ */ C("p", {
311
+ /* @__PURE__ */ w("p", {
311
312
  className: "text-sm text-text-secondary",
312
- children: ["Fallback: ", e.fallbackAgentId ? X(e.fallbackAgentId) : "none"]
313
+ children: ["Fallback: ", e.fallbackAgentId ? Y(e.fallbackAgentId) : "none"]
313
314
  })
314
315
  ]
315
- }), (I || L) && /* @__PURE__ */ C("div", {
316
+ }), (I || L) && /* @__PURE__ */ w("div", {
316
317
  className: "flex gap-2",
317
- children: [I && /* @__PURE__ */ S(s, {
318
+ children: [I && /* @__PURE__ */ C(s, {
318
319
  size: "sm",
319
320
  variant: "outline",
320
- leftIcon: /* @__PURE__ */ S(T, { size: 14 }),
321
- "aria-label": `Edit routing for ${X(e.agentId)}`,
322
- onClick: () => G(e.id),
321
+ leftIcon: /* @__PURE__ */ C(E, { size: 14 }),
322
+ "aria-label": `Edit routing for ${Y(e.agentId)}`,
323
+ onClick: () => W(e.id),
323
324
  children: "Edit"
324
- }), L && /* @__PURE__ */ S(s, {
325
+ }), L && /* @__PURE__ */ C(s, {
325
326
  size: "sm",
326
327
  variant: "outline",
327
- leftIcon: /* @__PURE__ */ S(D, { size: 14 }),
328
- "aria-label": `Remove ${X(e.agentId)}`,
329
- onClick: () => void ie(e),
328
+ leftIcon: /* @__PURE__ */ C(O, { size: 14 }),
329
+ "aria-label": `Remove ${Y(e.agentId)}`,
330
+ onClick: () => void ae(e),
330
331
  children: "Remove"
331
332
  })]
332
333
  })]