MCPcopy Create free account
hub / github.com/MatterAIOrg/OrbCode / fileEdit

Function fileEdit

src/tools/executors/files.ts:124–133  ·  view source on GitHub ↗
(args: Record<string, unknown>, context: ToolContext)

Source from the content-addressed store, hash-verified

122}
123
124export async function fileEdit(args: Record<string, unknown>, context: ToolContext): Promise<ToolResult> {
125 const edit: EditSpec = {
126 file_path: String(args.file_path ?? ""),
127 old_string: String(args.old_string ?? ""),
128 new_string: String(args.new_string ?? ""),
129 replace_all: parseReplaceAll(args.replace_all),
130 }
131 const [result] = editOneFile(context.cwd, [edit])
132 return { text: result, isError: result.startsWith("FAILED") }
133}
134
135/**
136 * Compute the diff a file-modifying tool call would produce, without writing

Callers

nothing calls this directly

Calls 2

parseReplaceAllFunction · 0.85
editOneFileFunction · 0.85

Tested by

no test coverage detected