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

Function update

packages/plugins/toolkits/src/server.ts:326–342  ·  view source on GitHub ↗
(toolkitId: string, input: { readonly name?: string; readonly slug?: string })

Source from the content-addressed store, hash-verified

324 });
325
326 const update = (toolkitId: string, input: { readonly name?: string; readonly slug?: string }) =>
327 Effect.gen(function* () {
328 const existing = yield* requireToolkit(toolkitId);
329 const name = input.name === undefined ? existing.data.name : input.name.trim();
330 if (!name) return yield* fail("Toolkit name is required.");
331 const slug =
332 input.slug === undefined
333 ? existing.data.slug
334 : yield* normalizeSlugEffect({ name, slug: input.slug });
335 yield* assertSlugAvailable(slug, toolkitId);
336 const entry = yield* storage.toolkits.put({
337 owner: existing.owner,
338 key: toolkitId,
339 data: { ...existing.data, name, slug, updatedAt: Date.now() },
340 });
341 return toolkitToResponse(entry);
342 });
343
344 const remove = (toolkitId: string) =>
345 Effect.gen(function* () {

Callers

nothing calls this directly

Calls 6

requireToolkitFunction · 0.85
normalizeSlugEffectFunction · 0.85
assertSlugAvailableFunction · 0.85
toolkitToResponseFunction · 0.85
failFunction · 0.70
putMethod · 0.65

Tested by

no test coverage detected