@pushary/agent-hooks 1.9.161 → 1.9.163
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/CHANGELOG.md +10 -0
- package/dist/{api-WHTSBK74.js → api-3W4XWXCZ.js} +13 -11
- package/dist/bin/pushary-audit.js +3 -3
- package/dist/bin/pushary-bell-hook.js +28 -28
- package/dist/bin/pushary-bell.js +11 -11
- package/dist/bin/pushary-calls.js +15 -15
- package/dist/bin/pushary-claude.js +27 -27
- package/dist/bin/pushary-clean.js +38 -38
- package/dist/bin/pushary-codex-bridge.js +23 -23
- package/dist/bin/pushary-codex-hook.js +187 -52
- package/dist/bin/pushary-codex-session.js +8 -8
- package/dist/bin/pushary-codex.js +16 -16
- package/dist/bin/pushary-connect.js +34 -34
- package/dist/bin/pushary-cowork.js +5 -5
- package/dist/bin/pushary-daemon.js +45 -45
- package/dist/bin/pushary-disconnect.js +29 -29
- package/dist/bin/pushary-doctor.js +46 -46
- package/dist/bin/pushary-elicitation-hook.js +28 -28
- package/dist/bin/pushary-gemini-bridge.js +17 -17
- package/dist/bin/pushary-gemini-hook.js +32 -32
- package/dist/bin/pushary-hook.js +36 -36
- package/dist/bin/pushary-login.js +22 -22
- package/dist/bin/pushary-logout.js +29 -29
- package/dist/bin/pushary-mcp.js +12 -12
- package/dist/bin/pushary-mode.js +16 -16
- package/dist/bin/pushary-notification-hook.js +27 -27
- package/dist/bin/pushary-opencode-hook.js +124 -75
- package/dist/bin/pushary-permission-denied-hook.js +36 -36
- package/dist/bin/pushary-permission-hook.js +36 -36
- package/dist/bin/pushary-post-hook.js +28 -28
- package/dist/bin/pushary-prompt-hook.js +27 -27
- package/dist/bin/pushary-session-end-hook.js +27 -27
- package/dist/bin/pushary-session-start-hook.js +38 -38
- package/dist/bin/pushary-setup.js +54 -54
- package/dist/bin/pushary-stats.js +5 -5
- package/dist/bin/pushary-status.js +35 -35
- package/dist/bin/pushary-stop-hook.js +27 -27
- package/dist/bin/pushary-stopfailure-hook.js +27 -27
- package/dist/bin/pushary-suggestions.js +16 -16
- package/dist/bin/pushary-transcript-register.js +17 -17
- package/dist/bin/pushary-transcripts.js +25 -25
- package/dist/bin/pushary-upgrade.js +43 -43
- package/dist/bin/pushary-wait.js +16 -16
- package/dist/bin/pushary.js +7 -7
- package/dist/{chunk-KKDKPWGM.js → chunk-2P3E6CXY.js} +1 -1
- package/dist/{chunk-J36DDPJV.js → chunk-3HDZQKAK.js} +1 -1
- package/dist/{chunk-2ABUBECK.js → chunk-3HUPWSLJ.js} +4 -4
- package/dist/{chunk-YEB7YWW7.js → chunk-3J6NPY5E.js} +8 -8
- package/dist/{chunk-DWMQZM52.js → chunk-3SGXZHV5.js} +1 -1
- package/dist/{chunk-Y553AEQU.js → chunk-3TN7WHEF.js} +3 -3
- package/dist/{chunk-WCXVPYSD.js → chunk-3WW4TQT2.js} +1 -1
- package/dist/{chunk-AT5ZLKMQ.js → chunk-3ZJLASF2.js} +5 -5
- package/dist/{chunk-2PY5DJTC.js → chunk-4ZV734EY.js} +1 -1
- package/dist/{chunk-UZTGEACF.js → chunk-5HSPZGN6.js} +5 -5
- package/dist/{chunk-AVGYUZVK.js → chunk-5TQERWVE.js} +6 -6
- package/dist/{chunk-OOODAKCC.js → chunk-5ZL7QBVM.js} +6 -6
- package/dist/{chunk-IHYKSPWH.js → chunk-6XKJVF2A.js} +8 -6
- package/dist/{chunk-UJT32RSQ.js → chunk-7DHVYOOP.js} +6 -6
- package/dist/{chunk-UH7GJHOO.js → chunk-7FMXDLNO.js} +3 -3
- package/dist/{chunk-OSCZ4MNE.js → chunk-7RGPAEEL.js} +5 -5
- package/dist/{chunk-R7NAG65X.js → chunk-7U3GZ5ZV.js} +2 -2
- package/dist/{chunk-L2ADRR62.js → chunk-7WBIMPZQ.js} +5 -5
- package/dist/{chunk-55AHQF63.js → chunk-AYQNGBZC.js} +7 -0
- package/dist/{chunk-W6FCSBTM.js → chunk-AZ7X2FBB.js} +2 -2
- package/dist/{chunk-4ZNZS6FM.js → chunk-B6SP4ZLB.js} +5 -5
- package/dist/{chunk-5UBV26GO.js → chunk-BS5YSLXS.js} +3 -3
- package/dist/{chunk-AVRRD6AY.js → chunk-COFH3FQT.js} +1 -1
- package/dist/{chunk-I5HXAELM.js → chunk-DJOAYJYR.js} +3 -3
- package/dist/{chunk-26GVUJMR.js → chunk-EXVUFDLL.js} +1 -1
- package/dist/{chunk-XWCLKWKP.js → chunk-F2EPFT5W.js} +1 -1
- package/dist/{chunk-F5NJUDGA.js → chunk-FIQFGSXB.js} +18 -18
- package/dist/{chunk-5S66DHJS.js → chunk-FRT6CTUK.js} +3 -3
- package/dist/{chunk-WAFJGQSE.js → chunk-FXV6MD35.js} +4 -4
- package/dist/{chunk-GJA3KQ3T.js → chunk-G3YVXFRI.js} +5 -5
- package/dist/{chunk-HKCJZGAJ.js → chunk-GVPOVNRT.js} +3 -3
- package/dist/{chunk-KDHLOPSO.js → chunk-GY3BDYVF.js} +1 -1
- package/dist/{chunk-VYNC7EYV.js → chunk-IHZ7MUYB.js} +2 -2
- package/dist/{chunk-DLZ6RK2P.js → chunk-ILPCJRLG.js} +3 -3
- package/dist/{chunk-LRTRIDOC.js → chunk-IZFVQLKO.js} +1 -1
- package/dist/{chunk-DHUWAUVL.js → chunk-JDY2FFC3.js} +1 -1
- package/dist/{chunk-MPYQW4IV.js → chunk-JQ2KBN4B.js} +2 -2
- package/dist/{chunk-OXZ75E2Y.js → chunk-K2QDEWH3.js} +4 -4
- package/dist/{chunk-OQAIMSHQ.js → chunk-KG5UNSTJ.js} +1 -1
- package/dist/{chunk-U36COV3Z.js → chunk-KJY4KNSE.js} +11 -11
- package/dist/{chunk-7AQTKVA6.js → chunk-KU55VZ2I.js} +4 -4
- package/dist/{chunk-EGEZKJHX.js → chunk-KU7DUO5E.js} +5 -5
- package/dist/{chunk-HHNC6FWO.js → chunk-LEWUIP5P.js} +1 -1
- package/dist/{chunk-TYB2QGJD.js → chunk-LKF2C5SP.js} +5 -5
- package/dist/{chunk-6OSE2IRG.js → chunk-LNZQBK3Z.js} +2 -2
- package/dist/{chunk-WNIDBPT2.js → chunk-LS6MIVVS.js} +6 -6
- package/dist/{chunk-E7K6YCWY.js → chunk-LYPTFNMM.js} +2 -2
- package/dist/{chunk-YGHHDDIM.js → chunk-MBAWDULS.js} +4 -4
- package/dist/{chunk-OZK75SFS.js → chunk-MLOOPTC7.js} +9 -9
- package/dist/{chunk-MGOBIHXH.js → chunk-MUGQUNPY.js} +10 -10
- package/dist/{chunk-RZBCXPOV.js → chunk-N7VOAIFG.js} +1 -1
- package/dist/{chunk-3F6HE5AK.js → chunk-NE23W6RX.js} +2 -2
- package/dist/{chunk-ATI5XO3E.js → chunk-OQSSPA5U.js} +3 -3
- package/dist/{chunk-U3FVVMB3.js → chunk-P6D5R2GR.js} +1 -1
- package/dist/{chunk-ZIKSHD5M.js → chunk-Q5CWVFV2.js} +2 -2
- package/dist/{chunk-GNHXDRO6.js → chunk-QCTLGNMD.js} +1 -1
- package/dist/{chunk-DHX5JZSH.js → chunk-QLBY4O7Q.js} +4 -4
- package/dist/{chunk-7VXHWU7A.js → chunk-QNHUMOCQ.js} +4 -4
- package/dist/{chunk-YD45WNVQ.js → chunk-QOKW2NVQ.js} +1 -1
- package/dist/{chunk-N4OKAE65.js → chunk-QRPW7KDH.js} +15 -13
- package/dist/{chunk-R7RN3Z2T.js → chunk-RQWKMBDO.js} +2 -2
- package/dist/{chunk-ANYLSZN3.js → chunk-RXEBODH6.js} +6 -6
- package/dist/{chunk-G44FOBHN.js → chunk-SKUDNFAZ.js} +4 -4
- package/dist/{chunk-6NWESDKK.js → chunk-SYAAPPNF.js} +4 -4
- package/dist/{chunk-FZCEPG6J.js → chunk-TAD24RFF.js} +2 -2
- package/dist/{chunk-7WLKE7QN.js → chunk-TF46WWVU.js} +2 -2
- package/dist/{chunk-ONMAG5BF.js → chunk-TG252BD4.js} +2 -2
- package/dist/{chunk-BGU56XCS.js → chunk-U2XD5U2Z.js} +1 -1
- package/dist/{chunk-Z5DOTAFI.js → chunk-UFTT6RO6.js} +3 -3
- package/dist/{chunk-PXLWR4TG.js → chunk-VXSAB3ZE.js} +2 -2
- package/dist/{chunk-VIS3EVRH.js → chunk-W2EOPCHG.js} +1 -1
- package/dist/{chunk-LVGRSC44.js → chunk-WHRLUSI3.js} +5 -5
- package/dist/{chunk-QLEFFGCN.js → chunk-WOAHDWWF.js} +1 -1
- package/dist/{chunk-HKI4RMZF.js → chunk-XO62UOR7.js} +7 -7
- package/dist/{chunk-7IHVTLHK.js → chunk-XOTBVRIH.js} +1 -1
- package/dist/{chunk-IGSSDODQ.js → chunk-YKR52UPQ.js} +1 -1
- package/dist/{chunk-Y23YO46U.js → chunk-YLV5J6QF.js} +3 -3
- package/dist/{chunk-BTYHDCAP.js → chunk-YQJX2SJ3.js} +3 -3
- package/dist/{chunk-WTWBHE2Y.js → chunk-ZLWAN47L.js} +24 -14
- package/dist/{chunk-S6ARXVVZ.js → chunk-ZZ44PWXB.js} +1 -1
- package/dist/{codex-app-cards-switch-DPCGWQSX.js → codex-app-cards-switch-TXT3ZJIA.js} +11 -11
- package/dist/{codex-card-routing-NFIEH66Q.js → codex-card-routing-LHZ4GOC5.js} +2 -2
- package/dist/{codex-desktop-launch-MARNBY23.js → codex-desktop-launch-7GSAOUBA.js} +1 -1
- package/dist/{codex-session-launch-LSNU7CUV.js → codex-session-launch-NPEFPDVM.js} +20 -20
- package/dist/{config-5D34OAYM.js → config-JEWWH3CO.js} +3 -3
- package/dist/{global-upgrade-5XBO6FYU.js → global-upgrade-SJVITKA6.js} +9 -9
- package/dist/{identity-6QEFK7PW.js → identity-JX2NVJQ3.js} +4 -4
- package/dist/{live-capabilities-6KOGY6KM.js → live-capabilities-YYINM2NK.js} +4 -4
- package/dist/{paths-7M6V62NO.js → paths-2QDA4DUP.js} +3 -3
- package/dist/{reapply-ZECM5JRX.js → reapply-23723QEC.js} +31 -31
- package/dist/src/index.js +35 -35
- package/dist/{upgrade-lock-DI4JY2CU.js → upgrade-lock-6AHHM2WU.js} +4 -4
- package/dist/{usage-X4BIHYR5.js → usage-ESU3WTVK.js} +3 -3
- package/package.json +1 -1
|
@@ -1,47 +1,47 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
readHookInput
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-KU7DUO5E.js";
|
|
5
|
+
import "../chunk-QNHUMOCQ.js";
|
|
6
|
+
import "../chunk-MUGQUNPY.js";
|
|
7
7
|
import "../chunk-WHB622LP.js";
|
|
8
8
|
import {
|
|
9
9
|
activeHookSource,
|
|
10
10
|
activeIdentity
|
|
11
|
-
} from "../chunk-
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
11
|
+
} from "../chunk-WHRLUSI3.js";
|
|
12
|
+
import "../chunk-LS6MIVVS.js";
|
|
13
|
+
import "../chunk-MBAWDULS.js";
|
|
14
14
|
import {
|
|
15
15
|
handleNotification
|
|
16
|
-
} from "../chunk-
|
|
17
|
-
import "../chunk-
|
|
18
|
-
import "../chunk-
|
|
19
|
-
import "../chunk-
|
|
16
|
+
} from "../chunk-QRPW7KDH.js";
|
|
17
|
+
import "../chunk-EXVUFDLL.js";
|
|
18
|
+
import "../chunk-COFH3FQT.js";
|
|
19
|
+
import "../chunk-4ZV734EY.js";
|
|
20
20
|
import "../chunk-YPY4YCIZ.js";
|
|
21
|
-
import "../chunk-
|
|
21
|
+
import "../chunk-BS5YSLXS.js";
|
|
22
22
|
import "../chunk-352FIVVH.js";
|
|
23
|
-
import "../chunk-
|
|
23
|
+
import "../chunk-QOKW2NVQ.js";
|
|
24
24
|
import "../chunk-Y6ILCLKE.js";
|
|
25
|
-
import "../chunk-
|
|
26
|
-
import "../chunk-
|
|
27
|
-
import "../chunk-
|
|
25
|
+
import "../chunk-WOAHDWWF.js";
|
|
26
|
+
import "../chunk-6XKJVF2A.js";
|
|
27
|
+
import "../chunk-GY3BDYVF.js";
|
|
28
28
|
import "../chunk-POFBE6ZY.js";
|
|
29
|
-
import "../chunk-
|
|
30
|
-
import "../chunk-
|
|
31
|
-
import "../chunk-
|
|
32
|
-
import "../chunk-
|
|
33
|
-
import "../chunk-
|
|
34
|
-
import "../chunk-
|
|
35
|
-
import "../chunk-
|
|
36
|
-
import "../chunk-
|
|
37
|
-
import "../chunk-
|
|
38
|
-
import "../chunk-
|
|
29
|
+
import "../chunk-7RGPAEEL.js";
|
|
30
|
+
import "../chunk-3SGXZHV5.js";
|
|
31
|
+
import "../chunk-DJOAYJYR.js";
|
|
32
|
+
import "../chunk-GVPOVNRT.js";
|
|
33
|
+
import "../chunk-W2EOPCHG.js";
|
|
34
|
+
import "../chunk-YLV5J6QF.js";
|
|
35
|
+
import "../chunk-TAD24RFF.js";
|
|
36
|
+
import "../chunk-TF46WWVU.js";
|
|
37
|
+
import "../chunk-FXV6MD35.js";
|
|
38
|
+
import "../chunk-XOTBVRIH.js";
|
|
39
39
|
import "../chunk-YU2EUD7O.js";
|
|
40
40
|
import "../chunk-TODDEIYG.js";
|
|
41
41
|
import "../chunk-BG4HHB7E.js";
|
|
42
|
-
import "../chunk-
|
|
42
|
+
import "../chunk-N7VOAIFG.js";
|
|
43
43
|
import "../chunk-UQTQ6HPO.js";
|
|
44
|
-
import "../chunk-
|
|
44
|
+
import "../chunk-AYQNGBZC.js";
|
|
45
45
|
import "../chunk-MLKGABMK.js";
|
|
46
46
|
|
|
47
47
|
// bin/pushary-notification-hook.ts
|
|
@@ -10,35 +10,35 @@ import {
|
|
|
10
10
|
OPENCODE_QUESTION_UNDELIVERED_EVENT,
|
|
11
11
|
OPENCODE_QUESTION_UNREACHABLE_EVENT,
|
|
12
12
|
OPENCODE_SUBAGENT_IDLE_EVENT
|
|
13
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-KG5UNSTJ.js";
|
|
14
14
|
import {
|
|
15
15
|
parseOpenCodeHookInput,
|
|
16
16
|
pushQuestionAndWait,
|
|
17
17
|
scopeQuestionOf
|
|
18
|
-
} from "../chunk-
|
|
18
|
+
} from "../chunk-B6SP4ZLB.js";
|
|
19
19
|
import {
|
|
20
20
|
askAgentQuestionWhileOpen
|
|
21
|
-
} from "../chunk-
|
|
21
|
+
} from "../chunk-ZLWAN47L.js";
|
|
22
22
|
import {
|
|
23
23
|
reportMachineDenial
|
|
24
|
-
} from "../chunk-
|
|
24
|
+
} from "../chunk-FRT6CTUK.js";
|
|
25
25
|
import {
|
|
26
26
|
isGatingMoment,
|
|
27
27
|
recordKeylessMoment
|
|
28
|
-
} from "../chunk-
|
|
28
|
+
} from "../chunk-LEWUIP5P.js";
|
|
29
29
|
import {
|
|
30
30
|
readHookInput
|
|
31
|
-
} from "../chunk-
|
|
32
|
-
import "../chunk-
|
|
31
|
+
} from "../chunk-KU7DUO5E.js";
|
|
32
|
+
import "../chunk-QNHUMOCQ.js";
|
|
33
33
|
import {
|
|
34
34
|
announceSubscriptionRequired,
|
|
35
35
|
isDeferAnswer
|
|
36
|
-
} from "../chunk-
|
|
37
|
-
import "../chunk-
|
|
36
|
+
} from "../chunk-JDY2FFC3.js";
|
|
37
|
+
import "../chunk-MUGQUNPY.js";
|
|
38
38
|
import "../chunk-WHB622LP.js";
|
|
39
|
-
import "../chunk-
|
|
40
|
-
import "../chunk-
|
|
41
|
-
import "../chunk-
|
|
39
|
+
import "../chunk-WHRLUSI3.js";
|
|
40
|
+
import "../chunk-LS6MIVVS.js";
|
|
41
|
+
import "../chunk-MBAWDULS.js";
|
|
42
42
|
import {
|
|
43
43
|
DEFAULT_SESSION,
|
|
44
44
|
fetchModeState,
|
|
@@ -50,7 +50,7 @@ import {
|
|
|
50
50
|
handleUserPrompt,
|
|
51
51
|
policyRequestFor,
|
|
52
52
|
readLastPrompt
|
|
53
|
-
} from "../chunk-
|
|
53
|
+
} from "../chunk-QRPW7KDH.js";
|
|
54
54
|
import {
|
|
55
55
|
HOOK_FALLBACK_MAX,
|
|
56
56
|
OPENCODE_TOOL_NAMES,
|
|
@@ -60,17 +60,17 @@ import {
|
|
|
60
60
|
deriveToolTarget,
|
|
61
61
|
describeToolCall,
|
|
62
62
|
scopePathFor
|
|
63
|
-
} from "../chunk-
|
|
64
|
-
import "../chunk-
|
|
65
|
-
import "../chunk-
|
|
63
|
+
} from "../chunk-EXVUFDLL.js";
|
|
64
|
+
import "../chunk-COFH3FQT.js";
|
|
65
|
+
import "../chunk-4ZV734EY.js";
|
|
66
66
|
import "../chunk-YPY4YCIZ.js";
|
|
67
|
-
import "../chunk-
|
|
67
|
+
import "../chunk-BS5YSLXS.js";
|
|
68
68
|
import "../chunk-352FIVVH.js";
|
|
69
|
-
import "../chunk-
|
|
69
|
+
import "../chunk-QOKW2NVQ.js";
|
|
70
70
|
import "../chunk-Y6ILCLKE.js";
|
|
71
71
|
import {
|
|
72
72
|
repoKeyFor
|
|
73
|
-
} from "../chunk-
|
|
73
|
+
} from "../chunk-WOAHDWWF.js";
|
|
74
74
|
import {
|
|
75
75
|
askingProcessWaits,
|
|
76
76
|
cancelQuestion,
|
|
@@ -78,31 +78,31 @@ import {
|
|
|
78
78
|
isDecisionStopped,
|
|
79
79
|
isQuestionLimitRefusal,
|
|
80
80
|
sendNotification
|
|
81
|
-
} from "../chunk-
|
|
82
|
-
import "../chunk-
|
|
81
|
+
} from "../chunk-6XKJVF2A.js";
|
|
82
|
+
import "../chunk-GY3BDYVF.js";
|
|
83
83
|
import "../chunk-POFBE6ZY.js";
|
|
84
84
|
import {
|
|
85
85
|
SubscriptionRequiredError
|
|
86
|
-
} from "../chunk-
|
|
87
|
-
import "../chunk-
|
|
88
|
-
import "../chunk-
|
|
89
|
-
import "../chunk-
|
|
86
|
+
} from "../chunk-7RGPAEEL.js";
|
|
87
|
+
import "../chunk-3SGXZHV5.js";
|
|
88
|
+
import "../chunk-DJOAYJYR.js";
|
|
89
|
+
import "../chunk-GVPOVNRT.js";
|
|
90
90
|
import {
|
|
91
91
|
getMachineId
|
|
92
|
-
} from "../chunk-
|
|
93
|
-
import "../chunk-
|
|
94
|
-
import "../chunk-
|
|
95
|
-
import "../chunk-
|
|
96
|
-
import "../chunk-
|
|
92
|
+
} from "../chunk-W2EOPCHG.js";
|
|
93
|
+
import "../chunk-YLV5J6QF.js";
|
|
94
|
+
import "../chunk-TAD24RFF.js";
|
|
95
|
+
import "../chunk-TF46WWVU.js";
|
|
96
|
+
import "../chunk-FXV6MD35.js";
|
|
97
97
|
import {
|
|
98
98
|
getApiKey
|
|
99
|
-
} from "../chunk-
|
|
99
|
+
} from "../chunk-XOTBVRIH.js";
|
|
100
100
|
import "../chunk-YU2EUD7O.js";
|
|
101
101
|
import "../chunk-TODDEIYG.js";
|
|
102
102
|
import {
|
|
103
103
|
EXIT
|
|
104
104
|
} from "../chunk-BG4HHB7E.js";
|
|
105
|
-
import "../chunk-
|
|
105
|
+
import "../chunk-N7VOAIFG.js";
|
|
106
106
|
import "../chunk-UQTQ6HPO.js";
|
|
107
107
|
import {
|
|
108
108
|
AGENT_QUESTION_DESCRIPTION_MAX,
|
|
@@ -113,10 +113,12 @@ import {
|
|
|
113
113
|
DECISION_STOP_REASON,
|
|
114
114
|
HOOK_BUDGETS,
|
|
115
115
|
KILL_REASON,
|
|
116
|
+
MAX_AGENT_QUESTIONS,
|
|
116
117
|
OPENCODE_APPROVAL_EVENT,
|
|
117
118
|
UNVERIFIABLE_APPROVAL_REASON,
|
|
118
119
|
denyReasonFrom,
|
|
119
120
|
effectiveWaitSeconds,
|
|
121
|
+
fitsAPlainSelect,
|
|
120
122
|
gateOutputFor,
|
|
121
123
|
hookMaxWaitSeconds,
|
|
122
124
|
isAgentQuestionSet,
|
|
@@ -128,7 +130,7 @@ import {
|
|
|
128
130
|
resolveGate,
|
|
129
131
|
standingDenyOfSubagentAlias,
|
|
130
132
|
unapprovedScopeReason
|
|
131
|
-
} from "../chunk-
|
|
133
|
+
} from "../chunk-AYQNGBZC.js";
|
|
132
134
|
import "../chunk-MLKGABMK.js";
|
|
133
135
|
|
|
134
136
|
// bin/pushary-opencode-hook.ts
|
|
@@ -188,20 +190,13 @@ var fieldShapeOf = (field) => {
|
|
|
188
190
|
}
|
|
189
191
|
};
|
|
190
192
|
var labelValues = (options) => new Map(options.map((option) => [option.label, option.value]));
|
|
191
|
-
var
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
return { key: field.key, field };
|
|
197
|
-
};
|
|
198
|
-
var openCodeQuestionOf = (form) => {
|
|
199
|
-
if (!isRecord(form)) return null;
|
|
200
|
-
const only = onlyFieldOf(form);
|
|
201
|
-
if (!only) return null;
|
|
202
|
-
const { key, field } = only;
|
|
193
|
+
var formFieldsOf = (form) => Array.isArray(form.fields) ? form.fields : [];
|
|
194
|
+
var isVisibleField = (field) => isRecord(field) && field.hidden !== true;
|
|
195
|
+
var isAskableField = (field) => isVisibleField(field) && typeof field.key === "string" && field.key.length > 0 && field.when === void 0;
|
|
196
|
+
var thePhoneCanAsk = (question) => isAgentQuestionSet([question]) || fitsAPlainSelect(question);
|
|
197
|
+
var phoneQuestionOf = (field, formTitle) => {
|
|
203
198
|
const shape = fieldShapeOf(field);
|
|
204
|
-
const text = questionTextOf(field,
|
|
199
|
+
const text = questionTextOf(field, formTitle);
|
|
205
200
|
if (!shape || !text) return null;
|
|
206
201
|
const header = headerOf(field, text);
|
|
207
202
|
const question = {
|
|
@@ -212,8 +207,26 @@ var openCodeQuestionOf = (form) => {
|
|
|
212
207
|
options: shape.options.map(phoneOptionOf)
|
|
213
208
|
};
|
|
214
209
|
const valueOfLabel = labelValues(shape.options);
|
|
215
|
-
if (valueOfLabel.size !== shape.options.length || !
|
|
216
|
-
return { fieldKey: key, kind: shape.kind, question, valueOfLabel };
|
|
210
|
+
if (valueOfLabel.size !== shape.options.length || !thePhoneCanAsk(question)) return null;
|
|
211
|
+
return { fieldKey: field.key, kind: shape.kind, question, valueOfLabel };
|
|
212
|
+
};
|
|
213
|
+
var isPhoneQuestion = (question) => question !== null;
|
|
214
|
+
var asksEachQuestionOnce = (fields) => new Set(fields.map((field) => field.question.question)).size === fields.length && new Set(fields.map((field) => field.fieldKey)).size === fields.length;
|
|
215
|
+
var openCodeQuestionFormOf = (form) => {
|
|
216
|
+
if (!isRecord(form)) return null;
|
|
217
|
+
const fields = formFieldsOf(form);
|
|
218
|
+
if (fields.length === 0 || fields.length > MAX_AGENT_QUESTIONS || !fields.every(isAskableField)) return null;
|
|
219
|
+
const formTitle = textOf(form.title);
|
|
220
|
+
const asked = fields.map((field) => phoneQuestionOf(field, formTitle));
|
|
221
|
+
if (!asked.every(isPhoneQuestion) || !asksEachQuestionOnce(asked)) return null;
|
|
222
|
+
return { fields: asked };
|
|
223
|
+
};
|
|
224
|
+
var openCodeQuestionNoticeOf = (form) => {
|
|
225
|
+
if (!isRecord(form)) return null;
|
|
226
|
+
const fields = formFieldsOf(form).filter(isVisibleField);
|
|
227
|
+
const formTitle = textOf(form.title);
|
|
228
|
+
const question = fields.map((field) => questionTextOf(field, formTitle)).find((text) => text !== void 0);
|
|
229
|
+
return question ? { question, questionCount: fields.length } : null;
|
|
217
230
|
};
|
|
218
231
|
var pickedLabelsOf = (answer) => {
|
|
219
232
|
try {
|
|
@@ -253,6 +266,12 @@ var openCodeFormAnswerOf = (asked, answers) => {
|
|
|
253
266
|
const value = formValueOf(asked, answer);
|
|
254
267
|
return value === null ? null : { [asked.fieldKey]: value };
|
|
255
268
|
};
|
|
269
|
+
var isFormAnswer = (answer) => answer !== null;
|
|
270
|
+
var openCodeFormAnswersOf = (asked, answers) => {
|
|
271
|
+
const perField = asked.fields.map((field) => openCodeFormAnswerOf(field, answers));
|
|
272
|
+
if (!perField.every(isFormAnswer)) return null;
|
|
273
|
+
return perField.reduce((all, answer) => ({ ...all, ...answer }), {});
|
|
274
|
+
};
|
|
256
275
|
|
|
257
276
|
// src/opencode-adapter.ts
|
|
258
277
|
var OPENCODE_AGENT = { type: "opencode", label: "OpenCode" };
|
|
@@ -288,7 +307,7 @@ var openCodeQuestionAnswered = (answer) => answer ? { kind: "answered", answer }
|
|
|
288
307
|
var openCodeQuestionDecisionOf = (asked, outcome) => {
|
|
289
308
|
switch (outcome.kind) {
|
|
290
309
|
case "answered":
|
|
291
|
-
return openCodeQuestionAnswered(
|
|
310
|
+
return openCodeQuestionAnswered(openCodeFormAnswersOf(asked, outcome.answers));
|
|
292
311
|
case "stopped":
|
|
293
312
|
return openCodeQuestionCancel(DECISION_STOP_REASON);
|
|
294
313
|
case "unavailable":
|
|
@@ -481,7 +500,8 @@ var decidePermission = async (input) => {
|
|
|
481
500
|
}
|
|
482
501
|
};
|
|
483
502
|
var OPENCODE_QUESTION_NOTIFY_TITLE = "Agent has a question";
|
|
484
|
-
var questionToolInput = (asked) => ({ questions:
|
|
503
|
+
var questionToolInput = (asked) => ({ questions: asked.fields.map((field) => field.question) });
|
|
504
|
+
var noticeToolInput = (notice) => ({ questions: notice ? [{ question: notice.question, multiSelect: false, options: [] }] : [] });
|
|
485
505
|
var recordKeylessQuestion = (input) => {
|
|
486
506
|
try {
|
|
487
507
|
recordKeylessMoment({
|
|
@@ -493,11 +513,15 @@ var recordKeylessQuestion = (input) => {
|
|
|
493
513
|
} catch {
|
|
494
514
|
}
|
|
495
515
|
};
|
|
496
|
-
var
|
|
516
|
+
var shownQuestionOf = (notice) => redactSecrets(notice.question).trim().slice(0, HOOK_FALLBACK_MAX);
|
|
517
|
+
var SENTENCE_END = /[.?!]$/;
|
|
518
|
+
var asSentence = (text) => SENTENCE_END.test(text) ? text : `${text}.`;
|
|
519
|
+
var shownQuestionsOf = (notice) => notice.questionCount > 1 ? `${notice.questionCount} questions, starting with: ${asSentence(shownQuestionOf(notice))}` : shownQuestionOf(notice);
|
|
520
|
+
var notifyQuestion = async (apiKey, input, notice) => {
|
|
497
521
|
try {
|
|
498
522
|
await sendNotification(apiKey, {
|
|
499
523
|
title: OPENCODE_QUESTION_NOTIFY_TITLE,
|
|
500
|
-
body:
|
|
524
|
+
body: shownQuestionsOf(notice),
|
|
501
525
|
agentName: agentNameFor(input),
|
|
502
526
|
sessionId: input.session_id,
|
|
503
527
|
machineId: getMachineId()
|
|
@@ -507,6 +531,8 @@ var notifyQuestion = async (apiKey, input, asked) => {
|
|
|
507
531
|
};
|
|
508
532
|
var ASKING_PROCESS = process.ppid;
|
|
509
533
|
var openCodeStillAsks = () => askingProcessWaits(ASKING_PROCESS, process.ppid, launcherIsGone);
|
|
534
|
+
var formStillOpenInOpenCode = () => !withdrawn && openCodeStillAsks();
|
|
535
|
+
var NOT_ASKED = { kind: "unanswered" };
|
|
510
536
|
var killIsOn = async (apiKey, sessionId) => {
|
|
511
537
|
try {
|
|
512
538
|
return (await fetchModeState(apiKey, sessionId)).kill === true;
|
|
@@ -515,7 +541,7 @@ var killIsOn = async (apiKey, sessionId) => {
|
|
|
515
541
|
}
|
|
516
542
|
};
|
|
517
543
|
var endedWithoutTheirAnswer = (outcome) => outcome.kind === "unanswered" || outcome.kind === "unavailable";
|
|
518
|
-
var
|
|
544
|
+
var askFieldOnThePhone = async (apiKey, input, field, position) => {
|
|
519
545
|
let questionCreated = () => {
|
|
520
546
|
};
|
|
521
547
|
questionBeingAsked = { apiKey, created: new Promise((resolve) => {
|
|
@@ -531,22 +557,38 @@ var askQuestionOnThePhone = async (apiKey, input, asked) => {
|
|
|
531
557
|
outstanding = { apiKey, correlationId };
|
|
532
558
|
questionCreated(correlationId);
|
|
533
559
|
}
|
|
534
|
-
},
|
|
560
|
+
}, field.question, formStillOpenInOpenCode, position);
|
|
535
561
|
questionCreated(null);
|
|
536
562
|
questionBeingAsked = void 0;
|
|
537
563
|
outstanding = void 0;
|
|
564
|
+
return outcome;
|
|
565
|
+
};
|
|
566
|
+
var askFormOnThePhone = async (apiKey, input, asked) => {
|
|
567
|
+
let answers = {};
|
|
568
|
+
for (const [index, field] of asked.fields.entries()) {
|
|
569
|
+
if (!formStillOpenInOpenCode()) return NOT_ASKED;
|
|
570
|
+
const outcome = await askFieldOnThePhone(apiKey, input, field, { index, total: asked.fields.length });
|
|
571
|
+
if (outcome.kind !== "answered") return outcome;
|
|
572
|
+
answers = { ...answers, ...outcome.answers };
|
|
573
|
+
}
|
|
574
|
+
return { kind: "answered", answers };
|
|
575
|
+
};
|
|
576
|
+
var askQuestionOnThePhone = async (apiKey, input, asked) => {
|
|
577
|
+
const outcome = await askFormOnThePhone(apiKey, input, asked);
|
|
538
578
|
if (endedWithoutTheirAnswer(outcome) && await killIsOn(apiKey, input.session_id)) return openCodeQuestionCancel(KILL_REASON);
|
|
539
|
-
|
|
579
|
+
const decision = openCodeQuestionDecisionOf(asked, outcome);
|
|
580
|
+
if (outcome.kind === "answered" && decision.kind === "pass") await notifyUndeliveredAnswer(input);
|
|
581
|
+
return decision;
|
|
540
582
|
};
|
|
541
583
|
var OPENCODE_ANSWER_UNDELIVERED_TITLE = "Answer this in OpenCode";
|
|
542
584
|
var OPENCODE_ANSWER_UNDELIVERED_NOTE = "OpenCode did not take the answer from your phone.";
|
|
543
585
|
var notifyUndeliveredAnswer = async (input) => {
|
|
544
|
-
const
|
|
545
|
-
if (!
|
|
586
|
+
const notice = openCodeQuestionNoticeOf(input.form);
|
|
587
|
+
if (!notice) return;
|
|
546
588
|
try {
|
|
547
589
|
await sendNotification(getApiKey(), {
|
|
548
590
|
title: OPENCODE_ANSWER_UNDELIVERED_TITLE,
|
|
549
|
-
body: `${
|
|
591
|
+
body: `${asSentence(shownQuestionsOf(notice))} ${OPENCODE_ANSWER_UNDELIVERED_NOTE}`,
|
|
550
592
|
agentName: agentNameFor(input),
|
|
551
593
|
sessionId: input.session_id,
|
|
552
594
|
machineId: getMachineId()
|
|
@@ -554,7 +596,7 @@ var notifyUndeliveredAnswer = async (input) => {
|
|
|
554
596
|
} catch {
|
|
555
597
|
}
|
|
556
598
|
};
|
|
557
|
-
var questionGateOf = async (apiKey, input,
|
|
599
|
+
var questionGateOf = async (apiKey, input, toolInput) => {
|
|
558
600
|
const modeState = await fetchModeState(apiKey, input.session_id);
|
|
559
601
|
const policyRequest = policyRequestFor(OPENCODE_AGENT.type);
|
|
560
602
|
const config = await getPolicy(
|
|
@@ -564,7 +606,6 @@ var questionGateOf = async (apiKey, input, asked) => {
|
|
|
564
606
|
policyRequest.repoAware,
|
|
565
607
|
input.session_id
|
|
566
608
|
);
|
|
567
|
-
const toolInput = questionToolInput(asked);
|
|
568
609
|
const verdict = resolveGate({
|
|
569
610
|
modeState,
|
|
570
611
|
config,
|
|
@@ -575,22 +616,16 @@ var questionGateOf = async (apiKey, input, asked) => {
|
|
|
575
616
|
repoKey: repoKeyFor(input.cwd),
|
|
576
617
|
sessionId: input.session_id
|
|
577
618
|
});
|
|
578
|
-
return { modeState,
|
|
619
|
+
return { modeState, verdict };
|
|
579
620
|
};
|
|
580
621
|
var questionReachesThePerson = (verdict, modeState) => verdict.kind === "gate" && !questionHandedToTheTerminal(AGENT_QUESTION_TOOL, modeState) && verdict.policy.mode !== "terminal_only";
|
|
581
622
|
var OPENCODE_QUESTION_UNREACHABLE_TITLE = "OpenCode is asking";
|
|
582
|
-
var
|
|
583
|
-
var
|
|
584
|
-
var notifyUnreachableQuestion = async (input) => {
|
|
585
|
-
const asked = openCodeQuestionOf(input.form);
|
|
586
|
-
if (!asked) return;
|
|
623
|
+
var answerInOpenCodeBodyOf = (notice) => notice.questionCount > 1 ? `OpenCode is asking ${notice.questionCount} questions, starting with: ${asSentence(shownQuestionOf(notice))} Answer them in OpenCode.` : `OpenCode is asking: ${asSentence(shownQuestionOf(notice))} Answer it in OpenCode.`;
|
|
624
|
+
var tellThePhoneToAnswerInOpenCode = async (apiKey, input, notice) => {
|
|
587
625
|
try {
|
|
588
|
-
const apiKey = getApiKey();
|
|
589
|
-
const { modeState, verdict } = await questionGateOf(apiKey, input, asked);
|
|
590
|
-
if (!questionReachesThePerson(verdict, modeState)) return;
|
|
591
626
|
await sendNotification(apiKey, {
|
|
592
627
|
title: OPENCODE_QUESTION_UNREACHABLE_TITLE,
|
|
593
|
-
body:
|
|
628
|
+
body: answerInOpenCodeBodyOf(notice),
|
|
594
629
|
agentName: agentNameFor(input),
|
|
595
630
|
sessionId: input.session_id,
|
|
596
631
|
machineId: getMachineId()
|
|
@@ -598,9 +633,20 @@ var notifyUnreachableQuestion = async (input) => {
|
|
|
598
633
|
} catch {
|
|
599
634
|
}
|
|
600
635
|
};
|
|
636
|
+
var notifyUnreachableQuestion = async (input) => {
|
|
637
|
+
const notice = openCodeQuestionNoticeOf(input.form);
|
|
638
|
+
if (!notice) return;
|
|
639
|
+
try {
|
|
640
|
+
const apiKey = getApiKey();
|
|
641
|
+
const { modeState, verdict } = await questionGateOf(apiKey, input, noticeToolInput(notice));
|
|
642
|
+
if (!questionReachesThePerson(verdict, modeState)) return;
|
|
643
|
+
await tellThePhoneToAnswerInOpenCode(apiKey, input, notice);
|
|
644
|
+
} catch {
|
|
645
|
+
}
|
|
646
|
+
};
|
|
601
647
|
var decideQuestion = async (input) => {
|
|
602
|
-
const
|
|
603
|
-
|
|
648
|
+
const notice = openCodeQuestionNoticeOf(input.form);
|
|
649
|
+
const asked = openCodeQuestionFormOf(input.form);
|
|
604
650
|
let apiKey;
|
|
605
651
|
try {
|
|
606
652
|
apiKey = getApiKey();
|
|
@@ -609,7 +655,8 @@ var decideQuestion = async (input) => {
|
|
|
609
655
|
return openCodeQuestionPass();
|
|
610
656
|
}
|
|
611
657
|
try {
|
|
612
|
-
const
|
|
658
|
+
const toolInput = asked ? questionToolInput(asked) : noticeToolInput(notice);
|
|
659
|
+
const { modeState, verdict } = await questionGateOf(apiKey, input, toolInput);
|
|
613
660
|
if (verdict.kind === "kill" || verdict.kind === "deny") {
|
|
614
661
|
await reportMachineDenial({ ...input, tool_name: AGENT_QUESTION_TOOL, tool_input: toolInput }, verdict, OPENCODE_AGENT);
|
|
615
662
|
return openCodeQuestionCancel(verdict.kind === "kill" ? KILL_REASON : verdict.reason);
|
|
@@ -619,10 +666,12 @@ var decideQuestion = async (input) => {
|
|
|
619
666
|
case "terminal_only":
|
|
620
667
|
return openCodeQuestionPass();
|
|
621
668
|
case "notify_only":
|
|
622
|
-
await notifyQuestion(apiKey, input,
|
|
669
|
+
if (notice) await notifyQuestion(apiKey, input, notice);
|
|
623
670
|
return openCodeQuestionPass();
|
|
624
671
|
default:
|
|
625
|
-
return await askQuestionOnThePhone(apiKey, input, asked);
|
|
672
|
+
if (asked) return await askQuestionOnThePhone(apiKey, input, asked);
|
|
673
|
+
if (notice) await tellThePhoneToAnswerInOpenCode(apiKey, input, notice);
|
|
674
|
+
return openCodeQuestionPass();
|
|
626
675
|
}
|
|
627
676
|
} catch {
|
|
628
677
|
return openCodeQuestionPass();
|
|
@@ -1,55 +1,55 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
handlePermissionDenied
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-FIQFGSXB.js";
|
|
5
|
+
import "../chunk-IHZ7MUYB.js";
|
|
6
|
+
import "../chunk-VXSAB3ZE.js";
|
|
7
7
|
import {
|
|
8
8
|
takeHookHoldBudget
|
|
9
|
-
} from "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
9
|
+
} from "../chunk-3WW4TQT2.js";
|
|
10
|
+
import "../chunk-3HDZQKAK.js";
|
|
11
|
+
import "../chunk-ZLWAN47L.js";
|
|
12
|
+
import "../chunk-FRT6CTUK.js";
|
|
13
|
+
import "../chunk-LEWUIP5P.js";
|
|
14
14
|
import {
|
|
15
15
|
readHookInput
|
|
16
|
-
} from "../chunk-
|
|
17
|
-
import "../chunk-
|
|
18
|
-
import "../chunk-
|
|
19
|
-
import "../chunk-
|
|
16
|
+
} from "../chunk-KU7DUO5E.js";
|
|
17
|
+
import "../chunk-QNHUMOCQ.js";
|
|
18
|
+
import "../chunk-JDY2FFC3.js";
|
|
19
|
+
import "../chunk-MUGQUNPY.js";
|
|
20
20
|
import "../chunk-WHB622LP.js";
|
|
21
|
-
import "../chunk-
|
|
22
|
-
import "../chunk-
|
|
23
|
-
import "../chunk-
|
|
24
|
-
import "../chunk-
|
|
25
|
-
import "../chunk-
|
|
26
|
-
import "../chunk-
|
|
27
|
-
import "../chunk-
|
|
21
|
+
import "../chunk-WHRLUSI3.js";
|
|
22
|
+
import "../chunk-LS6MIVVS.js";
|
|
23
|
+
import "../chunk-MBAWDULS.js";
|
|
24
|
+
import "../chunk-QRPW7KDH.js";
|
|
25
|
+
import "../chunk-EXVUFDLL.js";
|
|
26
|
+
import "../chunk-COFH3FQT.js";
|
|
27
|
+
import "../chunk-4ZV734EY.js";
|
|
28
28
|
import "../chunk-YPY4YCIZ.js";
|
|
29
|
-
import "../chunk-
|
|
29
|
+
import "../chunk-BS5YSLXS.js";
|
|
30
30
|
import "../chunk-352FIVVH.js";
|
|
31
|
-
import "../chunk-
|
|
31
|
+
import "../chunk-QOKW2NVQ.js";
|
|
32
32
|
import "../chunk-Y6ILCLKE.js";
|
|
33
|
-
import "../chunk-
|
|
34
|
-
import "../chunk-
|
|
35
|
-
import "../chunk-
|
|
33
|
+
import "../chunk-WOAHDWWF.js";
|
|
34
|
+
import "../chunk-6XKJVF2A.js";
|
|
35
|
+
import "../chunk-GY3BDYVF.js";
|
|
36
36
|
import "../chunk-POFBE6ZY.js";
|
|
37
|
-
import "../chunk-
|
|
38
|
-
import "../chunk-
|
|
39
|
-
import "../chunk-
|
|
40
|
-
import "../chunk-
|
|
41
|
-
import "../chunk-
|
|
42
|
-
import "../chunk-
|
|
43
|
-
import "../chunk-
|
|
44
|
-
import "../chunk-
|
|
45
|
-
import "../chunk-
|
|
46
|
-
import "../chunk-
|
|
37
|
+
import "../chunk-7RGPAEEL.js";
|
|
38
|
+
import "../chunk-3SGXZHV5.js";
|
|
39
|
+
import "../chunk-DJOAYJYR.js";
|
|
40
|
+
import "../chunk-GVPOVNRT.js";
|
|
41
|
+
import "../chunk-W2EOPCHG.js";
|
|
42
|
+
import "../chunk-YLV5J6QF.js";
|
|
43
|
+
import "../chunk-TAD24RFF.js";
|
|
44
|
+
import "../chunk-TF46WWVU.js";
|
|
45
|
+
import "../chunk-FXV6MD35.js";
|
|
46
|
+
import "../chunk-XOTBVRIH.js";
|
|
47
47
|
import "../chunk-YU2EUD7O.js";
|
|
48
48
|
import "../chunk-TODDEIYG.js";
|
|
49
49
|
import "../chunk-BG4HHB7E.js";
|
|
50
|
-
import "../chunk-
|
|
50
|
+
import "../chunk-N7VOAIFG.js";
|
|
51
51
|
import "../chunk-UQTQ6HPO.js";
|
|
52
|
-
import "../chunk-
|
|
52
|
+
import "../chunk-AYQNGBZC.js";
|
|
53
53
|
import "../chunk-MLKGABMK.js";
|
|
54
54
|
|
|
55
55
|
// bin/pushary-permission-denied-hook.ts
|