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