@pushary/agent-hooks 1.4.2 → 1.5.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.
Files changed (94) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.md +28 -0
  3. package/data/vscode-plugin/README.md +1 -1
  4. package/data/vscode-plugin/scripts/pushary-gate.mjs +2 -2
  5. package/dist/bin/pushary-bell-hook.js +22 -21
  6. package/dist/bin/pushary-bell.js +10 -10
  7. package/dist/bin/pushary-claude.js +28 -24
  8. package/dist/bin/pushary-clean.js +25 -25
  9. package/dist/bin/pushary-codex-bridge.js +16 -14
  10. package/dist/bin/pushary-codex-hook.js +32 -27
  11. package/dist/bin/pushary-codex.js +15 -10
  12. package/dist/bin/pushary-connect.js +11 -11
  13. package/dist/bin/pushary-cowork.js +6 -6
  14. package/dist/bin/pushary-daemon.js +32 -28
  15. package/dist/bin/pushary-disconnect.js +16 -16
  16. package/dist/bin/pushary-doctor.js +111 -40
  17. package/dist/bin/pushary-elicitation-hook.js +23 -22
  18. package/dist/bin/pushary-gemini-bridge.js +13 -11
  19. package/dist/bin/pushary-gemini-hook.js +29 -24
  20. package/dist/bin/pushary-hook.js +30 -30
  21. package/dist/bin/pushary-login.js +14 -14
  22. package/dist/bin/pushary-logout.js +8 -8
  23. package/dist/bin/pushary-mode.js +7 -7
  24. package/dist/bin/pushary-notification-hook.js +26 -25
  25. package/dist/bin/pushary-opencode-hook.js +25 -24
  26. package/dist/bin/pushary-permission-denied-hook.js +30 -29
  27. package/dist/bin/pushary-permission-hook.js +29 -28
  28. package/dist/bin/pushary-post-hook.js +26 -25
  29. package/dist/bin/pushary-prompt-hook.js +26 -25
  30. package/dist/bin/pushary-session-end-hook.js +26 -25
  31. package/dist/bin/pushary-session-start-hook.js +33 -27
  32. package/dist/bin/pushary-setup.js +94 -88
  33. package/dist/bin/pushary-stats.js +6 -6
  34. package/dist/bin/pushary-status.js +15 -15
  35. package/dist/bin/pushary-stop-hook.js +26 -25
  36. package/dist/bin/pushary-stopfailure-hook.js +26 -25
  37. package/dist/bin/pushary-suggestions.js +4 -4
  38. package/dist/bin/pushary-transcript-register.js +20 -19
  39. package/dist/bin/pushary-transcripts.js +8 -8
  40. package/dist/bin/pushary-upgrade.js +269 -45
  41. package/dist/bin/pushary-wait.js +7 -7
  42. package/dist/bin/pushary.js +8 -8
  43. package/dist/{chunk-LPYCPFBZ.js → chunk-2AUIEZYS.js} +3 -3
  44. package/dist/{chunk-4BROEAKH.js → chunk-2QT3GCU4.js} +1 -1
  45. package/dist/{chunk-55KW4FLG.js → chunk-3ZSGKLSO.js} +2 -2
  46. package/dist/{chunk-NY6XQ6CA.js → chunk-43LJSM4F.js} +2 -2
  47. package/dist/{chunk-LEAAERSQ.js → chunk-43ZDACBO.js} +1 -1
  48. package/dist/{chunk-II7PUMPB.js → chunk-4ERLRNOK.js} +3 -3
  49. package/dist/{chunk-M5CTUFF3.js → chunk-5HYNICS7.js} +1 -1
  50. package/dist/{chunk-MW6ZPC6R.js → chunk-5UQ5ATIE.js} +1 -1
  51. package/dist/{chunk-TYEO6T5J.js → chunk-5ZZG76S2.js} +2 -2
  52. package/dist/{chunk-EQRS3SGM.js → chunk-66H2QQAK.js} +1 -1
  53. package/dist/chunk-6EEANS74.js +300 -0
  54. package/dist/{chunk-TRLFZKVG.js → chunk-6IU45EHE.js} +49 -26
  55. package/dist/{chunk-JVTOML54.js → chunk-6QFEQIPM.js} +2 -2
  56. package/dist/chunk-BY2CRWBO.js +38 -0
  57. package/dist/{chunk-G653QPTR.js → chunk-D573TLP6.js} +7 -7
  58. package/dist/{chunk-25RTLTQD.js → chunk-DTQNDR7C.js} +1 -1
  59. package/dist/{chunk-FAH3D74E.js → chunk-EA3IELHP.js} +6 -0
  60. package/dist/{chunk-EYRGBYZG.js → chunk-HETOKNIL.js} +1 -1
  61. package/dist/{chunk-UM5J3J4V.js → chunk-HU5LSYL2.js} +2 -2
  62. package/dist/{chunk-PC6DU5C4.js → chunk-HUAOMX4U.js} +1 -1
  63. package/dist/{chunk-2V2IKOGJ.js → chunk-HVBF35GT.js} +2 -2
  64. package/dist/{chunk-DINDL2CF.js → chunk-HWJW3CPO.js} +25 -5
  65. package/dist/{chunk-VW66JEGU.js → chunk-IV3RHICU.js} +8 -8
  66. package/dist/{chunk-ACYIZ3KH.js → chunk-JKBDGZFL.js} +12 -6
  67. package/dist/{chunk-ZVY25BMK.js → chunk-K3QVDAZW.js} +1 -1
  68. package/dist/{chunk-MUVTZNJW.js → chunk-KHXVTWYS.js} +3 -3
  69. package/dist/{chunk-T5SZ4PML.js → chunk-KJRALILH.js} +7 -4
  70. package/dist/{chunk-VOMOZ4D5.js → chunk-M2LMXPJZ.js} +1 -1
  71. package/dist/{chunk-SUWRZYQG.js → chunk-MDJJW3LP.js} +3 -3
  72. package/dist/chunk-MU3WU2FO.js +166 -0
  73. package/dist/{chunk-2UMNXADU.js → chunk-OSJEMXSR.js} +5 -1
  74. package/dist/{chunk-TWWLVOPB.js → chunk-P4BNYJ5Q.js} +5 -5
  75. package/dist/{chunk-XDP3UYH5.js → chunk-PJ27EHCD.js} +8 -8
  76. package/dist/{chunk-LGXUGYUH.js → chunk-PYCQXCI5.js} +2 -2
  77. package/dist/{chunk-VIOL2DJS.js → chunk-R5KY3PBN.js} +5 -5
  78. package/dist/{chunk-SOUZBGYJ.js → chunk-T4QY64OR.js} +15 -14
  79. package/dist/{chunk-DY4ILT6L.js → chunk-TFKBFQCE.js} +1 -1
  80. package/dist/{chunk-GZ7E6VOB.js → chunk-TIWURSLS.js} +1 -1
  81. package/dist/{chunk-F4UWL4NY.js → chunk-TUXFIVOH.js} +1 -1
  82. package/dist/{chunk-UJBZIKSY.js → chunk-TZGCUNOX.js} +8 -8
  83. package/dist/{chunk-FU2DFEAZ.js → chunk-USQDVBEV.js} +2 -2
  84. package/dist/{chunk-YXP3WPAI.js → chunk-UYDTFCHW.js} +1 -1
  85. package/dist/{chunk-4ZDKSDVW.js → chunk-WNJSGZY7.js} +4 -4
  86. package/dist/{chunk-NHTAHAIS.js → chunk-WOLPADR6.js} +1 -1
  87. package/dist/{chunk-BZ4GDOJX.js → chunk-X7FESZTD.js} +7 -7
  88. package/dist/{chunk-NOWZUGZW.js → chunk-XWEONSLV.js} +1 -1
  89. package/dist/{chunk-Y3MM6PYN.js → chunk-YAWXKL2X.js} +1 -1
  90. package/dist/{chunk-GKIUEIDX.js → chunk-YQMFGWBD.js} +1 -1
  91. package/dist/{chunk-WPVHRUDT.js → chunk-Z4VGIBJ7.js} +3 -3
  92. package/dist/{reapply-J527BCJG.js → reapply-5CZSTJZI.js} +13 -8
  93. package/dist/src/index.js +18 -16
  94. package/package.json +1 -1
