@pushary/agent-hooks 1.9.15 → 1.9.17

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 (100) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/bin/pushary-bell-hook.js +25 -25
  3. package/dist/bin/pushary-bell.js +10 -10
  4. package/dist/bin/pushary-claude.js +24 -24
  5. package/dist/bin/pushary-clean.js +29 -29
  6. package/dist/bin/pushary-codex-bridge.js +17 -17
  7. package/dist/bin/pushary-codex-hook.js +45 -61
  8. package/dist/bin/pushary-codex.js +12 -12
  9. package/dist/bin/pushary-connect.js +25 -25
  10. package/dist/bin/pushary-cowork.js +5 -5
  11. package/dist/bin/pushary-daemon.js +31 -31
  12. package/dist/bin/pushary-disconnect.js +24 -24
  13. package/dist/bin/pushary-doctor.js +34 -34
  14. package/dist/bin/pushary-elicitation-hook.js +25 -25
  15. package/dist/bin/pushary-gemini-bridge.js +13 -13
  16. package/dist/bin/pushary-gemini-hook.js +27 -27
  17. package/dist/bin/pushary-hook.js +29 -29
  18. package/dist/bin/pushary-login.js +13 -13
  19. package/dist/bin/pushary-logout.js +11 -11
  20. package/dist/bin/pushary-mcp.js +9 -9
  21. package/dist/bin/pushary-mode.js +13 -13
  22. package/dist/bin/pushary-notification-hook.js +24 -24
  23. package/dist/bin/pushary-opencode-hook.js +26 -26
  24. package/dist/bin/pushary-permission-denied-hook.js +29 -29
  25. package/dist/bin/pushary-permission-hook.js +28 -28
  26. package/dist/bin/pushary-post-hook.js +24 -24
  27. package/dist/bin/pushary-prompt-hook.js +24 -24
  28. package/dist/bin/pushary-session-end-hook.js +24 -24
  29. package/dist/bin/pushary-session-start-hook.js +28 -28
  30. package/dist/bin/pushary-setup.js +443 -117
  31. package/dist/bin/pushary-stats.js +5 -5
  32. package/dist/bin/pushary-status.js +27 -27
  33. package/dist/bin/pushary-stop-hook.js +24 -24
  34. package/dist/bin/pushary-stopfailure-hook.js +24 -24
  35. package/dist/bin/pushary-suggestions.js +13 -13
  36. package/dist/bin/pushary-transcript-register.js +17 -17
  37. package/dist/bin/pushary-transcripts.js +7 -7
  38. package/dist/bin/pushary-upgrade.js +30 -30
  39. package/dist/bin/pushary-wait.js +13 -13
  40. package/dist/bin/pushary.js +10 -7
  41. package/dist/{chunk-WJO7SENK.js → chunk-2V4NKFHD.js} +5 -5
  42. package/dist/{chunk-TFV6RATK.js → chunk-35USDKDL.js} +5 -5
  43. package/dist/{chunk-6MLSXBNR.js → chunk-3FBU6HUW.js} +2 -2
  44. package/dist/{chunk-LJJWNHUW.js → chunk-3LRUBMNK.js} +2 -2
  45. package/dist/{chunk-Q4JD6WNB.js → chunk-5DVWWQ7H.js} +1 -1
  46. package/dist/{chunk-JEJSAI6Z.js → chunk-5SHOKE4K.js} +4 -4
  47. package/dist/{chunk-JC3AGMOP.js → chunk-5Y4PJEBJ.js} +2 -2
  48. package/dist/{chunk-ME55HQOI.js → chunk-73NUMFZG.js} +4 -4
  49. package/dist/{chunk-IQCNOEQL.js → chunk-AEWPTGG2.js} +10 -11
  50. package/dist/{chunk-5LQ7QUVF.js → chunk-AVNOQUNA.js} +1 -1
  51. package/dist/{chunk-YOHPJNFW.js → chunk-B45C755V.js} +36 -25
  52. package/dist/{chunk-3QXCTYMG.js → chunk-B4WI4UOX.js} +2 -2
  53. package/dist/{chunk-COZE23R3.js → chunk-BHBTPKYT.js} +2 -2
  54. package/dist/{chunk-ZMUDVPOT.js → chunk-CSKEQDLX.js} +3 -3
  55. package/dist/{chunk-SYLJL63X.js → chunk-CUW5CPJJ.js} +3 -3
  56. package/dist/{chunk-7VOEZPJ4.js → chunk-D2ZPTCAL.js} +1 -1
  57. package/dist/{chunk-HSVJ62BE.js → chunk-D45B4GNL.js} +1 -1
  58. package/dist/{chunk-NDZBDXU3.js → chunk-DCPJNJN3.js} +27 -8
  59. package/dist/{chunk-VP6WDFVO.js → chunk-E755IUIH.js} +3 -3
  60. package/dist/{chunk-OIESPH3R.js → chunk-EBABFMC7.js} +11 -11
  61. package/dist/{chunk-CU7Y7Y4L.js → chunk-ENR7TJSA.js} +2 -2
  62. package/dist/{chunk-U4TMAANR.js → chunk-FO3MDD26.js} +4 -4
  63. package/dist/{chunk-HJL5RBOU.js → chunk-GFW4NSYW.js} +23 -4
  64. package/dist/{chunk-H5YC7H6V.js → chunk-GYLRXSZW.js} +3 -3
  65. package/dist/{chunk-WWTB4DAE.js → chunk-H3OSAPDD.js} +1 -1
  66. package/dist/{chunk-3YCYTGGK.js → chunk-IJOITMKQ.js} +1 -1
  67. package/dist/{chunk-HTO2XULO.js → chunk-KRSBK5BE.js} +1 -1
  68. package/dist/{chunk-3FQCZSEQ.js → chunk-KWMZDPUJ.js} +3 -3
  69. package/dist/{chunk-6LORREOI.js → chunk-LBUKSO4N.js} +1 -1
  70. package/dist/{chunk-YKYFFCB5.js → chunk-MRMXB6Z6.js} +1 -1
  71. package/dist/{chunk-57VUNV32.js → chunk-NHJUNVMB.js} +1 -1
  72. package/dist/{chunk-AYV2NRYJ.js → chunk-OG5HVCVG.js} +12 -1
  73. package/dist/{chunk-7QZZK2YU.js → chunk-OQTTGULW.js} +6 -6
  74. package/dist/{chunk-NDKFHLJI.js → chunk-P76XTT2Y.js} +5 -5
  75. package/dist/{chunk-6WECKO24.js → chunk-PILHK3P5.js} +4 -4
  76. package/dist/{chunk-5BIMNGRQ.js → chunk-PJCNX4AA.js} +6 -6
  77. package/dist/{chunk-SDDKVY4I.js → chunk-PM7XZ5GJ.js} +5 -5
  78. package/dist/{chunk-D72OJS4S.js → chunk-PMKC4ZYP.js} +2 -2
  79. package/dist/{chunk-2DCGUCPZ.js → chunk-PYKF2DUY.js} +2 -2
  80. package/dist/{chunk-QIOWXUFH.js → chunk-QWO5UBVP.js} +1 -1
  81. package/dist/{chunk-Y6KG5JZP.js → chunk-SRK4O45T.js} +2 -2
  82. package/dist/{chunk-5EWNGYFD.js → chunk-TEWUZ3MT.js} +2 -2
  83. package/dist/{chunk-C2OUUGCW.js → chunk-TY2OTJFK.js} +2 -2
  84. package/dist/{chunk-52JA2WTH.js → chunk-UJTQCOYP.js} +1 -1
  85. package/dist/{chunk-ZH74RRGM.js → chunk-UM7CBQS5.js} +1 -1
  86. package/dist/{chunk-VKTDXQGH.js → chunk-UNO3UEDW.js} +2 -2
  87. package/dist/{chunk-FZW7Q7GM.js → chunk-VZA4GGXL.js} +10 -15
  88. package/dist/{chunk-TMQMUGSN.js → chunk-XGRZU6J4.js} +3 -3
  89. package/dist/{chunk-WBQK6KD5.js → chunk-XTVOEEZ5.js} +8 -8
  90. package/dist/{chunk-NA5D62OI.js → chunk-YCBXYOPI.js} +1 -1
  91. package/dist/{chunk-6GRUERVL.js → chunk-YJCNFRKV.js} +1 -1
  92. package/dist/{chunk-PNUWMEIY.js → chunk-YVDFJ6VV.js} +3 -2
  93. package/dist/{chunk-YL6HU2KF.js → chunk-Z4M66PI6.js} +5 -5
  94. package/dist/{chunk-PSWFYNOX.js → chunk-Z7LEZQSY.js} +3 -3
  95. package/dist/{global-upgrade-MOBLBPIJ.js → global-upgrade-MYSWPDKE.js} +6 -6
  96. package/dist/{paths-55SPLYW5.js → paths-JFXSQQBD.js} +2 -2
  97. package/dist/{reapply-SOIJJKGO.js → reapply-E3JKAGNS.js} +20 -20
  98. package/dist/src/index.js +19 -19
  99. package/dist/{upgrade-lock-FER4DMDA.js → upgrade-lock-DO5TUCXB.js} +3 -3
  100. package/package.json +1 -1
@@ -4,14 +4,14 @@ import {
4
4
  } from "./chunk-XHKBHWLX.js";
5
5
  import {
6
6
  readControlMode
7
- } from "./chunk-5EWNGYFD.js";
7
+ } from "./chunk-TEWUZ3MT.js";
8
8
  import {
9
9
  getMachineId
10
- } from "./chunk-NA5D62OI.js";
10
+ } from "./chunk-YCBXYOPI.js";
11
11
  import {
12
12
  pusharyDir,
13
13
  resolveGlobalBinary
14
- } from "./chunk-HJL5RBOU.js";
14
+ } from "./chunk-GFW4NSYW.js";
15
15
  import {
16
16
  readJsonSafe,
17
17
  writeFileAtomic,
@@ -20,14 +20,14 @@ import {
20
20
  } from "./chunk-T7E75EKA.js";
21
21
  import {
22
22
  getApiKey
23
- } from "./chunk-HTO2XULO.js";
23
+ } from "./chunk-KRSBK5BE.js";
24
24
  import {
25
25
  CLI_PACKAGE_NAMES,
26
26
  cmdShimTarget,
27
27
  getPackageVersion,
28
28
  globalPackageFolder,
29
29
  globalRootFor
30
- } from "./chunk-AYV2NRYJ.js";
30
+ } from "./chunk-OG5HVCVG.js";
31
31
 
32
32
  // src/daemon-lifecycle.ts
33
33
  import { dirname, join, win32 as win32Path } from "path";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-POFBE6ZY.js";
4
4
  import {
5
5
  autoUpdateState
6
- } from "./chunk-HJL5RBOU.js";
6
+ } from "./chunk-GFW4NSYW.js";
7
7
  import {
8
8
  readJsonSafe,
9
9
  writeJsonAtomic
@@ -14,7 +14,7 @@ import {
14
14
  cliPackagePathSegments,
15
15
  globalUpgradeEntry,
16
16
  ownPackageRoot
17
- } from "./chunk-AYV2NRYJ.js";
17
+ } from "./chunk-OG5HVCVG.js";
18
18
 
19
19
  // src/auto-update.ts
20
20
  import { spawn } from "child_process";
@@ -8,10 +8,10 @@ import {
8
8
  codexHooksJsonIn,
9
9
  isPusharyCodexCommand,
10
10
  resolvePathBinary
11
- } from "./chunk-HJL5RBOU.js";
11
+ } from "./chunk-GFW4NSYW.js";
12
12
  import {
13
13
  getPackageVersion
14
- } from "./chunk-AYV2NRYJ.js";
14
+ } from "./chunk-OG5HVCVG.js";
15
15
 
16
16
  // src/codex-app-server.ts
17
17
  import { existsSync, realpathSync } from "fs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  readConfigFileKey
3
- } from "./chunk-5EWNGYFD.js";
3
+ } from "./chunk-TEWUZ3MT.js";
4
4
 
5
5
  // src/bell/fleet.ts
6
6
  import { closeSync, constants, futimesSync, lstatSync, mkdirSync, openSync, readdirSync, unlinkSync } from "fs";
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  registerTranscript
3
- } from "./chunk-WBQK6KD5.js";
3
+ } from "./chunk-XTVOEEZ5.js";
4
4
  import {
5
5
  namedEvent
6
- } from "./chunk-ME55HQOI.js";
6
+ } from "./chunk-73NUMFZG.js";
7
7
  import {
8
8
  writeDegraded
9
- } from "./chunk-YL6HU2KF.js";
9
+ } from "./chunk-Z4M66PI6.js";
10
10
  import {
11
11
  claudeShapedHookInput,
12
12
  hookCompatibleProfileBySource
13
- } from "./chunk-AYV2NRYJ.js";
13
+ } from "./chunk-OG5HVCVG.js";
14
14
 
15
15
  // src/tool-hook-input.ts
16
16
  var OPTIONAL_TEXT_FIELDS = ["hook_event_name", "session_id", "cwd", "transcript_path", "tool_use_id", "permission_mode"];
@@ -10,10 +10,10 @@ import {
10
10
  resolvePackageVersionFromBinary,
11
11
  resolvePathBinary,
12
12
  resolvePathBinaryAsync
13
- } from "./chunk-HJL5RBOU.js";
13
+ } from "./chunk-GFW4NSYW.js";
14
14
  import {
15
15
  MANAGED_PROVIDERS
16
- } from "./chunk-AYV2NRYJ.js";
16
+ } from "./chunk-OG5HVCVG.js";
17
17
 
18
18
  // src/setup/codex-install.ts
19
19
  var NATIVE_BINARY_MIN_BYTES = 20 * 1024 * 1024;
@@ -3,18 +3,18 @@ import {
3
3
  addGeminiMcpServer,
4
4
  removeGeminiMcpServer,
5
5
  supportedClaudeEvents
6
- } from "./chunk-VP6WDFVO.js";
6
+ } from "./chunk-E755IUIH.js";
7
7
  import {
8
8
  CLAUDE_CODE_AGENT,
9
9
  parseApplyPatchFiles
10
- } from "./chunk-IQCNOEQL.js";
10
+ } from "./chunk-AEWPTGG2.js";
11
11
  import {
12
12
  guardBinary,
13
13
  guardBinaryRefusing,
14
14
  holdBudgetOf,
15
15
  isProtectedByScope,
16
16
  registerHookEntry
17
- } from "./chunk-HJL5RBOU.js";
17
+ } from "./chunk-GFW4NSYW.js";
18
18
  import {
19
19
  HOOK_LOCATOR_BINARY,
20
20
  PHONE_ANSWERED_TOOLS,
@@ -24,7 +24,7 @@ import {
24
24
  refusalOutput,
25
25
  toToolLookup,
26
26
  withHookHoldBudget
27
- } from "./chunk-AYV2NRYJ.js";
27
+ } from "./chunk-OG5HVCVG.js";
28
28
 
29
29
  // src/claude-config.ts
30
30
  import { join } from "path";
@@ -2,7 +2,7 @@ import {
2
2
  IDLE_PROMPT_NOTIFICATION,
3
3
  NOTIFICATION_PUSH_TYPES,
4
4
  POSTTOOLUSE_MIRROR_ONLY_TOOLS
5
- } from "./chunk-52JA2WTH.js";
5
+ } from "./chunk-UJTQCOYP.js";
6
6
  import {
7
7
  cancelQuestion,
8
8
  clientErrorKindOf,
@@ -10,26 +10,26 @@ import {
10
10
  reportClientError,
11
11
  sendNotification,
12
12
  waitForAnswer
13
- } from "./chunk-YL6HU2KF.js";
13
+ } from "./chunk-Z4M66PI6.js";
14
14
  import {
15
15
  withRetry
16
- } from "./chunk-SYLJL63X.js";
16
+ } from "./chunk-CUW5CPJJ.js";
17
17
  import {
18
18
  getMachineId
19
- } from "./chunk-NA5D62OI.js";
19
+ } from "./chunk-YCBXYOPI.js";
20
20
  import {
21
21
  reportedInstallSource
22
- } from "./chunk-VKTDXQGH.js";
22
+ } from "./chunk-UNO3UEDW.js";
23
23
  import {
24
24
  canonicalJson
25
- } from "./chunk-HJL5RBOU.js";
25
+ } from "./chunk-GFW4NSYW.js";
26
26
  import {
27
27
  writeFileAtomic
28
28
  } from "./chunk-T7E75EKA.js";
29
29
  import {
30
30
  getApiKey,
31
31
  getBaseUrl
32
- } from "./chunk-HTO2XULO.js";
32
+ } from "./chunk-KRSBK5BE.js";
33
33
  import {
34
34
  ACTION_BODY_MAX,
35
35
  AGENT_LABELS_BY_TYPE,
@@ -39,6 +39,7 @@ import {
39
39
  GATE_MAX_TOOL_INPUTS,
40
40
  HOOK_COMPATIBLE_PROFILES,
41
41
  HOOK_SOURCES,
42
+ NO_RESPONSE_REASON,
42
43
  PENDING_COMMAND_PREFIX,
43
44
  REPO_AWARE_AGENTS,
44
45
  blockedActionIdentity,
@@ -59,7 +60,7 @@ import {
59
60
  resolvePolicy,
60
61
  toToolLookup,
61
62
  truncateLine
62
- } from "./chunk-AYV2NRYJ.js";
63
+ } from "./chunk-OG5HVCVG.js";
63
64
 
64
65
  // ../hook-mapping/src/describe.ts
65
66
  import { isAbsolute, relative, resolve } from "path";
@@ -1395,10 +1396,9 @@ var toPolicyLookups = (toolName, toolInput, cwd) => {
1395
1396
  };
1396
1397
  var permissionTimeoutDecision = (timeoutAction) => {
1397
1398
  if (timeoutAction === "approve") return codexAllow();
1398
- if (timeoutAction === "deny") return codexDeny("No response within timeout");
1399
+ if (timeoutAction === "deny") return codexDeny(NO_RESPONSE_REASON);
1399
1400
  return codexPass();
1400
1401
  };
1401
- var preToolUseTimeoutDecision = (timeoutAction, denyReason = "No response within timeout") => timeoutAction === "deny" ? codexDeny(denyReason) : codexPass();
1402
1402
 
1403
1403
  // src/codex-call-decision.ts
1404
1404
  import { createHash as createHash4 } from "crypto";
@@ -2284,7 +2284,6 @@ export {
2284
2284
  toPolicyLookup,
2285
2285
  toPolicyLookups,
2286
2286
  permissionTimeoutDecision,
2287
- preToolUseTimeoutDecision,
2288
2287
  userScope,
2289
2288
  codexCallKey,
2290
2289
  recordCodexCallDecision,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  pusharyDir
3
- } from "./chunk-HJL5RBOU.js";
3
+ } from "./chunk-GFW4NSYW.js";
4
4
  import {
5
5
  readJsonSafe
6
6
  } from "./chunk-T7E75EKA.js";
@@ -11,22 +11,22 @@ import {
11
11
  clipToRow,
12
12
  terminalColumns,
13
13
  useColor
14
- } from "./chunk-U4TMAANR.js";
14
+ } from "./chunk-FO3MDD26.js";
15
15
  import {
16
16
  callMcpTool
17
- } from "./chunk-SYLJL63X.js";
17
+ } from "./chunk-CUW5CPJJ.js";
18
18
  import {
19
19
  reportedInstallSource
20
- } from "./chunk-VKTDXQGH.js";
20
+ } from "./chunk-UNO3UEDW.js";
21
21
  import {
22
22
  NPX_LATEST_COMMAND
23
- } from "./chunk-PNUWMEIY.js";
23
+ } from "./chunk-YVDFJ6VV.js";
24
24
  import {
25
25
  NO_PAIRING_COMPUTER,
26
26
  PAIR_TTL_SECONDS,
27
27
  classifyConfirmResponse,
28
28
  isAnswerSource
29
- } from "./chunk-AYV2NRYJ.js";
29
+ } from "./chunk-OG5HVCVG.js";
30
30
 
31
31
  // src/reach.ts
32
32
  var reachVerdict = (channels) => {
@@ -282,9 +282,9 @@ var describeAnswerSource = (source) => {
282
282
  switch (source) {
283
283
  case "mobile_app":
284
284
  case "mobile_background":
285
- return "A phone answered this synthetic test.";
285
+ return "Answered on your phone.";
286
286
  case "mac_app":
287
- return "A Mac answered this synthetic test.";
287
+ return "Answered on your Mac.";
288
288
  case "sandbox":
289
289
  return "This was a simulated sandbox answer.";
290
290
  default:
@@ -357,6 +357,7 @@ var yellow = paint("\x1B[33m");
357
357
  var check = green("\u2713");
358
358
  var apiBase = () => process.env.PUSHARY_API_URL?.trim() || process.env.PUSHARY_BASE_URL?.trim() || "https://pushary.com";
359
359
  var EXIT_ABORTED = 130;
360
+ var EXIT_TERMINATED = 143;
360
361
  var CONNECT_POLL_INTERVAL_MS = 2500;
361
362
  var CONNECT_TIMEOUT_MS = 18e4;
362
363
  var EMPTY_CHANNELS = {
@@ -491,10 +492,11 @@ var startSpinner = (getLabel) => {
491
492
  writeStatusLine(`${finalGlyph} ${finalLabel}`);
492
493
  };
493
494
  };
495
+ var qrRows = (qr) => qr.replace(/\n+$/, "").split("\n");
494
496
  var printQr = (url) => new Promise((resolve, reject) => {
495
497
  try {
496
498
  qrcodeTerminal.generate(url, { small: true }, (qr) => {
497
- writeHuman("\n" + qr.split("\n").map((line) => " " + line).join("\n") + "\n");
499
+ writeHuman("\n" + qrRows(qr).map((line) => " " + line).join("\n") + "\n");
498
500
  resolve();
499
501
  });
500
502
  } catch (err) {
@@ -737,7 +739,17 @@ var PAIR_TIMEOUT_MS = PAIR_TTL_SECONDS * 1e3 - PAIR_STOP_BEFORE_EXPIRY_MS;
737
739
  var PAIR_HINT_AFTER_MS = 45e3;
738
740
  var PAIR_BROWSER_FALLBACK_AFTER_MS = 6e4;
739
741
  var BROWSER_CONNECT_COMMAND = `${NPX_LATEST_COMMAND} setup --connect browser`;
740
- var PAIR_BROWSER_FALLBACK_LINE = `Still waiting? Sign in with a browser instead: Ctrl-C, then ${BROWSER_CONNECT_COMMAND}`;
742
+ var PAIR_BROWSER_FALLBACK_LINE = `Still waiting? Ctrl-C, then: ${BROWSER_CONNECT_COMMAND}`;
743
+ var PAIR_INSTALL_HINT = "No app yet? Install it, sign in, then scan the code above. Ctrl-C to stop.";
744
+ var PAIR_GET_APP_LINE = "No app yet? Get it at pushary.com/download. Setup keeps waiting.";
745
+ var describePairingScreen = (screen) => [
746
+ bold("Connect your phone"),
747
+ "Scan this with your phone's camera or the Pushary app.",
748
+ `${dim("Or open on your phone:")} ${cyan(screen.universalLink)}`,
749
+ `Your phone will show ${cyan(screen.fingerprint)}. Check it matches.`,
750
+ `${dim("Already have the app and it opened a browser? Use")} ${cyan(screen.deepLink)}`,
751
+ dim(PAIR_GET_APP_LINE)
752
+ ];
741
753
  var SYSTEM_PAIR_CLOCK = { now: () => Date.now(), sleep };
742
754
  var startPairing = async (cliPublicKey, computer) => {
743
755
  try {
@@ -841,15 +853,10 @@ var connectViaAppPairing = async (options = {}) => {
841
853
  }
842
854
  const { pairId, code } = started;
843
855
  const { qrLink, universalLink, deepLink } = buildPairLinks(pairId, keypair.publicKeyB64, apiBase(), code);
844
- console.log();
845
- console.log(` ${bold("Connect your Pushary app")}`);
846
- console.log(` ${dim("Scan this with your phone camera:")}`);
856
+ for (const line of describePairingScreen({ universalLink, fingerprint: publicKeyFingerprint(keypair.publicKeyB64), deepLink })) {
857
+ console.log(` ${line}`);
858
+ }
847
859
  await printQr(qrLink);
848
- console.log(` ${dim("No camera handy? Open this on the phone instead:")}`);
849
- console.log(` ${cyan(universalLink)}`);
850
- console.log(` ${dim("Confirm the app shows fingerprint")} ${cyan(publicKeyFingerprint(keypair.publicKeyB64))}`);
851
- console.log(` ${dim("Already have the app and it opened a browser? Use")} ${cyan(deepLink)}`);
852
- console.log();
853
860
  const startedAt = clock.now();
854
861
  const deadline = requestedAt + PAIR_TIMEOUT_MS;
855
862
  let hintShown = false;
@@ -861,20 +868,22 @@ var connectViaAppPairing = async (options = {}) => {
861
868
  }
862
869
  if (!hintShown) {
863
870
  hintShown = true;
864
- writeStatusLine(
865
- `${dim("No app yet? Install it, sign in with this account, then scan. Ctrl-C to stop.")}`
866
- );
871
+ writeStatusLine(dim(PAIR_INSTALL_HINT));
867
872
  }
868
873
  return `Waiting for the app ${dim(`(${left}m left)`)}`;
869
874
  });
870
875
  let cancelled = false;
871
- const onInterrupt = () => {
876
+ const cancelOnSignal = (exitCode) => () => {
877
+ if (cancelled) return;
872
878
  cancelled = true;
873
879
  stop(yellow("!"), "Cancelled");
874
- const flushed = options.onCancelled?.();
875
- void Promise.allSettled([Promise.resolve(flushed), cancelPairing(pairId)]).finally(() => process.exit(EXIT_ABORTED));
880
+ const flushed = options.onCancelled?.(exitCode);
881
+ void Promise.allSettled([Promise.resolve(flushed), cancelPairing(pairId)]).finally(() => process.exit(exitCode));
876
882
  };
883
+ const onInterrupt = cancelOnSignal(EXIT_ABORTED);
884
+ const onTerminate = cancelOnSignal(EXIT_TERMINATED);
877
885
  process.once("SIGINT", onInterrupt);
886
+ process.once("SIGTERM", onTerminate);
878
887
  let consecutiveFailures = 0;
879
888
  try {
880
889
  while (clock.now() < deadline) {
@@ -900,7 +909,7 @@ var connectViaAppPairing = async (options = {}) => {
900
909
  try {
901
910
  apiKey = openSealedKey(claim.sealed, keypair);
902
911
  } catch {
903
- stop(yellow("!"), "Pairing failed to decrypt \u2014 re-run setup to try again");
912
+ stop(yellow("!"), "Pairing failed to decrypt. Re-run setup to try again.");
904
913
  await cancelPairing(pairId);
905
914
  return pairFailed("decrypt");
906
915
  }
@@ -909,7 +918,7 @@ var connectViaAppPairing = async (options = {}) => {
909
918
  return { kind: "paired", apiKey, handle: claim.siteSlug };
910
919
  }
911
920
  if (claim?.status === "expired") {
912
- stop(yellow("!"), "Pairing expired \u2014 re-run setup to try again");
921
+ stop(yellow("!"), "Pairing expired. Re-run setup to try again.");
913
922
  return pairFailed("expired");
914
923
  }
915
924
  if (claim?.status === "failed") {
@@ -927,6 +936,7 @@ var connectViaAppPairing = async (options = {}) => {
927
936
  return pairFailed("unreachable");
928
937
  } finally {
929
938
  process.off("SIGINT", onInterrupt);
939
+ process.off("SIGTERM", onTerminate);
930
940
  }
931
941
  };
932
942
 
@@ -934,6 +944,7 @@ export {
934
944
  reachVerdict,
935
945
  describeReach,
936
946
  verifyRoundTrip,
947
+ describeRoundTripOutcome,
937
948
  describeRoundTrip,
938
949
  roundTripEvidence,
939
950
  fetchChannels,
@@ -3,10 +3,10 @@ import {
3
3
  keyPrefix,
4
4
  readConfigFileKey,
5
5
  readMacAppKeyPrefix
6
- } from "./chunk-5EWNGYFD.js";
6
+ } from "./chunk-TEWUZ3MT.js";
7
7
  import {
8
8
  NPX_LATEST_COMMAND
9
- } from "./chunk-PNUWMEIY.js";
9
+ } from "./chunk-YVDFJ6VV.js";
10
10
 
11
11
  // src/key-signed-out.ts
12
12
  var VERDICT_BY_CHECK = {
@@ -6,12 +6,12 @@ import {
6
6
  permissionDeniedAction,
7
7
  releaseThrottle,
8
8
  reportEvent
9
- } from "./chunk-IQCNOEQL.js";
9
+ } from "./chunk-AEWPTGG2.js";
10
10
  import {
11
11
  machineDecisionFor,
12
12
  shouldDeferToNativeMode,
13
13
  wireVerdictFor
14
- } from "./chunk-AYV2NRYJ.js";
14
+ } from "./chunk-OG5HVCVG.js";
15
15
 
16
16
  // src/machine-decision-audit.ts
17
17
  import { basename } from "path";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  openCodeConfigDirFrom
3
- } from "./chunk-NDKFHLJI.js";
3
+ } from "./chunk-P76XTT2Y.js";
4
4
  import {
5
5
  codexHomeFrom,
6
6
  resolvePathBinary
7
- } from "./chunk-HJL5RBOU.js";
7
+ } from "./chunk-GFW4NSYW.js";
8
8
  import {
9
9
  HOOK_COMPATIBLE_PROFILES
10
- } from "./chunk-AYV2NRYJ.js";
10
+ } from "./chunk-OG5HVCVG.js";
11
11
 
12
12
  // src/hermes-config.ts
13
13
  import { execFileSync } from "child_process";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  keyCheckFromResponse
3
- } from "./chunk-PSWFYNOX.js";
3
+ } from "./chunk-Z7LEZQSY.js";
4
4
  import {
5
5
  installNetworkDefaults
6
- } from "./chunk-3FQCZSEQ.js";
6
+ } from "./chunk-KWMZDPUJ.js";
7
7
  import {
8
8
  getBaseUrl
9
- } from "./chunk-HTO2XULO.js";
9
+ } from "./chunk-KRSBK5BE.js";
10
10
 
11
11
  // src/retry.ts
12
12
  var isRetryable = (err) => {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  guardBinary
3
- } from "./chunk-HJL5RBOU.js";
3
+ } from "./chunk-GFW4NSYW.js";
4
4
 
5
5
  // src/bell/install.ts
6
6
  import { join } from "path";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  readTranscriptPreference
3
- } from "./chunk-5EWNGYFD.js";
3
+ } from "./chunk-TEWUZ3MT.js";
4
4
 
5
5
  // src/transcript-setting.ts
6
6
  var transcriptEnvironmentPreference = () => {
@@ -1,12 +1,13 @@
1
1
  import {
2
2
  MCP_BRIDGE_BINARY
3
- } from "./chunk-D72OJS4S.js";
3
+ } from "./chunk-PMKC4ZYP.js";
4
4
  import {
5
5
  KEY_FILE_MODE
6
- } from "./chunk-5EWNGYFD.js";
6
+ } from "./chunk-TEWUZ3MT.js";
7
7
  import {
8
- NpmMissingError
9
- } from "./chunk-HJL5RBOU.js";
8
+ NpmMissingError,
9
+ NpmPermissionError
10
+ } from "./chunk-GFW4NSYW.js";
10
11
  import {
11
12
  readJsonSafe,
12
13
  writeFileAtomic,
@@ -14,7 +15,7 @@ import {
14
15
  } from "./chunk-T7E75EKA.js";
15
16
  import {
16
17
  NPX_LATEST_COMMAND
17
- } from "./chunk-PNUWMEIY.js";
18
+ } from "./chunk-YVDFJ6VV.js";
18
19
 
19
20
  // src/instruction-file.ts
20
21
  import { existsSync, readFileSync, writeFileSync, mkdirSync, rmSync } from "fs";
@@ -472,21 +473,37 @@ var AgentConfigError = class extends Error {
472
473
  var configFailureKind = (readFailure) => readFailure === "unparseable" ? "config-unparseable" : "config-unreadable";
473
474
  var AGENT_FAILURE_DETAILS = {
474
475
  "not-wired": "reported success but its config is not there.",
475
- "app-account-mismatch": "Mac app hooks kept, but their Pushary account could not be matched to this setup."
476
+ "app-account-mismatch": "Pushary for Mac set it up with an account that does not match this setup, so it was left as it is."
477
+ };
478
+ var DESCRIBED_FAILURE_REMEDIES = {
479
+ "not-wired": "retry-agent",
480
+ "app-account-mismatch": "match-mac-account"
476
481
  };
477
482
  var describedAgentFailure = (agent, kind) => ({
478
483
  agent,
479
484
  kind,
480
485
  detail: AGENT_FAILURE_DETAILS[kind],
481
- remedy: "retry-agent"
486
+ remedy: DESCRIBED_FAILURE_REMEDIES[kind]
482
487
  });
488
+ var remedyForError = (error) => {
489
+ if (error instanceof NpmMissingError) return "install-node";
490
+ if (error instanceof NpmPermissionError) return "fix-npm-prefix";
491
+ return "retry-agent";
492
+ };
483
493
  var agentFailureFromError = (agent, error, describeError) => ({
484
494
  agent,
485
495
  kind: error instanceof AgentConfigError ? error.kind : "installer-error",
486
496
  detail: describeError(error),
487
- remedy: error instanceof NpmMissingError ? "install-node" : "retry-agent"
497
+ remedy: remedyForError(error)
488
498
  });
489
499
  var retryAgentCommand = (agent) => `${NPX_LATEST_COMMAND} setup --agents ${agent}`;
500
+ var takeOverHooksCommand = (agent) => `${retryAgentCommand(agent)} --take-over-hooks`;
501
+ var matchMacAccountStep = (agent, setupAccount) => `Sign Pushary for Mac into ${setupAccount ?? "this setup's account"}, or run ${takeOverHooksCommand(agent)}`;
502
+ var UNCHECKED_ACCOUNT = "an account that could not be checked";
503
+ var describeMacAccountMismatch = (mismatch) => [
504
+ `${mismatch.agentName}: Pushary for Mac uses ${mismatch.macAccount ?? UNCHECKED_ACCOUNT}. This setup uses ${mismatch.setupAccount ?? UNCHECKED_ACCOUNT}.`,
505
+ matchMacAccountStep(mismatch.agent, mismatch.setupAccount)
506
+ ];
490
507
  var REMAINING_AGENTS_CONTINUE = "Other agents will continue. Re-run setup to retry.";
491
508
  var afterAgentFailureNote = (agentsStillToSetUp) => agentsStillToSetUp > 0 ? REMAINING_AGENTS_CONTINUE : null;
492
509
  var failedAgentsContext = (configuredAgentNames) => configuredAgentNames.length > 0 ? `(configured: ${configuredAgentNames.join(", ")})` : null;
@@ -626,6 +643,8 @@ export {
626
643
  describedAgentFailure,
627
644
  agentFailureFromError,
628
645
  retryAgentCommand,
646
+ matchMacAccountStep,
647
+ describeMacAccountMismatch,
629
648
  afterAgentFailureNote,
630
649
  failedAgentsContext,
631
650
  agentFailureWire,
@@ -5,16 +5,16 @@ import {
5
5
  import {
6
6
  NOTIFICATION_MATCHED_TYPES,
7
7
  POSTTOOLUSE_MIRRORED_TOOLS
8
- } from "./chunk-52JA2WTH.js";
8
+ } from "./chunk-UJTQCOYP.js";
9
9
  import {
10
10
  isProtectedByScope,
11
11
  registerHookEntry
12
- } from "./chunk-HJL5RBOU.js";
12
+ } from "./chunk-GFW4NSYW.js";
13
13
  import {
14
14
  CLAUDE_PRETOOLUSE_MATCHER,
15
15
  HOOK_BUDGETS,
16
16
  HOOK_LOCATOR_BINARY
17
- } from "./chunk-AYV2NRYJ.js";
17
+ } from "./chunk-OG5HVCVG.js";
18
18
 
19
19
  // src/gemini-config.ts
20
20
  var GEMINI_HOOK_BINARY = "pushary-gemini-hook";
@@ -1,21 +1,21 @@
1
1
  import {
2
2
  defersToNativeMode,
3
3
  reportMachineDenial
4
- } from "./chunk-COZE23R3.js";
4
+ } from "./chunk-BHBTPKYT.js";
5
5
  import {
6
6
  isGatingMoment,
7
7
  recordKeylessMoment
8
- } from "./chunk-WWTB4DAE.js";
8
+ } from "./chunk-H3OSAPDD.js";
9
9
  import {
10
10
  announceSubscriptionRequired,
11
11
  denyReasonFrom,
12
12
  isDeferAnswer,
13
13
  oncePerSession
14
- } from "./chunk-6GRUERVL.js";
14
+ } from "./chunk-YJCNFRKV.js";
15
15
  import {
16
16
  activeHookSource,
17
17
  activeIdentity
18
- } from "./chunk-ME55HQOI.js";
18
+ } from "./chunk-73NUMFZG.js";
19
19
  import {
20
20
  DEFAULT_SESSION,
21
21
  UNNAMED_ACTION,
@@ -40,7 +40,7 @@ import {
40
40
  reportEvent,
41
41
  scopePathFor,
42
42
  settleQuestionsForToolUse
43
- } from "./chunk-IQCNOEQL.js";
43
+ } from "./chunk-AEWPTGG2.js";
44
44
  import {
45
45
  askUser,
46
46
  cancelQuestion,
@@ -51,20 +51,20 @@ import {
51
51
  requestGate,
52
52
  sendNotification,
53
53
  waitForQuestion
54
- } from "./chunk-YL6HU2KF.js";
54
+ } from "./chunk-Z4M66PI6.js";
55
55
  import {
56
56
  SubscriptionRequiredError
57
- } from "./chunk-SYLJL63X.js";
57
+ } from "./chunk-CUW5CPJJ.js";
58
58
  import {
59
59
  getMachineId
60
- } from "./chunk-NA5D62OI.js";
60
+ } from "./chunk-YCBXYOPI.js";
61
61
  import {
62
62
  getApiKey,
63
63
  getBaseUrl
64
- } from "./chunk-HTO2XULO.js";
64
+ } from "./chunk-KRSBK5BE.js";
65
65
  import {
66
66
  NPX_LATEST_COMMAND
67
- } from "./chunk-PNUWMEIY.js";
67
+ } from "./chunk-YVDFJ6VV.js";
68
68
  import {
69
69
  AGENT_QUESTION_STRATEGY,
70
70
  DECISION_STOP_REASON,
@@ -103,7 +103,7 @@ import {
103
103
  parseAgentQuestions,
104
104
  questionHandedToTheTerminal,
105
105
  resolveGate
106
- } from "./chunk-AYV2NRYJ.js";
106
+ } from "./chunk-OG5HVCVG.js";
107
107
 
108
108
  // src/claude-permission-rules.ts
109
109
  import { readFileSync, statSync } from "fs";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  CODEX_HOOK_STATUS
3
- } from "./chunk-LJJWNHUW.js";
3
+ } from "./chunk-3LRUBMNK.js";
4
4
  import {
5
5
  NPX_LATEST_COMMAND
6
- } from "./chunk-PNUWMEIY.js";
6
+ } from "./chunk-YVDFJ6VV.js";
7
7
 
8
8
  // src/setup/codex-trust.ts
9
9
  var CODEX_TRUST_TELEMETRY = {