pushary 1.9.261 → 1.9.262

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 (146) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/README.md +6 -0
  3. package/dist/{api-LAG3VCHN.js → api-TGVE6ZKD.js} +11 -11
  4. package/dist/bin/pushary-audit.js +3 -3
  5. package/dist/bin/pushary-bell-hook.js +29 -29
  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 +40 -40
  10. package/dist/bin/pushary-codex-bridge.js +23 -23
  11. package/dist/bin/pushary-codex-hook.js +35 -35
  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 +36 -36
  15. package/dist/bin/pushary-cowork.js +5 -5
  16. package/dist/bin/pushary-daemon.js +47 -47
  17. package/dist/bin/pushary-disconnect.js +31 -31
  18. package/dist/bin/pushary-display-hook.js +60 -2
  19. package/dist/bin/pushary-doctor.js +143 -48
  20. package/dist/bin/pushary-elicitation-hook.js +28 -28
  21. package/dist/bin/pushary-gemini-bridge.js +18 -18
  22. package/dist/bin/pushary-gemini-hook.js +32 -32
  23. package/dist/bin/pushary-hook.js +36 -36
  24. package/dist/bin/pushary-login.js +41 -23
  25. package/dist/bin/pushary-logout.js +32 -32
  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 +28 -28
  29. package/dist/bin/pushary-opencode-bridge.js +22 -22
  30. package/dist/bin/pushary-opencode-hook.js +33 -33
  31. package/dist/bin/pushary-permission-denied-hook.js +35 -35
  32. package/dist/bin/pushary-permission-hook.js +36 -36
  33. package/dist/bin/pushary-post-hook.js +29 -29
  34. package/dist/bin/pushary-prompt-hook.js +28 -28
  35. package/dist/bin/pushary-session-end-hook.js +28 -28
  36. package/dist/bin/pushary-session-start-hook.js +40 -40
  37. package/dist/bin/pushary-sessions.js +12 -12
  38. package/dist/bin/pushary-setup.js +174 -82
  39. package/dist/bin/pushary-stats.js +5 -5
  40. package/dist/bin/pushary-status.js +37 -37
  41. package/dist/bin/pushary-stop-hook.js +28 -28
  42. package/dist/bin/pushary-stopfailure-hook.js +28 -28
  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 +48 -48
  47. package/dist/bin/pushary-wait.js +16 -16
  48. package/dist/bin/pushary.js +7 -7
  49. package/dist/{chunk-NKSOSZZU.js → chunk-23ELMB2F.js} +2 -2
  50. package/dist/{chunk-YHA5L6D3.js → chunk-2DYJTOOU.js} +3 -3
  51. package/dist/{chunk-QQ4U4NST.js → chunk-2Q3ZTT57.js} +7 -7
  52. package/dist/{chunk-NLG5BY2M.js → chunk-43DXK6WE.js} +1 -1
  53. package/dist/{chunk-T6ZGTBHT.js → chunk-5K5MT22J.js} +4 -4
  54. package/dist/{chunk-53LLER7E.js → chunk-5SVZXCAJ.js} +1 -1
  55. package/dist/{chunk-TUBI75B7.js → chunk-67UJTXRZ.js} +1 -1
  56. package/dist/{chunk-L6IKTYMZ.js → chunk-73ROMTIN.js} +6 -6
  57. package/dist/{chunk-3DW5OCS2.js → chunk-APTFA4KF.js} +1 -1
  58. package/dist/{chunk-ZGPUVZZ6.js → chunk-AURPPDRZ.js} +2 -2
  59. package/dist/{chunk-NTTHRLDQ.js → chunk-BTSJ2W7I.js} +1 -1
  60. package/dist/{chunk-GIK5P25V.js → chunk-BZ2V2ES3.js} +5 -5
  61. package/dist/{chunk-3PAM7BQJ.js → chunk-C4D6R27P.js} +5 -5
  62. package/dist/{chunk-YBVDF4NV.js → chunk-CAOMKUSR.js} +4 -4
  63. package/dist/{chunk-TW6BQOPH.js → chunk-CC6BYFNM.js} +6 -6
  64. package/dist/{chunk-VVDJCJ3P.js → chunk-CTTIW2A3.js} +2 -2
  65. package/dist/{chunk-KUVXFNHY.js → chunk-CXGRUUUM.js} +10 -10
  66. package/dist/{chunk-BBE7UITT.js → chunk-D2666AVW.js} +6 -6
  67. package/dist/{chunk-H6FDFP6W.js → chunk-DIHUVYT2.js} +81 -29
  68. package/dist/{chunk-ZVIF4O6V.js → chunk-DOMSM62I.js} +2 -2
  69. package/dist/{chunk-SFZWZHZB.js → chunk-DS3C4SRR.js} +2 -2
  70. package/dist/{chunk-ZSJDCRBA.js → chunk-DU2YTOTA.js} +1 -1
  71. package/dist/{chunk-X7BHVGGH.js → chunk-DU5MLJQL.js} +1 -1
  72. package/dist/{chunk-WUZM74HI.js → chunk-EHH4PQG7.js} +4 -4
  73. package/dist/{chunk-6LJVKWV7.js → chunk-EPT6MZBG.js} +5 -5
  74. package/dist/{chunk-I2DSQVSB.js → chunk-EVJ5DPRU.js} +1 -1
  75. package/dist/{chunk-GAKYGHUR.js → chunk-F6LNIS2Y.js} +1 -1
  76. package/dist/{chunk-HAOO2MNV.js → chunk-FKYZEIH7.js} +10 -10
  77. package/dist/{chunk-6RD6RNJY.js → chunk-FNDKQEJP.js} +4 -4
  78. package/dist/{chunk-IXXH6ZDQ.js → chunk-FURJQUDT.js} +2 -2
  79. package/dist/{chunk-LIZZSMUD.js → chunk-H4DPB3LK.js} +8 -8
  80. package/dist/{chunk-EYQZC5IV.js → chunk-H4XEEC4I.js} +2 -2
  81. package/dist/{chunk-RSV25NAF.js → chunk-HB3S3KDX.js} +1 -1
  82. package/dist/{chunk-WCSSU6QW.js → chunk-HMN4XEJE.js} +4 -4
  83. package/dist/{chunk-LH7NQSUC.js → chunk-HSVVH7K2.js} +1 -1
  84. package/dist/{chunk-N2IP7IDG.js → chunk-HVY3YUJU.js} +1 -1
  85. package/dist/{chunk-DN7PXEXE.js → chunk-HZ76NLD2.js} +6 -6
  86. package/dist/{chunk-FUXTIM33.js → chunk-I4D4XEIJ.js} +5 -5
  87. package/dist/{chunk-4SKEGBFV.js → chunk-IHH3HGQQ.js} +3 -3
  88. package/dist/{chunk-YHHQICQD.js → chunk-IK4MIPI2.js} +3 -3
  89. package/dist/{chunk-SSW4SERP.js → chunk-IMSFJFN6.js} +1 -1
  90. package/dist/{chunk-LRF4XS6M.js → chunk-IS5WMKN2.js} +3 -3
  91. package/dist/{chunk-ZNDLGXKO.js → chunk-J7V5ZFZC.js} +6 -6
  92. package/dist/{chunk-TDYAVCJ3.js → chunk-JG4JGAI2.js} +4 -4
  93. package/dist/{chunk-GQHIUZRG.js → chunk-JOQAW5BM.js} +12 -12
  94. package/dist/{chunk-5G55TWT5.js → chunk-JUCN4TV4.js} +5 -5
  95. package/dist/{chunk-GC75Q5P2.js → chunk-JVZCCUN4.js} +5 -5
  96. package/dist/{chunk-BLSGQHGW.js → chunk-K5ZEJCJO.js} +3 -3
  97. package/dist/{chunk-PX2MOPB2.js → chunk-KEC73KH6.js} +1 -1
  98. package/dist/{chunk-JC2E7D2W.js → chunk-LE6VFEJU.js} +1 -1
  99. package/dist/{chunk-FJMZDIKP.js → chunk-LZRXFGEP.js} +49 -3
  100. package/dist/{chunk-GETSAD5F.js → chunk-MJW6P7A6.js} +2 -2
  101. package/dist/{chunk-KMADAVW6.js → chunk-NHLCREFU.js} +1 -1
  102. package/dist/{chunk-IC6ARAAT.js → chunk-NLW2YDL5.js} +5 -5
  103. package/dist/{chunk-QAS67ZJH.js → chunk-OAE54AV7.js} +1 -1
  104. package/dist/{chunk-65MRCZGE.js → chunk-Q54QQO5E.js} +5 -5
  105. package/dist/{chunk-4ARB3SYI.js → chunk-QGYVOSDC.js} +1 -1
  106. package/dist/{chunk-CHKSE6TO.js → chunk-QIOPWRBQ.js} +1 -1
  107. package/dist/{chunk-5AL5W2HQ.js → chunk-QWSXLYTX.js} +3 -3
  108. package/dist/{chunk-TMJRKWWK.js → chunk-R33I7ZNR.js} +5 -5
  109. package/dist/{chunk-WFE4RAWD.js → chunk-RA4RSVVJ.js} +1 -1
  110. package/dist/{chunk-TX3IJUL7.js → chunk-RX75OG6S.js} +6 -6
  111. package/dist/{chunk-NBEFOUMK.js → chunk-SCXUTDQM.js} +3 -3
  112. package/dist/{chunk-Q3JHO3EJ.js → chunk-SG4IFPJP.js} +1 -1
  113. package/dist/{chunk-GAO33I7L.js → chunk-SLD22IUB.js} +4 -4
  114. package/dist/{chunk-QWIWACGD.js → chunk-SOJPAKCB.js} +1 -1
  115. package/dist/{chunk-JOABO2PX.js → chunk-T4EVAVKF.js} +5 -5
  116. package/dist/{chunk-SO5DEUCS.js → chunk-V6MQUYE2.js} +7 -7
  117. package/dist/{chunk-NVYEQLD5.js → chunk-VDPUBIL2.js} +2 -2
  118. package/dist/{chunk-VWJ5KDMM.js → chunk-VL4AJPCE.js} +4 -4
  119. package/dist/{chunk-B4MK2ZX2.js → chunk-VSW5ZMPX.js} +3 -3
  120. package/dist/{chunk-MGGN37IW.js → chunk-VZVKJP3Q.js} +72 -1
  121. package/dist/{chunk-YINXG75Q.js → chunk-W7QW3XFQ.js} +4 -4
  122. package/dist/{chunk-5UHGILNO.js → chunk-WCOI5PQU.js} +1 -1
  123. package/dist/{chunk-H4O3CV5W.js → chunk-WFUVBCKK.js} +4 -4
  124. package/dist/{chunk-2VTIVLLK.js → chunk-WOEMRT24.js} +3 -3
  125. package/dist/{chunk-RXGEWDA2.js → chunk-WTFR2OK4.js} +16 -16
  126. package/dist/{chunk-AKGNLKZP.js → chunk-WV7OME3F.js} +2 -2
  127. package/dist/{chunk-QRPHWWHI.js → chunk-WYYHSHBO.js} +2 -2
  128. package/dist/{chunk-HJOXLNYN.js → chunk-YEIHJAE6.js} +3 -3
  129. package/dist/{chunk-ATHP6SIZ.js → chunk-YQTU6V4X.js} +2 -2
  130. package/dist/{chunk-K4PJXC32.js → chunk-ZPM6H6GM.js} +1 -1
  131. package/dist/{codex-app-cards-switch-325EWQUA.js → codex-app-cards-switch-CQZL4XI6.js} +12 -12
  132. package/dist/{codex-card-routing-NXI4P7PB.js → codex-card-routing-VV2HQAGX.js} +2 -2
  133. package/dist/{codex-desktop-launch-3OAHHDWE.js → codex-desktop-launch-FYXOQGBR.js} +3 -3
  134. package/dist/{codex-session-launch-YB4LGTG2.js → codex-session-launch-A4LDZ4GU.js} +20 -20
  135. package/dist/{config-4FJ7KK75.js → config-EHAN6BUF.js} +3 -3
  136. package/dist/{global-upgrade-E4UKP2KG.js → global-upgrade-EJZ2EX7R.js} +9 -9
  137. package/dist/{identity-VQNJSXZO.js → identity-L7SFKUOG.js} +4 -4
  138. package/dist/{live-capabilities-YJW4CU7J.js → live-capabilities-QAVKVTKD.js} +4 -4
  139. package/dist/{paths-FOJGTYX4.js → paths-BD7XIUNJ.js} +3 -3
  140. package/dist/reapply-QFSUMRID.js +76 -0
  141. package/dist/src/index.d.ts +1 -0
  142. package/dist/src/index.js +34 -34
  143. package/dist/{upgrade-lock-MGX4PJQZ.js → upgrade-lock-Y35PJNJT.js} +4 -4
  144. package/dist/{usage-24DU5SWS.js → usage-E5Z3XUTZ.js} +3 -3
  145. package/package.json +1 -1
  146. package/dist/reapply-Q2MIQ4A7.js +0 -76
@@ -3,13 +3,13 @@ import {
3
3
  } from "./chunk-WHB622LP.js";
4
4
  import {
5
5
  ensureDaemonRunning
6
- } from "./chunk-ZNDLGXKO.js";
6
+ } from "./chunk-J7V5ZFZC.js";
7
7
  import {
8
8
  hookOwnerOf
9
- } from "./chunk-T6ZGTBHT.js";
9
+ } from "./chunk-5K5MT22J.js";
10
10
  import {
11
11
  hookMeaning
12
- } from "./chunk-N2IP7IDG.js";
12
+ } from "./chunk-HVY3YUJU.js";
13
13
  import {
14
14
  buildTranscriptRecords,
15
15
  changedRecipientsMessage,
@@ -24,11 +24,11 @@ import {
24
24
  uploadTranscriptRecords,
25
25
  verifyAnchoredRecipients,
26
26
  wrapSessionKey
27
- } from "./chunk-2VTIVLLK.js";
27
+ } from "./chunk-WOEMRT24.js";
28
28
  import {
29
29
  transcriptEnvironmentPreference,
30
30
  transcriptsEnabled
31
- } from "./chunk-ZSJDCRBA.js";
31
+ } from "./chunk-DU2YTOTA.js";
32
32
  import {
33
33
  external_exports,
34
34
  ownedOnlyByThisUser,
@@ -36,19 +36,19 @@ import {
36
36
  } from "./chunk-P6DUWKAO.js";
37
37
  import {
38
38
  fetchAsCredential
39
- } from "./chunk-JC2E7D2W.js";
39
+ } from "./chunk-LE6VFEJU.js";
40
40
  import {
41
41
  readTranscriptPreference
42
- } from "./chunk-BLSGQHGW.js";
42
+ } from "./chunk-K5ZEJCJO.js";
43
43
  import {
44
44
  claudeConfigDir,
45
45
  codexHome,
46
46
  pusharyDir
47
- } from "./chunk-ZGPUVZZ6.js";
47
+ } from "./chunk-AURPPDRZ.js";
48
48
  import {
49
49
  getApiKey,
50
50
  getBaseUrl
51
- } from "./chunk-AKGNLKZP.js";
51
+ } from "./chunk-WV7OME3F.js";
52
52
  import {
53
53
  writeJsonAtomic,
54
54
  writeJsonAtomicDurable
@@ -61,7 +61,7 @@ import {
61
61
  isHookSource,
62
62
  isRecord,
63
63
  redactSecretsFromContent
64
- } from "./chunk-MGGN37IW.js";
64
+ } from "./chunk-VZVKJP3Q.js";
65
65
 
66
66
  // src/transcript-registration.ts
67
67
  import { createHash as createHash4 } from "crypto";
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  APPROVAL_RULES_PATH,
3
3
  canChangeApprovalSettings
4
- } from "./chunk-ZVIF4O6V.js";
4
+ } from "./chunk-DOMSM62I.js";
5
5
  import {
6
6
  callMcpTool
7
- } from "./chunk-3PAM7BQJ.js";
7
+ } from "./chunk-C4D6R27P.js";
8
8
  import {
9
9
  absoluteUrl
10
- } from "./chunk-HJOXLNYN.js";
10
+ } from "./chunk-YEIHJAE6.js";
11
11
  import {
12
12
  getBaseUrl
13
- } from "./chunk-AKGNLKZP.js";
13
+ } from "./chunk-WV7OME3F.js";
14
14
  import {
15
15
  NPX_LATEST_COMMAND
16
- } from "./chunk-3DW5OCS2.js";
16
+ } from "./chunk-APTFA4KF.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-MGGN37IW.js";
24
+ } from "./chunk-VZVKJP3Q.js";
25
25
 
26
26
  // src/reach.ts
27
27
  var PUSHARY_APP_DOWNLOAD_URL = "https://pushary.com/download";
@@ -29,7 +29,7 @@ import {
29
29
  toolResultErrorText,
30
30
  transcriptTokensIn,
31
31
  transcriptUsageRequest
32
- } from "./chunk-N2IP7IDG.js";
32
+ } from "./chunk-HVY3YUJU.js";
33
33
  import {
34
34
  askUser,
35
35
  cancelQuestion,
@@ -45,37 +45,37 @@ import {
45
45
  waitForOpenQuestion,
46
46
  waitForQuestion,
47
47
  writeDegraded
48
- } from "./chunk-TX3IJUL7.js";
48
+ } from "./chunk-RX75OG6S.js";
49
49
  import {
50
50
  RETRY_ACK,
51
51
  readCommandAck,
52
52
  refusedReceiptMessage
53
- } from "./chunk-GAKYGHUR.js";
53
+ } from "./chunk-F6LNIS2Y.js";
54
54
  import {
55
55
  SubscriptionRequiredError,
56
56
  isRetryable,
57
57
  withRetry
58
- } from "./chunk-3PAM7BQJ.js";
58
+ } from "./chunk-C4D6R27P.js";
59
59
  import {
60
60
  fetchAsCredential
61
- } from "./chunk-JC2E7D2W.js";
61
+ } from "./chunk-LE6VFEJU.js";
62
62
  import {
63
63
  branchFor,
64
64
  projectNameFor,
65
65
  repoKeyFor
66
- } from "./chunk-I2DSQVSB.js";
66
+ } from "./chunk-EVJ5DPRU.js";
67
67
  import {
68
68
  getMachineId
69
- } from "./chunk-LH7NQSUC.js";
69
+ } from "./chunk-HSVVH7K2.js";
70
70
  import {
71
71
  reportedInstallSource
72
- } from "./chunk-VVDJCJ3P.js";
72
+ } from "./chunk-CTTIW2A3.js";
73
73
  import {
74
74
  IDLE_PROMPT_NOTIFICATION,
75
75
  NOTIFICATION_PUSH_TYPES,
76
76
  POSTTOOLUSE_MIRROR_ONLY_TOOLS,
77
77
  claudeConfigDir
78
- } from "./chunk-ZGPUVZZ6.js";
78
+ } from "./chunk-AURPPDRZ.js";
79
79
  import {
80
80
  compareVersion,
81
81
  parseVersion
@@ -84,7 +84,7 @@ import {
84
84
  getApiKey,
85
85
  getBaseUrl,
86
86
  isMalformedApiKeyError
87
- } from "./chunk-AKGNLKZP.js";
87
+ } from "./chunk-WV7OME3F.js";
88
88
  import {
89
89
  writeFileAtomic,
90
90
  writeJsonAtomicDurable
@@ -152,7 +152,7 @@ import {
152
152
  resolvePolicy,
153
153
  unansweredRefusalReason,
154
154
  waitsForThePhone
155
- } from "./chunk-MGGN37IW.js";
155
+ } from "./chunk-VZVKJP3Q.js";
156
156
 
157
157
  // src/pending.ts
158
158
  import { join } from "path";
@@ -458,6 +458,12 @@ var emitHookOutput = async (render, write = writeOutput) => {
458
458
  }
459
459
  };
460
460
 
461
+ // src/telemetry-opt-out.ts
462
+ var TELEMETRY_OPT_OUT_VARIABLES = ["DO_NOT_TRACK", "PUSHARY_TELEMETRY_DISABLED"];
463
+ var OPT_IN_SPELLINGS = ["", "0", "false"];
464
+ var variableOptsOut = (value) => value !== void 0 && !OPT_IN_SPELLINGS.includes(value.trim().toLowerCase());
465
+ var telemetryOptedOut = (env) => TELEMETRY_OPT_OUT_VARIABLES.some((name) => variableOptsOut(env[name]));
466
+
461
467
  // src/policy.ts
462
468
  import { createHash as createHash2 } from "crypto";
463
469
  import { existsSync as existsSync2, lstatSync as lstatSync2, readFileSync as readFileSync2, readdirSync as readdirSync2, unlinkSync as unlinkSync2, utimesSync, writeFileSync as writeFileSync2 } from "fs";
@@ -1314,7 +1320,7 @@ var phoneDrivenEnv = (base) => ({
1314
1320
  import { join as join5 } from "path";
1315
1321
  import { tmpdir as tmpdir5 } from "os";
1316
1322
  import { createHash as createHash4 } from "crypto";
1317
- import { existsSync as existsSync4, mkdirSync as mkdirSync3, statSync as statSync3, writeFileSync as writeFileSync5, rmSync as rmSync2 } from "fs";
1323
+ import { existsSync as existsSync4, mkdirSync as mkdirSync3, statSync as statSync3, writeFileSync as writeFileSync5, rmSync as rmSync2, utimesSync as utimesSync2 } from "fs";
1318
1324
  var THROTTLE_DIR = join5(tmpdir5(), "pushary-throttle");
1319
1325
  var markerPath = (key) => join5(THROTTLE_DIR, createHash4("sha256").update(key).digest("hex").slice(0, 16));
1320
1326
  var claimThrottle = (key, windowMs) => {
@@ -1331,16 +1337,24 @@ var claimThrottle = (key, windowMs) => {
1331
1337
  var releaseThrottle = (key) => {
1332
1338
  rmSync2(markerPath(key), { force: true });
1333
1339
  };
1340
+ var rearmThrottle = (key, windowMs, retryAfterMs) => {
1341
+ const stampSeconds = (Date.now() - windowMs + retryAfterMs) / 1e3;
1342
+ utimesSync2(markerPath(key), stampSeconds, stampSeconds);
1343
+ };
1344
+ var renewThrottle = (key) => {
1345
+ const stampSeconds = Date.now() / 1e3;
1346
+ utimesSync2(markerPath(key), stampSeconds, stampSeconds);
1347
+ };
1334
1348
 
1335
1349
  // src/blocked-action-hint.ts
1336
1350
  import { createHash as createHash5 } from "crypto";
1337
- import { existsSync as existsSync5, mkdirSync as mkdirSync5, readFileSync as readFileSync5, readdirSync as readdirSync4, rmSync as rmSync4, statSync as statSync4, utimesSync as utimesSync3 } from "fs";
1351
+ import { existsSync as existsSync5, mkdirSync as mkdirSync5, readFileSync as readFileSync5, readdirSync as readdirSync4, rmSync as rmSync4, statSync as statSync4, utimesSync as utimesSync4 } from "fs";
1338
1352
  import { tmpdir as tmpdir7 } from "os";
1339
1353
  import { join as join7 } from "path";
1340
1354
 
1341
1355
  // src/call-decision-store.ts
1342
1356
  import { randomUUID } from "crypto";
1343
- import { linkSync, lstatSync as lstatSync3, mkdirSync as mkdirSync4, readFileSync as readFileSync4, readdirSync as readdirSync3, renameSync, rmSync as rmSync3, utimesSync as utimesSync2, writeFileSync as writeFileSync6 } from "fs";
1357
+ import { linkSync, lstatSync as lstatSync3, mkdirSync as mkdirSync4, readFileSync as readFileSync4, readdirSync as readdirSync3, renameSync, rmSync as rmSync3, utimesSync as utimesSync3, writeFileSync as writeFileSync6 } from "fs";
1344
1358
  import { tmpdir as tmpdir6, userInfo } from "os";
1345
1359
  import { join as join6 } from "path";
1346
1360
  var userScope = () => {
@@ -1526,7 +1540,7 @@ var callDecisionStore = (name, ttlMs, options = {}) => {
1526
1540
  const pending = join6(dir, `${key}.${randomUUID()}.pending`);
1527
1541
  try {
1528
1542
  writeFileSync6(pending, JSON.stringify(decision), { encoding: "utf-8", mode: PRIVATE_FILE_MODE, flag: "wx" });
1529
- utimesSync2(pending, Date.now() / MS_PER_SECOND2, recordedAtMs / MS_PER_SECOND2);
1543
+ utimesSync3(pending, Date.now() / MS_PER_SECOND2, recordedAtMs / MS_PER_SECOND2);
1530
1544
  linkSync(pending, join6(dir, key));
1531
1545
  } catch (error) {
1532
1546
  if (!isAlreadyPresent(error)) reportUnrecordedDecision(error instanceof Error ? error.message : String(error));
@@ -1645,7 +1659,7 @@ var markApprovalReminded = (approval) => {
1645
1659
  const { atime, mtime } = statSync4(path);
1646
1660
  const { fingerprint, sessionId, toolName } = approval;
1647
1661
  writeFileAtomic(path, JSON.stringify({ fingerprint, sessionId, toolName, reminded: true }), 384);
1648
- utimesSync3(path, atime, mtime);
1662
+ utimesSync4(path, atime, mtime);
1649
1663
  } catch {
1650
1664
  return;
1651
1665
  }
@@ -1754,7 +1768,7 @@ var isWaitingOnBackgroundWork = (sessionKey, nowMs = Date.now()) => {
1754
1768
 
1755
1769
  // src/gate-outcome-record.ts
1756
1770
  import { createHash as createHash7 } from "crypto";
1757
- import { lstatSync as lstatSync4, readFileSync as readFileSync7, readdirSync as readdirSync6, utimesSync as utimesSync4, writeFileSync as writeFileSync8 } from "fs";
1771
+ import { lstatSync as lstatSync4, readFileSync as readFileSync7, readdirSync as readdirSync6, utimesSync as utimesSync5, writeFileSync as writeFileSync8 } from "fs";
1758
1772
  import { tmpdir as tmpdir9 } from "os";
1759
1773
  import { join as join10 } from "path";
1760
1774
  var GATE_OUTCOME_RECORD_TTL_MS = 60 * 60 * 1e3;
@@ -1775,7 +1789,7 @@ var claimedSweep = (stamp, nowMs) => {
1775
1789
  try {
1776
1790
  const stamped = lstatSync4(stamp);
1777
1791
  if (!stamped.isFile() || nowMs - stamped.mtimeMs < GATE_OUTCOME_SWEEP_INTERVAL_MS) return false;
1778
- utimesSync4(stamp, nowMs / 1e3, nowMs / 1e3);
1792
+ utimesSync5(stamp, nowMs / 1e3, nowMs / 1e3);
1779
1793
  return true;
1780
1794
  } catch {
1781
1795
  return startedSweepStamp(stamp);
@@ -1972,6 +1986,42 @@ var deriveAutoDecisionBeacon = (toolName, toolInput, liveMode, agentType, cwd, s
1972
1986
  };
1973
1987
  var AUTO_DECISION_WINDOW_MS = 15 * 60 * 1e3;
1974
1988
  var HOOK_ACTIVE_WINDOW_MS = 30 * 60 * 1e3;
1989
+ var HOOK_ACTIVE_REPORT = { maxAttempts: 1, timeoutMs: 800 };
1990
+ var HOOK_ACTIVE_RETRY_MS = 2 * 60 * 1e3;
1991
+ var HOOK_ACTIVE_CUT_SHORT_RETRY_MS = 10 * 60 * 1e3;
1992
+ var EventRejectedError = class extends Error {
1993
+ constructor(status) {
1994
+ super(`/api/agent/event rejected (${status})`);
1995
+ this.status = status;
1996
+ }
1997
+ };
1998
+ var TOO_MANY_REQUESTS = 429;
1999
+ var isDefinitiveRefusal = (error) => error instanceof EventRejectedError && error.status >= 400 && error.status < 500 && error.status !== TOO_MANY_REQUESTS;
2000
+ var isTimeout = (error) => error instanceof Error && error.name === "TimeoutError";
2001
+ var hookActiveWindowAfter = (error, toolReportSettled) => {
2002
+ if (error === null || isDefinitiveRefusal(error)) return { kind: "full" };
2003
+ if (toolReportSettled && !isTimeout(error)) return { kind: "retry", afterMs: HOOK_ACTIVE_CUT_SHORT_RETRY_MS };
2004
+ return { kind: "retry", afterMs: HOOK_ACTIVE_RETRY_MS };
2005
+ };
2006
+ var keepThrottleQuietly = (keep) => {
2007
+ try {
2008
+ keep();
2009
+ } catch {
2010
+ return;
2011
+ }
2012
+ };
2013
+ var holdHookActiveWindow = (throttleKey, window) => keepThrottleQuietly(() => window.kind === "full" ? renewThrottle(throttleKey) : rearmThrottle(throttleKey, HOOK_ACTIVE_WINDOW_MS, window.afterMs));
2014
+ var reportHookActive = async (throttleKey, event, signals, report = reportEvent) => {
2015
+ holdHookActiveWindow(throttleKey, { kind: "retry", afterMs: HOOK_ACTIVE_RETRY_MS });
2016
+ const signal = AbortSignal.any([signals.budget, signals.toolReportSettled]);
2017
+ try {
2018
+ await report(event, { ...HOOK_ACTIVE_REPORT, requireOk: true, skipDrain: true, signal });
2019
+ holdHookActiveWindow(throttleKey, { kind: "full" });
2020
+ } catch (error) {
2021
+ holdHookActiveWindow(throttleKey, hookActiveWindowAfter(error, signals.toolReportSettled.aborted));
2022
+ }
2023
+ };
2024
+ var telemetryOptOutMark = (env = process.env) => telemetryOptedOut(env) ? { telemetryOptOut: true } : {};
1975
2025
  var permissionModeOf = (input) => {
1976
2026
  const permissionMode = parsePermissionMode(input.permission_mode);
1977
2027
  return permissionMode === void 0 ? {} : { permissionMode };
@@ -2083,7 +2133,7 @@ var reportEvent = async (event, options = {}) => {
2083
2133
  }),
2084
2134
  signal: AbortSignal.any([AbortSignal.timeout(timeoutMs), ...options.signal ? [options.signal] : []])
2085
2135
  });
2086
- if ((options.requireOk || event.usage !== void 0) && !res.ok) throw new Error(`/api/agent/event rejected (${res.status})`);
2136
+ if ((options.requireOk || event.usage !== void 0) && !res.ok) throw new EventRejectedError(res.status);
2087
2137
  try {
2088
2138
  const result = await res.json();
2089
2139
  const withoutPending = () => ({ ...result, pendingCommand: void 0, pendingCommandId: void 0 });
@@ -2212,17 +2262,18 @@ var handlePostToolUse = async (input, agent = CLAUDE_CODE_AGENT) => {
2212
2262
  skipDrain: insideSubagent
2213
2263
  });
2214
2264
  const extraReports = [];
2215
- if (claimThrottle(`hookactive:${sessionKey}`, HOOK_ACTIVE_WINDOW_MS) === "passed") {
2265
+ const hookActiveKey = `hookactive:${sessionKey}`;
2266
+ if (claimThrottle(hookActiveKey, HOOK_ACTIVE_WINDOW_MS) === "passed") {
2267
+ const toolReportSettled = new AbortController();
2268
+ void toolReport.finally(() => toolReportSettled.abort()).catch(() => void 0);
2216
2269
  extraReports.push(
2217
- reportEvent(
2218
- {
2219
- event: "agent_hook_active",
2220
- agentType: agent.type,
2221
- agentName: `${agent.label} - ${projectName}`,
2222
- sessionId: input.session_id
2223
- },
2224
- { maxAttempts: 1, timeoutMs: 800, signal }
2225
- )
2270
+ reportHookActive(hookActiveKey, {
2271
+ event: "agent_hook_active",
2272
+ agentType: agent.type,
2273
+ agentName: `${agent.label} - ${projectName}`,
2274
+ sessionId: input.session_id,
2275
+ ...telemetryOptOutMark()
2276
+ }, { budget: signal, toolReportSettled: toolReportSettled.signal })
2226
2277
  );
2227
2278
  }
2228
2279
  const [reported] = await Promise.allSettled([toolReport, ...extraReports]);
@@ -2507,6 +2558,7 @@ export {
2507
2558
  phoneDrivenEnv,
2508
2559
  claimThrottle,
2509
2560
  releaseThrottle,
2561
+ telemetryOptedOut,
2510
2562
  policyRequestFor,
2511
2563
  getPolicy,
2512
2564
  getPolicyForStandingDenies,
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  absoluteUrl
3
- } from "./chunk-HJOXLNYN.js";
3
+ } from "./chunk-YEIHJAE6.js";
4
4
  import {
5
5
  KEY_SCOPE
6
- } from "./chunk-MGGN37IW.js";
6
+ } from "./chunk-VZVKJP3Q.js";
7
7
 
8
8
  // src/cli/approval-settings-pages.ts
9
9
  var API_KEYS_PATH = "/dashboard/agent/settings";
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  autoUpdateLock
3
- } from "./chunk-ZGPUVZZ6.js";
3
+ } from "./chunk-AURPPDRZ.js";
4
4
  import {
5
5
  installPackageGlobally,
6
6
  npmErrorMessage,
7
7
  throwIfNpmRefusesInstall
8
- } from "./chunk-GAO33I7L.js";
8
+ } from "./chunk-SLD22IUB.js";
9
9
  import {
10
10
  writeJsonAtomic
11
11
  } from "./chunk-PM2NRK6Y.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  readTranscriptPreference
3
- } from "./chunk-BLSGQHGW.js";
3
+ } from "./chunk-K5ZEJCJO.js";
4
4
 
5
5
  // src/transcript-setting.ts
6
6
  var transcriptEnvironmentPreference = () => {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isSafeReadOnlyCommand
3
- } from "./chunk-MGGN37IW.js";
3
+ } from "./chunk-VZVKJP3Q.js";
4
4
 
5
5
  // src/ledger.ts
6
6
  import { appendFileSync, existsSync, mkdirSync, readFileSync, renameSync, rmSync, statSync } from "fs";
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  compatibleConfigFile,
3
3
  hasCompatibleHooks
4
- } from "./chunk-DN7PXEXE.js";
4
+ } from "./chunk-HZ76NLD2.js";
5
5
  import {
6
6
  pusharyHookExecutable
7
- } from "./chunk-T6ZGTBHT.js";
7
+ } from "./chunk-5K5MT22J.js";
8
8
  import {
9
9
  isProtectedByScope,
10
10
  registerHookEntry
11
- } from "./chunk-ZGPUVZZ6.js";
11
+ } from "./chunk-AURPPDRZ.js";
12
12
  import {
13
13
  isRecord
14
- } from "./chunk-MGGN37IW.js";
14
+ } from "./chunk-VZVKJP3Q.js";
15
15
 
16
16
  // src/cursor-config.ts
17
17
  var hookCommandOf = (entry) => {
@@ -1,25 +1,25 @@
1
1
  import {
2
2
  openClawLauncherCandidates
3
- } from "./chunk-LRF4XS6M.js";
3
+ } from "./chunk-IS5WMKN2.js";
4
4
  import {
5
5
  openCodeConfigDirFrom
6
- } from "./chunk-SO5DEUCS.js";
6
+ } from "./chunk-V6MQUYE2.js";
7
7
  import {
8
8
  nativeClaudeInstallPath
9
9
  } from "./chunk-TCE3J44Z.js";
10
10
  import {
11
11
  grokHome
12
- } from "./chunk-DN7PXEXE.js";
12
+ } from "./chunk-HZ76NLD2.js";
13
13
  import {
14
14
  claudeConfigDir,
15
15
  clineDataDirectory,
16
16
  codexHomeFrom,
17
17
  openClawEnvironmentOf,
18
18
  openClawPathsFrom
19
- } from "./chunk-ZGPUVZZ6.js";
19
+ } from "./chunk-AURPPDRZ.js";
20
20
  import {
21
21
  HOOK_COMPATIBLE_PROFILES
22
- } from "./chunk-MGGN37IW.js";
22
+ } from "./chunk-VZVKJP3Q.js";
23
23
 
24
24
  // src/vscode-config.ts
25
25
  import { homedir } from "os";
@@ -2,7 +2,7 @@ import {
2
2
  localRepoKey,
3
3
  normalizeRepoRemote,
4
4
  parseGitBranch
5
- } from "./chunk-MGGN37IW.js";
5
+ } from "./chunk-VZVKJP3Q.js";
6
6
 
7
7
  // src/repo.ts
8
8
  import { existsSync, readFileSync, statSync } from "fs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isFinalCommandAckRefusal
3
- } from "./chunk-MGGN37IW.js";
3
+ } from "./chunk-VZVKJP3Q.js";
4
4
 
5
5
  // src/command-ack-outcome.ts
6
6
  var SETTLED_ACK = { outcome: "settled" };
@@ -1,35 +1,35 @@
1
1
  import {
2
2
  MANAGED_CLAUDE_SETTINGS_BY_PLATFORM
3
- } from "./chunk-NKSOSZZU.js";
3
+ } from "./chunk-23ELMB2F.js";
4
4
  import {
5
5
  declinedAgentsFile,
6
6
  readDeclinedAgents
7
- } from "./chunk-QRPHWWHI.js";
7
+ } from "./chunk-WYYHSHBO.js";
8
8
  import {
9
9
  OPENCODE_HOOK_BINARY,
10
10
  openCodeConfigDir,
11
11
  openCodePluginFile
12
- } from "./chunk-SO5DEUCS.js";
12
+ } from "./chunk-V6MQUYE2.js";
13
13
  import {
14
14
  openCodePluginArgv
15
- } from "./chunk-SSW4SERP.js";
15
+ } from "./chunk-IMSFJFN6.js";
16
16
  import {
17
17
  liveCursorGateCoverage
18
- } from "./chunk-5AL5W2HQ.js";
18
+ } from "./chunk-QWSXLYTX.js";
19
19
  import {
20
20
  compatibleConfigFile,
21
21
  compatibleHookEvents,
22
22
  grokHome
23
- } from "./chunk-DN7PXEXE.js";
23
+ } from "./chunk-HZ76NLD2.js";
24
24
  import {
25
25
  parseConfigDocument
26
- } from "./chunk-WFE4RAWD.js";
26
+ } from "./chunk-RA4RSVVJ.js";
27
27
  import {
28
28
  DEFAULT_HOOKS_KEY_PATH,
29
29
  GEMINI_HOOK_BINARY,
30
30
  GEMINI_HOOK_EVENTS,
31
31
  hooksAt
32
- } from "./chunk-T6ZGTBHT.js";
32
+ } from "./chunk-5K5MT22J.js";
33
33
  import {
34
34
  CODEX_EARLIER_APPROVAL_MATCHERS,
35
35
  CODEX_HOOK_BINARY,
@@ -57,7 +57,7 @@ import {
57
57
  parseHookArgv,
58
58
  parseHookCommand,
59
59
  supportedClaudeEvents
60
- } from "./chunk-ZGPUVZZ6.js";
60
+ } from "./chunk-AURPPDRZ.js";
61
61
  import {
62
62
  readRegularJsonFile,
63
63
  readRegularTextFile
@@ -71,7 +71,7 @@ import {
71
71
  OPENCODE_APPROVAL_EVENT,
72
72
  isRecord,
73
73
  matcherMatchesEveryCall
74
- } from "./chunk-MGGN37IW.js";
74
+ } from "./chunk-VZVKJP3Q.js";
75
75
 
76
76
  // src/hook-wiring.ts
77
77
  import { createHash } from "crypto";
@@ -4,16 +4,16 @@ import {
4
4
  } from "./chunk-WHB622LP.js";
5
5
  import {
6
6
  keyPrefix
7
- } from "./chunk-BLSGQHGW.js";
7
+ } from "./chunk-K5ZEJCJO.js";
8
8
  import {
9
9
  keyPrefixToShow
10
- } from "./chunk-AKGNLKZP.js";
10
+ } from "./chunk-WV7OME3F.js";
11
11
  import {
12
12
  NPX_LATEST_COMMAND
13
- } from "./chunk-3DW5OCS2.js";
13
+ } from "./chunk-APTFA4KF.js";
14
14
  import {
15
15
  isValidApiKey
16
- } from "./chunk-MGGN37IW.js";
16
+ } from "./chunk-VZVKJP3Q.js";
17
17
 
18
18
  // src/setup/key-account.ts
19
19
  var isKeyHeldByMacApp = (key, holder) => holder.macAppInstalled && holder.macAppKey === key;
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  projectNameFor
3
- } from "./chunk-I2DSQVSB.js";
3
+ } from "./chunk-EVJ5DPRU.js";
4
4
  import {
5
5
  readConfigFileKey
6
- } from "./chunk-BLSGQHGW.js";
6
+ } from "./chunk-K5ZEJCJO.js";
7
7
 
8
8
  // src/bell/fleet.ts
9
9
  import { closeSync, constants, futimesSync, lstatSync, mkdirSync, openSync, readdirSync, unlinkSync } from "fs";
@@ -6,17 +6,17 @@ import {
6
6
  postLiveSession,
7
7
  postLiveSessionUntilAccepted,
8
8
  startLiveSessionHeartbeat
9
- } from "./chunk-RSV25NAF.js";
9
+ } from "./chunk-HB3S3KDX.js";
10
10
  import {
11
11
  CommandReceipts,
12
12
  controllerCommandSchema
13
- } from "./chunk-Q3JHO3EJ.js";
13
+ } from "./chunk-SG4IFPJP.js";
14
14
  import {
15
15
  SESSION_IDLE_TIMEOUT_MS,
16
16
  describeIdleWindow,
17
17
  idleDeadlinePassed,
18
18
  startProcessOwnership
19
- } from "./chunk-NVYEQLD5.js";
19
+ } from "./chunk-VDPUBIL2.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-TX3IJUL7.js";
28
+ } from "./chunk-RX75OG6S.js";
29
29
  import {
30
30
  readCommandAck
31
- } from "./chunk-GAKYGHUR.js";
31
+ } from "./chunk-F6LNIS2Y.js";
32
32
  import {
33
33
  callMcpTool,
34
34
  isRetryable
35
- } from "./chunk-3PAM7BQJ.js";
35
+ } from "./chunk-C4D6R27P.js";
36
36
  import {
37
37
  projectNameFor,
38
38
  repositoryScopeFor
39
- } from "./chunk-I2DSQVSB.js";
39
+ } from "./chunk-EVJ5DPRU.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-MGGN37IW.js";
61
+ } from "./chunk-VZVKJP3Q.js";
62
62
 
63
63
  // src/codex-question-owner.ts
64
64
  import { createHash } from "crypto";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-POFBE6ZY.js";
4
4
  import {
5
5
  autoUpdateState
6
- } from "./chunk-ZGPUVZZ6.js";
6
+ } from "./chunk-AURPPDRZ.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-MGGN37IW.js";
20
+ } from "./chunk-VZVKJP3Q.js";
21
21
 
22
22
  // src/auto-update.ts
23
23
  import { spawn } from "child_process";
@@ -10,7 +10,7 @@ import {
10
10
  uploadTranscriptRecords,
11
11
  verifyAnchoredRecipients,
12
12
  wrapSessionKey
13
- } from "./chunk-2VTIVLLK.js";
13
+ } from "./chunk-WOEMRT24.js";
14
14
 
15
15
  // src/live-session.ts
16
16
  var LIVE_TRANSCRIPT_LIMITS = { queuedRecords: 100, recordCharacters: 32 * 1024 };
@@ -4,21 +4,21 @@ import {
4
4
  claimThrottle,
5
5
  releaseThrottle,
6
6
  reportEvent
7
- } from "./chunk-H6FDFP6W.js";
7
+ } from "./chunk-DIHUVYT2.js";
8
8
  import {
9
9
  deriveToolTarget,
10
10
  permissionDeniedAction
11
- } from "./chunk-N2IP7IDG.js";
11
+ } from "./chunk-HVY3YUJU.js";
12
12
  import {
13
13
  projectNameFor
14
- } from "./chunk-I2DSQVSB.js";
14
+ } from "./chunk-EVJ5DPRU.js";
15
15
  import {
16
16
  PERMISSION_ALLOWED_EVENT,
17
17
  PERMISSION_DENIED_EVENT,
18
18
  machineApprovalFor,
19
19
  machineDecisionFor,
20
20
  wireVerdictFor
21
- } from "./chunk-MGGN37IW.js";
21
+ } from "./chunk-VZVKJP3Q.js";
22
22
 
23
23
  // src/machine-decision-audit.ts
24
24
  var MACHINE_DECISION_REPORT_TIMEOUT_MS = 800;