MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / resolveArtifactId

Function resolveArtifactId

src/tools/artifacts/artifact-tools.ts:30–34  ·  view source on GitHub ↗

Resolve the artifact id from either `id` or the `name` alias some models send.

(args: { id?: string; name?: string })

Source from the content-addressed store, hash-verified

28import { startLive, stopLive, stopAllLive, listLive } from '../../artifacts/live-registry.js';
29
30const TYPE_VALUES = ['html', 'react', 'svg', 'markdown', 'vue', 'text'] as const;
31
32/** Resolve the artifact id from either `id` or the `name` alias some models send. */
33function resolveArtifactId(args: { id?: string; name?: string }): string {
34 const id = (args.id ?? args.name ?? '').trim();
35 if (!id) throw new Error('Missing artifact id. Pass id="<artifact-id>" (the id returned by artifact_create).');
36 return id;
37}

Callers 6

executeMethod · 0.85
executeMethod · 0.85
executeMethod · 0.85
executeMethod · 0.85
executeMethod · 0.85
executeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected