@pushary/agent-hooks 1.9.6 → 1.9.8

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 (111) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +3 -3
  3. package/data/cursor-plugin/README.md +3 -7
  4. package/data/vscode-plugin/README.md +1 -1
  5. package/dist/bin/pushary-bell-hook.js +22 -23
  6. package/dist/bin/pushary-bell.js +9 -9
  7. package/dist/bin/pushary-claude.js +27 -28
  8. package/dist/bin/pushary-clean.js +98 -76
  9. package/dist/bin/pushary-codex-bridge.js +18 -18
  10. package/dist/bin/pushary-codex-hook.js +32 -33
  11. package/dist/bin/pushary-codex.js +13 -13
  12. package/dist/bin/pushary-connect.js +24 -21
  13. package/dist/bin/pushary-cowork.js +5 -5
  14. package/dist/bin/pushary-daemon.js +51 -38
  15. package/dist/bin/pushary-disconnect.js +187 -52
  16. package/dist/bin/pushary-doctor.js +68 -56
  17. package/dist/bin/pushary-elicitation-hook.js +24 -25
  18. package/dist/bin/pushary-gemini-bridge.js +13 -13
  19. package/dist/bin/pushary-gemini-hook.js +29 -30
  20. package/dist/bin/pushary-hook.js +30 -32
  21. package/dist/bin/pushary-login.js +12 -12
  22. package/dist/bin/pushary-logout.js +105 -42
  23. package/dist/bin/pushary-mcp.js +9 -9
  24. package/dist/bin/pushary-mode.js +28 -31
  25. package/dist/bin/pushary-notification-hook.js +26 -28
  26. package/dist/bin/pushary-opencode-hook.js +28 -29
  27. package/dist/bin/pushary-permission-denied-hook.js +30 -32
  28. package/dist/bin/pushary-permission-hook.js +29 -31
  29. package/dist/bin/pushary-post-hook.js +26 -28
  30. package/dist/bin/pushary-prompt-hook.js +26 -28
  31. package/dist/bin/pushary-session-end-hook.js +26 -28
  32. package/dist/bin/pushary-session-start-hook.js +31 -31
  33. package/dist/bin/pushary-setup.js +98 -106
  34. package/dist/bin/pushary-stats.js +5 -5
  35. package/dist/bin/pushary-status.js +34 -18
  36. package/dist/bin/pushary-stop-hook.js +26 -28
  37. package/dist/bin/pushary-stopfailure-hook.js +26 -28
  38. package/dist/bin/pushary-suggestions.js +19 -21
  39. package/dist/bin/pushary-transcript-register.js +18 -19
  40. package/dist/bin/pushary-transcripts.js +7 -7
  41. package/dist/bin/pushary-upgrade.js +67 -31
  42. package/dist/bin/pushary-wait.js +23 -19
  43. package/dist/bin/pushary.js +15 -14
  44. package/dist/{chunk-BSZ7VBVT.js → chunk-2A53H4S6.js} +17 -15
  45. package/dist/{chunk-D7SOOVHX.js → chunk-2QGYMY7A.js} +83 -3
  46. package/dist/{chunk-SVTHEMM3.js → chunk-2QTO5YIT.js} +6 -6
  47. package/dist/{chunk-WN6WYUCV.js → chunk-2VZAALEJ.js} +5 -9
  48. package/dist/chunk-2WXF3QJR.js +49 -0
  49. package/dist/{chunk-UKNKYTTY.js → chunk-3I6IVOZV.js} +3 -3
  50. package/dist/chunk-3Z3A37WD.js +77 -0
  51. package/dist/{chunk-2QRE6QH2.js → chunk-5QUPKDI5.js} +1 -1
  52. package/dist/chunk-6TE27XZR.js +69 -0
  53. package/dist/{chunk-L6USMDTW.js → chunk-7DVNSQWF.js} +59 -15
  54. package/dist/{chunk-SNJ3BOCP.js → chunk-7PT35RY2.js} +27 -8
  55. package/dist/{chunk-CBVDW2N6.js → chunk-B64KHETR.js} +3 -3
  56. package/dist/chunk-BEJRK4DF.js +94 -0
  57. package/dist/chunk-BXET3ALR.js +46 -0
  58. package/dist/{chunk-DJ4BB264.js → chunk-CD47ZFFZ.js} +1 -1
  59. package/dist/{chunk-FBD3QGVJ.js → chunk-CKV3UPMU.js} +2 -2
  60. package/dist/{chunk-7JTVYR5B.js → chunk-CLOSJ4ES.js} +1 -1
  61. package/dist/{chunk-DA4FTGTK.js → chunk-DKMD6AWR.js} +4 -4
  62. package/dist/{chunk-SPXBXN23.js → chunk-DL7XWKYV.js} +7 -5
  63. package/dist/{chunk-VRT3EEZN.js → chunk-DPGSLWOS.js} +8 -8
  64. package/dist/{chunk-3BUAEQCY.js → chunk-DUZVXBBU.js} +1 -1
  65. package/dist/{chunk-6GERGJHF.js → chunk-EUW7JL2K.js} +0 -32
  66. package/dist/{chunk-75CA37FZ.js → chunk-FQ2GORVG.js} +2 -2
  67. package/dist/{chunk-WUKUXICK.js → chunk-HRULIYDU.js} +2 -2
  68. package/dist/{chunk-Q4E56K4X.js → chunk-I5IJRMNV.js} +78 -8
  69. package/dist/{chunk-MKJ3RTUS.js → chunk-I6MJXLMY.js} +2 -2
  70. package/dist/{chunk-YPXUD6DW.js → chunk-IAD2RT4L.js} +14 -14
  71. package/dist/{chunk-LBLCFD5K.js → chunk-IHFDPV7C.js} +2 -2
  72. package/dist/{chunk-BVCHY4OY.js → chunk-IHO3YQAN.js} +2 -2
  73. package/dist/{chunk-RDK7FX5F.js → chunk-KF3UZLYI.js} +1 -1
  74. package/dist/chunk-KFF7G225.js +599 -0
  75. package/dist/{chunk-TE5M6GGK.js → chunk-KHNFLYJO.js} +204 -28
  76. package/dist/{chunk-CCDVL63C.js → chunk-KRCR2CRQ.js} +9 -9
  77. package/dist/{chunk-ZC3TF4LR.js → chunk-LKLVTG3V.js} +18 -9
  78. package/dist/{chunk-4QKM44N6.js → chunk-LWOO567I.js} +4 -3
  79. package/dist/{chunk-KK54WQ74.js → chunk-M6BZZFVQ.js} +1 -1
  80. package/dist/{chunk-RIC6OOJX.js → chunk-MFF3ONG5.js} +21 -1
  81. package/dist/{chunk-IMGJYFCX.js → chunk-MGRFDGWU.js} +3 -2
  82. package/dist/{chunk-ZPW4MJOV.js → chunk-MKTJEXZ3.js} +3 -3
  83. package/dist/{chunk-2I23NFVT.js → chunk-MXHTGVFZ.js} +52 -9
  84. package/dist/{chunk-5BHROGRB.js → chunk-N4QSPI3B.js} +54 -5
  85. package/dist/{chunk-DGQTJDSJ.js → chunk-NWDG3MSW.js} +1 -1
  86. package/dist/chunk-OP7IHC2I.js +24 -0
  87. package/dist/{chunk-EVFY3VE6.js → chunk-QOLITCIP.js} +1 -1
  88. package/dist/{chunk-W4Q7NFXU.js → chunk-TCQ43LSG.js} +3 -3
  89. package/dist/chunk-TCWKTUAE.js +50 -0
  90. package/dist/{chunk-EZAFBC2C.js → chunk-V5HPPF3E.js} +8 -4
  91. package/dist/{chunk-Q23MMVTD.js → chunk-WG3K4TCH.js} +1 -1
  92. package/dist/{chunk-F56SB65Y.js → chunk-WS4H76EP.js} +2 -2
  93. package/dist/{chunk-HWQNQVY6.js → chunk-WWOHTTVP.js} +2 -2
  94. package/dist/{chunk-NVGDMTX3.js → chunk-YIG2R3BJ.js} +9 -7
  95. package/dist/{chunk-HJXZJF6O.js → chunk-ZBHUHJG6.js} +4 -4
  96. package/dist/{chunk-5AXCOTIT.js → chunk-ZBK6E2OR.js} +1 -1
  97. package/dist/{chunk-5PMTC2CB.js → chunk-ZN3C6GBG.js} +84 -673
  98. package/dist/{chunk-GQHZIBAZ.js → chunk-ZSTSEBG7.js} +1 -1
  99. package/dist/{chunk-PYZC54KA.js → chunk-ZW3XZLJC.js} +61 -17
  100. package/dist/{global-upgrade-7F5RP45B.js → global-upgrade-I56HNM23.js} +6 -6
  101. package/dist/{paths-MELXIVBO.js → paths-AGY43CXS.js} +2 -2
  102. package/dist/reapply-IA5XUKWW.js +57 -0
  103. package/dist/src/index.d.ts +1 -0
  104. package/dist/src/index.js +19 -20
  105. package/dist/{upgrade-lock-AHRBA66K.js → upgrade-lock-B34TAUKV.js} +5 -3
  106. package/package.json +1 -1
  107. package/dist/chunk-HT3WMM6Q.js +0 -44
  108. package/dist/chunk-IR5FRUPQ.js +0 -197
  109. package/dist/chunk-JUFKJCZG.js +0 -38
  110. package/dist/chunk-SJN22ADZ.js +0 -86
  111. package/dist/reapply-NOB2Q6C4.js +0 -35
@@ -1,76 +1,112 @@
1
1
  #!/usr/bin/env node
2
+ import {
3
+ declinedAgentsFile,
4
+ recordDeclinedAgent
5
+ } from "../chunk-BXET3ALR.js";
6
+ import {
7
+ macAppBridgeAvailable
8
+ } from "../chunk-3Z3A37WD.js";
9
+ import {
10
+ isCursorPluginLeftover,
11
+ isPusharyCursorPluginManifest
12
+ } from "../chunk-TCWKTUAE.js";
13
+ import {
14
+ planFxRemoval,
15
+ removeInstructionBlock
16
+ } from "../chunk-ZN3C6GBG.js";
17
+ import "../chunk-HRULIYDU.js";
2
18
  import {
3
19
  OPENCODE_PLUGIN_SIBLING,
4
20
  OPENCODE_PLUGIN_SIBLING_CONTENTS,
5
21
  hasForeignPlugins,
6
22
  isOpenCodePluginOurs,
7
23
  openCodeConfigFile,
24
+ openCodeInstructionsFile,
8
25
  openCodePluginDir,
9
26
  openCodePluginFile,
10
27
  removeOpenCodeMcpServer
11
- } from "../chunk-RIC6OOJX.js";
28
+ } from "../chunk-MFF3ONG5.js";
12
29
  import {
13
30
  compatibleConfigFile,
31
+ compatibleInstructionsFile,
14
32
  compatibleMcpFile,
15
33
  compatiblePermissionRuleFile,
16
- removeCompatibleHooks,
17
- removeCompatibleMcpServer
18
- } from "../chunk-TE5M6GGK.js";
19
- import {
20
34
  isClaudeMcpSnapshot,
21
35
  removeClaudeMcpServers,
36
+ removeCompatibleHooks,
37
+ removeCompatibleMcpServer,
22
38
  removePusharySettings,
23
39
  removePusharyToolPermissions,
24
40
  restoreClaudeMcpServer
25
- } from "../chunk-IR5FRUPQ.js";
41
+ } from "../chunk-KHNFLYJO.js";
42
+ import "../chunk-YIG2R3BJ.js";
43
+ import "../chunk-DL7XWKYV.js";
44
+ import "../chunk-2QGYMY7A.js";
26
45
  import {
27
46
  removeGeminiSettings
28
- } from "../chunk-UKNKYTTY.js";
47
+ } from "../chunk-3I6IVOZV.js";
48
+ import "../chunk-WG3K4TCH.js";
29
49
  import "../chunk-6ICPEJY5.js";
30
- import "../chunk-CCDVL63C.js";
50
+ import "../chunk-KRCR2CRQ.js";
31
51
  import "../chunk-N6IOSZOE.js";
32
- import "../chunk-DJ4BB264.js";
33
- import "../chunk-WN6WYUCV.js";
34
- import "../chunk-DA4FTGTK.js";
52
+ import "../chunk-CD47ZFFZ.js";
53
+ import "../chunk-2VZAALEJ.js";
54
+ import "../chunk-DKMD6AWR.js";
35
55
  import "../chunk-POFBE6ZY.js";
36
56
  import {
37
57
  exitOnHelpFlag
38
- } from "../chunk-FBD3QGVJ.js";
39
- import "../chunk-ZPW4MJOV.js";
40
- import "../chunk-4QKM44N6.js";
41
- import "../chunk-W4Q7NFXU.js";
42
- import "../chunk-3BUAEQCY.js";
58
+ } from "../chunk-CKV3UPMU.js";
59
+ import "../chunk-GMXKITVA.js";
60
+ import "../chunk-N4QSPI3B.js";
61
+ import "../chunk-MKTJEXZ3.js";
62
+ import "../chunk-LWOO567I.js";
63
+ import "../chunk-TCQ43LSG.js";
64
+ import "../chunk-DUZVXBBU.js";
43
65
  import "../chunk-7QLSKOSU.js";
44
- import "../chunk-KZERVKTD.js";
45
- import "../chunk-75CA37FZ.js";
66
+ import {
67
+ EXIT
68
+ } from "../chunk-KZERVKTD.js";
69
+ import "../chunk-FQ2GORVG.js";
46
70
  import {
47
71
  claudeJson,
48
72
  claudeMcpReceipt,
49
73
  claudeSettings,
50
74
  claudeSettingsLocal,
75
+ codexAgentsMd,
51
76
  codexConfigToml,
52
77
  codexHookPositions,
53
78
  codexHooksJson,
79
+ cursorPluginDir,
80
+ cursorPluginManifest,
54
81
  cursorUserHooks,
55
82
  cursorUserMcp,
83
+ fxAgentsMd,
84
+ fxMcpProfile,
85
+ fxQuestionRuleReceipt,
86
+ fxSettings,
87
+ geminiMd,
56
88
  geminiSettings,
57
89
  removeCodexHooks,
58
90
  removeCodexSettings
59
- } from "../chunk-HJXZJF6O.js";
91
+ } from "../chunk-ZBHUHJG6.js";
60
92
  import "../chunk-T7E75EKA.js";
61
- import "../chunk-2QRE6QH2.js";
62
- import "../chunk-L6USMDTW.js";
93
+ import "../chunk-5QUPKDI5.js";
94
+ import {
95
+ isInvocationOf
96
+ } from "../chunk-7DVNSQWF.js";
63
97
  import {
64
98
  DISCONNECTABLE_AGENTS,
65
- hookCompatibleProfileBySource
66
- } from "../chunk-Q4E56K4X.js";
99
+ DISCONNECT_AGENT_IDS,
100
+ hookCompatibleProfileBySource,
101
+ normalizeAgentId
102
+ } from "../chunk-I5IJRMNV.js";
67
103
 
68
104
  // bin/pushary-disconnect.ts
69
105
  import { readdirSync, readFileSync, rmSync, writeFileSync } from "fs";
70
106
  import { parse as parseTOML, stringify as stringifyTOML } from "smol-toml";
71
107
 
72
108
  // src/disconnect.ts
73
- import { dirname } from "path";
109
+ import { dirname, join } from "path";
74
110
  var isDisconnectableAgent = (value) => DISCONNECTABLE_AGENTS.includes(value);
75
111
  var removeCursorHooks = (config) => {
76
112
  const hooks = config.hooks;
@@ -161,9 +197,42 @@ var disconnectRemovals = (agent) => {
161
197
  }
162
198
  ];
163
199
  };
200
+ var disconnectDirectories = (agent) => {
201
+ if (agent !== "cursor") return [];
202
+ return [{ path: cursorPluginDir(), manifest: cursorPluginManifest(), ownedBy: isPusharyCursorPluginManifest }];
203
+ };
204
+ var disconnectLeftoverDirectories = (agent, list) => {
205
+ if (agent !== "cursor") return [];
206
+ const parent = dirname(cursorPluginDir());
207
+ return list(parent).filter(isCursorPluginLeftover).map((name) => join(parent, name));
208
+ };
209
+ var disconnectInstructionFile = (agent) => {
210
+ switch (agent) {
211
+ case "codex":
212
+ return codexAgentsMd();
213
+ case "gemini":
214
+ return geminiMd();
215
+ case "opencode":
216
+ return openCodeInstructionsFile();
217
+ case "qwen":
218
+ case "codebuddy":
219
+ case "qoder":
220
+ case "droid":
221
+ case "devin": {
222
+ const profile = hookCompatibleProfileBySource(agent);
223
+ return profile ? compatibleInstructionsFile(profile) : null;
224
+ }
225
+ case "claude":
226
+ case "cursor":
227
+ return null;
228
+ }
229
+ };
230
+ var GATE_STILL_REGISTERED_NOTE = "kept because its gate could not be removed from the hooks file that points into it";
164
231
  var disconnectAgent = (agent, io) => {
165
232
  const changed = [];
166
233
  const untouched = [];
234
+ const unreadable = [];
235
+ const kept = [];
167
236
  const claudeReceiptPath = claudeMcpReceipt();
168
237
  const rawClaudeReceipt = agent === "claude" ? io.read(claudeReceiptPath) : null;
169
238
  let claudeReceipt = null;
@@ -196,6 +265,7 @@ var disconnectAgent = (agent, io) => {
196
265
  }
197
266
  } catch {
198
267
  untouched.push(edit.path);
268
+ unreadable.push(edit.path);
199
269
  }
200
270
  }
201
271
  for (const removal of disconnectRemovals(agent)) {
@@ -226,40 +296,105 @@ var disconnectAgent = (agent, io) => {
226
296
  untouched.push(claudeReceiptPath);
227
297
  }
228
298
  }
229
- return { agent, changed, untouched };
299
+ const removeDirectory = io.removeDirectory;
300
+ if (removeDirectory) {
301
+ const owned = disconnectDirectories(agent).filter((directory) => {
302
+ const manifest = io.read(directory.manifest);
303
+ return manifest !== null && directory.ownedBy(manifest);
304
+ });
305
+ const targets = [...owned.map((directory) => directory.path), ...disconnectLeftoverDirectories(agent, io.list ?? (() => []))];
306
+ for (const path of targets) {
307
+ if (unreadable.length > 0) {
308
+ kept.push(`${path} (${GATE_STILL_REGISTERED_NOTE})`);
309
+ continue;
310
+ }
311
+ try {
312
+ removeDirectory(path);
313
+ changed.push(path);
314
+ } catch {
315
+ untouched.push(path);
316
+ }
317
+ }
318
+ }
319
+ const instructions = disconnectInstructionFile(agent);
320
+ if (instructions && io.removeInstructionBlock?.(instructions)) changed.push(instructions);
321
+ return { agent, changed, untouched, kept };
322
+ };
323
+ var disconnectFx = (io) => {
324
+ const changed = [];
325
+ const kept = [];
326
+ for (const action of planFxRemoval(fxMcpProfile(), fxSettings(), fxQuestionRuleReceipt())) {
327
+ if (action.kind === "write") {
328
+ io.write(action.path, action.text);
329
+ changed.push(action.path);
330
+ } else if (action.kind === "remove-receipt") {
331
+ io.remove(action.path);
332
+ changed.push(action.path);
333
+ } else if (action.kind === "kept") {
334
+ kept.push(`${action.label}: ${action.detail}`);
335
+ }
336
+ }
337
+ if (io.removeInstructionBlock(fxAgentsMd())) changed.push(fxAgentsMd());
338
+ return { changed, kept };
230
339
  };
231
340
 
232
341
  // bin/pushary-disconnect.ts
233
342
  exitOnHelpFlag("disconnect");
343
+ var MAC_APP_LEAVES_IT_OFF = (agent) => `The Pushary Mac app will leave ${agent} off until you connect it again, from the app or with pushary setup.`;
344
+ var MAC_APP_MAY_RESTORE_IT = (agent, file) => `Could not write ${file}, so a running Pushary Mac app may connect ${agent} again. Turn it off in the app's Settings too.`;
234
345
  var rest = process.argv.slice(2);
235
- var requested = rest[0] === "disconnect" ? rest[1] : rest[0];
236
- if (!requested || !isDisconnectableAgent(requested)) {
237
- console.error(`Usage: pushary disconnect <${DISCONNECTABLE_AGENTS.join("|")}>`);
238
- process.exit(1);
346
+ var typed = rest[0] !== void 0 && isInvocationOf(rest[0], "disconnect") ? rest[1] : rest[0];
347
+ var requested = typed === void 0 ? null : normalizeAgentId(typed, DISCONNECT_AGENT_IDS);
348
+ var printResult = (agent, changed, kept) => {
349
+ if (changed.length === 0) console.log(`${agent} was not connected.`);
350
+ else {
351
+ console.log(`Disconnected ${agent}:`);
352
+ for (const path of changed) console.log(` ${path}`);
353
+ }
354
+ if (kept.length > 0) {
355
+ console.log("Left as it is:");
356
+ for (const line of kept) console.log(` ${line}`);
357
+ }
358
+ };
359
+ if (requested === null) {
360
+ if (typed !== void 0) console.error(`Unknown agent: ${typed}`);
361
+ console.error(`Usage: pushary disconnect <${DISCONNECT_AGENT_IDS.join("|")}>`);
362
+ console.error("Setup ids such as claude_code and gemini_cli work too.");
363
+ process.exit(EXIT.FAILED);
239
364
  }
240
- var result = disconnectAgent(requested, {
241
- read: (path) => {
242
- try {
243
- return readFileSync(path, "utf-8");
244
- } catch {
245
- return null;
246
- }
247
- },
248
- write: (path, contents) => writeFileSync(path, contents, "utf-8"),
249
- parseToml: (raw) => parseTOML(raw),
250
- stringifyToml: (config) => stringifyTOML(config),
251
- remove: (path) => rmSync(path, { force: true }),
252
- list: (dir) => {
253
- try {
254
- return readdirSync(dir);
255
- } catch {
256
- return [];
257
- }
365
+ if (isDisconnectableAgent(requested)) {
366
+ const decline = recordDeclinedAgent(requested);
367
+ const result = disconnectAgent(requested, {
368
+ read: (path) => {
369
+ try {
370
+ return readFileSync(path, "utf-8");
371
+ } catch {
372
+ return null;
373
+ }
374
+ },
375
+ write: (path, contents) => writeFileSync(path, contents, "utf-8"),
376
+ parseToml: (raw) => parseTOML(raw),
377
+ stringifyToml: (config) => stringifyTOML(config),
378
+ remove: (path) => rmSync(path, { force: true }),
379
+ list: (dir) => {
380
+ try {
381
+ return readdirSync(dir);
382
+ } catch {
383
+ return [];
384
+ }
385
+ },
386
+ removeDirectory: (path) => rmSync(path, { recursive: true, force: true }),
387
+ removeInstructionBlock
388
+ });
389
+ printResult(requested, result.changed, result.kept);
390
+ if (decline !== "unchanged" && macAppBridgeAvailable()) {
391
+ console.log(decline === "changed" ? MAC_APP_LEAVES_IT_OFF(requested) : MAC_APP_MAY_RESTORE_IT(requested, declinedAgentsFile()));
258
392
  }
259
- });
260
- if (result.changed.length === 0) {
261
- console.log(`${requested} was not connected.`);
262
393
  } else {
263
- console.log(`Disconnected ${requested}:`);
264
- for (const path of result.changed) console.log(` ${path}`);
394
+ const result = disconnectFx({
395
+ write: (path, contents) => writeFileSync(path, contents, "utf-8"),
396
+ remove: (path) => rmSync(path, { force: true }),
397
+ removeInstructionBlock
398
+ });
399
+ printResult(requested, result.changed, result.kept);
265
400
  }
@@ -6,58 +6,62 @@ import {
6
6
  readServiceExecPath,
7
7
  versionManagerOf
8
8
  } from "../chunk-GU3EJCVV.js";
9
+ import {
10
+ CODEX_HOOK_REMEDY
11
+ } from "../chunk-6TE27XZR.js";
9
12
  import {
10
13
  writeStdoutFully
11
14
  } from "../chunk-EO23EUOK.js";
12
15
  import {
13
16
  assessCodexHookTrust,
14
17
  readCodexTrustForPusharyHooks
15
- } from "../chunk-IMGJYFCX.js";
18
+ } from "../chunk-MGRFDGWU.js";
16
19
  import {
17
20
  readMachineReadiness,
18
21
  readManagedControlEvidence
19
- } from "../chunk-SVTHEMM3.js";
22
+ } from "../chunk-2QTO5YIT.js";
20
23
  import {
21
- FX_PROFILE_REFUSALS,
22
- FX_PUSHARY_TOOLS_RULE,
23
- FX_QUESTION_TOOL,
24
24
  HERMES_PIP_PACKAGE,
25
25
  HERMES_PLUGIN_NAME,
26
26
  agentProbes,
27
27
  detectAgent,
28
28
  detectAllAgents,
29
- hasInstructionBlock,
30
29
  hermesWiredByPushary,
31
- inspectFxInstallation,
32
30
  isDetected,
33
31
  isPluginRegistered,
34
32
  readHermesStatus,
35
33
  resolveHermesPython,
36
- retryAgentCommand,
37
34
  shortenHome,
38
35
  vscodeSettingsTargets
39
- } from "../chunk-5PMTC2CB.js";
40
- import "../chunk-WUKUXICK.js";
36
+ } from "../chunk-KFF7G225.js";
37
+ import {
38
+ FX_PROFILE_REFUSALS,
39
+ FX_PUSHARY_TOOLS_RULE,
40
+ FX_QUESTION_TOOL,
41
+ hasInstructionBlock,
42
+ inspectFxInstallation,
43
+ retryAgentCommand
44
+ } from "../chunk-ZN3C6GBG.js";
45
+ import "../chunk-HRULIYDU.js";
41
46
  import {
42
47
  OPENCODE_PLUGIN_PLACEHOLDER,
43
48
  openCodePluginDir,
44
49
  openCodePluginFile,
45
50
  openCodeWired
46
- } from "../chunk-RIC6OOJX.js";
51
+ } from "../chunk-MFF3ONG5.js";
47
52
  import {
48
53
  compatibleConfigFile,
49
54
  compatibleInstructionsFile,
50
55
  compatibleMcpFile,
51
56
  hasCompatibleHooks,
52
57
  missingCompatibleHookEvents
53
- } from "../chunk-TE5M6GGK.js";
54
- import "../chunk-IR5FRUPQ.js";
58
+ } from "../chunk-KHNFLYJO.js";
55
59
  import {
56
60
  detectProviderLiveCapabilities,
57
61
  expectedLaunchCapabilities,
58
62
  hasSpawnProvider,
59
63
  resolveControlPolicy
60
- } from "../chunk-MKJ3RTUS.js";
64
+ } from "../chunk-I6MJXLMY.js";
61
65
  import "../chunk-RIVNNBEK.js";
62
66
  import {
63
67
  AUTO_UPDATE_DISABLE_ENV,
@@ -66,16 +70,19 @@ import {
66
70
  describeAutoUpdateCheck,
67
71
  readAutoUpdateState,
68
72
  takeAutoUpdateAnnouncement
69
- } from "../chunk-SNJ3BOCP.js";
73
+ } from "../chunk-7PT35RY2.js";
70
74
  import {
71
75
  readLedgerSummary
72
- } from "../chunk-GQHZIBAZ.js";
76
+ } from "../chunk-ZSTSEBG7.js";
73
77
  import {
74
- describeBridgeResolution,
75
- isBridgeLocator,
76
- liveBridgeProbe,
77
- resolveBridgeStub
78
- } from "../chunk-SJN22ADZ.js";
78
+ daemonHasRemoteProof,
79
+ daemonServiceManagerAvailable,
80
+ describeDaemonLoginBlock,
81
+ hasDaemonServiceDefinition,
82
+ readDaemonNeedsLogin,
83
+ readDaemonStatus,
84
+ readInstalledDaemonService
85
+ } from "../chunk-LKLVTG3V.js";
79
86
  import {
80
87
  claudeOtherHolders,
81
88
  claudeUnprovenHolds,
@@ -86,34 +93,29 @@ import {
86
93
  cursorMcpAuthorization,
87
94
  cursorOtherHolders,
88
95
  cursorWired,
96
+ describeBridgeResolution,
89
97
  describeHoldSentence,
90
98
  describeOtherHolder,
91
99
  geminiOtherHolders,
92
100
  geminiWired,
93
101
  holdsLong,
94
- pusharyHookExecutable
95
- } from "../chunk-D7SOOVHX.js";
96
- import {
97
- daemonHasRemoteProof,
98
- daemonServiceManagerAvailable,
99
- describeDaemonLoginBlock,
100
- hasDaemonServiceDefinition,
101
- readDaemonNeedsLogin,
102
- readDaemonStatus,
103
- readInstalledDaemonService
104
- } from "../chunk-ZC3TF4LR.js";
102
+ isBridgeLocator,
103
+ liveBridgeProbe,
104
+ pusharyHookExecutable,
105
+ resolveBridgeStub
106
+ } from "../chunk-2QGYMY7A.js";
105
107
  import {
106
108
  GEMINI_HOOK_BINARY,
107
109
  hasGeminiHooks,
108
110
  missingGeminiHookEvents
109
- } from "../chunk-UKNKYTTY.js";
111
+ } from "../chunk-3I6IVOZV.js";
110
112
  import "../chunk-XHKBHWLX.js";
111
113
  import "../chunk-6ICPEJY5.js";
112
- import "../chunk-CCDVL63C.js";
114
+ import "../chunk-KRCR2CRQ.js";
113
115
  import "../chunk-N6IOSZOE.js";
114
- import "../chunk-DJ4BB264.js";
115
- import "../chunk-WN6WYUCV.js";
116
- import "../chunk-DA4FTGTK.js";
116
+ import "../chunk-CD47ZFFZ.js";
117
+ import "../chunk-2VZAALEJ.js";
118
+ import "../chunk-DKMD6AWR.js";
117
119
  import "../chunk-POFBE6ZY.js";
118
120
  import {
119
121
  describeReach,
@@ -122,15 +124,21 @@ import {
122
124
  reachVerdict,
123
125
  roundTripEvidence,
124
126
  verifyRoundTrip
125
- } from "../chunk-YPXUD6DW.js";
127
+ } from "../chunk-IAD2RT4L.js";
126
128
  import "../chunk-3EGEA4KH.js";
127
129
  import "../chunk-QCGNGEGE.js";
130
+ import {
131
+ SIGNED_OUT_ON_MAC_MESSAGE,
132
+ activeKeyVerdictOf,
133
+ describeSignedOutKey,
134
+ readSignedOutDiagnosis
135
+ } from "../chunk-2WXF3QJR.js";
128
136
  import {
129
137
  createIo
130
138
  } from "../chunk-U4TMAANR.js";
131
139
  import {
132
140
  exitOnHelpFlag
133
- } from "../chunk-FBD3QGVJ.js";
141
+ } from "../chunk-CKV3UPMU.js";
134
142
  import {
135
143
  parseFlags
136
144
  } from "../chunk-GMXKITVA.js";
@@ -138,26 +146,26 @@ import {
138
146
  keyPrefix,
139
147
  readControlMode,
140
148
  readKeySource
141
- } from "../chunk-5BHROGRB.js";
149
+ } from "../chunk-N4QSPI3B.js";
142
150
  import {
143
151
  callMcpTool,
144
152
  sendMcpRequest
145
- } from "../chunk-ZPW4MJOV.js";
153
+ } from "../chunk-MKTJEXZ3.js";
146
154
  import {
147
155
  checkApiKey,
148
156
  describeKeyCheck
149
- } from "../chunk-4QKM44N6.js";
150
- import "../chunk-W4Q7NFXU.js";
157
+ } from "../chunk-LWOO567I.js";
158
+ import "../chunk-TCQ43LSG.js";
151
159
  import {
152
160
  getMachineId
153
- } from "../chunk-3BUAEQCY.js";
161
+ } from "../chunk-DUZVXBBU.js";
154
162
  import {
155
163
  UsageError
156
164
  } from "../chunk-7QLSKOSU.js";
157
165
  import {
158
166
  EXIT
159
167
  } from "../chunk-KZERVKTD.js";
160
- import "../chunk-75CA37FZ.js";
168
+ import "../chunk-FQ2GORVG.js";
161
169
  import {
162
170
  CODEX_HOOK_EVENTS,
163
171
  CODEX_REQUIRED_APPROVAL_EVENTS,
@@ -188,14 +196,14 @@ import {
188
196
  readGlobalCliInstall,
189
197
  resolvePathBinary,
190
198
  vscodePluginDir
191
- } from "../chunk-HJXZJF6O.js";
199
+ } from "../chunk-ZBHUHJG6.js";
192
200
  import "../chunk-T7E75EKA.js";
193
201
  import {
194
202
  getBaseUrl
195
- } from "../chunk-2QRE6QH2.js";
203
+ } from "../chunk-5QUPKDI5.js";
196
204
  import {
197
205
  NPX_LATEST_COMMAND
198
- } from "../chunk-L6USMDTW.js";
206
+ } from "../chunk-7DVNSQWF.js";
199
207
  import {
200
208
  AGENTS,
201
209
  CURSOR_GATE_EVENTS,
@@ -211,7 +219,7 @@ import {
211
219
  hookCompatibleProfile,
212
220
  isHookActivationReport,
213
221
  isNewerVersion
214
- } from "../chunk-Q4E56K4X.js";
222
+ } from "../chunk-I5IJRMNV.js";
215
223
 
216
224
  // bin/pushary-doctor.ts
217
225
  import { existsSync, readFileSync, writeFileSync } from "fs";
@@ -633,10 +641,10 @@ var reportCodexOwnTrust = (assessment) => {
633
641
  }
634
642
  };
635
643
  var describeStoredCodexTrust = (untrusted, disabled, missing, asynchronous) => {
636
- if (asynchronous.length > 0) return `asynchronous (${asynchronous.join(", ")}) \u2014 re-run setup to restore blocking permission hooks`;
637
- if (missing.length > 0) return `missing (${missing.join(", ")}) \u2014 re-run setup to register the permission hooks`;
638
- if (disabled.length > 0) return `disabled (${disabled.join(", ")}) \u2014 type /hooks in Codex to enable the permission hooks`;
639
- if (untrusted.length > 0) return `untrusted (${untrusted.join(", ")}) \u2014 type /hooks in Codex and trust them, once`;
644
+ if (asynchronous.length > 0) return `asynchronous (${asynchronous.join(", ")}) \u2014 ${CODEX_HOOK_REMEDY.asynchronous}`;
645
+ if (missing.length > 0) return `missing (${missing.join(", ")}) \u2014 ${CODEX_HOOK_REMEDY.missing}`;
646
+ if (disabled.length > 0) return `disabled (${disabled.join(", ")}) \u2014 ${CODEX_HOOK_REMEDY.disabled}`;
647
+ if (untrusted.length > 0) return `untrusted (${untrusted.join(", ")}) \u2014 ${CODEX_HOOK_REMEDY.untrusted}`;
640
648
  return "all events trusted";
641
649
  };
642
650
  var skipped = (label, why) => {
@@ -688,8 +696,12 @@ var main = async () => {
688
696
  );
689
697
  }
690
698
  let keyVerdict = null;
691
- if (apiKey) {
692
- keyVerdict = await checkApiKey(apiKey);
699
+ if (apiKey) keyVerdict = await checkApiKey(apiKey);
700
+ const signedOut = readSignedOutDiagnosis(apiKey ?? null, activeKeyVerdictOf(keyVerdict));
701
+ if (signedOut.kind === "signed_out_on_mac") {
702
+ check(false, "Key still signed in", SIGNED_OUT_ON_MAC_MESSAGE);
703
+ for (const line of describeSignedOutKey(signedOut)) console.log(` ${dim(line)}`);
704
+ } else if (keyVerdict) {
693
705
  switch (keyVerdict.kind) {
694
706
  case "ok":
695
707
  check(
@@ -1345,7 +1357,7 @@ var main = async () => {
1345
1357
  check(
1346
1358
  verdict.kind === "yours",
1347
1359
  "Phone reachable",
1348
- verdict.kind === "yours" ? describeReach(channels) : verdict.kind === "nobody" ? "nothing connected, run pushary connect or get the app at https://pushary.com/download" : `${describeReach(channels)}; run pushary connect to add your own`,
1360
+ verdict.kind === "yours" ? describeReach(channels) : verdict.kind === "nobody" ? "no phone paired, run pushary pair or get the app at https://pushary.com/download" : `${describeReach(channels)}; run pushary pair to pair your own`,
1349
1361
  "reachability"
1350
1362
  );
1351
1363
  }
@@ -1,53 +1,52 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  readHookInput
4
- } from "../chunk-HWQNQVY6.js";
4
+ } from "../chunk-WWOHTTVP.js";
5
5
  import {
6
6
  announceSubscriptionRequired,
7
7
  isDeferAnswer
8
8
  } from "../chunk-5OP5MQI7.js";
9
- import "../chunk-VRT3EEZN.js";
9
+ import "../chunk-DPGSLWOS.js";
10
10
  import "../chunk-SGZJ5LYH.js";
11
- import "../chunk-NVGDMTX3.js";
12
- import "../chunk-SPXBXN23.js";
13
- import "../chunk-SJN22ADZ.js";
14
- import "../chunk-D7SOOVHX.js";
15
- import "../chunk-ZC3TF4LR.js";
16
- import "../chunk-UKNKYTTY.js";
17
- import "../chunk-Q23MMVTD.js";
18
- import "../chunk-5AXCOTIT.js";
19
- import "../chunk-7JTVYR5B.js";
20
- import "../chunk-KK54WQ74.js";
11
+ import "../chunk-YIG2R3BJ.js";
12
+ import "../chunk-DL7XWKYV.js";
13
+ import "../chunk-LKLVTG3V.js";
14
+ import "../chunk-2QGYMY7A.js";
15
+ import "../chunk-3I6IVOZV.js";
16
+ import "../chunk-WG3K4TCH.js";
17
+ import "../chunk-ZBK6E2OR.js";
18
+ import "../chunk-CLOSJ4ES.js";
19
+ import "../chunk-M6BZZFVQ.js";
21
20
  import "../chunk-XHKBHWLX.js";
22
21
  import "../chunk-6ICPEJY5.js";
23
22
  import "../chunk-N6IOSZOE.js";
24
- import "../chunk-DJ4BB264.js";
23
+ import "../chunk-CD47ZFFZ.js";
25
24
  import {
26
25
  askUser,
27
26
  isDecisionStopped,
28
27
  waitForQuestion
29
- } from "../chunk-WN6WYUCV.js";
30
- import "../chunk-DA4FTGTK.js";
28
+ } from "../chunk-2VZAALEJ.js";
29
+ import "../chunk-DKMD6AWR.js";
31
30
  import "../chunk-POFBE6ZY.js";
32
31
  import "../chunk-GMXKITVA.js";
33
- import "../chunk-5BHROGRB.js";
32
+ import "../chunk-N4QSPI3B.js";
34
33
  import {
35
34
  SubscriptionRequiredError
36
- } from "../chunk-ZPW4MJOV.js";
37
- import "../chunk-4QKM44N6.js";
38
- import "../chunk-W4Q7NFXU.js";
35
+ } from "../chunk-MKTJEXZ3.js";
36
+ import "../chunk-LWOO567I.js";
37
+ import "../chunk-TCQ43LSG.js";
39
38
  import {
40
39
  getMachineId
41
- } from "../chunk-3BUAEQCY.js";
40
+ } from "../chunk-DUZVXBBU.js";
42
41
  import "../chunk-7QLSKOSU.js";
43
42
  import "../chunk-KZERVKTD.js";
44
- import "../chunk-75CA37FZ.js";
45
- import "../chunk-HJXZJF6O.js";
43
+ import "../chunk-FQ2GORVG.js";
44
+ import "../chunk-ZBHUHJG6.js";
46
45
  import "../chunk-T7E75EKA.js";
47
46
  import {
48
47
  getApiKey
49
- } from "../chunk-2QRE6QH2.js";
50
- import "../chunk-L6USMDTW.js";
48
+ } from "../chunk-5QUPKDI5.js";
49
+ import "../chunk-7DVNSQWF.js";
51
50
  import {
52
51
  ELICITATION_ANSWERABLE_MODE,
53
52
  effectiveWaitSeconds,
@@ -58,7 +57,7 @@ import {
58
57
  planElicitationAsk,
59
58
  readElicitationFields,
60
59
  renderElicitationOutput
61
- } from "../chunk-Q4E56K4X.js";
60
+ } from "../chunk-I5IJRMNV.js";
62
61
 
63
62
  // bin/pushary-elicitation-hook.ts
64
63
  import { basename } from "path";