@@ -1,23 +1,30 @@
1
1
  #!/usr/bin/env node
2
+ import {
3
+ codexTrustOutcome,
4
+ describeCodexTrustConfirmation
5
+ } from "../chunk-BY2CRWBO.js";
2
6
  import {
3
7
  runBrowserLogin
4
- } from "../chunk-GKIUEIDX.js";
8
+ } from "../chunk-YQMFGWBD.js";
5
9
  import {
6
10
  coworkOutput,
7
11
  coworkSelection
8
- } from "../chunk-55KW4FLG.js";
12
+ } from "../chunk-3ZSGKLSO.js";
9
13
  import "../chunk-PUZZELE6.js";
10
14
  import {
11
15
  detectClaudeVersion
12
- } from "../chunk-PC6DU5C4.js";
16
+ } from "../chunk-HUAOMX4U.js";
13
17
  import {
14
18
  describeVersionManagerPin,
15
19
  versionManagerOf
16
20
  } from "../chunk-GU3EJCVV.js";
21
+ import {
22
+ ensureCodexTrustsPusharyHooks
23
+ } from "../chunk-6EEANS74.js";
17
24
  import {
18
25
  readManagedControlEvidence,
19
26
  waitForMachineReadiness
20
- } from "../chunk-VW66JEGU.js";
27
+ } from "../chunk-IV3RHICU.js";
21
28
  import {
22
29
  HERMES_CONFIG_SCRIPT,
23
30
  HERMES_PIP_PACKAGE,
@@ -27,7 +34,7 @@ import {
27
34
  isHermesConfigReceipt,
28
35
  resolveHermesPython,
29
36
  runHermesPythonScript
30
- } from "../chunk-Y3MM6PYN.js";
37
+ } from "../chunk-YAWXKL2X.js";
31
38
  import {
32
39
  describeDetection,
33
40
  detectAllAgents,
@@ -39,7 +46,7 @@ import {
39
46
  shortenHome,
40
47
  vscodeSettingsTargets,
41
48
  writeInstructionBlock
42
- } from "../chunk-MUVTZNJW.js";
49
+ } from "../chunk-KHXVTWYS.js";
43
50
  import {
44
51
  OPENCODE_HOOK_BINARY,
45
52
  addOpenCodeMcpServer,
@@ -50,7 +57,7 @@ import {
50
57
  openCodePluginDir,
51
58
  openCodePluginFile,
52
59
  openCodeWired
53
- } from "../chunk-F4UWL4NY.js";
60
+ } from "../chunk-TUXFIVOH.js";
54
61
  import {
55
62
  addCompatibleHooks,
56
63
  addCompatibleMcpServer,
@@ -61,7 +68,7 @@ import {
61
68
  compatibleMcpFile,
62
69
  compatiblePermissionRuleFile,
63
70
  hasCompatibleHooks
64
- } from "../chunk-VIOL2DJS.js";
71
+ } from "../chunk-R5KY3PBN.js";
65
72
  import {
66
73
  addClaudeMcpServer,
67
74
  addPusharyHooks,
@@ -69,12 +76,16 @@ import {
69
76
  captureClaudeMcpServer,
70
77
  isClaudeMcpSnapshot,
71
78
  updateClaudeMcpSnapshot
72
- } from "../chunk-II7PUMPB.js";
79
+ } from "../chunk-4ERLRNOK.js";
73
80
  import {
74
81
  detectProviderLiveCapabilities,
75
82
  hasSpawnProvider,
76
83
  resolveControlPolicy
77
- } from "../chunk-TYEO6T5J.js";
84
+ } from "../chunk-5ZZG76S2.js";
85
+ import {
86
+ describeAutoUpdateAnnouncement,
87
+ takeAutoUpdateAnnouncement
88
+ } from "../chunk-MU3WU2FO.js";
78
89
  import {
79
90
  KEEP_HINT,
80
91
  captureHookTakeover,
@@ -84,23 +95,23 @@ import {
84
95
  hookOwnerOf,
85
96
  mcpBearerKey,
86
97
  planHooks
87
- } from "../chunk-4ZDKSDVW.js";
98
+ } from "../chunk-WNJSGZY7.js";
88
99
  import {
89
100
  AGENT_CHOICES,
90
101
  effectiveControlMode,
91
102
  effectiveVerify,
92
103
  parseSetupOptions
93
- } from "../chunk-DY4ILT6L.js";
104
+ } from "../chunk-TFKBFQCE.js";
94
105
  import {
95
106
  liveBridgeProbe,
96
107
  resolveBridgeStub
97
- } from "../chunk-ZVY25BMK.js";
108
+ } from "../chunk-K3QVDAZW.js";
98
109
  import {
99
110
  claudeWired,
100
111
  codexWired,
101
112
  geminiWired,
102
113
  pusharyHookExecutable
103
- } from "../chunk-WPVHRUDT.js";
114
+ } from "../chunk-Z4VGIBJ7.js";
104
115
  import {
105
116
  clearDaemonNeedsLogin,
106
117
  daemonHasRemoteProof,
@@ -113,30 +124,30 @@ import {
113
124
  replaceDaemonService,
114
125
  stopDaemonService,
115
126
  waitForDaemonRemoteProof
116
- } from "../chunk-BZ4GDOJX.js";
127
+ } from "../chunk-X7FESZTD.js";
117
128
  import {
118
129
  GEMINI_HOOK_BINARY,
119
130
  addGeminiHooks,
120
131
  addGeminiMcpServer,
121
132
  compareVersion,
122
- formatVersion,
123
133
  parseVersion
124
- } from "../chunk-LPYCPFBZ.js";
125
- import "../chunk-MW6ZPC6R.js";
134
+ } from "../chunk-2AUIEZYS.js";
135
+ import "../chunk-5UQ5ATIE.js";
126
136
  import {
127
137
  transcriptPreferenceForSetup
128
- } from "../chunk-4BROEAKH.js";
138
+ } from "../chunk-2QT3GCU4.js";
129
139
  import "../chunk-XHKBHWLX.js";
