pushary 1.9.43 → 1.9.45

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 (105) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +1 -0
  3. package/dist/bin/pushary-bell-hook.js +26 -26
  4. package/dist/bin/pushary-bell.js +11 -11
  5. package/dist/bin/pushary-claude.js +33 -33
  6. package/dist/bin/pushary-clean.js +38 -38
  7. package/dist/bin/pushary-codex-bridge.js +22 -680
  8. package/dist/bin/pushary-codex-hook.js +32 -32
  9. package/dist/bin/pushary-codex-session.d.ts +1 -0
  10. package/dist/bin/pushary-codex-session.js +649 -0
  11. package/dist/bin/pushary-codex.js +12 -12
  12. package/dist/bin/pushary-connect.js +27 -27
  13. package/dist/bin/pushary-cowork.js +6 -6
  14. package/dist/bin/pushary-daemon.js +55 -55
  15. package/dist/bin/pushary-disconnect.js +26 -26
  16. package/dist/bin/pushary-doctor.js +84 -82
  17. package/dist/bin/pushary-elicitation-hook.js +26 -26
  18. package/dist/bin/pushary-gemini-bridge.js +15 -15
  19. package/dist/bin/pushary-gemini-hook.js +29 -29
  20. package/dist/bin/pushary-hook.js +32 -32
  21. package/dist/bin/pushary-login.js +16 -16
  22. package/dist/bin/pushary-logout.js +27 -27
  23. package/dist/bin/pushary-mcp.js +9 -9
  24. package/dist/bin/pushary-mode.js +14 -14
  25. package/dist/bin/pushary-notification-hook.js +25 -25
  26. package/dist/bin/pushary-opencode-hook.js +28 -28
  27. package/dist/bin/pushary-permission-denied-hook.js +30 -30
  28. package/dist/bin/pushary-permission-hook.js +29 -29
  29. package/dist/bin/pushary-post-hook.js +25 -25
  30. package/dist/bin/pushary-prompt-hook.js +25 -25
  31. package/dist/bin/pushary-session-end-hook.js +25 -25
  32. package/dist/bin/pushary-session-start-hook.js +30 -30
  33. package/dist/bin/pushary-setup.js +164 -112
  34. package/dist/bin/pushary-stats.js +5 -5
  35. package/dist/bin/pushary-status.js +34 -34
  36. package/dist/bin/pushary-stop-hook.js +25 -25
  37. package/dist/bin/pushary-stopfailure-hook.js +25 -25
  38. package/dist/bin/pushary-suggestions.js +14 -14
  39. package/dist/bin/pushary-transcript-register.js +18 -18
  40. package/dist/bin/pushary-transcripts.js +7 -7
  41. package/dist/bin/pushary-upgrade.js +41 -41
  42. package/dist/bin/pushary-wait.js +14 -14
  43. package/dist/bin/pushary.js +7 -6
  44. package/dist/{chunk-HC4DQXAT.js → chunk-2DORVRDB.js} +2 -2
  45. package/dist/{chunk-C6QBNBL4.js → chunk-2FUHSKXH.js} +7 -7
  46. package/dist/{chunk-45W43U2Q.js → chunk-2SXXH6JY.js} +5 -5
  47. package/dist/{chunk-JE6GG3OV.js → chunk-335ZDJ7R.js} +1 -1
  48. package/dist/{chunk-S4QT3YFG.js → chunk-3PM62C2R.js} +15 -15
  49. package/dist/{chunk-Y3N3SYBX.js → chunk-46F4BRUQ.js} +1 -1
  50. package/dist/{chunk-W3BO56VE.js → chunk-4A6VUVXV.js} +1 -1
  51. package/dist/{chunk-LDCRV6HG.js → chunk-57M4ERJK.js} +2 -1
  52. package/dist/{chunk-IMD5FN6Y.js → chunk-5DCZL3BC.js} +3 -3
  53. package/dist/chunk-6JPDAUFP.js +866 -0
  54. package/dist/{chunk-H6V5S52A.js → chunk-6TYKZ4DN.js} +3 -3
  55. package/dist/{chunk-VQL62ECJ.js → chunk-7SGYCU5C.js} +1 -1
  56. package/dist/{chunk-SATOTPXW.js → chunk-7URSJMAB.js} +1 -1
  57. package/dist/{chunk-PIZ65U3D.js → chunk-ASK2MSD2.js} +5 -5
  58. package/dist/{chunk-SCYAXV7U.js → chunk-AUOSFZJ3.js} +7 -7
  59. package/dist/{chunk-LOUZNXTJ.js → chunk-BT57FUMT.js} +2 -2
  60. package/dist/{chunk-4T2TGP4T.js → chunk-CDERSTBO.js} +94 -7
  61. package/dist/{chunk-LAAOHBLO.js → chunk-CFMCV6Z7.js} +2 -2
  62. package/dist/{chunk-ENGASUEL.js → chunk-DSGB5JLG.js} +4 -4
  63. package/dist/{chunk-ZJXEQV3A.js → chunk-ECFEYB6Z.js} +1 -1
  64. package/dist/{chunk-CIERFMQT.js → chunk-EH5ZDG6V.js} +4 -4
  65. package/dist/{chunk-IDVKJICN.js → chunk-EKGQEDQ4.js} +3 -11
  66. package/dist/{chunk-GTOBOC6M.js → chunk-EWC4P4ZL.js} +1 -1
  67. package/dist/{chunk-F7SZ2RCK.js → chunk-FOUK4CBO.js} +4 -4
  68. package/dist/{chunk-LE2YVPAT.js → chunk-GQ5KCVGK.js} +11 -11
  69. package/dist/{chunk-YRE6GUFZ.js → chunk-GZSSAY6N.js} +75 -161
  70. package/dist/{chunk-LWW7SBK3.js → chunk-H4ODQD3Y.js} +2 -2
  71. package/dist/{chunk-O7ADPLBF.js → chunk-HHX6IRSH.js} +1 -1
  72. package/dist/{chunk-H64CU2VB.js → chunk-IFT3GU7Y.js} +2 -2
  73. package/dist/{chunk-FPJHS6PA.js → chunk-IKYI63RF.js} +6 -6
  74. package/dist/{chunk-S3OWTQ6Z.js → chunk-IOVJVGIT.js} +12 -5
  75. package/dist/{chunk-RXXKFM22.js → chunk-K7EGWMDU.js} +370 -138
  76. package/dist/{chunk-AVT7GPOF.js → chunk-KS7NA5CK.js} +10 -10
  77. package/dist/{chunk-A64UCGX3.js → chunk-N2K3BSCA.js} +5 -5
  78. package/dist/{chunk-ZORCUL3Z.js → chunk-NJN5NRHZ.js} +4 -4
  79. package/dist/{chunk-Q7CUTGT4.js → chunk-OHFC3GJY.js} +1 -1
  80. package/dist/{chunk-JW4S4O4W.js → chunk-P2F3JUFX.js} +4 -4
  81. package/dist/{chunk-C54VJJ37.js → chunk-PWUIPQ2I.js} +3 -3
  82. package/dist/{chunk-F5ALKPNS.js → chunk-QQXP3CQA.js} +1 -1
  83. package/dist/{chunk-EA5NWDK7.js → chunk-R7ZQHAVL.js} +29 -0
  84. package/dist/{chunk-V5SUKRRI.js → chunk-RBJWPUI6.js} +4 -4
  85. package/dist/{chunk-J6MVBWF2.js → chunk-RFQWB5ZV.js} +1 -1
  86. package/dist/{chunk-NKBAEGT7.js → chunk-S6EGJBI5.js} +1 -1
  87. package/dist/{chunk-53KLSE2F.js → chunk-SFQSOBLM.js} +3 -3
  88. package/dist/{chunk-MSUMSXTI.js → chunk-SIN7NJD7.js} +1 -1
  89. package/dist/{chunk-55FB6OSG.js → chunk-U45OINYS.js} +1 -1
  90. package/dist/{chunk-TH74SUVV.js → chunk-U6Z56IQS.js} +2 -2
  91. package/dist/{chunk-JJWG7CBT.js → chunk-VO6XI6AX.js} +3 -3
  92. package/dist/{chunk-VIVLJK3T.js → chunk-WDIX4XZH.js} +2 -2
  93. package/dist/{chunk-Y4VZYKSW.js → chunk-WM76AN4X.js} +11 -11
  94. package/dist/{chunk-NV2LARV4.js → chunk-WPPKXVV3.js} +2 -2
  95. package/dist/{chunk-VGPEXMYM.js → chunk-XFHISCJM.js} +42 -7
  96. package/dist/{chunk-C3RVRTHS.js → chunk-YK7FGPYS.js} +3 -3
  97. package/dist/{chunk-JB4JCGRW.js → chunk-YWIFK2UB.js} +2 -2
  98. package/dist/{chunk-O4SYJVAF.js → chunk-YXGWG5PO.js} +5 -5
  99. package/dist/{chunk-XLHFWG2E.js → chunk-ZSY6BWUD.js} +2 -2
  100. package/dist/{global-upgrade-FFWOHOJ4.js → global-upgrade-U6NWZA5W.js} +6 -6
  101. package/dist/{paths-Y2WPCM5Y.js → paths-IQTB3ZZI.js} +2 -2
  102. package/dist/{reapply-N3MV3CKD.js → reapply-LILGWJO3.js} +21 -21
  103. package/dist/src/index.js +19 -19
  104. package/dist/{upgrade-lock-ZXXNRH2P.js → upgrade-lock-2BVFIDU4.js} +3 -3
  105. package/package.json +5 -2
@@ -1,36 +1,56 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runBrowserLogin
4
- } from "../chunk-F5ALKPNS.js";
4
+ } from "../chunk-QQXP3CQA.js";
5
5
  import {
6
6
  coworkOutput,
7
7
  coworkSelection
8
- } from "../chunk-JJWG7CBT.js";
8
+ } from "../chunk-VO6XI6AX.js";
9
9
  import "../chunk-PUZZELE6.js";
10
10
  import {
11
11
  clearDeclinedAgent,
12
12
  declinedAgentForSetupChoice
13
- } from "../chunk-VIVLJK3T.js";
13
+ } from "../chunk-WDIX4XZH.js";
14
14
  import {
15
15
  CURSOR_GATE_SCRIPT,
16
16
  describeVersionManagerPin,
17
+ saveSetupFailure,
17
18
  versionManagerOf
18
- } from "../chunk-EA5NWDK7.js";
19
+ } from "../chunk-R7ZQHAVL.js";
19
20
  import {
20
21
  codexTrustOutcome,
21
22
  describeCodexTrustConfirmation,
22
23
  needsCodexTrustStep
23
- } from "../chunk-HC4DQXAT.js";
24
+ } from "../chunk-2DORVRDB.js";
25
+ import {
26
+ describeWaitLadder
27
+ } from "../chunk-CVWG2N3Y.js";
24
28
  import {
25
29
  writeStdoutFully
26
30
  } from "../chunk-EO23EUOK.js";
27
31
  import {
28
- ensureCodexTrustsPusharyHooks
29
- } from "../chunk-TH74SUVV.js";
32
+ BROWSER_CONNECT_COMMAND,
33
+ confirmAppConnection,
34
+ connectDevice,
35
+ connectViaAppPairing,
36
+ describeRoundTripOutcome,
37
+ pairingEscapeApplies,
38
+ printConnectInstructions,
39
+ roundTripEvidence,
40
+ verifyRoundTrip,
41
+ waitForYourPhone
42
+ } from "../chunk-2FUHSKXH.js";
43
+ import "../chunk-3EGEA4KH.js";
30
44
  import {
31
45
  readManagedControlEvidence,
32
46
  waitForMachineReadiness
33
- } from "../chunk-LE2YVPAT.js";
47
+ } from "../chunk-GQ5KCVGK.js";
48
+ import {
49
+ ensureCodexTrustsPusharyHooks
50
+ } from "../chunk-U6Z56IQS.js";
51
+ import {
52
+ setHumanStream
53
+ } from "../chunk-QCGNGEGE.js";
34
54
  import {
35
55
  describeSetupSideEffects,
36
56
  installAgentSkill,
@@ -44,7 +64,7 @@ import {
44
64
  soleGateFile,
45
65
  soleGateReceipt,
46
66
  soleGateReceiptFile
47
- } from "../chunk-ENGASUEL.js";
67
+ } from "../chunk-DSGB5JLG.js";
48
68
  import {
49
69
  HERMES_PIP_PACKAGE,
50
70
  describeDetection,
@@ -57,7 +77,11 @@ import {
57
77
  runHermesConfigScript,
58
78
  shortenHome,
59
79
  vscodeSettingsTargets
60
- } from "../chunk-ZORCUL3Z.js";
80
+ } from "../chunk-NJN5NRHZ.js";
81
+ import {
82
+ mcpServerBearer,
83
+ readMacAppAgentKey
84
+ } from "../chunk-FOUK4CBO.js";
61
85
  import {
62
86
  AgentConfigError,
63
87
  FX_PUSHARY_TOOLS_RULE,
@@ -82,64 +106,13 @@ import {
82
106
  retryAgentCommand,
83
107
  withFxPusharyServer,
84
108
  writeFxProfile,
85
- writeInstructionBlock
86
- } from "../chunk-VGPEXMYM.js";
109
+ writeInstructionBlock,
110
+ writeSetupConfigFile,
111
+ writeSetupConfigJson
112
+ } from "../chunk-XFHISCJM.js";
87
113
  import {
88
114
  MCP_BRIDGE_BINARY
89
- } from "../chunk-LOUZNXTJ.js";
90
- import {
91
- checkCodexInstall,
92
- detectProviderLiveCapabilities,
93
- expectedLaunchCapabilities,
94
- hasSpawnProvider,
95
- nodeCodexInstallProbe,
96
- resolveControlPolicy
97
- } from "../chunk-NV2LARV4.js";
98
- import {
99
- detectClaudeVersion
100
- } from "../chunk-RIVNNBEK.js";
101
- import {
102
- describeAutoUpdateAnnouncement,
103
- takeAutoUpdateAnnouncement
104
- } from "../chunk-H64CU2VB.js";
105
- import {
106
- DAEMON_COLD_START_TIMEOUT_MS,
107
- clearDaemonNeedsLogin,
108
- daemonHasRemoteProof,
109
- daemonServiceDefinitionPath,
110
- daemonServiceManagerAvailable,
111
- disableDaemonService,
112
- ensureDaemonRunning,
113
- hasDaemonServiceDefinition,
114
- readDaemonStatus,
115
- replaceDaemonService,
116
- stopDaemonService,
117
- waitForDaemonRemoteProof
118
- } from "../chunk-SCYAXV7U.js";
119
- import {
120
- transcriptPreferenceForSetup
121
- } from "../chunk-VQL62ECJ.js";
122
- import "../chunk-XHKBHWLX.js";
123
- import {
124
- BROWSER_CONNECT_COMMAND,
125
- confirmAppConnection,
126
- connectDevice,
127
- connectViaAppPairing,
128
- describeRoundTripOutcome,
129
- pairingEscapeApplies,
130
- printConnectInstructions,
131
- roundTripEvidence,
132
- verifyRoundTrip,
133
- waitForYourPhone
134
- } from "../chunk-C6QBNBL4.js";
135
- import "../chunk-3EGEA4KH.js";
136
- import {
137
- setHumanStream
138
- } from "../chunk-QCGNGEGE.js";
139
- import {
140
- mcpServerBearer,
141
- readMacAppAgentKey
142
- } from "../chunk-F7SZ2RCK.js";
115
+ } from "../chunk-BT57FUMT.js";
143
116
  import {
144
117
  OPENCODE_HOOK_BINARY,
145
118
  addOpenCodeMcpServer,
@@ -155,12 +128,16 @@ import {
155
128
  openCodePluginDir,
156
129
  openCodePluginFile,
157
130
  openCodeWired
158
- } from "../chunk-O4SYJVAF.js";
131
+ } from "../chunk-YXGWG5PO.js";
159
132
  import {
160
133
  ansiPainter,
161
134
  createIo,
162
135
  useColor
163
136
  } from "../chunk-FO3MDD26.js";
137
+ import {
138
+ describeAutoUpdateAnnouncement,
139
+ takeAutoUpdateAnnouncement
140
+ } from "../chunk-IFT3GU7Y.js";
164
141
  import {
165
142
  addClaudeMcpServer,
166
143
  addCompatibleHooks,
@@ -179,7 +156,21 @@ import {
179
156
  hasCompatibleHooks,
180
157
  isClaudeMcpSnapshot,
181
158
  updateClaudeMcpSnapshot
182
- } from "../chunk-V5SUKRRI.js";
159
+ } from "../chunk-RBJWPUI6.js";
160
+ import {
161
+ DAEMON_COLD_START_TIMEOUT_MS,
162
+ clearDaemonNeedsLogin,
163
+ daemonHasRemoteProof,
164
+ daemonServiceDefinitionPath,
165
+ daemonServiceManagerAvailable,
166
+ disableDaemonService,
167
+ ensureDaemonRunning,
168
+ hasDaemonServiceDefinition,
169
+ readDaemonStatus,
170
+ replaceDaemonService,
171
+ stopDaemonService,
172
+ waitForDaemonRemoteProof
173
+ } from "../chunk-AUOSFZJ3.js";
183
174
  import {
184
175
  KEEP_HINT,
185
176
  captureHookTakeover,
@@ -191,25 +182,24 @@ import {
191
182
  geminiWired,
192
183
  planHooks,
193
184
  pusharyHookExecutable
194
- } from "../chunk-PIZ65U3D.js";
185
+ } from "../chunk-ASK2MSD2.js";
195
186
  import {
196
187
  GEMINI_HOOK_BINARY,
197
188
  GEMINI_HOOK_EVENTS,
198
189
  addGeminiHooks,
199
190
  addGeminiMcpServer
200
- } from "../chunk-IMD5FN6Y.js";
191
+ } from "../chunk-5DCZL3BC.js";
201
192
  import {
202
193
  AGENT_CHOICES,
203
194
  effectiveControlMode,
204
195
  effectiveVerify,
205
196
  parseSetupOptions
206
- } from "../chunk-Q7CUTGT4.js";
207
- import "../chunk-55FB6OSG.js";
197
+ } from "../chunk-OHFC3GJY.js";
198
+ import "../chunk-U45OINYS.js";
208
199
  import "../chunk-GMXKITVA.js";
209
200
  import {
210
- compareVersion,
211
- parseVersion
212
- } from "../chunk-6ICPEJY5.js";
201
+ transcriptPreferenceForSetup
202
+ } from "../chunk-7SGYCU5C.js";
213
203
  import {
214
204
  KEY_FILE_MODE,
215
205
  exportLine,
@@ -222,28 +212,44 @@ import {
222
212
  recordMacAppKeyPrefix,
223
213
  resolveShellRc,
224
214
  writeKey
225
- } from "../chunk-C3RVRTHS.js";
215
+ } from "../chunk-YK7FGPYS.js";
216
+ import {
217
+ checkCodexInstall,
218
+ detectProviderLiveCapabilities,
219
+ expectedLaunchCapabilities,
220
+ hasSpawnProvider,
221
+ nodeCodexInstallProbe,
222
+ resolveControlPolicy
223
+ } from "../chunk-WPPKXVV3.js";
224
+ import {
225
+ detectClaudeVersion
226
+ } from "../chunk-RIVNNBEK.js";
227
+ import "../chunk-XHKBHWLX.js";
228
+ import {
229
+ compareVersion,
230
+ parseVersion
231
+ } from "../chunk-6ICPEJY5.js";
226
232
  import {
227
233
  reportEvent
228
- } from "../chunk-YRE6GUFZ.js";
229
- import "../chunk-O7ADPLBF.js";
230
- import "../chunk-4T2TGP4T.js";
234
+ } from "../chunk-GZSSAY6N.js";
235
+ import "../chunk-HHX6IRSH.js";
236
+ import "../chunk-CFMCV6Z7.js";
237
+ import "../chunk-CDERSTBO.js";
231
238
  import "../chunk-POFBE6ZY.js";
232
- import "../chunk-53KLSE2F.js";
239
+ import "../chunk-SFQSOBLM.js";
233
240
  import {
234
241
  checkApiKey,
235
242
  describeKeyCheck,
236
243
  samePusharyAccount
237
- } from "../chunk-C54VJJ37.js";
238
- import "../chunk-H6V5S52A.js";
239
- import "../chunk-W3BO56VE.js";
244
+ } from "../chunk-PWUIPQ2I.js";
245
+ import "../chunk-6TYKZ4DN.js";
246
+ import "../chunk-4A6VUVXV.js";
240
247
  import {
241
248
  UsageError
242
249
  } from "../chunk-7QLSKOSU.js";
243
250
  import {
244
251
  EXIT
245
252
  } from "../chunk-KZERVKTD.js";
246
- import "../chunk-LAAOHBLO.js";
247
253
  import {
248
254
  NpmMissingError,
249
255
  addCodexHookTrust,
@@ -288,18 +294,18 @@ import {
288
294
  resolveGlobalBinary,
289
295
  vscodePluginDir,
290
296
  vscodePluginMcp
291
- } from "../chunk-S3OWTQ6Z.js";
297
+ } from "../chunk-IOVJVGIT.js";
292
298
  import {
293
299
  backupFile,
294
- readJsonSafe,
295
- writeFileAtomic,
296
- writeJsonAtomic
300
+ readJsonSafe
297
301
  } from "../chunk-AQFEP65J.js";
298
- import "../chunk-GTOBOC6M.js";
302
+ import {
303
+ getBaseUrl
304
+ } from "../chunk-EWC4P4ZL.js";
299
305
  import {
300
306
  NPX_LATEST_COMMAND,
301
307
  renderCommandHelp
302
- } from "../chunk-LDCRV6HG.js";
308
+ } from "../chunk-57M4ERJK.js";
303
309
  import {
304
310
  HOOK_COMPATIBLE_PROFILES,
305
311
  PRETOOLUSE_GATED_TOOLS,
@@ -307,13 +313,15 @@ import {
307
313
  computerOsOfPlatform,
308
314
  getPackageVersion,
309
315
  hookCompatibleProfile,
316
+ isApprovalMode,
310
317
  isComputerAgent,
311
318
  isNewerVersion,
312
319
  isRecord,
320
+ isTimeoutAction,
313
321
  isValidApiKey,
314
322
  launchedPackage,
315
323
  ownPackageName
316
- } from "../chunk-RXXKFM22.js";
324
+ } from "../chunk-K7EGWMDU.js";
317
325
 
318
326
  // bin/pushary-setup.ts
319
327
  import { existsSync, readFileSync, writeFileSync, mkdirSync, cpSync, rmSync, renameSync, realpathSync, statSync, openSync, readSync, closeSync } from "fs";
@@ -622,6 +630,39 @@ var planPhoneCheck = (context) => {
622
630
  return "connect";
623
631
  };
624
632
 
633
+ // src/setup/wait-guidance.ts
634
+ var UNAVAILABLE = "Approval settings unavailable. Run pushary wait before stepping away.";
635
+ var isPolicyRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
636
+ var isWaitSeconds = (value) => typeof value === "number" && Number.isFinite(value) && value >= 0;
637
+ var setupWaitGuidance = (value) => {
638
+ if (!isPolicyRecord(value) || !Array.isArray(value.policies)) return UNAVAILABLE;
639
+ if (value.modeOverride != null && !isApprovalMode(value.modeOverride)) return UNAVAILABLE;
640
+ const rule = value.policies.find((row) => isPolicyRecord(row) && row.tool === "*") ?? {
641
+ mode: value.defaultMode,
642
+ pushFirstSeconds: value.defaultPushFirstSeconds,
643
+ timeoutSeconds: value.defaultTimeoutSeconds,
644
+ timeoutAction: value.defaultTimeoutAction
645
+ };
646
+ if (!isPolicyRecord(rule) || !isApprovalMode(rule.mode) || !isTimeoutAction(rule.timeoutAction) || !isWaitSeconds(rule.pushFirstSeconds) || !isWaitSeconds(rule.timeoutSeconds)) return UNAVAILABLE;
647
+ const mode = value.modeOverride ?? rule.mode;
648
+ if (!isApprovalMode(mode)) return UNAVAILABLE;
649
+ let behavior = describeWaitLadder({ tool: "*", mode, pushFirstSeconds: rule.pushFirstSeconds, timeoutSeconds: rule.timeoutSeconds, timeoutAction: rule.timeoutAction });
650
+ if (rule.timeoutSeconds === 0 && rule.timeoutAction === "approve") behavior = "auto-approve";
651
+ if (rule.timeoutSeconds === 0 && rule.timeoutAction === "deny") behavior = "auto-deny";
652
+ return `Workspace default: ${behavior}. Agent, repository and tool rules can differ. Run pushary wait to inspect the rules.`;
653
+ };
654
+ var fetchSetupWaitGuidance = async (apiKey) => {
655
+ try {
656
+ const response = await fetch(`${getBaseUrl()}/api/mcp/policy`, {
657
+ headers: { Authorization: `Bearer ${apiKey}` },
658
+ signal: AbortSignal.timeout(5e3)
659
+ });
660
+ return response.ok ? setupWaitGuidance(await response.json()) : UNAVAILABLE;
661
+ } catch {
662
+ return UNAVAILABLE;
663
+ }
664
+ };
665
+
625
666
  // src/setup/closing.ts
626
667
  var ACTIVITY_URL = "pushary.com/dashboard/agent/activity";
627
668
  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`;
@@ -653,6 +694,7 @@ var SURFACE_COLUMN = Math.max(...COMMAND_SURFACE.map((entry) => entry.command.le
653
694
  var renderCommandSurface = () => COMMAND_SURFACE.map((entry) => `${entry.command.padEnd(SURFACE_COLUMN)}${entry.summary}`);
654
695
  var nextSteps = (facts, reachable) => {
655
696
  const lines = ["Delivery follows the current approval mode, recipient rules and presence. pushary mode status shows the workspace setting.", facts.managedControlReady === true ? "Phone-start and steering: local and server checks passed just now. Recheck after sleep or network changes." : "Phone-start and steering: unverified. Run pushary doctor to check the provider, background service and server route."];
697
+ lines.push("Before stepping away, run pushary wait to see how long phone approvals wait and what happens if you do not answer.");
656
698
  if (facts.staleEnvironmentKey) {
657
699
  lines.push("Open a new terminal or unset PUSHARY_API_KEY, then run pushary doctor before starting an agent.");
658
700
  }
@@ -689,6 +731,7 @@ var describeClosing = (facts) => {
689
731
  headline: `Setup finished with ${count} problem${count === 1 ? "" : "s"}.`,
690
732
  next: [
691
733
  ...nextSteps(facts, reachable),
734
+ "For support: pushary doctor --bundle creates a redacted diagnostic with the last setup failure. Review it before sharing.",
692
735
  "",
693
736
  `Approvals: ${ACTIVITY_URL}`
694
737
  ],
@@ -732,6 +775,7 @@ var describeClosing = (facts) => {
732
775
  ok: false,
733
776
  headline: "Agents configured. Phone delivery is unverified.",
734
777
  next: [
778
+ "Your agent configuration is saved. Once your phone is connected, run pushary doctor --roundtrip to finish verification without reinstalling.",
735
779
  "Approval routing depends on your mode, presence and recipients. Check the phone and its notification settings.",
736
780
  "",
737
781
  ...nextSteps(facts, false)
@@ -911,7 +955,16 @@ var recordCodexTrust = (outcome) => {
911
955
  var emitted = false;
912
956
  var SETUP_COMPLETED_EVENT = "agent_setup_completed";
913
957
  var SETUP_AGENT_TYPE = "setup";
914
- var defaultDeps = { report: reportEvent };
958
+ var defaultDeps = {
959
+ report: async (event, options) => {
960
+ try {
961
+ saveSetupFailure({ ...event });
962
+ } catch {
963
+ process.stderr.write("[pushary] Could not save the local setup diagnostic. Keep the setup output for support.\n");
964
+ }
965
+ return reportEvent(event, options);
966
+ }
967
+ };
915
968
  var completeBeacon = (run) => ({
916
969
  ...run,
917
970
  codexTrust: recordedCodexTrust,
@@ -1090,9 +1143,7 @@ var readAgentJson = (filePath) => {
1090
1143
  );
1091
1144
  };
1092
1145
  var writeJson = (filePath, data) => {
1093
- const dir = dirname2(filePath);
1094
- if (!existsSync(dir)) mkdirSync(dir, { recursive: true });
1095
- writeFileSync(filePath, JSON.stringify(data, null, 2) + "\n", "utf-8");
1146
+ writeSetupConfigJson(filePath, data);
1096
1147
  };
1097
1148
  var readAgentToml = (filePath) => {
1098
1149
  let raw;
@@ -1202,7 +1253,7 @@ var setupClaudeCode = async (apiKey) => {
1202
1253
  }
1203
1254
  mcpSnapshot = updateClaudeMcpSnapshot(mcpReceipt.value, apiKey);
1204
1255
  }
1205
- writeJsonAtomic(CLAUDE_MCP_RECEIPT, mcpSnapshot, 384);
1256
+ writeSetupConfigJson(CLAUDE_MCP_RECEIPT, mcpSnapshot, 384);
1206
1257
  await spinner("Adding MCP server (type: http)", async () => {
1207
1258
  addClaudeMcpServer(claudeJson2, apiKey);
1208
1259
  });
@@ -1213,10 +1264,10 @@ var setupClaudeCode = async (apiKey) => {
1213
1264
  addPusharyHooks(settings, resolveGlobalBinDir("pushary-hook"), detectClaudeVersion());
1214
1265
  });
1215
1266
  await spinner(`Writing ${CLAUDE_JSON}`, async () => {
1216
- writeJsonAtomic(CLAUDE_JSON, claudeJson2, 384);
1267
+ writeSetupConfigJson(CLAUDE_JSON, claudeJson2, 384);
1217
1268
  });
1218
1269
  await spinner(`Writing ${CLAUDE_SETTINGS}`, async () => {
1219
- writeJsonAtomic(CLAUDE_SETTINGS, settings);
1270
+ writeSetupConfigJson(CLAUDE_SETTINGS, settings);
1220
1271
  });
1221
1272
  await installSkill("claude-code", CLAUDE_SKILL_DIR);
1222
1273
  console.log();
@@ -1388,7 +1439,7 @@ var removeCodexNotifyEntry = (codexConfig) => {
1388
1439
  } else {
1389
1440
  config.notify = filtered;
1390
1441
  }
1391
- writeFileSync(codexConfig, stringifyTOML(config), "utf-8");
1442
+ writeSetupConfigFile(codexConfig, stringifyTOML(config), KEY_FILE_MODE);
1392
1443
  };
1393
1444
  var addCodexNotifyEntry = (codexConfig) => {
1394
1445
  const pusharyCodexPath = resolveGlobalBinary("pushary-codex") ?? "pushary-codex";
@@ -1402,7 +1453,7 @@ var addCodexNotifyEntry = (codexConfig) => {
1402
1453
  if (!notify.some((n) => typeof n === "string" && n.includes("pushary-codex"))) {
1403
1454
  notify.push(pusharyCodexPath);
1404
1455
  config.notify = notify;
1405
- writeFileSync(codexConfig, stringifyTOML(config), "utf-8");
1456
+ writeSetupConfigFile(codexConfig, stringifyTOML(config), KEY_FILE_MODE);
1406
1457
  }
1407
1458
  };
1408
1459
  var confirmCodexTrust = async () => {
@@ -1443,7 +1494,7 @@ var setupCodex = async (apiKey) => {
1443
1494
  await spinner("Adding Pushary MCP server (key embedded, auto-allowed)", async () => {
1444
1495
  const config = readAgentToml(codexConfig);
1445
1496
  addCodexMcpServer(config, apiKey);
1446
- writeFileAtomic(codexConfig, stringifyTOML(config), KEY_FILE_MODE);
1497
+ writeSetupConfigFile(codexConfig, stringifyTOML(config), KEY_FILE_MODE);
1447
1498
  });
1448
1499
  const codexVersion = detectCodexVersion();
1449
1500
  const hooksSupported = codexSupportsHooks(codexVersion);
@@ -1468,7 +1519,7 @@ var setupCodex = async (apiKey) => {
1468
1519
  const config = raw ? parseTOML(raw) : {};
1469
1520
  dropVacatedCodexHookTrust(config, CODEX_HOOKS_JSON, vacated);
1470
1521
  addCodexHookTrust(config, CODEX_HOOKS_JSON, hookCommand, hookPositions);
1471
- writeFileSync(codexConfig, stringifyTOML(config), "utf-8");
1522
+ writeSetupConfigFile(codexConfig, stringifyTOML(config), KEY_FILE_MODE);
1472
1523
  portedTrustWritten = true;
1473
1524
  }, { optional: true });
1474
1525
  await spinner("Removing legacy notify handler", async () => {
@@ -1632,7 +1683,7 @@ var setupCursor = async (apiKey) => {
1632
1683
  if (servers.pushary) {
1633
1684
  servers.pushary.headers = { ...servers.pushary.headers, Authorization: `Bearer ${apiKey}` };
1634
1685
  mcp.mcpServers = servers;
1635
- writeJsonAtomic(mcpPath, mcp, KEY_FILE_MODE);
1686
+ writeSetupConfigJson(mcpPath, mcp, KEY_FILE_MODE);
1636
1687
  }
1637
1688
  });
1638
1689
  await spinner("Registering permission gate (~/.cursor/hooks.json)", async () => {
@@ -1676,7 +1727,7 @@ var registerVsCodePlugin = (pluginDir) => {
1676
1727
  }
1677
1728
  if (current !== null) backupFile(settingsPath);
1678
1729
  mkdirSync(dirname2(settingsPath), { recursive: true });
1679
- writeFileAtomic(settingsPath, result.content);
1730
+ writeSetupConfigFile(settingsPath, result.content);
1680
1731
  written.push(settingsPath);
1681
1732
  }
1682
1733
  return { written, manual };
@@ -1721,7 +1772,7 @@ var setupVsCode = async (apiKey) => {
1721
1772
  if (servers.pushary) {
1722
1773
  servers.pushary.headers = { ...servers.pushary.headers, Authorization: `Bearer ${apiKey}` };
1723
1774
  mcp.mcpServers = servers;
1724
- writeJsonAtomic(mcpPath, mcp, KEY_FILE_MODE);
1775
+ writeSetupConfigJson(mcpPath, mcp, KEY_FILE_MODE);
1725
1776
  }
1726
1777
  pinGuardedVsCodeGate(VSCODE_PLUGIN_DIR);
1727
1778
  });
@@ -1921,7 +1972,7 @@ var setupGemini = async (apiKey) => {
1921
1972
  addGeminiHooks(settings, guardBinary(resolveGlobalBinary(GEMINI_HOOK_BINARY) ?? GEMINI_HOOK_BINARY));
1922
1973
  });
1923
1974
  await spinner(`Writing ${GEMINI_SETTINGS}`, async () => {
1924
- writeJsonAtomic(GEMINI_SETTINGS, settings, KEY_FILE_MODE);
1975
+ writeSetupConfigJson(GEMINI_SETTINGS, settings, KEY_FILE_MODE);
1925
1976
  });
1926
1977
  await spinner("Teaching Gemini to ask via push (~/.gemini/GEMINI.md)", async () => {
1927
1978
  writeInstructionBlock(GEMINI_MD, renderAgentInstructions("Gemini"));
@@ -1953,7 +2004,7 @@ var setupOpenCode = async (apiKey) => {
1953
2004
  await spinner(`Adding MCP server (${openCodeConfigFile()})`, async () => {
1954
2005
  const config = readAgentJson(openCodeConfigFile());
1955
2006
  addOpenCodeMcpServer(config, apiKey);
1956
- writeJsonAtomic(openCodeConfigFile(), config, KEY_FILE_MODE);
2007
+ writeSetupConfigJson(openCodeConfigFile(), config, KEY_FILE_MODE);
1957
2008
  });
1958
2009
  await spinner("Teaching OpenCode to ask via push", async () => {
1959
2010
  writeInstructionBlock(OPENCODE_INSTRUCTIONS(), renderAgentInstructions("OpenCode"));
@@ -2027,7 +2078,7 @@ var captureTakeoverReceipt = (agent) => {
2027
2078
  } : {},
2028
2079
  ...mcp ? { mcpServer: captureMcpServer(mcp[0], mcp[1]) } : {}
2029
2080
  };
2030
- writeJsonAtomic(hookTakeoverReceipt(agent), receipt, 384);
2081
+ writeSetupConfigJson(hookTakeoverReceipt(agent), receipt, 384);
2031
2082
  };
2032
2083
  var agentIsWired = (agent) => {
2033
2084
  const readJson2 = (path) => {
@@ -2149,8 +2200,8 @@ var setupCompatibleAgent = (profile) => async (apiKey) => {
2149
2200
  }
2150
2201
  for (const [path, document] of documents) {
2151
2202
  await spinner(`Writing ${shortenHome(path)}`, async () => {
2152
- if (document.format === "toml") writeFileAtomic(path, stringifyTOML(document.value), KEY_FILE_MODE);
2153
- else writeJsonAtomic(path, document.value, KEY_FILE_MODE);
2203
+ if (document.format === "toml") writeSetupConfigFile(path, stringifyTOML(document.value), KEY_FILE_MODE);
2204
+ else writeSetupConfigJson(path, document.value, KEY_FILE_MODE);
2154
2205
  });
2155
2206
  }
2156
2207
  if (instructionsFile && profile.instructions) {
@@ -2164,8 +2215,8 @@ var setupCompatibleAgent = (profile) => async (apiKey) => {
2164
2215
  const soleGateClaim = gate && settings ? claimSoleGate(settings, gate) : null;
2165
2216
  if (gate && settingsPath && settings && soleGateClaim?.kind === "claimed") {
2166
2217
  await spinner(`Making Pushary the only gate (${shortenHome(settingsPath)})`, async () => {
2167
- writeJsonAtomic(soleGateReceiptFile(gate), soleGateReceipt(gate), KEY_FILE_MODE);
2168
- writeJsonAtomic(settingsPath, settings);
2218
+ writeSetupConfigJson(soleGateReceiptFile(gate), soleGateReceipt(gate), KEY_FILE_MODE);
2219
+ writeSetupConfigJson(settingsPath, settings);
2169
2220
  });
2170
2221
  }
2171
2222
  console.log();
@@ -2780,6 +2831,7 @@ var main = async () => {
2780
2831
  }
2781
2832
  }
2782
2833
  markStep("connect-phone");
2834
+ if (keyCheck.kind === "ok") console.log(` ${dim(await fetchSetupWaitGuidance(trimmedKey))}`);
2783
2835
  const skipPhone = options.skipPhone;
2784
2836
  let phone = null;
2785
2837
  const verifyMode = effectiveVerify(options, { paired: keyFromPairing });
@@ -1,16 +1,16 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  readLedgerSummary
4
- } from "../chunk-Y3N3SYBX.js";
4
+ } from "../chunk-46F4BRUQ.js";
5
5
  import {
6
6
  exitOnHelpFlag
7
- } from "../chunk-XLHFWG2E.js";
7
+ } from "../chunk-ZSY6BWUD.js";
8
8
  import "../chunk-KZERVKTD.js";
9
9
  import {
10
10
  getApiKey
11
- } from "../chunk-GTOBOC6M.js";
12
- import "../chunk-LDCRV6HG.js";
13
- import "../chunk-RXXKFM22.js";
11
+ } from "../chunk-EWC4P4ZL.js";
12
+ import "../chunk-57M4ERJK.js";
13
+ import "../chunk-K7EGWMDU.js";
14
14
 
15
15
  // bin/pushary-stats.ts
16
16
  exitOnHelpFlag("stats");
@@ -1,71 +1,71 @@
1
1
  #!/usr/bin/env node
2
- import {
3
- describeLastSeen,
4
- listMachines
5
- } from "../chunk-LE2YVPAT.js";
6
- import "../chunk-NV2LARV4.js";
7
- import "../chunk-RIVNNBEK.js";
8
- import "../chunk-SCYAXV7U.js";
9
- import "../chunk-XHKBHWLX.js";
10
2
  import {
11
3
  describeReach,
12
4
  fetchChannels,
13
5
  reachVerdict
14
- } from "../chunk-C6QBNBL4.js";
6
+ } from "../chunk-2FUHSKXH.js";
15
7
  import "../chunk-3EGEA4KH.js";
8
+ import {
9
+ describeLastSeen,
10
+ listMachines
11
+ } from "../chunk-GQ5KCVGK.js";
16
12
  import "../chunk-QCGNGEGE.js";
17
13
  import {
18
14
  CONNECTED_THROUGH_MAC_APP,
19
15
  readMacAppConnectionWhenKeyless
20
- } from "../chunk-F7SZ2RCK.js";
16
+ } from "../chunk-FOUK4CBO.js";
21
17
  import {
22
18
  SIGNED_OUT_ON_MAC_MESSAGE,
23
19
  activeKeyVerdictOf,
24
20
  describeSignedOutKey,
25
21
  readSignedOutDiagnosis
26
- } from "../chunk-JB4JCGRW.js";
27
- import "../chunk-O4SYJVAF.js";
22
+ } from "../chunk-YWIFK2UB.js";
23
+ import "../chunk-YXGWG5PO.js";
28
24
  import {
29
25
  createIo
30
26
  } from "../chunk-FO3MDD26.js";
31
- import {
32
- exitOnHelpFlag
33
- } from "../chunk-XLHFWG2E.js";
34
- import "../chunk-V5SUKRRI.js";
35
- import "../chunk-PIZ65U3D.js";
36
- import "../chunk-IMD5FN6Y.js";
37
- import "../chunk-Q7CUTGT4.js";
38
- import "../chunk-55FB6OSG.js";
27
+ import "../chunk-RBJWPUI6.js";
28
+ import "../chunk-AUOSFZJ3.js";
29
+ import "../chunk-ASK2MSD2.js";
30
+ import "../chunk-5DCZL3BC.js";
31
+ import "../chunk-OHFC3GJY.js";
32
+ import "../chunk-U45OINYS.js";
39
33
  import {
40
34
  rejectUnknownFlags
41
35
  } from "../chunk-GMXKITVA.js";
42
- import "../chunk-6ICPEJY5.js";
43
36
  import {
44
37
  readKeySource
45
- } from "../chunk-C3RVRTHS.js";
46
- import "../chunk-YRE6GUFZ.js";
47
- import "../chunk-O7ADPLBF.js";
48
- import "../chunk-4T2TGP4T.js";
38
+ } from "../chunk-YK7FGPYS.js";
39
+ import {
40
+ exitOnHelpFlag
41
+ } from "../chunk-ZSY6BWUD.js";
42
+ import "../chunk-WPPKXVV3.js";
43
+ import "../chunk-RIVNNBEK.js";
44
+ import "../chunk-XHKBHWLX.js";
45
+ import "../chunk-6ICPEJY5.js";
46
+ import "../chunk-GZSSAY6N.js";
47
+ import "../chunk-HHX6IRSH.js";
48
+ import "../chunk-CFMCV6Z7.js";
49
+ import "../chunk-CDERSTBO.js";
49
50
  import "../chunk-POFBE6ZY.js";
50
- import "../chunk-53KLSE2F.js";
51
+ import "../chunk-SFQSOBLM.js";
51
52
  import {
52
53
  checkApiKey,
53
54
  describeKeyCheck
54
- } from "../chunk-C54VJJ37.js";
55
- import "../chunk-H6V5S52A.js";
56
- import "../chunk-W3BO56VE.js";
55
+ } from "../chunk-PWUIPQ2I.js";
56
+ import "../chunk-6TYKZ4DN.js";
57
+ import "../chunk-4A6VUVXV.js";
57
58
  import {
58
59
  UsageError
59
60
  } from "../chunk-7QLSKOSU.js";
60
61
  import {
61
62
  EXIT
62
63
  } from "../chunk-KZERVKTD.js";
63
- import "../chunk-LAAOHBLO.js";
64
- import "../chunk-S3OWTQ6Z.js";
64
+ import "../chunk-IOVJVGIT.js";
65
65
  import "../chunk-AQFEP65J.js";
66
- import "../chunk-GTOBOC6M.js";
67
- import "../chunk-LDCRV6HG.js";
68
- import "../chunk-RXXKFM22.js";
66
+ import "../chunk-EWC4P4ZL.js";
67
+ import "../chunk-57M4ERJK.js";
68
+ import "../chunk-K7EGWMDU.js";
69
69
 
70
70
  // src/status.ts
71
71
  var SIGNED_OUT_LINE = { label: "Server", value: "key signed out on this Mac", ok: false };