@pushary/agent-hooks 1.9.80 → 1.9.82

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 (132) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +4 -4
  3. package/data/SKILL.md +12 -16
  4. package/data/cursor-plugin/README.md +1 -1
  5. package/data/cursor-plugin/skills/pushary/SKILL.md +11 -15
  6. package/data/vscode-plugin/README.md +1 -1
  7. package/data/vscode-plugin/skills/pushary/SKILL.md +11 -15
  8. package/dist/{api-FPA2PPXY.js → api-TZO5ACOS.js} +11 -11
  9. package/dist/bin/pushary-bell-hook.js +26 -26
  10. package/dist/bin/pushary-bell.js +11 -11
  11. package/dist/bin/pushary-claude.js +27 -27
  12. package/dist/bin/pushary-clean.js +34 -34
  13. package/dist/bin/pushary-codex-bridge.js +22 -22
  14. package/dist/bin/pushary-codex-hook.js +31 -31
  15. package/dist/bin/pushary-codex-session.js +8 -8
  16. package/dist/bin/pushary-codex.js +14 -14
  17. package/dist/bin/pushary-connect.js +27 -27
  18. package/dist/bin/pushary-cowork.js +6 -6
  19. package/dist/bin/pushary-daemon.js +39 -39
  20. package/dist/bin/pushary-disconnect.js +26 -26
  21. package/dist/bin/pushary-display-hook.js +17 -17
  22. package/dist/bin/pushary-doctor.js +48 -44
  23. package/dist/bin/pushary-elicitation-hook.js +26 -26
  24. package/dist/bin/pushary-gemini-bridge.js +16 -16
  25. package/dist/bin/pushary-gemini-hook.js +28 -28
  26. package/dist/bin/pushary-hook.js +30 -30
  27. package/dist/bin/pushary-login.js +21 -21
  28. package/dist/bin/pushary-logout.js +25 -25
  29. package/dist/bin/pushary-mcp.js +12 -12
  30. package/dist/bin/pushary-mode.js +16 -16
  31. package/dist/bin/pushary-notification-hook.js +25 -25
  32. package/dist/bin/pushary-opencode-hook.js +27 -27
  33. package/dist/bin/pushary-permission-denied-hook.js +30 -30
  34. package/dist/bin/pushary-permission-hook.js +30 -30
  35. package/dist/bin/pushary-post-hook.js +25 -25
  36. package/dist/bin/pushary-prompt-hook.js +25 -25
  37. package/dist/bin/pushary-session-end-hook.js +27 -27
  38. package/dist/bin/pushary-session-start-hook.js +35 -35
  39. package/dist/bin/pushary-setup.js +54 -59
  40. package/dist/bin/pushary-stats.js +6 -6
  41. package/dist/bin/pushary-status.js +32 -32
  42. package/dist/bin/pushary-stop-hook.js +25 -25
  43. package/dist/bin/pushary-stopfailure-hook.js +25 -25
  44. package/dist/bin/pushary-suggestions.js +16 -16
  45. package/dist/bin/pushary-transcript-register.js +17 -17
  46. package/dist/bin/pushary-transcripts.js +19 -19
  47. package/dist/bin/pushary-upgrade.js +40 -40
  48. package/dist/bin/pushary-wait.js +16 -16
  49. package/dist/bin/pushary.js +8 -8
  50. package/dist/{chunk-IRE7HPNI.js → chunk-2BJZFA7X.js} +7 -5
  51. package/dist/{chunk-PJRXYNXG.js → chunk-2TEX3APZ.js} +5 -5
  52. package/dist/{chunk-OJS32QPK.js → chunk-3BFCJZBU.js} +1 -1
  53. package/dist/{chunk-N3DOT42Y.js → chunk-3UBYG4G7.js} +6 -6
  54. package/dist/{chunk-TSCACSAR.js → chunk-3V6G2GBJ.js} +6 -6
  55. package/dist/{chunk-DFW2JKHX.js → chunk-4S5XVFDV.js} +1 -1
  56. package/dist/{chunk-WJVQOAZY.js → chunk-4TR4G7A4.js} +1 -1
  57. package/dist/{chunk-3G2D5NAG.js → chunk-5LLZSX7I.js} +3 -3
  58. package/dist/{chunk-4OXYED6O.js → chunk-5TMGEQAC.js} +4 -4
  59. package/dist/{chunk-HJZDJS63.js → chunk-6224ENW3.js} +3 -3
  60. package/dist/{chunk-B67R6ZCW.js → chunk-6355HHSR.js} +2 -2
  61. package/dist/{chunk-FZJON3RK.js → chunk-6L2U3TP3.js} +20 -19
  62. package/dist/{chunk-YEPXSGFC.js → chunk-72CIQCBA.js} +9 -6
  63. package/dist/{chunk-Z4PNECON.js → chunk-AM3H6HWG.js} +1 -1
  64. package/dist/{chunk-7TIDWBXF.js → chunk-APSYBSMG.js} +14 -12
  65. package/dist/{chunk-BWE52JRG.js → chunk-AXE2ZOKS.js} +2 -2
  66. package/dist/{chunk-ZYFZAZCN.js → chunk-C6FQ4YST.js} +2 -2
  67. package/dist/{chunk-3LJU2L5S.js → chunk-CV56MBIZ.js} +9 -8
  68. package/dist/{chunk-3GZRNHH5.js → chunk-CXZAKS7S.js} +4 -4
  69. package/dist/{chunk-SNQ5HQHE.js → chunk-D3QGBMO3.js} +2 -2
  70. package/dist/{chunk-EU67IKIQ.js → chunk-DJILSCSU.js} +3 -3
  71. package/dist/{chunk-IYCYKG2B.js → chunk-DS5BR4K6.js} +2 -2
  72. package/dist/{chunk-YJGWHP2I.js → chunk-DX45XQ36.js} +3 -3
  73. package/dist/{chunk-IPIJY4TI.js → chunk-ER4UCECJ.js} +1 -1
  74. package/dist/{chunk-262U6MMI.js → chunk-ESRKYHWE.js} +2 -2
  75. package/dist/{chunk-FNBGGKRK.js → chunk-FHPSVTS5.js} +9 -9
  76. package/dist/{chunk-T2H6BCRY.js → chunk-FJZSJZCT.js} +3 -3
  77. package/dist/{chunk-L3VBP627.js → chunk-G5BYSS6C.js} +6 -6
  78. package/dist/{chunk-VP473NXT.js → chunk-GUI2NYCX.js} +5 -5
  79. package/dist/{chunk-SGG5GNVW.js → chunk-GUM3WG4B.js} +6 -6
  80. package/dist/{chunk-LN32FXTF.js → chunk-I4RNLK5G.js} +4 -4
  81. package/dist/{chunk-PE6JUMI2.js → chunk-IEAABGST.js} +7 -6
  82. package/dist/{chunk-TDW5LI6P.js → chunk-IXVMMDIG.js} +3 -3
  83. package/dist/{chunk-ITVTU4RZ.js → chunk-J4TQYGHU.js} +5 -5
  84. package/dist/{chunk-LK343VAG.js → chunk-JNCD2ZG3.js} +4 -4
  85. package/dist/{chunk-5HA42EV4.js → chunk-JTYZEP4Q.js} +1 -1
  86. package/dist/{chunk-ZJGIJDWP.js → chunk-JXE4UQFJ.js} +3 -3
  87. package/dist/{chunk-LIXHCI4G.js → chunk-L77YWBMK.js} +7 -7
  88. package/dist/{chunk-OSXIMNMJ.js → chunk-LGWTITVK.js} +1 -1
  89. package/dist/{chunk-S5MRKUSX.js → chunk-LNSCANYY.js} +3 -3
  90. package/dist/{chunk-7R5ZKOQ4.js → chunk-M5XNFUXN.js} +1 -1
  91. package/dist/{chunk-3KQM5AKY.js → chunk-N3C3D4AV.js} +4 -4
  92. package/dist/{chunk-3BPSCYOE.js → chunk-NEWGYFKC.js} +7 -7
  93. package/dist/{chunk-GXW43S4A.js → chunk-NPBPH7KI.js} +2 -2
  94. package/dist/{chunk-QNPIHZFM.js → chunk-O6T3CLWT.js} +3 -3
  95. package/dist/{chunk-UAADLSK5.js → chunk-OIW3JAWH.js} +5 -5
  96. package/dist/{chunk-AFCKBLEG.js → chunk-ONUAAXAW.js} +1 -1
  97. package/dist/{chunk-MJNZBNTN.js → chunk-OXKVR2FP.js} +16 -10
  98. package/dist/{chunk-WQNHWWVW.js → chunk-OXTRF7CP.js} +1 -1
  99. package/dist/{chunk-A2OAJ7CS.js → chunk-PJ26BODT.js} +1 -1
  100. package/dist/{chunk-6VLSVB2C.js → chunk-QJJJENT2.js} +5 -5
  101. package/dist/{chunk-KHLWYQK7.js → chunk-RL2KE6HG.js} +13 -13
  102. package/dist/{chunk-HMLURCXV.js → chunk-RRMRP62I.js} +6 -6
  103. package/dist/{chunk-UCZZX5JH.js → chunk-S2DLTWFG.js} +4 -4
  104. package/dist/{chunk-IWYGHJY6.js → chunk-TKFDPYXS.js} +4 -4
  105. package/dist/{chunk-J5BCHHCB.js → chunk-TO77OYLM.js} +1 -1
  106. package/dist/{chunk-35M6YE6T.js → chunk-TTTK44RK.js} +3 -5
  107. package/dist/{chunk-24FQPJOZ.js → chunk-UB7VUSSX.js} +3 -3
  108. package/dist/{chunk-7QYERUTD.js → chunk-UOUUTDWF.js} +85 -45
  109. package/dist/{chunk-RNAFUXEK.js → chunk-UYTPCZ4M.js} +4 -4
  110. package/dist/{chunk-NOQGCGOR.js → chunk-VHLRXIMC.js} +1 -1
  111. package/dist/{chunk-XU2FL4B6.js → chunk-W3VRQEL3.js} +2 -2
  112. package/dist/{chunk-HGCUZQUL.js → chunk-WG67W43Y.js} +0 -1
  113. package/dist/{chunk-4WCPDCKA.js → chunk-WLOVGZ7R.js} +2 -2
  114. package/dist/{chunk-DN6QYNNC.js → chunk-WUS2LFTM.js} +10 -10
  115. package/dist/{chunk-DLPFYJ7G.js → chunk-X2P3O4PX.js} +1 -1
  116. package/dist/{chunk-QBI4KSTQ.js → chunk-YAMNJXCD.js} +2 -2
  117. package/dist/{chunk-EUZ73S73.js → chunk-Z5HLACZT.js} +4 -4
  118. package/dist/{chunk-QTOLNRET.js → chunk-ZVU6WMMU.js} +10 -0
  119. package/dist/{codex-app-cards-switch-AT6X3X6U.js → codex-app-cards-switch-3FAIEEB2.js} +12 -12
  120. package/dist/{codex-desktop-launch-4ELF22QM.js → codex-desktop-launch-LHMHRVGF.js} +1 -1
  121. package/dist/{codex-session-launch-QEVWHTU7.js → codex-session-launch-MXUBSTL2.js} +19 -19
  122. package/dist/{config-PXISW4O5.js → config-MZDRETL2.js} +3 -3
  123. package/dist/{global-upgrade-H3S4KQ26.js → global-upgrade-ZDENZA42.js} +11 -11
  124. package/dist/{identity-FB7QFMEZ.js → identity-YZRDJOGY.js} +5 -5
  125. package/dist/{live-capabilities-27LDDOMC.js → live-capabilities-KSQDWVT6.js} +6 -6
  126. package/dist/{paths-URGGQMFD.js → paths-DYZZBVYI.js} +4 -4
  127. package/dist/{reapply-A6OKNS24.js → reapply-L3AI5KJH.js} +28 -28
  128. package/dist/src/index.js +29 -29
  129. package/dist/{upgrade-lock-65A4XSMV.js → upgrade-lock-X7F2OFYB.js} +5 -5
  130. package/dist/usage-TKZALYXF.js +11 -0
  131. package/package.json +1 -1
  132. package/dist/usage-FZTPRQRP.js +0 -11
@@ -1,24 +1,24 @@
1
1
  import {
2
2
  APPROVAL_RULES_PATH,
3
3
  canChangeApprovalSettings
4
- } from "./chunk-ZYFZAZCN.js";
4
+ } from "./chunk-C6FQ4YST.js";
5
5
  import {
6
6
  callMcpTool
7
- } from "./chunk-EUZ73S73.js";
7
+ } from "./chunk-Z5HLACZT.js";
8
8
  import {
9
9
  absoluteUrl
10
- } from "./chunk-S5MRKUSX.js";
10
+ } from "./chunk-LNSCANYY.js";
11
11
  import {
12
12
  getBaseUrl
13
- } from "./chunk-AFCKBLEG.js";
13
+ } from "./chunk-ONUAAXAW.js";
14
14
  import {
15
15
  NPX_LATEST_COMMAND
16
- } from "./chunk-35M6YE6T.js";
16
+ } from "./chunk-TTTK44RK.js";
17
17
  import {
18
18
  APPROVAL_MODE_META,
19
19
  classifyConfirmResponse,
20
20
  isAnswerSource
21
- } from "./chunk-HGCUZQUL.js";
21
+ } from "./chunk-WG67W43Y.js";
22
22
 
23
23
  // src/reach.ts
24
24
  var reachVerdict = (channels) => {
@@ -3,21 +3,21 @@ import {
3
3
  } from "./chunk-POFBE6ZY.js";
4
4
  import {
5
5
  autoUpdateState
6
- } from "./chunk-7QYERUTD.js";
6
+ } from "./chunk-UOUUTDWF.js";
7
7
  import {
8
8
  readJsonSafe,
9
9
  writeJsonAtomic
10
- } from "./chunk-IRE7HPNI.js";
10
+ } from "./chunk-2BJZFA7X.js";
11
11
  import {
12
12
  CLI_PACKAGE_NAMES,
13
13
  POSIX_GLOBAL_ROOT_SEGMENTS,
14
14
  cliPackagePathSegments,
15
15
  globalUpgradeEntry,
16
16
  ownPackageRoot
17
- } from "./chunk-QTOLNRET.js";
17
+ } from "./chunk-ZVU6WMMU.js";
18
18
  import {
19
19
  isAutoUpdateResult
20
- } from "./chunk-HGCUZQUL.js";
20
+ } from "./chunk-WG67W43Y.js";
21
21
 
22
22
  // src/auto-update.ts
23
23
  import { spawn } from "child_process";
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  notificationAnswerStep
3
- } from "./chunk-HMLURCXV.js";
3
+ } from "./chunk-RRMRP62I.js";
4
4
  import {
5
5
  canChangeApprovalSettings
6
- } from "./chunk-ZYFZAZCN.js";
6
+ } from "./chunk-C6FQ4YST.js";
7
7
  import {
8
8
  matchMacAccountStep,
9
9
  retryAgentCommand
10
- } from "./chunk-T2H6BCRY.js";
10
+ } from "./chunk-FJZSJZCT.js";
11
11
  import {
12
12
  EXIT
13
13
  } from "./chunk-KZERVKTD.js";
14
14
  import {
15
15
  NPX_LATEST_COMMAND
16
- } from "./chunk-35M6YE6T.js";
16
+ } from "./chunk-TTTK44RK.js";
17
17
 
18
18
  // src/setup/closing.ts
19
19
  var ACTIVITY_URL = "pushary.com/dashboard/agent/activity";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isFile
3
- } from "./chunk-IRE7HPNI.js";
3
+ } from "./chunk-2BJZFA7X.js";
4
4
 
5
5
  // src/claude-native-install.ts
6
6
  import { accessSync, constants } from "fs";
@@ -2,7 +2,7 @@ import {
2
2
  DISCONNECT_AGENT_IDS,
3
3
  SETUP_AGENT_CHOICES,
4
4
  isApprovalMode
5
- } from "./chunk-HGCUZQUL.js";
5
+ } from "./chunk-WG67W43Y.js";
6
6
 
