@pushary/agent-hooks 1.9.56 → 1.9.58

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 (119) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/{api-JHBUZ7CV.js → api-WVXBM4MR.js} +10 -10
  3. package/dist/bin/pushary-bell-hook.js +27 -27
  4. package/dist/bin/pushary-bell.js +10 -10
  5. package/dist/bin/pushary-claude.js +26 -26
  6. package/dist/bin/pushary-clean.js +49 -46
  7. package/dist/bin/pushary-codex-bridge.js +21 -21
  8. package/dist/bin/pushary-codex-hook.js +32 -32
  9. package/dist/bin/pushary-codex-session.js +10 -8
  10. package/dist/bin/pushary-codex.js +14 -14
  11. package/dist/bin/pushary-connect.js +27 -26
  12. package/dist/bin/pushary-cowork.js +5 -5
  13. package/dist/bin/pushary-daemon.js +37 -37
  14. package/dist/bin/pushary-disconnect.js +26 -26
  15. package/dist/bin/pushary-doctor.js +41 -39
  16. package/dist/bin/pushary-elicitation-hook.js +27 -27
  17. package/dist/bin/pushary-gemini-bridge.js +15 -15
  18. package/dist/bin/pushary-gemini-hook.js +29 -29
  19. package/dist/bin/pushary-hook.js +31 -31
  20. package/dist/bin/pushary-login.js +13 -13
  21. package/dist/bin/pushary-logout.js +26 -26
  22. package/dist/bin/pushary-mcp.js +11 -11
  23. package/dist/bin/pushary-mode.js +13 -13
  24. package/dist/bin/pushary-notification-hook.js +26 -26
  25. package/dist/bin/pushary-opencode-hook.js +28 -28
  26. package/dist/bin/pushary-permission-denied-hook.js +31 -31
  27. package/dist/bin/pushary-permission-hook.js +30 -30
  28. package/dist/bin/pushary-post-hook.js +26 -26
  29. package/dist/bin/pushary-prompt-hook.js +26 -26
  30. package/dist/bin/pushary-session-end-hook.js +26 -26
  31. package/dist/bin/pushary-session-start-hook.js +33 -33
  32. package/dist/bin/pushary-setup.js +65 -268
  33. package/dist/bin/pushary-stats.js +5 -5
  34. package/dist/bin/pushary-status.js +32 -30
  35. package/dist/bin/pushary-stop-hook.js +26 -26
  36. package/dist/bin/pushary-stopfailure-hook.js +26 -26
  37. package/dist/bin/pushary-suggestions.js +13 -13
  38. package/dist/bin/pushary-transcript-register.js +18 -18
  39. package/dist/bin/pushary-transcripts.js +7 -7
  40. package/dist/bin/pushary-upgrade.js +107 -58
  41. package/dist/bin/pushary-wait.js +13 -13
  42. package/dist/bin/pushary.js +7 -7
  43. package/dist/{chunk-DWV3LTUH.js → chunk-3KOPY2UQ.js} +3 -3
  44. package/dist/{chunk-X5FHQMUL.js → chunk-3TJLPABQ.js} +3 -3
  45. package/dist/{chunk-OCYOOGXW.js → chunk-3WNOO7BM.js} +4 -4
  46. package/dist/{chunk-FJ7ZMR4N.js → chunk-4JJ3T7IE.js} +94 -15
  47. package/dist/{chunk-LTCNAIY2.js → chunk-4LUPZ347.js} +2 -2
  48. package/dist/{chunk-V2AMLVMD.js → chunk-4YNNAF53.js} +2 -2
  49. package/dist/{chunk-32MSOGMD.js → chunk-5DZHKNBU.js} +3 -3
  50. package/dist/{chunk-T4IAMIX4.js → chunk-5SFM6XB4.js} +1 -1
  51. package/dist/{chunk-WW266XKU.js → chunk-7RZO6VWD.js} +2 -2
  52. package/dist/{chunk-VZ3YPEMG.js → chunk-ATUZX4K7.js} +3 -3
  53. package/dist/{chunk-4US3BCQJ.js → chunk-C3IWX6KU.js} +1 -1
  54. package/dist/{chunk-AKFTQT7P.js → chunk-CK5BCFQF.js} +2 -2
  55. package/dist/{chunk-ILQARYXK.js → chunk-CSQJCXPX.js} +5 -5
  56. package/dist/chunk-CZULJ647.js +378 -0
  57. package/dist/{chunk-J5HQNZXQ.js → chunk-DQ565WFA.js} +5 -5
  58. package/dist/{chunk-ZMRO6ESW.js → chunk-ECJJKDP7.js} +1 -1
  59. package/dist/chunk-FAGDOPQI.js +266 -0
  60. package/dist/{chunk-WACFIQYA.js → chunk-GZL3KEPC.js} +51 -25
  61. package/dist/{chunk-MVW5WS6F.js → chunk-HRHAZ3GE.js} +36 -28
  62. package/dist/{chunk-GWQ6T6JV.js → chunk-HUWLEVL2.js} +5 -5
  63. package/dist/{chunk-5HMYW5W2.js → chunk-I43PY5G3.js} +1 -1
  64. package/dist/{chunk-SMMDQXI2.js → chunk-IJ6XKKQW.js} +1 -1
  65. package/dist/{chunk-YBE2KH2U.js → chunk-IRZ5FVWG.js} +3 -3
  66. package/dist/{chunk-M6DTXZQK.js → chunk-IUOUNRLH.js} +2 -2
  67. package/dist/{chunk-FXW3FW4A.js → chunk-JSQOHMNJ.js} +1 -1
  68. package/dist/{chunk-FLUKEZMH.js → chunk-JYXIARGW.js} +1 -1
  69. package/dist/{chunk-QWUWQBIJ.js → chunk-JZKEC4XJ.js} +5 -2
  70. package/dist/{chunk-6PUHW2FP.js → chunk-K5CAURU5.js} +4 -4
  71. package/dist/{chunk-FBFPQLJG.js → chunk-KIH5BDH5.js} +2 -7
  72. package/dist/{chunk-74DKFWU2.js → chunk-KSVCCSAO.js} +5 -5
  73. package/dist/{chunk-ECQNBLPS.js → chunk-KW6EYFZV.js} +14 -369
  74. package/dist/{chunk-MWBFB7WA.js → chunk-LVDC3RUE.js} +1 -1
  75. package/dist/{chunk-7QAL23TB.js → chunk-LVWXRXT7.js} +1 -1
  76. package/dist/{chunk-L66VPBS5.js → chunk-M7NX25ZA.js} +1 -1
  77. package/dist/{chunk-KWAOOXSD.js → chunk-MCHOBQHE.js} +5 -5
  78. package/dist/{chunk-57EOP757.js → chunk-MYBCXDIL.js} +4 -2
  79. package/dist/{chunk-LW4ZEC3A.js → chunk-N3NSWWNU.js} +1 -1
  80. package/dist/{chunk-HR3DJWP2.js → chunk-OHD35NPC.js} +2 -2
  81. package/dist/{chunk-PI2WWZQQ.js → chunk-PZOFPAPG.js} +2 -2
  82. package/dist/{chunk-4OXULVUA.js → chunk-QDFLBTUP.js} +1 -1
  83. package/dist/{chunk-DUACX6E3.js → chunk-QP3XPS5U.js} +11 -7
  84. package/dist/{chunk-G63LBV4Y.js → chunk-QTCFEKLJ.js} +1 -1
  85. package/dist/{chunk-724266XT.js → chunk-RF74KBF5.js} +9 -9
  86. package/dist/{chunk-JPTFFZWY.js → chunk-RGQEULXD.js} +11 -11
  87. package/dist/{chunk-5HRXOANL.js → chunk-S54YLXWW.js} +3 -3
  88. package/dist/{chunk-M7ZXKMVX.js → chunk-S5LX25XE.js} +1 -1
  89. package/dist/{chunk-JTQHC3RV.js → chunk-T2AC5VFQ.js} +5 -5
  90. package/dist/{chunk-VRPDHJGB.js → chunk-T2BEIPK2.js} +4 -4
  91. package/dist/{chunk-FFGW45DJ.js → chunk-TN74MUMB.js} +8 -8
  92. package/dist/{chunk-6U3L4K57.js → chunk-UMVVQXAC.js} +2 -2
  93. package/dist/{chunk-DFZTZRKL.js → chunk-VLJ5C6IT.js} +4 -4
  94. package/dist/{chunk-SM2DT5KP.js → chunk-VPZ5K72D.js} +1 -1
  95. package/dist/{chunk-T6GEEMVC.js → chunk-WVP6UQG3.js} +3 -3
  96. package/dist/{chunk-JSS5RG65.js → chunk-WXZN5CS3.js} +2 -2
  97. package/dist/{chunk-I6OGFHJT.js → chunk-X6F4BQEE.js} +5 -5
  98. package/dist/{chunk-HTN7SMKB.js → chunk-XEJV3QSS.js} +76 -29
  99. package/dist/{chunk-AKBFNTJF.js → chunk-XFUKCBPU.js} +10 -10
  100. package/dist/{chunk-OX5EYBOC.js → chunk-XTZHUIGJ.js} +1 -1
  101. package/dist/{chunk-WNVQPGLH.js → chunk-XWY4UW62.js} +4 -4
  102. package/dist/{chunk-S3CQBNUU.js → chunk-XXNT4FGA.js} +1 -1
  103. package/dist/{chunk-MW3DD3S5.js → chunk-ZEHUWE3X.js} +6 -6
  104. package/dist/{chunk-RZF2GIPI.js → chunk-ZJNU32VE.js} +21 -6
  105. package/dist/{chunk-WCPN3GVW.js → chunk-ZL3UR6M5.js} +3 -3
  106. package/dist/{codex-app-cards-switch-7UIGMEUE.js → codex-app-cards-switch-TVKXJWXE.js} +21 -19
  107. package/dist/{codex-desktop-launch-66LZ6R4Y.js → codex-desktop-launch-ROTJEEGF.js} +3 -1
  108. package/dist/{codex-session-launch-3TGHFR7R.js → codex-session-launch-VL6ZQA3N.js} +18 -18
  109. package/dist/{config-OBDZ2CL3.js → config-SYLUYZQE.js} +3 -3
  110. package/dist/global-upgrade-IPWV5PTM.js +34 -0
  111. package/dist/{identity-WJUPU3AK.js → identity-ARPAUNGN.js} +4 -4
  112. package/dist/{live-capabilities-GACO2VB6.js → live-capabilities-EWTRY2HA.js} +4 -4
  113. package/dist/{paths-5PWAQF63.js → paths-IZTNMJAQ.js} +5 -3
  114. package/dist/{reapply-EYPT5EP2.js → reapply-ILKOYYKA.js} +26 -26
  115. package/dist/src/index.js +21 -21
  116. package/dist/{upgrade-lock-G2ZPV7ZO.js → upgrade-lock-ML73QXIG.js} +4 -6
  117. package/dist/{usage-PXBMEKSA.js → usage-OUV76AIY.js} +3 -3
  118. package/package.json +1 -1
  119. package/dist/global-upgrade-6M2UXUUL.js +0 -26
@@ -1,27 +1,40 @@
1
1
  #!/usr/bin/env node
2
+ import {
3
+ INSTALL_NODE_STEP,
4
+ NPM_FILE_IN_USE_STEP,
5
+ NPM_PREFIX_STEP,
6
+ RETRY_AGENT_LABEL,
7
+ TRANSCRIPT_SYNC_NOTICE,
8
+ agentFailureFollowUps,
9
+ describeAgentFailures,
10
+ describeClosing,
11
+ phoneStartServiceState,
12
+ renderCommandSurface,
13
+ unverifiedKeyClosingReason
14
+ } from "../chunk-FAGDOPQI.js";
2
15
  import {
3
16
  runBrowserLogin
4
- } from "../chunk-M7ZXKMVX.js";
17
+ } from "../chunk-S5LX25XE.js";
5
18
  import {
6
19
  coworkOutput,
7
20
  coworkSelection
8
- } from "../chunk-X5FHQMUL.js";
21
+ } from "../chunk-3TJLPABQ.js";
9
22
  import "../chunk-PUZZELE6.js";
10
23
  import {
11
24
  clearDeclinedAgent,
12
25
  declinedAgentForSetupChoice
13
- } from "../chunk-PI2WWZQQ.js";
26
+ } from "../chunk-PZOFPAPG.js";
14
27
  import {
15
28
  CURSOR_GATE_SCRIPT,
16
29
  describeVersionManagerPin,
17
30
  saveSetupFailure,
18
31
  versionManagerOf
19
- } from "../chunk-JSS5RG65.js";
32
+ } from "../chunk-WXZN5CS3.js";
20
33
  import {
21
34
  codexTrustOutcome,
22
35
  describeCodexTrustConfirmation,
23
36
  needsCodexTrustStep
24
- } from "../chunk-HR3DJWP2.js";
37
+ } from "../chunk-OHD35NPC.js";
25
38
  import {
26
39
  describeWaitLadder
27
40
  } from "../chunk-CVWG2N3Y.js";
@@ -30,27 +43,28 @@ import {
30
43
  } from "../chunk-EO23EUOK.js";
31
44
  import {
32
45
  BROWSER_CONNECT_COMMAND,
33
- SETUP_AGENT_NAME,
34
46
  confirmAppConnection,
35
47
  connectDevice,
36
48
  connectViaAppPairing,
37
- describeAnswerTestPrompt,
38
- describeRoundTripOutcome,
39
- notificationAnswerStep,
40
49
  pairingEscapeApplies,
41
50
  printConnectInstructions,
42
- roundTripEvidence,
43
- verifyRoundTrip,
44
51
  waitForYourPhone
45
- } from "../chunk-ECQNBLPS.js";
52
+ } from "../chunk-KW6EYFZV.js";
53
+ import {
54
+ SETUP_AGENT_NAME,
55
+ describeAnswerTestPrompt,
56
+ describeRoundTripOutcome,
57
+ roundTripEvidence,
58
+ verifyRoundTrip
59
+ } from "../chunk-CZULJ647.js";
46
60
  import "../chunk-3EGEA4KH.js";
47
61
  import {
48
62
  readManagedControlEvidence,
49
63
  waitForMachineReadiness
50
- } from "../chunk-ILQARYXK.js";
64
+ } from "../chunk-CSQJCXPX.js";
51
65
  import {
52
66
  ensureCodexTrustsPusharyHooks
53
- } from "../chunk-6U3L4K57.js";
67
+ } from "../chunk-UMVVQXAC.js";
54
68
  import {
55
69
  describeSetupSideEffects,
56
70
  installAgentSkill,
@@ -58,7 +72,7 @@ import {
58
72
  } from "../chunk-EUW7JL2K.js";
59
73
  import {
60
74
  codexEngineBehindLauncher
61
- } from "../chunk-RZF2GIPI.js";
75
+ } from "../chunk-ZJNU32VE.js";
62
76
  import "../chunk-XCEN33UP.js";
63
77
  import {
64
78
  CURSOR_PLUGIN_BACKUP_INFIX,
@@ -68,7 +82,7 @@ import {
68
82
  soleGateFile,
69
83
  soleGateReceipt,
70
84
  soleGateReceiptFile
71
- } from "../chunk-OCYOOGXW.js";
85
+ } from "../chunk-3WNOO7BM.js";
72
86
  import {
73
87
  HERMES_PIP_PACKAGE,
74
88
  describeDetection,
@@ -81,11 +95,11 @@ import {
81
95
  runHermesConfigScript,
82
96
  shortenHome,
83
97
  vscodeSettingsTargets
84
- } from "../chunk-KWAOOXSD.js";
98
+ } from "../chunk-MCHOBQHE.js";
85
99
  import {
86
100
  mcpServerBearer,
87
101
  readMacAppAgentKey
88
- } from "../chunk-VRPDHJGB.js";
102
+ } from "../chunk-T2BEIPK2.js";
89
103
  import {
90
104
  setHumanStream
91
105
  } from "../chunk-QCGNGEGE.js";
@@ -109,7 +123,6 @@ import {
109
123
  fxInstructionsBody,
110
124
  fxPusharyEntry,
111
125
  inspectFxInstallation,
112
- matchMacAccountStep,
113
126
  readFxProfileForSetup,
114
127
  renderAgentInstructions,
115
128
  renderProjectAgentInstructions,
@@ -119,10 +132,10 @@ import {
119
132
  writeInstructionBlock,
120
133
  writeSetupConfigFile,
121
134
  writeSetupConfigJson
122
- } from "../chunk-GWQ6T6JV.js";
135
+ } from "../chunk-HUWLEVL2.js";
123
136
  import {
124
137
  MCP_BRIDGE_BINARY
125
- } from "../chunk-LTCNAIY2.js";
138
+ } from "../chunk-4LUPZ347.js";
126
139
  import {
127
140
  OPENCODE_HOOK_BINARY,
128
141
  addOpenCodeMcpServer,
@@ -138,7 +151,7 @@ import {
138
151
  openCodePluginDir,
139
152
  openCodePluginFile,
140
153
  openCodeWired
141
- } from "../chunk-JTQHC3RV.js";
154
+ } from "../chunk-T2AC5VFQ.js";
142
155
  import {
143
156
  ansiPainter,
144
157
  createIo,
@@ -154,15 +167,15 @@ import {
154
167
  nodeCodexInstallProbe,
155
168
  phoneStartIsRequired,
156
169
  resolveControlPolicy
157
- } from "../chunk-DWV3LTUH.js";
170
+ } from "../chunk-3KOPY2UQ.js";
158
171
  import {
159
172
  detectClaudeVersion
160
- } from "../chunk-7QAL23TB.js";
173
+ } from "../chunk-LVWXRXT7.js";
161
174
  import "../chunk-VUFHYMSP.js";
162
175
  import {
163
176
  describeAutoUpdateAnnouncement,
164
177
  takeAutoUpdateAnnouncement
165
- } from "../chunk-QWUWQBIJ.js";
178
+ } from "../chunk-JZKEC4XJ.js";
166
179
  import {
167
180
  addClaudeMcpServer,
168
181
  addCompatibleHooks,
@@ -182,11 +195,12 @@ import {
182
195
  hasCompatibleHooks,
183
196
  isClaudeMcpSnapshot,
184
197
  updateClaudeMcpSnapshot
185
- } from "../chunk-WNVQPGLH.js";
198
+ } from "../chunk-XWY4UW62.js";
186
199
  import {
187
200
  DAEMON_COLD_START_TIMEOUT_MS,
188
201
  clearDaemonNeedsLogin,
189
202
  daemonHasRemoteProof,
203
+ daemonIsServing,
190
204
  daemonServiceDefinitionPath,
191
205
  daemonServiceManagerAvailable,
192
206
  disableDaemonService,
@@ -196,7 +210,7 @@ import {
196
210
  replaceDaemonService,
197
211
  stopDaemonService,
198
212
  waitForDaemonRemoteProof
199
- } from "../chunk-DUACX6E3.js";
213
+ } from "../chunk-QP3XPS5U.js";
200
214
  import {
201
215
  KEEP_HINT,
202
216
  captureHookTakeover,
@@ -208,24 +222,24 @@ import {
208
222
  geminiWired,
209
223
  planHooks,
210
224
  pusharyHookExecutable
211
- } from "../chunk-74DKFWU2.js";
225
+ } from "../chunk-KSVCCSAO.js";
212
226
  import {
213
227
  GEMINI_HOOK_BINARY,
214
228
  GEMINI_HOOK_EVENTS,
215
229
  addGeminiHooks,
216
230
  addGeminiMcpServer
217
- } from "../chunk-VZ3YPEMG.js";
231
+ } from "../chunk-ATUZX4K7.js";
218
232
  import {
219
233
  AGENT_CHOICES,
220
234
  effectiveControlMode,
221
235
  effectiveVerify,
222
236
  parseSetupOptions
223
- } from "../chunk-ZMRO6ESW.js";
224
- import "../chunk-4OXULVUA.js";
237
+ } from "../chunk-ECJJKDP7.js";
238
+ import "../chunk-QDFLBTUP.js";
225
239
  import "../chunk-GMXKITVA.js";
226
240
  import {
227
241
  transcriptPreferenceForSetup
228
- } from "../chunk-4US3BCQJ.js";
242
+ } from "../chunk-C3IWX6KU.js";
229
243
  import "../chunk-XHKBHWLX.js";
230
244
  import {
231
245
  compareVersion,
@@ -243,7 +257,7 @@ import {
243
257
  recordMacAppKeyPrefix,
244
258
  resolveShellRc,
245
259
  writeKey
246
- } from "../chunk-YBE2KH2U.js";
260
+ } from "../chunk-IRZ5FVWG.js";
247
261
  import {
248
262
  CODEX_ENGINE_DIRECTORY,
249
263
  CODEX_ENGINE_ENTRYPOINT,
@@ -252,26 +266,26 @@ import {
252
266
  } from "../chunk-E46NE7FB.js";
253
267
  import {
254
268
  reportEvent
255
- } from "../chunk-724266XT.js";
256
- import "../chunk-G63LBV4Y.js";
257
- import "../chunk-S3CQBNUU.js";
258
- import "../chunk-J5HQNZXQ.js";
259
- import "../chunk-WCPN3GVW.js";
269
+ } from "../chunk-RF74KBF5.js";
270
+ import "../chunk-QTCFEKLJ.js";
271
+ import "../chunk-XXNT4FGA.js";
272
+ import "../chunk-DQ565WFA.js";
273
+ import "../chunk-ZL3UR6M5.js";
260
274
  import "../chunk-POFBE6ZY.js";
261
275
  import {
262
276
  checkApiKey,
263
277
  describeKeyCheck,
264
278
  samePusharyAccount
265
- } from "../chunk-5HRXOANL.js";
266
- import "../chunk-32MSOGMD.js";
267
- import "../chunk-SMMDQXI2.js";
279
+ } from "../chunk-S54YLXWW.js";
280
+ import "../chunk-5DZHKNBU.js";
281
+ import "../chunk-IJ6XKKQW.js";
268
282
  import {
269
283
  UsageError
270
284
  } from "../chunk-7QLSKOSU.js";
271
285
  import {
272
286
  EXIT
273
287
  } from "../chunk-KZERVKTD.js";
274
- import "../chunk-WW266XKU.js";
288
+ import "../chunk-7RZO6VWD.js";
275
289
  import {
276
290
  addCodexHookTrust,
277
291
  addCodexHooks,
@@ -310,7 +324,7 @@ import {
310
324
  readCodexMcpAuth,
311
325
  vscodePluginDir,
312
326
  vscodePluginMcp
313
- } from "../chunk-57EOP757.js";
327
+ } from "../chunk-MYBCXDIL.js";
314
328
  import {
315
329
  NpmMissingError,
316
330
  fetchLatestPublishedVersion,
@@ -319,18 +333,18 @@ import {
319
333
  plannedGlobalPackage,
320
334
  resolveGlobalBinDir,
321
335
  resolveGlobalBinary
322
- } from "../chunk-T6GEEMVC.js";
336
+ } from "../chunk-WVP6UQG3.js";
323
337
  import {
324
338
  backupFile,
325
339
  readJsonSafe
326
340
  } from "../chunk-QENTGE75.js";
327
341
  import {
328
342
  getBaseUrl
329
- } from "../chunk-MWBFB7WA.js";
343
+ } from "../chunk-LVDC3RUE.js";
330
344
  import {
331
345
  NPX_LATEST_COMMAND,
332
346
  renderCommandHelp
333
- } from "../chunk-T4IAMIX4.js";
347
+ } from "../chunk-5SFM6XB4.js";
334
348
  import {
335
349
  getPackageVersion,
336
350
  isNewerVersion,
@@ -348,7 +362,7 @@ import {
348
362
  isRecord,
349
363
  isTimeoutAction,
350
364
  isValidApiKey
351
- } from "../chunk-WACFIQYA.js";
365
+ } from "../chunk-GZL3KEPC.js";
352
366
 
353
367
  // bin/pushary-setup.ts
354
368
  import { existsSync, readFileSync, writeFileSync, mkdirSync, cpSync, rmSync, renameSync, realpathSync, statSync, openSync, readSync, closeSync } from "fs";
@@ -710,227 +724,6 @@ var fetchSetupWaitGuidance = async (apiKey) => {
710
724
  }
711
725
  };
712
726
 
713
- // src/setup/closing.ts
714
- var ACTIVITY_URL = "pushary.com/dashboard/agent/activity";
715
- var CHECK_THE_NOTIFICATION_OPENED = "Check the notification opened something you could tap, then:";
716
- var SEND_ANOTHER_TEST = "pushary doctor --roundtrip send another one";
717
- var sendAnotherTestLines = (appPlatforms) => {
718
- const step = notificationAnswerStep(appPlatforms);
719
- return step === null ? [CHECK_THE_NOTIFICATION_OPENED, SEND_ANOTHER_TEST] : [SEND_ANOTHER_TEST, step];
720
- };
721
- var TRANSCRIPT_SYNC_NOTICE = `Transcripts sync redacted and encrypted. Your phone can decrypt them; authorized Pushary compliance admins can recover them for documented legal obligations. Turn off: ${NPX_LATEST_COMMAND} setup --transcripts off`;
722
- var PAIR_PHONE_APP_HINT = `${NPX_LATEST_COMMAND} setup --connect app pair the Pushary app on your phone`;
723
- var RESTART_AGENTS_LINE = "Restart any open agent sessions so they pick up Pushary.";
724
- var ANSWERING_DEVICES = {
725
- mobile_app: "Your phone",
726
- mobile_background: "Your phone",
727
- mac_app: "Your Mac"
728
- };
729
- var SIMULATED_ANSWER_HEADLINE = "Agents configured. The test answer was simulated.";
730
- var answerSeconds = (latencyMs) => Math.max(1, Math.round(latencyMs / 1e3));
731
- var describeAnsweredHeadline = (answer) => {
732
- if (!answer) return "You're set. The test question was answered.";
733
- if (answer.answerSource === "sandbox") return SIMULATED_ANSWER_HEADLINE;
734
- const device = answer.answerSource ? ANSWERING_DEVICES[answer.answerSource] : void 0;
735
- const seconds = answerSeconds(answer.latencyMs);
736
- return device ? `You're set. ${device} answered in ${seconds}s.` : `You're set. The test question was answered in ${seconds}s.`;
737
- };
738
- var COMMAND_SURFACE = [
739
- { command: "pushary status", summary: "what this machine is connected to" },
740
- { command: "pushary mode", summary: "choose where approval requests appear" },
741
- { command: "pushary wait", summary: "show or set how long approvals wait for your phone" },
742
- { command: "pushary stats", summary: "what your agents have been asking" },
743
- { command: "pushary claude", summary: "run Claude Code with encrypted transcript support" },
744
- { command: "pushary doctor", summary: "check the install" }
745
- ];
746
- var SURFACE_COLUMN = Math.max(...COMMAND_SURFACE.map((entry) => entry.command.length)) + 2;
747
- var renderCommandSurface = () => COMMAND_SURFACE.map((entry) => `${entry.command.padEnd(SURFACE_COLUMN)}${entry.summary}`);
748
- var PHONE_START_VERIFIED_LINE = "Phone-start and steering: local and server checks passed just now. Recheck after sleep or network changes.";
749
- var PHONE_START_NOT_RUNNING_LINE = "Phone-start and steering: not running on this computer. Approvals do not depend on it. Run pushary doctor to see what is missing.";
750
- var PHONE_START_UNVERIFIED_LINE = "Phone-start and steering: unverified. Run pushary doctor to check the provider, background service and server route.";
751
- var phoneStartStatusLine = (facts) => {
752
- if (facts.managedControlReady === true) return PHONE_START_VERIFIED_LINE;
753
- if (facts.daemonReady === false) return PHONE_START_NOT_RUNNING_LINE;
754
- return PHONE_START_UNVERIFIED_LINE;
755
- };
756
- var phoneStartFailedTheRun = (facts) => facts.daemonReady === false && facts.phoneStartRequired !== false;
757
- var PHONE_START_UNVERIFIED_STEPS = [
758
- "Agent configuration and managed control are separate. Phone-start and steering could not be verified.",
759
- "pushary daemon install install or repair the background service",
760
- "pushary doctor verify it became reachable"
761
- ];
762
- var PHONE_START_CANNOT_RUN_LINE = "Agent configuration and managed control are separate. Phone-start cannot run on this computer yet; approvals do not depend on it.";
763
- var STOP_REQUIRING_PHONE_START_STEP = `${NPX_LATEST_COMMAND} setup --control off stop requiring phone-start on this computer`;
764
- var WHAT_PHONE_START_NEEDS = {
765
- provider: [
766
- "It needs Claude Code, Codex or Gemini CLI set up here with a command it can start, and setup found none.",
767
- "It looks for claude, codex and gemini on PATH and in npm's global folder, and for claude in Claude Code's own install folder too.",
768
- "Install one, or open a terminal where it runs, then run setup again."
769
- ],
770
- "service-manager": [
771
- "It needs a background service manager (launchd, systemd --user or Windows Task Scheduler), and this session has none.",
772
- "Run setup again from a normal desktop session."
773
- ]
774
- };
775
- var phoneStartProblemSteps = (missing) => missing ? [PHONE_START_CANNOT_RUN_LINE, ...WHAT_PHONE_START_NEEDS[missing], STOP_REQUIRING_PHONE_START_STEP] : PHONE_START_UNVERIFIED_STEPS;
776
- var nextSteps = (facts, reachable) => {
777
- const lines = ["Delivery follows the current approval mode, recipient rules and presence. pushary mode status shows the workspace setting.", phoneStartStatusLine(facts)];
778
- lines.push("Before stepping away, run pushary wait to see how long phone approvals wait and what happens if you do not answer.");
779
- if (facts.staleEnvironmentKey) {
780
- lines.push("Open a new terminal or unset PUSHARY_API_KEY, then run pushary doctor before starting an agent.");
781
- }
782
- if (facts.transcriptSync === false) {
783
- lines.push("Transcripts: disabled on this machine.");
784
- lines.push("pushary setup --transcripts on enable encrypted transcript sync");
785
- } else {
786
- lines.push(TRANSCRIPT_SYNC_NOTICE);
787
- }
788
- if (facts.completed.includes("claude_code")) {
789
- lines.push("pushary claude launch a managed Claude Code session");
790
- }
791
- if (!reachable) {
792
- lines.push(PAIR_PHONE_APP_HINT);
793
- }
794
- lines.push("pushary doctor re-check everything");
795
- return lines;
796
- };
797
- var describeClosing = (facts) => {
798
- const reachable = facts.reachChecked && facts.reachesYou;
799
- if (facts.configuredNothing) {
800
- return {
801
- ok: false,
802
- headline: "Setup failed.",
803
- next: ["Nothing was configured. Run pushary doctor to see why."],
804
- exitCode: EXIT.FAILED,
805
- reason: "configured-nothing"
806
- };
807
- }
808
- if (facts.failed.length > 0) {
809
- const count = facts.failed.length;
810
- return {
811
- ok: false,
812
- headline: `Setup finished with ${count} problem${count === 1 ? "" : "s"}.`,
813
- next: [
814
- ...nextSteps(facts, reachable),
815
- "For support: pushary doctor --bundle creates a redacted diagnostic with the last setup failure. Review it before sharing.",
816
- "",
817
- `Approvals: ${ACTIVITY_URL}`
818
- ],
819
- exitCode: EXIT.PROBLEMS_FOUND,
820
- reason: "agents-failed"
821
- };
822
- }
823
- if (facts.staleEnvironmentKey) {
824
- return {
825
- ok: false,
826
- headline: "Agents configured. This terminal still selects the previous key.",
827
- next: nextSteps(facts, reachable),
828
- exitCode: EXIT.PROBLEMS_FOUND,
829
- reason: "stale-environment-key"
830
- };
831
- }
832
- if (phoneStartFailedTheRun(facts)) {
833
- return {
834
- ok: false,
835
- headline: "Setup finished with 1 problem.",
836
- next: phoneStartProblemSteps(facts.phoneStartMissingPrerequisite),
837
- exitCode: EXIT.PROBLEMS_FOUND,
838
- reason: "control-unready"
839
- };
840
- }
841
- if (facts.roundTripAnswered === true) {
842
- return {
843
- ok: true,
844
- headline: describeAnsweredHeadline(facts.roundTripAnswer),
845
- next: [RESTART_AGENTS_LINE, ...nextSteps(facts, reachable), "", `Approvals: ${ACTIVITY_URL}`],
846
- exitCode: EXIT.OK,
847
- reason: "synthetic-answer"
848
- };
849
- }
850
- if (facts.reachChecked && !facts.reachesYou) {
851
- return {
852
- ok: false,
853
- headline: "Agents configured. Phone delivery is unverified.",
854
- next: [
855
- "Your agent configuration is saved. Once your phone is connected, run pushary doctor --roundtrip to finish verification without reinstalling.",
856
- "Approval routing depends on your mode, presence and recipients. Check the phone and its notification settings.",
857
- "",
858
- ...nextSteps(facts, false)
859
- ],
860
- exitCode: EXIT.NO_DEVICE,
861
- reason: "phone-unverified"
862
- };
863
- }
864
- if (facts.roundTripAnswered === false) {
865
- return {
866
- ok: false,
867
- headline: "Agents configured. Nobody answered the test question.",
868
- next: [
869
- "No answer returned from the synthetic test. Delivery acceptance does not prove a visible notification.",
870
- "",
871
- ...sendAnotherTestLines(facts.appPlatforms ?? []),
872
- "",
873
- "If you simply were not looking, re-run setup or pass --verify push to skip this check."
874
- ],
875
- exitCode: EXIT.PROBLEMS_FOUND,
876
- reason: "roundtrip-unanswered"
877
- };
878
- }
879
- if (!facts.reachChecked) {
880
- return {
881
- ok: true,
882
- headline: "Setup complete.",
883
- next: [
884
- "The phone check was skipped, so nothing here proves an approval reaches you.",
885
- "",
886
- ...nextSteps(facts, false)
887
- ],
888
- exitCode: EXIT.OK,
889
- reason: "phone-skipped"
890
- };
891
- }
892
- return {
893
- ok: true,
894
- headline: "Setup complete.",
895
- next: [...nextSteps(facts, true), "", `Approvals: ${ACTIVITY_URL}`],
896
- exitCode: EXIT.OK,
897
- reason: "complete"
898
- };
899
- };
900
- var RETRY_AGENT_LABEL = "Retry just this agent:";
901
- var INSTALL_NODE_STEP = "Install the current Node.js LTS, which includes npm, then run setup again.";
902
- var NPM_PREFIX_STEP = "npm can't install globally here. Use nvm, or run: npm config set prefix ~/.npm-global, then run setup again.";
903
- var NPM_FILE_IN_USE_STEP = "Close other terminals or editors that use Node, then run setup again.";
904
- var nextStepFor = (failure) => {
905
- switch (failure.remedy) {
906
- case "install-node":
907
- return { kind: "install-node", instruction: INSTALL_NODE_STEP };
908
- case "fix-npm-prefix":
909
- return { kind: "fix-npm-prefix", instruction: NPM_PREFIX_STEP };
910
- case "close-node-programs":
911
- return { kind: "close-node-programs", instruction: NPM_FILE_IN_USE_STEP };
912
- case "match-mac-account":
913
- return { kind: "match-mac-account", instruction: matchMacAccountStep(failure.agent, null) };
914
- case "retry-agent":
915
- return { kind: "retry-agent", command: retryAgentCommand(failure.agent) };
916
- }
917
- };
918
- var describeAgentFailures = (failures, agentName) => failures.map((failure) => ({
919
- summary: `${agentName(failure.agent)}: ${failure.detail}`,
920
- next: nextStepFor(failure)
921
- }));
922
- var agentFailureFollowUps = (failures) => [
923
- ...failures.some((failure) => failure.remedy === "install-node") ? ["install-node"] : [],
924
- ...failures.some((failure) => failure.remedy === "fix-npm-prefix") ? ["fix-npm-prefix"] : [],
925
- ...failures.some((failure) => failure.remedy === "close-node-programs") ? ["close-node-programs"] : [],
926
- ...failures.some((failure) => failure.remedy === "retry-agent") ? ["run-doctor"] : []
927
- ];
928
- var unverifiedKeyClosingReason = (facts) => {
929
- if (facts.failedCount > 0) return "agents-failed";
930
- if (facts.controlLifecycleFailed) return "control-unready";
931
- return facts.keyCheck === "locked" ? "plan-inactive" : "key-unverified";
932
- };
933
-
934
727
  // src/setup/codex-version.ts
935
728
  import { dirname, join as join2 } from "path";
936
729
  var parseCodexVersion = parseVersion;
@@ -3181,6 +2974,10 @@ var main = async () => {
3181
2974
  managedControlReady: !controlLifecycleFailure && managedControl.ready,
3182
2975
  daemonReady: controlLifecycleFailure ? false : daemonReady,
3183
2976
  phoneStartRequired: phoneStartIsRequired({ mode: controlMode, policy: controlPolicy, lifecycleFailed: controlLifecycleFailure !== null }),
2977
+ phoneStartService: phoneStartServiceState({
2978
+ lifecycleFailed: controlLifecycleFailure !== null,
2979
+ serviceIsRunning: daemonIsServing(readDaemonStatus())
2980
+ }),
3184
2981
  phoneStartMissingPrerequisite: controlMissingPrerequisite,
3185
2982
  transcriptSync,
3186
2983
  // null when the check did not run, so it changes nothing. Only an outright
@@ -1,17 +1,17 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  exitOnHelpFlag
4
- } from "../chunk-L66VPBS5.js";
4
+ } from "../chunk-M7NX25ZA.js";
5
5
  import {
6
6
  readLedgerSummary
7
- } from "../chunk-FLUKEZMH.js";
7
+ } from "../chunk-JYXIARGW.js";
8
8
  import "../chunk-KZERVKTD.js";
9
9
  import {
10
10
  getApiKey
11
- } from "../chunk-MWBFB7WA.js";
12
- import "../chunk-T4IAMIX4.js";
11
+ } from "../chunk-LVDC3RUE.js";
12
+ import "../chunk-5SFM6XB4.js";
13
13
  import "../chunk-QTOLNRET.js";
14
- import "../chunk-WACFIQYA.js";
14
+ import "../chunk-GZL3KEPC.js";
15
15
 
16
16
  // bin/pushary-stats.ts
17
17
  exitOnHelpFlag("stats");
@@ -1,41 +1,43 @@
1
1
  #!/usr/bin/env node
2
+ import {
3
+ fetchChannels
4
+ } from "../chunk-KW6EYFZV.js";
2
5
  import {
3
6
  describeReach,
4
- fetchChannels,
5
7
  reachVerdict
6
- } from "../chunk-ECQNBLPS.js";
8
+ } from "../chunk-CZULJ647.js";
7
9
  import "../chunk-3EGEA4KH.js";
8
10
  import {
9
11
  describeLastSeen,
10
12
  listMachines
11
- } from "../chunk-ILQARYXK.js";
13
+ } from "../chunk-CSQJCXPX.js";
12
14
  import {
13
15
  CONNECTED_THROUGH_MAC_APP,
14
16
  readMacAppConnectionWhenKeyless
15
- } from "../chunk-VRPDHJGB.js";
17
+ } from "../chunk-T2BEIPK2.js";
16
18
  import "../chunk-QCGNGEGE.js";
17
19
  import {
18
20
  SIGNED_OUT_ON_MAC_MESSAGE,
19
21
  activeKeyVerdictOf,
20
22
  describeSignedOutKey,
21
23
  readSignedOutDiagnosis
22
- } from "../chunk-V2AMLVMD.js";
23
- import "../chunk-JTQHC3RV.js";
24
+ } from "../chunk-4YNNAF53.js";
25
+ import "../chunk-T2AC5VFQ.js";
24
26
  import {
25
27
  createIo
26
28
  } from "../chunk-FO3MDD26.js";
27
29
  import {
28
30
  exitOnHelpFlag
29
- } from "../chunk-L66VPBS5.js";
30
- import "../chunk-DWV3LTUH.js";
31
- import "../chunk-7QAL23TB.js";
31
+ } from "../chunk-M7NX25ZA.js";
32
+ import "../chunk-3KOPY2UQ.js";
33
+ import "../chunk-LVWXRXT7.js";
32
34
  import "../chunk-VUFHYMSP.js";
33
- import "../chunk-WNVQPGLH.js";
34
- import "../chunk-DUACX6E3.js";
35
- import "../chunk-74DKFWU2.js";
36
- import "../chunk-VZ3YPEMG.js";
37
- import "../chunk-ZMRO6ESW.js";
38
- import "../chunk-4OXULVUA.js";
35
+ import "../chunk-XWY4UW62.js";
36
+ import "../chunk-QP3XPS5U.js";
37
+ import "../chunk-KSVCCSAO.js";
38
+ import "../chunk-ATUZX4K7.js";
39
+ import "../chunk-ECJJKDP7.js";
40
+ import "../chunk-QDFLBTUP.js";
39
41
  import {
40
42
  rejectUnknownFlags
41
43
  } from "../chunk-GMXKITVA.js";
@@ -43,33 +45,33 @@ import "../chunk-XHKBHWLX.js";
43
45
  import "../chunk-6ICPEJY5.js";
44
46
  import {
45
47
  readKeySource
46
- } from "../chunk-YBE2KH2U.js";
47
- import "../chunk-724266XT.js";
48
- import "../chunk-G63LBV4Y.js";
49
- import "../chunk-S3CQBNUU.js";
50
- import "../chunk-J5HQNZXQ.js";
51
- import "../chunk-WCPN3GVW.js";
48
+ } from "../chunk-IRZ5FVWG.js";
49
+ import "../chunk-RF74KBF5.js";
50
+ import "../chunk-QTCFEKLJ.js";
51
+ import "../chunk-XXNT4FGA.js";
52
+ import "../chunk-DQ565WFA.js";
53
+ import "../chunk-ZL3UR6M5.js";
52
54
  import "../chunk-POFBE6ZY.js";
53
55
  import {
54
56
  checkApiKey,
55
57
  describeKeyCheck
56
- } from "../chunk-5HRXOANL.js";
57
- import "../chunk-32MSOGMD.js";
58
- import "../chunk-SMMDQXI2.js";
58
+ } from "../chunk-S54YLXWW.js";
59
+ import "../chunk-5DZHKNBU.js";
60
+ import "../chunk-IJ6XKKQW.js";
59
61
  import {
60
62
  UsageError
61
63
  } from "../chunk-7QLSKOSU.js";
62
64
  import {
63
65
  EXIT
64
66
  } from "../chunk-KZERVKTD.js";
65
- import "../chunk-WW266XKU.js";
66
- import "../chunk-57EOP757.js";
67
- import "../chunk-T6GEEMVC.js";
67
+ import "../chunk-7RZO6VWD.js";
68
+ import "../chunk-MYBCXDIL.js";
69
+ import "../chunk-WVP6UQG3.js";
68
70
  import "../chunk-QENTGE75.js";
69
- import "../chunk-MWBFB7WA.js";
70
- import "../chunk-T4IAMIX4.js";
71
+ import "../chunk-LVDC3RUE.js";
72
+ import "../chunk-5SFM6XB4.js";
71
73
  import "../chunk-QTOLNRET.js";
72
- import "../chunk-WACFIQYA.js";
74
+ import "../chunk-GZL3KEPC.js";
73
75
 
74
76
  // src/status.ts
75
77
  var SIGNED_OUT_LINE = { label: "Server", value: "key signed out on this Mac", ok: false };