pushary 1.9.247 → 1.9.249

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 (143) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/data/openclaw-plugin/dist/json-record.js +1 -0
  3. package/dist/{api-AP7ZKAC4.js → api-NCCKFLNT.js} +11 -11
  4. package/dist/bin/pushary-audit.js +3 -3
  5. package/dist/bin/pushary-bell-hook.js +28 -28
  6. package/dist/bin/pushary-bell.js +12 -12
  7. package/dist/bin/pushary-calls.js +15 -15
  8. package/dist/bin/pushary-claude.js +26 -26
  9. package/dist/bin/pushary-clean.js +67 -57
  10. package/dist/bin/pushary-codex-bridge.js +23 -23
  11. package/dist/bin/pushary-codex-hook.js +34 -34
  12. package/dist/bin/pushary-codex-session.js +8 -8
  13. package/dist/bin/pushary-codex.js +16 -16
  14. package/dist/bin/pushary-connect.js +35 -35
  15. package/dist/bin/pushary-cowork.js +5 -5
  16. package/dist/bin/pushary-daemon.js +46 -46
  17. package/dist/bin/pushary-disconnect.js +30 -30
  18. package/dist/bin/pushary-display-hook.js +21 -10
  19. package/dist/bin/pushary-doctor.js +47 -47
  20. package/dist/bin/pushary-elicitation-hook.js +27 -27
  21. package/dist/bin/pushary-gemini-bridge.js +18 -18
  22. package/dist/bin/pushary-gemini-hook.js +31 -31
  23. package/dist/bin/pushary-hook.js +35 -35
  24. package/dist/bin/pushary-login.js +23 -23
  25. package/dist/bin/pushary-logout.js +31 -31
  26. package/dist/bin/pushary-mcp.js +12 -12
  27. package/dist/bin/pushary-mode.js +16 -16
  28. package/dist/bin/pushary-notification-hook.js +27 -27
  29. package/dist/bin/pushary-opencode-bridge.js +22 -22
  30. package/dist/bin/pushary-opencode-hook.js +32 -32
  31. package/dist/bin/pushary-permission-denied-hook.js +34 -34
  32. package/dist/bin/pushary-permission-hook.js +35 -35
  33. package/dist/bin/pushary-post-hook.js +28 -28
  34. package/dist/bin/pushary-prompt-hook.js +27 -27
  35. package/dist/bin/pushary-session-end-hook.js +27 -27
  36. package/dist/bin/pushary-session-start-hook.js +39 -39
  37. package/dist/bin/pushary-sessions.js +12 -12
  38. package/dist/bin/pushary-setup.js +69 -60
  39. package/dist/bin/pushary-stats.js +5 -5
  40. package/dist/bin/pushary-status.js +36 -36
  41. package/dist/bin/pushary-stop-hook.js +27 -27
  42. package/dist/bin/pushary-stopfailure-hook.js +27 -27
  43. package/dist/bin/pushary-suggestions.js +16 -16
  44. package/dist/bin/pushary-transcript-register.js +17 -17
  45. package/dist/bin/pushary-transcripts.js +26 -26
  46. package/dist/bin/pushary-upgrade.js +47 -47
  47. package/dist/bin/pushary-wait.js +16 -16
  48. package/dist/bin/pushary.js +7 -7
  49. package/dist/{chunk-7KQL5NR6.js → chunk-2E23LSLT.js} +1 -1
  50. package/dist/{chunk-O5OPPV2S.js → chunk-2R2LXG6H.js} +11 -11
  51. package/dist/{chunk-46IJNC36.js → chunk-33IFGELL.js} +1 -1
  52. package/dist/{chunk-4HYHQYHX.js → chunk-3BFJF63Q.js} +5 -5
  53. package/dist/{chunk-7MZQVWYF.js → chunk-3DGOI6YH.js} +5 -5
  54. package/dist/{chunk-AAM62GRJ.js → chunk-3PWAFQCI.js} +1 -1
  55. package/dist/{chunk-QCYZY7SM.js → chunk-3S4OKDZR.js} +1 -1
  56. package/dist/{chunk-TIGMJWTH.js → chunk-4E3KK4PH.js} +3 -3
  57. package/dist/{chunk-AABRXBIY.js → chunk-4QTDUXS5.js} +1 -1
  58. package/dist/{chunk-S4N5VZRJ.js → chunk-5L7YJPS2.js} +1 -1
  59. package/dist/{chunk-HGWBXD3A.js → chunk-5Y7CYSQO.js} +2 -2
  60. package/dist/{chunk-XF6LGULK.js → chunk-7SIC6DRK.js} +6 -6
  61. package/dist/{chunk-L5YCMEOV.js → chunk-ACG4HJ27.js} +1 -1
  62. package/dist/{chunk-2MHP66YE.js → chunk-AKGJQEGR.js} +1 -1
  63. package/dist/{chunk-534LSPWP.js → chunk-AKT3UR6S.js} +2 -2
  64. package/dist/{chunk-KO3VP7KV.js → chunk-AV5QS5FQ.js} +4 -4
  65. package/dist/{chunk-6LNSHFHD.js → chunk-BDMNQBP4.js} +22 -22
  66. package/dist/{chunk-PCSUSVPL.js → chunk-BMVNMKVL.js} +3 -3
  67. package/dist/{chunk-5JLTTZ4A.js → chunk-BZJ22MT6.js} +1 -1
  68. package/dist/{chunk-GZBAWH5W.js → chunk-DIGV5AQW.js} +4 -4
  69. package/dist/{chunk-TIT3JTG2.js → chunk-DRLY2ELW.js} +2 -2
  70. package/dist/{chunk-C22UGPRX.js → chunk-DT6NJLC3.js} +1 -1
  71. package/dist/{chunk-BXY5XZEI.js → chunk-FJBU6OWM.js} +2 -2
  72. package/dist/{chunk-GA6CXG7J.js → chunk-FM7FNY5J.js} +4 -1
  73. package/dist/{chunk-R7ZFEHXE.js → chunk-FS4VJTFC.js} +1 -1
  74. package/dist/{chunk-ZHQ5GDGT.js → chunk-FZBLNBFS.js} +6 -6
  75. package/dist/{chunk-UP4JGKLJ.js → chunk-G76IPLDX.js} +1 -1
  76. package/dist/{chunk-23J7UISJ.js → chunk-GFGSIDHQ.js} +41 -35
  77. package/dist/{chunk-64QB6LAZ.js → chunk-GISC7J7K.js} +1 -1
  78. package/dist/{chunk-SI642PQX.js → chunk-GPGUGAO7.js} +1 -1
  79. package/dist/{chunk-RJKX4FJJ.js → chunk-IA44JTLJ.js} +2 -2
  80. package/dist/{chunk-LHKIMBJO.js → chunk-IR6ZNTDK.js} +10 -10
  81. package/dist/{chunk-OXKDOZH5.js → chunk-JZCSXMWF.js} +4 -4
  82. package/dist/{chunk-2BZECJVP.js → chunk-K63QVFSB.js} +27 -6
  83. package/dist/{chunk-3WVNDX5O.js → chunk-KFRYGJS5.js} +4 -4
  84. package/dist/{chunk-GVGLZBOG.js → chunk-KIYUQ2XZ.js} +3 -3
  85. package/dist/{chunk-D5PK3FCS.js → chunk-KT7COQH2.js} +3 -3
  86. package/dist/{chunk-DVM22JGJ.js → chunk-LRCWZNYY.js} +5 -5
  87. package/dist/{chunk-OQ4MBJEK.js → chunk-MAXV4AZR.js} +2 -2
  88. package/dist/{chunk-JJTKHAVD.js → chunk-MGKF5FLQ.js} +13 -3
  89. package/dist/{chunk-UTOND6JN.js → chunk-MQGFUEYG.js} +1 -1
  90. package/dist/{chunk-VX54TD6Y.js → chunk-NC24UL7K.js} +1 -1
  91. package/dist/{chunk-YTGHV5F3.js → chunk-NFYD5TJK.js} +2 -2
  92. package/dist/{chunk-A7OIGKCQ.js → chunk-NLAT5MMY.js} +15 -5
  93. package/dist/{chunk-NMBUEXCN.js → chunk-NLHVEM3C.js} +7 -7
  94. package/dist/{chunk-Y7I5JUKB.js → chunk-NQ6KV722.js} +53 -25
  95. package/dist/{chunk-5ZV4OJLQ.js → chunk-OD2I3DD6.js} +3 -3
  96. package/dist/{chunk-VYGQZDXZ.js → chunk-PFN76FSF.js} +1 -1
  97. package/dist/{chunk-CN7P65IZ.js → chunk-PNZPLFKE.js} +41 -5
  98. package/dist/{chunk-33D2NTVD.js → chunk-QLHSLYOR.js} +5 -5
  99. package/dist/{chunk-URI4M2Y7.js → chunk-QLKUYP7Z.js} +1 -1
  100. package/dist/{chunk-6L7SVCL7.js → chunk-QR2OSVGC.js} +12 -2
  101. package/dist/{chunk-XRKK7REL.js → chunk-QTXUETWK.js} +9 -9
  102. package/dist/{chunk-MOOSK3D3.js → chunk-RRUZZQ74.js} +5 -5
  103. package/dist/{chunk-DIVCBKJX.js → chunk-S5VZAJZC.js} +2 -2
  104. package/dist/{chunk-MJI2OVQQ.js → chunk-S7CJ2L7L.js} +12 -12
  105. package/dist/{chunk-UYI7GNRI.js → chunk-SVHLXOER.js} +4 -4
  106. package/dist/{chunk-RGY5D5KQ.js → chunk-SYYPELYT.js} +2 -2
  107. package/dist/{chunk-GRF3ROE7.js → chunk-TM3WECNP.js} +5 -5
  108. package/dist/{chunk-B236OY5Z.js → chunk-TTUKVQTQ.js} +6 -3
  109. package/dist/{chunk-FGDWDPRQ.js → chunk-UE5QZNZO.js} +7 -7
  110. package/dist/{chunk-ZEYB3PCY.js → chunk-UNATZHHI.js} +5 -5
  111. package/dist/{chunk-MNYCJISM.js → chunk-USMEX5WO.js} +1 -1
  112. package/dist/{chunk-U4SM4755.js → chunk-UWVA7YWR.js} +10 -5
  113. package/dist/{chunk-WSNBD56T.js → chunk-UXXYHW6B.js} +2 -2
  114. package/dist/{chunk-44K7GQQF.js → chunk-V4DMA2GT.js} +1 -1
  115. package/dist/{chunk-AXCLC72D.js → chunk-VSPTVHE2.js} +8 -8
  116. package/dist/{chunk-SNO4Q74P.js → chunk-VUDAFOQU.js} +16 -16
  117. package/dist/{chunk-GRI3QUPX.js → chunk-WE7TYQVB.js} +3 -3
  118. package/dist/{chunk-ZPXFKXHV.js → chunk-WGZFBSXM.js} +3 -3
  119. package/dist/{chunk-FFFNHVN6.js → chunk-WILH4LFK.js} +6 -6
  120. package/dist/{chunk-4JT2BY7S.js → chunk-WYIJA2GH.js} +4 -4
  121. package/dist/{chunk-ABEAPF3L.js → chunk-X37REV7T.js} +1 -1
  122. package/dist/{chunk-F5F7S2JJ.js → chunk-XJR2JCWQ.js} +6 -6
  123. package/dist/{chunk-K3KHHIKW.js → chunk-Y4R3NQQG.js} +4 -4
  124. package/dist/{chunk-WDW4F5RB.js → chunk-YONUK2EY.js} +1 -1
  125. package/dist/{chunk-I5EO46FK.js → chunk-YRIECI5K.js} +4 -4
  126. package/dist/{chunk-MZAW27UT.js → chunk-ZCRO6HW2.js} +3 -3
  127. package/dist/{chunk-JS3LOMRQ.js → chunk-ZGA2LFVD.js} +3 -3
  128. package/dist/{chunk-4CU2JKVB.js → chunk-ZPSLQQ4F.js} +6 -6
  129. package/dist/{chunk-NFCYFGGB.js → chunk-ZQYYPDFT.js} +5 -5
  130. package/dist/{codex-app-cards-switch-LSUHIBWH.js → codex-app-cards-switch-J3AR3LN3.js} +13 -11
  131. package/dist/{codex-card-routing-UALNWUT7.js → codex-card-routing-K6LLM4TA.js} +2 -2
  132. package/dist/{codex-desktop-launch-NJJP3LOL.js → codex-desktop-launch-FK53DJ36.js} +3 -3
  133. package/dist/{codex-session-launch-SV3UAIQN.js → codex-session-launch-PY52DUMW.js} +20 -20
  134. package/dist/{config-DIUV6RBG.js → config-2NISBOJX.js} +3 -3
  135. package/dist/{global-upgrade-432FL35T.js → global-upgrade-2CK75GFZ.js} +9 -9
  136. package/dist/{identity-Y4TV3HOR.js → identity-T2EYYWQJ.js} +4 -4
  137. package/dist/{live-capabilities-TF5OI6MP.js → live-capabilities-V4LJIPMB.js} +4 -4
  138. package/dist/{paths-PUHJCRSZ.js → paths-XULGFNML.js} +3 -3
  139. package/dist/{reapply-YF6ZPMSG.js → reapply-KAEIPK36.js} +34 -34
  140. package/dist/src/index.js +33 -33
  141. package/dist/{upgrade-lock-KGXKS5S3.js → upgrade-lock-TPOCYNQ3.js} +8 -4
  142. package/dist/{usage-D7HCNUXP.js → usage-SMB3WYHN.js} +3 -3
  143. package/package.json +1 -1
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  quoteIfNeeded,
7
7
  shellDoubleQuoted
8
- } from "./chunk-2BZECJVP.js";
8
+ } from "./chunk-K63QVFSB.js";
9
9
  import {
10
10
  writeFileAtomic
11
11
  } from "./chunk-PM2NRK6Y.js";
@@ -24,7 +24,7 @@ import {
24
24
  PUSHARY_HOSTS,
25
25
  PUSHARY_TOOL_PREFIX,
26
26
  withHookHoldBudget
27
- } from "./chunk-6LNSHFHD.js";
27
+ } from "./chunk-BDMNQBP4.js";
28
28
 
29
29
  // src/setup/paths.ts
30
30
  import { createHash as createHash2 } from "crypto";
@@ -772,6 +772,28 @@ var needsReregistration = (stored, version) => {
772
772
 
773
773
  // src/claude-config.ts
774
774
  import { isDeepStrictEqual } from "util";
775
+
776
+ // src/pushary-mcp-url.ts
777
+ var PUSHARY_MCP_HOSTS = new Set(PUSHARY_HOSTS);
778
+ var PUSHARY_MCP_PATH_PREFIX = "/api/mcp";
779
+ var isPusharyMcpPath = (pathname) => pathname === PUSHARY_MCP_PATH_PREFIX || pathname.startsWith(`${PUSHARY_MCP_PATH_PREFIX}/`);
780
+ var PUSHARY_FULL_ACCESS_MCP_PATHS = /* @__PURE__ */ new Set(["/api/mcp/mcp", "/api/mcp/sse"]);
781
+ var pusharyMcpPathOf = (value) => {
782
+ if (typeof value !== "string") return void 0;
783
+ try {
784
+ const url = new URL(value);
785
+ return PUSHARY_MCP_HOSTS.has(url.hostname) && isPusharyMcpPath(url.pathname) ? url.pathname : void 0;
786
+ } catch {
787
+ return void 0;
788
+ }
789
+ };
790
+ var isPusharyMcpUrl = (value) => pusharyMcpPathOf(value) !== void 0;
791
+ var isPusharyFullAccessMcpUrl = (value) => {
792
+ const path = pusharyMcpPathOf(value);
793
+ return path !== void 0 && PUSHARY_FULL_ACCESS_MCP_PATHS.has(path.replace(/\/$/, ""));
794
+ };
795
+
796
+ // src/claude-config.ts
775
797
  var PUSHARY_MCP_URL = "https://pushary.com/api/mcp/mcp";
776
798
  var PUSHARY_PERMISSION_RULE = `${PUSHARY_TOOL_PREFIX}*`;
777
799
  var PUSHARY_CONNECTOR_PERMISSION_RULES = PUSHARY_CONNECTOR_TOOL_PREFIXES.map((prefix) => `${prefix}*`);
@@ -831,6 +853,7 @@ var updateClaudeMcpSnapshot = (snapshot, apiKey) => ({
831
853
  ...snapshot,
832
854
  installedPushary: pusharyMcpServer(apiKey)
833
855
  });
856
+ var isPusharyMcpServer = (entry2) => isPusharyMcpUrl(asRecord3(entry2)?.url);
834
857
  var restoreClaudeMcpServer = (config, snapshot) => {
835
858
  const mcpServers = asRecord3(config.mcpServers);
836
859
  const current = asRecord3(mcpServers?.pushary);
@@ -854,11 +877,11 @@ var restoreClaudeMcpServer = (config, snapshot) => {
854
877
  }
855
878
  return true;
856
879
  };
857
- var removeClaudeMcpServers = (config) => {
880
+ var removeMcpServersNamedPushary = (config, isOurs) => {
858
881
  let changed = false;
859
882
  const removeFrom = (target) => {
860
883
  const mcpServers = asRecord3(target.mcpServers);
861
- if (!mcpServers?.pushary) return;
884
+ if (!mcpServers?.pushary || !isOurs(mcpServers.pushary)) return;
862
885
  delete mcpServers.pushary;
863
886
  if (Object.keys(mcpServers).length === 0) delete target.mcpServers;
864
887
  changed = true;
@@ -873,6 +896,29 @@ var removeClaudeMcpServers = (config) => {
873
896
  }
874
897
  return changed;
875
898
  };
899
+ var removeClaudeMcpServers = (config) => removeMcpServersNamedPushary(config, () => true);
900
+ var claudeMcpRemovalChanged = (outcome) => outcome === "removed" || outcome === "restored";
901
+ var theirOwnEntryBeforeSetup = (receipt) => receipt.hadPushary && !isPusharyMcpServer(receipt.pushary) ? receipt.pushary : void 0;
902
+ var putTheirOwnEntryBack = (config, theirs) => {
903
+ ensureRecord2(config, "mcpServers").pushary = structuredClone(theirs);
904
+ };
905
+ var isOursBesides = (theirs) => (entry2) => theirs === void 0 || isPusharyMcpServer(entry2) && !isDeepStrictEqual(entry2, theirs);
906
+ var removeEveryEntryOfOurs = (config, receipt) => {
907
+ const restored = restoreClaudeMcpServer(config, receipt);
908
+ const theirs = theirOwnEntryBeforeSetup(receipt);
909
+ const isOurs = isOursBesides(theirs);
910
+ const rootEntry = asRecord3(config.mcpServers)?.pushary;
911
+ const ourEntryTookTheirPlace = theirs !== void 0 && rootEntry !== void 0 && isOurs(rootEntry);
912
+ const removed = removeMcpServersNamedPushary(config, isOurs);
913
+ if (ourEntryTookTheirPlace) putTheirOwnEntryBack(config, theirs);
914
+ if (theirs !== void 0 && (restored || ourEntryTookTheirPlace)) return "restored";
915
+ return removed || restored ? "removed" : "none";
916
+ };
917
+ var claudeMcpRemoval = (receipt, everything) => (config) => {
918
+ if (receipt === null) return removeClaudeMcpServers(config) ? "removed" : "none";
919
+ if (everything) return removeEveryEntryOfOurs(config, receipt);
920
+ return restoreClaudeMcpServer(config, receipt) ? "restored" : "kept_changed_after_setup";
921
+ };
876
922
  var removePusharyToolPermissions = (settings) => {
877
923
  const permissions = asRecord3(settings.permissions);
878
924
  if (!permissions || !Array.isArray(permissions.allow)) return false;
@@ -1072,26 +1118,6 @@ var hasInstructionBlock = (filePath) => {
1072
1118
  }
1073
1119
  };
1074
1120
 
1075
- // src/pushary-mcp-url.ts
1076
- var PUSHARY_MCP_HOSTS = new Set(PUSHARY_HOSTS);
1077
- var PUSHARY_MCP_PATH_PREFIX = "/api/mcp";
1078
- var isPusharyMcpPath = (pathname) => pathname === PUSHARY_MCP_PATH_PREFIX || pathname.startsWith(`${PUSHARY_MCP_PATH_PREFIX}/`);
1079
- var PUSHARY_FULL_ACCESS_MCP_PATHS = /* @__PURE__ */ new Set(["/api/mcp/mcp", "/api/mcp/sse"]);
1080
- var pusharyMcpPathOf = (value) => {
1081
- if (typeof value !== "string") return void 0;
1082
- try {
1083
- const url = new URL(value);
1084
- return PUSHARY_MCP_HOSTS.has(url.hostname) && isPusharyMcpPath(url.pathname) ? url.pathname : void 0;
1085
- } catch {
1086
- return void 0;
1087
- }
1088
- };
1089
- var isPusharyMcpUrl = (value) => pusharyMcpPathOf(value) !== void 0;
1090
- var isPusharyFullAccessMcpUrl = (value) => {
1091
- const path = pusharyMcpPathOf(value);
1092
- return path !== void 0 && PUSHARY_FULL_ACCESS_MCP_PATHS.has(path.replace(/\/$/, ""));
1093
- };
1094
-
1095
1121
  // src/cline-config.ts
1096
1122
  var CLINE_LABEL = "Cline";
1097
1123
  var CLINE_SERVER_NAME = "pushary";
@@ -1393,6 +1419,7 @@ export {
1393
1419
  supportedClaudeEvents,
1394
1420
  registrationSignatures,
1395
1421
  needsReregistration,
1422
+ isPusharyFullAccessMcpUrl,
1396
1423
  PUSHARY_MCP_URL,
1397
1424
  CLAUDE_CODE_PUSHARY_PERMISSION_RULES,
1398
1425
  allowsPusharyTools,
@@ -1403,6 +1430,8 @@ export {
1403
1430
  updateClaudeMcpSnapshot,
1404
1431
  restoreClaudeMcpServer,
1405
1432
  removeClaudeMcpServers,
1433
+ claudeMcpRemovalChanged,
1434
+ claudeMcpRemoval,
1406
1435
  removePusharyToolPermissions,
1407
1436
  addPusharyToolPermissions,
1408
1437
  addPusharyHooks,
@@ -1415,7 +1444,6 @@ export {
1415
1444
  refreshInstructionBlock,
1416
1445
  removeInstructionBlock,
1417
1446
  hasInstructionBlock,
1418
- isPusharyFullAccessMcpUrl,
1419
1447
  CLINE_LABEL,
1420
1448
  CLINE_AUTO_APPROVE_STEP,
1421
1449
  CLINE_RELOAD_STEP,
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  callDecisionStore,
3
3
  identifyingToolInput
4
- } from "./chunk-O5OPPV2S.js";
4
+ } from "./chunk-2R2LXG6H.js";
5
5
  import {
6
6
  canonicalJson
7
- } from "./chunk-Y7I5JUKB.js";
7
+ } from "./chunk-NQ6KV722.js";
8
8
  import {
9
9
  BYPASS_PERMISSION_MODE
10
- } from "./chunk-6LNSHFHD.js";
10
+ } from "./chunk-BDMNQBP4.js";
11
11
 
12
12
  // src/phone-approval.ts
13
13
  import { createHash } from "crypto";
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  RETRY_ACK,
6
6
  refusedReceiptMessage
7
- } from "./chunk-ABEAPF3L.js";
7
+ } from "./chunk-X37REV7T.js";
8
8
 
9
9
  // src/command-receipts.ts
10
10
  import { randomUUID } from "crypto";
@@ -9,17 +9,21 @@ import {
9
9
  installedCodexApp,
10
10
  readCodexAppRuntime,
11
11
  shellQuoted
12
- } from "./chunk-3WVNDX5O.js";
12
+ } from "./chunk-KFRYGJS5.js";
13
13
  import {
14
14
  CODEX_APP_LAUNCH_AT_LOGIN_VERB,
15
- CODEX_APP_LAUNCH_VARIABLE
15
+ CODEX_APP_LAUNCH_VARIABLE,
16
+ codexEngineInside
16
17
  } from "./chunk-U4P4NDVB.js";
17
18
  import {
18
19
  writeHuman
19
20
  } from "./chunk-QCGNGEGE.js";
20
21
  import {
21
22
  xml
22
- } from "./chunk-FFFNHVN6.js";
23
+ } from "./chunk-WILH4LFK.js";
24
+ import {
25
+ codexHomeFrom
26
+ } from "./chunk-NQ6KV722.js";
23
27
  import {
24
28
  writeFileAtomic
25
29
  } from "./chunk-PM2NRK6Y.js";
@@ -328,11 +332,11 @@ var setCodexAppLaunchAtLogin = (paths, machine) => {
328
332
  machine.setLaunchVariable(paths.launcherPath);
329
333
  return "set";
330
334
  };