7
7
  // src/cli/mode-request.ts
8
8
  var parseDuration = (value) => {
@@ -229,8 +229,6 @@ var SETUP_OPTIONS = [
229
229
  ["--agents <list>", 'Comma-separated agent ids, or "auto" for everything detected, or "none" to save the key only'],
230
230
  ["--yes, -y", "Accept every default and ask nothing. Implies --agents auto unless --agents is given"],
231
231
  ["--connect app", "Pair the native Pushary app, no key to paste (default)"],
232
- ["--connect browser", "Approve in a browser tab instead. For a machine with no app"],
233
- ["--connect web", "Legacy browser subscribe page"],
234
232
  ["--connect none", "Skip pairing a phone, same as --skip-phone"],
235
233
  ["--control auto|on|off", "Manage phone-start automatically (default), require it, or disable its background service"],
236
234
  ["--transcripts on|off", "Enable or disable encrypted transcript sync on this machine"],
@@ -297,8 +295,8 @@ var renderCommandHelp = (token, version) => {
297
295
  ...name === "setup" ? [
298
296
  `Agent ids: ${AGENT_IDS}`,
299
297
  "",
300
- "Non-interactive runs need --agents or --yes. Without a terminal on stdin,",
301
- "setup takes the defaults rather than waiting for a keypress that can never arrive.",
298
+ "Without a terminal on stdin, setup asks nothing: it configures the agents it",
299
+ "detects and takes every default. Pass --agents to choose the agents yourself.",
302
300
  ""
303
301
  ] : []
304
302
  ].join("\n");
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  findNativeClaudeInstall
3
- } from "./chunk-J5BCHHCB.js";
3
+ } from "./chunk-TO77OYLM.js";
4
4
  import {
5
5
  parseVersion
6
- } from "./chunk-IRE7HPNI.js";
6
+ } from "./chunk-2BJZFA7X.js";
7
7
  import {
8
8
  isRecord
9
- } from "./chunk-HGCUZQUL.js";
9
+ } from "./chunk-WG67W43Y.js";
10
10
 
11
11
  // src/setup/agent-probe.ts
12
12
  import { execSync } from "child_process";
@@ -4,7 +4,10 @@ import {
4
4
  quoteIfNeeded,
5
5
  shellDoubleQuoted,
6
6
  writeFileAtomic
7
- } from "./chunk-IRE7HPNI.js";
7
+ } from "./chunk-2BJZFA7X.js";
8
+ import {
9
+ cmdShimScriptOf
10
+ } from "./chunk-ZVU6WMMU.js";
8
11
  import {
9
12
  CLAUDE_PRETOOLUSE_MATCHER,
10
13
  CODEX_QUESTION_TOOLS,
@@ -12,7 +15,7 @@ import {
12
15
  HOOK_LOCATOR_BINARY,
13
16
  PRETOOLUSE_GATED_TOOLS,
14
17
  withHookHoldBudget
15
- } from "./chunk-HGCUZQUL.js";
18
+ } from "./chunk-WG67W43Y.js";
16
19
 
17
20
  // src/setup/paths.ts
18
21
  import { createHash as createHash2 } from "crypto";
@@ -32,35 +35,6 @@ import { createHash } from "crypto";
32
35
  import { homedir as homedir2 } from "os";
33
36
  import { join as join2 } from "path";
34
37
 
35
- // src/registration-holder.ts
36
- var asRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value) ? value : null;
37
- var registeredCommands = (document) => {
38
- const hooks = asRecord(document?.hooks);
39
- if (!hooks) return [];
40
- const found = [];
41
- for (const [event, value] of Object.entries(hooks)) {
42
- if (!Array.isArray(value)) continue;
43
- for (const item of value) {
44
- const inner = asRecord(item)?.hooks;
45
- if (!Array.isArray(inner)) continue;
46
- for (const hook of inner) {
47
- const command = asRecord(hook)?.command;
48
- if (typeof command === "string") found.push({ event, command });
49
- }
50
- }
51
- }
52
- return found;
53
- };
54
- var wholeSegments = (command) => command.split(/[\s/\\"']+/).map((segment) => segment.replace(/\.(cmd|exe)$/i, ""));
55
- var namesLocator = (command) => wholeSegments(command).includes(HOOK_LOCATOR_BINARY);
56
- var namesCliBinary = (command, cliBinaries) => wholeSegments(command).some((segment) => cliBinaries.has(segment));
57
- var namesOurBinary = (command, cliBinaries) => namesLocator(command) || namesCliBinary(command, cliBinaries);
58
- var registrationHolderOf = (document, cliBinaries) => {
59
- const commands = registeredCommands(document);
60
- if (commands.some(({ command }) => namesLocator(command))) return "app";
61
- return commands.some(({ command }) => namesCliBinary(command, cliBinaries)) ? "cli" : "none";
62
- };
63
-
64
38
  // src/hook-command.ts
65
39
  var HOOK_SHELL = "/bin/sh -c";
66
40
  var holdBudgetOf = (hook) => hook.holds ? hook.timeout : void 0;
@@ -93,12 +67,25 @@ var guardKindOf = (target) => {
93
67
  };
94
68
  var targetPath = (target) => target.kind === "binary" ? target.path : target.script;
95
69
  var runsThroughNode = (target) => target.kind !== "binary";
96
- var guardHookCommand = (target, platform = process.platform) => {
70
+ var LAUNCHABLE_EXTENSION = /\.(cmd|exe|js|mjs)$/i;
71
+ var hookBinaryNameOf = (fileName) => fileName.replace(LAUNCHABLE_EXTENSION, "");
72
+ var windowsNodeLaunchOf = (target, launcher) => {
73
+ if (launcher === null) return null;
74
+ if (target.kind !== "binary") return { node: launcher.node, script: target.script };
75
+ if (target.runtime !== "node") return null;
76
+ const script = launcher.scriptFor(target.path);
77
+ return script === void 0 ? null : { node: launcher.node, script };
78
+ };
79
+ var guardHookCommand = (target, platform = process.platform, launcher = null) => {
97
80
  const path = quoteIfNeeded(targetPath(target), platform);
98
- if (platform === "win32") return runsThroughNode(target) ? `node ${path}` : path;
81
+ if (platform === "win32") {
82
+ const launch = windowsNodeLaunchOf(target, launcher);
83
+ if (launch !== null) return `${quoteIfNeeded(launch.node, platform)} ${quoteIfNeeded(launch.script, platform)}`;
84
+ return runsThroughNode(target) ? `node ${path}` : path;
85
+ }
99
86
  return `${HOOK_SHELL} '${HOOK_GUARD_SCRIPTS[guardKindOf(target)]}' ${path}`;
100
87
  };
101
- var guardBinary = (path, platform) => guardHookCommand({ kind: "binary", path, runtime: "node" }, platform);
88
+ var guardBinary = (path, platform, launcher) => guardHookCommand({ kind: "binary", path, runtime: "node" }, platform, launcher);
102
89
  var SILENT_MISS = "exit 0";
103
90
  var REFUSE = "R";
104
91
  var definesRefusal = (refusal) => `${REFUSE}() { printf %s ${shellDoubleQuoted(refusal)}; exit 0; }`;
@@ -109,15 +96,64 @@ var guardBinaryRefusing = (path, refusal, platform = process.platform) => {
109
96
  };
110
97
  var guardNodeScript = (script, platform) => guardHookCommand({ kind: "node", script }, platform);
111
98
  var guardCursorGate = (script, platform) => guardHookCommand({ kind: "cursor_gate", script }, platform);
112
- var guardedArgv = (target, args = [], platform = process.platform) => {
99
+ var guardedArgv = (target, args = [], platform = process.platform, launcher = null) => {
113
100
  const path = targetPath(target);
114
101
  if (platform === "win32") {
102
+ const launch = windowsNodeLaunchOf(target, launcher);
103
+ if (launch !== null) return [launch.node, launch.script, ...args];
115
104
  return runsThroughNode(target) ? ["node", path, ...args] : [path, ...args];
116
105
  }
117
106
  const [shell, ...shellArgs] = HOOK_SHELL.split(/\s+/);
118
107
  return [shell, ...shellArgs, HOOK_GUARD_SCRIPTS[guardKindOf(target)], path, ...args];
119
108
  };
120
109
 
110
+ // src/registration-holder.ts
111
+ var asRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value) ? value : null;
112
+ var registeredCommands = (document) => {
113
+ const hooks = asRecord(document?.hooks);
114
+ if (!hooks) return [];
115
+ const found = [];
116
+ for (const [event, value] of Object.entries(hooks)) {
117
+ if (!Array.isArray(value)) continue;
118
+ for (const item of value) {
119
+ const inner = asRecord(item)?.hooks;
120
+ if (!Array.isArray(inner)) continue;
121
+ for (const hook of inner) {
122
+ const command = asRecord(hook)?.command;
123
+ if (typeof command === "string") found.push({ event, command });
124
+ }
125
+ }
126
+ }
127
+ return found;
128
+ };
129
+ var wholeSegments = (command) => command.split(/[\s/\\"']+/).map(hookBinaryNameOf);
130
+ var namesLocator = (command) => wholeSegments(command).includes(HOOK_LOCATOR_BINARY);
131
+ var namesCliBinary = (command, cliBinaries) => wholeSegments(command).some((segment) => cliBinaries.has(segment));
132
+ var namesOurBinary = (command, cliBinaries) => namesLocator(command) || namesCliBinary(command, cliBinaries);
133
+ var registrationHolderOf = (document, cliBinaries) => {
134
+ const commands = registeredCommands(document);
135
+ if (commands.some(({ command }) => namesLocator(command))) return "app";
136
+ return commands.some(({ command }) => namesCliBinary(command, cliBinaries)) ? "cli" : "none";
137
+ };
138
+
139
+ // src/windows-node-launcher.ts
140
+ import { existsSync, readFileSync } from "fs";
141
+ import { win32 } from "path";
142
+ var STANDARD_NODE_LOCATION = ["nodejs", "node.exe"];
143
+ var isStandardWindowsNode = (execPath, programFolders) => {
144
+ const running = win32.normalize(execPath).toLowerCase();
145
+ return programFolders.some((folder) => folder !== void 0 && folder !== "" && win32.join(folder, ...STANDARD_NODE_LOCATION).toLowerCase() === running);
146
+ };
147
+ var windowsHookScriptFor = (shim, files) => {
148
+ const script = cmdShimScriptOf(shim, files.readFile);
149
+ return script !== void 0 && files.exists(script) ? script : void 0;
150
+ };
151
+ var INSTALLED_FILES = {
152
+ exists: existsSync,
153
+ readFile: (path) => readFileSync(path, "utf8")
154
+ };
155
+ var windowsNodeLauncherFor = (platform) => platform === "win32" && process.platform === "win32" && isStandardWindowsNode(process.execPath, [process.env.ProgramFiles, process.env.ProgramW6432]) ? { node: process.execPath, scriptFor: (shim) => windowsHookScriptFor(shim, INSTALLED_FILES) } : null;
156
+
121
157
  // src/hook-entries.ts
122
158
  var registerHookEntry = (existing, isOurs, entry2) => {
123
159
  const rewritten = [];
@@ -149,6 +185,7 @@ var canonicalJson = (value) => {
149
185
 
150
186
  // src/codex-config.ts
151
187
  var CODEX_HOOK_BINARY = "pushary-codex-hook";
188
+ var codexHookCommand = (resolvedBinary, platform = process.platform) => guardBinary(resolvedBinary ?? CODEX_HOOK_BINARY, platform, windowsNodeLauncherFor(platform));
152
189
  var codexHome = () => codexHomeFrom(homedir2());
153
190
  var codexHomeFrom = (home) => process.env.CODEX_HOME?.trim() || join2(home, ".codex");
154
191
  var codexConfigToml = () => join2(codexHome(), "config.toml");
@@ -746,7 +783,7 @@ var removePusharySettings = (settings, scope) => {
746
783
  };
747
784
 
748
785
  // src/instruction-file.ts
749
- import { accessSync, constants, existsSync, readFileSync, statSync, writeFileSync, mkdirSync, rmSync } from "fs";
786
+ import { accessSync, constants, existsSync as existsSync2, readFileSync as readFileSync2, statSync, writeFileSync, mkdirSync, rmSync } from "fs";
750
787
  import { dirname } from "path";
751
788
  var PUSHARY_BEGIN = "<!-- BEGIN PUSHARY (managed by @pushary/agent-hooks; do not edit this block) -->";
752
789
  var PUSHARY_END = "<!-- END PUSHARY -->";
@@ -794,10 +831,10 @@ var withInstructionBlockReplaced = (existing, body) => {
794
831
  };
795
832
  var writeInstructionBlock = (filePath, body) => {
796
833
  const dir = dirname(filePath);
797
- if (!existsSync(dir)) mkdirSync(dir, { recursive: true });
834
+ if (!existsSync2(dir)) mkdirSync(dir, { recursive: true });
798
835
  let existing = "";
799
836
  try {
800
- existing = readFileSync(filePath, "utf-8");
837
+ existing = readFileSync2(filePath, "utf-8");
801
838
  } catch {
802
839
  }
803
840
  writeFileSync(filePath, withInstructionBlockReplaced(existing, body) ?? withInstructionBlockAppended(existing, body), "utf-8");
@@ -814,7 +851,7 @@ var CRLF = "\r\n";
814
851
  var withLineEndingsOf = (sample, block) => sample.includes(CRLF) ? block.replaceAll("\n", CRLF) : block;
815
852
  var readUtf8 = (filePath) => {
816
853
  try {
817
- const bytes = readFileSync(filePath);
854
+ const bytes = readFileSync2(filePath);
818
855
  const text = bytes.toString("utf-8");
819
856
  return Buffer.from(text, "utf-8").equals(bytes) ? { kind: "text", text } : { kind: "not_utf8" };
820
857
  } catch {
@@ -830,7 +867,7 @@ var isWritable = (filePath) => {
830
867
  }
831
868
  };
832
869
  var refreshInstructionBlock = (filePath, body) => {
833
- if (!existsSync(filePath)) return "absent";
870
+ if (!existsSync2(filePath)) return "absent";
834
871
  const read = readUtf8(filePath);
835
872
  if (read.kind !== "text") return read.kind;
836
873
  const block = soleManagedBlock(read.text);
@@ -851,7 +888,7 @@ var refreshInstructionBlock = (filePath, body) => {
851
888
  var removeInstructionBlock = (filePath) => {
852
889
  let existing = "";
853
890
  try {
854
- existing = readFileSync(filePath, "utf-8");
891
+ existing = readFileSync2(filePath, "utf-8");
855
892
  } catch {
856
893
  return false;
857
894
  }
@@ -868,7 +905,7 @@ var removeInstructionBlock = (filePath) => {
868
905
  };
869
906
  var hasInstructionBlock = (filePath) => {
870
907
  try {
871
- return readFileSync(filePath, "utf-8").includes(PUSHARY_BEGIN);
908
+ return readFileSync2(filePath, "utf-8").includes(PUSHARY_BEGIN);
872
909
  } catch {
873
910
  return false;
874
911
  }
@@ -1079,20 +1116,23 @@ var clineRules = () => clineRulesFile(clineLocation());
1079
1116
  export {
1080
1117
  claudeConfigDir,
1081
1118
  claudeUserConfigFile,
1082
- registeredCommands,
1083
- namesOurBinary,
1084
- registrationHolderOf,
1085
1119
  HOOK_SHELL,
1086
1120
  holdBudgetOf,
1121
+ hookBinaryNameOf,
1087
1122
  guardBinary,
1088
1123
  guardBinaryRefusing,
1089
1124
  guardNodeScript,
1090
1125
  guardCursorGate,
1091
1126
  guardedArgv,
1127
+ registeredCommands,
1128
+ namesOurBinary,
1129
+ registrationHolderOf,
1130
+ windowsNodeLauncherFor,
1092
1131
  registerHookEntry,
1093
1132
  isProtectedByScope,
1094
1133
  canonicalJson,
1095
1134
  CODEX_HOOK_BINARY,
1135
+ codexHookCommand,
1096
1136
  codexHome,
1097
1137
  codexHomeFrom,
1098
1138
  codexConfigToml,
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  realpath
3
- } from "./chunk-24FQPJOZ.js";
3
+ } from "./chunk-UB7VUSSX.js";
4
4
  import {
5
5
  findNativeClaudeInstall
6
- } from "./chunk-J5BCHHCB.js";
6
+ } from "./chunk-TO77OYLM.js";
7
7
  import {
8
8
  readGlobalPrefixAsync,
9
9
  resolveGlobalBinary,
@@ -13,10 +13,10 @@ import {
13
13
  resolvePackageVersionFromBinary,
14
14
  resolvePathBinary,
15
15
  resolvePathBinaryAsync
16
- } from "./chunk-IRE7HPNI.js";
16
+ } from "./chunk-2BJZFA7X.js";
17
17
  import {
18
18
  MANAGED_PROVIDERS
19
- } from "./chunk-HGCUZQUL.js";
19
+ } from "./chunk-WG67W43Y.js";
20
20
 
21
21
  // src/live-capabilities.ts
22
22
  import { homedir } from "os";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  writeJsonAtomicDurable
3
- } from "./chunk-IRE7HPNI.js";
3
+ } from "./chunk-2BJZFA7X.js";
4
4
 
5
5
  // src/transcript-recipient-pin.ts
6
6
  import { existsSync, mkdirSync, readFileSync, rmSync } from "fs";
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  getBaseUrl
3
- } from "./chunk-AFCKBLEG.js";
3
+ } from "./chunk-ONUAAXAW.js";
4
4
  import {
5
5
  compressTranscriptRecord,
6
6
  redactSecretsFromContent,
7
7
  transcriptRecordPlaintext
8
- } from "./chunk-HGCUZQUL.js";
8
+ } from "./chunk-WG67W43Y.js";
9
9
 
10
10
  // src/transcript-api.ts
11
11
  var retentionDaysOf = (sessionHistory) => {
@@ -7208,7 +7208,6 @@ export {
7208
7208
  isComputerAgent,
7209
7209
  NO_PAIRING_COMPUTER,
7210
7210
  readSetupAgentFailures,
7211
- SETUP_CONNECT_MODES,
7212
7211
  isSetupConnectMode,
7213
7212
  readSetupOutcomeProperties,
7214
7213
  DECLINED_AGENTS_FILE,
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  findNativeClaudeInstall
3
- } from "./chunk-J5BCHHCB.js";
3
+ } from "./chunk-TO77OYLM.js";
4
4
  import {
5
5
  isFile
6
- } from "./chunk-IRE7HPNI.js";
6
+ } from "./chunk-2BJZFA7X.js";
7
7
 
8
8
  // src/wrapper/claudeBinary.ts
9
9
  import { homedir } from "os";
@@ -3,16 +3,16 @@ import {
3
3
  loadPin,
4
4
  savePin,
5
5
  verifyRecipients
6
- } from "./chunk-NOQGCGOR.js";
6
+ } from "./chunk-VHLRXIMC.js";
7
7
  import {
8
8
  SESSION_HISTORY_RETENTION_DAYS
9
9
  } from "./chunk-MHUKYYYR.js";
10
10
  import {
11
11
  ensureDaemonRunning
12
- } from "./chunk-FZJON3RK.js";
12
+ } from "./chunk-6L2U3TP3.js";
13
13
  import {
14
14
  hookOwnerOf
15
- } from "./chunk-PE6JUMI2.js";
15
+ } from "./chunk-IEAABGST.js";
16
16
  import {
17
17
  buildTranscriptRecords,
18
18
  decodePublicKey,
@@ -23,37 +23,37 @@ import {
23
23
  recordSealerFor,
24
24
  uploadTranscriptRecords,
25
25
  wrapSessionKey
26
- } from "./chunk-XU2FL4B6.js";
26
+ } from "./chunk-W3VRQEL3.js";
27
27
  import {
28
28
  external_exports
29
29
  } from "./chunk-XMSDA5WA.js";
30
30
  import {
31
31
  transcriptEnvironmentPreference,
32
32
  transcriptsEnabled
33
- } from "./chunk-WQNHWWVW.js";
33
+ } from "./chunk-OXTRF7CP.js";
34
34
  import {
35
35
  readTranscriptPreference
36
- } from "./chunk-3GZRNHH5.js";
36
+ } from "./chunk-CXZAKS7S.js";
37
37
  import {
38
38
  claudeConfigDir,
39
39
  codexHome,
40
40
  pusharyDir
41
- } from "./chunk-7QYERUTD.js";
41
+ } from "./chunk-UOUUTDWF.js";
42
42
  import {
43
43
  writeJsonAtomic,
44
44
  writeJsonAtomicDurable
45
- } from "./chunk-IRE7HPNI.js";
45
+ } from "./chunk-2BJZFA7X.js";
46
46
  import {
47
47
  getApiKey,
48
48
  getBaseUrl
49
- } from "./chunk-AFCKBLEG.js";
49
+ } from "./chunk-ONUAAXAW.js";
50
50
  import {
51
51
  PENDING_COMMAND_PREFIX,
52
52
  SESSION_HISTORY_BACKFILL_LIMIT_BYTES,
53
53
  canonicalJsonText,
54
54
  isRecord,
55
55
  redactSecretsFromContent
56
- } from "./chunk-HGCUZQUL.js";
56
+ } from "./chunk-WG67W43Y.js";
57
57
 
58
58
  // src/transcript-registration.ts
59
59
  import { createHash as createHash4 } from "crypto";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isSafeReadOnlyCommand
3
- } from "./chunk-HGCUZQUL.js";
3
+ } from "./chunk-WG67W43Y.js";
4
4
 
5
5
  // src/ledger.ts
6
6
  import { appendFileSync, existsSync, mkdirSync, readFileSync, renameSync, rmSync, statSync } from "fs";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  pusharyDir
3
- } from "./chunk-7QYERUTD.js";
3
+ } from "./chunk-UOUUTDWF.js";
4
4
  import {
5
5
  writeFileAtomic
6
- } from "./chunk-IRE7HPNI.js";
6
+ } from "./chunk-2BJZFA7X.js";
7
7
 
8
8
  // src/identity.ts
9
9
  import { randomUUID } from "crypto";
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  keyCheckFromResponse
3
- } from "./chunk-S5MRKUSX.js";
3
+ } from "./chunk-LNSCANYY.js";
4
4
  import {
5
5
  installNetworkDefaults
6
- } from "./chunk-LK343VAG.js";
6
+ } from "./chunk-JNCD2ZG3.js";
7
7
  import {
8
8
  getBaseUrl
9
- } from "./chunk-AFCKBLEG.js";
9
+ } from "./chunk-ONUAAXAW.js";
10
10
  import {
11
11
  isRecord,
12
12
  isToolErrorResult,
13
13
  toolFailureCodeOfResult
14
- } from "./chunk-HGCUZQUL.js";
14
+ } from "./chunk-WG67W43Y.js";
15
15
 
16
16
  // src/retry.ts
17
17
  var isRetryable = (err) => {
@@ -43,6 +43,15 @@ var cmdShimTarget = (shimDir, contents) => {
43
43
  const relativeTarget = CMD_SHIM_TARGET.exec(contents)?.[1];
44
44
  return relativeTarget === void 0 ? void 0 : win32.resolve(shimDir, relativeTarget);
45
45
  };
46
+ var CMD_SHIM = /\.cmd$/i;
47
+ var cmdShimScriptOf = (shim, readFile) => {
48
+ if (!CMD_SHIM.test(shim)) return void 0;
49
+ try {
50
+ return cmdShimTarget(win32.dirname(shim), readFile(shim));
51
+ } catch {
52
+ return void 0;
53
+ }
54
+ };
46
55
  var launchedPackage = (ownName) => ownName ?? LEGACY_PACKAGE;
47
56
  var globalInstallTarget = (owner, ownName) => {
48
57
  switch (owner.kind) {
@@ -153,6 +162,7 @@ export {
153
162
  globalUpgradeEntry,
154
163
  decideCommandOwner,
155
164
  cmdShimTarget,
165
+ cmdShimScriptOf,
156
166
  launchedPackage,
157
167
  globalInstallTarget,
158
168
  classifyGlobalFolder,
@@ -22,22 +22,22 @@ import {
22
22
  turnCodexAppCardsOff,
23
23
  turnCodexAppCardsOn,
24
24
  whyLaunchctlFailed
25
- } from "./chunk-3G2D5NAG.js";
26
- import "./chunk-B67R6ZCW.js";
25
+ } from "./chunk-5LLZSX7I.js";
26
+ import "./chunk-6355HHSR.js";
27
27
  import "./chunk-XCEN33UP.js";
28
28
  import "./chunk-QCGNGEGE.js";
29
- import "./chunk-FZJON3RK.js";
29
+ import "./chunk-6L2U3TP3.js";
30
30
  import "./chunk-XHKBHWLX.js";
31
- import "./chunk-3GZRNHH5.js";
31
+ import "./chunk-CXZAKS7S.js";
32
32
  import "./chunk-E46NE7FB.js";
33
- import "./chunk-QBI4KSTQ.js";
34
- import "./chunk-GXW43S4A.js";
35
- import "./chunk-7QYERUTD.js";
36
- import "./chunk-IRE7HPNI.js";
37
- import "./chunk-AFCKBLEG.js";
38
- import "./chunk-35M6YE6T.js";
39
- import "./chunk-QTOLNRET.js";
40
- import "./chunk-HGCUZQUL.js";
33
+ import "./chunk-YAMNJXCD.js";
34
+ import "./chunk-NPBPH7KI.js";
35
+ import "./chunk-UOUUTDWF.js";
36
+ import "./chunk-2BJZFA7X.js";
37
+ import "./chunk-ONUAAXAW.js";
38
+ import "./chunk-TTTK44RK.js";
39
+ import "./chunk-ZVU6WMMU.js";
40
+ import "./chunk-WG67W43Y.js";
41
41
  import "./chunk-MLKGABMK.js";
42
42
  export {
43
43
  CODEX_APP_CARDS_DIRECTORY,
@@ -11,7 +11,7 @@ import {
11
11
  installedCodexApp,
12
12
  shellQuoted,
13
13
  writeDesktopProxy
14
- } from "./chunk-B67R6ZCW.js";
14
+ } from "./chunk-6355HHSR.js";
15
15
  import "./chunk-XCEN33UP.js";
16
16
  import {
17
17
  CODEX_APP_LAUNCH_VARIABLE