MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / policyBadgeFor

Function policyBadgeFor

packages/react/src/components/tool-detail.tsx:44–62  ·  view source on GitHub ↗
(policy: EffectivePolicy)

Source from the content-addressed store, hash-verified

42// the always-run plugin default — that's the safe state and the
43// header would just be noise.
44const policyBadgeFor = (policy: EffectivePolicy) => {
45 if (policy.source === "plugin-default" && policy.action === "approve") {
46 return null;
47 }
48 if (policy.source === "user") {
49 return {
50 variant: POLICY_BADGE_VARIANT[policy.action],
51 title: `Matched policy: ${policy.pattern}`,
52 text: `${POLICY_STATE_LABEL[policy.action]} · ${policy.pattern}`,
53 className: "font-mono text-[10px]",
54 };
55 }
56 return {
57 variant: "outline" as const,
58 title: "No matching policy — plugin default applies",
59 text: `Default: ${POLICY_STATE_LABEL[policy.action]}`,
60 className: "text-[10px] text-muted-foreground",
61 };
62};
63
64function EmptySection(props: { title: string; message: string }) {
65 return (

Callers 1

PolicyBadgeMenuFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected