@burdenoff/microfe-botmanor 2026.1027.2 → 2026.1028.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 (91) hide show
  1. package/dist/botlit/BotlitRoutes.js +142 -132
  2. package/dist/botlit/BotlitRoutes.js.map +1 -1
  3. package/dist/botlit/components/AgentApprovalPanel.js +144 -126
  4. package/dist/botlit/components/AgentApprovalPanel.js.map +1 -1
  5. package/dist/botlit/components/ModelRegistrationPanel.js +4 -4
  6. package/dist/botlit/components/RetentionStatusPanel.js +95 -0
  7. package/dist/botlit/components/RetentionStatusPanel.js.map +1 -0
  8. package/dist/botlit/components/VersionHistoryPanel.js +92 -83
  9. package/dist/botlit/components/VersionHistoryPanel.js.map +1 -1
  10. package/dist/botlit/hooks/index.js +1 -0
  11. package/dist/botlit/hooks/useRetention.js +31 -0
  12. package/dist/botlit/hooks/useRetention.js.map +1 -0
  13. package/dist/botlit/pages/A2AAgentDetailPage.js +212 -203
  14. package/dist/botlit/pages/A2AAgentDetailPage.js.map +1 -1
  15. package/dist/botlit/pages/A2ARegistryPage.js +129 -117
  16. package/dist/botlit/pages/A2ARegistryPage.js.map +1 -1
  17. package/dist/botlit/pages/AgentApprovalsPage.js +122 -110
  18. package/dist/botlit/pages/AgentApprovalsPage.js.map +1 -1
  19. package/dist/botlit/pages/AgentBuilderPage.js +18 -18
  20. package/dist/botlit/pages/AgentDetailPage.js +298 -273
  21. package/dist/botlit/pages/AgentDetailPage.js.map +1 -1
  22. package/dist/botlit/pages/AgentsListPage.js +145 -121
  23. package/dist/botlit/pages/AgentsListPage.js.map +1 -1
  24. package/dist/botlit/pages/BotChannelsTab.js +238 -226
  25. package/dist/botlit/pages/BotChannelsTab.js.map +1 -1
  26. package/dist/botlit/pages/BotDetailPage.js +307 -288
  27. package/dist/botlit/pages/BotDetailPage.js.map +1 -1
  28. package/dist/botlit/pages/BotWorkflowTab.js +125 -116
  29. package/dist/botlit/pages/BotWorkflowTab.js.map +1 -1
  30. package/dist/botlit/pages/BotsListPage.js +159 -144
  31. package/dist/botlit/pages/BotsListPage.js.map +1 -1
  32. package/dist/botlit/pages/BucketsPage.js +279 -258
  33. package/dist/botlit/pages/BucketsPage.js.map +1 -1
  34. package/dist/botlit/pages/ChannelDetailPage.js +346 -328
  35. package/dist/botlit/pages/ChannelDetailPage.js.map +1 -1
  36. package/dist/botlit/pages/ChannelRoutesPage.js +10 -10
  37. package/dist/botlit/pages/ChannelsPage.js +163 -148
  38. package/dist/botlit/pages/ChannelsPage.js.map +1 -1
  39. package/dist/botlit/pages/DashboardPage.js +129 -114
  40. package/dist/botlit/pages/DashboardPage.js.map +1 -1
  41. package/dist/botlit/pages/ExecutionDetailPage.js +145 -139
  42. package/dist/botlit/pages/ExecutionDetailPage.js.map +1 -1
  43. package/dist/botlit/pages/ExecutionsPage.js +14 -14
  44. package/dist/botlit/pages/InstalledPackagesPage.js +245 -227
  45. package/dist/botlit/pages/InstalledPackagesPage.js.map +1 -1
  46. package/dist/botlit/pages/KnowledgeBaseDetailPage.js +168 -156
  47. package/dist/botlit/pages/KnowledgeBaseDetailPage.js.map +1 -1
  48. package/dist/botlit/pages/KnowledgeBasesPage.js +91 -79
  49. package/dist/botlit/pages/KnowledgeBasesPage.js.map +1 -1
  50. package/dist/botlit/pages/MCPServerDetailPage.js +200 -188
  51. package/dist/botlit/pages/MCPServerDetailPage.js.map +1 -1
  52. package/dist/botlit/pages/MCPServersPage.js +170 -155
  53. package/dist/botlit/pages/MCPServersPage.js.map +1 -1
  54. package/dist/botlit/pages/PoliciesPage.js +115 -104
  55. package/dist/botlit/pages/PoliciesPage.js.map +1 -1
  56. package/dist/botlit/pages/PolicyDetailPage.js +368 -324
  57. package/dist/botlit/pages/PolicyDetailPage.js.map +1 -1
  58. package/dist/botlit/pages/PromptStudioPage.js +106 -97
  59. package/dist/botlit/pages/PromptStudioPage.js.map +1 -1
  60. package/dist/botlit/pages/PromptTemplateDetailPage.js +359 -347
  61. package/dist/botlit/pages/PromptTemplateDetailPage.js.map +1 -1
  62. package/dist/botlit/pages/PromptTemplatesPage.js +127 -112
  63. package/dist/botlit/pages/PromptTemplatesPage.js.map +1 -1
  64. package/dist/botlit/pages/RetrievalProfileDetailPage.js +219 -210
  65. package/dist/botlit/pages/RetrievalProfileDetailPage.js.map +1 -1
  66. package/dist/botlit/pages/RetrievalProfilesPage.js +112 -103
  67. package/dist/botlit/pages/RetrievalProfilesPage.js.map +1 -1
  68. package/dist/botlit/pages/SettingsPage.js +264 -252
  69. package/dist/botlit/pages/SettingsPage.js.map +1 -1
  70. package/dist/botlit/pages/SkillDetailPage.js +235 -226
  71. package/dist/botlit/pages/SkillDetailPage.js.map +1 -1
  72. package/dist/botlit/pages/SkillsPage.js +115 -106
  73. package/dist/botlit/pages/SkillsPage.js.map +1 -1
  74. package/dist/botlit/pages/StorePackageDetailPage.js +194 -188
  75. package/dist/botlit/pages/StorePackageDetailPage.js.map +1 -1
  76. package/dist/botlit/pages/StorePage.js +161 -155
  77. package/dist/botlit/pages/StorePage.js.map +1 -1
  78. package/dist/botlit/permissions/PermissionRequired.js +45 -0
  79. package/dist/botlit/permissions/PermissionRequired.js.map +1 -0
  80. package/dist/botlit/permissions/botmanorPermissions.js +72 -0
  81. package/dist/botlit/permissions/botmanorPermissions.js.map +1 -0
  82. package/dist/botlit/permissions/index.js +3 -0
  83. package/dist/botlit/permissions/useBotmanorPermissions.js +19 -0
  84. package/dist/botlit/permissions/useBotmanorPermissions.js.map +1 -0
  85. package/dist/botlit/utils/policyConfig.js +67 -42
  86. package/dist/botlit/utils/policyConfig.js.map +1 -1
  87. package/dist/generated/global-types.js.map +1 -1
  88. package/dist/generated/wspace-operations.js +90 -54
  89. package/dist/generated/wspace-operations.js.map +1 -1
  90. package/dist/generated/wspace-types.js.map +1 -1
  91. package/package.json +1 -1
@@ -1,15 +1,18 @@
1
1
  import { useTr as e } from "../../shared/hooks/useTr.js";
2
2
  import { useConfigureLLMProvider as t, useLLMModels as n, useLLMProviders as r } from "../hooks/useLLMProviders.js";
3
3
  import { cn as i } from "../utils/cn.js";
4
- import { PageLayout as a } from "../components/PageLayout.js";
5
- import { Card as o, CardContent as s, CardDescription as c, CardHeader as l, CardTitle as u } from "../components/Card.js";
6
- import { Button as d } from "../components/Button.js";
7
- import { Badge as f } from "../components/Badge.js";
8
- import { FormField as p, Input as m } from "../components/Input.js";
9
- import { toUnion as h } from "../utils/unions.js";
10
- import { ModelRegistrationPanel as g } from "../components/ModelRegistrationPanel.js";
4
+ import { BOTMANOR_PERMISSIONS as a } from "../permissions/botmanorPermissions.js";
5
+ import { BotmanorPermissionGate as o } from "../permissions/useBotmanorPermissions.js";
6
+ import { PageLayout as ee } from "../components/PageLayout.js";
7
+ import { Button as s } from "../components/Button.js";
8
+ import "../permissions/index.js";
9
+ import { Card as c, CardContent as l, CardDescription as u, CardHeader as d, CardTitle as f } from "../components/Card.js";
10
+ import { Badge as p } from "../components/Badge.js";
11
+ import { FormField as m, Input as h } from "../components/Input.js";
12
+ import { toUnion as g } from "../utils/unions.js";
13
+ import { ModelRegistrationPanel as te } from "../components/ModelRegistrationPanel.js";
11
14
  import { useState as _ } from "react";
12
- import { PagePurpose as ee } from "@burdenoff/fe-libs/ui";
15
+ import { PagePurpose as ne } from "@burdenoff/fe-libs/ui";
13
16
  import { jsx as v, jsxs as y } from "react/jsx-runtime";
14
17
  import { Brain as b, ExternalLink as x, Key as S, Link2 as C, Save as w } from "lucide-react";
15
18
  import { toast as T } from "sonner";
@@ -23,13 +26,13 @@ var E = [
23
26
  "CUSTOM"
24
27
  ];
25
28
  function D(e) {
26
- return h(e.toUpperCase(), E, "CUSTOM");
29
+ return g(e.toUpperCase(), E, "CUSTOM");
27
30
  }
