@burdenoff/microfe-botmanor 2026.1014.2 → 2026.1025.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,20 +1,20 @@
1
1
  import { useBotlit as e } from "../providers/BotlitProvider.js";
2
2
  import { formatRelativeTime as t } from "../utils/formatters.js";
3
3
  import { PageLayout as n } from "../components/PageLayout.js";
4
- import { Card as r, CardContent as i, CardDescription as ee, CardHeader as a, CardTitle as o } from "../components/Card.js";
5
- import { Button as s } from "../components/Button.js";
6
- import { Badge as te, StatusBadge as ne } from "../components/Badge.js";
7
- import { isNative as c, nativeImpact as re, nativeNotify as l } from "../../utils/nativeBridge.js";
8
- import { EmptyState as ie } from "../components/EmptyState.js";
9
- import { FormField as u, Input as d, Textarea as f } from "../components/Input.js";
10
- import { useCreatePolicy as ae, useDeletePolicy as oe, usePolicy as se, useUpdatePolicy as ce } from "../hooks/usePolicies.js";
11
- import { toUnion as p } from "../utils/unions.js";
4
+ import { Card as r, CardContent as i, CardDescription as a, CardHeader as o, CardTitle as s } from "../components/Card.js";
5
+ import { Button as c } from "../components/Button.js";
6
+ import { Badge as ee, StatusBadge as te } from "../components/Badge.js";
7
+ import { isNative as l, nativeImpact as ne, nativeNotify as u } from "../../utils/nativeBridge.js";
8
+ import { EmptyState as re } from "../components/EmptyState.js";
9
+ import { FormField as d, Input as f, Textarea as p } from "../components/Input.js";
10
+ import { useCreatePolicy as ie, useDeletePolicy as ae, usePolicy as oe, useUpdatePolicy as se } from "../hooks/usePolicies.js";
11
+ import { toUnion as m } from "../utils/unions.js";
12
12
  import "../hooks/index.js";
13
- import { useState as m } from "react";
14
- import { PagePurpose as le } from "@burdenoff/fe-libs/ui";
15
- import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
13
+ import { useState as h } from "react";
14
+ import { PagePurpose as ce } from "@burdenoff/fe-libs/ui";
15
+ import { Fragment as le, jsx as g, jsxs as _ } from "react/jsx-runtime";
16
16
  import { useParams as ue } from "react-router";
17
- import { AlertTriangle as v, ArrowLeft as de, Clock as y, Database as b, DollarSign as x, Edit as fe, FileText as S, Save as C, Settings as pe, Shield as w, Trash2 as T, Wrench as E } from "lucide-react";
17
+ import { AlertTriangle as v, ArrowLeft as de, Clock as y, Database as b, DollarSign as x, Edit as fe, FileText as S, Power as pe, Save as C, Settings as me, Shield as w, Trash2 as T, Wrench as E } from "lucide-react";
18
18
  import { toast as D } from "sonner";
19
19
  //#region src/botlit/pages/PolicyDetailPage.tsx
