@pushary/agent-hooks 1.6.0 → 1.6.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/CHANGELOG.md +5 -0
- package/dist/bin/pushary-bell-hook.js +18 -18
- package/dist/bin/pushary-bell.js +6 -6
- package/dist/bin/pushary-claude.js +19 -19
- package/dist/bin/pushary-clean.js +20 -20
- package/dist/bin/pushary-codex-bridge.js +95 -20
- package/dist/bin/pushary-codex-hook.js +24 -24
- package/dist/bin/pushary-codex.js +7 -7
- package/dist/bin/pushary-connect.js +6 -6
- package/dist/bin/pushary-cowork.js +3 -3
- package/dist/bin/pushary-daemon.js +23 -23
- package/dist/bin/pushary-disconnect.js +11 -11
- package/dist/bin/pushary-doctor.js +23 -23
- package/dist/bin/pushary-elicitation-hook.js +18 -18
- package/dist/bin/pushary-gemini-bridge.js +9 -9
- package/dist/bin/pushary-gemini-hook.js +21 -21
- package/dist/bin/pushary-hook.js +24 -24
- package/dist/bin/pushary-login.js +7 -7
- package/dist/bin/pushary-logout.js +4 -4
- package/dist/bin/pushary-mode.js +3 -3
- package/dist/bin/pushary-notification-hook.js +21 -21
- package/dist/bin/pushary-opencode-hook.js +20 -20
- package/dist/bin/pushary-permission-denied-hook.js +25 -25
- package/dist/bin/pushary-permission-hook.js +24 -24
- package/dist/bin/pushary-post-hook.js +21 -21
- package/dist/bin/pushary-prompt-hook.js +21 -21
- package/dist/bin/pushary-session-end-hook.js +21 -21
- package/dist/bin/pushary-session-start-hook.js +25 -25
- package/dist/bin/pushary-setup.js +29 -30
- package/dist/bin/pushary-stats.js +2 -2
- package/dist/bin/pushary-status.js +10 -10
- package/dist/bin/pushary-stop-hook.js +21 -21
- package/dist/bin/pushary-stopfailure-hook.js +21 -21
- package/dist/bin/pushary-transcript-register.js +16 -16
- package/dist/bin/pushary-transcripts.js +4 -4
- package/dist/bin/pushary-upgrade.js +16 -16
- package/dist/bin/pushary-wait.js +3 -3
- package/dist/{chunk-DZ75BJ7V.js → chunk-2PHHXWA4.js} +3 -3
- package/dist/{chunk-ALG3IBLB.js → chunk-3ROHFC7Q.js} +1 -1
- package/dist/{chunk-BK5F3FGE.js → chunk-3TKMWW34.js} +3 -3
- package/dist/{chunk-XQOT4CCK.js → chunk-45BA4RL6.js} +1 -1
- package/dist/{chunk-B6TYEKJR.js → chunk-5NDOV3UU.js} +1 -1
- package/dist/{chunk-NDS27FXU.js → chunk-5TRIYAHM.js} +1 -1
- package/dist/{chunk-5QCZYSYR.js → chunk-7H4HD2WR.js} +1 -1
- package/dist/{chunk-F4KRNFDE.js → chunk-7WRJFRNF.js} +1 -1
- package/dist/{chunk-NYD7W7AT.js → chunk-7XGW7IKI.js} +1 -1
- package/dist/{chunk-G5LENVCZ.js → chunk-B75OQ2E7.js} +3 -3
- package/dist/{chunk-OR3A3RLH.js → chunk-CATEMFAP.js} +1 -1
- package/dist/{chunk-OP7HFIWE.js → chunk-CNJWNFBL.js} +6 -6
- package/dist/{chunk-PCVVCS4A.js → chunk-DACRA27R.js} +1 -1
- package/dist/{chunk-5MH5P366.js → chunk-GE64YOTX.js} +2 -2
- package/dist/{chunk-GOXINLDU.js → chunk-GOQC7R3F.js} +1 -1
- package/dist/{chunk-VMNI33F5.js → chunk-IEXXFXSP.js} +1 -1
- package/dist/{chunk-KZBGITM4.js → chunk-J7X5YVTP.js} +4 -4
- package/dist/{chunk-PRZXYILJ.js → chunk-K5BPU3RG.js} +2 -2
- package/dist/{chunk-F2OPOBRO.js → chunk-L2FPZQQM.js} +1 -1
- package/dist/{chunk-A2GS2ENL.js → chunk-LNMHLXNR.js} +6 -6
- package/dist/{chunk-PYCQXCI5.js → chunk-LVHGSD5E.js} +2 -0
- package/dist/{chunk-A5URWZTP.js → chunk-MK7ZJ2JN.js} +1 -1
- package/dist/{chunk-VZANUMIF.js → chunk-MR2GHF3F.js} +1 -1
- package/dist/{chunk-CSW6A2EW.js → chunk-MZCYOUBR.js} +1 -1
- package/dist/{chunk-YFD7CRIZ.js → chunk-NTTMJFJU.js} +7 -3
- package/dist/{chunk-MOQOJOMD.js → chunk-NYFBIXA7.js} +3 -3
- package/dist/{chunk-RBPJO4KG.js → chunk-O6MHM25J.js} +1 -1
- package/dist/{chunk-TDKE3V6W.js → chunk-OLD4YGZR.js} +1 -1
- package/dist/{chunk-E7MJBWSR.js → chunk-PWQHK3F7.js} +1 -1
- package/dist/{chunk-66BIMA62.js → chunk-ROCRCXTP.js} +6 -6
- package/dist/{chunk-FDF72XHK.js → chunk-TPD6LCQI.js} +2 -2
- package/dist/{chunk-644CGYOB.js → chunk-UJ4O22GU.js} +7 -7
- package/dist/{chunk-HWG7X3VI.js → chunk-UMVM4HVV.js} +3 -3
- package/dist/{chunk-GDXSCXQC.js → chunk-VT5TVFM3.js} +1 -1
- package/dist/{chunk-SFNRAEEW.js → chunk-VT63XWPR.js} +1 -1
- package/dist/{chunk-XGL5JC6U.js → chunk-W5JUN4TF.js} +2 -2
- package/dist/{chunk-GP6SFVEN.js → chunk-WBWF7WU7.js} +1 -1
- package/dist/{chunk-7JSE6JTZ.js → chunk-WHOD4YGB.js} +1 -1
- package/dist/{chunk-FI3LQCUH.js → chunk-X4G4MQEV.js} +5 -5
- package/dist/{chunk-BW3Y2D24.js → chunk-XTXCQ4QE.js} +4 -4
- package/dist/{chunk-BE4P7ERZ.js → chunk-ZR4NP264.js} +3 -3
- package/dist/{reapply-RRDVJATI.js → reapply-GGHT2YJX.js} +9 -9
- package/dist/src/index.js +13 -13
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.6.1
|
|
4
|
+
|
|
5
|
+
- Pushary-launched Codex sessions can answer supported questions from inside MCP tools through Pushary. Invalid answers and cancelled requests never become approval. This does not connect existing Codex Desktop Computer Use permission dialogs.
|
|
6
|
+
- Claude forms with rules Pushary cannot preserve now stay in the native client instead of silently losing those rules.
|
|
7
|
+
|
|
3
8
|
## 1.6.0
|
|
4
9
|
|
|
5
10
|
- Pushary no longer asks about a Claude Code command your own Claude Code allow rules already cover when only a Pushary default would have asked. Risky commands still ask: destructive, network and data-loss commands, and anything whose effect cannot be read from its text, such as `bash -c`, inline interpreter code, `xargs` or a `#` comment. If Claude Code prompts anyway, the approval still reaches your phone.
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
handleBell
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-PWQHK3F7.js";
|
|
5
5
|
import {
|
|
6
6
|
readHookInput
|
|
7
|
-
} from "../chunk-
|
|
8
|
-
import "../chunk-
|
|
7
|
+
} from "../chunk-TPD6LCQI.js";
|
|
8
|
+
import "../chunk-LNMHLXNR.js";
|
|
9
9
|
import "../chunk-SGZJ5LYH.js";
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
14
|
-
import "../chunk-
|
|
15
|
-
import "../chunk-
|
|
16
|
-
import "../chunk-
|
|
17
|
-
import "../chunk-
|
|
10
|
+
import "../chunk-J7X5YVTP.js";
|
|
11
|
+
import "../chunk-MK7ZJ2JN.js";
|
|
12
|
+
import "../chunk-VT5TVFM3.js";
|
|
13
|
+
import "../chunk-NYFBIXA7.js";
|
|
14
|
+
import "../chunk-2PHHXWA4.js";
|
|
15
|
+
import "../chunk-3TKMWW34.js";
|
|
16
|
+
import "../chunk-CATEMFAP.js";
|
|
17
|
+
import "../chunk-VT63XWPR.js";
|
|
18
18
|
import "../chunk-66H2QQAK.js";
|
|
19
|
-
import "../chunk-
|
|
19
|
+
import "../chunk-WBWF7WU7.js";
|
|
20
20
|
import "../chunk-XHKBHWLX.js";
|
|
21
|
-
import "../chunk-
|
|
22
|
-
import "../chunk-
|
|
23
|
-
import "../chunk-
|
|
21
|
+
import "../chunk-MR2GHF3F.js";
|
|
22
|
+
import "../chunk-WHOD4YGB.js";
|
|
23
|
+
import "../chunk-L2FPZQQM.js";
|
|
24
24
|
import "../chunk-GMXKITVA.js";
|
|
25
|
-
import "../chunk-
|
|
25
|
+
import "../chunk-OLD4YGZR.js";
|
|
26
26
|
import "../chunk-7QLSKOSU.js";
|
|
27
27
|
import "../chunk-KZERVKTD.js";
|
|
28
|
-
import "../chunk-
|
|
28
|
+
import "../chunk-IEXXFXSP.js";
|
|
29
29
|
import "../chunk-T7E75EKA.js";
|
|
30
30
|
import "../chunk-OSJEMXSR.js";
|
|
31
|
-
import "../chunk-
|
|
31
|
+
import "../chunk-NTTMJFJU.js";
|
|
32
32
|
import "../chunk-EA3IELHP.js";
|
|
33
33
|
import "../chunk-HWJW3CPO.js";
|
|
34
34
|
|
package/dist/bin/pushary-bell.js
CHANGED
|
@@ -5,15 +5,15 @@ import {
|
|
|
5
5
|
liveAgentCount,
|
|
6
6
|
ring,
|
|
7
7
|
upgradeThreshold
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-PWQHK3F7.js";
|
|
9
9
|
import {
|
|
10
10
|
addBellHooks,
|
|
11
11
|
bellInstalled,
|
|
12
12
|
removeBellHooks
|
|
13
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-CATEMFAP.js";
|
|
14
14
|
import {
|
|
15
15
|
claudeSettings
|
|
16
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-L2FPZQQM.js";
|
|
17
17
|
import {
|
|
18
18
|
createIo
|
|
19
19
|
} from "../chunk-5RUIFDTP.js";
|
|
@@ -23,18 +23,18 @@ import {
|
|
|
23
23
|
import {
|
|
24
24
|
parseFlags
|
|
25
25
|
} from "../chunk-GMXKITVA.js";
|
|
26
|
-
import "../chunk-
|
|
26
|
+
import "../chunk-OLD4YGZR.js";
|
|
27
27
|
import "../chunk-7QLSKOSU.js";
|
|
28
28
|
import {
|
|
29
29
|
EXIT
|
|
30
30
|
} from "../chunk-KZERVKTD.js";
|
|
31
|
-
import "../chunk-
|
|
31
|
+
import "../chunk-IEXXFXSP.js";
|
|
32
32
|
import {
|
|
33
33
|
readJsonSafe,
|
|
34
34
|
writeJsonAtomic
|
|
35
35
|
} from "../chunk-T7E75EKA.js";
|
|
36
36
|
import "../chunk-OSJEMXSR.js";
|
|
37
|
-
import "../chunk-
|
|
37
|
+
import "../chunk-NTTMJFJU.js";
|
|
38
38
|
import "../chunk-EA3IELHP.js";
|
|
39
39
|
import "../chunk-HWJW3CPO.js";
|
|
40
40
|
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
describeIdleWindow,
|
|
9
9
|
startProcessOwnership,
|
|
10
10
|
withSpawnProcessOwnership
|
|
11
|
-
} from "../chunk-
|
|
11
|
+
} from "../chunk-3ROHFC7Q.js";
|
|
12
12
|
import {
|
|
13
13
|
isDeferAnswer
|
|
14
14
|
} from "../chunk-YHG74UFF.js";
|
|
@@ -17,24 +17,24 @@ import {
|
|
|
17
17
|
loadSessionKey,
|
|
18
18
|
registerTranscript,
|
|
19
19
|
registeredTranscriptEnabled
|
|
20
|
-
} from "../chunk-
|
|
20
|
+
} from "../chunk-LNMHLXNR.js";
|
|
21
21
|
import "../chunk-SGZJ5LYH.js";
|
|
22
|
-
import "../chunk-
|
|
23
|
-
import "../chunk-
|
|
24
|
-
import "../chunk-
|
|
25
|
-
import "../chunk-
|
|
22
|
+
import "../chunk-J7X5YVTP.js";
|
|
23
|
+
import "../chunk-MK7ZJ2JN.js";
|
|
24
|
+
import "../chunk-VT5TVFM3.js";
|
|
25
|
+
import "../chunk-NYFBIXA7.js";
|
|
26
26
|
import {
|
|
27
27
|
ensureDaemonRunning
|
|
28
|
-
} from "../chunk-
|
|
29
|
-
import "../chunk-
|
|
30
|
-
import "../chunk-
|
|
28
|
+
} from "../chunk-2PHHXWA4.js";
|
|
29
|
+
import "../chunk-3TKMWW34.js";
|
|
30
|
+
import "../chunk-CATEMFAP.js";
|
|
31
31
|
import {
|
|
32
32
|
encryptRecord
|
|
33
|
-
} from "../chunk-
|
|
33
|
+
} from "../chunk-VT63XWPR.js";
|
|
34
34
|
import "../chunk-66H2QQAK.js";
|
|
35
35
|
import {
|
|
36
36
|
transcriptsEnabled
|
|
37
|
-
} from "../chunk-
|
|
37
|
+
} from "../chunk-WBWF7WU7.js";
|
|
38
38
|
import {
|
|
39
39
|
needsShell,
|
|
40
40
|
spawnClaude
|
|
@@ -56,8 +56,8 @@ import {
|
|
|
56
56
|
reportEvent,
|
|
57
57
|
savePendingCommand,
|
|
58
58
|
scopePathFor
|
|
59
|
-
} from "../chunk-
|
|
60
|
-
import "../chunk-
|
|
59
|
+
} from "../chunk-ROCRCXTP.js";
|
|
60
|
+
import "../chunk-MR2GHF3F.js";
|
|
61
61
|
import {
|
|
62
62
|
DECISION_STOP_REASON,
|
|
63
63
|
askUser,
|
|
@@ -67,18 +67,18 @@ import {
|
|
|
67
67
|
nextLongPollMs,
|
|
68
68
|
waitForAnswer,
|
|
69
69
|
withdrawQuestion
|
|
70
|
-
} from "../chunk-
|
|
70
|
+
} from "../chunk-LVHGSD5E.js";
|
|
71
71
|
import {
|
|
72
72
|
getMachineId
|
|
73
|
-
} from "../chunk-
|
|
74
|
-
import "../chunk-
|
|
73
|
+
} from "../chunk-WHOD4YGB.js";
|
|
74
|
+
import "../chunk-L2FPZQQM.js";
|
|
75
75
|
import "../chunk-GMXKITVA.js";
|
|
76
|
-
import "../chunk-
|
|
76
|
+
import "../chunk-OLD4YGZR.js";
|
|
77
77
|
import "../chunk-HETOKNIL.js";
|
|
78
78
|
import "../chunk-SAF6HGAA.js";
|
|
79
79
|
import "../chunk-7QLSKOSU.js";
|
|
80
80
|
import "../chunk-KZERVKTD.js";
|
|
81
|
-
import "../chunk-
|
|
81
|
+
import "../chunk-IEXXFXSP.js";
|
|
82
82
|
import "../chunk-T7E75EKA.js";
|
|
83
83
|
import {
|
|
84
84
|
getApiKey,
|
|
@@ -88,7 +88,7 @@ import {
|
|
|
88
88
|
KILL_REASON,
|
|
89
89
|
redactSecrets,
|
|
90
90
|
resolveGate
|
|
91
|
-
} from "../chunk-
|
|
91
|
+
} from "../chunk-NTTMJFJU.js";
|
|
92
92
|
import {
|
|
93
93
|
NPX_LATEST_COMMAND
|
|
94
94
|
} from "../chunk-EA3IELHP.js";
|
|
@@ -7,14 +7,14 @@ import {
|
|
|
7
7
|
createGuards,
|
|
8
8
|
resolveHermesPython,
|
|
9
9
|
runHermesPythonScript
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-7XGW7IKI.js";
|
|
11
11
|
import "../chunk-P32LPT2L.js";
|
|
12
12
|
import {
|
|
13
13
|
removeInstructionBlock,
|
|
14
14
|
shortenHome,
|
|
15
15
|
unregisterPluginLocation,
|
|
16
16
|
vscodeSettingsTargets
|
|
17
|
-
} from "../chunk-
|
|
17
|
+
} from "../chunk-B75OQ2E7.js";
|
|
18
18
|
import {
|
|
19
19
|
OPENCODE_PLUGIN_SIBLING,
|
|
20
20
|
OPENCODE_PLUGIN_SIBLING_CONTENTS,
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
openCodePluginDir,
|
|
25
25
|
openCodePluginFile,
|
|
26
26
|
removeOpenCodeMcpServer
|
|
27
|
-
} from "../chunk-
|
|
27
|
+
} from "../chunk-5NDOV3UU.js";
|
|
28
28
|
import {
|
|
29
29
|
compatibleConfigFile,
|
|
30
30
|
compatibleInstructionsFile,
|
|
@@ -32,40 +32,40 @@ import {
|
|
|
32
32
|
compatiblePermissionRuleFile,
|
|
33
33
|
removeCompatibleHooks,
|
|
34
34
|
removeCompatibleMcpServer
|
|
35
|
-
} from "../chunk-
|
|
35
|
+
} from "../chunk-X4G4MQEV.js";
|
|
36
36
|
import {
|
|
37
37
|
isClaudeMcpSnapshot,
|
|
38
38
|
removeClaudeMcpServers,
|
|
39
39
|
removePusharySettings,
|
|
40
40
|
removePusharyToolPermissions,
|
|
41
41
|
restoreClaudeMcpServer
|
|
42
|
-
} from "../chunk-
|
|
42
|
+
} from "../chunk-UMVM4HVV.js";
|
|
43
43
|
import {
|
|
44
44
|
hookOwnerOf,
|
|
45
45
|
isHookTakeoverReceipt,
|
|
46
46
|
restoreHookTakeover,
|
|
47
47
|
restoreMcpServer
|
|
48
|
-
} from "../chunk-
|
|
49
|
-
import "../chunk-
|
|
48
|
+
} from "../chunk-J7X5YVTP.js";
|
|
49
|
+
import "../chunk-MK7ZJ2JN.js";
|
|
50
50
|
import {
|
|
51
51
|
liveBridgeProbe,
|
|
52
52
|
resolveBridgeStub
|
|
53
|
-
} from "../chunk-
|
|
53
|
+
} from "../chunk-VT5TVFM3.js";
|
|
54
54
|
import {
|
|
55
55
|
pusharyHookExecutable
|
|
56
|
-
} from "../chunk-
|
|
56
|
+
} from "../chunk-NYFBIXA7.js";
|
|
57
57
|
import {
|
|
58
58
|
disableDaemonService
|
|
59
|
-
} from "../chunk-
|
|
59
|
+
} from "../chunk-2PHHXWA4.js";
|
|
60
60
|
import {
|
|
61
61
|
removeGeminiSettings
|
|
62
|
-
} from "../chunk-
|
|
63
|
-
import "../chunk-
|
|
62
|
+
} from "../chunk-3TKMWW34.js";
|
|
63
|
+
import "../chunk-CATEMFAP.js";
|
|
64
64
|
import "../chunk-XHKBHWLX.js";
|
|
65
|
-
import "../chunk-
|
|
66
|
-
import "../chunk-
|
|
67
|
-
import "../chunk-
|
|
68
|
-
import "../chunk-
|
|
65
|
+
import "../chunk-ROCRCXTP.js";
|
|
66
|
+
import "../chunk-MR2GHF3F.js";
|
|
67
|
+
import "../chunk-LVHGSD5E.js";
|
|
68
|
+
import "../chunk-WHOD4YGB.js";
|
|
69
69
|
import {
|
|
70
70
|
bridgeAgentKey,
|
|
71
71
|
claudeJson,
|
|
@@ -94,7 +94,7 @@ import {
|
|
|
94
94
|
restoreCodexHookTrust,
|
|
95
95
|
vscodePluginDir,
|
|
96
96
|
vscodePluginMcp
|
|
97
|
-
} from "../chunk-
|
|
97
|
+
} from "../chunk-L2FPZQQM.js";
|
|
98
98
|
import {
|
|
99
99
|
exitOnHelpFlag
|
|
100
100
|
} from "../chunk-P4BNYJ5Q.js";
|
|
@@ -105,14 +105,14 @@ import {
|
|
|
105
105
|
CANDIDATE_RCS,
|
|
106
106
|
isDisabledExport,
|
|
107
107
|
removeClaudeAlias
|
|
108
|
-
} from "../chunk-
|
|
108
|
+
} from "../chunk-OLD4YGZR.js";
|
|
109
109
|
import "../chunk-HETOKNIL.js";
|
|
110
110
|
import "../chunk-SAF6HGAA.js";
|
|
111
111
|
import "../chunk-7QLSKOSU.js";
|
|
112
112
|
import {
|
|
113
113
|
EXIT
|
|
114
114
|
} from "../chunk-KZERVKTD.js";
|
|
115
|
-
import "../chunk-
|
|
115
|
+
import "../chunk-IEXXFXSP.js";
|
|
116
116
|
import "../chunk-T7E75EKA.js";
|
|
117
117
|
import "../chunk-OSJEMXSR.js";
|
|
118
118
|
import {
|
|
@@ -123,7 +123,7 @@ import {
|
|
|
123
123
|
SUPPORT_EMAIL,
|
|
124
124
|
isValidApiKey,
|
|
125
125
|
redactSecrets
|
|
126
|
-
} from "../chunk-
|
|
126
|
+
} from "../chunk-NTTMJFJU.js";
|
|
127
127
|
import "../chunk-EA3IELHP.js";
|
|
128
128
|
import "../chunk-HWJW3CPO.js";
|
|
129
129
|
|
|
@@ -1,54 +1,60 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import "../chunk-
|
|
2
|
+
import "../chunk-GE64YOTX.js";
|
|
3
3
|
import {
|
|
4
4
|
LiveTranscriptRelay,
|
|
5
5
|
liveSessionSleep,
|
|
6
6
|
postLiveSession,
|
|
7
7
|
postLiveSessionUntilAccepted,
|
|
8
8
|
startLiveSessionHeartbeat
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-7H4HD2WR.js";
|
|
10
10
|
import {
|
|
11
11
|
SESSION_IDLE_TIMEOUT_MS,
|
|
12
12
|
describeIdleWindow,
|
|
13
13
|
idleDeadlinePassed,
|
|
14
14
|
startProcessOwnership,
|
|
15
15
|
withSpawnProcessOwnership
|
|
16
|
-
} from "../chunk-
|
|
17
|
-
import "../chunk-
|
|
16
|
+
} from "../chunk-3ROHFC7Q.js";
|
|
17
|
+
import "../chunk-VT63XWPR.js";
|
|
18
18
|
import "../chunk-66H2QQAK.js";
|
|
19
19
|
import {
|
|
20
20
|
transcriptsEnabled
|
|
21
|
-
} from "../chunk-
|
|
21
|
+
} from "../chunk-WBWF7WU7.js";
|
|
22
22
|
import {
|
|
23
23
|
spawnClaude
|
|
24
24
|
} from "../chunk-XHKBHWLX.js";
|
|
25
25
|
import {
|
|
26
|
+
isAskUserResponse,
|
|
26
27
|
isDecisionStopped,
|
|
28
|
+
isWaitForAnswerResponse,
|
|
27
29
|
withdrawQuestion
|
|
28
|
-
} from "../chunk-
|
|
30
|
+
} from "../chunk-LVHGSD5E.js";
|
|
29
31
|
import {
|
|
30
32
|
getMachineId
|
|
31
|
-
} from "../chunk-
|
|
33
|
+
} from "../chunk-WHOD4YGB.js";
|
|
32
34
|
import {
|
|
33
35
|
resolveBinary
|
|
34
|
-
} from "../chunk-
|
|
35
|
-
import "../chunk-
|
|
36
|
+
} from "../chunk-L2FPZQQM.js";
|
|
37
|
+
import "../chunk-OLD4YGZR.js";
|
|
36
38
|
import {
|
|
37
39
|
callMcpTool
|
|
38
40
|
} from "../chunk-HETOKNIL.js";
|
|
39
41
|
import "../chunk-SAF6HGAA.js";
|
|
40
42
|
import "../chunk-7QLSKOSU.js";
|
|
41
43
|
import "../chunk-KZERVKTD.js";
|
|
42
|
-
import "../chunk-
|
|
44
|
+
import "../chunk-IEXXFXSP.js";
|
|
43
45
|
import "../chunk-T7E75EKA.js";
|
|
44
46
|
import {
|
|
45
47
|
getApiKey,
|
|
46
48
|
getBaseUrl
|
|
47
49
|
} from "../chunk-OSJEMXSR.js";
|
|
48
50
|
import {
|
|
51
|
+
degradedLine,
|
|
52
|
+
elicitationContent,
|
|
49
53
|
parseAgentQuestion,
|
|
50
|
-
parseAgentQuestionAnswers
|
|
51
|
-
|
|
54
|
+
parseAgentQuestionAnswers,
|
|
55
|
+
planElicitationAsk,
|
|
56
|
+
readElicitationFields
|
|
57
|
+
} from "../chunk-NTTMJFJU.js";
|
|
52
58
|
import "../chunk-EA3IELHP.js";
|
|
53
59
|
import "../chunk-HWJW3CPO.js";
|
|
54
60
|
|
|
@@ -57,6 +63,38 @@ import { existsSync } from "fs";
|
|
|
57
63
|
|
|
58
64
|
// src/codex-bridge.ts
|
|
59
65
|
import { randomUUID } from "crypto";
|
|
66
|
+
|
|
67
|
+
// src/codex-elicitation.ts
|
|
68
|
+
var planCodexElicitation = (params, threadId) => {
|
|
69
|
+
if (!threadId || params.threadId !== threadId || params.mode !== "form" || params._meta != null || typeof params.serverName !== "string" || !params.serverName.trim() || typeof params.message !== "string" || !params.message.trim()) return null;
|
|
70
|
+
const fields = readElicitationFields(params.requestedSchema);
|
|
71
|
+
if (!fields || fields.length > 3) return null;
|
|
72
|
+
const plan = [];
|
|
73
|
+
for (const [index, field] of fields.entries()) {
|
|
74
|
+
const question = `${params.serverName}: ${params.message} \u2014 ${field.label}`;
|
|
75
|
+
const ask = planElicitationAsk(question, [field]);
|
|
76
|
+
if (!ask || ask.kind === "questions" || question.length > 500) return null;
|
|
77
|
+
let labels = [];
|
|
78
|
+
if (ask.kind === "confirm") labels = ["Yes", "No"];
|
|
79
|
+
if (ask.kind === "select") labels = ask.options;
|
|
80
|
+
if (labels.length > 4 || labels.some((label) => label.length > 100)) return null;
|
|
81
|
+
plan.push({ ask, question: { id: String(index), question, isOther: false, options: labels.map((label) => ({ label })) } });
|
|
82
|
+
}
|
|
83
|
+
return plan;
|
|
84
|
+
};
|
|
85
|
+
var codexElicitationContent = (plan, answers) => {
|
|
86
|
+
let content = {};
|
|
87
|
+
for (const { ask, question } of plan) {
|
|
88
|
+
const values = answers[question.id]?.answers;
|
|
89
|
+
if (!values || values.length !== 1) return null;
|
|
90
|
+
const field = elicitationContent(ask, values[0]);
|
|
91
|
+
if (!field) return null;
|
|
92
|
+
content = { ...content, ...field };
|
|
93
|
+
}
|
|
94
|
+
return content;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
// src/codex-bridge.ts
|
|
60
98
|
import { spawn } from "child_process";
|
|
61
99
|
import { basename } from "path";
|
|
62
100
|
var MAX_RPC_LINE = 1024 * 1024;
|
|
@@ -70,6 +108,7 @@ var MAX_MESSAGE_BUFFERS = 16;
|
|
|
70
108
|
var JsonRpcClient = class {
|
|
71
109
|
constructor(command, cwd, timeoutMs, bridgeOptions) {
|
|
72
110
|
this.bridgeOptions = bridgeOptions;
|
|
111
|
+
this.threadId = bridgeOptions.resumeThreadId ?? null;
|
|
73
112
|
const options = { cwd, env: process.env, stdio: ["pipe", "pipe", "pipe"] };
|
|
74
113
|
this.child = process.platform === "win32" ? spawnClaude(command.command, command.args ?? [], options) : spawn(command.command, command.args ?? [], options);
|
|
75
114
|
this.child.stdout?.setEncoding("utf8");
|
|
@@ -84,6 +123,7 @@ var JsonRpcClient = class {
|
|
|
84
123
|
pending = /* @__PURE__ */ new Map();
|
|
85
124
|
notifications = /* @__PURE__ */ new Set();
|
|
86
125
|
serverRequests = /* @__PURE__ */ new Map();
|
|
126
|
+
threadId = null;
|
|
87
127
|
nextId = 1;
|
|
88
128
|
buffer = "";
|
|
89
129
|
closed = false;
|
|
@@ -108,6 +148,9 @@ var JsonRpcClient = class {
|
|
|
108
148
|
this.notifications.add(listener);
|
|
109
149
|
return () => this.notifications.delete(listener);
|
|
110
150
|
}
|
|
151
|
+
bindThread(threadId) {
|
|
152
|
+
this.threadId = threadId;
|
|
153
|
+
}
|
|
111
154
|
notify(method) {
|
|
112
155
|
this.write({ method });
|
|
113
156
|
}
|
|
@@ -163,11 +206,13 @@ var JsonRpcClient = class {
|
|
|
163
206
|
handle(line) {
|
|
164
207
|
let message;
|
|
165
208
|
try {
|
|
166
|
-
|
|
209
|
+
const parsed = JSON.parse(line);
|
|
210
|
+
if (!isRpcMessage(parsed)) return;
|
|
211
|
+
message = parsed;
|
|
167
212
|
} catch {
|
|
168
213
|
return;
|
|
169
214
|
}
|
|
170
|
-
if (message.id !== void 0 && message.method === "item/tool/requestUserInput") {
|
|
215
|
+
if (message.id !== void 0 && (message.method === "item/tool/requestUserInput" || message.method === "mcpServer/elicitation/request")) {
|
|
171
216
|
const id = message.id;
|
|
172
217
|
if (this.serverRequests.has(id)) return;
|
|
173
218
|
if (this.serverRequests.size >= MAX_PENDING_RPC) {
|
|
@@ -177,7 +222,8 @@ var JsonRpcClient = class {
|
|
|
177
222
|
const controller = new AbortController();
|
|
178
223
|
this.serverRequests.set(id, controller);
|
|
179
224
|
const signal = AbortSignal.any([controller.signal, this.bridgeOptions.signal]);
|
|
180
|
-
|
|
225
|
+
const answer = message.method === "mcpServer/elicitation/request" ? answerCodexElicitation(this.bridgeOptions, message.params ?? {}, this.threadId, signal) : answerCodexQuestions(this.bridgeOptions, message.params ?? {}, signal);
|
|
226
|
+
void answer.then(
|
|
181
227
|
(result) => {
|
|
182
228
|
if (!signal.aborted && !this.closed) this.write({ id, result });
|
|
183
229
|
},
|
|
@@ -226,7 +272,9 @@ var JsonRpcClient = class {
|
|
|
226
272
|
this.pending.clear();
|
|
227
273
|
}
|
|
228
274
|
};
|
|
229
|
-
var
|
|
275
|
+
var isJsonObject = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
276
|
+
var object = (value) => isJsonObject(value) ? value : null;
|
|
277
|
+
var isRpcMessage = (value) => isJsonObject(value) && (value.id === void 0 || typeof value.id === "string" || typeof value.id === "number" && Number.isFinite(value.id)) && (value.method === void 0 || typeof value.method === "string") && (value.params === void 0 || isJsonObject(value.params)) && (value.error === void 0 || isJsonObject(value.error) && (value.error.message === void 0 || typeof value.error.message === "string"));
|
|
230
278
|
var string = (value) => typeof value === "string" && value.length > 0 ? value : null;
|
|
231
279
|
var input = (text) => [{ type: "text", text, text_elements: [] }];
|
|
232
280
|
var rpcThreadId = (result) => string(object(object(result)?.thread)?.id);
|
|
@@ -234,7 +282,7 @@ var rpcTurnId = (result) => {
|
|
|
234
282
|
const response = object(result);
|
|
235
283
|
return string(object(response?.turn)?.id) ?? string(response?.turnId);
|
|
236
284
|
};
|
|
237
|
-
var answerCodexQuestions = async (options, params, signal) => {
|
|
285
|
+
var answerCodexQuestions = async (options, params, signal, toolName = "request_user_input") => {
|
|
238
286
|
if (!Array.isArray(params.questions) || !params.questions.length || params.questions.length > 3) throw new Error("Invalid questions");
|
|
239
287
|
const answers = /* @__PURE__ */ Object.create(null);
|
|
240
288
|
const deadline = Date.now() + Math.min(12e4, typeof params.autoResolutionMs === "number" ? Math.max(0, params.autoResolutionMs) : 12e4);
|
|
@@ -248,7 +296,11 @@ var answerCodexQuestions = async (options, params, signal) => {
|
|
|
248
296
|
const structured = labels.length >= 2 ? parseAgentQuestion({ ...question, multiSelect: false, allowOther: question?.isOther === true }) : void 0;
|
|
249
297
|
let correlationId = null;
|
|
250
298
|
let settled = false;
|
|
251
|
-
const call = (name, args, timeoutMs, waitSignal = signal) =>
|
|
299
|
+
const call = async (name, args, timeoutMs, waitSignal = signal) => {
|
|
300
|
+
const result = await callMcpTool(options.apiKey, name, args, { baseUrl: options.baseUrl, signal: waitSignal, timeoutMs, maxRetries: 1 });
|
|
301
|
+
if (name === "wait_for_answer" && !isWaitForAnswerResponse(result)) throw new Error("Invalid wait_for_answer response");
|
|
302
|
+
return result;
|
|
303
|
+
};
|
|
252
304
|
try {
|
|
253
305
|
signal.throwIfAborted();
|
|
254
306
|
if (Date.now() >= deadline) throw new Error("Question expired");
|
|
@@ -262,11 +314,12 @@ var answerCodexQuestions = async (options, params, signal) => {
|
|
|
262
314
|
agentName: `Codex - ${basename(options.cwd)}`,
|
|
263
315
|
sessionId: params.threadId,
|
|
264
316
|
machineId: options.machineId,
|
|
265
|
-
toolName
|
|
317
|
+
toolName,
|
|
266
318
|
wait: false,
|
|
267
319
|
waitEndsAt: new Date(deadline).toISOString()
|
|
268
320
|
}, Math.min(1e4, deadline - Date.now()));
|
|
269
|
-
correlationId = string(result
|
|
321
|
+
correlationId = string(object(result)?.correlationId);
|
|
322
|
+
if (!isAskUserResponse(result)) throw new Error("Invalid ask_user response");
|
|
270
323
|
while (!result.answered) {
|
|
271
324
|
if (result.status === "terminal" || result.status === "notified" || result.suppressed || result.mode === "terminal_only" || result.mode === "notify_only") {
|
|
272
325
|
if (correlationId) {
|
|
@@ -302,6 +355,27 @@ var answerCodexQuestions = async (options, params, signal) => {
|
|
|
302
355
|
}
|
|
303
356
|
return { answers };
|
|
304
357
|
};
|
|
358
|
+
var answerCodexElicitation = async (options, params, threadId, signal) => {
|
|
359
|
+
const plan = planCodexElicitation(params, threadId);
|
|
360
|
+
if (!plan) {
|
|
361
|
+
process.stderr.write(`${degradedLine("questions", { reason: "unsupported_codex_elicitation", fallback: "no form answer submitted", event: "mcpServer/elicitation/request" })}
|
|
362
|
+
`);
|
|
363
|
+
return { action: "cancel", content: null };
|
|
364
|
+
}
|
|
365
|
+
try {
|
|
366
|
+
const result = await answerCodexQuestions(options, {
|
|
367
|
+
threadId,
|
|
368
|
+
questions: plan.map((field) => field.question)
|
|
369
|
+
}, signal, "Elicitation");
|
|
370
|
+
const content = codexElicitationContent(plan, result.answers);
|
|
371
|
+
if (!content) throw new Error("Invalid elicitation answer");
|
|
372
|
+
return { action: "accept", content };
|
|
373
|
+
} catch {
|
|
374
|
+
process.stderr.write(`${degradedLine("questions", { reason: "codex_elicitation_unanswered", fallback: "no form answer submitted", event: "mcpServer/elicitation/request" })}
|
|
375
|
+
`);
|
|
376
|
+
return { action: "cancel", content: null };
|
|
377
|
+
}
|
|
378
|
+
};
|
|
305
379
|
var runCodexBridge = async (options) => {
|
|
306
380
|
const timeoutMs = options.requestTimeoutMs ?? 1e4;
|
|
307
381
|
const now = options.now ?? Date.now;
|
|
@@ -368,6 +442,7 @@ var runCodexBridge = async (options) => {
|
|
|
368
442
|
rpc.notify("initialized");
|
|
369
443
|
const thread = options.resumeThreadId ? await rpc.request("thread/resume", { threadId: options.resumeThreadId, cwd: options.cwd, excludeTurns: true }) : await rpc.request("thread/start", { cwd: options.cwd, model: options.model ?? null });
|
|
370
444
|
threadId = rpcThreadId(thread);
|
|
445
|
+
if (threadId) rpc.bindThread(threadId);
|
|
371
446
|
if (!threadId) throw new Error("Codex app-server did not return a thread id");
|
|
372
447
|
ownership = startProcessOwnership({ sessionId: threadId, pid: process.pid, spawnId: options.spawnId });
|
|
373
448
|
await ownership.ready;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
takeHookHoldBudget
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-GOQC7R3F.js";
|
|
5
5
|
import {
|
|
6
6
|
blockedActionFingerprint,
|
|
7
7
|
codexCallKey,
|
|
@@ -13,33 +13,33 @@ import {
|
|
|
13
13
|
recordCodexCallDecision,
|
|
14
14
|
reportMachineDenial,
|
|
15
15
|
userScope
|
|
16
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-ZR4NP264.js";
|
|
17
17
|
import {
|
|
18
18
|
triggerAutoUpdate
|
|
19
|
-
} from "../chunk-
|
|
19
|
+
} from "../chunk-O6MHM25J.js";
|
|
20
20
|
import {
|
|
21
21
|
isGatingMoment,
|
|
22
22
|
recordKeylessMoment
|
|
23
|
-
} from "../chunk-
|
|
23
|
+
} from "../chunk-7WRJFRNF.js";
|
|
24
24
|
import {
|
|
25
25
|
readHookInput
|
|
26
|
-
} from "../chunk-
|
|
26
|
+
} from "../chunk-TPD6LCQI.js";
|
|
27
27
|
import {
|
|
28
28
|
denyReasonFrom,
|
|
29
29
|
isDeferAnswer
|
|
30
30
|
} from "../chunk-YHG74UFF.js";
|
|
31
|
-
import "../chunk-
|
|
31
|
+
import "../chunk-LNMHLXNR.js";
|
|
32
32
|
import "../chunk-SGZJ5LYH.js";
|
|
33
|
-
import "../chunk-
|
|
34
|
-
import "../chunk-
|
|
35
|
-
import "../chunk-
|
|
36
|
-
import "../chunk-
|
|
37
|
-
import "../chunk-
|
|
38
|
-
import "../chunk-
|
|
39
|
-
import "../chunk-
|
|
40
|
-
import "../chunk-
|
|
33
|
+
import "../chunk-J7X5YVTP.js";
|
|
34
|
+
import "../chunk-MK7ZJ2JN.js";
|
|
35
|
+
import "../chunk-VT5TVFM3.js";
|
|
36
|
+
import "../chunk-NYFBIXA7.js";
|
|
37
|
+
import "../chunk-2PHHXWA4.js";
|
|
38
|
+
import "../chunk-3TKMWW34.js";
|
|
39
|
+
import "../chunk-CATEMFAP.js";
|
|
40
|
+
import "../chunk-VT63XWPR.js";
|
|
41
41
|
import "../chunk-66H2QQAK.js";
|
|
42
|
-
import "../chunk-
|
|
42
|
+
import "../chunk-WBWF7WU7.js";
|
|
43
43
|
import "../chunk-XHKBHWLX.js";
|
|
44
44
|
import {
|
|
45
45
|
CODEX_AGENT,
|
|
@@ -76,8 +76,8 @@ import {
|
|
|
76
76
|
toCodexWire,
|
|
77
77
|
toPolicyLookup,
|
|
78
78
|
toPolicyLookups
|
|
79
|
-
} from "../chunk-
|
|
80
|
-
import "../chunk-
|
|
79
|
+
} from "../chunk-ROCRCXTP.js";
|
|
80
|
+
import "../chunk-MR2GHF3F.js";
|
|
81
81
|
import {
|
|
82
82
|
DECISION_STOP_REASON,
|
|
83
83
|
askUser,
|
|
@@ -89,20 +89,20 @@ import {
|
|
|
89
89
|
requestGate,
|
|
90
90
|
sendNotification,
|
|
91
91
|
waitForQuestion
|
|
92
|
-
} from "../chunk-
|
|
92
|
+
} from "../chunk-LVHGSD5E.js";
|
|
93
93
|
import {
|
|
94
94
|
getMachineId
|
|
95
|
-
} from "../chunk-
|
|
95
|
+
} from "../chunk-WHOD4YGB.js";
|
|
96
96
|
import {
|
|
97
97
|
canonicalJson
|
|
98
|
-
} from "../chunk-
|
|
98
|
+
} from "../chunk-L2FPZQQM.js";
|
|
99
99
|
import "../chunk-GMXKITVA.js";
|
|
100
|
-
import "../chunk-
|
|
100
|
+
import "../chunk-OLD4YGZR.js";
|
|
101
101
|
import "../chunk-HETOKNIL.js";
|
|
102
102
|
import "../chunk-SAF6HGAA.js";
|
|
103
103
|
import "../chunk-7QLSKOSU.js";
|
|
104
104
|
import "../chunk-KZERVKTD.js";
|
|
105
|
-
import "../chunk-
|
|
105
|
+
import "../chunk-IEXXFXSP.js";
|
|
106
106
|
import {
|
|
107
107
|
writeFileAtomic
|
|
108
108
|
} from "../chunk-T7E75EKA.js";
|
|
@@ -122,7 +122,7 @@ import {
|
|
|
122
122
|
hookWaitClamped,
|
|
123
123
|
hookWaitDeadline,
|
|
124
124
|
resolveGate
|
|
125
|
-
} from "../chunk-
|
|
125
|
+
} from "../chunk-NTTMJFJU.js";
|
|
126
126
|
import "../chunk-EA3IELHP.js";
|
|
127
127
|
import "../chunk-HWJW3CPO.js";
|
|
128
128
|
|
|
@@ -745,7 +745,7 @@ var decidePreToolUse = async (input) => {
|
|
|
745
745
|
};
|
|
746
746
|
var repairCodexHoldsQuietly = async () => {
|
|
747
747
|
try {
|
|
748
|
-
const { repairCodexHolds } = await import("../reapply-
|
|
748
|
+
const { repairCodexHolds } = await import("../reapply-GGHT2YJX.js");
|
|
749
749
|
repairCodexHolds();
|
|
750
750
|
} catch {
|
|
751
751
|
return;
|