@pushary/agent-hooks 1.9.152 → 1.9.154

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 (136) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/{api-IQMAAMIS.js → api-U7VCJ5IJ.js} +11 -11
  3. package/dist/bin/pushary-audit.js +3 -3
  4. package/dist/bin/pushary-bell-hook.js +28 -28
  5. package/dist/bin/pushary-bell.js +11 -11
  6. package/dist/bin/pushary-claude.js +27 -27
  7. package/dist/bin/pushary-clean.js +37 -37
  8. package/dist/bin/pushary-codex-bridge.js +23 -23
  9. package/dist/bin/pushary-codex-hook.js +35 -35
  10. package/dist/bin/pushary-codex-session.js +8 -8
  11. package/dist/bin/pushary-codex.js +16 -16
  12. package/dist/bin/pushary-connect.js +33 -33
  13. package/dist/bin/pushary-cowork.js +5 -5
  14. package/dist/bin/pushary-daemon.js +44 -44
  15. package/dist/bin/pushary-disconnect.js +28 -28
  16. package/dist/bin/pushary-display-hook.js +49 -42
  17. package/dist/bin/pushary-doctor.js +45 -45
  18. package/dist/bin/pushary-elicitation-hook.js +28 -28
  19. package/dist/bin/pushary-gemini-bridge.js +17 -17
  20. package/dist/bin/pushary-gemini-hook.js +32 -32
  21. package/dist/bin/pushary-hook.js +35 -35
  22. package/dist/bin/pushary-login.js +22 -22
  23. package/dist/bin/pushary-logout.js +28 -28
  24. package/dist/bin/pushary-mcp.js +12 -12
  25. package/dist/bin/pushary-mode.js +16 -16
  26. package/dist/bin/pushary-notification-hook.js +27 -27
  27. package/dist/bin/pushary-opencode-hook.js +31 -31
  28. package/dist/bin/pushary-permission-denied-hook.js +35 -35
  29. package/dist/bin/pushary-permission-hook.js +35 -35
  30. package/dist/bin/pushary-post-hook.js +28 -28
  31. package/dist/bin/pushary-prompt-hook.js +27 -27
  32. package/dist/bin/pushary-session-end-hook.js +27 -27
  33. package/dist/bin/pushary-session-start-hook.js +37 -37
  34. package/dist/bin/pushary-setup.js +61 -70
  35. package/dist/bin/pushary-stats.js +5 -5
  36. package/dist/bin/pushary-status.js +34 -34
  37. package/dist/bin/pushary-stop-hook.js +27 -27
  38. package/dist/bin/pushary-stopfailure-hook.js +27 -27
  39. package/dist/bin/pushary-suggestions.js +16 -16
  40. package/dist/bin/pushary-transcript-register.js +17 -17
  41. package/dist/bin/pushary-transcripts.js +25 -25
  42. package/dist/bin/pushary-upgrade.js +43 -44
  43. package/dist/bin/pushary-wait.js +16 -16
  44. package/dist/bin/pushary.js +7 -7
  45. package/dist/{chunk-3N5RC7KI.js → chunk-2GHUVGB5.js} +3 -3
  46. package/dist/{chunk-K73XYVAI.js → chunk-3OWCINUY.js} +8 -8
  47. package/dist/{chunk-P474YA7K.js → chunk-3UONQKDQ.js} +1 -1
  48. package/dist/{chunk-ZUS334Z2.js → chunk-4E6PCUYJ.js} +8 -2
  49. package/dist/{chunk-JKP27CWR.js → chunk-5EEIROLA.js} +1 -1
  50. package/dist/{chunk-VAXPBUY7.js → chunk-6DAAURLB.js} +2 -2
  51. package/dist/{chunk-PDALRESB.js → chunk-6EOSF7WR.js} +8 -8
  52. package/dist/{chunk-H3W3GRV6.js → chunk-6FGTTNP4.js} +1 -1
  53. package/dist/{chunk-F5KUZBN7.js → chunk-6TBHP6RP.js} +6 -6
  54. package/dist/{chunk-YELJYFSC.js → chunk-6VMXXBSZ.js} +4 -4
  55. package/dist/{chunk-KSQOSFWU.js → chunk-7LOWA7WF.js} +3 -3
  56. package/dist/{chunk-HZUVLAWB.js → chunk-AIQRVNWO.js} +6 -6
  57. package/dist/{chunk-MIVJN6UX.js → chunk-AM5FQTVF.js} +2 -2
  58. package/dist/{chunk-BEGXHUFW.js → chunk-BEYMW4FP.js} +7 -2
  59. package/dist/{chunk-K3RITWPY.js → chunk-BKG7F3AY.js} +4 -4
  60. package/dist/{chunk-HYKV5VFO.js → chunk-BR5Z4FYW.js} +3 -3
  61. package/dist/{chunk-IZIUWALV.js → chunk-C6KJ3X7U.js} +5 -5
  62. package/dist/{chunk-GBVNCGF5.js → chunk-DGLRLNQZ.js} +1 -1
  63. package/dist/{chunk-672GQ3QP.js → chunk-DWWR4G3U.js} +3 -3
  64. package/dist/{chunk-NWRILLTQ.js → chunk-E2H5IGMP.js} +3 -3
  65. package/dist/{chunk-AVB5ZJRA.js → chunk-EENGXQP2.js} +1 -1
  66. package/dist/{chunk-NPRN6U2N.js → chunk-ESATURKU.js} +4 -4
  67. package/dist/{chunk-43XJ7U63.js → chunk-EUAMAIHV.js} +2 -2
  68. package/dist/{chunk-UYWRWMVG.js → chunk-F6EPRJDF.js} +3 -3
  69. package/dist/{chunk-JHYXXSXE.js → chunk-FFFAXIYH.js} +11 -9
  70. package/dist/{chunk-LFMW5JU5.js → chunk-FUZ3KIA2.js} +1 -1
  71. package/dist/{chunk-WF4GAVIZ.js → chunk-H7TZUYPP.js} +4 -4
  72. package/dist/{chunk-W26FWH7E.js → chunk-IFYBTFGJ.js} +1 -1
  73. package/dist/{chunk-VJCNWZWT.js → chunk-JPXW7CB3.js} +1 -1
  74. package/dist/{chunk-ZYES37XJ.js → chunk-KCDOQU2Y.js} +4 -4
  75. package/dist/{chunk-YM2T76UM.js → chunk-KMOVQIU7.js} +7 -2
  76. package/dist/{chunk-H3PD7NM6.js → chunk-L7KV5SEW.js} +2 -2
  77. package/dist/{chunk-J7ZT4QIS.js → chunk-LJQKVACR.js} +5 -5
  78. package/dist/{chunk-YGC22HOG.js → chunk-LPAPVM5J.js} +1 -1
  79. package/dist/{chunk-2PWQQ5S4.js → chunk-LQFGVGHE.js} +1 -1
  80. package/dist/{chunk-RPGXFONU.js → chunk-LQZYHSDL.js} +5 -5
  81. package/dist/{chunk-ITQPLAJU.js → chunk-LROV5XIM.js} +6 -6
  82. package/dist/{chunk-BVI7NBGK.js → chunk-MIWMGFYJ.js} +3 -3
  83. package/dist/{chunk-AHAVUAFN.js → chunk-MPNAKEEI.js} +2 -2
  84. package/dist/{chunk-USJEAJBM.js → chunk-MRAC3IOW.js} +1 -1
  85. package/dist/{chunk-HDG5E3KL.js → chunk-MVPRF6G3.js} +3 -3
  86. package/dist/{chunk-GRKS5KRJ.js → chunk-O2DQIATJ.js} +1 -1
  87. package/dist/{chunk-ED6YWQEU.js → chunk-O5KXQCKS.js} +4 -4
  88. package/dist/{chunk-2PCWFDLS.js → chunk-OKOEWPAM.js} +5 -5
  89. package/dist/{chunk-7T75RUZJ.js → chunk-ORELODI4.js} +1 -1
  90. package/dist/{chunk-XNZT3Y3Y.js → chunk-PW2ZTLGS.js} +2 -2
  91. package/dist/{chunk-VMGVFV4F.js → chunk-QIZO2G57.js} +4 -4
  92. package/dist/{chunk-6B5OLJFA.js → chunk-QPOYAD62.js} +1 -1
  93. package/dist/{chunk-IQ6ZOIJW.js → chunk-QV6HCQ2K.js} +11 -11
  94. package/dist/{chunk-SI4WLQRD.js → chunk-QZ4YXAKG.js} +22 -23
  95. package/dist/{chunk-6U4HTJDH.js → chunk-RCTJEXGN.js} +6 -6
  96. package/dist/{chunk-7THR5LFY.js → chunk-RKBWMWPM.js} +2 -2
  97. package/dist/{chunk-SY75XL7K.js → chunk-ROBVIQWZ.js} +1 -1
  98. package/dist/{chunk-UBOZHYDV.js → chunk-RUVSBWXC.js} +2 -2
  99. package/dist/{chunk-43TBZRPG.js → chunk-S4GSEFRL.js} +1 -1
  100. package/dist/{chunk-X5ECZTDF.js → chunk-STDH6IE7.js} +8 -8
  101. package/dist/{chunk-2NEN7KVF.js → chunk-TJUUA3NF.js} +2 -2
  102. package/dist/{chunk-4RFLYU65.js → chunk-TTFJOZZN.js} +1 -1
  103. package/dist/{chunk-E2ZX6DAP.js → chunk-TVD6FKNF.js} +7 -7
  104. package/dist/{chunk-4LVISHV6.js → chunk-TVV7NN6T.js} +1 -1
  105. package/dist/{chunk-4P4G4AGP.js → chunk-UNHFYYUM.js} +3 -3
  106. package/dist/{chunk-4BUSJQJH.js → chunk-UWPNSMAA.js} +11 -9
  107. package/dist/{chunk-OOIX6OGT.js → chunk-VNODGGX7.js} +2 -2
  108. package/dist/{chunk-ESHJ67UO.js → chunk-X64VKAZJ.js} +4 -4
  109. package/dist/{chunk-YKCACY4F.js → chunk-X6LMBS26.js} +2 -2
  110. package/dist/{chunk-ADZQYXHK.js → chunk-X7IKZNRX.js} +5 -5
  111. package/dist/{chunk-4NZORVWS.js → chunk-XBUFMVU7.js} +10 -10
  112. package/dist/{chunk-6FIQQLB4.js → chunk-XWJVSAVU.js} +3 -3
  113. package/dist/{chunk-ISF5ESY4.js → chunk-YMCLBYAQ.js} +1 -1
  114. package/dist/{chunk-WUFOQ3BO.js → chunk-YOCSXG3N.js} +5 -5
  115. package/dist/{chunk-FT4V3IJ2.js → chunk-ZFYZV7WG.js} +16 -16
  116. package/dist/{chunk-QXD25T2R.js → chunk-ZGTQW6XD.js} +5 -5
  117. package/dist/{chunk-XVIPSHT3.js → chunk-ZJMS2BWD.js} +3 -3
  118. package/dist/{chunk-BKXMMYEJ.js → chunk-ZKFYBNHA.js} +5 -5
  119. package/dist/{chunk-DJCTVJR4.js → chunk-ZO2GP56D.js} +6 -23
  120. package/dist/{chunk-G7UI7IQN.js → chunk-ZWLH3BXV.js} +2 -2
  121. package/dist/{chunk-NLEUWI4M.js → chunk-ZYAPD2XN.js} +12 -12
  122. package/dist/{chunk-XTIUW3CE.js → chunk-ZZFNKGFE.js} +5 -5
  123. package/dist/{codex-app-cards-switch-ZC2QNMYV.js → codex-app-cards-switch-GNJRPEMD.js} +11 -11
  124. package/dist/{codex-card-routing-7S6SQSCN.js → codex-card-routing-KAAZTFYE.js} +2 -2
  125. package/dist/{codex-desktop-launch-7A7YFJEW.js → codex-desktop-launch-5YZ4WCA4.js} +1 -1
  126. package/dist/{codex-session-launch-6TN6U52H.js → codex-session-launch-P3ZUEJQI.js} +20 -20
  127. package/dist/{config-GC6NPWRS.js → config-HOIM5RUY.js} +4 -3
  128. package/dist/{global-upgrade-2QO2GEFD.js → global-upgrade-3TX5MDOW.js} +9 -9
  129. package/dist/{identity-7K2E5ZRO.js → identity-J2AVMZVV.js} +4 -4
  130. package/dist/{live-capabilities-6WMTLNQN.js → live-capabilities-CRNMW6RF.js} +4 -4
  131. package/dist/{paths-BJUKHDVE.js → paths-BWOEOPPJ.js} +3 -3
  132. package/dist/{reapply-ODUBZT4P.js → reapply-QQGXNOW5.js} +30 -30
  133. package/dist/src/index.js +34 -34
  134. package/dist/{upgrade-lock-N6FDN5Z7.js → upgrade-lock-ET4ON56I.js} +4 -6
  135. package/dist/{usage-4PYAM3IB.js → usage-NVLSP3QT.js} +3 -3
  136. package/package.json +1 -1
@@ -7,7 +7,7 @@ import {
7
7
  } from "./chunk-BG4HHB7E.js";
8
8
  import {
9
9
  redactSecretsFromContent
10
- } from "./chunk-BEGXHUFW.js";
10
+ } from "./chunk-BEYMW4FP.js";
11
11
 
12
12
  // src/cli/json.ts
13
13
  var writeStdoutFully = (text) => new Promise((resolve, reject) => {
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  CODEX_HOOK_STATUS
3
- } from "./chunk-7THR5LFY.js";
3
+ } from "./chunk-RKBWMWPM.js";
4
4
  import {
5
5
  HERMES_ALWAYS_ALLOWED_SHELL_RULE,
6
6
  HERMES_COMMAND_ALLOWLIST_KEY,
7
7
  HERMES_GATE_TOOLS_KEY,
8
8
  HERMES_SHELL_TOOL
9
- } from "./chunk-YELJYFSC.js";
9
+ } from "./chunk-6VMXXBSZ.js";
10
10
  import {
11
11
  retryAgentCommand
12
- } from "./chunk-NWRILLTQ.js";
12
+ } from "./chunk-E2H5IGMP.js";
13
13
  import {
14
14
  NPX_LATEST_COMMAND
15
- } from "./chunk-ZUS334Z2.js";
15
+ } from "./chunk-4E6PCUYJ.js";
16
16
 
17
17
  // src/setup/codex-trust.ts
18
18
  var CODEX_TRUST_TELEMETRY = {
@@ -1,3 +1,7 @@
1
+ import {
2
+ redactSecretsFromContent
3
+ } from "./chunk-BEYMW4FP.js";
4
+
1
5
  // src/cli/terminal-row.ts
2
6
  var visibleLength = (text) => text.replace(/\x1b\[[0-9;]*m/g, "").length;
3
7
  var clipToRow = (text, columns) => {
@@ -74,9 +78,9 @@ var describeError = (err) => {
74
78
  if (signalled.killed && signalled.signal === "SIGTERM") {
75
79
  return "timed out, check your network connection";
76
80
  }
77
- return err.message;
81
+ return redactSecretsFromContent(err.message);
78
82
  }
79
- return String(err);
83
+ return redactSecretsFromContent(String(err));
80
84
  };
81
85
  var createIo = (stream = process.stdout, context = {}) => {
82
86
  const color = useColor(context, stream);
@@ -134,5 +138,6 @@ export {
134
138
  ciMarker,
135
139
  isCI,
136
140
  describeCiReason,
141
+ describeError,
137
142
  createIo
138
143
  };
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  configFilePath
3
- } from "./chunk-LFMW5JU5.js";
3
+ } from "./chunk-FUZ3KIA2.js";
4
4
  import {
5
5
  normalizeInstallSource
6
- } from "./chunk-BEGXHUFW.js";
6
+ } from "./chunk-BEYMW4FP.js";
7
7
 
8
8
  // src/install-source.ts
9
9
  import { readFileSync } from "fs";
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  announceSubscriptionRequired,
3
3
  isDeferAnswer
4
- } from "./chunk-SY75XL7K.js";
4
+ } from "./chunk-ROBVIQWZ.js";
5
5
  import {
6
6
  askUser,
7
7
  isDecisionStopped,
8
8
  isQuestionLimitRefusal,
9
9
  waitForQuestion
10
- } from "./chunk-F5KUZBN7.js";
10
+ } from "./chunk-6TBHP6RP.js";
11
11
  import {
12
12
  SubscriptionRequiredError
13
- } from "./chunk-WUFOQ3BO.js";
13
+ } from "./chunk-YOCSXG3N.js";
14
14
  import {
15
15
  getMachineId
16
- } from "./chunk-ISF5ESY4.js";
16
+ } from "./chunk-YMCLBYAQ.js";
17
17
  import {
18
18
  ASK_CONTEXT_MAX,
19
19
  agentQuestionContext,
@@ -23,7 +23,7 @@ import {
23
23
  plainAskOf,
24
24
  questionsShownAsASet,
25
25
  shouldDeferToNativeMode
26
- } from "./chunk-BEGXHUFW.js";
26
+ } from "./chunk-BEYMW4FP.js";
27
27
 
28
28
  // src/native-defer.ts
29
29
  var nativeDeferOptions = () => {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isFinalCommandAckRefusal
3
- } from "./chunk-BEGXHUFW.js";
3
+ } from "./chunk-BEYMW4FP.js";
4
4
 
5
5
  // src/command-ack-outcome.ts
6
6
  var SETTLED_ACK = { outcome: "settled" };
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-BG4HHB7E.js";
4
4
  import {
5
5
  renderCommandHelp
6
- } from "./chunk-ZUS334Z2.js";
6
+ } from "./chunk-4E6PCUYJ.js";
7
7
  import {
8
8
  getPackageVersion
9
9
  } from "./chunk-WIIMW5YO.js";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  addGeminiMcpServer,
3
3
  removeGeminiMcpServer
4
- } from "./chunk-VMGVFV4F.js";
4
+ } from "./chunk-QIZO2G57.js";
5
5
  import {
6
6
  CLAUDE_CODE_AGENT
7
- } from "./chunk-NLEUWI4M.js";
7
+ } from "./chunk-ZYAPD2XN.js";
8
8
  import {
9
9
  compatibleToolLookup
10
- } from "./chunk-JKP27CWR.js";
10
+ } from "./chunk-5EEIROLA.js";
11
11
  import {
12
12
  CLAUDE_HOOK_EVENTS,
13
13
  PUSHARY_MCP_URL,
@@ -19,7 +19,7 @@ import {
19
19
  isPusharyHook,
20
20
  registerHookEntry,
21
21
  removeClaudeMcpServers
22
- } from "./chunk-YKCACY4F.js";
22
+ } from "./chunk-X6LMBS26.js";
23
23
  import {
24
24
  HOOK_COMPATIBLE_PROFILES,
25
25
  PHONE_ANSWERED_TOOLS,
@@ -30,7 +30,7 @@ import {
30
30
  pusharyMissingReason,
31
31
  refusalOutput,
32
32
  withHookHoldBudget
33
- } from "./chunk-BEGXHUFW.js";
33
+ } from "./chunk-BEYMW4FP.js";
34
34
 
35
35
  // src/config-document.ts
36
36
  import { parse, stringify } from "smol-toml";
@@ -4,19 +4,19 @@ import {
4
4
  } from "./chunk-H6CL3T2S.js";
5
5
  import {
6
6
  getMachineId
7
- } from "./chunk-ISF5ESY4.js";
7
+ } from "./chunk-YMCLBYAQ.js";
8
8
  import {
9
9
  readControlMode
10
- } from "./chunk-KSQOSFWU.js";
10
+ } from "./chunk-7LOWA7WF.js";
11
11
  import {
12
12
  pusharyDir
13
- } from "./chunk-YKCACY4F.js";
13
+ } from "./chunk-X6LMBS26.js";
14
14
  import {
15
15
  resolveGlobalBinary
16
- } from "./chunk-SI4WLQRD.js";
16
+ } from "./chunk-QZ4YXAKG.js";
17
17
  import {
18
18
  getApiKey
19
- } from "./chunk-LFMW5JU5.js";
19
+ } from "./chunk-FUZ3KIA2.js";
20
20
  import {
21
21
  readJsonSafe,
22
22
  writeFileAtomic,
@@ -32,7 +32,7 @@ import {
32
32
  } from "./chunk-WIIMW5YO.js";
33
33
  import {
34
34
  isRecord
35
- } from "./chunk-BEGXHUFW.js";
35
+ } from "./chunk-BEYMW4FP.js";
36
36
 
37
37
  // src/daemon-entry-guard.ts
38
38
  import { mkdirSync, readFileSync } from "fs";
@@ -4,15 +4,15 @@ import {
4
4
  claimThrottle,
5
5
  releaseThrottle,
6
6
  reportEvent
7
- } from "./chunk-NLEUWI4M.js";
7
+ } from "./chunk-ZYAPD2XN.js";
8
8
  import {
9
9
  deriveToolTarget,
10
10
  permissionDeniedAction
11
- } from "./chunk-JKP27CWR.js";
11
+ } from "./chunk-5EEIROLA.js";
12
12
  import {
13
13
  machineDecisionFor,
14
14
  wireVerdictFor
15
- } from "./chunk-BEGXHUFW.js";
15
+ } from "./chunk-BEYMW4FP.js";
16
16
 
17
17
  // src/machine-decision-audit.ts
18
18
  import { basename } from "path";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  claudeConfigDir
3
- } from "./chunk-YKCACY4F.js";
3
+ } from "./chunk-X6LMBS26.js";
4
4
  import {
5
5
  claudePermissionRulesFromSettings
6
- } from "./chunk-BEGXHUFW.js";
6
+ } from "./chunk-BEYMW4FP.js";
7
7
 
8
8
  // src/claude-permission-rules.ts
9
9
  import { readFileSync, statSync } from "fs";
@@ -10,7 +10,7 @@ import {
10
10
  uploadTranscriptRecords,
11
11
  verifyAnchoredRecipients,
12
12
  wrapSessionKey
13
- } from "./chunk-XVIPSHT3.js";
13
+ } from "./chunk-ZJMS2BWD.js";
14
14
 
15
15
  // src/live-session.ts
16
16
  var LIVE_TRANSCRIPT_LIMITS = { queuedRecords: 100, recordCharacters: 32 * 1024 };
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  readExistingMachineId
3
- } from "./chunk-ISF5ESY4.js";
3
+ } from "./chunk-YMCLBYAQ.js";
4
4
  import {
5
5
  NetworkError
6
6
  } from "./chunk-YU2EUD7O.js";
7
7
  import {
8
8
  getBaseUrl
9
- } from "./chunk-LFMW5JU5.js";
9
+ } from "./chunk-FUZ3KIA2.js";
10
10
  import {
11
11
  getPackageVersion
12
12
  } from "./chunk-WIIMW5YO.js";
13
13
  import {
14
14
  clientContextHeaders,
15
15
  redactSecretsFromContent
16
- } from "./chunk-BEGXHUFW.js";
16
+ } from "./chunk-BEYMW4FP.js";
17
17
 
18
18
  // src/cli/net.ts
19
19
  import { createRequire } from "module";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  readTranscriptPreference
3
- } from "./chunk-KSQOSFWU.js";
3
+ } from "./chunk-7LOWA7WF.js";
4
4
 
5
5
  // src/transcript-setting.ts
6
6
  var transcriptEnvironmentPreference = () => {
@@ -1,21 +1,21 @@
1
1
  import {
2
2
  UNNAMED_ACTION
3
- } from "./chunk-JKP27CWR.js";
3
+ } from "./chunk-5EEIROLA.js";
4
4
  import {
5
5
  askUser,
6
6
  isAwayPaused,
7
7
  isLocalQuestionHandoff,
8
8
  unavailableQuestionUnlessRefused,
9
9
  waitForQuestion
10
- } from "./chunk-F5KUZBN7.js";
10
+ } from "./chunk-6TBHP6RP.js";
11
11
  import {
12
12
  getMachineId
13
- } from "./chunk-ISF5ESY4.js";
13
+ } from "./chunk-YMCLBYAQ.js";
14
14
  import {
15
15
  hookWaitClamped,
16
16
  hookWaitDeadline,
17
17
  scopeBreachReasonOf
18
- } from "./chunk-BEGXHUFW.js";
18
+ } from "./chunk-BEYMW4FP.js";
19
19
 
20
20
  // src/pushed-question.ts
21
21
  var scopeQuestionOf = (verdict) => {
@@ -4,13 +4,13 @@ import {
4
4
  configFailureKind,
5
5
  retryAgentCommand,
6
6
  writeSetupConfigFile
7
- } from "./chunk-NWRILLTQ.js";
7
+ } from "./chunk-E2H5IGMP.js";
8
8
  import {
9
9
  MCP_BRIDGE_BINARY
10
- } from "./chunk-4P4G4AGP.js";
10
+ } from "./chunk-UNHFYYUM.js";
11
11
  import {
12
12
  KEY_FILE_MODE
13
- } from "./chunk-KSQOSFWU.js";
13
+ } from "./chunk-7LOWA7WF.js";
14
14
  import {
15
15
  CLINE_SERVER_NAME_TAKEN,
16
16
  CLINE_SETTINGS_REFUSALS,
@@ -32,10 +32,10 @@ import {
32
32
  withClinePusharyServer,
33
33
  withRefreshedClineKey,
34
34
  withoutClinePusharyServer
35
- } from "./chunk-YKCACY4F.js";
35
+ } from "./chunk-X6LMBS26.js";
36
36
  import {
37
37
  resolveGlobalBinary
38
- } from "./chunk-SI4WLQRD.js";
38
+ } from "./chunk-QZ4YXAKG.js";
39
39
  import {
40
40
  readJsonSafe,
41
41
  writeFileAtomic,
@@ -9,7 +9,7 @@ import {
9
9
  isSetupConnectMode,
10
10
  isValidApiKey,
11
11
  normalizeAgentId
12
- } from "./chunk-BEGXHUFW.js";
12
+ } from "./chunk-BEYMW4FP.js";
13
13
 
14
14
  // src/setup/options.ts
15
15
  var AGENT_CHOICES = SETUP_AGENT_CHOICES;
@@ -3,10 +3,10 @@ import {
3
3
  } from "./chunk-CYTPQDQY.js";
4
4
  import {
5
5
  parseVersion
6
- } from "./chunk-SI4WLQRD.js";
6
+ } from "./chunk-QZ4YXAKG.js";
7
7
  import {
8
8
  isRecord
9
- } from "./chunk-BEGXHUFW.js";
9
+ } from "./chunk-BEYMW4FP.js";
10
10
 
11
11
  // src/setup/agent-probe.ts
12
12
  import { execSync } from "child_process";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  AGENT_CHOICES
3
- } from "./chunk-7T75RUZJ.js";
3
+ } from "./chunk-ORELODI4.js";
4
4
  import {
5
5
  BELL_HOOK_BINARY
6
- } from "./chunk-6B5OLJFA.js";
6
+ } from "./chunk-QPOYAD62.js";
7
7
  import {
8
8
  CLAUDE_HOOK_EVENTS,
9
9
  CODEX_HOOK_EVENTS,
@@ -16,13 +16,13 @@ import {
16
16
  isBridgeLocator,
17
17
  isProtectedByScope,
18
18
  registerHookEntry
19
- } from "./chunk-YKCACY4F.js";
19
+ } from "./chunk-X6LMBS26.js";
20
20
  import {
21
21
  CURSOR_GATE_EVENTS,
22
22
  HOOK_BUDGETS,
23
23
  HOOK_LOCATOR_BINARY,
24
24
  hookCommandHoldBudget
25
- } from "./chunk-BEGXHUFW.js";
25
+ } from "./chunk-BEYMW4FP.js";
26
26
 
27
27
  // src/gemini-config.ts
28
28
  var GEMINI_HOOK_BINARY = "pushary-gemini-hook";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  guardBinary
3
- } from "./chunk-YKCACY4F.js";
3
+ } from "./chunk-X6LMBS26.js";
4
4
 
5
5
  // src/bell/install.ts
6
6
  import { join } from "path";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ensureCodexTrustsPusharyHooks
3
- } from "./chunk-7THR5LFY.js";
3
+ } from "./chunk-RKBWMWPM.js";
4
4
  import {
5
5
  hermesReceiptPaths,
6
6
  hermesSetupPredatesThePluginFolder,
@@ -9,7 +9,7 @@ import {
9
9
  refreshHermesPluginFiles,
10
10
  refreshOpenClawPlugin,
11
11
  shippedHermesPlugin
12
- } from "./chunk-YELJYFSC.js";
12
+ } from "./chunk-6VMXXBSZ.js";
13
13
  import {
14
14
  fxIgnoresInstructionsFile,
15
15
  fxInstructionsBody,
@@ -18,7 +18,7 @@ import {
18
18
  macAppFxBridge,
19
19
  refreshClineKey,
20
20
  switchFxHttpEntryToBridge
21
- } from "./chunk-2PCWFDLS.js";
21
+ } from "./chunk-OKOEWPAM.js";
22
22
  import {
23
23
  OPENCODE_HOOK_BINARY,
24
24
  agentHookOwner,
@@ -30,16 +30,16 @@ import {
30
30
  openCodePluginDir,
31
31
  openCodeWired,
32
32
  withOpenCodeAskRules
33
- } from "./chunk-QXD25T2R.js";
33
+ } from "./chunk-ZGTQW6XD.js";
34
34
  import {
35
35
  detectClaudeVersion
36
- } from "./chunk-XNZT3Y3Y.js";
36
+ } from "./chunk-PW2ZTLGS.js";
37
37
  import {
38
38
  addCompatibleHooks,
39
39
  compatibleConfigFile,
40
40
  compatibleInstructionsFile,
41
41
  hasCompatibleHooks
42
- } from "./chunk-RPGXFONU.js";
42
+ } from "./chunk-LQZYHSDL.js";
43
43
  import {
44
44
  GEMINI_HOOK_BINARY,
45
45
  addGeminiHooks,
@@ -51,10 +51,10 @@ import {
51
51
  geminiWired,
52
52
  hasGeminiHooks,
53
53
  planHooks
54
- } from "./chunk-VMGVFV4F.js";
54
+ } from "./chunk-QIZO2G57.js";
55
55
  import {
56
56
  KEY_FILE_MODE
57
- } from "./chunk-KSQOSFWU.js";
57
+ } from "./chunk-7LOWA7WF.js";
58
58
  import {
59
59
  CLAUDE_CODE_PUSHARY_PERMISSION_RULES,
60
60
  CLAUDE_HOOK_BINARY,
@@ -102,13 +102,13 @@ import {
102
102
  renderAgentInstructions,
103
103
  supportedClaudeEvents,
104
104
  vscodePluginMcp
105
- } from "./chunk-YKCACY4F.js";
105
+ } from "./chunk-X6LMBS26.js";
106
106
  import {
107
107
  formatVersion,
108
108
  hookCommandsUseBareNames,
109
109
  resolveGlobalBinDir,
110
110
  resolveGlobalBinary
111
- } from "./chunk-SI4WLQRD.js";
111
+ } from "./chunk-QZ4YXAKG.js";
112
112
  import {
113
113
  readJsonSafe,
114
114
  writeFileAtomic,
@@ -118,7 +118,7 @@ import {
118
118
  HOOK_COMPATIBLE_PROFILES,
119
119
  isCompatibleAgentType,
120
120
  isRecord
121
- } from "./chunk-BEGXHUFW.js";
121
+ } from "./chunk-BEYMW4FP.js";
122
122
 
123
123
  // src/reapply.ts
124
124
  import { dirname, join } from "path";
@@ -8,9 +8,13 @@ import {
8
8
  globalInstallTarget,
9
9
  globalPackageFolder,
10
10
  globalRootFor,
11
+ isNewerVersion,
11
12
  isReleaseVersion,
12
13
  ownPackageName
13
14
  } from "./chunk-WIIMW5YO.js";
15
+ import {
16
+ redactSecretsFromContent
17
+ } from "./chunk-BEYMW4FP.js";
14
18
 
15
19
  // src/shell-quote.ts
16
20
  var shellDoubleQuoted = (text) => `"${text.replace(/(["\\$`])/g, "\\$1")}"`;
@@ -22,7 +26,6 @@ import { existsSync, readFileSync, readlinkSync, realpathSync } from "fs";
22
26
  import { dirname, isAbsolute, join, relative, resolve, win32 } from "path";
23
27
  var latestReleaseUrl = (packageName) => `https://registry.npmjs.org/${packageName}/latest`;
24
28
  var REGISTRY_TIMEOUT_MS = 5e3;
25
- var LATEST_TAG = "latest";
26
29
  var cleanNpmEnv = () => {
27
30
  const env = {};
28
31
  for (const [key, value] of Object.entries(process.env)) {
@@ -33,10 +36,9 @@ var cleanNpmEnv = () => {
33
36
  };
34
37
  var NPM_ERROR_METADATA = /^(code|syscall|path|dest|errno)\s/i;
35
38
  var npmErrorMessage = (err) => {
36
- const e = err;
37
- const text = [e?.stderr, e?.stdout].map((part) => part ? part.toString() : "").join("\n");
39
+ const text = errorTextOf(err, ["stderr", "stdout"]).join("\n");
38
40
  const line = text.split("\n").map((l) => l.replace(/^npm error\s*/i, "").trim()).find((l) => l && !l.startsWith("A complete log") && !NPM_ERROR_METADATA.test(l));
39
- return line || e?.message || String(err);
41
+ return redactSecretsFromContent(line || errorTextOf(err, ["message"])[0] || String(err));
40
42
  };
41
43
  var execNpm = (args, options = {}) => {
42
44
  return execSync(`npm ${args}`, {
@@ -196,9 +198,9 @@ var NpmReleaseAgeError = class extends NpmInstallError {
196
198
  };
197
199
  var NPM_PERMISSION_CODE = /\b(EACCES|EPERM)\b/;
198
200
  var ERROR_TEXT_FIELDS = ["code", "stderr", "stdout", "message"];
199
- var errorTextOf = (err) => {
201
+ var errorTextOf = (err, fields = ERROR_TEXT_FIELDS) => {
200
202
  if (typeof err !== "object" || err === null) return [String(err)];
201
- return ERROR_TEXT_FIELDS.flatMap((field) => {
203
+ return fields.flatMap((field) => {
202
204
  const value = Reflect.get(err, field);
203
205
  return typeof value === "string" || Buffer.isBuffer(value) ? [value.toString()] : [];
204
206
  });
@@ -222,12 +224,6 @@ var npmExitedOnItsOwn = (error) => {
222
224
  return typeof status === "number" && Number.isSafeInteger(status) && status > 0 && !npmWasKilledBySignal(error);
223
225
  };
224
226
  var npmExitedOnReleaseAge = (error) => npmExitedOnItsOwn(error) && isNpmReleaseAgeFailure(error);
225
- var NPM_VERSION_UNAVAILABLE = /\b(ETARGET|E404)\b/;
226
- var npmExitedBeforeInstalling = (error) => npmExitedOnItsOwn(error) && errorTextOf(error).some((text) => NPM_VERSION_UNAVAILABLE.test(text));
227
- var npmExitedOnPermissionDenied = (err, platform) => {
228
- const code = npmPermissionCodeOf(err);
229
- return code !== null && npmPermissionFailureKind(code, platform) === "global-prefix" && !npmWasKilledBySignal(err);
230
- };
231
227
  var npmInstallFailure = (err, platform = process.platform) => {
232
228
  if (npmExitedOnReleaseAge(err)) return new NpmReleaseAgeError(npmErrorMessage(err));
233
229
  const code = npmPermissionCodeOf(err);
@@ -408,6 +404,7 @@ var installPackageGlobally = (request, runNpm = execNpm) => {
408
404
  runNpm(`install -g --no-workspaces${prefixFlag} ${spec}`, { timeout: request.timeoutMs });
409
405
  };
410
406
  var needsGlobalInstall = (requested, installed, binaryPresent) => requested !== installed || !binaryPresent;
407
+ var setupWouldDowngrade = (requested, installed) => installed !== void 0 && isReleaseVersion(installed) && isReleaseVersion(requested) && isNewerVersion(installed, requested);
411
408
  var planGlobalInstall = (platform) => {
412
409
  const prefix = readGlobalPrefix();
413
410
  const owner = prefix === void 0 ? NPM_UNAVAILABLE_OWNER : readCommandOwner(prefix, platform);
@@ -421,28 +418,33 @@ var installedVersionOf = (prefix, name, platform) => {
421
418
  var asCachedResult = (result) => result === "installed" ? "cached" : result;
422
419
  var installState;
423
420
  var installGlobally = (options) => {
421
+ if (!isReleaseVersion(options.version) || options.version === "0.0.0") {
422
+ return Promise.reject(new NpmInstallError("Setup requires a known release version. Run an official versioned release; no global package was installed."));
423
+ }
424
424
  if (installState) {
425
425
  return installState.then(asCachedResult);
426
426
  }
427
427
  const started = (async () => {
428
428
  if (!npmIsOnPath()) throw new NpmMissingError();
429
- const { withUpgradeLock } = await import("./global-upgrade-2QO2GEFD.js");
430
- const { installWithUpgradeLock, ownsUpgradeLock } = await import("./upgrade-lock-N6FDN5Z7.js");
431
- const { autoUpdateLock } = await import("./paths-BJUKHDVE.js");
429
+ const { withUpgradeLock } = await import("./global-upgrade-3TX5MDOW.js");
430
+ const { installWithUpgradeLock, ownsUpgradeLock } = await import("./upgrade-lock-ET4ON56I.js");
431
+ const { autoUpdateLock } = await import("./paths-BWOEOPPJ.js");
432
432
  let result = "skipped";
433
433
  const install = async () => {
434
434
  const platform = process.platform;
435
435
  const { prefix, packageName } = planGlobalInstall(platform);
436
- const pinned = process.env.PUSHARY_PIN_GLOBAL_VERSION !== "0";
437
- if (pinned && prefix !== void 0 && !needsGlobalInstall(
436
+ const installed = prefix === void 0 ? void 0 : installedVersionOf(prefix, packageName, platform);
437
+ if (setupWouldDowngrade(options.version, installed)) {
438
+ throw new NpmInstallError(`Setup ${options.version} is older than the installed ${packageName} ${installed}. Run setup from the installed version or a newer policy-eligible release; Pushary did not downgrade the runtime.`);
439
+ }
440
+ if (prefix !== void 0 && !needsGlobalInstall(
438
441
  options.version,
439
- installedVersionOf(prefix, packageName, platform),
442
+ installed,
440
443
  globalPackageBinsPresent(packageName, prefix, platform)
441
444
  )) {
442
445
  return;
443
446
  }
444
- const version = pinned && options.version && options.version !== "0.0.0" ? options.version : LATEST_TAG;
445
- installWithUpgradeLock({ packageName, version, timeoutMs: options.timeoutMs ?? 12e4 }, options.lockPath);
447
+ installWithUpgradeLock({ packageName, version: options.version, timeoutMs: options.timeoutMs ?? 12e4 }, options.lockPath);
446
448
  result = "installed";
447
449
  };
448
450
  if (ownsUpgradeLock(options.lockPath ?? autoUpdateLock())) {
@@ -480,7 +482,6 @@ export {
480
482
  compareVersion,
481
483
  atLeast,
482
484
  formatVersion,
483
- LATEST_TAG,
484
485
  cleanNpmEnv,
485
486
  npmErrorMessage,
486
487
  execNpm,
@@ -496,8 +497,6 @@ export {
496
497
  NpmPermissionError,
497
498
  NpmInstallError,
498
499
  NpmReleaseAgeError,
499
- npmExitedBeforeInstalling,
500
- npmExitedOnPermissionDenied,
501
500
  npmInstallFailure,
502
501
  resolveBinary,
503
502
  resolvePackageVersionFromBinary,
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  APPROVAL_RULES_PATH,
3
3
  canChangeApprovalSettings
4
- } from "./chunk-MIVJN6UX.js";
4
+ } from "./chunk-AM5FQTVF.js";
5
5
  import {
6
6
  callMcpTool
7
- } from "./chunk-WUFOQ3BO.js";
7
+ } from "./chunk-YOCSXG3N.js";
8
8
  import {
9
9
  absoluteUrl
10
- } from "./chunk-UYWRWMVG.js";
10
+ } from "./chunk-F6EPRJDF.js";
11
11
  import {
12
12
  getBaseUrl
13
- } from "./chunk-LFMW5JU5.js";
13
+ } from "./chunk-FUZ3KIA2.js";
14
14
  import {
15
15
  NPX_LATEST_COMMAND
16
- } from "./chunk-ZUS334Z2.js";
16
+ } from "./chunk-4E6PCUYJ.js";
17
17
  import {
18
18
  AGENT_STOP_DEFAULT_SECONDS,
19
19
  APPROVAL_MODE_META,
@@ -21,7 +21,7 @@ import {
21
21
  classifyConfirmResponse,
22
22
  isAnswerSource,
23
23
  roundTripAsk
24
- } from "./chunk-BEGXHUFW.js";
24
+ } from "./chunk-BEYMW4FP.js";
25
25
 
26
26
  // src/reach.ts
27
27
  var PUSHARY_APP_DOWNLOAD_URL = "https://pushary.com/download";
@@ -7,10 +7,10 @@ import {
7
7
  codexHome,
8
8
  codexHooksJsonIn,
9
9
  isPusharyCodexCommand
10
- } from "./chunk-YKCACY4F.js";
10
+ } from "./chunk-X6LMBS26.js";
11
11
  import {
12
12
  resolvePathBinary
13
- } from "./chunk-SI4WLQRD.js";
13
+ } from "./chunk-QZ4YXAKG.js";
14
14
  import {
15
15
  getPackageVersion
16
16
  } from "./chunk-WIIMW5YO.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  DEFAULT_SESSION
3
- } from "./chunk-NLEUWI4M.js";
3
+ } from "./chunk-ZYAPD2XN.js";
4
4
 
5
5
  // src/answer.ts
6
6
  var isDeferAnswer = (value) => value === "defer";