ai-hist 0.3.7 → 0.6.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 +100 -2
- package/dist/cloud-client.d.ts +1 -0
- package/dist/cloud-client.d.ts.map +1 -1
- package/dist/cloud-client.js +2 -0
- package/dist/cloud-client.js.map +1 -1
- package/dist/cloud-push.d.ts +51 -0
- package/dist/cloud-push.d.ts.map +1 -0
- package/dist/cloud-push.js +113 -0
- package/dist/cloud-push.js.map +1 -0
- package/dist/cloud-push.test.d.ts +2 -0
- package/dist/cloud-push.test.d.ts.map +1 -0
- package/dist/cloud-push.test.js +82 -0
- package/dist/cloud-push.test.js.map +1 -0
- package/dist/index.d.ts +119 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +304 -10
- package/dist/index.js.map +1 -1
- package/dist/jsonl-sources.d.ts +4 -6
- package/dist/jsonl-sources.d.ts.map +1 -1
- package/dist/jsonl-sources.js +9 -12
- package/dist/jsonl-sources.js.map +1 -1
- package/dist/mcp-server.js +116 -1
- package/dist/mcp-server.js.map +1 -1
- package/dist/mcp-smoke.test.js +194 -44
- package/dist/mcp-smoke.test.js.map +1 -1
- package/dist/session-catalog.d.ts +257 -0
- package/dist/session-catalog.d.ts.map +1 -0
- package/dist/session-catalog.js +340 -0
- package/dist/session-catalog.js.map +1 -0
- package/dist/session-catalog.test.d.ts +2 -0
- package/dist/session-catalog.test.d.ts.map +1 -0
- package/dist/session-catalog.test.js +710 -0
- package/dist/session-catalog.test.js.map +1 -0
- package/dist/session-events.test.d.ts +2 -0
- package/dist/session-events.test.d.ts.map +1 -0
- package/dist/session-events.test.js +177 -0
- package/dist/session-events.test.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session catalog: the materialized shallow index of coding-agent sessions.
|
|
3
|
+
*
|
|
4
|
+
* Two halves, deliberately split by who owns the write:
|
|
5
|
+
*
|
|
6
|
+
* - **Cache-only listing** — `AiHist.listSessionCatalog()` in `index.ts`
|
|
7
|
+
* reads the `sessions` table and nothing else. No provider file is opened,
|
|
8
|
+
* no `history` / `session_events` scan happens. This module supplies the
|
|
9
|
+
* row type and the raw-row → `CatalogSession` mapping it uses.
|
|
10
|
+
* - **Shallow discovery** — `discoverSessions()` here drives
|
|
11
|
+
* `ai-hist sessions discover --json`, which scans the known provider
|
|
12
|
+
* locations with bounded reads and upserts the catalog. It is a top-level
|
|
13
|
+
* function rather than an `AiHist` method because discovery *writes* the
|
|
14
|
+
* on-disk database, and an `AiHist` instance is an in-memory snapshot taken
|
|
15
|
+
* at open time — a method would hand back a reader that cannot see the rows
|
|
16
|
+
* it just wrote. Re-open (or `openAiHist` again) afterwards to read them.
|
|
17
|
+
*
|
|
18
|
+
* The Rust CLI stays the single source of truth for discovery (provider
|
|
19
|
+
* locations, bounded reads, global recency ordering, stamp comparison), exactly
|
|
20
|
+
* as `cloud-push.ts` defers to `ai-hist push` for the push pipeline.
|
|
21
|
+
*/
|
|
22
|
+
import { spawn } from 'node:child_process';
|
|
23
|
+
import { StringDecoder } from 'node:string_decoder';
|
|
24
|
+
import { resolveAiHistBinary } from './cloud-push.js';
|
|
25
|
+
/**
|
|
26
|
+
* Version of the session-catalog output contract this SDK understands.
|
|
27
|
+
* Mirrors the native `SESSION_CATALOG_CONTRACT_VERSION`; a `summary` whose
|
|
28
|
+
* `contractVersion` differs came from a binary that speaks a different dialect.
|
|
29
|
+
*/
|
|
30
|
+
export const SESSION_CATALOG_CONTRACT_VERSION = 1;
|
|
31
|
+
/**
|
|
32
|
+
* A discovery run that could not be completed or trusted.
|
|
33
|
+
*
|
|
34
|
+
* The native command emits its diagnostics and the summary trailer even when
|
|
35
|
+
* every provider fails, so a failed run still carries everything it managed to
|
|
36
|
+
* learn: `diagnostics` says which sources broke and why, and `summary` (when
|
|
37
|
+
* the trailer arrived) says what the run actually did. `stderr` and `exitCode`
|
|
38
|
+
* carry the process-level detail.
|
|
39
|
+
*/
|
|
40
|
+
export class DiscoveryError extends Error {
|
|
41
|
+
exitCode;
|
|
42
|
+
stderr;
|
|
43
|
+
diagnostics;
|
|
44
|
+
summary;
|
|
45
|
+
constructor(message, details = {}) {
|
|
46
|
+
super(message);
|
|
47
|
+
this.name = 'DiscoveryError';
|
|
48
|
+
this.exitCode = details.exitCode ?? null;
|
|
49
|
+
this.stderr = details.stderr ?? '';
|
|
50
|
+
this.diagnostics = details.diagnostics ?? [];
|
|
51
|
+
this.summary = details.summary ?? null;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
const AI_HIST_RUST_BIN_ENV = 'AI_HIST_RUST_BIN';
|
|
55
|
+
/** Spawn failures that all mean the same thing: no usable binary. */
|
|
56
|
+
const MISSING_BINARY_CODES = new Set(['ENOENT', 'EACCES', 'EPERM', 'ENOTDIR', 'EISDIR']);
|
|
57
|
+
function str(value) {
|
|
58
|
+
return typeof value === 'string' ? value : null;
|
|
59
|
+
}
|
|
60
|
+
function num(value) {
|
|
61
|
+
return typeof value === 'number' && Number.isFinite(value) ? value : null;
|
|
62
|
+
}
|
|
63
|
+
function count(value) {
|
|
64
|
+
return num(value) ?? 0;
|
|
65
|
+
}
|
|
66
|
+
function stringList(value) {
|
|
67
|
+
return Array.isArray(value) ? value.filter((item) => typeof item === 'string') : [];
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Parse a JSON string array column (`models_json`, `workspace_roots_json`).
|
|
71
|
+
* `NULL`, `''`, and malformed JSON all mean "nothing observed" → `[]`; the
|
|
72
|
+
* column never stores `[]` itself.
|
|
73
|
+
*/
|
|
74
|
+
export function parseJsonStringList(raw) {
|
|
75
|
+
if (typeof raw !== 'string' || raw.length === 0)
|
|
76
|
+
return [];
|
|
77
|
+
try {
|
|
78
|
+
return stringList(JSON.parse(raw));
|
|
79
|
+
}
|
|
80
|
+
catch {
|
|
81
|
+
return [];
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
/** `NULL` `discovery_state` predates the catalog and means a fully ingested row. */
|
|
85
|
+
export function normalizeDiscoveryState(raw) {
|
|
86
|
+
return raw === 'shallow' ? 'shallow' : 'full';
|
|
87
|
+
}
|
|
88
|
+
/** Map one snake_case CLI/`sessions`-row object onto a {@link CatalogSession}. */
|
|
89
|
+
export function catalogSessionFromJson(raw) {
|
|
90
|
+
return {
|
|
91
|
+
source: (str(raw.source) ?? ''),
|
|
92
|
+
sessionId: str(raw.session_id) ?? '',
|
|
93
|
+
cwd: str(raw.cwd),
|
|
94
|
+
gitBranch: str(raw.git_branch),
|
|
95
|
+
firstActivityMs: num(raw.first_activity_ms),
|
|
96
|
+
lastActivityMs: num(raw.last_activity_ms),
|
|
97
|
+
firstPrompt: str(raw.first_prompt),
|
|
98
|
+
lastAssistantText: str(raw.last_assistant_text),
|
|
99
|
+
// Discovery emits parsed arrays; a raw table row carries the JSON text.
|
|
100
|
+
models: Array.isArray(raw.models) ? stringList(raw.models) : parseJsonStringList(str(raw.models_json)),
|
|
101
|
+
originator: str(raw.originator),
|
|
102
|
+
agentVersion: str(raw.agent_version),
|
|
103
|
+
repoUrl: str(raw.repo_url),
|
|
104
|
+
initialCommit: str(raw.initial_commit),
|
|
105
|
+
workspaceRoots: Array.isArray(raw.workspace_roots)
|
|
106
|
+
? stringList(raw.workspace_roots)
|
|
107
|
+
: parseJsonStringList(str(raw.workspace_roots_json)),
|
|
108
|
+
rawPath: str(raw.raw_path),
|
|
109
|
+
sourceStamp: str(raw.source_stamp),
|
|
110
|
+
discoveryState: normalizeDiscoveryState(raw.discovery_state),
|
|
111
|
+
fromCache: raw.from_cache === true,
|
|
112
|
+
...(num(raw.parser_version) != null ? { parserVersion: num(raw.parser_version) } : {}),
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
function diagnosticFromJson(raw) {
|
|
116
|
+
return {
|
|
117
|
+
source: str(raw.source) ?? '',
|
|
118
|
+
locator: str(raw.locator),
|
|
119
|
+
error: str(raw.error) ?? '',
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
function providerSummaryFromJson(raw) {
|
|
123
|
+
const obj = (typeof raw === 'object' && raw !== null ? raw : {});
|
|
124
|
+
return {
|
|
125
|
+
candidates: count(obj.candidates),
|
|
126
|
+
discovered: count(obj.discovered),
|
|
127
|
+
skippedUnchanged: count(obj.skipped_unchanged),
|
|
128
|
+
failed: obj.failed === true,
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
function summaryFromJson(raw) {
|
|
132
|
+
const providersRaw = (typeof raw.providers === 'object' && raw.providers !== null
|
|
133
|
+
? raw.providers
|
|
134
|
+
: {});
|
|
135
|
+
const providers = {};
|
|
136
|
+
for (const [source, value] of Object.entries(providersRaw)) {
|
|
137
|
+
providers[source] = providerSummaryFromJson(value);
|
|
138
|
+
}
|
|
139
|
+
const countersRaw = (typeof raw.counters === 'object' && raw.counters !== null
|
|
140
|
+
? raw.counters
|
|
141
|
+
: {});
|
|
142
|
+
return {
|
|
143
|
+
contractVersion: count(raw.contract_version),
|
|
144
|
+
discovered: count(raw.discovered),
|
|
145
|
+
skippedUnchanged: count(raw.skipped_unchanged),
|
|
146
|
+
providers,
|
|
147
|
+
exemptSources: Array.isArray(raw.exempt_sources)
|
|
148
|
+
? raw.exempt_sources
|
|
149
|
+
.filter((item) => typeof item === 'object' && item !== null)
|
|
150
|
+
.map((item) => ({ source: str(item.source) ?? '', reason: str(item.reason) ?? '' }))
|
|
151
|
+
: [],
|
|
152
|
+
counters: {
|
|
153
|
+
candidatesEnumerated: count(countersRaw.candidates_enumerated),
|
|
154
|
+
shallowReads: count(countersRaw.shallow_reads),
|
|
155
|
+
skippedUnchanged: count(countersRaw.skipped_unchanged),
|
|
156
|
+
filesOpened: count(countersRaw.files_opened),
|
|
157
|
+
bytesRead: count(countersRaw.bytes_read),
|
|
158
|
+
},
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Run shallow session discovery by driving `ai-hist sessions discover --json`.
|
|
163
|
+
*
|
|
164
|
+
* The CLI streams JSONL — one `session` object per discovered row, a
|
|
165
|
+
* `diagnostic` per non-fatal failure, then a closing `summary` — and this
|
|
166
|
+
* parses it as it arrives, so `onSession` fires progressively rather than only
|
|
167
|
+
* once the whole run finishes.
|
|
168
|
+
*
|
|
169
|
+
* Discovery **writes the on-disk database**. An `AiHist` opened before the run
|
|
170
|
+
* is a snapshot and will not contain the new rows; re-open (or call
|
|
171
|
+
* `openAiHist` again) before `listSessionCatalog()` to see them.
|
|
172
|
+
*
|
|
173
|
+
* Failure behavior mirrors the CLI's: a provider that blows up contributes a
|
|
174
|
+
* diagnostic and the run still resolves (exit 0). Individual unparseable or
|
|
175
|
+
* unrecognized lines are skipped rather than failing the run, so a newer
|
|
176
|
+
* binary's extra line types stay forward-compatible. The promise rejects with
|
|
177
|
+
* a {@link DiscoveryError} when:
|
|
178
|
+
*
|
|
179
|
+
* - the binary cannot be run at all (the message names `AI_HIST_RUST_BIN`);
|
|
180
|
+
* - the run exits non-zero — every selected provider failed. The native
|
|
181
|
+
* command still writes its diagnostics and the summary trailer before
|
|
182
|
+
* exiting, so the error carries both alongside `stderr` and `exitCode`;
|
|
183
|
+
* - no summary line arrived, or its `contractVersion` is not the one this
|
|
184
|
+
* SDK understands. The trailer is mandatory in the native contract, so a
|
|
185
|
+
* run without one (or with a version this SDK cannot read) means the rows
|
|
186
|
+
* are not safe to interpret — better to say so than to hand back a
|
|
187
|
+
* half-understood catalog.
|
|
188
|
+
*
|
|
189
|
+
* An exception thrown by `onSession` or `onDiagnostic` aborts the run: the
|
|
190
|
+
* child is killed and the promise rejects with that exception, rather than
|
|
191
|
+
* escaping the stream handler as an uncaught error in the host process.
|
|
192
|
+
*/
|
|
193
|
+
export function discoverSessions(opts = {}) {
|
|
194
|
+
const spawnFn = opts.spawnFn ?? spawn;
|
|
195
|
+
const bin = resolveAiHistBinary(opts.binPath);
|
|
196
|
+
const args = ['sessions', 'discover', '--json'];
|
|
197
|
+
for (const source of opts.sources ?? [])
|
|
198
|
+
args.push('--source', String(source));
|
|
199
|
+
if (opts.limit != null)
|
|
200
|
+
args.push('--limit', String(opts.limit));
|
|
201
|
+
const spawnOpts = {
|
|
202
|
+
env: { ...process.env, ...opts.env },
|
|
203
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
204
|
+
};
|
|
205
|
+
return new Promise((resolve, reject) => {
|
|
206
|
+
const sessions = [];
|
|
207
|
+
const diagnostics = [];
|
|
208
|
+
let summary = null;
|
|
209
|
+
let stderr = '';
|
|
210
|
+
let pending = '';
|
|
211
|
+
let settled = false;
|
|
212
|
+
const decoder = new StringDecoder('utf8');
|
|
213
|
+
const child = spawnFn(bin, args, spawnOpts);
|
|
214
|
+
const succeed = (result) => {
|
|
215
|
+
if (settled)
|
|
216
|
+
return;
|
|
217
|
+
settled = true;
|
|
218
|
+
resolve(result);
|
|
219
|
+
};
|
|
220
|
+
const fail = (err) => {
|
|
221
|
+
if (settled)
|
|
222
|
+
return;
|
|
223
|
+
settled = true;
|
|
224
|
+
reject(err);
|
|
225
|
+
};
|
|
226
|
+
/**
|
|
227
|
+
* A host callback that throws must not take the process down with it, and
|
|
228
|
+
* must not leave the child running: stop consuming, end the run, surface
|
|
229
|
+
* the caller's own error.
|
|
230
|
+
*/
|
|
231
|
+
const abort = (err) => {
|
|
232
|
+
try {
|
|
233
|
+
child.kill?.();
|
|
234
|
+
}
|
|
235
|
+
catch {
|
|
236
|
+
/* already gone */
|
|
237
|
+
}
|
|
238
|
+
fail(err);
|
|
239
|
+
};
|
|
240
|
+
const handleLine = (line) => {
|
|
241
|
+
const trimmed = line.trim();
|
|
242
|
+
if (!trimmed)
|
|
243
|
+
return;
|
|
244
|
+
let parsed;
|
|
245
|
+
try {
|
|
246
|
+
parsed = JSON.parse(trimmed);
|
|
247
|
+
}
|
|
248
|
+
catch {
|
|
249
|
+
return; // Tolerant: skip a line we cannot read rather than failing the run.
|
|
250
|
+
}
|
|
251
|
+
if (typeof parsed !== 'object' || parsed === null)
|
|
252
|
+
return;
|
|
253
|
+
const obj = parsed;
|
|
254
|
+
switch (obj.type) {
|
|
255
|
+
case 'session': {
|
|
256
|
+
const session = catalogSessionFromJson(obj);
|
|
257
|
+
sessions.push(session);
|
|
258
|
+
if (opts.onSession) {
|
|
259
|
+
try {
|
|
260
|
+
opts.onSession(session);
|
|
261
|
+
}
|
|
262
|
+
catch (err) {
|
|
263
|
+
abort(err);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
break;
|
|
267
|
+
}
|
|
268
|
+
case 'diagnostic': {
|
|
269
|
+
const diagnostic = diagnosticFromJson(obj);
|
|
270
|
+
diagnostics.push(diagnostic);
|
|
271
|
+
if (opts.onDiagnostic) {
|
|
272
|
+
try {
|
|
273
|
+
opts.onDiagnostic(diagnostic);
|
|
274
|
+
}
|
|
275
|
+
catch (err) {
|
|
276
|
+
abort(err);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
break;
|
|
280
|
+
}
|
|
281
|
+
case 'summary':
|
|
282
|
+
summary = summaryFromJson(obj);
|
|
283
|
+
break;
|
|
284
|
+
default:
|
|
285
|
+
break; // Unknown line type from a newer binary.
|
|
286
|
+
}
|
|
287
|
+
};
|
|
288
|
+
child.stdout?.on('data', (chunk) => {
|
|
289
|
+
if (settled)
|
|
290
|
+
return;
|
|
291
|
+
pending += typeof chunk === 'string' ? chunk : decoder.write(chunk);
|
|
292
|
+
let newline = pending.indexOf('\n');
|
|
293
|
+
while (newline !== -1 && !settled) {
|
|
294
|
+
handleLine(pending.slice(0, newline));
|
|
295
|
+
pending = pending.slice(newline + 1);
|
|
296
|
+
newline = pending.indexOf('\n');
|
|
297
|
+
}
|
|
298
|
+
});
|
|
299
|
+
child.stderr?.on('data', (chunk) => {
|
|
300
|
+
stderr += String(chunk);
|
|
301
|
+
});
|
|
302
|
+
child.on('error', (err) => {
|
|
303
|
+
if (MISSING_BINARY_CODES.has(err.code ?? '')) {
|
|
304
|
+
fail(new DiscoveryError(`could not run the ai-hist binary (${bin}): ${err.code}. Install ai-hist, ` +
|
|
305
|
+
`or set ${AI_HIST_RUST_BIN_ENV} to its path.`));
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
fail(err);
|
|
309
|
+
});
|
|
310
|
+
child.on('close', (code) => {
|
|
311
|
+
if (settled)
|
|
312
|
+
return;
|
|
313
|
+
handleLine(pending + decoder.end());
|
|
314
|
+
pending = '';
|
|
315
|
+
if (settled)
|
|
316
|
+
return; // A callback threw on the final line.
|
|
317
|
+
const trailer = summary;
|
|
318
|
+
if (code !== 0) {
|
|
319
|
+
// The native command emits its diagnostics and the summary trailer
|
|
320
|
+
// before exiting non-zero, so the failure carries what the run learned.
|
|
321
|
+
fail(new DiscoveryError(`ai-hist sessions discover failed (exit ${code}): ${stderr.trim().slice(0, 300)}`, { exitCode: code, stderr, diagnostics, summary: trailer }));
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
if (!trailer) {
|
|
325
|
+
fail(new DiscoveryError('ai-hist sessions discover produced no summary line — the closing summary is ' +
|
|
326
|
+
'part of the output contract, so the stream was truncated or the binary is too old.', { exitCode: code, stderr, diagnostics, summary: null }));
|
|
327
|
+
return;
|
|
328
|
+
}
|
|
329
|
+
if (trailer.contractVersion !== SESSION_CATALOG_CONTRACT_VERSION) {
|
|
330
|
+
fail(new DiscoveryError(`unsupported session-catalog contract version ${trailer.contractVersion} ` +
|
|
331
|
+
`(this SDK understands ${SESSION_CATALOG_CONTRACT_VERSION}) — upgrade the ai-hist ` +
|
|
332
|
+
'package or the ai-hist binary so the two agree. A version of 0 means the summary ' +
|
|
333
|
+
'carried no contract_version at all.', { exitCode: code, stderr, diagnostics, summary: trailer }));
|
|
334
|
+
return;
|
|
335
|
+
}
|
|
336
|
+
succeed({ sessions, diagnostics, summary: trailer });
|
|
337
|
+
});
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
//# sourceMappingURL=session-catalog.js.map
|
|
@@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O;YACT,CAAC;YACD,IAAI,OAAO,CAAC,eAAe,KAAK,gCAAgC,EAAE,CAAC;gBACjE,IAAI,CACF,IAAI,cAAc,CAChB,gDAAgD,OAAO,CAAC,eAAe,GAAG;oBACxE,yBAAyB,gCAAgC,0BAA0B;oBACnF,mFAAmF;oBACnF,qCAAqC,EACvC,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,EAAE,CAC1D,CACF,CAAC;gBACF,OAAO;YACT,CAAC;YACD,OAAO,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;QACvD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-catalog.test.d.ts","sourceRoot":"","sources":["../src/session-catalog.test.ts"],"names":[],"mappings":""}
|