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

Function create

packages/plugins/toolkits/src/server.ts:351–369  ·  view source on GitHub ↗
(input: {
    readonly owner: Owner;
    readonly name: string;
    readonly slug?: string;
  })

Source from the content-addressed store, hash-verified

349 );
350
351 const create = (input: {
352 readonly owner: Owner;
353 readonly name: string;
354 readonly slug?: string;
355 }) =>
356 Effect.gen(function* () {
357 const name = input.name.trim();
358 if (!name) return yield* fail("Toolkit name is required.");
359 const slug = yield* normalizeSlugEffect({ name, slug: input.slug });
360 yield* assertSlugAvailable(slug);
361 const now = Date.now();
362 const id = newId("tk");
363 const entry = yield* storage.toolkits.put({
364 owner: input.owner,
365 key: id,
366 data: { id, slug, name, createdAt: now, updatedAt: now },
367 });
368 return toolkitToResponse(entry);
369 });
370
371 const update = (toolkitId: string, input: { readonly name?: string; readonly slug?: string }) =>
372 Effect.gen(function* () {

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected