@wrongstack/tui 0.306.2 → 0.306.3

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.
@@ -9,6 +9,11 @@
9
9
  import type { InputBuilder } from '@wrongstack/core/agent';
10
10
  import type { Action, State } from '../app-reducer.js';
11
11
  import { type TokenPreviewStore } from '../token-previews.js';
12
+ /**
13
+ * Keystroke coalescing window for `@`-file search. Long enough to swallow a
14
+ * burst of typing, short enough that the results feel attached to the keys.
15
+ */
16
+ export declare const FILE_SEARCH_DEBOUNCE_MS = 150;
12
17
  /**
13
18
  * Find an active `@<query>` token at the cursor. The token starts at the
14
19
  * last `@` not preceded by a non-whitespace char, and runs up to the cursor
@@ -0,0 +1,30 @@
1
+ /**
2
+ * use-history-archive — wires {@link HistoryArchive} into the scroll-back path.
3
+ *
4
+ * The reducer caps the in-memory window (`retainTuiHistory`), so entries that
5
+ * age out are gone from `state.entries`. This hook mirrors every entry to a
6
+ * disk-backed JSONL archive as it appears, and serves pages back when the user
7
+ * scrolls past the oldest in-memory entry. Without it `onRequestOlderEntries`
8
+ * resolves with zero entries and scroll-back silently dead-ends.
9
+ *
10
+ * Scope is one process run. The archive file is truncated at startup because
11
+ * entry ids restart at 1 on resume (`replaySessionMessages(..., 1)`) — keeping
12
+ * a previous run's lines would collide ids and duplicate rows in the view.
13
+ * Cross-run history is `/resume`'s job, not the scroll window's.
14
+ */
15
+ import type { Action } from '../app-reducer.js';
16
+ import type { HistoryEntry } from '../history-entry.js';
17
+ export interface UseHistoryArchiveOptions {
18
+ entries: readonly HistoryEntry[];
19
+ dispatch: React.Dispatch<Action>;
20
+ /** Root of the session store. Absent for ephemeral (`--no-session`) runs. */
21
+ sessionsDir?: string | undefined;
22
+ /** Current session id; the archive lives beside the session's own files. */
23
+ sessionId?: string | undefined;
24
+ }
25
+ export interface HistoryArchiveResult {
26
+ /** Passed to <ScrollableHistory>; fires when the user reaches the oldest row. */
27
+ onRequestOlderEntries: () => void;
28
+ }
29
+ export declare function useHistoryArchive({ entries, dispatch, sessionsDir, sessionId, }: UseHistoryArchiveOptions): HistoryArchiveResult;
30
+ //# sourceMappingURL=use-history-archive.d.ts.map