pushary 1.9.111 → 1.9.113

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 (129) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/{api-AESRTYYT.js → api-PCAXOVGM.js} +11 -11
  3. package/dist/bin/pushary-audit.js +3 -3
  4. package/dist/bin/pushary-bell-hook.js +27 -27
  5. package/dist/bin/pushary-bell.js +10 -10
  6. package/dist/bin/pushary-claude.js +25 -25
  7. package/dist/bin/pushary-clean.js +34 -34
  8. package/dist/bin/pushary-codex-bridge.js +21 -21
  9. package/dist/bin/pushary-codex-hook.js +32 -32
  10. package/dist/bin/pushary-codex-session.js +8 -8
  11. package/dist/bin/pushary-codex.js +15 -15
  12. package/dist/bin/pushary-connect.js +28 -28
  13. package/dist/bin/pushary-cowork.js +5 -5
  14. package/dist/bin/pushary-daemon.js +66 -484
  15. package/dist/bin/pushary-disconnect.js +27 -27
  16. package/dist/bin/pushary-display-hook.js +17 -17
  17. package/dist/bin/pushary-doctor.js +42 -42
  18. package/dist/bin/pushary-elicitation-hook.js +27 -27
  19. package/dist/bin/pushary-gemini-bridge.js +15 -15
  20. package/dist/bin/pushary-gemini-hook.js +29 -29
  21. package/dist/bin/pushary-hook.js +32 -32
  22. package/dist/bin/pushary-login.js +21 -21
  23. package/dist/bin/pushary-logout.js +26 -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 +26 -26
  27. package/dist/bin/pushary-opencode-hook.js +28 -28
  28. package/dist/bin/pushary-permission-denied-hook.js +32 -32
  29. package/dist/bin/pushary-permission-hook.js +32 -32
  30. package/dist/bin/pushary-post-hook.js +26 -26
  31. package/dist/bin/pushary-prompt-hook.js +26 -26
  32. package/dist/bin/pushary-session-end-hook.js +26 -26
  33. package/dist/bin/pushary-session-start-hook.js +35 -35
  34. package/dist/bin/pushary-setup.js +61 -47
  35. package/dist/bin/pushary-stats.js +5 -5
  36. package/dist/bin/pushary-status.js +32 -32
  37. package/dist/bin/pushary-stop-hook.js +26 -26
  38. package/dist/bin/pushary-stopfailure-hook.js +26 -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 +40 -40
  43. package/dist/bin/pushary-wait.js +15 -15
  44. package/dist/bin/pushary.js +7 -7
  45. package/dist/{chunk-NUU2JVOG.js → chunk-22OATDEL.js} +3 -3
  46. package/dist/{chunk-YBQF7DCL.js → chunk-233KC6DP.js} +1 -1
  47. package/dist/{chunk-2MOWY5QL.js → chunk-24M7PB2Y.js} +5 -5
  48. package/dist/{chunk-NHDTSA7V.js → chunk-3D2J3T2M.js} +1 -1
  49. package/dist/{chunk-KLCT2YQD.js → chunk-3LJWADU2.js} +6 -6
  50. package/dist/{chunk-SSW4QRGU.js → chunk-3ZU77DJH.js} +6 -6
  51. package/dist/{chunk-RFFIAX33.js → chunk-44HW5T6P.js} +2 -2
  52. package/dist/{chunk-TILEGY4M.js → chunk-44O6GG4I.js} +6 -6
  53. package/dist/{chunk-YNTB3MIQ.js → chunk-4EFZANH3.js} +1 -1
  54. package/dist/{chunk-NVPCETJ3.js → chunk-4I6FWGZ5.js} +1 -1
  55. package/dist/{chunk-O2MZQPP4.js → chunk-53ROMSOB.js} +3 -3
  56. package/dist/{chunk-G42VQNBC.js → chunk-5J2OGCUA.js} +1 -1
  57. package/dist/{chunk-54DPX27B.js → chunk-5SUTYXCT.js} +1 -1
  58. package/dist/{chunk-M73Q37LC.js → chunk-6E2D22Y5.js} +2 -2
  59. package/dist/{chunk-G2TTGQ5A.js → chunk-AR3VX4UQ.js} +10 -10
  60. package/dist/{chunk-5EEW4WIS.js → chunk-B5NKPU2E.js} +5 -5
  61. package/dist/{chunk-DEHWKUKF.js → chunk-BMZFL3HF.js} +4 -4
  62. package/dist/{chunk-VA4OGALQ.js → chunk-BWSXWX6T.js} +2 -2
  63. package/dist/{chunk-YI5I2TF3.js → chunk-BYL7RNOM.js} +3 -3
  64. package/dist/{chunk-XJ4PMNCR.js → chunk-CG5SK6NF.js} +1 -1
  65. package/dist/{chunk-YILMWIZN.js → chunk-D3XNQAQO.js} +2 -2
  66. package/dist/{chunk-BM32JPXJ.js → chunk-DLCECUKY.js} +7 -7
  67. package/dist/{chunk-PTBWLU4G.js → chunk-DSXBMC2N.js} +5 -5
  68. package/dist/{chunk-76ATPJN2.js → chunk-E3A77P52.js} +4 -4
  69. package/dist/{chunk-SDQQ43FT.js → chunk-F5TQ6TCH.js} +1 -1
  70. package/dist/{chunk-WO46WX65.js → chunk-FLRVTAV4.js} +2 -2
  71. package/dist/{chunk-FYVRA5GN.js → chunk-FQSFN5ZE.js} +1 -1
  72. package/dist/{chunk-3AX5BKYN.js → chunk-GBT74TNN.js} +2 -2
  73. package/dist/chunk-GGBGKQIZ.js +454 -0
  74. package/dist/{chunk-YXFLZ2LO.js → chunk-GI3266RE.js} +2 -2
  75. package/dist/{chunk-X5P3IO37.js → chunk-GNP6I5XM.js} +2 -2
  76. package/dist/{chunk-R3KDA7JB.js → chunk-GQFT3QTC.js} +15 -3
  77. package/dist/{chunk-O76PTPKP.js → chunk-GSJUGW3A.js} +1 -1
  78. package/dist/{chunk-OECCPPO6.js → chunk-HJ566HEV.js} +3 -3
  79. package/dist/{chunk-7HDO5W4C.js → chunk-I7HSE5LD.js} +11 -11
  80. package/dist/{chunk-QVGE26SZ.js → chunk-IWUYKDDW.js} +4 -4
  81. package/dist/{chunk-KHWNW4AS.js → chunk-JCHF4VR3.js} +1 -1
  82. package/dist/{chunk-LTVILMEZ.js → chunk-JRW5HK32.js} +2 -2
  83. package/dist/{chunk-KICQRZAT.js → chunk-JXN4SH6M.js} +1 -1
  84. package/dist/{chunk-GXTW3W45.js → chunk-JXNDO7FB.js} +1 -1
  85. package/dist/{chunk-UN2QALQO.js → chunk-KB2EEK5T.js} +5 -5
  86. package/dist/{chunk-262UYDKT.js → chunk-KDTTCR3E.js} +3 -3
  87. package/dist/{chunk-DZE26BID.js → chunk-KPCVIH52.js} +22 -1
  88. package/dist/{chunk-RBM2ROSY.js → chunk-LUBECFXJ.js} +1 -1
  89. package/dist/{chunk-4M6VUUTX.js → chunk-MDEXA6JD.js} +3 -3
  90. package/dist/{chunk-Y3N7LIFV.js → chunk-MPG4HYQ6.js} +3 -3
  91. package/dist/{chunk-75UJ7W6H.js → chunk-NG2EWF32.js} +2 -2
  92. package/dist/{chunk-NZZFIIH6.js → chunk-NK5XT4RS.js} +4 -4
  93. package/dist/{chunk-PYAPWXVP.js → chunk-NPG4WCIM.js} +1 -1
  94. package/dist/{chunk-AW7IJ56H.js → chunk-O5VJGP6H.js} +4 -4
  95. package/dist/{chunk-RUORT3DE.js → chunk-OJGHJIFQ.js} +5 -5
  96. package/dist/{chunk-56ANL3UO.js → chunk-OR5SWH44.js} +10 -10
  97. package/dist/{chunk-FE7HSLTK.js → chunk-P4PLDBZK.js} +5 -5
  98. package/dist/{chunk-4AKZALX4.js → chunk-PU2KHDRD.js} +22 -19
  99. package/dist/{chunk-YQMARTNQ.js → chunk-Q4VB3DIL.js} +2 -2
  100. package/dist/{chunk-QQMT2JIC.js → chunk-RIBCPWOB.js} +3 -3
  101. package/dist/{chunk-PCFIYMK4.js → chunk-RLBTKTOK.js} +2 -2
  102. package/dist/{chunk-CIT4NO5H.js → chunk-SI7EFQEU.js} +34 -13
  103. package/dist/{chunk-X2XXKXC5.js → chunk-T2N7MEO3.js} +3 -3
  104. package/dist/{chunk-Q63L3VBY.js → chunk-T5GJK54S.js} +4 -4
  105. package/dist/{chunk-37F75NBN.js → chunk-TAGLGMA6.js} +2 -2
  106. package/dist/{chunk-N2VH44GL.js → chunk-U35OB2HQ.js} +6 -6
  107. package/dist/{chunk-LUFKWK7N.js → chunk-UMR6UQZ4.js} +3 -3
  108. package/dist/{chunk-LDE7L7XO.js → chunk-WGK2BIX6.js} +4 -4
  109. package/dist/{chunk-EPMIBLCE.js → chunk-WUREJCUJ.js} +5 -5
  110. package/dist/{chunk-BH5WEDQ4.js → chunk-XL6DDWWT.js} +1 -1
  111. package/dist/{chunk-5RVL2CQK.js → chunk-XQFHB2EK.js} +3 -3
  112. package/dist/{chunk-ZLLQO4RU.js → chunk-YM5OM2CI.js} +6 -6
  113. package/dist/{chunk-LMECI62A.js → chunk-Z2QWM27R.js} +6 -6
  114. package/dist/{chunk-YHHWO4IU.js → chunk-ZUZ4RXM7.js} +1 -1
  115. package/dist/{codex-app-cards-switch-SXY732CY.js → codex-app-cards-switch-UI2LQQ6C.js} +11 -11
  116. package/dist/{codex-card-routing-K5FNOTBK.js → codex-card-routing-IOVURY45.js} +2 -2
  117. package/dist/{codex-desktop-launch-SMWGCLWW.js → codex-desktop-launch-GAXMK6IM.js} +1 -1
  118. package/dist/{codex-session-launch-MDMNYCCG.js → codex-session-launch-FYXRCD3I.js} +18 -18
  119. package/dist/{config-3R7UVC67.js → config-WOATWPOD.js} +3 -3
  120. package/dist/{global-upgrade-2BXXJQHR.js → global-upgrade-LDIMKAPF.js} +9 -9
  121. package/dist/{identity-N45XKYBA.js → identity-GCRCIP45.js} +4 -4
  122. package/dist/{live-capabilities-YT7CENI2.js → live-capabilities-DPMIMA3P.js} +4 -4
  123. package/dist/{paths-A2TITMY3.js → paths-H5LP5HJB.js} +3 -3
  124. package/dist/{reapply-O4TGPUVZ.js → reapply-FBNJRZLQ.js} +28 -28
  125. package/dist/src/index.d.ts +2 -1
  126. package/dist/src/index.js +31 -31
  127. package/dist/{upgrade-lock-HYD3MFFS.js → upgrade-lock-76Z2YLIV.js} +4 -4
  128. package/dist/{usage-PTPB2XF6.js → usage-SIELH6XD.js} +3 -3
  129. package/package.json +1 -1
