MCPcopy Create free account
hub / github.com/arctic-cli/interface / execute

Function execute

packages/arctic/src/tool/multiedit.ts:23–45  ·  view source on GitHub ↗
(params, ctx)

Source from the content-addressed store, hash-verified

21 .describe("Array of edit operations to perform sequentially on the file"),
22 }),
23 async execute(params, ctx) {
24 const tool = await EditTool.init()
25 const results = []
26 for (const [, edit] of params.edits.entries()) {
27 const result = await tool.execute(
28 {
29 filePath: params.filePath,
30 oldString: edit.oldString,
31 newString: edit.newString,
32 replaceAll: edit.replaceAll,
33 },
34 ctx,
35 )
36 results.push(result)
37 }
38 return {
39 title: path.relative(Instance.worktree, params.filePath),
40 metadata: {
41 results: results.map((r) => r.metadata),
42 },
43 output: results.at(-1)!.output,
44 }
45 },
46})

Callers

nothing calls this directly

Calls 2

pushMethod · 0.80
initMethod · 0.45

Tested by

no test coverage detected