@pushary/agent-hooks 1.9.78 → 1.9.80

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 (126) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/{api-4WCUP47K.js → api-FPA2PPXY.js} +10 -10
  3. package/dist/bin/pushary-bell-hook.js +25 -25
  4. package/dist/bin/pushary-bell.js +10 -10
  5. package/dist/bin/pushary-claude.js +26 -26
  6. package/dist/bin/pushary-clean.js +34 -34
  7. package/dist/bin/pushary-codex-bridge.js +21 -21
  8. package/dist/bin/pushary-codex-hook.js +30 -30
  9. package/dist/bin/pushary-codex-session.js +8 -8
  10. package/dist/bin/pushary-codex.js +13 -13
  11. package/dist/bin/pushary-connect.js +26 -26
  12. package/dist/bin/pushary-cowork.js +5 -5
  13. package/dist/bin/pushary-daemon.js +45 -42
  14. package/dist/bin/pushary-disconnect.js +25 -25
  15. package/dist/bin/pushary-display-hook.js +16 -16
  16. package/dist/bin/pushary-doctor.js +41 -41
  17. package/dist/bin/pushary-elicitation-hook.js +25 -25
  18. package/dist/bin/pushary-gemini-bridge.js +15 -15
  19. package/dist/bin/pushary-gemini-hook.js +27 -27
  20. package/dist/bin/pushary-hook.js +29 -29
  21. package/dist/bin/pushary-login.js +20 -20
  22. package/dist/bin/pushary-logout.js +24 -24
  23. package/dist/bin/pushary-mcp.js +11 -11
  24. package/dist/bin/pushary-mode.js +15 -15
  25. package/dist/bin/pushary-notification-hook.js +24 -24
  26. package/dist/bin/pushary-opencode-hook.js +26 -26
  27. package/dist/bin/pushary-permission-denied-hook.js +29 -29
  28. package/dist/bin/pushary-permission-hook.js +29 -29
  29. package/dist/bin/pushary-post-hook.js +24 -24
  30. package/dist/bin/pushary-prompt-hook.js +24 -24
  31. package/dist/bin/pushary-session-end-hook.js +26 -26
  32. package/dist/bin/pushary-session-start-hook.js +34 -34
  33. package/dist/bin/pushary-setup.js +46 -46
  34. package/dist/bin/pushary-stats.js +5 -5
  35. package/dist/bin/pushary-status.js +31 -31
  36. package/dist/bin/pushary-stop-hook.js +24 -24
  37. package/dist/bin/pushary-stopfailure-hook.js +24 -24
  38. package/dist/bin/pushary-suggestions.js +15 -15
  39. package/dist/bin/pushary-transcript-register.js +16 -16
  40. package/dist/bin/pushary-transcripts.js +18 -18
  41. package/dist/bin/pushary-upgrade.js +39 -39
  42. package/dist/bin/pushary-wait.js +15 -15
  43. package/dist/bin/pushary.js +7 -7
  44. package/dist/{chunk-VYELSTZK.js → chunk-24FQPJOZ.js} +3 -3
  45. package/dist/{chunk-22FLBWJH.js → chunk-262U6MMI.js} +2 -2
  46. package/dist/{chunk-RCDZ2XZ6.js → chunk-35M6YE6T.js} +1 -1
  47. package/dist/{chunk-TNNB7P6Z.js → chunk-3BPSCYOE.js} +7 -7
  48. package/dist/{chunk-JLBLEFBK.js → chunk-3G2D5NAG.js} +3 -3
  49. package/dist/{chunk-NH7C6QBI.js → chunk-3GZRNHH5.js} +4 -4
  50. package/dist/{chunk-MJXP5MFI.js → chunk-3KQM5AKY.js} +4 -4
  51. package/dist/{chunk-SV2C7PZV.js → chunk-3LJU2L5S.js} +6 -6
  52. package/dist/{chunk-TDLK3ZU2.js → chunk-4OXYED6O.js} +4 -4
  53. package/dist/{chunk-JM4WO3JT.js → chunk-4WCPDCKA.js} +2 -2
  54. package/dist/{chunk-AOGM34LL.js → chunk-5HA42EV4.js} +1 -1
  55. package/dist/{chunk-C5LCOXAC.js → chunk-6VLSVB2C.js} +5 -5
  56. package/dist/{chunk-TQYSBYYZ.js → chunk-7QYERUTD.js} +3 -3
  57. package/dist/{chunk-6HDYWRCP.js → chunk-7R5ZKOQ4.js} +1 -1
  58. package/dist/{chunk-7BMBXTN4.js → chunk-7TIDWBXF.js} +10 -10
  59. package/dist/{chunk-BE5BA3GF.js → chunk-A2OAJ7CS.js} +1 -1
  60. package/dist/{chunk-Q53QJQLY.js → chunk-AFCKBLEG.js} +1 -1
  61. package/dist/{chunk-OFQACQDL.js → chunk-B67R6ZCW.js} +2 -2
  62. package/dist/{chunk-YOPFR22Y.js → chunk-BWE52JRG.js} +2 -2
  63. package/dist/{chunk-42Y7IZSV.js → chunk-DFW2JKHX.js} +1 -1
  64. package/dist/{chunk-YH3RAWMV.js → chunk-DLPFYJ7G.js} +1 -1
  65. package/dist/{chunk-T2MJ5H2V.js → chunk-DN6QYNNC.js} +14 -11
  66. package/dist/{chunk-CHBK47DU.js → chunk-EU67IKIQ.js} +3 -3
  67. package/dist/{chunk-5F3L3QOO.js → chunk-EUZ73S73.js} +4 -4
  68. package/dist/{chunk-ZM3ELQPE.js → chunk-FNBGGKRK.js} +29 -20
  69. package/dist/{chunk-7KMI2G24.js → chunk-FZJON3RK.js} +6 -6
  70. package/dist/{chunk-YP35CA5L.js → chunk-GXW43S4A.js} +2 -2
  71. package/dist/{chunk-OFJUHEEG.js → chunk-HGCUZQUL.js} +2 -0
  72. package/dist/{chunk-KJYZXX7X.js → chunk-HJZDJS63.js} +3 -3
  73. package/dist/{chunk-Z6DZHUCO.js → chunk-HMLURCXV.js} +6 -6
  74. package/dist/{chunk-WJTUCQ47.js → chunk-IPIJY4TI.js} +1 -1
  75. package/dist/{chunk-Y4I5YX3L.js → chunk-IRE7HPNI.js} +31 -4
  76. package/dist/{chunk-ZFS2Y5GK.js → chunk-ITVTU4RZ.js} +5 -5
  77. package/dist/{chunk-TRTAYW7Z.js → chunk-IWYGHJY6.js} +4 -4
  78. package/dist/{chunk-TKQGDSO4.js → chunk-IYCYKG2B.js} +2 -2
  79. package/dist/{chunk-DQCQQ2PY.js → chunk-J5BCHHCB.js} +1 -1
  80. package/dist/{chunk-EUW7JL2K.js → chunk-K6ZOH6P7.js} +13 -6
  81. package/dist/{chunk-IVBQ5ISS.js → chunk-KHLWYQK7.js} +13 -13
  82. package/dist/{chunk-5YHI2FN4.js → chunk-L3VBP627.js} +6 -6
  83. package/dist/{chunk-RJEG3TUZ.js → chunk-LIXHCI4G.js} +6 -6
  84. package/dist/{chunk-XCBKGQ6N.js → chunk-LK343VAG.js} +3 -3
  85. package/dist/{chunk-WHTWHHE3.js → chunk-LN32FXTF.js} +5 -5
  86. package/dist/{chunk-RDU5HWKU.js → chunk-MJNZBNTN.js} +4 -4
  87. package/dist/{chunk-YJK3LBAJ.js → chunk-N3DOT42Y.js} +6 -6
  88. package/dist/{chunk-MPZFQP6O.js → chunk-NOQGCGOR.js} +1 -1
  89. package/dist/{chunk-VZHDSUXK.js → chunk-OJS32QPK.js} +1 -1
  90. package/dist/{chunk-4FYY6YW3.js → chunk-OSXIMNMJ.js} +1 -1
  91. package/dist/{chunk-3XH4YLCN.js → chunk-PE6JUMI2.js} +4 -4
  92. package/dist/{chunk-74R4IZ7N.js → chunk-PJRXYNXG.js} +5 -5
  93. package/dist/{chunk-4ZSQPGAU.js → chunk-QBI4KSTQ.js} +2 -2
  94. package/dist/{chunk-5WU6534E.js → chunk-QNPIHZFM.js} +2 -2
  95. package/dist/{chunk-BM3AT5AF.js → chunk-RNAFUXEK.js} +4 -4
  96. package/dist/{chunk-NFK5ZCLK.js → chunk-S5MRKUSX.js} +3 -3
  97. package/dist/{chunk-FMDP5KWV.js → chunk-SGG5GNVW.js} +6 -6
  98. package/dist/{chunk-5QOMMZFZ.js → chunk-SNQ5HQHE.js} +1 -1
  99. package/dist/{chunk-VIIQLZJS.js → chunk-T2H6BCRY.js} +3 -3
  100. package/dist/{chunk-EDHOHS3C.js → chunk-TDW5LI6P.js} +3 -3
  101. package/dist/{chunk-B4MQSH3R.js → chunk-TSCACSAR.js} +5 -5
  102. package/dist/{chunk-PYW7VWVZ.js → chunk-UAADLSK5.js} +5 -5
  103. package/dist/{chunk-OOODSAHW.js → chunk-UCZZX5JH.js} +3 -3
  104. package/dist/{chunk-RIVCTSYV.js → chunk-VP473NXT.js} +5 -5
  105. package/dist/{chunk-L2S7KWMF.js → chunk-WJVQOAZY.js} +1 -1
  106. package/dist/{chunk-IVY6LYTO.js → chunk-WQNHWWVW.js} +1 -1
  107. package/dist/{chunk-Z5VZWDGL.js → chunk-XU2FL4B6.js} +2 -2
  108. package/dist/{chunk-LXSGNGK5.js → chunk-YEPXSGFC.js} +3 -3
  109. package/dist/{chunk-56POFDRB.js → chunk-YJGWHP2I.js} +3 -3
  110. package/dist/{chunk-74NZ3CJQ.js → chunk-Z4PNECON.js} +1 -1
  111. package/dist/{chunk-4DOJLAGR.js → chunk-ZJGIJDWP.js} +1 -1
  112. package/dist/{chunk-DLOUKVLM.js → chunk-ZYFZAZCN.js} +2 -2
  113. package/dist/{codex-app-cards-switch-GUZ7XMPB.js → codex-app-cards-switch-AT6X3X6U.js} +11 -11
  114. package/dist/{codex-desktop-launch-Q5UINXU6.js → codex-desktop-launch-4ELF22QM.js} +1 -1
  115. package/dist/{codex-session-launch-4G5AFXXU.js → codex-session-launch-QEVWHTU7.js} +18 -18
  116. package/dist/{config-725HOJFK.js → config-PXISW4O5.js} +3 -3
  117. package/dist/{global-upgrade-AXTMEH3I.js → global-upgrade-H3S4KQ26.js} +10 -10
  118. package/dist/{identity-HLIZDGEN.js → identity-FB7QFMEZ.js} +4 -4
  119. package/dist/{live-capabilities-A74OIHWN.js → live-capabilities-27LDDOMC.js} +5 -5
  120. package/dist/{paths-ZHDLQD25.js → paths-URGGQMFD.js} +3 -3
  121. package/dist/{reapply-RC2AMGCQ.js → reapply-A6OKNS24.js} +27 -27
  122. package/dist/src/index.d.ts +3 -0
  123. package/dist/src/index.js +28 -28
  124. package/dist/{upgrade-lock-4B3D3OCT.js → upgrade-lock-65A4XSMV.js} +4 -4
  125. package/dist/{usage-VVPEFYKS.js → usage-FZTPRQRP.js} +3 -3
  126. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  repoKeyFor
3
- } from "./chunk-6HDYWRCP.js";
3
+ } from "./chunk-7R5ZKOQ4.js";
4
4
  import {
5
5
  cancelQuestion,
6
6
  clientErrorKindOf,
@@ -8,33 +8,33 @@ import {
8
8
  reportClientError,
9
9
  sendNotification,
10
10
  waitForAnswer
11
- } from "./chunk-PYW7VWVZ.js";
11
+ } from "./chunk-UAADLSK5.js";
12
12
  import {
13
13
  withRetry
14
- } from "./chunk-5F3L3QOO.js";
14
+ } from "./chunk-EUZ73S73.js";
15
15
  import {
16
16
  getMachineId
17
- } from "./chunk-4ZSQPGAU.js";
17
+ } from "./chunk-QBI4KSTQ.js";
18
18
  import {
19
19
  reportedInstallSource
20
- } from "./chunk-YP35CA5L.js";
20
+ } from "./chunk-GXW43S4A.js";
21
21
  import {
22
22
  IDLE_PROMPT_NOTIFICATION,
23
23
  NOTIFICATION_PUSH_TYPES,
24
24
  POSTTOOLUSE_MIRROR_ONLY_TOOLS,
25
25
  canonicalJson,
26
26
  claudeConfigDir
27
- } from "./chunk-TQYSBYYZ.js";
27
+ } from "./chunk-7QYERUTD.js";
28
28
  import {
29
29
  compareVersion,
30
30
  parseVersion,
31
31
  writeFileAtomic,
32
32
  writeJsonAtomicDurable
33
- } from "./chunk-Y4I5YX3L.js";
33
+ } from "./chunk-IRE7HPNI.js";
34
34
  import {
35
35
  getApiKey,
36
36
  getBaseUrl
37
- } from "./chunk-Q53QJQLY.js";
37
+ } from "./chunk-AFCKBLEG.js";
38
38
  import {
39
39
  ACTION_BODY_MAX,
40
40
  AGENTS,
@@ -59,6 +59,7 @@ import {
59
59
  gateOutputFor,
60
60
  hookCompatibleProfileBySource,
61
61
  isAutoApprove,
62
+ isClaudeWakePrompt,
62
63
  isRecord,
63
64
  isTokenCount,
64
65
  modeStateFromResponse,
@@ -75,7 +76,7 @@ import {
75
76
  toToolLookup,
76
77
  truncateLine,
77
78
  unansweredRefusalReason
78
- } from "./chunk-OFJUHEEG.js";
79
+ } from "./chunk-HGCUZQUL.js";
79
80
 
80
81
  // ../hook-mapping/src/describe.ts
81
82
  import { isAbsolute, relative, resolve } from "path";
@@ -631,7 +632,7 @@ var compactionAction = (hookEvent, trigger) => {
631
632
  };
632
633
  var sessionStartAction = (source) => source === "resume" ? "Session resumed" : "Session started";
633
634
  var sessionEndAction = (reason) => typeof reason === "string" && SESSION_END_ACTIONS[reason] || "Session ended";
634
- var taskTitleFrom = (prompt) => typeof prompt === "string" ? conversationText(prompt).replace(/\s+/g, " ").trim().slice(0, TASK_TITLE_MAX_LENGTH) || void 0 : void 0;
635
+ var taskTitleFrom = (prompt) => typeof prompt === "string" && !isClaudeWakePrompt(prompt) ? conversationText(prompt).replace(/\s+/g, " ").trim().slice(0, TASK_TITLE_MAX_LENGTH) || void 0 : void 0;
635
636
  var asString = (value) => typeof value === "string" && value.length > 0 ? value : void 0;
636
637
  var NOTIFICATION_ACTION_MAX_LENGTH = 200;
637
638
  var STOP_FAILURE_REASON_MAX_LENGTH = 300;
@@ -933,19 +934,25 @@ var readPendingCommand = (sessionId, namespace = "") => {
933
934
  const commands = pruneExpiredCommands(commandDirFor(sessionId, namespace));
934
935
  return commands.find((command) => !command.delivered && !command.failed && !command.attempted) ?? commands[0] ?? null;
935
936
  };
937
+ var writeNewCommandFile = (file, contents) => {
938
+ const descriptor = openSync(file, "wx", 384);
939
+ try {
940
+ writeFileSync(descriptor, contents, "utf-8");
941
+ fsyncSync(descriptor);
942
+ } catch (error) {
943
+ closeSync(descriptor);
944
+ rmSync(file, { force: true });
945
+ throw error;
946
+ }
947
+ closeSync(descriptor);
948
+ };
936
949
  var savePendingCommand = (sessionId, command, namespace = "") => {
937
950
  const dir = commandDirFor(sessionId, namespace);
938
951
  try {
939
952
  mkdirSync(dir, { recursive: true, mode: 448 });
940
953
  pruneExpiredCommandStore();
941
954
  if (readPendingCommandById(sessionId, command.id, namespace)) return false;
942
- writeFileSync(commandFile(sessionId, command.id, namespace), JSON.stringify({ ...command, sessionId }), { encoding: "utf-8", mode: 384, flag: "wx" });
943
- const descriptor = openSync(commandFile(sessionId, command.id, namespace), "r");
944
- try {
945
- fsyncSync(descriptor);
946
- } finally {
947
- closeSync(descriptor);
948
- }
955
+ writeNewCommandFile(commandFile(sessionId, command.id, namespace), JSON.stringify({ ...command, sessionId }));
949
956
  if (process.platform !== "win32") {
950
957
  const directory = openSync(dir, "r");
951
958
  try {
@@ -1339,7 +1346,7 @@ var readLastUserPrompt = (transcriptPath) => {
1339
1346
  }
1340
1347
  if (parsed.type !== "user") continue;
1341
1348
  const text = extractUserText(parsed.message?.content);
1342
- if (text) return text.slice(0, USER_PROMPT_MAX);
1349
+ if (text && !isClaudeWakePrompt(text)) return text.slice(0, USER_PROMPT_MAX);
1343
1350
  }
1344
1351
  return void 0;
1345
1352
  } catch {
@@ -2148,7 +2155,8 @@ var handleUserPrompt = async (input, agent = CLAUDE_CODE_AGENT) => {
2148
2155
  const sessionKey = input.session_id || DEFAULT_SESSION;
2149
2156
  const titlesEnabled = process.env.PUSHARY_TASK_TITLES !== "off";
2150
2157
  const taskTitle = titlesEnabled ? taskTitleFrom(input.prompt) : void 0;
2151
- if (input.prompt) saveLastPrompt(sessionKey, input.prompt);
2158
+ const wakeTurn = isClaudeWakePrompt(input.prompt);
2159
+ if (input.prompt && !wakeTurn) saveLastPrompt(sessionKey, input.prompt);
2152
2160
  const late = await reconcilePendingQuestions(sessionKey, void 0, signal);
2153
2161
  let additionalContext;
2154
2162
  if (late.length > 0 && agent.type === CLAUDE_CODE_AGENT.type) {
@@ -2161,7 +2169,8 @@ var handleUserPrompt = async (input, agent = CLAUDE_CODE_AGENT) => {
2161
2169
  agentType: agent.type,
2162
2170
  agentName: `${agent.label} - ${projectName}`,
2163
2171
  sessionId: input.session_id,
2164
- taskTitle
2172
+ taskTitle,
2173
+ ...wakeTurn ? { driver: PHONE_DRIVER } : {}
2165
2174
  }, { maxAttempts: 1, budgetMs: Math.min(DRAINING_REPORT_BUDGET_MS, Math.max(0, deadline - Date.now())), signal })
2166
2175
  ]);
2167
2176
  if (consumesActivityContext(agent.type)) {
@@ -4,23 +4,23 @@ import {
4
4
  } from "./chunk-XHKBHWLX.js";
5
5
  import {
6
6
  readControlMode
7
- } from "./chunk-NH7C6QBI.js";
7
+ } from "./chunk-3GZRNHH5.js";
8
8
  import {
9
9
  getMachineId
10
- } from "./chunk-4ZSQPGAU.js";
10
+ } from "./chunk-QBI4KSTQ.js";
11
11
  import {
12
12
  pusharyDir
13
- } from "./chunk-TQYSBYYZ.js";
13
+ } from "./chunk-7QYERUTD.js";
14
14
  import {
15
15
  readJsonSafe,
16
16
  resolveGlobalBinary,
17
17
  writeFileAtomic,
18
18
  writeJsonAtomic,
19
19
  writeJsonAtomicDurable
20
- } from "./chunk-Y4I5YX3L.js";
20
+ } from "./chunk-IRE7HPNI.js";
21
21
  import {
22
22
  getApiKey
23
- } from "./chunk-Q53QJQLY.js";
23
+ } from "./chunk-AFCKBLEG.js";
24
24
  import {
25
25
  CLI_PACKAGE_NAMES,
26
26
  cmdShimTarget,
@@ -30,7 +30,7 @@ import {
30
30
  } from "./chunk-QTOLNRET.js";
31
31
  import {
32
32
  isRecord
33
- } from "./chunk-OFJUHEEG.js";
33
+ } from "./chunk-HGCUZQUL.js";
34
34
 
35
35
  // src/daemon-lifecycle.ts
36
36
  import { dirname, join, win32 as win32Path } from "path";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  configFilePath
3
- } from "./chunk-Q53QJQLY.js";
3
+ } from "./chunk-AFCKBLEG.js";
4
4
  import {
5
5
  normalizeInstallSource
6
- } from "./chunk-OFJUHEEG.js";
6
+ } from "./chunk-HGCUZQUL.js";
7
7
 
8
8
  // src/install-source.ts
9
9
  import { readFileSync } from "fs";
@@ -1189,6 +1189,7 @@ var CLAUDE_WAKE = {
1189
1189
  retainedAttempts: 128,
1190
1190
  directory: "run/claude-wake"
1191
1191
  };
1192
+ var isClaudeWakePrompt = (prompt) => typeof prompt === "string" && prompt.trim() === CLAUDE_WAKE.message;
1192
1193
  var versionAtLeast = (version, floor) => {
1193
1194
  if (!version || !/^\d+\.\d+\.\d+$/.test(version)) return false;
1194
1195
  const parts = version.split(".").map(Number);
@@ -7126,6 +7127,7 @@ export {
7126
7127
  COMMAND_RECOVERY,
7127
7128
  isCommandAcknowledgementReceipt,
7128
7129
  CLAUDE_WAKE,
7130
+ isClaudeWakePrompt,
7129
7131
  claudeWakeDecision,
7130
7132
  CLAUDE_WAKE_API,
7131
7133
  claudeWakeWaitingOn,
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  CODEX_HOOK_STATUS
3
- } from "./chunk-5WU6534E.js";
3
+ } from "./chunk-QNPIHZFM.js";
4
4
  import {
5
5
  retryAgentCommand
6
- } from "./chunk-VIIQLZJS.js";
6
+ } from "./chunk-T2H6BCRY.js";
7
7
  import {
8
8
  NPX_LATEST_COMMAND
9
- } from "./chunk-RCDZ2XZ6.js";
9
+ } from "./chunk-35M6YE6T.js";
10
10
 
11
11
  // src/setup/codex-trust.ts
12
12
  var CODEX_TRUST_TELEMETRY = {
@@ -1,24 +1,24 @@
1
1
  import {
2
2
  APPROVAL_RULES_PATH,
3
3
  canChangeApprovalSettings
4
- } from "./chunk-DLOUKVLM.js";
4
+ } from "./chunk-ZYFZAZCN.js";
5
5
  import {
6
6
  callMcpTool
7
- } from "./chunk-5F3L3QOO.js";
7
+ } from "./chunk-EUZ73S73.js";
8
8
  import {
9
9
  absoluteUrl
10
- } from "./chunk-NFK5ZCLK.js";
10
+ } from "./chunk-S5MRKUSX.js";
11
11
  import {
12
12
  getBaseUrl
13
- } from "./chunk-Q53QJQLY.js";
13
+ } from "./chunk-AFCKBLEG.js";
14
14
  import {
15
15
  NPX_LATEST_COMMAND
16
- } from "./chunk-RCDZ2XZ6.js";
16
+ } from "./chunk-35M6YE6T.js";
17
17
  import {
18
18
  APPROVAL_MODE_META,
19
19
  classifyConfirmResponse,
20
20
  isAnswerSource
21
- } from "./chunk-OFJUHEEG.js";
21
+ } from "./chunk-HGCUZQUL.js";
22
22
 
23
23
  // src/reach.ts
24
24
  var reachVerdict = (channels) => {
@@ -7,7 +7,7 @@ import {
7
7
  } from "./chunk-KZERVKTD.js";
8
8
  import {
9
9
  redactSecretsFromContent
10
- } from "./chunk-OFJUHEEG.js";
10
+ } from "./chunk-HGCUZQUL.js";
11
11
 
12
12
  // src/cli/json.ts
13
13
  var writeStdoutFully = (text) => new Promise((resolve, reject) => {
@@ -124,7 +124,26 @@ var execNpm = (args, options = {}) => {
124
124
  });
125
125
  };
126
126
  var GLOBAL_PREFIX_TIMEOUT_MS = 5e3;
127
- var readGlobalPrefix = () => {
127
+ var GLOBAL_PREFIX_REUSE_MS = 6e4;
128
+ var GLOBAL_PREFIX_ENVIRONMENT = ["PATH", "HOME", "USERPROFILE", "APPDATA", "PREFIX", "DESTDIR"];
129
+ var NPM_CONFIG_VARIABLE = /^npm_config_/i;
130
+ var rememberedGlobalPrefix = null;
131
+ var isNpmConfigVariable = ([key]) => NPM_CONFIG_VARIABLE.test(key);
132
+ var currentDirectory = () => {
133
+ try {
134
+ return process.cwd();
135
+ } catch {
136
+ return null;
137
+ }
138
+ };
139
+ var globalPrefixInputs = () => JSON.stringify({
140
+ cwd: currentDirectory(),
141
+ environment: GLOBAL_PREFIX_ENVIRONMENT.map((key) => process.env[key] ?? null),
142
+ npmConfig: Object.entries(process.env).filter(isNpmConfigVariable).sort(([left], [right]) => left.localeCompare(right))
143
+ });
144
+ var withinReuseWindow = (readAt, now) => now >= readAt && now - readAt < GLOBAL_PREFIX_REUSE_MS;
145
+ var stillCurrent = (remembered, inputs, now) => remembered !== null && remembered.inputs === inputs && withinReuseWindow(remembered.readAt, now);
146
+ var askNpmForGlobalPrefix = () => {
128
147
  try {
129
148
  const prefix = execNpm("prefix -g --no-workspaces", { timeout: GLOBAL_PREFIX_TIMEOUT_MS }).toString().trim();
130
149
  return prefix === "" ? void 0 : prefix;
@@ -132,6 +151,14 @@ var readGlobalPrefix = () => {
132
151
  return void 0;
133
152
  }
134
153
  };
154
+ var readGlobalPrefix = () => {
155
+ const inputs = globalPrefixInputs();
156
+ const now = Date.now();
157
+ if (stillCurrent(rememberedGlobalPrefix, inputs, now)) return rememberedGlobalPrefix.prefix;
158
+ const prefix = askNpmForGlobalPrefix();
159
+ rememberedGlobalPrefix = prefix === void 0 ? null : { inputs, prefix, readAt: now };
160
+ return prefix;
161
+ };
135
162
  var resolveGlobalBinary = (name) => {
136
163
  const prefix = readGlobalPrefix();
137
164
  if (prefix === void 0) return void 0;
@@ -443,9 +470,9 @@ var installGlobally = (options) => {
443
470
  }
444
471
  const started = (async () => {
445
472
  if (!npmIsOnPath()) throw new NpmMissingError();
446
- const { withUpgradeLock } = await import("./global-upgrade-AXTMEH3I.js");
447
- const { installWithUpgradeLock, ownsUpgradeLock } = await import("./upgrade-lock-4B3D3OCT.js");
448
- const { autoUpdateLock } = await import("./paths-ZHDLQD25.js");
473
+ const { withUpgradeLock } = await import("./global-upgrade-H3S4KQ26.js");
474
+ const { installWithUpgradeLock, ownsUpgradeLock } = await import("./upgrade-lock-65A4XSMV.js");
475
+ const { autoUpdateLock } = await import("./paths-URGGQMFD.js");
449
476
  let result = "skipped";
450
477
  const install = async () => {
451
478
  const platform = process.platform;
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  macAppBridgeAvailable
3
- } from "./chunk-SV2C7PZV.js";
3
+ } from "./chunk-3LJU2L5S.js";
4
4
  import {
5
5
  keyPrefix
6
- } from "./chunk-NH7C6QBI.js";
6
+ } from "./chunk-3GZRNHH5.js";
7
7
  import {
8
8
  bridgeAgentKey
9
- } from "./chunk-TQYSBYYZ.js";
9
+ } from "./chunk-7QYERUTD.js";
10
10
  import {
11
11
  readJsonSafe
12
- } from "./chunk-Y4I5YX3L.js";
12
+ } from "./chunk-IRE7HPNI.js";
13
13
  import {
14
14
  isRecord,
15
15
  isValidApiKey
16
- } from "./chunk-OFJUHEEG.js";
16
+ } from "./chunk-HGCUZQUL.js";
17
17
 
18
18
  // src/shared-mcp-key.ts
19
19
  var asRecord = (value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0;
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  notificationAnswerStep
3
- } from "./chunk-Z6DZHUCO.js";
3
+ } from "./chunk-HMLURCXV.js";
4
4
  import {
5
5
  canChangeApprovalSettings
6
- } from "./chunk-DLOUKVLM.js";
6
+ } from "./chunk-ZYFZAZCN.js";
7
7
  import {
8
8
  matchMacAccountStep,
9
9
  retryAgentCommand
10
- } from "./chunk-VIIQLZJS.js";
10
+ } from "./chunk-T2H6BCRY.js";
11
11
  import {
12
12
  EXIT
13
13
  } from "./chunk-KZERVKTD.js";
14
14
  import {
15
15
  NPX_LATEST_COMMAND
16
- } from "./chunk-RCDZ2XZ6.js";
16
+ } from "./chunk-35M6YE6T.js";
17
17
 
18
18
  // src/setup/closing.ts
19
19
  var ACTIVITY_URL = "pushary.com/dashboard/agent/activity";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  parseSseMessages
3
- } from "./chunk-5F3L3QOO.js";
3
+ } from "./chunk-EUZ73S73.js";
4
4
  import {
5
5
  NPX_LATEST_COMMAND
6
- } from "./chunk-RCDZ2XZ6.js";
6
+ } from "./chunk-35M6YE6T.js";
7
7
 
8
8
  // src/mcp-stdio-bridge.ts
9
9
  var MCP_BRIDGE_BINARY = "pushary-mcp";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isFile
3
- } from "./chunk-Y4I5YX3L.js";
3
+ } from "./chunk-IRE7HPNI.js";
4
4
 
5
5
  // src/claude-native-install.ts
6
6
  import { accessSync, constants } from "fs";
@@ -1,13 +1,20 @@
1
1
  // src/skills-cli.ts
2
- import { execSync } from "child_process";
2
+ import { exec } from "child_process";
3
+ import { promisify } from "util";
3
4
  var PUSHARY_SKILL_SOURCE = "Pushary/pushary-skill";
4
5
  var PUSHARY_SKILL_NAME = "pushary";
5
- var installSkillViaSkillsCli = (agent) => {
6
+ var SKILLS_CLI_TIMEOUT_MS = 9e4;
7
+ var SKILLS_CLI_OUTPUT_LIMIT_BYTES = 1024 * 1024;
8
+ var runShellAsync = promisify(exec);
9
+ var skillsCliCommand = (agent) => `npx -y skills@latest add ${PUSHARY_SKILL_SOURCE}@${PUSHARY_SKILL_NAME} -y -g --agent ${agent}`;
10
+ var installSkillViaSkillsCli = async (agent) => {
6
11
  try {
7
- execSync(`npx -y skills@latest add ${PUSHARY_SKILL_SOURCE}@${PUSHARY_SKILL_NAME} -y -g --agent ${agent}`, {
8
- stdio: "pipe",
9
- timeout: 9e4
12
+ const running = runShellAsync(skillsCliCommand(agent), {
13
+ timeout: SKILLS_CLI_TIMEOUT_MS,
14
+ maxBuffer: SKILLS_CLI_OUTPUT_LIMIT_BYTES
10
15
  });
16
+ running.child.stdin?.end();
17
+ await running;
11
18
  return true;
12
19
  } catch {
13
20
  return false;
@@ -16,7 +23,7 @@ var installSkillViaSkillsCli = (agent) => {
16
23
  var installAgentSkill = async (request, effects) => {
17
24
  if (request.skillsCliInUse) {
18
25
  const startedAt = effects.now();
19
- if (effects.runSkillsCli(request.agent)) {
26
+ if (await effects.runSkillsCli(request.agent)) {
20
27
  const modifiedAt = effects.skillModifiedAt(request.agentSkillDir);
21
28
  if (modifiedAt !== null && modifiedAt >= startedAt) return "skills-cli";
22
29
  }
@@ -4,24 +4,24 @@ import {
4
4
  outcomeOfFailedAsk,
5
5
  reportMachineDenial,
6
6
  storedWaitDeadline
7
- } from "./chunk-YJK3LBAJ.js";
7
+ } from "./chunk-N3DOT42Y.js";
8
8
  import {
9
9
  isGatingMoment,
10
10
  recordKeylessMoment
11
- } from "./chunk-YH3RAWMV.js";
11
+ } from "./chunk-DLPFYJ7G.js";
12
12
  import {
13
13
  isAdmitted,
14
14
  readAdmissionRules
15
- } from "./chunk-TNNB7P6Z.js";
15
+ } from "./chunk-3BPSCYOE.js";
16
16
  import {
17
17
  isDeferAnswer,
18
18
  oncePerSession
19
- } from "./chunk-74NZ3CJQ.js";
19
+ } from "./chunk-Z4PNECON.js";
20
20
  import {
21
21
  activeHookSource,
22
22
  activeIdentity,
23
23
  namedSource
24
- } from "./chunk-TDLK3ZU2.js";
24
+ } from "./chunk-4OXYED6O.js";
25
25
  import {
26
26
  DEFAULT_SESSION,
27
27
  UNNAMED_ACTION,
@@ -45,10 +45,10 @@ import {
45
45
  reportEvent,
46
46
  scopePathFor,
47
47
  settleQuestionsForToolUse
48
- } from "./chunk-ZM3ELQPE.js";
48
+ } from "./chunk-FNBGGKRK.js";
49
49
  import {
50
50
  repoKeyFor
51
- } from "./chunk-6HDYWRCP.js";
51
+ } from "./chunk-7R5ZKOQ4.js";
52
52
  import {
53
53
  askUser,
54
54
  cancelQuestion,
@@ -65,20 +65,20 @@ import {
65
65
  waitForQuestion,
66
66
  waitsForThePhone,
67
67
  withdrawQuestion
68
- } from "./chunk-PYW7VWVZ.js";
68
+ } from "./chunk-UAADLSK5.js";
69
69
  import {
70
70
  getMachineId
71
- } from "./chunk-4ZSQPGAU.js";
71
+ } from "./chunk-QBI4KSTQ.js";
72
72
  import {
73
73
  claudeConfigDir
74
- } from "./chunk-TQYSBYYZ.js";
74
+ } from "./chunk-7QYERUTD.js";
75
75
  import {
76
76
  getApiKey,
77
77
  getBaseUrl
78
- } from "./chunk-Q53QJQLY.js";
78
+ } from "./chunk-AFCKBLEG.js";
79
79
  import {
80
80
  NPX_LATEST_COMMAND
81
- } from "./chunk-RCDZ2XZ6.js";
81
+ } from "./chunk-35M6YE6T.js";
82
82
  import {
83
83
  AGENT_QUESTION_STRATEGY,
84
84
  AGENT_QUESTION_TOOL,
@@ -133,7 +133,7 @@ import {
133
133
  terminalStaysLiveForTheCall,
134
134
  timeoutActionWithoutLocalPrompt,
135
135
  unansweredRefusalReason
136
- } from "./chunk-OFJUHEEG.js";
136
+ } from "./chunk-HGCUZQUL.js";
137
137
 
138
138
  // src/terminal-answer-watch.ts
139
139
  import { closeSync, openSync, readSync, statSync } from "fs";
@@ -2,31 +2,31 @@ import {
2
2
  SIGNED_OUT_ON_MAC_MESSAGE,
3
3
  describeSignedOutKey,
4
4
  readSignedOutDiagnosis
5
- } from "./chunk-YOPFR22Y.js";
5
+ } from "./chunk-BWE52JRG.js";
6
6
  import {
7
7
  APPROVAL_RULES_PATH
8
- } from "./chunk-DLOUKVLM.js";
8
+ } from "./chunk-ZYFZAZCN.js";
9
9
  import {
10
10
  createIo
11
11
  } from "./chunk-FO3MDD26.js";
12
12
  import {
13
13
  readKeySource
14
- } from "./chunk-NH7C6QBI.js";
14
+ } from "./chunk-3GZRNHH5.js";
15
15
  import {
16
16
  absoluteUrl,
17
17
  checkApiKey,
18
18
  describeKeyCheck,
19
19
  keyCheckFromResponse
20
- } from "./chunk-NFK5ZCLK.js";
20
+ } from "./chunk-S5MRKUSX.js";
21
21
  import {
22
22
  getBaseUrl
23
- } from "./chunk-Q53QJQLY.js";
23
+ } from "./chunk-AFCKBLEG.js";
24
24
  import {
25
25
  EXIT
26
26
  } from "./chunk-KZERVKTD.js";
27
27
  import {
28
28
  KEY_SCOPE
29
- } from "./chunk-OFJUHEEG.js";
29
+ } from "./chunk-HGCUZQUL.js";
30
30
 
31
31
  // src/cli/report-key.ts
32
32
  var { dim, yellow } = createIo();
@@ -3,10 +3,10 @@ import {
3
3
  forkFinishWithUpgradeLock,
4
4
  installWithUpgradeLock,
5
5
  releaseAutoUpdateLock
6
- } from "./chunk-22FLBWJH.js";
6
+ } from "./chunk-262U6MMI.js";
7
7
  import {
8
8
  phoneStartIsRequired
9
- } from "./chunk-BM3AT5AF.js";
9
+ } from "./chunk-RNAFUXEK.js";
10
10
  import {
11
11
  describeAutoUpdateCheck,
12
12
  globalInstallLocation,
@@ -18,25 +18,25 @@ import {
18
18
  readAutoUpdateState,
19
19
  updateAutoUpdateState,
20
20
  upgradeEntryFor
21
- } from "./chunk-OOODSAHW.js";
21
+ } from "./chunk-UCZZX5JH.js";
22
22
  import {
23
23
  autoUpdateLock,
24
24
  autoUpdateLog,
25
25
  autoUpdateState
26
- } from "./chunk-TQYSBYYZ.js";
26
+ } from "./chunk-7QYERUTD.js";
27
27
  import {
28
28
  execNpm,
29
29
  fetchLatestPublishedVersion,
30
30
  npmErrorMessage,
31
31
  readGlobalCliInstallAt,
32
32
  readGlobalPrefix
33
- } from "./chunk-Y4I5YX3L.js";
33
+ } from "./chunk-IRE7HPNI.js";
34
34
  import {
35
35
  EXIT
36
36
  } from "./chunk-KZERVKTD.js";
37
37
  import {
38
38
  NPX_LATEST_COMMAND
39
- } from "./chunk-RCDZ2XZ6.js";
39
+ } from "./chunk-35M6YE6T.js";
40
40
  import {
41
41
  commandsPackage,
42
42
  globalUpgradeEntry,
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  readExistingMachineId
3
- } from "./chunk-4ZSQPGAU.js";
3
+ } from "./chunk-QBI4KSTQ.js";
4
4
  import {
5
5
  getBaseUrl
6
- } from "./chunk-Q53QJQLY.js";
6
+ } from "./chunk-AFCKBLEG.js";
7
7
  import {
8
8
  NetworkError
9
9
  } from "./chunk-PPY5N2E6.js";
@@ -13,7 +13,7 @@ import {
13
13
  import {
14
14
  clientContextHeaders,
15
15
  redactSecretsFromContent
16
- } from "./chunk-OFJUHEEG.js";
16
+ } from "./chunk-HGCUZQUL.js";
17
17
 
18
18
  // src/cli/net.ts
19
19
  import { createRequire } from "module";
@@ -5,19 +5,19 @@ import {
5
5
  hermesAppWiringRecord,
6
6
  hermesConfigReceipt,
7
7
  hermesSetupReceipt
8
- } from "./chunk-TQYSBYYZ.js";
8
+ } from "./chunk-7QYERUTD.js";
9
9
  import {
10
10
  readJsonSafe,
11
11
  resolvePathBinary,
12
12
  writeJsonAtomic
13
- } from "./chunk-Y4I5YX3L.js";
13
+ } from "./chunk-IRE7HPNI.js";
14
14
  import {
15
15
  isNewerVersion,
16
16
  isReleaseVersion
17
17
  } from "./chunk-QTOLNRET.js";
18
18
  import {
19
19
  isRecord
20
- } from "./chunk-OFJUHEEG.js";
20
+ } from "./chunk-HGCUZQUL.js";
21
21
 
22
22
  // src/hermes/plugin-payload.ts
23
23
  import { createHash } from "crypto";
@@ -2109,7 +2109,7 @@ var runHermesCommand = async (launcher, args, timeoutMs = HERMES_COMMAND_TIMEOUT
2109
2109
  const running = runFileAsync(
2110
2110
  shell ? quotedForWindowsShell(launcher.path) : launcher.path,
2111
2111
  shell ? args.map(quotedForWindowsShell) : [...args],
2112
- { encoding: "utf-8", timeout: timeoutMs, maxBuffer: HERMES_OUTPUT_LIMIT_BYTES, shell, windowsHide: true }
2112
+ { encoding: "utf-8", timeout: timeoutMs, maxBuffer: HERMES_OUTPUT_LIMIT_BYTES, shell }
2113
2113
  );
2114
2114
  running.child.stdin?.end();
2115
2115
  const { stdout } = await running;
@@ -2305,7 +2305,7 @@ var removeLegacyPipCopy = async (python, distribution) => {
2305
2305
  const running = runFileAsync(
2306
2306
  python,
2307
2307
  ["-m", "pip", "uninstall", "-y", distribution],
2308
- { encoding: "utf-8", timeout: LEGACY_PIP_TIMEOUT_MS, maxBuffer: HERMES_OUTPUT_LIMIT_BYTES, windowsHide: true }
2308
+ { encoding: "utf-8", timeout: LEGACY_PIP_TIMEOUT_MS, maxBuffer: HERMES_OUTPUT_LIMIT_BYTES }
2309
2309
  );
2310
2310
  running.child.stdin?.end();
2311
2311
  const { stdout } = await running;