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

Function withLineNumbers

src/tools/executors/files.ts:10–12  ·  view source on GitHub ↗

Format file content as right-aligned `LINE_NUMBER|LINE_CONTENT` (6-char padding).

(lines: string[], startLine: number)

Source from the content-addressed store, hash-verified

8
9/** Format file content as right-aligned `LINE_NUMBER|LINE_CONTENT` (6-char padding). */
10function withLineNumbers(lines: string[], startLine: number): string {
11 return lines.map((line, i) => `${String(startLine + i).padStart(6, " ")}|${line}`).join("\n")
12}
13
14export async function readFile(args: Record<string, unknown>, context: ToolContext): Promise<ToolResult> {
15 const filePath = resolveWorkspacePath(context.cwd, String(args.file_path ?? ""))

Callers 1

readFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected