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

Method execute

src/tools/artifacts/artifact-tools.ts:156–164  ·  view source on GitHub ↗
(args: z.infer<typeof RollbackArgs>, ctx: ToolContext)

Source from the content-addressed store, hash-verified

154 description = 'Repoint an artifact\u2019s "current" version to an earlier one. No content is lost; later versions remain in history.';
155 argsSchema = RollbackArgs;
156 isReadOnly = false;
157 isDestructive = false;
158
159 async execute(args: z.infer<typeof RollbackArgs>, ctx: ToolContext): Promise<ToolResult> {
160 try {
161 const manifest = await rollbackArtifact(ctx.cwd, resolveArtifactId(args), args.version, (p, c) => ctx.transaction.write(p, c));
162 ctx.emit({ type: 'progress', message: `Rolled "${manifest.id}" back to v${args.version}` });
163 return { content: `"${manifest.id}" current version is now v${args.version}.`, metadata: { artifactId: manifest.id, current: args.version } };
164 } catch (e: any) {
165 return { content: e?.message ?? String(e), isError: true };
166 }
167 }

Callers

nothing calls this directly

Calls 4

rollbackArtifactFunction · 0.85
resolveArtifactIdFunction · 0.85
writeMethod · 0.45
emitMethod · 0.45

Tested by

no test coverage detected