335
+ var engineTheLauncherRuns = (paths, launcher, machine) => codexAppCardsReceiptFrom(machine.readFile(paths.receiptPath))?.engine ?? codexEngineBehindLauncher(launcher);
331
336
  var leaveOnlyThePathToTheEngine = (paths, machine) => {
332
- const receipt = codexAppCardsReceiptFrom(machine.readFile(paths.receiptPath));
333
337
  const launcher = machine.readFile(paths.launcherPath);
334
338
  if (launcher === null) return;
335
- const engine = receipt?.engine ?? codexEngineBehindLauncher(launcher);
339
+ const engine = engineTheLauncherRuns(paths, launcher, machine);
336
340
  if (engine === null) return;
337
341
  const onlyThePathToTheEngine = codexPassThroughScript(engine);
338
342
  if (launcher !== onlyThePathToTheEngine) machine.writeFile(paths.launcherPath, onlyThePathToTheEngine, PRIVATE_PROGRAM_MODE);
@@ -378,11 +382,41 @@ var codexAppCardsReport = (paths, machine) => {
378
382
  };
379
383
  var isKeptOnForTheMacApp = (request, paths, machine) => request.keepWhatTheMacAppTurnedOn && turnedOnByTheMacApp(codexAppCardsReceiptFrom(machine.readFile(paths.receiptPath))) && codexAppCardsStatus(paths, machine).kind !== "off";
380
384
  var isKeptOffForTheMacApp = (request, paths, machine) => request.keepWhatTheMacAppTurnedOn && machine.exists(paths.turnedOffPath);
385
+ var CODEX_CONFIG_FILE = "config.toml";
386
+ var CODEX_LAUNCH_SETTING = new RegExp(`^(\\s*${CODEX_APP_LAUNCH_VARIABLE}\\s*=\\s*)(["'])(.*)\\2(\\s*(?:#.*)?\\r?)$`);
387
+ var codexConfigLaunchingTheEngine = (config, launcher, engine) => {
388
+ const lines = config.split("\n");
389
+ const repointed = lines.map((line) => {
390
+ const setting = CODEX_LAUNCH_SETTING.exec(line);
391
+ return setting !== null && setting[3] === launcher ? `${setting[1]}${JSON.stringify(engine)}${setting[4]}` : line;
392
+ });
393
+ return repointed.some((line, index) => line !== lines[index]) ? repointed.join("\n") : null;
394
+ };
395
+ var enginesToLaunchInstead = (paths, machine) => {
396
+ const launcher = machine.readFile(paths.launcherPath);
397
+ const app = machine.codexApp();
398
+ return [
399
+ codexAppCardsReceiptFrom(machine.readFile(paths.receiptPath))?.engine ?? null,
400
+ launcher === null ? null : codexEngineBehindLauncher(launcher),
401
+ app === null ? null : codexEngineInside(app)
402
+ ];
403
+ };
404
+ var engineToLaunchInstead = (paths, machine) => enginesToLaunchInstead(paths, machine).find((engine) => engine !== null && machine.exists(engine)) ?? null;
405
+ var pointCodexBackAtItsEngine = (request, paths, machine) => {
406
+ const engine = engineToLaunchInstead(paths, machine);
407
+ if (engine === null) return;
408
+ const codexConfig = join2(codexHomeFrom(request.homeDir), CODEX_CONFIG_FILE);
409
+ const config = machine.readFile(codexConfig);
410
+ if (config === null) return;
411
+ const repointed = codexConfigLaunchingTheEngine(config, paths.launcherPath, engine);
412
+ if (repointed !== null) machine.writeFile(codexConfig, repointed, PRIVATE_FILE_MODE);
413
+ };
381
414
  var nothingIsTurnedOn = (paths, machine) => !machine.exists(paths.launcherPath) && !machine.exists(paths.loginItemPath) && machine.launchVariable() !== paths.launcherPath;
382
415
  var removeCodexAppCards = (request, machine) => {
383
416
  const paths = codexAppCardsPaths(request.homeDir, request.uid);
384
417
  const keepsTheOff = isKeptOffForTheMacApp(request, paths, machine);
385
418
  if (nothingIsTurnedOn(paths, machine)) {
419
+ if (!request.dryRun) pointCodexBackAtItsEngine(request, paths, machine);
386
420
  if (!request.dryRun && !keepsTheOff && machine.exists(paths.launcherDirectory)) machine.remove(paths.launcherDirectory);
387
421
  return "absent";
388
422
  }
@@ -390,6 +424,7 @@ var removeCodexAppCards = (request, machine) => {
390
424
  if (machine.launchVariable() === null) throw new Error(LAUNCH_SETTING_NOT_READ);
391
425
  if (request.dryRun) return "removed";
392
426
  turnCodexAppCardsOff(paths, machine);
427
+ pointCodexBackAtItsEngine(request, paths, machine);
393
428
  machine.remove(paths.launcherDirectory);
394
429
  if (keepsTheOff) rememberCodexAppCardsWereTurnedOff(paths, machine);
395
430
  return "removed";
@@ -567,6 +602,7 @@ export {
567
602
  turnCodexAppCardsOff,
568
603
  rememberCodexAppCardsWereTurnedOff,
569
604
  codexAppCardsReport,
605
+ codexConfigLaunchingTheEngine,
570
606
  removeCodexAppCards,
571
607
  cleanUpCodexAppCards,
572
608
  codexAppCardsFolderInTheLastSweep,
@@ -1,22 +1,22 @@
1
1
  import {
2
2
  cursorGateOwnsClaudeCall,
3
3
  readCursorGateRegistration
4
- } from "./chunk-D5PK3FCS.js";
4
+ } from "./chunk-KT7COQH2.js";
5
5
  import {
6
6
  registerTranscript
7
- } from "./chunk-LHKIMBJO.js";
7
+ } from "./chunk-IR6ZNTDK.js";
8
8
  import {
9
9
  namedEvent
10
- } from "./chunk-23J7UISJ.js";
10
+ } from "./chunk-GFGSIDHQ.js";
11
11
  import {
12
12
  writeDegraded
13
- } from "./chunk-F5F7S2JJ.js";
13
+ } from "./chunk-XJR2JCWQ.js";
14
14
  import {
15
15
  claudeShapedHookInput,
16
16
  hookCompatibleProfileBySource,
17
17
  isGrokHookPayload,
18
18
  isGrokSessionEndStop
19
- } from "./chunk-6LNSHFHD.js";
19
+ } from "./chunk-BDMNQBP4.js";
20
20
 
21
21
  // src/tool-hook-input.ts
22
22
  var OPTIONAL_TEXT_FIELDS = ["hook_event_name", "session_id", "cwd", "transcript_path", "tool_use_id", "permission_mode", "cursor_version"];
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-6ICPEJY5.js";
7
7
  import {
8
8
  isRecord
9
- } from "./chunk-6LNSHFHD.js";
9
+ } from "./chunk-BDMNQBP4.js";
10
10
 
11
11
  // src/setup/agent-probe.ts
12
12
  import { execSync } from "child_process";
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  autoUpdateLock
3
- } from "./chunk-Y7I5JUKB.js";
3
+ } from "./chunk-NQ6KV722.js";
4
4
  import {
5
5
  installPackageGlobally,
6
6
  npmErrorMessage,
7
7
  throwIfNpmRefusesInstall
8
- } from "./chunk-2BZECJVP.js";
8
+ } from "./chunk-K63QVFSB.js";
9
9
  import {
10
10
  writeJsonAtomic
11
11
  } from "./chunk-PM2NRK6Y.js";
@@ -242,6 +242,14 @@ var claimUpgradeLock = async (request = {}) => {
242
242
  return { kind: "unavailable", reason: npmErrorMessage(error) };
243
243
  }
244
244
  };
245
+ var leftAnUnfinishedInstallHere = (lockPath) => {
246
+ try {
247
+ const record = readLockRecord(canonicalLockPath(lockPath));
248
+ return record.installationPending && record.pid === process.pid;
249
+ } catch {
250
+ return false;
251
+ }
252
+ };
245
253
  var ownsUpgradeLock = (lockPath) => {
246
254
  try {
247
255
  return heldLocks.has(canonicalLockPath(lockPath));
@@ -299,7 +307,9 @@ var installWithUpgradeLock = (request, lockPath = autoUpdateLock(), runNpm) => {
299
307
 
300
308
  export {
301
309
  PENDING_INSTALL_STALE_AFTER_MS,
310
+ canonicalLockPath,
302
311
  claimUpgradeLock,
312
+ leftAnUnfinishedInstallHere,
303
313
  ownsUpgradeLock,
304
314
  releaseAutoUpdateLock,
305
315
  forkFinishWithUpgradeLock,
@@ -1,33 +1,33 @@
1
1
  import {
2
2
  MANAGED_CLAUDE_SETTINGS_BY_PLATFORM
3
- } from "./chunk-YTGHV5F3.js";
3
+ } from "./chunk-NFYD5TJK.js";
4
4
  import {
5
5
  declinedAgentsFile,
6
6
  readDeclinedAgents
7
- } from "./chunk-BXY5XZEI.js";
7
+ } from "./chunk-FJBU6OWM.js";
8
8
  import {
9
9
  OPENCODE_HOOK_BINARY,
10
10
  openCodeConfigDir,
11
11
  openCodePluginFile
12
- } from "./chunk-FGDWDPRQ.js";
12
+ } from "./chunk-UE5QZNZO.js";
13
13
  import {
14
14
  openCodePluginArgv
15
- } from "./chunk-46IJNC36.js";
15
+ } from "./chunk-33IFGELL.js";
16
16
  import {
17
17
  liveCursorGateCoverage
18
- } from "./chunk-D5PK3FCS.js";
18
+ } from "./chunk-KT7COQH2.js";
19
19
  import {
20
20
  compatibleConfigFile,
21
21
  compatibleHookEvents,
22
22
  grokHome,
23
23
  parseConfigDocument
24
- } from "./chunk-23J7UISJ.js";
24
+ } from "./chunk-GFGSIDHQ.js";
25
25
  import {
26
26
  DEFAULT_HOOKS_KEY_PATH,
27
27
  GEMINI_HOOK_BINARY,
28
28
  GEMINI_HOOK_EVENTS,
29
29
  hooksAt
30
- } from "./chunk-4JT2BY7S.js";
30
+ } from "./chunk-WYIJA2GH.js";
31
31
  import {
32
32
  CODEX_EARLIER_APPROVAL_MATCHERS,
33
33
  CODEX_HOOK_BINARY,
@@ -55,7 +55,7 @@ import {
55
55
  parseHookArgv,
56
56
  parseHookCommand,
57
57
  supportedClaudeEvents
58
- } from "./chunk-Y7I5JUKB.js";
58
+ } from "./chunk-NQ6KV722.js";
59
59
  import {
60
60
  readRegularJsonFile,
61
61
  readRegularTextFile
@@ -69,7 +69,7 @@ import {
69
69
  OPENCODE_APPROVAL_EVENT,
70
70
  isRecord,
71
71
  matcherMatchesEveryCall
72
- } from "./chunk-6LNSHFHD.js";
72
+ } from "./chunk-BDMNQBP4.js";
73
73
 
74
74
  // src/hook-wiring.ts
75
75
  import { createHash } from "crypto";
@@ -18,18 +18,18 @@ import {
18
18
  settingSnapshot,
19
19
  writeHermesSetting,
20
20
  writeSetupReceipt
21
- } from "./chunk-A7OIGKCQ.js";
21
+ } from "./chunk-NLAT5MMY.js";
22
22
  import {
23
23
  OPENCLAW_MIN_VERSION,
24
24
  OPENCLAW_PLUGIN_ID,
25
25
  OPENCLAW_PLUGIN_PACKAGE
26
- } from "./chunk-JJTKHAVD.js";
26
+ } from "./chunk-MGKF5FLQ.js";
27
27
  import {
28
28
  retryAgentCommand
29
- } from "./chunk-B236OY5Z.js";
29
+ } from "./chunk-TTUKVQTQ.js";
30
30
  import {
31
31
  configFilePath
32
- } from "./chunk-RJKX4FJJ.js";
32
+ } from "./chunk-IA44JTLJ.js";
33
33
  import {
34
34
  readJsonSafe,
35
35
  writeJsonAtomic
@@ -37,7 +37,7 @@ import {
37
37
  import {
38
38
  readSetupOutcomeProperties,
39
39
  redactSecretsFromContent
40
- } from "./chunk-6LNSHFHD.js";
40
+ } from "./chunk-BDMNQBP4.js";
41
41
 
42
42
  // src/hermes/shell-gate.ts
43
43
  var readHermesShellGate = async (launcher) => {
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-3EGEA4KH.js";
10
10
  import {
11
11
  getBaseUrl
12
- } from "./chunk-RJKX4FJJ.js";
12
+ } from "./chunk-IA44JTLJ.js";
13
13
  import {
14
14
  CLI_LOCAL_BIND_PATH,
15
15
  LOCAL_CONFIRM_HOST,
@@ -20,7 +20,7 @@ import {
20
20
  isLocalConfirmToken,
21
21
  isPhonePass,
22
22
  localTerminalEntryUrl
23
- } from "./chunk-6LNSHFHD.js";
23
+ } from "./chunk-BDMNQBP4.js";
24
24
 
25
25
  // src/cli/login-ui.ts
26
26
  import { hostname } from "os";
@@ -5,7 +5,7 @@ import {
5
5
  ensureCodexTrustsPusharyHooks,
6
6
  hermesHistoryNeedsTheCliHelper,
7
7
  recordInstalledHermesHistoryHelper
8
- } from "./chunk-JS3LOMRQ.js";
8
+ } from "./chunk-ZGA2LFVD.js";
9
9
  import {
10
10
  hermesReceiptPaths,
11
11
  hermesSetupPredatesThePluginFolder,
@@ -14,7 +14,7 @@ import {
14
14
  refreshHermesPluginFiles,
15
15
  refreshOpenClawPlugin,
16
16
  shippedHermesPlugin
17
- } from "./chunk-A7OIGKCQ.js";
17
+ } from "./chunk-NLAT5MMY.js";
18
18
  import {
19
19
  fxIgnoresInstructionsFile,
20
20
  fxInstructionsBody,
@@ -23,7 +23,7 @@ import {
23
23
  macAppFxBridge,
24
24
  refreshClineKey,
25
25
  switchFxHttpEntryToBridge
26
- } from "./chunk-NFCYFGGB.js";
26
+ } from "./chunk-ZQYYPDFT.js";
27
27
  import {
28
28
  OPENCODE_HOOK_BINARY,
29
29
  agentHookOwner,
@@ -36,16 +36,16 @@ import {
36
36
  openCodePluginDir,
37
37
  openCodeWired,
38
38
  withOpenCodeAskRules
39
- } from "./chunk-FGDWDPRQ.js";
39
+ } from "./chunk-UE5QZNZO.js";
40
40
  import {
41
41
  detectClaudeVersion
42
- } from "./chunk-URI4M2Y7.js";
42
+ } from "./chunk-QLKUYP7Z.js";
43
43
  import {
44
44
  addCompatibleHooks,
45
45
  compatibleConfigFile,
46
46
  compatibleInstructionsFile,
47
47
  hasCompatibleHooks
48
- } from "./chunk-23J7UISJ.js";
48
+ } from "./chunk-GFGSIDHQ.js";
49
49
  import {
50
50
  GEMINI_HOOK_BINARY,
51
51
  addGeminiHooks,
@@ -57,13 +57,13 @@ import {
57
57
  geminiWired,
58
58
  hasGeminiHooks,
59
59
  planHooks
60
- } from "./chunk-4JT2BY7S.js";
60
+ } from "./chunk-WYIJA2GH.js";
61
61
  import {
62
62
  transcriptsEnabled
63
- } from "./chunk-AABRXBIY.js";
63
+ } from "./chunk-4QTDUXS5.js";
64
64
  import {
65
65
  KEY_FILE_MODE
66
- } from "./chunk-GVGLZBOG.js";
66
+ } from "./chunk-KIYUQ2XZ.js";
67
67
  import {
68
68
  CLAUDE_CODE_PUSHARY_PERMISSION_RULES,
69
69
  CLAUDE_HOOK_BINARY,
@@ -110,7 +110,7 @@ import {
110
110
  renderAgentInstructions,
111
111
  supportedClaudeEvents,
112
112
  vscodePluginMcp
113
- } from "./chunk-Y7I5JUKB.js";
113
+ } from "./chunk-NQ6KV722.js";
114
114
  import {
115
115
  formatVersion
116
116
  } from "./chunk-6ICPEJY5.js";
@@ -118,7 +118,7 @@ import {
118
118
  hookCommandsUseBareNames,
119
119
  resolveGlobalBinDir,
120
120
  resolveGlobalBinary
121
- } from "./chunk-2BZECJVP.js";
121
+ } from "./chunk-K63QVFSB.js";
122
122
  import {
123
123
  readJsonSafe,
124
124
  writeFileAtomic,
@@ -128,7 +128,7 @@ import {
128
128
  HOOK_COMPATIBLE_PROFILES,
129
129
  isCompatibleAgentType,
130
130
  isRecord
131
- } from "./chunk-6LNSHFHD.js";
131
+ } from "./chunk-BDMNQBP4.js";
132
132
 
133
133
  // src/reapply.ts
134
134
  import { dirname, join } from "path";
@@ -4,16 +4,16 @@ import {
4
4
  } from "./chunk-WHB622LP.js";
5
5
  import {
6
6
  keyPrefix
7
- } from "./chunk-GVGLZBOG.js";
7
+ } from "./chunk-KIYUQ2XZ.js";
8
8
  import {
9
9
  keyPrefixToShow
10
- } from "./chunk-RJKX4FJJ.js";
10
+ } from "./chunk-IA44JTLJ.js";
11
11
  import {
12
12
  NPX_LATEST_COMMAND
13
- } from "./chunk-VX54TD6Y.js";
13
+ } from "./chunk-NC24UL7K.js";
14
14
  import {
15
15
  isValidApiKey
16
- } from "./chunk-6LNSHFHD.js";
16
+ } from "./chunk-BDMNQBP4.js";
17
17
 
18
18
  // src/setup/key-account.ts
19
19
  var isKeyHeldByMacApp = (key, holder) => holder.macAppInstalled && holder.macAppKey === key;
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-POFBE6ZY.js";
4
4
  import {
5
5
  autoUpdateState
6
- } from "./chunk-Y7I5JUKB.js";
6
+ } from "./chunk-NQ6KV722.js";
7
7
  import {
8
8
  readJsonSafe,
9
9
  writeJsonAtomic
@@ -17,7 +17,7 @@ import {
17
17
  } from "./chunk-CXQWDQCJ.js";
18
18
  import {
19
19
  isAutoUpdateResult
20
- } from "./chunk-6LNSHFHD.js";
20
+ } from "./chunk-BDMNQBP4.js";
21
21
 
22
22
  // src/auto-update.ts
23
23
  import { spawn } from "child_process";
@@ -5,13 +5,13 @@ import {
5
5
  } from "./chunk-OYIN77HO.js";
6
6
  import {
7
7
  readMacAppAgentKey
8
- } from "./chunk-KO3VP7KV.js";
8
+ } from "./chunk-AV5QS5FQ.js";
9
9
  import {
10
10
  API_KEYS_PATH
11
- } from "./chunk-WSNBD56T.js";
11
+ } from "./chunk-UXXYHW6B.js";
12
12
  import {
13
13
  absoluteUrl
14
- } from "./chunk-ZPXFKXHV.js";
14
+ } from "./chunk-WGZFBSXM.js";
15
15
  import {
16
16
  findExportedKeyLines,
17
17
  isAdoptedMacAppKey,
@@ -21,10 +21,10 @@ import {
21
21
  readConfigFileKey,
22
22
  readKeySource,
23
23
  readMacAppKeyPrefix
24
- } from "./chunk-GVGLZBOG.js";
24
+ } from "./chunk-KIYUQ2XZ.js";
25
25
  import {
26
26
  isValidApiKey
27
- } from "./chunk-6LNSHFHD.js";
27
+ } from "./chunk-BDMNQBP4.js";
28
28
 
29
29
  // src/cli/held-key-revocation.ts
30
30
  var readCliHeldKeys = (profiles) => {
@@ -1,18 +1,19 @@
1
1
  import {
2
+ NpmDiskFullError,
2
3
  NpmInstallError,
3
4
  NpmMissingError,
4
5
  NpmPermissionError,
5
6
  NpmReleaseAgeError
6
- } from "./chunk-2BZECJVP.js";
7
+ } from "./chunk-K63QVFSB.js";
7
8
  import {
8
9
  writeFileAtomic
9
10
  } from "./chunk-PM2NRK6Y.js";
10
11
  import {
11
12
  NPX_LATEST_COMMAND
12
- } from "./chunk-VX54TD6Y.js";
13
+ } from "./chunk-NC24UL7K.js";
13
14
  import {
14
15
  readSetupAgentFailures
15
- } from "./chunk-6LNSHFHD.js";
16
+ } from "./chunk-BDMNQBP4.js";
16
17
 
17
18
  // src/setup/config-write.ts
18
19
  var AgentConfigWriteError = class extends Error {
@@ -62,6 +63,7 @@ var NPM_PERMISSION_REMEDIES = {
62
63
  };
63
64
  var remedyForError = (error) => {
64
65
  if (error instanceof NpmReleaseAgeError) return "use-npm-policy";
66
+ if (error instanceof NpmDiskFullError) return "free-disk-space";
65
67
  if (error instanceof NpmMissingError) return "install-node";
66
68
  if (error instanceof NpmPermissionError) return NPM_PERMISSION_REMEDIES[error.kind];
67
69
  return "retry-agent";
@@ -74,6 +76,7 @@ var setupFailureDiagnostic = (error) => {
74
76
  if (error instanceof NpmPermissionError) {
75
77
  return { stage: "runtime-install", diagnosticCode: error.kind === "global-prefix" ? "npm-global-prefix-denied" : "npm-file-in-use" };
76
78
  }
79
+ if (error instanceof NpmDiskFullError) return { stage: "runtime-install", diagnosticCode: "npm-disk-full" };
77
80
  if (error instanceof NpmInstallError) return { stage: "runtime-install", diagnosticCode: "npm-install-failed" };
78
81
  return { stage: "unknown" };
79
82
  };