@pushary/agent-hooks 1.5.1 → 1.6.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 (81) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/bin/pushary-bell-hook.js +18 -18
  3. package/dist/bin/pushary-bell.js +6 -6
  4. package/dist/bin/pushary-claude.js +18 -18
  5. package/dist/bin/pushary-clean.js +19 -19
  6. package/dist/bin/pushary-codex-bridge.js +10 -10
  7. package/dist/bin/pushary-codex-hook.js +23 -23
  8. package/dist/bin/pushary-codex.js +6 -6
  9. package/dist/bin/pushary-connect.js +6 -6
  10. package/dist/bin/pushary-cowork.js +3 -3
  11. package/dist/bin/pushary-daemon.js +23 -23
  12. package/dist/bin/pushary-disconnect.js +10 -10
  13. package/dist/bin/pushary-doctor.js +22 -22
  14. package/dist/bin/pushary-elicitation-hook.js +17 -17
  15. package/dist/bin/pushary-gemini-bridge.js +9 -9
  16. package/dist/bin/pushary-gemini-hook.js +20 -20
  17. package/dist/bin/pushary-hook.js +23 -23
  18. package/dist/bin/pushary-login.js +7 -7
  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 +20 -20
  22. package/dist/bin/pushary-opencode-hook.js +19 -19
  23. package/dist/bin/pushary-permission-denied-hook.js +24 -24
  24. package/dist/bin/pushary-permission-hook.js +23 -23
  25. package/dist/bin/pushary-post-hook.js +20 -20
  26. package/dist/bin/pushary-prompt-hook.js +20 -20
  27. package/dist/bin/pushary-session-end-hook.js +20 -20
  28. package/dist/bin/pushary-session-start-hook.js +24 -24
  29. package/dist/bin/pushary-setup.js +28 -28
  30. package/dist/bin/pushary-stats.js +2 -2
  31. package/dist/bin/pushary-status.js +10 -10
  32. package/dist/bin/pushary-stop-hook.js +20 -20
  33. package/dist/bin/pushary-stopfailure-hook.js +20 -20
  34. package/dist/bin/pushary-transcript-register.js +16 -16
  35. package/dist/bin/pushary-transcripts.js +4 -4
  36. package/dist/bin/pushary-upgrade.js +44 -26
  37. package/dist/bin/pushary-wait.js +3 -3
  38. package/dist/{chunk-5ZZG76S2.js → chunk-5MH5P366.js} +2 -2
  39. package/dist/{chunk-HVBF35GT.js → chunk-5QCZYSYR.js} +1 -1
  40. package/dist/{chunk-PJ27EHCD.js → chunk-644CGYOB.js} +66 -12
  41. package/dist/{chunk-D573TLP6.js → chunk-66BIMA62.js} +6 -5
  42. package/dist/{chunk-WOLPADR6.js → chunk-7JSE6JTZ.js} +1 -1
  43. package/dist/{chunk-TZGCUNOX.js → chunk-A2GS2ENL.js} +6 -6
  44. package/dist/{chunk-TFKBFQCE.js → chunk-A5URWZTP.js} +1 -1
  45. package/dist/{chunk-M2LMXPJZ.js → chunk-ALG3IBLB.js} +1 -1
  46. package/dist/{chunk-TUXFIVOH.js → chunk-B6TYEKJR.js} +1 -1
  47. package/dist/{chunk-MDJJW3LP.js → chunk-BE4P7ERZ.js} +3 -3
  48. package/dist/{chunk-2AUIEZYS.js → chunk-BK5F3FGE.js} +3 -3
  49. package/dist/{chunk-IV3RHICU.js → chunk-BW3Y2D24.js} +4 -4
  50. package/dist/{chunk-43LJSM4F.js → chunk-CSW6A2EW.js} +1 -1
  51. package/dist/{chunk-X7FESZTD.js → chunk-DZ75BJ7V.js} +3 -3
  52. package/dist/{chunk-DTQNDR7C.js → chunk-E7MJBWSR.js} +1 -1
  53. package/dist/{chunk-6IU45EHE.js → chunk-F2OPOBRO.js} +1 -1
  54. package/dist/{chunk-43ZDACBO.js → chunk-F4KRNFDE.js} +1 -1
  55. package/dist/{chunk-6QFEQIPM.js → chunk-FDF72XHK.js} +2 -2
  56. package/dist/{chunk-R5KY3PBN.js → chunk-FI3LQCUH.js} +5 -5
  57. package/dist/{chunk-KHXVTWYS.js → chunk-G5LENVCZ.js} +3 -3
  58. package/dist/{chunk-K3QVDAZW.js → chunk-GDXSCXQC.js} +1 -1
  59. package/dist/{chunk-5HYNICS7.js → chunk-GOXINLDU.js} +1 -1
  60. package/dist/{chunk-2QT3GCU4.js → chunk-GP6SFVEN.js} +1 -1
  61. package/dist/{chunk-4ERLRNOK.js → chunk-HWG7X3VI.js} +3 -3
  62. package/dist/{chunk-WNJSGZY7.js → chunk-KZBGITM4.js} +4 -4
  63. package/dist/{chunk-Z4VGIBJ7.js → chunk-MOQOJOMD.js} +3 -3
  64. package/dist/{chunk-HUAOMX4U.js → chunk-NDS27FXU.js} +1 -1
  65. package/dist/{chunk-YAWXKL2X.js → chunk-NYD7W7AT.js} +1 -1
  66. package/dist/{chunk-JKBDGZFL.js → chunk-OP7HFIWE.js} +22 -12
  67. package/dist/{chunk-5UQ5ATIE.js → chunk-OR3A3RLH.js} +1 -1
  68. package/dist/{chunk-XWEONSLV.js → chunk-PCVVCS4A.js} +1 -1
  69. package/dist/{chunk-KJRALILH.js → chunk-PRZXYILJ.js} +2 -2
  70. package/dist/{chunk-MU3WU2FO.js → chunk-RBPJO4KG.js} +1 -1
  71. package/dist/{chunk-TIWURSLS.js → chunk-SFNRAEEW.js} +1 -1
  72. package/dist/{chunk-USQDVBEV.js → chunk-TDKE3V6W.js} +1 -1
  73. package/dist/{chunk-HU5LSYL2.js → chunk-VMNI33F5.js} +1 -1
  74. package/dist/{chunk-UYDTFCHW.js → chunk-VZANUMIF.js} +1 -1
  75. package/dist/{chunk-3ZSGKLSO.js → chunk-XGL5JC6U.js} +2 -2
  76. package/dist/{chunk-6EEANS74.js → chunk-XQOT4CCK.js} +8 -3
  77. package/dist/{chunk-T4QY64OR.js → chunk-YFD7CRIZ.js} +376 -10
  78. package/dist/{reapply-5CZSTJZI.js → reapply-RRDVJATI.js} +9 -9
  79. package/dist/src/index.d.ts +1 -0
  80. package/dist/src/index.js +12 -12
  81. package/package.json +1 -1
@@ -1,21 +1,21 @@
1
1
  import {
2
2
  detectClaudeVersion
3
- } from "./chunk-HUAOMX4U.js";
3
+ } from "./chunk-NDS27FXU.js";
4
4
  import {
5
5
  ensureCodexTrustsPusharyHooks
6
- } from "./chunk-6EEANS74.js";
6
+ } from "./chunk-XQOT4CCK.js";
7
7
  import {
8
8
  addClaudeMcpServer,
9
9
  addPusharyHooks,
10
10
  addPusharyToolPermissions
11
- } from "./chunk-4ERLRNOK.js";
11
+ } from "./chunk-HWG7X3VI.js";
12
12
  import {
13
13
  claudeUnprovenHolds,
14
14
  claudeWired,
15
15
  codexUnprovenHolds,
16
16
  codexWired,
17
17
  geminiWired
18
- } from "./chunk-Z4VGIBJ7.js";
18
+ } from "./chunk-MOQOJOMD.js";
19
19
  import {
20
20
  CLAUDE_HOOK_BINARY,
21
21
  CLAUDE_HOOK_EVENTS,
@@ -27,7 +27,7 @@ import {
27
27
  needsReregistration,
28
28
  registrationSignatures,
29
29
  supportedClaudeEvents
30
- } from "./chunk-2AUIEZYS.js";
30
+ } from "./chunk-BK5F3FGE.js";
31
31
  import {
32
32
  CODEX_HOOK_BINARY,
33
33
  addCodexHookTrust,
@@ -47,7 +47,7 @@ import {
47
47
  registrationHolderOf,
48
48
  resolveGlobalBinary,
49
49
  vscodePluginMcp
50
- } from "./chunk-6IU45EHE.js";
50
+ } from "./chunk-F2OPOBRO.js";
51
51
  import {
52
52
  readJsonSafe,
53
53
  writeFileAtomic,
@@ -126,6 +126,7 @@ var reapplyClaudeSettings = (apiKey, paths = {}) => {
126
126
  const claudeJsonWritable = claudeJson != null;
127
127
  let hooks = false;
128
128
  let mcp = false;
129
+ let failed = false;
129
130
  try {
130
131
  if (!settingsWritable) throw new Error("settings.json could not be parsed");
131
132
  const s = settings;
@@ -135,6 +136,7 @@ var reapplyClaudeSettings = (apiKey, paths = {}) => {
135
136
  writeJson(settingsPath, s);
136
137
  hooks = true;
137
138
  } catch {
139
+ failed = true;
138
140
  }
139
141
  if (apiKey) {
140
142
  try {
@@ -144,9 +146,10 @@ var reapplyClaudeSettings = (apiKey, paths = {}) => {
144
146
  writeJson(claudeJsonPath, cj);
145
147
  mcp = true;
146
148
  } catch {
149
+ failed = true;
147
150
  }
148
151
  }
149
- return { configured: true, reapplied: hooks || mcp, hooks, mcp };
152
+ return { configured: true, reapplied: hooks || mcp, hooks, mcp, failed };
150
153
  };
151
154
  var reapplyClaudeForVersion = (apiKey, paths = {}) => {
152
155
  const idle = { verdict: "current", rewrote: false, missing: [] };
@@ -215,6 +218,7 @@ var reapplyCodexSettings = (apiKey, paths = {}) => {
215
218
  const command = guardBinary((paths.resolveBinary ?? resolveGlobalBinary)(CODEX_HOOK_BINARY) ?? CODEX_HOOK_BINARY);
216
219
  let hooks = false;
217
220
  let mcp = false;
221
+ let failed = hooksConfig === null || config === null;
218
222
  const vacated = codexVacatedIndexes(hooksConfig ?? void 0);
219
223
  if (hooksConfig != null) {
220
224
  try {
@@ -222,6 +226,7 @@ var reapplyCodexSettings = (apiKey, paths = {}) => {
222
226
  writeJson(hooksPath, hooksConfig);
223
227
  hooks = true;
224
228
  } catch {
229
+ failed = true;
225
230
  }
226
231
  }
227
232
  if (config != null) {
@@ -232,15 +237,18 @@ var reapplyCodexSettings = (apiKey, paths = {}) => {
232
237
  }
233
238
  if (apiKey) {
234
239
  addCodexMcpServer(config, apiKey);
235
- mcp = true;
236
240
  }
237
241
  if (hooks || apiKey) {
238
242
  writeFileAtomic(configPath, stringifyTOML(config), modeToPreserve(configPath), "utf-8");
243
+ mcp = Boolean(apiKey);
239
244
  }
240
245
  } catch {
246
+ failed = true;
247
+ hooks = false;
241
248
  }
242
249
  }
243
- return { configured: true, reapplied: hooks || mcp, hooks, mcp };
250
+ if (config === null) hooks = false;
251
+ return { configured: true, reapplied: hooks || mcp, hooks, mcp, failed };
244
252
  };
245
253
  var repairCodexHolds = (paths = {}) => {
246
254
  const idle = { configured: false, reapplied: false, hooks: false, mcp: false };
@@ -265,13 +273,14 @@ var reapplyGeminiSettings = (apiKey, paths = {}) => {
265
273
  let mcp = false;
266
274
  try {
267
275
  addGeminiHooks(settings, guardBinary(resolveGlobalBinary(GEMINI_HOOK_BINARY) ?? GEMINI_HOOK_BINARY));
268
- hooks = true;
269
276
  if (apiKey) {
270
277
  addGeminiMcpServer(settings, apiKey);
271
- mcp = true;
272
278
  }
273
279
  writeJson(settingsPath, settings);
280
+ hooks = true;
281
+ mcp = Boolean(apiKey);
274
282
  } catch {
283
+ return { configured: true, reapplied: false, hooks: false, mcp: false, failed: true };
275
284
  }
276
285
  return { configured: true, reapplied: hooks || mcp, hooks, mcp };
277
286
  };
@@ -286,7 +295,7 @@ var reapplyPluginMcp = (mcpPath, apiKey) => {
286
295
  writeJson(mcpPath, mcpConfig);
287
296
  return { configured: true, reapplied: true, hooks: false, mcp: true };
288
297
  } catch {
289
- return { configured: true, reapplied: false, hooks: false, mcp: false };
298
+ return { configured: true, reapplied: false, hooks: false, mcp: false, failed: true };
290
299
  }
291
300
  };
292
301
  var reapplyCursorPlugin = (apiKey, paths = {}) => reapplyPluginMcp(
@@ -308,6 +317,7 @@ var reapplyAllAgents = (apiKey) => {
308
317
  const result = runner.run();
309
318
  if (result.configured) done.push({ id: runner.id, label: runner.label, result });
310
319
  } catch {
320
+ done.push({ id: runner.id, label: runner.label, result: { configured: false, reapplied: false, hooks: false, mcp: false, failed: true } });
311
321
  }
312
322
  }
313
323
  return done;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  guardBinary
3
- } from "./chunk-6IU45EHE.js";
3
+ } from "./chunk-F2OPOBRO.js";
4
4
 
5
5
  // src/bell/install.ts
6
6
  import { join } from "path";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  describeKeyCheck,
3
3
  keyCheckFromResponse
4
- } from "./chunk-43LJSM4F.js";
4
+ } from "./chunk-CSW6A2EW.js";
5
5
  import {
6
6
  createIo
7
7
  } from "./chunk-5RUIFDTP.js";
@@ -15,11 +15,11 @@ import {
15
15
  } from "./chunk-HETOKNIL.js";
16
16
  import {
17
17
  reportedInstallSource
18
- } from "./chunk-HU5LSYL2.js";
18
+ } from "./chunk-VMNI33F5.js";
19
19
  import {
20
20
  PAIR_TTL_SECONDS,
21
21
  isAnswerSource
22
- } from "./chunk-T4QY64OR.js";
22
+ } from "./chunk-YFD7CRIZ.js";
23
23
  import {
24
24
  NPX_LATEST_COMMAND
25
25
  } from "./chunk-EA3IELHP.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  autoUpdateState
3
- } from "./chunk-6IU45EHE.js";
3
+ } from "./chunk-F2OPOBRO.js";
4
4
  import {
5
5
  readJsonSafe,
6
6
  writeJsonAtomic
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  redactSecrets
3
- } from "./chunk-T4QY64OR.js";
3
+ } from "./chunk-YFD7CRIZ.js";
4
4
 
5
5
  // src/crypto.ts
6
6
  import nacl from "tweetnacl";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolveInstallSourceFor
3
- } from "./chunk-HU5LSYL2.js";
3
+ } from "./chunk-VMNI33F5.js";
4
4
  import {
5
5
  backupFile,
6
6
  readJsonSafe,
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-OSJEMXSR.js";
4
4
  import {
5
5
  normalizeInstallSource
6
- } from "./chunk-T4QY64OR.js";
6
+ } from "./chunk-YFD7CRIZ.js";
7
7
 
8
8
  // src/install-source.ts
9
9
  import { readFileSync } from "fs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  PRETOOLUSE_GATED_TOOLS
3
- } from "./chunk-T4QY64OR.js";
3
+ } from "./chunk-YFD7CRIZ.js";
4
4
 
5
5
  // src/claude-tools.ts
6
6
  var POSTTOOLUSE_MIRROR_ONLY_TOOLS = ["TodoWrite", "Task", "WebFetch", "WebSearch"];
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  SETUP_FLAGS
3
- } from "./chunk-TFKBFQCE.js";
3
+ } from "./chunk-A5URWZTP.js";
4
4
  import {
5
5
  parseFlags
6
6
  } from "./chunk-GMXKITVA.js";
@@ -14,7 +14,7 @@ import {
14
14
  CLAUDE_CONNECTOR_URL,
15
15
  COWORK_CONNECTOR_LIMIT,
16
16
  COWORK_STANDING_INSTRUCTIONS
17
- } from "./chunk-T4QY64OR.js";
17
+ } from "./chunk-YFD7CRIZ.js";
18
18
 
19
19
  // src/cli/cowork.ts
20
20
  import { readFileSync } from "fs";
@@ -6,7 +6,7 @@ import {
6
6
  codexHooksJsonIn,
7
7
  isPusharyCodexCommand,
8
8
  resolvePathBinary
9
- } from "./chunk-6IU45EHE.js";
9
+ } from "./chunk-F2OPOBRO.js";
10
10
  import {
11
11
  getPackageVersion
12
12
  } from "./chunk-HWJW3CPO.js";
@@ -37,7 +37,8 @@ var CODEX_INSTALLATION_ID_FILE = "installation_id";
37
37
  var CODEX_NOT_ASKED = {
38
38
  notInteractive: "Pushary only starts Codex when you run setup, upgrade or doctor yourself at a terminal",
39
39
  noCodexOnPath: "there is no codex command on PATH",
40
- neverOpened: "Codex has not been opened on this machine yet"
40
+ neverOpened: "Codex has not been opened on this machine yet",
41
+ insideAnApp: "the codex command resolves inside an app bundle, which Pushary does not run"
41
42
  };
42
43
  var UNRECOGNISED_LISTING = "Codex answered hooks/list in a shape Pushary does not recognise";
43
44
  var isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
@@ -115,6 +116,9 @@ var mayAskCodex = (conditions) => {
115
116
  if (!conditions.interactive) return { kind: "skipped", reason: CODEX_NOT_ASKED.notInteractive };
116
117
  if (!conditions.codexOnPath) return { kind: "skipped", reason: CODEX_NOT_ASKED.noCodexOnPath };
117
118
  if (!conditions.codexOpenedBefore) return { kind: "skipped", reason: CODEX_NOT_ASKED.neverOpened };
119
+ if (conditions.codexOnPath.split(/[\\/]/).some((part) => part.toLowerCase().endsWith(".app"))) {
120
+ return { kind: "skipped", reason: CODEX_NOT_ASKED.insideAnApp };
121
+ }
118
122
  return { kind: "ask", binary: conditions.codexOnPath };
119
123
  };
120
124
  var canonicalPath = (path) => {
@@ -233,9 +237,10 @@ var runCodexAppServer = (launch, conversation) => {
233
237
  };
234
238
  var launchOf = (options) => {
235
239
  const home = options.codexHome ?? codexHome();
240
+ const binary = options.codexOnPath === void 0 ? resolvePathBinary("codex") ?? null : options.codexOnPath;
236
241
  const decision = mayAskCodex({
237
242
  interactive: options.interactive ?? process.stdout.isTTY === true,
238
- codexOnPath: options.codexOnPath === void 0 ? resolvePathBinary("codex") ?? null : options.codexOnPath,
243
+ codexOnPath: binary ? canonicalPath(binary) : null,
239
244
  codexOpenedBefore: existsSync(join(home, CODEX_INSTALLATION_ID_FILE))
240
245
  });
241
246
  if (decision.kind === "skipped") return decision;