@pushary/agent-hooks 0.53.0 → 0.54.0
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/bin/pushary-claude.js +3 -3
- package/dist/bin/pushary-clean.js +3 -3
- package/dist/bin/pushary-codex-hook.js +4 -4
- package/dist/bin/pushary-codex.js +2 -2
- package/dist/bin/pushary-doctor.js +3 -3
- package/dist/bin/pushary-gemini-hook.js +4 -4
- package/dist/bin/pushary-hook.js +6 -6
- package/dist/bin/pushary-notification-hook.js +2 -2
- package/dist/bin/pushary-permission-denied-hook.js +6 -6
- package/dist/bin/pushary-permission-hook.js +6 -6
- package/dist/bin/pushary-post-hook.js +2 -2
- package/dist/bin/pushary-prompt-hook.js +2 -2
- package/dist/bin/pushary-session-end-hook.js +2 -2
- package/dist/bin/pushary-session-start-hook.js +2 -2
- package/dist/bin/pushary-setup.js +4 -4
- package/dist/bin/pushary-stats.js +2 -2
- package/dist/bin/pushary-stop-hook.js +2 -2
- package/dist/bin/pushary-stopfailure-hook.js +2 -2
- package/dist/bin/pushary-suggestions.d.ts +1 -0
- package/dist/{pushary-suggestions-WIONM5ME.js → bin/pushary-suggestions.js} +1 -1
- package/dist/bin/pushary-upgrade.js +2 -2
- package/dist/bin/pushary.js +1 -1
- package/dist/{chunk-G3Y5HB4P.js → chunk-PZWZ77QH.js} +1 -1
- package/dist/{chunk-JKSSDN2O.js → chunk-SVRDT5PP.js} +11 -11
- package/dist/{chunk-5U3YC3BZ.js → chunk-SWNBIHDX.js} +1 -1
- package/dist/{chunk-YTW7BZUC.js → chunk-T2EEBR2D.js} +1 -1
- package/dist/{chunk-CANZPNGD.js → chunk-WYQSLB7K.js} +1 -1
- package/dist/chunk-YHG74UFF.js +12 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +6 -6
- package/package.json +2 -1
- package/dist/chunk-KQYIHZ5E.js +0 -8
- /package/dist/{chunk-F4DGHFIW.js → chunk-SY3NBF67.js} +0 -0
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
} from "../chunk-XHKBHWLX.js";
|
|
6
6
|
import {
|
|
7
7
|
isDeferAnswer
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-YHG74UFF.js";
|
|
9
9
|
import {
|
|
10
10
|
askUser,
|
|
11
11
|
cancelQuestion,
|
|
@@ -16,14 +16,14 @@ import {
|
|
|
16
16
|
reportEvent,
|
|
17
17
|
resolvePolicy,
|
|
18
18
|
waitForAnswer
|
|
19
|
-
} from "../chunk-
|
|
19
|
+
} from "../chunk-SWNBIHDX.js";
|
|
20
20
|
import {
|
|
21
21
|
getMachineId
|
|
22
22
|
} from "../chunk-RN3NOEJF.js";
|
|
23
23
|
import "../chunk-DWED7BS3.js";
|
|
24
24
|
import {
|
|
25
25
|
redactSecrets
|
|
26
|
-
} from "../chunk-
|
|
26
|
+
} from "../chunk-SY3NBF67.js";
|
|
27
27
|
import {
|
|
28
28
|
getApiKey,
|
|
29
29
|
getBaseUrl
|
|
@@ -6,15 +6,15 @@ import {
|
|
|
6
6
|
removeCodexHooks,
|
|
7
7
|
removeGeminiSettings,
|
|
8
8
|
removeInstructionBlock
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-PZWZ77QH.js";
|
|
10
10
|
import {
|
|
11
11
|
execNpm
|
|
12
12
|
} from "../chunk-J7JWI3KU.js";
|
|
13
13
|
import {
|
|
14
14
|
removeClaudeMcpServers,
|
|
15
15
|
removePusharySettings
|
|
16
|
-
} from "../chunk-
|
|
17
|
-
import "../chunk-
|
|
16
|
+
} from "../chunk-T2EEBR2D.js";
|
|
17
|
+
import "../chunk-SY3NBF67.js";
|
|
18
18
|
|
|
19
19
|
// bin/pushary-clean.ts
|
|
20
20
|
import { existsSync, readFileSync, writeFileSync, rmSync, readdirSync } from "fs";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
denyReasonFrom,
|
|
4
4
|
isDeferAnswer
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-YHG74UFF.js";
|
|
6
6
|
import {
|
|
7
7
|
CODEX_AGENT,
|
|
8
8
|
DEFAULT_SESSION,
|
|
@@ -31,21 +31,21 @@ import {
|
|
|
31
31
|
toCodexWire,
|
|
32
32
|
toPolicyLookup,
|
|
33
33
|
waitForAnswer
|
|
34
|
-
} from "../chunk-
|
|
34
|
+
} from "../chunk-SWNBIHDX.js";
|
|
35
35
|
import {
|
|
36
36
|
getMachineId
|
|
37
37
|
} from "../chunk-RN3NOEJF.js";
|
|
38
38
|
import {
|
|
39
39
|
isGatingMoment,
|
|
40
40
|
recordKeylessMoment
|
|
41
|
-
} from "../chunk-
|
|
41
|
+
} from "../chunk-WYQSLB7K.js";
|
|
42
42
|
import "../chunk-DWED7BS3.js";
|
|
43
43
|
import {
|
|
44
44
|
DECISION_LINE_MAX,
|
|
45
45
|
effectiveWaitSeconds,
|
|
46
46
|
hookWaitClamped,
|
|
47
47
|
hookWaitDeadline
|
|
48
|
-
} from "../chunk-
|
|
48
|
+
} from "../chunk-SY3NBF67.js";
|
|
49
49
|
import {
|
|
50
50
|
getApiKey
|
|
51
51
|
} from "../chunk-NKXSILEW.js";
|
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
askUser,
|
|
4
4
|
reportEvent,
|
|
5
5
|
waitForAnswer
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-SWNBIHDX.js";
|
|
7
7
|
import {
|
|
8
8
|
getMachineId
|
|
9
9
|
} from "../chunk-RN3NOEJF.js";
|
|
10
10
|
import "../chunk-DWED7BS3.js";
|
|
11
|
-
import "../chunk-
|
|
11
|
+
import "../chunk-SY3NBF67.js";
|
|
12
12
|
import {
|
|
13
13
|
getApiKey
|
|
14
14
|
} from "../chunk-NKXSILEW.js";
|
|
@@ -11,18 +11,18 @@ import {
|
|
|
11
11
|
missingGeminiHookEvents,
|
|
12
12
|
readCodexMcpAuth,
|
|
13
13
|
untrustedCodexHookEvents
|
|
14
|
-
} from "../chunk-
|
|
14
|
+
} from "../chunk-PZWZ77QH.js";
|
|
15
15
|
import {
|
|
16
16
|
execNpm
|
|
17
17
|
} from "../chunk-J7JWI3KU.js";
|
|
18
18
|
import {
|
|
19
19
|
readLedgerSummary
|
|
20
|
-
} from "../chunk-
|
|
20
|
+
} from "../chunk-WYQSLB7K.js";
|
|
21
21
|
import {
|
|
22
22
|
callMcpTool,
|
|
23
23
|
sendMcpRequest
|
|
24
24
|
} from "../chunk-DWED7BS3.js";
|
|
25
|
-
import "../chunk-
|
|
25
|
+
import "../chunk-SY3NBF67.js";
|
|
26
26
|
import {
|
|
27
27
|
getBaseUrl
|
|
28
28
|
} from "../chunk-NKXSILEW.js";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
denyReasonFrom,
|
|
4
4
|
isDeferAnswer
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-YHG74UFF.js";
|
|
6
6
|
import {
|
|
7
7
|
DEFAULT_SESSION,
|
|
8
8
|
askUser,
|
|
@@ -23,21 +23,21 @@ import {
|
|
|
23
23
|
savePendingQuestion,
|
|
24
24
|
sendNotification,
|
|
25
25
|
waitForAnswer
|
|
26
|
-
} from "../chunk-
|
|
26
|
+
} from "../chunk-SWNBIHDX.js";
|
|
27
27
|
import {
|
|
28
28
|
getMachineId
|
|
29
29
|
} from "../chunk-RN3NOEJF.js";
|
|
30
30
|
import {
|
|
31
31
|
isGatingMoment,
|
|
32
32
|
recordKeylessMoment
|
|
33
|
-
} from "../chunk-
|
|
33
|
+
} from "../chunk-WYQSLB7K.js";
|
|
34
34
|
import "../chunk-DWED7BS3.js";
|
|
35
35
|
import {
|
|
36
36
|
DECISION_LINE_MAX,
|
|
37
37
|
effectiveWaitSeconds,
|
|
38
38
|
hookWaitClamped,
|
|
39
39
|
hookWaitDeadline
|
|
40
|
-
} from "../chunk-
|
|
40
|
+
} from "../chunk-SY3NBF67.js";
|
|
41
41
|
import {
|
|
42
42
|
getApiKey
|
|
43
43
|
} from "../chunk-NKXSILEW.js";
|
package/dist/bin/pushary-hook.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
handlePreToolUse
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-SVRDT5PP.js";
|
|
5
|
+
import "../chunk-T2EEBR2D.js";
|
|
6
|
+
import "../chunk-YHG74UFF.js";
|
|
7
|
+
import "../chunk-SWNBIHDX.js";
|
|
8
8
|
import "../chunk-RN3NOEJF.js";
|
|
9
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-WYQSLB7K.js";
|
|
10
10
|
import "../chunk-DWED7BS3.js";
|
|
11
|
-
import "../chunk-
|
|
11
|
+
import "../chunk-SY3NBF67.js";
|
|
12
12
|
import "../chunk-NKXSILEW.js";
|
|
13
13
|
|
|
14
14
|
// bin/pushary-hook.ts
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
handleNotification
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-SWNBIHDX.js";
|
|
5
5
|
import "../chunk-RN3NOEJF.js";
|
|
6
6
|
import "../chunk-DWED7BS3.js";
|
|
7
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-SY3NBF67.js";
|
|
8
8
|
import "../chunk-NKXSILEW.js";
|
|
9
9
|
|
|
10
10
|
// bin/pushary-notification-hook.ts
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
handlePermissionDenied
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-SVRDT5PP.js";
|
|
5
|
+
import "../chunk-T2EEBR2D.js";
|
|
6
|
+
import "../chunk-YHG74UFF.js";
|
|
7
|
+
import "../chunk-SWNBIHDX.js";
|
|
8
8
|
import "../chunk-RN3NOEJF.js";
|
|
9
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-WYQSLB7K.js";
|
|
10
10
|
import "../chunk-DWED7BS3.js";
|
|
11
|
-
import "../chunk-
|
|
11
|
+
import "../chunk-SY3NBF67.js";
|
|
12
12
|
import "../chunk-NKXSILEW.js";
|
|
13
13
|
|
|
14
14
|
// bin/pushary-permission-denied-hook.ts
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
handlePermissionRequest
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-SVRDT5PP.js";
|
|
5
|
+
import "../chunk-T2EEBR2D.js";
|
|
6
|
+
import "../chunk-YHG74UFF.js";
|
|
7
|
+
import "../chunk-SWNBIHDX.js";
|
|
8
8
|
import "../chunk-RN3NOEJF.js";
|
|
9
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-WYQSLB7K.js";
|
|
10
10
|
import "../chunk-DWED7BS3.js";
|
|
11
|
-
import "../chunk-
|
|
11
|
+
import "../chunk-SY3NBF67.js";
|
|
12
12
|
import "../chunk-NKXSILEW.js";
|
|
13
13
|
|
|
14
14
|
// bin/pushary-permission-hook.ts
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
handlePostToolUse
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-SWNBIHDX.js";
|
|
5
5
|
import "../chunk-RN3NOEJF.js";
|
|
6
6
|
import "../chunk-DWED7BS3.js";
|
|
7
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-SY3NBF67.js";
|
|
8
8
|
import "../chunk-NKXSILEW.js";
|
|
9
9
|
|
|
10
10
|
// bin/pushary-post-hook.ts
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
handleUserPrompt
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-SWNBIHDX.js";
|
|
5
5
|
import "../chunk-RN3NOEJF.js";
|
|
6
6
|
import "../chunk-DWED7BS3.js";
|
|
7
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-SY3NBF67.js";
|
|
8
8
|
import "../chunk-NKXSILEW.js";
|
|
9
9
|
|
|
10
10
|
// bin/pushary-prompt-hook.ts
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
handleSessionEnd
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-SWNBIHDX.js";
|
|
5
5
|
import "../chunk-RN3NOEJF.js";
|
|
6
6
|
import "../chunk-DWED7BS3.js";
|
|
7
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-SY3NBF67.js";
|
|
8
8
|
import "../chunk-NKXSILEW.js";
|
|
9
9
|
|
|
10
10
|
// bin/pushary-session-end-hook.ts
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
handleSessionStart
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-SWNBIHDX.js";
|
|
5
5
|
import "../chunk-RN3NOEJF.js";
|
|
6
6
|
import "../chunk-DWED7BS3.js";
|
|
7
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-SY3NBF67.js";
|
|
8
8
|
import "../chunk-NKXSILEW.js";
|
|
9
9
|
|
|
10
10
|
// bin/pushary-session-start-hook.ts
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
renderAgentInstructions,
|
|
14
14
|
renderProjectAgentInstructions,
|
|
15
15
|
writeInstructionBlock
|
|
16
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-PZWZ77QH.js";
|
|
17
17
|
import {
|
|
18
18
|
execNpm,
|
|
19
19
|
npmErrorMessage,
|
|
@@ -25,15 +25,15 @@ import {
|
|
|
25
25
|
addClaudeMcpServer,
|
|
26
26
|
addPusharyHooks,
|
|
27
27
|
addPusharyToolPermissions
|
|
28
|
-
} from "../chunk-
|
|
28
|
+
} from "../chunk-T2EEBR2D.js";
|
|
29
29
|
import {
|
|
30
30
|
reportEvent
|
|
31
|
-
} from "../chunk-
|
|
31
|
+
} from "../chunk-SWNBIHDX.js";
|
|
32
32
|
import "../chunk-RN3NOEJF.js";
|
|
33
33
|
import "../chunk-DWED7BS3.js";
|
|
34
34
|
import {
|
|
35
35
|
isValidApiKey
|
|
36
|
-
} from "../chunk-
|
|
36
|
+
} from "../chunk-SY3NBF67.js";
|
|
37
37
|
import "../chunk-NKXSILEW.js";
|
|
38
38
|
|
|
39
39
|
// bin/pushary-setup.ts
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
handleStop
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-SWNBIHDX.js";
|
|
5
5
|
import "../chunk-RN3NOEJF.js";
|
|
6
6
|
import "../chunk-DWED7BS3.js";
|
|
7
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-SY3NBF67.js";
|
|
8
8
|
import "../chunk-NKXSILEW.js";
|
|
9
9
|
|
|
10
10
|
// bin/pushary-stop-hook.ts
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
handleStopFailure
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-SWNBIHDX.js";
|
|
5
5
|
import "../chunk-RN3NOEJF.js";
|
|
6
6
|
import "../chunk-DWED7BS3.js";
|
|
7
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-SY3NBF67.js";
|
|
8
8
|
import "../chunk-NKXSILEW.js";
|
|
9
9
|
|
|
10
10
|
// bin/pushary-stopfailure-hook.ts
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
@@ -8,8 +8,8 @@ import {
|
|
|
8
8
|
addClaudeMcpServer,
|
|
9
9
|
addPusharyHooks,
|
|
10
10
|
addPusharyToolPermissions
|
|
11
|
-
} from "../chunk-
|
|
12
|
-
import "../chunk-
|
|
11
|
+
} from "../chunk-T2EEBR2D.js";
|
|
12
|
+
import "../chunk-SY3NBF67.js";
|
|
13
13
|
import {
|
|
14
14
|
getApiKey
|
|
15
15
|
} from "../chunk-NKXSILEW.js";
|
package/dist/bin/pushary.js
CHANGED
|
@@ -17,7 +17,7 @@ if (command === "setup") {
|
|
|
17
17
|
} else if (command === "stats") {
|
|
18
18
|
await import("./pushary-stats.js");
|
|
19
19
|
} else if (command === "suggestions") {
|
|
20
|
-
await import("
|
|
20
|
+
await import("./pushary-suggestions.js");
|
|
21
21
|
} else if (command === "upgrade") {
|
|
22
22
|
await import("./pushary-upgrade.js");
|
|
23
23
|
} else if (command === "claude") {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PRETOOLUSE_HANDLED_TOOLS
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-T2EEBR2D.js";
|
|
4
4
|
import {
|
|
5
5
|
denyReasonFrom,
|
|
6
6
|
isDeferAnswer
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-YHG74UFF.js";
|
|
8
8
|
import {
|
|
9
9
|
DEFAULT_SESSION,
|
|
10
10
|
askUser,
|
|
@@ -23,20 +23,20 @@ import {
|
|
|
23
23
|
sendNotification,
|
|
24
24
|
throttlePass,
|
|
25
25
|
waitForAnswer
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-SWNBIHDX.js";
|
|
27
27
|
import {
|
|
28
28
|
getMachineId
|
|
29
29
|
} from "./chunk-RN3NOEJF.js";
|
|
30
30
|
import {
|
|
31
31
|
isGatingMoment,
|
|
32
32
|
recordKeylessMoment
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-WYQSLB7K.js";
|
|
34
34
|
import {
|
|
35
35
|
buildDecisionEpisodeFeatures,
|
|
36
36
|
effectiveWaitSeconds,
|
|
37
37
|
hookWaitClamped,
|
|
38
38
|
hookWaitDeadline
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-SY3NBF67.js";
|
|
40
40
|
import {
|
|
41
41
|
getApiKey,
|
|
42
42
|
getBaseUrl
|
|
@@ -141,7 +141,7 @@ var handlePushOnly = async (apiKey, description, projectName, timeoutSeconds, ti
|
|
|
141
141
|
if (result.suppressed) {
|
|
142
142
|
await cancelQuestion(apiKey, result.correlationId).catch(() => {
|
|
143
143
|
});
|
|
144
|
-
return ask("You are at the keyboard
|
|
144
|
+
return ask("You are at the keyboard, approve here.");
|
|
145
145
|
}
|
|
146
146
|
if (result.noDevices) {
|
|
147
147
|
switch (timeoutAction) {
|
|
@@ -161,11 +161,11 @@ var handlePushOnly = async (apiKey, description, projectName, timeoutSeconds, ti
|
|
|
161
161
|
if (answer.answered) {
|
|
162
162
|
if (isDeferAnswer(answer.value)) return ask("Handling on your machine");
|
|
163
163
|
signals.humanDecision = true;
|
|
164
|
-
return answer.value === "yes" ? allow() : deny(denyReasonFrom(answer.value));
|
|
164
|
+
return answer.value === "yes" ? allow() : deny(denyReasonFrom(answer.value, answer.note));
|
|
165
165
|
}
|
|
166
166
|
if (timeoutAction === "wait" || clampCut) {
|
|
167
167
|
savePendingQuestion(sessionId || DEFAULT_SESSION, result.correlationId);
|
|
168
|
-
return ask(timeoutAction === "wait" ? "
|
|
168
|
+
return ask(timeoutAction === "wait" ? "Still waiting on your phone. Answer here, or on your phone and it will be applied on the next step." : "This step cannot wait any longer. Answer here, or on your phone and it will be applied on the next step.");
|
|
169
169
|
}
|
|
170
170
|
switch (timeoutAction) {
|
|
171
171
|
case "approve":
|
|
@@ -199,7 +199,7 @@ var handlePushFirst = async (apiKey, description, projectName, pushFirstSeconds,
|
|
|
199
199
|
if (result.suppressed) {
|
|
200
200
|
await cancelQuestion(apiKey, result.correlationId).catch(() => {
|
|
201
201
|
});
|
|
202
|
-
return ask("You are at the keyboard
|
|
202
|
+
return ask("You are at the keyboard, approve here.");
|
|
203
203
|
}
|
|
204
204
|
if (result.noDevices) {
|
|
205
205
|
return void 0;
|
|
@@ -209,7 +209,7 @@ var handlePushFirst = async (apiKey, description, projectName, pushFirstSeconds,
|
|
|
209
209
|
if (answer.answered) {
|
|
210
210
|
if (isDeferAnswer(answer.value)) return ask("Handling on your machine");
|
|
211
211
|
signals.humanDecision = true;
|
|
212
|
-
return answer.value === "yes" ? allow() : deny(denyReasonFrom(answer.value));
|
|
212
|
+
return answer.value === "yes" ? allow() : deny(denyReasonFrom(answer.value, answer.note));
|
|
213
213
|
}
|
|
214
214
|
savePendingQuestion(sessionId || DEFAULT_SESSION, result.correlationId);
|
|
215
215
|
return ask("Sent as push notification. You can also approve here.");
|
|
@@ -387,7 +387,7 @@ var handlePreToolUse = async (input) => {
|
|
|
387
387
|
const modeState = await fetchModeState(apiKey, input.session_id);
|
|
388
388
|
const policy = await getPolicy(apiKey, modeState.policyVersion, "claude_code");
|
|
389
389
|
if (modeState.kill) {
|
|
390
|
-
return deny("Stopped by user
|
|
390
|
+
return deny("Stopped by user, this agent was halted from Pushary");
|
|
391
391
|
}
|
|
392
392
|
if (input.tool_name === "AskUserQuestion") {
|
|
393
393
|
return handleAskUserQuestion(apiKey, input);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// src/answer.ts
|
|
2
|
+
var denyReasonFrom = (value, note) => {
|
|
3
|
+
const trimmed = note?.trim();
|
|
4
|
+
if (trimmed) return `Denied from your phone: ${trimmed}`;
|
|
5
|
+
return value && value !== "no" && value !== "yes" ? `Denied from your phone: ${value}` : "Denied via push notification";
|
|
6
|
+
};
|
|
7
|
+
var isDeferAnswer = (value) => value === "defer";
|
|
8
|
+
|
|
9
|
+
export {
|
|
10
|
+
denyReasonFrom,
|
|
11
|
+
isDeferAnswer
|
|
12
|
+
};
|
package/dist/src/index.d.ts
CHANGED
|
@@ -136,6 +136,7 @@ interface AskUserResponse {
|
|
|
136
136
|
interface WaitForAnswerResponse {
|
|
137
137
|
answered: boolean;
|
|
138
138
|
value?: string;
|
|
139
|
+
note?: string;
|
|
139
140
|
}
|
|
140
141
|
declare const askUser: (apiKey: string, params: AskUserParams, timeoutMs?: number) => Promise<AskUserResponse>;
|
|
141
142
|
declare const waitForAnswer: (apiKey: string, correlationId: string, timeoutMs?: number) => Promise<WaitForAnswerResponse>;
|
package/dist/src/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
handlePreToolUse
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-SVRDT5PP.js";
|
|
4
|
+
import "../chunk-T2EEBR2D.js";
|
|
5
|
+
import "../chunk-YHG74UFF.js";
|
|
6
6
|
import {
|
|
7
7
|
askUser,
|
|
8
8
|
cancelQuestion,
|
|
@@ -15,11 +15,11 @@ import {
|
|
|
15
15
|
reportEvent,
|
|
16
16
|
resolvePolicy,
|
|
17
17
|
waitForAnswer
|
|
18
|
-
} from "../chunk-
|
|
18
|
+
} from "../chunk-SWNBIHDX.js";
|
|
19
19
|
import "../chunk-RN3NOEJF.js";
|
|
20
|
-
import "../chunk-
|
|
20
|
+
import "../chunk-WYQSLB7K.js";
|
|
21
21
|
import "../chunk-DWED7BS3.js";
|
|
22
|
-
import "../chunk-
|
|
22
|
+
import "../chunk-SY3NBF67.js";
|
|
23
23
|
import {
|
|
24
24
|
getApiKey,
|
|
25
25
|
getBaseUrl
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pushary/agent-hooks",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.54.0",
|
|
4
4
|
"description": "Permission hooks for AI coding agents: route tool approvals through Pushary push notifications",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pushary",
|
|
@@ -64,6 +64,7 @@
|
|
|
64
64
|
"pushary-mode": "./dist/bin/pushary-mode.js",
|
|
65
65
|
"pushary-wait": "./dist/bin/pushary-wait.js",
|
|
66
66
|
"pushary-stats": "./dist/bin/pushary-stats.js",
|
|
67
|
+
"pushary-suggestions": "./dist/bin/pushary-suggestions.js",
|
|
67
68
|
"pushary-upgrade": "./dist/bin/pushary-upgrade.js"
|
|
68
69
|
},
|
|
69
70
|
"files": [
|
package/dist/chunk-KQYIHZ5E.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
// src/answer.ts
|
|
2
|
-
var denyReasonFrom = (value) => value && value !== "no" && value !== "yes" ? `Denied from your phone: ${value}` : "Denied via push notification";
|
|
3
|
-
var isDeferAnswer = (value) => value === "defer";
|
|
4
|
-
|
|
5
|
-
export {
|
|
6
|
-
denyReasonFrom,
|
|
7
|
-
isDeferAnswer
|
|
8
|
-
};
|
|
File without changes
|