@pushary/agent-hooks 1.6.4 → 1.7.0

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 (98) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +3 -2
  3. package/dist/bin/pushary-bell-hook.js +23 -24
  4. package/dist/bin/pushary-bell.js +9 -10
  5. package/dist/bin/pushary-claude.js +27 -28
  6. package/dist/bin/pushary-clean.js +85 -28
  7. package/dist/bin/pushary-codex-bridge.js +17 -18
  8. package/dist/bin/pushary-codex-hook.js +30 -31
  9. package/dist/bin/pushary-codex.js +12 -13
  10. package/dist/bin/pushary-connect.js +13 -14
  11. package/dist/bin/pushary-cowork.js +5 -6
  12. package/dist/bin/pushary-daemon.js +27 -28
  13. package/dist/bin/pushary-disconnect.js +17 -18
  14. package/dist/bin/pushary-doctor.js +71 -36
  15. package/dist/bin/pushary-elicitation-hook.js +24 -25
  16. package/dist/bin/pushary-gemini-bridge.js +12 -13
  17. package/dist/bin/pushary-gemini-hook.js +27 -28
  18. package/dist/bin/pushary-hook.js +31 -32
  19. package/dist/bin/pushary-login.js +13 -15
  20. package/dist/bin/pushary-logout.js +7 -8
  21. package/dist/bin/pushary-mcp.d.ts +1 -0
  22. package/dist/bin/pushary-mcp.js +56 -0
  23. package/dist/bin/pushary-mode.js +9 -10
  24. package/dist/bin/pushary-notification-hook.js +27 -28
  25. package/dist/bin/pushary-opencode-hook.js +26 -27
  26. package/dist/bin/pushary-permission-denied-hook.js +31 -32
  27. package/dist/bin/pushary-permission-hook.js +30 -31
  28. package/dist/bin/pushary-post-hook.js +27 -28
  29. package/dist/bin/pushary-prompt-hook.js +27 -28
  30. package/dist/bin/pushary-session-end-hook.js +27 -28
  31. package/dist/bin/pushary-session-start-hook.js +31 -32
  32. package/dist/bin/pushary-setup.js +183 -73
  33. package/dist/bin/pushary-stats.js +5 -6
  34. package/dist/bin/pushary-status.js +15 -16
  35. package/dist/bin/pushary-stop-hook.js +27 -28
  36. package/dist/bin/pushary-stopfailure-hook.js +27 -28
  37. package/dist/bin/pushary-suggestions.js +4 -4
  38. package/dist/bin/pushary-transcript-register.js +19 -20
  39. package/dist/bin/pushary-transcripts.js +7 -8
  40. package/dist/bin/pushary-upgrade.js +20 -21
  41. package/dist/bin/pushary-wait.js +9 -10
  42. package/dist/bin/pushary.js +6 -7
  43. package/dist/{chunk-5UWV5GHM.js → chunk-2C7CCWVX.js} +1 -1
  44. package/dist/{chunk-P4BNYJ5Q.js → chunk-2PS6QWDW.js} +2 -2
  45. package/dist/{chunk-JOGA3TL2.js → chunk-4F46VIEE.js} +6 -6
  46. package/dist/{chunk-NYMPLNV3.js → chunk-52NVBNJT.js} +3 -3
  47. package/dist/{chunk-I3XJATMR.js → chunk-5HLTWFJ6.js} +1 -1
  48. package/dist/{chunk-HUB4Q35G.js → chunk-6ADZQFVW.js} +1 -1
  49. package/dist/{chunk-OZE2TQX5.js → chunk-73T6MSU5.js} +5 -5
  50. package/dist/{chunk-53DN77WB.js → chunk-7OS4IHGI.js} +2 -2
  51. package/dist/{chunk-BY2CRWBO.js → chunk-B234346F.js} +1 -1
  52. package/dist/{chunk-EA3IELHP.js → chunk-B3UXMSMW.js} +6 -2
  53. package/dist/{chunk-3VZX4NSP.js → chunk-B3YQANFN.js} +1 -1
  54. package/dist/{chunk-VA2R64I7.js → chunk-B76WVEDX.js} +1 -1
  55. package/dist/{chunk-YPONELWS.js → chunk-BBKNJJVX.js} +6 -6
  56. package/dist/{chunk-XOMH53NB.js → chunk-BH2SKSSK.js} +1 -1
  57. package/dist/{chunk-P4UYILQK.js → chunk-BWYJ6AAF.js} +2 -2
  58. package/dist/{chunk-I2YUMZLE.js → chunk-CVALVGA7.js} +1 -1
  59. package/dist/{chunk-6NLWK6ZV.js → chunk-D6BULEJW.js} +2 -2
  60. package/dist/{chunk-N62KAMMY.js → chunk-DANOZVZK.js} +1 -1
  61. package/dist/{chunk-K32C2RGK.js → chunk-DNJUSFBL.js} +11 -5
  62. package/dist/{chunk-5U3FJ6YF.js → chunk-DVQDPI3T.js} +8 -8
  63. package/dist/{chunk-YUGGNZSF.js → chunk-DZURML2D.js} +1 -1
  64. package/dist/{chunk-D3K2FPPJ.js → chunk-EAQMWJPG.js} +8 -8
  65. package/dist/{chunk-EREBZHN2.js → chunk-EGKXSQCY.js} +4 -4
  66. package/dist/{chunk-XJG2FUWS.js → chunk-HDRNWNVP.js} +6 -6
  67. package/dist/{chunk-H6XU22TN.js → chunk-IJ6ECPA6.js} +8 -8
  68. package/dist/{chunk-3LU74H52.js → chunk-J2355HR7.js} +1 -1
  69. package/dist/{chunk-BJENQBMH.js → chunk-JNXVOU6Y.js} +8 -4
  70. package/dist/{chunk-GBL4BTG3.js → chunk-JXUAXO74.js} +2 -2
  71. package/dist/{chunk-DESAUCH2.js → chunk-KW2RRR7D.js} +4 -6
  72. package/dist/{chunk-66H2QQAK.js → chunk-KXMZMZD3.js} +1 -1
  73. package/dist/{chunk-ZA5UXRNE.js → chunk-KYQXUGH7.js} +3 -3
  74. package/dist/{chunk-NFH73H5B.js → chunk-L4H2Q2S4.js} +276 -19
  75. package/dist/{chunk-LDRGVXLR.js → chunk-LEZFOTMI.js} +1 -1
  76. package/dist/{chunk-PBKEYMAO.js → chunk-O2LEPIU6.js} +1 -1
  77. package/dist/{chunk-YXPGFRRW.js → chunk-PQ4F64M2.js} +3 -3
  78. package/dist/{chunk-LFMOYHPY.js → chunk-PUDBG3GM.js} +1 -1
  79. package/dist/{chunk-YQMFGWBD.js → chunk-QXAK5RFU.js} +1 -1
  80. package/dist/{chunk-5SWQZ6HY.js → chunk-R2XCLT6I.js} +4 -4
  81. package/dist/{chunk-VHNDE3ZD.js → chunk-ROQK7IN3.js} +2 -2
  82. package/dist/{chunk-GU3EJCVV.js → chunk-S3UD4V6W.js} +39 -0
  83. package/dist/{chunk-PJF7L7AA.js → chunk-SQRWHALT.js} +2 -2
  84. package/dist/{chunk-UAP556WK.js → chunk-UC65FJJT.js} +2 -2
  85. package/dist/{chunk-R4HVHTNA.js → chunk-UOAQ6QMP.js} +2 -2
  86. package/dist/{chunk-OSJEMXSR.js → chunk-V4AQBAVG.js} +1 -1
  87. package/dist/{chunk-VOCZHOXV.js → chunk-V6QRSU2G.js} +4 -4
  88. package/dist/{chunk-LQI7W4RG.js → chunk-VKVIAZQO.js} +1 -1
  89. package/dist/{chunk-LJEL7IB5.js → chunk-WUNZAE7I.js} +5 -5
  90. package/dist/{chunk-UGKDBJJX.js → chunk-X6KDKOV5.js} +3 -3
  91. package/dist/{chunk-DZTKLE7Q.js → chunk-XNCMT7YY.js} +1 -1
  92. package/dist/{chunk-CAS7GFWI.js → chunk-YROGUPOZ.js} +75 -5
  93. package/dist/chunk-YYINL576.js +120 -0
  94. package/dist/{chunk-7CLTSZOL.js → chunk-ZQ7IDOKY.js} +3 -3
  95. package/dist/{reapply-4DAJKNVP.js → reapply-6PH3FMPX.js} +9 -10
  96. package/dist/src/index.js +19 -20
  97. package/package.json +2 -1
  98. package/dist/chunk-HWJW3CPO.js +0 -65
@@ -2,29 +2,35 @@
2
2
  import {
3
3
  codexTrustOutcome,
4
4
  describeCodexTrustConfirmation
5
- } from "../chunk-BY2CRWBO.js";
5
+ } from "../chunk-B234346F.js";
6
6
  import {
7
7
  runBrowserLogin
8
- } from "../chunk-YQMFGWBD.js";
8
+ } from "../chunk-QXAK5RFU.js";
9
9
  import {
10
10
  coworkOutput,
11
11
  coworkSelection
12
- } from "../chunk-6NLWK6ZV.js";
12
+ } from "../chunk-D6BULEJW.js";
13
13
  import "../chunk-PUZZELE6.js";
14
14
  import {
15
15
  detectClaudeVersion
16
- } from "../chunk-PBKEYMAO.js";
16
+ } from "../chunk-O2LEPIU6.js";
17
17
  import {
18
+ AgentConfigError,
19
+ agentFailureFromError,
20
+ agentFailureWire,
21
+ configFailureKind,
18
22
  describeVersionManagerPin,
23
+ describedAgentFailure,
24
+ retryAgentCommand,
19
25
  versionManagerOf
20
- } from "../chunk-GU3EJCVV.js";
26
+ } from "../chunk-S3UD4V6W.js";
21
27
  import {
22
28
  ensureCodexTrustsPusharyHooks
23
- } from "../chunk-53DN77WB.js";
29
+ } from "../chunk-7OS4IHGI.js";
24
30
  import {
25
31
  readManagedControlEvidence,
26
32
  waitForMachineReadiness
27
- } from "../chunk-JOGA3TL2.js";
33
+ } from "../chunk-4F46VIEE.js";
28
34
  import {
29
35
  HERMES_CONFIG_SCRIPT,
30
36
  HERMES_PIP_PACKAGE,
@@ -34,19 +40,38 @@ import {
34
40
  isHermesConfigReceipt,
35
41
  resolveHermesPython,
36
42
  runHermesPythonScript
37
- } from "../chunk-N62KAMMY.js";
43
+ } from "../chunk-DANOZVZK.js";
38
44
  import {
45
+ FX_PROFILE_REFUSALS,
46
+ FX_PUSHARY_TOOLS_RULE,
47
+ FX_SETTINGS_REFUSALS,
48
+ FX_TOOL_DISCOVERY_NOTE,
39
49
  describeDetection,
40
50
  detectAllAgents,
51
+ fxIgnoresInstructionsFile,
52
+ fxProfileText,
53
+ fxPusharyEntry,
54
+ fxPusharyEntryOf,
55
+ fxSettingsText,
41
56
  isDetected,
57
+ isFxPusharyEntry,
42
58
  pluginLocationSnippet,
59
+ readFxFile,
60
+ readFxProfile,
61
+ readFxSettings,
43
62
  registerPluginLocation,
44
63
  renderAgentInstructions,
45
64
  renderProjectAgentInstructions,
46
65
  shortenHome,
47
66
  vscodeSettingsTargets,
67
+ withFxPusharyServer,
68
+ withPusharyToolsAllowed,
69
+ workspacesOverridingPusharyRule,
48
70
  writeInstructionBlock
49
- } from "../chunk-NFH73H5B.js";
71
+ } from "../chunk-L4H2Q2S4.js";
72
+ import {
73
+ MCP_BRIDGE_BINARY
74
+ } from "../chunk-YYINL576.js";
50
75
  import {
51
76
  OPENCODE_HOOK_BINARY,
52
77
  addOpenCodeMcpServer,
@@ -57,7 +82,7 @@ import {
57
82
  openCodePluginDir,
58
83
  openCodePluginFile,
59
84
  openCodeWired
60
- } from "../chunk-3VZX4NSP.js";
85
+ } from "../chunk-B3YQANFN.js";
61
86
  import {
62
87
  addCompatibleHooks,
63
88
  addCompatibleMcpServer,
@@ -68,7 +93,7 @@ import {
68
93
  compatibleMcpFile,
69
94
  compatiblePermissionRuleFile,
70
95
  hasCompatibleHooks
71
- } from "../chunk-LJEL7IB5.js";
96
+ } from "../chunk-WUNZAE7I.js";
72
97
  import {
73
98
  addClaudeMcpServer,
74
99
  addPusharyHooks,
@@ -76,16 +101,16 @@ import {
76
101
  captureClaudeMcpServer,
77
102
  isClaudeMcpSnapshot,
78
103
  updateClaudeMcpSnapshot
79
- } from "../chunk-ZA5UXRNE.js";
104
+ } from "../chunk-KYQXUGH7.js";
80
105
  import {
81
106
  detectProviderLiveCapabilities,
82
107
  hasSpawnProvider,
83
108
  resolveControlPolicy
84
- } from "../chunk-GBL4BTG3.js";
109
+ } from "../chunk-JXUAXO74.js";
85
110
  import {
86
111
  describeAutoUpdateAnnouncement,
87
112
  takeAutoUpdateAnnouncement
88
- } from "../chunk-P4UYILQK.js";
113
+ } from "../chunk-BWYJ6AAF.js";
89
114
  import {
90
115
  KEEP_HINT,
91
116
  captureHookTakeover,
@@ -95,23 +120,23 @@ import {
95
120
  hookOwnerOf,
96
121
  mcpBearerKey,
97
122
  planHooks
98
- } from "../chunk-5SWQZ6HY.js";
123
+ } from "../chunk-R2XCLT6I.js";
99
124
  import {
100
125
  AGENT_CHOICES,
101
126
  effectiveControlMode,
102
127
  effectiveVerify,
103
128
  parseSetupOptions
104
- } from "../chunk-I2YUMZLE.js";
129
+ } from "../chunk-CVALVGA7.js";
105
130
  import {
106
131
  liveBridgeProbe,
107
132
  resolveBridgeStub
108
- } from "../chunk-I3XJATMR.js";
133
+ } from "../chunk-5HLTWFJ6.js";
109
134
  import {
110
135
  claudeWired,
111
136
  codexWired,
112
137
  geminiWired,
113
138
  pusharyHookExecutable
114
- } from "../chunk-YXPGFRRW.js";
139
+ } from "../chunk-PQ4F64M2.js";
115
140
  import {
116
141
  clearDaemonNeedsLogin,
117
142
  daemonHasRemoteProof,
@@ -124,25 +149,25 @@ import {
124
149
  replaceDaemonService,
125
150
  stopDaemonService,
126
151
  waitForDaemonRemoteProof
127
- } from "../chunk-OZE2TQX5.js";
152
+ } from "../chunk-73T6MSU5.js";
128
153
  import {
129
154
  GEMINI_HOOK_BINARY,
130
155
  addGeminiHooks,
131
156
  addGeminiMcpServer,
132
157
  compareVersion,
133
158
  parseVersion
134
- } from "../chunk-7CLTSZOL.js";
135
- import "../chunk-LQI7W4RG.js";
159
+ } from "../chunk-ZQ7IDOKY.js";
160
+ import "../chunk-VKVIAZQO.js";
136
161
  import {
137
162
  transcriptPreferenceForSetup
138
- } from "../chunk-VA2R64I7.js";
163
+ } from "../chunk-B76WVEDX.js";
139
164
  import "../chunk-XHKBHWLX.js";
140
165
  import {
141
166
  reportEvent
142
- } from "../chunk-H6XU22TN.js";
143
- import "../chunk-YUGGNZSF.js";
144
- import "../chunk-EREBZHN2.js";
145
- import "../chunk-VOCZHOXV.js";
167
+ } from "../chunk-IJ6ECPA6.js";
168
+ import "../chunk-DZURML2D.js";
169
+ import "../chunk-EGKXSQCY.js";
170
+ import "../chunk-V6QRSU2G.js";
146
171
  import "../chunk-POFBE6ZY.js";
147
172
  import {
148
173
  BROWSER_CONNECT_COMMAND,
@@ -154,13 +179,13 @@ import {
154
179
  printConnectInstructions,
155
180
  roundTripEvidence,
156
181
  verifyRoundTrip
157
- } from "../chunk-XJG2FUWS.js";
182
+ } from "../chunk-HDRNWNVP.js";
158
183
  import "../chunk-3EGEA4KH.js";
159
184
  import {
160
185
  checkApiKey,
161
186
  describeKeyCheck,
162
187
  samePusharyAccount
163
- } from "../chunk-UGKDBJJX.js";
188
+ } from "../chunk-X6KDKOV5.js";
164
189
  import {
165
190
  setHumanStream
166
191
  } from "../chunk-QCGNGEGE.js";
@@ -178,17 +203,17 @@ import {
178
203
  readKeySource,
179
204
  resolveShellRc,
180
205
  writeKey
181
- } from "../chunk-R4HVHTNA.js";
182
- import "../chunk-BJENQBMH.js";
183
- import "../chunk-DESAUCH2.js";
184
- import "../chunk-DZTKLE7Q.js";
206
+ } from "../chunk-UOAQ6QMP.js";
207
+ import "../chunk-JNXVOU6Y.js";
208
+ import "../chunk-KW2RRR7D.js";
209
+ import "../chunk-XNCMT7YY.js";
185
210
  import {
186
211
  UsageError
187
212
  } from "../chunk-7QLSKOSU.js";
188
213
  import {
189
214
  EXIT
190
215
  } from "../chunk-KZERVKTD.js";
191
- import "../chunk-VHNDE3ZD.js";
216
+ import "../chunk-ROQK7IN3.js";
192
217
  import {
193
218
  addCodexHookTrust,
194
219
  addCodexHooks,
@@ -210,6 +235,10 @@ import {
210
235
  cursorUserMcp,
211
236
  dropVacatedCodexHookTrust,
212
237
  fetchLatestPublishedVersion,
238
+ fxAgentsMd,
239
+ fxConfigDir,
240
+ fxMcpProfile,
241
+ fxSettings,
213
242
  geminiMd,
214
243
  geminiSettings,
215
244
  guardBinary,
@@ -227,31 +256,29 @@ import {
227
256
  resolveGlobalBinary,
228
257
  vscodePluginDir,
229
258
  vscodePluginMcp
230
- } from "../chunk-K32C2RGK.js";
259
+ } from "../chunk-DNJUSFBL.js";
231
260
  import {
232
261
  backupFile,
233
262
  readJsonSafe,
234
263
  writeFileAtomic,
235
264
  writeJsonAtomic
236
265
  } from "../chunk-T7E75EKA.js";
237
- import "../chunk-OSJEMXSR.js";
266
+ import "../chunk-V4AQBAVG.js";
267
+ import {
268
+ NPX_LATEST_COMMAND,
269
+ renderCommandHelp
270
+ } from "../chunk-B3UXMSMW.js";
238
271
  import {
239
272
  HOOK_COMPATIBLE_PROFILES,
240
273
  HOOK_LOCATOR_BINARY,
241
274
  PRETOOLUSE_GATED_TOOLS,
242
275
  SUPPORT_EMAIL,
243
276
  compatibleTargetFiles,
277
+ getPackageVersion,
244
278
  hookCompatibleProfile,
279
+ isNewerVersion,
245
280
  isValidApiKey
246
- } from "../chunk-CAS7GFWI.js";
247
- import {
248
- NPX_LATEST_COMMAND,
249
- renderCommandHelp
250
- } from "../chunk-EA3IELHP.js";
251
- import {
252
- getPackageVersion,
253
- isNewerVersion
254
- } from "../chunk-HWJW3CPO.js";
281
+ } from "../chunk-YROGUPOZ.js";
255
282
 
256
283
  // bin/pushary-setup.ts
257
284
  import { existsSync, readFileSync, writeFileSync, mkdirSync, cpSync, rmSync, renameSync, realpathSync, readdirSync, statSync, openSync, readSync, closeSync } from "fs";
@@ -280,35 +307,6 @@ var planPhoneCheck = (context) => {
280
307
  return "connect";
281
308
  };
282
309
 
283
- // src/setup/agent-failure.ts
284
- var AgentConfigError = class extends Error {
285
- kind;
286
- filePath;
287
- constructor(kind, filePath, message) {
288
- super(message);
289
- this.name = "AgentConfigError";
290
- this.kind = kind;
291
- this.filePath = filePath;
292
- }
293
- };
294
- var configFailureKind = (readFailure) => readFailure === "unparseable" ? "config-unparseable" : "config-unreadable";
295
- var AGENT_FAILURE_DETAILS = {
296
- "not-wired": "reported success but its config is not there.",
297
- "app-account-mismatch": "Mac app hooks kept, but their Pushary account could not be matched to this setup."
298
- };
299
- var describedAgentFailure = (agent, kind) => ({
300
- agent,
301
- kind,
302
- detail: AGENT_FAILURE_DETAILS[kind]
303
- });
304
- var agentFailureFromError = (agent, error, describeError) => ({
305
- agent,
306
- kind: error instanceof AgentConfigError ? error.kind : "installer-error",
307
- detail: describeError(error)
308
- });
309
- var retryAgentCommand = (agent) => `${NPX_LATEST_COMMAND} setup --agents ${agent}`;
310
- var agentFailureWire = (failures) => failures.map(({ agent, kind }) => ({ agent, kind }));
311
-
312
310
  // src/setup/closing.ts
313
311
  var ACTIVITY_URL = "pushary.com/dashboard/agent/activity";
314
312
  var COMMAND_SURFACE = [
@@ -1486,6 +1484,112 @@ var saveApiKey = async (apiKey, controlMode, transcriptSync) => {
1486
1484
  }
1487
1485
  return rc;
1488
1486
  };
1487
+ var fxRetryHint = () => `Fix it, then run ${retryAgentCommand("fx")}.`;
1488
+ var readFxProfileForSetup = (filePath) => {
1489
+ const read = readFxFile(filePath, readFxProfile);
1490
+ if (read.kind === "profile") return read.profile;
1491
+ if (read.kind === "missing") return {};
1492
+ if (read.kind === "unreadable") {
1493
+ throw new AgentConfigError(configFailureKind("unreadable"), filePath, `${filePath} could not be read, so it was left untouched. ${fxRetryHint()}`);
1494
+ }
1495
+ throw new AgentConfigError(
1496
+ configFailureKind("unparseable"),
1497
+ filePath,
1498
+ `${filePath} ${FX_PROFILE_REFUSALS[read.reason]}, so it was left untouched. ${fxRetryHint()}`
1499
+ );
1500
+ };
1501
+ var writeFxProfile = (filePath, profile) => {
1502
+ const rendered = fxProfileText(profile);
1503
+ if (rendered.kind === "refused") {
1504
+ throw new Error(`${filePath} would grow past the size fx reads, so it was left untouched. ${fxRetryHint()}`);
1505
+ }
1506
+ writeFileAtomic(filePath, rendered.text, KEY_FILE_MODE);
1507
+ };
1508
+ var FX_ALLOW_RULE_SNIPPET = `"permission": { "${FX_PUSHARY_TOOLS_RULE}": "allow" }`;
1509
+ var fxSettingsReadRefusal = (filePath, read) => {
1510
+ if (read.kind === "unreadable") return `${filePath} could not be read`;
1511
+ if (read.kind === "refused") return `${filePath} ${FX_SETTINGS_REFUSALS[read.reason]}`;
1512
+ return null;
1513
+ };
1514
+ var allowPusharyToolsInFx = (filePath) => {
1515
+ const read = readFxFile(filePath, readFxSettings);
1516
+ const refusal = fxSettingsReadRefusal(filePath, read);
1517
+ if (refusal) return { kind: "refused", detail: refusal };
1518
+ const { settings, change } = withPusharyToolsAllowed(read.kind === "settings" ? read.settings : {});
1519
+ if (change !== "added") return { kind: "written", change, overridingWorkspaces: workspacesOverridingPusharyRule(settings) };
1520
+ const rendered = fxSettingsText(settings);
1521
+ if (rendered.kind === "refused") return { kind: "refused", detail: `${filePath} would grow past the 64 KiB fx reads` };
1522
+ try {
1523
+ writeFileAtomic(filePath, rendered.text, KEY_FILE_MODE);
1524
+ } catch (err) {
1525
+ return { kind: "refused", detail: `${filePath} could not be written (${formatError(err)})` };
1526
+ }
1527
+ return { kind: "written", change, overridingWorkspaces: workspacesOverridingPusharyRule(settings) };
1528
+ };
1529
+ var reportFxToolsRule = (outcome) => {
1530
+ if (outcome.kind === "refused") {
1531
+ console.log(` ${yellow("!")} ${outcome.detail}, so Pushary tools were not auto-allowed. fx will review or prompt for each Pushary call.`);
1532
+ noteManual(`Add ${FX_ALLOW_RULE_SNIPPET} to ${fxSettings()} so fx runs Pushary tools without a prompt.`);
1533
+ return;
1534
+ }
1535
+ if (outcome.change === "user-rule-kept") {
1536
+ console.log(` ${yellow("!")} ${fxSettings()} already has a ${FX_PUSHARY_TOOLS_RULE} rule, so it was left as you set it.`);
1537
+ } else {
1538
+ console.log(` ${dim("\u2022")} Auto-allowed tools: ${FX_PUSHARY_TOOLS_RULE} in ${fxSettings()}, so Pushary calls run without an fx prompt or review`);
1539
+ }
1540
+ if (outcome.overridingWorkspaces.length > 0) {
1541
+ console.log(` ${yellow("!")} ${outcome.overridingWorkspaces.length} fx workspace(s) set their own permission rules, which replace the global ones there. Add ${FX_PUSHARY_TOOLS_RULE} to each to auto-allow Pushary tools.`);
1542
+ }
1543
+ };
1544
+ var teachFxToAskViaPush = () => {
1545
+ if (fxIgnoresInstructionsFile(fxAgentsMd(), fxConfigDir())) return false;
1546
+ writeInstructionBlock(fxAgentsMd(), `${renderAgentInstructions("fx")}
1547
+
1548
+ ${FX_TOOL_DISCOVERY_NOTE}`);
1549
+ return true;
1550
+ };
1551
+ var fxWired = () => {
1552
+ const read = readFxFile(fxMcpProfile(), readFxProfile);
1553
+ return read.kind === "profile" && isFxPusharyEntry(fxPusharyEntryOf(read.profile));
1554
+ };
1555
+ var setupFx = async () => {
1556
+ console.log(`
1557
+ ${bold("Setting up fx")}
1558
+ `);
1559
+ if (process.platform === "win32") {
1560
+ console.log(` ${yellow("!")} fx does not run on Windows. Skipping.`);
1561
+ return "skipped";
1562
+ }
1563
+ if (!existsSync(fxConfigDir())) {
1564
+ console.log(` ${yellow("!")} fx not found (${fxConfigDir()} does not exist). Skipping.`);
1565
+ console.log(` ${dim("Install fx from https://fx.sh, run it once, then re-run setup.")}`);
1566
+ return "skipped";
1567
+ }
1568
+ await installGlobally2();
1569
+ await spinner(`Adding the Pushary MCP server (${fxMcpProfile()})`, async () => {
1570
+ const profile = readFxProfileForSetup(fxMcpProfile());
1571
+ const bridge = resolveGlobalBinary(MCP_BRIDGE_BINARY) ?? MCP_BRIDGE_BINARY;
1572
+ const entry = fxPusharyEntry(guardedArgv({ kind: "binary", path: bridge, runtime: "node" }));
1573
+ writeFxProfile(fxMcpProfile(), withFxPusharyServer(profile, entry));
1574
+ });
1575
+ const toolsRule = allowPusharyToolsInFx(fxSettings());
1576
+ const instructionsWritten = teachFxToAskViaPush();
1577
+ console.log();
1578
+ console.log(` ${dim("What this configured:")}`);
1579
+ console.log(` ${dim("\u2022")} MCP server ${bold("pushary")} in ${fxMcpProfile()}`);
1580
+ console.log(` ${dim("\u2022")} It runs ${MCP_BRIDGE_BINARY}, which signs in with the key saved in ~/.pushary, so no key is written to fx's config`);
1581
+ reportFxToolsRule(toolsRule);
1582
+ if (instructionsWritten) {
1583
+ console.log(` ${dim("\u2022")} Instructions: ${fxAgentsMd()}`);
1584
+ } else {
1585
+ console.log(` ${yellow("!")} ${fxAgentsMd()} links outside ${fxConfigDir()}, and fx ignores such a file, so no instructions were written.`);
1586
+ noteManual(`Replace the ${fxAgentsMd()} symlink with a file so fx loads Pushary's instructions, then run ${retryAgentCommand("fx")}.`);
1587
+ }
1588
+ console.log(` ${dim("\u2022")} fx cannot hand its own approval prompts to Pushary; its agent asks through Pushary when it chooses to`);
1589
+ console.log(` ${dim("Restart fx, or run /mcp reload in a running session.")}`);
1590
+ noteManual("Restart fx, or run /mcp reload in a running session.");
1591
+ return "configured";
1592
+ };
1489
1593
  var setupCustom = async (apiKey, context) => {
1490
1594
  console.log(`
1491
1595
  ${bold("Connect any other agent (MCP or HTTP)")}
@@ -1667,6 +1771,8 @@ var agentIsWired = (agent) => {
1667
1771
  return existsSync(VSCODE_PLUGIN_MCP);
1668
1772
  case "opencode":
1669
1773
  return openCodeWired();
1774
+ case "fx":
1775
+ return fxWired();
1670
1776
  default: {
1671
1777
  const profile = hookCompatibleProfile(agent);
1672
1778
  if (!profile) return true;
@@ -1759,6 +1865,7 @@ var AGENT_SETUP = {
1759
1865
  cursor: setupCursor,
1760
1866
  vscode: setupVsCode,
1761
1867
  opencode: setupOpenCode,
1868
+ fx: setupFx,
1762
1869
  ...COMPATIBLE_SETUP,
1763
1870
  custom: setupCustom
1764
1871
  };
@@ -1863,6 +1970,7 @@ var AGENT_NAMES = {
1863
1970
  cursor: "Cursor",
1864
1971
  vscode: "VS Code",
1865
1972
  opencode: "OpenCode",
1973
+ fx: "fx",
1866
1974
  ...compatibleRecord((profile) => profile.label),
1867
1975
  custom: "Other"
1868
1976
  };
@@ -1874,6 +1982,7 @@ var AGENT_CAPABILITIES = {
1874
1982
  cursor: "plugin + permission gate",
1875
1983
  vscode: "agent plugin + permission gate",
1876
1984
  opencode: "generated plugin + permission gate",
1985
+ fx: "MCP through a local bridge",
1877
1986
  ...compatibleRecord((profile) => profile.mcp ? "MCP + native hooks" : "native hooks"),
1878
1987
  custom: "any MCP or HTTP agent (Windsurf, n8n, custom)"
1879
1988
  };
@@ -1952,6 +2061,7 @@ var AGENT_TARGETS = {
1952
2061
  openCodeConfigFile(),
1953
2062
  OPENCODE_INSTRUCTIONS()
1954
2063
  ],
2064
+ fx: [fxMcpProfile(), fxSettings(), fxAgentsMd()],
1955
2065
  ...compatibleRecord((profile) => compatibleTargetFiles(profile).map((file) => join3(homedir(), ...file))),
1956
2066
  custom: ["nothing (prints connection details only)"]
1957
2067
  };
@@ -1,17 +1,16 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  readLedgerSummary
4
- } from "../chunk-5UWV5GHM.js";
4
+ } from "../chunk-2C7CCWVX.js";
5
5
  import {
6
6
  exitOnHelpFlag
7
- } from "../chunk-P4BNYJ5Q.js";
7
+ } from "../chunk-2PS6QWDW.js";
8
8
  import "../chunk-KZERVKTD.js";
9
9
  import {
10
10
  getApiKey
11
- } from "../chunk-OSJEMXSR.js";
12
- import "../chunk-CAS7GFWI.js";
13
- import "../chunk-EA3IELHP.js";
14
- import "../chunk-HWJW3CPO.js";
11
+ } from "../chunk-V4AQBAVG.js";
12
+ import "../chunk-B3UXMSMW.js";
13
+ import "../chunk-YROGUPOZ.js";
15
14
 
16
15
  // bin/pushary-stats.ts
17
16
  exitOnHelpFlag("stats");
@@ -2,49 +2,48 @@
2
2
  import {
3
3
  describeLastSeen,
4
4
  listMachines
5
- } from "../chunk-JOGA3TL2.js";
6
- import "../chunk-GBL4BTG3.js";
7
- import "../chunk-OZE2TQX5.js";
5
+ } from "../chunk-4F46VIEE.js";
6
+ import "../chunk-JXUAXO74.js";
7
+ import "../chunk-73T6MSU5.js";
8
8
  import "../chunk-XHKBHWLX.js";
9
9
  import {
10
10
  describeReach,
11
11
  fetchChannels,
12
12
  reachVerdict
13
- } from "../chunk-XJG2FUWS.js";
13
+ } from "../chunk-HDRNWNVP.js";
14
14
  import "../chunk-3EGEA4KH.js";
15
15
  import {
16
16
  checkApiKey,
17
17
  describeKeyCheck
18
- } from "../chunk-UGKDBJJX.js";
18
+ } from "../chunk-X6KDKOV5.js";
19
19
  import "../chunk-QCGNGEGE.js";
20
20
  import {
21
21
  createIo
22
22
  } from "../chunk-5RUIFDTP.js";
23
23
  import {
24
24
  exitOnHelpFlag
25
- } from "../chunk-P4BNYJ5Q.js";
25
+ } from "../chunk-2PS6QWDW.js";
26
26
  import {
27
27
  rejectUnknownFlags
28
28
  } from "../chunk-GMXKITVA.js";
29
29
  import {
30
30
  readKeySource
31
- } from "../chunk-R4HVHTNA.js";
32
- import "../chunk-BJENQBMH.js";
33
- import "../chunk-DESAUCH2.js";
34
- import "../chunk-DZTKLE7Q.js";
31
+ } from "../chunk-UOAQ6QMP.js";
32
+ import "../chunk-JNXVOU6Y.js";
33
+ import "../chunk-KW2RRR7D.js";
34
+ import "../chunk-XNCMT7YY.js";
35
35
  import {
36
36
  UsageError
37
37
  } from "../chunk-7QLSKOSU.js";
38
38
  import {
39
39
  EXIT
40
40
  } from "../chunk-KZERVKTD.js";
41
- import "../chunk-VHNDE3ZD.js";
42
- import "../chunk-K32C2RGK.js";
41
+ import "../chunk-ROQK7IN3.js";
42
+ import "../chunk-DNJUSFBL.js";
43
43
  import "../chunk-T7E75EKA.js";
44
- import "../chunk-OSJEMXSR.js";
45
- import "../chunk-CAS7GFWI.js";
46
- import "../chunk-EA3IELHP.js";
47
- import "../chunk-HWJW3CPO.js";
44
+ import "../chunk-V4AQBAVG.js";
45
+ import "../chunk-B3UXMSMW.js";
46
+ import "../chunk-YROGUPOZ.js";
48
47
 
49
48
  // src/status.ts
50
49
  var keySourceLine = (source) => {
@@ -2,47 +2,46 @@
2
2
  import {
3
3
  activeHookSource,
4
4
  activeIdentity
5
- } from "../chunk-LJEL7IB5.js";
6
- import "../chunk-ZA5UXRNE.js";
5
+ } from "../chunk-WUNZAE7I.js";
6
+ import "../chunk-KYQXUGH7.js";
7
7
  import {
8
8
  readHookInput
9
- } from "../chunk-UAP556WK.js";
10
- import "../chunk-D3K2FPPJ.js";
9
+ } from "../chunk-UC65FJJT.js";
10
+ import "../chunk-EAQMWJPG.js";
11
11
  import "../chunk-SGZJ5LYH.js";
12
- import "../chunk-5SWQZ6HY.js";
13
- import "../chunk-I2YUMZLE.js";
14
- import "../chunk-I3XJATMR.js";
15
- import "../chunk-YXPGFRRW.js";
16
- import "../chunk-OZE2TQX5.js";
17
- import "../chunk-7CLTSZOL.js";
18
- import "../chunk-LQI7W4RG.js";
19
- import "../chunk-XOMH53NB.js";
20
- import "../chunk-66H2QQAK.js";
21
- import "../chunk-VA2R64I7.js";
12
+ import "../chunk-R2XCLT6I.js";
13
+ import "../chunk-CVALVGA7.js";
14
+ import "../chunk-5HLTWFJ6.js";
15
+ import "../chunk-PQ4F64M2.js";
16
+ import "../chunk-73T6MSU5.js";
17
+ import "../chunk-ZQ7IDOKY.js";
18
+ import "../chunk-VKVIAZQO.js";
19
+ import "../chunk-BH2SKSSK.js";
20
+ import "../chunk-KXMZMZD3.js";
21
+ import "../chunk-B76WVEDX.js";
22
22
  import "../chunk-XHKBHWLX.js";
23
23
  import {
24
24
  handleStop,
25
25
  handleSubagentStop,
26
26
  isSubagentStop
27
- } from "../chunk-H6XU22TN.js";
28
- import "../chunk-YUGGNZSF.js";
29
- import "../chunk-EREBZHN2.js";
30
- import "../chunk-VOCZHOXV.js";
27
+ } from "../chunk-IJ6ECPA6.js";
28
+ import "../chunk-DZURML2D.js";
29
+ import "../chunk-EGKXSQCY.js";
30
+ import "../chunk-V6QRSU2G.js";
31
31
  import "../chunk-POFBE6ZY.js";
32
32
  import "../chunk-GMXKITVA.js";
33
- import "../chunk-R4HVHTNA.js";
34
- import "../chunk-BJENQBMH.js";
35
- import "../chunk-DESAUCH2.js";
36
- import "../chunk-DZTKLE7Q.js";
33
+ import "../chunk-UOAQ6QMP.js";
34
+ import "../chunk-JNXVOU6Y.js";
35
+ import "../chunk-KW2RRR7D.js";
36
+ import "../chunk-XNCMT7YY.js";
37
37
  import "../chunk-7QLSKOSU.js";
38
38
  import "../chunk-KZERVKTD.js";
39
- import "../chunk-VHNDE3ZD.js";
40
- import "../chunk-K32C2RGK.js";
39
+ import "../chunk-ROQK7IN3.js";
40
+ import "../chunk-DNJUSFBL.js";
41
41
  import "../chunk-T7E75EKA.js";
42
- import "../chunk-OSJEMXSR.js";
43
- import "../chunk-CAS7GFWI.js";
44
- import "../chunk-EA3IELHP.js";
45
- import "../chunk-HWJW3CPO.js";
42
+ import "../chunk-V4AQBAVG.js";
43
+ import "../chunk-B3UXMSMW.js";
44
+ import "../chunk-YROGUPOZ.js";
46
45
 
47
46
  // bin/pushary-stop-hook.ts
48
47
  var AGENT = activeIdentity(process.argv);