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

Function remove

packages/plugins/toolkits/src/server.ts:344–363  ·  view source on GitHub ↗
(toolkitId: string)

Source from the content-addressed store, hash-verified

342 });
343
344 const remove = (toolkitId: string) =>
345 Effect.gen(function* () {
346 const toolkit = yield* requireToolkit(toolkitId);
347 const policies = yield* listPoliciesForRecord(toolkitId);
348 const connections = yield* listConnectionsForRecord(toolkitId);
349 yield* ctx.pluginStorage.removeMany({
350 owner: toolkit.owner,
351 entries: [
352 { collection: toolkitsCollection.name, key: toolkitId },
353 ...policies.map((policy) => ({
354 collection: toolkitPoliciesCollection.name,
355 key: policy.id,
356 })),
357 ...connections.map((connection) => ({
358 collection: toolkitConnectionsCollection.name,
359 key: connection.id,
360 })),
361 ],
362 });
363 });
364
365 const listPolicies = (toolkitId: string) =>
366 requireToolkit(toolkitId).pipe(Effect.flatMap(() => listPoliciesForRecord(toolkitId)));

Callers

nothing calls this directly

Calls 3

requireToolkitFunction · 0.85
listPoliciesForRecordFunction · 0.85
listConnectionsForRecordFunction · 0.85

Tested by

no test coverage detected