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

Function remove

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

Source from the content-addressed store, hash-verified

387 });
388
389 const remove = (toolkitId: string) =>
390 Effect.gen(function* () {
391 const toolkit = yield* requireToolkit(toolkitId);
392 const policies = yield* listPoliciesForRecord(toolkitId);
393 const connections = yield* listConnectionsForRecord(toolkitId);
394 yield* ctx.pluginStorage.removeMany({
395 owner: toolkit.owner,
396 entries: [
397 { collection: toolkitsCollection.name, key: toolkitId },
398 ...policies.map((policy) => ({
399 collection: toolkitPoliciesCollection.name,
400 key: policy.id,
401 })),
402 ...connections.map((connection) => ({
403 collection: toolkitConnectionsCollection.name,
404 key: connection.id,
405 })),
406 ],
407 });
408 });
409
410 const listPolicies = (toolkitId: string) =>
411 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