@pushary/agent-hooks 1.9.67 → 1.9.69

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 (104) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/{api-3WIPD5GC.js → api-KUJYE5YZ.js} +7 -7
  3. package/dist/bin/pushary-bell-hook.js +18 -18
  4. package/dist/bin/pushary-bell.js +5 -5
  5. package/dist/bin/pushary-claude.js +19 -19
  6. package/dist/bin/pushary-clean.js +26 -26
  7. package/dist/bin/pushary-codex-bridge.js +14 -14
  8. package/dist/bin/pushary-codex-hook.js +21 -21
  9. package/dist/bin/pushary-codex-session.js +6 -6
  10. package/dist/bin/pushary-codex.js +8 -8
  11. package/dist/bin/pushary-connect.js +19 -19
  12. package/dist/bin/pushary-daemon.js +30 -30
  13. package/dist/bin/pushary-disconnect.js +18 -18
  14. package/dist/bin/pushary-doctor.js +43 -33
  15. package/dist/bin/pushary-elicitation-hook.js +18 -18
  16. package/dist/bin/pushary-gemini-bridge.js +9 -9
  17. package/dist/bin/pushary-gemini-hook.js +19 -19
  18. package/dist/bin/pushary-hook.js +20 -20
  19. package/dist/bin/pushary-login.js +13 -13
  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 +9 -9
  23. package/dist/bin/pushary-notification-hook.js +17 -17
  24. package/dist/bin/pushary-opencode-hook.js +18 -18
  25. package/dist/bin/pushary-permission-denied-hook.js +20 -20
  26. package/dist/bin/pushary-permission-hook.js +20 -20
  27. package/dist/bin/pushary-post-hook.js +17 -17
  28. package/dist/bin/pushary-prompt-hook.js +17 -17
  29. package/dist/bin/pushary-session-end-hook.js +19 -19
  30. package/dist/bin/pushary-session-start-hook.js +27 -27
  31. package/dist/bin/pushary-setup.js +44 -41
  32. package/dist/bin/pushary-status.js +23 -23
  33. package/dist/bin/pushary-stop-hook.js +17 -17
  34. package/dist/bin/pushary-stopfailure-hook.js +17 -17
  35. package/dist/bin/pushary-suggestions.js +9 -9
  36. package/dist/bin/pushary-transcript-register.js +10 -10
  37. package/dist/bin/pushary-transcripts.js +13 -13
  38. package/dist/bin/pushary-upgrade.js +52 -32
  39. package/dist/bin/pushary-wait.js +9 -9
  40. package/dist/bin/pushary.js +4 -4
  41. package/dist/{chunk-TI4JYPGQ.js → chunk-274CV7IW.js} +22 -12
  42. package/dist/{chunk-ZPIYJLQ3.js → chunk-2LI3DF7Q.js} +2 -2
  43. package/dist/{chunk-DP6LU6BB.js → chunk-2REVIFLS.js} +2 -2
  44. package/dist/{chunk-B3V2WOJX.js → chunk-3HWDWR42.js} +8 -8
  45. package/dist/{chunk-IXTVUINH.js → chunk-4BXI6WJI.js} +2 -2
  46. package/dist/{chunk-Y4MRHAE5.js → chunk-54O76CMR.js} +2 -2
  47. package/dist/{chunk-PO2P3XDC.js → chunk-5LQCADHK.js} +4 -4
  48. package/dist/{chunk-VEYFXRZ6.js → chunk-5UIA5GLL.js} +6 -5
  49. package/dist/{chunk-NSS2AIGI.js → chunk-72ILLFCY.js} +4 -4
  50. package/dist/{chunk-IRV2MNMA.js → chunk-7CW63ZK3.js} +2 -2
  51. package/dist/{chunk-6H4E5UBA.js → chunk-7FWZNWIO.js} +5 -5
  52. package/dist/{chunk-KTLE7NIK.js → chunk-7XS44DQX.js} +3 -3
  53. package/dist/{chunk-3THDNNVL.js → chunk-AQA63ZWO.js} +1 -1
  54. package/dist/{chunk-JHB5SR5B.js → chunk-AUYMNTUX.js} +3 -3
  55. package/dist/{chunk-76SWHCAR.js → chunk-AVKD5QS4.js} +4 -4
  56. package/dist/{chunk-D7Z4USSB.js → chunk-BRWU4NT4.js} +3 -3
  57. package/dist/{chunk-FONWVVDD.js → chunk-CJ3W7XRU.js} +1 -1
  58. package/dist/{chunk-KIXRHNCW.js → chunk-CPYVVEJP.js} +3 -3
  59. package/dist/{chunk-JBRMIADM.js → chunk-D5G2HSQ6.js} +1 -1
  60. package/dist/{chunk-ICQCQAUO.js → chunk-DJPNVVJQ.js} +3 -3
  61. package/dist/{chunk-YSD4SMHE.js → chunk-DTENGECG.js} +1 -1
  62. package/dist/{chunk-KE4TSJUD.js → chunk-EAJUFO7Q.js} +3 -3
  63. package/dist/{chunk-D3U6CN7T.js → chunk-FD6KOIT2.js} +3 -3
  64. package/dist/{chunk-564IPPBL.js → chunk-FULXDMAP.js} +3 -3
  65. package/dist/{chunk-PIBWX3EF.js → chunk-FZ2SHXUE.js} +2 -2
  66. package/dist/{chunk-JOBSKQ2Z.js → chunk-GZHQQP7J.js} +1 -1
  67. package/dist/{chunk-R2BZH2NK.js → chunk-HGXWC4WT.js} +1 -1
  68. package/dist/{chunk-XFDWLDHG.js → chunk-HZNZJTGH.js} +5 -5
  69. package/dist/{chunk-IPG3RS23.js → chunk-JQMERLQS.js} +2 -2
  70. package/dist/{chunk-XNUWKKGS.js → chunk-JWRDCANS.js} +2 -2
  71. package/dist/{chunk-P4RXSZDT.js → chunk-KHOWMC57.js} +1 -1
  72. package/dist/{chunk-CJZLIAJF.js → chunk-KVXX5M5A.js} +4 -4
  73. package/dist/{chunk-RO2B4YBF.js → chunk-LWFSXSRG.js} +1 -1
  74. package/dist/{chunk-JOD2325S.js → chunk-N2FDORN6.js} +1 -1
  75. package/dist/{chunk-SB6TYV4M.js → chunk-N2WAXSJY.js} +7 -7
  76. package/dist/{chunk-BFF3ABFV.js → chunk-NFWZVY25.js} +2 -2
  77. package/dist/{chunk-JSPCGPSH.js → chunk-NSR6IFA6.js} +1 -1
  78. package/dist/{chunk-WJLHZ6E6.js → chunk-OXOYS3UG.js} +3 -3
  79. package/dist/{chunk-UQIPWXBL.js → chunk-OYFGZARB.js} +2 -2
  80. package/dist/{chunk-DXCHIKAN.js → chunk-PIGBU7D3.js} +4 -4
  81. package/dist/{chunk-LS42NV6E.js → chunk-PK6WI4HH.js} +4 -4
  82. package/dist/{chunk-CHYBOTQN.js → chunk-QE22XDUK.js} +1 -1
  83. package/dist/{chunk-Y6ZN454E.js → chunk-QZPRCMPV.js} +1 -1
  84. package/dist/{chunk-6LXXKMV6.js → chunk-SCKZVTFV.js} +32 -12
  85. package/dist/{chunk-CPLQ5OHX.js → chunk-SKTZKAGH.js} +1 -1
  86. package/dist/{chunk-LYTWK5TF.js → chunk-SSJDAX4E.js} +90 -7
  87. package/dist/{chunk-LJHDUKBB.js → chunk-TXRV7AOA.js} +4 -4
  88. package/dist/{chunk-KNUYUQBP.js → chunk-VIQ5OS5E.js} +2 -2
  89. package/dist/{chunk-EQR6JSFE.js → chunk-WOJW23ZD.js} +6 -6
  90. package/dist/{chunk-5MOJCOCF.js → chunk-XLKO2XEG.js} +1 -1
  91. package/dist/{chunk-IVB5O6NY.js → chunk-YAA6MT6O.js} +2 -2
  92. package/dist/{chunk-BBFGDYYI.js → chunk-YSOZVBFW.js} +1 -1
  93. package/dist/{chunk-VVIQWGS7.js → chunk-Z3FMJ567.js} +2 -2
  94. package/dist/{codex-app-cards-switch-25TDTMUZ.js → codex-app-cards-switch-GBTS3OQW.js} +7 -7
  95. package/dist/{codex-desktop-launch-JDKUCD2Y.js → codex-desktop-launch-S6OULJDZ.js} +1 -1
  96. package/dist/{codex-session-launch-6N35AAEO.js → codex-session-launch-K2KE3AD5.js} +12 -12
  97. package/dist/{global-upgrade-2QNQD5OM.js → global-upgrade-ZMWRPO5G.js} +8 -8
  98. package/dist/{identity-CUPX2U7Q.js → identity-OLRKDYFR.js} +3 -3
  99. package/dist/{live-capabilities-CUEIWMSM.js → live-capabilities-LZECCGFQ.js} +4 -4
  100. package/dist/{paths-BHLBZ6FY.js → paths-YUF2TFTA.js} +2 -2
  101. package/dist/{reapply-4GXLWZ5M.js → reapply-5SZSMZJJ.js} +21 -21
  102. package/dist/src/index.js +20 -20
  103. package/dist/{upgrade-lock-RDKTAHWR.js → upgrade-lock-MSBKXUKM.js} +3 -3
  104. package/package.json +1 -1
@@ -4,7 +4,7 @@ import {
4
4
  keyPrefix,
5
5
  readConfigFileKey,
6
6
  readMacAppKeyPrefix
7
- } from "./chunk-JOBSKQ2Z.js";
7
+ } from "./chunk-GZHQQP7J.js";
8
8
  import {
9
9
  NPX_LATEST_COMMAND
10
10
  } from "./chunk-X2MTVD4W.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  writeJsonAtomicDurable
3
- } from "./chunk-WJLHZ6E6.js";
3
+ } from "./chunk-OXOYS3UG.js";
4
4
 
5
5
  // src/transcript-recipient-pin.ts
6
6
  import { existsSync, mkdirSync, readFileSync, rmSync } from "fs";
@@ -1,20 +1,22 @@
1
1
  import {
2
2
  ensureCodexTrustsPusharyHooks
3
- } from "./chunk-Y4MRHAE5.js";
3
+ } from "./chunk-54O76CMR.js";
4
4
  import {
5
5
  hermesReceiptPaths,
6
6
  hermesSetupPredatesThePluginFolder,
7
7
  installHermesPlugin,
8
8
  refreshHermesPluginFiles,
9
9
  shippedHermesPlugin
10
- } from "./chunk-VVIQWGS7.js";
10
+ } from "./chunk-Z3FMJ567.js";
11
11
  import {
12
12
  fxIgnoresInstructionsFile,
13
13
  fxInstructionsBody,
14
14
  fxServerHolder,
15
+ installedCliFxBridgeEntry,
15
16
  macAppFxBridge,
16
- refreshClineKey
17
- } from "./chunk-LYTWK5TF.js";
17
+ refreshClineKey,
18
+ switchFxHttpEntryToBridge
19
+ } from "./chunk-SSJDAX4E.js";
18
20
  import {
19
21
  OPENCODE_HOOK_BINARY,
20
22
  agentHookOwner,
@@ -26,16 +28,16 @@ import {
26
28
  openCodePluginDir,
27
29
  openCodeWired,
28
30
  withOpenCodeAskRules
29
- } from "./chunk-NSS2AIGI.js";
31
+ } from "./chunk-72ILLFCY.js";
30
32
  import {
31
33
  detectClaudeVersion
32
- } from "./chunk-IVB5O6NY.js";
34
+ } from "./chunk-YAA6MT6O.js";
33
35
  import {
34
36
  addCompatibleHooks,
35
37
  compatibleConfigFile,
36
38
  compatibleInstructionsFile,
37
39
  hasCompatibleHooks
38
- } from "./chunk-ICQCQAUO.js";
40
+ } from "./chunk-DJPNVVJQ.js";
39
41
  import {
40
42
  GEMINI_HOOK_BINARY,
41
43
  addGeminiHooks,
@@ -47,7 +49,7 @@ import {
47
49
  geminiWired,
48
50
  hasGeminiHooks,
49
51
  planHooks
50
- } from "./chunk-BFF3ABFV.js";
52
+ } from "./chunk-NFWZVY25.js";
51
53
  import {
52
54
  CLAUDE_HOOK_BINARY,
53
55
  CLAUDE_HOOK_EVENTS,
@@ -92,7 +94,7 @@ import {
92
94
  renderAgentInstructions,
93
95
  supportedClaudeEvents,
94
96
  vscodePluginMcp
95
- } from "./chunk-TI4JYPGQ.js";
97
+ } from "./chunk-274CV7IW.js";
96
98
  import {
97
99
  formatVersion,
98
100
  readJsonSafe,
@@ -100,7 +102,7 @@ import {
100
102
  resolveGlobalBinary,
101
103
  writeFileAtomic,
102
104
  writeJsonAtomic
103
- } from "./chunk-WJLHZ6E6.js";
105
+ } from "./chunk-OXOYS3UG.js";
104
106
  import {
105
107
  HOOK_COMPATIBLE_PROFILES,
106
108
  isCompatibleAgentType,
@@ -402,7 +404,25 @@ var reapplyCompatibleHooks = (profile, paths = {}) => {
402
404
  };
403
405
  var CONFIGURED_AND_UNCHANGED = { configured: true, reapplied: false, hooks: false, mcp: false };
404
406
  var fxHolder = () => fxServerHolder(fxMcpProfile(), macAppFxBridge(pusharyDir()));
405
- var inspectFxWiring = () => fxHolder() === "cli" ? CONFIGURED_AND_UNCHANGED : NOT_CONFIGURED;
407
+ var FX_SWITCHED_TO_BRIDGE = { configured: true, reapplied: true, hooks: false, mcp: false, fxBridge: true };
408
+ var fxSwitchResultOf = (outcome) => {
409
+ switch (outcome.kind) {
410
+ case "switched":
411
+ return FX_SWITCHED_TO_BRIDGE;
412
+ case "not-http":
413
+ return NOT_CONFIGURED;
414
+ case "kept":
415
+ return { ...CONFIGURED_AND_UNCHANGED, fxHttpKept: outcome.reason };
416
+ }
417
+ };
418
+ var reapplyFxWiring = (apiKey) => {
419
+ if (fxHolder() === "cli") return CONFIGURED_AND_UNCHANGED;
420
+ return fxSwitchResultOf(switchFxHttpEntryToBridge(fxMcpProfile(), {
421
+ machineKey: apiKey || void 0,
422
+ env: process.env,
423
+ findBridgeEntry: installedCliFxBridgeEntry
424
+ }));
425
+ };
406
426
  var REFRESHED_MCP = { configured: true, reapplied: true, hooks: false, mcp: true };
407
427
  var CLINE_REAPPLY_RESULTS = {
408
428
  refreshed: REFRESHED_MCP,
@@ -489,7 +509,7 @@ var reapplyAllAgents = (apiKey, options = {}) => {
489
509
  run: () => reapplyOpenCodePlugin(),
490
510
  instructions: () => ({ file: openCodeInstructionsFile(), body: renderAgentInstructions(OPENCODE_INSTRUCTIONS_LABEL) })
491
511
  },
492
- { id: "fx", label: "fx", run: inspectFxWiring, instructions: fxInstructionTarget },
512
+ { id: "fx", label: "fx", run: () => reapplyFxWiring(apiKey), instructions: fxInstructionTarget },
493
513
  { id: "cline", label: CLINE_LABEL, run: () => reapplyClineSettings(apiKey), instructions: clineInstructionTarget },
494
514
  { id: "hermes", label: "Hermes", run: reapplyHermesPlugin, instructions: noInstructionBlock },
495
515
  ...HOOK_COMPATIBLE_PROFILES.map((profile) => ({
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  DEFAULT_SESSION
3
- } from "./chunk-XFDWLDHG.js";
3
+ } from "./chunk-HZNZJTGH.js";
4
4
 
5
5
  // src/answer.ts
6
6
  var isDeferAnswer = (value) => value === "defer";
@@ -4,13 +4,13 @@ import {
4
4
  configFailureKind,
5
5
  retryAgentCommand,
6
6
  writeSetupConfigFile
7
- } from "./chunk-JOD2325S.js";
7
+ } from "./chunk-N2FDORN6.js";
8
8
  import {
9
9
  MCP_BRIDGE_BINARY
10
- } from "./chunk-JBRMIADM.js";
10
+ } from "./chunk-D5G2HSQ6.js";
11
11
  import {
12
12
  KEY_FILE_MODE
13
- } from "./chunk-JOBSKQ2Z.js";
13
+ } from "./chunk-GZHQQP7J.js";
14
14
  import {
15
15
  CLINE_SERVER_NAME_TAKEN,
16
16
  CLINE_SETTINGS_REFUSALS,
@@ -23,19 +23,22 @@ import {
23
23
  clinePusharyEntryOf,
24
24
  clineServerNameTakenElsewhere,
25
25
  clineSettingsText,
26
+ guardedArgv,
26
27
  isClinePusharyEntry,
28
+ isPusharyFullAccessMcpUrl,
27
29
  otherPusharyServerNames,
28
30
  readClineSettings,
29
31
  renderAgentInstructions,
30
32
  withClinePusharyServer,
31
33
  withRefreshedClineKey,
32
34
  withoutClinePusharyServer
33
- } from "./chunk-TI4JYPGQ.js";
35
+ } from "./chunk-274CV7IW.js";
34
36
  import {
35
37
  readJsonSafe,
38
+ resolveGlobalBinary,
36
39
  writeFileAtomic,
37
40
  writeJsonAtomic
38
- } from "./chunk-WJLHZ6E6.js";
41
+ } from "./chunk-OXOYS3UG.js";
39
42
 
40
43
  // src/fx-config.ts
41
44
  var FX_SERVER_NAME = "pushary";
@@ -55,8 +58,13 @@ var WORKSPACES_KEY = "workspaces";
55
58
  var CANONICAL_SERVERS_KEY = "mcp";
56
59
  var ALIAS_SERVERS_KEY = "mcpServers";
57
60
  var LOCAL_TRANSPORT = "local";
58
- var SERVER_TRANSPORTS = /* @__PURE__ */ new Set(["local", "stdio", "http", "sse"]);
61
+ var SERVER_TRANSPORTS = /* @__PURE__ */ new Set(["local", "stdio", "http", "streamable-http", "sse"]);
59
62
  var STDIO_TRANSPORTS = /* @__PURE__ */ new Set(["local", "stdio"]);
63
+ var HTTP_TRANSPORTS = /* @__PURE__ */ new Set(["http", "streamable-http", "sse"]);
64
+ var PUSHARY_KEY_ENV = "PUSHARY_API_KEY";
65
+ var URL_KEY_PARAM = "api_key";
66
+ var FX_HTTP_CALLS_CAN_DROP = "fx's MCP-v2 engine (FX_MCP_ENGINE=v2) reuses an HTTP connection the server has already closed, so the first Pushary call after a few idle minutes can fail without reaching Pushary";
67
+ var FX_RELOAD_AFTER_BRIDGE = "Restart fx, or run /mcp reload in each running fx session, so it reaches Pushary through the local bridge.";
60
68
  var AMBIGUOUS_SERVER_KEYS = /* @__PURE__ */ new Set([
61
69
  "mcpserver",
62
70
  "mcpservers",
@@ -200,6 +208,40 @@ var isFxPusharyEntry = (value) => {
200
208
  return STDIO_TRANSPORTS.has(transport) && (commandNamesBridge(entry.command) || commandNamesBridge(entry.args));
201
209
  };
202
210
  var fxPusharyEntryOf = (profile) => asRecord(profile[fxServersKeyOf(profile)])?.[FX_SERVER_NAME];
211
+ var connectsOverHttp = (entry) => typeof entry.type === "string" && HTTP_TRANSPORTS.has(entry.type);
212
+ var isFxPusharyHttpEntry = (value) => {
213
+ const entry = asRecord(value);
214
+ return entry !== void 0 && entry.enabled !== false && connectsOverHttp(entry) && isPusharyFullAccessMcpUrl(entry.url);
215
+ };
216
+ var urlKeyOf = (url) => {
217
+ if (typeof url !== "string") return void 0;
218
+ try {
219
+ return new URL(url).searchParams.get(URL_KEY_PARAM) ?? void 0;
220
+ } catch {
221
+ return void 0;
222
+ }
223
+ };
224
+ var fxHttpEntryUsesKey = (value, machineKey, env) => {
225
+ const entry = asRecord(value);
226
+ if (!entry) return false;
227
+ const variable = typeof entry.bearer_token_env === "string" ? entry.bearer_token_env : void 0;
228
+ if (variable === PUSHARY_KEY_ENV) return true;
229
+ const key = variable === void 0 ? urlKeyOf(entry.url) : env[variable];
230
+ return key?.trim() === machineKey;
231
+ };
232
+ var isOtherPusharyHttpServer = ([name, entry]) => name !== FX_SERVER_NAME && isFxPusharyHttpEntry(entry);
233
+ var serverNameOf = ([name]) => name;
234
+ var fxOtherPusharyHttpServers = (profile) => Object.entries(asRecord(profile[fxServersKeyOf(profile)]) ?? {}).filter(isOtherPusharyHttpServer).map(serverNameOf);
235
+ var quotedServerNames = (names) => names.map((name) => `"${name}"`).join(", ");
236
+ var fxOtherHttpServersNote = (names, profilePath, retryCommand) => `fx also reaches Pushary over HTTP through ${quotedServerNames(names)} in ${profilePath}. ${FX_HTTP_CALLS_CAN_DROP}. Remove ${names.length === 1 ? "it" : "them"}, then run ${retryCommand}.`;
237
+ var FX_HTTP_ENTRY_KEPT_BECAUSE = {
238
+ "no-key": "no Pushary key could be read on this machine for the local bridge",
239
+ "other-key": "it signs in with its own credential, not this machine's Pushary key, and the local bridge would use this machine's key",
240
+ "no-bridge": "the Pushary bridge could not be found in the global npm install",
241
+ unwritable: "the file could not be written"
242
+ };
243
+ var fxHttpEntryKeptNote = (reason, profilePath, retryCommand) => `fx still reaches Pushary over HTTP ("${FX_SERVER_NAME}" in ${profilePath}), because ${FX_HTTP_ENTRY_KEPT_BECAUSE[reason]}. ${FX_HTTP_CALLS_CAN_DROP}. Run ${retryCommand} to switch it.`;
244
+ var fxHttpEntryDoctorNote = (profilePath, retryCommand) => `${profilePath} points "${FX_SERVER_NAME}" straight at Pushary over HTTP. ${FX_HTTP_CALLS_CAN_DROP}. Run ${retryCommand} to switch it to the local bridge.`;
203
245
  var isBridgeTarget = (part) => namesBridge(part);
204
246
  var fxBridgeTargetOf = (value) => {
205
247
  const entry = asRecord(value);
@@ -435,6 +477,40 @@ var fxServerHolder = (profilePath, appBridge) => {
435
477
  if (!isFxPusharyEntry(entry)) return "none";
436
478
  return fxBridgeTargetOf(entry) === appBridge ? "app" : "cli";
437
479
  };
480
+ var fxBridgeEntryAt = (bridgePath) => fxPusharyEntry(guardedArgv({ kind: "binary", path: bridgePath, runtime: "node" }));
481
+ var cliFxBridgeEntry = () => fxBridgeEntryAt(resolveGlobalBinary(MCP_BRIDGE_BINARY) ?? MCP_BRIDGE_BINARY);
482
+ var installedCliFxBridgeEntry = () => {
483
+ const installed = resolveGlobalBinary(MCP_BRIDGE_BINARY);
484
+ return installed === void 0 ? void 0 : fxBridgeEntryAt(installed);
485
+ };
486
+ var NO_FX_PUSHARY_HTTP_WIRING = { pusharyOverHttp: false, otherHttpServers: [] };
487
+ var inspectFxPusharyHttpWiring = (profilePath) => {
488
+ const read = readFxFile(profilePath, readFxProfile);
489
+ if (read.kind !== "profile") return NO_FX_PUSHARY_HTTP_WIRING;
490
+ return {
491
+ pusharyOverHttp: isFxPusharyHttpEntry(fxPusharyEntryOf(read.profile)),
492
+ otherHttpServers: fxOtherPusharyHttpServers(read.profile)
493
+ };
494
+ };
495
+ var FX_HTTP_ENTRY_SWITCHED = { kind: "switched" };
496
+ var FX_ENTRY_NOT_HTTP = { kind: "not-http" };
497
+ var fxHttpEntryKept = (reason) => ({ kind: "kept", reason });
498
+ var switchFxHttpEntryToBridge = (profilePath, input) => {
499
+ const read = readFxFile(profilePath, readFxProfile);
500
+ if (read.kind !== "profile") return FX_ENTRY_NOT_HTTP;
501
+ const entry = fxPusharyEntryOf(read.profile);
502
+ if (!isFxPusharyHttpEntry(entry)) return FX_ENTRY_NOT_HTTP;
503
+ if (input.machineKey === void 0) return fxHttpEntryKept("no-key");
504
+ if (!fxHttpEntryUsesKey(entry, input.machineKey, input.env)) return fxHttpEntryKept("other-key");
505
+ const bridgeEntry = input.findBridgeEntry();
506
+ if (bridgeEntry === void 0) return fxHttpEntryKept("no-bridge");
507
+ try {
508
+ writeFxProfile(profilePath, withFxPusharyServer(read.profile, bridgeEntry));
509
+ return FX_HTTP_ENTRY_SWITCHED;
510
+ } catch {
511
+ return fxHttpEntryKept("unwritable");
512
+ }
513
+ };
438
514
  var fxSettingsReadRefusal = (filePath, read) => {
439
515
  if (read.kind === "unreadable") return `${filePath} could not be read`;
440
516
  if (read.kind === "refused") return `${filePath} ${FX_SETTINGS_REFUSALS[read.reason]}`;
@@ -701,15 +777,22 @@ var removeClineServer = (settingsPath) => {
701
777
  export {
702
778
  FX_PUSHARY_TOOLS_RULE,
703
779
  fxInstructionsBody,
780
+ FX_RELOAD_AFTER_BRIDGE,
704
781
  FX_PROFILE_REFUSALS,
705
- fxPusharyEntry,
706
782
  withFxPusharyServer,
783
+ fxOtherHttpServersNote,
784
+ fxHttpEntryKeptNote,
785
+ fxHttpEntryDoctorNote,
707
786
  FX_QUESTION_TOOL,
708
787
  fxIgnoresInstructionsFile,
709
788
  readFxProfileForSetup,
710
789
  writeFxProfile,
711
790
  macAppFxBridge,
712
791
  fxServerHolder,
792
+ cliFxBridgeEntry,
793
+ installedCliFxBridgeEntry,
794
+ inspectFxPusharyHttpWiring,
795
+ switchFxHttpEntryToBridge,
713
796
  configureFxSettings,
714
797
  inspectFxInstallation,
715
798
  planFxRemoval,
@@ -4,20 +4,20 @@ import {
4
4
  } from "./chunk-XHKBHWLX.js";
5
5
  import {
6
6
  readControlMode
7
- } from "./chunk-JOBSKQ2Z.js";
7
+ } from "./chunk-GZHQQP7J.js";
8
8
  import {
9
9
  getMachineId
10
- } from "./chunk-PIBWX3EF.js";
10
+ } from "./chunk-FZ2SHXUE.js";
11
11
  import {
12
12
  pusharyDir
13
- } from "./chunk-TI4JYPGQ.js";
13
+ } from "./chunk-274CV7IW.js";
14
14
  import {
15
15
  readJsonSafe,
16
16
  resolveGlobalBinary,
17
17
  writeFileAtomic,
18
18
  writeJsonAtomic,
19
19
  writeJsonAtomicDurable
20
- } from "./chunk-WJLHZ6E6.js";
20
+ } from "./chunk-OXOYS3UG.js";
21
21
  import {
22
22
  getApiKey
23
23
  } from "./chunk-32OSSYGZ.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  keyCheckFromResponse
3
- } from "./chunk-3THDNNVL.js";
3
+ } from "./chunk-AQA63ZWO.js";
4
4
  import {
5
5
  installNetworkDefaults
6
- } from "./chunk-P4RXSZDT.js";
6
+ } from "./chunk-KHOWMC57.js";
7
7
  import {
8
8
  getBaseUrl
9
9
  } from "./chunk-32OSSYGZ.js";
