ropilot 0.1.49 → 0.1.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/proxy.js +6 -25
- package/package.json +1 -1
package/lib/proxy.js
CHANGED
|
@@ -232,32 +232,13 @@ async function handleToolsCall(apiKey, request) {
|
|
|
232
232
|
const scriptPath = request.params?.arguments?.path;
|
|
233
233
|
const localFile = getLocalFileForScript(scriptPath);
|
|
234
234
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
content: [{ type: 'text', text: `Error: Cannot commit "${scriptPath}" - you must request it first with ropilot_sourcecontrol_requestscript.` }],
|
|
241
|
-
isError: true
|
|
242
|
-
}
|
|
243
|
-
};
|
|
235
|
+
// Edge validates request→commit pairing, but we need local file for content
|
|
236
|
+
if (localFile && existsSync(localFile)) {
|
|
237
|
+
const content = readFileSync(localFile, 'utf-8');
|
|
238
|
+
request.params.arguments.content = content;
|
|
239
|
+
commitScriptPath = scriptPath; // Track for clearing after successful commit
|
|
244
240
|
}
|
|
245
|
-
|
|
246
|
-
if (!existsSync(localFile)) {
|
|
247
|
-
return {
|
|
248
|
-
jsonrpc: '2.0',
|
|
249
|
-
id: request.id,
|
|
250
|
-
result: {
|
|
251
|
-
content: [{ type: 'text', text: `Error: Local file not found: ${localFile}` }],
|
|
252
|
-
isError: true
|
|
253
|
-
}
|
|
254
|
-
};
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
// Read the file and inject content into the request
|
|
258
|
-
const content = readFileSync(localFile, 'utf-8');
|
|
259
|
-
request.params.arguments.content = content;
|
|
260
|
-
commitScriptPath = scriptPath; // Track for clearing after successful commit
|
|
241
|
+
// If no local file, let edge return the "must request first" error
|
|
261
242
|
}
|
|
262
243
|
|
|
263
244
|
// Forward to edge
|