pushary 1.9.266 → 1.9.268

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 +12 -0
  2. package/dist/{api-6HVKVLYN.js → api-2PD4GLZO.js} +14 -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 +32 -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 +65 -73
  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-IHLT622L.js → chunk-26K5VC53.js} +1 -1
  49. package/dist/{chunk-CV63IDIE.js → chunk-2EHLFIVK.js} +4 -4
  50. package/dist/{chunk-2SWQRNPR.js → chunk-2FI62SKT.js} +1 -1
  51. package/dist/{chunk-OCQ6Y7NI.js → chunk-47NWTV5K.js} +45 -13
  52. package/dist/{chunk-RBM5PLKI.js → chunk-4LRWEHQT.js} +69 -6
  53. package/dist/{chunk-RCMMMQSJ.js → chunk-4ZSC56SL.js} +1 -1
  54. package/dist/{chunk-3JYLC2WN.js → chunk-5LE7C6Q2.js} +2 -2
  55. package/dist/{chunk-VDTJEVMG.js → chunk-5WSFZXR6.js} +2 -2
  56. package/dist/{chunk-CKKCIMJM.js → chunk-AOCTHK4E.js} +3 -3
  57. package/dist/{chunk-Y6X73WXC.js → chunk-AQP5SMAF.js} +2 -2
  58. package/dist/{chunk-4MUKWLYS.js → chunk-AQPA4YIB.js} +1 -1
  59. package/dist/{chunk-WMV4MDYA.js → chunk-AT3C3Z3M.js} +7 -7
  60. package/dist/{chunk-77QY3M7Z.js → chunk-AXVLRYIK.js} +1 -1
  61. package/dist/{chunk-Q3TS5VKY.js → chunk-BQ23UZJY.js} +5 -5
  62. package/dist/{chunk-WT2XF4CO.js → chunk-CIO6FAIU.js} +1 -1
  63. package/dist/{chunk-CMODL5RR.js → chunk-DC35GPRY.js} +8 -8
  64. package/dist/{chunk-SUEN6I24.js → chunk-DJYBACUW.js} +1 -1
  65. package/dist/{chunk-OYUCP6IN.js → chunk-DPOLLK6I.js} +3 -3
  66. package/dist/{chunk-ZJOVWZJ4.js → chunk-DVAXZOTR.js} +1 -1
  67. package/dist/{chunk-VDHRFPX2.js → chunk-EKU4KLON.js} +1 -1
  68. package/dist/{chunk-Z2UGEG75.js → chunk-ERE3R6SS.js} +4 -4
  69. package/dist/{chunk-NSMO7QPG.js → chunk-FF2LDPB2.js} +4 -4
  70. package/dist/{chunk-DIESQCCP.js → chunk-FFWESSEY.js} +4 -4
  71. package/dist/{chunk-OOFSQMMB.js → chunk-FHCXJ2HZ.js} +5 -5
  72. package/dist/{chunk-QIXZJA4Z.js → chunk-FK4BFIFR.js} +5 -5
  73. package/dist/{chunk-GLPZVUDH.js → chunk-GCDVD242.js} +6 -6
  74. package/dist/{chunk-WXWZ5LBE.js → chunk-GEBRKBLB.js} +5 -5
  75. package/dist/{chunk-T672PUVP.js → chunk-GMQ73QWC.js} +16 -16
  76. package/dist/{chunk-LEUXJOX6.js → chunk-GP5UGODT.js} +5 -5
  77. package/dist/{chunk-WOSJT4NA.js → chunk-GPEGT2EP.js} +1 -1
  78. package/dist/{chunk-WQDX276X.js → chunk-GYLIVREZ.js} +32 -0
  79. package/dist/{chunk-KW32GJSQ.js → chunk-HEAJBTIG.js} +1 -1
  80. package/dist/{chunk-UMQCCVEI.js → chunk-HPLG5D6Y.js} +5 -5
  81. package/dist/{chunk-VM3BJUKF.js → chunk-HSX5EVPH.js} +2 -2
  82. package/dist/{chunk-6Q77W6D7.js → chunk-IEQDAZDB.js} +2 -2
  83. package/dist/{chunk-SWHJRTCT.js → chunk-IQBJD5ZB.js} +4 -4
  84. package/dist/{chunk-RBIDBSHI.js → chunk-IR342JX3.js} +6 -6
  85. package/dist/{chunk-4SRBFGPG.js → chunk-JQCF2IYA.js} +1 -1
  86. package/dist/{chunk-GHPBR545.js → chunk-JSE7T4JL.js} +1 -1
  87. package/dist/{chunk-RIKMC6JA.js → chunk-JXWWWVGR.js} +10 -10
  88. package/dist/{chunk-MKHTIXOB.js → chunk-KQZQ55CO.js} +4 -4
  89. package/dist/{chunk-6V7WJK5B.js → chunk-KVCWPOF6.js} +8 -5
  90. package/dist/{chunk-TAP2MUPA.js → chunk-L6CWEU5C.js} +2 -2
  91. package/dist/{chunk-KRJHE353.js → chunk-LF5OEQNP.js} +2 -2
  92. package/dist/{chunk-G4PVFXAT.js → chunk-LYBX463S.js} +2 -2
  93. package/dist/{chunk-QX2WZ6NB.js → chunk-M2ETE6JQ.js} +1 -1
  94. package/dist/{chunk-3G4HNQA6.js → chunk-N6ARPVSQ.js} +90 -83
  95. package/dist/{chunk-ARJH7TUY.js → chunk-NA5EQTCV.js} +1 -1
  96. package/dist/{chunk-EUFKPNZF.js → chunk-NAVHNIM4.js} +1 -1
  97. package/dist/{chunk-RFZXAPIN.js → chunk-NOWWUX5V.js} +3 -3
  98. package/dist/{chunk-5UDPKOWF.js → chunk-NRTSHLZQ.js} +6 -6
  99. package/dist/{chunk-RTHHTOSN.js → chunk-NYP2NRV3.js} +1 -1
  100. package/dist/{chunk-DGE5W756.js → chunk-O2X6KT7P.js} +4 -4
  101. package/dist/{chunk-E2ODJUS6.js → chunk-P6AKOYLZ.js} +4 -4
  102. package/dist/{chunk-4DI66ZHF.js → chunk-QJHOS33W.js} +5 -5
  103. package/dist/{chunk-5LJHKXLN.js → chunk-S2DKGGEL.js} +5 -5
  104. package/dist/{chunk-BZ6E2ZJ3.js → chunk-S4AQUVX3.js} +3 -3
  105. package/dist/{chunk-5Z63DAD6.js → chunk-S55XHTYZ.js} +1 -1
  106. package/dist/{chunk-5A65MMYW.js → chunk-SYCNMJ3Z.js} +1 -1
  107. package/dist/{chunk-YIP2LG47.js → chunk-SYEUQH6Z.js} +3 -3
  108. package/dist/{chunk-FTWC3YL5.js → chunk-TEFLCQO4.js} +1 -1
  109. package/dist/{chunk-PDBABOA2.js → chunk-TKMOPFZS.js} +3 -3
  110. package/dist/{chunk-3WNCR4KH.js → chunk-TOELRIWR.js} +59 -13
  111. package/dist/{chunk-6IG4XWEM.js → chunk-TZO67S4V.js} +10 -10
  112. package/dist/{chunk-O6UNU4NB.js → chunk-U2OB44U5.js} +5 -5
  113. package/dist/{chunk-YVXQXWP4.js → chunk-UNF23P35.js} +1 -1
  114. package/dist/{chunk-SAS22USY.js → chunk-UQB4MAA6.js} +3 -3
  115. package/dist/{chunk-I4GD3T6R.js → chunk-UVO56TVL.js} +7 -7
  116. package/dist/{chunk-PKA7UXDK.js → chunk-V2UGSM45.js} +6 -6
  117. package/dist/{chunk-R5BKLVFA.js → chunk-WCEP3U7C.js} +1 -1
  118. package/dist/{chunk-IPBJJCEC.js → chunk-WHFXXV2A.js} +25 -2
  119. package/dist/{chunk-ZEPZMXJH.js → chunk-WYYZ2UFX.js} +2 -2
  120. package/dist/{chunk-AMV2AVTB.js → chunk-WZM7Y5HM.js} +1 -1
  121. package/dist/{chunk-QXSMS7IR.js → chunk-X5R55HMM.js} +6 -6
  122. package/dist/{chunk-VZKJU6TX.js → chunk-XIEYX4TJ.js} +1 -1
  123. package/dist/{chunk-HVEOTPRU.js → chunk-XPS36L6H.js} +3 -3
  124. package/dist/{chunk-6LDMEN7P.js → chunk-XUJBTEUC.js} +4 -4
  125. package/dist/{chunk-XWWBOTJX.js → chunk-YBAU5TAV.js} +2 -2
  126. package/dist/{chunk-ISVO2KSM.js → chunk-YGCU6KMO.js} +3 -3
  127. package/dist/{chunk-TXVWUYJC.js → chunk-YZRUE46K.js} +1 -1
  128. package/dist/{chunk-SVU7OCV4.js → chunk-Z5KP6GBC.js} +4 -4
  129. package/dist/{chunk-MJNRULIV.js → chunk-ZYQHIMZU.js} +5 -5
  130. package/dist/{codex-app-cards-switch-QTAMDVPU.js → codex-app-cards-switch-TSHQTVOY.js} +11 -12
  131. package/dist/{codex-card-routing-MDIJ7WTX.js → codex-card-routing-EZFQRLL5.js} +2 -2
  132. package/dist/{codex-desktop-launch-4AC7JUSA.js → codex-desktop-launch-RBW6N6HI.js} +3 -3
  133. package/dist/{codex-session-launch-4ZLEBUHB.js → codex-session-launch-TERIKZPR.js} +21 -20
  134. package/dist/{config-SDTBVASN.js → config-2AGEPXWU.js} +3 -3
  135. package/dist/{global-upgrade-EBANNXIB.js → global-upgrade-67DCWAOQ.js} +9 -9
  136. package/dist/{identity-AJ7EIESJ.js → identity-QETOMF2L.js} +4 -4
  137. package/dist/{live-capabilities-G662M2ZR.js → live-capabilities-5UIO6P52.js} +4 -4
  138. package/dist/{paths-G53BK3IS.js → paths-IRWDFERG.js} +3 -3
  139. package/dist/reapply-BBNONPII.js +81 -0
  140. package/dist/src/index.js +33 -34
  141. package/dist/{upgrade-lock-7ATRPVWH.js → upgrade-lock-LICESK4W.js} +4 -4
  142. package/dist/{usage-EYJ5KBHE.js → usage-CNCT5BGJ.js} +3 -3
  143. package/package.json +1 -1
  144. package/dist/chunk-CYK2K3SB.js +0 -44
  145. package/dist/reapply-6U2BGHTD.js +0 -76
@@ -1,11 +1,8 @@
1
- import {
2
- resolveInstallSourceFor
3
- } from "./chunk-CYK2K3SB.js";
4
1
  import {
5
2
  apiKeyInForce,
6
3
  configFilePath,
7
4
  keyPrefixToShow
8
- } from "./chunk-3JYLC2WN.js";
5
+ } from "./chunk-5LE7C6Q2.js";
9
6
  import {
10
7
  backupFile,
11
8
  backupFileInto,
@@ -16,12 +13,46 @@ import {
16
13
  import {
17
14
  API_KEY_PREFIX_PATTERN,
18
15
  isRecord,
19
- isValidApiKey
20
- } from "./chunk-WQDX276X.js";
16
+ isValidApiKey,
17
+ normalizeInstallSource
18
+ } from "./chunk-GYLIVREZ.js";
19
+
20
+ // src/install-source.ts
21
+ import { readFileSync } from "fs";
22
+ var ENV_OVERRIDE = "PUSHARY_INSTALL_SOURCE";
23
+ var PLUGIN_ROOT = "CLAUDE_PLUGIN_ROOT";
24
+ var EDITOR_PLUGIN_MARKERS = ["cursor-plugin", "vscode-plugin"];
25
+ var detectInstallSource = (env = process.env, argv = process.argv) => {
26
+ const declared = env[ENV_OVERRIDE]?.trim();
27
+ if (declared) return normalizeInstallSource(declared);
28
+ const pluginRoot = env[PLUGIN_ROOT]?.trim();
29
+ if (pluginRoot) {
30
+ return EDITOR_PLUGIN_MARKERS.some((marker) => pluginRoot.includes(marker)) ? "editor_plugin" : "claude_plugin";
31
+ }
32
+ const entry = argv[1] ?? "";
33
+ if (entry.includes("_npx")) return "npx";
34
+ if (entry) return "npm";
35
+ return "unknown";
36
+ };
37
+ var storedInstallSource = () => {
38
+ try {
39
+ const parsed = JSON.parse(readFileSync(configFilePath(), "utf-8"));
40
+ const stored = parsed.installSource;
41
+ return typeof stored === "string" && stored ? normalizeInstallSource(stored) : void 0;
42
+ } catch {
43
+ return void 0;
44
+ }
45
+ };
46
+ var resolveInstallSourceFor = (config) => {
47
+ const stored = config.installSource;
48
+ if (typeof stored === "string" && stored) return normalizeInstallSource(stored);
49
+ return detectInstallSource();
50
+ };
51
+ var reportedInstallSource = () => storedInstallSource() ?? detectInstallSource();
21
52
 
22
53
  // src/shell-alias.ts
23
54
  import { homedir } from "os";
24
- import { existsSync, readFileSync, appendFileSync, writeFileSync } from "fs";
55
+ import { existsSync, readFileSync as readFileSync2, appendFileSync, writeFileSync } from "fs";
25
56
  import { join } from "path";
26
57
  var MARKER_START = "# >>> pushary >>>";
27
58
  var MARKER_END = "# <<< pushary <<<";
@@ -64,7 +95,7 @@ var removeClaudeAlias = () => {
64
95
  if (!existsSync(path)) continue;
65
96
  let content;
66
97
  try {
67
- content = readFileSync(path, "utf-8");
98
+ content = readFileSync2(path, "utf-8");
68
99
  } catch {
69
100
  continue;
70
101
  }
@@ -81,7 +112,7 @@ var removeClaudeAlias = () => {
81
112
  };
82
113
 
83
114
  // src/keystore.ts
84
- import { chmodSync, constants as fsConstants, copyFileSync, existsSync as existsSync2, lstatSync, mkdirSync, readdirSync, readFileSync as readFileSync2, realpathSync, rmSync, statSync, writeFileSync as writeFileSync2 } from "fs";
115
+ import { chmodSync, constants as fsConstants, copyFileSync, existsSync as existsSync2, lstatSync, mkdirSync, readdirSync, readFileSync as readFileSync3, realpathSync, rmSync, statSync, writeFileSync as writeFileSync2 } from "fs";
85
116
  import { homedir as homedir2 } from "os";
86
117
  import { basename, dirname, isAbsolute, join as join2, relative } from "path";
87
118
  var KEY_FILE_MODE = 384;
@@ -191,7 +222,7 @@ var isRegularFile = (path) => {
191
222
  };
192
223
  var holdsAPusharyKey = (file) => {
193
224
  try {
194
- return readFileSync2(file, "utf8").split(/\r?\n/).some(isPusharyKeyLine);
225
+ return readFileSync3(file, "utf8").split(/\r?\n/).some(isPusharyKeyLine);
195
226
  } catch {
196
227
  return false;
197
228
  }
@@ -316,7 +347,7 @@ var realPathOf = (filePath) => {
316
347
  var isMissingFileError = (err) => err instanceof Error && "code" in err && err.code === "ENOENT";
317
348
  var readRcContents = (path) => {
318
349
  try {
319
- return { kind: "read", content: readFileSync2(path, "utf-8") };
350
+ return { kind: "read", content: readFileSync3(path, "utf-8") };
320
351
  } catch (err) {
321
352
  return isMissingFileError(err) ? { kind: "read", content: "" } : { kind: "unavailable", detail: errorMessageOf(err) };
322
353
  }
@@ -411,7 +442,7 @@ var writeKey = (apiKey, origin, options = {}) => {
411
442
  var disableKeyLinesIn = (rcPath, loader, isReplacedLine) => {
412
443
  try {
413
444
  const real = realpathSync(rcPath);
414
- const lines = readFileSync2(real, "utf8").split("\n");
445
+ const lines = readFileSync3(real, "utf8").split("\n");
415
446
  const edit = replaceKeyLinesWithLoader(lines, loader, isReplacedLine);
416
447
  if (keyLinesWereReplaced(lines, edit)) writeFileSync2(real, edit.lines.join("\n"));
417
448
  return edit.replacedLineCount;
@@ -522,7 +553,7 @@ var shellProfileCandidates = () => {
522
553
  };
523
554
  var readProfileOrNull = (path) => {
524
555
  try {
525
- return readFileSync2(path, "utf8");
556
+ return readFileSync3(path, "utf8");
526
557
  } catch {
527
558
  return null;
528
559
  }
@@ -537,6 +568,7 @@ var findExportedKeyLines = (profiles = exportedKeyFiles()) => profiles.flatMap(e
537
568
  var findExportedKeyLine = (profiles = exportedKeyFiles()) => findExportedKeyLines(profiles)[0] ?? null;
538
569
 
539
570
  export {
571
+ reportedInstallSource,
540
572
  CANDIDATE_RCS,
541
573
  resolveShellRc,
542
574
  removeClaudeAlias,
@@ -8,39 +8,54 @@ import {
8
8
  SubscriptionRequiredError,
9
9
  callMcpTool,
10
10
  isRetryable
11
- } from "./chunk-MJNRULIV.js";
11
+ } from "./chunk-ZYQHIMZU.js";
12
12
  import {
13
13
  fetchAsCredential
14
- } from "./chunk-5A65MMYW.js";
14
+ } from "./chunk-SYCNMJ3Z.js";
15
15
  import {
16
16
  installNetworkDefaults,
17
17
  isNetworkFailure
18
- } from "./chunk-BZ6E2ZJ3.js";
18
+ } from "./chunk-S4AQUVX3.js";
19
+ import {
20
+ keyPrefix
21
+ } from "./chunk-47NWTV5K.js";
19
22
  import {
20
23
  clientReportClaims
21
- } from "./chunk-IPBJJCEC.js";
24
+ } from "./chunk-WHFXXV2A.js";
22
25
  import {
23
26
  getApiKey,
24
27
  getBaseUrl
25
- } from "./chunk-3JYLC2WN.js";
28
+ } from "./chunk-5LE7C6Q2.js";
29
+ import {
30
+ getPackageVersion
31
+ } from "./chunk-CXQWDQCJ.js";
26
32
  import {
27
33
  ASK_AGENT_NAME_MAX,
34
+ CANCEL_QUESTION_REASON_FIELD,
28
35
  CLIENT_REPORT_PATH,
29
36
  DECISION_LINE_MAX,
30
37
  GATE_PERMISSION_MODE_MAX_LENGTH,
38
+ KEY_REJECTED_PHASE,
39
+ QUESTION_WITHDRAWAL_REASON,
40
+ SETUP_STOPPED_PATH,
41
+ TEST_TRAFFIC_ENV,
42
+ TEST_TRAFFIC_HEADER,
43
+ TEST_TRAFFIC_HEADER_VALUE,
31
44
  TOOL_FAILURE_CODES,
32
45
  WAIT_END_CLOSED,
33
46
  WAIT_END_OPEN,
34
47
  WAIT_END_PATH,
48
+ computerOsOfPlatform,
35
49
  degradedLine,
36
50
  isAskUserReply,
37
51
  isAwayPaused,
38
52
  isDecisionStoppedReply,
39
53
  isLocalQuestionHandoff,
40
54
  isRecord,
55
+ responseRejectsCredential,
41
56
  truncateLine,
42
57
  waitEndAnswered
43
- } from "./chunk-WQDX276X.js";
58
+ } from "./chunk-GYLIVREZ.js";
44
59
 
45
60
  // src/api.ts
46
61
  import { randomUUID } from "crypto";
@@ -164,6 +179,30 @@ var claimReportWindow = (claimsDir, key, now) => {
164
179
  return "claimed";
165
180
  };
166
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
+
167
206
  // src/client-report.ts
168
207
  var CLIENT_REPORT_TIMEOUT_MS = 1e3;
169
208
  var CLIENT_REPORT_MAX_ATTEMPTS = 2;
@@ -183,6 +222,14 @@ var defaultDeps = () => ({
183
222
  claimsDir: clientReportClaims()
184
223
  });
185
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
+ });
186
233
  var createClientErrorReporter = (deps) => {
187
234
  const windowClaimedInProcess = /* @__PURE__ */ new Map();
188
235
  const claimInProcess = (key, now) => {
@@ -194,6 +241,16 @@ var createClientErrorReporter = (deps) => {
194
241
  const claim = claimReportWindow(deps.claimsDir, key, now);
195
242
  return claim === "unavailable" ? claimInProcess(key, now) : claim === "claimed";
196
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
+ };
197
254
  return async (event) => {
198
255
  try {
199
256
  if (deps.disabled()) return;
@@ -210,6 +267,7 @@ var createClientErrorReporter = (deps) => {
210
267
  signal
211
268
  }, deps.fetchImpl);
212
269
  await response.body?.cancel();
270
+ if (responseRejectsCredential(response.status, response.headers)) return await reportRejectedKeyOnce(apiKey, event, now, signal);
213
271
  if (response.ok || response.status < 500 && response.status !== 429) return;
214
272
  } catch {
215
273
  if (signal.aborted) return;
@@ -398,6 +456,7 @@ var CANCEL_QUESTION_TIMEOUT_MS = 4e3;
398
456
  var cancelQuestion = async (apiKey, correlationId, signal, baseUrl) => {
399
457
  return callMcpTool(apiKey, "cancel_question", { correlationId }, { signal, timeoutMs: CANCEL_QUESTION_TIMEOUT_MS, maxRetries: 1, baseUrl });
400
458
  };
459
+ var cancelQuestionSettledAtComputer = async (apiKey, correlationId, signal) => callMcpTool(apiKey, "cancel_question", { correlationId, [CANCEL_QUESTION_REASON_FIELD]: QUESTION_WITHDRAWAL_REASON.settledAtComputer }, { signal, timeoutMs: CANCEL_QUESTION_TIMEOUT_MS, maxRetries: 1 });
401
460
  var WITHDRAW_READ_TIMEOUT_MS = 2e3;
402
461
  var withdrawQuestion = async (apiKey, correlationId, transport = { cancelQuestion, waitForAnswer }) => {
403
462
  try {
@@ -497,6 +556,9 @@ var claimBlockedAction = async (apiKey, request, timeoutMs) => {
497
556
  };
498
557
 
499
558
  export {
559
+ testTrafficHeaders,
560
+ postKeylessBeacon,
561
+ telemetryOptedOut,
500
562
  CLIENT_REPORT_TIMEOUT_MS,
501
563
  reportClientError,
502
564
  exitAfterClientReports,
@@ -526,6 +588,7 @@ export {
526
588
  pollForAnswer,
527
589
  CANCEL_QUESTION_TIMEOUT_MS,
528
590
  cancelQuestion,
591
+ cancelQuestionSettledAtComputer,
529
592
  WITHDRAW_READ_TIMEOUT_MS,
530
593
  withdrawQuestion,
531
594
  waitForQuestion,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  pusharyDir
3
- } from "./chunk-IPBJJCEC.js";
3
+ } from "./chunk-WHFXXV2A.js";
4
4
  import {
5
5
  writeFileAtomic
6
6
  } from "./chunk-PM2NRK6Y.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  NPX_LATEST_COMMAND
3
- } from "./chunk-AMV2AVTB.js";
3
+ } from "./chunk-WZM7Y5HM.js";
4
4
  import {
5
5
  isValidApiKey
6
- } from "./chunk-WQDX276X.js";
6
+ } from "./chunk-GYLIVREZ.js";
7
7
 
8
8
  // src/config.ts
9
9
  import { readFileSync } from "fs";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  projectNameFor
3
- } from "./chunk-5Z63DAD6.js";
3
+ } from "./chunk-S55XHTYZ.js";
4
4
  import {
5
5
  readConfigFileKey
6
- } from "./chunk-OCQ6Y7NI.js";
6
+ } from "./chunk-47NWTV5K.js";
7
7
 
8
8
  // src/bell/fleet.ts
9
9
  import { closeSync, constants, futimesSync, lstatSync, mkdirSync, openSync, readdirSync, unlinkSync } from "fs";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  pusharyHookExecutable
3
- } from "./chunk-CV63IDIE.js";
3
+ } from "./chunk-2EHLFIVK.js";
4
4
  import {
5
5
  bridgeResolvesToApp,
6
6
  cursorUserHooks,
7
7
  executableFileName,
8
8
  isBridgeLocator,
9
9
  liveBridgeProbe
10
- } from "./chunk-IPBJJCEC.js";
10
+ } from "./chunk-WHFXXV2A.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-WQDX276X.js";
24
+ } from "./chunk-GYLIVREZ.js";
25
25
 
26
26
  // src/cursor-gate-registration.ts
27
27
  import { dirname, isAbsolute, join, resolve } from "path";
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  autoUpdateLock
3
- } from "./chunk-IPBJJCEC.js";
3
+ } from "./chunk-WHFXXV2A.js";
4
4
  import {
5
5
  installPackageGlobally,
6
6
  npmErrorMessage,
7
7
  throwIfNpmRefusesInstall
8
- } from "./chunk-SWHJRTCT.js";
8
+ } from "./chunk-IQBJD5ZB.js";
9
9
  import {
10
10
  writeJsonAtomic
11
11
  } from "./chunk-PM2NRK6Y.js";
@@ -10,7 +10,7 @@ import {
10
10
  uploadTranscriptRecords,
11
11
  verifyAnchoredRecipients,
12
12
  wrapSessionKey
13
- } from "./chunk-OYUCP6IN.js";
13
+ } from "./chunk-DPOLLK6I.js";
14
14
 
15
15
  // src/live-session.ts
16
16
  var LIVE_TRANSCRIPT_LIMITS = { queuedRecords: 100, recordCharacters: 32 * 1024 };
@@ -2,31 +2,31 @@ import {
2
2
  SIGNED_OUT_ON_MAC_MESSAGE,
3
3
  describeSignedOutKey,
4
4
  readSignedOutDiagnosis
5
- } from "./chunk-XWWBOTJX.js";
5
+ } from "./chunk-YBAU5TAV.js";
6
6
  import {
7
7
  APPROVAL_RULES_PATH
8
- } from "./chunk-ZEPZMXJH.js";
8
+ } from "./chunk-WYYZ2UFX.js";
9
9
  import {
10
10
  createIo
11
- } from "./chunk-FTWC3YL5.js";
11
+ } from "./chunk-TEFLCQO4.js";
12
12
  import {
13
13
  absoluteUrl,
14
14
  checkApiKey,
15
15
  describeKeyCheck,
16
16
  keyCheckFromResponse
17
- } from "./chunk-RFZXAPIN.js";
17
+ } from "./chunk-NOWWUX5V.js";
18
18
  import {
19
19
  readKeySource
20
- } from "./chunk-OCQ6Y7NI.js";
20
+ } from "./chunk-47NWTV5K.js";
21
21
  import {
22
22
  getBaseUrl
23
- } from "./chunk-3JYLC2WN.js";
23
+ } from "./chunk-5LE7C6Q2.js";
24
24
  import {
25
25
  EXIT
26
26
  } from "./chunk-BG4HHB7E.js";
27
27
  import {
28
28
  KEY_SCOPE
29
- } from "./chunk-WQDX276X.js";
29
+ } from "./chunk-GYLIVREZ.js";
30
30
 
31
31
  // src/cli/report-key.ts
32
32
  var { dim, yellow } = createIo();
@@ -2,7 +2,7 @@ import {
2
2
  MCP_TOOLS_THAT_SEND_SOMETHING_OUT_LABEL,
3
3
  MCP_TOOLS_THAT_SEND_SOMETHING_OUT_PATTERN,
4
4
  WILDCARD_TOOL_PATTERN
5
- } from "./chunk-WQDX276X.js";
5
+ } from "./chunk-GYLIVREZ.js";
6
6
 
7
7
  // src/wait-ladder.ts
8
8
  var WAIT_RULE_LABELS = {
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  questionWindowOf
3
- } from "./chunk-3G4HNQA6.js";
3
+ } from "./chunk-N6ARPVSQ.js";
4
4
  import {
5
5
  UNNAMED_ACTION
6
- } from "./chunk-TXVWUYJC.js";
6
+ } from "./chunk-YZRUE46K.js";
7
7
  import {
8
8
  ASK_USER_TIMEOUT_MS,
9
9
  WAIT_END_TIMEOUT_MS,
@@ -11,10 +11,10 @@ import {
11
11
  askUser,
12
12
  unavailableQuestionUnlessRefused,
13
13
  waitForQuestion
14
- } from "./chunk-RBM5PLKI.js";
14
+ } from "./chunk-4LRWEHQT.js";
15
15
  import {
16
16
  getMachineId
17
- } from "./chunk-RCMMMQSJ.js";
17
+ } from "./chunk-4ZSC56SL.js";
18
18
  import {
19
19
  hookMaxWaitSeconds,
20
20
  hookWaitClamped,
@@ -24,7 +24,7 @@ import {
24
24
  refusesWhenUnanswered,
25
25
  ruleApprovesAfterItsFullWindow,
26
26
  scopeBreachReasonOf
27
- } from "./chunk-WQDX276X.js";
27
+ } from "./chunk-GYLIVREZ.js";
28
28
 
29
29
  // src/pushed-question.ts
30
30
  var scopeQuestionOf = (verdict) => {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isRecord
3
- } from "./chunk-WQDX276X.js";
3
+ } from "./chunk-GYLIVREZ.js";
4
4
 
5
5
  // src/config-document.ts
6
6
  import { parse, stringify } from "smol-toml";
@@ -6,17 +6,17 @@ import {
6
6
  postLiveSession,
7
7
  postLiveSessionUntilAccepted,
8
8
  startLiveSessionHeartbeat
9
- } from "./chunk-4MUKWLYS.js";
9
+ } from "./chunk-AQPA4YIB.js";
10
10
  import {
11
11
  CommandReceipts,
12
12
  controllerCommandSchema
13
- } from "./chunk-4SRBFGPG.js";
13
+ } from "./chunk-JQCF2IYA.js";
14
14
  import {
15
15
  SESSION_IDLE_TIMEOUT_MS,
16
16
  describeIdleWindow,
17
17
  idleDeadlinePassed,
18
18
  startProcessOwnership
19
- } from "./chunk-KRJHE353.js";
19
+ } from "./chunk-LF5OEQNP.js";
20
20
  import {
21
21
  spawnClaude
22
22
  } from "./chunk-3PSNUHC5.js";
@@ -25,18 +25,18 @@ import {
25
25
  isWaitForAnswerResponse,
26
26
  withdrawQuestion,
27
27
  writeDegraded
28
- } from "./chunk-RBM5PLKI.js";
28
+ } from "./chunk-4LRWEHQT.js";
29
29
  import {
30
30
  readCommandAck
31
- } from "./chunk-RTHHTOSN.js";
31
+ } from "./chunk-NYP2NRV3.js";
32
32
  import {
33
33
  callMcpTool,
34
34
  isRetryable
35
- } from "./chunk-MJNRULIV.js";
35
+ } from "./chunk-ZYQHIMZU.js";
36
36
  import {
37
37
  projectNameFor,
38
38
  repositoryScopeFor
39
- } from "./chunk-5Z63DAD6.js";
39
+ } from "./chunk-S55XHTYZ.js";
40
40
  import {
41
41
  AGENT_QUESTION_DESCRIPTION_MAX,
42
42
  AGENT_QUESTION_HEADER_MAX,
@@ -58,7 +58,7 @@ import {
58
58
  parseCodexQuestions,
59
59
  planElicitationAsk,
60
60
  readElicitationFields
61
- } from "./chunk-WQDX276X.js";
61
+ } from "./chunk-GYLIVREZ.js";
62
62
 
63
63
  // src/codex-question-owner.ts
64
64
  import { createHash } from "crypto";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  guardBinary
3
- } from "./chunk-IPBJJCEC.js";
3
+ } from "./chunk-WHFXXV2A.js";
4
4
 
5
5
  // src/bell/install.ts
6
6
  import { join } from "path";
@@ -4,10 +4,10 @@ import {
4
4
  } from "./chunk-P6DUWKAO.js";
5
5
  import {
6
6
  fetchAsCredential
7
- } from "./chunk-5A65MMYW.js";
7
+ } from "./chunk-SYCNMJ3Z.js";
8
8
  import {
9
9
  getBaseUrl
10
- } from "./chunk-3JYLC2WN.js";
10
+ } from "./chunk-5LE7C6Q2.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-WQDX276X.js";
18
+ } from "./chunk-GYLIVREZ.js";
19
19
 
20
20
  // src/transcript-recipient-pin.ts
21
21
  import { createHash } from "crypto";
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-6ICPEJY5.js";
7
7
  import {
8
8
  isRecord
9
- } from "./chunk-WQDX276X.js";
9
+ } from "./chunk-GYLIVREZ.js";
10
10
 
11
11
  // src/setup/agent-probe.ts
12
12
  import { execSync } from "child_process";
@@ -6,7 +6,7 @@ import {
6
6
  OPENCODE_PLUGIN_PLACEHOLDER,
7
7
  OPENCODE_PLUGIN_SIBLING,
8
8
  OPENCODE_PLUGIN_SIBLING_CONTENTS
9
- } from "./chunk-VZKJU6TX.js";
9
+ } from "./chunk-XIEYX4TJ.js";
10
10
 
11
11
  // src/opencode-runtime-bundle.ts
12
12
  var openCodeRuntimeSource = `import { spawn } from 'child_process';
@@ -4,16 +4,16 @@ import {
4
4
  } from "./chunk-WHB622LP.js";
5
5
  import {
6
6
  keyPrefix
7
- } from "./chunk-OCQ6Y7NI.js";
7
+ } from "./chunk-47NWTV5K.js";
8
8
  import {
9
9
  keyPrefixToShow
10
- } from "./chunk-3JYLC2WN.js";
10
+ } from "./chunk-5LE7C6Q2.js";
11
11
  import {
12
12
  NPX_LATEST_COMMAND
13
- } from "./chunk-AMV2AVTB.js";
13
+ } from "./chunk-WZM7Y5HM.js";
14
14
  import {
15
15
  isValidApiKey
16
- } from "./chunk-WQDX276X.js";
16
+ } from "./chunk-GYLIVREZ.js";
17
17
 
18
18
  // src/setup/key-account.ts
19
19
  var isKeyHeldByMacApp = (key, holder) => holder.macAppInstalled && holder.macAppKey === key;
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  compatibleConfigFile,
3
3
  hasCompatibleHooks
4
- } from "./chunk-QXSMS7IR.js";
4
+ } from "./chunk-X5R55HMM.js";
5
5
  import {
6
6
  pusharyHookExecutable
7
- } from "./chunk-CV63IDIE.js";
7
+ } from "./chunk-2EHLFIVK.js";
8
8
  import {
9
9
  isProtectedByScope,
10
10
  registerHookEntry
11
- } from "./chunk-IPBJJCEC.js";
11
+ } from "./chunk-WHFXXV2A.js";
12
12
  import {
13
13
  isRecord
14
- } from "./chunk-WQDX276X.js";
14
+ } from "./chunk-GYLIVREZ.js";
15
15
 
16
16
  // src/cursor-config.ts
17
17
  var hookCommandOf = (entry) => {
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  CODEX_HOOK_STATUS,
3
3
  HERMES_HISTORY_HELPER_COMMAND
4
- } from "./chunk-HVEOTPRU.js";
4
+ } from "./chunk-XPS36L6H.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-6LDMEN7P.js";
10
+ } from "./chunk-XUJBTEUC.js";
11
11
  import {
12
12
  retryAgentCommand
13
- } from "./chunk-YIP2LG47.js";
13
+ } from "./chunk-SYEUQH6Z.js";
14
14
  import {
15
15
  NPX_LATEST_COMMAND
16
- } from "./chunk-AMV2AVTB.js";
16
+ } from "./chunk-WZM7Y5HM.js";
17
17
 
18
18
  // src/setup/codex-trust.ts
19
19
  var CODEX_TRUST_TELEMETRY = {
@@ -3,24 +3,24 @@ import {
3
3
  expectedLaunchCapabilities,
4
4
  hasSpawnProvider,
5
5
  resolveControlPolicy
6
- } from "./chunk-ISVO2KSM.js";
6
+ } from "./chunk-YGCU6KMO.js";
7
7
  import {
8
8
  daemonHasRemoteProof,
9
9
  daemonServiceManagerAvailable,
10
10
  hasDaemonServiceDefinition,
11
11
  readDaemonNeedsLogin,
12
12
  readDaemonStatus
13
- } from "./chunk-RBIDBSHI.js";
13
+ } from "./chunk-IR342JX3.js";
14
14
  import {
15
15
  getMachineId
16
- } from "./chunk-RCMMMQSJ.js";
16
+ } from "./chunk-4ZSC56SL.js";
17
17
  import {
18
18
  readControlMode,
19
19
  readKeyInForce
20
- } from "./chunk-OCQ6Y7NI.js";
20
+ } from "./chunk-47NWTV5K.js";
21
21
  import {
22
22
  getBaseUrl
23
- } from "./chunk-3JYLC2WN.js";
23
+ } from "./chunk-5LE7C6Q2.js";
24
24
  import {
25
25
  getPackageVersion
26
26
  } from "./chunk-CXQWDQCJ.js";