@@ -1,25 +1,25 @@
1
1
  import {
2
2
  registerTranscript
3
- } from "./chunk-SB6TYV4M.js";
3
+ } from "./chunk-N2WAXSJY.js";
4
4
  import {
5
5
  namedEvent
6
- } from "./chunk-ICQCQAUO.js";
6
+ } from "./chunk-DJPNVVJQ.js";
7
7
  import {
8
8
  isBridgeLocator,
9
9
  liveBridgeProbe,
10
10
  pusharyHookExecutable,
11
11
  resolveBridgeStub
12
- } from "./chunk-BFF3ABFV.js";
12
+ } from "./chunk-NFWZVY25.js";
13
13
  import {
14
14
  writeDegraded
15
- } from "./chunk-D3U6CN7T.js";
15
+ } from "./chunk-FD6KOIT2.js";
16
16
  import {
17
17
  cursorUserHooks
18
- } from "./chunk-TI4JYPGQ.js";
18
+ } from "./chunk-274CV7IW.js";
19
19
  import {
20
20
  atLeast,
21
21
  parseVersion
22
- } from "./chunk-WJLHZ6E6.js";
22
+ } from "./chunk-OXOYS3UG.js";
23
23
  import {
24
24
  CURSOR_GATE_COVERAGE,
25
25
  CURSOR_GATE_SCRIPT,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  absoluteUrl
3
- } from "./chunk-3THDNNVL.js";
3
+ } from "./chunk-AQA63ZWO.js";
4
4
  import {
5
5
  KEY_SCOPE
6
6
  } from "./chunk-RQOT6QL3.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  findNativeClaudeInstall
3
- } from "./chunk-BBFGDYYI.js";
3
+ } from "./chunk-YSOZVBFW.js";
4
4
  import {
5
5
  parseVersion
6
- } from "./chunk-WJLHZ6E6.js";
6
+ } from "./chunk-OXOYS3UG.js";
7
7
  import {
8
8
  isRecord
9
9
  } from "./chunk-RQOT6QL3.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isFile
3
- } from "./chunk-WJLHZ6E6.js";
3
+ } from "./chunk-OXOYS3UG.js";
4
4
 
5
5
  // src/claude-native-install.ts
6
6
  import { accessSync, constants } from "fs";
@@ -5,12 +5,12 @@ import {
5
5
  hermesAppWiringRecord,
6
6
  hermesConfigReceipt,
7
7
  hermesSetupReceipt
8
- } from "./chunk-TI4JYPGQ.js";
8
+ } from "./chunk-274CV7IW.js";
9
9
  import {
10
10
  readJsonSafe,
11
11
  resolvePathBinary,
12
12
  writeJsonAtomic
13
- } from "./chunk-WJLHZ6E6.js";
13
+ } from "./chunk-OXOYS3UG.js";
14
14
  import {
15
15
  isNewerVersion,
16
16
  isReleaseVersion
@@ -22,18 +22,18 @@ import {
22
22
  turnCodexAppCardsOff,
23
23
  turnCodexAppCardsOn,
24
24
  whyLaunchctlFailed
25
- } from "./chunk-564IPPBL.js";
26
- import "./chunk-ZPIYJLQ3.js";
25
+ } from "./chunk-FULXDMAP.js";
26
+ import "./chunk-2LI3DF7Q.js";
27
27
  import "./chunk-XCEN33UP.js";
28
28
  import "./chunk-QCGNGEGE.js";
29
- import "./chunk-LJHDUKBB.js";
29
+ import "./chunk-TXRV7AOA.js";
30
30
  import "./chunk-XHKBHWLX.js";
31
- import "./chunk-JOBSKQ2Z.js";
31
+ import "./chunk-GZHQQP7J.js";
32
32
  import "./chunk-E46NE7FB.js";
33
- import "./chunk-PIBWX3EF.js";
33
+ import "./chunk-FZ2SHXUE.js";
34
34
  import "./chunk-METUT7V4.js";
35
- import "./chunk-TI4JYPGQ.js";
36
- import "./chunk-WJLHZ6E6.js";
35
+ import "./chunk-274CV7IW.js";
36
+ import "./chunk-OXOYS3UG.js";
37
37
  import "./chunk-32OSSYGZ.js";
38
38
  import "./chunk-X2MTVD4W.js";
39
39
  import "./chunk-QTOLNRET.js";
@@ -11,7 +11,7 @@ import {
11
11
  installedCodexApp,
12
12
  shellQuoted,
13
13
  writeDesktopProxy
14
- } from "./chunk-ZPIYJLQ3.js";
14
+ } from "./chunk-2LI3DF7Q.js";
15
15
  import "./chunk-XCEN33UP.js";
16
16
  import {
17
17
  CODEX_APP_LAUNCH_VARIABLE
@@ -11,27 +11,27 @@ import {
11
11
  isCodexQuestionLeftWithTheLocalClient,
12
12
  planCodexElicitation,
13
13
  reportOwnedQuestion
14
- } from "./chunk-KIXRHNCW.js";
14
+ } from "./chunk-CPYVVEJP.js";
15
15
  import "./chunk-XZKSUJ55.js";
16
- import "./chunk-KE4TSJUD.js";
17
- import "./chunk-IVB5O6NY.js";
18
- import "./chunk-XNUWKKGS.js";
19
- import "./chunk-BBFGDYYI.js";
16
+ import "./chunk-EAJUFO7Q.js";
17
+ import "./chunk-YAA6MT6O.js";
18
+ import "./chunk-JWRDCANS.js";
19
+ import "./chunk-YSOZVBFW.js";
20
20
  import "./chunk-NWN6GGJL.js";
21
21
  import "./chunk-XHKBHWLX.js";
22
22
  import "./chunk-GMHQYX3D.js";
23
23
  import {
24
24
  writeDegraded
25
- } from "./chunk-D3U6CN7T.js";
25
+ } from "./chunk-FD6KOIT2.js";
26
26
  import "./chunk-POFBE6ZY.js";
27
- import "./chunk-KNUYUQBP.js";
28
- import "./chunk-3THDNNVL.js";
29
- import "./chunk-P4RXSZDT.js";
30
- import "./chunk-PIBWX3EF.js";
27
+ import "./chunk-VIQ5OS5E.js";
28
+ import "./chunk-AQA63ZWO.js";
29
+ import "./chunk-KHOWMC57.js";
30
+ import "./chunk-FZ2SHXUE.js";
31
31
  import "./chunk-PPY5N2E6.js";
32
32
  import "./chunk-KZERVKTD.js";
33
- import "./chunk-TI4JYPGQ.js";
34
- import "./chunk-WJLHZ6E6.js";
33
+ import "./chunk-274CV7IW.js";
34
+ import "./chunk-OXOYS3UG.js";
35
35
  import "./chunk-32OSSYGZ.js";
36
36
  import "./chunk-X2MTVD4W.js";
37
37
  import "./chunk-QTOLNRET.js";
@@ -7,16 +7,16 @@ import {
7
7
  recordUnfinishedUpgrade,
8
8
  upgradeInstalledPackage,
9
9
  withUpgradeLock
10
- } from "./chunk-VEYFXRZ6.js";
11
- import "./chunk-DP6LU6BB.js";
12
- import "./chunk-KE4TSJUD.js";
13
- import "./chunk-IVB5O6NY.js";
14
- import "./chunk-BBFGDYYI.js";
15
- import "./chunk-IXTVUINH.js";
10
+ } from "./chunk-5UIA5GLL.js";
11
+ import "./chunk-2REVIFLS.js";
12
+ import "./chunk-EAJUFO7Q.js";
13
+ import "./chunk-YAA6MT6O.js";
14
+ import "./chunk-YSOZVBFW.js";
15
+ import "./chunk-4BXI6WJI.js";
16
16
  import "./chunk-POFBE6ZY.js";
17
17
  import "./chunk-KZERVKTD.js";
18
- import "./chunk-TI4JYPGQ.js";
19
- import "./chunk-WJLHZ6E6.js";
18
+ import "./chunk-274CV7IW.js";
19
+ import "./chunk-OXOYS3UG.js";
20
20
  import "./chunk-X2MTVD4W.js";
21
21
  import "./chunk-QTOLNRET.js";
22
22
  import "./chunk-RQOT6QL3.js";
@@ -2,9 +2,9 @@ import {
2
2
  getMachineId,
3
3
  getOrCreateMachineId,
4
4
  readExistingMachineId
5
- } from "./chunk-PIBWX3EF.js";
6
- import "./chunk-TI4JYPGQ.js";
7
- import "./chunk-WJLHZ6E6.js";
5
+ } from "./chunk-FZ2SHXUE.js";
6
+ import "./chunk-274CV7IW.js";
7
+ import "./chunk-OXOYS3UG.js";
8
8
  import "./chunk-QTOLNRET.js";
9
9
  import "./chunk-RQOT6QL3.js";
10
10
  import "./chunk-MLKGABMK.js";
@@ -22,10 +22,10 @@ import {
22
22
  resolveControlPolicy,
23
23
  resolveProviderBinary,
24
24
  trackProviderInventory
25
- } from "./chunk-KE4TSJUD.js";
26
- import "./chunk-IVB5O6NY.js";
27
- import "./chunk-BBFGDYYI.js";
28
- import "./chunk-WJLHZ6E6.js";
25
+ } from "./chunk-EAJUFO7Q.js";
26
+ import "./chunk-YAA6MT6O.js";
27
+ import "./chunk-YSOZVBFW.js";
28
+ import "./chunk-OXOYS3UG.js";
29
29
  import "./chunk-QTOLNRET.js";
30
30
  import "./chunk-RQOT6QL3.js";
31
31
  import "./chunk-MLKGABMK.js";
@@ -37,8 +37,8 @@ import {
37
37
  serviceOwedBackMark,
38
38
  vscodePluginDir,
39
39
  vscodePluginMcp
40
- } from "./chunk-TI4JYPGQ.js";
41
- import "./chunk-WJLHZ6E6.js";
40
+ } from "./chunk-274CV7IW.js";
41
+ import "./chunk-OXOYS3UG.js";
42
42
  import "./chunk-QTOLNRET.js";
43
43
  import "./chunk-RQOT6QL3.js";
44
44
  import "./chunk-MLKGABMK.js";
@@ -12,35 +12,35 @@ import {
12
12
  reapplyOpenCodePlugin,
13
13
  reapplyVsCodePlugin,
14
14
  repairCodexHolds
15
- } from "./chunk-6LXXKMV6.js";
16
- import "./chunk-Y4MRHAE5.js";
17
- import "./chunk-VVIQWGS7.js";
18
- import "./chunk-LYTWK5TF.js";
19
- import "./chunk-JOD2325S.js";
20
- import "./chunk-JBRMIADM.js";
21
- import "./chunk-NSS2AIGI.js";
22
- import "./chunk-IVB5O6NY.js";
23
- import "./chunk-BBFGDYYI.js";
24
- import "./chunk-ICQCQAUO.js";
25
- import "./chunk-BFF3ABFV.js";
15
+ } from "./chunk-SCKZVTFV.js";
16
+ import "./chunk-54O76CMR.js";
17
+ import "./chunk-Z3FMJ567.js";
18
+ import "./chunk-SSJDAX4E.js";
19
+ import "./chunk-N2FDORN6.js";
20
+ import "./chunk-D5G2HSQ6.js";
21
+ import "./chunk-72ILLFCY.js";
22
+ import "./chunk-YAA6MT6O.js";
23
+ import "./chunk-YSOZVBFW.js";
24
+ import "./chunk-DJPNVVJQ.js";
25
+ import "./chunk-NFWZVY25.js";
26
26
  import "./chunk-ZK5WYAMI.js";
27
- import "./chunk-FONWVVDD.js";
27
+ import "./chunk-CJ3W7XRU.js";
28
28
  import "./chunk-NMUI3ZWG.js";
29
29
  import "./chunk-XHKBHWLX.js";
30
- import "./chunk-JOBSKQ2Z.js";
31
- import "./chunk-XFDWLDHG.js";
30
+ import "./chunk-GZHQQP7J.js";
31
+ import "./chunk-HZNZJTGH.js";
32
32
  import "./chunk-GMHQYX3D.js";
33
- import "./chunk-D3U6CN7T.js";
33
+ import "./chunk-FD6KOIT2.js";
34
34
  import "./chunk-POFBE6ZY.js";
35
- import "./chunk-KNUYUQBP.js";
36
- import "./chunk-3THDNNVL.js";
37
- import "./chunk-P4RXSZDT.js";
38
- import "./chunk-PIBWX3EF.js";
35
+ import "./chunk-VIQ5OS5E.js";
36
+ import "./chunk-AQA63ZWO.js";
37
+ import "./chunk-KHOWMC57.js";
38
+ import "./chunk-FZ2SHXUE.js";
39
39
  import "./chunk-PPY5N2E6.js";
40
40
  import "./chunk-KZERVKTD.js";
41
41
  import "./chunk-METUT7V4.js";
42
- import "./chunk-TI4JYPGQ.js";
43
- import "./chunk-WJLHZ6E6.js";
42
+ import "./chunk-274CV7IW.js";
43
+ import "./chunk-OXOYS3UG.js";
44
44
  import "./chunk-32OSSYGZ.js";
45
45
  import "./chunk-X2MTVD4W.js";
46
46
  import "./chunk-QTOLNRET.js";