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

Function indicatorFor

packages/react/src/components/tool-tree.tsx:119–134  ·  view source on GitHub ↗
(policy: EffectivePolicy)

Source from the content-addressed store, hash-verified

117// row); everything else gets a dot. User policies are filled, plugin
118// defaults are hollow rings.
119const indicatorFor = (policy: EffectivePolicy) => {
120 if (policy.source === "plugin-default" && policy.action === "approve") {
121 return null;
122 }
123 const colors = POLICY_INDICATOR_COLOR[policy.action];
124 const stateLabel = POLICY_STATE_LABEL[policy.action];
125 const filled = policy.source === "user";
126 const label =
127 policy.source === "user"
128 ? `${stateLabel} (matched ${policy.pattern})`
129 : `Plugin default: ${stateLabel}`;
130 return {
131 label,
132 className: filled ? colors.dot : cn("bg-transparent ring-1", colors.ring),
133 };
134};
135
136type TreeNode = {
137 segment: string;

Callers 1

ToolLeafRowFunction · 0.85

Calls 1

cnFunction · 0.90

Tested by

no test coverage detected