20
20
  var O = [
@@ -25,11 +25,15 @@ var O = [
25
25
  "BUDGET",
26
26
  "RATE_LIMIT",
27
27
  "RETENTION"
28
- ], me = [
28
+ ], he = [
29
29
  "PRIVATE",
30
30
  "WORKSPACE",
31
31
  "PUBLIC"
32
- ], k = ({ type: e }) => ({
32
+ ];
33
+ function k(e) {
34
+ return e.split(",").map((e) => e.trim()).filter(Boolean);
35
+ }
36
+ var A = ({ type: e }) => ({
33
37
  CONTENT: /* @__PURE__ */ g(v, { size: 18 }),
34
38
  TOOL: /* @__PURE__ */ g(E, { size: 18 }),
35
39
  DATA: /* @__PURE__ */ g(b, { size: 18 }),
@@ -37,85 +41,96 @@ var O = [
37
41
  BUDGET: /* @__PURE__ */ g(x, { size: 18 }),
38
42
  RATE_LIMIT: /* @__PURE__ */ g(y, { size: 18 }),
39
43
  RETENTION: /* @__PURE__ */ g(T, { size: 18 })
40
- })[e] || /* @__PURE__ */ g(w, { size: 18 }), he = {
44
+ })[e] || /* @__PURE__ */ g(w, { size: 18 }), ge = {
41
45
  CONTENT: "Content Policy",
42
46
  TOOL: "Tool Policy",
43
47
  DATA: "Data Policy",
44
- RESPONSE: "Response Policy",
48
+ RESPONSE: "Response & Model Policy",
45
49
  BUDGET: "Budget Policy",
46
50
  RATE_LIMIT: "Rate Limit Policy",
47
51
  RETENTION: "Retention Policy"
48
- }, A = ({ isNew: b }) => {
49
- let { policyId: S } = ue(), { navigateTo: A } = e(), { data: j, loading: M } = se(b ? void 0 : S), { create: N, loading: P } = ae(), { update: F, loading: I } = ce(), { remove: L, loading: ge } = oe(), [R, z] = m(!1), [_e, B] = m(!1), [V, H] = m({
52
+ }, j = ({ isNew: b }) => {
53
+ let { policyId: j } = ue(), { navigateTo: M } = e(), { data: N, loading: _e, refetch: P } = oe(b ? void 0 : j), { create: ve, loading: ye } = ie(), { update: F, loading: I } = se(), { remove: be, loading: xe } = ae(), [L, R] = h(!1), [Se, z] = h(!1), [B, V] = h({
50
54
  name: "",
51
55
  description: "",
52
56
  type: "CONTENT",
53
57
  visibility: "PRIVATE"
54
- }), [U, W] = m({
58
+ }), [H, U] = h({
55
59
  jailbreakDetection: !0,
56
60
  piiDetection: !0,
57
61
  toxicityThreshold: .7,
58
62
  customPatterns: ""
59
- }), [G, K] = m({
63
+ }), [W, G] = h({
60
64
  allowedTools: "",
61
65
  deniedTools: "",
62
66
  maxCallsPerExecution: 10,
63
67
  timeoutSeconds: 30
64
- }), [q, J] = m({
68
+ }), [K, q] = h({
65
69
  maxTokensPerExecution: 1e4,
66
70
  maxCostPerExecution: 1,
67
71
  allowEscalation: !1,
68
72
  maxModelTier: "gpt-4"
69
- }), [Y, X] = m({
73
+ }), [J, Y] = h({
70
74
  requestsPerMinute: 60,
71
75
  requestsPerHour: 1e3,
72
76
  tokensPerMinute: 1e5,
73
77
  scope: "app"
74
- }), [Z, Q] = m({
78
+ }), [X, Ce] = h({
79
+ allowedModels: "",
80
+ allowedProviders: ""
81
+ }), [we, Te] = h(!1), [Z, Ee] = h({
75
82
  executionDataRetentionDays: 90,
76
83
  payloadSnapshotsEnabled: !0
77
- }), ve = async () => {
78
- if (!V.name) return;
84
+ }), De = async () => {
85
+ if (!B.name) return;
79
86
  let e;
80
- switch (V.type) {
87
+ switch (B.type) {
81
88
  case "CONTENT":
82
89
  e = {
83
- jailbreakDetection: U.jailbreakDetection,
84
- piiDetection: U.piiDetection,
85
- toxicityThreshold: U.toxicityThreshold,
86
- customPatterns: U.customPatterns.split("\n").filter(Boolean)
90
+ jailbreakDetection: H.jailbreakDetection,
91
+ piiDetection: H.piiDetection,
92
+ toxicityThreshold: H.toxicityThreshold,
93
+ customPatterns: H.customPatterns.split("\n").filter(Boolean)
87
94
  };
88
95
  break;
89
96
  case "TOOL":
90
97
  e = {
91
- allowedTools: G.allowedTools.split(",").map((e) => e.trim()).filter(Boolean),
92
- deniedTools: G.deniedTools.split(",").map((e) => e.trim()).filter(Boolean),
98
+ allowedTools: W.allowedTools.split(",").map((e) => e.trim()).filter(Boolean),
99
+ deniedTools: W.deniedTools.split(",").map((e) => e.trim()).filter(Boolean),
93
100
  limits: {
94
- maxCallsPerExecution: G.maxCallsPerExecution,
95
- timeoutSeconds: G.timeoutSeconds
101
+ maxCallsPerExecution: W.maxCallsPerExecution,
102
+ timeoutSeconds: W.timeoutSeconds
96
103
  }
97
104
  };
98
105
  break;
99
106
  case "BUDGET":
100
107
  e = {
101
- maxTokensPerExecution: q.maxTokensPerExecution,
102
- maxCostPerExecution: q.maxCostPerExecution,
108
+ maxTokensPerExecution: K.maxTokensPerExecution,
109
+ maxCostPerExecution: K.maxCostPerExecution,
103
110
  modelEscalationConstraints: {
104
- allowEscalation: q.allowEscalation,
105
- maxModelTier: q.maxModelTier
111
+ allowEscalation: K.allowEscalation,
112
+ maxModelTier: K.maxModelTier
106
113
  }
107
114
  };
108
115
  break;
109
116
  case "RATE_LIMIT":
110
117
  e = {
111
118
  limits: {
112
- requestsPerMinute: Y.requestsPerMinute,
113
- requestsPerHour: Y.requestsPerHour,
114
- tokensPerMinute: Y.tokensPerMinute
119
+ requestsPerMinute: J.requestsPerMinute,
120
+ requestsPerHour: J.requestsPerHour,
121
+ tokensPerMinute: J.tokensPerMinute
115
122
  },
116
- scope: Y.scope
123
+ scope: J.scope
117
124
  };
118
125
  break;
126
+ case "RESPONSE": {
127
+ let t = k(X.allowedModels), n = k(X.allowedProviders).map((e) => e.toUpperCase());
128
+ e = {
129
+ ...t.length > 0 ? { allowedModels: t } : {},
130
+ ...n.length > 0 ? { allowedProviders: n } : {}
131
+ };
132
+ break;
133
+ }
119
134
  case "RETENTION":
120
135
  e = {
121
136
  executionDataRetentionDays: Z.executionDataRetentionDays,
@@ -124,91 +139,105 @@ var O = [
124
139
  break;
125
140
  }
126
141
  try {
127
- await N({
128
- name: V.name,
129
- description: V.description,
130
- type: V.type,
131
- visibility: V.visibility,
142
+ await ve({
143
+ name: B.name,
144
+ description: B.description,
145
+ type: B.type,
146
+ visibility: B.visibility,
147
+ status: we ? "ACTIVE" : "DRAFT",
132
148
  config: e
133
149
  });
134
150
  } catch (e) {
135
151
  D.error(e instanceof Error ? e.message : "Failed to create policy");
136
152
  return;
137
153
  }
138
- D.success(`Policy "${V.name}" created`), A("policies");
139
- }, ye = async () => {
140
- if (!(!S || !V.name)) {
154
+ D.success(`Policy "${B.name}" created`), M("policies");
155
+ }, Oe = async () => {
156
+ if (!(!j || !B.name)) {
141
157
  try {
142
158
  await F({
143
- policyId: S,
159
+ policyId: j,
144
160
  input: {
145
- name: V.name,
146
- description: V.description,
147
- visibility: V.visibility
161
+ name: B.name,
162
+ description: B.description,
163
+ visibility: B.visibility
148
164
  }
149
165
  });
150
166
  } catch (e) {
151
167
  D.error(e instanceof Error ? e.message : "Failed to update policy");
152
168
  return;
153
169
  }
154
- D.success("Policy updated"), z(!1);
170
+ await P(), D.success("Policy updated"), R(!1);
155
171
  }
156
- }, be = async () => {
157
- if (S) try {
158
- await L(S), c() && l("success"), A("policies");
172
+ }, ke = async () => {
173
+ if (j) try {
174
+ await be(j), l() && u("success"), M("policies");
159
175
  } catch (e) {
160
- throw c() && l("error"), e;
176
+ throw l() && u("error"), e;
177
+ }
178
+ }, Q = N?.status === "ACTIVE", Ae = async () => {
179
+ if (!j) return;
180
+ let e = Q ? "DRAFT" : "ACTIVE";
181
+ try {
182
+ await F({
183
+ policyId: j,
184
+ input: { status: e }
185
+ });
186
+ } catch (e) {
187
+ D.error(e instanceof Error ? e.message : "Failed to update policy");
188
+ return;
161
189
  }
162
- }, xe = () => {
163
- j && (H({
164
- name: j.name,
165
- description: j.description || "",
166
- type: p(j.type, O, "CONTENT"),
167
- visibility: p(j.visibility, me, "PRIVATE")
168
- }), z(!0));
190
+ await P(), D.success(e === "ACTIVE" ? "Policy is now enforced" : "Policy is no longer enforced");
191
+ }, je = () => {
192
+ N && (V({
193
+ name: N.name,
194
+ description: N.description || "",
195
+ type: m(N.type, O, "CONTENT"),
196
+ visibility: m(N.visibility, he, "PRIVATE")
197
+ }), R(!0));
169
198
  };
170
199
  if (b) return /* @__PURE__ */ g(n, {
171
200
  title: "Create Policy",
172
201
  description: "Define guardrails and constraints for your AI agents",
173
202
  actions: /* @__PURE__ */ _("div", {
174
203
  className: "flex gap-2",
175
- children: [/* @__PURE__ */ g(s, {
204
+ children: [/* @__PURE__ */ g(c, {
176
205
  variant: "outline",
177
- onClick: () => A("policies"),
206
+ onClick: () => M("policies"),
178
207
  children: "Cancel"
179
- }), /* @__PURE__ */ g(s, {
208
+ }), /* @__PURE__ */ g(c, {
180
209
  leftIcon: /* @__PURE__ */ g(C, { size: 16 }),
181
- onClick: ve,
182
- isLoading: P,
183
- disabled: !V.name,
210
+ onClick: De,
211
+ isLoading: ye,
212
+ disabled: !B.name,
184
213
  children: "Create"
185
214
  })]
186
215
  }),
187
216
  children: /* @__PURE__ */ _("div", {
188
217
  className: "max-w-2xl space-y-6",
189
218
  children: [
190
- /* @__PURE__ */ _(r, { children: [/* @__PURE__ */ g(a, { children: /* @__PURE__ */ g(o, { children: "Basic Information" }) }), /* @__PURE__ */ _(i, {
219
+ /* @__PURE__ */ _(r, { children: [/* @__PURE__ */ g(o, { children: /* @__PURE__ */ g(s, { children: "Basic Information" }) }), /* @__PURE__ */ _(i, {
191
220
  className: "space-y-4",
192
221
  children: [
193
- /* @__PURE__ */ g(u, {
222
+ /* @__PURE__ */ g(d, {
194
223
  label: "Policy Name",
195
224
  required: !0,
196
- children: /* @__PURE__ */ g(d, {
225
+ children: /* @__PURE__ */ g(f, {
197
226
  placeholder: "e.g., Production Content Policy",
198
- value: V.name,
199
- onChange: (e) => H({
200
- ...V,
227
+ value: B.name,
228
+ onChange: (e) => V({
229
+ ...B,
201
230
  name: e.target.value
202
231
  })
203
232
  })
204
233
  }),
205
- /* @__PURE__ */ g(u, {
234
+ /* @__PURE__ */ g(d, {
206
235
  label: "Description",
207
- children: /* @__PURE__ */ g(f, {
236
+ children: /* @__PURE__ */ g(p, {
208
237
  placeholder: "What does this policy enforce?",
209
- value: V.description,
210
- onChange: (e) => H({
211
- ...V,
238
+ value: B.description,
239
+ onChange: (e) => V({
240
+ ...B,
212
241
  description: e.target.value
213
242
  }),
214
243
  rows: 3
@@ -216,14 +245,14 @@ var O = [
216
245
  }),
217
246
  /* @__PURE__ */ _("div", {
218
247
  className: "grid grid-cols-2 gap-4",
219
- children: [/* @__PURE__ */ g(u, {
248
+ children: [/* @__PURE__ */ g(d, {
220
249
  label: "Policy Type",
221
250
  required: !0,
222
251
  children: /* @__PURE__ */ _("select", {
223
252
  className: "flex h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm",
224
- value: V.type,
225
- onChange: (e) => H({
226
- ...V,
253
+ value: B.type,
254
+ onChange: (e) => V({
255
+ ...B,
227
256
  type: e.target.value
228
257
  }),
229
258
  children: [
@@ -241,7 +270,7 @@ var O = [
241
270
  }),
242
271
  /* @__PURE__ */ g("option", {
243
272
  value: "RESPONSE",
244
- children: "Response Policy"
273
+ children: "Response & Model Policy"
245
274
  }),
246
275
  /* @__PURE__ */ g("option", {
247
276
  value: "BUDGET",
@@ -257,13 +286,13 @@ var O = [
257
286
  })
258
287
  ]
259
288
  })
260
- }), /* @__PURE__ */ g(u, {
289
+ }), /* @__PURE__ */ g(d, {
261
290
  label: "Visibility",
262
291
  children: /* @__PURE__ */ _("select", {
263
292
  className: "flex h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm",
264
- value: V.visibility,
265
- onChange: (e) => H({
266
- ...V,
293
+ value: B.visibility,
294
+ onChange: (e) => V({
295
+ ...B,
267
296
  visibility: e.target.value
268
297
  }),
269
298
  children: [
@@ -285,7 +314,7 @@ var O = [
285
314
  })
286
315
  ]
287
316
  })] }),
288
- V.type === "CONTENT" && /* @__PURE__ */ _(r, { children: [/* @__PURE__ */ g(a, { children: /* @__PURE__ */ _(o, {
317
+ B.type === "CONTENT" && /* @__PURE__ */ _(r, { children: [/* @__PURE__ */ g(o, { children: /* @__PURE__ */ _(s, {
289
318
  className: "flex items-center gap-2",
290
319
  children: [/* @__PURE__ */ g(v, { size: 18 }), "Content Policy Configuration"]
291
320
  }) }), /* @__PURE__ */ _(i, {
@@ -298,9 +327,9 @@ var O = [
298
327
  children: [/* @__PURE__ */ g("input", {
299
328
  type: "checkbox",
300
329
  id: "jailbreak",
301
- checked: U.jailbreakDetection,
302
- onChange: (e) => W({
303
- ...U,
330
+ checked: H.jailbreakDetection,
331
+ onChange: (e) => U({
332
+ ...H,
304
333
  jailbreakDetection: e.target.checked
305
334
  }),
306
335
  className: "h-4 w-4"
@@ -314,9 +343,9 @@ var O = [
314
343
  children: [/* @__PURE__ */ g("input", {
315
344
  type: "checkbox",
316
345
  id: "pii",
317
- checked: U.piiDetection,
318
- onChange: (e) => W({
319
- ...U,
346
+ checked: H.piiDetection,
347
+ onChange: (e) => U({
348
+ ...H,
320
349
  piiDetection: e.target.checked
321
350
  }),
322
351
  className: "h-4 w-4"
@@ -327,29 +356,29 @@ var O = [
327
356
  })]
328
357
  })]
329
358
  }),
330
- /* @__PURE__ */ g(u, {
359
+ /* @__PURE__ */ g(d, {
331
360
  label: "Toxicity Threshold",
332
361
  description: "0.0 to 1.0",
333
- children: /* @__PURE__ */ g(d, {
362
+ children: /* @__PURE__ */ g(f, {
334
363
  type: "number",
335
364
  min: 0,
336
365
  max: 1,
337
366
  step: .1,
338
- value: U.toxicityThreshold,
339
- onChange: (e) => W({
340
- ...U,
367
+ value: H.toxicityThreshold,
368
+ onChange: (e) => U({
369
+ ...H,
341
370
  toxicityThreshold: parseFloat(e.target.value)
342
371
  })
343
372
  })
344
373
  }),
345
- /* @__PURE__ */ g(u, {
374
+ /* @__PURE__ */ g(d, {
346
375
  label: "Custom Patterns",
347
376
  description: "One regex pattern per line",
348
- children: /* @__PURE__ */ g(f, {
377
+ children: /* @__PURE__ */ g(p, {
349
378
  placeholder: "Enter custom patterns...",
350
- value: U.customPatterns,
351
- onChange: (e) => W({
352
- ...U,
379
+ value: H.customPatterns,
380
+ onChange: (e) => U({
381
+ ...H,
353
382
  customPatterns: e.target.value
354
383
  }),
355
384
  rows: 3
@@ -357,57 +386,57 @@ var O = [
357
386
  })
358
387
  ]
359
388
  })] }),
360
- V.type === "TOOL" && /* @__PURE__ */ _(r, { children: [/* @__PURE__ */ g(a, { children: /* @__PURE__ */ _(o, {
389
+ B.type === "TOOL" && /* @__PURE__ */ _(r, { children: [/* @__PURE__ */ g(o, { children: /* @__PURE__ */ _(s, {
361
390
  className: "flex items-center gap-2",
362
391
  children: [/* @__PURE__ */ g(E, { size: 18 }), "Tool Policy Configuration"]
363
392
  }) }), /* @__PURE__ */ _(i, {
364
393
  className: "space-y-4",
365
394
  children: [
366
- /* @__PURE__ */ g(u, {
395
+ /* @__PURE__ */ g(d, {
367
396
  label: "Allowed Tools",
368
397
  description: "Comma-separated tool IDs",
369
- children: /* @__PURE__ */ g(d, {
398
+ children: /* @__PURE__ */ g(f, {
370
399
  placeholder: "e.g., search, read_file, web_browse",
371
- value: G.allowedTools,
372
- onChange: (e) => K({
373
- ...G,
400
+ value: W.allowedTools,
401
+ onChange: (e) => G({
402
+ ...W,
374
403
  allowedTools: e.target.value
375
404
  })
376
405
  })
377
406
  }),
378
- /* @__PURE__ */ g(u, {
407
+ /* @__PURE__ */ g(d, {
379
408
  label: "Denied Tools",
380
409
  description: "Comma-separated tool IDs",
381
- children: /* @__PURE__ */ g(d, {
410
+ children: /* @__PURE__ */ g(f, {
382
411
  placeholder: "e.g., delete_file, execute_code",
383
- value: G.deniedTools,
384
- onChange: (e) => K({
385
- ...G,
412
+ value: W.deniedTools,
413
+ onChange: (e) => G({
414
+ ...W,
386
415
  deniedTools: e.target.value
387
416
  })
388
417
  })
389
418
  }),
390
419
  /* @__PURE__ */ _("div", {
391
420
  className: "grid grid-cols-2 gap-4",
392
- children: [/* @__PURE__ */ g(u, {
421
+ children: [/* @__PURE__ */ g(d, {
393
422
  label: "Max Calls Per Execution",
394
- children: /* @__PURE__ */ g(d, {
423
+ children: /* @__PURE__ */ g(f, {
395
424
  type: "number",
396
425
  min: 1,
397
- value: G.maxCallsPerExecution,
398
- onChange: (e) => K({
399
- ...G,
426
+ value: W.maxCallsPerExecution,
427
+ onChange: (e) => G({
428
+ ...W,
400
429
  maxCallsPerExecution: parseInt(e.target.value)
401
430
  })
402
431
  })
403
- }), /* @__PURE__ */ g(u, {
432
+ }), /* @__PURE__ */ g(d, {
404
433
  label: "Timeout (seconds)",
405
- children: /* @__PURE__ */ g(d, {
434
+ children: /* @__PURE__ */ g(f, {
406
435
  type: "number",
407
436
  min: 1,
408
- value: G.timeoutSeconds,
409
- onChange: (e) => K({
410
- ...G,
437
+ value: W.timeoutSeconds,
438
+ onChange: (e) => G({
439
+ ...W,
411
440
  timeoutSeconds: parseInt(e.target.value)
412
441
  })
413
442
  })
@@ -415,7 +444,7 @@ var O = [
415
444
  })
416
445
  ]
417
446
  })] }),
418
- V.type === "BUDGET" && /* @__PURE__ */ _(r, { children: [/* @__PURE__ */ g(a, { children: /* @__PURE__ */ _(o, {
447
+ B.type === "BUDGET" && /* @__PURE__ */ _(r, { children: [/* @__PURE__ */ g(o, { children: /* @__PURE__ */ _(s, {
419
448
  className: "flex items-center gap-2",
420
449
  children: [/* @__PURE__ */ g(x, { size: 18 }), "Budget Policy Configuration"]
421
450
  }) }), /* @__PURE__ */ _(i, {
@@ -423,26 +452,26 @@ var O = [
423
452
  children: [
424
453
  /* @__PURE__ */ _("div", {
425
454
  className: "grid grid-cols-2 gap-4",
426
- children: [/* @__PURE__ */ g(u, {
455
+ children: [/* @__PURE__ */ g(d, {
427
456
  label: "Max Tokens Per Execution",
428
- children: /* @__PURE__ */ g(d, {
457
+ children: /* @__PURE__ */ g(f, {
429
458
  type: "number",
430
459
  min: 100,
431
- value: q.maxTokensPerExecution,
432
- onChange: (e) => J({
433
- ...q,
460
+ value: K.maxTokensPerExecution,
461
+ onChange: (e) => q({
462
+ ...K,
434
463
  maxTokensPerExecution: parseInt(e.target.value)
435
464
  })
436
465
  })
437
- }), /* @__PURE__ */ g(u, {
466
+ }), /* @__PURE__ */ g(d, {
438
467
  label: "Max Cost Per Execution ($)",
439
- children: /* @__PURE__ */ g(d, {
468
+ children: /* @__PURE__ */ g(f, {
440
469
  type: "number",
441
470
  min: .01,
442
471
  step: .01,
443
- value: q.maxCostPerExecution,
444
- onChange: (e) => J({
445
- ...q,
472
+ value: K.maxCostPerExecution,
473
+ onChange: (e) => q({
474
+ ...K,
446
475
  maxCostPerExecution: parseFloat(e.target.value)
447
476
  })
448
477
  })
@@ -453,9 +482,9 @@ var O = [
453
482
  children: [/* @__PURE__ */ g("input", {
454
483
  type: "checkbox",
455
484
  id: "escalation",
456
- checked: q.allowEscalation,
457
- onChange: (e) => J({
458
- ...q,
485
+ checked: K.allowEscalation,
486
+ onChange: (e) => q({
487
+ ...K,
459
488
  allowEscalation: e.target.checked
460
489
  }),
461
490
  className: "h-4 w-4"
@@ -465,13 +494,13 @@ var O = [
465
494
  children: "Allow Model Escalation"
466
495
  })]
467
496
  }),
468
- /* @__PURE__ */ g(u, {
497
+ /* @__PURE__ */ g(d, {
469
498
  label: "Max Model Tier",
470
499
  children: /* @__PURE__ */ _("select", {
471
500
  className: "flex h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm",
472
- value: q.maxModelTier,
473
- onChange: (e) => J({
474
- ...q,
501
+ value: K.maxModelTier,
502
+ onChange: (e) => q({
503
+ ...K,
475
504
  maxModelTier: e.target.value
476
505
  }),
477
506
  children: [
@@ -500,7 +529,7 @@ var O = [
500
529
  })
501
530
  ]
502
531
  })] }),
503
- V.type === "RATE_LIMIT" && /* @__PURE__ */ _(r, { children: [/* @__PURE__ */ g(a, { children: /* @__PURE__ */ _(o, {
532
+ B.type === "RATE_LIMIT" && /* @__PURE__ */ _(r, { children: [/* @__PURE__ */ g(o, { children: /* @__PURE__ */ _(s, {
504
533
  className: "flex items-center gap-2",
505
534
  children: [/* @__PURE__ */ g(y, { size: 18 }), "Rate Limit Configuration"]
506
535
  }) }), /* @__PURE__ */ _(i, {
@@ -508,50 +537,50 @@ var O = [
508
537
  children: [/* @__PURE__ */ _("div", {
509
538
  className: "grid grid-cols-3 gap-4",
510
539
  children: [
511
- /* @__PURE__ */ g(u, {
540
+ /* @__PURE__ */ g(d, {
512
541
  label: "Requests / Minute",
513
- children: /* @__PURE__ */ g(d, {
542
+ children: /* @__PURE__ */ g(f, {
514
543
  type: "number",
515
544
  min: 1,
516
- value: Y.requestsPerMinute,
517
- onChange: (e) => X({
518
- ...Y,
545
+ value: J.requestsPerMinute,
546
+ onChange: (e) => Y({
547
+ ...J,
519
548
  requestsPerMinute: parseInt(e.target.value)
520
549
  })
521
550
  })
522
551
  }),
523
- /* @__PURE__ */ g(u, {
552
+ /* @__PURE__ */ g(d, {
524
553
  label: "Requests / Hour",
525
- children: /* @__PURE__ */ g(d, {
554
+ children: /* @__PURE__ */ g(f, {
526
555
  type: "number",
527
556
  min: 1,
528
- value: Y.requestsPerHour,
529
- onChange: (e) => X({
530
- ...Y,
557
+ value: J.requestsPerHour,
558
+ onChange: (e) => Y({
559
+ ...J,
531
560
  requestsPerHour: parseInt(e.target.value)
532
561
  })
533
562
  })
534
563
  }),
535
- /* @__PURE__ */ g(u, {
564
+ /* @__PURE__ */ g(d, {
536
565
  label: "Tokens / Minute",
537
- children: /* @__PURE__ */ g(d, {
566
+ children: /* @__PURE__ */ g(f, {
538
567
  type: "number",
539
568
  min: 1,
540
- value: Y.tokensPerMinute,
541
- onChange: (e) => X({
542
- ...Y,
569
+ value: J.tokensPerMinute,
570
+ onChange: (e) => Y({
571
+ ...J,
543
572
  tokensPerMinute: parseInt(e.target.value)
544
573
  })
545
574
  })
546
575
  })
547
576
  ]
548
- }), /* @__PURE__ */ g(u, {
577
+ }), /* @__PURE__ */ g(d, {
549
578
  label: "Scope",
550
579
  children: /* @__PURE__ */ _("select", {
551
580
  className: "flex h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm",
552
- value: Y.scope,
553
- onChange: (e) => X({
554
- ...Y,
581
+ value: J.scope,
582
+ onChange: (e) => Y({
583
+ ...J,
555
584
  scope: e.target.value
556
585
  }),
557
586
  children: [
@@ -575,18 +604,70 @@ var O = [
575
604
  })
576
605
  })]
577
606
  })] }),
578
- V.type === "RETENTION" && /* @__PURE__ */ _(r, { children: [/* @__PURE__ */ g(a, { children: /* @__PURE__ */ _(o, {
607
+ B.type === "RESPONSE" && /* @__PURE__ */ _(r, { children: [/* @__PURE__ */ _(o, { children: [/* @__PURE__ */ _(s, {
608
+ className: "flex items-center gap-2",
609
+ children: [/* @__PURE__ */ g(S, { size: 18 }), "Model Usage Allowlist"]
610
+ }), /* @__PURE__ */ g(a, { 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__ */ _(i, {
611
+ className: "space-y-4",
612
+ children: [/* @__PURE__ */ g(d, {
613
+ label: "Allowed Models",
614
+ description: "Comma-separated model IDs. End an entry with * to allow a prefix.",
615
+ children: /* @__PURE__ */ g(f, {
616
+ placeholder: "e.g., gpt-4o-mini, anthropic.claude-*",
617
+ value: X.allowedModels,
618
+ onChange: (e) => Ce({
619
+ ...X,
620
+ allowedModels: e.target.value
621
+ })
622
+ })
623
+ }), /* @__PURE__ */ g(d, {
624
+ label: "Allowed Providers",
625
+ description: "Comma-separated provider types, e.g. OPENAI, ANTHROPIC, AWS_BEDROCK.",
626
+ children: /* @__PURE__ */ g(f, {
627
+ placeholder: "e.g., AWS_BEDROCK, ANTHROPIC",
628
+ value: X.allowedProviders,
629
+ onChange: (e) => Ce({
630
+ ...X,
631
+ allowedProviders: e.target.value
632
+ })
633
+ })
634
+ })]
635
+ })] }),
636
+ /* @__PURE__ */ g(r, { children: /* @__PURE__ */ g(i, {
637
+ className: "pt-6",
638
+ children: /* @__PURE__ */ _("div", {
639
+ className: "flex items-start gap-2",
640
+ children: [/* @__PURE__ */ g("input", {
641
+ type: "checkbox",
642
+ id: "activate-on-create",
643
+ checked: we,
644
+ onChange: (e) => Te(e.target.checked),
645
+ className: "mt-1 h-4 w-4"
646
+ }), /* @__PURE__ */ _("label", {
647
+ htmlFor: "activate-on-create",
648
+ className: "text-sm",
649
+ children: [/* @__PURE__ */ g("span", {
650
+ className: "font-medium",
651
+ children: "Enforce immediately"
652
+ }), /* @__PURE__ */ g("span", {
653
+ className: "block text-text-secondary",
654
+ children: "Only active policies are enforced. Leave unchecked to save this policy as a draft and activate it later."
655
+ })]
656
+ })]
657
+ })
658
+ }) }),
659
+ B.type === "RETENTION" && /* @__PURE__ */ _(r, { children: [/* @__PURE__ */ g(o, { children: /* @__PURE__ */ _(s, {
579
660
  className: "flex items-center gap-2",
580
661
  children: [/* @__PURE__ */ g(T, { size: 18 }), "Retention Policy Configuration"]
581
662
  }) }), /* @__PURE__ */ _(i, {
582
663
  className: "space-y-4",
583
- children: [/* @__PURE__ */ g(u, {
664
+ children: [/* @__PURE__ */ g(d, {
584
665
  label: "Execution Data Retention (days)",
585
- children: /* @__PURE__ */ g(d, {
666
+ children: /* @__PURE__ */ g(f, {
586
667
  type: "number",
587
668
  min: 1,
588
669
  value: Z.executionDataRetentionDays,
589
- onChange: (e) => Q({
670
+ onChange: (e) => Ee({
590
671
  ...Z,
591
672
  executionDataRetentionDays: parseInt(e.target.value)
592
673
  })
@@ -597,7 +678,7 @@ var O = [
597
678
  type: "checkbox",
598
679
  id: "snapshots",
599
680
  checked: Z.payloadSnapshotsEnabled,
600
- onChange: (e) => Q({
681
+ onChange: (e) => Ee({
601
682
  ...Z,
602
683
  payloadSnapshotsEnabled: e.target.checked
603
684
  }),
@@ -612,125 +693,135 @@ var O = [
612
693
  ]
613
694
  })
614
695
  });
615
- if (M) return /* @__PURE__ */ g(n, {
696
+ if (_e) return /* @__PURE__ */ g(n, {
616
697
  title: "Loading...",
617
698
  children: /* @__PURE__ */ g("div", { className: "h-96 bg-bg-sunken motion-safe:animate-vc-shimmer rounded-lg" })
618
699
  });
619
- if (!j) return /* @__PURE__ */ g(n, {
700
+ if (!N) return /* @__PURE__ */ g(n, {
620
701
  title: "Policy Not Found",
621
- children: /* @__PURE__ */ g(ie, {
702
+ children: /* @__PURE__ */ g(re, {
622
703
  illustration: "empty-generic",
623
704
  title: "Policy Not Found",
624
705
  description: "This policy doesn't exist.",
625
- action: /* @__PURE__ */ g(s, {
626
- onClick: () => A("policies"),
706
+ action: /* @__PURE__ */ g(c, {
707
+ onClick: () => M("policies"),
627
708
  children: "Back to Policies"
628
709
  })
629
710
  })
630
711
  });
631
- let $ = p(j.type, O, "CONTENT");
712
+ let $ = m(N.type, O, "CONTENT");
632
713
  return /* @__PURE__ */ g(n, {
633
714
  title: /* @__PURE__ */ _("div", {
634
715
  className: "flex items-center gap-3",
635
716
  children: [
636
- /* @__PURE__ */ g(s, {
717
+ /* @__PURE__ */ g(c, {
637
718
  variant: "ghost",
638
719
  size: "icon",
639
- onClick: () => A("policies"),
720
+ onClick: () => M("policies"),
640
721
  children: /* @__PURE__ */ g(de, { size: 20 })
641
722
  }),
642
723
  /* @__PURE__ */ g("div", {
643
724
  className: "p-2 rounded-lg bg-action-primary-bg/10",
644
- children: /* @__PURE__ */ g(k, { type: $ })
725
+ children: /* @__PURE__ */ g(A, { type: $ })
645
726
  }),
646
727
  /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("div", {
647
728
  className: "flex items-center gap-2",
648
- children: [/* @__PURE__ */ g("span", { children: j.name }), /* @__PURE__ */ g(ne, { status: j.status })]
729
+ children: [/* @__PURE__ */ g("span", { children: N.name }), /* @__PURE__ */ g(te, { status: N.status })]
649
730
  }), /* @__PURE__ */ g("p", {
650
731
  className: "text-sm font-normal text-text-secondary",
651
- children: j.description
732
+ children: N.description
652
733
  })] })
653
734
  ]
654
735
  }),
655
736
  actions: /* @__PURE__ */ g("div", {
656
737
  className: "flex gap-2",
657
- children: R ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(s, {
738
+ children: L ? /* @__PURE__ */ _(le, { children: [/* @__PURE__ */ g(c, {
658
739
  variant: "outline",
659
- onClick: () => z(!1),
740
+ onClick: () => R(!1),
660
741
  children: "Cancel"
661
- }), /* @__PURE__ */ g(s, {
742
+ }), /* @__PURE__ */ g(c, {
662
743
  leftIcon: /* @__PURE__ */ g(C, { size: 16 }),
663
- onClick: ye,
744
+ onClick: Oe,
664
745
  isLoading: I,
665
- disabled: !V.name,
746
+ disabled: !B.name,
666
747
  children: "Save Changes"
667
- })] }) : /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(s, {
668
- variant: "outline",
669
- leftIcon: /* @__PURE__ */ g(fe, { size: 16 }),
670
- onClick: xe,
671
- children: "Edit"
672
- }), _e ? /* @__PURE__ */ _("div", {
673
- className: "flex gap-2",
674
- children: [/* @__PURE__ */ g(s, {
748
+ })] }) : /* @__PURE__ */ _(le, { children: [
749
+ /* @__PURE__ */ g(c, {
750
+ variant: Q ? "outline" : "default",
751
+ leftIcon: /* @__PURE__ */ g(pe, { size: 16 }),
752
+ onClick: () => void Ae(),
753
+ isLoading: I,
754
+ children: Q ? "Deactivate" : "Activate"
755
+ }),
756
+ /* @__PURE__ */ g(c, {
675
757
  variant: "outline",
676
- size: "sm",
677
- onClick: () => B(!1),
678
- children: "Cancel"
679
- }), /* @__PURE__ */ g(s, {
758
+ leftIcon: /* @__PURE__ */ g(fe, { size: 16 }),
759
+ onClick: je,
760
+ children: "Edit"
761
+ }),
762
+ Se ? /* @__PURE__ */ _("div", {
763
+ className: "flex gap-2",
764
+ children: [/* @__PURE__ */ g(c, {
765
+ variant: "outline",
766
+ size: "sm",
767
+ onClick: () => z(!1),
768
+ children: "Cancel"
769
+ }), /* @__PURE__ */ g(c, {
770
+ variant: "destructive",
771
+ size: "sm",
772
+ onClick: () => {
773
+ ne("medium"), ke();
774
+ },
775
+ isLoading: xe,
776
+ children: "Confirm Delete"
777
+ })]
778
+ }) : /* @__PURE__ */ g(c, {
680
779
  variant: "destructive",
681
- size: "sm",
682
- onClick: () => {
683
- re("medium"), be();
684
- },
685
- isLoading: ge,
686
- children: "Confirm Delete"
687
- })]
688
- }) : /* @__PURE__ */ g(s, {
689
- variant: "destructive",
690
- leftIcon: /* @__PURE__ */ g(T, { size: 16 }),
691
- onClick: () => B(!0),
692
- children: "Delete"
693
- })] })
780
+ leftIcon: /* @__PURE__ */ g(T, { size: 16 }),
781
+ onClick: () => z(!0),
782
+ children: "Delete"
783
+ })
784
+ ] })
694
785
  }),
695
786
  children: /* @__PURE__ */ _("div", {
696
787
  className: "space-y-6",
697
788
  children: [
698
- /* @__PURE__ */ g(le, {
789
+ /* @__PURE__ */ g(ce, {
699
790
  icon: /* @__PURE__ */ g(w, { size: 18 }),
700
791
  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."
701
792
  }),
702
- R && /* @__PURE__ */ _(r, { children: [/* @__PURE__ */ g(a, { children: /* @__PURE__ */ g(o, { children: "Edit Policy" }) }), /* @__PURE__ */ _(i, {
793
+ L && /* @__PURE__ */ _(r, { children: [/* @__PURE__ */ g(o, { children: /* @__PURE__ */ g(s, { children: "Edit Policy" }) }), /* @__PURE__ */ _(i, {
703
794
  className: "space-y-4",
704
795
  children: [
705
- /* @__PURE__ */ g(u, {
796
+ /* @__PURE__ */ g(d, {
706
797
  label: "Policy Name",
707
798
  required: !0,
708
- children: /* @__PURE__ */ g(d, {
709
- value: V.name,
710
- onChange: (e) => H({
711
- ...V,
799
+ children: /* @__PURE__ */ g(f, {
800
+ value: B.name,
801
+ onChange: (e) => V({
802
+ ...B,
712
803
  name: e.target.value
713
804
  })
714
805
  })
715
806
  }),
716
- /* @__PURE__ */ g(u, {
807
+ /* @__PURE__ */ g(d, {
717
808
  label: "Description",
718
- children: /* @__PURE__ */ g(f, {
719
- value: V.description,
720
- onChange: (e) => H({
721
- ...V,
809
+ children: /* @__PURE__ */ g(p, {
810
+ value: B.description,
811
+ onChange: (e) => V({
812
+ ...B,
722
813
  description: e.target.value
723
814
  }),
724
815
  rows: 3
725
816
  })
726
817
  }),
727
- /* @__PURE__ */ g(u, {
818
+ /* @__PURE__ */ g(d, {
728
819
  label: "Visibility",
729
820
  children: /* @__PURE__ */ _("select", {
730
821
  className: "flex h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm",
731
- value: V.visibility,
732
- onChange: (e) => H({
733
- ...V,
822
+ value: B.visibility,
823
+ onChange: (e) => V({
824
+ ...B,
734
825
  visibility: e.target.value
735
826
  }),
736
827
  children: [
@@ -766,11 +857,11 @@ var O = [
766
857
  children: [
767
858
  /* @__PURE__ */ g("div", {
768
859
  className: "p-3 rounded-full bg-action-primary-bg/10 w-fit mx-auto mb-2",
769
- children: /* @__PURE__ */ g(k, { type: $ })
860
+ children: /* @__PURE__ */ g(A, { type: $ })
770
861
  }),
771
862
  /* @__PURE__ */ g("p", {
772
863
  className: "text-lg font-bold",
773
- children: he[$]
864
+ children: ge[$]
774
865
  }),
775
866
  /* @__PURE__ */ g("p", {
776
867
  className: "text-sm text-text-secondary",
@@ -783,7 +874,7 @@ var O = [
783
874
  className: "pt-6 text-center",
784
875
  children: [/* @__PURE__ */ g("p", {
785
876
  className: "text-3xl font-bold text-text-primary capitalize",
786
- children: j.visibility.toLowerCase()
877
+ children: N.visibility.toLowerCase()
787
878
  }), /* @__PURE__ */ g("p", {
788
879
  className: "text-sm text-text-secondary",
789
880
  children: "Visibility"
@@ -793,7 +884,7 @@ var O = [
793
884
  className: "pt-6 text-center",
794
885
  children: [/* @__PURE__ */ g("p", {
795
886
  className: "text-3xl font-bold text-text-primary",
796
- children: j.revision
887
+ children: N.revision
797
888
  }), /* @__PURE__ */ g("p", {
798
889
  className: "text-sm text-text-secondary",
799
890
  children: "Revision"
@@ -803,7 +894,7 @@ var O = [
803
894
  className: "pt-6 text-center",
804
895
  children: [/* @__PURE__ */ g("p", {
805
896
  className: "text-lg font-bold text-text-primary",
806
- children: t(j.updatedAt)
897
+ children: t(N.updatedAt)
807
898
  }), /* @__PURE__ */ g("p", {
808
899
  className: "text-sm text-text-secondary",
809
900
  children: "Last Updated"
@@ -811,13 +902,13 @@ var O = [
811
902
  }) })
812
903
  ]
813
904
  }),
814
- /* @__PURE__ */ _(r, { children: [/* @__PURE__ */ _(a, { children: [/* @__PURE__ */ g(o, { children: "Configuration" }), /* @__PURE__ */ g(ee, { children: "Current policy configuration" })] }), /* @__PURE__ */ g(i, { children: /* @__PURE__ */ g("div", {
905
+ /* @__PURE__ */ _(r, { children: [/* @__PURE__ */ _(o, { children: [/* @__PURE__ */ g(s, { children: "Configuration" }), /* @__PURE__ */ g(a, { children: "Current policy configuration" })] }), /* @__PURE__ */ g(i, { children: /* @__PURE__ */ g("div", {
815
906
  className: "p-4 bg-bg-sunken rounded-lg font-mono text-sm overflow-auto",
816
- children: /* @__PURE__ */ g("pre", { children: JSON.stringify(j.config, null, 2) })
907
+ children: /* @__PURE__ */ g("pre", { children: JSON.stringify(N.config, null, 2) })
817
908
  }) })] }),
818
- /* @__PURE__ */ _(r, { children: [/* @__PURE__ */ g(a, { children: /* @__PURE__ */ _(o, {
909
+ /* @__PURE__ */ _(r, { children: [/* @__PURE__ */ g(o, { children: /* @__PURE__ */ _(s, {
819
910
  className: "flex items-center gap-2",
820
- children: [/* @__PURE__ */ g(pe, { size: 18 }), "Metadata"]
911
+ children: [/* @__PURE__ */ g(me, { size: 18 }), "Metadata"]
821
912
  }) }), /* @__PURE__ */ g(i, { children: /* @__PURE__ */ _("div", {
822
913
  className: "grid grid-cols-2 md:grid-cols-4 gap-6 text-sm",
823
914
  children: [
@@ -826,21 +917,21 @@ var O = [
826
917
  children: "Created"
827
918
  }), /* @__PURE__ */ g("p", {
828
919
  className: "font-medium",
829
- children: t(j.createdAt)
920
+ children: t(N.createdAt)
830
921
  })] }),
831
922
  /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
832
923
  className: "text-text-secondary",
833
924
  children: "Updated"
834
925
  }), /* @__PURE__ */ g("p", {
835
926
  className: "font-medium",
836
- children: t(j.updatedAt)
927
+ children: t(N.updatedAt)
837
928
  })] }),
838
929
  /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
839
930
  className: "text-text-secondary",
840
931
  children: "Tags"
841
932
  }), /* @__PURE__ */ g("div", {
842
933
  className: "flex gap-1",
843
- children: j.tags.length > 0 ? j.tags.map((e) => /* @__PURE__ */ g(te, {
934
+ children: N.tags.length > 0 ? N.tags.map((e) => /* @__PURE__ */ g(ee, {
844
935
  variant: "secondary",
845
936
  className: "text-xs",
846
937
  children: e
@@ -856,6 +947,6 @@ var O = [
856
947
  });
857
948
  };
858
949
  //#endregion
859
- export { A as PolicyDetailPage };
950
+ export { j as PolicyDetailPage };
860
951
 
861
952
  //# sourceMappingURL=PolicyDetailPage.js.map