@c3-oss/prosa-core 0.8.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/dist/index.d.ts +1185 -0
- package/dist/index.js +9227 -0
- package/dist/index.js.map +1 -0
- package/package.json +73 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1185 @@
|
|
|
1
|
+
import { Database } from 'better-sqlite3';
|
|
2
|
+
import { Logger } from 'pino';
|
|
3
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Synchronous better-sqlite3 database handle used throughout core.
|
|
7
|
+
*/
|
|
8
|
+
type Db = Database;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Durable metadata written to `manifest.json` at the root of a bundle.
|
|
12
|
+
*
|
|
13
|
+
* The manifest records the store format and the parser/schema versions that
|
|
14
|
+
* last opened the bundle. SQLite remains the authoritative schema source after
|
|
15
|
+
* migrations; `openBundle` refreshes the version stamps when they drift.
|
|
16
|
+
*/
|
|
17
|
+
interface BundleManifest {
|
|
18
|
+
/** Manifest file format version. */
|
|
19
|
+
version: 1;
|
|
20
|
+
/** Parser version that last initialized or opened the bundle. */
|
|
21
|
+
parser_version: string;
|
|
22
|
+
/** SQLite schema version expected by the last opener. */
|
|
23
|
+
schema_version: number;
|
|
24
|
+
/** ISO timestamp for bundle creation. */
|
|
25
|
+
created_at: string;
|
|
26
|
+
/** Hash algorithm used for content-addressed object IDs. */
|
|
27
|
+
hash_alg: 'blake3';
|
|
28
|
+
/** Default compression used for stored CAS payloads. */
|
|
29
|
+
default_compression: 'zstd';
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Open bundle handle shared by core services.
|
|
33
|
+
*
|
|
34
|
+
* `path` is the resolved bundle root. `paths` contains all managed locations
|
|
35
|
+
* under that root, including SQLite, CAS/object storage, raw source copies,
|
|
36
|
+
* search indexes, and generated exports.
|
|
37
|
+
*/
|
|
38
|
+
interface Bundle {
|
|
39
|
+
/** Absolute bundle root path. */
|
|
40
|
+
path: string;
|
|
41
|
+
/** Open better-sqlite3 database handle for `prosa.sqlite`. */
|
|
42
|
+
db: Db;
|
|
43
|
+
/** Parsed bundle manifest metadata. */
|
|
44
|
+
manifest: BundleManifest;
|
|
45
|
+
/** Canonical absolute paths for bundle-managed files and directories. */
|
|
46
|
+
paths: {
|
|
47
|
+
/** SQLite database file. */
|
|
48
|
+
db: string;
|
|
49
|
+
/** Manifest JSON file. */
|
|
50
|
+
manifest: string;
|
|
51
|
+
/** Main CAS fanout directory. */
|
|
52
|
+
objects: string;
|
|
53
|
+
/** Raw preserved source-file directory. */
|
|
54
|
+
rawSources: string;
|
|
55
|
+
/** Search-related sidecar root. */
|
|
56
|
+
search: string;
|
|
57
|
+
/** Tantivy index directory. */
|
|
58
|
+
tantivy: string;
|
|
59
|
+
/** Generated export root. */
|
|
60
|
+
exports: string;
|
|
61
|
+
/** Default Parquet export directory. */
|
|
62
|
+
parquet: string;
|
|
63
|
+
/** Reserved lock-file path for future single-writer coordination. */
|
|
64
|
+
lock: string;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
/** Store path exists or was requested, but no initialized bundle is available. */
|
|
68
|
+
declare class BundleNotInitializedError extends Error {
|
|
69
|
+
readonly bundlePath: string;
|
|
70
|
+
readonly reason: 'missing-directory' | 'missing-manifest';
|
|
71
|
+
constructor(bundlePath: string, reason: 'missing-directory' | 'missing-manifest');
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Resolve the default bundle root.
|
|
75
|
+
*
|
|
76
|
+
* `PROSA_STORE` wins when set; otherwise the local-first store lives in
|
|
77
|
+
* `~/.prosa`. The return value is absolute in both cases.
|
|
78
|
+
*/
|
|
79
|
+
declare function defaultBundlePath(): string;
|
|
80
|
+
/**
|
|
81
|
+
* Create a fresh bundle at `rootPath`. Fails if the directory already contains
|
|
82
|
+
* a manifest (use openBundle for that case).
|
|
83
|
+
*
|
|
84
|
+
* Side effects: creates the bundle directory tree, writes `manifest.json`,
|
|
85
|
+
* opens `prosa.sqlite`, and applies all schema migrations. The caller owns the
|
|
86
|
+
* returned database handle and must close it via `closeBundle`.
|
|
87
|
+
*/
|
|
88
|
+
declare function initBundle(rootPath: string): Promise<Bundle>;
|
|
89
|
+
/**
|
|
90
|
+
* Open an existing bundle. Applies pending migrations if the schema is older
|
|
91
|
+
* than the current code expects.
|
|
92
|
+
*
|
|
93
|
+
* Fails when the root is missing, lacks a manifest, or the migrated database
|
|
94
|
+
* version still does not match the code-time schema version. On success it may
|
|
95
|
+
* rewrite only manifest version metadata.
|
|
96
|
+
*/
|
|
97
|
+
declare function openBundle(rootPath: string): Promise<Bundle>;
|
|
98
|
+
/**
|
|
99
|
+
* Open an existing bundle or transparently initialize one if the store path is
|
|
100
|
+
* missing or has not been initialized yet.
|
|
101
|
+
*
|
|
102
|
+
* Fails when `rootPath` exists but is not a directory. This is the CLI-friendly
|
|
103
|
+
* entrypoint for commands that should create the store on first use.
|
|
104
|
+
*/
|
|
105
|
+
declare function openOrInitBundle(rootPath: string): Promise<Bundle>;
|
|
106
|
+
/**
|
|
107
|
+
* Close the SQLite handle associated with a bundle.
|
|
108
|
+
*/
|
|
109
|
+
declare function closeBundle(bundle: Bundle): void;
|
|
110
|
+
|
|
111
|
+
/** Result returned after running schema migrations. */
|
|
112
|
+
interface MigrationResult {
|
|
113
|
+
/** Migration versions applied during this call. */
|
|
114
|
+
applied: number[];
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Apply all unapplied schema migrations and return the versions newly applied.
|
|
118
|
+
*
|
|
119
|
+
* The migrations table is created on demand. Each migration either fully
|
|
120
|
+
* applies with its bookkeeping row or rolls back through SQLite's transaction
|
|
121
|
+
* machinery; errors propagate to the caller.
|
|
122
|
+
*/
|
|
123
|
+
declare function runMigrations(db: Db): MigrationResult;
|
|
124
|
+
/**
|
|
125
|
+
* Read the highest applied schema version from the database.
|
|
126
|
+
*
|
|
127
|
+
* Returns 0 for an uninitialized database or if migration metadata cannot be
|
|
128
|
+
* queried yet.
|
|
129
|
+
*/
|
|
130
|
+
declare function currentSchemaVersion(db: Db): number;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Parser/projection version for normalized importer output.
|
|
134
|
+
*
|
|
135
|
+
* Bump when importer or normalizer semantics change in a way that can make
|
|
136
|
+
* existing canonical rows stale relative to preserved raw records. Stored on
|
|
137
|
+
* every `import_batches` row for future re-projection decisions.
|
|
138
|
+
*/
|
|
139
|
+
declare const PROSA_PARSER_VERSION: string;
|
|
140
|
+
/**
|
|
141
|
+
* Current SQLite schema version, matching the highest migration in
|
|
142
|
+
* `src/core/schema`.
|
|
143
|
+
*/
|
|
144
|
+
declare const PROSA_SCHEMA_VERSION = 5;
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Source tools that have first-class importer support and stable schema
|
|
148
|
+
* semantics.
|
|
149
|
+
*/
|
|
150
|
+
declare const SOURCE_TOOLS: readonly ["cursor", "codex", "claude", "gemini", "hermes"];
|
|
151
|
+
/**
|
|
152
|
+
* Normalized source-tool discriminator stored on source files, raw records,
|
|
153
|
+
* sessions, and analytics views.
|
|
154
|
+
*/
|
|
155
|
+
type SourceTool = (typeof SOURCE_TOOLS)[number];
|
|
156
|
+
/**
|
|
157
|
+
* Confidence level for inferred timeline positions and recovered relations.
|
|
158
|
+
*/
|
|
159
|
+
type Confidence = 'high' | 'medium' | 'low';
|
|
160
|
+
/**
|
|
161
|
+
* Canonical message role vocabulary used by the `messages.role` CHECK
|
|
162
|
+
* constraint. `operational` is reserved for runtime/system events that are not
|
|
163
|
+
* user-visible system prompts.
|
|
164
|
+
*/
|
|
165
|
+
type MessageRole = 'system_prompt' | 'developer' | 'user' | 'assistant' | 'tool' | 'operational';
|
|
166
|
+
/**
|
|
167
|
+
* Coarse tool categories used for cross-importer aggregation while preserving
|
|
168
|
+
* the native tool name separately.
|
|
169
|
+
*/
|
|
170
|
+
type CanonicalToolType = 'shell' | 'read_file' | 'write_file' | 'edit_file' | 'search_file' | 'web_search' | 'mcp' | 'subagent' | 'patch' | 'other';
|
|
171
|
+
/**
|
|
172
|
+
* Directed graph relationship vocabulary for `edges`, covering conversation
|
|
173
|
+
* lineage, tool call/result links, artifacts, and recovered equivalence.
|
|
174
|
+
*/
|
|
175
|
+
type EdgeType = 'parent_of' | 'calls' | 'returns' | 'spawned' | 'contains' | 'produced' | 'consumed' | 'derived_from' | 'summarizes' | 'compacts' | 'same_as' | 'refers_to';
|
|
176
|
+
/**
|
|
177
|
+
* Importer-normalized lifecycle state for tool calls when the source format
|
|
178
|
+
* provides enough evidence to distinguish outcomes.
|
|
179
|
+
*/
|
|
180
|
+
type ToolCallStatus = 'started' | 'success' | 'error' | 'cancelled' | 'unknown';
|
|
181
|
+
/**
|
|
182
|
+
* Complete row projection for the `sessions` table.
|
|
183
|
+
*
|
|
184
|
+
* Boolean flags are represented as SQLite integers and absent values are
|
|
185
|
+
* represented as `null` so callers can bind/read rows without conversion.
|
|
186
|
+
*/
|
|
187
|
+
interface SessionRowFull {
|
|
188
|
+
/** Canonical prosa session identifier. */
|
|
189
|
+
session_id: string;
|
|
190
|
+
/** Source tool that produced the session. */
|
|
191
|
+
source_tool: SourceTool;
|
|
192
|
+
/** Native session identifier from the source tool. */
|
|
193
|
+
source_session_id: string;
|
|
194
|
+
/** Canonical project identifier, when recovered. */
|
|
195
|
+
project_id: string | null;
|
|
196
|
+
/** Parent session identifier for subagent sessions. */
|
|
197
|
+
parent_session_id: string | null;
|
|
198
|
+
/** SQLite boolean indicating whether this session is a subagent. */
|
|
199
|
+
is_subagent: 0 | 1;
|
|
200
|
+
/** Source-specific role for a subagent. */
|
|
201
|
+
agent_role: string | null;
|
|
202
|
+
/** Display nickname for a subagent. */
|
|
203
|
+
agent_nickname: string | null;
|
|
204
|
+
/** Best recovered session title. */
|
|
205
|
+
title: string | null;
|
|
206
|
+
/** Best recovered session summary. */
|
|
207
|
+
summary: string | null;
|
|
208
|
+
/** Earliest recovered session timestamp. */
|
|
209
|
+
start_ts: string | null;
|
|
210
|
+
/** Latest recovered session timestamp. */
|
|
211
|
+
end_ts: string | null;
|
|
212
|
+
/** Initial working directory, when available. */
|
|
213
|
+
cwd_initial: string | null;
|
|
214
|
+
/** Initial git branch, when available. */
|
|
215
|
+
git_branch_initial: string | null;
|
|
216
|
+
/** First observed model name. */
|
|
217
|
+
model_first: string | null;
|
|
218
|
+
/** Last observed model name. */
|
|
219
|
+
model_last: string | null;
|
|
220
|
+
/** Source or importer session status. */
|
|
221
|
+
status: string | null;
|
|
222
|
+
/** Confidence in recovered timeline ordering. */
|
|
223
|
+
timeline_confidence: Confidence;
|
|
224
|
+
/** Raw record that introduced the session, when applicable. */
|
|
225
|
+
raw_record_id: string | null;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Stored object compression marker persisted in the `objects` table.
|
|
230
|
+
*/
|
|
231
|
+
type Compression = 'zstd' | 'none';
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Content-addressed object identifier stored as `blake3:<hex>`.
|
|
235
|
+
*/
|
|
236
|
+
type ObjectId = string;
|
|
237
|
+
/**
|
|
238
|
+
* Complete metadata row for one object stored in the CAS.
|
|
239
|
+
*
|
|
240
|
+
* `storage_path` is relative to the bundle root and points at compressed or
|
|
241
|
+
* raw bytes depending on `compression`.
|
|
242
|
+
*/
|
|
243
|
+
interface ObjectMeta {
|
|
244
|
+
/** Canonical object identifier, formatted as `blake3:<hex>`. */
|
|
245
|
+
object_id: ObjectId;
|
|
246
|
+
/** Hash algorithm used to derive `hash` and `object_id`. */
|
|
247
|
+
hash_alg: 'blake3';
|
|
248
|
+
/** Raw BLAKE3 hex digest without the `blake3:` prefix. */
|
|
249
|
+
hash: string;
|
|
250
|
+
/** Original uncompressed payload size in bytes. */
|
|
251
|
+
size_bytes: number;
|
|
252
|
+
/** Stored compressed payload size, or null when stored uncompressed. */
|
|
253
|
+
compressed_size_bytes: number | null;
|
|
254
|
+
/** Compression algorithm used for the stored payload. */
|
|
255
|
+
compression: Compression;
|
|
256
|
+
/** Optional media type supplied by the writer. */
|
|
257
|
+
mime_type: string | null;
|
|
258
|
+
/** Optional text encoding supplied by the writer. */
|
|
259
|
+
encoding: string | null;
|
|
260
|
+
/** Bundle-relative path to the stored bytes. */
|
|
261
|
+
storage_path: string;
|
|
262
|
+
/** BLAKE3 hex digest of the bytes stored on disk and uploaded over sync. */
|
|
263
|
+
transport_hash: string | null;
|
|
264
|
+
/** ISO timestamp for the metadata row insertion. */
|
|
265
|
+
created_at: string;
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Optional MIME and text-encoding metadata for newly stored CAS objects.
|
|
269
|
+
*/
|
|
270
|
+
interface PutOptions {
|
|
271
|
+
/** Optional media type to persist on the object metadata row. */
|
|
272
|
+
mimeType?: string;
|
|
273
|
+
/** Optional text encoding to persist on the object metadata row. */
|
|
274
|
+
encoding?: string;
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Store raw bytes in the CAS. Returns the object_id. Idempotent: if the same
|
|
278
|
+
* content already exists, returns the existing object_id without rewriting.
|
|
279
|
+
*
|
|
280
|
+
* Bytes are compressed with zstd when worth it (see compress.ts threshold).
|
|
281
|
+
* The on-disk path is `<bundle>/objects/blake3/ab/cd/<hash>.zst`.
|
|
282
|
+
*/
|
|
283
|
+
declare function putBytes(bundle: Bundle, bytes: Uint8Array, options?: PutOptions): Promise<ObjectId>;
|
|
284
|
+
/**
|
|
285
|
+
* Store UTF-8 text in the CAS with text metadata.
|
|
286
|
+
*/
|
|
287
|
+
declare function putText(bundle: Bundle, text: string, options?: {
|
|
288
|
+
mimeType?: string;
|
|
289
|
+
}): Promise<ObjectId>;
|
|
290
|
+
/**
|
|
291
|
+
* Store a JSON-serialized value in the CAS.
|
|
292
|
+
*
|
|
293
|
+
* Serialization is compact but not canonicalized; callers should not rely on
|
|
294
|
+
* object key ordering for cross-process identity unless the input itself is
|
|
295
|
+
* produced deterministically.
|
|
296
|
+
*/
|
|
297
|
+
declare function putJson(bundle: Bundle, value: unknown): Promise<ObjectId>;
|
|
298
|
+
/**
|
|
299
|
+
* Read and decompress object bytes from the CAS.
|
|
300
|
+
*
|
|
301
|
+
* Throws when `objectId` is absent from the `objects` table; filesystem read or
|
|
302
|
+
* decompression errors also propagate because they indicate bundle corruption
|
|
303
|
+
* or inaccessible storage.
|
|
304
|
+
*/
|
|
305
|
+
declare function getBytes(bundle: Bundle, objectId: ObjectId): Promise<Buffer>;
|
|
306
|
+
/**
|
|
307
|
+
* Read an object as UTF-8 text.
|
|
308
|
+
*/
|
|
309
|
+
declare function getText(bundle: Bundle, objectId: ObjectId): Promise<string>;
|
|
310
|
+
/**
|
|
311
|
+
* Read an object as UTF-8 JSON and parse it as `T`.
|
|
312
|
+
*/
|
|
313
|
+
declare function getJson<T = unknown>(bundle: Bundle, objectId: ObjectId): Promise<T>;
|
|
314
|
+
/**
|
|
315
|
+
* Look up object metadata without reading object bytes.
|
|
316
|
+
*/
|
|
317
|
+
declare function getObjectMeta(bundle: Bundle, objectId: ObjectId): ObjectMeta | null;
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* In-memory representation of an `import_batches` row while a compile/import
|
|
321
|
+
* run is active.
|
|
322
|
+
*
|
|
323
|
+
* `finished_at` is populated only after `finishBatch` persists terminal status.
|
|
324
|
+
*/
|
|
325
|
+
interface ImportBatch {
|
|
326
|
+
/** Stable batch identifier derived from source and start time. */
|
|
327
|
+
batch_id: string;
|
|
328
|
+
/** Source importer for this batch, or null for multi-source orchestration. */
|
|
329
|
+
source_tool: SourceTool | null;
|
|
330
|
+
/** Parser version that produced this batch. */
|
|
331
|
+
parser_version: string;
|
|
332
|
+
/** Source roots or files covered by the batch. */
|
|
333
|
+
paths: string[];
|
|
334
|
+
/** ISO timestamp when the batch was created. */
|
|
335
|
+
started_at: string;
|
|
336
|
+
/** ISO timestamp set after terminal status is persisted. */
|
|
337
|
+
finished_at?: string;
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* Per-batch counters serialized into `import_batches.counts_json`.
|
|
341
|
+
*
|
|
342
|
+
* Counts describe importer work, not necessarily net-new durable rows; skipped
|
|
343
|
+
* source files and idempotent inserts are tracked explicitly.
|
|
344
|
+
*/
|
|
345
|
+
interface ImportCounts {
|
|
346
|
+
/** Source files discovered by the importer. */
|
|
347
|
+
source_files_seen: number;
|
|
348
|
+
/** Source files parsed and imported. */
|
|
349
|
+
source_files_imported: number;
|
|
350
|
+
/** Source files skipped by idempotency checks. */
|
|
351
|
+
source_files_skipped: number;
|
|
352
|
+
/** Raw source records preserved. */
|
|
353
|
+
raw_records: number;
|
|
354
|
+
/** Session rows inserted or updated. */
|
|
355
|
+
sessions: number;
|
|
356
|
+
/** Turn rows inserted or updated. */
|
|
357
|
+
turns: number;
|
|
358
|
+
/** Timeline event rows inserted or updated. */
|
|
359
|
+
events: number;
|
|
360
|
+
/** Message rows inserted or updated. */
|
|
361
|
+
messages: number;
|
|
362
|
+
/** Content block rows inserted or updated. */
|
|
363
|
+
content_blocks: number;
|
|
364
|
+
/** Tool call rows inserted or updated. */
|
|
365
|
+
tool_calls: number;
|
|
366
|
+
/** Tool result rows inserted or updated. */
|
|
367
|
+
tool_results: number;
|
|
368
|
+
/** Artifact rows inserted or updated. */
|
|
369
|
+
artifacts: number;
|
|
370
|
+
/** Edge rows inserted or updated. */
|
|
371
|
+
edges: number;
|
|
372
|
+
/** Import errors recorded for the batch. */
|
|
373
|
+
errors: number;
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* Create a zeroed counter object for a new import batch.
|
|
377
|
+
*/
|
|
378
|
+
declare function emptyCounts(): ImportCounts;
|
|
379
|
+
/**
|
|
380
|
+
* Insert a running import batch and return its process-local handle.
|
|
381
|
+
*
|
|
382
|
+
* Batch IDs are intentionally unique per run so repeated compiles preserve
|
|
383
|
+
* their own audit trail even when all source rows are skipped idempotently.
|
|
384
|
+
*/
|
|
385
|
+
declare function startBatch(bundle: Bundle, sourceTool: SourceTool | null, paths: string[]): ImportBatch;
|
|
386
|
+
/**
|
|
387
|
+
* Mark an import batch completed or failed and persist final counts.
|
|
388
|
+
*/
|
|
389
|
+
declare function finishBatch(bundle: Bundle, batch: ImportBatch, counts: ImportCounts, status: 'completed' | 'failed'): void;
|
|
390
|
+
/**
|
|
391
|
+
* Record an importer error tied to an optional source file or raw record.
|
|
392
|
+
*
|
|
393
|
+
* Non-string payloads are preserved in the CAS as JSON and referenced from the
|
|
394
|
+
* error row; this keeps diagnostic detail out of inline SQLite columns while
|
|
395
|
+
* preserving it for later inspection.
|
|
396
|
+
*/
|
|
397
|
+
declare function recordError(bundle: Bundle, batchId: string, args: {
|
|
398
|
+
sourceFileId?: string | null;
|
|
399
|
+
rawRecordId?: string | null;
|
|
400
|
+
kind: string;
|
|
401
|
+
message: string;
|
|
402
|
+
payload?: unknown;
|
|
403
|
+
}): Promise<void>;
|
|
404
|
+
|
|
405
|
+
/**
|
|
406
|
+
* Complete `source_files` row used by source discovery and importer idempotency.
|
|
407
|
+
*
|
|
408
|
+
* Paths are absolute source paths. `object_id` points at preserved raw source
|
|
409
|
+
* bytes and may be backfilled for rows created before raw preservation existed.
|
|
410
|
+
*/
|
|
411
|
+
interface SourceFileRow {
|
|
412
|
+
/** Stable source file identifier. */
|
|
413
|
+
source_file_id: string;
|
|
414
|
+
/** Importer that discovered the file. */
|
|
415
|
+
source_tool: SourceTool;
|
|
416
|
+
/** Absolute path to the native source file. */
|
|
417
|
+
path: string;
|
|
418
|
+
/** Importer-specific file kind. */
|
|
419
|
+
file_kind: string;
|
|
420
|
+
/** File size observed during discovery. */
|
|
421
|
+
size_bytes: number;
|
|
422
|
+
/** Filesystem modification time as ISO text, when available. */
|
|
423
|
+
mtime: string | null;
|
|
424
|
+
/** SHA-256 content hash used for idempotency. */
|
|
425
|
+
content_hash: string;
|
|
426
|
+
/** CAS object ID for preserved raw bytes, if available. */
|
|
427
|
+
object_id: string | null;
|
|
428
|
+
/** ISO timestamp when the file was first registered. */
|
|
429
|
+
discovered_at: string;
|
|
430
|
+
/** Optional project/workspace hint derived during discovery. */
|
|
431
|
+
workspace_hint: string | null;
|
|
432
|
+
}
|
|
433
|
+
/**
|
|
434
|
+
* Result of source-file registration.
|
|
435
|
+
*
|
|
436
|
+
* `alreadyKnown` means the same path/content tuple was already registered and
|
|
437
|
+
* the caller can usually skip parsing/importing the file.
|
|
438
|
+
*/
|
|
439
|
+
interface RegisterResult {
|
|
440
|
+
/** Registered source file row. */
|
|
441
|
+
row: SourceFileRow;
|
|
442
|
+
/** True when the caller can usually skip parsing the file. */
|
|
443
|
+
alreadyKnown: boolean;
|
|
444
|
+
}
|
|
445
|
+
/**
|
|
446
|
+
* Idempotent registration of a source file. The natural key is
|
|
447
|
+
* (source_tool, path, size, mtime, content_hash). If a row with the same
|
|
448
|
+
* tuple already exists we return it untouched and the caller can skip
|
|
449
|
+
* re-importing. Otherwise we insert a new row.
|
|
450
|
+
*
|
|
451
|
+
* This is the cheapest form of idempotency: re-running `prosa compile` over
|
|
452
|
+
* the same Codex tree is a no-op (no rehash unless the file changed).
|
|
453
|
+
*/
|
|
454
|
+
declare function registerSourceFile(bundle: Bundle, args: {
|
|
455
|
+
sourceTool: SourceTool;
|
|
456
|
+
absolutePath: string;
|
|
457
|
+
fileKind: string;
|
|
458
|
+
workspaceHint?: string | null;
|
|
459
|
+
}): Promise<RegisterResult>;
|
|
460
|
+
|
|
461
|
+
/** Filters applied consistently to session list and count queries. */
|
|
462
|
+
interface SessionListFilters {
|
|
463
|
+
/** Restrict results to one source tool. */
|
|
464
|
+
sourceTool?: SourceTool;
|
|
465
|
+
/** Inclusive lower bound for `start_ts`; unknown timestamps are retained. */
|
|
466
|
+
sinceIso?: string;
|
|
467
|
+
/** Exclusive upper bound for `start_ts`; unknown timestamps are retained. */
|
|
468
|
+
untilIso?: string;
|
|
469
|
+
/** Maximum rows to return, clamped by service limits. */
|
|
470
|
+
limit?: number;
|
|
471
|
+
}
|
|
472
|
+
/** Summary row returned by session listing surfaces. */
|
|
473
|
+
interface SessionRow {
|
|
474
|
+
/** Canonical prosa session identifier. */
|
|
475
|
+
session_id: string;
|
|
476
|
+
/** Source tool that produced the session. */
|
|
477
|
+
source_tool: SourceTool;
|
|
478
|
+
/** Native source session identifier. */
|
|
479
|
+
source_session_id: string;
|
|
480
|
+
/** Canonical project identifier this session belongs to, when one was recovered. */
|
|
481
|
+
project_id: string | null;
|
|
482
|
+
/** Parent session for subagent sessions. */
|
|
483
|
+
parent_session_id: string | null;
|
|
484
|
+
/** SQLite boolean indicating whether this is a subagent session. */
|
|
485
|
+
is_subagent: 0 | 1;
|
|
486
|
+
/** Best recovered title. */
|
|
487
|
+
title: string | null;
|
|
488
|
+
/** Earliest recovered timestamp. */
|
|
489
|
+
start_ts: string | null;
|
|
490
|
+
/** Latest recovered timestamp. */
|
|
491
|
+
end_ts: string | null;
|
|
492
|
+
/** Initial working directory. */
|
|
493
|
+
cwd_initial: string | null;
|
|
494
|
+
/** Initial git branch. */
|
|
495
|
+
git_branch_initial: string | null;
|
|
496
|
+
/** First observed model. */
|
|
497
|
+
model_first: string | null;
|
|
498
|
+
/** Last observed model. */
|
|
499
|
+
model_last: string | null;
|
|
500
|
+
/** Source or importer status. */
|
|
501
|
+
status: string | null;
|
|
502
|
+
/** Confidence in recovered timeline ordering. */
|
|
503
|
+
timeline_confidence: Confidence;
|
|
504
|
+
/** Number of messages attached to the session. */
|
|
505
|
+
message_count: number;
|
|
506
|
+
/** Number of tool calls attached to the session. */
|
|
507
|
+
tool_call_count: number;
|
|
508
|
+
}
|
|
509
|
+
/** Lists sessions newest-first, preserving rows with unknown timestamps at the end. */
|
|
510
|
+
declare function listSessions(bundle: Bundle, filters?: SessionListFilters): SessionRow[];
|
|
511
|
+
/** Counts sessions using the same filter policy as {@link listSessions}. */
|
|
512
|
+
declare function countSessions(bundle: Bundle, filters?: SessionListFilters): number;
|
|
513
|
+
/** Timeline event row used by session detail views. */
|
|
514
|
+
interface SessionDetailEvent {
|
|
515
|
+
/** Timeline ordinal within the session. */
|
|
516
|
+
ordinal: number;
|
|
517
|
+
/** Event timestamp when known. */
|
|
518
|
+
timestamp: string | null;
|
|
519
|
+
/** Canonical event type. */
|
|
520
|
+
event_type: string;
|
|
521
|
+
/** Native source event type, when retained. */
|
|
522
|
+
source_type: string | null;
|
|
523
|
+
/** Source-specific event subtype. */
|
|
524
|
+
subtype: string | null;
|
|
525
|
+
/** Actor associated with the event. */
|
|
526
|
+
actor: string | null;
|
|
527
|
+
/** Message row attached to the event. */
|
|
528
|
+
message_id: string | null;
|
|
529
|
+
/** Message role attached to the event. */
|
|
530
|
+
role: string | null;
|
|
531
|
+
/** Tool name attached to the event. */
|
|
532
|
+
tool_name: string | null;
|
|
533
|
+
/** SQLite boolean indicating a failed tool result. */
|
|
534
|
+
is_error: 0 | 1 | null;
|
|
535
|
+
/** Human-sized preview for detail rendering. */
|
|
536
|
+
preview: string | null;
|
|
537
|
+
}
|
|
538
|
+
/** Full session detail with summary metadata and ordered timeline events. */
|
|
539
|
+
interface SessionDetail {
|
|
540
|
+
/** Session summary row. */
|
|
541
|
+
session: SessionRow;
|
|
542
|
+
/** Ordered timeline events. */
|
|
543
|
+
events: SessionDetailEvent[];
|
|
544
|
+
}
|
|
545
|
+
/** Returns a single session with its event timeline, or null when absent. */
|
|
546
|
+
declare function getSession(bundle: Bundle, sessionId: string): SessionDetail | null;
|
|
547
|
+
|
|
548
|
+
/** Supported search backends tracked by the bundle. */
|
|
549
|
+
type SearchEngine = 'fts5' | 'tantivy';
|
|
550
|
+
/** Persisted status row for a search index sidecar. */
|
|
551
|
+
interface SearchIndexStatus {
|
|
552
|
+
/** Search backend represented by this status row. */
|
|
553
|
+
engine: SearchEngine;
|
|
554
|
+
/** Current index lifecycle state. */
|
|
555
|
+
status: 'missing' | 'ready' | 'stale' | 'building' | 'failed';
|
|
556
|
+
/** Number of canonical search_docs rows available to index. */
|
|
557
|
+
source_doc_count: number;
|
|
558
|
+
/** Number of documents known to be present in the index. */
|
|
559
|
+
indexed_doc_count: number;
|
|
560
|
+
/** ISO timestamp for the last status update. */
|
|
561
|
+
updated_at: string;
|
|
562
|
+
/** Last build error message, if the index failed. */
|
|
563
|
+
error_message: string | null;
|
|
564
|
+
/** Last indexed SQLite rowid for incremental sidecars. */
|
|
565
|
+
last_indexed_rowid: number | null;
|
|
566
|
+
/** Schema fingerprint used to decide whether incremental rebuild is valid. */
|
|
567
|
+
schema_fingerprint: string | null;
|
|
568
|
+
}
|
|
569
|
+
/** Enables incremental FTS5 maintenance after bulk rebuilds or imports. */
|
|
570
|
+
declare function enableFts5Triggers(bundle: Bundle): void;
|
|
571
|
+
/** Disables FTS5 maintenance triggers while import code performs bulk writes. */
|
|
572
|
+
declare function disableFts5Triggers(bundle: Bundle): void;
|
|
573
|
+
/** Returns status rows for all known search engines, creating defaults if absent. */
|
|
574
|
+
declare function getSearchIndexStatuses(bundle: Bundle): SearchIndexStatus[];
|
|
575
|
+
/** Returns the status row for one search engine, or null only if initialization failed. */
|
|
576
|
+
declare function getSearchIndexStatus(bundle: Bundle, engine: SearchEngine): SearchIndexStatus | null;
|
|
577
|
+
/** Marks derived search indexes stale after canonical search_docs changed. */
|
|
578
|
+
declare function markIndexesAfterImport(bundle: Bundle, options: {
|
|
579
|
+
changed: boolean;
|
|
580
|
+
}): void;
|
|
581
|
+
/** Fully rebuilds the SQLite FTS5 index from search_docs and records status. */
|
|
582
|
+
declare function rebuildFts5Index(bundle: Bundle): SearchIndexStatus;
|
|
583
|
+
/** Options controlling Tantivy sidecar rebuild behavior. */
|
|
584
|
+
interface RebuildTantivyOptions {
|
|
585
|
+
/**
|
|
586
|
+
* Force a full re-index even when an incremental run would be valid.
|
|
587
|
+
* Surfaced by the `--overwrite` flag on `prosa index tantivy` and on
|
|
588
|
+
* `prosa compile`.
|
|
589
|
+
*/
|
|
590
|
+
overwrite?: boolean;
|
|
591
|
+
}
|
|
592
|
+
/** Rebuilds the Tantivy sidecar, using an incremental append path when valid. */
|
|
593
|
+
declare function rebuildTantivyIndex(bundle: Bundle, options?: RebuildTantivyOptions): Promise<SearchIndexStatus>;
|
|
594
|
+
|
|
595
|
+
/** Search result projected from either FTS5 or Tantivy into the common service shape. */
|
|
596
|
+
interface SearchHit {
|
|
597
|
+
/** Search document identifier. */
|
|
598
|
+
doc_id: string;
|
|
599
|
+
/** Indexed entity kind. */
|
|
600
|
+
entity_type: string;
|
|
601
|
+
/** Identifier of the indexed entity. */
|
|
602
|
+
entity_id: string;
|
|
603
|
+
/** Session that owns the document, when applicable. */
|
|
604
|
+
session_id: string | null;
|
|
605
|
+
/** Timestamp used for result ordering. */
|
|
606
|
+
timestamp: string | null;
|
|
607
|
+
/** Message role associated with the document. */
|
|
608
|
+
role: string | null;
|
|
609
|
+
/** Tool name associated with the document. */
|
|
610
|
+
tool_name: string | null;
|
|
611
|
+
/** Indexed text field category. */
|
|
612
|
+
field_kind: string;
|
|
613
|
+
/** Highlighted or truncated result snippet. */
|
|
614
|
+
snippet: string;
|
|
615
|
+
}
|
|
616
|
+
/** Options for full-text search across indexed conversation and tool evidence. */
|
|
617
|
+
interface SearchOptions {
|
|
618
|
+
/** Query text, interpreted by the selected engine. */
|
|
619
|
+
query: string;
|
|
620
|
+
/** Maximum hit count, clamped by service limits. */
|
|
621
|
+
limit?: number;
|
|
622
|
+
/** Search backend to query; defaults to FTS5. */
|
|
623
|
+
engine?: SearchEngine;
|
|
624
|
+
/**
|
|
625
|
+
* When true, pass `query` straight to FTS5 (MATCH expression). When false
|
|
626
|
+
* (default), each whitespace-delimited token is wrapped in double quotes so
|
|
627
|
+
* punctuation like `package.json` doesn't trip the FTS5 parser. Set true if
|
|
628
|
+
* you want to use FTS5 operators like `OR`, `NEAR`, prefixes, etc.
|
|
629
|
+
*/
|
|
630
|
+
raw?: boolean;
|
|
631
|
+
}
|
|
632
|
+
/** Runs full-text search with FTS5 by default, or Tantivy when requested. */
|
|
633
|
+
declare function searchFullText(bundle: Bundle, options: SearchOptions): SearchHit[];
|
|
634
|
+
|
|
635
|
+
/** Minimal structured logger surface used by importers while compiling source files. */
|
|
636
|
+
type CompileLogger = Pick<Logger, 'child' | 'debug' | 'error' | 'info' | 'warn'>;
|
|
637
|
+
/** Shared options accepted by every importer compile entrypoint. */
|
|
638
|
+
interface CompileOptions {
|
|
639
|
+
/** Optional logger for batch, file discovery, skip, and per-file failure events. */
|
|
640
|
+
logger?: CompileLogger;
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
/** Importer result shape normalized for compile orchestration. */
|
|
644
|
+
interface CompileResult$4 {
|
|
645
|
+
/** Import batch created by the provider. */
|
|
646
|
+
batch: ImportBatch;
|
|
647
|
+
/** Final provider import counts. */
|
|
648
|
+
counts: ImportCounts;
|
|
649
|
+
}
|
|
650
|
+
/** Configures one source-tool importer for the compile service. */
|
|
651
|
+
interface CompileProviderConfig {
|
|
652
|
+
/** Source tool handled by this provider. */
|
|
653
|
+
name: SourceTool;
|
|
654
|
+
/** Human-readable provider description. */
|
|
655
|
+
description: string;
|
|
656
|
+
/** Help text describing the expected root path. */
|
|
657
|
+
pathHelp: string;
|
|
658
|
+
/** Default native history location for this provider. */
|
|
659
|
+
defaultSessionsPath: () => string;
|
|
660
|
+
/** Provider compile implementation. */
|
|
661
|
+
compile: (bundle: Bundle, root: string, options?: CompileOptions) => Promise<CompileResult$4>;
|
|
662
|
+
}
|
|
663
|
+
/** Per-provider summary emitted after an importer finishes. */
|
|
664
|
+
interface ProviderCompileSummary {
|
|
665
|
+
/** Source tool that completed. */
|
|
666
|
+
source: SourceTool;
|
|
667
|
+
/** Resolved source path compiled by the provider. */
|
|
668
|
+
sourcePath: string;
|
|
669
|
+
/** Batch identifier for this provider run. */
|
|
670
|
+
batchId: string;
|
|
671
|
+
/** Import batch metadata. */
|
|
672
|
+
batch: ImportBatch;
|
|
673
|
+
/** Final import counts. */
|
|
674
|
+
counts: ImportCounts;
|
|
675
|
+
}
|
|
676
|
+
/** Summary emitted after a Tantivy rebuild completes during compile. */
|
|
677
|
+
interface TantivyCompileSummary {
|
|
678
|
+
/** Documents present in the rebuilt Tantivy index. */
|
|
679
|
+
indexedDocCount: number;
|
|
680
|
+
}
|
|
681
|
+
/** Aggregate result for a compile import run across one or more providers. */
|
|
682
|
+
interface CompileImportSummary {
|
|
683
|
+
/** Per-provider summaries in execution order. */
|
|
684
|
+
providers: ProviderCompileSummary[];
|
|
685
|
+
/** True when at least one source file was imported. */
|
|
686
|
+
importedAny: boolean;
|
|
687
|
+
/** Tantivy rebuild summary, if it completed. */
|
|
688
|
+
tantivy: TantivyCompileSummary | null;
|
|
689
|
+
/** Tantivy rebuild error message, if rebuild failed but compile continued. */
|
|
690
|
+
tantivyError: string | null;
|
|
691
|
+
/** FTS5 rebuild error message, if rebuild failed but compile continued. */
|
|
692
|
+
fts5Error: string | null;
|
|
693
|
+
}
|
|
694
|
+
/** Summary returned after compile-triggered Parquet export. */
|
|
695
|
+
interface ParquetCompileSummary {
|
|
696
|
+
/** Directory containing generated Parquet files. */
|
|
697
|
+
outDir: string;
|
|
698
|
+
/** Path to the generated export manifest. */
|
|
699
|
+
manifestPath: string;
|
|
700
|
+
/** Number of exported canonical tables. */
|
|
701
|
+
tableCount: number;
|
|
702
|
+
/** Absolute output file path by table. */
|
|
703
|
+
files: Record<string, string>;
|
|
704
|
+
/** Row count by table. */
|
|
705
|
+
counts: Record<string, number>;
|
|
706
|
+
}
|
|
707
|
+
/** Options for running compile imports across configured providers. */
|
|
708
|
+
interface CompileImportOptions {
|
|
709
|
+
/** Open bundle to import into. */
|
|
710
|
+
bundle: Bundle;
|
|
711
|
+
/** Providers to run in order. */
|
|
712
|
+
providers: CompileProviderConfig[];
|
|
713
|
+
/** Optional override for every provider's default source path. */
|
|
714
|
+
sessionsPath?: string;
|
|
715
|
+
/**
|
|
716
|
+
* Force a full rebuild of derived indexes after import. Tantivy is the
|
|
717
|
+
* only sidecar with an incremental path today, so this currently flips
|
|
718
|
+
* Tantivy to a from-scratch rebuild; FTS5 and Parquet are always
|
|
719
|
+
* full-rewrite. Surfaced by `prosa compile … --overwrite`.
|
|
720
|
+
*/
|
|
721
|
+
overwrite?: boolean;
|
|
722
|
+
/** Optional structured logger. */
|
|
723
|
+
logger?: CompileLogger;
|
|
724
|
+
/** Callback invoked after each provider completes. */
|
|
725
|
+
onProviderComplete?: (summary: ProviderCompileSummary) => void;
|
|
726
|
+
/** Callback invoked after Tantivy rebuild completes. */
|
|
727
|
+
onTantivyComplete?: (summary: TantivyCompileSummary) => void;
|
|
728
|
+
}
|
|
729
|
+
/** Options for compile's Parquet export step. */
|
|
730
|
+
interface ExportCompileParquetOptions {
|
|
731
|
+
/** Bundle root whose canonical tables should be exported. */
|
|
732
|
+
storePath: string;
|
|
733
|
+
/** Optional structured logger. */
|
|
734
|
+
logger?: CompileLogger;
|
|
735
|
+
}
|
|
736
|
+
/** Built-in compile providers and their default history locations. */
|
|
737
|
+
declare const COMPILE_PROVIDERS: CompileProviderConfig[];
|
|
738
|
+
/** Resolves a compile provider by source tool, throwing for unsupported names. */
|
|
739
|
+
declare function getCompileProvider(source: SourceTool): CompileProviderConfig;
|
|
740
|
+
/** Expands shell-style home paths and resolves compile paths to absolutes. */
|
|
741
|
+
declare function resolveCompilePath(p: string, basePath?: string): string;
|
|
742
|
+
/** Runs provider imports and refreshes derived search indexes when data changed. */
|
|
743
|
+
declare function runCompileImports(options: CompileImportOptions): Promise<CompileImportSummary>;
|
|
744
|
+
/** Exports the compiled bundle to Parquet using compile command path semantics. */
|
|
745
|
+
declare function exportCompileParquet(options: ExportCompileParquetOptions): Promise<ParquetCompileSummary>;
|
|
746
|
+
|
|
747
|
+
/** Canonical SQLite tables exported as one Parquet file per table. */
|
|
748
|
+
declare const PARQUET_TABLES: readonly ["objects", "source_files", "import_batches", "raw_records", "import_errors", "uncertainties", "projects", "sessions", "turns", "events", "messages", "content_blocks", "tool_calls", "tool_results", "artifacts", "edges", "search_docs"];
|
|
749
|
+
/** Derived analytics views recreated in DuckDB alongside exported tables. */
|
|
750
|
+
declare const ANALYTICS_VIEWS: readonly ["session_facts", "tool_usage_facts", "error_facts", "model_usage", "project_activity"];
|
|
751
|
+
/** Exportable canonical table name. */
|
|
752
|
+
type ParquetTable = (typeof PARQUET_TABLES)[number];
|
|
753
|
+
/** DuckDB analytics view name exposed over exported Parquet data. */
|
|
754
|
+
type AnalyticsView = (typeof ANALYTICS_VIEWS)[number];
|
|
755
|
+
/** Options for exporting a bundle's canonical tables to Parquet. */
|
|
756
|
+
interface ParquetExportOptions {
|
|
757
|
+
/** Bundle root to open and export. */
|
|
758
|
+
bundlePath: string;
|
|
759
|
+
/** Output directory; defaults to the bundle's parquet directory. */
|
|
760
|
+
outDir?: string;
|
|
761
|
+
}
|
|
762
|
+
/** Result metadata for a Parquet export operation. */
|
|
763
|
+
interface ParquetExportResult {
|
|
764
|
+
/** Directory containing generated Parquet files. */
|
|
765
|
+
outDir: string;
|
|
766
|
+
/** Path to the generated manifest JSON. */
|
|
767
|
+
manifestPath: string;
|
|
768
|
+
/** Absolute Parquet file path by canonical table. */
|
|
769
|
+
files: Record<ParquetTable, string>;
|
|
770
|
+
/** Exported row count by canonical table. */
|
|
771
|
+
counts: Record<ParquetTable, number>;
|
|
772
|
+
}
|
|
773
|
+
/** Options for querying exported Parquet files through DuckDB. */
|
|
774
|
+
interface DuckDbQueryOptions {
|
|
775
|
+
/** Directory containing exported Parquet files. */
|
|
776
|
+
parquetDir: string;
|
|
777
|
+
/** SQL query to run after table and analytics views are created. */
|
|
778
|
+
sql: string;
|
|
779
|
+
}
|
|
780
|
+
/** Column-oriented query result shape returned by analytics services. */
|
|
781
|
+
interface DuckDbQueryResult {
|
|
782
|
+
/** Result column names in DuckDB output order. */
|
|
783
|
+
columns: string[];
|
|
784
|
+
/** Result rows as plain JSON-compatible objects. */
|
|
785
|
+
rows: Record<string, unknown>[];
|
|
786
|
+
}
|
|
787
|
+
/** Exports canonical bundle tables to Parquet and writes a manifest. */
|
|
788
|
+
declare function exportBundleParquet(options: ParquetExportOptions): Promise<ParquetExportResult>;
|
|
789
|
+
/** Queries Parquet exports after creating table and analytics views in DuckDB. */
|
|
790
|
+
declare function queryDuckDbParquet(options: DuckDbQueryOptions): Promise<DuckDbQueryResult>;
|
|
791
|
+
|
|
792
|
+
/** Stable report names exposed by CLI and MCP analytics surfaces. */
|
|
793
|
+
declare const ANALYTICS_REPORTS: readonly ["sessions", "tools", "errors", "models", "projects"];
|
|
794
|
+
/** Analytics report identifier. */
|
|
795
|
+
type AnalyticsReport = (typeof ANALYTICS_REPORTS)[number];
|
|
796
|
+
/** SQL dialects supported by the analytics query builder. */
|
|
797
|
+
type AnalyticsDialect = 'sqlite' | 'duckdb';
|
|
798
|
+
/** Cross-report filters accepted by analytics read surfaces. */
|
|
799
|
+
interface AnalyticsReportFilters {
|
|
800
|
+
/** Source tool filter. */
|
|
801
|
+
source?: string;
|
|
802
|
+
/** Inclusive lower time bound for report-specific timestamps. */
|
|
803
|
+
since?: string;
|
|
804
|
+
/** Exclusive upper time bound for report-specific timestamps. */
|
|
805
|
+
until?: string;
|
|
806
|
+
/** Maximum row count, clamped by service limits. */
|
|
807
|
+
limit?: number;
|
|
808
|
+
/** Native tool name filter for tool/error reports. */
|
|
809
|
+
toolName?: string;
|
|
810
|
+
/** Canonical tool category filter. */
|
|
811
|
+
canonicalType?: string;
|
|
812
|
+
/** Restrict tool/error reports to failed operations. */
|
|
813
|
+
errorsOnly?: boolean;
|
|
814
|
+
/** Error category filter. */
|
|
815
|
+
category?: string;
|
|
816
|
+
/** Model name filter. */
|
|
817
|
+
model?: string;
|
|
818
|
+
/** Project name filter. */
|
|
819
|
+
project?: string;
|
|
820
|
+
/** Canonical session identifier filter. */
|
|
821
|
+
sessionId?: string;
|
|
822
|
+
/** Source file path substring filter. */
|
|
823
|
+
sourcePathSubstring?: string;
|
|
824
|
+
}
|
|
825
|
+
/** Options for running an analytics report against exported Parquet files. */
|
|
826
|
+
interface AnalyticsReportOptions {
|
|
827
|
+
/** Directory containing exported Parquet tables. */
|
|
828
|
+
parquetDir: string;
|
|
829
|
+
/** Report to run. */
|
|
830
|
+
report: AnalyticsReport;
|
|
831
|
+
/** Optional report filters. */
|
|
832
|
+
filters?: AnalyticsReportFilters;
|
|
833
|
+
}
|
|
834
|
+
/** Options for running an analytics report directly against a SQLite bundle. */
|
|
835
|
+
interface AnalyticsBundleReportOptions {
|
|
836
|
+
/** Open bundle queried through SQLite analytics views. */
|
|
837
|
+
bundle: Bundle;
|
|
838
|
+
/** Report to run. */
|
|
839
|
+
report: AnalyticsReport;
|
|
840
|
+
/** Optional report filters. */
|
|
841
|
+
filters?: AnalyticsReportFilters;
|
|
842
|
+
}
|
|
843
|
+
/** Runs a fixed analytics report over DuckDB views backed by Parquet exports. */
|
|
844
|
+
declare function runAnalyticsReport(options: AnalyticsReportOptions): Promise<DuckDbQueryResult>;
|
|
845
|
+
/** Runs the same fixed analytics reports against SQLite analytics views. */
|
|
846
|
+
declare function runAnalyticsReportFromBundle(options: AnalyticsBundleReportOptions): DuckDbQueryResult;
|
|
847
|
+
|
|
848
|
+
/** Severity/status emitted by an individual doctor check. */
|
|
849
|
+
type CheckStatus = 'pass' | 'info' | 'warn' | 'fail' | 'skipped';
|
|
850
|
+
/** One diagnostic result produced by doctor. */
|
|
851
|
+
interface CheckResult {
|
|
852
|
+
check: string;
|
|
853
|
+
status: CheckStatus;
|
|
854
|
+
message: string;
|
|
855
|
+
hint?: string;
|
|
856
|
+
details?: Record<string, unknown>;
|
|
857
|
+
}
|
|
858
|
+
/** Complete doctor run result, including filtered checks and status counts. */
|
|
859
|
+
interface DoctorReport {
|
|
860
|
+
storePath: string;
|
|
861
|
+
bundleOpened: boolean;
|
|
862
|
+
checks: CheckResult[];
|
|
863
|
+
summary: {
|
|
864
|
+
pass: number;
|
|
865
|
+
info: number;
|
|
866
|
+
warn: number;
|
|
867
|
+
fail: number;
|
|
868
|
+
skipped: number;
|
|
869
|
+
duration_ms: number;
|
|
870
|
+
};
|
|
871
|
+
}
|
|
872
|
+
/** Options controlling bundle selection, deep checks, and check filtering. */
|
|
873
|
+
interface DoctorOptions {
|
|
874
|
+
storePath?: string;
|
|
875
|
+
deep?: boolean;
|
|
876
|
+
deepSample?: number;
|
|
877
|
+
/** Dotted prefixes or exact check names to include. Empty/undefined = all. */
|
|
878
|
+
checks?: string[];
|
|
879
|
+
}
|
|
880
|
+
/**
|
|
881
|
+
* Return true when freelist waste crosses the vacuum-recommendation threshold.
|
|
882
|
+
* Pure so the threshold logic is unit-testable without a fixture bundle.
|
|
883
|
+
*/
|
|
884
|
+
declare function shouldRecommendVacuum(freelistCount: number, pageCount: number, thresholdPct?: number): boolean;
|
|
885
|
+
/**
|
|
886
|
+
* Audit a bundle's health. Tolerates open failures: when `openBundle` throws
|
|
887
|
+
* (missing manifest, schema mismatch, corrupt sqlite), doctor still produces
|
|
888
|
+
* a report — the bundle-layout / schema checks fire and the rest are marked
|
|
889
|
+
* `skipped`. Doctor never throws on bundle problems; only catastrophic errors
|
|
890
|
+
* inside the check engine propagate.
|
|
891
|
+
*/
|
|
892
|
+
declare function runDoctor(opts?: DoctorOptions): Promise<DoctorReport>;
|
|
893
|
+
|
|
894
|
+
/** Entity kinds surfaced by tool-call history queries. */
|
|
895
|
+
type ToolCallEntity = 'tool_call' | 'artifact';
|
|
896
|
+
/** Tool-call or artifact evidence row returned by file and command history queries. */
|
|
897
|
+
interface ToolCallEvidence {
|
|
898
|
+
/** Whether this row describes a tool call or a matching artifact. */
|
|
899
|
+
entity_type: ToolCallEntity;
|
|
900
|
+
/** Session that owns the evidence. */
|
|
901
|
+
session_id: string | null;
|
|
902
|
+
/** Tool call identifier when `entity_type` is `tool_call`. */
|
|
903
|
+
tool_call_id: string | null;
|
|
904
|
+
/** Artifact identifier when `entity_type` is `artifact`. */
|
|
905
|
+
artifact_id: string | null;
|
|
906
|
+
/** Native tool name. */
|
|
907
|
+
tool_name: string | null;
|
|
908
|
+
/** Canonical tool category. */
|
|
909
|
+
canonical_tool_type: string | null;
|
|
910
|
+
/** Command text, when the tool represents shell execution. */
|
|
911
|
+
command: string | null;
|
|
912
|
+
/** File path associated with the tool call or artifact. */
|
|
913
|
+
path: string | null;
|
|
914
|
+
/** Normalized tool call status. */
|
|
915
|
+
status: string | null;
|
|
916
|
+
/** Tool call start timestamp or artifact creation timestamp. */
|
|
917
|
+
timestamp_start: string | null;
|
|
918
|
+
/** SQLite boolean indicating an error result. */
|
|
919
|
+
is_error: 0 | 1 | null;
|
|
920
|
+
/** Process exit code when available. */
|
|
921
|
+
exit_code: number | null;
|
|
922
|
+
/** Human-sized result preview. */
|
|
923
|
+
preview: string | null;
|
|
924
|
+
}
|
|
925
|
+
/** Filters for tool-call history and file-history queries. */
|
|
926
|
+
interface ToolCallFilters {
|
|
927
|
+
/** Restrict evidence to one session. */
|
|
928
|
+
sessionId?: string;
|
|
929
|
+
/** Restrict evidence to a native tool name. */
|
|
930
|
+
toolName?: string;
|
|
931
|
+
/** Restrict evidence to a canonical tool category. */
|
|
932
|
+
canonicalType?: string;
|
|
933
|
+
/** Match paths on tool calls and artifacts. */
|
|
934
|
+
pathSubstring?: string;
|
|
935
|
+
/** Include only tool calls with error evidence. */
|
|
936
|
+
errorsOnly?: boolean;
|
|
937
|
+
/** Inclusive lower bound for tool timestamps. */
|
|
938
|
+
sinceIso?: string;
|
|
939
|
+
/** Exclusive upper bound for tool timestamps. */
|
|
940
|
+
untilIso?: string;
|
|
941
|
+
/** Maximum rows to return, clamped by service limits. */
|
|
942
|
+
limit?: number;
|
|
943
|
+
}
|
|
944
|
+
/** Lists tool-call evidence, including artifacts when filtering by path substring. */
|
|
945
|
+
declare function listToolCalls(bundle: Bundle, filters?: ToolCallFilters): ToolCallEvidence[];
|
|
946
|
+
|
|
947
|
+
/**
|
|
948
|
+
* Render a session into Markdown. Big tool outputs aren't dumped inline:
|
|
949
|
+
* we show a preview line plus a `[object: blake3:…]` reference, leaving the
|
|
950
|
+
* raw bytes in the CAS for downstream tools.
|
|
951
|
+
*
|
|
952
|
+
* Built on top of {@link loadTranscript} so the CLI's `session show --format
|
|
953
|
+
* markdown` path and `prosa export session --format markdown` share one
|
|
954
|
+
* resolution pipeline (inline + CAS text + tool result preview).
|
|
955
|
+
*/
|
|
956
|
+
declare function exportSessionMarkdown(bundle: Bundle, sessionId: string): Promise<string>;
|
|
957
|
+
|
|
958
|
+
/** Matched `tool_results` row attached to its owning `TranscriptToolCall`. */
|
|
959
|
+
interface TranscriptToolResult {
|
|
960
|
+
toolResultId: string;
|
|
961
|
+
status: string | null;
|
|
962
|
+
isError: boolean;
|
|
963
|
+
exitCode: number | null;
|
|
964
|
+
durationMs: number | null;
|
|
965
|
+
preview: string | null;
|
|
966
|
+
/** Full stdout, if any, is in CAS; pass-through id so renderers can fetch on demand. */
|
|
967
|
+
stdoutObjectId: string | null;
|
|
968
|
+
/** Full stderr, if any, is in CAS; pass-through id so renderers can fetch on demand. */
|
|
969
|
+
stderrObjectId: string | null;
|
|
970
|
+
/** Full output, if any, is in CAS; pass-through id so renderers can fetch on demand. */
|
|
971
|
+
outputObjectId: string | null;
|
|
972
|
+
}
|
|
973
|
+
/** Tool invocation rendered alongside its owning turn (or as unattached). */
|
|
974
|
+
interface TranscriptToolCall {
|
|
975
|
+
toolCallId: string;
|
|
976
|
+
toolName: string;
|
|
977
|
+
canonicalToolType: string | null;
|
|
978
|
+
/** Resolved args JSON text when ≤ maxArgsInlineBytes; otherwise null. */
|
|
979
|
+
argsInline: string | null;
|
|
980
|
+
/** Source CAS id for args. Kept so renderers can fetch on demand. */
|
|
981
|
+
argsObjectId: string | null;
|
|
982
|
+
command: string | null;
|
|
983
|
+
path: string | null;
|
|
984
|
+
status: string | null;
|
|
985
|
+
timestampStart: string | null;
|
|
986
|
+
result: TranscriptToolResult | null;
|
|
987
|
+
}
|
|
988
|
+
/** One content block in a message: text, thinking, tool_use, tool_result, etc. */
|
|
989
|
+
interface TranscriptBlock {
|
|
990
|
+
blockId: string;
|
|
991
|
+
blockType: 'text' | 'thinking' | 'tool_use' | 'tool_result' | string;
|
|
992
|
+
/** Resolved inline OR fetched from CAS when ≤ maxInlineBytes. Null for oversize. */
|
|
993
|
+
text: string | null;
|
|
994
|
+
/** Source CAS id for text. Kept so renderers can fetch oversized blobs on demand. */
|
|
995
|
+
textObjectId: string | null;
|
|
996
|
+
/** Mirrors `content_blocks.visibility = 'hidden_by_default'`. */
|
|
997
|
+
hidden: boolean;
|
|
998
|
+
mimeType: string | null;
|
|
999
|
+
isError: boolean;
|
|
1000
|
+
}
|
|
1001
|
+
/** One conversational turn: a message plus its blocks and outbound tool calls. */
|
|
1002
|
+
interface TranscriptTurn {
|
|
1003
|
+
messageId: string;
|
|
1004
|
+
ordinal: number;
|
|
1005
|
+
role: 'system_prompt' | 'developer' | 'user' | 'assistant' | 'tool' | 'operational';
|
|
1006
|
+
model: string | null;
|
|
1007
|
+
timestamp: string | null;
|
|
1008
|
+
blocks: TranscriptBlock[];
|
|
1009
|
+
toolCalls: TranscriptToolCall[];
|
|
1010
|
+
}
|
|
1011
|
+
/** Full structured transcript for one session. */
|
|
1012
|
+
interface SessionTranscript {
|
|
1013
|
+
session: SessionRow;
|
|
1014
|
+
turns: TranscriptTurn[];
|
|
1015
|
+
/** Tool calls whose `message_id` is NULL (legacy / event-only imports). */
|
|
1016
|
+
unattachedToolCalls: TranscriptToolCall[];
|
|
1017
|
+
}
|
|
1018
|
+
/** Options controlling how aggressively the loader inlines CAS-backed text. */
|
|
1019
|
+
interface LoadTranscriptOptions {
|
|
1020
|
+
/** Maximum UTF-8 byte size to inline a block's text. Default 64KB. */
|
|
1021
|
+
maxInlineBytes?: number;
|
|
1022
|
+
/** Maximum UTF-8 byte size to inline a tool-call's args JSON. Default 8KB. */
|
|
1023
|
+
maxArgsInlineBytes?: number;
|
|
1024
|
+
}
|
|
1025
|
+
/**
|
|
1026
|
+
* Assemble a session's full conversation — messages, content blocks, and tool
|
|
1027
|
+
* calls with matched results — from the local bundle SQLite. Returns null
|
|
1028
|
+
* when the session is absent (callers handle "not found" themselves).
|
|
1029
|
+
*
|
|
1030
|
+
* Text bodies are resolved inline when small enough; oversize bodies surface
|
|
1031
|
+
* only as `textObjectId`/`argsObjectId` so renderers can fetch on demand.
|
|
1032
|
+
*/
|
|
1033
|
+
declare function loadTranscript(bundle: Bundle, sessionId: string, options?: LoadTranscriptOptions): Promise<SessionTranscript | null>;
|
|
1034
|
+
/**
|
|
1035
|
+
* Resolve a block's printable text. Returns null when neither inline nor CAS
|
|
1036
|
+
* has a body; returns null `text` (but keeps `textObjectId`) when the CAS
|
|
1037
|
+
* blob exceeds `maxInlineBytes` so renderers can fetch on demand.
|
|
1038
|
+
*
|
|
1039
|
+
* Exported so the markdown exporter can share the same resolution path.
|
|
1040
|
+
*/
|
|
1041
|
+
declare function resolveBlockText(bundle: Bundle, block: {
|
|
1042
|
+
text_inline: string | null;
|
|
1043
|
+
text_object_id: string | null;
|
|
1044
|
+
}, maxInlineBytes?: number): Promise<{
|
|
1045
|
+
text: string | null;
|
|
1046
|
+
textObjectId: string | null;
|
|
1047
|
+
unavailable: boolean;
|
|
1048
|
+
}>;
|
|
1049
|
+
/**
|
|
1050
|
+
* Resolve a tool call's args JSON. Returns null when the blob is missing or
|
|
1051
|
+
* exceeds `maxBytes`; the caller keeps the object id for "show full" UX.
|
|
1052
|
+
*
|
|
1053
|
+
* Exported so the markdown exporter can share the same resolution path.
|
|
1054
|
+
*/
|
|
1055
|
+
declare function resolveArgsText(bundle: Bundle, argsObjectId: ObjectId | null, maxBytes?: number): Promise<string | null>;
|
|
1056
|
+
|
|
1057
|
+
/** Options controlling the textual transcript rendering. */
|
|
1058
|
+
interface FormatTranscriptTextOptions {
|
|
1059
|
+
/** When true, thinking blocks are rendered in full. Default false. */
|
|
1060
|
+
showThinking?: boolean;
|
|
1061
|
+
/** Max preview/output lines to keep per tool result; over-long output is truncated. */
|
|
1062
|
+
maxOutputLines?: number;
|
|
1063
|
+
/**
|
|
1064
|
+
* Accepted for source-compat with prior releases. Ignored: this formatter
|
|
1065
|
+
* always emits plain text (no ANSI escapes) so piped output stays clean.
|
|
1066
|
+
* Callers that want colored interactive output should use Ink directly
|
|
1067
|
+
* (apps/cli ships `renderTranscriptInk`).
|
|
1068
|
+
*/
|
|
1069
|
+
color?: boolean;
|
|
1070
|
+
}
|
|
1071
|
+
/**
|
|
1072
|
+
* Render a `SessionTranscript` as plaintext. Output is always ANSI-free so it
|
|
1073
|
+
* round-trips through pipes (`prosa session show --format text > file.txt`).
|
|
1074
|
+
*
|
|
1075
|
+
* Layout: a metadata header (title, ids, models, confidence), then one section
|
|
1076
|
+
* per turn with a role header and inline blocks/tool-call summaries. Thinking
|
|
1077
|
+
* blocks collapse to one line by default; tool outputs truncate at
|
|
1078
|
+
* `maxOutputLines` and surface CAS object ids for full retrieval downstream.
|
|
1079
|
+
*/
|
|
1080
|
+
declare function formatTranscriptText(transcript: SessionTranscript, options?: FormatTranscriptTextOptions): string;
|
|
1081
|
+
|
|
1082
|
+
/** Result returned after a Codex compile batch finishes or records a failed batch. */
|
|
1083
|
+
interface CompileResult$3 {
|
|
1084
|
+
/** Import batch created for this Codex run. */
|
|
1085
|
+
batch: ImportBatch;
|
|
1086
|
+
/** Final counts accumulated while importing Codex files. */
|
|
1087
|
+
counts: ImportCounts;
|
|
1088
|
+
}
|
|
1089
|
+
/** Compile Codex JSONL session files under `root` into the bundle. */
|
|
1090
|
+
declare function compileCodex(bundle: Bundle, root: string, options?: CompileOptions): Promise<CompileResult$3>;
|
|
1091
|
+
|
|
1092
|
+
/** Result returned after a Claude compile batch finishes or records a failed batch. */
|
|
1093
|
+
interface CompileResult$2 {
|
|
1094
|
+
/** Import batch created for this Claude run. */
|
|
1095
|
+
batch: ImportBatch;
|
|
1096
|
+
/** Final counts accumulated while importing Claude files. */
|
|
1097
|
+
counts: ImportCounts;
|
|
1098
|
+
}
|
|
1099
|
+
/** Compile Claude Code JSONL files under `root` into the bundle. */
|
|
1100
|
+
declare function compileClaude(bundle: Bundle, root: string, options?: CompileOptions): Promise<CompileResult$2>;
|
|
1101
|
+
|
|
1102
|
+
/** Result returned after a Gemini compile batch finishes or records a failed batch. */
|
|
1103
|
+
interface CompileResult$1 {
|
|
1104
|
+
/** Import batch created for this Gemini run. */
|
|
1105
|
+
batch: ImportBatch;
|
|
1106
|
+
/** Final counts accumulated while importing Gemini files. */
|
|
1107
|
+
counts: ImportCounts;
|
|
1108
|
+
}
|
|
1109
|
+
/** Compile Gemini CLI chat snapshot files under `root` into the bundle. */
|
|
1110
|
+
declare function compileGemini(bundle: Bundle, root: string, options?: CompileOptions): Promise<CompileResult$1>;
|
|
1111
|
+
|
|
1112
|
+
/** Result returned after a Cursor compile batch finishes or records a failed batch. */
|
|
1113
|
+
interface CompileResult {
|
|
1114
|
+
/** Import batch created for this Cursor run. */
|
|
1115
|
+
batch: ImportBatch;
|
|
1116
|
+
/** Final counts accumulated while importing Cursor stores. */
|
|
1117
|
+
counts: ImportCounts;
|
|
1118
|
+
}
|
|
1119
|
+
/** Compile Cursor `store.db` files under `root` into the bundle. */
|
|
1120
|
+
declare function compileCursor(bundle: Bundle, root: string, options?: CompileOptions): Promise<CompileResult>;
|
|
1121
|
+
|
|
1122
|
+
/** System instructions advertised by the MCP server to guide evidence-first use of prosa tools. */
|
|
1123
|
+
declare const PROSA_MCP_INSTRUCTIONS: string;
|
|
1124
|
+
|
|
1125
|
+
/** HTTP transport options for exposing a prosa bundle as an MCP server. */
|
|
1126
|
+
interface McpServerOptions {
|
|
1127
|
+
/** Hostname or IP address to bind. */
|
|
1128
|
+
host: string;
|
|
1129
|
+
/** TCP port to bind. */
|
|
1130
|
+
port: number;
|
|
1131
|
+
/** HTTP path that receives MCP Streamable HTTP requests. Defaults to `/mcp`. */
|
|
1132
|
+
path?: string;
|
|
1133
|
+
/** Default search engine passed to MCP search tools. */
|
|
1134
|
+
searchEngine?: SearchEngine;
|
|
1135
|
+
/** Bundle path reopened by long-lived tool handlers. Defaults to `bundle.path`. */
|
|
1136
|
+
storePath?: string;
|
|
1137
|
+
}
|
|
1138
|
+
/** Handle returned by the HTTP MCP server listener. */
|
|
1139
|
+
interface RunningServer {
|
|
1140
|
+
/** Full URL clients should use for Streamable HTTP requests. */
|
|
1141
|
+
url: string;
|
|
1142
|
+
/** Stop the HTTP listener and close all active MCP sessions. */
|
|
1143
|
+
close(): Promise<void>;
|
|
1144
|
+
}
|
|
1145
|
+
/** Handle returned by the stdio MCP server listener. */
|
|
1146
|
+
interface RunningStdioServer {
|
|
1147
|
+
/** Close the MCP server and stdio transport. */
|
|
1148
|
+
close(): Promise<void>;
|
|
1149
|
+
}
|
|
1150
|
+
/** Stdio transport options for exposing a prosa bundle as an MCP server. */
|
|
1151
|
+
interface McpStdioServerOptions {
|
|
1152
|
+
/** Default search engine passed to MCP search tools. */
|
|
1153
|
+
searchEngine?: SearchEngine;
|
|
1154
|
+
/** Bundle path reopened by long-lived tool handlers. Defaults to `bundle.path`. */
|
|
1155
|
+
storePath?: string;
|
|
1156
|
+
}
|
|
1157
|
+
/** Start a stdio MCP server backed by an already-open prosa bundle. */
|
|
1158
|
+
declare function listenMcpStdioServer(bundle: Bundle, options?: McpStdioServerOptions): Promise<RunningStdioServer>;
|
|
1159
|
+
/**
|
|
1160
|
+
* Bind an HTTP MCP server on `host:port` backed by `bundle`. Implements the
|
|
1161
|
+
* Streamable HTTP transport with stateful sessions (one McpServer per
|
|
1162
|
+
* `MCP-Session-Id`).
|
|
1163
|
+
*
|
|
1164
|
+
* - POST /mcp — JSON-RPC requests; opens a session if `MCP-Session-Id` is missing
|
|
1165
|
+
* - DELETE /mcp — close an existing session by header
|
|
1166
|
+
* - GET /mcp — 405 (we don't expose server-initiated SSE streams)
|
|
1167
|
+
*/
|
|
1168
|
+
declare function listenMcpServer(bundle: Bundle, options: McpServerOptions): Promise<RunningServer>;
|
|
1169
|
+
|
|
1170
|
+
/** Options that tune how registered MCP tools open bundles and choose search backends. */
|
|
1171
|
+
interface ProsaToolOptions {
|
|
1172
|
+
/** Default search engine used when a `search` tool call does not specify one. */
|
|
1173
|
+
searchEngine?: SearchEngine;
|
|
1174
|
+
/** Store path to reopen for each tool call when `ensureStore` is enabled. */
|
|
1175
|
+
storePath?: string;
|
|
1176
|
+
/** Reopen or initialize the bundle per call instead of reusing the startup handle. */
|
|
1177
|
+
ensureStore?: boolean;
|
|
1178
|
+
}
|
|
1179
|
+
/**
|
|
1180
|
+
* Register the six prosa MCP tools on `server`. Five are read-only; `compile`
|
|
1181
|
+
* is dual-mode (no args = bundle status snapshot, with args = mutating import).
|
|
1182
|
+
*/
|
|
1183
|
+
declare function registerProsaTools(server: McpServer, bundle: Bundle, options?: ProsaToolOptions): void;
|
|
1184
|
+
|
|
1185
|
+
export { ANALYTICS_REPORTS, ANALYTICS_VIEWS, type AnalyticsBundleReportOptions, type AnalyticsDialect, type AnalyticsReport, type AnalyticsReportFilters, type AnalyticsReportOptions, type AnalyticsView, type Bundle, type BundleManifest, BundleNotInitializedError, COMPILE_PROVIDERS, type CanonicalToolType, type CheckResult, type CheckStatus, type CompileResult$2 as ClaudeCompileResult, type CompileResult$3 as CodexCompileResult, type CompileImportOptions, type CompileImportSummary, type CompileLogger, type CompileOptions, type CompileProviderConfig, type CompileResult$4 as CompileResult, type Compression, type Confidence, type CompileResult as CursorCompileResult, type DoctorOptions, type DoctorReport, type DuckDbQueryOptions, type DuckDbQueryResult, type EdgeType, type ExportCompileParquetOptions, type FormatTranscriptTextOptions, type CompileResult$1 as GeminiCompileResult, type ImportBatch, type ImportCounts, type LoadTranscriptOptions, type McpServerOptions, type McpStdioServerOptions, type MessageRole, type MigrationResult, type ObjectId, type ObjectMeta, PARQUET_TABLES, PROSA_MCP_INSTRUCTIONS, PROSA_PARSER_VERSION, PROSA_SCHEMA_VERSION, type ParquetCompileSummary, type ParquetExportOptions, type ParquetExportResult, type ParquetTable, type ProsaToolOptions, type ProviderCompileSummary, type PutOptions, type RebuildTantivyOptions, type RegisterResult, type RunningServer, type RunningStdioServer, SOURCE_TOOLS, type SearchEngine, type SearchHit, type SearchIndexStatus, type SearchOptions, type SessionDetail, type SessionDetailEvent, type SessionListFilters, type SessionRow, type SessionRowFull, type SessionTranscript, type SourceFileRow, type SourceTool, type TantivyCompileSummary, type ToolCallEntity, type ToolCallEvidence, type ToolCallFilters, type ToolCallStatus, type TranscriptBlock, type TranscriptToolCall, type TranscriptToolResult, type TranscriptTurn, closeBundle, compileClaude, compileCodex, compileCursor, compileGemini, countSessions, currentSchemaVersion, defaultBundlePath, disableFts5Triggers, emptyCounts, enableFts5Triggers, exportBundleParquet, exportCompileParquet, exportSessionMarkdown, finishBatch, formatTranscriptText, getBytes, getCompileProvider, getJson, getObjectMeta, getSearchIndexStatus, getSearchIndexStatuses, getSession, getText, initBundle, listSessions, listToolCalls, listenMcpServer, listenMcpStdioServer, loadTranscript, markIndexesAfterImport, openBundle, openOrInitBundle, putBytes, putJson, putText, queryDuckDbParquet, rebuildFts5Index, rebuildTantivyIndex, recordError, registerProsaTools, registerSourceFile, resolveArgsText, resolveBlockText, resolveCompilePath, runAnalyticsReport, runAnalyticsReportFromBundle, runCompileImports, runDoctor, runMigrations, searchFullText, shouldRecommendVacuum, startBatch };
|