@c3-oss/prosa 0.1.1 → 0.3.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 +48 -31
- package/dist/bin/prosa.js +754 -247
- package/dist/bin/prosa.js.map +1 -1
- package/dist/cli/main.js +754 -247
- package/dist/cli/main.js.map +1 -1
- package/dist/index.d.ts +62 -5
- package/dist/index.js +2442 -2070
- package/dist/index.js.map +1 -1
- package/package.json +21 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Database } from 'better-sqlite3';
|
|
2
|
+
import { Logger } from 'pino';
|
|
2
3
|
|
|
3
4
|
type Db = Database;
|
|
4
5
|
|
|
@@ -273,6 +274,62 @@ interface SearchOptions {
|
|
|
273
274
|
*/
|
|
274
275
|
declare function searchFullText(bundle: Bundle, options: SearchOptions): SearchHit[];
|
|
275
276
|
|
|
277
|
+
type CompileLogger = Pick<Logger, 'child' | 'debug' | 'error' | 'info' | 'warn'>;
|
|
278
|
+
interface CompileOptions {
|
|
279
|
+
logger?: CompileLogger;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
interface CompileResult$4 {
|
|
283
|
+
batch: ImportBatch;
|
|
284
|
+
counts: ImportCounts;
|
|
285
|
+
}
|
|
286
|
+
interface CompileProviderConfig {
|
|
287
|
+
name: SourceTool;
|
|
288
|
+
description: string;
|
|
289
|
+
pathHelp: string;
|
|
290
|
+
defaultSessionsPath: () => string;
|
|
291
|
+
compile: (bundle: Bundle, root: string, options?: CompileOptions) => Promise<CompileResult$4>;
|
|
292
|
+
}
|
|
293
|
+
interface ProviderCompileSummary {
|
|
294
|
+
source: SourceTool;
|
|
295
|
+
sourcePath: string;
|
|
296
|
+
batchId: string;
|
|
297
|
+
batch: ImportBatch;
|
|
298
|
+
counts: ImportCounts;
|
|
299
|
+
}
|
|
300
|
+
interface TantivyCompileSummary {
|
|
301
|
+
indexedDocCount: number;
|
|
302
|
+
}
|
|
303
|
+
interface CompileImportSummary {
|
|
304
|
+
providers: ProviderCompileSummary[];
|
|
305
|
+
importedAny: boolean;
|
|
306
|
+
tantivy: TantivyCompileSummary | null;
|
|
307
|
+
tantivyError: string | null;
|
|
308
|
+
}
|
|
309
|
+
interface ParquetCompileSummary {
|
|
310
|
+
outDir: string;
|
|
311
|
+
manifestPath: string;
|
|
312
|
+
tableCount: number;
|
|
313
|
+
files: Record<string, string>;
|
|
314
|
+
counts: Record<string, number>;
|
|
315
|
+
}
|
|
316
|
+
declare const COMPILE_PROVIDERS: CompileProviderConfig[];
|
|
317
|
+
declare function getCompileProvider(source: SourceTool): CompileProviderConfig;
|
|
318
|
+
declare function resolveCompilePath(p: string): string;
|
|
319
|
+
declare function runCompileImports(options: {
|
|
320
|
+
bundle: Bundle;
|
|
321
|
+
providers: CompileProviderConfig[];
|
|
322
|
+
deferIndex: boolean;
|
|
323
|
+
sessionsPath?: string;
|
|
324
|
+
logger?: CompileLogger;
|
|
325
|
+
onProviderComplete?: (summary: ProviderCompileSummary) => void;
|
|
326
|
+
onTantivyComplete?: (summary: TantivyCompileSummary) => void;
|
|
327
|
+
}): Promise<CompileImportSummary>;
|
|
328
|
+
declare function exportCompileParquet(options: {
|
|
329
|
+
storePath: string;
|
|
330
|
+
logger?: CompileLogger;
|
|
331
|
+
}): Promise<ParquetCompileSummary>;
|
|
332
|
+
|
|
276
333
|
/**
|
|
277
334
|
* Render a session into Markdown. Big tool outputs aren't dumped inline:
|
|
278
335
|
* we show a preview line plus a `[object: blake3:…]` reference, leaving the
|
|
@@ -307,24 +364,24 @@ interface CompileResult$3 {
|
|
|
307
364
|
batch: ImportBatch;
|
|
308
365
|
counts: ImportCounts;
|
|
309
366
|
}
|
|
310
|
-
declare function compileCodex(bundle: Bundle, root: string): Promise<CompileResult$3>;
|
|
367
|
+
declare function compileCodex(bundle: Bundle, root: string, options?: CompileOptions): Promise<CompileResult$3>;
|
|
311
368
|
|
|
312
369
|
interface CompileResult$2 {
|
|
313
370
|
batch: ImportBatch;
|
|
314
371
|
counts: ImportCounts;
|
|
315
372
|
}
|
|
316
|
-
declare function compileClaude(bundle: Bundle, root: string): Promise<CompileResult$2>;
|
|
373
|
+
declare function compileClaude(bundle: Bundle, root: string, options?: CompileOptions): Promise<CompileResult$2>;
|
|
317
374
|
|
|
318
375
|
interface CompileResult$1 {
|
|
319
376
|
batch: ImportBatch;
|
|
320
377
|
counts: ImportCounts;
|
|
321
378
|
}
|
|
322
|
-
declare function compileGemini(bundle: Bundle, root: string): Promise<CompileResult$1>;
|
|
379
|
+
declare function compileGemini(bundle: Bundle, root: string, options?: CompileOptions): Promise<CompileResult$1>;
|
|
323
380
|
|
|
324
381
|
interface CompileResult {
|
|
325
382
|
batch: ImportBatch;
|
|
326
383
|
counts: ImportCounts;
|
|
327
384
|
}
|
|
328
|
-
declare function compileCursor(bundle: Bundle, root: string): Promise<CompileResult>;
|
|
385
|
+
declare function compileCursor(bundle: Bundle, root: string, options?: CompileOptions): Promise<CompileResult>;
|
|
329
386
|
|
|
330
|
-
export { type Bundle, type BundleManifest, type CanonicalToolType, type CompileResult$2 as ClaudeCompileResult, type CompileResult$3 as CodexCompileResult, type Confidence, type CompileResult as CursorCompileResult, type DuckDbQueryOptions, type DuckDbQueryResult, type EdgeType, type CompileResult$1 as GeminiCompileResult, type ImportBatch, type ImportCounts, type MessageRole, type ObjectId, type ObjectMeta, PARQUET_TABLES, PROSA_PARSER_VERSION, PROSA_SCHEMA_VERSION, type ParquetExportOptions, type ParquetExportResult, type ParquetTable, type RegisterResult, type SearchEngine, type SearchHit, type SearchIndexStatus, type SearchOptions, type SessionDetail, type SessionDetailEvent, type SessionListFilters, type SessionRow, type SessionRowFull, type SourceFileRow, type SourceTool, type ToolCallStatus, closeBundle, compileClaude, compileCodex, compileCursor, compileGemini, countSessions, currentSchemaVersion, defaultBundlePath, disableFts5Triggers, emptyCounts, enableFts5Triggers, exportBundleParquet, exportSessionMarkdown, finishBatch, getBytes, getJson, getObjectMeta, getSearchIndexStatus, getSearchIndexStatuses, getSession, getText, initBundle, listSessions, markIndexesAfterImport, openBundle, putBytes, putJson, putText, queryDuckDbParquet, rebuildFts5Index, rebuildTantivyIndex, recordError, registerSourceFile, runMigrations, searchFullText, startBatch };
|
|
387
|
+
export { type Bundle, type BundleManifest, COMPILE_PROVIDERS, type CanonicalToolType, type CompileResult$2 as ClaudeCompileResult, type CompileResult$3 as CodexCompileResult, type CompileImportSummary, type CompileLogger, type CompileOptions, type CompileProviderConfig, type Confidence, type CompileResult as CursorCompileResult, type DuckDbQueryOptions, type DuckDbQueryResult, type EdgeType, type CompileResult$1 as GeminiCompileResult, type ImportBatch, type ImportCounts, type MessageRole, type ObjectId, type ObjectMeta, PARQUET_TABLES, PROSA_PARSER_VERSION, PROSA_SCHEMA_VERSION, type ParquetCompileSummary, type ParquetExportOptions, type ParquetExportResult, type ParquetTable, type ProviderCompileSummary, type RegisterResult, type SearchEngine, type SearchHit, type SearchIndexStatus, type SearchOptions, type SessionDetail, type SessionDetailEvent, type SessionListFilters, type SessionRow, type SessionRowFull, type SourceFileRow, type SourceTool, type TantivyCompileSummary, type ToolCallStatus, closeBundle, compileClaude, compileCodex, compileCursor, compileGemini, countSessions, currentSchemaVersion, defaultBundlePath, disableFts5Triggers, emptyCounts, enableFts5Triggers, exportBundleParquet, exportCompileParquet, exportSessionMarkdown, finishBatch, getBytes, getCompileProvider, getJson, getObjectMeta, getSearchIndexStatus, getSearchIndexStatuses, getSession, getText, initBundle, listSessions, markIndexesAfterImport, openBundle, putBytes, putJson, putText, queryDuckDbParquet, rebuildFts5Index, rebuildTantivyIndex, recordError, registerSourceFile, resolveCompilePath, runCompileImports, runMigrations, searchFullText, startBatch };
|