@@ -1,42 +1,36 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
- inspectConfiguredManagedProviders
4
- } from "../chunk-G2TTGQ5A.js";
5
- import {
6
- MANAGED_CLAUDE_SETTINGS_BY_PLATFORM
7
- } from "../chunk-M73Q37LC.js";
3
+ readHookWiring,
4
+ readHookWiringSafely
5
+ } from "../chunk-GGBGKQIZ.js";
8
6
  import {
9
- declinedAgentsFile,
10
- readDeclinedAgents
11
- } from "../chunk-VA4OGALQ.js";
7
+ inspectConfiguredManagedProviders
8
+ } from "../chunk-AR3VX4UQ.js";
9
+ import "../chunk-6E2D22Y5.js";
10
+ import "../chunk-BWSXWX6T.js";
12
11
  import {
13
12
  HEARTBEAT_INTERVAL_MS,
14
13
  sendHeartbeat
15
- } from "../chunk-PTBWLU4G.js";
16
- import "../chunk-3AX5BKYN.js";
14
+ } from "../chunk-DSXBMC2N.js";
15
+ import "../chunk-GBT74TNN.js";
17
16
  import {
18
17
  readSignedOutDiagnosis
19
- } from "../chunk-YXFLZ2LO.js";
18
+ } from "../chunk-GI3266RE.js";
20
19
  import {
21
20
  HERMES_INSTALL_MARKER_FILE,
22
21
  defaultHermesHome,
23
22
  parseHermesInstallMarker
24
- } from "../chunk-4M6VUUTX.js";
23
+ } from "../chunk-MDEXA6JD.js";
25
24
  import {
26
25
  writeHuman
27
26
  } from "../chunk-QCGNGEGE.js";
28
- import "../chunk-5EEW4WIS.js";
29
- import "../chunk-Y3N7LIFV.js";
30
- import "../chunk-O2MZQPP4.js";
31
- import {
32
- OPENCODE_HOOK_BINARY,
33
- openCodeConfigDir,
34
- openCodePluginArgv,
35
- openCodePluginFile
36
- } from "../chunk-UN2QALQO.js";
27
+ import "../chunk-B5NKPU2E.js";
28
+ import "../chunk-MPG4HYQ6.js";
29
+ import "../chunk-53ROMSOB.js";
30
+ import "../chunk-KB2EEK5T.js";
37
31
  import {
38
32
  exitOnHelpFlag
39
- } from "../chunk-RBM2ROSY.js";
33
+ } from "../chunk-LUBECFXJ.js";
40
34
  import {
41
35
  codexBinaryIsBroken,
42
36
  detectProviderLiveCapabilities,
@@ -45,8 +39,8 @@ import {
45
39
  launchableProviders,
46
40
  resolveControlPolicy,
47
41
  trackProviderInventory
48
- } from "../chunk-X2XXKXC5.js";
49
- import "../chunk-WO46WX65.js";
42
+ } from "../chunk-T2N7MEO3.js";
43
+ import "../chunk-FLRVTAV4.js";
50
44
  import {
51
45
  SESSION_REAP_SILENCE_MS,
52
46
  describeIdleWindow,
@@ -54,29 +48,22 @@ import {
54
48
  listProcessProofs,
55
49
  ownsLiveProcess,
56
50
  silentSpawnedProofs
57
- } from "../chunk-37F75NBN.js";
51
+ } from "../chunk-TAGLGMA6.js";
58
52
  import "../chunk-ROVLRXBI.js";
59
53
  import {
60
54
  readLocalAutoUpdateReport
61
- } from "../chunk-YILMWIZN.js";
62
- import {
63
- liveCursorGateCoverage
64
- } from "../chunk-QVGE26SZ.js";
55
+ } from "../chunk-D3XNQAQO.js";
56
+ import "../chunk-IWUYKDDW.js";
65
57
  import {
66
58
  startRegisteredTranscripts
67
- } from "../chunk-56ANL3UO.js";
59
+ } from "../chunk-OR5SWH44.js";
68
60
  import "../chunk-HXBQTPKC.js";
69
61
  import "../chunk-G66WIAST.js";
70
- import {
71
- compatibleConfigFile,
72
- compatibleHookEvents,
73
- grokHome,
74
- parseConfigDocument
75
- } from "../chunk-RUORT3DE.js";
62
+ import "../chunk-OJGHJIFQ.js";
76
63
  import {
77
64
  pendingCommandReceipts,
78
65
  removePendingCommand
79
- } from "../chunk-7HDO5W4C.js";
66
+ } from "../chunk-I7HSE5LD.js";
80
67
  import {
81
68
  DAEMON_LEASE_RENEW_INTERVAL_MS,
82
69
  acquireDaemonLease,
@@ -93,83 +80,53 @@ import {
93
80
  requestDaemonHandoff,
94
81
  stopDaemonRunning,
95
82
  writeDaemonNeedsLogin
96
- } from "../chunk-SSW4QRGU.js";
83
+ } from "../chunk-3ZU77DJH.js";
97
84
  import {
98
- DEFAULT_HOOKS_KEY_PATH,
99
- GEMINI_HOOK_BINARY,
100
- GEMINI_HOOK_EVENTS,
101
- hookOwnerOf,
102
- hooksAt
103
- } from "../chunk-NZZFIIH6.js";
104
- import "../chunk-FYVRA5GN.js";
105
- import "../chunk-54DPX27B.js";
106
- import "../chunk-YBQF7DCL.js";
85
+ hookOwnerOf
86
+ } from "../chunk-NK5XT4RS.js";
87
+ import "../chunk-FQSFN5ZE.js";
88
+ import "../chunk-5SUTYXCT.js";
89
+ import "../chunk-233KC6DP.js";
107
90
  import "../chunk-YPY4YCIZ.js";
108
- import "../chunk-262UYDKT.js";
91
+ import "../chunk-KDTTCR3E.js";
109
92
  import "../chunk-XMSDA5WA.js";
110
- import "../chunk-G42VQNBC.js";
111
- import "../chunk-NVPCETJ3.js";
112
- import "../chunk-TILEGY4M.js";
93
+ import "../chunk-5J2OGCUA.js";
94
+ import "../chunk-4I6FWGZ5.js";
95
+ import "../chunk-44O6GG4I.js";
113
96
  import "../chunk-POFBE6ZY.js";
114
- import "../chunk-EPMIBLCE.js";
115
- import "../chunk-OECCPPO6.js";
116
- import "../chunk-5RVL2CQK.js";
97
+ import "../chunk-WUREJCUJ.js";
98
+ import "../chunk-HJ566HEV.js";
99
+ import "../chunk-XQFHB2EK.js";
117
100
  import {
118
101
  spawnClaude
119
102
  } from "../chunk-XHKBHWLX.js";
120
- import "../chunk-PYAPWXVP.js";
103
+ import "../chunk-NPG4WCIM.js";
121
104
  import {
122
105
  getMachineId
123
- } from "../chunk-SDQQ43FT.js";
106
+ } from "../chunk-F5TQ6TCH.js";
124
107
  import {
125
108
  readControlMode
126
- } from "../chunk-NUU2JVOG.js";
127
- import "../chunk-LTVILMEZ.js";
109
+ } from "../chunk-22OATDEL.js";
110
+ import "../chunk-JRW5HK32.js";
128
111
  import {
129
- CODEX_EARLIER_APPROVAL_MATCHERS,
130
- CODEX_HOOK_BINARY,
131
- CODEX_HOOK_EVENTS,
132
- NO_SPOTLIGHT,
133
- bridgeCache,
134
- bridgeStub,
135
112
  claudeConfigDir,
136
- claudeSettings,
137
- claudeSettingsLocal,
138
- codexConfigToml,
139
- codexHome,
140
- codexHookPositions,
141
- codexHooksFeatureDisabled,
142
- codexHooksJson,
143
- codexTrustGaps,
144
- cursorUserHooks,
145
- geminiSettings,
146
- hookBinaryNameOf,
147
- hookExecutableName,
148
- installedBridgeBundleRoots,
149
- isBridgeLocator,
150
- liveBridgeProbe,
151
- macAppBridgeIsInstalled,
152
- parseHookArgv,
153
- parseHookCommand,
154
- supportedClaudeEvents
155
- } from "../chunk-PCFIYMK4.js";
113
+ codexHome
114
+ } from "../chunk-RLBTKTOK.js";
156
115
  import {
157
116
  resolveBinary
158
- } from "../chunk-QQMT2JIC.js";
117
+ } from "../chunk-RIBCPWOB.js";
159
118
  import {
160
119
  getApiKey,
161
120
  getBaseUrl
162
- } from "../chunk-O76PTPKP.js";
121
+ } from "../chunk-GSJUGW3A.js";
163
122
  import "../chunk-YU2EUD7O.js";
164
123
  import {
165
- readRegularJsonFile,
166
- readRegularTextFile,
167
124
  writeJsonAtomicDurable
168
125
  } from "../chunk-T5I4PKOQ.js";
169
126
  import {
170
127
  EXIT
171
128
  } from "../chunk-BG4HHB7E.js";
172
- import "../chunk-KHWNW4AS.js";
129
+ import "../chunk-JCHF4VR3.js";
173
130
  import "../chunk-ZVU6WMMU.js";
174
131
  import {
175
132
  CLAUDE_INBOX,
@@ -179,14 +136,8 @@ import {
179
136
  CLAUDE_WAKE,
180
137
  CLAUDE_WAKE_API,
181
138
  COMMAND_RECOVERY,
182
- CURSOR_GATE_EVENTS,
183
- CURSOR_GATE_SCRIPT,
184
- HOOK_COMPATIBLE_PROFILES,
185
- HOOK_WIRING_PROFILE_LENGTH,
186
- HOOK_WIRING_REPORT_VERSION,
187
139
  NATIVE_INPUT,
188
140
  NativeInputAgent,
189
- OPENCODE_APPROVAL_EVENT,
190
141
  claudeInboxAction,
191
142
  claudeWakeDecision,
192
143
  claudeWakeWaitingOn,
@@ -196,8 +147,6 @@ import {
196
147
  isCodexInputReceipt,
197
148
  isCodexQueuedReceipt,
198
149
  isCommandAcknowledgementReceipt,
199
- isRecord,
200
- matcherMatchesEveryCall,
201
150
  nativeIdentifier,
202
151
  nativeInputAction,
203
152
  nativeRecord,
@@ -207,7 +156,7 @@ import {
207
156
  parseHermesAdmission,
208
157
  parseHermesReplayCursor,
209
158
  qualifyHermesReceiptMode
210
- } from "../chunk-DZE26BID.js";
159
+ } from "../chunk-KPCVIH52.js";
211
160
  import "../chunk-MLKGABMK.js";
212
161
 
213
162
  // src/native-host-receiver.ts
@@ -295,8 +244,8 @@ var Rpc = class _Rpc {
295
244
  followRedirects: false
296
245
  });
297
246
  const rpc = new _Rpc(socket, timeout);
298
- await new Promise((resolve4, reject) => {
299
- socket.once("open", resolve4);
247
+ await new Promise((resolve3, reject) => {
248
+ socket.once("open", resolve3);
300
249
  socket.once("error", reject);
301
250
  });
302
251
  if (protocols.length && socket.protocol !== protocols[0]) {
@@ -307,12 +256,12 @@ var Rpc = class _Rpc {
307
256
  }
308
257
  request(method, params) {
309
258
  const id = ++this.sequence;
310
- return new Promise((resolve4, reject) => {
259
+ return new Promise((resolve3, reject) => {
311
260
  const timer = setTimeout(() => {
312
261
  this.pending.delete(id);
313
262
  reject(new Error("native RPC timeout"));
314
263
  }, this.timeout);
315
- this.pending.set(id, { resolve: resolve4, reject, timer });
264
+ this.pending.set(id, { resolve: resolve3, reject, timer });
316
265
  this.socket.send(
317
266
  JSON.stringify({ jsonrpc: "2.0", id, method, params }),
318
267
  (error) => {
@@ -333,7 +282,7 @@ var Rpc = class _Rpc {
333
282
  this.socket.terminate();
334
283
  }
335
284
  };
336
- var controlRequest = (path, request, timeout) => new Promise((resolve4, reject) => {
285
+ var controlRequest = (path, request, timeout) => new Promise((resolve3, reject) => {
337
286
  const s = createConnection(path);
338
287
  let buffer = "";
339
288
  const timer = setTimeout(() => {
@@ -354,7 +303,7 @@ var controlRequest = (path, request, timeout) => new Promise((resolve4, reject)
354
303
  }
355
304
  if (!buffer.includes("\n")) return;
356
305
  try {
357
- resolve4(JSON.parse(buffer.slice(0, buffer.indexOf("\n"))));
306
+ resolve3(JSON.parse(buffer.slice(0, buffer.indexOf("\n"))));
358
307
  } catch {
359
308
  reject(new Error("invalid native control response"));
360
309
  }
@@ -1481,376 +1430,9 @@ var startClaudeInboxReceiver = (apiKey, machineId, options = {}) => {
1481
1430
 
1482
1431
  // src/spawn-daemon.ts
1483
1432
  import { execFileSync as execFileSync2, spawn } from "child_process";
1484
- import { existsSync, statSync as statSync3 } from "fs";
1485
- import { homedir as homedir4 } from "os";
1486
- import { basename as basename3, dirname as dirname4, join as join5 } from "path";
1487
-
1488
- // src/hook-wiring.ts
1489
- import { createHash as createHash4 } from "crypto";
1490
- import { realpathSync as realpathSync2, statSync as statSync2 } from "fs";
1433
+ import { existsSync, statSync as statSync2 } from "fs";
1491
1434
  import { homedir as homedir3 } from "os";
1492
- import { dirname as dirname3, isAbsolute as isAbsolute2, resolve as resolve3 } from "path";
1493
- var HOOK_WIRING_MAX_FILE_BYTES = 16 * 1024 * 1024;
1494
- var COMMAND_HOOK_TYPE = "command";
1495
- var CODEX_TRUST_GAPS_THAT_SWITCH_OFF = /* @__PURE__ */ new Set(["disabled", "asynchronous"]);
1496
- var CODEX_TRUST_GAP_UNTRUSTED = "untrusted";
1497
- var MATCHER_ALTERNATIVE_SEPARATOR = "|";
1498
- var SIMPLE_CLAUDE_CODE_MATCHER = /^[a-zA-Z0-9_|]+$/;
1499
- var TABLE_PATTERN_WILDCARD = ".*";
1500
- var TABLE_PATTERN_SAMPLE = "probe";
1501
- var UNRESTRICTED_MATCHER_PROBES = ["Bash", "Write", "Edit", "Read", "apply_patch", "run_shell_command", "mcp__probe__tool", "probe"];
1502
- var EXECUTE_BITS = 73;
1503
- var WINDOWS_PLATFORM = "win32";
1504
- var NO_EVENTS = /* @__PURE__ */ new Set();
1505
- var NO_HANDLERS = /* @__PURE__ */ new Map();
1506
- var NO_EARLIER_MATCHERS = {};
1507
- var approvalEventsOf = (definitions, binaryOf, earlierMatchers = NO_EARLIER_MATCHERS) => definitions.filter((definition) => definition.delivery === "approval").map((definition) => ({
1508
- event: definition.event,
1509
- binary: binaryOf(definition),
1510
- matcher: definition.matcher ?? null,
1511
- earlierMatchers: earlierMatchers[definition.event] ?? [],
1512
- cliOnly: definition.cliOnly === true
1513
- }));
1514
- var eventsWithBinary = (events, binary) => events.map((event) => ({ event, binary, matcher: null, earlierMatchers: [], cliOnly: false }));
1515
- var CODEX_APPROVAL_EVENTS = approvalEventsOf(CODEX_HOOK_EVENTS, () => CODEX_HOOK_BINARY, CODEX_EARLIER_APPROVAL_MATCHERS);
1516
- var hookWiringAgentOf = (target) => {
1517
- switch (target.kind) {
1518
- case "claude":
1519
- return "claude";
1520
- case "codex":
1521
- return "codex";
1522
- case "gemini":
1523
- return "gemini";
1524
- case "cursor":
1525
- return "cursor";
1526
- case "opencode":
1527
- return "opencode";
1528
- case "compatible":
1529
- return target.profile.source;
1530
- }
1531
- };
1532
- var hookWiringApprovalEvents = (target) => {
1533
- switch (target.kind) {
1534
- case "claude":
1535
- return approvalEventsOf(supportedClaudeEvents(null), (hook) => hook.binary);
1536
- case "codex":
1537
- return CODEX_APPROVAL_EVENTS;
1538
- case "gemini":
1539
- return approvalEventsOf(GEMINI_HOOK_EVENTS, () => GEMINI_HOOK_BINARY);
1540
- case "cursor":
1541
- return eventsWithBinary(CURSOR_GATE_EVENTS, hookBinaryNameOf(CURSOR_GATE_SCRIPT));
1542
- case "opencode":
1543
- return eventsWithBinary([OPENCODE_APPROVAL_EVENT], OPENCODE_HOOK_BINARY);
1544
- case "compatible":
1545
- return approvalEventsOf(compatibleHookEvents(target.profile), (hook) => hook.binary);
1546
- }
1547
- };
1548
- var configFileOf = (target) => {
1549
- switch (target.kind) {
1550
- case "claude":
1551
- case "gemini":
1552
- return target.settingsFile;
1553
- case "opencode":
1554
- return target.pluginFile;
1555
- case "codex":
1556
- case "cursor":
1557
- case "compatible":
1558
- return target.hooksFile;
1559
- }
1560
- };
1561
- var hooksKeyPathOf = (target) => target.kind === "compatible" ? target.profile.hooksKeyPath : DEFAULT_HOOKS_KEY_PATH;
1562
- var handlerTypeOf = (target) => target.kind === "cursor" ? "optional" : "required";
1563
- var hookWiringProfileOf = (machineId, configFile) => createHash4("sha256").update(`${machineId}\0${resolve3(configFile)}`, "utf8").digest("hex").slice(0, HOOK_WIRING_PROFILE_LENGTH);
1564
- var requiredApprovalEvents = (events, owner) => events.filter((event) => !(event.cliOnly && owner === "app")).map((event) => event.event);
1565
- var isSwitchedOff = (reading, required) => reading.switchedOff || reading.trustGaps.some((gap) => CODEX_TRUST_GAPS_THAT_SWITCH_OFF.has(gap.kind) && required.has(gap.event));
1566
- var isUntrusted = (reading, required) => reading.trustGaps.some((gap) => gap.kind === CODEX_TRUST_GAP_UNTRUSTED && required.has(gap.event));
1567
- var weakeningOf = (switchedOff, wiring) => {
1568
- if (switchedOff) return "switched_off";
1569
- if (wiring.missing.length > 0) return "events_missing";
1570
- return wiring.narrowed.length > 0 ? "matcher_narrowed" : null;
1571
- };
1572
- var guardedStateOf = (reading, required) => isUntrusted(reading, required) ? "untrusted" : "wired";
1573
- var requiredEventWiringOf = (required, wiredEvents, narrowedEvents) => ({
1574
- missing: required.filter((event) => !wiredEvents.has(event) && !narrowedEvents.has(event)),
1575
- narrowed: required.filter((event) => !wiredEvents.has(event) && narrowedEvents.has(event))
1576
- });
1577
- var hookWiringOf = (reading) => {
1578
- if (!reading.configDirExists) return null;
1579
- const base = { agent: reading.agent, profile: reading.profile };
1580
- if (reading.hooks.kind === "unreadable") {
1581
- return { ...base, state: reading.declined ? "disconnected" : "unreadable", owner: null };
1582
- }
1583
- const owner = reading.hooks.kind === "read" ? reading.hooks.owner : null;
1584
- if (reading.declined) return { ...base, state: "disconnected", owner };
1585
- const required = requiredApprovalEvents(reading.approvalEvents, owner);
1586
- const wiring = reading.hooks.kind === "read" ? requiredEventWiringOf(required, reading.hooks.wiredEvents, reading.hooks.narrowedEvents) : requiredEventWiringOf(required, NO_EVENTS, NO_EVENTS);
1587
- if (wiring.missing.length === required.length) return { ...base, state: "missing", owner };
1588
- const requiredSet = new Set(required);
1589
- const weakenedBy = weakeningOf(isSwitchedOff(reading, requiredSet), wiring);
1590
- if (weakenedBy) {
1591
- return { ...base, state: "weakened", owner, weakenedBy, ...wiring.missing.length > 0 ? { missing: wiring.missing } : {} };
1592
- }
1593
- return { ...base, state: guardedStateOf(reading, requiredSet), owner };
1594
- };
1595
- var isCommandHandler = (handler, handlerType) => handler.type === COMMAND_HOOK_TYPE || handlerType === "optional" && handler.type === void 0;
1596
- var handlerOf = (handler, matcher, handlerType) => {
1597
- if (!isCommandHandler(handler, handlerType) || typeof handler.command !== "string") return [];
1598
- const command = parseHookCommand(handler.command);
1599
- return command ? [{ raw: handler.command, command, matcher }] : [];
1600
- };
1601
- var handlersInEntry = (entry, handlerType) => {
1602
- if (!isRecord(entry)) return [];
1603
- if (!Array.isArray(entry.hooks)) return handlerOf(entry, entry.matcher, handlerType);
1604
- return entry.hooks.filter(isRecord).flatMap((handler) => handlerOf(handler, entry.matcher, handlerType));
1605
- };
1606
- var handlersOnEvent = (entries, handlerType) => Array.isArray(entries) ? entries.flatMap((entry) => handlersInEntry(entry, handlerType)) : [];
1607
- var handlersByEventIn = (hooks, handlerType) => new Map(isRecord(hooks) ? Object.entries(hooks).map(([event, entries]) => [event, handlersOnEvent(entries, handlerType)]) : []);
1608
- var matcherAlternatives = (matcher) => matcher.split(MATCHER_ALTERNATIVE_SEPARATOR);
1609
- var compiledMatcher = (matcher) => {
1610
- try {
1611
- return new RegExp(matcher);
1612
- } catch {
1613
- return null;
1614
- }
1615
- };
1616
- var regexToolMatch = (matcher) => {
1617
- const pattern = compiledMatcher(matcher);
1618
- return (tool) => pattern !== null && pattern.test(tool);
1619
- };
1620
- var toolMatchOf = (semantics, matcher) => {
1621
- if (semantics === "regex" || !SIMPLE_CLAUDE_CODE_MATCHER.test(matcher)) return regexToolMatch(matcher);
1622
- const names = new Set(matcherAlternatives(matcher));
1623
- return (tool) => names.has(tool);
1624
- };
1625
- var tableToolSamples = (tableMatcher) => matcherAlternatives(tableMatcher).map((alternative) => alternative.replaceAll(TABLE_PATTERN_WILDCARD, TABLE_PATTERN_SAMPLE));
1626
- var coverageOfSamples = (samples, matches) => {
1627
- const matched = samples.filter(matches).length;
1628
- if (matched === samples.length) return "covers";
1629
- return matched > 0 ? "narrows" : "misses";
1630
- };
1631
- var unrestrictedEventCoverage = (matcher, matches, event) => {
1632
- if (UNRESTRICTED_MATCHER_PROBES.every(matches)) return "covers";
1633
- return event.earlierMatchers.includes(matcher) ? "narrows" : "misses";
1634
- };
1635
- var tableMatcherCoverage = (semantics) => (matcher, event) => {
1636
- if (matcherMatchesEveryCall(matcher)) return "covers";
1637
- if (typeof matcher !== "string") return "misses";
1638
- const matches = toolMatchOf(semantics, matcher);
1639
- if (event.matcher === null) return unrestrictedEventCoverage(matcher, matches, event);
1640
- return coverageOfSamples(tableToolSamples(event.matcher), matches);
1641
- };
1642
- var matcherSemanticsOf = (target) => target.kind === "codex" || target.kind === "gemini" ? "regex" : "claude_code";
1643
- var coverageDecidedElsewhere = () => "covers";
1644
- var runsBinary = (command, binary, context) => {
1645
- if (!command.runsExecutable) return false;
1646
- if (isBridgeLocator(command.executable)) return context.isLiveBridge(command.executable);
1647
- return hookExecutableName(command.executable) === binary && context.isRunnableBinary(command);
1648
- };
1649
- var coveredHandlerOf = (handler, event, coverageOf) => {
1650
- const coverage = coverageOf(handler.matcher, event);
1651
- return coverage === "misses" ? [] : [{ handler, coverage }];
1652
- };
1653
- var approvalHandlersOn = (handlersByEvent, event, context, coverageOf) => ({
1654
- event,
1655
- handlers: (handlersByEvent.get(event.event) ?? []).filter((handler) => runsBinary(handler.command, event.binary, context)).flatMap((handler) => coveredHandlerOf(handler, event, coverageOf))
1656
- });
1657
- var coversTableMatcher = (approval) => approval.handlers.some((covered) => covered.coverage === "covers");
1658
- var isBridgeHandler = (handler) => isBridgeLocator(handler.command.executable);
1659
- var hasLiveBridgeAnywhere = (handlersByEvent, isLiveBridge) => [...handlersByEvent.values()].flat().some((handler) => handler.command.runsExecutable && isBridgeHandler(handler) && isLiveBridge(handler.command.executable));
1660
- var approvalOwnerOf = (running, liveBridgeAnywhere) => {
1661
- const covering = running.flatMap((approval) => approval.handlers.filter((covered) => covered.coverage === "covers").map((covered) => covered.handler));
1662
- if (covering.length > 0) return covering.some(isBridgeHandler) ? "app" : "cli";
1663
- if (running.some((approval) => approval.handlers.some((covered) => !isBridgeHandler(covered.handler)))) return "cli";
1664
- return liveBridgeAnywhere ? "app" : null;
1665
- };
1666
- var eventNamesOf = (approvals) => new Set(approvals.map((approval) => approval.event.event));
1667
- var approvalWiringOf = (handlersByEvent, events, context, coverageOf) => {
1668
- const running = events.map((event) => approvalHandlersOn(handlersByEvent, event, context, coverageOf)).filter((approval) => approval.handlers.length > 0);
1669
- return {
1670
- owner: approvalOwnerOf(running, hasLiveBridgeAnywhere(handlersByEvent, context.isLiveBridge)),
1671
- wiredEvents: eventNamesOf(running.filter(coversTableMatcher)),
1672
- narrowedEvents: eventNamesOf(running.filter((approval) => !coversTableMatcher(approval)))
1673
- };
1674
- };
1675
- var readJsonDocument = (path) => {
1676
- const result = readRegularJsonFile(path, HOOK_WIRING_MAX_FILE_BYTES);
1677
- if (result.kind === "missing") return { kind: "missing" };
1678
- if (result.kind === "ok" && isRecord(result.value)) return { kind: "read", document: result.value };
1679
- return { kind: "unreadable" };
1680
- };
1681
- var jsonDocumentOrEmpty = (path) => {
1682
- if (path === null) return {};
1683
- const reading = readJsonDocument(path);
1684
- return reading.kind === "read" ? reading.document : {};
1685
- };
1686
- var textOrNull = (path) => {
1687
- const result = readRegularTextFile(path, HOOK_WIRING_MAX_FILE_BYTES);
1688
- return result.kind === "ok" ? result.value : null;
1689
- };
1690
- var tomlDocumentOrEmpty = (path) => {
1691
- const document = parseConfigDocument(textOrNull(path), "toml");
1692
- return document.kind === "parsed" ? document.value : {};
1693
- };
1694
- var handlersIn = (document, target) => handlersByEventIn(hooksAt(document, hooksKeyPathOf(target)), handlerTypeOf(target));
1695
- var tableFileReading = (reading, target, context) => reading.kind === "read" ? { kind: "read", ...approvalWiringOf(handlersIn(reading.document, target), hookWiringApprovalEvents(target), context, tableMatcherCoverage(matcherSemanticsOf(target))) } : reading;
1696
- var cursorFileReading = (target, context) => {
1697
- const reading = readJsonDocument(target.hooksFile);
1698
- if (reading.kind !== "read") return reading;
1699
- const wiring = approvalWiringOf(handlersIn(reading.document, target), hookWiringApprovalEvents(target), context, coverageDecidedElsewhere);
1700
- const coverage = liveCursorGateCoverage(reading.document, { hooksFile: target.hooksFile, probe: context.probe });
1701
- const runsPushary = (event) => wiring.wiredEvents.has(event);
1702
- return {
1703
- kind: "read",
1704
- owner: wiring.owner,
1705
- wiredEvents: new Set(coverage.full.filter(runsPushary)),
1706
- narrowedEvents: new Set(coverage.partial.filter(runsPushary))
1707
- };
1708
- };
1709
- var openCodeHandlers = (argv) => {
1710
- const command = parseHookArgv(argv);
1711
- return command ? /* @__PURE__ */ new Map([[OPENCODE_APPROVAL_EVENT, [{ raw: argv.join(" "), command, matcher: void 0 }]]]) : NO_HANDLERS;
1712
- };
1713
- var openCodeFileReading = (target, context) => {
1714
- const result = readRegularTextFile(target.pluginFile, HOOK_WIRING_MAX_FILE_BYTES);
1715
- if (result.kind === "missing") return { kind: "missing" };
1716
- if (result.kind !== "ok") return { kind: "unreadable" };
1717
- const handlersByEvent = openCodeHandlers(openCodePluginArgv(result.value) ?? []);
1718
- return { kind: "read", ...approvalWiringOf(handlersByEvent, hookWiringApprovalEvents(target), context, tableMatcherCoverage(matcherSemanticsOf(target))) };
1719
- };
1720
- var isDirectory = (path) => {
1721
- try {
1722
- return statSync2(path).isDirectory();
1723
- } catch {
1724
- return false;
1725
- }
1726
- };
1727
- var claudeHooksSwitchedOff = (user, local, managed) => [user, local, managed].some((settings) => settings.disableAllHooks === true) || managed.allowManagedHooksOnly === true;
1728
- var codexTrustCommandIn = (document) => {
1729
- const handlersByEvent = handlersByEventIn(hooksAt(document, DEFAULT_HOOKS_KEY_PATH), "required");
1730
- const handlers = CODEX_APPROVAL_EVENTS.flatMap((event) => handlersByEvent.get(event.event) ?? []);
1731
- return handlers.find((handler) => hookExecutableName(handler.command.executable) === CODEX_HOOK_BINARY)?.raw ?? "";
1732
- };
1733
- var codexHookTrustGapsIn = (config, document, hooksFile) => codexTrustGaps(config, document, hooksFile, codexTrustCommandIn(document), codexHookPositions(document));
1734
- var UNSWITCHED = { switchedOff: false, trustGaps: [] };
1735
- var readClaudeTarget = (target, context) => {
1736
- const settings = readJsonDocument(target.settingsFile);
1737
- return {
1738
- hooks: tableFileReading(settings, target, context),
1739
- switchedOff: claudeHooksSwitchedOff(
1740
- settings.kind === "read" ? settings.document : {},
1741
- jsonDocumentOrEmpty(target.localSettingsFile),
1742
- jsonDocumentOrEmpty(target.managedSettingsFile)
1743
- ),
1744
- trustGaps: []
1745
- };
1746
- };
1747
- var readCodexTarget = (target, context) => {
1748
- const hooksDocument = readJsonDocument(target.hooksFile);
1749
- const hooks = tableFileReading(hooksDocument, target, context);
1750
- if (hooksDocument.kind !== "read") return { hooks, ...UNSWITCHED };
1751
- const config = tomlDocumentOrEmpty(target.configFile);
1752
- return {
1753
- hooks,
1754
- switchedOff: codexHooksFeatureDisabled(config),
1755
- trustGaps: codexHookTrustGapsIn(config, hooksDocument.document, target.hooksFile)
1756
- };
1757
- };
1758
- var readAgentSpecific = (target, context) => {
1759
- switch (target.kind) {
1760
- case "claude":
1761
- return readClaudeTarget(target, context);
1762
- case "codex":
1763
- return readCodexTarget(target, context);
1764
- case "opencode":
1765
- return { hooks: openCodeFileReading(target, context), ...UNSWITCHED };
1766
- case "cursor":
1767
- return { hooks: cursorFileReading(target, context), ...UNSWITCHED };
1768
- case "gemini":
1769
- case "compatible":
1770
- return { hooks: tableFileReading(readJsonDocument(configFileOf(target)), target, context), ...UNSWITCHED };
1771
- }
1772
- };
1773
- var readHookWiringTarget = (target, machineId, declined, context) => {
1774
- const agent = hookWiringAgentOf(target);
1775
- return {
1776
- agent,
1777
- profile: hookWiringProfileOf(machineId, configFileOf(target)),
1778
- configDirExists: isDirectory(target.configDir),
1779
- declined: declined.has(agent),
1780
- approvalEvents: hookWiringApprovalEvents(target),
1781
- ...readAgentSpecific(target, context)
1782
- };
1783
- };
1784
- var realpathOrNull = (path) => {
1785
- try {
1786
- return realpathSync2(path);
1787
- } catch {
1788
- return null;
1789
- }
1790
- };
1791
- var canonicalLiveBridge = (location, probe) => {
1792
- const stub = realpathOrNull(location.stub);
1793
- if (stub === null || !macAppBridgeIsInstalled(location, probe)) return () => false;
1794
- return (executable) => isAbsolute2(executable) && isBridgeLocator(executable) && realpathOrNull(executable) === stub;
1795
- };
1796
- var regularFileMode = (path) => {
1797
- try {
1798
- const stats = statSync2(path);
1799
- return stats.isFile() ? stats.mode : null;
1800
- } catch {
1801
- return null;
1802
- }
1803
- };
1804
- var runnableBinaryCheck = (platform) => (command) => {
1805
- if (!isAbsolute2(command.executable)) return false;
1806
- const mode = regularFileMode(command.executable);
1807
- if (mode === null) return false;
1808
- return command.runsThroughNode || platform === WINDOWS_PLATFORM || (mode & EXECUTE_BITS) !== 0;
1809
- };
1810
- var hookWiringReadContext = (bridge, platform) => {
1811
- const probe = { ...liveBridgeProbe(), readFile: textOrNull, mdfind: NO_SPOTLIGHT };
1812
- return { probe, isLiveBridge: canonicalLiveBridge(bridge, probe), isRunnableBinary: runnableBinaryCheck(platform) };
1813
- };
1814
- var compatibleConfigDirOf = (profile, hooksFile) => profile.configFile.root === "grok_home" ? grokHome() : dirname3(hooksFile);
1815
- var compatibleTarget = (profile) => {
1816
- const hooksFile = compatibleConfigFile(profile);
1817
- return { kind: "compatible", profile, configDir: compatibleConfigDirOf(profile, hooksFile), hooksFile };
1818
- };
1819
- var hookWiringLocations = (platform = process.platform) => ({
1820
- declinedAgentsFile: declinedAgentsFile(),
1821
- bridge: { stub: bridgeStub(), cache: bridgeCache(), bundleRoots: installedBridgeBundleRoots(homedir3()) },
1822
- targets: [
1823
- {
1824
- kind: "claude",
1825
- configDir: claudeConfigDir(),
1826
- settingsFile: claudeSettings(),
1827
- localSettingsFile: claudeSettingsLocal(),
1828
- managedSettingsFile: MANAGED_CLAUDE_SETTINGS_BY_PLATFORM[platform] ?? null
1829
- },
1830
- { kind: "codex", configDir: codexHome(), hooksFile: codexHooksJson(), configFile: codexConfigToml() },
1831
- { kind: "gemini", configDir: dirname3(geminiSettings()), settingsFile: geminiSettings() },
1832
- { kind: "cursor", configDir: dirname3(cursorUserHooks()), hooksFile: cursorUserHooks() },
1833
- { kind: "opencode", configDir: openCodeConfigDir(), pluginFile: openCodePluginFile() },
1834
- ...HOOK_COMPATIBLE_PROFILES.map(compatibleTarget)
1835
- ]
1836
- });
1837
- var readHookWiring = (machineId, locations = hookWiringLocations()) => {
1838
- const declined = new Set(readDeclinedAgents(locations.declinedAgentsFile));
1839
- const context = hookWiringReadContext(locations.bridge, process.platform);
1840
- const agents = locations.targets.flatMap((target) => {
1841
- const entry = hookWiringOf(readHookWiringTarget(target, machineId, declined, context));
1842
- return entry ? [entry] : [];
1843
- });
1844
- return { version: HOOK_WIRING_REPORT_VERSION, agents };
1845
- };
1846
- var readHookWiringSafely = (read, reportFailure) => {
1847
- try {
1848
- return read();
1849
- } catch (error) {
1850
- reportFailure(error);
1851
- return null;
1852
- }
1853
- };
1435
+ import { basename as basename3, dirname as dirname3, join as join5 } from "path";
1854
1436
 
1855
1437
  // src/stop-requests.ts
1856
1438
  var STOP_CAPABILITY = "stop";
@@ -2033,13 +1615,13 @@ var resolveSpawnDirectory = (requested, options = {}) => {
2033
1615
  const fallbackDir = options.fallbackDir ?? process.cwd();
2034
1616
  const value = requested?.trim();
2035
1617
  if (!value) return { ok: true, cwd: fallbackDir };
2036
- const homeDir = options.homeDir ?? homedir4();
1618
+ const homeDir = options.homeDir ?? homedir3();
2037
1619
  const cwd = value === "~" ? homeDir : value.startsWith("~/") || value.startsWith("~\\") ? join5(homeDir, value.slice(2)) : value;
2038
1620
  if (!(options.exists ?? existsSync)(cwd)) {
2039
1621
  return { ok: false, message: `Directory does not exist: ${value}` };
2040
1622
  }
2041
1623
  try {
2042
- if (!(options.isDirectory ?? ((path) => statSync3(path).isDirectory()))(cwd)) {
1624
+ if (!(options.isDirectory ?? ((path) => statSync2(path).isDirectory()))(cwd)) {
2043
1625
  return { ok: false, message: `Not a directory: ${value}` };
2044
1626
  }
2045
1627
  } catch {
@@ -2131,9 +1713,9 @@ var runSpawnDaemon = async () => {
2131
1713
  describedProviders = description;
2132
1714
  });
2133
1715
  describedProviders = describeLaunchableProviders(inventory.current.capabilities);
2134
- const siblingEntry = process.argv[1] ? join5(dirname4(process.argv[1]), "pushary.js") : "";
2135
- const codexBridgeEntry = process.argv[1] ? join5(dirname4(process.argv[1]), "pushary-codex-bridge.js") : "pushary-codex-bridge";
2136
- const geminiBridgeEntry = process.argv[1] ? join5(dirname4(process.argv[1]), "pushary-gemini-bridge.js") : "pushary-gemini-bridge";
1716
+ const siblingEntry = process.argv[1] ? join5(dirname3(process.argv[1]), "pushary.js") : "";
1717
+ const codexBridgeEntry = process.argv[1] ? join5(dirname3(process.argv[1]), "pushary-codex-bridge.js") : "pushary-codex-bridge";
1718
+ const geminiBridgeEntry = process.argv[1] ? join5(dirname3(process.argv[1]), "pushary-gemini-bridge.js") : "pushary-gemini-bridge";
2137
1719
  const spawnDirect = siblingEntry.length > 0 && existsSync(siblingEntry);
2138
1720
  const existing = readDaemonStatus();
2139
1721
  let handoff;
@@ -2233,7 +1815,7 @@ var runSpawnDaemon = async () => {
2233
1815
  if (!plan) {
2234
1816
  return Promise.reject(new Error(FLAG_SHAPED_PROMPT_MESSAGE));
2235
1817
  }
2236
- return new Promise((resolve4, reject) => {
1818
+ return new Promise((resolve3, reject) => {
2237
1819
  try {
2238
1820
  const child = plan.direct ? spawn(plan.command, plan.args, { cwd, detached: true, stdio: "ignore", env }) : spawnClaude(plan.command, plan.args, { cwd, detached: true, stdio: "ignore", env });
2239
1821
  let started = false;
@@ -2263,7 +1845,7 @@ var runSpawnDaemon = async () => {
2263
1845
  }
2264
1846
  child.unref();
2265
1847
  log(`spawn ${req.id}: launched a phone-requested ${plan.agent} session in ${basename3(cwd)} (pid ${child.pid ?? "unknown"})`);
2266
- resolve4(typeof child.pid === "number" ? child.pid : null);
1848
+ resolve3(typeof child.pid === "number" ? child.pid : null);
2267
1849
  });
2268
1850
  } catch (err) {
2269
1851
  reject(err);
@@ -2283,7 +1865,7 @@ var runSpawnDaemon = async () => {
2283
1865
  return launched || ownsLiveProcess(request);
2284
1866
  },
2285
1867
  selfPid: process.pid,
2286
- sleep: (ms) => new Promise((resolve4) => setTimeout(resolve4, ms)),
1868
+ sleep: (ms) => new Promise((resolve3) => setTimeout(resolve3, ms)),
2287
1869
  isAlive: (pid) => {
2288
1870
  try {
2289
1871
  process.kill(pid, 0);
@@ -2341,7 +1923,7 @@ var runSpawnDaemon = async () => {
2341
1923
  completedStops.delete(acknowledgement.stopId);
2342
1924
  break;
2343
1925
  }
2344
- if (attempt < 2) await new Promise((resolve4) => setTimeout(resolve4, 200 * (attempt + 1)));
1926
+ if (attempt < 2) await new Promise((resolve3) => setTimeout(resolve3, 200 * (attempt + 1)));
2345
1927
  }
2346
1928
  }
2347
1929
  async function apply() {
@@ -2546,13 +2128,13 @@ var runSpawnDaemon = async () => {
2546
2128
  log(hasSpawnProvider(inventory.current.capabilities) ? `daemon online (pid ${process.pid}): this machine (${machineId}) can now be sent a new session from your phone. Ctrl-C to stop.` : `daemon online (pid ${process.pid}): no supported Claude, Codex, or Gemini CLI was found, so phone-start is unavailable. Ctrl-C to stop.`);
2547
2129
  timer = setTimeout(tick, 0);
2548
2130
  const signals = daemonSignals();
2549
- await new Promise((resolve4) => {
2131
+ await new Promise((resolve3) => {
2550
2132
  const onSignal = () => finish();
2551
2133
  for (const signal of signals) process.on(signal, onSignal);
2552
2134
  finish = () => {
2553
2135
  teardown();
2554
2136
  for (const signal of signals) process.off(signal, onSignal);
2555
- resolve4();
2137
+ resolve3();
2556
2138
  };
2557
2139
  });
2558
2140
  return 0;