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

Function remove

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

Source from the content-addressed store, hash-verified

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