agentapprove 0.1.5 → 0.1.6
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/cli.js +24 -9
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -2413,7 +2413,7 @@ var AGENTS = {
|
|
|
2413
2413
|
{ name: "BeforeAgent", file: "gemini-before-agent.sh", description: "User prompt capture" },
|
|
2414
2414
|
{ name: "BeforeModel", file: "gemini-before-model.sh", description: "Before LLM request" },
|
|
2415
2415
|
{ name: "AfterModel", file: "gemini-after-model.sh", description: "After LLM response" },
|
|
2416
|
-
{ name: "BeforeTool", file: "gemini-before-tool.sh", description: "Tool approval", isApprovalHook: true },
|
|
2416
|
+
{ name: "BeforeTool", file: "gemini-before-tool.sh", description: "Tool approval", isApprovalHook: true, timeout: 300 },
|
|
2417
2417
|
{ name: "AfterTool", file: "gemini-after-tool.sh", description: "Tool completion logging" },
|
|
2418
2418
|
{ name: "AfterAgent", file: "gemini-stop.sh", description: "Agent stop (iOS input)", timeout: 600 },
|
|
2419
2419
|
{ name: "Notification", file: "gemini-notification.sh", description: "Notifications (logging only)" },
|
|
@@ -3135,8 +3135,15 @@ async function installHooksForAgent(agentId, hooksDir, mode = "approval") {
|
|
|
3135
3135
|
installedHooks.push(hook.name);
|
|
3136
3136
|
} else if (agentId === "cursor") {
|
|
3137
3137
|
const existing = hooksConfig[hook.name];
|
|
3138
|
-
const
|
|
3139
|
-
const
|
|
3138
|
+
const needsStopTimeout = hook.name === "stop" || hook.name === "subagentStop";
|
|
3139
|
+
const isApproval = hook.isApprovalHook;
|
|
3140
|
+
const hookEntry = { command: hookCommand };
|
|
3141
|
+
if (needsStopTimeout) {
|
|
3142
|
+
hookEntry.timeout = 600;
|
|
3143
|
+
hookEntry.loop_limit = 10;
|
|
3144
|
+
} else if (isApproval) {
|
|
3145
|
+
hookEntry.timeout = 300;
|
|
3146
|
+
}
|
|
3140
3147
|
if (!existing) {
|
|
3141
3148
|
hooksConfig[hook.name] = [hookEntry];
|
|
3142
3149
|
} else if (Array.isArray(existing)) {
|
|
@@ -3208,7 +3215,7 @@ async function installHooksForAgent(agentId, hooksDir, mode = "approval") {
|
|
|
3208
3215
|
command: hookCommand
|
|
3209
3216
|
};
|
|
3210
3217
|
if (hook.isApprovalHook) {
|
|
3211
|
-
hookEntry.timeout =
|
|
3218
|
+
hookEntry.timeout = 300;
|
|
3212
3219
|
}
|
|
3213
3220
|
if (hook.timeout) {
|
|
3214
3221
|
hookEntry.timeout = hook.timeout;
|
|
@@ -3231,7 +3238,7 @@ async function installHooksForAgent(agentId, hooksDir, mode = "approval") {
|
|
|
3231
3238
|
bash: isWindows() ? toGitBashPath(hookPath) : hookPath
|
|
3232
3239
|
};
|
|
3233
3240
|
if (hook.isApprovalHook) {
|
|
3234
|
-
hookEntry.timeoutSec =
|
|
3241
|
+
hookEntry.timeoutSec = 300;
|
|
3235
3242
|
}
|
|
3236
3243
|
cleanedArray.push(hookEntry);
|
|
3237
3244
|
hooksConfig[hook.name] = cleanedArray;
|
|
@@ -3339,8 +3346,16 @@ function getManualInstructions(agentId, hooksDir) {
|
|
|
3339
3346
|
for (const hook of agent.hooks) {
|
|
3340
3347
|
const hookPath = join(hooksDir, hook.file);
|
|
3341
3348
|
const hookCmd = buildHookCommand(hookPath, agentId);
|
|
3342
|
-
const
|
|
3343
|
-
|
|
3349
|
+
const needsStopTimeout = hook.name === "stop" || hook.name === "subagentStop";
|
|
3350
|
+
const isApproval = hook.isApprovalHook;
|
|
3351
|
+
const entry = { command: hookCmd };
|
|
3352
|
+
if (needsStopTimeout) {
|
|
3353
|
+
entry.timeout = 600;
|
|
3354
|
+
entry.loop_limit = 10;
|
|
3355
|
+
} else if (isApproval) {
|
|
3356
|
+
entry.timeout = 300;
|
|
3357
|
+
}
|
|
3358
|
+
hooksObj[hook.name] = [entry];
|
|
3344
3359
|
}
|
|
3345
3360
|
return JSON.stringify({ hooks: hooksObj }, null, 2);
|
|
3346
3361
|
} else if (agentId === "gemini-cli") {
|
|
@@ -3364,7 +3379,7 @@ function getManualInstructions(agentId, hooksDir) {
|
|
|
3364
3379
|
command: hookCmd
|
|
3365
3380
|
};
|
|
3366
3381
|
if (isApproval)
|
|
3367
|
-
entry.timeout =
|
|
3382
|
+
entry.timeout = 300;
|
|
3368
3383
|
if (hookTimeout)
|
|
3369
3384
|
entry.timeout = hookTimeout;
|
|
3370
3385
|
hooksObj[hook.name] = [entry];
|
|
@@ -3380,7 +3395,7 @@ function getManualInstructions(agentId, hooksDir) {
|
|
|
3380
3395
|
bash: isWindows() ? toGitBashPath(hookPath) : hookPath
|
|
3381
3396
|
};
|
|
3382
3397
|
if (isApproval)
|
|
3383
|
-
entry.timeoutSec =
|
|
3398
|
+
entry.timeoutSec = 300;
|
|
3384
3399
|
hooksObj[hook.name] = [entry];
|
|
3385
3400
|
}
|
|
3386
3401
|
return JSON.stringify({ version: 1, hooks: hooksObj }, null, 2);
|