@sandagent/runner-cli 0.2.8 → 0.2.9
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/dist/bundle.mjs +4 -7
- package/package.json +1 -1
package/dist/bundle.mjs
CHANGED
|
@@ -260,23 +260,20 @@ function createCanUseToolCallback(claudeOptions) {
|
|
|
260
260
|
}
|
|
261
261
|
const cwd = claudeOptions.cwd || process.cwd();
|
|
262
262
|
try {
|
|
263
|
-
const
|
|
263
|
+
const fs = await import("node:fs");
|
|
264
264
|
const path = await import("node:path");
|
|
265
265
|
const approvalDir = path.join(cwd, ".sandagent", "approvals");
|
|
266
266
|
const approvalFile = path.join(approvalDir, `${toolUseID}.json`);
|
|
267
|
-
execSync(`mkdir -p "${approvalDir}"`);
|
|
268
267
|
const timeout = Date.now() + 6e4;
|
|
269
268
|
let lastApproval = null;
|
|
270
269
|
while (Date.now() < timeout) {
|
|
271
270
|
try {
|
|
272
|
-
const data =
|
|
273
|
-
encoding: "utf-8"
|
|
274
|
-
});
|
|
271
|
+
const data = fs.readFileSync(approvalFile, "utf-8");
|
|
275
272
|
const approval = JSON.parse(data);
|
|
276
273
|
lastApproval = approval;
|
|
277
274
|
if (approval.status === "completed") {
|
|
278
275
|
try {
|
|
279
|
-
|
|
276
|
+
fs.unlinkSync(approvalFile);
|
|
280
277
|
} catch {
|
|
281
278
|
}
|
|
282
279
|
return {
|
|
@@ -292,7 +289,7 @@ function createCanUseToolCallback(claudeOptions) {
|
|
|
292
289
|
await new Promise((resolve) => setTimeout(resolve, 500));
|
|
293
290
|
}
|
|
294
291
|
try {
|
|
295
|
-
|
|
292
|
+
fs.unlinkSync(approvalFile);
|
|
296
293
|
} catch {
|
|
297
294
|
}
|
|
298
295
|
if (lastApproval && Object.keys(lastApproval.answers).length > 0) {
|
package/package.json
CHANGED