@burdenoff/microfe-botmanor 2026.1127.8 → 2026.1201.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.
- package/dist/botlit/BotlitRoutes.js +40 -36
- package/dist/botlit/BotlitRoutes.js.map +1 -1
- package/dist/botlit/components/ToolApprovalPolicyFields.d.ts +15 -0
- package/dist/botlit/components/ToolApprovalPolicyFields.js +152 -0
- package/dist/botlit/components/ToolApprovalPolicyFields.js.map +1 -0
- package/dist/botlit/hooks/useToolApprovals.d.ts +44 -0
- package/dist/botlit/hooks/useToolApprovals.js +98 -0
- package/dist/botlit/hooks/useToolApprovals.js.map +1 -0
- package/dist/botlit/pages/PoliciesPage.js +16 -7
- package/dist/botlit/pages/PoliciesPage.js.map +1 -1
- package/dist/botlit/pages/PolicyDetailPage.js +438 -429
- package/dist/botlit/pages/PolicyDetailPage.js.map +1 -1
- package/dist/botlit/pages/ToolApprovalsPage.d.ts +4 -0
- package/dist/botlit/pages/ToolApprovalsPage.js +274 -0
- package/dist/botlit/pages/ToolApprovalsPage.js.map +1 -0
- package/dist/botlit/utils/policyConfig.d.ts +12 -0
- package/dist/botlit/utils/policyConfig.js +134 -76
- package/dist/botlit/utils/policyConfig.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
import { useTr as e } from "../../shared/hooks/useTr.js";
|
|
2
|
+
import { PageLayout as t } from "../components/PageLayout.js";
|
|
3
|
+
import { Card as n, CardContent as r, CardHeader as i, CardTitle as a } from "../components/Card.js";
|
|
4
|
+
import { BOTMANOR_PERMISSIONS as o } from "../permissions/botmanorPermissions.js";
|
|
5
|
+
import { BotmanorPermissionGate as s } from "../permissions/useBotmanorPermissions.js";
|
|
6
|
+
import { Button as c } from "../components/Button.js";
|
|
7
|
+
import { Badge as l } from "../components/Badge.js";
|
|
8
|
+
import { ErrorState as u } from "../components/ErrorState.js";
|
|
9
|
+
import { useDecideToolApproval as d, useToolApprovals as f } from "../hooks/useToolApprovals.js";
|
|
10
|
+
import { useBotlit as p } from "../providers/BotlitProvider.js";
|
|
11
|
+
import { formatRelativeTime as m } from "../utils/formatters.js";
|
|
12
|
+
import "../permissions/index.js";
|
|
13
|
+
import { useState as h } from "react";
|
|
14
|
+
import { PagePurpose as g, ResponsiveDialog as _, ResponsiveDialogContent as v, ResponsiveDialogDescription as y, ResponsiveDialogFooter as b, ResponsiveDialogHeader as x, ResponsiveDialogTitle as S, Textarea as C } from "@burdenoff/fe-libs/ui";
|
|
15
|
+
import { jsx as w, jsxs as T } from "react/jsx-runtime";
|
|
16
|
+
import { ArrowLeft as E, CheckCircle2 as D, ShieldAlert as O, XCircle as k } from "lucide-react";
|
|
17
|
+
import { toast as A } from "sonner";
|
|
18
|
+
// src/botlit/pages/ToolApprovalsPage.tsx
|
|
19
|
+
function j(e) {
|
|
20
|
+
return e === "PENDING" ? "warning" : e === "APPROVED" ? "success" : e === "DENIED" ? "destructive" : "outline";
|
|
21
|
+
}
|
|
22
|
+
function M(e) {
|
|
23
|
+
try {
|
|
24
|
+
return JSON.stringify(e ?? {}, null, 2);
|
|
25
|
+
} catch {
|
|
26
|
+
return String(e);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
var N = ({ request: t }) => {
|
|
30
|
+
let n = e();
|
|
31
|
+
return /* @__PURE__ */ T("div", {
|
|
32
|
+
className: "space-y-2 text-sm",
|
|
33
|
+
children: [
|
|
34
|
+
t.userMessage && /* @__PURE__ */ T("p", {
|
|
35
|
+
className: "break-words",
|
|
36
|
+
children: [/* @__PURE__ */ T("span", {
|
|
37
|
+
className: "text-text-secondary",
|
|
38
|
+
children: [n("botlit.toolApprovals.userAsked", "User asked:"), " "]
|
|
39
|
+
}), t.userMessage]
|
|
40
|
+
}),
|
|
41
|
+
/* @__PURE__ */ w("div", {
|
|
42
|
+
className: "flex flex-wrap gap-1",
|
|
43
|
+
children: t.reasons.map((e) => /* @__PURE__ */ w(l, {
|
|
44
|
+
variant: "outline",
|
|
45
|
+
children: e
|
|
46
|
+
}, e))
|
|
47
|
+
}),
|
|
48
|
+
/* @__PURE__ */ w("pre", {
|
|
49
|
+
className: "text-xs bg-bg-sunken rounded-md p-2 overflow-x-auto max-h-48 whitespace-pre-wrap break-all",
|
|
50
|
+
children: M(t.arguments)
|
|
51
|
+
})
|
|
52
|
+
]
|
|
53
|
+
});
|
|
54
|
+
}, P = () => {
|
|
55
|
+
let M = e(), { navigateTo: P, currentUser: F } = p(), I = f({ status: "PENDING" }), L = f({}), { decide: R, pendingId: z } = d(), [B, V] = h(null), [H, U] = h(""), W = L.data.filter((e) => e.status !== "PENDING").slice(0, 20), G = (e) => e && e === F?.id ? M("botlit.toolApprovals.you", "you") : e ?? "—", K = () => {
|
|
56
|
+
V(null), U("");
|
|
57
|
+
}, q = async () => {
|
|
58
|
+
if (B) try {
|
|
59
|
+
await R(B.request.id, B.decision, H), A.success(B.decision === "APPROVE" ? M("botlit.toolApprovals.toast.approved", "Approved — the tool is running and the agent will answer in the conversation") : M("botlit.toolApprovals.toast.denied", "Denied — the user is told it was not run")), K(), await Promise.all([I.refetch(), L.refetch()]);
|
|
60
|
+
} catch (e) {
|
|
61
|
+
A.error(e instanceof Error ? e.message : M("botlit.toolApprovals.toast.error", "Could not record the decision"));
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
return /* @__PURE__ */ T(t, {
|
|
65
|
+
title: /* @__PURE__ */ T("div", {
|
|
66
|
+
className: "flex items-center gap-3",
|
|
67
|
+
children: [/* @__PURE__ */ w(c, {
|
|
68
|
+
variant: "ghost",
|
|
69
|
+
size: "icon",
|
|
70
|
+
onClick: () => P("policies"),
|
|
71
|
+
children: /* @__PURE__ */ w(E, { size: 20 })
|
|
72
|
+
}), /* @__PURE__ */ w("span", { children: M("botlit.toolApprovals.title", "Tool approvals") })]
|
|
73
|
+
}),
|
|
74
|
+
description: M("botlit.toolApprovals.description", "Approve or deny risky tool calls your TOOL policies hold for a human"),
|
|
75
|
+
children: [/* @__PURE__ */ T("div", {
|
|
76
|
+
className: "space-y-6",
|
|
77
|
+
children: [
|
|
78
|
+
/* @__PURE__ */ w(g, {
|
|
79
|
+
icon: /* @__PURE__ */ w(O, { size: 18 }),
|
|
80
|
+
children: M("botlit.toolApprovals.purpose", "When a TOOL policy marks a tool, an MCP server or a risk level as needing approval, the agent does not run the call. It tells the user the call is waiting, and the request appears here. Approving runs the call and the agent posts its answer in the same conversation. Denying tells the user it was not run. Requests expire at the time shown.")
|
|
81
|
+
}),
|
|
82
|
+
/* @__PURE__ */ T(n, { children: [/* @__PURE__ */ w(i, { children: /* @__PURE__ */ w(a, { children: M("botlit.toolApprovals.pending.title", "Waiting for a decision") }) }), /* @__PURE__ */ w(r, { children: I.error ? /* @__PURE__ */ w(u, {
|
|
83
|
+
resource: M("botlit.toolApprovals.resource", "tool approvals"),
|
|
84
|
+
error: I.error,
|
|
85
|
+
onRetry: () => void I.refetch()
|
|
86
|
+
}) : I.loading && I.data.length === 0 ? /* @__PURE__ */ w("div", { className: "h-24 bg-bg-sunken motion-safe:animate-vc-shimmer rounded-lg" }) : I.data.length === 0 ? /* @__PURE__ */ w("p", {
|
|
87
|
+
className: "text-sm text-text-secondary",
|
|
88
|
+
children: M("botlit.toolApprovals.pending.empty", "No tool calls are waiting for approval.")
|
|
89
|
+
}) : /* @__PURE__ */ w("ul", {
|
|
90
|
+
className: "space-y-3",
|
|
91
|
+
"data-testid": "tool-approvals-pending",
|
|
92
|
+
children: I.data.map((e) => /* @__PURE__ */ T("li", {
|
|
93
|
+
className: "p-4 border border-border-subtle rounded-lg space-y-3",
|
|
94
|
+
"data-testid": `tool-approval-${e.id}`,
|
|
95
|
+
children: [
|
|
96
|
+
/* @__PURE__ */ T("div", {
|
|
97
|
+
className: "flex items-center gap-2 flex-wrap",
|
|
98
|
+
children: [
|
|
99
|
+
/* @__PURE__ */ w("button", {
|
|
100
|
+
type: "button",
|
|
101
|
+
className: "font-medium text-primary hover:underline",
|
|
102
|
+
onClick: () => P(`agents/${e.agentId}`),
|
|
103
|
+
children: e.agentName ?? e.agentId
|
|
104
|
+
}),
|
|
105
|
+
/* @__PURE__ */ T("span", {
|
|
106
|
+
className: "text-sm",
|
|
107
|
+
children: [
|
|
108
|
+
M("botlit.toolApprovals.wantsToRun", "wants to run"),
|
|
109
|
+
" ",
|
|
110
|
+
/* @__PURE__ */ w("code", {
|
|
111
|
+
className: "font-mono",
|
|
112
|
+
children: e.toolName
|
|
113
|
+
}),
|
|
114
|
+
" ",
|
|
115
|
+
M("botlit.toolApprovals.on", "on"),
|
|
116
|
+
" ",
|
|
117
|
+
e.connectionName
|
|
118
|
+
]
|
|
119
|
+
}),
|
|
120
|
+
/* @__PURE__ */ w(l, {
|
|
121
|
+
variant: e.riskLevel === "HIGH" ? "destructive" : "warning",
|
|
122
|
+
children: e.riskLevel
|
|
123
|
+
}),
|
|
124
|
+
e.mode === "REQUESTER" && /* @__PURE__ */ w(l, {
|
|
125
|
+
variant: "outline",
|
|
126
|
+
children: M("botlit.toolApprovals.requesterMode", "Requester confirms")
|
|
127
|
+
})
|
|
128
|
+
]
|
|
129
|
+
}),
|
|
130
|
+
/* @__PURE__ */ T("p", {
|
|
131
|
+
className: "text-xs text-text-secondary",
|
|
132
|
+
children: [
|
|
133
|
+
M("botlit.toolApprovals.requested", "Requested"),
|
|
134
|
+
" ",
|
|
135
|
+
m(e.createdAt),
|
|
136
|
+
" ·",
|
|
137
|
+
" ",
|
|
138
|
+
M("botlit.toolApprovals.expires", "expires"),
|
|
139
|
+
" ",
|
|
140
|
+
m(e.expiresAt)
|
|
141
|
+
]
|
|
142
|
+
}),
|
|
143
|
+
/* @__PURE__ */ w(N, { request: e }),
|
|
144
|
+
/* @__PURE__ */ T("div", {
|
|
145
|
+
className: "flex gap-2",
|
|
146
|
+
children: [/* @__PURE__ */ w(s, {
|
|
147
|
+
permission: o.AGENT_APPROVE,
|
|
148
|
+
children: /* @__PURE__ */ w(c, {
|
|
149
|
+
size: "sm",
|
|
150
|
+
leftIcon: /* @__PURE__ */ w(D, { size: 14 }),
|
|
151
|
+
isLoading: z === e.id && B?.decision === "APPROVE",
|
|
152
|
+
onClick: () => V({
|
|
153
|
+
decision: "APPROVE",
|
|
154
|
+
request: e
|
|
155
|
+
}),
|
|
156
|
+
children: M("botlit.toolApprovals.approve", "Approve")
|
|
157
|
+
})
|
|
158
|
+
}), /* @__PURE__ */ w(s, {
|
|
159
|
+
permission: o.AGENT_APPROVE,
|
|
160
|
+
children: /* @__PURE__ */ w(c, {
|
|
161
|
+
size: "sm",
|
|
162
|
+
variant: "destructive",
|
|
163
|
+
leftIcon: /* @__PURE__ */ w(k, { size: 14 }),
|
|
164
|
+
onClick: () => V({
|
|
165
|
+
decision: "DENY",
|
|
166
|
+
request: e
|
|
167
|
+
}),
|
|
168
|
+
children: M("botlit.toolApprovals.deny", "Deny")
|
|
169
|
+
})
|
|
170
|
+
})]
|
|
171
|
+
})
|
|
172
|
+
]
|
|
173
|
+
}, e.id))
|
|
174
|
+
}) })] }),
|
|
175
|
+
/* @__PURE__ */ T(n, { children: [/* @__PURE__ */ w(i, { children: /* @__PURE__ */ w(a, { children: M("botlit.toolApprovals.history.title", "Recent decisions") }) }), /* @__PURE__ */ w(r, { children: L.error ? /* @__PURE__ */ w(u, {
|
|
176
|
+
resource: M("botlit.toolApprovals.resource", "tool approvals"),
|
|
177
|
+
error: L.error,
|
|
178
|
+
onRetry: () => void L.refetch()
|
|
179
|
+
}) : L.loading && W.length === 0 ? /* @__PURE__ */ w("div", { className: "h-16 bg-bg-sunken motion-safe:animate-vc-shimmer rounded-lg" }) : W.length === 0 ? /* @__PURE__ */ w("p", {
|
|
180
|
+
className: "text-sm text-text-secondary",
|
|
181
|
+
children: M("botlit.toolApprovals.history.empty", "No decisions yet.")
|
|
182
|
+
}) : /* @__PURE__ */ w("ul", {
|
|
183
|
+
className: "space-y-2",
|
|
184
|
+
"data-testid": "tool-approvals-history",
|
|
185
|
+
children: W.map((e) => /* @__PURE__ */ T("li", {
|
|
186
|
+
className: "p-3 border border-border-subtle rounded-lg text-sm space-y-1",
|
|
187
|
+
children: [
|
|
188
|
+
/* @__PURE__ */ T("div", {
|
|
189
|
+
className: "flex items-center gap-2 flex-wrap",
|
|
190
|
+
children: [
|
|
191
|
+
/* @__PURE__ */ w("span", {
|
|
192
|
+
className: "font-medium",
|
|
193
|
+
children: e.agentName ?? e.agentId
|
|
194
|
+
}),
|
|
195
|
+
/* @__PURE__ */ w("code", {
|
|
196
|
+
className: "font-mono",
|
|
197
|
+
children: e.toolName
|
|
198
|
+
}),
|
|
199
|
+
/* @__PURE__ */ w(l, {
|
|
200
|
+
variant: j(e.status),
|
|
201
|
+
children: e.status
|
|
202
|
+
}),
|
|
203
|
+
e.resumeStatus && /* @__PURE__ */ T(l, {
|
|
204
|
+
variant: e.resumeStatus === "FAILED" ? "destructive" : "outline",
|
|
205
|
+
children: [
|
|
206
|
+
M("botlit.toolApprovals.run", "Run"),
|
|
207
|
+
": ",
|
|
208
|
+
e.resumeStatus
|
|
209
|
+
]
|
|
210
|
+
}),
|
|
211
|
+
/* @__PURE__ */ T("span", {
|
|
212
|
+
className: "text-text-secondary",
|
|
213
|
+
children: [
|
|
214
|
+
M("botlit.toolApprovals.by", "by"),
|
|
215
|
+
" ",
|
|
216
|
+
G(e.deciderId),
|
|
217
|
+
" ",
|
|
218
|
+
e.decidedAt ? m(e.decidedAt) : ""
|
|
219
|
+
]
|
|
220
|
+
})
|
|
221
|
+
]
|
|
222
|
+
}),
|
|
223
|
+
e.decisionNote && /* @__PURE__ */ w("p", {
|
|
224
|
+
className: "break-words",
|
|
225
|
+
children: e.decisionNote
|
|
226
|
+
}),
|
|
227
|
+
e.resumeError && /* @__PURE__ */ w("p", {
|
|
228
|
+
className: "break-words text-status-error-text",
|
|
229
|
+
children: e.resumeError
|
|
230
|
+
}),
|
|
231
|
+
e.resumeExecutionId && /* @__PURE__ */ w("button", {
|
|
232
|
+
type: "button",
|
|
233
|
+
className: "text-primary hover:underline",
|
|
234
|
+
onClick: () => P(`executions/${e.resumeExecutionId}`),
|
|
235
|
+
children: M("botlit.toolApprovals.viewRun", "View the resumed run")
|
|
236
|
+
})
|
|
237
|
+
]
|
|
238
|
+
}, e.id))
|
|
239
|
+
}) })] })
|
|
240
|
+
]
|
|
241
|
+
}), /* @__PURE__ */ w(_, {
|
|
242
|
+
open: B !== null,
|
|
243
|
+
onOpenChange: (e) => {
|
|
244
|
+
e || K();
|
|
245
|
+
},
|
|
246
|
+
children: /* @__PURE__ */ T(v, { children: [
|
|
247
|
+
/* @__PURE__ */ T(x, { children: [/* @__PURE__ */ w(S, { children: B?.decision === "APPROVE" ? M("botlit.toolApprovals.dialog.approveTitle", "Approve and run this tool call") : M("botlit.toolApprovals.dialog.denyTitle", "Deny this tool call") }), /* @__PURE__ */ w(y, { children: B?.decision === "APPROVE" ? M("botlit.toolApprovals.dialog.approveDescription", "The tool runs now with the arguments shown, and the agent posts its answer in the conversation.") : M("botlit.toolApprovals.dialog.denyDescription", "The tool is not run. The user is told the request was declined, with your reason.") })] }),
|
|
248
|
+
B && /* @__PURE__ */ w(N, { request: B.request }),
|
|
249
|
+
/* @__PURE__ */ w(C, {
|
|
250
|
+
"aria-label": M("botlit.toolApprovals.dialog.noteLabel", "Reason"),
|
|
251
|
+
value: H,
|
|
252
|
+
maxLength: 2e3,
|
|
253
|
+
onChange: (e) => U(e.target.value),
|
|
254
|
+
placeholder: B?.decision === "DENY" ? M("botlit.toolApprovals.dialog.reasonRequired", "Reason (required)") : M("botlit.toolApprovals.dialog.reasonOptional", "Note (optional)"),
|
|
255
|
+
rows: 3
|
|
256
|
+
}),
|
|
257
|
+
/* @__PURE__ */ T(b, { children: [/* @__PURE__ */ w(c, {
|
|
258
|
+
variant: "outline",
|
|
259
|
+
onClick: K,
|
|
260
|
+
children: M("botlit.common.cancel", "Cancel")
|
|
261
|
+
}), /* @__PURE__ */ w(c, {
|
|
262
|
+
variant: B?.decision === "DENY" ? "destructive" : "default",
|
|
263
|
+
isLoading: z !== null,
|
|
264
|
+
disabled: B?.decision === "DENY" && H.trim().length === 0,
|
|
265
|
+
onClick: () => void q(),
|
|
266
|
+
children: B?.decision === "APPROVE" ? M("botlit.toolApprovals.approve", "Approve") : M("botlit.toolApprovals.deny", "Deny")
|
|
267
|
+
})] })
|
|
268
|
+
] })
|
|
269
|
+
})]
|
|
270
|
+
});
|
|
271
|
+
};
|
|
272
|
+
export { P as ToolApprovalsPage, j as toolApprovalStatusVariant };
|
|
273
|
+
|
|
274
|
+
//# sourceMappingURL=ToolApprovalsPage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolApprovalsPage.js","names":["toolApprovalStatusVariant","status","argumentsText","value","ApprovalRequestDetails","t","useTr","request","Badge","reason","ToolApprovalsPage","useBotlit","pending","useToolApprovals","all","useDecideToolApproval","dialog","setDialog","useState","note","setNote","decided","who","id","currentUser","close","submitDecision","decide","toast","err","PageLayout","Button","navigateTo","ArrowLeft","PagePurpose","ShieldAlert","Card","CardHeader","CardTitle","CardContent","ErrorState","formatRelativeTime","BotmanorPermissionGate","BOTMANOR_PERMISSIONS","CheckCircle2","pendingId","XCircle","ResponsiveDialog","open","ResponsiveDialogContent","ResponsiveDialogHeader","ResponsiveDialogTitle","ResponsiveDialogDescription","Textarea","event","ResponsiveDialogFooter"],"sources":["../../../src/botlit/pages/ToolApprovalsPage.tsx"],"sourcesContent":["/**\n * Tool Approvals Page (BOFF-15360)\n * @module botlit/pages\n *\n * Approver queue for tool calls a TOOL policy holds for a human decision:\n * which agent wants to run which tool, with what arguments, why it needs\n * approval and when the request expires. Approving runs the call and the\n * agent posts its answer in the original conversation; denying (with a\n * reason) tells the user it was not run. Recent decisions show how each\n * resumed call ended.\n */\n\nimport { useState, type FC } from 'react';\nimport { ArrowLeft, CheckCircle2, ShieldAlert, XCircle } from 'lucide-react';\nimport { toast } from 'sonner';\nimport {\n ResponsiveDialog,\n ResponsiveDialogContent,\n ResponsiveDialogDescription,\n ResponsiveDialogFooter,\n ResponsiveDialogHeader,\n ResponsiveDialogTitle,\n PagePurpose,\n Textarea,\n} from '@burdenoff/fe-libs/ui';\nimport { useTr } from '../../shared/hooks/useTr';\nimport { PageLayout } from '../components/PageLayout';\nimport { Card, CardContent, CardHeader, CardTitle } from '../components/Card';\nimport { Button } from '../components/Button';\nimport { Badge } from '../components/Badge';\nimport { ErrorState } from '../components/ErrorState';\nimport {\n useDecideToolApproval,\n useToolApprovals,\n type ToolApprovalRecord,\n type ToolApprovalStatus,\n} from '../hooks/useToolApprovals';\nimport { useBotlit } from '../providers/BotlitProvider';\nimport { formatRelativeTime } from '../utils/formatters';\nimport { BOTMANOR_PERMISSIONS, BotmanorPermissionGate } from '../permissions';\n\nexport function toolApprovalStatusVariant(\n status: ToolApprovalStatus\n): 'warning' | 'success' | 'destructive' | 'outline' {\n if (status === 'PENDING') return 'warning';\n if (status === 'APPROVED') return 'success';\n if (status === 'DENIED') return 'destructive';\n return 'outline';\n}\n\nfunction argumentsText(value: unknown): string {\n try {\n return JSON.stringify(value ?? {}, null, 2);\n } catch {\n return String(value);\n }\n}\n\nconst ApprovalRequestDetails: FC<{ request: ToolApprovalRecord }> = ({ request }) => {\n const t = useTr();\n return (\n <div className=\"space-y-2 text-sm\">\n {request.userMessage && (\n <p className=\"break-words\">\n <span className=\"text-text-secondary\">\n {t('botlit.toolApprovals.userAsked', 'User asked:')}{' '}\n </span>\n {request.userMessage}\n </p>\n )}\n <div className=\"flex flex-wrap gap-1\">\n {request.reasons.map((reason) => (\n <Badge key={reason} variant=\"outline\">\n {reason}\n </Badge>\n ))}\n </div>\n <pre className=\"text-xs bg-bg-sunken rounded-md p-2 overflow-x-auto max-h-48 whitespace-pre-wrap break-all\">\n {argumentsText(request.arguments)}\n </pre>\n </div>\n );\n};\n\nexport const ToolApprovalsPage: FC = () => {\n const t = useTr();\n const { navigateTo, currentUser } = useBotlit();\n const pending = useToolApprovals({ status: 'PENDING' });\n const all = useToolApprovals({});\n const { decide, pendingId } = useDecideToolApproval();\n const [dialog, setDialog] = useState<{\n decision: 'APPROVE' | 'DENY';\n request: ToolApprovalRecord;\n } | null>(null);\n const [note, setNote] = useState('');\n\n const decided = all.data.filter((request) => request.status !== 'PENDING').slice(0, 20);\n const who = (id?: string | null): string =>\n id && id === currentUser?.id ? t('botlit.toolApprovals.you', 'you') : (id ?? '—');\n\n const close = (): void => {\n setDialog(null);\n setNote('');\n };\n\n const submitDecision = async (): Promise<void> => {\n if (!dialog) return;\n try {\n await decide(dialog.request.id, dialog.decision, note);\n toast.success(\n dialog.decision === 'APPROVE'\n ? t(\n 'botlit.toolApprovals.toast.approved',\n 'Approved — the tool is running and the agent will answer in the conversation'\n )\n : t('botlit.toolApprovals.toast.denied', 'Denied — the user is told it was not run')\n );\n close();\n await Promise.all([pending.refetch(), all.refetch()]);\n } catch (err: unknown) {\n toast.error(\n err instanceof Error\n ? err.message\n : t('botlit.toolApprovals.toast.error', 'Could not record the decision')\n );\n }\n };\n\n return (\n <PageLayout\n title={\n <div className=\"flex items-center gap-3\">\n <Button variant=\"ghost\" size=\"icon\" onClick={() => navigateTo('policies')}>\n <ArrowLeft size={20} />\n </Button>\n <span>{t('botlit.toolApprovals.title', 'Tool approvals')}</span>\n </div>\n }\n description={t(\n 'botlit.toolApprovals.description',\n 'Approve or deny risky tool calls your TOOL policies hold for a human'\n )}\n >\n <div className=\"space-y-6\">\n <PagePurpose icon={<ShieldAlert size={18} />}>\n {t(\n 'botlit.toolApprovals.purpose',\n 'When a TOOL policy marks a tool, an MCP server or a risk level as needing approval, the agent does not run the call. It tells the user the call is waiting, and the request appears here. Approving runs the call and the agent posts its answer in the same conversation. Denying tells the user it was not run. Requests expire at the time shown.'\n )}\n </PagePurpose>\n\n <Card>\n <CardHeader>\n <CardTitle>\n {t('botlit.toolApprovals.pending.title', 'Waiting for a decision')}\n </CardTitle>\n </CardHeader>\n <CardContent>\n {pending.error ? (\n <ErrorState\n resource={t('botlit.toolApprovals.resource', 'tool approvals')}\n error={pending.error}\n onRetry={() => void pending.refetch()}\n />\n ) : pending.loading && pending.data.length === 0 ? (\n <div className=\"h-24 bg-bg-sunken motion-safe:animate-vc-shimmer rounded-lg\" />\n ) : pending.data.length === 0 ? (\n <p className=\"text-sm text-text-secondary\">\n {t('botlit.toolApprovals.pending.empty', 'No tool calls are waiting for approval.')}\n </p>\n ) : (\n <ul className=\"space-y-3\" data-testid=\"tool-approvals-pending\">\n {pending.data.map((request) => (\n <li\n key={request.id}\n className=\"p-4 border border-border-subtle rounded-lg space-y-3\"\n data-testid={`tool-approval-${request.id}`}\n >\n <div className=\"flex items-center gap-2 flex-wrap\">\n <button\n type=\"button\"\n className=\"font-medium text-primary hover:underline\"\n onClick={() => navigateTo(`agents/${request.agentId}`)}\n >\n {request.agentName ?? request.agentId}\n </button>\n <span className=\"text-sm\">\n {t('botlit.toolApprovals.wantsToRun', 'wants to run')}{' '}\n <code className=\"font-mono\">{request.toolName}</code>{' '}\n {t('botlit.toolApprovals.on', 'on')} {request.connectionName}\n </span>\n <Badge variant={request.riskLevel === 'HIGH' ? 'destructive' : 'warning'}>\n {request.riskLevel}\n </Badge>\n {request.mode === 'REQUESTER' && (\n <Badge variant=\"outline\">\n {t('botlit.toolApprovals.requesterMode', 'Requester confirms')}\n </Badge>\n )}\n </div>\n <p className=\"text-xs text-text-secondary\">\n {t('botlit.toolApprovals.requested', 'Requested')}{' '}\n {formatRelativeTime(request.createdAt)} ·{' '}\n {t('botlit.toolApprovals.expires', 'expires')}{' '}\n {formatRelativeTime(request.expiresAt)}\n </p>\n <ApprovalRequestDetails request={request} />\n <div className=\"flex gap-2\">\n <BotmanorPermissionGate permission={BOTMANOR_PERMISSIONS.AGENT_APPROVE}>\n <Button\n size=\"sm\"\n leftIcon={<CheckCircle2 size={14} />}\n isLoading={pendingId === request.id && dialog?.decision === 'APPROVE'}\n onClick={() => setDialog({ decision: 'APPROVE', request })}\n >\n {t('botlit.toolApprovals.approve', 'Approve')}\n </Button>\n </BotmanorPermissionGate>\n <BotmanorPermissionGate permission={BOTMANOR_PERMISSIONS.AGENT_APPROVE}>\n <Button\n size=\"sm\"\n variant=\"destructive\"\n leftIcon={<XCircle size={14} />}\n onClick={() => setDialog({ decision: 'DENY', request })}\n >\n {t('botlit.toolApprovals.deny', 'Deny')}\n </Button>\n </BotmanorPermissionGate>\n </div>\n </li>\n ))}\n </ul>\n )}\n </CardContent>\n </Card>\n\n <Card>\n <CardHeader>\n <CardTitle>{t('botlit.toolApprovals.history.title', 'Recent decisions')}</CardTitle>\n </CardHeader>\n <CardContent>\n {all.error ? (\n <ErrorState\n resource={t('botlit.toolApprovals.resource', 'tool approvals')}\n error={all.error}\n onRetry={() => void all.refetch()}\n />\n ) : all.loading && decided.length === 0 ? (\n <div className=\"h-16 bg-bg-sunken motion-safe:animate-vc-shimmer rounded-lg\" />\n ) : decided.length === 0 ? (\n <p className=\"text-sm text-text-secondary\">\n {t('botlit.toolApprovals.history.empty', 'No decisions yet.')}\n </p>\n ) : (\n <ul className=\"space-y-2\" data-testid=\"tool-approvals-history\">\n {decided.map((request) => (\n <li\n key={request.id}\n className=\"p-3 border border-border-subtle rounded-lg text-sm space-y-1\"\n >\n <div className=\"flex items-center gap-2 flex-wrap\">\n <span className=\"font-medium\">{request.agentName ?? request.agentId}</span>\n <code className=\"font-mono\">{request.toolName}</code>\n <Badge variant={toolApprovalStatusVariant(request.status)}>\n {request.status}\n </Badge>\n {request.resumeStatus && (\n <Badge\n variant={request.resumeStatus === 'FAILED' ? 'destructive' : 'outline'}\n >\n {t('botlit.toolApprovals.run', 'Run')}: {request.resumeStatus}\n </Badge>\n )}\n <span className=\"text-text-secondary\">\n {t('botlit.toolApprovals.by', 'by')} {who(request.deciderId)}{' '}\n {request.decidedAt ? formatRelativeTime(request.decidedAt) : ''}\n </span>\n </div>\n {request.decisionNote && <p className=\"break-words\">{request.decisionNote}</p>}\n {request.resumeError && (\n <p className=\"break-words text-status-error-text\">{request.resumeError}</p>\n )}\n {request.resumeExecutionId && (\n <button\n type=\"button\"\n className=\"text-primary hover:underline\"\n onClick={() => navigateTo(`executions/${request.resumeExecutionId}`)}\n >\n {t('botlit.toolApprovals.viewRun', 'View the resumed run')}\n </button>\n )}\n </li>\n ))}\n </ul>\n )}\n </CardContent>\n </Card>\n </div>\n\n <ResponsiveDialog\n open={dialog !== null}\n onOpenChange={(open) => {\n if (!open) close();\n }}\n >\n <ResponsiveDialogContent>\n <ResponsiveDialogHeader>\n <ResponsiveDialogTitle>\n {dialog?.decision === 'APPROVE'\n ? t('botlit.toolApprovals.dialog.approveTitle', 'Approve and run this tool call')\n : t('botlit.toolApprovals.dialog.denyTitle', 'Deny this tool call')}\n </ResponsiveDialogTitle>\n <ResponsiveDialogDescription>\n {dialog?.decision === 'APPROVE'\n ? t(\n 'botlit.toolApprovals.dialog.approveDescription',\n 'The tool runs now with the arguments shown, and the agent posts its answer in the conversation.'\n )\n : t(\n 'botlit.toolApprovals.dialog.denyDescription',\n 'The tool is not run. The user is told the request was declined, with your reason.'\n )}\n </ResponsiveDialogDescription>\n </ResponsiveDialogHeader>\n {dialog && <ApprovalRequestDetails request={dialog.request} />}\n <Textarea\n aria-label={t('botlit.toolApprovals.dialog.noteLabel', 'Reason')}\n value={note}\n maxLength={2000}\n onChange={(event) => setNote(event.target.value)}\n placeholder={\n dialog?.decision === 'DENY'\n ? t('botlit.toolApprovals.dialog.reasonRequired', 'Reason (required)')\n : t('botlit.toolApprovals.dialog.reasonOptional', 'Note (optional)')\n }\n rows={3}\n />\n <ResponsiveDialogFooter>\n <Button variant=\"outline\" onClick={close}>\n {t('botlit.common.cancel', 'Cancel')}\n </Button>\n <Button\n variant={dialog?.decision === 'DENY' ? 'destructive' : 'default'}\n isLoading={pendingId !== null}\n disabled={dialog?.decision === 'DENY' && note.trim().length === 0}\n onClick={() => void submitDecision()}\n >\n {dialog?.decision === 'APPROVE'\n ? t('botlit.toolApprovals.approve', 'Approve')\n : t('botlit.toolApprovals.deny', 'Deny')}\n </Button>\n </ResponsiveDialogFooter>\n </ResponsiveDialogContent>\n </ResponsiveDialog>\n </PageLayout>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAyCA,SAAgBA,EACd,GACmD;CAInD,OAHIC,MAAW,YAAkB,YAC7BA,MAAW,aAAmB,YAC9BA,MAAW,WAAiB,gBACzB;AACT;AAEA,SAASC,EAAc,GAAwB;CAC7C,IAAI;EACF,OAAO,KAAK,UAAUC,KAAS,CAAC,GAAG,MAAM,CAAC;CAC5C,QAAQ;EACN,OAAO,OAAOA,CAAK;CACrB;AACF;AAEA,IAAMC,KAA+D,EAAE,iBAAc;CACnF,IAAMC,IAAIC,EAAM;CAChB,OACE,kBAAC,OAAD;EAAK,WAAU;EAAf,UAAA;GACGC,EAAQ,eACP,kBAAC,KAAD;IAAG,WAAU;IAAb,UAAA,CACE,kBAAC,QAAD;KAAM,WAAU;KAAhB,UAAA,CACGF,EAAE,kCAAkC,aAAa,GAAG,GACjD;IACL,CAAA,GAAAE,EAAQ,WACR;;GAEL,kBAAC,OAAD;IAAK,WAAU;IACZ,UAAAA,EAAQ,QAAQ,KAAK,MACpB,kBAACC,GAAD;KAAoB,SAAQ;KACzB,UAAAC;IACI,GAFKA,CAEL,CACR;GACE,CAAA;GACL,kBAAC,OAAD;IAAK,WAAU;IACZ,UAAAP,EAAcK,EAAQ,SAAS;GAC7B,CAAA;EACF;;AAET,GAEaG,UAA8B;CACzC,IAAML,IAAIC,EAAM,GACV,EAAE,eAAY,mBAAgBK,EAAU,GACxCC,IAAUC,EAAiB,EAAE,QAAQ,UAAU,CAAC,GAChDC,IAAMD,EAAiB,CAAC,CAAC,GACzB,EAAE,WAAQ,iBAAcE,EAAsB,GAC9C,CAACC,GAAQC,KAAaC,EAGlB,IAAI,GACR,CAACC,GAAMC,KAAWF,EAAS,EAAE,GAE7BG,IAAUP,EAAI,KAAK,QAAQ,MAAYP,EAAQ,WAAW,SAAS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,UACGnC,GAAQ,aAAa,YAClBX,EAAE,4CAA4C,gCAAgC,IAC9EA,EAAE,yCAAyC,qBAAqB,EAC/C,CAAA,GACvB,kBAAC+C,GAAD,EAAA,UACGpC,GAAQ,aAAa,YAClBX,EACE,kDACA,iGACF,IACAA,EACE,+CACA,mFACF,EACuB,CAAA,CACP,EAAA,CAAA;IACvBW,KAAU,kBAACZ,GAAD,EAAwB,SAASY,EAAO,QAAU,CAAA;IAC7D,kBAACqC,GAAD;KACE,cAAYhD,EAAE,yCAAyC,QAAQ;KAC/D,OAAOc;KACP,WAAW;KACX,WAAW,MAAUC,EAAQkC,EAAM,OAAO,KAAK;KAC/C,aACEtC,GAAQ,aAAa,SACjBX,EAAE,8CAA8C,mBAAmB,IACnEA,EAAE,8CAA8C,iBAAiB;KAEvE,MAAM;IACP,CAAA;IACD,kBAACkD,GAAD,EAAA,UAAA,CACE,kBAACxB,GAAD;KAAQ,SAAQ;KAAU,SAASN;KAChC,UAAApB,EAAE,wBAAwB,QAAQ;IAC7B,CAAA,GACR,kBAAC0B,GAAD;KACE,SAASf,GAAQ,aAAa,SAAS,gBAAgB;KACvD,WAAW6B,MAAc;KACzB,UAAU7B,GAAQ,aAAa,UAAUG,EAAK,KAAK,CAAC,CAAC,WAAW;KAChE,eAAe,KAAKO,EAAe;KAElC,UAAAV,GAAQ,aAAa,YAClBX,EAAE,gCAAgC,SAAS,IAC3CA,EAAE,6BAA6B,MAAM;IACnC,CAAA,CACc,EAAA,CAAA;GACD,EAAA,CAAA;EACT,CAAA,CACR;;AAEhB"}
|
|
@@ -23,6 +23,8 @@ export interface PolicyFormState {
|
|
|
23
23
|
piiDetection: boolean;
|
|
24
24
|
blockedKeywords: string;
|
|
25
25
|
blockedPatterns: string;
|
|
26
|
+
/** BOFF-15360 — refuse input that tries to override the agent's instructions. */
|
|
27
|
+
promptInjectionDetection: boolean;
|
|
26
28
|
};
|
|
27
29
|
tool: {
|
|
28
30
|
allowedTools: string;
|
|
@@ -31,6 +33,14 @@ export interface PolicyFormState {
|
|
|
31
33
|
a2aMinTrustLevel: '' | (typeof A2A_TRUST_LEVELS)[number];
|
|
32
34
|
maxCallsPerExecution: string;
|
|
33
35
|
timeoutSeconds: string;
|
|
36
|
+
/** BOFF-15360 — tool calls that wait for a human decision. */
|
|
37
|
+
approvalRiskLevels: Array<(typeof TOOL_RISK_LEVELS)[number]>;
|
|
38
|
+
approvalTools: string;
|
|
39
|
+
approvalServers: string;
|
|
40
|
+
approverRoles: string;
|
|
41
|
+
approverUserIds: string;
|
|
42
|
+
approvalTimeoutMinutes: string;
|
|
43
|
+
requesterConfirmation: boolean;
|
|
34
44
|
};
|
|
35
45
|
budget: {
|
|
36
46
|
maxTokensPerDay: string;
|
|
@@ -88,6 +98,8 @@ export type PolicyConfigResult = {
|
|
|
88
98
|
export declare function splitList(value: string): string[];
|
|
89
99
|
/** Split a one-entry-per-line form value into trimmed, non-empty entries. */
|
|
90
100
|
export declare function splitLines(value: string): string[];
|
|
101
|
+
/** Longest a tool call may wait for a decision (seven days, as the runtime clamps it). */
|
|
102
|
+
export declare const MAX_APPROVAL_TIMEOUT_MINUTES: number;
|
|
91
103
|
/**
|
|
92
104
|
* Build the config for a new policy from the editor state, or explain what is
|
|
93
105
|
* wrong with the input. Only enforced keys are ever written.
|