@pushary/agent-hooks 1.9.153 → 1.9.155

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 +10 -0
  2. package/dist/{api-CP25UREX.js → api-3C62HQDC.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 +56 -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-3UONQKDQ.js → chunk-25PVMWSM.js} +1 -1
  46. package/dist/{chunk-7MI43W6R.js → chunk-2LTRA6NA.js} +3 -3
  47. package/dist/{chunk-6QVR763H.js → chunk-2N23JFER.js} +3 -3
  48. package/dist/{chunk-TQDJSQTK.js → chunk-3EF7G5EV.js} +4 -4
  49. package/dist/{chunk-N7ADBRB6.js → chunk-3FQJYA76.js} +3 -3
  50. package/dist/{chunk-A5CQZKTQ.js → chunk-3UYTCDDY.js} +11 -9
  51. package/dist/{chunk-6FLI6ZLI.js → chunk-44FDCO7M.js} +8 -8
  52. package/dist/{chunk-HJW4HIGB.js → chunk-4RSJZOKB.js} +1 -1
  53. package/dist/{chunk-44OIS5QI.js → chunk-5C7TFCQH.js} +5 -5
  54. package/dist/{chunk-3PAXV5AO.js → chunk-5TCLBCUO.js} +6 -6
  55. package/dist/{chunk-FOU4YBB6.js → chunk-5Y5ZB5GG.js} +5 -5
  56. package/dist/{chunk-XOBZSFHN.js → chunk-6NRFAP45.js} +1 -1
  57. package/dist/{chunk-ORELODI4.js → chunk-6UGVZTRA.js} +1 -1
  58. package/dist/{chunk-YXR2LIDZ.js → chunk-7HDQUTRK.js} +7 -7
  59. package/dist/{chunk-VZKX3B7B.js → chunk-AKUYCHJU.js} +1 -1
  60. package/dist/{chunk-6BUQ6KQ3.js → chunk-ALRANF2G.js} +12 -12
  61. package/dist/{chunk-5M2AA3G3.js → chunk-ANL74IBU.js} +1 -1
  62. package/dist/{chunk-GJQKDHO3.js → chunk-B2SZN2C7.js} +5 -5
  63. package/dist/{chunk-VBQU3OFQ.js → chunk-BMR66K6T.js} +4 -4
  64. package/dist/{chunk-6FGTTNP4.js → chunk-C3HYWUZE.js} +1 -1
  65. package/dist/{chunk-G6QERYOX.js → chunk-C4K4KYOY.js} +3 -3
  66. package/dist/{chunk-HJDNDZQI.js → chunk-CAZ5FMWP.js} +6 -6
  67. package/dist/{chunk-4DGCCNVG.js → chunk-CHI57HS3.js} +3 -3
  68. package/dist/{chunk-D7DN5DXL.js → chunk-CV6G4IDZ.js} +2 -2
  69. package/dist/{chunk-VBKU5ICI.js → chunk-DDSMTD4W.js} +3 -3
  70. package/dist/{chunk-D5HE7ZE7.js → chunk-DMWKPUAI.js} +2 -2
  71. package/dist/{chunk-UZVU4ZOC.js → chunk-E2KAAKWU.js} +3 -3
  72. package/dist/{chunk-E3P63UWQ.js → chunk-ELF4NIIM.js} +2 -2
  73. package/dist/{chunk-AZ7225CM.js → chunk-EPYNFHCW.js} +3 -3
  74. package/dist/{chunk-6QFTOGXF.js → chunk-EQF6SSQL.js} +2 -2
  75. package/dist/{chunk-TTFJOZZN.js → chunk-F6ZBXV4G.js} +1 -1
  76. package/dist/{chunk-JTB3DC7H.js → chunk-FLY6YDPE.js} +5 -5
  77. package/dist/{chunk-XMJRSL5A.js → chunk-G6SQOGSD.js} +8 -8
  78. package/dist/{chunk-6ZWHFTGD.js → chunk-HNESCLUJ.js} +4 -4
  79. package/dist/{chunk-V7EEPW7U.js → chunk-HXX4EFK3.js} +3 -3
  80. package/dist/{chunk-NGGBXN6M.js → chunk-ICHKAH5Q.js} +6 -6
  81. package/dist/{chunk-KL7LGD57.js → chunk-JBF6A2X5.js} +1 -1
  82. package/dist/{chunk-5EEIROLA.js → chunk-JIH55UHZ.js} +1 -1
  83. package/dist/{chunk-BEYMW4FP.js → chunk-KB7YWU7A.js} +33 -14
  84. package/dist/{chunk-JJYIPQPG.js → chunk-KOBIBSE6.js} +3 -3
  85. package/dist/{chunk-SIEPFBGO.js → chunk-KWHADNCV.js} +4 -4
  86. package/dist/{chunk-ALTCTVBD.js → chunk-M2WLCRMX.js} +1 -1
  87. package/dist/{chunk-A5QLHC5S.js → chunk-MEUAK5BK.js} +2 -2
  88. package/dist/{chunk-RZC7MMY2.js → chunk-MGT2V2AB.js} +1 -1
  89. package/dist/{chunk-MXYCC6TR.js → chunk-MH4O453X.js} +2 -2
  90. package/dist/{chunk-WDO3YKVN.js → chunk-MOX7IOGL.js} +5 -5
  91. package/dist/{chunk-S4GSEFRL.js → chunk-O3NAHPCR.js} +1 -1
  92. package/dist/{chunk-DHA32CH3.js → chunk-OGB4QCB3.js} +5 -5
  93. package/dist/{chunk-VND6AFTY.js → chunk-P2OC7VZZ.js} +4 -4
  94. package/dist/{chunk-K3RPTQGZ.js → chunk-P5JV6YZW.js} +8 -2
  95. package/dist/{chunk-7PKA5C7Z.js → chunk-PBKYOLKX.js} +5 -5
  96. package/dist/{chunk-TVV7NN6T.js → chunk-PKU3WFT5.js} +1 -1
  97. package/dist/{chunk-OEQFFPBU.js → chunk-PMEDJ4WM.js} +22 -23
  98. package/dist/{chunk-HLMDINWY.js → chunk-Q242EVCI.js} +2 -2
  99. package/dist/{chunk-UOJQZ7L5.js → chunk-QEKKOZS3.js} +16 -16
  100. package/dist/{chunk-LPAPVM5J.js → chunk-QONYKXWP.js} +1 -1
  101. package/dist/{chunk-F2XOMBVP.js → chunk-R4DMHIOK.js} +5 -5
  102. package/dist/{chunk-ZMTMAKZI.js → chunk-RALCZD2Z.js} +8 -8
  103. package/dist/{chunk-7GQMN55L.js → chunk-RF35YTIF.js} +2 -2
  104. package/dist/{chunk-FLDVCVHA.js → chunk-RF7HGOBC.js} +2 -2
  105. package/dist/{chunk-OTYRLDKJ.js → chunk-S6DJAYQW.js} +5 -5
  106. package/dist/{chunk-I54ERZRS.js → chunk-T3LSBTWU.js} +2 -2
  107. package/dist/{chunk-6RB6DG5U.js → chunk-TIOQ55VZ.js} +6 -6
  108. package/dist/{chunk-EENGXQP2.js → chunk-TWOSBIAW.js} +1 -1
  109. package/dist/{chunk-KORCPXUS.js → chunk-UAYNQ2IG.js} +4 -4
  110. package/dist/{chunk-IFYBTFGJ.js → chunk-UJJ2OXFA.js} +1 -1
  111. package/dist/{chunk-YM2T76UM.js → chunk-UOVTXOSS.js} +7 -2
  112. package/dist/{chunk-DXCYJHL4.js → chunk-V4OIPLSC.js} +4 -4
  113. package/dist/{chunk-44BHQL5D.js → chunk-WCVANKUD.js} +1 -1
  114. package/dist/{chunk-7BXROUKN.js → chunk-WDCS3RGI.js} +2 -2
  115. package/dist/{chunk-JPXW7CB3.js → chunk-WIOLCW7W.js} +1 -1
  116. package/dist/{chunk-AGZW3MDV.js → chunk-WSPDIT2B.js} +2 -2
  117. package/dist/{chunk-KNXFZWYU.js → chunk-WWDWEVGT.js} +11 -9
  118. package/dist/{chunk-K5QMB6A7.js → chunk-XHPTW6WL.js} +6 -23
  119. package/dist/{chunk-HWUMQCKI.js → chunk-XOZ2IFFU.js} +10 -10
  120. package/dist/{chunk-XMKNE4XR.js → chunk-XZ7AZOUT.js} +11 -11
  121. package/dist/{chunk-AHLKBYZN.js → chunk-Y6OGY2G4.js} +3 -3
  122. package/dist/{chunk-OHKGBJ4O.js → chunk-YPSP7NZI.js} +4 -4
  123. package/dist/{codex-app-cards-switch-FPUS5HGR.js → codex-app-cards-switch-B7GY2ONI.js} +11 -11
  124. package/dist/{codex-card-routing-KAAZTFYE.js → codex-card-routing-6RN4N266.js} +2 -2
  125. package/dist/{codex-desktop-launch-K22UOYK4.js → codex-desktop-launch-K4GU2NFZ.js} +1 -1
  126. package/dist/{codex-session-launch-UALDJWDA.js → codex-session-launch-AVEFGOT7.js} +20 -20
  127. package/dist/{config-37VCCNI3.js → config-YGUXX5GB.js} +4 -3
  128. package/dist/{global-upgrade-P6UR6T67.js → global-upgrade-HLXPTFDU.js} +9 -9
  129. package/dist/{identity-VKL2KE5Y.js → identity-CAC763RQ.js} +4 -4
  130. package/dist/{live-capabilities-YKXXTWIP.js → live-capabilities-WRI22INV.js} +4 -4
  131. package/dist/{paths-P5H3NCEO.js → paths-DNXBDJJH.js} +3 -3
  132. package/dist/{reapply-MLREXGHX.js → reapply-L7QUIQXK.js} +30 -30
  133. package/dist/src/index.js +34 -34
  134. package/dist/{upgrade-lock-HBLAJ7ID.js → upgrade-lock-CRW26OIW.js} +4 -6
  135. package/dist/{usage-6E3PTA6F.js → usage-AWWCZ7H7.js} +3 -3
  136. package/package.json +1 -1
@@ -1,20 +1,20 @@
1
1
  import {
2
2
  keyCheckFromResponse
3
- } from "./chunk-G6QERYOX.js";
3
+ } from "./chunk-C4K4KYOY.js";
4
4
  import {
5
5
  installNetworkDefaults
6
- } from "./chunk-UZVU4ZOC.js";
6
+ } from "./chunk-E2KAAKWU.js";
7
7
  import {
8
8
  fetchAsCredential
9
- } from "./chunk-EENGXQP2.js";
9
+ } from "./chunk-TWOSBIAW.js";
10
10
  import {
11
11
  getBaseUrl
12
- } from "./chunk-5M2AA3G3.js";
12
+ } from "./chunk-ANL74IBU.js";
13
13
  import {
14
14
  isRecord,
15
15
  isToolErrorResult,
16
16
  toolFailureCodeOfResult
17
- } from "./chunk-BEYMW4FP.js";
17
+ } from "./chunk-KB7YWU7A.js";
18
18
 
19
19
  // src/retry.ts
20
20
  var isRetryable = (err) => {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  computerOsOfPlatform,
3
3
  isComputerAgent
4
- } from "./chunk-BEYMW4FP.js";
4
+ } from "./chunk-KB7YWU7A.js";
5
5
 
6
6
  // src/setup/phone-check.ts
7
7
  var planPhoneCheck = (context) => {
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  addGeminiMcpServer,
3
3
  removeGeminiMcpServer
4
- } from "./chunk-VBQU3OFQ.js";
4
+ } from "./chunk-BMR66K6T.js";
5
5
  import {
6
6
  CLAUDE_CODE_AGENT
7
- } from "./chunk-6BUQ6KQ3.js";
7
+ } from "./chunk-ALRANF2G.js";
8
8
  import {
9
9
  compatibleToolLookup
10
- } from "./chunk-5EEIROLA.js";
10
+ } from "./chunk-JIH55UHZ.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-MXYCC6TR.js";
22
+ } from "./chunk-MH4O453X.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-BEYMW4FP.js";
33
+ } from "./chunk-KB7YWU7A.js";
34
34
 
35
35
  // src/config-document.ts
36
36
  import { parse, stringify } from "smol-toml";
@@ -13,16 +13,16 @@ import {
13
13
  } from "./chunk-G66WIAST.js";
14
14
  import {
15
15
  keyPrefix
16
- } from "./chunk-7MI43W6R.js";
16
+ } from "./chunk-2LTRA6NA.js";
17
17
  import {
18
18
  getBaseUrl
19
- } from "./chunk-5M2AA3G3.js";
19
+ } from "./chunk-ANL74IBU.js";
20
20
  import {
21
21
  NPX_LATEST_COMMAND
22
- } from "./chunk-K3RPTQGZ.js";
22
+ } from "./chunk-P5JV6YZW.js";
23
23
  import {
24
24
  isValidApiKey
25
- } from "./chunk-BEYMW4FP.js";
25
+ } from "./chunk-KB7YWU7A.js";
26
26
 
27
27
  // src/cli/login-ui.ts
28
28
  import { hostname } from "os";
@@ -1,8 +1,11 @@
1
+ import {
2
+ isReleaseVersion
3
+ } from "./chunk-WIIMW5YO.js";
1
4
  import {
2
5
  DISCONNECT_AGENT_IDS,
3
6
  SETUP_AGENT_CHOICES,
4
7
  isApprovalMode
5
- } from "./chunk-BEYMW4FP.js";
8
+ } from "./chunk-KB7YWU7A.js";
6
9
 
7
10
  // src/cli/mode-request.ts
8
11
  var parseDuration = (value) => {
@@ -35,7 +38,10 @@ var describeMode = (mode) => {
35
38
  // src/cli/commands.ts
36
39
  var npxLatestCommandFor = (platform) => `${platform === "win32" ? "npx.cmd" : "npx"} pushary@latest`;
37
40
  var NPX_LATEST_COMMAND = npxLatestCommandFor(process.platform);
38
- var npmExecSetupCommandFor = (platform, agents) => `${platform === "win32" ? "npm.cmd" : "npm"} exec --yes --package=pushary@latest -c "pushary setup --agents ${agents.join(",")}"`;
41
+ var npmExecSetupCommandFor = (platform, agents, version) => {
42
+ if (!isReleaseVersion(version) || version === "0.0.0") throw new Error("Recovery requires a known release version");
43
+ return `${platform === "win32" ? "npm.cmd" : "npm"} exec --yes --package=pushary@${version} -c "pushary setup --agents ${agents.join(",")}"`;
44
+ };
39
45
  var COMMAND_LIST = [
40
46
  {
41
47
  name: "codex",
@@ -5,13 +5,13 @@ import {
5
5
  } from "./chunk-OYIN77HO.js";
6
6
  import {
7
7
  readMacAppAgentKey
8
- } from "./chunk-6ZWHFTGD.js";
8
+ } from "./chunk-HNESCLUJ.js";
9
9
  import {
10
10
  API_KEYS_PATH
11
- } from "./chunk-6QFTOGXF.js";
11
+ } from "./chunk-EQF6SSQL.js";
12
12
  import {
13
13
  absoluteUrl
14
- } from "./chunk-G6QERYOX.js";
14
+ } from "./chunk-C4K4KYOY.js";
15
15
  import {
16
16
  findExportedKeyLines,
17
17
  isAdoptedMacAppKey,
@@ -21,10 +21,10 @@ import {
21
21
  readConfigFileKey,
22
22
  readKeySource,
23
23
  readMacAppKeyPrefix
24
- } from "./chunk-7MI43W6R.js";
24
+ } from "./chunk-2LTRA6NA.js";
25
25
  import {
26
26
  isValidApiKey
27
- } from "./chunk-BEYMW4FP.js";
27
+ } from "./chunk-KB7YWU7A.js";
28
28
 
29
29
  // src/cli/held-key-revocation.ts
30
30
  var readCliHeldKeys = (profiles) => {
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  RETRY_ACK,
6
6
  refusedReceiptMessage
7
- } from "./chunk-LPAPVM5J.js";
7
+ } from "./chunk-QONYKXWP.js";
8
8
 
9
9
  // src/command-receipts.ts
10
10
  import { randomUUID } from "crypto";
@@ -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-KB7YWU7A.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-P6UR6T67.js");
430
- const { installWithUpgradeLock, ownsUpgradeLock } = await import("./upgrade-lock-HBLAJ7ID.js");
431
- const { autoUpdateLock } = await import("./paths-P5H3NCEO.js");
429
+ const { withUpgradeLock } = await import("./global-upgrade-HLXPTFDU.js");
430
+ const { installWithUpgradeLock, ownsUpgradeLock } = await import("./upgrade-lock-CRW26OIW.js");
431
+ const { autoUpdateLock } = await import("./paths-DNXBDJJH.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,
@@ -9,13 +9,13 @@ import {
9
9
  installedCodexApp,
10
10
  readCodexAppRuntime,
11
11
  shellQuoted
12
- } from "./chunk-AHLKBYZN.js";
12
+ } from "./chunk-Y6OGY2G4.js";
13
13
  import {
14
14
  writeHuman
15
15
  } from "./chunk-QCGNGEGE.js";
16
16
  import {
17
17
  xml
18
- } from "./chunk-3PAXV5AO.js";
18
+ } from "./chunk-5TCLBCUO.js";
19
19
  import {
20
20
  writeFileAtomic
21
21
  } from "./chunk-TODDEIYG.js";
@@ -2,37 +2,37 @@ import {
2
2
  forgetPhoneApproval,
3
3
  rememberPhoneApproval,
4
4
  takePhoneApproval
5
- } from "./chunk-D5HE7ZE7.js";
5
+ } from "./chunk-DMWKPUAI.js";
6
6
  import {
7
7
  claudeSettingsLocationFor,
8
8
  readClaudePermissionRules
9
- } from "./chunk-AGZW3MDV.js";
9
+ } from "./chunk-WSPDIT2B.js";
10
10
  import {
11
11
  askAgentQuestions,
12
12
  defersToNativeMode,
13
13
  outcomeOfFailedAsk,
14
14
  storedWaitDeadline
15
- } from "./chunk-GJQKDHO3.js";
15
+ } from "./chunk-B2SZN2C7.js";
16
16
  import {
17
17
  reportMachineDenial
18
- } from "./chunk-AZ7225CM.js";
18
+ } from "./chunk-EPYNFHCW.js";
19
19
  import {
20
20
  isGatingMoment,
21
21
  recordKeylessMoment
22
- } from "./chunk-6FGTTNP4.js";
22
+ } from "./chunk-C3HYWUZE.js";
23
23
  import {
24
24
  isAdmitted,
25
25
  readAdmissionRules
26
- } from "./chunk-JTB3DC7H.js";
26
+ } from "./chunk-FLY6YDPE.js";
27
27
  import {
28
28
  isDeferAnswer,
29
29
  oncePerSession
30
- } from "./chunk-ALTCTVBD.js";
30
+ } from "./chunk-M2WLCRMX.js";
31
31
  import {
32
32
  activeHookSource,
33
33
  activeIdentity,
34
34
  namedSource
35
- } from "./chunk-DHA32CH3.js";
35
+ } from "./chunk-OGB4QCB3.js";
36
36
  import {
37
37
  DEFAULT_SESSION,
38
38
  approvalAwaitingRetry,
@@ -53,7 +53,7 @@ import {
53
53
  settleQuestionsForToolUse,
54
54
  sweepFilesOlderThan,
55
55
  userScope
56
- } from "./chunk-6BUQ6KQ3.js";
56
+ } from "./chunk-ALRANF2G.js";
57
57
  import {
58
58
  UNNAMED_ACTION,
59
59
  deriveAction,
@@ -64,12 +64,12 @@ import {
64
64
  patchDeletesFiles,
65
65
  permissionDeniedAction,
66
66
  scopePathFor
67
- } from "./chunk-5EEIROLA.js";
67
+ } from "./chunk-JIH55UHZ.js";
68
68
  import {
69
69
  branchFor,
70
70
  repoKeyFor,
71
71
  repositoryScopeFor
72
- } from "./chunk-IFYBTFGJ.js";
72
+ } from "./chunk-UJJ2OXFA.js";
73
73
  import {
74
74
  askUser,
75
75
  cancelQuestion,
@@ -86,20 +86,20 @@ import {
86
86
  waitForQuestion,
87
87
  waitsForThePhone,
88
88
  withdrawQuestion
89
- } from "./chunk-NGGBXN6M.js";
89
+ } from "./chunk-ICHKAH5Q.js";
90
90
  import {
91
91
  getMachineId
92
- } from "./chunk-HJW4HIGB.js";
92
+ } from "./chunk-4RSJZOKB.js";
93
93
  import {
94
94
  getApiKey,
95
95
  getBaseUrl
96
- } from "./chunk-5M2AA3G3.js";
96
+ } from "./chunk-ANL74IBU.js";
97
97
  import {
98
98
  writeFileAtomic
99
99
  } from "./chunk-TODDEIYG.js";
100
100
  import {
101
101
  NPX_LATEST_COMMAND
102
- } from "./chunk-K3RPTQGZ.js";
102
+ } from "./chunk-P5JV6YZW.js";
103
103
  import {
104
104
  AGENT_QUESTION_STRATEGY,
105
105
  AGENT_QUESTION_TOOL,
@@ -169,7 +169,7 @@ import {
169
169
  timeoutActionWithoutLocalPrompt,
170
170
  unansweredRefusalReason,
171
171
  unapprovedScopeReason
172
- } from "./chunk-BEYMW4FP.js";
172
+ } from "./chunk-KB7YWU7A.js";
173
173
 
174
174
  // src/terminal-answer-watch.ts
175
175
  import { closeSync, openSync, readSync, statSync } from "fs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isFinalCommandAckRefusal
3
- } from "./chunk-BEYMW4FP.js";
3
+ } from "./chunk-KB7YWU7A.js";
4
4
 
5
5
  // src/command-ack-outcome.ts
6
6
  var SETTLED_ACK = { outcome: "settled" };
@@ -3,24 +3,24 @@ import {
3
3
  expectedLaunchCapabilities,
4
4
  hasSpawnProvider,
5
5
  resolveControlPolicy
6
- } from "./chunk-N7ADBRB6.js";
6
+ } from "./chunk-3FQJYA76.js";
7
7
  import {
8
8
  daemonHasRemoteProof,
9
9
  daemonServiceManagerAvailable,
10
10
  hasDaemonServiceDefinition,
11
11
  readDaemonNeedsLogin,
12
12
  readDaemonStatus
13
- } from "./chunk-3PAXV5AO.js";
13
+ } from "./chunk-5TCLBCUO.js";
14
14
  import {
15
15
  getMachineId
16
- } from "./chunk-HJW4HIGB.js";
16
+ } from "./chunk-4RSJZOKB.js";
17
17
  import {
18
18
  readControlMode,
19
19
  readKeySource
20
- } from "./chunk-7MI43W6R.js";
20
+ } from "./chunk-2LTRA6NA.js";
21
21
  import {
22
22
  getBaseUrl
23
- } from "./chunk-5M2AA3G3.js";
23
+ } from "./chunk-ANL74IBU.js";
24
24
  import {
25
25
  getPackageVersion
26
26
  } from "./chunk-WIIMW5YO.js";
@@ -1,31 +1,31 @@
1
1
  import {
2
2
  MANAGED_CLAUDE_SETTINGS_BY_PLATFORM
3
- } from "./chunk-AGZW3MDV.js";
3
+ } from "./chunk-WSPDIT2B.js";
4
4
  import {
5
5
  declinedAgentsFile,
6
6
  readDeclinedAgents
7
- } from "./chunk-7BXROUKN.js";
7
+ } from "./chunk-WDCS3RGI.js";
8
8
  import {
9
9
  OPENCODE_HOOK_BINARY,
10
10
  openCodeConfigDir,
11
11
  openCodePluginArgv,
12
12
  openCodePluginFile
13
- } from "./chunk-FOU4YBB6.js";
13
+ } from "./chunk-5Y5ZB5GG.js";
14
14
  import {
15
15
  liveCursorGateCoverage
16
- } from "./chunk-TQDJSQTK.js";
16
+ } from "./chunk-3EF7G5EV.js";
17
17
  import {
18
18
  compatibleConfigFile,
19
19
  compatibleHookEvents,
20
20
  grokHome,
21
21
  parseConfigDocument
22
- } from "./chunk-DHA32CH3.js";
22
+ } from "./chunk-OGB4QCB3.js";
23
23
  import {
24
24
  DEFAULT_HOOKS_KEY_PATH,
25
25
  GEMINI_HOOK_BINARY,
26
26
  GEMINI_HOOK_EVENTS,
27
27
  hooksAt
28
- } from "./chunk-VBQU3OFQ.js";
28
+ } from "./chunk-BMR66K6T.js";
29
29
  import {
30
30
  CODEX_EARLIER_APPROVAL_MATCHERS,
31
31
  CODEX_HOOK_BINARY,
@@ -53,7 +53,7 @@ import {
53
53
  parseHookArgv,
54
54
  parseHookCommand,
55
55
  supportedClaudeEvents
56
- } from "./chunk-MXYCC6TR.js";
56
+ } from "./chunk-MH4O453X.js";
57
57
  import {
58
58
  readRegularJsonFile,
59
59
  readRegularTextFile
@@ -67,7 +67,7 @@ import {
67
67
  OPENCODE_APPROVAL_EVENT,
68
68
  isRecord,
69
69
  matcherMatchesEveryCall
70
- } from "./chunk-BEYMW4FP.js";
70
+ } from "./chunk-KB7YWU7A.js";
71
71
 
72
72
  // src/hook-wiring.ts
73
73
  import { createHash } from "crypto";
@@ -4,10 +4,10 @@ import {
4
4
  keyPrefix,
5
5
  readConfigFileKey,
6
6
  readMacAppKeyPrefix
7
- } from "./chunk-7MI43W6R.js";
7
+ } from "./chunk-2LTRA6NA.js";
8
8
  import {
9
9
  NPX_LATEST_COMMAND
10
- } from "./chunk-K3RPTQGZ.js";
10
+ } from "./chunk-P5JV6YZW.js";
11
11
 
12
12
  // src/key-signed-out.ts
13
13
  var VERDICT_BY_CHECK = {
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-POFBE6ZY.js";
4
4
  import {
5
5
  autoUpdateState
6
- } from "./chunk-MXYCC6TR.js";
6
+ } from "./chunk-MH4O453X.js";
7
7
  import {
8
8
  readJsonSafe,
9
9
  writeJsonAtomic
@@ -17,7 +17,7 @@ import {
17
17
  } from "./chunk-WIIMW5YO.js";
18
18
  import {
19
19
  isAutoUpdateResult
20
- } from "./chunk-BEYMW4FP.js";
20
+ } from "./chunk-KB7YWU7A.js";
21
21
 
22
22
  // src/auto-update.ts
23
23
  import { spawn } from "child_process";
@@ -4,13 +4,13 @@ import {
4
4
  configFailureKind,
5
5
  retryAgentCommand,
6
6
  writeSetupConfigFile
7
- } from "./chunk-6QVR763H.js";
7
+ } from "./chunk-2N23JFER.js";
8
8
  import {
9
9
  MCP_BRIDGE_BINARY
10
- } from "./chunk-VBKU5ICI.js";
10
+ } from "./chunk-DDSMTD4W.js";
11
11
  import {
12
12
  KEY_FILE_MODE
13
- } from "./chunk-7MI43W6R.js";
13
+ } from "./chunk-2LTRA6NA.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-MXYCC6TR.js";
35
+ } from "./chunk-MH4O453X.js";
36
36
  import {
37
37
  resolveGlobalBinary
38
- } from "./chunk-OEQFFPBU.js";
38
+ } from "./chunk-PMEDJ4WM.js";
39
39
  import {
40
40
  readJsonSafe,
41
41
  writeFileAtomic,
@@ -7,10 +7,10 @@ import {
7
7
  codexHome,
8
8
  codexHooksJsonIn,
9
9
  isPusharyCodexCommand
10
- } from "./chunk-MXYCC6TR.js";
10
+ } from "./chunk-MH4O453X.js";
11
11
  import {
12
12
  resolvePathBinary
13
- } from "./chunk-OEQFFPBU.js";
13
+ } from "./chunk-PMEDJ4WM.js";
14
14
  import {
15
15
  getPackageVersion
16
16
  } from "./chunk-WIIMW5YO.js";
@@ -14,7 +14,7 @@ import {
14
14
  reachVerdict,
15
15
  reachesYou,
16
16
  verifyDelivery
17
- } from "./chunk-HJDNDZQI.js";
17
+ } from "./chunk-CAZ5FMWP.js";
18
18
  import {
19
19
  describeRevokeAttempt,
20
20
  keyNoLongerAccepted,
@@ -29,20 +29,20 @@ import {
29
29
  isCI,
30
30
  terminalColumns,
31
31
  useColor
32
- } from "./chunk-YM2T76UM.js";
32
+ } from "./chunk-UOVTXOSS.js";
33
33
  import {
34
34
  checkApiKey
35
- } from "./chunk-G6QERYOX.js";
35
+ } from "./chunk-C4K4KYOY.js";
36
36
  import {
37
37
  reportedInstallSource
38
- } from "./chunk-E3P63UWQ.js";
38
+ } from "./chunk-ELF4NIIM.js";
39
39
  import {
40
40
  NPX_LATEST_COMMAND
41
- } from "./chunk-K3RPTQGZ.js";
41
+ } from "./chunk-P5JV6YZW.js";
42
42
  import {
43
43
  NO_PAIRING_COMPUTER,
44
44
  PAIR_TTL_SECONDS
45
- } from "./chunk-BEYMW4FP.js";
45
+ } from "./chunk-KB7YWU7A.js";
46
46
 
47
47
  // src/onboarding.ts
48
48
  import qrcodeTerminal from "qrcode-terminal";
@@ -5,7 +5,7 @@ import {
5
5
  MCP_CREDENTIAL_REJECTION_BODY,
6
6
  isRecord,
7
7
  responseRejectsCredential
8
- } from "./chunk-BEYMW4FP.js";
8
+ } from "./chunk-KB7YWU7A.js";
9
9
 
10
10
  // src/credential-rejection.ts
11
11
  import { createHash, randomUUID } from "crypto";
@@ -13,7 +13,7 @@ import {
13
13
  uninstallOpenClawPlugin,
14
14
  unsetOpenClawEntry,
15
15
  writeOpenClawEntry
16
- } from "./chunk-V7EEPW7U.js";
16
+ } from "./chunk-HXX4EFK3.js";
17
17
  import {
18
18
  needsShell
19
19
  } from "./chunk-H6CL3T2S.js";
@@ -25,10 +25,10 @@ import {
25
25
  openClawDirectoriesToLookIn,
26
26
  openClawPluginFolder,
27
27
  openClawSetupReceiptDirectory
28
- } from "./chunk-MXYCC6TR.js";
28
+ } from "./chunk-MH4O453X.js";
29
29
  import {
30
30
  resolvePathBinary
31
- } from "./chunk-OEQFFPBU.js";
31
+ } from "./chunk-PMEDJ4WM.js";
32
32
  import {
33
33
  readJsonSafe,
34
34
  writeJsonAtomic
@@ -39,7 +39,7 @@ import {
39
39
  } from "./chunk-WIIMW5YO.js";
40
40
  import {
41
41
  isRecord
42
- } from "./chunk-BEYMW4FP.js";
42
+ } from "./chunk-KB7YWU7A.js";
43
43
 
44
44
  // src/hermes/plugin-payload.ts
45
45
  import { createHash } from "crypto";
@@ -2,7 +2,7 @@ import {
2
2
  localRepoKey,
3
3
  normalizeRepoRemote,
4
4
  parseGitBranch
5
- } from "./chunk-BEYMW4FP.js";
5
+ } from "./chunk-KB7YWU7A.js";
6
6
 
7
7
  // src/repo.ts
8
8
  import { existsSync, readFileSync, statSync } from "fs";