pushary 1.9.177 → 1.9.179

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 (143) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/{api-MOK62OPO.js → api-YH7WN4FA.js} +21 -11
  3. package/dist/bin/pushary-audit.js +3 -3
  4. package/dist/bin/pushary-bell-hook.js +28 -28
  5. package/dist/bin/pushary-bell.js +12 -12
  6. package/dist/bin/pushary-calls.js +15 -15
  7. package/dist/bin/pushary-claude.js +27 -27
  8. package/dist/bin/pushary-clean.js +38 -38
  9. package/dist/bin/pushary-codex-bridge.js +23 -23
  10. package/dist/bin/pushary-codex-hook.js +108 -54
  11. package/dist/bin/pushary-codex-session.js +8 -8
  12. package/dist/bin/pushary-codex.js +16 -16
  13. package/dist/bin/pushary-connect.js +34 -34
  14. package/dist/bin/pushary-cowork.js +5 -5
  15. package/dist/bin/pushary-daemon.js +102 -78
  16. package/dist/bin/pushary-disconnect.js +29 -29
  17. package/dist/bin/pushary-display-hook.js +22 -1
  18. package/dist/bin/pushary-doctor.js +62 -48
  19. package/dist/bin/pushary-elicitation-hook.js +28 -28
  20. package/dist/bin/pushary-gemini-bridge.js +20 -33
  21. package/dist/bin/pushary-gemini-hook.js +32 -32
  22. package/dist/bin/pushary-hook.js +36 -36
  23. package/dist/bin/pushary-login.js +22 -22
  24. package/dist/bin/pushary-logout.js +29 -29
  25. package/dist/bin/pushary-mcp.js +12 -12
  26. package/dist/bin/pushary-mode.js +16 -16
  27. package/dist/bin/pushary-notification-hook.js +27 -27
  28. package/dist/bin/pushary-opencode-bridge.d.ts +1 -0
  29. package/dist/bin/pushary-opencode-bridge.js +576 -0
  30. package/dist/bin/pushary-opencode-hook.js +33 -33
  31. package/dist/bin/pushary-permission-denied-hook.js +36 -36
  32. package/dist/bin/pushary-permission-hook.js +36 -36
  33. package/dist/bin/pushary-post-hook.js +28 -28
  34. package/dist/bin/pushary-prompt-hook.js +27 -27
  35. package/dist/bin/pushary-session-end-hook.js +27 -27
  36. package/dist/bin/pushary-session-start-hook.js +38 -38
  37. package/dist/bin/pushary-sessions.js +14 -14
  38. package/dist/bin/pushary-setup.js +58 -58
  39. package/dist/bin/pushary-stats.js +5 -5
  40. package/dist/bin/pushary-status.js +35 -35
  41. package/dist/bin/pushary-stop-hook.js +27 -27
  42. package/dist/bin/pushary-stopfailure-hook.js +27 -27
  43. package/dist/bin/pushary-suggestions.js +16 -16
  44. package/dist/bin/pushary-transcript-register.js +17 -17
  45. package/dist/bin/pushary-transcripts.js +25 -25
  46. package/dist/bin/pushary-upgrade.js +45 -44
  47. package/dist/bin/pushary-wait.js +16 -16
  48. package/dist/bin/pushary.js +7 -7
  49. package/dist/{chunk-2SFXPVAE.js → chunk-2HMDWEER.js} +1 -1
  50. package/dist/{chunk-7ZDL4EOA.js → chunk-2JSTCD7L.js} +2 -2
  51. package/dist/{chunk-GOL7TCMO.js → chunk-32YARQJC.js} +5 -5
  52. package/dist/{chunk-2HREYLQL.js → chunk-3BZ7IGGW.js} +5 -5
  53. package/dist/{chunk-G2RTHSTU.js → chunk-3JXSIPLF.js} +1 -1
  54. package/dist/{chunk-N7GV4Y5B.js → chunk-3NTAU6DN.js} +2 -2
  55. package/dist/{chunk-BTOP6AHZ.js → chunk-65CSOPQW.js} +12 -25
  56. package/dist/{chunk-MNWUZ4JH.js → chunk-6BIC2SHE.js} +2 -2
  57. package/dist/{chunk-FLEDJCTE.js → chunk-6KF26UUL.js} +3 -3
  58. package/dist/{chunk-6FFXBHVF.js → chunk-6W7Q6VB6.js} +2 -2
  59. package/dist/{chunk-77PUYCLF.js → chunk-7VNTZY7V.js} +90 -21
  60. package/dist/{chunk-A4AG42X2.js → chunk-A7G6CFZU.js} +4 -4
  61. package/dist/{chunk-HCW3KFL3.js → chunk-AXPZZFBW.js} +2 -2
  62. package/dist/{chunk-AH6FRO37.js → chunk-AYMFOYOZ.js} +9 -9
  63. package/dist/{chunk-UC4DTMPM.js → chunk-AYP4GE3X.js} +24 -0
  64. package/dist/{chunk-SOWF5BU3.js → chunk-BKZZSXEQ.js} +4 -4
  65. package/dist/{chunk-2O6TO2YW.js → chunk-BNZYEIBB.js} +18 -18
  66. package/dist/{chunk-UYBCGHGQ.js → chunk-CTJRWP6Y.js} +3 -3
  67. package/dist/{chunk-3HGR5T4W.js → chunk-D7GUUTOT.js} +4 -4
  68. package/dist/{chunk-AIM5GLBI.js → chunk-E25IZ5S3.js} +4 -4
  69. package/dist/{chunk-5SNBTQOU.js → chunk-EEHTVBKI.js} +6 -6
  70. package/dist/{chunk-R2VQ4OKM.js → chunk-FHVGZ6AN.js} +1 -1
  71. package/dist/{chunk-MIHH354F.js → chunk-FWUF33U6.js} +2 -2
  72. package/dist/{chunk-XWG4PSQL.js → chunk-HGP2DDW3.js} +1 -1
  73. package/dist/{chunk-WVU5TTRU.js → chunk-HNQ2FIBA.js} +2 -2
  74. package/dist/{chunk-FUSZOEZK.js → chunk-HOVBZBAJ.js} +4 -4
  75. package/dist/{chunk-5OBLFHMG.js → chunk-I4XCADTT.js} +1 -1
  76. package/dist/{chunk-M7LXGZM6.js → chunk-I6AMLYXS.js} +4 -4
  77. package/dist/{chunk-NNWUE7PY.js → chunk-INUW2CXK.js} +6 -6
  78. package/dist/{chunk-2HK3KVEJ.js → chunk-IV4ZY2DS.js} +5 -5
  79. package/dist/{chunk-OU4FPSNZ.js → chunk-J5PTUQMF.js} +3 -3
  80. package/dist/{chunk-5YUBUJ6F.js → chunk-JDNQC5IG.js} +5 -5
  81. package/dist/{chunk-JH6IUXXS.js → chunk-JMPC7HL6.js} +6 -6
  82. package/dist/{chunk-JLOOLENK.js → chunk-JSSCR6M2.js} +2 -2
  83. package/dist/{chunk-KLPOTV4Q.js → chunk-KFLHGN4D.js} +3 -3
  84. package/dist/{chunk-KSRMVJ2V.js → chunk-KUB4OGLG.js} +5 -5
  85. package/dist/{chunk-3DFKZATL.js → chunk-M2P5KFP5.js} +3 -3
  86. package/dist/{chunk-AUVB3J6X.js → chunk-MIJ2P4FZ.js} +7 -7
  87. package/dist/{chunk-XJJ4KJF5.js → chunk-MKKRQBQF.js} +114 -15
  88. package/dist/{chunk-5F2GVH3H.js → chunk-MM5QO2ZY.js} +1 -1
  89. package/dist/{chunk-LAJ62ADY.js → chunk-MWKKUBHQ.js} +1 -1
  90. package/dist/{chunk-ZHVWYX5I.js → chunk-N24MKYZ2.js} +1 -1
  91. package/dist/{chunk-6HEYIMTE.js → chunk-N2L7E5NE.js} +5 -5
  92. package/dist/{chunk-IIIVVFHC.js → chunk-NEAJLLIG.js} +5 -5
  93. package/dist/{chunk-RQYNZJZ3.js → chunk-NX33EVEP.js} +1 -1
  94. package/dist/{chunk-GCAFTVYG.js → chunk-OD6JNTGZ.js} +2 -2
  95. package/dist/{chunk-QS4IPOAQ.js → chunk-OIFWZESQ.js} +14 -11
  96. package/dist/{chunk-4YBTCIIU.js → chunk-P3MYHWF5.js} +5 -5
  97. package/dist/{chunk-L3R3XAQC.js → chunk-PFH7XMHE.js} +1 -1
  98. package/dist/{chunk-HWBO3QVL.js → chunk-PJHYFHP4.js} +1 -1
  99. package/dist/{chunk-ZRMI7POM.js → chunk-POESL3CD.js} +1 -1
  100. package/dist/{chunk-2MMTYCCV.js → chunk-QMV7WS7D.js} +2 -2
  101. package/dist/{chunk-TIGCU3PF.js → chunk-QYGO5EKA.js} +2 -2
  102. package/dist/{chunk-3CWVK6BS.js → chunk-RM3F4V6A.js} +64 -15
  103. package/dist/{chunk-RSRWMXEM.js → chunk-RM3YENVK.js} +3 -3
  104. package/dist/{chunk-UOM2JOQZ.js → chunk-RVIYAQC7.js} +2 -2
  105. package/dist/{chunk-CUE6IPNE.js → chunk-S7X3PENP.js} +6 -6
  106. package/dist/{chunk-G2T7S5RU.js → chunk-SV6AMA7J.js} +10 -10
  107. package/dist/{chunk-DOCNSQOB.js → chunk-SYIAWMBA.js} +6 -6
  108. package/dist/{chunk-SV7PLR6Z.js → chunk-TVBND3VL.js} +2 -2
  109. package/dist/{chunk-CEMYK6BM.js → chunk-UJUXZCQS.js} +6 -6
  110. package/dist/{chunk-NWO4GVKC.js → chunk-VOWNWXVE.js} +38 -10
  111. package/dist/{chunk-4PRJDA3J.js → chunk-W27VNI6G.js} +1 -1
  112. package/dist/{chunk-IR5B5EQI.js → chunk-WDPIZXCZ.js} +3 -3
  113. package/dist/{chunk-KX2SWWSD.js → chunk-WII73NRE.js} +1 -1
  114. package/dist/{chunk-J3V4CBKZ.js → chunk-WIKPDEOR.js} +29 -8
  115. package/dist/{chunk-FDB2VMJM.js → chunk-WMHXZDUT.js} +2 -2
  116. package/dist/{chunk-NSR3ZTUJ.js → chunk-XJG7YRF7.js} +3 -3
  117. package/dist/{chunk-W7KAVPQP.js → chunk-XOVAERD7.js} +1 -1
  118. package/dist/{chunk-EXK47DWS.js → chunk-XQGU77H7.js} +4 -4
  119. package/dist/{chunk-DN5FNT3O.js → chunk-XWWD2KTY.js} +22 -1
  120. package/dist/{chunk-LGKFRWQL.js → chunk-Y5BRXPL6.js} +1 -1
  121. package/dist/{chunk-QBIALYLY.js → chunk-YRGDHBS5.js} +4 -4
  122. package/dist/{chunk-EHFUVDRM.js → chunk-YXLJTIGG.js} +4 -4
  123. package/dist/{chunk-MIRXACOR.js → chunk-Z2DAWG5U.js} +6 -1
  124. package/dist/{chunk-QES7CGHR.js → chunk-ZMJKA7CF.js} +5 -5
  125. package/dist/{chunk-VOPORKYP.js → chunk-ZMSQQVVY.js} +1 -1
  126. package/dist/{chunk-LEWVT2A2.js → chunk-ZNCRZNLJ.js} +1 -1
  127. package/dist/{chunk-JWMS3WIN.js → chunk-ZPHPNTGW.js} +1 -1
  128. package/dist/{chunk-L7MROSFJ.js → chunk-ZTNGM6NU.js} +3 -3
  129. package/dist/{codex-app-cards-switch-VUX7FUBE.js → codex-app-cards-switch-RDVTCDVO.js} +11 -11
  130. package/dist/{codex-card-routing-F6PBOHKA.js → codex-card-routing-XUYIRUB7.js} +2 -2
  131. package/dist/{codex-desktop-launch-DHE24VP2.js → codex-desktop-launch-EX3E3T3Q.js} +1 -1
  132. package/dist/{codex-session-launch-5QMO4UNL.js → codex-session-launch-TDEWJ3G6.js} +20 -20
  133. package/dist/{config-VEUG5WVO.js → config-XDZZTOHU.js} +3 -3
  134. package/dist/{global-upgrade-TE6N2LPD.js → global-upgrade-QVFP4F7D.js} +9 -9
  135. package/dist/{identity-RUUBB2GE.js → identity-Q5HWBCJY.js} +4 -4
  136. package/dist/{live-capabilities-CATPYBSX.js → live-capabilities-G5FB5VBL.js} +28 -4
  137. package/dist/{paths-LE4WLG45.js → paths-IVCUVJM6.js} +3 -3
  138. package/dist/{reapply-4BTKZGKT.js → reapply-MQTAPBPH.js} +31 -31
  139. package/dist/src/index.d.ts +2 -0
  140. package/dist/src/index.js +35 -35
  141. package/dist/{upgrade-lock-HU2F5X57.js → upgrade-lock-Y56NERM5.js} +4 -4
  142. package/dist/{usage-UMIDTEI3.js → usage-J7O2QQEQ.js} +3 -3
  143. package/package.json +2 -1
@@ -1,20 +1,20 @@
1
1
  import {
2
2
  fetchAsCredential
3
- } from "./chunk-HWBO3QVL.js";
3
+ } from "./chunk-PJHYFHP4.js";
4
4
  import {
5
5
  keyCheckFromResponse
6
- } from "./chunk-IR5B5EQI.js";
6
+ } from "./chunk-WDPIZXCZ.js";
7
7
  import {
8
8
  installNetworkDefaults
9
- } from "./chunk-NSR3ZTUJ.js";
9
+ } from "./chunk-XJG7YRF7.js";
10
10
  import {
11
11
  getBaseUrl
12
- } from "./chunk-JWMS3WIN.js";
12
+ } from "./chunk-ZPHPNTGW.js";
13
13
  import {
14
14
  isRecord,
15
15
  isToolErrorResult,
16
16
  toolFailureCodeOfResult
17
- } from "./chunk-UC4DTMPM.js";
17
+ } from "./chunk-AYP4GE3X.js";
18
18
 
19
19
  // src/retry.ts
20
20
  var isRetryable = (err) => {
@@ -3,24 +3,24 @@ import {
3
3
  expectedLaunchCapabilities,
4
4
  hasSpawnProvider,
5
5
  resolveControlPolicy
6
- } from "./chunk-XJJ4KJF5.js";
6
+ } from "./chunk-MKKRQBQF.js";
7
7
  import {
8
8
  daemonHasRemoteProof,
9
9
  daemonServiceManagerAvailable,
10
10
  hasDaemonServiceDefinition,
11
11
  readDaemonNeedsLogin,
12
12
  readDaemonStatus
13
- } from "./chunk-5SNBTQOU.js";
13
+ } from "./chunk-EEHTVBKI.js";
14
14
  import {
15
15
  getMachineId
16
- } from "./chunk-L3R3XAQC.js";
16
+ } from "./chunk-PFH7XMHE.js";
17
17
  import {
18
18
  readControlMode,
19
19
  readKeySource
20
- } from "./chunk-L7MROSFJ.js";
20
+ } from "./chunk-ZTNGM6NU.js";
21
21
  import {
22
22
  getBaseUrl
23
- } from "./chunk-JWMS3WIN.js";
23
+ } from "./chunk-ZPHPNTGW.js";
24
24
  import {
25
25
  getPackageVersion
26
26
  } from "./chunk-UQTQ6HPO.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  readTranscriptPreference
3
- } from "./chunk-L7MROSFJ.js";
3
+ } from "./chunk-ZTNGM6NU.js";
4
4
 
5
5
  // src/transcript-setting.ts
6
6
  var transcriptEnvironmentPreference = () => {
@@ -3,7 +3,7 @@ import {
3
3
  formatVersion,
4
4
  quoteIfNeeded,
5
5
  shellDoubleQuoted
6
- } from "./chunk-SOWF5BU3.js";
6
+ } from "./chunk-BKZZSXEQ.js";
7
7
  import {
8
8
  writeFileAtomic
9
9
  } from "./chunk-PM2NRK6Y.js";
@@ -22,7 +22,7 @@ import {
22
22
  PUSHARY_HOSTS,
23
23
  PUSHARY_TOOL_PREFIX,
24
24
  withHookHoldBudget
25
- } from "./chunk-UC4DTMPM.js";
25
+ } from "./chunk-AYP4GE3X.js";
26
26
 
27
27
  // src/setup/paths.ts
28
28
  import { createHash as createHash2 } from "crypto";
@@ -1,20 +1,22 @@
1
1
  import {
2
+ BRIDGE_FAILURE_MESSAGE_MAX,
2
3
  LiveTranscriptRelay,
4
+ acknowledgeSpawnFailure,
3
5
  liveSessionSleep,
4
6
  postLiveSession,
5
7
  postLiveSessionUntilAccepted,
6
8
  startLiveSessionHeartbeat
7
- } from "./chunk-DN5FNT3O.js";
9
+ } from "./chunk-XWWD2KTY.js";
8
10
  import {
9
11
  CommandReceipts,
10
12
  controllerCommandSchema
11
- } from "./chunk-XWG4PSQL.js";
13
+ } from "./chunk-HGP2DDW3.js";
12
14
  import {
13
15
  SESSION_IDLE_TIMEOUT_MS,
14
16
  describeIdleWindow,
15
17
  idleDeadlinePassed,
16
18
  startProcessOwnership
17
- } from "./chunk-6FFXBHVF.js";
19
+ } from "./chunk-6W7Q6VB6.js";
18
20
  import {
19
21
  spawnClaude
20
22
  } from "./chunk-VRNGMRJA.js";
