pushary 1.9.186 → 1.9.192

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 (154) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/data/cursor-plugin/.cursor-plugin/plugin.json +1 -1
  3. package/data/cursor-plugin/CHANGELOG.md +4 -0
  4. package/data/cursor-plugin/scripts/pushary-gate.mjs +34 -6
  5. package/data/openclaw-plugin/README.md +2 -2
  6. package/data/openclaw-plugin/dist/protected-writes.js +3 -2
  7. package/data/openclaw-plugin/package.json +1 -1
  8. package/data/vscode-plugin/.claude-plugin/plugin.json +1 -1
  9. package/data/vscode-plugin/CHANGELOG.md +4 -0
  10. package/data/vscode-plugin/scripts/pushary-gate.mjs +34 -6
  11. package/dist/{api-JW7AA573.js → api-XPS2NPJH.js} +13 -11
  12. package/dist/bin/pushary-audit.js +3 -3
  13. package/dist/bin/pushary-bell-hook.js +28 -28
  14. package/dist/bin/pushary-bell.js +12 -12
  15. package/dist/bin/pushary-calls.js +15 -15
  16. package/dist/bin/pushary-claude.js +27 -27
  17. package/dist/bin/pushary-clean.js +39 -39
  18. package/dist/bin/pushary-codex-bridge.js +23 -23
  19. package/dist/bin/pushary-codex-hook.js +91 -64
  20. package/dist/bin/pushary-codex-session.js +8 -8
  21. package/dist/bin/pushary-codex.js +16 -16
  22. package/dist/bin/pushary-connect.js +35 -35
  23. package/dist/bin/pushary-cowork.js +5 -5
  24. package/dist/bin/pushary-daemon.js +46 -46
  25. package/dist/bin/pushary-disconnect.js +30 -30
  26. package/dist/bin/pushary-display-hook.js +8 -0
  27. package/dist/bin/pushary-doctor.js +75 -53
  28. package/dist/bin/pushary-elicitation-hook.js +28 -28
  29. package/dist/bin/pushary-gemini-bridge.js +18 -18
  30. package/dist/bin/pushary-gemini-hook.js +32 -32
  31. package/dist/bin/pushary-hook.js +36 -36
  32. package/dist/bin/pushary-login.js +22 -22
  33. package/dist/bin/pushary-logout.js +30 -30
  34. package/dist/bin/pushary-mcp.js +12 -12
  35. package/dist/bin/pushary-mode.js +16 -16
  36. package/dist/bin/pushary-notification-hook.js +27 -27
  37. package/dist/bin/pushary-opencode-bridge.js +61 -24
  38. package/dist/bin/pushary-opencode-hook.js +45 -40
  39. package/dist/bin/pushary-permission-denied-hook.js +36 -36
  40. package/dist/bin/pushary-permission-hook.js +36 -36
  41. package/dist/bin/pushary-post-hook.js +28 -28
  42. package/dist/bin/pushary-prompt-hook.js +27 -27
  43. package/dist/bin/pushary-session-end-hook.js +27 -27
  44. package/dist/bin/pushary-session-start-hook.js +39 -39
  45. package/dist/bin/pushary-sessions.js +14 -14
  46. package/dist/bin/pushary-setup.js +55 -55
  47. package/dist/bin/pushary-stats.js +5 -5
  48. package/dist/bin/pushary-status.js +36 -36
  49. package/dist/bin/pushary-stop-hook.js +27 -27
  50. package/dist/bin/pushary-stopfailure-hook.js +27 -27
  51. package/dist/bin/pushary-suggestions.js +16 -16
  52. package/dist/bin/pushary-transcript-register.js +17 -17
  53. package/dist/bin/pushary-transcripts.js +25 -25
  54. package/dist/bin/pushary-upgrade.js +44 -44
  55. package/dist/bin/pushary-wait.js +16 -16
  56. package/dist/bin/pushary.js +7 -7
  57. package/dist/{chunk-P5EVSOB6.js → chunk-23WKGMTI.js} +4 -2
  58. package/dist/{chunk-6TVDGTWR.js → chunk-2HOKEC2I.js} +2 -2
  59. package/dist/{chunk-FVQASC2C.js → chunk-3APYAOZF.js} +3 -3
  60. package/dist/{chunk-EMGKV2QC.js → chunk-3ULFLONL.js} +1 -1
  61. package/dist/{chunk-G6V3D64U.js → chunk-4FVKGWWZ.js} +2 -2
  62. package/dist/{chunk-W522XWAT.js → chunk-4TIZJD3Q.js} +5 -5
  63. package/dist/{chunk-KKUUJQ7D.js → chunk-5IPXL33D.js} +1 -1
  64. package/dist/{chunk-DGG75PIW.js → chunk-5QP7DVQF.js} +1 -1
  65. package/dist/{chunk-R3ECFKO3.js → chunk-5WC6N3HA.js} +5 -5
  66. package/dist/{chunk-IPVW4IUW.js → chunk-5WT6DLL2.js} +5 -5
  67. package/dist/{chunk-26LAHVWI.js → chunk-6C7DT36Z.js} +18 -18
  68. package/dist/{chunk-CEWERXV4.js → chunk-6CJSVFAD.js} +2 -2
  69. package/dist/{chunk-K4WBFMAT.js → chunk-6EZY7IXB.js} +1 -1
  70. package/dist/{chunk-LRLAIP75.js → chunk-6TNKY3DC.js} +2 -2
  71. package/dist/{chunk-SQA3ZPM4.js → chunk-7K5AYNDY.js} +5 -5
  72. package/dist/chunk-7QUPTDT2.js +92 -0
  73. package/dist/{chunk-JKF5I32P.js → chunk-A4QFVUEY.js} +2 -2
  74. package/dist/{chunk-SRCQFOVZ.js → chunk-AD7R7TNQ.js} +4 -4
  75. package/dist/{chunk-OY5W64TR.js → chunk-AQLIBG2P.js} +1 -1
  76. package/dist/{chunk-4WJDKZEJ.js → chunk-C2B4LPJU.js} +2 -2
  77. package/dist/{chunk-CBE5G6UP.js → chunk-CDEJHIYQ.js} +4 -4
  78. package/dist/{chunk-DUZ6V74X.js → chunk-CDXD6W4N.js} +1 -1
  79. package/dist/{chunk-STWKEQRM.js → chunk-DAHGMBRE.js} +3 -3
  80. package/dist/{chunk-CL7QR6FW.js → chunk-DHD54IIT.js} +7 -7
  81. package/dist/{chunk-RS7CW5W7.js → chunk-DP6YHOKF.js} +2 -2
  82. package/dist/{chunk-EQGQPDCH.js → chunk-DQI4647T.js} +4 -4
  83. package/dist/{chunk-NZTPGQT7.js → chunk-E65O7RMA.js} +4 -4
  84. package/dist/{chunk-I7GUIT7E.js → chunk-EBIPQ3ZE.js} +20 -4
  85. package/dist/{chunk-GP377Y34.js → chunk-EJ56NJQ4.js} +7 -7
  86. package/dist/{chunk-NITOSXEV.js → chunk-EJJBM4OB.js} +1 -1
  87. package/dist/{chunk-6PBNSFQG.js → chunk-EPNYDS4H.js} +1 -1
  88. package/dist/{chunk-ZIEZJXQY.js → chunk-ETT24EIH.js} +3 -3
  89. package/dist/{chunk-H6NPQ336.js → chunk-F326QJEJ.js} +8 -8
  90. package/dist/{chunk-S67UAFW2.js → chunk-FY7WHRDJ.js} +3 -3
  91. package/dist/{chunk-6WLQ7WOD.js → chunk-FZWUUGC2.js} +4 -4
  92. package/dist/{chunk-GL4EIL5Q.js → chunk-GAAPUS5J.js} +1 -1
  93. package/dist/{chunk-YXKQXKGV.js → chunk-GGKGVCUN.js} +6 -5
  94. package/dist/{chunk-DDNFI2GA.js → chunk-GR46QR45.js} +6 -6
  95. package/dist/{chunk-5SN2IITE.js → chunk-GUBY4KIU.js} +8 -6
  96. package/dist/{chunk-H4ZHVSKE.js → chunk-GUZLBFER.js} +5 -5
  97. package/dist/{chunk-ZXAWHBFW.js → chunk-H6CBRJKT.js} +7 -6
  98. package/dist/{chunk-X55NVFKJ.js → chunk-HMMVGDL3.js} +11 -4
  99. package/dist/{chunk-LWWUA5DF.js → chunk-ITPAUHJ4.js} +1 -1
  100. package/dist/{chunk-ECBECMRW.js → chunk-IYOA3NWO.js} +1 -1
  101. package/dist/{chunk-7Z2N3SVV.js → chunk-JJBM5FYH.js} +2 -2
  102. package/dist/{chunk-MSUOS64O.js → chunk-JXZQ4XFL.js} +2 -2
  103. package/dist/{chunk-2DNN7O7B.js → chunk-KERLAXHG.js} +3 -3
  104. package/dist/{chunk-G2IFBGTY.js → chunk-LWUDOZHE.js} +4 -4
  105. package/dist/{chunk-RNN2XAF7.js → chunk-NCN7ANYA.js} +6 -6
  106. package/dist/{chunk-O67OY3RA.js → chunk-NFK2QF74.js} +5 -5
  107. package/dist/{chunk-ZK4E2VID.js → chunk-O7ZCWGYA.js} +2 -2
  108. package/dist/{chunk-A4CQJZ3K.js → chunk-OTJEIINV.js} +10 -8
  109. package/dist/{chunk-GXR3JSXP.js → chunk-OYZUPSD7.js} +6 -6
  110. package/dist/{chunk-AWYR3KPA.js → chunk-P4JYK7WB.js} +3 -3
  111. package/dist/{chunk-EEFNFZNQ.js → chunk-P6NACIBR.js} +4 -4
  112. package/dist/{chunk-V25PSICC.js → chunk-PUVD22DY.js} +12 -12
  113. package/dist/{chunk-HFDBV3ZJ.js → chunk-R2NYUOTC.js} +9 -9
  114. package/dist/{chunk-5FDIOHNH.js → chunk-RNPEOAPC.js} +2 -2
  115. package/dist/{chunk-NGDDNKOV.js → chunk-SHAHZQTQ.js} +4 -4
  116. package/dist/{chunk-KTKM7HS5.js → chunk-T4GV5MOC.js} +3 -3
  117. package/dist/{chunk-BLLDCO5A.js → chunk-TP47JHGJ.js} +1 -1
  118. package/dist/{chunk-4CPKJI4N.js → chunk-UF6RZBTL.js} +3 -3
  119. package/dist/{chunk-N5YRPYPC.js → chunk-URVW3D2J.js} +11 -11
  120. package/dist/{chunk-NDHS2ULF.js → chunk-UV5ROHY2.js} +1 -1
  121. package/dist/{chunk-W2WM5IXQ.js → chunk-UVNH4UGJ.js} +1 -1
  122. package/dist/{chunk-OBTUMS5L.js → chunk-UXQVXB7Q.js} +1 -1
  123. package/dist/{chunk-STJYAFMW.js → chunk-VDJMYP54.js} +3 -3
  124. package/dist/{chunk-TXVRUVBB.js → chunk-VEE2MRUN.js} +1 -1
  125. package/dist/{chunk-7OQZ5GL7.js → chunk-VH5DPURH.js} +1 -1
  126. package/dist/{chunk-XL2PSZIU.js → chunk-VNCN3Z4T.js} +2 -2
  127. package/dist/{chunk-7KLNBFFD.js → chunk-WB5DD232.js} +3 -3
  128. package/dist/{chunk-63HIRFYV.js → chunk-WNCTMTMG.js} +1 -1
  129. package/dist/{chunk-OLED2XSM.js → chunk-X4ENTDFT.js} +2 -2
  130. package/dist/{chunk-Q4FXPTPH.js → chunk-X7FIYMHC.js} +2 -2
  131. package/dist/{chunk-EBSFVPHH.js → chunk-XMNETXQ4.js} +6 -6
  132. package/dist/{chunk-NK3V3E6P.js → chunk-XONHTLMX.js} +10 -10
  133. package/dist/{chunk-5JRRWACR.js → chunk-XSJON4TV.js} +1 -1
  134. package/dist/{chunk-3MKRWTLZ.js → chunk-Y2H5TF7T.js} +1 -1
  135. package/dist/{chunk-WMXQFOTJ.js → chunk-YLZRG4U5.js} +1 -1
  136. package/dist/{chunk-ERI4ISGN.js → chunk-YMULPOSH.js} +5 -5
  137. package/dist/{chunk-PZBVUHRD.js → chunk-ZCR5VTOC.js} +5 -5
  138. package/dist/{codex-app-cards-switch-J4QYBE4B.js → codex-app-cards-switch-UEN23QFT.js} +11 -11
  139. package/dist/{codex-card-routing-TLQSULL6.js → codex-card-routing-CJZT26VA.js} +2 -2
  140. package/dist/{codex-desktop-launch-QS7RJIWL.js → codex-desktop-launch-DKOOCOTD.js} +1 -1
  141. package/dist/{codex-session-launch-IOALOU37.js → codex-session-launch-UHNV5Z3D.js} +20 -20
  142. package/dist/{config-WHD32JOQ.js → config-EVDZ6OAI.js} +3 -3
  143. package/dist/{global-upgrade-SILVY22G.js → global-upgrade-KZQWNABB.js} +9 -9
  144. package/dist/{identity-ZFMKTDMM.js → identity-A2BK7P2A.js} +4 -4
  145. package/dist/{live-capabilities-A5NUXYA3.js → live-capabilities-43YRGYAR.js} +4 -4
  146. package/dist/{paths-2Q5EPYCM.js → paths-67D2435E.js} +3 -3
  147. package/dist/reapply-APVASEGC.js +70 -0
  148. package/dist/src/index.d.ts +2 -1
  149. package/dist/src/index.js +35 -35
  150. package/dist/{upgrade-lock-YNBGIRDF.js → upgrade-lock-TG4UOPN7.js} +4 -4
  151. package/dist/{usage-K74RCKF7.js → usage-FVDJIMCB.js} +3 -3
  152. package/package.json +1 -1
  153. package/dist/chunk-ZVGPDR37.js +0 -62
  154. package/dist/reapply-TXX2GU6T.js +0 -70
@@ -1,41 +1,42 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  takeHookHoldBudget
4
- } from "../chunk-BLLDCO5A.js";
4
+ } from "../chunk-TP47JHGJ.js";
5
5
  import {
6
6
  parseCodexHookInput,
7
7
  pushQuestionAndWait,
8
8
  scopeQuestionOf
9
- } from "../chunk-YXKQXKGV.js";
9
+ } from "../chunk-GGKGVCUN.js";
10
10
  import {
11
11
  defersToNativeMode
12
- } from "../chunk-OBTUMS5L.js";
12
+ } from "../chunk-UXQVXB7Q.js";
13
13
  import {
14
14
  askAgentQuestions
15
- } from "../chunk-5SN2IITE.js";
15
+ } from "../chunk-GUBY4KIU.js";
16
16
  import {
17
- reportMachineDenial
18
- } from "../chunk-ZVGPDR37.js";
17
+ reportMachineDenial,
18
+ reportRuleCoveredRun
19
+ } from "../chunk-7QUPTDT2.js";
19
20
  import {
20
21
  isGatingMoment,
21
22
  recordKeylessMoment
22
- } from "../chunk-ECBECMRW.js";
23
+ } from "../chunk-IYOA3NWO.js";
23
24
  import {
24
25
  triggerAutoUpdate
25
- } from "../chunk-Q4FXPTPH.js";
26
+ } from "../chunk-X7FIYMHC.js";
26
27
  import {
27
28
  readHookInput
28
- } from "../chunk-SQA3ZPM4.js";
29
- import "../chunk-G2IFBGTY.js";
29
+ } from "../chunk-7K5AYNDY.js";
30
+ import "../chunk-LWUDOZHE.js";
30
31
  import {
31
32
  announceSubscriptionRequired,
32
33
  isDeferAnswer
33
- } from "../chunk-NDHS2ULF.js";
34
- import "../chunk-NK3V3E6P.js";
34
+ } from "../chunk-UV5ROHY2.js";
35
+ import "../chunk-XONHTLMX.js";
35
36
  import "../chunk-WHB622LP.js";
36
- import "../chunk-PZBVUHRD.js";
37
- import "../chunk-GXR3JSXP.js";
38
- import "../chunk-EQGQPDCH.js";
37
+ import "../chunk-ZCR5VTOC.js";
38
+ import "../chunk-OYZUPSD7.js";
39
+ import "../chunk-DQI4647T.js";
39
40
  import {
40
41
  CODEX_AGENT,
41
42
  DEFAULT_SESSION,
@@ -71,7 +72,7 @@ import {
71
72
  toPolicyLookups,
72
73
  userScope,
73
74
  withdrawLeftOpenQuestions
74
- } from "../chunk-V25PSICC.js";
75
+ } from "../chunk-PUVD22DY.js";
75
76
  import {
76
77
  codexReviewerDenialsSince,
77
78
  deriveActionBody,
@@ -84,13 +85,13 @@ import {
84
85
  scanCodexGuardianReviews,
85
86
  scopePathFor,
86
87
  sessionIdentityOf
87
- } from "../chunk-EMGKV2QC.js";
88
- import "../chunk-NITOSXEV.js";
89
- import "../chunk-LWWUA5DF.js";
88
+ } from "../chunk-3ULFLONL.js";
89
+ import "../chunk-EJJBM4OB.js";
90
+ import "../chunk-ITPAUHJ4.js";
90
91
  import "../chunk-BZIBNSQE.js";
91
- import "../chunk-7KLNBFFD.js";
92
+ import "../chunk-WB5DD232.js";
92
93
  import "../chunk-55L4JSPA.js";
93
- import "../chunk-DUZ6V74X.js";
94
+ import "../chunk-CDXD6W4N.js";
94
95
  import "../chunk-VRNGMRJA.js";
95
96
  import {
96
97
  ABANDONED_WAIT,
@@ -106,35 +107,35 @@ import {
106
107
  sendNotification,
107
108
  sleepUnlessAborted,
108
109
  withdrawQuestion
109
- } from "../chunk-A4CQJZ3K.js";
110
- import "../chunk-KKUUJQ7D.js";
110
+ } from "../chunk-OTJEIINV.js";
111
+ import "../chunk-5IPXL33D.js";
111
112
  import "../chunk-POFBE6ZY.js";
112
113
  import {
113
114
  SubscriptionRequiredError
114
- } from "../chunk-ZXAWHBFW.js";
115
+ } from "../chunk-H6CBRJKT.js";
115
116
  import {
116
117
  fetchAsCredential
117
- } from "../chunk-TXVRUVBB.js";
118
+ } from "../chunk-VEE2MRUN.js";
118
119
  import {
119
120
  projectNameFor,
120
121
  repoKeyFor,
121
122
  repositoryScopeFor
122
- } from "../chunk-7OQZ5GL7.js";
123
- import "../chunk-FVQASC2C.js";
124
- import "../chunk-KTKM7HS5.js";
123
+ } from "../chunk-VH5DPURH.js";
124
+ import "../chunk-3APYAOZF.js";
125
+ import "../chunk-T4GV5MOC.js";
125
126
  import {
126
127
  getMachineId
127
- } from "../chunk-5JRRWACR.js";
128
- import "../chunk-S67UAFW2.js";
129
- import "../chunk-RS7CW5W7.js";
128
+ } from "../chunk-XSJON4TV.js";
129
+ import "../chunk-FY7WHRDJ.js";
130
+ import "../chunk-DP6YHOKF.js";
130
131
  import {
131
132
  canonicalJson
132
- } from "../chunk-6TVDGTWR.js";
133
- import "../chunk-I7GUIT7E.js";
133
+ } from "../chunk-2HOKEC2I.js";
134
+ import "../chunk-EBIPQ3ZE.js";
134
135
  import {
135
136
  getApiKey,
136
137
  getBaseUrl
137
- } from "../chunk-3MKRWTLZ.js";
138
+ } from "../chunk-Y2H5TF7T.js";
138
139
  import "../chunk-CINBAX5G.js";
139
140
  import {
140
141
  writeFileAtomic
@@ -142,7 +143,7 @@ import {
142
143
  import {
143
144
  EXIT
144
145
  } from "../chunk-BG4HHB7E.js";
145
- import "../chunk-GL4EIL5Q.js";
146
+ import "../chunk-GAAPUS5J.js";
146
147
  import "../chunk-UQTQ6HPO.js";
147
148
  import {
148
149
  CALL_REFUSED_EVENT,
@@ -155,6 +156,7 @@ import {
155
156
  KILL_REASON,
156
157
  SCOPE_BATCH_REASON,
157
158
  UNVERIFIABLE_APPROVAL_REASON,
159
+ approvesWhenUnanswered,
158
160
  blockedActionIdentity,
159
161
  callRefusalReasonWhenUnanswered,
160
162
  codexDeferredPreToolUse,
@@ -178,7 +180,7 @@ import {
178
180
  refusesWhenUnanswered,
179
181
  resolveGate,
180
182
  unapprovedScopeReason
181
- } from "../chunk-X55NVFKJ.js";
183
+ } from "../chunk-HMMVGDL3.js";
182
184
  import "../chunk-MLKGABMK.js";
183
185
 
184
186
  // src/rule-watched-ask.ts
@@ -191,44 +193,55 @@ var FIRST_RULE_RECHECK_MS = 4e3;
191
193
  var LONGEST_RULE_RECHECK_MS = 15e3;
192
194
  var RULE_RECHECK_GROWTH = 1.5;
193
195
  var NO_RULE_CHANGE = { kind: "none" };
194
- var RULE_ALLOWS = { kind: "allows" };
195
- var COVERED_BY_RULE = { kind: "covered_by_rule" };
196
196
  var NO_FREE_SLOT = { kind: "no_free_slot" };
197
- var lastSlotAttemptAt = (startMs, waitSeconds, agent) => {
197
+ var slotWaitRoomOf = (waitSeconds, agent) => {
198
198
  const budgetMs = hookMaxWaitSeconds(agent) * 1e3;
199
199
  const windowMs = Math.min(Math.max(waitSeconds, 0) * 1e3, budgetMs);
200
- const slotWaitMs = Math.min(windowMs, budgetMs - windowMs - SLOT_ATTEMPT_MARGIN_MS, MAX_SLOT_WAIT_SECONDS * 1e3);
200
+ return { windowMs, beforeTheLastWholeWindowMs: budgetMs - windowMs - SLOT_ATTEMPT_MARGIN_MS };
201
+ };
202
+ var lastSlotAttemptAt = (startMs, waitSeconds, agent) => {
203
+ const { windowMs, beforeTheLastWholeWindowMs } = slotWaitRoomOf(waitSeconds, agent);
204
+ const slotWaitMs = Math.min(windowMs, beforeTheLastWholeWindowMs, MAX_SLOT_WAIT_SECONDS * 1e3);
201
205
  return startMs + Math.max(slotWaitMs, 0);
202
206
  };
207
+ var lastSlotAttemptOutlastingEarlierWindowsAt = (startMs, waitSeconds, agent) => {
208
+ const { windowMs, beforeTheLastWholeWindowMs } = slotWaitRoomOf(waitSeconds, agent);
209
+ return windowMs > 0 ? startMs + Math.max(beforeTheLastWholeWindowMs, 0) : startMs;
210
+ };
211
+ var lastSlotAttemptFor = ({ startMs, waitSeconds, agent, silenceApproves }) => silenceApproves ? lastSlotAttemptOutlastingEarlierWindowsAt(startMs, waitSeconds, agent) : lastSlotAttemptAt(startMs, waitSeconds, agent);
212
+ var ruleStoppedApprovingUnanswered = (verdict) => verdict.kind === "gate" && !approvesWhenUnanswered(verdict.policy);
213
+ var slotWaitFor = (rule) => rule.silenceApproves ? { lastSlotAttemptAtMs: lastSlotAttemptFor(rule), slotWaitEndsOn: ruleStoppedApprovingUnanswered } : { lastSlotAttemptAtMs: lastSlotAttemptFor(rule) };
203
214
  var nextRuleRecheckMs = (previousMs) => Math.min(Math.round(previousMs * RULE_RECHECK_GROWTH), LONGEST_RULE_RECHECK_MS);
204
215
  var ruleChangeOf = (verdict) => {
205
- if (verdict.kind === "allow") return RULE_ALLOWS;
216
+ if (verdict.kind === "allow") return { kind: "allows", verdict };
206
217
  if (isGateRefusal(verdict)) return { kind: "refuses", verdict };
207
218
  return NO_RULE_CHANGE;
208
219
  };
209
- var readRuleChange = async (deps, signal) => {
210
- if (!deps.readsRules) return NO_RULE_CHANGE;
220
+ var RULES_UNREAD = null;
221
+ var readRules = async (deps, signal) => {
222
+ if (!deps.readsRules) return RULES_UNREAD;
211
223
  try {
212
- return ruleChangeOf(await deps.readsRules(signal));
224
+ return await deps.readsRules(signal);
213
225
  } catch {
214
- return NO_RULE_CHANGE;
226
+ return RULES_UNREAD;
215
227
  }
216
228
  };
217
- var readRuleChangeWithin = async (deps, limitMs) => {
229
+ var readRuleChange = async (deps, signal) => {
230
+ const verdict = await readRules(deps, signal);
231
+ return verdict === RULES_UNREAD ? NO_RULE_CHANGE : ruleChangeOf(verdict);
232
+ };
233
+ var readRulesWithin = async (deps, limitMs) => {
218
234
  const readOver = new AbortController();
219
- const timeUp = deps.sleep(limitMs, readOver.signal).then(() => NO_RULE_CHANGE, () => NO_RULE_CHANGE);
235
+ const timeUp = deps.sleep(limitMs, readOver.signal).then(() => RULES_UNREAD, () => RULES_UNREAD);
220
236
  try {
221
- return await Promise.race([readRuleChange(deps, readOver.signal), timeUp]);
237
+ return await Promise.race([readRules(deps, readOver.signal), timeUp]);
222
238
  } finally {
223
239
  readOver.abort();
224
240
  }
225
241
  };
226
242
  var ruleSettlesAFailedAsk = (change, error) => change.kind === "refuses" || isQuestionLimitRefusal(error);
227
- var outcomeOfRuleChange = (change) => {
228
- if (change.kind === "allows") return COVERED_BY_RULE;
229
- if (change.kind === "refuses") return { kind: "refused_by_rule", verdict: change.verdict };
230
- return null;
231
- };
243
+ var ruledOutcomeOf = (change) => change.kind === "allows" ? { kind: "covered_by_rule", verdict: change.verdict } : { kind: "refused_by_rule", verdict: change.verdict };
244
+ var outcomeOfRuleChange = (change) => change.kind === "none" ? null : ruledOutcomeOf(change);
232
245
  var watchForARuleChange = async (deps, waitOver) => {
233
246
  let intervalMs = FIRST_RULE_RECHECK_MS;
234
247
  while (!waitOver.aborted) {
@@ -244,8 +257,8 @@ var isSettled = (answer) => answer.answered || isDecisionStopped(answer);
244
257
  var wasAbandonedForARule = (answer) => answer.status === ABANDONED_WAIT.status;
245
258
  var settleAfterARuleChange = async (deps, pushed, correlationId, change) => {
246
259
  const late = correlationId.length > 0 ? await deps.withdraw(correlationId) : pushed.answer;
247
- if (change.kind === "refuses") return { kind: "refused_by_rule", verdict: change.verdict };
248
- return isSettled(late) ? { kind: "pushed", pushed: { ...pushed, answer: late } } : COVERED_BY_RULE;
260
+ if (change.kind === "allows" && isSettled(late)) return { kind: "pushed", pushed: { ...pushed, answer: late } };
261
+ return ruledOutcomeOf(change);
249
262
  };
250
263
  var pushWatchingForARule = async (deps) => {
251
264
  const ruleChanged = new AbortController();
@@ -280,7 +293,13 @@ var pushWatchingForARule = async (deps) => {
280
293
  }
281
294
  };
282
295
  var slotRetryStillFits = (deps) => deps.now() + SLOT_RETRY_MS <= deps.lastSlotAttemptAtMs;
283
- var ruleOutcomeBeforeRetry = async (deps) => outcomeOfRuleChange(await readRuleChangeWithin(deps, RULE_READ_BEFORE_RETRY_MS));
296
+ var ruleOutcomeBeforeRetry = async (deps) => {
297
+ const verdict = await readRulesWithin(deps, RULE_READ_BEFORE_RETRY_MS);
298
+ if (verdict === RULES_UNREAD) return null;
299
+ const ruled = outcomeOfRuleChange(ruleChangeOf(verdict));
300
+ if (ruled) return ruled;
301
+ return deps.slotWaitEndsOn?.(verdict) ? NO_FREE_SLOT : null;
302
+ };
284
303
  var askWatchingForARule = async (deps) => {
285
304
  for (; ; ) {
286
305
  try {
@@ -757,10 +776,13 @@ var callKeyFor = (input) => codexCallKey({
757
776
  toolInput: input.tool_input
758
777
  });
759
778
  var START_MS2 = Date.now();
760
- var REFUSAL_REPORT_DEADLINE_MS = START_MS2 + (HOOK_BUDGETS.codex.budgetSeconds - 1) * 1e3;
779
+ var REPORT_DEADLINE_MS = START_MS2 + (HOOK_BUDGETS.codex.budgetSeconds - 1) * 1e3;
761
780
  var agentNameFor = (input) => `Codex - ${projectNameFor(input.cwd)}`;
762
781
  var describeFor = (input, lookup) => input.tool_name === "apply_patch" ? describeApplyPatch(input.tool_input?.command) ?? describeToolCall(lookup.tool, lookup.input, "hook") : describeToolCall(lookup.tool, lookup.input, "hook");
763
782
  var AGENT_PROMPT_FOLLOWS_A_PRE_TOOL_USE_REFUSAL = false;
783
+ var HOOK_BUDGET_MS = hookMaxWaitSeconds("codex") * 1e3;
784
+ var SHORTEST_ASK_MS = 1;
785
+ var untilTheHookBudgetEnds = () => AbortSignal.timeout(Math.max(START_MS2 + HOOK_BUDGET_MS - Date.now(), SHORTEST_ASK_MS));
764
786
  var pushQuestion = (apiKey, input, lookup, waitSeconds, mode, noLocalSurface, scope, watch, preToolUse) => {
765
787
  const description = describeFor(input, lookup);
766
788
  return pushQuestionAndWait(apiKey, {
@@ -786,7 +808,7 @@ var pushQuestion = (apiKey, input, lookup, waitSeconds, mode, noLocalSurface, sc
786
808
  toolUseId: input.tool_use_id,
787
809
  ...preToolUse ? { agentPromptFollows: AGENT_PROMPT_FOLLOWS_A_PRE_TOOL_USE_REFUSAL } : {}
788
810
  }
789
- }, { agent: "codex", startMs: START_MS2, waitSeconds, askFailure: "wait_as_unavailable", signal: watch?.signal, onQuestionCreated: watch?.onQuestionCreated, rejoinable: preToolUse?.rejoinable });
811
+ }, { agent: "codex", startMs: START_MS2, waitSeconds, askFailure: "wait_as_unavailable", askSignal: untilTheHookBudgetEnds(), signal: watch?.signal, onQuestionCreated: watch?.onQuestionCreated, rejoinable: preToolUse?.rejoinable });
790
812
  };
791
813
  var codexStepsAside = (error, input) => {
792
814
  announceSubscriptionRequired(error.upgradeUrl, input.session_id);
@@ -826,9 +848,9 @@ var codexGate = async (apiKey, input, signal) => {
826
848
  return { verdict: resolveGate(gateInput), lookup, gateInput };
827
849
  };
828
850
  var SCOPE_BREACH_ASKS_ONCE = { lastSlotAttemptAtMs: START_MS2 };
829
- var ruleWatchFor = (apiKey, input, scope, waitSeconds) => scope ? SCOPE_BREACH_ASKS_ONCE : {
851
+ var ruleWatchFor = (apiKey, input, scope, slotWait) => scope ? SCOPE_BREACH_ASKS_ONCE : {
830
852
  readsRules: async (signal) => (await codexGate(apiKey, input, signal)).verdict,
831
- lastSlotAttemptAtMs: lastSlotAttemptAt(START_MS2, waitSeconds, "codex")
853
+ ...slotWait
832
854
  };
833
855
  var sessionKeyOf = (input) => input.session_id || DEFAULT_SESSION;
834
856
  var fingerprintOf = (input) => codexCallFingerprint({
@@ -856,6 +878,10 @@ var passedByRule = async (input, callFingerprint) => {
856
878
  await withdrawQuestionsLeftOpen(input, questionsAPassWithdraws(callFingerprint));
857
879
  return codexPass();
858
880
  };
881
+ var passedByARuleWhileHeld = async (input, lookup, verdict, callFingerprint) => {
882
+ await reportRuleCoveredRun({ ...input, tool_name: lookup.tool, tool_input: lookup.input }, verdict, CODEX_AGENT, REPORT_DEADLINE_MS);
883
+ return passedByRule(input, callFingerprint);
884
+ };
859
885
  var callsPusharysOwnTool = (input) => input.tool_name !== void 0 && isPusharyOwnTool(input.tool_name);
860
886
  var decidePermissionRequest = async (input) => {
861
887
  if (callsPusharysOwnTool(input)) return codexPass();
@@ -920,7 +946,7 @@ var reportIfRefused = (apiKey, input, lookup, deliveryMode, reason, decision) =>
920
946
  reason,
921
947
  deliveryMode,
922
948
  waitedSeconds: wholeSecondsBetween(START_MS2, Date.now())
923
- }, REFUSAL_REPORT_DEADLINE_MS);
949
+ }, REPORT_DEADLINE_MS);
924
950
  }
925
951
  return decision;
926
952
  };
@@ -1012,6 +1038,7 @@ var decidePreToolUse = async (input) => {
1012
1038
  const preToolUse = {
1013
1039
  rejoinable: rejoinableCodexCall(callFingerprint, toolPolicy, scope)
1014
1040
  };
1041
+ const slotWait = slotWaitFor({ startMs: START_MS2, waitSeconds, agent: "codex", silenceApproves: approvesWhenUnanswered(toolPolicy) });
1015
1042
  let asked;
1016
1043
  try {
1017
1044
  asked = await askWatchingForARule({
@@ -1019,13 +1046,13 @@ var decidePreToolUse = async (input) => {
1019
1046
  withdraw: (correlationId) => withdrawQuestion(apiKey, correlationId),
1020
1047
  sleep: sleepUnlessAborted,
1021
1048
  now: Date.now,
1022
- ...ruleWatchFor(apiKey, input, scope, waitSeconds)
1049
+ ...ruleWatchFor(apiKey, input, scope, slotWait)
1023
1050
  });
1024
1051
  } catch (error) {
1025
1052
  if (error instanceof SubscriptionRequiredError) return recordPreToolUse(callKey, codexStepsAside(error, input));
1026
1053
  return recordPreToolUse(callKey, codexDeny(UNVERIFIABLE_APPROVAL_REASON));
1027
1054
  }
1028
- if (asked.kind === "covered_by_rule") return await passedByRule(input, callFingerprint);
1055
+ if (asked.kind === "covered_by_rule") return await passedByARuleWhileHeld(input, lookup, asked.verdict, callFingerprint);
1029
1056
  if (asked.kind === "refused_by_rule") return await refusedByRule(input, lookup, asked.verdict, callFingerprint);
1030
1057
  if (asked.kind === "no_free_slot") {
1031
1058
  return reportIfRefused(apiKey, input, lookup, deliveryMode, "no_free_slot", recordPreToolUse(callKey, unansweredOutcome(scope, codexQuestionLimitDecision({ refusesUnanswered: refusesWhenUnanswered(delivery.policy), agentPromptFollows: AGENT_PROMPT_FOLLOWS_A_PRE_TOOL_USE_REFUSAL }))));
@@ -1053,7 +1080,7 @@ var decidePreToolUse = async (input) => {
1053
1080
  };
1054
1081
  var repairCodexHoldsQuietly = async () => {
1055
1082
  try {
1056
- const { repairCodexHolds } = await import("../reapply-TXX2GU6T.js");
1083
+ const { repairCodexHolds } = await import("../reapply-APVASEGC.js");
1057
1084
  repairCodexHolds();
1058
1085
  } catch {
1059
1086
  return;
@@ -8,8 +8,8 @@ import "../chunk-MLKGABMK.js";
8
8
  var args = process.argv.slice(2);
9
9
  if (args[0] === "codex") args.shift();
10
10
  var appBehindTheProxy = args[0] === "--desktop-proxy" && args[2] === "--" ? args[1] : void 0;
11
- if (args[0] !== "--desktop-proxy") (await import("../usage-K74RCKF7.js")).exitOnHelpFlag("codex");
12
- var loadWhatReadsTheAccount = () => Promise.all([import("../config-WHD32JOQ.js"), import("../identity-ZFMKTDMM.js")]);
11
+ if (args[0] !== "--desktop-proxy") (await import("../usage-FVDJIMCB.js")).exitOnHelpFlag("codex");
12
+ var loadWhatReadsTheAccount = () => Promise.all([import("../config-EVDZ6OAI.js"), import("../identity-A2BK7P2A.js")]);
13
13
  var loadedWhenThePassThroughStarted = appBehindTheProxy === void 0 ? null : loadWhatReadsTheAccount().catch(() => null);
14
14
  var desktopAccount = async () => {
15
15
  try {
@@ -19,7 +19,7 @@ var desktopAccount = async () => {
19
19
  return null;
20
20
  }
21
21
  };
22
- var desktopLaunch = await import("../codex-desktop-launch-QS7RJIWL.js").catch(() => null);
22
+ var desktopLaunch = await import("../codex-desktop-launch-DKOOCOTD.js").catch(() => null);
23
23
  if (desktopLaunch === null && appBehindTheProxy !== void 0) {
24
24
  process.exitCode = await letCodexRunWithoutPushary(appBehindTheProxy, args.slice(3));
25
25
  } else {
@@ -27,15 +27,15 @@ if (desktopLaunch === null && appBehindTheProxy !== void 0) {
27
27
  const stop = () => abort.abort();
28
28
  if (!args[0]?.startsWith("--desktop")) for (const signal of ["SIGINT", "SIGTERM", "SIGHUP"]) process.on(signal, stop);
29
29
  try {
30
- const { codexDesktopCommand } = desktopLaunch ?? await import("../codex-desktop-launch-QS7RJIWL.js");
30
+ const { codexDesktopCommand } = desktopLaunch ?? await import("../codex-desktop-launch-DKOOCOTD.js");
31
31
  const desktop = await codexDesktopCommand(args, [process.execPath, ...process.execArgv, process.argv[1], "codex"], desktopAccount);
32
32
  if (desktop !== null) process.exitCode = desktop;
33
33
  else {
34
34
  const [{ getApiKey, getBaseUrl }, { getMachineId }, { resolveProviderBinary }, { codexSessionDirectory, launchCodexSession }] = await Promise.all([
35
- import("../config-WHD32JOQ.js"),
36
- import("../identity-ZFMKTDMM.js"),
37
- import("../live-capabilities-A5NUXYA3.js"),
38
- import("../codex-session-launch-IOALOU37.js")
35
+ import("../config-EVDZ6OAI.js"),
36
+ import("../identity-A2BK7P2A.js"),
37
+ import("../live-capabilities-43YRGYAR.js"),
38
+ import("../codex-session-launch-UHNV5Z3D.js")
39
39
  ]);
40
40
  const binary = resolveProviderBinary("codex");
41
41
  if (!binary) throw new Error("Install Codex first, then run pushary codex");
@@ -1,39 +1,39 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  reportEvent
4
- } from "../chunk-V25PSICC.js";
5
- import "../chunk-EMGKV2QC.js";
4
+ } from "../chunk-PUVD22DY.js";
5
+ import "../chunk-3ULFLONL.js";
6
6
  import {
7
7
  askUser,
8
8
  isDecisionStopped,
9
9
  waitForAnswer
10
- } from "../chunk-A4CQJZ3K.js";
11
- import "../chunk-KKUUJQ7D.js";
10
+ } from "../chunk-OTJEIINV.js";
11
+ import "../chunk-5IPXL33D.js";
12
12
  import "../chunk-POFBE6ZY.js";
13
- import "../chunk-ZXAWHBFW.js";
14
- import "../chunk-TXVRUVBB.js";
13
+ import "../chunk-H6CBRJKT.js";
14
+ import "../chunk-VEE2MRUN.js";
15
15
  import {
16
16
  projectNameFor
17
- } from "../chunk-7OQZ5GL7.js";
18
- import "../chunk-FVQASC2C.js";
19
- import "../chunk-KTKM7HS5.js";
17
+ } from "../chunk-VH5DPURH.js";
18
+ import "../chunk-3APYAOZF.js";
19
+ import "../chunk-T4GV5MOC.js";
20
20
  import {
21
21
  getMachineId
22
- } from "../chunk-5JRRWACR.js";
23
- import "../chunk-RS7CW5W7.js";
24
- import "../chunk-6TVDGTWR.js";
25
- import "../chunk-I7GUIT7E.js";
22
+ } from "../chunk-XSJON4TV.js";
23
+ import "../chunk-DP6YHOKF.js";
24
+ import "../chunk-2HOKEC2I.js";
25
+ import "../chunk-EBIPQ3ZE.js";
26
26
  import {
27
27
  getApiKey
28
- } from "../chunk-3MKRWTLZ.js";
28
+ } from "../chunk-Y2H5TF7T.js";
29
29
  import "../chunk-CINBAX5G.js";
30
30
  import "../chunk-PM2NRK6Y.js";
31
31
  import "../chunk-BG4HHB7E.js";
32
32
  import {
33
33
  NPX_LATEST_COMMAND
34
- } from "../chunk-GL4EIL5Q.js";
34
+ } from "../chunk-GAAPUS5J.js";
35
35
  import "../chunk-UQTQ6HPO.js";
36
- import "../chunk-X55NVFKJ.js";
36
+ import "../chunk-HMMVGDL3.js";
37
37
  import "../chunk-MLKGABMK.js";
38
38
 
39
39
  // bin/pushary-codex.ts
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  pairingComputerOf,
4
4
  planPairCommand
5
- } from "../chunk-W2WM5IXQ.js";
5
+ } from "../chunk-UVNH4UGJ.js";
6
6
  import {
7
7
  canShowPairingQr,
8
8
  checkPhoneWithoutPairing,
@@ -12,65 +12,65 @@ import {
12
12
  pairAppWithThisComputer,
13
13
  pairingAgainHelps,
14
14
  printConnectInstructions
15
- } from "../chunk-EBSFVPHH.js";
15
+ } from "../chunk-XMNETXQ4.js";
16
16
  import "../chunk-3EGEA4KH.js";
17
- import "../chunk-DDNFI2GA.js";
17
+ import "../chunk-GR46QR45.js";
18
18
  import {
19
19
  printKeyCheck
20
- } from "../chunk-GP377Y34.js";
21
- import "../chunk-4WJDKZEJ.js";
20
+ } from "../chunk-EJ56NJQ4.js";
21
+ import "../chunk-C2B4LPJU.js";
22
22
  import {
23
23
  detectedAgentChoices
24
- } from "../chunk-ERI4ISGN.js";
24
+ } from "../chunk-YMULPOSH.js";
25
25
  import "../chunk-OYIN77HO.js";
26
26
  import {
27
27
  CONNECTED_THROUGH_MAC_APP,
28
28
  PAIR_FROM_MAC_APP,
29
29
  readMacAppConnection
30
- } from "../chunk-6WLQ7WOD.js";
30
+ } from "../chunk-FZWUUGC2.js";
31
31
  import "../chunk-QCGNGEGE.js";
32
- import "../chunk-2DNN7O7B.js";
33
- import "../chunk-CL7QR6FW.js";
34
- import "../chunk-W522XWAT.js";
35
- import "../chunk-63HIRFYV.js";
36
- import "../chunk-CEWERXV4.js";
32
+ import "../chunk-KERLAXHG.js";
33
+ import "../chunk-DHD54IIT.js";
34
+ import "../chunk-4TIZJD3Q.js";
35
+ import "../chunk-WNCTMTMG.js";
36
+ import "../chunk-6CJSVFAD.js";
37
37
  import {
38
38
  ciMarker,
39
39
  createIo,
40
40
  describeCiReason
41
- } from "../chunk-DGG75PIW.js";
41
+ } from "../chunk-5QP7DVQF.js";
42
42
  import {
43
43
  exitOnHelpFlag
44
- } from "../chunk-OY5W64TR.js";
44
+ } from "../chunk-AQLIBG2P.js";
45
45
  import "../chunk-TCE3J44Z.js";
46
- import "../chunk-PZBVUHRD.js";
47
- import "../chunk-EQGQPDCH.js";
48
- import "../chunk-V25PSICC.js";
49
- import "../chunk-EMGKV2QC.js";
50
- import "../chunk-NITOSXEV.js";
51
- import "../chunk-LWWUA5DF.js";
46
+ import "../chunk-ZCR5VTOC.js";
47
+ import "../chunk-DQI4647T.js";
48
+ import "../chunk-PUVD22DY.js";
49
+ import "../chunk-3ULFLONL.js";
50
+ import "../chunk-EJJBM4OB.js";
51
+ import "../chunk-ITPAUHJ4.js";
52
52
  import {
53
53
  parseFlags
54
54
  } from "../chunk-BZIBNSQE.js";
55
55
  import "../chunk-VRNGMRJA.js";
56
- import "../chunk-A4CQJZ3K.js";
57
- import "../chunk-KKUUJQ7D.js";
56
+ import "../chunk-OTJEIINV.js";
57
+ import "../chunk-5IPXL33D.js";
58
58
  import "../chunk-POFBE6ZY.js";
59
- import "../chunk-ZXAWHBFW.js";
60
- import "../chunk-TXVRUVBB.js";
61
- import "../chunk-7OQZ5GL7.js";
59
+ import "../chunk-H6CBRJKT.js";
60
+ import "../chunk-VEE2MRUN.js";
61
+ import "../chunk-VH5DPURH.js";
62
62
  import {
63
63
  checkApiKey
64
- } from "../chunk-FVQASC2C.js";
65
- import "../chunk-KTKM7HS5.js";
66
- import "../chunk-5JRRWACR.js";
64
+ } from "../chunk-3APYAOZF.js";
65
+ import "../chunk-T4GV5MOC.js";
66
+ import "../chunk-XSJON4TV.js";
67
67
  import {
68
68
  readKeySource
69
- } from "../chunk-S67UAFW2.js";
70
- import "../chunk-RS7CW5W7.js";
71
- import "../chunk-6TVDGTWR.js";
72
- import "../chunk-I7GUIT7E.js";
73
- import "../chunk-3MKRWTLZ.js";
69
+ } from "../chunk-FY7WHRDJ.js";
70
+ import "../chunk-DP6YHOKF.js";
71
+ import "../chunk-2HOKEC2I.js";
72
+ import "../chunk-EBIPQ3ZE.js";
73
+ import "../chunk-Y2H5TF7T.js";
74
74
  import {
75
75
  UsageError
76
76
  } from "../chunk-CINBAX5G.js";
@@ -80,9 +80,9 @@ import {
80
80
  } from "../chunk-BG4HHB7E.js";
81
81
  import {
82
82
  isInvocationOf
83
- } from "../chunk-GL4EIL5Q.js";
83
+ } from "../chunk-GAAPUS5J.js";
84
84
  import "../chunk-UQTQ6HPO.js";
85
- import "../chunk-X55NVFKJ.js";
85
+ import "../chunk-HMMVGDL3.js";
86
86
  import "../chunk-MLKGABMK.js";
87
87
 
88
88
  // bin/pushary-connect.ts
@@ -2,15 +2,15 @@
2
2
  import {
3
3
  coworkOutput,
4
4
  parseCoworkOptions
5
- } from "../chunk-STJYAFMW.js";
5
+ } from "../chunk-VDJMYP54.js";
6
6
  import {
7
7
  canOpenBrowser,
8
8
  openInBrowser
9
9
  } from "../chunk-PUZZELE6.js";
10
10
  import {
11
11
  exitOnHelpFlag
12
- } from "../chunk-OY5W64TR.js";
13
- import "../chunk-NITOSXEV.js";
12
+ } from "../chunk-AQLIBG2P.js";
13
+ import "../chunk-EJJBM4OB.js";
14
14
  import "../chunk-BZIBNSQE.js";
15
15
  import {
16
16
  UsageError
@@ -18,11 +18,11 @@ import {
18
18
  import {
19
19
  EXIT
20
20
  } from "../chunk-BG4HHB7E.js";
21
- import "../chunk-GL4EIL5Q.js";
21
+ import "../chunk-GAAPUS5J.js";
22
22
  import "../chunk-UQTQ6HPO.js";
23
23
  import {
24
24
  CLAUDE_CONNECTOR_GUIDE
25
- } from "../chunk-X55NVFKJ.js";
25
+ } from "../chunk-HMMVGDL3.js";
26
26
  import "../chunk-MLKGABMK.js";
27
27
 
28
28
  // bin/pushary-cowork.ts