sideby 0.19.1 → 0.20.0
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.
- package/README.md +7 -4
- package/ai-tasks.json +28 -0
- package/dist/build.json +1 -1
- package/dist/src/cli/commands.d.ts +22 -1
- package/dist/src/cli/commands.js +815 -21
- package/dist/src/cli/format.d.ts +4 -0
- package/dist/src/cli/format.js +42 -4
- package/dist/src/cli/json-schemas.js +334 -4
- package/dist/src/cli/main.js +159 -13
- package/dist/src/core/accounts.d.ts +6 -0
- package/dist/src/core/accounts.js +12 -0
- package/dist/src/core/autostart.d.ts +11 -0
- package/dist/src/core/autostart.js +32 -5
- package/dist/src/core/browser-profiles.d.ts +23 -2
- package/dist/src/core/browser-profiles.js +148 -37
- package/dist/src/core/claude-settings-file.d.ts +18 -0
- package/dist/src/core/claude-settings-file.js +52 -3
- package/dist/src/core/config.d.ts +5 -0
- package/dist/src/core/config.js +12 -1
- package/dist/src/core/edit-settings.d.ts +7 -0
- package/dist/src/core/edit-settings.js +10 -5
- package/dist/src/core/history-group.d.ts +28 -0
- package/dist/src/core/history-group.js +47 -0
- package/dist/src/core/history-index.d.ts +145 -0
- package/dist/src/core/history-index.js +447 -0
- package/dist/src/core/history-project.d.ts +13 -0
- package/dist/src/core/history-project.js +87 -0
- package/dist/src/core/history.d.ts +210 -0
- package/dist/src/core/history.js +952 -0
- package/dist/src/core/inbound.d.ts +62 -0
- package/dist/src/core/inbound.js +215 -0
- package/dist/src/core/launch.d.ts +9 -1
- package/dist/src/core/launch.js +58 -24
- package/dist/src/core/live-sessions-copy.d.ts +5 -0
- package/dist/src/core/live-sessions-copy.js +46 -0
- package/dist/src/core/live-sessions-procs.d.ts +89 -0
- package/dist/src/core/live-sessions-procs.js +296 -0
- package/dist/src/core/live-sessions-title.d.ts +28 -0
- package/dist/src/core/live-sessions-title.js +80 -0
- package/dist/src/core/live-sessions.d.ts +68 -0
- package/dist/src/core/live-sessions.js +163 -0
- package/dist/src/core/login-check.d.ts +15 -0
- package/dist/src/core/login-check.js +32 -0
- package/dist/src/core/messages.d.ts +83 -0
- package/dist/src/core/messages.js +433 -0
- package/dist/src/core/project-categories.d.ts +14 -0
- package/dist/src/core/project-categories.js +48 -0
- package/dist/src/core/quota-fetch.d.ts +3 -3
- package/dist/src/core/quota-fetch.js +5 -5
- package/dist/src/core/quota-levels.d.ts +5 -0
- package/dist/src/core/quota-levels.js +5 -0
- package/dist/src/core/remote-control.d.ts +2 -0
- package/dist/src/core/remote-control.js +34 -59
- package/dist/src/core/run-link.d.ts +76 -0
- package/dist/src/core/run-link.js +245 -0
- package/dist/src/core/same-login.d.ts +4 -3
- package/dist/src/core/same-login.js +10 -7
- package/dist/src/core/session-select.d.ts +31 -0
- package/dist/src/core/session-select.js +44 -0
- package/dist/src/families/browser.d.ts +7 -18
- package/dist/src/families/browser.js +19 -8
- package/dist/src/families/claude/deliver.d.ts +2 -0
- package/dist/src/families/claude/deliver.js +43 -0
- package/dist/src/families/claude/history.d.ts +2 -0
- package/dist/src/families/claude/history.js +192 -0
- package/dist/src/families/claude/live-sessions.d.ts +13 -0
- package/dist/src/families/claude/live-sessions.js +117 -0
- package/dist/src/families/claude/messaging.d.ts +69 -0
- package/dist/src/families/claude/messaging.js +165 -0
- package/dist/src/families/claude/mod.d.ts +26 -0
- package/dist/src/families/claude/mod.js +105 -0
- package/dist/src/families/claude/session-files.d.ts +21 -0
- package/dist/src/families/claude/session-files.js +54 -0
- package/dist/src/families/codex/deliver.d.ts +5 -0
- package/dist/src/families/codex/deliver.js +76 -0
- package/dist/src/families/codex/history.d.ts +7 -0
- package/dist/src/families/codex/history.js +174 -0
- package/dist/src/families/codex/index.js +2 -0
- package/dist/src/families/codex/live-sessions.d.ts +12 -0
- package/dist/src/families/codex/live-sessions.js +193 -0
- package/dist/src/families/codex/quota.d.ts +3 -0
- package/dist/src/families/codex/quota.js +123 -0
- package/dist/src/families/codex/rate-limits.js +2 -0
- package/dist/src/families/codex/rollout.js +1 -1
- package/dist/src/families/grok/browser.d.ts +3 -0
- package/dist/src/families/grok/browser.js +5 -0
- package/dist/src/families/grok/history.d.ts +2 -0
- package/dist/src/families/grok/history.js +157 -0
- package/dist/src/families/grok/live-sessions.d.ts +4 -0
- package/dist/src/families/grok/live-sessions.js +80 -0
- package/dist/src/families/grok/login-key.d.ts +14 -0
- package/dist/src/families/grok/login-key.js +37 -0
- package/dist/src/families/history.d.ts +20 -0
- package/dist/src/families/history.js +81 -0
- package/dist/src/families/live-sessions.d.ts +26 -0
- package/dist/src/families/live-sessions.js +9 -0
- package/dist/src/families/login-keys.js +5 -1
- package/dist/src/families/messaging.d.ts +27 -0
- package/dist/src/families/messaging.js +6 -0
- package/dist/src/families/pi/history.d.ts +2 -0
- package/dist/src/families/pi/history.js +124 -0
- package/dist/src/families/pi/live-sessions.d.ts +2 -0
- package/dist/src/families/pi/live-sessions.js +70 -0
- package/dist/src/families/shared/history-text.d.ts +65 -0
- package/dist/src/families/shared/history-text.js +261 -0
- package/dist/src/menubar/hotkey.d.ts +86 -0
- package/dist/src/menubar/hotkey.js +159 -0
- package/dist/src/menubar/script.d.ts +2 -0
- package/dist/src/menubar/script.js +118 -22
- package/dist/src/menubar/snapshot.d.ts +8 -4
- package/dist/src/menubar/snapshot.js +45 -13
- package/dist/src/menubar/strings.d.ts +24 -6
- package/dist/src/menubar/strings.js +24 -6
- package/dist/src/panel/handler.d.ts +69 -0
- package/dist/src/panel/handler.js +686 -15
- package/dist/src/panel/i18n.d.ts +304 -3
- package/dist/src/panel/i18n.js +620 -18
- package/dist/src/panel/orca.d.ts +48 -0
- package/dist/src/panel/orca.js +153 -0
- package/dist/src/panel/page-logic.d.ts +255 -13
- package/dist/src/panel/page-logic.js +483 -1
- package/dist/src/panel/page-script.js +2260 -204
- package/dist/src/panel/page-styles.js +404 -32
- package/dist/src/panel/page.js +1 -0
- package/dist/src/plugins/check.js +16 -4
- package/dist/src/plugins/loader.d.ts +8 -1
- package/dist/src/plugins/loader.js +72 -7
- package/dist/src/runtime.d.ts +5 -0
- package/dist/src/runtime.js +27 -5
- package/dist/src/types.d.ts +116 -1
- package/dist/testing/index.d.ts +5 -0
- package/dist/testing/index.js +5 -0
- package/mods/claude/.claude-plugin/plugin.json +7 -0
- package/mods/claude/hooks/hooks.json +1 -0
- package/mods/claude/hooks/register.js +261 -0
- package/package.json +5 -2
- package/schemas/autostart.json +74 -1
- package/schemas/browser-set.json +110 -0
- package/schemas/browser.json +22 -2
- package/schemas/config.json +26 -1
- package/schemas/history-index.json +209 -0
- package/schemas/history-projects.json +133 -0
- package/schemas/history-show.json +275 -0
- package/schemas/history.json +410 -0
- package/schemas/menubar-hotkey.json +139 -0
- package/schemas/menubar-snapshot.json +36 -2
- package/schemas/menubar.json +74 -1
- package/schemas/messages-inbound.json +258 -0
- package/schemas/messages.json +164 -0
- package/schemas/send.json +165 -0
- package/schemas/sessions-copy.json +113 -0
- package/schemas/sessions-open-run.json +97 -0
- package/schemas/sessions.json +237 -0
- package/skills/sideby/SKILL.md +10 -5
- package/skills/sideby/references/accounts.md +11 -0
- package/skills/sideby/references/ai-tasks.md +17 -1
- package/skills/sideby/references/panel.md +6 -4
- package/skills/sideby/references/quota.md +2 -2
- package/skills/sideby/references/sessions.md +79 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
// The Project of a Session (spec §3.33): the git repository its working directory is in. A worktree's `.git` is a
|
|
2
|
+
// file naming `<main>/.git/worktrees/<name>`, so worktrees fold into their main repository. A folder that is gone
|
|
3
|
+
// keeps the root the Host recorded, else itself.
|
|
4
|
+
import { readFile, stat } from 'node:fs/promises';
|
|
5
|
+
import { basename, dirname, isAbsolute, join, resolve, sep } from 'node:path';
|
|
6
|
+
async function kind(p) {
|
|
7
|
+
try {
|
|
8
|
+
const st = await stat(p);
|
|
9
|
+
return st.isDirectory() ? 'dir' : st.isFile() ? 'file' : 'none';
|
|
10
|
+
}
|
|
11
|
+
catch {
|
|
12
|
+
return 'none';
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
/** The main repository a worktree's `.git` file points into, when it has the usual `.git/worktrees/<name>` form. */
|
|
16
|
+
async function worktreeMain(gitFile) {
|
|
17
|
+
try {
|
|
18
|
+
const text = await readFile(gitFile, 'utf8');
|
|
19
|
+
const m = /^gitdir:\s*(.+)$/m.exec(text);
|
|
20
|
+
if (!m)
|
|
21
|
+
return undefined;
|
|
22
|
+
const gitdir = resolve(dirname(gitFile), m[1].trim());
|
|
23
|
+
const at = gitdir.lastIndexOf(`${sep}.git${sep}worktrees${sep}`);
|
|
24
|
+
return at > 0 ? gitdir.slice(0, at) : undefined;
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
/** Resolves Projects, remembering each working directory for the life of this object. */
|
|
31
|
+
export class ProjectResolver {
|
|
32
|
+
#memo = new Map();
|
|
33
|
+
resolve(cwd, hostRoot) {
|
|
34
|
+
const key = `${cwd ?? ''}\0${hostRoot ?? ''}`;
|
|
35
|
+
let p = this.#memo.get(key);
|
|
36
|
+
if (!p) {
|
|
37
|
+
p = this.#find(cwd, hostRoot);
|
|
38
|
+
this.#memo.set(key, p);
|
|
39
|
+
}
|
|
40
|
+
return p;
|
|
41
|
+
}
|
|
42
|
+
async #find(cwd, hostRoot) {
|
|
43
|
+
if (!cwd || !isAbsolute(cwd))
|
|
44
|
+
return { path: hostRoot ?? cwd ?? '', gone: false };
|
|
45
|
+
if ((await kind(cwd)) !== 'dir') {
|
|
46
|
+
const root = hostRoot && isAbsolute(hostRoot) ? hostRoot : cwd;
|
|
47
|
+
const main = (await kind(join(root, '.git'))) === 'file' ? await worktreeMain(join(root, '.git')) : undefined;
|
|
48
|
+
return { path: main ?? root, gone: true };
|
|
49
|
+
}
|
|
50
|
+
for (let dir = resolve(cwd);;) {
|
|
51
|
+
const git = await kind(join(dir, '.git'));
|
|
52
|
+
if (git === 'dir')
|
|
53
|
+
return { path: dir, gone: false };
|
|
54
|
+
if (git === 'file')
|
|
55
|
+
return { path: (await worktreeMain(join(dir, '.git'))) ?? dir, gone: false };
|
|
56
|
+
const up = dirname(dir);
|
|
57
|
+
if (up === dir)
|
|
58
|
+
return { path: resolve(cwd), gone: false };
|
|
59
|
+
dir = up;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
/** A short name for a Project: its folder name, with as many parent folders as it takes to tell it from another Project of the same name. */
|
|
64
|
+
export function projectNames(paths) {
|
|
65
|
+
const byBase = new Map();
|
|
66
|
+
for (const p of new Set(paths)) {
|
|
67
|
+
const b = basename(p) || p;
|
|
68
|
+
byBase.set(b, [...(byBase.get(b) ?? []), p]);
|
|
69
|
+
}
|
|
70
|
+
const out = new Map();
|
|
71
|
+
for (const [b, list] of byBase) {
|
|
72
|
+
if (list.length === 1) {
|
|
73
|
+
out.set(list[0], b);
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
const parts = list.map((p) => p.split(/[\\/]+/).filter(Boolean));
|
|
77
|
+
const tail = (seg, n) => seg.slice(-n).join('/');
|
|
78
|
+
for (const [i, p] of list.entries()) {
|
|
79
|
+
const seg = parts[i];
|
|
80
|
+
let n = 2;
|
|
81
|
+
while (n < seg.length && parts.some((o, j) => j !== i && tail(o, n) === tail(seg, n)))
|
|
82
|
+
n++;
|
|
83
|
+
out.set(p, tail(seg, n));
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return out;
|
|
87
|
+
}
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import type { Runtime } from '../runtime.ts';
|
|
2
|
+
import { type GroupBy } from './history-group.ts';
|
|
3
|
+
export type IndexState = 'building' | 'ready' | 'off' | 'unavailable';
|
|
4
|
+
export interface HistorySource {
|
|
5
|
+
account: string;
|
|
6
|
+
accountLabel: string;
|
|
7
|
+
family: string;
|
|
8
|
+
/** Sessions stored for the Account. */
|
|
9
|
+
sessions: number;
|
|
10
|
+
/** Record files found. */
|
|
11
|
+
files: number;
|
|
12
|
+
/** Record files that could not be read. */
|
|
13
|
+
failed: number;
|
|
14
|
+
/** Why the Account has no Sessions or could not be listed, in plain words. */
|
|
15
|
+
note?: string;
|
|
16
|
+
/** The same reason as a code: no record files, records without a conversation, a folder that could not be read,
|
|
17
|
+
* or a Family sideby reads no history for. */
|
|
18
|
+
reason?: 'empty' | 'no-conversation' | 'unreadable' | 'unsupported';
|
|
19
|
+
}
|
|
20
|
+
export interface HistorySession {
|
|
21
|
+
account: string;
|
|
22
|
+
accountLabel: string;
|
|
23
|
+
family: string;
|
|
24
|
+
sessionId: string;
|
|
25
|
+
title: string;
|
|
26
|
+
titleFrom: string;
|
|
27
|
+
project: string;
|
|
28
|
+
projectName: string;
|
|
29
|
+
cwd: string;
|
|
30
|
+
cwdGone?: boolean;
|
|
31
|
+
branch?: string;
|
|
32
|
+
model?: string;
|
|
33
|
+
startedAt: string;
|
|
34
|
+
updatedAt: string;
|
|
35
|
+
messages: number;
|
|
36
|
+
script: boolean;
|
|
37
|
+
parent?: string;
|
|
38
|
+
children: number;
|
|
39
|
+
/** The first prompt on one line, when it says more than the title. */
|
|
40
|
+
preview?: string;
|
|
41
|
+
snippet?: string;
|
|
42
|
+
live: boolean;
|
|
43
|
+
transcript: string;
|
|
44
|
+
resumeCommand: string;
|
|
45
|
+
continueCommand: string;
|
|
46
|
+
reference: string;
|
|
47
|
+
/** The key of the group the Session is listed under, when the list is grouped. */
|
|
48
|
+
group?: string;
|
|
49
|
+
/** `tools` when the words were found only in its tool output (`sideby history --tools`). */
|
|
50
|
+
foundIn?: 'tools';
|
|
51
|
+
}
|
|
52
|
+
export interface IndexProgress {
|
|
53
|
+
state: IndexState;
|
|
54
|
+
/** Files read in the current build, and how many it has to read. */
|
|
55
|
+
progress: {
|
|
56
|
+
done: number;
|
|
57
|
+
total: number;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
export interface HistoryGroup {
|
|
61
|
+
/** The Project path, Category name, Account ref, Family id or day (`today`, `yesterday`, `week`, `month`,
|
|
62
|
+
* `older`); '' for Sessions without one, listed last. */
|
|
63
|
+
key: string;
|
|
64
|
+
label: string;
|
|
65
|
+
/** Sessions in the group, collapsed or not. */
|
|
66
|
+
sessions: number;
|
|
67
|
+
updatedAt: string;
|
|
68
|
+
collapsed?: boolean;
|
|
69
|
+
}
|
|
70
|
+
export interface HistoryResult extends IndexProgress {
|
|
71
|
+
sessions: HistorySession[];
|
|
72
|
+
/** Sessions in the paged list: the matches, without those in collapsed groups. */
|
|
73
|
+
total: number;
|
|
74
|
+
/** The groups of every match, in order, when `group` is set and not `none`. */
|
|
75
|
+
groups?: HistoryGroup[];
|
|
76
|
+
/** Set when a Plugin sorts Projects into categories: what they are called and which Plugin. */
|
|
77
|
+
categories?: {
|
|
78
|
+
label: string;
|
|
79
|
+
from: string;
|
|
80
|
+
};
|
|
81
|
+
sources: HistorySource[];
|
|
82
|
+
problems: string[];
|
|
83
|
+
}
|
|
84
|
+
export type Since = 'today' | '7d' | '30d' | 'all';
|
|
85
|
+
export interface HistoryQuery {
|
|
86
|
+
/** Words, split on white space; every word must match. */
|
|
87
|
+
q?: string;
|
|
88
|
+
/** A Project path, or a Project name as `history projects` shows it. */
|
|
89
|
+
project?: string;
|
|
90
|
+
family?: string;
|
|
91
|
+
/** An Account ref or Alias. */
|
|
92
|
+
account?: string;
|
|
93
|
+
since?: Since;
|
|
94
|
+
scripts?: boolean;
|
|
95
|
+
/** A Project Category: only Sessions in its Projects. */
|
|
96
|
+
category?: string;
|
|
97
|
+
/** List the Sessions under group headers; `none` (the default) lists them as one. */
|
|
98
|
+
group?: GroupBy;
|
|
99
|
+
/** Group keys whose Sessions are counted but left out of the page. */
|
|
100
|
+
collapsed?: string[];
|
|
101
|
+
limit?: number;
|
|
102
|
+
offset?: number;
|
|
103
|
+
}
|
|
104
|
+
export declare const historyIndexPath: (rt: Pick<Runtime, 'paths'>) => string;
|
|
105
|
+
/** Closes the History Index of `rt` (tests), after the open, sync and reads in flight end. */
|
|
106
|
+
export declare function closeHistory(rt: Runtime): Promise<void>;
|
|
107
|
+
/**
|
|
108
|
+
* Brings the History Index in step with the Hosts' files: lists every Account's record files, forgets the ones that
|
|
109
|
+
* are gone, and reads the new or changed ones, newest first. One sync runs at a time; a call while one runs waits for
|
|
110
|
+
* it. An Account that cannot be listed keeps the Sessions already stored for it.
|
|
111
|
+
*/
|
|
112
|
+
export declare function syncHistory(rt: Runtime, opts?: {
|
|
113
|
+
force?: boolean;
|
|
114
|
+
}): Promise<void>;
|
|
115
|
+
/** How long a listing waits for a first build before it answers with what is built so far. */
|
|
116
|
+
export declare const FIRST_ANSWER_MS = 2500;
|
|
117
|
+
/** Starts a sync without waiting for it; what is already built answers at once. */
|
|
118
|
+
export declare function syncHistoryInBackground(rt: Runtime): void;
|
|
119
|
+
/** True once a first build finished (the Panel then answers without waiting). */
|
|
120
|
+
export declare const historyBuilt: (rt: Runtime) => boolean;
|
|
121
|
+
/**
|
|
122
|
+
* The Projects a name given to `--project` may mean: the one whose shown name it is, else every Project whose path
|
|
123
|
+
* ends with it. A shown name is unique, so it wins over a path tail it shares with a longer path (`a/app` for
|
|
124
|
+
* `/a/app` beside `/x/a/app`).
|
|
125
|
+
*/
|
|
126
|
+
export declare function projectsNamed(names: ReadonlyMap<string, string>, p: string): string[];
|
|
127
|
+
/** A snippet of `text` around the first of `words` it contains, about 40 characters each side. */
|
|
128
|
+
export declare function snippetOf(text: string, words: string[]): string | undefined;
|
|
129
|
+
/** The words of a search; `"two words"` in double quotes is one phrase, matched as written. */
|
|
130
|
+
export declare const splitWords: (q: string | undefined) => string[];
|
|
131
|
+
/**
|
|
132
|
+
* Sessions matching `q`, best first (relevance times a recency boost that halves every 7 days), or newest first
|
|
133
|
+
* without words. Answers from what is built; `wait` waits for the current sync first (the CLI's first run).
|
|
134
|
+
* `live` names Sessions running now, as `<account>\0<sessionId>`.
|
|
135
|
+
*/
|
|
136
|
+
export declare function searchHistory(rt: Runtime, q: HistoryQuery, opts?: {
|
|
137
|
+
wait?: boolean;
|
|
138
|
+
live?: ReadonlySet<string>;
|
|
139
|
+
}): Promise<HistoryResult>;
|
|
140
|
+
export interface ProjectEntry {
|
|
141
|
+
project: string;
|
|
142
|
+
name: string;
|
|
143
|
+
sessions: number;
|
|
144
|
+
updatedAt: string;
|
|
145
|
+
gone?: boolean;
|
|
146
|
+
/** Its Project Category, when a Plugin sorts Projects into categories. */
|
|
147
|
+
category?: string;
|
|
148
|
+
}
|
|
149
|
+
/** Every Project with its number of Sessions, most recent first. */
|
|
150
|
+
export declare function historyProjects(rt: Runtime, q?: Pick<HistoryQuery, 'family' | 'account' | 'since' | 'scripts'>, opts?: {
|
|
151
|
+
wait?: boolean;
|
|
152
|
+
}): Promise<{
|
|
153
|
+
projects: ProjectEntry[];
|
|
154
|
+
categories?: {
|
|
155
|
+
label: string;
|
|
156
|
+
from: string;
|
|
157
|
+
};
|
|
158
|
+
problems?: string[];
|
|
159
|
+
} & IndexProgress>;
|
|
160
|
+
export interface ShownMessage {
|
|
161
|
+
n: number;
|
|
162
|
+
role: 'user' | 'assistant' | 'tool';
|
|
163
|
+
text: string;
|
|
164
|
+
at?: string;
|
|
165
|
+
tool?: string;
|
|
166
|
+
}
|
|
167
|
+
export interface HistoryShow {
|
|
168
|
+
session: HistorySession;
|
|
169
|
+
messages: ShownMessage[];
|
|
170
|
+
/** Pass as `before` for the messages before these; absent when these start at the first one. */
|
|
171
|
+
before?: number;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* One Session's messages, oldest first: the newest `limit` (default 200) before message `before`. `id` is the
|
|
175
|
+
* Session id or its first eight characters or more.
|
|
176
|
+
*/
|
|
177
|
+
export declare function historyShow(rt: Runtime, id: string, opts?: {
|
|
178
|
+
before?: number;
|
|
179
|
+
limit?: number;
|
|
180
|
+
account?: string;
|
|
181
|
+
}): Promise<HistoryShow>;
|
|
182
|
+
export interface IndexInfo extends IndexProgress {
|
|
183
|
+
enabled: boolean;
|
|
184
|
+
path: string;
|
|
185
|
+
files: number;
|
|
186
|
+
sessions: number;
|
|
187
|
+
bytes: number;
|
|
188
|
+
sources: HistorySource[];
|
|
189
|
+
cleared?: boolean;
|
|
190
|
+
}
|
|
191
|
+
/** The History Index's state; with `clear` it is deleted first (and rebuilt by the next listing when on). */
|
|
192
|
+
export declare function historyIndexInfo(rt: Runtime, opts?: {
|
|
193
|
+
clear?: boolean;
|
|
194
|
+
wait?: boolean;
|
|
195
|
+
rebuild?: boolean;
|
|
196
|
+
}): Promise<IndexInfo>;
|
|
197
|
+
export interface ToolHit {
|
|
198
|
+
session: HistorySession;
|
|
199
|
+
snippet: string;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Reads the record files of the Sessions in scope, newest first, for `words` anywhere in them (tool output included),
|
|
203
|
+
* and yields each Session in which every word appears. Nothing read is kept. Stops when `signal` aborts.
|
|
204
|
+
*/
|
|
205
|
+
export declare function scanToolOutput(rt: Runtime, q: HistoryQuery, opts?: {
|
|
206
|
+
signal?: AbortSignal;
|
|
207
|
+
skip?: ReadonlySet<string>;
|
|
208
|
+
live?: ReadonlySet<string>;
|
|
209
|
+
onProgress?: (done: number, total: number) => void | Promise<void>;
|
|
210
|
+
}): AsyncGenerator<ToolHit>;
|