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

Function artifactsRename

packages/core/sdk/src/executor.ts:6306–6320  ·  view source on GitHub ↗
(
      input: RenameArtifactInput,
    )

Source from the content-addressed store, hash-verified

6304 });
6305
6306 const artifactsRename = (
6307 input: RenameArtifactInput,
6308 ): Effect.Effect<Artifact, ArtifactNotFoundError | StorageFailure> =>
6309 Effect.gen(function* () {
6310 const where = artifactById(input.id);
6311 const existing = yield* core.findFirst("artifact", { where });
6312 if (!existing) {
6313 return yield* new ArtifactNotFoundError({
6314 id: ArtifactId.make(input.id),
6315 });
6316 }
6317 const set = { title: input.title, updated_at: new Date() };
6318 yield* core.updateMany("artifact", { where, set });
6319 return rowToArtifact({ ...existing, ...set });
6320 });
6321
6322 // Hard delete: an artifact is not a connection, so there is no disabled or
6323 // archived state to fall back to.

Callers

nothing calls this directly

Calls 2

rowToArtifactFunction · 0.90
artifactByIdFunction · 0.85

Tested by

no test coverage detected