@pushary/agent-hooks 0.28.0 → 0.28.1
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/LICENSE +21 -0
- package/README.md +111 -0
- package/dist/bin/pushary-clean.js +3 -3
- package/dist/bin/pushary-codex-hook.js +2 -2
- package/dist/bin/pushary-codex.js +2 -2
- package/dist/bin/pushary-doctor.js +2 -2
- package/dist/bin/pushary-gemini-hook.js +2 -2
- package/dist/bin/pushary-hook.js +3 -3
- package/dist/bin/pushary-post-hook.js +2 -2
- package/dist/bin/pushary-prompt-hook.js +2 -2
- package/dist/bin/pushary-setup.js +4 -4
- package/dist/bin/pushary-stop-hook.js +2 -2
- package/dist/chunk-22CV7V7A.js +38 -0
- package/dist/chunk-2BE2IPMO.js +315 -0
- package/dist/chunk-2CRLBMOX.js +244 -0
- package/dist/chunk-2HMNOZPY.js +109 -0
- package/dist/chunk-2I6DLXJN.js +219 -0
- package/dist/chunk-2Q6XPZ4Q.js +395 -0
- package/dist/chunk-3LC4YUMA.js +194 -0
- package/dist/chunk-3MIR7ODJ.js +112 -0
- package/dist/chunk-3QZESA66.js +222 -0
- package/dist/chunk-4Z4MB37G.js +96 -0
- package/dist/chunk-5GFUI5N6.js +132 -0
- package/dist/chunk-5JEDLXEC.js +99 -0
- package/dist/chunk-5LTQNC7R.js +824 -0
- package/dist/chunk-5MA3CPZB.js +141 -0
- package/dist/chunk-5QHQVXWN.js +174 -0
- package/dist/{chunk-QDPUTE2V.js → chunk-5V3XJ2ES.js} +1 -1
- package/dist/chunk-6A3WCJO2.js +416 -0
- package/dist/chunk-6QWFMVCD.js +328 -0
- package/dist/chunk-6SRXMZAN.js +99 -0
- package/dist/chunk-7OXL2QQ4.js +357 -0
- package/dist/chunk-7PTU7TGE.js +96 -0
- package/dist/chunk-AB4KX4XT.js +109 -0
- package/dist/chunk-AC4UYAGX.js +136 -0
- package/dist/chunk-ACE77TKQ.js +328 -0
- package/dist/chunk-BHAMEPOP.js +323 -0
- package/dist/chunk-BYNYYZWW.js +412 -0
- package/dist/chunk-C4BMEVK7.js +208 -0
- package/dist/chunk-C5TFTNHG.js +244 -0
- package/dist/chunk-CH53PBQN.js +265 -0
- package/dist/chunk-DF3BM6BF.js +195 -0
- package/dist/chunk-DKZVKEOW.js +175 -0
- package/dist/chunk-EMPL27ZV.js +96 -0
- package/dist/chunk-EQJXMEIR.js +175 -0
- package/dist/{chunk-76F75WQQ.js → chunk-FB3N633T.js} +1 -1
- package/dist/chunk-FGZZRCOG.js +194 -0
- package/dist/chunk-FXYTRZHC.js +177 -0
- package/dist/chunk-GTJGZBTQ.js +328 -0
- package/dist/chunk-GYPPVD3P.js +1047 -0
- package/dist/chunk-HJMFYDWY.js +222 -0
- package/dist/chunk-HRQEECB6.js +315 -0
- package/dist/chunk-HWEMAAOY.js +370 -0
- package/dist/{chunk-2BHYQCF7.js → chunk-I4GMPUYN.js} +2 -2
- package/dist/{chunk-NFKYZY74.js → chunk-IAOXM7X5.js} +1 -1
- package/dist/chunk-IBWCHA5M.js +10 -0
- package/dist/chunk-JPRRYC5X.js +328 -0
- package/dist/chunk-KTM4ZQ3W.js +96 -0
- package/dist/chunk-KTP2EPVB.js +27 -0
- package/dist/chunk-KYARP7KP.js +97 -0
- package/dist/chunk-LXUHXG2X.js +937 -0
- package/dist/chunk-M2N5DYWN.js +247 -0
- package/dist/chunk-M4GDBGXF.js +824 -0
- package/dist/chunk-M5F2L4KF.js +177 -0
- package/dist/chunk-M6S3M6E3.js +244 -0
- package/dist/chunk-N7VXDBQU.js +6 -0
- package/dist/chunk-O2QL6U6G.js +194 -0
- package/dist/chunk-O6A5RHWY.js +122 -0
- package/dist/chunk-ODUXELPM.js +219 -0
- package/dist/chunk-OF5WIOYS.js +129 -0
- package/dist/chunk-OP4QAN23.js +99 -0
- package/dist/chunk-P4JH2Q7Z.js +102 -0
- package/dist/chunk-P6QBZS27.js +231 -0
- package/dist/chunk-PMD5JSV3.js +242 -0
- package/dist/chunk-PSSHNBEL.js +177 -0
- package/dist/chunk-PZO7RZ5W.js +145 -0
- package/dist/chunk-QEPRH7JB.js +315 -0
- package/dist/chunk-QNEYHDKR.js +145 -0
- package/dist/chunk-QRXWPZKN.js +308 -0
- package/dist/chunk-QY4L6XHN.js +384 -0
- package/dist/chunk-RNWPCELY.js +176 -0
- package/dist/chunk-RSHN2AQ7.js +29 -0
- package/dist/chunk-RZLVE57X.js +38 -0
- package/dist/chunk-SDCIKREA.js +241 -0
- package/dist/chunk-SDREQWNI.js +175 -0
- package/dist/chunk-SH26ZOHU.js +159 -0
- package/dist/chunk-SJ5MC36D.js +882 -0
- package/dist/chunk-TRLBBLSS.js +176 -0
- package/dist/chunk-U6OXZPYC.js +384 -0
- package/dist/chunk-UDQZNO5H.js +231 -0
- package/dist/chunk-UIBTFZUD.js +314 -0
- package/dist/chunk-USUCPCUC.js +156 -0
- package/dist/chunk-UTK3TJC4.js +882 -0
- package/dist/chunk-V4GLWPD7.js +174 -0
- package/dist/chunk-VC6U3QGF.js +142 -0
- package/dist/chunk-VIST7ACL.js +88 -0
- package/dist/chunk-VUNL35KE.js +16 -0
- package/dist/chunk-VWBNI4SC.js +174 -0
- package/dist/chunk-W5KRWUNE.js +262 -0
- package/dist/chunk-WCGKLHCL.js +154 -0
- package/dist/chunk-WNXGIEX7.js +219 -0
- package/dist/chunk-WPVL6VIT.js +160 -0
- package/dist/chunk-X3YCHQQK.js +357 -0
- package/dist/chunk-X6LV22NZ.js +229 -0
- package/dist/chunk-XHTZ2DWC.js +206 -0
- package/dist/chunk-XPVSZIA3.js +315 -0
- package/dist/chunk-Y633ZIJF.js +384 -0
- package/dist/chunk-YCL4GUFR.js +222 -0
- package/dist/chunk-YTMKB44I.js +220 -0
- package/dist/{chunk-YRL4ZB4R.js → chunk-Z5PL3K7C.js} +1 -1
- package/dist/chunk-ZWBS3T7Q.js +244 -0
- package/dist/pushary-mode-T7XOPI6Z.js +83 -0
- package/dist/pushary-wait-4BUC6ZM6.js +93 -0
- package/dist/src/index.js +3 -3
- package/package.json +25 -1
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
// src/claude-config.ts
|
|
2
|
+
import { join } from "path";
|
|
3
|
+
var PUSHARY_MCP_URL = "https://pushary.com/api/mcp/mcp";
|
|
4
|
+
var PUSHARY_PERMISSION_RULE = "mcp__pushary__*";
|
|
5
|
+
var asRecord = (value) => value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
6
|
+
var ensureRecord = (target, key) => {
|
|
7
|
+
const existing = asRecord(target[key]);
|
|
8
|
+
if (existing) return existing;
|
|
9
|
+
const created = {};
|
|
10
|
+
target[key] = created;
|
|
11
|
+
return created;
|
|
12
|
+
};
|
|
13
|
+
var isPusharyPermission = (rule) => typeof rule === "string" && (rule.includes("pushary") || rule.includes("MCP(pushary"));
|
|
14
|
+
var isPusharyHook = (entry) => {
|
|
15
|
+
const hooks = asRecord(entry)?.hooks;
|
|
16
|
+
if (!Array.isArray(hooks)) return false;
|
|
17
|
+
return hooks.some((hook) => {
|
|
18
|
+
const command = String(asRecord(hook)?.command ?? "");
|
|
19
|
+
return command.includes("pushary-hook") || command.includes("pushary-post-hook") || command.includes("pushary-stop-hook") || command.includes("pushary-prompt-hook");
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
var addClaudeMcpServer = (config, apiKey) => {
|
|
23
|
+
const mcpServers = ensureRecord(config, "mcpServers");
|
|
24
|
+
mcpServers.pushary = {
|
|
25
|
+
type: "http",
|
|
26
|
+
url: PUSHARY_MCP_URL,
|
|
27
|
+
headers: { Authorization: `Bearer ${apiKey}` }
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
var removeClaudeMcpServers = (config) => {
|
|
31
|
+
let changed = false;
|
|
32
|
+
const removeFrom = (target) => {
|
|
33
|
+
const mcpServers = asRecord(target.mcpServers);
|
|
34
|
+
if (!mcpServers?.pushary) return;
|
|
35
|
+
delete mcpServers.pushary;
|
|
36
|
+
if (Object.keys(mcpServers).length === 0) delete target.mcpServers;
|
|
37
|
+
changed = true;
|
|
38
|
+
};
|
|
39
|
+
removeFrom(config);
|
|
40
|
+
const projects = asRecord(config.projects);
|
|
41
|
+
if (projects) {
|
|
42
|
+
for (const project of Object.values(projects)) {
|
|
43
|
+
const projectConfig = asRecord(project);
|
|
44
|
+
if (projectConfig) removeFrom(projectConfig);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return changed;
|
|
48
|
+
};
|
|
49
|
+
var addPusharyToolPermissions = (settings) => {
|
|
50
|
+
const permissions = ensureRecord(settings, "permissions");
|
|
51
|
+
const allow = Array.isArray(permissions.allow) ? permissions.allow : [];
|
|
52
|
+
const filtered = allow.filter((rule) => !isPusharyPermission(rule));
|
|
53
|
+
if (!filtered.includes(PUSHARY_PERMISSION_RULE)) {
|
|
54
|
+
filtered.push(PUSHARY_PERMISSION_RULE);
|
|
55
|
+
}
|
|
56
|
+
permissions.allow = filtered;
|
|
57
|
+
};
|
|
58
|
+
var addPusharyHooks = (settings, binDir) => {
|
|
59
|
+
const resolve = (name) => binDir ? join(binDir, name) : name;
|
|
60
|
+
const hooks = ensureRecord(settings, "hooks");
|
|
61
|
+
const preToolUse = (Array.isArray(hooks.PreToolUse) ? hooks.PreToolUse : []).filter((entry) => !isPusharyHook(entry));
|
|
62
|
+
preToolUse.push({
|
|
63
|
+
matcher: "Bash|Write|Edit",
|
|
64
|
+
hooks: [{
|
|
65
|
+
type: "command",
|
|
66
|
+
command: resolve("pushary-hook"),
|
|
67
|
+
timeout: 120
|
|
68
|
+
}]
|
|
69
|
+
});
|
|
70
|
+
hooks.PreToolUse = preToolUse;
|
|
71
|
+
const postToolUse = (Array.isArray(hooks.PostToolUse) ? hooks.PostToolUse : []).filter((entry) => !isPusharyHook(entry));
|
|
72
|
+
postToolUse.push({
|
|
73
|
+
matcher: "Bash|Write|Edit",
|
|
74
|
+
hooks: [{
|
|
75
|
+
type: "command",
|
|
76
|
+
command: resolve("pushary-post-hook"),
|
|
77
|
+
timeout: 10
|
|
78
|
+
}]
|
|
79
|
+
});
|
|
80
|
+
hooks.PostToolUse = postToolUse;
|
|
81
|
+
const stop = (Array.isArray(hooks.Stop) ? hooks.Stop : []).filter((entry) => !isPusharyHook(entry));
|
|
82
|
+
stop.push({
|
|
83
|
+
hooks: [{
|
|
84
|
+
type: "command",
|
|
85
|
+
command: resolve("pushary-stop-hook"),
|
|
86
|
+
timeout: 10
|
|
87
|
+
}]
|
|
88
|
+
});
|
|
89
|
+
hooks.Stop = stop;
|
|
90
|
+
const userPromptSubmit = (Array.isArray(hooks.UserPromptSubmit) ? hooks.UserPromptSubmit : []).filter((entry) => !isPusharyHook(entry));
|
|
91
|
+
userPromptSubmit.push({
|
|
92
|
+
hooks: [{
|
|
93
|
+
type: "command",
|
|
94
|
+
command: resolve("pushary-prompt-hook"),
|
|
95
|
+
timeout: 10
|
|
96
|
+
}]
|
|
97
|
+
});
|
|
98
|
+
hooks.UserPromptSubmit = userPromptSubmit;
|
|
99
|
+
};
|
|
100
|
+
var removePusharySettings = (settings) => {
|
|
101
|
+
let changed = removeClaudeMcpServers(settings);
|
|
102
|
+
const permissions = asRecord(settings.permissions);
|
|
103
|
+
if (permissions && Array.isArray(permissions.allow)) {
|
|
104
|
+
const filtered = permissions.allow.filter((rule) => !isPusharyPermission(rule));
|
|
105
|
+
if (filtered.length !== permissions.allow.length) {
|
|
106
|
+
if (filtered.length === 0) {
|
|
107
|
+
delete permissions.allow;
|
|
108
|
+
} else {
|
|
109
|
+
permissions.allow = filtered;
|
|
110
|
+
}
|
|
111
|
+
if (Object.keys(permissions).length === 0) delete settings.permissions;
|
|
112
|
+
changed = true;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
const hooks = asRecord(settings.hooks);
|
|
116
|
+
if (hooks) {
|
|
117
|
+
for (const key of ["PreToolUse", "PostToolUse", "Stop", "UserPromptSubmit"]) {
|
|
118
|
+
const entries = hooks[key];
|
|
119
|
+
if (!Array.isArray(entries)) continue;
|
|
120
|
+
const filtered = entries.filter((entry) => !isPusharyHook(entry));
|
|
121
|
+
if (filtered.length !== entries.length) {
|
|
122
|
+
if (filtered.length === 0) {
|
|
123
|
+
delete hooks[key];
|
|
124
|
+
} else {
|
|
125
|
+
hooks[key] = filtered;
|
|
126
|
+
}
|
|
127
|
+
changed = true;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
if (Object.keys(hooks).length === 0) delete settings.hooks;
|
|
131
|
+
}
|
|
132
|
+
return changed;
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
export {
|
|
136
|
+
addClaudeMcpServer,
|
|
137
|
+
removeClaudeMcpServers,
|
|
138
|
+
addPusharyToolPermissions,
|
|
139
|
+
addPusharyHooks,
|
|
140
|
+
removePusharySettings
|
|
141
|
+
};
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DEFAULT_SESSION,
|
|
3
|
+
askUser,
|
|
4
|
+
deriveToolTarget,
|
|
5
|
+
describeToolCall,
|
|
6
|
+
fetchModeState,
|
|
7
|
+
getMachineId,
|
|
8
|
+
getPolicy,
|
|
9
|
+
resolvePolicy,
|
|
10
|
+
savePendingQuestion,
|
|
11
|
+
sendNotification,
|
|
12
|
+
waitForAnswer
|
|
13
|
+
} from "./chunk-QEPRH7JB.js";
|
|
14
|
+
import {
|
|
15
|
+
getApiKey
|
|
16
|
+
} from "./chunk-VUNL35KE.js";
|
|
17
|
+
|
|
18
|
+
// src/hook.ts
|
|
19
|
+
import { basename } from "path";
|
|
20
|
+
var sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
21
|
+
var allow = () => ({
|
|
22
|
+
hookSpecificOutput: {
|
|
23
|
+
hookEventName: "PreToolUse",
|
|
24
|
+
permissionDecision: "allow"
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
var deny = (reason) => ({
|
|
28
|
+
hookSpecificOutput: {
|
|
29
|
+
hookEventName: "PreToolUse",
|
|
30
|
+
permissionDecision: "deny",
|
|
31
|
+
permissionDecisionReason: reason
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
var ask = (reason) => ({
|
|
35
|
+
hookSpecificOutput: {
|
|
36
|
+
hookEventName: "PreToolUse",
|
|
37
|
+
permissionDecision: "ask",
|
|
38
|
+
...reason ? { permissionDecisionReason: reason } : {}
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
var pollForAnswer = async (apiKey, correlationId, deadlineMs, pollInterval = 2e3) => {
|
|
42
|
+
while (Date.now() < deadlineMs) {
|
|
43
|
+
const remaining = Math.min(Math.max(deadlineMs - Date.now(), 1e3), 3e4);
|
|
44
|
+
let answer;
|
|
45
|
+
try {
|
|
46
|
+
answer = await waitForAnswer(apiKey, correlationId, remaining);
|
|
47
|
+
} catch {
|
|
48
|
+
if (Date.now() + pollInterval >= deadlineMs) break;
|
|
49
|
+
await sleep(pollInterval);
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
if (answer.answered) return answer;
|
|
53
|
+
if (Date.now() + pollInterval >= deadlineMs) break;
|
|
54
|
+
await sleep(pollInterval);
|
|
55
|
+
}
|
|
56
|
+
return { answered: false };
|
|
57
|
+
};
|
|
58
|
+
var handlePushOnly = async (apiKey, description, projectName, timeoutSeconds, timeoutAction, sessionId, machineId, toolName, toolTarget) => {
|
|
59
|
+
let result;
|
|
60
|
+
try {
|
|
61
|
+
result = await askUser(apiKey, {
|
|
62
|
+
question: `Allow ${description}?`,
|
|
63
|
+
type: "confirm",
|
|
64
|
+
context: `Agent wants to run this in ${projectName}`,
|
|
65
|
+
agentName: `Claude Code - ${projectName}`,
|
|
66
|
+
sessionId,
|
|
67
|
+
machineId,
|
|
68
|
+
toolName,
|
|
69
|
+
toolTarget
|
|
70
|
+
});
|
|
71
|
+
} catch {
|
|
72
|
+
switch (timeoutAction) {
|
|
73
|
+
case "approve":
|
|
74
|
+
return allow();
|
|
75
|
+
case "deny":
|
|
76
|
+
return deny("Push notification failed, denying per policy");
|
|
77
|
+
default:
|
|
78
|
+
return ask("Push notification failed, asking in terminal");
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
const deadline = Date.now() + timeoutSeconds * 1e3;
|
|
82
|
+
const answer = await pollForAnswer(apiKey, result.correlationId, deadline);
|
|
83
|
+
if (answer.answered) {
|
|
84
|
+
return answer.value === "yes" ? allow() : deny("Denied via push notification");
|
|
85
|
+
}
|
|
86
|
+
switch (timeoutAction) {
|
|
87
|
+
case "approve":
|
|
88
|
+
return allow();
|
|
89
|
+
case "deny":
|
|
90
|
+
return deny("No response within timeout");
|
|
91
|
+
default:
|
|
92
|
+
return ask("No push response, asking in terminal");
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
var handleTerminalOnly = () => {
|
|
96
|
+
return ask();
|
|
97
|
+
};
|
|
98
|
+
var handlePushFirst = async (apiKey, description, projectName, pushFirstSeconds, sessionId, machineId, toolName, toolTarget) => {
|
|
99
|
+
let result;
|
|
100
|
+
try {
|
|
101
|
+
result = await askUser(apiKey, {
|
|
102
|
+
question: `Allow ${description}?`,
|
|
103
|
+
type: "confirm",
|
|
104
|
+
context: `Agent wants to run this in ${projectName}`,
|
|
105
|
+
agentName: `Claude Code - ${projectName}`,
|
|
106
|
+
sessionId,
|
|
107
|
+
machineId,
|
|
108
|
+
toolName,
|
|
109
|
+
toolTarget
|
|
110
|
+
});
|
|
111
|
+
} catch {
|
|
112
|
+
return ask("Push notification failed, asking in terminal");
|
|
113
|
+
}
|
|
114
|
+
const deadline = Date.now() + pushFirstSeconds * 1e3;
|
|
115
|
+
const answer = await pollForAnswer(apiKey, result.correlationId, deadline, 1500);
|
|
116
|
+
if (answer.answered) {
|
|
117
|
+
return answer.value === "yes" ? allow() : deny("Denied via push notification");
|
|
118
|
+
}
|
|
119
|
+
savePendingQuestion(sessionId || DEFAULT_SESSION, result.correlationId);
|
|
120
|
+
return ask("Sent as push notification. You can also approve here.");
|
|
121
|
+
};
|
|
122
|
+
var handleNotifyOnly = async (apiKey, description, projectName, sessionId, machineId) => {
|
|
123
|
+
try {
|
|
124
|
+
await sendNotification(apiKey, {
|
|
125
|
+
title: "Agent needs approval",
|
|
126
|
+
body: description,
|
|
127
|
+
agentName: `Claude Code - ${projectName}`,
|
|
128
|
+
sessionId,
|
|
129
|
+
machineId
|
|
130
|
+
});
|
|
131
|
+
} catch {
|
|
132
|
+
}
|
|
133
|
+
return ask();
|
|
134
|
+
};
|
|
135
|
+
var handlePreToolUse = async (input) => {
|
|
136
|
+
try {
|
|
137
|
+
const apiKey = getApiKey();
|
|
138
|
+
const modeState = await fetchModeState(apiKey, input.session_id);
|
|
139
|
+
const policy = await getPolicy(apiKey, modeState.policyVersion);
|
|
140
|
+
if (modeState.kill) {
|
|
141
|
+
return deny("Stopped by user \u2014 this agent was halted from Pushary");
|
|
142
|
+
}
|
|
143
|
+
const toolPolicy = resolvePolicy(policy, input.tool_name, modeState.mode, input.tool_input);
|
|
144
|
+
if (toolPolicy.timeoutSeconds === 0 && toolPolicy.timeoutAction === "approve") {
|
|
145
|
+
return allow();
|
|
146
|
+
}
|
|
147
|
+
if (toolPolicy.timeoutSeconds === 0 && toolPolicy.timeoutAction === "deny") {
|
|
148
|
+
return deny(`Denied by policy for ${toolPolicy.tool}`);
|
|
149
|
+
}
|
|
150
|
+
const description = describeToolCall(input.tool_name, input.tool_input, "hook");
|
|
151
|
+
const projectName = basename(input.cwd ?? process.cwd());
|
|
152
|
+
const sessionId = input.session_id;
|
|
153
|
+
const machineId = getMachineId();
|
|
154
|
+
const toolTarget = deriveToolTarget(input.tool_name, input.tool_input);
|
|
155
|
+
switch (toolPolicy.mode) {
|
|
156
|
+
case "push_only":
|
|
157
|
+
return handlePushOnly(apiKey, description, projectName, toolPolicy.timeoutSeconds, toolPolicy.timeoutAction, sessionId, machineId, input.tool_name, toolTarget);
|
|
158
|
+
case "terminal_only":
|
|
159
|
+
return handleTerminalOnly();
|
|
160
|
+
case "push_first":
|
|
161
|
+
return handlePushFirst(apiKey, description, projectName, toolPolicy.pushFirstSeconds, sessionId, machineId, input.tool_name, toolTarget);
|
|
162
|
+
case "notify_only":
|
|
163
|
+
return handleNotifyOnly(apiKey, description, projectName, sessionId, machineId);
|
|
164
|
+
default:
|
|
165
|
+
return handlePushFirst(apiKey, description, projectName, toolPolicy.pushFirstSeconds, sessionId, machineId, input.tool_name, toolTarget);
|
|
166
|
+
}
|
|
167
|
+
} catch {
|
|
168
|
+
return ask("Pushary unavailable, falling back to terminal approval");
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
export {
|
|
173
|
+
handlePreToolUse
|
|
174
|
+
};
|