@burdenoff/microfe-botmanor 2026.1118.4 → 2026.1118.6

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 (36) hide show
  1. package/dist/botlit/components/ChannelSetupPanels.d.ts +21 -0
  2. package/dist/botlit/components/ChannelSetupPanels.js +139 -0
  3. package/dist/botlit/components/ChannelSetupPanels.js.map +1 -0
  4. package/dist/botlit/hooks/index.d.ts +3 -1
  5. package/dist/botlit/hooks/index.js +13 -12
  6. package/dist/botlit/hooks/useChannelSetup.d.ts +96 -0
  7. package/dist/botlit/hooks/useChannelSetup.js +199 -0
  8. package/dist/botlit/hooks/useChannelSetup.js.map +1 -0
  9. package/dist/botlit/hooks/useChannels.d.ts +6 -0
  10. package/dist/botlit/hooks/useChannels.js +80 -58
  11. package/dist/botlit/hooks/useChannels.js.map +1 -1
  12. package/dist/botlit/hooks/useUserPlatformConnection.d.ts +1 -0
  13. package/dist/botlit/hooks/useUserPlatformConnection.js +1 -0
  14. package/dist/botlit/hooks/useUserPlatformConnection.js.map +1 -1
  15. package/dist/botlit/pages/AgentDetailPage.js +50 -38
  16. package/dist/botlit/pages/AgentDetailPage.js.map +1 -1
  17. package/dist/botlit/pages/BotChannelsTab.js +204 -186
  18. package/dist/botlit/pages/BotChannelsTab.js.map +1 -1
  19. package/dist/botlit/pages/ChannelDetailPage.js +658 -526
  20. package/dist/botlit/pages/ChannelDetailPage.js.map +1 -1
  21. package/dist/botlit/pages/ChannelsPage.js +2 -1
  22. package/dist/botlit/pages/ChannelsPage.js.map +1 -1
  23. package/dist/botlit/pages/ChatPage.js +76 -36
  24. package/dist/botlit/pages/ChatPage.js.map +1 -1
  25. package/dist/botlit/pages/PolicyDetailPage.js +763 -743
  26. package/dist/botlit/pages/PolicyDetailPage.js.map +1 -1
  27. package/dist/botlit/providers/BotlitProvider.js +39 -35
  28. package/dist/botlit/providers/BotlitProvider.js.map +1 -1
  29. package/dist/botlit/types/index.d.ts +2 -0
  30. package/dist/botlit/utils/channelConnectors.d.ts +16 -0
  31. package/dist/botlit/utils/channelConnectors.js +24 -0
  32. package/dist/botlit/utils/channelConnectors.js.map +1 -0
  33. package/dist/botlit/utils/policyConfig.d.ts +8 -0
  34. package/dist/botlit/utils/policyConfig.js +97 -1
  35. package/dist/botlit/utils/policyConfig.js.map +1 -1
  36. package/package.json +1 -1
@@ -12,17 +12,17 @@ import { Badge as ee, StatusBadge as te } from "../components/Badge.js";
12
12
  import "../hooks/index.js";
13
13
  import { formatRelativeTime as v } from "../utils/formatters.js";
14
14
  import { useCreatePolicy as ne, useDeletePolicy as re, usePolicy as ie, useUpdatePolicy as ae } from "../hooks/usePolicies.js";
15
- import { toUnion as oe } from "../utils/unions.js";
16
- import { A2A_TRUST_LEVELS as se, CITATION_MODES as ce, CREATABLE_POLICY_TYPES as le, EMPTY_POLICY_FORM as ue, KNOWLEDGE_CLASSIFICATIONS as de, PII_MASK_TYPES as fe, RESPONSE_FORMALITY_LEVELS as pe, RESPONSE_STRUCTURES as me, TOOL_RISK_LEVELS as he, buildPolicyConfig as ge, isCreatablePolicyType as _e, unenforcedConfigKeys as ve } from "../utils/policyConfig.js";
15
+ import { toUnion as y } from "../utils/unions.js";
16
+ import { A2A_TRUST_LEVELS as oe, CITATION_MODES as se, CREATABLE_POLICY_TYPES as ce, EMPTY_POLICY_FORM as le, KNOWLEDGE_CLASSIFICATIONS as ue, PII_MASK_TYPES as de, RESPONSE_FORMALITY_LEVELS as fe, RESPONSE_STRUCTURES as pe, TOOL_RISK_LEVELS as me, buildPolicyConfig as he, isCreatablePolicyType as b, policyFormFromConfig as ge, unenforcedConfigKeys as _e } from "../utils/policyConfig.js";
17
17
  import "../permissions/index.js";
18
- import { useState as y } from "react";
19
- import { PagePurpose as ye } from "@burdenoff/fe-libs/ui";
20
- import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
21
- import { useParams as be } from "react-router";
22
- import { AlertTriangle as C, ArrowLeft as xe, Clock as w, Database as T, DollarSign as E, Edit as Se, FileText as D, Power as Ce, Save as O, Settings as we, Shield as k, Trash2 as A, Wrench as j } from "lucide-react";
18
+ import { useState as x } from "react";
19
+ import { PagePurpose as ve } from "@burdenoff/fe-libs/ui";
20
+ import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
21
+ import { useParams as ye } from "react-router";
22
+ import { AlertTriangle as T, ArrowLeft as be, Clock as E, Database as D, DollarSign as O, Edit as xe, FileText as k, Power as Se, Save as A, Settings as Ce, Shield as we, Trash2 as j, Wrench as Te } from "lucide-react";
23
23
  import { toast as M } from "sonner";
24
24
  // src/botlit/pages/PolicyDetailPage.tsx
