lark-remote 0.1.6 → 0.1.8

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 (216) hide show
  1. package/CHANGELOG.md +51 -1
  2. package/README.en.md +9 -1
  3. package/README.md +14 -2
  4. package/dist/bridge/approval-coordinator.d.ts +71 -34
  5. package/dist/bridge/approval-coordinator.js +225 -41
  6. package/dist/bridge/inbound-media.d.ts +62 -0
  7. package/dist/bridge/inbound-media.js +282 -0
  8. package/dist/bridge/index.d.ts +97 -13
  9. package/dist/bridge/index.js +227 -87
  10. package/dist/bridge/queue-manager.d.ts +2 -1
  11. package/dist/bridge/queue-manager.js +1 -0
  12. package/dist/card/approval-render.js +294 -36
  13. package/dist/card/bash-card-session.d.ts +2 -24
  14. package/dist/card/bash-card-session.js +6 -73
  15. package/dist/card/bash-renderer.js +2 -3
  16. package/dist/card/card-budget.js +29 -75
  17. package/dist/card/card-session.d.ts +48 -0
  18. package/dist/card/card-session.js +86 -0
  19. package/dist/card/card-shared.d.ts +7 -16
  20. package/dist/card/card-shared.js +7 -30
  21. package/dist/card/run-card-session.d.ts +2 -55
  22. package/dist/card/run-card-session.js +6 -104
  23. package/dist/card/run-renderer.d.ts +7 -0
  24. package/dist/card/run-renderer.js +116 -238
  25. package/dist/card/run-state.d.ts +13 -0
  26. package/dist/card/run-state.js +25 -16
  27. package/dist/card/text-truncate.d.ts +13 -12
  28. package/dist/card/text-truncate.js +13 -63
  29. package/dist/common/fs.d.ts +8 -0
  30. package/dist/common/fs.js +17 -0
  31. package/dist/common/guards.d.ts +0 -20
  32. package/dist/common/guards.js +0 -43
  33. package/dist/common/sleep.d.ts +2 -0
  34. package/dist/common/sleep.js +5 -0
  35. package/dist/common/truncate.d.ts +39 -0
  36. package/dist/common/truncate.js +92 -0
  37. package/dist/config/codex-config.d.ts +1 -1
  38. package/dist/config/codex-config.js +1 -1
  39. package/dist/config/index.d.ts +112 -24
  40. package/dist/config/index.js +139 -37
  41. package/dist/connector/index.d.ts +69 -2
  42. package/dist/connector/index.js +107 -1
  43. package/dist/index.js +150 -118
  44. package/dist/instance-lock.js +4 -12
  45. package/dist/order/alias-resolve.d.ts +13 -0
  46. package/dist/order/alias-resolve.js +22 -0
  47. package/dist/order/alias-store.d.ts +38 -0
  48. package/dist/order/alias-store.js +106 -0
  49. package/dist/persistence/atomic-write.d.ts +8 -2
  50. package/dist/persistence/atomic-write.js +23 -7
  51. package/dist/restart.js +2 -1
  52. package/dist/router/card-action-payload.d.ts +30 -0
  53. package/dist/router/card-action-payload.js +39 -0
  54. package/dist/router/card-helpers.d.ts +63 -0
  55. package/dist/router/card-helpers.js +146 -0
  56. package/dist/router/config/claude.js +30 -1
  57. package/dist/router/config/codex.js +29 -50
  58. package/dist/router/config/common/model-patch.d.ts +22 -0
  59. package/dist/router/config/common/model-patch.js +26 -0
  60. package/dist/router/config/common/render.js +5 -4
  61. package/dist/router/config/dsh.d.ts +51 -0
  62. package/dist/router/config/dsh.js +179 -0
  63. package/dist/router/config/index.d.ts +12 -0
  64. package/dist/router/config/index.js +28 -1
  65. package/dist/router/config/kimi.d.ts +4 -1
  66. package/dist/router/config/kimi.js +27 -0
  67. package/dist/router/config/opencode.js +18 -5
  68. package/dist/router/config/pi.js +4 -5
  69. package/dist/router/config/types.d.ts +17 -2
  70. package/dist/router/index.d.ts +76 -22
  71. package/dist/router/index.js +479 -548
  72. package/dist/router/utils.d.ts +2 -0
  73. package/dist/router/utils.js +16 -2
  74. package/dist/runner/agent-choices-common.d.ts +16 -0
  75. package/dist/runner/agent-choices-common.js +34 -0
  76. package/dist/runner/claude/runner.d.ts +47 -10
  77. package/dist/runner/claude/runner.js +117 -46
  78. package/dist/runner/claude/session.d.ts +166 -0
  79. package/dist/runner/claude/session.js +768 -0
  80. package/dist/runner/codex/app-server/protocol-types.d.ts +66 -39
  81. package/dist/runner/codex/app-server/protocol-types.js +2 -13
  82. package/dist/runner/codex/app-server/runner.d.ts +52 -59
  83. package/dist/runner/codex/app-server/runner.js +216 -338
  84. package/dist/runner/codex/app-server/translator.d.ts +8 -21
  85. package/dist/runner/codex/app-server/translator.js +45 -18
  86. package/dist/runner/codex/index.d.ts +0 -2
  87. package/dist/runner/codex/index.js +0 -2
  88. package/dist/runner/common/acp/protocol-helpers.d.ts +14 -0
  89. package/dist/runner/common/acp/protocol-helpers.js +21 -0
  90. package/dist/runner/common/acp/protocol-types.d.ts +271 -0
  91. package/dist/runner/common/acp/protocol-types.js +77 -0
  92. package/dist/runner/common/connection-based-runner.d.ts +111 -0
  93. package/dist/runner/common/connection-based-runner.js +261 -0
  94. package/dist/runner/{codex/app-server → common/jsonrpc}/client.d.ts +14 -7
  95. package/dist/runner/{codex/app-server → common/jsonrpc}/client.js +27 -18
  96. package/dist/runner/common/jsonrpc/connection-manager.d.ts +125 -0
  97. package/dist/runner/{codex/app-server → common/jsonrpc}/connection-manager.js +63 -28
  98. package/dist/runner/{codex/app-server → common/jsonrpc}/transport.d.ts +5 -4
  99. package/dist/runner/{codex/app-server → common/jsonrpc}/transport.js +18 -19
  100. package/dist/runner/common/jsonrpc/types.d.ts +32 -0
  101. package/dist/runner/common/jsonrpc/types.js +9 -0
  102. package/dist/runner/common/process-stopper.d.ts +2 -1
  103. package/dist/runner/common/process-stopper.js +1 -0
  104. package/dist/runner/common/runner-utils.d.ts +6 -13
  105. package/dist/runner/common/runner-utils.js +6 -47
  106. package/dist/runner/common/spawning-runner.d.ts +24 -70
  107. package/dist/runner/common/spawning-runner.js +98 -152
  108. package/dist/runner/dsh/client.d.ts +95 -0
  109. package/dist/runner/dsh/client.js +418 -0
  110. package/dist/runner/dsh/fake-dsh-server.d.ts +60 -0
  111. package/dist/runner/dsh/fake-dsh-server.js +156 -0
  112. package/dist/runner/dsh/index.d.ts +3 -0
  113. package/dist/runner/dsh/index.js +4 -0
  114. package/dist/runner/dsh/runner.d.ts +57 -0
  115. package/dist/runner/dsh/runner.js +191 -0
  116. package/dist/runner/dsh/translator.d.ts +28 -0
  117. package/dist/runner/dsh/translator.js +98 -0
  118. package/dist/runner/dsh/types.d.ts +155 -0
  119. package/dist/runner/dsh/types.js +14 -0
  120. package/dist/runner/index.d.ts +5 -4
  121. package/dist/runner/index.js +5 -4
  122. package/dist/runner/kimi/acp/runner.d.ts +106 -0
  123. package/dist/runner/kimi/acp/runner.js +516 -0
  124. package/dist/runner/kimi/acp/translator.d.ts +138 -0
  125. package/dist/runner/kimi/acp/translator.js +441 -0
  126. package/dist/runner/kimi/index.d.ts +1 -1
  127. package/dist/runner/kimi/index.js +1 -1
  128. package/dist/runner/opencode/acp/index.d.ts +1 -0
  129. package/dist/runner/opencode/acp/index.js +2 -0
  130. package/dist/runner/opencode/acp/runner.d.ts +121 -0
  131. package/dist/runner/opencode/acp/runner.js +429 -0
  132. package/dist/runner/opencode/acp/translator.d.ts +119 -0
  133. package/dist/runner/opencode/acp/translator.js +345 -0
  134. package/dist/runner/opencode/index.d.ts +1 -1
  135. package/dist/runner/opencode/index.js +1 -1
  136. package/dist/runner/pi/index.d.ts +1 -1
  137. package/dist/runner/pi/index.js +1 -1
  138. package/dist/runner/pi/rpc/client.d.ts +52 -0
  139. package/dist/runner/pi/rpc/client.js +114 -0
  140. package/dist/runner/pi/rpc/index.d.ts +4 -0
  141. package/dist/runner/pi/rpc/index.js +4 -0
  142. package/dist/runner/pi/rpc/protocol-types.d.ts +127 -0
  143. package/dist/runner/pi/rpc/protocol-types.js +21 -0
  144. package/dist/runner/pi/rpc/runner.d.ts +74 -0
  145. package/dist/runner/pi/rpc/runner.js +190 -0
  146. package/dist/runner/pi/rpc/translator.d.ts +55 -0
  147. package/dist/runner/pi/rpc/translator.js +258 -0
  148. package/dist/runner/probe.js +6 -1
  149. package/dist/runner/question-common.d.ts +26 -0
  150. package/dist/runner/question-common.js +42 -0
  151. package/dist/runner/registry.d.ts +7 -8
  152. package/dist/runner/registry.js +3 -4
  153. package/dist/runner/resolve-agent-choices.js +18 -59
  154. package/dist/runner/sync-agent-choices.js +16 -67
  155. package/dist/runner/types.d.ts +97 -14
  156. package/dist/session/claude/session-index.js +2 -3
  157. package/dist/session/claude/session-reader.js +3 -6
  158. package/dist/session/claude/sessions.js +43 -28
  159. package/dist/session/codex/rollout-reader.d.ts +2 -2
  160. package/dist/session/codex/rollout-reader.js +14 -17
  161. package/dist/session/codex/sessions.d.ts +1 -1
  162. package/dist/session/codex/sessions.js +2 -2
  163. package/dist/session/common/content-blocks.d.ts +7 -0
  164. package/dist/session/common/content-blocks.js +13 -9
  165. package/dist/session/common/jsonl.d.ts +8 -25
  166. package/dist/session/common/jsonl.js +126 -261
  167. package/dist/session/common/pagination.d.ts +28 -0
  168. package/dist/session/common/pagination.js +33 -0
  169. package/dist/session/dsh/index.d.ts +1 -0
  170. package/dist/session/dsh/index.js +2 -0
  171. package/dist/session/dsh/sessions.d.ts +39 -0
  172. package/dist/session/dsh/sessions.js +237 -0
  173. package/dist/session/index.d.ts +1 -0
  174. package/dist/session/index.js +1 -0
  175. package/dist/session/kimi/sessions.d.ts +34 -1
  176. package/dist/session/kimi/sessions.js +208 -98
  177. package/dist/session/opencode/sessions.d.ts +17 -3
  178. package/dist/session/opencode/sessions.js +29 -29
  179. package/dist/session/pi/sessions.d.ts +5 -1
  180. package/dist/session/pi/sessions.js +12 -16
  181. package/dist/session/session-store.d.ts +11 -1
  182. package/dist/session/session-store.js +75 -178
  183. package/dist/update/index.d.ts +2 -2
  184. package/dist/update/index.js +2 -2
  185. package/dist/update/install.d.ts +20 -2
  186. package/dist/update/install.js +51 -7
  187. package/dist/workspace/index.d.ts +4 -0
  188. package/dist/workspace/index.js +8 -1
  189. package/package.json +2 -1
  190. package/dist/runner/codex/app-server/connection-manager.d.ts +0 -56
  191. package/dist/runner/codex/argv.d.ts +0 -33
  192. package/dist/runner/codex/argv.js +0 -40
  193. package/dist/runner/codex/factory.d.ts +0 -29
  194. package/dist/runner/codex/factory.js +0 -39
  195. package/dist/runner/codex/jsonl.d.ts +0 -37
  196. package/dist/runner/codex/jsonl.js +0 -221
  197. package/dist/runner/codex/runner.d.ts +0 -66
  198. package/dist/runner/codex/runner.js +0 -129
  199. package/dist/runner/common/exec-translator.d.ts +0 -73
  200. package/dist/runner/common/exec-translator.js +0 -105
  201. package/dist/runner/kimi/jsonl.d.ts +0 -28
  202. package/dist/runner/kimi/jsonl.js +0 -143
  203. package/dist/runner/kimi/runner.d.ts +0 -49
  204. package/dist/runner/kimi/runner.js +0 -105
  205. package/dist/runner/opencode/argv.d.ts +0 -32
  206. package/dist/runner/opencode/argv.js +0 -35
  207. package/dist/runner/opencode/jsonl.d.ts +0 -68
  208. package/dist/runner/opencode/jsonl.js +0 -295
  209. package/dist/runner/opencode/runner.d.ts +0 -61
  210. package/dist/runner/opencode/runner.js +0 -93
  211. package/dist/runner/pi/jsonl.d.ts +0 -128
  212. package/dist/runner/pi/jsonl.js +0 -249
  213. package/dist/runner/pi/runner.d.ts +0 -36
  214. package/dist/runner/pi/runner.js +0 -76
  215. package/dist/session/common/catch-up.d.ts +0 -12
  216. package/dist/session/common/catch-up.js +0 -31
@@ -11,12 +11,13 @@
11
11
  * ```
12
12
  *
13
13
  * Note: This handles the **rollout file format** (historical logging), NOT the
14
- * `codex exec --json` stdout format. Those are two different JSONL formats
15
- * (see design doc appendix B vs C).
14
+ * `codex exec --json` stdout format(已随 exec 模式移除)。
16
15
  */
17
16
  import fs from 'node:fs';
18
17
  import path from 'node:path';
19
18
  import { readJsonlLines, findJsonlLine } from '../common/jsonl.js';
19
+ import { STALE_MS } from '../common/constants.js';
20
+ import { paginate, capEvents } from '../common/pagination.js';
20
21
  import { getLogger } from '../../logger/index.js';
21
22
  import { isRecord, stringValue } from '../../common/guards.js';
22
23
  import { resolveCodexHome } from '../../config/codex-config.js';
@@ -243,8 +244,6 @@ export function readCodexRollout(filePath) {
243
244
  */
244
245
  export function listCodexRollouts(opts = {}) {
245
246
  const codexHome = resolveCodexHome(opts.codexHome);
246
- const limit = opts.limit ?? 20;
247
- const offset = Math.max(0, opts.offset ?? 0);
248
247
  const filterCwd = opts.cwd;
249
248
  // Full index: every rollout file's session_meta + mtime, no early break.
250
249
  const index = getSessionIndex(codexHome);
@@ -263,8 +262,7 @@ export function listCodexRollouts(opts = {}) {
263
262
  // Same-mtime ties use filePath as a deterministic secondary key so index
264
263
  // rebuilds / walk order changes never reorder the page.
265
264
  matched.sort((a, b) => b.mtimeMs - a.mtimeMs || a.filePath.localeCompare(b.filePath));
266
- const total = matched.length;
267
- const page = matched.slice(offset, offset + limit);
265
+ const { items: page, total } = paginate(matched, { limit: opts.limit, offset: opts.offset });
268
266
  // Full-parse only the page being returned (summary/usage).
269
267
  const entries = [];
270
268
  for (const item of page) {
@@ -317,22 +315,14 @@ export function readCodexSessionContent(sessionId, opts = {}) {
317
315
  }
318
316
  // Apply maxEvents cap: keep the LAST N events (most recent).
319
317
  // See function docstring for rationale.
320
- // P2-7: maxEvents <= 0 returns [] — guards the `slice(-0) === slice(0)`
321
- // full-array trap (no caller passes 0 today, but the contract must hold).
322
- const events = opts.maxEvents !== undefined && opts.maxEvents > 0 && rollout.events.length > opts.maxEvents
323
- ? rollout.events.slice(-opts.maxEvents)
324
- : opts.maxEvents !== undefined && opts.maxEvents <= 0
325
- ? []
326
- : rollout.events;
318
+ const events = capEvents(rollout.events, opts.maxEvents);
327
319
  return {
328
320
  events,
329
321
  // displayTitle = LAST real user message (matches the
330
322
  // "最近输入" label). recap is undefined: codex has no
331
323
  // compact-summary concept, so never fake one from a user
332
324
  // message (was: firstUserMessage = injected project rules).
333
- displayTitle: rollout.lastRealUserMessage
334
- ? rollout.lastRealUserMessage.slice(0, 50)
335
- : undefined,
325
+ displayTitle: rollout.lastRealUserMessage || undefined,
336
326
  recap: undefined,
337
327
  usage: rollout.usage,
338
328
  };
@@ -347,7 +337,9 @@ export function readCodexSessionContent(sessionId, opts = {}) {
347
337
  */
348
338
  export function isCodexSessionActive(sessionId, opts = {}) {
349
339
  const codexHome = resolveCodexHome(opts.codexHome);
350
- const threshold = opts.activeThresholdMs ?? 10 * 60 * 1000; // 10 minutes default
340
+ // Unify with the other readers' 1-hour stale window (claude/pi/opencode/kimi
341
+ // all use STALE_MS). Previously codex used a divergent 10-minute default.
342
+ const threshold = opts.activeThresholdMs ?? STALE_MS;
351
343
  // P2-4: Use session index for direct file lookup + mtime check
352
344
  let index = getSessionIndex(codexHome);
353
345
  let entry = index.get(sessionId);
@@ -366,6 +358,11 @@ export function isCodexSessionActive(sessionId, opts = {}) {
366
358
  if (entry.isSubagent) {
367
359
  return false;
368
360
  }
361
+ // Cwd guard: when a cwd is provided, the session's working directory must
362
+ // match (align with claude/pi/opencode which validate cwd).
363
+ if (opts.cwd && entry.cwd !== opts.cwd) {
364
+ return false;
365
+ }
369
366
  // Re-stat to get fresh mtime (index may be up to INDEX_TTL_MS stale)
370
367
  try {
371
368
  const stat = fs.statSync(entry.filePath);
@@ -16,6 +16,6 @@ export declare class CodexSessionReader implements AgentSessionReader {
16
16
  readSessionContent(sessionId: string, cwd: string, opts?: {
17
17
  maxEvents?: number;
18
18
  }): SessionContent;
19
- isSessionActive(sessionId: string, _cwd: string): boolean;
19
+ isSessionActive(sessionId: string, cwd: string): boolean;
20
20
  }
21
21
  export {};
@@ -34,8 +34,8 @@ export class CodexSessionReader {
34
34
  cwd,
35
35
  });
36
36
  }
37
- isSessionActive(sessionId, _cwd) {
38
- return isCodexSessionActive(sessionId, { codexHome: this.codexHome });
37
+ isSessionActive(sessionId, cwd) {
38
+ return isCodexSessionActive(sessionId, { codexHome: this.codexHome, cwd });
39
39
  }
40
40
  }
41
41
  //# sourceMappingURL=sessions.js.map
@@ -10,6 +10,13 @@ interface ContentBlock {
10
10
  type: 'text' | 'thinking' | 'tool_use' | 'tool_result';
11
11
  content: string;
12
12
  }
13
+ /**
14
+ * Truncate a serialized tool-input string to 200 chars, collapsing newlines.
15
+ * Shared by content-block extraction and standalone wire-event readers (kimi
16
+ * tool.call) so the resume card never exceeds its 28KB budget on pathological
17
+ * args (e.g. whole-file writes / long prompts).
18
+ */
19
+ export declare function truncateToolInput(inputStr: string): string;
13
20
  /** Maps agent-specific field names to the generic extraction logic. */
14
21
  export interface ContentBlockMapping {
15
22
  /** The `type` value that identifies a tool-use block (e.g. 'tool_use' or 'toolCall'). */
@@ -5,6 +5,17 @@
5
5
  * tool_result blocks. The {@link ContentBlockMapping} type captures those
6
6
  * differences so a single implementation can serve all readers.
7
7
  */
8
+ /**
9
+ * Truncate a serialized tool-input string to 200 chars, collapsing newlines.
10
+ * Shared by content-block extraction and standalone wire-event readers (kimi
11
+ * tool.call) so the resume card never exceeds its 28KB budget on pathological
12
+ * args (e.g. whole-file writes / long prompts).
13
+ */
14
+ export function truncateToolInput(inputStr) {
15
+ if (inputStr.length <= 200)
16
+ return inputStr;
17
+ return inputStr.replace(/\n/g, ' ').slice(0, 197) + '...';
18
+ }
8
19
  /**
9
20
  * Extract content blocks from a message content array.
10
21
  *
@@ -34,16 +45,9 @@ export function extractContentBlocks(content, mapping) {
34
45
  // tool_use block (parameterized type name + input field)
35
46
  if (p.type === mapping.toolUseType && typeof p.name === 'string') {
36
47
  const rawInput = p[mapping.toolInputField] ?? {};
37
- const inputStr = JSON.stringify(rawInput, null, 2);
48
+ const inputStr = truncateToolInput(JSON.stringify(rawInput, null, 2));
38
49
  const label = `🔧 ${p.name}`;
39
- let body;
40
- if (inputStr.length > 200) {
41
- body = inputStr.replace(/\n/g, ' ').slice(0, 197) + '...';
42
- }
43
- else {
44
- body = inputStr;
45
- }
46
- blocks.push({ type: 'tool_use', content: `${label}: ${body}` });
50
+ blocks.push({ type: 'tool_use', content: `${label}: ${inputStr}` });
47
51
  }
48
52
  // tool_result block (parameterized type name + error field)
49
53
  if (p.type === mapping.toolResultType) {
@@ -18,14 +18,7 @@ export declare function readLastJsonlLine(filePath: string): string | null;
18
18
  * Read the last N non-empty lines from a JSONL file using streaming reads.
19
19
  *
20
20
  * Unlike `readJsonlLines` (which materializes the entire file into a `string[]`),
21
- * this only retains the last `n` lines — memory is O(n), not O(whole file). The
22
- * file is still read front-to-back in chunks (no reverse seek), but earlier
23
- * lines are discarded as soon as the buffer exceeds `n`, so a multi-MB file
24
- * costs only ~`n` line strings of resident memory.
25
- *
26
- * Used by tail-only read paths (P2-5) such as `isSessionActive`, which only
27
- * need to inspect the file's tail (e.g. the last ~20 loop events) but were
28
- * previously full-slurping the whole wire log.
21
+ * this only retains the last `n` lines — memory is O(n), not O(whole file).
29
22
  *
30
23
  * @param filePath Absolute path to a `.jsonl` file.
31
24
  * @param n Maximum number of trailing non-empty lines to retain.
@@ -37,32 +30,23 @@ export declare function readLastNJsonlLines(filePath: string, n: number): string
37
30
  * Stream-scan a JSONL file once, invoking `onLine` for each non-empty line
38
31
  * with the line's raw string and its **starting byte offset** within the file.
39
32
  *
40
- * Unlike `readJsonlLines` this retains NOTHING — memory is O(chunk), not
41
- * O(whole file). The callback receives the byte offset so callers can record
42
- * where a line of interest (e.g. the last user message) begins, then re-read
43
- * only the tail from that offset via `readJsonlLinesFromOffset` (P2-5
44
- * byte-offset two-pass: full-file scalar scan without materializing a
45
- * `string[]`, then tail-only re-parse for events).
33
+ * Memory is O(chunk), not O(whole file). The callback receives the byte offset
34
+ * so callers can record where a line of interest begins, then re-read only the
35
+ * tail from that offset via `readJsonlLinesFromOffset`.
46
36
  *
47
37
  * @param filePath Absolute path to a `.jsonl` file.
48
- * @param onLine Called for each non-empty line with `(line, offset)` where
49
- * `offset` is the byte offset of the line's first character.
38
+ * @param onLine Called for each non-empty line with `(line, offset)`.
50
39
  * @returns `true` if the file was opened and scanned, `false` on open error.
51
40
  */
52
41
  export declare function scanJsonlLines(filePath: string, onLine: (line: string, offset: number) => void): boolean;
53
42
  /**
54
43
  * Read all non-empty lines starting from a byte `offset` in a JSONL file.
55
44
  *
56
- * Companion to `scanJsonlLines` for the P2-5 byte-offset two-pass pattern:
57
- * pass 1 records the offset where the tail begins (e.g. the byte right after
58
- * the last user message); pass 2 seeks there and reads/parses only the tail,
59
- * so raw line-string memory is O(tail) instead of O(whole file).
45
+ * Companion to `scanJsonlLines` for the byte-offset two-pass pattern.
60
46
  *
61
47
  * @param filePath Absolute path to a `.jsonl` file.
62
48
  * @param offset Byte offset to seek to before reading. **Must fall on a line
63
- * boundary** (e.g. 0, or the start of the line after the last
64
- * user message as recorded by `scanJsonlLines`); a mid-line
65
- * offset will include a leading partial line.
49
+ * boundary**; a mid-line offset will include a leading partial line.
66
50
  * @returns Array of raw line strings from `offset` to EOF (empty lines
67
51
  * excluded). Empty array on open/seek error or `offset` past EOF.
68
52
  */
@@ -71,7 +55,6 @@ export declare function readJsonlLinesFromOffset(filePath: string, offset: numbe
71
55
  * Read all non-empty lines from a JSONL file using streaming reads.
72
56
  *
73
57
  * @param filePath Absolute path to a `.jsonl` file.
74
- * @param chunkSize Buffer size for each `fs.readSync` call (default 65536).
75
58
  * @returns Array of raw line strings (empty lines excluded).
76
59
  */
77
- export declare function readJsonlLines(filePath: string, chunkSize?: number): string[];
60
+ export declare function readJsonlLines(filePath: string): string[];