28
31
  var O = () => {
29
- let h = e(), { data: E, refetch: O, loading: k, error: A } = r(), { configureProvider: j, isConfiguring: M } = t(), { data: N, refetch: P, loading: F, error: te } = n(), I = k || F, L = A || te, [R, z] = _(""), [B, V] = _(!0), [H, U] = _("openai"), [W, G] = _(null), [K, q] = _("apikey"), [J, Y] = _(""), [X, Z] = _("ap-south-1"), Q = H === "aws_bedrock", $ = Q && K === "iam", ne = /^[a-z]{2}(?:-[a-z]+)+-\d+$/.test(X.trim());
30
- return /* @__PURE__ */ v(a, {
31
- title: h("botlit.settings.title", "Settings"),
32
- description: h("botlit.settings.description", "Configure your BotManor workspace settings"),
32
+ let g = e(), { data: E, refetch: O, loading: k, error: A } = r(), { configureProvider: j, isConfiguring: re } = t(), { data: M, refetch: N, loading: P, error: F } = n(), I = k || P, L = A || F, [R, z] = _(""), [B, V] = _(!0), [H, U] = _("openai"), [W, G] = _(null), [K, q] = _("apikey"), [J, Y] = _(""), [X, Z] = _("ap-south-1"), Q = H === "aws_bedrock", $ = Q && K === "iam", ie = /^[a-z]{2}(?:-[a-z]+)+-\d+$/.test(X.trim());
33
+ return /* @__PURE__ */ v(ee, {
34
+ title: g("botlit.settings.title", "Settings"),
35
+ description: g("botlit.settings.description", "Configure your BotManor workspace settings"),
33
36
  children: /* @__PURE__ */ y("div", {
34
37
  className: "space-y-6",
35
38
  children: [
@@ -39,22 +42,22 @@ var O = () => {
39
42
  }),
40
43
  L && /* @__PURE__ */ y("div", {
41
44
  role: "alert",
42
- children: [/* @__PURE__ */ v("p", { children: "Could not load providers and models. Try loading the catalog again." }), /* @__PURE__ */ v(d, {
45
+ children: [/* @__PURE__ */ v("p", { children: "Could not load providers and models. Try loading the catalog again." }), /* @__PURE__ */ v(s, {
43
46
  variant: "secondary",
44
47
  onClick: () => {
45
- O(), P();
48
+ O(), N();
46
49
  },
47
50
  children: "Retry model catalog"
48
51
  })]
49
52
  }),
50
- /* @__PURE__ */ v(ee, {
53
+ /* @__PURE__ */ v(ne, {
51
54
  icon: /* @__PURE__ */ v(S, { size: 18 }),
52
- children: h("botlit.settings.purpose", "Workspace-wide settings for LLM Providers — connect at least one model provider (OpenAI, Anthropic, Google and others) so your agents have a brain to think with.")
55
+ children: g("botlit.settings.purpose", "Workspace-wide settings for LLM Providers — connect at least one model provider (OpenAI, Anthropic, Google and others) so your agents have a brain to think with.")
53
56
  }),
54
- /* @__PURE__ */ y(o, {
57
+ /* @__PURE__ */ y(c, {
55
58
  treatment: "glass",
56
59
  glow: !0,
57
- children: [/* @__PURE__ */ y(l, { children: [/* @__PURE__ */ v(u, { children: h("botlit.settings.providers.title", "LLM Providers") }), /* @__PURE__ */ v(c, { children: h("botlit.settings.providers.description", "Configure API keys for AI model providers") })] }), /* @__PURE__ */ v(s, {
60
+ children: [/* @__PURE__ */ y(d, { children: [/* @__PURE__ */ v(f, { children: g("botlit.settings.providers.title", "LLM Providers") }), /* @__PURE__ */ v(u, { children: g("botlit.settings.providers.description", "Configure API keys for AI model providers") })] }), /* @__PURE__ */ v(l, {
58
61
  className: "space-y-4",
59
62
  children: E?.map((e) => /* @__PURE__ */ y("div", {
60
63
  className: "flex items-center justify-between p-4 border border-border-subtle rounded-lg",
@@ -70,44 +73,47 @@ var O = () => {
70
73
  }),
71
74
  /* @__PURE__ */ v("p", {
72
75
  className: "text-sm text-text-secondary",
73
- children: h("botlit.settings.providers.type", "Type: {{type}}", { type: e.type })
76
+ children: g("botlit.settings.providers.type", "Type: {{type}}", { type: e.type })
74
77
  }),
75
78
  e.connectionId && /* @__PURE__ */ v("p", {
76
79
  className: "text-xs text-text-secondary mt-0.5",
77
- children: h("botlit.settings.providers.connectedViaIntegrations", "Connected via Integrations")
80
+ children: g("botlit.settings.providers.connectedViaIntegrations", "Connected via Integrations")
78
81
  }),
79
82
  !e.connectionId && e.credentialsHash && /* @__PURE__ */ v("p", {
80
83
  className: "text-xs text-text-secondary mt-0.5",
81
- children: h("botlit.settings.providers.apiKeyStored", "API key stored locally")
84
+ children: g("botlit.settings.providers.apiKeyStored", "API key stored locally")
82
85
  })
83
86
  ] })]
84
87
  }), /* @__PURE__ */ y("div", {
85
88
  className: "flex items-center gap-3",
86
89
  children: [
87
- e.connectionId && /* @__PURE__ */ v(f, {
90
+ e.connectionId && /* @__PURE__ */ v(p, {
88
91
  variant: "default",
89
- children: h("botlit.settings.providers.integrationBadge", "Integration")
92
+ children: g("botlit.settings.providers.integrationBadge", "Integration")
90
93
  }),
91
- /* @__PURE__ */ v(f, {
94
+ /* @__PURE__ */ v(p, {
92
95
  variant: e.isActive ? "success" : "secondary",
93
- children: e.isActive ? h("botlit.settings.providers.active", "Active") : h("botlit.settings.providers.inactive", "Inactive")
96
+ children: e.isActive ? g("botlit.settings.providers.active", "Active") : g("botlit.settings.providers.inactive", "Inactive")
94
97
  }),
95
- /* @__PURE__ */ v(d, {
96
- variant: "outline",
97
- size: "sm",
98
- onClick: () => {
99
- G(e.id), V(e.isActive), U(e.type.toLowerCase()), z(""), Y(e.connectionId || ""), q(e.type === "AWS_BEDROCK" && e.metadata?.awsAuthentication === "iam" ? "iam" : e.connectionId ? "integration" : "apikey"), Z(typeof e.metadata?.region == "string" ? e.metadata.region : "ap-south-1"), document.getElementById("provider-form")?.scrollIntoView({ behavior: "smooth" });
100
- },
101
- children: h("botlit.settings.actions.configure", "Configure")
98
+ /* @__PURE__ */ v(o, {
99
+ permission: a.LLM_UPDATE,
100
+ children: /* @__PURE__ */ v(s, {
101
+ variant: "outline",
102
+ size: "sm",
103
+ onClick: () => {
104
+ G(e.id), V(e.isActive), U(e.type.toLowerCase()), z(""), Y(e.connectionId || ""), q(e.type === "AWS_BEDROCK" && e.metadata?.awsAuthentication === "iam" ? "iam" : e.connectionId ? "integration" : "apikey"), Z(typeof e.metadata?.region == "string" ? e.metadata.region : "ap-south-1"), document.getElementById("provider-form")?.scrollIntoView({ behavior: "smooth" });
105
+ },
106
+ children: g("botlit.settings.actions.configure", "Configure")
107
+ })
102
108
  })
103
109
  ]
104
110
  })]
105
111
  }, e.id))
106
112
  })]
107
113
  }),
108
- /* @__PURE__ */ y(o, { children: [/* @__PURE__ */ y(l, { children: [/* @__PURE__ */ v(u, { children: h("botlit.settings.models.title", "LLM Models") }), /* @__PURE__ */ v(c, { children: h("botlit.settings.models.description", "Registered models across your providers") })] }), /* @__PURE__ */ v(s, {
114
+ /* @__PURE__ */ y(c, { children: [/* @__PURE__ */ y(d, { children: [/* @__PURE__ */ v(f, { children: g("botlit.settings.models.title", "LLM Models") }), /* @__PURE__ */ v(u, { children: g("botlit.settings.models.description", "Registered models across your providers") })] }), /* @__PURE__ */ v(l, {
109
115
  className: "space-y-4",
110
- children: N && N.length > 0 ? N.map((e) => {
116
+ children: M && M.length > 0 ? M.map((e) => {
111
117
  let t = E?.find((t) => t.id === e.providerId)?.name;
112
118
  return /* @__PURE__ */ y("div", {
113
119
  className: "flex items-center justify-between p-4 border border-border-subtle rounded-lg",
@@ -128,239 +134,245 @@ var O = () => {
128
134
  /* @__PURE__ */ y("div", {
129
135
  className: "flex gap-3 mt-1 text-xs text-text-secondary",
130
136
  children: [
131
- e.contextWindow != null && /* @__PURE__ */ v("span", { children: h("botlit.settings.models.context", "Context: {{value}}K", { value: (e.contextWindow / 1e3).toFixed(0) }) }),
132
- e.maxOutputTokens != null && /* @__PURE__ */ v("span", { children: h("botlit.settings.models.maxOut", "Max out: {{value}}K", { value: (e.maxOutputTokens / 1e3).toFixed(0) }) }),
133
- e.inputPricePerMToken != null && /* @__PURE__ */ v("span", { children: h("botlit.settings.models.priceIn", "${{value}}/M in", { value: e.inputPricePerMToken }) }),
134
- e.outputPricePerMToken != null && /* @__PURE__ */ v("span", { children: h("botlit.settings.models.priceOut", "${{value}}/M out", { value: e.outputPricePerMToken }) })
137
+ e.contextWindow != null && /* @__PURE__ */ v("span", { children: g("botlit.settings.models.context", "Context: {{value}}K", { value: (e.contextWindow / 1e3).toFixed(0) }) }),
138
+ e.maxOutputTokens != null && /* @__PURE__ */ v("span", { children: g("botlit.settings.models.maxOut", "Max out: {{value}}K", { value: (e.maxOutputTokens / 1e3).toFixed(0) }) }),
139
+ e.inputPricePerMToken != null && /* @__PURE__ */ v("span", { children: g("botlit.settings.models.priceIn", "${{value}}/M in", { value: e.inputPricePerMToken }) }),
140
+ e.outputPricePerMToken != null && /* @__PURE__ */ v("span", { children: g("botlit.settings.models.priceOut", "${{value}}/M out", { value: e.outputPricePerMToken }) })
135
141
  ]
136
142
  })
137
143
  ] })]
138
- }), /* @__PURE__ */ v(f, {
144
+ }), /* @__PURE__ */ v(p, {
139
145
  variant: e.isActive ? "success" : "secondary",
140
- children: e.isActive ? h("botlit.settings.providers.active", "Active") : h("botlit.settings.providers.inactive", "Inactive")
146
+ children: e.isActive ? g("botlit.settings.providers.active", "Active") : g("botlit.settings.providers.inactive", "Inactive")
141
147
  })]
142
148
  }, e.id);
143
149
  }) : !I && !L ? /* @__PURE__ */ v("p", {
144
150
  className: "text-sm text-text-secondary text-center py-4",
145
- children: h("botlit.settings.models.empty", "No models registered yet.")
151
+ children: g("botlit.settings.models.empty", "No models registered yet.")
146
152
  }) : null
147
153
  })] }),
148
- !I && !L && /* @__PURE__ */ v(g, {
149
- providers: E ?? [],
150
- onCreated: () => void P()
154
+ !I && !L && /* @__PURE__ */ v(o, {
155
+ permission: a.LLM_CREATE,
156
+ children: /* @__PURE__ */ v(te, {
157
+ providers: E ?? [],
158
+ onCreated: () => void N()
159
+ })
151
160
  }),
152
- /* @__PURE__ */ y(o, {
153
- id: "provider-form",
154
- children: [/* @__PURE__ */ y(l, { children: [/* @__PURE__ */ v(u, { children: W ? h("botlit.settings.form.updateTitle", "Update Provider") : h("botlit.settings.form.addTitle", "Add Provider") }), /* @__PURE__ */ v(c, { children: W ? h("botlit.settings.form.updateDescription", "Update credentials for this provider") : h("botlit.settings.form.addDescription", "Configure a new LLM provider") })] }), /* @__PURE__ */ y(s, {
155
- className: "space-y-4",
156
- children: [
157
- /* @__PURE__ */ v(p, {
158
- label: h("botlit.settings.form.providerLabel", "Provider"),
159
- children: /* @__PURE__ */ y("select", {
160
- className: "flex h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm",
161
- value: H,
162
- disabled: !!W,
163
- onChange: (e) => {
164
- U(e.target.value), q(e.target.value === "aws_bedrock" ? "iam" : "apikey"), z(""), Y("");
165
- },
166
- children: [
167
- /* @__PURE__ */ v("option", {
168
- value: "openai",
169
- children: "OpenAI"
170
- }),
171
- /* @__PURE__ */ v("option", {
172
- value: "anthropic",
173
- children: "Anthropic"
174
- }),
175
- /* @__PURE__ */ v("option", {
176
- value: "google",
177
- children: "Google AI"
178
- }),
179
- /* @__PURE__ */ v("option", {
180
- value: "azure_openai",
181
- children: "Azure OpenAI"
182
- }),
183
- /* @__PURE__ */ v("option", {
184
- value: "aws_bedrock",
185
- children: "AWS Bedrock"
186
- }),
187
- /* @__PURE__ */ v("option", {
188
- value: "custom",
189
- children: "Custom"
190
- })
191
- ]
192
- })
193
- }),
194
- W && /* @__PURE__ */ y("label", {
195
- className: "flex items-center gap-2 text-sm",
196
- children: [/* @__PURE__ */ v("input", {
197
- type: "checkbox",
198
- checked: B,
199
- onChange: (e) => V(e.target.checked)
200
- }), "Provider enabled"]
201
- }),
202
- Q && /* @__PURE__ */ y(p, {
203
- label: "AWS region",
204
- children: [/* @__PURE__ */ v(m, {
205
- "aria-label": "AWS region",
206
- value: X,
207
- onChange: (e) => Z(e.target.value)
208
- }), /* @__PURE__ */ v("p", {
209
- className: "text-sm text-text-secondary",
210
- children: "Managed AWS IAM requires model access enabled for this workspace by your platform administrator."
211
- })]
212
- }),
213
- /* @__PURE__ */ v(p, {
214
- label: h("botlit.settings.form.credentialMethod", "Credential Method"),
215
- children: /* @__PURE__ */ y("div", {
216
- className: "flex flex-wrap gap-3",
217
- children: [
218
- Q && /* @__PURE__ */ y("label", {
219
- className: i("flex items-center gap-2 px-4 py-3 border rounded-lg cursor-pointer flex-1", $ ? "border-primary bg-action-primary-bg/5" : "border-border-subtle hover:border-primary/50"),
220
- children: [/* @__PURE__ */ v("input", {
221
- type: "radio",
222
- name: "credentialMethod",
223
- value: "iam",
224
- checked: $,
225
- onChange: () => {
226
- q("iam"), z(""), Y("");
227
- }
228
- }), "Managed AWS IAM"]
229
- }),
230
- /* @__PURE__ */ y("label", {
231
- className: i("flex items-center gap-2 px-4 py-3 border rounded-lg cursor-pointer transition-colors flex-1", K === "integration" ? "border-primary bg-action-primary-bg/5" : "border-border-subtle hover:border-primary/50"),
232
- children: [/* @__PURE__ */ v("input", {
233
- type: "radio",
234
- name: "credentialMethod",
235
- value: "integration",
236
- checked: K === "integration",
237
- onChange: () => q("integration"),
238
- className: "h-4 w-4"
239
- }), /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
240
- className: "font-medium text-sm",
241
- children: h("botlit.settings.form.integrationOption", "Connect via Integrations")
242
- }), /* @__PURE__ */ v("p", {
243
- className: "text-xs text-text-secondary",
244
- children: h("botlit.settings.form.integrationHint", "Managed credentials (recommended)")
245
- })] })]
246
- }),
247
- /* @__PURE__ */ y("label", {
248
- className: i("flex items-center gap-2 px-4 py-3 border rounded-lg cursor-pointer transition-colors flex-1", K === "apikey" ? "border-primary bg-action-primary-bg/5" : "border-border-subtle hover:border-primary/50"),
249
- children: [/* @__PURE__ */ v("input", {
250
- type: "radio",
251
- name: "credentialMethod",
252
- value: "apikey",
253
- checked: K === "apikey",
254
- onChange: () => q("apikey"),
255
- className: "h-4 w-4"
256
- }), /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
257
- className: "font-medium text-sm",
258
- children: h("botlit.settings.form.apiKeyOption", "Enter API Key")
259
- }), /* @__PURE__ */ v("p", {
260
- className: "text-xs text-text-secondary",
261
- children: h("botlit.settings.form.apiKeyHint", "Paste key directly (legacy)")
262
- })] })]
263
- })
264
- ]
265
- })
266
- }),
267
- K === "integration" && /* @__PURE__ */ y("div", {
268
- className: "space-y-3",
269
- children: [/* @__PURE__ */ v("div", {
270
- className: "p-4 bg-bg-sunken/50 border border-border-subtle rounded-lg",
161
+ /* @__PURE__ */ v(o, {
162
+ permission: a.LLM_CREATE,
163
+ children: /* @__PURE__ */ y(c, {
164
+ id: "provider-form",
165
+ children: [/* @__PURE__ */ y(d, { children: [/* @__PURE__ */ v(f, { children: W ? g("botlit.settings.form.updateTitle", "Update Provider") : g("botlit.settings.form.addTitle", "Add Provider") }), /* @__PURE__ */ v(u, { children: W ? g("botlit.settings.form.updateDescription", "Update credentials for this provider") : g("botlit.settings.form.addDescription", "Configure a new LLM provider") })] }), /* @__PURE__ */ y(l, {
166
+ className: "space-y-4",
167
+ children: [
168
+ /* @__PURE__ */ v(m, {
169
+ label: g("botlit.settings.form.providerLabel", "Provider"),
170
+ children: /* @__PURE__ */ y("select", {
171
+ className: "flex h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm",
172
+ value: H,
173
+ disabled: !!W,
174
+ onChange: (e) => {
175
+ U(e.target.value), q(e.target.value === "aws_bedrock" ? "iam" : "apikey"), z(""), Y("");
176
+ },
177
+ children: [
178
+ /* @__PURE__ */ v("option", {
179
+ value: "openai",
180
+ children: "OpenAI"
181
+ }),
182
+ /* @__PURE__ */ v("option", {
183
+ value: "anthropic",
184
+ children: "Anthropic"
185
+ }),
186
+ /* @__PURE__ */ v("option", {
187
+ value: "google",
188
+ children: "Google AI"
189
+ }),
190
+ /* @__PURE__ */ v("option", {
191
+ value: "azure_openai",
192
+ children: "Azure OpenAI"
193
+ }),
194
+ /* @__PURE__ */ v("option", {
195
+ value: "aws_bedrock",
196
+ children: "AWS Bedrock"
197
+ }),
198
+ /* @__PURE__ */ v("option", {
199
+ value: "custom",
200
+ children: "Custom"
201
+ })
202
+ ]
203
+ })
204
+ }),
205
+ W && /* @__PURE__ */ y("label", {
206
+ className: "flex items-center gap-2 text-sm",
207
+ children: [/* @__PURE__ */ v("input", {
208
+ type: "checkbox",
209
+ checked: B,
210
+ onChange: (e) => V(e.target.checked)
211
+ }), "Provider enabled"]
212
+ }),
213
+ Q && /* @__PURE__ */ y(m, {
214
+ label: "AWS region",
215
+ children: [/* @__PURE__ */ v(h, {
216
+ "aria-label": "AWS region",
217
+ value: X,
218
+ onChange: (e) => Z(e.target.value)
219
+ }), /* @__PURE__ */ v("p", {
220
+ className: "text-sm text-text-secondary",
221
+ children: "Managed AWS IAM requires model access enabled for this workspace by your platform administrator."
222
+ })]
223
+ }),
224
+ /* @__PURE__ */ v(m, {
225
+ label: g("botlit.settings.form.credentialMethod", "Credential Method"),
271
226
  children: /* @__PURE__ */ y("div", {
272
- className: "flex items-start gap-3",
273
- children: [/* @__PURE__ */ v(C, { className: "h-5 w-5 text-primary mt-0.5 flex-shrink-0" }), /* @__PURE__ */ y("div", {
274
- className: "space-y-2 flex-1",
275
- children: [
276
- /* @__PURE__ */ v("p", {
277
- className: "text-sm font-medium",
278
- children: h("botlit.settings.form.integrationTitle", "Integration Connection")
279
- }),
280
- /* @__PURE__ */ v("p", {
227
+ className: "flex flex-wrap gap-3",
228
+ children: [
229
+ Q && /* @__PURE__ */ y("label", {
230
+ className: i("flex items-center gap-2 px-4 py-3 border rounded-lg cursor-pointer flex-1", $ ? "border-primary bg-action-primary-bg/5" : "border-border-subtle hover:border-primary/50"),
231
+ children: [/* @__PURE__ */ v("input", {
232
+ type: "radio",
233
+ name: "credentialMethod",
234
+ value: "iam",
235
+ checked: $,
236
+ onChange: () => {
237
+ q("iam"), z(""), Y("");
238
+ }
239
+ }), "Managed AWS IAM"]
240
+ }),
241
+ /* @__PURE__ */ y("label", {
242
+ className: i("flex items-center gap-2 px-4 py-3 border rounded-lg cursor-pointer transition-colors flex-1", K === "integration" ? "border-primary bg-action-primary-bg/5" : "border-border-subtle hover:border-primary/50"),
243
+ children: [/* @__PURE__ */ v("input", {
244
+ type: "radio",
245
+ name: "credentialMethod",
246
+ value: "integration",
247
+ checked: K === "integration",
248
+ onChange: () => q("integration"),
249
+ className: "h-4 w-4"
250
+ }), /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
251
+ className: "font-medium text-sm",
252
+ children: g("botlit.settings.form.integrationOption", "Connect via Integrations")
253
+ }), /* @__PURE__ */ v("p", {
281
254
  className: "text-xs text-text-secondary",
282
- children: h("botlit.settings.form.integrationDescription", "Create a connection in the Integrations module, then paste the Connection ID here. This stores your API key securely in the Integrations vault.")
283
- }),
284
- /* @__PURE__ */ v("div", {
285
- className: "flex gap-2 mt-2",
286
- children: /* @__PURE__ */ y(d, {
287
- variant: "outline",
288
- size: "sm",
289
- onClick: () => {
290
- window.open("/integrations/connections", "_blank");
291
- },
292
- children: [/* @__PURE__ */ v(x, {
293
- size: 14,
294
- className: "mr-1.5"
295
- }), h("botlit.settings.form.openIntegrations", "Open Integrations")]
296
- })
297
- })
298
- ]
299
- })]
255
+ children: g("botlit.settings.form.integrationHint", "Managed credentials (recommended)")
256
+ })] })]
257
+ }),
258
+ /* @__PURE__ */ y("label", {
259
+ className: i("flex items-center gap-2 px-4 py-3 border rounded-lg cursor-pointer transition-colors flex-1", K === "apikey" ? "border-primary bg-action-primary-bg/5" : "border-border-subtle hover:border-primary/50"),
260
+ children: [/* @__PURE__ */ v("input", {
261
+ type: "radio",
262
+ name: "credentialMethod",
263
+ value: "apikey",
264
+ checked: K === "apikey",
265
+ onChange: () => q("apikey"),
266
+ className: "h-4 w-4"
267
+ }), /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
268
+ className: "font-medium text-sm",
269
+ children: g("botlit.settings.form.apiKeyOption", "Enter API Key")
270
+ }), /* @__PURE__ */ v("p", {
271
+ className: "text-xs text-text-secondary",
272
+ children: g("botlit.settings.form.apiKeyHint", "Paste key directly (legacy)")
273
+ })] })]
274
+ })
275
+ ]
300
276
  })
301
- }), /* @__PURE__ */ v(p, {
302
- label: h("botlit.settings.form.connectionIdPlaceholder", "Connection ID"),
303
- children: /* @__PURE__ */ v(m, {
304
- placeholder: h("botlit.settings.form.connectionIdPlaceholder", "Paste connection ID from Integrations..."),
305
- value: J,
306
- onChange: (e) => Y(e.target.value)
277
+ }),
278
+ K === "integration" && /* @__PURE__ */ y("div", {
279
+ className: "space-y-3",
280
+ children: [/* @__PURE__ */ v("div", {
281
+ className: "p-4 bg-bg-sunken/50 border border-border-subtle rounded-lg",
282
+ children: /* @__PURE__ */ y("div", {
283
+ className: "flex items-start gap-3",
284
+ children: [/* @__PURE__ */ v(C, { className: "h-5 w-5 text-primary mt-0.5 flex-shrink-0" }), /* @__PURE__ */ y("div", {
285
+ className: "space-y-2 flex-1",
286
+ children: [
287
+ /* @__PURE__ */ v("p", {
288
+ className: "text-sm font-medium",
289
+ children: g("botlit.settings.form.integrationTitle", "Integration Connection")
290
+ }),
291
+ /* @__PURE__ */ v("p", {
292
+ className: "text-xs text-text-secondary",
293
+ children: g("botlit.settings.form.integrationDescription", "Create a connection in the Integrations module, then paste the Connection ID here. This stores your API key securely in the Integrations vault.")
294
+ }),
295
+ /* @__PURE__ */ v("div", {
296
+ className: "flex gap-2 mt-2",
297
+ children: /* @__PURE__ */ y(s, {
298
+ variant: "outline",
299
+ size: "sm",
300
+ onClick: () => {
301
+ window.open("/integrations/connections", "_blank");
302
+ },
303
+ children: [/* @__PURE__ */ v(x, {
304
+ size: 14,
305
+ className: "mr-1.5"
306
+ }), g("botlit.settings.form.openIntegrations", "Open Integrations")]
307
+ })
308
+ })
309
+ ]
310
+ })]
311
+ })
312
+ }), /* @__PURE__ */ v(m, {
313
+ label: g("botlit.settings.form.connectionIdPlaceholder", "Connection ID"),
314
+ children: /* @__PURE__ */ v(h, {
315
+ placeholder: g("botlit.settings.form.connectionIdPlaceholder", "Paste connection ID from Integrations..."),
316
+ value: J,
317
+ onChange: (e) => Y(e.target.value)
318
+ })
319
+ })]
320
+ }),
321
+ K === "apikey" && /* @__PURE__ */ v(m, {
322
+ label: g("botlit.settings.form.apiKeyLabel", "API Key"),
323
+ children: /* @__PURE__ */ v(h, {
324
+ type: "password",
325
+ placeholder: g("botlit.settings.form.apiKeyPlaceholder", "sk-..."),
326
+ value: R,
327
+ onChange: (e) => z(e.target.value)
307
328
  })
308
- })]
309
- }),
310
- K === "apikey" && /* @__PURE__ */ v(p, {
311
- label: h("botlit.settings.form.apiKeyLabel", "API Key"),
312
- children: /* @__PURE__ */ v(m, {
313
- type: "password",
314
- placeholder: h("botlit.settings.form.apiKeyPlaceholder", "sk-..."),
315
- value: R,
316
- onChange: (e) => z(e.target.value)
329
+ }),
330
+ /* @__PURE__ */ y("div", {
331
+ className: "flex gap-2",
332
+ children: [/* @__PURE__ */ v(s, {
333
+ leftIcon: /* @__PURE__ */ v(w, { size: 16 }),
334
+ isLoading: re,
335
+ disabled: Q && !ie || ($ ? !1 : K === "apikey" ? !R.trim() : !J.trim()),
336
+ onClick: async () => {
337
+ try {
338
+ let e = H.charAt(0).toUpperCase() + H.slice(1), t = K === "apikey" && R ? { apiKey: R } : void 0, n = K === "integration" ? J : null, r = E?.find((e) => e.id === W)?.metadata ?? {}, i = Q ? {
339
+ ...r,
340
+ region: X.trim(),
341
+ awsAuthentication: $ ? "iam" : "credentials"
342
+ } : r;
343
+ W ? await j({
344
+ name: e,
345
+ type: D(H),
346
+ connectionId: n,
347
+ credentials: t,
348
+ metadata: i,
349
+ isActive: B
350
+ }, W) : await j({
351
+ name: e,
352
+ type: D(H),
353
+ connectionId: n,
354
+ credentials: t,
355
+ metadata: i
356
+ }), z(""), Y(""), G(null), await O();
357
+ let a = H.charAt(0).toUpperCase() + H.slice(1);
358
+ T.success(W ? g("botlit.settings.form.updateSuccess", "{{provider}} provider updated successfully", { provider: a }) : g("botlit.settings.form.addSuccess", "{{provider}} provider added successfully", { provider: a }));
359
+ } catch (e) {
360
+ let t = e instanceof Error ? e.message : g("botlit.settings.form.saveError", "Failed to save provider");
361
+ T.error(t);
362
+ }
363
+ },
364
+ children: W ? g("botlit.settings.form.updateProvider", "Update Provider") : g("botlit.settings.form.saveProvider", "Save Provider")
365
+ }), W && /* @__PURE__ */ v(s, {
366
+ variant: "outline",
367
+ onClick: () => {
368
+ G(null), z(""), Y(""), q("apikey"), U("openai");
369
+ },
370
+ children: g("botlit.settings.form.cancel", "Cancel")
371
+ })]
317
372
  })
318
- }),
319
- /* @__PURE__ */ y("div", {
320
- className: "flex gap-2",
321
- children: [/* @__PURE__ */ v(d, {
322
- leftIcon: /* @__PURE__ */ v(w, { size: 16 }),
323
- isLoading: M,
324
- disabled: Q && !ne || ($ ? !1 : K === "apikey" ? !R.trim() : !J.trim()),
325
- onClick: async () => {
326
- try {
327
- let e = H.charAt(0).toUpperCase() + H.slice(1), t = K === "apikey" && R ? { apiKey: R } : void 0, n = K === "integration" ? J : null, r = E?.find((e) => e.id === W)?.metadata ?? {}, i = Q ? {
328
- ...r,
329
- region: X.trim(),
330
- awsAuthentication: $ ? "iam" : "credentials"
331
- } : r;
332
- W ? await j({
333
- name: e,
334
- type: D(H),
335
- connectionId: n,
336
- credentials: t,
337
- metadata: i,
338
- isActive: B
339
- }, W) : await j({
340
- name: e,
341
- type: D(H),
342
- connectionId: n,
343
- credentials: t,
344
- metadata: i
345
- }), z(""), Y(""), G(null), await O();
346
- let a = H.charAt(0).toUpperCase() + H.slice(1);
347
- T.success(W ? h("botlit.settings.form.updateSuccess", "{{provider}} provider updated successfully", { provider: a }) : h("botlit.settings.form.addSuccess", "{{provider}} provider added successfully", { provider: a }));
348
- } catch (e) {
349
- let t = e instanceof Error ? e.message : h("botlit.settings.form.saveError", "Failed to save provider");
350
- T.error(t);
351
- }
352
- },
353
- children: W ? h("botlit.settings.form.updateProvider", "Update Provider") : h("botlit.settings.form.saveProvider", "Save Provider")
354
- }), W && /* @__PURE__ */ v(d, {
355
- variant: "outline",
356
- onClick: () => {
357
- G(null), z(""), Y(""), q("apikey"), U("openai");
358
- },
359
- children: h("botlit.settings.form.cancel", "Cancel")
360
- })]
361
- })
362
- ]
363
- })]
373
+ ]
374
+ })]
375
+ })
364
376
  })
365
377
  ]
366
378
  })