pushary 1.9.133 → 1.9.135

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 (133) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/{api-7CZR7B53.js → api-WEDLFKUE.js} +11 -11
  3. package/dist/bin/pushary-audit.js +3 -3
  4. package/dist/bin/pushary-bell-hook.js +28 -27
  5. package/dist/bin/pushary-bell.js +10 -10
  6. package/dist/bin/pushary-claude.js +47 -33
  7. package/dist/bin/pushary-clean.js +35 -34
  8. package/dist/bin/pushary-codex-bridge.js +23 -22
  9. package/dist/bin/pushary-codex-hook.js +35 -34
  10. package/dist/bin/pushary-codex-session.js +8 -8
  11. package/dist/bin/pushary-codex.js +16 -15
  12. package/dist/bin/pushary-connect.js +29 -28
  13. package/dist/bin/pushary-cowork.js +5 -5
  14. package/dist/bin/pushary-daemon.js +85 -59
  15. package/dist/bin/pushary-disconnect.js +28 -27
  16. package/dist/bin/pushary-display-hook.js +23 -10
  17. package/dist/bin/pushary-doctor.js +50 -42
  18. package/dist/bin/pushary-elicitation-hook.js +28 -27
  19. package/dist/bin/pushary-gemini-bridge.js +20 -17
  20. package/dist/bin/pushary-gemini-hook.js +32 -31
  21. package/dist/bin/pushary-hook.js +34 -33
  22. package/dist/bin/pushary-login.js +21 -21
  23. package/dist/bin/pushary-logout.js +27 -26
  24. package/dist/bin/pushary-mcp.js +12 -12
  25. package/dist/bin/pushary-mode.js +15 -15
  26. package/dist/bin/pushary-notification-hook.js +27 -26
  27. package/dist/bin/pushary-opencode-hook.js +31 -30
  28. package/dist/bin/pushary-permission-denied-hook.js +34 -33
  29. package/dist/bin/pushary-permission-hook.js +34 -33
  30. package/dist/bin/pushary-post-hook.js +27 -26
  31. package/dist/bin/pushary-prompt-hook.js +27 -26
  32. package/dist/bin/pushary-session-end-hook.js +27 -26
  33. package/dist/bin/pushary-session-start-hook.js +36 -35
  34. package/dist/bin/pushary-setup.js +64 -49
  35. package/dist/bin/pushary-stats.js +5 -5
  36. package/dist/bin/pushary-status.js +33 -32
  37. package/dist/bin/pushary-stop-hook.js +27 -26
  38. package/dist/bin/pushary-stopfailure-hook.js +27 -26
  39. package/dist/bin/pushary-suggestions.js +15 -15
  40. package/dist/bin/pushary-transcript-register.js +17 -17
  41. package/dist/bin/pushary-transcripts.js +25 -25
  42. package/dist/bin/pushary-upgrade.js +47 -40
  43. package/dist/bin/pushary-wait.js +15 -15
  44. package/dist/bin/pushary.js +7 -7
  45. package/dist/{chunk-42PVKPHM.js → chunk-2K7MZRPH.js} +1 -1
  46. package/dist/{chunk-XMZVQF2J.js → chunk-35RCY4LB.js} +1 -1
  47. package/dist/{chunk-QVIDOVT6.js → chunk-3KPPXZCO.js} +15 -15
  48. package/dist/{chunk-KWICQAP7.js → chunk-4PPSXQQ6.js} +3 -3
  49. package/dist/{chunk-4EQOCSJW.js → chunk-4VVDRMVE.js} +1 -1
  50. package/dist/{chunk-HOPJEPL4.js → chunk-4XTB74D3.js} +4 -4
  51. package/dist/{chunk-ZXJTTV7I.js → chunk-4YBDKFU2.js} +2 -2
  52. package/dist/{chunk-VO55SJSD.js → chunk-5GQLZ46V.js} +11 -8
  53. package/dist/{chunk-EA5EASYT.js → chunk-64QLX4ZC.js} +1 -1
  54. package/dist/{chunk-I6MI4NWX.js → chunk-65ZWYA5L.js} +10 -10
  55. package/dist/{chunk-N5P2FLOJ.js → chunk-6QZGKKQS.js} +20 -5
  56. package/dist/{chunk-X23GSBOH.js → chunk-6RSAOA2P.js} +3 -3
  57. package/dist/{chunk-V2T5ZDMP.js → chunk-6UARD3WA.js} +3 -3
  58. package/dist/{chunk-RZBV5KTF.js → chunk-7ASHS5VR.js} +5 -5
  59. package/dist/{chunk-HW63OEVM.js → chunk-7DWERNHQ.js} +3 -3
  60. package/dist/{chunk-UDAXXR43.js → chunk-7GEMAKQL.js} +5 -5
  61. package/dist/{chunk-XWUPOTJV.js → chunk-7JXYR4TC.js} +5 -5
  62. package/dist/{chunk-2U4MCUVZ.js → chunk-7KWOR2T2.js} +1 -1
  63. package/dist/{chunk-A44MRVWG.js → chunk-ACI4PZ5N.js} +3 -3
  64. package/dist/{chunk-LBMCQWRX.js → chunk-AEOITMCS.js} +4 -4
  65. package/dist/chunk-AIZYJJGD.js +95 -0
  66. package/dist/{chunk-MF5ZQX7C.js → chunk-AXQFLLOB.js} +4 -4
  67. package/dist/{chunk-SZYKS433.js → chunk-BGXXWLS5.js} +1 -1
  68. package/dist/{chunk-NSBWFX7H.js → chunk-CGROOSWT.js} +5 -5
  69. package/dist/{chunk-RGVQOOGD.js → chunk-DMK3U7GG.js} +1 -1
  70. package/dist/{chunk-GQPXW6BL.js → chunk-E4RMOK4A.js} +1 -1
  71. package/dist/{chunk-EPPH5RMJ.js → chunk-EWJXECUK.js} +4 -4
  72. package/dist/{chunk-T6HX6OTY.js → chunk-FP6ZVMF2.js} +1 -1
  73. package/dist/{chunk-YI6RR4JP.js → chunk-FSLV5FIE.js} +4 -4
  74. package/dist/{chunk-PPUIIP3O.js → chunk-G3YIGTFS.js} +11 -11
  75. package/dist/{chunk-FTH4TSJ2.js → chunk-GLAGHQPB.js} +4 -4
  76. package/dist/{chunk-NYFUU23B.js → chunk-GRCX2FGD.js} +1 -1
  77. package/dist/{chunk-M65LPNIO.js → chunk-H4226UC7.js} +21 -1
  78. package/dist/{chunk-BKH4LQJC.js → chunk-IABPEGAA.js} +2 -2
  79. package/dist/{chunk-MJVDFNP2.js → chunk-IOUCIJ56.js} +1 -1
  80. package/dist/{chunk-KIWFCW7M.js → chunk-JDAX2HVS.js} +2 -2
  81. package/dist/{chunk-FJST6ZXC.js → chunk-KUAS2DGZ.js} +5 -5
  82. package/dist/{chunk-ZJPBTJED.js → chunk-LIXCHEDJ.js} +6 -6
  83. package/dist/{chunk-CVBSETPW.js → chunk-LTY5DSWT.js} +3 -3
  84. package/dist/{chunk-7MIT5C7B.js → chunk-MGTMXF3T.js} +3 -3
  85. package/dist/{chunk-PHKCTMAV.js → chunk-MYMADZRU.js} +2 -2
  86. package/dist/{chunk-QBJVECFY.js → chunk-N2DYYXQI.js} +2 -2
  87. package/dist/{chunk-2YS7YEUW.js → chunk-NBMK6T6R.js} +2 -2
  88. package/dist/{chunk-C4UH6YPD.js → chunk-NWNUS2ET.js} +4 -4
  89. package/dist/{chunk-3PGANQ4K.js → chunk-OEIU6BNH.js} +6 -6
  90. package/dist/{chunk-237FYIVC.js → chunk-ORZ7H3AQ.js} +4 -4
  91. package/dist/{chunk-FT5MTCKU.js → chunk-OUMH4UTT.js} +2 -2
  92. package/dist/{chunk-WZ4SIRMH.js → chunk-Q5GPXYDG.js} +1 -1
  93. package/dist/{chunk-D2KJKAYM.js → chunk-QLIG4PMT.js} +4 -4
  94. package/dist/{chunk-RVGYXUOC.js → chunk-QUMPSMZN.js} +3 -3
  95. package/dist/{chunk-3DCCMO23.js → chunk-RCZ5ZER4.js} +6 -6
  96. package/dist/{chunk-MRHGK3Q3.js → chunk-RGRPDJG3.js} +42 -25
  97. package/dist/{chunk-DS7XMYUB.js → chunk-RLNJNRYP.js} +1 -1
  98. package/dist/{chunk-LR3PIGRS.js → chunk-SFN72Q7W.js} +3 -3
  99. package/dist/{chunk-UJZ5YHSR.js → chunk-SULQKUPJ.js} +2 -2
  100. package/dist/{chunk-6JY44IZI.js → chunk-TKOALSA5.js} +8 -8
  101. package/dist/{chunk-YNV5GURD.js → chunk-U5W3MKPU.js} +5 -5
  102. package/dist/{chunk-PG23ENSN.js → chunk-UCDPJHZT.js} +2 -2
  103. package/dist/{chunk-VME5NXCM.js → chunk-UCGWTMQD.js} +3 -3
  104. package/dist/{chunk-UZUDMZES.js → chunk-UDSJKRRI.js} +2 -2
  105. package/dist/{chunk-25UU4Q4V.js → chunk-UQCVVN7K.js} +1 -1
  106. package/dist/{chunk-JYCAAQUW.js → chunk-UXPRMNH2.js} +1 -1
  107. package/dist/{chunk-3TKTZOKG.js → chunk-V7KBG7XH.js} +3 -3
  108. package/dist/{chunk-RLQDVWZ4.js → chunk-VCMJLNEP.js} +2 -2
  109. package/dist/{chunk-GKZMBU6T.js → chunk-VND6LN6X.js} +2 -2
  110. package/dist/{chunk-VRUEKURE.js → chunk-VXYGYCNR.js} +1 -1
  111. package/dist/{chunk-PFHRW3LR.js → chunk-WNPZGHHU.js} +3 -3
  112. package/dist/{chunk-IZJDVOJV.js → chunk-WPPTHRBO.js} +5 -5
  113. package/dist/{chunk-75FJZR2M.js → chunk-WTLQMJZ3.js} +3 -3
  114. package/dist/{chunk-XHC3UNOK.js → chunk-WVOMK2HW.js} +1 -1
  115. package/dist/{chunk-L5RSLIBQ.js → chunk-X3NYMHLG.js} +6 -6
  116. package/dist/chunk-XB75IJ3G.js +36 -0
  117. package/dist/{chunk-J4UNR655.js → chunk-XRO6NRBO.js} +6 -6
  118. package/dist/{chunk-W4FJR57E.js → chunk-ZJKWDM3S.js} +2 -2
  119. package/dist/{chunk-2KN53MPE.js → chunk-ZNST34QH.js} +5 -5
  120. package/dist/{codex-app-cards-switch-D2SODMQN.js → codex-app-cards-switch-C6DXLVAM.js} +11 -11
  121. package/dist/{codex-card-routing-X2HUY2AV.js → codex-card-routing-ZMMS4RIR.js} +2 -2
  122. package/dist/{codex-desktop-launch-CFKIJZVB.js → codex-desktop-launch-DIUFMA45.js} +1 -1
  123. package/dist/{codex-session-launch-YGH5UUAH.js → codex-session-launch-S4WTGKRY.js} +20 -19
  124. package/dist/{config-5SNDVPS2.js → config-BV5FQ536.js} +3 -3
  125. package/dist/{global-upgrade-U4V7KWH6.js → global-upgrade-JZWB67EU.js} +9 -9
  126. package/dist/{identity-DCRNA3J3.js → identity-G6FQTONT.js} +4 -4
  127. package/dist/{live-capabilities-H7J5ANZ3.js → live-capabilities-YHMOXY5E.js} +4 -4
  128. package/dist/{paths-3DUQGU4V.js → paths-XTEJ5LI2.js} +3 -3
  129. package/dist/{reapply-LNVBPUWL.js → reapply-MVZKPXIQ.js} +29 -28
  130. package/dist/src/index.js +33 -32
  131. package/dist/{upgrade-lock-3T7JLBHT.js → upgrade-lock-YPAQEEJA.js} +4 -4
  132. package/dist/{usage-XLJK7OTL.js → usage-R6PZTIEH.js} +3 -3
  133. package/package.json +1 -1
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  macAppBridgeAvailable
3
- } from "./chunk-NSBWFX7H.js";
3
+ } from "./chunk-CGROOSWT.js";
4
4
  import {
5
5
  keyPrefix
6
- } from "./chunk-CVBSETPW.js";
6
+ } from "./chunk-LTY5DSWT.js";
7
7
  import {
8
8
  bridgeAgentKey
9
- } from "./chunk-W4FJR57E.js";
9
+ } from "./chunk-ZJKWDM3S.js";
10
10
  import {
11
11
  readJsonSafe
12
12
  } from "./chunk-TODDEIYG.js";
