The inbox shows the console output of a command under its "Ausführen" row, kept to the same tail the job list shows. A deny picks its radio channel (post by default, call, newsletter, broadcast, pan-pan, security) and an optional reason; the passkey signs denial, channel and reason, the hub verifies the proof before it stores or sends anything, and the PermissionRequest hook quotes a reason only when it verifies. Agents ask for an auto-approval rule through the MCP tool rule_request; the request shows in the inbox with a dry run over the last seven days and is accepted only with a passkey assertion the hub verifies against the pinned keys and the hub origin, for every rule kind. Requests lapse with the ask lifetime and are capped per agent and in total. The image runs as nobody by default and carries the health check command; compose keeps the timing. 🎯 Fix: 93 % 💥 Break: 4 % 💸 Cost: 98 % ⏱️ Time: 75 % 🛡️ Security: 100 % 🏆 Score: 100 🚦 Gate: ✅ 90/5, cost and time <= 100, security 100 % Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
29 lines
1.6 KiB
JavaScript
29 lines
1.6 KiB
JavaScript
const COUNTED = {ask: "Asks", review: "Reviews", decision: "Entscheidungen"};
|
|
|
|
function ruleRequestBody(item) {
|
|
const rule = item.rule;
|
|
const dry = item.dry_run;
|
|
const pairs = [["Art", RULE_KINDS[rule.kind]], rule.kind === "ask" ? ["Werkzeug (Glob)", rule.tool] : null, ["Muster (Glob)", rule.pattern], rule.kind === "decision" ? null : ["Verzeichnis (Glob)", rule.scope], ["Läuft ab am", absolute.format(stampOf(rule.expires))]];
|
|
return h("div", {class: "rule-request"},
|
|
item.detail ? h("p", {class: "text"}, item.detail) : null,
|
|
meta(pairs.filter(Boolean)),
|
|
h("p", {class: "muted dry-run-count"}, "Trockenlauf: Die Regel hätte ", h("strong", {}, `${dry.matched} von ${dry.total}`), ` ${COUNTED[rule.kind]} der letzten ${dry.days} Tage freigegeben.`),
|
|
h("p", {class: "muted"}, RULE_HINTS[rule.kind]));
|
|
}
|
|
|
|
async function acceptRule(item) {
|
|
const label = `Regel: ${short(item.title)}`;
|
|
ui.busy = true;
|
|
const prepared = await sendJson(`/api/rule-requests/${encodeURIComponent(item.id)}/sign`, {});
|
|
const signed = prepared.ok && prepared.data ? await assertion(prepared.data, label) : null;
|
|
if (!prepared.ok || !prepared.data) {
|
|
toast(`${label}: nicht möglich`, fail(prepared), false);
|
|
}
|
|
const result = signed ? await sendJson(`/api/rule-requests/${encodeURIComponent(item.id)}/accept`, {rule: prepared.data.payload, assertion: signed}) : null;
|
|
ui.busy = false;
|
|
if (result) {
|
|
toast(result.ok ? `Angelegt: ${short(item.title)}` : `${label}: nicht angelegt`, result.ok ? [] : fail(result), result.ok);
|
|
}
|
|
await load();
|
|
}
|