pushary 1.9.75 → 1.9.76

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 +7 -0
  2. package/dist/{api-L3BIISGS.js → api-YDCHRRA4.js} +10 -10
  3. package/dist/bin/pushary-bell-hook.js +26 -25
  4. package/dist/bin/pushary-bell.js +10 -10
  5. package/dist/bin/pushary-claude.js +27 -26
  6. package/dist/bin/pushary-clean.js +33 -33
  7. package/dist/bin/pushary-codex-bridge.js +21 -21
  8. package/dist/bin/pushary-codex-hook.js +31 -30
  9. package/dist/bin/pushary-codex-session.js +8 -8
  10. package/dist/bin/pushary-codex.js +13 -13
  11. package/dist/bin/pushary-connect.js +26 -26
  12. package/dist/bin/pushary-cowork.js +5 -5
  13. package/dist/bin/pushary-daemon.js +39 -38
  14. package/dist/bin/pushary-disconnect.js +25 -25
  15. package/dist/bin/pushary-display-hook.js +17 -16
  16. package/dist/bin/pushary-doctor.js +41 -41
  17. package/dist/bin/pushary-elicitation-hook.js +26 -25
  18. package/dist/bin/pushary-gemini-bridge.js +15 -15
  19. package/dist/bin/pushary-gemini-hook.js +28 -27
  20. package/dist/bin/pushary-hook.js +30 -29
  21. package/dist/bin/pushary-login.js +20 -20
  22. package/dist/bin/pushary-logout.js +24 -24
  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 -24
  26. package/dist/bin/pushary-opencode-hook.js +27 -26
  27. package/dist/bin/pushary-permission-denied-hook.js +30 -29
  28. package/dist/bin/pushary-permission-hook.js +30 -29
  29. package/dist/bin/pushary-post-hook.js +25 -24
  30. package/dist/bin/pushary-prompt-hook.js +25 -24
  31. package/dist/bin/pushary-session-end-hook.js +27 -26
  32. package/dist/bin/pushary-session-start-hook.js +35 -34
  33. package/dist/bin/pushary-setup.js +50 -267
  34. package/dist/bin/pushary-stats.js +5 -5
  35. package/dist/bin/pushary-status.js +31 -31
  36. package/dist/bin/pushary-stop-hook.js +25 -24
  37. package/dist/bin/pushary-stopfailure-hook.js +25 -24
  38. package/dist/bin/pushary-suggestions.js +15 -15
  39. package/dist/bin/pushary-transcript-register.js +17 -16
  40. package/dist/bin/pushary-transcripts.js +19 -19
  41. package/dist/bin/pushary-upgrade.js +39 -39
  42. package/dist/bin/pushary-wait.js +15 -15
  43. package/dist/bin/pushary.js +7 -7
  44. package/dist/{chunk-CI6MDBQB.js → chunk-2BK2EQOB.js} +7 -7
  45. package/dist/{chunk-JCZWWBBA.js → chunk-2QFYEB3P.js} +5 -5
  46. package/dist/{chunk-3SAF4QXU.js → chunk-3YU6NIIL.js} +4 -4
  47. package/dist/{chunk-L2FQBHIR.js → chunk-47TIRGS5.js} +2 -2
  48. package/dist/{chunk-I73UQU7K.js → chunk-4LX5QUFV.js} +1 -1
  49. package/dist/{chunk-LRYZXY4V.js → chunk-57MQNSM5.js} +1 -1
  50. package/dist/{chunk-4DH54LS7.js → chunk-5FV472Q2.js} +1 -1
  51. package/dist/{chunk-HRRGIVIL.js → chunk-5KPMDLXB.js} +3 -3
  52. package/dist/{chunk-RPKFXNOJ.js → chunk-5M5F4IWR.js} +2 -2
  53. package/dist/{chunk-DARPCQPY.js → chunk-5NW7VM35.js} +2 -2
  54. package/dist/{chunk-KDUWFGY2.js → chunk-74ONBRPF.js} +4 -4
  55. package/dist/{chunk-2J4IVUEA.js → chunk-7KYQ24FI.js} +2 -2
  56. package/dist/{chunk-LIDUPDEY.js → chunk-7LLC4R66.js} +4 -4
  57. package/dist/{chunk-ZX3KEXO3.js → chunk-7SFP6Y5U.js} +45 -24
  58. package/dist/{chunk-EOGVWCLF.js → chunk-7ZOWQBHQ.js} +5 -5
  59. package/dist/{chunk-HXV2SY2V.js → chunk-B2PFCS72.js} +2 -2
  60. package/dist/{chunk-BGEUAJYL.js → chunk-BUR2LYQI.js} +2 -2
  61. package/dist/{chunk-UU3CDLIX.js → chunk-C2AR7QXU.js} +2 -2
  62. package/dist/{chunk-UBANQ4EZ.js → chunk-CHIOUBPB.js} +13 -13
  63. package/dist/{chunk-M7BXAWUC.js → chunk-CMNB4IZO.js} +3 -3
  64. package/dist/{chunk-BRG4XS2H.js → chunk-CUD6SYDG.js} +1 -1
  65. package/dist/{chunk-DCHZ5JOI.js → chunk-DB3NOEDW.js} +6 -6
  66. package/dist/{chunk-P4TWTQ6V.js → chunk-DZF2M3LM.js} +6 -6
  67. package/dist/{chunk-PV5XEBFI.js → chunk-E2VJ7B7D.js} +6 -6
  68. package/dist/{chunk-SIJHPGUW.js → chunk-E7U4YM4A.js} +3 -3
  69. package/dist/{chunk-PGLNE556.js → chunk-F7R7M5MG.js} +1 -1
  70. package/dist/{chunk-VGHWK5Z2.js → chunk-FAGQAR6I.js} +3 -3
  71. package/dist/{chunk-GAAN3Y7V.js → chunk-GII565PB.js} +1 -1
  72. package/dist/{chunk-6BFLDHPM.js → chunk-GJVV2EUC.js} +3 -3
  73. package/dist/{chunk-EH5OLIP2.js → chunk-IRLHN5UP.js} +236 -20
  74. package/dist/{chunk-7FNSQMQ2.js → chunk-IRN6JLSM.js} +4 -4
  75. package/dist/{chunk-SONZCJY5.js → chunk-ITLWEGLE.js} +11 -4
  76. package/dist/{chunk-32JJ5KV3.js → chunk-JNV5LOZH.js} +4 -4
  77. package/dist/{chunk-EM2RSWDA.js → chunk-JZ5KV2FK.js} +5 -5
  78. package/dist/{chunk-TPYZFYQ5.js → chunk-KGWLDNNT.js} +4 -4
  79. package/dist/{chunk-SOHJ37NA.js → chunk-KWGOKO4E.js} +3 -3
  80. package/dist/{chunk-DOG3BQFO.js → chunk-M5VJ3HXB.js} +6 -6
  81. package/dist/{chunk-53D6FFVE.js → chunk-M7JFGDGP.js} +1 -1
  82. package/dist/{chunk-4GWKKUQ5.js → chunk-MAWC4PJV.js} +5 -5
  83. package/dist/chunk-MHUKYYYR.js +239 -0
  84. package/dist/{chunk-SFJOGZQV.js → chunk-MMVIKXCP.js} +3 -3
  85. package/dist/{chunk-EVBG5YUO.js → chunk-MTRZQR2R.js} +3 -3
  86. package/dist/{chunk-QDUDXJAF.js → chunk-NFUV25JZ.js} +3 -3
  87. package/dist/{chunk-UEJTWQVF.js → chunk-NJTAUEW6.js} +1 -1
  88. package/dist/{chunk-WL3V2UV4.js → chunk-NQA56AMZ.js} +6 -6
  89. package/dist/{chunk-JFVLMWKY.js → chunk-NVLKH5FS.js} +9 -9
  90. package/dist/{chunk-NCTABQMC.js → chunk-PPD64MZW.js} +1 -1
  91. package/dist/{chunk-E5XYFIYL.js → chunk-QUGP76DQ.js} +6 -6
  92. package/dist/{chunk-UIS332AZ.js → chunk-R3HXGHRQ.js} +1 -1
  93. package/dist/{chunk-DX65IDBI.js → chunk-S7C5NY4R.js} +1 -1
  94. package/dist/{chunk-7O54GE5C.js → chunk-SWRNJ3BP.js} +3 -3
  95. package/dist/{chunk-AUDYAVNM.js → chunk-T2EJ3H6Y.js} +3 -3
  96. package/dist/{chunk-Z7ORL6SC.js → chunk-TFYFQM5C.js} +2 -2
  97. package/dist/{chunk-JOMG6J64.js → chunk-UEY4SHY2.js} +1 -1
  98. package/dist/{chunk-R7V6BPEV.js → chunk-UMBVIFP5.js} +1 -1
  99. package/dist/{chunk-2DB7TBA7.js → chunk-USMUW3LI.js} +2 -2
  100. package/dist/{chunk-SHW6KK2K.js → chunk-USZJJWZL.js} +2 -2
  101. package/dist/{chunk-4T25BBBO.js → chunk-VELPOV2F.js} +4 -4
  102. package/dist/{chunk-D4X4BQVQ.js → chunk-VZSSL6US.js} +10 -10
  103. package/dist/{chunk-MD4UJICD.js → chunk-W5AUTVVL.js} +5 -5
  104. package/dist/{chunk-XO7LP3JC.js → chunk-WK2L3XVQ.js} +1 -1
  105. package/dist/{chunk-3PPL64AG.js → chunk-WLHHDDVA.js} +9 -4
  106. package/dist/{chunk-5EQOUZYE.js → chunk-WRCM4XGY.js} +2 -2
  107. package/dist/{chunk-CLHRSK5L.js → chunk-XJ5DYPTM.js} +4 -4
  108. package/dist/{chunk-FEC3JUIH.js → chunk-XLGD5LDG.js} +3 -3
  109. package/dist/{chunk-SNUHX5GQ.js → chunk-Y2CYSVWU.js} +6 -6
  110. package/dist/{chunk-QRS7FQHE.js → chunk-Y4OBAK4I.js} +4 -0
  111. package/dist/{chunk-I6TIZMM3.js → chunk-YDPGBBV7.js} +5 -5
  112. package/dist/{chunk-T6RWREWU.js → chunk-YLB4AGZJ.js} +1 -1
  113. package/dist/{chunk-DUOBFECC.js → chunk-ZY25SNFQ.js} +1 -1
  114. package/dist/{codex-app-cards-switch-CN3G7GZW.js → codex-app-cards-switch-3OUTABVU.js} +11 -11
  115. package/dist/{codex-desktop-launch-GFZXCDSL.js → codex-desktop-launch-JH3E2CIA.js} +1 -1
  116. package/dist/{codex-session-launch-4F2UGQYE.js → codex-session-launch-GR363OQN.js} +18 -18
  117. package/dist/{config-BLHDUDCS.js → config-R43UFHX7.js} +3 -3
  118. package/dist/{global-upgrade-IZEC22BQ.js → global-upgrade-73GP4MZM.js} +10 -10
  119. package/dist/{identity-3HGTEP5Q.js → identity-CA7CZGDL.js} +4 -4
  120. package/dist/{live-capabilities-AZK664T7.js → live-capabilities-RCGMQIIZ.js} +5 -5
  121. package/dist/{paths-ROMZUSEX.js → paths-H7VNNB46.js} +3 -3
  122. package/dist/{reapply-IJYRR4YK.js → reapply-3UIA3CUO.js} +27 -27
  123. package/dist/src/index.js +29 -28
  124. package/dist/{upgrade-lock-FGEZPX56.js → upgrade-lock-ZTLX5PDF.js} +4 -4
  125. package/dist/{usage-HCURE44F.js → usage-C53NVWC2.js} +3 -3
  126. package/package.json +1 -1
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  addGeminiMcpServer,
3
3
  removeGeminiMcpServer
4
- } from "./chunk-TPYZFYQ5.js";
4
+ } from "./chunk-KGWLDNNT.js";
5
5
  import {
6
6
  CLAUDE_CODE_AGENT,
7
7
  compatibleToolLookup
8
- } from "./chunk-JFVLMWKY.js";
8
+ } from "./chunk-NVLKH5FS.js";
9
9
  import {
10
10
  CLAUDE_HOOK_EVENTS,
11
11
  PUSHARY_MCP_URL,
@@ -17,7 +17,7 @@ import {
17
17
  isPusharyHook,
18
18
  registerHookEntry,
19
19
  removeClaudeMcpServers
20
- } from "./chunk-2J4IVUEA.js";
20
+ } from "./chunk-7KYQ24FI.js";
21
21
  import {
22
22
  HOOK_COMPATIBLE_PROFILES,
23
23
  PHONE_ANSWERED_TOOLS,
@@ -28,7 +28,7 @@ import {
28
28
  pusharyMissingReason,
29
29
  refusalOutput,
30
30
  withHookHoldBudget
31
- } from "./chunk-QRS7FQHE.js";
31
+ } from "./chunk-Y4OBAK4I.js";
32
32
 
33
33
  // src/config-document.ts
34
34
  import { parse, stringify } from "smol-toml";
@@ -19,7 +19,7 @@ var credentialSchema = external_exports.object({
19
19
  baseURL: external_exports.string().url(),
20
20
  keyScope: external_exports.literal("agent")
21
21
  });
22
- var consentSchema = credentialSchema.pick({ siteID: true, machineID: true, baseURL: true }).extend({ enabled: external_exports.literal(true), grantedAtMs: external_exports.number().int().positive() });
22
+ var consentSchema = credentialSchema.pick({ siteID: true, machineID: true, baseURL: true }).extend({ enabled: external_exports.literal(true), grantedAtMs: external_exports.number().int().positive(), includesEarlierConversation: external_exports.boolean().optional() });
23
23
  var readPositionSchema = external_exports.object({
24
24
  identity: external_exports.string().nullable(),
25
25
  offset: external_exports.number().int().nonnegative(),
@@ -58,7 +58,7 @@ var nativeTranscriptGrant = (home = homedir()) => {
58
58
  if (!account) return null;
59
59
  const consent = consentSchema.parse(ownerDocument(nativeConsentFile(home)));
60
60
  if (account.siteID !== consent.siteID || account.machineID !== consent.machineID || account.baseURL !== consent.baseURL) return null;
61
- return { account, grantedAtMs: consent.grantedAtMs };
61
+ return { account, grantedAtMs: consent.grantedAtMs, includesEarlierConversation: consent.includesEarlierConversation === true };
62
62
  } catch {
63
63
  return null;
64
64
  }
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  DEFAULT_SESSION
3
- } from "./chunk-JFVLMWKY.js";
3
+ } from "./chunk-NVLKH5FS.js";
4
4
 
5
5
  // src/answer.ts
6
6
  var isDeferAnswer = (value) => value === "defer";
@@ -7,7 +7,7 @@ import {
7
7
  } from "./chunk-KZERVKTD.js";
8
8
  import {
9
9
  redactSecretsFromContent
10
- } from "./chunk-QRS7FQHE.js";
10
+ } from "./chunk-Y4OBAK4I.js";
11
11
 
12
12
  // src/cli/json.ts
13
13
  var writeStdoutFully = (text) => new Promise((resolve, reject) => {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  guardBinary
3
- } from "./chunk-2J4IVUEA.js";
3
+ } from "./chunk-7KYQ24FI.js";
4
4
 
5
5
  // src/bell/install.ts
6
6
  import { join } from "path";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  readJsonSafe,
3
3
  writeJsonAtomic
4
- } from "./chunk-AUDYAVNM.js";
4
+ } from "./chunk-T2EJ3H6Y.js";
5
5
  import {
6
6
  configFilePath
7
- } from "./chunk-53D6FFVE.js";
7
+ } from "./chunk-M7JFGDGP.js";
8
8
  import {
9
9
  readSetupOutcomeProperties
10
- } from "./chunk-QRS7FQHE.js";
10
+ } from "./chunk-Y4OBAK4I.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,6 +1,6 @@
1
1
  import {
2
2
  readTranscriptPreference
3
- } from "./chunk-LIDUPDEY.js";
3
+ } from "./chunk-7LLC4R66.js";
4
4
 
5
5
  // src/transcript-setting.ts
6
6
  var transcriptEnvironmentPreference = () => {
@@ -11,7 +11,7 @@ var transcriptEnvironmentPreference = () => {
11
11
  return null;
12
12
  };
13
13
  var configuredPreference = () => transcriptEnvironmentPreference() ?? readTranscriptPreference();
14
- var transcriptsEnabled = () => configuredPreference() ?? false;
14
+ var transcriptsEnabled = () => configuredPreference() ?? true;
15
15
  var transcriptPreferenceForSetup = (explicit = null) => explicit ?? configuredPreference() ?? true;
16
16
 
17
17
  export {
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  configFilePath
3
- } from "./chunk-53D6FFVE.js";
3
+ } from "./chunk-M7JFGDGP.js";
4
4
  import {
5
5
  normalizeInstallSource
6
- } from "./chunk-QRS7FQHE.js";
6
+ } from "./chunk-Y4OBAK4I.js";
7
7
 
8
8
  // src/install-source.ts
9
9
  import { readFileSync } from "fs";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  realpath
3
- } from "./chunk-QDUDXJAF.js";
3
+ } from "./chunk-NFUV25JZ.js";
4
4
  import {
5
5
  findNativeClaudeInstall
6
- } from "./chunk-R7V6BPEV.js";
6
+ } from "./chunk-UMBVIFP5.js";
7
7
  import {
8
8
  readGlobalPrefixAsync,
9
9
  resolveGlobalBinary,
@@ -13,10 +13,10 @@ import {
13
13
  resolvePackageVersionFromBinary,
14
14
  resolvePathBinary,
15
15
  resolvePathBinaryAsync
16
- } from "./chunk-AUDYAVNM.js";
16
+ } from "./chunk-T2EJ3H6Y.js";
17
17
  import {
18
18
  MANAGED_PROVIDERS
19
- } from "./chunk-QRS7FQHE.js";
19
+ } from "./chunk-Y4OBAK4I.js";
20
20
 
21
21
  // src/live-capabilities.ts
22
22
  import { homedir } from "os";
@@ -4,7 +4,7 @@ import {
4
4
  quoteIfNeeded,
5
5
  shellDoubleQuoted,
6
6
  writeFileAtomic
7
- } from "./chunk-AUDYAVNM.js";
7
+ } from "./chunk-T2EJ3H6Y.js";
8
8
  import {
9
9
  CLAUDE_PRETOOLUSE_MATCHER,
10
10
  CODEX_QUESTION_TOOLS,
@@ -12,7 +12,7 @@ import {
12
12
  HOOK_LOCATOR_BINARY,
13
13
  PRETOOLUSE_GATED_TOOLS,
14
14
  withHookHoldBudget
15
- } from "./chunk-QRS7FQHE.js";
15
+ } from "./chunk-Y4OBAK4I.js";
16
16
 
17
17
  // src/setup/paths.ts
18
18
  import { createHash as createHash2 } from "crypto";
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  resolveInstallSourceFor
3
- } from "./chunk-DARPCQPY.js";
3
+ } from "./chunk-5NW7VM35.js";
4
4
  import {
5
5
  backupFile,
6
6
  readJsonSafe,
7
7
  writeFileAtomic,
8
8
  writeJsonAtomic
9
- } from "./chunk-AUDYAVNM.js";
9
+ } from "./chunk-T2EJ3H6Y.js";
10
10
  import {
11
11
  configFilePath
12
- } from "./chunk-53D6FFVE.js";
12
+ } from "./chunk-M7JFGDGP.js";
13
13
  import {
14
14
  API_KEY_PREFIX_PATTERN,
15
15
  isRecord
16
- } from "./chunk-QRS7FQHE.js";
16
+ } from "./chunk-Y4OBAK4I.js";
17
17
 
18
18
  // src/shell-alias.ts
19
19
  import { homedir } from "os";
@@ -3,13 +3,16 @@ import {
3
3
  loadPin,
4
4
  savePin,
5
5
  verifyRecipients
6
- } from "./chunk-T6RWREWU.js";
6
+ } from "./chunk-YLB4AGZJ.js";
7
+ import {
8
+ SESSION_HISTORY_RETENTION_DAYS
9
+ } from "./chunk-MHUKYYYR.js";
7
10
  import {
8
11
  ensureDaemonRunning
9
- } from "./chunk-DCHZ5JOI.js";
12
+ } from "./chunk-DB3NOEDW.js";
10
13
  import {
11
14
  hookOwnerOf
12
- } from "./chunk-TPYZFYQ5.js";
15
+ } from "./chunk-KGWLDNNT.js";
13
16
  import {
14
17
  buildTranscriptRecords,
15
18
  decodePublicKey,
@@ -20,33 +23,34 @@ import {
20
23
  recordSealerFor,
21
24
  uploadTranscriptRecords,
22
25
  wrapSessionKey
23
- } from "./chunk-SONZCJY5.js";
26
+ } from "./chunk-ITLWEGLE.js";
24
27
  import {
25
28
  external_exports
26
29
  } from "./chunk-XMSDA5WA.js";
27
30
  import {
28
31
  transcriptEnvironmentPreference,
29
32
  transcriptsEnabled
30
- } from "./chunk-RPKFXNOJ.js";
33
+ } from "./chunk-5M5F4IWR.js";
31
34
  import {
32
35
  readTranscriptPreference
33
- } from "./chunk-LIDUPDEY.js";
36
+ } from "./chunk-7LLC4R66.js";
34
37
  import {
35
38
  claudeConfigDir,
36
39
  codexHome,
37
40
  pusharyDir
38
- } from "./chunk-2J4IVUEA.js";
41
+ } from "./chunk-7KYQ24FI.js";
39
42
  import {
40
43
  writeJsonAtomic
41
- } from "./chunk-AUDYAVNM.js";
44
+ } from "./chunk-T2EJ3H6Y.js";
42
45
  import {
43
46
  getApiKey,
44
47
  getBaseUrl
45
- } from "./chunk-53D6FFVE.js";
48
+ } from "./chunk-M7JFGDGP.js";
46
49
  import {
47
50
  PENDING_COMMAND_PREFIX,
51
+ SESSION_HISTORY_BACKFILL_LIMIT_BYTES,
48
52
  redactSecretsFromContent
49
- } from "./chunk-QRS7FQHE.js";
53
+ } from "./chunk-Y4OBAK4I.js";
50
54
 
51
55
  // src/transcript-registration.ts
52
56
  import { createHash } from "crypto";
@@ -376,11 +380,14 @@ var normalizeTranscriptLines = (lines, source) => {
376
380
  });
377
381
  };
378
382
  var createdDuringEpoch = (sighting, epochStartedAtMs) => sighting.birthtimeMs !== null && sighting.birthtimeMs >= epochStartedAtMs && sighting.birthtimeMs <= sighting.seenAtMs;
383
+ var SESSION_HISTORY_BACKFILL = { limitBytes: SESSION_HISTORY_BACKFILL_LIMIT_BYTES };
384
+ var MS_PER_DAY = 864e5;
379
385
  var everythingAlreadyWritten = (sighting) => ({ identity: sighting.identity, offset: sighting.sizeBytes, startedBeforeEpoch: true });
380
- var cutoffAtFirstSight = (sighting, epochStartedAtMs) => sighting.identity === null || createdDuringEpoch(sighting, epochStartedAtMs) ? { identity: sighting.identity, offset: 0, startedBeforeEpoch: false } : everythingAlreadyWritten(sighting);
386
+ var earlierConversationStart = (sighting, backfill) => backfill === null ? everythingAlreadyWritten(sighting) : { identity: sighting.identity, offset: Math.max(0, sighting.sizeBytes - backfill.limitBytes), startedBeforeEpoch: true };
387
+ var cutoffAtFirstSight = (sighting, epochStartedAtMs, backfill) => sighting.identity === null || createdDuringEpoch(sighting, epochStartedAtMs) ? { identity: sighting.identity, offset: 0, startedBeforeEpoch: false } : earlierConversationStart(sighting, backfill);
381
388
  var replacedOrShrunk = (previous, sighting) => previous.identity !== sighting.identity || sighting.sizeBytes < previous.offset;
382
- var nextTranscriptCutoff = (previous, sighting, epochStartedAtMs) => {
383
- if (!previous) return cutoffAtFirstSight(sighting, epochStartedAtMs);
389
+ var nextTranscriptCutoff = (previous, sighting, epochStartedAtMs, backfill = null) => {
390
+ if (!previous) return cutoffAtFirstSight(sighting, epochStartedAtMs, backfill);
384
391
  if (sighting.identity === null) return previous;
385
392
  if (previous.identity === null) return { ...previous, identity: sighting.identity };
386
393
  return replacedOrShrunk(previous, sighting) ? everythingAlreadyWritten(sighting) : previous;
@@ -401,10 +408,12 @@ var stampedBefore = (record, momentMs) => {
401
408
  return Number.isFinite(stamped) && stamped < momentMs;
402
409
  };
403
410
  var isCompactionSummary = (record) => record.isCompactSummary === true;
404
- var transcriptLinesSeenLive = (lines, epochStartedAtMs, startedBeforeEpoch) => lines.filter((line) => {
411
+ var oldestTranscriptLineMs = (epochStartedAtMs, backfill, retentionDays, nowMs) => backfill === null ? epochStartedAtMs : nowMs - retentionDays * MS_PER_DAY;
412
+ var dropsCompactionSummaries = (cutoff, backfill) => cutoff.startedBeforeEpoch && backfill === null;
413
+ var transcriptLinesSince = (lines, oldestLineMs, dropCompactionSummaries) => lines.filter((line) => {
405
414
  const record = parsedTranscriptRecord(line);
406
415
  if (record === null) return true;
407
- return !stampedBefore(record, epochStartedAtMs) && !(startedBeforeEpoch && isCompactionSummary(record));
416
+ return !stampedBefore(record, oldestLineMs) && !(dropCompactionSummaries && isCompactionSummary(record));
408
417
  });
409
418
 
410
419
  // src/transcript-sync.ts
@@ -425,7 +434,8 @@ var createSyncState = () => ({
425
434
  keyUploaded: false,
426
435
  keyRejected: false,
427
436
  keyUnavailable: false,
428
- unsettled: 0
437
+ unsettled: 0,
438
+ retentionDays: null
429
439
  });
430
440
  var withSessionKey = async (state, uploader) => {
431
441
  if (state.sessionKey || state.keyRejected) return state;
@@ -438,7 +448,8 @@ var withSessionKey = async (state, uploader) => {
438
448
  wrappedKey: wrapSessionKey(sessionKey, decodePublicKey(recipients.phonePublicKey)),
439
449
  providerWrappedKey: recipients.provider ? wrapSessionKey(sessionKey, decodePublicKey(recipients.provider.publicKey)) : state.providerWrappedKey,
440
450
  providerKeyId: recipients.provider ? recipients.provider.keyId : state.providerKeyId,
441
- compressRecords: recipients.phoneReadsCompressedRecords
451
+ compressRecords: recipients.phoneReadsCompressedRecords,
452
+ retentionDays: recipients.retentionDays
442
453
  };
443
454
  };
444
455
  var syncTick = async (lines, state, uploader, sessionId, machineId) => {
@@ -491,7 +502,8 @@ var syncTick = async (lines, state, uploader, sessionId, machineId) => {
491
502
  keyUploaded,
492
503
  keyRejected,
493
504
  keyUnavailable,
494
- unsettled: built.records.filter((record) => !seen.has(record.localId)).length
505
+ unsettled: built.records.filter((record) => !seen.has(record.localId)).length,
506
+ retentionDays: keyed.retentionDays
495
507
  };
496
508
  };
497
509
  var MAX_RECORDS_PER_BATCH = 200;
@@ -521,6 +533,9 @@ var readLines = (path) => {
521
533
  }
522
534
  };
523
535
  var IDLE_CEILING_MS = 6e4;
536
+ var readPositionsKeptInMemory = { load: () => /* @__PURE__ */ new Map(), save: () => {
537
+ } };
538
+ var startTranscriptCaptureEpoch = (startedAtMs, positions = readPositionsKeptInMemory, backfill = null) => ({ startedAtMs, cutoffs: new Map(positions.load()), positions, backfill });
524
539
  var recordedBirthtime = (info) => process.platform === "darwin" && info.birthtimeMs > 0 ? info.birthtimeMs : null;
525
540
  var sightingOf = (info, seenAtMs) => info ? { identity: `${info.dev}:${info.ino}`, sizeBytes: info.size, birthtimeMs: recordedBirthtime(info), seenAtMs } : { identity: null, sizeBytes: 0, birthtimeMs: null, seenAtMs };
526
541
  var storeCutoff = (epoch, path, cutoff) => {
@@ -529,7 +544,7 @@ var storeCutoff = (epoch, path, cutoff) => {
529
544
  };
530
545
  var recordSighting = (epoch, path, sighting) => {
531
546
  const previous = epoch.cutoffs.get(path);
532
- const cutoff = nextTranscriptCutoff(previous, sighting, epoch.startedAtMs);
547
+ const cutoff = nextTranscriptCutoff(previous, sighting, epoch.startedAtMs, epoch.backfill);
533
548
  if (cutoff !== previous) storeCutoff(epoch, path, cutoff);
534
549
  return cutoff;
535
550
  };
@@ -591,9 +606,13 @@ var readLinesSinceCutoff = (epoch, path, seenAtMs) => {
591
606
  closeSync2(descriptor);
592
607
  }
593
608
  };
594
- var linesSeenDuringEpoch = (epoch, path, source, seenAtMs) => {
609
+ var linesSeenDuringEpoch = (epoch, path, source, seenAtMs, retentionDays) => {
595
610
  const read2 = readLinesSinceCutoff(epoch, path, seenAtMs);
596
- return { ...read2, lines: transcriptLinesSeenLive(normalizeTranscriptLines(read2.lines, source), epoch.startedAtMs, read2.cutoff.startedBeforeEpoch) };
611
+ const oldestLineMs = oldestTranscriptLineMs(epoch.startedAtMs, epoch.backfill, retentionDays, seenAtMs);
612
+ return {
613
+ ...read2,
614
+ lines: transcriptLinesSince(normalizeTranscriptLines(read2.lines, source), oldestLineMs, dropsCompactionSummaries(read2.cutoff, epoch.backfill))
615
+ };
597
616
  };
598
617
  var nothingLeftToUpload = (state) => state.sessionKey !== null && !state.keyRejected && state.unsettled === 0;
599
618
  var uploadStalled = (before, after) => after.sessionKey !== null && !after.keyRejected && after.unsettled > 0 && after.seen.size === before.seen.size;
@@ -658,7 +677,8 @@ var startTranscriptSync = (opts) => {
658
677
  const previous = state;
659
678
  const modified = existsSync2(path) ? statSync2(path).mtimeMs : null;
660
679
  const source = opts.source ?? "claude";
661
- const read2 = opts.epoch ? linesSeenDuringEpoch(opts.epoch, path, source, Date.now()) : null;
680
+ const retentionDays = state.retentionDays ?? SESSION_HISTORY_RETENTION_DAYS.standard;
681
+ const read2 = opts.epoch ? linesSeenDuringEpoch(opts.epoch, path, source, Date.now(), retentionDays) : null;
662
682
  const lines = read2?.lines ?? normalizeTranscriptLines(readLines(path), source);
663
683
  state = await syncTick(lines, state, uploader, opts.sessionId, opts.machineId);
664
684
  stalled = uploadStalled(previous, state);
@@ -711,7 +731,7 @@ var cliRegistry = (apiKey = getApiKey()) => ({ apiKey, baseUrl: getBaseUrl(), di
711
731
  var accountFor = (registry) => createHash("sha256").update(`${registry.baseUrl}\0${registry.apiKey}`).digest("hex");
712
732
  var TTL = 48 * 60 * 60 * 1e3;
713
733
  var read = (path) => JSON.parse(readFileSync4(path, "utf8"));
714
- var consent = (record) => record.consentOverride ?? readTranscriptPreference() ?? false;
734
+ var consent = (record) => record.consentOverride ?? readTranscriptPreference() ?? true;
715
735
  var withoutTrailingSlash = (url) => url.replace(/\/+$/, "");
716
736
  var sameServer = (url, registry) => withoutTrailingSlash(url) === withoutTrailingSlash(registry.baseUrl);
717
737
  var fileFor3 = (registry, sessionId) => join4(registry.directory, `${createHash("sha256").update(accountFor(registry) + sessionId).digest("hex")}.json`);
@@ -803,7 +823,8 @@ var sightRegisteredTranscripts = (epoch, registry, listing) => {
803
823
  if (listing.complete) forgetUnregisteredTranscripts(epoch, registeredPaths);
804
824
  };
805
825
  var startRegisteredTranscripts = (apiKey, machineId, options = {}) => {
806
- const { intervalMs = 3e3, enabled = () => true, storage, epoch } = options;
826
+ const { intervalMs = 3e3, enabled = () => true, storage } = options;
827
+ const epoch = options.epoch ?? startTranscriptCaptureEpoch(Date.now(), void 0, SESSION_HISTORY_BACKFILL);
807
828
  const registry = { apiKey, baseUrl: options.baseUrl ?? getBaseUrl(), directory: options.registryDirectory ?? defaultRegistryDirectory() };
808
829
  const active = /* @__PURE__ */ new Map();
809
830
  let stopped = false;
@@ -6,18 +6,18 @@ import {
6
6
  McpToolError,
7
7
  SubscriptionRequiredError,
8
8
  callMcpTool
9
- } from "./chunk-32JJ5KV3.js";
9
+ } from "./chunk-JNV5LOZH.js";
10
10
  import {
11
11
  installNetworkDefaults,
12
12
  isNetworkFailure
13
- } from "./chunk-SOHJ37NA.js";
13
+ } from "./chunk-KWGOKO4E.js";
14
14
  import {
15
15
  clientReportClaims
16
- } from "./chunk-2J4IVUEA.js";
16
+ } from "./chunk-7KYQ24FI.js";
17
17
  import {
18
18
  getApiKey,
19
19
  getBaseUrl
20
- } from "./chunk-53D6FFVE.js";
20
+ } from "./chunk-M7JFGDGP.js";
21
21
  import {
22
22
  ASK_AGENT_NAME_MAX,
23
23
  CLIENT_REPORT_PATH,
@@ -26,7 +26,7 @@ import {
26
26
  TOOL_FAILURE_CODES,
27
27
  degradedLine,
28
28
  truncateLine
29
- } from "./chunk-QRS7FQHE.js";
29
+ } from "./chunk-Y4OBAK4I.js";
30
30
 
31
31
  // src/api.ts
32
32
  import { randomUUID } from "crypto";
@@ -4,10 +4,10 @@ import {
4
4
  keyPrefix,
5
5
  readConfigFileKey,
6
6
  readMacAppKeyPrefix
7
- } from "./chunk-LIDUPDEY.js";
7
+ } from "./chunk-7LLC4R66.js";
8
8
  import {
9
9
  NPX_LATEST_COMMAND
10
- } from "./chunk-UIS332AZ.js";
10
+ } from "./chunk-R3HXGHRQ.js";
11
11
 
12
12
  // src/key-signed-out.ts
13
13
  var VERDICT_BY_CHECK = {
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  pusharyDir
3
- } from "./chunk-2J4IVUEA.js";
3
+ } from "./chunk-7KYQ24FI.js";
4
4
  import {
5
5
  writeFileAtomic
6
- } from "./chunk-AUDYAVNM.js";
6
+ } from "./chunk-T2EJ3H6Y.js";
7
7
 
8
8
  // src/identity.ts
9
9
  import { randomUUID } from "crypto";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  parseSseMessages
3
- } from "./chunk-32JJ5KV3.js";
3
+ } from "./chunk-JNV5LOZH.js";
4
4
  import {
5
5
  NPX_LATEST_COMMAND
6
- } from "./chunk-UIS332AZ.js";
6
+ } from "./chunk-R3HXGHRQ.js";
7
7
 
8
8
  // src/mcp-stdio-bridge.ts
9
9
  var MCP_BRIDGE_BINARY = "pushary-mcp";
@@ -4,24 +4,24 @@ import {
4
4
  outcomeOfFailedAsk,
5
5
  reportMachineDenial,
6
6
  storedWaitDeadline
7
- } from "./chunk-WL3V2UV4.js";
7
+ } from "./chunk-NQA56AMZ.js";
8
8
  import {
9
9
  isGatingMoment,
10
10
  recordKeylessMoment
11
- } from "./chunk-GAAN3Y7V.js";
11
+ } from "./chunk-GII565PB.js";
12
12
  import {
13
13
  isAdmitted,
14
14
  readAdmissionRules
15
- } from "./chunk-CI6MDBQB.js";
15
+ } from "./chunk-2BK2EQOB.js";
16
16
  import {
17
17
  isDeferAnswer,
18
18
  oncePerSession
19
- } from "./chunk-I73UQU7K.js";
19
+ } from "./chunk-4LX5QUFV.js";
20
20
  import {
21
21
  activeHookSource,
22
22
  activeIdentity,
23
23
  namedSource
24
- } from "./chunk-3SAF4QXU.js";
24
+ } from "./chunk-3YU6NIIL.js";
25
25
  import {
26
26
  DEFAULT_SESSION,
27
27
  UNNAMED_ACTION,
@@ -45,10 +45,10 @@ import {
45
45
  reportEvent,
46
46
  scopePathFor,
47
47
  settleQuestionsForToolUse
48
- } from "./chunk-JFVLMWKY.js";
48
+ } from "./chunk-NVLKH5FS.js";
49
49
  import {
50
50
  repoKeyFor
51
- } from "./chunk-DUOBFECC.js";
51
+ } from "./chunk-ZY25SNFQ.js";
52
52
  import {
53
53
  askUser,
54
54
  cancelQuestion,
@@ -65,20 +65,20 @@ import {
65
65
  waitForQuestion,
66
66
  waitsForThePhone,
67
67
  withdrawQuestion
68
- } from "./chunk-EOGVWCLF.js";
68
+ } from "./chunk-7ZOWQBHQ.js";
69
69
  import {
70
70
  getMachineId
71
- } from "./chunk-BGEUAJYL.js";
71
+ } from "./chunk-BUR2LYQI.js";
72
72
  import {
73
73
  claudeConfigDir
74
- } from "./chunk-2J4IVUEA.js";
74
+ } from "./chunk-7KYQ24FI.js";
75
75
  import {
76
76
  getApiKey,
77
77
  getBaseUrl
78
- } from "./chunk-53D6FFVE.js";
78
+ } from "./chunk-M7JFGDGP.js";
79
79
  import {
80
80
  NPX_LATEST_COMMAND
81
- } from "./chunk-UIS332AZ.js";
81
+ } from "./chunk-R3HXGHRQ.js";
82
82
  import {
83
83
  AGENT_QUESTION_STRATEGY,
84
84
  AGENT_QUESTION_TOOL,
@@ -133,7 +133,7 @@ import {
133
133
  terminalStaysLiveForTheCall,
134
134
  timeoutActionWithoutLocalPrompt,
135
135
  unansweredRefusalReason
136
- } from "./chunk-QRS7FQHE.js";
136
+ } from "./chunk-Y4OBAK4I.js";
137
137
 
138
138
  // src/terminal-answer-watch.ts
139
139
  import { closeSync, openSync, readSync, statSync } from "fs";
@@ -3,11 +3,11 @@ import {
3
3
  } from "./chunk-POFBE6ZY.js";
4
4
  import {
5
5
  autoUpdateState
6
- } from "./chunk-2J4IVUEA.js";
6
+ } from "./chunk-7KYQ24FI.js";
7
7
  import {
8
8
  readJsonSafe,
9
9
  writeJsonAtomic
10
- } from "./chunk-AUDYAVNM.js";
10
+ } from "./chunk-T2EJ3H6Y.js";
11
11
  import {
12
12
  CLI_PACKAGE_NAMES,
13
13
  POSIX_GLOBAL_ROOT_SEGMENTS,
@@ -17,7 +17,7 @@ import {
17
17
  } from "./chunk-QTOLNRET.js";
18
18
  import {
19
19
  isAutoUpdateResult
20
- } from "./chunk-QRS7FQHE.js";
20
+ } from "./chunk-Y4OBAK4I.js";
21
21
 
22
22
  // src/auto-update.ts
23
23
  import { spawn } from "child_process";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  readConfigFileKey
3
- } from "./chunk-LIDUPDEY.js";
3
+ } from "./chunk-7LLC4R66.js";
4
4
 
5
5
  // src/bell/fleet.ts
6
6
  import { closeSync, constants, futimesSync, lstatSync, mkdirSync, openSync, readdirSync, unlinkSync } from "fs";
@@ -4,23 +4,23 @@ import {
4
4
  } from "./chunk-XHKBHWLX.js";
5
5
  import {
6
6
  readControlMode
7
- } from "./chunk-LIDUPDEY.js";
7
+ } from "./chunk-7LLC4R66.js";
8
8
  import {
9
9
  getMachineId
10
- } from "./chunk-BGEUAJYL.js";
10
+ } from "./chunk-BUR2LYQI.js";
11
11
  import {
12
12
  pusharyDir
13
- } from "./chunk-2J4IVUEA.js";
13
+ } from "./chunk-7KYQ24FI.js";
14
14
  import {
15
15
  readJsonSafe,
16
16
  resolveGlobalBinary,
17
17
  writeFileAtomic,
18
18
  writeJsonAtomic,
19
19
  writeJsonAtomicDurable
20
- } from "./chunk-AUDYAVNM.js";
20
+ } from "./chunk-T2EJ3H6Y.js";
21
21
  import {
22
22
  getApiKey
23
- } from "./chunk-53D6FFVE.js";
23
+ } from "./chunk-M7JFGDGP.js";
24
24
  import {
25
25
  CLI_PACKAGE_NAMES,
26
26
  cmdShimTarget,
@@ -30,7 +30,7 @@ import {
30
30
  } from "./chunk-QTOLNRET.js";
31
31
  import {
32
32
  isRecord
33
- } from "./chunk-QRS7FQHE.js";
33
+ } from "./chunk-Y4OBAK4I.js";
34
34
 
35
35
  // src/daemon-lifecycle.ts
36
36
  import { dirname, join, win32 as win32Path } from "path";
@@ -2,31 +2,31 @@ import {
2
2
  SIGNED_OUT_ON_MAC_MESSAGE,
3
3
  describeSignedOutKey,
4
4
  readSignedOutDiagnosis
5
- } from "./chunk-HXV2SY2V.js";
5
+ } from "./chunk-B2PFCS72.js";
6
6
  import {
7
7
  APPROVAL_RULES_PATH
8
- } from "./chunk-2DB7TBA7.js";
8
+ } from "./chunk-USMUW3LI.js";
9
9
  import {
10
10
  createIo
11
11
  } from "./chunk-FO3MDD26.js";
12
12
  import {
13
13
  readKeySource
14
- } from "./chunk-LIDUPDEY.js";
14
+ } from "./chunk-7LLC4R66.js";
15
15
  import {
16
16
  absoluteUrl,
17
17
  checkApiKey,
18
18
  describeKeyCheck,
19
19
  keyCheckFromResponse
20
- } from "./chunk-SIJHPGUW.js";
20
+ } from "./chunk-E7U4YM4A.js";
21
21
  import {
22
22
  getBaseUrl
23
- } from "./chunk-53D6FFVE.js";
23
+ } from "./chunk-M7JFGDGP.js";
24
24
  import {
25
25
  EXIT
26
26
  } from "./chunk-KZERVKTD.js";
27
27
  import {
28
28
  KEY_SCOPE
29
- } from "./chunk-QRS7FQHE.js";
29
+ } from "./chunk-Y4OBAK4I.js";
30
30
 
31
31
  // src/cli/report-key.ts
32
32
  var { dim, yellow } = createIo();