pushary 1.9.267 → 1.9.269

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 (145) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/{api-L2Z47RNK.js → api-ILQDGJL4.js} +12 -11
  3. package/dist/bin/pushary-audit.js +3 -3
  4. package/dist/bin/pushary-bell-hook.js +28 -29
  5. package/dist/bin/pushary-bell.js +11 -12
  6. package/dist/bin/pushary-calls.js +14 -15
  7. package/dist/bin/pushary-claude.js +25 -26
  8. package/dist/bin/pushary-clean.js +39 -40
  9. package/dist/bin/pushary-codex-bridge.js +22 -23
  10. package/dist/bin/pushary-codex-hook.js +34 -35
  11. package/dist/bin/pushary-codex-session.js +8 -8
  12. package/dist/bin/pushary-codex.js +16 -16
  13. package/dist/bin/pushary-connect.js +35 -36
  14. package/dist/bin/pushary-cowork.js +5 -5
  15. package/dist/bin/pushary-daemon.js +46 -47
  16. package/dist/bin/pushary-disconnect.js +30 -31
  17. package/dist/bin/pushary-display-hook.js +20 -0
  18. package/dist/bin/pushary-doctor.js +50 -51
  19. package/dist/bin/pushary-elicitation-hook.js +27 -28
  20. package/dist/bin/pushary-gemini-bridge.js +17 -18
  21. package/dist/bin/pushary-gemini-hook.js +31 -32
  22. package/dist/bin/pushary-hook.js +35 -36
  23. package/dist/bin/pushary-login.js +101 -25
  24. package/dist/bin/pushary-logout.js +31 -32
  25. package/dist/bin/pushary-mcp.js +12 -12
  26. package/dist/bin/pushary-mode.js +15 -16
  27. package/dist/bin/pushary-notification-hook.js +27 -28
  28. package/dist/bin/pushary-opencode-bridge.js +21 -22
  29. package/dist/bin/pushary-opencode-hook.js +32 -33
  30. package/dist/bin/pushary-permission-denied-hook.js +34 -35
  31. package/dist/bin/pushary-permission-hook.js +35 -36
  32. package/dist/bin/pushary-post-hook.js +28 -29
  33. package/dist/bin/pushary-prompt-hook.js +27 -28
  34. package/dist/bin/pushary-session-end-hook.js +27 -28
  35. package/dist/bin/pushary-session-start-hook.js +39 -40
  36. package/dist/bin/pushary-sessions.js +12 -12
  37. package/dist/bin/pushary-setup.js +101 -77
  38. package/dist/bin/pushary-stats.js +5 -5
  39. package/dist/bin/pushary-status.js +36 -37
  40. package/dist/bin/pushary-stop-hook.js +27 -28
  41. package/dist/bin/pushary-stopfailure-hook.js +27 -28
  42. package/dist/bin/pushary-suggestions.js +15 -16
  43. package/dist/bin/pushary-transcript-register.js +16 -17
  44. package/dist/bin/pushary-transcripts.js +25 -26
  45. package/dist/bin/pushary-upgrade.js +47 -48
  46. package/dist/bin/pushary-wait.js +16 -17
  47. package/dist/bin/pushary.js +7 -7
  48. package/dist/{chunk-XHKGTKM6.js → chunk-3D6EDVCE.js} +86 -79
  49. package/dist/{chunk-QW7LM6BG.js → chunk-3K2HA65U.js} +4 -4
  50. package/dist/{chunk-OOSDN4AF.js → chunk-3QOTNFNM.js} +3 -3
  51. package/dist/{chunk-NDOHMHU7.js → chunk-3YU4M3H6.js} +10 -10
  52. package/dist/{chunk-YFJ4ANFO.js → chunk-43EYM5PY.js} +6 -6
  53. package/dist/{chunk-WAVZTVYL.js → chunk-4JO5JG2P.js} +5 -5
  54. package/dist/{chunk-WH5M67RN.js → chunk-4NBFRTVM.js} +6 -6
  55. package/dist/{chunk-UX7YU7EM.js → chunk-4R2BZ7ZV.js} +1 -1
  56. package/dist/{chunk-XUN2NSYF.js → chunk-4VUQPSEP.js} +1 -1
  57. package/dist/{chunk-DW7YF5GB.js → chunk-5EQYWIQ2.js} +4 -4
  58. package/dist/{chunk-KPQ7QKS4.js → chunk-66EWTFIK.js} +1 -1
  59. package/dist/{chunk-V6673KO7.js → chunk-6LRUCUBE.js} +5 -5
  60. package/dist/{chunk-TXPDNOKT.js → chunk-7CBU5D6G.js} +1 -1
  61. package/dist/{chunk-S44D2HDB.js → chunk-7GFQHVKY.js} +16 -16
  62. package/dist/{chunk-2C7L3B3T.js → chunk-7O2OZQ6L.js} +4 -4
  63. package/dist/{chunk-UVRUK52J.js → chunk-AHYV7ZQE.js} +1 -1
  64. package/dist/{chunk-LOSHKUR2.js → chunk-ALWSX6SA.js} +3 -3
  65. package/dist/{chunk-7KAMTVC2.js → chunk-ARWKVVKB.js} +1 -1
  66. package/dist/{chunk-HWIXP7UY.js → chunk-AVST42GD.js} +1 -1
  67. package/dist/{chunk-4YOLB6H7.js → chunk-AY37CFHF.js} +26 -0
  68. package/dist/{chunk-WUKZEENF.js → chunk-CNNEMTRD.js} +4 -4
  69. package/dist/{chunk-BWPDGMKS.js → chunk-D57LIC6X.js} +23 -3
  70. package/dist/{chunk-WNMTWBV4.js → chunk-D6OF2TD3.js} +5 -5
  71. package/dist/{chunk-XPLUSOU5.js → chunk-DBYHLVQ2.js} +1 -1
  72. package/dist/{chunk-FV2YDUH5.js → chunk-DLMR45RP.js} +1 -1
  73. package/dist/{chunk-ZJLVASQZ.js → chunk-E274RVGY.js} +4 -4
  74. package/dist/{chunk-CSI5V5NO.js → chunk-EPQDQGVZ.js} +1 -1
  75. package/dist/{chunk-AXIIY75S.js → chunk-ESH2IFRQ.js} +3 -3
  76. package/dist/{chunk-EVX63B2G.js → chunk-ESMAFA2J.js} +5 -5
  77. package/dist/{chunk-KQ5S2ZUP.js → chunk-EY4XHT6G.js} +2 -2
  78. package/dist/{chunk-6QFYQYLV.js → chunk-FM73BOSO.js} +2 -2
  79. package/dist/{chunk-KK57NC2O.js → chunk-GCWAQMHF.js} +5 -5
  80. package/dist/{chunk-WX6YWZFM.js → chunk-GFX5AAWT.js} +7 -7
  81. package/dist/{chunk-LB474DMC.js → chunk-HV2DBLA2.js} +5 -5
  82. package/dist/{chunk-I2EZVCOY.js → chunk-J2PCHNZO.js} +5 -5
  83. package/dist/{chunk-7YCRU3HC.js → chunk-JGMEZV2Q.js} +3 -3
  84. package/dist/{chunk-3DY5G7JW.js → chunk-JYUIHUMK.js} +1 -1
  85. package/dist/{chunk-OEKXK3YR.js → chunk-KARQYZR3.js} +1 -1
  86. package/dist/{chunk-FSTX5SRV.js → chunk-KGZSVBUD.js} +3 -3
  87. package/dist/{chunk-FF7JYSH5.js → chunk-KYCPYOKD.js} +2 -2
  88. package/dist/{chunk-5K6MB557.js → chunk-L7GL5TJY.js} +2 -2
  89. package/dist/{chunk-JYKM47DL.js → chunk-LKKOKKUX.js} +2 -2
  90. package/dist/{chunk-573LGFOV.js → chunk-M3VS3PEK.js} +2 -2
  91. package/dist/{chunk-RB4QNUFM.js → chunk-MFQNYRKP.js} +4 -4
  92. package/dist/{chunk-YJ2T5AKE.js → chunk-MPXY3I3M.js} +6 -6
  93. package/dist/{chunk-A2YOC25E.js → chunk-NCHOWL5Y.js} +2 -2
  94. package/dist/{chunk-4TRRDGM5.js → chunk-O54TEHYJ.js} +25 -2
  95. package/dist/{chunk-MY3ZY6B2.js → chunk-P2OVSHIW.js} +3 -3
  96. package/dist/{chunk-J26QBILB.js → chunk-P3DV5JOE.js} +7 -7
  97. package/dist/{chunk-KBQBO3KA.js → chunk-PAKMLOFV.js} +3 -3
  98. package/dist/{chunk-TFI7UZ4N.js → chunk-PWP6NIWM.js} +2 -2
  99. package/dist/{chunk-MQO4F37H.js → chunk-Q7VXJ634.js} +4 -4
  100. package/dist/{chunk-275RFVSO.js → chunk-QFOMZSIU.js} +1 -1
  101. package/dist/{chunk-QTWLOFBV.js → chunk-QICIMORB.js} +2 -2
  102. package/dist/{chunk-4R7RMJIP.js → chunk-RBZCLXTE.js} +1 -1
  103. package/dist/{chunk-GF75PDAQ.js → chunk-RQCVHU7Q.js} +1 -1
  104. package/dist/{chunk-MGFCPJHQ.js → chunk-TDV2RONN.js} +15 -7
  105. package/dist/{chunk-JSPW2FFO.js → chunk-THDJL37Z.js} +1 -1
  106. package/dist/{chunk-KPH6GX74.js → chunk-TOHXHAFM.js} +8 -8
  107. package/dist/{chunk-SLWLFMMB.js → chunk-TZ32ZFFG.js} +65 -6
  108. package/dist/{chunk-KCQP7ZDP.js → chunk-U7WPURWA.js} +2 -2
  109. package/dist/{chunk-7SSL355C.js → chunk-ULOJDRKP.js} +2 -1
  110. package/dist/{chunk-HZG7IUDL.js → chunk-UT7O4WQ6.js} +4 -4
  111. package/dist/{chunk-TDDX5PAP.js → chunk-UVWYN2UR.js} +4 -4
  112. package/dist/{chunk-RQ5DKUF4.js → chunk-UXRP56HU.js} +1 -1
  113. package/dist/{chunk-OF7LT6JD.js → chunk-VIMAUIPP.js} +6 -6
  114. package/dist/{chunk-IV7POIBI.js → chunk-WAZZ2JJ3.js} +59 -13
  115. package/dist/{chunk-GXHOOPOY.js → chunk-WQVKU4BI.js} +3 -3
  116. package/dist/{chunk-EVT7LZ7E.js → chunk-WT2RG7RS.js} +1 -1
  117. package/dist/{chunk-BO5TJWAN.js → chunk-WUUVZEKA.js} +3 -3
  118. package/dist/{chunk-MDG6IDIJ.js → chunk-XIWZX5YY.js} +5 -5
  119. package/dist/{chunk-2IXNXTLA.js → chunk-XLJTD3PP.js} +6 -6
  120. package/dist/{chunk-SSQWDL6Q.js → chunk-XNYZBQCJ.js} +1 -1
  121. package/dist/{chunk-NBU7Y6JX.js → chunk-Y2DBHR2N.js} +1 -1
  122. package/dist/{chunk-PDANBIJA.js → chunk-Z26E6HSF.js} +5 -5
  123. package/dist/{chunk-OTCNXBIY.js → chunk-Z32D32PL.js} +4 -4
  124. package/dist/{chunk-IRS2FE32.js → chunk-Z4XTXCRP.js} +1 -1
  125. package/dist/{chunk-XF3R4ZPV.js → chunk-Z7ZBH7RU.js} +10 -10
  126. package/dist/{chunk-U6X2XWRP.js → chunk-ZG6QJH5C.js} +1 -1
  127. package/dist/{chunk-Y2CO2RMJ.js → chunk-ZNQ5YZ2L.js} +45 -13
  128. package/dist/{chunk-VSOUII7B.js → chunk-ZTQS2ZVJ.js} +1 -1
  129. package/dist/{chunk-LXH5JLD7.js → chunk-ZVSSHI6H.js} +5 -5
  130. package/dist/{codex-app-cards-switch-MZBLPDC5.js → codex-app-cards-switch-ROGUHXKQ.js} +11 -12
  131. package/dist/{codex-card-routing-QMXQ3RRX.js → codex-card-routing-CQX3C552.js} +2 -2
  132. package/dist/{codex-desktop-launch-7H4COE7H.js → codex-desktop-launch-U6XMY4AD.js} +3 -3
  133. package/dist/{codex-session-launch-ZSY7FTS3.js → codex-session-launch-FFF7HWWT.js} +21 -20
  134. package/dist/{config-PPMFPV2E.js → config-J6IB5GWC.js} +3 -3
  135. package/dist/{global-upgrade-RFXS76KH.js → global-upgrade-W6O44GGK.js} +9 -9
  136. package/dist/{identity-SLRS7XIR.js → identity-6W3NU4R3.js} +4 -4
  137. package/dist/{live-capabilities-4G46QNGE.js → live-capabilities-XGYRPZB3.js} +4 -4
  138. package/dist/{paths-55IJMRJW.js → paths-BK42XGTR.js} +3 -3
  139. package/dist/reapply-WEEWFQOE.js +81 -0
  140. package/dist/src/index.js +33 -34
  141. package/dist/{upgrade-lock-UGPXSPSU.js → upgrade-lock-AOHJCJIT.js} +4 -4
  142. package/dist/{usage-YC6BB7BX.js → usage-AG2GXZV6.js} +3 -3
  143. package/package.json +1 -1
  144. package/dist/chunk-B3FN4XL2.js +0 -44
  145. package/dist/reapply-HA6RLYRS.js +0 -76
@@ -8,41 +8,54 @@ import {
8
8
  SubscriptionRequiredError,
9
9
  callMcpTool,
10
10
  isRetryable
11
- } from "./chunk-LB474DMC.js";
11
+ } from "./chunk-HV2DBLA2.js";
12
12
  import {
13
13
  fetchAsCredential
14
- } from "./chunk-HWIXP7UY.js";
14
+ } from "./chunk-AVST42GD.js";
15
15
  import {
16
16
  installNetworkDefaults,
17
17
  isNetworkFailure
18
- } from "./chunk-OOSDN4AF.js";
18
+ } from "./chunk-3QOTNFNM.js";
19
+ import {
20
+ keyPrefix
21
+ } from "./chunk-ZNQ5YZ2L.js";
19
22
  import {
20
23
  clientReportClaims
21
- } from "./chunk-4TRRDGM5.js";
24
+ } from "./chunk-O54TEHYJ.js";
22
25
  import {
23
26
  getApiKey,
24
27
  getBaseUrl
25
- } from "./chunk-KCQP7ZDP.js";
28
+ } from "./chunk-U7WPURWA.js";
29
+ import {
30
+ getPackageVersion
31
+ } from "./chunk-CXQWDQCJ.js";
26
32
  import {
27
33
  ASK_AGENT_NAME_MAX,
28
34
  CANCEL_QUESTION_REASON_FIELD,
29
35
  CLIENT_REPORT_PATH,
30
36
  DECISION_LINE_MAX,
31
37
  GATE_PERMISSION_MODE_MAX_LENGTH,
38
+ KEY_REJECTED_PHASE,
32
39
  QUESTION_WITHDRAWAL_REASON,
40
+ SETUP_STOPPED_PATH,
41
+ TEST_TRAFFIC_ENV,
42
+ TEST_TRAFFIC_HEADER,
43
+ TEST_TRAFFIC_HEADER_VALUE,
33
44
  TOOL_FAILURE_CODES,
34
45
  WAIT_END_CLOSED,
35
46
  WAIT_END_OPEN,
36
47
  WAIT_END_PATH,
48
+ computerOsOfPlatform,
37
49
  degradedLine,
38
50
  isAskUserReply,
39
51
  isAwayPaused,
40
52
  isDecisionStoppedReply,
41
53
  isLocalQuestionHandoff,
42
54
  isRecord,
55
+ responseRejectsCredential,
43
56
  truncateLine,
44
57
  waitEndAnswered
45
- } from "./chunk-4YOLB6H7.js";
58
+ } from "./chunk-AY37CFHF.js";
46
59
 
47
60
  // src/api.ts
48
61
  import { randomUUID } from "crypto";
@@ -166,6 +179,30 @@ var claimReportWindow = (claimsDir, key, now) => {
166
179
  return "claimed";
167
180
  };
168
181
 
182
+ // src/test-traffic.ts
183
+ var TEST_TRAFFIC_ON_VALUES = /* @__PURE__ */ new Set(["1", "true"]);
184
+ var runsAsTestTraffic = (env) => TEST_TRAFFIC_ON_VALUES.has((env[TEST_TRAFFIC_ENV] ?? "").trim().toLowerCase());
185
+ var testTrafficHeaders = (env = process.env) => runsAsTestTraffic(env) ? { [TEST_TRAFFIC_HEADER]: TEST_TRAFFIC_HEADER_VALUE } : {};
186
+
187
+ // src/keyless-beacon.ts
188
+ var defaultKeylessBeaconDeps = () => ({ fetchImpl: fetch, baseUrl: getBaseUrl, env: process.env });
189
+ var postKeylessBeaconUntil = async (beacon, signal, deps = defaultKeylessBeaconDeps()) => {
190
+ const response = await deps.fetchImpl(`${deps.baseUrl()}${SETUP_STOPPED_PATH}`, {
191
+ method: "POST",
192
+ headers: { "content-type": "application/json", ...testTrafficHeaders(deps.env) },
193
+ body: JSON.stringify(beacon),
194
+ signal
195
+ });
196
+ await response.body?.cancel();
197
+ };
198
+ var postKeylessBeacon = (beacon, timeoutMs, deps = defaultKeylessBeaconDeps()) => postKeylessBeaconUntil(beacon, AbortSignal.timeout(timeoutMs), deps);
199
+
200
+ // src/telemetry-opt-out.ts
201
+ var TELEMETRY_OPT_OUT_VARIABLES = ["DO_NOT_TRACK", "PUSHARY_TELEMETRY_DISABLED"];
202
+ var OPT_IN_SPELLINGS = ["", "0", "false"];
203
+ var variableOptsOut = (value) => value !== void 0 && !OPT_IN_SPELLINGS.includes(value.trim().toLowerCase());
204
+ var telemetryOptedOut = (env) => TELEMETRY_OPT_OUT_VARIABLES.some((name) => variableOptsOut(env[name]));
205
+
169
206
  // src/client-report.ts
170
207
  var CLIENT_REPORT_TIMEOUT_MS = 1e3;
171
208
  var CLIENT_REPORT_MAX_ATTEMPTS = 2;
@@ -185,6 +222,14 @@ var defaultDeps = () => ({
185
222
  claimsDir: clientReportClaims()
186
223
  });
187
224
  var reportKey = (event) => `${event.kind}:${event.code}`;
225
+ var REJECTED_KEY_CLAIM = "key-rejected";
226
+ var keyRejectedBeaconOf = (apiKey, event, cliVersion, platform) => ({
227
+ phase: KEY_REJECTED_PHASE,
228
+ keyPrefix: keyPrefix(apiKey),
229
+ code: event.code,
230
+ cliVersion,
231
+ os: computerOsOfPlatform(platform)
232
+ });
188
233
  var createClientErrorReporter = (deps) => {
189
234
  const windowClaimedInProcess = /* @__PURE__ */ new Map();
190
235
  const claimInProcess = (key, now) => {
@@ -196,6 +241,16 @@ var createClientErrorReporter = (deps) => {
196
241
  const claim = claimReportWindow(deps.claimsDir, key, now);
197
242
  return claim === "unavailable" ? claimInProcess(key, now) : claim === "claimed";
198
243
  };
244
+ const claimRejectedKeyBeacon = (now) => claimReportWindow(deps.claimsDir, REJECTED_KEY_CLAIM, now) === "claimed";
245
+ const reportRejectedKeyOnce = async (apiKey, event, now, signal) => {
246
+ if (telemetryOptedOut(process.env) || signal.aborted || !claimRejectedKeyBeacon(now)) return;
247
+ try {
248
+ const beacon = keyRejectedBeaconOf(apiKey, event, getPackageVersion(), process.platform);
249
+ await postKeylessBeaconUntil(beacon, signal, { fetchImpl: deps.fetchImpl, baseUrl: deps.baseUrl, env: process.env });
250
+ } catch {
251
+ return;
252
+ }
253
+ };
199
254
  return async (event) => {
200
255
  try {
201
256
  if (deps.disabled()) return;
@@ -212,6 +267,7 @@ var createClientErrorReporter = (deps) => {
212
267
  signal
213
268
  }, deps.fetchImpl);
214
269
  await response.body?.cancel();
270
+ if (responseRejectsCredential(response.status, response.headers)) return await reportRejectedKeyOnce(apiKey, event, now, signal);
215
271
  if (response.ok || response.status < 500 && response.status !== 429) return;
216
272
  } catch {
217
273
  if (signal.aborted) return;
@@ -500,6 +556,9 @@ var claimBlockedAction = async (apiKey, request, timeoutMs) => {
500
556
  };
501
557
 
502
558
  export {
559
+ testTrafficHeaders,
560
+ postKeylessBeacon,
561
+ telemetryOptedOut,
503
562
  CLIENT_REPORT_TIMEOUT_MS,
504
563
  reportClientError,
505
564
  exitAfterClientReports,
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  NPX_LATEST_COMMAND
3
- } from "./chunk-7SSL355C.js";
3
+ } from "./chunk-ULOJDRKP.js";
4
4
  import {
5
5
  isValidApiKey
6
- } from "./chunk-4YOLB6H7.js";
6
+ } from "./chunk-AY37CFHF.js";
7
7
 
8
8
  // src/config.ts
9
9
  import { readFileSync } from "fs";
@@ -8,7 +8,7 @@ import {
8
8
  PUSHARY_CLI_LATEST_FOR_POWERSHELL,
9
9
  SETUP_AGENT_CHOICES,
10
10
  isApprovalMode
11
- } from "./chunk-4YOLB6H7.js";
11
+ } from "./chunk-AY37CFHF.js";
12
12
 
13
13
  // src/cli/mode-request.ts
14
14
  var parseDuration = (value) => {
@@ -263,6 +263,7 @@ var SETUP_OPTIONS = [
263
263
  ["--yes, -y", "Accept every default and ask nothing. Implies --agents auto unless --agents is given"],
264
264
  ["--connect app", "Only pair the native Pushary app with a QR. By default setup offers browser sign-in first, with the QR below it"],
265
265
  ["--connect none", "Skip pairing a phone, same as --skip-phone"],
266
+ ["--code <XXXX-XXXX>", "The code from your phone, also read from PUSHARY_SETUP_CODE. Browser sign-in then only accepts the account and workspace that phone uses"],
266
267
  ["--control auto|on|off", "Manage phone-start automatically (default), require it, or disable its background service"],
267
268
  ["--transcripts on|off", "Enable or disable encrypted transcript sync on this machine"],
268
269
  ["--skip-phone", "Skip pairing a phone"],
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  CODEX_HOOK_STATUS,
3
3
  HERMES_HISTORY_HELPER_COMMAND
4
- } from "./chunk-LOSHKUR2.js";
4
+ } from "./chunk-ALWSX6SA.js";
5
5
  import {
6
6
  HERMES_ALWAYS_ALLOWED_SHELL_RULE,
7
7
  HERMES_COMMAND_ALLOWLIST_KEY,
8
8
  HERMES_GATE_TOOLS_KEY,
9
9
  HERMES_SHELL_TOOL
10
- } from "./chunk-TDDX5PAP.js";
10
+ } from "./chunk-UVWYN2UR.js";
11
11
  import {
12
12
  retryAgentCommand
13
- } from "./chunk-FSTX5SRV.js";
13
+ } from "./chunk-KGZSVBUD.js";
14
14
  import {
15
15
  NPX_LATEST_COMMAND
16
- } from "./chunk-7SSL355C.js";
16
+ } from "./chunk-ULOJDRKP.js";
17
17
 
18
18
  // src/setup/codex-trust.ts
19
19
  var CODEX_TRUST_TELEMETRY = {
@@ -16,7 +16,7 @@ import {
16
16
  uninstallOpenClawPlugin,
17
17
  unsetOpenClawEntry,
18
18
  writeOpenClawEntry
19
- } from "./chunk-7YCRU3HC.js";
19
+ } from "./chunk-JGMEZV2Q.js";
20
20
  import {
21
21
  needsShell
22
22
  } from "./chunk-3PSNUHC5.js";
@@ -28,10 +28,10 @@ import {
28
28
  openClawDirectoriesToLookIn,
29
29
  openClawPluginFolder,
30
30
  openClawSetupReceiptDirectory
31
- } from "./chunk-4TRRDGM5.js";
31
+ } from "./chunk-O54TEHYJ.js";
32
32
  import {
33
33
  resolvePathBinary
34
- } from "./chunk-QW7LM6BG.js";
34
+ } from "./chunk-3K2HA65U.js";
35
35
  import {
36
36
  readJsonSafe,
37
37
  writeJsonAtomic
@@ -42,7 +42,7 @@ import {
42
42
  } from "./chunk-CXQWDQCJ.js";
43
43
  import {
44
44
  isRecord
45
- } from "./chunk-4YOLB6H7.js";
45
+ } from "./chunk-AY37CFHF.js";
46
46
 
47
47
  // src/hermes/plugin-payload.ts
48
48
  import { createHash } from "crypto";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  pusharyDir
3
- } from "./chunk-4TRRDGM5.js";
3
+ } from "./chunk-O54TEHYJ.js";
4
4
  import {
5
5
  writeFileAtomic
6
6
  } from "./chunk-PM2NRK6Y.js";
@@ -14,7 +14,7 @@ import {
14
14
  reachVerdict,
15
15
  reachesYou,
16
16
  verifyDelivery
17
- } from "./chunk-2IXNXTLA.js";
17
+ } from "./chunk-XLJTD3PP.js";
18
18
  import {
19
19
  describeRevokeAttempt,
20
20
  keyNoLongerAccepted,
@@ -29,20 +29,20 @@ import {
29
29
  isCI,
30
30
  terminalColumns,
31
31
  useColor
32
- } from "./chunk-SSQWDL6Q.js";
32
+ } from "./chunk-XNYZBQCJ.js";
33
33
  import {
34
34
  checkApiKey
35
- } from "./chunk-AXIIY75S.js";
35
+ } from "./chunk-ESH2IFRQ.js";
36
36
  import {
37
37
  reportedInstallSource
38
- } from "./chunk-B3FN4XL2.js";
38
+ } from "./chunk-ZNQ5YZ2L.js";
39
39
  import {
40
40
  NPX_LATEST_COMMAND
41
- } from "./chunk-7SSL355C.js";
41
+ } from "./chunk-ULOJDRKP.js";
42
42
  import {
43
43
  NO_PAIRING_COMPUTER,
44
44
  PAIR_TTL_SECONDS
45
- } from "./chunk-4YOLB6H7.js";
45
+ } from "./chunk-AY37CFHF.js";
46
46
 
47
47
  // src/onboarding.ts
48
48
  import qrcodeTerminal from "qrcode-terminal";
@@ -5,7 +5,7 @@ import {
5
5
  ensureCodexTrustsPusharyHooks,
6
6
  hermesHistoryNeedsTheCliHelper,
7
7
  recordInstalledHermesHistoryHelper
8
- } from "./chunk-LOSHKUR2.js";
8
+ } from "./chunk-ALWSX6SA.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-TDDX5PAP.js";
17
+ } from "./chunk-UVWYN2UR.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-I2EZVCOY.js";
26
+ } from "./chunk-J2PCHNZO.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-WX6YWZFM.js";
39
+ } from "./chunk-GFX5AAWT.js";
40
40
  import {
41
41
  detectClaudeVersion
42
- } from "./chunk-7KAMTVC2.js";
42
+ } from "./chunk-ARWKVVKB.js";
43
43
  import {
44
44
  addCompatibleHooks,
45
45
  compatibleConfigFile,
46
46
  compatibleInstructionsFile,
47
47
  hasCompatibleHooks
48
- } from "./chunk-YFJ4ANFO.js";
48
+ } from "./chunk-43EYM5PY.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-OTCNXBIY.js";
60
+ } from "./chunk-Z32D32PL.js";
61
61
  import {
62
62
  transcriptsEnabled
63
- } from "./chunk-KPQ7QKS4.js";
63
+ } from "./chunk-66EWTFIK.js";
64
64
  import {
65
65
  KEY_FILE_MODE
66
- } from "./chunk-Y2CO2RMJ.js";
66
+ } from "./chunk-ZNQ5YZ2L.js";
67
67
  import {
68
68
  CLAUDE_CODE_PUSHARY_PERMISSION_RULES,
69
69
  CLAUDE_HOOK_BINARY,
@@ -93,6 +93,8 @@ import {
93
93
  codexRegistrationHolder,
94
94
  codexVacatedIndexes,
95
95
  dropVacatedCodexHookTrust,
96
+ embeddedClaudeMcpKey,
97
+ embeddedCodexMcpKey,
96
98
  fxAgentsMd,
97
99
  fxConfigDir,
98
100
  fxMcpProfile,
@@ -108,9 +110,10 @@ import {
108
110
  registrationHolderOf,
109
111
  registrationSignatures,
110
112
  renderAgentInstructions,
113
+ replaceCodexMcpEmbeddedKey,
111
114
  supportedClaudeEvents,
112
115
  vscodePluginMcp
113
- } from "./chunk-4TRRDGM5.js";
116
+ } from "./chunk-O54TEHYJ.js";
114
117
  import {
115
118
  formatVersion
116
119
  } from "./chunk-6ICPEJY5.js";
@@ -118,7 +121,7 @@ import {
118
121
  hookCommandsUseBareNames,
119
122
  resolveGlobalBinDir,
120
123
  resolveGlobalBinary
121
- } from "./chunk-QW7LM6BG.js";
124
+ } from "./chunk-3K2HA65U.js";
122
125
  import {
123
126
  readJsonSafe,
124
127
  writeFileAtomic,
@@ -128,12 +131,12 @@ import {
128
131
  HOOK_COMPATIBLE_PROFILES,
129
132
  isCompatibleAgentType,
130
133
  isRecord
131
- } from "./chunk-4YOLB6H7.js";
134
+ } from "./chunk-AY37CFHF.js";
132
135
 
133
136
  // src/reapply.ts
134
137
  import { dirname, join } from "path";
135
138
  import { homedir } from "os";
136
- import { readFileSync, statSync } from "fs";
139
+ import { existsSync, readFileSync, statSync } from "fs";
137
140
  import { parse as parseTOML, stringify as stringifyTOML } from "smol-toml";
138
141
 
139
142
  // src/reregister.ts
@@ -340,6 +343,46 @@ var reapplyCodexSettings = (apiKey, paths = {}, nativeOwnership = "preserve") =>
340
343
  if (config === null) hooks = false;
341
344
  return { configured: true, reapplied: hooks || mcp, hooks, mcp, failed, ...mcp && startedCommand ? { codexRestartRequired: true } : {} };
342
345
  };
346
+ var embeddedKeyStepFor = (embedded, apiKey) => {
347
+ if (embedded.kind === "none") return "unchanged";
348
+ if (embedded.kind === "custom") return "left-alone";
349
+ return embedded.key === apiKey ? "unchanged" : "replace";
350
+ };
351
+ var refreshClaudeEmbeddedKey = (apiKey, claudeJsonPath = claudeJson()) => {
352
+ const read = readJsonSafe(claudeJsonPath);
353
+ if (read.kind === "missing") return "absent";
354
+ if (read.kind !== "ok" || !isRecord(read.value)) return "left-alone";
355
+ const config = read.value;
356
+ if (!hasPusharyMcp(config)) return "absent";
357
+ const step = embeddedKeyStepFor(embeddedClaudeMcpKey(config), apiKey);
358
+ if (step !== "replace") return step;
359
+ try {
360
+ addClaudeMcpServer(config, apiKey);
361
+ writeJsonAtomic(claudeJsonPath, config, KEY_FILE_MODE);
362
+ return "refreshed";
363
+ } catch {
364
+ return "failed";
365
+ }
366
+ };
367
+ var refreshCodexEmbeddedKey = (apiKey, configPath = codexConfigToml()) => {
368
+ if (!existsSync(configPath)) return "absent";
369
+ const config = readToml(configPath);
370
+ if (config === null) return "left-alone";
371
+ if (!isRecord(config.mcp_servers) || !isRecord(config.mcp_servers.pushary)) return "absent";
372
+ const step = embeddedKeyStepFor(embeddedCodexMcpKey(config), apiKey);
373
+ if (step !== "replace") return step;
374
+ try {
375
+ replaceCodexMcpEmbeddedKey(config, apiKey);
376
+ writeFileAtomic(configPath, stringifyTOML(config), modeToPreserve(configPath), "utf-8");
377
+ return "refreshed";
378
+ } catch {
379
+ return "failed";
380
+ }
381
+ };
382
+ var refreshEmbeddedAgentKeys = (apiKey, paths = {}) => ({
383
+ claude: refreshClaudeEmbeddedKey(apiKey, paths.claudeJsonPath),
384
+ codex: refreshCodexEmbeddedKey(apiKey, paths.codexConfigPath)
385
+ });
343
386
  var repairCodexHolds = (paths = {}) => {
344
387
  const idle = { configured: false, reapplied: false, hooks: false, mcp: false };
345
388
  try {
@@ -590,6 +633,9 @@ export {
590
633
  reapplyClaudeForVersion,
591
634
  inspectConfiguredManagedProviders,
592
635
  reapplyCodexSettings,
636
+ refreshClaudeEmbeddedKey,
637
+ refreshCodexEmbeddedKey,
638
+ refreshEmbeddedAgentKeys,
593
639
  repairCodexHolds,
594
640
  reapplyGeminiSettings,
595
641
  reapplyCursorPlugin,
@@ -4,10 +4,10 @@ import {
4
4
  } from "./chunk-P6DUWKAO.js";
5
5
  import {
6
6
  fetchAsCredential
7
- } from "./chunk-HWIXP7UY.js";
7
+ } from "./chunk-AVST42GD.js";
8
8
  import {
9
9
  getBaseUrl
10
- } from "./chunk-KCQP7ZDP.js";
10
+ } from "./chunk-U7WPURWA.js";
11
11
  import {
12
12
  writeJsonAtomicDurable
13
13
  } from "./chunk-PM2NRK6Y.js";
@@ -15,7 +15,7 @@ import {
15
15
  compressTranscriptRecord,
16
16
  redactSecretsFromContent,
17
17
  transcriptRecordPlaintext
18
- } from "./chunk-4YOLB6H7.js";
18
+ } from "./chunk-AY37CFHF.js";
19
19
 
20
20
  // src/transcript-recipient-pin.ts
21
21
  import { createHash } from "crypto";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  guardBinary
3
- } from "./chunk-4TRRDGM5.js";
3
+ } from "./chunk-O54TEHYJ.js";
4
4
 
5
5
  // src/bell/install.ts
6
6
  import { join } from "path";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  pusharyHookExecutable
3
- } from "./chunk-OTCNXBIY.js";
3
+ } from "./chunk-Z32D32PL.js";
4
4
  import {
5
5
  bridgeResolvesToApp,
6
6
  cursorUserHooks,
7
7
  executableFileName,
8
8
  isBridgeLocator,
9
9
  liveBridgeProbe
10
- } from "./chunk-4TRRDGM5.js";
10
+ } from "./chunk-O54TEHYJ.js";
11
11
  import {
12
12
  atLeast,
13
13
  parseVersion
@@ -21,7 +21,7 @@ import {
21
21
  isCursorHookPayload,
22
22
  isRecord,
23
23
  toolsCoveredByGateEntry
24
- } from "./chunk-4YOLB6H7.js";
24
+ } from "./chunk-AY37CFHF.js";
25
25
 
26
26
  // src/cursor-gate-registration.ts
27
27
  import { dirname, isAbsolute, join, resolve } from "path";
@@ -18,18 +18,18 @@ import {
18
18
  settingSnapshot,
19
19
  writeHermesSetting,
20
20
  writeSetupReceipt
21
- } from "./chunk-TDDX5PAP.js";
21
+ } from "./chunk-UVWYN2UR.js";
22
22
  import {
23
23
  OPENCLAW_MIN_VERSION,
24
24
  OPENCLAW_PLUGIN_ID,
25
25
  OPENCLAW_PLUGIN_PACKAGE
26
- } from "./chunk-7YCRU3HC.js";
26
+ } from "./chunk-JGMEZV2Q.js";
27
27
  import {
28
28
  retryAgentCommand
29
- } from "./chunk-FSTX5SRV.js";
29
+ } from "./chunk-KGZSVBUD.js";
30
30
  import {
31
31
  configFilePath
32
- } from "./chunk-KCQP7ZDP.js";
32
+ } from "./chunk-U7WPURWA.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-4YOLB6H7.js";
40
+ } from "./chunk-AY37CFHF.js";
41
41
 
42
42
  // src/hermes/shell-gate.ts
43
43
  var readHermesShellGate = async (launcher) => {
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  APPROVAL_RULES_PATH,
3
3
  canChangeApprovalSettings
4
- } from "./chunk-FF7JYSH5.js";
4
+ } from "./chunk-KYCPYOKD.js";
5
5
  import {
6
6
  callMcpTool
7
- } from "./chunk-LB474DMC.js";
7
+ } from "./chunk-HV2DBLA2.js";
8
8
  import {
9
9
  absoluteUrl
10
- } from "./chunk-AXIIY75S.js";
10
+ } from "./chunk-ESH2IFRQ.js";
11
11
  import {
12
12
  getBaseUrl
13
- } from "./chunk-KCQP7ZDP.js";
13
+ } from "./chunk-U7WPURWA.js";
14
14
  import {
15
15
  NPX_LATEST_COMMAND
16
- } from "./chunk-7SSL355C.js";
16
+ } from "./chunk-ULOJDRKP.js";
17
17
  import {
18
18
  AGENT_STOP_DEFAULT_SECONDS,
19
19
  APPROVAL_MODE_META,
@@ -21,7 +21,7 @@ import {
21
21
  classifyConfirmResponse,
22
22
  isAnswerSource,
23
23
  roundTripAsk
24
- } from "./chunk-4YOLB6H7.js";
24
+ } from "./chunk-AY37CFHF.js";
25
25
 
26
26
  // src/reach.ts
27
27
  var PUSHARY_APP_DOWNLOAD_URL = "https://pushary.com/download";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  redactSecretsFromContent
3
- } from "./chunk-4YOLB6H7.js";
3
+ } from "./chunk-AY37CFHF.js";
4
4
 
5
5
  // src/cli/terminal-row.ts
6
6
  var visibleLength = (text) => text.replace(/\x1b\[[0-9;]*m/g, "").length;
@@ -2,7 +2,7 @@ import {
2
2
  localRepoKey,
3
3
  normalizeRepoRemote,
4
4
  parseGitBranch
5
- } from "./chunk-4YOLB6H7.js";
5
+ } from "./chunk-AY37CFHF.js";
6
6
 
7
7
  // src/repo.ts
8
8
  import { existsSync, readFileSync, statSync } from "fs";
@@ -5,13 +5,13 @@ import {
5
5
  } from "./chunk-OYIN77HO.js";
6
6
  import {
7
7
  readMacAppAgentKey
8
- } from "./chunk-DW7YF5GB.js";
8
+ } from "./chunk-5EQYWIQ2.js";
9
9
  import {
10
10
  API_KEYS_PATH
11
- } from "./chunk-FF7JYSH5.js";
11
+ } from "./chunk-KYCPYOKD.js";
12
12
  import {
13
13
  absoluteUrl
14
- } from "./chunk-AXIIY75S.js";
14
+ } from "./chunk-ESH2IFRQ.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-Y2CO2RMJ.js";
24
+ } from "./chunk-ZNQ5YZ2L.js";
25
25
  import {
26
26
  isValidApiKey
27
- } from "./chunk-4YOLB6H7.js";
27
+ } from "./chunk-AY37CFHF.js";
28
28
 
29
29
  // src/cli/held-key-revocation.ts
30
30
  var readCliHeldKeys = (profiles) => {
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  AGENT_CHOICES
3
- } from "./chunk-BWPDGMKS.js";
3
+ } from "./chunk-D57LIC6X.js";
4
4
  import {
5
5
  BELL_HOOK_BINARY
6
- } from "./chunk-EVT7LZ7E.js";
6
+ } from "./chunk-WT2RG7RS.js";
7
7
  import {
8
8
  CLAUDE_HOOK_EVENTS,
9
9
  CODEX_HOOK_EVENTS,
@@ -16,13 +16,13 @@ import {
16
16
  isBridgeLocator,
17
17
  isProtectedByScope,
18
18
  registerHookEntry
19
- } from "./chunk-4TRRDGM5.js";
19
+ } from "./chunk-O54TEHYJ.js";
20
20
  import {
21
21
  CURSOR_GATE_EVENTS,
22
22
  HOOK_BUDGETS,
23
23
  HOOK_LOCATOR_BINARY,
24
24
  hookCommandHoldBudget
25
- } from "./chunk-4YOLB6H7.js";
25
+ } from "./chunk-AY37CFHF.js";
26
26
 
27
27
  // src/gemini-config.ts
28
28
  var GEMINI_HOOK_BINARY = "pushary-gemini-hook";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  shouldDeferToNativeMode
3
- } from "./chunk-4YOLB6H7.js";
3
+ } from "./chunk-AY37CFHF.js";
4
4
 
5
5
  // src/native-defer.ts
6
6
  var nativeDeferOptions = () => {