@pushary/agent-hooks 1.9.7 → 1.9.9

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 +18 -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 -24
  6. package/dist/bin/pushary-bell.js +13 -13
  7. package/dist/bin/pushary-claude.js +28 -30
  8. package/dist/bin/pushary-clean.js +113 -94
  9. package/dist/bin/pushary-codex-bridge.js +20 -20
  10. package/dist/bin/pushary-codex-hook.js +36 -38
  11. package/dist/bin/pushary-codex.js +13 -13
  12. package/dist/bin/pushary-connect.js +48 -22
  13. package/dist/bin/pushary-cowork.js +5 -5
  14. package/dist/bin/pushary-daemon.js +50 -40
  15. package/dist/bin/pushary-disconnect.js +188 -56
  16. package/dist/bin/pushary-doctor.js +105 -85
  17. package/dist/bin/pushary-elicitation-hook.js +25 -27
  18. package/dist/bin/pushary-gemini-bridge.js +13 -13
  19. package/dist/bin/pushary-gemini-hook.js +31 -33
  20. package/dist/bin/pushary-hook.js +36 -39
  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 +29 -32
  26. package/dist/bin/pushary-opencode-hook.js +30 -32
  27. package/dist/bin/pushary-permission-denied-hook.js +30 -33
  28. package/dist/bin/pushary-permission-hook.js +33 -36
  29. package/dist/bin/pushary-post-hook.js +30 -33
  30. package/dist/bin/pushary-prompt-hook.js +29 -32
  31. package/dist/bin/pushary-session-end-hook.js +29 -32
  32. package/dist/bin/pushary-session-start-hook.js +33 -36
  33. package/dist/bin/pushary-setup.js +168 -160
  34. package/dist/bin/pushary-stats.js +5 -5
  35. package/dist/bin/pushary-status.js +65 -19
  36. package/dist/bin/pushary-stop-hook.js +29 -32
  37. package/dist/bin/pushary-stopfailure-hook.js +29 -32
  38. package/dist/bin/pushary-suggestions.js +19 -21
  39. package/dist/bin/pushary-transcript-register.js +18 -20
  40. package/dist/bin/pushary-transcripts.js +7 -7
  41. package/dist/bin/pushary-upgrade.js +50 -26
  42. package/dist/bin/pushary-wait.js +23 -19
  43. package/dist/bin/pushary.js +15 -14
  44. package/dist/{chunk-4FK6RZVJ.js → chunk-462EQA6K.js} +1 -1
  45. package/dist/{chunk-STQRUH3S.js → chunk-5DCDQ5VW.js} +59 -15
  46. package/dist/{chunk-JXISQ7DT.js → chunk-5N5L6DNN.js} +3 -3
  47. package/dist/{chunk-QR6VE5ME.js → chunk-5RGA636G.js} +79 -17
  48. package/dist/{chunk-L76HTPU6.js → chunk-6AYSKVLL.js} +3 -3
  49. package/dist/{chunk-NIBFSARF.js → chunk-6EBGOHDJ.js} +33 -13
  50. package/dist/{chunk-QQ4HBXZC.js → chunk-6W5M3MSE.js} +84 -673
  51. package/dist/{chunk-R3YW55MY.js → chunk-AI7RMFVV.js} +29 -26
  52. package/dist/{chunk-AUUXS44H.js → chunk-APP43AW7.js} +1 -1
  53. package/dist/{chunk-RQGODFQN.js → chunk-AZOKPWVI.js} +1 -1
  54. package/dist/{chunk-3GNUXXDZ.js → chunk-B5NMSP3V.js} +2 -2
  55. package/dist/{chunk-4D2AYNSE.js → chunk-BNSKVIAW.js} +2 -2
  56. package/dist/chunk-BYLKCZ2G.js +367 -0
  57. package/dist/{chunk-X5NXPCIC.js → chunk-BZLHTMT6.js} +89 -7
  58. package/dist/{chunk-BTQGAXZ3.js → chunk-COQ64C4F.js} +10 -10
  59. package/dist/{chunk-N4EUSDKX.js → chunk-DCCSULXK.js} +14 -14
  60. package/dist/{chunk-JWKBDSPF.js → chunk-DP3WX7FW.js} +2 -2
  61. package/dist/chunk-E5HOHIUV.js +52 -0
  62. package/dist/{chunk-GU3EJCVV.js → chunk-EA5NWDK7.js} +4 -0
  63. package/dist/chunk-EIAEUG7G.js +46 -0
  64. package/dist/{chunk-EB4XGVBG.js → chunk-EUW7JL2K.js} +0 -32
  65. package/dist/{chunk-T7Y5EADL.js → chunk-F7R3SZ4Q.js} +2 -2
  66. package/dist/{chunk-H37L7TT3.js → chunk-G7RIDXAT.js} +2 -2
  67. package/dist/{chunk-W2KI5KPD.js → chunk-H5T27W7M.js} +2 -2
  68. package/dist/chunk-HBWYMRR5.js +94 -0
  69. package/dist/{chunk-CBQACHKY.js → chunk-IIVZZMSO.js} +1 -1
  70. package/dist/{chunk-Z6HPS67T.js → chunk-IRHABAQT.js} +1 -1
  71. package/dist/{chunk-QTO6HEZD.js → chunk-K545B734.js} +2 -2
  72. package/dist/{chunk-KYO45G5L.js → chunk-KOWFRUIT.js} +1 -1
  73. package/dist/{chunk-QFEM7R6T.js → chunk-KQFTBQ66.js} +11 -11
  74. package/dist/chunk-LENBKYRB.js +50 -0
  75. package/dist/{chunk-JCWZ23MJ.js → chunk-M3STIAGU.js} +3 -3
  76. package/dist/{chunk-6DJTDHBI.js → chunk-MD4SVNT6.js} +1 -1
  77. package/dist/{chunk-7264S5HZ.js → chunk-MLGIVVSG.js} +1 -1
  78. package/dist/{chunk-H7MMU64M.js → chunk-NGKUXZID.js} +2 -2
  79. package/dist/{chunk-JWQZSYCK.js → chunk-NUVGDBZC.js} +1 -1
  80. package/dist/{chunk-AQ55ZSSS.js → chunk-OAYWO5NP.js} +1 -1
  81. package/dist/chunk-Q6C6ILUS.js +49 -0
  82. package/dist/{chunk-MBK7N46B.js → chunk-QIOIO7VN.js} +6 -6
  83. package/dist/{chunk-KFKL3FHS.js → chunk-QRXPWW3M.js} +4 -3
  84. package/dist/{chunk-7OIWWZAD.js → chunk-QTIUJZRX.js} +3 -3
  85. package/dist/{chunk-XWAYAO3V.js → chunk-R5RIVOPL.js} +2 -2
  86. package/dist/{chunk-ADSQDYYG.js → chunk-REU2VQPH.js} +54 -5
  87. package/dist/{chunk-GKI6LFAV.js → chunk-RQ32ADJP.js} +2 -2
  88. package/dist/{chunk-VXRXFU6Q.js → chunk-SZ4Q6ZVS.js} +14 -7
  89. package/dist/{chunk-KT5E2RLS.js → chunk-T6ZN4TEF.js} +1 -1
  90. package/dist/{chunk-UFVGSEWH.js → chunk-TO3PS646.js} +2 -2
  91. package/dist/chunk-UAP5DS6P.js +599 -0
  92. package/dist/{chunk-MZPXVH4A.js → chunk-UF6RBP5V.js} +204 -28
  93. package/dist/{chunk-AVNKVF7N.js → chunk-UPIZSCYD.js} +4 -4
  94. package/dist/{chunk-3PVDOCFI.js → chunk-VHPFNLRS.js} +5 -5
  95. package/dist/{chunk-HPRZJKRO.js → chunk-VIIHC42X.js} +1 -1
  96. package/dist/{chunk-D6S5EKXA.js → chunk-WRPYCIV2.js} +8 -12
  97. package/dist/{chunk-ZUTU43FT.js → chunk-Z23ZBYDW.js} +6 -4
  98. package/dist/{chunk-SBLPHUEB.js → chunk-ZGADIZDS.js} +8 -6
  99. package/dist/{global-upgrade-E2HUEB4B.js → global-upgrade-H272QOGD.js} +6 -6
  100. package/dist/{paths-QVTEGNZV.js → paths-HMVOTFUN.js} +2 -2
  101. package/dist/reapply-Q5NHDTVU.js +55 -0
  102. package/dist/src/index.d.ts +1 -0
  103. package/dist/src/index.js +19 -20
  104. package/dist/{upgrade-lock-JCIDZMHF.js → upgrade-lock-L3GHFIRW.js} +3 -3
  105. package/package.json +1 -1
  106. package/dist/chunk-4YO4T5FV.js +0 -149
  107. package/dist/chunk-ANEAA37E.js +0 -197
  108. package/dist/chunk-MNWRUGMH.js +0 -86
  109. package/dist/chunk-RQSOEB4S.js +0 -44
  110. package/dist/chunk-SD3272LS.js +0 -143
  111. package/dist/reapply-5QVKM6LA.js +0 -38
@@ -1,76 +1,109 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
- compatibleConfigFile,
4
- compatibleMcpFile,
5
- compatiblePermissionRuleFile,
6
- removeCompatibleHooks,
7
- removeCompatibleMcpServer
8
- } from "../chunk-MZPXVH4A.js";
3
+ declinedAgentsFile,
4
+ recordDeclinedAgent
5
+ } from "../chunk-EIAEUG7G.js";
6
+ import {
7
+ isCursorPluginLeftover,
8
+ isPusharyCursorPluginManifest
9
+ } from "../chunk-LENBKYRB.js";
10
+ import {
11
+ planFxRemoval,
12
+ removeInstructionBlock
13
+ } from "../chunk-6W5M3MSE.js";
14
+ import "../chunk-H5T27W7M.js";
9
15
  import {
10
16
  OPENCODE_PLUGIN_SIBLING,
11
17
  OPENCODE_PLUGIN_SIBLING_CONTENTS,
12
18
  hasForeignPlugins,
13
19
  isOpenCodePluginOurs,
20
+ macAppBridgeAvailable,
14
21
  openCodeConfigFile,
22
+ openCodeInstructionsFile,
15
23
  openCodePluginDir,
16
24
  openCodePluginFile,
17
25
  removeOpenCodeMcpServer
18
- } from "../chunk-X5NXPCIC.js";
26
+ } from "../chunk-BZLHTMT6.js";
19
27
  import {
28
+ compatibleConfigFile,
29
+ compatibleInstructionsFile,
30
+ compatibleMcpFile,
31
+ compatiblePermissionRuleFile,
20
32
  isClaudeMcpSnapshot,
21
33
  removeClaudeMcpServers,
34
+ removeCompatibleHooks,
35
+ removeCompatibleMcpServer,
22
36
  removePusharySettings,
23
37
  removePusharyToolPermissions,
24
38
  restoreClaudeMcpServer
25
- } from "../chunk-ANEAA37E.js";
39
+ } from "../chunk-UF6RBP5V.js";
40
+ import {
41
+ exitOnHelpFlag
42
+ } from "../chunk-TO3PS646.js";
43
+ import "../chunk-BYLKCZ2G.js";
26
44
  import {
27
45
  removeGeminiSettings
28
- } from "../chunk-JCWZ23MJ.js";
46
+ } from "../chunk-M3STIAGU.js";
47
+ import "../chunk-ZGADIZDS.js";
48
+ import "../chunk-MLGIVVSG.js";
49
+ import "../chunk-GMXKITVA.js";
29
50
  import "../chunk-6ICPEJY5.js";
30
- import "../chunk-QFEM7R6T.js";
51
+ import "../chunk-REU2VQPH.js";
52
+ import "../chunk-KQFTBQ66.js";
31
53
  import "../chunk-N6IOSZOE.js";
32
- import "../chunk-6DJTDHBI.js";
33
- import "../chunk-D6S5EKXA.js";
34
- import "../chunk-AVNKVF7N.js";
54
+ import "../chunk-MD4SVNT6.js";
55
+ import "../chunk-WRPYCIV2.js";
56
+ import "../chunk-6AYSKVLL.js";
57
+ import "../chunk-QRXPWW3M.js";
58
+ import "../chunk-UPIZSCYD.js";
35
59
  import "../chunk-POFBE6ZY.js";
36
- import {
37
- exitOnHelpFlag
38
- } from "../chunk-UFVGSEWH.js";
39
- import "../chunk-L76HTPU6.js";
40
- import "../chunk-KFKL3FHS.js";
41
- import "../chunk-JXISQ7DT.js";
42
- import "../chunk-KYO45G5L.js";
60
+ import "../chunk-5N5L6DNN.js";
61
+ import "../chunk-KOWFRUIT.js";
43
62
  import "../chunk-7QLSKOSU.js";
44
- import "../chunk-KZERVKTD.js";
45
- import "../chunk-4D2AYNSE.js";
63
+ import {
64
+ EXIT
65
+ } from "../chunk-KZERVKTD.js";
66
+ import "../chunk-BNSKVIAW.js";
46
67
  import {
47
68
  claudeJson,
48
69
  claudeMcpReceipt,
49
70
  claudeSettings,
50
71
  claudeSettingsLocal,
72
+ codexAgentsMd,
51
73
  codexConfigToml,
52
74
  codexHookPositions,
53
75
  codexHooksJson,
76
+ cursorPluginDir,
77
+ cursorPluginManifest,
54
78
  cursorUserHooks,
55
79
  cursorUserMcp,
80
+ fxAgentsMd,
81
+ fxMcpProfile,
82
+ fxQuestionRuleReceipt,
83
+ fxSettings,
84
+ geminiMd,
56
85
  geminiSettings,
57
86
  removeCodexHooks,
58
87
  removeCodexSettings
59
- } from "../chunk-ZUTU43FT.js";
88
+ } from "../chunk-Z23ZBYDW.js";
60
89
  import "../chunk-T7E75EKA.js";
61
- import "../chunk-Z6HPS67T.js";
62
- import "../chunk-STQRUH3S.js";
90
+ import "../chunk-IRHABAQT.js";
91
+ import {
92
+ isInvocationOf
93
+ } from "../chunk-5DCDQ5VW.js";
63
94
  import {
64
95
  DISCONNECTABLE_AGENTS,
65
- hookCompatibleProfileBySource
66
- } from "../chunk-QR6VE5ME.js";
96
+ DISCONNECT_AGENT_IDS,
97
+ hookCompatibleProfileBySource,
98
+ normalizeAgentId
99
+ } from "../chunk-5RGA636G.js";
67
100
 
68
101
  // bin/pushary-disconnect.ts
69
102
  import { readdirSync, readFileSync, rmSync, writeFileSync } from "fs";
70
103
  import { parse as parseTOML, stringify as stringifyTOML } from "smol-toml";
71
104
 
72
105
  // src/disconnect.ts
73
- import { dirname } from "path";
106
+ import { dirname, join } from "path";
74
107
  var isDisconnectableAgent = (value) => DISCONNECTABLE_AGENTS.includes(value);
75
108
  var removeCursorHooks = (config) => {
76
109
  const hooks = config.hooks;
@@ -161,9 +194,42 @@ var disconnectRemovals = (agent) => {
161
194
  }
162
195
  ];
163
196
  };
197
+ var disconnectDirectories = (agent) => {
198
+ if (agent !== "cursor") return [];
199
+ return [{ path: cursorPluginDir(), manifest: cursorPluginManifest(), ownedBy: isPusharyCursorPluginManifest }];
200
+ };
201
+ var disconnectLeftoverDirectories = (agent, list) => {
202
+ if (agent !== "cursor") return [];
203
+ const parent = dirname(cursorPluginDir());
204
+ return list(parent).filter(isCursorPluginLeftover).map((name) => join(parent, name));
205
+ };
206
+ var disconnectInstructionFile = (agent) => {
207
+ switch (agent) {
208
+ case "codex":
209
+ return codexAgentsMd();
210
+ case "gemini":
211
+ return geminiMd();
212
+ case "opencode":
213
+ return openCodeInstructionsFile();
214
+ case "qwen":
215
+ case "codebuddy":
216
+ case "qoder":
217
+ case "droid":
218
+ case "devin": {
219
+ const profile = hookCompatibleProfileBySource(agent);
220
+ return profile ? compatibleInstructionsFile(profile) : null;
221
+ }
222
+ case "claude":
223
+ case "cursor":
224
+ return null;
225
+ }
226
+ };
227
+ var GATE_STILL_REGISTERED_NOTE = "kept because its gate could not be removed from the hooks file that points into it";
164
228
  var disconnectAgent = (agent, io) => {
165
229
  const changed = [];
166
230
  const untouched = [];
231
+ const unreadable = [];
232
+ const kept = [];
167
233
  const claudeReceiptPath = claudeMcpReceipt();
168
234
  const rawClaudeReceipt = agent === "claude" ? io.read(claudeReceiptPath) : null;
169
235
  let claudeReceipt = null;
@@ -196,6 +262,7 @@ var disconnectAgent = (agent, io) => {
196
262
  }
197
263
  } catch {
198
264
  untouched.push(edit.path);
265
+ unreadable.push(edit.path);
199
266
  }
200
267
  }
201
268
  for (const removal of disconnectRemovals(agent)) {
@@ -226,40 +293,105 @@ var disconnectAgent = (agent, io) => {
226
293
  untouched.push(claudeReceiptPath);
227
294
  }
228
295
  }
229
- return { agent, changed, untouched };
296
+ const removeDirectory = io.removeDirectory;
297
+ if (removeDirectory) {
298
+ const owned = disconnectDirectories(agent).filter((directory) => {
299
+ const manifest = io.read(directory.manifest);
300
+ return manifest !== null && directory.ownedBy(manifest);
301
+ });
302
+ const targets = [...owned.map((directory) => directory.path), ...disconnectLeftoverDirectories(agent, io.list ?? (() => []))];
303
+ for (const path of targets) {
304
+ if (unreadable.length > 0) {
305
+ kept.push(`${path} (${GATE_STILL_REGISTERED_NOTE})`);
306
+ continue;
307
+ }
308
+ try {
309
+ removeDirectory(path);
310
+ changed.push(path);
311
+ } catch {
312
+ untouched.push(path);
313
+ }
314
+ }
315
+ }
316
+ const instructions = disconnectInstructionFile(agent);
317
+ if (instructions && io.removeInstructionBlock?.(instructions)) changed.push(instructions);
318
+ return { agent, changed, untouched, kept };
319
+ };
320
+ var disconnectFx = (io) => {
321
+ const changed = [];
322
+ const kept = [];
323
+ for (const action of planFxRemoval(fxMcpProfile(), fxSettings(), fxQuestionRuleReceipt())) {
324
+ if (action.kind === "write") {
325
+ io.write(action.path, action.text);
326
+ changed.push(action.path);
327
+ } else if (action.kind === "remove-receipt") {
328
+ io.remove(action.path);
329
+ changed.push(action.path);
330
+ } else if (action.kind === "kept") {
331
+ kept.push(`${action.label}: ${action.detail}`);
332
+ }
333
+ }
334
+ if (io.removeInstructionBlock(fxAgentsMd())) changed.push(fxAgentsMd());
335
+ return { changed, kept };
230
336
  };
231
337
 
232
338
  // bin/pushary-disconnect.ts
233
339
  exitOnHelpFlag("disconnect");
340
+ 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.`;
341
+ 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
342
  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);
343
+ var typed = rest[0] !== void 0 && isInvocationOf(rest[0], "disconnect") ? rest[1] : rest[0];
344
+ var requested = typed === void 0 ? null : normalizeAgentId(typed, DISCONNECT_AGENT_IDS);
345
+ var printResult = (agent, changed, kept) => {
346
+ if (changed.length === 0) console.log(`${agent} was not connected.`);
347
+ else {
348
+ console.log(`Disconnected ${agent}:`);
349
+ for (const path of changed) console.log(` ${path}`);
350
+ }
351
+ if (kept.length > 0) {
352
+ console.log("Left as it is:");
353
+ for (const line of kept) console.log(` ${line}`);
354
+ }
355
+ };
356
+ if (requested === null) {
357
+ if (typed !== void 0) console.error(`Unknown agent: ${typed}`);
358
+ console.error(`Usage: pushary disconnect <${DISCONNECT_AGENT_IDS.join("|")}>`);
359
+ console.error("Setup ids such as claude_code and gemini_cli work too.");
360
+ process.exit(EXIT.FAILED);
239
361
  }
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
- }
362
+ if (isDisconnectableAgent(requested)) {
363
+ const decline = recordDeclinedAgent(requested);
364
+ const result = disconnectAgent(requested, {
365
+ read: (path) => {
366
+ try {
367
+ return readFileSync(path, "utf-8");
368
+ } catch {
369
+ return null;
370
+ }
371
+ },
372
+ write: (path, contents) => writeFileSync(path, contents, "utf-8"),
373
+ parseToml: (raw) => parseTOML(raw),
374
+ stringifyToml: (config) => stringifyTOML(config),
375
+ remove: (path) => rmSync(path, { force: true }),
376
+ list: (dir) => {
377
+ try {
378
+ return readdirSync(dir);
379
+ } catch {
380
+ return [];
381
+ }
382
+ },
383
+ removeDirectory: (path) => rmSync(path, { recursive: true, force: true }),
384
+ removeInstructionBlock
385
+ });
386
+ printResult(requested, result.changed, result.kept);
387
+ if (decline !== "unchanged" && macAppBridgeAvailable()) {
388
+ console.log(decline === "changed" ? MAC_APP_LEAVES_IT_OFF(requested) : MAC_APP_MAY_RESTORE_IT(requested, declinedAgentsFile()));
258
389
  }
259
- });
260
- if (result.changed.length === 0) {
261
- console.log(`${requested} was not connected.`);
262
390
  } else {
263
- console.log(`Disconnected ${requested}:`);
264
- for (const path of result.changed) console.log(` ${path}`);
391
+ const result = disconnectFx({
392
+ write: (path, contents) => writeFileSync(path, contents, "utf-8"),
393
+ remove: (path) => rmSync(path, { force: true }),
394
+ removeInstructionBlock
395
+ });
396
+ printResult(requested, result.changed, result.kept);
265
397
  }
@@ -3,64 +3,53 @@ import {
3
3
  describeWaitLadder
4
4
  } from "../chunk-CVWG2N3Y.js";
5
5
  import {
6
+ CURSOR_GATE_SCRIPT,
6
7
  readServiceExecPath,
7
8
  versionManagerOf
8
- } from "../chunk-GU3EJCVV.js";
9
+ } from "../chunk-EA5NWDK7.js";
9
10
  import {
10
11
  CODEX_HOOK_REMEDY
11
- } from "../chunk-JWKBDSPF.js";
12
+ } from "../chunk-DP3WX7FW.js";
12
13
  import {
13
14
  writeStdoutFully
14
15
  } from "../chunk-EO23EUOK.js";
15
16
  import {
16
17
  assessCodexHookTrust,
17
18
  readCodexTrustForPusharyHooks
18
- } from "../chunk-H7MMU64M.js";
19
+ } from "../chunk-NGKUXZID.js";
19
20
  import {
20
21
  readMachineReadiness,
21
22
  readManagedControlEvidence
22
- } from "../chunk-MBK7N46B.js";
23
+ } from "../chunk-QIOIO7VN.js";
23
24
  import {
24
- FX_PROFILE_REFUSALS,
25
- FX_PUSHARY_TOOLS_RULE,
26
- FX_QUESTION_TOOL,
27
25
  HERMES_PIP_PACKAGE,
28
26
  HERMES_PLUGIN_NAME,
29
27
  agentProbes,
30
28
  detectAgent,
31
29
  detectAllAgents,
32
- hasInstructionBlock,
33
30
  hermesWiredByPushary,
34
- inspectFxInstallation,
35
31
  isDetected,
36
32
  isPluginRegistered,
37
33
  readHermesStatus,
38
34
  resolveHermesPython,
39
- retryAgentCommand,
40
35
  shortenHome,
41
36
  vscodeSettingsTargets
42
- } from "../chunk-QQ4HBXZC.js";
43
- import "../chunk-W2KI5KPD.js";
44
- import {
45
- compatibleConfigFile,
46
- compatibleInstructionsFile,
47
- compatibleMcpFile,
48
- hasCompatibleHooks,
49
- missingCompatibleHookEvents
50
- } from "../chunk-MZPXVH4A.js";
37
+ } from "../chunk-UAP5DS6P.js";
51
38
  import {
52
- OPENCODE_PLUGIN_PLACEHOLDER,
53
- openCodePluginDir,
54
- openCodePluginFile,
55
- openCodeWired
56
- } from "../chunk-X5NXPCIC.js";
57
- import "../chunk-ANEAA37E.js";
39
+ FX_PROFILE_REFUSALS,
40
+ FX_PUSHARY_TOOLS_RULE,
41
+ FX_QUESTION_TOOL,
42
+ hasInstructionBlock,
43
+ inspectFxInstallation,
44
+ retryAgentCommand
45
+ } from "../chunk-6W5M3MSE.js";
46
+ import "../chunk-H5T27W7M.js";
58
47
  import {
59
48
  detectProviderLiveCapabilities,
60
49
  expectedLaunchCapabilities,
61
50
  hasSpawnProvider,
62
51
  resolveControlPolicy
63
- } from "../chunk-T7Y5EADL.js";
52
+ } from "../chunk-F7R3SZ4Q.js";
64
53
  import "../chunk-RIVNNBEK.js";
65
54
  import {
66
55
  AUTO_UPDATE_DISABLE_ENV,
@@ -69,33 +58,10 @@ import {
69
58
  describeAutoUpdateCheck,
70
59
  readAutoUpdateState,
71
60
  takeAutoUpdateAnnouncement
72
- } from "../chunk-QTO6HEZD.js";
61
+ } from "../chunk-K545B734.js";
73
62
  import {
74
63
  readLedgerSummary
75
- } from "../chunk-CBQACHKY.js";
76
- import {
77
- describeBridgeResolution,
78
- isBridgeLocator,
79
- liveBridgeProbe,
80
- resolveBridgeStub
81
- } from "../chunk-MNWRUGMH.js";
82
- import {
83
- claudeOtherHolders,
84
- claudeUnprovenHolds,
85
- claudeWired,
86
- codexOtherHolders,
87
- codexUnprovenHolds,
88
- codexWired,
89
- cursorMcpAuthorization,
90
- cursorOtherHolders,
91
- cursorWired,
92
- describeHoldSentence,
93
- describeOtherHolder,
94
- geminiOtherHolders,
95
- geminiWired,
96
- holdsLong,
97
- pusharyHookExecutable
98
- } from "../chunk-4YO4T5FV.js";
64
+ } from "../chunk-IIVZZMSO.js";
99
65
  import {
100
66
  daemonHasRemoteProof,
101
67
  daemonServiceManagerAvailable,
@@ -104,20 +70,8 @@ import {
104
70
  readDaemonNeedsLogin,
105
71
  readDaemonStatus,
106
72
  readInstalledDaemonService
107
- } from "../chunk-VXRXFU6Q.js";
108
- import {
109
- GEMINI_HOOK_BINARY,
110
- hasGeminiHooks,
111
- missingGeminiHookEvents
112
- } from "../chunk-JCWZ23MJ.js";
73
+ } from "../chunk-SZ4Q6ZVS.js";
113
74
  import "../chunk-XHKBHWLX.js";
114
- import "../chunk-6ICPEJY5.js";
115
- import "../chunk-QFEM7R6T.js";
116
- import "../chunk-N6IOSZOE.js";
117
- import "../chunk-6DJTDHBI.js";
118
- import "../chunk-D6S5EKXA.js";
119
- import "../chunk-AVNKVF7N.js";
120
- import "../chunk-POFBE6ZY.js";
121
75
  import {
122
76
  describeReach,
123
77
  describeRoundTrip,
@@ -125,42 +79,100 @@ import {
125
79
  reachVerdict,
126
80
  roundTripEvidence,
127
81
  verifyRoundTrip
128
- } from "../chunk-N4EUSDKX.js";
82
+ } from "../chunk-DCCSULXK.js";
129
83
  import "../chunk-3EGEA4KH.js";
130
84
  import "../chunk-QCGNGEGE.js";
85
+ import {
86
+ SIGNED_OUT_ON_MAC_MESSAGE,
87
+ activeKeyVerdictOf,
88
+ describeSignedOutKey,
89
+ readSignedOutDiagnosis
90
+ } from "../chunk-Q6C6ILUS.js";
91
+ import {
92
+ CONNECTED_THROUGH_MAC_APP,
93
+ readMacAppConnectionWhenKeyless
94
+ } from "../chunk-E5HOHIUV.js";
95
+ import {
96
+ OPENCODE_PLUGIN_PLACEHOLDER,
97
+ openCodePluginDir,
98
+ openCodePluginFile,
99
+ openCodeWired
100
+ } from "../chunk-BZLHTMT6.js";
101
+ import {
102
+ compatibleConfigFile,
103
+ compatibleInstructionsFile,
104
+ compatibleMcpFile,
105
+ hasCompatibleHooks,
106
+ missingCompatibleHookEvents
107
+ } from "../chunk-UF6RBP5V.js";
131
108
  import {
132
109
  createIo
133
110
  } from "../chunk-U4TMAANR.js";
134
111
  import {
135
112
  exitOnHelpFlag
136
- } from "../chunk-UFVGSEWH.js";
113
+ } from "../chunk-TO3PS646.js";
114
+ import {
115
+ claudeOtherHolders,
116
+ claudeUnprovenHolds,
117
+ claudeWired,
118
+ codexOtherHolders,
119
+ codexUnprovenHolds,
120
+ codexWired,
121
+ cursorMcpAuthorization,
122
+ cursorOtherHolders,
123
+ cursorWired,
124
+ describeBridgeResolution,
125
+ describeHoldSentence,
126
+ describeOtherHolder,
127
+ geminiOtherHolders,
128
+ geminiWired,
129
+ holdsLong,
130
+ isBridgeLocator,
131
+ liveBridgeProbe,
132
+ pusharyHookExecutable,
133
+ resolveBridgeStub
134
+ } from "../chunk-BYLKCZ2G.js";
135
+ import {
136
+ GEMINI_HOOK_BINARY,
137
+ hasGeminiHooks,
138
+ missingGeminiHookEvents
139
+ } from "../chunk-M3STIAGU.js";
140
+ import "../chunk-ZGADIZDS.js";
141
+ import "../chunk-MLGIVVSG.js";
137
142
  import {
138
143
  parseFlags
139
144
  } from "../chunk-GMXKITVA.js";
145
+ import "../chunk-6ICPEJY5.js";
140
146
  import {
141
147
  keyPrefix,
142
148
  readControlMode,
143
149
  readKeySource
144
- } from "../chunk-ADSQDYYG.js";
150
+ } from "../chunk-REU2VQPH.js";
151
+ import "../chunk-KQFTBQ66.js";
152
+ import "../chunk-N6IOSZOE.js";
153
+ import "../chunk-MD4SVNT6.js";
154
+ import "../chunk-WRPYCIV2.js";
145
155
  import {
146
156
  callMcpTool,
147
157
  sendMcpRequest
148
- } from "../chunk-L76HTPU6.js";
158
+ } from "../chunk-6AYSKVLL.js";
149
159
  import {
150
160
  checkApiKey,
151
161
  describeKeyCheck
152
- } from "../chunk-KFKL3FHS.js";
153
- import "../chunk-JXISQ7DT.js";
162
+ } from "../chunk-QRXPWW3M.js";
163
+ import "../chunk-UPIZSCYD.js";
164
+ import "../chunk-POFBE6ZY.js";
165
+ import "../chunk-5N5L6DNN.js";
154
166
  import {
155
167
  getMachineId
156
- } from "../chunk-KYO45G5L.js";
168
+ } from "../chunk-KOWFRUIT.js";
157
169
  import {
158
170
  UsageError
159
171
  } from "../chunk-7QLSKOSU.js";
160
172
  import {
161
173
  EXIT
162
174
  } from "../chunk-KZERVKTD.js";
163
- import "../chunk-4D2AYNSE.js";
175
+ import "../chunk-BNSKVIAW.js";
164
176
  import {
165
177
  CODEX_HOOK_EVENTS,
166
178
  CODEX_REQUIRED_APPROVAL_EVENTS,
@@ -191,14 +203,14 @@ import {
191
203
  readGlobalCliInstall,
192
204
  resolvePathBinary,
193
205
  vscodePluginDir
194
- } from "../chunk-ZUTU43FT.js";
206
+ } from "../chunk-Z23ZBYDW.js";
195
207
  import "../chunk-T7E75EKA.js";
196
208
  import {
197
209
  getBaseUrl
198
- } from "../chunk-Z6HPS67T.js";
210
+ } from "../chunk-IRHABAQT.js";
199
211
  import {
200
212
  NPX_LATEST_COMMAND
201
- } from "../chunk-STQRUH3S.js";
213
+ } from "../chunk-5DCDQ5VW.js";
202
214
  import {
203
215
  AGENTS,
204
216
  CURSOR_GATE_EVENTS,
@@ -214,7 +226,7 @@ import {
214
226
  hookCompatibleProfile,
215
227
  isHookActivationReport,
216
228
  isNewerVersion
217
- } from "../chunk-QR6VE5ME.js";
229
+ } from "../chunk-5RGA636G.js";
218
230
 
219
231
  // bin/pushary-doctor.ts
220
232
  import { existsSync, readFileSync, writeFileSync } from "fs";
@@ -405,9 +417,6 @@ function inertRegistrations(configs, resolves) {
405
417
  var describeInertRegistration = ({ named }) => `hooks here are registered for "${named}", which this CLI has no profile for, so every one of them stands aside`;
406
418
  var inertRegistrationRemedy = () => `Upgrade with ${NPX_LATEST_COMMAND} upgrade, or re-run setup to rewrite them for an agent this version knows`;
407
419
 
408
- // src/hooks-spec.ts
409
- var CURSOR_GATE_SCRIPT = "pushary-gate.mjs";
410
-
411
420
  // src/diagnostics/activation.ts
412
421
  import { realpathSync } from "fs";
413
422
  import { basename, dirname, join, resolve } from "path";
@@ -671,6 +680,7 @@ var main = async () => {
671
680
  }
672
681
  }
673
682
  const maskKey = (k) => `pk_${k.split(".")[0]?.slice(3, 7)}...`;
683
+ const macApp = readMacAppConnectionWhenKeyless(apiKey);
674
684
  if (keySource === "config-file") {
675
685
  console.log(` ${pass} API key in ${dim(source.origin ?? "the config file")} ${dim(`(${maskKey(apiKey)})`)}`);
676
686
  } else if (keySource === "profile") {
@@ -680,6 +690,8 @@ var main = async () => {
680
690
  `found only in a shell profile (${maskKey(apiKey)}), which hooks do not read \u2014 re-run setup, or open a new terminal`
681
691
  );
682
692
  console.log(` ${dim("Hooks read $PUSHARY_API_KEY, then")} ${dim(pusharyConfigFile())}`);
693
+ } else if (macApp.kind === "connected") {
694
+ check(true, CONNECTED_THROUGH_MAC_APP, `${macApp.keyPrefix}, held by the app; the CLI has no key of its own`);
683
695
  } else {
684
696
  check(!!apiKey, "API key in environment", apiKey ? maskKey(apiKey) : "PUSHARY_API_KEY not set");
685
697
  }
@@ -691,8 +703,12 @@ var main = async () => {
691
703
  );
692
704
  }
693
705
  let keyVerdict = null;
694
- if (apiKey) {
695
- keyVerdict = await checkApiKey(apiKey);
706
+ if (apiKey) keyVerdict = await checkApiKey(apiKey);
707
+ const signedOut = readSignedOutDiagnosis(apiKey ?? null, activeKeyVerdictOf(keyVerdict));
708
+ if (signedOut.kind === "signed_out_on_mac") {
709
+ check(false, "Key still signed in", SIGNED_OUT_ON_MAC_MESSAGE);
710
+ for (const line of describeSignedOutKey(signedOut)) console.log(` ${dim(line)}`);
711
+ } else if (keyVerdict) {
696
712
  switch (keyVerdict.kind) {
697
713
  case "ok":
698
714
  check(
@@ -1289,9 +1305,13 @@ var main = async () => {
1289
1305
  console.log();
1290
1306
  console.log(` ${dim("Connectivity")}`);
1291
1307
  if (!apiKey) {
1292
- check(false, "MCP server reachable", "skipped \u2014 no API key");
1293
- check(false, "API key valid", "skipped");
1294
- check(false, "MCP handshake", "skipped");
1308
+ if (macApp.kind === "connected") {
1309
+ console.log(` ${dim("\u2013")} MCP server, key and handshake ${dim("(the Pushary Mac app holds this computer's key and checks its own connection)")}`);
1310
+ } else {
1311
+ check(false, "MCP server reachable", "skipped \u2014 no API key");
1312
+ check(false, "API key valid", "skipped");
1313
+ check(false, "MCP handshake", "skipped");
1314
+ }
1295
1315
  const keylessSummary = readLedgerSummary(7);
1296
1316
  if (keylessSummary.count > 0) {
1297
1317
  check(false, "Keyless approval moments (7d)", `${keylessSummary.count} counted locally. See them with ${NPX_LATEST_COMMAND} stats`);
@@ -1348,7 +1368,7 @@ var main = async () => {
1348
1368
  check(
1349
1369
  verdict.kind === "yours",
1350
1370
  "Phone reachable",
1351
- 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`,
1371
+ 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`,
1352
1372
  "reachability"
1353
1373
  );
1354
1374
  }