13
13
  import {
14
14
  isRecord,
15
15
  isValidApiKey
16
- } from "./chunk-M65LPNIO.js";
16
+ } from "./chunk-H4226UC7.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,7 +1,7 @@
1
1
  import {
2
2
  HOOK_HOLD_BUDGET_ENV,
3
3
  hookHoldBudgetProof
4
- } from "./chunk-M65LPNIO.js";
4
+ } from "./chunk-H4226UC7.js";
5
5
 
6
6
  // src/hold-budget.ts
7
7
  var takeHookHoldBudget = (args = process.argv.slice(2), env = process.env) => {
@@ -1538,6 +1538,25 @@ var COMMAND_ACKNOWLEDGEMENT_STATES = [
1538
1538
  ...COMMAND_SETTLEMENT_STATES
1539
1539
  ];
1540
1540
  var isCommandAcknowledgementReceipt = (value) => typeof value === "object" && value !== null && "ok" in value && value.ok === true;
1541
+ var COMMAND_ACK_ERRORS = {
1542
+ unauthorized: { status: 401, error: "Unauthorized", final: false },
1543
+ forbiddenKeyScope: { status: 403, error: "Forbidden key scope", final: true },
1544
+ invalidAck: { status: 400, error: "invalid_ack", final: true },
1545
+ invalidMachineId: { status: 400, error: "invalid_machine_id", final: true },
1546
+ invalidDispatch: { status: 400, error: "invalid_dispatch", final: true },
1547
+ machineRequired: { status: 400, error: "machine_required", final: true },
1548
+ ackUnavailable: { status: 503, error: "ack_unavailable", final: false },
1549
+ claimMismatch: { status: 409, error: "claim_mismatch", final: true },
1550
+ staleCommand: { status: 409, error: "stale_command", final: true }
1551
+ };
1552
+ var COMMAND_ACK_ERROR_RESPONSES = Object.values(COMMAND_ACK_ERRORS);
1553
+ var commandAckErrorOf = (body) => isRecord(body) && typeof body.error === "string" ? body.error : null;
1554
+ var isFinalCommandAckRefusal = (status, body) => {
1555
+ const error = commandAckErrorOf(body);
1556
+ return COMMAND_ACK_ERROR_RESPONSES.some(
1557
+ (response) => response.final && response.status === status && response.error === error
1558
+ );
1559
+ };
1541
1560
 
1542
1561
  // ../contracts/src/claude-wake.ts
1543
1562
  var CLAUDE_WAKE = {
@@ -9468,14 +9487,15 @@ export {
9468
9487
  parseHermesReplayCursor,
9469
9488
  hermesPendingAdmissionId,
9470
9489
  hermesReplayAdmissionId,
9490
+ isRecord,
9471
9491
  COMMAND_RECOVERY,
9472
9492
  isCommandAcknowledgementReceipt,
9493
+ isFinalCommandAckRefusal,
9473
9494
  CLAUDE_WAKE,
9474
9495
  isClaudeWakePrompt,
9475
9496
  claudeWakeDecision,
9476
9497
  CLAUDE_WAKE_API,
9477
9498
  claudeWakeWaitingOn,
9478
- isRecord,
9479
9499
  AGENT_QUESTION_HEADER_MAX,
9480
9500
  AGENT_QUESTION_OPTION_MAX,
9481
9501
  AGENT_QUESTION_DESCRIPTION_MAX,
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  configFilePath
3
- } from "./chunk-T6HX6OTY.js";
3
+ } from "./chunk-FP6ZVMF2.js";
4
4
  import {
5
5
  normalizeInstallSource
6
- } from "./chunk-M65LPNIO.js";
6
+ } from "./chunk-H4226UC7.js";
7
7
 
8
8
  // src/install-source.ts
9
9
  import { readFileSync } from "fs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  guardBinary
3
- } from "./chunk-W4FJR57E.js";
3
+ } from "./chunk-ZJKWDM3S.js";
4
4
 
5
5
  // src/bell/install.ts
6
6
  import { join } from "path";
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  autoUpdateLock
3
- } from "./chunk-W4FJR57E.js";
3
+ } from "./chunk-ZJKWDM3S.js";
4
4
  import {
5
5
  installPackageGlobally,
6
6
  npmErrorMessage,
7
7
  npmExitedOnPermissionDenied
8
- } from "./chunk-A44MRVWG.js";
8
+ } from "./chunk-ACI4PZ5N.js";
9
9
  import {
10
10
  writeJsonAtomic
11
11
  } from "./chunk-TODDEIYG.js";
@@ -3,24 +3,24 @@ import {
3
3
  expectedLaunchCapabilities,
4
4
  hasSpawnProvider,
5
5
  resolveControlPolicy
6
- } from "./chunk-X23GSBOH.js";
6
+ } from "./chunk-6RSAOA2P.js";
7
7
  import {
8
8
  daemonHasRemoteProof,
9
9
  daemonServiceManagerAvailable,
10
10
  hasDaemonServiceDefinition,
11
11
  readDaemonNeedsLogin,
12
12
  readDaemonStatus
13
- } from "./chunk-3DCCMO23.js";
13
+ } from "./chunk-RCZ5ZER4.js";
14
14
  import {
15
15
  getMachineId
16
- } from "./chunk-DS7XMYUB.js";
16
+ } from "./chunk-RLNJNRYP.js";
17
17
  import {
18
18
  readControlMode,
19
19
  readKeySource
20
- } from "./chunk-CVBSETPW.js";
20
+ } from "./chunk-LTY5DSWT.js";
21
21
  import {
22
22
  getBaseUrl
23
- } from "./chunk-T6HX6OTY.js";
23
+ } from "./chunk-FP6ZVMF2.js";
24
24
  import {
25
25
  getPackageVersion
26
26
  } from "./chunk-WIIMW5YO.js";
@@ -2,10 +2,10 @@ import {
2
2
  SIGNED_OUT_ON_MAC_MESSAGE,
3
3
  describeSignedOutKey,
4
4
  readSignedOutDiagnosis
5
- } from "./chunk-2YS7YEUW.js";
5
+ } from "./chunk-NBMK6T6R.js";
6
6
  import {
7
7
  APPROVAL_RULES_PATH
8
- } from "./chunk-GKZMBU6T.js";
8
+ } from "./chunk-VND6LN6X.js";
9
9
  import {
10
10
  createIo
11
11
  } from "./chunk-FO3MDD26.js";
@@ -14,19 +14,19 @@ import {
14
14
  checkApiKey,
15
15
  describeKeyCheck,
16
16
  keyCheckFromResponse
17
- } from "./chunk-LR3PIGRS.js";
17
+ } from "./chunk-SFN72Q7W.js";
18
18
  import {
19
19
  readKeySource
20
- } from "./chunk-CVBSETPW.js";
20
+ } from "./chunk-LTY5DSWT.js";
21
21
  import {
22
22
  getBaseUrl
23
- } from "./chunk-T6HX6OTY.js";
23
+ } from "./chunk-FP6ZVMF2.js";
24
24
  import {
25
25
  EXIT
26
26
  } from "./chunk-BG4HHB7E.js";
27
27
  import {
28
28
  KEY_SCOPE
29
- } from "./chunk-M65LPNIO.js";
29
+ } from "./chunk-H4226UC7.js";
30
30
 
31
31
  // src/cli/report-key.ts
32
32
  var { dim, yellow } = createIo();
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  resolveInstallSourceFor
3
- } from "./chunk-BKH4LQJC.js";
3
+ } from "./chunk-IABPEGAA.js";
4
4
  import {
5
5
  configFilePath
6
- } from "./chunk-T6HX6OTY.js";
6
+ } from "./chunk-FP6ZVMF2.js";
7
7
  import {
8
8
  backupFile,
9
9
  readJsonSafe,
@@ -14,7 +14,7 @@ import {
14
14
  API_KEY_PREFIX_PATTERN,
15
15
  isRecord,
16
16
  isValidApiKey
17
- } from "./chunk-M65LPNIO.js";
17
+ } from "./chunk-H4226UC7.js";
18
18
 
19
19
  // src/shell-alias.ts
20
20
  import { homedir } from "os";
@@ -5,10 +5,10 @@ import {
5
5
  hermesAppWiringRecord,
6
6
  hermesConfigReceipt,
7
7
  hermesSetupReceipt
8
- } from "./chunk-W4FJR57E.js";
8
+ } from "./chunk-ZJKWDM3S.js";
9
9
  import {
10
10
  resolvePathBinary
11
- } from "./chunk-A44MRVWG.js";
11
+ } from "./chunk-ACI4PZ5N.js";
12
12
  import {
13
13
  readJsonSafe,
14
14
  writeJsonAtomic
@@ -19,7 +19,7 @@ import {
19
19
  } from "./chunk-WIIMW5YO.js";
20
20
  import {
21
21
  isRecord
22
- } from "./chunk-M65LPNIO.js";
22
+ } from "./chunk-H4226UC7.js";
23
23
 
