@pushary/agent-hooks 1.9.57 → 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 (92) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/{api-RQAY3A5V.js → api-WVXBM4MR.js} +7 -7
  3. package/dist/bin/pushary-bell-hook.js +15 -15
  4. package/dist/bin/pushary-bell.js +3 -3
  5. package/dist/bin/pushary-claude.js +15 -15
  6. package/dist/bin/pushary-clean.js +39 -36
  7. package/dist/bin/pushary-codex-bridge.js +10 -10
  8. package/dist/bin/pushary-codex-hook.js +19 -19
  9. package/dist/bin/pushary-codex-session.js +8 -6
  10. package/dist/bin/pushary-codex.js +8 -8
  11. package/dist/bin/pushary-connect.js +17 -16
  12. package/dist/bin/pushary-daemon.js +23 -23
  13. package/dist/bin/pushary-disconnect.js +17 -17
  14. package/dist/bin/pushary-doctor.js +28 -26
  15. package/dist/bin/pushary-elicitation-hook.js +16 -16
  16. package/dist/bin/pushary-gemini-bridge.js +5 -5
  17. package/dist/bin/pushary-gemini-hook.js +17 -17
  18. package/dist/bin/pushary-hook.js +18 -18
  19. package/dist/bin/pushary-login.js +6 -6
  20. package/dist/bin/pushary-logout.js +16 -16
  21. package/dist/bin/pushary-mcp.js +8 -8
  22. package/dist/bin/pushary-mode.js +6 -6
  23. package/dist/bin/pushary-notification-hook.js +15 -15
  24. package/dist/bin/pushary-opencode-hook.js +16 -16
  25. package/dist/bin/pushary-permission-denied-hook.js +18 -18
  26. package/dist/bin/pushary-permission-hook.js +18 -18
  27. package/dist/bin/pushary-post-hook.js +15 -15
  28. package/dist/bin/pushary-prompt-hook.js +15 -15
  29. package/dist/bin/pushary-session-end-hook.js +15 -15
  30. package/dist/bin/pushary-session-start-hook.js +21 -21
  31. package/dist/bin/pushary-setup.js +52 -255
  32. package/dist/bin/pushary-status.js +21 -19
  33. package/dist/bin/pushary-stop-hook.js +15 -15
  34. package/dist/bin/pushary-stopfailure-hook.js +15 -15
  35. package/dist/bin/pushary-suggestions.js +6 -6
  36. package/dist/bin/pushary-transcript-register.js +8 -8
  37. package/dist/bin/pushary-upgrade.js +97 -48
  38. package/dist/bin/pushary-wait.js +6 -6
  39. package/dist/bin/pushary.js +4 -4
  40. package/dist/{chunk-DDQRYX2L.js → chunk-3KOPY2UQ.js} +1 -1
  41. package/dist/{chunk-ZU6L34DQ.js → chunk-3WNOO7BM.js} +3 -3
  42. package/dist/{chunk-RFAF3TOX.js → chunk-4JJ3T7IE.js} +93 -14
  43. package/dist/{chunk-JCMSISCC.js → chunk-4LUPZ347.js} +1 -1
  44. package/dist/{chunk-HCIB4YNB.js → chunk-5DZHKNBU.js} +1 -1
  45. package/dist/{chunk-QQYUWTYS.js → chunk-ATUZX4K7.js} +1 -1
  46. package/dist/{chunk-CB565EVO.js → chunk-CK5BCFQF.js} +1 -1
  47. package/dist/{chunk-AN6TVB2H.js → chunk-CSQJCXPX.js} +3 -3
  48. package/dist/chunk-CZULJ647.js +378 -0
  49. package/dist/{chunk-6QM54CSJ.js → chunk-DQ565WFA.js} +3 -3
  50. package/dist/chunk-FAGDOPQI.js +266 -0
  51. package/dist/{chunk-QLDTBZBP.js → chunk-HRHAZ3GE.js} +5 -5
  52. package/dist/{chunk-NQDEMRAS.js → chunk-HUWLEVL2.js} +2 -2
  53. package/dist/{chunk-SQ5G6A6K.js → chunk-IJ6XKKQW.js} +1 -1
  54. package/dist/{chunk-BAJ3A3BU.js → chunk-JZKEC4XJ.js} +4 -1
  55. package/dist/{chunk-ZZB4J6CX.js → chunk-K5CAURU5.js} +3 -3
  56. package/dist/{chunk-7OQ4AJC7.js → chunk-KIH5BDH5.js} +2 -7
  57. package/dist/{chunk-CUEUANIU.js → chunk-KSVCCSAO.js} +3 -3
  58. package/dist/{chunk-D2EETYAL.js → chunk-KW6EYFZV.js} +11 -366
  59. package/dist/{chunk-LW7IWGSV.js → chunk-MCHOBQHE.js} +4 -4
  60. package/dist/{chunk-TWLWDIFB.js → chunk-MYBCXDIL.js} +3 -1
  61. package/dist/{chunk-4QD7VE4E.js → chunk-OHD35NPC.js} +1 -1
  62. package/dist/{chunk-3IBUZQKM.js → chunk-PZOFPAPG.js} +1 -1
  63. package/dist/{chunk-YKYVDHIY.js → chunk-QDFLBTUP.js} +1 -1
  64. package/dist/{chunk-Z7Q36I4K.js → chunk-QP3XPS5U.js} +8 -4
  65. package/dist/{chunk-4YTFYILS.js → chunk-RF74KBF5.js} +4 -4
  66. package/dist/{chunk-K5SDLOFS.js → chunk-RGQEULXD.js} +6 -6
  67. package/dist/{chunk-FBKVCODG.js → chunk-S54YLXWW.js} +1 -1
  68. package/dist/{chunk-PZDMZ7LM.js → chunk-T2AC5VFQ.js} +3 -3
  69. package/dist/{chunk-OLNBYAPI.js → chunk-T2BEIPK2.js} +2 -2
  70. package/dist/{chunk-W6363YYZ.js → chunk-TN74MUMB.js} +3 -3
  71. package/dist/{chunk-2NIRYGTK.js → chunk-UMVVQXAC.js} +2 -2
  72. package/dist/{chunk-K45CFSYV.js → chunk-VLJ5C6IT.js} +1 -1
  73. package/dist/{chunk-LVZYIUSR.js → chunk-VPZ5K72D.js} +1 -1
  74. package/dist/{chunk-AEXACKDR.js → chunk-WVP6UQG3.js} +3 -3
  75. package/dist/{chunk-T45PAPOG.js → chunk-X6F4BQEE.js} +3 -3
  76. package/dist/{chunk-2PJENKRJ.js → chunk-XEJV3QSS.js} +76 -29
  77. package/dist/{chunk-IBSRULIY.js → chunk-XFUKCBPU.js} +8 -8
  78. package/dist/{chunk-UPFFO4F6.js → chunk-XWY4UW62.js} +3 -3
  79. package/dist/{chunk-DS6OR5OS.js → chunk-ZEHUWE3X.js} +3 -3
  80. package/dist/{chunk-OZSP4RIQ.js → chunk-ZJNU32VE.js} +21 -6
  81. package/dist/{chunk-A54W5A74.js → chunk-ZL3UR6M5.js} +2 -2
  82. package/dist/{codex-app-cards-switch-SVGTZ2UN.js → codex-app-cards-switch-TVKXJWXE.js} +16 -14
  83. package/dist/{codex-desktop-launch-SH7OUEEC.js → codex-desktop-launch-ROTJEEGF.js} +3 -1
  84. package/dist/{codex-session-launch-IQ57OL3N.js → codex-session-launch-VL6ZQA3N.js} +10 -10
  85. package/dist/{global-upgrade-SRCWQE7N.js → global-upgrade-IPWV5PTM.js} +13 -5
  86. package/dist/{identity-6KRUO2YO.js → identity-ARPAUNGN.js} +3 -3
  87. package/dist/{live-capabilities-RKUHAWT6.js → live-capabilities-EWTRY2HA.js} +2 -2
  88. package/dist/{paths-MUPQZNLG.js → paths-IZTNMJAQ.js} +4 -2
  89. package/dist/{reapply-YZXZCWCI.js → reapply-ILKOYYKA.js} +17 -17
  90. package/dist/src/index.js +13 -13
  91. package/dist/{upgrade-lock-JXP27UKI.js → upgrade-lock-ML73QXIG.js} +3 -5
  92. package/package.json +1 -1
@@ -1,3 +1,13 @@
1
+ import {
2
+ describeAppRepair,
3
+ describeJustPairedRepair,
4
+ describeReach,
5
+ describeVerifyOutcome,
6
+ ownAppPlatforms,
7
+ reachVerdict,
8
+ reachesYou,
9
+ verifyDelivery
10
+ } from "./chunk-CZULJ647.js";
1
11
  import {
2
12
  generateKeypair,
3
13
  openSealedKey,
@@ -12,9 +22,6 @@ import {
12
22
  terminalColumns,
13
23
  useColor
14
24
  } from "./chunk-FO3MDD26.js";
15
- import {
16
- callMcpTool
17
- } from "./chunk-A54W5A74.js";
18
25
  import {
19
26
  reportedInstallSource
20
27
  } from "./chunk-7RZO6VWD.js";
@@ -23,361 +30,9 @@ import {
23
30
  } from "./chunk-5SFM6XB4.js";
24
31
  import {
25
32
  NO_PAIRING_COMPUTER,
26
- PAIR_TTL_SECONDS,
27
- classifyConfirmResponse,
28
- isAnswerSource
33
+ PAIR_TTL_SECONDS
29
34
  } from "./chunk-GZL3KEPC.js";
30
35
 
31
- // src/reach.ts
32
- var reachVerdict = (channels) => {
33
- const { yours, site } = channels;
34
- if (yours === null || site === null) {
35
- return channels.phoneReachable || channels.webActive > 0 ? { kind: "yours" } : { kind: "nobody" };
36
- }
37
- if (yours.phoneReachable) return { kind: "yours" };
38
- const solo = site.otherMembers === 0;
39
- if (solo) {
40
- return site.phoneReachable || site.webActive > 0 ? { kind: "yours" } : { kind: "nobody" };
41
- }
42
- if (site.appDevices === 0 && site.webActive === 0) return { kind: "nobody" };
43
- if (site.webActive > 0 && !yours.webAttributable) {
44
- return { kind: "unattributable", otherMembers: site.otherMembers };
45
- }
46
- return { kind: "others", otherMembers: site.otherMembers };
47
- };
48
- var reachesYou = (channels) => reachVerdict(channels).kind === "yours";
49
- var plural = (count, one, many = `${one}s`) => `${count} ${count === 1 ? one : many}`;
50
- var describeReach = (channels) => {
51
- const verdict = reachVerdict(channels);
52
- if (verdict.kind === "nobody") return "nothing can receive an approval";
53
- const parts = [];
54
- const own = channels.yours;
55
- if (verdict.kind === "yours" && own !== null && own.appDevices > 0) {
56
- const platforms = own.appPlatforms.length > 0 ? ` (${own.appPlatforms.join(", ")})` : "";
57
- parts.push(`${plural(own.appDevices, "app device")}${platforms}`);
58
- } else if (channels.appDevices > 0) {
59
- const platforms = channels.appPlatforms.length > 0 ? ` (${channels.appPlatforms.join(", ")})` : "";
60
- parts.push(`${plural(channels.appDevices, "app device")}${platforms}`);
61
- }
62
- if (channels.webPhone > 0) parts.push(`${plural(channels.webPhone, "browser")} on a phone`);
63
- if (channels.webDesktop > 0) parts.push(`${plural(channels.webDesktop, "browser")} on a desktop`);
64
- const summary = parts.length > 0 ? parts.join(", ") : "a device";
65
- if (verdict.kind === "others") return `${summary}, none of them yours`;
66
- if (verdict.kind === "unattributable") return `${summary}, and no way to tell whose`;
67
- return summary;
68
- };
69
- var describeAppRepair = (verdict) => {
70
- switch (verdict.kind) {
71
- case "yours":
72
- return null;
73
- case "nobody":
74
- return [
75
- "Open the Pushary app, sign in, and allow notifications.",
76
- `If this terminal was never paired with your phone, run: ${NPX_LATEST_COMMAND} setup --connect app`
77
- ];
78
- case "others":
79
- return [
80
- `Reachable devices belong to other members of this workspace (${verdict.otherMembers}).`,
81
- "Sign in on the Pushary app with your own account so approvals can reach you."
82
- ];
83
- case "unattributable":
84
- return [
85
- "Something is reachable here, but not identifiably yours.",
86
- "Sign in on the Pushary app so your approvals are routed to your device."
87
- ];
88
- }
89
- };
90
- var describeJustPairedRepair = (verdict) => {
91
- if (verdict.kind === "nobody") {
92
- return [
93
- "The app asks for the notification permission after it grants the pairing.",
94
- "Open the Pushary app and allow notifications. That is the whole remaining step."
95
- ];
96
- }
97
- return describeAppRepair(verdict) ?? [];
98
- };
99
-
100
- // src/setup/verify.ts
101
- var plural2 = (count, one) => `${count} ${one}${count === 1 ? "" : "s"}`;
102
- var SETUP_AGENT_NAME = "Pushary setup";
103
- var ownAppPlatforms = (channels) => channels.yours?.appPlatforms ?? channels.appPlatforms;
104
- var describeRecipients = (push, channels) => {
105
- const parts = [];
106
- if (push.app > 0) {
107
- const platforms = ownAppPlatforms(channels);
108
- const suffix = platforms.length > 0 ? ` (${platforms.join(", ")})` : "";
109
- parts.push(`${plural2(push.app, "app device")}${suffix}`);
110
- }
111
- if (push.web > 0) parts.push(plural2(push.web, "browser"));
112
- return parts.length > 0 ? parts.join(" and ") : plural2(push.total, "device");
113
- };
114
- var classifyDelivery = (channels, push) => {
115
- if (push.total <= 0) return { kind: "no-recipients" };
116
- const verdict = reachVerdict(channels);
117
- if (verdict.kind === "yours" && (push.app > 0 || channels.yours === null || channels.site?.otherMembers === 0)) {
118
- return { kind: "delivered", recipients: push.total, deviceLabel: describeRecipients(push, channels) };
119
- }
120
- if (verdict.kind === "unattributable") {
121
- return { kind: "unattributable", recipients: push.total, otherMembers: verdict.otherMembers };
122
- }
123
- if (verdict.kind === "others") {
124
- return { kind: "others-only", recipients: push.total, otherMembers: verdict.otherMembers };
125
- }
126
- if (verdict.kind === "yours") {
127
- const otherMembers = channels.site?.otherMembers ?? 0;
128
- return { kind: "unattributable", recipients: push.total, otherMembers };
129
- }
130
- return { kind: "delivered", recipients: push.total, deviceLabel: describeRecipients(push, channels) };
131
- };
132
- var sendTestNotification = async (apiKey) => {
133
- const result = await callMcpTool(apiKey, "send_notification", {
134
- title: "Pushary is connected",
135
- body: "This setup notification reached you. Agent hooks still need a real-agent check.",
136
- agentName: SETUP_AGENT_NAME
137
- }, { timeoutMs: 2e4 });
138
- const toCount = (value) => typeof value === "number" && Number.isFinite(value) ? value : 0;
139
- const app = toCount(result.delivery?.mobile?.recipients);
140
- const web = toCount(result.delivery?.web?.recipients);
141
- return { app, web, total: typeof result.sent === "number" ? result.sent : app + web };
142
- };
143
- var verifyDelivery = async (apiKey, channels, deps = {}) => {
144
- const send = deps.send ?? sendTestNotification;
145
- try {
146
- return classifyDelivery(channels, await send(apiKey));
147
- } catch (err) {
148
- return { kind: "error", detail: err instanceof Error ? err.message : "send failed" };
149
- }
150
- };
151
- var describeVerifyOutcome = (outcome) => {
152
- switch (outcome.kind) {
153
- case "delivered":
154
- return { ok: true, message: `Delivered to ${outcome.deviceLabel}. Push works.`, next: [] };
155
- case "no-recipients":
156
- return {
157
- ok: false,
158
- message: "Nothing to deliver to. Agents are configured; approvals will fall back to the terminal.",
159
- next: [
160
- "Run pushary pair to pair your phone.",
161
- "Then pushary doctor --roundtrip to test a synthetic question and answer."
162
- ]
163
- };
164
- case "others-only":
165
- return {
166
- ok: false,
167
- message: `Delivered to ${plural2(outcome.recipients, "device")} on this site, none of them yours.`,
168
- next: [
169
- `Approvals for your agent would wake one of your ${plural2(outcome.otherMembers, "teammate")}.`,
170
- "Run pushary pair to pair your own phone."
171
- ]
172
- };
173
- case "unattributable":
174
- return {
175
- ok: false,
176
- message: `Delivered to ${plural2(outcome.recipients, "device")} on this site, and no way to tell whose.`,
177
- next: [
178
- "Browser subscriptions carry no owner, and this site has other members.",
179
- "Install the Pushary app and pair it with pushary pair, or run pushary doctor --roundtrip to prove it reaches you."
180
- ]
181
- };
182
- case "error":
183
- return {
184
- ok: false,
185
- message: `Could not send the test notification (${outcome.detail}).`,
186
- next: ["Agents are configured. Run pushary doctor once the connection is back."]
187
- };
188
- }
189
- };
190
- var ROUND_TRIP_QUESTION = "Pushary delivery test. Answer either way to test returning an answer. This does not test your agent hooks.";
191
- var ROUND_TRIP_TIMEOUT_MS = 55e3;
192
- var reportNoInterrupt = async () => {
193
- };
194
- var defaultAsk = (apiKey, agentName) => (
195
- // wait:false so the poll is ours: the blocking form returns on the SITE's
196
- // policy timeout, which a user may have set to seconds, and a setup check
197
- // reporting "unanswered" after three seconds would be a lie about the product.
198
- callMcpTool(apiKey, "ask_user", {
199
- question: ROUND_TRIP_QUESTION,
200
- type: "confirm",
201
- agentName,
202
- wait: false
203
- }, { timeoutMs: 15e3 })
204
- );
205
- var defaultWait = (apiKey, correlationId) => callMcpTool(apiKey, "wait_for_answer", {
206
- correlationId,
207
- timeoutMs: ROUND_TRIP_TIMEOUT_MS
208
- }, { timeoutMs: ROUND_TRIP_TIMEOUT_MS + 5e3 });
209
- var defaultCancel = async (apiKey, correlationId) => {
210
- await callMcpTool(apiKey, "cancel_question", { correlationId }, { timeoutMs: 1e4 }).catch(() => {
211
- });
212
- };
213
- var answeredRoundTrip = (answer, correlationId, latencyMs) => {
214
- if (answer.value === void 0 || classifyConfirmResponse(answer.value) === null) {
215
- return { kind: "error", detail: "the server reported an answer without a valid Yes, No or defer value" };
216
- }
217
- return {
218
- kind: "answered",
219
- value: answer.value,
220
- latencyMs,
221
- correlationId,
222
- ...isAnswerSource(answer.answerSource) ? { answerSource: answer.answerSource } : {}
223
- };
224
- };
225
- var verifyRoundTrip = async (apiKey, agentName = SETUP_AGENT_NAME, deps = {}) => {
226
- const ask = deps.ask ?? defaultAsk;
227
- const wait = deps.wait ?? defaultWait;
228
- const cancel = deps.cancel ?? defaultCancel;
229
- const interrupted = deps.interrupted ?? reportNoInterrupt;
230
- const now = deps.now ?? Date.now;
231
- const started = now();
232
- let asked;
233
- try {
234
- asked = await ask(apiKey, agentName);
235
- } catch (err) {
236
- return { kind: "error", detail: err instanceof Error ? err.message : "ask failed" };
237
- }
238
- let shutdown;
239
- const stop = (code) => {
240
- if (shutdown) return;
241
- shutdown = (async () => {
242
- let timer;
243
- try {
244
- await Promise.race([
245
- Promise.all([
246
- cancel(apiKey, asked.correlationId).catch(() => {
247
- }),
248
- interrupted(code).catch(() => {
249
- })
250
- ]),
251
- new Promise((resolve) => {
252
- timer = setTimeout(resolve, 4e3);
253
- })
254
- ]);
255
- } finally {
256
- clearTimeout(timer);
257
- process.stderr.write("Delivery test interrupted. Cleanup was attempted; an unresolved question expires automatically.\n");
258
- process.exit(code);
259
- }
260
- })();
261
- };
262
- const onInterrupt = () => stop(130);
263
- const onTerminate = () => stop(143);
264
- if (asked.correlationId) {
265
- process.on("SIGINT", onInterrupt);
266
- process.on("SIGTERM", onTerminate);
267
- }
268
- let answerObserved = false;
269
- try {
270
- if (asked.noDevices || asked.warning) return { kind: "no-recipients" };
271
- if (asked.mode === "notify_only" || asked.status === "notified") return { kind: "notify-only" };
272
- if (!asked.correlationId) return { kind: "error", detail: "no correlationId returned" };
273
- const answer = asked.answered === true ? asked : await wait(apiKey, asked.correlationId);
274
- if (answer.answered === true) {
275
- const outcome = answeredRoundTrip(answer, asked.correlationId, now() - started);
276
- answerObserved = outcome.kind === "answered";
277
- return outcome;
278
- }
279
- return { kind: "unanswered" };
280
- } catch (err) {
281
- return { kind: "error", detail: err instanceof Error ? err.message : "wait failed" };
282
- } finally {
283
- if (shutdown) await shutdown;
284
- process.off("SIGINT", onInterrupt);
285
- process.off("SIGTERM", onTerminate);
286
- if (!answerObserved && asked.correlationId) await cancel(apiKey, asked.correlationId).catch(() => {
287
- });
288
- }
289
- };
290
- var describeAnswerSource = (source) => {
291
- switch (source) {
292
- case "mobile_app":
293
- case "mobile_background":
294
- return "Answered on your phone.";
295
- case "mac_app":
296
- return "Answered on your Mac.";
297
- case "sandbox":
298
- return "This was a simulated sandbox answer.";
299
- default:
300
- return source ? `Answer source: ${source}. This was a synthetic test.` : "The answering surface was not reported. This was a synthetic test.";
301
- }
302
- };
303
- var NOTIFICATION_ANSWER_STEPS = /* @__PURE__ */ new Map([
304
- ["ios", "Press and hold the notification, then tap Approve."],
305
- ["android", "Expand the notification, then tap Approve."]
306
- ]);
307
- var EITHER_PHONE_ANSWER_STEP = "Press and hold the notification on iPhone, or expand it on Android, then tap Approve.";
308
- var notificationAnswerStep = (appPlatforms) => {
309
- const platforms = [...new Set(appPlatforms)];
310
- const [onlyPlatform] = platforms;
311
- if (onlyPlatform === void 0) return null;
312
- if (platforms.length > 1) return EITHER_PHONE_ANSWER_STEP;
313
- return NOTIFICATION_ANSWER_STEPS.get(onlyPlatform) ?? EITHER_PHONE_ANSWER_STEP;
314
- };
315
- var WAITING_FOR_TAP = "Waiting for you to tap the notification";
316
- var WAITING_FOR_ANSWER = "Waiting for your answer";
317
- var describeAnswerTestPrompt = (appPlatforms) => {
318
- const step = notificationAnswerStep(appPlatforms);
319
- return { step, waiting: step === null ? WAITING_FOR_TAP : WAITING_FOR_ANSWER };
320
- };
321
- var CHECK_THE_NOTIFICATION_OPENED = "Check the notification actually opened something you could tap, then run pushary doctor --roundtrip.";
322
- var unansweredNextStep = (appPlatforms) => {
323
- const step = notificationAnswerStep(appPlatforms);
324
- return step === null ? CHECK_THE_NOTIFICATION_OPENED : `To send another one, run pushary doctor --roundtrip. ${step}`;
325
- };
326
- var describeRoundTripOutcome = (outcome, appPlatforms = []) => {
327
- switch (outcome.kind) {
328
- case "answered":
329
- return {
330
- ok: true,
331
- message: `Answered "${outcome.value}" in ${(outcome.latencyMs / 1e3).toFixed(1)}s. ${describeAnswerSource(outcome.answerSource)}`,
332
- next: []
333
- };
334
- case "unanswered":
335
- return {
336
- ok: false,
337
- message: "The question was sent and nothing came back.",
338
- next: [
339
- "A push that arrives and cannot be answered is the most common way this breaks, so this is worth resolving now.",
340
- unansweredNextStep(appPlatforms)
341
- ]
342
- };
343
- case "notify-only":
344
- return {
345
- ok: true,
346
- message: "Sent. This site is in notify-only mode, so questions never wait for an answer.",
347
- next: ["Switch with pushary mode push_first if you want approvals to hold for your phone."]
348
- };
349
- case "no-recipients":
350
- return {
351
- ok: false,
352
- message: "Nothing to ask. No phone or browser is connected to this site.",
353
- next: [
354
- "Run pushary pair to pair your phone.",
355
- "Or pushary pair --app if you already have the Pushary app."
356
- ]
357
- };
358
- case "error":
359
- return {
360
- ok: false,
361
- message: `Could not complete the round trip (${outcome.detail}).`,
362
- next: ["Agents are configured. Run pushary doctor --roundtrip once the connection is back."]
363
- };
364
- }
365
- };
366
- var describeRoundTrip = (outcome, appPlatforms = []) => {
367
- const report = describeRoundTripOutcome(outcome, appPlatforms);
368
- return { ...report, next: [...report.next, "Agent hook activation remains unverified. Restart your agent and check one real approval."] };
369
- };
370
- var roundTripEvidence = (outcome) => ({
371
- kind: outcome?.kind ?? "skipped",
372
- ...outcome?.kind === "answered" ? {
373
- correlationId: outcome.correlationId ?? null,
374
- answerSource: outcome.answerSource ?? null,
375
- value: outcome.value,
376
- latencyMs: outcome.latencyMs
377
- } : {},
378
- hookActivation: "unverified"
379
- });
380
-
381
36
  // src/onboarding.ts
382
37
  import qrcodeTerminal from "qrcode-terminal";
383
38
  var paint = (open) => (s) => useColor() ? `${open}${s}\x1B[0m` : s;
@@ -1058,16 +713,6 @@ var waitForYourPhone = async (apiKey, options = {}) => {
1058
713
  };
1059
714
 
1060
715
  export {
1061
- reachVerdict,
1062
- describeReach,
1063
- SETUP_AGENT_NAME,
1064
- ownAppPlatforms,
1065
- verifyRoundTrip,
1066
- notificationAnswerStep,
1067
- describeAnswerTestPrompt,
1068
- describeRoundTripOutcome,
1069
- describeRoundTrip,
1070
- roundTripEvidence,
1071
716
  fetchChannels,
1072
717
  connectDevice,
1073
718
  confirmAppConnection,
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  openCodeConfigDirFrom
3
- } from "./chunk-PZDMZ7LM.js";
3
+ } from "./chunk-T2AC5VFQ.js";
4
4
  import {
5
5
  nativeClaudeInstallPath
6
6
  } from "./chunk-VUFHYMSP.js";
7
7
  import {
8
8
  grokHome
9
- } from "./chunk-UPFFO4F6.js";
9
+ } from "./chunk-XWY4UW62.js";
10
10
  import {
11
11
  codexHomeFrom
12
- } from "./chunk-TWLWDIFB.js";
12
+ } from "./chunk-MYBCXDIL.js";
13
13
  import {
14
14
  resolvePathBinary
15
- } from "./chunk-AEXACKDR.js";
15
+ } from "./chunk-WVP6UQG3.js";
16
16
  import {
17
17
  HOOK_COMPATIBLE_PROFILES
18
18
  } from "./chunk-GZL3KEPC.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  quoteIfNeeded
3
- } from "./chunk-AEXACKDR.js";
3
+ } from "./chunk-WVP6UQG3.js";
4
4
  import {
5
5
  CODEX_QUESTION_TOOLS,
6
6
  HOOK_BUDGETS,
@@ -463,6 +463,7 @@ var claudeMcpReceipt = () => join2(pusharyDir(), "setup", "claude-mcp.json");
463
463
  var bridgeAgentKey = () => join2(pusharyDir(), "bridge-auth", "agent-key.json");
464
464
  var autoUpdateState = () => join2(pusharyDir(), "auto-update.json");
465
465
  var autoUpdateLock = () => join2(pusharyDir(), "auto-update.lock");
466
+ var serviceOwedBackMark = () => join2(pusharyDir(), "service-owed-back");
466
467
  var autoUpdateLog = () => join2(pusharyDir(), "logs", "auto-update.log");
467
468
  var clientReportClaims = () => join2(pusharyDir(), "client-reports");
468
469
  var claudeRegistrationReceipt = () => join2(pusharyDir(), "setup", "claude-registration.json");
@@ -537,6 +538,7 @@ export {
537
538
  bridgeAgentKey,
538
539
  autoUpdateState,
539
540
  autoUpdateLock,
541
+ serviceOwedBackMark,
540
542
  autoUpdateLog,
541
543
  clientReportClaims,
542
544
  claudeRegistrationReceipt,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  CODEX_HOOK_STATUS
3
- } from "./chunk-2NIRYGTK.js";
3
+ } from "./chunk-UMVVQXAC.js";
4
4
  import {
5
5
  NPX_LATEST_COMMAND
6
6
  } from "./chunk-5SFM6XB4.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  pusharyDir
3
- } from "./chunk-TWLWDIFB.js";
3
+ } from "./chunk-MYBCXDIL.js";
4
4
  import {
5
5
  readJsonSafe,
6
6
  writeFileAtomic
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  guardBinary
3
- } from "./chunk-TWLWDIFB.js";
3
+ } from "./chunk-MYBCXDIL.js";
4
4
 
5
5
  // src/bell/install.ts
6
6
  import { join } from "path";
@@ -7,13 +7,13 @@ import {
7
7
  } from "./chunk-IRZ5FVWG.js";
8
8
  import {
9
9
  getMachineId
10
- } from "./chunk-SQ5G6A6K.js";
10
+ } from "./chunk-IJ6XKKQW.js";
11
11
  import {
12
12
  pusharyDir
13
- } from "./chunk-TWLWDIFB.js";
13
+ } from "./chunk-MYBCXDIL.js";
14
14
  import {
15
15
  resolveGlobalBinary
16
- } from "./chunk-AEXACKDR.js";
16
+ } from "./chunk-WVP6UQG3.js";
17
17
  import {
18
18
  readJsonSafe,
19
19
  writeFileAtomic,
@@ -40,7 +40,9 @@ import { existsSync, mkdirSync, readFileSync, realpathSync, renameSync, unlinkSy
40
40
  import { createHash, randomUUID } from "crypto";
41
41
  import { homedir, userInfo } from "os";
42
42
  import { execFileSync } from "child_process";
43
+ var daemonIsServing = (status) => status.kind === "running" || status.kind === "version-mismatch" || status.kind === "configuration-mismatch";
43
44
  var daemonNeedsHandoff = (status) => status.kind === "version-mismatch" || status.kind === "configuration-mismatch" || status.kind === "unresponsive" && status.processAlive === true;
45
+ var daemonProcessIsThere = (status) => daemonIsServing(status) || daemonNeedsHandoff(status);
44
46
  var DAEMON_REMOTE_PROOF_MAX_AGE_MS = 18e4;
45
47
  var DAEMON_REMOTE_PROOF_CLOCK_SKEW_MS = 3e4;
46
48
  var DAEMON_STARTUP_TIMEOUT_MS = 5e3;
@@ -573,7 +575,7 @@ var acquireDaemonLease = (options = {}) => {
573
575
  return { kind: "unavailable", detail: err instanceof Error ? err.message : String(err) };
574
576
  }
575
577
  const status = readDaemonStatus(options);
576
- if (status.kind === "running" || status.kind === "version-mismatch" || status.kind === "configuration-mismatch") {
578
+ if (daemonIsServing(status)) {
577
579
  return { kind: "already-running", status };
578
580
  }
579
581
  const lock = readJsonSafe(lockPath(dir));
@@ -1121,6 +1123,8 @@ var waitForDaemonRemoteProof = async (options = {}) => {
1121
1123
  };
1122
1124
 
1123
1125
  export {
1126
+ daemonIsServing,
1127
+ daemonProcessIsThere,
1124
1128
  DAEMON_COLD_START_TIMEOUT_MS,
1125
1129
  daemonHasRemoteProof,
1126
1130
  daemonServiceManagerAvailable,
@@ -13,19 +13,19 @@ import {
13
13
  reportClientError,
14
14
  sendNotification,
15
15
  waitForAnswer
16
- } from "./chunk-6QM54CSJ.js";
16
+ } from "./chunk-DQ565WFA.js";
17
17
  import {
18
18
  withRetry
19
- } from "./chunk-A54W5A74.js";
19
+ } from "./chunk-ZL3UR6M5.js";
20
20
  import {
21
21
  getMachineId
22
- } from "./chunk-SQ5G6A6K.js";
22
+ } from "./chunk-IJ6XKKQW.js";
23
23
  import {
24
24
  reportedInstallSource
25
25
  } from "./chunk-7RZO6VWD.js";
26
26
  import {
27
27
  canonicalJson
28
- } from "./chunk-TWLWDIFB.js";
28
+ } from "./chunk-MYBCXDIL.js";
29
29
  import {
30
30
  writeFileAtomic
31
31
  } from "./chunk-QENTGE75.js";
@@ -4,7 +4,7 @@ import {
4
4
  outcomeOfFailedAsk,
5
5
  reportMachineDenial,
6
6
  storedWaitDeadline
7
- } from "./chunk-QLDTBZBP.js";
7
+ } from "./chunk-HRHAZ3GE.js";
8
8
  import {
9
9
  isGatingMoment,
10
10
  recordKeylessMoment
@@ -12,11 +12,11 @@ import {
12
12
  import {
13
13
  isDeferAnswer,
14
14
  oncePerSession
15
- } from "./chunk-LVZYIUSR.js";
15
+ } from "./chunk-VPZ5K72D.js";
16
16
  import {
17
17
  activeHookSource,
18
18
  activeIdentity
19
- } from "./chunk-UPFFO4F6.js";
19
+ } from "./chunk-XWY4UW62.js";
20
20
  import {
21
21
  DEFAULT_SESSION,
22
22
  UNNAMED_ACTION,
@@ -40,7 +40,7 @@ import {
40
40
  reportEvent,
41
41
  scopePathFor,
42
42
  settleQuestionsForToolUse
43
- } from "./chunk-4YTFYILS.js";
43
+ } from "./chunk-RF74KBF5.js";
44
44
  import {
45
45
  repoKeyFor
46
46
  } from "./chunk-XXNT4FGA.js";
@@ -56,10 +56,10 @@ import {
56
56
  sendNotification,
57
57
  waitForQuestion,
58
58
  waitsForThePhone
59
- } from "./chunk-6QM54CSJ.js";
59
+ } from "./chunk-DQ565WFA.js";
60
60
  import {
61
61
  getMachineId
62
- } from "./chunk-SQ5G6A6K.js";
62
+ } from "./chunk-IJ6XKKQW.js";
63
63
  import {
64
64
  getApiKey,
65
65
  getBaseUrl
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  pusharyFetch
3
- } from "./chunk-HCIB4YNB.js";
3
+ } from "./chunk-5DZHKNBU.js";
4
4
  import {
5
5
  NetworkError
6
6
  } from "./chunk-7QLSKOSU.js";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  compatibleConfigFile
3
- } from "./chunk-UPFFO4F6.js";
3
+ } from "./chunk-XWY4UW62.js";
4
4
  import {
5
5
  hookOwnerOf,
6
6
  hookOwnerOfCommands,
7
7
  liveBridgeProbe,
8
8
  resolveBridgeStub
9
- } from "./chunk-CUEUANIU.js";
9
+ } from "./chunk-KSVCCSAO.js";
10
10
  import {
11
11
  AGENT_CHOICES
12
12
  } from "./chunk-ECJJKDP7.js";
@@ -18,7 +18,7 @@ import {
18
18
  guardedArgv,
19
19
  pusharyDir,
20
20
  vscodePluginDir
21
- } from "./chunk-TWLWDIFB.js";
21
+ } from "./chunk-MYBCXDIL.js";
22
22
  import {
23
23
  readJsonSafe
24
24
  } from "./chunk-QENTGE75.js";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  macAppBridgeAvailable
3
- } from "./chunk-PZDMZ7LM.js";
3
+ } from "./chunk-T2AC5VFQ.js";
4
4
  import {
5
5
  keyPrefix
6
6
  } from "./chunk-IRZ5FVWG.js";
7
7
  import {
8
8
  bridgeAgentKey
9
- } from "./chunk-TWLWDIFB.js";
9
+ } from "./chunk-MYBCXDIL.js";
10
10
  import {
11
11
  readJsonSafe
12
12
  } from "./chunk-QENTGE75.js";
@@ -6,10 +6,10 @@ import {
6
6
  } from "./chunk-QW3FRUFB.js";
7
7
  import {
8
8
  ensureDaemonRunning
9
- } from "./chunk-Z7Q36I4K.js";
9
+ } from "./chunk-QP3XPS5U.js";
10
10
  import {
11
11
  hookOwnerOf
12
- } from "./chunk-CUEUANIU.js";
12
+ } from "./chunk-KSVCCSAO.js";
13
13
  import {
14
14
  buildTranscriptRecords,
15
15
  decodePublicKey,
@@ -30,7 +30,7 @@ import {
30
30
  import {
31
31
  codexHome,
32
32
  pusharyDir
33
- } from "./chunk-TWLWDIFB.js";
33
+ } from "./chunk-MYBCXDIL.js";
34
34
  import {
35
35
  writeJsonAtomic
36
36
  } from "./chunk-QENTGE75.js";
@@ -7,10 +7,10 @@ import {
7
7
  codexHome,
8
8
  codexHooksJsonIn,
9
9
  isPusharyCodexCommand
10
- } from "./chunk-TWLWDIFB.js";
10
+ } from "./chunk-MYBCXDIL.js";
11
11
  import {
12
12
  resolvePathBinary
13
- } from "./chunk-AEXACKDR.js";
13
+ } from "./chunk-WVP6UQG3.js";
14
14
  import {
15
15
  getPackageVersion
16
16
  } from "./chunk-QTOLNRET.js";