@@ -24,18 +26,18 @@ import {
24
26
  isWaitForAnswerResponse,
25
27
  withdrawQuestion,
26
28
  writeDegraded
27
- } from "./chunk-3CWVK6BS.js";
29
+ } from "./chunk-RM3F4V6A.js";
28
30
  import {
29
31
  readCommandAck
30
- } from "./chunk-W7KAVPQP.js";
32
+ } from "./chunk-XOVAERD7.js";
31
33
  import {
32
34
  callMcpTool,
33
35
  isRetryable
34
- } from "./chunk-GOL7TCMO.js";
36
+ } from "./chunk-32YARQJC.js";
35
37
  import {
36
38
  projectNameFor,
37
39
  repositoryScopeFor
38
- } from "./chunk-LGKFRWQL.js";
40
+ } from "./chunk-Y5BRXPL6.js";
39
41
  import {
40
42
  AGENT_QUESTION_DESCRIPTION_MAX,
41
43
  AGENT_QUESTION_HEADER_MAX,
@@ -56,7 +58,7 @@ import {
56
58
  parseCodexQuestions,
57
59
  planElicitationAsk,
58
60
  readElicitationFields
59
- } from "./chunk-UC4DTMPM.js";
61
+ } from "./chunk-AYP4GE3X.js";
60
62
 
61
63
  // src/codex-question-owner.ts
62
64
  import { createHash } from "crypto";
@@ -338,7 +340,6 @@ var codexElicitationContent = (plan, answers) => {
338
340
  import { spawn } from "child_process";
339
341
  var MAX_RPC_LINE = 1024 * 1024;
340
342
  var STDERR_TAIL_LIMIT = 2e3;
341
- var FAILURE_MESSAGE_MAX = 240;
342
343
  var MAX_PENDING_RPC = 8;
343
344
  var QUESTION_UNAVAILABLE = "Question unavailable";
344
345
  var LOCAL_QUESTION_UNAVAILABLE = "Pushary handed this question to the current client, but this Codex bridge has no local question UI. Continue in an interactive Codex session, or choose a Pushary mode that permits remote questions.";
@@ -841,27 +842,13 @@ var runCodexBridge = async (options) => {
841
842
  } catch (error) {
842
843
  const message = error instanceof Error ? error.message : String(error);
843
844
  if (!linked && options.claimId) {
844
- for (let attempt = 0; attempt < 3; attempt++) {
845
- const acknowledged = await postLiveSession(options, "/api/agent/spawn/ack", {
846
- spawnId: options.spawnId,
847
- claimId: options.claimId,
848
- machineId: options.machineId,
849
- state: "failed",
850
- failure: {
851
- code: "bridge_failed",
852
- message: message.slice(0, FAILURE_MESSAGE_MAX),
853
- retryable: false
854
- }
855
- }).catch(() => null);
856
- if (acknowledged?.ok) break;
857
- await liveSessionSleep(200 * (attempt + 1), options.signal);
858
- }
845
+ await acknowledgeSpawnFailure(options, { spawnId: options.spawnId, claimId: options.claimId }, message);
859
846
  }
860
847
  if (options.signal.aborted) {
861
848
  await report("session_closed", "Session stopped").catch(() => null);
862
849
  return "stopped";
863
850
  }
864
- await report("error", `Live bridge failed: ${message}`.slice(0, FAILURE_MESSAGE_MAX)).catch(() => null);
851
+ await report("error", `Live bridge failed: ${message}`.slice(0, BRIDGE_FAILURE_MESSAGE_MAX)).catch(() => null);
865
852
  return "failed";
866
853
  } finally {
867
854
  stopHeartbeat();
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  projectNameFor
3
- } from "./chunk-LGKFRWQL.js";
3
+ } from "./chunk-Y5BRXPL6.js";
4
4
  import {
5
5
  readConfigFileKey
6
- } from "./chunk-L7MROSFJ.js";
6
+ } from "./chunk-ZTNGM6NU.js";
7
7
 
8
8
  // src/bell/fleet.ts
9
9
  import { closeSync, constants, futimesSync, lstatSync, mkdirSync, openSync, readdirSync, unlinkSync } from "fs";
@@ -5,13 +5,13 @@ import {
5
5
  OPENCLAW_ENVIRONMENT_KEYS,
6
6
  openClawEnvironmentOf,
7
7
  openClawPathsFrom
8
- } from "./chunk-N7GV4Y5B.js";
8
+ } from "./chunk-3NTAU6DN.js";
9
9
  import {
10
10
  resolvePathBinary
11
- } from "./chunk-SOWF5BU3.js";
11
+ } from "./chunk-BKZZSXEQ.js";
12
12
  import {
13
13
  isRecord
14
- } from "./chunk-UC4DTMPM.js";
14
+ } from "./chunk-AYP4GE3X.js";
15
15
 
16
16
  // src/openclaw/wiring-state.ts
17
17
  var OPENCLAW_PLUGIN_ID = "pushary";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  pusharyDir
3
- } from "./chunk-N7GV4Y5B.js";
3
+ } from "./chunk-3NTAU6DN.js";
4
4
  import {
5
5
  readJsonSafe
6
6
  } from "./chunk-PM2NRK6Y.js";
7
7
  import {
8
8
  isRecord
9
- } from "./chunk-UC4DTMPM.js";
9
+ } from "./chunk-AYP4GE3X.js";
10
10
 
11
11
  // src/process-ownership.ts
12
12
  import { createHash, randomUUID } from "crypto";
@@ -27,7 +27,7 @@ import {
27
27
  toolResultErrorText,
28
28
  transcriptTokensIn,
29
29
  transcriptUsageRequest
30
- } from "./chunk-MIRXACOR.js";
30
+ } from "./chunk-Z2DAWG5U.js";
31
31
  import {
32
32
  cancelQuestion,
33
33
  clientErrorKindOf,
@@ -35,44 +35,44 @@ import {
35
35
  reportClientError,
36
36
  sendNotification,
37
37
  waitForAnswer
38
- } from "./chunk-3CWVK6BS.js";
38
+ } from "./chunk-RM3F4V6A.js";
39
39
  import {
40
40
  RETRY_ACK,
41
41
  readCommandAck,
42
42
  refusedReceiptMessage
43
- } from "./chunk-W7KAVPQP.js";
43
+ } from "./chunk-XOVAERD7.js";
44
44
  import {
45
45
  isRetryable,
46
46
  withRetry
47
- } from "./chunk-GOL7TCMO.js";
47
+ } from "./chunk-32YARQJC.js";
48
48
  import {
49
49
  fetchAsCredential
50
- } from "./chunk-HWBO3QVL.js";
50
+ } from "./chunk-PJHYFHP4.js";
51
51
  import {
52
52
  branchFor,
53
53
  projectNameFor,
54
54
  repoKeyFor
55
- } from "./chunk-LGKFRWQL.js";
55
+ } from "./chunk-Y5BRXPL6.js";
56
56
  import {
57
57
  getMachineId
58
- } from "./chunk-L3R3XAQC.js";
58
+ } from "./chunk-PFH7XMHE.js";
59
59
  import {
60
60
  reportedInstallSource
61
- } from "./chunk-WVU5TTRU.js";
61
+ } from "./chunk-HNQ2FIBA.js";
62
62
  import {
63
63
  IDLE_PROMPT_NOTIFICATION,
64
64
  NOTIFICATION_PUSH_TYPES,
65
65
  POSTTOOLUSE_MIRROR_ONLY_TOOLS,
66
66
  claudeConfigDir
67
- } from "./chunk-N7GV4Y5B.js";
67
+ } from "./chunk-3NTAU6DN.js";
68
68
  import {
69
69
  compareVersion,
70
70
  parseVersion
71
- } from "./chunk-SOWF5BU3.js";
71
+ } from "./chunk-BKZZSXEQ.js";
72
72
  import {
73
73
  getApiKey,
74
74
  getBaseUrl
75
- } from "./chunk-JWMS3WIN.js";
75
+ } from "./chunk-ZPHPNTGW.js";
76
76
  import {
77
77
  writeFileAtomic,
78
78
  writeJsonAtomicDurable
@@ -103,7 +103,7 @@ import {
103
103
  resolveAutoResolveOrigin,
104
104
  resolvePolicy,
105
105
  unansweredRefusalReason
106
- } from "./chunk-UC4DTMPM.js";
106
+ } from "./chunk-AYP4GE3X.js";
107
107
 
108
108
  // src/pending.ts
109
109
  import { join } from "path";
@@ -111,11 +111,14 @@ import { homedir, tmpdir } from "os";
111
111
  import { createHash } from "crypto";
112
112
  import { openSync, closeSync, fsyncSync, lstatSync, existsSync, mkdirSync, writeFileSync, readFileSync, readdirSync, unlinkSync, rmSync, statSync } from "fs";
113
113
  var PENDING_DIR = join(tmpdir(), "pushary-pending");
114
+ var LEFT_OPEN_DIR = join(tmpdir(), "pushary-left-open");
114
115
  var commandRoot = () => process.env.PUSHARY_COMMAND_DIR?.trim() || join(homedir(), ".pushary", "run", "commands");
115
116
  var DEFAULT_SESSION = "_no_session";
116
117
  var GRACE_MS = 10 * 60 * 1e3;
117
118
  var sanitize = (sessionId) => sessionId.replace(/[^A-Za-z0-9_-]/g, "_").slice(0, 128) || DEFAULT_SESSION;
118
119
  var dirFor = (sessionId) => join(PENDING_DIR, sanitize(sessionId));
120
+ var leftOpenDirFor = (sessionId) => join(LEFT_OPEN_DIR, sanitize(sessionId));
121
+ var isMarkerName = (correlationId) => correlationId.length > 0 && sanitize(correlationId) === correlationId;
119
122
  var commandDirFor = (sessionId, namespace = "") => join(
120
123
  commandRoot(),
121
124
  createHash("sha256").update(namespace).digest("hex").slice(0, 16),
@@ -317,17 +320,54 @@ var listPendingQuestions = (sessionId) => {
317
320
  }
318
321
  });
319
322
  };
323
+ var saveLeftOpenQuestion = (sessionId, correlationId, callFingerprint) => {
324
+ if (!isMarkerName(correlationId)) return false;
325
+ try {
326
+ mkdirSync(leftOpenDirFor(sessionId), { recursive: true });
327
+ writeFileSync(join(leftOpenDirFor(sessionId), correlationId), callFingerprint, "utf-8");
328
+ return true;
329
+ } catch {
330
+ return false;
331
+ }
332
+ };
333
+ var listLeftOpenQuestions = (sessionId) => {
334
+ try {
335
+ return readdirSync(leftOpenDirFor(sessionId)).filter(isMarkerName);
336
+ } catch {
337
+ return [];
338
+ }
339
+ };
340
+ var leftOpenBy = (sessionId, callFingerprint) => (correlationId) => {
341
+ try {
342
+ return readFileSync(join(leftOpenDirFor(sessionId), correlationId), "utf-8") === callFingerprint;
343
+ } catch {
344
+ return false;
345
+ }
346
+ };
347
+ var listLeftOpenQuestionsOfCall = (sessionId, callFingerprint) => listLeftOpenQuestions(sessionId).filter(leftOpenBy(sessionId, callFingerprint));
348
+ var removeLeftOpenQuestion = (sessionId, correlationId) => {
349
+ if (!isMarkerName(correlationId)) return;
350
+ try {
351
+ unlinkSync(join(leftOpenDirFor(sessionId), correlationId));
352
+ } catch {
353
+ }
354
+ };
320
355
  var removePendingQuestion = (sessionId, correlationId) => {
321
356
  try {
322
357
  unlinkSync(join(dirFor(sessionId), correlationId));
323
358
  } catch {
324
359
  }
360
+ removeLeftOpenQuestion(sessionId, correlationId);
325
361
  };
326
362
  var removePendingSession = (sessionId) => {
327
363
  try {
328
364
  rmSync(dirFor(sessionId), { recursive: true, force: true });
329
365
  } catch {
330
366
  }
367
+ try {
368
+ rmSync(leftOpenDirFor(sessionId), { recursive: true, force: true });
369
+ } catch {
370
+ }
331
371
  };
332
372
 
333
373
  // src/hook-command-delivery.ts
@@ -746,6 +786,7 @@ import { resolve } from "path";
746
786
  var CODEX_AGENT = { type: "codex", label: "Codex" };
747
787
  var codexAllow = () => ({ kind: "allow" });
748
788
  var codexDeny = (reason) => ({ kind: "deny", reason });
789
+ var WAITING_ON_PHONE_REASON = "Waiting for the person to approve this on their phone, so it did not run. Run the same call again to keep waiting. It runs once they approve";
749
790
  var codexPass = () => ({ kind: "pass" });
750
791
  var toCodexWire = (event, decision) => {
751
792
  if (decision.kind === "pass") return null;
@@ -1273,21 +1314,37 @@ var pendingQuestionsToSettle = (sessionId, toolUseId, insideSubagent = false) =>
1273
1314
  if (insideSubagent) return settledElsewhere;
1274
1315
  return [.../* @__PURE__ */ new Set([...settledElsewhere, ...listPendingQuestions(sessionId)])];
1275
1316
  };
1276
- var reconcileQuestions = async (sessionId, files, signal) => {
1317
+ var MARKER_ANSWER_HOLD_MS = 1e3;
1318
+ var WITHDRAWN_MARKER = { answered: false, status: "withdrawn" };
1319
+ var answerUnlessWithdrawn = async (apiKey, correlationId, signal) => {
1320
+ const answer = await waitForAnswer(apiKey, correlationId, MARKER_ANSWER_HOLD_MS, signal);
1321
+ if (!answer.answered) await cancelQuestion(apiKey, correlationId, signal);
1322
+ return answer;
1323
+ };
1324
+ var answerAfterWithdrawing = async (apiKey, correlationId, signal) => {
1325
+ const withdrawal = await cancelQuestion(apiKey, correlationId, signal);
1326
+ return withdrawal.cancelled === true ? WITHDRAWN_MARKER : waitForAnswer(apiKey, correlationId, MARKER_ANSWER_HOLD_MS, signal);
1327
+ };
1328
+ var handedOffMarkers = (files) => markersSettledBy(answerUnlessWithdrawn, files);
1329
+ var cancelWithoutReading = async (apiKey, correlationId, signal) => {
1330
+ await cancelQuestion(apiKey, correlationId, signal).catch(() => void 0);
1331
+ return WITHDRAWN_MARKER;
1332
+ };
1333
+ var markersSettledBy = (settle, correlationIds) => correlationIds.map((correlationId) => ({ correlationId, settle }));
1334
+ var reconcileQuestions = async (sessionId, markers, signal) => {
1277
1335
  const late = [];
1278
1336
  try {
1279
- if (files.length === 0) return late;
1337
+ if (markers.length === 0) return late;
1280
1338
  const apiKey = getApiKey();
1281
1339
  if (signal) signal = AbortSignal.any([signal, AbortSignal.timeout(2e3)]);
1282
- for (const correlationId of files) {
1340
+ for (const { correlationId, settle } of markers) {
1283
1341
  if (signal?.aborted) break;
1284
1342
  try {
1285
- const answer = await waitForAnswer(apiKey, correlationId, 1e3, signal);
1343
+ const answer = await settle(apiKey, correlationId, signal);
1286
1344
  if (answer.answered) {
1287
1345
  late.push({ correlationId, value: answer.value });
1288
1346
  continue;
1289
1347
  }
1290
- await cancelQuestion(apiKey, correlationId, signal);
1291
1348
  } catch {
1292
1349
  continue;
1293
1350
  }
@@ -1297,7 +1354,15 @@ var reconcileQuestions = async (sessionId, files, signal) => {
1297
1354
  }
1298
1355
  return late;
1299
1356
  };
1300
- var reconcilePendingQuestions = (sessionId, toolUseId, signal) => reconcileQuestions(sessionId, pendingQuestionsToSettle(sessionId, toolUseId), signal);
1357
+ var leftOpenQuestionIds = (sessionId, which) => which.kind === "of_session" ? listLeftOpenQuestions(sessionId) : listLeftOpenQuestionsOfCall(sessionId, which.callFingerprint);
1358
+ var settlementOfLeftOpen = (which) => which.kind === "of_a_call_that_runs" ? cancelWithoutReading : answerAfterWithdrawing;
1359
+ var withdrawLeftOpenQuestions = async (sessionId, which) => {
1360
+ const markers = markersSettledBy(settlementOfLeftOpen(which), leftOpenQuestionIds(sessionId, which));
1361
+ if (markers.length === 0) return;
1362
+ await reconcileQuestions(sessionId, markers, AbortSignal.timeout(HOOK_BUDGET_MS));
1363
+ };
1364
+ var sessionHasNoQuestionMarkers = (sessionId) => listPendingQuestions(sessionId).length === 0 && listLeftOpenQuestions(sessionId).length === 0;
1365
+ var reconcilePendingQuestions = (sessionId, toolUseId, signal) => reconcileQuestions(sessionId, [...handedOffMarkers(pendingQuestionsToSettle(sessionId, toolUseId)), ...markersSettledBy(answerAfterWithdrawing, listLeftOpenQuestions(sessionId))], signal);
1301
1366
  var describeLateAnswer = (value) => {
1302
1367
  const v = (value ?? "").trim();
1303
1368
  if (v === "yes") return "approved it";
@@ -1557,7 +1622,7 @@ var HOOK_BUDGET_MS = 9e3;
1557
1622
  var DRAINING_REPORT_BUDGET_MS = 8e3;
1558
1623
  var settleQuestionsForToolUse = async (sessionId, toolUseId) => {
1559
1624
  if (!toolUseId) return;
1560
- const late = await reconcileQuestions(sessionId, listPendingQuestionsForToolUse(sessionId, toolUseId));
1625
+ const late = await reconcileQuestions(sessionId, handedOffMarkers(listPendingQuestionsForToolUse(sessionId, toolUseId)));
1561
1626
  for (const answer of late) removePendingQuestion(sessionId, answer.correlationId);
1562
1627
  };
1563
1628
  var ranInsideSubagent = (input) => sessionIdentityOf(input).parentSessionId !== void 0;
@@ -1577,7 +1642,7 @@ var handlePostToolUse = async (input, agent = CLAUDE_CODE_AGENT) => {
1577
1642
  const questionsToSettle = pendingQuestionsToSettle(sessionKey, input.tool_use_id, insideSubagent);
1578
1643
  const [liveMode, late] = await Promise.all([
1579
1644
  fetchModeState(getApiKey(), input.session_id, MODE_REUSE_MS, signal),
1580
- reconcileQuestions(sessionKey, questionsToSettle, signal)
1645
+ reconcileQuestions(sessionKey, handedOffMarkers(questionsToSettle), signal)
1581
1646
  ]);
1582
1647
  let additionalContext;
1583
1648
  if (late.length > 0 && agent.type === CLAUDE_CODE_AGENT.type) {
@@ -1701,7 +1766,7 @@ var handleStop = async (input, agent = CLAUDE_CODE_AGENT) => {
1701
1766
  tasks.push(notifyLateAnswers(getApiKey(), late, `${agent.label} - ${projectName}`, input.session_id, signal));
1702
1767
  for (const l of late) removePendingQuestion(sessionKey, l.correlationId);
1703
1768
  }
1704
- if (!isDefaultSession(sessionKey) && listPendingQuestions(sessionKey).length === 0) removePendingSession(sessionKey);
1769
+ if (!isDefaultSession(sessionKey) && sessionHasNoQuestionMarkers(sessionKey)) removePendingSession(sessionKey);
1705
1770
  const [reported] = await Promise.allSettled(tasks);
1706
1771
  const unusedApproval = !input.stop_hook_active && approvalAwaitingRetry(input.session_id) !== null;
1707
1772
  const instruction = carriesInstruction ? pendingInstructionOf(reported) : void 0;
@@ -1897,6 +1962,8 @@ export {
1897
1962
  markPendingCommandFailed,
1898
1963
  markPendingCommandRefused,
1899
1964
  removePendingCommand,
1965
+ saveLeftOpenQuestion,
1966
+ removeLeftOpenQuestion,
1900
1967
  emitHookOutput,
1901
1968
  PHONE_DRIVER,
1902
1969
  phoneDrivenEnv,
@@ -1913,6 +1980,7 @@ export {
1913
1980
  CODEX_AGENT,
1914
1981
  codexAllow,
1915
1982
  codexDeny,
1983
+ WAITING_ON_PHONE_REASON,
1916
1984
  codexPass,
1917
1985
  toCodexWire,
1918
1986
  describeApplyPatch,
@@ -1932,6 +2000,7 @@ export {
1932
2000
  forgetBlockedActionHint,
1933
2001
  recordGateOutcome,
1934
2002
  readLastPrompt,
2003
+ withdrawLeftOpenQuestions,
1935
2004
  CLAUDE_CODE_AGENT,
1936
2005
  AUTO_DECISION_WINDOW_MS,
1937
2006
  permissionModeOf,
@@ -4,18 +4,18 @@ import {
4
4
  claimThrottle,
5
5
  releaseThrottle,
6
6
  reportEvent
7
- } from "./chunk-77PUYCLF.js";
7
+ } from "./chunk-7VNTZY7V.js";
8
8
  import {
9
9
  deriveToolTarget,
10
10
  permissionDeniedAction
11
- } from "./chunk-MIRXACOR.js";
11
+ } from "./chunk-Z2DAWG5U.js";
12
12
  import {
13
13
  projectNameFor
14
- } from "./chunk-LGKFRWQL.js";
14
+ } from "./chunk-Y5BRXPL6.js";
15
15
  import {
16
16
  machineDecisionFor,
17
17
  wireVerdictFor
18
- } from "./chunk-UC4DTMPM.js";
18
+ } from "./chunk-AYP4GE3X.js";
19
19
 
20
20
  // src/machine-decision-audit.ts
21
21
  var reportMachineDenial = async (input, verdict, agent) => {
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  callDecisionStore,
3
3
  identifyingToolInput
4
- } from "./chunk-77PUYCLF.js";
4
+ } from "./chunk-7VNTZY7V.js";
5
5
  import {
6
6
  canonicalJson
7
- } from "./chunk-N7GV4Y5B.js";
7
+ } from "./chunk-3NTAU6DN.js";
8
8
 
9
9
  // src/phone-approval.ts
10
10
  import { createHash } from "crypto";
@@ -1,33 +1,33 @@
1
1
  import {
2
2
  MANAGED_CLAUDE_SETTINGS_BY_PLATFORM
3
- } from "./chunk-MIHH354F.js";
3
+ } from "./chunk-FWUF33U6.js";
4
4
  import {
5
5
  declinedAgentsFile,
6
6
  readDeclinedAgents
7
- } from "./chunk-FDB2VMJM.js";
7
+ } from "./chunk-WMHXZDUT.js";
8
8
  import {
9
9
  OPENCODE_HOOK_BINARY,
10
10
  openCodeConfigDir,
11
11
  openCodePluginFile
12
- } from "./chunk-DOCNSQOB.js";
12
+ } from "./chunk-SYIAWMBA.js";
13
13
  import {
14
14
  openCodePluginArgv
15
- } from "./chunk-J3V4CBKZ.js";
15
+ } from "./chunk-WIKPDEOR.js";
16
16
  import {
17
17
  liveCursorGateCoverage
18
- } from "./chunk-EXK47DWS.js";
18
+ } from "./chunk-XQGU77H7.js";
19
19
  import {
20
20
  compatibleConfigFile,
21
21
  compatibleHookEvents,
22
22
  grokHome,
23
23
  parseConfigDocument
24
- } from "./chunk-6HEYIMTE.js";
24
+ } from "./chunk-N2L7E5NE.js";
25
25
  import {
26
26
  DEFAULT_HOOKS_KEY_PATH,
27
27
  GEMINI_HOOK_BINARY,
28
28
  GEMINI_HOOK_EVENTS,
29
29
  hooksAt
30
- } from "./chunk-QBIALYLY.js";
30
+ } from "./chunk-YRGDHBS5.js";
31
31
  import {
32
32
  CODEX_EARLIER_APPROVAL_MATCHERS,
33
33
  CODEX_HOOK_BINARY,
@@ -55,7 +55,7 @@ import {
55
55
  parseHookArgv,
56
56
  parseHookCommand,
57
57
  supportedClaudeEvents
58
- } from "./chunk-N7GV4Y5B.js";
58
+ } from "./chunk-3NTAU6DN.js";
59
59
  import {
60
60
  readRegularJsonFile,
61
61
  readRegularTextFile
@@ -69,7 +69,7 @@ import {
69
69
  OPENCODE_APPROVAL_EVENT,
70
70
  isRecord,
71
71
  matcherMatchesEveryCall
72
- } from "./chunk-UC4DTMPM.js";
72
+ } from "./chunk-AYP4GE3X.js";
73
73
 
74
74
  // src/hook-wiring.ts
75
75
  import { createHash } from "crypto";
@@ -225,6 +225,8 @@ var CODEX_BRIDGE_CAPABILITY = "codex-bridge";
225
225
  var CODEX_RESUME_CAPABILITY = "codex-resume";
226
226
  var GEMINI_BRIDGE_CAPABILITY = "gemini-bridge";
227
227
  var GEMINI_RESUME_CAPABILITY = "gemini-resume";
228
+ var OPENCODE_BRIDGE_CAPABILITY = "opencode-bridge";
229
+ var OPENCODE_RESUME_CAPABILITY = "opencode-resume";
228
230
  var SESSION_RUNTIMES = {
229
231
  claude: {
230
232
  provider: "claude",
@@ -249,6 +251,14 @@ var SESSION_RUNTIMES = {
249
251
  bridgeCapability: GEMINI_BRIDGE_CAPABILITY,
250
252
  resumeCapability: GEMINI_RESUME_CAPABILITY,
251
253
  phoneResume: true
254
+ },
255
+ opencode: {
256
+ provider: "opencode",
257
+ label: "OpenCode",
258
+ protocol: "opencode-http",
259
+ bridgeCapability: OPENCODE_BRIDGE_CAPABILITY,
260
+ resumeCapability: OPENCODE_RESUME_CAPABILITY,
261
+ phoneResume: false
252
262
  }
253
263
  };
254
264
  var sessionProvidersAdvertisedBy = (capabilities) => Object.values(SESSION_RUNTIMES).filter((runtime) => capabilities.includes(runtime.bridgeCapability)).map((runtime) => runtime.provider);
@@ -435,6 +445,7 @@ var AGENTS = {
435
445
  policyAgent: "opencode",
436
446
  repoAware: true,
437
447
  disconnectable: true,
448
+ sessionRuntime: SESSION_RUNTIMES.opencode,
438
449
  enforcement: "enforced",
439
450
  connectVia: "Generated plugin + MCP",
440
451
  setupCommand: PUSHARY_SETUP_COMMAND,
@@ -4674,6 +4685,12 @@ var CLAUDE_INBOX_SETTLEMENTS = {
4674
4685
  ["unconfirmed" /* unconfirmed */]: null
4675
4686
  };
4676
4687
 
4688
+ // ../contracts/src/call-rejoin.ts
4689
+ var WAIT_END_PATH = "/api/agent/decision/wait-ended";
4690
+ var WAIT_END_CLOSED = { kind: "closed" };
4691
+ var WAIT_END_OPEN = { kind: "open" };
4692
+ var waitEndAnswered = (value, note) => note === null ? { kind: "answered", value } : { kind: "answered", value, note };
4693
+
4677
4694
  // ../contracts/src/index.ts
4678
4695
  var APPROVAL_MODES = ["push_only", "terminal_only", "push_first", "notify_only"];
4679
4696
  var isApprovalMode = (value) => typeof value === "string" && APPROVAL_MODES.includes(value);
@@ -10339,6 +10356,8 @@ export {
10339
10356
  CODEX_RESUME_CAPABILITY,
10340
10357
  GEMINI_BRIDGE_CAPABILITY,
10341
10358
  GEMINI_RESUME_CAPABILITY,
10359
+ OPENCODE_BRIDGE_CAPABILITY,
10360
+ SESSION_RUNTIMES,
10342
10361
  sessionProvidersAdvertisedBy,
10343
10362
  CLAUDE_CONNECTOR_URL,
10344
10363
  CLAUDE_CONNECTOR_GUIDE,
@@ -10457,6 +10476,10 @@ export {
10457
10476
  parseClaudeInboxClaim,
10458
10477
  CLAUDE_INBOX_RECEIVER,
10459
10478
  CLAUDE_INBOX_SETTLEMENTS,
10479
+ WAIT_END_PATH,
10480
+ WAIT_END_CLOSED,
10481
+ WAIT_END_OPEN,
10482
+ waitEndAnswered,
10460
10483
  isApprovalMode,
10461
10484
  APPROVAL_MODE_META,
10462
10485
  approvalModeWithoutLocalPrompt,
@@ -10552,6 +10575,7 @@ export {
10552
10575
  UNREADABLE_CALL_REASON,
10553
10576
  unapprovedScopeReason,
10554
10577
  codexHasNoPromptOfItsOwn,
10578
+ ruleApprovesAfterItsFullWindow,
10555
10579
  codexUnansweredPreToolUse,
10556
10580
  HANDED_BACK_REASON,
10557
10581
  HAND_BACK_WITHOUT_A_PROMPT,
@@ -14,7 +14,7 @@ import {
14
14
  } from "./chunk-UQTQ6HPO.js";
15
15
  import {
16
16
  redactSecretsFromContent
17
- } from "./chunk-UC4DTMPM.js";
17
+ } from "./chunk-AYP4GE3X.js";
18
18
 
19
19
  // src/shell-quote.ts
20
20
  var shellDoubleQuoted = (text) => `"${text.replace(/(["\\$`])/g, "\\$1")}"`;
@@ -484,9 +484,9 @@ var installGlobally = (options) => {
484
484
  }
485
485
  const started = (async () => {
486
486
  if (!npmIsOnPath()) throw new NpmMissingError();
487
- const { withUpgradeLock } = await import("./global-upgrade-TE6N2LPD.js");
488
- const { installWithUpgradeLock, ownsUpgradeLock } = await import("./upgrade-lock-HU2F5X57.js");
489
- const { autoUpdateLock } = await import("./paths-LE4WLG45.js");
487
+ const { withUpgradeLock } = await import("./global-upgrade-QVFP4F7D.js");
488
+ const { installWithUpgradeLock, ownsUpgradeLock } = await import("./upgrade-lock-Y56NERM5.js");
489
+ const { autoUpdateLock } = await import("./paths-IVCUVJM6.js");
490
490
  let result = "skipped";
491
491
  const install = async () => {
492
492
  const platform = process.platform;