24
24
  // src/hermes/plugin-payload.ts
25
25
  import { createHash } from "crypto";
@@ -9,13 +9,13 @@ import {
9
9
  installedCodexApp,
10
10
  readCodexAppRuntime,
11
11
  shellQuoted
12
- } from "./chunk-VME5NXCM.js";
12
+ } from "./chunk-UCGWTMQD.js";
13
13
  import {
14
14
  writeHuman
15
15
  } from "./chunk-QCGNGEGE.js";
16
16
  import {
17
17
  xml
18
- } from "./chunk-3DCCMO23.js";
18
+ } from "./chunk-RCZ5ZER4.js";
19
19
  import {
20
20
  writeFileAtomic
21
21
  } from "./chunk-TODDEIYG.js";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  configFilePath
3
- } from "./chunk-T6HX6OTY.js";
3
+ } from "./chunk-FP6ZVMF2.js";
4
4
  import {
5
5
  readJsonSafe,
6
6
  writeJsonAtomic
7
7
  } from "./chunk-TODDEIYG.js";
8
8
  import {
9
9
  readSetupOutcomeProperties
10
- } from "./chunk-M65LPNIO.js";
10
+ } from "./chunk-H4226UC7.js";
11
11
 
12
12
  // src/diagnostics/service-runtime.ts
13
13
  var unescapeXml = (value) => value.replaceAll("&quot;", '"').replaceAll("&apos;", "'").replaceAll("&lt;", "<").replaceAll("&gt;", ">").replaceAll("&amp;", "&");
@@ -4,10 +4,10 @@ import {
4
4
  keyPrefix,
5
5
  readConfigFileKey,
6
6
  readMacAppKeyPrefix
7
- } from "./chunk-CVBSETPW.js";
7
+ } from "./chunk-LTY5DSWT.js";
8
8
  import {
9
9
  NPX_LATEST_COMMAND
10
- } from "./chunk-SZYKS433.js";
10
+ } from "./chunk-BGXXWLS5.js";
11
11
 
12
12
  // src/key-signed-out.ts
13
13
  var VERDICT_BY_CHECK = {
@@ -1,21 +1,21 @@
1
1
  import {
2
2
  UNNAMED_ACTION
3
- } from "./chunk-JYCAAQUW.js";
3
+ } from "./chunk-UXPRMNH2.js";
4
4
  import {
5
5
  askUser,
6
6
  isAwayPaused,
7
7
  isLocalQuestionHandoff,
8
8
  unavailableQuestionUnlessRefused,
9
9
  waitForQuestion
10
- } from "./chunk-J4UNR655.js";
10
+ } from "./chunk-XRO6NRBO.js";
11
11
  import {
12
12
  getMachineId
13
- } from "./chunk-DS7XMYUB.js";
13
+ } from "./chunk-RLNJNRYP.js";
14
14
  import {
15
15
  hookWaitClamped,
16
16
  hookWaitDeadline,
17
17
  scopeBreachReasonOf
18
- } from "./chunk-M65LPNIO.js";
18
+ } from "./chunk-H4226UC7.js";
19
19
 
20
20
  // src/pushed-question.ts
21
21
  var scopeQuestionOf = (verdict) => {
@@ -3,10 +3,10 @@ import {
3
3
  forkFinishWithUpgradeLock,
4
4
  installWithUpgradeLock,
5
5
  releaseAutoUpdateLock
6
- } from "./chunk-KIWFCW7M.js";
6
+ } from "./chunk-JDAX2HVS.js";
7
7
  import {
8
8
  phoneStartIsRequired
9
- } from "./chunk-X23GSBOH.js";
9
+ } from "./chunk-6RSAOA2P.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-UZUDMZES.js";
21
+ } from "./chunk-UDSJKRRI.js";
22
22
  import {
23
23
  autoUpdateLock,
24
24
  autoUpdateLog,
25
25
  autoUpdateState
26
- } from "./chunk-W4FJR57E.js";
26
+ } from "./chunk-ZJKWDM3S.js";
27
27
  import {
28
28
  execNpm,
29
29
  fetchLatestPublishedVersion,
30
30
  npmErrorMessage,
31
31
  readGlobalCliInstallAt,
32
32
  readGlobalPrefix
33
- } from "./chunk-A44MRVWG.js";
33
+ } from "./chunk-ACI4PZ5N.js";
34
34
  import {
35
35
  EXIT
36
36
  } from "./chunk-BG4HHB7E.js";
37
37
  import {
38
38
  NPX_LATEST_COMMAND
39
- } from "./chunk-SZYKS433.js";
39
+ } from "./chunk-BGXXWLS5.js";
40
40
  import {
41
41
  commandsPackage,
42
42
  globalUpgradeEntry,
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  AGENT_CHOICES
3
- } from "./chunk-XHC3UNOK.js";
3
+ } from "./chunk-WVOMK2HW.js";
4
4
  import {
5
5
  BELL_HOOK_BINARY
6
- } from "./chunk-MJVDFNP2.js";
6
+ } from "./chunk-IOUCIJ56.js";
7
7
  import {
8
8
  CLAUDE_HOOK_EVENTS,
9
9
  CODEX_HOOK_EVENTS,
@@ -16,13 +16,13 @@ import {
16
16
  isBridgeLocator,
17
17
  isProtectedByScope,
18
18
  registerHookEntry
19
- } from "./chunk-W4FJR57E.js";
19
+ } from "./chunk-ZJKWDM3S.js";
20
20
  import {
21
21
  CURSOR_GATE_EVENTS,
22
22
  HOOK_BUDGETS,
23
23
  HOOK_LOCATOR_BINARY,
24
24
  hookCommandHoldBudget
25
- } from "./chunk-M65LPNIO.js";
25
+ } from "./chunk-H4226UC7.js";
26
26
 
27
27
  // src/gemini-config.ts
28
28
  var GEMINI_HOOK_BINARY = "pushary-gemini-hook";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  claudeConfigDir
3
- } from "./chunk-W4FJR57E.js";
3
+ } from "./chunk-ZJKWDM3S.js";
4
4
  import {
5
5
  claudePermissionRulesFromSettings
6
- } from "./chunk-M65LPNIO.js";
6
+ } from "./chunk-H4226UC7.js";
7
7
 
8
8
  // src/claude-permission-rules.ts
9
9
  import { readFileSync, statSync } from "fs";
@@ -2,7 +2,7 @@ import {
2
2
  isApprovalMode,
3
3
  isRecord,
4
4
  isTimeoutAction
5
- } from "./chunk-M65LPNIO.js";
5
+ } from "./chunk-H4226UC7.js";
6
6
 
7
7
  // src/cli/settings-response.ts
8
8
  var isFiniteNumber = (value) => typeof value === "number" && Number.isFinite(value);
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  compatibleConfigFile,
3
3
  hasCompatibleHooks
4
- } from "./chunk-RZBV5KTF.js";
4
+ } from "./chunk-7ASHS5VR.js";
5
5
  import {
6
6
  pusharyHookExecutable
7
- } from "./chunk-237FYIVC.js";
7
+ } from "./chunk-ORZ7H3AQ.js";
8
8
  import {
9
9
  isProtectedByScope,
10
10
  registerHookEntry
11
- } from "./chunk-W4FJR57E.js";
11
+ } from "./chunk-ZJKWDM3S.js";
12
12
  import {
13
13
  isRecord
14
- } from "./chunk-M65LPNIO.js";
14
+ } from "./chunk-H4226UC7.js";
15
15
 
16
16
  // src/cursor-config.ts
17
17
  var hookCommandOf = (entry) => {
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  CODEX_HOOK_STATUS
3
- } from "./chunk-RLQDVWZ4.js";
3
+ } from "./chunk-VCMJLNEP.js";
4
4
  import {
5
5
  retryAgentCommand
6
- } from "./chunk-3TKTZOKG.js";
6
+ } from "./chunk-V7KBG7XH.js";
7
7
  import {
8
8
  NPX_LATEST_COMMAND
9
- } from "./chunk-SZYKS433.js";
9
+ } from "./chunk-BGXXWLS5.js";
10
10
 
11
11
  // src/setup/codex-trust.ts
12
12
  var CODEX_TRUST_TELEMETRY = {
@@ -4,19 +4,19 @@ import {
4
4
  } from "./chunk-H6CL3T2S.js";
5
5
  import {
6
6
  getMachineId
7
- } from "./chunk-DS7XMYUB.js";
7
+ } from "./chunk-RLNJNRYP.js";
8
8
  import {
9
9
  readControlMode
10
- } from "./chunk-CVBSETPW.js";
10
+ } from "./chunk-LTY5DSWT.js";
11
11
  import {
12
12
  pusharyDir
13
- } from "./chunk-W4FJR57E.js";
13
+ } from "./chunk-ZJKWDM3S.js";
14
14
  import {
15
15
  resolveGlobalBinary
16
- } from "./chunk-A44MRVWG.js";
16
+ } from "./chunk-ACI4PZ5N.js";
17
17
  import {
18
18
  getApiKey
19
- } from "./chunk-T6HX6OTY.js";
19
+ } from "./chunk-FP6ZVMF2.js";
20
20
  import {
21
21
  readJsonSafe,
22
22
  writeFileAtomic,
@@ -32,7 +32,7 @@ import {
32
32
  } from "./chunk-WIIMW5YO.js";
33
33
  import {
34
34
  isRecord
35
- } from "./chunk-M65LPNIO.js";
35
+ } from "./chunk-H4226UC7.js";
36
36
 
37
37
  // src/daemon-lifecycle.ts
38
38
  import { dirname, join, win32 as win32Path } from "path";
@@ -27,11 +27,11 @@ import {
27
27
  toolResultErrorText,
28
28
  transcriptTokensIn,
29
29
  transcriptUsageRequest
30
- } from "./chunk-JYCAAQUW.js";
30
+ } from "./chunk-UXPRMNH2.js";
31
31
  import {
32
32
  branchFor,
33
33
  repoKeyFor
34
- } from "./chunk-RGVQOOGD.js";
34
+ } from "./chunk-DMK3U7GG.js";
35
35
  import {
36
36
  cancelQuestion,
37
37
  clientErrorKindOf,
@@ -39,35 +39,40 @@ import {
39
39
  reportClientError,
40
40
  sendNotification,
41
41
  waitForAnswer
42
- } from "./chunk-J4UNR655.js";
42
+ } from "./chunk-XRO6NRBO.js";
43
+ import {
44
+ RETRY_ACK,
45
+ readCommandAck,
46
+ refusedReceiptMessage
47
+ } from "./chunk-XB75IJ3G.js";
43
48
  import {
44
49
  isRetryable,
45
50
  withRetry
46
- } from "./chunk-2KN53MPE.js";
51
+ } from "./chunk-ZNST34QH.js";
47
52
  import {
48
53
  fetchAsCredential
49
- } from "./chunk-42PVKPHM.js";
54
+ } from "./chunk-2K7MZRPH.js";
50
55
  import {
51
56
  getMachineId
52
- } from "./chunk-DS7XMYUB.js";
57
+ } from "./chunk-RLNJNRYP.js";
53
58
  import {
54
59
  reportedInstallSource
55
- } from "./chunk-BKH4LQJC.js";
60
+ } from "./chunk-IABPEGAA.js";
56
61
  import {
57
62
  IDLE_PROMPT_NOTIFICATION,
58
63
  NOTIFICATION_PUSH_TYPES,
59
64
  POSTTOOLUSE_MIRROR_ONLY_TOOLS,
60
65
  canonicalJson,
61
66
  claudeConfigDir
62
- } from "./chunk-W4FJR57E.js";
67
+ } from "./chunk-ZJKWDM3S.js";
63
68
  import {
64
69
  compareVersion,
65
70
  parseVersion
66
- } from "./chunk-A44MRVWG.js";
71
+ } from "./chunk-ACI4PZ5N.js";
67
72
  import {
68
73
  getApiKey,
69
74
  getBaseUrl
70
- } from "./chunk-T6HX6OTY.js";
75
+ } from "./chunk-FP6ZVMF2.js";
71
76
  import {
72
77
  writeFileAtomic,
73
78
  writeJsonAtomicDurable
@@ -96,7 +101,7 @@ import {
96
101
  resolveAutoResolveOrigin,
97
102
  resolvePolicy,
98
103
  unansweredRefusalReason
99
- } from "./chunk-M65LPNIO.js";
104
+ } from "./chunk-H4226UC7.js";
100
105
 
101
106
  // src/pending.ts
102
107
  import { join } from "path";
@@ -116,6 +121,7 @@ var commandDirFor = (sessionId, namespace = "") => join(
116
121
  );
117
122
  var legacyCommandFile = (sessionId, namespace = "") => join(commandDirFor(sessionId, namespace), "command.json");
118
123
  var commandFile = (sessionId, id, namespace = "") => join(commandDirFor(sessionId, namespace), `${createHash("sha256").update(id).digest("hex")}.json`);
124
+ var wasRefusedByTheServer = (command) => command.refused === true;
119
125
  var readCommandFile = (file) => {
120
126
  try {
121
127
  if (!lstatSync(file).isFile()) return null;
@@ -132,6 +138,7 @@ var readCommandFile = (file) => {
132
138
  expiresAtMs: value.expiresAtMs,
133
139
  ...value.attempted === true ? { attempted: true } : {},
134
140
  ...typeof value.attemptedAtMs === "number" ? { attemptedAtMs: value.attemptedAtMs } : {},
141
+ ...value.refused === true ? { refused: true } : {},
135
142
  ...typeof value.sessionId === "string" ? { sessionId: value.sessionId } : {},
136
143
  delivered: value.delivered === true,
137
144
  ...value.failed === true || !value.delivered && !value.attempted && value.expiresAtMs <= Date.now() ? { failed: true } : {}
@@ -179,7 +186,7 @@ var pruneExpiredCommandStore = () => {
179
186
  }
180
187
  };
181
188
  var readPendingCommand = (sessionId, namespace = "") => {
182
- const commands = pruneExpiredCommands(commandDirFor(sessionId, namespace));
189
+ const commands = pruneExpiredCommands(commandDirFor(sessionId, namespace)).filter((command) => !wasRefusedByTheServer(command));
183
190
  return commands.find((command) => !command.delivered && !command.failed && !command.attempted) ?? commands[0] ?? null;
184
191
  };
185
192
  var writeNewCommandFile = (file, contents) => {
@@ -228,7 +235,7 @@ var updatePendingCommand = (sessionId, id, update, namespace = "") => {
228
235
  };
229
236
  var markPendingCommandAttempted = (sessionId, id, namespace = "") => {
230
237
  const command = readPendingCommandById(sessionId, id, namespace);
231
- if (!command || command.attempted || command.delivered || command.failed) return false;
238
+ if (!command || command.attempted || command.delivered || command.failed || wasRefusedByTheServer(command)) return false;
232
239
  try {
233
240
  const descriptor = openSync(`${commandFile(sessionId, id, namespace)}.emission`, "wx", 384);
234
241
  try {
@@ -244,13 +251,17 @@ var markPendingCommandAttempted = (sessionId, id, namespace = "") => {
244
251
  var pendingCommandReceipts = (namespace) => {
245
252
  const root = join(commandRoot(), createHash("sha256").update(namespace).digest("hex").slice(0, 16));
246
253
  try {
247
- return readdirSync(root, { withFileTypes: true }).filter((entry) => entry.isDirectory()).flatMap((entry) => pruneExpiredCommands(join(root, entry.name)).filter((command) => command.delivered || command.failed || command.attempted && Date.now() - (command.attemptedAtMs ?? 0) >= COMMAND_RECOVERY.emissionRecoveryGraceMs).map((command) => ({ sessionId: command.sessionId ?? entry.name, command })));
254
+ return readdirSync(root, { withFileTypes: true }).filter((entry) => entry.isDirectory()).flatMap((entry) => pruneExpiredCommands(join(root, entry.name)).filter((command) => !wasRefusedByTheServer(command) && (command.delivered || command.failed || command.attempted && Date.now() - (command.attemptedAtMs ?? 0) >= COMMAND_RECOVERY.emissionRecoveryGraceMs)).map((command) => ({ sessionId: command.sessionId ?? entry.name, command })));
248
255
  } catch {
249
256
  return [];
250
257
  }
251
258
  };
252
259
  var markPendingCommandDelivered = (sessionId, id, namespace = "") => updatePendingCommand(sessionId, id, { delivered: true, failed: void 0 }, namespace);
253
260
  var markPendingCommandFailed = (sessionId, id, namespace = "") => updatePendingCommand(sessionId, id, { delivered: false, failed: true }, namespace);
261
+ var REFUSED_AFTER_DELIVERY = { refused: true };
262
+ var REFUSED_BEFORE_CONFIRMED_DELIVERY = { refused: true, failed: true };
263
+ var refusalTombstoneFor = (command) => command?.delivered ? REFUSED_AFTER_DELIVERY : REFUSED_BEFORE_CONFIRMED_DELIVERY;
264
+ var markPendingCommandRefused = (sessionId, id, namespace = "") => updatePendingCommand(sessionId, id, refusalTombstoneFor(readPendingCommandById(sessionId, id, namespace)), namespace);
254
265
  var removePendingCommand = (sessionId, id, namespace = "") => {
255
266
  if (!readPendingCommandById(sessionId, id, namespace)) return;
256
267
  try {
@@ -350,12 +361,9 @@ var emitHookOutput = async (render, write = writeOutput) => {
350
361
  command.namespace
351
362
  ))
352
363
  continue;
353
- if (await command.acknowledge())
354
- removePendingCommand(
355
- command.sessionId,
356
- command.commandId,
357
- command.namespace
358
- );
364
+ const ack = await command.acknowledge();
365
+ if (ack.outcome === "settled") removePendingCommand(command.sessionId, command.commandId, command.namespace);
366
+ if (ack.outcome === "refused") markPendingCommandRefused(command.sessionId, command.commandId, command.namespace);
359
367
  }
360
368
  };
361
369
 
@@ -1266,7 +1274,7 @@ var detectInstallMode = () => (process.argv[1] ?? "").includes("_npx") ? "npx" :
1266
1274
  var acknowledgePendingCommand = async (apiKey, baseUrl, commandId, sessionId, machineId, timeoutMs, state = "delivered", signal) => {
1267
1275
  try {
1268
1276
  signal?.throwIfAborted();
1269
- if (timeoutMs <= 0) return false;
1277
+ if (timeoutMs <= 0) return RETRY_ACK;
1270
1278
  const response = await fetchAsCredential(apiKey, `${baseUrl}/api/agent/command/ack`, {
1271
1279
  method: "POST",
1272
1280
  headers: {
@@ -1282,9 +1290,12 @@ var acknowledgePendingCommand = async (apiKey, baseUrl, commandId, sessionId, ma
1282
1290
  }),
1283
1291
  signal: AbortSignal.any([AbortSignal.timeout(timeoutMs), ...signal ? [signal] : []])
1284
1292
  });
1285
- return response.ok;
1293
+ const ack = await readCommandAck(response);
1294
+ if (ack.outcome === "refused") process.stderr.write(`${refusedReceiptMessage(commandId, ack.status)}
1295
+ `);
1296
+ return ack;
1286
1297
  } catch {
1287
- return false;
1298
+ return RETRY_ACK;
1288
1299
  }
1289
1300
  };
1290
1301
  var ACK_RESERVE_MS = 1500;
@@ -1358,7 +1369,11 @@ var reportEvent = async (event, options = {}) => {
1358
1369
  failed ? "failed" : storedCommand.attempted && !storedCommand.delivered ? "uncertain" : "delivered",
1359
1370
  options.signal
1360
1371
  );
1361
- if (!acknowledged) return withoutPending();
1372
+ if (acknowledged.outcome === "retry") return withoutPending();
1373
+ if (acknowledged.outcome === "refused") {
1374
+ markPendingCommandRefused(sessionKey, storedCommand.id, receiptNamespace);
1375
+ return withoutPending();
1376
+ }
1362
1377
  if (storedCommand.delivered || storedCommand.attempted || failed) {
1363
1378
  removePendingCommand(sessionKey, storedCommand.id, receiptNamespace);
1364
1379
  return withoutPending();
@@ -1391,7 +1406,8 @@ var reportEvent = async (event, options = {}) => {
1391
1406
  "delivered",
1392
1407
  options.signal
1393
1408
  );
1394
- if (!acknowledged || !markPendingCommandDelivered(sessionKey, result.pendingCommandId, receiptNamespace)) {
1409
+ if (acknowledged.outcome === "refused") markPendingCommandRefused(sessionKey, result.pendingCommandId, receiptNamespace);
1410
+ if (acknowledged.outcome !== "settled" || !markPendingCommandDelivered(sessionKey, result.pendingCommandId, receiptNamespace)) {
1395
1411
  return withoutPending();
1396
1412
  }
1397
1413
  }
@@ -1734,6 +1750,7 @@ export {
1734
1750
  pendingCommandReceipts,
1735
1751
  markPendingCommandDelivered,
1736
1752
  markPendingCommandFailed,
1753
+ markPendingCommandRefused,
1737
1754
  removePendingCommand,
1738
1755
  emitHookOutput,
1739
1756
  PHONE_DRIVER,