@pushary/agent-hooks 1.7.0 → 1.7.2

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 (102) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/bin/pushary-bell-hook.js +23 -23
  3. package/dist/bin/pushary-bell.js +10 -10
  4. package/dist/bin/pushary-claude.js +46 -35
  5. package/dist/bin/pushary-clean.js +194 -102
  6. package/dist/bin/pushary-codex-bridge.js +18 -17
  7. package/dist/bin/pushary-codex-hook.js +53 -39
  8. package/dist/bin/pushary-codex.js +14 -12
  9. package/dist/bin/pushary-connect.js +16 -16
  10. package/dist/bin/pushary-cowork.js +5 -5
  11. package/dist/bin/pushary-daemon.js +27 -27
  12. package/dist/bin/pushary-disconnect.js +19 -17
  13. package/dist/bin/pushary-doctor.js +99 -43
  14. package/dist/bin/pushary-elicitation-hook.js +35 -26
  15. package/dist/bin/pushary-gemini-bridge.js +12 -12
  16. package/dist/bin/pushary-gemini-hook.js +47 -32
  17. package/dist/bin/pushary-hook.js +34 -32
  18. package/dist/bin/pushary-login.js +16 -16
  19. package/dist/bin/pushary-logout.js +8 -8
  20. package/dist/bin/pushary-mcp.js +9 -8
  21. package/dist/bin/pushary-mode.js +10 -10
  22. package/dist/bin/pushary-notification-hook.js +29 -27
  23. package/dist/bin/pushary-opencode-hook.js +46 -32
  24. package/dist/bin/pushary-permission-denied-hook.js +34 -32
  25. package/dist/bin/pushary-permission-hook.js +33 -31
  26. package/dist/bin/pushary-post-hook.js +29 -27
  27. package/dist/bin/pushary-prompt-hook.js +29 -27
  28. package/dist/bin/pushary-session-end-hook.js +29 -27
  29. package/dist/bin/pushary-session-start-hook.js +33 -31
  30. package/dist/bin/pushary-setup.js +143 -105
  31. package/dist/bin/pushary-stats.js +5 -5
  32. package/dist/bin/pushary-status.js +19 -19
  33. package/dist/bin/pushary-stop-hook.js +29 -27
  34. package/dist/bin/pushary-stopfailure-hook.js +29 -27
  35. package/dist/bin/pushary-suggestions.js +5 -5
  36. package/dist/bin/pushary-transcript-register.js +19 -19
  37. package/dist/bin/pushary-transcripts.js +7 -7
  38. package/dist/bin/pushary-upgrade.js +20 -20
  39. package/dist/bin/pushary-wait.js +10 -10
  40. package/dist/bin/pushary.js +6 -6
  41. package/dist/{chunk-IJ6ECPA6.js → chunk-2B4XCMH6.js} +75 -232
  42. package/dist/{chunk-EGKXSQCY.js → chunk-2XOHXZRC.js} +12 -4
  43. package/dist/{chunk-D6BULEJW.js → chunk-3NSRL5E7.js} +2 -2
  44. package/dist/{chunk-UC65FJJT.js → chunk-3RO2UWJQ.js} +2 -2
  45. package/dist/{chunk-73T6MSU5.js → chunk-4S7CCOXB.js} +5 -5
  46. package/dist/{chunk-7OS4IHGI.js → chunk-5GIBNUBD.js} +2 -2
  47. package/dist/chunk-5OP5MQI7.js +45 -0
  48. package/dist/{chunk-B3UXMSMW.js → chunk-65RN6ZCO.js} +1 -1
  49. package/dist/{chunk-2PS6QWDW.js → chunk-6NHXKTQU.js} +2 -2
  50. package/dist/{chunk-V6QRSU2G.js → chunk-6QZK4O36.js} +4 -4
  51. package/dist/{chunk-ZQ7IDOKY.js → chunk-A6WQF7FQ.js} +3 -3
  52. package/dist/{chunk-QXAK5RFU.js → chunk-AWZNDM3B.js} +1 -1
  53. package/dist/{chunk-JNXVOU6Y.js → chunk-D4OGEWLH.js} +19 -2
  54. package/dist/{chunk-R2XCLT6I.js → chunk-E3PLF7YB.js} +4 -4
  55. package/dist/{chunk-2C7CCWVX.js → chunk-F6BMJOSW.js} +1 -1
  56. package/dist/{chunk-XNCMT7YY.js → chunk-HOIGXMI7.js} +1 -1
  57. package/dist/{chunk-CVALVGA7.js → chunk-I7B2DNVU.js} +1 -1
  58. package/dist/{chunk-S3UD4V6W.js → chunk-INR3RVQ3.js} +13 -3
  59. package/dist/{chunk-52NVBNJT.js → chunk-IZVAVXHQ.js} +6 -4
  60. package/dist/{chunk-5HLTWFJ6.js → chunk-JMSB6CJT.js} +1 -1
  61. package/dist/{chunk-KYQXUGH7.js → chunk-KAJT6HPI.js} +3 -3
  62. package/dist/{chunk-VKVIAZQO.js → chunk-KLXYMPTM.js} +1 -1
  63. package/dist/{chunk-PQ4F64M2.js → chunk-L6IF4JOF.js} +3 -3
  64. package/dist/{chunk-ROQK7IN3.js → chunk-LI3C2IQY.js} +2 -2
  65. package/dist/{chunk-B234346F.js → chunk-M2JGLFFS.js} +1 -1
  66. package/dist/chunk-MY3UZO5U.js +99 -0
  67. package/dist/chunk-N6IOSZOE.js +185 -0
  68. package/dist/{chunk-DNJUSFBL.js → chunk-NYBZJ44G.js} +40 -5
  69. package/dist/{chunk-BBKNJJVX.js → chunk-OJRB5QKN.js} +6 -6
  70. package/dist/{chunk-PUDBG3GM.js → chunk-OXEF6JHD.js} +4 -4
  71. package/dist/{chunk-LEZFOTMI.js → chunk-PWNQGITG.js} +1 -1
  72. package/dist/{chunk-B76WVEDX.js → chunk-Q7CDBJXU.js} +1 -1
  73. package/dist/{chunk-KXMZMZD3.js → chunk-QSZ37ROP.js} +1 -1
  74. package/dist/{chunk-BH2SKSSK.js → chunk-R7ZETVNR.js} +1 -1
  75. package/dist/{chunk-DZURML2D.js → chunk-RLRDPZG4.js} +1 -1
  76. package/dist/{chunk-J2355HR7.js → chunk-SEIZQZEE.js} +1 -1
  77. package/dist/{chunk-V4AQBAVG.js → chunk-SJN64NJX.js} +1 -1
  78. package/dist/{chunk-B3YQANFN.js → chunk-SKEW3TQX.js} +1 -1
  79. package/dist/{chunk-L4H2Q2S4.js → chunk-SKMWPXGV.js} +500 -46
  80. package/dist/{chunk-WUNZAE7I.js → chunk-T3PRPFDY.js} +5 -5
  81. package/dist/{chunk-YYINL576.js → chunk-TVJYGZXB.js} +2 -2
  82. package/dist/{chunk-O2LEPIU6.js → chunk-U3MS6D5X.js} +1 -1
  83. package/dist/{chunk-5RUIFDTP.js → chunk-U4TMAANR.js} +33 -2
  84. package/dist/{chunk-KW2RRR7D.js → chunk-UFNBKYWT.js} +3 -3
  85. package/dist/{chunk-DVQDPI3T.js → chunk-UUTWHVSV.js} +35 -35
  86. package/dist/{chunk-X6KDKOV5.js → chunk-VQDJ6KB3.js} +3 -3
  87. package/dist/{chunk-UOAQ6QMP.js → chunk-VSGKQ3HI.js} +2 -2
  88. package/dist/{chunk-YROGUPOZ.js → chunk-WWTLAZQA.js} +25 -8
  89. package/dist/{chunk-SQRWHALT.js → chunk-WXIVUIXA.js} +2 -2
  90. package/dist/{chunk-HDRNWNVP.js → chunk-YLCSKVQQ.js} +9 -28
  91. package/dist/{chunk-JXUAXO74.js → chunk-YNJ2H2FD.js} +2 -2
  92. package/dist/{chunk-BWYJ6AAF.js → chunk-YU4222G2.js} +2 -2
  93. package/dist/{chunk-4F46VIEE.js → chunk-YU54LNC6.js} +6 -6
  94. package/dist/{chunk-EAQMWJPG.js → chunk-ZMWX5SDA.js} +8 -8
  95. package/dist/{chunk-6ADZQFVW.js → chunk-ZUKZJQGR.js} +1 -1
  96. package/dist/{reapply-6PH3FMPX.js → reapply-D6RSDYCK.js} +9 -9
  97. package/dist/src/index.d.ts +1 -0
  98. package/dist/src/index.js +22 -20
  99. package/package.json +2 -1
  100. package/dist/chunk-DANOZVZK.js +0 -307
  101. package/dist/chunk-P32LPT2L.js +0 -6
  102. package/dist/chunk-YHG74UFF.js +0 -12
@@ -3,7 +3,7 @@ import {
3
3
  HOOK_LOCATOR_BINARY,
4
4
  isReleaseVersion,
5
5
  withHookHoldBudget
6
- } from "./chunk-YROGUPOZ.js";
6
+ } from "./chunk-WWTLAZQA.js";
7
7
 
8
8
  // src/npm.ts
9
9
  import { execFileSync, execSync } from "child_process";
@@ -56,6 +56,32 @@ var resolvePathBinary = (name, platform = process.platform) => {
56
56
  return void 0;
57
57
  }
58
58
  };
59
+ var NPM_MISSING_MESSAGE = "npm is not on PATH, and the hooks run from a global npm install.";
60
+ var NPM_LOOKUP = process.platform === "win32" ? "where npm" : "command -v npm";
61
+ var npmIsOnPath = () => {
62
+ try {
63
+ execSync(NPM_LOOKUP, { env: cleanNpmEnv(), stdio: "ignore", timeout: 5e3 });
64
+ return true;
65
+ } catch {
66
+ return false;
67
+ }
68
+ };
69
+ var GLOBAL_LIST_TIMEOUT_MS = 3e4;
70
+ var globalPackageState = (name) => {
71
+ try {
72
+ const listing = JSON.parse(execNpm("list -g --depth=0 --json --no-workspaces", { timeout: GLOBAL_LIST_TIMEOUT_MS }).toString());
73
+ const dependencies = typeof listing === "object" && listing !== null && "dependencies" in listing ? listing.dependencies : void 0;
74
+ return typeof dependencies === "object" && dependencies !== null && name in dependencies ? "installed" : "absent";
75
+ } catch {
76
+ return "unknown";
77
+ }
78
+ };
79
+ var NpmMissingError = class extends Error {
80
+ constructor() {
81
+ super(NPM_MISSING_MESSAGE);
82
+ this.name = "NpmMissingError";
83
+ }
84
+ };
59
85
  var resolveBinary = (name) => resolveGlobalBinary(name) ?? resolvePathBinary(name);
60
86
  var resolvePackageVersionFromBinary = (binary, packageName) => {
61
87
  try {
@@ -176,6 +202,7 @@ var installGlobally = (options) => {
176
202
  return installState.then((result) => result === "installed" ? "cached" : result);
177
203
  }
178
204
  const started = (async () => {
205
+ if (!npmIsOnPath()) throw new NpmMissingError();
179
206
  const pinned = process.env.PUSHARY_PIN_GLOBAL_VERSION !== "0";
180
207
  if (pinned && !needsGlobalInstall(
181
208
  options.version,
@@ -244,10 +271,6 @@ var guardedArgv = (target, args = [], platform = process.platform) => {
244
271
  return [shell, ...shellArgs, HOOK_GUARD_SCRIPTS[guardKindOf(target)], path, ...args];
245
272
  };
246
273
 
247
- // src/removal-scope.ts
248
- var namesAppLocator = (command) => command.includes(HOOK_LOCATOR_BINARY);
249
- var isProtectedByScope = (command, scope) => scope?.keepAppWiring === true && namesAppLocator(command);
250
-
251
274
  // src/codex-config.ts
252
275
  import { createHash } from "crypto";
253
276
  import { homedir } from "os";
@@ -299,6 +322,10 @@ var registerHookEntry = (existing, isOurs, entry) => {
299
322
  return rewritten;
300
323
  };
301
324
 
325
+ // src/removal-scope.ts
326
+ var namesAppLocator = (command) => command.includes(HOOK_LOCATOR_BINARY);
327
+ var isProtectedByScope = (command, scope) => scope?.keepAppWiring === true && namesAppLocator(command);
328
+
302
329
  // src/canonical-json.ts
303
330
  var canonicalJson = (value) => {
304
331
  if (value === null || typeof value !== "object") return JSON.stringify(value);
@@ -625,7 +652,9 @@ var autoUpdateLock = () => join3(pusharyDir(), "auto-update.lock");
625
652
  var autoUpdateLog = () => join3(pusharyDir(), "logs", "auto-update.log");
626
653
  var clientReportClaims = () => join3(pusharyDir(), "client-reports");
627
654
  var claudeRegistrationReceipt = () => join3(pusharyDir(), "setup", "claude-registration.json");
655
+ var hermesConfig = () => join3(homedir2(), ".hermes", "config.yaml");
628
656
  var hermesConfigReceipt = () => join3(pusharyDir(), "setup", "hermes-config.json");
657
+ var fxQuestionRuleReceipt = () => join3(pusharyDir(), "setup", "fx-question-rule.json");
629
658
  var hookTakeoverReceipt = (agent) => join3(pusharyDir(), "setup", `hook-takeover-${agent}.json`);
630
659
  var codexSkillDir2 = () => join3(codexHome(), "skills", "pushary");
631
660
  var codexAgentsMd2 = () => join3(codexHome(), "AGENTS.md");
@@ -641,11 +670,15 @@ export {
641
670
  registeredCommands,
642
671
  namesOurBinary,
643
672
  registrationHolderOf,
673
+ AGENT_HOOKS_PACKAGE,
644
674
  LATEST_TAG,
645
675
  npmErrorMessage,
646
676
  execNpm,
647
677
  resolveGlobalBinary,
648
678
  resolvePathBinary,
679
+ npmIsOnPath,
680
+ globalPackageState,
681
+ NpmMissingError,
649
682
  resolveBinary,
650
683
  resolvePackageVersionFromBinary,
651
684
  resolveGlobalPackageVersion,
@@ -703,7 +736,9 @@ export {
703
736
  autoUpdateLog,
704
737
  clientReportClaims,
705
738
  claudeRegistrationReceipt,
739
+ hermesConfig,
706
740
  hermesConfigReceipt,
741
+ fxQuestionRuleReceipt,
707
742
  hookTakeoverReceipt,
708
743
  codexSkillDir2,
709
744
  codexAgentsMd2,
@@ -1,21 +1,21 @@
1
1
  import {
2
2
  detectClaudeVersion
3
- } from "./chunk-O2LEPIU6.js";
3
+ } from "./chunk-U3MS6D5X.js";
4
4
  import {
5
5
  ensureCodexTrustsPusharyHooks
6
- } from "./chunk-7OS4IHGI.js";
6
+ } from "./chunk-5GIBNUBD.js";
7
7
  import {
8
8
  addClaudeMcpServer,
9
9
  addPusharyHooks,
10
10
  addPusharyToolPermissions
11
- } from "./chunk-KYQXUGH7.js";
11
+ } from "./chunk-KAJT6HPI.js";
12
12
  import {
13
13
  claudeUnprovenHolds,
14
14
  claudeWired,
15
15
  codexUnprovenHolds,
16
16
  codexWired,
17
17
  geminiWired
18
- } from "./chunk-PQ4F64M2.js";
18
+ } from "./chunk-L6IF4JOF.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-ZQ7IDOKY.js";
30
+ } from "./chunk-A6WQF7FQ.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-DNJUSFBL.js";
50
+ } from "./chunk-NYBZJ44G.js";
51
51
  import {
52
52
  readJsonSafe,
53
53
  writeFileAtomic,
@@ -1,10 +1,10 @@
1
+ import {
2
+ createIo
3
+ } from "./chunk-U4TMAANR.js";
1
4
  import {
2
5
  describeKeyCheck,
3
6
  keyCheckFromResponse
4
- } from "./chunk-X6KDKOV5.js";
5
- import {
6
- createIo
7
- } from "./chunk-5RUIFDTP.js";
7
+ } from "./chunk-VQDJ6KB3.js";
8
8
  import {
9
9
  EXIT
10
10
  } from "./chunk-KZERVKTD.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  pusharyDir
3
- } from "./chunk-DNJUSFBL.js";
3
+ } from "./chunk-NYBZJ44G.js";
4
4
  import {
5
5
  readJsonSafe
6
6
  } from "./chunk-T7E75EKA.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  readTranscriptPreference
3
- } from "./chunk-UOAQ6QMP.js";
3
+ } from "./chunk-VSGKQ3HI.js";
4
4
 
5
5
  // src/transcript-setting.ts
6
6
  var transcriptEnvironmentPreference = () => {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getBaseUrl
3
- } from "./chunk-V4AQBAVG.js";
3
+ } from "./chunk-SJN64NJX.js";
4
4
 
5
5
  // src/transcript-api.ts
6
6
  var fetchTranscriptRecipients = async (apiKey, baseUrl = getBaseUrl()) => {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  redactSecrets
3
- } from "./chunk-YROGUPOZ.js";
3
+ } from "./chunk-WWTLAZQA.js";
4
4
 
5
5
  // src/crypto.ts
6
6
  import nacl from "tweetnacl";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  PRETOOLUSE_GATED_TOOLS
3
- } from "./chunk-YROGUPOZ.js";
3
+ } from "./chunk-WWTLAZQA.js";
4
4
 
5
5
  // src/claude-tools.ts
6
6
  var POSTTOOLUSE_MIRROR_ONLY_TOOLS = ["TodoWrite", "Task", "WebFetch", "WebSearch"];
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  HOOK_HOLD_BUDGET_ENV,
3
3
  hookHoldBudgetProof
4
- } from "./chunk-YROGUPOZ.js";
4
+ } from "./chunk-WWTLAZQA.js";
5
5
 
6
6
  // src/hold-budget.ts
7
7
  var takeHookHoldBudget = (args = process.argv.slice(2), env = process.env) => {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  NPX_LATEST_COMMAND
3
- } from "./chunk-B3UXMSMW.js";
3
+ } from "./chunk-65RN6ZCO.js";
4
4
 
5
5
  // src/config.ts
6
6
  import { readFileSync } from "fs";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  HOOK_BUDGETS,
3
3
  OPENCODE_APPROVAL_EVENT
4
- } from "./chunk-YROGUPOZ.js";
4
+ } from "./chunk-WWTLAZQA.js";
5
5
 
6
6
  // src/opencode-plugin.ts
7
7
  var OPENCODE_PLUGIN_MARKER = "pushary-opencode-plugin w1";