MCPcopy Create free account
hub / github.com/RioArisk/claudecode_api_RemoteControl / enrichEditStartLines

Function enrichEditStartLines

lib/transcript.js:106–123  ·  view source on GitHub ↗
(event)

Source from the content-addressed store, hash-verified

104}
105
106function enrichEditStartLines(event) {
107 const content = event.message && event.message.content;
108 if (!Array.isArray(content)) return;
109 for (const block of content) {
110 if (block.type !== 'tool_use' || block.name !== 'Edit') continue;
111 const input = block.input;
112 if (!input || !input.file_path || input.old_string === undefined) continue;
113 try {
114 const filePath = path.resolve(state.CWD, input.file_path);
115 const src = fs.readFileSync(filePath, 'utf8');
116 const needle = input.new_string || input.old_string;
117 const idx = src.indexOf(needle);
118 if (idx >= 0) {
119 input._startLine = src.substring(0, idx).split('\n').length;
120 }
121 } catch {}
122 }
123}
124
125// ============================================================
126// Hook Session Resolution

Callers 1

startTailingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected