pushary 1.9.85 → 1.9.86

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 (126) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/{api-4WEMR2G3.js → api-ZDMC22LN.js} +10 -10
  3. package/dist/bin/pushary-bell-hook.js +26 -26
  4. package/dist/bin/pushary-bell.js +10 -10
  5. package/dist/bin/pushary-claude.js +27 -27
  6. package/dist/bin/pushary-clean.js +34 -34
  7. package/dist/bin/pushary-codex-bridge.js +21 -21
  8. package/dist/bin/pushary-codex-hook.js +33 -32
  9. package/dist/bin/pushary-codex-session.js +8 -8
  10. package/dist/bin/pushary-codex.js +14 -14
  11. package/dist/bin/pushary-connect.js +27 -27
  12. package/dist/bin/pushary-cowork.js +5 -5
  13. package/dist/bin/pushary-daemon.js +39 -39
  14. package/dist/bin/pushary-disconnect.js +26 -26
  15. package/dist/bin/pushary-display-hook.js +17 -17
  16. package/dist/bin/pushary-doctor.js +42 -42
  17. package/dist/bin/pushary-elicitation-hook.js +26 -26
  18. package/dist/bin/pushary-gemini-bridge.js +15 -15
  19. package/dist/bin/pushary-gemini-hook.js +28 -28
  20. package/dist/bin/pushary-hook.js +30 -30
  21. package/dist/bin/pushary-login.js +20 -20
  22. package/dist/bin/pushary-logout.js +25 -25
  23. package/dist/bin/pushary-mcp.js +11 -11
  24. package/dist/bin/pushary-mode.js +15 -15
  25. package/dist/bin/pushary-notification-hook.js +25 -25
  26. package/dist/bin/pushary-opencode-hook.js +27 -27
  27. package/dist/bin/pushary-permission-denied-hook.js +30 -30
  28. package/dist/bin/pushary-permission-hook.js +30 -30
  29. package/dist/bin/pushary-post-hook.js +25 -25
  30. package/dist/bin/pushary-prompt-hook.js +25 -25
  31. package/dist/bin/pushary-session-end-hook.js +27 -27
  32. package/dist/bin/pushary-session-start-hook.js +35 -35
  33. package/dist/bin/pushary-setup.js +48 -48
  34. package/dist/bin/pushary-stats.js +5 -5
  35. package/dist/bin/pushary-status.js +32 -32
  36. package/dist/bin/pushary-stop-hook.js +25 -25
  37. package/dist/bin/pushary-stopfailure-hook.js +25 -25
  38. package/dist/bin/pushary-suggestions.js +15 -15
  39. package/dist/bin/pushary-transcript-register.js +18 -18
  40. package/dist/bin/pushary-transcripts.js +26 -26
  41. package/dist/bin/pushary-upgrade.js +40 -40
  42. package/dist/bin/pushary-wait.js +15 -15
  43. package/dist/bin/pushary.js +7 -7
  44. package/dist/{chunk-ZWKF7WE4.js → chunk-2CJNGJQS.js} +4 -4
  45. package/dist/{chunk-FSSA76HW.js → chunk-2JTWOTOC.js} +1 -1
  46. package/dist/{chunk-254B34JU.js → chunk-33RQ7I3K.js} +1 -1
  47. package/dist/{chunk-7ZYVX2KN.js → chunk-3ZWJBPQ5.js} +1 -1
  48. package/dist/{chunk-TD5PW2VI.js → chunk-42KJLBX2.js} +6 -6
  49. package/dist/{chunk-7GYDMVHV.js → chunk-4PS27SCG.js} +2 -2
  50. package/dist/{chunk-JLJWVKMJ.js → chunk-4RZXECJS.js} +10 -10
  51. package/dist/{chunk-VJZGR4N3.js → chunk-4VHT5SWU.js} +5 -5
  52. package/dist/{chunk-JHWOM55B.js → chunk-5TLDFPW6.js} +4 -1
  53. package/dist/{chunk-64XK7DLE.js → chunk-5YDIHB67.js} +3 -3
  54. package/dist/{chunk-CSOVOAX5.js → chunk-6OVWYAET.js} +6 -6
  55. package/dist/{chunk-HWT42Z4O.js → chunk-7AH6F44G.js} +5 -5
  56. package/dist/{chunk-HVZJ2EEI.js → chunk-7LRY76MV.js} +6 -6
  57. package/dist/{chunk-V4JZHAOY.js → chunk-7SY2F6JA.js} +2 -2
  58. package/dist/{chunk-RPNT4D3K.js → chunk-7TZDVGMC.js} +1 -1
  59. package/dist/{chunk-Z75D2NJN.js → chunk-B34K6NXW.js} +3 -3
  60. package/dist/{chunk-EX33ZFJ6.js → chunk-CT2HRZLL.js} +3 -3
  61. package/dist/{chunk-W2IRYDG5.js → chunk-D766FEAS.js} +4 -4
  62. package/dist/{chunk-HARHFDZM.js → chunk-D7ZJ3AUK.js} +1 -1
  63. package/dist/{chunk-UGELL4RB.js → chunk-DWUD47H5.js} +2 -2
  64. package/dist/{chunk-DNBBWBYA.js → chunk-E5DZ74QT.js} +5 -5
  65. package/dist/{chunk-SAPRO7FI.js → chunk-FE3I7SCA.js} +6 -6
  66. package/dist/{chunk-2VZY5XQ5.js → chunk-FQ2EBMDA.js} +7 -7
  67. package/dist/{chunk-BGMYSRMY.js → chunk-GAYYYXMU.js} +1 -1
  68. package/dist/{chunk-G2GOVKBU.js → chunk-GPP7AUCM.js} +6 -6
  69. package/dist/{chunk-5Z43EFX2.js → chunk-GVMOTYFU.js} +2 -2
  70. package/dist/{chunk-OSEGZLCO.js → chunk-GVZAEST7.js} +3 -3
  71. package/dist/{chunk-GWHZUHIK.js → chunk-IOJZPPDB.js} +1 -1
  72. package/dist/{chunk-EKWDNEPN.js → chunk-IXUJCONI.js} +3 -3
  73. package/dist/{chunk-ZUZ7NTWO.js → chunk-JILOKJ3W.js} +57 -18
  74. package/dist/{chunk-ZHL6F2KC.js → chunk-K34J2V5G.js} +3 -3
  75. package/dist/{chunk-YU5ACKJP.js → chunk-K4I2LESS.js} +4 -4
  76. package/dist/{chunk-GGGOFJBL.js → chunk-KWWHFTNJ.js} +1 -1
  77. package/dist/{chunk-ZNFAF74M.js → chunk-KXGKUV2F.js} +1 -1
  78. package/dist/{chunk-WRKRZJCW.js → chunk-LXTTFH4P.js} +7 -7
  79. package/dist/{chunk-FNC4SPOD.js → chunk-M66W7UD7.js} +2 -2
  80. package/dist/{chunk-TSCFJJIB.js → chunk-MY6CX7WE.js} +6 -6
  81. package/dist/{chunk-YQCCJ6U5.js → chunk-NFKB7ZHA.js} +3 -3
  82. package/dist/{chunk-TNPKYKXU.js → chunk-NFQCFVKJ.js} +3 -3
  83. package/dist/{chunk-JSZT4Q23.js → chunk-NP65LEAY.js} +1 -1
  84. package/dist/{chunk-OKWHHDV5.js → chunk-NW3GZBQA.js} +5 -5
  85. package/dist/{chunk-OGTZ7JR7.js → chunk-OUIUIJV4.js} +1 -1
  86. package/dist/{chunk-POKCUYIQ.js → chunk-P4W5TP2X.js} +1 -1
  87. package/dist/{chunk-SBK7WGSE.js → chunk-QN2EFKXV.js} +2 -2
  88. package/dist/{chunk-QSDZE2B7.js → chunk-R5SANCZC.js} +5 -5
  89. package/dist/{chunk-UWL6VVE3.js → chunk-RHDHLXUK.js} +4 -4
  90. package/dist/{chunk-UIDWJ24H.js → chunk-RKN7BJRQ.js} +1 -1
  91. package/dist/{chunk-TZDEHPYZ.js → chunk-RKX2ZOIG.js} +1 -1
  92. package/dist/{chunk-QF6OJUWQ.js → chunk-RPXPRBBA.js} +1 -1
  93. package/dist/{chunk-CZ7C5AJT.js → chunk-S33CCO4J.js} +1 -1
  94. package/dist/{chunk-TFJQAPIA.js → chunk-SLMCMHVY.js} +2 -2
  95. package/dist/{chunk-6HBWJXU6.js → chunk-STQEIEYJ.js} +3 -3
  96. package/dist/{chunk-FRPR4OTH.js → chunk-TQ43EX2E.js} +4 -4
  97. package/dist/{chunk-3MWQZKIO.js → chunk-TXJ65MIV.js} +1 -1
  98. package/dist/{chunk-4QGV3II7.js → chunk-UAB3K3TA.js} +4 -4
  99. package/dist/{chunk-4J3NGYHG.js → chunk-UDYWZ4DI.js} +2 -2
  100. package/dist/{chunk-CIICMXVH.js → chunk-UOM5SUWJ.js} +3 -3
  101. package/dist/{chunk-BUS7MXEE.js → chunk-VADZ6C26.js} +3 -3
  102. package/dist/{chunk-LUSWC2MV.js → chunk-VNROKR2K.js} +3 -3
  103. package/dist/{chunk-QG5Y5A36.js → chunk-VNYSGRCL.js} +10 -10
  104. package/dist/{chunk-4TMKTLQX.js → chunk-VU5PKE2N.js} +1 -1
  105. package/dist/{chunk-H6IJOGDH.js → chunk-WJ2APMU5.js} +4 -4
  106. package/dist/{chunk-42DNYOC4.js → chunk-X5INK4OE.js} +14 -14
  107. package/dist/{chunk-JJCMQRBF.js → chunk-XGW7J7KT.js} +3 -3
  108. package/dist/{chunk-HLAW7HUT.js → chunk-XMRCP7TM.js} +2 -2
  109. package/dist/{chunk-4OP5GWHQ.js → chunk-XPE745FL.js} +5 -5
  110. package/dist/{chunk-PHBZK4SC.js → chunk-YLWPJ2MP.js} +2 -2
  111. package/dist/{chunk-BS5MTP34.js → chunk-YRQWA4ZS.js} +2 -2
  112. package/dist/{chunk-VVWL6AB4.js → chunk-ZLO3K5TP.js} +5 -5
  113. package/dist/{chunk-VD24OIWR.js → chunk-ZUIAABLS.js} +1 -1
  114. package/dist/{codex-app-cards-switch-26N5XSSZ.js → codex-app-cards-switch-ARYZG5DV.js} +11 -11
  115. package/dist/{codex-desktop-launch-UU6CPB2I.js → codex-desktop-launch-6P2IXUIZ.js} +1 -1
  116. package/dist/{codex-session-launch-66LBR4MG.js → codex-session-launch-WUZSHGSI.js} +18 -18
  117. package/dist/{config-ESAAVJWO.js → config-ZDOHQUNU.js} +3 -3
  118. package/dist/{global-upgrade-QJONTWQI.js → global-upgrade-QGHGUP5V.js} +10 -10
  119. package/dist/{identity-IZVPSC7B.js → identity-WRUYTQ4O.js} +4 -4
  120. package/dist/{live-capabilities-OEUPZX67.js → live-capabilities-AJJILIIZ.js} +5 -5
  121. package/dist/{paths-GDWS3B46.js → paths-Q5A6GBRA.js} +3 -3
  122. package/dist/{reapply-P2VOZGWQ.js → reapply-BMNUBJ3Z.js} +28 -28
  123. package/dist/src/index.js +29 -29
  124. package/dist/{upgrade-lock-3QABNXBZ.js → upgrade-lock-NGCFJRRN.js} +4 -4
  125. package/dist/{usage-KDRZPUZS.js → usage-3EPWR2WQ.js} +3 -3
  126. package/package.json +1 -1
@@ -1,25 +1,25 @@
1
1
  import {
2
2
  registerTranscript
3
- } from "./chunk-ZUZ7NTWO.js";
3
+ } from "./chunk-JILOKJ3W.js";
4
4
  import {
5
5
  namedEvent
6
- } from "./chunk-VJZGR4N3.js";
6
+ } from "./chunk-4VHT5SWU.js";
7
7
  import {
8
8
  isBridgeLocator,
9
9
  liveBridgeProbe,
10
10
  pusharyHookExecutable,
11
11
  resolveBridgeStub
12
- } from "./chunk-YU5ACKJP.js";
12
+ } from "./chunk-K4I2LESS.js";
13
13
  import {
14
14
  writeDegraded
15
- } from "./chunk-HWT42Z4O.js";
15
+ } from "./chunk-7AH6F44G.js";
16
16
  import {
17
17
  cursorUserHooks
18
- } from "./chunk-PHBZK4SC.js";
18
+ } from "./chunk-YLWPJ2MP.js";
19
19
  import {
20
20
  atLeast,
21
21
  parseVersion
22
- } from "./chunk-64XK7DLE.js";
22
+ } from "./chunk-5YDIHB67.js";
23
23
  import {
24
24
  CURSOR_GATE_COVERAGE,
25
25
  CURSOR_GATE_SCRIPT,
@@ -33,7 +33,7 @@ import {
33
33
  isGrokSessionEndStop,
34
34
  isRecord,
35
35
  toolsCoveredByGateEntry
36
- } from "./chunk-JHWOM55B.js";
36
+ } from "./chunk-5TLDFPW6.js";
37
37
 
38
38
  // src/tool-hook-input.ts
39
39
  var OPTIONAL_TEXT_FIELDS = ["hook_event_name", "session_id", "cwd", "transcript_path", "tool_use_id", "permission_mode", "cursor_version"];
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  readConfigFileKey
3
- } from "./chunk-FRPR4OTH.js";
3
+ } from "./chunk-TQ43EX2E.js";
4
4
 
5
5
  // src/bell/fleet.ts
6
6
  import { closeSync, constants, futimesSync, lstatSync, mkdirSync, openSync, readdirSync, unlinkSync } from "fs";
@@ -1,24 +1,24 @@
1
1
  import {
2
2
  APPROVAL_RULES_PATH,
3
3
  canChangeApprovalSettings
4
- } from "./chunk-BS5MTP34.js";
4
+ } from "./chunk-YRQWA4ZS.js";
5
5
  import {
6
6
  callMcpTool
7
- } from "./chunk-ZWKF7WE4.js";
7
+ } from "./chunk-2CJNGJQS.js";
8
8
  import {
9
9
  absoluteUrl
10
- } from "./chunk-BUS7MXEE.js";
10
+ } from "./chunk-VADZ6C26.js";
11
11
  import {
12
12
  getBaseUrl
13
- } from "./chunk-JSZT4Q23.js";
13
+ } from "./chunk-NP65LEAY.js";
14
14
  import {
15
15
  NPX_LATEST_COMMAND
16
- } from "./chunk-GGGOFJBL.js";
16
+ } from "./chunk-KWWHFTNJ.js";
17
17
  import {
18
18
  APPROVAL_MODE_META,
19
19
  classifyConfirmResponse,
20
20
  isAnswerSource
21
- } from "./chunk-JHWOM55B.js";
21
+ } from "./chunk-5TLDFPW6.js";
22
22
 
23
23
  // src/reach.ts
24
24
  var reachVerdict = (channels) => {
@@ -7,10 +7,10 @@ import {
7
7
  codexHome,
8
8
  codexHooksJsonIn,
9
9
  isPusharyCodexCommand
10
- } from "./chunk-PHBZK4SC.js";
10
+ } from "./chunk-YLWPJ2MP.js";
11
11
  import {
12
12
  resolvePathBinary
13
- } from "./chunk-64XK7DLE.js";
13
+ } from "./chunk-5YDIHB67.js";
14
14
  import {
15
15
  getPackageVersion
16
16
  } from "./chunk-ZVU6WMMU.js";
@@ -9,20 +9,20 @@ import {
9
9
  installedCodexApp,
10
10
  readCodexAppRuntime,
11
11
  shellQuoted
12
- } from "./chunk-FNC4SPOD.js";
12
+ } from "./chunk-M66W7UD7.js";
13
13
  import {
14
14
  writeHuman
15
15
  } from "./chunk-QCGNGEGE.js";
16
16
  import {
17
17
  xml
18
- } from "./chunk-SAPRO7FI.js";
18
+ } from "./chunk-FE3I7SCA.js";
19
19
  import {
20
20
  CODEX_APP_LAUNCH_AT_LOGIN_VERB,
21
21
  CODEX_APP_LAUNCH_VARIABLE
22
22
  } from "./chunk-E46NE7FB.js";
23
23
  import {
24
24
  writeFileAtomic
25
- } from "./chunk-64XK7DLE.js";
25
+ } from "./chunk-5YDIHB67.js";
26
26
 
27
27
  // src/codex-app-cards-switch.ts
28
28
  import { execFileSync as execFileSync2 } from "child_process";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  readTranscriptPreference
3
- } from "./chunk-FRPR4OTH.js";
3
+ } from "./chunk-TQ43EX2E.js";
4
4
 
5
5
  // src/transcript-setting.ts
6
6
  var transcriptEnvironmentPreference = () => {
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  readJsonSafe,
3
3
  writeJsonAtomic
4
- } from "./chunk-64XK7DLE.js";
4
+ } from "./chunk-5YDIHB67.js";
5
5
  import {
6
6
  configFilePath
7
- } from "./chunk-JSZT4Q23.js";
7
+ } from "./chunk-NP65LEAY.js";
8
8
  import {
9
9
  readSetupOutcomeProperties
10
- } from "./chunk-JHWOM55B.js";
10
+ } from "./chunk-5TLDFPW6.js";
11
11
 
12
12
  // src/diagnostics/service-runtime.ts
13
13
  var unescapeXml = (value) => value.replaceAll("&quot;", '"').replaceAll("&apos;", "'").replaceAll("&lt;", "<").replaceAll("&gt;", ">").replaceAll("&amp;", "&");
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  SESSION_HISTORY_RETENTION_DAYS,
3
3
  savedTranscriptReadPositions
4
- } from "./chunk-4TMKTLQX.js";
4
+ } from "./chunk-VU5PKE2N.js";
5
5
  import {
6
6
  ensureDaemonRunning
7
- } from "./chunk-SAPRO7FI.js";
7
+ } from "./chunk-FE3I7SCA.js";
8
8
  import {
9
9
  hookOwnerOf
10
- } from "./chunk-YU5ACKJP.js";
10
+ } from "./chunk-K4I2LESS.js";
11
11
  import {
12
12
  buildTranscriptRecords,
13
13
  decodePublicKey,
@@ -18,33 +18,33 @@ import {
18
18
  recordSealerFor,
19
19
  uploadTranscriptRecords,
20
20
  wrapSessionKey
21
- } from "./chunk-7GYDMVHV.js";
21
+ } from "./chunk-4PS27SCG.js";
22
22
  import {
23
23
  external_exports
24
24
  } from "./chunk-XMSDA5WA.js";
25
25
  import {
26
26
  transcriptEnvironmentPreference,
27
27
  transcriptsEnabled
28
- } from "./chunk-GWHZUHIK.js";
28
+ } from "./chunk-IOJZPPDB.js";
29
29
  import {
30
30
  readTranscriptPreference
31
- } from "./chunk-FRPR4OTH.js";
31
+ } from "./chunk-TQ43EX2E.js";
32
32
  import {
33
33
  hookMeaning
34
- } from "./chunk-3MWQZKIO.js";
34
+ } from "./chunk-TXJ65MIV.js";
35
35
  import {
36
36
  claudeConfigDir,
37
37
  codexHome,
38
38
  pusharyDir
39
- } from "./chunk-PHBZK4SC.js";
39
+ } from "./chunk-YLWPJ2MP.js";
40
40
  import {
41
41
  writeJsonAtomic,
42
42
  writeJsonAtomicDurable
43
- } from "./chunk-64XK7DLE.js";
43
+ } from "./chunk-5YDIHB67.js";
44
44
  import {
45
45
  getApiKey,
46
46
  getBaseUrl
47
- } from "./chunk-JSZT4Q23.js";
47
+ } from "./chunk-NP65LEAY.js";
48
48
  import {
49
49
  PENDING_COMMAND_PREFIX,
50
50
  SESSION_HISTORY_BACKFILL_LIMIT_BYTES,
@@ -52,7 +52,7 @@ import {
52
52
  isHookSource,
53
53
  isRecord,
54
54
  redactSecretsFromContent
55
- } from "./chunk-JHWOM55B.js";
55
+ } from "./chunk-5TLDFPW6.js";
56
56
 
57
57
  // src/transcript-recipient-pin.ts
58
58
  import { existsSync, mkdirSync, readFileSync, rmSync } from "fs";
@@ -642,12 +642,12 @@ var parseHermesSnapshot = (text, sessionId, nowMs) => {
642
642
  };
643
643
 
644
644
  // src/transcript-snapshot-file.ts
645
- var MAXIMUM_SNAPSHOT_MESSAGES = 5e3;
645
+ var MAXIMUM_SNAPSHOT_FILE_BYTES = 64e6;
646
646
  var readTranscriptSnapshot = (path, source, sessionId) => {
647
647
  const descriptor = openSync2(path, "r");
648
648
  try {
649
649
  const before = fstatSync2(descriptor);
650
- if (!before.isFile() || before.size === 0 || before.size > SESSION_HISTORY_BACKFILL_LIMIT_BYTES) throw new Error("History snapshot is empty or exceeds its size limit");
650
+ if (!before.isFile() || before.size === 0 || before.size > MAXIMUM_SNAPSHOT_FILE_BYTES) throw new Error("History snapshot is empty or exceeds its size limit");
651
651
  const text = readFileSync4(descriptor, "utf8");
652
652
  const after = fstatSync2(descriptor);
653
653
  if (before.size !== after.size || before.mtimeMs !== after.mtimeMs) throw new Error("History snapshot changed while reading");
@@ -663,7 +663,6 @@ var readTranscriptSnapshot = (path, source, sessionId) => {
663
663
  messages = parseHermesSnapshot(text, sessionId, Date.now());
664
664
  break;
665
665
  }
666
- if (messages.length > MAXIMUM_SNAPSHOT_MESSAGES) throw new Error("History snapshot exceeds its message limit");
667
666
  return messages;
668
667
  } finally {
669
668
  closeSync2(descriptor);
@@ -676,7 +675,27 @@ import { dirname as dirname2 } from "path";
676
675
 
677
676
  // src/transcript-projection.ts
678
677
  import { createHash as createHash2 } from "crypto";
679
- var projectTranscriptSnapshot = (previous, messages) => {
678
+ var newestWithinUploadLimits = (messages, limits) => {
679
+ let start = messages.length;
680
+ let contentBytes = 0;
681
+ for (const message of [...messages].reverse()) {
682
+ if (messages.length - start >= limits.messages) break;
683
+ contentBytes += Buffer.byteLength(JSON.stringify(message.content));
684
+ if (contentBytes > limits.contentBytes && start < messages.length) break;
685
+ start -= 1;
686
+ }
687
+ return { newest: messages.slice(start), olderIds: messages.slice(0, start).map((message) => message.id) };
688
+ };
689
+ var partitionOlderTurns = (olderIds, recorded, maximumTracked) => {
690
+ const tracked = /* @__PURE__ */ new Set();
691
+ const excluded = [];
692
+ for (const id of [...olderIds].reverse()) {
693
+ if (Object.hasOwn(recorded, id) && tracked.size < maximumTracked) tracked.add(id);
694
+ else excluded.push(id);
695
+ }
696
+ return { tracked, excluded };
697
+ };
698
+ var projectTranscriptSnapshot = (previous, messages, older) => {
680
699
  const revision = (previous?.revision ?? 0) + 1;
681
700
  const entries = /* @__PURE__ */ Object.create(null);
682
701
  const lines = [];
@@ -692,6 +711,11 @@ var projectTranscriptSnapshot = (previous, messages) => {
692
711
  }
693
712
  for (const [id, entry] of Object.entries(previous?.entries ?? {})) {
694
713
  if (Object.hasOwn(entries, id)) continue;
714
+ if (older.tracked.has(id)) {
715
+ entries[id] = entry;
716
+ continue;
717
+ }
718
+ if (older.present.has(id)) continue;
695
719
  lines.push(JSON.stringify({ historySource: { id, order: entry.order, removed: true }, historyRevision: revision }));
696
720
  }
697
721
  return { lines, next: { revision: lines.length ? revision : previous?.revision ?? 0, entries } };
@@ -699,6 +723,8 @@ var projectTranscriptSnapshot = (previous, messages) => {
699
723
 
700
724
  // src/transcript-snapshot-journal.ts
701
725
  var MAXIMUM_JOURNAL_BYTES = 64 * 1024 * 1024;
726
+ var SNAPSHOT_UPLOAD_LIMITS = { messages: 5e3, contentBytes: SESSION_HISTORY_BACKFILL_LIMIT_BYTES };
727
+ var MAXIMUM_TRACKED_OLDER_TURNS = 2e4;
702
728
  var projectionSchema = external_exports.object({
703
729
  revision: external_exports.number().int().nonnegative(),
704
730
  entries: external_exports.record(external_exports.string(), external_exports.object({ digest: external_exports.string().regex(/^[a-f0-9]{64}$/), order: external_exports.number().int().nonnegative() }))
@@ -740,9 +766,15 @@ var TranscriptSnapshotJournal = class {
740
766
  if (!message.timestamp && !excluded.has(message.id) && !Object.hasOwn(observedAtMs, message.id)) observedAtMs[message.id] = nowMs;
741
767
  }
742
768
  const allowed = messages.flatMap((message, sourcePosition) => !excluded.has(message.id) && (message.timestamp ? Date.parse(message.timestamp) : observedAtMs[message.id] ?? 0) >= oldestMessageMs ? [{ ...message.timestamp ? message : { ...message, observedAtMs: observedAtMs[message.id] }, sourcePosition }] : []);
743
- const projected = projectTranscriptSnapshot(this.current.projection, allowed);
769
+ const split = newestWithinUploadLimits(allowed, SNAPSHOT_UPLOAD_LIMITS);
770
+ const older = partitionOlderTurns(split.olderIds, this.current.projection?.entries ?? {}, MAXIMUM_TRACKED_OLDER_TURNS);
771
+ for (const id of older.excluded) {
772
+ excluded.add(id);
773
+ delete observedAtMs[id];
774
+ }
775
+ const projected = projectTranscriptSnapshot(this.current.projection, split.newest, { present: new Set(split.olderIds), tracked: older.tracked });
744
776
  if (projected.lines.length === 0) {
745
- const metadataChanged = excluded.size !== this.current.excludedIds.length || Object.keys(observedAtMs).length !== Object.keys(this.current.observedAtMs).length;
777
+ const metadataChanged = excluded.size !== this.current.excludedIds.length || this.current.excludedIds.some((id) => !excluded.has(id)) || Object.keys(observedAtMs).length !== Object.keys(this.current.observedAtMs).length;
746
778
  if (!this.current.initialized || metadataChanged) this.store({ ...this.current, initialized: true, observedAtMs, excludedIds: [...excluded], projection: projected.next, pending: null });
747
779
  return [];
748
780
  }
@@ -874,6 +906,9 @@ var appendOnlyReader = (path, source, epoch) => ({
874
906
  };
875
907
  }
876
908
  });
909
+ var UNCHANGED_SNAPSHOT_REREAD_MS = 6e4;
910
+ var caughtUpReadStillCurrent = (caughtUp, version, nowMs) => caughtUp !== null && caughtUp.version === version && nowMs >= caughtUp.atMs && nowMs - caughtUp.atMs < UNCHANGED_SNAPSHOT_REREAD_MS;
911
+ var UNCHANGED_SNAPSHOT_READ = { lines: [], acknowledge: () => "unchanged" };
877
912
  var snapshotReader = (options, source) => {
878
913
  const { path, epoch } = options;
879
914
  const binding = createHash3("sha256").update(JSON.stringify([options.baseUrl, options.apiKey, options.machineId, options.sessionId, source, path])).digest("hex");
@@ -881,6 +916,7 @@ var snapshotReader = (options, source) => {
881
916
  const epochStart = epoch?.startedAtMs ?? 0;
882
917
  const backfill = epoch ? epoch.backfill : SESSION_HISTORY_BACKFILL;
883
918
  let journal;
919
+ let caughtUp = null;
884
920
  return {
885
921
  requiresRevisions: true,
886
922
  read(retentionDays, nowMs) {
@@ -888,12 +924,15 @@ var snapshotReader = (options, source) => {
888
924
  const oldestMessage = oldestTranscriptLineMs(epochStart, backfill, retentionDays, nowMs);
889
925
  const pending = checkpoint.pendingLinesSince(oldestMessage);
890
926
  const version = pending === null ? sourceVersion(path) : null;
927
+ if (version !== null && caughtUpReadStillCurrent(caughtUp, version, nowMs)) return UNCHANGED_SNAPSHOT_READ;
891
928
  const lines = pending ?? checkpoint.prepare(readTranscriptSnapshot(path, source, options.sessionId), oldestMessage, nowMs);
892
929
  return {
893
930
  lines,
894
931
  acknowledge() {
895
932
  checkpoint.settle();
896
- return version === null || sourceVersion(path) !== version ? "more" : "caught_up";
933
+ const progress = version === null || sourceVersion(path) !== version ? "more" : "caught_up";
934
+ caughtUp = progress === "caught_up" && version !== null ? { version, atMs: nowMs } : null;
935
+ return progress;
897
936
  }
898
937
  };
899
938
  }
@@ -3,11 +3,11 @@ import {
3
3
  } from "./chunk-POFBE6ZY.js";
4
4
  import {
5
5
  autoUpdateState
6
- } from "./chunk-PHBZK4SC.js";
6
+ } from "./chunk-YLWPJ2MP.js";
7
7
  import {
8
8
  readJsonSafe,
9
9
  writeJsonAtomic
10
- } from "./chunk-64XK7DLE.js";
10
+ } from "./chunk-5YDIHB67.js";
11
11
  import {
12
12
  CLI_PACKAGE_NAMES,
13
13
  POSIX_GLOBAL_ROOT_SEGMENTS,
@@ -17,7 +17,7 @@ import {
17
17
  } from "./chunk-ZVU6WMMU.js";
18
18
  import {
19
19
  isAutoUpdateResult
20
- } from "./chunk-JHWOM55B.js";
20
+ } from "./chunk-5TLDFPW6.js";
21
21
 
22
22
  // src/auto-update.ts
23
23
  import { spawn } from "child_process";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  AGENT_CHOICES
3
- } from "./chunk-HARHFDZM.js";
3
+ } from "./chunk-D7ZJ3AUK.js";
4
4
  import {
5
5
  BELL_HOOK_BINARY
6
- } from "./chunk-RPNT4D3K.js";
6
+ } from "./chunk-7TZDVGMC.js";
7
7
  import {
8
8
  CLAUDE_HOOK_EVENTS,
9
9
  CODEX_HOOK_EVENTS,
@@ -13,13 +13,13 @@ import {
13
13
  hookBinaryNameOf,
14
14
  isProtectedByScope,
15
15
  registerHookEntry
16
- } from "./chunk-PHBZK4SC.js";
16
+ } from "./chunk-YLWPJ2MP.js";
17
17
  import {
18
18
  CURSOR_GATE_EVENTS,
19
19
  HOOK_BUDGETS,
20
20
  HOOK_LOCATOR_BINARY,
21
21
  hookCommandHoldBudget
22
- } from "./chunk-JHWOM55B.js";
22
+ } from "./chunk-5TLDFPW6.js";
23
23
 
24
24
  // src/diagnostics/bridge.ts
25
25
  import { execFileSync } from "child_process";
@@ -2,7 +2,7 @@ import {
2
2
  DISCONNECT_AGENT_IDS,
3
3
  SETUP_AGENT_CHOICES,
4
4
  isApprovalMode
5
- } from "./chunk-JHWOM55B.js";
5
+ } from "./chunk-5TLDFPW6.js";
6
6
 
7
7
  // src/cli/mode-request.ts
8
8
  var parseDuration = (value) => {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isSafeReadOnlyCommand
3
- } from "./chunk-JHWOM55B.js";
3
+ } from "./chunk-5TLDFPW6.js";
4
4
 
5
5
  // src/ledger.ts
6
6
  import { appendFileSync, existsSync, mkdirSync, readFileSync, renameSync, rmSync, statSync } from "fs";
@@ -1,30 +1,30 @@
1
1
  import {
2
2
  announceSubscriptionRequired,
3
3
  isDeferAnswer
4
- } from "./chunk-CZ7C5AJT.js";
4
+ } from "./chunk-S33CCO4J.js";
5
5
  import {
6
6
  AUTO_DECISION_WINDOW_MS,
7
7
  DEFAULT_SESSION,
8
8
  claimThrottle,
9
9
  releaseThrottle,
10
10
  reportEvent
11
- } from "./chunk-JLJWVKMJ.js";
11
+ } from "./chunk-4RZXECJS.js";
12
12
  import {
13
13
  deriveToolTarget,
14
14
  permissionDeniedAction
15
- } from "./chunk-3MWQZKIO.js";
15
+ } from "./chunk-TXJ65MIV.js";
16
16
  import {
17
17
  askUser,
18
18
  isDecisionStopped,
19
19
  isQuestionLimitRefusal,
20
20
  waitForQuestion
21
- } from "./chunk-HWT42Z4O.js";
21
+ } from "./chunk-7AH6F44G.js";
22
22
  import {
23
23
  SubscriptionRequiredError
24
- } from "./chunk-ZWKF7WE4.js";
24
+ } from "./chunk-2CJNGJQS.js";
25
25
  import {
26
26
  getMachineId
27
- } from "./chunk-V4JZHAOY.js";
27
+ } from "./chunk-7SY2F6JA.js";
28
28
  import {
29
29
  ASK_CONTEXT_MAX,
30
30
  agentQuestionContext,
@@ -36,7 +36,7 @@ import {
36
36
  questionsShownAsASet,
37
37
  shouldDeferToNativeMode,
38
38
  wireVerdictFor
39
- } from "./chunk-JHWOM55B.js";
39
+ } from "./chunk-5TLDFPW6.js";
40
40
 
41
41
  // src/machine-decision-audit.ts
42
42
  import { basename } from "path";
@@ -521,7 +521,7 @@ var loadedOnce = (load) => {
521
521
  };
522
522
 
523
523
  // src/codex-desktop-proxy.ts
524
- var loadThePhone = () => import("./api-4WEMR2G3.js");
524
+ var loadThePhone = () => import("./api-ZDMC22LN.js");
525
525
  var theFirstCardLoadsAgain = () => {
526
526
  };
527
527
  var APP_SERVER_COMMAND = "app-server";
@@ -1062,7 +1062,7 @@ var codexDesktopCommand = async (args, entry, readAccount) => {
1062
1062
  return runCodexDesktopProxy(engine2, args.slice(3), readAccount, { watchesForCards: layoutIsKnown });
1063
1063
  }
1064
1064
  if (args[0] === APP_CARDS_FLAG) {
1065
- const { codexAppCardsCommandOnThisMac } = await import("./codex-app-cards-switch-26N5XSSZ.js");
1065
+ const { codexAppCardsCommandOnThisMac } = await import("./codex-app-cards-switch-ARYZG5DV.js");
1066
1066
  return codexAppCardsCommandOnThisMac(args.slice(1), entry, readAccount);
1067
1067
  }
1068
1068
  if (args.length > 2) throw new Error("Usage: pushary codex --desktop [path/to/Codex.app]");
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  compatibleConfigFile
3
- } from "./chunk-VJZGR4N3.js";
3
+ } from "./chunk-4VHT5SWU.js";
4
4
  import {
5
5
  hookOwnerOf,
6
6
  hookOwnerOfCommands,
7
7
  liveBridgeProbe,
8
8
  resolveBridgeStub
9
- } from "./chunk-YU5ACKJP.js";
9
+ } from "./chunk-K4I2LESS.js";
10
10
  import {
11
11
  AGENT_CHOICES
12
- } from "./chunk-HARHFDZM.js";
12
+ } from "./chunk-D7ZJ3AUK.js";
13
13
  import {
14
14
  claudeSettings,
15
15
  codexHooksJson,
@@ -19,10 +19,10 @@ import {
19
19
  pusharyDir,
20
20
  vscodePluginDir,
21
21
  windowsNodeLauncherFor
22
- } from "./chunk-PHBZK4SC.js";
22
+ } from "./chunk-YLWPJ2MP.js";
23
23
  import {
24
24
  readJsonSafe
25
- } from "./chunk-64XK7DLE.js";
25
+ } from "./chunk-5YDIHB67.js";
26
26
  import {
27
27
  HOOK_BUDGETS,
28
28
  HOOK_COMPATIBLE_PROFILES,
@@ -30,7 +30,7 @@ import {
30
30
  OPENCODE_APPROVAL_EVENT,
31
31
  hookCompatibleProfile,
32
32
  isRecord
33
- } from "./chunk-JHWOM55B.js";
33
+ } from "./chunk-5TLDFPW6.js";
34
34
 
35
35
  // src/opencode-plugin.ts
36
36
  var OPENCODE_PLUGIN_MARKER = "pushary-opencode-plugin w1";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  pusharyDir
3
- } from "./chunk-PHBZK4SC.js";
3
+ } from "./chunk-YLWPJ2MP.js";
4
4
  import {
5
5
  readJsonSafe
6
- } from "./chunk-64XK7DLE.js";
6
+ } from "./chunk-5YDIHB67.js";
7
7
  import {
8
8
  isRecord
9
- } from "./chunk-JHWOM55B.js";
9
+ } from "./chunk-5TLDFPW6.js";
10
10
 
11
11
  // src/process-ownership.ts
12
12
  import { createHash, randomUUID } from "crypto";
@@ -5,19 +5,19 @@ import {
5
5
  hermesAppWiringRecord,
6
6
  hermesConfigReceipt,
7
7
  hermesSetupReceipt
8
- } from "./chunk-PHBZK4SC.js";
8
+ } from "./chunk-YLWPJ2MP.js";
9
9
  import {
10
10
  readJsonSafe,
11
11
  resolvePathBinary,
12
12
  writeJsonAtomic
13
- } from "./chunk-64XK7DLE.js";
13
+ } from "./chunk-5YDIHB67.js";
14
14
  import {
15
15
  isNewerVersion,
16
16
  isReleaseVersion
17
17
  } from "./chunk-ZVU6WMMU.js";
18
18
  import {
19
19
  isRecord
20
- } from "./chunk-JHWOM55B.js";
20
+ } from "./chunk-5TLDFPW6.js";
21
21
 
22
22
  // src/hermes/plugin-payload.ts
23
23
  import { createHash } from "crypto";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  NPX_LATEST_COMMAND
3
- } from "./chunk-GGGOFJBL.js";
3
+ } from "./chunk-KWWHFTNJ.js";
4
4
 
5
5
  // src/config.ts
6
6
  import { readFileSync } from "fs";
@@ -1,20 +1,20 @@
1
1
  import {
2
2
  openCodeConfigDirFrom
3
- } from "./chunk-TSCFJJIB.js";
3
+ } from "./chunk-MY6CX7WE.js";
4
4
  import {
5
5
  nativeClaudeInstallPath
6
- } from "./chunk-7ZYVX2KN.js";
6
+ } from "./chunk-3ZWJBPQ5.js";
7
7
  import {
8
8
  grokHome
9
- } from "./chunk-VJZGR4N3.js";
9
+ } from "./chunk-4VHT5SWU.js";
10
10
  import {
11
11
  claudeConfigDir,
12
12
  clineDataDirectory,
13
13
  codexHomeFrom
14
- } from "./chunk-PHBZK4SC.js";
14
+ } from "./chunk-YLWPJ2MP.js";
15
15
  import {
16
16
  HOOK_COMPATIBLE_PROFILES
17
- } from "./chunk-JHWOM55B.js";
17
+ } from "./chunk-5TLDFPW6.js";
18
18
 
19
19
  // src/vscode-config.ts
20
20
  import { homedir } from "os";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  localRepoKey,
3
3
  normalizeRepoRemote
4
- } from "./chunk-JHWOM55B.js";
4
+ } from "./chunk-5TLDFPW6.js";
5
5
 
6
6
  // src/repo.ts
7
7
  import { existsSync, readFileSync, statSync } from "fs";
@@ -7,7 +7,7 @@ import {
7
7
  recordSealerFor,
8
8
  uploadTranscriptRecords,
9
9
  wrapSessionKey
10
- } from "./chunk-7GYDMVHV.js";
10
+ } from "./chunk-4PS27SCG.js";
11
11
 
12
12
  // src/live-session.ts
13
13
  var MAX_TRANSCRIPT_QUEUE = 100;
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  autoUpdateLock
3
- } from "./chunk-PHBZK4SC.js";
3
+ } from "./chunk-YLWPJ2MP.js";
4
4
  import {
5
5
  installPackageGlobally,
6
6
  npmErrorMessage,
7
7
  writeJsonAtomic
8
- } from "./chunk-64XK7DLE.js";
8
+ } from "./chunk-5YDIHB67.js";
9
9
 
10
10
  // src/upgrade-lock.ts
11
11
  import { fork } from "child_process";
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  macAppBridgeAvailable
3
- } from "./chunk-TSCFJJIB.js";
3
+ } from "./chunk-MY6CX7WE.js";
4
4
  import {
5
5
  keyPrefix
6
- } from "./chunk-FRPR4OTH.js";
6
+ } from "./chunk-TQ43EX2E.js";
7
7
  import {
8
8
  bridgeAgentKey
9
- } from "./chunk-PHBZK4SC.js";
9
+ } from "./chunk-YLWPJ2MP.js";
10
10
  import {
11
11
  readJsonSafe
12
- } from "./chunk-64XK7DLE.js";
12
+ } from "./chunk-5YDIHB67.js";
13
13
  import {
14
14
  isRecord,
15
15
  isValidApiKey
16
- } from "./chunk-JHWOM55B.js";
16
+ } from "./chunk-5TLDFPW6.js";
17
17
 
18
18
  // src/shared-mcp-key.ts
19
19
  var asRecord = (value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0;