130
140
  import {
131
141
  reportEvent
132
- } from "../chunk-G653QPTR.js";
133
- import "../chunk-YXP3WPAI.js";
134
- import "../chunk-LGXUGYUH.js";
135
- import "../chunk-NHTAHAIS.js";
142
+ } from "../chunk-D573TLP6.js";
143
+ import "../chunk-UYDTFCHW.js";
144
+ import "../chunk-PYCQXCI5.js";
145
+ import "../chunk-WOLPADR6.js";
136
146
  import {
137
147
  addCodexHookTrust,
138
148
  addCodexHooks,
139
149
  addCodexMcpServer,
150
+ autoUpdateState,
140
151
  captureCodexHookTrust,
141
152
  claudeJson,
142
153
  claudeMcpReceipt,
@@ -147,12 +158,12 @@ import {
147
158
  codexHome,
148
159
  codexHookPositions,
149
160
  codexSkillDir2 as codexSkillDir,
150
- codexTrustSchemeAgrees,
151
161
  codexVacatedIndexes,
152
162
  cursorPluginDir,
153
163
  cursorUserHooks,
154
164
  cursorUserMcp,
155
165
  dropVacatedCodexHookTrust,
166
+ fetchLatestPublishedVersion,
156
167
  geminiMd,
157
168
  geminiSettings,
158
169
  guardBinary,
@@ -170,7 +181,7 @@ import {
170
181
  resolveGlobalBinary,
171
182
  vscodePluginDir,
172
183
  vscodePluginMcp
173
- } from "../chunk-TRLFZKVG.js";
184
+ } from "../chunk-6IU45EHE.js";
174
185
  import {
175
186
  BROWSER_CONNECT_COMMAND,
176
187
  confirmAppConnection,
@@ -181,27 +192,20 @@ import {
181
192
  printConnectInstructions,
182
193
  roundTripEvidence,
183
194
  verifyRoundTrip
184
- } from "../chunk-T5SZ4PML.js";
195
+ } from "../chunk-KJRALILH.js";
185
196
  import "../chunk-3EGEA4KH.js";
186
197
  import {
187
198
  checkApiKey,
188
199
  describeKeyCheck,
189
200
  samePusharyAccount
190
- } from "../chunk-NY6XQ6CA.js";
201
+ } from "../chunk-43LJSM4F.js";
191
202
  import {
192
203
  setHumanStream
193
204
  } from "../chunk-QCGNGEGE.js";
194
205
  import {
195
206
  useColor
196
207
  } from "../chunk-5RUIFDTP.js";
197
- import {
198
- renderCommandHelp
199
- } from "../chunk-FAH3D74E.js";
200
208
  import "../chunk-GMXKITVA.js";
201
- import {
202
- getPackageVersion,
203
- isNewerVersion
204
- } from "../chunk-DINDL2CF.js";
205
209
  import {
206
210
  KEY_FILE_MODE,
207
211
  exportLine,
@@ -212,8 +216,8 @@ import {
212
216
  readKeySource,
213
217
  resolveShellRc,
214
218
  writeKey
215
- } from "../chunk-FU2DFEAZ.js";
216
- import "../chunk-EYRGBYZG.js";
219
+ } from "../chunk-USQDVBEV.js";
220
+ import "../chunk-HETOKNIL.js";
217
221
  import "../chunk-SAF6HGAA.js";
218
222
  import {
219
223
  UsageError
@@ -221,14 +225,14 @@ import {
221
225
  import {
222
226
  EXIT
223
227
  } from "../chunk-KZERVKTD.js";
224
- import "../chunk-UM5J3J4V.js";
228
+ import "../chunk-HU5LSYL2.js";
225
229
  import {
226
230
  backupFile,
227
231
  readJsonSafe,
228
232
  writeFileAtomic,
229
233
  writeJsonAtomic
230
234
  } from "../chunk-T7E75EKA.js";
231
- import "../chunk-2UMNXADU.js";
235
+ import "../chunk-OSJEMXSR.js";
232
236
  import {
233
237
  HOOK_COMPATIBLE_PROFILES,
234
238
  HOOK_LOCATOR_BINARY,
@@ -237,7 +241,15 @@ import {
237
241
  compatibleTargetFiles,
238
242
  hookCompatibleProfile,
239
243
  isValidApiKey
240
- } from "../chunk-SOUZBGYJ.js";
244
+ } from "../chunk-T4QY64OR.js";
245
+ import {
246
+ NPX_LATEST_COMMAND,
247
+ renderCommandHelp
248
+ } from "../chunk-EA3IELHP.js";
249
+ import {
250
+ getPackageVersion,
251
+ isNewerVersion
252
+ } from "../chunk-HWJW3CPO.js";
241
253
 
242
254
  // bin/pushary-setup.ts
243
255
  import { existsSync, readFileSync, writeFileSync, mkdirSync, cpSync, rmSync, renameSync, realpathSync, readdirSync, statSync, openSync, readSync, closeSync } from "fs";
@@ -439,15 +451,6 @@ var readCodexVersion = (probe) => {
439
451
  return bundled ? parseCodexVersion(bundled) : null;
440
452
  };
441
453
 
442
- // src/setup/codex-trust.ts
443
- var CODEX_TRUST_VERIFIED_MAX = [0, 155, 1];
444
- var planCodexTrust = (installed, hashingProvenOnThisMachine) => hashingProvenOnThisMachine || compareCodexVersion(installed, CODEX_TRUST_VERIFIED_MAX) <= 0 ? { kind: "pretrust" } : { kind: "manual", installed, verifiedMax: CODEX_TRUST_VERIFIED_MAX };
445
- var codexTrustOutcome = (pretrusted) => pretrusted ? "pretrusted" : "manual";
446
- var describeUnverifiedCodexTrust = (plan, surface) => {
447
- const where = surface === "chatgpt" ? "Open ChatGPT, then Settings and Hooks," : "Open Codex";
448
- return `Codex ${formatVersion(plan.installed)} is newer than the last version Pushary verified (${formatVersion(plan.verifiedMax)}), so its hooks are not trusted yet. ${where} and choose Trust for the Pushary hooks.`;
449
- };
450
-
451
454
  // src/setup/codex-install.ts
452
455
  var NATIVE_BINARY_MIN_BYTES = 20 * 1024 * 1024;
453
456
  var packageRootFor = (probe, binPath) => {
@@ -728,19 +731,17 @@ var spinner = async (label, fn, options = {}) => {
728
731
  if (!options.optional) throw err;
729
732
  }
730
733
  };
731
- var checkForUpdates = async (current) => {
732
- try {
733
- const res = await fetch("https://registry.npmjs.org/@pushary/agent-hooks/latest", {
734
- signal: AbortSignal.timeout(3e3)
735
- });
736
- const data = await res.json();
737
- const latest = data.version;
738
- if (latest && isNewerVersion(latest, current)) {
739
- console.log(` ${yellow("!")} Update available: ${dim(current)} \u2192 ${green(latest)}`);
740
- console.log(` ${dim("Run:")} npx @pushary/agent-hooks@latest upgrade`);
741
- console.log();
742
- }
743
- } catch {
734
+ var checkForUpdates = async (current, markAnnounced) => {
735
+ const announcement = takeAutoUpdateAnnouncement(autoUpdateState(), markAnnounced);
736
+ if (announcement) {
737
+ console.log(` ${check} ${describeAutoUpdateAnnouncement(announcement)}`);
738
+ console.log();
739
+ }
740
+ const latest = await fetchLatestPublishedVersion({ timeoutMs: 3e3 });
741
+ if (latest && isNewerVersion(latest, current)) {
742
+ console.log(` ${yellow("!")} Update available: ${dim(current)} \u2192 ${green(latest)}`);
743
+ console.log(` ${dim("Run:")} ${NPX_LATEST_COMMAND} upgrade`);
744
+ console.log();
744
745
  }
745
746
  };
746
747
  var globalInstallReady = false;
@@ -1031,6 +1032,13 @@ var addCodexNotifyEntry = (codexConfig) => {
1031
1032
  writeFileSync(codexConfig, stringifyTOML(config), "utf-8");
1032
1033
  }
1033
1034
  };
1035
+ var confirmCodexTrust = async () => {
1036
+ let confirmation = { kind: "unavailable", reason: "setup could not ask Codex" };
1037
+ await spinner("Checking the Pushary hook's trust with Codex", async () => {
1038
+ confirmation = await ensureCodexTrustsPusharyHooks();
1039
+ }, { optional: true });
1040
+ return confirmation;
1041
+ };
1034
1042
  var setupCodex = async (apiKey) => {
1035
1043
  console.log(`
1036
1044
  ${bold("Setting up Codex")}
@@ -1066,12 +1074,7 @@ var setupCodex = async (apiKey) => {
1066
1074
  });
1067
1075
  const codexVersion = detectCodexVersion();
1068
1076
  const hooksSupported = codexSupportsHooks(codexVersion);
1069
- const trustPlan = hooksSupported && codexVersion !== null ? planCodexTrust(
1070
- codexVersion,
1071
- codexTrustSchemeAgrees(readAgentJson(CODEX_HOOKS_JSON), readAgentToml(codexConfig), CODEX_HOOKS_JSON)
1072
- ) : null;
1073
- const trustAuto = trustPlan?.kind === "pretrust";
1074
- let trusted = false;
1077
+ let portedTrustWritten = false;
1075
1078
  if (hooksSupported) {
1076
1079
  const hookCommand = guardBinary(resolveGlobalBinary("pushary-codex-hook") ?? "pushary-codex-hook");
1077
1080
  let hookPositions = {};
@@ -1083,24 +1086,21 @@ var setupCodex = async (apiKey) => {
1083
1086
  writeJson(CODEX_HOOKS_JSON, hooksConfig);
1084
1087
  hookPositions = codexHookPositions(hooksConfig);
1085
1088
  });
1086
- if (trustAuto) {
1087
- await spinner("Trusting the Pushary hook (skips the /hooks step)", async () => {
1088
- let raw = "";
1089
- try {
1090
- raw = readFileSync(codexConfig, "utf-8");
1091
- } catch {
1092
- }
1093
- const config = raw ? parseTOML(raw) : {};
1094
- dropVacatedCodexHookTrust(config, CODEX_HOOKS_JSON, vacated);
1095
- addCodexHookTrust(config, CODEX_HOOKS_JSON, hookCommand, hookPositions);
1096
- writeFileSync(codexConfig, stringifyTOML(config), "utf-8");
1097
- trusted = true;
1098
- }, { optional: true });
1099
- }
1089
+ await spinner("Writing trust entries for the Pushary hook", async () => {
1090
+ let raw = "";
1091
+ try {
1092
+ raw = readFileSync(codexConfig, "utf-8");
1093
+ } catch {
1094
+ }
1095
+ const config = raw ? parseTOML(raw) : {};
1096
+ dropVacatedCodexHookTrust(config, CODEX_HOOKS_JSON, vacated);
1097
+ addCodexHookTrust(config, CODEX_HOOKS_JSON, hookCommand, hookPositions);
1098
+ writeFileSync(codexConfig, stringifyTOML(config), "utf-8");
1099
+ portedTrustWritten = true;
1100
+ }, { optional: true });
1100
1101
  await spinner("Removing legacy notify handler", async () => {
1101
1102
  removeCodexNotifyEntry(codexConfig);
1102
1103
  });
1103
- recordCodexTrust(codexTrustOutcome(trusted));
1104
1104
  } else {
1105
1105
  if (codexVersion !== null) {
1106
1106
  console.log(` ${yellow("!")} This Codex version predates native hooks (needs ${CODEX_HOOKS_MIN_VERSION.join(".")}+).`);
@@ -1120,6 +1120,9 @@ var setupCodex = async (apiKey) => {
1120
1120
  await spinner("Teaching Codex to ask via push (~/.codex/AGENTS.md)", async () => {
1121
1121
  writeInstructionBlock(CODEX_AGENTS_MD, renderAgentInstructions("Codex"));
1122
1122
  });
1123
+ const confirmation = hooksSupported ? await confirmCodexTrust() : null;
1124
+ const trustOutcome = confirmation === null ? null : codexTrustOutcome(confirmation, portedTrustWritten);
1125
+ if (trustOutcome !== null) recordCodexTrust(trustOutcome);
1123
1126
  console.log();
1124
1127
  console.log(` ${dim("What this configured:")}`);
1125
1128
  console.log(` ${dim("\u2022")} MCP server: Codex can send notifications and ask questions`);
@@ -1128,11 +1131,14 @@ var setupCodex = async (apiKey) => {
1128
1131
  console.log(` ${dim("\u2022")} Auto-allowed tools: no permission prompts for Pushary MCP calls`);
1129
1132
  if (hooksSupported) {
1130
1133
  console.log(` ${dim("\u2022")} Native hooks: phone approvals, policy enforcement, kill switch, session tracking`);
1131
- if (trusted) {
1134
+ if (trustOutcome === "verified") {
1135
+ console.log(` ${dim("\u2022")} Hook trusted, and Codex confirmed it: no ${cyan("/hooks")} step`);
1136
+ } else if (trustOutcome === "unverified" && confirmation) {
1132
1137
  console.log(` ${dim("\u2022")} Hook pre-trusted: no ${cyan("/hooks")} step. If approvals never arrive, ${cyan("/hooks")} re-trusts it`);
1138
+ console.log(` ${dim(describeCodexTrustConfirmation(confirmation))}`);
1133
1139
  } else {
1134
- if (trustPlan?.kind === "manual") {
1135
- console.log(` ${yellow("!")} ${describeUnverifiedCodexTrust(trustPlan, bundled ? "chatgpt" : "codex")}`);
1140
+ if (confirmation) {
1141
+ console.log(` ${yellow("!")} ${describeCodexTrustConfirmation(confirmation)}`);
1136
1142
  }
1137
1143
  console.log();
1138
1144
  console.log(` ${bold("One step left, and it happens inside Codex")}`);
@@ -1767,7 +1773,7 @@ var printPairingEscape = () => {
1767
1773
  console.log(` ${cyan(BROWSER_CONNECT_COMMAND)}`);
1768
1774
  console.log(` ${dim("Approve in a browser tab. No phone needed.")}`);
1769
1775
  console.log();
1770
- console.log(` ${cyan("npx @pushary/agent-hooks setup --key pk_...")}`);
1776
+ console.log(` ${cyan(`${NPX_LATEST_COMMAND} setup --key pk_...`)}`);
1771
1777
  console.log(` ${dim("Paste a key from")} ${cyan("pushary.com/dashboard/agent/settings")}`);
1772
1778
  console.log();
1773
1779
  console.log(` ${dim("Or get the app at")} ${cyan("https://pushary.com/download")} ${dim("and re-run setup.")}`);
@@ -1952,7 +1958,7 @@ var main = async () => {
1952
1958
  console.log(` ${bold("Pushary")} ${dim("v" + version)}`);
1953
1959
  console.log(` ${dim("Push notifications for AI agents")}`);
1954
1960
  console.log();
1955
- await checkForUpdates(version);
1961
+ await checkForUpdates(version, !options.dryRun);
1956
1962
  markStep("resolve-key");
1957
1963
  const connectMode = options.connectMode;
1958
1964
  const flagKey = await readKeyFromStdin(options) ?? options.key ?? void 0;
@@ -2479,7 +2485,7 @@ main().catch(async (err) => {
2479
2485
  }
2480
2486
  console.log();
2481
2487
  console.log(` ${yellow("!")} Setup failed: ${formatError(err)}`);
2482
- console.log(` ${dim("Run")} ${cyan("npx @pushary/agent-hooks doctor")} ${dim("after fixing the issue, then rerun setup.")}`);
2488
+ console.log(` ${dim("Run")} ${cyan(`${NPX_LATEST_COMMAND} doctor`)} ${dim("after fixing the issue, then rerun setup.")}`);
2483
2489
  console.log();
2484
2490
  process.exit(await abortWith("crashed", EXIT.FAILED));
2485
2491
  });
@@ -1,17 +1,17 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  readLedgerSummary
4
- } from "../chunk-LEAAERSQ.js";
4
+ } from "../chunk-43ZDACBO.js";
5
5
  import {
6
6
  exitOnHelpFlag
7
- } from "../chunk-TWWLVOPB.js";
8
- import "../chunk-FAH3D74E.js";
9
- import "../chunk-DINDL2CF.js";
7
+ } from "../chunk-P4BNYJ5Q.js";
10
8
  import "../chunk-KZERVKTD.js";
11
9
  import {
12
10
  getApiKey
13
- } from "../chunk-2UMNXADU.js";
14
- import "../chunk-SOUZBGYJ.js";
11
+ } from "../chunk-OSJEMXSR.js";
12
+ import "../chunk-T4QY64OR.js";
13
+ import "../chunk-EA3IELHP.js";
14
+ import "../chunk-HWJW3CPO.js";
15
15
 
16
16
  // bin/pushary-stats.ts
17
17
  exitOnHelpFlag("stats");
@@ -2,38 +2,36 @@
2
2
  import {
3
3
  describeLastSeen,
4
4
  listMachines
5
- } from "../chunk-VW66JEGU.js";
6
- import "../chunk-TYEO6T5J.js";
7
- import "../chunk-BZ4GDOJX.js";
5
+ } from "../chunk-IV3RHICU.js";
6
+ import "../chunk-5ZZG76S2.js";
7
+ import "../chunk-X7FESZTD.js";
8
8
  import "../chunk-XHKBHWLX.js";
9
- import "../chunk-NHTAHAIS.js";
10
- import "../chunk-TRLFZKVG.js";
9
+ import "../chunk-WOLPADR6.js";
10
+ import "../chunk-6IU45EHE.js";
11
11
  import {
12
12
  describeReach,
13
13
  fetchChannels,
14
14
  reachVerdict
15
- } from "../chunk-T5SZ4PML.js";
15
+ } from "../chunk-KJRALILH.js";
16
16
  import "../chunk-3EGEA4KH.js";
17
17
  import {
18
18
  checkApiKey,
19
19
  describeKeyCheck
20
- } from "../chunk-NY6XQ6CA.js";
20
+ } from "../chunk-43LJSM4F.js";
21
21
  import "../chunk-QCGNGEGE.js";
22
22
  import {
23
23
  createIo
24
24
  } from "../chunk-5RUIFDTP.js";
25
25
  import {
26
26
  exitOnHelpFlag
27
- } from "../chunk-TWWLVOPB.js";
28
- import "../chunk-FAH3D74E.js";
27
+ } from "../chunk-P4BNYJ5Q.js";
29
28
  import {
30
29
  rejectUnknownFlags
31
30
  } from "../chunk-GMXKITVA.js";
32
- import "../chunk-DINDL2CF.js";
33
31
  import {
34
32
  readKeySource
35
- } from "../chunk-FU2DFEAZ.js";
36
- import "../chunk-EYRGBYZG.js";
33
+ } from "../chunk-USQDVBEV.js";
34
+ import "../chunk-HETOKNIL.js";
37
35
  import "../chunk-SAF6HGAA.js";
38
36
  import {
39
37
  UsageError
@@ -41,10 +39,12 @@ import {
41
39
  import {
42
40
  EXIT
43
41
  } from "../chunk-KZERVKTD.js";
44
- import "../chunk-UM5J3J4V.js";
42
+ import "../chunk-HU5LSYL2.js";
45
43
  import "../chunk-T7E75EKA.js";
46
- import "../chunk-2UMNXADU.js";
47
- import "../chunk-SOUZBGYJ.js";
44
+ import "../chunk-OSJEMXSR.js";
45
+ import "../chunk-T4QY64OR.js";
46
+ import "../chunk-EA3IELHP.js";
47
+ import "../chunk-HWJW3CPO.js";
48
48
 
49
49
  // src/status.ts
50
50
  var keySourceLine = (source) => {
@@ -2,44 +2,45 @@
2
2
  import {
3
3
  activeHookSource,
4
4
  activeIdentity
5
- } from "../chunk-VIOL2DJS.js";
6
- import "../chunk-II7PUMPB.js";
5
+ } from "../chunk-R5KY3PBN.js";
6
+ import "../chunk-4ERLRNOK.js";
7
7
  import {
8
8
  readHookInput
9
- } from "../chunk-JVTOML54.js";
10
- import "../chunk-UJBZIKSY.js";
9
+ } from "../chunk-6QFEQIPM.js";
10
+ import "../chunk-TZGCUNOX.js";
11
11
  import "../chunk-SGZJ5LYH.js";
12
- import "../chunk-4ZDKSDVW.js";
13
- import "../chunk-DY4ILT6L.js";
14
- import "../chunk-ZVY25BMK.js";
15
- import "../chunk-WPVHRUDT.js";
16
- import "../chunk-BZ4GDOJX.js";
17
- import "../chunk-LPYCPFBZ.js";
18
- import "../chunk-MW6ZPC6R.js";
19
- import "../chunk-GZ7E6VOB.js";
20
- import "../chunk-EQRS3SGM.js";
21
- import "../chunk-4BROEAKH.js";
12
+ import "../chunk-WNJSGZY7.js";
13
+ import "../chunk-TFKBFQCE.js";
14
+ import "../chunk-K3QVDAZW.js";
15
+ import "../chunk-Z4VGIBJ7.js";
16
+ import "../chunk-X7FESZTD.js";
17
+ import "../chunk-2AUIEZYS.js";
18
+ import "../chunk-5UQ5ATIE.js";
19
+ import "../chunk-TIWURSLS.js";
20
+ import "../chunk-66H2QQAK.js";
21
+ import "../chunk-2QT3GCU4.js";
22
22
  import "../chunk-XHKBHWLX.js";
23
23
  import {
24
24
  handleStop,
25
25
  handleSubagentStop,
26
26
  isSubagentStop
27
- } from "../chunk-G653QPTR.js";
28
- import "../chunk-YXP3WPAI.js";
29
- import "../chunk-LGXUGYUH.js";
30
- import "../chunk-NHTAHAIS.js";
31
- import "../chunk-TRLFZKVG.js";
27
+ } from "../chunk-D573TLP6.js";
28
+ import "../chunk-UYDTFCHW.js";
29
+ import "../chunk-PYCQXCI5.js";
30
+ import "../chunk-WOLPADR6.js";
31
+ import "../chunk-6IU45EHE.js";
32
32
  import "../chunk-GMXKITVA.js";
33
- import "../chunk-DINDL2CF.js";
34
- import "../chunk-FU2DFEAZ.js";
35
- import "../chunk-EYRGBYZG.js";
33
+ import "../chunk-USQDVBEV.js";
34
+ import "../chunk-HETOKNIL.js";
36
35
  import "../chunk-SAF6HGAA.js";
37
36
  import "../chunk-7QLSKOSU.js";
38
37
  import "../chunk-KZERVKTD.js";
39
- import "../chunk-UM5J3J4V.js";
38
+ import "../chunk-HU5LSYL2.js";
40
39
  import "../chunk-T7E75EKA.js";
41
- import "../chunk-2UMNXADU.js";
42
- import "../chunk-SOUZBGYJ.js";
40
+ import "../chunk-OSJEMXSR.js";
41
+ import "../chunk-T4QY64OR.js";
42
+ import "../chunk-EA3IELHP.js";
43
+ import "../chunk-HWJW3CPO.js";
43
44
 
44
45
  // bin/pushary-stop-hook.ts
45
46
  var AGENT = activeIdentity(process.argv);
@@ -2,42 +2,43 @@
2
2
  import {
3
3
  activeHookSource,
4
4
  activeIdentity
5
- } from "../chunk-VIOL2DJS.js";
6
- import "../chunk-II7PUMPB.js";
5
+ } from "../chunk-R5KY3PBN.js";
6
+ import "../chunk-4ERLRNOK.js";
7
7
  import {
8
8
  readHookInput
9
- } from "../chunk-JVTOML54.js";
10
- import "../chunk-UJBZIKSY.js";
9
+ } from "../chunk-6QFEQIPM.js";
10
+ import "../chunk-TZGCUNOX.js";
11
11
  import "../chunk-SGZJ5LYH.js";
12
- import "../chunk-4ZDKSDVW.js";
13
- import "../chunk-DY4ILT6L.js";
14
- import "../chunk-ZVY25BMK.js";
15
- import "../chunk-WPVHRUDT.js";
16
- import "../chunk-BZ4GDOJX.js";
17
- import "../chunk-LPYCPFBZ.js";
18
- import "../chunk-MW6ZPC6R.js";
19
- import "../chunk-GZ7E6VOB.js";
20
- import "../chunk-EQRS3SGM.js";
21
- import "../chunk-4BROEAKH.js";
12
+ import "../chunk-WNJSGZY7.js";
13
+ import "../chunk-TFKBFQCE.js";
14
+ import "../chunk-K3QVDAZW.js";
15
+ import "../chunk-Z4VGIBJ7.js";
16
+ import "../chunk-X7FESZTD.js";
17
+ import "../chunk-2AUIEZYS.js";
18
+ import "../chunk-5UQ5ATIE.js";
19
+ import "../chunk-TIWURSLS.js";
20
+ import "../chunk-66H2QQAK.js";
21
+ import "../chunk-2QT3GCU4.js";
22
22
  import "../chunk-XHKBHWLX.js";
23
23
  import {
24
24
  handleStopFailure
25
- } from "../chunk-G653QPTR.js";
26
- import "../chunk-YXP3WPAI.js";
27
- import "../chunk-LGXUGYUH.js";
28
- import "../chunk-NHTAHAIS.js";
29
- import "../chunk-TRLFZKVG.js";
25
+ } from "../chunk-D573TLP6.js";
26
+ import "../chunk-UYDTFCHW.js";
27
+ import "../chunk-PYCQXCI5.js";
28
+ import "../chunk-WOLPADR6.js";
29
+ import "../chunk-6IU45EHE.js";
30
30
  import "../chunk-GMXKITVA.js";
31
- import "../chunk-DINDL2CF.js";
32
- import "../chunk-FU2DFEAZ.js";
33
- import "../chunk-EYRGBYZG.js";
31
+ import "../chunk-USQDVBEV.js";
32
+ import "../chunk-HETOKNIL.js";
34
33
  import "../chunk-SAF6HGAA.js";
35
34
  import "../chunk-7QLSKOSU.js";
36
35
  import "../chunk-KZERVKTD.js";
37
- import "../chunk-UM5J3J4V.js";
36
+ import "../chunk-HU5LSYL2.js";
38
37
  import "../chunk-T7E75EKA.js";
39
- import "../chunk-2UMNXADU.js";
40
- import "../chunk-SOUZBGYJ.js";
38
+ import "../chunk-OSJEMXSR.js";
39
+ import "../chunk-T4QY64OR.js";
40
+ import "../chunk-EA3IELHP.js";
41
+ import "../chunk-HWJW3CPO.js";
41
42
 
42
43
  // bin/pushary-stopfailure-hook.ts
43
44
  var AGENT = activeIdentity(process.argv);
@@ -4,12 +4,10 @@ import {
4
4
  } from "../chunk-5RUIFDTP.js";
5
5
  import {
6
6
  exitOnHelpFlag
7
- } from "../chunk-TWWLVOPB.js";
8
- import "../chunk-FAH3D74E.js";
7
+ } from "../chunk-P4BNYJ5Q.js";
9
8
  import {
10
9
  rejectUnknownFlags
11
10
  } from "../chunk-GMXKITVA.js";
12
- import "../chunk-DINDL2CF.js";
13
11
  import {
14
12
  UsageError
15
13
  } from "../chunk-7QLSKOSU.js";
@@ -19,7 +17,9 @@ import {
19
17
  import {
20
18
  getApiKey,
21
19
  getBaseUrl
22
- } from "../chunk-2UMNXADU.js";
20
+ } from "../chunk-OSJEMXSR.js";
21
+ import "../chunk-EA3IELHP.js";
22
+ import "../chunk-HWJW3CPO.js";
23
23
 
24
24
  // bin/pushary-suggestions.ts
25
25
  exitOnHelpFlag("suggestions");