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

Function setPolicyHandler

packages/plugins/toolkits/src/page.tsx:1303–1318  ·  view source on GitHub ↗
(pattern: string, action: ToolPolicyAction)

Source from the content-addressed store, hash-verified

1301 const connectionRows = AsyncResult.isSuccess(connections) ? connections.value.connections : [];
1302
1303 const setPolicyHandler = async (pattern: string, action: ToolPolicyAction) => {
1304 const existing = policyRows.find((policy) => policy.pattern === pattern);
1305 if (existing) {
1306 await doUpdatePolicy({
1307 params: { toolkitId: props.toolkit.id, policyId: existing.id },
1308 payload: { action },
1309 reactivityKeys: toolkitWriteKeys,
1310 });
1311 return;
1312 }
1313 await doCreatePolicy({
1314 params: { toolkitId: props.toolkit.id },
1315 payload: { pattern, action },
1316 reactivityKeys: toolkitWriteKeys,
1317 });
1318 };
1319
1320 const addConnectionHandler = async (pattern: string) => {
1321 await doCreateConnection({

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected