@pushary/agent-hooks 0.85.2 → 0.87.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.
Files changed (60) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/bin/pushary-bell-hook.js +4 -4
  3. package/dist/bin/pushary-bell.js +6 -6
  4. package/dist/bin/pushary-claude.js +12 -10
  5. package/dist/bin/pushary-clean.js +10 -9
  6. package/dist/bin/pushary-codex-bridge.js +5 -5
  7. package/dist/bin/pushary-codex-hook.js +13 -29
  8. package/dist/bin/pushary-codex.js +6 -4
  9. package/dist/bin/pushary-connect.js +6 -6
  10. package/dist/bin/pushary-daemon.js +4 -4
  11. package/dist/bin/pushary-disconnect.js +25 -10
  12. package/dist/bin/pushary-doctor.js +21 -15
  13. package/dist/bin/pushary-elicitation-hook.d.ts +1 -0
  14. package/dist/bin/pushary-elicitation-hook.js +210 -0
  15. package/dist/bin/pushary-gemini-bridge.js +5 -5
  16. package/dist/bin/pushary-gemini-hook.js +10 -8
  17. package/dist/bin/pushary-hook.js +7 -8
  18. package/dist/bin/pushary-login.js +4 -4
  19. package/dist/bin/pushary-logout.js +4 -4
  20. package/dist/bin/pushary-mode.js +3 -3
  21. package/dist/bin/pushary-notification-hook.js +4 -3
  22. package/dist/bin/pushary-permission-denied-hook.js +7 -8
  23. package/dist/bin/pushary-permission-hook.js +7 -8
  24. package/dist/bin/pushary-post-hook.js +4 -3
  25. package/dist/bin/pushary-prompt-hook.js +4 -3
  26. package/dist/bin/pushary-session-end-hook.js +4 -3
  27. package/dist/bin/pushary-session-start-hook.js +4 -3
  28. package/dist/bin/pushary-setup.js +26 -21
  29. package/dist/bin/pushary-stats.js +2 -2
  30. package/dist/bin/pushary-status.js +5 -5
  31. package/dist/bin/pushary-stop-hook.js +4 -3
  32. package/dist/bin/pushary-stopfailure-hook.js +4 -3
  33. package/dist/bin/pushary-upgrade.js +13 -11
  34. package/dist/bin/pushary-wait.js +3 -3
  35. package/dist/{chunk-GM74DUMS.js → chunk-2T3GX7WG.js} +1 -1
  36. package/dist/{chunk-XJDL3MUE.js → chunk-5646VKR4.js} +18 -20
  37. package/dist/{chunk-PKUNB3SN.js → chunk-7MBDFNUC.js} +1 -1
  38. package/dist/{chunk-K337LIBD.js → chunk-7YJS2VTG.js} +36 -4
  39. package/dist/{chunk-LCA2EQTK.js → chunk-A3PFIWWN.js} +1 -1
  40. package/dist/{chunk-LSB6PFLN.js → chunk-A4I5JGCW.js} +1 -1
  41. package/dist/chunk-ATBKJNWS.js +19 -0
  42. package/dist/{chunk-KJW6NKF7.js → chunk-B3V2H6SA.js} +39 -15
  43. package/dist/{chunk-T54OT7IY.js → chunk-ECEUMWBH.js} +1 -1
  44. package/dist/{chunk-Q4URN3E7.js → chunk-HAUTLCMA.js} +1 -1
  45. package/dist/{chunk-Y7E2MC3G.js → chunk-HJ44HIUW.js} +60 -31
  46. package/dist/{chunk-4U2YRHNF.js → chunk-IWL5LWIE.js} +2 -2
  47. package/dist/chunk-J3YDT4HM.js +128 -0
  48. package/dist/{chunk-NTIUQB3E.js → chunk-JAICP7BA.js} +1 -1
  49. package/dist/{chunk-HSGEEBBL.js → chunk-M7RYIZX6.js} +3 -3
  50. package/dist/{chunk-KZIGJLOX.js → chunk-OT4YD54Q.js} +1 -1
  51. package/dist/{chunk-LXWISFF3.js → chunk-QBWYNVKY.js} +1 -1
  52. package/dist/{chunk-4YMWLMAP.js → chunk-SJVLFIYP.js} +1 -1
  53. package/dist/{chunk-DPDUB4XF.js → chunk-V2XPF77V.js} +104 -163
  54. package/dist/{chunk-JBLRZGTT.js → chunk-WLLBFDVY.js} +1 -1
  55. package/dist/{chunk-JT5NQQCE.js → chunk-XW5CHAQX.js} +2 -2
  56. package/dist/{chunk-CWV4CMB6.js → chunk-Y3UTTFTZ.js} +1 -1
  57. package/dist/{chunk-GY3I353G.js → chunk-ZZE6FN7T.js} +7 -3
  58. package/dist/src/index.d.ts +2 -2
  59. package/dist/src/index.js +11 -11
  60. package/package.json +3 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.86.0
4
+
5
+ ### Approving a plan from your phone
6
+
7
+ Exiting plan mode blocked the terminal and pushed nothing, so an away user's agent
8
+ sat waiting on the one approval that decides everything after it. `ExitPlanMode` was
9
+ never in the hook's tool matcher, and `plan` is a mode Pushary steps aside for
10
+ entirely, so matching it alone would not have helped either.
11
+
12
+ The plan approval now reaches your phone before Pushary steps aside, and it carries
13
+ the plan itself, redacted and capped like any diff, so you are approving something
14
+ you can read rather than a bare tool name. Two options rather than the terminal's
15
+ three: a hook cannot set the permission mode the session lands in, so offering that
16
+ choice would have quietly dropped half of what you picked.
17
+
18
+ Falls back to the terminal exactly as before whenever the phone cannot answer.
19
+
3
20
  ## 0.85.2
4
21
 
5
22
  ### One agent-protocol renderer for CLI and native approvals
@@ -1,16 +1,16 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  handleBell
4
- } from "../chunk-GM74DUMS.js";
4
+ } from "../chunk-2T3GX7WG.js";
5
5
  import {
6
6
  readHookInput
7
7
  } from "../chunk-6CUUA7HO.js";
8
- import "../chunk-KZIGJLOX.js";
8
+ import "../chunk-OT4YD54Q.js";
9
9
  import "../chunk-BC3VCZ3E.js";
10
10
  import "../chunk-6MTNS63X.js";
11
- import "../chunk-CWV4CMB6.js";
11
+ import "../chunk-Y3UTTFTZ.js";
12
12
  import "../chunk-2UMNXADU.js";
13
- import "../chunk-K337LIBD.js";
13
+ import "../chunk-7YJS2VTG.js";
14
14
 
15
15
  // bin/pushary-bell-hook.ts
16
16
  var main = async () => {
@@ -5,18 +5,18 @@ import {
5
5
  liveAgentCount,
6
6
  ring,
7
7
  upgradeThreshold
8
- } from "../chunk-GM74DUMS.js";
8
+ } from "../chunk-2T3GX7WG.js";
9
9
  import {
10
10
  guardBinary
11
- } from "../chunk-HSGEEBBL.js";
11
+ } from "../chunk-M7RYIZX6.js";
12
12
  import "../chunk-VT4IVERX.js";
13
13
  import {
14
14
  claudeSettings
15
- } from "../chunk-KJW6NKF7.js";
15
+ } from "../chunk-B3V2H6SA.js";
16
16
  import {
17
17
  createIo
18
18
  } from "../chunk-5RUIFDTP.js";
19
- import "../chunk-KZIGJLOX.js";
19
+ import "../chunk-OT4YD54Q.js";
20
20
  import {
21
21
  parseFlags
22
22
  } from "../chunk-GMXKITVA.js";
@@ -30,13 +30,13 @@ import {
30
30
  readJsonSafe,
31
31
  writeJsonAtomic
32
32
  } from "../chunk-6MTNS63X.js";
33
- import "../chunk-CWV4CMB6.js";
33
+ import "../chunk-Y3UTTFTZ.js";
34
34
  import "../chunk-7QLSKOSU.js";
35
35
  import {
36
36
  EXIT
37
37
  } from "../chunk-KZERVKTD.js";
38
38
  import "../chunk-2UMNXADU.js";
39
- import "../chunk-K337LIBD.js";
39
+ import "../chunk-7YJS2VTG.js";
40
40
 
41
41
  // src/bell/install.ts
42
42
  import { join } from "path";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  ensureDaemonRunning
4
- } from "../chunk-4YMWLMAP.js";
4
+ } from "../chunk-SJVLFIYP.js";
5
5
  import {
6
6
  buildTranscriptRecords,
7
7
  decodePublicKey,
@@ -9,32 +9,34 @@ import {
9
9
  generateSessionKey,
10
10
  uploadTranscriptRecords,
11
11
  wrapSessionKey
12
- } from "../chunk-T54OT7IY.js";
12
+ } from "../chunk-ECEUMWBH.js";
13
13
  import {
14
14
  startProcessOwnership,
15
15
  withSpawnProcessOwnership
16
- } from "../chunk-LXWISFF3.js";
16
+ } from "../chunk-QBWYNVKY.js";
17
17
  import {
18
18
  needsShell,
19
19
  spawnClaude
20
20
  } from "../chunk-XHKBHWLX.js";
21
21
  import "../chunk-VT4IVERX.js";
22
- import "../chunk-KJW6NKF7.js";
22
+ import "../chunk-B3V2H6SA.js";
23
23
  import {
24
24
  isDeferAnswer
25
25
  } from "../chunk-YHG74UFF.js";
26
26
  import {
27
- askUser,
28
- cancelQuestion,
29
27
  deriveToolTarget,
30
28
  describeToolCall,
31
29
  fetchModeState,
32
30
  getPolicy,
33
31
  repoKeyFor,
34
32
  reportEvent,
35
- scopePathFor,
33
+ scopePathFor
34
+ } from "../chunk-V2XPF77V.js";
35
+ import {
36
+ askUser,
37
+ cancelQuestion,
36
38
  waitForAnswer
37
- } from "../chunk-DPDUB4XF.js";
39
+ } from "../chunk-J3YDT4HM.js";
38
40
  import {
39
41
  getMachineId
40
42
  } from "../chunk-RN3NOEJF.js";
@@ -42,7 +44,7 @@ import "../chunk-DINDL2CF.js";
42
44
  import "../chunk-6MTNS63X.js";
43
45
  import "../chunk-BSZYIAZL.js";
44
46
  import "../chunk-SAF6HGAA.js";
45
- import "../chunk-CWV4CMB6.js";
47
+ import "../chunk-Y3UTTFTZ.js";
46
48
  import "../chunk-7QLSKOSU.js";
47
49
  import "../chunk-KZERVKTD.js";
48
50
  import {
@@ -52,7 +54,7 @@ import {
52
54
  import {
53
55
  KILL_REASON,
54
56
  resolveGate
55
- } from "../chunk-K337LIBD.js";
57
+ } from "../chunk-7YJS2VTG.js";
56
58
 
57
59
  // src/wrapper/claudeBinary.ts
58
60
  import { statSync } from "fs";
@@ -1,18 +1,19 @@
1
1
  #!/usr/bin/env node
2
+ import {
3
+ removeClaudeMcpServers,
4
+ removePusharySettings
5
+ } from "../chunk-5646VKR4.js";
2
6
  import {
3
7
  removeInstructionBlock,
4
8
  shortenHome,
5
9
  unregisterPluginLocation,
6
10
  vscodeSettingsTargets
7
- } from "../chunk-4U2YRHNF.js";
11
+ } from "../chunk-IWL5LWIE.js";
8
12
  import {
9
13
  removeGeminiSettings
10
- } from "../chunk-GY3I353G.js";
11
- import {
12
- removeClaudeMcpServers,
13
- removePusharySettings
14
- } from "../chunk-XJDL3MUE.js";
15
- import "../chunk-HSGEEBBL.js";
14
+ } from "../chunk-ZZE6FN7T.js";
15
+ import "../chunk-ATBKJNWS.js";
16
+ import "../chunk-M7RYIZX6.js";
16
17
  import {
17
18
  execNpm
18
19
  } from "../chunk-VT4IVERX.js";
@@ -33,7 +34,7 @@ import {
33
34
  pusharyDir,
34
35
  removeCodexHooks,
35
36
  vscodePluginDir
36
- } from "../chunk-KJW6NKF7.js";
37
+ } from "../chunk-B3V2H6SA.js";
37
38
  import {
38
39
  rejectUnknownFlags
39
40
  } from "../chunk-GMXKITVA.js";
@@ -49,7 +50,7 @@ import "../chunk-7QLSKOSU.js";
49
50
  import {
50
51
  EXIT
51
52
  } from "../chunk-KZERVKTD.js";
52
- import "../chunk-K337LIBD.js";
53
+ import "../chunk-7YJS2VTG.js";
53
54
 
54
55
  // bin/pushary-clean.ts
55
56
  import { existsSync, readFileSync, copyFileSync, readdirSync } from "fs";
@@ -6,19 +6,19 @@ import {
6
6
  postLiveSession,
7
7
  postLiveSessionUntilAccepted,
8
8
  startLiveSessionHeartbeat
9
- } from "../chunk-JBLRZGTT.js";
10
- import "../chunk-T54OT7IY.js";
9
+ } from "../chunk-WLLBFDVY.js";
10
+ import "../chunk-ECEUMWBH.js";
11
11
  import {
12
12
  startProcessOwnership,
13
13
  withSpawnProcessOwnership
14
- } from "../chunk-LXWISFF3.js";
14
+ } from "../chunk-QBWYNVKY.js";
15
15
  import {
16
16
  spawnClaude
17
17
  } from "../chunk-XHKBHWLX.js";
18
18
  import {
19
19
  resolveBinary
20
20
  } from "../chunk-VT4IVERX.js";
21
- import "../chunk-KJW6NKF7.js";
21
+ import "../chunk-B3V2H6SA.js";
22
22
  import {
23
23
  getMachineId
24
24
  } from "../chunk-RN3NOEJF.js";
@@ -27,7 +27,7 @@ import {
27
27
  getApiKey,
28
28
  getBaseUrl
29
29
  } from "../chunk-2UMNXADU.js";
30
- import "../chunk-K337LIBD.js";
30
+ import "../chunk-7YJS2VTG.js";
31
31
 
32
32
  // bin/pushary-codex-bridge.ts
33
33
  import { existsSync } from "fs";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  isGatingMoment,
4
4
  recordKeylessMoment
5
- } from "../chunk-PKUNB3SN.js";
5
+ } from "../chunk-7MBDFNUC.js";
6
6
  import {
7
7
  readHookInput
8
8
  } from "../chunk-6CUUA7HO.js";
@@ -12,9 +12,6 @@ import {
12
12
  } from "../chunk-YHG74UFF.js";
13
13
  import {
14
14
  CODEX_AGENT,
15
- DEFAULT_SESSION,
16
- askUser,
17
- cancelQuestion,
18
15
  codexAllow,
19
16
  codexDeny,
20
17
  codexPass,
@@ -34,20 +31,25 @@ import {
34
31
  readLastPrompt,
35
32
  repoKeyFor,
36
33
  reportEvent,
37
- savePendingQuestion,
38
34
  scopePathFor,
39
- sendNotification,
40
35
  toCodexWire,
41
36
  toPolicyLookup,
42
- toPolicyLookups,
43
- waitForAnswer
44
- } from "../chunk-DPDUB4XF.js";
37
+ toPolicyLookups
38
+ } from "../chunk-V2XPF77V.js";
39
+ import {
40
+ DEFAULT_SESSION,
41
+ askUser,
42
+ cancelQuestion,
43
+ pollForAnswer,
44
+ savePendingQuestion,
45
+ sendNotification
46
+ } from "../chunk-J3YDT4HM.js";
45
47
  import {
46
48
  getMachineId
47
49
  } from "../chunk-RN3NOEJF.js";
48
50
  import "../chunk-BSZYIAZL.js";
49
51
  import "../chunk-SAF6HGAA.js";
50
- import "../chunk-CWV4CMB6.js";
52
+ import "../chunk-Y3UTTFTZ.js";
51
53
  import "../chunk-7QLSKOSU.js";
52
54
  import "../chunk-KZERVKTD.js";
53
55
  import {
@@ -60,7 +62,7 @@ import {
60
62
  hookWaitClamped,
61
63
  hookWaitDeadline,
62
64
  resolveGate
63
- } from "../chunk-K337LIBD.js";
65
+ } from "../chunk-7YJS2VTG.js";
64
66
 
65
67
  // bin/pushary-codex-hook.ts
66
68
  import { basename, join } from "path";
@@ -111,24 +113,6 @@ var claimNotify = (toolUseId) => {
111
113
  return true;
112
114
  }
113
115
  };
114
- var sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
115
- var pollForAnswer = async (apiKey, correlationId, deadlineMs, pollInterval = 2e3) => {
116
- while (Date.now() < deadlineMs) {
117
- const remaining = Math.min(Math.max(deadlineMs - Date.now(), 1e3), 3e4);
118
- let answer;
119
- try {
120
- answer = await waitForAnswer(apiKey, correlationId, remaining);
121
- } catch {
122
- if (Date.now() + pollInterval >= deadlineMs) break;
123
- await sleep(pollInterval);
124
- continue;
125
- }
126
- if (answer.answered) return answer;
127
- if (Date.now() + pollInterval >= deadlineMs) break;
128
- await sleep(pollInterval);
129
- }
130
- return { answered: false };
131
- };
132
116
  var agentNameFor = (input) => `Codex - ${basename(input.cwd ?? process.cwd())}`;
133
117
  var describeFor = (input, lookup) => input.tool_name === "apply_patch" ? describeApplyPatch(input.tool_input?.command) ?? describeToolCall(lookup.tool, lookup.input, "hook") : describeToolCall(lookup.tool, lookup.input, "hook");
134
118
  var pushQuestion = async (apiKey, input, lookup, waitSeconds, mode) => {
@@ -1,21 +1,23 @@
1
1
  #!/usr/bin/env node
2
+ import {
3
+ reportEvent
4
+ } from "../chunk-V2XPF77V.js";
2
5
  import {
3
6
  askUser,
4
- reportEvent,
5
7
  waitForAnswer
6
- } from "../chunk-DPDUB4XF.js";
8
+ } from "../chunk-J3YDT4HM.js";
7
9
  import {
8
10
  getMachineId
9
11
  } from "../chunk-RN3NOEJF.js";
10
12
  import "../chunk-BSZYIAZL.js";
11
13
  import "../chunk-SAF6HGAA.js";
12
- import "../chunk-CWV4CMB6.js";
14
+ import "../chunk-Y3UTTFTZ.js";
13
15
  import "../chunk-7QLSKOSU.js";
14
16
  import "../chunk-KZERVKTD.js";
15
17
  import {
16
18
  getApiKey
17
19
  } from "../chunk-2UMNXADU.js";
18
- import "../chunk-K337LIBD.js";
20
+ import "../chunk-7YJS2VTG.js";
19
21
 
20
22
  // bin/pushary-codex.ts
21
23
  import { basename } from "path";
@@ -1,22 +1,22 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  printKeyCheck
4
- } from "../chunk-NTIUQB3E.js";
4
+ } from "../chunk-JAICP7BA.js";
5
5
  import {
6
6
  confirmAppConnection,
7
7
  connectDevice,
8
8
  printConnectInstructions
9
- } from "../chunk-LCA2EQTK.js";
9
+ } from "../chunk-A3PFIWWN.js";
10
10
  import "../chunk-3EGEA4KH.js";
11
11
  import {
12
12
  checkApiKey
13
- } from "../chunk-LSB6PFLN.js";
13
+ } from "../chunk-A4I5JGCW.js";
14
14
  import {
15
15
  createIo
16
16
  } from "../chunk-5RUIFDTP.js";
17
17
  import {
18
18
  readKeySource
19
- } from "../chunk-KZIGJLOX.js";
19
+ } from "../chunk-OT4YD54Q.js";
20
20
  import {
21
21
  parseFlags
22
22
  } from "../chunk-GMXKITVA.js";
@@ -29,7 +29,7 @@ import "../chunk-DINDL2CF.js";
29
29
  import "../chunk-6MTNS63X.js";
30
30
  import "../chunk-BSZYIAZL.js";
31
31
  import "../chunk-SAF6HGAA.js";
32
- import "../chunk-CWV4CMB6.js";
32
+ import "../chunk-Y3UTTFTZ.js";
33
33
  import {
34
34
  UsageError
35
35
  } from "../chunk-7QLSKOSU.js";
@@ -37,7 +37,7 @@ import {
37
37
  EXIT
38
38
  } from "../chunk-KZERVKTD.js";
39
39
  import "../chunk-2UMNXADU.js";
40
- import "../chunk-K337LIBD.js";
40
+ import "../chunk-7YJS2VTG.js";
41
41
 
42
42
  // bin/pushary-connect.ts
43
43
  exitOnHelpFlag("connect");
@@ -8,7 +8,7 @@ import {
8
8
  acquireDaemonLease,
9
9
  readDaemonStatus,
10
10
  requestDaemonHandoff
11
- } from "../chunk-4YMWLMAP.js";
11
+ } from "../chunk-SJVLFIYP.js";
12
12
  import {
13
13
  CODEX_BRIDGE_CAPABILITY,
14
14
  CODEX_RESUME_CAPABILITY,
@@ -17,7 +17,7 @@ import {
17
17
  import {
18
18
  findLiveProcessBySpawnId,
19
19
  ownsLiveProcess
20
- } from "../chunk-LXWISFF3.js";
20
+ } from "../chunk-QBWYNVKY.js";
21
21
  import {
22
22
  spawnClaude
23
23
  } from "../chunk-XHKBHWLX.js";
@@ -26,7 +26,7 @@ import {
26
26
  resolveGlobalPackageVersion,
27
27
  resolvePackageVersionFromBinary
28
28
  } from "../chunk-VT4IVERX.js";
29
- import "../chunk-KJW6NKF7.js";
29
+ import "../chunk-B3V2H6SA.js";
30
30
  import {
31
31
  getMachineId
32
32
  } from "../chunk-RN3NOEJF.js";
@@ -43,7 +43,7 @@ import {
43
43
  getApiKey,
44
44
  getBaseUrl
45
45
  } from "../chunk-2UMNXADU.js";
46
- import "../chunk-K337LIBD.js";
46
+ import "../chunk-7YJS2VTG.js";
47
47
 
48
48
  // src/spawn-daemon.ts
49
49
  import { execFileSync, spawn } from "child_process";
@@ -1,32 +1,34 @@
1
1
  #!/usr/bin/env node
2
- import {
3
- removeGeminiSettings
4
- } from "../chunk-GY3I353G.js";
5
2
  import {
6
3
  removeClaudeMcpServers,
7
4
  removePusharySettings
8
- } from "../chunk-XJDL3MUE.js";
9
- import "../chunk-HSGEEBBL.js";
5
+ } from "../chunk-5646VKR4.js";
6
+ import {
7
+ removeGeminiSettings
8
+ } from "../chunk-ZZE6FN7T.js";
9
+ import "../chunk-ATBKJNWS.js";
10
+ import "../chunk-M7RYIZX6.js";
10
11
  import "../chunk-VT4IVERX.js";
11
12
  import {
12
13
  claudeJson,
13
14
  claudeSettings,
14
15
  claudeSettingsLocal,
15
16
  codexConfigToml,
17
+ codexHookPositions,
16
18
  codexHooksJson,
17
19
  cursorUserHooks,
18
20
  cursorUserMcp,
19
21
  geminiSettings,
20
22
  removeCodexHooks,
21
23
  removeCodexSettings
22
- } from "../chunk-KJW6NKF7.js";
24
+ } from "../chunk-B3V2H6SA.js";
23
25
  import {
24
26
  exitOnHelpFlag
25
27
  } from "../chunk-SQOFGPNX.js";
26
28
  import "../chunk-GOEXZ5QJ.js";
27
29
  import "../chunk-DINDL2CF.js";
28
30
  import "../chunk-KZERVKTD.js";
29
- import "../chunk-K337LIBD.js";
31
+ import "../chunk-7YJS2VTG.js";
30
32
 
31
33
  // bin/pushary-disconnect.ts
32
34
  import { readFileSync, writeFileSync } from "fs";
@@ -58,11 +60,24 @@ var disconnectPlan = (agent) => {
58
60
  { path: claudeSettingsLocal(), format: "json", remove: removePusharySettings },
59
61
  { path: claudeJson(), format: "json", remove: removeClaudeMcpServers }
60
62
  ];
61
- case "codex":
63
+ case "codex": {
64
+ const positions = {};
62
65
  return [
63
- { path: codexHooksJson(), format: "json", remove: removeCodexHooks },
64
- { path: codexConfigToml(), format: "toml", remove: (config) => removeCodexSettings(config, codexHooksJson()) }
66
+ {
67
+ path: codexHooksJson(),
68
+ format: "json",
69
+ remove: (config) => {
70
+ Object.assign(positions, codexHookPositions(config));
71
+ return removeCodexHooks(config);
72
+ }
73
+ },
74
+ {
75
+ path: codexConfigToml(),
76
+ format: "toml",
77
+ remove: (config) => removeCodexSettings(config, codexHooksJson(), positions)
78
+ }
65
79
  ];
80
+ }
66
81
  case "gemini":
67
82
  return [{ path: geminiSettings(), format: "json", remove: removeGeminiSettings }];
68
83
  case "cursor":
@@ -1,15 +1,15 @@
1
1
  #!/usr/bin/env node
2
+ import {
3
+ describeWaitLadder
4
+ } from "../chunk-IIENZE2J.js";
2
5
  import {
3
6
  claudeWired,
4
7
  codexWired,
5
8
  geminiWired
6
- } from "../chunk-JT5NQQCE.js";
7
- import {
8
- describeWaitLadder
9
- } from "../chunk-IIENZE2J.js";
9
+ } from "../chunk-XW5CHAQX.js";
10
10
  import {
11
11
  readDaemonStatus
12
- } from "../chunk-4YMWLMAP.js";
12
+ } from "../chunk-SJVLFIYP.js";
13
13
  import {
14
14
  agentProbes,
15
15
  detectAgent,
@@ -18,12 +18,12 @@ import {
18
18
  isDetected,
19
19
  isPluginRegistered,
20
20
  vscodeSettingsTargets
21
- } from "../chunk-4U2YRHNF.js";
21
+ } from "../chunk-IWL5LWIE.js";
22
22
  import {
23
23
  GEMINI_HOOK_BINARY,
24
24
  hasGeminiHooks,
25
25
  missingGeminiHookEvents
26
- } from "../chunk-GY3I353G.js";
26
+ } from "../chunk-ZZE6FN7T.js";
27
27
  import "../chunk-XHKBHWLX.js";
28
28
  import {
29
29
  execNpm
@@ -34,6 +34,7 @@ import {
34
34
  claudeSkillDir,
35
35
  codexAgentsMd,
36
36
  codexConfigToml,
37
+ codexHookPositions,
37
38
  codexHooksJson,
38
39
  codexSkillDir,
39
40
  cursorPluginDir,
@@ -46,10 +47,10 @@ import {
46
47
  readCodexMcpAuth,
47
48
  untrustedCodexHookEvents,
48
49
  vscodePluginDir
49
- } from "../chunk-KJW6NKF7.js";
50
+ } from "../chunk-B3V2H6SA.js";
50
51
  import {
51
52
  readLedgerSummary
52
- } from "../chunk-PKUNB3SN.js";
53
+ } from "../chunk-7MBDFNUC.js";
53
54
  import {
54
55
  getMachineId
55
56
  } from "../chunk-RN3NOEJF.js";
@@ -59,19 +60,19 @@ import {
59
60
  fetchChannels,
60
61
  reachVerdict,
61
62
  verifyRoundTrip
62
- } from "../chunk-LCA2EQTK.js";
63
+ } from "../chunk-A3PFIWWN.js";
63
64
  import "../chunk-3EGEA4KH.js";
64
65
  import {
65
66
  checkApiKey,
66
67
  describeKeyCheck
67
- } from "../chunk-LSB6PFLN.js";
68
+ } from "../chunk-A4I5JGCW.js";
68
69
  import {
69
70
  createIo
70
71
  } from "../chunk-5RUIFDTP.js";
71
72
  import {
72
73
  keyPrefix,
73
74
  readKeySource
74
- } from "../chunk-KZIGJLOX.js";
75
+ } from "../chunk-OT4YD54Q.js";
75
76
  import {
76
77
  parseFlags
77
78
  } from "../chunk-GMXKITVA.js";
@@ -89,7 +90,7 @@ import {
89
90
  sendMcpRequest
90
91
  } from "../chunk-BSZYIAZL.js";
91
92
  import "../chunk-SAF6HGAA.js";
92
- import "../chunk-CWV4CMB6.js";
93
+ import "../chunk-Y3UTTFTZ.js";
93
94
  import {
94
95
  UsageError
95
96
  } from "../chunk-7QLSKOSU.js";
@@ -99,7 +100,7 @@ import {
99
100
  import {
100
101
  getBaseUrl
101
102
  } from "../chunk-2UMNXADU.js";
102
- import "../chunk-K337LIBD.js";
103
+ import "../chunk-7YJS2VTG.js";
103
104
 
104
105
  // bin/pushary-doctor.ts
105
106
  import { existsSync, readFileSync, writeFileSync } from "fs";
@@ -463,7 +464,12 @@ var main = async () => {
463
464
  console.log(` ${warn} Codex: stale legacy notify entry ${dim("(double-push risk, re-run setup to remove it)")}`);
464
465
  }
465
466
  if (hookCommand) {
466
- const untrusted = untrustedCodexHookEvents(codexParsed, codexHooksPath, hookCommand);
467
+ const untrusted = untrustedCodexHookEvents(
468
+ codexParsed,
469
+ codexHooksPath,
470
+ hookCommand,
471
+ codexHookPositions(codexHooksConfig)
472
+ );
467
473
  check(untrusted.length === 0, "Codex: hooks trusted", untrusted.length === 0 ? "all events trusted" : `untrusted (${untrusted.join(", ")}) \u2014 type /hooks in Codex and trust them, once`);
468
474
  }
469
475
  } else {
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node