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

Function createPolicyCode

e2e/scenarios/toolkits-mcp.test.ts:126–136  ·  view source on GitHub ↗
(input: {
  readonly pattern: string;
  readonly action: "approve" | "require_approval" | "block";
})

Source from the content-addressed store, hash-verified

124`;
125
126const createPolicyCode = (input: {
127 readonly pattern: string;
128 readonly action: "approve" | "require_approval" | "block";
129}) => `
130const created = await tools.executor.coreTools.policies.create({
131 owner: "user",
132 pattern: ${JSON.stringify(input.pattern)},
133 action: ${JSON.stringify(input.action)},
134});
135return JSON.stringify({ ok: created.ok, data: created.ok ? created.data : null, error: created.ok ? null : created.error });
136`;
137
138const assertCallOk = (value: Record<string, unknown>, label: string) => {
139 expect(value.ok, `${label}: ${JSON.stringify(value)}`).toBe(true);

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected