@pushary/agent-hooks 1.9.59 → 1.9.61

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 (130) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +6 -0
  3. package/data/cursor-plugin/.cursor-plugin/plugin.json +5 -1
  4. package/data/cursor-plugin/CHANGELOG.md +4 -0
  5. package/dist/{api-UVJGNZIF.js → api-LW3PJQYY.js} +12 -11
  6. package/dist/bin/pushary-bell-hook.js +30 -29
  7. package/dist/bin/pushary-bell.js +13 -12
  8. package/dist/bin/pushary-claude.js +32 -30
  9. package/dist/bin/pushary-clean.js +61 -54
  10. package/dist/bin/pushary-codex-bridge.js +23 -22
  11. package/dist/bin/pushary-codex-hook.js +35 -34
  12. package/dist/bin/pushary-codex-session.js +9 -8
  13. package/dist/bin/pushary-codex.js +16 -15
  14. package/dist/bin/pushary-connect.js +30 -29
  15. package/dist/bin/pushary-cowork.js +8 -7
  16. package/dist/bin/pushary-daemon.js +40 -39
  17. package/dist/bin/pushary-disconnect.js +43 -29
  18. package/dist/bin/pushary-doctor.js +52 -47
  19. package/dist/bin/pushary-elicitation-hook.js +30 -29
  20. package/dist/bin/pushary-gemini-bridge.js +16 -15
  21. package/dist/bin/pushary-gemini-hook.js +32 -31
  22. package/dist/bin/pushary-hook.js +34 -33
  23. package/dist/bin/pushary-login.js +23 -19
  24. package/dist/bin/pushary-logout.js +37 -31
  25. package/dist/bin/pushary-mcp.js +13 -12
  26. package/dist/bin/pushary-mode.js +42 -55
  27. package/dist/bin/pushary-notification-hook.js +29 -28
  28. package/dist/bin/pushary-opencode-hook.js +31 -30
  29. package/dist/bin/pushary-permission-denied-hook.js +34 -33
  30. package/dist/bin/pushary-permission-hook.js +33 -32
  31. package/dist/bin/pushary-post-hook.js +29 -28
  32. package/dist/bin/pushary-prompt-hook.js +29 -28
  33. package/dist/bin/pushary-session-end-hook.js +29 -28
  34. package/dist/bin/pushary-session-start-hook.js +36 -35
  35. package/dist/bin/pushary-setup.js +4397 -292
  36. package/dist/bin/pushary-stats.js +6 -5
  37. package/dist/bin/pushary-status.js +42 -36
  38. package/dist/bin/pushary-stop-hook.js +29 -28
  39. package/dist/bin/pushary-stopfailure-hook.js +29 -28
  40. package/dist/bin/pushary-suggestions.js +34 -39
  41. package/dist/bin/pushary-transcript-register.js +21 -20
  42. package/dist/bin/pushary-transcripts.js +34 -20
  43. package/dist/bin/pushary-upgrade.js +77 -50
  44. package/dist/bin/pushary-wait.js +37 -42
  45. package/dist/bin/pushary.js +9 -8
  46. package/dist/{chunk-PVANKDWM.js → chunk-2AELPDMT.js} +1 -1
  47. package/dist/{chunk-W47WL6JY.js → chunk-33OOEVPG.js} +1 -1
  48. package/dist/{chunk-BRUHVTFB.js → chunk-4N5E4JNF.js} +2 -2
  49. package/dist/{chunk-6ONSTCDJ.js → chunk-4VRTSDGP.js} +5 -5
  50. package/dist/{chunk-DS7X36Z3.js → chunk-64S5PQBQ.js} +4 -4
  51. package/dist/{chunk-KQHY6L3X.js → chunk-6FJ6CK32.js} +4 -4
  52. package/dist/{chunk-EBQTWH5O.js → chunk-6T5Z64KS.js} +39 -31
  53. package/dist/{chunk-JAKBCKEB.js → chunk-7BAO42UV.js} +8 -7
  54. package/dist/chunk-7BHI3PZN.js +41 -0
  55. package/dist/{chunk-5BNXJTOZ.js → chunk-7HDGH3Z2.js} +3 -12
  56. package/dist/{chunk-D6CXQIXO.js → chunk-7JXJJNQ5.js} +1 -1
  57. package/dist/{chunk-KHDD74MK.js → chunk-7MCCXE5Y.js} +5 -5
  58. package/dist/{chunk-AY32RSUC.js → chunk-ADR3KHOC.js} +2 -2
  59. package/dist/{chunk-MMLIQDTG.js → chunk-ATKN4BJT.js} +1 -1
  60. package/dist/{chunk-762CDAJJ.js → chunk-AXJLJJ3M.js} +7 -0
  61. package/dist/{chunk-4XXZUFWN.js → chunk-BG4Y64FW.js} +1 -1
  62. package/dist/{chunk-X4ES7QBT.js → chunk-BJTSKOH3.js} +9 -7
  63. package/dist/{chunk-TCH5UCPR.js → chunk-BQ2VV7LY.js} +2 -2
  64. package/dist/{chunk-IBXHVYN2.js → chunk-BUZIEL7Y.js} +2 -2
  65. package/dist/{chunk-UFJS4RR7.js → chunk-CICLXLQN.js} +3 -3
  66. package/dist/{chunk-US3IT6ZC.js → chunk-CJ5TCFD4.js} +11 -4
  67. package/dist/{chunk-5JWCWALO.js → chunk-DQLCFGHK.js} +12 -10
  68. package/dist/{chunk-V3PDUDPB.js → chunk-ELLJPP6O.js} +2 -2
  69. package/dist/{chunk-BMPZ5HVJ.js → chunk-ERK24P76.js} +11 -1
  70. package/dist/{chunk-2WMZDKPM.js → chunk-EUIPTDLX.js} +13 -13
  71. package/dist/{chunk-RQDP2SJY.js → chunk-FUZ5VYWD.js} +1 -1
  72. package/dist/{chunk-5PP4455M.js → chunk-G36T5LAP.js} +3 -3
  73. package/dist/{chunk-3N2ZTHZZ.js → chunk-GAMVAORR.js} +1 -1
  74. package/dist/{chunk-YQVKG5MC.js → chunk-GDKQUB52.js} +7 -6
  75. package/dist/{chunk-KQWN7C5C.js → chunk-GKFO5JLN.js} +4 -4
  76. package/dist/{chunk-MYU5D5VH.js → chunk-GZCSWDAS.js} +4 -4
  77. package/dist/{chunk-2FVP7WRP.js → chunk-HUI4OE43.js} +3 -3
  78. package/dist/{chunk-AS4Z6KS4.js → chunk-IFPOHFDJ.js} +1 -1
  79. package/dist/{chunk-L3NVHPBU.js → chunk-JGQV4MDQ.js} +6 -6
  80. package/dist/{chunk-UVZK5LIK.js → chunk-K4MBKXAE.js} +1 -1
  81. package/dist/{chunk-EHCIQA5D.js → chunk-KPNZ7JUL.js} +4 -4
  82. package/dist/{chunk-4QF2YLYK.js → chunk-LBHJJEKT.js} +6 -6
  83. package/dist/{chunk-5O6D4J2K.js → chunk-LN7DE5LY.js} +2 -2
  84. package/dist/chunk-MLKGABMK.js +9 -0
  85. package/dist/{chunk-KZCYHWDF.js → chunk-MWLTTLPK.js} +107 -50
  86. package/dist/{chunk-WWAVHLGS.js → chunk-NKLNU577.js} +5 -5
  87. package/dist/{chunk-GMXKITVA.js → chunk-NMUI3ZWG.js} +1 -1
  88. package/dist/{chunk-SIU6OWA6.js → chunk-O65F2IIN.js} +6 -6
  89. package/dist/{chunk-T65RIQK2.js → chunk-ORX5BTV4.js} +6 -6
  90. package/dist/{chunk-VAJHDTJX.js → chunk-P3VQH65N.js} +28 -17
  91. package/dist/{chunk-CPRA7IEK.js → chunk-PITQ5ZIQ.js} +2 -2
  92. package/dist/chunk-PPY5N2E6.js +58 -0
  93. package/dist/{chunk-UTJ5465F.js → chunk-QER5R7Z6.js} +2 -2
  94. package/dist/{chunk-TDOKDCFH.js → chunk-RGSW36XH.js} +3 -3
  95. package/dist/{chunk-WW24SG27.js → chunk-RJHX66EY.js} +21 -11
  96. package/dist/{chunk-M46WDK64.js → chunk-SFAP4AJY.js} +1 -1
  97. package/dist/{chunk-MSU3VKGJ.js → chunk-SHJVFW22.js} +2 -2
  98. package/dist/{chunk-RAMQBSVZ.js → chunk-SVQWHV65.js} +1 -1
  99. package/dist/{chunk-3NROUNIS.js → chunk-UADSXJZ4.js} +2 -2
  100. package/dist/{chunk-M6MOQBR5.js → chunk-USE5IEEW.js} +1 -1
  101. package/dist/{chunk-KW3DED2A.js → chunk-VX2MJ4X7.js} +4 -4
  102. package/dist/{chunk-OZIXBN3O.js → chunk-WFSGCFXQ.js} +2 -2
  103. package/dist/{chunk-KAJDKYUM.js → chunk-WN3RACVD.js} +3 -3
  104. package/dist/chunk-X3YKQJCZ.js +36 -0
  105. package/dist/{chunk-5EFNBL6V.js → chunk-XAO6EYGM.js} +3 -3
  106. package/dist/{chunk-BKVX53QR.js → chunk-XEJOPVCG.js} +1 -1
  107. package/dist/{chunk-75UYYIFJ.js → chunk-XV6S5PWW.js} +3 -3
  108. package/dist/{chunk-3RKIJM26.js → chunk-Y5VKZNFN.js} +2 -2
  109. package/dist/{chunk-DK35M4TH.js → chunk-Y6Z7DA5Y.js} +5 -5
  110. package/dist/{chunk-MA37WNVS.js → chunk-YDR4BQ7R.js} +4 -4
  111. package/dist/{chunk-XGP5VSQG.js → chunk-YPD3MTFU.js} +1 -1
  112. package/dist/{chunk-LAEW5QQD.js → chunk-ZEWIMY63.js} +1 -1
  113. package/dist/{chunk-JBCMXSBO.js → chunk-ZGU3NXL2.js} +77 -18
  114. package/dist/{codex-app-cards-switch-N77RWKCO.js → codex-app-cards-switch-BD7LCI2I.js} +12 -11
  115. package/dist/{codex-desktop-launch-KIX7OMTL.js → codex-desktop-launch-V5CASSBB.js} +2 -1
  116. package/dist/{codex-session-launch-XV7SIIWP.js → codex-session-launch-5PKFKUFD.js} +20 -19
  117. package/dist/{config-HH4DYYNX.js → config-AEKH7HGC.js} +4 -3
  118. package/dist/{global-upgrade-YWIVJIUR.js → global-upgrade-IUXJJDWF.js} +10 -9
  119. package/dist/{identity-4J7Y2MW3.js → identity-YJIV2XTY.js} +5 -4
  120. package/dist/{live-capabilities-LHZBCI5U.js → live-capabilities-QYFW5QAW.js} +5 -4
  121. package/dist/{paths-ES3V7BWQ.js → paths-A5GAR5PL.js} +4 -3
  122. package/dist/reapply-BKJGICRJ.js +63 -0
  123. package/dist/src/index.js +23 -22
  124. package/dist/{upgrade-lock-TJPKU5HL.js → upgrade-lock-DDB7WEWC.js} +5 -4
  125. package/dist/usage-HBDNFZ3O.js +11 -0
  126. package/package.json +1 -1
  127. package/dist/chunk-7QLSKOSU.js +0 -19
  128. package/dist/chunk-EO23EUOK.js +0 -14
  129. package/dist/reapply-KA5SIYWX.js +0 -62
  130. package/dist/usage-7ALXBJVJ.js +0 -10
@@ -2,7 +2,7 @@ import {
2
2
  DISCONNECT_AGENT_IDS,
3
3
  SETUP_AGENT_CHOICES,
4
4
  isApprovalMode
5
- } from "./chunk-762CDAJJ.js";
5
+ } from "./chunk-AXJLJJ3M.js";
6
6
 
7
7
  // src/cli/mode-request.ts
8
8
  var parseDuration = (value) => {
@@ -146,6 +146,16 @@ var resolveCommandName = (token) => {
146
146
  };
147
147
  var isInvocationOf = (token, name) => resolveCommandName(token) === name;
148
148
  var COMMAND_OPTIONS = {
149
+ login: [
150
+ ["--with-token", "Read an API key from stdin"],
151
+ ["--no-browser", "Print the sign-in link without opening a browser"],
152
+ ["--json", "Emit the result as one object instead of the screen"],
153
+ ["--force", "Start a new sign-in instead of reusing the saved key"]
154
+ ],
155
+ pair: [
156
+ ["--app", "Pair with the Pushary app"],
157
+ ["--browser", "Pair through a browser (default)"]
158
+ ],
149
159
  cowork: [
150
160
  ["--open", "Also open the setup guide in your browser"],
151
161
  ["--instructions", "Print standing instructions to paste into Cowork"],
@@ -6,38 +6,39 @@ import {
6
6
  } from "./chunk-QW3FRUFB.js";
7
7
  import {
8
8
  ensureDaemonRunning
9
- } from "./chunk-4QF2YLYK.js";
9
+ } from "./chunk-LBHJJEKT.js";
10
10
  import {
11
11
  hookOwnerOf
12
- } from "./chunk-X4ES7QBT.js";
12
+ } from "./chunk-BJTSKOH3.js";
13
13
  import {
14
14
  buildTranscriptRecords,
15
15
  decodePublicKey,
16
16
  generateSessionKey,
17
17
  wrapSessionKey
18
- } from "./chunk-PVANKDWM.js";
18
+ } from "./chunk-2AELPDMT.js";
19
19
  import {
20
20
  fetchTranscriptRecipients,
21
21
  uploadTranscriptRecords
22
- } from "./chunk-3N2ZTHZZ.js";
22
+ } from "./chunk-GAMVAORR.js";
23
23
  import {
24
24
  transcriptEnvironmentPreference,
25
25
  transcriptsEnabled
26
- } from "./chunk-D6CXQIXO.js";
26
+ } from "./chunk-7JXJJNQ5.js";
27
27
  import {
28
28
  readTranscriptPreference
29
- } from "./chunk-KAJDKYUM.js";
29
+ } from "./chunk-WN3RACVD.js";
30
30
  import {
31
+ claudeConfigDir,
31
32
  codexHome,
32
33
  pusharyDir
33
- } from "./chunk-KZCYHWDF.js";
34
+ } from "./chunk-MWLTTLPK.js";
34
35
  import {
35
36
  writeJsonAtomic
36
37
  } from "./chunk-QENTGE75.js";
37
38
  import {
38
39
  getApiKey,
39
40
  getBaseUrl
40
- } from "./chunk-4XXZUFWN.js";
41
+ } from "./chunk-BG4Y64FW.js";
41
42
 
42
43
  // src/transcript-registration.ts
43
44
  import { createHash } from "crypto";
@@ -92,7 +93,6 @@ var transcriptLinesSeenLive = (lines, epochStartedAtMs, startedBeforeEpoch) => l
92
93
  });
93
94
 
94
95
  // src/transcript-sync.ts
95
- import { homedir as homedir2 } from "os";
96
96
  import { join as join2, resolve } from "path";
97
97
  import { closeSync, existsSync as existsSync2, fstatSync, openSync, readFileSync as readFileSync2, readSync, statSync as statSync2 } from "fs";
98
98
 
@@ -165,7 +165,7 @@ var sweepStaleSessionKeys = (now = Date.now(), dir = sessionDir()) => {
165
165
  // src/transcript-sync.ts
166
166
  var claudeTranscriptPath = (cwd, sessionId) => {
167
167
  const projectId = resolve(cwd).replace(/[^a-zA-Z0-9-]/g, "-");
168
- const configDir = process.env.CLAUDE_CONFIG_DIR || join2(homedir2(), ".claude");
168
+ const configDir = claudeConfigDir();
169
169
  return join2(configDir, "projects", projectId, `${sessionId}.jsonl`);
170
170
  };
171
171
  var createSyncState = () => ({
@@ -446,7 +446,7 @@ var startTranscriptSync = (opts) => {
446
446
  };
447
447
 
448
448
  // src/transcript-registration.ts
449
- import { homedir as homedir3 } from "os";
449
+ import { homedir as homedir2 } from "os";
450
450
  var defaultRegistryDirectory = () => process.env.PUSHARY_TRANSCRIPT_REGISTRY_DIR || join3(pusharyDir(), "transcript-capture");
451
451
  var cliRegistry = (apiKey = getApiKey()) => ({ apiKey, baseUrl: getBaseUrl(), directory: defaultRegistryDirectory() });
452
452
  var accountFor = (registry) => createHash("sha256").update(`${registry.baseUrl}\0${registry.apiKey}`).digest("hex");
@@ -466,7 +466,7 @@ var registeredTranscriptEnabled = (apiKey, sessionId) => {
466
466
  }
467
467
  };
468
468
  var macOwnsClaudeHooks = (cwd) => [
469
- join3(process.env.CLAUDE_CONFIG_DIR || join3(homedir3(), ".claude"), "settings.json"),
469
+ join3(claudeConfigDir(), "settings.json"),
470
470
  join3(cwd, ".claude", "settings.json"),
471
471
  join3(cwd, ".claude", "settings.local.json")
472
472
  ].some((path) => {
@@ -478,7 +478,7 @@ var macOwnsClaudeHooks = (cwd) => [
478
478
  });
479
479
  var TRANSCRIPT_ROOT_NAME = { claude: "projects", codex: "sessions" };
480
480
  var transcriptRoots = (source) => {
481
- const home = homedir3();
481
+ const home = homedir2();
482
482
  if (source === "codex") return [join3(codexHome(), TRANSCRIPT_ROOT_NAME.codex)];
483
483
  const configured = process.env.CLAUDE_CONFIG_DIR;
484
484
  return [join3(configured || join3(home, ".claude"), TRANSCRIPT_ROOT_NAME.claude), join3(home, ".claude", TRANSCRIPT_ROOT_NAME.claude)];
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-3EGEA4KH.js";
10
10
  import {
11
11
  getBaseUrl
12
- } from "./chunk-4XXZUFWN.js";
12
+ } from "./chunk-BG4Y64FW.js";
13
13
 
14
14
  // src/cli/login-ui.ts
15
15
  import { hostname } from "os";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  realpath
3
- } from "./chunk-M6MOQBR5.js";
3
+ } from "./chunk-USE5IEEW.js";
4
4
  import {
5
5
  findNativeClaudeInstall
6
6
  } from "./chunk-VUFHYMSP.js";
@@ -13,10 +13,10 @@ import {
13
13
  resolvePackageVersionFromBinary,
14
14
  resolvePathBinary,
15
15
  resolvePathBinaryAsync
16
- } from "./chunk-US3IT6ZC.js";
16
+ } from "./chunk-CJ5TCFD4.js";
17
17
  import {
18
18
  MANAGED_PROVIDERS
19
- } from "./chunk-762CDAJJ.js";
19
+ } from "./chunk-AXJLJJ3M.js";
20
20
 
21
21
  // src/live-capabilities.ts
22
22
  import { homedir } from "os";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getBaseUrl
3
- } from "./chunk-4XXZUFWN.js";
3
+ } from "./chunk-BG4Y64FW.js";
4
4
 
5
5
  // src/transcript-api.ts
6
6
  var fetchTranscriptRecipients = async (apiKey, baseUrl = getBaseUrl()) => {
@@ -1,21 +1,22 @@
1
1
  import {
2
2
  openCodeConfigDirFrom
3
- } from "./chunk-JBCMXSBO.js";
3
+ } from "./chunk-ZGU3NXL2.js";
4
4
  import {
5
5
  nativeClaudeInstallPath
6
6
  } from "./chunk-VUFHYMSP.js";
7
7
  import {
8
8
  grokHome
9
- } from "./chunk-KQWN7C5C.js";
9
+ } from "./chunk-GKFO5JLN.js";
10
10
  import {
11
+ claudeConfigDir,
11
12
  codexHomeFrom
12
- } from "./chunk-KZCYHWDF.js";
13
+ } from "./chunk-MWLTTLPK.js";
13
14
  import {
14
15
  resolvePathBinary
15
- } from "./chunk-US3IT6ZC.js";
16
+ } from "./chunk-CJ5TCFD4.js";
16
17
  import {
17
18
  HOOK_COMPATIBLE_PROFILES
18
- } from "./chunk-762CDAJJ.js";
19
+ } from "./chunk-AXJLJJ3M.js";
19
20
 
20
21
  // src/hermes-config.ts
21
22
  import { execFileSync } from "child_process";
@@ -510,7 +511,7 @@ var agentProbes = (home = homedir3(), platform = process.platform) => ({
510
511
  binary: "claude",
511
512
  // The native installer puts it here, outside a default non-login PATH.
512
513
  paths: [nativeClaudeInstallPath(home, platform)],
513
- configMarkers: [join3(home, ".claude")]
514
+ configMarkers: [claudeConfigDir(home)]
514
515
  },
515
516
  codex: {
516
517
  binary: "codex",
@@ -3,18 +3,18 @@ import {
3
3
  addGeminiMcpServer,
4
4
  removeGeminiMcpServer,
5
5
  supportedClaudeEvents
6
- } from "./chunk-TDOKDCFH.js";
6
+ } from "./chunk-RGSW36XH.js";
7
7
  import {
8
8
  CLAUDE_CODE_AGENT,
9
9
  compatibleToolLookup
10
- } from "./chunk-5JWCWALO.js";
10
+ } from "./chunk-DQLCFGHK.js";
11
11
  import {
12
12
  guardBinary,
13
13
  guardBinaryRefusing,
14
14
  holdBudgetOf,
15
15
  isProtectedByScope,
16
16
  registerHookEntry
17
- } from "./chunk-KZCYHWDF.js";
17
+ } from "./chunk-MWLTTLPK.js";
18
18
  import {
19
19
  HOOK_COMPATIBLE_PROFILES,
20
20
  HOOK_LOCATOR_BINARY,
@@ -26,7 +26,7 @@ import {
26
26
  pusharyMissingReason,
27
27
  refusalOutput,
28
28
  withHookHoldBudget
29
- } from "./chunk-762CDAJJ.js";
29
+ } from "./chunk-AXJLJJ3M.js";
30
30
 
31
31
  // src/claude-config.ts
32
32
  import { join } from "path";
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  compatibleConfigFile,
3
3
  hasCompatibleHooks
4
- } from "./chunk-KQWN7C5C.js";
4
+ } from "./chunk-GKFO5JLN.js";
5
5
  import {
6
6
  pusharyHookExecutable
7
- } from "./chunk-X4ES7QBT.js";
7
+ } from "./chunk-BJTSKOH3.js";
8
8
  import {
9
9
  isProtectedByScope,
10
10
  registerHookEntry
11
- } from "./chunk-KZCYHWDF.js";
11
+ } from "./chunk-MWLTTLPK.js";
12
12
  import {
13
13
  isRecord
14
- } from "./chunk-762CDAJJ.js";
14
+ } from "./chunk-AXJLJJ3M.js";
15
15
 
16
16
  // src/cursor-config.ts
17
17
  var hookCommandOf = (entry) => {
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  callMcpTool
3
- } from "./chunk-5EFNBL6V.js";
3
+ } from "./chunk-XAO6EYGM.js";
4
4
  import {
5
5
  NPX_LATEST_COMMAND
6
- } from "./chunk-BMPZ5HVJ.js";
6
+ } from "./chunk-ERK24P76.js";
7
7
  import {
8
8
  classifyConfirmResponse,
9
9
  isAnswerSource
10
- } from "./chunk-762CDAJJ.js";
10
+ } from "./chunk-AXJLJJ3M.js";
11
11
 
12
12
  // src/reach.ts
13
13
  var reachVerdict = (channels) => {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  guardBinary
3
- } from "./chunk-KZCYHWDF.js";
3
+ } from "./chunk-MWLTTLPK.js";
4
4
 
5
5
  // src/bell/install.ts
6
6
  import { join } from "path";
@@ -3,10 +3,10 @@ import {
3
3
  forkFinishWithUpgradeLock,
4
4
  installWithUpgradeLock,
5
5
  releaseAutoUpdateLock
6
- } from "./chunk-BRUHVTFB.js";
6
+ } from "./chunk-4N5E4JNF.js";
7
7
  import {
8
8
  phoneStartIsRequired
9
- } from "./chunk-5PP4455M.js";
9
+ } from "./chunk-G36T5LAP.js";
10
10
  import {
11
11
  describeAutoUpdateCheck,
12
12
  globalInstallLocation,
@@ -18,7 +18,7 @@ import {
18
18
  readAutoUpdateState,
19
19
  updateAutoUpdateState,
20
20
  upgradeEntryFor
21
- } from "./chunk-5BNXJTOZ.js";
21
+ } from "./chunk-7HDGH3Z2.js";
22
22
  import {
23
23
  EXIT
24
24
  } from "./chunk-KZERVKTD.js";
@@ -26,17 +26,17 @@ import {
26
26
  autoUpdateLock,
27
27
  autoUpdateLog,
28
28
  autoUpdateState
29
- } from "./chunk-KZCYHWDF.js";
29
+ } from "./chunk-MWLTTLPK.js";
30
30
  import {
31
31
  execNpm,
32
32
  fetchLatestPublishedVersion,
33
33
  npmErrorMessage,
34
34
  readGlobalCliInstallAt,
35
35
  readGlobalPrefix
36
- } from "./chunk-US3IT6ZC.js";
36
+ } from "./chunk-CJ5TCFD4.js";
37
37
  import {
38
38
  NPX_LATEST_COMMAND
39
- } from "./chunk-BMPZ5HVJ.js";
39
+ } from "./chunk-ERK24P76.js";
40
40
  import {
41
41
  commandsPackage,
42
42
  globalUpgradeEntry,
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-KZERVKTD.js";
4
4
  import {
5
5
  renderCommandHelp
6
- } from "./chunk-BMPZ5HVJ.js";
6
+ } from "./chunk-ERK24P76.js";
7
7
  import {
8
8
  getPackageVersion
9
9
  } from "./chunk-QTOLNRET.js";
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  macAppBridgeAvailable
3
- } from "./chunk-JBCMXSBO.js";
3
+ } from "./chunk-ZGU3NXL2.js";
4
4
  import {
5
5
  keyPrefix
6
- } from "./chunk-KAJDKYUM.js";
6
+ } from "./chunk-WN3RACVD.js";
7
7
  import {
8
8
  bridgeAgentKey
9
- } from "./chunk-KZCYHWDF.js";
9
+ } from "./chunk-MWLTTLPK.js";
10
10
  import {
11
11
  readJsonSafe
12
12
  } from "./chunk-QENTGE75.js";
13
13
  import {
14
14
  isValidApiKey
15
- } from "./chunk-762CDAJJ.js";
15
+ } from "./chunk-AXJLJJ3M.js";
16
16
 
17
17
  // src/shared-mcp-key.ts
18
18
  var asRecord = (value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0;
@@ -4,16 +4,16 @@ import {
4
4
  } from "./chunk-XHKBHWLX.js";
5
5
  import {
6
6
  readControlMode
7
- } from "./chunk-KAJDKYUM.js";
7
+ } from "./chunk-WN3RACVD.js";
8
8
  import {
9
9
  getMachineId
10
- } from "./chunk-M46WDK64.js";
10
+ } from "./chunk-SFAP4AJY.js";
11
11
  import {
12
12
  pusharyDir
13
- } from "./chunk-KZCYHWDF.js";
13
+ } from "./chunk-MWLTTLPK.js";
14
14
  import {
15
15
  resolveGlobalBinary
16
- } from "./chunk-US3IT6ZC.js";
16
+ } from "./chunk-CJ5TCFD4.js";
17
17
  import {
18
18
  readJsonSafe,
19
19
  writeFileAtomic,
@@ -22,7 +22,7 @@ import {
22
22
  } from "./chunk-QENTGE75.js";
23
23
  import {
24
24
  getApiKey
25
- } from "./chunk-4XXZUFWN.js";
25
+ } from "./chunk-BG4Y64FW.js";
26
26
  import {
27
27
  CLI_PACKAGE_NAMES,
28
28
  cmdShimTarget,
@@ -32,7 +32,7 @@ import {
32
32
  } from "./chunk-QTOLNRET.js";
33
33
  import {
34
34
  isRecord
35
- } from "./chunk-762CDAJJ.js";
35
+ } from "./chunk-AXJLJJ3M.js";
36
36
 
37
37
  // src/daemon-lifecycle.ts
38
38
  import { dirname, join, win32 as win32Path } from "path";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  pusharyDir
3
- } from "./chunk-KZCYHWDF.js";
3
+ } from "./chunk-MWLTTLPK.js";
4
4
  import {
5
5
  readJsonSafe,
6
6
  writeFileAtomic
@@ -13,7 +13,7 @@ import {
13
13
  serializeDeclinedAgents,
14
14
  withDeclinedAgent,
15
15
  withoutDeclinedAgent
16
- } from "./chunk-762CDAJJ.js";
16
+ } from "./chunk-AXJLJJ3M.js";
17
17
 
18
18
  // src/declined-agents-file.ts
19
19
  import { join } from "path";
@@ -0,0 +1,9 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __export = (target, all) => {
3
+ for (var name in all)
4
+ __defProp(target, name, { get: all[name], enumerable: true });
5
+ };
6
+
7
+ export {
8
+ __export
9
+ };
@@ -1,21 +1,31 @@
1
1
  import {
2
- quoteIfNeeded
3
- } from "./chunk-US3IT6ZC.js";
2
+ quoteIfNeeded,
3
+ shellDoubleQuoted
4
+ } from "./chunk-CJ5TCFD4.js";
4
5
  import {
5
6
  CODEX_QUESTION_TOOLS,
6
7
  HOOK_BUDGETS,
7
8
  HOOK_LOCATOR_BINARY,
8
9
  withHookHoldBudget
9
- } from "./chunk-762CDAJJ.js";
10
+ } from "./chunk-AXJLJJ3M.js";
10
11
 
11
12
  // src/setup/paths.ts
12
- import { homedir as homedir2 } from "os";
13
- import { join as join2 } from "path";
13
+ import { createHash as createHash2 } from "crypto";
14
+
15
+ // src/claude-config-paths.ts
16
+ import { homedir } from "os";
17
+ import { join, resolve } from "path";
18
+ var claudeConfigDir = (home = homedir(), environment = process.env) => resolve(environment.CLAUDE_CONFIG_DIR || join(home, ".claude"));
19
+ var claudeUserConfigFile = (home = homedir(), environment = process.env) => join(environment.CLAUDE_CONFIG_DIR ? claudeConfigDir(home, environment) : home, ".claude.json");
20
+
21
+ // src/setup/paths.ts
22
+ import { homedir as homedir3 } from "os";
23
+ import { join as join3 } from "path";
14
24
 
15
25
  // src/codex-config.ts
16
26
  import { createHash } from "crypto";
17
- import { homedir } from "os";
18
- import { join } from "path";
27
+ import { homedir as homedir2 } from "os";
28
+ import { join as join2 } from "path";
19
29
 
20
30
  // src/registration-holder.ts
21
31
  var asRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value) ? value : null;
@@ -52,7 +62,6 @@ var holdBudgetOf = (hook) => hook.holds ? hook.timeout : void 0;
52
62
  var LOCATE = 'B=$(command -v "$0") || exit 0; [ -f "$B" ] || exit 0; [ -x "$B" ] || exit 0';
53
63
  var NODE_PRESENT = "command -v node >/dev/null 2>&1 || exit 0";
54
64
  var CURSOR_NO_OPINION = { permission: "deny", user_message: "Command denied via Pushary.", agent_message: "Pushary hook is unavailable. Repair the integration before retrying." };
55
- var shellDoubleQuoted = (text) => `"${text.replace(/(["\\$`])/g, "\\$1")}"`;
56
65
  var CURSOR_NATIVE_PROMPT = { permission: "ask" };
57
66
  var CURSOR_NATIVE_PROMPT_EVENTS = ["beforeShellExecution", "beforeMCPExecution"];
58
67
  var hookEventIsOneOf = (events) => events.flatMap((event) => [`*\\"hook_event_name\\":\\"${event}\\"*`, `*\\"hook_event_name\\":\\ \\"${event}\\"*`]).join("|");
@@ -80,7 +89,7 @@ var guardKindOf = (target) => {
80
89
  var targetPath = (target) => target.kind === "binary" ? target.path : target.script;
81
90
  var runsThroughNode = (target) => target.kind !== "binary";
82
91
  var guardHookCommand = (target, platform = process.platform) => {
83
- const path = quoteIfNeeded(targetPath(target));
92
+ const path = quoteIfNeeded(targetPath(target), platform);
84
93
  if (platform === "win32") return runsThroughNode(target) ? `node ${path}` : path;
85
94
  return `${HOOK_SHELL} '${HOOK_GUARD_SCRIPTS[guardKindOf(target)]}' ${path}`;
86
95
  };
@@ -135,13 +144,13 @@ var canonicalJson = (value) => {
135
144
 
136
145
  // src/codex-config.ts
137
146
  var CODEX_HOOK_BINARY = "pushary-codex-hook";
138
- var codexHome = () => codexHomeFrom(homedir());
139
- var codexHomeFrom = (home) => process.env.CODEX_HOME?.trim() || join(home, ".codex");
140
- var codexConfigToml = () => join(codexHome(), "config.toml");
141
- var codexHooksJsonIn = (home) => join(home, "hooks.json");
147
+ var codexHome = () => codexHomeFrom(homedir2());
148
+ var codexHomeFrom = (home) => process.env.CODEX_HOME?.trim() || join2(home, ".codex");
149
+ var codexConfigToml = () => join2(codexHome(), "config.toml");
150
+ var codexHooksJsonIn = (home) => join2(home, "hooks.json");
142
151
  var codexHooksJson = () => codexHooksJsonIn(codexHome());
143
- var codexAgentsMd = () => join(codexHome(), "AGENTS.md");
144
- var codexSkillDir = () => join(codexHome(), "skills", "pushary");
152
+ var codexAgentsMd = () => join2(codexHome(), "AGENTS.md");
153
+ var codexSkillDir = () => join2(codexHome(), "skills", "pushary");
145
154
  var CODEX_TOOL_CALL_MATCHER = "Bash|apply_patch|mcp__.*";
146
155
  var CODEX_PRE_TOOL_USE_MATCHER = [CODEX_TOOL_CALL_MATCHER, ...CODEX_QUESTION_TOOLS].join("|");
147
156
  var CODEX_HOOK_EVENTS = [
@@ -192,18 +201,59 @@ var ensureRecord = (target, key) => {
192
201
  return created;
193
202
  };
194
203
  var CODEX_MCP_URL = "https://pushary.com/api/mcp/mcp";
195
- var addCodexMcpServer = (config, apiKey) => {
204
+ var CODEX_HTTP_ONLY_FIELDS = ["url", "http_headers", "env_http_headers", "http_headers_helper", "bearer_token", "bearer_token_env_var", "auth", "oauth", "oauth_resource"];
205
+ var NATIVE_MCP_TRANSPORT_FIELDS = [...CODEX_HTTP_ONLY_FIELDS, "args", "env", "env_vars", "cwd"];
206
+ var OLD_CLI_HTTP_FIELDS = /* @__PURE__ */ new Set(["url", "http_headers"]);
207
+ var nativeCodexMcpCommand = () => join2(homedir2(), ".pushary", "bin", "pushary-mcp");
208
+ var isNativeCodexMcpEntry = (entry, command) => {
209
+ const server = asRecord2(entry);
210
+ return server?.command === command && NATIVE_MCP_TRANSPORT_FIELDS.every((field) => !(field in server));
211
+ };
212
+ var carriesOnlyAnAuthorizationHeader = (headers) => {
213
+ const record = asRecord2(headers);
214
+ return record !== void 0 && Object.keys(record).length === 1 && typeof record.Authorization === "string";
215
+ };
216
+ var isOldCliMixedCodexMcpEntry = (entry, command) => {
217
+ const server = asRecord2(entry);
218
+ return server?.command === command && server.url === CODEX_MCP_URL && carriesOnlyAnAuthorizationHeader(server.http_headers) && NATIVE_MCP_TRANSPORT_FIELDS.every((field) => OLD_CLI_HTTP_FIELDS.has(field) || !(field in server));
219
+ };
220
+ var codexMcpMixesCommandWithHttp = (entry) => {
221
+ const server = asRecord2(entry);
222
+ return server !== void 0 && "command" in server && CODEX_HTTP_ONLY_FIELDS.some((field) => field in server);
223
+ };
224
+ var CODEX_RESTART_AFTER_TRANSPORT_CHANGE = "Fully quit and reopen Codex to load the updated Pushary configuration.";
225
+ var codexMcpStartsCommand = (config) => {
226
+ const pushary = asRecord2(asRecord2(config.mcp_servers)?.pushary);
227
+ return pushary !== void 0 && "command" in pushary && pushary.enabled !== false;
228
+ };
229
+ var addCodexMcpServer = (config, apiKey, nativeOwnership = "preserve") => {
230
+ const existing = asRecord2(asRecord2(config.mcp_servers)?.pushary);
231
+ if (existing !== void 0 && "command" in existing) {
232
+ const command = nativeCodexMcpCommand();
233
+ if (!isOldCliMixedCodexMcpEntry(existing, command) && !isNativeCodexMcpEntry(existing, command)) {
234
+ throw new Error("Pushary MCP has an unrecognized or mixed transport. Its configuration was left unchanged.");
235
+ }
236
+ if (nativeOwnership === "preserve") {
237
+ for (const field of OLD_CLI_HTTP_FIELDS) delete existing[field];
238
+ return "kept-native";
239
+ }
240
+ }
196
241
  const servers = ensureRecord(config, "mcp_servers");
197
242
  const pushary = ensureRecord(servers, "pushary");
243
+ delete pushary.command;
198
244
  pushary.url = CODEX_MCP_URL;
199
245
  ensureRecord(pushary, "http_headers").Authorization = `Bearer ${apiKey}`;
200
246
  pushary.default_tools_approval_mode = "approve";
201
247
  delete pushary.bearer_token_env_var;
202
248
  delete pushary.tools;
249
+ return "wrote-key";
203
250
  };
204
251
  var readCodexMcpAuth = (config) => {
205
252
  const pushary = asRecord2(asRecord2(config.mcp_servers)?.pushary);
206
253
  if (!pushary) return void 0;
254
+ if ("command" in pushary) {
255
+ return isNativeCodexMcpEntry(pushary, nativeCodexMcpCommand()) ? { method: "native" } : void 0;
256
+ }
207
257
  const authorization = asRecord2(pushary.http_headers)?.Authorization;
208
258
  if (typeof authorization === "string" && authorization.startsWith("Bearer ")) {
209
259
  return { method: "embedded", key: authorization.slice("Bearer ".length).trim() };
@@ -446,45 +496,49 @@ var staleTrustKeys = (state, hooksJsonPath, event, currentKey, ourHash) => {
446
496
  };
447
497
 
448
498
  // src/setup/paths.ts
449
- var claudeSettings = () => join2(homedir2(), ".claude", "settings.json");
450
- var claudeJson = () => join2(homedir2(), ".claude.json");
451
- var claudeSkillDir = () => join2(homedir2(), ".claude", "skills", "pushary");
452
- var cursorPluginDir = () => join2(homedir2(), ".cursor", "plugins", "local", "pushary");
453
- var cursorUserHooks = () => join2(homedir2(), ".cursor", "hooks.json");
454
- var cursorPluginMcp = () => join2(cursorPluginDir(), "mcp.json");
455
- var cursorPluginManifest = () => join2(cursorPluginDir(), ".cursor-plugin", "plugin.json");
456
- var cursorPluginRule = () => join2(cursorPluginDir(), "rules", "pushary.mdc");
457
- var cursorUserMcp = () => join2(homedir2(), ".cursor", "mcp.json");
458
- var vscodePluginDir = () => join2(homedir2(), ".pushary", "plugins", "vscode");
459
- var vscodePluginMcp = () => join2(vscodePluginDir(), ".mcp.json");
460
- var claudeSettingsLocal = () => join2(homedir2(), ".claude", "settings.local.json");
461
- var pusharyDir = () => join2(homedir2(), ".pushary");
462
- var claudeMcpReceipt = () => join2(pusharyDir(), "setup", "claude-mcp.json");
463
- var bridgeAgentKey = () => join2(pusharyDir(), "bridge-auth", "agent-key.json");
464
- var autoUpdateState = () => join2(pusharyDir(), "auto-update.json");
465
- var autoUpdateLock = () => join2(pusharyDir(), "auto-update.lock");
466
- var serviceOwedBackMark = () => join2(pusharyDir(), "service-owed-back");
467
- var autoUpdateLog = () => join2(pusharyDir(), "logs", "auto-update.log");
468
- var clientReportClaims = () => join2(pusharyDir(), "client-reports");
469
- var claudeRegistrationReceipt = () => join2(pusharyDir(), "setup", "claude-registration.json");
470
- var hermesConfig = () => join2(homedir2(), ".hermes", "config.yaml");
471
- var hermesConfigReceipt = () => join2(pusharyDir(), "setup", "hermes-config.json");
472
- var fxQuestionRuleReceipt = () => join2(pusharyDir(), "setup", "fx-question-rule.json");
473
- var hookTakeoverReceipt = (agent) => join2(pusharyDir(), "setup", `hook-takeover-${agent}.json`);
474
- var codexSkillDir2 = () => join2(codexHome(), "skills", "pushary");
475
- var codexAgentsMd2 = () => join2(codexHome(), "AGENTS.md");
476
- var geminiSettings = () => join2(homedir2(), ".gemini", "settings.json");
477
- var geminiMd = () => join2(homedir2(), ".gemini", "GEMINI.md");
478
- var pusharyConfigFile = () => join2(homedir2(), ".pushary", "config.json");
479
- var fxConfigDir = () => join2(homedir2(), ".fx");
480
- var fxMcpProfile = () => join2(fxConfigDir(), "mcp.json");
481
- var fxSettings = () => join2(fxConfigDir(), "settings.json");
482
- var fxAgentsMd = () => join2(fxConfigDir(), "AGENTS.md");
499
+ var claudeSettings = (environment = process.env) => join3(claudeConfigDir(homedir3(), environment), "settings.json");
500
+ var claudeJson = (environment = process.env) => claudeUserConfigFile(homedir3(), environment);
501
+ var claudeSkillDir = (environment = process.env) => join3(claudeConfigDir(homedir3(), environment), "skills", "pushary");
502
+ var cursorPluginDir = () => join3(homedir3(), ".cursor", "plugins", "local", "pushary");
503
+ var cursorUserHooks = () => join3(homedir3(), ".cursor", "hooks.json");
504
+ var cursorPluginMcp = () => join3(cursorPluginDir(), "mcp.json");
505
+ var cursorPluginManifest = () => join3(cursorPluginDir(), ".cursor-plugin", "plugin.json");
506
+ var cursorPluginRule = () => join3(cursorPluginDir(), "rules", "pushary.mdc");
507
+ var cursorUserMcp = () => join3(homedir3(), ".cursor", "mcp.json");
508
+ var vscodePluginDir = () => join3(homedir3(), ".pushary", "plugins", "vscode");
509
+ var vscodePluginMcp = () => join3(vscodePluginDir(), ".mcp.json");
510
+ var claudeSettingsLocal = () => join3(claudeConfigDir(), "settings.local.json");
511
+ var pusharyDir = () => join3(homedir3(), ".pushary");
512
+ var claudeSetupDir = () => process.env.CLAUDE_CONFIG_DIR ? join3(pusharyDir(), "setup", "claude-profiles", createHash2("sha256").update(claudeUserConfigFile()).digest("hex").slice(0, 32)) : join3(pusharyDir(), "setup");
513
+ var claudeMcpReceipt = () => join3(claudeSetupDir(), "claude-mcp.json");
514
+ var bridgeAgentKey = () => join3(pusharyDir(), "bridge-auth", "agent-key.json");
515
+ var autoUpdateState = () => join3(pusharyDir(), "auto-update.json");
516
+ var autoUpdateLock = () => join3(pusharyDir(), "auto-update.lock");
517
+ var serviceOwedBackMark = () => join3(pusharyDir(), "service-owed-back");
518
+ var autoUpdateLog = () => join3(pusharyDir(), "logs", "auto-update.log");
519
+ var clientReportClaims = () => join3(pusharyDir(), "client-reports");
520
+ var claudeRegistrationReceipt = () => join3(claudeSetupDir(), "claude-registration.json");
521
+ var hermesConfig = () => join3(homedir3(), ".hermes", "config.yaml");
522
+ var hermesConfigReceipt = () => join3(pusharyDir(), "setup", "hermes-config.json");
523
+ var fxQuestionRuleReceipt = () => join3(pusharyDir(), "setup", "fx-question-rule.json");
524
+ var hookTakeoverReceipt = (agent) => join3(agent === "claude_code" ? claudeSetupDir() : join3(pusharyDir(), "setup"), `hook-takeover-${agent}.json`);
525
+ var codexSkillDir2 = () => join3(codexHome(), "skills", "pushary");
526
+ var codexAgentsMd2 = () => join3(codexHome(), "AGENTS.md");
527
+ var geminiSettings = () => join3(homedir3(), ".gemini", "settings.json");
528
+ var geminiMd = () => join3(homedir3(), ".gemini", "GEMINI.md");
529
+ var pusharyConfigFile = () => join3(homedir3(), ".pushary", "config.json");
530
+ var fxConfigDir = () => join3(homedir3(), ".fx");
531
+ var fxMcpProfile = () => join3(fxConfigDir(), "mcp.json");
532
+ var fxSettings = () => join3(fxConfigDir(), "settings.json");
533
+ var fxAgentsMd = () => join3(fxConfigDir(), "AGENTS.md");
483
534
 
484
535
  export {
536
+ claudeConfigDir,
537
+ claudeUserConfigFile,
485
538
  registeredCommands,
486
539
  namesOurBinary,
487
540
  registrationHolderOf,
541
+ HOOK_SHELL,
488
542
  holdBudgetOf,
489
543
  guardBinary,
490
544
  guardBinaryRefusing,
@@ -504,6 +558,9 @@ export {
504
558
  codexSkillDir,
505
559
  CODEX_HOOK_EVENTS,
506
560
  CODEX_REQUIRED_APPROVAL_EVENTS,
561
+ codexMcpMixesCommandWithHttp,
562
+ CODEX_RESTART_AFTER_TRANSPORT_CHANGE,
563
+ codexMcpStartsCommand,
507
564
  addCodexMcpServer,
508
565
  readCodexMcpAuth,
509
566
  isPusharyCodexCommand,