25
- var Te = [
25
+ var N = [
26
26
  "CONTENT",
27
27
  "TOOL",
28
28
  "DATA",
@@ -34,15 +34,15 @@ var Te = [
34
34
  "PRIVATE",
35
35
  "WORKSPACE",
36
36
  "PUBLIC"
37
- ], N = "flex h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm", P = ({ type: e }) => ({
38
- CONTENT: /* @__PURE__ */ x(C, { size: 18 }),
39
- TOOL: /* @__PURE__ */ x(j, { size: 18 }),
40
- DATA: /* @__PURE__ */ x(T, { size: 18 }),
41
- RESPONSE: /* @__PURE__ */ x(D, { size: 18 }),
42
- BUDGET: /* @__PURE__ */ x(E, { size: 18 }),
43
- RATE_LIMIT: /* @__PURE__ */ x(w, { size: 18 }),
44
- RETENTION: /* @__PURE__ */ x(A, { size: 18 })
45
- })[e] || /* @__PURE__ */ x(k, { size: 18 }), De = {
37
+ ], P = "flex h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm", De = ({ type: e }) => ({
38
+ CONTENT: /* @__PURE__ */ C(T, { size: 18 }),
39
+ TOOL: /* @__PURE__ */ C(Te, { size: 18 }),
40
+ DATA: /* @__PURE__ */ C(D, { size: 18 }),
41
+ RESPONSE: /* @__PURE__ */ C(k, { size: 18 }),
42
+ BUDGET: /* @__PURE__ */ C(O, { size: 18 }),
43
+ RATE_LIMIT: /* @__PURE__ */ C(E, { size: 18 }),
44
+ RETENTION: /* @__PURE__ */ C(j, { size: 18 })
45
+ })[e] || /* @__PURE__ */ C(we, { size: 18 }), Oe = {
46
46
  EMAIL: "Email addresses",
47
47
  PHONE: "Phone numbers",
48
48
  CREDIT_CARD: "Card numbers",
@@ -52,47 +52,47 @@ var Te = [
52
52
  function F(e, t, n) {
53
53
  return n ? [...e.filter((e) => e !== t), t] : e.filter((e) => e !== t);
54
54
  }
55
- var I = ({ value: e, onChange: n }) => {
55
+ var ke = ({ value: e, onChange: n }) => {
56
56
  let { data: r, loading: i, error: a, refetch: o, hasMore: s, loadingMore: c, loadMore: l } = t();
57
- return /* @__PURE__ */ x(h, {
57
+ return /* @__PURE__ */ C(h, {
58
58
  label: "Apply To Agents",
59
59
  description: "Leave all unchecked to apply this policy to every agent in the workspace.",
60
- children: /* @__PURE__ */ S("div", {
60
+ children: /* @__PURE__ */ w("div", {
61
61
  className: "max-h-48 overflow-auto rounded-md border border-border-default p-2 space-y-1",
62
62
  children: [
63
- a && r.length === 0 ? /* @__PURE__ */ S("div", {
63
+ a && r.length === 0 ? /* @__PURE__ */ w("div", {
64
64
  className: "space-y-2",
65
65
  role: "alert",
66
- children: [/* @__PURE__ */ x("p", {
66
+ children: [/* @__PURE__ */ C("p", {
67
67
  className: "text-sm text-status-error-text",
68
68
  children: "Agents could not be loaded, so this policy cannot be limited to agents right now. Saving it as is applies it to every agent in the workspace."
69
- }), /* @__PURE__ */ x(m, {
69
+ }), /* @__PURE__ */ C(m, {
70
70
  variant: "outline",
71
71
  size: "sm",
72
72
  onClick: () => void o(),
73
73
  children: "Retry"
74
74
  })]
75
- }) : i && r.length === 0 ? /* @__PURE__ */ x("p", {
75
+ }) : i && r.length === 0 ? /* @__PURE__ */ C("p", {
76
76
  className: "text-sm text-text-secondary",
77
77
  children: "Loading agents…"
78
- }) : r.length === 0 ? /* @__PURE__ */ x("p", {
78
+ }) : r.length === 0 ? /* @__PURE__ */ C("p", {
79
79
  className: "text-sm text-text-secondary",
80
80
  children: "No agents in this workspace yet."
81
- }) : r.map((t) => /* @__PURE__ */ S("label", {
81
+ }) : r.map((t) => /* @__PURE__ */ w("label", {
82
82
  className: "flex items-center gap-2 text-sm",
83
- children: [/* @__PURE__ */ x("input", {
83
+ children: [/* @__PURE__ */ C("input", {
84
84
  type: "checkbox",
85
85
  className: "h-4 w-4",
86
86
  checked: e.includes(t.id),
87
87
  onChange: (r) => n(F(e, t.id, r.target.checked))
88
- }), /* @__PURE__ */ x("span", { children: t.name })]
88
+ }), /* @__PURE__ */ C("span", { children: t.name })]
89
89
  }, t.id)),
90
- a && r.length > 0 && /* @__PURE__ */ x("p", {
90
+ a && r.length > 0 && /* @__PURE__ */ C("p", {
91
91
  className: "text-sm text-status-error-text",
92
92
  role: "alert",
93
93
  children: "More agents could not be loaded; the list above is incomplete."
94
94
  }),
95
- s && /* @__PURE__ */ x(m, {
95
+ s && /* @__PURE__ */ C(m, {
96
96
  variant: "ghost",
97
97
  size: "sm",
98
98
  onClick: () => void l(),
@@ -103,7 +103,7 @@ var I = ({ value: e, onChange: n }) => {
103
103
  ]
104
104
  })
105
105
  });
106
- }, L = {
106
+ }, I = {
107
107
  CONTENT: "Content Policy",
108
108
  TOOL: "Tool Policy",
109
109
  DATA: "Data Policy",
@@ -111,173 +111,692 @@ var I = ({ value: e, onChange: n }) => {
111
111
  BUDGET: "Budget Policy",
112
112
  RATE_LIMIT: "Rate Limit Policy",
113
113
  RETENTION: "Retention Policy"
114
- }, R = ({ isNew: t }) => {
115
- let { policyId: R } = be(), { navigateTo: z } = e(), { data: B, loading: Oe, refetch: V } = ie(t ? void 0 : R), { create: ke, loading: Ae } = ne(), { update: je, loading: Me } = ae(), { remove: Ne, loading: Pe } = re(), [Fe, H] = y(!1), [Ie, Le] = y(!1), [U, W] = y({
114
+ }, L = ({ isNew: t }) => {
115
+ let { policyId: L } = ye(), { navigateTo: R } = e(), { data: z, loading: Ae, refetch: je } = ie(t ? void 0 : L), { create: Me, loading: Ne } = ne(), { update: Pe, loading: Fe } = ae(), { remove: Ie, loading: Le } = re(), [B, V] = x(!1), [Re, ze] = x(!1), [H, U] = x({
116
116
  name: "",
117
117
  description: "",
118
118
  type: "CONTENT",
119
119
  visibility: "PRIVATE"
120
- }), [G, K] = y({
120
+ }), [W, G] = x({
121
121
  name: "",
122
122
  description: "",
123
123
  visibility: "PRIVATE"
124
- }), [q, J] = y(ue), [Re, Y] = y(null), X = (e, t) => {
125
- Y(null), J((n) => ({
124
+ }), [K, q] = x(le), [J, Y] = x(null), [Be, Ve] = x(null), X = (e, t) => {
125
+ Y(null), q((n) => ({
126
126
  ...n,
127
127
  [e]: {
128
128
  ...n[e],
129
129
  ...t
130
130
  }
131
131
  }));
132
- }, [ze, Be] = y(!1), Ve = async () => {
133
- if (!U.name) return;
134
- let e = ge(U.type, q);
132
+ }, [He, Ue] = x(!1), We = async () => {
133
+ if (!H.name) return;
134
+ let e = he(H.type, K);
135
135
  if (!e.ok) Y(e.error), M.error(e.error);
136
136
  else {
137
137
  try {
138
- await ke({
139
- name: U.name,
140
- description: U.description,
141
- type: U.type,
142
- visibility: U.visibility,
143
- status: ze ? "ACTIVE" : "DRAFT",
138
+ await Me({
139
+ name: H.name,
140
+ description: H.description,
141
+ type: H.type,
142
+ visibility: H.visibility,
143
+ status: He ? "ACTIVE" : "DRAFT",
144
144
  config: e.config
145
145
  });
146
146
  } catch (e) {
147
147
  M.error(e instanceof Error ? e.message : "Failed to create policy");
148
148
  return;
149
149
  }
150
- M.success(`Policy "${U.name}" created`), z("policies");
150
+ M.success(`Policy "${H.name}" created`), R("policies");
151
151
  }
152
- }, He = async () => {
153
- if (R && G.name) {
154
- try {
155
- await je({
156
- policyId: R,
157
- input: {
158
- name: G.name,
159
- description: G.description,
160
- visibility: G.visibility
161
- }
162
- });
163
- } catch (e) {
164
- M.error(e instanceof Error ? e.message : "Failed to update policy");
152
+ }, Ge = async () => {
153
+ if (!L || !z || !W.name) return;
154
+ let e = N.find((e) => e === z.type), t, n = JSON.stringify(K) !== JSON.stringify(Be);
155
+ if (e && b(e) && n) {
156
+ let n = he(e, K);
157
+ if (!n.ok) {
158
+ Y(n.error), M.error(n.error);
165
159
  return;
166
160
  }
167
- await V(), M.success("Policy updated"), H(!1);
161
+ t = n.config;
162
+ }
163
+ try {
164
+ await Pe({
165
+ policyId: L,
166
+ input: {
167
+ name: W.name,
168
+ description: W.description,
169
+ visibility: W.visibility,
170
+ ...t ? { config: t } : {}
171
+ }
172
+ });
173
+ } catch (e) {
174
+ M.error(e instanceof Error ? e.message : "Failed to update policy");
175
+ return;
168
176
  }
169
- }, Ue = async () => {
170
- if (R) try {
171
- await Ne(R), n() && i("success"), z("policies");
177
+ await je(), M.success("Policy updated"), V(!1);
178
+ }, Ke = async () => {
179
+ if (L) try {
180
+ await Ie(L), n() && i("success"), R("policies");
172
181
  } catch (e) {
173
182
  throw n() && i("error"), e;
174
183
  }
175
- }, Z = B?.status === "ACTIVE", We = async () => {
176
- if (!R) return;
184
+ }, Z = z?.status === "ACTIVE", qe = async () => {
185
+ if (!L) return;
177
186
  let e = Z ? "DRAFT" : "ACTIVE";
178
187
  try {
179
- await je({
180
- policyId: R,
188
+ await Pe({
189
+ policyId: L,
181
190
  input: { status: e }
182
191
  });
183
192
  } catch (e) {
184
193
  M.error(e instanceof Error ? e.message : "Failed to update policy");
185
194
  return;
186
195
  }
187
- await V(), M.success(e === "ACTIVE" ? "Policy is now enforced" : "Policy is no longer enforced");
188
- }, Ge = () => {
189
- B && (K({
190
- name: B.name,
191
- description: B.description || "",
192
- visibility: oe(B.visibility, Ee, "PRIVATE")
193
- }), H(!0));
196
+ await je(), M.success(e === "ACTIVE" ? "Policy is now enforced" : "Policy is no longer enforced");
197
+ }, Je = (e) => /* @__PURE__ */ w(S, { children: [
198
+ e === "CONTENT" && /* @__PURE__ */ w(l, { children: [/* @__PURE__ */ w(f, { children: [/* @__PURE__ */ w(p, {
199
+ className: "flex items-center gap-2",
200
+ children: [/* @__PURE__ */ C(T, { size: 18 }), "Content Policy Configuration"]
201
+ }), /* @__PURE__ */ C(d, { children: "Checked against every message sent to an agent and every response it gives. A blocked message is refused; a blocked response is replaced with a refusal." })] }), /* @__PURE__ */ w(u, {
202
+ className: "space-y-4",
203
+ children: [
204
+ /* @__PURE__ */ w("div", {
205
+ className: "flex items-start gap-2",
206
+ children: [/* @__PURE__ */ C("input", {
207
+ type: "checkbox",
208
+ id: "pii",
209
+ checked: K.content.piiDetection,
210
+ onChange: (e) => X("content", { piiDetection: e.target.checked }),
211
+ className: "mt-1 h-4 w-4"
212
+ }), /* @__PURE__ */ w("label", {
213
+ htmlFor: "pii",
214
+ className: "text-sm",
215
+ children: [/* @__PURE__ */ C("span", {
216
+ className: "font-medium",
217
+ children: "PII Detection"
218
+ }), /* @__PURE__ */ C("span", {
219
+ className: "block text-text-secondary",
220
+ children: "Blocks text containing an email address, a US SSN or a card-number shaped digit run."
221
+ })]
222
+ })]
223
+ }),
224
+ /* @__PURE__ */ C(h, {
225
+ label: "Blocked Keywords",
226
+ description: "Comma-separated. Case-insensitive; any occurrence blocks the text.",
227
+ children: /* @__PURE__ */ C(g, {
228
+ placeholder: "e.g., internal-only, project-x",
229
+ value: K.content.blockedKeywords,
230
+ onChange: (e) => X("content", { blockedKeywords: e.target.value })
231
+ })
232
+ }),
233
+ /* @__PURE__ */ C(h, {
234
+ label: "Blocked Patterns",
235
+ description: "One regular expression per line, matched case-insensitively.",
236
+ children: /* @__PURE__ */ C(_, {
237
+ placeholder: "e.g., \\bACME-\\d{6}\\b",
238
+ value: K.content.blockedPatterns,
239
+ onChange: (e) => X("content", { blockedPatterns: e.target.value }),
240
+ rows: 3
241
+ })
242
+ })
243
+ ]
244
+ })] }),
245
+ e === "TOOL" && /* @__PURE__ */ w(l, { children: [/* @__PURE__ */ w(f, { children: [/* @__PURE__ */ w(p, {
246
+ className: "flex items-center gap-2",
247
+ children: [/* @__PURE__ */ C(Te, { size: 18 }), "Tool Policy Configuration"]
248
+ }), /* @__PURE__ */ C(d, { children: "Applies to MCP tool calls made by agents and through Call Tool, and to agent delegation. Leave a field empty to not restrict it." })] }), /* @__PURE__ */ w(u, {
249
+ className: "space-y-4",
250
+ children: [
251
+ /* @__PURE__ */ C(h, {
252
+ label: "Allowed Tools",
253
+ description: "Comma-separated MCP tool names. End an entry with * to allow a prefix. Empty allows every tool.",
254
+ children: /* @__PURE__ */ C(g, {
255
+ placeholder: "e.g., search, read_*",
256
+ value: K.tool.allowedTools,
257
+ onChange: (e) => X("tool", { allowedTools: e.target.value })
258
+ })
259
+ }),
260
+ /* @__PURE__ */ C(h, {
261
+ label: "Denied Tools",
262
+ description: "Comma-separated MCP tool names that may never run. A deny always wins.",
263
+ children: /* @__PURE__ */ C(g, {
264
+ placeholder: "e.g., delete_*, execute_code",
265
+ value: K.tool.deniedTools,
266
+ onChange: (e) => X("tool", { deniedTools: e.target.value })
267
+ })
268
+ }),
269
+ /* @__PURE__ */ w("div", {
270
+ className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
271
+ children: [/* @__PURE__ */ C(h, {
272
+ label: "Max Tool Risk Level",
273
+ children: /* @__PURE__ */ w("select", {
274
+ className: P,
275
+ value: K.tool.maxToolRiskLevel,
276
+ onChange: (e) => X("tool", { maxToolRiskLevel: e.target.value }),
277
+ children: [/* @__PURE__ */ C("option", {
278
+ value: "",
279
+ children: "Any risk level"
280
+ }), me.map((e) => /* @__PURE__ */ w("option", {
281
+ value: e,
282
+ children: ["Up to ", e.toLowerCase()]
283
+ }, e))]
284
+ })
285
+ }), /* @__PURE__ */ C(h, {
286
+ label: "Minimum A2A Trust Level",
287
+ description: "For delegation to external registry agents.",
288
+ children: /* @__PURE__ */ w("select", {
289
+ className: P,
290
+ value: K.tool.a2aMinTrustLevel,
291
+ onChange: (e) => X("tool", { a2aMinTrustLevel: e.target.value }),
292
+ children: [/* @__PURE__ */ C("option", {
293
+ value: "",
294
+ children: "Default (verified publisher)"
295
+ }), oe.map((e) => /* @__PURE__ */ C("option", {
296
+ value: e,
297
+ children: e === "VERIFIED_PUBLISHER" ? "Verified publisher" : e.charAt(0) + e.slice(1).toLowerCase()
298
+ }, e))]
299
+ })
300
+ })]
301
+ }),
302
+ /* @__PURE__ */ w("div", {
303
+ className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
304
+ children: [/* @__PURE__ */ C(h, {
305
+ label: "Max Tool Calls Per Execution",
306
+ description: "Tool calls allowed in one agent turn.",
307
+ children: /* @__PURE__ */ C(g, {
308
+ type: "number",
309
+ min: 1,
310
+ placeholder: "No limit",
311
+ value: K.tool.maxCallsPerExecution,
312
+ onChange: (e) => X("tool", { maxCallsPerExecution: e.target.value })
313
+ })
314
+ }), /* @__PURE__ */ C(h, {
315
+ label: "Tool Call Timeout (seconds)",
316
+ description: "Can only shorten the platform's own timeout.",
317
+ children: /* @__PURE__ */ C(g, {
318
+ type: "number",
319
+ min: 1,
320
+ placeholder: "Platform default",
321
+ value: K.tool.timeoutSeconds,
322
+ onChange: (e) => X("tool", { timeoutSeconds: e.target.value })
323
+ })
324
+ })]
325
+ })
326
+ ]
327
+ })] }),
328
+ e === "BUDGET" && /* @__PURE__ */ w(l, { children: [/* @__PURE__ */ w(f, { children: [/* @__PURE__ */ w(p, {
329
+ className: "flex items-center gap-2",
330
+ children: [/* @__PURE__ */ C(O, { size: 18 }), "Budget Policy Configuration"]
331
+ }), /* @__PURE__ */ C(d, { children: "Token budgets apply per agent. Leave a field empty to not restrict it." })] }), /* @__PURE__ */ C(u, {
332
+ className: "space-y-4",
333
+ children: /* @__PURE__ */ w("div", {
334
+ className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
335
+ children: [/* @__PURE__ */ C(h, {
336
+ label: "Max Tokens Per Day",
337
+ description: "An agent that has used this many tokens today (UTC) is refused.",
338
+ children: /* @__PURE__ */ C(g, {
339
+ type: "number",
340
+ min: 1,
341
+ placeholder: "No limit",
342
+ value: K.budget.maxTokensPerDay,
343
+ onChange: (e) => X("budget", { maxTokensPerDay: e.target.value })
344
+ })
345
+ }), /* @__PURE__ */ C(h, {
346
+ label: "Max Output Tokens Per Model Call",
347
+ description: "Lowers the agent's own max-tokens setting when it is higher.",
348
+ children: /* @__PURE__ */ C(g, {
349
+ type: "number",
350
+ min: 1,
351
+ placeholder: "No limit",
352
+ value: K.budget.maxTokensPerExecution,
353
+ onChange: (e) => X("budget", { maxTokensPerExecution: e.target.value })
354
+ })
355
+ })]
356
+ })
357
+ })] }),
358
+ e === "RATE_LIMIT" && /* @__PURE__ */ w(l, { children: [/* @__PURE__ */ w(f, { children: [/* @__PURE__ */ w(p, {
359
+ className: "flex items-center gap-2",
360
+ children: [/* @__PURE__ */ C(E, { size: 18 }), "Rate Limit Configuration"]
361
+ }), /* @__PURE__ */ C(d, { children: "Every limit is counted per agent. Leave a field empty to not restrict it." })] }), /* @__PURE__ */ C(u, {
362
+ className: "space-y-4",
363
+ children: /* @__PURE__ */ w("div", {
364
+ className: "grid grid-cols-1 sm:grid-cols-3 gap-4",
365
+ children: [
366
+ /* @__PURE__ */ C(h, {
367
+ label: "Requests / Minute",
368
+ children: /* @__PURE__ */ C(g, {
369
+ type: "number",
370
+ min: 1,
371
+ placeholder: "No limit",
372
+ value: K.rateLimit.requestsPerMinute,
373
+ onChange: (e) => X("rateLimit", { requestsPerMinute: e.target.value })
374
+ })
375
+ }),
376
+ /* @__PURE__ */ C(h, {
377
+ label: "Requests / Hour",
378
+ children: /* @__PURE__ */ C(g, {
379
+ type: "number",
380
+ min: 1,
381
+ placeholder: "No limit",
382
+ value: K.rateLimit.requestsPerHour,
383
+ onChange: (e) => X("rateLimit", { requestsPerHour: e.target.value })
384
+ })
385
+ }),
386
+ /* @__PURE__ */ C(h, {
387
+ label: "Tokens / Minute",
388
+ children: /* @__PURE__ */ C(g, {
389
+ type: "number",
390
+ min: 1,
391
+ placeholder: "No limit",
392
+ value: K.rateLimit.tokensPerMinute,
393
+ onChange: (e) => X("rateLimit", { tokensPerMinute: e.target.value })
394
+ })
395
+ })
396
+ ]
397
+ })
398
+ })] }),
399
+ e === "RESPONSE" && /* @__PURE__ */ w(l, { children: [/* @__PURE__ */ w(f, { children: [/* @__PURE__ */ w(p, {
400
+ className: "flex items-center gap-2",
401
+ children: [/* @__PURE__ */ C(k, { size: 18 }), "Model Usage Allowlist"]
402
+ }), /* @__PURE__ */ C(d, { children: "Agents in this workspace may only answer with models that match every active model policy. Leave both fields empty to allow all models." })] }), /* @__PURE__ */ w(u, {
403
+ className: "space-y-4",
404
+ children: [/* @__PURE__ */ C(h, {
405
+ label: "Allowed Models",
406
+ description: "Comma-separated model IDs. End an entry with * to allow a prefix.",
407
+ children: /* @__PURE__ */ C(g, {
408
+ placeholder: "e.g., gpt-4o-mini, anthropic.claude-*",
409
+ value: K.response.allowedModels,
410
+ onChange: (e) => X("response", { allowedModels: e.target.value })
411
+ })
412
+ }), /* @__PURE__ */ C(h, {
413
+ label: "Allowed Providers",
414
+ description: "Comma-separated provider types, e.g. OPENAI, ANTHROPIC, AWS_BEDROCK.",
415
+ children: /* @__PURE__ */ C(g, {
416
+ placeholder: "e.g., AWS_BEDROCK, ANTHROPIC",
417
+ value: K.response.allowedProviders,
418
+ onChange: (e) => X("response", { allowedProviders: e.target.value })
419
+ })
420
+ })]
421
+ })] }),
422
+ e === "RESPONSE" && /* @__PURE__ */ w(l, { children: [/* @__PURE__ */ w(f, { children: [/* @__PURE__ */ w(p, {
423
+ className: "flex items-center gap-2",
424
+ children: [/* @__PURE__ */ C(k, { size: 18 }), "Response Style, Length And Citations"]
425
+ }), /* @__PURE__ */ C(d, { children: "Persona, tone, formality, structure and formatting are given to the model as instructions. The token limit caps every model call and longer answers are cut to the length limit. Leave a field empty to not set it." })] }), /* @__PURE__ */ w(u, {
426
+ className: "space-y-4",
427
+ children: [
428
+ /* @__PURE__ */ C(h, {
429
+ label: "Persona",
430
+ description: "Who the agent speaks as. Up to 2000 characters.",
431
+ children: /* @__PURE__ */ C(_, {
432
+ rows: 3,
433
+ maxLength: 2e3,
434
+ placeholder: "e.g., A patient support specialist for Acme Cloud",
435
+ value: K.response.persona,
436
+ onChange: (e) => X("response", { persona: e.target.value })
437
+ })
438
+ }),
439
+ /* @__PURE__ */ w("div", {
440
+ className: "grid grid-cols-1 sm:grid-cols-3 gap-4",
441
+ children: [
442
+ /* @__PURE__ */ C(h, {
443
+ label: "Tone",
444
+ children: /* @__PURE__ */ C(g, {
445
+ placeholder: "e.g., friendly, calm",
446
+ value: K.response.tone,
447
+ onChange: (e) => X("response", { tone: e.target.value })
448
+ })
449
+ }),
450
+ /* @__PURE__ */ C(h, {
451
+ label: "Formality",
452
+ children: /* @__PURE__ */ w("select", {
453
+ className: P,
454
+ value: K.response.formality,
455
+ onChange: (e) => X("response", { formality: e.target.value }),
456
+ children: [/* @__PURE__ */ C("option", {
457
+ value: "",
458
+ children: "Not set"
459
+ }), fe.map((e) => /* @__PURE__ */ C("option", {
460
+ value: e,
461
+ children: e.charAt(0) + e.slice(1).toLowerCase()
462
+ }, e))]
463
+ })
464
+ }),
465
+ /* @__PURE__ */ C(h, {
466
+ label: "Structure",
467
+ children: /* @__PURE__ */ w("select", {
468
+ className: P,
469
+ value: K.response.structure,
470
+ onChange: (e) => X("response", { structure: e.target.value }),
471
+ children: [/* @__PURE__ */ C("option", {
472
+ value: "",
473
+ children: "Not set"
474
+ }), pe.map((e) => /* @__PURE__ */ C("option", {
475
+ value: e,
476
+ children: e.split("_").map((e) => e.charAt(0) + e.slice(1).toLowerCase()).join(" ")
477
+ }, e))]
478
+ })
479
+ })
480
+ ]
481
+ }),
482
+ /* @__PURE__ */ C(h, {
483
+ label: "Formatting Instructions",
484
+ children: /* @__PURE__ */ C(g, {
485
+ placeholder: "e.g., End every answer with a one-line summary",
486
+ value: K.response.formattingInstructions,
487
+ onChange: (e) => X("response", { formattingInstructions: e.target.value })
488
+ })
489
+ }),
490
+ /* @__PURE__ */ w("div", {
491
+ className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
492
+ children: [/* @__PURE__ */ C(h, {
493
+ label: "Max Response Tokens",
494
+ description: "Caps the output tokens of every model call.",
495
+ children: /* @__PURE__ */ C(g, {
496
+ type: "number",
497
+ min: 1,
498
+ placeholder: "No limit",
499
+ value: K.response.maxResponseTokens,
500
+ onChange: (e) => X("response", { maxResponseTokens: e.target.value })
501
+ })
502
+ }), /* @__PURE__ */ C(h, {
503
+ label: "Max Response Length (characters)",
504
+ description: "Longer answers are cut at a word boundary.",
505
+ children: /* @__PURE__ */ C(g, {
506
+ type: "number",
507
+ min: 1,
508
+ placeholder: "No limit",
509
+ value: K.response.maxResponseLength,
510
+ onChange: (e) => X("response", { maxResponseLength: e.target.value })
511
+ })
512
+ })]
513
+ }),
514
+ /* @__PURE__ */ w("div", {
515
+ className: "flex items-start gap-2",
516
+ children: [/* @__PURE__ */ C("input", {
517
+ type: "checkbox",
518
+ id: "require-citations",
519
+ checked: K.response.requireCitations,
520
+ onChange: (e) => X("response", { requireCitations: e.target.checked }),
521
+ className: "mt-1 h-4 w-4"
522
+ }), /* @__PURE__ */ w("label", {
523
+ htmlFor: "require-citations",
524
+ className: "text-sm",
525
+ children: [/* @__PURE__ */ C("span", {
526
+ className: "font-medium",
527
+ children: "Require citations"
528
+ }), /* @__PURE__ */ C("span", {
529
+ className: "block text-text-secondary",
530
+ children: "When knowledge-base passages ground an answer and the answer cites none of them, either add the passage references or refuse the answer."
531
+ })]
532
+ })]
533
+ }),
534
+ K.response.requireCitations && /* @__PURE__ */ C(h, {
535
+ label: "When Citations Are Missing",
536
+ children: /* @__PURE__ */ C("select", {
537
+ className: P,
538
+ value: K.response.citationMode,
539
+ onChange: (e) => X("response", { citationMode: e.target.value }),
540
+ children: se.map((e) => /* @__PURE__ */ C("option", {
541
+ value: e,
542
+ children: e === "APPEND" ? "Add the source references" : "Refuse the answer"
543
+ }, e))
544
+ })
545
+ }),
546
+ /* @__PURE__ */ C(ke, {
547
+ value: K.appliesToAgentIds,
548
+ onChange: (e) => {
549
+ Y(null), q((t) => ({
550
+ ...t,
551
+ appliesToAgentIds: e
552
+ }));
553
+ }
554
+ })
555
+ ]
556
+ })] }),
557
+ e === "DATA" && /* @__PURE__ */ w(l, { children: [/* @__PURE__ */ w(f, { children: [/* @__PURE__ */ w(p, {
558
+ className: "flex items-center gap-2",
559
+ children: [/* @__PURE__ */ C(D, { size: 18 }), "Data Policy Configuration"]
560
+ }), /* @__PURE__ */ C(d, { children: "Masked values are replaced before any model, tool or log sees them. Provider, region, tool and agent rules refuse a turn that would share data outside them." })] }), /* @__PURE__ */ w(u, {
561
+ className: "space-y-4",
562
+ children: [
563
+ /* @__PURE__ */ C(h, {
564
+ label: "Mask",
565
+ children: /* @__PURE__ */ C("div", {
566
+ className: "grid grid-cols-1 sm:grid-cols-2 gap-1",
567
+ children: de.map((e) => /* @__PURE__ */ w("label", {
568
+ className: "flex items-center gap-2 text-sm",
569
+ children: [/* @__PURE__ */ C("input", {
570
+ type: "checkbox",
571
+ className: "h-4 w-4",
572
+ checked: K.data.maskPii.includes(e),
573
+ onChange: (t) => X("data", { maskPii: F(K.data.maskPii, e, t.target.checked) })
574
+ }), /* @__PURE__ */ C("span", { children: Oe[e] })]
575
+ }, e))
576
+ })
577
+ }),
578
+ /* @__PURE__ */ C(h, {
579
+ label: "Custom Masking Patterns",
580
+ description: "One regular expression per line; matches are replaced with [REDACTED].",
581
+ children: /* @__PURE__ */ C(_, {
582
+ rows: 3,
583
+ placeholder: "e.g., EMP-\\d{5}",
584
+ value: K.data.maskPatterns,
585
+ onChange: (e) => X("data", { maskPatterns: e.target.value })
586
+ })
587
+ }),
588
+ /* @__PURE__ */ C(h, {
589
+ label: "Allowed Regions",
590
+ description: "Comma-separated regions a model provider may process data in; end an entry with * for a prefix. A provider whose region is not recorded is refused.",
591
+ children: /* @__PURE__ */ C(g, {
592
+ placeholder: "e.g., ap-south-1, eu-*",
593
+ value: K.data.allowedRegions,
594
+ onChange: (e) => X("data", { allowedRegions: e.target.value })
595
+ })
596
+ }),
597
+ [
598
+ [
599
+ "restrictProviders",
600
+ "allowedProviders",
601
+ "model providers",
602
+ "e.g., AWS_BEDROCK"
603
+ ],
604
+ [
605
+ "restrictMcpServers",
606
+ "allowedMcpServers",
607
+ "MCP servers",
608
+ "Connection name, id or host"
609
+ ],
610
+ [
611
+ "restrictA2AAgents",
612
+ "allowedA2AAgents",
613
+ "agents to delegate to",
614
+ "Agent name or id"
615
+ ]
616
+ ].map(([e, t, n, r]) => /* @__PURE__ */ w("div", {
617
+ className: "space-y-2",
618
+ children: [/* @__PURE__ */ w("label", {
619
+ className: "flex items-center gap-2 text-sm",
620
+ children: [/* @__PURE__ */ C("input", {
621
+ type: "checkbox",
622
+ className: "h-4 w-4",
623
+ checked: K.data[e],
624
+ onChange: (t) => X("data", { [e]: t.target.checked })
625
+ }), /* @__PURE__ */ w("span", {
626
+ className: "font-medium",
627
+ children: ["Only share with these ", n]
628
+ })]
629
+ }), K.data[e] && /* @__PURE__ */ C(g, {
630
+ "aria-label": `Allowed ${n}`,
631
+ placeholder: `${r}; comma-separated, empty = none`,
632
+ value: K.data[t],
633
+ onChange: (e) => X("data", { [t]: e.target.value })
634
+ })]
635
+ }, e)),
636
+ /* @__PURE__ */ C(h, {
637
+ label: "Allowed Knowledge Classifications",
638
+ description: "Knowledge bases are classified by metadata.classification. Leave all unchecked to not restrict retrieval.",
639
+ children: /* @__PURE__ */ C("div", {
640
+ className: "grid grid-cols-1 sm:grid-cols-3 gap-1",
641
+ children: ue.map((e) => /* @__PURE__ */ w("label", {
642
+ className: "flex items-center gap-2 text-sm",
643
+ children: [/* @__PURE__ */ C("input", {
644
+ type: "checkbox",
645
+ className: "h-4 w-4",
646
+ checked: K.data.allowedClassifications.includes(e),
647
+ onChange: (t) => X("data", { allowedClassifications: F(K.data.allowedClassifications, e, t.target.checked) })
648
+ }), /* @__PURE__ */ C("span", { children: e.charAt(0) + e.slice(1).toLowerCase() })]
649
+ }, e))
650
+ })
651
+ }),
652
+ /* @__PURE__ */ C(h, {
653
+ label: "Blocked Knowledge Labels",
654
+ description: "Comma-separated; knowledge bases with any of these labels (metadata.labels) are never retrieved.",
655
+ children: /* @__PURE__ */ C(g, {
656
+ placeholder: "e.g., hr, legal",
657
+ value: K.data.blockedLabels,
658
+ onChange: (e) => X("data", { blockedLabels: e.target.value })
659
+ })
660
+ }),
661
+ /* @__PURE__ */ C(ke, {
662
+ value: K.appliesToAgentIds,
663
+ onChange: (e) => {
664
+ Y(null), q((t) => ({
665
+ ...t,
666
+ appliesToAgentIds: e
667
+ }));
668
+ }
669
+ })
670
+ ]
671
+ })] }),
672
+ e === "RETENTION" && /* @__PURE__ */ w(l, { children: [/* @__PURE__ */ w(f, { children: [/* @__PURE__ */ w(p, {
673
+ className: "flex items-center gap-2",
674
+ children: [/* @__PURE__ */ C(j, { size: 18 }), "Retention Policy Configuration"]
675
+ }), /* @__PURE__ */ C(d, { children: "A scheduled job erases content older than these periods every hour. With several active retention policies the shortest period applies. Leave a field empty to keep that content for the life of the workspace." })] }), /* @__PURE__ */ C(u, {
676
+ className: "space-y-4",
677
+ children: /* @__PURE__ */ w("div", {
678
+ className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
679
+ children: [/* @__PURE__ */ C(h, {
680
+ label: "Execution Data Retention (days)",
681
+ description: "Inputs, outputs and errors of finished runs and agent-to-agent messages are erased this many days after the run ended; 0 keeps none. Run metrics stay.",
682
+ children: /* @__PURE__ */ C(g, {
683
+ type: "number",
684
+ min: 0,
685
+ max: 3650,
686
+ placeholder: "Keep",
687
+ value: K.retention.executionDataRetentionDays,
688
+ onChange: (e) => X("retention", { executionDataRetentionDays: e.target.value })
689
+ })
690
+ }), /* @__PURE__ */ C(h, {
691
+ label: "Conversation Retention (days)",
692
+ description: "Assistant conversations older than this are retired and erased.",
693
+ children: /* @__PURE__ */ C(g, {
694
+ type: "number",
695
+ min: 1,
696
+ max: 3650,
697
+ placeholder: "Keep",
698
+ value: K.retention.conversationRetentionDays,
699
+ onChange: (e) => X("retention", { conversationRetentionDays: e.target.value })
700
+ })
701
+ })]
702
+ })
703
+ })] })
704
+ ] }), Ye = () => {
705
+ if (!z) return;
706
+ G({
707
+ name: z.name,
708
+ description: z.description || "",
709
+ visibility: y(z.visibility, Ee, "PRIVATE")
710
+ });
711
+ let e = ge(y(z.type, N, "CONTENT"), z.config);
712
+ q(e), Ve(e), Y(null), V(!0);
194
713
  };
195
- if (t) return /* @__PURE__ */ x(s, {
714
+ if (t) return /* @__PURE__ */ C(s, {
196
715
  title: "Create Policy",
197
716
  description: "Define guardrails and constraints for your AI agents",
198
- actions: /* @__PURE__ */ S("div", {
717
+ actions: /* @__PURE__ */ w("div", {
199
718
  className: "flex gap-2",
200
- children: [/* @__PURE__ */ x(m, {
719
+ children: [/* @__PURE__ */ C(m, {
201
720
  variant: "outline",
202
- onClick: () => z("policies"),
721
+ onClick: () => R("policies"),
203
722
  children: "Cancel"
204
- }), /* @__PURE__ */ x(m, {
205
- leftIcon: /* @__PURE__ */ x(O, { size: 16 }),
206
- onClick: Ve,
207
- isLoading: Ae,
208
- disabled: !U.name,
723
+ }), /* @__PURE__ */ C(m, {
724
+ leftIcon: /* @__PURE__ */ C(A, { size: 16 }),
725
+ onClick: We,
726
+ isLoading: Ne,
727
+ disabled: !H.name,
209
728
  children: "Create"
210
729
  })]
211
730
  }),
212
- children: /* @__PURE__ */ S("div", {
731
+ children: /* @__PURE__ */ w("div", {
213
732
  className: "max-w-2xl space-y-6",
214
733
  children: [
215
- /* @__PURE__ */ S(l, { children: [/* @__PURE__ */ x(f, { children: /* @__PURE__ */ x(p, { children: "Basic Information" }) }), /* @__PURE__ */ S(u, {
734
+ /* @__PURE__ */ w(l, { children: [/* @__PURE__ */ C(f, { children: /* @__PURE__ */ C(p, { children: "Basic Information" }) }), /* @__PURE__ */ w(u, {
216
735
  className: "space-y-4",
217
736
  children: [
218
- /* @__PURE__ */ x(h, {
737
+ /* @__PURE__ */ C(h, {
219
738
  label: "Policy Name",
220
739
  required: !0,
221
- children: /* @__PURE__ */ x(g, {
740
+ children: /* @__PURE__ */ C(g, {
222
741
  placeholder: "e.g., Production Content Policy",
223
- value: U.name,
224
- onChange: (e) => W({
225
- ...U,
742
+ value: H.name,
743
+ onChange: (e) => U({
744
+ ...H,
226
745
  name: e.target.value
227
746
  })
228
747
  })
229
748
  }),
230
- /* @__PURE__ */ x(h, {
749
+ /* @__PURE__ */ C(h, {
231
750
  label: "Description",
232
- children: /* @__PURE__ */ x(_, {
751
+ children: /* @__PURE__ */ C(_, {
233
752
  placeholder: "What does this policy enforce?",
234
- value: U.description,
235
- onChange: (e) => W({
236
- ...U,
753
+ value: H.description,
754
+ onChange: (e) => U({
755
+ ...H,
237
756
  description: e.target.value
238
757
  }),
239
758
  rows: 3
240
759
  })
241
760
  }),
242
- /* @__PURE__ */ S("div", {
761
+ /* @__PURE__ */ w("div", {
243
762
  className: "grid grid-cols-2 gap-4",
244
- children: [/* @__PURE__ */ x(h, {
763
+ children: [/* @__PURE__ */ C(h, {
245
764
  label: "Policy Type",
246
765
  required: !0,
247
- children: /* @__PURE__ */ x("select", {
248
- className: N,
249
- value: U.type,
766
+ children: /* @__PURE__ */ C("select", {
767
+ className: P,
768
+ value: H.type,
250
769
  onChange: (e) => {
251
770
  let t = e.target.value;
252
- _e(t) && (Y(null), W({
253
- ...U,
771
+ b(t) && (Y(null), U({
772
+ ...H,
254
773
  type: t
255
774
  }));
256
775
  },
257
- children: le.map((e) => /* @__PURE__ */ x("option", {
776
+ children: ce.map((e) => /* @__PURE__ */ C("option", {
258
777
  value: e,
259
- children: L[e]
778
+ children: I[e]
260
779
  }, e))
261
780
  })
262
- }), /* @__PURE__ */ x(h, {
781
+ }), /* @__PURE__ */ C(h, {
263
782
  label: "Visibility",
264
- children: /* @__PURE__ */ S("select", {
783
+ children: /* @__PURE__ */ w("select", {
265
784
  className: "flex h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm",
266
- value: U.visibility,
267
- onChange: (e) => W({
268
- ...U,
785
+ value: H.visibility,
786
+ onChange: (e) => U({
787
+ ...H,
269
788
  visibility: e.target.value
270
789
  }),
271
790
  children: [
272
- /* @__PURE__ */ x("option", {
791
+ /* @__PURE__ */ C("option", {
273
792
  value: "PRIVATE",
274
793
  children: "Private"
275
794
  }),
276
- /* @__PURE__ */ x("option", {
795
+ /* @__PURE__ */ C("option", {
277
796
  value: "WORKSPACE",
278
797
  children: "Workspace"
279
798
  }),
280
- /* @__PURE__ */ x("option", {
799
+ /* @__PURE__ */ C("option", {
281
800
  value: "PUBLIC",
282
801
  children: "Public"
283
802
  })
@@ -287,534 +806,29 @@ var I = ({ value: e, onChange: n }) => {
287
806
  })
288
807
  ]
289
808
  })] }),
290
- U.type === "CONTENT" && /* @__PURE__ */ S(l, { children: [/* @__PURE__ */ S(f, { children: [/* @__PURE__ */ S(p, {
291
- className: "flex items-center gap-2",
292
- children: [/* @__PURE__ */ x(C, { size: 18 }), "Content Policy Configuration"]
293
- }), /* @__PURE__ */ x(d, { children: "Checked against every message sent to an agent and every response it gives. A blocked message is refused; a blocked response is replaced with a refusal." })] }), /* @__PURE__ */ S(u, {
294
- className: "space-y-4",
295
- children: [
296
- /* @__PURE__ */ S("div", {
297
- className: "flex items-start gap-2",
298
- children: [/* @__PURE__ */ x("input", {
299
- type: "checkbox",
300
- id: "pii",
301
- checked: q.content.piiDetection,
302
- onChange: (e) => X("content", { piiDetection: e.target.checked }),
303
- className: "mt-1 h-4 w-4"
304
- }), /* @__PURE__ */ S("label", {
305
- htmlFor: "pii",
306
- className: "text-sm",
307
- children: [/* @__PURE__ */ x("span", {
308
- className: "font-medium",
309
- children: "PII Detection"
310
- }), /* @__PURE__ */ x("span", {
311
- className: "block text-text-secondary",
312
- children: "Blocks text containing an email address, a US SSN or a card-number shaped digit run."
313
- })]
314
- })]
315
- }),
316
- /* @__PURE__ */ x(h, {
317
- label: "Blocked Keywords",
318
- description: "Comma-separated. Case-insensitive; any occurrence blocks the text.",
319
- children: /* @__PURE__ */ x(g, {
320
- placeholder: "e.g., internal-only, project-x",
321
- value: q.content.blockedKeywords,
322
- onChange: (e) => X("content", { blockedKeywords: e.target.value })
323
- })
324
- }),
325
- /* @__PURE__ */ x(h, {
326
- label: "Blocked Patterns",
327
- description: "One regular expression per line, matched case-insensitively.",
328
- children: /* @__PURE__ */ x(_, {
329
- placeholder: "e.g., \\bACME-\\d{6}\\b",
330
- value: q.content.blockedPatterns,
331
- onChange: (e) => X("content", { blockedPatterns: e.target.value }),
332
- rows: 3
333
- })
334
- })
335
- ]
336
- })] }),
337
- U.type === "TOOL" && /* @__PURE__ */ S(l, { children: [/* @__PURE__ */ S(f, { children: [/* @__PURE__ */ S(p, {
338
- className: "flex items-center gap-2",
339
- children: [/* @__PURE__ */ x(j, { size: 18 }), "Tool Policy Configuration"]
340
- }), /* @__PURE__ */ x(d, { children: "Applies to MCP tool calls made by agents and through Call Tool, and to agent delegation. Leave a field empty to not restrict it." })] }), /* @__PURE__ */ S(u, {
341
- className: "space-y-4",
342
- children: [
343
- /* @__PURE__ */ x(h, {
344
- label: "Allowed Tools",
345
- description: "Comma-separated MCP tool names. End an entry with * to allow a prefix. Empty allows every tool.",
346
- children: /* @__PURE__ */ x(g, {
347
- placeholder: "e.g., search, read_*",
348
- value: q.tool.allowedTools,
349
- onChange: (e) => X("tool", { allowedTools: e.target.value })
350
- })
351
- }),
352
- /* @__PURE__ */ x(h, {
353
- label: "Denied Tools",
354
- description: "Comma-separated MCP tool names that may never run. A deny always wins.",
355
- children: /* @__PURE__ */ x(g, {
356
- placeholder: "e.g., delete_*, execute_code",
357
- value: q.tool.deniedTools,
358
- onChange: (e) => X("tool", { deniedTools: e.target.value })
359
- })
360
- }),
361
- /* @__PURE__ */ S("div", {
362
- className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
363
- children: [/* @__PURE__ */ x(h, {
364
- label: "Max Tool Risk Level",
365
- children: /* @__PURE__ */ S("select", {
366
- className: N,
367
- value: q.tool.maxToolRiskLevel,
368
- onChange: (e) => X("tool", { maxToolRiskLevel: e.target.value }),
369
- children: [/* @__PURE__ */ x("option", {
370
- value: "",
371
- children: "Any risk level"
372
- }), he.map((e) => /* @__PURE__ */ S("option", {
373
- value: e,
374
- children: ["Up to ", e.toLowerCase()]
375
- }, e))]
376
- })
377
- }), /* @__PURE__ */ x(h, {
378
- label: "Minimum A2A Trust Level",
379
- description: "For delegation to external registry agents.",
380
- children: /* @__PURE__ */ S("select", {
381
- className: N,
382
- value: q.tool.a2aMinTrustLevel,
383
- onChange: (e) => X("tool", { a2aMinTrustLevel: e.target.value }),
384
- children: [/* @__PURE__ */ x("option", {
385
- value: "",
386
- children: "Default (verified publisher)"
387
- }), se.map((e) => /* @__PURE__ */ x("option", {
388
- value: e,
389
- children: e === "VERIFIED_PUBLISHER" ? "Verified publisher" : e.charAt(0) + e.slice(1).toLowerCase()
390
- }, e))]
391
- })
392
- })]
393
- }),
394
- /* @__PURE__ */ S("div", {
395
- className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
396
- children: [/* @__PURE__ */ x(h, {
397
- label: "Max Tool Calls Per Execution",
398
- description: "Tool calls allowed in one agent turn.",
399
- children: /* @__PURE__ */ x(g, {
400
- type: "number",
401
- min: 1,
402
- placeholder: "No limit",
403
- value: q.tool.maxCallsPerExecution,
404
- onChange: (e) => X("tool", { maxCallsPerExecution: e.target.value })
405
- })
406
- }), /* @__PURE__ */ x(h, {
407
- label: "Tool Call Timeout (seconds)",
408
- description: "Can only shorten the platform's own timeout.",
409
- children: /* @__PURE__ */ x(g, {
410
- type: "number",
411
- min: 1,
412
- placeholder: "Platform default",
413
- value: q.tool.timeoutSeconds,
414
- onChange: (e) => X("tool", { timeoutSeconds: e.target.value })
415
- })
416
- })]
417
- })
418
- ]
419
- })] }),
420
- U.type === "BUDGET" && /* @__PURE__ */ S(l, { children: [/* @__PURE__ */ S(f, { children: [/* @__PURE__ */ S(p, {
421
- className: "flex items-center gap-2",
422
- children: [/* @__PURE__ */ x(E, { size: 18 }), "Budget Policy Configuration"]
423
- }), /* @__PURE__ */ x(d, { children: "Token budgets apply per agent. Leave a field empty to not restrict it." })] }), /* @__PURE__ */ x(u, {
424
- className: "space-y-4",
425
- children: /* @__PURE__ */ S("div", {
426
- className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
427
- children: [/* @__PURE__ */ x(h, {
428
- label: "Max Tokens Per Day",
429
- description: "An agent that has used this many tokens today (UTC) is refused.",
430
- children: /* @__PURE__ */ x(g, {
431
- type: "number",
432
- min: 1,
433
- placeholder: "No limit",
434
- value: q.budget.maxTokensPerDay,
435
- onChange: (e) => X("budget", { maxTokensPerDay: e.target.value })
436
- })
437
- }), /* @__PURE__ */ x(h, {
438
- label: "Max Output Tokens Per Model Call",
439
- description: "Lowers the agent's own max-tokens setting when it is higher.",
440
- children: /* @__PURE__ */ x(g, {
441
- type: "number",
442
- min: 1,
443
- placeholder: "No limit",
444
- value: q.budget.maxTokensPerExecution,
445
- onChange: (e) => X("budget", { maxTokensPerExecution: e.target.value })
446
- })
447
- })]
448
- })
449
- })] }),
450
- U.type === "RATE_LIMIT" && /* @__PURE__ */ S(l, { children: [/* @__PURE__ */ S(f, { children: [/* @__PURE__ */ S(p, {
451
- className: "flex items-center gap-2",
452
- children: [/* @__PURE__ */ x(w, { size: 18 }), "Rate Limit Configuration"]
453
- }), /* @__PURE__ */ x(d, { children: "Every limit is counted per agent. Leave a field empty to not restrict it." })] }), /* @__PURE__ */ x(u, {
454
- className: "space-y-4",
455
- children: /* @__PURE__ */ S("div", {
456
- className: "grid grid-cols-1 sm:grid-cols-3 gap-4",
457
- children: [
458
- /* @__PURE__ */ x(h, {
459
- label: "Requests / Minute",
460
- children: /* @__PURE__ */ x(g, {
461
- type: "number",
462
- min: 1,
463
- placeholder: "No limit",
464
- value: q.rateLimit.requestsPerMinute,
465
- onChange: (e) => X("rateLimit", { requestsPerMinute: e.target.value })
466
- })
467
- }),
468
- /* @__PURE__ */ x(h, {
469
- label: "Requests / Hour",
470
- children: /* @__PURE__ */ x(g, {
471
- type: "number",
472
- min: 1,
473
- placeholder: "No limit",
474
- value: q.rateLimit.requestsPerHour,
475
- onChange: (e) => X("rateLimit", { requestsPerHour: e.target.value })
476
- })
477
- }),
478
- /* @__PURE__ */ x(h, {
479
- label: "Tokens / Minute",
480
- children: /* @__PURE__ */ x(g, {
481
- type: "number",
482
- min: 1,
483
- placeholder: "No limit",
484
- value: q.rateLimit.tokensPerMinute,
485
- onChange: (e) => X("rateLimit", { tokensPerMinute: e.target.value })
486
- })
487
- })
488
- ]
489
- })
490
- })] }),
491
- U.type === "RESPONSE" && /* @__PURE__ */ S(l, { children: [/* @__PURE__ */ S(f, { children: [/* @__PURE__ */ S(p, {
492
- className: "flex items-center gap-2",
493
- children: [/* @__PURE__ */ x(D, { size: 18 }), "Model Usage Allowlist"]
494
- }), /* @__PURE__ */ x(d, { children: "Agents in this workspace may only answer with models that match every active model policy. Leave both fields empty to allow all models." })] }), /* @__PURE__ */ S(u, {
495
- className: "space-y-4",
496
- children: [/* @__PURE__ */ x(h, {
497
- label: "Allowed Models",
498
- description: "Comma-separated model IDs. End an entry with * to allow a prefix.",
499
- children: /* @__PURE__ */ x(g, {
500
- placeholder: "e.g., gpt-4o-mini, anthropic.claude-*",
501
- value: q.response.allowedModels,
502
- onChange: (e) => X("response", { allowedModels: e.target.value })
503
- })
504
- }), /* @__PURE__ */ x(h, {
505
- label: "Allowed Providers",
506
- description: "Comma-separated provider types, e.g. OPENAI, ANTHROPIC, AWS_BEDROCK.",
507
- children: /* @__PURE__ */ x(g, {
508
- placeholder: "e.g., AWS_BEDROCK, ANTHROPIC",
509
- value: q.response.allowedProviders,
510
- onChange: (e) => X("response", { allowedProviders: e.target.value })
511
- })
512
- })]
513
- })] }),
514
- U.type === "RESPONSE" && /* @__PURE__ */ S(l, { children: [/* @__PURE__ */ S(f, { children: [/* @__PURE__ */ S(p, {
515
- className: "flex items-center gap-2",
516
- children: [/* @__PURE__ */ x(D, { size: 18 }), "Response Style, Length And Citations"]
517
- }), /* @__PURE__ */ x(d, { children: "Persona, tone, formality, structure and formatting are given to the model as instructions. The token limit caps every model call and longer answers are cut to the length limit. Leave a field empty to not set it." })] }), /* @__PURE__ */ S(u, {
518
- className: "space-y-4",
519
- children: [
520
- /* @__PURE__ */ x(h, {
521
- label: "Persona",
522
- description: "Who the agent speaks as. Up to 2000 characters.",
523
- children: /* @__PURE__ */ x(_, {
524
- rows: 3,
525
- maxLength: 2e3,
526
- placeholder: "e.g., A patient support specialist for Acme Cloud",
527
- value: q.response.persona,
528
- onChange: (e) => X("response", { persona: e.target.value })
529
- })
530
- }),
531
- /* @__PURE__ */ S("div", {
532
- className: "grid grid-cols-1 sm:grid-cols-3 gap-4",
533
- children: [
534
- /* @__PURE__ */ x(h, {
535
- label: "Tone",
536
- children: /* @__PURE__ */ x(g, {
537
- placeholder: "e.g., friendly, calm",
538
- value: q.response.tone,
539
- onChange: (e) => X("response", { tone: e.target.value })
540
- })
541
- }),
542
- /* @__PURE__ */ x(h, {
543
- label: "Formality",
544
- children: /* @__PURE__ */ S("select", {
545
- className: N,
546
- value: q.response.formality,
547
- onChange: (e) => X("response", { formality: e.target.value }),
548
- children: [/* @__PURE__ */ x("option", {
549
- value: "",
550
- children: "Not set"
551
- }), pe.map((e) => /* @__PURE__ */ x("option", {
552
- value: e,
553
- children: e.charAt(0) + e.slice(1).toLowerCase()
554
- }, e))]
555
- })
556
- }),
557
- /* @__PURE__ */ x(h, {
558
- label: "Structure",
559
- children: /* @__PURE__ */ S("select", {
560
- className: N,
561
- value: q.response.structure,
562
- onChange: (e) => X("response", { structure: e.target.value }),
563
- children: [/* @__PURE__ */ x("option", {
564
- value: "",
565
- children: "Not set"
566
- }), me.map((e) => /* @__PURE__ */ x("option", {
567
- value: e,
568
- children: e.split("_").map((e) => e.charAt(0) + e.slice(1).toLowerCase()).join(" ")
569
- }, e))]
570
- })
571
- })
572
- ]
573
- }),
574
- /* @__PURE__ */ x(h, {
575
- label: "Formatting Instructions",
576
- children: /* @__PURE__ */ x(g, {
577
- placeholder: "e.g., End every answer with a one-line summary",
578
- value: q.response.formattingInstructions,
579
- onChange: (e) => X("response", { formattingInstructions: e.target.value })
580
- })
581
- }),
582
- /* @__PURE__ */ S("div", {
583
- className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
584
- children: [/* @__PURE__ */ x(h, {
585
- label: "Max Response Tokens",
586
- description: "Caps the output tokens of every model call.",
587
- children: /* @__PURE__ */ x(g, {
588
- type: "number",
589
- min: 1,
590
- placeholder: "No limit",
591
- value: q.response.maxResponseTokens,
592
- onChange: (e) => X("response", { maxResponseTokens: e.target.value })
593
- })
594
- }), /* @__PURE__ */ x(h, {
595
- label: "Max Response Length (characters)",
596
- description: "Longer answers are cut at a word boundary.",
597
- children: /* @__PURE__ */ x(g, {
598
- type: "number",
599
- min: 1,
600
- placeholder: "No limit",
601
- value: q.response.maxResponseLength,
602
- onChange: (e) => X("response", { maxResponseLength: e.target.value })
603
- })
604
- })]
605
- }),
606
- /* @__PURE__ */ S("div", {
607
- className: "flex items-start gap-2",
608
- children: [/* @__PURE__ */ x("input", {
609
- type: "checkbox",
610
- id: "require-citations",
611
- checked: q.response.requireCitations,
612
- onChange: (e) => X("response", { requireCitations: e.target.checked }),
613
- className: "mt-1 h-4 w-4"
614
- }), /* @__PURE__ */ S("label", {
615
- htmlFor: "require-citations",
616
- className: "text-sm",
617
- children: [/* @__PURE__ */ x("span", {
618
- className: "font-medium",
619
- children: "Require citations"
620
- }), /* @__PURE__ */ x("span", {
621
- className: "block text-text-secondary",
622
- children: "When knowledge-base passages ground an answer and the answer cites none of them, either add the passage references or refuse the answer."
623
- })]
624
- })]
625
- }),
626
- q.response.requireCitations && /* @__PURE__ */ x(h, {
627
- label: "When Citations Are Missing",
628
- children: /* @__PURE__ */ x("select", {
629
- className: N,
630
- value: q.response.citationMode,
631
- onChange: (e) => X("response", { citationMode: e.target.value }),
632
- children: ce.map((e) => /* @__PURE__ */ x("option", {
633
- value: e,
634
- children: e === "APPEND" ? "Add the source references" : "Refuse the answer"
635
- }, e))
636
- })
637
- }),
638
- /* @__PURE__ */ x(I, {
639
- value: q.appliesToAgentIds,
640
- onChange: (e) => {
641
- Y(null), J((t) => ({
642
- ...t,
643
- appliesToAgentIds: e
644
- }));
645
- }
646
- })
647
- ]
648
- })] }),
649
- U.type === "DATA" && /* @__PURE__ */ S(l, { children: [/* @__PURE__ */ S(f, { children: [/* @__PURE__ */ S(p, {
650
- className: "flex items-center gap-2",
651
- children: [/* @__PURE__ */ x(T, { size: 18 }), "Data Policy Configuration"]
652
- }), /* @__PURE__ */ x(d, { children: "Masked values are replaced before any model, tool or log sees them. Provider, region, tool and agent rules refuse a turn that would share data outside them." })] }), /* @__PURE__ */ S(u, {
653
- className: "space-y-4",
654
- children: [
655
- /* @__PURE__ */ x(h, {
656
- label: "Mask",
657
- children: /* @__PURE__ */ x("div", {
658
- className: "grid grid-cols-1 sm:grid-cols-2 gap-1",
659
- children: fe.map((e) => /* @__PURE__ */ S("label", {
660
- className: "flex items-center gap-2 text-sm",
661
- children: [/* @__PURE__ */ x("input", {
662
- type: "checkbox",
663
- className: "h-4 w-4",
664
- checked: q.data.maskPii.includes(e),
665
- onChange: (t) => X("data", { maskPii: F(q.data.maskPii, e, t.target.checked) })
666
- }), /* @__PURE__ */ x("span", { children: De[e] })]
667
- }, e))
668
- })
669
- }),
670
- /* @__PURE__ */ x(h, {
671
- label: "Custom Masking Patterns",
672
- description: "One regular expression per line; matches are replaced with [REDACTED].",
673
- children: /* @__PURE__ */ x(_, {
674
- rows: 3,
675
- placeholder: "e.g., EMP-\\d{5}",
676
- value: q.data.maskPatterns,
677
- onChange: (e) => X("data", { maskPatterns: e.target.value })
678
- })
679
- }),
680
- /* @__PURE__ */ x(h, {
681
- label: "Allowed Regions",
682
- description: "Comma-separated regions a model provider may process data in; end an entry with * for a prefix. A provider whose region is not recorded is refused.",
683
- children: /* @__PURE__ */ x(g, {
684
- placeholder: "e.g., ap-south-1, eu-*",
685
- value: q.data.allowedRegions,
686
- onChange: (e) => X("data", { allowedRegions: e.target.value })
687
- })
688
- }),
689
- [
690
- [
691
- "restrictProviders",
692
- "allowedProviders",
693
- "model providers",
694
- "e.g., AWS_BEDROCK"
695
- ],
696
- [
697
- "restrictMcpServers",
698
- "allowedMcpServers",
699
- "MCP servers",
700
- "Connection name, id or host"
701
- ],
702
- [
703
- "restrictA2AAgents",
704
- "allowedA2AAgents",
705
- "agents to delegate to",
706
- "Agent name or id"
707
- ]
708
- ].map(([e, t, n, r]) => /* @__PURE__ */ S("div", {
709
- className: "space-y-2",
710
- children: [/* @__PURE__ */ S("label", {
711
- className: "flex items-center gap-2 text-sm",
712
- children: [/* @__PURE__ */ x("input", {
713
- type: "checkbox",
714
- className: "h-4 w-4",
715
- checked: q.data[e],
716
- onChange: (t) => X("data", { [e]: t.target.checked })
717
- }), /* @__PURE__ */ S("span", {
718
- className: "font-medium",
719
- children: ["Only share with these ", n]
720
- })]
721
- }), q.data[e] && /* @__PURE__ */ x(g, {
722
- "aria-label": `Allowed ${n}`,
723
- placeholder: `${r}; comma-separated, empty = none`,
724
- value: q.data[t],
725
- onChange: (e) => X("data", { [t]: e.target.value })
726
- })]
727
- }, e)),
728
- /* @__PURE__ */ x(h, {
729
- label: "Allowed Knowledge Classifications",
730
- description: "Knowledge bases are classified by metadata.classification. Leave all unchecked to not restrict retrieval.",
731
- children: /* @__PURE__ */ x("div", {
732
- className: "grid grid-cols-1 sm:grid-cols-3 gap-1",
733
- children: de.map((e) => /* @__PURE__ */ S("label", {
734
- className: "flex items-center gap-2 text-sm",
735
- children: [/* @__PURE__ */ x("input", {
736
- type: "checkbox",
737
- className: "h-4 w-4",
738
- checked: q.data.allowedClassifications.includes(e),
739
- onChange: (t) => X("data", { allowedClassifications: F(q.data.allowedClassifications, e, t.target.checked) })
740
- }), /* @__PURE__ */ x("span", { children: e.charAt(0) + e.slice(1).toLowerCase() })]
741
- }, e))
742
- })
743
- }),
744
- /* @__PURE__ */ x(h, {
745
- label: "Blocked Knowledge Labels",
746
- description: "Comma-separated; knowledge bases with any of these labels (metadata.labels) are never retrieved.",
747
- children: /* @__PURE__ */ x(g, {
748
- placeholder: "e.g., hr, legal",
749
- value: q.data.blockedLabels,
750
- onChange: (e) => X("data", { blockedLabels: e.target.value })
751
- })
752
- }),
753
- /* @__PURE__ */ x(I, {
754
- value: q.appliesToAgentIds,
755
- onChange: (e) => {
756
- Y(null), J((t) => ({
757
- ...t,
758
- appliesToAgentIds: e
759
- }));
760
- }
761
- })
762
- ]
763
- })] }),
764
- U.type === "RETENTION" && /* @__PURE__ */ S(l, { children: [/* @__PURE__ */ S(f, { children: [/* @__PURE__ */ S(p, {
765
- className: "flex items-center gap-2",
766
- children: [/* @__PURE__ */ x(A, { size: 18 }), "Retention Policy Configuration"]
767
- }), /* @__PURE__ */ x(d, { children: "A scheduled job erases content older than these periods every hour. With several active retention policies the shortest period applies. Leave a field empty to keep that content for the life of the workspace." })] }), /* @__PURE__ */ x(u, {
768
- className: "space-y-4",
769
- children: /* @__PURE__ */ S("div", {
770
- className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
771
- children: [/* @__PURE__ */ x(h, {
772
- label: "Execution Data Retention (days)",
773
- description: "Inputs, outputs and errors of finished runs and agent-to-agent messages are erased this many days after the run ended; 0 keeps none. Run metrics stay.",
774
- children: /* @__PURE__ */ x(g, {
775
- type: "number",
776
- min: 0,
777
- max: 3650,
778
- placeholder: "Keep",
779
- value: q.retention.executionDataRetentionDays,
780
- onChange: (e) => X("retention", { executionDataRetentionDays: e.target.value })
781
- })
782
- }), /* @__PURE__ */ x(h, {
783
- label: "Conversation Retention (days)",
784
- description: "Assistant conversations older than this are retired and erased.",
785
- children: /* @__PURE__ */ x(g, {
786
- type: "number",
787
- min: 1,
788
- max: 3650,
789
- placeholder: "Keep",
790
- value: q.retention.conversationRetentionDays,
791
- onChange: (e) => X("retention", { conversationRetentionDays: e.target.value })
792
- })
793
- })]
794
- })
795
- })] }),
796
- Re && /* @__PURE__ */ x("p", {
809
+ Je(H.type),
810
+ J && /* @__PURE__ */ C("p", {
797
811
  className: "text-sm text-status-error-text",
798
812
  role: "alert",
799
- children: Re
813
+ children: J
800
814
  }),
801
- /* @__PURE__ */ x(l, { children: /* @__PURE__ */ x(u, {
815
+ /* @__PURE__ */ C(l, { children: /* @__PURE__ */ C(u, {
802
816
  className: "pt-6",
803
- children: /* @__PURE__ */ S("div", {
817
+ children: /* @__PURE__ */ w("div", {
804
818
  className: "flex items-start gap-2",
805
- children: [/* @__PURE__ */ x("input", {
819
+ children: [/* @__PURE__ */ C("input", {
806
820
  type: "checkbox",
807
821
  id: "activate-on-create",
808
- checked: ze,
809
- onChange: (e) => Be(e.target.checked),
822
+ checked: He,
823
+ onChange: (e) => Ue(e.target.checked),
810
824
  className: "mt-1 h-4 w-4"
811
- }), /* @__PURE__ */ S("label", {
825
+ }), /* @__PURE__ */ w("label", {
812
826
  htmlFor: "activate-on-create",
813
827
  className: "text-sm",
814
- children: [/* @__PURE__ */ x("span", {
828
+ children: [/* @__PURE__ */ C("span", {
815
829
  className: "font-medium",
816
830
  children: "Enforce immediately"
817
- }), /* @__PURE__ */ x("span", {
831
+ }), /* @__PURE__ */ C("span", {
818
832
  className: "block text-text-secondary",
819
833
  children: "Only active policies are enforced. Leave unchecked to save this policy as a draft and activate it later."
820
834
  })]
@@ -824,283 +838,289 @@ var I = ({ value: e, onChange: n }) => {
824
838
  ]
825
839
  })
826
840
  });
827
- if (Oe) return /* @__PURE__ */ x(s, {
841
+ if (Ae) return /* @__PURE__ */ C(s, {
828
842
  title: "Loading...",
829
- children: /* @__PURE__ */ x("div", { className: "h-96 bg-bg-sunken motion-safe:animate-vc-shimmer rounded-lg" })
843
+ children: /* @__PURE__ */ C("div", { className: "h-96 bg-bg-sunken motion-safe:animate-vc-shimmer rounded-lg" })
830
844
  });
831
- if (!B) return /* @__PURE__ */ x(s, {
845
+ if (!z) return /* @__PURE__ */ C(s, {
832
846
  title: "Policy Not Found",
833
- children: /* @__PURE__ */ x(c, {
847
+ children: /* @__PURE__ */ C(c, {
834
848
  illustration: "empty-generic",
835
849
  title: "Policy Not Found",
836
850
  description: "This policy doesn't exist.",
837
- action: /* @__PURE__ */ x(m, {
838
- onClick: () => z("policies"),
851
+ action: /* @__PURE__ */ C(m, {
852
+ onClick: () => R("policies"),
839
853
  children: "Back to Policies"
840
854
  })
841
855
  })
842
856
  });
843
- let Q = oe(B.type, Te, "CONTENT"), $ = ve(Q, B.config);
844
- return /* @__PURE__ */ x(s, {
845
- title: /* @__PURE__ */ S("div", {
857
+ let Q = y(z.type, N, "CONTENT"), $ = _e(Q, z.config);
858
+ return /* @__PURE__ */ C(s, {
859
+ title: /* @__PURE__ */ w("div", {
846
860
  className: "flex items-center gap-3",
847
861
  children: [
848
- /* @__PURE__ */ x(m, {
862
+ /* @__PURE__ */ C(m, {
849
863
  variant: "ghost",
850
864
  size: "icon",
851
- onClick: () => z("policies"),
852
- children: /* @__PURE__ */ x(xe, { size: 20 })
865
+ onClick: () => R("policies"),
866
+ children: /* @__PURE__ */ C(be, { size: 20 })
853
867
  }),
854
- /* @__PURE__ */ x("div", {
868
+ /* @__PURE__ */ C("div", {
855
869
  className: "p-2 rounded-lg bg-action-primary-bg/10",
856
- children: /* @__PURE__ */ x(P, { type: Q })
870
+ children: /* @__PURE__ */ C(De, { type: Q })
857
871
  }),
858
- /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ S("div", {
872
+ /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ w("div", {
859
873
  className: "flex items-center gap-2",
860
- children: [/* @__PURE__ */ x("span", { children: B.name }), /* @__PURE__ */ x(te, { status: B.status })]
861
- }), /* @__PURE__ */ x("p", {
874
+ children: [/* @__PURE__ */ C("span", { children: z.name }), /* @__PURE__ */ C(te, { status: z.status })]
875
+ }), /* @__PURE__ */ C("p", {
862
876
  className: "text-sm font-normal text-text-secondary",
863
- children: B.description
877
+ children: z.description
864
878
  })] })
865
879
  ]
866
880
  }),
867
- actions: /* @__PURE__ */ x("div", {
881
+ actions: /* @__PURE__ */ C("div", {
868
882
  className: "flex gap-2",
869
- children: Fe ? /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x(m, {
883
+ children: B ? /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C(m, {
870
884
  variant: "outline",
871
- onClick: () => H(!1),
885
+ onClick: () => V(!1),
872
886
  children: "Cancel"
873
- }), /* @__PURE__ */ x(m, {
874
- leftIcon: /* @__PURE__ */ x(O, { size: 16 }),
875
- onClick: He,
876
- isLoading: Me,
877
- disabled: !G.name,
887
+ }), /* @__PURE__ */ C(m, {
888
+ leftIcon: /* @__PURE__ */ C(A, { size: 16 }),
889
+ onClick: Ge,
890
+ isLoading: Fe,
891
+ disabled: !W.name,
878
892
  children: "Save Changes"
879
- })] }) : /* @__PURE__ */ S(b, { children: [
880
- /* @__PURE__ */ x(o, {
893
+ })] }) : /* @__PURE__ */ w(S, { children: [
894
+ /* @__PURE__ */ C(o, {
881
895
  permission: a.POLICY_UPDATE,
882
- children: /* @__PURE__ */ x(m, {
896
+ children: /* @__PURE__ */ C(m, {
883
897
  variant: Z ? "outline" : "default",
884
- leftIcon: /* @__PURE__ */ x(Ce, { size: 16 }),
885
- onClick: () => void We(),
886
- isLoading: Me,
898
+ leftIcon: /* @__PURE__ */ C(Se, { size: 16 }),
899
+ onClick: () => void qe(),
900
+ isLoading: Fe,
887
901
  children: Z ? "Deactivate" : "Activate"
888
902
  })
889
903
  }),
890
- /* @__PURE__ */ x(o, {
904
+ /* @__PURE__ */ C(o, {
891
905
  permission: a.POLICY_UPDATE,
892
- children: /* @__PURE__ */ x(m, {
906
+ children: /* @__PURE__ */ C(m, {
893
907
  variant: "outline",
894
- leftIcon: /* @__PURE__ */ x(Se, { size: 16 }),
895
- onClick: Ge,
908
+ leftIcon: /* @__PURE__ */ C(xe, { size: 16 }),
909
+ onClick: Ye,
896
910
  children: "Edit"
897
911
  })
898
912
  }),
899
- Ie ? /* @__PURE__ */ S("div", {
913
+ Re ? /* @__PURE__ */ w("div", {
900
914
  className: "flex gap-2",
901
- children: [/* @__PURE__ */ x(m, {
915
+ children: [/* @__PURE__ */ C(m, {
902
916
  variant: "outline",
903
917
  size: "sm",
904
- onClick: () => Le(!1),
918
+ onClick: () => ze(!1),
905
919
  children: "Cancel"
906
- }), /* @__PURE__ */ x(m, {
920
+ }), /* @__PURE__ */ C(m, {
907
921
  variant: "destructive",
908
922
  size: "sm",
909
923
  onClick: () => {
910
- r("medium"), Ue();
924
+ r("medium"), Ke();
911
925
  },
912
- isLoading: Pe,
926
+ isLoading: Le,
913
927
  children: "Confirm Delete"
914
928
  })]
915
- }) : /* @__PURE__ */ x(o, {
929
+ }) : /* @__PURE__ */ C(o, {
916
930
  permission: a.POLICY_DELETE,
917
- children: /* @__PURE__ */ x(m, {
931
+ children: /* @__PURE__ */ C(m, {
918
932
  variant: "destructive",
919
- leftIcon: /* @__PURE__ */ x(A, { size: 16 }),
920
- onClick: () => Le(!0),
933
+ leftIcon: /* @__PURE__ */ C(j, { size: 16 }),
934
+ onClick: () => ze(!0),
921
935
  children: "Delete"
922
936
  })
923
937
  })
924
938
  ] })
925
939
  }),
926
- children: /* @__PURE__ */ S("div", {
940
+ children: /* @__PURE__ */ w("div", {
927
941
  className: "space-y-6",
928
942
  children: [
929
- /* @__PURE__ */ x(ye, {
930
- icon: /* @__PURE__ */ x(k, { size: 18 }),
943
+ /* @__PURE__ */ C(ve, {
944
+ icon: /* @__PURE__ */ C(we, { size: 18 }),
931
945
  children: "This is a single guardrail and its rules. Review and tune exactly what it enforces — what content to block, which tools are allowed, the spend or rate limits it applies — then attach it to the agents and bots that should obey it. Policies are how you keep agents safe, compliant and within budget."
932
946
  }),
933
- Fe && /* @__PURE__ */ S(l, { children: [/* @__PURE__ */ x(f, { children: /* @__PURE__ */ x(p, { children: "Edit Policy" }) }), /* @__PURE__ */ S(u, {
947
+ B && /* @__PURE__ */ w(l, { children: [/* @__PURE__ */ C(f, { children: /* @__PURE__ */ C(p, { children: "Edit Policy" }) }), /* @__PURE__ */ w(u, {
934
948
  className: "space-y-4",
935
949
  children: [
936
- /* @__PURE__ */ x(h, {
950
+ /* @__PURE__ */ C(h, {
937
951
  label: "Policy Name",
938
952
  required: !0,
939
- children: /* @__PURE__ */ x(g, {
940
- value: G.name,
941
- onChange: (e) => K({
942
- ...G,
953
+ children: /* @__PURE__ */ C(g, {
954
+ value: W.name,
955
+ onChange: (e) => G({
956
+ ...W,
943
957
  name: e.target.value
944
958
  })
945
959
  })
946
960
  }),
947
- /* @__PURE__ */ x(h, {
961
+ /* @__PURE__ */ C(h, {
948
962
  label: "Description",
949
- children: /* @__PURE__ */ x(_, {
950
- value: G.description,
951
- onChange: (e) => K({
952
- ...G,
963
+ children: /* @__PURE__ */ C(_, {
964
+ value: W.description,
965
+ onChange: (e) => G({
966
+ ...W,
953
967
  description: e.target.value
954
968
  }),
955
969
  rows: 3
956
970
  })
957
971
  }),
958
- /* @__PURE__ */ x(h, {
972
+ /* @__PURE__ */ C(h, {
959
973
  label: "Visibility",
960
- children: /* @__PURE__ */ S("select", {
961
- className: N,
962
- value: G.visibility,
963
- onChange: (e) => K({
964
- ...G,
974
+ children: /* @__PURE__ */ w("select", {
975
+ className: P,
976
+ value: W.visibility,
977
+ onChange: (e) => G({
978
+ ...W,
965
979
  visibility: e.target.value
966
980
  }),
967
981
  children: [
968
- /* @__PURE__ */ x("option", {
982
+ /* @__PURE__ */ C("option", {
969
983
  value: "PRIVATE",
970
984
  children: "Private"
971
985
  }),
972
- /* @__PURE__ */ x("option", {
986
+ /* @__PURE__ */ C("option", {
973
987
  value: "WORKSPACE",
974
988
  children: "Workspace"
975
989
  }),
976
- /* @__PURE__ */ x("option", {
990
+ /* @__PURE__ */ C("option", {
977
991
  value: "PUBLIC",
978
992
  children: "Public"
979
993
  })
980
994
  ]
981
995
  })
982
996
  }),
983
- /* @__PURE__ */ x("p", {
997
+ /* @__PURE__ */ C("p", {
984
998
  className: "text-sm text-text-secondary",
985
- children: "Note: Policy type and configuration cannot be changed after creation."
999
+ children: "The policy type cannot be changed after creation; its rules can be edited below."
986
1000
  })
987
1001
  ]
988
1002
  })] }),
989
- /* @__PURE__ */ S("div", {
1003
+ B && z.type === Q && b(Q) && Je(Q),
1004
+ B && J && /* @__PURE__ */ C("p", {
1005
+ className: "text-sm text-status-error-text",
1006
+ role: "alert",
1007
+ children: J
1008
+ }),
1009
+ /* @__PURE__ */ w("div", {
990
1010
  className: "grid grid-cols-2 md:grid-cols-4 gap-4",
991
1011
  children: [
992
- /* @__PURE__ */ x(l, {
1012
+ /* @__PURE__ */ C(l, {
993
1013
  treatment: "glass",
994
1014
  glow: !0,
995
- children: /* @__PURE__ */ S(u, {
1015
+ children: /* @__PURE__ */ w(u, {
996
1016
  className: "pt-6 text-center",
997
1017
  children: [
998
- /* @__PURE__ */ x("div", {
1018
+ /* @__PURE__ */ C("div", {
999
1019
  className: "p-3 rounded-full bg-action-primary-bg/10 w-fit mx-auto mb-2",
1000
- children: /* @__PURE__ */ x(P, { type: Q })
1020
+ children: /* @__PURE__ */ C(De, { type: Q })
1001
1021
  }),
1002
- /* @__PURE__ */ x("p", {
1022
+ /* @__PURE__ */ C("p", {
1003
1023
  className: "text-lg font-bold",
1004
- children: L[Q]
1024
+ children: I[Q]
1005
1025
  }),
1006
- /* @__PURE__ */ x("p", {
1026
+ /* @__PURE__ */ C("p", {
1007
1027
  className: "text-sm text-text-secondary",
1008
1028
  children: "Policy Type"
1009
1029
  })
1010
1030
  ]
1011
1031
  })
1012
1032
  }),
1013
- /* @__PURE__ */ x(l, { children: /* @__PURE__ */ S(u, {
1033
+ /* @__PURE__ */ C(l, { children: /* @__PURE__ */ w(u, {
1014
1034
  className: "pt-6 text-center",
1015
- children: [/* @__PURE__ */ x("p", {
1035
+ children: [/* @__PURE__ */ C("p", {
1016
1036
  className: "text-3xl font-bold text-text-primary capitalize",
1017
- children: B.visibility.toLowerCase()
1018
- }), /* @__PURE__ */ x("p", {
1037
+ children: z.visibility.toLowerCase()
1038
+ }), /* @__PURE__ */ C("p", {
1019
1039
  className: "text-sm text-text-secondary",
1020
1040
  children: "Visibility"
1021
1041
  })]
1022
1042
  }) }),
1023
- /* @__PURE__ */ x(l, { children: /* @__PURE__ */ S(u, {
1043
+ /* @__PURE__ */ C(l, { children: /* @__PURE__ */ w(u, {
1024
1044
  className: "pt-6 text-center",
1025
- children: [/* @__PURE__ */ x("p", {
1045
+ children: [/* @__PURE__ */ C("p", {
1026
1046
  className: "text-3xl font-bold text-text-primary",
1027
- children: B.revision
1028
- }), /* @__PURE__ */ x("p", {
1047
+ children: z.revision
1048
+ }), /* @__PURE__ */ C("p", {
1029
1049
  className: "text-sm text-text-secondary",
1030
1050
  children: "Revision"
1031
1051
  })]
1032
1052
  }) }),
1033
- /* @__PURE__ */ x(l, { children: /* @__PURE__ */ S(u, {
1053
+ /* @__PURE__ */ C(l, { children: /* @__PURE__ */ w(u, {
1034
1054
  className: "pt-6 text-center",
1035
- children: [/* @__PURE__ */ x("p", {
1055
+ children: [/* @__PURE__ */ C("p", {
1036
1056
  className: "text-lg font-bold text-text-primary",
1037
- children: v(B.updatedAt)
1038
- }), /* @__PURE__ */ x("p", {
1057
+ children: v(z.updatedAt)
1058
+ }), /* @__PURE__ */ C("p", {
1039
1059
  className: "text-sm text-text-secondary",
1040
1060
  children: "Last Updated"
1041
1061
  })]
1042
1062
  }) })
1043
1063
  ]
1044
1064
  }),
1045
- /* @__PURE__ */ S(l, { children: [/* @__PURE__ */ S(f, { children: [/* @__PURE__ */ x(p, { children: "Configuration" }), /* @__PURE__ */ x(d, { children: "Current policy configuration" })] }), /* @__PURE__ */ S(u, {
1065
+ /* @__PURE__ */ w(l, { children: [/* @__PURE__ */ w(f, { children: [/* @__PURE__ */ C(p, { children: "Configuration" }), /* @__PURE__ */ C(d, { children: "Current policy configuration" })] }), /* @__PURE__ */ w(u, {
1046
1066
  className: "space-y-4",
1047
- children: [$ === null ? /* @__PURE__ */ S("div", {
1067
+ children: [$ === null ? /* @__PURE__ */ w("div", {
1048
1068
  className: "flex items-start gap-2 p-3 bg-status-warning-bg-subtle rounded-lg text-sm",
1049
1069
  "data-testid": "policy-not-enforced",
1050
- children: [/* @__PURE__ */ x(C, {
1070
+ children: [/* @__PURE__ */ C(T, {
1051
1071
  size: 16,
1052
1072
  className: "mt-0.5 shrink-0 text-status-warning-text"
1053
- }), /* @__PURE__ */ S("p", { children: [L[Q], " settings are not enforced at runtime. This policy is kept for reference only and does not restrict any agent."] })]
1054
- }) : $.length > 0 ? /* @__PURE__ */ S("div", {
1073
+ }), /* @__PURE__ */ w("p", { children: [I[Q], " settings are not enforced at runtime. This policy is kept for reference only and does not restrict any agent."] })]
1074
+ }) : $.length > 0 ? /* @__PURE__ */ w("div", {
1055
1075
  className: "flex items-start gap-2 p-3 bg-status-warning-bg-subtle rounded-lg text-sm",
1056
1076
  "data-testid": "policy-ignored-keys",
1057
- children: [/* @__PURE__ */ x(C, {
1077
+ children: [/* @__PURE__ */ C(T, {
1058
1078
  size: 16,
1059
1079
  className: "mt-0.5 shrink-0 text-status-warning-text"
1060
- }), /* @__PURE__ */ S("p", { children: [
1080
+ }), /* @__PURE__ */ w("p", { children: [
1061
1081
  "These settings are not enforced at runtime and have no effect:",
1062
1082
  " ",
1063
- /* @__PURE__ */ x("span", {
1083
+ /* @__PURE__ */ C("span", {
1064
1084
  className: "font-mono",
1065
1085
  children: $.join(", ")
1066
1086
  }),
1067
1087
  ". Create a new policy to use the enforced settings."
1068
1088
  ] })]
1069
- }) : null, /* @__PURE__ */ x("div", {
1089
+ }) : null, /* @__PURE__ */ C("div", {
1070
1090
  className: "p-4 bg-bg-sunken rounded-lg font-mono text-sm overflow-auto",
1071
- children: /* @__PURE__ */ x("pre", { children: JSON.stringify(B.config, null, 2) })
1091
+ children: /* @__PURE__ */ C("pre", { children: JSON.stringify(z.config, null, 2) })
1072
1092
  })]
1073
1093
  })] }),
1074
- /* @__PURE__ */ S(l, { children: [/* @__PURE__ */ x(f, { children: /* @__PURE__ */ S(p, {
1094
+ /* @__PURE__ */ w(l, { children: [/* @__PURE__ */ C(f, { children: /* @__PURE__ */ w(p, {
1075
1095
  className: "flex items-center gap-2",
1076
- children: [/* @__PURE__ */ x(we, { size: 18 }), "Metadata"]
1077
- }) }), /* @__PURE__ */ x(u, { children: /* @__PURE__ */ S("div", {
1096
+ children: [/* @__PURE__ */ C(Ce, { size: 18 }), "Metadata"]
1097
+ }) }), /* @__PURE__ */ C(u, { children: /* @__PURE__ */ w("div", {
1078
1098
  className: "grid grid-cols-2 md:grid-cols-4 gap-6 text-sm",
1079
1099
  children: [
1080
- /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
1100
+ /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
1081
1101
  className: "text-text-secondary",
1082
1102
  children: "Created"
1083
- }), /* @__PURE__ */ x("p", {
1103
+ }), /* @__PURE__ */ C("p", {
1084
1104
  className: "font-medium",
1085
- children: v(B.createdAt)
1105
+ children: v(z.createdAt)
1086
1106
  })] }),
1087
- /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
1107
+ /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
1088
1108
  className: "text-text-secondary",
1089
1109
  children: "Updated"
1090
- }), /* @__PURE__ */ x("p", {
1110
+ }), /* @__PURE__ */ C("p", {
1091
1111
  className: "font-medium",
1092
- children: v(B.updatedAt)
1112
+ children: v(z.updatedAt)
1093
1113
  })] }),
1094
- /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
1114
+ /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
1095
1115
  className: "text-text-secondary",
1096
1116
  children: "Tags"
1097
- }), /* @__PURE__ */ x("div", {
1117
+ }), /* @__PURE__ */ C("div", {
1098
1118
  className: "flex gap-1",
1099
- children: B.tags.length > 0 ? B.tags.map((e) => /* @__PURE__ */ x(ee, {
1119
+ children: z.tags.length > 0 ? z.tags.map((e) => /* @__PURE__ */ C(ee, {
1100
1120
  variant: "secondary",
1101
1121
  className: "text-xs",
1102
1122
  children: e
1103
- }, e)) : /* @__PURE__ */ x("span", {
1123
+ }, e)) : /* @__PURE__ */ C("span", {
1104
1124
  className: "text-text-secondary",
1105
1125
  children: "None"
1106
1126
  })
@@ -1111,6 +1131,6 @@ var I = ({ value: e, onChange: n }) => {
1111
1131
  })
1112
1132
  });
1113
1133
  };
1114
- export { R as PolicyDetailPage };
1134
+ export { L as PolicyDetailPage };
1115
1135
 
1116
1136
  //# sourceMappingURL=PolicyDetailPage.js.map